Greasy Fork is available in English.

bianos websocket blabal

i just added window.io to normal 1.8.0 bundle

Ce script ne devrait pas être installé directement. C'est une librairie créée pour d'autres scripts. Elle doit être inclus avec la commande // @require https://update.greasyfork.org/scripts/494975/1376630/bianos%20websocket%20blabal.js

  1. (function () {
  2. const t = document.createElement("link").relList;
  3. if (t && t.supports && t.supports("modulepreload")) return;
  4. for (const n of document.querySelectorAll('link[rel="modulepreload"]')) s(n);
  5. new MutationObserver((n) => {
  6. for (const r of n) if (r.type === "childList") for (const o of r.addedNodes) o.tagName === "LINK" && o.rel === "modulepreload" && s(o);
  7. }).observe(document, { childList: !0, subtree: !0 });
  8. function i(n) {
  9. const r = {};
  10. return (
  11. n.integrity && (r.integrity = n.integrity),
  12. n.referrerpolicy && (r.referrerPolicy = n.referrerpolicy),
  13. n.crossorigin === "use-credentials" ? (r.credentials = "include") : n.crossorigin === "anonymous" ? (r.credentials = "omit") : (r.credentials = "same-origin"),
  14. r
  15. );
  16. }
  17. function s(n) {
  18. if (n.ep) return;
  19. n.ep = !0;
  20. const r = i(n);
  21. fetch(n.href, r);
  22. }
  23. })();
  24. var Ke = 4294967295;
  25. function Ko(e, t, i) {
  26. var s = i / 4294967296,
  27. n = i;
  28. e.setUint32(t, s), e.setUint32(t + 4, n);
  29. }
  30. function Br(e, t, i) {
  31. var s = Math.floor(i / 4294967296),
  32. n = i;
  33. e.setUint32(t, s), e.setUint32(t + 4, n);
  34. }
  35. function zr(e, t) {
  36. var i = e.getInt32(t),
  37. s = e.getUint32(t + 4);
  38. return i * 4294967296 + s;
  39. }
  40. function Jo(e, t) {
  41. var i = e.getUint32(t),
  42. s = e.getUint32(t + 4);
  43. return i * 4294967296 + s;
  44. }
  45. var Gi,
  46. Yi,
  47. $i,
  48. 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";
  49. function Cs(e) {
  50. for (var t = e.length, i = 0, s = 0; s < t; ) {
  51. var n = e.charCodeAt(s++);
  52. if (n & 4294967168)
  53. if (!(n & 4294965248)) i += 2;
  54. else {
  55. if (n >= 55296 && n <= 56319 && s < t) {
  56. var r = e.charCodeAt(s);
  57. (r & 64512) === 56320 && (++s, (n = ((n & 1023) << 10) + (r & 1023) + 65536));
  58. }
  59. n & 4294901760 ? (i += 4) : (i += 3);
  60. }
  61. else {
  62. i++;
  63. continue;
  64. }
  65. }
  66. return i;
  67. }
  68. function Qo(e, t, i) {
  69. for (var s = e.length, n = i, r = 0; r < s; ) {
  70. var o = e.charCodeAt(r++);
  71. if (o & 4294967168)
  72. if (!(o & 4294965248)) t[n++] = ((o >> 6) & 31) | 192;
  73. else {
  74. if (o >= 55296 && o <= 56319 && r < s) {
  75. var l = e.charCodeAt(r);
  76. (l & 64512) === 56320 && (++r, (o = ((o & 1023) << 10) + (l & 1023) + 65536));
  77. }
  78. o & 4294901760 ? ((t[n++] = ((o >> 18) & 7) | 240), (t[n++] = ((o >> 12) & 63) | 128), (t[n++] = ((o >> 6) & 63) | 128)) : ((t[n++] = ((o >> 12) & 15) | 224), (t[n++] = ((o >> 6) & 63) | 128));
  79. }
  80. else {
  81. t[n++] = o;
  82. continue;
  83. }
  84. t[n++] = (o & 63) | 128;
  85. }
  86. }
  87. var Ut = Pi ? new TextEncoder() : void 0,
  88. 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;
  89. function jo(e, t, i) {
  90. t.set(Ut.encode(e), i);
  91. }
  92. function ea(e, t, i) {
  93. Ut.encodeInto(e, t.subarray(i));
  94. }
  95. var ta = Ut != null && Ut.encodeInto ? ea : jo,
  96. ia = 4096;
  97. function Hr(e, t, i) {
  98. for (var s = t, n = s + i, r = [], o = ""; s < n; ) {
  99. var l = e[s++];
  100. if (!(l & 128)) r.push(l);
  101. else if ((l & 224) === 192) {
  102. var c = e[s++] & 63;
  103. r.push(((l & 31) << 6) | c);
  104. } else if ((l & 240) === 224) {
  105. var c = e[s++] & 63,
  106. a = e[s++] & 63;
  107. r.push(((l & 31) << 12) | (c << 6) | a);
  108. } else if ((l & 248) === 240) {
  109. var c = e[s++] & 63,
  110. a = e[s++] & 63,
  111. u = e[s++] & 63,
  112. p = ((l & 7) << 18) | (c << 12) | (a << 6) | u;
  113. p > 65535 && ((p -= 65536), r.push(((p >>> 10) & 1023) | 55296), (p = 56320 | (p & 1023))), r.push(p);
  114. } else r.push(l);
  115. r.length >= ia && ((o += String.fromCharCode.apply(String, r)), (r.length = 0));
  116. }
  117. return r.length > 0 && (o += String.fromCharCode.apply(String, r)), o;
  118. }
  119. var na = Pi ? new TextDecoder() : null,
  120. 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;
  121. function ra(e, t, i) {
  122. var s = e.subarray(t, t + i);
  123. return na.decode(s);
  124. }
  125. var si = (function () {
  126. function e(t, i) {
  127. (this.type = t), (this.data = i);
  128. }
  129. return e;
  130. })(),
  131. oa =
  132. (globalThis && globalThis.__extends) ||
  133. (function () {
  134. var e = function (t, i) {
  135. return (
  136. (e =
  137. Object.setPrototypeOf ||
  138. ({ __proto__: [] } instanceof Array &&
  139. function (s, n) {
  140. s.__proto__ = n;
  141. }) ||
  142. function (s, n) {
  143. for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (s[r] = n[r]);
  144. }),
  145. e(t, i)
  146. );
  147. };
  148. return function (t, i) {
  149. if (typeof i != "function" && i !== null) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null");
  150. e(t, i);
  151. function s() {
  152. this.constructor = t;
  153. }
  154. t.prototype = i === null ? Object.create(i) : ((s.prototype = i.prototype), new s());
  155. };
  156. })(),
  157. Pe = (function (e) {
  158. oa(t, e);
  159. function t(i) {
  160. var s = e.call(this, i) || this,
  161. n = Object.create(t.prototype);
  162. return Object.setPrototypeOf(s, n), Object.defineProperty(s, "name", { configurable: !0, enumerable: !1, value: t.name }), s;
  163. }
  164. return t;
  165. })(Error),
  166. aa = -1,
  167. la = 4294967296 - 1,
  168. ca = 17179869184 - 1;
  169. function ha(e) {
  170. var t = e.sec,
  171. i = e.nsec;
  172. if (t >= 0 && i >= 0 && t <= ca)
  173. if (i === 0 && t <= la) {
  174. var s = new Uint8Array(4),
  175. n = new DataView(s.buffer);
  176. return n.setUint32(0, t), s;
  177. } else {
  178. var r = t / 4294967296,
  179. o = t & 4294967295,
  180. s = new Uint8Array(8),
  181. n = new DataView(s.buffer);
  182. return n.setUint32(0, (i << 2) | (r & 3)), n.setUint32(4, o), s;
  183. }
  184. else {
  185. var s = new Uint8Array(12),
  186. n = new DataView(s.buffer);
  187. return n.setUint32(0, i), Br(n, 4, t), s;
  188. }
  189. }
  190. function fa(e) {
  191. var t = e.getTime(),
  192. i = Math.floor(t / 1e3),
  193. s = (t - i * 1e3) * 1e6,
  194. n = Math.floor(s / 1e9);
  195. return { sec: i + n, nsec: s - n * 1e9 };
  196. }
  197. function ua(e) {
  198. if (e instanceof Date) {
  199. var t = fa(e);
  200. return ha(t);
  201. } else return null;
  202. }
  203. function da(e) {
  204. var t = new DataView(e.buffer, e.byteOffset, e.byteLength);
  205. switch (e.byteLength) {
  206. case 4: {
  207. var i = t.getUint32(0),
  208. s = 0;
  209. return { sec: i, nsec: s };
  210. }
  211. case 8: {
  212. var n = t.getUint32(0),
  213. r = t.getUint32(4),
  214. i = (n & 3) * 4294967296 + r,
  215. s = n >>> 2;
  216. return { sec: i, nsec: s };
  217. }
  218. case 12: {
  219. var i = zr(t, 4),
  220. s = t.getUint32(0);
  221. return { sec: i, nsec: s };
  222. }
  223. default:
  224. throw new Pe("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length));
  225. }
  226. }
  227. function pa(e) {
  228. var t = da(e);
  229. return new Date(t.sec * 1e3 + t.nsec / 1e6);
  230. }
  231. var ma = { type: aa, encode: ua, decode: pa },
  232. Fr = (function () {
  233. function e() {
  234. (this.builtInEncoders = []), (this.builtInDecoders = []), (this.encoders = []), (this.decoders = []), this.register(ma);
  235. }
  236. return (
  237. (e.prototype.register = function (t) {
  238. var i = t.type,
  239. s = t.encode,
  240. n = t.decode;
  241. if (i >= 0) (this.encoders[i] = s), (this.decoders[i] = n);
  242. else {
  243. var r = 1 + i;
  244. (this.builtInEncoders[r] = s), (this.builtInDecoders[r] = n);
  245. }
  246. }),
  247. (e.prototype.tryToEncode = function (t, i) {
  248. for (var s = 0; s < this.builtInEncoders.length; s++) {
  249. var n = this.builtInEncoders[s];
  250. if (n != null) {
  251. var r = n(t, i);
  252. if (r != null) {
  253. var o = -1 - s;
  254. return new si(o, r);
  255. }
  256. }
  257. }
  258. for (var s = 0; s < this.encoders.length; s++) {
  259. var n = this.encoders[s];
  260. if (n != null) {
  261. var r = n(t, i);
  262. if (r != null) {
  263. var o = s;
  264. return new si(o, r);
  265. }
  266. }
  267. }
  268. return t instanceof si ? t : null;
  269. }),
  270. (e.prototype.decode = function (t, i, s) {
  271. var n = i < 0 ? this.builtInDecoders[-1 - i] : this.decoders[i];
  272. return n ? n(t, i, s) : new si(i, t);
  273. }),
  274. (e.defaultCodec = new e()),
  275. e
  276. );
  277. })();
  278. function gi(e) {
  279. 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);
  280. }
  281. function ga(e) {
  282. if (e instanceof ArrayBuffer) return new DataView(e);
  283. var t = gi(e);
  284. return new DataView(t.buffer, t.byteOffset, t.byteLength);
  285. }
  286. var ya = 100,
  287. wa = 2048,
  288. ka = (function () {
  289. function e(t, i, s, n, r, o, l, c) {
  290. t === void 0 && (t = Fr.defaultCodec),
  291. i === void 0 && (i = void 0),
  292. s === void 0 && (s = ya),
  293. n === void 0 && (n = wa),
  294. r === void 0 && (r = !1),
  295. o === void 0 && (o = !1),
  296. l === void 0 && (l = !1),
  297. c === void 0 && (c = !1),
  298. (this.extensionCodec = t),
  299. (this.context = i),
  300. (this.maxDepth = s),
  301. (this.initialBufferSize = n),
  302. (this.sortKeys = r),
  303. (this.forceFloat32 = o),
  304. (this.ignoreUndefined = l),
  305. (this.forceIntegerToFloat = c),
  306. (this.pos = 0),
  307. (this.view = new DataView(new ArrayBuffer(this.initialBufferSize))),
  308. (this.bytes = new Uint8Array(this.view.buffer));
  309. }
  310. return (
  311. (e.prototype.reinitializeState = function () {
  312. this.pos = 0;
  313. }),
  314. (e.prototype.encodeSharedRef = function (t) {
  315. return this.reinitializeState(), this.doEncode(t, 1), this.bytes.subarray(0, this.pos);
  316. }),
  317. (e.prototype.encode = function (t) {
  318. return this.reinitializeState(), this.doEncode(t, 1), this.bytes.slice(0, this.pos);
  319. }),
  320. (e.prototype.doEncode = function (t, i) {
  321. if (i > this.maxDepth) throw new Error("Too deep objects in depth ".concat(i));
  322. 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);
  323. }),
  324. (e.prototype.ensureBufferSizeToWrite = function (t) {
  325. var i = this.pos + t;
  326. this.view.byteLength < i && this.resizeBuffer(i * 2);
  327. }),
  328. (e.prototype.resizeBuffer = function (t) {
  329. var i = new ArrayBuffer(t),
  330. s = new Uint8Array(i),
  331. n = new DataView(i);
  332. s.set(this.bytes), (this.view = n), (this.bytes = s);
  333. }),
  334. (e.prototype.encodeNil = function () {
  335. this.writeU8(192);
  336. }),
  337. (e.prototype.encodeBoolean = function (t) {
  338. t === !1 ? this.writeU8(194) : this.writeU8(195);
  339. }),
  340. (e.prototype.encodeNumber = function (t) {
  341. Number.isSafeInteger(t) && !this.forceIntegerToFloat
  342. ? t >= 0
  343. ? t < 128
  344. ? this.writeU8(t)
  345. : t < 256
  346. ? (this.writeU8(204), this.writeU8(t))
  347. : t < 65536
  348. ? (this.writeU8(205), this.writeU16(t))
  349. : t < 4294967296
  350. ? (this.writeU8(206), this.writeU32(t))
  351. : (this.writeU8(207), this.writeU64(t))
  352. : t >= -32
  353. ? this.writeU8(224 | (t + 32))
  354. : t >= -128
  355. ? (this.writeU8(208), this.writeI8(t))
  356. : t >= -32768
  357. ? (this.writeU8(209), this.writeI16(t))
  358. : t >= -2147483648
  359. ? (this.writeU8(210), this.writeI32(t))
  360. : (this.writeU8(211), this.writeI64(t))
  361. : this.forceFloat32
  362. ? (this.writeU8(202), this.writeF32(t))
  363. : (this.writeU8(203), this.writeF64(t));
  364. }),
  365. (e.prototype.writeStringHeader = function (t) {
  366. if (t < 32) this.writeU8(160 + t);
  367. else if (t < 256) this.writeU8(217), this.writeU8(t);
  368. else if (t < 65536) this.writeU8(218), this.writeU16(t);
  369. else if (t < 4294967296) this.writeU8(219), this.writeU32(t);
  370. else throw new Error("Too long string: ".concat(t, " bytes in UTF-8"));
  371. }),
  372. (e.prototype.encodeString = function (t) {
  373. var i = 5,
  374. s = t.length;
  375. if (s > Zo) {
  376. var n = Cs(t);
  377. this.ensureBufferSizeToWrite(i + n), this.writeStringHeader(n), ta(t, this.bytes, this.pos), (this.pos += n);
  378. } else {
  379. var n = Cs(t);
  380. this.ensureBufferSizeToWrite(i + n), this.writeStringHeader(n), Qo(t, this.bytes, this.pos), (this.pos += n);
  381. }
  382. }),
  383. (e.prototype.encodeObject = function (t, i) {
  384. var s = this.extensionCodec.tryToEncode(t, this.context);
  385. if (s != null) this.encodeExtension(s);
  386. else if (Array.isArray(t)) this.encodeArray(t, i);
  387. else if (ArrayBuffer.isView(t)) this.encodeBinary(t);
  388. else if (typeof t == "object") this.encodeMap(t, i);
  389. else throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(t)));
  390. }),
  391. (e.prototype.encodeBinary = function (t) {
  392. var i = t.byteLength;
  393. if (i < 256) this.writeU8(196), this.writeU8(i);
  394. else if (i < 65536) this.writeU8(197), this.writeU16(i);
  395. else if (i < 4294967296) this.writeU8(198), this.writeU32(i);
  396. else throw new Error("Too large binary: ".concat(i));
  397. var s = gi(t);
  398. this.writeU8a(s);
  399. }),
  400. (e.prototype.encodeArray = function (t, i) {
  401. var s = t.length;
  402. if (s < 16) this.writeU8(144 + s);
  403. else if (s < 65536) this.writeU8(220), this.writeU16(s);
  404. else if (s < 4294967296) this.writeU8(221), this.writeU32(s);
  405. else throw new Error("Too large array: ".concat(s));
  406. for (var n = 0, r = t; n < r.length; n++) {
  407. var o = r[n];
  408. this.doEncode(o, i + 1);
  409. }
  410. }),
  411. (e.prototype.countWithoutUndefined = function (t, i) {
  412. for (var s = 0, n = 0, r = i; n < r.length; n++) {
  413. var o = r[n];
  414. t[o] !== void 0 && s++;
  415. }
  416. return s;
  417. }),
  418. (e.prototype.encodeMap = function (t, i) {
  419. var s = Object.keys(t);
  420. this.sortKeys && s.sort();
  421. var n = this.ignoreUndefined ? this.countWithoutUndefined(t, s) : s.length;
  422. if (n < 16) this.writeU8(128 + n);
  423. else if (n < 65536) this.writeU8(222), this.writeU16(n);
  424. else if (n < 4294967296) this.writeU8(223), this.writeU32(n);
  425. else throw new Error("Too large map object: ".concat(n));
  426. for (var r = 0, o = s; r < o.length; r++) {
  427. var l = o[r],
  428. c = t[l];
  429. (this.ignoreUndefined && c === void 0) || (this.encodeString(l), this.doEncode(c, i + 1));
  430. }
  431. }),
  432. (e.prototype.encodeExtension = function (t) {
  433. var i = t.data.length;
  434. if (i === 1) this.writeU8(212);
  435. else if (i === 2) this.writeU8(213);
  436. else if (i === 4) this.writeU8(214);
  437. else if (i === 8) this.writeU8(215);
  438. else if (i === 16) this.writeU8(216);
  439. else if (i < 256) this.writeU8(199), this.writeU8(i);
  440. else if (i < 65536) this.writeU8(200), this.writeU16(i);
  441. else if (i < 4294967296) this.writeU8(201), this.writeU32(i);
  442. else throw new Error("Too large extension object: ".concat(i));
  443. this.writeI8(t.type), this.writeU8a(t.data);
  444. }),
  445. (e.prototype.writeU8 = function (t) {
  446. this.ensureBufferSizeToWrite(1), this.view.setUint8(this.pos, t), this.pos++;
  447. }),
  448. (e.prototype.writeU8a = function (t) {
  449. var i = t.length;
  450. this.ensureBufferSizeToWrite(i), this.bytes.set(t, this.pos), (this.pos += i);
  451. }),
  452. (e.prototype.writeI8 = function (t) {
  453. this.ensureBufferSizeToWrite(1), this.view.setInt8(this.pos, t), this.pos++;
  454. }),
  455. (e.prototype.writeU16 = function (t) {
  456. this.ensureBufferSizeToWrite(2), this.view.setUint16(this.pos, t), (this.pos += 2);
  457. }),
  458. (e.prototype.writeI16 = function (t) {
  459. this.ensureBufferSizeToWrite(2), this.view.setInt16(this.pos, t), (this.pos += 2);
  460. }),
  461. (e.prototype.writeU32 = function (t) {
  462. this.ensureBufferSizeToWrite(4), this.view.setUint32(this.pos, t), (this.pos += 4);
  463. }),
  464. (e.prototype.writeI32 = function (t) {
  465. this.ensureBufferSizeToWrite(4), this.view.setInt32(this.pos, t), (this.pos += 4);
  466. }),
  467. (e.prototype.writeF32 = function (t) {
  468. this.ensureBufferSizeToWrite(4), this.view.setFloat32(this.pos, t), (this.pos += 4);
  469. }),
  470. (e.prototype.writeF64 = function (t) {
  471. this.ensureBufferSizeToWrite(8), this.view.setFloat64(this.pos, t), (this.pos += 8);
  472. }),
  473. (e.prototype.writeU64 = function (t) {
  474. this.ensureBufferSizeToWrite(8), Ko(this.view, this.pos, t), (this.pos += 8);
  475. }),
  476. (e.prototype.writeI64 = function (t) {
  477. this.ensureBufferSizeToWrite(8), Br(this.view, this.pos, t), (this.pos += 8);
  478. }),
  479. e
  480. );
  481. })();
  482. function Ki(e) {
  483. return "".concat(e < 0 ? "-" : "", "0x").concat(Math.abs(e).toString(16).padStart(2, "0"));
  484. }
  485. var va = 16,
  486. xa = 16,
  487. ba = (function () {
  488. function e(t, i) {
  489. t === void 0 && (t = va), i === void 0 && (i = xa), (this.maxKeyLength = t), (this.maxLengthPerKey = i), (this.hit = 0), (this.miss = 0), (this.caches = []);
  490. for (var s = 0; s < this.maxKeyLength; s++) this.caches.push([]);
  491. }
  492. return (
  493. (e.prototype.canBeCached = function (t) {
  494. return t > 0 && t <= this.maxKeyLength;
  495. }),
  496. (e.prototype.find = function (t, i, s) {
  497. var n = this.caches[s - 1];
  498. e: for (var r = 0, o = n; r < o.length; r++) {
  499. for (var l = o[r], c = l.bytes, a = 0; a < s; a++) if (c[a] !== t[i + a]) continue e;
  500. return l.str;
  501. }
  502. return null;
  503. }),
  504. (e.prototype.store = function (t, i) {
  505. var s = this.caches[t.length - 1],
  506. n = { bytes: t, str: i };
  507. s.length >= this.maxLengthPerKey ? (s[(Math.random() * s.length) | 0] = n) : s.push(n);
  508. }),
  509. (e.prototype.decode = function (t, i, s) {
  510. var n = this.find(t, i, s);
  511. if (n != null) return this.hit++, n;
  512. this.miss++;
  513. var r = Hr(t, i, s),
  514. o = Uint8Array.prototype.slice.call(t, i, i + s);
  515. return this.store(o, r), r;
  516. }),
  517. e
  518. );
  519. })(),
  520. Sa =
  521. (globalThis && globalThis.__awaiter) ||
  522. function (e, t, i, s) {
  523. function n(r) {
  524. return r instanceof i
  525. ? r
  526. : new i(function (o) {
  527. o(r);
  528. });
  529. }
  530. return new (i || (i = Promise))(function (r, o) {
  531. function l(u) {
  532. try {
  533. a(s.next(u));
  534. } catch (p) {
  535. o(p);
  536. }
  537. }
  538. function c(u) {
  539. try {
  540. a(s.throw(u));
  541. } catch (p) {
  542. o(p);
  543. }
  544. }
  545. function a(u) {
  546. u.done ? r(u.value) : n(u.value).then(l, c);
  547. }
  548. a((s = s.apply(e, t || [])).next());
  549. });
  550. },
  551. Ji =
  552. (globalThis && globalThis.__generator) ||
  553. function (e, t) {
  554. var i = {
  555. label: 0,
  556. sent: function () {
  557. if (r[0] & 1) throw r[1];
  558. return r[1];
  559. },
  560. trys: [],
  561. ops: [],
  562. },
  563. s,
  564. n,
  565. r,
  566. o;
  567. return (
  568. (o = { next: l(0), throw: l(1), return: l(2) }),
  569. typeof Symbol == "function" &&
  570. (o[Symbol.iterator] = function () {
  571. return this;
  572. }),
  573. o
  574. );
  575. function l(a) {
  576. return function (u) {
  577. return c([a, u]);
  578. };
  579. }
  580. function c(a) {
  581. if (s) throw new TypeError("Generator is already executing.");
  582. for (; i; )
  583. try {
  584. if (((s = 1), n && (r = a[0] & 2 ? n.return : a[0] ? n.throw || ((r = n.return) && r.call(n), 0) : n.next) && !(r = r.call(n, a[1])).done)) return r;
  585. switch (((n = 0), r && (a = [a[0] & 2, r.value]), a[0])) {
  586. case 0:
  587. case 1:
  588. r = a;
  589. break;
  590. case 4:
  591. return i.label++, { value: a[1], done: !1 };
  592. case 5:
  593. i.label++, (n = a[1]), (a = [0]);
  594. continue;
  595. case 7:
  596. (a = i.ops.pop()), i.trys.pop();
  597. continue;
  598. default:
  599. if (((r = i.trys), !(r = r.length > 0 && r[r.length - 1]) && (a[0] === 6 || a[0] === 2))) {
  600. i = 0;
  601. continue;
  602. }
  603. if (a[0] === 3 && (!r || (a[1] > r[0] && a[1] < r[3]))) {
  604. i.label = a[1];
  605. break;
  606. }
  607. if (a[0] === 6 && i.label < r[1]) {
  608. (i.label = r[1]), (r = a);
  609. break;
  610. }
  611. if (r && i.label < r[2]) {
  612. (i.label = r[2]), i.ops.push(a);
  613. break;
  614. }
  615. r[2] && i.ops.pop(), i.trys.pop();
  616. continue;
  617. }
  618. a = t.call(e, i);
  619. } catch (u) {
  620. (a = [6, u]), (n = 0);
  621. } finally {
  622. s = r = 0;
  623. }
  624. if (a[0] & 5) throw a[1];
  625. return { value: a[0] ? a[1] : void 0, done: !0 };
  626. }
  627. },
  628. As =
  629. (globalThis && globalThis.__asyncValues) ||
  630. function (e) {
  631. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  632. var t = e[Symbol.asyncIterator],
  633. i;
  634. return t
  635. ? t.call(e)
  636. : ((e = typeof __values == "function" ? __values(e) : e[Symbol.iterator]()),
  637. (i = {}),
  638. s("next"),
  639. s("throw"),
  640. s("return"),
  641. (i[Symbol.asyncIterator] = function () {
  642. return this;
  643. }),
  644. i);
  645. function s(r) {
  646. i[r] =
  647. e[r] &&
  648. function (o) {
  649. return new Promise(function (l, c) {
  650. (o = e[r](o)), n(l, c, o.done, o.value);
  651. });
  652. };
  653. }
  654. function n(r, o, l, c) {
  655. Promise.resolve(c).then(function (a) {
  656. r({ value: a, done: l });
  657. }, o);
  658. }
  659. },
  660. St =
  661. (globalThis && globalThis.__await) ||
  662. function (e) {
  663. return this instanceof St ? ((this.v = e), this) : new St(e);
  664. },
  665. Ta =
  666. (globalThis && globalThis.__asyncGenerator) ||
  667. function (e, t, i) {
  668. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  669. var s = i.apply(e, t || []),
  670. n,
  671. r = [];
  672. return (
  673. (n = {}),
  674. o("next"),
  675. o("throw"),
  676. o("return"),
  677. (n[Symbol.asyncIterator] = function () {
  678. return this;
  679. }),
  680. n
  681. );
  682. function o(h) {
  683. s[h] &&
  684. (n[h] = function (m) {
  685. return new Promise(function (w, v) {
  686. r.push([h, m, w, v]) > 1 || l(h, m);
  687. });
  688. });
  689. }
  690. function l(h, m) {
  691. try {
  692. c(s[h](m));
  693. } catch (w) {
  694. p(r[0][3], w);
  695. }
  696. }
  697. function c(h) {
  698. h.value instanceof St ? Promise.resolve(h.value.v).then(a, u) : p(r[0][2], h);
  699. }
  700. function a(h) {
  701. l("next", h);
  702. }
  703. function u(h) {
  704. l("throw", h);
  705. }
  706. function p(h, m) {
  707. h(m), r.shift(), r.length && l(r[0][0], r[0][1]);
  708. }
  709. },
  710. Ia = function (e) {
  711. var t = typeof e;
  712. return t === "string" || t === "number";
  713. },
  714. Dt = -1,
  715. es = new DataView(new ArrayBuffer(0)),
  716. Ma = new Uint8Array(es.buffer),
  717. Cn = (function () {
  718. try {
  719. es.getInt8(0);
  720. } catch (e) {
  721. return e.constructor;
  722. }
  723. throw new Error("never reached");
  724. })(),
  725. Ds = new Cn("Insufficient data"),
  726. Ea = new ba(),
  727. Pa = (function () {
  728. function e(t, i, s, n, r, o, l, c) {
  729. t === void 0 && (t = Fr.defaultCodec),
  730. i === void 0 && (i = void 0),
  731. s === void 0 && (s = Ke),
  732. n === void 0 && (n = Ke),
  733. r === void 0 && (r = Ke),
  734. o === void 0 && (o = Ke),
  735. l === void 0 && (l = Ke),
  736. c === void 0 && (c = Ea),
  737. (this.extensionCodec = t),
  738. (this.context = i),
  739. (this.maxStrLength = s),
  740. (this.maxBinLength = n),
  741. (this.maxArrayLength = r),
  742. (this.maxMapLength = o),
  743. (this.maxExtLength = l),
  744. (this.keyDecoder = c),
  745. (this.totalPos = 0),
  746. (this.pos = 0),
  747. (this.view = es),
  748. (this.bytes = Ma),
  749. (this.headByte = Dt),
  750. (this.stack = []);
  751. }
  752. return (
  753. (e.prototype.reinitializeState = function () {
  754. (this.totalPos = 0), (this.headByte = Dt), (this.stack.length = 0);
  755. }),
  756. (e.prototype.setBuffer = function (t) {
  757. (this.bytes = gi(t)), (this.view = ga(this.bytes)), (this.pos = 0);
  758. }),
  759. (e.prototype.appendBuffer = function (t) {
  760. if (this.headByte === Dt && !this.hasRemaining(1)) this.setBuffer(t);
  761. else {
  762. var i = this.bytes.subarray(this.pos),
  763. s = gi(t),
  764. n = new Uint8Array(i.length + s.length);
  765. n.set(i), n.set(s, i.length), this.setBuffer(n);
  766. }
  767. }),
  768. (e.prototype.hasRemaining = function (t) {
  769. return this.view.byteLength - this.pos >= t;
  770. }),
  771. (e.prototype.createExtraByteError = function (t) {
  772. var i = this,
  773. s = i.view,
  774. n = i.pos;
  775. return new RangeError(
  776. "Extra "
  777. .concat(s.byteLength - n, " of ")
  778. .concat(s.byteLength, " byte(s) found at buffer[")
  779. .concat(t, "]")
  780. );
  781. }),
  782. (e.prototype.decode = function (t) {
  783. this.reinitializeState(), this.setBuffer(t);
  784. var i = this.doDecodeSync();
  785. if (this.hasRemaining(1)) throw this.createExtraByteError(this.pos);
  786. return i;
  787. }),
  788. (e.prototype.decodeMulti = function (t) {
  789. return Ji(this, function (i) {
  790. switch (i.label) {
  791. case 0:
  792. this.reinitializeState(), this.setBuffer(t), (i.label = 1);
  793. case 1:
  794. return this.hasRemaining(1) ? [4, this.doDecodeSync()] : [3, 3];
  795. case 2:
  796. return i.sent(), [3, 1];
  797. case 3:
  798. return [2];
  799. }
  800. });
  801. }),
  802. (e.prototype.decodeAsync = function (t) {
  803. var i, s, n, r;
  804. return Sa(this, void 0, void 0, function () {
  805. var o, l, c, a, u, p, h, m;
  806. return Ji(this, function (w) {
  807. switch (w.label) {
  808. case 0:
  809. (o = !1), (w.label = 1);
  810. case 1:
  811. w.trys.push([1, 6, 7, 12]), (i = As(t)), (w.label = 2);
  812. case 2:
  813. return [4, i.next()];
  814. case 3:
  815. if (((s = w.sent()), !!s.done)) return [3, 5];
  816. if (((c = s.value), o)) throw this.createExtraByteError(this.totalPos);
  817. this.appendBuffer(c);
  818. try {
  819. (l = this.doDecodeSync()), (o = !0);
  820. } catch (v) {
  821. if (!(v instanceof Cn)) throw v;
  822. }
  823. (this.totalPos += this.pos), (w.label = 4);
  824. case 4:
  825. return [3, 2];
  826. case 5:
  827. return [3, 12];
  828. case 6:
  829. return (a = w.sent()), (n = { error: a }), [3, 12];
  830. case 7:
  831. return w.trys.push([7, , 10, 11]), s && !s.done && (r = i.return) ? [4, r.call(i)] : [3, 9];
  832. case 8:
  833. w.sent(), (w.label = 9);
  834. case 9:
  835. return [3, 11];
  836. case 10:
  837. if (n) throw n.error;
  838. return [7];
  839. case 11:
  840. return [7];
  841. case 12:
  842. if (o) {
  843. if (this.hasRemaining(1)) throw this.createExtraByteError(this.totalPos);
  844. return [2, l];
  845. }
  846. throw ((u = this), (p = u.headByte), (h = u.pos), (m = u.totalPos), new RangeError("Insufficient data in parsing ".concat(Ki(p), " at ").concat(m, " (").concat(h, " in the current buffer)")));
  847. }
  848. });
  849. });
  850. }),
  851. (e.prototype.decodeArrayStream = function (t) {
  852. return this.decodeMultiAsync(t, !0);
  853. }),
  854. (e.prototype.decodeStream = function (t) {
  855. return this.decodeMultiAsync(t, !1);
  856. }),
  857. (e.prototype.decodeMultiAsync = function (t, i) {
  858. return Ta(this, arguments, function () {
  859. var n, r, o, l, c, a, u, p, h;
  860. return Ji(this, function (m) {
  861. switch (m.label) {
  862. case 0:
  863. (n = i), (r = -1), (m.label = 1);
  864. case 1:
  865. m.trys.push([1, 13, 14, 19]), (o = As(t)), (m.label = 2);
  866. case 2:
  867. return [4, St(o.next())];
  868. case 3:
  869. if (((l = m.sent()), !!l.done)) return [3, 12];
  870. if (((c = l.value), i && r === 0)) throw this.createExtraByteError(this.totalPos);
  871. this.appendBuffer(c), n && ((r = this.readArraySize()), (n = !1), this.complete()), (m.label = 4);
  872. case 4:
  873. m.trys.push([4, 9, , 10]), (m.label = 5);
  874. case 5:
  875. return [4, St(this.doDecodeSync())];
  876. case 6:
  877. return [4, m.sent()];
  878. case 7:
  879. return m.sent(), --r === 0 ? [3, 8] : [3, 5];
  880. case 8:
  881. return [3, 10];
  882. case 9:
  883. if (((a = m.sent()), !(a instanceof Cn))) throw a;
  884. return [3, 10];
  885. case 10:
  886. (this.totalPos += this.pos), (m.label = 11);
  887. case 11:
  888. return [3, 2];
  889. case 12:
  890. return [3, 19];
  891. case 13:
  892. return (u = m.sent()), (p = { error: u }), [3, 19];
  893. case 14:
  894. return m.trys.push([14, , 17, 18]), l && !l.done && (h = o.return) ? [4, St(h.call(o))] : [3, 16];
  895. case 15:
  896. m.sent(), (m.label = 16);
  897. case 16:
  898. return [3, 18];
  899. case 17:
  900. if (p) throw p.error;
  901. return [7];
  902. case 18:
  903. return [7];
  904. case 19:
  905. return [2];
  906. }
  907. });
  908. });
  909. }),
  910. (e.prototype.doDecodeSync = function () {
  911. e: for (;;) {
  912. var t = this.readHeadByte(),
  913. i = void 0;
  914. if (t >= 224) i = t - 256;
  915. else if (t < 192)
  916. if (t < 128) i = t;
  917. else if (t < 144) {
  918. var s = t - 128;
  919. if (s !== 0) {
  920. this.pushMapState(s), this.complete();
  921. continue e;
  922. } else i = {};
  923. } else if (t < 160) {
  924. var s = t - 144;
  925. if (s !== 0) {
  926. this.pushArrayState(s), this.complete();
  927. continue e;
  928. } else i = [];
  929. } else {
  930. var n = t - 160;
  931. i = this.decodeUtf8String(n, 0);
  932. }
  933. else if (t === 192) i = null;
  934. else if (t === 194) i = !1;
  935. else if (t === 195) i = !0;
  936. else if (t === 202) i = this.readF32();
  937. else if (t === 203) i = this.readF64();
  938. else if (t === 204) i = this.readU8();
  939. else if (t === 205) i = this.readU16();
  940. else if (t === 206) i = this.readU32();
  941. else if (t === 207) i = this.readU64();
  942. else if (t === 208) i = this.readI8();
  943. else if (t === 209) i = this.readI16();
  944. else if (t === 210) i = this.readI32();
  945. else if (t === 211) i = this.readI64();
  946. else if (t === 217) {
  947. var n = this.lookU8();
  948. i = this.decodeUtf8String(n, 1);
  949. } else if (t === 218) {
  950. var n = this.lookU16();
  951. i = this.decodeUtf8String(n, 2);
  952. } else if (t === 219) {
  953. var n = this.lookU32();
  954. i = this.decodeUtf8String(n, 4);
  955. } else if (t === 220) {
  956. var s = this.readU16();
  957. if (s !== 0) {
  958. this.pushArrayState(s), this.complete();
  959. continue e;
  960. } else i = [];
  961. } else if (t === 221) {
  962. var s = this.readU32();
  963. if (s !== 0) {
  964. this.pushArrayState(s), this.complete();
  965. continue e;
  966. } else i = [];
  967. } else if (t === 222) {
  968. var s = this.readU16();
  969. if (s !== 0) {
  970. this.pushMapState(s), this.complete();
  971. continue e;
  972. } else i = {};
  973. } else if (t === 223) {
  974. var s = this.readU32();
  975. if (s !== 0) {
  976. this.pushMapState(s), this.complete();
  977. continue e;
  978. } else i = {};
  979. } else if (t === 196) {
  980. var s = this.lookU8();
  981. i = this.decodeBinary(s, 1);
  982. } else if (t === 197) {
  983. var s = this.lookU16();
  984. i = this.decodeBinary(s, 2);
  985. } else if (t === 198) {
  986. var s = this.lookU32();
  987. i = this.decodeBinary(s, 4);
  988. } else if (t === 212) i = this.decodeExtension(1, 0);
  989. else if (t === 213) i = this.decodeExtension(2, 0);
  990. else if (t === 214) i = this.decodeExtension(4, 0);
  991. else if (t === 215) i = this.decodeExtension(8, 0);
  992. else if (t === 216) i = this.decodeExtension(16, 0);
  993. else if (t === 199) {
  994. var s = this.lookU8();
  995. i = this.decodeExtension(s, 1);
  996. } else if (t === 200) {
  997. var s = this.lookU16();
  998. i = this.decodeExtension(s, 2);
  999. } else if (t === 201) {
  1000. var s = this.lookU32();
  1001. i = this.decodeExtension(s, 4);
  1002. } else throw new Pe("Unrecognized type byte: ".concat(Ki(t)));
  1003. this.complete();
  1004. for (var r = this.stack; r.length > 0; ) {
  1005. var o = r[r.length - 1];
  1006. if (o.type === 0)
  1007. if (((o.array[o.position] = i), o.position++, o.position === o.size)) r.pop(), (i = o.array);
  1008. else continue e;
  1009. else if (o.type === 1) {
  1010. if (!Ia(i)) throw new Pe("The type of key must be string or number but " + typeof i);
  1011. if (i === "__proto__") throw new Pe("The key __proto__ is not allowed");
  1012. (o.key = i), (o.type = 2);
  1013. continue e;
  1014. } else if (((o.map[o.key] = i), o.readCount++, o.readCount === o.size)) r.pop(), (i = o.map);
  1015. else {
  1016. (o.key = null), (o.type = 1);
  1017. continue e;
  1018. }
  1019. }
  1020. return i;
  1021. }
  1022. }),
  1023. (e.prototype.readHeadByte = function () {
  1024. return this.headByte === Dt && (this.headByte = this.readU8()), this.headByte;
  1025. }),
  1026. (e.prototype.complete = function () {
  1027. this.headByte = Dt;
  1028. }),
  1029. (e.prototype.readArraySize = function () {
  1030. var t = this.readHeadByte();
  1031. switch (t) {
  1032. case 220:
  1033. return this.readU16();
  1034. case 221:
  1035. return this.readU32();
  1036. default: {
  1037. if (t < 160) return t - 144;
  1038. throw new Pe("Unrecognized array type byte: ".concat(Ki(t)));
  1039. }
  1040. }
  1041. }),
  1042. (e.prototype.pushMapState = function (t) {
  1043. if (t > this.maxMapLength) throw new Pe("Max length exceeded: map length (".concat(t, ") > maxMapLengthLength (").concat(this.maxMapLength, ")"));
  1044. this.stack.push({ type: 1, size: t, key: null, readCount: 0, map: {} });
  1045. }),
  1046. (e.prototype.pushArrayState = function (t) {
  1047. if (t > this.maxArrayLength) throw new Pe("Max length exceeded: array length (".concat(t, ") > maxArrayLength (").concat(this.maxArrayLength, ")"));
  1048. this.stack.push({ type: 0, size: t, array: new Array(t), position: 0 });
  1049. }),
  1050. (e.prototype.decodeUtf8String = function (t, i) {
  1051. var s;
  1052. if (t > this.maxStrLength) throw new Pe("Max length exceeded: UTF-8 byte length (".concat(t, ") > maxStrLength (").concat(this.maxStrLength, ")"));
  1053. if (this.bytes.byteLength < this.pos + i + t) throw Ds;
  1054. var n = this.pos + i,
  1055. r;
  1056. return (
  1057. 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)),
  1058. (this.pos += i + t),
  1059. r
  1060. );
  1061. }),
  1062. (e.prototype.stateIsMapKey = function () {
  1063. if (this.stack.length > 0) {
  1064. var t = this.stack[this.stack.length - 1];
  1065. return t.type === 1;
  1066. }
  1067. return !1;
  1068. }),
  1069. (e.prototype.decodeBinary = function (t, i) {
  1070. if (t > this.maxBinLength) throw new Pe("Max length exceeded: bin length (".concat(t, ") > maxBinLength (").concat(this.maxBinLength, ")"));
  1071. if (!this.hasRemaining(t + i)) throw Ds;
  1072. var s = this.pos + i,
  1073. n = this.bytes.subarray(s, s + t);
  1074. return (this.pos += i + t), n;
  1075. }),
  1076. (e.prototype.decodeExtension = function (t, i) {
  1077. if (t > this.maxExtLength) throw new Pe("Max length exceeded: ext length (".concat(t, ") > maxExtLength (").concat(this.maxExtLength, ")"));
  1078. var s = this.view.getInt8(this.pos + i),
  1079. n = this.decodeBinary(t, i + 1);
  1080. return this.extensionCodec.decode(n, s, this.context);
  1081. }),
  1082. (e.prototype.lookU8 = function () {
  1083. return this.view.getUint8(this.pos);
  1084. }),
  1085. (e.prototype.lookU16 = function () {
  1086. return this.view.getUint16(this.pos);
  1087. }),
  1088. (e.prototype.lookU32 = function () {
  1089. return this.view.getUint32(this.pos);
  1090. }),
  1091. (e.prototype.readU8 = function () {
  1092. var t = this.view.getUint8(this.pos);
  1093. return this.pos++, t;
  1094. }),
  1095. (e.prototype.readI8 = function () {
  1096. var t = this.view.getInt8(this.pos);
  1097. return this.pos++, t;
  1098. }),
  1099. (e.prototype.readU16 = function () {
  1100. var t = this.view.getUint16(this.pos);
  1101. return (this.pos += 2), t;
  1102. }),
  1103. (e.prototype.readI16 = function () {
  1104. var t = this.view.getInt16(this.pos);
  1105. return (this.pos += 2), t;
  1106. }),
  1107. (e.prototype.readU32 = function () {
  1108. var t = this.view.getUint32(this.pos);
  1109. return (this.pos += 4), t;
  1110. }),
  1111. (e.prototype.readI32 = function () {
  1112. var t = this.view.getInt32(this.pos);
  1113. return (this.pos += 4), t;
  1114. }),
  1115. (e.prototype.readU64 = function () {
  1116. var t = Jo(this.view, this.pos);
  1117. return (this.pos += 8), t;
  1118. }),
  1119. (e.prototype.readI64 = function () {
  1120. var t = zr(this.view, this.pos);
  1121. return (this.pos += 8), t;
  1122. }),
  1123. (e.prototype.readF32 = function () {
  1124. var t = this.view.getFloat32(this.pos);
  1125. return (this.pos += 4), t;
  1126. }),
  1127. (e.prototype.readF64 = function () {
  1128. var t = this.view.getFloat64(this.pos);
  1129. return (this.pos += 8), t;
  1130. }),
  1131. e
  1132. );
  1133. })(),
  1134. rt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
  1135. $t = {},
  1136. Ca = {
  1137. get exports() {
  1138. return $t;
  1139. },
  1140. set exports(e) {
  1141. $t = e;
  1142. },
  1143. },
  1144. le = (Ca.exports = {}),
  1145. Ce,
  1146. Ae;
  1147. function An() {
  1148. throw new Error("setTimeout has not been defined");
  1149. }
  1150. function Dn() {
  1151. throw new Error("clearTimeout has not been defined");
  1152. }
  1153. (function () {
  1154. try {
  1155. typeof setTimeout == "function" ? (Ce = setTimeout) : (Ce = An);
  1156. } catch {
  1157. Ce = An;
  1158. }
  1159. try {
  1160. typeof clearTimeout == "function" ? (Ae = clearTimeout) : (Ae = Dn);
  1161. } catch {
  1162. Ae = Dn;
  1163. }
  1164. })();
  1165. function Vr(e) {
  1166. if (Ce === setTimeout) return setTimeout(e, 0);
  1167. if ((Ce === An || !Ce) && setTimeout) return (Ce = setTimeout), setTimeout(e, 0);
  1168. try {
  1169. return Ce(e, 0);
  1170. } catch {
  1171. try {
  1172. return Ce.call(null, e, 0);
  1173. } catch {
  1174. return Ce.call(this, e, 0);
  1175. }
  1176. }
  1177. }
  1178. function Aa(e) {
  1179. if (Ae === clearTimeout) return clearTimeout(e);
  1180. if ((Ae === Dn || !Ae) && clearTimeout) return (Ae = clearTimeout), clearTimeout(e);
  1181. try {
  1182. return Ae(e);
  1183. } catch {
  1184. try {
  1185. return Ae.call(null, e);
  1186. } catch {
  1187. return Ae.call(this, e);
  1188. }
  1189. }
  1190. }
  1191. var ze = [],
  1192. Tt = !1,
  1193. Qe,
  1194. li = -1;
  1195. function Da() {
  1196. !Tt || !Qe || ((Tt = !1), Qe.length ? (ze = Qe.concat(ze)) : (li = -1), ze.length && Ur());
  1197. }
  1198. function Ur() {
  1199. if (!Tt) {
  1200. var e = Vr(Da);
  1201. Tt = !0;
  1202. for (var t = ze.length; t; ) {
  1203. for (Qe = ze, ze = []; ++li < t; ) Qe && Qe[li].run();
  1204. (li = -1), (t = ze.length);
  1205. }
  1206. (Qe = null), (Tt = !1), Aa(e);
  1207. }
  1208. }
  1209. le.nextTick = function (e) {
  1210. var t = new Array(arguments.length - 1);
  1211. if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i];
  1212. ze.push(new Lr(e, t)), ze.length === 1 && !Tt && Vr(Ur);
  1213. };
  1214. function Lr(e, t) {
  1215. (this.fun = e), (this.array = t);
  1216. }
  1217. Lr.prototype.run = function () {
  1218. this.fun.apply(null, this.array);
  1219. };
  1220. le.title = "browser";
  1221. le.browser = !0;
  1222. le.env = {};
  1223. le.argv = [];
  1224. le.version = "";
  1225. le.versions = {};
  1226. function Fe() {}
  1227. le.on = Fe;
  1228. le.addListener = Fe;
  1229. le.once = Fe;
  1230. le.off = Fe;
  1231. le.removeListener = Fe;
  1232. le.removeAllListeners = Fe;
  1233. le.emit = Fe;
  1234. le.prependListener = Fe;
  1235. le.prependOnceListener = Fe;
  1236. le.listeners = function (e) {
  1237. return [];
  1238. };
  1239. le.binding = function (e) {
  1240. throw new Error("process.binding is not supported");
  1241. };
  1242. le.cwd = function () {
  1243. return "/";
  1244. };
  1245. le.chdir = function (e) {
  1246. throw new Error("process.chdir is not supported");
  1247. };
  1248. le.umask = function () {
  1249. return 0;
  1250. };
  1251. const Oa = 1920,
  1252. Ra = 1080,
  1253. _a = 9,
  1254. Nr = $t && $t.argv.indexOf("--largeserver") != -1 ? 80 : 40,
  1255. Ba = Nr + 10,
  1256. za = 6,
  1257. Ha = 3e3,
  1258. Fa = 10,
  1259. Va = 5,
  1260. Ua = 50,
  1261. La = 4.5,
  1262. Na = 15,
  1263. qa = 0.9,
  1264. Wa = 3e3,
  1265. Xa = 60,
  1266. Ga = 35,
  1267. Ya = 3e3,
  1268. $a = 500,
  1269. Ka = $t && {}.IS_SANDBOX,
  1270. Ja = 100,
  1271. Qa = Math.PI / 2.6,
  1272. Za = 10,
  1273. ja = 0.25,
  1274. el = Math.PI / 2,
  1275. tl = 35,
  1276. il = 0.0016,
  1277. nl = 0.993,
  1278. sl = 34,
  1279. rl = ["#bf8f54", "#cbb091", "#896c4b", "#fadadc", "#ececec", "#c37373", "#4c4c4c", "#ecaff7", "#738cc3", "#8bc373"],
  1280. ol = 7,
  1281. al = 0.06,
  1282. ll = [
  1283. "Sid",
  1284. "Steph",
  1285. "Bmoe",
  1286. "Romn",
  1287. "Jononthecool",
  1288. "Fiona",
  1289. "Vince",
  1290. "Nathan",
  1291. "Nick",
  1292. "Flappy",
  1293. "Ronald",
  1294. "Otis",
  1295. "Pepe",
  1296. "Mc Donald",
  1297. "Theo",
  1298. "Fabz",
  1299. "Oliver",
  1300. "Jeff",
  1301. "Jimmy",
  1302. "Helena",
  1303. "Reaper",
  1304. "Ben",
  1305. "Alan",
  1306. "Naomi",
  1307. "XYZ",
  1308. "Clever",
  1309. "Jeremy",
  1310. "Mike",
  1311. "Destined",
  1312. "Stallion",
  1313. "Allison",
  1314. "Meaty",
  1315. "Sophia",
  1316. "Vaja",
  1317. "Joey",
  1318. "Pendy",
  1319. "Murdoch",
  1320. "Theo",
  1321. "Jared",
  1322. "July",
  1323. "Sonia",
  1324. "Mel",
  1325. "Dexter",
  1326. "Quinn",
  1327. "Milky",
  1328. ],
  1329. cl = Math.PI / 3,
  1330. ci = [
  1331. { id: 0, src: "", xp: 0, val: 1 },
  1332. { id: 1, src: "_g", xp: 3e3, val: 1.1 },
  1333. { id: 2, src: "_d", xp: 7e3, val: 1.18 },
  1334. { id: 3, src: "_r", poison: !0, xp: 12e3, val: 1.18 },
  1335. ],
  1336. hl = function (e) {
  1337. const t = e.weaponXP[e.weaponIndex] || 0;
  1338. for (let i = ci.length - 1; i >= 0; --i) if (t >= ci[i].xp) return ci[i];
  1339. },
  1340. fl = ["wood", "food", "stone", "points"],
  1341. ul = 7,
  1342. dl = 9,
  1343. pl = 3,
  1344. ml = 32,
  1345. gl = 7,
  1346. yl = 724,
  1347. wl = 114,
  1348. kl = 0.0011,
  1349. vl = 1e-4,
  1350. xl = 1.3,
  1351. bl = [150, 160, 165, 175],
  1352. Sl = [80, 85, 95],
  1353. Tl = [80, 85, 90],
  1354. Il = 2400,
  1355. Ml = 0.75,
  1356. El = 15,
  1357. ts = 14400,
  1358. Pl = 40,
  1359. Cl = 2200,
  1360. Al = 0.6,
  1361. Dl = 1,
  1362. Ol = 0.3,
  1363. Rl = 0.3,
  1364. _l = 144e4,
  1365. is = 320,
  1366. Bl = 100,
  1367. zl = 2,
  1368. Hl = 3200,
  1369. Fl = 1440,
  1370. Vl = 0.2,
  1371. Ul = -1,
  1372. Ll = ts - is - 120,
  1373. Nl = ts - is - 120,
  1374. T = {
  1375. maxScreenWidth: Oa,
  1376. maxScreenHeight: Ra,
  1377. serverUpdateRate: _a,
  1378. maxPlayers: Nr,
  1379. maxPlayersHard: Ba,
  1380. collisionDepth: za,
  1381. minimapRate: Ha,
  1382. colGrid: Fa,
  1383. clientSendRate: Va,
  1384. healthBarWidth: Ua,
  1385. healthBarPad: La,
  1386. iconPadding: Na,
  1387. iconPad: qa,
  1388. deathFadeout: Wa,
  1389. crownIconScale: Xa,
  1390. crownPad: Ga,
  1391. chatCountdown: Ya,
  1392. chatCooldown: $a,
  1393. inSandbox: Ka,
  1394. maxAge: Ja,
  1395. gatherAngle: Qa,
  1396. gatherWiggle: Za,
  1397. hitReturnRatio: ja,
  1398. hitAngle: el,
  1399. playerScale: tl,
  1400. playerSpeed: il,
  1401. playerDecel: nl,
  1402. nameY: sl,
  1403. skinColors: rl,
  1404. animalCount: ol,
  1405. aiTurnRandom: al,
  1406. cowNames: ll,
  1407. shieldAngle: cl,
  1408. weaponVariants: ci,
  1409. fetchVariant: hl,
  1410. resourceTypes: fl,
  1411. areaCount: ul,
  1412. treesPerArea: dl,
  1413. bushesPerArea: pl,
  1414. totalRocks: ml,
  1415. goldOres: gl,
  1416. riverWidth: yl,
  1417. riverPadding: wl,
  1418. waterCurrent: kl,
  1419. waveSpeed: vl,
  1420. waveMax: xl,
  1421. treeScales: bl,
  1422. bushScales: Sl,
  1423. rockScales: Tl,
  1424. snowBiomeTop: Il,
  1425. snowSpeed: Ml,
  1426. maxNameLength: El,
  1427. mapScale: ts,
  1428. mapPingScale: Pl,
  1429. mapPingTime: Cl,
  1430. volcanoScale: is,
  1431. innerVolcanoScale: Bl,
  1432. volcanoAnimalStrength: zl,
  1433. volcanoAnimationDuration: Hl,
  1434. volcanoAggressionRadius: Fl,
  1435. volcanoAggressionPercentage: Vl,
  1436. volcanoDamagePerSecond: Ul,
  1437. volcanoLocationX: Ll,
  1438. volcanoLocationY: Nl,
  1439. MAX_ATTACK: Al,
  1440. MAX_SPAWN_DELAY: Dl,
  1441. MAX_SPEED: Ol,
  1442. MAX_TURN_SPEED: Rl,
  1443. DAY_INTERVAL: _l,
  1444. },
  1445. ql = new ka(),
  1446. Wl = new Pa(),
  1447. ee = {
  1448. socket: null,
  1449. connected: !1,
  1450. socketId: -1,
  1451. connect: function (e, t, i) {
  1452. if (this.socket) return;
  1453. const s = this;
  1454. try {
  1455. let n = !1;
  1456. const r = e;
  1457. (this.socket = new WebSocket(e)),
  1458. (this.socket.binaryType = "arraybuffer"),
  1459. (this.socket.onmessage = function (o) {
  1460. var a = new Uint8Array(o.data);
  1461. const l = Wl.decode(a),
  1462. c = l[0];
  1463. var a = l[1];
  1464. c == "io-init" ? (s.socketId = a[0]) : i[c].apply(void 0, a);
  1465. }),
  1466. (this.socket.onopen = function () {
  1467. (s.connected = !0), t();
  1468. }),
  1469. (this.socket.onclose = function (o) {
  1470. (s.connected = !1), o.code == 4001 ? t("Invalid Connection") : n || t("disconnected");
  1471. }),
  1472. (this.socket.onerror = function (o) {
  1473. this.socket && this.socket.readyState != WebSocket.OPEN && ((n = !0), console.error("Socket error", arguments), t("Socket error"));
  1474. });
  1475. } catch (n) {
  1476. console.warn("Socket connection error:", n), t(n);
  1477. }
  1478. },
  1479. send: function (e) {
  1480. const t = Array.prototype.slice.call(arguments, 1),
  1481. i = ql.encode([e, t]);
  1482. this.socket && this.socket.send(i);
  1483. },
  1484. socketReady: function () {
  1485. return this.socket && this.connected;
  1486. },
  1487. close: function () {
  1488. this.socket && this.socket.close(), (this.socket = null), (this.connected = !1);
  1489. },
  1490. };
  1491. var qr = Math.abs;
  1492. const Xl = Math.sqrt;
  1493. var qr = Math.abs;
  1494. const Gl = Math.atan2,
  1495. Qi = Math.PI,
  1496. Yl = function (e, t) {
  1497. return Math.floor(Math.random() * (t - e + 1)) + e;
  1498. },
  1499. $l = function (e, t) {
  1500. return Math.random() * (t - e + 1) + e;
  1501. },
  1502. Kl = function (e, t, i) {
  1503. return e + (t - e) * i;
  1504. },
  1505. Jl = function (e, t) {
  1506. return e > 0 ? (e = Math.max(0, e - t)) : e < 0 && (e = Math.min(0, e + t)), e;
  1507. },
  1508. Ql = function (e, t, i, s) {
  1509. return Xl((i -= e) * i + (s -= t) * s);
  1510. },
  1511. Zl = function (e, t, i, s) {
  1512. return Gl(t - s, e - i);
  1513. },
  1514. jl = function (e, t) {
  1515. const i = qr(t - e) % (Qi * 2);
  1516. return i > Qi ? Qi * 2 - i : i;
  1517. },
  1518. ec = function (e) {
  1519. return typeof e == "number" && !isNaN(e) && isFinite(e);
  1520. },
  1521. tc = function (e) {
  1522. return e && typeof e == "string";
  1523. },
  1524. ic = function (e) {
  1525. return e > 999 ? (e / 1e3).toFixed(1) + "k" : e;
  1526. },
  1527. nc = function (e) {
  1528. return e.charAt(0).toUpperCase() + e.slice(1);
  1529. },
  1530. sc = function (e, t) {
  1531. return e ? parseFloat(e.toFixed(t)) : 0;
  1532. },
  1533. rc = function (e, t) {
  1534. return parseFloat(t.points) - parseFloat(e.points);
  1535. },
  1536. oc = function (e, t, i, s, n, r, o, l) {
  1537. let c = n,
  1538. a = o;
  1539. if ((n > o && ((c = o), (a = n)), a > i && (a = i), c < e && (c = e), c > a)) return !1;
  1540. let u = r,
  1541. p = l;
  1542. const h = o - n;
  1543. if (Math.abs(h) > 1e-7) {
  1544. const m = (l - r) / h,
  1545. w = r - m * n;
  1546. (u = m * c + w), (p = m * a + w);
  1547. }
  1548. if (u > p) {
  1549. const m = p;
  1550. (p = u), (u = m);
  1551. }
  1552. return p > s && (p = s), u < t && (u = t), !(u > p);
  1553. },
  1554. Wr = function (e, t, i) {
  1555. const s = e.getBoundingClientRect(),
  1556. n = s.left + window.scrollX,
  1557. r = s.top + window.scrollY,
  1558. o = s.width,
  1559. l = s.height,
  1560. c = t > n && t < n + o,
  1561. a = i > r && i < r + l;
  1562. return c && a;
  1563. },
  1564. hi = function (e) {
  1565. const t = e.changedTouches[0];
  1566. (e.screenX = t.screenX), (e.screenY = t.screenY), (e.clientX = t.clientX), (e.clientY = t.clientY), (e.pageX = t.pageX), (e.pageY = t.pageY);
  1567. },
  1568. Xr = function (e, t) {
  1569. const i = !t;
  1570. let s = !1;
  1571. const n = !1;
  1572. e.addEventListener("touchstart", Be(r), n), e.addEventListener("touchmove", Be(o), n), e.addEventListener("touchend", Be(l), n), e.addEventListener("touchcancel", Be(l), n), e.addEventListener("touchleave", Be(l), n);
  1573. function r(c) {
  1574. hi(c), window.setUsingTouch(!0), i && (c.preventDefault(), c.stopPropagation()), e.onmouseover && e.onmouseover(c), (s = !0);
  1575. }
  1576. function o(c) {
  1577. hi(c), window.setUsingTouch(!0), i && (c.preventDefault(), c.stopPropagation()), Wr(e, c.pageX, c.pageY) ? s || (e.onmouseover && e.onmouseover(c), (s = !0)) : s && (e.onmouseout && e.onmouseout(c), (s = !1));
  1578. }
  1579. function l(c) {
  1580. hi(c), window.setUsingTouch(!0), i && (c.preventDefault(), c.stopPropagation()), s && (e.onclick && e.onclick(c), e.onmouseout && e.onmouseout(c), (s = !1));
  1581. }
  1582. },
  1583. ac = function (e) {
  1584. for (; e.hasChildNodes(); ) e.removeChild(e.lastChild);
  1585. },
  1586. lc = function (e) {
  1587. const t = document.createElement(e.tag || "div");
  1588. function i(s, n) {
  1589. e[s] && (t[n] = e[s]);
  1590. }
  1591. i("text", "textContent"), i("html", "innerHTML"), i("class", "className");
  1592. for (const s in e) {
  1593. switch (s) {
  1594. case "tag":
  1595. case "text":
  1596. case "html":
  1597. case "class":
  1598. case "style":
  1599. case "hookTouch":
  1600. case "parent":
  1601. case "children":
  1602. continue;
  1603. }
  1604. t[s] = e[s];
  1605. }
  1606. if (
  1607. (t.onclick && (t.onclick = Be(t.onclick)),
  1608. t.onmouseover && (t.onmouseover = Be(t.onmouseover)),
  1609. t.onmouseout && (t.onmouseout = Be(t.onmouseout)),
  1610. e.style && (t.style.cssText = e.style),
  1611. e.hookTouch && Xr(t),
  1612. e.parent && e.parent.appendChild(t),
  1613. e.children)
  1614. )
  1615. for (let s = 0; s < e.children.length; s++) t.appendChild(e.children[s]);
  1616. return t;
  1617. },
  1618. Gr = function (e) {
  1619. return e && typeof e.isTrusted == "boolean" ? e.isTrusted : !0;
  1620. },
  1621. Be = function (e) {
  1622. return function (t) {
  1623. t && t instanceof Event && Gr(t) && e(t);
  1624. };
  1625. },
  1626. cc = function (e) {
  1627. let t = "";
  1628. const i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  1629. for (let s = 0; s < e; s++) t += i.charAt(Math.floor(Math.random() * i.length));
  1630. return t;
  1631. },
  1632. hc = function (e, t) {
  1633. let i = 0;
  1634. for (let s = 0; s < e.length; s++) e[s] === t && i++;
  1635. return i;
  1636. },
  1637. C = {
  1638. randInt: Yl,
  1639. randFloat: $l,
  1640. lerp: Kl,
  1641. decel: Jl,
  1642. getDistance: Ql,
  1643. getDirection: Zl,
  1644. getAngleDist: jl,
  1645. isNumber: ec,
  1646. isString: tc,
  1647. kFormat: ic,
  1648. capitalizeFirst: nc,
  1649. fixTo: sc,
  1650. sortByPoints: rc,
  1651. lineInRect: oc,
  1652. containsPoint: Wr,
  1653. mousifyTouchEvent: hi,
  1654. hookTouchEvents: Xr,
  1655. removeAllChildren: ac,
  1656. generateElement: lc,
  1657. eventIsTrusted: Gr,
  1658. checkTrusted: Be,
  1659. randomString: cc,
  1660. countInArray: hc,
  1661. },
  1662. fc = function () {
  1663. (this.init = function (e, t, i, s, n, r, o) {
  1664. (this.x = e), (this.y = t), (this.color = o), (this.scale = i), (this.startScale = this.scale), (this.maxScale = i * 1.5), (this.scaleSpeed = 0.7), (this.speed = s), (this.life = n), (this.text = r);
  1665. }),
  1666. (this.update = function (e) {
  1667. this.life &&
  1668. ((this.life -= e),
  1669. (this.y -= this.speed * e),
  1670. (this.scale += this.scaleSpeed * e),
  1671. this.scale >= this.maxScale ? ((this.scale = this.maxScale), (this.scaleSpeed *= -1)) : this.scale <= this.startScale && ((this.scale = this.startScale), (this.scaleSpeed = 0)),
  1672. this.life <= 0 && (this.life = 0));
  1673. }),
  1674. (this.render = function (e, t, i) {
  1675. (e.fillStyle = this.color), (e.font = this.scale + "px Hammersmith One"), e.fillText(this.text, this.x - t, this.y - i);
  1676. });
  1677. },
  1678. uc = function () {
  1679. (this.texts = []),
  1680. (this.update = function (e, t, i, s) {
  1681. (t.textBaseline = "middle"), (t.textAlign = "center");
  1682. for (let n = 0; n < this.texts.length; ++n) this.texts[n].life && (this.texts[n].update(e), this.texts[n].render(t, i, s));
  1683. }),
  1684. (this.showText = function (e, t, i, s, n, r, o) {
  1685. let l;
  1686. for (let c = 0; c < this.texts.length; ++c)
  1687. if (!this.texts[c].life) {
  1688. l = this.texts[c];
  1689. break;
  1690. }
  1691. l || ((l = new fc()), this.texts.push(l)), l.init(e, t, i, s, n, r, o);
  1692. });
  1693. },
  1694. dc = function (e, t) {
  1695. let i;
  1696. (this.sounds = []),
  1697. (this.active = !0),
  1698. (this.play = function (s, n, r) {
  1699. !n ||
  1700. !this.active ||
  1701. ((i = this.sounds[s]), i || ((i = new Howl({ src: ".././sound/" + s + ".mp3" })), (this.sounds[s] = i)), (!r || !i.isPlaying) && ((i.isPlaying = !0), i.play(), i.volume((n || 1) * e.volumeMult), i.loop(r)));
  1702. }),
  1703. (this.toggleMute = function (s, n) {
  1704. (i = this.sounds[s]), i && i.mute(n);
  1705. }),
  1706. (this.stop = function (s) {
  1707. (i = this.sounds[s]), i && (i.stop(), (i.isPlaying = !1));
  1708. });
  1709. },
  1710. Os = Math.floor,
  1711. Rs = Math.abs,
  1712. Ot = Math.cos,
  1713. Rt = Math.sin,
  1714. pc = Math.sqrt;
  1715. function mc(e, t, i, s, n, r) {
  1716. (this.objects = t), (this.grids = {}), (this.updateObjects = []);
  1717. let o, l;
  1718. const c = s.mapScale / s.colGrid;
  1719. (this.setObjectGrids = function (h) {
  1720. const m = Math.min(s.mapScale, Math.max(0, h.x)),
  1721. w = Math.min(s.mapScale, Math.max(0, h.y));
  1722. for (let v = 0; v < s.colGrid; ++v) {
  1723. o = v * c;
  1724. for (let x = 0; x < s.colGrid; ++x)
  1725. (l = x * c),
  1726. 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] = []), this.grids[v + "_" + x].push(h), h.gridLocations.push(v + "_" + x));
  1727. }
  1728. }),
  1729. (this.removeObjGrid = function (h) {
  1730. let m;
  1731. for (let w = 0; w < h.gridLocations.length; ++w) (m = this.grids[h.gridLocations[w]].indexOf(h)), m >= 0 && this.grids[h.gridLocations[w]].splice(m, 1);
  1732. }),
  1733. (this.disableObj = function (h) {
  1734. if (((h.active = !1), r)) {
  1735. h.owner && h.pps && (h.owner.pps -= h.pps), this.removeObjGrid(h);
  1736. const m = this.updateObjects.indexOf(h);
  1737. m >= 0 && this.updateObjects.splice(m, 1);
  1738. }
  1739. }),
  1740. (this.hitObj = function (h, m) {
  1741. for (let w = 0; w < n.length; ++w)
  1742. 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)), !h.active && h.owner == n[w] && n[w].changeItemCount(h.group.id, -1));
  1743. });
  1744. const a = [];
  1745. let u;
  1746. this.getGridArrays = function (h, m, w) {
  1747. (o = Os(h / c)), (l = Os(m / c)), (a.length = 0);
  1748. try {
  1749. this.grids[o + "_" + l] && a.push(this.grids[o + "_" + l]),
  1750. h + w >= (o + 1) * c &&
  1751. ((u = this.grids[o + 1 + "_" + l]), u && a.push(u), l && m - w <= l * c ? ((u = this.grids[o + 1 + "_" + (l - 1)]), u && a.push(u)) : m + w >= (l + 1) * c && ((u = this.grids[o + 1 + "_" + (l + 1)]), u && a.push(u))),
  1752. o &&
  1753. h - w <= o * c &&
  1754. ((u = this.grids[o - 1 + "_" + l]), u && a.push(u), l && m - w <= l * c ? ((u = this.grids[o - 1 + "_" + (l - 1)]), u && a.push(u)) : m + w >= (l + 1) * c && ((u = this.grids[o - 1 + "_" + (l + 1)]), u && a.push(u))),
  1755. m + w >= (l + 1) * c && ((u = this.grids[o + "_" + (l + 1)]), u && a.push(u)),
  1756. l && m - w <= l * c && ((u = this.grids[o + "_" + (l - 1)]), u && a.push(u));
  1757. } catch {}
  1758. return a;
  1759. };
  1760. let p;
  1761. (this.add = function (h, m, w, v, x, D, k, S, O) {
  1762. p = null;
  1763. for (var U = 0; U < t.length; ++U)
  1764. if (t[U].sid == h) {
  1765. p = t[U];
  1766. break;
  1767. }
  1768. if (!p) {
  1769. for (var U = 0; U < t.length; ++U)
  1770. if (!t[U].active) {
  1771. p = t[U];
  1772. break;
  1773. }
  1774. }
  1775. p || ((p = new e(h)), t.push(p)), S && (p.sid = h), p.init(m, w, v, x, D, k, O), r && (this.setObjectGrids(p), p.doUpdate && this.updateObjects.push(p));
  1776. }),
  1777. (this.disableBySid = function (h) {
  1778. for (let m = 0; m < t.length; ++m)
  1779. if (t[m].sid == h) {
  1780. this.disableObj(t[m]);
  1781. break;
  1782. }
  1783. }),
  1784. (this.removeAllItems = function (h, m) {
  1785. for (let w = 0; w < t.length; ++w) t[w].active && t[w].owner && t[w].owner.sid == h && this.disableObj(t[w]);
  1786. m && m.broadcast("R", h);
  1787. }),
  1788. (this.fetchSpawnObj = function (h) {
  1789. let m = null;
  1790. for (let w = 0; w < t.length; ++w)
  1791. if (((p = t[w]), p.active && p.owner && p.owner.sid == h && p.spawnPoint)) {
  1792. (m = [p.x, p.y]), this.disableObj(p), r.broadcast("Q", p.sid), p.owner && p.owner.changeItemCount(p.group.id, -1);
  1793. break;
  1794. }
  1795. return m;
  1796. }),
  1797. (this.checkItemLocation = function (h, m, w, v, x, D, k) {
  1798. for (let S = 0; S < t.length; ++S) {
  1799. const O = t[S].blocker ? t[S].blocker : t[S].getScale(v, t[S].isItem);
  1800. if (t[S].active && i.getDistance(h, m, t[S].x, t[S].y) < w + O) return !1;
  1801. }
  1802. return !(!D && x != 18 && m >= s.mapScale / 2 - s.riverWidth / 2 && m <= s.mapScale / 2 + s.riverWidth / 2);
  1803. }),
  1804. (this.addProjectile = function (h, m, w, v, x) {
  1805. const D = items.projectiles[x];
  1806. let k;
  1807. for (let S = 0; S < projectiles.length; ++S)
  1808. if (!projectiles[S].active) {
  1809. k = projectiles[S];
  1810. break;
  1811. }
  1812. k || ((k = new Projectile(n, i)), projectiles.push(k)), k.init(x, h, m, w, D.speed, v, D.scale);
  1813. }),
  1814. (this.checkCollision = function (h, m, w) {
  1815. w = w || 1;
  1816. const v = h.x - m.x,
  1817. x = h.y - m.y;
  1818. let D = h.scale + m.scale;
  1819. if (Rs(v) <= D || Rs(x) <= D) {
  1820. D = h.scale + (m.getScale ? m.getScale() : m.scale);
  1821. let k = pc(v * v + x * x) - D;
  1822. if (k <= 0) {
  1823. if (m.ignoreCollision)
  1824. m.trap && !h.noTrap && m.owner != h && !(m.owner && m.owner.team && m.owner.team == h.team)
  1825. ? ((h.lockMove = !0), (m.hideFromEnemy = !1))
  1826. : m.boostSpeed
  1827. ? ((h.xVel += w * m.boostSpeed * (m.weightM || 1) * Ot(m.dir)), (h.yVel += w * m.boostSpeed * (m.weightM || 1) * Rt(m.dir)))
  1828. : m.healCol
  1829. ? (h.healCol = m.healCol)
  1830. : m.teleport && ((h.x = i.randInt(0, s.mapScale)), (h.y = i.randInt(0, s.mapScale)));
  1831. else {
  1832. const S = i.getDirection(h.x, h.y, m.x, m.y);
  1833. if (
  1834. (i.getDistance(h.x, h.y, m.x, m.y),
  1835. m.isPlayer ? ((k = (k * -1) / 2), (h.x += k * Ot(S)), (h.y += k * Rt(S)), (m.x -= k * Ot(S)), (m.y -= k * Rt(S))) : ((h.x = m.x + D * Ot(S)), (h.y = m.y + D * Rt(S)), (h.xVel *= 0.75), (h.yVel *= 0.75)),
  1836. m.dmg && m.owner != h && !(m.owner && m.owner.team && m.owner.team == h.team))
  1837. ) {
  1838. h.changeHealth(-m.dmg, m.owner, m);
  1839. const O = 1.5 * (m.weightM || 1);
  1840. (h.xVel += O * Ot(S)),
  1841. (h.yVel += O * Rt(S)),
  1842. m.pDmg && !(h.skin && h.skin.poisonRes) && ((h.dmgOverTime.dmg = m.pDmg), (h.dmgOverTime.time = 5), (h.dmgOverTime.doer = m.owner)),
  1843. h.colDmg && m.health && (m.changeHealth(-h.colDmg) && this.disableObj(m), this.hitObj(m, i.getDirection(h.x, h.y, m.x, m.y)));
  1844. }
  1845. }
  1846. return m.zIndex > h.zIndex && (h.zIndex = m.zIndex), !0;
  1847. }
  1848. }
  1849. return !1;
  1850. });
  1851. }
  1852. function gc(e, t, i, s, n, r, o, l, c) {
  1853. this.addProjectile = function (a, u, p, h, m, w, v, x, D) {
  1854. const k = r.projectiles[w];
  1855. let S;
  1856. for (let O = 0; O < t.length; ++O)
  1857. if (!t[O].active) {
  1858. S = t[O];
  1859. break;
  1860. }
  1861. return S || ((S = new e(i, s, n, r, o, l, c)), (S.sid = t.length), t.push(S)), S.init(w, a, u, p, m, k.dmg, h, k.scale, v), (S.ignoreObj = x), (S.layer = D || k.layer), (S.src = k.src), S;
  1862. };
  1863. }
  1864. function yc(e, t, i, s, n, r, o, l, c) {
  1865. (this.aiTypes = [
  1866. { id: 0, src: "cow_1", killScore: 150, health: 500, weightM: 0.8, speed: 95e-5, turnSpeed: 0.001, scale: 72, drop: ["food", 50] },
  1867. { id: 1, src: "pig_1", killScore: 200, health: 800, weightM: 0.6, speed: 85e-5, turnSpeed: 0.001, scale: 72, drop: ["food", 80] },
  1868. { id: 2, name: "Bull", src: "bull_2", hostile: !0, dmg: 20, killScore: 1e3, health: 1800, weightM: 0.5, speed: 94e-5, turnSpeed: 74e-5, scale: 78, viewRange: 800, chargePlayer: !0, drop: ["food", 100] },
  1869. { id: 3, name: "Bully", src: "bull_1", hostile: !0, dmg: 20, killScore: 2e3, health: 2800, weightM: 0.45, speed: 0.001, turnSpeed: 8e-4, scale: 90, viewRange: 900, chargePlayer: !0, drop: ["food", 400] },
  1870. { id: 4, name: "Wolf", src: "wolf_1", hostile: !0, dmg: 8, killScore: 500, health: 300, weightM: 0.45, speed: 0.001, turnSpeed: 0.002, scale: 84, viewRange: 800, chargePlayer: !0, drop: ["food", 200] },
  1871. { id: 5, name: "Quack", src: "chicken_1", dmg: 8, killScore: 2e3, noTrap: !0, health: 300, weightM: 0.2, speed: 0.0018, turnSpeed: 0.006, scale: 70, drop: ["food", 100] },
  1872. {
  1873. id: 6,
  1874. name: "MOOSTAFA",
  1875. nameScale: 50,
  1876. src: "enemy",
  1877. hostile: !0,
  1878. dontRun: !0,
  1879. fixedSpawn: !0,
  1880. spawnDelay: 6e4,
  1881. noTrap: !0,
  1882. colDmg: 100,
  1883. dmg: 40,
  1884. killScore: 8e3,
  1885. health: 18e3,
  1886. weightM: 0.4,
  1887. speed: 7e-4,
  1888. turnSpeed: 0.01,
  1889. scale: 80,
  1890. spriteMlt: 1.8,
  1891. leapForce: 0.9,
  1892. viewRange: 1e3,
  1893. hitRange: 210,
  1894. hitDelay: 1e3,
  1895. chargePlayer: !0,
  1896. drop: ["food", 100],
  1897. },
  1898. { id: 7, name: "Treasure", hostile: !0, nameScale: 35, src: "crate_1", fixedSpawn: !0, spawnDelay: 12e4, colDmg: 200, killScore: 5e3, health: 2e4, weightM: 0.1, speed: 0, turnSpeed: 0, scale: 70, spriteMlt: 1 },
  1899. {
  1900. id: 8,
  1901. name: "MOOFIE",
  1902. src: "wolf_2",
  1903. hostile: !0,
  1904. fixedSpawn: !0,
  1905. dontRun: !0,
  1906. hitScare: 4,
  1907. spawnDelay: 3e4,
  1908. noTrap: !0,
  1909. nameScale: 35,
  1910. dmg: 10,
  1911. colDmg: 100,
  1912. killScore: 3e3,
  1913. health: 7e3,
  1914. weightM: 0.45,
  1915. speed: 0.0015,
  1916. turnSpeed: 0.002,
  1917. scale: 90,
  1918. viewRange: 800,
  1919. chargePlayer: !0,
  1920. drop: ["food", 1e3],
  1921. },
  1922. {
  1923. id: 9,
  1924. name: "💀MOOFIE",
  1925. src: "wolf_2",
  1926. hostile: !0,
  1927. fixedSpawn: !0,
  1928. dontRun: !0,
  1929. hitScare: 50,
  1930. spawnDelay: 6e4,
  1931. noTrap: !0,
  1932. nameScale: 35,
  1933. dmg: 12,
  1934. colDmg: 100,
  1935. killScore: 3e3,
  1936. health: 9e3,
  1937. weightM: 0.45,
  1938. speed: 0.0015,
  1939. turnSpeed: 0.0025,
  1940. scale: 94,
  1941. viewRange: 1440,
  1942. chargePlayer: !0,
  1943. drop: ["food", 3e3],
  1944. minSpawnRange: 0.85,
  1945. maxSpawnRange: 0.9,
  1946. },
  1947. {
  1948. id: 10,
  1949. name: "💀Wolf",
  1950. src: "wolf_1",
  1951. hostile: !0,
  1952. fixedSpawn: !0,
  1953. dontRun: !0,
  1954. hitScare: 50,
  1955. spawnDelay: 3e4,
  1956. dmg: 10,
  1957. killScore: 700,
  1958. health: 500,
  1959. weightM: 0.45,
  1960. speed: 0.00115,
  1961. turnSpeed: 0.0025,
  1962. scale: 88,
  1963. viewRange: 1440,
  1964. chargePlayer: !0,
  1965. drop: ["food", 400],
  1966. minSpawnRange: 0.85,
  1967. maxSpawnRange: 0.9,
  1968. },
  1969. {
  1970. id: 11,
  1971. name: "💀Bully",
  1972. src: "bull_1",
  1973. hostile: !0,
  1974. fixedSpawn: !0,
  1975. dontRun: !0,
  1976. hitScare: 50,
  1977. dmg: 20,
  1978. killScore: 5e3,
  1979. health: 5e3,
  1980. spawnDelay: 1e5,
  1981. weightM: 0.45,
  1982. speed: 0.00115,
  1983. turnSpeed: 0.0025,
  1984. scale: 94,
  1985. viewRange: 1440,
  1986. chargePlayer: !0,
  1987. drop: ["food", 800],
  1988. minSpawnRange: 0.85,
  1989. maxSpawnRange: 0.9,
  1990. },
  1991. ]),
  1992. (this.spawn = function (a, u, p, h) {
  1993. if (!this.aiTypes[h]) return console.error("missing ai type", h), this.spawn(a, u, p, 0);
  1994. let m;
  1995. for (let w = 0; w < e.length; ++w)
  1996. if (!e[w].active) {
  1997. m = e[w];
  1998. break;
  1999. }
  2000. return m || ((m = new t(e.length, n, i, s, o, r, l, c)), e.push(m)), m.init(a, u, p, h, this.aiTypes[h]), m;
  2001. });
  2002. }
  2003. const ot = Math.PI * 2,
  2004. Zi = 0;
  2005. function wc(e, t, i, s, n, r, o, l) {
  2006. (this.sid = e),
  2007. (this.isAI = !0),
  2008. (this.nameIndex = n.randInt(0, r.cowNames.length - 1)),
  2009. (this.init = function (p, h, m, w, v) {
  2010. (this.x = p),
  2011. (this.y = h),
  2012. (this.startX = v.fixedSpawn ? p : null),
  2013. (this.startY = v.fixedSpawn ? h : null),
  2014. (this.xVel = 0),
  2015. (this.yVel = 0),
  2016. (this.zIndex = 0),
  2017. (this.dir = m),
  2018. (this.dirPlus = 0),
  2019. (this.index = w),
  2020. (this.src = v.src),
  2021. v.name && (this.name = v.name),
  2022. (this.name || "").startsWith("💀") && (this.isVolcanoAi = !0),
  2023. (this.weightM = v.weightM),
  2024. (this.speed = v.speed),
  2025. (this.killScore = v.killScore),
  2026. (this.turnSpeed = v.turnSpeed),
  2027. (this.scale = v.scale),
  2028. (this.maxHealth = v.health),
  2029. (this.leapForce = v.leapForce),
  2030. (this.health = this.maxHealth),
  2031. (this.chargePlayer = v.chargePlayer),
  2032. (this.viewRange = v.viewRange),
  2033. (this.drop = v.drop),
  2034. (this.dmg = v.dmg),
  2035. (this.hostile = v.hostile),
  2036. (this.dontRun = v.dontRun),
  2037. (this.hitRange = v.hitRange),
  2038. (this.hitDelay = v.hitDelay),
  2039. (this.hitScare = v.hitScare),
  2040. (this.spriteMlt = v.spriteMlt),
  2041. (this.nameScale = v.nameScale),
  2042. (this.colDmg = v.colDmg),
  2043. (this.noTrap = v.noTrap),
  2044. (this.spawnDelay = v.spawnDelay),
  2045. (this.minSpawnRange = v.minSpawnRange),
  2046. (this.maxSpawnRange = v.maxSpawnRange),
  2047. (this.hitWait = 0),
  2048. (this.waitCount = 1e3),
  2049. (this.moveCount = 0),
  2050. (this.targetDir = 0),
  2051. (this.active = !0),
  2052. (this.alive = !0),
  2053. (this.runFrom = null),
  2054. (this.chargeTarget = null),
  2055. (this.dmgOverTime = {});
  2056. }),
  2057. (this.getVolcanoAggression = function () {
  2058. const p = n.getDistance(this.x, this.y, r.volcanoLocationX, r.volcanoLocationY),
  2059. h = p > r.volcanoAggressionRadius ? 0 : r.volcanoAggressionRadius - p;
  2060. return 1 + r.volcanoAggressionPercentage * (1 - h / r.volcanoAggressionRadius);
  2061. });
  2062. let c = 0;
  2063. (this.update = function (p) {
  2064. if (this.active) {
  2065. if (this.spawnCounter) {
  2066. if (((this.spawnCounter -= p * (1 + 0) * this.getVolcanoAggression()), this.spawnCounter <= 0))
  2067. if (((this.spawnCounter = 0), this.minSpawnRange || this.maxSpawnRange)) {
  2068. const W = r.mapScale * this.minSpawnRange,
  2069. F = r.mapScale * this.maxSpawnRange;
  2070. (this.x = n.randInt(W, F)), (this.y = n.randInt(W, F));
  2071. } else (this.x = this.startX || n.randInt(0, r.mapScale)), (this.y = this.startY || n.randInt(0, r.mapScale));
  2072. return;
  2073. }
  2074. (c -= p), c <= 0 && (this.dmgOverTime.dmg && (this.changeHealth(-this.dmgOverTime.dmg, this.dmgOverTime.doer), (this.dmgOverTime.time -= 1), this.dmgOverTime.time <= 0 && (this.dmgOverTime.dmg = 0)), (c = 1e3));
  2075. let k = !1,
  2076. S = 1;
  2077. if ((!this.zIndex && !this.lockMove && this.y >= r.mapScale / 2 - r.riverWidth / 2 && this.y <= r.mapScale / 2 + r.riverWidth / 2 && ((S = 0.33), (this.xVel += r.waterCurrent * p)), this.lockMove))
  2078. (this.xVel = 0), (this.yVel = 0);
  2079. else if (this.waitCount > 0) {
  2080. if (((this.waitCount -= p), this.waitCount <= 0))
  2081. if (this.chargePlayer) {
  2082. let W, F, _;
  2083. for (var h = 0; h < i.length; ++h) i[h].alive && !(i[h].skin && i[h].skin.bullRepel) && ((_ = n.getDistance(this.x, this.y, i[h].x, i[h].y)), _ <= this.viewRange && (!W || _ < F) && ((F = _), (W = i[h])));
  2084. W ? ((this.chargeTarget = W), (this.moveCount = n.randInt(8e3, 12e3))) : ((this.moveCount = n.randInt(1e3, 2e3)), (this.targetDir = n.randFloat(-Math.PI, Math.PI)));
  2085. } else (this.moveCount = n.randInt(4e3, 1e4)), (this.targetDir = n.randFloat(-Math.PI, Math.PI));
  2086. } else if (this.moveCount > 0) {
  2087. var m = this.speed * S * (1 + r.MAX_SPEED * Zi) * this.getVolcanoAggression();
  2088. if (
  2089. (this.runFrom && this.runFrom.active && !(this.runFrom.isPlayer && !this.runFrom.alive)
  2090. ? ((this.targetDir = n.getDirection(this.x, this.y, this.runFrom.x, this.runFrom.y)), (m *= 1.42))
  2091. : this.chargeTarget && this.chargeTarget.alive && ((this.targetDir = n.getDirection(this.chargeTarget.x, this.chargeTarget.y, this.x, this.y)), (m *= 1.75), (k = !0)),
  2092. this.hitWait && (m *= 0.3),
  2093. this.dir != this.targetDir)
  2094. ) {
  2095. this.dir %= ot;
  2096. const W = (this.dir - this.targetDir + ot) % ot,
  2097. F = Math.min(Math.abs(W - ot), W, this.turnSpeed * p),
  2098. _ = W - Math.PI >= 0 ? 1 : -1;
  2099. this.dir += _ * F + ot;
  2100. }
  2101. (this.dir %= ot),
  2102. (this.xVel += m * p * Math.cos(this.dir)),
  2103. (this.yVel += m * p * Math.sin(this.dir)),
  2104. (this.moveCount -= p),
  2105. this.moveCount <= 0 && ((this.runFrom = null), (this.chargeTarget = null), (this.waitCount = this.hostile ? 1500 : n.randInt(1500, 6e3)));
  2106. }
  2107. (this.zIndex = 0), (this.lockMove = !1);
  2108. var w;
  2109. const O = n.getDistance(0, 0, this.xVel * p, this.yVel * p),
  2110. U = Math.min(4, Math.max(1, Math.round(O / 40))),
  2111. L = 1 / U;
  2112. for (var h = 0; h < U; ++h) {
  2113. this.xVel && (this.x += this.xVel * p * L), this.yVel && (this.y += this.yVel * p * L), (w = t.getGridArrays(this.x, this.y, this.scale));
  2114. for (var v = 0; v < w.length; ++v) for (let F = 0; F < w[v].length; ++F) w[v][F].active && t.checkCollision(this, w[v][F], L);
  2115. }
  2116. let q = !1;
  2117. if (this.hitWait > 0 && ((this.hitWait -= p), this.hitWait <= 0)) {
  2118. (q = !0), (this.hitWait = 0), this.leapForce && !n.randInt(0, 2) && ((this.xVel += this.leapForce * Math.cos(this.dir)), (this.yVel += this.leapForce * Math.sin(this.dir)));
  2119. var w = t.getGridArrays(this.x, this.y, this.hitRange),
  2120. x,
  2121. D;
  2122. for (let F = 0; F < w.length; ++F)
  2123. for (var v = 0; v < w[F].length; ++v)
  2124. (x = w[F][v]), x.health && ((D = n.getDistance(this.x, this.y, x.x, x.y)), D < x.scale + this.hitRange && (x.changeHealth(-this.dmg * 5) && t.disableObj(x), t.hitObj(x, n.getDirection(this.x, this.y, x.x, x.y))));
  2125. for (var v = 0; v < i.length; ++v) i[v].canSee(this) && l.send(i[v].id, "J", this.sid);
  2126. }
  2127. if (k || q) {
  2128. var x, D;
  2129. let _;
  2130. for (var h = 0; h < i.length; ++h)
  2131. (x = i[h]),
  2132. x &&
  2133. x.alive &&
  2134. ((D = n.getDistance(this.x, this.y, x.x, x.y)),
  2135. this.hitRange
  2136. ? !this.hitWait &&
  2137. D <= this.hitRange + x.scale &&
  2138. (q
  2139. ? ((_ = n.getDirection(x.x, x.y, this.x, this.y)),
  2140. x.changeHealth(-this.dmg * (1 + r.MAX_ATTACK * Zi) * this.getVolcanoAggression()),
  2141. (x.xVel += 0.6 * Math.cos(_)),
  2142. (x.yVel += 0.6 * Math.sin(_)),
  2143. (this.runFrom = null),
  2144. (this.chargeTarget = null),
  2145. (this.waitCount = 3e3),
  2146. (this.hitWait = n.randInt(0, 2) ? 0 : 600))
  2147. : (this.hitWait = this.hitDelay))
  2148. : D <= this.scale + x.scale &&
  2149. ((_ = n.getDirection(x.x, x.y, this.x, this.y)), x.changeHealth(-this.dmg * (1 + r.MAX_ATTACK * Zi) * this.getVolcanoAggression()), (x.xVel += 0.55 * Math.cos(_)), (x.yVel += 0.55 * Math.sin(_))));
  2150. }
  2151. this.xVel && (this.xVel *= Math.pow(r.playerDecel, p)), this.yVel && (this.yVel *= Math.pow(r.playerDecel, p));
  2152. const P = this.scale;
  2153. this.x - P < 0 ? ((this.x = P), (this.xVel = 0)) : this.x + P > r.mapScale && ((this.x = r.mapScale - P), (this.xVel = 0)),
  2154. this.y - P < 0 ? ((this.y = P), (this.yVel = 0)) : this.y + P > r.mapScale && ((this.y = r.mapScale - P), (this.yVel = 0)),
  2155. this.isVolcanoAi &&
  2156. (this.chargeTarget && (n.getDistance(this.chargeTarget.x, this.chargeTarget.y, r.volcanoLocationX, r.volcanoLocationY) || 0) > r.volcanoAggressionRadius && (this.chargeTarget = null),
  2157. this.xVel &&
  2158. (this.x < r.volcanoLocationX - r.volcanoAggressionRadius
  2159. ? ((this.x = r.volcanoLocationX - r.volcanoAggressionRadius), (this.xVel = 0))
  2160. : this.x > r.volcanoLocationX + r.volcanoAggressionRadius && ((this.x = r.volcanoLocationX + r.volcanoAggressionRadius), (this.xVel = 0))),
  2161. this.yVel &&
  2162. (this.y < r.volcanoLocationY - r.volcanoAggressionRadius
  2163. ? ((this.y = r.volcanoLocationY - r.volcanoAggressionRadius), (this.yVel = 0))
  2164. : this.y > r.volcanoLocationY + r.volcanoAggressionRadius && ((this.y = r.volcanoLocationY + r.volcanoAggressionRadius), (this.yVel = 0))));
  2165. }
  2166. }),
  2167. (this.canSee = function (p) {
  2168. if (!p || (p.skin && p.skin.invisTimer && p.noMovTimer >= p.skin.invisTimer)) return !1;
  2169. const h = Math.abs(p.x - this.x) - p.scale,
  2170. m = Math.abs(p.y - this.y) - p.scale;
  2171. return h <= (r.maxScreenWidth / 2) * 1.3 && m <= (r.maxScreenHeight / 2) * 1.3;
  2172. });
  2173. let a = 0,
  2174. u = 0;
  2175. (this.animate = function (p) {
  2176. this.animTime > 0 &&
  2177. ((this.animTime -= p),
  2178. this.animTime <= 0
  2179. ? ((this.animTime = 0), (this.dirPlus = 0), (a = 0), (u = 0))
  2180. : u == 0
  2181. ? ((a += p / (this.animSpeed * r.hitReturnRatio)), (this.dirPlus = n.lerp(0, this.targetAngle, Math.min(1, a))), a >= 1 && ((a = 1), (u = 1)))
  2182. : ((a -= p / (this.animSpeed * (1 - r.hitReturnRatio))), (this.dirPlus = n.lerp(0, this.targetAngle, Math.max(0, a)))));
  2183. }),
  2184. (this.startAnim = function () {
  2185. (this.animTime = this.animSpeed = 600), (this.targetAngle = Math.PI * 0.8), (a = 0), (u = 0);
  2186. }),
  2187. (this.changeHealth = function (p, h, m) {
  2188. if (
  2189. this.active &&
  2190. ((this.health += p),
  2191. m &&
  2192. (this.hitScare && !n.randInt(0, this.hitScare)
  2193. ? ((this.runFrom = m), (this.waitCount = 0), (this.moveCount = 2e3))
  2194. : this.hostile && this.chargePlayer && m.isPlayer
  2195. ? ((this.chargeTarget = m), (this.waitCount = 0), (this.moveCount = 8e3))
  2196. : this.dontRun || ((this.runFrom = m), (this.waitCount = 0), (this.moveCount = 2e3))),
  2197. p < 0 && this.hitRange && n.randInt(0, 1) && (this.hitWait = 500),
  2198. h && h.canSee(this) && p < 0 && l.send(h.id, "8", Math.round(this.x), Math.round(this.y), Math.round(-p), 1),
  2199. this.health <= 0)
  2200. ) {
  2201. if (this.spawnDelay) (this.spawnCounter = this.spawnDelay), (this.x = -1e6), (this.y = -1e6);
  2202. else if (this.minSpawnRange || this.maxSpawnRange) {
  2203. const w = r.mapScale * this.minSpawnRange,
  2204. v = r.mapScale * this.maxSpawnRange;
  2205. (this.x = n.randInt(w, v)), (this.y = n.randInt(w, v));
  2206. } else (this.x = this.startX || n.randInt(0, r.mapScale)), (this.y = this.startY || n.randInt(0, r.mapScale));
  2207. if (((this.health = this.maxHealth), (this.runFrom = null), h && (o(h, this.killScore), this.drop))) for (let w = 0; w < this.drop.length; ) h.addResource(r.resourceTypes.indexOf(this.drop[w]), this.drop[w + 1]), (w += 2);
  2208. }
  2209. });
  2210. }
  2211. function kc(e) {
  2212. (this.sid = e),
  2213. (this.init = function (t, i, s, n, r, o, l) {
  2214. (o = o || {}),
  2215. (this.sentTo = {}),
  2216. (this.gridLocations = []),
  2217. (this.active = !0),
  2218. (this.doUpdate = o.doUpdate),
  2219. (this.x = t),
  2220. (this.y = i),
  2221. (this.dir = s),
  2222. (this.xWiggle = 0),
  2223. (this.yWiggle = 0),
  2224. (this.scale = n),
  2225. (this.type = r),
  2226. (this.id = o.id),
  2227. (this.owner = l),
  2228. (this.name = o.name),
  2229. (this.isItem = this.id != null),
  2230. (this.group = o.group),
  2231. (this.health = o.health),
  2232. (this.layer = 2),
  2233. 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),
  2234. (this.colDiv = o.colDiv || 1),
  2235. (this.blocker = o.blocker),
  2236. (this.ignoreCollision = o.ignoreCollision),
  2237. (this.dontGather = o.dontGather),
  2238. (this.hideFromEnemy = o.hideFromEnemy),
  2239. (this.friction = o.friction),
  2240. (this.projDmg = o.projDmg),
  2241. (this.dmg = o.dmg),
  2242. (this.pDmg = o.pDmg),
  2243. (this.pps = o.pps),
  2244. (this.zIndex = o.zIndex || 0),
  2245. (this.turnSpeed = o.turnSpeed),
  2246. (this.req = o.req),
  2247. (this.trap = o.trap),
  2248. (this.healCol = o.healCol),
  2249. (this.teleport = o.teleport),
  2250. (this.boostSpeed = o.boostSpeed),
  2251. (this.projectile = o.projectile),
  2252. (this.shootRange = o.shootRange),
  2253. (this.shootRate = o.shootRate),
  2254. (this.shootCount = this.shootRate),
  2255. (this.spawnPoint = o.spawnPoint);
  2256. }),
  2257. (this.changeHealth = function (t, i) {
  2258. return (this.health += t), this.health <= 0;
  2259. }),
  2260. (this.getScale = function (t, i) {
  2261. return (t = t || 1), this.scale * (this.isItem || this.type == 2 || this.type == 3 || this.type == 4 ? 1 : 0.6 * t) * (i ? 1 : this.colDiv);
  2262. }),
  2263. (this.visibleToPlayer = function (t) {
  2264. return !this.hideFromEnemy || (this.owner && (this.owner == t || (this.owner.team && t.team == this.owner.team)));
  2265. }),
  2266. (this.update = function (t) {
  2267. this.active && (this.xWiggle && (this.xWiggle *= Math.pow(0.99, t)), this.yWiggle && (this.yWiggle *= Math.pow(0.99, t)), this.turnSpeed && (this.dir += this.turnSpeed * t));
  2268. });
  2269. }
  2270. const j = [
  2271. { id: 0, name: "food", layer: 0 },
  2272. { id: 1, name: "walls", place: !0, limit: 30, layer: 0 },
  2273. { id: 2, name: "spikes", place: !0, limit: 15, layer: 0 },
  2274. { id: 3, name: "mill", place: !0, limit: 7, sandboxLimit: 299, layer: 1 },
  2275. { id: 4, name: "mine", place: !0, limit: 1, layer: 0 },
  2276. { id: 5, name: "trap", place: !0, limit: 6, layer: -1 },
  2277. { id: 6, name: "booster", place: !0, limit: 12, sandboxLimit: 299, layer: -1 },
  2278. { id: 7, name: "turret", place: !0, limit: 2, layer: 1 },
  2279. { id: 8, name: "watchtower", place: !0, limit: 12, layer: 1 },
  2280. { id: 9, name: "buff", place: !0, limit: 4, layer: -1 },
  2281. { id: 10, name: "spawn", place: !0, limit: 1, layer: -1 },
  2282. { id: 11, name: "sapling", place: !0, limit: 2, layer: 0 },
  2283. { id: 12, name: "blocker", place: !0, limit: 3, layer: -1 },
  2284. { id: 13, name: "teleporter", place: !0, limit: 2, sandboxLimit: 299, layer: -1 },
  2285. ],
  2286. vc = [
  2287. { indx: 0, layer: 0, src: "arrow_1", dmg: 25, speed: 1.6, scale: 103, range: 1e3 },
  2288. { indx: 1, layer: 1, dmg: 25, scale: 20 },
  2289. { indx: 0, layer: 0, src: "arrow_1", dmg: 35, speed: 2.5, scale: 103, range: 1200 },
  2290. { indx: 0, layer: 0, src: "arrow_1", dmg: 30, speed: 2, scale: 103, range: 1200 },
  2291. { indx: 1, layer: 1, dmg: 16, scale: 20 },
  2292. { indx: 0, layer: 0, src: "bullet_1", dmg: 50, speed: 3.6, scale: 160, range: 1400 },
  2293. ],
  2294. xc = [
  2295. { id: 0, type: 0, name: "tool hammer", desc: "tool for gathering all resources", src: "hammer_1", length: 140, width: 140, xOff: -3, yOff: 18, dmg: 25, range: 65, gather: 1, speed: 300 },
  2296. { id: 1, type: 0, age: 2, name: "hand axe", desc: "gathers resources at a higher rate", src: "axe_1", length: 140, width: 140, xOff: 3, yOff: 24, dmg: 30, spdMult: 1, range: 70, gather: 2, speed: 400 },
  2297. { id: 2, type: 0, age: 8, pre: 1, name: "great axe", desc: "deal more damage and gather more resources", src: "great_axe_1", length: 140, width: 140, xOff: -8, yOff: 25, dmg: 35, spdMult: 1, range: 75, gather: 4, speed: 400 },
  2298. {
  2299. id: 3,
  2300. type: 0,
  2301. age: 2,
  2302. name: "short sword",
  2303. desc: "increased attack power but slower move speed",
  2304. src: "sword_1",
  2305. iPad: 1.3,
  2306. length: 130,
  2307. width: 210,
  2308. xOff: -8,
  2309. yOff: 46,
  2310. dmg: 35,
  2311. spdMult: 0.85,
  2312. range: 110,
  2313. gather: 1,
  2314. speed: 300,
  2315. },
  2316. { id: 4, type: 0, age: 8, pre: 3, name: "katana", desc: "greater range and damage", src: "samurai_1", iPad: 1.3, length: 130, width: 210, xOff: -8, yOff: 59, dmg: 40, spdMult: 0.8, range: 118, gather: 1, speed: 300 },
  2317. { id: 5, type: 0, age: 2, name: "polearm", desc: "long range melee weapon", src: "spear_1", iPad: 1.3, length: 130, width: 210, xOff: -8, yOff: 53, dmg: 45, knock: 0.2, spdMult: 0.82, range: 142, gather: 1, speed: 700 },
  2318. { id: 6, type: 0, age: 2, name: "bat", desc: "fast long range melee weapon", src: "bat_1", iPad: 1.3, length: 110, width: 180, xOff: -8, yOff: 53, dmg: 20, knock: 0.7, range: 110, gather: 1, speed: 300 },
  2319. {
  2320. id: 7,
  2321. type: 0,
  2322. age: 2,
  2323. name: "daggers",
  2324. desc: "really fast short range weapon",
  2325. src: "dagger_1",
  2326. iPad: 0.8,
  2327. length: 110,
  2328. width: 110,
  2329. xOff: 18,
  2330. yOff: 0,
  2331. dmg: 20,
  2332. knock: 0.1,
  2333. range: 65,
  2334. gather: 1,
  2335. hitSlow: 0.1,
  2336. spdMult: 1.13,
  2337. speed: 100,
  2338. },
  2339. { id: 8, type: 0, age: 2, name: "stick", desc: "great for gathering but very weak", src: "stick_1", length: 140, width: 140, xOff: 3, yOff: 24, dmg: 1, spdMult: 1, range: 70, gather: 7, speed: 400 },
  2340. { id: 9, type: 1, age: 6, name: "hunting bow", desc: "bow used for ranged combat and hunting", src: "bow_1", req: ["wood", 4], length: 120, width: 120, xOff: -6, yOff: 0, projectile: 0, spdMult: 0.75, speed: 600 },
  2341. {
  2342. id: 10,
  2343. type: 1,
  2344. age: 6,
  2345. name: "great hammer",
  2346. desc: "hammer used for destroying structures",
  2347. src: "great_hammer_1",
  2348. length: 140,
  2349. width: 140,
  2350. xOff: -9,
  2351. yOff: 25,
  2352. dmg: 10,
  2353. spdMult: 0.88,
  2354. range: 75,
  2355. sDmg: 7.5,
  2356. gather: 1,
  2357. speed: 400,
  2358. },
  2359. { id: 11, type: 1, age: 6, name: "wooden shield", desc: "blocks projectiles and reduces melee damage", src: "shield_1", length: 120, width: 120, shield: 0.2, xOff: 6, yOff: 0, spdMult: 0.7 },
  2360. {
  2361. id: 12,
  2362. type: 1,
  2363. age: 8,
  2364. pre: 9,
  2365. name: "crossbow",
  2366. desc: "deals more damage and has greater range",
  2367. src: "crossbow_1",
  2368. req: ["wood", 5],
  2369. aboveHand: !0,
  2370. armS: 0.75,
  2371. length: 120,
  2372. width: 120,
  2373. xOff: -4,
  2374. yOff: 0,
  2375. projectile: 2,
  2376. spdMult: 0.7,
  2377. speed: 700,
  2378. },
  2379. {
  2380. id: 13,
  2381. type: 1,
  2382. age: 9,
  2383. pre: 12,
  2384. name: "repeater crossbow",
  2385. desc: "high firerate crossbow with reduced damage",
  2386. src: "crossbow_2",
  2387. req: ["wood", 10],
  2388. aboveHand: !0,
  2389. armS: 0.75,
  2390. length: 120,
  2391. width: 120,
  2392. xOff: -4,
  2393. yOff: 0,
  2394. projectile: 3,
  2395. spdMult: 0.7,
  2396. speed: 230,
  2397. },
  2398. { id: 14, type: 1, age: 6, name: "mc grabby", desc: "steals resources from enemies", src: "grab_1", length: 130, width: 210, xOff: -8, yOff: 53, dmg: 0, steal: 250, knock: 0.2, spdMult: 1.05, range: 125, gather: 0, speed: 700 },
  2399. {
  2400. id: 15,
  2401. type: 1,
  2402. age: 9,
  2403. pre: 12,
  2404. name: "musket",
  2405. desc: "slow firerate but high damage and range",
  2406. src: "musket_1",
  2407. req: ["stone", 10],
  2408. aboveHand: !0,
  2409. rec: 0.35,
  2410. armS: 0.6,
  2411. hndS: 0.3,
  2412. hndD: 1.6,
  2413. length: 205,
  2414. width: 205,
  2415. xOff: 25,
  2416. yOff: 0,
  2417. projectile: 5,
  2418. hideProjectile: !0,
  2419. spdMult: 0.6,
  2420. speed: 1500,
  2421. },
  2422. ],
  2423. dt = [
  2424. {
  2425. group: j[0],
  2426. name: "apple",
  2427. desc: "restores 20 health when consumed",
  2428. req: ["food", 10],
  2429. consume: function (e) {
  2430. return e.changeHealth(20, e);
  2431. },
  2432. scale: 22,
  2433. holdOffset: 15,
  2434. },
  2435. {
  2436. age: 3,
  2437. group: j[0],
  2438. name: "cookie",
  2439. desc: "restores 40 health when consumed",
  2440. req: ["food", 15],
  2441. consume: function (e) {
  2442. return e.changeHealth(40, e);
  2443. },
  2444. scale: 27,
  2445. holdOffset: 15,
  2446. },
  2447. {
  2448. age: 7,
  2449. group: j[0],
  2450. name: "cheese",
  2451. desc: "restores 30 health and another 50 over 5 seconds",
  2452. req: ["food", 25],
  2453. consume: function (e) {
  2454. return e.changeHealth(30, e) || e.health < 100 ? ((e.dmgOverTime.dmg = -10), (e.dmgOverTime.doer = e), (e.dmgOverTime.time = 5), !0) : !1;
  2455. },
  2456. scale: 27,
  2457. holdOffset: 15,
  2458. },
  2459. { group: j[1], name: "wood wall", desc: "provides protection for your village", req: ["wood", 10], projDmg: !0, health: 380, scale: 50, holdOffset: 20, placeOffset: -5 },
  2460. { age: 3, group: j[1], name: "stone wall", desc: "provides improved protection for your village", req: ["stone", 25], health: 900, scale: 50, holdOffset: 20, placeOffset: -5 },
  2461. { age: 7, pre: 1, group: j[1], name: "castle wall", desc: "provides powerful protection for your village", req: ["stone", 35], health: 1500, scale: 52, holdOffset: 20, placeOffset: -5 },
  2462. { group: j[2], name: "spikes", desc: "damages enemies when they touch them", req: ["wood", 20, "stone", 5], health: 400, dmg: 20, scale: 49, spritePadding: -23, holdOffset: 8, placeOffset: -5 },
  2463. { age: 5, group: j[2], name: "greater spikes", desc: "damages enemies when they touch them", req: ["wood", 30, "stone", 10], health: 500, dmg: 35, scale: 52, spritePadding: -23, holdOffset: 8, placeOffset: -5 },
  2464. { age: 9, pre: 1, group: j[2], name: "poison spikes", desc: "poisons enemies when they touch them", req: ["wood", 35, "stone", 15], health: 600, dmg: 30, pDmg: 5, scale: 52, spritePadding: -23, holdOffset: 8, placeOffset: -5 },
  2465. {
  2466. age: 9,
  2467. pre: 2,
  2468. group: j[2],
  2469. name: "spinning spikes",
  2470. desc: "damages enemies when they touch them",
  2471. req: ["wood", 30, "stone", 20],
  2472. health: 500,
  2473. dmg: 45,
  2474. turnSpeed: 0.003,
  2475. scale: 52,
  2476. spritePadding: -23,
  2477. holdOffset: 8,
  2478. placeOffset: -5,
  2479. },
  2480. { group: j[3], name: "windmill", desc: "generates gold over time", req: ["wood", 50, "stone", 10], health: 400, pps: 1, turnSpeed: 0.0016, spritePadding: 25, iconLineMult: 12, scale: 45, holdOffset: 20, placeOffset: 5 },
  2481. {
  2482. age: 5,
  2483. pre: 1,
  2484. group: j[3],
  2485. name: "faster windmill",
  2486. desc: "generates more gold over time",
  2487. req: ["wood", 60, "stone", 20],
  2488. health: 500,
  2489. pps: 1.5,
  2490. turnSpeed: 0.0025,
  2491. spritePadding: 25,
  2492. iconLineMult: 12,
  2493. scale: 47,
  2494. holdOffset: 20,
  2495. placeOffset: 5,
  2496. },
  2497. {
  2498. age: 8,
  2499. pre: 1,
  2500. group: j[3],
  2501. name: "power mill",
  2502. desc: "generates more gold over time",
  2503. req: ["wood", 100, "stone", 50],
  2504. health: 800,
  2505. pps: 2,
  2506. turnSpeed: 0.005,
  2507. spritePadding: 25,
  2508. iconLineMult: 12,
  2509. scale: 47,
  2510. holdOffset: 20,
  2511. placeOffset: 5,
  2512. },
  2513. { age: 5, group: j[4], type: 2, name: "mine", desc: "allows you to mine stone", req: ["wood", 20, "stone", 100], iconLineMult: 12, scale: 65, holdOffset: 20, placeOffset: 0 },
  2514. { age: 5, group: j[11], type: 0, name: "sapling", desc: "allows you to farm wood", req: ["wood", 150], iconLineMult: 12, colDiv: 0.5, scale: 110, holdOffset: 50, placeOffset: -15 },
  2515. {
  2516. age: 4,
  2517. group: j[5],
  2518. name: "pit trap",
  2519. desc: "pit that traps enemies if they walk over it",
  2520. req: ["wood", 30, "stone", 30],
  2521. trap: !0,
  2522. ignoreCollision: !0,
  2523. hideFromEnemy: !0,
  2524. health: 500,
  2525. colDiv: 0.2,
  2526. scale: 50,
  2527. holdOffset: 20,
  2528. placeOffset: -5,
  2529. },
  2530. { age: 4, group: j[6], name: "boost pad", desc: "provides boost when stepped on", req: ["stone", 20, "wood", 5], ignoreCollision: !0, boostSpeed: 1.5, health: 150, colDiv: 0.7, scale: 45, holdOffset: 20, placeOffset: -5 },
  2531. {
  2532. age: 7,
  2533. group: j[7],
  2534. doUpdate: !0,
  2535. name: "turret",
  2536. desc: "defensive structure that shoots at enemies",
  2537. req: ["wood", 200, "stone", 150],
  2538. health: 800,
  2539. projectile: 1,
  2540. shootRange: 700,
  2541. shootRate: 2200,
  2542. scale: 43,
  2543. holdOffset: 20,
  2544. placeOffset: -5,
  2545. },
  2546. { age: 7, group: j[8], name: "platform", desc: "platform to shoot over walls and cross over water", req: ["wood", 20], ignoreCollision: !0, zIndex: 1, health: 300, scale: 43, holdOffset: 20, placeOffset: -5 },
  2547. { age: 7, group: j[9], name: "healing pad", desc: "standing on it will slowly heal you", req: ["wood", 30, "food", 10], ignoreCollision: !0, healCol: 15, health: 400, colDiv: 0.7, scale: 45, holdOffset: 20, placeOffset: -5 },
  2548. {
  2549. age: 9,
  2550. group: j[10],
  2551. name: "spawn pad",
  2552. desc: "you will spawn here when you die but it will dissapear",
  2553. req: ["wood", 100, "stone", 100],
  2554. health: 400,
  2555. ignoreCollision: !0,
  2556. spawnPoint: !0,
  2557. scale: 45,
  2558. holdOffset: 20,
  2559. placeOffset: -5,
  2560. },
  2561. { age: 7, group: j[12], name: "blocker", desc: "blocks building in radius", req: ["wood", 30, "stone", 25], ignoreCollision: !0, blocker: 300, health: 400, colDiv: 0.7, scale: 45, holdOffset: 20, placeOffset: -5 },
  2562. {
  2563. age: 7,
  2564. group: j[13],
  2565. name: "teleporter",
  2566. desc: "teleports you to a random point on the map",
  2567. req: ["wood", 60, "stone", 60],
  2568. ignoreCollision: !0,
  2569. teleport: !0,
  2570. health: 200,
  2571. colDiv: 0.7,
  2572. scale: 45,
  2573. holdOffset: 20,
  2574. placeOffset: -5,
  2575. },
  2576. ];
  2577. for (let e = 0; e < dt.length; ++e) (dt[e].id = e), dt[e].pre && (dt[e].pre = e - dt[e].pre);
  2578. const R = { groups: j, projectiles: vc, weapons: xc, list: dt },
  2579. bc = [
  2580. "ahole",
  2581. "anus",
  2582. "ash0le",
  2583. "ash0les",
  2584. "asholes",
  2585. "ass",
  2586. "Ass Monkey",
  2587. "Assface",
  2588. "assh0le",
  2589. "assh0lez",
  2590. "asshole",
  2591. "assholes",
  2592. "assholz",
  2593. "asswipe",
  2594. "azzhole",
  2595. "bassterds",
  2596. "bastard",
  2597. "bastards",
  2598. "bastardz",
  2599. "basterds",
  2600. "basterdz",
  2601. "Biatch",
  2602. "bitch",
  2603. "bitches",
  2604. "Blow Job",
  2605. "boffing",
  2606. "butthole",
  2607. "buttwipe",
  2608. "c0ck",
  2609. "c0cks",
  2610. "c0k",
  2611. "Carpet Muncher",
  2612. "cawk",
  2613. "cawks",
  2614. "Clit",
  2615. "cnts",
  2616. "cntz",
  2617. "cock",
  2618. "cockhead",
  2619. "cock-head",
  2620. "cocks",
  2621. "CockSucker",
  2622. "cock-sucker",
  2623. "crap",
  2624. "cum",
  2625. "cunt",
  2626. "cunts",
  2627. "cuntz",
  2628. "dick",
  2629. "dild0",
  2630. "dild0s",
  2631. "dildo",
  2632. "dildos",
  2633. "dilld0",
  2634. "dilld0s",
  2635. "dominatricks",
  2636. "dominatrics",
  2637. "dominatrix",
  2638. "dyke",
  2639. "enema",
  2640. "f u c k",
  2641. "f u c k e r",
  2642. "fag",
  2643. "fag1t",
  2644. "faget",
  2645. "fagg1t",
  2646. "faggit",
  2647. "faggot",
  2648. "fagg0t",
  2649. "fagit",
  2650. "fags",
  2651. "fagz",
  2652. "faig",
  2653. "faigs",
  2654. "fart",
  2655. "flipping the bird",
  2656. "fuck",
  2657. "fucker",
  2658. "fuckin",
  2659. "fucking",
  2660. "fucks",
  2661. "Fudge Packer",
  2662. "fuk",
  2663. "Fukah",
  2664. "Fuken",
  2665. "fuker",
  2666. "Fukin",
  2667. "Fukk",
  2668. "Fukkah",
  2669. "Fukken",
  2670. "Fukker",
  2671. "Fukkin",
  2672. "g00k",
  2673. "God-damned",
  2674. "h00r",
  2675. "h0ar",
  2676. "h0re",
  2677. "hells",
  2678. "hoar",
  2679. "hoor",
  2680. "hoore",
  2681. "jackoff",
  2682. "jap",
  2683. "japs",
  2684. "jerk-off",
  2685. "jisim",
  2686. "jiss",
  2687. "jizm",
  2688. "jizz",
  2689. "knob",
  2690. "knobs",
  2691. "knobz",
  2692. "kunt",
  2693. "kunts",
  2694. "kuntz",
  2695. "Lezzian",
  2696. "Lipshits",
  2697. "Lipshitz",
  2698. "masochist",
  2699. "masokist",
  2700. "massterbait",
  2701. "masstrbait",
  2702. "masstrbate",
  2703. "masterbaiter",
  2704. "masterbate",
  2705. "masterbates",
  2706. "Motha Fucker",
  2707. "Motha Fuker",
  2708. "Motha Fukkah",
  2709. "Motha Fukker",
  2710. "Mother Fucker",
  2711. "Mother Fukah",
  2712. "Mother Fuker",
  2713. "Mother Fukkah",
  2714. "Mother Fukker",
  2715. "mother-fucker",
  2716. "Mutha Fucker",
  2717. "Mutha Fukah",
  2718. "Mutha Fuker",
  2719. "Mutha Fukkah",
  2720. "Mutha Fukker",
  2721. "n1gr",
  2722. "nastt",
  2723. "nigger;",
  2724. "nigur;",
  2725. "niiger;",
  2726. "niigr;",
  2727. "orafis",
  2728. "orgasim;",
  2729. "orgasm",
  2730. "orgasum",
  2731. "oriface",
  2732. "orifice",
  2733. "orifiss",
  2734. "packi",
  2735. "packie",
  2736. "packy",
  2737. "paki",
  2738. "pakie",
  2739. "paky",
  2740. "pecker",
  2741. "peeenus",
  2742. "peeenusss",
  2743. "peenus",
  2744. "peinus",
  2745. "pen1s",
  2746. "penas",
  2747. "penis",
  2748. "penis-breath",
  2749. "penus",
  2750. "penuus",
  2751. "Phuc",
  2752. "Phuck",
  2753. "Phuk",
  2754. "Phuker",
  2755. "Phukker",
  2756. "polac",
  2757. "polack",
  2758. "polak",
  2759. "Poonani",
  2760. "pr1c",
  2761. "pr1ck",
  2762. "pr1k",
  2763. "pusse",
  2764. "pussee",
  2765. "pussy",
  2766. "puuke",
  2767. "puuker",
  2768. "qweir",
  2769. "recktum",
  2770. "rectum",
  2771. "retard",
  2772. "sadist",
  2773. "scank",
  2774. "schlong",
  2775. "screwing",
  2776. "semen",
  2777. "sex",
  2778. "sexy",
  2779. "Sh!t",
  2780. "sh1t",
  2781. "sh1ter",
  2782. "sh1ts",
  2783. "sh1tter",
  2784. "sh1tz",
  2785. "shit",
  2786. "shits",
  2787. "shitter",
  2788. "Shitty",
  2789. "Shity",
  2790. "shitz",
  2791. "Shyt",
  2792. "Shyte",
  2793. "Shytty",
  2794. "Shyty",
  2795. "skanck",
  2796. "skank",
  2797. "skankee",
  2798. "skankey",
  2799. "skanks",
  2800. "Skanky",
  2801. "slag",
  2802. "slut",
  2803. "sluts",
  2804. "Slutty",
  2805. "slutz",
  2806. "son-of-a-bitch",
  2807. "tit",
  2808. "turd",
  2809. "va1jina",
  2810. "vag1na",
  2811. "vagiina",
  2812. "vagina",
  2813. "vaj1na",
  2814. "vajina",
  2815. "vullva",
  2816. "vulva",
  2817. "w0p",
  2818. "wh00r",
  2819. "wh0re",
  2820. "whore",
  2821. "xrated",
  2822. "xxx",
  2823. "b!+ch",
  2824. "bitch",
  2825. "blowjob",
  2826. "clit",
  2827. "arschloch",
  2828. "fuck",
  2829. "shit",
  2830. "ass",
  2831. "asshole",
  2832. "b!tch",
  2833. "b17ch",
  2834. "b1tch",
  2835. "bastard",
  2836. "bi+ch",
  2837. "boiolas",
  2838. "buceta",
  2839. "c0ck",
  2840. "cawk",
  2841. "chink",
  2842. "cipa",
  2843. "clits",
  2844. "cock",
  2845. "cum",
  2846. "cunt",
  2847. "dildo",
  2848. "dirsa",
  2849. "ejakulate",
  2850. "fatass",
  2851. "fcuk",
  2852. "fuk",
  2853. "fux0r",
  2854. "hoer",
  2855. "hore",
  2856. "jism",
  2857. "kawk",
  2858. "l3itch",
  2859. "l3i+ch",
  2860. "masturbate",
  2861. "masterbat*",
  2862. "masterbat3",
  2863. "motherfucker",
  2864. "s.o.b.",
  2865. "mofo",
  2866. "nazi",
  2867. "nigga",
  2868. "nigger",
  2869. "nutsack",
  2870. "phuck",
  2871. "pimpis",
  2872. "pusse",
  2873. "pussy",
  2874. "scrotum",
  2875. "sh!t",
  2876. "shemale",
  2877. "shi+",
  2878. "sh!+",
  2879. "slut",
  2880. "smut",
  2881. "teets",
  2882. "tits",
  2883. "boobs",
  2884. "b00bs",
  2885. "teez",
  2886. "testical",
  2887. "testicle",
  2888. "titt",
  2889. "w00se",
  2890. "jackoff",
  2891. "wank",
  2892. "whoar",
  2893. "whore",
  2894. "*damn",
  2895. "*dyke",
  2896. "*fuck*",
  2897. "*shit*",
  2898. "@$$",
  2899. "amcik",
  2900. "andskota",
  2901. "arse*",
  2902. "assrammer",
  2903. "ayir",
  2904. "bi7ch",
  2905. "bitch*",
  2906. "bollock*",
  2907. "breasts",
  2908. "butt-pirate",
  2909. "cabron",
  2910. "cazzo",
  2911. "chraa",
  2912. "chuj",
  2913. "Cock*",
  2914. "cunt*",
  2915. "d4mn",
  2916. "daygo",
  2917. "dego",
  2918. "dick*",
  2919. "dike*",
  2920. "dupa",
  2921. "dziwka",
  2922. "ejackulate",
  2923. "Ekrem*",
  2924. "Ekto",
  2925. "enculer",
  2926. "faen",
  2927. "fag*",
  2928. "fanculo",
  2929. "fanny",
  2930. "feces",
  2931. "feg",
  2932. "Felcher",
  2933. "ficken",
  2934. "fitt*",
  2935. "Flikker",
  2936. "foreskin",
  2937. "Fotze",
  2938. "Fu(*",
  2939. "fuk*",
  2940. "futkretzn",
  2941. "gook",
  2942. "guiena",
  2943. "h0r",
  2944. "h4x0r",
  2945. "hell",
  2946. "helvete",
  2947. "hoer*",
  2948. "honkey",
  2949. "Huevon",
  2950. "hui",
  2951. "injun",
  2952. "jizz",
  2953. "kanker*",
  2954. "kike",
  2955. "klootzak",
  2956. "kraut",
  2957. "knulle",
  2958. "kuk",
  2959. "kuksuger",
  2960. "Kurac",
  2961. "kurwa",
  2962. "kusi*",
  2963. "kyrpa*",
  2964. "lesbo",
  2965. "mamhoon",
  2966. "masturbat*",
  2967. "merd*",
  2968. "mibun",
  2969. "monkleigh",
  2970. "mouliewop",
  2971. "muie",
  2972. "mulkku",
  2973. "muschi",
  2974. "nazis",
  2975. "nepesaurio",
  2976. "nigger*",
  2977. "orospu",
  2978. "paska*",
  2979. "perse",
  2980. "picka",
  2981. "pierdol*",
  2982. "pillu*",
  2983. "pimmel",
  2984. "piss*",
  2985. "pizda",
  2986. "poontsee",
  2987. "poop",
  2988. "porn",
  2989. "p0rn",
  2990. "pr0n",
  2991. "preteen",
  2992. "pula",
  2993. "pule",
  2994. "puta",
  2995. "puto",
  2996. "qahbeh",
  2997. "queef*",
  2998. "rautenberg",
  2999. "schaffer",
  3000. "scheiss*",
  3001. "schlampe",
  3002. "schmuck",
  3003. "screw",
  3004. "sh!t*",
  3005. "sharmuta",
  3006. "sharmute",
  3007. "shipal",
  3008. "shiz",
  3009. "skribz",
  3010. "skurwysyn",
  3011. "sphencter",
  3012. "spic",
  3013. "spierdalaj",
  3014. "splooge",
  3015. "suka",
  3016. "b00b*",
  3017. "testicle*",
  3018. "titt*",
  3019. "twat",
  3020. "vittu",
  3021. "wank*",
  3022. "wetback*",
  3023. "wichser",
  3024. "wop*",
  3025. "yed",
  3026. "zabourah",
  3027. ],
  3028. Sc = { words: bc };
  3029. var Tc = {
  3030. "4r5e": 1,
  3031. "5h1t": 1,
  3032. "5hit": 1,
  3033. a55: 1,
  3034. anal: 1,
  3035. anus: 1,
  3036. ar5e: 1,
  3037. arrse: 1,
  3038. arse: 1,
  3039. ass: 1,
  3040. "ass-fucker": 1,
  3041. asses: 1,
  3042. assfucker: 1,
  3043. assfukka: 1,
  3044. asshole: 1,
  3045. assholes: 1,
  3046. asswhole: 1,
  3047. a_s_s: 1,
  3048. "b!tch": 1,
  3049. b00bs: 1,
  3050. b17ch: 1,
  3051. b1tch: 1,
  3052. ballbag: 1,
  3053. balls: 1,
  3054. ballsack: 1,
  3055. bastard: 1,
  3056. beastial: 1,
  3057. beastiality: 1,
  3058. bellend: 1,
  3059. bestial: 1,
  3060. bestiality: 1,
  3061. "bi+ch": 1,
  3062. biatch: 1,
  3063. bitch: 1,
  3064. bitcher: 1,
  3065. bitchers: 1,
  3066. bitches: 1,
  3067. bitchin: 1,
  3068. bitching: 1,
  3069. bloody: 1,
  3070. "blow job": 1,
  3071. blowjob: 1,
  3072. blowjobs: 1,
  3073. boiolas: 1,
  3074. bollock: 1,
  3075. bollok: 1,
  3076. boner: 1,
  3077. boob: 1,
  3078. boobs: 1,
  3079. booobs: 1,
  3080. boooobs: 1,
  3081. booooobs: 1,
  3082. booooooobs: 1,
  3083. breasts: 1,
  3084. buceta: 1,
  3085. bugger: 1,
  3086. bum: 1,
  3087. "bunny fucker": 1,
  3088. butt: 1,
  3089. butthole: 1,
  3090. buttmuch: 1,
  3091. buttplug: 1,
  3092. c0ck: 1,
  3093. c0cksucker: 1,
  3094. "carpet muncher": 1,
  3095. cawk: 1,
  3096. chink: 1,
  3097. cipa: 1,
  3098. cl1t: 1,
  3099. clit: 1,
  3100. clitoris: 1,
  3101. clits: 1,
  3102. cnut: 1,
  3103. cock: 1,
  3104. "cock-sucker": 1,
  3105. cockface: 1,
  3106. cockhead: 1,
  3107. cockmunch: 1,
  3108. cockmuncher: 1,
  3109. cocks: 1,
  3110. cocksuck: 1,
  3111. cocksucked: 1,
  3112. cocksucker: 1,
  3113. cocksucking: 1,
  3114. cocksucks: 1,
  3115. cocksuka: 1,
  3116. cocksukka: 1,
  3117. cok: 1,
  3118. cokmuncher: 1,
  3119. coksucka: 1,
  3120. coon: 1,
  3121. cox: 1,
  3122. crap: 1,
  3123. cum: 1,
  3124. cummer: 1,
  3125. cumming: 1,
  3126. cums: 1,
  3127. cumshot: 1,
  3128. cunilingus: 1,
  3129. cunillingus: 1,
  3130. cunnilingus: 1,
  3131. cunt: 1,
  3132. cuntlick: 1,
  3133. cuntlicker: 1,
  3134. cuntlicking: 1,
  3135. cunts: 1,
  3136. cyalis: 1,
  3137. cyberfuc: 1,
  3138. cyberfuck: 1,
  3139. cyberfucked: 1,
  3140. cyberfucker: 1,
  3141. cyberfuckers: 1,
  3142. cyberfucking: 1,
  3143. d1ck: 1,
  3144. damn: 1,
  3145. dick: 1,
  3146. dickhead: 1,
  3147. dildo: 1,
  3148. dildos: 1,
  3149. dink: 1,
  3150. dinks: 1,
  3151. dirsa: 1,
  3152. dlck: 1,
  3153. "dog-fucker": 1,
  3154. doggin: 1,
  3155. dogging: 1,
  3156. donkeyribber: 1,
  3157. doosh: 1,
  3158. duche: 1,
  3159. dyke: 1,
  3160. ejaculate: 1,
  3161. ejaculated: 1,
  3162. ejaculates: 1,
  3163. ejaculating: 1,
  3164. ejaculatings: 1,
  3165. ejaculation: 1,
  3166. ejakulate: 1,
  3167. "f u c k": 1,
  3168. "f u c k e r": 1,
  3169. f4nny: 1,
  3170. fag: 1,
  3171. fagging: 1,
  3172. faggitt: 1,
  3173. faggot: 1,
  3174. faggs: 1,
  3175. fagot: 1,
  3176. fagots: 1,
  3177. fags: 1,
  3178. fanny: 1,
  3179. fannyflaps: 1,
  3180. fannyfucker: 1,
  3181. fanyy: 1,
  3182. fatass: 1,
  3183. fcuk: 1,
  3184. fcuker: 1,
  3185. fcuking: 1,
  3186. feck: 1,
  3187. fecker: 1,
  3188. felching: 1,
  3189. fellate: 1,
  3190. fellatio: 1,
  3191. fingerfuck: 1,
  3192. fingerfucked: 1,
  3193. fingerfucker: 1,
  3194. fingerfuckers: 1,
  3195. fingerfucking: 1,
  3196. fingerfucks: 1,
  3197. fistfuck: 1,
  3198. fistfucked: 1,
  3199. fistfucker: 1,
  3200. fistfuckers: 1,
  3201. fistfucking: 1,
  3202. fistfuckings: 1,
  3203. fistfucks: 1,
  3204. flange: 1,
  3205. fook: 1,
  3206. fooker: 1,
  3207. fuck: 1,
  3208. fucka: 1,
  3209. fucked: 1,
  3210. fucker: 1,
  3211. fuckers: 1,
  3212. fuckhead: 1,
  3213. fuckheads: 1,
  3214. fuckin: 1,
  3215. fucking: 1,
  3216. fuckings: 1,
  3217. fuckingshitmotherfucker: 1,
  3218. fuckme: 1,
  3219. fucks: 1,
  3220. fuckwhit: 1,
  3221. fuckwit: 1,
  3222. "fudge packer": 1,
  3223. fudgepacker: 1,
  3224. fuk: 1,
  3225. fuker: 1,
  3226. fukker: 1,
  3227. fukkin: 1,
  3228. fuks: 1,
  3229. fukwhit: 1,
  3230. fukwit: 1,
  3231. fux: 1,
  3232. fux0r: 1,
  3233. f_u_c_k: 1,
  3234. gangbang: 1,
  3235. gangbanged: 1,
  3236. gangbangs: 1,
  3237. gaylord: 1,
  3238. gaysex: 1,
  3239. goatse: 1,
  3240. God: 1,
  3241. "god-dam": 1,
  3242. "god-damned": 1,
  3243. goddamn: 1,
  3244. goddamned: 1,
  3245. hardcoresex: 1,
  3246. hell: 1,
  3247. heshe: 1,
  3248. hoar: 1,
  3249. hoare: 1,
  3250. hoer: 1,
  3251. homo: 1,
  3252. hore: 1,
  3253. horniest: 1,
  3254. horny: 1,
  3255. hotsex: 1,
  3256. "jack-off": 1,
  3257. jackoff: 1,
  3258. jap: 1,
  3259. "jerk-off": 1,
  3260. jism: 1,
  3261. jiz: 1,
  3262. jizm: 1,
  3263. jizz: 1,
  3264. kawk: 1,
  3265. knob: 1,
  3266. knobead: 1,
  3267. knobed: 1,
  3268. knobend: 1,
  3269. knobhead: 1,
  3270. knobjocky: 1,
  3271. knobjokey: 1,
  3272. kock: 1,
  3273. kondum: 1,
  3274. kondums: 1,
  3275. kum: 1,
  3276. kummer: 1,
  3277. kumming: 1,
  3278. kums: 1,
  3279. kunilingus: 1,
  3280. "l3i+ch": 1,
  3281. l3itch: 1,
  3282. labia: 1,
  3283. lust: 1,
  3284. lusting: 1,
  3285. m0f0: 1,
  3286. m0fo: 1,
  3287. m45terbate: 1,
  3288. ma5terb8: 1,
  3289. ma5terbate: 1,
  3290. masochist: 1,
  3291. "master-bate": 1,
  3292. masterb8: 1,
  3293. "masterbat*": 1,
  3294. masterbat3: 1,
  3295. masterbate: 1,
  3296. masterbation: 1,
  3297. masterbations: 1,
  3298. masturbate: 1,
  3299. "mo-fo": 1,
  3300. mof0: 1,
  3301. mofo: 1,
  3302. mothafuck: 1,
  3303. mothafucka: 1,
  3304. mothafuckas: 1,
  3305. mothafuckaz: 1,
  3306. mothafucked: 1,
  3307. mothafucker: 1,
  3308. mothafuckers: 1,
  3309. mothafuckin: 1,
  3310. mothafucking: 1,
  3311. mothafuckings: 1,
  3312. mothafucks: 1,
  3313. "mother fucker": 1,
  3314. motherfuck: 1,
  3315. motherfucked: 1,
  3316. motherfucker: 1,
  3317. motherfuckers: 1,
  3318. motherfuckin: 1,
  3319. motherfucking: 1,
  3320. motherfuckings: 1,
  3321. motherfuckka: 1,
  3322. motherfucks: 1,
  3323. muff: 1,
  3324. mutha: 1,
  3325. muthafecker: 1,
  3326. muthafuckker: 1,
  3327. muther: 1,
  3328. mutherfucker: 1,
  3329. n1gga: 1,
  3330. n1gger: 1,
  3331. nazi: 1,
  3332. nigg3r: 1,
  3333. nigg4h: 1,
  3334. nigga: 1,
  3335. niggah: 1,
  3336. niggas: 1,
  3337. niggaz: 1,
  3338. nigger: 1,
  3339. niggers: 1,
  3340. nob: 1,
  3341. "nob jokey": 1,
  3342. nobhead: 1,
  3343. nobjocky: 1,
  3344. nobjokey: 1,
  3345. numbnuts: 1,
  3346. nutsack: 1,
  3347. orgasim: 1,
  3348. orgasims: 1,
  3349. orgasm: 1,
  3350. orgasms: 1,
  3351. p0rn: 1,
  3352. pawn: 1,
  3353. pecker: 1,
  3354. penis: 1,
  3355. penisfucker: 1,
  3356. phonesex: 1,
  3357. phuck: 1,
  3358. phuk: 1,
  3359. phuked: 1,
  3360. phuking: 1,
  3361. phukked: 1,
  3362. phukking: 1,
  3363. phuks: 1,
  3364. phuq: 1,
  3365. pigfucker: 1,
  3366. pimpis: 1,
  3367. piss: 1,
  3368. pissed: 1,
  3369. pisser: 1,
  3370. pissers: 1,
  3371. pisses: 1,
  3372. pissflaps: 1,
  3373. pissin: 1,
  3374. pissing: 1,
  3375. pissoff: 1,
  3376. poop: 1,
  3377. porn: 1,
  3378. porno: 1,
  3379. pornography: 1,
  3380. pornos: 1,
  3381. prick: 1,
  3382. pricks: 1,
  3383. pron: 1,
  3384. pube: 1,
  3385. pusse: 1,
  3386. pussi: 1,
  3387. pussies: 1,
  3388. pussy: 1,
  3389. pussys: 1,
  3390. rectum: 1,
  3391. retard: 1,
  3392. rimjaw: 1,
  3393. rimming: 1,
  3394. "s hit": 1,
  3395. "s.o.b.": 1,
  3396. sadist: 1,
  3397. schlong: 1,
  3398. screwing: 1,
  3399. scroat: 1,
  3400. scrote: 1,
  3401. scrotum: 1,
  3402. semen: 1,
  3403. sex: 1,
  3404. "sh!+": 1,
  3405. "sh!t": 1,
  3406. sh1t: 1,
  3407. shag: 1,
  3408. shagger: 1,
  3409. shaggin: 1,
  3410. shagging: 1,
  3411. shemale: 1,
  3412. "shi+": 1,
  3413. shit: 1,
  3414. shitdick: 1,
  3415. shite: 1,
  3416. shited: 1,
  3417. shitey: 1,
  3418. shitfuck: 1,
  3419. shitfull: 1,
  3420. shithead: 1,
  3421. shiting: 1,
  3422. shitings: 1,
  3423. shits: 1,
  3424. shitted: 1,
  3425. shitter: 1,
  3426. shitters: 1,
  3427. shitting: 1,
  3428. shittings: 1,
  3429. shitty: 1,
  3430. skank: 1,
  3431. slut: 1,
  3432. sluts: 1,
  3433. smegma: 1,
  3434. smut: 1,
  3435. snatch: 1,
  3436. "son-of-a-bitch": 1,
  3437. spac: 1,
  3438. spunk: 1,
  3439. s_h_i_t: 1,
  3440. t1tt1e5: 1,
  3441. t1tties: 1,
  3442. teets: 1,
  3443. teez: 1,
  3444. testical: 1,
  3445. testicle: 1,
  3446. tit: 1,
  3447. titfuck: 1,
  3448. tits: 1,
  3449. titt: 1,
  3450. tittie5: 1,
  3451. tittiefucker: 1,
  3452. titties: 1,
  3453. tittyfuck: 1,
  3454. tittywank: 1,
  3455. titwank: 1,
  3456. tosser: 1,
  3457. turd: 1,
  3458. tw4t: 1,
  3459. twat: 1,
  3460. twathead: 1,
  3461. twatty: 1,
  3462. twunt: 1,
  3463. twunter: 1,
  3464. v14gra: 1,
  3465. v1gra: 1,
  3466. vagina: 1,
  3467. viagra: 1,
  3468. vulva: 1,
  3469. w00se: 1,
  3470. wang: 1,
  3471. wank: 1,
  3472. wanker: 1,
  3473. wanky: 1,
  3474. whoar: 1,
  3475. whore: 1,
  3476. willies: 1,
  3477. willy: 1,
  3478. xrated: 1,
  3479. xxx: 1,
  3480. },
  3481. Ic = [
  3482. "4r5e",
  3483. "5h1t",
  3484. "5hit",
  3485. "a55",
  3486. "anal",
  3487. "anus",
  3488. "ar5e",
  3489. "arrse",
  3490. "arse",
  3491. "ass",
  3492. "ass-fucker",
  3493. "asses",
  3494. "assfucker",
  3495. "assfukka",
  3496. "asshole",
  3497. "assholes",
  3498. "asswhole",
  3499. "a_s_s",
  3500. "b!tch",
  3501. "b00bs",
  3502. "b17ch",
  3503. "b1tch",
  3504. "ballbag",
  3505. "balls",
  3506. "ballsack",
  3507. "bastard",
  3508. "beastial",
  3509. "beastiality",
  3510. "bellend",
  3511. "bestial",
  3512. "bestiality",
  3513. "bi+ch",
  3514. "biatch",
  3515. "bitch",
  3516. "bitcher",
  3517. "bitchers",
  3518. "bitches",
  3519. "bitchin",
  3520. "bitching",
  3521. "bloody",
  3522. "blow job",
  3523. "blowjob",
  3524. "blowjobs",
  3525. "boiolas",
  3526. "bollock",
  3527. "bollok",
  3528. "boner",
  3529. "boob",
  3530. "boobs",
  3531. "booobs",
  3532. "boooobs",
  3533. "booooobs",
  3534. "booooooobs",
  3535. "breasts",
  3536. "buceta",
  3537. "bugger",
  3538. "bum",
  3539. "bunny fucker",
  3540. "butt",
  3541. "butthole",
  3542. "buttmuch",
  3543. "buttplug",
  3544. "c0ck",
  3545. "c0cksucker",
  3546. "carpet muncher",
  3547. "cawk",
  3548. "chink",
  3549. "cipa",
  3550. "cl1t",
  3551. "clit",
  3552. "clitoris",
  3553. "clits",
  3554. "cnut",
  3555. "cock",
  3556. "cock-sucker",
  3557. "cockface",
  3558. "cockhead",
  3559. "cockmunch",
  3560. "cockmuncher",
  3561. "cocks",
  3562. "cocksuck",
  3563. "cocksucked",
  3564. "cocksucker",
  3565. "cocksucking",
  3566. "cocksucks",
  3567. "cocksuka",
  3568. "cocksukka",
  3569. "cok",
  3570. "cokmuncher",
  3571. "coksucka",
  3572. "coon",
  3573. "cox",
  3574. "crap",
  3575. "cum",
  3576. "cummer",
  3577. "cumming",
  3578. "cums",
  3579. "cumshot",
  3580. "cunilingus",
  3581. "cunillingus",
  3582. "cunnilingus",
  3583. "cunt",
  3584. "cuntlick",
  3585. "cuntlicker",
  3586. "cuntlicking",
  3587. "cunts",
  3588. "cyalis",
  3589. "cyberfuc",
  3590. "cyberfuck",
  3591. "cyberfucked",
  3592. "cyberfucker",
  3593. "cyberfuckers",
  3594. "cyberfucking",
  3595. "d1ck",
  3596. "damn",
  3597. "dick",
  3598. "dickhead",
  3599. "dildo",
  3600. "dildos",
  3601. "dink",
  3602. "dinks",
  3603. "dirsa",
  3604. "dlck",
  3605. "dog-fucker",
  3606. "doggin",
  3607. "dogging",
  3608. "donkeyribber",
  3609. "doosh",
  3610. "duche",
  3611. "dyke",
  3612. "ejaculate",
  3613. "ejaculated",
  3614. "ejaculates",
  3615. "ejaculating",
  3616. "ejaculatings",
  3617. "ejaculation",
  3618. "ejakulate",
  3619. "f u c k",
  3620. "f u c k e r",
  3621. "f4nny",
  3622. "fag",
  3623. "fagging",
  3624. "faggitt",
  3625. "faggot",
  3626. "faggs",
  3627. "fagot",
  3628. "fagots",
  3629. "fags",
  3630. "fanny",
  3631. "fannyflaps",
  3632. "fannyfucker",
  3633. "fanyy",
  3634. "fatass",
  3635. "fcuk",
  3636. "fcuker",
  3637. "fcuking",
  3638. "feck",
  3639. "fecker",
  3640. "felching",
  3641. "fellate",
  3642. "fellatio",
  3643. "fingerfuck",
  3644. "fingerfucked",
  3645. "fingerfucker",
  3646. "fingerfuckers",
  3647. "fingerfucking",
  3648. "fingerfucks",
  3649. "fistfuck",
  3650. "fistfucked",
  3651. "fistfucker",
  3652. "fistfuckers",
  3653. "fistfucking",
  3654. "fistfuckings",
  3655. "fistfucks",
  3656. "flange",
  3657. "fook",
  3658. "fooker",
  3659. "fuck",
  3660. "fucka",
  3661. "fucked",
  3662. "fucker",
  3663. "fuckers",
  3664. "fuckhead",
  3665. "fuckheads",
  3666. "fuckin",
  3667. "fucking",
  3668. "fuckings",
  3669. "fuckingshitmotherfucker",
  3670. "fuckme",
  3671. "fucks",
  3672. "fuckwhit",
  3673. "fuckwit",
  3674. "fudge packer",
  3675. "fudgepacker",
  3676. "fuk",
  3677. "fuker",
  3678. "fukker",
  3679. "fukkin",
  3680. "fuks",
  3681. "fukwhit",
  3682. "fukwit",
  3683. "fux",
  3684. "fux0r",
  3685. "f_u_c_k",
  3686. "gangbang",
  3687. "gangbanged",
  3688. "gangbangs",
  3689. "gaylord",
  3690. "gaysex",
  3691. "goatse",
  3692. "God",
  3693. "god-dam",
  3694. "god-damned",
  3695. "goddamn",
  3696. "goddamned",
  3697. "hardcoresex",
  3698. "hell",
  3699. "heshe",
  3700. "hoar",
  3701. "hoare",
  3702. "hoer",
  3703. "homo",
  3704. "hore",
  3705. "horniest",
  3706. "horny",
  3707. "hotsex",
  3708. "jack-off",
  3709. "jackoff",
  3710. "jap",
  3711. "jerk-off",
  3712. "jism",
  3713. "jiz",
  3714. "jizm",
  3715. "jizz",
  3716. "kawk",
  3717. "knob",
  3718. "knobead",
  3719. "knobed",
  3720. "knobend",
  3721. "knobhead",
  3722. "knobjocky",
  3723. "knobjokey",
  3724. "kock",
  3725. "kondum",
  3726. "kondums",
  3727. "kum",
  3728. "kummer",
  3729. "kumming",
  3730. "kums",
  3731. "kunilingus",
  3732. "l3i+ch",
  3733. "l3itch",
  3734. "labia",
  3735. "lust",
  3736. "lusting",
  3737. "m0f0",
  3738. "m0fo",
  3739. "m45terbate",
  3740. "ma5terb8",
  3741. "ma5terbate",
  3742. "masochist",
  3743. "master-bate",
  3744. "masterb8",
  3745. "masterbat*",
  3746. "masterbat3",
  3747. "masterbate",
  3748. "masterbation",
  3749. "masterbations",
  3750. "masturbate",
  3751. "mo-fo",
  3752. "mof0",
  3753. "mofo",
  3754. "mothafuck",
  3755. "mothafucka",
  3756. "mothafuckas",
  3757. "mothafuckaz",
  3758. "mothafucked",
  3759. "mothafucker",
  3760. "mothafuckers",
  3761. "mothafuckin",
  3762. "mothafucking",
  3763. "mothafuckings",
  3764. "mothafucks",
  3765. "mother fucker",
  3766. "motherfuck",
  3767. "motherfucked",
  3768. "motherfucker",
  3769. "motherfuckers",
  3770. "motherfuckin",
  3771. "motherfucking",
  3772. "motherfuckings",
  3773. "motherfuckka",
  3774. "motherfucks",
  3775. "muff",
  3776. "mutha",
  3777. "muthafecker",
  3778. "muthafuckker",
  3779. "muther",
  3780. "mutherfucker",
  3781. "n1gga",
  3782. "n1gger",
  3783. "nazi",
  3784. "nigg3r",
  3785. "nigg4h",
  3786. "nigga",
  3787. "niggah",
  3788. "niggas",
  3789. "niggaz",
  3790. "nigger",
  3791. "niggers",
  3792. "nob",
  3793. "nob jokey",
  3794. "nobhead",
  3795. "nobjocky",
  3796. "nobjokey",
  3797. "numbnuts",
  3798. "nutsack",
  3799. "orgasim",
  3800. "orgasims",
  3801. "orgasm",
  3802. "orgasms",
  3803. "p0rn",
  3804. "pawn",
  3805. "pecker",
  3806. "penis",
  3807. "penisfucker",
  3808. "phonesex",
  3809. "phuck",
  3810. "phuk",
  3811. "phuked",
  3812. "phuking",
  3813. "phukked",
  3814. "phukking",
  3815. "phuks",
  3816. "phuq",
  3817. "pigfucker",
  3818. "pimpis",
  3819. "piss",
  3820. "pissed",
  3821. "pisser",
  3822. "pissers",
  3823. "pisses",
  3824. "pissflaps",
  3825. "pissin",
  3826. "pissing",
  3827. "pissoff",
  3828. "poop",
  3829. "porn",
  3830. "porno",
  3831. "pornography",
  3832. "pornos",
  3833. "prick",
  3834. "pricks",
  3835. "pron",
  3836. "pube",
  3837. "pusse",
  3838. "pussi",
  3839. "pussies",
  3840. "pussy",
  3841. "pussys",
  3842. "rectum",
  3843. "retard",
  3844. "rimjaw",
  3845. "rimming",
  3846. "s hit",
  3847. "s.o.b.",
  3848. "sadist",
  3849. "schlong",
  3850. "screwing",
  3851. "scroat",
  3852. "scrote",
  3853. "scrotum",
  3854. "semen",
  3855. "sex",
  3856. "sh!+",
  3857. "sh!t",
  3858. "sh1t",
  3859. "shag",
  3860. "shagger",
  3861. "shaggin",
  3862. "shagging",
  3863. "shemale",
  3864. "shi+",
  3865. "shit",
  3866. "shitdick",
  3867. "shite",
  3868. "shited",
  3869. "shitey",
  3870. "shitfuck",
  3871. "shitfull",
  3872. "shithead",
  3873. "shiting",
  3874. "shitings",
  3875. "shits",
  3876. "shitted",
  3877. "shitter",
  3878. "shitters",
  3879. "shitting",
  3880. "shittings",
  3881. "shitty",
  3882. "skank",
  3883. "slut",
  3884. "sluts",
  3885. "smegma",
  3886. "smut",
  3887. "snatch",
  3888. "son-of-a-bitch",
  3889. "spac",
  3890. "spunk",
  3891. "s_h_i_t",
  3892. "t1tt1e5",
  3893. "t1tties",
  3894. "teets",
  3895. "teez",
  3896. "testical",
  3897. "testicle",
  3898. "tit",
  3899. "titfuck",
  3900. "tits",
  3901. "titt",
  3902. "tittie5",
  3903. "tittiefucker",
  3904. "titties",
  3905. "tittyfuck",
  3906. "tittywank",
  3907. "titwank",
  3908. "tosser",
  3909. "turd",
  3910. "tw4t",
  3911. "twat",
  3912. "twathead",
  3913. "twatty",
  3914. "twunt",
  3915. "twunter",
  3916. "v14gra",
  3917. "v1gra",
  3918. "vagina",
  3919. "viagra",
  3920. "vulva",
  3921. "w00se",
  3922. "wang",
  3923. "wank",
  3924. "wanker",
  3925. "wanky",
  3926. "whoar",
  3927. "whore",
  3928. "willies",
  3929. "willy",
  3930. "xrated",
  3931. "xxx",
  3932. ],
  3933. Mc = /\b(4r5e|5h1t|5hit|a55|anal|anus|ar5e|arrse|arse|ass|ass-fucker|asses|assfucker|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 fucker|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|cyberfuck|cyberfucked|cyberfucker|cyberfuckers|cyberfucking|d1ck|damn|dick|dickhead|dildo|dildos|dink|dinks|dirsa|dlck|dog-fucker|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|fannyfucker|fanyy|fatass|fcuk|fcuker|fcuking|feck|fecker|felching|fellate|fellatio|fingerfuck|fingerfucked|fingerfucker|fingerfuckers|fingerfucking|fingerfucks|fistfuck|fistfucked|fistfucker|fistfuckers|fistfucking|fistfuckings|fistfucks|flange|fook|fooker|fuck|fucka|fucked|fucker|fuckers|fuckhead|fuckheads|fuckin|fucking|fuckings|fuckingshitmotherfucker|fuckme|fucks|fuckwhit|fuckwit|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|jism|jiz|jizm|jizz|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|mothafuck|mothafucka|mothafuckas|mothafuckaz|mothafucked|mothafucker|mothafuckers|mothafuckin|mothafucking|mothafuckings|mothafucks|mother fucker|motherfuck|motherfucked|motherfucker|motherfuckers|motherfuckin|motherfucking|motherfuckings|motherfuckka|motherfucks|muff|mutha|muthafecker|muthafuckker|muther|mutherfucker|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|penisfucker|phonesex|phuck|phuk|phuked|phuking|phukked|phukking|phuks|phuq|pigfucker|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|shitfuck|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|titfuck|tits|titt|tittie5|tittiefucker|titties|tittyfuck|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,
  3934. Ec = { object: Tc, array: Ic, regex: Mc };
  3935. const Pc = Sc.words,
  3936. Cc = Ec.array;
  3937. class Ac {
  3938. constructor(t = {}) {
  3939. Object.assign(this, {
  3940. list: (t.emptyList && []) || Array.prototype.concat.apply(Pc, [Cc, t.list || []]),
  3941. exclude: t.exclude || [],
  3942. splitRegex: t.splitRegex || /\b/,
  3943. placeHolder: t.placeHolder || "*",
  3944. regex: t.regex || /[^a-zA-Z0-9|\$|\@]|\^/g,
  3945. replaceRegex: t.replaceRegex || /\w/g,
  3946. });
  3947. }
  3948. isProfane(t) {
  3949. return (
  3950. this.list.filter((i) => {
  3951. const s = new RegExp(`\\b${i.replace(/(\W)/g, "\\$1")}\\b`, "gi");
  3952. return !this.exclude.includes(i.toLowerCase()) && s.test(t);
  3953. }).length > 0 || !1
  3954. );
  3955. }
  3956. replaceWord(t) {
  3957. return t.replace(this.regex, "").replace(this.replaceRegex, this.placeHolder);
  3958. }
  3959. clean(t) {
  3960. return t
  3961. .split(this.splitRegex)
  3962. .map((i) => (this.isProfane(i) ? this.replaceWord(i) : i))
  3963. .join(this.splitRegex.exec(t)[0]);
  3964. }
  3965. addWords() {
  3966. let t = Array.from(arguments);
  3967. this.list.push(...t),
  3968. t
  3969. .map((i) => i.toLowerCase())
  3970. .forEach((i) => {
  3971. this.exclude.includes(i) && this.exclude.splice(this.exclude.indexOf(i), 1);
  3972. });
  3973. }
  3974. removeWords() {
  3975. this.exclude.push(...Array.from(arguments).map((t) => t.toLowerCase()));
  3976. }
  3977. }
  3978. var Dc = Ac;
  3979. const Yr = new Dc(),
  3980. Oc = [
  3981. "jew",
  3982. "black",
  3983. "baby",
  3984. "child",
  3985. "white",
  3986. "porn",
  3987. "pedo",
  3988. "trump",
  3989. "clinton",
  3990. "hitler",
  3991. "nazi",
  3992. "gay",
  3993. "pride",
  3994. "sex",
  3995. "pleasure",
  3996. "touch",
  3997. "poo",
  3998. "kids",
  3999. "rape",
  4000. "white power",
  4001. "nigga",
  4002. "nig nog",
  4003. "doggy",
  4004. "rapist",
  4005. "boner",
  4006. "nigger",
  4007. "nigg",
  4008. "finger",
  4009. "nogger",
  4010. "nagger",
  4011. "nig",
  4012. "fag",
  4013. "gai",
  4014. "pole",
  4015. "stripper",
  4016. "penis",
  4017. "vagina",
  4018. "pussy",
  4019. "nazi",
  4020. "hitler",
  4021. "stalin",
  4022. "burn",
  4023. "chamber",
  4024. "cock",
  4025. "peen",
  4026. "dick",
  4027. "spick",
  4028. "nieger",
  4029. "die",
  4030. "satan",
  4031. "n|ig",
  4032. "nlg",
  4033. "cunt",
  4034. "c0ck",
  4035. "fag",
  4036. "lick",
  4037. "condom",
  4038. "anal",
  4039. "shit",
  4040. "phile",
  4041. "little",
  4042. "kids",
  4043. "free KR",
  4044. "tiny",
  4045. "sidney",
  4046. "ass",
  4047. "kill",
  4048. ".io",
  4049. "(dot)",
  4050. "[dot]",
  4051. "mini",
  4052. "whiore",
  4053. "whore",
  4054. "faggot",
  4055. "github",
  4056. "1337",
  4057. "666",
  4058. "satan",
  4059. "senpa",
  4060. "discord",
  4061. "d1scord",
  4062. "mistik",
  4063. ".io",
  4064. "senpa.io",
  4065. "sidney",
  4066. "sid",
  4067. "senpaio",
  4068. "vries",
  4069. "asa",
  4070. ];
  4071. Yr.addWords(...Oc);
  4072. const _s = Math.abs,
  4073. at = Math.cos,
  4074. lt = Math.sin,
  4075. Bs = Math.pow,
  4076. Rc = Math.sqrt;
  4077. function _c(e, t, i, s, n, r, o, l, c, a, u, p, h, m) {
  4078. (this.id = e), (this.sid = t), (this.tmpScore = 0), (this.team = null), (this.skinIndex = 0), (this.tailIndex = 0), (this.hitTime = 0), (this.tails = {});
  4079. for (var w = 0; w < u.length; ++w) u[w].price <= 0 && (this.tails[u[w].id] = 1);
  4080. this.skins = {};
  4081. for (var w = 0; w < a.length; ++w) a[w].price <= 0 && (this.skins[a[w].id] = 1);
  4082. (this.points = 0),
  4083. (this.dt = 0),
  4084. (this.hidden = !1),
  4085. (this.itemCounts = {}),
  4086. (this.isPlayer = !0),
  4087. (this.pps = 0),
  4088. (this.moveDir = void 0),
  4089. (this.skinRot = 0),
  4090. (this.lastPing = 0),
  4091. (this.iconIndex = 0),
  4092. (this.skinColor = 0),
  4093. (this.spawn = function (k) {
  4094. (this.active = !0),
  4095. (this.alive = !0),
  4096. (this.lockMove = !1),
  4097. (this.lockDir = !1),
  4098. (this.minimapCounter = 0),
  4099. (this.chatCountdown = 0),
  4100. (this.shameCount = 0),
  4101. (this.shameTimer = 0),
  4102. (this.sentTo = {}),
  4103. (this.gathering = 0),
  4104. (this.autoGather = 0),
  4105. (this.animTime = 0),
  4106. (this.animSpeed = 0),
  4107. (this.mouseState = 0),
  4108. (this.buildIndex = -1),
  4109. (this.weaponIndex = 0),
  4110. (this.dmgOverTime = {}),
  4111. (this.noMovTimer = 0),
  4112. (this.maxXP = 300),
  4113. (this.XP = 0),
  4114. (this.age = 1),
  4115. (this.kills = 0),
  4116. (this.upgrAge = 2),
  4117. (this.upgradePoints = 0),
  4118. (this.x = 0),
  4119. (this.y = 0),
  4120. (this.zIndex = 0),
  4121. (this.xVel = 0),
  4122. (this.yVel = 0),
  4123. (this.slowMult = 1),
  4124. (this.dir = 0),
  4125. (this.dirPlus = 0),
  4126. (this.targetDir = 0),
  4127. (this.targetAngle = 0),
  4128. (this.maxHealth = 100),
  4129. (this.health = this.maxHealth),
  4130. (this.scale = i.playerScale),
  4131. (this.speed = i.playerSpeed),
  4132. this.resetMoveDir(),
  4133. this.resetResources(k),
  4134. (this.items = [0, 3, 6, 10]),
  4135. (this.weapons = [0]),
  4136. (this.shootCount = 0),
  4137. (this.weaponXP = []),
  4138. (this.reloads = {}),
  4139. (this.timeSpentNearVolcano = 0);
  4140. }),
  4141. (this.resetMoveDir = function () {
  4142. this.moveDir = void 0;
  4143. }),
  4144. (this.resetResources = function (k) {
  4145. for (let S = 0; S < i.resourceTypes.length; ++S) this[i.resourceTypes[S]] = k ? 100 : 0;
  4146. }),
  4147. (this.addItem = function (k) {
  4148. const S = c.list[k];
  4149. if (S) {
  4150. for (let O = 0; O < this.items.length; ++O) if (c.list[this.items[O]].group == S.group) return this.buildIndex == this.items[O] && (this.buildIndex = k), (this.items[O] = k), !0;
  4151. return this.items.push(k), !0;
  4152. }
  4153. return !1;
  4154. }),
  4155. (this.setUserData = function (k) {
  4156. if (k) {
  4157. this.name = "unknown";
  4158. let S = k.name + "";
  4159. (S = S.slice(0, i.maxNameLength)), (S = S.replace(/[^\w:\(\)\/? -]+/gim, " ")), (S = S.replace(/[^\x00-\x7F]/g, " ")), (S = S.trim());
  4160. let O = !1;
  4161. const U = S.toLowerCase().replace(/\s/g, "").replace(/1/g, "i").replace(/0/g, "o").replace(/5/g, "s");
  4162. for (const L of Yr.list)
  4163. if (U.indexOf(L) != -1) {
  4164. O = !0;
  4165. break;
  4166. }
  4167. S.length > 0 && !O && (this.name = S), (this.skinColor = 0), i.skinColors[k.skin] && (this.skinColor = k.skin);
  4168. }
  4169. }),
  4170. (this.getData = function () {
  4171. 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];
  4172. }),
  4173. (this.setData = function (k) {
  4174. (this.id = k[0]), (this.sid = k[1]), (this.name = k[2]), (this.x = k[3]), (this.y = k[4]), (this.dir = k[5]), (this.health = k[6]), (this.maxHealth = k[7]), (this.scale = k[8]), (this.skinColor = k[9]);
  4175. });
  4176. let v = 0;
  4177. (this.update = function (k) {
  4178. if (!this.alive) return;
  4179. if (
  4180. ((s.getDistance(this.x, this.y, i.volcanoLocationX, i.volcanoLocationY) || 0) < i.volcanoAggressionRadius &&
  4181. ((this.timeSpentNearVolcano += k),
  4182. this.timeSpentNearVolcano >= 1e3 && (this.changeHealth(i.volcanoDamagePerSecond, null), p.send(this.id, "8", Math.round(this.x), Math.round(this.y), i.volcanoDamagePerSecond, -1), (this.timeSpentNearVolcano %= 1e3))),
  4183. this.shameTimer > 0 && ((this.shameTimer -= k), this.shameTimer <= 0 && ((this.shameTimer = 0), (this.shameCount = 0))),
  4184. (v -= k),
  4185. v <= 0)
  4186. ) {
  4187. const _ = (this.skin && this.skin.healthRegen ? this.skin.healthRegen : 0) + (this.tail && this.tail.healthRegen ? this.tail.healthRegen : 0);
  4188. _ && this.changeHealth(_, this),
  4189. this.dmgOverTime.dmg && (this.changeHealth(-this.dmgOverTime.dmg, this.dmgOverTime.doer), (this.dmgOverTime.time -= 1), this.dmgOverTime.time <= 0 && (this.dmgOverTime.dmg = 0)),
  4190. this.healCol && this.changeHealth(this.healCol, this),
  4191. (v = 1e3);
  4192. }
  4193. if (!this.alive) return;
  4194. if ((this.slowMult < 1 && ((this.slowMult += 8e-4 * k), this.slowMult > 1 && (this.slowMult = 1)), (this.noMovTimer += k), (this.xVel || this.yVel) && (this.noMovTimer = 0), this.lockMove)) (this.xVel = 0), (this.yVel = 0);
  4195. else {
  4196. let _ =
  4197. (this.buildIndex >= 0 ? 0.5 : 1) *
  4198. (c.weapons[this.weaponIndex].spdMult || 1) *
  4199. ((this.skin && this.skin.spdMult) || 1) *
  4200. ((this.tail && this.tail.spdMult) || 1) *
  4201. (this.y <= i.snowBiomeTop ? (this.skin && this.skin.coldM ? 1 : i.snowSpeed) : 1) *
  4202. this.slowMult;
  4203. !this.zIndex &&
  4204. this.y >= i.mapScale / 2 - i.riverWidth / 2 &&
  4205. this.y <= i.mapScale / 2 + i.riverWidth / 2 &&
  4206. (this.skin && this.skin.watrImm ? ((_ *= 0.75), (this.xVel += i.waterCurrent * 0.4 * k)) : ((_ *= 0.33), (this.xVel += i.waterCurrent * k)));
  4207. let $ = this.moveDir != null ? at(this.moveDir) : 0,
  4208. V = this.moveDir != null ? lt(this.moveDir) : 0;
  4209. const z = Rc($ * $ + V * V);
  4210. z != 0 && (($ /= z), (V /= z)), $ && (this.xVel += $ * this.speed * _ * k), V && (this.yVel += V * this.speed * _ * k);
  4211. }
  4212. (this.zIndex = 0), (this.lockMove = !1), (this.healCol = 0);
  4213. let O;
  4214. const U = s.getDistance(0, 0, this.xVel * k, this.yVel * k),
  4215. L = Math.min(4, Math.max(1, Math.round(U / 40))),
  4216. q = 1 / L;
  4217. let P = {};
  4218. for (var W = 0; W < L; ++W) {
  4219. this.xVel && (this.x += this.xVel * k * q), this.yVel && (this.y += this.yVel * k * q), (O = r.getGridArrays(this.x, this.y, this.scale));
  4220. for (let _ = 0; _ < O.length; ++_) {
  4221. for (let $ = 0; $ < O[_].length && !(O[_][$].active && !P[O[_][$].sid] && r.checkCollision(this, O[_][$], q) && ((P[O[_][$].sid] = !0), !this.alive)); ++$);
  4222. if (!this.alive) break;
  4223. }
  4224. if (!this.alive) break;
  4225. }
  4226. for (var F = o.indexOf(this), W = F + 1; W < o.length; ++W) o[W] != this && o[W].alive && r.checkCollision(this, o[W]);
  4227. if (
  4228. (this.xVel && ((this.xVel *= Bs(i.playerDecel, k)), this.xVel <= 0.01 && this.xVel >= -0.01 && (this.xVel = 0)),
  4229. this.yVel && ((this.yVel *= Bs(i.playerDecel, k)), this.yVel <= 0.01 && this.yVel >= -0.01 && (this.yVel = 0)),
  4230. this.x - this.scale < 0 ? (this.x = this.scale) : this.x + this.scale > i.mapScale && (this.x = i.mapScale - this.scale),
  4231. this.y - this.scale < 0 ? (this.y = this.scale) : this.y + this.scale > i.mapScale && (this.y = i.mapScale - this.scale),
  4232. this.buildIndex < 0)
  4233. ) {
  4234. if (this.reloads[this.weaponIndex] > 0) (this.reloads[this.weaponIndex] -= k), (this.gathering = this.mouseState);
  4235. else if (this.gathering || this.autoGather) {
  4236. let _ = !0;
  4237. if (c.weapons[this.weaponIndex].gather != null) this.gather(o);
  4238. else if (c.weapons[this.weaponIndex].projectile != null && this.hasRes(c.weapons[this.weaponIndex], this.skin ? this.skin.projCost : 0)) {
  4239. this.useRes(c.weapons[this.weaponIndex], this.skin ? this.skin.projCost : 0), (this.noMovTimer = 0);
  4240. var F = c.weapons[this.weaponIndex].projectile;
  4241. const V = this.scale * 2,
  4242. z = this.skin && this.skin.aMlt ? this.skin.aMlt : 1;
  4243. c.weapons[this.weaponIndex].rec && ((this.xVel -= c.weapons[this.weaponIndex].rec * at(this.dir)), (this.yVel -= c.weapons[this.weaponIndex].rec * lt(this.dir))),
  4244. 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);
  4245. } else _ = !1;
  4246. (this.gathering = this.mouseState), _ && (this.reloads[this.weaponIndex] = c.weapons[this.weaponIndex].speed * ((this.skin && this.skin.atkSpd) || 1));
  4247. }
  4248. }
  4249. }),
  4250. (this.addWeaponXP = function (k) {
  4251. this.weaponXP[this.weaponIndex] || (this.weaponXP[this.weaponIndex] = 0), (this.weaponXP[this.weaponIndex] += k);
  4252. }),
  4253. (this.earnXP = function (k) {
  4254. this.age < i.maxAge &&
  4255. ((this.XP += k),
  4256. this.XP >= this.maxXP
  4257. ? (this.age < i.maxAge ? (this.age++, (this.XP = 0), (this.maxXP *= 1.2)) : (this.XP = this.maxXP),
  4258. this.upgradePoints++,
  4259. p.send(this.id, "U", this.upgradePoints, this.upgrAge),
  4260. p.send(this.id, "T", this.XP, s.fixTo(this.maxXP, 1), this.age))
  4261. : p.send(this.id, "T", this.XP));
  4262. }),
  4263. (this.changeHealth = function (k, S) {
  4264. if (k > 0 && this.health >= this.maxHealth) return !1;
  4265. k < 0 && this.skin && (k *= this.skin.dmgMult || 1),
  4266. k < 0 && this.tail && (k *= this.tail.dmgMult || 1),
  4267. k < 0 && (this.hitTime = Date.now()),
  4268. (this.health += k),
  4269. this.health > this.maxHealth && ((k -= this.health - this.maxHealth), (this.health = this.maxHealth)),
  4270. this.health <= 0 && this.kill(S);
  4271. for (let O = 0; O < o.length; ++O) this.sentTo[o[O].id] && p.send(o[O].id, "O", this.sid, this.health);
  4272. 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), !0;
  4273. }),
  4274. (this.kill = function (k) {
  4275. k && k.alive && (k.kills++, 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))), p.send(k.id, "N", "kills", k.kills, 1)),
  4276. (this.alive = !1),
  4277. p.send(this.id, "P"),
  4278. m();
  4279. }),
  4280. (this.addResource = function (k, S, O) {
  4281. !O && S > 0 && this.addWeaponXP(S), k == 3 ? h(this, S, !0) : ((this[i.resourceTypes[k]] += S), p.send(this.id, "N", i.resourceTypes[k], this[i.resourceTypes[k]], 1));
  4282. }),
  4283. (this.changeItemCount = function (k, S) {
  4284. (this.itemCounts[k] = this.itemCounts[k] || 0), (this.itemCounts[k] += S), p.send(this.id, "S", k, this.itemCounts[k]);
  4285. }),
  4286. (this.buildItem = function (k) {
  4287. const S = this.scale + k.scale + (k.placeOffset || 0),
  4288. O = this.x + S * at(this.dir),
  4289. U = this.y + S * lt(this.dir);
  4290. if (this.canBuild(k) && !(k.consume && this.skin && this.skin.noEat) && (k.consume || r.checkItemLocation(O, U, k.scale, 0.6, k.id, !1, this))) {
  4291. let L = !1;
  4292. if (k.consume) {
  4293. if (this.hitTime) {
  4294. const q = Date.now() - this.hitTime;
  4295. (this.hitTime = 0), q <= 120 ? (this.shameCount++, this.shameCount >= 8 && ((this.shameTimer = 3e4), (this.shameCount = 0))) : ((this.shameCount -= 2), this.shameCount <= 0 && (this.shameCount = 0));
  4296. }
  4297. this.shameTimer <= 0 && (L = k.consume(this));
  4298. } else (L = !0), k.group.limit && this.changeItemCount(k.group.id, 1), k.pps && (this.pps += k.pps), r.add(r.objects.length, O, U, this.dir, k.scale, k.type, k, !1, this);
  4299. L && (this.useRes(k), (this.buildIndex = -1));
  4300. }
  4301. }),
  4302. (this.hasRes = function (k, S) {
  4303. for (let O = 0; O < k.req.length; ) {
  4304. if (this[k.req[O]] < Math.round(k.req[O + 1] * (S || 1))) return !1;
  4305. O += 2;
  4306. }
  4307. return !0;
  4308. }),
  4309. (this.useRes = function (k, S) {
  4310. if (!i.inSandbox) for (let O = 0; O < k.req.length; ) this.addResource(i.resourceTypes.indexOf(k.req[O]), -Math.round(k.req[O + 1] * (S || 1))), (O += 2);
  4311. }),
  4312. (this.canBuild = function (k) {
  4313. const S = i.inSandbox ? k.group.sandboxLimit || Math.max(k.group.limit * 3, 99) : k.group.limit;
  4314. return S && this.itemCounts[k.group.id] >= S ? !1 : i.inSandbox ? !0 : this.hasRes(k);
  4315. }),
  4316. (this.gather = function () {
  4317. (this.noMovTimer = 0), (this.slowMult -= c.weapons[this.weaponIndex].hitSlow || 0.3), this.slowMult < 0 && (this.slowMult = 0);
  4318. const k = i.fetchVariant(this),
  4319. S = k.poison,
  4320. O = k.val,
  4321. U = {};
  4322. let L, q, P, W;
  4323. const F = r.getGridArrays(this.x, this.y, c.weapons[this.weaponIndex].range);
  4324. for (let $ = 0; $ < F.length; ++$)
  4325. for (var _ = 0; _ < F[$].length; ++_)
  4326. if (
  4327. ((P = F[$][_]),
  4328. P.active &&
  4329. !P.dontGather &&
  4330. !U[P.sid] &&
  4331. P.visibleToPlayer(this) &&
  4332. ((L = s.getDistance(this.x, this.y, P.x, P.y) - P.scale), L <= c.weapons[this.weaponIndex].range && ((q = s.getDirection(P.x, P.y, this.x, this.y)), s.getAngleDist(q, this.dir) <= i.gatherAngle)))
  4333. ) {
  4334. if (((U[P.sid] = 1), P.health)) {
  4335. 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)) {
  4336. for (let V = 0; V < P.req.length; ) this.addResource(i.resourceTypes.indexOf(P.req[V]), P.req[V + 1]), (V += 2);
  4337. r.disableObj(P);
  4338. }
  4339. } else {
  4340. if (P.name === "volcano") this.hitVolcano(c.weapons[this.weaponIndex].gather);
  4341. else {
  4342. this.earnXP(4 * c.weapons[this.weaponIndex].gather);
  4343. const V = c.weapons[this.weaponIndex].gather + (P.type == 3 ? 4 : 0);
  4344. this.addResource(P.type, V);
  4345. }
  4346. this.skin && this.skin.extraGold && this.addResource(3, 1);
  4347. }
  4348. (W = !0), r.hitObj(P, q);
  4349. }
  4350. for (var _ = 0; _ < o.length + l.length; ++_)
  4351. if (
  4352. ((P = o[_] || l[_ - o.length]),
  4353. P != this &&
  4354. P.alive &&
  4355. !(P.team && P.team == this.team) &&
  4356. ((L = s.getDistance(this.x, this.y, P.x, P.y) - P.scale * 1.8), L <= c.weapons[this.weaponIndex].range && ((q = s.getDirection(P.x, P.y, this.x, this.y)), s.getAngleDist(q, this.dir) <= i.gatherAngle)))
  4357. ) {
  4358. let V = c.weapons[this.weaponIndex].steal;
  4359. V && P.addResource && ((V = Math.min(P.points || 0, V)), this.addResource(3, V), P.addResource(3, -V));
  4360. let z = O;
  4361. P.weaponIndex != null && c.weapons[P.weaponIndex].shield && s.getAngleDist(q + Math.PI, P.dir) <= i.shieldAngle && (z = c.weapons[P.weaponIndex].shield);
  4362. const X = c.weapons[this.weaponIndex].dmg,
  4363. G = X * (this.skin && this.skin.dmgMultO ? this.skin.dmgMultO : 1) * (this.tail && this.tail.dmgMultO ? this.tail.dmgMultO : 1),
  4364. te = 0.3 * (P.weightM || 1) + (c.weapons[this.weaponIndex].knock || 0);
  4365. (P.xVel += te * at(q)),
  4366. (P.yVel += te * lt(q)),
  4367. this.skin && this.skin.healD && this.changeHealth(G * z * this.skin.healD, this),
  4368. this.tail && this.tail.healD && this.changeHealth(G * z * this.tail.healD, this),
  4369. P.skin && P.skin.dmg && this.changeHealth(-X * P.skin.dmg, P),
  4370. P.tail && P.tail.dmg && this.changeHealth(-X * P.tail.dmg, P),
  4371. P.dmgOverTime && this.skin && this.skin.poisonDmg && !(P.skin && P.skin.poisonRes) && ((P.dmgOverTime.dmg = this.skin.poisonDmg), (P.dmgOverTime.time = this.skin.poisonTime || 1), (P.dmgOverTime.doer = this)),
  4372. P.dmgOverTime && S && !(P.skin && P.skin.poisonRes) && ((P.dmgOverTime.dmg = 5), (P.dmgOverTime.time = 5), (P.dmgOverTime.doer = this)),
  4373. P.skin && P.skin.dmgK && ((this.xVel -= P.skin.dmgK * at(q)), (this.yVel -= P.skin.dmgK * lt(q))),
  4374. P.changeHealth(-G * z, this, this);
  4375. }
  4376. this.sendAnimation(W ? 1 : 0);
  4377. }),
  4378. (this.hitVolcano = function (k) {
  4379. const S = 5 + Math.round(k / 3.5);
  4380. this.addResource(2, S), this.addResource(3, S);
  4381. }),
  4382. (this.sendAnimation = function (k) {
  4383. for (let S = 0; S < o.length; ++S) this.sentTo[o[S].id] && this.canSee(o[S]) && p.send(o[S].id, "K", this.sid, k ? 1 : 0, this.weaponIndex);
  4384. });
  4385. let x = 0,
  4386. D = 0;
  4387. (this.animate = function (k) {
  4388. this.animTime > 0 &&
  4389. ((this.animTime -= k),
  4390. this.animTime <= 0
  4391. ? ((this.animTime = 0), (this.dirPlus = 0), (x = 0), (D = 0))
  4392. : D == 0
  4393. ? ((x += k / (this.animSpeed * i.hitReturnRatio)), (this.dirPlus = s.lerp(0, this.targetAngle, Math.min(1, x))), x >= 1 && ((x = 1), (D = 1)))
  4394. : ((x -= k / (this.animSpeed * (1 - i.hitReturnRatio))), (this.dirPlus = s.lerp(0, this.targetAngle, Math.max(0, x)))));
  4395. }),
  4396. (this.startAnim = function (k, S) {
  4397. (this.animTime = this.animSpeed = c.weapons[S].speed), (this.targetAngle = k ? -i.hitAngle : -Math.PI), (x = 0), (D = 0);
  4398. }),
  4399. (this.canSee = function (k) {
  4400. if (!k || (k.skin && k.skin.invisTimer && k.noMovTimer >= k.skin.invisTimer)) return !1;
  4401. const S = _s(k.x - this.x) - k.scale,
  4402. O = _s(k.y - this.y) - k.scale;
  4403. return S <= (i.maxScreenWidth / 2) * 1.3 && O <= (i.maxScreenHeight / 2) * 1.3;
  4404. });
  4405. }
  4406. const Bc = [
  4407. { id: 45, name: "Shame!", dontSell: !0, price: 0, scale: 120, desc: "hacks are for losers" },
  4408. { id: 51, name: "Moo Cap", price: 0, scale: 120, desc: "coolest mooer around" },
  4409. { id: 50, name: "Apple Cap", price: 0, scale: 120, desc: "apple farms remembers" },
  4410. { id: 28, name: "Moo Head", price: 0, scale: 120, desc: "no effect" },
  4411. { id: 29, name: "Pig Head", price: 0, scale: 120, desc: "no effect" },
  4412. { id: 30, name: "Fluff Head", price: 0, scale: 120, desc: "no effect" },
  4413. { id: 36, name: "Pandou Head", price: 0, scale: 120, desc: "no effect" },
  4414. { id: 37, name: "Bear Head", price: 0, scale: 120, desc: "no effect" },
  4415. { id: 38, name: "Monkey Head", price: 0, scale: 120, desc: "no effect" },
  4416. { id: 44, name: "Polar Head", price: 0, scale: 120, desc: "no effect" },
  4417. { id: 35, name: "Fez Hat", price: 0, scale: 120, desc: "no effect" },
  4418. { id: 42, name: "Enigma Hat", price: 0, scale: 120, desc: "join the enigma army" },
  4419. { id: 43, name: "Blitz Hat", price: 0, scale: 120, desc: "hey everybody i'm blitz" },
  4420. { id: 49, name: "Bob XIII Hat", price: 0, scale: 120, desc: "like and subscribe" },
  4421. { id: 57, name: "Pumpkin", price: 50, scale: 120, desc: "Spooooky" },
  4422. { id: 8, name: "Bummle Hat", price: 100, scale: 120, desc: "no effect" },
  4423. { id: 2, name: "Straw Hat", price: 500, scale: 120, desc: "no effect" },
  4424. { id: 15, name: "Winter Cap", price: 600, scale: 120, desc: "allows you to move at normal speed in snow", coldM: 1 },
  4425. { id: 5, name: "Cowboy Hat", price: 1e3, scale: 120, desc: "no effect" },
  4426. { id: 4, name: "Ranger Hat", price: 2e3, scale: 120, desc: "no effect" },
  4427. { id: 18, name: "Explorer Hat", price: 2e3, scale: 120, desc: "no effect" },
  4428. { id: 31, name: "Flipper Hat", price: 2500, scale: 120, desc: "have more control while in water", watrImm: !0 },
  4429. { id: 1, name: "Marksman Cap", price: 3e3, scale: 120, desc: "increases arrow speed and range", aMlt: 1.3 },
  4430. { id: 10, name: "Bush Gear", price: 3e3, scale: 160, desc: "allows you to disguise yourself as a bush" },
  4431. { id: 48, name: "Halo", price: 3e3, scale: 120, desc: "no effect" },
  4432. { id: 6, name: "Soldier Helmet", price: 4e3, scale: 120, desc: "reduces damage taken but slows movement", spdMult: 0.94, dmgMult: 0.75 },
  4433. { id: 23, name: "Anti Venom Gear", price: 4e3, scale: 120, desc: "makes you immune to poison", poisonRes: 1 },
  4434. { id: 13, name: "Medic Gear", price: 5e3, scale: 110, desc: "slowly regenerates health over time", healthRegen: 3 },
  4435. { id: 9, name: "Miners Helmet", price: 5e3, scale: 120, desc: "earn 1 extra gold per resource", extraGold: 1 },
  4436. { id: 32, name: "Musketeer Hat", price: 5e3, scale: 120, desc: "reduces cost of projectiles", projCost: 0.5 },
  4437. { id: 7, name: "Bull Helmet", price: 6e3, scale: 120, desc: "increases damage done but drains health", healthRegen: -5, dmgMultO: 1.5, spdMult: 0.96 },
  4438. { id: 22, name: "Emp Helmet", price: 6e3, scale: 120, desc: "turrets won't attack but you move slower", antiTurret: 1, spdMult: 0.7 },
  4439. { id: 12, name: "Booster Hat", price: 6e3, scale: 120, desc: "increases your movement speed", spdMult: 1.16 },
  4440. { id: 26, name: "Barbarian Armor", price: 8e3, scale: 120, desc: "knocks back enemies that attack you", dmgK: 0.6 },
  4441. { id: 21, name: "Plague Mask", price: 1e4, scale: 120, desc: "melee attacks deal poison damage", poisonDmg: 5, poisonTime: 6 },
  4442. { id: 46, name: "Bull Mask", price: 1e4, scale: 120, desc: "bulls won't target you unless you attack them", bullRepel: 1 },
  4443. { id: 14, name: "Windmill Hat", topSprite: !0, price: 1e4, scale: 120, desc: "generates points while worn", pps: 1.5 },
  4444. { id: 11, name: "Spike Gear", topSprite: !0, price: 1e4, scale: 120, desc: "deal damage to players that damage you", dmg: 0.45 },
  4445. { id: 53, name: "Turret Gear", topSprite: !0, price: 1e4, scale: 120, desc: "you become a walking turret", turret: { proj: 1, range: 700, rate: 2500 }, spdMult: 0.7 },
  4446. { id: 20, name: "Samurai Armor", price: 12e3, scale: 120, desc: "increased attack speed and fire rate", atkSpd: 0.78 },
  4447. { id: 58, name: "Dark Knight", price: 12e3, scale: 120, desc: "restores health when you deal damage", healD: 0.4 },
  4448. { id: 27, name: "Scavenger Gear", price: 15e3, scale: 120, desc: "earn double points for each kill", kScrM: 2 },
  4449. { id: 40, name: "Tank Gear", price: 15e3, scale: 120, desc: "increased damage to buildings but slower movement", spdMult: 0.3, bDmg: 3.3 },
  4450. { id: 52, name: "Thief Gear", price: 15e3, scale: 120, desc: "steal half of a players gold when you kill them", goldSteal: 0.5 },
  4451. { id: 55, name: "Bloodthirster", price: 2e4, scale: 120, desc: "Restore Health when dealing damage. And increased damage", healD: 0.25, dmgMultO: 1.2 },
  4452. { id: 56, name: "Assassin Gear", price: 2e4, scale: 120, desc: "Go invisible when not moving. Can't eat. Increased speed", noEat: !0, spdMult: 1.1, invisTimer: 1e3 },
  4453. ],
  4454. zc = [
  4455. { id: 12, name: "Snowball", price: 1e3, scale: 105, xOff: 18, desc: "no effect" },
  4456. { id: 9, name: "Tree Cape", price: 1e3, scale: 90, desc: "no effect" },
  4457. { id: 10, name: "Stone Cape", price: 1e3, scale: 90, desc: "no effect" },
  4458. { id: 3, name: "Cookie Cape", price: 1500, scale: 90, desc: "no effect" },
  4459. { id: 8, name: "Cow Cape", price: 2e3, scale: 90, desc: "no effect" },
  4460. { id: 11, name: "Monkey Tail", price: 2e3, scale: 97, xOff: 25, desc: "Super speed but reduced damage", spdMult: 1.35, dmgMultO: 0.2 },
  4461. { id: 17, name: "Apple Basket", price: 3e3, scale: 80, xOff: 12, desc: "slowly regenerates health over time", healthRegen: 1 },
  4462. { id: 6, name: "Winter Cape", price: 3e3, scale: 90, desc: "no effect" },
  4463. { id: 4, name: "Skull Cape", price: 4e3, scale: 90, desc: "no effect" },
  4464. { id: 5, name: "Dash Cape", price: 5e3, scale: 90, desc: "no effect" },
  4465. { id: 2, name: "Dragon Cape", price: 6e3, scale: 90, desc: "no effect" },
  4466. { id: 1, name: "Super Cape", price: 8e3, scale: 90, desc: "no effect" },
  4467. { id: 7, name: "Troll Cape", price: 8e3, scale: 90, desc: "no effect" },
  4468. { id: 14, name: "Thorns", price: 1e4, scale: 115, xOff: 20, desc: "no effect" },
  4469. { id: 15, name: "Blockades", price: 1e4, scale: 95, xOff: 15, desc: "no effect" },
  4470. { id: 20, name: "Devils Tail", price: 1e4, scale: 95, xOff: 20, desc: "no effect" },
  4471. { id: 16, name: "Sawblade", price: 12e3, scale: 90, spin: !0, xOff: 0, desc: "deal damage to players that damage you", dmg: 0.15 },
  4472. { id: 13, name: "Angel Wings", price: 15e3, scale: 138, xOff: 22, desc: "slowly regenerates health over time", healthRegen: 3 },
  4473. { id: 19, name: "Shadow Wings", price: 15e3, scale: 138, xOff: 22, desc: "increased movement speed", spdMult: 1.1 },
  4474. { id: 18, name: "Blood Wings", price: 2e4, scale: 178, xOff: 26, desc: "restores health when you deal damage", healD: 0.2 },
  4475. { id: 21, name: "Corrupt X Wings", price: 2e4, scale: 178, xOff: 26, desc: "deal damage to players that damage you", dmg: 0.25 },
  4476. ],
  4477. $r = { hats: Bc, accessories: zc };
  4478. function Hc(e, t, i, s, n, r, o) {
  4479. this.init = function (a, u, p, h, m, w, v, x, D) {
  4480. (this.active = !0), (this.indx = a), (this.x = u), (this.y = p), (this.dir = h), (this.skipMov = !0), (this.speed = m), (this.dmg = w), (this.scale = x), (this.range = v), (this.owner = D), o && (this.sentTo = {});
  4481. };
  4482. const l = [];
  4483. let c;
  4484. this.update = function (a) {
  4485. if (this.active) {
  4486. let p = this.speed * a,
  4487. h;
  4488. if (
  4489. (this.skipMov
  4490. ? (this.skipMov = !1)
  4491. : ((this.x += p * Math.cos(this.dir)),
  4492. (this.y += p * Math.sin(this.dir)),
  4493. (this.range -= p),
  4494. this.range <= 0 && ((this.x += this.range * Math.cos(this.dir)), (this.y += this.range * Math.sin(this.dir)), (p = 1), (this.range = 0), (this.active = !1))),
  4495. o)
  4496. ) {
  4497. for (var u = 0; u < e.length; ++u)
  4498. !this.sentTo[e[u].id] &&
  4499. e[u].canSee(this) &&
  4500. ((this.sentTo[e[u].id] = 1), 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));
  4501. l.length = 0;
  4502. for (var u = 0; u < e.length + t.length; ++u)
  4503. (c = e[u] || t[u - e.length]),
  4504. c.alive &&
  4505. c != this.owner &&
  4506. !(this.owner.team && c.team == this.owner.team) &&
  4507. 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)) &&
  4508. l.push(c);
  4509. const m = i.getGridArrays(this.x, this.y, this.scale);
  4510. for (let w = 0; w < m.length; ++w)
  4511. for (let v = 0; v < m[w].length; ++v)
  4512. (c = m[w][v]),
  4513. (h = c.getScale()),
  4514. c.active &&
  4515. this.ignoreObj != c.sid &&
  4516. this.layer <= c.layer &&
  4517. l.indexOf(c) < 0 &&
  4518. !c.ignoreCollision &&
  4519. 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)) &&
  4520. l.push(c);
  4521. if (l.length > 0) {
  4522. let w = null,
  4523. v = null,
  4524. x = null;
  4525. for (var u = 0; u < l.length; ++u) (x = r.getDistance(this.x, this.y, l[u].x, l[u].y)), (v == null || x < v) && ((v = x), (w = l[u]));
  4526. if (w.isPlayer || w.isAI) {
  4527. const D = 0.3 * (w.weightM || 1);
  4528. (w.xVel += D * Math.cos(this.dir)),
  4529. (w.yVel += D * Math.sin(this.dir)),
  4530. (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);
  4531. } else {
  4532. w.projDmg && w.health && w.changeHealth(-this.dmg) && i.disableObj(w);
  4533. for (var u = 0; u < e.length; ++u)
  4534. e[u].active &&
  4535. (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)), !w.active && w.owner == e[u] && e[u].changeItemCount(w.group.id, -1));
  4536. }
  4537. this.active = !1;
  4538. for (var u = 0; u < e.length; ++u) this.sentTo[e[u].id] && o.send(e[u].id, "Y", this.sid, r.fixTo(v, 1));
  4539. }
  4540. }
  4541. }
  4542. };
  4543. }
  4544. var On = {},
  4545. Fc = {
  4546. get exports() {
  4547. return On;
  4548. },
  4549. set exports(e) {
  4550. On = e;
  4551. },
  4552. },
  4553. Rn = {},
  4554. Vc = {
  4555. get exports() {
  4556. return Rn;
  4557. },
  4558. set exports(e) {
  4559. Rn = e;
  4560. },
  4561. };
  4562. (function () {
  4563. var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  4564. t = {
  4565. rotl: function (i, s) {
  4566. return (i << s) | (i >>> (32 - s));
  4567. },
  4568. rotr: function (i, s) {
  4569. return (i << (32 - s)) | (i >>> s);
  4570. },
  4571. endian: function (i) {
  4572. if (i.constructor == Number) return (t.rotl(i, 8) & 16711935) | (t.rotl(i, 24) & 4278255360);
  4573. for (var s = 0; s < i.length; s++) i[s] = t.endian(i[s]);
  4574. return i;
  4575. },
  4576. randomBytes: function (i) {
  4577. for (var s = []; i > 0; i--) s.push(Math.floor(Math.random() * 256));
  4578. return s;
  4579. },
  4580. bytesToWords: function (i) {
  4581. for (var s = [], n = 0, r = 0; n < i.length; n++, r += 8) s[r >>> 5] |= i[n] << (24 - (r % 32));
  4582. return s;
  4583. },
  4584. wordsToBytes: function (i) {
  4585. for (var s = [], n = 0; n < i.length * 32; n += 8) s.push((i[n >>> 5] >>> (24 - (n % 32))) & 255);
  4586. return s;
  4587. },
  4588. bytesToHex: function (i) {
  4589. for (var s = [], n = 0; n < i.length; n++) s.push((i[n] >>> 4).toString(16)), s.push((i[n] & 15).toString(16));
  4590. return s.join("");
  4591. },
  4592. hexToBytes: function (i) {
  4593. for (var s = [], n = 0; n < i.length; n += 2) s.push(parseInt(i.substr(n, 2), 16));
  4594. return s;
  4595. },
  4596. bytesToBase64: function (i) {
  4597. for (var s = [], n = 0; n < i.length; n += 3) for (var r = (i[n] << 16) | (i[n + 1] << 8) | i[n + 2], o = 0; o < 4; o++) n * 8 + o * 6 <= i.length * 8 ? s.push(e.charAt((r >>> (6 * (3 - o))) & 63)) : s.push("=");
  4598. return s.join("");
  4599. },
  4600. base64ToBytes: function (i) {
  4601. i = i.replace(/[^A-Z0-9+\/]/gi, "");
  4602. for (var s = [], n = 0, r = 0; n < i.length; r = ++n % 4) 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)));
  4603. return s;
  4604. },
  4605. };
  4606. Vc.exports = t;
  4607. })();
  4608. var _n = {
  4609. utf8: {
  4610. stringToBytes: function (e) {
  4611. return _n.bin.stringToBytes(unescape(encodeURIComponent(e)));
  4612. },
  4613. bytesToString: function (e) {
  4614. return decodeURIComponent(escape(_n.bin.bytesToString(e)));
  4615. },
  4616. },
  4617. bin: {
  4618. stringToBytes: function (e) {
  4619. for (var t = [], i = 0; i < e.length; i++) t.push(e.charCodeAt(i) & 255);
  4620. return t;
  4621. },
  4622. bytesToString: function (e) {
  4623. for (var t = [], i = 0; i < e.length; i++) t.push(String.fromCharCode(e[i]));
  4624. return t.join("");
  4625. },
  4626. },
  4627. },
  4628. zs = _n;
  4629. /*!
  4630. * Determine if an object is a Buffer
  4631. *
  4632. * @author Feross Aboukhadijeh <https://feross.org>
  4633. * @license MIT
  4634. */ var Uc = function (e) {
  4635. return e != null && (Kr(e) || Lc(e) || !!e._isBuffer);
  4636. };
  4637. function Kr(e) {
  4638. return !!e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
  4639. }
  4640. function Lc(e) {
  4641. return typeof e.readFloatLE == "function" && typeof e.slice == "function" && Kr(e.slice(0, 0));
  4642. }
  4643. (function () {
  4644. var e = Rn,
  4645. t = zs.utf8,
  4646. i = Uc,
  4647. s = zs.bin,
  4648. n = function (r, o) {
  4649. r.constructor == String
  4650. ? o && o.encoding === "binary"
  4651. ? (r = s.stringToBytes(r))
  4652. : (r = t.stringToBytes(r))
  4653. : i(r)
  4654. ? (r = Array.prototype.slice.call(r, 0))
  4655. : !Array.isArray(r) && r.constructor !== Uint8Array && (r = r.toString());
  4656. for (var l = e.bytesToWords(r), c = r.length * 8, a = 1732584193, u = -271733879, p = -1732584194, h = 271733878, m = 0; m < l.length; m++)
  4657. l[m] = (((l[m] << 8) | (l[m] >>> 24)) & 16711935) | (((l[m] << 24) | (l[m] >>> 8)) & 4278255360);
  4658. (l[c >>> 5] |= 128 << c % 32), (l[(((c + 64) >>> 9) << 4) + 14] = c);
  4659. for (var w = n._ff, v = n._gg, x = n._hh, D = n._ii, m = 0; m < l.length; m += 16) {
  4660. var k = a,
  4661. S = u,
  4662. O = p,
  4663. U = h;
  4664. (a = w(a, u, p, h, l[m + 0], 7, -680876936)),
  4665. (h = w(h, a, u, p, l[m + 1], 12, -389564586)),
  4666. (p = w(p, h, a, u, l[m + 2], 17, 606105819)),
  4667. (u = w(u, p, h, a, l[m + 3], 22, -1044525330)),
  4668. (a = w(a, u, p, h, l[m + 4], 7, -176418897)),
  4669. (h = w(h, a, u, p, l[m + 5], 12, 1200080426)),
  4670. (p = w(p, h, a, u, l[m + 6], 17, -1473231341)),
  4671. (u = w(u, p, h, a, l[m + 7], 22, -45705983)),
  4672. (a = w(a, u, p, h, l[m + 8], 7, 1770035416)),
  4673. (h = w(h, a, u, p, l[m + 9], 12, -1958414417)),
  4674. (p = w(p, h, a, u, l[m + 10], 17, -42063)),
  4675. (u = w(u, p, h, a, l[m + 11], 22, -1990404162)),
  4676. (a = w(a, u, p, h, l[m + 12], 7, 1804603682)),
  4677. (h = w(h, a, u, p, l[m + 13], 12, -40341101)),
  4678. (p = w(p, h, a, u, l[m + 14], 17, -1502002290)),
  4679. (u = w(u, p, h, a, l[m + 15], 22, 1236535329)),
  4680. (a = v(a, u, p, h, l[m + 1], 5, -165796510)),
  4681. (h = v(h, a, u, p, l[m + 6], 9, -1069501632)),
  4682. (p = v(p, h, a, u, l[m + 11], 14, 643717713)),
  4683. (u = v(u, p, h, a, l[m + 0], 20, -373897302)),
  4684. (a = v(a, u, p, h, l[m + 5], 5, -701558691)),
  4685. (h = v(h, a, u, p, l[m + 10], 9, 38016083)),
  4686. (p = v(p, h, a, u, l[m + 15], 14, -660478335)),
  4687. (u = v(u, p, h, a, l[m + 4], 20, -405537848)),
  4688. (a = v(a, u, p, h, l[m + 9], 5, 568446438)),
  4689. (h = v(h, a, u, p, l[m + 14], 9, -1019803690)),
  4690. (p = v(p, h, a, u, l[m + 3], 14, -187363961)),
  4691. (u = v(u, p, h, a, l[m + 8], 20, 1163531501)),
  4692. (a = v(a, u, p, h, l[m + 13], 5, -1444681467)),
  4693. (h = v(h, a, u, p, l[m + 2], 9, -51403784)),
  4694. (p = v(p, h, a, u, l[m + 7], 14, 1735328473)),
  4695. (u = v(u, p, h, a, l[m + 12], 20, -1926607734)),
  4696. (a = x(a, u, p, h, l[m + 5], 4, -378558)),
  4697. (h = x(h, a, u, p, l[m + 8], 11, -2022574463)),
  4698. (p = x(p, h, a, u, l[m + 11], 16, 1839030562)),
  4699. (u = x(u, p, h, a, l[m + 14], 23, -35309556)),
  4700. (a = x(a, u, p, h, l[m + 1], 4, -1530992060)),
  4701. (h = x(h, a, u, p, l[m + 4], 11, 1272893353)),
  4702. (p = x(p, h, a, u, l[m + 7], 16, -155497632)),
  4703. (u = x(u, p, h, a, l[m + 10], 23, -1094730640)),
  4704. (a = x(a, u, p, h, l[m + 13], 4, 681279174)),
  4705. (h = x(h, a, u, p, l[m + 0], 11, -358537222)),
  4706. (p = x(p, h, a, u, l[m + 3], 16, -722521979)),
  4707. (u = x(u, p, h, a, l[m + 6], 23, 76029189)),
  4708. (a = x(a, u, p, h, l[m + 9], 4, -640364487)),
  4709. (h = x(h, a, u, p, l[m + 12], 11, -421815835)),
  4710. (p = x(p, h, a, u, l[m + 15], 16, 530742520)),
  4711. (u = x(u, p, h, a, l[m + 2], 23, -995338651)),
  4712. (a = D(a, u, p, h, l[m + 0], 6, -198630844)),
  4713. (h = D(h, a, u, p, l[m + 7], 10, 1126891415)),
  4714. (p = D(p, h, a, u, l[m + 14], 15, -1416354905)),
  4715. (u = D(u, p, h, a, l[m + 5], 21, -57434055)),
  4716. (a = D(a, u, p, h, l[m + 12], 6, 1700485571)),
  4717. (h = D(h, a, u, p, l[m + 3], 10, -1894986606)),
  4718. (p = D(p, h, a, u, l[m + 10], 15, -1051523)),
  4719. (u = D(u, p, h, a, l[m + 1], 21, -2054922799)),
  4720. (a = D(a, u, p, h, l[m + 8], 6, 1873313359)),
  4721. (h = D(h, a, u, p, l[m + 15], 10, -30611744)),
  4722. (p = D(p, h, a, u, l[m + 6], 15, -1560198380)),
  4723. (u = D(u, p, h, a, l[m + 13], 21, 1309151649)),
  4724. (a = D(a, u, p, h, l[m + 4], 6, -145523070)),
  4725. (h = D(h, a, u, p, l[m + 11], 10, -1120210379)),
  4726. (p = D(p, h, a, u, l[m + 2], 15, 718787259)),
  4727. (u = D(u, p, h, a, l[m + 9], 21, -343485551)),
  4728. (a = (a + k) >>> 0),
  4729. (u = (u + S) >>> 0),
  4730. (p = (p + O) >>> 0),
  4731. (h = (h + U) >>> 0);
  4732. }
  4733. return e.endian([a, u, p, h]);
  4734. };
  4735. (n._ff = function (r, o, l, c, a, u, p) {
  4736. var h = r + ((o & l) | (~o & c)) + (a >>> 0) + p;
  4737. return ((h << u) | (h >>> (32 - u))) + o;
  4738. }),
  4739. (n._gg = function (r, o, l, c, a, u, p) {
  4740. var h = r + ((o & c) | (l & ~c)) + (a >>> 0) + p;
  4741. return ((h << u) | (h >>> (32 - u))) + o;
  4742. }),
  4743. (n._hh = function (r, o, l, c, a, u, p) {
  4744. var h = r + (o ^ l ^ c) + (a >>> 0) + p;
  4745. return ((h << u) | (h >>> (32 - u))) + o;
  4746. }),
  4747. (n._ii = function (r, o, l, c, a, u, p) {
  4748. var h = r + (l ^ (o | ~c)) + (a >>> 0) + p;
  4749. return ((h << u) | (h >>> (32 - u))) + o;
  4750. }),
  4751. (n._blocksize = 16),
  4752. (n._digestsize = 16),
  4753. (Fc.exports = function (r, o) {
  4754. if (r == null) throw new Error("Illegal argument " + r);
  4755. var l = e.wordsToBytes(n(r, o));
  4756. return o && o.asBytes ? l : o && o.asString ? s.bytesToString(l) : e.bytesToHex(l);
  4757. });
  4758. })();
  4759. var ji, Hs;
  4760. function Ge() {
  4761. if (Hs) return ji;
  4762. Hs = 1;
  4763. function e(t, i, s, n, r, o) {
  4764. return { tag: t, key: i, attrs: s, children: n, text: r, dom: o, domSize: void 0, state: void 0, events: void 0, instance: void 0 };
  4765. }
  4766. return (
  4767. (e.normalize = function (t) {
  4768. 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);
  4769. }),
  4770. (e.normalizeChildren = function (t) {
  4771. var i = [];
  4772. if (t.length) {
  4773. for (var s = t[0] != null && t[0].key != null, n = 1; n < t.length; n++)
  4774. if ((t[n] != null && t[n].key != null) !== s)
  4775. throw new TypeError(
  4776. s && (t[n] != null || typeof t[n] == "boolean")
  4777. ? "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."
  4778. : "In fragments, vnodes must either all have keys or none have keys."
  4779. );
  4780. for (var n = 0; n < t.length; n++) i[n] = e.normalize(t[n]);
  4781. }
  4782. return i;
  4783. }),
  4784. (ji = e),
  4785. ji
  4786. );
  4787. }
  4788. var Nc = Ge(),
  4789. Jr = function () {
  4790. var e = arguments[this],
  4791. t = this + 1,
  4792. i;
  4793. if ((e == null ? (e = {}) : (typeof e != "object" || e.tag != null || Array.isArray(e)) && ((e = {}), (t = this)), arguments.length === t + 1)) (i = arguments[t]), Array.isArray(i) || (i = [i]);
  4794. else for (i = []; t < arguments.length; ) i.push(arguments[t++]);
  4795. return Nc("", e.key, e, i);
  4796. },
  4797. Ci = {}.hasOwnProperty,
  4798. qc = Ge(),
  4799. Wc = Jr,
  4800. pt = Ci,
  4801. Xc = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,
  4802. Qr = {};
  4803. function Fs(e) {
  4804. for (var t in e) if (pt.call(e, t)) return !1;
  4805. return !0;
  4806. }
  4807. function Gc(e) {
  4808. for (var t, i = "div", s = [], n = {}; (t = Xc.exec(e)); ) {
  4809. var r = t[1],
  4810. o = t[2];
  4811. if (r === "" && o !== "") i = o;
  4812. else if (r === "#") n.id = o;
  4813. else if (r === ".") s.push(o);
  4814. else if (t[3][0] === "[") {
  4815. var l = t[6];
  4816. l && (l = l.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\")), t[4] === "class" ? s.push(l) : (n[t[4]] = l === "" ? l : l || !0);
  4817. }
  4818. }
  4819. return s.length > 0 && (n.className = s.join(" ")), (Qr[e] = { tag: i, attrs: n });
  4820. }
  4821. function Yc(e, t) {
  4822. var i = t.attrs,
  4823. s = pt.call(i, "class"),
  4824. n = s ? i.class : i.className;
  4825. if (((t.tag = e.tag), (t.attrs = {}), !Fs(e.attrs) && !Fs(i))) {
  4826. var r = {};
  4827. for (var o in i) pt.call(i, o) && (r[o] = i[o]);
  4828. i = r;
  4829. }
  4830. for (var o in e.attrs) pt.call(e.attrs, o) && o !== "className" && !pt.call(i, o) && (i[o] = e.attrs[o]);
  4831. (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), s && (i.class = null);
  4832. for (var o in i)
  4833. if (pt.call(i, o) && o !== "key") {
  4834. t.attrs = i;
  4835. break;
  4836. }
  4837. return t;
  4838. }
  4839. function $c(e) {
  4840. if (e == null || (typeof e != "string" && typeof e != "function" && typeof e.view != "function")) throw Error("The selector must be either a string or a component.");
  4841. var t = Wc.apply(1, arguments);
  4842. return typeof e == "string" && ((t.children = qc.normalizeChildren(t.children)), e !== "[") ? Yc(Qr[e] || Gc(e), t) : ((t.tag = e), t);
  4843. }
  4844. var Zr = $c,
  4845. Kc = Ge(),
  4846. Jc = function (e) {
  4847. return e == null && (e = ""), Kc("<", void 0, void 0, e, void 0, void 0);
  4848. },
  4849. Qc = Ge(),
  4850. Zc = Jr,
  4851. jc = function () {
  4852. var e = Zc.apply(0, arguments);
  4853. return (e.tag = "["), (e.children = Qc.normalizeChildren(e.children)), e;
  4854. },
  4855. ns = Zr;
  4856. ns.trust = Jc;
  4857. ns.fragment = jc;
  4858. var eh = ns,
  4859. yi = {},
  4860. en = {
  4861. get exports() {
  4862. return yi;
  4863. },
  4864. set exports(e) {
  4865. yi = e;
  4866. },
  4867. },
  4868. tn,
  4869. Vs;
  4870. function jr() {
  4871. if (Vs) return tn;
  4872. Vs = 1;
  4873. var e = function (t) {
  4874. if (!(this instanceof e)) throw new Error("Promise must be called with 'new'.");
  4875. if (typeof t != "function") throw new TypeError("executor must be a function.");
  4876. var i = this,
  4877. s = [],
  4878. n = [],
  4879. r = a(s, !0),
  4880. o = a(n, !1),
  4881. l = (i._instance = { resolvers: s, rejectors: n }),
  4882. c = typeof setImmediate == "function" ? setImmediate : setTimeout;
  4883. function a(p, h) {
  4884. return function m(w) {
  4885. var v;
  4886. try {
  4887. if (h && w != null && (typeof w == "object" || typeof w == "function") && typeof (v = w.then) == "function") {
  4888. if (w === i) throw new TypeError("Promise can't be resolved with itself.");
  4889. u(v.bind(w));
  4890. } else
  4891. c(function () {
  4892. !h && p.length === 0 && console.error("Possible unhandled promise rejection:", w);
  4893. for (var x = 0; x < p.length; x++) p[x](w);
  4894. (s.length = 0),
  4895. (n.length = 0),
  4896. (l.state = h),
  4897. (l.retry = function () {
  4898. m(w);
  4899. });
  4900. });
  4901. } catch (x) {
  4902. o(x);
  4903. }
  4904. };
  4905. }
  4906. function u(p) {
  4907. var h = 0;
  4908. function m(v) {
  4909. return function (x) {
  4910. h++ > 0 || v(x);
  4911. };
  4912. }
  4913. var w = m(o);
  4914. try {
  4915. p(m(r), w);
  4916. } catch (v) {
  4917. w(v);
  4918. }
  4919. }
  4920. u(t);
  4921. };
  4922. return (
  4923. (e.prototype.then = function (t, i) {
  4924. var s = this,
  4925. n = s._instance;
  4926. function r(a, u, p, h) {
  4927. u.push(function (m) {
  4928. if (typeof a != "function") p(m);
  4929. else
  4930. try {
  4931. o(a(m));
  4932. } catch (w) {
  4933. l && l(w);
  4934. }
  4935. }),
  4936. typeof n.retry == "function" && h === n.state && n.retry();
  4937. }
  4938. var o,
  4939. l,
  4940. c = new e(function (a, u) {
  4941. (o = a), (l = u);
  4942. });
  4943. return r(t, n.resolvers, o, !0), r(i, n.rejectors, l, !1), c;
  4944. }),
  4945. (e.prototype.catch = function (t) {
  4946. return this.then(null, t);
  4947. }),
  4948. (e.prototype.finally = function (t) {
  4949. return this.then(
  4950. function (i) {
  4951. return e.resolve(t()).then(function () {
  4952. return i;
  4953. });
  4954. },
  4955. function (i) {
  4956. return e.resolve(t()).then(function () {
  4957. return e.reject(i);
  4958. });
  4959. }
  4960. );
  4961. }),
  4962. (e.resolve = function (t) {
  4963. return t instanceof e
  4964. ? t
  4965. : new e(function (i) {
  4966. i(t);
  4967. });
  4968. }),
  4969. (e.reject = function (t) {
  4970. return new e(function (i, s) {
  4971. s(t);
  4972. });
  4973. }),
  4974. (e.all = function (t) {
  4975. return new e(function (i, s) {
  4976. var n = t.length,
  4977. r = 0,
  4978. o = [];
  4979. if (t.length === 0) i([]);
  4980. else
  4981. for (var l = 0; l < t.length; l++)
  4982. (function (c) {
  4983. function a(u) {
  4984. r++, (o[c] = u), r === n && i(o);
  4985. }
  4986. t[c] != null && (typeof t[c] == "object" || typeof t[c] == "function") && typeof t[c].then == "function" ? t[c].then(a, s) : a(t[c]);
  4987. })(l);
  4988. });
  4989. }),
  4990. (e.race = function (t) {
  4991. return new e(function (i, s) {
  4992. for (var n = 0; n < t.length; n++) t[n].then(i, s);
  4993. });
  4994. }),
  4995. (tn = e),
  4996. tn
  4997. );
  4998. }
  4999. var _t = jr();
  5000. typeof window < "u"
  5001. ? (typeof window.Promise > "u" ? (window.Promise = _t) : window.Promise.prototype.finally || (window.Promise.prototype.finally = _t.prototype.finally), (en.exports = window.Promise))
  5002. : typeof rt < "u"
  5003. ? (typeof rt.Promise > "u" ? (rt.Promise = _t) : rt.Promise.prototype.finally || (rt.Promise.prototype.finally = _t.prototype.finally), (en.exports = rt.Promise))
  5004. : (en.exports = _t);
  5005. var nn, Us;
  5006. function th() {
  5007. if (Us) return nn;
  5008. Us = 1;
  5009. var e = Ge();
  5010. return (
  5011. (nn = function (t) {
  5012. var i = t && t.document,
  5013. s,
  5014. n = { svg: "http://www.w3.org/2000/svg", math: "http://www.w3.org/1998/Math/MathML" };
  5015. function r(d) {
  5016. return (d.attrs && d.attrs.xmlns) || n[d.tag];
  5017. }
  5018. function o(d, f) {
  5019. if (d.state !== f) throw new Error("'vnode.state' must not be modified.");
  5020. }
  5021. function l(d) {
  5022. var f = d.state;
  5023. try {
  5024. return this.apply(f, arguments);
  5025. } finally {
  5026. o(d, f);
  5027. }
  5028. }
  5029. function c() {
  5030. try {
  5031. return i.activeElement;
  5032. } catch {
  5033. return null;
  5034. }
  5035. }
  5036. function a(d, f, g, b, I, A, H) {
  5037. for (var N = g; N < b; N++) {
  5038. var B = f[N];
  5039. B != null && u(d, B, I, H, A);
  5040. }
  5041. }
  5042. function u(d, f, g, b, I) {
  5043. var A = f.tag;
  5044. if (typeof A == "string")
  5045. switch (((f.state = {}), f.attrs != null && Fi(f.attrs, f, g), A)) {
  5046. case "#":
  5047. p(d, f, I);
  5048. break;
  5049. case "<":
  5050. m(d, f, b, I);
  5051. break;
  5052. case "[":
  5053. w(d, f, g, b, I);
  5054. break;
  5055. default:
  5056. v(d, f, g, b, I);
  5057. }
  5058. else D(d, f, g, b, I);
  5059. }
  5060. function p(d, f, g) {
  5061. (f.dom = i.createTextNode(f.children)), X(d, f.dom, g);
  5062. }
  5063. var h = { caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup" };
  5064. function m(d, f, g, b) {
  5065. var I = f.children.match(/^\s*?<(\w+)/im) || [],
  5066. A = i.createElement(h[I[1]] || "div");
  5067. g === "http://www.w3.org/2000/svg" ? ((A.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg">' + f.children + "</svg>"), (A = A.firstChild)) : (A.innerHTML = f.children),
  5068. (f.dom = A.firstChild),
  5069. (f.domSize = A.childNodes.length),
  5070. (f.instance = []);
  5071. for (var H = i.createDocumentFragment(), N; (N = A.firstChild); ) f.instance.push(N), H.appendChild(N);
  5072. X(d, H, b);
  5073. }
  5074. function w(d, f, g, b, I) {
  5075. var A = i.createDocumentFragment();
  5076. if (f.children != null) {
  5077. var H = f.children;
  5078. a(A, H, 0, H.length, g, null, b);
  5079. }
  5080. (f.dom = A.firstChild), (f.domSize = A.childNodes.length), X(d, A, I);
  5081. }
  5082. function v(d, f, g, b, I) {
  5083. var A = f.tag,
  5084. H = f.attrs,
  5085. N = H && H.is;
  5086. b = r(f) || b;
  5087. var B = b ? (N ? i.createElementNS(b, A, { is: N }) : i.createElementNS(b, A)) : N ? i.createElement(A, { is: N }) : i.createElement(A);
  5088. if (((f.dom = B), H != null && Bi(f, H, b), X(d, B, I), !G(f) && f.children != null)) {
  5089. var Y = f.children;
  5090. a(B, Y, 0, Y.length, g, null, b), f.tag === "select" && H != null && No(f, H);
  5091. }
  5092. }
  5093. function x(d, f) {
  5094. var g;
  5095. if (typeof d.tag.view == "function") {
  5096. if (((d.state = Object.create(d.tag)), (g = d.state.view), g.$$reentrantLock$$ != null)) return;
  5097. g.$$reentrantLock$$ = !0;
  5098. } else {
  5099. if (((d.state = void 0), (g = d.tag), g.$$reentrantLock$$ != null)) return;
  5100. (g.$$reentrantLock$$ = !0), (d.state = d.tag.prototype != null && typeof d.tag.prototype.view == "function" ? new d.tag(d) : d.tag(d));
  5101. }
  5102. if ((Fi(d.state, d, f), d.attrs != null && Fi(d.attrs, d, f), (d.instance = e.normalize(l.call(d.state.view, d))), d.instance === d)) throw Error("A view cannot return the vnode it received as argument");
  5103. g.$$reentrantLock$$ = null;
  5104. }
  5105. function D(d, f, g, b, I) {
  5106. x(f, g), f.instance != null ? (u(d, f.instance, g, b, I), (f.dom = f.instance.dom), (f.domSize = f.dom != null ? f.instance.domSize : 0)) : (f.domSize = 0);
  5107. }
  5108. function k(d, f, g, b, I, A) {
  5109. if (!(f === g || (f == null && g == null)))
  5110. if (f == null || f.length === 0) a(d, g, 0, g.length, b, I, A);
  5111. else if (g == null || g.length === 0) te(d, f, 0, f.length);
  5112. else {
  5113. var H = f[0] != null && f[0].key != null,
  5114. N = g[0] != null && g[0].key != null,
  5115. B = 0,
  5116. Y = 0;
  5117. if (!H) for (; Y < f.length && f[Y] == null; ) Y++;
  5118. if (!N) for (; B < g.length && g[B] == null; ) B++;
  5119. if (H !== N) te(d, f, Y, f.length), a(d, g, B, g.length, b, I, A);
  5120. else if (N) {
  5121. for (var ve = f.length - 1, fe = g.length - 1, ni, xe, oe, ge, Z, Li; ve >= Y && fe >= B && ((ge = f[ve]), (Z = g[fe]), ge.key === Z.key); )
  5122. ge !== Z && S(d, ge, Z, b, I, A), Z.dom != null && (I = Z.dom), ve--, fe--;
  5123. for (; ve >= Y && fe >= B && ((xe = f[Y]), (oe = g[B]), xe.key === oe.key); ) Y++, B++, xe !== oe && S(d, xe, oe, b, $(f, Y, I), A);
  5124. for (; ve >= Y && fe >= B && !(B === fe || xe.key !== Z.key || ge.key !== oe.key); )
  5125. (Li = $(f, Y, I)),
  5126. V(d, ge, Li),
  5127. ge !== oe && S(d, ge, oe, b, Li, A),
  5128. ++B <= --fe && V(d, xe, I),
  5129. xe !== Z && S(d, xe, Z, b, I, A),
  5130. Z.dom != null && (I = Z.dom),
  5131. Y++,
  5132. ve--,
  5133. (ge = f[ve]),
  5134. (Z = g[fe]),
  5135. (xe = f[Y]),
  5136. (oe = g[B]);
  5137. for (; ve >= Y && fe >= B && ge.key === Z.key; ) ge !== Z && S(d, ge, Z, b, I, A), Z.dom != null && (I = Z.dom), ve--, fe--, (ge = f[ve]), (Z = g[fe]);
  5138. if (B > fe) te(d, f, Y, ve + 1);
  5139. else if (Y > ve) a(d, g, B, fe + 1, b, I, A);
  5140. else {
  5141. var $o = I,
  5142. Ps = fe - B + 1,
  5143. At = new Array(Ps),
  5144. Ni = 0,
  5145. ne = 0,
  5146. qi = 2147483647,
  5147. Wi = 0,
  5148. ni,
  5149. Xi;
  5150. for (ne = 0; ne < Ps; ne++) At[ne] = -1;
  5151. for (ne = fe; ne >= B; ne--) {
  5152. ni == null && (ni = W(f, Y, ve + 1)), (Z = g[ne]);
  5153. var st = ni[Z.key];
  5154. st != null && ((qi = st < qi ? st : -1), (At[ne - B] = st), (ge = f[st]), (f[st] = null), ge !== Z && S(d, ge, Z, b, I, A), Z.dom != null && (I = Z.dom), Wi++);
  5155. }
  5156. if (((I = $o), Wi !== ve - Y + 1 && te(d, f, Y, ve + 1), Wi === 0)) a(d, g, B, fe + 1, b, I, A);
  5157. else if (qi === -1)
  5158. for (Xi = _(At), Ni = Xi.length - 1, ne = fe; ne >= B; ne--) (oe = g[ne]), At[ne - B] === -1 ? u(d, oe, b, A, I) : Xi[Ni] === ne - B ? Ni-- : V(d, oe, I), oe.dom != null && (I = g[ne].dom);
  5159. else for (ne = fe; ne >= B; ne--) (oe = g[ne]), At[ne - B] === -1 && u(d, oe, b, A, I), oe.dom != null && (I = g[ne].dom);
  5160. }
  5161. } else {
  5162. var Ui = f.length < g.length ? f.length : g.length;
  5163. for (B = B < Y ? B : Y; B < Ui; B++)
  5164. (xe = f[B]), (oe = g[B]), !(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));
  5165. f.length > Ui && te(d, f, B, f.length), g.length > Ui && a(d, g, B, g.length, b, I, A);
  5166. }
  5167. }
  5168. }
  5169. function S(d, f, g, b, I, A) {
  5170. var H = f.tag,
  5171. N = g.tag;
  5172. if (H === N) {
  5173. if (((g.state = f.state), (g.events = f.events), Yo(g, f))) return;
  5174. if (typeof H == "string")
  5175. switch ((g.attrs != null && Vi(g.attrs, g, b), H)) {
  5176. case "#":
  5177. O(f, g);
  5178. break;
  5179. case "<":
  5180. U(d, f, g, A, I);
  5181. break;
  5182. case "[":
  5183. L(d, f, g, b, I, A);
  5184. break;
  5185. default:
  5186. q(f, g, b, A);
  5187. }
  5188. else P(d, f, g, b, I, A);
  5189. } else ie(d, f), u(d, g, b, A, I);
  5190. }
  5191. function O(d, f) {
  5192. d.children.toString() !== f.children.toString() && (d.dom.nodeValue = f.children), (f.dom = d.dom);
  5193. }
  5194. function U(d, f, g, b, I) {
  5195. f.children !== g.children ? (K(d, f), m(d, g, b, I)) : ((g.dom = f.dom), (g.domSize = f.domSize), (g.instance = f.instance));
  5196. }
  5197. function L(d, f, g, b, I, A) {
  5198. k(d, f.children, g.children, b, I, A);
  5199. var H = 0,
  5200. N = g.children;
  5201. if (((g.dom = null), N != null)) {
  5202. for (var B = 0; B < N.length; B++) {
  5203. var Y = N[B];
  5204. Y != null && Y.dom != null && (g.dom == null && (g.dom = Y.dom), (H += Y.domSize || 1));
  5205. }
  5206. H !== 1 && (g.domSize = H);
  5207. }
  5208. }
  5209. function q(d, f, g, b) {
  5210. var I = (f.dom = d.dom);
  5211. (b = r(f) || b), f.tag === "textarea" && f.attrs == null && (f.attrs = {}), qo(f, d.attrs, f.attrs, b), G(f) || k(I, d.children, f.children, g, null, b);
  5212. }
  5213. function P(d, f, g, b, I, A) {
  5214. if (((g.instance = e.normalize(l.call(g.state.view, g))), g.instance === g)) throw Error("A view cannot return the vnode it received as argument");
  5215. Vi(g.state, g, b),
  5216. g.attrs != null && Vi(g.attrs, g, b),
  5217. g.instance != null
  5218. ? (f.instance == null ? u(d, g.instance, b, A, I) : S(d, f.instance, g.instance, b, I, A), (g.dom = g.instance.dom), (g.domSize = g.instance.domSize))
  5219. : f.instance != null
  5220. ? (ie(d, f.instance), (g.dom = void 0), (g.domSize = 0))
  5221. : ((g.dom = f.dom), (g.domSize = f.domSize));
  5222. }
  5223. function W(d, f, g) {
  5224. for (var b = Object.create(null); f < g; f++) {
  5225. var I = d[f];
  5226. if (I != null) {
  5227. var A = I.key;
  5228. A != null && (b[A] = f);
  5229. }
  5230. }
  5231. return b;
  5232. }
  5233. var F = [];
  5234. function _(d) {
  5235. for (var f = [0], g = 0, b = 0, I = 0, A = (F.length = d.length), I = 0; I < A; I++) F[I] = d[I];
  5236. for (var I = 0; I < A; ++I)
  5237. if (d[I] !== -1) {
  5238. var H = f[f.length - 1];
  5239. if (d[H] < d[I]) {
  5240. (F[I] = H), f.push(I);
  5241. continue;
  5242. }
  5243. for (g = 0, b = f.length - 1; g < b; ) {
  5244. var N = (g >>> 1) + (b >>> 1) + (g & b & 1);
  5245. d[f[N]] < d[I] ? (g = N + 1) : (b = N);
  5246. }
  5247. d[I] < d[f[g]] && (g > 0 && (F[I] = f[g - 1]), (f[g] = I));
  5248. }
  5249. for (g = f.length, b = f[g - 1]; g-- > 0; ) (f[g] = b), (b = F[b]);
  5250. return (F.length = 0), f;
  5251. }
  5252. function $(d, f, g) {
  5253. for (; f < d.length; f++) if (d[f] != null && d[f].dom != null) return d[f].dom;
  5254. return g;
  5255. }
  5256. function V(d, f, g) {
  5257. var b = i.createDocumentFragment();
  5258. z(d, b, f), X(d, b, g);
  5259. }
  5260. function z(d, f, g) {
  5261. for (; g.dom != null && g.dom.parentNode === d; ) {
  5262. if (typeof g.tag != "string") {
  5263. if (((g = g.instance), g != null)) continue;
  5264. } else if (g.tag === "<") for (var b = 0; b < g.instance.length; b++) f.appendChild(g.instance[b]);
  5265. else if (g.tag !== "[") f.appendChild(g.dom);
  5266. else if (g.children.length === 1) {
  5267. if (((g = g.children[0]), g != null)) continue;
  5268. } else
  5269. for (var b = 0; b < g.children.length; b++) {
  5270. var I = g.children[b];
  5271. I != null && z(d, f, I);
  5272. }
  5273. break;
  5274. }
  5275. }
  5276. function X(d, f, g) {
  5277. g != null ? d.insertBefore(f, g) : d.appendChild(f);
  5278. }
  5279. function G(d) {
  5280. if (d.attrs == null || (d.attrs.contenteditable == null && d.attrs.contentEditable == null)) return !1;
  5281. var f = d.children;
  5282. if (f != null && f.length === 1 && f[0].tag === "<") {
  5283. var g = f[0].children;
  5284. d.dom.innerHTML !== g && (d.dom.innerHTML = g);
  5285. } else if (f != null && f.length !== 0) throw new Error("Child node of a contenteditable must be trusted.");
  5286. return !0;
  5287. }
  5288. function te(d, f, g, b) {
  5289. for (var I = g; I < b; I++) {
  5290. var A = f[I];
  5291. A != null && ie(d, A);
  5292. }
  5293. }
  5294. function ie(d, f) {
  5295. var g = 0,
  5296. b = f.state,
  5297. I,
  5298. A;
  5299. if (typeof f.tag != "string" && typeof f.state.onbeforeremove == "function") {
  5300. var H = l.call(f.state.onbeforeremove, f);
  5301. H != null && typeof H.then == "function" && ((g = 1), (I = H));
  5302. }
  5303. if (f.attrs && typeof f.attrs.onbeforeremove == "function") {
  5304. var H = l.call(f.attrs.onbeforeremove, f);
  5305. H != null && typeof H.then == "function" && ((g |= 2), (A = H));
  5306. }
  5307. if ((o(f, b), !g)) nt(f), ke(d, f);
  5308. else {
  5309. if (I != null) {
  5310. var N = function () {
  5311. g & 1 && ((g &= 2), g || B());
  5312. };
  5313. I.then(N, N);
  5314. }
  5315. if (A != null) {
  5316. var N = function () {
  5317. g & 2 && ((g &= 1), g || B());
  5318. };
  5319. A.then(N, N);
  5320. }
  5321. }
  5322. function B() {
  5323. o(f, b), nt(f), ke(d, f);
  5324. }
  5325. }
  5326. function K(d, f) {
  5327. for (var g = 0; g < f.instance.length; g++) d.removeChild(f.instance[g]);
  5328. }
  5329. function ke(d, f) {
  5330. for (; f.dom != null && f.dom.parentNode === d; ) {
  5331. if (typeof f.tag != "string") {
  5332. if (((f = f.instance), f != null)) continue;
  5333. } else if (f.tag === "<") K(d, f);
  5334. else {
  5335. if (f.tag !== "[" && (d.removeChild(f.dom), !Array.isArray(f.children))) break;
  5336. if (f.children.length === 1) {
  5337. if (((f = f.children[0]), f != null)) continue;
  5338. } else
  5339. for (var g = 0; g < f.children.length; g++) {
  5340. var b = f.children[g];
  5341. b != null && ke(d, b);
  5342. }
  5343. }
  5344. break;
  5345. }
  5346. }
  5347. function nt(d) {
  5348. if ((typeof d.tag != "string" && typeof d.state.onremove == "function" && l.call(d.state.onremove, d), d.attrs && typeof d.attrs.onremove == "function" && l.call(d.attrs.onremove, d), typeof d.tag != "string"))
  5349. d.instance != null && nt(d.instance);
  5350. else {
  5351. var f = d.children;
  5352. if (Array.isArray(f))
  5353. for (var g = 0; g < f.length; g++) {
  5354. var b = f[g];
  5355. b != null && nt(b);
  5356. }
  5357. }
  5358. }
  5359. function Bi(d, f, g) {
  5360. d.tag === "input" && f.type != null && d.dom.setAttribute("type", f.type);
  5361. var b = f != null && d.tag === "input" && f.type === "file";
  5362. for (var I in f) Ue(d, I, null, f[I], g, b);
  5363. }
  5364. function Ue(d, f, g, b, I, A) {
  5365. if (!(f === "key" || f === "is" || b == null || Ts(f) || (g === b && !Wo(d, f) && typeof b != "object") || (f === "type" && d.tag === "input"))) {
  5366. if (f[0] === "o" && f[1] === "n") return Es(d, f, b);
  5367. if (f.slice(0, 6) === "xlink:") d.dom.setAttributeNS("http://www.w3.org/1999/xlink", f.slice(6), b);
  5368. else if (f === "style") Ms(d.dom, g, b);
  5369. else if (Is(d, f, I)) {
  5370. if (f === "value") {
  5371. if (
  5372. ((d.tag === "input" || d.tag === "textarea") && d.dom.value === "" + b && (A || d.dom === c())) ||
  5373. (d.tag === "select" && g !== null && d.dom.value === "" + b) ||
  5374. (d.tag === "option" && g !== null && d.dom.value === "" + b)
  5375. )
  5376. return;
  5377. if (A && "" + b != "") {
  5378. console.error("`value` is read-only on file inputs!");
  5379. return;
  5380. }
  5381. }
  5382. d.dom[f] = b;
  5383. } else typeof b == "boolean" ? (b ? d.dom.setAttribute(f, "") : d.dom.removeAttribute(f)) : d.dom.setAttribute(f === "className" ? "class" : f, b);
  5384. }
  5385. }
  5386. function Ye(d, f, g, b) {
  5387. if (!(f === "key" || f === "is" || g == null || Ts(f)))
  5388. if (f[0] === "o" && f[1] === "n") Es(d, f, void 0);
  5389. else if (f === "style") Ms(d.dom, g, null);
  5390. 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"))
  5391. d.dom[f] = null;
  5392. else {
  5393. var I = f.indexOf(":");
  5394. I !== -1 && (f = f.slice(I + 1)), g !== !1 && d.dom.removeAttribute(f === "className" ? "class" : f);
  5395. }
  5396. }
  5397. function No(d, f) {
  5398. if ("value" in f)
  5399. if (f.value === null) d.dom.selectedIndex !== -1 && (d.dom.value = null);
  5400. else {
  5401. var g = "" + f.value;
  5402. (d.dom.value !== g || d.dom.selectedIndex === -1) && (d.dom.value = g);
  5403. }
  5404. "selectedIndex" in f && Ue(d, "selectedIndex", null, f.selectedIndex, void 0);
  5405. }
  5406. function qo(d, f, g, b) {
  5407. if ((f && f === g && console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major"), g != null)) {
  5408. d.tag === "input" && g.type != null && d.dom.setAttribute("type", g.type);
  5409. var I = d.tag === "input" && g.type === "file";
  5410. for (var A in g) Ue(d, A, f && f[A], g[A], b, I);
  5411. }
  5412. var H;
  5413. if (f != null) for (var A in f) (H = f[A]) != null && (g == null || g[A] == null) && Ye(d, A, H, b);
  5414. }
  5415. function Wo(d, f) {
  5416. return f === "value" || f === "checked" || f === "selectedIndex" || (f === "selected" && d.dom === c()) || (d.tag === "option" && d.dom.parentNode === i.activeElement);
  5417. }
  5418. function Ts(d) {
  5419. return d === "oninit" || d === "oncreate" || d === "onupdate" || d === "onremove" || d === "onbeforeremove" || d === "onbeforeupdate";
  5420. }
  5421. function Is(d, f, g) {
  5422. 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;
  5423. }
  5424. var Xo = /[A-Z]/g;
  5425. function Go(d) {
  5426. return "-" + d.toLowerCase();
  5427. }
  5428. function zi(d) {
  5429. return d[0] === "-" && d[1] === "-" ? d : d === "cssFloat" ? "float" : d.replace(Xo, Go);
  5430. }
  5431. function Ms(d, f, g) {
  5432. if (f !== g)
  5433. if (g == null) d.style.cssText = "";
  5434. else if (typeof g != "object") d.style.cssText = g;
  5435. else if (f == null || typeof f != "object") {
  5436. d.style.cssText = "";
  5437. for (var b in g) {
  5438. var I = g[b];
  5439. I != null && d.style.setProperty(zi(b), String(I));
  5440. }
  5441. } else {
  5442. for (var b in g) {
  5443. var I = g[b];
  5444. I != null && (I = String(I)) !== String(f[b]) && d.style.setProperty(zi(b), I);
  5445. }
  5446. for (var b in f) f[b] != null && g[b] == null && d.style.removeProperty(zi(b));
  5447. }
  5448. }
  5449. function Hi() {
  5450. this._ = s;
  5451. }
  5452. (Hi.prototype = Object.create(null)),
  5453. (Hi.prototype.handleEvent = function (d) {
  5454. var f = this["on" + d.type],
  5455. g;
  5456. typeof f == "function" ? (g = f.call(d.currentTarget, d)) : typeof f.handleEvent == "function" && f.handleEvent(d), this._ && d.redraw !== !1 && (0, this._)(), g === !1 && (d.preventDefault(), d.stopPropagation());
  5457. });
  5458. function Es(d, f, g) {
  5459. if (d.events != null) {
  5460. if (((d.events._ = s), d.events[f] === g)) return;
  5461. g != null && (typeof g == "function" || typeof g == "object")
  5462. ? (d.events[f] == null && d.dom.addEventListener(f.slice(2), d.events, !1), (d.events[f] = g))
  5463. : (d.events[f] != null && d.dom.removeEventListener(f.slice(2), d.events, !1), (d.events[f] = void 0));
  5464. } else g != null && (typeof g == "function" || typeof g == "object") && ((d.events = new Hi()), d.dom.addEventListener(f.slice(2), d.events, !1), (d.events[f] = g));
  5465. }
  5466. function Fi(d, f, g) {
  5467. typeof d.oninit == "function" && l.call(d.oninit, f), typeof d.oncreate == "function" && g.push(l.bind(d.oncreate, f));
  5468. }
  5469. function Vi(d, f, g) {
  5470. typeof d.onupdate == "function" && g.push(l.bind(d.onupdate, f));
  5471. }
  5472. function Yo(d, f) {
  5473. do {
  5474. if (d.attrs != null && typeof d.attrs.onbeforeupdate == "function") {
  5475. var g = l.call(d.attrs.onbeforeupdate, d, f);
  5476. if (g !== void 0 && !g) break;
  5477. }
  5478. if (typeof d.tag != "string" && typeof d.state.onbeforeupdate == "function") {
  5479. var g = l.call(d.state.onbeforeupdate, d, f);
  5480. if (g !== void 0 && !g) break;
  5481. }
  5482. return !1;
  5483. } while (!1);
  5484. return (d.dom = f.dom), (d.domSize = f.domSize), (d.instance = f.instance), (d.attrs = f.attrs), (d.children = f.children), (d.text = f.text), !0;
  5485. }
  5486. var Ct;
  5487. return function (d, f, g) {
  5488. if (!d) throw new TypeError("DOM element being rendered to does not exist.");
  5489. if (Ct != null && d.contains(Ct)) throw new TypeError("Node is currently being rendered to and thus is locked.");
  5490. var b = s,
  5491. I = Ct,
  5492. A = [],
  5493. H = c(),
  5494. N = d.namespaceURI;
  5495. (Ct = d), (s = typeof g == "function" ? g : void 0);
  5496. try {
  5497. d.vnodes == null && (d.textContent = ""),
  5498. (f = e.normalizeChildren(Array.isArray(f) ? f : [f])),
  5499. k(d, d.vnodes, f, A, null, N === "http://www.w3.org/1999/xhtml" ? void 0 : N),
  5500. (d.vnodes = f),
  5501. H != null && c() !== H && typeof H.focus == "function" && H.focus();
  5502. for (var B = 0; B < A.length; B++) A[B]();
  5503. } finally {
  5504. (s = b), (Ct = I);
  5505. }
  5506. };
  5507. }),
  5508. nn
  5509. );
  5510. }
  5511. var sn, Ls;
  5512. function eo() {
  5513. return Ls || ((Ls = 1), (sn = th()(typeof window < "u" ? window : null))), sn;
  5514. }
  5515. var Ns = Ge(),
  5516. ih = function (e, t, i) {
  5517. var s = [],
  5518. n = !1,
  5519. r = -1;
  5520. function o() {
  5521. for (r = 0; r < s.length; r += 2)
  5522. try {
  5523. e(s[r], Ns(s[r + 1]), l);
  5524. } catch (a) {
  5525. i.error(a);
  5526. }
  5527. r = -1;
  5528. }
  5529. function l() {
  5530. n ||
  5531. ((n = !0),
  5532. t(function () {
  5533. (n = !1), o();
  5534. }));
  5535. }
  5536. l.sync = o;
  5537. function c(a, u) {
  5538. if (u != null && u.view == null && typeof u != "function") throw new TypeError("m.mount expects a component, not a vnode.");
  5539. var p = s.indexOf(a);
  5540. p >= 0 && (s.splice(p, 2), p <= r && (r -= 2), e(a, [])), u != null && (s.push(a, u), e(a, Ns(u), l));
  5541. }
  5542. return { mount: c, redraw: l };
  5543. },
  5544. nh = eo(),
  5545. ss = ih(nh, typeof requestAnimationFrame < "u" ? requestAnimationFrame : null, typeof console < "u" ? console : null),
  5546. rn,
  5547. qs;
  5548. function to() {
  5549. return (
  5550. qs ||
  5551. ((qs = 1),
  5552. (rn = function (e) {
  5553. if (Object.prototype.toString.call(e) !== "[object Object]") return "";
  5554. var t = [];
  5555. for (var i in e) s(i, e[i]);
  5556. return t.join("&");
  5557. function s(n, r) {
  5558. if (Array.isArray(r)) for (var o = 0; o < r.length; o++) s(n + "[" + o + "]", r[o]);
  5559. else if (Object.prototype.toString.call(r) === "[object Object]") for (var o in r) s(n + "[" + o + "]", r[o]);
  5560. else t.push(encodeURIComponent(n) + (r != null && r !== "" ? "=" + encodeURIComponent(r) : ""));
  5561. }
  5562. })),
  5563. rn
  5564. );
  5565. }
  5566. var on, Ws;
  5567. function io() {
  5568. if (Ws) return on;
  5569. Ws = 1;
  5570. var e = Ci;
  5571. return (
  5572. (on =
  5573. Object.assign ||
  5574. function (t, i) {
  5575. for (var s in i) e.call(i, s) && (t[s] = i[s]);
  5576. }),
  5577. on
  5578. );
  5579. }
  5580. var an, Xs;
  5581. function rs() {
  5582. if (Xs) return an;
  5583. Xs = 1;
  5584. var e = to(),
  5585. t = io();
  5586. return (
  5587. (an = function (i, s) {
  5588. if (/:([^\/\.-]+)(\.{3})?:/.test(i)) throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.");
  5589. if (s == null) return i;
  5590. var n = i.indexOf("?"),
  5591. r = i.indexOf("#"),
  5592. o = r < 0 ? i.length : r,
  5593. l = n < 0 ? o : n,
  5594. c = i.slice(0, l),
  5595. a = {};
  5596. t(a, s);
  5597. var u = c.replace(/:([^\/\.-]+)(\.{3})?/g, function (D, k, S) {
  5598. return delete a[k], s[k] == null ? D : S ? s[k] : encodeURIComponent(String(s[k]));
  5599. }),
  5600. p = u.indexOf("?"),
  5601. h = u.indexOf("#"),
  5602. m = h < 0 ? u.length : h,
  5603. w = p < 0 ? m : p,
  5604. v = u.slice(0, w);
  5605. n >= 0 && (v += i.slice(n, o)), p >= 0 && (v += (n < 0 ? "?" : "&") + u.slice(p, m));
  5606. var x = e(a);
  5607. return x && (v += (n < 0 && p < 0 ? "?" : "&") + x), r >= 0 && (v += i.slice(r)), h >= 0 && (v += (r < 0 ? "" : "&") + u.slice(h)), v;
  5608. }),
  5609. an
  5610. );
  5611. }
  5612. var sh = rs(),
  5613. Gs = Ci,
  5614. rh = function (e, t, i) {
  5615. var s = 0;
  5616. function n(l) {
  5617. return new t(l);
  5618. }
  5619. (n.prototype = t.prototype), (n.__proto__ = t);
  5620. function r(l) {
  5621. return function (c, a) {
  5622. typeof c != "string" ? ((a = c), (c = c.url)) : a == null && (a = {});
  5623. var u = new t(function (w, v) {
  5624. l(
  5625. sh(c, a.params),
  5626. a,
  5627. function (x) {
  5628. if (typeof a.type == "function")
  5629. if (Array.isArray(x)) for (var D = 0; D < x.length; D++) x[D] = new a.type(x[D]);
  5630. else x = new a.type(x);
  5631. w(x);
  5632. },
  5633. v
  5634. );
  5635. });
  5636. if (a.background === !0) return u;
  5637. var p = 0;
  5638. function h() {
  5639. --p === 0 && typeof i == "function" && i();
  5640. }
  5641. return m(u);
  5642. function m(w) {
  5643. var v = w.then;
  5644. return (
  5645. (w.constructor = n),
  5646. (w.then = function () {
  5647. p++;
  5648. var x = v.apply(w, arguments);
  5649. return (
  5650. x.then(h, function (D) {
  5651. if ((h(), p === 0)) throw D;
  5652. }),
  5653. m(x)
  5654. );
  5655. }),
  5656. w
  5657. );
  5658. }
  5659. };
  5660. }
  5661. function o(l, c) {
  5662. for (var a in l.headers) if (Gs.call(l.headers, a) && a.toLowerCase() === c) return !0;
  5663. return !1;
  5664. }
  5665. return {
  5666. request: r(function (l, c, a, u) {
  5667. var p = c.method != null ? c.method.toUpperCase() : "GET",
  5668. h = c.body,
  5669. m = (c.serialize == null || c.serialize === JSON.serialize) && !(h instanceof e.FormData || h instanceof e.URLSearchParams),
  5670. w = c.responseType || (typeof c.extract == "function" ? "" : "json"),
  5671. v = new e.XMLHttpRequest(),
  5672. x = !1,
  5673. D = !1,
  5674. k = v,
  5675. S,
  5676. O = v.abort;
  5677. (v.abort = function () {
  5678. (x = !0), O.call(this);
  5679. }),
  5680. v.open(p, l, c.async !== !1, typeof c.user == "string" ? c.user : void 0, typeof c.password == "string" ? c.password : void 0),
  5681. m && h != null && !o(c, "content-type") && v.setRequestHeader("Content-Type", "application/json; charset=utf-8"),
  5682. typeof c.deserialize != "function" && !o(c, "accept") && v.setRequestHeader("Accept", "application/json, text/*"),
  5683. c.withCredentials && (v.withCredentials = c.withCredentials),
  5684. c.timeout && (v.timeout = c.timeout),
  5685. (v.responseType = w);
  5686. for (var U in c.headers) Gs.call(c.headers, U) && v.setRequestHeader(U, c.headers[U]);
  5687. (v.onreadystatechange = function (L) {
  5688. if (!x && L.target.readyState === 4)
  5689. try {
  5690. var q = (L.target.status >= 200 && L.target.status < 300) || L.target.status === 304 || /^file:\/\//i.test(l),
  5691. P = L.target.response,
  5692. W;
  5693. if (w === "json") {
  5694. if (!L.target.responseType && typeof c.extract != "function")
  5695. try {
  5696. P = JSON.parse(L.target.responseText);
  5697. } catch {
  5698. P = null;
  5699. }
  5700. } else (!w || w === "text") && P == null && (P = L.target.responseText);
  5701. if ((typeof c.extract == "function" ? ((P = c.extract(L.target, c)), (q = !0)) : typeof c.deserialize == "function" && (P = c.deserialize(P)), q)) a(P);
  5702. else {
  5703. var F = function () {
  5704. try {
  5705. W = L.target.responseText;
  5706. } catch {
  5707. W = P;
  5708. }
  5709. var _ = new Error(W);
  5710. (_.code = L.target.status), (_.response = P), u(_);
  5711. };
  5712. v.status === 0
  5713. ? setTimeout(function () {
  5714. D || F();
  5715. })
  5716. : F();
  5717. }
  5718. } catch (_) {
  5719. u(_);
  5720. }
  5721. }),
  5722. (v.ontimeout = function (L) {
  5723. D = !0;
  5724. var q = new Error("Request timed out");
  5725. (q.code = L.target.status), u(q);
  5726. }),
  5727. typeof c.config == "function" &&
  5728. ((v = c.config(v, c, l) || v),
  5729. v !== k &&
  5730. ((S = v.abort),
  5731. (v.abort = function () {
  5732. (x = !0), S.call(this);
  5733. }))),
  5734. 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));
  5735. }),
  5736. jsonp: r(function (l, c, a, u) {
  5737. var p = c.callbackName || "_mithril_" + Math.round(Math.random() * 1e16) + "_" + s++,
  5738. h = e.document.createElement("script");
  5739. (e[p] = function (m) {
  5740. delete e[p], h.parentNode.removeChild(h), a(m);
  5741. }),
  5742. (h.onerror = function () {
  5743. delete e[p], h.parentNode.removeChild(h), u(new Error("JSONP request failed"));
  5744. }),
  5745. (h.src = l + (l.indexOf("?") < 0 ? "?" : "&") + encodeURIComponent(c.callbackKey || "callback") + "=" + encodeURIComponent(p)),
  5746. e.document.documentElement.appendChild(h);
  5747. }),
  5748. };
  5749. },
  5750. oh = yi,
  5751. ah = ss,
  5752. lh = rh(typeof window < "u" ? window : null, oh, ah.redraw),
  5753. ln,
  5754. Ys;
  5755. function no() {
  5756. if (Ys) return ln;
  5757. Ys = 1;
  5758. function e(t) {
  5759. try {
  5760. return decodeURIComponent(t);
  5761. } catch {
  5762. return t;
  5763. }
  5764. }
  5765. return (
  5766. (ln = function (t) {
  5767. if (t === "" || t == null) return {};
  5768. t.charAt(0) === "?" && (t = t.slice(1));
  5769. for (var i = t.split("&"), s = {}, n = {}, r = 0; r < i.length; r++) {
  5770. var o = i[r].split("="),
  5771. l = e(o[0]),
  5772. c = o.length === 2 ? e(o[1]) : "";
  5773. c === "true" ? (c = !0) : c === "false" && (c = !1);
  5774. var a = l.split(/\]\[?|\[/),
  5775. u = n;
  5776. l.indexOf("[") > -1 && a.pop();
  5777. for (var p = 0; p < a.length; p++) {
  5778. var h = a[p],
  5779. m = a[p + 1],
  5780. w = m == "" || !isNaN(parseInt(m, 10));
  5781. if (h === "") {
  5782. var l = a.slice(0, p).join();
  5783. s[l] == null && (s[l] = Array.isArray(u) ? u.length : 0), (h = s[l]++);
  5784. } else if (h === "__proto__") break;
  5785. if (p === a.length - 1) u[h] = c;
  5786. else {
  5787. var v = Object.getOwnPropertyDescriptor(u, h);
  5788. v != null && (v = v.value), v == null && (u[h] = v = w ? [] : {}), (u = v);
  5789. }
  5790. }
  5791. }
  5792. return n;
  5793. }),
  5794. ln
  5795. );
  5796. }
  5797. var cn, $s;
  5798. function os() {
  5799. if ($s) return cn;
  5800. $s = 1;
  5801. var e = no();
  5802. return (
  5803. (cn = function (t) {
  5804. var i = t.indexOf("?"),
  5805. s = t.indexOf("#"),
  5806. n = s < 0 ? t.length : s,
  5807. r = i < 0 ? n : i,
  5808. o = t.slice(0, r).replace(/\/{2,}/g, "/");
  5809. return o ? (o[0] !== "/" && (o = "/" + o), o.length > 1 && o[o.length - 1] === "/" && (o = o.slice(0, -1))) : (o = "/"), { path: o, params: i < 0 ? {} : e(t.slice(i + 1, n)) };
  5810. }),
  5811. cn
  5812. );
  5813. }
  5814. var hn, Ks;
  5815. function ch() {
  5816. if (Ks) return hn;
  5817. Ks = 1;
  5818. var e = os();
  5819. return (
  5820. (hn = function (t) {
  5821. var i = e(t),
  5822. s = Object.keys(i.params),
  5823. n = [],
  5824. r = new RegExp(
  5825. "^" +
  5826. i.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g, function (o, l, c) {
  5827. return l == null ? "\\" + o : (n.push({ k: l, r: c === "..." }), c === "..." ? "(.*)" : c === "." ? "([^/]+)\\." : "([^/]+)" + (c || ""));
  5828. }) +
  5829. "$"
  5830. );
  5831. return function (o) {
  5832. for (var l = 0; l < s.length; l++) if (i.params[s[l]] !== o.params[s[l]]) return !1;
  5833. if (!n.length) return r.test(o.path);
  5834. var c = r.exec(o.path);
  5835. if (c == null) return !1;
  5836. for (var l = 0; l < n.length; l++) o.params[n[l].k] = n[l].r ? c[l + 1] : decodeURIComponent(c[l + 1]);
  5837. return !0;
  5838. };
  5839. }),
  5840. hn
  5841. );
  5842. }
  5843. var fn, Js;
  5844. function so() {
  5845. if (Js) return fn;
  5846. Js = 1;
  5847. var e = Ci,
  5848. t = new RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");
  5849. return (
  5850. (fn = function (i, s) {
  5851. var n = {};
  5852. if (s != null) for (var r in i) e.call(i, r) && !t.test(r) && s.indexOf(r) < 0 && (n[r] = i[r]);
  5853. else for (var r in i) e.call(i, r) && !t.test(r) && (n[r] = i[r]);
  5854. return n;
  5855. }),
  5856. fn
  5857. );
  5858. }
  5859. var un, Qs;
  5860. function hh() {
  5861. if (Qs) return un;
  5862. Qs = 1;
  5863. var e = Ge(),
  5864. t = Zr,
  5865. i = yi,
  5866. s = rs(),
  5867. n = os(),
  5868. r = ch(),
  5869. o = io(),
  5870. l = so(),
  5871. c = {};
  5872. function a(u) {
  5873. try {
  5874. return decodeURIComponent(u);
  5875. } catch {
  5876. return u;
  5877. }
  5878. }
  5879. return (
  5880. (un = function (u, p) {
  5881. var h = u == null ? null : typeof u.setImmediate == "function" ? u.setImmediate : u.setTimeout,
  5882. m = i.resolve(),
  5883. w = !1,
  5884. v = !1,
  5885. x = 0,
  5886. D,
  5887. k,
  5888. S = c,
  5889. O,
  5890. U,
  5891. L,
  5892. q,
  5893. P = {
  5894. onbeforeupdate: function () {
  5895. return (x = x ? 2 : 1), !(!x || c === S);
  5896. },
  5897. onremove: function () {
  5898. u.removeEventListener("popstate", _, !1), u.removeEventListener("hashchange", F, !1);
  5899. },
  5900. view: function () {
  5901. if (!(!x || c === S)) {
  5902. var z = [e(O, U.key, U)];
  5903. return S && (z = S.render(z[0])), z;
  5904. }
  5905. },
  5906. },
  5907. W = (V.SKIP = {});
  5908. function F() {
  5909. w = !1;
  5910. var z = u.location.hash;
  5911. V.prefix[0] !== "#" && ((z = u.location.search + z), V.prefix[0] !== "?" && ((z = u.location.pathname + z), z[0] !== "/" && (z = "/" + z)));
  5912. var X = z
  5913. .concat()
  5914. .replace(/(?:%[a-f89][a-f0-9])+/gim, a)
  5915. .slice(V.prefix.length),
  5916. G = n(X);
  5917. o(G.params, u.history.state);
  5918. function te(K) {
  5919. console.error(K), $(k, null, { replace: !0 });
  5920. }
  5921. ie(0);
  5922. function ie(K) {
  5923. for (; K < D.length; K++)
  5924. if (D[K].check(G)) {
  5925. var ke = D[K].component,
  5926. nt = D[K].route,
  5927. Bi = ke,
  5928. Ue = (q = function (Ye) {
  5929. if (Ue === q) {
  5930. if (Ye === W) return ie(K + 1);
  5931. (O = Ye != null && (typeof Ye.view == "function" || typeof Ye == "function") ? Ye : "div"),
  5932. (U = G.params),
  5933. (L = X),
  5934. (q = null),
  5935. (S = ke.render ? ke : null),
  5936. x === 2 ? p.redraw() : ((x = 2), p.redraw.sync());
  5937. }
  5938. });
  5939. ke.view || typeof ke == "function"
  5940. ? ((ke = {}), Ue(Bi))
  5941. : ke.onmatch
  5942. ? m
  5943. .then(function () {
  5944. return ke.onmatch(G.params, X, nt);
  5945. })
  5946. .then(Ue, X === k ? null : te)
  5947. : Ue("div");
  5948. return;
  5949. }
  5950. if (X === k) throw new Error("Could not resolve default route " + k + ".");
  5951. $(k, null, { replace: !0 });
  5952. }
  5953. }
  5954. function _() {
  5955. w || ((w = !0), h(F));
  5956. }
  5957. function $(z, X, G) {
  5958. if (((z = s(z, X)), v)) {
  5959. _();
  5960. var te = G ? G.state : null,
  5961. ie = G ? G.title : null;
  5962. G && G.replace ? u.history.replaceState(te, ie, V.prefix + z) : u.history.pushState(te, ie, V.prefix + z);
  5963. } else u.location.href = V.prefix + z;
  5964. }
  5965. function V(z, X, G) {
  5966. if (!z) throw new TypeError("DOM element being rendered to does not exist.");
  5967. if (
  5968. ((D = Object.keys(G).map(function (ie) {
  5969. if (ie[0] !== "/") throw new SyntaxError("Routes must start with a '/'.");
  5970. if (/:([^\/\.-]+)(\.{3})?:/.test(ie)) throw new SyntaxError("Route parameter names must be separated with either '/', '.', or '-'.");
  5971. return { route: ie, component: G[ie], check: r(ie) };
  5972. })),
  5973. (k = X),
  5974. X != null)
  5975. ) {
  5976. var te = n(X);
  5977. if (
  5978. !D.some(function (ie) {
  5979. return ie.check(te);
  5980. })
  5981. )
  5982. throw new ReferenceError("Default route doesn't match any known routes.");
  5983. }
  5984. typeof u.history.pushState == "function" ? u.addEventListener("popstate", _, !1) : V.prefix[0] === "#" && u.addEventListener("hashchange", F, !1), (v = !0), p.mount(z, P), F();
  5985. }
  5986. return (
  5987. (V.set = function (z, X, G) {
  5988. q != null && ((G = G || {}), (G.replace = !0)), (q = null), $(z, X, G);
  5989. }),
  5990. (V.get = function () {
  5991. return L;
  5992. }),
  5993. (V.prefix = "#!"),
  5994. (V.Link = {
  5995. view: function (z) {
  5996. var X = t(z.attrs.selector || "a", l(z.attrs, ["options", "params", "selector", "onclick"]), z.children),
  5997. G,
  5998. te,
  5999. ie;
  6000. return (
  6001. (X.attrs.disabled = Boolean(X.attrs.disabled))
  6002. ? ((X.attrs.href = null), (X.attrs["aria-disabled"] = "true"))
  6003. : ((G = z.attrs.options),
  6004. (te = z.attrs.onclick),
  6005. (ie = s(X.attrs.href, z.attrs.params)),
  6006. (X.attrs.href = V.prefix + ie),
  6007. (X.attrs.onclick = function (K) {
  6008. var ke;
  6009. typeof te == "function" ? (ke = te.call(K.currentTarget, K)) : te == null || typeof te != "object" || (typeof te.handleEvent == "function" && te.handleEvent(K)),
  6010. ke !== !1 &&
  6011. !K.defaultPrevented &&
  6012. (K.button === 0 || K.which === 0 || K.which === 1) &&
  6013. (!K.currentTarget.target || K.currentTarget.target === "_self") &&
  6014. !K.ctrlKey &&
  6015. !K.metaKey &&
  6016. !K.shiftKey &&
  6017. !K.altKey &&
  6018. (K.preventDefault(), (K.redraw = !1), V.set(ie, null, G));
  6019. })),
  6020. X
  6021. );
  6022. },
  6023. }),
  6024. (V.param = function (z) {
  6025. return U && z != null ? U[z] : U;
  6026. }),
  6027. V
  6028. );
  6029. }),
  6030. un
  6031. );
  6032. }
  6033. var dn, Zs;
  6034. function fh() {
  6035. if (Zs) return dn;
  6036. Zs = 1;
  6037. var e = ss;
  6038. return (dn = hh()(typeof window < "u" ? window : null, e)), dn;
  6039. }
  6040. var Ai = eh,
  6041. ro = lh,
  6042. oo = ss,
  6043. pe = function () {
  6044. return Ai.apply(this, arguments);
  6045. };
  6046. pe.m = Ai;
  6047. pe.trust = Ai.trust;
  6048. pe.fragment = Ai.fragment;
  6049. pe.Fragment = "[";
  6050. pe.mount = oo.mount;
  6051. pe.route = fh();
  6052. pe.render = eo();
  6053. pe.redraw = oo.redraw;
  6054. pe.request = ro.request;
  6055. pe.jsonp = ro.jsonp;
  6056. pe.parseQueryString = no();
  6057. pe.buildQueryString = to();
  6058. pe.parsePathname = os();
  6059. pe.buildPathname = rs();
  6060. pe.vnode = Ge();
  6061. pe.PromisePolyfill = jr();
  6062. pe.censor = so();
  6063. var Ne = pe;
  6064. function we(e, t, i, s, n) {
  6065. (this.debugLog = !1), (this.baseUrl = e), (this.lobbySize = i), (this.devPort = t), (this.lobbySpread = s), (this.rawIPs = !!n), (this.server = void 0), (this.gameIndex = void 0), (this.callback = void 0), (this.errorCallback = void 0);
  6066. }
  6067. we.prototype.regionInfo = {
  6068. 0: { name: "Local", latitude: 0, longitude: 0 },
  6069. "us-east": { name: "Miami", latitude: 40.1393329, longitude: -75.8521818 },
  6070. "us-west": { name: "Silicon Valley", latitude: 47.6149942, longitude: -122.4759879 },
  6071. gb: { name: "London", latitude: 51.5283063, longitude: -0.382486 },
  6072. "eu-west": { name: "Frankfurt", latitude: 50.1211273, longitude: 8.496137 },
  6073. au: { name: "Sydney", latitude: -33.8479715, longitude: 150.651084 },
  6074. sg: { name: "Singapore", latitude: 1.3147268, longitude: 103.7065876 },
  6075. };
  6076. we.prototype.start = function (e, t, i, s) {
  6077. if (((this.callback = t), (this.errorCallback = i), s)) return t();
  6078. const n = this.parseServerQuery(e);
  6079. n && n.length > 0 ? (this.log("Found server in query."), (this.password = n[3]), this.connect(n[0], n[1], n[2])) : this.errorCallback("Unable to find server");
  6080. };
  6081. we.prototype.parseServerQuery = function (e) {
  6082. const t = new URLSearchParams(location.search, !0),
  6083. i = e || t.get("server");
  6084. if (typeof i != "string") return [];
  6085. const [s, n] = i.split(":");
  6086. return [s, n, t.get("password")];
  6087. };
  6088. we.prototype.findServer = function (e, t) {
  6089. var i = this.servers[e];
  6090. for (let s = 0; s < i.length; s++) {
  6091. const n = i[s];
  6092. if (n.name === t) return n;
  6093. }
  6094. console.warn("Could not find server in region " + e + " with serverName " + t + ".");
  6095. };
  6096. we.prototype.seekServer = function (e, t, i) {
  6097. i == null && (i = "random"), t == null && (t = !1);
  6098. const s = ["random"],
  6099. n = this.lobbySize,
  6100. r = this.lobbySpread,
  6101. o = this.servers[e]
  6102. .flatMap(function (h) {
  6103. let m = 0;
  6104. return h.games.map(function (w) {
  6105. const v = m++;
  6106. return { region: h.region, index: h.index * h.games.length + v, gameIndex: v, gameCount: h.games.length, playerCount: w.playerCount, playerCapacity: w.playerCapacity, isPrivate: w.isPrivate };
  6107. });
  6108. })
  6109. .filter(function (h) {
  6110. return !h.isPrivate;
  6111. })
  6112. .filter(function (h) {
  6113. return t ? h.playerCount == 0 && h.gameIndex >= h.gameCount / 2 : !0;
  6114. })
  6115. .filter(function (h) {
  6116. return i == "random" ? !0 : s[h.index % s.length].key == i;
  6117. })
  6118. .sort(function (h, m) {
  6119. return m.playerCount - h.playerCount;
  6120. })
  6121. .filter(function (h) {
  6122. return h.playerCount < n;
  6123. });
  6124. if ((t && o.reverse(), o.length == 0)) {
  6125. this.errorCallback("No open servers.");
  6126. return;
  6127. }
  6128. const l = Math.min(r, o.length);
  6129. var u = Math.floor(Math.random() * l);
  6130. u = Math.min(u, o.length - 1);
  6131. const c = o[u],
  6132. a = c.region;
  6133. var u = Math.floor(c.index / c.gameCount);
  6134. const p = c.index % c.gameCount;
  6135. return this.log("Found server."), [a, u, p];
  6136. };
  6137. we.prototype.connect = function (e, t, i) {
  6138. if (this.connected) return;
  6139. const s = this.findServer(e, t);
  6140. if (s == null) {
  6141. this.errorCallback("Failed to find server for region " + e + " and serverName " + t);
  6142. return;
  6143. }
  6144. if ((this.log("Connecting to server", s, "with game index", i), s.playerCount >= s.playerCapacity)) {
  6145. this.errorCallback("Server is already full.");
  6146. return;
  6147. }
  6148. window.history.replaceState(document.title, document.title, this.generateHref(e, t, this.password)),
  6149. (this.server = s),
  6150. (this.gameIndex = i),
  6151. this.log("Calling callback with address", this.serverAddress(s), "on port", this.serverPort(s)),
  6152. this.callback(this.serverAddress(s), this.serverPort(s), i),
  6153. Lt && clearInterval(Lt);
  6154. };
  6155. we.prototype.switchServer = function (e, t) {
  6156. (this.switchingServers = !0), (window.location = this.generateHref(e, t, null));
  6157. };
  6158. we.prototype.generateHref = function (e, t, i) {
  6159. let s = window.location.href.split("?")[0];
  6160. return (s += "?server=" + e + ":" + t), i && (s += "&password=" + encodeURIComponent(i)), s;
  6161. };
  6162. we.prototype.serverAddress = function (e) {
  6163. return e.region == 0 ? "localhost" : e.key + "." + e.region + "." + this.baseUrl;
  6164. };
  6165. we.prototype.serverPort = function (e) {
  6166. return e.port;
  6167. };
  6168. let Lt;
  6169. function uh(e) {
  6170. e = e.filter((n) => n.playerCount !== n.playerCapacity);
  6171. const t = Math.min(...e.map((n) => n.ping || 1 / 0)),
  6172. i = e.filter((n) => n.ping === t);
  6173. return !i.length > 0 ? null : i.reduce((n, r) => (n.playerCount > r.playerCount ? n : r));
  6174. }
  6175. we.prototype.processServers = function (e) {
  6176. return (
  6177. Lt && clearInterval(Lt),
  6178. new Promise((t) => {
  6179. const i = {},
  6180. s = (c) => {
  6181. const a = i[c],
  6182. u = a[0];
  6183. let p = this.serverAddress(u);
  6184. const h = this.serverPort(u);
  6185. h && (p += `:${h}`);
  6186. const m = `https://${p}/ping`,
  6187. w = new Date().getTime();
  6188. return Promise.race([
  6189. fetch(m)
  6190. .then(() => {
  6191. const v = new Date().getTime() - w;
  6192. a.forEach((x) => {
  6193. (x.pings = x.pings ?? []), x.pings.push(v), x.pings.length > 10 && x.pings.shift(), (x.ping = Math.floor(x.pings.reduce((D, k) => D + k, 0) / x.pings.length));
  6194. });
  6195. })
  6196. .catch(() => {}),
  6197. new Promise((v) => setTimeout(() => v(), 100)),
  6198. ]);
  6199. },
  6200. n = async () => {
  6201. await Promise.all(Object.keys(i).map(s)), window.blockRedraw || Ne.redraw();
  6202. };
  6203. e.forEach((c) => {
  6204. (i[c.region] = i[c.region] || []), i[c.region].push(c);
  6205. });
  6206. for (const c in i)
  6207. i[c] = i[c].sort(function (a, u) {
  6208. return u.playerCount - a.playerCount;
  6209. });
  6210. this.servers = i;
  6211. let r;
  6212. const [o, l] = this.parseServerQuery();
  6213. e.forEach((c) => {
  6214. o === c.region && l === c.name && ((c.selected = !0), (r = c));
  6215. }),
  6216. n()
  6217. .then(n)
  6218. .then(() => {
  6219. if (r) return;
  6220. let c = uh(e);
  6221. c || (c = e[0]), c && ((c.selected = !0), window.history.replaceState(document.title, document.title, this.generateHref(c.region, c.name, this.password))), window.blockRedraw || Ne.redraw();
  6222. })
  6223. .then(n)
  6224. .catch((c) => {})
  6225. .finally(t),
  6226. (Lt = setInterval(n, 5e3));
  6227. })
  6228. );
  6229. };
  6230. we.prototype.ipToHex = function (e) {
  6231. return e
  6232. .split(".")
  6233. .map((i) => ("00" + parseInt(i).toString(16)).substr(-2))
  6234. .join("")
  6235. .toLowerCase();
  6236. };
  6237. we.prototype.hashIP = function (e) {
  6238. return On(this.ipToHex(e));
  6239. };
  6240. we.prototype.log = function () {
  6241. if (this.debugLog) return console.log.apply(void 0, arguments);
  6242. if (console.verbose) return console.verbose.apply(void 0, arguments);
  6243. };
  6244. we.prototype.stripRegion = function (e) {
  6245. return e.startsWith("vultr:") ? (e = e.slice(6)) : e.startsWith("do:") && (e = e.slice(3)), e;
  6246. };
  6247. const dh = function (e, t) {
  6248. return e.concat(t);
  6249. },
  6250. ph = function (e, t) {
  6251. return t.map(e).reduce(dh, []);
  6252. };
  6253. Array.prototype.flatMap = function (e) {
  6254. return ph(e, this);
  6255. };
  6256. const fi = (e, t) => {
  6257. const i = t.x - e.x,
  6258. s = t.y - e.y;
  6259. return Math.sqrt(i * i + s * s);
  6260. },
  6261. mh = (e, t) => {
  6262. const i = t.x - e.x,
  6263. s = t.y - e.y;
  6264. return yh(Math.atan2(s, i));
  6265. },
  6266. gh = (e, t, i) => {
  6267. const s = { x: 0, y: 0 };
  6268. return (i = Bn(i)), (s.x = e.x - t * Math.cos(i)), (s.y = e.y - t * Math.sin(i)), s;
  6269. },
  6270. Bn = (e) => e * (Math.PI / 180),
  6271. yh = (e) => e * (180 / Math.PI),
  6272. wh = (e) => (isNaN(e.buttons) ? e.pressure !== 0 : e.buttons !== 0),
  6273. pn = new Map(),
  6274. js = (e) => {
  6275. pn.has(e) && clearTimeout(pn.get(e)), pn.set(e, setTimeout(e, 100));
  6276. },
  6277. wi = (e, t, i) => {
  6278. const s = t.split(/[ ,]+/g);
  6279. let n;
  6280. for (let r = 0; r < s.length; r += 1) (n = s[r]), e.addEventListener ? e.addEventListener(n, i, !1) : e.attachEvent && e.attachEvent(n, i);
  6281. },
  6282. er = (e, t, i) => {
  6283. const s = t.split(/[ ,]+/g);
  6284. let n;
  6285. for (let r = 0; r < s.length; r += 1) (n = s[r]), e.removeEventListener ? e.removeEventListener(n, i) : e.detachEvent && e.detachEvent(n, i);
  6286. },
  6287. ao = (e) => (e.preventDefault(), e.type.match(/^touch/) ? e.changedTouches : e),
  6288. tr = () => {
  6289. const e = window.pageXOffset !== void 0 ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft,
  6290. t = window.pageYOffset !== void 0 ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
  6291. return { x: e, y: t };
  6292. },
  6293. ir = (e, t) => {
  6294. t.top || t.right || t.bottom || t.left ? ((e.style.top = t.top), (e.style.right = t.right), (e.style.bottom = t.bottom), (e.style.left = t.left)) : ((e.style.left = t.x + "px"), (e.style.top = t.y + "px"));
  6295. },
  6296. as = (e, t, i) => {
  6297. const s = lo(e);
  6298. for (let n in s)
  6299. if (s.hasOwnProperty(n))
  6300. if (typeof t == "string") s[n] = t + " " + i;
  6301. else {
  6302. let r = "";
  6303. for (let o = 0, l = t.length; o < l; o += 1) r += t[o] + " " + i + ", ";
  6304. s[n] = r.slice(0, -2);
  6305. }
  6306. return s;
  6307. },
  6308. kh = (e, t) => {
  6309. const i = lo(e);
  6310. for (let s in i) i.hasOwnProperty(s) && (i[s] = t);
  6311. return i;
  6312. },
  6313. lo = (e) => {
  6314. const t = {};
  6315. return (
  6316. (t[e] = ""),
  6317. ["webkit", "Moz", "o"].forEach(function (s) {
  6318. t[s + e.charAt(0).toUpperCase() + e.slice(1)] = "";
  6319. }),
  6320. t
  6321. );
  6322. },
  6323. mn = (e, t) => {
  6324. for (let i in t) t.hasOwnProperty(i) && (e[i] = t[i]);
  6325. return e;
  6326. },
  6327. vh = (e, t) => {
  6328. const i = {};
  6329. for (let s in e) e.hasOwnProperty(s) && t.hasOwnProperty(s) ? (i[s] = t[s]) : e.hasOwnProperty(s) && (i[s] = e[s]);
  6330. return i;
  6331. },
  6332. zn = (e, t) => {
  6333. if (e.length) for (let i = 0, s = e.length; i < s; i += 1) t(e[i]);
  6334. else t(e);
  6335. },
  6336. xh = (e, t, i) => ({ x: Math.min(Math.max(e.x, t.x - i), t.x + i), y: Math.min(Math.max(e.y, t.y - i), t.y + i) });
  6337. var bh = "ontouchstart" in window,
  6338. Sh = !!window.PointerEvent,
  6339. Th = !!window.MSPointerEvent,
  6340. Bt = {
  6341. touch: { start: "touchstart", move: "touchmove", end: "touchend, touchcancel" },
  6342. mouse: { start: "mousedown", move: "mousemove", end: "mouseup" },
  6343. pointer: { start: "pointerdown", move: "pointermove", end: "pointerup, pointercancel" },
  6344. MSPointer: { start: "MSPointerDown", move: "MSPointerMove", end: "MSPointerUp" },
  6345. },
  6346. vt,
  6347. Kt = {};
  6348. Sh ? (vt = Bt.pointer) : Th ? (vt = Bt.MSPointer) : bh ? ((vt = Bt.touch), (Kt = Bt.mouse)) : (vt = Bt.mouse);
  6349. function Ve() {}
  6350. Ve.prototype.on = function (e, t) {
  6351. var i = this,
  6352. s = e.split(/[ ,]+/g),
  6353. n;
  6354. i._handlers_ = i._handlers_ || {};
  6355. for (var r = 0; r < s.length; r += 1) (n = s[r]), (i._handlers_[n] = i._handlers_[n] || []), i._handlers_[n].push(t);
  6356. return i;
  6357. };
  6358. Ve.prototype.off = function (e, t) {
  6359. var i = this;
  6360. return (i._handlers_ = i._handlers_ || {}), 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), i;
  6361. };
  6362. Ve.prototype.trigger = function (e, t) {
  6363. var i = this,
  6364. s = e.split(/[ ,]+/g),
  6365. n;
  6366. i._handlers_ = i._handlers_ || {};
  6367. for (var r = 0; r < s.length; r += 1)
  6368. (n = s[r]),
  6369. i._handlers_[n] &&
  6370. i._handlers_[n].length &&
  6371. i._handlers_[n].forEach(function (o) {
  6372. o.call(i, { type: n, target: i }, t);
  6373. });
  6374. };
  6375. Ve.prototype.config = function (e) {
  6376. var t = this;
  6377. (t.options = t.defaults || {}), e && (t.options = vh(t.options, e));
  6378. };
  6379. Ve.prototype.bindEvt = function (e, t) {
  6380. var i = this;
  6381. return (
  6382. (i._domHandlers_ = i._domHandlers_ || {}),
  6383. (i._domHandlers_[t] = function () {
  6384. typeof i["on" + t] == "function" ? i["on" + t].apply(i, arguments) : console.warn('[WARNING] : Missing "on' + t + '" handler.');
  6385. }),
  6386. wi(e, vt[t], i._domHandlers_[t]),
  6387. Kt[t] && wi(e, Kt[t], i._domHandlers_[t]),
  6388. i
  6389. );
  6390. };
  6391. Ve.prototype.unbindEvt = function (e, t) {
  6392. var i = this;
  6393. return (i._domHandlers_ = i._domHandlers_ || {}), er(e, vt[t], i._domHandlers_[t]), Kt[t] && er(e, Kt[t], i._domHandlers_[t]), delete i._domHandlers_[t], this;
  6394. };
  6395. function he(e, t) {
  6396. return (
  6397. (this.identifier = t.identifier),
  6398. (this.position = t.position),
  6399. (this.frontPosition = t.frontPosition),
  6400. (this.collection = e),
  6401. (this.defaults = { size: 100, threshold: 0.1, color: "white", fadeTime: 250, dataOnly: !1, restJoystick: !0, restOpacity: 0.5, mode: "dynamic", zone: document.body, lockX: !1, lockY: !1, shape: "circle" }),
  6402. this.config(t),
  6403. this.options.mode === "dynamic" && (this.options.restOpacity = 0),
  6404. (this.id = he.id),
  6405. (he.id += 1),
  6406. this.buildEl().stylize(),
  6407. (this.instance = {
  6408. el: this.ui.el,
  6409. on: this.on.bind(this),
  6410. off: this.off.bind(this),
  6411. show: this.show.bind(this),
  6412. hide: this.hide.bind(this),
  6413. add: this.addToDom.bind(this),
  6414. remove: this.removeFromDom.bind(this),
  6415. destroy: this.destroy.bind(this),
  6416. setPosition: this.setPosition.bind(this),
  6417. resetDirection: this.resetDirection.bind(this),
  6418. computeDirection: this.computeDirection.bind(this),
  6419. trigger: this.trigger.bind(this),
  6420. position: this.position,
  6421. frontPosition: this.frontPosition,
  6422. ui: this.ui,
  6423. identifier: this.identifier,
  6424. id: this.id,
  6425. options: this.options,
  6426. }),
  6427. this.instance
  6428. );
  6429. }
  6430. he.prototype = new Ve();
  6431. he.constructor = he;
  6432. he.id = 0;
  6433. he.prototype.buildEl = function (e) {
  6434. return (
  6435. (this.ui = {}),
  6436. this.options.dataOnly
  6437. ? this
  6438. : ((this.ui.el = document.createElement("div")),
  6439. (this.ui.back = document.createElement("div")),
  6440. (this.ui.front = document.createElement("div")),
  6441. (this.ui.el.className = "nipple collection_" + this.collection.id),
  6442. (this.ui.back.className = "back"),
  6443. (this.ui.front.className = "front"),
  6444. this.ui.el.setAttribute("id", "nipple_" + this.collection.id + "_" + this.id),
  6445. this.ui.el.appendChild(this.ui.back),
  6446. this.ui.el.appendChild(this.ui.front),
  6447. this)
  6448. );
  6449. };
  6450. he.prototype.stylize = function () {
  6451. if (this.options.dataOnly) return this;
  6452. var e = this.options.fadeTime + "ms",
  6453. t = kh("borderRadius", "50%"),
  6454. i = as("transition", "opacity", e),
  6455. s = {};
  6456. return (
  6457. (s.el = { position: "absolute", opacity: this.options.restOpacity, display: "block", zIndex: 999 }),
  6458. (s.back = {
  6459. position: "absolute",
  6460. display: "block",
  6461. width: this.options.size + "px",
  6462. height: this.options.size + "px",
  6463. marginLeft: -this.options.size / 2 + "px",
  6464. marginTop: -this.options.size / 2 + "px",
  6465. background: this.options.color,
  6466. opacity: ".5",
  6467. }),
  6468. (s.front = {
  6469. width: this.options.size / 2 + "px",
  6470. height: this.options.size / 2 + "px",
  6471. position: "absolute",
  6472. display: "block",
  6473. marginLeft: -this.options.size / 4 + "px",
  6474. marginTop: -this.options.size / 4 + "px",
  6475. background: this.options.color,
  6476. opacity: ".5",
  6477. transform: "translate(0px, 0px)",
  6478. }),
  6479. mn(s.el, i),
  6480. this.options.shape === "circle" && mn(s.back, t),
  6481. mn(s.front, t),
  6482. this.applyStyles(s),
  6483. this
  6484. );
  6485. };
  6486. he.prototype.applyStyles = function (e) {
  6487. for (var t in this.ui) if (this.ui.hasOwnProperty(t)) for (var i in e[t]) this.ui[t].style[i] = e[t][i];
  6488. return this;
  6489. };
  6490. he.prototype.addToDom = function () {
  6491. return this.options.dataOnly || document.body.contains(this.ui.el) ? this : (this.options.zone.appendChild(this.ui.el), this);
  6492. };
  6493. he.prototype.removeFromDom = function () {
  6494. return this.options.dataOnly || !document.body.contains(this.ui.el) ? this : (this.options.zone.removeChild(this.ui.el), this);
  6495. };
  6496. he.prototype.destroy = function () {
  6497. clearTimeout(this.removeTimeout), clearTimeout(this.showTimeout), clearTimeout(this.restTimeout), this.trigger("destroyed", this.instance), this.removeFromDom(), this.off();
  6498. };
  6499. he.prototype.show = function (e) {
  6500. var t = this;
  6501. return (
  6502. t.options.dataOnly ||
  6503. (clearTimeout(t.removeTimeout),
  6504. clearTimeout(t.showTimeout),
  6505. clearTimeout(t.restTimeout),
  6506. t.addToDom(),
  6507. t.restCallback(),
  6508. setTimeout(function () {
  6509. t.ui.el.style.opacity = 1;
  6510. }, 0),
  6511. (t.showTimeout = setTimeout(function () {
  6512. t.trigger("shown", t.instance), typeof e == "function" && e.call(this);
  6513. }, t.options.fadeTime))),
  6514. t
  6515. );
  6516. };
  6517. he.prototype.hide = function (e) {
  6518. var t = this;
  6519. if (t.options.dataOnly) return t;
  6520. if (
  6521. ((t.ui.el.style.opacity = t.options.restOpacity),
  6522. clearTimeout(t.removeTimeout),
  6523. clearTimeout(t.showTimeout),
  6524. clearTimeout(t.restTimeout),
  6525. (t.removeTimeout = setTimeout(function () {
  6526. var i = t.options.mode === "dynamic" ? "none" : "block";
  6527. (t.ui.el.style.display = i), typeof e == "function" && e.call(t), t.trigger("hidden", t.instance);
  6528. }, t.options.fadeTime)),
  6529. t.options.restJoystick)
  6530. ) {
  6531. const i = t.options.restJoystick,
  6532. s = {};
  6533. (s.x = i === !0 || i.x !== !1 ? 0 : t.instance.frontPosition.x), (s.y = i === !0 || i.y !== !1 ? 0 : t.instance.frontPosition.y), t.setPosition(e, s);
  6534. }
  6535. return t;
  6536. };
  6537. he.prototype.setPosition = function (e, t) {
  6538. var i = this;
  6539. i.frontPosition = { x: t.x, y: t.y };
  6540. var s = i.options.fadeTime + "ms",
  6541. n = {};
  6542. n.front = as("transition", ["transform"], s);
  6543. var r = { front: {} };
  6544. (r.front = { transform: "translate(" + i.frontPosition.x + "px," + i.frontPosition.y + "px)" }),
  6545. i.applyStyles(n),
  6546. i.applyStyles(r),
  6547. (i.restTimeout = setTimeout(function () {
  6548. typeof e == "function" && e.call(i), i.restCallback();
  6549. }, i.options.fadeTime));
  6550. };
  6551. he.prototype.restCallback = function () {
  6552. var e = this,
  6553. t = {};
  6554. (t.front = as("transition", "none", "")), e.applyStyles(t), e.trigger("rested", e.instance);
  6555. };
  6556. he.prototype.resetDirection = function () {
  6557. this.direction = { x: !1, y: !1, angle: !1 };
  6558. };
  6559. he.prototype.computeDirection = function (e) {
  6560. var t = e.angle.radian,
  6561. i = Math.PI / 4,
  6562. s = Math.PI / 2,
  6563. n,
  6564. r,
  6565. o;
  6566. if (
  6567. (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"),
  6568. e.lockY || (t > -s && t < s ? (r = "left") : (r = "right")),
  6569. e.lockX || (t > 0 ? (o = "up") : (o = "down")),
  6570. e.force > this.options.threshold)
  6571. ) {
  6572. var l = {},
  6573. c;
  6574. for (c in this.direction) this.direction.hasOwnProperty(c) && (l[c] = this.direction[c]);
  6575. var a = {};
  6576. (this.direction = { x: r, y: o, angle: n }), (e.direction = this.direction);
  6577. for (c in l) l[c] === this.direction[c] && (a[c] = !0);
  6578. if (a.x && a.y && a.angle) return e;
  6579. (!a.x || !a.y) && this.trigger("plain", e), a.x || this.trigger("plain:" + r, e), a.y || this.trigger("plain:" + o, e), a.angle || this.trigger("dir dir:" + n, e);
  6580. } else this.resetDirection();
  6581. return e;
  6582. };
  6583. function ae(e, t) {
  6584. var i = this;
  6585. (i.nipples = []),
  6586. (i.idles = []),
  6587. (i.actives = []),
  6588. (i.ids = []),
  6589. (i.pressureIntervals = {}),
  6590. (i.manager = e),
  6591. (i.id = ae.id),
  6592. (ae.id += 1),
  6593. (i.defaults = {
  6594. zone: document.body,
  6595. multitouch: !1,
  6596. maxNumberOfNipples: 10,
  6597. mode: "dynamic",
  6598. position: { top: 0, left: 0 },
  6599. catchDistance: 200,
  6600. size: 100,
  6601. threshold: 0.1,
  6602. color: "white",
  6603. fadeTime: 250,
  6604. dataOnly: !1,
  6605. restJoystick: !0,
  6606. restOpacity: 0.5,
  6607. lockX: !1,
  6608. lockY: !1,
  6609. shape: "circle",
  6610. dynamicPage: !1,
  6611. follow: !1,
  6612. }),
  6613. i.config(t),
  6614. (i.options.mode === "static" || i.options.mode === "semi") && (i.options.multitouch = !1),
  6615. i.options.multitouch || (i.options.maxNumberOfNipples = 1);
  6616. const s = getComputedStyle(i.options.zone.parentElement);
  6617. return s && s.display === "flex" && (i.parentIsFlex = !0), i.updateBox(), i.prepareNipples(), i.bindings(), i.begin(), i.nipples;
  6618. }
  6619. ae.prototype = new Ve();
  6620. ae.constructor = ae;
  6621. ae.id = 0;
  6622. ae.prototype.prepareNipples = function () {
  6623. var e = this,
  6624. t = e.nipples;
  6625. (t.on = e.on.bind(e)),
  6626. (t.off = e.off.bind(e)),
  6627. (t.options = e.options),
  6628. (t.destroy = e.destroy.bind(e)),
  6629. (t.ids = e.ids),
  6630. (t.id = e.id),
  6631. (t.processOnMove = e.processOnMove.bind(e)),
  6632. (t.processOnEnd = e.processOnEnd.bind(e)),
  6633. (t.get = function (i) {
  6634. if (i === void 0) return t[0];
  6635. for (var s = 0, n = t.length; s < n; s += 1) if (t[s].identifier === i) return t[s];
  6636. return !1;
  6637. });
  6638. };
  6639. ae.prototype.bindings = function () {
  6640. var e = this;
  6641. e.bindEvt(e.options.zone, "start"), (e.options.zone.style.touchAction = "none"), (e.options.zone.style.msTouchAction = "none");
  6642. };
  6643. ae.prototype.begin = function () {
  6644. var e = this,
  6645. t = e.options;
  6646. if (t.mode === "static") {
  6647. var i = e.createNipple(t.position, e.manager.getIdentifier());
  6648. i.add(), e.idles.push(i);
  6649. }
  6650. };
  6651. ae.prototype.createNipple = function (e, t) {
  6652. var i = this,
  6653. s = i.manager.scroll,
  6654. n = {},
  6655. r = i.options,
  6656. o = { x: i.parentIsFlex ? s.x : s.x + i.box.left, y: i.parentIsFlex ? s.y : s.y + i.box.top };
  6657. if (e.x && e.y) n = { x: e.x - o.x, y: e.y - o.y };
  6658. else if (e.top || e.right || e.bottom || e.left) {
  6659. var l = document.createElement("DIV");
  6660. (l.style.display = "hidden"), (l.style.top = e.top), (l.style.right = e.right), (l.style.bottom = e.bottom), (l.style.left = e.left), (l.style.position = "absolute"), r.zone.appendChild(l);
  6661. var c = l.getBoundingClientRect();
  6662. r.zone.removeChild(l), (n = e), (e = { x: c.left + s.x, y: c.top + s.y });
  6663. }
  6664. var a = new he(i, {
  6665. color: r.color,
  6666. size: r.size,
  6667. threshold: r.threshold,
  6668. fadeTime: r.fadeTime,
  6669. dataOnly: r.dataOnly,
  6670. restJoystick: r.restJoystick,
  6671. restOpacity: r.restOpacity,
  6672. mode: r.mode,
  6673. identifier: t,
  6674. position: e,
  6675. zone: r.zone,
  6676. frontPosition: { x: 0, y: 0 },
  6677. shape: r.shape,
  6678. });
  6679. return r.dataOnly || (ir(a.ui.el, n), ir(a.ui.front, a.frontPosition)), i.nipples.push(a), i.trigger("added " + a.identifier + ":added", a), i.manager.trigger("added " + a.identifier + ":added", a), i.bindNipple(a), a;
  6680. };
  6681. ae.prototype.updateBox = function () {
  6682. var e = this;
  6683. e.box = e.options.zone.getBoundingClientRect();
  6684. };
  6685. ae.prototype.bindNipple = function (e) {
  6686. var t = this,
  6687. i,
  6688. s = function (n, r) {
  6689. (i = n.type + " " + r.id + ":" + n.type), t.trigger(i, r);
  6690. };
  6691. e.on("destroyed", t.onDestroyed.bind(t)), e.on("shown hidden rested dir plain", s), e.on("dir:up dir:right dir:down dir:left", s), e.on("plain:up plain:right plain:down plain:left", s);
  6692. };
  6693. ae.prototype.pressureFn = function (e, t, i) {
  6694. var s = this,
  6695. n = 0;
  6696. clearInterval(s.pressureIntervals[i]),
  6697. (s.pressureIntervals[i] = setInterval(
  6698. function () {
  6699. var r = e.force || e.pressure || e.webkitForce || 0;
  6700. r !== n && (t.trigger("pressure", r), s.trigger("pressure " + t.identifier + ":pressure", r), (n = r));
  6701. }.bind(s),
  6702. 100
  6703. ));
  6704. };
  6705. ae.prototype.onstart = function (e) {
  6706. var t = this,
  6707. i = t.options,
  6708. s = e;
  6709. (e = ao(e)), t.updateBox();
  6710. var n = function (r) {
  6711. t.actives.length < i.maxNumberOfNipples
  6712. ? t.processOnStart(r)
  6713. : s.type.match(/^touch/) &&
  6714. (Object.keys(t.manager.ids).forEach(function (o) {
  6715. if (
  6716. Object.values(s.touches).findIndex(function (c) {
  6717. return c.identifier === o;
  6718. }) < 0
  6719. ) {
  6720. var l = [e[0]];
  6721. (l.identifier = o), t.processOnEnd(l);
  6722. }
  6723. }),
  6724. t.actives.length < i.maxNumberOfNipples && t.processOnStart(r));
  6725. };
  6726. return zn(e, n), t.manager.bindDocument(), !1;
  6727. };
  6728. ae.prototype.processOnStart = function (e) {
  6729. var t = this,
  6730. i = t.options,
  6731. s,
  6732. n = t.manager.getIdentifier(e),
  6733. r = e.force || e.pressure || e.webkitForce || 0,
  6734. o = { x: e.pageX, y: e.pageY },
  6735. l = t.getOrCreate(n, o);
  6736. l.identifier !== n && t.manager.removeIdentifier(l.identifier), (l.identifier = n);
  6737. var c = function (u) {
  6738. u.trigger("start", u), t.trigger("start " + u.id + ":start", u), u.show(), r > 0 && t.pressureFn(e, u, u.identifier), t.processOnMove(e);
  6739. };
  6740. if (((s = t.idles.indexOf(l)) >= 0 && t.idles.splice(s, 1), t.actives.push(l), t.ids.push(l.identifier), i.mode !== "semi")) c(l);
  6741. else {
  6742. var a = fi(o, l.position);
  6743. if (a <= i.catchDistance) c(l);
  6744. else {
  6745. l.destroy(), t.processOnStart(e);
  6746. return;
  6747. }
  6748. }
  6749. return l;
  6750. };
  6751. ae.prototype.getOrCreate = function (e, t) {
  6752. var i = this,
  6753. s = i.options,
  6754. n;
  6755. return /(semi|static)/.test(s.mode) ? ((n = i.idles[0]), n ? (i.idles.splice(0, 1), n) : s.mode === "semi" ? i.createNipple(t, e) : (console.warn("Coudln't find the needed nipple."), !1)) : ((n = i.createNipple(t, e)), n);
  6756. };
  6757. ae.prototype.processOnMove = function (e) {
  6758. var t = this,
  6759. i = t.options,
  6760. s = t.manager.getIdentifier(e),
  6761. n = t.nipples.get(s),
  6762. r = t.manager.scroll;
  6763. if (!wh(e)) {
  6764. this.processOnEnd(e);
  6765. return;
  6766. }
  6767. if (!n) {
  6768. console.error("Found zombie joystick with ID " + s), t.manager.removeIdentifier(s);
  6769. return;
  6770. }
  6771. if (i.dynamicPage) {
  6772. var o = n.el.getBoundingClientRect();
  6773. n.position = { x: r.x + o.left, y: r.y + o.top };
  6774. }
  6775. n.identifier = s;
  6776. var l = n.options.size / 2,
  6777. c = { x: e.pageX, y: e.pageY };
  6778. i.lockX && (c.y = n.position.y), i.lockY && (c.x = n.position.x);
  6779. var a = fi(c, n.position),
  6780. u = mh(c, n.position),
  6781. p = Bn(u),
  6782. h = a / l,
  6783. m = { distance: a, position: c },
  6784. w,
  6785. v;
  6786. if ((n.options.shape === "circle" ? ((w = Math.min(a, l)), (v = gh(n.position, w, u))) : ((v = xh(c, n.position, l)), (w = fi(v, n.position))), i.follow)) {
  6787. if (a > l) {
  6788. let S = c.x - v.x,
  6789. O = c.y - v.y;
  6790. (n.position.x += S), (n.position.y += O), (n.el.style.top = n.position.y - (t.box.top + r.y) + "px"), (n.el.style.left = n.position.x - (t.box.left + r.x) + "px"), (a = fi(c, n.position));
  6791. }
  6792. } else (c = v), (a = w);
  6793. var x = c.x - n.position.x,
  6794. D = c.y - n.position.y;
  6795. (n.frontPosition = { x, y: D }), i.dataOnly || (n.ui.front.style.transform = "translate(" + x + "px," + D + "px)");
  6796. var k = {
  6797. identifier: n.identifier,
  6798. position: c,
  6799. force: h,
  6800. pressure: e.force || e.pressure || e.webkitForce || 0,
  6801. distance: a,
  6802. angle: { radian: p, degree: u },
  6803. vector: { x: x / l, y: -D / l },
  6804. raw: m,
  6805. instance: n,
  6806. lockX: i.lockX,
  6807. lockY: i.lockY,
  6808. };
  6809. (k = n.computeDirection(k)), (k.angle = { radian: Bn(180 - u), degree: 180 - u }), n.trigger("move", k), t.trigger("move " + n.id + ":move", k);
  6810. };
  6811. ae.prototype.processOnEnd = function (e) {
  6812. var t = this,
  6813. i = t.options,
  6814. s = t.manager.getIdentifier(e),
  6815. n = t.nipples.get(s),
  6816. r = t.manager.removeIdentifier(n.identifier);
  6817. n &&
  6818. (i.dataOnly ||
  6819. n.hide(function () {
  6820. i.mode === "dynamic" && (n.trigger("removed", n), t.trigger("removed " + n.id + ":removed", n), t.manager.trigger("removed " + n.id + ":removed", n), n.destroy());
  6821. }),
  6822. clearInterval(t.pressureIntervals[n.identifier]),
  6823. n.resetDirection(),
  6824. n.trigger("end", n),
  6825. t.trigger("end " + n.id + ":end", n),
  6826. t.ids.indexOf(n.identifier) >= 0 && t.ids.splice(t.ids.indexOf(n.identifier), 1),
  6827. t.actives.indexOf(n) >= 0 && t.actives.splice(t.actives.indexOf(n), 1),
  6828. /(semi|static)/.test(i.mode) ? t.idles.push(n) : t.nipples.indexOf(n) >= 0 && t.nipples.splice(t.nipples.indexOf(n), 1),
  6829. t.manager.unbindDocument(),
  6830. /(semi|static)/.test(i.mode) && (t.manager.ids[r.id] = r.identifier));
  6831. };
  6832. ae.prototype.onDestroyed = function (e, t) {
  6833. var i = this;
  6834. i.nipples.indexOf(t) >= 0 && i.nipples.splice(i.nipples.indexOf(t), 1),
  6835. i.actives.indexOf(t) >= 0 && i.actives.splice(i.actives.indexOf(t), 1),
  6836. i.idles.indexOf(t) >= 0 && i.idles.splice(i.idles.indexOf(t), 1),
  6837. i.ids.indexOf(t.identifier) >= 0 && i.ids.splice(i.ids.indexOf(t.identifier), 1),
  6838. i.manager.removeIdentifier(t.identifier),
  6839. i.manager.unbindDocument();
  6840. };
  6841. ae.prototype.destroy = function () {
  6842. var e = this;
  6843. e.unbindEvt(e.options.zone, "start"),
  6844. e.nipples.forEach(function (i) {
  6845. i.destroy();
  6846. });
  6847. for (var t in e.pressureIntervals) e.pressureIntervals.hasOwnProperty(t) && clearInterval(e.pressureIntervals[t]);
  6848. e.trigger("destroyed", e.nipples), e.manager.unbindDocument(), e.off();
  6849. };
  6850. function de(e) {
  6851. var t = this;
  6852. (t.ids = {}), (t.index = 0), (t.collections = []), (t.scroll = tr()), t.config(e), t.prepareCollections();
  6853. var i = function () {
  6854. var n;
  6855. t.collections.forEach(function (r) {
  6856. r.forEach(function (o) {
  6857. (n = o.el.getBoundingClientRect()), (o.position = { x: t.scroll.x + n.left, y: t.scroll.y + n.top });
  6858. });
  6859. });
  6860. };
  6861. wi(window, "resize", function () {
  6862. js(i);
  6863. });
  6864. var s = function () {
  6865. t.scroll = tr();
  6866. };
  6867. return (
  6868. wi(window, "scroll", function () {
  6869. js(s);
  6870. }),
  6871. t.collections
  6872. );
  6873. }
  6874. de.prototype = new Ve();
  6875. de.constructor = de;
  6876. de.prototype.prepareCollections = function () {
  6877. var e = this;
  6878. (e.collections.create = e.create.bind(e)),
  6879. (e.collections.on = e.on.bind(e)),
  6880. (e.collections.off = e.off.bind(e)),
  6881. (e.collections.destroy = e.destroy.bind(e)),
  6882. (e.collections.get = function (t) {
  6883. var i;
  6884. return (
  6885. e.collections.every(function (s) {
  6886. return (i = s.get(t)), !i;
  6887. }),
  6888. i
  6889. );
  6890. });
  6891. };
  6892. de.prototype.create = function (e) {
  6893. return this.createCollection(e);
  6894. };
  6895. de.prototype.createCollection = function (e) {
  6896. var t = this,
  6897. i = new ae(t, e);
  6898. return t.bindCollection(i), t.collections.push(i), i;
  6899. };
  6900. de.prototype.bindCollection = function (e) {
  6901. var t = this,
  6902. i,
  6903. s = function (n, r) {
  6904. (i = n.type + " " + r.id + ":" + n.type), t.trigger(i, r);
  6905. };
  6906. e.on("destroyed", t.onDestroyed.bind(t)), e.on("shown hidden rested dir plain", s), e.on("dir:up dir:right dir:down dir:left", s), e.on("plain:up plain:right plain:down plain:left", s);
  6907. };
  6908. de.prototype.bindDocument = function () {
  6909. var e = this;
  6910. e.binded || (e.bindEvt(document, "move").bindEvt(document, "end"), (e.binded = !0));
  6911. };
  6912. de.prototype.unbindDocument = function (e) {
  6913. var t = this;
  6914. (!Object.keys(t.ids).length || e === !0) && (t.unbindEvt(document, "move").unbindEvt(document, "end"), (t.binded = !1));
  6915. };
  6916. de.prototype.getIdentifier = function (e) {
  6917. var t;
  6918. return (
  6919. e ? ((t = e.identifier === void 0 ? e.pointerId : e.identifier), t === void 0 && (t = this.latest || 0)) : (t = this.index), this.ids[t] === void 0 && ((this.ids[t] = this.index), (this.index += 1)), (this.latest = t), this.ids[t]
  6920. );
  6921. };
  6922. de.prototype.removeIdentifier = function (e) {
  6923. var t = {};
  6924. for (var i in this.ids)
  6925. if (this.ids[i] === e) {
  6926. (t.id = i), (t.identifier = this.ids[i]), delete this.ids[i];
  6927. break;
  6928. }
  6929. return t;
  6930. };
  6931. de.prototype.onmove = function (e) {
  6932. var t = this;
  6933. return t.onAny("move", e), !1;
  6934. };
  6935. de.prototype.onend = function (e) {
  6936. var t = this;
  6937. return t.onAny("end", e), !1;
  6938. };
  6939. de.prototype.oncancel = function (e) {
  6940. var t = this;
  6941. return t.onAny("end", e), !1;
  6942. };
  6943. de.prototype.onAny = function (e, t) {
  6944. var i = this,
  6945. s,
  6946. n = "processOn" + e.charAt(0).toUpperCase() + e.slice(1);
  6947. t = ao(t);
  6948. var r = function (l, c, a) {
  6949. a.ids.indexOf(c) >= 0 && (a[n](l), (l._found_ = !0));
  6950. },
  6951. o = function (l) {
  6952. (s = i.getIdentifier(l)), zn(i.collections, r.bind(null, l, s)), l._found_ || i.removeIdentifier(s);
  6953. };
  6954. return zn(t, o), !1;
  6955. };
  6956. de.prototype.destroy = function () {
  6957. var e = this;
  6958. e.unbindDocument(!0),
  6959. (e.ids = {}),
  6960. (e.index = 0),
  6961. e.collections.forEach(function (t) {
  6962. t.destroy();
  6963. }),
  6964. e.off();
  6965. };
  6966. de.prototype.onDestroyed = function (e, t) {
  6967. var i = this;
  6968. if (i.collections.indexOf(t) < 0) return !1;
  6969. i.collections.splice(i.collections.indexOf(t), 1);
  6970. };
  6971. const nr = new de(),
  6972. sr = {
  6973. create: function (e) {
  6974. return nr.create(e);
  6975. },
  6976. factory: nr,
  6977. };
  6978. let rr = !1;
  6979. const Ih = (e) => {
  6980. if (rr) return;
  6981. rr = !0;
  6982. const t = document.getElementById("touch-controls-left"),
  6983. i = sr.create({ zone: t });
  6984. i.on("start", e.onStartMoving), i.on("end", e.onStopMoving), i.on("move", e.onRotateMoving);
  6985. const s = document.getElementById("touch-controls-right"),
  6986. n = sr.create({ zone: s });
  6987. n.on("start", e.onStartAttacking), n.on("end", e.onStopAttacking), n.on("move", e.onRotateAttacking), (t.style.display = "block"), (s.style.display = "block");
  6988. },
  6989. Mh = { enable: Ih };
  6990. window.loadedScript = !0;
  6991. const Eh = location.hostname !== "localhost" && location.hostname !== "127.0.0.1" && !location.hostname.startsWith("192.168."),
  6992. co = location.hostname === "sandbox-dev.moomoo.io" || location.hostname === "sandbox.moomoo.io",
  6993. Ph = location.hostname === "dev.moomoo.io" || location.hostname === "dev2.moomoo.io",
  6994. Hn = new uc();
  6995. let ui, di;
  6996. const ki = location.hostname === "localhost" || location.hostname === "127.0.0.1",
  6997. Ch = !1,
  6998. ls = ki || Ch;
  6999. co ? ((ui = "https://api-sandbox.moomoo.io"), (di = "moomoo.io")) : Ph ? ((ui = "https://api-dev.moomoo.io"), (di = "moomoo.io")) : ((ui = "https://api.moomoo.io"), (di = "moomoo.io"));
  7000. const Ah = !ls,
  7001. qe = new we(di, 443, T.maxPlayers, 5, Ah);
  7002. qe.debugLog = !1;
  7003. const Me = { animationTime: 0, land: null, lava: null, x: T.volcanoLocationX, y: T.volcanoLocationY };
  7004. function Dh() {
  7005. let e = !1;
  7006. return (
  7007. (function (t) {
  7008. (/(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(
  7009. t
  7010. ) ||
  7011. /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|jigs|kddi|keji|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(
  7012. t.substr(0, 4)
  7013. )) &&
  7014. (e = !0);
  7015. })(navigator.userAgent || navigator.vendor || window.opera),
  7016. e
  7017. );
  7018. }
  7019. const ho = Dh();
  7020. let vi = !1,
  7021. Fn = !1;
  7022. function Oh() {
  7023. !ps ||
  7024. Fn ||
  7025. ((Fn = !0),
  7026. Eh || ls
  7027. ? window.turnstileToken
  7028. ? gn(window.turnstileToken)
  7029. : window.grecaptcha.ready(() => {
  7030. window.grecaptcha
  7031. .execute("6LfahtgjAAAAAF8SkpjyeYMcxMdxIaQeh-VoPATP", { action: "homepage" })
  7032. .then(function (e) {
  7033. gn("re:" + e);
  7034. })
  7035. .catch(console.error);
  7036. })
  7037. : gn());
  7038. }
  7039. let Vn = !1;
  7040. function gn(e) {
  7041. qe.start(
  7042. bi,
  7043. function (t, i, s) {
  7044. let r = "wss" + "://" + t;
  7045. e && (r += "?token=" + encodeURIComponent(e)),
  7046. ki && (r = "wss://localhost:3000"),
  7047. ee.connect(
  7048. r,
  7049. function (o) {
  7050. if (Vn) {
  7051. Vn = !1;
  7052. return;
  7053. }
  7054. Vo(), o ? bn(o) : ((vi = !0), bs());
  7055. },
  7056. {
  7057. A: qh,
  7058. B: bn,
  7059. C: If,
  7060. D: Qf,
  7061. E: Zf,
  7062. a: iu,
  7063. G: Df,
  7064. H: qf,
  7065. I: Kf,
  7066. J: $f,
  7067. K: _f,
  7068. L: Wf,
  7069. M: Xf,
  7070. N: eu,
  7071. O: tu,
  7072. P: Ef,
  7073. Q: Cf,
  7074. R: Pf,
  7075. S: jf,
  7076. T: Ro,
  7077. U: Oo,
  7078. V: To,
  7079. X: Gf,
  7080. Y: Yf,
  7081. Z: ru,
  7082. g: Zh,
  7083. 1: tf,
  7084. 2: Qh,
  7085. 3: jh,
  7086. 4: ef,
  7087. 5: ff,
  7088. 6: gf,
  7089. 7: af,
  7090. 8: Mf,
  7091. 9: rf,
  7092. 0: su,
  7093. }
  7094. );
  7095. },
  7096. function (t) {
  7097. console.error("Vultr error:", t),
  7098. alert(
  7099. `Error:
  7100. ` + t
  7101. ),
  7102. bn("disconnected");
  7103. },
  7104. ki
  7105. );
  7106. }
  7107. function cs() {
  7108. return ee.connected;
  7109. }
  7110. function Rh() {
  7111. const t = prompt("party key", bi);
  7112. t && ((window.onbeforeunload = void 0), (window.location.href = "/?server=" + t));
  7113. }
  7114. const _h = new dc(T),
  7115. fo = Math.PI,
  7116. Ze = fo * 2;
  7117. Math.lerpAngle = function (e, t, i) {
  7118. Math.abs(t - e) > fo && (e > t ? (t += Ze) : (e += Ze));
  7119. const n = t + (e - t) * i;
  7120. return n >= 0 && n <= Ze ? n : n % Ze;
  7121. };
  7122. CanvasRenderingContext2D.prototype.roundRect = function (e, t, i, s, n) {
  7123. return (
  7124. i < 2 * n && (n = i / 2),
  7125. s < 2 * n && (n = s / 2),
  7126. n < 0 && (n = 0),
  7127. this.beginPath(),
  7128. this.moveTo(e + n, t),
  7129. this.arcTo(e + i, t, e + i, t + s, n),
  7130. this.arcTo(e + i, t + s, e, t + s, n),
  7131. this.arcTo(e, t + s, e, t, n),
  7132. this.arcTo(e, t, e + i, t, n),
  7133. this.closePath(),
  7134. this
  7135. );
  7136. };
  7137. let hs;
  7138. typeof Storage < "u" && (hs = !0);
  7139. function Di(e, t) {
  7140. hs && localStorage.setItem(e, t);
  7141. }
  7142. function Nt(e) {
  7143. return hs ? localStorage.getItem(e) : null;
  7144. }
  7145. let xi = Nt("moofoll");
  7146. function Bh() {
  7147. xi || ((xi = !0), Di("moofoll", 1));
  7148. }
  7149. let uo,
  7150. $e,
  7151. mt = 1,
  7152. be,
  7153. It,
  7154. yn,
  7155. or = Date.now();
  7156. var He;
  7157. let Ee;
  7158. const ye = [],
  7159. J = [];
  7160. let Oe = [];
  7161. const et = [],
  7162. Mt = [],
  7163. po = new gc(Hc, Mt, J, ye, ue, R, T, C),
  7164. ar = new yc(ye, wc, J, R, null, T, C);
  7165. let E,
  7166. mo,
  7167. y,
  7168. ct = 1,
  7169. wn = 0,
  7170. go = 0,
  7171. yo = 0,
  7172. Re,
  7173. _e,
  7174. lr,
  7175. fs = 0;
  7176. const se = T.maxScreenWidth,
  7177. re = T.maxScreenHeight;
  7178. let gt,
  7179. yt,
  7180. Jt = !1;
  7181. document.getElementById("ad-container");
  7182. const Oi = document.getElementById("mainMenu"),
  7183. Un = document.getElementById("enterGame"),
  7184. kn = document.getElementById("promoImg");
  7185. document.getElementById("partyButton");
  7186. const vn = document.getElementById("joinPartyButton"),
  7187. Ln = document.getElementById("settingsButton"),
  7188. cr = Ln.getElementsByTagName("span")[0],
  7189. hr = document.getElementById("allianceButton"),
  7190. fr = document.getElementById("storeButton"),
  7191. ur = document.getElementById("chatButton"),
  7192. xt = document.getElementById("gameCanvas"),
  7193. M = xt.getContext("2d");
  7194. var zh = document.getElementById("serverBrowser");
  7195. const Nn = document.getElementById("nativeResolution"),
  7196. xn = document.getElementById("showPing");
  7197. document.getElementById("playMusic");
  7198. const Qt = document.getElementById("pingDisplay"),
  7199. dr = document.getElementById("shutdownDisplay"),
  7200. Zt = document.getElementById("menuCardHolder"),
  7201. qt = document.getElementById("guideCard"),
  7202. Et = document.getElementById("loadingText"),
  7203. us = document.getElementById("gameUI"),
  7204. pr = document.getElementById("actionBar"),
  7205. Hh = document.getElementById("scoreDisplay"),
  7206. Fh = document.getElementById("foodDisplay"),
  7207. Vh = document.getElementById("woodDisplay"),
  7208. Uh = document.getElementById("stoneDisplay"),
  7209. Lh = document.getElementById("killCounter"),
  7210. mr = document.getElementById("leaderboardData"),
  7211. jt = document.getElementById("nameInput"),
  7212. Le = document.getElementById("itemInfoHolder"),
  7213. gr = document.getElementById("ageText"),
  7214. yr = document.getElementById("ageBarBody"),
  7215. ht = document.getElementById("upgradeHolder"),
  7216. ri = document.getElementById("upgradeCounter"),
  7217. Te = document.getElementById("allianceMenu"),
  7218. oi = document.getElementById("allianceHolder"),
  7219. ai = document.getElementById("allianceManager"),
  7220. me = document.getElementById("mapDisplay"),
  7221. Wt = document.getElementById("diedText"),
  7222. Nh = document.getElementById("skinColorHolder"),
  7223. ce = me.getContext("2d");
  7224. me.width = 300;
  7225. me.height = 300;
  7226. const We = document.getElementById("storeMenu"),
  7227. wr = document.getElementById("storeHolder"),
  7228. ft = document.getElementById("noticationDisplay"),
  7229. Xt = $r.hats,
  7230. Gt = $r.accessories;
  7231. var ue = new mc(kc, et, C, T);
  7232. const ei = "#525252",
  7233. kr = "#3d3f42",
  7234. Xe = 5.5;
  7235. T.DAY_INTERVAL / 24;
  7236. T.DAY_INTERVAL / 2;
  7237. function qh(e) {
  7238. Oe = e.teams;
  7239. }
  7240. let ds = !0;
  7241. var ps = !1;
  7242. (!ls || ki) && (ps = !0);
  7243. window.onblur = function () {
  7244. ds = !1;
  7245. };
  7246. window.onfocus = function () {
  7247. (ds = !0), E && E.alive && xs();
  7248. };
  7249. window.captchaCallbackHook = function () {
  7250. ps = !0;
  7251. };
  7252. window.captchaCallbackComplete && window.captchaCallbackHook();
  7253. window.addEventListener("keydown", function (e) {
  7254. e.keyCode == 32 && e.target == document.body && e.preventDefault();
  7255. });
  7256. xt.oncontextmenu = function () {
  7257. return !1;
  7258. };
  7259. ["touch-controls-left", "touch-controls-right", "touch-controls-fullscreen", "storeMenu"].forEach((e) => {
  7260. document.getElementById(e) &&
  7261. (document.getElementById(e).oncontextmenu = function (t) {
  7262. t.preventDefault();
  7263. });
  7264. });
  7265. function bn(e) {
  7266. (vi = !1), ee.close(), ms(e);
  7267. }
  7268. function ms(e, t) {
  7269. (Oi.style.display = "block"),
  7270. (us.style.display = "none"),
  7271. (Zt.style.display = "none"),
  7272. (Wt.style.display = "none"),
  7273. (Et.style.display = "block"),
  7274. (Et.innerHTML = e + (t ? "<a href='javascript:window.location.href=window.location.href' class='ytLink'>reload</a>" : ""));
  7275. }
  7276. function Wh() {
  7277. (Qt.hidden = !0), (Et.style.display = "none"), (Oi.style.display = "block"), (Zt.style.display = "block"), uf(), Xh(), Af(), (Et.style.display = "none"), (Zt.style.display = "block");
  7278. let e = Nt("moo_name") || "";
  7279. !e.length && FRVR.profile && ((e = FRVR.profile.name()), e && (e += Math.floor(Math.random() * 90) + 9)), (jt.value = e || "");
  7280. }
  7281. function Xh() {
  7282. (Un.onclick = C.checkTrusted(function () {
  7283. ms("Connecting..."), cs() ? bs() : Oh();
  7284. })),
  7285. C.hookTouchEvents(Un),
  7286. kn &&
  7287. ((kn.onclick = C.checkTrusted(function () {
  7288. Lo("https://krunker.io/?play=SquidGame_KB");
  7289. })),
  7290. C.hookTouchEvents(kn)),
  7291. vn &&
  7292. ((vn.onclick = C.checkTrusted(function () {
  7293. setTimeout(function () {
  7294. Rh();
  7295. }, 10);
  7296. })),
  7297. C.hookTouchEvents(vn)),
  7298. (Ln.onclick = C.checkTrusted(function () {
  7299. pf();
  7300. })),
  7301. C.hookTouchEvents(Ln),
  7302. (hr.onclick = C.checkTrusted(function () {
  7303. nf();
  7304. })),
  7305. C.hookTouchEvents(hr),
  7306. (fr.onclick = C.checkTrusted(function () {
  7307. hf();
  7308. })),
  7309. C.hookTouchEvents(fr),
  7310. (ur.onclick = C.checkTrusted(function () {
  7311. Mo();
  7312. })),
  7313. C.hookTouchEvents(ur),
  7314. (me.onclick = C.checkTrusted(function () {
  7315. Ao();
  7316. })),
  7317. C.hookTouchEvents(me);
  7318. }
  7319. let bi;
  7320. const Gh = {
  7321. view: () => {
  7322. if (!qe.servers) return;
  7323. let e = 0;
  7324. const t = Object.keys(qe.servers).map((i) => {
  7325. const s = qe.regionInfo[i].name;
  7326. let n = 0;
  7327. const r = qe.servers[i].map((o) => {
  7328. var h;
  7329. n += o.playerCount;
  7330. const l = o.selected;
  7331. let c = s + " " + o.name + " [" + Math.min(o.playerCount, o.playerCapacity) + "/" + o.playerCapacity + "]";
  7332. const a = o.name,
  7333. u = l ? "selected" : "";
  7334. o.ping && ((h = o.pings) == null ? void 0 : h.length) >= 2 ? (c += ` [${Math.floor(o.ping)}ms]`) : l || (c += " [?]");
  7335. let p = { value: i + ":" + a };
  7336. return u && ((bi = i + ":" + a), (p.selected = !0)), Ne("option", p, c);
  7337. });
  7338. return (e += n), [Ne("option[disabled]", `${s} - ${n} players`), r, Ne("option[disabled]")];
  7339. });
  7340. return Ne(
  7341. "select",
  7342. {
  7343. value: bi,
  7344. onfocus: () => {
  7345. window.blockRedraw = !0;
  7346. },
  7347. onblur: () => {
  7348. window.blockRedraw = !1;
  7349. },
  7350. onchange: Kh,
  7351. },
  7352. [t, Ne("option[disabled]", `All Servers - ${e} players`)]
  7353. );
  7354. },
  7355. };
  7356. Ne.mount(zh, Gh);
  7357. var qn, Wn;
  7358. location.hostname == "sandbox.moomoo.io" ? ((qn = "Back to MooMoo"), (Wn = "//moomoo.io/")) : ((qn = "Try the sandbox"), (Wn = "//sandbox.moomoo.io/"));
  7359. document.getElementById("altServer").innerHTML = "<a href='" + Wn + "'>" + qn + "<i class='material-icons' style='font-size:10px;vertical-align:middle'>arrow_forward_ios</i></a>";
  7360. const Yh = `${ui}/servers?v=1.22`,
  7361. wo = async () =>
  7362. fetch(Yh)
  7363. .then((e) => e.json())
  7364. .then(async (e) => qe.processServers(e))
  7365. .catch((e) => {
  7366. console.error("Failed to load server data with status code:", e);
  7367. }),
  7368. $h = () =>
  7369. wo()
  7370. .then(Wh)
  7371. .catch((e) => {
  7372. console.error("Failed to load.");
  7373. });
  7374. window.frvrSdkInitPromise.then(() => window.FRVR.bootstrapper.complete()).then(() => $h());
  7375. const Kh = (e) => {
  7376. if (((window.blockRedraw = !1), FRVR.channelCharacteristics.allowNavigation)) {
  7377. const [t, i] = e.target.value.split(":");
  7378. qe.switchServer(t, i);
  7379. } else vi && ((vi = !1), (Fn = !1), (Vn = !0), (Ei = !0), ee.close());
  7380. };
  7381. document.getElementById("pre-content-container");
  7382. function Jh() {
  7383. FRVR.ads.show("interstitial", bs);
  7384. }
  7385. window.showPreAd = Jh;
  7386. function Se(e, t, i) {
  7387. if (E && e) {
  7388. if ((C.removeAllChildren(Le), Le.classList.add("visible"), C.generateElement({ id: "itemInfoName", text: C.capitalizeFirst(e.name), parent: Le }), C.generateElement({ id: "itemInfoDesc", text: e.desc, parent: Le }), !i))
  7389. if (t) C.generateElement({ class: "itemInfoReq", text: e.type ? "secondary" : "primary", parent: Le });
  7390. else {
  7391. for (let n = 0; n < e.req.length; n += 2) C.generateElement({ class: "itemInfoReq", html: e.req[n] + "<span class='itemInfoReqVal'> x" + e.req[n + 1] + "</span>", parent: Le });
  7392. const s = co ? e.group.sandboxLimit || Math.max(e.group.limit * 3, 99) : e.group.limit;
  7393. e.group.limit && C.generateElement({ class: "itemInfoLmt", text: (E.itemCounts[e.group.id] || 0) + "/" + s, parent: Le });
  7394. }
  7395. } else Le.classList.remove("visible");
  7396. }
  7397. let Pt = [],
  7398. wt = [];
  7399. function Qh(e, t) {
  7400. Pt.push({ sid: e, name: t }), gs();
  7401. }
  7402. function gs() {
  7403. if (Pt[0]) {
  7404. const e = Pt[0];
  7405. C.removeAllChildren(ft),
  7406. (ft.style.display = "block"),
  7407. C.generateElement({ class: "notificationText", text: e.name, parent: ft }),
  7408. C.generateElement({
  7409. class: "notifButton",
  7410. html: "<i class='material-icons' style='font-size:28px;color:#cc5151;'>&#xE14C;</i>",
  7411. parent: ft,
  7412. onclick: function () {
  7413. Gn(0);
  7414. },
  7415. hookTouch: !0,
  7416. }),
  7417. C.generateElement({
  7418. class: "notifButton",
  7419. html: "<i class='material-icons' style='font-size:28px;color:#8ecc51;'>&#xE876;</i>",
  7420. parent: ft,
  7421. onclick: function () {
  7422. Gn(1);
  7423. },
  7424. hookTouch: !0,
  7425. });
  7426. } else ft.style.display = "none";
  7427. }
  7428. function Zh(e) {
  7429. Oe.push(e), Te.style.display == "block" && ti();
  7430. }
  7431. function jh(e, t) {
  7432. E && ((E.team = e), (E.isOwner = t), Te.style.display == "block" && ti());
  7433. }
  7434. function ef(e) {
  7435. (wt = e), Te.style.display == "block" && ti();
  7436. }
  7437. function tf(e) {
  7438. for (let t = Oe.length - 1; t >= 0; t--) Oe[t].sid == e && Oe.splice(t, 1);
  7439. Te.style.display == "block" && ti();
  7440. }
  7441. function nf() {
  7442. xs(), Te.style.display != "block" ? ti() : Xn();
  7443. }
  7444. function Xn() {
  7445. Te.style.display == "block" && (Te.style.display = "none");
  7446. }
  7447. function ti() {
  7448. if (E && E.alive) {
  7449. if ((Ri(), (We.style.display = "none"), (Te.style.display = "block"), C.removeAllChildren(oi), E.team))
  7450. for (var e = 0; e < wt.length; e += 2)
  7451. (function (t) {
  7452. const i = C.generateElement({ class: "allianceItem", style: "color:" + (wt[t] == E.sid ? "#fff" : "rgba(255,255,255,0.6)"), text: wt[t + 1], parent: oi });
  7453. E.isOwner &&
  7454. wt[t] != E.sid &&
  7455. C.generateElement({
  7456. class: "joinAlBtn",
  7457. text: "Kick",
  7458. onclick: function () {
  7459. ko(wt[t]);
  7460. },
  7461. hookTouch: !0,
  7462. parent: i,
  7463. });
  7464. })(e);
  7465. else if (Oe.length)
  7466. for (var e = 0; e < Oe.length; ++e)
  7467. (function (i) {
  7468. const s = C.generateElement({ class: "allianceItem", style: "color:" + (Oe[i].sid == E.team ? "#fff" : "rgba(255,255,255,0.6)"), text: Oe[i].sid, parent: oi });
  7469. C.generateElement({
  7470. class: "joinAlBtn",
  7471. text: "Join",
  7472. onclick: function () {
  7473. vo(i);
  7474. },
  7475. hookTouch: !0,
  7476. parent: s,
  7477. });
  7478. })(e);
  7479. else C.generateElement({ class: "allianceItem", text: "No Tribes Yet", parent: oi });
  7480. C.removeAllChildren(ai),
  7481. E.team
  7482. ? C.generateElement({
  7483. class: "allianceButtonM",
  7484. style: "width: 360px",
  7485. text: E.isOwner ? "Delete Tribe" : "Leave Tribe",
  7486. onclick: function () {
  7487. xo();
  7488. },
  7489. hookTouch: !0,
  7490. parent: ai,
  7491. })
  7492. : (C.generateElement({
  7493. tag: "input",
  7494. type: "text",
  7495. id: "allianceInput",
  7496. maxLength: 7,
  7497. placeholder: "unique name",
  7498. onchange: (t) => {
  7499. t.target.value = (t.target.value || "").slice(0, 7);
  7500. },
  7501. onkeypress: (t) => {
  7502. if (t.key === "Enter") return t.preventDefault(), Yn(), !1;
  7503. },
  7504. parent: ai,
  7505. }),
  7506. C.generateElement({
  7507. tag: "div",
  7508. class: "allianceButtonM",
  7509. style: "width: 140px;",
  7510. text: "Create",
  7511. onclick: function () {
  7512. Yn();
  7513. },
  7514. hookTouch: !0,
  7515. parent: ai,
  7516. }));
  7517. }
  7518. }
  7519. function Gn(e) {
  7520. ee.send("P", Pt[0].sid, e), Pt.splice(0, 1), gs();
  7521. }
  7522. function ko(e) {
  7523. ee.send("Q", e);
  7524. }
  7525. function vo(e) {
  7526. ee.send("b", Oe[e].sid);
  7527. }
  7528. function Yn() {
  7529. ee.send("L", document.getElementById("allianceInput").value);
  7530. }
  7531. function xo() {
  7532. (Pt = []), gs(), ee.send("N");
  7533. }
  7534. let pi, Ht, je;
  7535. const bt = [];
  7536. let Je;
  7537. function sf() {
  7538. (this.init = function (e, t) {
  7539. (this.scale = 0), (this.x = e), (this.y = t), (this.active = !0);
  7540. }),
  7541. (this.update = function (e, t) {
  7542. this.active &&
  7543. ((this.scale += 0.05 * t),
  7544. this.scale >= T.mapPingScale
  7545. ? (this.active = !1)
  7546. : ((e.globalAlpha = 1 - Math.max(0, this.scale / T.mapPingScale)), e.beginPath(), e.arc((this.x / T.mapScale) * me.width, (this.y / T.mapScale) * me.width, this.scale, 0, 2 * Math.PI), e.stroke()));
  7547. });
  7548. }
  7549. function rf(e, t) {
  7550. for (let i = 0; i < bt.length; ++i)
  7551. if (!bt[i].active) {
  7552. Je = bt[i];
  7553. break;
  7554. }
  7555. Je || ((Je = new sf()), bt.push(Je)), Je.init(e, t);
  7556. }
  7557. function of() {
  7558. je || (je = {}), (je.x = E.x), (je.y = E.y);
  7559. }
  7560. function af(e) {
  7561. Ht = e;
  7562. }
  7563. function lf(e) {
  7564. if (E && E.alive) {
  7565. ce.clearRect(0, 0, me.width, me.height), (ce.strokeStyle = "#fff"), (ce.lineWidth = 4);
  7566. for (var t = 0; t < bt.length; ++t) (Je = bt[t]), Je.update(ce, e);
  7567. if (((ce.globalAlpha = 1), (ce.fillStyle = "#fff"), Q((E.x / T.mapScale) * me.width, (E.y / T.mapScale) * me.height, 7, ce, !0), (ce.fillStyle = "rgba(255,255,255,0.35)"), E.team && Ht))
  7568. for (var t = 0; t < Ht.length; ) Q((Ht[t] / T.mapScale) * me.width, (Ht[t + 1] / T.mapScale) * me.height, 7, ce, !0), (t += 2);
  7569. pi && ((ce.fillStyle = "#fc5553"), (ce.font = "34px Hammersmith One"), (ce.textBaseline = "middle"), (ce.textAlign = "center"), ce.fillText("x", (pi.x / T.mapScale) * me.width, (pi.y / T.mapScale) * me.height)),
  7570. je && ((ce.fillStyle = "#fff"), (ce.font = "34px Hammersmith One"), (ce.textBaseline = "middle"), (ce.textAlign = "center"), ce.fillText("x", (je.x / T.mapScale) * me.width, (je.y / T.mapScale) * me.height));
  7571. }
  7572. }
  7573. let $n = 0;
  7574. function cf(e) {
  7575. $n != e && (($n = e), ys());
  7576. }
  7577. function hf() {
  7578. We.style.display != "block" ? ((We.style.display = "block"), (Te.style.display = "none"), Ri(), ys()) : Kn();
  7579. }
  7580. function Kn() {
  7581. We.style.display == "block" && ((We.style.display = "none"), Se());
  7582. }
  7583. function ff(e, t, i) {
  7584. i ? (e ? (E.tailIndex = t) : (E.tails[t] = 1)) : e ? (E.skinIndex = t) : (E.skins[t] = 1), We.style.display == "block" && ys();
  7585. }
  7586. function ys() {
  7587. if (E) {
  7588. C.removeAllChildren(wr);
  7589. const e = $n,
  7590. t = e ? Gt : Xt;
  7591. for (let i = 0; i < t.length; ++i)
  7592. t[i].dontSell ||
  7593. (function (s) {
  7594. const n = C.generateElement({
  7595. id: "storeDisplay" + s,
  7596. class: "storeItem",
  7597. onmouseout: function () {
  7598. Se();
  7599. },
  7600. onmouseover: function () {
  7601. Se(t[s], !1, !0);
  7602. },
  7603. parent: wr,
  7604. });
  7605. C.hookTouchEvents(n, !0),
  7606. C.generateElement({ tag: "img", class: "hatPreview", src: "./img/" + (e ? "accessories/access_" : "hats/hat_") + t[s].id + (t[s].topSprite ? "_p" : "") + ".png", parent: n }),
  7607. C.generateElement({ tag: "span", text: t[s].name, parent: n }),
  7608. (e ? !E.tails[t[s].id] : !E.skins[t[s].id])
  7609. ? (C.generateElement({
  7610. class: "joinAlBtn",
  7611. style: "margin-top: 5px",
  7612. text: "Buy",
  7613. onclick: function () {
  7614. bo(t[s].id, e);
  7615. },
  7616. hookTouch: !0,
  7617. parent: n,
  7618. }),
  7619. C.generateElement({ tag: "span", class: "itemPrice", text: t[s].price, parent: n }))
  7620. : (e ? E.tailIndex : E.skinIndex) == t[s].id
  7621. ? C.generateElement({
  7622. class: "joinAlBtn",
  7623. style: "margin-top: 5px",
  7624. text: "Unequip",
  7625. onclick: function () {
  7626. Jn(0, e);
  7627. },
  7628. hookTouch: !0,
  7629. parent: n,
  7630. })
  7631. : C.generateElement({
  7632. class: "joinAlBtn",
  7633. style: "margin-top: 5px",
  7634. text: "Equip",
  7635. onclick: function () {
  7636. Jn(t[s].id, e);
  7637. },
  7638. hookTouch: !0,
  7639. parent: n,
  7640. });
  7641. })(i);
  7642. }
  7643. }
  7644. function Jn(e, t) {
  7645. ee.send("c", 0, e, t);
  7646. }
  7647. function bo(e, t) {
  7648. ee.send("c", 1, e, t);
  7649. }
  7650. function So() {
  7651. (We.style.display = "none"), (Te.style.display = "none"), Ri();
  7652. }
  7653. function uf() {
  7654. const e = Nt("native_resolution");
  7655. Sn(e ? e == "true" : typeof cordova < "u"),
  7656. ($e = Nt("show_ping") == "true"),
  7657. (Qt.hidden = !$e || !Jt),
  7658. Nt("moo_moosic"),
  7659. setInterval(function () {
  7660. window.cordova && (document.getElementById("downloadButtonContainer").classList.add("cordova"), document.getElementById("mobileDownloadButtonContainer").classList.add("cordova"));
  7661. }, 1e3),
  7662. Io(),
  7663. C.removeAllChildren(pr);
  7664. for (var t = 0; t < R.weapons.length + R.list.length; ++t)
  7665. (function (i) {
  7666. C.generateElement({
  7667. id: "actionBarItem" + i,
  7668. class: "actionBarItem",
  7669. style: "display:none",
  7670. onmouseout: function () {
  7671. Se();
  7672. },
  7673. parent: pr,
  7674. });
  7675. })(t);
  7676. for (var t = 0; t < R.list.length + R.weapons.length; ++t)
  7677. (function (s) {
  7678. const n = document.createElement("canvas");
  7679. n.width = n.height = 66;
  7680. const r = n.getContext("2d");
  7681. if ((r.translate(n.width / 2, n.height / 2), (r.imageSmoothingEnabled = !1), (r.webkitImageSmoothingEnabled = !1), (r.mozImageSmoothingEnabled = !1), R.weapons[s])) {
  7682. r.rotate(Math.PI / 4 + Math.PI);
  7683. var o = new Image();
  7684. (jn[R.weapons[s].src] = o),
  7685. (o.onload = function () {
  7686. this.isLoaded = !0;
  7687. const c = 1 / (this.height / this.width),
  7688. a = R.weapons[s].iPad || 1;
  7689. 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),
  7690. (r.fillStyle = "rgba(0, 0, 70, 0.1)"),
  7691. (r.globalCompositeOperation = "source-atop"),
  7692. r.fillRect(-n.width / 2, -n.height / 2, n.width, n.height),
  7693. (document.getElementById("actionBarItem" + s).style.backgroundImage = "url(" + n.toDataURL() + ")");
  7694. }),
  7695. (o.src = "./img/weapons/" + R.weapons[s].src + ".png");
  7696. var l = document.getElementById("actionBarItem" + s);
  7697. (l.onmouseover = C.checkTrusted(function () {
  7698. Se(R.weapons[s], !0);
  7699. })),
  7700. (l.onclick = C.checkTrusted(function () {
  7701. Yt(s, !0);
  7702. })),
  7703. C.hookTouchEvents(l);
  7704. } else {
  7705. var o = Ss(R.list[s - R.weapons.length], !0);
  7706. const a = Math.min(n.width - T.iconPadding, o.width);
  7707. (r.globalAlpha = 1),
  7708. r.drawImage(o, -a / 2, -a / 2, a, a),
  7709. (r.fillStyle = "rgba(0, 0, 70, 0.1)"),
  7710. (r.globalCompositeOperation = "source-atop"),
  7711. r.fillRect(-a / 2, -a / 2, a, a),
  7712. (document.getElementById("actionBarItem" + s).style.backgroundImage = "url(" + n.toDataURL() + ")");
  7713. var l = document.getElementById("actionBarItem" + s);
  7714. (l.onmouseover = C.checkTrusted(function () {
  7715. Se(R.list[s - R.weapons.length]);
  7716. })),
  7717. (l.onclick = C.checkTrusted(function () {
  7718. Yt(s - R.weapons.length);
  7719. })),
  7720. C.hookTouchEvents(l);
  7721. }
  7722. })(t);
  7723. (jt.onchange = (i) => {
  7724. i.target.value = (i.target.value || "").slice(0, 15);
  7725. }),
  7726. (jt.onkeypress = (i) => {
  7727. if (i.key === "Enter") return i.preventDefault(), Un.onclick(i), !1;
  7728. }),
  7729. (Nn.checked = uo),
  7730. (Nn.onchange = C.checkTrusted(function (i) {
  7731. Sn(i.target.checked);
  7732. })),
  7733. (xn.checked = $e),
  7734. (xn.onchange = C.checkTrusted(function (i) {
  7735. ($e = xn.checked), (Qt.hidden = !$e), Di("show_ping", $e ? "true" : "false");
  7736. }));
  7737. }
  7738. function To(e, t) {
  7739. e && (t ? (E.weapons = e) : (E.items = e));
  7740. for (var i = 0; i < R.list.length; ++i) {
  7741. const s = R.weapons.length + i;
  7742. document.getElementById("actionBarItem" + s).style.display = E.items.indexOf(R.list[i].id) >= 0 ? "inline-block" : "none";
  7743. }
  7744. for (var i = 0; i < R.weapons.length; ++i) document.getElementById("actionBarItem" + i).style.display = E.weapons[R.weapons[i].type] == R.weapons[i].id ? "inline-block" : "none";
  7745. }
  7746. function Sn(e) {
  7747. (uo = e), (mt = (e && window.devicePixelRatio) || 1), (Nn.checked = e), Di("native_resolution", e.toString()), ws();
  7748. }
  7749. function df() {
  7750. ii ? qt.classList.add("touch") : qt.classList.remove("touch");
  7751. }
  7752. function pf() {
  7753. qt.classList.contains("showing") ? (qt.classList.remove("showing"), (cr.innerText = "Settings")) : (qt.classList.add("showing"), (cr.innerText = "Close"));
  7754. }
  7755. function Io() {
  7756. let e = "";
  7757. for (let t = 0; t < T.skinColors.length; ++t)
  7758. t == fs
  7759. ? (e += "<div class='skinColorItem activeSkin' style='background-color:" + T.skinColors[t] + "' onclick='selectSkinColor(" + t + ")'></div>")
  7760. : (e += "<div class='skinColorItem' style='background-color:" + T.skinColors[t] + "' onclick='selectSkinColor(" + t + ")'></div>");
  7761. Nh.innerHTML = e;
  7762. }
  7763. function mf(e) {
  7764. (fs = e), Io();
  7765. }
  7766. const Ft = document.getElementById("chatBox"),
  7767. Si = document.getElementById("chatHolder");
  7768. function Mo() {
  7769. ii
  7770. ? setTimeout(function () {
  7771. const e = prompt("chat message");
  7772. e && vr(e);
  7773. }, 1)
  7774. : Si.style.display == "block"
  7775. ? (Ft.value && vr(Ft.value), Ri())
  7776. : ((We.style.display = "none"), (Te.style.display = "none"), (Si.style.display = "block"), Ft.focus(), xs()),
  7777. (Ft.value = "");
  7778. }
  7779. function vr(e) {
  7780. ee.send("6", e.slice(0, 30));
  7781. }
  7782. function Ri() {
  7783. (Ft.value = ""), (Si.style.display = "none");
  7784. }
  7785. function gf(e, t) {
  7786. const i = _i(e);
  7787. i && ((i.chatMessage = t), (i.chatCountdown = T.chatCountdown));
  7788. }
  7789. window.addEventListener("resize", C.checkTrusted(ws));
  7790. function ws() {
  7791. (gt = window.innerWidth), (yt = window.innerHeight);
  7792. const e = Math.max(gt / se, yt / re) * mt;
  7793. (xt.width = gt * mt), (xt.height = yt * mt), (xt.style.width = gt + "px"), (xt.style.height = yt + "px"), M.setTransform(e, 0, 0, e, (gt * mt - se * e) / 2, (yt * mt - re * e) / 2);
  7794. }
  7795. ws();
  7796. let ii;
  7797. tt(!1);
  7798. function tt(e) {
  7799. (ii = e), df();
  7800. }
  7801. window.setUsingTouch = tt;
  7802. let yf = document.getElementById("leaderboardButton"),
  7803. Eo = document.getElementById("leaderboard");
  7804. yf.addEventListener("touchstart", () => {
  7805. Eo.classList.add("is-showing");
  7806. });
  7807. const ks = () => {
  7808. Eo.classList.remove("is-showing");
  7809. };
  7810. document.body.addEventListener("touchend", ks);
  7811. document.body.addEventListener("touchleave", ks);
  7812. document.body.addEventListener("touchcancel", ks);
  7813. if (!ho) {
  7814. let t = function (n) {
  7815. n.preventDefault(), n.stopPropagation(), tt(!1), (go = n.clientX), (yo = n.clientY);
  7816. },
  7817. i = function (n) {
  7818. tt(!1), Ee != 1 && ((Ee = 1), it());
  7819. },
  7820. s = function (n) {
  7821. tt(!1), Ee != 0 && ((Ee = 0), it());
  7822. };
  7823. var gameInput = t,
  7824. mouseDown = i,
  7825. mouseUp = s;
  7826. const e = document.getElementById("touch-controls-fullscreen");
  7827. (e.style.display = "block"), e.addEventListener("mousemove", t, !1), e.addEventListener("mousedown", i, !1), e.addEventListener("mouseup", s, !1);
  7828. }
  7829. let Qn = !1,
  7830. Po;
  7831. function wf() {
  7832. let e = 0,
  7833. t = 0,
  7834. i;
  7835. if (ii) {
  7836. if (!Qn) return;
  7837. i = Po;
  7838. }
  7839. for (const s in Ii) {
  7840. const n = Ii[s];
  7841. (e += !!He[s] * n[0]), (t += !!He[s] * n[1]);
  7842. }
  7843. if (((e != 0 || t != 0) && (i = Math.atan2(t, e)), i !== void 0)) return C.fixTo(i, 2);
  7844. }
  7845. let Ti;
  7846. function vs() {
  7847. return E ? (!E.lockDir && !ii && (Ti = Math.atan2(yo - yt / 2, go - gt / 2)), C.fixTo(Ti || 0, 2)) : 0;
  7848. }
  7849. var He = {},
  7850. Ii = { 87: [0, -1], 38: [0, -1], 83: [0, 1], 40: [0, 1], 65: [-1, 0], 37: [-1, 0], 68: [1, 0], 39: [1, 0] };
  7851. function xs() {
  7852. (He = {}), ee.send("e");
  7853. }
  7854. function Co() {
  7855. return Te.style.display != "block" && Si.style.display != "block";
  7856. }
  7857. function kf(e) {
  7858. const t = e.which || e.keyCode || 0;
  7859. t == 27
  7860. ? So()
  7861. : E &&
  7862. E.alive &&
  7863. Co() &&
  7864. (He[t] ||
  7865. ((He[t] = 1),
  7866. t == 69
  7867. ? bf()
  7868. : t == 67
  7869. ? of()
  7870. : t == 88
  7871. ? xf()
  7872. : E.weapons[t - 49] != null
  7873. ? Yt(E.weapons[t - 49], !0)
  7874. : E.items[t - 49 - E.weapons.length] != null
  7875. ? Yt(E.items[t - 49 - E.weapons.length])
  7876. : t == 81
  7877. ? Yt(E.items[0])
  7878. : t == 82
  7879. ? Ao()
  7880. : Ii[t]
  7881. ? Mi()
  7882. : t == 32 && ((Ee = 1), it())));
  7883. }
  7884. window.addEventListener("keydown", C.checkTrusted(kf));
  7885. function vf(e) {
  7886. if (E && E.alive) {
  7887. const t = e.which || e.keyCode || 0;
  7888. if (t == 13) {
  7889. if (Te.style.display === "block") return;
  7890. Mo();
  7891. } else Co() && He[t] && ((He[t] = 0), Ii[t] ? Mi() : t == 32 && ((Ee = 0), it()));
  7892. }
  7893. }
  7894. window.addEventListener("keyup", C.checkTrusted(vf));
  7895. function it() {
  7896. E && E.alive && ee.send("d", Ee, E.buildIndex >= 0 ? vs() : null);
  7897. }
  7898. let Tn;
  7899. function Mi() {
  7900. const e = wf();
  7901. (Tn == null || e == null || Math.abs(e - Tn) > 0.3) && (ee.send("a", e), (Tn = e));
  7902. }
  7903. function xf() {
  7904. (E.lockDir = E.lockDir ? 0 : 1), ee.send("K", 0);
  7905. }
  7906. function Ao() {
  7907. ee.send("S", 1);
  7908. }
  7909. function bf() {
  7910. ee.send("K", 1);
  7911. }
  7912. function Yt(e, t) {
  7913. ee.send("G", e, t);
  7914. }
  7915. window.io = ee;
  7916. function bs() {
  7917. (Qt.hidden = !$e),
  7918. (window.onbeforeunload = function (e) {
  7919. return "Are you sure?";
  7920. }),
  7921. window.FRVR && window.FRVR.tracker.levelStart("game_start"),
  7922. Di("moo_name", jt.value),
  7923. !Jt && cs() && ((Jt = !0), _h.stop("menu"), ms("Loading..."), ee.send("M", { name: jt.value, moofoll: xi, skin: fs })),
  7924. Sf();
  7925. }
  7926. function Sf() {
  7927. var e = document.getElementById("ot-sdk-btn-floating");
  7928. e && (e.style.display = "none");
  7929. }
  7930. function Tf() {
  7931. var e = document.getElementById("ot-sdk-btn-floating");
  7932. e && (e.style.display = "block");
  7933. }
  7934. let Ei = !0,
  7935. In = !1;
  7936. function If(e) {
  7937. (Et.style.display = "none"),
  7938. (Zt.style.display = "block"),
  7939. (Oi.style.display = "none"),
  7940. (He = {}),
  7941. (mo = e),
  7942. (Ee = 0),
  7943. (Jt = !0),
  7944. Ei && ((Ei = !1), (et.length = 0)),
  7945. ho &&
  7946. Mh.enable({
  7947. onStartMoving: () => {
  7948. Kn(), Xn(), tt(!0), (Qn = !0);
  7949. },
  7950. onStopMoving: () => {
  7951. (Qn = !1), Mi();
  7952. },
  7953. onRotateMoving: (t, i) => {
  7954. i.force < 0.25 || ((Po = -i.angle.radian), Mi(), In || (Ti = -i.angle.radian));
  7955. },
  7956. onStartAttacking: () => {
  7957. Kn(), Xn(), tt(!0), (In = !0), E.buildIndex < 0 && ((Ee = 1), it());
  7958. },
  7959. onStopAttacking: () => {
  7960. E.buildIndex >= 0 && ((Ee = 1), it()), (Ee = 0), it(), (In = !1);
  7961. },
  7962. onRotateAttacking: (t, i) => {
  7963. i.force < 0.25 || (Ti = -i.angle.radian);
  7964. },
  7965. });
  7966. }
  7967. function Mf(e, t, i, s) {
  7968. s === -1 ? Hn.showText(e, t, 50, 0.18, 500, i, "#ee5551") : Hn.showText(e, t, 50, 0.18, 500, Math.abs(i), i >= 0 ? "#fff" : "#8ecc51");
  7969. }
  7970. let mi = 99999;
  7971. function Ef() {
  7972. (Jt = !1), Tf();
  7973. try {
  7974. factorem.refreshAds([2], !0);
  7975. } catch {}
  7976. (us.style.display = "none"),
  7977. So(),
  7978. (pi = { x: E.x, y: E.y }),
  7979. (Et.style.display = "none"),
  7980. (Wt.style.display = "block"),
  7981. (Wt.style.fontSize = "0px"),
  7982. (mi = 0),
  7983. setTimeout(function () {
  7984. (Zt.style.display = "block"), (Oi.style.display = "block"), (Wt.style.display = "none");
  7985. }, T.deathFadeout),
  7986. wo();
  7987. }
  7988. function Pf(e) {
  7989. E && ue.removeAllItems(e);
  7990. }
  7991. function Cf(e) {
  7992. ue.disableBySid(e);
  7993. }
  7994. function Do() {
  7995. (Hh.innerText = E.points), (Fh.innerText = E.food), (Vh.innerText = E.wood), (Uh.innerText = E.stone), (Lh.innerText = E.kills);
  7996. }
  7997. const Vt = {},
  7998. Mn = ["crown", "skull"];
  7999. function Af() {
  8000. for (let e = 0; e < Mn.length; ++e) {
  8001. const t = new Image();
  8002. (t.onload = function () {
  8003. this.isLoaded = !0;
  8004. }),
  8005. (t.src = "./img/icons/" + Mn[e] + ".png"),
  8006. (Vt[Mn[e]] = t);
  8007. }
  8008. }
  8009. const ut = [];
  8010. function Oo(e, t) {
  8011. if (((E.upgradePoints = e), (E.upgrAge = t), e > 0)) {
  8012. (ut.length = 0), C.removeAllChildren(ht);
  8013. for (var i = 0; i < R.weapons.length; ++i)
  8014. if (R.weapons[i].age == t && (R.weapons[i].pre == null || E.weapons.indexOf(R.weapons[i].pre) >= 0)) {
  8015. var s = C.generateElement({
  8016. id: "upgradeItem" + i,
  8017. class: "actionBarItem",
  8018. onmouseout: function () {
  8019. Se();
  8020. },
  8021. parent: ht,
  8022. });
  8023. (s.style.backgroundImage = document.getElementById("actionBarItem" + i).style.backgroundImage), ut.push(i);
  8024. }
  8025. for (var i = 0; i < R.list.length; ++i)
  8026. if (R.list[i].age == t && (R.list[i].pre == null || E.items.indexOf(R.list[i].pre) >= 0)) {
  8027. const r = R.weapons.length + i;
  8028. var s = C.generateElement({
  8029. id: "upgradeItem" + r,
  8030. class: "actionBarItem",
  8031. onmouseout: function () {
  8032. Se();
  8033. },
  8034. parent: ht,
  8035. });
  8036. (s.style.backgroundImage = document.getElementById("actionBarItem" + r).style.backgroundImage), ut.push(r);
  8037. }
  8038. for (var i = 0; i < ut.length; i++)
  8039. (function (r) {
  8040. const o = document.getElementById("upgradeItem" + r);
  8041. (o.onmouseover = function () {
  8042. R.weapons[r] ? Se(R.weapons[r], !0) : Se(R.list[r - R.weapons.length]);
  8043. }),
  8044. (o.onclick = C.checkTrusted(function () {
  8045. ee.send("H", r);
  8046. })),
  8047. C.hookTouchEvents(o);
  8048. })(ut[i]);
  8049. ut.length ? ((ht.style.display = "block"), (ri.style.display = "block"), (ri.innerHTML = "SELECT ITEMS (" + e + ")")) : ((ht.style.display = "none"), (ri.style.display = "none"), Se());
  8050. } else (ht.style.display = "none"), (ri.style.display = "none"), Se();
  8051. }
  8052. function Ro(e, t, i) {
  8053. e != null && (E.XP = e), t != null && (E.maxXP = t), i != null && (E.age = i), i == T.maxAge ? ((gr.innerHTML = "MAX AGE"), (yr.style.width = "100%")) : ((gr.innerHTML = "AGE " + E.age), (yr.style.width = (E.XP / E.maxXP) * 100 + "%"));
  8054. }
  8055. function Df(e) {
  8056. C.removeAllChildren(mr);
  8057. let t = 1;
  8058. for (let i = 0; i < e.length; i += 3)
  8059. (function (s) {
  8060. C.generateElement({
  8061. class: "leaderHolder",
  8062. parent: mr,
  8063. children: [
  8064. C.generateElement({ class: "leaderboardItem", style: "color:" + (e[s] == mo ? "#fff" : "rgba(255,255,255,0.6)"), text: t + ". " + (e[s + 1] != "" ? e[s + 1] : "unknown") }),
  8065. C.generateElement({ class: "leaderScore", text: C.kFormat(e[s + 2]) || "0" }),
  8066. ],
  8067. });
  8068. })(i),
  8069. t++;
  8070. }
  8071. let xr = null;
  8072. function Of() {
  8073. {
  8074. if (E && (!yn || It - yn >= 1e3 / T.clientSendRate)) {
  8075. yn = It;
  8076. const a = vs();
  8077. xr !== a && ((xr = a), ee.send("D", a));
  8078. }
  8079. if ((mi < 120 && ((mi += 0.1 * be), (Wt.style.fontSize = Math.min(Math.round(mi), 120) + "px")), E)) {
  8080. const a = C.getDistance(Re, _e, E.x, E.y),
  8081. u = C.getDirection(E.x, E.y, Re, _e),
  8082. p = Math.min(a * 0.01 * be, a);
  8083. a > 0.05 ? ((Re += p * Math.cos(u)), (_e += p * Math.sin(u))) : ((Re = E.x), (_e = E.y));
  8084. } else (Re = T.mapScale / 2), (_e = T.mapScale / 2);
  8085. const o = It - 1e3 / T.serverUpdateRate;
  8086. for (var e, t = 0; t < J.length + ye.length; ++t)
  8087. if (((y = J[t] || ye[t - J.length]), y && y.visible))
  8088. if (y.forcePos) (y.x = y.x2), (y.y = y.y2), (y.dir = y.d2);
  8089. else {
  8090. const a = y.t2 - y.t1,
  8091. p = (o - y.t1) / a,
  8092. h = 170;
  8093. y.dt += be;
  8094. const m = Math.min(1.7, y.dt / h);
  8095. var e = y.x2 - y.x1;
  8096. (y.x = y.x1 + e * m), (e = y.y2 - y.y1), (y.y = y.y1 + e * m), (y.dir = Math.lerpAngle(y.d2, y.d1, Math.min(1.2, p)));
  8097. }
  8098. const l = Re - se / 2,
  8099. c = _e - re / 2;
  8100. T.snowBiomeTop - c <= 0 && T.mapScale - T.snowBiomeTop - c >= re
  8101. ? ((M.fillStyle = "#b6db66"), M.fillRect(0, 0, se, re))
  8102. : T.mapScale - T.snowBiomeTop - c <= 0
  8103. ? ((M.fillStyle = "#dbc666"), M.fillRect(0, 0, se, re))
  8104. : T.snowBiomeTop - c >= re
  8105. ? ((M.fillStyle = "#fff"), M.fillRect(0, 0, se, re))
  8106. : T.snowBiomeTop - c >= 0
  8107. ? ((M.fillStyle = "#fff"), M.fillRect(0, 0, se, T.snowBiomeTop - c), (M.fillStyle = "#b6db66"), M.fillRect(0, T.snowBiomeTop - c, se, re - (T.snowBiomeTop - c)))
  8108. : ((M.fillStyle = "#b6db66"), M.fillRect(0, 0, se, T.mapScale - T.snowBiomeTop - c), (M.fillStyle = "#dbc666"), M.fillRect(0, T.mapScale - T.snowBiomeTop - c, se, re - (T.mapScale - T.snowBiomeTop - c))),
  8109. Ei ||
  8110. ((ct += wn * T.waveSpeed * be),
  8111. ct >= T.waveMax ? ((ct = T.waveMax), (wn = -1)) : ct <= 1 && (ct = wn = 1),
  8112. (M.globalAlpha = 1),
  8113. (M.fillStyle = "#dbc666"),
  8114. Tr(l, c, M, T.riverPadding),
  8115. (M.fillStyle = "#91b2db"),
  8116. Tr(l, c, M, (ct - 1) * 250)),
  8117. (M.lineWidth = 4),
  8118. (M.strokeStyle = "#000"),
  8119. (M.globalAlpha = 0.06),
  8120. M.beginPath();
  8121. for (var i = -Re; i < se; i += re / 18) i > 0 && (M.moveTo(i, 0), M.lineTo(i, re));
  8122. for (let a = -_e; a < re; a += re / 18) i > 0 && (M.moveTo(0, a), M.lineTo(se, a));
  8123. M.stroke(), (M.globalAlpha = 1), (M.strokeStyle = ei), zt(-1, l, c), (M.globalAlpha = 1), (M.lineWidth = Xe), br(0, l, c), Ir(l, c, 0), (M.globalAlpha = 1);
  8124. for (var t = 0; t < ye.length; ++t) (y = ye[t]), y.active && y.visible && (y.animate(be), M.save(), M.translate(y.x - l, y.y - c), M.rotate(y.dir + y.dirPlus - Math.PI / 2), Jf(y, M), M.restore());
  8125. if ((zt(0, l, c), br(1, l, c), zt(1, l, c), Ir(l, c, 1), zt(2, l, c), zt(3, l, c), (M.fillStyle = "#000"), (M.globalAlpha = 0.09), l <= 0 && M.fillRect(0, 0, -l, re), T.mapScale - l <= se)) {
  8126. var s = Math.max(0, -c);
  8127. M.fillRect(T.mapScale - l, s, se - (T.mapScale - l), re - s);
  8128. }
  8129. if ((c <= 0 && M.fillRect(-l, 0, se + l, -c), T.mapScale - c <= re)) {
  8130. var n = Math.max(0, -l);
  8131. let a = 0;
  8132. T.mapScale - l <= se && (a = se - (T.mapScale - l)), M.fillRect(n, T.mapScale - c, se - n - a, re - (T.mapScale - c));
  8133. }
  8134. (M.globalAlpha = 1), (M.fillStyle = "rgba(0, 0, 70, 0.35)"), M.fillRect(0, 0, se, re), (M.strokeStyle = kr);
  8135. for (var t = 0; t < J.length + ye.length; ++t)
  8136. if (((y = J[t] || ye[t - J.length]), y.visible && (y.skinIndex != 10 || y == E || (y.team && y.team == E.team)))) {
  8137. const u = (y.team ? "[" + y.team + "] " : "") + (y.name || "");
  8138. if (u != "") {
  8139. if (
  8140. ((M.font = (y.nameScale || 30) + "px Hammersmith One"),
  8141. (M.fillStyle = "#fff"),
  8142. (M.textBaseline = "middle"),
  8143. (M.textAlign = "center"),
  8144. (M.lineWidth = y.nameScale ? 11 : 8),
  8145. (M.lineJoin = "round"),
  8146. M.strokeText(u, y.x - l, y.y - c - y.scale - T.nameY),
  8147. M.fillText(u, y.x - l, y.y - c - y.scale - T.nameY),
  8148. y.isLeader && Vt.crown.isLoaded)
  8149. ) {
  8150. var r = T.crownIconScale,
  8151. n = y.x - l - r / 2 - M.measureText(u).width / 2 - T.crownPad;
  8152. M.drawImage(Vt.crown, n, y.y - c - y.scale - T.nameY - r / 2 - 5, r, r);
  8153. }
  8154. if (y.iconIndex == 1 && Vt.skull.isLoaded) {
  8155. var r = T.crownIconScale,
  8156. n = y.x - l - r / 2 + M.measureText(u).width / 2 + T.crownPad;
  8157. M.drawImage(Vt.skull, n, y.y - c - y.scale - T.nameY - r / 2 - 5, r, r);
  8158. }
  8159. }
  8160. y.health > 0 &&
  8161. (T.healthBarWidth,
  8162. (M.fillStyle = kr),
  8163. M.roundRect(y.x - l - T.healthBarWidth - T.healthBarPad, y.y - c + y.scale + T.nameY, T.healthBarWidth * 2 + T.healthBarPad * 2, 17, 8),
  8164. M.fill(),
  8165. (M.fillStyle = y == E || (y.team && y.team == E.team) ? "#8ecc51" : "#cc5151"),
  8166. 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),
  8167. M.fill());
  8168. }
  8169. Hn.update(be, M, l, c);
  8170. for (var t = 0; t < J.length; ++t)
  8171. if (((y = J[t]), y.visible && y.chatCountdown > 0)) {
  8172. (y.chatCountdown -= be), y.chatCountdown <= 0 && (y.chatCountdown = 0), (M.font = "32px Hammersmith One");
  8173. const u = M.measureText(y.chatMessage);
  8174. (M.textBaseline = "middle"), (M.textAlign = "center");
  8175. var n = y.x - l,
  8176. s = y.y - y.scale - c - 90;
  8177. const m = 47,
  8178. w = u.width + 17;
  8179. (M.fillStyle = "rgba(0,0,0,0.2)"), M.roundRect(n - w / 2, s - m / 2, w, m, 6), M.fill(), (M.fillStyle = "#fff"), M.fillText(y.chatMessage, n, s);
  8180. }
  8181. }
  8182. lf(be);
  8183. }
  8184. function br(e, t, i) {
  8185. for (let s = 0; s < Mt.length; ++s) (y = Mt[s]), y.active && y.layer == e && (y.update(be), y.active && Bo(y.x - t, y.y - i, y.scale) && (M.save(), M.translate(y.x - t, y.y - i), M.rotate(y.dir), Zn(0, 0, y, M), M.restore()));
  8186. }
  8187. const Sr = {};
  8188. function Zn(e, t, i, s, n) {
  8189. if (i.src) {
  8190. const r = R.projectiles[i.indx].src;
  8191. let o = Sr[r];
  8192. o ||
  8193. ((o = new Image()),
  8194. (o.onload = function () {
  8195. this.isLoaded = !0;
  8196. }),
  8197. (o.src = "./img/weapons/" + r + ".png"),
  8198. (Sr[r] = o)),
  8199. o.isLoaded && s.drawImage(o, e - i.scale / 2, t - i.scale / 2, i.scale, i.scale);
  8200. } else i.indx == 1 && ((s.fillStyle = "#939393"), Q(e, t, i.scale, s));
  8201. }
  8202. function Rf() {
  8203. const e = Re - se / 2,
  8204. t = _e - re / 2;
  8205. (Me.animationTime += be), (Me.animationTime %= T.volcanoAnimationDuration);
  8206. const i = T.volcanoAnimationDuration / 2,
  8207. s = 1.7 + 0.3 * (Math.abs(i - Me.animationTime) / i),
  8208. n = T.innerVolcanoScale * s;
  8209. M.drawImage(Me.land, Me.x - T.volcanoScale - e, Me.y - T.volcanoScale - t, T.volcanoScale * 2, T.volcanoScale * 2), M.drawImage(Me.lava, Me.x - n - e, Me.y - n - t, n * 2, n * 2);
  8210. }
  8211. function Tr(e, t, i, s) {
  8212. const n = T.riverWidth + s,
  8213. r = T.mapScale / 2 - t - n / 2;
  8214. r < re && r + n > 0 && i.fillRect(0, r, se, n);
  8215. }
  8216. function zt(e, t, i) {
  8217. let s, n, r;
  8218. for (let o = 0; o < et.length; ++o)
  8219. (y = et[o]),
  8220. y.active &&
  8221. ((n = y.x + y.xWiggle - t),
  8222. (r = y.y + y.yWiggle - i),
  8223. e == 0 && y.update(be),
  8224. y.layer == e &&
  8225. Bo(n, r, y.scale + (y.blocker || 0)) &&
  8226. ((M.globalAlpha = y.hideFromEnemy ? 0.6 : 1),
  8227. y.isItem
  8228. ? ((s = Ss(y)),
  8229. M.save(),
  8230. M.translate(n, r),
  8231. M.rotate(y.dir),
  8232. M.drawImage(s, -(s.width / 2), -(s.height / 2)),
  8233. y.blocker && ((M.strokeStyle = "#db6e6e"), (M.globalAlpha = 0.3), (M.lineWidth = 6), Q(0, 0, y.blocker, M, !1, !0)),
  8234. M.restore())
  8235. : y.type === 4
  8236. ? Rf()
  8237. : ((s = Hf(y)), M.drawImage(s, n - s.width / 2, r - s.height / 2))));
  8238. }
  8239. function _f(e, t, i) {
  8240. (y = _i(e)), y && y.startAnim(t, i);
  8241. }
  8242. function Ir(e, t, i) {
  8243. M.globalAlpha = 1;
  8244. for (let s = 0; s < J.length; ++s)
  8245. (y = J[s]), y.zIndex == i && (y.animate(be), y.visible && ((y.skinRot += 0.002 * be), (lr = (y == E ? vs() : y.dir) + y.dirPlus), M.save(), M.translate(y.x - e, y.y - t), M.rotate(lr), Bf(y, M), M.restore()));
  8246. }
  8247. function Bf(e, t) {
  8248. (t = t || M), (t.lineWidth = Xe), (t.lineJoin = "miter");
  8249. const i = (Math.PI / 4) * (R.weapons[e.weaponIndex].armS || 1),
  8250. s = (e.buildIndex < 0 && R.weapons[e.weaponIndex].hndS) || 1,
  8251. n = (e.buildIndex < 0 && R.weapons[e.weaponIndex].hndD) || 1;
  8252. if (
  8253. (e.tailIndex > 0 && zf(e.tailIndex, t, e),
  8254. e.buildIndex < 0 &&
  8255. !R.weapons[e.weaponIndex].aboveHand &&
  8256. (Ar(R.weapons[e.weaponIndex], T.weaponVariants[e.weaponVariant].src, e.scale, 0, t),
  8257. R.weapons[e.weaponIndex].projectile != null && !R.weapons[e.weaponIndex].hideProjectile && Zn(e.scale, 0, R.projectiles[R.weapons[e.weaponIndex].projectile], M)),
  8258. (t.fillStyle = T.skinColors[e.skinColor]),
  8259. Q(e.scale * Math.cos(i), e.scale * Math.sin(i), 14),
  8260. Q(e.scale * n * Math.cos(-i * s), e.scale * n * Math.sin(-i * s), 14),
  8261. e.buildIndex < 0 &&
  8262. R.weapons[e.weaponIndex].aboveHand &&
  8263. (Ar(R.weapons[e.weaponIndex], T.weaponVariants[e.weaponVariant].src, e.scale, 0, t),
  8264. R.weapons[e.weaponIndex].projectile != null && !R.weapons[e.weaponIndex].hideProjectile && Zn(e.scale, 0, R.projectiles[R.weapons[e.weaponIndex].projectile], M)),
  8265. e.buildIndex >= 0)
  8266. ) {
  8267. const r = Ss(R.list[e.buildIndex]);
  8268. t.drawImage(r, e.scale - R.list[e.buildIndex].holdOffset, -r.width / 2);
  8269. }
  8270. Q(0, 0, e.scale, t), e.skinIndex > 0 && (t.rotate(Math.PI / 2), _o(e.skinIndex, t, null, e));
  8271. }
  8272. const Mr = {},
  8273. Er = {};
  8274. let De;
  8275. function _o(e, t, i, s) {
  8276. if (((De = Mr[e]), !De)) {
  8277. const r = new Image();
  8278. (r.onload = function () {
  8279. (this.isLoaded = !0), (this.onload = null);
  8280. }),
  8281. (r.src = "./img/hats/hat_" + e + ".png"),
  8282. (Mr[e] = r),
  8283. (De = r);
  8284. }
  8285. let n = i || Er[e];
  8286. if (!n) {
  8287. for (let r = 0; r < Xt.length; ++r)
  8288. if (Xt[r].id == e) {
  8289. n = Xt[r];
  8290. break;
  8291. }
  8292. Er[e] = n;
  8293. }
  8294. De.isLoaded && t.drawImage(De, -n.scale / 2, -n.scale / 2, n.scale, n.scale), !i && n.topSprite && (t.save(), t.rotate(s.skinRot), _o(e + "_top", t, n, s), t.restore());
  8295. }
  8296. const Pr = {},
  8297. Cr = {};
  8298. function zf(e, t, i) {
  8299. if (((De = Pr[e]), !De)) {
  8300. const n = new Image();
  8301. (n.onload = function () {
  8302. (this.isLoaded = !0), (this.onload = null);
  8303. }),
  8304. (n.src = "./img/accessories/access_" + e + ".png"),
  8305. (Pr[e] = n),
  8306. (De = n);
  8307. }
  8308. let s = Cr[e];
  8309. if (!s) {
  8310. for (let n = 0; n < Gt.length; ++n)
  8311. if (Gt[n].id == e) {
  8312. s = Gt[n];
  8313. break;
  8314. }
  8315. Cr[e] = s;
  8316. }
  8317. De.isLoaded && (t.save(), t.translate(-20 - (s.xOff || 0), 0), s.spin && t.rotate(i.skinRot), t.drawImage(De, -(s.scale / 2), -(s.scale / 2), s.scale, s.scale), t.restore());
  8318. }
  8319. var jn = {};
  8320. function Ar(e, t, i, s, n) {
  8321. const r = e.src + (t || "");
  8322. let o = jn[r];
  8323. o ||
  8324. ((o = new Image()),
  8325. (o.onload = function () {
  8326. this.isLoaded = !0;
  8327. }),
  8328. (o.src = "./img/weapons/" + r + ".png"),
  8329. (jn[r] = o)),
  8330. o.isLoaded && n.drawImage(o, i + e.xOff - e.length / 2, s + e.yOff - e.width / 2, e.length, e.width);
  8331. }
  8332. const Dr = {};
  8333. function Hf(e) {
  8334. const t = e.y >= T.mapScale - T.snowBiomeTop ? 2 : e.y <= T.snowBiomeTop ? 1 : 0,
  8335. i = e.type + "_" + e.scale + "_" + t;
  8336. let s = Dr[i];
  8337. if (!s) {
  8338. const r = document.createElement("canvas");
  8339. r.width = r.height = e.scale * 2.1 + Xe;
  8340. const o = r.getContext("2d");
  8341. if ((o.translate(r.width / 2, r.height / 2), o.rotate(C.randFloat(0, Math.PI)), (o.strokeStyle = ei), (o.lineWidth = Xe), e.type == 0)) {
  8342. let l;
  8343. for (var n = 0; n < 2; ++n) (l = y.scale * (n ? 0.5 : 1)), Ie(o, y.sid % 2 === 0 ? 5 : 7, l, l * 0.7), (o.fillStyle = t ? (n ? "#fff" : "#e3f1f4") : n ? "#b4db62" : "#9ebf57"), o.fill(), n || o.stroke();
  8344. } else if (e.type == 1)
  8345. if (t == 2) (o.fillStyle = "#606060"), Ie(o, 6, e.scale * 0.3, e.scale * 0.71), o.fill(), o.stroke(), (o.fillStyle = "#89a54c"), Q(0, 0, e.scale * 0.55, o), (o.fillStyle = "#a5c65b"), Q(0, 0, e.scale * 0.3, o, !0);
  8346. else {
  8347. Uf(o, 6, y.scale, y.scale * 0.7), (o.fillStyle = t ? "#e3f1f4" : "#89a54c"), o.fill(), o.stroke(), (o.fillStyle = t ? "#6a64af" : "#c15555");
  8348. let l;
  8349. const c = 4,
  8350. a = Ze / c;
  8351. for (var n = 0; n < c; ++n) (l = C.randInt(y.scale / 3.5, y.scale / 2.3)), Q(l * Math.cos(a * n), l * Math.sin(a * n), C.randInt(10, 12), o);
  8352. }
  8353. else
  8354. (e.type == 2 || e.type == 3) &&
  8355. ((o.fillStyle = e.type == 2 ? (t == 2 ? "#938d77" : "#939393") : "#e0c655"),
  8356. Ie(o, 3, e.scale, e.scale),
  8357. o.fill(),
  8358. o.stroke(),
  8359. (o.fillStyle = e.type == 2 ? (t == 2 ? "#b2ab90" : "#bcbcbc") : "#ebdca3"),
  8360. Ie(o, 3, e.scale * 0.55, e.scale * 0.65),
  8361. o.fill());
  8362. (s = r), (Dr[i] = s);
  8363. }
  8364. return s;
  8365. }
  8366. function Or(e, t, i) {
  8367. const s = e.lineWidth || 0;
  8368. (i /= 2), e.beginPath();
  8369. let n = (Math.PI * 2) / t;
  8370. for (let r = 0; r < t; r++) e.lineTo(i + (i - s / 2) * Math.cos(n * r), i + (i - s / 2) * Math.sin(n * r));
  8371. e.closePath();
  8372. }
  8373. function Ff() {
  8374. const t = T.volcanoScale * 2,
  8375. i = document.createElement("canvas");
  8376. (i.width = t), (i.height = t);
  8377. const s = i.getContext("2d");
  8378. (s.strokeStyle = "#3e3e3e"), (s.lineWidth = Xe * 2), (s.fillStyle = "#7f7f7f"), Or(s, 10, t), s.fill(), s.stroke(), (Me.land = i);
  8379. const n = document.createElement("canvas"),
  8380. r = T.innerVolcanoScale * 2;
  8381. (n.width = r), (n.height = r);
  8382. const o = n.getContext("2d");
  8383. (o.strokeStyle = ei), (o.lineWidth = Xe * 1.6), (o.fillStyle = "#f54e16"), (o.strokeStyle = "#f56f16"), Or(o, 10, r), o.fill(), o.stroke(), (Me.lava = n);
  8384. }
  8385. Ff();
  8386. const Rr = [];
  8387. function Ss(e, t) {
  8388. let i = Rr[e.id];
  8389. if (!i || t) {
  8390. const c = document.createElement("canvas");
  8391. c.width = c.height = e.scale * 2.5 + Xe + (R.list[e.id].spritePadding || 0);
  8392. const a = c.getContext("2d");
  8393. if ((a.translate(c.width / 2, c.height / 2), a.rotate(t ? 0 : Math.PI / 2), (a.strokeStyle = ei), (a.lineWidth = Xe * (t ? c.width / 81 : 1)), e.name == "apple")) {
  8394. (a.fillStyle = "#c15555"), Q(0, 0, e.scale, a), (a.fillStyle = "#89a54c");
  8395. const u = -(Math.PI / 2);
  8396. Vf(e.scale * Math.cos(u), e.scale * Math.sin(u), 25, u + Math.PI / 2, a);
  8397. } else if (e.name == "cookie") {
  8398. (a.fillStyle = "#cca861"), Q(0, 0, e.scale, a), (a.fillStyle = "#937c4b");
  8399. for (var s = 4, n = Ze / s, r, o = 0; o < s; ++o) (r = C.randInt(e.scale / 2.5, e.scale / 1.7)), Q(r * Math.cos(n * o), r * Math.sin(n * o), C.randInt(4, 5), a, !0);
  8400. } else if (e.name == "cheese") {
  8401. (a.fillStyle = "#f4f3ac"), Q(0, 0, e.scale, a), (a.fillStyle = "#c3c28b");
  8402. for (var s = 4, n = Ze / s, r, o = 0; o < s; ++o) (r = C.randInt(e.scale / 2.5, e.scale / 1.7)), Q(r * Math.cos(n * o), r * Math.sin(n * o), C.randInt(4, 5), a, !0);
  8403. } else if (e.name == "wood wall" || e.name == "stone wall" || e.name == "castle wall") {
  8404. a.fillStyle = e.name == "castle wall" ? "#83898e" : e.name == "wood wall" ? "#a5974c" : "#939393";
  8405. const u = e.name == "castle wall" ? 4 : 3;
  8406. Ie(a, u, e.scale * 1.1, e.scale * 1.1), a.fill(), a.stroke(), (a.fillStyle = e.name == "castle wall" ? "#9da4aa" : e.name == "wood wall" ? "#c9b758" : "#bcbcbc"), Ie(a, u, e.scale * 0.65, e.scale * 0.65), a.fill();
  8407. } else if (e.name == "spikes" || e.name == "greater spikes" || e.name == "poison spikes" || e.name == "spinning spikes") {
  8408. a.fillStyle = e.name == "poison spikes" ? "#7b935d" : "#939393";
  8409. var l = e.scale * 0.6;
  8410. Ie(a, e.name == "spikes" ? 5 : 6, e.scale, l), a.fill(), a.stroke(), (a.fillStyle = "#a5974c"), Q(0, 0, l, a), (a.fillStyle = "#c9b758"), Q(0, 0, l / 2, a, !0);
  8411. } else if (e.name == "windmill" || e.name == "faster windmill" || e.name == "power mill")
  8412. (a.fillStyle = "#a5974c"), Q(0, 0, e.scale, a), (a.fillStyle = "#c9b758"), En(0, 0, e.scale * 1.5, 29, 4, a), (a.fillStyle = "#a5974c"), Q(0, 0, e.scale * 0.5, a);
  8413. else if (e.name == "mine") (a.fillStyle = "#939393"), Ie(a, 3, e.scale, e.scale), a.fill(), a.stroke(), (a.fillStyle = "#bcbcbc"), Ie(a, 3, e.scale * 0.55, e.scale * 0.65), a.fill();
  8414. else if (e.name == "sapling")
  8415. for (var o = 0; o < 2; ++o) {
  8416. var l = e.scale * (o ? 0.5 : 1);
  8417. Ie(a, 7, l, l * 0.7), (a.fillStyle = o ? "#b4db62" : "#9ebf57"), a.fill(), o || a.stroke();
  8418. }
  8419. else if (e.name == "pit trap") (a.fillStyle = "#a5974c"), Ie(a, 3, e.scale * 1.1, e.scale * 1.1), a.fill(), a.stroke(), (a.fillStyle = ei), Ie(a, 3, e.scale * 0.65, e.scale * 0.65), a.fill();
  8420. else if (e.name == "boost pad") (a.fillStyle = "#7e7f82"), kt(0, 0, e.scale * 2, e.scale * 2, a), a.fill(), a.stroke(), (a.fillStyle = "#dbd97d"), Lf(e.scale * 1, a);
  8421. else if (e.name == "turret") {
  8422. (a.fillStyle = "#a5974c"), Q(0, 0, e.scale, a), a.fill(), a.stroke(), (a.fillStyle = "#939393");
  8423. const u = 50;
  8424. kt(0, -u / 2, e.scale * 0.9, u, a), Q(0, 0, e.scale * 0.6, a), a.fill(), a.stroke();
  8425. } else if (e.name == "platform") {
  8426. a.fillStyle = "#cebd5f";
  8427. const u = 4,
  8428. p = e.scale * 2,
  8429. h = p / u;
  8430. let m = -(e.scale / 2);
  8431. for (var o = 0; o < u; ++o) kt(m - h / 2, 0, h, e.scale * 2, a), a.fill(), a.stroke(), (m += p / u);
  8432. } else
  8433. e.name == "healing pad"
  8434. ? ((a.fillStyle = "#7e7f82"), kt(0, 0, e.scale * 2, e.scale * 2, a), a.fill(), a.stroke(), (a.fillStyle = "#db6e6e"), En(0, 0, e.scale * 0.65, 20, 4, a, !0))
  8435. : e.name == "spawn pad"
  8436. ? ((a.fillStyle = "#7e7f82"), kt(0, 0, e.scale * 2, e.scale * 2, a), a.fill(), a.stroke(), (a.fillStyle = "#71aad6"), Q(0, 0, e.scale * 0.6, a))
  8437. : e.name == "blocker"
  8438. ? ((a.fillStyle = "#7e7f82"), Q(0, 0, e.scale, a), a.fill(), a.stroke(), a.rotate(Math.PI / 4), (a.fillStyle = "#db6e6e"), En(0, 0, e.scale * 0.65, 20, 4, a, !0))
  8439. : e.name == "teleporter" && ((a.fillStyle = "#7e7f82"), Q(0, 0, e.scale, a), a.fill(), a.stroke(), a.rotate(Math.PI / 4), (a.fillStyle = "#d76edb"), Q(0, 0, e.scale * 0.5, a, !0));
  8440. (i = c), t || (Rr[e.id] = i);
  8441. }
  8442. return i;
  8443. }
  8444. function Vf(e, t, i, s, n) {
  8445. const r = e + i * Math.cos(s),
  8446. o = t + i * Math.sin(s),
  8447. l = i * 0.4;
  8448. n.moveTo(e, t),
  8449. n.beginPath(),
  8450. n.quadraticCurveTo((e + r) / 2 + l * Math.cos(s + Math.PI / 2), (t + o) / 2 + l * Math.sin(s + Math.PI / 2), r, o),
  8451. n.quadraticCurveTo((e + r) / 2 - l * Math.cos(s + Math.PI / 2), (t + o) / 2 - l * Math.sin(s + Math.PI / 2), e, t),
  8452. n.closePath(),
  8453. n.fill(),
  8454. n.stroke();
  8455. }
  8456. function Q(e, t, i, s, n, r) {
  8457. (s = s || M), s.beginPath(), s.arc(e, t, i, 0, 2 * Math.PI), r || s.fill(), n || s.stroke();
  8458. }
  8459. function Ie(e, t, i, s) {
  8460. let n = (Math.PI / 2) * 3,
  8461. r,
  8462. o;
  8463. const l = Math.PI / t;
  8464. e.beginPath(), e.moveTo(0, -i);
  8465. for (let c = 0; c < t; c++) (r = Math.cos(n) * i), (o = Math.sin(n) * i), e.lineTo(r, o), (n += l), (r = Math.cos(n) * s), (o = Math.sin(n) * s), e.lineTo(r, o), (n += l);
  8466. e.lineTo(0, -i), e.closePath();
  8467. }
  8468. function kt(e, t, i, s, n, r) {
  8469. n.fillRect(e - i / 2, t - s / 2, i, s), r || n.strokeRect(e - i / 2, t - s / 2, i, s);
  8470. }
  8471. function En(e, t, i, s, n, r, o) {
  8472. r.save(), r.translate(e, t), (n = Math.ceil(n / 2));
  8473. for (let l = 0; l < n; l++) kt(0, 0, i * 2, s, r, o), r.rotate(Math.PI / n);
  8474. r.restore();
  8475. }
  8476. function Uf(e, t, i, s) {
  8477. let n = (Math.PI / 2) * 3;
  8478. const r = Math.PI / t;
  8479. let o;
  8480. e.beginPath(), e.moveTo(0, -s);
  8481. for (let l = 0; l < t; l++) (o = C.randInt(i + 0.9, i * 1.2)), e.quadraticCurveTo(Math.cos(n + r) * o, Math.sin(n + r) * o, Math.cos(n + r * 2) * s, Math.sin(n + r * 2) * s), (n += r * 2);
  8482. e.lineTo(0, -s), e.closePath();
  8483. }
  8484. function Lf(e, t) {
  8485. t = t || M;
  8486. const i = e * (Math.sqrt(3) / 2);
  8487. t.beginPath(), t.moveTo(0, -i / 2), t.lineTo(-e / 2, i / 2), t.lineTo(e / 2, i / 2), t.lineTo(0, -i / 2), t.fill(), t.closePath();
  8488. }
  8489. function Nf() {
  8490. const e = T.mapScale / 2;
  8491. ue.add(0, e, e + 200, 0, T.treeScales[3], 0),
  8492. ue.add(1, e, e - 480, 0, T.treeScales[3], 0),
  8493. ue.add(2, e + 300, e + 450, 0, T.treeScales[3], 0),
  8494. ue.add(3, e - 950, e - 130, 0, T.treeScales[2], 0),
  8495. ue.add(4, e - 750, e - 400, 0, T.treeScales[3], 0),
  8496. ue.add(5, e - 700, e + 400, 0, T.treeScales[2], 0),
  8497. ue.add(6, e + 800, e - 200, 0, T.treeScales[3], 0),
  8498. ue.add(7, e - 260, e + 340, 0, T.bushScales[3], 1),
  8499. ue.add(8, e + 760, e + 310, 0, T.bushScales[3], 1),
  8500. ue.add(9, e - 800, e + 100, 0, T.bushScales[3], 1),
  8501. ue.add(10, e - 800, e + 300, 0, R.list[4].scale, R.list[4].id, R.list[10]),
  8502. ue.add(11, e + 650, e - 390, 0, R.list[4].scale, R.list[4].id, R.list[10]),
  8503. ue.add(12, e - 400, e - 450, 0, T.rockScales[2], 2);
  8504. }
  8505. function qf(e) {
  8506. for (let t = 0; t < e.length; ) 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 ? { sid: e[t + 7] } : null), (t += 8);
  8507. }
  8508. function Wf(e, t) {
  8509. (y = Ho(t)), y && ((y.xWiggle += T.gatherWiggle * Math.cos(e)), (y.yWiggle += T.gatherWiggle * Math.sin(e)));
  8510. }
  8511. function Xf(e, t) {
  8512. (y = Ho(e)), y && ((y.dir = t), (y.xWiggle += T.gatherWiggle * Math.cos(t + Math.PI)), (y.yWiggle += T.gatherWiggle * Math.sin(t + Math.PI)));
  8513. }
  8514. function Gf(e, t, i, s, n, r, o, l) {
  8515. ds && (po.addProjectile(e, t, i, s, n, r, null, null, o).sid = l);
  8516. }
  8517. function Yf(e, t) {
  8518. for (let i = 0; i < Mt.length; ++i) Mt[i].sid == e && (Mt[i].range = t);
  8519. }
  8520. function $f(e) {
  8521. (y = zo(e)), y && y.startAnim();
  8522. }
  8523. function Kf(e) {
  8524. for (var t = 0; t < ye.length; ++t) (ye[t].forcePos = !ye[t].visible), (ye[t].visible = !1);
  8525. if (e) {
  8526. const i = Date.now();
  8527. for (var t = 0; t < e.length; )
  8528. (y = zo(e[t])),
  8529. y
  8530. ? ((y.index = e[t + 1]),
  8531. (y.t1 = y.t2 === void 0 ? i : y.t2),
  8532. (y.t2 = i),
  8533. (y.x1 = y.x),
  8534. (y.y1 = y.y),
  8535. (y.x2 = e[t + 2]),
  8536. (y.y2 = e[t + 3]),
  8537. (y.d1 = y.d2 === void 0 ? e[t + 4] : y.d2),
  8538. (y.d2 = e[t + 4]),
  8539. (y.health = e[t + 5]),
  8540. (y.dt = 0),
  8541. (y.visible = !0))
  8542. : ((y = ar.spawn(e[t + 2], e[t + 3], e[t + 4], e[t + 1])),
  8543. (y.x2 = y.x),
  8544. (y.y2 = y.y),
  8545. (y.d2 = y.dir),
  8546. (y.health = e[t + 5]),
  8547. ar.aiTypes[e[t + 1]].name || (y.name = T.cowNames[e[t + 6]]),
  8548. (y.forcePos = !0),
  8549. (y.sid = e[t]),
  8550. (y.visible = !0)),
  8551. (t += 7);
  8552. }
  8553. }
  8554. const _r = {};
  8555. function Jf(e, t) {
  8556. const i = e.index;
  8557. let s = _r[i];
  8558. if (!s) {
  8559. const n = new Image();
  8560. (n.onload = function () {
  8561. (this.isLoaded = !0), (this.onload = null);
  8562. }),
  8563. (n.src = "./img/animals/" + e.src + ".png"),
  8564. (s = n),
  8565. (_r[i] = s);
  8566. }
  8567. if (s.isLoaded) {
  8568. const n = e.scale * 1.2 * (e.spriteMlt || 1);
  8569. t.drawImage(s, -n, -n, n * 2, n * 2);
  8570. }
  8571. }
  8572. function Bo(e, t, i) {
  8573. return e + i >= 0 && e - i <= se && t + i >= 0 && t - i <= re;
  8574. }
  8575. function Qf(e, t) {
  8576. let i = nu(e[0]);
  8577. i || ((i = new _c(e[0], e[1], T, C, po, ue, J, ye, R, Xt, Gt)), J.push(i)),
  8578. i.spawn(t ? xi : null),
  8579. (i.visible = !1),
  8580. (i.x2 = void 0),
  8581. (i.y2 = void 0),
  8582. i.setData(e),
  8583. t && ((E = i), (Re = E.x), (_e = E.y), To(), Do(), Ro(), Oo(0), (us.style.display = "block"));
  8584. }
  8585. function Zf(e) {
  8586. for (let t = 0; t < J.length; t++)
  8587. if (J[t].id == e) {
  8588. J.splice(t, 1);
  8589. break;
  8590. }
  8591. }
  8592. function jf(e, t) {
  8593. E && (E.itemCounts[e] = t);
  8594. }
  8595. function eu(e, t, i) {
  8596. E && ((E[e] = t), i && Do());
  8597. }
  8598. function tu(e, t) {
  8599. (y = _i(e)), y && (y.health = t);
  8600. }
  8601. function iu(e) {
  8602. const t = Date.now();
  8603. for (var i = 0; i < J.length; ++i) (J[i].forcePos = !J[i].visible), (J[i].visible = !1);
  8604. for (var i = 0; i < e.length; )
  8605. (y = _i(e[i])),
  8606. y &&
  8607. ((y.t1 = y.t2 === void 0 ? t : y.t2),
  8608. (y.t2 = t),
  8609. (y.x1 = y.x),
  8610. (y.y1 = y.y),
  8611. (y.x2 = e[i + 1]),
  8612. (y.y2 = e[i + 2]),
  8613. (y.d1 = y.d2 === void 0 ? e[i + 3] : y.d2),
  8614. (y.d2 = e[i + 3]),
  8615. (y.dt = 0),
  8616. (y.buildIndex = e[i + 4]),
  8617. (y.weaponIndex = e[i + 5]),
  8618. (y.weaponVariant = e[i + 6]),
  8619. (y.team = e[i + 7]),
  8620. (y.isLeader = e[i + 8]),
  8621. (y.skinIndex = e[i + 9]),
  8622. (y.tailIndex = e[i + 10]),
  8623. (y.iconIndex = e[i + 11]),
  8624. (y.zIndex = e[i + 12]),
  8625. (y.visible = !0)),
  8626. (i += 13);
  8627. }
  8628. function nu(e) {
  8629. for (let t = 0; t < J.length; ++t) if (J[t].id == e) return J[t];
  8630. return null;
  8631. }
  8632. function _i(e) {
  8633. for (let t = 0; t < J.length; ++t) if (J[t].sid == e) return J[t];
  8634. return null;
  8635. }
  8636. function zo(e) {
  8637. for (let t = 0; t < ye.length; ++t) if (ye[t].sid == e) return ye[t];
  8638. return null;
  8639. }
  8640. function Ho(e) {
  8641. for (let t = 0; t < et.length; ++t) if (et[t].sid == e) return et[t];
  8642. return null;
  8643. }
  8644. let Fo = -1;
  8645. function su() {
  8646. const e = Date.now() - Fo;
  8647. (window.pingTime = e), (Qt.innerText = "Ping: " + e + "Â ms");
  8648. }
  8649. let Pn;
  8650. function Vo() {
  8651. Pn && clearTimeout(Pn), cs() && ((Fo = Date.now()), ee.send("0")), (Pn = setTimeout(Vo, 2500));
  8652. }
  8653. function ru(e) {
  8654. if (e < 0) return;
  8655. const t = Math.floor(e / 60);
  8656. let i = e % 60;
  8657. (i = ("0" + i).slice(-2)), (dr.innerText = "Server restarting in " + t + ":" + i), (dr.hidden = !1);
  8658. }
  8659. window.requestAnimFrame = (function () {
  8660. return (
  8661. window.requestAnimationFrame ||
  8662. window.webkitRequestAnimationFrame ||
  8663. window.mozRequestAnimationFrame ||
  8664. function (e) {
  8665. window.setTimeout(e, 1e3 / 60);
  8666. }
  8667. );
  8668. })();
  8669. function Uo() {
  8670. (It = Date.now()), (be = It - or), (or = It), Of(), requestAnimFrame(Uo);
  8671. }
  8672. Nf();
  8673. Uo();
  8674. function Lo(e) {
  8675. window.open(e, "_blank");
  8676. }
  8677. window.openLink = Lo;
  8678. window.aJoinReq = Gn;
  8679. window.follmoo = Bh;
  8680. window.kickFromClan = ko;
  8681. window.sendJoin = vo;
  8682. window.leaveAlliance = xo;
  8683. window.createAlliance = Yn;
  8684. window.storeBuy = bo;
  8685. window.storeEquip = Jn;
  8686. window.showItemInfo = Se;
  8687. window.selectSkinColor = mf;
  8688. window.changeStoreIndex = cf;
  8689. window.config = T;
  8690. window.io = ee;
  8691. window.player = E;
  8692. window.tmpObj = y;
  8693. window.items = R;