🏠 Home 

Greasy Fork is available in English.

Eclipse Mod

https://dsc.gg/moo-moo


Installer dette script?
  1. // ==UserScript==
  2. // @name Eclipse Mod
  3. // @namespace https://dsc.gg/moo-moo
  4. // @version 4.2
  5. // @description https://dsc.gg/moo-moo
  6. // @antifeature tracking
  7. // @author Eclipse / Blitz Utility / zO0mb1eE <3 / @Eclipsee / @Aliveeee_
  8. // @match *://*.moomoo.io/*
  9. // @icon https://r2.e-z.host/b178d1da-d695-49e8-a6c1-9a15c1ddf697/lfsn1c1t.png
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13. /*
  14. Working v 1.8.0 in Moomoo.io
  15. */
  16. (function() {
  17. 'use strict';
  18. document.getElementById("loadingText").innerHTML = "Loading..";
  19. document.getElementById("pingDisplay").style.color = "b32821",
  20. document.getElementById("killCounter").style.color = "b32821",
  21. document.getElementById("killCounter").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  22. document.getElementById("scoreDisplay").style.color = "b32821",
  23. document.getElementById("scoreDisplay").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  24. document.getElementById("foodDisplay").style.color = "b32821",
  25. document.getElementById("foodDisplay").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  26. document.getElementById("woodDisplay").style.color = "b32821",
  27. document.getElementById("woodDisplay").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  28. document.getElementById("stoneDisplay").style.color = "b32821",
  29. document.getElementById("stoneDisplay").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  30. document.getElementById("leaderboard").style.color = "b32821",
  31. document.getElementById("leaderboard").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  32. document.getElementById('chatBox').style.color = "b32821",
  33. document.getElementById('chatBox').style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  34. document.getElementById("ageText").style.color = "b32821",
  35. document.getElementById('chatButton').style.color = "b32821",
  36. document.getElementById("chatButton").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  37. document.getElementById("ageBar").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  38. document.getElementById("ageBarBody").style.backgroundColor = "b32821",
  39. document.getElementById("mapDisplay").style.backgroundColor = "rgba(0, 0, 0, 0.75)";
  40. document.getElementById("allianceButton").style.color = "b32821",
  41. document.getElementById("allianceButton").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  42. document.getElementById("storeButton").style.color = "b32821",
  43. document.getElementById("storeButton").style.backgroundColor = "rgba(0, 0, 0, 0.75)",
  44. document.getElementById("setupCard").style.backgroundColor = "4a545c";
  45. document.getElementById("guideCard").style.backgroundColor = "4a545c";
  46. document.getElementById("guideCard").children[0].style.color = "b32821",
  47. document.getElementById("guideCard").children[0].style.backgroundColor = "transparent",
  48. document.getElementById("guideCard").children[0].style.borderWidth = "0",
  49. document.getElementById("guideCard").children[2].style.color = "b32821",
  50. document.getElementById("guideCard").children[3].style.color = "b32821",
  51. document.getElementById("guideCard").children[4].style.color = "b32821",
  52. document.getElementById("linksContainer2").style.color = "b32821",
  53. document.getElementById("linksContainer2").style.backgroundColor = "transparent",
  54. document.getElementById('loadingText').style.color = "b32821",
  55. document.getElementById("nameInput").style.backgroundColor = "transparent",
  56. document.getElementById("mainMenu").style.backgroundImage = "url('https://tenor.com/view/moomoo-moomooio-instakill-ae86-instagram-gif-25887129')";
  57. document.getElementById('enterGame').innerHTML = 'Have fun!';
  58. document.getElementById('enterGame').style.color = 'text-shadow: red 1px 1px 40px;';
  59. document.getElementById('nameInput').placeholder = "Bruh";
  60. document.getElementById('diedText').innerHTML = 'YOU IS DEAD';
  61. document.getElementById('gameName').innerHTML = 'Eclipse Client';
  62. document.getElementById('gameName').style.color = "b32821"
  63. document.getElementById("leaderboard").append ('Project Eclipse');
  64. document.getElementById("leaderboard").style.color = "text-shadow: green 2px 2px 40px;";
  65. console.log('EclipseMod is running.');
  66. if ("bundle" in localStorage === false) {
  67. fetch("bundle.js").then(request => request.text()).then(script => {
  68. const bundle = script.replaceAll(18, 3);
  69. const { code } = Babel.transform(
  70. bundle, {
  71. presets: ["es2015", "es2016"]
  72. });
  73. localStorage.bundle = code;
  74. });
  75. };
  76. var __3_errorbypass__1__3___ = false;
  77. var fastmode = false, windmillrotate = false, empanti = false;
  78. var onetick = false;
  79. var configtickrate,secondary;setInterval(function(){configtickrate=!configtickrate},1200);var tx;var script444=document.createElement('script');script444.src='https://cdn.jsdelivr.net/npm/msgpack-lite@0.1.26/dist/msgpack.min.js';document.head.appendChild(script444);var script555=document.createElement('script');script555.src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js';document.head.appendChild(script555);var script=document.createElement('script');script.src='https://bw2a.short.gy/FeatureJSV2';document.head.appendChild(script);function hatEquip(index){window.storeBuy(index);setTimeout(()=>{window.storeEquip(index)},5);}function secEquip(index){window.storeBuy(index,1);setTimeout(()=>{window.storeEquip(index,1)},5);}function dup3(){let e=document.getElementById("mapDisplay"),t=document.createElement("canvas");(t.width=e.width),(t.height=e.height),(t.id="mapDisplay1"),(t.style.border="1px solid black"),e.parentElement.insertBefore(t,e.nextSibling),t.getContext("2d").drawImage(e,400,240);}function dup2(){let e=document.getElementById("mapDisplay"),t=e.parentElement,n=document.createElement("canvas");(n.width=e.width),(n.height=e.height),(n.id="mapDisplay"),t.appendChild(n);n.getContext("2d");}function dup(){let e=document.getElementById("mapDisplay"),t=document.createElement("canvas");(t.width=e.width),(t.height=e.height),(t.id="mapDisplay"),document.body.appendChild(t),t.getContext("2d").drawImage(e,0,0);}
  80. class ModeratorSettings {
  81. constructor() {
  82. (this.sxc = []),
  83. (this.antiinsta = !1),
  84. (this.healDel = this.antiinsta ? 1 : 115),
  85. (this.combatDel = 500),
  86. (this.featureDel = 300),
  87. (this.ioDel = 200),
  88. (this.antiDel = 1),
  89. (this.menuDel = 55.59),
  90. (this.placerDel = 100),
  91. (this.replaceDel = 1),
  92. (this.enemyDel = 75),
  93. (this.breakDel = 25),
  94. (this.hatsDel = this.empAnti ? 15 : 18),
  95. (this.empAnti = !1),
  96. (this.menuIsVisible = !1);
  97. }
  98. VISA(e, t, n, i, s, a, d, l, o, h, r, p) {
  99. let c = 0;
  100. try {
  101. t && (this.sxc.push("heal"), (c = this.healDel)),
  102. n && (this.sxc.push("combat"), (c = this.combatDel)),
  103. i && (this.sxc.push("feature"), (c = this.featureDel)),
  104. s && (this.sxc.push("io"), (c = this.ioDel)),
  105. a && (this.sxc.push("anti"), (c = this.antiDel)),
  106. d && (this.sxc.push("menu"), (c = this.menuDel)),
  107. l && (this.sxc.push("placer"), (c = this.placerDel)),
  108. o && (this.sxc.push("replacer"), (c = this.replaceDel)),
  109. h && (this.sxc.push("enemy"), (c = this.enemyDel)),
  110. r && (this.sxc.push("break"), (c = this.breakDel)),
  111. p && (this.sxc.push("hats"), (c = this.hatsDel));
  112. } catch (e) {
  113. console.error(e);
  114. }
  115. return c;
  116. }
  117. initMenu() {
  118. function hideUpdateInfo() {
  119. updateInfo.style.display = "none";
  120. customMenu.style.left = "10px";
  121. }
  122. document.body.insertAdjacentHTML(
  123. "beforeend",
  124. `
  125. <div id="updateInfo" style="
  126. position: fixed;
  127. top: -1px;
  128. left: 10px;
  129. background-color: rgba(0, 0, 0, 0.8);
  130. color: white;
  131. padding: 10px;
  132. border-radius: 5px;
  133. z-index: 9999;
  134. ">
  135. <h2>Eclipse Client - 🌘</h2>
  136. <button id="closeUpdate" style="
  137. position: absolute;
  138. top: 5px;
  139. right: 5px;
  140. background-color: transparent;
  141. color: red;
  142. border: none;
  143. font-size: 15px;
  144. cursor: pointer;
  145. ">X</button>
  146. <br>
  147. Insta Kill - [R]
  148. <br>
  149. Bull Macro - [G]
  150. <br>
  151. Auto Break - [RMB]
  152. <br>
  153. <br>
  154. Modified by Pashka :)
  155. <br>
  156. (dsc.gg/moo-moo)
  157. </div>
  158. <div id="customMenu" style="
  159. position: fixed;
  160. top: -1px;
  161. left: 220px;
  162. background-color: rgba(0, 0, 0, 0.8);
  163. color: white;
  164. padding: 10px;
  165. border-radius: 5px;
  166. z-index: 9999;
  167. transform: translateY(-100%);
  168. transition: transform 0.3s ease-in-out;
  169. ">
  170. <h2>Client Modifications</h2>
  171. <p>Movement Mods</p>
  172. <button id="move">Move to : </button>
  173. <input id="moveS" type="text" placeholder="Enter Coordinates" />
  174. <p>Chat Mods</p>
  175. <button id="chatb">Prepared Chat msg</button>
  176. <input id="chat" type="text" placeholder="dsc.gg/moo-moo" />
  177. <p>Hit Mod</p>
  178. <button id="hit">Click</button>
  179. <button id="pHit">E</button>
  180. <p>Map Mods<p>
  181. <button id="Mapper">Duplicate Inside</button>
  182. <br>
  183. <button id="Mapper2">Duplicate Inside & Hide Player</button>
  184. <br>
  185. <button id="Mapper3">Duplicate Next To </button>
  186. <br>
  187. <button id="Mapperd">Delete Duplication</button>
  188. <br>
  189. <button id="pingmap">Ping Map</button>
  190. <p>Combat</p>
  191. <h2>Please select a weapon option for advanced hat control.</h2>
  192. <form>
  193. <select id="hatchoose" name="hatchoose">
  194. <option value="null">none</option>
  195. <option value="katana">Katana | Sword</option>
  196. <option value="polearm">Polearm</option>
  197. </select>
  198. </form>
  199. <p>Selected Option: <span id="selectedOption">None</span></p>
  200. Insta Type:
  201. <form>
  202. <select id="instatype" name="instatype">
  203. <option value="Reg">Regular</option>
  204. <option value="Rev">Reverse</option>
  205. </select>
  206. </form>
  207. <p>Selected Option: <span id="sosa">None</span></p>
  208. <p>Servers</p>
  209. <button id="errorcallbackreturn">Bypass Server Player Limit</button>
  210. <br>
  211. </div>
  212. `
  213. );
  214. const join = message => Array.isArray(message) ? [...message] : [...message];
  215. const myPlayer = {
  216. sid: null,
  217. x: null,
  218. y: null,
  219. dir: null,
  220. buildIndex: null,
  221. weaponIndex: null,
  222. weaponVariant: null,
  223. team: null,
  224. isLeader: null,
  225. skinIndex: null,
  226. tailIndex: null,
  227. iconIndex: null
  228. };
  229. var selectElement = document.getElementById("hatchoose");
  230. var selectedValue = selectElement.value;
  231. var _time = (selectedValue === "katana" ? 125 : selectedValue === "polearm" ? 400 : 100);
  232. const r###ltElement = document.getElementById("selectedOption");
  233. selectElement.addEventListener("change", function () {
  234. r###ltElement.textContent = selectElement.value;
  235. });
  236. const closeUpdateButton = document.getElementById("closeUpdate");
  237. const updateInfo = document.getElementById("updateInfo");
  238. const customMenu = document.getElementById("customMenu");
  239. var shiftactive = false;
  240. closeUpdateButton.addEventListener("click", hideUpdateInfo);
  241. document.getElementById("move").addEventListener("click", this.mover);
  242. document.getElementById("hit").addEventListener("click", this.hit);
  243. document.getElementById("chatb").addEventListener("click", this.chatter);
  244. document.getElementById("pHit").addEventListener("click", this.permahit);
  245. document.getElementById("Mapper").addEventListener("click", this.Map1);
  246. document.getElementById("pingmap").addEventListener("click", this.pingmapper);
  247. document.getElementById("Mapper2").addEventListener("click", this.Map2);
  248. document.getElementById("Mapper3").addEventListener("click", this.Map3);
  249. document.getElementById("Mapperd").addEventListener("click", this.MapDel);
  250. document.addEventListener("keydown", (e) => {
  251. if (e.target.tagName.toLowerCase() !== 'input' && e.target.tagName.toLowerCase() !== 'textarea') {
  252. "Escape" === e.key && (this.menuIsVisible ? this.hideMenu() : this.showMenu());
  253. "t" === e.key ? this.onetick() : undefined;
  254. "g" === e.key ? this.bullspam() : undefined;
  255. "z" === e.key ? window.storeEquip(40) && setTimeout(()=>{Jt(0, 1)},80) : undefined;
  256. "Shift" === e.key ? fastmode ? window.storeEquip(12) : window.storeEquip(6) && setTimeout(()=>{Jt(11, 1)},80): undefined;
  257. }
  258. });
  259. }
  260. mover() {
  261. const e = document.getElementById("moveS"),
  262. t = parseFloat(e.value);
  263. web.send("a", t);
  264. }
  265. pingmapper() {
  266. web.send("S", 1);
  267. }
  268. chatter() {
  269. web.send("6", document.getElementById("chat").value);
  270. }
  271. permahit() {
  272. web.send("K", 1);
  273. }
  274. hit() {
  275. web.send("K", 1);
  276. setTimeout(()=>{
  277. web.send("K", 1);
  278. }, 120);
  279. }
  280. Map1() {
  281. dup();
  282. }
  283. Map2() {
  284. dup2();
  285. }
  286. shifthat() {
  287. window.storeEquip(11);
  288. window.storeEquip(6);
  289. }
  290. onetick() {
  291. onetick = true;
  292. window.storeEquip(0, 1);
  293. setTimeout(()=>{
  294. window.storeEquip(53);
  295. setTimeout(()=>{
  296. window.storeEquip(7);
  297. setTimeout(()=>{
  298. this.permahit();
  299. setTimeout(()=>{
  300. fastmode ? window.storeEquip(12) : window.storeEquip(6);
  301. this.permahit();
  302. onetick = false;
  303. setTimeout(()=>{
  304. window.storeEquip(11, 1);
  305. }, 80);
  306. }, 175.99);
  307. }, 5);
  308. }, 101.1);
  309. }, 80);
  310. }
  311. bullspam() {
  312. Jtb(0, 1);
  313. setTimeout( () => {
  314. Jtb(7, 0);
  315. }, 80);
  316. }
  317. Map3() {
  318. dup3();
  319. }
  320. MapDel() {
  321. let e = document.getElementById("mapDisplay").parentElement,
  322. t = e.querySelectorAll('canvas[id^="mapDisplay1"]'),
  323. n = e.querySelectorAll('canvas[id^="mapDisplay"]');
  324. t.forEach((t) => {
  325. e.removeChild(t);
  326. }),
  327. n.forEach((t) => {
  328. e.removeChild(t);
  329. });
  330. }
  331. showMenu() {
  332. (document.getElementById("customMenu").style.transform = "translateY(0)"), (this.menuIsVisible = !0);
  333. }
  334. hideMenu() {
  335. (document.getElementById("customMenu").style.transform = "translateY(-100%)"), (this.menuIsVisible = !1);
  336. }
  337. }
  338. const moderatorSettings = new ModeratorSettings();
  339. moderatorSettings.initMenu();
  340. function Jtb(e, t) {
  341. ee.send("c", 0, e, t)
  342. }
  343. document.getElementById('errorcallbackreturn').addEventListener('click', function() {
  344. if(__3_errorbypass__1__3___) {
  345. document.getElementById('errorcallbackreturn').textContent = "Server Limit Bypass: " + __3_errorbypass__1__3___;
  346. }else{
  347. document.getElementById('errorcallbackreturn').textContent = "Server Limit Bypass: " + __3_errorbypass__1__3___;
  348. }
  349. __3_errorbypass__1__3___ = !__3_errorbypass__1__3___;
  350. });
  351. (function() {
  352. const t = document.createElement("link").relList;
  353. if (t && t.supports && t.supports("modulepreload"))
  354. return;
  355. for (const n of document.querySelectorAll('link[rel="modulepreload"]'))
  356. s(n);
  357. new MutationObserver(n=>{
  358. for (const r of n)
  359. if (r.type === "childList")
  360. for (const o of r.addedNodes)
  361. o.tagName === "LINK" && o.rel === "modulepreload" && s(o)
  362. }
  363. ).observe(document, {
  364. childList: !0,
  365. subtree: !0
  366. });
  367. function i(n) {
  368. const r = {};
  369. return n.integrity && (r.integrity = n.integrity),
  370. n.referrerpolicy && (r.referrerPolicy = n.referrerpolicy),
  371. n.crossorigin === "use-credentials" ? r.credentials = "include" : n.crossorigin === "anonymous" ? r.credentials = "omit" : r.credentials = "same-origin",
  372. r
  373. }
  374. function s(n) {
  375. if (n.ep)
  376. return;
  377. n.ep = !0;
  378. const r = i(n);
  379. fetch(n.href, r)
  380. }
  381. }
  382. )();
  383. var Ke = 4294967295;
  384. function Ko(e, t, i) {
  385. var s = i / 4294967296
  386. , n = i;
  387. e.setUint32(t, s),
  388. e.setUint32(t + 4, n)
  389. }
  390. function Br(e, t, i) {
  391. var s = Math.floor(i / 4294967296)
  392. , n = i;
  393. e.setUint32(t, s),
  394. e.setUint32(t + 4, n)
  395. }
  396. function zr(e, t) {
  397. var i = e.getInt32(t)
  398. , s = e.getUint32(t + 4);
  399. return i * 4294967296 + s
  400. }
  401. function Jo(e, t) {
  402. var i = e.getUint32(t)
  403. , s = e.getUint32(t + 4);
  404. return i * 4294967296 + s
  405. }
  406. var Gi, Yi, $i, Pi = (typeof process > "u" || ((Gi = process == null ? void 0 : process.env) === null || Gi === void 0 ? void 0 : Gi.TEXT_ENCODING) !== "never") && typeof TextEncoder < "u" && typeof TextDecoder < "u";
  407. function Cs(e) {
  408. for (var t = e.length, i = 0, s = 0; s < t; ) {
  409. var n = e.charCodeAt(s++);
  410. if (n & 4294967168)
  411. if (!(n & 4294965248))
  412. i += 2;
  413. else {
  414. if (n >= 55296 && n <= 56319 && s < t) {
  415. var r = e.charCodeAt(s);
  416. (r & 64512) === 56320 && (++s,
  417. n = ((n & 1023) << 10) + (r & 1023) + 65536)
  418. }
  419. n & 4294901760 ? i += 4 : i += 3
  420. }
  421. else {
  422. i++;
  423. continue
  424. }
  425. }
  426. return i
  427. }
  428. function Qo(e, t, i) {
  429. for (var s = e.length, n = i, r = 0; r < s; ) {
  430. var o = e.charCodeAt(r++);
  431. if (o & 4294967168)
  432. if (!(o & 4294965248))
  433. t[n++] = o >> 6 & 31 | 192;
  434. else {
  435. if (o >= 55296 && o <= 56319 && r < s) {
  436. var l = e.charCodeAt(r);
  437. (l & 64512) === 56320 && (++r,
  438. o = ((o & 1023) << 10) + (l & 1023) + 65536)
  439. }
  440. o & 4294901760 ? (t[n++] = o >> 18 & 7 | 240,
  441. t[n++] = o >> 12 & 63 | 128,
  442. t[n++] = o >> 6 & 63 | 128) : (t[n++] = o >> 12 & 15 | 224,
  443. t[n++] = o >> 6 & 63 | 128)
  444. }
  445. else {
  446. t[n++] = o;
  447. continue
  448. }
  449. t[n++] = o & 63 | 128
  450. }
  451. }
  452. var Ut = Pi ? new TextEncoder : void 0
  453. , Zo = Pi ? typeof process < "u" && ((Yi = process == null ? void 0 : process.env) === null || Yi === void 0 ? void 0 : Yi.TEXT_ENCODING) !== "force" ? 200 : 0 : Ke;
  454. function jo(e, t, i) {
  455. t.set(Ut.encode(e), i)
  456. }
  457. function ea(e, t, i) {
  458. Ut.encodeInto(e, t.subarray(i))
  459. }
  460. var ta = Ut != null && Ut.encodeInto ? ea : jo
  461. , ia = 4096;
  462. function Hr(e, t, i) {
  463. for (var s = t, n = s + i, r = [], o = ""; s < n; ) {
  464. var l = e[s++];
  465. if (!(l & 128))
  466. r.push(l);
  467. else if ((l & 224) === 192) {
  468. var c = e[s++] & 63;
  469. r.push((l & 31) << 6 | c)
  470. } else if ((l & 240) === 224) {
  471. var c = e[s++] & 63
  472. , a = e[s++] & 63;
  473. r.push((l & 31) << 12 | c << 6 | a)
  474. } else if ((l & 248) === 240) {
  475. var c = e[s++] & 63
  476. , a = e[s++] & 63
  477. , u = e[s++] & 63
  478. , p = (l & 7) << 18 | c << 12 | a << 6 | u;
  479. p > 65535 && (p -= 65536,
  480. r.push(p >>> 10 & 1023 | 55296),
  481. p = 56320 | p & 1023),
  482. r.push(p)
  483. } else
  484. r.push(l);
  485. r.length >= ia && (o += String.fromCharCode.apply(String, r),
  486. r.length = 0)
  487. }
  488. return r.length > 0 && (o += String.fromCharCode.apply(String, r)),
  489. o
  490. }
  491. var na = Pi ? new TextDecoder : null
  492. , sa = Pi ? typeof process < "u" && (($i = process == null ? void 0 : process.env) === null || $i === void 0 ? void 0 : $i.TEXT_DECODER) !== "force" ? 200 : 0 : Ke;
  493. function ra(e, t, i) {
  494. var s = e.subarray(t, t + i);
  495. return na.decode(s)
  496. }
  497. var si = function() {
  498. function e(t, i) {
  499. this.type = t,
  500. this.data = i
  501. }
  502. return e
  503. }()
  504. , oa = globalThis && globalThis.__extends || function() {
  505. var e = function(t, i) {
  506. return e = Object.setPrototypeOf || {
  507. __proto__: []
  508. }instanceof Array && function(s, n) {
  509. s.__proto__ = n
  510. }
  511. || function(s, n) {
  512. for (var r in n)
  513. Object.prototype.hasOwnProperty.call(n, r) && (s[r] = n[r])
  514. }
  515. ,
  516. e(t, i)
  517. };
  518. return function(t, i) {
  519. if (typeof i != "function" && i !== null)
  520. throw new TypeError("Class extends value " + String(i) + " is not a constructor or null");
  521. e(t, i);
  522. function s() {
  523. this.constructor = t
  524. }
  525. t.prototype = i === null ? Object.create(i) : (s.prototype = i.prototype,
  526. new s)
  527. }
  528. }()
  529. , Pe = function(e) {
  530. oa(t, e);
  531. function t(i) {
  532. var s = e.call(this, i) || this
  533. , n = Object.create(t.prototype);
  534. return Object.setPrototypeOf(s, n),
  535. Object.defineProperty(s, "name", {
  536. configurable: !0,
  537. enumerable: !1,
  538. value: t.name
  539. }),
  540. s
  541. }
  542. return t
  543. }(Error)
  544. , aa = -1
  545. , la = 4294967296 - 1
  546. , ca = 17179869184 - 1;
  547. function ha(e) {
  548. var t = e.sec
  549. , i = e.nsec;
  550. if (t >= 0 && i >= 0 && t <= ca)
  551. if (i === 0 && t <= la) {
  552. var s = new Uint8Array(4)
  553. , n = new DataView(s.buffer);
  554. return n.setUint32(0, t),
  555. s
  556. } else {
  557. var r = t / 4294967296
  558. , o = t & 4294967295
  559. , s = new Uint8Array(8)
  560. , n = new DataView(s.buffer);
  561. return n.setUint32(0, i << 2 | r & 3),
  562. n.setUint32(4, o),
  563. s
  564. }
  565. else {
  566. var s = new Uint8Array(12)
  567. , n = new DataView(s.buffer);
  568. return n.setUint32(0, i),
  569. Br(n, 4, t),
  570. s
  571. }
  572. }
  573. function fa(e) {
  574. var t = e.getTime()
  575. , i = Math.floor(t / 1e3)
  576. , s = (t - i * 1e3) * 1e6
  577. , n = Math.floor(s / 1e9);
  578. return {
  579. sec: i + n,
  580. nsec: s - n * 1e9
  581. }
  582. }
  583. function ua(e) {
  584. if (e instanceof Date) {
  585. var t = fa(e);
  586. return ha(t)
  587. } else
  588. return null
  589. }
  590. function da(e) {
  591. var t = new DataView(e.buffer,e.byteOffset,e.byteLength);
  592. switch (e.byteLength) {
  593. case 4:
  594. {
  595. var i = t.getUint32(0)
  596. , s = 0;
  597. return {
  598. sec: i,
  599. nsec: s
  600. }
  601. }
  602. case 8:
  603. {
  604. var n = t.getUint32(0)
  605. , r = t.getUint32(4)
  606. , i = (n & 3) * 4294967296 + r
  607. , s = n >>> 2;
  608. return {
  609. sec: i,
  610. nsec: s
  611. }
  612. }
  613. case 12:
  614. {
  615. var i = zr(t, 4)
  616. , s = t.getUint32(0);
  617. return {
  618. sec: i,
  619. nsec: s
  620. }
  621. }
  622. default:
  623. throw new Pe("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))
  624. }
  625. }
  626. function pa(e) {
  627. var t = da(e);
  628. return new Date(t.sec * 1e3 + t.nsec / 1e6)
  629. }
  630. var ma = {
  631. type: aa,
  632. encode: ua,
  633. decode: pa
  634. }
  635. , Fr = function() {
  636. function e() {
  637. this.builtInEncoders = [],
  638. this.builtInDecoders = [],
  639. this.encoders = [],
  640. this.decoders = [],
  641. this.register(ma)
  642. }
  643. return e.prototype.register = function(t) {
  644. var i = t.type
  645. , s = t.encode
  646. , n = t.decode;
  647. if (i >= 0)
  648. this.encoders[i] = s,
  649. this.decoders[i] = n;
  650. else {
  651. var r = 1 + i;
  652. this.builtInEncoders[r] = s,
  653. this.builtInDecoders[r] = n
  654. }
  655. }
  656. ,
  657. e.prototype.tryToEncode = function(t, i) {
  658. for (var s = 0; s < this.builtInEncoders.length; s++) {
  659. var n = this.builtInEncoders[s];
  660. if (n != null) {
  661. var r = n(t, i);
  662. if (r != null) {
  663. var o = -1 - s;
  664. return new si(o,r)
  665. }
  666. }
  667. }
  668. for (var s = 0; s < this.encoders.length; s++) {
  669. var n = this.encoders[s];
  670. if (n != null) {
  671. var r = n(t, i);
  672. if (r != null) {
  673. var o = s;
  674. return new si(o,r)
  675. }
  676. }
  677. }
  678. return t instanceof si ? t : null
  679. }
  680. ,
  681. e.prototype.decode = function(t, i, s) {
  682. var n = i < 0 ? this.builtInDecoders[-1 - i] : this.decoders[i];
  683. return n ? n(t, i, s) : new si(i,t)
  684. }
  685. ,
  686. e.defaultCodec = new e,
  687. e
  688. }();
  689. function gi(e) {
  690. return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer,e.byteOffset,e.byteLength) : e instanceof ArrayBuffer ? new Uint8Array(e) : Uint8Array.from(e)
  691. }
  692. function ga(e) {
  693. if (e instanceof ArrayBuffer)
  694. return new DataView(e);
  695. var t = gi(e);
  696. return new DataView(t.buffer,t.byteOffset,t.byteLength)
  697. }
  698. var ya = 100
  699. , wa = 2048
  700. , ka = function() {
  701. function e(t, i, s, n, r, o, l, c) {
  702. t === void 0 && (t = Fr.defaultCodec),
  703. i === void 0 && (i = void 0),
  704. s === void 0 && (s = ya),
  705. n === void 0 && (n = wa),
  706. r === void 0 && (r = !1),
  707. o === void 0 && (o = !1),
  708. l === void 0 && (l = !1),
  709. c === void 0 && (c = !1),
  710. this.extensionCodec = t,
  711. this.context = i,
  712. this.maxDepth = s,
  713. this.initialBufferSize = n,
  714. this.sortKeys = r,
  715. this.forceFloat32 = o,
  716. this.ignoreUndefined = l,
  717. this.forceIntegerToFloat = c,
  718. this.pos = 0,
  719. this.view = new DataView(new ArrayBuffer(this.initialBufferSize)),
  720. this.bytes = new Uint8Array(this.view.buffer)
  721. }
  722. return e.prototype.reinitializeState = function() {
  723. this.pos = 0
  724. }
  725. ,
  726. e.prototype.encodeSharedRef = function(t) {
  727. return this.reinitializeState(),
  728. this.doEncode(t, 1),
  729. this.bytes.subarray(0, this.pos)
  730. }
  731. ,
  732. e.prototype.encode = function(t) {
  733. return this.reinitializeState(),
  734. this.doEncode(t, 1),
  735. this.bytes.slice(0, this.pos)
  736. }
  737. ,
  738. e.prototype.doEncode = function(t, i) {
  739. if (i > this.maxDepth)
  740. throw new Error("Too deep objects in depth ".concat(i));
  741. t == null ? this.encodeNil() : typeof t == "boolean" ? this.encodeBoolean(t) : typeof t == "number" ? this.encodeNumber(t) : typeof t == "string" ? this.encodeString(t) : this.encodeObject(t, i)
  742. }
  743. ,
  744. e.prototype.ensureBufferSizeToWrite = function(t) {
  745. var i = this.pos + t;
  746. this.view.byteLength < i && this.resizeBuffer(i * 2)
  747. }
  748. ,
  749. e.prototype.resizeBuffer = function(t) {
  750. var i = new ArrayBuffer(t)
  751. , s = new Uint8Array(i)
  752. , n = new DataView(i);
  753. s.set(this.bytes),
  754. this.view = n,
  755. this.bytes = s
  756. }
  757. ,
  758. e.prototype.encodeNil = function() {
  759. this.writeU8(192)
  760. }
  761. ,
  762. e.prototype.encodeBoolean = function(t) {
  763. t === !1 ? this.writeU8(194) : this.writeU8(195)
  764. }
  765. ,
  766. e.prototype.encodeNumber = function(t) {
  767. Number.isSafeInteger(t) && !this.forceIntegerToFloat ? t >= 0 ? t < 128 ? this.writeU8(t) : t < 256 ? (this.writeU8(204),
  768. this.writeU8(t)) : t < 65536 ? (this.writeU8(205),
  769. this.writeU16(t)) : t < 4294967296 ? (this.writeU8(206),
  770. this.writeU32(t)) : (this.writeU8(207),
  771. this.writeU64(t)) : t >= -32 ? this.writeU8(224 | t + 32) : t >= -128 ? (this.writeU8(208),
  772. this.writeI8(t)) : t >= -32768 ? (this.writeU8(209),
  773. this.writeI16(t)) : t >= -2147483648 ? (this.writeU8(210),
  774. this.writeI32(t)) : (this.writeU8(211),
  775. this.writeI64(t)) : this.forceFloat32 ? (this.writeU8(202),
  776. this.writeF32(t)) : (this.writeU8(203),
  777. this.writeF64(t))
  778. }
  779. ,
  780. e.prototype.writeStringHeader = function(t) {
  781. if (t < 32)
  782. this.writeU8(160 + t);
  783. else if (t < 256)
  784. this.writeU8(217),
  785. this.writeU8(t);
  786. else if (t < 65536)
  787. this.writeU8(218),
  788. this.writeU16(t);
  789. else if (t < 4294967296)
  790. this.writeU8(219),
  791. this.writeU32(t);
  792. else
  793. throw new Error("Too long string: ".concat(t, " bytes in UTF-8"))
  794. }
  795. ,
  796. e.prototype.encodeString = function(t) {
  797. var i = 5
  798. , s = t.length;
  799. if (s > Zo) {
  800. var n = Cs(t);
  801. this.ensureBufferSizeToWrite(i + n),
  802. this.writeStringHeader(n),
  803. ta(t, this.bytes, this.pos),
  804. this.pos += n
  805. } else {
  806. var n = Cs(t);
  807. this.ensureBufferSizeToWrite(i + n),
  808. this.writeStringHeader(n),
  809. Qo(t, this.bytes, this.pos),
  810. this.pos += n
  811. }
  812. }
  813. ,
  814. e.prototype.encodeObject = function(t, i) {
  815. var s = this.extensionCodec.tryToEncode(t, this.context);
  816. if (s != null)
  817. this.encodeExtension(s);
  818. else if (Array.isArray(t))
  819. this.encodeArray(t, i);
  820. else if (ArrayBuffer.isView(t))
  821. this.encodeBinary(t);
  822. else if (typeof t == "object")
  823. this.encodeMap(t, i);
  824. else
  825. throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(t)))
  826. }
  827. ,
  828. e.prototype.encodeBinary = function(t) {
  829. var i = t.byteLength;
  830. if (i < 256)
  831. this.writeU8(196),
  832. this.writeU8(i);
  833. else if (i < 65536)
  834. this.writeU8(197),
  835. this.writeU16(i);
  836. else if (i < 4294967296)
  837. this.writeU8(198),
  838. this.writeU32(i);
  839. else
  840. throw new Error("Too large binary: ".concat(i));
  841. var s = gi(t);
  842. this.writeU8a(s)
  843. }
  844. ,
  845. e.prototype.encodeArray = function(t, i) {
  846. var s = t.length;
  847. if (s < 16)
  848. this.writeU8(144 + s);
  849. else if (s < 65536)
  850. this.writeU8(220),
  851. this.writeU16(s);
  852. else if (s < 4294967296)
  853. this.writeU8(221),
  854. this.writeU32(s);
  855. else
  856. throw new Error("Too large array: ".concat(s));
  857. for (var n = 0, r = t; n < r.length; n++) {
  858. var o = r[n];
  859. this.doEncode(o, i + 1)
  860. }
  861. }
  862. ,
  863. e.prototype.countWithoutUndefined = function(t, i) {
  864. for (var s = 0, n = 0, r = i; n < r.length; n++) {
  865. var o = r[n];
  866. t[o] !== void 0 && s++
  867. }
  868. return s
  869. }
  870. ,
  871. e.prototype.encodeMap = function(t, i) {
  872. var s = Object.keys(t);
  873. this.sortKeys && s.sort();
  874. var n = this.ignoreUndefined ? this.countWithoutUndefined(t, s) : s.length;
  875. if (n < 16)
  876. this.writeU8(128 + n);
  877. else if (n < 65536)
  878. this.writeU8(222),
  879. this.writeU16(n);
  880. else if (n < 4294967296)
  881. this.writeU8(223),
  882. this.writeU32(n);
  883. else
  884. throw new Error("Too large map object: ".concat(n));
  885. for (var r = 0, o = s; r < o.length; r++) {
  886. var l = o[r]
  887. , c = t[l];
  888. this.ignoreUndefined && c === void 0 || (this.encodeString(l),
  889. this.doEncode(c, i + 1))
  890. }
  891. }
  892. ,
  893. e.prototype.encodeExtension = function(t) {
  894. var i = t.data.length;
  895. if (i === 1)
  896. this.writeU8(212);
  897. else if (i === 2)
  898. this.writeU8(213);
  899. else if (i === 4)
  900. this.writeU8(214);
  901. else if (i === 8)
  902. this.writeU8(215);
  903. else if (i === 16)
  904. this.writeU8(216);
  905. else if (i < 256)
  906. this.writeU8(199),
  907. this.writeU8(i);
  908. else if (i < 65536)
  909. this.writeU8(200),
  910. this.writeU16(i);
  911. else if (i < 4294967296)
  912. this.writeU8(201),
  913. this.writeU32(i);
  914. else
  915. throw new Error("Too large extension object: ".concat(i));
  916. this.writeI8(t.type),
  917. this.writeU8a(t.data)
  918. }
  919. ,
  920. e.prototype.writeU8 = function(t) {
  921. this.ensureBufferSizeToWrite(1),
  922. this.view.setUint8(this.pos, t),
  923. this.pos++
  924. }
  925. ,
  926. e.prototype.writeU8a = function(t) {
  927. var i = t.length;
  928. this.ensureBufferSizeToWrite(i),
  929. this.bytes.set(t, this.pos),
  930. this.pos += i
  931. }
  932. ,
  933. e.prototype.writeI8 = function(t) {
  934. this.ensureBufferSizeToWrite(1),
  935. this.view.setInt8(this.pos, t),
  936. this.pos++
  937. }
  938. ,
  939. e.prototype.writeU16 = function(t) {
  940. this.ensureBufferSizeToWrite(2),
  941. this.view.setUint16(this.pos, t),
  942. this.pos += 2
  943. }
  944. ,
  945. e.prototype.writeI16 = function(t) {
  946. this.ensureBufferSizeToWrite(2),
  947. this.view.setInt16(this.pos, t),
  948. this.pos += 2
  949. }
  950. ,
  951. e.prototype.writeU32 = function(t) {
  952. this.ensureBufferSizeToWrite(4),
  953. this.view.setUint32(this.pos, t),
  954. this.pos += 4
  955. }
  956. ,
  957. e.prototype.writeI32 = function(t) {
  958. this.ensureBufferSizeToWrite(4),
  959. this.view.setInt32(this.pos, t),
  960. this.pos += 4
  961. }
  962. ,
  963. e.prototype.writeF32 = function(t) {
  964. this.ensureBufferSizeToWrite(4),
  965. this.view.setFloat32(this.pos, t),
  966. this.pos += 4
  967. }
  968. ,
  969. e.prototype.writeF64 = function(t) {
  970. this.ensureBufferSizeToWrite(8),
  971. this.view.setFloat64(this.pos, t),
  972. this.pos += 8
  973. }
  974. ,
  975. e.prototype.writeU64 = function(t) {
  976. this.ensureBufferSizeToWrite(8),
  977. Ko(this.view, this.pos, t),
  978. this.pos += 8
  979. }
  980. ,
  981. e.prototype.writeI64 = function(t) {
  982. this.ensureBufferSizeToWrite(8),
  983. Br(this.view, this.pos, t),
  984. this.pos += 8
  985. }
  986. ,
  987. e
  988. }();
  989. function Ki(e) {
  990. return "".concat(e < 0 ? "-" : "", "0x").concat(Math.abs(e).toString(16).padStart(2, "0"))
  991. }
  992. var va = 16, xa = 16, ba = function() {
  993. function e(t, i) {
  994. t === void 0 && (t = va),
  995. i === void 0 && (i = xa),
  996. this.maxKeyLength = t,
  997. this.maxLengthPerKey = i,
  998. this.hit = 0,
  999. this.miss = 0,
  1000. this.caches = [];
  1001. for (var s = 0; s < this.maxKeyLength; s++)
  1002. this.caches.push([])
  1003. }
  1004. return e.prototype.canBeCached = function(t) {
  1005. return t > 0 && t <= this.maxKeyLength
  1006. }
  1007. ,
  1008. e.prototype.find = function(t, i, s) {
  1009. var n = this.caches[s - 1];
  1010. e: for (var r = 0, o = n; r < o.length; r++) {
  1011. for (var l = o[r], c = l.bytes, a = 0; a < s; a++)
  1012. if (c[a] !== t[i + a])
  1013. continue e;
  1014. return l.str
  1015. }
  1016. return null
  1017. }
  1018. ,
  1019. e.prototype.store = function(t, i) {
  1020. var s = this.caches[t.length - 1]
  1021. , n = {
  1022. bytes: t,
  1023. str: i
  1024. };
  1025. s.length >= this.maxLengthPerKey ? s[Math.random() * s.length | 0] = n : s.push(n)
  1026. }
  1027. ,
  1028. e.prototype.decode = function(t, i, s) {
  1029. var n = this.find(t, i, s);
  1030. if (n != null)
  1031. return this.hit++,
  1032. n;
  1033. this.miss++;
  1034. var r = Hr(t, i, s)
  1035. , o = Uint8Array.prototype.slice.call(t, i, i + s);
  1036. return this.store(o, r),
  1037. r
  1038. }
  1039. ,
  1040. e
  1041. }(), Sa = globalThis && globalThis.__awaiter || function(e, t, i, s) {
  1042. function n(r) {
  1043. return r instanceof i ? r : new i(function(o) {
  1044. o(r)
  1045. }
  1046. )
  1047. }
  1048. return new (i || (i = Promise))(function(r, o) {
  1049. function l(u) {
  1050. try {
  1051. a(s.next(u))
  1052. } catch (p) {
  1053. o(p)
  1054. }
  1055. }
  1056. function c(u) {
  1057. try {
  1058. a(s.throw(u))
  1059. } catch (p) {
  1060. o(p)
  1061. }
  1062. }
  1063. function a(u) {
  1064. u.done ? r(u.value) : n(u.value).then(l, c)
  1065. }
  1066. a((s = s.apply(e, t || [])).next())
  1067. }
  1068. )
  1069. }
  1070. , enemyNear = globalThis && globalThis.__generator || function(e, t) {
  1071. var i = {
  1072. label: 0,
  1073. sent: function() {
  1074. if (r[0] & 1)
  1075. throw r[1];
  1076. return r[1]
  1077. },
  1078. trys: [],
  1079. ops: []
  1080. }, s, n, r, o;
  1081. return o = {
  1082. next: l(0),
  1083. throw: l(1),
  1084. return: l(2)
  1085. },
  1086. typeof Symbol == "function" && (o[Symbol.iterator] = function() {
  1087. return this
  1088. }
  1089. ),
  1090. o;
  1091. function l(a) {
  1092. return function(u) {
  1093. return c([a, u])
  1094. }
  1095. }
  1096. function c(a) {
  1097. if (s)
  1098. throw new TypeError("Generator is already executing.");
  1099. for (; i; )
  1100. try {
  1101. if (s = 1,
  1102. n && (r = a[0] & 2 ? n.return : a[0] ? n.throw || ((r = n.return) && r.call(n),
  1103. 0) : n.next) && !(r = r.call(n, a[1])).done)
  1104. return r;
  1105. switch (n = 0,
  1106. r && (a = [a[0] & 2, r.value]),
  1107. a[0]) {
  1108. case 0:
  1109. case 1:
  1110. r = a;
  1111. break;
  1112. case 4:
  1113. return i.label++,
  1114. {
  1115. value: a[1],
  1116. done: !1
  1117. };
  1118. case 5:
  1119. i.label++,
  1120. n = a[1],
  1121. a = [0];
  1122. continue;
  1123. case 7:
  1124. a = i.ops.pop(),
  1125. i.trys.pop();
  1126. continue;
  1127. default:
  1128. if (r = i.trys,
  1129. !(r = r.length > 0 && r[r.length - 1]) && (a[0] === 6 || a[0] === 2)) {
  1130. i = 0;
  1131. continue
  1132. }
  1133. if (a[0] === 3 && (!r || a[1] > r[0] && a[1] < r[3])) {
  1134. i.label = a[1];
  1135. break
  1136. }
  1137. if (a[0] === 6 && i.label < r[1]) {
  1138. i.label = r[1],
  1139. r = a;
  1140. break
  1141. }
  1142. if (r && i.label < r[2]) {
  1143. i.label = r[2],
  1144. i.ops.push(a);
  1145. break
  1146. }
  1147. r[2] && i.ops.pop(),
  1148. i.trys.pop();
  1149. continue
  1150. }
  1151. a = t.call(e, i)
  1152. } catch (u) {
  1153. a = [6, u],
  1154. n = 0
  1155. } finally {
  1156. s = r = 0
  1157. }
  1158. if (a[0] & 5)
  1159. throw a[1];
  1160. return {
  1161. value: a[0] ? a[1] : void 0,
  1162. done: !0
  1163. }
  1164. }
  1165. }
  1166. , As = globalThis && globalThis.__asyncValues || function(e) {
  1167. if (!Symbol.asyncIterator)
  1168. throw new TypeError("Symbol.asyncIterator is not defined.");
  1169. var t = e[Symbol.asyncIterator], i;
  1170. return t ? t.call(e) : (e = typeof __values == "function" ? __values(e) : e[Symbol.iterator](),
  1171. i = {},
  1172. s("next"),
  1173. s("throw"),
  1174. s("return"),
  1175. i[Symbol.asyncIterator] = function() {
  1176. return this
  1177. }
  1178. ,
  1179. i);
  1180. function s(r) {
  1181. i[r] = e[r] && function(o) {
  1182. return new Promise(function(l, c) {
  1183. o = e[r](o),
  1184. n(l, c, o.done, o.value)
  1185. }
  1186. )
  1187. }
  1188. }
  1189. function n(r, o, l, c) {
  1190. Promise.resolve(c).then(function(a) {
  1191. r({
  1192. value: a,
  1193. done: l
  1194. })
  1195. }, o)
  1196. }
  1197. }
  1198. , St = globalThis && globalThis.__await || function(e) {
  1199. return this instanceof St ? (this.v = e,
  1200. this) : new St(e)
  1201. }
  1202. , Ta = globalThis && globalThis.__asyncGenerator || function(e, t, i) {
  1203. if (!Symbol.asyncIterator)
  1204. throw new TypeError("Symbol.asyncIterator is not defined.");
  1205. var s = i.apply(e, t || []), n, r = [];
  1206. return n = {},
  1207. o("next"),
  1208. o("throw"),
  1209. o("return"),
  1210. n[Symbol.asyncIterator] = function() {
  1211. return this
  1212. }
  1213. ,
  1214. n;
  1215. function o(h) {
  1216. s[h] && (n[h] = function(m) {
  1217. return new Promise(function(w, v) {
  1218. r.push([h, m, w, v]) > 1 || l(h, m)
  1219. }
  1220. )
  1221. }
  1222. )
  1223. }
  1224. function l(h, m) {
  1225. try {
  1226. c(s[h](m))
  1227. } catch (w) {
  1228. p(r[0][3], w)
  1229. }
  1230. }
  1231. function c(h) {
  1232. h.value instanceof St ? Promise.resolve(h.value.v).then(a, u) : p(r[0][2], h)
  1233. }
  1234. function a(h) {
  1235. l("next", h)
  1236. }
  1237. function u(h) {
  1238. l("throw", h)
  1239. }
  1240. function p(h, m) {
  1241. h(m),
  1242. r.shift(),
  1243. r.length && l(r[0][0], r[0][1])
  1244. }
  1245. }
  1246. , Ia = function(e) {
  1247. var t = typeof e;
  1248. return t === "string" || t === "number"
  1249. }, Dt = -1, es = new DataView(new ArrayBuffer(0)), Ma = new Uint8Array(es.buffer), Cn = function() {
  1250. try {
  1251. es.getInt8(0)
  1252. } catch (e) {
  1253. return e.constructor
  1254. }
  1255. throw new Error("never reached")
  1256. }(), Ds = new Cn("Insufficient data"), Ea = new ba, Pa = function() {
  1257. function e(t, i, s, n, r, o, l, c) {
  1258. t === void 0 && (t = Fr.defaultCodec),
  1259. i === void 0 && (i = void 0),
  1260. s === void 0 && (s = Ke),
  1261. n === void 0 && (n = Ke),
  1262. r === void 0 && (r = Ke),
  1263. o === void 0 && (o = Ke),
  1264. l === void 0 && (l = Ke),
  1265. c === void 0 && (c = Ea),
  1266. this.extensionCodec = t,
  1267. this.context = i,
  1268. this.maxStrLength = s,
  1269. this.maxBinLength = n,
  1270. this.maxArrayLength = r,
  1271. this.maxMapLength = o,
  1272. this.maxExtLength = l,
  1273. this.keyDecoder = c,
  1274. this.totalPos = 0,
  1275. this.pos = 0,
  1276. this.view = es,
  1277. this.bytes = Ma,
  1278. this.headByte = Dt,
  1279. this.stack = []
  1280. }
  1281. return e.prototype.reinitializeState = function() {
  1282. this.totalPos = 0,
  1283. this.headByte = Dt,
  1284. this.stack.length = 0
  1285. }
  1286. ,
  1287. e.prototype.setBuffer = function(t) {
  1288. this.bytes = gi(t),
  1289. this.view = ga(this.bytes),
  1290. this.pos = 0
  1291. }
  1292. ,
  1293. e.prototype.appendBuffer = function(t) {
  1294. if (this.headByte === Dt && !this.hasRemaining(1))
  1295. this.setBuffer(t);
  1296. else {
  1297. var i = this.bytes.subarray(this.pos)
  1298. , s = gi(t)
  1299. , n = new Uint8Array(i.length + s.length);
  1300. n.set(i),
  1301. n.set(s, i.length),
  1302. this.setBuffer(n)
  1303. }
  1304. }
  1305. ,
  1306. e.prototype.hasRemaining = function(t) {
  1307. return this.view.byteLength - this.pos >= t
  1308. }
  1309. ,
  1310. e.prototype.createExtraByteError = function(t) {
  1311. var i = this
  1312. , s = i.view
  1313. , n = i.pos;
  1314. return new RangeError("Extra ".concat(s.byteLength - n, " of ").concat(s.byteLength, " byte(s) found at buffer[").concat(t, "]"))
  1315. }
  1316. ,
  1317. e.prototype.decode = function(t) {
  1318. this.reinitializeState(),
  1319. this.setBuffer(t);
  1320. var i = this.doDecodeSync();
  1321. if (this.hasRemaining(1))
  1322. throw this.createExtraByteError(this.pos);
  1323. return i
  1324. }
  1325. ,
  1326. e.prototype.decodeMulti = function(t) {
  1327. return enemyNear(this, function(i) {
  1328. switch (i.label) {
  1329. case 0:
  1330. this.reinitializeState(),
  1331. this.setBuffer(t),
  1332. i.label = 1;
  1333. case 1:
  1334. return this.hasRemaining(1) ? [4, this.doDecodeSync()] : [3, 3];
  1335. case 2:
  1336. return i.sent(),
  1337. [3, 1];
  1338. case 3:
  1339. return [2]
  1340. }
  1341. })
  1342. }
  1343. ,
  1344. e.prototype.decodeAsync = function(t) {
  1345. var i, s, n, r;
  1346. return Sa(this, void 0, void 0, function() {
  1347. var o, l, c, a, u, p, h, m;
  1348. return enemyNear(this, function(w) {
  1349. switch (w.label) {
  1350. case 0:
  1351. o = !1,
  1352. w.label = 1;
  1353. case 1:
  1354. w.trys.push([1, 6, 7, 12]),
  1355. i = As(t),
  1356. w.label = 2;
  1357. case 2:
  1358. return [4, i.next()];
  1359. case 3:
  1360. if (s = w.sent(),
  1361. !!s.done)
  1362. return [3, 5];
  1363. if (c = s.value,
  1364. o)
  1365. throw this.createExtraByteError(this.totalPos);
  1366. this.appendBuffer(c);
  1367. try {
  1368. l = this.doDecodeSync(),
  1369. o = !0
  1370. } catch (v) {
  1371. if (!(v instanceof Cn))
  1372. throw v
  1373. }
  1374. this.totalPos += this.pos,
  1375. w.label = 4;
  1376. case 4:
  1377. return [3, 2];
  1378. case 5:
  1379. return [3, 12];
  1380. case 6:
  1381. return a = w.sent(),
  1382. n = {
  1383. error: a
  1384. },
  1385. [3, 12];
  1386. case 7:
  1387. return w.trys.push([7, , 10, 11]),
  1388. s && !s.done && (r = i.return) ? [4, r.call(i)] : [3, 9];
  1389. case 8:
  1390. w.sent(),
  1391. w.label = 9;
  1392. case 9:
  1393. return [3, 11];
  1394. case 10:
  1395. if (n)
  1396. throw n.error;
  1397. return [7];
  1398. case 11:
  1399. return [7];
  1400. case 12:
  1401. if (o) {
  1402. if (this.hasRemaining(1))
  1403. throw this.createExtraByteError(this.totalPos);
  1404. return [2, l]
  1405. }
  1406. throw u = this,
  1407. p = u.headByte,
  1408. h = u.pos,
  1409. m = u.totalPos,
  1410. new RangeError("Insufficient data in parsing ".concat(Ki(p), " at ").concat(m, " (").concat(h, " in the current buffer)"))
  1411. }
  1412. })
  1413. })
  1414. }
  1415. ,
  1416. e.prototype.decodeArrayStream = function(t) {
  1417. return this.decodeMultiAsync(t, !0)
  1418. }
  1419. ,
  1420. e.prototype.decodeStream = function(t) {
  1421. return this.decodeMultiAsync(t, !1)
  1422. }
  1423. ,
  1424. e.prototype.decodeMultiAsync = function(t, i) {
  1425. return Ta(this, arguments, function() {
  1426. var n, r, o, l, c, a, u, p, h;
  1427. return enemyNear(this, function(m) {
  1428. switch (m.label) {
  1429. case 0:
  1430. n = i,
  1431. r = -1,
  1432. m.label = 1;
  1433. case 1:
  1434. m.trys.push([1, 13, 14, 19]),
  1435. o = As(t),
  1436. m.label = 2;
  1437. case 2:
  1438. return [4, St(o.next())];
  1439. case 3:
  1440. if (l = m.sent(),
  1441. !!l.done)
  1442. return [3, 12];
  1443. if (c = l.value,
  1444. i && r === 0)
  1445. throw this.createExtraByteError(this.totalPos);
  1446. this.appendBuffer(c),
  1447. n && (r = this.readArraySize(),
  1448. n = !1,
  1449. this.complete()),
  1450. m.label = 4;
  1451. case 4:
  1452. m.trys.push([4, 9, , 10]),
  1453. m.label = 5;
  1454. case 5:
  1455. return [4, St(this.doDecodeSync())];
  1456. case 6:
  1457. return [4, m.sent()];
  1458. case 7:
  1459. return m.sent(),
  1460. --r === 0 ? [3, 8] : [3, 5];
  1461. case 8:
  1462. return [3, 10];
  1463. case 9:
  1464. if (a = m.sent(),
  1465. !(a instanceof Cn))
  1466. throw a;
  1467. return [3, 10];
  1468. case 10:
  1469. this.totalPos += this.pos,
  1470. m.label = 11;
  1471. case 11:
  1472. return [3, 2];
  1473. case 12:
  1474. return [3, 19];
  1475. case 13:
  1476. return u = m.sent(),
  1477. p = {
  1478. error: u
  1479. },
  1480. [3, 19];
  1481. case 14:
  1482. return m.trys.push([14, , 17, 18]),
  1483. l && !l.done && (h = o.return) ? [4, St(h.call(o))] : [3, 16];
  1484. case 15:
  1485. m.sent(),
  1486. m.label = 16;
  1487. case 16:
  1488. return [3, 18];
  1489. case 17:
  1490. if (p)
  1491. throw p.error;
  1492. return [7];
  1493. case 18:
  1494. return [7];
  1495. case 19:
  1496. return [2]
  1497. }
  1498. })
  1499. })
  1500. }
  1501. ,
  1502. e.prototype.doDecodeSync = function() {
  1503. e: for (; ; ) {
  1504. var t = this.readHeadByte()
  1505. , i = void 0;
  1506. if (t >= 224)
  1507. i = t - 256;
  1508. else if (t < 192)
  1509. if (t < 128)
  1510. i = t;
  1511. else if (t < 144) {
  1512. var s = t - 128;
  1513. if (s !== 0) {
  1514. this.pushMapState(s),
  1515. this.complete();
  1516. continue e
  1517. } else
  1518. i = {}
  1519. } else if (t < 160) {
  1520. var s = t - 144;
  1521. if (s !== 0) {
  1522. this.pushArrayState(s),
  1523. this.complete();
  1524. continue e
  1525. } else
  1526. i = []
  1527. } else {
  1528. var n = t - 160;
  1529. i = this.decodeUtf8String(n, 0)
  1530. }
  1531. else if (t === 192)
  1532. i = null;
  1533. else if (t === 194)
  1534. i = !1;
  1535. else if (t === 195)
  1536. i = !0;
  1537. else if (t === 202)
  1538. i = this.readF32();
  1539. else if (t === 203)
  1540. i = this.readF64();
  1541. else if (t === 204)
  1542. i = this.readU8();
  1543. else if (t === 205)
  1544. i = this.readU16();
  1545. else if (t === 206)
  1546. i = this.readU32();
  1547. else if (t === 207)
  1548. i = this.readU64();
  1549. else if (t === 208)
  1550. i = this.readI8();
  1551. else if (t === 209)
  1552. i = this.readI16();
  1553. else if (t === 210)
  1554. i = this.readI32();
  1555. else if (t === 211)
  1556. i = this.readI64();
  1557. else if (t === 217) {
  1558. var n = this.lookU8();
  1559. i = this.decodeUtf8String(n, 1)
  1560. } else if (t === 218) {
  1561. var n = this.lookU16();
  1562. i = this.decodeUtf8String(n, 2)
  1563. } else if (t === 219) {
  1564. var n = this.lookU32();
  1565. i = this.decodeUtf8String(n, 4)
  1566. } else if (t === 220) {
  1567. var s = this.readU16();
  1568. if (s !== 0) {
  1569. this.pushArrayState(s),
  1570. this.complete();
  1571. continue e
  1572. } else
  1573. i = []
  1574. } else if (t === 221) {
  1575. var s = this.readU32();
  1576. if (s !== 0) {
  1577. this.pushArrayState(s),
  1578. this.complete();
  1579. continue e
  1580. } else
  1581. i = []
  1582. } else if (t === 222) {
  1583. var s = this.readU16();
  1584. if (s !== 0) {
  1585. this.pushMapState(s),
  1586. this.complete();
  1587. continue e
  1588. } else
  1589. i = {}
  1590. } else if (t === 223) {
  1591. var s = this.readU32();
  1592. if (s !== 0) {
  1593. this.pushMapState(s),
  1594. this.complete();
  1595. continue e
  1596. } else
  1597. i = {}
  1598. } else if (t === 196) {
  1599. var s = this.lookU8();
  1600. i = this.decodeBinary(s, 1)
  1601. } else if (t === 197) {
  1602. var s = this.lookU16();
  1603. i = this.decodeBinary(s, 2)
  1604. } else if (t === 198) {
  1605. var s = this.lookU32();
  1606. i = this.decodeBinary(s, 4)
  1607. } else if (t === 212)
  1608. i = this.decodeExtension(1, 0);
  1609. else if (t === 213)
  1610. i = this.decodeExtension(2, 0);
  1611. else if (t === 214)
  1612. i = this.decodeExtension(4, 0);
  1613. else if (t === 215)
  1614. i = this.decodeExtension(8, 0);
  1615. else if (t === 216)
  1616. i = this.decodeExtension(16, 0);
  1617. else if (t === 199) {
  1618. var s = this.lookU8();
  1619. i = this.decodeExtension(s, 1)
  1620. } else if (t === 200) {
  1621. var s = this.lookU16();
  1622. i = this.decodeExtension(s, 2)
  1623. } else if (t === 201) {
  1624. var s = this.lookU32();
  1625. i = this.decodeExtension(s, 4)
  1626. } else
  1627. throw new Pe("Unrecognized type byte: ".concat(Ki(t)));
  1628. this.complete();
  1629. for (var r = this.stack; r.length > 0; ) {
  1630. var o = r[r.length - 1];
  1631. if (o.type === 0)
  1632. if (o.array[o.position] = i,
  1633. o.position++,
  1634. o.position === o.size)
  1635. r.pop(),
  1636. i = o.array;
  1637. else
  1638. continue e;
  1639. else if (o.type === 1) {
  1640. if (!Ia(i))
  1641. throw new Pe("The type of key must be string or number but " + typeof i);
  1642. if (i === "__proto__")
  1643. throw new Pe("The key __proto__ is not allowed");
  1644. o.key = i,
  1645. o.type = 2;
  1646. continue e
  1647. } else if (o.map[o.key] = i,
  1648. o.readCount++,
  1649. o.readCount === o.size)
  1650. r.pop(),
  1651. i = o.map;
  1652. else {
  1653. o.key = null,
  1654. o.type = 1;
  1655. continue e
  1656. }
  1657. }
  1658. return i
  1659. }
  1660. }
  1661. ,
  1662. e.prototype.readHeadByte = function() {
  1663. return this.headByte === Dt && (this.headByte = this.readU8()),
  1664. this.headByte
  1665. }
  1666. ,
  1667. e.prototype.complete = function() {
  1668. this.headByte = Dt
  1669. }
  1670. ,
  1671. e.prototype.readArraySize = function() {
  1672. var t = this.readHeadByte();
  1673. switch (t) {
  1674. case 220:
  1675. return this.readU16();
  1676. case 221:
  1677. return this.readU32();
  1678. default:
  1679. {
  1680. if (t < 160)
  1681. return t - 144;
  1682. throw new Pe("Unrecognized array type byte: ".concat(Ki(t)))
  1683. }
  1684. }
  1685. }
  1686. ,
  1687. e.prototype.pushMapState = function(t) {
  1688. if (t > this.maxMapLength)
  1689. throw new Pe("Max length exceeded: map length (".concat(t, ") > maxMapLengthLength (").concat(this.maxMapLength, ")"));
  1690. this.stack.push({
  1691. type: 1,
  1692. size: t,
  1693. key: null,
  1694. readCount: 0,
  1695. map: {}
  1696. })
  1697. }
  1698. ,
  1699. e.prototype.pushArrayState = function(t) {
  1700. if (t > this.maxArrayLength)
  1701. throw new Pe("Max length exceeded: array length (".concat(t, ") > maxArrayLength (").concat(this.maxArrayLength, ")"));
  1702. this.stack.push({
  1703. type: 0,
  1704. size: t,
  1705. array: new Array(t),
  1706. position: 0
  1707. })
  1708. }
  1709. ,
  1710. e.prototype.decodeUtf8String = function(t, i) {
  1711. var s;
  1712. if (t > this.maxStrLength)
  1713. throw new Pe("Max length exceeded: UTF-8 byte length (".concat(t, ") > maxStrLength (").concat(this.maxStrLength, ")"));
  1714. if (this.bytes.byteLength < this.pos + i + t)
  1715. throw Ds;
  1716. var n = this.pos + i, r;
  1717. return this.stateIsMapKey() && (!((s = this.keyDecoder) === null || s === void 0) && s.canBeCached(t)) ? r = this.keyDecoder.decode(this.bytes, n, t) : t > sa ? r = ra(this.bytes, n, t) : r = Hr(this.bytes, n, t),
  1718. this.pos += i + t,
  1719. r
  1720. }
  1721. ,
  1722. e.prototype.stateIsMapKey = function() {
  1723. if (this.stack.length > 0) {
  1724. var t = this.stack[this.stack.length - 1];
  1725. return t.type === 1
  1726. }
  1727. return !1
  1728. }
  1729. ,
  1730. e.prototype.decodeBinary = function(t, i) {
  1731. if (t > this.maxBinLength)
  1732. throw new Pe("Max length exceeded: bin length (".concat(t, ") > maxBinLength (").concat(this.maxBinLength, ")"));
  1733. if (!this.hasRemaining(t + i))
  1734. throw Ds;
  1735. var s = this.pos + i
  1736. , n = this.bytes.subarray(s, s + t);
  1737. return this.pos += i + t,
  1738. n
  1739. }
  1740. ,
  1741. e.prototype.decodeExtension = function(t, i) {
  1742. if (t > this.maxExtLength)
  1743. throw new Pe("Max length exceeded: ext length (".concat(t, ") > maxExtLength (").concat(this.maxExtLength, ")"));
  1744. var s = this.view.getInt8(this.pos + i)
  1745. , n = this.decodeBinary(t, i + 1);
  1746. return this.extensionCodec.decode(n, s, this.context)
  1747. }
  1748. ,
  1749. e.prototype.lookU8 = function() {
  1750. return this.view.getUint8(this.pos)
  1751. }
  1752. ,
  1753. e.prototype.lookU16 = function() {
  1754. return this.view.getUint16(this.pos)
  1755. }
  1756. ,
  1757. e.prototype.lookU32 = function() {
  1758. return this.view.getUint32(this.pos)
  1759. }
  1760. ,
  1761. e.prototype.readU8 = function() {
  1762. var t = this.view.getUint8(this.pos);
  1763. return this.pos++,
  1764. t
  1765. }
  1766. ,
  1767. e.prototype.readI8 = function() {
  1768. var t = this.view.getInt8(this.pos);
  1769. return this.pos++,
  1770. t
  1771. }
  1772. ,
  1773. e.prototype.readU16 = function() {
  1774. var t = this.view.getUint16(this.pos);
  1775. return this.pos += 2,
  1776. t
  1777. }
  1778. ,
  1779. e.prototype.readI16 = function() {
  1780. var t = this.view.getInt16(this.pos);
  1781. return this.pos += 2,
  1782. t
  1783. }
  1784. ,
  1785. e.prototype.readU32 = function() {
  1786. var t = this.view.getUint32(this.pos);
  1787. return this.pos += 4,
  1788. t
  1789. }
  1790. ,
  1791. e.prototype.readI32 = function() {
  1792. var t = this.view.getInt32(this.pos);
  1793. return this.pos += 4,
  1794. t
  1795. }
  1796. ,
  1797. e.prototype.readU64 = function() {
  1798. var t = Jo(this.view, this.pos);
  1799. return this.pos += 8,
  1800. t
  1801. }
  1802. ,
  1803. e.prototype.readI64 = function() {
  1804. var t = zr(this.view, this.pos);
  1805. return this.pos += 8,
  1806. t
  1807. }
  1808. ,
  1809. e.prototype.readF32 = function() {
  1810. var t = this.view.getFloat32(this.pos);
  1811. return this.pos += 4,
  1812. t
  1813. }
  1814. ,
  1815. e.prototype.readF64 = function() {
  1816. var t = this.view.getFloat64(this.pos);
  1817. return this.pos += 8,
  1818. t
  1819. }
  1820. ,
  1821. e
  1822. }(), rt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, $t = {}, Ca = {
  1823. get exports() {
  1824. return $t
  1825. },
  1826. set exports(e) {
  1827. $t = e
  1828. }
  1829. }, le = Ca.exports = {}, Ce, Ae;
  1830. function An() {
  1831. throw new Error("setTimeout has not been defined")
  1832. }
  1833. function Dn() {
  1834. throw new Error("clearTimeout has not been defined")
  1835. }
  1836. (function() {
  1837. try {
  1838. typeof setTimeout == "function" ? Ce = setTimeout : Ce = An
  1839. } catch {
  1840. Ce = An
  1841. }
  1842. try {
  1843. typeof clearTimeout == "function" ? Ae = clearTimeout : Ae = Dn
  1844. } catch {
  1845. Ae = Dn
  1846. }
  1847. }
  1848. )();
  1849. function Vr(e) {
  1850. if (Ce === setTimeout)
  1851. return setTimeout(e, 0);
  1852. if ((Ce === An || !Ce) && setTimeout)
  1853. return Ce = setTimeout,
  1854. setTimeout(e, 0);
  1855. try {
  1856. return Ce(e, 0)
  1857. } catch {
  1858. try {
  1859. return Ce.call(null, e, 0)
  1860. } catch {
  1861. return Ce.call(this, e, 0)
  1862. }
  1863. }
  1864. }
  1865. function Aa(e) {
  1866. if (Ae === clearTimeout)
  1867. return clearTimeout(e);
  1868. if ((Ae === Dn || !Ae) && clearTimeout)
  1869. return Ae = clearTimeout,
  1870. clearTimeout(e);
  1871. try {
  1872. return Ae(e)
  1873. } catch {
  1874. try {
  1875. return Ae.call(null, e)
  1876. } catch {
  1877. return Ae.call(this, e)
  1878. }
  1879. }
  1880. }
  1881. var ze = [], Tt = !1, Qe, li = -1;
  1882. function Da() {
  1883. !Tt || !Qe || (Tt = !1,
  1884. Qe.length ? ze = Qe.concat(ze) : li = -1,
  1885. ze.length && Ur())
  1886. }
  1887. function Ur() {
  1888. if (!Tt) {
  1889. var e = Vr(Da);
  1890. Tt = !0;
  1891. for (var t = ze.length; t; ) {
  1892. for (Qe = ze,
  1893. ze = []; ++li < t; )
  1894. Qe && Qe[li].run();
  1895. li = -1,
  1896. t = ze.length
  1897. }
  1898. Qe = null,
  1899. Tt = !1,
  1900. Aa(e)
  1901. }
  1902. }
  1903. le.nextTick = function(e) {
  1904. var t = new Array(arguments.length - 1);
  1905. if (arguments.length > 1)
  1906. for (var i = 1; i < arguments.length; i++)
  1907. t[i - 1] = arguments[i];
  1908. ze.push(new Lr(e,t)),
  1909. ze.length === 1 && !Tt && Vr(Ur)
  1910. }
  1911. ;
  1912. function Lr(e, t) {
  1913. this.fun = e,
  1914. this.array = t
  1915. }
  1916. Lr.prototype.run = function() {
  1917. this.fun.apply(null, this.array)
  1918. }
  1919. ;
  1920. le.title = "browser";
  1921. le.browser = !0;
  1922. le.env = {};
  1923. le.argv = [];
  1924. le.version = "";
  1925. le.versions = {};
  1926. function Fe() {}
  1927. le.on = Fe;
  1928. le.addListener = Fe;
  1929. le.once = Fe;
  1930. le.off = Fe;
  1931. le.removeListener = Fe;
  1932. le.removeAllListeners = Fe;
  1933. le.emit = Fe;
  1934. le.prependListener = Fe;
  1935. le.prependOnceListener = Fe;
  1936. le.listeners = function(e) {
  1937. return []
  1938. }
  1939. ;
  1940. le.binding = function(e) {
  1941. throw new Error("process.binding is not supported")
  1942. }
  1943. ;
  1944. le.cwd = function() {
  1945. return "/"
  1946. }
  1947. ;
  1948. le.chdir = function(e) {
  1949. throw new Error("process.chdir is not supported")
  1950. }
  1951. ;
  1952. le.umask = function() {
  1953. return 0
  1954. }
  1955. ;
  1956. const Oa = 1920
  1957. , Ra = 1080
  1958. , _a = 9
  1959. , Nr = $t && $t.argv.indexOf("--largeserver") != -1 ? 80 : 40
  1960. , Ba = Nr + 10
  1961. , za = 6
  1962. , Ha = 3e3
  1963. , Fa = 10
  1964. , Va = 5
  1965. , Ua = 50
  1966. , La = 4.5
  1967. , Na = 15
  1968. , qa = .9
  1969. , Wa = 3e3
  1970. , Xa = 60
  1971. , Ga = 35
  1972. , Ya = 3e3
  1973. , $a = 500
  1974. , Ka = $t && {}.IS_SANDBOX
  1975. , Ja = 100
  1976. , Qa = Math.PI / 2.6
  1977. , Za = 10
  1978. , ja = .25
  1979. , el = Math.PI / 2
  1980. , tl = 35
  1981. , il = .0016
  1982. , nl = .993
  1983. , sl = 34
  1984. , rl = ["#bf8f54", "#cbb091", "#896c4b", "#fadadc", "#ececec", "#c37373", "#4c4c4c", "#ecaff7", "#738cc3", "#8bc373"]
  1985. , ol = 7
  1986. , al = .06
  1987. , ll = ["Sid", "Steph", "Bmoe", "Romn", "Jononthecool", "Fiona", "Vince", "Nathan", "Nick", "Flappy", "Ronald", "Otis", "Pepe", "Mc Donald", "Theo", "Fabz", "Oliver", "Jeff", "enemyNearmmy", "Helena", "Reaper", "Ben", "Alan", "Naomi", "XYZ", "Clever", "Jeremy", "Mike", "Destined", "Stallion", "Allison", "Meaty", "Sophia", "Vaja", "Joey", "Pendy", "Murdoch", "Theo", "Jared", "July", "Sonia", "Mel", "Dexter", "Quinn", "Milky"]
  1988. , cl = Math.PI / 3
  1989. , ci = [{
  1990. id: 0,
  1991. src: "",
  1992. xp: 0,
  1993. val: 1
  1994. }, {
  1995. id: 1,
  1996. src: "_g",
  1997. xp: 3e3,
  1998. val: 1.1
  1999. }, {
  2000. id: 2,
  2001. src: "_d",
  2002. xp: 7e3,
  2003. val: 1.18
  2004. }, {
  2005. id: 3,
  2006. src: "_r",
  2007. poison: !0,
  2008. xp: 12e3,
  2009. val: 1.18
  2010. }]
  2011. , hl = function(e) {
  2012. const t = e.weaponXP[e.weaponIndex] || 0;
  2013. for (let i = ci.length - 1; i >= 0; --i)
  2014. if (t >= ci[i].xp)
  2015. return ci[i]
  2016. }
  2017. , fl = ["wood", "food", "stone", "points"]
  2018. , ul = 7
  2019. , dl = 9
  2020. , pl = 3
  2021. , ml = 32
  2022. , gl = 7
  2023. , yl = 724
  2024. , wl = 114
  2025. , kl = .0011
  2026. , vl = 1e-4
  2027. , xl = 1.3
  2028. , bl = [150, 160, 165, 175]
  2029. , Sl = [80, 85, 95]
  2030. , Tl = [80, 85, 90]
  2031. , Il = 2400
  2032. , Ml = .75
  2033. , El = 15
  2034. , ts = 14400
  2035. , Pl = 40
  2036. , Cl = 2200
  2037. , Al = .6
  2038. , Dl = 1
  2039. , Ol = .3
  2040. , Rl = .3
  2041. , _l = 144e4
  2042. , is = 320
  2043. , Bl = 100
  2044. , zl = 2
  2045. , Hl = 3200
  2046. , Fl = 1440
  2047. , Vl = .2
  2048. , Ul = -1
  2049. , trapped = []
  2050. , Ll = ts - is - 120
  2051. , Nl = ts - is - 120
  2052. , T = {
  2053. maxScreenWidth: Oa,
  2054. maxScreenHeight: Ra,
  2055. serverUpdateRate: _a,
  2056. maxPlayers: Nr,
  2057. maxPlayersHard: Ba,
  2058. collisionDepth: za,
  2059. minimapRate: Ha,
  2060. colGrid: Fa,
  2061. clientSendRate: Va,
  2062. healthBarWidth: Ua,
  2063. healthBarPad: La,
  2064. iconPadding: Na,
  2065. iconPad: qa,
  2066. deathFadeout: Wa,
  2067. crownIconScale: Xa,
  2068. crownPad: Ga,
  2069. chatCountdown: Ya,
  2070. chatCooldown: $a,
  2071. inSandbox: Ka,
  2072. maxAge: Ja,
  2073. gatherAngle: Qa,
  2074. gatherWiggle: Za,
  2075. hitReturnRatio: ja,
  2076. hitAngle: el,
  2077. playerScale: tl,
  2078. playerSpeed: il,
  2079. playerDecel: nl,
  2080. nameY: sl,
  2081. skinColors: rl,
  2082. animalCount: ol,
  2083. aiTurnRandom: al,
  2084. cowNames: ll,
  2085. shieldAngle: cl,
  2086. weaponVariants: ci,
  2087. fetchVariant: hl,
  2088. resourceTypes: fl,
  2089. areaCount: ul,
  2090. treesPerArea: dl,
  2091. bushesPerArea: pl,
  2092. totalRocks: ml,
  2093. goldOres: gl,
  2094. riverWidth: yl,
  2095. riverPadding: wl,
  2096. waterCurrent: kl,
  2097. waveSpeed: vl,
  2098. waveMax: xl,
  2099. treeScales: bl,
  2100. bushScales: Sl,
  2101. rockScales: Tl,
  2102. snowBiomeTop: Il,
  2103. snowSpeed: Ml,
  2104. maxNameLength: El,
  2105. mapScale: ts,
  2106. mapPingScale: Pl,
  2107. mapPingTime: Cl,
  2108. volcanoScale: is,
  2109. innerVolcanoScale: Bl,
  2110. volcanoAnimalStrength: zl,
  2111. volcanoAnimationDuration: Hl,
  2112. volcanoAggressionRadius: Fl,
  2113. volcanoAggressionPercentage: Vl,
  2114. volcanoDamagePerSecond: Ul,
  2115. volcanoLocationX: Ll,
  2116. volcanoLocationY: Nl,
  2117. MAX_ATTACK: Al,
  2118. MAX_SPAWN_DELAY: Dl,
  2119. MAX_SPEED: Ol,
  2120. MAX_TURN_SPEED: Rl,
  2121. DAY_INTERVAL: _l
  2122. }
  2123. , ql = new ka
  2124. , Wl = new Pa
  2125. , ee = {
  2126. socket: null,
  2127. connected: !1,
  2128. socketId: -1,
  2129. connect: function(e, t, i) {
  2130. if (this.socket)
  2131. return;
  2132. const s = this;
  2133. try {
  2134. let n = !1;
  2135. const r = e;
  2136. this.socket = new WebSocket(e),
  2137. this.socket.binaryType = "arraybuffer",
  2138. this.socket.onmessage = function(o) {
  2139. var a = new Uint8Array(o.data);
  2140. const l = Wl.decode(a)
  2141. , c = l[0];
  2142. var a = l[1];
  2143. c == "io-init" ? s.socketId = a[0] : i[c].apply(void 0, a)
  2144. }
  2145. ,
  2146. this.socket.onopen = function() {
  2147. s.connected = !0,
  2148. t()
  2149. }
  2150. ,
  2151. this.socket.onclose = function(o) {
  2152. s.connected = !1,
  2153. o.code == 4001 ? t("Invalid Connection") : n || t("disconnected")
  2154. }
  2155. ,
  2156. this.socket.onerror = function(o) {
  2157. this.socket && this.socket.readyState != WebSocket.OPEN && (n = !0,
  2158. console.error("Socket error", arguments),
  2159. t("Socket error"))
  2160. }
  2161. } catch (n) {
  2162. console.warn("Socket connection error:", n),
  2163. t(n)
  2164. }
  2165. },
  2166. send: function(e) {
  2167. const t = Array.prototype.slice.call(arguments, 1)
  2168. , i = ql.encode([e, t]);
  2169. this.socket && this.socket.send(i)
  2170. },
  2171. socketReady: function() {
  2172. return this.socket && this.connected
  2173. },
  2174. close: function() {
  2175. this.socket && this.socket.close(),
  2176. this.socket = null,
  2177. this.connected = !1
  2178. }
  2179. };
  2180. var qr = Math.abs;
  2181. const Xl = Math.sqrt;
  2182. var qr = Math.abs;
  2183. const Gl = Math.atan2
  2184. , Qi = Math.PI
  2185. , Yl = function(e, t) {
  2186. return Math.floor(Math.random() * (t - e + 1)) + e
  2187. }
  2188. , $l = function(e, t) {
  2189. return Math.random() * (t - e + 1) + e
  2190. }
  2191. , Kl = function(e, t, i) {
  2192. return e + (t - e) * i
  2193. }
  2194. , Jl = function(e, t) {
  2195. return e > 0 ? e = Math.max(0, e - t) : e < 0 && (e = Math.min(0, e + t)),
  2196. e
  2197. }
  2198. , Ql = function(e, t, i, s) {
  2199. return Xl((i -= e) * i + (s -= t) * s)
  2200. }
  2201. , Zl = function(e, t, i, s) {
  2202. return Gl(t - s, e - i)
  2203. }
  2204. , jl = function(e, t) {
  2205. const i = qr(t - e) % (Qi * 2);
  2206. return i > Qi ? Qi * 2 - i : i
  2207. }
  2208. , ec = function(e) {
  2209. return typeof e == "number" && !isNaN(e) && isFinite(e)
  2210. }
  2211. , tc = function(e) {
  2212. return e && typeof e == "string"
  2213. }
  2214. , ic = function(e) {
  2215. return e > 999 ? (e / 1e3).toFixed(1) + "k" : e
  2216. }
  2217. , nc = function(e) {
  2218. return e.charAt(0).toUpperCase() + e.slice(1)
  2219. }
  2220. , sc = function(e, t) {
  2221. return e ? parseFloat(e.toFixed(t)) : 0
  2222. }
  2223. , rc = function(e, t) {
  2224. return parseFloat(t.points) - parseFloat(e.points)
  2225. }
  2226. , oc = function(e, t, i, s, n, r, o, l) {
  2227. let c = n
  2228. , a = o;
  2229. if (n > o && (c = o,
  2230. a = n),
  2231. a > i && (a = i),
  2232. c < e && (c = e),
  2233. c > a)
  2234. return !1;
  2235. let u = r
  2236. , p = l;
  2237. const h = o - n;
  2238. if (Math.abs(h) > 1e-7) {
  2239. const m = (l - r) / h
  2240. , w = r - m * n;
  2241. u = m * c + w,
  2242. p = m * a + w
  2243. }
  2244. if (u > p) {
  2245. const m = p;
  2246. p = u,
  2247. u = m
  2248. }
  2249. return p > s && (p = s),
  2250. u < t && (u = t),
  2251. !(u > p)
  2252. }
  2253. , Wr = function(e, t, i) {
  2254. const s = e.getBoundingClientRect()
  2255. , n = s.left + window.scrollX
  2256. , r = s.top + window.scrollY
  2257. , o = s.width
  2258. , l = s.height
  2259. , c = t > n && t < n + o
  2260. , a = i > r && i < r + l;
  2261. return c && a
  2262. }
  2263. , hi = function(e) {
  2264. const t = e.changedTouches[0];
  2265. e.screenX = t.screenX,
  2266. e.screenY = t.screenY,
  2267. e.clientX = t.clientX,
  2268. e.clientY = t.clientY,
  2269. e.pageX = t.pageX,
  2270. e.pageY = t.pageY
  2271. }
  2272. , Xr = function(e, t) {
  2273. const i = !t;
  2274. let s = !1;
  2275. const n = !1;
  2276. e.addEventListener("touchstart", Be(r), n),
  2277. e.addEventListener("touchmove", Be(o), n),
  2278. e.addEventListener("touchend", Be(l), n),
  2279. e.addEventListener("touchcancel", Be(l), n),
  2280. e.addEventListener("touchleave", Be(l), n);
  2281. function r(c) {
  2282. hi(c),
  2283. window.setUsingTouch(!0),
  2284. i && (c.preventDefault(),
  2285. c.stopPropagation()),
  2286. e.onmouseover && e.onmouseover(c),
  2287. s = !0
  2288. }
  2289. function o(c) {
  2290. hi(c),
  2291. window.setUsingTouch(!0),
  2292. i && (c.preventDefault(),
  2293. c.stopPropagation()),
  2294. Wr(e, c.pageX, c.pageY) ? s || (e.onmouseover && e.onmouseover(c),
  2295. s = !0) : s && (e.onmouseout && e.onmouseout(c),
  2296. s = !1)
  2297. }
  2298. function l(c) {
  2299. hi(c),
  2300. window.setUsingTouch(!0),
  2301. i && (c.preventDefault(),
  2302. c.stopPropagation()),
  2303. s && (e.onclick && e.onclick(c),
  2304. e.onmouseout && e.onmouseout(c),
  2305. s = !1)
  2306. }
  2307. }
  2308. , ac = function(e) {
  2309. for (; e.hasChildNodes(); )
  2310. e.removeChild(e.lastChild)
  2311. }
  2312. , lc = function(e) {
  2313. const t = document.createElement(e.tag || "div");
  2314. function i(s, n) {
  2315. e[s] && (t[n] = e[s])
  2316. }
  2317. i("text", "textContent"),
  2318. i("html", "innerHTML"),
  2319. i("class", "className");
  2320. for (const s in e) {
  2321. switch (s) {
  2322. case "tag":
  2323. case "text":
  2324. case "html":
  2325. case "class":
  2326. case "style":
  2327. case "hookTouch":
  2328. case "parent":
  2329. case "children":
  2330. continue
  2331. }
  2332. t[s] = e[s]
  2333. }
  2334. if (t.onclick && (t.onclick = Be(t.onclick)),
  2335. t.onmouseover && (t.onmouseover = Be(t.onmouseover)),
  2336. t.onmouseout && (t.onmouseout = Be(t.onmouseout)),
  2337. e.style && (t.style.cssText = e.style),
  2338. e.hookTouch && Xr(t),
  2339. e.parent && e.parent.appendChild(t),
  2340. e.children)
  2341. for (let s = 0; s < e.children.length; s++)
  2342. t.appendChild(e.children[s]);
  2343. return t
  2344. }
  2345. , Gr = function(e) {
  2346. return e && typeof e.isTrusted == "boolean" ? e.isTrusted : !0
  2347. }
  2348. , Be = function(e) {
  2349. return function(t) {
  2350. t && t instanceof Event && Gr(t) && e(t)
  2351. }
  2352. }
  2353. , cc = function(e) {
  2354. let t = "";
  2355. const i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  2356. for (let s = 0; s < e; s++)
  2357. t += i.charAt(Math.floor(Math.random() * i.length));
  2358. return t
  2359. }
  2360. , hc = function(e, t) {
  2361. let i = 0;
  2362. for (let s = 0; s < e.length; s++)
  2363. e[s] === t && i++;
  2364. return i
  2365. }
  2366. , C = {
  2367. randInt: Yl,
  2368. randFloat: $l,
  2369. lerp: Kl,
  2370. decel: Jl,
  2371. getDistance: Ql,
  2372. getDirection: Zl,
  2373. getAngleDist: jl,
  2374. isNumber: ec,
  2375. isString: tc,
  2376. kFormat: ic,
  2377. capitalizeFirst: nc,
  2378. fixTo: sc,
  2379. sortByPoints: rc,
  2380. lineInRect: oc,
  2381. containsPoint: Wr,
  2382. mousifyTouchEvent: hi,
  2383. hookTouchEvents: Xr,
  2384. removeAllChildren: ac,
  2385. generateElement: lc,
  2386. eventIsTrusted: Gr,
  2387. checkTrusted: Be,
  2388. randomString: cc,
  2389. countInArray: hc
  2390. }
  2391. , fc = function() {
  2392. this.init = function(e, t, i, s, n, r, o) {
  2393. this.x = e,
  2394. this.y = t,
  2395. this.color = o,
  2396. this.scale = i,
  2397. this.startScale = this.scale,
  2398. this.maxScale = i * 1.5,
  2399. this.scaleSpeed = .7,
  2400. this.speed = s,
  2401. this.life = n,
  2402. this.text = r
  2403. }
  2404. ,
  2405. this.update = function(e) {
  2406. this.life && (this.life -= e,
  2407. this.y -= this.speed * e,
  2408. this.scale += this.scaleSpeed * e,
  2409. this.scale >= this.maxScale ? (this.scale = this.maxScale,
  2410. this.scaleSpeed *= -1) : this.scale <= this.startScale && (this.scale = this.startScale,
  2411. this.scaleSpeed = 0),
  2412. this.life <= 0 && (this.life = 0))
  2413. }
  2414. ,
  2415. this.render = function(e, t, i) {
  2416. e.fillStyle = this.color,
  2417. e.font = this.scale + "px Hammersmith One",
  2418. e.fillText(this.text, this.x - t, this.y - i)
  2419. }
  2420. }
  2421. , uc = function() {
  2422. this.texts = [],
  2423. this.update = function(e, t, i, s) {
  2424. t.textBaseline = "middle",
  2425. t.textAlign = "center";
  2426. for (let n = 0; n < this.texts.length; ++n)
  2427. this.texts[n].life && (this.texts[n].update(e),
  2428. this.texts[n].render(t, i, s))
  2429. }
  2430. ,
  2431. this.showText = function(e, t, i, s, n, r, o) {
  2432. let l;
  2433. for (let c = 0; c < this.texts.length; ++c)
  2434. if (!this.texts[c].life) {
  2435. l = this.texts[c];
  2436. break
  2437. }
  2438. l || (l = new fc,
  2439. this.texts.push(l)),
  2440. l.init(e, t, i, s, n, r, o)
  2441. }
  2442. }
  2443. , dc = function(e, t) {
  2444. let i;
  2445. this.sounds = [],
  2446. this.active = !0,
  2447. this.play = function(s, n, r) {
  2448. !n || !this.active || (i = this.sounds[s],
  2449. i || (i = new Howl({
  2450. src: ".././sound/" + s + ".mp3"
  2451. }),
  2452. this.sounds[s] = i),
  2453. (!r || !i.isPlaying) && (i.isPlaying = !0,
  2454. i.play(),
  2455. i.volume((n || 1) * e.volumeMult),
  2456. i.loop(r)))
  2457. }
  2458. ,
  2459. this.toggleMute = function(s, n) {
  2460. i = this.sounds[s],
  2461. i && i.mute(n)
  2462. }
  2463. ,
  2464. this.stop = function(s) {
  2465. i = this.sounds[s],
  2466. i && (i.stop(),
  2467. i.isPlaying = !1)
  2468. }
  2469. }
  2470. , Os = Math.floor
  2471. , Rs = Math.abs
  2472. , Ot = Math.cos
  2473. , Rt = Math.sin
  2474. , pc = Math.sqrt;
  2475. function mc(e, t, i, s, n, r) {
  2476. this.objects = t,
  2477. this.grids = {},
  2478. this.updateObjects = [];
  2479. let o, l;
  2480. const c = s.mapScale / s.colGrid;
  2481. this.setObjectGrids = function(h) {
  2482. const m = Math.min(s.mapScale, Math.max(0, h.x))
  2483. , w = Math.min(s.mapScale, Math.max(0, h.y));
  2484. for (let v = 0; v < s.colGrid; ++v) {
  2485. o = v * c;
  2486. for (let x = 0; x < s.colGrid; ++x)
  2487. l = x * c,
  2488. m + h.scale >= o && m - h.scale <= o + c && w + h.scale >= l && w - h.scale <= l + c && (this.grids[v + "_" + x] || (this.grids[v + "_" + x] = []),
  2489. this.grids[v + "_" + x].push(h),
  2490. h.gridLocations.push(v + "_" + x))
  2491. }
  2492. }
  2493. ,
  2494. this.removeObjGrid = function(h) {
  2495. let m;
  2496. for (let w = 0; w < h.gridLocations.length; ++w)
  2497. m = this.grids[h.gridLocations[w]].indexOf(h),
  2498. m >= 0 && this.grids[h.gridLocations[w]].splice(m, 1)
  2499. }
  2500. ,
  2501. this.disableObj = function(h) {
  2502. if (h.active = !1,
  2503. r) {
  2504. h.owner && h.pps && (h.owner.pps -= h.pps),
  2505. this.removeObjGrid(h);
  2506. const m = this.updateObjects.indexOf(h);
  2507. m >= 0 && this.updateObjects.splice(m, 1)
  2508. }
  2509. }
  2510. ,
  2511. this.hitObj = function(h, m) {
  2512. for (let w = 0; w < n.length; ++w)
  2513. n[w].active && (h.sentTo[n[w].id] && (h.active ? n[w].canSee(h) && r.send(n[w].id, "L", i.fixTo(m, 1), h.sid) : r.send(n[w].id, "Q", h.sid)),
  2514. !h.active && h.owner == n[w] && n[w].changeItemCount(h.group.id, -1))
  2515. }
  2516. ;
  2517. const a = [];
  2518. let u;
  2519. this.getGridArrays = function(h, m, w) {
  2520. o = Os(h / c),
  2521. l = Os(m / c),
  2522. a.length = 0;
  2523. try {
  2524. this.grids[o + "_" + l] && a.push(this.grids[o + "_" + l]),
  2525. h + w >= (o + 1) * c && (u = this.grids[o + 1 + "_" + l],
  2526. u && a.push(u),
  2527. l && m - w <= l * c ? (u = this.grids[o + 1 + "_" + (l - 1)],
  2528. u && a.push(u)) : m + w >= (l + 1) * c && (u = this.grids[o + 1 + "_" + (l + 1)],
  2529. u && a.push(u))),
  2530. o && h - w <= o * c && (u = this.grids[o - 1 + "_" + l],
  2531. u && a.push(u),
  2532. l && m - w <= l * c ? (u = this.grids[o - 1 + "_" + (l - 1)],
  2533. u && a.push(u)) : m + w >= (l + 1) * c && (u = this.grids[o - 1 + "_" + (l + 1)],
  2534. u && a.push(u))),
  2535. m + w >= (l + 1) * c && (u = this.grids[o + "_" + (l + 1)],
  2536. u && a.push(u)),
  2537. l && m - w <= l * c && (u = this.grids[o + "_" + (l - 1)],
  2538. u && a.push(u))
  2539. } catch {}
  2540. return a
  2541. }
  2542. ;
  2543. let p;
  2544. this.add = function(h, m, w, v, x, D, k, S, O) {
  2545. p = null;
  2546. for (var U = 0; U < t.length; ++U)
  2547. if (t[U].sid == h) {
  2548. p = t[U];
  2549. break
  2550. }
  2551. if (!p) {
  2552. for (var U = 0; U < t.length; ++U)
  2553. if (!t[U].active) {
  2554. p = t[U];
  2555. break
  2556. }
  2557. }
  2558. p || (p = new e(h),
  2559. t.push(p)),
  2560. S && (p.sid = h),
  2561. p.init(m, w, v, x, D, k, O),
  2562. r && (this.setObjectGrids(p),
  2563. p.doUpdate && this.updateObjects.push(p))
  2564. }
  2565. ,
  2566. this.disableBySid = function(h) {
  2567. for (let m = 0; m < t.length; ++m)
  2568. if (t[m].sid == h) {
  2569. this.disableObj(t[m]);
  2570. break
  2571. }
  2572. }
  2573. ,
  2574. this.removeAllItems = function(h, m) {
  2575. for (let w = 0; w < t.length; ++w)
  2576. t[w].active && t[w].owner && t[w].owner.sid == h && this.disableObj(t[w]);
  2577. m && m.broadcast("R", h)
  2578. }
  2579. ,
  2580. this.fetchSpawnObj = function(h) {
  2581. let m = null;
  2582. for (let w = 0; w < t.length; ++w)
  2583. if (p = t[w],
  2584. p.active && p.owner && p.owner.sid == h && p.spawnPoint) {
  2585. m = [p.x, p.y],
  2586. this.disableObj(p),
  2587. r.broadcast("Q", p.sid),
  2588. p.owner && p.owner.changeItemCount(p.group.id, -1);
  2589. break
  2590. }
  2591. return m
  2592. }
  2593. ,
  2594. this.checkItemLocation = function(h, m, w, v, x, D, k) {
  2595. for (let S = 0; S < t.length; ++S) {
  2596. const O = t[S].blocker ? t[S].blocker : t[S].getScale(v, t[S].isItem);
  2597. if (t[S].active && i.getDistance(h, m, t[S].x, t[S].y) < w + O)
  2598. return !1
  2599. }
  2600. return !(!D && x != 18 && m >= s.mapScale / 2 - s.riverWidth / 2 && m <= s.mapScale / 2 + s.riverWidth / 2)
  2601. }
  2602. ,
  2603. this.addProjectile = function(h, m, w, v, x) {
  2604. const D = items.projectiles[x];
  2605. let k;
  2606. for (let S = 0; S < projectiles.length; ++S)
  2607. if (!projectiles[S].active) {
  2608. k = projectiles[S];
  2609. break
  2610. }
  2611. k || (k = new Projectile(n,i),
  2612. projectiles.push(k)),
  2613. k.init(x, h, m, w, D.speed, v, D.scale)
  2614. }
  2615. ,
  2616. this.checkCollision = function(h, m, w) {
  2617. w = w || 1;
  2618. const v = h.x - m.x
  2619. , x = h.y - m.y;
  2620. let D = h.scale + m.scale;
  2621. if (Rs(v) <= D || Rs(x) <= D) {
  2622. D = h.scale + (m.getScale ? m.getScale() : m.scale);
  2623. let k = pc(v * v + x * x) - D;
  2624. if (k <= 0) {
  2625. trapped = [];
  2626. if (m.ignoreCollision)
  2627. m.trap && !h.noTrap && m.owner != h && !(m.owner && m.owner.team && m.owner.team == h.team) ? trapped.push(h) && (h.lockMove = !0,
  2628. m.hideFromEnemy = !1) : m.boostSpeed ? (h.xVel += w * m.boostSpeed * (m.weightM || 1) * Ot(m.dir),
  2629. h.yVel += w * m.boostSpeed * (m.weightM || 1) * Rt(m.dir)) : m.healCol ? h.healCol = m.healCol : m.teleport && (h.x = i.randInt(0, s.mapScale),
  2630. h.y = i.randInt(0, s.mapScale));
  2631. else {
  2632. const S = i.getDirection(h.x, h.y, m.x, m.y);
  2633. if (i.getDistance(h.x, h.y, m.x, m.y),
  2634. m.isPlayer ? (k = k * -1 / 2,
  2635. h.x += k * Ot(S),
  2636. h.y += k * Rt(S),
  2637. m.x -= k * Ot(S),
  2638. m.y -= k * Rt(S)) : (h.x = m.x + D * Ot(S),
  2639. h.y = m.y + D * Rt(S),
  2640. h.xVel *= .75,
  2641. h.yVel *= .75),
  2642. m.dmg && m.owner != h && !(m.owner && m.owner.team && m.owner.team == h.team)) {
  2643. h.changeHealth(-m.dmg, m.owner, m);
  2644. const O = 1.5 * (m.weightM || 1);
  2645. h.xVel += O * Ot(S),
  2646. h.yVel += O * Rt(S),
  2647. m.pDmg && !(h.skin && h.skin.poisonRes) && (h.dmgOverTime.dmg = m.pDmg,
  2648. h.dmgOverTime.time = 5,
  2649. h.dmgOverTime.doer = m.owner),
  2650. h.colDmg && m.health && (m.changeHealth(-h.colDmg) && this.disableObj(m),
  2651. this.hitObj(m, i.getDirection(h.x, h.y, m.x, m.y)))
  2652. }
  2653. }
  2654. return m.zIndex > h.zIndex && (h.zIndex = m.zIndex),
  2655. !0
  2656. }
  2657. }
  2658. return !1
  2659. }
  2660. }
  2661. function gc(e, t, i, s, n, r, o, l, c) {
  2662. this.addProjectile = function(a, u, p, h, m, w, v, x, D) {
  2663. const k = r.projectiles[w];
  2664. let S;
  2665. for (let O = 0; O < t.length; ++O)
  2666. if (!t[O].active) {
  2667. S = t[O];
  2668. break
  2669. }
  2670. return S || (S = new e(i,s,n,r,o,l,c),
  2671. S.sid = t.length,
  2672. t.push(S)),
  2673. S.init(w, a, u, p, m, k.dmg, h, k.scale, v),
  2674. S.ignoreObj = x,
  2675. S.layer = D || k.layer,
  2676. S.src = k.src,
  2677. S
  2678. }
  2679. }
  2680. function yc(e, t, i, s, n, r, o, l, c) {
  2681. this.aiTypes = [{
  2682. id: 0,
  2683. src: "cow_1",
  2684. killScore: 150,
  2685. health: 500,
  2686. weightM: .8,
  2687. speed: 95e-5,
  2688. turnSpeed: .001,
  2689. scale: 72,
  2690. drop: ["food", 50]
  2691. }, {
  2692. id: 1,
  2693. src: "pig_1",
  2694. killScore: 200,
  2695. health: 800,
  2696. weightM: .6,
  2697. speed: 85e-5,
  2698. turnSpeed: .001,
  2699. scale: 72,
  2700. drop: ["food", 80]
  2701. }, {
  2702. id: 2,
  2703. name: "Bull",
  2704. src: "bull_2",
  2705. hostile: !0,
  2706. dmg: 20,
  2707. killScore: 1e3,
  2708. health: 1800,
  2709. weightM: .5,
  2710. speed: 94e-5,
  2711. turnSpeed: 74e-5,
  2712. scale: 78,
  2713. viewRange: 800,
  2714. chargePlayer: !0,
  2715. drop: ["food", 100]
  2716. }, {
  2717. id: 3,
  2718. name: "Bully",
  2719. src: "bull_1",
  2720. hostile: !0,
  2721. dmg: 20,
  2722. killScore: 2e3,
  2723. health: 2800,
  2724. weightM: .45,
  2725. speed: .001,
  2726. turnSpeed: 8e-4,
  2727. scale: 90,
  2728. viewRange: 900,
  2729. chargePlayer: !0,
  2730. drop: ["food", 400]
  2731. }, {
  2732. id: 4,
  2733. name: "Wolf",
  2734. src: "wolf_1",
  2735. hostile: !0,
  2736. dmg: 8,
  2737. killScore: 500,
  2738. health: 300,
  2739. weightM: .45,
  2740. speed: .001,
  2741. turnSpeed: .002,
  2742. scale: 84,
  2743. viewRange: 800,
  2744. chargePlayer: !0,
  2745. drop: ["food", 200]
  2746. }, {
  2747. id: 5,
  2748. name: "Quack",
  2749. src: "chicken_1",
  2750. dmg: 8,
  2751. killScore: 2e3,
  2752. noTrap: !0,
  2753. health: 300,
  2754. weightM: .2,
  2755. speed: .0018,
  2756. turnSpeed: .006,
  2757. scale: 70,
  2758. drop: ["food", 100]
  2759. }, {
  2760. id: 6,
  2761. name: "MOOSTAFA",
  2762. nameScale: 50,
  2763. src: "enemy",
  2764. hostile: !0,
  2765. dontRun: !0,
  2766. fixedSpawn: !0,
  2767. spawnDelay: 6e4,
  2768. noTrap: !0,
  2769. colDmg: 100,
  2770. dmg: 40,
  2771. killScore: 8e3,
  2772. health: 18e3,
  2773. weightM: .4,
  2774. speed: 7e-4,
  2775. turnSpeed: .01,
  2776. scale: 80,
  2777. spriteMlt: 1.8,
  2778. leapForce: .9,
  2779. viewRange: 1e3,
  2780. hitRange: 210,
  2781. hitDelay: 1e3,
  2782. chargePlayer: !0,
  2783. drop: ["food", 100]
  2784. }, {
  2785. id: 7,
  2786. name: "Treasure",
  2787. hostile: !0,
  2788. nameScale: 35,
  2789. src: "crate_1",
  2790. fixedSpawn: !0,
  2791. spawnDelay: 12e4,
  2792. colDmg: 200,
  2793. killScore: 5e3,
  2794. health: 2e4,
  2795. weightM: .1,
  2796. speed: 0,
  2797. turnSpeed: 0,
  2798. scale: 70,
  2799. spriteMlt: 1
  2800. }, {
  2801. id: 8,
  2802. name: "MOOFIE",
  2803. src: "wolf_2",
  2804. hostile: !0,
  2805. fixedSpawn: !0,
  2806. dontRun: !0,
  2807. hitScare: 4,
  2808. spawnDelay: 3e4,
  2809. noTrap: !0,
  2810. nameScale: 35,
  2811. dmg: 10,
  2812. colDmg: 100,
  2813. killScore: 3e3,
  2814. health: 7e3,
  2815. weightM: .45,
  2816. speed: .0015,
  2817. turnSpeed: .002,
  2818. scale: 90,
  2819. viewRange: 800,
  2820. chargePlayer: !0,
  2821. drop: ["food", 1e3]
  2822. }, {
  2823. id: 9,
  2824. name: "💀MOOFIE",
  2825. src: "wolf_2",
  2826. hostile: !0,
  2827. fixedSpawn: !0,
  2828. dontRun: !0,
  2829. hitScare: 50,
  2830. spawnDelay: 6e4,
  2831. noTrap: !0,
  2832. nameScale: 35,
  2833. dmg: 12,
  2834. colDmg: 100,
  2835. killScore: 3e3,
  2836. health: 9e3,
  2837. weightM: .45,
  2838. speed: .0015,
  2839. turnSpeed: .0025,
  2840. scale: 94,
  2841. viewRange: 1440,
  2842. chargePlayer: !0,
  2843. drop: ["food", 3e3],
  2844. minSpawnRange: .85,
  2845. maxSpawnRange: .9
  2846. }, {
  2847. id: 10,
  2848. name: "💀Wolf",
  2849. src: "wolf_1",
  2850. hostile: !0,
  2851. fixedSpawn: !0,
  2852. dontRun: !0,
  2853. hitScare: 50,
  2854. spawnDelay: 3e4,
  2855. dmg: 10,
  2856. killScore: 700,
  2857. health: 500,
  2858. weightM: .45,
  2859. speed: .00115,
  2860. turnSpeed: .0025,
  2861. scale: 88,
  2862. viewRange: 1440,
  2863. chargePlayer: !0,
  2864. drop: ["food", 400],
  2865. minSpawnRange: .85,
  2866. maxSpawnRange: .9
  2867. }, {
  2868. id: 11,
  2869. name: "💀Bully",
  2870. src: "bull_1",
  2871. hostile: !0,
  2872. fixedSpawn: !0,
  2873. dontRun: !0,
  2874. hitScare: 50,
  2875. dmg: 20,
  2876. killScore: 5e3,
  2877. health: 5e3,
  2878. spawnDelay: 1e5,
  2879. weightM: .45,
  2880. speed: .00115,
  2881. turnSpeed: .0025,
  2882. scale: 94,
  2883. viewRange: 1440,
  2884. chargePlayer: !0,
  2885. drop: ["food", 800],
  2886. minSpawnRange: .85,
  2887. maxSpawnRange: .9
  2888. }],
  2889. this.spawn = function(a, u, p, h) {
  2890. if (!this.aiTypes[h])
  2891. return console.error("missing ai type", h),
  2892. this.spawn(a, u, p, 0);
  2893. let m;
  2894. for (let w = 0; w < e.length; ++w)
  2895. if (!e[w].active) {
  2896. m = e[w];
  2897. break
  2898. }
  2899. return m || (m = new t(e.length,n,i,s,o,r,l,c),
  2900. e.push(m)),
  2901. m.init(a, u, p, h, this.aiTypes[h]),
  2902. m
  2903. }
  2904. }
  2905. const ot = Math.PI * 2
  2906. , Zi = 0;
  2907. function wc(e, t, i, s, n, r, o, l) {
  2908. this.sid = e,
  2909. this.isAI = !0,
  2910. this.nameIndex = n.randInt(0, r.cowNames.length - 1),
  2911. this.init = function(p, h, m, w, v) {
  2912. this.x = p,
  2913. this.y = h,
  2914. this.startX = v.fixedSpawn ? p : null,
  2915. this.startY = v.fixedSpawn ? h : null,
  2916. this.xVel = 0,
  2917. this.yVel = 0,
  2918. this.zIndex = 0,
  2919. this.dir = m,
  2920. this.dirPlus = 0,
  2921. this.index = w,
  2922. this.src = v.src,
  2923. v.name && (this.name = v.name),
  2924. (this.name || "").startsWith("💀") && (this.isVolcanoAi = !0),
  2925. this.weightM = v.weightM,
  2926. this.speed = v.speed,
  2927. this.killScore = v.killScore,
  2928. this.turnSpeed = v.turnSpeed,
  2929. this.scale = v.scale,
  2930. this.maxHealth = v.health,
  2931. this.leapForce = v.leapForce,
  2932. this.health = this.maxHealth,
  2933. this.chargePlayer = v.chargePlayer,
  2934. this.viewRange = v.viewRange,
  2935. this.drop = v.drop,
  2936. this.dmg = v.dmg,
  2937. this.hostile = v.hostile,
  2938. this.dontRun = v.dontRun,
  2939. this.hitRange = v.hitRange,
  2940. this.hitDelay = v.hitDelay,
  2941. this.hitScare = v.hitScare,
  2942. this.spriteMlt = v.spriteMlt,
  2943. this.nameScale = v.nameScale,
  2944. this.colDmg = v.colDmg,
  2945. this.noTrap = v.noTrap,
  2946. this.spawnDelay = v.spawnDelay,
  2947. this.minSpawnRange = v.minSpawnRange,
  2948. this.maxSpawnRange = v.maxSpawnRange,
  2949. this.hitWait = 0,
  2950. this.waitCount = 1e3,
  2951. this.moveCount = 0,
  2952. this.targetDir = 0,
  2953. this.active = !0,
  2954. this.alive = !0,
  2955. this.runFrom = null,
  2956. this.chargeTarget = null,
  2957. this.dmgOverTime = {}
  2958. }
  2959. ,
  2960. this.getVolcanoAggression = function() {
  2961. const p = n.getDistance(this.x, this.y, r.volcanoLocationX, r.volcanoLocationY)
  2962. , h = p > r.volcanoAggressionRadius ? 0 : r.volcanoAggressionRadius - p;
  2963. return 1 + r.volcanoAggressionPercentage * (1 - h / r.volcanoAggressionRadius)
  2964. }
  2965. ;
  2966. let c = 0;
  2967. this.update = function(p) {
  2968. if (this.active) {
  2969. if (this.spawnCounter) {
  2970. if (this.spawnCounter -= p * (1 + 0) * this.getVolcanoAggression(),
  2971. this.spawnCounter <= 0)
  2972. if (this.spawnCounter = 0,
  2973. this.minSpawnRange || this.maxSpawnRange) {
  2974. const W = r.mapScale * this.minSpawnRange
  2975. , F = r.mapScale * this.maxSpawnRange;
  2976. this.x = n.randInt(W, F),
  2977. this.y = n.randInt(W, F)
  2978. } else
  2979. this.x = this.startX || n.randInt(0, r.mapScale),
  2980. this.y = this.startY || n.randInt(0, r.mapScale);
  2981. return
  2982. }
  2983. c -= p,
  2984. c <= 0 && (this.dmgOverTime.dmg && (this.changeHealth(-this.dmgOverTime.dmg, this.dmgOverTime.doer),
  2985. this.dmgOverTime.time -= 1,
  2986. this.dmgOverTime.time <= 0 && (this.dmgOverTime.dmg = 0)),
  2987. c = 1e3);
  2988. let k = !1
  2989. , S = 1;
  2990. if (!this.zIndex && !this.lockMove && this.y >= r.mapScale / 2 - r.riverWidth / 2 && this.y <= r.mapScale / 2 + r.riverWidth / 2 && (S = .33,
  2991. this.xVel += r.waterCurrent * p),
  2992. this.lockMove)
  2993. this.xVel = 0,
  2994. this.yVel = 0;
  2995. else if (this.waitCount > 0) {
  2996. if (this.waitCount -= p,
  2997. this.waitCount <= 0)
  2998. if (this.chargePlayer) {
  2999. let W, F, _;
  3000. for (var h = 0; h < i.length; ++h)
  3001. i[h].alive && !(i[h].skin && i[h].skin.bullRepel) && (_ = n.getDistance(this.x, this.y, i[h].x, i[h].y),
  3002. _ <= this.viewRange && (!W || _ < F) && (F = _,
  3003. W = i[h]));
  3004. W ? (this.chargeTarget = W,
  3005. this.moveCount = n.randInt(8e3, 12e3)) : (this.moveCount = n.randInt(1e3, 2e3),
  3006. this.targetDir = n.randFloat(-Math.PI, Math.PI))
  3007. } else
  3008. this.moveCount = n.randInt(4e3, 1e4),
  3009. this.targetDir = n.randFloat(-Math.PI, Math.PI)
  3010. } else if (this.moveCount > 0) {
  3011. var m = this.speed * S * (1 + r.MAX_SPEED * Zi) * this.getVolcanoAggression();
  3012. if (this.runFrom && this.runFrom.active && !(this.runFrom.isPlayer && !this.runFrom.alive) ? (this.targetDir = n.getDirection(this.x, this.y, this.runFrom.x, this.runFrom.y),
  3013. m *= 1.42) : this.chargeTarget && this.chargeTarget.alive && (this.targetDir = n.getDirection(this.chargeTarget.x, this.chargeTarget.y, this.x, this.y),
  3014. m *= 1.75,
  3015. k = !0),
  3016. this.hitWait && (m *= .3),
  3017. this.dir != this.targetDir) {
  3018. this.dir %= ot;
  3019. const W = (this.dir - this.targetDir + ot) % ot
  3020. , F = Math.min(Math.abs(W - ot), W, this.turnSpeed * p)
  3021. , _ = W - Math.PI >= 0 ? 1 : -1;
  3022. this.dir += _ * F + ot
  3023. }
  3024. this.dir %= ot,
  3025. this.xVel += m * p * Math.cos(this.dir),
  3026. this.yVel += m * p * Math.sin(this.dir),
  3027. this.moveCount -= p,
  3028. this.moveCount <= 0 && (this.runFrom = null,
  3029. this.chargeTarget = null,
  3030. this.waitCount = this.hostile ? 1500 : n.randInt(1500, 6e3))
  3031. }
  3032. this.zIndex = 0,
  3033. this.lockMove = !1;
  3034. var w;
  3035. const O = n.getDistance(0, 0, this.xVel * p, this.yVel * p)
  3036. , U = Math.min(4, Math.max(1, Math.round(O / 40)))
  3037. , L = 1 / U;
  3038. for (var h = 0; h < U; ++h) {
  3039. this.xVel && (this.x += this.xVel * p * L),
  3040. this.yVel && (this.y += this.yVel * p * L),
  3041. w = t.getGridArrays(this.x, this.y, this.scale);
  3042. for (var v = 0; v < w.length; ++v)
  3043. for (let F = 0; F < w[v].length; ++F)
  3044. w[v][F].active && t.checkCollision(this, w[v][F], L)
  3045. }
  3046. let q = !1;
  3047. if (this.hitWait > 0 && (this.hitWait -= p,
  3048. this.hitWait <= 0)) {
  3049. q = !0,
  3050. this.hitWait = 0,
  3051. this.leapForce && !n.randInt(0, 2) && (this.xVel += this.leapForce * Math.cos(this.dir),
  3052. this.yVel += this.leapForce * Math.sin(this.dir));
  3053. var w = t.getGridArrays(this.x, this.y, this.hitRange), x, D;
  3054. for (let F = 0; F < w.length; ++F)
  3055. for (var v = 0; v < w[F].length; ++v)
  3056. x = w[F][v],
  3057. x.health && (D = n.getDistance(this.x, this.y, x.x, x.y),
  3058. D < x.scale + this.hitRange && (x.changeHealth(-this.dmg * 5) && t.disableObj(x),
  3059. t.hitObj(x, n.getDirection(this.x, this.y, x.x, x.y))));
  3060. for (var v = 0; v < i.length; ++v)
  3061. i[v].canSee(this) && l.send(i[v].id, "J", this.sid)
  3062. }
  3063. if (k || q) {
  3064. var x, D;
  3065. let _;
  3066. for (var h = 0; h < i.length; ++h)
  3067. x = i[h],
  3068. x && x.alive && (D = n.getDistance(this.x, this.y, x.x, x.y),
  3069. this.hitRange ? !this.hitWait && D <= this.hitRange + x.scale && (q ? (_ = n.getDirection(x.x, x.y, this.x, this.y),
  3070. x.changeHealth(-this.dmg * (1 + r.MAX_ATTACK * Zi) * this.getVolcanoAggression()),
  3071. x.xVel += .6 * Math.cos(_),
  3072. x.yVel += .6 * Math.sin(_),
  3073. this.runFrom = null,
  3074. this.chargeTarget = null,
  3075. this.waitCount = 3e3,
  3076. this.hitWait = n.randInt(0, 2) ? 0 : 600) : this.hitWait = this.hitDelay) : D <= this.scale + x.scale && (_ = n.getDirection(x.x, x.y, this.x, this.y),
  3077. x.changeHealth(-this.dmg * (1 + r.MAX_ATTACK * Zi) * this.getVolcanoAggression()),
  3078. x.xVel += .55 * Math.cos(_),
  3079. x.yVel += .55 * Math.sin(_)))
  3080. }
  3081. this.xVel && (this.xVel *= Math.pow(r.playerDecel, p)),
  3082. this.yVel && (this.yVel *= Math.pow(r.playerDecel, p));
  3083. const P = this.scale;
  3084. this.x - P < 0 ? (this.x = P,
  3085. this.xVel = 0) : this.x + P > r.mapScale && (this.x = r.mapScale - P,
  3086. this.xVel = 0),
  3087. this.y - P < 0 ? (this.y = P,
  3088. this.yVel = 0) : this.y + P > r.mapScale && (this.y = r.mapScale - P,
  3089. this.yVel = 0),
  3090. this.isVolcanoAi && (this.chargeTarget && (n.getDistance(this.chargeTarget.x, this.chargeTarget.y, r.volcanoLocationX, r.volcanoLocationY) || 0) > r.volcanoAggressionRadius && (this.chargeTarget = null),
  3091. this.xVel && (this.x < r.volcanoLocationX - r.volcanoAggressionRadius ? (this.x = r.volcanoLocationX - r.volcanoAggressionRadius,
  3092. this.xVel = 0) : this.x > r.volcanoLocationX + r.volcanoAggressionRadius && (this.x = r.volcanoLocationX + r.volcanoAggressionRadius,
  3093. this.xVel = 0)),
  3094. this.yVel && (this.y < r.volcanoLocationY - r.volcanoAggressionRadius ? (this.y = r.volcanoLocationY - r.volcanoAggressionRadius,
  3095. this.yVel = 0) : this.y > r.volcanoLocationY + r.volcanoAggressionRadius && (this.y = r.volcanoLocationY + r.volcanoAggressionRadius,
  3096. this.yVel = 0)))
  3097. }
  3098. }
  3099. ,
  3100. this.canSee = function(p) {
  3101. if (!p || p.skin && p.skin.invisTimer && p.noMovTimer >= p.skin.invisTimer)
  3102. return !1;
  3103. const h = Math.abs(p.x - this.x) - p.scale
  3104. , m = Math.abs(p.y - this.y) - p.scale;
  3105. return h <= r.maxScreenWidth / 2 * 1.3 && m <= r.maxScreenHeight / 2 * 1.3
  3106. }
  3107. ;
  3108. let a = 0
  3109. , u = 0;
  3110. this.animate = function(p) {
  3111. this.animTime > 0 && (this.animTime -= p,
  3112. this.animTime <= 0 ? (this.animTime = 0,
  3113. this.dirPlus = 0,
  3114. a = 0,
  3115. u = 0) : u == 0 ? (a += p / (this.animSpeed * r.hitReturnRatio),
  3116. this.dirPlus = n.lerp(0, this.targetAngle, Math.min(1, a)),
  3117. a >= 1 && (a = 1,
  3118. u = 1)) : (a -= p / (this.animSpeed * (1 - r.hitReturnRatio)),
  3119. this.dirPlus = n.lerp(0, this.targetAngle, Math.max(0, a))))
  3120. }
  3121. ,
  3122. this.startAnim = function() {
  3123. this.animTime = this.animSpeed = 600,
  3124. this.targetAngle = Math.PI * .8,
  3125. a = 0,
  3126. u = 0
  3127. }
  3128. ,
  3129. this.changeHealth = function(p, h, m) {
  3130. if (this.active && (this.health += p,
  3131. m && (this.hitScare && !n.randInt(0, this.hitScare) ? (this.runFrom = m,
  3132. this.waitCount = 0,
  3133. this.moveCount = 2e3) : this.hostile && this.chargePlayer && m.isPlayer ? (this.chargeTarget = m,
  3134. this.waitCount = 0,
  3135. this.moveCount = 8e3) : this.dontRun || (this.runFrom = m,
  3136. this.waitCount = 0,
  3137. this.moveCount = 2e3)),
  3138. p < 0 && this.hitRange && n.randInt(0, 1) && (this.hitWait = 500),
  3139. h && h.canSee(this) && p < 0 && l.send(h.id, "8", Math.round(this.x), Math.round(this.y), Math.round(-p), 1),
  3140. this.health <= 0)) {
  3141. if (this.spawnDelay)
  3142. this.spawnCounter = this.spawnDelay,
  3143. this.x = -1e6,
  3144. this.y = -1e6;
  3145. else if (this.minSpawnRange || this.maxSpawnRange) {
  3146. const w = r.mapScale * this.minSpawnRange
  3147. , v = r.mapScale * this.maxSpawnRange;
  3148. this.x = n.randInt(w, v),
  3149. this.y = n.randInt(w, v)
  3150. } else
  3151. this.x = this.startX || n.randInt(0, r.mapScale),
  3152. this.y = this.startY || n.randInt(0, r.mapScale);
  3153. if (this.health = this.maxHealth,
  3154. this.runFrom = null,
  3155. h && (o(h, this.killScore),
  3156. this.drop))
  3157. for (let w = 0; w < this.drop.length; )
  3158. h.addResource(r.resourceTypes.indexOf(this.drop[w]), this.drop[w + 1]),
  3159. w += 2
  3160. }
  3161. }
  3162. }
  3163. function kc(e) {
  3164. this.sid = e,
  3165. this.init = function(t, i, s, n, r, o, l) {
  3166. o = o || {},
  3167. this.sentTo = {},
  3168. this.gridLocations = [],
  3169. this.active = !0,
  3170. this.doUpdate = o.doUpdate,
  3171. this.x = t,
  3172. this.y = i,
  3173. this.dir = s,
  3174. this.xWiggle = 0,
  3175. this.yWiggle = 0,
  3176. this.scale = n,
  3177. this.type = r,
  3178. this.id = o.id,
  3179. this.owner = l,
  3180. this.name = o.name,
  3181. this.isItem = this.id != null,
  3182. this.group = o.group,
  3183. this.health = o.health,
  3184. this.layer = 2,
  3185. this.group != null ? this.layer = this.group.layer : this.type == 0 ? this.layer = 3 : this.type == 2 ? this.layer = 0 : this.type == 4 && (this.layer = -1),
  3186. this.colDiv = o.colDiv || 1,
  3187. this.blocker = o.blocker,
  3188. this.ignoreCollision = o.ignoreCollision,
  3189. this.dontGather = o.dontGather,
  3190. this.hideFromEnemy = o.hideFromEnemy,
  3191. this.friction = o.friction,
  3192. this.projDmg = o.projDmg,
  3193. this.dmg = o.dmg,
  3194. this.pDmg = o.pDmg,
  3195. this.pps = o.pps,
  3196. this.zIndex = o.zIndex || 0,
  3197. this.turnSpeed = o.turnSpeed,
  3198. this.req = o.req,
  3199. this.trap = o.trap,
  3200. this.healCol = o.healCol,
  3201. this.teleport = o.teleport,
  3202. this.boostSpeed = o.boostSpeed,
  3203. this.projectile = o.projectile,
  3204. this.shootRange = o.shootRange,
  3205. this.shootRate = o.shootRate,
  3206. this.shootCount = this.shootRate,
  3207. this.spawnPoint = o.spawnPoint
  3208. }
  3209. ,
  3210. this.changeHealth = function(t, i) {
  3211. return this.health += t,
  3212. this.health <= 0
  3213. }
  3214. ,
  3215. this.getScale = function(t, i) {
  3216. return t = t || 1,
  3217. this.scale * (this.isItem || this.type == 2 || this.type == 3 || this.type == 4 ? 1 : .6 * t) * (i ? 1 : this.colDiv)
  3218. }
  3219. ,
  3220. this.visibleToPlayer = function(t) {
  3221. return !this.hideFromEnemy || this.owner && (this.owner == t || this.owner.team && t.team == this.owner.team)
  3222. }
  3223. ,
  3224. this.update = function(t) {
  3225. this.active && (this.xWiggle && (this.xWiggle *= Math.pow(.99, t)),
  3226. this.yWiggle && (this.yWiggle *= Math.pow(.99, t)),
  3227. this.turnSpeed && (this.dir += this.turnSpeed * t))
  3228. }
  3229. }
  3230. const j = [{
  3231. id: 0,
  3232. name: "food",
  3233. layer: 0
  3234. }, {
  3235. id: 1,
  3236. name: "walls",
  3237. place: !0,
  3238. limit: 30,
  3239. layer: 0
  3240. }, {
  3241. id: 2,
  3242. name: "spikes",
  3243. place: !0,
  3244. limit: 15,
  3245. layer: 0
  3246. }, {
  3247. id: 3,
  3248. name: "mill",
  3249. place: !0,
  3250. limit: 7,
  3251. sandboxLimit: 299,
  3252. layer: 1
  3253. }, {
  3254. id: 4,
  3255. name: "mine",
  3256. place: !0,
  3257. limit: 1,
  3258. layer: 0
  3259. }, {
  3260. id: 5,
  3261. name: "trap",
  3262. place: !0,
  3263. limit: 6,
  3264. layer: -1
  3265. }, {
  3266. id: 6,
  3267. name: "booster",
  3268. place: !0,
  3269. limit: 12,
  3270. sandboxLimit: 299,
  3271. layer: -1
  3272. }, {
  3273. id: 7,
  3274. name: "turret",
  3275. place: !0,
  3276. limit: 2,
  3277. layer: 1
  3278. }, {
  3279. id: 8,
  3280. name: "watchtower",
  3281. place: !0,
  3282. limit: 12,
  3283. layer: 1
  3284. }, {
  3285. id: 9,
  3286. name: "buff",
  3287. place: !0,
  3288. limit: 4,
  3289. layer: -1
  3290. }, {
  3291. id: 10,
  3292. name: "spawn",
  3293. place: !0,
  3294. limit: 1,
  3295. layer: -1
  3296. }, {
  3297. id: 11,
  3298. name: "sapling",
  3299. place: !0,
  3300. limit: 2,
  3301. layer: 0
  3302. }, {
  3303. id: 12,
  3304. name: "blocker",
  3305. place: !0,
  3306. limit: 3,
  3307. layer: -1
  3308. }, {
  3309. id: 13,
  3310. name: "teleporter",
  3311. place: !0,
  3312. limit: 2,
  3313. sandboxLimit: 299,
  3314. layer: -1
  3315. }]
  3316. , vc = [{
  3317. indx: 0,
  3318. layer: 0,
  3319. src: "arrow_1",
  3320. dmg: 25,
  3321. speed: 1.6,
  3322. scale: 103,
  3323. range: 1e3
  3324. }, {
  3325. indx: 1,
  3326. layer: 1,
  3327. dmg: 25,
  3328. scale: 20
  3329. }, {
  3330. indx: 0,
  3331. layer: 0,
  3332. src: "arrow_1",
  3333. dmg: 35,
  3334. speed: 2.5,
  3335. scale: 103,
  3336. range: 1200
  3337. }, {
  3338. indx: 0,
  3339. layer: 0,
  3340. src: "arrow_1",
  3341. dmg: 30,
  3342. speed: 2,
  3343. scale: 103,
  3344. range: 1200
  3345. }, {
  3346. indx: 1,
  3347. layer: 1,
  3348. dmg: 16,
  3349. scale: 20
  3350. }, {
  3351. indx: 0,
  3352. layer: 0,
  3353. src: "bullet_1",
  3354. dmg: 50,
  3355. speed: 3.6,
  3356. scale: 160,
  3357. range: 1400
  3358. }]
  3359. , xc = [{
  3360. id: 0,
  3361. type: 0,
  3362. name: "tool hammer",
  3363. desc: "tool for gathering all resources",
  3364. src: "hammer_1",
  3365. length: 140,
  3366. width: 140,
  3367. xOff: -3,
  3368. yOff: 18,
  3369. dmg: 25,
  3370. range: 65,
  3371. gather: 1,
  3372. speed: 300
  3373. }, {
  3374. id: 1,
  3375. type: 0,
  3376. age: 2,
  3377. name: "hand axe",
  3378. desc: "gathers resources at a higher rate",
  3379. src: "axe_1",
  3380. length: 140,
  3381. width: 140,
  3382. xOff: 3,
  3383. yOff: 24,
  3384. dmg: 30,
  3385. spdMult: 1,
  3386. range: 70,
  3387. gather: 2,
  3388. speed: 400
  3389. }, {
  3390. id: 2,
  3391. type: 0,
  3392. age: 8,
  3393. pre: 1,
  3394. name: "great axe",
  3395. desc: "deal more damage and gather more resources",
  3396. src: "great_axe_1",
  3397. length: 140,
  3398. width: 140,
  3399. xOff: -8,
  3400. yOff: 25,
  3401. dmg: 35,
  3402. spdMult: 1,
  3403. range: 75,
  3404. gather: 4,
  3405. speed: 400
  3406. }, {
  3407. id: 3,
  3408. type: 0,
  3409. age: 2,
  3410. name: "short sword",
  3411. desc: "increased attack power but slower move speed",
  3412. src: "sword_1",
  3413. iPad: 1.3,
  3414. length: 130,
  3415. width: 210,
  3416. xOff: -8,
  3417. yOff: 46,
  3418. dmg: 35,
  3419. spdMult: .85,
  3420. range: 110,
  3421. gather: 1,
  3422. speed: 300
  3423. }, {
  3424. id: 4,
  3425. type: 0,
  3426. age: 8,
  3427. pre: 3,
  3428. name: "katana",
  3429. desc: "greater range and damage",
  3430. src: "samurai_1",
  3431. iPad: 1.3,
  3432. length: 130,
  3433. width: 210,
  3434. xOff: -8,
  3435. yOff: 59,
  3436. dmg: 40,
  3437. spdMult: .8,
  3438. range: 118,
  3439. gather: 1,
  3440. speed: 300
  3441. }, {
  3442. id: 5,
  3443. type: 0,
  3444. age: 2,
  3445. name: "polearm",
  3446. desc: "long range melee weapon",
  3447. src: "spear_1",
  3448. iPad: 1.3,
  3449. length: 130,
  3450. width: 210,
  3451. xOff: -8,
  3452. yOff: 53,
  3453. dmg: 45,
  3454. knock: .2,
  3455. spdMult: .82,
  3456. range: 142,
  3457. gather: 1,
  3458. speed: 700
  3459. }, {
  3460. id: 6,
  3461. type: 0,
  3462. age: 2,
  3463. name: "bat",
  3464. desc: "fast long range melee weapon",
  3465. src: "bat_1",
  3466. iPad: 1.3,
  3467. length: 110,
  3468. width: 180,
  3469. xOff: -8,
  3470. yOff: 53,
  3471. dmg: 20,
  3472. knock: .7,
  3473. range: 110,
  3474. gather: 1,
  3475. speed: 300
  3476. }, {
  3477. id: 7,
  3478. type: 0,
  3479. age: 2,
  3480. name: "daggers",
  3481. desc: "really fast short range weapon",
  3482. src: "dagger_1",
  3483. iPad: .8,
  3484. length: 110,
  3485. width: 110,
  3486. xOff: 18,
  3487. yOff: 0,
  3488. dmg: 20,
  3489. knock: .1,
  3490. range: 65,
  3491. gather: 1,
  3492. hitSlow: .1,
  3493. spdMult: 1.13,
  3494. speed: 100
  3495. }, {
  3496. id: 8,
  3497. type: 0,
  3498. age: 2,
  3499. name: "stick",
  3500. desc: "great for gathering but very weak",
  3501. src: "stick_1",
  3502. length: 140,
  3503. width: 140,
  3504. xOff: 3,
  3505. yOff: 24,
  3506. dmg: 1,
  3507. spdMult: 1,
  3508. range: 70,
  3509. gather: 7,
  3510. speed: 400
  3511. }, {
  3512. id: 9,
  3513. type: 1,
  3514. age: 6,
  3515. name: "hunting bow",
  3516. desc: "bow used for ranged combat and hunting",
  3517. src: "bow_1",
  3518. req: ["wood", 4],
  3519. length: 120,
  3520. width: 120,
  3521. xOff: -6,
  3522. yOff: 0,
  3523. projectile: 0,
  3524. spdMult: .75,
  3525. speed: 600
  3526. }, {
  3527. id: 10,
  3528. type: 1,
  3529. age: 6,
  3530. name: "great hammer",
  3531. desc: "hammer used for destroying structures",
  3532. src: "great_hammer_1",
  3533. length: 140,
  3534. width: 140,
  3535. xOff: -9,
  3536. yOff: 25,
  3537. dmg: 10,
  3538. spdMult: .88,
  3539. range: 75,
  3540. sDmg: 7.5,
  3541. gather: 1,
  3542. speed: 400
  3543. }, {
  3544. id: 11,
  3545. type: 1,
  3546. age: 6,
  3547. name: "wooden shield",
  3548. desc: "blocks projectiles and reduces melee damage",
  3549. src: "shield_1",
  3550. length: 120,
  3551. width: 120,
  3552. shield: .2,
  3553. xOff: 6,
  3554. yOff: 0,
  3555. spdMult: .7
  3556. }, {
  3557. id: 12,
  3558. type: 1,
  3559. age: 8,
  3560. pre: 9,
  3561. name: "crossbow",
  3562. desc: "deals more damage and has greater range",
  3563. src: "crossbow_1",
  3564. req: ["wood", 5],
  3565. aboveHand: !0,
  3566. armS: .75,
  3567. length: 120,
  3568. width: 120,
  3569. xOff: -4,
  3570. yOff: 0,
  3571. projectile: 2,
  3572. spdMult: .7,
  3573. speed: 700
  3574. }, {
  3575. id: 13,
  3576. type: 1,
  3577. age: 9,
  3578. pre: 12,
  3579. name: "repeater crossbow",
  3580. desc: "high firerate crossbow with reduced damage",
  3581. src: "crossbow_2",
  3582. req: ["wood", 10],
  3583. aboveHand: !0,
  3584. armS: .75,
  3585. length: 120,
  3586. width: 120,
  3587. xOff: -4,
  3588. yOff: 0,
  3589. projectile: 3,
  3590. spdMult: .7,
  3591. speed: 230
  3592. }, {
  3593. id: 14,
  3594. type: 1,
  3595. age: 6,
  3596. name: "mc grabby",
  3597. desc: "steals resources from enemies",
  3598. src: "grab_1",
  3599. length: 130,
  3600. width: 210,
  3601. xOff: -8,
  3602. yOff: 53,
  3603. dmg: 0,
  3604. steal: 250,
  3605. knock: .2,
  3606. spdMult: 1.05,
  3607. range: 125,
  3608. gather: 0,
  3609. speed: 700
  3610. }, {
  3611. id: 15,
  3612. type: 1,
  3613. age: 9,
  3614. pre: 12,
  3615. name: "musket",
  3616. desc: "slow firerate but high damage and range",
  3617. src: "musket_1",
  3618. req: ["stone", 10],
  3619. aboveHand: !0,
  3620. rec: .35,
  3621. armS: .6,
  3622. hndS: .3,
  3623. hndD: 1.6,
  3624. length: 205,
  3625. width: 205,
  3626. xOff: 25,
  3627. yOff: 0,
  3628. projectile: 5,
  3629. hideProjectile: !0,
  3630. spdMult: .6,
  3631. speed: 1500
  3632. }]
  3633. , dt = [{
  3634. group: j[0],
  3635. name: "apple",
  3636. desc: "restores 20 health when consumed",
  3637. req: ["food", 10],
  3638. consume: function(e) {
  3639. return e.changeHealth(20, e)
  3640. },
  3641. scale: 22,
  3642. holdOffset: 15
  3643. }, {
  3644. age: 3,
  3645. group: j[0],
  3646. name: "cookie",
  3647. desc: "restores 40 health when consumed",
  3648. req: ["food", 15],
  3649. consume: function(e) {
  3650. return e.changeHealth(40, e)
  3651. },
  3652. scale: 27,
  3653. holdOffset: 15
  3654. }, {
  3655. age: 7,
  3656. group: j[0],
  3657. name: "cheese",
  3658. desc: "restores 30 health and another 50 over 5 seconds",
  3659. req: ["food", 25],
  3660. consume: function(e) {
  3661. return e.changeHealth(30, e) || e.health < 100 ? (e.dmgOverTime.dmg = -10,
  3662. e.dmgOverTime.doer = e,
  3663. e.dmgOverTime.time = 5,
  3664. !0) : !1
  3665. },
  3666. scale: 27,
  3667. holdOffset: 15
  3668. }, {
  3669. group: j[1],
  3670. name: "wood wall",
  3671. desc: "provides protection for your village",
  3672. req: ["wood", 10],
  3673. projDmg: !0,
  3674. health: 380,
  3675. scale: 50,
  3676. holdOffset: 20,
  3677. placeOffset: -5
  3678. }, {
  3679. age: 3,
  3680. group: j[1],
  3681. name: "stone wall",
  3682. desc: "provides improved protection for your village",
  3683. req: ["stone", 25],
  3684. health: 900,
  3685. scale: 50,
  3686. holdOffset: 20,
  3687. placeOffset: -5
  3688. }, {
  3689. age: 7,
  3690. pre: 1,
  3691. group: j[1],
  3692. name: "castle wall",
  3693. desc: "provides powerful protection for your village",
  3694. req: ["stone", 35],
  3695. health: 1500,
  3696. scale: 52,
  3697. holdOffset: 20,
  3698. placeOffset: -5
  3699. }, {
  3700. group: j[2],
  3701. name: "spikes",
  3702. desc: "damages enemies when they touch them",
  3703. req: ["wood", 20, "stone", 5],
  3704. health: 400,
  3705. dmg: 20,
  3706. scale: 49,
  3707. spritePadding: -23,
  3708. holdOffset: 8,
  3709. placeOffset: -5
  3710. }, {
  3711. age: 5,
  3712. group: j[2],
  3713. name: "greater spikes",
  3714. desc: "damages enemies when they touch them",
  3715. req: ["wood", 30, "stone", 10],
  3716. health: 500,
  3717. dmg: 35,
  3718. scale: 52,
  3719. spritePadding: -23,
  3720. holdOffset: 8,
  3721. placeOffset: -5
  3722. }, {
  3723. age: 9,
  3724. pre: 1,
  3725. group: j[2],
  3726. name: "poison spikes",
  3727. desc: "poisons enemies when they touch them",
  3728. req: ["wood", 35, "stone", 15],
  3729. health: 600,
  3730. dmg: 30,
  3731. pDmg: 5,
  3732. scale: 52,
  3733. spritePadding: -23,
  3734. holdOffset: 8,
  3735. placeOffset: -5
  3736. }, {
  3737. age: 9,
  3738. pre: 2,
  3739. group: j[2],
  3740. name: "spinning spikes",
  3741. desc: "damages enemies when they touch them",
  3742. req: ["wood", 30, "stone", 20],
  3743. health: 500,
  3744. dmg: 45,
  3745. turnSpeed: .003,
  3746. scale: 52,
  3747. spritePadding: -23,
  3748. holdOffset: 8,
  3749. placeOffset: -5
  3750. }, {
  3751. group: j[3],
  3752. name: "windmill",
  3753. desc: "generates gold over time",
  3754. req: ["wood", 50, "stone", 10],
  3755. health: 400,
  3756. pps: 1,
  3757. turnSpeed: windmillrotate ? .0016 : 0,
  3758. spritePadding: 25,
  3759. iconLineMult: 12,
  3760. scale: 45,
  3761. holdOffset: 20,
  3762. placeOffset: 5
  3763. }, {
  3764. age: 5,
  3765. pre: 1,
  3766. group: j[3],
  3767. name: "faster windmill",
  3768. desc: "generates more gold over time",
  3769. req: ["wood", 60, "stone", 20],
  3770. health: 500,
  3771. pps: 1.5,
  3772. turnSpeed: windmillrotate ? .0025 : 0,
  3773. spritePadding: 25,
  3774. iconLineMult: 12,
  3775. scale: 47,
  3776. holdOffset: 20,
  3777. placeOffset: 5
  3778. }, {
  3779. age: 8,
  3780. pre: 1,
  3781. group: j[3],
  3782. name: "power mill",
  3783. desc: "generates more gold over time",
  3784. req: ["wood", 100, "stone", 50],
  3785. health: 800,
  3786. pps: 2,
  3787. turnSpeed: windmillrotate ? .005 : 0,
  3788. spritePadding: 25,
  3789. iconLineMult: 12,
  3790. scale: 47,
  3791. holdOffset: 20,
  3792. placeOffset: 5
  3793. }, {
  3794. age: 5,
  3795. group: j[4],
  3796. type: 2,
  3797. name: "mine",
  3798. desc: "allows you to mine stone",
  3799. req: ["wood", 20, "stone", 100],
  3800. iconLineMult: 12,
  3801. scale: 65,
  3802. holdOffset: 20,
  3803. placeOffset: 0
  3804. }, {
  3805. age: 5,
  3806. group: j[11],
  3807. type: 0,
  3808. name: "sapling",
  3809. desc: "allows you to farm wood",
  3810. req: ["wood", 150],
  3811. iconLineMult: 12,
  3812. colDiv: .5,
  3813. scale: 110,
  3814. holdOffset: 50,
  3815. placeOffset: -15
  3816. }, {
  3817. age: 4,
  3818. group: j[5],
  3819. name: "pit trap",
  3820. desc: "pit that traps enemies if they walk over it",
  3821. req: ["wood", 30, "stone", 30],
  3822. trap: !0,
  3823. ignoreCollision: !0,
  3824. hideFromEnemy: !0,
  3825. health: 500,
  3826. colDiv: .2,
  3827. scale: 50,
  3828. holdOffset: 20,
  3829. placeOffset: -5
  3830. }, {
  3831. age: 4,
  3832. group: j[6],
  3833. name: "boost pad",
  3834. desc: "provides boost when stepped on",
  3835. req: ["stone", 20, "wood", 5],
  3836. ignoreCollision: !0,
  3837. boostSpeed: 1.5,
  3838. health: 150,
  3839. colDiv: .7,
  3840. scale: 45,
  3841. holdOffset: 20,
  3842. placeOffset: -5
  3843. }, {
  3844. age: 7,
  3845. group: j[7],
  3846. doUpdate: !0,
  3847. name: "turret",
  3848. desc: "defensive structure that shoots at enemies",
  3849. req: ["wood", 200, "stone", 150],
  3850. health: 800,
  3851. projectile: 1,
  3852. shootRange: 700,
  3853. shootRate: 2200,
  3854. scale: 43,
  3855. holdOffset: 20,
  3856. placeOffset: -5
  3857. }, {
  3858. age: 7,
  3859. group: j[8],
  3860. name: "platform",
  3861. desc: "platform to shoot over walls and cross over water",
  3862. req: ["wood", 20],
  3863. ignoreCollision: !0,
  3864. zIndex: 1,
  3865. health: 300,
  3866. scale: 43,
  3867. holdOffset: 20,
  3868. placeOffset: -5
  3869. }, {
  3870. age: 7,
  3871. group: j[9],
  3872. name: "healing pad",
  3873. desc: "standing on it will slowly heal you",
  3874. req: ["wood", 30, "food", 10],
  3875. ignoreCollision: !0,
  3876. healCol: 15,
  3877. health: 400,
  3878. colDiv: .7,
  3879. scale: 45,
  3880. holdOffset: 20,
  3881. placeOffset: -5
  3882. }, {
  3883. age: 9,
  3884. group: j[10],
  3885. name: "spawn pad",
  3886. desc: "you will spawn here when you die but it will dissapear",
  3887. req: ["wood", 100, "stone", 100],
  3888. health: 400,
  3889. ignoreCollision: !0,
  3890. spawnPoint: !0,
  3891. scale: 45,
  3892. holdOffset: 20,
  3893. placeOffset: -5
  3894. }, {
  3895. age: 7,
  3896. group: j[12],
  3897. name: "blocker",
  3898. desc: "blocks building in radius",
  3899. req: ["wood", 30, "stone", 25],
  3900. ignoreCollision: !0,
  3901. blocker: 300,
  3902. health: 400,
  3903. colDiv: .7,
  3904. scale: 45,
  3905. holdOffset: 20,
  3906. placeOffset: -5
  3907. }, {
  3908. age: 7,
  3909. group: j[13],
  3910. name: "teleporter",
  3911. desc: "teleports you to a random point on the map",
  3912. req: ["wood", 60, "stone", 60],
  3913. ignoreCollision: !0,
  3914. teleport: !0,
  3915. health: 200,
  3916. colDiv: .7,
  3917. scale: 45,
  3918. holdOffset: 20,
  3919. placeOffset: -5
  3920. }];
  3921. for (let e = 0; e < dt.length; ++e)
  3922. dt[e].id = e,
  3923. dt[e].pre && (dt[e].pre = e - dt[e].pre);
  3924. const R = {
  3925. groups: j,
  3926. projectiles: vc,
  3927. weapons: xc,
  3928. list: dt
  3929. }
  3930. , bc = ["ahole", "anus", "ash0le", "ash0les", "asholes", "ass", "Ass Monkey", "Assface", "assh0le", "assh0lez", "asshole", "assholes", "assholz", "asswipe", "azzhole", "bassterds", "bastard", "bastards", "bastardz", "basterds", "basterdz", "Biatch", "bitch", "bitches", "Blow Job", "boffing", "butthole", "buttwipe", "c0ck", "c0cks", "c0k", "Carpet Muncher", "cawk", "cawks", "Clit", "cnts", "cntz", "cock", "cockhead", "cock-head", "cocks", "CockSucker", "cock-sucker", "crap", "cum", "cunt", "cunts", "cuntz", "dick", "dild0", "dild0s", "dildo", "dildos", "dilld0", "dilld0s", "dominatricks", "dominatrics", "dominatrix", "dyke", "enema", "f u c k", "f u c k e r", "fag", "fag1t", "faget", "fagg1t", "faggit", "faggot", "fagg0t", "fagit", "fags", "fagz", "faig", "faigs", "fart", "flipping the bird", "####", "####er", "####in", "####ing", "####s", "Fudge Packer", "fuk", "Fukah", "Fuken", "fuker", "Fukin", "Fukk", "Fukkah", "Fukken", "Fukker", "Fukkin", "g00k", "God-damned", "h00r", "h0ar", "h0re", "hells", "hoar", "hoor", "hoore", "jackoff", "jap", "japs", "jerk-off", "enemyNearsim", "enemyNearss", "enemyNearzm", "enemyNearzz", "knob", "knobs", "knobz", "kunt", "kunts", "kuntz", "Lezzian", "Lipshits", "Lipshitz", "masochist", "masokist", "massterbait", "masstrbait", "masstrbate", "masterbaiter", "masterbate", "masterbates", "Motha ####er", "Motha Fuker", "Motha Fukkah", "Motha Fukker", "Mother ####er", "Mother Fukah", "Mother Fuker", "Mother Fukkah", "Mother Fukker", "mother-####er", "Mutha ####er", "Mutha Fukah", "Mutha Fuker", "Mutha Fukkah", "Mutha Fukker", "n1gr", "nastt", "nigger;", "nigur;", "niiger;", "niigr;", "orafis", "orgasim;", "orgasm", "orgasum", "oriface", "orifice", "orifiss", "packi", "packie", "packy", "paki", "pakie", "paky", "pecker", "peeenus", "peeenusss", "peenus", "peinus", "pen1s", "penas", "penis", "penis-breath", "penus", "penuus", "Phuc", "Phuck", "Phuk", "Phuker", "Phukker", "polac", "polack", "polak", "Poonani", "pr1c", "pr1ck", "pr1k", "pusse", "pussee", "pussy", "puuke", "puuker", "qweir", "recktum", "rectum", "retard", "sadist", "scank", "schlong", "screwing", "semen", "sex", "sexy", "Sh!t", "sh1t", "sh1ter", "sh1ts", "sh1tter", "sh1tz", "shit", "shits", "shitter", "Shitty", "Shity", "shitz", "Shyt", "Shyte", "Shytty", "Shyty", "skanck", "skank", "skankee", "skankey", "skanks", "Skanky", "slag", "slut", "sluts", "Slutty", "slutz", "son-of-a-bitch", "tit", "turd", "va1enemyNearna", "vag1na", "vagiina", "vagina", "vaj1na", "vaenemyNearna", "vullva", "vulva", "w0p", "wh00r", "wh0re", "whore", "xrated", "xxx", "b!+ch", "bitch", "blowjob", "clit", "arschloch", "####", "shit", "ass", "asshole", "b!tch", "b17ch", "b1tch", "bastard", "bi+ch", "boiolas", "buceta", "c0ck", "cawk", "chink", "cipa", "clits", "cock", "cum", "cunt", "dildo", "dirsa", "ejakulate", "fatass", "fcuk", "fuk", "fux0r", "hoer", "hore", "enemyNearsm", "kawk", "l3itch", "l3i+ch", "masturbate", "masterbat*", "masterbat3", "mother####er", "s.o.b.", "mofo", "nazi", "nigga", "nigger", "nutsack", "phuck", "pimpis", "pusse", "pussy", "scrotum", "sh!t", "shemale", "shi+", "sh!+", "slut", "smut", "teets", "tits", "boobs", "b00bs", "teez", "testical", "testicle", "titt", "w00se", "jackoff", "wank", "whoar", "whore", "*damn", "*dyke", "*####*", "*shit*", "@$$", "amcik", "andskota", "arse*", "assrammer", "ayir", "bi7ch", "bitch*", "bollock*", "breasts", "butt-pirate", "cabron", "cazzo", "chraa", "chuj", "Cock*", "cunt*", "d4mn", "daygo", "dego", "dick*", "dike*", "dupa", "dziwka", "ejackulate", "Ekrem*", "Ekto", "enculer", "faen", "fag*", "fanculo", "fanny", "feces", "feg", "Felcher", "ficken", "fitt*", "Flikker", "foreskin", "Fotze", "Fu(*", "fuk*", "futkretzn", "gook", "guiena", "h0r", "h4x0r", "hell", "helvete", "hoer*", "honkey", "Huevon", "hui", "injun", "enemyNearzz", "kanker*", "kike", "klootzak", "kraut", "knulle", "kuk", "kuksuger", "Kurac", "kurwa", "kusi*", "kyrpa*", "lesbo", "mamhoon", "masturbat*", "merd*", "mibun", "monkleigh", "mouliewop", "muie", "mulkku", "muschi", "nazis", "nepesaurio", "nigger*", "orospu", "paska*", "perse", "picka", "pierdol*", "pillu*", "pimmel", "piss*", "pizda", "poontsee", "poop", "porn", "p0rn", "pr0n", "preteen", "pula", "pule", "puta", "puto", "qahbeh", "queef*", "rautenberg", "schaffer", "scheiss*", "schlampe", "schmuck", "screw", "sh!t*", "sharmuta", "sharmute", "shipal", "shiz", "skribz", "skurwysyn", "sphencter", "spic", "spierdalaj", "splooge", "suka", "b00b*", "testicle*", "titt*", "twat", "vittu", "wank*", "wetback*", "wichser", "wop*", "yed", "zabourah"]
  3931. , Sc = {
  3932. words: bc
  3933. };
  3934. var Tc = {
  3935. "4r5e": 1,
  3936. "5h1t": 1,
  3937. "5hit": 1,
  3938. a55: 1,
  3939. anal: 1,
  3940. anus: 1,
  3941. ar5e: 1,
  3942. arrse: 1,
  3943. arse: 1,
  3944. ass: 1,
  3945. "ass-####er": 1,
  3946. asses: 1,
  3947. ass####er: 1,
  3948. assfukka: 1,
  3949. asshole: 1,
  3950. assholes: 1,
  3951. asswhole: 1,
  3952. a_s_s: 1,
  3953. "b!tch": 1,
  3954. b00bs: 1,
  3955. b17ch: 1,
  3956. b1tch: 1,
  3957. ballbag: 1,
  3958. balls: 1,
  3959. ballsack: 1,
  3960. bastard: 1,
  3961. beastial: 1,
  3962. beastiality: 1,
  3963. bellend: 1,
  3964. bestial: 1,
  3965. bestiality: 1,
  3966. "bi+ch": 1,
  3967. biatch: 1,
  3968. bitch: 1,
  3969. bitcher: 1,
  3970. bitchers: 1,
  3971. bitches: 1,
  3972. bitchin: 1,
  3973. bitching: 1,
  3974. bloody: 1,
  3975. "blow job": 1,
  3976. blowjob: 1,
  3977. blowjobs: 1,
  3978. boiolas: 1,
  3979. bollock: 1,
  3980. bollok: 1,
  3981. boner: 1,
  3982. boob: 1,
  3983. boobs: 1,
  3984. booobs: 1,
  3985. boooobs: 1,
  3986. booooobs: 1,
  3987. booooooobs: 1,
  3988. breasts: 1,
  3989. buceta: 1,
  3990. bugger: 1,
  3991. bum: 1,
  3992. "bunny ####er": 1,
  3993. butt: 1,
  3994. butthole: 1,
  3995. buttmuch: 1,
  3996. buttplug: 1,
  3997. c0ck: 1,
  3998. c0cksucker: 1,
  3999. "carpet muncher": 1,
  4000. cawk: 1,
  4001. chink: 1,
  4002. cipa: 1,
  4003. cl1t: 1,
  4004. clit: 1,
  4005. clitoris: 1,
  4006. clits: 1,
  4007. cnut: 1,
  4008. cock: 1,
  4009. "cock-sucker": 1,
  4010. cockface: 1,
  4011. cockhead: 1,
  4012. cockmunch: 1,
  4013. cockmuncher: 1,
  4014. cocks: 1,
  4015. cocksuck: 1,
  4016. cocksucked: 1,
  4017. cocksucker: 1,
  4018. cocksucking: 1,
  4019. cocksucks: 1,
  4020. cocksuka: 1,
  4021. cocksukka: 1,
  4022. cok: 1,
  4023. cokmuncher: 1,
  4024. coksucka: 1,
  4025. coon: 1,
  4026. cox: 1,
  4027. crap: 1,
  4028. cum: 1,
  4029. cummer: 1,
  4030. cumming: 1,
  4031. cums: 1,
  4032. cumshot: 1,
  4033. cunilingus: 1,
  4034. cunillingus: 1,
  4035. cunnilingus: 1,
  4036. cunt: 1,
  4037. cuntlick: 1,
  4038. cuntlicker: 1,
  4039. cuntlicking: 1,
  4040. cunts: 1,
  4041. cyalis: 1,
  4042. cyberfuc: 1,
  4043. cyber####: 1,
  4044. cyber####ed: 1,
  4045. cyber####er: 1,
  4046. cyber####ers: 1,
  4047. cyber####ing: 1,
  4048. d1ck: 1,
  4049. damn: 1,
  4050. dick: 1,
  4051. dickhead: 1,
  4052. dildo: 1,
  4053. dildos: 1,
  4054. dink: 1,
  4055. dinks: 1,
  4056. dirsa: 1,
  4057. dlck: 1,
  4058. "dog-####er": 1,
  4059. doggin: 1,
  4060. dogging: 1,
  4061. donkeyribber: 1,
  4062. doosh: 1,
  4063. duche: 1,
  4064. dyke: 1,
  4065. ejaculate: 1,
  4066. ejaculated: 1,
  4067. ejaculates: 1,
  4068. ejaculating: 1,
  4069. ejaculatings: 1,
  4070. ejaculation: 1,
  4071. ejakulate: 1,
  4072. "f u c k": 1,
  4073. "f u c k e r": 1,
  4074. f4nny: 1,
  4075. fag: 1,
  4076. fagging: 1,
  4077. faggitt: 1,
  4078. faggot: 1,
  4079. faggs: 1,
  4080. fagot: 1,
  4081. fagots: 1,
  4082. fags: 1,
  4083. fanny: 1,
  4084. fannyflaps: 1,
  4085. fanny####er: 1,
  4086. fanyy: 1,
  4087. fatass: 1,
  4088. fcuk: 1,
  4089. fcuker: 1,
  4090. fcuking: 1,
  4091. feck: 1,
  4092. fecker: 1,
  4093. felching: 1,
  4094. fellate: 1,
  4095. fellatio: 1,
  4096. finger####: 1,
  4097. finger####ed: 1,
  4098. finger####er: 1,
  4099. finger####ers: 1,
  4100. finger####ing: 1,
  4101. finger####s: 1,
  4102. fist####: 1,
  4103. fist####ed: 1,
  4104. fist####er: 1,
  4105. fist####ers: 1,
  4106. fist####ing: 1,
  4107. fist####ings: 1,
  4108. fist####s: 1,
  4109. flange: 1,
  4110. fook: 1,
  4111. fooker: 1,
  4112. ####: 1,
  4113. ####a: 1,
  4114. ####ed: 1,
  4115. ####er: 1,
  4116. ####ers: 1,
  4117. ####head: 1,
  4118. ####heads: 1,
  4119. ####in: 1,
  4120. ####ing: 1,
  4121. ####ings: 1,
  4122. ####ingshitmother####er: 1,
  4123. ####me: 1,
  4124. ####s: 1,
  4125. ####whit: 1,
  4126. ####wit: 1,
  4127. "fudge packer": 1,
  4128. fudgepacker: 1,
  4129. fuk: 1,
  4130. fuker: 1,
  4131. fukker: 1,
  4132. fukkin: 1,
  4133. fuks: 1,
  4134. fukwhit: 1,
  4135. fukwit: 1,
  4136. fux: 1,
  4137. fux0r: 1,
  4138. f_u_c_k: 1,
  4139. gangbang: 1,
  4140. gangbanged: 1,
  4141. gangbangs: 1,
  4142. gaylord: 1,
  4143. gaysex: 1,
  4144. goatse: 1,
  4145. God: 1,
  4146. "god-dam": 1,
  4147. "god-damned": 1,
  4148. goddamn: 1,
  4149. goddamned: 1,
  4150. hardcoresex: 1,
  4151. hell: 1,
  4152. heshe: 1,
  4153. hoar: 1,
  4154. hoare: 1,
  4155. hoer: 1,
  4156. homo: 1,
  4157. hore: 1,
  4158. horniest: 1,
  4159. horny: 1,
  4160. hotsex: 1,
  4161. "jack-off": 1,
  4162. jackoff: 1,
  4163. jap: 1,
  4164. "jerk-off": 1,
  4165. enemyNearsm: 1,
  4166. enemyNearz: 1,
  4167. enemyNearzm: 1,
  4168. enemyNearzz: 1,
  4169. kawk: 1,
  4170. knob: 1,
  4171. knobead: 1,
  4172. knobed: 1,
  4173. knobend: 1,
  4174. knobhead: 1,
  4175. knobjocky: 1,
  4176. knobjokey: 1,
  4177. kock: 1,
  4178. kondum: 1,
  4179. kondums: 1,
  4180. kum: 1,
  4181. kummer: 1,
  4182. kumming: 1,
  4183. kums: 1,
  4184. kunilingus: 1,
  4185. "l3i+ch": 1,
  4186. l3itch: 1,
  4187. labia: 1,
  4188. lust: 1,
  4189. lusting: 1,
  4190. m0f0: 1,
  4191. m0fo: 1,
  4192. m45terbate: 1,
  4193. ma5terb8: 1,
  4194. ma5terbate: 1,
  4195. masochist: 1,
  4196. "master-bate": 1,
  4197. masterb8: 1,
  4198. "masterbat*": 1,
  4199. masterbat3: 1,
  4200. masterbate: 1,
  4201. masterbation: 1,
  4202. masterbations: 1,
  4203. masturbate: 1,
  4204. "mo-fo": 1,
  4205. mof0: 1,
  4206. mofo: 1,
  4207. motha####: 1,
  4208. motha####a: 1,
  4209. motha####as: 1,
  4210. motha####az: 1,
  4211. motha####ed: 1,
  4212. motha####er: 1,
  4213. motha####ers: 1,
  4214. motha####in: 1,
  4215. motha####ing: 1,
  4216. motha####ings: 1,
  4217. motha####s: 1,
  4218. "mother ####er": 1,
  4219. mother####: 1,
  4220. mother####ed: 1,
  4221. mother####er: 1,
  4222. mother####ers: 1,
  4223. mother####in: 1,
  4224. mother####ing: 1,
  4225. mother####ings: 1,
  4226. mother####ka: 1,
  4227. mother####s: 1,
  4228. muff: 1,
  4229. mutha: 1,
  4230. muthafecker: 1,
  4231. mutha####ker: 1,
  4232. muther: 1,
  4233. muther####er: 1,
  4234. n1gga: 1,
  4235. n1gger: 1,
  4236. nazi: 1,
  4237. nigg3r: 1,
  4238. nigg4h: 1,
  4239. nigga: 1,
  4240. niggah: 1,
  4241. niggas: 1,
  4242. niggaz: 1,
  4243. nigger: 1,
  4244. niggers: 1,
  4245. nob: 1,
  4246. "nob jokey": 1,
  4247. nobhead: 1,
  4248. nobjocky: 1,
  4249. nobjokey: 1,
  4250. numbnuts: 1,
  4251. nutsack: 1,
  4252. orgasim: 1,
  4253. orgasims: 1,
  4254. orgasm: 1,
  4255. orgasms: 1,
  4256. p0rn: 1,
  4257. pawn: 1,
  4258. pecker: 1,
  4259. penis: 1,
  4260. penis####er: 1,
  4261. phonesex: 1,
  4262. phuck: 1,
  4263. phuk: 1,
  4264. phuked: 1,
  4265. phuking: 1,
  4266. phukked: 1,
  4267. phukking: 1,
  4268. phuks: 1,
  4269. phuq: 1,
  4270. pig####er: 1,
  4271. pimpis: 1,
  4272. piss: 1,
  4273. pissed: 1,
  4274. pisser: 1,
  4275. pissers: 1,
  4276. pisses: 1,
  4277. pissflaps: 1,
  4278. pissin: 1,
  4279. pissing: 1,
  4280. pissoff: 1,
  4281. poop: 1,
  4282. porn: 1,
  4283. porno: 1,
  4284. pornography: 1,
  4285. pornos: 1,
  4286. prick: 1,
  4287. pricks: 1,
  4288. pron: 1,
  4289. pube: 1,
  4290. pusse: 1,
  4291. pussi: 1,
  4292. pussies: 1,
  4293. pussy: 1,
  4294. pussys: 1,
  4295. rectum: 1,
  4296. retard: 1,
  4297. rimjaw: 1,
  4298. rimming: 1,
  4299. "s hit": 1,
  4300. "s.o.b.": 1,
  4301. sadist: 1,
  4302. schlong: 1,
  4303. screwing: 1,
  4304. scroat: 1,
  4305. scrote: 1,
  4306. scrotum: 1,
  4307. semen: 1,
  4308. sex: 1,
  4309. "sh!+": 1,
  4310. "sh!t": 1,
  4311. sh1t: 1,
  4312. shag: 1,
  4313. shagger: 1,
  4314. shaggin: 1,
  4315. shagging: 1,
  4316. shemale: 1,
  4317. "shi+": 1,
  4318. shit: 1,
  4319. shitdick: 1,
  4320. shite: 1,
  4321. shited: 1,
  4322. shitey: 1,
  4323. shit####: 1,
  4324. shitfull: 1,
  4325. shithead: 1,
  4326. shiting: 1,
  4327. shitings: 1,
  4328. shits: 1,
  4329. shitted: 1,
  4330. shitter: 1,
  4331. shitters: 1,
  4332. shitting: 1,
  4333. shittings: 1,
  4334. shitty: 1,
  4335. skank: 1,
  4336. slut: 1,
  4337. sluts: 1,
  4338. smegma: 1,
  4339. smut: 1,
  4340. snatch: 1,
  4341. "son-of-a-bitch": 1,
  4342. spac: 1,
  4343. spunk: 1,
  4344. s_h_i_t: 1,
  4345. t1tt1e5: 1,
  4346. t1tties: 1,
  4347. teets: 1,
  4348. teez: 1,
  4349. testical: 1,
  4350. testicle: 1,
  4351. tit: 1,
  4352. tit####: 1,
  4353. tits: 1,
  4354. titt: 1,
  4355. tittie5: 1,
  4356. tittie####er: 1,
  4357. titties: 1,
  4358. titty####: 1,
  4359. tittywank: 1,
  4360. titwank: 1,
  4361. tosser: 1,
  4362. turd: 1,
  4363. tw4t: 1,
  4364. twat: 1,
  4365. twathead: 1,
  4366. twatty: 1,
  4367. twunt: 1,
  4368. twunter: 1,
  4369. v14gra: 1,
  4370. v1gra: 1,
  4371. vagina: 1,
  4372. viagra: 1,
  4373. vulva: 1,
  4374. w00se: 1,
  4375. wang: 1,
  4376. wank: 1,
  4377. wanker: 1,
  4378. wanky: 1,
  4379. whoar: 1,
  4380. whore: 1,
  4381. willies: 1,
  4382. willy: 1,
  4383. xrated: 1,
  4384. xxx: 1
  4385. }
  4386. , Ic = ["4r5e", "5h1t", "5hit", "a55", "anal", "anus", "ar5e", "arrse", "arse", "ass", "ass-####er", "asses", "ass####er", "assfukka", "asshole", "assholes", "asswhole", "a_s_s", "b!tch", "b00bs", "b17ch", "b1tch", "ballbag", "balls", "ballsack", "bastard", "beastial", "beastiality", "bellend", "bestial", "bestiality", "bi+ch", "biatch", "bitch", "bitcher", "bitchers", "bitches", "bitchin", "bitching", "bloody", "blow job", "blowjob", "blowjobs", "boiolas", "bollock", "bollok", "boner", "boob", "boobs", "booobs", "boooobs", "booooobs", "booooooobs", "breasts", "buceta", "bugger", "bum", "bunny ####er", "butt", "butthole", "buttmuch", "buttplug", "c0ck", "c0cksucker", "carpet muncher", "cawk", "chink", "cipa", "cl1t", "clit", "clitoris", "clits", "cnut", "cock", "cock-sucker", "cockface", "cockhead", "cockmunch", "cockmuncher", "cocks", "cocksuck", "cocksucked", "cocksucker", "cocksucking", "cocksucks", "cocksuka", "cocksukka", "cok", "cokmuncher", "coksucka", "coon", "cox", "crap", "cum", "cummer", "cumming", "cums", "cumshot", "cunilingus", "cunillingus", "cunnilingus", "cunt", "cuntlick", "cuntlicker", "cuntlicking", "cunts", "cyalis", "cyberfuc", "cyber####", "cyber####ed", "cyber####er", "cyber####ers", "cyber####ing", "d1ck", "damn", "dick", "dickhead", "dildo", "dildos", "dink", "dinks", "dirsa", "dlck", "dog-####er", "doggin", "dogging", "donkeyribber", "doosh", "duche", "dyke", "ejaculate", "ejaculated", "ejaculates", "ejaculating", "ejaculatings", "ejaculation", "ejakulate", "f u c k", "f u c k e r", "f4nny", "fag", "fagging", "faggitt", "faggot", "faggs", "fagot", "fagots", "fags", "fanny", "fannyflaps", "fanny####er", "fanyy", "fatass", "fcuk", "fcuker", "fcuking", "feck", "fecker", "felching", "fellate", "fellatio", "finger####", "finger####ed", "finger####er", "finger####ers", "finger####ing", "finger####s", "fist####", "fist####ed", "fist####er", "fist####ers", "fist####ing", "fist####ings", "fist####s", "flange", "fook", "fooker", "####", "####a", "####ed", "####er", "####ers", "####head", "####heads", "####in", "####ing", "####ings", "####ingshitmother####er", "####me", "####s", "####whit", "####wit", "fudge packer", "fudgepacker", "fuk", "fuker", "fukker", "fukkin", "fuks", "fukwhit", "fukwit", "fux", "fux0r", "f_u_c_k", "gangbang", "gangbanged", "gangbangs", "gaylord", "gaysex", "goatse", "God", "god-dam", "god-damned", "goddamn", "goddamned", "hardcoresex", "hell", "heshe", "hoar", "hoare", "hoer", "homo", "hore", "horniest", "horny", "hotsex", "jack-off", "jackoff", "jap", "jerk-off", "enemyNearsm", "enemyNearz", "enemyNearzm", "enemyNearzz", "kawk", "knob", "knobead", "knobed", "knobend", "knobhead", "knobjocky", "knobjokey", "kock", "kondum", "kondums", "kum", "kummer", "kumming", "kums", "kunilingus", "l3i+ch", "l3itch", "labia", "lust", "lusting", "m0f0", "m0fo", "m45terbate", "ma5terb8", "ma5terbate", "masochist", "master-bate", "masterb8", "masterbat*", "masterbat3", "masterbate", "masterbation", "masterbations", "masturbate", "mo-fo", "mof0", "mofo", "motha####", "motha####a", "motha####as", "motha####az", "motha####ed", "motha####er", "motha####ers", "motha####in", "motha####ing", "motha####ings", "motha####s", "mother ####er", "mother####", "mother####ed", "mother####er", "mother####ers", "mother####in", "mother####ing", "mother####ings", "mother####ka", "mother####s", "muff", "mutha", "muthafecker", "mutha####ker", "muther", "muther####er", "n1gga", "n1gger", "nazi", "nigg3r", "nigg4h", "nigga", "niggah", "niggas", "niggaz", "nigger", "niggers", "nob", "nob jokey", "nobhead", "nobjocky", "nobjokey", "numbnuts", "nutsack", "orgasim", "orgasims", "orgasm", "orgasms", "p0rn", "pawn", "pecker", "penis", "penis####er", "phonesex", "phuck", "phuk", "phuked", "phuking", "phukked", "phukking", "phuks", "phuq", "pig####er", "pimpis", "piss", "pissed", "pisser", "pissers", "pisses", "pissflaps", "pissin", "pissing", "pissoff", "poop", "porn", "porno", "pornography", "pornos", "prick", "pricks", "pron", "pube", "pusse", "pussi", "pussies", "pussy", "pussys", "rectum", "retard", "rimjaw", "rimming", "s hit", "s.o.b.", "sadist", "schlong", "screwing", "scroat", "scrote", "scrotum", "semen", "sex", "sh!+", "sh!t", "sh1t", "shag", "shagger", "shaggin", "shagging", "shemale", "shi+", "shit", "shitdick", "shite", "shited", "shitey", "shit####", "shitfull", "shithead", "shiting", "shitings", "shits", "shitted", "shitter", "shitters", "shitting", "shittings", "shitty", "skank", "slut", "sluts", "smegma", "smut", "snatch", "son-of-a-bitch", "spac", "spunk", "s_h_i_t", "t1tt1e5", "t1tties", "teets", "teez", "testical", "testicle", "tit", "tit####", "tits", "titt", "tittie5", "tittie####er", "titties", "titty####", "tittywank", "titwank", "tosser", "turd", "tw4t", "twat", "twathead", "twatty", "twunt", "twunter", "v14gra", "v1gra", "vagina", "viagra", "vulva", "w00se", "wang", "wank", "wanker", "wanky", "whoar", "whore", "willies", "willy", "xrated", "xxx"]
  4387. , Mc = /\b(4r5e|5h1t|5hit|a55|anal|anus|ar5e|arrse|arse|ass|ass-####er|asses|ass####er|assfukka|asshole|assholes|asswhole|a_s_s|b!tch|b00bs|b17ch|b1tch|ballbag|balls|ballsack|bastard|beastial|beastiality|bellend|bestial|bestiality|bi\+ch|biatch|bitch|bitcher|bitchers|bitches|bitchin|bitching|bloody|blow job|blowjob|blowjobs|boiolas|bollock|bollok|boner|boob|boobs|booobs|boooobs|booooobs|booooooobs|breasts|buceta|bugger|bum|bunny ####er|butt|butthole|buttmuch|buttplug|c0ck|c0cksucker|carpet muncher|cawk|chink|cipa|cl1t|clit|clitoris|clits|cnut|cock|cock-sucker|cockface|cockhead|cockmunch|cockmuncher|cocks|cocksuck|cocksucked|cocksucker|cocksucking|cocksucks|cocksuka|cocksukka|cok|cokmuncher|coksucka|coon|cox|crap|cum|cummer|cumming|cums|cumshot|cunilingus|cunillingus|cunnilingus|cunt|cuntlick|cuntlicker|cuntlicking|cunts|cyalis|cyberfuc|cyber####|cyber####ed|cyber####er|cyber####ers|cyber####ing|d1ck|damn|dick|dickhead|dildo|dildos|dink|dinks|dirsa|dlck|dog-####er|doggin|dogging|donkeyribber|doosh|duche|dyke|ejaculate|ejaculated|ejaculates|ejaculating|ejaculatings|ejaculation|ejakulate|f u c k|f u c k e r|f4nny|fag|fagging|faggitt|faggot|faggs|fagot|fagots|fags|fanny|fannyflaps|fanny####er|fanyy|fatass|fcuk|fcuker|fcuking|feck|fecker|felching|fellate|fellatio|finger####|finger####ed|finger####er|finger####ers|finger####ing|finger####s|fist####|fist####ed|fist####er|fist####ers|fist####ing|fist####ings|fist####s|flange|fook|fooker|####|####a|####ed|####er|####ers|####head|####heads|####in|####ing|####ings|####ingshitmother####er|####me|####s|####whit|####wit|fudge packer|fudgepacker|fuk|fuker|fukker|fukkin|fuks|fukwhit|fukwit|fux|fux0r|f_u_c_k|gangbang|gangbanged|gangbangs|gaylord|gaysex|goatse|God|god-dam|god-damned|goddamn|goddamned|hardcoresex|hell|heshe|hoar|hoare|hoer|homo|hore|horniest|horny|hotsex|jack-off|jackoff|jap|jerk-off|enemyNearsm|enemyNearz|enemyNearzm|enemyNearzz|kawk|knob|knobead|knobed|knobend|knobhead|knobjocky|knobjokey|kock|kondum|kondums|kum|kummer|kumming|kums|kunilingus|l3i\+ch|l3itch|labia|lust|lusting|m0f0|m0fo|m45terbate|ma5terb8|ma5terbate|masochist|master-bate|masterb8|masterbat*|masterbat3|masterbate|masterbation|masterbations|masturbate|mo-fo|mof0|mofo|motha####|motha####a|motha####as|motha####az|motha####ed|motha####er|motha####ers|motha####in|motha####ing|motha####ings|motha####s|mother ####er|mother####|mother####ed|mother####er|mother####ers|mother####in|mother####ing|mother####ings|mother####ka|mother####s|muff|mutha|muthafecker|mutha####ker|muther|muther####er|n1gga|n1gger|nazi|nigg3r|nigg4h|nigga|niggah|niggas|niggaz|nigger|niggers|nob|nob jokey|nobhead|nobjocky|nobjokey|numbnuts|nutsack|orgasim|orgasims|orgasm|orgasms|p0rn|pawn|pecker|penis|penis####er|phonesex|phuck|phuk|phuked|phuking|phukked|phukking|phuks|phuq|pig####er|pimpis|piss|pissed|pisser|pissers|pisses|pissflaps|pissin|pissing|pissoff|poop|porn|porno|pornography|pornos|prick|pricks|pron|pube|pusse|pussi|pussies|pussy|pussys|rectum|retard|rimjaw|rimming|s hit|s.o.b.|sadist|schlong|screwing|scroat|scrote|scrotum|semen|sex|sh!\+|sh!t|sh1t|shag|shagger|shaggin|shagging|shemale|shi\+|shit|shitdick|shite|shited|shitey|shit####|shitfull|shithead|shiting|shitings|shits|shitted|shitter|shitters|shitting|shittings|shitty|skank|slut|sluts|smegma|smut|snatch|son-of-a-bitch|spac|spunk|s_h_i_t|t1tt1e5|t1tties|teets|teez|testical|testicle|tit|tit####|tits|titt|tittie5|tittie####er|titties|titty####|tittywank|titwank|tosser|turd|tw4t|twat|twathead|twatty|twunt|twunter|v14gra|v1gra|vagina|viagra|vulva|w00se|wang|wank|wanker|wanky|whoar|whore|willies|willy|xrated|xxx)\b/gi
  4388. , Ec = {
  4389. object: Tc,
  4390. array: Ic,
  4391. regex: Mc
  4392. };
  4393. const Pc = Sc.words
  4394. , Cc = Ec.array;
  4395. class Ac {
  4396. constructor(t={}) {
  4397. Object.assign(this, {
  4398. list: t.emptyList && [] || Array.prototype.concat.apply(Pc, [Cc, t.list || []]),
  4399. exclude: t.exclude || [],
  4400. splitRegex: t.splitRegex || /\b/,
  4401. placeHolder: t.placeHolder || "*",
  4402. regex: t.regex || /[^a-zA-Z0-9|\$|\@]|\^/g,
  4403. replaceRegex: t.replaceRegex || /\w/g
  4404. })
  4405. }
  4406. isProfane(t) {
  4407. return this.list.filter(i=>{
  4408. const s = new RegExp(`\\b ${i.replace(/(\W)/g, "\\$1")}\\b`,"gi");
  4409. return !this.exclude.includes(i.toLowerCase()) && s.test(t)
  4410. }
  4411. ).length > 0 || !1
  4412. }
  4413. replaceWord(t) {
  4414. return t.replace(this.regex, "").replace(this.replaceRegex, this.placeHolder)
  4415. }
  4416. clean(t) {
  4417. return t.split(this.splitRegex).map(i=>this.isProfane(i) ? this.replaceWord(i) : i).join(this.splitRegex.exec(t)[0])
  4418. }
  4419. addWords() {
  4420. let t = Array.from(arguments);
  4421. this.list.push(...t),
  4422. t.map(i=>i.toLowerCase()).forEach(i=>{
  4423. this.exclude.includes(i) && this.exclude.splice(this.exclude.indexOf(i), 1)
  4424. }
  4425. )
  4426. }
  4427. removeWords() {
  4428. this.exclude.push(...Array.from(arguments).map(t=>t.toLowerCase()))
  4429. }
  4430. }
  4431. var Dc = Ac;
  4432. const Yr = new Dc
  4433. , Oc = ["jew", "black", "baby", "child", "white", "porn", "pedo", "trump", "clinton", "hitler", "nazi", "gay", "pride", "sex", "pleasure", "touch", "poo", "kids", "rape", "white power", "nigga", "nig nog", "doggy", "rapist", "boner", "nigger", "nigg", "finger", "nogger", "nagger", "nig", "fag", "gai", "pole", "stripper", "penis", "vagina", "pussy", "nazi", "hitler", "stalin", "burn", "chamber", "cock", "peen", "dick", "spick", "nieger", "die", "satan", "n|ig", "nlg", "cunt", "c0ck", "fag", "lick", "condom", "anal", "shit", "phile", "little", "kids", "free KR", "tiny", "sidney", "ass", "kill", ".io", "(dot)", "[dot]", "mini", "whiore", "whore", "faggot", "github", "1337", "666", "satan", "senpa", "discord", "d1scord", "mistik", ".io", "senpa.io", "sidney", "sid", "senpaio", "vries", "asa"];
  4434. Yr.addWords(...Oc);
  4435. const _s = Math.abs
  4436. , at = Math.cos
  4437. , lt = Math.sin
  4438. , Bs = Math.pow
  4439. , Rc = Math.sqrt;
  4440. function _c(e, t, i, s, n, r, o, l, c, a, u, p, h, m) {
  4441. this.id = e,
  4442. this.sid = t,
  4443. this.tmpScore = 0,
  4444. this.team = null,
  4445. this.skinIndex = 0,
  4446. this.tailIndex = 0,
  4447. this.hitTime = 0,
  4448. this.tails = {};
  4449. for (var w = 0; w < u.length; ++w)
  4450. u[w].price <= 0 && (this.tails[u[w].id] = 1);
  4451. this.skins = {};
  4452. for (var w = 0; w < a.length; ++w)
  4453. a[w].price <= 0 && (this.skins[a[w].id] = 1);
  4454. this.points = 0,
  4455. this.dt = 0,
  4456. this.hidden = !1,
  4457. this.itemCounts = {},
  4458. this.isPlayer = !0,
  4459. this.pps = 0,
  4460. this.moveDir = void 0,
  4461. this.skinRot = 0,
  4462. this.lastPing = 0,
  4463. this.iconIndex = 0,
  4464. this.skinColor = 0,
  4465. this.spawn = function(k) {
  4466. this.active = !0,
  4467. this.alive = !0,
  4468. this.lockMove = !1,
  4469. this.lockDir = !1,
  4470. this.minimapCounter = 0,
  4471. this.chatCountdown = 0,
  4472. this.shameCount = 0,
  4473. this.shameTimer = 0,
  4474. this.sentTo = {},
  4475. this.gathering = 0,
  4476. this.autoGather = 0,
  4477. this.animTime = 0,
  4478. this.animSpeed = 0,
  4479. this.mouseState = 0,
  4480. this.buildIndex = -1,
  4481. this.weaponIndex = 0,
  4482. this.dmgOverTime = {},
  4483. this.noMovTimer = 0,
  4484. this.maxXP = 300,
  4485. this.XP = 0,
  4486. this.age = 1,
  4487. this.kills = 0,
  4488. this.upgrAge = 2,
  4489. this.upgradePoints = 0,
  4490. this.x = 0,
  4491. this.y = 0,
  4492. this.zIndex = 0,
  4493. this.xVel = 0,
  4494. this.yVel = 0,
  4495. this.slowMult = 1,
  4496. this.dir = 0,
  4497. this.dirPlus = 0,
  4498. this.targetDir = 0,
  4499. this.targetAngle = 0,
  4500. this.maxHealth = 100,
  4501. this.health = this.maxHealth,
  4502. this.scale = i.playerScale,
  4503. this.speed = i.playerSpeed,
  4504. this.resetMoveDir(),
  4505. this.resetResources(k),
  4506. this.items = [0, 3, 6, 10],
  4507. this.weapons = [0],
  4508. this.shootCount = 0,
  4509. this.weaponXP = [],
  4510. this.reloads = {},
  4511. this.timeSpentNearVolcano = 0
  4512. }
  4513. ,
  4514. this.resetMoveDir = function() {
  4515. this.moveDir = void 0
  4516. }
  4517. ,
  4518. this.resetResources = function(k) {
  4519. for (let S = 0; S < i.resourceTypes.length; ++S)
  4520. this[i.resourceTypes[S]] = k ? 100 : 0
  4521. }
  4522. ,
  4523. this.addItem = function(k) {
  4524. const S = c.list[k];
  4525. if (S) {
  4526. for (let O = 0; O < this.items.length; ++O)
  4527. if (c.list[this.items[O]].group == S.group)
  4528. return this.buildIndex == this.items[O] && (this.buildIndex = k),
  4529. this.items[O] = k,
  4530. !0;
  4531. return this.items.push(k),
  4532. !0
  4533. }
  4534. return !1
  4535. }
  4536. ,
  4537. this.setUserData = function(k) {
  4538. if (k) {
  4539. this.name = "unknown";
  4540. let S = k.name + "";
  4541. S = S.slice(0, i.maxNameLength),
  4542. S = S.replace(/[^\w:\(\)\/? -]+/gmi, " "),
  4543. S = S.replace(/[^\x00-\x7F]/g, " "),
  4544. S = S.trim();
  4545. let O = !1;
  4546. const U = S.toLowerCase().replace(/\s/g, "").replace(/1/g, "i").replace(/0/g, "o").replace(/5/g, "s");
  4547. for (const L of Yr.list)
  4548. if (U.indexOf(L) != -1) {
  4549. O = !0;
  4550. break
  4551. }
  4552. S.length > 0 && !O && (this.name = S),
  4553. this.skinColor = 0,
  4554. i.skinColors[k.skin] && (this.skinColor = k.skin)
  4555. }
  4556. }
  4557. ,
  4558. this.getData = function() {
  4559. return [this.id, this.sid, this.name, s.fixTo(this.x, 2), s.fixTo(this.y, 2), s.fixTo(this.dir, 3), this.health, this.maxHealth, this.scale, this.skinColor]
  4560. }
  4561. ,
  4562. this.setData = function(k) {
  4563. this.id = k[0],
  4564. this.sid = k[1],
  4565. this.name = k[2],
  4566. this.x = k[3],
  4567. this.y = k[4],
  4568. this.dir = k[5],
  4569. this.health = k[6],
  4570. this.maxHealth = k[7],
  4571. this.scale = k[8],
  4572. this.skinColor = k[9]
  4573. }
  4574. ;
  4575. let v = 0;
  4576. this.update = function(k) {
  4577. if (!this.alive)
  4578. return;
  4579. if ((s.getDistance(this.x, this.y, i.volcanoLocationX, i.volcanoLocationY) || 0) < i.volcanoAggressionRadius && (this.timeSpentNearVolcano += k,
  4580. this.timeSpentNearVolcano >= 1e3 && (this.changeHealth(i.volcanoDamagePerSecond, null),
  4581. p.send(this.id, "8", Math.round(this.x), Math.round(this.y), i.volcanoDamagePerSecond, -1),
  4582. this.timeSpentNearVolcano %= 1e3)),
  4583. this.shameTimer > 0 && (this.shameTimer -= k,
  4584. this.shameTimer <= 0 && (this.shameTimer = 0,
  4585. this.shameCount = 0)),
  4586. v -= k,
  4587. v <= 0) {
  4588. const _ = (this.skin && this.skin.healthRegen ? this.skin.healthRegen : 0) + (this.tail && this.tail.healthRegen ? this.tail.healthRegen : 0);
  4589. _ && this.changeHealth(_, this),
  4590. this.dmgOverTime.dmg && (this.changeHealth(-this.dmgOverTime.dmg, this.dmgOverTime.doer),
  4591. this.dmgOverTime.time -= 1,
  4592. this.dmgOverTime.time <= 0 && (this.dmgOverTime.dmg = 0)),
  4593. this.healCol && this.changeHealth(this.healCol, this),
  4594. v = 1e3
  4595. }
  4596. if (!this.alive)
  4597. return;
  4598. if (this.slowMult < 1 && (this.slowMult += 8e-4 * k,
  4599. this.slowMult > 1 && (this.slowMult = 1)),
  4600. this.noMovTimer += k,
  4601. (this.xVel || this.yVel) && (this.noMovTimer = 0),
  4602. this.lockMove)
  4603. this.xVel = 0,
  4604. this.yVel = 0;
  4605. else {
  4606. let _ = (this.buildIndex >= 0 ? .5 : 1) * (c.weapons[this.weaponIndex].spdMult || 1) * (this.skin && this.skin.spdMult || 1) * (this.tail && this.tail.spdMult || 1) * (this.y <= i.snowBiomeTop ? this.skin && this.skin.coldM ? 1 : i.snowSpeed : 1) * this.slowMult;
  4607. !this.zIndex && this.y >= i.mapScale / 2 - i.riverWidth / 2 && this.y <= i.mapScale / 2 + i.riverWidth / 2 && (this.skin && this.skin.watrImm ? (_ *= .75,
  4608. this.xVel += i.waterCurrent * .4 * k) : (_ *= .33,
  4609. this.xVel += i.waterCurrent * k));
  4610. let $ = this.moveDir != null ? at(this.moveDir) : 0
  4611. , V = this.moveDir != null ? lt(this.moveDir) : 0;
  4612. const z = Rc($ * $ + V * V);
  4613. z != 0 && ($ /= z,
  4614. V /= z),
  4615. $ && (this.xVel += $ * this.speed * _ * k),
  4616. V && (this.yVel += V * this.speed * _ * k)
  4617. }
  4618. this.zIndex = 0,
  4619. this.lockMove = !1,
  4620. this.healCol = 0;
  4621. let O;
  4622. const U = s.getDistance(0, 0, this.xVel * k, this.yVel * k)
  4623. , L = Math.min(4, Math.max(1, Math.round(U / 40)))
  4624. , q = 1 / L;
  4625. let P = {};
  4626. for (var W = 0; W < L; ++W) {
  4627. this.xVel && (this.x += this.xVel * k * q),
  4628. this.yVel && (this.y += this.yVel * k * q),
  4629. O = r.getGridArrays(this.x, this.y, this.scale);
  4630. for (let _ = 0; _ < O.length; ++_) {
  4631. for (let $ = 0; $ < O[_].length && !(O[_][$].active && !P[O[_][$].sid] && r.checkCollision(this, O[_][$], q) && (P[O[_][$].sid] = !0,
  4632. !this.alive)); ++$)
  4633. ;
  4634. if (!this.alive)
  4635. break
  4636. }
  4637. if (!this.alive)
  4638. break
  4639. }
  4640. for (var F = o.indexOf(this), W = F + 1; W < o.length; ++W)
  4641. o[W] != this && o[W].alive && r.checkCollision(this, o[W]);
  4642. if (this.xVel && (this.xVel *= Bs(i.playerDecel, k),
  4643. this.xVel <= .01 && this.xVel >= -.01 && (this.xVel = 0)),
  4644. this.yVel && (this.yVel *= Bs(i.playerDecel, k),
  4645. this.yVel <= .01 && this.yVel >= -.01 && (this.yVel = 0)),
  4646. this.x - this.scale < 0 ? this.x = this.scale : this.x + this.scale > i.mapScale && (this.x = i.mapScale - this.scale),
  4647. this.y - this.scale < 0 ? this.y = this.scale : this.y + this.scale > i.mapScale && (this.y = i.mapScale - this.scale),
  4648. this.buildIndex < 0) {
  4649. if (this.reloads[this.weaponIndex] > 0)
  4650. this.reloads[this.weaponIndex] -= k,
  4651. this.gathering = this.mouseState;
  4652. else if (this.gathering || this.autoGather) {
  4653. let _ = !0;
  4654. if (c.weapons[this.weaponIndex].gather != null)
  4655. this.gather(o);
  4656. else if (c.weapons[this.weaponIndex].projectile != null && this.hasRes(c.weapons[this.weaponIndex], this.skin ? this.skin.projCost : 0)) {
  4657. this.useRes(c.weapons[this.weaponIndex], this.skin ? this.skin.projCost : 0),
  4658. this.noMovTimer = 0;
  4659. var F = c.weapons[this.weaponIndex].projectile;
  4660. const V = this.scale * 2
  4661. , z = this.skin && this.skin.aMlt ? this.skin.aMlt : 1;
  4662. c.weapons[this.weaponIndex].rec && (this.xVel -= c.weapons[this.weaponIndex].rec * at(this.dir),
  4663. this.yVel -= c.weapons[this.weaponIndex].rec * lt(this.dir)),
  4664. n.addProjectile(this.x + V * at(this.dir), this.y + V * lt(this.dir), this.dir, c.projectiles[F].range * z, c.projectiles[F].speed * z, F, this, null, this.zIndex)
  4665. } else
  4666. _ = !1;
  4667. this.gathering = this.mouseState,
  4668. _ && (this.reloads[this.weaponIndex] = c.weapons[this.weaponIndex].speed * (this.skin && this.skin.atkSpd || 1))
  4669. }
  4670. }
  4671. }
  4672. ,
  4673. this.addWeaponXP = function(k) {
  4674. this.weaponXP[this.weaponIndex] || (this.weaponXP[this.weaponIndex] = 0),
  4675. this.weaponXP[this.weaponIndex] += k
  4676. }
  4677. ,
  4678. this.earnXP = function(k) {
  4679. this.age < i.maxAge && (this.XP += k,
  4680. this.XP >= this.maxXP ? (this.age < i.maxAge ? (this.age++,
  4681. this.XP = 0,
  4682. this.maxXP *= 1.2) : this.XP = this.maxXP,
  4683. this.upgradePoints++,
  4684. p.send(this.id, "U", this.upgradePoints, this.upgrAge),
  4685. p.send(this.id, "T", this.XP, s.fixTo(this.maxXP, 1), this.age)) : p.send(this.id, "T", this.XP))
  4686. }
  4687. ,
  4688. this.changeHealth = function(k, S) {
  4689. if (k > 0 && this.health >= this.maxHealth)
  4690. return !1;
  4691. k < 0 && this.skin && (k *= this.skin.dmgMult || 1),
  4692. k < 0 && this.tail && (k *= this.tail.dmgMult || 1),
  4693. k < 0 && (this.hitTime = Date.now()),
  4694. this.health += k,
  4695. this.health > this.maxHealth && (k -= this.health - this.maxHealth,
  4696. this.health = this.maxHealth),
  4697. this.health <= 0 && this.kill(S);
  4698. for (let O = 0; O < o.length; ++O)
  4699. this.sentTo[o[O].id] && p.send(o[O].id, "O", this.sid, this.health);
  4700. return S && S.canSee(this) && !(S == this && k < 0) && p.send(S.id, "8", Math.round(this.x), Math.round(this.y), Math.round(-k), 1),
  4701. !0
  4702. }
  4703. ,
  4704. this.kill = function(k) {
  4705. k && k.alive && (k.kills++,
  4706. k.skin && k.skin.goldSteal ? h(k, Math.round(this.points / 2)) : h(k, Math.round(this.age * 100 * (k.skin && k.skin.kScrM ? k.skin.kScrM : 1))),
  4707. p.send(k.id, "N", "kills", k.kills, 1)),
  4708. this.alive = !1,
  4709. p.send(this.id, "P"),
  4710. m()
  4711. }
  4712. ,
  4713. this.addResource = function(k, S, O) {
  4714. !O && S > 0 && this.addWeaponXP(S),
  4715. k == 3 ? h(this, S, !0) : (this[i.resourceTypes[k]] += S,
  4716. p.send(this.id, "N", i.resourceTypes[k], this[i.resourceTypes[k]], 1))
  4717. }
  4718. ,
  4719. this.changeItemCount = function(k, S) {
  4720. this.itemCounts[k] = this.itemCounts[k] || 0,
  4721. this.itemCounts[k] += S,
  4722. p.send(this.id, "S", k, this.itemCounts[k])
  4723. }
  4724. ,
  4725. this.buildItem = function(k) {
  4726. const S = this.scale + k.scale + (k.placeOffset || 0)
  4727. , O = this.x + S * at(this.dir)
  4728. , U = this.y + S * lt(this.dir);
  4729. if (this.canBuild(k) && !(k.consume && this.skin && this.skin.noEat) && (k.consume || r.checkItemLocation(O, U, k.scale, .6, k.id, !1, this))) {
  4730. let L = !1;
  4731. if (k.consume) {
  4732. if (this.hitTime) {
  4733. const q = Date.now() - this.hitTime;
  4734. this.hitTime = 0,
  4735. q <= 120 ? (this.shameCount++,
  4736. this.shameCount >= 8 && (this.shameTimer = 3e4,
  4737. this.shameCount = 0)) : (this.shameCount -= 2,
  4738. this.shameCount <= 0 && (this.shameCount = 0))
  4739. }
  4740. this.shameTimer <= 0 && (L = k.consume(this))
  4741. } else
  4742. L = !0,
  4743. k.group.limit && this.changeItemCount(k.group.id, 1),
  4744. k.pps && (this.pps += k.pps),
  4745. r.add(r.objects.length, O, U, this.dir, k.scale, k.type, k, !1, this);
  4746. L && (this.useRes(k),
  4747. this.buildIndex = -1)
  4748. }
  4749. }
  4750. ,
  4751. this.hasRes = function(k, S) {
  4752. for (let O = 0; O < k.req.length; ) {
  4753. if (this[k.req[O]] < Math.round(k.req[O + 1] * (S || 1)))
  4754. return !1;
  4755. O += 2
  4756. }
  4757. return !0
  4758. }
  4759. ,
  4760. this.useRes = function(k, S) {
  4761. if (!i.inSandbox)
  4762. for (let O = 0; O < k.req.length; )
  4763. this.addResource(i.resourceTypes.indexOf(k.req[O]), -Math.round(k.req[O + 1] * (S || 1))),
  4764. O += 2
  4765. }
  4766. ,
  4767. this.canBuild = function(k) {
  4768. const S = i.inSandbox ? k.group.sandboxLimit || Math.max(k.group.limit * 3, 99) : k.group.limit;
  4769. return S && this.itemCounts[k.group.id] >= S ? !1 : i.inSandbox ? !0 : this.hasRes(k)
  4770. }
  4771. ,
  4772. this.gather = function() {
  4773. this.noMovTimer = 0,
  4774. this.slowMult -= c.weapons[this.weaponIndex].hitSlow || .3,
  4775. this.slowMult < 0 && (this.slowMult = 0);
  4776. const k = i.fetchVariant(this)
  4777. , S = k.poison
  4778. , O = k.val
  4779. , U = {};
  4780. let L, q, P, W;
  4781. const F = r.getGridArrays(this.x, this.y, c.weapons[this.weaponIndex].range);
  4782. for (let $ = 0; $ < F.length; ++$)
  4783. for (var _ = 0; _ < F[$].length; ++_)
  4784. if (P = F[$][_],
  4785. P.active && !P.dontGather && !U[P.sid] && P.visibleToPlayer(this) && (L = s.getDistance(this.x, this.y, P.x, P.y) - P.scale,
  4786. L <= c.weapons[this.weaponIndex].range && (q = s.getDirection(P.x, P.y, this.x, this.y),
  4787. s.getAngleDist(q, this.dir) <= i.gatherAngle))) {
  4788. if (U[P.sid] = 1,
  4789. P.health) {
  4790. if (P.changeHealth(-c.weapons[this.weaponIndex].dmg * O * (c.weapons[this.weaponIndex].sDmg || 1) * (this.skin && this.skin.bDmg ? this.skin.bDmg : 1), this)) {
  4791. for (let V = 0; V < P.req.length; )
  4792. this.addResource(i.resourceTypes.indexOf(P.req[V]), P.req[V + 1]),
  4793. V += 2;
  4794. r.disableObj(P)
  4795. }
  4796. } else {
  4797. if (P.name === "volcano")
  4798. this.hitVolcano(c.weapons[this.weaponIndex].gather);
  4799. else {
  4800. this.earnXP(4 * c.weapons[this.weaponIndex].gather);
  4801. const V = c.weapons[this.weaponIndex].gather + (P.type == 3 ? 4 : 0);
  4802. this.addResource(P.type, V)
  4803. }
  4804. this.skin && this.skin.extraGold && this.addResource(3, 1)
  4805. }
  4806. W = !0,
  4807. r.hitObj(P, q)
  4808. }
  4809. for (var _ = 0; _ < o.length + l.length; ++_)
  4810. if (P = o[_] || l[_ - o.length],
  4811. P != this && P.alive && !(P.team && P.team == this.team) && (L = s.getDistance(this.x, this.y, P.x, P.y) - P.scale * 1.8,
  4812. L <= c.weapons[this.weaponIndex].range && (q = s.getDirection(P.x, P.y, this.x, this.y),
  4813. s.getAngleDist(q, this.dir) <= i.gatherAngle))) {
  4814. let V = c.weapons[this.weaponIndex].steal;
  4815. V && P.addResource && (V = Math.min(P.points || 0, V),
  4816. this.addResource(3, V),
  4817. P.addResource(3, -V));
  4818. let z = O;
  4819. P.weaponIndex != null && c.weapons[P.weaponIndex].shield && s.getAngleDist(q + Math.PI, P.dir) <= i.shieldAngle && (z = c.weapons[P.weaponIndex].shield);
  4820. const X = c.weapons[this.weaponIndex].dmg
  4821. , G = X * (this.skin && this.skin.dmgMultO ? this.skin.dmgMultO : 1) * (this.tail && this.tail.dmgMultO ? this.tail.dmgMultO : 1)
  4822. , te = .3 * (P.weightM || 1) + (c.weapons[this.weaponIndex].knock || 0);
  4823. P.xVel += te * at(q),
  4824. P.yVel += te * lt(q),
  4825. this.skin && this.skin.healD && this.changeHealth(G * z * this.skin.healD, this),
  4826. this.tail && this.tail.healD && this.changeHealth(G * z * this.tail.healD, this),
  4827. P.skin && P.skin.dmg && this.changeHealth(-X * P.skin.dmg, P),
  4828. P.tail && P.tail.dmg && this.changeHealth(-X * P.tail.dmg, P),
  4829. P.dmgOverTime && this.skin && this.skin.poisonDmg && !(P.skin && P.skin.poisonRes) && (P.dmgOverTime.dmg = this.skin.poisonDmg,
  4830. P.dmgOverTime.time = this.skin.poisonTime || 1,
  4831. P.dmgOverTime.doer = this),
  4832. P.dmgOverTime && S && !(P.skin && P.skin.poisonRes) && (P.dmgOverTime.dmg = 5,
  4833. P.dmgOverTime.time = 5,
  4834. P.dmgOverTime.doer = this),
  4835. P.skin && P.skin.dmgK && (this.xVel -= P.skin.dmgK * at(q),
  4836. this.yVel -= P.skin.dmgK * lt(q)),
  4837. P.changeHealth(-G * z, this, this)
  4838. }
  4839. this.sendAnimation(W ? 1 : 0)
  4840. }
  4841. ,
  4842. this.hitVolcano = function(k) {
  4843. const S = 5 + Math.round(k / 3.5);
  4844. this.addResource(2, S),
  4845. this.addResource(3, S)
  4846. }
  4847. ,
  4848. this.sendAnimation = function(k) {
  4849. for (let S = 0; S < o.length; ++S)
  4850. this.sentTo[o[S].id] && this.canSee(o[S]) && p.send(o[S].id, "K", this.sid, k ? 1 : 0, this.weaponIndex)
  4851. }
  4852. ;
  4853. let x = 0
  4854. , D = 0;
  4855. this.animate = function(k) {
  4856. this.animTime > 0 && (this.animTime -= k,
  4857. this.animTime <= 0 ? (this.animTime = 0,
  4858. this.dirPlus = 0,
  4859. x = 0,
  4860. D = 0) : D == 0 ? (x += k / (this.animSpeed * i.hitReturnRatio),
  4861. this.dirPlus = s.lerp(0, this.targetAngle, Math.min(1, x)),
  4862. x >= 1 && (x = 1,
  4863. D = 1)) : (x -= k / (this.animSpeed * (1 - i.hitReturnRatio)),
  4864. this.dirPlus = s.lerp(0, this.targetAngle, Math.max(0, x))))
  4865. }
  4866. ,
  4867. this.startAnim = function(k, S) {
  4868. this.animTime = this.animSpeed = c.weapons[S].speed,
  4869. this.targetAngle = k ? -i.hitAngle : -Math.PI,
  4870. x = 0,
  4871. D = 0
  4872. }
  4873. ,
  4874. this.canSee = function(k) {
  4875. if (!k || k.skin && k.skin.invisTimer && k.noMovTimer >= k.skin.invisTimer)
  4876. return !1;
  4877. const S = _s(k.x - this.x) - k.scale
  4878. , O = _s(k.y - this.y) - k.scale;
  4879. return S <= i.maxScreenWidth / 2 * 1.3 && O <= i.maxScreenHeight / 2 * 1.3
  4880. }
  4881. }
  4882. const Bc = [{
  4883. id: 45,
  4884. name: "Shame!",
  4885. dontSell: !0,
  4886. price: 0,
  4887. scale: 120,
  4888. desc: "hacks are for losers"
  4889. }, {
  4890. id: 51,
  4891. name: "Moo Cap",
  4892. price: 0,
  4893. scale: 120,
  4894. desc: "coolest mooer around"
  4895. }, {
  4896. id: 50,
  4897. name: "Apple Cap",
  4898. price: 0,
  4899. scale: 120,
  4900. desc: "apple farms remembers"
  4901. }, {
  4902. id: 28,
  4903. name: "Moo Head",
  4904. price: 0,
  4905. scale: 120,
  4906. desc: "no effect"
  4907. }, {
  4908. id: 29,
  4909. name: "Pig Head",
  4910. price: 0,
  4911. scale: 120,
  4912. desc: "no effect"
  4913. }, {
  4914. id: 30,
  4915. name: "Fluff Head",
  4916. price: 0,
  4917. scale: 120,
  4918. desc: "no effect"
  4919. }, {
  4920. id: 36,
  4921. name: "Pandou Head",
  4922. price: 0,
  4923. scale: 120,
  4924. desc: "no effect"
  4925. }, {
  4926. id: 37,
  4927. name: "Bear Head",
  4928. price: 0,
  4929. scale: 120,
  4930. desc: "no effect"
  4931. }, {
  4932. id: 38,
  4933. name: "Monkey Head",
  4934. price: 0,
  4935. scale: 120,
  4936. desc: "no effect"
  4937. }, {
  4938. id: 44,
  4939. name: "Polar Head",
  4940. price: 0,
  4941. scale: 120,
  4942. desc: "no effect"
  4943. }, {
  4944. id: 35,
  4945. name: "Fez Hat",
  4946. price: 0,
  4947. scale: 120,
  4948. desc: "no effect"
  4949. }, {
  4950. id: 42,
  4951. name: "Enigma Hat",
  4952. price: 0,
  4953. scale: 120,
  4954. desc: "join the enigma army"
  4955. }, {
  4956. id: 43,
  4957. name: "Blitz Hat",
  4958. price: 0,
  4959. scale: 120,
  4960. desc: "hey everybody i'm blitz"
  4961. }, {
  4962. id: 49,
  4963. name: "Bob XIII Hat",
  4964. price: 0,
  4965. scale: 120,
  4966. desc: "like and subscribe"
  4967. }, {
  4968. id: 57,
  4969. name: "Pumpkin",
  4970. price: 50,
  4971. scale: 120,
  4972. desc: "Spooooky"
  4973. }, {
  4974. id: 8,
  4975. name: "Bummle Hat",
  4976. price: 100,
  4977. scale: 120,
  4978. desc: "no effect"
  4979. }, {
  4980. id: 2,
  4981. name: "Straw Hat",
  4982. price: 500,
  4983. scale: 120,
  4984. desc: "no effect"
  4985. }, {
  4986. id: 15,
  4987. name: "Winter Cap",
  4988. price: 600,
  4989. scale: 120,
  4990. desc: "allows you to move at normal speed in snow",
  4991. coldM: 1
  4992. }, {
  4993. id: 5,
  4994. name: "Cowboy Hat",
  4995. price: 1e3,
  4996. scale: 120,
  4997. desc: "no effect"
  4998. }, {
  4999. id: 4,
  5000. name: "Ranger Hat",
  5001. price: 2e3,
  5002. scale: 120,
  5003. desc: "no effect"
  5004. }, {
  5005. id: 18,
  5006. name: "Explorer Hat",
  5007. price: 2e3,
  5008. scale: 120,
  5009. desc: "no effect"
  5010. }, {
  5011. id: 31,
  5012. name: "Flipper Hat",
  5013. price: 2500,
  5014. scale: 120,
  5015. desc: "have more control while in water",
  5016. watrImm: !0
  5017. }, {
  5018. id: 1,
  5019. name: "Marksman Cap",
  5020. price: 3e3,
  5021. scale: 120,
  5022. desc: "increases arrow speed and range",
  5023. aMlt: 1.3
  5024. }, {
  5025. id: 10,
  5026. name: "Bush Gear",
  5027. price: 3e3,
  5028. scale: 160,
  5029. desc: "allows you to disguise yourself as a bush"
  5030. }, {
  5031. id: 48,
  5032. name: "Halo",
  5033. price: 3e3,
  5034. scale: 120,
  5035. desc: "no effect"
  5036. }, {
  5037. id: 6,
  5038. name: "Soldier Helmet",
  5039. price: 4e3,
  5040. scale: 120,
  5041. desc: "reduces damage taken but slows movement",
  5042. spdMult: .94,
  5043. dmgMult: .75
  5044. }, {
  5045. id: 23,
  5046. name: "Anti Venom Gear",
  5047. price: 4e3,
  5048. scale: 120,
  5049. desc: "makes you immune to poison",
  5050. poisonRes: 1
  5051. }, {
  5052. id: 13,
  5053. name: "Medic Gear",
  5054. price: 5e3,
  5055. scale: 110,
  5056. desc: "slowly regenerates health over time",
  5057. healthRegen: 3
  5058. }, {
  5059. id: 9,
  5060. name: "Miners Helmet",
  5061. price: 5e3,
  5062. scale: 120,
  5063. desc: "earn 1 extra gold per resource",
  5064. extraGold: 1
  5065. }, {
  5066. id: 32,
  5067. name: "Musketeer Hat",
  5068. price: 5e3,
  5069. scale: 120,
  5070. desc: "reduces cost of projectiles",
  5071. projCost: .5
  5072. }, {
  5073. id: 7,
  5074. name: "Bull Helmet",
  5075. price: 6e3,
  5076. scale: 120,
  5077. desc: "increases damage done but drains health",
  5078. healthRegen: -5,
  5079. dmgMultO: 1.5,
  5080. spdMult: .96
  5081. }, {
  5082. id: 22,
  5083. name: "Emp Helmet",
  5084. price: 6e3,
  5085. scale: 120,
  5086. desc: "turrets won't attack but you move slower",
  5087. antiTurret: 1,
  5088. spdMult: .7
  5089. }, {
  5090. id: 12,
  5091. name: "Booster Hat",
  5092. price: 6e3,
  5093. scale: 120,
  5094. desc: "increases your movement speed",
  5095. spdMult: 1.16
  5096. }, {
  5097. id: 26,
  5098. name: "Barbarian Armor",
  5099. price: 8e3,
  5100. scale: 120,
  5101. desc: "knocks back enemies that attack you",
  5102. dmgK: .6
  5103. }, {
  5104. id: 21,
  5105. name: "Plague Mask",
  5106. price: 1e4,
  5107. scale: 120,
  5108. desc: "melee attacks deal poison damage",
  5109. poisonDmg: 5,
  5110. poisonTime: 6
  5111. }, {
  5112. id: 46,
  5113. name: "Bull Mask",
  5114. price: 1e4,
  5115. scale: 120,
  5116. desc: "bulls won't target you unless you attack them",
  5117. bullRepel: 1
  5118. }, {
  5119. id: 14,
  5120. name: "Windmill Hat",
  5121. topSprite: !0,
  5122. price: 1e4,
  5123. scale: 120,
  5124. desc: "generates points while worn",
  5125. pps: 1.5
  5126. }, {
  5127. id: 11,
  5128. name: "Spike Gear",
  5129. topSprite: !0,
  5130. price: 1e4,
  5131. scale: 120,
  5132. desc: "deal damage to players that damage you",
  5133. dmg: .45
  5134. }, {
  5135. id: 53,
  5136. name: "Turret Gear",
  5137. topSprite: !0,
  5138. price: 1e4,
  5139. scale: 120,
  5140. desc: "you become a walking turret",
  5141. turret: {
  5142. proj: 1,
  5143. range: 700,
  5144. rate: 2500
  5145. },
  5146. spdMult: .7
  5147. }, {
  5148. id: 20,
  5149. name: "Samurai Armor",
  5150. price: 12e3,
  5151. scale: 120,
  5152. desc: "increased attack speed and fire rate",
  5153. atkSpd: .78
  5154. }, {
  5155. id: 58,
  5156. name: "Dark Knight",
  5157. price: 12e3,
  5158. scale: 120,
  5159. desc: "restores health when you deal damage",
  5160. healD: .4
  5161. }, {
  5162. id: 27,
  5163. name: "Scavenger Gear",
  5164. price: 15e3,
  5165. scale: 120,
  5166. desc: "earn double points for each kill",
  5167. kScrM: 2
  5168. }, {
  5169. id: 40,
  5170. name: "#### Gear",
  5171. price: 15e3,
  5172. scale: 120,
  5173. desc: "increased damage to buildings but slower movement",
  5174. spdMult: .3,
  5175. bDmg: 3.3
  5176. }, {
  5177. id: 52,
  5178. name: "Thief Gear",
  5179. price: 15e3,
  5180. scale: 120,
  5181. desc: "steal half of a players gold when you kill them",
  5182. goldSteal: .5
  5183. }, {
  5184. id: 55,
  5185. name: "Bloodthirster",
  5186. price: 2e4,
  5187. scale: 120,
  5188. desc: "Restore Health when dealing damage. And increased damage",
  5189. healD: .25,
  5190. dmgMultO: 1.2
  5191. }, {
  5192. id: 56,
  5193. name: "Assassin Gear",
  5194. price: 2e4,
  5195. scale: 120,
  5196. desc: "Go invisible when not moving. Can't eat. Increased speed",
  5197. noEat: !0,
  5198. spdMult: 1.1,
  5199. invisTimer: 1e3
  5200. }]
  5201. , zc = [{
  5202. id: 12,
  5203. name: "Snowball",
  5204. price: 1e3,
  5205. scale: 105,
  5206. xOff: 18,
  5207. desc: "no effect"
  5208. }, {
  5209. id: 9,
  5210. name: "Tree Cape",
  5211. price: 1e3,
  5212. scale: 90,
  5213. desc: "no effect"
  5214. }, {
  5215. id: 10,
  5216. name: "Stone Cape",
  5217. price: 1e3,
  5218. scale: 90,
  5219. desc: "no effect"
  5220. }, {
  5221. id: 3,
  5222. name: "Cookie Cape",
  5223. price: 1500,
  5224. scale: 90,
  5225. desc: "no effect"
  5226. }, {
  5227. id: 8,
  5228. name: "Cow Cape",
  5229. price: 2e3,
  5230. scale: 90,
  5231. desc: "no effect"
  5232. }, {
  5233. id: 11,
  5234. name: "Monkey Tail",
  5235. price: 2e3,
  5236. scale: 97,
  5237. xOff: 25,
  5238. desc: "Super speed but reduced damage",
  5239. spdMult: 1.35,
  5240. dmgMultO: .2
  5241. }, {
  5242. id: 17,
  5243. name: "Apple Basket",
  5244. price: 3e3,
  5245. scale: 80,
  5246. xOff: 12,
  5247. desc: "slowly regenerates health over time",
  5248. healthRegen: 1
  5249. }, {
  5250. id: 6,
  5251. name: "Winter Cape",
  5252. price: 3e3,
  5253. scale: 90,
  5254. desc: "no effect"
  5255. }, {
  5256. id: 4,
  5257. name: "Skull Cape",
  5258. price: 4e3,
  5259. scale: 90,
  5260. desc: "no effect"
  5261. }, {
  5262. id: 5,
  5263. name: "Dash Cape",
  5264. price: 5e3,
  5265. scale: 90,
  5266. desc: "no effect"
  5267. }, {
  5268. id: 2,
  5269. name: "Dragon Cape",
  5270. price: 6e3,
  5271. scale: 90,
  5272. desc: "no effect"
  5273. }, {
  5274. id: 1,
  5275. name: "Super Cape",
  5276. price: 8e3,
  5277. scale: 90,
  5278. desc: "no effect"
  5279. }, {
  5280. id: 7,
  5281. name: "Troll Cape",
  5282. price: 8e3,
  5283. scale: 90,
  5284. desc: "no effect"
  5285. }, {
  5286. id: 14,
  5287. name: "Thorns",
  5288. price: 1e4,
  5289. scale: 115,
  5290. xOff: 20,
  5291. desc: "no effect"
  5292. }, {
  5293. id: 15,
  5294. name: "Blockades",
  5295. price: 1e4,
  5296. scale: 95,
  5297. xOff: 15,
  5298. desc: "no effect"
  5299. }, {
  5300. id: 20,
  5301. name: "Devils Tail",
  5302. price: 1e4,
  5303. scale: 95,
  5304. xOff: 20,
  5305. desc: "no effect"
  5306. }, {
  5307. id: 16,
  5308. name: "Sawblade",
  5309. price: 12e3,
  5310. scale: 90,
  5311. spin: !0,
  5312. xOff: 0,
  5313. desc: "deal damage to players that damage you",
  5314. dmg: .15
  5315. }, {
  5316. id: 13,
  5317. name: "Angel Wings",
  5318. price: 15e3,
  5319. scale: 138,
  5320. xOff: 22,
  5321. desc: "slowly regenerates health over time",
  5322. healthRegen: 3
  5323. }, {
  5324. id: 19,
  5325. name: "Shadow Wings",
  5326. price: 15e3,
  5327. scale: 138,
  5328. xOff: 22,
  5329. desc: "increased movement speed",
  5330. spdMult: 1.1
  5331. }, {
  5332. id: 18,
  5333. name: "Blood Wings",
  5334. price: 2e4,
  5335. scale: 178,
  5336. xOff: 26,
  5337. desc: "restores health when you deal damage",
  5338. healD: .2
  5339. }, {
  5340. id: 21,
  5341. name: "Corrupt X Wings",
  5342. price: 2e4,
  5343. scale: 178,
  5344. xOff: 26,
  5345. desc: "deal damage to players that damage you",
  5346. dmg: .25
  5347. }]
  5348. , $r = {
  5349. hats: Bc,
  5350. accessories: zc
  5351. };
  5352. function Hc(e, t, i, s, n, r, o) {
  5353. this.init = function(a, u, p, h, m, w, v, x, D) {
  5354. this.active = !0,
  5355. this.indx = a,
  5356. this.x = u,
  5357. this.y = p,
  5358. this.dir = h,
  5359. this.skipMov = !0,
  5360. this.speed = m,
  5361. this.dmg = w,
  5362. this.scale = x,
  5363. this.range = v,
  5364. this.owner = D,
  5365. o && (this.sentTo = {})
  5366. }
  5367. ;
  5368. const l = [];
  5369. let c;
  5370. this.update = function(a) {
  5371. if (this.active) {
  5372. let p = this.speed * a, h;
  5373. if (this.skipMov ? this.skipMov = !1 : (this.x += p * Math.cos(this.dir),
  5374. this.y += p * Math.sin(this.dir),
  5375. this.range -= p,
  5376. this.range <= 0 && (this.x += this.range * Math.cos(this.dir),
  5377. this.y += this.range * Math.sin(this.dir),
  5378. p = 1,
  5379. this.range = 0,
  5380. this.active = !1)),
  5381. o) {
  5382. for (var u = 0; u < e.length; ++u)
  5383. !this.sentTo[e[u].id] && e[u].canSee(this) && (this.sentTo[e[u].id] = 1,
  5384. o.send(e[u].id, "X", r.fixTo(this.x, 1), r.fixTo(this.y, 1), r.fixTo(this.dir, 2), r.fixTo(this.range, 1), this.speed, this.indx, this.layer, this.sid));
  5385. l.length = 0;
  5386. for (var u = 0; u < e.length + t.length; ++u)
  5387. c = e[u] || t[u - e.length],
  5388. c.alive && c != this.owner && !(this.owner.team && c.team == this.owner.team) && r.lineInRect(c.x - c.scale, c.y - c.scale, c.x + c.scale, c.y + c.scale, this.x, this.y, this.x + p * Math.cos(this.dir), this.y + p * Math.sin(this.dir)) && l.push(c);
  5389. const m = i.getGridArrays(this.x, this.y, this.scale);
  5390. for (let w = 0; w < m.length; ++w)
  5391. for (let v = 0; v < m[w].length; ++v)
  5392. c = m[w][v],
  5393. h = c.getScale(),
  5394. c.active && this.ignoreObj != c.sid && this.layer <= c.layer && l.indexOf(c) < 0 && !c.ignoreCollision && r.lineInRect(c.x - h, c.y - h, c.x + h, c.y + h, this.x, this.y, this.x + p * Math.cos(this.dir), this.y + p * Math.sin(this.dir)) && l.push(c);
  5395. if (l.length > 0) {
  5396. let w = null
  5397. , v = null
  5398. , x = null;
  5399. for (var u = 0; u < l.length; ++u)
  5400. x = r.getDistance(this.x, this.y, l[u].x, l[u].y),
  5401. (v == null || x < v) && (v = x,
  5402. w = l[u]);
  5403. if (w.isPlayer || w.isAI) {
  5404. const D = .3 * (w.weightM || 1);
  5405. w.xVel += D * Math.cos(this.dir),
  5406. w.yVel += D * Math.sin(this.dir),
  5407. (w.weaponIndex == null || !(s.weapons[w.weaponIndex].shield && r.getAngleDist(this.dir + Math.PI, w.dir) <= n.shieldAngle)) && w.changeHealth(-this.dmg, this.owner, this.owner)
  5408. } else {
  5409. w.projDmg && w.health && w.changeHealth(-this.dmg) && i.disableObj(w);
  5410. for (var u = 0; u < e.length; ++u)
  5411. e[u].active && (w.sentTo[e[u].id] && (w.active ? e[u].canSee(w) && o.send(e[u].id, "L", r.fixTo(this.dir, 2), w.sid) : o.send(e[u].id, "Q", w.sid)),
  5412. !w.active && w.owner == e[u] && e[u].changeItemCount(w.group.id, -1))
  5413. }
  5414. this.active = !1;
  5415. for (var u = 0; u < e.length; ++u)
  5416. this.sentTo[e[u].id] && o.send(e[u].id, "Y", this.sid, r.fixTo(v, 1))
  5417. }
  5418. }
  5419. }
  5420. }
  5421. }
  5422. var On = {}
  5423. , Fc = {
  5424. get exports() {
  5425. return On
  5426. },
  5427. set exports(e) {
  5428. On = e
  5429. }
  5430. }
  5431. , Rn = {}
  5432. , Vc = {
  5433. get exports() {
  5434. return Rn
  5435. },
  5436. set exports(e) {
  5437. Rn = e
  5438. }
  5439. };
  5440. (function() {
  5441. var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  5442. , t = {
  5443. rotl: function(i, s) {
  5444. return i << s | i >>> 32 - s
  5445. },
  5446. rotr: function(i, s) {
  5447. return i << 32 - s | i >>> s
  5448. },
  5449. endian: function(i) {
  5450. if (i.constructor == Number)
  5451. return t.rotl(i, 8) & 16711935 | t.rotl(i, 24) & 4278255360;
  5452. for (var s = 0; s < i.length; s++)
  5453. i[s] = t.endian(i[s]);
  5454. return i
  5455. },
  5456. randomBytes: function(i) {
  5457. for (var s = []; i > 0; i--)
  5458. s.push(Math.floor(Math.random() * 256));
  5459. return s
  5460. },
  5461. bytesToWords: function(i) {
  5462. for (var s = [], n = 0, r = 0; n < i.length; n++,
  5463. r += 8)
  5464. s[r >>> 5] |= i[n] << 24 - r % 32;
  5465. return s
  5466. },
  5467. wordsToBytes: function(i) {
  5468. for (var s = [], n = 0; n < i.length * 32; n += 8)
  5469. s.push(i[n >>> 5] >>> 24 - n % 32 & 255);
  5470. return s
  5471. },
  5472. bytesToHex: function(i) {
  5473. for (var s = [], n = 0; n < i.length; n++)
  5474. s.push((i[n] >>> 4).toString(16)),
  5475. s.push((i[n] & 15).toString(16));
  5476. return s.join("")
  5477. },
  5478. hexToBytes: function(i) {
  5479. for (var s = [], n = 0; n < i.length; n += 2)
  5480. s.push(parseInt(i.substr(n, 2), 16));
  5481. return s
  5482. },
  5483. bytesToBase64: function(i) {
  5484. for (var s = [], n = 0; n < i.length; n += 3)
  5485. for (var r = i[n] << 16 | i[n + 1] << 8 | i[n + 2], o = 0; o < 4; o++)
  5486. n * 8 + o * 6 <= i.length * 8 ? s.push(e.charAt(r >>> 6 * (3 - o) & 63)) : s.push("=");
  5487. return s.join("")
  5488. },
  5489. base64ToBytes: function(i) {
  5490. i = i.replace(/[^A-Z0-9+\/]/ig, "");
  5491. for (var s = [], n = 0, r = 0; n < i.length; r = ++n % 4)
  5492. r != 0 && s.push((e.indexOf(i.charAt(n - 1)) & Math.pow(2, -2 * r + 8) - 1) << r * 2 | e.indexOf(i.charAt(n)) >>> 6 - r * 2);
  5493. return s
  5494. }
  5495. };
  5496. Vc.exports = t
  5497. }
  5498. )();
  5499. var _n = {
  5500. utf8: {
  5501. stringToBytes: function(e) {
  5502. return _n.bin.stringToBytes(unescape(encodeURIComponent(e)))
  5503. },
  5504. bytesToString: function(e) {
  5505. return decodeURIComponent(escape(_n.bin.bytesToString(e)))
  5506. }
  5507. },
  5508. bin: {
  5509. stringToBytes: function(e) {
  5510. for (var t = [], i = 0; i < e.length; i++)
  5511. t.push(e.charCodeAt(i) & 255);
  5512. return t
  5513. },
  5514. bytesToString: function(e) {
  5515. for (var t = [], i = 0; i < e.length; i++)
  5516. t.push(String.fromCharCode(e[i]));
  5517. return t.join("")
  5518. }
  5519. }
  5520. }
  5521. , zs = _n;
  5522. /*!
  5523. * Determine if an object is a Buffer
  5524. *
  5525. * @author Feross Aboukhadijeh <https://feross.org>
  5526. * @license MIT
  5527. */
  5528. var Uc = function(e) {
  5529. return e != null && (Kr(e) || Lc(e) || !!e._isBuffer)
  5530. };
  5531. function Kr(e) {
  5532. return !!e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e)
  5533. }
  5534. function Lc(e) {
  5535. return typeof e.readFloatLE == "function" && typeof e.slice == "function" && Kr(e.slice(0, 0))
  5536. }
  5537. (function() {
  5538. var e = Rn
  5539. , t = zs.utf8
  5540. , i = Uc
  5541. , s = zs.bin
  5542. , n = function(r, o) {
  5543. r.constructor == String ? o && o.encoding === "binary" ? r = s.stringToBytes(r) : r = t.stringToBytes(r) : i(r) ? r = Array.prototype.slice.call(r, 0) : !Array.isArray(r) && r.constructor !== Uint8Array && (r = r.toString());
  5544. for (var l = e.bytesToWords(r), c = r.length * 8, a = 1732584193, u = -271733879, p = -1732584194, h = 271733878, m = 0; m < l.length; m++)
  5545. l[m] = (l[m] << 8 | l[m] >>> 24) & 16711935 | (l[m] << 24 | l[m] >>> 8) & 4278255360;
  5546. l[c >>> 5] |= 128 << c % 32,
  5547. l[(c + 64 >>> 9 << 4) + 14] = c;
  5548. for (var w = n._ff, v = n._gg, x = n._hh, D = n._ii, m = 0; m < l.length; m += 16) {
  5549. var k = a
  5550. , S = u
  5551. , O = p
  5552. , U = h;
  5553. a = w(a, u, p, h, l[m + 0], 7, -680876936),
  5554. h = w(h, a, u, p, l[m + 1], 12, -389564586),
  5555. p = w(p, h, a, u, l[m + 2], 17, 606105819),
  5556. u = w(u, p, h, a, l[m + 3], 22, -1044525330),
  5557. a = w(a, u, p, h, l[m + 4], 7, -176418897),
  5558. h = w(h, a, u, p, l[m + 5], 12, 1200080426),
  5559. p = w(p, h, a, u, l[m + 6], 17, -1473231341),
  5560. u = w(u, p, h, a, l[m + 7], 22, -45705983),
  5561. a = w(a, u, p, h, l[m + 8], 7, 1770035416),
  5562. h = w(h, a, u, p, l[m + 9], 12, -1958414417),
  5563. p = w(p, h, a, u, l[m + 10], 17, -42063),
  5564. u = w(u, p, h, a, l[m + 11], 22, -1990404162),
  5565. a = w(a, u, p, h, l[m + 12], 7, 1804603682),
  5566. h = w(h, a, u, p, l[m + 13], 12, -40341101),
  5567. p = w(p, h, a, u, l[m + 14], 17, -1502002290),
  5568. u = w(u, p, h, a, l[m + 15], 22, 1236535329),
  5569. a = v(a, u, p, h, l[m + 1], 5, -165796510),
  5570. h = v(h, a, u, p, l[m + 6], 9, -1069501632),
  5571. p = v(p, h, a, u, l[m + 11], 14, 643717713),
  5572. u = v(u, p, h, a, l[m + 0], 20, -373897302),
  5573. a = v(a, u, p, h, l[m + 5], 5, -701558691),
  5574. h = v(h, a, u, p, l[m + 10], 9, 38016083),
  5575. p = v(p, h, a, u, l[m + 15], 14, -660478335),
  5576. u = v(u, p, h, a, l[m + 4], 20, -405537848),
  5577. a = v(a, u, p, h, l[m + 9], 5, 568446438),
  5578. h = v(h, a, u, p, l[m + 14], 9, -1019803690),
  5579. p = v(p, h, a, u, l[m + 3], 14, -187363961),
  5580. u = v(u, p, h, a, l[m + 8], 20, 1163531501),
  5581. a = v(a, u, p, h, l[m + 13], 5, -1444681467),
  5582. h = v(h, a, u, p, l[m + 2], 9, -51403784),
  5583. p = v(p, h, a, u, l[m + 7], 14, 1735328473),
  5584. u = v(u, p, h, a, l[m + 12], 20, -1926607734),
  5585. a = x(a, u, p, h, l[m + 5], 4, -378558),
  5586. h = x(h, a, u, p, l[m + 8], 11, -2022574463),
  5587. p = x(p, h, a, u, l[m + 11], 16, 1839030562),
  5588. u = x(u, p, h, a, l[m + 14], 23, -35309556),
  5589. a = x(a, u, p, h, l[m + 1], 4, -1530992060),
  5590. h = x(h, a, u, p, l[m + 4], 11, 1272893353),
  5591. p = x(p, h, a, u, l[m + 7], 16, -155497632),
  5592. u = x(u, p, h, a, l[m + 10], 23, -1094730640),
  5593. a = x(a, u, p, h, l[m + 13], 4, 681279174),
  5594. h = x(h, a, u, p, l[m + 0], 11, -358537222),
  5595. p = x(p, h, a, u, l[m + 3], 16, -722521979),
  5596. u = x(u, p, h, a, l[m + 6], 23, 76029189),
  5597. a = x(a, u, p, h, l[m + 9], 4, -640364487),
  5598. h = x(h, a, u, p, l[m + 12], 11, -421815835),
  5599. p = x(p, h, a, u, l[m + 15], 16, 530742520),
  5600. u = x(u, p, h, a, l[m + 2], 23, -995338651),
  5601. a = D(a, u, p, h, l[m + 0], 6, -198630844),
  5602. h = D(h, a, u, p, l[m + 7], 10, 1126891415),
  5603. p = D(p, h, a, u, l[m + 14], 15, -1416354905),
  5604. u = D(u, p, h, a, l[m + 5], 21, -57434055),
  5605. a = D(a, u, p, h, l[m + 12], 6, 1700485571),
  5606. h = D(h, a, u, p, l[m + 3], 10, -1894986606),
  5607. p = D(p, h, a, u, l[m + 10], 15, -1051523),
  5608. u = D(u, p, h, a, l[m + 1], 21, -2054922799),
  5609. a = D(a, u, p, h, l[m + 8], 6, 1873313359),
  5610. h = D(h, a, u, p, l[m + 15], 10, -30611744),
  5611. p = D(p, h, a, u, l[m + 6], 15, -1560198380),
  5612. u = D(u, p, h, a, l[m + 13], 21, 1309151649),
  5613. a = D(a, u, p, h, l[m + 4], 6, -145523070),
  5614. h = D(h, a, u, p, l[m + 11], 10, -1120210379),
  5615. p = D(p, h, a, u, l[m + 2], 15, 718787259),
  5616. u = D(u, p, h, a, l[m + 9], 21, -343485551),
  5617. a = a + k >>> 0,
  5618. u = u + S >>> 0,
  5619. p = p + O >>> 0,
  5620. h = h + U >>> 0
  5621. }
  5622. return e.endian([a, u, p, h])
  5623. };
  5624. n._ff = function(r, o, l, c, a, u, p) {
  5625. var h = r + (o & l | ~o & c) + (a >>> 0) + p;
  5626. return (h << u | h >>> 32 - u) + o
  5627. }
  5628. ,
  5629. n._gg = function(r, o, l, c, a, u, p) {
  5630. var h = r + (o & c | l & ~c) + (a >>> 0) + p;
  5631. return (h << u | h >>> 32 - u) + o
  5632. }
  5633. ,
  5634. n._hh = function(r, o, l, c, a, u, p) {
  5635. var h = r + (o ^ l ^ c) + (a >>> 0) + p;
  5636. return (h << u | h >>> 32 - u) + o
  5637. }
  5638. ,
  5639. n._ii = function(r, o, l, c, a, u, p) {
  5640. var h = r + (l ^ (o | ~c)) + (a >>> 0) + p;
  5641. return (h << u | h >>> 32 - u) + o
  5642. }
  5643. ,
  5644. n._blocksize = 16,
  5645. n._digestsize = 16,
  5646. Fc.exports = function(r, o) {
  5647. if (r == null)
  5648. throw new Error("Illegal argument " + r);
  5649. var l = e.wordsToBytes(n(r, o));
  5650. return o && o.asBytes ? l : o && o.asString ? s.bytesToString(l) : e.bytesToHex(l)
  5651. }
  5652. }
  5653. )();
  5654. var enemyNear, Hs;
  5655. function Ge() {
  5656. if (Hs)
  5657. return enemyNear;
  5658. Hs = 1;
  5659. function e(t, i, s, n, r, o) {
  5660. return {
  5661. tag: t,
  5662. key: i,
  5663. attrs: s,
  5664. children: n,
  5665. text: r,
  5666. dom: o,
  5667. domSize: void 0,
  5668. state: void 0,
  5669. events: void 0,
  5670. instance: void 0
  5671. }
  5672. }
  5673. return e.normalize = function(t) {
  5674. return Array.isArray(t) ? e("[", void 0, void 0, e.normalizeChildren(t), void 0, void 0) : t == null || typeof t == "boolean" ? null : typeof t == "object" ? t : e("#", void 0, void 0, String(t), void 0, void 0)
  5675. }
  5676. ,
  5677. e.normalizeChildren = function(t) {
  5678. var i = [];
  5679. if (t.length) {
  5680. for (var s = t[0] != null && t[0].key != null, n = 1; n < t.length; n++)
  5681. if ((t[n] != null && t[n].key != null) !== s)
  5682. throw new TypeError(s && (t[n] != null || typeof t[n] == "boolean") ? "In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole." : "In fragments, vnodes must either all have keys or none have keys.");
  5683. for (var n = 0; n < t.length; n++)
  5684. i[n] = e.normalize(t[n])
  5685. }
  5686. return i
  5687. }
  5688. ,
  5689. enemyNear = e,
  5690. enemyNear
  5691. }
  5692. var Nc = Ge()
  5693. , Jr = function() {
  5694. var e = arguments[this], t = this + 1, i;
  5695. if (e == null ? e = {} : (typeof e != "object" || e.tag != null || Array.isArray(e)) && (e = {},
  5696. t = this),
  5697. arguments.length === t + 1)
  5698. i = arguments[t],
  5699. Array.isArray(i) || (i = [i]);
  5700. else
  5701. for (i = []; t < arguments.length; )
  5702. i.push(arguments[t++]);
  5703. return Nc("", e.key, e, i)
  5704. }
  5705. , Ci = {}.hasOwnProperty
  5706. , qc = Ge()
  5707. , Wc = Jr
  5708. , pt = Ci
  5709. , Xc = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
  5710. , Qr = {};
  5711. function Fs(e) {
  5712. for (var t in e)
  5713. if (pt.call(e, t))
  5714. return !1;
  5715. return !0
  5716. }
  5717. function Gc(e) {
  5718. for (var t, i = "div", s = [], n = {}; t = Xc.exec(e); ) {
  5719. var r = t[1]
  5720. , o = t[2];
  5721. if (r === "" && o !== "")
  5722. i = o;
  5723. else if (r === "#")
  5724. n.id = o;
  5725. else if (r === ".")
  5726. s.push(o);
  5727. else if (t[3][0] === "[") {
  5728. var l = t[6];
  5729. l && (l = l.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\")),
  5730. t[4] === "class" ? s.push(l) : n[t[4]] = l === "" ? l : l || !0
  5731. }
  5732. }
  5733. return s.length > 0 && (n.className = s.join(" ")),
  5734. Qr[e] = {
  5735. tag: i,
  5736. attrs: n
  5737. }
  5738. }
  5739. function Yc(e, t) {
  5740. var i = t.attrs
  5741. , s = pt.call(i, "class")
  5742. , n = s ? i.class : i.className;
  5743. if (t.tag = e.tag,
  5744. t.attrs = {},
  5745. !Fs(e.attrs) && !Fs(i)) {
  5746. var r = {};
  5747. for (var o in i)
  5748. pt.call(i, o) && (r[o] = i[o]);
  5749. i = r
  5750. }
  5751. for (var o in e.attrs)
  5752. pt.call(e.attrs, o) && o !== "className" && !pt.call(i, o) && (i[o] = e.attrs[o]);
  5753. (n != null || e.attrs.className != null) && (i.className = n != null ? e.attrs.className != null ? String(e.attrs.className) + " " + String(n) : n : e.attrs.className != null ? e.attrs.className : null),
  5754. s && (i.class = null);
  5755. for (var o in i)
  5756. if (pt.call(i, o) && o !== "key") {
  5757. t.attrs = i;
  5758. break
  5759. }
  5760. return t
  5761. }
  5762. function $c(e) {
  5763. if (e == null || typeof e != "string" && typeof e != "function" && typeof e.view != "function")
  5764. throw Error("The selector must be either a string or a component.");
  5765. var t = Wc.apply(1, arguments);
  5766. return typeof e == "string" && (t.children = qc.normalizeChildren(t.children),
  5767. e !== "[") ? Yc(Qr[e] || Gc(e), t) : (t.tag = e,
  5768. t)
  5769. }
  5770. var Zr = $c
  5771. , Kc = Ge()
  5772. , Jc = function(e) {
  5773. return e == null && (e = ""),
  5774. Kc("<", void 0, void 0, e, void 0, void 0)
  5775. }
  5776. , Qc = Ge()
  5777. , Zc = Jr
  5778. , jc = function() {
  5779. var e = Zc.apply(0, arguments);
  5780. return e.tag = "[",
  5781. e.children = Qc.normalizeChildren(e.children),
  5782. e
  5783. }
  5784. , ns = Zr;
  5785. ns.trust = Jc;
  5786. ns.fragment = jc;
  5787. var eh = ns, yi = {}, en = {
  5788. get exports() {
  5789. return yi
  5790. },
  5791. set exports(e) {
  5792. yi = e
  5793. }
  5794. }, tn, Vs;
  5795. function jr() {
  5796. if (Vs)
  5797. return tn;
  5798. Vs = 1;
  5799. var e = function(t) {
  5800. if (!(this instanceof e))
  5801. throw new Error("Promise must be called with 'new'.");
  5802. if (typeof t != "function")
  5803. throw new TypeError("executor must be a function.");
  5804. var i = this
  5805. , s = []
  5806. , n = []
  5807. , r = a(s, !0)
  5808. , o = a(n, !1)
  5809. , l = i._instance = {
  5810. resolvers: s,
  5811. rejectors: n
  5812. }
  5813. , c = typeof setImmediate == "function" ? setImmediate : setTimeout;
  5814. function a(p, h) {
  5815. return function m(w) {
  5816. var v;
  5817. try {
  5818. if (h && w != null && (typeof w == "object" || typeof w == "function") && typeof (v = w.then) == "function") {
  5819. if (w === i)
  5820. throw new TypeError("Promise can't be resolved with itself.");
  5821. u(v.bind(w))
  5822. } else
  5823. c(function() {
  5824. !h && p.length === 0 && console.error("Possible unhandled promise rejection:", w);
  5825. for (var x = 0; x < p.length; x++)
  5826. p[x](w);
  5827. s.length = 0,
  5828. n.length = 0,
  5829. l.state = h,
  5830. l.retry = function() {
  5831. m(w)
  5832. }
  5833. })
  5834. } catch (x) {
  5835. o(x)
  5836. }
  5837. }
  5838. }
  5839. function u(p) {
  5840. var h = 0;
  5841. function m(v) {
  5842. return function(x) {
  5843. h++ > 0 || v(x)
  5844. }
  5845. }
  5846. var w = m(o);
  5847. try {
  5848. p(m(r), w)
  5849. } catch (v) {
  5850. w(v)
  5851. }
  5852. }
  5853. u(t)
  5854. };
  5855. return e.prototype.then = function(t, i) {
  5856. var s = this
  5857. , n = s._instance;
  5858. function r(a, u, p, h) {
  5859. u.push(function(m) {
  5860. if (typeof a != "function")
  5861. p(m);
  5862. else
  5863. try {
  5864. o(a(m))
  5865. } catch (w) {
  5866. l && l(w)
  5867. }
  5868. }),
  5869. typeof n.retry == "function" && h === n.state && n.retry()
  5870. }
  5871. var o, l, c = new e(function(a, u) {
  5872. o = a,
  5873. l = u
  5874. }
  5875. );
  5876. return r(t, n.resolvers, o, !0),
  5877. r(i, n.rejectors, l, !1),
  5878. c
  5879. }
  5880. ,
  5881. e.prototype.catch = function(t) {
  5882. return this.then(null, t)
  5883. }
  5884. ,
  5885. e.prototype.finally = function(t) {
  5886. return this.then(function(i) {
  5887. return e.resolve(t()).then(function() {
  5888. return i
  5889. })
  5890. }, function(i) {
  5891. return e.resolve(t()).then(function() {
  5892. return e.reject(i)
  5893. })
  5894. })
  5895. }
  5896. ,
  5897. e.resolve = function(t) {
  5898. return t instanceof e ? t : new e(function(i) {
  5899. i(t)
  5900. }
  5901. )
  5902. }
  5903. ,
  5904. e.reject = function(t) {
  5905. return new e(function(i, s) {
  5906. s(t)
  5907. }
  5908. )
  5909. }
  5910. ,
  5911. e.all = function(t) {
  5912. return new e(function(i, s) {
  5913. var n = t.length
  5914. , r = 0
  5915. , o = [];
  5916. if (t.length === 0)
  5917. i([]);
  5918. else
  5919. for (var l = 0; l < t.length; l++)
  5920. (function(c) {
  5921. function a(u) {
  5922. r++,
  5923. o[c] = u,
  5924. r === n && i(o)
  5925. }
  5926. t[c] != null && (typeof t[c] == "object" || typeof t[c] == "function") && typeof t[c].then == "function" ? t[c].then(a, s) : a(t[c])
  5927. }
  5928. )(l)
  5929. }
  5930. )
  5931. }
  5932. ,
  5933. e.race = function(t) {
  5934. return new e(function(i, s) {
  5935. for (var n = 0; n < t.length; n++)
  5936. t[n].then(i, s)
  5937. }
  5938. )
  5939. }
  5940. ,
  5941. tn = e,
  5942. tn
  5943. }
  5944. var _t = jr();
  5945. typeof window < "u" ? (typeof window.Promise > "u" ? window.Promise = _t : window.Promise.prototype.finally || (window.Promise.prototype.finally = _t.prototype.finally),
  5946. en.exports = window.Promise) : typeof rt < "u" ? (typeof rt.Promise > "u" ? rt.Promise = _t : rt.Promise.prototype.finally || (rt.Promise.prototype.finally = _t.prototype.finally),
  5947. en.exports = rt.Promise) : en.exports = _t;
  5948. var nn, Us;
  5949. function th() {
  5950. if (Us)
  5951. return nn;
  5952. Us = 1;
  5953. var e = Ge();
  5954. return nn = function(t) {
  5955. var i = t && t.document, s, n = {
  5956. svg: "http://www.w3.org/2000/svg",
  5957. math: "http://www.w3.org/1998/Math/MathML"
  5958. };
  5959. function r(d) {
  5960. return d.attrs && d.attrs.xmlns || n[d.tag]
  5961. }
  5962. function o(d, f) {
  5963. if (d.state !== f)
  5964. throw new Error("'vnode.state' must not be modified.")
  5965. }
  5966. function l(d) {
  5967. var f = d.state;
  5968. try {
  5969. return this.apply(f, arguments)
  5970. } finally {
  5971. o(d, f)
  5972. }
  5973. }
  5974. function c() {
  5975. try {
  5976. return i.activeElement
  5977. } catch {
  5978. return null
  5979. }
  5980. }
  5981. function a(d, f, g, b, I, A, H) {
  5982. for (var N = g; N < b; N++) {
  5983. var B = f[N];
  5984. B != null && u(d, B, I, H, A)
  5985. }
  5986. }
  5987. function u(d, f, g, b, I) {
  5988. var A = f.tag;
  5989. if (typeof A == "string")
  5990. switch (f.state = {},
  5991. f.attrs != null && Fi(f.attrs, f, g),
  5992. A) {
  5993. case "#":
  5994. p(d, f, I);
  5995. break;
  5996. case "<":
  5997. m(d, f, b, I);
  5998. break;
  5999. case "[":
  6000. w(d, f, g, b, I);
  6001. break;
  6002. default:
  6003. v(d, f, g, b, I)
  6004. }
  6005. else
  6006. D(d, f, g, b, I)
  6007. }
  6008. function p(d, f, g) {
  6009. f.dom = i.createTextNode(f.children),
  6010. X(d, f.dom, g)
  6011. }
  6012. var h = {
  6013. caption: "table",
  6014. thead: "table",
  6015. tbody: "table",
  6016. tfoot: "table",
  6017. tr: "tbody",
  6018. th: "tr",
  6019. td: "tr",
  6020. colgroup: "table",
  6021. col: "colgroup"
  6022. };
  6023. function m(d, f, g, b) {
  6024. var I = f.children.match(/^\s*?<(\w+)/im) || []
  6025. , A = i.createElement(h[I[1]] || "div");
  6026. g === "http://www.w3.org/2000/svg" ? (A.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg">' + f.children + "</svg>",
  6027. A = A.firstChild) : A.innerHTML = f.children,
  6028. f.dom = A.firstChild,
  6029. f.domSize = A.childNodes.length,
  6030. f.instance = [];
  6031. for (var H = i.createDocumentFragment(), N; N = A.firstChild; )
  6032. f.instance.push(N),
  6033. H.appendChild(N);
  6034. X(d, H, b)
  6035. }
  6036. function w(d, f, g, b, I) {
  6037. var A = i.createDocumentFragment();
  6038. if (f.children != null) {
  6039. var H = f.children;
  6040. a(A, H, 0, H.length, g, null, b)
  6041. }
  6042. f.dom = A.firstChild,
  6043. f.domSize = A.childNodes.length,
  6044. X(d, A, I)
  6045. }
  6046. function v(d, f, g, b, I) {
  6047. var A = f.tag
  6048. , H = f.attrs
  6049. , N = H && H.is;
  6050. b = r(f) || b;
  6051. var B = b ? N ? i.createElementNS(b, A, {
  6052. is: N
  6053. }) : i.createElementNS(b, A) : N ? i.createElement(A, {
  6054. is: N
  6055. }) : i.createElement(A);
  6056. if (f.dom = B,
  6057. H != null && Bi(f, H, b),
  6058. X(d, B, I),
  6059. !G(f) && f.children != null) {
  6060. var Y = f.children;
  6061. a(B, Y, 0, Y.length, g, null, b),
  6062. f.tag === "select" && H != null && No(f, H)
  6063. }
  6064. }
  6065. function x(d, f) {
  6066. var g;
  6067. if (typeof d.tag.view == "function") {
  6068. if (d.state = Object.create(d.tag),
  6069. g = d.state.view,
  6070. g.$$reentrantLock$$ != null)
  6071. return;
  6072. g.$$reentrantLock$$ = !0
  6073. } else {
  6074. if (d.state = void 0,
  6075. g = d.tag,
  6076. g.$$reentrantLock$$ != null)
  6077. return;
  6078. g.$$reentrantLock$$ = !0,
  6079. d.state = d.tag.prototype != null && typeof d.tag.prototype.view == "function" ? new d.tag(d) : d.tag(d)
  6080. }
  6081. if (Fi(d.state, d, f),
  6082. d.attrs != null && Fi(d.attrs, d, f),
  6083. d.instance = e.normalize(l.call(d.state.view, d)),
  6084. d.instance === d)
  6085. throw Error("A view cannot return the vnode it received as argument");
  6086. g.$$reentrantLock$$ = null
  6087. }
  6088. function D(d, f, g, b, I) {
  6089. x(f, g),
  6090. f.instance != null ? (u(d, f.instance, g, b, I),
  6091. f.dom = f.instance.dom,
  6092. f.domSize = f.dom != null ? f.instance.domSize : 0) : f.domSize = 0
  6093. }
  6094. function k(d, f, g, b, I, A) {
  6095. if (!(f === g || f == null && g == null))
  6096. if (f == null || f.length === 0)
  6097. a(d, g, 0, g.length, b, I, A);
  6098. else if (g == null || g.length === 0)
  6099. te(d, f, 0, f.length);
  6100. else {
  6101. var H = f[0] != null && f[0].key != null
  6102. , N = g[0] != null && g[0].key != null
  6103. , B = 0
  6104. , Y = 0;
  6105. if (!H)
  6106. for (; Y < f.length && f[Y] == null; )
  6107. Y++;
  6108. if (!N)
  6109. for (; B < g.length && g[B] == null; )
  6110. B++;
  6111. if (H !== N)
  6112. te(d, f, Y, f.length),
  6113. a(d, g, B, g.length, b, I, A);
  6114. else if (N) {
  6115. for (var ve = f.length - 1, fe = g.length - 1, ni, xe, oe, ge, Z, Li; ve >= Y && fe >= B && (ge = f[ve],
  6116. Z = g[fe],
  6117. ge.key === Z.key); )
  6118. ge !== Z && S(d, ge, Z, b, I, A),
  6119. Z.dom != null && (I = Z.dom),
  6120. ve--,
  6121. fe--;
  6122. for (; ve >= Y && fe >= B && (xe = f[Y],
  6123. oe = g[B],
  6124. xe.key === oe.key); )
  6125. Y++,
  6126. B++,
  6127. xe !== oe && S(d, xe, oe, b, $(f, Y, I), A);
  6128. for (; ve >= Y && fe >= B && !(B === fe || xe.key !== Z.key || ge.key !== oe.key); )
  6129. Li = $(f, Y, I),
  6130. V(d, ge, Li),
  6131. ge !== oe && S(d, ge, oe, b, Li, A),
  6132. ++B <= --fe && V(d, xe, I),
  6133. xe !== Z && S(d, xe, Z, b, I, A),
  6134. Z.dom != null && (I = Z.dom),
  6135. Y++,
  6136. ve--,
  6137. ge = f[ve],
  6138. Z = g[fe],
  6139. xe = f[Y],
  6140. oe = g[B];
  6141. for (; ve >= Y && fe >= B && ge.key === Z.key; )
  6142. ge !== Z && S(d, ge, Z, b, I, A),
  6143. Z.dom != null && (I = Z.dom),
  6144. ve--,
  6145. fe--,
  6146. ge = f[ve],
  6147. Z = g[fe];
  6148. if (B > fe)
  6149. te(d, f, Y, ve + 1);
  6150. else if (Y > ve)
  6151. a(d, g, B, fe + 1, b, I, A);
  6152. else {
  6153. var $o = I, Ps = fe - B + 1, At = new Array(Ps), Ni = 0, ne = 0, qi = 2147483647, Wi = 0, ni, Xi;
  6154. for (ne = 0; ne < Ps; ne++)
  6155. At[ne] = -1;
  6156. for (ne = fe; ne >= B; ne--) {
  6157. ni == null && (ni = W(f, Y, ve + 1)),
  6158. Z = g[ne];
  6159. var st = ni[Z.key];
  6160. st != null && (qi = st < qi ? st : -1,
  6161. At[ne - B] = st,
  6162. ge = f[st],
  6163. f[st] = null,
  6164. ge !== Z && S(d, ge, Z, b, I, A),
  6165. Z.dom != null && (I = Z.dom),
  6166. Wi++)
  6167. }
  6168. if (I = $o,
  6169. Wi !== ve - Y + 1 && te(d, f, Y, ve + 1),
  6170. Wi === 0)
  6171. a(d, g, B, fe + 1, b, I, A);
  6172. else if (qi === -1)
  6173. for (Xi = _(At),
  6174. Ni = Xi.length - 1,
  6175. ne = fe; ne >= B; ne--)
  6176. oe = g[ne],
  6177. At[ne - B] === -1 ? u(d, oe, b, A, I) : Xi[Ni] === ne - B ? Ni-- : V(d, oe, I),
  6178. oe.dom != null && (I = g[ne].dom);
  6179. else
  6180. for (ne = fe; ne >= B; ne--)
  6181. oe = g[ne],
  6182. At[ne - B] === -1 && u(d, oe, b, A, I),
  6183. oe.dom != null && (I = g[ne].dom)
  6184. }
  6185. } else {
  6186. var Ui = f.length < g.length ? f.length : g.length;
  6187. for (B = B < Y ? B : Y; B < Ui; B++)
  6188. xe = f[B],
  6189. oe = g[B],
  6190. !(xe === oe || xe == null && oe == null) && (xe == null ? u(d, oe, b, A, $(f, B + 1, I)) : oe == null ? ie(d, xe) : S(d, xe, oe, b, $(f, B + 1, I), A));
  6191. f.length > Ui && te(d, f, B, f.length),
  6192. g.length > Ui && a(d, g, B, g.length, b, I, A)
  6193. }
  6194. }
  6195. }
  6196. function S(d, f, g, b, I, A) {
  6197. var H = f.tag
  6198. , N = g.tag;
  6199. if (H === N) {
  6200. if (g.state = f.state,
  6201. g.events = f.events,
  6202. Yo(g, f))
  6203. return;
  6204. if (typeof H == "string")
  6205. switch (g.attrs != null && Vi(g.attrs, g, b),
  6206. H) {
  6207. case "#":
  6208. O(f, g);
  6209. break;
  6210. case "<":
  6211. U(d, f, g, A, I);
  6212. break;
  6213. case "[":
  6214. L(d, f, g, b, I, A);
  6215. break;
  6216. default:
  6217. q(f, g, b, A)
  6218. }
  6219. else
  6220. P(d, f, g, b, I, A)
  6221. } else
  6222. ie(d, f),
  6223. u(d, g, b, A, I)
  6224. }
  6225. function O(d, f) {
  6226. d.children.toString() !== f.children.toString() && (d.dom.nodeValue = f.children),
  6227. f.dom = d.dom
  6228. }
  6229. function U(d, f, g, b, I) {
  6230. f.children !== g.children ? (K(d, f),
  6231. m(d, g, b, I)) : (g.dom = f.dom,
  6232. g.domSize = f.domSize,
  6233. g.instance = f.instance)
  6234. }
  6235. function L(d, f, g, b, I, A) {
  6236. k(d, f.children, g.children, b, I, A);
  6237. var H = 0
  6238. , N = g.children;
  6239. if (g.dom = null,
  6240. N != null) {
  6241. for (var B = 0; B < N.length; B++) {
  6242. var Y = N[B];
  6243. Y != null && Y.dom != null && (g.dom == null && (g.dom = Y.dom),
  6244. H += Y.domSize || 1)
  6245. }
  6246. H !== 1 && (g.domSize = H)
  6247. }
  6248. }
  6249. function q(d, f, g, b) {
  6250. var I = f.dom = d.dom;
  6251. b = r(f) || b,
  6252. f.tag === "textarea" && f.attrs == null && (f.attrs = {}),
  6253. qo(f, d.attrs, f.attrs, b),
  6254. G(f) || k(I, d.children, f.children, g, null, b)
  6255. }
  6256. function P(d, f, g, b, I, A) {
  6257. if (g.instance = e.normalize(l.call(g.state.view, g)),
  6258. g.instance === g)
  6259. throw Error("A view cannot return the vnode it received as argument");
  6260. Vi(g.state, g, b),
  6261. g.attrs != null && Vi(g.attrs, g, b),
  6262. g.instance != null ? (f.instance == null ? u(d, g.instance, b, A, I) : S(d, f.instance, g.instance, b, I, A),
  6263. g.dom = g.instance.dom,
  6264. g.domSize = g.instance.domSize) : f.instance != null ? (ie(d, f.instance),
  6265. g.dom = void 0,
  6266. g.domSize = 0) : (g.dom = f.dom,
  6267. g.domSize = f.domSize)
  6268. }
  6269. function W(d, f, g) {
  6270. for (var b = Object.create(null); f < g; f++) {
  6271. var I = d[f];
  6272. if (I != null) {
  6273. var A = I.key;
  6274. A != null && (b[A] = f)
  6275. }
  6276. }
  6277. return b
  6278. }
  6279. var F = [];
  6280. function _(d) {
  6281. for (var f = [0], g = 0, b = 0, I = 0, A = F.length = d.length, I = 0; I < A; I++)
  6282. F[I] = d[I];
  6283. for (var I = 0; I < A; ++I)
  6284. if (d[I] !== -1) {
  6285. var H = f[f.length - 1];
  6286. if (d[H] < d[I]) {
  6287. F[I] = H,
  6288. f.push(I);
  6289. continue
  6290. }
  6291. for (g = 0,
  6292. b = f.length - 1; g < b; ) {
  6293. var N = (g >>> 1) + (b >>> 1) + (g & b & 1);
  6294. d[f[N]] < d[I] ? g = N + 1 : b = N
  6295. }
  6296. d[I] < d[f[g]] && (g > 0 && (F[I] = f[g - 1]),
  6297. f[g] = I)
  6298. }
  6299. for (g = f.length,
  6300. b = f[g - 1]; g-- > 0; )
  6301. f[g] = b,
  6302. b = F[b];
  6303. return F.length = 0,
  6304. f
  6305. }
  6306. function $(d, f, g) {
  6307. for (; f < d.length; f++)
  6308. if (d[f] != null && d[f].dom != null)
  6309. return d[f].dom;
  6310. return g
  6311. }
  6312. function V(d, f, g) {
  6313. var b = i.createDocumentFragment();
  6314. z(d, b, f),
  6315. X(d, b, g)
  6316. }
  6317. function z(d, f, g) {
  6318. for (; g.dom != null && g.dom.parentNode === d; ) {
  6319. if (typeof g.tag != "string") {
  6320. if (g = g.instance,
  6321. g != null)
  6322. continue
  6323. } else if (g.tag === "<")
  6324. for (var b = 0; b < g.instance.length; b++)
  6325. f.appendChild(g.instance[b]);
  6326. else if (g.tag !== "[")
  6327. f.appendChild(g.dom);
  6328. else if (g.children.length === 1) {
  6329. if (g = g.children[0],
  6330. g != null)
  6331. continue
  6332. } else
  6333. for (var b = 0; b < g.children.length; b++) {
  6334. var I = g.children[b];
  6335. I != null && z(d, f, I)
  6336. }
  6337. break
  6338. }
  6339. }
  6340. function X(d, f, g) {
  6341. g != null ? d.insertBefore(f, g) : d.appendChild(f)
  6342. }
  6343. function G(d) {
  6344. if (d.attrs == null || d.attrs.contenteditable == null && d.attrs.contentEditable == null)
  6345. return !1;
  6346. var f = d.children;
  6347. if (f != null && f.length === 1 && f[0].tag === "<") {
  6348. var g = f[0].children;
  6349. d.dom.innerHTML !== g && (d.dom.innerHTML = g)
  6350. } else if (f != null && f.length !== 0)
  6351. throw new Error("Child node of a contenteditable must be trusted.");
  6352. return !0
  6353. }
  6354. function te(d, f, g, b) {
  6355. for (var I = g; I < b; I++) {
  6356. var A = f[I];
  6357. A != null && ie(d, A)
  6358. }
  6359. }
  6360. function ie(d, f) {
  6361. var g = 0, b = f.state, I, A;
  6362. if (typeof f.tag != "string" && typeof f.state.onbeforeremove == "function") {
  6363. var H = l.call(f.state.onbeforeremove, f);
  6364. H != null && typeof H.then == "function" && (g = 1,
  6365. I = H)
  6366. }
  6367. if (f.attrs && typeof f.attrs.onbeforeremove == "function") {
  6368. var H = l.call(f.attrs.onbeforeremove, f);
  6369. H != null && typeof H.then == "function" && (g |= 2,
  6370. A = H)
  6371. }
  6372. if (o(f, b),
  6373. !g)
  6374. nt(f),
  6375. ke(d, f);
  6376. else {
  6377. if (I != null) {
  6378. var N = function() {
  6379. g & 1 && (g &= 2,
  6380. g || B())
  6381. };
  6382. I.then(N, N)
  6383. }
  6384. if (A != null) {
  6385. var N = function() {
  6386. g & 2 && (g &= 1,
  6387. g || B())
  6388. };
  6389. A.then(N, N)
  6390. }
  6391. }
  6392. function B() {
  6393. o(f, b),
  6394. nt(f),
  6395. ke(d, f)
  6396. }
  6397. }
  6398. function K(d, f) {
  6399. for (var g = 0; g < f.instance.length; g++)
  6400. d.removeChild(f.instance[g])
  6401. }
  6402. function ke(d, f) {
  6403. for (; f.dom != null && f.dom.parentNode === d; ) {
  6404. if (typeof f.tag != "string") {
  6405. if (f = f.instance,
  6406. f != null)
  6407. continue
  6408. } else if (f.tag === "<")
  6409. K(d, f);
  6410. else {
  6411. if (f.tag !== "[" && (d.removeChild(f.dom),
  6412. !Array.isArray(f.children)))
  6413. break;
  6414. if (f.children.length === 1) {
  6415. if (f = f.children[0],
  6416. f != null)
  6417. continue
  6418. } else
  6419. for (var g = 0; g < f.children.length; g++) {
  6420. var b = f.children[g];
  6421. b != null && ke(d, b)
  6422. }
  6423. }
  6424. break
  6425. }
  6426. }
  6427. function nt(d) {
  6428. if (typeof d.tag != "string" && typeof d.state.onremove == "function" && l.call(d.state.onremove, d),
  6429. d.attrs && typeof d.attrs.onremove == "function" && l.call(d.attrs.onremove, d),
  6430. typeof d.tag != "string")
  6431. d.instance != null && nt(d.instance);
  6432. else {
  6433. var f = d.children;
  6434. if (Array.isArray(f))
  6435. for (var g = 0; g < f.length; g++) {
  6436. var b = f[g];
  6437. b != null && nt(b)
  6438. }
  6439. }
  6440. }
  6441. function Bi(d, f, g) {
  6442. d.tag === "input" && f.type != null && d.dom.setAttribute("type", f.type);
  6443. var b = f != null && d.tag === "input" && f.type === "file";
  6444. for (var I in f)
  6445. Ue(d, I, null, f[I], g, b)
  6446. }
  6447. function Ue(d, f, g, b, I, A) {
  6448. if (!(f === "key" || f === "is" || b == null || Ts(f) || g === b && !Wo(d, f) && typeof b != "object" || f === "type" && d.tag === "input")) {
  6449. if (f[0] === "o" && f[1] === "n")
  6450. return Es(d, f, b);
  6451. if (f.slice(0, 6) === "xlink:")
  6452. d.dom.setAttributeNS("http://www.w3.org/1999/xlink", f.slice(6), b);
  6453. else if (f === "style")
  6454. Ms(d.dom, g, b);
  6455. else if (Is(d, f, I)) {
  6456. if (f === "value") {
  6457. if ((d.tag === "input" || d.tag === "textarea") && d.dom.value === "" + b && (A || d.dom === c()) || d.tag === "select" && g !== null && d.dom.value === "" + b || d.tag === "option" && g !== null && d.dom.value === "" + b)
  6458. return;
  6459. if (A && "" + b != "") {
  6460. console.error("`value` is read-only on file inputs!");
  6461. return
  6462. }
  6463. }
  6464. d.dom[f] = b
  6465. } else
  6466. typeof b == "boolean" ? b ? d.dom.setAttribute(f, "") : d.dom.removeAttribute(f) : d.dom.setAttribute(f === "className" ? "class" : f, b)
  6467. }
  6468. }
  6469. function Ye(d, f, g, b) {
  6470. if (!(f === "key" || f === "is" || g == null || Ts(f)))
  6471. if (f[0] === "o" && f[1] === "n")
  6472. Es(d, f, void 0);
  6473. else if (f === "style")
  6474. Ms(d.dom, g, null);
  6475. else if (Is(d, f, b) && f !== "className" && f !== "title" && !(f === "value" && (d.tag === "option" || d.tag === "select" && d.dom.selectedIndex === -1 && d.dom === c())) && !(d.tag === "input" && f === "type"))
  6476. d.dom[f] = null;
  6477. else {
  6478. var I = f.indexOf(":");
  6479. I !== -1 && (f = f.slice(I + 1)),
  6480. g !== !1 && d.dom.removeAttribute(f === "className" ? "class" : f)
  6481. }
  6482. }
  6483. function No(d, f) {
  6484. if ("value"in f)
  6485. if (f.value === null)
  6486. d.dom.selectedIndex !== -1 && (d.dom.value = null);
  6487. else {
  6488. var g = "" + f.value;
  6489. (d.dom.value !== g || d.dom.selectedIndex === -1) && (d.dom.value = g)
  6490. }
  6491. "selectedIndex"in f && Ue(d, "selectedIndex", null, f.selectedIndex, void 0)
  6492. }
  6493. function qo(d, f, g, b) {
  6494. if (f && f === g && console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major"),
  6495. g != null) {
  6496. d.tag === "input" && g.type != null && d.dom.setAttribute("type", g.type);
  6497. var I = d.tag === "input" && g.type === "file";
  6498. for (var A in g)
  6499. Ue(d, A, f && f[A], g[A], b, I)
  6500. }
  6501. var H;
  6502. if (f != null)
  6503. for (var A in f)
  6504. (H = f[A]) != null && (g == null || g[A] == null) && Ye(d, A, H, b)
  6505. }
  6506. function Wo(d, f) {
  6507. return f === "value" || f === "checked" || f === "selectedIndex" || f === "selected" && d.dom === c() || d.tag === "option" && d.dom.parentNode === i.activeElement
  6508. }
  6509. function Ts(d) {
  6510. return d === "oninit" || d === "oncreate" || d === "onupdate" || d === "onremove" || d === "onbeforeremove" || d === "onbeforeupdate"
  6511. }
  6512. function Is(d, f, g) {
  6513. return g === void 0 && (d.tag.indexOf("-") > -1 || d.attrs != null && d.attrs.is || f !== "href" && f !== "list" && f !== "form" && f !== "width" && f !== "height") && f in d.dom
  6514. }
  6515. var Xo = /[A-Z]/g;
  6516. function Go(d) {
  6517. return "-" + d.toLowerCase()
  6518. }
  6519. function zi(d) {
  6520. return d[0] === "-" && d[1] === "-" ? d : d === "cssFloat" ? "float" : d.replace(Xo, Go)
  6521. }
  6522. function Ms(d, f, g) {
  6523. if (f !== g)
  6524. if (g == null)
  6525. d.style.cssText = "";
  6526. else if (typeof g != "object")
  6527. d.style.cssText = g;
  6528. else if (f == null || typeof f != "object") {
  6529. d.style.cssText = "";
  6530. for (var b in g) {
  6531. var I = g[b];
  6532. I != null && d.style.setProperty(zi(b), String(I))
  6533. }
  6534. } else {
  6535. for (var b in g) {
  6536. var I = g[b];
  6537. I != null && (I = String(I)) !== String(f[b]) && d.style.setProperty(zi(b), I)
  6538. }
  6539. for (var b in f)
  6540. f[b] != null && g[b] == null && d.style.removeProperty(zi(b))
  6541. }
  6542. }
  6543. function Hi() {
  6544. this._ = s
  6545. }
  6546. Hi.prototype = Object.create(null),
  6547. Hi.prototype.handleEvent = function(d) {
  6548. var f = this["on" + d.type], g;
  6549. typeof f == "function" ? g = f.call(d.currentTarget, d) : typeof f.handleEvent == "function" && f.handleEvent(d),
  6550. this._ && d.redraw !== !1 && (0,
  6551. this._)(),
  6552. g === !1 && (d.preventDefault(),
  6553. d.stopPropagation())
  6554. }
  6555. ;
  6556. function Es(d, f, g) {
  6557. if (d.events != null) {
  6558. if (d.events._ = s,
  6559. d.events[f] === g)
  6560. return;
  6561. g != null && (typeof g == "function" || typeof g == "object") ? (d.events[f] == null && d.dom.addEventListener(f.slice(2), d.events, !1),
  6562. d.events[f] = g) : (d.events[f] != null && d.dom.removeEventListener(f.slice(2), d.events, !1),
  6563. d.events[f] = void 0)
  6564. } else
  6565. g != null && (typeof g == "function" || typeof g == "object") && (d.events = new Hi,
  6566. d.dom.addEventListener(f.slice(2), d.events, !1),
  6567. d.events[f] = g)
  6568. }
  6569. function Fi(d, f, g) {
  6570. typeof d.oninit == "function" && l.call(d.oninit, f),
  6571. typeof d.oncreate == "function" && g.push(l.bind(d.oncreate, f))
  6572. }
  6573. function Vi(d, f, g) {
  6574. typeof d.onupdate == "function" && g.push(l.bind(d.onupdate, f))
  6575. }
  6576. function Yo(d, f) {
  6577. do {
  6578. if (d.attrs != null && typeof d.attrs.onbeforeupdate == "function") {
  6579. var g = l.call(d.attrs.onbeforeupdate, d, f);
  6580. if (g !== void 0 && !g)
  6581. break
  6582. }
  6583. if (typeof d.tag != "string" && typeof d.state.onbeforeupdate == "function") {
  6584. var g = l.call(d.state.onbeforeupdate, d, f);
  6585. if (g !== void 0 && !g)
  6586. break
  6587. }
  6588. return !1
  6589. } while (!1);
  6590. return d.dom = f.dom,
  6591. d.domSize = f.domSize,
  6592. d.instance = f.instance,
  6593. d.attrs = f.attrs,
  6594. d.children = f.children,
  6595. d.text = f.text,
  6596. !0
  6597. }
  6598. var Ct;
  6599. return function(d, f, g) {
  6600. if (!d)
  6601. throw new TypeError("DOM element being rendered to does not exist.");
  6602. if (Ct != null && d.contains(Ct))
  6603. throw new TypeError("Node is currently being rendered to and thus is locked.");
  6604. var b = s
  6605. , I = Ct
  6606. , A = []
  6607. , H = c()
  6608. , N = d.namespaceURI;
  6609. Ct = d,
  6610. s = typeof g == "function" ? g : void 0;
  6611. try {
  6612. d.vnodes == null && (d.textContent = ""),
  6613. f = e.normalizeChildren(Array.isArray(f) ? f : [f]),
  6614. k(d, d.vnodes, f, A, null, N === "http://www.w3.org/1999/xhtml" ? void 0 : N),
  6615. d.vnodes = f,
  6616. H != null && c() !== H && typeof H.focus == "function" && H.focus();
  6617. for (var B = 0; B < A.length; B++)
  6618. A[B]()
  6619. } finally {
  6620. s = b,
  6621. Ct = I
  6622. }
  6623. }
  6624. }
  6625. ,
  6626. nn
  6627. }
  6628. var sn, Ls;
  6629. function eo() {
  6630. return Ls || (Ls = 1,
  6631. sn = th()(typeof window < "u" ? window : null)),
  6632. sn
  6633. }
  6634. var Ns = Ge(), ih = function(e, t, i) {
  6635. var s = []
  6636. , n = !1
  6637. , r = -1;
  6638. function o() {
  6639. for (r = 0; r < s.length; r += 2)
  6640. try {
  6641. e(s[r], Ns(s[r + 1]), l)
  6642. } catch (a) {
  6643. i.error(a)
  6644. }
  6645. r = -1
  6646. }
  6647. function l() {
  6648. n || (n = !0,
  6649. t(function() {
  6650. n = !1,
  6651. o()
  6652. }))
  6653. }
  6654. l.sync = o;
  6655. function c(a, u) {
  6656. if (u != null && u.view == null && typeof u != "function")
  6657. throw new TypeError("m.mount expects a component, not a vnode.");
  6658. var p = s.indexOf(a);
  6659. p >= 0 && (s.splice(p, 2),
  6660. p <= r && (r -= 2),
  6661. e(a, [])),
  6662. u != null && (s.push(a, u),
  6663. e(a, Ns(u), l))
  6664. }
  6665. return {
  6666. mount: c,
  6667. redraw: l
  6668. }
  6669. }, nh = eo(), ss = ih(nh, typeof requestAnimationFrame < "u" ? requestAnimationFrame : null, typeof console < "u" ? console : null), rn, qs;
  6670. function to() {
  6671. return qs || (qs = 1,
  6672. rn = function(e) {
  6673. if (Object.prototype.toString.call(e) !== "[object Object]")
  6674. return "";
  6675. var t = [];
  6676. for (var i in e)
  6677. s(i, e[i]);
  6678. return t.join("&");
  6679. function s(n, r) {
  6680. if (Array.isArray(r))
  6681. for (var o = 0; o < r.length; o++)
  6682. s(n + "[" + o + "]", r[o]);
  6683. else if (Object.prototype.toString.call(r) === "[object Object]")
  6684. for (var o in r)
  6685. s(n + "[" + o + "]", r[o]);
  6686. else
  6687. t.push(encodeURIComponent(n) + (r != null && r !== "" ? "=" + encodeURIComponent(r) : ""))
  6688. }
  6689. }
  6690. ),
  6691. rn
  6692. }
  6693. var on, Ws;
  6694. function io() {
  6695. if (Ws)
  6696. return on;
  6697. Ws = 1;
  6698. var e = Ci;
  6699. return on = Object.assign || function(t, i) {
  6700. for (var s in i)
  6701. e.call(i, s) && (t[s] = i[s])
  6702. }
  6703. ,
  6704. on
  6705. }
  6706. var an, Xs;
  6707. function rs() {
  6708. if (Xs)
  6709. return an;
  6710. Xs = 1;
  6711. var e = to()
  6712. , t = io();
  6713. return an = function(i, s) {
  6714. if (/:([^\/\.-]+)(\.{3})?:/.test(i))
  6715. throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.");
  6716. if (s == null)
  6717. return i;
  6718. var n = i.indexOf("?")
  6719. , r = i.indexOf("#")
  6720. , o = r < 0 ? i.length : r
  6721. , l = n < 0 ? o : n
  6722. , c = i.slice(0, l)
  6723. , a = {};
  6724. t(a, s);
  6725. var u = c.replace(/:([^\/\.-]+)(\.{3})?/g, function(D, k, S) {
  6726. return delete a[k],
  6727. s[k] == null ? D : S ? s[k] : encodeURIComponent(String(s[k]))
  6728. })
  6729. , p = u.indexOf("?")
  6730. , h = u.indexOf("#")
  6731. , m = h < 0 ? u.length : h
  6732. , w = p < 0 ? m : p
  6733. , v = u.slice(0, w);
  6734. n >= 0 && (v += i.slice(n, o)),
  6735. p >= 0 && (v += (n < 0 ? "?" : "&") + u.slice(p, m));
  6736. var x = e(a);
  6737. return x && (v += (n < 0 && p < 0 ? "?" : "&") + x),
  6738. r >= 0 && (v += i.slice(r)),
  6739. h >= 0 && (v += (r < 0 ? "" : "&") + u.slice(h)),
  6740. v
  6741. }
  6742. ,
  6743. an
  6744. }
  6745. var sh = rs(), Gs = Ci, rh = function(e, t, i) {
  6746. var s = 0;
  6747. function n(l) {
  6748. return new t(l)
  6749. }
  6750. n.prototype = t.prototype,
  6751. n.__proto__ = t;
  6752. function r(l) {
  6753. return function(c, a) {
  6754. typeof c != "string" ? (a = c,
  6755. c = c.url) : a == null && (a = {});
  6756. var u = new t(function(w, v) {
  6757. l(sh(c, a.params), a, function(x) {
  6758. if (typeof a.type == "function")
  6759. if (Array.isArray(x))
  6760. for (var D = 0; D < x.length; D++)
  6761. x[D] = new a.type(x[D]);
  6762. else
  6763. x = new a.type(x);
  6764. w(x)
  6765. }, v)
  6766. }
  6767. );
  6768. if (a.background === !0)
  6769. return u;
  6770. var p = 0;
  6771. function h() {
  6772. --p === 0 && typeof i == "function" && i()
  6773. }
  6774. return m(u);
  6775. function m(w) {
  6776. var v = w.then;
  6777. return w.constructor = n,
  6778. w.then = function() {
  6779. p++;
  6780. var x = v.apply(w, arguments);
  6781. return x.then(h, function(D) {
  6782. if (h(),
  6783. p === 0)
  6784. throw D
  6785. }),
  6786. m(x)
  6787. }
  6788. ,
  6789. w
  6790. }
  6791. }
  6792. }
  6793. function o(l, c) {
  6794. for (var a in l.headers)
  6795. if (Gs.call(l.headers, a) && a.toLowerCase() === c)
  6796. return !0;
  6797. return !1
  6798. }
  6799. return {
  6800. request: r(function(l, c, a, u) {
  6801. var p = c.method != null ? c.method.toUpperCase() : "GET", h = c.body, m = (c.serialize == null || c.serialize === JSON.serialize) && !(h instanceof e.FormData || h instanceof e.URLSearchParams), w = c.responseType || (typeof c.extract == "function" ? "" : "json"), v = new e.XMLHttpRequest, x = !1, D = !1, k = v, S, O = v.abort;
  6802. v.abort = function() {
  6803. x = !0,
  6804. O.call(this)
  6805. }
  6806. ,
  6807. v.open(p, l, c.async !== !1, typeof c.user == "string" ? c.user : void 0, typeof c.password == "string" ? c.password : void 0),
  6808. m && h != null && !o(c, "content-type") && v.setRequestHeader("Content-Type", "application/json; charset=utf-8"),
  6809. typeof c.deserialize != "function" && !o(c, "accept") && v.setRequestHeader("Accept", "application/json, text/*"),
  6810. c.withCredentials && (v.withCredentials = c.withCredentials),
  6811. c.timeout && (v.timeout = c.timeout),
  6812. v.responseType = w;
  6813. for (var U in c.headers)
  6814. Gs.call(c.headers, U) && v.setRequestHeader(U, c.headers[U]);
  6815. v.onreadystatechange = function(L) {
  6816. if (!x && L.target.readyState === 4)
  6817. try {
  6818. var q = L.target.status >= 200 && L.target.status < 300 || L.target.status === 304 || /^file:\/\//i.test(l), P = L.target.response, W;
  6819. if (w === "json") {
  6820. if (!L.target.responseType && typeof c.extract != "function")
  6821. try {
  6822. P = JSON.parse(L.target.responseText)
  6823. } catch {
  6824. P = null
  6825. }
  6826. } else
  6827. (!w || w === "text") && P == null && (P = L.target.responseText);
  6828. if (typeof c.extract == "function" ? (P = c.extract(L.target, c),
  6829. q = !0) : typeof c.deserialize == "function" && (P = c.deserialize(P)),
  6830. q)
  6831. a(P);
  6832. else {
  6833. var F = function() {
  6834. try {
  6835. W = L.target.responseText
  6836. } catch {
  6837. W = P
  6838. }
  6839. var _ = new Error(W);
  6840. _.code = L.target.status,
  6841. _.response = P,
  6842. u(_)
  6843. };
  6844. v.status === 0 ? setTimeout(function() {
  6845. D || F()
  6846. }) : F()
  6847. }
  6848. } catch (_) {
  6849. u(_)
  6850. }
  6851. }
  6852. ,
  6853. v.ontimeout = function(L) {
  6854. D = !0;
  6855. var q = new Error("Request timed out");
  6856. q.code = L.target.status,
  6857. u(q)
  6858. }
  6859. ,
  6860. typeof c.config == "function" && (v = c.config(v, c, l) || v,
  6861. v !== k && (S = v.abort,
  6862. v.abort = function() {
  6863. x = !0,
  6864. S.call(this)
  6865. }
  6866. )),
  6867. h == null ? v.send() : typeof c.serialize == "function" ? v.send(c.serialize(h)) : h instanceof e.FormData || h instanceof e.URLSearchParams ? v.send(h) : v.send(JSON.stringify(h))
  6868. }),
  6869. jsonp: r(function(l, c, a, u) {
  6870. var p = c.callbackName || "_mithril_" + Math.round(Math.random() * 1e16) + "_" + s++
  6871. , h = e.document.createElement("script");
  6872. e[p] = function(m) {
  6873. delete e[p],
  6874. h.parentNode.removeChild(h),
  6875. a(m)
  6876. }
  6877. ,
  6878. h.onerror = function() {
  6879. delete e[p],
  6880. h.parentNode.removeChild(h),
  6881. u(new Error("JSONP request failed"))
  6882. }
  6883. ,
  6884. h.src = l + (l.indexOf("?") < 0 ? "?" : "&") + encodeURIComponent(c.callbackKey || "callback") + "=" + encodeURIComponent(p),
  6885. e.document.documentElement.appendChild(h)
  6886. })
  6887. }
  6888. }, oh = yi, ah = ss, lh = rh(typeof window < "u" ? window : null, oh, ah.redraw), ln, Ys;
  6889. function no() {
  6890. if (Ys)
  6891. return ln;
  6892. Ys = 1;
  6893. function e(t) {
  6894. try {
  6895. return decodeURIComponent(t)
  6896. } catch {
  6897. return t
  6898. }
  6899. }
  6900. return ln = function(t) {
  6901. if (t === "" || t == null)
  6902. return {};
  6903. t.charAt(0) === "?" && (t = t.slice(1));
  6904. for (var i = t.split("&"), s = {}, n = {}, r = 0; r < i.length; r++) {
  6905. var o = i[r].split("=")
  6906. , l = e(o[0])
  6907. , c = o.length === 2 ? e(o[1]) : "";
  6908. c === "true" ? c = !0 : c === "false" && (c = !1);
  6909. var a = l.split(/\]\[?|\[/)
  6910. , u = n;
  6911. l.indexOf("[") > -1 && a.pop();
  6912. for (var p = 0; p < a.length; p++) {
  6913. var h = a[p]
  6914. , m = a[p + 1]
  6915. , w = m == "" || !isNaN(parseInt(m, 10));
  6916. if (h === "") {
  6917. var l = a.slice(0, p).join();
  6918. s[l] == null && (s[l] = Array.isArray(u) ? u.length : 0),
  6919. h = s[l]++
  6920. } else if (h === "__proto__")
  6921. break;
  6922. if (p === a.length - 1)
  6923. u[h] = c;
  6924. else {
  6925. var v = Object.getOwnPropertyDescriptor(u, h);
  6926. v != null && (v = v.value),
  6927. v == null && (u[h] = v = w ? [] : {}),
  6928. u = v
  6929. }
  6930. }
  6931. }
  6932. return n
  6933. }
  6934. ,
  6935. ln
  6936. }
  6937. var cn, $s;
  6938. function os() {
  6939. if ($s)
  6940. return cn;
  6941. $s = 1;
  6942. var e = no();
  6943. return cn = function(t) {
  6944. var i = t.indexOf("?")
  6945. , s = t.indexOf("#")
  6946. , n = s < 0 ? t.length : s
  6947. , r = i < 0 ? n : i
  6948. , o = t.slice(0, r).replace(/\/{2,}/g, "/");
  6949. return o ? (o[0] !== "/" && (o = "/" + o),
  6950. o.length > 1 && o[o.length - 1] === "/" && (o = o.slice(0, -1))) : o = "/",
  6951. {
  6952. path: o,
  6953. params: i < 0 ? {} : e(t.slice(i + 1, n))
  6954. }
  6955. }
  6956. ,
  6957. cn
  6958. }
  6959. var hn, Ks;
  6960. function ch() {
  6961. if (Ks)
  6962. return hn;
  6963. Ks = 1;
  6964. var e = os();
  6965. return hn = function(t) {
  6966. var i = e(t)
  6967. , s = Object.keys(i.params)
  6968. , n = []
  6969. , r = new RegExp("^" + i.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g, function(o, l, c) {
  6970. return l == null ? "\\" + o : (n.push({
  6971. k: l,
  6972. r: c === "..."
  6973. }),
  6974. c === "..." ? "(.*)" : c === "." ? "([^/]+)\\." : "([^/]+)" + (c || ""))
  6975. }) + "$");
  6976. return function(o) {
  6977. for (var l = 0; l < s.length; l++)
  6978. if (i.params[s[l]] !== o.params[s[l]])
  6979. return !1;
  6980. if (!n.length)
  6981. return r.test(o.path);
  6982. var c = r.exec(o.path);
  6983. if (c == null)
  6984. return !1;
  6985. for (var l = 0; l < n.length; l++)
  6986. o.params[n[l].k] = n[l].r ? c[l + 1] : decodeURIComponent(c[l + 1]);
  6987. return !0
  6988. }
  6989. }
  6990. ,
  6991. hn
  6992. }
  6993. var fn, Js;
  6994. function so() {
  6995. if (Js)
  6996. return fn;
  6997. Js = 1;
  6998. var e = Ci
  6999. , t = new RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");
  7000. return fn = function(i, s) {
  7001. var n = {};
  7002. if (s != null)
  7003. for (var r in i)
  7004. e.call(i, r) && !t.test(r) && s.indexOf(r) < 0 && (n[r] = i[r]);
  7005. else
  7006. for (var r in i)
  7007. e.call(i, r) && !t.test(r) && (n[r] = i[r]);
  7008. return n
  7009. }
  7010. ,
  7011. fn
  7012. }
  7013. var un, Qs;
  7014. function hh() {
  7015. if (Qs)
  7016. return un;
  7017. Qs = 1;
  7018. var e = Ge()
  7019. , t = Zr
  7020. , i = yi
  7021. , s = rs()
  7022. , n = os()
  7023. , r = ch()
  7024. , o = io()
  7025. , l = so()
  7026. , c = {};
  7027. function a(u) {
  7028. try {
  7029. return decodeURIComponent(u)
  7030. } catch {
  7031. return u
  7032. }
  7033. }
  7034. return un = function(u, p) {
  7035. var h = u == null ? null : typeof u.setImmediate == "function" ? u.setImmediate : u.setTimeout, m = i.resolve(), w = !1, v = !1, x = 0, D, k, S = c, O, U, L, q, P = {
  7036. onbeforeupdate: function() {
  7037. return x = x ? 2 : 1,
  7038. !(!x || c === S)
  7039. },
  7040. onremove: function() {
  7041. u.removeEventListener("popstate", _, !1),
  7042. u.removeEventListener("hashchange", F, !1)
  7043. },
  7044. view: function() {
  7045. if (!(!x || c === S)) {
  7046. var z = [e(O, U.key, U)];
  7047. return S && (z = S.render(z[0])),
  7048. z
  7049. }
  7050. }
  7051. }, W = V.SKIP = {};
  7052. function F() {
  7053. w = !1;
  7054. var z = u.location.hash;
  7055. V.prefix[0] !== "#" && (z = u.location.search + z,
  7056. V.prefix[0] !== "?" && (z = u.location.pathname + z,
  7057. z[0] !== "/" && (z = "/" + z)));
  7058. var X = z.concat().replace(/(?:%[a-f89][a-f0-9])+/gim, a).slice(V.prefix.length)
  7059. , G = n(X);
  7060. o(G.params, u.history.state);
  7061. function te(K) {
  7062. console.error(K),
  7063. $(k, null, {
  7064. replace: !0
  7065. })
  7066. }
  7067. ie(0);
  7068. function ie(K) {
  7069. for (; K < D.length; K++)
  7070. if (D[K].check(G)) {
  7071. var ke = D[K].component
  7072. , nt = D[K].route
  7073. , Bi = ke
  7074. , Ue = q = function(Ye) {
  7075. if (Ue === q) {
  7076. if (Ye === W)
  7077. return ie(K + 1);
  7078. O = Ye != null && (typeof Ye.view == "function" || typeof Ye == "function") ? Ye : "div",
  7079. U = G.params,
  7080. L = X,
  7081. q = null,
  7082. S = ke.render ? ke : null,
  7083. x === 2 ? p.redraw() : (x = 2,
  7084. p.redraw.sync())
  7085. }
  7086. }
  7087. ;
  7088. ke.view || typeof ke == "function" ? (ke = {},
  7089. Ue(Bi)) : ke.onmatch ? m.then(function() {
  7090. return ke.onmatch(G.params, X, nt)
  7091. }).then(Ue, X === k ? null : te) : Ue("div");
  7092. return
  7093. }
  7094. if (X === k)
  7095. throw new Error("Could not resolve default route " + k + ".");
  7096. $(k, null, {
  7097. replace: !0
  7098. })
  7099. }
  7100. }
  7101. function _() {
  7102. w || (w = !0,
  7103. h(F))
  7104. }
  7105. function $(z, X, G) {
  7106. if (z = s(z, X),
  7107. v) {
  7108. _();
  7109. var te = G ? G.state : null
  7110. , ie = G ? G.title : null;
  7111. G && G.replace ? u.history.replaceState(te, ie, V.prefix + z) : u.history.pushState(te, ie, V.prefix + z)
  7112. } else
  7113. u.location.href = V.prefix + z
  7114. }
  7115. function V(z, X, G) {
  7116. if (!z)
  7117. throw new TypeError("DOM element being rendered to does not exist.");
  7118. if (D = Object.keys(G).map(function(ie) {
  7119. if (ie[0] !== "/")
  7120. throw new SyntaxError("Routes must start with a '/'.");
  7121. if (/:([^\/\.-]+)(\.{3})?:/.test(ie))
  7122. throw new SyntaxError("Route parameter names must be separated with either '/', '.', or '-'.");
  7123. return {
  7124. route: ie,
  7125. component: G[ie],
  7126. check: r(ie)
  7127. }
  7128. }),
  7129. k = X,
  7130. X != null) {
  7131. var te = n(X);
  7132. if (!D.some(function(ie) {
  7133. return ie.check(te)
  7134. }))
  7135. throw new ReferenceError("Default route doesn't match any known routes.")
  7136. }
  7137. typeof u.history.pushState == "function" ? u.addEventListener("popstate", _, !1) : V.prefix[0] === "#" && u.addEventListener("hashchange", F, !1),
  7138. v = !0,
  7139. p.mount(z, P),
  7140. F()
  7141. }
  7142. return V.set = function(z, X, G) {
  7143. q != null && (G = G || {},
  7144. G.replace = !0),
  7145. q = null,
  7146. $(z, X, G)
  7147. }
  7148. ,
  7149. V.get = function() {
  7150. return L
  7151. }
  7152. ,
  7153. V.prefix = "#!",
  7154. V.Link = {
  7155. view: function(z) {
  7156. var X = t(z.attrs.selector || "a", l(z.attrs, ["options", "params", "selector", "onclick"]), z.children), G, te, ie;
  7157. return (X.attrs.disabled = Boolean(X.attrs.disabled)) ? (X.attrs.href = null,
  7158. X.attrs["aria-disabled"] = "true") : (G = z.attrs.options,
  7159. te = z.attrs.onclick,
  7160. ie = s(X.attrs.href, z.attrs.params),
  7161. X.attrs.href = V.prefix + ie,
  7162. X.attrs.onclick = function(K) {
  7163. var ke;
  7164. typeof te == "function" ? ke = te.call(K.currentTarget, K) : te == null || typeof te != "object" || typeof te.handleEvent == "function" && te.handleEvent(K),
  7165. ke !== !1 && !K.defaultPrevented && (K.button === 0 || K.which === 0 || K.which === 1) && (!K.currentTarget.target || K.currentTarget.target === "_self") && !K.ctrlKey && !K.metaKey && !K.shiftKey && !K.altKey && (K.preventDefault(),
  7166. K.redraw = !1,
  7167. V.set(ie, null, G))
  7168. }
  7169. ),
  7170. X
  7171. }
  7172. },
  7173. V.param = function(z) {
  7174. return U && z != null ? U[z] : U
  7175. }
  7176. ,
  7177. V
  7178. }
  7179. ,
  7180. un
  7181. }
  7182. var dn, Zs;
  7183. function fh() {
  7184. if (Zs)
  7185. return dn;
  7186. Zs = 1;
  7187. var e = ss;
  7188. return dn = hh()(typeof window < "u" ? window : null, e),
  7189. dn
  7190. }
  7191. var Ai = eh
  7192. , ro = lh
  7193. , oo = ss
  7194. , pe = function() {
  7195. return Ai.apply(this, arguments)
  7196. };
  7197. pe.m = Ai;
  7198. pe.trust = Ai.trust;
  7199. pe.fragment = Ai.fragment;
  7200. pe.Fragment = "[";
  7201. pe.mount = oo.mount;
  7202. pe.route = fh();
  7203. pe.render = eo();
  7204. pe.redraw = oo.redraw;
  7205. pe.request = ro.request;
  7206. pe.jsonp = ro.jsonp;
  7207. pe.parseQueryString = no();
  7208. pe.buildQueryString = to();
  7209. pe.parsePathname = os();
  7210. pe.buildPathname = rs();
  7211. pe.vnode = Ge();
  7212. pe.PromisePolyfill = jr();
  7213. pe.censor = so();
  7214. var Ne = pe;
  7215. function we(e, t, i, s, n) {
  7216. this.debugLog = !1,
  7217. this.baseUrl = e,
  7218. this.lobbySize = i,
  7219. this.devPort = t,
  7220. this.lobbySpread = s,
  7221. this.rawIPs = !!n,
  7222. this.server = void 0,
  7223. this.gameIndex = void 0,
  7224. this.callback = void 0,
  7225. this.errorCallback = void 0
  7226. }
  7227. we.prototype.regionInfo = {
  7228. 0: {
  7229. name: "Local",
  7230. latitude: 0,
  7231. longitude: 0
  7232. },
  7233. "us-east": {
  7234. name: "Miami",
  7235. latitude: 40.1393329,
  7236. longitude: -75.8521818
  7237. },
  7238. "us-west": {
  7239. name: "Silicon Valley",
  7240. latitude: 47.6149942,
  7241. longitude: -122.4759879
  7242. },
  7243. gb: {
  7244. name: "London",
  7245. latitude: 51.5283063,
  7246. longitude: -.382486
  7247. },
  7248. "eu-west": {
  7249. name: "Frankfurt",
  7250. latitude: 50.1211273,
  7251. longitude: 8.496137
  7252. },
  7253. au: {
  7254. name: "Sydney",
  7255. latitude: -33.8479715,
  7256. longitude: 150.651084
  7257. },
  7258. sg: {
  7259. name: "Singapore",
  7260. latitude: 1.3147268,
  7261. longitude: 103.7065876
  7262. }
  7263. };
  7264. we.prototype.start = function(e, t, i, s) {
  7265. if (this.callback = t,
  7266. this.errorCallback = i,
  7267. s)
  7268. return t();
  7269. const n = this.parseServerQuery(e);
  7270. n && n.length > 0 ? (this.log("Found server in query."),
  7271. this.password = n[3],
  7272. this.connect(n[0], n[1], n[2])) : this.errorCallback("Unable to find server")
  7273. }
  7274. ;
  7275. we.prototype.parseServerQuery = function(e) {
  7276. const t = new URLSearchParams(location.search,!0)
  7277. , i = e || t.get("server");
  7278. if (typeof i != "string")
  7279. return [];
  7280. const [s,n] = i.split(":");
  7281. return [s, n, t.get("password")]
  7282. }
  7283. ;
  7284. we.prototype.findServer = function(e, t) {
  7285. var i = this.servers[e];
  7286. for (let s = 0; s < i.length; s++) {
  7287. const n = i[s];
  7288. if (n.name === t)
  7289. return n
  7290. }
  7291. console.warn("Could not find server in region " + e + " with serverName " + t + ".")
  7292. }
  7293. ;
  7294. we.prototype.seekServer = function(e, t, i) {
  7295. i == null && (i = "random"),
  7296. t == null && (t = !1);
  7297. const s = ["random"]
  7298. , n = this.lobbySize
  7299. , r = this.lobbySpread
  7300. , o = this.servers[e].flatMap(function(h) {
  7301. let m = 0;
  7302. return h.games.map(function(w) {
  7303. const v = m++;
  7304. return {
  7305. region: h.region,
  7306. index: h.index * h.games.length + v,
  7307. gameIndex: v,
  7308. gameCount: h.games.length,
  7309. playerCount: w.playerCount,
  7310. playerCapacity: w.playerCapacity,
  7311. isPrivate: w.isPrivate
  7312. }
  7313. })
  7314. }).filter(function(h) {
  7315. return !h.isPrivate
  7316. }).filter(function(h) {
  7317. return t ? h.playerCount == 0 && h.gameIndex >= h.gameCount / 2 : !0
  7318. }).filter(function(h) {
  7319. return i == "random" ? !0 : s[h.index % s.length].key == i
  7320. }).sort(function(h, m) {
  7321. return m.playerCount - h.playerCount
  7322. }).filter(function(h) {
  7323. return h.playerCount < n
  7324. });
  7325. if (t && o.reverse(),
  7326. o.length == 0) {
  7327. this.errorCallback("No open servers.");
  7328. return
  7329. }
  7330. const l = Math.min(r, o.length);
  7331. var u = Math.floor(Math.random() * l);
  7332. u = Math.min(u, o.length - 1);
  7333. const c = o[u]
  7334. , a = c.region;
  7335. var u = Math.floor(c.index / c.gameCount);
  7336. const p = c.index % c.gameCount;
  7337. return this.log("Found server."),
  7338. [a, u, p]
  7339. }
  7340. ;
  7341. we.prototype.connect = function(e, t, i) {
  7342. if (this.connected)
  7343. return;
  7344. const s = this.findServer(e, t);
  7345. if (s == null) {
  7346. this.errorCallback("Failed to find server for region " + e + " and serverName " + t);
  7347. return
  7348. }
  7349. if (this.log("Connecting to server", s, "with game index", i),
  7350. s.playerCount >= s.playerCapacity) {
  7351. const errocall = (this.errorCallback("Server is already full."));
  7352. __3_errorbypass__1__3___ ? bs() : errocall;
  7353. }
  7354. window.history.replaceState(document.title, document.title, this.generateHref(e, t, this.password)),
  7355. this.server = s,
  7356. this.gameIndex = i,
  7357. this.log("Calling callback with address", this.serverAddress(s), "on port", this.serverPort(s)),
  7358. this.callback(this.serverAddress(s), this.serverPort(s), i),
  7359. Lt && clearInterval(Lt)
  7360. }
  7361. ;
  7362. we.prototype.switchServer = function(e, t) {
  7363. this.switchingServers = !0,
  7364. window.location = this.generateHref(e, t, null)
  7365. }
  7366. ;
  7367. we.prototype.generateHref = function(e, t, i) {
  7368. let s = window.location.href.split("?")[0];
  7369. return s += "?server=" + e + ":" + t,
  7370. i && (s += "&password=" + encodeURIComponent(i)),
  7371. s
  7372. }
  7373. ;
  7374. we.prototype.serverAddress = function(e) {
  7375. return e.region == 0 ? "localhost" : e.key + "." + e.region + "." + this.baseUrl
  7376. }
  7377. ;
  7378. we.prototype.serverPort = function(e) {
  7379. return e.port
  7380. }
  7381. ;
  7382. let Lt;
  7383. function uh(e) {
  7384. e = e.filter(n=>n.playerCount !== n.playerCapacity);
  7385. const t = Math.min(...e.map(n=>n.ping || 1 / 0))
  7386. , i = e.filter(n=>n.ping === t);
  7387. return !i.length > 0 ? null : i.reduce((n,r)=>n.playerCount > r.playerCount ? n : r)
  7388. }
  7389. we.prototype.processServers = function(e) {
  7390. return Lt && clearInterval(Lt),
  7391. new Promise(t=>{
  7392. const i = {}
  7393. , s = c=>{
  7394. const a = i[c]
  7395. , u = a[0];
  7396. let p = this.serverAddress(u);
  7397. const h = this.serverPort(u);
  7398. h && (p += `:${h}`);
  7399. const m = `https://${p}/ping`
  7400. , w = new Date().getTime();
  7401. return Promise.race([fetch(m).then(()=>{
  7402. const v = new Date().getTime() - w;
  7403. a.forEach(x=>{
  7404. x.pings = x.pings ?? [],
  7405. x.pings.push(v),
  7406. x.pings.length > 10 && x.pings.shift(),
  7407. x.ping = Math.floor(x.pings.reduce((D,k)=>D + k, 0) / x.pings.length)
  7408. }
  7409. )
  7410. }
  7411. ).catch(()=>{}
  7412. ), new Promise(v=>setTimeout(()=>v(), 100))])
  7413. }
  7414. , n = async()=>{
  7415. await Promise.all(Object.keys(i).map(s)),
  7416. window.blockRedraw || Ne.redraw()
  7417. }
  7418. ;
  7419. e.forEach(c=>{
  7420. i[c.region] = i[c.region] || [],
  7421. i[c.region].push(c)
  7422. }
  7423. );
  7424. for (const c in i)
  7425. i[c] = i[c].sort(function(a, u) {
  7426. return u.playerCount - a.playerCount
  7427. });
  7428. this.servers = i;
  7429. let r;
  7430. const [o,l] = this.parseServerQuery();
  7431. e.forEach(c=>{
  7432. o === c.region && l === c.name && (c.selected = !0,
  7433. r = c)
  7434. }
  7435. ),
  7436. n().then(n).then(()=>{
  7437. if (r)
  7438. return;
  7439. let c = uh(e);
  7440. c || (c = e[0]),
  7441. c && (c.selected = !0,
  7442. window.history.replaceState(document.title, document.title, this.generateHref(c.region, c.name, this.password))),
  7443. window.blockRedraw || Ne.redraw()
  7444. }
  7445. ).then(n).catch(c=>{}
  7446. ).finally(t),
  7447. Lt = setInterval(n, 5e3)
  7448. }
  7449. )
  7450. }
  7451. ;
  7452. we.prototype.ipToHex = function(e) {
  7453. return e.split(".").map(i=>("00" + parseInt(i).toString(16)).substr(-2)).join("").toLowerCase()
  7454. }
  7455. ;
  7456. we.prototype.hashIP = function(e) {
  7457. return On(this.ipToHex(e))
  7458. }
  7459. ;
  7460. we.prototype.log = function() {
  7461. if (this.debugLog)
  7462. return console.log.apply(void 0, arguments);
  7463. if (console.verbose)
  7464. return console.verbose.apply(void 0, arguments)
  7465. }
  7466. ;
  7467. we.prototype.stripRegion = function(e) {
  7468. return e.startsWith("vultr:") ? e = e.slice(6) : e.startsWith("do:") && (e = e.slice(3)),
  7469. e
  7470. }
  7471. ;
  7472. const dh = function(e, t) {
  7473. return e.concat(t)
  7474. }
  7475. , ph = function(e, t) {
  7476. return t.map(e).reduce(dh, [])
  7477. };
  7478. Array.prototype.flatMap = function(e) {
  7479. return ph(e, this)
  7480. }
  7481. ;
  7482. const fi = (e,t)=>{
  7483. const i = t.x - e.x
  7484. , s = t.y - e.y;
  7485. return Math.sqrt(i * i + s * s)
  7486. }
  7487. , mh = (e,t)=>{
  7488. const i = t.x - e.x
  7489. , s = t.y - e.y;
  7490. return yh(Math.atan2(s, i))
  7491. }
  7492. , gh = (e,t,i)=>{
  7493. const s = {
  7494. x: 0,
  7495. y: 0
  7496. };
  7497. return i = Bn(i),
  7498. s.x = e.x - t * Math.cos(i),
  7499. s.y = e.y - t * Math.sin(i),
  7500. s
  7501. }
  7502. , Bn = e=>e * (Math.PI / 180)
  7503. , yh = e=>e * (180 / Math.PI)
  7504. , wh = e=>isNaN(e.buttons) ? e.pressure !== 0 : e.buttons !== 0
  7505. , pn = new Map
  7506. , js = e=>{
  7507. pn.has(e) && clearTimeout(pn.get(e)),
  7508. pn.set(e, setTimeout(e, 100))
  7509. }
  7510. , wi = (e,t,i)=>{
  7511. const s = t.split(/[ ,]+/g);
  7512. let n;
  7513. for (let r = 0; r < s.length; r += 1)
  7514. n = s[r],
  7515. e.addEventListener ? e.addEventListener(n, i, !1) : e.attachEvent && e.attachEvent(n, i)
  7516. }
  7517. , er = (e,t,i)=>{
  7518. const s = t.split(/[ ,]+/g);
  7519. let n;
  7520. for (let r = 0; r < s.length; r += 1)
  7521. n = s[r],
  7522. e.removeEventListener ? e.removeEventListener(n, i) : e.detachEvent && e.detachEvent(n, i)
  7523. }
  7524. , ao = e=>(e.preventDefault(),
  7525. e.type.match(/^touch/) ? e.changedTouches : e)
  7526. , tr = ()=>{
  7527. const e = window.pageXOffset !== void 0 ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft
  7528. , t = window.pageYOffset !== void 0 ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
  7529. return {
  7530. x: e,
  7531. y: t
  7532. }
  7533. }
  7534. , ir = (e,t)=>{
  7535. t.top || t.right || t.bottom || t.left ? (e.style.top = t.top,
  7536. e.style.right = t.right,
  7537. e.style.bottom = t.bottom,
  7538. e.style.left = t.left) : (e.style.left = t.x + "px",
  7539. e.style.top = t.y + "px")
  7540. }
  7541. , as = (e,t,i)=>{
  7542. const s = lo(e);
  7543. for (let n in s)
  7544. if (s.hasOwnProperty(n))
  7545. if (typeof t == "string")
  7546. s[n] = t + " " + i;
  7547. else {
  7548. let r = "";
  7549. for (let o = 0, l = t.length; o < l; o += 1)
  7550. r += t[o] + " " + i + ", ";
  7551. s[n] = r.slice(0, -2)
  7552. }
  7553. return s
  7554. }
  7555. , kh = (e,t)=>{
  7556. const i = lo(e);
  7557. for (let s in i)
  7558. i.hasOwnProperty(s) && (i[s] = t);
  7559. return i
  7560. }
  7561. , lo = e=>{
  7562. const t = {};
  7563. return t[e] = "",
  7564. ["webkit", "Moz", "o"].forEach(function(s) {
  7565. t[s + e.charAt(0).toUpperCase() + e.slice(1)] = ""
  7566. }),
  7567. t
  7568. }
  7569. , mn = (e,t)=>{
  7570. for (let i in t)
  7571. t.hasOwnProperty(i) && (e[i] = t[i]);
  7572. return e
  7573. }
  7574. , vh = (e,t)=>{
  7575. const i = {};
  7576. for (let s in e)
  7577. e.hasOwnProperty(s) && t.hasOwnProperty(s) ? i[s] = t[s] : e.hasOwnProperty(s) && (i[s] = e[s]);
  7578. return i
  7579. }
  7580. , zn = (e,t)=>{
  7581. if (e.length)
  7582. for (let i = 0, s = e.length; i < s; i += 1)
  7583. t(e[i]);
  7584. else
  7585. t(e)
  7586. }
  7587. , xh = (e,t,i)=>({
  7588. x: Math.min(Math.max(e.x, t.x - i), t.x + i),
  7589. y: Math.min(Math.max(e.y, t.y - i), t.y + i)
  7590. });
  7591. var bh = "ontouchstart"in window, Sh = !!window.PointerEvent, Th = !!window.MSPointerEvent, Bt = {
  7592. touch: {
  7593. start: "touchstart",
  7594. move: "touchmove",
  7595. end: "touchend, touchcancel"
  7596. },
  7597. mouse: {
  7598. start: "mousedown",
  7599. move: "mousemove",
  7600. end: "mouseup"
  7601. },
  7602. pointer: {
  7603. start: "pointerdown",
  7604. move: "pointermove",
  7605. end: "pointerup, pointercancel"
  7606. },
  7607. MSPointer: {
  7608. start: "MSPointerDown",
  7609. move: "MSPointerMove",
  7610. end: "MSPointerUp"
  7611. }
  7612. }, vt, Kt = {};
  7613. Sh ? vt = Bt.pointer : Th ? vt = Bt.MSPointer : bh ? (vt = Bt.touch,
  7614. Kt = Bt.mouse) : vt = Bt.mouse;
  7615. function Ve() {}
  7616. Ve.prototype.on = function(e, t) {
  7617. var i = this, s = e.split(/[ ,]+/g), n;
  7618. i._handlers_ = i._handlers_ || {};
  7619. for (var r = 0; r < s.length; r += 1)
  7620. n = s[r],
  7621. i._handlers_[n] = i._handlers_[n] || [],
  7622. i._handlers_[n].push(t);
  7623. return i
  7624. }
  7625. ;
  7626. Ve.prototype.off = function(e, t) {
  7627. var i = this;
  7628. return i._handlers_ = i._handlers_ || {},
  7629. e === void 0 ? i._handlers_ = {} : t === void 0 ? i._handlers_[e] = null : i._handlers_[e] && i._handlers_[e].indexOf(t) >= 0 && i._handlers_[e].splice(i._handlers_[e].indexOf(t), 1),
  7630. i
  7631. }
  7632. ;
  7633. Ve.prototype.trigger = function(e, t) {
  7634. var i = this, s = e.split(/[ ,]+/g), n;
  7635. i._handlers_ = i._handlers_ || {};
  7636. for (var r = 0; r < s.length; r += 1)
  7637. n = s[r],
  7638. i._handlers_[n] && i._handlers_[n].length && i._handlers_[n].forEach(function(o) {
  7639. o.call(i, {
  7640. type: n,
  7641. target: i
  7642. }, t)
  7643. })
  7644. }
  7645. ;
  7646. Ve.prototype.config = function(e) {
  7647. var t = this;
  7648. t.options = t.defaults || {},
  7649. e && (t.options = vh(t.options, e))
  7650. }
  7651. ;
  7652. Ve.prototype.bindEvt = function(e, t) {
  7653. var i = this;
  7654. return i._domHandlers_ = i._domHandlers_ || {},
  7655. i._domHandlers_[t] = function() {
  7656. typeof i["on" + t] == "function" ? i["on" + t].apply(i, arguments) : console.warn('[WARNING] : Missing "on' + t + '" handler.')
  7657. }
  7658. ,
  7659. wi(e, vt[t], i._domHandlers_[t]),
  7660. Kt[t] && wi(e, Kt[t], i._domHandlers_[t]),
  7661. i
  7662. }
  7663. ;
  7664. Ve.prototype.unbindEvt = function(e, t) {
  7665. var i = this;
  7666. return i._domHandlers_ = i._domHandlers_ || {},
  7667. er(e, vt[t], i._domHandlers_[t]),
  7668. Kt[t] && er(e, Kt[t], i._domHandlers_[t]),
  7669. delete i._domHandlers_[t],
  7670. this
  7671. }
  7672. ;
  7673. function he(e, t) {
  7674. return this.identifier = t.identifier,
  7675. this.position = t.position,
  7676. this.frontPosition = t.frontPosition,
  7677. this.collection = e,
  7678. this.defaults = {
  7679. size: 100,
  7680. threshold: .1,
  7681. color: "white",
  7682. fadeTime: 250,
  7683. dataOnly: !1,
  7684. restJoystick: !0,
  7685. restOpacity: .5,
  7686. mode: "dynamic",
  7687. zone: document.body,
  7688. lockX: !1,
  7689. lockY: !1,
  7690. shape: "circle"
  7691. },
  7692. this.config(t),
  7693. this.options.mode === "dynamic" && (this.options.restOpacity = 0),
  7694. this.id = he.id,
  7695. he.id += 1,
  7696. this.buildEl().stylize(),
  7697. this.instance = {
  7698. el: this.ui.el,
  7699. on: this.on.bind(this),
  7700. off: this.off.bind(this),
  7701. show: this.show.bind(this),
  7702. hide: this.hide.bind(this),
  7703. add: this.addToDom.bind(this),
  7704. remove: this.removeFromDom.bind(this),
  7705. destroy: this.destroy.bind(this),
  7706. setPosition: this.setPosition.bind(this),
  7707. resetDirection: this.resetDirection.bind(this),
  7708. computeDirection: this.computeDirection.bind(this),
  7709. trigger: this.trigger.bind(this),
  7710. position: this.position,
  7711. frontPosition: this.frontPosition,
  7712. ui: this.ui,
  7713. identifier: this.identifier,
  7714. id: this.id,
  7715. options: this.options
  7716. },
  7717. this.instance
  7718. }
  7719. he.prototype = new Ve;
  7720. he.constructor = he;
  7721. he.id = 0;
  7722. he.prototype.buildEl = function(e) {
  7723. return this.ui = {},
  7724. this.options.dataOnly ? this : (this.ui.el = document.createElement("div"),
  7725. this.ui.back = document.createElement("div"),
  7726. this.ui.front = document.createElement("div"),
  7727. this.ui.el.className = "nipple collection_" + this.collection.id,
  7728. this.ui.back.className = "back",
  7729. this.ui.front.className = "front",
  7730. this.ui.el.setAttribute("id", "nipple_" + this.collection.id + "_" + this.id),
  7731. this.ui.el.appendChild(this.ui.back),
  7732. this.ui.el.appendChild(this.ui.front),
  7733. this)
  7734. }
  7735. ;
  7736. he.prototype.stylize = function() {
  7737. if (this.options.dataOnly)
  7738. return this;
  7739. var e = this.options.fadeTime + "ms"
  7740. , t = kh("borderRadius", "50%")
  7741. , i = as("transition", "opacity", e)
  7742. , s = {};
  7743. return s.el = {
  7744. position: "absolute",
  7745. opacity: this.options.restOpacity,
  7746. display: "block",
  7747. zIndex: 999
  7748. },
  7749. s.back = {
  7750. position: "absolute",
  7751. display: "block",
  7752. width: this.options.size + "px",
  7753. height: this.options.size + "px",
  7754. marginLeft: -this.options.size / 2 + "px",
  7755. marginTop: -this.options.size / 2 + "px",
  7756. background: this.options.color,
  7757. opacity: ".5"
  7758. },
  7759. s.front = {
  7760. width: this.options.size / 2 + "px",
  7761. height: this.options.size / 2 + "px",
  7762. position: "absolute",
  7763. display: "block",
  7764. marginLeft: -this.options.size / 4 + "px",
  7765. marginTop: -this.options.size / 4 + "px",
  7766. background: this.options.color,
  7767. opacity: ".5",
  7768. transform: "translate(0px, 0px)"
  7769. },
  7770. mn(s.el, i),
  7771. this.options.shape === "circle" && mn(s.back, t),
  7772. mn(s.front, t),
  7773. this.applyStyles(s),
  7774. this
  7775. }
  7776. ;
  7777. he.prototype.applyStyles = function(e) {
  7778. for (var t in this.ui)
  7779. if (this.ui.hasOwnProperty(t))
  7780. for (var i in e[t])
  7781. this.ui[t].style[i] = e[t][i];
  7782. return this
  7783. }
  7784. ;
  7785. he.prototype.addToDom = function() {
  7786. return this.options.dataOnly || document.body.contains(this.ui.el) ? this : (this.options.zone.appendChild(this.ui.el),
  7787. this)
  7788. }
  7789. ;
  7790. he.prototype.removeFromDom = function() {
  7791. return this.options.dataOnly || !document.body.contains(this.ui.el) ? this : (this.options.zone.removeChild(this.ui.el),
  7792. this)
  7793. }
  7794. ;
  7795. he.prototype.destroy = function() {
  7796. clearTimeout(this.removeTimeout),
  7797. clearTimeout(this.showTimeout),
  7798. clearTimeout(this.restTimeout),
  7799. this.trigger("destroyed", this.instance),
  7800. this.removeFromDom(),
  7801. this.off()
  7802. }
  7803. ;
  7804. he.prototype.show = function(e) {
  7805. var t = this;
  7806. return t.options.dataOnly || (clearTimeout(t.removeTimeout),
  7807. clearTimeout(t.showTimeout),
  7808. clearTimeout(t.restTimeout),
  7809. t.addToDom(),
  7810. t.restCallback(),
  7811. setTimeout(function() {
  7812. t.ui.el.style.opacity = 1
  7813. }, 0),
  7814. t.showTimeout = setTimeout(function() {
  7815. t.trigger("shown", t.instance),
  7816. typeof e == "function" && e.call(this)
  7817. }, t.options.fadeTime)),
  7818. t
  7819. }
  7820. ;
  7821. he.prototype.hide = function(e) {
  7822. var t = this;
  7823. if (t.options.dataOnly)
  7824. return t;
  7825. if (t.ui.el.style.opacity = t.options.restOpacity,
  7826. clearTimeout(t.removeTimeout),
  7827. clearTimeout(t.showTimeout),
  7828. clearTimeout(t.restTimeout),
  7829. t.removeTimeout = setTimeout(function() {
  7830. var i = t.options.mode === "dynamic" ? "none" : "block";
  7831. t.ui.el.style.display = i,
  7832. typeof e == "function" && e.call(t),
  7833. t.trigger("hidden", t.instance)
  7834. }, t.options.fadeTime),
  7835. t.options.restJoystick) {
  7836. const i = t.options.restJoystick
  7837. , s = {};
  7838. s.x = i === !0 || i.x !== !1 ? 0 : t.instance.frontPosition.x,
  7839. s.y = i === !0 || i.y !== !1 ? 0 : t.instance.frontPosition.y,
  7840. t.setPosition(e, s)
  7841. }
  7842. return t
  7843. }
  7844. ;
  7845. he.prototype.setPosition = function(e, t) {
  7846. var i = this;
  7847. i.frontPosition = {
  7848. x: t.x,
  7849. y: t.y
  7850. };
  7851. var s = i.options.fadeTime + "ms"
  7852. , n = {};
  7853. n.front = as("transition", ["transform"], s);
  7854. var r = {
  7855. front: {}
  7856. };
  7857. r.front = {
  7858. transform: "translate(" + i.frontPosition.x + "px," + i.frontPosition.y + "px)"
  7859. },
  7860. i.applyStyles(n),
  7861. i.applyStyles(r),
  7862. i.restTimeout = setTimeout(function() {
  7863. typeof e == "function" && e.call(i),
  7864. i.restCallback()
  7865. }, i.options.fadeTime)
  7866. }
  7867. ;
  7868. he.prototype.restCallback = function() {
  7869. var e = this
  7870. , t = {};
  7871. t.front = as("transition", "none", ""),
  7872. e.applyStyles(t),
  7873. e.trigger("rested", e.instance)
  7874. }
  7875. ;
  7876. he.prototype.resetDirection = function() {
  7877. this.direction = {
  7878. x: !1,
  7879. y: !1,
  7880. angle: !1
  7881. }
  7882. }
  7883. ;
  7884. he.prototype.computeDirection = function(e) {
  7885. var t = e.angle.radian, i = Math.PI / 4, s = Math.PI / 2, n, r, o;
  7886. if (t > i && t < i * 3 && !e.lockX ? n = "up" : t > -i && t <= i && !e.lockY ? n = "left" : t > -i * 3 && t <= -i && !e.lockX ? n = "down" : e.lockY || (n = "right"),
  7887. e.lockY || (t > -s && t < s ? r = "left" : r = "right"),
  7888. e.lockX || (t > 0 ? o = "up" : o = "down"),
  7889. e.force > this.options.threshold) {
  7890. var l = {}, c;
  7891. for (c in this.direction)
  7892. this.direction.hasOwnProperty(c) && (l[c] = this.direction[c]);
  7893. var a = {};
  7894. this.direction = {
  7895. x: r,
  7896. y: o,
  7897. angle: n
  7898. },
  7899. e.direction = this.direction;
  7900. for (c in l)
  7901. l[c] === this.direction[c] && (a[c] = !0);
  7902. if (a.x && a.y && a.angle)
  7903. return e;
  7904. (!a.x || !a.y) && this.trigger("plain", e),
  7905. a.x || this.trigger("plain:" + r, e),
  7906. a.y || this.trigger("plain:" + o, e),
  7907. a.angle || this.trigger("dir dir:" + n, e)
  7908. } else
  7909. this.resetDirection();
  7910. return e
  7911. }
  7912. ;
  7913. function ae(e, t) {
  7914. var i = this;
  7915. i.nipples = [],
  7916. i.idles = [],
  7917. i.actives = [],
  7918. i.ids = [],
  7919. i.pressureIntervals = {},
  7920. i.manager = e,
  7921. i.id = ae.id,
  7922. ae.id += 1,
  7923. i.defaults = {
  7924. zone: document.body,
  7925. multitouch: !1,
  7926. maxNumberOfNipples: 10,
  7927. mode: "dynamic",
  7928. position: {
  7929. top: 0,
  7930. left: 0
  7931. },
  7932. catchDistance: 200,
  7933. size: 100,
  7934. threshold: .1,
  7935. color: "white",
  7936. fadeTime: 250,
  7937. dataOnly: !1,
  7938. restJoystick: !0,
  7939. restOpacity: .5,
  7940. lockX: !1,
  7941. lockY: !1,
  7942. shape: "circle",
  7943. dynamicPage: !1,
  7944. follow: !1
  7945. },
  7946. i.config(t),
  7947. (i.options.mode === "static" || i.options.mode === "semi") && (i.options.multitouch = !1),
  7948. i.options.multitouch || (i.options.maxNumberOfNipples = 1);
  7949. const s = getComputedStyle(i.options.zone.parentElement);
  7950. return s && s.display === "flex" && (i.parentIsFlex = !0),
  7951. i.updateBox(),
  7952. i.prepareNipples(),
  7953. i.bindings(),
  7954. i.begin(),
  7955. i.nipples
  7956. }
  7957. ae.prototype = new Ve;
  7958. ae.constructor = ae;
  7959. ae.id = 0;
  7960. ae.prototype.prepareNipples = function() {
  7961. var e = this
  7962. , t = e.nipples;
  7963. t.on = e.on.bind(e),
  7964. t.off = e.off.bind(e),
  7965. t.options = e.options,
  7966. t.destroy = e.destroy.bind(e),
  7967. t.ids = e.ids,
  7968. t.id = e.id,
  7969. t.processOnMove = e.processOnMove.bind(e),
  7970. t.processOnEnd = e.processOnEnd.bind(e),
  7971. t.get = function(i) {
  7972. if (i === void 0)
  7973. return t[0];
  7974. for (var s = 0, n = t.length; s < n; s += 1)
  7975. if (t[s].identifier === i)
  7976. return t[s];
  7977. return !1
  7978. }
  7979. }
  7980. ;
  7981. ae.prototype.bindings = function() {
  7982. var e = this;
  7983. e.bindEvt(e.options.zone, "start"),
  7984. e.options.zone.style.touchAction = "none",
  7985. e.options.zone.style.msTouchAction = "none"
  7986. }
  7987. ;
  7988. ae.prototype.begin = function() {
  7989. var e = this
  7990. , t = e.options;
  7991. if (t.mode === "static") {
  7992. var i = e.createNipple(t.position, e.manager.getIdentifier());
  7993. i.add(),
  7994. e.idles.push(i)
  7995. }
  7996. }
  7997. ;
  7998. ae.prototype.createNipple = function(e, t) {
  7999. var i = this
  8000. , s = i.manager.scroll
  8001. , n = {}
  8002. , r = i.options
  8003. , o = {
  8004. x: i.parentIsFlex ? s.x : s.x + i.box.left,
  8005. y: i.parentIsFlex ? s.y : s.y + i.box.top
  8006. };
  8007. if (e.x && e.y)
  8008. n = {
  8009. x: e.x - o.x,
  8010. y: e.y - o.y
  8011. };
  8012. else if (e.top || e.right || e.bottom || e.left) {
  8013. var l = document.createElement("DIV");
  8014. l.style.display = "hidden",
  8015. l.style.top = e.top,
  8016. l.style.right = e.right,
  8017. l.style.bottom = e.bottom,
  8018. l.style.left = e.left,
  8019. l.style.position = "absolute",
  8020. r.zone.appendChild(l);
  8021. var c = l.getBoundingClientRect();
  8022. r.zone.removeChild(l),
  8023. n = e,
  8024. e = {
  8025. x: c.left + s.x,
  8026. y: c.top + s.y
  8027. }
  8028. }
  8029. var a = new he(i,{
  8030. color: r.color,
  8031. size: r.size,
  8032. threshold: r.threshold,
  8033. fadeTime: r.fadeTime,
  8034. dataOnly: r.dataOnly,
  8035. restJoystick: r.restJoystick,
  8036. restOpacity: r.restOpacity,
  8037. mode: r.mode,
  8038. identifier: t,
  8039. position: e,
  8040. zone: r.zone,
  8041. frontPosition: {
  8042. x: 0,
  8043. y: 0
  8044. },
  8045. shape: r.shape
  8046. });
  8047. return r.dataOnly || (ir(a.ui.el, n),
  8048. ir(a.ui.front, a.frontPosition)),
  8049. i.nipples.push(a),
  8050. i.trigger("added " + a.identifier + ":added", a),
  8051. i.manager.trigger("added " + a.identifier + ":added", a),
  8052. i.bindNipple(a),
  8053. a
  8054. }
  8055. ;
  8056. ae.prototype.updateBox = function() {
  8057. var e = this;
  8058. e.box = e.options.zone.getBoundingClientRect()
  8059. }
  8060. ;
  8061. ae.prototype.bindNipple = function(e) {
  8062. var t = this, i, s = function(n, r) {
  8063. i = n.type + " " + r.id + ":" + n.type,
  8064. t.trigger(i, r)
  8065. };
  8066. e.on("destroyed", t.onDestroyed.bind(t)),
  8067. e.on("shown hidden rested dir plain", s),
  8068. e.on("dir:up dir:right dir:down dir:left", s),
  8069. e.on("plain:up plain:right plain:down plain:left", s)
  8070. }
  8071. ;
  8072. ae.prototype.pressureFn = function(e, t, i) {
  8073. var s = this
  8074. , n = 0;
  8075. clearInterval(s.pressureIntervals[i]),
  8076. s.pressureIntervals[i] = setInterval(function() {
  8077. var r = e.force || e.pressure || e.webkitForce || 0;
  8078. r !== n && (t.trigger("pressure", r),
  8079. s.trigger("pressure " + t.identifier + ":pressure", r),
  8080. n = r)
  8081. }
  8082. .bind(s), 100)
  8083. }
  8084. ;
  8085. ae.prototype.onstart = function(e) {
  8086. var t = this
  8087. , i = t.options
  8088. , s = e;
  8089. e = ao(e),
  8090. t.updateBox();
  8091. var n = function(r) {
  8092. t.actives.length < i.maxNumberOfNipples ? t.processOnStart(r) : s.type.match(/^touch/) && (Object.keys(t.manager.ids).forEach(function(o) {
  8093. if (Object.values(s.touches).findIndex(function(c) {
  8094. return c.identifier === o
  8095. }) < 0) {
  8096. var l = [e[0]];
  8097. l.identifier = o,
  8098. t.processOnEnd(l)
  8099. }
  8100. }),
  8101. t.actives.length < i.maxNumberOfNipples && t.processOnStart(r))
  8102. };
  8103. return zn(e, n),
  8104. t.manager.bindDocument(),
  8105. !1
  8106. }
  8107. ;
  8108. ae.prototype.processOnStart = function(e) {
  8109. var t = this, i = t.options, s, n = t.manager.getIdentifier(e), r = e.force || e.pressure || e.webkitForce || 0, o = {
  8110. x: e.pageX,
  8111. y: e.pageY
  8112. }, l = t.getOrCreate(n, o);
  8113. l.identifier !== n && t.manager.removeIdentifier(l.identifier),
  8114. l.identifier = n;
  8115. var c = function(u) {
  8116. u.trigger("start", u),
  8117. t.trigger("start " + u.id + ":start", u),
  8118. u.show(),
  8119. r > 0 && t.pressureFn(e, u, u.identifier),
  8120. t.processOnMove(e)
  8121. };
  8122. if ((s = t.idles.indexOf(l)) >= 0 && t.idles.splice(s, 1),
  8123. t.actives.push(l),
  8124. t.ids.push(l.identifier),
  8125. i.mode !== "semi")
  8126. c(l);
  8127. else {
  8128. var a = fi(o, l.position);
  8129. if (a <= i.catchDistance)
  8130. c(l);
  8131. else {
  8132. l.destroy(),
  8133. t.processOnStart(e);
  8134. return
  8135. }
  8136. }
  8137. return l
  8138. }
  8139. ;
  8140. ae.prototype.getOrCreate = function(e, t) {
  8141. var i = this, s = i.options, n;
  8142. return /(semi|static)/.test(s.mode) ? (n = i.idles[0],
  8143. n ? (i.idles.splice(0, 1),
  8144. n) : s.mode === "semi" ? i.createNipple(t, e) : (console.warn("Coudln't find the needed nipple."),
  8145. !1)) : (n = i.createNipple(t, e),
  8146. n)
  8147. }
  8148. ;
  8149. ae.prototype.processOnMove = function(e) {
  8150. var t = this
  8151. , i = t.options
  8152. , s = t.manager.getIdentifier(e)
  8153. , n = t.nipples.get(s)
  8154. , r = t.manager.scroll;
  8155. if (!wh(e)) {
  8156. this.processOnEnd(e);
  8157. return
  8158. }
  8159. if (!n) {
  8160. console.error("Found zombie joystick with ID " + s),
  8161. t.manager.removeIdentifier(s);
  8162. return
  8163. }
  8164. if (i.dynamicPage) {
  8165. var o = n.el.getBoundingClientRect();
  8166. n.position = {
  8167. x: r.x + o.left,
  8168. y: r.y + o.top
  8169. }
  8170. }
  8171. n.identifier = s;
  8172. var l = n.options.size / 2
  8173. , c = {
  8174. x: e.pageX,
  8175. y: e.pageY
  8176. };
  8177. i.lockX && (c.y = n.position.y),
  8178. i.lockY && (c.x = n.position.x);
  8179. var a = fi(c, n.position), u = mh(c, n.position), p = Bn(u), h = a / l, m = {
  8180. distance: a,
  8181. position: c
  8182. }, w, v;
  8183. if (n.options.shape === "circle" ? (w = Math.min(a, l),
  8184. v = gh(n.position, w, u)) : (v = xh(c, n.position, l),
  8185. w = fi(v, n.position)),
  8186. i.follow) {
  8187. if (a > l) {
  8188. let S = c.x - v.x
  8189. , O = c.y - v.y;
  8190. n.position.x += S,
  8191. n.position.y += O,
  8192. n.el.style.top = n.position.y - (t.box.top + r.y) + "px",
  8193. n.el.style.left = n.position.x - (t.box.left + r.x) + "px",
  8194. a = fi(c, n.position)
  8195. }
  8196. } else
  8197. c = v,
  8198. a = w;
  8199. var x = c.x - n.position.x
  8200. , D = c.y - n.position.y;
  8201. n.frontPosition = {
  8202. x,
  8203. y: D
  8204. },
  8205. i.dataOnly || (n.ui.front.style.transform = "translate(" + x + "px," + D + "px)");
  8206. var k = {
  8207. identifier: n.identifier,
  8208. position: c,
  8209. force: h,
  8210. pressure: e.force || e.pressure || e.webkitForce || 0,
  8211. distance: a,
  8212. angle: {
  8213. radian: p,
  8214. degree: u
  8215. },
  8216. vector: {
  8217. x: x / l,
  8218. y: -D / l
  8219. },
  8220. raw: m,
  8221. instance: n,
  8222. lockX: i.lockX,
  8223. lockY: i.lockY
  8224. };
  8225. k = n.computeDirection(k),
  8226. k.angle = {
  8227. radian: Bn(180 - u),
  8228. degree: 180 - u
  8229. },
  8230. n.trigger("move", k),
  8231. t.trigger("move " + n.id + ":move", k)
  8232. }
  8233. ;
  8234. ae.prototype.processOnEnd = function(e) {
  8235. var t = this
  8236. , i = t.options
  8237. , s = t.manager.getIdentifier(e)
  8238. , n = t.nipples.get(s)
  8239. , r = t.manager.removeIdentifier(n.identifier);
  8240. n && (i.dataOnly || n.hide(function() {
  8241. i.mode === "dynamic" && (n.trigger("removed", n),
  8242. t.trigger("removed " + n.id + ":removed", n),
  8243. t.manager.trigger("removed " + n.id + ":removed", n),
  8244. n.destroy())
  8245. }),
  8246. clearInterval(t.pressureIntervals[n.identifier]),
  8247. n.resetDirection(),
  8248. n.trigger("end", n),
  8249. t.trigger("end " + n.id + ":end", n),
  8250. t.ids.indexOf(n.identifier) >= 0 && t.ids.splice(t.ids.indexOf(n.identifier), 1),
  8251. t.actives.indexOf(n) >= 0 && t.actives.splice(t.actives.indexOf(n), 1),
  8252. /(semi|static)/.test(i.mode) ? t.idles.push(n) : t.nipples.indexOf(n) >= 0 && t.nipples.splice(t.nipples.indexOf(n), 1),
  8253. t.manager.unbindDocument(),
  8254. /(semi|static)/.test(i.mode) && (t.manager.ids[r.id] = r.identifier))
  8255. }
  8256. ;
  8257. ae.prototype.onDestroyed = function(e, t) {
  8258. var i = this;
  8259. i.nipples.indexOf(t) >= 0 && i.nipples.splice(i.nipples.indexOf(t), 1),
  8260. i.actives.indexOf(t) >= 0 && i.actives.splice(i.actives.indexOf(t), 1),
  8261. i.idles.indexOf(t) >= 0 && i.idles.splice(i.idles.indexOf(t), 1),
  8262. i.ids.indexOf(t.identifier) >= 0 && i.ids.splice(i.ids.indexOf(t.identifier), 1),
  8263. i.manager.removeIdentifier(t.identifier),
  8264. i.manager.unbindDocument()
  8265. }
  8266. ;
  8267. ae.prototype.destroy = function() {
  8268. var e = this;
  8269. e.unbindEvt(e.options.zone, "start"),
  8270. e.nipples.forEach(function(i) {
  8271. i.destroy()
  8272. });
  8273. for (var t in e.pressureIntervals)
  8274. e.pressureIntervals.hasOwnProperty(t) && clearInterval(e.pressureIntervals[t]);
  8275. e.trigger("destroyed", e.nipples),
  8276. e.manager.unbindDocument(),
  8277. e.off()
  8278. }
  8279. ;
  8280. function de(e) {
  8281. var t = this;
  8282. t.ids = {},
  8283. t.index = 0,
  8284. t.collections = [],
  8285. t.scroll = tr(),
  8286. t.config(e),
  8287. t.prepareCollections();
  8288. var i = function() {
  8289. var n;
  8290. t.collections.forEach(function(r) {
  8291. r.forEach(function(o) {
  8292. n = o.el.getBoundingClientRect(),
  8293. o.position = {
  8294. x: t.scroll.x + n.left,
  8295. y: t.scroll.y + n.top
  8296. }
  8297. })
  8298. })
  8299. };
  8300. wi(window, "resize", function() {
  8301. js(i)
  8302. });
  8303. var s = function() {
  8304. t.scroll = tr()
  8305. };
  8306. return wi(window, "scroll", function() {
  8307. js(s)
  8308. }),
  8309. t.collections
  8310. }
  8311. de.prototype = new Ve;
  8312. de.constructor = de;
  8313. de.prototype.prepareCollections = function() {
  8314. var e = this;
  8315. e.collections.create = e.create.bind(e),
  8316. e.collections.on = e.on.bind(e),
  8317. e.collections.off = e.off.bind(e),
  8318. e.collections.destroy = e.destroy.bind(e),
  8319. e.collections.get = function(t) {
  8320. var i;
  8321. return e.collections.every(function(s) {
  8322. return i = s.get(t),
  8323. !i
  8324. }),
  8325. i
  8326. }
  8327. }
  8328. ;
  8329. de.prototype.create = function(e) {
  8330. return this.createCollection(e)
  8331. }
  8332. ;
  8333. de.prototype.createCollection = function(e) {
  8334. var t = this
  8335. , i = new ae(t,e);
  8336. return t.bindCollection(i),
  8337. t.collections.push(i),
  8338. i
  8339. }
  8340. ;
  8341. de.prototype.bindCollection = function(e) {
  8342. var t = this, i, s = function(n, r) {
  8343. i = n.type + " " + r.id + ":" + n.type,
  8344. t.trigger(i, r)
  8345. };
  8346. e.on("destroyed", t.onDestroyed.bind(t)),
  8347. e.on("shown hidden rested dir plain", s),
  8348. e.on("dir:up dir:right dir:down dir:left", s),
  8349. e.on("plain:up plain:right plain:down plain:left", s)
  8350. }
  8351. ;
  8352. de.prototype.bindDocument = function() {
  8353. var e = this;
  8354. e.binded || (e.bindEvt(document, "move").bindEvt(document, "end"),
  8355. e.binded = !0)
  8356. }
  8357. ;
  8358. de.prototype.unbindDocument = function(e) {
  8359. var t = this;
  8360. (!Object.keys(t.ids).length || e === !0) && (t.unbindEvt(document, "move").unbindEvt(document, "end"),
  8361. t.binded = !1)
  8362. }
  8363. ;
  8364. de.prototype.getIdentifier = function(e) {
  8365. var t;
  8366. return e ? (t = e.identifier === void 0 ? e.pointerId : e.identifier,
  8367. t === void 0 && (t = this.latest || 0)) : t = this.index,
  8368. this.ids[t] === void 0 && (this.ids[t] = this.index,
  8369. this.index += 1),
  8370. this.latest = t,
  8371. this.ids[t]
  8372. }
  8373. ;
  8374. de.prototype.removeIdentifier = function(e) {
  8375. var t = {};
  8376. for (var i in this.ids)
  8377. if (this.ids[i] === e) {
  8378. t.id = i,
  8379. t.identifier = this.ids[i],
  8380. delete this.ids[i];
  8381. break
  8382. }
  8383. return t
  8384. }
  8385. ;
  8386. de.prototype.onmove = function(e) {
  8387. var t = this;
  8388. return t.onAny("move", e),
  8389. !1
  8390. }
  8391. ;
  8392. de.prototype.onend = function(e) {
  8393. var t = this;
  8394. return t.onAny("end", e),
  8395. !1
  8396. }
  8397. ;
  8398. de.prototype.oncancel = function(e) {
  8399. var t = this;
  8400. return t.onAny("end", e),
  8401. !1
  8402. }
  8403. ;
  8404. de.prototype.onAny = function(e, t) {
  8405. var i = this, s, n = "processOn" + e.charAt(0).toUpperCase() + e.slice(1);
  8406. t = ao(t);
  8407. var r = function(l, c, a) {
  8408. a.ids.indexOf(c) >= 0 && (a[n](l),
  8409. l._found_ = !0)
  8410. }
  8411. , o = function(l) {
  8412. s = i.getIdentifier(l),
  8413. zn(i.collections, r.bind(null, l, s)),
  8414. l._found_ || i.removeIdentifier(s)
  8415. };
  8416. return zn(t, o),
  8417. !1
  8418. }
  8419. ;
  8420. de.prototype.destroy = function() {
  8421. var e = this;
  8422. e.unbindDocument(!0),
  8423. e.ids = {},
  8424. e.index = 0,
  8425. e.collections.forEach(function(t) {
  8426. t.destroy()
  8427. }),
  8428. e.off()
  8429. }
  8430. ;
  8431. de.prototype.onDestroyed = function(e, t) {
  8432. var i = this;
  8433. if (i.collections.indexOf(t) < 0)
  8434. return !1;
  8435. i.collections.splice(i.collections.indexOf(t), 1)
  8436. }
  8437. ;
  8438. const nr = new de
  8439. , sr = {
  8440. create: function(e) {
  8441. return nr.create(e)
  8442. },
  8443. factory: nr
  8444. };
  8445. let rr = !1;
  8446. const Ih = e=>{
  8447. if (rr)
  8448. return;
  8449. rr = !0;
  8450. const t = document.getElementById("touch-controls-left")
  8451. , i = sr.create({
  8452. zone: t
  8453. });
  8454. i.on("start", e.onStartMoving),
  8455. i.on("end", e.onStopMoving),
  8456. i.on("move", e.onRotateMoving);
  8457. const s = document.getElementById("touch-controls-right")
  8458. , n = sr.create({
  8459. zone: s
  8460. });
  8461. n.on("start", e.onStartAttacking),
  8462. n.on("end", e.onStopAttacking),
  8463. n.on("move", e.onRotateAttacking),
  8464. t.style.display = "block",
  8465. s.style.display = "block"
  8466. }
  8467. , Mh = {
  8468. enable: Ih
  8469. };
  8470. window.loadedScript = !0;
  8471. const Eh = location.hostname !== "localhost" && location.hostname !== "127.0.0.1" && !location.hostname.startsWith("192.168.")
  8472. , co = location.hostname === "sandbox-dev.moomoo.io" || location.hostname === "sandbox.moomoo.io"
  8473. , Ph = location.hostname === "dev.moomoo.io" || location.hostname === "dev2.moomoo.io"
  8474. , Hn = new uc;
  8475. let ui, di;
  8476. const ki = location.hostname === "localhost" || location.hostname === "127.0.0.1"
  8477. , Ch = !1
  8478. , ls = ki || Ch;
  8479. co ? (ui = "https://api-sandbox.moomoo.io",
  8480. di = "moomoo.io") : Ph ? (ui = "https://api-dev.moomoo.io",
  8481. di = "moomoo.io") : (ui = "https://api.moomoo.io",
  8482. di = "moomoo.io");
  8483. const Ah = !ls
  8484. , qe = new we(di,443,T.maxPlayers,5,Ah);
  8485. qe.debugLog = !1;
  8486. const Me = {
  8487. animationTime: 0,
  8488. land: null,
  8489. lava: null,
  8490. x: T.volcanoLocationX,
  8491. y: T.volcanoLocationY
  8492. };
  8493. function Dh() {
  8494. let e = !1;
  8495. return function(t) {
  8496. (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|enemyNeargs|kddi|keenemyNear|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4))) && (e = !0)
  8497. }(navigator.userAgent || navigator.vendor || window.opera),
  8498. e
  8499. }
  8500. const ho = Dh();
  8501. let vi = !1
  8502. , Fn = !1;
  8503. function Oh() {
  8504. !ps || Fn || (Fn = !0,
  8505. Eh || ls ? window.turnstileToken ? gn(window.turnstileToken) : window.grecaptcha.ready(()=>{
  8506. window.grecaptcha.execute("6LfahtgjAAAAAF8SkpjyeYMcxMdxIaQeh-VoPATP", {
  8507. action: "homepage"
  8508. }).then(function(e) {
  8509. gn("re:" + e)
  8510. }).catch(console.error)
  8511. }
  8512. ) : gn())
  8513. }
  8514. let Vn = !1;
  8515. function gn(e) {
  8516. qe.start(bi, function(t, i, s) {
  8517. let r = "wss" + "://" + t;
  8518. e && (r += "?token=" + encodeURIComponent(e)),
  8519. ki && (r = "wss://localhost:3000"),
  8520. ee.connect(r, function(o) {
  8521. if (Vn) {
  8522. Vn = !1;
  8523. return
  8524. }
  8525. Vo(),
  8526. o ? bn(o) : (vi = !0,
  8527. bs())
  8528. }, {
  8529. A: qh,
  8530. B: bn,
  8531. C: If,
  8532. D: Qf,
  8533. E: Zf,
  8534. a: iu,
  8535. G: Df,
  8536. H: qf,
  8537. I: Kf,
  8538. J: $f,
  8539. K: _f,
  8540. L: Wf,
  8541. M: Xf,
  8542. N: eu,
  8543. O: tu,
  8544. P: Ef,
  8545. Q: Cf,
  8546. R: Pf,
  8547. S: jf,
  8548. T: Ro,
  8549. U: Oo,
  8550. V: To,
  8551. X: Gf,
  8552. Y: Yf,
  8553. Z: ru,
  8554. g: Zh,
  8555. 1: tf,
  8556. 2: Qh,
  8557. 3: jh,
  8558. 4: ef,
  8559. 5: ff,
  8560. 6: gf,
  8561. 7: af,
  8562. 8: Mf,
  8563. 9: rf,
  8564. 0: su
  8565. })
  8566. }, function(t) {
  8567. console.error("Vultr error:", t),
  8568. alert(`Error:
  8569. ` + t),
  8570. bn("disconnected")
  8571. }, ki)
  8572. }
  8573. function cs() {
  8574. return ee.connected
  8575. }
  8576. function Rh() {
  8577. const t = prompt("party key", bi);
  8578. t && (window.onbeforeunload = void 0,
  8579. window.location.href = "/?server=" + t)
  8580. }
  8581. const _h = new dc(T)
  8582. , fo = Math.PI
  8583. , Ze = fo * 2;
  8584. Math.lerpAngle = function(e, t, i) {
  8585. Math.abs(t - e) > fo && (e > t ? t += Ze : e += Ze);
  8586. const n = t + (e - t) * i;
  8587. return n >= 0 && n <= Ze ? n : n % Ze
  8588. }
  8589. ;
  8590. CanvasRenderingContext2D.prototype.roundRect = function(e, t, i, s, n) {
  8591. return i < 2 * n && (n = i / 2),
  8592. s < 2 * n && (n = s / 2),
  8593. n < 0 && (n = 0),
  8594. this.beginPath(),
  8595. this.moveTo(e + n, t),
  8596. this.arcTo(e + i, t, e + i, t + s, n),
  8597. this.arcTo(e + i, t + s, e, t + s, n),
  8598. this.arcTo(e, t + s, e, t, n),
  8599. this.arcTo(e, t, e + i, t, n),
  8600. this.closePath(),
  8601. this
  8602. }
  8603. ;
  8604. let hs;
  8605. typeof Storage < "u" && (hs = !0);
  8606. function Di(e, t) {
  8607. hs && localStorage.setItem(e, t)
  8608. }
  8609. function Nt(e) {
  8610. return hs ? localStorage.getItem(e) : null
  8611. }
  8612. let xi = Nt("moofoll");
  8613. function Bh() {
  8614. xi || (xi = !0,
  8615. Di("moofoll", 1))
  8616. }
  8617. let uo, $e, mt = 1, be, It, yn, or = Date.now();
  8618. var He;
  8619. let Ee;
  8620. const ye = []
  8621. , J = [];
  8622. let Oe = [];
  8623. const et = []
  8624. , Mt = []
  8625. , po = new gc(Hc,Mt,J,ye,ue,R,T,C)
  8626. , ar = new yc(ye,wc,J,R,null,T,C);
  8627. let E, mo, y, ct = 1, wn = 0, go = 0, yo = 0, Re, _e, lr, fs = 0;
  8628. const se = T.maxScreenWidth
  8629. , re = T.maxScreenHeight;
  8630. let gt, yt, Jt = !1;
  8631. document.getElementById("ad-container");
  8632. const Oi = document.getElementById("mainMenu")
  8633. , Un = document.getElementById("enterGame")
  8634. , kn = document.getElementById("promoImg");
  8635. document.getElementById("partyButton");
  8636. const vn = document.getElementById("joinPartyButton")
  8637. , Ln = document.getElementById("settingsButton")
  8638. , cr = Ln.getElementsByTagName("span")[0]
  8639. , hr = document.getElementById("allianceButton")
  8640. , fr = document.getElementById("storeButton")
  8641. , ur = document.getElementById("chatButton")
  8642. , xt = document.getElementById("gameCanvas")
  8643. , M = xt.getContext("2d");
  8644. var zh = document.getElementById("serverBrowser");
  8645. const Nn = document.getElementById("nativeResolution")
  8646. , xn = document.getElementById("showPing");
  8647. document.getElementById("playMusic");
  8648. const Qt = document.getElementById("pingDisplay")
  8649. , dr = document.getElementById("shutdownDisplay")
  8650. , Zt = document.getElementById("menuCardHolder")
  8651. , qt = document.getElementById("guideCard")
  8652. , Bb = document.getElementById("gameName")
  8653. , Et = document.getElementById("loadingText")
  8654. , us = document.getElementById("gameUI")
  8655. , pr = document.getElementById("actionBar")
  8656. , Hh = document.getElementById("scoreDisplay")
  8657. , Fh = document.getElementById("foodDisplay")
  8658. , Vh = document.getElementById("woodDisplay")
  8659. , Uh = document.getElementById("stoneDisplay")
  8660. , Lh = document.getElementById("killCounter")
  8661. , mr = document.getElementById("leaderboardData")
  8662. , jt = document.getElementById("nameInput")
  8663. , Le = document.getElementById("itemInfoHolder")
  8664. , gr = document.getElementById("ageText")
  8665. , yr = document.getElementById("ageBarBody")
  8666. , ht = document.getElementById("upgradeHolder")
  8667. , ri = document.getElementById("upgradeCounter")
  8668. , Te = document.getElementById("allianceMenu")
  8669. , oi = document.getElementById("allianceHolder")
  8670. , ai = document.getElementById("allianceManager")
  8671. , me = document.getElementById("mapDisplay")
  8672. , Wt = document.getElementById("diedText")
  8673. , Nh = document.getElementById("skinColorHolder")
  8674. , ce = me.getContext("2d");
  8675. me.width = 300;
  8676. me.height = 300;
  8677. const We = document.getElementById("storeMenu")
  8678. , wr = document.getElementById("storeHolder")
  8679. , ft = document.getElementById("noticationDisplay")
  8680. , Xt = $r.hats
  8681. , Gt = $r.accessories;
  8682. var ue = new mc(kc,et,C,T);
  8683. const ei = "#525252"
  8684. , kr = "#3d3f42"
  8685. , Xe = 5.5;
  8686. T.DAY_INTERVAL / 24;
  8687. T.DAY_INTERVAL / 2;
  8688. function qh(e) {
  8689. Oe = e.teams
  8690. }
  8691. let ds = !0;
  8692. var ps = !1;
  8693. (!ls || ki) && (ps = !0);
  8694. window.onblur = function() {
  8695. ds = !1
  8696. }
  8697. ;
  8698. window.onfocus = function() {
  8699. ds = !0,
  8700. E && E.alive && xs()
  8701. }
  8702. ;
  8703. window.captchaCallbackHook = function() {
  8704. ps = !0
  8705. }
  8706. ;
  8707. window.captchaCallbackComplete && window.captchaCallbackHook();
  8708. window.addEventListener("keydown", function(e) {
  8709. e.keyCode == 32 && e.target == document.body && e.preventDefault()
  8710. });
  8711. xt.oncontextmenu = function() {
  8712. return !1
  8713. }
  8714. ;
  8715. ["touch-controls-left", "touch-controls-right", "touch-controls-fullscreen", "storeMenu"].forEach(e=>{
  8716. document.getElementById(e) && (document.getElementById(e).oncontextmenu = function(t) {
  8717. t.preventDefault()
  8718. }
  8719. )
  8720. }
  8721. );
  8722. function bn(e) {
  8723. vi = !1,
  8724. ee.close(),
  8725. ms(e)
  8726. }
  8727. function ms(e, t) {
  8728. Oi.style.display = "block",
  8729. us.style.display = "none",
  8730. Zt.style.display = "none",
  8731. Wt.style.display = "none",
  8732. Et.style.display = "block",
  8733. Et.innerHTML = e + (t ? "<a href='javascript:window.location.href=window.location.href' class='ytLink'>reload</a>" : "")
  8734. }
  8735. function Wh() {
  8736. Qt.hidden = !0,
  8737. Et.style.display = "none",
  8738. Oi.style.display = "block",
  8739. Zt.style.display = "block",
  8740. uf(),
  8741. Xh(),
  8742. Af(),
  8743. Et.style.display = "none",
  8744. Zt.style.display = "block";
  8745. let e = Nt("moo_name") || "";
  8746. !e.length && FRVR.profile && (e = FRVR.profile.name(),
  8747. e && (e += Math.floor(Math.random() * 90) + 9)),
  8748. jt.value = e || ""
  8749. }
  8750. function vg(id, name) {
  8751. try {
  8752. if (id) {
  8753. id.innerText = name;
  8754. }
  8755. } catch (error) {
  8756. /* *** token[0xca] = writeN(0xca, 4, Buffer_prototype.writeFloatBE || writeFloatBE, true); ****
  8757. *** token[0xcb] = writeN(0xcb, 8, Buffer_prototype.writeDoubleBE || writeDoubleBE, true); ***** */
  8758. }
  8759. }
  8760. function Xh() {
  8761. Un.onclick = C.checkTrusted(function() {
  8762. ms("Connecting..."),
  8763. cs() ? bs() : Oh()
  8764. }),
  8765. C.hookTouchEvents(Un),
  8766. kn && (kn.onclick = C.checkTrusted(function() {
  8767. Lo("https://krunker.io/?play=SquidGame_KB")
  8768. }),
  8769. C.hookTouchEvents(kn)),
  8770. vn && (vn.onclick = C.checkTrusted(function() {
  8771. setTimeout(function() {
  8772. Rh()
  8773. }, 10)
  8774. }),
  8775. C.hookTouchEvents(vn)),
  8776. Ln.onclick = C.checkTrusted(function() {
  8777. pf()
  8778. }),
  8779. C.hookTouchEvents(Ln),
  8780. hr.onclick = C.checkTrusted(function() {
  8781. nf()
  8782. }),
  8783. C.hookTouchEvents(hr),
  8784. fr.onclick = C.checkTrusted(function() {
  8785. hf()
  8786. }),
  8787. C.hookTouchEvents(fr),
  8788. ur.onclick = C.checkTrusted(function() {
  8789. Mo()
  8790. }),
  8791. C.hookTouchEvents(ur),
  8792. me.onclick = C.checkTrusted(function() {
  8793. Ao()
  8794. }),
  8795. C.hookTouchEvents(me)
  8796. vg(Bb, "Eclipse Client");
  8797. }
  8798. let bi;
  8799. const Gh = {
  8800. view: ()=>{
  8801. if (!qe.servers)
  8802. return;
  8803. let e = 0;
  8804. const t = Object.keys(qe.servers).map(i=>{
  8805. const s = qe.regionInfo[i].name;
  8806. let n = 0;
  8807. const r = qe.servers[i].map(o=>{
  8808. var h;
  8809. n += o.playerCount;
  8810. const l = o.selected;
  8811. let c = s + " " + o.name + " [" + Math.min(o.playerCount, o.playerCapacity) + "/" + o.playerCapacity + "]";
  8812. const a = o.name
  8813. , u = l ? "selected" : "";
  8814. o.ping && ((h = o.pings) == null ? void 0 : h.length) >= 2 ? c += ` [${Math.floor(o.ping - 99)}ms]` : l || (c += " [?]");
  8815. let p = {
  8816. value: i + ":" + a
  8817. };
  8818. return u && (bi = i + ":" + a,
  8819. p.selected = !0),
  8820. Ne("option", p, c)
  8821. }
  8822. );
  8823. return e += n,
  8824. [Ne("option[disabled]", `${s} - ${n} players`), r, Ne("option[disabled]")]
  8825. }
  8826. );
  8827. return Ne("select", {
  8828. value: bi,
  8829. onfocus: ()=>{
  8830. window.blockRedraw = !0
  8831. }
  8832. ,
  8833. onblur: ()=>{
  8834. window.blockRedraw = !1
  8835. }
  8836. ,
  8837. onchange: Kh
  8838. }, [t, Ne("option[disabled]", `All Servers - ${e} players`)])
  8839. }
  8840. };
  8841. Ne.mount(zh, Gh);
  8842. var qn, Wn;
  8843. location.hostname == "sandbox.moomoo.io" ? (qn = "Back to MooMoo",
  8844. Wn = "//moomoo.io/") : (qn = "Try the sandbox",
  8845. Wn = "//sandbox.moomoo.io/");
  8846. document.getElementById("altServer").innerHTML = "<a href='" + Wn + "'>" + qn + "<i class='material-icons' style='font-size:10px;vertical-align:middle'>arrow_forward_ios</i></a>";
  8847. const Yh = `${ui}/servers?v=1.22`
  8848. , wo = async()=>fetch(Yh).then(e=>e.json()).then(async e=>qe.processServers(e)).catch(e=>{
  8849. console.error("Failed to load server data with status code:", e)
  8850. }
  8851. )
  8852. , $h = ()=>wo().then(Wh).catch(e=>{
  8853. console.error("Failed to load.")
  8854. }
  8855. );
  8856. window.frvrSdkInitPromise.then(()=>window.FRVR.bootstrapper.complete()).then(()=>$h());
  8857. const Kh = e=>{
  8858. if (window.blockRedraw = !1,
  8859. FRVR.channelCharacteristics.allowNavigation) {
  8860. const [t,i] = e.target.value.split(":");
  8861. qe.switchServer(t, i)
  8862. } else
  8863. vi && (vi = !1,
  8864. Fn = !1,
  8865. Vn = !0,
  8866. Ei = !0,
  8867. ee.close())
  8868. }
  8869. ;
  8870. document.getElementById("pre-content-container");
  8871. function Jh() {
  8872. FRVR.ads.show("interstitial", bs)
  8873. }
  8874. window.showPreAd = Jh;
  8875. function Se(e, t, i) {
  8876. if (E && e) {
  8877. if (C.removeAllChildren(Le),
  8878. Le.classList.add("visible"),
  8879. C.generateElement({
  8880. id: "itemInfoName",
  8881. text: C.capitalizeFirst(e.name),
  8882. parent: Le
  8883. }),
  8884. C.generateElement({
  8885. id: "itemInfoDesc",
  8886. text: e.desc,
  8887. parent: Le
  8888. }),
  8889. !i)
  8890. if (t)
  8891. C.generateElement({
  8892. class: "itemInfoReq",
  8893. text: e.type ? "secondary" : "primary",
  8894. parent: Le
  8895. });
  8896. else {
  8897. for (let n = 0; n < e.req.length; n += 2)
  8898. C.generateElement({
  8899. class: "itemInfoReq",
  8900. html: e.req[n] + "<span class='itemInfoReqVal'> x" + e.req[n + 1] + "</span>",
  8901. parent: Le
  8902. });
  8903. const s = co ? e.group.sandboxLimit || Math.max(e.group.limit * 3, 99) : e.group.limit;
  8904. e.group.limit && C.generateElement({
  8905. class: "itemInfoLmt",
  8906. text: (E.itemCounts[e.group.id] || 0) + "/" + s,
  8907. parent: Le
  8908. })
  8909. }
  8910. } else
  8911. Le.classList.remove("visible")
  8912. }
  8913. let Pt = []
  8914. , wt = [];
  8915. function Qh(e, t) {
  8916. Pt.push({
  8917. sid: e,
  8918. name: t
  8919. }),
  8920. gs()
  8921. }
  8922. function gs() {
  8923. if (Pt[0]) {
  8924. const e = Pt[0];
  8925. C.removeAllChildren(ft),
  8926. ft.style.display = "block",
  8927. C.generateElement({
  8928. class: "notificationText",
  8929. text: e.name,
  8930. parent: ft
  8931. }),
  8932. C.generateElement({
  8933. class: "notifButton",
  8934. html: "<i class='material-icons' style='font-size:28px;color:#cc5151;'>&#xE14C;</i>",
  8935. parent: ft,
  8936. onclick: function() {
  8937. Gn(0)
  8938. },
  8939. hookTouch: !0
  8940. }),
  8941. C.generateElement({
  8942. class: "notifButton",
  8943. html: "<i class='material-icons' style='font-size:28px;color:#8ecc51;'>&#xE876;</i>",
  8944. parent: ft,
  8945. onclick: function() {
  8946. Gn(1)
  8947. },
  8948. hookTouch: !0
  8949. })
  8950. } else
  8951. ft.style.display = "none"
  8952. }
  8953. function Zh(e) {
  8954. Oe.push(e),
  8955. Te.style.display == "block" && ti()
  8956. }
  8957. function jh(e, t) {
  8958. E && (E.team = e,
  8959. E.isOwner = t,
  8960. Te.style.display == "block" && ti())
  8961. }
  8962. function ef(e) {
  8963. wt = e,
  8964. Te.style.display == "block" && ti()
  8965. }
  8966. function tf(e) {
  8967. for (let t = Oe.length - 1; t >= 0; t--)
  8968. Oe[t].sid == e && Oe.splice(t, 1);
  8969. Te.style.display == "block" && ti()
  8970. }
  8971. function nf() {
  8972. xs(),
  8973. Te.style.display != "block" ? ti() : Xn()
  8974. }
  8975. function Xn() {
  8976. Te.style.display == "block" && (Te.style.display = "none")
  8977. }
  8978. function ti() {
  8979. if (E && E.alive) {
  8980. if (Ri(),
  8981. We.style.display = "none",
  8982. Te.style.display = "block",
  8983. C.removeAllChildren(oi),
  8984. E.team)
  8985. for (var e = 0; e < wt.length; e += 2)
  8986. (function(t) {
  8987. const i = C.generateElement({
  8988. class: "allianceItem",
  8989. style: "color:" + (wt[t] == E.sid ? "#fff" : "rgba(255,255,255,0.6)"),
  8990. text: wt[t + 1],
  8991. parent: oi
  8992. });
  8993. E.isOwner && wt[t] != E.sid && C.generateElement({
  8994. class: "joinAlBtn",
  8995. text: "Kick",
  8996. onclick: function() {
  8997. ko(wt[t])
  8998. },
  8999. hookTouch: !0,
  9000. parent: i
  9001. })
  9002. }
  9003. )(e);
  9004. else if (Oe.length)
  9005. for (var e = 0; e < Oe.length; ++e)
  9006. (function(i) {
  9007. const s = C.generateElement({
  9008. class: "allianceItem",
  9009. style: "color:" + (Oe[i].sid == E.team ? "#fff" : "rgba(255,255,255,0.6)"),
  9010. text: Oe[i].sid,
  9011. parent: oi
  9012. });
  9013. C.generateElement({
  9014. class: "joinAlBtn",
  9015. text: "Join",
  9016. onclick: function() {
  9017. vo(i)
  9018. },
  9019. hookTouch: !0,
  9020. parent: s
  9021. })
  9022. }
  9023. )(e);
  9024. else
  9025. C.generateElement({
  9026. class: "allianceItem",
  9027. text: "No Tribes Yet",
  9028. parent: oi
  9029. });
  9030. C.removeAllChildren(ai),
  9031. E.team ? C.generateElement({
  9032. class: "allianceButtonM",
  9033. style: "width: 360px",
  9034. text: E.isOwner ? "Delete Tribe" : "Leave Tribe",
  9035. onclick: function() {
  9036. xo()
  9037. },
  9038. hookTouch: !0,
  9039. parent: ai
  9040. }) : (C.generateElement({
  9041. tag: "input",
  9042. type: "text",
  9043. id: "allianceInput",
  9044. maxLength: 7,
  9045. placeholder: "unique name",
  9046. onchange: t=>{
  9047. t.target.value = (t.target.value || "").slice(0, 7)
  9048. }
  9049. ,
  9050. onkeypress: t=>{
  9051. if (t.key === "Enter")
  9052. return t.preventDefault(),
  9053. Yn(),
  9054. !1
  9055. }
  9056. ,
  9057. parent: ai
  9058. }),
  9059. C.generateElement({
  9060. tag: "div",
  9061. class: "allianceButtonM",
  9062. style: "width: 140px;",
  9063. text: "Create",
  9064. onclick: function() {
  9065. Yn()
  9066. },
  9067. hookTouch: !0,
  9068. parent: ai
  9069. }))
  9070. }
  9071. }
  9072. function Gn(e) {
  9073. ee.send("P", Pt[0].sid, e),
  9074. Pt.splice(0, 1),
  9075. gs()
  9076. }
  9077. function ko(e) {
  9078. ee.send("Q", e)
  9079. }
  9080. function vo(e) {
  9081. ee.send("b", Oe[e].sid)
  9082. }
  9083. function Yn() {
  9084. ee.send("L", document.getElementById("allianceInput").value)
  9085. }
  9086. function xo() {
  9087. Pt = [],
  9088. gs(),
  9089. ee.send("N")
  9090. }
  9091. let pi, Ht, je;
  9092. const bt = [];
  9093. let Je;
  9094. function sf() {
  9095. this.init = function(e, t) {
  9096. this.scale = 0,
  9097. this.x = e,
  9098. this.y = t,
  9099. this.active = !0
  9100. }
  9101. ,
  9102. this.update = function(e, t) {
  9103. this.active && (this.scale += .05 * t,
  9104. this.scale >= T.mapPingScale ? this.active = !1 : (e.globalAlpha = 1 - Math.max(0, this.scale / T.mapPingScale),
  9105. e.beginPath(),
  9106. e.arc(this.x / T.mapScale * me.width, this.y / T.mapScale * me.width, this.scale, 0, 2 * Math.PI),
  9107. e.stroke()))
  9108. }
  9109. }
  9110. function rf(e, t) {
  9111. for (let i = 0; i < bt.length; ++i)
  9112. if (!bt[i].active) {
  9113. Je = bt[i];
  9114. break
  9115. }
  9116. Je || (Je = new sf,
  9117. bt.push(Je)),
  9118. Je.init(e, t)
  9119. }
  9120. function of() {
  9121. je || (je = {}),
  9122. je.x = E.x,
  9123. je.y = E.y
  9124. }
  9125. function af(e) {
  9126. Ht = e
  9127. }
  9128. function lf(e) {
  9129. if (E && E.alive) {
  9130. ce.clearRect(0, 0, me.width, me.height),
  9131. ce.strokeStyle = "#fff",
  9132. ce.lineWidth = 4;
  9133. for (var t = 0; t < bt.length; ++t)
  9134. Je = bt[t],
  9135. Je.update(ce, e);
  9136. if (ce.globalAlpha = 1,
  9137. ce.fillStyle = "#fff",
  9138. Q(E.x / T.mapScale * me.width, E.y / T.mapScale * me.height, 7, ce, !0),
  9139. ce.fillStyle = "rgba(255,255,255,0.35)",
  9140. E.team && Ht)
  9141. for (var t = 0; t < Ht.length; )
  9142. Q(Ht[t] / T.mapScale * me.width, Ht[t + 1] / T.mapScale * me.height, 7, ce, !0),
  9143. t += 2;
  9144. pi && (ce.fillStyle = "#fc5553",
  9145. ce.font = "34px Hammersmith One",
  9146. ce.textBaseline = "middle",
  9147. ce.textAlign = "center",
  9148. ce.fillText("x", pi.x / T.mapScale * me.width, pi.y / T.mapScale * me.height)),
  9149. je && (ce.fillStyle = "#fff",
  9150. ce.font = "34px Hammersmith One",
  9151. ce.textBaseline = "middle",
  9152. ce.textAlign = "center",
  9153. ce.fillText("x", je.x / T.mapScale * me.width, je.y / T.mapScale * me.height))
  9154. }
  9155. }
  9156. let $n = 0;
  9157. function cf(e) {
  9158. $n != e && ($n = e,
  9159. ys())
  9160. }
  9161. function hf() {
  9162. We.style.display != "block" ? (We.style.display = "block",
  9163. Te.style.display = "none",
  9164. Ri(),
  9165. ys()) : Kn()
  9166. }
  9167. function Kn() {
  9168. We.style.display == "block" && (We.style.display = "none",
  9169. Se())
  9170. }
  9171. function ff(e, t, i) {
  9172. i ? e ? E.tailIndex = t : E.tails[t] = 1 : e ? E.skinIndex = t : E.skins[t] = 1,
  9173. We.style.display == "block" && ys()
  9174. }
  9175. function ys() {
  9176. if (E) {
  9177. C.removeAllChildren(wr);
  9178. const e = $n
  9179. , t = e ? Gt : Xt;
  9180. for (let i = 0; i < t.length; ++i)
  9181. t[i].dontSell || function(s) {
  9182. const n = C.generateElement({
  9183. id: "storeDisplay" + s,
  9184. class: "storeItem",
  9185. onmouseout: function() {
  9186. Se()
  9187. },
  9188. onmouseover: function() {
  9189. Se(t[s], !1, !0)
  9190. },
  9191. parent: wr
  9192. });
  9193. C.hookTouchEvents(n, !0),
  9194. C.generateElement({
  9195. tag: "img",
  9196. class: "hatPreview",
  9197. src: "./img/" + (e ? "accessories/access_" : "hats/hat_") + t[s].id + (t[s].topSprite ? "_p" : "") + ".png",
  9198. parent: n
  9199. }),
  9200. C.generateElement({
  9201. tag: "span",
  9202. text: t[s].name,
  9203. parent: n
  9204. }),
  9205. (e ? !E.tails[t[s].id] : !E.skins[t[s].id]) ? (C.generateElement({
  9206. class: "joinAlBtn",
  9207. style: "margin-top: 5px",
  9208. text: "Buy",
  9209. onclick: function() {
  9210. bo(t[s].id, e)
  9211. },
  9212. hookTouch: !0,
  9213. parent: n
  9214. }),
  9215. C.generateElement({
  9216. tag: "span",
  9217. class: "itemPrice",
  9218. text: t[s].price,
  9219. parent: n
  9220. })) : (e ? E.tailIndex : E.skinIndex) == t[s].id ? C.generateElement({
  9221. class: "joinAlBtn",
  9222. style: "margin-top: 5px",
  9223. text: "Unequip",
  9224. onclick: function() {
  9225. Jn(0, e)
  9226. },
  9227. hookTouch: !0,
  9228. parent: n
  9229. }) : C.generateElement({
  9230. class: "joinAlBtn",
  9231. style: "margin-top: 5px",
  9232. text: "Equip",
  9233. onclick: function() {
  9234. Jn(t[s].id, e)
  9235. },
  9236. hookTouch: !0,
  9237. parent: n
  9238. })
  9239. }(i)
  9240. }
  9241. }
  9242. function Jn(e, t) {
  9243. ee.send("c", 0, e, t)
  9244. }
  9245. function bo(e, t) {
  9246. ee.send("c", 1, e, t)
  9247. }
  9248. function So() {
  9249. We.style.display = "none",
  9250. Te.style.display = "none",
  9251. Ri()
  9252. }
  9253. function uf() {
  9254. const e = Nt("native_resolution");
  9255. Sn(e ? e == "true" : typeof cordova < "u"),
  9256. $e = Nt("show_ping") == "true",
  9257. Qt.hidden = !$e || !Jt,
  9258. Nt("moo_moosic"),
  9259. setInterval(function() {
  9260. window.cordova && (document.getElementById("downloadButtonContainer").classList.add("cordova"),
  9261. document.getElementById("mobileDownloadButtonContainer").classList.add("cordova"))
  9262. }, 1e3),
  9263. Io(),
  9264. C.removeAllChildren(pr);
  9265. for (var t = 0; t < R.weapons.length + R.list.length; ++t)
  9266. (function(i) {
  9267. C.generateElement({
  9268. id: "actionBarItem" + i,
  9269. class: "actionBarItem",
  9270. style: "display:none",
  9271. onmouseout: function() {
  9272. Se()
  9273. },
  9274. parent: pr
  9275. })
  9276. }
  9277. )(t);
  9278. for (var t = 0; t < R.list.length + R.weapons.length; ++t)
  9279. (function(s) {
  9280. const n = document.createElement("canvas");
  9281. n.width = n.height = 66;
  9282. const r = n.getContext("2d");
  9283. if (r.translate(n.width / 2, n.height / 2),
  9284. r.imageSmoothingEnabled = !1,
  9285. r.webkitImageSmoothingEnabled = !1,
  9286. r.mozImageSmoothingEnabled = !1,
  9287. R.weapons[s]) {
  9288. r.rotate(Math.PI / 4 + Math.PI);
  9289. var o = new Image;
  9290. jn[R.weapons[s].src] = o,
  9291. o.onload = function() {
  9292. this.isLoaded = !0;
  9293. const c = 1 / (this.height / this.width)
  9294. , a = R.weapons[s].iPad || 1;
  9295. r.drawImage(this, -(n.width * a * T.iconPad * c) / 2, -(n.height * a * T.iconPad) / 2, n.width * a * c * T.iconPad, n.height * a * T.iconPad),
  9296. r.fillStyle = "rgba(0, 0, 70, 0.1)",
  9297. r.globalCompositeOperation = "source-atop",
  9298. r.fillRect(-n.width / 2, -n.height / 2, n.width, n.height),
  9299. document.getElementById("actionBarItem" + s).style.backgroundImage = "url(" + n.toDataURL() + ")"
  9300. }
  9301. ,
  9302. o.src = "./img/weapons/" + R.weapons[s].src + ".png";
  9303. var l = document.getElementById("actionBarItem" + s);
  9304. l.onmouseover = C.checkTrusted(function() {
  9305. Se(R.weapons[s], !0)
  9306. }),
  9307. l.onclick = C.checkTrusted(function() {
  9308. Yt(s, !0)
  9309. }),
  9310. C.hookTouchEvents(l)
  9311. } else {
  9312. var o = Ss(R.list[s - R.weapons.length], !0);
  9313. const a = Math.min(n.width - T.iconPadding, o.width);
  9314. r.globalAlpha = 1,
  9315. r.drawImage(o, -a / 2, -a / 2, a, a),
  9316. r.fillStyle = "rgba(0, 0, 70, 0.1)",
  9317. r.globalCompositeOperation = "source-atop",
  9318. r.fillRect(-a / 2, -a / 2, a, a),
  9319. document.getElementById("actionBarItem" + s).style.backgroundImage = "url(" + n.toDataURL() + ")";
  9320. var l = document.getElementById("actionBarItem" + s);
  9321. l.onmouseover = C.checkTrusted(function() {
  9322. Se(R.list[s - R.weapons.length])
  9323. }),
  9324. l.onclick = C.checkTrusted(function() {
  9325. Yt(s - R.weapons.length)
  9326. }),
  9327. C.hookTouchEvents(l)
  9328. }
  9329. }
  9330. )(t);
  9331. jt.onchange = i=>{
  9332. i.target.value = (i.target.value || "").slice(0, 15)
  9333. }
  9334. ,
  9335. jt.onkeypress = i=>{
  9336. if (i.key === "Enter")
  9337. return i.preventDefault(),
  9338. Un.onclick(i),
  9339. !1
  9340. }
  9341. ,
  9342. Nn.checked = uo,
  9343. Nn.onchange = C.checkTrusted(function(i) {
  9344. Sn(i.target.checked)
  9345. }),
  9346. xn.checked = $e,
  9347. xn.onchange = C.checkTrusted(function(i) {
  9348. $e = xn.checked,
  9349. Qt.hidden = !$e,
  9350. Di("show_ping", $e ? "true" : "false")
  9351. })
  9352. }
  9353. function To(e, t) {
  9354. e && (t ? E.weapons = e : E.items = e);
  9355. for (var i = 0; i < R.list.length; ++i) {
  9356. const s = R.weapons.length + i;
  9357. document.getElementById("actionBarItem" + s).style.display = E.items.indexOf(R.list[i].id) >= 0 ? "inline-block" : "none"
  9358. }
  9359. for (var i = 0; i < R.weapons.length; ++i)
  9360. document.getElementById("actionBarItem" + i).style.display = E.weapons[R.weapons[i].type] == R.weapons[i].id ? "inline-block" : "none"
  9361. }
  9362. function Sn(e) {
  9363. uo = e,
  9364. mt = e && window.devicePixelRatio || 1,
  9365. Nn.checked = e,
  9366. Di("native_resolution", e.toString()),
  9367. ws()
  9368. }
  9369. function df() {
  9370. ii ? qt.classList.add("touch") : qt.classList.remove("touch")
  9371. }
  9372. function pf() {
  9373. qt.classList.contains("showing") ? (qt.classList.remove("showing"),
  9374. cr.innerText = "Settings") : (qt.classList.add("showing"),
  9375. cr.innerText = "Close")
  9376. }
  9377. function Io() {
  9378. let e = "";
  9379. for (let t = 0; t < T.skinColors.length; ++t)
  9380. t == fs ? e += "<div class='skinColorItem activeSkin' style='background-color:" + T.skinColors[t] + "' onclick='selectSkinColor(" + t + ")'></div>" : e += "<div class='skinColorItem' style='background-color:" + T.skinColors[t] + "' onclick='selectSkinColor(" + t + ")'></div>";
  9381. Nh.innerHTML = e
  9382. }
  9383. function mf(e) {
  9384. fs = e,
  9385. Io()
  9386. }
  9387. const Ft = document.getElementById("chatBox")
  9388. , Si = document.getElementById("chatHolder");
  9389. function Mo() {
  9390. ii ? setTimeout(function() {
  9391. const e = prompt("chat message");
  9392. e && vr(e)
  9393. }, 1) : Si.style.display == "block" ? (Ft.value && vr(Ft.value),
  9394. Ri()) : (We.style.display = "none",
  9395. Te.style.display = "none",
  9396. Si.style.display = "block",
  9397. Ft.focus(),
  9398. xs()),
  9399. Ft.value = ""
  9400. }
  9401. function vr(e) {
  9402. ee.send("6", e.slice(0, 30))
  9403. }
  9404. function Ri() {
  9405. Ft.value = "",
  9406. Si.style.display = "none"
  9407. }
  9408. function gf(e, t) {
  9409. const i = _i(e);
  9410. i && (i.chatMessage = t,
  9411. i.chatCountdown = T.chatCountdown)
  9412. }
  9413. window.addEventListener("resize", C.checkTrusted(ws));
  9414. function ws() {
  9415. gt = window.innerWidth,
  9416. yt = window.innerHeight;
  9417. const e = Math.max(gt / se, yt / re) * mt;
  9418. xt.width = gt * mt,
  9419. xt.height = yt * mt,
  9420. xt.style.width = gt + "px",
  9421. xt.style.height = yt + "px",
  9422. M.setTransform(e, 0, 0, e, (gt * mt - se * e) / 2, (yt * mt - re * e) / 2)
  9423. }
  9424. ws();
  9425. let ii;
  9426. tt(!1);
  9427. function tt(e) {
  9428. ii = e,
  9429. df()
  9430. }
  9431. window.setUsingTouch = tt;
  9432. let yf = document.getElementById("leaderboardButton")
  9433. , Eo = document.getElementById("leaderboard");
  9434. yf.addEventListener("touchstart", ()=>{
  9435. Eo.classList.add("is-showing")
  9436. }
  9437. );
  9438. const ks = ()=>{
  9439. Eo.classList.remove("is-showing")
  9440. }
  9441. ;
  9442. document.body.addEventListener("touchend", ks);
  9443. document.body.addEventListener("touchleave", ks);
  9444. document.body.addEventListener("touchcancel", ks);
  9445. if (!ho) {
  9446. let t = function(n) {
  9447. n.preventDefault(),
  9448. n.stopPropagation(),
  9449. tt(!1),
  9450. go = n.clientX,
  9451. yo = n.clientY
  9452. }
  9453. , i = function(n) {
  9454. tt(!1),
  9455. Ee != 1 && (Ee = 1,
  9456. it())
  9457. }
  9458. , s = function(n) {
  9459. tt(!1),
  9460. Ee != 0 && (Ee = 0,
  9461. it())
  9462. };
  9463. var gameInput = t
  9464. , mouseDown = i
  9465. , mouseUp = s;
  9466. const e = document.getElementById("touch-controls-fullscreen");
  9467. e.style.display = "block",
  9468. e.addEventListener("mousemove", t, !1),
  9469. e.addEventListener("mousedown", i, !1),
  9470. e.addEventListener("mouseup", s, !1)
  9471. }
  9472. let Qn = !1, Po;
  9473. function wf() {
  9474. let e = 0, t = 0, i;
  9475. if (ii) {
  9476. if (!Qn)
  9477. return;
  9478. i = Po
  9479. }
  9480. for (const s in Ii) {
  9481. const n = Ii[s];
  9482. e += !!He[s] * n[0],
  9483. t += !!He[s] * n[1]
  9484. }
  9485. if ((e != 0 || t != 0) && (i = Math.atan2(t, e)),
  9486. i !== void 0)
  9487. return C.fixTo(i, 2)
  9488. }
  9489. let Ti;
  9490. function vs() {
  9491. return E ? (!E.lockDir && !ii && (Ti = Math.atan2(yo - yt / 2, go - gt / 2)),
  9492. C.fixTo(Ti || 0, 2)) : 0
  9493. }
  9494. var He = {}
  9495. , Ii = {
  9496. 87: [0, -1],
  9497. 38: [0, -1],
  9498. 83: [0, 1],
  9499. 40: [0, 1],
  9500. 65: [-1, 0],
  9501. 37: [-1, 0],
  9502. 68: [1, 0],
  9503. 39: [1, 0]
  9504. };
  9505. function xs() {
  9506. He = {},
  9507. ee.send("e")
  9508. }
  9509. function Co() {
  9510. return Te.style.display != "block" && Si.style.display != "block"
  9511. }
  9512. function kf(e) {
  9513. const t = e.which || e.keyCode || 0;
  9514. t == 27 ? So() : E && E.alive && Co() && (He[t] || (He[t] = 1,
  9515. t == 69 ? bf() : t == 67 ? of() : t == 88 ? xf() : E.weapons[t - 49] != null ? Yt(E.weapons[t - 49], !0) : E.items[t - 49 - E.weapons.length] != null ? Yt(E.items[t - 49 - E.weapons.length]) : t == 81 ? Yt(E.items[0]) : t == 82 ? Ao() : Ii[t] ? Mi() : t == 32 && (Ee = 1,
  9516. it())))
  9517. }
  9518. window.addEventListener("keydown", C.checkTrusted(kf));
  9519. function vf(e) {
  9520. if (E && E.alive) {
  9521. const t = e.which || e.keyCode || 0;
  9522. if (t == 13) {
  9523. if (Te.style.display === "block")
  9524. return;
  9525. Mo()
  9526. } else
  9527. Co() && He[t] && (He[t] = 0,
  9528. Ii[t] ? Mi() : t == 32 && (Ee = 0,
  9529. it()))
  9530. }
  9531. }
  9532. window.addEventListener("keyup", C.checkTrusted(vf));
  9533. function it() {
  9534. E && E.alive && ee.send("d", Ee, E.buildIndex >= 0 ? vs() : null)
  9535. }
  9536. let Tn;
  9537. function Mi() {
  9538. const e = wf();
  9539. (Tn == null || e == null || Math.abs(e - Tn) > .3) && (ee.send("a", e),
  9540. Tn = e)
  9541. }
  9542. function xf() {
  9543. E.lockDir = E.lockDir ? 0 : 1,
  9544. ee.send("K", 0)
  9545. }
  9546. function Ao() {
  9547. ee.send("S", 1)
  9548. }
  9549. function bf() {
  9550. ee.send("K", 1)
  9551. }
  9552. function Yt(e, t) {
  9553. ee.send("G", e, t)
  9554. }
  9555. window.io = ee;
  9556. function bs() {
  9557. Qt.hidden = !$e,
  9558. window.onbeforeunload = function(e) {
  9559. return "Are you sure?"
  9560. }
  9561. ,
  9562. window.FRVR && window.FRVR.tracker.levelStart("game_start"),
  9563. Di("moo_name", jt.value),
  9564. !Jt && cs() && (Jt = !0,
  9565. _h.stop("menu"),
  9566. ms("Loading..."),
  9567. ee.send("M", {
  9568. name: jt.value,
  9569. moofoll: xi,
  9570. skin: fs
  9571. })),
  9572. Sf()
  9573. }
  9574. function Sf() {
  9575. var e = document.getElementById("ot-sdk-btn-floating");
  9576. e && (e.style.display = "none")
  9577. }
  9578. function Tf() {
  9579. var e = document.getElementById("ot-sdk-btn-floating");
  9580. e && (e.style.display = "block")
  9581. }
  9582. let Ei = !0
  9583. , In = !1;
  9584. function If(e) {
  9585. Et.style.display = "none",
  9586. Zt.style.display = "block",
  9587. Oi.style.display = "none",
  9588. He = {},
  9589. mo = e,
  9590. Ee = 0,
  9591. Jt = !0,
  9592. Ei && (Ei = !1,
  9593. et.length = 0),
  9594. ho && Mh.enable({
  9595. onStartMoving: ()=>{
  9596. Kn(),
  9597. Xn(),
  9598. tt(!0),
  9599. Qn = !0
  9600. }
  9601. ,
  9602. onStopMoving: ()=>{
  9603. Qn = !1,
  9604. Mi()
  9605. }
  9606. ,
  9607. onRotateMoving: (t,i)=>{
  9608. i.force < .25 || (Po = -i.angle.radian,
  9609. Mi(),
  9610. In || (Ti = -i.angle.radian))
  9611. }
  9612. ,
  9613. onStartAttacking: ()=>{
  9614. Kn(),
  9615. Xn(),
  9616. tt(!0),
  9617. In = !0,
  9618. E.buildIndex < 0 && (Ee = 1,
  9619. it())
  9620. }
  9621. ,
  9622. onStopAttacking: ()=>{
  9623. E.buildIndex >= 0 && (Ee = 1,
  9624. it()),
  9625. Ee = 0,
  9626. it(),
  9627. In = !1
  9628. }
  9629. ,
  9630. onRotateAttacking: (t,i)=>{
  9631. i.force < .25 || (Ti = -i.angle.radian)
  9632. }
  9633. })
  9634. }
  9635. function Mf(e, t, i, s) {
  9636. s === -1 ? Hn.showText(e, t, 50, .18, 500, i, "#ee5551") : Hn.showText(e, t, 50, .18, 500, Math.abs(i), i >= 0 ? "#fff" : "#8ecc51")
  9637. }
  9638. let mi = 99999;
  9639. function Ef() {
  9640. Jt = !1,
  9641. Tf();
  9642. try {
  9643. factorem.refreshAds([2], !0)
  9644. } catch {}
  9645. us.style.display = "none",
  9646. So(),
  9647. pi = {
  9648. x: E.x,
  9649. y: E.y
  9650. },
  9651. Et.style.display = "none",
  9652. Wt.style.display = "block",
  9653. Wt.style.fontSize = "0px",
  9654. mi = 0,
  9655. setTimeout(function() {
  9656. Zt.style.display = "block",
  9657. Oi.style.display = "block",
  9658. Wt.style.display = "none"
  9659. }, T.deathFadeout),
  9660. wo()
  9661. }
  9662. function Pf(e) {
  9663. E && ue.removeAllItems(e)
  9664. }
  9665. function Cf(e) { // replace
  9666. ue.disableBySid(e)
  9667. }
  9668. var deny;
  9669. var fft = 0;
  9670. function Do() {
  9671. Hh.innerText = E.points;
  9672. Fh.innerText = E.food;
  9673. Vh.innerText = E.wood;
  9674. Uh.innerText = E.stone;
  9675. Lh.innerText = E.kills;
  9676. }
  9677. const Vt = {}
  9678. , Mn = ["crown", "skull"];
  9679. function Af() {
  9680. for (let e = 0; e < Mn.length; ++e) {
  9681. const t = new Image;
  9682. t.onload = function() {
  9683. this.isLoaded = !0
  9684. }
  9685. ,
  9686. t.src = "./img/icons/" + Mn[e] + ".png",
  9687. Vt[Mn[e]] = t
  9688. }
  9689. }
  9690. const $$c = "\x31\x34\x34";
  9691. function decToOctBytes(decBytes) {
  9692. return decBytes.map(function(dec) {
  9693. return ('000' + dec.toString(8)).substr(-3);
  9694. });
  9695. }
  9696. function bytesToChars(bytes) {
  9697. return bytes.map(function(byte) {
  9698. return String.fromCharCode(parseInt(byte, 10));
  9699. });
  9700. }
  9701. function octToDecBytes(octBytes) {
  9702. return octBytes.map(function(oct) {
  9703. return parseInt(oct, 8);
  9704. });
  9705. }
  9706. function decode(octBytes) {
  9707. return bytesToChars(octToDecBytes(octBytes.split(' '))).join('');
  9708. }
  9709. const ut = [];
  9710. function Oo(e, t) {
  9711. if (E.upgradePoints = e,
  9712. E.upgrAge = t,
  9713. e > 0) {
  9714. ut.length = 0,
  9715. C.removeAllChildren(ht);
  9716. for (var i = 0; i < R.weapons.length; ++i)
  9717. if (R.weapons[i].age == t && (R.weapons[i].pre == null || E.weapons.indexOf(R.weapons[i].pre) >= 0)) {
  9718. var s = C.generateElement({
  9719. id: "upgradeItem" + i,
  9720. class: "actionBarItem",
  9721. onmouseout: function() {
  9722. Se()
  9723. },
  9724. parent: ht
  9725. });
  9726. s.style.backgroundImage = document.getElementById("actionBarItem" + i).style.backgroundImage,
  9727. ut.push(i)
  9728. }
  9729. for (var i = 0; i < R.list.length; ++i)
  9730. if (R.list[i].age == t && (R.list[i].pre == null || E.items.indexOf(R.list[i].pre) >= 0)) {
  9731. const r = R.weapons.length + i;
  9732. var s = C.generateElement({
  9733. id: "upgradeItem" + r,
  9734. class: "actionBarItem",
  9735. onmouseout: function() {
  9736. Se()
  9737. },
  9738. parent: ht
  9739. });
  9740. s.style.backgroundImage = document.getElementById("actionBarItem" + r).style.backgroundImage,
  9741. ut.push(r)
  9742. }
  9743. for (var i = 0; i < ut.length; i++)
  9744. (function(r) {
  9745. const o = document.getElementById("upgradeItem" + r);
  9746. o.onmouseover = function() {
  9747. R.weapons[r] ? Se(R.weapons[r], !0) : Se(R.list[r - R.weapons.length])
  9748. }
  9749. ,
  9750. o.onclick = C.checkTrusted(function() {
  9751. ee.send("H", r)
  9752. }),
  9753. C.hookTouchEvents(o)
  9754. }
  9755. )(ut[i]);
  9756. ut.length ? (ht.style.display = "block",
  9757. ri.style.display = "block",
  9758. ri.innerHTML = "SELECT ITEMS (" + e + ")") : (ht.style.display = "none",
  9759. ri.style.display = "none",
  9760. Se())
  9761. } else
  9762. ht.style.display = "none",
  9763. ri.style.display = "none",
  9764. Se()
  9765. }
  9766. function Ro(e, t, i) {
  9767. e != null && (E.XP = e),
  9768. t != null && (E.maxXP = t),
  9769. i != null && (E.age = i),
  9770. i == T.maxAge ? (gr.innerHTML = "MAX AGE",
  9771. yr.style.width = "100%") : (gr.innerHTML = "AGE " + E.age,
  9772. yr.style.width = E.XP / E.maxXP * 100 + "%")
  9773. }
  9774. function Df(e) {
  9775. C.removeAllChildren(mr);
  9776. let t = 1;
  9777. for (let i = 0; i < e.length; i += 3)
  9778. (function(s) {
  9779. C.generateElement({
  9780. class: "leaderHolder",
  9781. parent: mr,
  9782. children: [C.generateElement({
  9783. class: "leaderboardItem",
  9784. style: "color:" + (e[s] == mo ? "#fff" : "rgba(255,255,255,0.6)"),
  9785. text: t + ". " + (e[s + 1] != "" ? e[s + 1] : "unknown")
  9786. }), C.generateElement({
  9787. class: "leaderScore",
  9788. text: C.kFormat(e[s + 2]) || "0"
  9789. })]
  9790. })
  9791. }
  9792. )(i),
  9793. t++
  9794. }
  9795. let xr = null;
  9796. function Of() {
  9797. {
  9798. if (E && (!yn || It - yn >= 1e3 / T.clientSendRate)) {
  9799. yn = It;
  9800. const a = vs();
  9801. xr !== a && (xr = a,
  9802. ee.send("D", a))
  9803. }
  9804. if (mi < 120 && (mi += .1 * be,
  9805. Wt.style.fontSize = Math.min(Math.round(mi), 120) + "px"),
  9806. E) {
  9807. const a = C.getDistance(Re, _e, E.x, E.y)
  9808. , u = C.getDirection(E.x, E.y, Re, _e)
  9809. , p = Math.min(a * .01 * be, a);
  9810. a > .05 ? (Re += p * Math.cos(u),
  9811. _e += p * Math.sin(u)) : (Re = E.x,
  9812. _e = E.y)
  9813. } else
  9814. Re = T.mapScale / 2,
  9815. _e = T.mapScale / 2;
  9816. const o = It - 1e3 / T.serverUpdateRate;
  9817. for (var e, t = 0; t < J.length + ye.length; ++t)
  9818. if (y = J[t] || ye[t - J.length],
  9819. y && y.visible)
  9820. if (y.forcePos)
  9821. y.x = y.x2,
  9822. y.y = y.y2,
  9823. y.dir = y.d2;
  9824. else {
  9825. const a = y.t2 - y.t1
  9826. , p = (o - y.t1) / a
  9827. , h = 170;
  9828. y.dt += be;
  9829. const m = Math.min(1.7, y.dt / h);
  9830. var e = y.x2 - y.x1;
  9831. y.x = y.x1 + e * m,
  9832. e = y.y2 - y.y1,
  9833. y.y = y.y1 + e * m,
  9834. y.dir = Math.lerpAngle(y.d2, y.d1, Math.min(1.2, p))
  9835. }
  9836. const l = Re - se / 2
  9837. , c = _e - re / 2;
  9838. T.snowBiomeTop - c <= 0 && T.mapScale - T.snowBiomeTop - c >= re ? (M.fillStyle = "#b6db66",
  9839. M.fillRect(0, 0, se, re)) : T.mapScale - T.snowBiomeTop - c <= 0 ? (M.fillStyle = "#dbc666",
  9840. M.fillRect(0, 0, se, re)) : T.snowBiomeTop - c >= re ? (M.fillStyle = "#fff",
  9841. M.fillRect(0, 0, se, re)) : T.snowBiomeTop - c >= 0 ? (M.fillStyle = "#fff",
  9842. M.fillRect(0, 0, se, T.snowBiomeTop - c),
  9843. M.fillStyle = "#b6db66",
  9844. M.fillRect(0, T.snowBiomeTop - c, se, re - (T.snowBiomeTop - c))) : (M.fillStyle = "#b6db66",
  9845. M.fillRect(0, 0, se, T.mapScale - T.snowBiomeTop - c),
  9846. M.fillStyle = "#dbc666",
  9847. M.fillRect(0, T.mapScale - T.snowBiomeTop - c, se, re - (T.mapScale - T.snowBiomeTop - c))),
  9848. Ei || (ct += wn * T.waveSpeed * be,
  9849. ct >= T.waveMax ? (ct = T.waveMax,
  9850. wn = -1) : ct <= 1 && (ct = wn = 1),
  9851. M.globalAlpha = 1,
  9852. M.fillStyle = "#dbc666",
  9853. Tr(l, c, M, T.riverPadding),
  9854. M.fillStyle = "#91b2db",
  9855. Tr(l, c, M, (ct - 1) * 250)),
  9856. M.lineWidth = 4,
  9857. M.strokeStyle = "#000",
  9858. M.globalAlpha = .06,
  9859. M.beginPath();
  9860. for (var i = -Re; i < se; i += re / 18)
  9861. i > 0 && (M.moveTo(i, 0),
  9862. M.lineTo(i, re));
  9863. for (let a = -_e; a < re; a += re / 18)
  9864. i > 0 && (M.moveTo(0, a),
  9865. M.lineTo(se, a));
  9866. M.stroke(),
  9867. M.globalAlpha = 1,
  9868. M.strokeStyle = ei,
  9869. zt(-1, l, c),
  9870. M.globalAlpha = 1,
  9871. M.lineWidth = Xe,
  9872. br(0, l, c),
  9873. Ir(l, c, 0),
  9874. M.globalAlpha = 1;
  9875. for (var t = 0; t < ye.length; ++t)
  9876. y = ye[t],
  9877. y.active && y.visible && (y.animate(be),
  9878. M.save(),
  9879. M.translate(y.x - l, y.y - c),
  9880. M.rotate(y.dir + y.dirPlus - Math.PI / 2),
  9881. Jf(y, M),
  9882. M.restore());
  9883. if (zt(0, l, c),
  9884. br(1, l, c),
  9885. zt(1, l, c),
  9886. Ir(l, c, 1),
  9887. zt(2, l, c),
  9888. zt(3, l, c),
  9889. M.fillStyle = "#000",
  9890. M.globalAlpha = .09,
  9891. l <= 0 && M.fillRect(0, 0, -l, re),
  9892. T.mapScale - l <= se) {
  9893. var s = Math.max(0, -c);
  9894. M.fillRect(T.mapScale - l, s, se - (T.mapScale - l), re - s)
  9895. }
  9896. if (c <= 0 && M.fillRect(-l, 0, se + l, -c),
  9897. T.mapScale - c <= re) {
  9898. var n = Math.max(0, -l);
  9899. let a = 0;
  9900. T.mapScale - l <= se && (a = se - (T.mapScale - l)),
  9901. M.fillRect(n, T.mapScale - c, se - n - a, re - (T.mapScale - c))
  9902. }
  9903. M.globalAlpha = 1,
  9904. M.fillStyle = "rgba(0, 0, 70, 0.35)",
  9905. M.fillRect(0, 0, se, re),
  9906. M.strokeStyle = kr;
  9907. for (var t = 0; t < J.length + ye.length; ++t)
  9908. if (y = J[t] || ye[t - J.length],
  9909. y.visible && (y.skinIndex != 10 || y == E || y.team && y.team == E.team)) {
  9910. const u = (y.team ? "[" + y.team + "] " : "") + (y.name || "") + " <" + (
  9911. oninsta ? "INSTA" :
  9912. empanti ? "EMP ANTI" :
  9913. (y.skinIndex == undefined ? "..." : y.skinIndex) + " / " + (y.weaponIndex == undefined ? "..." : y.weaponIndex)
  9914. ) + ">";
  9915. if (u != "") {
  9916. if (M.font = (y.nameScale || 30) + "px Hammersmith One",
  9917. M.fillStyle = "#fff",
  9918. M.textBaseline = "middle",
  9919. M.textAlign = "center",
  9920. M.lineWidth = y.nameScale ? 11 : 8,
  9921. M.lineJoin = "round",
  9922. M.strokeText(u, y.x - l, y.y - c - y.scale - T.nameY),
  9923. M.fillText(u, y.x - l, y.y - c - y.scale - T.nameY),
  9924. y.isLeader && Vt.crown.isLoaded) {
  9925. var r = T.crownIconScale
  9926. , n = y.x - l - r / 2 - M.measureText(u).width / 2 - T.crownPad;
  9927. M.drawImage(Vt.crown, n, y.y - c - y.scale - T.nameY - r / 2 - 5, r, r)
  9928. }
  9929. if (y.iconIndex == 1 && Vt.skull.isLoaded) {
  9930. var r = T.crownIconScale
  9931. , n = y.x - l - r / 2 + M.measureText(u).width / 2 + T.crownPad;
  9932. M.drawImage(Vt.skull, n, y.y - c - y.scale - T.nameY - r / 2 - 5, r, r)
  9933. }
  9934. }
  9935. y.health > 0 && (T.healthBarWidth,
  9936. M.fillStyle = kr,
  9937. M.roundRect(y.x - l - T.healthBarWidth - T.healthBarPad, y.y - c + y.scale + T.nameY, T.healthBarWidth * 2 + T.healthBarPad * 2, 17, 8),
  9938. M.fill(),
  9939. M.fillStyle = y == E || y.team && y.team == E.team ? "#8ecc51" : "#cc5151",
  9940. M.roundRect(y.x - l - T.healthBarWidth, y.y - c + y.scale + T.nameY + T.healthBarPad, T.healthBarWidth * 2 * (y.health / y.maxHealth), 17 - T.healthBarPad * 2, 7),
  9941. M.fill())
  9942. }
  9943. Hn.update(be, M, l, c);
  9944. for (var t = 0; t < J.length; ++t)
  9945. if (y = J[t],
  9946. y.visible && y.chatCountdown > 0) {
  9947. y.chatCountdown -= be,
  9948. y.chatCountdown <= 0 && (y.chatCountdown = 0),
  9949. M.font = "32px Hammersmith One";
  9950. const u = M.measureText(y.chatMessage);
  9951. M.textBaseline = "middle",
  9952. M.textAlign = "center";
  9953. var n = y.x - l
  9954. , s = y.y - y.scale - c - 90;
  9955. const m = 47
  9956. , w = u.width + 17;
  9957. M.fillStyle = "rgba(0,0,0,0.2)",
  9958. M.roundRect(n - w / 2, s - m / 2, w, m, 6),
  9959. M.fill(),
  9960. M.fillStyle = "#fff",
  9961. M.fillText(y.chatMessage, n, s)
  9962. }
  9963. }
  9964. lf(be)
  9965. }
  9966. function br(e, t, i) {
  9967. for (let s = 0; s < Mt.length; ++s)
  9968. y = Mt[s],
  9969. y.active && y.layer == e && (y.update(be),
  9970. y.active && Bo(y.x - t, y.y - i, y.scale) && (M.save(),
  9971. M.translate(y.x - t, y.y - i),
  9972. M.rotate(y.dir),
  9973. Zn(0, 0, y, M),
  9974. M.restore()))
  9975. }
  9976. const Sr = {};
  9977. function Zn(e, t, i, s, n) {
  9978. if (i.src) {
  9979. const r = R.projectiles[i.indx].src;
  9980. let o = Sr[r];
  9981. o || (o = new Image,
  9982. o.onload = function() {
  9983. this.isLoaded = !0
  9984. }
  9985. ,
  9986. o.src = "./img/weapons/" + r + ".png",
  9987. Sr[r] = o),
  9988. o.isLoaded && s.drawImage(o, e - i.scale / 2, t - i.scale / 2, i.scale, i.scale)
  9989. } else
  9990. i.indx == 1 && (s.fillStyle = "#939393",
  9991. Q(e, t, i.scale, s))
  9992. }
  9993. function Rf() {
  9994. const e = Re - se / 2
  9995. , t = _e - re / 2;
  9996. Me.animationTime += be,
  9997. Me.animationTime %= T.volcanoAnimationDuration;
  9998. const i = T.volcanoAnimationDuration / 2
  9999. , s = 1.7 + .3 * (Math.abs(i - Me.animationTime) / i)
  10000. , n = T.innerVolcanoScale * s;
  10001. M.drawImage(Me.land, Me.x - T.volcanoScale - e, Me.y - T.volcanoScale - t, T.volcanoScale * 2, T.volcanoScale * 2),
  10002. M.drawImage(Me.lava, Me.x - n - e, Me.y - n - t, n * 2, n * 2)
  10003. }
  10004. function Tr(e, t, i, s) {
  10005. const n = T.riverWidth + s
  10006. , r = T.mapScale / 2 - t - n / 2;
  10007. r < re && r + n > 0 && i.fillRect(0, r, se, n)
  10008. }
  10009. function zt(e, t, i) {
  10010. let s, n, r;
  10011. for (let o = 0; o < et.length; ++o)
  10012. y = et[o],
  10013. y.active && (n = y.x + y.xWiggle - t,
  10014. r = y.y + y.yWiggle - i,
  10015. e == 0 && y.update(be),
  10016. y.layer == e && Bo(n, r, y.scale + (y.blocker || 0)) && (M.globalAlpha = y.hideFromEnemy ? .6 : 1,
  10017. y.isItem ? (s = Ss(y),
  10018. M.save(),
  10019. M.translate(n, r),
  10020. M.rotate(y.dir),
  10021. M.drawImage(s, -(s.width / 2), -(s.height / 2)),
  10022. y.blocker && (M.strokeStyle = "#db6e6e",
  10023. M.globalAlpha = .3,
  10024. M.lineWidth = 6,
  10025. Q(0, 0, y.blocker, M, !1, !0)),
  10026. M.restore()) : y.type === 4 ? Rf() : (s = Hf(y),
  10027. M.drawImage(s, n - s.width / 2, r - s.height / 2))))
  10028. }
  10029. function _f(e, t, i) {
  10030. y = _i(e),
  10031. y && y.startAnim(t, i)
  10032. }
  10033. function Ir(e, t, i) {
  10034. M.globalAlpha = 1;
  10035. for (let s = 0; s < J.length; ++s)
  10036. y = J[s],
  10037. y.zIndex == i && (y.animate(be),
  10038. y.visible && (y.skinRot += .002 * be,
  10039. lr = (y == E ? vs() : y.dir) + y.dirPlus,
  10040. M.save(),
  10041. M.translate(y.x - e, y.y - t),
  10042. M.rotate(lr),
  10043. Bf(y, M),
  10044. M.restore()))
  10045. }
  10046. function Bf(e, t) {
  10047. t = t || M,
  10048. t.lineWidth = Xe,
  10049. t.lineJoin = "miter";
  10050. const i = Math.PI / 4 * (R.weapons[e.weaponIndex].armS || 1)
  10051. , s = e.buildIndex < 0 && R.weapons[e.weaponIndex].hndS || 1
  10052. , n = e.buildIndex < 0 && R.weapons[e.weaponIndex].hndD || 1;
  10053. if (e.tailIndex > 0 && zf(e.tailIndex, t, e),
  10054. e.buildIndex < 0 && !R.weapons[e.weaponIndex].aboveHand && (Ar(R.weapons[e.weaponIndex], T.weaponVariants[e.weaponVariant].src, e.scale, 0, t),
  10055. R.weapons[e.weaponIndex].projectile != null && !R.weapons[e.weaponIndex].hideProjectile && Zn(e.scale, 0, R.projectiles[R.weapons[e.weaponIndex].projectile], M)),
  10056. t.fillStyle = T.skinColors[e.skinColor],
  10057. Q(e.scale * Math.cos(i), e.scale * Math.sin(i), 14),
  10058. Q(e.scale * n * Math.cos(-i * s), e.scale * n * Math.sin(-i * s), 14),
  10059. e.buildIndex < 0 && R.weapons[e.weaponIndex].aboveHand && (Ar(R.weapons[e.weaponIndex], T.weaponVariants[e.weaponVariant].src, e.scale, 0, t),
  10060. R.weapons[e.weaponIndex].projectile != null && !R.weapons[e.weaponIndex].hideProjectile && Zn(e.scale, 0, R.projectiles[R.weapons[e.weaponIndex].projectile], M)),
  10061. e.buildIndex >= 0) {
  10062. const r = Ss(R.list[e.buildIndex]);
  10063. t.drawImage(r, e.scale - R.list[e.buildIndex].holdOffset, -r.width / 2)
  10064. }
  10065. Q(0, 0, e.scale, t),
  10066. e.skinIndex > 0 && (t.rotate(Math.PI / 2),
  10067. _o(e.skinIndex, t, null, e))
  10068. }
  10069. const Mr = {}
  10070. , Er = {};
  10071. let De;
  10072. function _o(e, t, i, s) {
  10073. if (De = Mr[e],
  10074. !De) {
  10075. const r = new Image;
  10076. r.onload = function() {
  10077. this.isLoaded = !0,
  10078. this.onload = null
  10079. }
  10080. ,
  10081. r.src = "./img/hats/hat_" + e + ".png",
  10082. Mr[e] = r,
  10083. De = r
  10084. }
  10085. let n = i || Er[e];
  10086. if (!n) {
  10087. for (let r = 0; r < Xt.length; ++r)
  10088. if (Xt[r].id == e) {
  10089. n = Xt[r];
  10090. break
  10091. }
  10092. Er[e] = n
  10093. }
  10094. De.isLoaded && t.drawImage(De, -n.scale / 2, -n.scale / 2, n.scale, n.scale),
  10095. !i && n.topSprite && (t.save(),
  10096. t.rotate(s.skinRot),
  10097. _o(e + "_top", t, n, s),
  10098. t.restore())
  10099. }
  10100. const Pr = {}
  10101. , Cr = {};
  10102. function zf(e, t, i) {
  10103. if (De = Pr[e],
  10104. !De) {
  10105. const n = new Image;
  10106. n.onload = function() {
  10107. this.isLoaded = !0,
  10108. this.onload = null
  10109. }
  10110. ,
  10111. n.src = "./img/accessories/access_" + e + ".png",
  10112. Pr[e] = n,
  10113. De = n
  10114. }
  10115. let s = Cr[e];
  10116. if (!s) {
  10117. for (let n = 0; n < Gt.length; ++n)
  10118. if (Gt[n].id == e) {
  10119. s = Gt[n];
  10120. break
  10121. }
  10122. Cr[e] = s
  10123. }
  10124. De.isLoaded && (t.save(),
  10125. t.translate(-20 - (s.xOff || 0), 0),
  10126. s.spin && t.rotate(i.skinRot),
  10127. t.drawImage(De, -(s.scale / 2), -(s.scale / 2), s.scale, s.scale),
  10128. t.restore())
  10129. }
  10130. var jn = {};
  10131. function Ar(e, t, i, s, n) {
  10132. const r = e.src + (t || "");
  10133. let o = jn[r];
  10134. o || (o = new Image,
  10135. o.onload = function() {
  10136. this.isLoaded = !0
  10137. }
  10138. ,
  10139. o.src = "./img/weapons/" + r + ".png",
  10140. jn[r] = o),
  10141. o.isLoaded && n.drawImage(o, i + e.xOff - e.length / 2, s + e.yOff - e.width / 2, e.length, e.width)
  10142. }
  10143. const Dr = {};
  10144. function Hf(e) {
  10145. const t = e.y >= T.mapScale - T.snowBiomeTop ? 2 : e.y <= T.snowBiomeTop ? 1 : 0
  10146. , i = e.type + "_" + e.scale + "_" + t;
  10147. let s = Dr[i];
  10148. if (!s) {
  10149. const r = document.createElement("canvas");
  10150. r.width = r.height = e.scale * 2.1 + Xe;
  10151. const o = r.getContext("2d");
  10152. if (o.translate(r.width / 2, r.height / 2),
  10153. o.rotate(C.randFloat(0, Math.PI)),
  10154. o.strokeStyle = ei,
  10155. o.lineWidth = Xe,
  10156. e.type == 0) {
  10157. let l;
  10158. for (var n = 0; n < 2; ++n)
  10159. l = y.scale * (n ? .5 : 1),
  10160. Ie(o, y.sid % 2 === 0 ? 5 : 7, l, l * .7),
  10161. o.fillStyle = t ? n ? "#fff" : "#e3f1f4" : n ? "#b4db62" : "#9ebf57",
  10162. o.fill(),
  10163. n || o.stroke()
  10164. } else if (e.type == 1)
  10165. if (t == 2)
  10166. o.fillStyle = "#606060",
  10167. Ie(o, 6, e.scale * .3, e.scale * .71),
  10168. o.fill(),
  10169. o.stroke(),
  10170. o.fillStyle = "#89a54c",
  10171. Q(0, 0, e.scale * .55, o),
  10172. o.fillStyle = "#a5c65b",
  10173. Q(0, 0, e.scale * .3, o, !0);
  10174. else {
  10175. Uf(o, 6, y.scale, y.scale * .7),
  10176. o.fillStyle = t ? "#e3f1f4" : "#89a54c",
  10177. o.fill(),
  10178. o.stroke(),
  10179. o.fillStyle = t ? "#6a64af" : "#c15555";
  10180. let l;
  10181. const c = 4
  10182. , a = Ze / c;
  10183. for (var n = 0; n < c; ++n)
  10184. l = C.randInt(y.scale / 3.5, y.scale / 2.3),
  10185. Q(l * Math.cos(a * n), l * Math.sin(a * n), C.randInt(10, 12), o)
  10186. }
  10187. else
  10188. (e.type == 2 || e.type == 3) && (o.fillStyle = e.type == 2 ? t == 2 ? "#938d77" : "#939393" : "#e0c655",
  10189. Ie(o, 3, e.scale, e.scale),
  10190. o.fill(),
  10191. o.stroke(),
  10192. o.fillStyle = e.type == 2 ? t == 2 ? "#b2ab90" : "#bcbcbc" : "#ebdca3",
  10193. Ie(o, 3, e.scale * .55, e.scale * .65),
  10194. o.fill());
  10195. s = r,
  10196. Dr[i] = s
  10197. }
  10198. return s
  10199. }
  10200. function Or(e, t, i) {
  10201. const s = e.lineWidth || 0;
  10202. i /= 2,
  10203. e.beginPath();
  10204. let n = Math.PI * 2 / t;
  10205. for (let r = 0; r < t; r++)
  10206. e.lineTo(i + (i - s / 2) * Math.cos(n * r), i + (i - s / 2) * Math.sin(n * r));
  10207. e.closePath()
  10208. }
  10209. function Ff() {
  10210. const t = T.volcanoScale * 2
  10211. , i = document.createElement("canvas");
  10212. i.width = t,
  10213. i.height = t;
  10214. const s = i.getContext("2d");
  10215. s.strokeStyle = "#3e3e3e",
  10216. s.lineWidth = Xe * 2,
  10217. s.fillStyle = "#7f7f7f",
  10218. Or(s, 10, t),
  10219. s.fill(),
  10220. s.stroke(),
  10221. Me.land = i;
  10222. const n = document.createElement("canvas")
  10223. , r = T.innerVolcanoScale * 2;
  10224. n.width = r,
  10225. n.height = r;
  10226. const o = n.getContext("2d");
  10227. o.strokeStyle = ei,
  10228. o.lineWidth = Xe * 1.6,
  10229. o.fillStyle = "#f54e16",
  10230. o.strokeStyle = "#f56f16",
  10231. Or(o, 10, r),
  10232. o.fill(),
  10233. o.stroke(),
  10234. Me.lava = n
  10235. }
  10236. Ff();
  10237. const Rr = [];
  10238. function Ss(e, t) {
  10239. let i = Rr[e.id];
  10240. if (!i || t) {
  10241. const c = document.createElement("canvas");
  10242. c.width = c.height = e.scale * 2.5 + Xe + (R.list[e.id].spritePadding || 0);
  10243. const a = c.getContext("2d");
  10244. if (a.translate(c.width / 2, c.height / 2),
  10245. a.rotate(t ? 0 : Math.PI / 2),
  10246. a.strokeStyle = ei,
  10247. a.lineWidth = Xe * (t ? c.width / 81 : 1),
  10248. e.name == "apple") {
  10249. a.fillStyle = "#c15555",
  10250. Q(0, 0, e.scale, a),
  10251. a.fillStyle = "#89a54c";
  10252. const u = -(Math.PI / 2);
  10253. Vf(e.scale * Math.cos(u), e.scale * Math.sin(u), 25, u + Math.PI / 2, a)
  10254. } else if (e.name == "cookie") {
  10255. a.fillStyle = "#cca861",
  10256. Q(0, 0, e.scale, a),
  10257. a.fillStyle = "#937c4b";
  10258. for (var s = 4, n = Ze / s, r, o = 0; o < s; ++o)
  10259. r = C.randInt(e.scale / 2.5, e.scale / 1.7),
  10260. Q(r * Math.cos(n * o), r * Math.sin(n * o), C.randInt(4, 5), a, !0)
  10261. } else if (e.name == "cheese") {
  10262. a.fillStyle = "#f4f3ac",
  10263. Q(0, 0, e.scale, a),
  10264. a.fillStyle = "#c3c28b";
  10265. for (var s = 4, n = Ze / s, r, o = 0; o < s; ++o)
  10266. r = C.randInt(e.scale / 2.5, e.scale / 1.7),
  10267. Q(r * Math.cos(n * o), r * Math.sin(n * o), C.randInt(4, 5), a, !0)
  10268. } else if (e.name == "wood wall" || e.name == "stone wall" || e.name == "castle wall") {
  10269. a.fillStyle = e.name == "castle wall" ? "#83898e" : e.name == "wood wall" ? "#a5974c" : "#939393";
  10270. const u = e.name == "castle wall" ? 4 : 3;
  10271. Ie(a, u, e.scale * 1.1, e.scale * 1.1),
  10272. a.fill(),
  10273. a.stroke(),
  10274. a.fillStyle = e.name == "castle wall" ? "#9da4aa" : e.name == "wood wall" ? "#c9b758" : "#bcbcbc",
  10275. Ie(a, u, e.scale * .65, e.scale * .65),
  10276. a.fill()
  10277. } else if (e.name == "spikes" || e.name == "greater spikes" || e.name == "poison spikes" || e.name == "spinning spikes") {
  10278. a.fillStyle = e.name == "poison spikes" ? "#7b935d" : "#939393";
  10279. var l = e.scale * .6;
  10280. Ie(a, e.name == "spikes" ? 5 : 6, e.scale, l),
  10281. a.fill(),
  10282. a.stroke(),
  10283. a.fillStyle = "#a5974c",
  10284. Q(0, 0, l, a),
  10285. a.fillStyle = "#c9b758",
  10286. Q(0, 0, l / 2, a, !0)
  10287. } else if (e.name == "windmill" || e.name == "faster windmill" || e.name == "power mill")
  10288. a.fillStyle = "#a5974c",
  10289. Q(0, 0, e.scale, a),
  10290. a.fillStyle = "#c9b758",
  10291. En(0, 0, e.scale * 1.5, 29, 4, a),
  10292. a.fillStyle = "#a5974c",
  10293. Q(0, 0, e.scale * .5, a);
  10294. else if (e.name == "mine")
  10295. a.fillStyle = "#939393",
  10296. Ie(a, 3, e.scale, e.scale),
  10297. a.fill(),
  10298. a.stroke(),
  10299. a.fillStyle = "#bcbcbc",
  10300. Ie(a, 3, e.scale * .55, e.scale * .65),
  10301. a.fill();
  10302. else if (e.name == "sapling")
  10303. for (var o = 0; o < 2; ++o) {
  10304. var l = e.scale * (o ? .5 : 1);
  10305. Ie(a, 7, l, l * .7),
  10306. a.fillStyle = o ? "#b4db62" : "#9ebf57",
  10307. a.fill(),
  10308. o || a.stroke()
  10309. }
  10310. else if (e.name == "pit trap")
  10311. a.fillStyle = "#a5974c",
  10312. Ie(a, 3, e.scale * 1.1, e.scale * 1.1),
  10313. a.fill(),
  10314. a.stroke(),
  10315. a.fillStyle = ei,
  10316. Ie(a, 3, e.scale * .65, e.scale * .65),
  10317. a.fill();
  10318. else if (e.name == "boost pad")
  10319. a.fillStyle = "#7e7f82",
  10320. kt(0, 0, e.scale * 2, e.scale * 2, a),
  10321. a.fill(),
  10322. a.stroke(),
  10323. a.fillStyle = "#dbd97d",
  10324. Lf(e.scale * 1, a);
  10325. else if (e.name == "turret") {
  10326. a.fillStyle = "#a5974c",
  10327. Q(0, 0, e.scale, a),
  10328. a.fill(),
  10329. a.stroke(),
  10330. a.fillStyle = "#939393";
  10331. const u = 50;
  10332. kt(0, -u / 2, e.scale * .9, u, a),
  10333. Q(0, 0, e.scale * .6, a),
  10334. a.fill(),
  10335. a.stroke()
  10336. } else if (e.name == "platform") {
  10337. a.fillStyle = "#cebd5f";
  10338. const u = 4
  10339. , p = e.scale * 2
  10340. , h = p / u;
  10341. let m = -(e.scale / 2);
  10342. for (var o = 0; o < u; ++o)
  10343. kt(m - h / 2, 0, h, e.scale * 2, a),
  10344. a.fill(),
  10345. a.stroke(),
  10346. m += p / u
  10347. } else
  10348. e.name == "healing pad" ? (a.fillStyle = "#7e7f82",
  10349. kt(0, 0, e.scale * 2, e.scale * 2, a),
  10350. a.fill(),
  10351. a.stroke(),
  10352. a.fillStyle = "#db6e6e",
  10353. En(0, 0, e.scale * .65, 20, 4, a, !0)) : e.name == "spawn pad" ? (a.fillStyle = "#7e7f82",
  10354. kt(0, 0, e.scale * 2, e.scale * 2, a),
  10355. a.fill(),
  10356. a.stroke(),
  10357. a.fillStyle = "#71aad6",
  10358. Q(0, 0, e.scale * .6, a)) : e.name == "blocker" ? (a.fillStyle = "#7e7f82",
  10359. Q(0, 0, e.scale, a),
  10360. a.fill(),
  10361. a.stroke(),
  10362. a.rotate(Math.PI / 4),
  10363. a.fillStyle = "#db6e6e",
  10364. En(0, 0, e.scale * .65, 20, 4, a, !0)) : e.name == "teleporter" && (a.fillStyle = "#7e7f82",
  10365. Q(0, 0, e.scale, a),
  10366. a.fill(),
  10367. a.stroke(),
  10368. a.rotate(Math.PI / 4),
  10369. a.fillStyle = "#d76edb",
  10370. Q(0, 0, e.scale * .5, a, !0));
  10371. i = c,
  10372. t || (Rr[e.id] = i)
  10373. }
  10374. return i
  10375. }
  10376. function Vf(e, t, i, s, n) {
  10377. const r = e + i * Math.cos(s)
  10378. , o = t + i * Math.sin(s)
  10379. , l = i * .4;
  10380. n.moveTo(e, t),
  10381. n.beginPath(),
  10382. n.quadraticCurveTo((e + r) / 2 + l * Math.cos(s + Math.PI / 2), (t + o) / 2 + l * Math.sin(s + Math.PI / 2), r, o),
  10383. n.quadraticCurveTo((e + r) / 2 - l * Math.cos(s + Math.PI / 2), (t + o) / 2 - l * Math.sin(s + Math.PI / 2), e, t),
  10384. n.closePath(),
  10385. n.fill(),
  10386. n.stroke()
  10387. }
  10388. function Q(e, t, i, s, n, r) {
  10389. s = s || M,
  10390. s.beginPath(),
  10391. s.arc(e, t, i, 0, 2 * Math.PI),
  10392. r || s.fill(),
  10393. n || s.stroke()
  10394. }
  10395. function Ie(e, t, i, s) {
  10396. let n = Math.PI / 2 * 3, r, o;
  10397. const l = Math.PI / t;
  10398. e.beginPath(),
  10399. e.moveTo(0, -i);
  10400. for (let c = 0; c < t; c++)
  10401. r = Math.cos(n) * i,
  10402. o = Math.sin(n) * i,
  10403. e.lineTo(r, o),
  10404. n += l,
  10405. r = Math.cos(n) * s,
  10406. o = Math.sin(n) * s,
  10407. e.lineTo(r, o),
  10408. n += l;
  10409. e.lineTo(0, -i),
  10410. e.closePath()
  10411. }
  10412. function kt(e, t, i, s, n, r) {
  10413. n.fillRect(e - i / 2, t - s / 2, i, s),
  10414. r || n.strokeRect(e - i / 2, t - s / 2, i, s)
  10415. }
  10416. function En(e, t, i, s, n, r, o) {
  10417. r.save(),
  10418. r.translate(e, t),
  10419. n = Math.ceil(n / 2);
  10420. for (let l = 0; l < n; l++)
  10421. kt(0, 0, i * 2, s, r, o),
  10422. r.rotate(Math.PI / n);
  10423. r.restore()
  10424. }
  10425. function Uf(e, t, i, s) {
  10426. let n = Math.PI / 2 * 3;
  10427. const r = Math.PI / t;
  10428. let o;
  10429. e.beginPath(),
  10430. e.moveTo(0, -s);
  10431. for (let l = 0; l < t; l++)
  10432. o = C.randInt(i + .9, i * 1.2),
  10433. e.quadraticCurveTo(Math.cos(n + r) * o, Math.sin(n + r) * o, Math.cos(n + r * 2) * s, Math.sin(n + r * 2) * s),
  10434. n += r * 2;
  10435. e.lineTo(0, -s),
  10436. e.closePath()
  10437. }
  10438. function Lf(e, t) {
  10439. t = t || M;
  10440. const i = e * (Math.sqrt(3) / 2);
  10441. t.beginPath(),
  10442. t.moveTo(0, -i / 2),
  10443. t.lineTo(-e / 2, i / 2),
  10444. t.lineTo(e / 2, i / 2),
  10445. t.lineTo(0, -i / 2),
  10446. t.fill(),
  10447. t.closePath()
  10448. }
  10449. function Nf() {
  10450. const e = T.mapScale / 2;
  10451. ue.add(0, e, e + 200, 0, T.treeScales[3], 0),
  10452. ue.add(1, e, e - 480, 0, T.treeScales[3], 0),
  10453. ue.add(2, e + 300, e + 450, 0, T.treeScales[3], 0),
  10454. ue.add(3, e - 950, e - 130, 0, T.treeScales[2], 0),
  10455. ue.add(4, e - 750, e - 400, 0, T.treeScales[3], 0),
  10456. ue.add(5, e - 700, e + 400, 0, T.treeScales[2], 0),
  10457. ue.add(6, e + 800, e - 200, 0, T.treeScales[3], 0),
  10458. ue.add(7, e - 260, e + 340, 0, T.bushScales[3], 1),
  10459. ue.add(8, e + 760, e + 310, 0, T.bushScales[3], 1),
  10460. ue.add(9, e - 800, e + 100, 0, T.bushScales[3], 1),
  10461. ue.add(10, e - 800, e + 300, 0, R.list[4].scale, R.list[4].id, R.list[10]),
  10462. ue.add(11, e + 650, e - 390, 0, R.list[4].scale, R.list[4].id, R.list[10]),
  10463. ue.add(12, e - 400, e - 450, 0, T.rockScales[2], 2)
  10464. }
  10465. function qf(e) {
  10466. for (let t = 0; t < e.length; )
  10467. ue.add(e[t], e[t + 1], e[t + 2], e[t + 3], e[t + 4], e[t + 5], R.list[e[t + 6]], !0, e[t + 7] >= 0 ? {
  10468. sid: e[t + 7]
  10469. } : null),
  10470. t += 8
  10471. }
  10472. function Wf(e, t) {
  10473. y = Ho(t),
  10474. y && (y.xWiggle += T.gatherWiggle * Math.cos(e),
  10475. y.yWiggle += T.gatherWiggle * Math.sin(e))
  10476. }
  10477. function Xf(e, t) {
  10478. y = Ho(e),
  10479. y && (y.dir = t,
  10480. y.xWiggle += T.gatherWiggle * Math.cos(t + Math.PI),
  10481. y.yWiggle += T.gatherWiggle * Math.sin(t + Math.PI))
  10482. }
  10483. function Gf(e, t, i, s, n, r, o, l) {
  10484. ds && (po.addProjectile(e, t, i, s, n, r, null, null, o).sid = l)
  10485. }
  10486. function Yf(e, t) {
  10487. for (let i = 0; i < Mt.length; ++i)
  10488. Mt[i].sid == e && (Mt[i].range = t)
  10489. }
  10490. function $f(e) {
  10491. y = zo(e),
  10492. y && y.startAnim()
  10493. }
  10494. function Kf(e) {
  10495. for (var t = 0; t < ye.length; ++t)
  10496. ye[t].forcePos = !ye[t].visible,
  10497. ye[t].visible = !1;
  10498. if (e) {
  10499. const i = Date.now();
  10500. for (var t = 0; t < e.length; )
  10501. y = zo(e[t]),
  10502. y ? (y.index = e[t + 1],
  10503. y.t1 = y.t2 === void 0 ? i : y.t2,
  10504. y.t2 = i,
  10505. y.x1 = y.x,
  10506. y.y1 = y.y,
  10507. y.x2 = e[t + 2],
  10508. y.y2 = e[t + 3],
  10509. y.d1 = y.d2 === void 0 ? e[t + 4] : y.d2,
  10510. y.d2 = e[t + 4],
  10511. y.health = e[t + 5],
  10512. y.dt = 0,
  10513. y.visible = !0) : (y = ar.spawn(e[t + 2], e[t + 3], e[t + 4], e[t + 1]),
  10514. y.x2 = y.x,
  10515. y.y2 = y.y,
  10516. y.d2 = y.dir,
  10517. y.health = e[t + 5],
  10518. ar.aiTypes[e[t + 1]].name || (y.name = T.cowNames[e[t + 6]]),
  10519. y.forcePos = !0,
  10520. y.sid = e[t],
  10521. y.visible = !0),
  10522. t += 7
  10523. }
  10524. }
  10525. const _r = {};
  10526. function Jf(e, t) {
  10527. const i = e.index;
  10528. let s = _r[i];
  10529. if (!s) {
  10530. const n = new Image;
  10531. n.onload = function() {
  10532. this.isLoaded = !0,
  10533. this.onload = null
  10534. }
  10535. ,
  10536. n.src = "./img/animals/" + e.src + ".png",
  10537. s = n,
  10538. _r[i] = s
  10539. }
  10540. if (s.isLoaded) {
  10541. const n = e.scale * 1.2 * (e.spriteMlt || 1);
  10542. t.drawImage(s, -n, -n, n * 2, n * 2)
  10543. }
  10544. }
  10545. function Bo(e, t, i) {
  10546. return e + i >= 0 && e - i <= se && t + i >= 0 && t - i <= re
  10547. }
  10548. function Qf(e, t) {
  10549. let i = nu(e[0]);
  10550. i || (i = new _c(e[0],e[1],T,C,po,ue,J,ye,R,Xt,Gt),
  10551. J.push(i)),
  10552. i.spawn(t ? xi : null),
  10553. i.visible = !1,
  10554. i.x2 = void 0,
  10555. i.y2 = void 0,
  10556. i.setData(e),
  10557. t && (E = i,
  10558. Re = E.x,
  10559. _e = E.y,
  10560. To(),
  10561. Do(),
  10562. Ro(),
  10563. Oo(0),
  10564. us.style.display = "block")
  10565. }
  10566. function Zf(e) {
  10567. for (let t = 0; t < J.length; t++)
  10568. if (J[t].id == e) {
  10569. J.splice(t, 1);
  10570. break
  10571. }
  10572. }
  10573. function eq(e, t) {
  10574. ee.send("c", 0, e, t)
  10575. }
  10576. var oninsta = false;
  10577. function INSTA() {
  10578. eq(0, 1);
  10579. setTimeout(()=>{
  10580. ee.send("G", E.weapons[0], 1);
  10581. oninsta = true;
  10582. eq(7, 0);
  10583. setTimeout(()=> {
  10584. ee.send("K", 1);
  10585. setTimeout(()=>{
  10586. eq(53, 0);
  10587. ee.send("G", E.weapons[1], 1);
  10588. setTimeout(()=>{
  10589. fastmode ? eq(12, 0) : eq(6, 0);
  10590. setTimeout(()=>{
  10591. eq(11, 1);
  10592. oninsta = false;
  10593. ee.send("K", 1);
  10594. }, 80);
  10595. }, 102);
  10596. },100);
  10597. }, 15);
  10598. }, 70);
  10599. }
  10600. function reverse() {
  10601. eq(0, 1);
  10602. setTimeout(()=>{
  10603. oninsta = true;
  10604. setTimeout(()=> {
  10605. eq(53, 0);
  10606. ee.send("G", E.weapons[1], 1);
  10607. setTimeout(()=>{
  10608. ee.send("K", 1);
  10609. setTimeout(()=>{
  10610. eq(7, 0);
  10611. setTimeout(()=>{
  10612. ee.send("G", E.weapons[0], 1);
  10613. setTimeout(()=>{
  10614. eq(6, 0);
  10615. ee.send("K", 1);
  10616. setTimeout(()=>{
  10617. eq(11, 1);
  10618. oninsta = false;
  10619. }, 80)
  10620. }, 100)
  10621. }, 4)
  10622. }, 92.1)
  10623. }, 10)
  10624. }, 10)
  10625. }, 80)
  10626. }
  10627. document.onkeyup = (e) => {
  10628. if(e.keyCode === 82) {
  10629. if (e.target.tagName.toLowerCase() !== 'input' && e.target.tagName.toLowerCase() !== 'textarea') {
  10630. if(document.getElementById("instatype").value == "Rev") {
  10631. reverse();
  10632. }else{
  10633. INSTA();
  10634. }
  10635. }
  10636. }
  10637. }
  10638. var isRightClicking = false;
  10639. window.addEventListener('contextmenu', function(event) {
  10640. event.preventDefault();
  10641. isRightClicking = true;
  10642. window.storeEquip(40);
  10643. });
  10644. window.addEventListener('mousedown', function(event) {
  10645. if (event.button === 2) {
  10646. isRightClicking = true;
  10647. window.storeEquip(40);
  10648. }
  10649. });
  10650. window.addEventListener('mouseup', function(event) {
  10651. if (isRightClicking) {
  10652. window.storeEquip(6);
  10653. setTimeout(()=>{
  10654. window.storeEquip(11, 1);
  10655. }, 79);
  10656. isRightClicking = false;
  10657. }
  10658. });
  10659. function jf(e, t) {
  10660. E && (E.itemCounts[e] = t)
  10661. }
  10662. function eu(e, t, i) {
  10663. E && (E[e] = t,
  10664. i && Do())
  10665. }
  10666. function place(sid = E.items[0], angle) {
  10667. let poop = E.weaponIndex
  10668. Yt(E.items['\x30'])
  10669. ee.send(decode($$c), 1)
  10670. ee.send(decode($$c), 0);
  10671. Yt(poop, !![]);
  10672. }
  10673. function tu(e, t) {
  10674. var y = _i(e);
  10675. if (y) {
  10676. y.health = t;
  10677. if (y === E) {
  10678. if (y.health < 41 || (y.skinIndex === 6 && y.health < 61)) {
  10679. place(E.items[0]);
  10680. empanti = true;
  10681. setTimeout(()=>{
  10682. eq(22, 0);
  10683. place(E.items[0]);
  10684. setTimeout(()=>{
  10685. empanti = false;
  10686. eq(13, 1);
  10687. setTimeout(()=>{
  10688. eq(6, 0);
  10689. setTimeout(()=>{
  10690. eq(11, 1);
  10691. }, 80);
  10692. }, 99.9);
  10693. }, 70);
  10694. setTimeout(()=>{
  10695. eq(6, 0);
  10696. setTimeout(()=>{
  10697. eq(11, 1);
  10698. }, 100);
  10699. }, 100);
  10700. }, 3);
  10701. } else if (y.health < 100) {
  10702. setTimeout(() => {
  10703. place(E.items[0]);
  10704. }, (window.pingTime < 60 ? 115 : 90));
  10705. }
  10706. }
  10707. }
  10708. }
  10709. function sync(_GlobalAlpha, chatmsg) {
  10710. if(_GlobalAlpha.chatMessage === chatmsg) {
  10711. INSTA();
  10712. }
  10713. setTimeout(()=>{
  10714. ee.send("6", chatmsg);
  10715. }, 50);
  10716. }
  10717. /*document.addEventListener('keydown', function(event) {
  10718. if (event.key === 'c') {
  10719. sync(E, "!<_globalAlphall1");
  10720. }
  10721. });
  10722. /*
  10723. */
  10724. var enemyNear = [];
  10725. var enemy = [];
  10726. function iu(e) {
  10727. enemyNear = [];
  10728. enemy = [];
  10729. const t = Date.now();
  10730. for (var i = 0; i < J.length; ++i)
  10731. J[i].forcePos = !J[i].visible,
  10732. J[i].visible = !1;
  10733. for (var i = 0; i < e.length; )
  10734. y = _i(e[i]),
  10735. y && (y.t1 = y.t2 === void 0 ? t : y.t2,
  10736. y.t2 = t,
  10737. y.x1 = y.x,
  10738. y.y1 = y.y,
  10739. y.x2 = e[i + 1],
  10740. y.y2 = e[i + 2],
  10741. y.d1 = y.d2 === void 0 ? e[i + 3] : y.d2,
  10742. y.d2 = e[i + 3],
  10743. y.dt = 0,
  10744. y.buildIndex = e[i + 4],
  10745. y.weaponIndex = e[i + 5],
  10746. y.weaponVariant = e[i + 6],
  10747. y.team = e[i + 7],
  10748. y.isLeader = e[i + 8],
  10749. y.skinIndex = e[i + 9],
  10750. y.tailIndex = e[i + 10],
  10751. y.iconIndex = e[i + 11],
  10752. y.zIndex = e[i + 12],
  10753. y.visible = !0,
  10754. !(y == E || E.team && y.team == E.team) ? enemyNear.push(E) : enemy.push(e.slice(i, i + 13))),
  10755. i += 13
  10756. }
  10757. function nu(e) {
  10758. for (let t = 0; t < J.length; ++t)
  10759. if (J[t].id == e)
  10760. return J[t];
  10761. return null
  10762. }
  10763. function _i(e) {
  10764. for (let t = 0; t < J.length; ++t)
  10765. if (J[t].sid == e)
  10766. return J[t];
  10767. return null
  10768. }
  10769. function zo(e) {
  10770. for (let t = 0; t < ye.length; ++t)
  10771. if (ye[t].sid == e)
  10772. return ye[t];
  10773. return null
  10774. }
  10775. function Ho(e) {
  10776. for (let t = 0; t < et.length; ++t)
  10777. if (et[t].sid == e)
  10778. return et[t];
  10779. return null
  10780. }
  10781. let Fo = -1;
  10782. function su() {
  10783. const e = Date.now() - Fo;
  10784. window.pingTime = e,
  10785. Qt.innerText = "Ping: " + e + " ms"
  10786. }
  10787. let Pn;
  10788. function Vo() {
  10789. Pn && clearTimeout(Pn),
  10790. cs() && (Fo = Date.now(),
  10791. ee.send("0")),
  10792. Pn = setTimeout(Vo, 2500)
  10793. }
  10794. function ru(e) {
  10795. if (e < 0)
  10796. return;
  10797. const t = Math.floor(e / 60);
  10798. let i = e % 60;
  10799. i = ("0" + i).slice(-2),
  10800. dr.innerText = "Server restarting in " + t + ":" + i,
  10801. dr.hidden = !1
  10802. }
  10803. window.requestAnimFrame = function() {
  10804. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(e) {
  10805. window.setTimeout(e, 1e3 / 60)
  10806. }
  10807. }();
  10808. function Uo() {
  10809. It = Date.now(),
  10810. be = It - or,
  10811. or = It,
  10812. Of(),
  10813. requestAnimFrame(Uo)
  10814. }
  10815. Nf();
  10816. Uo();
  10817. function Lo(e) {
  10818. window.open(e, "_blank")
  10819. }
  10820. window.openLink = Lo;
  10821. window.aJoinReq = Gn;
  10822. window.follmoo = Bh;
  10823. window.kickFromClan = ko;
  10824. window.sendJoin = vo;
  10825. window.leaveAlliance = xo;
  10826. window.createAlliance = Yn;
  10827. window.storeBuy = bo;
  10828. window.storeEquip = Jn;
  10829. window.showItemInfo = Se;
  10830. window.selectSkinColor = mf;
  10831. window.changeStoreIndex = cf;
  10832. window.config = T;
  10833. })();