7Placer

typescript pixelplace.io bot

当前为 2025-05-02 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name 7Placer
  3. // @description typescript pixelplace.io bot
  4. // @version 2.1.0
  5. // @author Azti
  6. // @include /^https:\/\/pixelplace.io\/\d+-/
  7. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js
  8. // @require https://update.greasyfork.org/scripts/498080/1395134/Hacktimer.js
  9. // @require https://cdnjs.cloudflare.com/ajax/libs/toastify-js/1.12.0/toastify.js
  10. // @require https://cdn.jsdelivr.net/npm/rgbquant@1.1.2/src/rgbquant.min.js
  11. // @grant none
  12. // @run-at document-start
  13. // @namespace https://greasyfork.org/users/374503
  14. // ==/UserScript==
  15.  
  16. /******/ (() => { // webpackBootstrap
  17. /******/ var __webpack_modules__ = ({
  18.  
  19. /***/ "./node_modules/css-loader/dist/cjs.js!./src/GUI/GUIStyle.css":
  20. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  21.  
  22. "use strict";
  23. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  24. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  25. /* harmony export */ });
  26. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  27. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  28. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  29. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  30. // Imports
  31.  
  32.  
  33. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  34. ___CSS_LOADER_EXPORT___.push([module.id, "@import url(https://fonts.cdnfonts.com/css/verdana);"]);
  35. // Module
  36. ___CSS_LOADER_EXPORT___.push([module.id, `:root {
  37. --gui-main-color: #7300ff;
  38. --gui-main-color-fade: color-mix(in oklab, var(--gui-main-color), #000)
  39. }
  40.  
  41. /* GUI */
  42. #sevenGUI {
  43. all: initial;
  44. background-color: #1C1C1C;
  45. height: 40vh;
  46. width: 50vh;
  47. top: 50%;
  48. left: 50%;
  49. transform: translate(-50%, -50%);
  50. position: absolute;
  51. border: #262626;
  52. border-style: solid;
  53. border-width: 0.4vh;
  54. user-select: none;
  55. display: flex;
  56. flex-direction: column;
  57. z-index: 1000;
  58. }
  59.  
  60. #sevenGUIheader {
  61. color: var(--gui-main-color);
  62. text-align: center;
  63. font-family: Verdana, Tahoma, sans-serif;
  64. background-color: #1a1a1a;
  65. font-size: 1.5vh;
  66. }
  67.  
  68. #sevenGUIheader:hover {
  69. cursor: move;
  70. }
  71.  
  72. #rainbowBar {
  73. all: revert;
  74. height: 0.3vh;
  75. width: 100%;
  76. background: linear-gradient(90deg, rgba(0,140,255,1) 0%, rgba(96,39,147,1) 21%, rgba(140,77,78,1) 63%, rgba(181,181,0,1) 100%);
  77. }
  78.  
  79. #generalContainer {
  80. display: flex;
  81. flex-grow: 1; /* Takes remaining space */
  82. min-height: 0;
  83. }
  84.  
  85. /* SIDE BAR */
  86. #sideBarContainer {
  87. height: 100%;
  88. width: 10vh;
  89. background-color: #161616;
  90. display: flex;
  91. flex-flow: column;
  92. align-items: center;
  93. position: relative;
  94. }
  95.  
  96. #sideBarTabContainer {
  97. display: flex;
  98. flex-flow: column;
  99. flex-grow: 1;
  100. width: 100%;
  101. overflow-y: overlay;
  102. scrollbar-width: thin;
  103. scrollbar-color: grey #161616;
  104. direction: rtl;
  105. }
  106.  
  107. .sideBarTab {
  108. height: 7vh;
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. width: 100%;
  113. }
  114.  
  115. .sideBarTab img {
  116. object-fit: contain;
  117. width: 100%;
  118. filter: invert(1) brightness(0.45);
  119. height: 80%;
  120. }
  121.  
  122. .sideBarTab.selected {
  123. background-color: #1C1C1C;
  124. }
  125.  
  126. .sideBarTab.selected img {
  127. filter: invert(1) brightness(1);
  128. }
  129.  
  130. #tabButton_settings {
  131. position: relative;
  132. bottom: 0;
  133. }
  134.  
  135. /* TAB STUFF */
  136. .GUITabContainer {
  137. all: revert;
  138. display: flex;
  139. flex-wrap: wrap;
  140. flex-grow: 1;
  141. flex-direction: column;
  142. position: relative;
  143. padding: 3%;
  144. gap: 3%;
  145. }
  146.  
  147. .GUISubmenu {
  148. all: revert;
  149. min-width: 25%;
  150. max-width: 45%;
  151. box-sizing: border-box;
  152. flex-grow: 1;
  153. position: relative;
  154. background-color: #151515;
  155. border: #252525;
  156. border-width: 0.3vh;
  157. border-style: solid;
  158. display: flex;
  159. }
  160.  
  161. .submenuInside {
  162. display: flex;
  163. all: revert;
  164. overflow-x: hidden;
  165. flex-grow: 1;
  166. padding-top: 2%;
  167. scrollbar-color: rgb(91, 91, 91) rgb(48, 48, 48);
  168. scrollbar-width: thin;
  169. padding: 2%;
  170. min-width: 0;
  171. max-width: 100%;
  172. }
  173.  
  174. .submenuTitle {
  175. all: revert;
  176. position: absolute;
  177. top: -1.9vh;
  178. left: 5%;
  179. color: white;
  180. font-weight: bold;
  181. font-family: 'Verdana', sans-serif;
  182. font-size: 1vh;
  183. }
  184.  
  185. /* Toggle */
  186. .toggleContainer {
  187. display: flex;
  188. flex-direction: row;
  189. justify-content: left;
  190. align-items: center;
  191. gap: 5%;
  192. padding-left: 7%;
  193. overflow: hidden;
  194. margin-top: 3%;
  195. }
  196.  
  197. .toggleSquare {
  198. padding-left: 5%;
  199. padding-bottom: 5%;
  200. background: rgb(58, 58, 58);
  201. border: solid #000000 0.2vh;
  202. }
  203.  
  204. .toggleContainer.toggled .toggleSquare {
  205. background: linear-gradient(180deg, var(--gui-main-color) 0%, var(--gui-main-color-fade) 100%);
  206. }
  207.  
  208. .toggleName {
  209. color: rgb(219, 219, 219);
  210. font-family: 'Verdana', sans-serif;
  211. font-size: 1vh;
  212. margin: 3%;
  213. }
  214.  
  215. /* text */
  216. .textContainer {
  217. width: 100%;
  218. font-size: 1vh;
  219. justify-content: center;
  220. display: flex;
  221. flex-direction: row;
  222. justify-content: left;
  223. overflow: hidden;
  224. margin-top: 3%;
  225. justify-content: center;
  226. }
  227.  
  228. .textContainer > p {
  229. color: rgb(219, 219, 219);
  230. font-family: 'Verdana', sans-serif;
  231. font-size: 1vh;
  232. margin: 3%;
  233. }
  234.  
  235. /* Drop Image */
  236. .dropImage {
  237. position: relative;
  238. display: flex;
  239. height: 7vh;
  240. width: 80%;
  241. align-self: center;
  242. margin-left: auto;
  243. margin-right: auto;
  244. background-color: #242424;
  245. border: 0.3vh solid var(--gui-main-color);
  246. justify-content: center;
  247. align-items: center;
  248. margin-top: 5%;
  249. color: white;
  250. font-family: Verdana, sans-serif;
  251. font-size: 1vh;
  252. }
  253.  
  254. /* Button */
  255. .button {
  256. position: relative;
  257. display: flex;
  258. height: 1.7vh;
  259. width: 80%;
  260. background: linear-gradient(180deg, rgb(76, 75, 75) 0%, rgb(25, 25, 25) 100%);
  261. border: 0.2vh solid #000000;
  262. justify-content: center;
  263. align-items: center;
  264. justify-self: center;
  265. margin-top: 5%;
  266. color: white;
  267. font-family: Verdana, sans-serif;
  268. font-size: 1vh;
  269. }
  270.  
  271. .button:active {
  272. background: linear-gradient(180deg, rgb(31, 31, 31) 0%, rgb(25, 25, 25) 100%)
  273. }
  274.  
  275. /* Input */
  276. .inputContainer {
  277. display: flex;
  278. position: relative;
  279. justify-content: center;
  280. margin-top: 5%;
  281. width: 7vh;
  282. margin-left: auto;
  283. margin-right: auto;
  284. }
  285.  
  286. .inputContainer input {
  287. text-align: center;
  288. height: 1.7vh;
  289. width: 100%;
  290. background-color: #2b2b2b;
  291. border: 1px solid #000;
  292. color: white;
  293. font-family: Verdana, Tahoma, sans-serif;
  294. font-size: 1.1vh;
  295. }
  296.  
  297. input::-webkit-outer-spin-button,
  298. input::-webkit-inner-spin-button {
  299. -webkit-appearance: none;
  300. margin: 0;
  301. }
  302.  
  303. /* Select */
  304. .submenuInside select {
  305. background: linear-gradient(180deg, rgb(76, 75, 75) 0%, rgb(25, 25, 25) 100%);
  306. border: none;
  307. color: rgb(203, 203, 203);
  308. font-family: Verdana, Tahoma, sans-serif;
  309. height: 1.7vh;
  310. width: 80%;
  311. display: block;
  312. margin: 5% auto;
  313. font-size: 1vh;
  314. }
  315. select option {
  316. background: rgb(25, 25, 25);
  317. color: #fff;
  318. }
  319.  
  320. /* ColorSelect */
  321. .colorPicker {
  322. font-family: Verdana, sans-serif;
  323. font-size: 1vh;
  324. color: white;
  325. text-align: center;
  326. }
  327.  
  328. .colorPicker input {
  329. height: 1.7vh;
  330. width: 80%;
  331. margin-top: 0.2vh;
  332. }
  333. input[type="color"]::-webkit-color-swatch-wrapper {
  334. padding: 0;
  335. }
  336. `, ""]);
  337. // Exports
  338. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  339.  
  340.  
  341. /***/ }),
  342.  
  343. /***/ "./node_modules/css-loader/dist/runtime/api.js":
  344. /***/ ((module) => {
  345.  
  346. "use strict";
  347.  
  348.  
  349. /*
  350. MIT License http://www.opensource.org/licenses/mit-license.php
  351. Author Tobias Koppers @sokra
  352. */
  353. module.exports = function (cssWithMappingToString) {
  354. var list = [];
  355.  
  356. // return the list of modules as css string
  357. list.toString = function toString() {
  358. return this.map(function (item) {
  359. var content = "";
  360. var needLayer = typeof item[5] !== "undefined";
  361. if (item[4]) {
  362. content += "@supports (".concat(item[4], ") {");
  363. }
  364. if (item[2]) {
  365. content += "@media ".concat(item[2], " {");
  366. }
  367. if (needLayer) {
  368. content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
  369. }
  370. content += cssWithMappingToString(item);
  371. if (needLayer) {
  372. content += "}";
  373. }
  374. if (item[2]) {
  375. content += "}";
  376. }
  377. if (item[4]) {
  378. content += "}";
  379. }
  380. return content;
  381. }).join("");
  382. };
  383.  
  384. // import a list of modules into the list
  385. list.i = function i(modules, media, dedupe, supports, layer) {
  386. if (typeof modules === "string") {
  387. modules = [[null, modules, undefined]];
  388. }
  389. var alreadyImportedModules = {};
  390. if (dedupe) {
  391. for (var k = 0; k < this.length; k++) {
  392. var id = this[k][0];
  393. if (id != null) {
  394. alreadyImportedModules[id] = true;
  395. }
  396. }
  397. }
  398. for (var _k = 0; _k < modules.length; _k++) {
  399. var item = [].concat(modules[_k]);
  400. if (dedupe && alreadyImportedModules[item[0]]) {
  401. continue;
  402. }
  403. if (typeof layer !== "undefined") {
  404. if (typeof item[5] === "undefined") {
  405. item[5] = layer;
  406. } else {
  407. item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
  408. item[5] = layer;
  409. }
  410. }
  411. if (media) {
  412. if (!item[2]) {
  413. item[2] = media;
  414. } else {
  415. item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
  416. item[2] = media;
  417. }
  418. }
  419. if (supports) {
  420. if (!item[4]) {
  421. item[4] = "".concat(supports);
  422. } else {
  423. item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
  424. item[4] = supports;
  425. }
  426. }
  427. list.push(item);
  428. }
  429. };
  430. return list;
  431. };
  432.  
  433. /***/ }),
  434.  
  435. /***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js":
  436. /***/ ((module) => {
  437.  
  438. "use strict";
  439.  
  440.  
  441. module.exports = function (i) {
  442. return i[1];
  443. };
  444.  
  445. /***/ }),
  446.  
  447. /***/ "./src/GUI/GUIStyle.css":
  448. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  449.  
  450. "use strict";
  451. __webpack_require__.r(__webpack_exports__);
  452. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  453. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  454. /* harmony export */ });
  455. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  456. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  457. /* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js");
  458. /* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
  459. /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js");
  460. /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
  461. /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
  462. /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
  463. /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js");
  464. /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
  465. /* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js");
  466. /* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
  467. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_GUIStyle_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/css-loader/dist/cjs.js!./src/GUI/GUIStyle.css");
  468.  
  469.  
  470. var options = {};
  471.  
  472. options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
  473. options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
  474. options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
  475. options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
  476. options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
  477.  
  478. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_GUIStyle_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A, options);
  479.  
  480.  
  481.  
  482.  
  483. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_GUIStyle_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A && _node_modules_css_loader_dist_cjs_js_GUIStyle_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.locals ? _node_modules_css_loader_dist_cjs_js_GUIStyle_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.locals : undefined);
  484.  
  485.  
  486. /***/ }),
  487.  
  488. /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
  489. /***/ ((module) => {
  490.  
  491. "use strict";
  492.  
  493.  
  494. var stylesInDOM = [];
  495. function getIndexByIdentifier(identifier) {
  496. var result = -1;
  497. for (var i = 0; i < stylesInDOM.length; i++) {
  498. if (stylesInDOM[i].identifier === identifier) {
  499. result = i;
  500. break;
  501. }
  502. }
  503. return result;
  504. }
  505. function modulesToDom(list, options) {
  506. var idCountMap = {};
  507. var identifiers = [];
  508. for (var i = 0; i < list.length; i++) {
  509. var item = list[i];
  510. var id = options.base ? item[0] + options.base : item[0];
  511. var count = idCountMap[id] || 0;
  512. var identifier = "".concat(id, " ").concat(count);
  513. idCountMap[id] = count + 1;
  514. var indexByIdentifier = getIndexByIdentifier(identifier);
  515. var obj = {
  516. css: item[1],
  517. media: item[2],
  518. sourceMap: item[3],
  519. supports: item[4],
  520. layer: item[5]
  521. };
  522. if (indexByIdentifier !== -1) {
  523. stylesInDOM[indexByIdentifier].references++;
  524. stylesInDOM[indexByIdentifier].updater(obj);
  525. } else {
  526. var updater = addElementStyle(obj, options);
  527. options.byIndex = i;
  528. stylesInDOM.splice(i, 0, {
  529. identifier: identifier,
  530. updater: updater,
  531. references: 1
  532. });
  533. }
  534. identifiers.push(identifier);
  535. }
  536. return identifiers;
  537. }
  538. function addElementStyle(obj, options) {
  539. var api = options.domAPI(options);
  540. api.update(obj);
  541. var updater = function updater(newObj) {
  542. if (newObj) {
  543. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
  544. return;
  545. }
  546. api.update(obj = newObj);
  547. } else {
  548. api.remove();
  549. }
  550. };
  551. return updater;
  552. }
  553. module.exports = function (list, options) {
  554. options = options || {};
  555. list = list || [];
  556. var lastIdentifiers = modulesToDom(list, options);
  557. return function update(newList) {
  558. newList = newList || [];
  559. for (var i = 0; i < lastIdentifiers.length; i++) {
  560. var identifier = lastIdentifiers[i];
  561. var index = getIndexByIdentifier(identifier);
  562. stylesInDOM[index].references--;
  563. }
  564. var newLastIdentifiers = modulesToDom(newList, options);
  565. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  566. var _identifier = lastIdentifiers[_i];
  567. var _index = getIndexByIdentifier(_identifier);
  568. if (stylesInDOM[_index].references === 0) {
  569. stylesInDOM[_index].updater();
  570. stylesInDOM.splice(_index, 1);
  571. }
  572. }
  573. lastIdentifiers = newLastIdentifiers;
  574. };
  575. };
  576.  
  577. /***/ }),
  578.  
  579. /***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js":
  580. /***/ ((module) => {
  581.  
  582. "use strict";
  583.  
  584.  
  585. var memo = {};
  586.  
  587. /* istanbul ignore next */
  588. function getTarget(target) {
  589. if (typeof memo[target] === "undefined") {
  590. var styleTarget = document.querySelector(target);
  591.  
  592. // Special case to return head of iframe instead of iframe itself
  593. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  594. try {
  595. // This will throw an exception if access to iframe is blocked
  596. // due to cross-origin restrictions
  597. styleTarget = styleTarget.contentDocument.head;
  598. } catch (e) {
  599. // istanbul ignore next
  600. styleTarget = null;
  601. }
  602. }
  603. memo[target] = styleTarget;
  604. }
  605. return memo[target];
  606. }
  607.  
  608. /* istanbul ignore next */
  609. function insertBySelector(insert, style) {
  610. var target = getTarget(insert);
  611. if (!target) {
  612. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  613. }
  614. target.appendChild(style);
  615. }
  616. module.exports = insertBySelector;
  617.  
  618. /***/ }),
  619.  
  620. /***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js":
  621. /***/ ((module) => {
  622.  
  623. "use strict";
  624.  
  625.  
  626. /* istanbul ignore next */
  627. function insertStyleElement(options) {
  628. var element = document.createElement("style");
  629. options.setAttributes(element, options.attributes);
  630. options.insert(element, options.options);
  631. return element;
  632. }
  633. module.exports = insertStyleElement;
  634.  
  635. /***/ }),
  636.  
  637. /***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":
  638. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  639.  
  640. "use strict";
  641.  
  642.  
  643. /* istanbul ignore next */
  644. function setAttributesWithoutAttributes(styleElement) {
  645. var nonce = true ? __webpack_require__.nc : 0;
  646. if (nonce) {
  647. styleElement.setAttribute("nonce", nonce);
  648. }
  649. }
  650. module.exports = setAttributesWithoutAttributes;
  651.  
  652. /***/ }),
  653.  
  654. /***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js":
  655. /***/ ((module) => {
  656.  
  657. "use strict";
  658.  
  659.  
  660. /* istanbul ignore next */
  661. function apply(styleElement, options, obj) {
  662. var css = "";
  663. if (obj.supports) {
  664. css += "@supports (".concat(obj.supports, ") {");
  665. }
  666. if (obj.media) {
  667. css += "@media ".concat(obj.media, " {");
  668. }
  669. var needLayer = typeof obj.layer !== "undefined";
  670. if (needLayer) {
  671. css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  672. }
  673. css += obj.css;
  674. if (needLayer) {
  675. css += "}";
  676. }
  677. if (obj.media) {
  678. css += "}";
  679. }
  680. if (obj.supports) {
  681. css += "}";
  682. }
  683. var sourceMap = obj.sourceMap;
  684. if (sourceMap && typeof btoa !== "undefined") {
  685. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  686. }
  687.  
  688. // For old IE
  689. /* istanbul ignore if */
  690. options.styleTagTransform(css, styleElement, options.options);
  691. }
  692. function removeStyleElement(styleElement) {
  693. // istanbul ignore if
  694. if (styleElement.parentNode === null) {
  695. return false;
  696. }
  697. styleElement.parentNode.removeChild(styleElement);
  698. }
  699.  
  700. /* istanbul ignore next */
  701. function domAPI(options) {
  702. if (typeof document === "undefined") {
  703. return {
  704. update: function update() {},
  705. remove: function remove() {}
  706. };
  707. }
  708. var styleElement = options.insertStyleElement(options);
  709. return {
  710. update: function update(obj) {
  711. apply(styleElement, options, obj);
  712. },
  713. remove: function remove() {
  714. removeStyleElement(styleElement);
  715. }
  716. };
  717. }
  718. module.exports = domAPI;
  719.  
  720. /***/ }),
  721.  
  722. /***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js":
  723. /***/ ((module) => {
  724.  
  725. "use strict";
  726.  
  727.  
  728. /* istanbul ignore next */
  729. function styleTagTransform(css, styleElement) {
  730. if (styleElement.styleSheet) {
  731. styleElement.styleSheet.cssText = css;
  732. } else {
  733. while (styleElement.firstChild) {
  734. styleElement.removeChild(styleElement.firstChild);
  735. }
  736. styleElement.appendChild(document.createTextNode(css));
  737. }
  738. }
  739. module.exports = styleTagTransform;
  740.  
  741. /***/ }),
  742.  
  743. /***/ "./src/GUI/GUICore.ts":
  744. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  745.  
  746. "use strict";
  747. __webpack_require__.r(__webpack_exports__);
  748. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  749. /* harmony export */ MainGUI: () => (/* binding */ MainGUI),
  750. /* harmony export */ Submenu: () => (/* binding */ Submenu),
  751. /* harmony export */ Tab: () => (/* binding */ Tab)
  752. /* harmony export */ });
  753. /* harmony import */ var _dragElement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/GUI/dragElement.ts");
  754.  
  755. class MainGUI {
  756. constructor() {
  757. this._tabs = new Map();
  758. this._createMainGUI();
  759. }
  760. createTab(name, tab_image) {
  761. if (this._tabs.has(name))
  762. return;
  763. const created_tab = new Tab(this, name, tab_image);
  764. this._tabs.set(name, created_tab);
  765. return created_tab;
  766. }
  767. switchTab(name) {
  768. const tab = this._tabs.get(name);
  769. this._tabs.forEach((tab) => {
  770. tab.hide();
  771. });
  772. tab.show();
  773. }
  774. getTab(name) {
  775. return this._tabs.get(name);
  776. }
  777. _createMainGUI() {
  778. // main gui elements
  779. let GUI_core = `
  780. <div id='sevenGUI' style="display: none;">
  781. <div id="sevenGUIheader">7PLACER</div>
  782. <div id="rainbowBar"></div>
  783. <div id="generalContainer">
  784. <div id="sideBarContainer">
  785. <div id="sideBarTabContainer"></div>
  786. </div>
  787. </div>
  788. </div>
  789. `;
  790. $("body").append(GUI_core);
  791. (0,_dragElement__WEBPACK_IMPORTED_MODULE_0__["default"])($("#sevenGUI")[0]);
  792. // menu toggle
  793. const toggle_gui_button = $('<a href="#" title="Seven Opener" class="grey margin-top-button"><img src="https://infonutricional.tomatelavida.com.co/wp-content/uploads/2023/06/postobon_informacion_nutriconallogo-7up.png" alt="icon"></a>');
  794. toggle_gui_button.css("border-color", "var(--gui-main-color)");
  795. $("#menu-buttons").append(toggle_gui_button);
  796. let toggle = false;
  797. toggle_gui_button.on("click", () => {
  798. if (toggle) {
  799. $('#sevenGUI').css("display", "none");
  800. toggle = false;
  801. }
  802. else {
  803. $('#sevenGUI').css({ "display": "flex", "top": "50%", "left": "50%", "transform": "translate(-50%, -50%)" });
  804. toggle = true;
  805. }
  806. });
  807. // settings tab
  808. const settings_tab = this.createTab('settings', 'https://upload.wikimedia.org/wikipedia/commons/d/dc/Settings-icon-symbol-vector.png');
  809. settings_tab.tab_button.appendTo('#sideBarContainer');
  810. }
  811. ;
  812. static get instance() {
  813. if (!this._instance) {
  814. this._instance = new MainGUI;
  815. }
  816. return this._instance;
  817. }
  818. }
  819. ;
  820. class Tab {
  821. constructor(main_gui, name, tab_image) {
  822. this._submenus = new Map();
  823. this._main_gui = main_gui;
  824. this._createTab(name, tab_image);
  825. }
  826. ;
  827. createSubmenu(name) {
  828. if (this._submenus.has(name))
  829. return;
  830. const created_submenu = new Submenu(this, name);
  831. this._submenus.set(name, created_submenu);
  832. return created_submenu;
  833. }
  834. getSubmenu(name) {
  835. return this._submenus.get(name);
  836. }
  837. show() {
  838. this._tab_button.addClass("selected");
  839. this._submenu_container.css("display", "flex");
  840. }
  841. hide() {
  842. this._tab_button.removeClass("selected");
  843. this._submenu_container.css("display", "none");
  844. }
  845. _createTab(name, tab_image) {
  846. this._tab_button = $(`<div class="sideBarTab" id="tabButton_${name}"><img src="${tab_image}" class="sideBarTab" draggable="false"></div>`);
  847. this._tab_button.on("click", () => {
  848. this._main_gui.switchTab(name);
  849. });
  850. $("#sideBarTabContainer").append(this._tab_button);
  851. this._submenu_container = $(`<div class="GUITabContainer" id="tab_${name}">`).css("display", "none");
  852. $("#generalContainer").append(this._submenu_container);
  853. }
  854. ;
  855. get submenu_container() {
  856. return this._submenu_container;
  857. }
  858. get tab_button() {
  859. return this._tab_button;
  860. }
  861. }
  862. class Submenu {
  863. constructor(parent_tab, name) {
  864. this._parent_tab = parent_tab;
  865. this._createSubmenu(name);
  866. }
  867. createToggle(name, default_state, callback) {
  868. const container = $(`<div class="toggleContainer" id="toggle_${name}"></div>`);
  869. container.append('<div class="toggleSquare"></div>');
  870. container.append(`<p class="toggleName">${name}</p>`);
  871. this._submenu_inside.append(container);
  872. if (default_state) {
  873. container.addClass("toggled");
  874. }
  875. let state = default_state;
  876. container.on("click", () => {
  877. if (state) {
  878. state = false;
  879. container.removeClass("toggled");
  880. }
  881. else {
  882. state = true;
  883. container.addClass("toggled");
  884. }
  885. callback(state);
  886. });
  887. return container;
  888. }
  889. createButton(name, callback) {
  890. const button = $(`<div class="button" id="button_${name}">${name}</div>`);
  891. this._submenu_inside.append(button);
  892. button.on("click", () => {
  893. callback();
  894. });
  895. return button;
  896. }
  897. createDrop(label, onFile) {
  898. const drop_container = $(`<div class="dropImage">${label}</div>`);
  899. drop_container.on("dragover", function (event) {
  900. event.preventDefault();
  901. });
  902. drop_container.on("drop", function (event) {
  903. event.preventDefault();
  904. const file = event.originalEvent.dataTransfer.files[0];
  905. if (file.type.startsWith("image/")) {
  906. const reader = new FileReader();
  907. reader.onload = function (e) {
  908. drop_container.html(`<img src="${e.target.result}" style="max-width: 100%; max-height: 100%;">`);
  909. };
  910. reader.readAsDataURL(file);
  911. onFile(file);
  912. }
  913. });
  914. this._submenu_inside.append(drop_container);
  915. return drop_container;
  916. }
  917. createInput(placeholder, type, onType) {
  918. const input = $(`<input class="input" type="${type}" placeholder="${placeholder}">`);
  919. input.on("input", () => {
  920. onType(input.val());
  921. });
  922. this._submenu_inside.append($(`<div class="inputContainer"></div>`).append(input));
  923. return input;
  924. }
  925. createText(text) {
  926. const container = $(`<div class="textContainer">`);
  927. const text_elem = container.append(`<p>${text}</p>`);
  928. this._submenu_inside.append(container);
  929. return text_elem;
  930. }
  931. createSelect(default_value, options, onChange) {
  932. const selector = $(`<select id="selector_${default_value}"></select>`);
  933. selector.append(`<option value="">${default_value}</option>`);
  934. for (const option of options) {
  935. selector.append(`<option value="${option.value}">${option.label}</option>`);
  936. }
  937. selector.on("change", () => {
  938. const value = selector.val();
  939. if (value == "")
  940. return;
  941. onChange(value);
  942. });
  943. this._submenu_inside.append(selector);
  944. return selector;
  945. }
  946. createColor(label, default_color, onChange) {
  947. const color_selector = $(`<input type="color" value="${default_color}" />`);
  948. const container = $(`<div class="colorPicker"><div>${label}</div></div>`).append(color_selector);
  949. color_selector.on("input", () => {
  950. onChange(color_selector.val());
  951. });
  952. this._submenu_inside.append(container);
  953. return color_selector;
  954. }
  955. _createSubmenu(name) {
  956. this._submenu_element = $(`<div class="GUISubmenu" id="submenu_${name}">`);
  957. this._submenu_element.append(`<p class="submenuTitle">${name}</p>`);
  958. this._submenu_inside = $('<div class="submenuInside">');
  959. this._submenu_element.append(this._submenu_inside);
  960. this._parent_tab.submenu_container.append(this._submenu_element);
  961. }
  962. }
  963.  
  964.  
  965. /***/ }),
  966.  
  967. /***/ "./src/GUI/TAB_Botting.ts":
  968. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  969.  
  970. "use strict";
  971. __webpack_require__.r(__webpack_exports__);
  972. /* harmony import */ var _modules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/modules/index.ts");
  973. /* harmony import */ var _modules_defaultModules_Queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/modules/defaultModules/Queue.ts");
  974. /* harmony import */ var _modules_util_getClientMouse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/modules/util/getClientMouse.ts");
  975. /* harmony import */ var _GUICore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/GUI/GUICore.ts");
  976.  
  977.  
  978.  
  979.  
  980. $(function () {
  981. const GUI = _GUICore__WEBPACK_IMPORTED_MODULE_2__.MainGUI.instance;
  982. const TAB = GUI.createTab("Botting", "https://pngimg.com/d/android_logo_PNG5.png");
  983. GUI.switchTab("Botting");
  984. const image_submenu = TAB.createSubmenu("Images");
  985. let current_image;
  986. let current_image_x;
  987. let current_image_y;
  988. image_submenu.createDrop("Drop Image", dropped_image => {
  989. current_image = dropped_image;
  990. });
  991. image_submenu.createInput("X", "number", x_coord => {
  992. current_image_x = parseInt(x_coord);
  993. });
  994. image_submenu.createInput("Y", "number", y_coord => {
  995. current_image_y = parseInt(y_coord);
  996. });
  997. const dithering_options = [
  998. { label: "None", value: "None" },
  999. { label: "FloydSteinberg", value: "FloydSteinberg" },
  1000. { label: "FalseFloydSteinberg", value: "FalseFloydSteinberg" },
  1001. { label: "Stucki", value: "Stucki" },
  1002. { label: "Atkinson", value: "Atkinson" },
  1003. { label: "Jarvis", value: "Jarvis" },
  1004. { label: "Burkes", value: "Burkes" },
  1005. { label: "Sierra", value: "Sierra" },
  1006. { label: "TwoSierra", value: "TwoSierra" },
  1007. { label: "SierraLite", value: "SierraLite" },
  1008. ];
  1009. image_submenu.createSelect("-- select dithering --", dithering_options, (value) => {
  1010. if (value == "None") {
  1011. window.seven.dither = null;
  1012. return;
  1013. }
  1014. window.seven.dither = value;
  1015. });
  1016. image_submenu.createButton("Start", () => {
  1017. (0,_modules__WEBPACK_IMPORTED_MODULE_0__.botImage)(current_image_x, current_image_y, current_image);
  1018. });
  1019. image_submenu.createButton("Stop", () => {
  1020. _modules_defaultModules_Queue__WEBPACK_IMPORTED_MODULE_1__["default"].stop();
  1021. });
  1022. const protecting_submenu = TAB.createSubmenu("Protecting");
  1023. protecting_submenu.createToggle("Protect", false, (state) => {
  1024. window.seven.protect = state;
  1025. });
  1026. protecting_submenu.createToggle("Agressive protection", false, (state) => {
  1027. window.seven.agressive_protection = state;
  1028. });
  1029. const square_submenu = TAB.createSubmenu("Squares");
  1030. let square_x1;
  1031. let square_y1;
  1032. let square_x2;
  1033. let square_y2;
  1034. square_submenu.createText("Select color as usual");
  1035. square_submenu.createInput('X1', "number", text => {
  1036. square_x1 = parseInt(text);
  1037. });
  1038. square_submenu.createInput('Y1', "number", text => {
  1039. square_y1 = parseInt(text);
  1040. });
  1041. square_submenu.createInput('X2', "number", text => {
  1042. square_x2 = parseInt(text);
  1043. });
  1044. square_submenu.createInput('Y2', "number", text => {
  1045. square_y2 = parseInt(text);
  1046. });
  1047. square_submenu.createButton("Start", () => {
  1048. (0,_modules__WEBPACK_IMPORTED_MODULE_0__.BotSquare)(square_x1, square_y1, square_x2, square_y2, (0,_modules_util_getClientMouse__WEBPACK_IMPORTED_MODULE_3__["default"])()[2]);
  1049. });
  1050. square_submenu.createButton("Stop", () => {
  1051. _modules_defaultModules_Queue__WEBPACK_IMPORTED_MODULE_1__["default"].stop();
  1052. });
  1053. });
  1054.  
  1055.  
  1056. /***/ }),
  1057.  
  1058. /***/ "./src/GUI/TAB_Settings.ts":
  1059. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1060.  
  1061. "use strict";
  1062. __webpack_require__.r(__webpack_exports__);
  1063. /* harmony import */ var _GUICore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/GUI/GUICore.ts");
  1064. /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./package.json");
  1065.  
  1066.  
  1067. $(function () {
  1068. const gui = _GUICore__WEBPACK_IMPORTED_MODULE_1__.MainGUI.instance;
  1069. const tab = gui.getTab("settings");
  1070. const bot_settings = tab.createSubmenu("bot settings");
  1071. bot_settings.createText("pixel speed default is 21");
  1072. const pixelspeed_input = bot_settings.createInput(`pixel speed`, "number", (number) => {
  1073. number = parseInt(number);
  1074. if (number < 16.5)
  1075. number = 16.5;
  1076. window.seven.pixelspeed = number;
  1077. });
  1078. const sort_options = [
  1079. { label: "none", value: "none" },
  1080. { label: "random", value: "rand" },
  1081. { label: "colors", value: "colors" },
  1082. { label: "vertical", value: "vertical" },
  1083. { label: "horizontal", value: "horizontal" },
  1084. { label: "circle", value: "circle" },
  1085. ];
  1086. bot_settings.createSelect('-- select sorting --', sort_options, value => {
  1087. window.seven.order = value;
  1088. });
  1089. bot_settings.createText('Only works in canvas your admin');
  1090. const pixel_type_options = [
  1091. { label: "default", value: "default" },
  1092. { label: "protect", value: "protect" },
  1093. { label: "sea protect", value: "seaprotect" },
  1094. { label: "unprotect", value: "unprotect" },
  1095. ];
  1096. bot_settings.createSelect('-- select tool --', pixel_type_options, value => {
  1097. window.seven.pixel_type = value;
  1098. });
  1099. bot_settings.createColor("GUI Color Picker", "", color => {
  1100. $(":root").css("--gui-main-color", color);
  1101. });
  1102. tab.createSubmenu("version").createText("7Placer version " + _package_json__WEBPACK_IMPORTED_MODULE_0__/* .version */ .rE);
  1103. });
  1104.  
  1105.  
  1106. /***/ }),
  1107.  
  1108. /***/ "./src/GUI/dragElement.ts":
  1109. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1110.  
  1111. "use strict";
  1112. __webpack_require__.r(__webpack_exports__);
  1113. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1114. /* harmony export */ "default": () => (/* binding */ dragElement)
  1115. /* harmony export */ });
  1116. // W3SCHOOLS
  1117. function dragElement(elmnt) {
  1118. var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
  1119. if (document.getElementById(elmnt.id + "header")) {
  1120. // if present, the header is where you move the DIV from:
  1121. document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
  1122. }
  1123. else {
  1124. // otherwise, move the DIV from anywhere inside the DIV:
  1125. elmnt.onmousedown = dragMouseDown;
  1126. }
  1127. function dragMouseDown(e) {
  1128. e.preventDefault();
  1129. // get the mouse cursor position at startup:
  1130. pos3 = e.clientX;
  1131. pos4 = e.clientY;
  1132. document.onmouseup = closeDragElement;
  1133. // call a function whenever the cursor moves:
  1134. document.onmousemove = elementDrag;
  1135. }
  1136. function elementDrag(e) {
  1137. e.preventDefault();
  1138. // calculate the new cursor position:
  1139. pos1 = pos3 - e.clientX;
  1140. pos2 = pos4 - e.clientY;
  1141. pos3 = e.clientX;
  1142. pos4 = e.clientY;
  1143. // set the element's new position:
  1144. elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
  1145. elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
  1146. }
  1147. function closeDragElement() {
  1148. // stop moving when mouse button is released:
  1149. document.onmouseup = null;
  1150. document.onmousemove = null;
  1151. }
  1152. }
  1153.  
  1154.  
  1155. /***/ }),
  1156.  
  1157. /***/ "./src/GUI/drop.ts":
  1158. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1159.  
  1160. "use strict";
  1161. __webpack_require__.r(__webpack_exports__);
  1162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1163. /* harmony export */ createDropArea: () => (/* binding */ createDropArea)
  1164. /* harmony export */ });
  1165. /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/GUI/style.ts");
  1166. /* harmony import */ var _modules_defaultModules_ImageTools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/modules/defaultModules/ImageTools.ts");
  1167. /* harmony import */ var _modules_util_getClientMouse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/modules/util/getClientMouse.ts");
  1168.  
  1169.  
  1170.  
  1171. function createDropArea() {
  1172. const dropobject = $('<div>').text('Drop Image').css(_style__WEBPACK_IMPORTED_MODULE_0__.drop);
  1173. const [x, y] = (0,_modules_util_getClientMouse__WEBPACK_IMPORTED_MODULE_2__["default"])();
  1174. $('body').append(dropobject);
  1175. dropobject.on("click", function () {
  1176. dropobject.remove();
  1177. });
  1178. dropobject.on("drop", async function (event) {
  1179. event.preventDefault();
  1180. event.stopPropagation();
  1181. const image = event.originalEvent.dataTransfer.files[0];
  1182. dropobject.remove();
  1183. await (0,_modules_defaultModules_ImageTools__WEBPACK_IMPORTED_MODULE_1__.botImage)(x, y, image);
  1184. // console.log(image)
  1185. }).on('dragover', false);
  1186. }
  1187.  
  1188.  
  1189. /***/ }),
  1190.  
  1191. /***/ "./src/GUI/style.ts":
  1192. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1193.  
  1194. "use strict";
  1195. __webpack_require__.r(__webpack_exports__);
  1196. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1197. /* harmony export */ canvascss: () => (/* binding */ canvascss),
  1198. /* harmony export */ drop: () => (/* binding */ drop),
  1199. /* harmony export */ trackercss: () => (/* binding */ trackercss)
  1200. /* harmony export */ });
  1201. const trackercss = {
  1202. top: '0px',
  1203. left: '0px',
  1204. borderColor: 'rgb(138,43,226)',
  1205. color: 'rgb(138,43,226)',
  1206. backgroundColor: 'black',
  1207. opacity: '60%',
  1208. display: 'none',
  1209. transition: 'all 0.06s ease-in-out',
  1210. pointerEvents: 'none'
  1211. };
  1212. // design by 0vc4
  1213. const drop = {
  1214. width: 'calc(100% - 2em)',
  1215. height: 'calc(100% - 2em)',
  1216. position: 'fixed',
  1217. left: '0px',
  1218. top: '0px',
  1219. backgroundColor: 'rgba(0, 0, 0, 0.533)',
  1220. zIndex: '9999-',
  1221. display: 'flex',
  1222. color: 'white',
  1223. fontSize: '48pt',
  1224. justifyContent: 'center',
  1225. alignItems: 'center',
  1226. border: '3px white dashed',
  1227. borderRadius: '18px',
  1228. margin: '1em',
  1229. };
  1230. const canvascss = {
  1231. position: 'absolute',
  1232. pointerEvents: 'none',
  1233. left: '0px',
  1234. top: '0px',
  1235. imageRendering: 'pixelated',
  1236. opacity: '50%',
  1237. animation: 'blink 3s ease-out infinite'
  1238. };
  1239. const blink = document.createElement("style");
  1240. blink.type = "text/css";
  1241. blink.innerText = `
  1242. @keyframes blink {
  1243. 0% { opacity: .30; }
  1244. 50% { opacity: .10; }
  1245. 100% { opacity: .30; }
  1246. }`;
  1247. document.head.appendChild(blink);
  1248.  
  1249.  
  1250. /***/ }),
  1251.  
  1252. /***/ "./src/auth/Auth.ts":
  1253. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1254.  
  1255. "use strict";
  1256. __webpack_require__.r(__webpack_exports__);
  1257. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1258. /* harmony export */ "default": () => (/* binding */ Auth)
  1259. /* harmony export */ });
  1260. class Auth {
  1261. constructor(authObj) {
  1262. this.authKey = authObj.authKey;
  1263. this.authId = authObj.authId;
  1264. this.authToken = authObj.authToken;
  1265. }
  1266. }
  1267.  
  1268.  
  1269. /***/ }),
  1270.  
  1271. /***/ "./src/auth/util/commands.ts":
  1272. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1273.  
  1274. "use strict";
  1275. __webpack_require__.r(__webpack_exports__);
  1276. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1277. /* harmony export */ deleteAccount: () => (/* binding */ deleteAccount),
  1278. /* harmony export */ public_commands: () => (/* binding */ public_commands)
  1279. /* harmony export */ });
  1280. /* harmony import */ var _Auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/auth/Auth.ts");
  1281. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/variables.ts");
  1282. /* harmony import */ var _requests_get_painting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/requests/get-painting.ts");
  1283. /* harmony import */ var _bot_util_websocket__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/bot/util/websocket.ts");
  1284.  
  1285.  
  1286.  
  1287.  
  1288. var LocalAccounts = new Map();
  1289. const public_commands = {
  1290. saveAuth,
  1291. getAuth,
  1292. saveAccount,
  1293. getAccounts,
  1294. deleteAccount,
  1295. connect,
  1296. connectAll,
  1297. disconnect,
  1298. disconnectAll,
  1299. };
  1300. // save changes in localstorage
  1301. function storagePush() {
  1302. const obj = Object.fromEntries(LocalAccounts);
  1303. localStorage.setItem('LocalAccounts', JSON.stringify(obj));
  1304. }
  1305. // restore localstorage to localaccounts
  1306. function storageGet() {
  1307. const storedAccounts = localStorage.getItem('LocalAccounts');
  1308. if (storedAccounts) {
  1309. const parsedAccounts = JSON.parse(storedAccounts);
  1310. LocalAccounts = new Map(Object.entries(parsedAccounts));
  1311. }
  1312. else
  1313. LocalAccounts = new Map();
  1314. }
  1315. async function delay(ms) {
  1316. return new Promise(resolve => setTimeout(resolve, ms));
  1317. }
  1318. // saves from params
  1319. function saveAuth(username, authId, authKey, authToken, print = true) {
  1320. if (!authId || !authKey || !authToken) {
  1321. console.log('[7p] saveAuth usage: saveAuth(username, authId, authKey, authToken)');
  1322. return;
  1323. }
  1324. const account = { authId, authKey, authToken };
  1325. LocalAccounts.set(username, account);
  1326. storagePush();
  1327. if (print)
  1328. console.log('Auth saved. Saved list: ', LocalAccounts);
  1329. }
  1330. // returns client's auth
  1331. async function getAuth(print = true) {
  1332. const cookieStore = window.cookieStore;
  1333. const authToken = await cookieStore.get("authToken");
  1334. const authKey = await cookieStore.get("authKey");
  1335. const authId = await cookieStore.get("authId");
  1336. if (authToken == null || authKey == null || authId == null) {
  1337. console.log('[7p] Please login first!');
  1338. return;
  1339. }
  1340. if (print)
  1341. console.log(`authId = "${authId.value}", authKey = "${authKey.value}", authToken = "${authToken.value}"`);
  1342. return { authToken: authToken.value, authKey: authKey.value, authId: authId.value };
  1343. }
  1344. // saves auth from client cookies
  1345. async function saveAccount() {
  1346. storageGet();
  1347. const AuthObj = await getAuth(false);
  1348. const userinfo = await (0,_requests_get_painting__WEBPACK_IMPORTED_MODULE_1__["default"])(AuthObj.authId, AuthObj.authKey, AuthObj.authToken);
  1349. saveAuth(userinfo.user.name, AuthObj.authId, AuthObj.authKey, AuthObj.authToken, false);
  1350. console.log('Auth saved. Saved list: ', LocalAccounts);
  1351. }
  1352. // logs saved auths
  1353. function getAccounts() {
  1354. storageGet();
  1355. if (!LocalAccounts || LocalAccounts.size == 0) {
  1356. console.log('No accounts found');
  1357. return;
  1358. }
  1359. console.log(`Found ${LocalAccounts.size} accounts`);
  1360. console.log(LocalAccounts);
  1361. }
  1362. // deletes auths
  1363. function deleteAccount(identifier) {
  1364. if (identifier == null) {
  1365. console.log('deleteAccount usage: deleteAccount(user or index)');
  1366. return;
  1367. }
  1368. storageGet();
  1369. if (typeof identifier == 'string') {
  1370. if (identifier == 'all') {
  1371. LocalAccounts.forEach((value, key) => {
  1372. LocalAccounts.delete(key);
  1373. });
  1374. return;
  1375. }
  1376. if (!LocalAccounts.has(identifier)) {
  1377. console.log(`[7p] Error deleting: No account with name ${identifier}`);
  1378. return;
  1379. }
  1380. LocalAccounts.delete(identifier);
  1381. console.log(`[7p] Deleted account ${identifier}.`);
  1382. console.log(LocalAccounts);
  1383. }
  1384. if (typeof identifier == 'number') {
  1385. const keys = Array.from(LocalAccounts.keys());
  1386. if (identifier > keys.length) {
  1387. console.log(`[7p] Error deleting: No account with index ${identifier}`);
  1388. return;
  1389. }
  1390. LocalAccounts.delete(keys[identifier]);
  1391. console.log(`Deleted account ${identifier}`);
  1392. console.log(LocalAccounts);
  1393. }
  1394. storagePush();
  1395. }
  1396. async function connect(username) {
  1397. storageGet();
  1398. const account = LocalAccounts.get(username);
  1399. const seven = window.seven;
  1400. if (!username) {
  1401. console.log('[7p] Missing bot username, connect("username")');
  1402. return;
  1403. }
  1404. if (!account) {
  1405. console.log(`[7p] No account found with username ${username}`);
  1406. return;
  1407. }
  1408. if (seven.bots.has(username)) {
  1409. console.log(`[7p] Account ${username} is already connected.`);
  1410. return;
  1411. }
  1412. const auth = new _Auth__WEBPACK_IMPORTED_MODULE_3__["default"](account);
  1413. (0,_bot_util_websocket__WEBPACK_IMPORTED_MODULE_2__.createBot)(auth, username);
  1414. }
  1415. async function connectAll() {
  1416. storageGet();
  1417. const seven = window.seven;
  1418. for (const [username, account] of LocalAccounts) {
  1419. if (seven.bots.has(username)) {
  1420. console.log(`[7p] Account ${username} is already connected.`);
  1421. continue;
  1422. }
  1423. const auth = new _Auth__WEBPACK_IMPORTED_MODULE_3__["default"](account);
  1424. (0,_bot_util_websocket__WEBPACK_IMPORTED_MODULE_2__.createBot)(auth, username);
  1425. await delay(500);
  1426. }
  1427. }
  1428. function disconnect(username) {
  1429. const seven = window.seven;
  1430. const bot = seven.bots.get(username);
  1431. if (!username) {
  1432. console.log('[7p] disconnect requires a username, disconnect("username")');
  1433. return;
  1434. }
  1435. if (!bot) {
  1436. console.log(`[7p] No bot connected with username ${username}`);
  1437. return;
  1438. }
  1439. ;
  1440. bot.kill();
  1441. }
  1442. function disconnectAll() {
  1443. const seven = window.seven;
  1444. if (seven.bots.size == 5) {
  1445. console.log('[7p] No bots connected.');
  1446. return;
  1447. }
  1448. ;
  1449. seven.bots.forEach((bot, name) => {
  1450. if (name == "Client") {
  1451. return;
  1452. }
  1453. ;
  1454. bot.kill();
  1455. });
  1456. }
  1457.  
  1458.  
  1459. /***/ }),
  1460.  
  1461. /***/ "./src/bot/Bot.ts":
  1462. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1463.  
  1464. "use strict";
  1465. __webpack_require__.r(__webpack_exports__);
  1466. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1467. /* harmony export */ Bot: () => (/* binding */ Bot),
  1468. /* harmony export */ Client: () => (/* binding */ Client),
  1469. /* harmony export */ WSBot: () => (/* binding */ WSBot)
  1470. /* harmony export */ });
  1471. /* harmony import */ var _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/canvas/Canvas.ts");
  1472. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/variables.ts");
  1473. /* harmony import */ var _GUI_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/GUI/style.ts");
  1474. /* harmony import */ var _requests_get_painting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/requests/get-painting.ts");
  1475. /* harmony import */ var _util_MessageHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./src/bot/util/MessageHandler.ts");
  1476. /* harmony import */ var _modules_defaultModules_Protect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./src/modules/defaultModules/Protect.ts");
  1477. /* harmony import */ var _auth_util_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./src/auth/util/commands.ts");
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486. class Bot {
  1487. constructor(websocket) {
  1488. this.trackeriters = 0;
  1489. this.lastplace = performance.now();
  1490. this._ws = websocket;
  1491. this.handler = new _util_MessageHandler__WEBPACK_IMPORTED_MODULE_6__.MessageHandler(this, this.ws);
  1492. }
  1493. ;
  1494. emit(event, params) {
  1495. this.ws.send(`42["${event}",${params}]`);
  1496. }
  1497. ;
  1498. kill() {
  1499. const seven = window.seven;
  1500. seven.bots.delete(this.username);
  1501. if (this._ws.readyState == 1) {
  1502. this._ws.close();
  1503. }
  1504. ;
  1505. }
  1506. ;
  1507. async placePixel(pixel, client = false, tracker = true) {
  1508. const canvas = _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance;
  1509. const canvascolor = canvas.getColor(pixel.x, pixel.y);
  1510. const seven = window.seven;
  1511. if (canvascolor == pixel.color || canvascolor == 200) {
  1512. return true;
  1513. }
  1514. ;
  1515. while (performance.now() - this.lastplace < seven.pixelspeed) {
  1516. await new Promise(resolve => setTimeout(resolve, 0));
  1517. }
  1518. ;
  1519. console.log(performance.now() - this.lastplace);
  1520. const pixel_param = this.determinePixelType(pixel);
  1521. this.emit('p', pixel_param);
  1522. this.lastplace = performance.now();
  1523. if (tracker && this.trackeriters >= 6) {
  1524. $(this.tracker).css({ top: pixel.y, left: pixel.x, display: 'block' });
  1525. this.trackeriters = 0;
  1526. }
  1527. ;
  1528. this.trackeriters += 1;
  1529. return true;
  1530. }
  1531. ;
  1532. determinePixelType(pixel, type) {
  1533. const types = {
  1534. default: `[${pixel.x},${pixel.y},${pixel.color},1]`,
  1535. protect: `[${pixel.x},${pixel.y},${pixel.color},1,1]`,
  1536. seaprotect: `[${pixel.x},${pixel.y},-100,1,1]`,
  1537. unprotect: `[${pixel.x},${pixel.y},${pixel.color},1,2]`,
  1538. };
  1539. if (!type)
  1540. type = window.seven.pixel_type;
  1541. if (!(type in types)) {
  1542. throw new Error(type + " is not a valid pixel type.");
  1543. }
  1544. return types[type];
  1545. }
  1546. ;
  1547. static async findAvailableBot() {
  1548. const seven = window.seven;
  1549. const bots = seven.bots;
  1550. var tick = 0;
  1551. while (true) {
  1552. for (const [_, bot] of bots) {
  1553. if (Date.now() - bot.lastplace >= seven.pixelspeed) {
  1554. // console.log(`[7p] found available bot: ${bot.username}, ${ Date.now() - bot.lastplace }`);
  1555. return bot;
  1556. }
  1557. ;
  1558. }
  1559. ;
  1560. tick += 1;
  1561. if (tick == seven.tickspeed) {
  1562. tick = 0;
  1563. await new Promise(resolve => setTimeout(resolve, 0));
  1564. }
  1565. ;
  1566. }
  1567. ;
  1568. }
  1569. createTracker() {
  1570. const tracker = $('<div class="track" id="bottracker">').text(`[7P] ${this.username}`).css(_GUI_style__WEBPACK_IMPORTED_MODULE_2__.trackercss);
  1571. $('#canvas').ready(function () {
  1572. // console.log(`[7p] created tracker: ${name}`)
  1573. $('#painting-move').append(tracker);
  1574. });
  1575. return tracker;
  1576. }
  1577. ;
  1578. get ws() {
  1579. return this._ws;
  1580. }
  1581. ;
  1582. }
  1583. class WSBot extends Bot {
  1584. constructor(auth, username, websocket) {
  1585. super(websocket);
  1586. this._auth = auth;
  1587. this.username = username;
  1588. this.startBot();
  1589. }
  1590. async startBot() {
  1591. this.generalinfo = await (0,_requests_get_painting__WEBPACK_IMPORTED_MODULE_3__["default"])(this.auth.authId, this.auth.authKey, this.auth.authToken);
  1592. this.tracker = this.createTracker();
  1593. this.internalListeners();
  1594. }
  1595. get auth() {
  1596. return this._auth;
  1597. }
  1598. ;
  1599. internalListeners() {
  1600. this.handler.on('server_time', (data) => {
  1601. this.paliveServerTime = data[1]; // stores servertime for palive
  1602. });
  1603. // this.handler.on('ping.alive', () => {
  1604. // const hash = getPalive(this.paliveServerTime, this.botid);
  1605. // console.log('[7p]', this.username, ': pong =', hash, this.botid)
  1606. // this.emit('pong.alive', `"${hash}"`);
  1607. // })
  1608. this.handler.on('throw.error', (data) => {
  1609. if (data[1] == 49) {
  1610. console.log(`[7p] [Bot ${this.username}] Error (${data[1]}): This auth is not valid! Deleting account from saved accounts...`);
  1611. (0,_auth_util_commands__WEBPACK_IMPORTED_MODULE_5__.deleteAccount)(this.username);
  1612. this.kill();
  1613. return;
  1614. }
  1615. else if (data[1] == 16) {
  1616. this.kill();
  1617. }
  1618. ;
  1619. console.log(`[7p] [Bot ${this.username}] Pixelplace WS error: ${data[1]}`);
  1620. });
  1621. this.handler.on('canvas', () => {
  1622. const seven = window.seven;
  1623. console.log(`[7p] Succesfully connected to bot ${this.username}`);
  1624. seven.bots.set(this.username, this);
  1625. });
  1626. this.handler.on(2, () => {
  1627. this.ws.send('3');
  1628. });
  1629. this.handler.on('start', () => {
  1630. this.ws.send('40');
  1631. });
  1632. this.handler.on('init', () => {
  1633. this.emit('init', `{"authKey":"${this.auth.authKey}","authToken":"${this.auth.authToken}","authId":"${this.auth.authId}","boardId":${_canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance.ID}}`);
  1634. });
  1635. }
  1636. }
  1637. class Client extends Bot {
  1638. constructor(websocket) {
  1639. super(websocket);
  1640. Client.instance = this;
  1641. this.start();
  1642. }
  1643. ;
  1644. static get Client() {
  1645. return Client.instance;
  1646. }
  1647. ;
  1648. start() {
  1649. const seven = window.seven;
  1650. this.username = 'Client';
  1651. this.tracker = this.createTracker();
  1652. this.internalListeners();
  1653. seven.bots.set(this.username, this);
  1654. }
  1655. ;
  1656. internalListeners() {
  1657. // Bot canvas array updater
  1658. this.handler.on('p', (data) => {
  1659. for (const pixel of data[1]) {
  1660. const canvas = _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance;
  1661. const x = pixel[0];
  1662. const y = pixel[1];
  1663. const color = pixel[2];
  1664. const id = pixel[4];
  1665. canvas.updatePixel(x, y, color);
  1666. _modules_defaultModules_Protect__WEBPACK_IMPORTED_MODULE_4__["default"].checkPixel(x, y, color);
  1667. }
  1668. });
  1669. // Rewrites some pixels after loading (I think because of cache lag)
  1670. this.handler.on("canvas", (data) => {
  1671. for (const pixel of data[1]) {
  1672. const canvas = _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance;
  1673. const x = pixel[0];
  1674. const y = pixel[1];
  1675. const color = pixel[2];
  1676. canvas.updatePixel(x, y, color);
  1677. }
  1678. ;
  1679. });
  1680. }
  1681. ;
  1682. }
  1683. ;
  1684.  
  1685.  
  1686. /***/ }),
  1687.  
  1688. /***/ "./src/bot/util/MessageHandler.ts":
  1689. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1690.  
  1691. "use strict";
  1692. __webpack_require__.r(__webpack_exports__);
  1693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1694. /* harmony export */ MessageHandler: () => (/* binding */ MessageHandler)
  1695. /* harmony export */ });
  1696. class MessageHandler {
  1697. constructor(bot, websocket) {
  1698. this._listeners = new Map();
  1699. this._bot = bot;
  1700. this._websocket = websocket;
  1701. this._startHandler();
  1702. }
  1703. ;
  1704. on(message_type, callback) {
  1705. if (!this._listeners.has(message_type))
  1706. this._listeners.set(message_type, []);
  1707. this._listeners.get(message_type).push(callback);
  1708. }
  1709. ;
  1710. cancel(func) {
  1711. this._listeners.forEach((value) => {
  1712. value.filter((listener) => {
  1713. listener != func;
  1714. });
  1715. });
  1716. }
  1717. ;
  1718. _startHandler() {
  1719. this._websocket.addEventListener('message', event => this._handleMessage(event));
  1720. }
  1721. _handleMessage(message) {
  1722. message = message.data;
  1723. if (message.startsWith('42')) {
  1724. message = JSON.parse(message.slice(2));
  1725. const message_type = message[0];
  1726. this._fire(message_type, message);
  1727. return;
  1728. }
  1729. if (message.startsWith('0')) {
  1730. this._fire('start');
  1731. return;
  1732. }
  1733. if (message.startsWith('40')) {
  1734. this._fire('init');
  1735. }
  1736. this._fire(message);
  1737. }
  1738. ;
  1739. _fire(message_type, data) {
  1740. if (!this._listeners.has(message_type))
  1741. return;
  1742. this._listeners.get(message_type).forEach((listener) => {
  1743. listener(data);
  1744. });
  1745. }
  1746. ;
  1747. }
  1748. ;
  1749.  
  1750.  
  1751. /***/ }),
  1752.  
  1753. /***/ "./src/bot/util/palive.ts":
  1754. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1755.  
  1756. "use strict";
  1757. __webpack_require__.r(__webpack_exports__);
  1758. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1759. /* harmony export */ "default": () => (/* binding */ getPalive),
  1760. /* harmony export */ getTDelay: () => (/* binding */ getTDelay)
  1761. /* harmony export */ });
  1762. // credits to symmetry
  1763. function randomString(charList, num) {
  1764. return Array.from({ length: num }, () => charList.charAt(Math.floor(Math.random() * charList.length))).join('');
  1765. }
  1766. function randomString1(num) {
  1767. const charList = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  1768. return randomString(charList, num);
  1769. }
  1770. function randomString2(num) {
  1771. const charList = 'gmbonjklezcfxta1234567890GMBONJKLEZCFXTA';
  1772. return randomString(charList, num);
  1773. }
  1774. function randInt(min, max) {
  1775. return Math.floor(Math.random() * (max - min + 1)) + min;
  1776. }
  1777. const paliveCharmap = {
  1778. "0": "g",
  1779. "1": "n",
  1780. "2": "b",
  1781. "3": "r",
  1782. "4": "z",
  1783. "5": "s",
  1784. "6": "l",
  1785. "7": "x",
  1786. "8": "i",
  1787. "9": "o",
  1788. };
  1789. function getPalive(serverTime, userId) {
  1790. const tDelay = getTDelay(serverTime);
  1791. const sequenceLengths = [6, 5, 9, 4, 5, 3, 6, 6, 3];
  1792. const currentTimestamp = Math.floor(Date.now() / 1000) + tDelay - 5400;
  1793. const timestampString = currentTimestamp.toString();
  1794. const timestampCharacters = timestampString.split('');
  1795. let result = '';
  1796. for (let i = 0; i < sequenceLengths.length; i++) {
  1797. const sequenceNumber = sequenceLengths[i];
  1798. result += randInt(0, 1) == 1 ? randomString2(sequenceNumber) : randomString1(sequenceNumber);
  1799. const letter = paliveCharmap[parseInt(timestampCharacters[i])];
  1800. result += randInt(0, 1) == 0 ? letter.toUpperCase() : letter;
  1801. }
  1802. result += userId.toString().substring(0, 1) + (randInt(0, 1) == 1 ? randomString2(randInt(4, 20)) : randomString1(randInt(4, 25)));
  1803. return result + "0=";
  1804. }
  1805. function getTDelay(serverTime) {
  1806. const currentTime = new Date().getTime() / 1e3;
  1807. return Math.floor(serverTime - currentTime);
  1808. }
  1809.  
  1810.  
  1811. /***/ }),
  1812.  
  1813. /***/ "./src/bot/util/websocket.ts":
  1814. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1815.  
  1816. "use strict";
  1817. __webpack_require__.r(__webpack_exports__);
  1818. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1819. /* harmony export */ createBot: () => (/* binding */ createBot)
  1820. /* harmony export */ });
  1821. /* harmony import */ var _Bot__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/bot/Bot.ts");
  1822. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/variables.ts");
  1823.  
  1824.  
  1825. // client
  1826. function hookClient() {
  1827. const unmodifiedWS = window.WebSocket;
  1828. window.WebSocket = function (url, protocols) {
  1829. const socket = new unmodifiedWS(url, protocols);
  1830. socket.addEventListener("open", () => new _Bot__WEBPACK_IMPORTED_MODULE_0__.Client(socket));
  1831. socket.addEventListener("close", hookClient);
  1832. // client.handler = new MessageHandler(client, socket)
  1833. return socket;
  1834. };
  1835. }
  1836. hookClient();
  1837. // multibot
  1838. async function createBot(auth, username) {
  1839. console.log(`[7p] Attempting to connect account ${username}`);
  1840. const socket = new WebSocket("wss://pixelplace.io/socket.io/?EIO=4&transport=websocket");
  1841. const bot = new _Bot__WEBPACK_IMPORTED_MODULE_0__.WSBot(auth, username, socket);
  1842. socket.addEventListener("close", () => { bot.kill(); });
  1843. }
  1844.  
  1845.  
  1846. /***/ }),
  1847.  
  1848. /***/ "./src/canvas/Canvas.ts":
  1849. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1850.  
  1851. "use strict";
  1852. __webpack_require__.r(__webpack_exports__);
  1853. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1854. /* harmony export */ Canvas: () => (/* binding */ Canvas),
  1855. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1856. /* harmony export */ });
  1857. /* harmony import */ var _GUI_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/GUI/style.ts");
  1858. /* harmony import */ var _modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/modules/index.ts");
  1859. /* harmony import */ var _util_canvasloader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/canvas/util/canvasloader.ts");
  1860.  
  1861.  
  1862.  
  1863. class Canvas {
  1864. constructor() {
  1865. this._ID = this.ParseID();
  1866. this._isProcessed = false;
  1867. this._customCanvas = this.newPreviewCanvas();
  1868. this._colors = this.getPalette();
  1869. }
  1870. static get instance() {
  1871. if (!Canvas._instance) {
  1872. Canvas._instance = new Canvas;
  1873. (0,_util_canvasloader__WEBPACK_IMPORTED_MODULE_2__.processColors)();
  1874. }
  1875. return Canvas._instance;
  1876. }
  1877. newPreviewCanvas() {
  1878. const canvas = $(`<canvas width="2500" height="2088">`).css(_GUI_style__WEBPACK_IMPORTED_MODULE_0__.canvascss);
  1879. $('#canvas').ready(function () {
  1880. $('#painting-move').append(canvas);
  1881. });
  1882. const ctx = canvas[0].getContext("2d");
  1883. return ctx;
  1884. }
  1885. ParseID() {
  1886. return parseInt(window.location.href.split("/").slice(-1)[0].split("-")[0]);
  1887. }
  1888. get previewCanvas() {
  1889. return this._customCanvas;
  1890. }
  1891. get canvasArray() {
  1892. return this._canvasArray;
  1893. }
  1894. get isProcessed() {
  1895. return this._isProcessed;
  1896. }
  1897. set isProcessed(bool) {
  1898. this._isProcessed = bool;
  1899. }
  1900. get ID() {
  1901. return this._ID;
  1902. }
  1903. get colors() {
  1904. return this._colors;
  1905. }
  1906. set canvasArray(array) {
  1907. this._canvasArray = array;
  1908. this.isProcessed = true;
  1909. }
  1910. getColor(x, y) {
  1911. try {
  1912. return this.canvasArray[x][y];
  1913. }
  1914. catch {
  1915. return 200;
  1916. }
  1917. ;
  1918. }
  1919. updatePixel(x, y, color) {
  1920. if (!this._isProcessed)
  1921. return;
  1922. this.canvasArray[x][y] = color;
  1923. // console.log(this.getColor(x, y), "->", color)
  1924. }
  1925. getPalette() {
  1926. const palette_buttons = document.querySelectorAll("#palette-buttons a");
  1927. let unsorted_array = [];
  1928. palette_buttons.forEach((color) => {
  1929. let id = color.getAttribute('data-id');
  1930. let colorhex = color.getAttribute('title');
  1931. unsorted_array.push({ color: colorhex, id: parseInt(id) });
  1932. });
  1933. unsorted_array.sort((a, b) => { return a.id - b.id; });
  1934. let result = [];
  1935. unsorted_array.forEach((colorobj) => {
  1936. result.push((0,_modules__WEBPACK_IMPORTED_MODULE_1__.hex2rgb)(colorobj.color));
  1937. });
  1938. return result;
  1939. }
  1940. ;
  1941. }
  1942. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Canvas);
  1943.  
  1944.  
  1945. /***/ }),
  1946.  
  1947. /***/ "./src/canvas/util/canvasloader.ts":
  1948. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1949.  
  1950. "use strict";
  1951. __webpack_require__.r(__webpack_exports__);
  1952. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1953. /* harmony export */ processColors: () => (/* binding */ processColors),
  1954. /* harmony export */ processWater: () => (/* binding */ processWater)
  1955. /* harmony export */ });
  1956. /* harmony import */ var _Canvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/canvas/Canvas.ts");
  1957.  
  1958. async function processWater() {
  1959. const pixelplace_canvas = document.getElementById('canvas');
  1960. var waterArray = Array.from({ length: pixelplace_canvas.width }, () => Array.from({ length: pixelplace_canvas.height }, () => 1));
  1961. var image = await fetch('https://pixelplace.io/canvas/' + _Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance.ID + 'p.png?t200000=' + Date.now());
  1962. if (!image.ok) {
  1963. return waterArray;
  1964. }
  1965. const blob = await image.blob();
  1966. const bitmap = await createImageBitmap(blob);
  1967. const canvas = new OffscreenCanvas(bitmap.width, bitmap.height);
  1968. const context = canvas.getContext('2d', { "willReadFrequently": true });
  1969. context.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height);
  1970. const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
  1971. return new Promise((resolve) => {
  1972. if (bitmap.width == 1 && bitmap.height == 1) { // custom canvases ?
  1973. resolve(waterArray);
  1974. }
  1975. for (let y = 0; y < canvas.height; y++) {
  1976. for (let x = 0; x < canvas.width; x++) {
  1977. const index = (y * imageData.width + x) * 4;
  1978. var r = imageData.data[index];
  1979. var g = imageData.data[index + 1];
  1980. var b = imageData.data[index + 2];
  1981. if (r == 204 && g == 204 && b == 204) {
  1982. waterArray[x][y] = 200;
  1983. }
  1984. }
  1985. }
  1986. console.log(waterArray);
  1987. resolve(waterArray);
  1988. });
  1989. }
  1990. async function processColors() {
  1991. const start_total_time = performance.now();
  1992. const canvas = _Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance;
  1993. const pixelplace_canvas = document.getElementById('canvas');
  1994. const ctx = pixelplace_canvas.getContext('2d', { "willReadFrequently": true });
  1995. const imageData = ctx.getImageData(0, 0, pixelplace_canvas.width, pixelplace_canvas.height);
  1996. const pixelData = imageData.data;
  1997. const start_water_time = performance.now();
  1998. const waterArray = await processWater();
  1999. const final_water_time = performance.now() - start_water_time;
  2000. var CanvasArray = Array.from({ length: pixelplace_canvas.width }, () => Array.from({ length: pixelplace_canvas.height }, () => 1));
  2001. const start_color_time = performance.now();
  2002. if (waterArray.length > 1) {
  2003. CanvasArray = waterArray;
  2004. }
  2005. for (let y = 0; y < pixelplace_canvas.height; y++) {
  2006. for (let x = 0; x < pixelplace_canvas.width; x++) {
  2007. if (CanvasArray[x][y] == 200) {
  2008. continue;
  2009. }
  2010. const pixelIndex = (y * pixelplace_canvas.width + x) * 4;
  2011. const r = pixelData[pixelIndex];
  2012. const g = pixelData[pixelIndex + 1];
  2013. const b = pixelData[pixelIndex + 2];
  2014. const colorIndex = canvas.colors.findIndex(color => color[0] === r && color[1] === g && color[2] === b);
  2015. CanvasArray[x][y] = colorIndex;
  2016. }
  2017. }
  2018. console.log(CanvasArray);
  2019. _Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance.canvasArray = CanvasArray;
  2020. // Logging
  2021. const final_total_time = performance.now() - start_total_time;
  2022. const final_colors_time = performance.now() - start_color_time;
  2023. console.log(`[7p PROCESSING] Total Time: ${final_total_time}ms, Colors Time: ${final_colors_time}ms, Water Time: ${final_water_time}ms`);
  2024. Toastify({
  2025. text: `Canvas loaded!`,
  2026. style: {
  2027. background: "#1a1a1a",
  2028. border: "solid rgb(0, 255, 81)"
  2029. },
  2030. }).showToast();
  2031. }
  2032.  
  2033.  
  2034. /***/ }),
  2035.  
  2036. /***/ "./src/index.ts":
  2037. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2038.  
  2039. "use strict";
  2040. __webpack_require__.r(__webpack_exports__);
  2041. /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./package.json");
  2042. /* harmony import */ var _canvas_Canvas__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/canvas/Canvas.ts");
  2043. /* harmony import */ var _util_ExternalLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/util/ExternalLoader.ts");
  2044.  
  2045.  
  2046.  
  2047. // @ts-ignore (GLOBAL IMPORT)
  2048. const context = __webpack_require__("./src sync recursive ^(?%21.*global\\.d).+");
  2049. context.keys().forEach(context);
  2050. Object.defineProperty(window.console, 'log', {
  2051. configurable: false,
  2052. enumerable: true,
  2053. writable: false,
  2054. value: console.log
  2055. });
  2056. console.log(`%c7Placer Loaded! Version: ${_package_json__WEBPACK_IMPORTED_MODULE_0__/* .version */ .rE}`, 'color: chartreuse; font-size: 60px; font-style: italic;');
  2057. (0,_util_ExternalLoader__WEBPACK_IMPORTED_MODULE_2__.loadCss)('https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css');
  2058. const intervalId = setInterval(() => {
  2059. if (document.getElementById('canvas')) {
  2060. clearInterval(intervalId);
  2061. Toastify({
  2062. text: `7Placer ${_package_json__WEBPACK_IMPORTED_MODULE_0__/* .version */ .rE} Loaded! Loading canvas...`,
  2063. style: {
  2064. background: "#1a1a1a",
  2065. border: "solid var(--gui-main-color)"
  2066. },
  2067. callback: () => {
  2068. Toastify({
  2069. text: `Click me to join the discord.`,
  2070. destination: "https://discord.gg/3fXfQp7Rms",
  2071. newWindow: true,
  2072. style: {
  2073. background: "#1a1a1a",
  2074. border: "solid var(--gui-main-color)"
  2075. },
  2076. }).showToast();
  2077. }
  2078. }).showToast();
  2079. _canvas_Canvas__WEBPACK_IMPORTED_MODULE_1__["default"].instance;
  2080. }
  2081. }, 100);
  2082.  
  2083.  
  2084. /***/ }),
  2085.  
  2086. /***/ "./src/modules/defaultModules/ImageTools.ts":
  2087. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2088.  
  2089. "use strict";
  2090. __webpack_require__.r(__webpack_exports__);
  2091. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2092. /* harmony export */ ImageToPixels: () => (/* binding */ ImageToPixels),
  2093. /* harmony export */ botImage: () => (/* binding */ botImage),
  2094. /* harmony export */ hex2rgb: () => (/* binding */ hex2rgb)
  2095. /* harmony export */ });
  2096. /* harmony import */ var _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/canvas/Canvas.ts");
  2097. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/variables.ts");
  2098. /* harmony import */ var _Queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/modules/defaultModules/Queue.ts");
  2099. /* harmony import */ var _Sorting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/modules/defaultModules/Sorting.ts");
  2100.  
  2101.  
  2102.  
  2103.  
  2104. function hex2rgb(hex) {
  2105. const r = parseInt(hex.slice(1, 3), 16);
  2106. const g = parseInt(hex.slice(3, 5), 16);
  2107. const b = parseInt(hex.slice(5, 7), 16);
  2108. return [r, g, b];
  2109. }
  2110. // function getColorDistance(c1: {r: number, g: number, b: number}, c2: [r: number, g: number, b: number]) {
  2111. // return (c1.r - c2[0]) ** 2 + (c1.g - c2[1]) ** 2 + (c1.b - c2[2]) ** 2;
  2112. // }
  2113. // function findClosestColor(color: {r: number, g: number, b: number}, palette: [r: number, g: number, b:number][]) {
  2114. // let minDistance = Infinity;
  2115. // let colorNumber: number
  2116. // let index = 0
  2117. // for (const palette_color of palette) {
  2118. // const distance = getColorDistance(color, palette_color);
  2119. // if (distance < minDistance) {
  2120. // minDistance = distance;
  2121. // colorNumber = index
  2122. // }
  2123. // index += 1
  2124. // }
  2125. // return colorNumber;
  2126. // }
  2127. function previewCanvasImage(x, y, image) {
  2128. const canvas = _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance;
  2129. const ctx = canvas.previewCanvas;
  2130. const img = new Image();
  2131. img.onload = function () {
  2132. ctx.drawImage(img, x, y);
  2133. };
  2134. img.src = URL.createObjectURL(image);
  2135. }
  2136. const workerCode = `
  2137. function getColorDistance(c1, c2) {
  2138. return (c1.r - c2[0]) ** 2 + (c1.g - c2[1]) ** 2 + (c1.b - c2[2]) ** 2;
  2139. }
  2140. function findClosestColor(color, palette) {
  2141. let minDistance = Infinity;
  2142. let colorNumber
  2143. let index = 0
  2144. for (const palette_color of palette) {
  2145. const distance = getColorDistance(color, palette_color);
  2146. if (distance < minDistance) {
  2147. minDistance = distance;
  2148. colorNumber = index
  2149. }
  2150. index += 1
  2151. }
  2152. return colorNumber;
  2153. }
  2154.  
  2155. self.onmessage = function (e) { // {imageData: ImageData, palette: [r, g, b][], y_division_last: number, x_division_last: number}
  2156. const pixelData = e.data.imageData.data
  2157. const result = []
  2158. for (let y = 0; y < e.data.y_division_last; y++) {
  2159. for (let x = 0; x < e.data.x_division_last; x++) {
  2160. const pixelIndex = (y * e.data.imageData.width + x) * 4;
  2161. const r = pixelData[pixelIndex];
  2162. const g = pixelData[pixelIndex + 1];
  2163. const b = pixelData[pixelIndex + 2];
  2164. const a = pixelData[pixelIndex + 3];
  2165. if (a < 1) {
  2166. continue; // ignore transparent pixels
  2167. };
  2168. const color = findClosestColor({r, g, b}, e.data.palette);
  2169. result.push({x, y, color});
  2170. };
  2171. }
  2172. self.postMessage(result);
  2173. };
  2174. `;
  2175. const blob = new Blob([workerCode], { type: 'application/javascript' });
  2176. const blobUrl = URL.createObjectURL(blob);
  2177. function imageData2array(imageData, thread_amount, palette) {
  2178. const t0 = performance.now();
  2179. return new Promise(resolve => {
  2180. const workers_global_result = [];
  2181. let workers = 0;
  2182. let workers_done = 0;
  2183. for (let divison_y = 0; divison_y < imageData.height; divison_y += (imageData.height / thread_amount)) {
  2184. const y_division_last = divison_y + (imageData.height / thread_amount);
  2185. for (let division_x = 0; division_x < imageData.width; division_x += (imageData.width / thread_amount)) {
  2186. const x_division_last = division_x + (imageData.width / thread_amount);
  2187. const worker = new Worker(blobUrl);
  2188. workers += 1;
  2189. worker.postMessage({ imageData: imageData, palette: palette, y_division_last: y_division_last, x_division_last: x_division_last });
  2190. worker.onmessage = function (e) {
  2191. const worker_pixels = e.data;
  2192. worker.terminate();
  2193. workers_done += 1;
  2194. console.log(workers_done);
  2195. worker_pixels.forEach((pixel) => {
  2196. workers_global_result.push(pixel);
  2197. });
  2198. if (workers == workers_done) {
  2199. console.log(`ImageData processed in ${performance.now() - t0} ms`);
  2200. resolve(workers_global_result);
  2201. }
  2202. };
  2203. }
  2204. }
  2205. })
  2206. .then((final_result) => {
  2207. return final_result;
  2208. });
  2209. }
  2210. async function ImageToPixels(image, dither, palette) {
  2211. const processing_toast = Toastify({
  2212. text: `Processing image...`,
  2213. duration: 100000,
  2214. style: {
  2215. background: "#1a1a1a",
  2216. border: "solid var(--gui-main-color)"
  2217. },
  2218. }).showToast();
  2219. const canvas = new OffscreenCanvas(image.width, image.height);
  2220. const ctx = canvas.getContext('2d');
  2221. ctx.drawImage(image, 0, 0, image.width, image.height);
  2222. const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
  2223. if (dither) {
  2224. const quant = new RgbQuant({ palette: _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance.colors });
  2225. quant.sample(imageData);
  2226. quant.reduce(imageData, 1, dither);
  2227. }
  2228. const array = await imageData2array(imageData, 1, palette || _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance.colors);
  2229. processing_toast.hideToast();
  2230. Toastify({
  2231. text: `Image processed!`,
  2232. style: {
  2233. background: "#1a1a1a",
  2234. border: "solid rgb(0, 255, 81)"
  2235. },
  2236. }).showToast();
  2237. return array;
  2238. }
  2239. async function botImage(x, y, image) {
  2240. if (!x || !y || !image)
  2241. return;
  2242. const seven = window.seven;
  2243. const bitmap = await createImageBitmap(image);
  2244. let processed = await ImageToPixels(bitmap, window.seven.dither);
  2245. previewCanvasImage(x, y, image);
  2246. processed = await (0,_Sorting__WEBPACK_IMPORTED_MODULE_3__["default"])(processed, seven.order);
  2247. processed.forEach((pixel) => {
  2248. pixel.x += x;
  2249. pixel.y += y;
  2250. });
  2251. _Queue__WEBPACK_IMPORTED_MODULE_2__["default"].bulkAdd(processed, true);
  2252. }
  2253.  
  2254.  
  2255. /***/ }),
  2256.  
  2257. /***/ "./src/modules/defaultModules/Protect.ts":
  2258. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2259.  
  2260. "use strict";
  2261. __webpack_require__.r(__webpack_exports__);
  2262. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2263. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  2264. /* harmony export */ });
  2265. /* harmony import */ var _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/canvas/Canvas.ts");
  2266. /* harmony import */ var _Queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/modules/defaultModules/Queue.ts");
  2267.  
  2268.  
  2269. class Protector {
  2270. protect(x, y, color) {
  2271. Protector.protected.push({ x: x, y: y, color: color });
  2272. }
  2273. static clear() {
  2274. Protector.protected = [];
  2275. }
  2276. static checkPixel(x, y, color) {
  2277. const canvas = _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance;
  2278. if (Protector.protected.length == 0) {
  2279. return;
  2280. }
  2281. function isInsideProtected(pixel) {
  2282. if (pixel.x == x && pixel.y == y) {
  2283. return true;
  2284. }
  2285. return false;
  2286. }
  2287. function isSameColor(pixel) {
  2288. const canvasColor = canvas.getColor(x, y);
  2289. if (canvasColor == pixel.color) {
  2290. return true;
  2291. }
  2292. return false;
  2293. }
  2294. Protector.protected.forEach((pixel) => {
  2295. if (isInsideProtected(pixel) && !isSameColor(pixel)) {
  2296. _Queue__WEBPACK_IMPORTED_MODULE_1__["default"].add(pixel, false, window.seven.agressive_protection);
  2297. }
  2298. });
  2299. }
  2300. }
  2301. Protector.protected = [];
  2302. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Protector);
  2303.  
  2304.  
  2305. /***/ }),
  2306.  
  2307. /***/ "./src/modules/defaultModules/Queue.ts":
  2308. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2309.  
  2310. "use strict";
  2311. __webpack_require__.r(__webpack_exports__);
  2312. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2313. /* harmony export */ "default": () => (/* binding */ Queue)
  2314. /* harmony export */ });
  2315. /* harmony import */ var _bot_Bot__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/bot/Bot.ts");
  2316. /* harmony import */ var _canvas_Canvas__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/canvas/Canvas.ts");
  2317. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/variables.ts");
  2318. /* harmony import */ var _Protect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/modules/defaultModules/Protect.ts");
  2319.  
  2320.  
  2321.  
  2322.  
  2323. class Queue {
  2324. constructor() {
  2325. Queue.performance = performance.now();
  2326. }
  2327. static add(pixel, protection, atStart = false, client = false) {
  2328. const seven = window.seven;
  2329. if (atStart)
  2330. seven.queue.unshift(pixel);
  2331. else {
  2332. seven.queue.push(pixel);
  2333. }
  2334. ;
  2335. if (seven.queue.length == 1)
  2336. Queue.start();
  2337. }
  2338. ;
  2339. static bulkAdd(pixel_array, protection, atStart = false, client = false) {
  2340. const seven = window.seven;
  2341. pixel_array.forEach(pixel => {
  2342. pixel.protected = protection;
  2343. pixel.client = client;
  2344. });
  2345. if (!atStart) {
  2346. seven.queue = seven.queue.concat(pixel_array);
  2347. }
  2348. else {
  2349. seven.queue.unshift(...pixel_array);
  2350. }
  2351. if (seven.queue.length == pixel_array.length)
  2352. Queue.start();
  2353. }
  2354. ;
  2355. static clear() {
  2356. const seven = window.seven;
  2357. // console.log('Queue cleared: ', seven.queue);
  2358. seven.queue = [];
  2359. }
  2360. ;
  2361. static async start() {
  2362. const seven = window.seven;
  2363. const canvas = _canvas_Canvas__WEBPACK_IMPORTED_MODULE_1__["default"].instance;
  2364. const protector = new _Protect__WEBPACK_IMPORTED_MODULE_3__["default"];
  2365. if (!canvas.isProcessed) {
  2366. Toastify({
  2367. text: `Canvas has not been processed yet.`,
  2368. style: {
  2369. background: "#1a1a1a",
  2370. border: "solid rgb(255, 0, 0)",
  2371. },
  2372. }).showToast();
  2373. console.log('[7p] Error starting queue: Canvas has not been processed yet.');
  2374. Queue.stop();
  2375. return;
  2376. }
  2377. seven.inprogress = true;
  2378. let tick = 0;
  2379. while (seven.inprogress) {
  2380. // console.log(performance.now() - Queue.performance);
  2381. Queue.performance = performance.now();
  2382. const pixel = seven.queue[0];
  2383. let bot;
  2384. if (pixel.client) {
  2385. bot = _bot_Bot__WEBPACK_IMPORTED_MODULE_0__.Client.instance;
  2386. }
  2387. else {
  2388. bot = await _bot_Bot__WEBPACK_IMPORTED_MODULE_0__.Bot.findAvailableBot();
  2389. }
  2390. ;
  2391. // Anti lag when skipping (fix it pls)
  2392. const canvas_color = canvas.getColor(pixel.x, pixel.y);
  2393. if (pixel.color == canvas_color) {
  2394. tick += 1;
  2395. }
  2396. else
  2397. tick = 0;
  2398. if (tick == 100) {
  2399. await new Promise(resolve => setTimeout(resolve, 0));
  2400. tick = 0;
  2401. }
  2402. ;
  2403. await bot.placePixel(pixel);
  2404. var indexOfRemoval = seven.queue.indexOf(pixel);
  2405. seven.queue.splice(indexOfRemoval, 1);
  2406. if (pixel.protected && seven.protect) {
  2407. protector.protect(pixel.x, pixel.y, pixel.color);
  2408. }
  2409. if (seven.queue.length == 0) {
  2410. seven.inprogress = false;
  2411. console.log('[7p] Queue done.');
  2412. }
  2413. ;
  2414. }
  2415. ;
  2416. }
  2417. ;
  2418. static stop() {
  2419. const seven = window.seven;
  2420. seven.inprogress = false;
  2421. const canvas = _canvas_Canvas__WEBPACK_IMPORTED_MODULE_1__["default"].instance;
  2422. canvas.previewCanvas.clearRect(0, 0, 3000, 3000);
  2423. _Protect__WEBPACK_IMPORTED_MODULE_3__["default"].clear();
  2424. Queue.clear();
  2425. }
  2426. ;
  2427. }
  2428. ;
  2429.  
  2430.  
  2431. /***/ }),
  2432.  
  2433. /***/ "./src/modules/defaultModules/Sorting.ts":
  2434. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2435.  
  2436. "use strict";
  2437. __webpack_require__.r(__webpack_exports__);
  2438. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2439. /* harmony export */ "default": () => (/* binding */ sort)
  2440. /* harmony export */ });
  2441. const workerCode = `
  2442. self.onmessage = function (e) { // {array: {x: number, y: number, color: number}[], order: string}
  2443. let array = e.data.array
  2444. switch (e.data.order) {
  2445. case 'none':
  2446. break
  2447.  
  2448. case 'rand':
  2449. array.sort(() => Math.random() - 0.5);
  2450. break
  2451.  
  2452. case 'colors':
  2453. array.sort((a, b) => a.color - b.color);
  2454. break
  2455.  
  2456. case 'vertical':
  2457. array.sort((a, b) => a.x - b.x);
  2458. break
  2459.  
  2460. case 'horizontal':
  2461. array.sort((a, b) => a.y - b.y);
  2462. break
  2463.  
  2464. default:
  2465. case 'circle':
  2466. const CX = Math.floor((array[0].x + array[array.length - 1].x) / 2);
  2467. const CY = Math.floor((array[0].y + array[array.length - 1].y) / 2);
  2468. array.sort((a, b) => {
  2469. const distanceA = Math.sqrt((a.x - CX) ** 2 + (a.y - CY) ** 2);
  2470. const distanceB = Math.sqrt((b.x - CX) ** 2 + (b.y - CY) ** 2);
  2471. return distanceA - distanceB;
  2472. });
  2473. }
  2474. self.postMessage(array)
  2475. };
  2476. `;
  2477. const blob = new Blob([workerCode], { type: 'application/javascript' });
  2478. const blobUrl = URL.createObjectURL(blob);
  2479. async function sort(array, order) {
  2480. const pixel_array = await new Promise(resolve => {
  2481. let t0 = performance.now();
  2482. let sorting_toast = Toastify({
  2483. text: `Sorting...`,
  2484. duration: 100000,
  2485. style: {
  2486. background: "#1a1a1a",
  2487. border: "solid var(--gui-main-color)"
  2488. },
  2489. }).showToast();
  2490. const worker = new Worker(blobUrl);
  2491. worker.postMessage({ array: array, order: order });
  2492. worker.onmessage = function (e) {
  2493. resolve(e.data);
  2494. console.log(`Sorted in ${performance.now() - t0}`);
  2495. sorting_toast.hideToast();
  2496. clearTimeout(long_sort_timeout);
  2497. };
  2498. let long_sort_timeout = setTimeout(() => {
  2499. Toastify({
  2500. text: `If sorting is taking too long consider using "sort: none"`,
  2501. duration: 10000,
  2502. style: {
  2503. background: "#1a1a1a",
  2504. border: "solid rgb(255, 251, 0)"
  2505. },
  2506. }).showToast();
  2507. }, 7000);
  2508. });
  2509. return pixel_array;
  2510. }
  2511.  
  2512.  
  2513. /***/ }),
  2514.  
  2515. /***/ "./src/modules/defaultModules/SquareMaker.ts":
  2516. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2517.  
  2518. "use strict";
  2519. __webpack_require__.r(__webpack_exports__);
  2520. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2521. /* harmony export */ BotSquare: () => (/* binding */ BotSquare)
  2522. /* harmony export */ });
  2523. /* harmony import */ var _Queue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/modules/defaultModules/Queue.ts");
  2524. /* harmony import */ var _Sorting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/modules/defaultModules/Sorting.ts");
  2525.  
  2526.  
  2527. async function BotSquare(x1, y1, x2, y2, color) {
  2528. if (!x1 || !y1 || !x2 || !y2 || color === undefined)
  2529. return;
  2530. const seven = window.seven;
  2531. var result = [];
  2532. if (x2 < x1)
  2533. [x1, x2] = [x2, x1];
  2534. if (y2 < y1)
  2535. [y1, y2] = [y2, y1];
  2536. for (let x = x1; x <= x2; x++) {
  2537. for (let y = y1; y <= y2; y++) {
  2538. result.push({ x, y, color });
  2539. }
  2540. }
  2541. result = await (0,_Sorting__WEBPACK_IMPORTED_MODULE_1__["default"])(result, seven.order);
  2542. result.forEach((pixel) => {
  2543. _Queue__WEBPACK_IMPORTED_MODULE_0__["default"].add(pixel, true);
  2544. });
  2545. Toastify({
  2546. text: `Square from ${x1}, ${y1} TO ${x2}, ${y2} with color ID ${color}`,
  2547. style: {
  2548. background: "#1a1a1a",
  2549. border: "solid var(--gui-main-color)"
  2550. },
  2551. }).showToast();
  2552. }
  2553.  
  2554.  
  2555. /***/ }),
  2556.  
  2557. /***/ "./src/modules/defaultModules/defaultKeys.ts":
  2558. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2559.  
  2560. "use strict";
  2561. __webpack_require__.r(__webpack_exports__);
  2562. /* harmony import */ var _GUI_drop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/GUI/drop.ts");
  2563. /* harmony import */ var _util_getClientMouse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/modules/util/getClientMouse.ts");
  2564. /* harmony import */ var _Queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/modules/defaultModules/Queue.ts");
  2565. /* harmony import */ var _SquareMaker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/modules/defaultModules/SquareMaker.ts");
  2566.  
  2567.  
  2568.  
  2569.  
  2570. var coord1 = null;
  2571. $(document).on('keyup', function (event) {
  2572. if ($(':input[type="text"]').is(':focus'))
  2573. return; //; prevent with chat open
  2574. switch (event.which) {
  2575. case (87):
  2576. if (!event.altKey)
  2577. return;
  2578. _Queue__WEBPACK_IMPORTED_MODULE_1__["default"].stop();
  2579. break;
  2580. case (66):
  2581. if (!event.altKey)
  2582. return;
  2583. (0,_GUI_drop__WEBPACK_IMPORTED_MODULE_0__.createDropArea)();
  2584. break;
  2585. case 88:
  2586. const [x, y, color] = (0,_util_getClientMouse__WEBPACK_IMPORTED_MODULE_3__["default"])();
  2587. if (coord1 == null) {
  2588. coord1 = { x: x, y: y };
  2589. return;
  2590. }
  2591. (0,_SquareMaker__WEBPACK_IMPORTED_MODULE_2__.BotSquare)(coord1.x, coord1.y, x, y, color);
  2592. coord1 = null;
  2593. break;
  2594. // add more
  2595. }
  2596. });
  2597.  
  2598.  
  2599. /***/ }),
  2600.  
  2601. /***/ "./src/modules/defaultModules/index.ts":
  2602. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2603.  
  2604. "use strict";
  2605. __webpack_require__.r(__webpack_exports__);
  2606. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2607. /* harmony export */ BotSquare: () => (/* reexport safe */ _SquareMaker__WEBPACK_IMPORTED_MODULE_2__.BotSquare),
  2608. /* harmony export */ ImageToPixels: () => (/* reexport safe */ _ImageTools__WEBPACK_IMPORTED_MODULE_0__.ImageToPixels),
  2609. /* harmony export */ botImage: () => (/* reexport safe */ _ImageTools__WEBPACK_IMPORTED_MODULE_0__.botImage),
  2610. /* harmony export */ hex2rgb: () => (/* reexport safe */ _ImageTools__WEBPACK_IMPORTED_MODULE_0__.hex2rgb)
  2611. /* harmony export */ });
  2612. /* harmony import */ var _ImageTools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/modules/defaultModules/ImageTools.ts");
  2613. /* harmony import */ var _Queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/modules/defaultModules/Queue.ts");
  2614. /* harmony import */ var _SquareMaker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/modules/defaultModules/SquareMaker.ts");
  2615. /* harmony import */ var _defaultKeys__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/modules/defaultModules/defaultKeys.ts");
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622. /***/ }),
  2623.  
  2624. /***/ "./src/modules/index.ts":
  2625. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2626.  
  2627. "use strict";
  2628. __webpack_require__.r(__webpack_exports__);
  2629. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2630. /* harmony export */ BotSquare: () => (/* reexport safe */ _defaultModules__WEBPACK_IMPORTED_MODULE_0__.BotSquare),
  2631. /* harmony export */ ImageToPixels: () => (/* reexport safe */ _defaultModules__WEBPACK_IMPORTED_MODULE_0__.ImageToPixels),
  2632. /* harmony export */ botImage: () => (/* reexport safe */ _defaultModules__WEBPACK_IMPORTED_MODULE_0__.botImage),
  2633. /* harmony export */ hex2rgb: () => (/* reexport safe */ _defaultModules__WEBPACK_IMPORTED_MODULE_0__.hex2rgb)
  2634. /* harmony export */ });
  2635. /* harmony import */ var _defaultModules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/modules/defaultModules/index.ts");
  2636.  
  2637. // custom exports
  2638.  
  2639.  
  2640. /***/ }),
  2641.  
  2642. /***/ "./src/modules/util/getClientMouse.ts":
  2643. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2644.  
  2645. "use strict";
  2646. __webpack_require__.r(__webpack_exports__);
  2647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2648. /* harmony export */ "default": () => (/* binding */ getClientMouse)
  2649. /* harmony export */ });
  2650. function getClientMouse() {
  2651. const coordinates = $('#coordinates').text();
  2652. const [x, y] = coordinates.split(',').map(coord => parseInt(coord.trim()));
  2653. const selectedcolor = $('#palette-buttons a.selected').data('id');
  2654. return [x, y, selectedcolor];
  2655. }
  2656.  
  2657.  
  2658. /***/ }),
  2659.  
  2660. /***/ "./src/requests/get-painting.ts":
  2661. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2662.  
  2663. "use strict";
  2664. __webpack_require__.r(__webpack_exports__);
  2665. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2666. /* harmony export */ "default": () => (/* binding */ getPainting)
  2667. /* harmony export */ });
  2668. /* harmony import */ var _getCookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/requests/getCookie.ts");
  2669. /* harmony import */ var _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/canvas/Canvas.ts");
  2670.  
  2671.  
  2672. async function getPainting(authId, authKey, authToken) {
  2673. const canvas = _canvas_Canvas__WEBPACK_IMPORTED_MODULE_0__["default"].instance;
  2674. const originalAuthId = (0,_getCookie__WEBPACK_IMPORTED_MODULE_1__["default"])('authId');
  2675. const originalAuthKey = (0,_getCookie__WEBPACK_IMPORTED_MODULE_1__["default"])('authKey');
  2676. const originalAuthToken = (0,_getCookie__WEBPACK_IMPORTED_MODULE_1__["default"])('authToken');
  2677. document.cookie = `authId=${authId}; path=/`;
  2678. document.cookie = `authKey=${authKey}; path=/`;
  2679. document.cookie = `authToken=${authToken}; path=/`;
  2680. try {
  2681. const response = await fetch(`https://pixelplace.io/api/get-painting.php?id=${canvas.ID}&connected=1`, {
  2682. headers: {
  2683. 'Accept': 'application/json, text/javascript, */*; q=0.01',
  2684. },
  2685. credentials: 'include'
  2686. });
  2687. const json = response.json();
  2688. return json;
  2689. }
  2690. finally {
  2691. document.cookie = `authId=${originalAuthId}; path=/`;
  2692. document.cookie = `authKey=${originalAuthKey}; path=/`;
  2693. document.cookie = `authToken=${originalAuthToken}; path=/`;
  2694. }
  2695. }
  2696.  
  2697.  
  2698. /***/ }),
  2699.  
  2700. /***/ "./src/requests/getCookie.ts":
  2701. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2702.  
  2703. "use strict";
  2704. __webpack_require__.r(__webpack_exports__);
  2705. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2706. /* harmony export */ "default": () => (/* binding */ getCookie)
  2707. /* harmony export */ });
  2708. function getCookie(name) {
  2709. const value = `; ${document.cookie}`;
  2710. const parts = value.split(`; ${name}=`);
  2711. if (parts.length === 2)
  2712. return parts.pop().split(';').shift();
  2713. }
  2714.  
  2715.  
  2716. /***/ }),
  2717.  
  2718. /***/ "./src/requests/ping.ts":
  2719. /***/ (() => {
  2720.  
  2721. // to do
  2722.  
  2723.  
  2724. /***/ }),
  2725.  
  2726. /***/ "./src/util/ExternalLoader.ts":
  2727. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2728.  
  2729. "use strict";
  2730. __webpack_require__.r(__webpack_exports__);
  2731. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2732. /* harmony export */ loadCss: () => (/* binding */ loadCss)
  2733. /* harmony export */ });
  2734. function loadCss(url) {
  2735. var head = document.getElementsByTagName('head')[0];
  2736. var link = document.createElement('link');
  2737. link.rel = 'stylesheet';
  2738. link.type = 'text/css';
  2739. link.href = url;
  2740. link.media = 'all';
  2741. head.appendChild(link);
  2742. }
  2743.  
  2744.  
  2745. /***/ }),
  2746.  
  2747. /***/ "./src/variables.ts":
  2748. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2749.  
  2750. "use strict";
  2751. __webpack_require__.r(__webpack_exports__);
  2752. /* harmony import */ var _auth_util_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/auth/util/commands.ts");
  2753.  
  2754. window.seven = {
  2755. bots: new Map(),
  2756. pixelspeed: 21,
  2757. queue: [],
  2758. inprogress: false,
  2759. protect: false,
  2760. tickspeed: 1000,
  2761. order: 'fromCenter',
  2762. multi: _auth_util_commands__WEBPACK_IMPORTED_MODULE_0__.public_commands,
  2763. dither: null,
  2764. agressive_protection: false,
  2765. pixel_type: "default",
  2766. };
  2767.  
  2768.  
  2769. /***/ }),
  2770.  
  2771. /***/ "./src sync recursive ^(?%21.*global\\.d).+":
  2772. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2773.  
  2774. var map = {
  2775. ".": "./src/index.ts",
  2776. "./": "./src/index.ts",
  2777. "./GUI/GUICore": "./src/GUI/GUICore.ts",
  2778. "./GUI/GUICore.ts": "./src/GUI/GUICore.ts",
  2779. "./GUI/GUIStyle.css": "./src/GUI/GUIStyle.css",
  2780. "./GUI/TAB_Botting": "./src/GUI/TAB_Botting.ts",
  2781. "./GUI/TAB_Botting.ts": "./src/GUI/TAB_Botting.ts",
  2782. "./GUI/TAB_Settings": "./src/GUI/TAB_Settings.ts",
  2783. "./GUI/TAB_Settings.ts": "./src/GUI/TAB_Settings.ts",
  2784. "./GUI/dragElement": "./src/GUI/dragElement.ts",
  2785. "./GUI/dragElement.ts": "./src/GUI/dragElement.ts",
  2786. "./GUI/drop": "./src/GUI/drop.ts",
  2787. "./GUI/drop.ts": "./src/GUI/drop.ts",
  2788. "./GUI/style": "./src/GUI/style.ts",
  2789. "./GUI/style.ts": "./src/GUI/style.ts",
  2790. "./auth/Auth": "./src/auth/Auth.ts",
  2791. "./auth/Auth.ts": "./src/auth/Auth.ts",
  2792. "./auth/util/commands": "./src/auth/util/commands.ts",
  2793. "./auth/util/commands.ts": "./src/auth/util/commands.ts",
  2794. "./bot/Bot": "./src/bot/Bot.ts",
  2795. "./bot/Bot.ts": "./src/bot/Bot.ts",
  2796. "./bot/util/MessageHandler": "./src/bot/util/MessageHandler.ts",
  2797. "./bot/util/MessageHandler.ts": "./src/bot/util/MessageHandler.ts",
  2798. "./bot/util/palive": "./src/bot/util/palive.ts",
  2799. "./bot/util/palive.ts": "./src/bot/util/palive.ts",
  2800. "./bot/util/websocket": "./src/bot/util/websocket.ts",
  2801. "./bot/util/websocket.ts": "./src/bot/util/websocket.ts",
  2802. "./canvas/Canvas": "./src/canvas/Canvas.ts",
  2803. "./canvas/Canvas.ts": "./src/canvas/Canvas.ts",
  2804. "./canvas/util/canvasloader": "./src/canvas/util/canvasloader.ts",
  2805. "./canvas/util/canvasloader.ts": "./src/canvas/util/canvasloader.ts",
  2806. "./index": "./src/index.ts",
  2807. "./index.ts": "./src/index.ts",
  2808. "./modules": "./src/modules/index.ts",
  2809. "./modules/": "./src/modules/index.ts",
  2810. "./modules/defaultModules": "./src/modules/defaultModules/index.ts",
  2811. "./modules/defaultModules/": "./src/modules/defaultModules/index.ts",
  2812. "./modules/defaultModules/ImageTools": "./src/modules/defaultModules/ImageTools.ts",
  2813. "./modules/defaultModules/ImageTools.ts": "./src/modules/defaultModules/ImageTools.ts",
  2814. "./modules/defaultModules/Protect": "./src/modules/defaultModules/Protect.ts",
  2815. "./modules/defaultModules/Protect.ts": "./src/modules/defaultModules/Protect.ts",
  2816. "./modules/defaultModules/Queue": "./src/modules/defaultModules/Queue.ts",
  2817. "./modules/defaultModules/Queue.ts": "./src/modules/defaultModules/Queue.ts",
  2818. "./modules/defaultModules/Sorting": "./src/modules/defaultModules/Sorting.ts",
  2819. "./modules/defaultModules/Sorting.ts": "./src/modules/defaultModules/Sorting.ts",
  2820. "./modules/defaultModules/SquareMaker": "./src/modules/defaultModules/SquareMaker.ts",
  2821. "./modules/defaultModules/SquareMaker.ts": "./src/modules/defaultModules/SquareMaker.ts",
  2822. "./modules/defaultModules/defaultKeys": "./src/modules/defaultModules/defaultKeys.ts",
  2823. "./modules/defaultModules/defaultKeys.ts": "./src/modules/defaultModules/defaultKeys.ts",
  2824. "./modules/defaultModules/index": "./src/modules/defaultModules/index.ts",
  2825. "./modules/defaultModules/index.ts": "./src/modules/defaultModules/index.ts",
  2826. "./modules/index": "./src/modules/index.ts",
  2827. "./modules/index.ts": "./src/modules/index.ts",
  2828. "./modules/util/getClientMouse": "./src/modules/util/getClientMouse.ts",
  2829. "./modules/util/getClientMouse.ts": "./src/modules/util/getClientMouse.ts",
  2830. "./requests/get-painting": "./src/requests/get-painting.ts",
  2831. "./requests/get-painting.ts": "./src/requests/get-painting.ts",
  2832. "./requests/getCookie": "./src/requests/getCookie.ts",
  2833. "./requests/getCookie.ts": "./src/requests/getCookie.ts",
  2834. "./requests/ping": "./src/requests/ping.ts",
  2835. "./requests/ping.ts": "./src/requests/ping.ts",
  2836. "./util/ExternalLoader": "./src/util/ExternalLoader.ts",
  2837. "./util/ExternalLoader.ts": "./src/util/ExternalLoader.ts",
  2838. "./variables": "./src/variables.ts",
  2839. "./variables.ts": "./src/variables.ts"
  2840. };
  2841.  
  2842.  
  2843. function webpackContext(req) {
  2844. var id = webpackContextResolve(req);
  2845. return __webpack_require__(id);
  2846. }
  2847. function webpackContextResolve(req) {
  2848. if(!__webpack_require__.o(map, req)) {
  2849. var e = new Error("Cannot find module '" + req + "'");
  2850. e.code = 'MODULE_NOT_FOUND';
  2851. throw e;
  2852. }
  2853. return map[req];
  2854. }
  2855. webpackContext.keys = function webpackContextKeys() {
  2856. return Object.keys(map);
  2857. };
  2858. webpackContext.resolve = webpackContextResolve;
  2859. module.exports = webpackContext;
  2860. webpackContext.id = "./src sync recursive ^(?%21.*global\\.d).+";
  2861.  
  2862. /***/ }),
  2863.  
  2864. /***/ "./package.json":
  2865. /***/ ((module) => {
  2866.  
  2867. "use strict";
  2868. module.exports = {"rE":"2.1.0"};
  2869.  
  2870. /***/ })
  2871.  
  2872. /******/ });
  2873. /************************************************************************/
  2874. /******/ // The module cache
  2875. /******/ var __webpack_module_cache__ = {};
  2876. /******/
  2877. /******/ // The require function
  2878. /******/ function __webpack_require__(moduleId) {
  2879. /******/ // Check if module is in cache
  2880. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  2881. /******/ if (cachedModule !== undefined) {
  2882. /******/ return cachedModule.exports;
  2883. /******/ }
  2884. /******/ // Create a new module (and put it into the cache)
  2885. /******/ var module = __webpack_module_cache__[moduleId] = {
  2886. /******/ id: moduleId,
  2887. /******/ // no module.loaded needed
  2888. /******/ exports: {}
  2889. /******/ };
  2890. /******/
  2891. /******/ // Execute the module function
  2892. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  2893. /******/
  2894. /******/ // Return the exports of the module
  2895. /******/ return module.exports;
  2896. /******/ }
  2897. /******/
  2898. /************************************************************************/
  2899. /******/ /* webpack/runtime/compat get default export */
  2900. /******/ (() => {
  2901. /******/ // getDefaultExport function for compatibility with non-harmony modules
  2902. /******/ __webpack_require__.n = (module) => {
  2903. /******/ var getter = module && module.__esModule ?
  2904. /******/ () => (module['default']) :
  2905. /******/ () => (module);
  2906. /******/ __webpack_require__.d(getter, { a: getter });
  2907. /******/ return getter;
  2908. /******/ };
  2909. /******/ })();
  2910. /******/
  2911. /******/ /* webpack/runtime/define property getters */
  2912. /******/ (() => {
  2913. /******/ // define getter functions for harmony exports
  2914. /******/ __webpack_require__.d = (exports, definition) => {
  2915. /******/ for(var key in definition) {
  2916. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  2917. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  2918. /******/ }
  2919. /******/ }
  2920. /******/ };
  2921. /******/ })();
  2922. /******/
  2923. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  2924. /******/ (() => {
  2925. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  2926. /******/ })();
  2927. /******/
  2928. /******/ /* webpack/runtime/make namespace object */
  2929. /******/ (() => {
  2930. /******/ // define __esModule on exports
  2931. /******/ __webpack_require__.r = (exports) => {
  2932. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  2933. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  2934. /******/ }
  2935. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  2936. /******/ };
  2937. /******/ })();
  2938. /******/
  2939. /******/ /* webpack/runtime/nonce */
  2940. /******/ (() => {
  2941. /******/ __webpack_require__.nc = undefined;
  2942. /******/ })();
  2943. /******/
  2944. /************************************************************************/
  2945. /******/
  2946. /******/ // startup
  2947. /******/ // Load entry module and return exports
  2948. /******/ // This entry module is referenced by other modules so it can't be inlined
  2949. /******/ var __webpack_exports__ = __webpack_require__("./src/index.ts");
  2950. /******/
  2951. /******/ })()
  2952. ;