161 lines
958 KiB
JavaScript
161 lines
958 KiB
JavaScript
module.exports=function(e){function t(c){if(l[c])return l[c].exports;var I=l[c]={i:c,l:!1,exports:{}};return e[c].call(I.exports,I,I.exports,t),I.l=!0,I.exports}var l={};return t.m=e,t.c=l,t.d=function(e,l,c){t.o(e,l)||Object.defineProperty(e,l,{enumerable:!0,get:c})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,l){if(1&l&&(e=t(e)),8&l)return e;if(4&l&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(t.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&l&&"string"!=typeof e)for(var I in e)t.d(c,I,function(t){return e[t]}.bind(null,I));return c},t.n=function(e){var l=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(l,"a",l),l},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./src/index.js")}({"./src/0globals.js":/*!*************************!*\
|
|
!*** ./src/0globals.js ***!
|
|
\*************************/ /*! exports provided: minimumDiscordVersion, currentDiscordVersion, minSupportedVersion, bbdVersion, bbdChangelog, settings, defaultCookie, settingsCookie, settingsRPC, defaultRPC, bdpluginErrors, bdthemeErrors, bdConfig, bdthemes, bdplugins, pluginCookie, themeCookie */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"minimumDiscordVersion\", function() { return minimumDiscordVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"currentDiscordVersion\", function() { return currentDiscordVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"minSupportedVersion\", function() { return minSupportedVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bbdVersion\", function() { return bbdVersion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bbdChangelog\", function() { return bbdChangelog; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"settings\", function() { return settings; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultCookie\", function() { return defaultCookie; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"settingsCookie\", function() { return settingsCookie; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"settingsRPC\", function() { return settingsRPC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultRPC\", function() { return defaultRPC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bdpluginErrors\", function() { return bdpluginErrors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bdthemeErrors\", function() { return bdthemeErrors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bdConfig\", function() { return bdConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bdthemes\", function() { return bdthemes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bdplugins\", function() { return bdplugins; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pluginCookie\", function() { return pluginCookie; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"themeCookie\", function() { return themeCookie; });\n// var settingsPanel, voiceMode, pluginModule, themeModule, dMode, publicServersModule, mainCore, BDV2;\nconst minimumDiscordVersion = \"0.0.306\";\nconst currentDiscordVersion = window.DiscordNative && window.DiscordNative.remoteApp && window.DiscordNative.remoteApp.getVersion && window.DiscordNative.remoteApp.getVersion() || \"0.0.306\";\nconst minSupportedVersion = \"0.3.0\";\nconst bbdVersion = \"0.3.4\";\nconst bbdChangelog = {\n description: \"LightCord Edition.\",\n changes: [{\n title: \"What's New?\",\n items: [\"**LightCord** is now using BandagedBD. That means all plugins you were using can be used too !\", \"**Window Transparency** changes were made to more compatible with external window managers and addons like Glasscord.\", \"Initialization sequence has once again been changed slightly to hopefully improve loading times.\", \"We removed emotes. That's sad for people who were actually using it, but it was leading to more loading time and some basic words were emote.\"]\n }, {\n title: \"Bug Fixes\",\n type: \"fixed\",\n items: [\"Some fixes related to showing modals in the `BdApi`.\"]\n }]\n};\nconst settings = {\n \"Custom css live update\": {\n id: \"bda-css-0\",\n info: \"\",\n implemented: true,\n hidden: true,\n cat: \"core\"\n },\n \"Custom css auto udpate\": {\n id: \"bda-css-1\",\n info: \"\",\n implemented: true,\n hidden: true,\n cat: \"core\"\n },\n \"BetterDiscord Blue\": {\n id: \"bda-gs-b\",\n info: \"Replace Discord blue with BD Blue\",\n implemented: false,\n hidden: false,\n cat: \"core\"\n },\n\n /* Core */\n\n /* ====== */\n \"Public Servers\": {\n id: \"bda-gs-1\",\n info: \"Display public servers button\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n \"Minimal Mode\": {\n id: \"bda-gs-2\",\n info: \"Hide elements and reduce the size of elements.\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n \"Voice Mode\": {\n id: \"bda-gs-4\",\n info: \"Only show voice chat\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n \"Hide Channels\": {\n id: \"bda-gs-3\",\n info: \"Hide channels in minimal mode\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n \"Dark Mode\": {\n id: \"bda-gs-5\",\n info: \"Make certain elements dark by default(wip)\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n \"Voice Disconnect\": {\n id: \"bda-dc-0\",\n info: \"Disconnect from voice server when closing Discord\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n \"24 Hour Timestamps\": {\n id: \"bda-gs-6\",\n info: \"Replace 12hr timestamps with proper ones\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n \"Colored Text\": {\n id: \"bda-gs-7\",\n info: \"Make text color the same as role color\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n \"Normalize Classes\": {\n id: \"fork-ps-4\",\n info: \"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"modules\"\n },\n\n /* Content */\n \"Content Error Modal\": {\n id: \"fork-ps-1\",\n info: \"Shows a modal with plugin/theme errors\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"content manager\"\n },\n \"Show Toasts\": {\n id: \"fork-ps-2\",\n info: \"Shows a small notification for important information\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"content manager\"\n },\n \"Scroll To Settings\": {\n id: \"fork-ps-3\",\n info: \"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"content manager\"\n },\n \"Automatic Loading\": {\n id: \"fork-ps-5\",\n info: \"Automatically loads, reloads, and unloads plugins and themes\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"content manager\"\n },\n\n /* Developer */\n \"Developer Mode\": {\n id: \"bda-gs-8\",\n info: \"Developer Mode Toggle\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"developer settings\"\n },\n \"Copy Selector\": {\n id: \"fork-dm-1\",\n info: \"Adds a \\\"Copy Selector\\\" option to context menus when developer mode is active\",\n implemented: true,\n hidden: false,\n cat: \"core\",\n category: \"developer settings\"\n },\n \"React DevTools\": {\n id: \"reactDevTools\",\n info: \"Adds react developer tools to the devtools. Must be installed in Google Chrome on your pc.\",\n implemented: true,\n hidden: true,\n cat: \"core\",\n category: \"developer settings\"\n },\n\n /** LightCord */\n \"Disable BetterDiscord\": {\n id: \"bd-disable\",\n info: \"Disable Betterdiscord (plugins, themes, etc).\",\n implemented: false,\n hidden: false,\n cat: \"lightcord\",\n category: \"Lightcord\"\n },\n \"Calling Ring Beat\": {\n id: \"lightcord-2\",\n info: \"Enable Discord's special calling beat.\",\n implemented: true,\n hidden: false,\n cat: \"lightcord\",\n category: \"Lightcord\"\n },\n \"Developer Options\": {\n id: \"lightcord-1\",\n info: \"Enable Discord's Internal Developer Options. This allow the \\\"Experiments\\\" tab and the \\\"Developer Options\\\" tab. (must close and reopen settings)\",\n implemented: true,\n hidden: false,\n cat: \"lightcord\",\n category: \"Lightcord\"\n },\n \"Ad Block\": {\n id: \"lightcord-4\",\n info: \"Block any BOT that dm you with an invite link. Even in an embed.\",\n implemented: true,\n hidden: false,\n cat: \"lightcord\",\n category: \"Lightcord\"\n },\n\n /** Lightcord Window */\n \"Always-on-Top\": {\n id: \"lightcord-3\",\n info: \"Enable window's Always-on-Top mode, where Lightcord stays on top of other applications.\",\n implemented: true,\n hidden: false,\n cat: \"lightcord\",\n category: \"Window\"\n },\n\n /** RichPresence */\n \"Enable\": {\n id: \"lightcord-presence-1\",\n info: \"Enable RichPresence below.\",\n implemented: true,\n hidden: false,\n cat: \"status\"\n }\n};\nconst defaultCookie = {\n \"bda-gs-1\": true,\n \"bda-gs-2\": false,\n \"bda-gs-3\": false,\n \"bda-gs-4\": false,\n \"bda-gs-5\": true,\n \"bda-gs-6\": false,\n \"bda-gs-7\": false,\n \"bda-gs-8\": true,\n \"bda-es-0\": true,\n \"bda-es-1\": true,\n \"bda-es-2\": true,\n \"bda-es-4\": false,\n \"bda-es-6\": true,\n \"bda-es-7\": true,\n \"bda-gs-b\": false,\n \"bda-es-8\": true,\n \"bda-dc-0\": false,\n \"bda-css-0\": false,\n \"bda-css-1\": false,\n \"bda-es-9\": true,\n \"fork-dm-1\": false,\n \"fork-ps-1\": true,\n \"fork-ps-2\": true,\n \"fork-ps-3\": true,\n \"fork-ps-4\": true,\n \"fork-ps-5\": true,\n \"fork-es-2\": false,\n \"fork-es-3\": true,\n \"fork-wp-1\": false,\n \"fork-wp-2\": false,\n \"fork-beta\": true,\n \"reactDevTools\": false,\n \"lightcord-1\": false,\n \"lightcord-2\": true,\n \"lightcord-presence-1\": false,\n \"lightcord-3\": false,\n \"lightcord-4\": false\n};\nconst settingsCookie = {};\nconst settingsRPC = {};\nconst defaultRPC = {\n \"name\": \"Lightcord\",\n \"application_id\": \"711416957718757418\",\n \"state\": \"Lightcord Client\",\n \"details\": \"Browsing Discord\",\n \"timestamps.start\": Date.now(),\n \"assets.small\": null,\n \"assets.large\": \"712323821037682791\"\n};\nconst bdpluginErrors = [];\nconst bdthemeErrors = []; // define for backwards compatibility\n\nconst bdConfig = Object.create(BetterDiscordConfig);\nconst bdthemes = {};\nconst bdplugins = {};\nconst pluginCookie = {};\nconst themeCookie = {};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvMGdsb2JhbHMuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjLzBnbG9iYWxzLmpzPzAwZDIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gdmFyIHNldHRpbmdzUGFuZWwsIHZvaWNlTW9kZSwgcGx1Z2luTW9kdWxlLCB0aGVtZU1vZHVsZSwgZE1vZGUsIHB1YmxpY1NlcnZlcnNNb2R1bGUsIG1haW5Db3JlLCBCRFYyO1xuZXhwb3J0IGNvbnN0IG1pbmltdW1EaXNjb3JkVmVyc2lvbiA9IFwiMC4wLjMwNlwiO1xuZXhwb3J0IGNvbnN0IGN1cnJlbnREaXNjb3JkVmVyc2lvbiA9IHdpbmRvdy5EaXNjb3JkTmF0aXZlICYmIHdpbmRvdy5EaXNjb3JkTmF0aXZlLnJlbW90ZUFwcCAmJiB3aW5kb3cuRGlzY29yZE5hdGl2ZS5yZW1vdGVBcHAuZ2V0VmVyc2lvbiAmJiB3aW5kb3cuRGlzY29yZE5hdGl2ZS5yZW1vdGVBcHAuZ2V0VmVyc2lvbigpIHx8IFwiMC4wLjMwNlwiO1xuZXhwb3J0IGNvbnN0IG1pblN1cHBvcnR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
\**********************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CoreWrapper; });\n/* harmony import */ var _localStorageFix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./localStorageFix */ \"./src/localStorageFix.js\");\n/* harmony import */ var _loadingIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loadingIcon */ \"./src/loadingIcon.js\");\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_bdApi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/bdApi */ \"./src/modules/bdApi.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_pluginModule__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _modules_themeModule__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _modules_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modules/utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _modules_bdEvents__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modules/bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _modules_settingsPanel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modules/settingsPanel */ \"./src/modules/settingsPanel.js\");\n/* harmony import */ var _modules_dataStore__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modules/dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _modules_contentManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./modules/contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _modules_classNormalizer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modules/classNormalizer */ \"./src/modules/classNormalizer.js\");\n/* harmony import */ var _modules_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./modules/core */ \"./src/modules/core.js\");\n\n\nObject(_localStorageFix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])();\nObject(_loadingIcon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n\nconst deprecateGlobal = (key, value) => {\n // value = typeof(value) !== \"object\" ? value : new Proxy(value, {\n // get: function(obj, mod) {\n // if (!obj.hasOwnProperty(mod)) return undefined;\n // return obj[mod];\n // },\n // set: function(obj, mod) {\n // if (obj.hasOwnProperty(mod)) return Utils.err(\"Deprecated Global\", \"Trying to overwrite deprecated BD globals\");\n // }\n // });\n Object.defineProperty(window, key, {\n get() {\n _modules_utils__WEBPACK_IMPORTED_MODULE_7__[\"default\"].warn(\"Deprecated Global\", `\"${key}\" will be removed in future versions. Please only use BdApi.`);\n return value;\n }\n\n });\n};\n\n\nconst globalKeys = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_2__);\n\nfor (const key of globalKeys) deprecateGlobal(key, _0globals__WEBPACK_IMPORTED_MODULE_2__[key]);\n\n\n\n\n\n\n\n\n\n\n\ndeprecateGlobal(\"BDV2\", _modules_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\ndeprecateGlobal(\"pluginModule\", _modules_pluginModule__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\ndeprecateGlobal(\"themeModule\", _modules_themeModule__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\ndeprecateGlobal(\"Utils\", _modules_utils__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\ndeprecateGlobal(\"BDEvents\", _modules_bdEvents__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\ndeprecateGlobal(\"settingsPanel\", _modules_settingsPanel__WEBPACK_IMPORTED_MODULE_9__[\"default\"]);\ndeprecateGlobal(\"DataStore\", _modules_dataStore__WEBPACK_IMPORTED_MODULE_10__[\"default\"]);\ndeprecateGlobal(\"ContentManager\", _modules_contentManager__WEBPACK_IMPORTED_MODULE_11__[\"default\"]);\ndeprecateGlobal(\"ClassNormalizer\", _modules_classNormalizer__WEBPACK_IMPORTED_MODULE_12__[\"default\"]);\nwindow.BdApi = _modules_bdApi__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n\ndeprecateGlobal(\"mainCore\", _modules_core__WEBPACK_IMPORTED_MODULE_13__[\"default\"]);\nclass CoreWrapper {\n constructor(bdConfig) {\n _modules_core__WEBPACK_IMPORTED_MODULE_13__[\"default\"].setConfig(bdConfig);\n }\n\n init() {\n // deprecateGlobal(\"mainCore\", this.mainCore);\n _modules_core__WEBPACK_IMPORTED_MODULE_13__[\"default\"].init();\n }\n\n} // function patchModuleLoad() {\n// const namespace = \"betterdiscord\";\n// const prefix = `${namespace}/`;\n// const Module = require(\"module\");\n// const load = Module._load;\n// // const resolveFilename = Module._resolveFilename;\n// Module._load = function(request) {\n// if (request === namespace || request.startsWith(prefix)) {\n// const requested = request.substr(prefix.length);\n// if (requested == \"api\") return BdApi;\n// }\n// return load.apply(this, arguments);\n// };\n// // Module._resolveFilename = function (request, parent, isMain) {\n// // if (request === \"betterdiscord\" || request.startsWith(\"betterdiscord/\")) {\n// // const contentPath = PluginManager.getPluginPathByModule(parent);\n// // if (contentPath) return request;\n// // }\n// // return resolveFilename.apply(this, arguments);\n// // };\n// return function() {\n// Module._load = load;\n// };\n// }\n// patchModuleLoad();\n// var settingsPanel, voiceMode,, dMode, publicServersModule;\n// var bdConfig = null;\n\n__webpack_require__(/*! request */ \"request\"); // just in cache so plugin can require it too//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvaW5kZXguan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QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/index.js\n")},"./src/loadingIcon.js":/*!****************************!*\
|
|
!*** ./src/loadingIcon.js ***!
|
|
\****************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (() => {\n const v2Loader = document.createElement(\"div\");\n v2Loader.className = \"bd-loaderv2\";\n v2Loader.title = \"BandagedBD is loading...\";\n document.body.appendChild(v2Loader);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbG9hZGluZ0ljb24uanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL2xvYWRpbmdJY29uLmpzP2NlZGIiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgKCgpID0+IHtcbiAgY29uc3QgdjJMb2FkZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwiZGl2XCIpO1xuICB2MkxvYWRlci5jbGFzc05hbWUgPSBcImJkLWxvYWRlcnYyXCI7XG4gIHYyTG9hZGVyLnRpdGxlID0gXCJCYW5kYWdlZEJEIGlzIGxvYWRpbmcuLi5cIjtcbiAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZCh2MkxvYWRlcik7XG59KTsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/loadingIcon.js\n")},"./src/localStorageFix.js":/*!********************************!*\
|
|
!*** ./src/localStorageFix.js ***!
|
|
\********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n const contentWindowGetter = Object.getOwnPropertyDescriptor(HTMLIFrameElement.prototype, \"contentWindow\").get;\n Object.defineProperty(HTMLIFrameElement.prototype, \"contentWindow\", {\n get: function () {\n const contentWindow = Reflect.apply(contentWindowGetter, this, arguments);\n return new Proxy(contentWindow, {\n getOwnPropertyDescriptor: function (obj, prop) {\n if (prop === \"localStorage\") return undefined;\n return Object.getOwnPropertyDescriptor(obj, prop);\n },\n get: function (obj, prop) {\n if (prop === \"localStorage\") return null;\n const val = obj[prop];\n if (typeof val === \"function\") return val.bind(obj);\n return val;\n }\n });\n }\n }); // Prevent interception by patching Reflect.apply and Function.prototype.bind\n\n Object.defineProperty(Reflect, \"apply\", {\n value: Reflect.apply,\n writable: false,\n configurable: false\n });\n Object.defineProperty(Function.prototype, \"bind\", {\n value: Function.prototype.bind,\n writable: false,\n configurable: false\n });\n const oOpen = XMLHttpRequest.prototype.open;\n\n XMLHttpRequest.prototype.open = function () {\n const url = arguments[1];\n if (url.toLowerCase().includes(\"api/webhooks\")) return null;\n return Reflect.apply(oOpen, this, arguments);\n };\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbG9jYWxTdG9yYWdlRml4LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy9sb2NhbFN0b3JhZ2VGaXguanM/MTUzMyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiAoKSB7XG4gIGNvbnN0IGNvbnRlbnRXaW5kb3dHZXR0ZXIgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKEhUTUxJRnJhbWVFbGVtZW50LnByb3RvdHlwZSwgXCJjb250ZW50V2luZG93XCIpLmdldDtcbiAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEhUTUxJRnJhbWVFbGVtZW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uICB9KTtcbiAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEZ1bmN0aW9uLnByb3RvdHlwZSwgXCJiaW5kXCIsIHtcbiAgICB2YWx1ZTogRnVuY3Rpb24ucHJvdG90eXBlLmJpbmQsXG4gICAgd3JpdGFibGU6IGZhbHNlLFxuICAgIGNvbmZpZ3VyYWJsZTogZmFsc2VcbiAgfSk7XG4gIGNvbnN0IG9PcGVuID0gWE1MSHR0cFJlcXVlc3QucHJvdG90eXBlLm9wZW47XG5cbiAgWE1MSHR0cFJlcXVlc3QucHJvdG90eXBlLm9wZW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgY29uc3QgdXJsID0gYXJndW1lbnRzWzFdO1xuICAgIGlmICh1cmwudG9Mb3dlckNhc2UoKS5pbmNsdWRlcyhcImFwaS93ZWJob29rc1wiKSkgcmV0dXJuIG51bGw7XG4gICAgcmV0dXJuIFJlZmxlY3QuYXBwbHkob09wZW4sIHRoaXMsIGFyZ3VtZW50cyk7XG4gIH07XG59Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/localStorageFix.js\n")},"./src/modules/24hour.js":/*!*******************************!*\
|
|
!*** ./src/modules/24hour.js ***!
|
|
\*******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class TFHour {\n inject24Hour() {\n if (this.cancel24Hour) return;\n const twelveHour = new RegExp(`([0-9]{1,2}):([0-9]{1,2})\\\\s(AM|PM)`);\n\n const convert = data => {\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-6\"]) return;\n const matched = data.returnValue.match(twelveHour);\n if (!matched || matched.length !== 4) return;\n if (matched[3] === \"AM\") return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"00\" : matched[1].padStart(2, \"0\")}:${matched[2]}`);\n return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"12\" : parseInt(matched[1]) + 12}:${matched[2]}`);\n };\n\n const cancelCozy = _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].monkeyPatch(_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].TimeFormatter, \"calendarFormat\", {\n after: convert\n }); // Called in Cozy mode\n\n const cancelCompact = _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].monkeyPatch(_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].TimeFormatter, \"dateFormat\", {\n after: convert\n }); // Called in Compact mode\n\n this.cancel24Hour = () => {\n cancelCozy();\n cancelCompact();\n }; // Cancel both\n\n }\n\n remove24Hour() {\n if (this.cancel24Hour) this.cancel24Hour();\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy8yNGhvdXIuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s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./src/modules/AntiAdDM.js":/*!*********************************!*\
|
|
!*** ./src/modules/AntiAdDM.js ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\nconst dispatcher = window.Lightcord.DiscordModules.dispatcher;\nconst ChannelModule = BDModules.get(e => e.default && e.default.getChannel && e.default.hasChannel)[0].default;\nconst relationShipModule = BDModules.get(e => e.default && e.default.addRelationship)[0].default;\nconst DMModule = BDModules.get(e => e.default && e.default.closePrivateChannel)[0].default;\nconst blocked = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class AntiBotDM {\n constructor() {\n this.antiDM = this.antiDM.bind(this);\n this.enabled = false;\n }\n\n enable() {\n if (this.enabled) return;\n this.enabled = true;\n dispatcher.subscribe(\"MESSAGE_CREATE\", this.antiDM);\n }\n\n disable() {\n if (!this.enabled) return;\n this.enabled = false;\n dispatcher.unsubscribe(\"MESSAGE_CREATE\", this.antiDM);\n }\n\n antiDM(ev) {\n if (!ev.message.author.bot) return;\n if (ev.message.guild_id) return;\n const channel = ChannelModule.getChannel(ev.message.channel_id);\n if (!channel) return; // might be broken\n\n if (channel.type !== 1) return;\n if (blocked[ev.message.author.id]) return; // If the user unblock the bot, Don't block it again.\n\n if (scanMessage(ev.message)) {\n blocked[ev.message.author.id] = true;\n _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].showToast(`[AdBlock]: Blocked ${ev.message.author.username}#${ev.message.author.discriminator}`, {\n \"type\": \"warning\"\n });\n relationShipModule.addRelationship(ev.message.author.id, {\n location: \"ContextMenu\"\n }, 2);\n DMModule.closePrivateChannel(channel.id, false);\n }\n }\n\n}());\n\nfunction scanMessage(message) {\n if (/(discord\\.gg|discord\\.com\\/invite\\/|discordapp\\.com\\/invite\\/)/g.test(message.content)) return true;\n if (EmbedsContains(message, \"discord.gg/\") || EmbedsContains(message, \"discord.com/invite/\") || EmbedsContains(message, \"discordapp.com/invite/\")) return true;\n return false;\n}\n\nfunction EmbedsContains(message, search) {\n let embeds = message.embeds;\n if (embeds.length === 0) return false;\n return embeds.map(embed => {\n if (embed.type !== \"rich\") return false;\n if ((embed.title || \"\").includes(search)) return true;\n if ((embed.description || \"\").includes(search)) return true;\n if (((embed.footer || \"\") && embed.footer.text || \"\").includes(search)) return true;\n if (embed.fields.map(e => {\n return e.value.includes(search) || e.name.includes(search);\n }).includes(true)) return true;\n return false;\n }).includes(true);\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9BbnRpQWRETS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy9BbnRpQWRETS5qcz85ODhiIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBVdGlscyBmcm9tIFwiLi91dGlsc1wiO1xuY29uc3QgZGlzcGF0Y2hlciA9IHdpbmRvdy5MaWdodGNvcmQuRGlzY29yZE1vZHVsZXMuZGlzcGF0Y2hlcjtcbmNvbnN0IENoYW5uZWxNb2R1bGUgPSBCRE1vZHVsZXMuZ2V0KGUgPT4gZS5kZWZhdWx0ICYmIGUuZGVmYXVsdC5nZXRDaGFubmVsICYmIGUuZGVmYXVsdC5oYXNDaGFubmVsKVswXS5kZWZhdWx0O1xuY29uc3QgcmVsYXRpb25TaGlwTW9kdWxlID0gQkRNb2R1bGVzLmdldChlID0+IGUuZGVmYXVsdCAmJiBlLmRlZmF1bHQuYWRkUmVsYXRpb25zaGlwKVswXS5kZWZhdWx0O1xuY29uc3QgRE1Nb2R1bGUgPSBCRE1vZHVsZXMuZ2V0KGUgPT4gZS5kZWZhdWx0ICYmIGUuZGVmYXVsdC5jbG9zZVByaXZhdGVDaGFubmVsKVswXS5kZWZh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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/AntiAdDM.js\n")},"./src/modules/CustomRichPresence.js":/*!*******************************************!*\
|
|
!*** ./src/modules/CustomRichPresence.js ***!
|
|
\*******************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\nconst dispatcher = BDModules.get(m => m.Dispatcher && m.default && m.default.dispatch)[0].default;\nconst ActionTypes = BDModules.get(m => m.ActionTypes)[0].ActionTypes;\nconst socketId = \"lightcord-spoof-socket\";\nconst pid = process.pid;\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class CustomRichPresence {\n constructor() {\n this.enabled = false;\n this.game = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsRPC\"];\n }\n\n get formatedGame() {\n if (!this.game) return null;\n if (this.enabled === false) return null;\n let game = {\n name: this.game.name || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"defaultRPC\"].name,\n application_id: this.game.application_id || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"defaultRPC\"].application_id,\n details: this.game.details || undefined,\n state: this.game.state || undefined,\n timestamps: this.game[\"timestamps.start\"] ? {\n start: this.game[\"timestamps.start\"]\n } : undefined,\n assets: this.game[\"assets.large\"] ? {\n large_image: this.game[\"assets.large\"],\n small_image: this.game[\"assets.small\"] || undefined\n } : undefined\n };\n return game;\n }\n\n sendGame() {\n dispatcher.dispatch({\n type: ActionTypes.LOCAL_ACTIVITY_UPDATE,\n socketId,\n pid,\n activity: this.formatedGame\n });\n }\n\n enable() {\n if (this.enabled) return;\n this.enabled = true;\n console.log(\"Enabling custom RichPresence\");\n this.set(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsRPC\"] || Object.create(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"defaultRPC\"]));\n this.sendGame();\n }\n\n disable() {\n if (!this.enabled) return;\n this.enabled = false;\n console.log(\"Disabling custom RichPresence\");\n this.sendGame();\n }\n\n async fetchAssets(applicationId) {\n let assets = await BDModules.get(e => e.getAssets)[0].getAssets(applicationId);\n\n if (assets.undefined && typeof assets.undefined === \"number\") {\n throw new Error(\"Unknown Application\");\n }\n\n return assets;\n }\n\n set(activity) {\n this.game = activity;\n this.sendGame();\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9DdXN0b21SaWNoUHJlc2VuY2UuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL21vZHVsZXMvQ3VzdG9tUmljaFByZXNlbmNlLmpzPzE4MzUiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc2V0dGluZ3NDb29raWUsIHNldHRpbmdzUlBDLCBkZWZhdWx0UlBDIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi92MlwiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5jb25zdCBkaXNwYXRjaGVyID0gQkRNb2R1bGVzLmdldChtID0+IG0uRGlzcGF0Y2hlciAmJiBtLm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4gZS5nZXRBc3NldHMpWzBdLmdldEFzc2V0cyhhcHBsaWNhdGlvbklkKTtcblxuICAgIGlmIChhc3NldHMudW5kZWZpbmVkICYmIHR5cGVvZiBhc3NldHMudW5kZWZpbmVkID09PSBcIm51bWJlclwiKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoXCJVbmtub3duIEFwcGxpY2F0aW9uXCIpO1xuICAgIH1cblxuICAgIHJldHVybiBhc3NldHM7XG4gIH1cblxuICBzZXQoYWN0aXZpdHkpIHtcbiAgICB0aGlzLmdhbWUgPSBhY3Rpdml0eTtcbiAgICB0aGlzLnNlbmRHYW1lKCk7XG4gIH1cblxufSgpOyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/CustomRichPresence.js\n")},"./src/modules/bdApi.js":/*!******************************!*\
|
|
!*** ./src/modules/bdApi.js ***!
|
|
\******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core */ \"./src/modules/core.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _pluginModule__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _themeModule__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _settingsPanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./settingsPanel */ \"./src/modules/settingsPanel.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n\n\n\n\n\n\n\n\n\nconst BdApi = {\n get React() {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].React;\n },\n\n get ReactDOM() {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ReactDom;\n },\n\n get ReactComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ReactComponent;\n },\n\n get WindowConfigFile() {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].WindowConfigFile;\n },\n\n get settings() {\n return _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"];\n },\n\n get emotes() {\n return {};\n },\n\n // deprecated, deleted all emotes from betterdiscord.\n get screenWidth() {\n return Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n },\n\n get screenHeight() {\n return Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n }\n\n};\n\nBdApi.getAllWindowPreferences = function () {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getAllWindowPreferences();\n};\n\nBdApi.getWindowPreference = function (key) {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getWindowPreference(key);\n};\n\nBdApi.setWindowPreference = function (key, value) {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setWindowPreference(key, value);\n}; //Inject CSS to document head\n//id = id of element\n//css = custom css\n\n\nBdApi.injectCSS = function (id, css) {\n _domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].addStyle(_domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].escapeID(id), css);\n}; //Clear css/remove any element\n//id = id of element\n\n\nBdApi.clearCSS = function (id) {\n _domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].removeStyle(_domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].escapeID(id));\n}; //Inject CSS to document head\n//id = id of element\n//css = custom css\n\n\nBdApi.linkJS = function (id, url) {\n _domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].addScript(_domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].escapeID(id), url);\n}; //Clear css/remove any element\n//id = id of element\n\n\nBdApi.unlinkJS = function (id) {\n _domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].removeScript(_domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].escapeID(id));\n}; //Get another plugin\n//name = name of plugin\n\n\nBdApi.getPlugin = function (name) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"].hasOwnProperty(name)) {\n return _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][name].plugin;\n }\n\n return null;\n}; //Get BetterDiscord Core\n\n\nBdApi.getCore = function () {\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].warn(\"Deprecation Notice\", `BdApi.getCore() will be removed in future versions.`);\n return _core__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n};\n/**\r\n * Shows a generic but very customizable modal.\r\n * @param {string} title - title of the modal\r\n * @param {string} content - a string of text to display in the modal\r\n */\n\n\nBdApi.alert = function (title, content) {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].showConfirmationModal(title, content, {\n cancelText: null\n });\n};\n/**\r\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\r\n * @param {string} title - title of the modal\r\n * @param {(string|ReactElement|Array<string|ReactElement>)} children - a single or mixed array of react elements and strings. Every string is wrapped in Discord's `Markdown` component so strings will show and render properly.\r\n * @param {object} [options] - options to modify the modal\r\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\r\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\r\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\r\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\r\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\r\n * @param {string} [options.key] - key used to identify the modal. If not provided, one is generated and returned\r\n * @returns {string} - the key used for this modal\r\n */\n\n\nBdApi.showConfirmationModal = function (title, content, options = {}) {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].showConfirmationModal(title, content, options);\n}; //Show toast alert\n\n\nBdApi.showToast = function (content, options = {}) {\n _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].showToast(content, options);\n}; // Finds module\n\n\nBdApi.findModule = function (filter) {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].WebpackModules.find(filter);\n}; // Finds module\n\n\nBdApi.findAllModules = function (filter) {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].WebpackModules.findAll(filter);\n}; // Finds module\n\n\nBdApi.findModuleByProps = function (...props) {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].WebpackModules.findByUniqueProperties(props);\n};\n\nBdApi.findModuleByPrototypes = function (...protos) {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].WebpackModules.findByPrototypes(protos);\n};\n\nBdApi.findModuleByDisplayName = function (name) {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].WebpackModules.findByDisplayName(name);\n}; // Gets react instance\n\n\nBdApi.getInternalInstance = function (node) {\n if (!(node instanceof window.jQuery) && !(node instanceof Element)) return undefined;\n if (node instanceof jQuery) node = node[0];\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getInternalInstance(node);\n}; // Gets data\n\n\nBdApi.loadData = function (pluginName, key) {\n return _dataStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getPluginData(pluginName, key);\n};\n\nBdApi.getData = BdApi.loadData; // Sets data\n\nBdApi.saveData = function (pluginName, key, data) {\n return _dataStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].setPluginData(pluginName, key, data);\n};\n\nBdApi.setData = BdApi.saveData; // Deletes data\n\nBdApi.deleteData = function (pluginName, key) {\n return _dataStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].deletePluginData(pluginName, key);\n}; // Patches other functions\n\n\nBdApi.monkeyPatch = function (what, methodName, options) {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].monkeyPatch(what, methodName, options);\n}; // Event when element is removed\n\n\nBdApi.onRemoved = function (node, callback) {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].onRemoved(node, callback);\n}; // Wraps function in try..catch\n\n\nBdApi.suppressErrors = function (method, message) {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].suppressErrors(method, message);\n}; // Tests for valid JSON\n\n\nBdApi.testJSON = function (data) {\n return _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].testJSON(data);\n};\n\nBdApi.isPluginEnabled = function (name) {\n return !!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name];\n};\n\nBdApi.isThemeEnabled = function (name) {\n return !!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][name];\n};\n\nBdApi.isSettingEnabled = function (id) {\n return !!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][id];\n};\n\nBdApi.enableSetting = function (id) {\n return _settingsPanel__WEBPACK_IMPORTED_MODULE_7__[\"default\"].onChange(id, true);\n};\n\nBdApi.disableSetting = function (id) {\n return _settingsPanel__WEBPACK_IMPORTED_MODULE_7__[\"default\"].onChange(id, false);\n};\n\nBdApi.toggleSetting = function (id) {\n return _settingsPanel__WEBPACK_IMPORTED_MODULE_7__[\"default\"].onChange(id, !_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][id]);\n}; // Gets data\n\n\nBdApi.getBDData = function (key) {\n return _dataStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getBDData(key);\n}; // Sets data\n\n\nBdApi.setBDData = function (key, data) {\n return _dataStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].setBDData(key, data);\n};\n\nconst makeAddonAPI = (cookie, list, manager) => new class AddonAPI {\n get folder() {\n return manager.folder;\n }\n\n isEnabled(name) {\n return !!cookie[name];\n }\n\n enable(name) {\n return manager.enable(name);\n }\n\n disable(name) {\n return manager.disable(name);\n }\n\n toggle(name) {\n if (cookie[name]) this.disable(name);else this.enable(name);\n }\n\n reload(name) {\n return manager.reload(name);\n }\n\n get(name) {\n if (list.hasOwnProperty(name)) {\n if (list[name].plugin) return list[name].plugin;\n return list[name];\n }\n\n return null;\n }\n\n getAll() {\n return Object.keys(list).map(k => this.get(k)).filter(a => a);\n }\n\n}();\n\nBdApi.Plugins = makeAddonAPI(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"], _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"], _pluginModule__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nBdApi.Themes = makeAddonAPI(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"], _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"], _themeModule__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (BdApi);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9iZEFwaS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy9iZEFwaS5qcz9hOWEzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHBsdWdpbkNvb2tpZSwgdGhlbWVDb29raWUsIGJkcGx1Z2lucywgYmR0aGVtZXMsIHNldHRpbmdzQ29va2llLCBzZXR0aW5ncyB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IG1haW5Db3JlIGZyb20gXCIuL2NvcmVcIjtcbmltcG9ydCBVdGlscyBmcm9tIFwiLi91dGlsc1wiO1xuaW1wb3J0IEJEVjIgZnJvbSBcIi4vdjJcIjtcbmltcG9ydCBEYXRhU3RvcmUgZnJvbSBcIi4vZGF0YVN0b3JlXCI7XG5pbXBvcnQgcGx1Z2luTW9kdWxlIGZyb20gXCIuL3BsdWdpbk1vZHVsZVwiO1xuaW1wb3J0IHRoZW1lTW9kdWxlIGZyb20gXCIuL3RoZW1lTW9kdWxlXCI7XG5pbXBvcnQgc2V0dGluZ3NQYW5lbCBmcm9tIFwiLi9zZXR0aW5nc1BhbmVsXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuL2RvbXRvb2xzXCI7XG5jb25zdCBCZEFwaSA9IHtcbiAgZ2V0IFJlYWN0KCkge1xuICAgIHJldHVybiBCRFYyLlJlYWN0O1xuICB9LFxuXG4gIGdldCBSZWFjdERPTSgpIHtcbiAgICByZXR1cm4gQkRWMi5SZWF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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/bdApi.js\n")},"./src/modules/bdEvents.js":/*!*********************************!*\
|
|
!*** ./src/modules/bdEvents.js ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* BDEvents */\nconst EventEmitter = __webpack_require__(/*! events */ \"events\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class BDEvents extends EventEmitter {\n dispatch(eventName, ...args) {\n this.emit(eventName, ...args);\n }\n\n off(eventName, eventAction) {\n this.removeListener(eventName, eventAction);\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9iZEV2ZW50cy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy9iZEV2ZW50cy5qcz84ZjI1Il0sInNvdXJjZXNDb250ZW50IjpbIi8qIEJERXZlbnRzICovXG5jb25zdCBFdmVudEVtaXR0ZXIgPSByZXF1aXJlKFwiZXZlbnRzXCIpO1xuXG5leHBvcnQgZGVmYXVsdCBuZXcgY2xhc3MgQkRFdmVudHMgZXh0ZW5kcyBFdmVudEVtaXR0ZXIge1xuICBkaXNwYXRjaChldmVudE5hbWUsIC4uLmFyZ3MpIHtcbiAgICB0aGlzLmVtaXQoZXZlbnROYW1lLCAuLi5hcmdzKTtcbiAgfVxuXG4gIG9mZihldmVudE5hbWUsIGV2ZW50QWN0aW9uKSB7XG4gICAgdGhpcy5yZW1vdmVMaXN0ZW5lcihldmVudE5hbWUsIGV2ZW50QWN0aW9uKTtcbiAgfVxuXG59KCk7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/modules/bdEvents.js\n")},"./src/modules/classNormalizer.js":/*!****************************************!*\
|
|
!*** ./src/modules/classNormalizer.js ***!
|
|
\****************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _webpackModules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webpackModules */ \"./src/modules/webpackModules.js\");\n\nconst normalizedPrefix = \"da\";\nconst randClass = new RegExp(`^(?!${normalizedPrefix}-)((?:[A-Za-z]|[0-9]|-)+)-(?:[A-Za-z]|[0-9]|-|_){6}$`);\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class ClassNormalizer {\n stop() {\n if (!this.hasPatched) return;\n this.unpatchClassModules(_webpackModules__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findAll(this.moduleFilter.bind(this)));\n this.revertElement(document.querySelector(\"#app-mount\"));\n this.hasPatched = false;\n }\n\n start() {\n if (this.hasPatched) return;\n this.patchClassModules(_webpackModules__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findAll(this.moduleFilter.bind(this)));\n this.normalizeElement(document.querySelector(\"#app-mount\"));\n this.hasPatched = true;\n this.patchDOMMethods();\n }\n\n patchClassModules(modules) {\n for (const module of modules) {\n this.patchClassModule(normalizedPrefix, module);\n }\n }\n\n unpatchClassModules(modules) {\n for (const module of modules) {\n this.unpatchClassModule(normalizedPrefix, module);\n }\n }\n\n shouldIgnore(value) {\n if (!isNaN(value)) return true;\n if (value.endsWith(\"px\") || value.endsWith(\"ch\") || value.endsWith(\"em\") || value.endsWith(\"ms\")) return true;\n if (value.startsWith(\"layerContainer-\")) return true;\n if (value.startsWith(\"#\") && (value.length == 7 || value.length == 4)) return true;\n if (value.includes(\"calc(\") || value.includes(\"rgba\")) return true;\n return false;\n }\n\n moduleFilter(module) {\n if (typeof module !== \"object\" || Array.isArray(module)) return false;\n if (module.__esModule) return false;\n if (!Object.keys(module).length) return false;\n\n for (const baseClassName in module) {\n const value = module[baseClassName];\n if (typeof value !== \"string\") return false;\n if (this.shouldIgnore(value)) continue;\n if (value.split(\"-\").length === 1) return false;\n if (!randClass.test(value.split(\" \")[0])) return false;\n }\n\n return true;\n }\n\n patchClassModule(componentName, classNames) {\n for (const baseClassName in classNames) {\n const value = classNames[baseClassName];\n if (this.shouldIgnore(value)) continue;\n const classList = value.split(\" \");\n\n for (const normalClass of classList) {\n const match = normalClass.match(randClass);\n if (!match || !match.length || match.length < 2) continue; // Shouldn't ever happen since they passed the moduleFilter, but you never know\n\n const camelCase = match[1].split(\"-\").map((s, i) => i ? s[0].toUpperCase() + s.slice(1) : s).join(\"\");\n classNames[baseClassName] += ` ${componentName}-${camelCase}`;\n }\n }\n }\n\n unpatchClassModule(componentName, classNames) {\n for (const baseClassName in classNames) {\n const value = classNames[baseClassName];\n if (this.shouldIgnore(value)) continue;\n let newString = \"\";\n const classList = value.split(\" \");\n\n for (const normalClass of classList) {\n if (normalClass.startsWith(`${componentName}-`)) continue;\n newString += ` ${normalClass}`;\n }\n\n classNames[baseClassName] = newString.trim();\n }\n }\n\n normalizeElement(element) {\n if (!(element instanceof Element)) return;\n const classes = element.classList;\n\n for (let c = 0, clen = classes.length; c < clen; c++) {\n if (!randClass.test(classes[c])) continue;\n const match = classes[c].match(randClass)[1];\n const newClass = match.split(\"-\").map((s, i) => i ? s[0].toUpperCase() + s.slice(1) : s).join(\"\");\n element.classList.add(`${normalizedPrefix}-${newClass}`);\n }\n\n for (const child of element.children) this.normalizeElement(child);\n }\n\n revertElement(element) {\n if (!(element instanceof Element)) return;\n if (element.children && element.children.length) this.revertElement(element.children[0]);\n if (element.nextElementSibling) this.revertElement(element.nextElementSibling);\n const classes = element.classList;\n const toRemove = [];\n\n for (let c = 0; c < classes.length; c++) {\n if (classes[c].startsWith(`${normalizedPrefix}-`)) toRemove.push(classes[c]);\n }\n\n element.classList.remove(...toRemove);\n }\n\n patchDOMMethods() {\n const contains = DOMTokenList.prototype.contains;\n\n DOMTokenList.prototype.contains = function (token) {\n // const tokens = token.split(\" \");\n return Reflect.apply(contains, this, [token.split(\" \")[0]]); // return tokens.every(t => contains.call(this, t));\n };\n\n const add = DOMTokenList.prototype.add;\n\n DOMTokenList.prototype.add = function (...tokens) {\n for (let t = 0; t < tokens.length; t++) {\n tokens[t] = tokens[t].split(\" \")[0];\n }\n\n return Reflect.apply(add, this, tokens);\n };\n\n const remove = DOMTokenList.prototype.remove;\n\n DOMTokenList.prototype.remove = function (...tokens) {\n for (let t = 0; t < tokens.length; t++) {\n tokens[t] = tokens[t].split(\" \")[0];\n }\n\n return Reflect.apply(remove, this, tokens);\n };\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9jbGFzc05vcm1hbGl6ZXIuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/classNormalizer.js\n")},"./src/modules/coloredText.js":/*!************************************!*\
|
|
!*** ./src/modules/coloredText.js ***!
|
|
\************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class ColoredText {\n injectColoredText() {\n if (this.cancelColoredText) return;\n if (!_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MessageComponent) return;\n this.cancelColoredText = _utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].monkeyPatch(_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MessageComponent, \"default\", {\n before: data => {\n const props = data.methodArguments[0];\n if (!props || !props.childrenMessageContent) return;\n const messageContent = props.childrenMessageContent;\n if (!messageContent.type || !messageContent.type.type || messageContent.type.type.displayName != \"MessageContent\") return;\n const originalType = messageContent.type.type;\n if (originalType.__originalMethod) return; // Don't patch again\n\n messageContent.type.type = function (props) {\n const returnValue = originalType(props);\n const roleColor = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-7\"] ? props.message.colorString || \"\" : \"\";\n returnValue.props.style = {\n color: roleColor\n };\n return returnValue;\n };\n\n messageContent.type.type.__originalMethod = originalType;\n Object.assign(messageContent.type.type, originalType);\n }\n });\n }\n\n removeColoredText() {\n let classNameMarkup = BDModules.get(e => e.markup)[0].markup;\n document.querySelectorAll(\".\" + classNameMarkup.split(\" \")[0]).forEach(elem => {\n elem.style.setProperty(\"color\", \"\");\n });\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9jb2xvcmVkVGV4dC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy9jb2xvcmVkVGV4dC5qcz9lMjk3Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNldHRpbmdzQ29va2llIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi92MlwiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5leHBvcnQgZGVmYXVsdCBuZXcgY2xhc3MgQ29sb3JlZFRleHQge1xuICBpbmplY3RDb2xvcmVkVGV4dCgpIHtcbiAgICBpZiAodGhpcy5jYW5jZWxDb2xvcmVkVGV4dCkgcmV0dXJuO1xuICAgIGlmICghQkRWMi5NZXNzYWdlQ29tcG9uZW50KSByZXR1cm47XG4gICAgdGhpcy5jYW5jZWxDb2xvcmVkVGV4dCA9I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blZhbHVlO1xuICAgICAgICB9O1xuXG4gICAgICAgIG1lc3NhZ2VDb250ZW50LnR5cGUudHlwZS5fX29yaWdpbmFsTWV0aG9kID0gb3JpZ2luYWxUeXBlO1xuICAgICAgICBPYmplY3QuYXNzaWduKG1lc3NhZ2VDb250ZW50LnR5cGUudHlwZSwgb3JpZ2luYWxUeXBlKTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxuXG4gIHJlbW92ZUNvbG9yZWRUZXh0KCkge1xuICAgIGxldCBjbGFzc05hbWVNYXJrdXAgPSBCRE1vZHVsZXMuZ2V0KGUgPT4gZS5tYXJrdXApWzBdLm1hcmt1cDtcbiAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFwiLlwiICsgY2xhc3NOYW1lTWFya3VwLnNwbGl0KFwiIFwiKVswXSkuZm9yRWFjaChlbGVtID0+IHtcbiAgICAgIGVsZW0uc3R5bGUuc2V0UHJvcGVydHkoXCJjb2xvclwiLCBcIlwiKTtcbiAgICB9KTtcbiAgfVxuXG59KCk7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/coloredText.js\n")},"./src/modules/contentManager.js":/*!***************************************!*\
|
|
!*** ./src/modules/contentManager.js ***!
|
|
\***************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _pluginModule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _themeModule__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\nconst __non_webpack_require__ = window.require;\n\n\n\n\n\nconst path = __webpack_require__(/*! path */ \"path\");\n\nconst fs = __webpack_require__(/*! fs */ \"fs\");\n\nconst Module = __webpack_require__(/*! module */ \"module\").Module;\n\nModule.globalPaths.push(path.resolve(__webpack_require__(/*! electron */ \"electron\").remote.app.getAppPath(), \"node_modules\"));\n\nclass MetaError extends Error {\n constructor(message) {\n super(message);\n this.name = \"MetaError\";\n }\n\n}\n\nconst originalJSRequire = Module._extensions[\".js\"];\nconst originalCSSRequire = Module._extensions[\".css\"] ? Module._extensions[\".css\"] : () => {\n return null;\n};\nconst splitRegex = /[^\\S\\r\\n]*?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\nconst escapedAtRegex = /^\\\\@/;\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class ContentManager {\n constructor() {\n this.timeCache = {};\n this.watchers = {};\n Module._extensions[\".js\"] = this.getContentRequire(\"plugin\");\n Module._extensions[\".css\"] = this.getContentRequire(\"theme\");\n }\n\n get pluginsFolder() {\n return this._pluginsFolder || (this._pluginsFolder = fs.realpathSync(path.resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].dataPath + \"plugins/\")));\n }\n\n get themesFolder() {\n return this._themesFolder || (this._themesFolder = fs.realpathSync(path.resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].dataPath + \"themes/\")));\n }\n\n watchContent(contentType) {\n if (this.watchers[contentType]) return;\n const isPlugin = contentType === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n this.watchers[contentType] = fs.watch(baseFolder, {\n persistent: false\n }, async (eventType, filename) => {\n if (!eventType || !filename || !filename.endsWith(fileEnding)) return;\n await new Promise(r => setTimeout(r, 50));\n\n try {\n fs.statSync(path.resolve(baseFolder, filename));\n } catch (err) {\n if (err.code !== \"ENOENT\") return;\n delete this.timeCache[filename];\n if (isPlugin) return _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].unloadPlugin(filename);\n return _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].unloadTheme(filename);\n }\n\n if (!fs.statSync(path.resolve(baseFolder, filename)).isFile()) return;\n const stats = fs.statSync(path.resolve(baseFolder, filename));\n if (!stats || !stats.mtime || !stats.mtime.getTime()) return;\n if (typeof stats.mtime.getTime() !== \"number\") return;\n if (this.timeCache[filename] == stats.mtime.getTime()) return;\n this.timeCache[filename] = stats.mtime.getTime();\n\n if (eventType == \"rename\") {\n if (isPlugin) _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadPlugin(filename);else _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].loadTheme(filename);\n }\n\n if (eventType == \"change\") {\n if (isPlugin) _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reloadPlugin(filename);else _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reloadTheme(filename);\n }\n });\n }\n\n unwatchContent(contentType) {\n if (!this.watchers[contentType]) return;\n this.watchers[contentType].close();\n delete this.watchers[contentType];\n }\n\n extractMeta(content) {\n const firstLine = content.split(\"\\n\")[0];\n const hasOldMeta = firstLine.includes(\"//META\");\n if (hasOldMeta) return this.parseOldMeta(content);\n const hasNewMeta = firstLine.includes(\"/**\");\n if (hasNewMeta) return this.parseNewMeta(content);\n throw new MetaError(\"META was not found.\");\n }\n\n parseOldMeta(content) {\n const meta = content.split(\"\\n\")[0];\n const rawMeta = meta.substring(meta.lastIndexOf(\"//META\") + 6, meta.lastIndexOf(\"*//\"));\n if (meta.indexOf(\"META\") < 0) throw new MetaError(\"META was not found.\");\n const parsed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].testJSON(rawMeta);\n if (!parsed) throw new MetaError(\"META could not be parsed.\");\n if (!parsed.name) throw new MetaError(\"META missing name data.\");\n parsed.format = \"json\";\n return parsed;\n }\n\n parseNewMeta(content) {\n const block = content.split(\"/**\", 2)[1].split(\"*/\", 1)[0];\n const out = {};\n let field = \"\";\n let accum = \"\";\n\n for (const line of block.split(splitRegex)) {\n if (line.length === 0) continue;\n\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\n out[field] = accum;\n const l = line.indexOf(\" \");\n field = line.substr(1, l - 1);\n accum = line.substr(l + 1);\n } else {\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\n }\n }\n\n out[field] = accum.trim();\n delete out[\"\"];\n out.format = \"jsdoc\";\n return out;\n }\n\n getContentRequire(type) {\n const isPlugin = type === \"plugin\";\n const self = this;\n const originalRequire = isPlugin ? originalJSRequire : originalCSSRequire;\n return function (module, filename) {\n const baseFolder = isPlugin ? self.pluginsFolder : self.themesFolder;\n const possiblePath = path.resolve(baseFolder, path.basename(filename));\n if (!fs.existsSync(possiblePath) || filename !== fs.realpathSync(possiblePath)) return Reflect.apply(originalRequire, this, arguments);\n let content = fs.readFileSync(filename, \"utf8\");\n content = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].stripBOM(content);\n const stats = fs.statSync(filename);\n const meta = self.extractMeta(content);\n meta.filename = path.basename(filename);\n meta.added = stats.atimeMs;\n meta.modified = stats.mtimeMs;\n meta.size = stats.size;\n\n if (!isPlugin) {\n meta.css = content;\n if (meta.format == \"json\") meta.css = meta.css.split(\"\\n\").slice(1).join(\"\\n\");\n content = `module.exports = ${JSON.stringify(meta)};`;\n }\n\n if (isPlugin) {\n module._compile(content, module.filename);\n\n const didExport = !_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isEmpty(module.exports);\n\n if (didExport) {\n meta.type = module.exports;\n module.exports = meta;\n content = \"\";\n } else {\n // Utils.warn(\"Module Not Exported\", `${meta.name}, please start setting module.exports`);\n content += `\\nmodule.exports = ${JSON.stringify(meta)};\\nmodule.exports.type = ${meta.exports || meta.name};`;\n }\n }\n\n module._compile(content, filename);\n };\n }\n\n makePlaceholderPlugin(data) {\n return {\n plugin: {\n start: () => {},\n getName: () => {\n return data.name || data.filename;\n },\n getAuthor: () => {\n return \"???\";\n },\n getDescription: () => {\n return data.message ? data.message : \"This plugin was unable to be loaded. Check the author's page for updates.\";\n },\n getVersion: () => {\n return \"???\";\n }\n },\n name: data.name || data.filename,\n filename: data.filename,\n source: data.source ? data.source : \"\",\n website: data.website ? data.website : \"\"\n };\n }\n\n loadContent(filename, type) {\n if (typeof filename === \"undefined\" || typeof type === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n __non_webpack_require__(path.resolve(baseFolder, filename));\n } catch (error) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be compiled.\",\n error: {\n message: error.message,\n stack: error.stack\n }\n };\n }\n\n const content = __non_webpack_require__(path.resolve(baseFolder, filename));\n\n if (!content.name) return {\n name: filename,\n file: filename,\n message: \"Cannot escape the ID.\",\n error: {\n message: \"Cannot read property 'replace' of undefined\",\n stack: \"Cannot read property 'replace' of undefined\"\n }\n };\n content.id = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].escapeID(content.name);\n\n if (isPlugin) {\n if (!content.type) return;\n\n try {\n content.plugin = new content.type();\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][content.plugin.getName()];\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][content.plugin.getName()] = content;\n } catch (error) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be constructed.\",\n error: {\n message: error.message,\n stack: error.stack\n }\n };\n }\n } else {\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][content.name];\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][content.name] = content;\n }\n }\n\n unloadContent(filename, type) {\n if (typeof filename === \"undefined\" || typeof type === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n delete __non_webpack_require__.cache[__non_webpack_require__.resolve(path.resolve(baseFolder, filename))];\n } catch (err) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be unloaded.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n };\n }\n }\n\n isLoaded(filename, type) {\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n __non_webpack_require__.cache[__non_webpack_require__.resolve(path.resolve(baseFolder, filename))];\n } catch (err) {\n return false;\n }\n\n return true;\n }\n\n reloadContent(filename, type) {\n const cantUnload = this.unloadContent(filename, type);\n if (cantUnload) return cantUnload;\n return this.loadContent(filename, type);\n }\n\n loadNewContent(type) {\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const files = fs.readdirSync(basedir);\n const contentList = Object.values(isPlugin ? _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"] : _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]);\n const removed = contentList.filter(t => !files.includes(t.filename)).map(c => isPlugin ? c.plugin.getName() : c.name);\n const added = files.filter(f => !contentList.find(t => t.filename == f) && f.endsWith(fileEnding) && fs.statSync(path.resolve(basedir, f)).isFile());\n return {\n added,\n removed\n };\n }\n\n loadAllContent(type) {\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const errors = [];\n const files = fs.readdirSync(basedir);\n\n for (const filename of files) {\n if (!fs.statSync(path.resolve(basedir, filename)).isFile() || !filename.endsWith(fileEnding)) continue;\n const error = this.loadContent(filename, type);\n if (error) errors.push(error);\n }\n\n return errors;\n }\n\n loadPlugins() {\n return this.loadAllContent(\"plugin\");\n }\n\n loadThemes() {\n return this.loadAllContent(\"theme\");\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9jb250ZW50TWFuYWdlci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy9jb250ZW50TWFuYWdlci5qcz80ZWIwIl0sInNvdXJjZXNDb250ZW50IjpbImNvbnN0IF9fbm9uX3dlYnBhY2tfcmVxdWlyZV9fID0gd2luZG93LnJlcXVpcmU7XG5pbXBvcnQgeyBiZENvbmZpZywgYmRwbHVnaW5zLCBiZHRoZW1lcyB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IHBsdWdpbk1vZHVsZSBmcm9tIFwiLi9wbHVnaW5Nb2R1bGVcIjtcbmltcG9ydCB0aGVtZU1vZHVsZSBmcm9tIFwiLi90aGVtZU1vZHVsZVwiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5cbmNvbnN0IHBhdGggPSByZXF1aXJlKFwicGF0aFwiKTtcblxuY29uc3QgZnMgPSByZXF1aXJlKFwiZnNcIik7XG5cbmNvbnN0IE1vZHVsZSA9IHJlcXVpcmUoXCJtb2R1bGVcIikuTW9kdWxlO1xuXG5Nb2R1bGUuZ2xvYmFsUGF0aHMucHVzaChwYXRoLnJlc29sdmUocmVxdWlyZShcImVsZWN0cm9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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/modules/contentManager.js\n")},"./src/modules/core.js":/*!*****************************!*\
|
|
!*** ./src/modules/core.js ***!
|
|
\*****************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _settingsPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./settingsPanel */ \"./src/modules/settingsPanel.js\");\n/* harmony import */ var _pluginModule__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _themeModule__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _webpackModules__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./webpackModules */ \"./src/modules/webpackModules.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _ui_bdLogo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../ui/bdLogo */ \"./src/ui/bdLogo.js\");\n/* harmony import */ var _ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../ui/tooltipWrap */ \"./src/ui/tooltipWrap.js\");\n/* harmony import */ var _svg_lightcord__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../svg/lightcord */ \"./src/svg/lightcord.jsx\");\n/* harmony import */ var _pluginCertifier__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./pluginCertifier */ \"./src/modules/pluginCertifier.js\");\n/* harmony import */ var _distant__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./distant */ \"./src/modules/distant.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction Core() {// Object.assign(bdConfig, __non_webpack_require__(DataStore.configFile));\n // this.init();\n}\n\nCore.prototype.setConfig = function (config) {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"], config);\n};\n\nCore.prototype.init = async function () {\n if (!Array.prototype.flat) {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].alert(\"Not Supported\", \"BetterDiscord v\" + _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdVersion\"] + \" does not support this old version (\" + _0globals__WEBPACK_IMPORTED_MODULE_0__[\"currentDiscordVersion\"] + \") of Discord. Please update your Discord installation before proceeding.\");\n return;\n }\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].version < _0globals__WEBPACK_IMPORTED_MODULE_0__[\"minSupportedVersion\"]) {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].alert(\"Not Supported\", \"BetterDiscord v\" + _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].version + \" (your version)\" + \" is not supported by the latest js (\" + _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdVersion\"] + \").<br><br> Please download the latest version from <a href='https://github.com/rauenzi/BetterDiscordApp/releases/latest' target='_blank'>GitHub</a>\");\n return;\n }\n\n if (window.ED) {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].alert(\"Not Supported\", \"BandagedBD does not work with EnhancedDiscord. Please uninstall one of them.\");\n return;\n }\n\n if (window.WebSocket && window.WebSocket.name && window.WebSocket.name.includes(\"Patched\")) {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].alert(\"Not Supported\", \"BandagedBD does not work with Powercord. Please uninstall one of them.\");\n return;\n }\n\n const latestLocalVersion = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].updater ? _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].updater.LatestVersion : _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].latestVersion;\n\n if (latestLocalVersion > _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].version) {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].showConfirmationModal(\"Update Available\", [`There is an update available for BandagedBD's Injector (${latestLocalVersion}).`, \"You can either update and restart now, or later.\"], {\n confirmText: \"Update Now\",\n cancelText: \"Maybe Later\",\n onConfirm: async () => {\n const onUpdateFailed = () => {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].alert(\"Could Not Update\", `Unable to update automatically, please download the installer and reinstall normally.<br /><br /><a href='https://github.com/rauenzi/BetterDiscordApp/releases/latest' target='_blank'>Download Installer</a>`);\n };\n\n try {\n const didUpdate = await this.updateInjector();\n if (!didUpdate) return onUpdateFailed();\n\n const app = __webpack_require__(/*! electron */ \"electron\").remote.app;\n\n app.relaunch();\n app.exit();\n } catch (err) {\n onUpdateFailed();\n }\n }\n });\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"Startup\", \"Initializing Settings\");\n this.initSettings();\n await this.checkForGuilds();\n _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].initialize();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"Startup\", \"Updating Settings\");\n _settingsPanel__WEBPACK_IMPORTED_MODULE_3__[\"default\"].initializeSettings();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"Startup\", \"Loading Plugins\");\n _pluginModule__WEBPACK_IMPORTED_MODULE_4__[\"default\"].loadPlugins();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"Startup\", \"Loading Themes\");\n _themeModule__WEBPACK_IMPORTED_MODULE_5__[\"default\"].loadThemes();\n _domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].addStyle(\"customcss\", atob(_dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getBDData(\"bdcustomcss\")));\n window.addEventListener(\"beforeunload\", function () {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-dc-0\"]) document.querySelector(\".btn.btn-disconnect\").click();\n });\n new _pluginCertifier__WEBPACK_IMPORTED_MODULE_12__[\"default\"]().start();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"Startup\", \"Removing Loading Icon\");\n if (document.getElementsByClassName(\"bd-loaderv2\").length) document.getElementsByClassName(\"bd-loaderv2\")[0].remove();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"Startup\", \"Initializing Main Observer\");\n this.initObserver(); // Show loading errors\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"Startup\", \"Collecting Startup Errors\");\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].showContentErrors({\n plugins: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"],\n themes: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemeErrors\"]\n });\n }\n\n const previousVersion = _dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getBDData(\"version\");\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdVersion\"] > previousVersion) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdChangelog\"]) this.showChangelogModal(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdChangelog\"]);\n _dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].setBDData(\"version\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdVersion\"]);\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].suppressErrors(this.patchSocial.bind(this), \"BD Social Patch\")();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].suppressErrors(this.patchGuildPills.bind(this), \"BD Guild Pills Patch\")();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].suppressErrors(this.patchGuildListItems.bind(this), \"BD Guild List Items Patch\")();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].suppressErrors(this.patchGuildSeparator.bind(this), \"BD Guild Separator Patch\")();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].suppressErrors(this.patchMessageHeader.bind(this), \"BD Badge Chat Patch\")();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].suppressErrors(this.patchMemberList.bind(this), \"BD Badge Member List Patch\")();\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].haveInstalledDefault) {\n let alert = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].alert(\"First Installation\", \"As it is the first time you install Lightcord, We added two default themes and one default plugin in your plugin/theme folder. Check it in the Plugin/Theme settings.\");\n await new Promise(resolve => {\n alert.onClose(resolve);\n });\n }\n};\n\nCore.prototype.checkForGuilds = function () {\n let timesChecked = 0;\n return new Promise(resolve => {\n const checkForGuilds = function () {\n const wrapper = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].guildClasses.wrapper.split(\" \")[0];\n if (document.querySelectorAll(`.${wrapper}`).length > 0) timesChecked++;\n const guild = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].guildClasses.listItem.split(\" \")[0];\n const blob = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].guildClasses.blobContainer.split(\" \")[0];\n if (document.querySelectorAll(`.${wrapper} .${guild} .${blob}`).length > 0) return resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].deferLoaded = true);else if (timesChecked >= 50) return resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].deferLoaded = true);\n setTimeout(checkForGuilds, 100);\n };\n\n if (document.readyState != \"loading\") setTimeout(checkForGuilds, 100);\n document.addEventListener(\"DOMContentLoaded\", () => {\n setTimeout(checkForGuilds, 100);\n });\n });\n};\n\nCore.prototype.injectExternals = async function () {\n await _domtools__WEBPACK_IMPORTED_MODULE_8__[\"default\"].addScript(\"ace-script\", \"https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js\");\n if (window.require.original) window.require = window.require.original;\n};\n\nCore.prototype.initSettings = function () {\n _dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].initialize();\n\n if (!_dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getSettingGroup(\"settings\") && !_dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getSettingGroup(\"rpc\")) {\n if (!_dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getSettingGroup(\"settings\")) {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"], _0globals__WEBPACK_IMPORTED_MODULE_0__[\"defaultCookie\"]);\n }\n\n if (!_dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getSettingGroup(\"rpc\")) {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsRPC\"], _0globals__WEBPACK_IMPORTED_MODULE_0__[\"defaultRPC\"]);\n }\n\n _settingsPanel__WEBPACK_IMPORTED_MODULE_3__[\"default\"].saveSettings();\n } else {\n _settingsPanel__WEBPACK_IMPORTED_MODULE_3__[\"default\"].loadSettings();\n\n for (const setting in _0globals__WEBPACK_IMPORTED_MODULE_0__[\"defaultCookie\"]) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][setting] == undefined) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][setting] = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"defaultCookie\"][setting];\n _settingsPanel__WEBPACK_IMPORTED_MODULE_3__[\"default\"].saveSettings();\n }\n }\n }\n};\n\nCore.prototype.initObserver = function () {\n const mainObserver = new MutationObserver(mutations => {\n for (let i = 0, mlen = mutations.length; i < mlen; i++) {\n const mutation = mutations[i];\n if (typeof _pluginModule__WEBPACK_IMPORTED_MODULE_4__[\"default\"] !== \"undefined\") _pluginModule__WEBPACK_IMPORTED_MODULE_4__[\"default\"].rawObserver(mutation); // if there was nothing added, skip\n\n if (!mutation.addedNodes.length || !(mutation.addedNodes[0] instanceof Element)) continue;\n const node = mutation.addedNodes[0];\n let [classNameLayer, classNameSocialLinks] = [BDModules.get(e => e.layer && typeof e.layer === \"string\" && e.animating)[0].layer, BDModules.get(e => e.socialLinks && typeof e.socialLinks === \"string\")[0].socialLinks];\n\n if (node.classList.contains(classNameLayer)) {\n if (node.getElementsByClassName(\"guild-settings-base-section\").length) node.setAttribute(\"layer-id\", \"server-settings\");\n\n if (node.getElementsByClassName(classNameSocialLinks).length) {\n node.setAttribute(\"layer-id\", \"user-settings\");\n node.setAttribute(\"id\", \"user-settings\");\n if (!document.getElementById(\"bd-settings-sidebar\")) _settingsPanel__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderSidebar();\n }\n }\n\n if (node.parentElement == document.body && node.querySelector(\"#ace_settingsmenu\")) node.id = \"ace_settingsmenu_container\"; // Emoji Picker\n //node.getElementsByClassName(\"emojiPicker-3m1S-j\").length && !node.querySelector(\".emojiPicker-3m1S-j\").parentElement.classList.contains(\"animatorLeft-1EQxU0\")\n //if (node.classList.contains(classNameLayer2) && node.getElementsByClassName(classNameEmojiPicker).length && !node.querySelector(\".\"+classNameEmojiPicker).parentElement.classList.contains(classNameAnimatorLeft)) quickEmoteMenu.obsCallback(node);\n }\n });\n mainObserver.observe(document, {\n childList: true,\n subtree: true\n });\n};\n\nCore.prototype.showChangelogModal = function (options = {}) {\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].showChangelogModal(options);\n};\n\nCore.prototype.alert = function (title, content) {\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].alert(title, content);\n};\n\nCore.prototype.patchSocial = function () {\n if (this.socialPatch) return;\n const TabBar = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].find(m => m.displayName == \"TabBar\");\n const Anchor = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].find(m => m.displayName == \"Anchor\");\n if (!TabBar) return;\n this.socialPatch = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].monkeyPatch(TabBar.prototype, \"render\", {\n after: data => {\n const children = data.returnValue.props.children;\n if (!children || !children.length || children.length < 3) return;\n if (children[children.length - 3].type.displayName !== \"Separator\") return;\n if (!children[children.length - 2].type.toString().includes(\"socialLinks\")) return;\n\n if (Anchor) {\n let socialModule1 = BDModules.get(e => e.socialLinks)[0];\n const original = children[children.length - 2].type;\n\n const newOne = function () {\n const returnVal = original(...arguments);\n returnVal.props.children.push(_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"Lightcord\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(Anchor, {\n className: \"bd-social-link \" + socialModule1.link,\n href: \"https://github.com/Lightcord/Lightcord\",\n title: \"Lightcord\",\n target: \"_blank\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_svg_lightcord__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n size: \"16px\",\n className: \"bd-social-logo\"\n }))));\n returnVal.props.children.push(_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"BandagedBD\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(Anchor, {\n className: \"bd-social-link \" + socialModule1.link,\n href: \"https://github.com/rauenzi/BetterDiscordApp\",\n title: \"BandagedBD\",\n target: \"_blank\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_bdLogo__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n size: \"16px\",\n className: \"bd-social-logo\"\n }))));\n return returnVal;\n };\n\n children[children.length - 2].type = newOne;\n }\n\n let [classNameColorMuted, sizes, classNameVersionHash] = [BDModules.get(e => e.colorMuted)[0].colorMuted, BDModules.get(e => e.size32)[0], BDModules.get(e => e.versionHash)[0].versionHash];\n const injector = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n className: `${classNameColorMuted} ${sizes.size12}`\n }, `Injector ${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].version}`);\n const versionHash = `(${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].hash ? _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].hash.substring(0, 7) : _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].branch})`;\n const additional = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n className: `${classNameColorMuted} ${sizes.size12}`\n }, `BBD ${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdVersion\"]} `, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"span\", {\n className: classNameVersionHash + \" da-versionHash\"\n }, versionHash));\n const originalVersions = children[children.length - 1].type;\n\n children[children.length - 1].type = function () {\n const returnVal = originalVersions(...arguments);\n returnVal.props.children.splice(returnVal.props.children.length - 1, 0, injector);\n returnVal.props.children.splice(1, 0, additional);\n return returnVal;\n };\n }\n });\n};\n\nconst getGuildClasses = function () {\n const guildsWrapper = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].findByProps(\"wrapper\", \"unreadMentionsBar\");\n const guilds = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].findByProps(\"guildsError\", \"selected\");\n const pill = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].findByProps(\"blobContainer\");\n return Object.assign({}, guildsWrapper, guilds, pill);\n};\n\nCore.prototype.patchGuildListItems = function () {\n if (this.guildListItemsPatch) return;\n const GuildClasses = getGuildClasses();\n const listItemClass = GuildClasses.listItem.split(\" \")[0];\n const blobClass = GuildClasses.blobContainer.split(\" \")[0];\n const reactInstance = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getInternalInstance(document.querySelector(`.${listItemClass} .${blobClass}`).parentElement);\n const GuildComponent = reactInstance.return.type;\n if (!GuildComponent) return;\n this.guildListItemsPatch = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].monkeyPatch(GuildComponent.prototype, \"render\", {\n after: data => {\n if (data.returnValue && data.thisObject) {\n const returnValue = data.returnValue;\n const guildData = data.thisObject.props;\n returnValue.props.className += \" bd-guild\";\n if (guildData.unread) returnValue.props.className += \" bd-unread\";\n if (guildData.selected) returnValue.props.className += \" bd-selected\";\n if (guildData.audio) returnValue.props.className += \" bd-audio\";\n if (guildData.video) returnValue.props.className += \" bd-video\";\n if (guildData.badge) returnValue.props.className += \" bd-badge\";\n if (guildData.animatable) returnValue.props.className += \" bd-animatable\";\n return returnValue;\n }\n }\n });\n};\n\nCore.prototype.patchGuildPills = function () {\n if (this.guildPillPatch) return;\n const guildPill = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].find(m => m.default && !m.default.displayName && m.default.toString && m.default.toString().includes(\"translate3d\"));\n if (!guildPill) return;\n this.guildPillPatch = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].monkeyPatch(guildPill, \"default\", {\n after: data => {\n const props = data.methodArguments[0];\n if (props.unread) data.returnValue.props.className += \" bd-unread\";\n if (props.selected) data.returnValue.props.className += \" bd-selected\";\n if (props.hovered) data.returnValue.props.className += \" bd-hovered\";\n return data.returnValue;\n }\n });\n};\n\nCore.prototype.patchGuildSeparator = function () {\n if (this.guildSeparatorPatch) return;\n const Guilds = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].findByDisplayName(\"Guilds\");\n const guildComponents = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].findByProps(\"renderListItem\");\n if (!guildComponents || !Guilds) return;\n\n const GuildSeparator = function () {\n const returnValue = guildComponents.Separator(...arguments);\n returnValue.props.className += \" bd-guild-separator\";\n return returnValue;\n };\n\n this.guildSeparatorPatch = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].monkeyPatch(Guilds.prototype, \"render\", {\n after: data => {\n data.returnValue.props.children[1].props.children[3].type = GuildSeparator;\n }\n });\n};\n\nCore.prototype.patchMessageHeader = function () {\n if (this.messageHeaderPatch) return;\n const MessageHeader = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].findByProps(\"MessageTimestamp\");\n const Anchor = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].find(m => m.displayName == \"Anchor\");\n if (!Anchor || !MessageHeader || !MessageHeader.default) return;\n this.messageHeaderPatch = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].monkeyPatch(MessageHeader, \"default\", {\n after: data => {\n const author = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getNestedProp(data.methodArguments[0], \"message.author\"); // const header = Utils.getNestedProp(data.returnValue, \"props.children.1.props\");\n\n const children = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getNestedProp(data.returnValue, \"props.children.1.props.children.1.props.children\");\n if (!children || !author || !author.id) return; // if (header && header.className) header.className += \" \"\n\n if (!Array.isArray(children)) return;\n\n if (author.id === \"249746236008169473\") {\n // Rauenzi: BandagedBD Developer\n children.push(_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"BandagedBD Developer\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(Anchor, {\n className: \"bd-chat-badge\",\n href: \"https://github.com/rauenzi/BetterDiscordApp\",\n title: \"BandagedBD\",\n target: \"_blank\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_bdLogo__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n size: \"16px\",\n className: \"bd-logo\"\n }))));\n } else if (author.id === \"696481194443014174\" || author.id === \"696003456611385396\") {\n // Not Thomiz: Lightcord Developer, Phorcys: Lightcord Developer\n children.push(_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"Lightcord Developer\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(Anchor, {\n className: \"bd-chat-badge\",\n href: \"https://github.com/Lightcord/Lightcord\",\n title: \"Lightcord\",\n target: \"_blank\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_svg_lightcord__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n size: \"16px\",\n className: \"bd-logo\"\n }))));\n }\n\n const id = Object(_distant__WEBPACK_IMPORTED_MODULE_13__[\"uuidv4\"])();\n children.push(_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(\"div\", {\n id: \"badges-\" + id,\n style: {\n display: \"inline\"\n }\n }));\n applyBadges(id, author, true);\n }\n });\n};\n\nfunction applyBadges(id, user, chat) {\n process.nextTick(() => {\n const div = document.getElementById(\"badges-\" + id);\n if (!div || div.childNodes.length > 0) return;\n const Anchor = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].find(m => m.displayName == \"Anchor\");\n _distant__WEBPACK_IMPORTED_MODULE_13__[\"default\"].getBadges(user.id).then(badges => {\n badges.forEach(badge => {\n const props = {\n size: \"16px\",\n className: \"bd-logo\"\n };\n badge.scopes.forEach(scope => {// TODO: implement scope for badges (user, channel, etc)\n });\n const element = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: badge.name\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(Anchor, {\n className: chat ? \"bd-chat-badge\" : \"bd-member-badge\",\n href: badge.href,\n title: badge.name,\n target: \"_blank\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(badge.component, props)));\n const div2 = document.createElement(\"div\");\n _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reactDom.render(element, div2);\n div2.childNodes.forEach(node => {\n div.appendChild(node);\n });\n });\n });\n });\n}\n\nCore.prototype.patchMemberList = function () {\n if (this.memberListPatch) return;\n const MemberListItem = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].findByDisplayName(\"MemberListItem\");\n const Anchor = _webpackModules__WEBPACK_IMPORTED_MODULE_7__[\"default\"].find(m => m.displayName == \"Anchor\");\n if (!Anchor || !MemberListItem || !MemberListItem.prototype || !MemberListItem.prototype.renderDecorators) return;\n this.memberListPatch = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].monkeyPatch(MemberListItem.prototype, \"renderDecorators\", {\n after: data => {\n const user = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getNestedProp(data.thisObject, \"props.user\");\n const children = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getNestedProp(data.returnValue, \"props.children\");\n if (!children || !user || !user.id) return; // if (header && header.className) header.className += \" \"\n\n if (!Array.isArray(children)) return;\n\n if (user.id === \"249746236008169473\") {\n children.push(_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"BandagedBD Developer\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(Anchor, {\n className: \"bd-member-badge\",\n href: \"https://github.com/rauenzi/BetterDiscordApp\",\n title: \"BandagedBD\",\n target: \"_blank\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_bdLogo__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n size: \"16px\",\n className: \"bd-logo\"\n }))));\n } else if (user.id === \"696481194443014174\" || user.id === \"696003456611385396\") {\n children.push(_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"Lightcord Developer\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(Anchor, {\n className: \"bd-member-badge\",\n href: \"https://github.com/Lightcord/Lightcord\",\n title: \"Lightcord\",\n target: \"_blank\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(_svg_lightcord__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n size: \"32px\",\n className: \"bd-logo\"\n }))));\n }\n\n const id = Object(_distant__WEBPACK_IMPORTED_MODULE_13__[\"uuidv4\"])();\n children.push(_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(\"div\", {\n id: \"badges-\" + id\n }));\n applyBadges(id, user, false);\n }\n });\n};\n\nCore.prototype.updateInjector = async function () {\n const injectionPath = _dataStore__WEBPACK_IMPORTED_MODULE_6__[\"default\"].injectionPath;\n if (!injectionPath) return false;\n\n const fs = __webpack_require__(/*! fs */ \"fs\");\n\n const path = __webpack_require__(/*! path */ \"path\");\n\n const rmrf = __webpack_require__(/*! rimraf */ \"rimraf\");\n\n const yauzl = __webpack_require__(/*! yauzl */ \"yauzl\");\n\n const mkdirp = __webpack_require__(/*! mkdirp */ \"mkdirp\");\n\n const request =\n /*require(\"request\");*/\n null;\n const parentPath = path.resolve(injectionPath, \"..\");\n const folderName = path.basename(injectionPath);\n const zipLink = \"https://github.com/rauenzi/BetterDiscordApp/archive/injector.zip\";\n const savedZip = path.resolve(parentPath, \"injector.zip\");\n const extractedFolder = path.resolve(parentPath, \"BetterDiscordApp-injector\"); // Download the injector zip file\n\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"InjectorUpdate\", \"Downloading \" + zipLink);\n let success = await new Promise(resolve => {\n request.get({\n url: zipLink,\n encoding: null\n }, async (error, response, body) => {\n if (error || response.statusCode !== 200) return resolve(false); // Save a backup in case someone has their own copy\n\n const alreadyExists = await new Promise(res => fs.exists(savedZip, res));\n if (alreadyExists) await new Promise(res => fs.rename(savedZip, `${savedZip}.bak${Math.round(performance.now())}`, res));\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"InjectorUpdate\", \"Writing \" + savedZip);\n fs.writeFile(savedZip, body, err => resolve(!err));\n });\n });\n if (!success) return success; // Check and delete rename extraction\n\n const alreadyExists = await new Promise(res => fs.exists(extractedFolder, res));\n if (alreadyExists) await new Promise(res => fs.rename(extractedFolder, `${extractedFolder}.bak${Math.round(performance.now())}`, res)); // Unzip the downloaded zip file\n\n const zipfile = await new Promise(r => yauzl.open(savedZip, {\n lazyEntries: true\n }, (err, zip) => r(zip)));\n zipfile.on(\"entry\", function (entry) {\n // Skip directories, they are handled with mkdirp\n if (entry.fileName.endsWith(\"/\")) return zipfile.readEntry();\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"InjectorUpdate\", \"Extracting \" + entry.fileName); // Make any needed parent directories\n\n const fullPath = path.resolve(parentPath, entry.fileName);\n mkdirp.sync(path.dirname(fullPath));\n zipfile.openReadStream(entry, function (err, readStream) {\n if (err) return success = false;\n readStream.on(\"end\", function () {\n zipfile.readEntry();\n }); // Go to next file after this\n\n readStream.pipe(fs.createWriteStream(fullPath));\n });\n });\n zipfile.readEntry(); // Start reading\n // Wait for the final file to finish\n\n await new Promise(resolve => zipfile.once(\"end\", resolve)); // Save a backup in case something goes wrong during final step\n\n const backupFolder = path.resolve(parentPath, `${folderName}.bak${Math.round(performance.now())}`);\n await new Promise(resolve => fs.rename(injectionPath, backupFolder, resolve)); // Rename the extracted folder to what it should be\n\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"InjectorUpdate\", `Renaming ${path.basename(extractedFolder)} to ${folderName}`);\n success = await new Promise(resolve => fs.rename(extractedFolder, injectionPath, err => resolve(!err)));\n\n if (!success) {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].err(\"InjectorUpdate\", \"Failed to rename the final directory\");\n return success;\n } // If rename had issues, delete what we tried to rename and restore backup\n\n\n if (!success) {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].err(\"InjectorUpdate\", \"Something went wrong... restoring backups.\");\n await new Promise(resolve => rmrf(extractedFolder, resolve));\n await new Promise(resolve => fs.rename(backupFolder, injectionPath, resolve));\n return success;\n } // If we've gotten to this point, everything should have gone smoothly.\n // Cleanup the backup folder then remove the zip\n\n\n await new Promise(resolve => rmrf(backupFolder, resolve));\n await new Promise(resolve => fs.unlink(savedZip, resolve));\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].log(\"InjectorUpdate\", \"Injector Updated!\");\n return success;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new Core());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9jb3JlLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy9tb2R1bGVzL2NvcmUuanM/MTNjMiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBiZENvbmZpZywgbWluU3VwcG9ydGVkVmVyc2lvbiwgYmJkVmVyc2lvbiwgc2V0dGluZ3NDb29raWUsIGJkcGx1Z2luRXJyb3JzLCBiZHRoZW1lRXJyb3JzLCBiYmRDaGFuZ2Vsb2csIGRlZmF1bHRDb29raWUsIGN1cnJlbnREaXNjb3JkVmVyc2lvbiwgZGVmYXVsdFJQQywgc2V0dGluZ3NSUEMgfSBmcm9tIFwiLi4vMGdsb2JhbHNcIjtcbmltcG9ydCBVdGlscyBmcm9tIFwiLi91dGlsc1wiO1xuaW1wb3J0IEJEVjIgZnJvbSBcIi4vdjJcIjtcbmltcG9ydCBzZXR0aW5nc1BhbmVsIGZyb20gXCIuL3NldHRpbmdzUGFuZWxcIjtcbmltcG9ydCBwbHVnaW5Nb2R1bGUgZnJvbSBcIi4vcGx1Z2luTW9kdWxlXCI7XG5pbXBvcnQgdGhlbWVNb2R1bGUgZnJvbSBcIi4vdGhlbWVNb2R1bGVcIjtcbmltcG9ydCBEYXRhU3RvcmUgZnJvbSBcIi4vZGF0YVN0b3JlXCI7XG5pbXBvcnQgV2VicGFja01vZHVsZXMgZnJvbSBcIi4vd2VicGFja01vZHVsZXNcIjtcbmltcG9ydCBET00gZnJvbSBcIi4vZG9tdG9vbHNcIjtcb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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/core.js\n")},"./src/modules/dataStore.js":/*!**********************************!*\
|
|
!*** ./src/modules/dataStore.js ***!
|
|
\**********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\nconst __non_webpack_require__ = window.require;\n\n\n\n\nconst fs = __webpack_require__(/*! fs */ \"fs\");\n\nconst path = __webpack_require__(/*! path */ \"path\");\n\nconst releaseChannel = DiscordNative.globals.releaseChannel;\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class DataStore {\n constructor() {\n this.data = {\n settings: {\n stable: {},\n canary: {},\n ptb: {}\n }\n };\n this.pluginData = {};\n }\n\n initialize() {\n try {\n if (!fs.existsSync(this.BDFile)) fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"binary\");\n const data = JSON.parse(fs.readFileSync(this.BDFile, \"binary\"));\n if (data.hasOwnProperty(\"settings\")) this.data = data;\n if (!fs.existsSync(this.settingsFile)) return;\n\n let settings = __non_webpack_require__(this.settingsFile);\n\n fs.unlinkSync(this.settingsFile);\n if (settings.hasOwnProperty(\"settings\")) settings = Object.assign({\n stable: {},\n canary: {},\n ptb: {}\n }, {\n [releaseChannel]: settings\n });else settings = Object.assign({\n stable: {},\n canary: {},\n ptb: {}\n }, settings);\n this.setBDData(\"settings\", settings);\n } catch (err) {\n console.error(err);\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].alert(\"Corrupt Storage\", \"The bd storage has somehow become corrupt. You may either try to salvage the file or delete it then reload.\");\n }\n }\n\n get injectionPath() {\n if (this._injectionPath) return this._injectionPath;\n\n const electron = __webpack_require__(/*! electron */ \"electron\").remote.app;\n\n const base = electron.getAppPath();\n const roamingBase = electron.getPath(\"userData\");\n const roamingLocation = path.resolve(roamingBase, electron.getVersion(), \"modules\", \"discord_desktop_core\", \"injector\");\n const location = path.resolve(base, \"..\", \"app\");\n const realLocation = fs.existsSync(location) ? location : fs.existsSync(roamingLocation) ? roamingLocation : null;\n if (!realLocation) return this._injectionPath = null;\n return this._injectionPath = realLocation;\n }\n\n get configFile() {\n return this._configFile || (this._configFile = path.resolve(this.injectionPath, \"betterdiscord\", \"config.json\"));\n }\n\n get BDFile() {\n return this._BDFile || (this._BDFile = path.resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].dataPath, \"bdstorage.json\"));\n }\n\n get settingsFile() {\n return this._settingsFile || (this._settingsFile = path.resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].dataPath, \"bdsettings.json\"));\n }\n\n getPluginFile(pluginName) {\n return path.resolve(_contentManager__WEBPACK_IMPORTED_MODULE_2__[\"default\"].pluginsFolder, pluginName + \".config.json\");\n }\n\n getSettingGroup(key) {\n return this.data.settings[releaseChannel][key] || null;\n }\n\n setSettingGroup(key, data) {\n this.data.settings[releaseChannel][key] = data;\n fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"binary\");\n }\n\n getBDData(key) {\n return this.data[key] || \"\";\n }\n\n setBDData(key, value) {\n this.data[key] = value;\n fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"binary\");\n }\n\n getPluginData(pluginName, key) {\n if (this.pluginData[pluginName] !== undefined) return this.pluginData[pluginName][key];\n if (!fs.existsSync(this.getPluginFile(pluginName))) return undefined;\n this.pluginData[pluginName] = JSON.parse(fs.readFileSync(this.getPluginFile(pluginName)));\n return this.pluginData[pluginName][key];\n }\n\n setPluginData(pluginName, key, value) {\n if (value === undefined) return;\n if (this.pluginData[pluginName] === undefined) this.pluginData[pluginName] = {};\n this.pluginData[pluginName][key] = value;\n fs.writeFileSync(this.getPluginFile(pluginName), JSON.stringify(this.pluginData[pluginName], null, 4), \"binary\");\n }\n\n deletePluginData(pluginName, key) {\n if (this.pluginData[pluginName] === undefined) this.pluginData[pluginName] = {};\n delete this.pluginData[pluginName][key];\n fs.writeFileSync(this.getPluginFile(pluginName), JSON.stringify(this.pluginData[pluginName], null, 4), \"binary\");\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9kYXRhU3RvcmUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0Z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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/dataStore.js\n")},"./src/modules/devMode.js":/*!********************************!*\
|
|
!*** ./src/modules/devMode.js ***!
|
|
\********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class DevMode {\n constructor() {\n this.debugListener = this.debugListener.bind(this);\n this.copySelectorListener = this.copySelectorListener.bind(this);\n }\n\n start() {\n this.startDebugListener();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-dm-1\"]) this.startCopySelector();\n }\n\n stop() {\n this.stopDebugListener();\n this.stopCopySelector();\n }\n\n startDebugListener() {\n this.stopDebugListener();\n document.addEventListener(\"keydown\", this.debugListener);\n }\n\n stopDebugListener() {\n document.removeEventListener(\"keydown\", this.debugListener);\n }\n\n startCopySelector() {\n this.stopCopySelector();\n document.addEventListener(\"contextmenu\", this.copySelectorListener);\n }\n\n stopCopySelector() {\n document.removeEventListener(\"contextmenu\", this.copySelectorListener);\n }\n\n debugListener(e) {\n if (e.which === 119 || e.which == 118) {\n //F8\n console.log(\"%c[%cDevMode%c] %cBreak/Resume\", \"color: red;\", \"color: #303030; font-weight:700;\", \"color:red;\", \"\");\n debugger; // eslint-disable-line no-debugger\n\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n copySelectorListener(e) {\n try {\n e.stopPropagation();\n const selector = this.getSelector(e.target);\n let [classNameLayer, classItems] = [BDModules.get(e => e.layer && typeof e.layer === \"string\" && e.disabledPointerEvents)[0].layer, BDModules.get(e => e.contextMenu)[0]];\n\n function attach() {\n let cm = _domtools__WEBPACK_IMPORTED_MODULE_2__[\"default\"].query(\".\" + classItems.contextMenu.split(\" \")[0]);\n\n if (!cm) {\n const container = _domtools__WEBPACK_IMPORTED_MODULE_2__[\"default\"].query(\"#app-mount\");\n const cmWrap = _domtools__WEBPACK_IMPORTED_MODULE_2__[\"default\"].createElement(`<div class=\"${classNameLayer}\">`);\n cm = _domtools__WEBPACK_IMPORTED_MODULE_2__[\"default\"].createElement(`<div class=\"${classItems.contextMenu} bd-context-menu\"></div>`);\n cmWrap.append(cm);\n container.append(cmWrap);\n cmWrap.style.top = e.clientY + \"px\";\n cmWrap.style.left = e.clientX + \"px\";\n cmWrap.style.zIndex = \"1002\";\n\n const removeCM = function (e) {\n if (e.keyCode && e.keyCode !== 27) return;\n cmWrap.remove();\n document.removeEventListener(\"click\", removeCM);\n document.removeEventListener(\"contextmenu\", removeCM);\n document.removeEventListener(\"keyup\", removeCM);\n };\n\n document.addEventListener(\"click\", removeCM);\n document.addEventListener(\"contextmenu\", removeCM);\n document.addEventListener(\"keyup\", removeCM);\n }\n\n const cmWrap = _domtools__WEBPACK_IMPORTED_MODULE_2__[\"default\"].query(\".\" + classNameLayer.split(\" \")[0]);\n const cmg = _domtools__WEBPACK_IMPORTED_MODULE_2__[\"default\"].createElement(`<div class=\"${classItems.itemGroup}\">`);\n const cmi = _domtools__WEBPACK_IMPORTED_MODULE_2__[\"default\"].createElement(`<div class=\"${classItems.item} ${classItems.clickable}\">`);\n cmi.append(_domtools__WEBPACK_IMPORTED_MODULE_2__[\"default\"].createElement(`<div class=\"${classItems.label}\">Copy Selector</div>`));\n cmi.addEventListener(\"click\", () => {\n _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].NativeModule.copy(selector);\n cm.style.display = \"none\";\n });\n cmg.append(cmi);\n cm.append(cmg);\n\n if (cmWrap.clientHeight < cmWrap.scrollHeight) {\n console.log(\"overflowing \" + cmWrap.style.top);\n cmWrap.style.top = cmWrap.style.top - cmg.clientHeight + \"px\";\n console.log(\"overflowing\" + cmWrap.style.top);\n }\n }\n\n setTimeout(attach, 1);\n } catch (e) {\n console.error(e);\n }\n }\n\n getSelector(element) {\n if (element.id) return `#${element.id}`;\n /**\r\n * \r\n * @param {HTMLElement} el \r\n */\n\n function fullPath(el) {\n var names = [];\n\n while (el.parentNode) {\n if (el.id) {\n names.unshift('#' + el.id);\n break;\n } else {\n if (el == el.ownerDocument.documentElement) names.unshift(el.tagName.toLowerCase() + Array.from(el.classList.entries()).map(e => \".\" + e).join(\"\"));else {\n for (var c = 1, e = el; e.previousElementSibling; e = e.previousElementSibling, c++);\n\n names.unshift(el.tagName.toLowerCase() + (el.className || \"\").split(\" \").map(e => \".\" + e).join(\"\") + \":nth-child(\" + c + \")\");\n }\n el = el.parentNode;\n }\n }\n\n return names.join(\" > \");\n }\n\n return fullPath(element);\n /*\r\n const rules = this.getRules(element);\r\n const latestRule = rules[rules.length - 1];\r\n if (latestRule) return latestRule.selectorText;\r\n else if (element.classList.length) return `.${Array.from(element.classList).join(\".\")}`;\r\n return `.${Array.from(element.parentElement.classList).join(\".\")}`;*/\n }\n\n getRules(element, css = element.ownerDocument.styleSheets) {\n //if (window.getMatchedCSSRules) return window.getMatchedCSSRules(element);\n const sheets = [...css].filter(s => !s.href || !s.href.includes(\"BetterDiscordApp\"));\n const rules = sheets.map(s => [...(s.cssRules || [])]).flat();\n const elementRules = rules.filter(r => r && r.selectorText && element.matches(r.selectorText) && r.style.length && r.selectorText.split(\", \").length < 8 && !r.selectorText.split(\", \").includes(\"*\"));\n return elementRules;\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/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
\********************************/ /*! exports provided: uuidv4, default, Constants, Routes */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uuidv4\", function() { return uuidv4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Constants\", function() { return Constants; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Routes\", function() { return Routes; });\n/* harmony import */ var _svg_bug_hunter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../svg/bug_hunter */ \"./src/svg/bug_hunter.jsx\");\n\nfunction uuidv4() {\n // Generate UUID (No crypto rng)\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0,\n v = c == 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n}\nconst awaitingBadgesPromises = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class DistantServer {\n constructor() {\n this._cache = {\n badges: {}\n };\n }\n\n get cache() {\n return this._cache;\n }\n\n set cache(data) {\n if (typeof data !== \"object\" || typeof this._cache !== \"object\") return this._cache = data;\n return this._cache = Object.assign(this._cache, data);\n }\n /**\r\n * Get custom badges from the user ID.\r\n * @param {string} user The user ID \r\n * @returns {Promise<Constants[\"badges\"]>}\r\n */\n\n\n async getBadges(user) {\n if (this.cache.badges[user]) return this.cache.badges[user];\n if (awaitingBadgesPromises[user]) return awaitingBadgesPromises[user];\n let resolve;\n const newPromise = new Promise(res => resolve = res);\n awaitingBadgesPromises[user] = newPromise;\n const badges = [];\n\n for (let badge of Constants.badges) {\n if (badge.defaultUsers.includes(user)) badges.push(badge);\n }\n\n const fetchedBadges = await new Promise(resolve => {\n handleRequest(Routes.badges(user), \"GET\").then(async res => {\n if (res.status !== 200) {\n // Couldn't fetch badges: server error\n return resolve([]); // no badge fetched\n }\n\n return resolve((await res.json()));\n }).catch(() => {\n // Couldn't fetch badges: error\n return resolve([]); // no badge fetched\n });\n });\n\n for (let badge of fetchedBadges) {\n if (!Constants.badges.find(e => e.id === badge)) continue; // We do not have the Component, skip it.\n\n if (badges.find(e => e.id === badge)) continue; // Already inserted.\n\n badges.push(Constants.badges.find(e => e.id === badge));\n }\n\n this.cache = {\n badges: Object.assign(this.cache.badges, {\n [user]: badges\n })\n };\n setTimeout(() => {\n delete this.cache.badges[user];\n }, 600000);\n resolve(badges);\n delete awaitingBadgesPromises[user];\n return badges;\n }\n\n}());\n\nconst handleRequest = function (route, method) {\n return fetch(`${Constants.SERVER_URL}/api/v1${route}`, {\n method,\n headers: {\n \"CLIENT\": \"Lightcord\"\n }\n });\n};\n\nconst Constants = {\n SERVER_URL: \"http://127.0.0.1\",\n badges: [{\n name: \"Bug Hunter\",\n id: \"f04698f5-816b-41e3-bd01-92291193d7a5\",\n defaultUsers: [\"696481194443014174\", \"585858920149549067\"],\n scopes: [],\n component: _svg_bug_hunter__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n href: \"https://github.com/lightcord/lightcord/wiki/badges/bug_hunter\"\n }]\n};\nconst Routes = {\n badges(user) {\n return `/${user}/badges`;\n }\n\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9kaXN0YW50LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy9tb2R1bGVzL2Rpc3RhbnQuanM/MjJhMiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQnVnSHVudGVyQmFkZ2UgZnJvbSBcIi4uL3N2Zy9idWdfaHVudGVyXCI7XG5leHBvcnQgZnVuY3Rpb24gdXVpZHY0KCkge1xuICAvLyBHZW5lcmF0ZSBVVUlEIChObyBjcnlwdG8gcm5nKVxuICByZXR1cm4gJ3h4eHh4eHh4LXh4eHgtNHh4eC15eHh4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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/distant.js\n")},"./src/modules/domtools.js":/*!*********************************!*\
|
|
!*** ./src/modules/domtools.js ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return DOMTools; });\n/**\r\n * Copyright 2018 Zachary Rauen\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining\r\n * a copy of this software and associated documentation files (the \"Software\"),\r\n * to deal in the Software without restriction, including without limitation the\r\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is furnished\r\n * to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\r\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\r\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\r\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\r\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\r\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n * \r\n * From: https://github.com/rauenzi/BDPluginLibrary\r\n */\n\n/**\r\n * @interface\r\n * @name Offset\r\n * @property {number} top - Top offset of the target element.\r\n * @property {number} right - Right offset of the target element.\r\n * @property {number} bottom - Bottom offset of the target element.\r\n * @property {number} left - Left offset of the target element.\r\n * @property {number} height - Outer height of the target element.\r\n * @property {number} width - Outer width of the target element.\r\n */\n\n/**\r\n* Function that automatically removes added listener.\r\n* @callback module:DOMTools~CancelListener\r\n*/\nclass DOMTools {\n static escapeID(id) {\n return id.replace(/^[^a-z]+|[^\\w-]+/gi, \"-\");\n }\n /**\r\n * Adds a style to the document.\r\n * @param {string} id - identifier to use as the element id\r\n * @param {string} css - css to add to the document\r\n */\n\n\n static addStyle(id, css) {\n document.head.append(DOMTools.createElement(`<style id=\"${id}\">${css}</style>`));\n }\n /**\r\n * Removes a style from the document.\r\n * @param {string} id - original identifier used\r\n */\n\n\n static removeStyle(id) {\n const element = document.getElementById(id);\n if (element) element.remove();\n }\n /**\r\n * Adds/requires a remote script to be loaded\r\n * @param {string} id - identifier to use for this script\r\n * @param {string} url - url from which to load the script\r\n * @returns {Promise} promise that resolves when the script is loaded\r\n */\n\n\n static addScript(id, url) {\n return new Promise(resolve => {\n const script = document.createElement(\"script\");\n script.id = id;\n script.src = url;\n script.type = \"text/javascript\";\n script.onload = resolve;\n document.head.append(script);\n });\n }\n /**\r\n * Removes a remote script from the document.\r\n * @param {string} id - original identifier used\r\n */\n\n\n static removeScript(id) {\n id = this.escapeID(id);\n const element = document.getElementById(id);\n if (element) element.remove();\n } // https://javascript.info/js-animation\n\n\n static animate({\n timing = _ => _,\n update,\n duration\n }) {\n const start = performance.now();\n requestAnimationFrame(function animate(time) {\n // timeFraction goes from 0 to 1\n let timeFraction = (time - start) / duration;\n if (timeFraction > 1) timeFraction = 1; // calculate the current animation state\n\n const progress = timing(timeFraction);\n update(progress); // draw it\n\n if (timeFraction < 1) {\n requestAnimationFrame(animate);\n }\n });\n }\n /**\r\n * This is my shit version of not having to use `$` from jQuery. Meaning\r\n * that you can pass a selector and it will automatically run {@link module:DOMTools.query}.\r\n * It also means that you can pass a string of html and it will perform and return `parseHTML`.\r\n * @see module:DOMTools.parseHTML\r\n * @see module:DOMTools.query\r\n * @param {string} selector - Selector to query or HTML to parse\r\n * @returns {(DocumentFragment|NodeList|HTMLElement)} - Either the result of `parseHTML` or `query`\r\n */\n\n\n static Q(selector) {\n const element = this.parseHTML(selector);\n const isHTML = element instanceof NodeList ? Array.from(element).some(n => n.nodeType === 1) : element.nodeType === 1;\n if (isHTML) return element;\n return this.query(selector);\n }\n /**\r\n * Essentially a shorthand for `document.querySelector`. If the `baseElement` is not provided\r\n * `document` is used by default.\r\n * @param {string} selector - Selector to query\r\n * @param {Element} [baseElement] - Element to base the query from\r\n * @returns {(Element|null)} - The found element or null if not found\r\n */\n\n\n static query(selector, baseElement) {\n if (!baseElement) baseElement = document;\n return baseElement.querySelector(selector);\n }\n /**\r\n * Essentially a shorthand for `document.querySelectorAll`. If the `baseElement` is not provided\r\n * `document` is used by default.\r\n * @param {string} selector - Selector to query\r\n * @param {Element} [baseElement] - Element to base the query from\r\n * @returns {Array<Element>} - Array of all found elements\r\n */\n\n\n static queryAll(selector, baseElement) {\n if (!baseElement) baseElement = document;\n return baseElement.querySelectorAll(selector);\n }\n /**\r\n * Parses a string of HTML and returns the results. If the second parameter is true,\r\n * the parsed HTML will be returned as a document fragment {@see https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment}.\r\n * This is extremely useful if you have a list of elements at the top level, they can then be appended all at once to another node.\r\n * \r\n * If the second parameter is false, then the return value will be the list of parsed\r\n * nodes and there were multiple top level nodes, otherwise the single node is returned.\r\n * @param {string} html - HTML to be parsed\r\n * @param {boolean} [fragment=false] - Whether or not the return should be the raw `DocumentFragment`\r\n * @returns {(DocumentFragment|NodeList|HTMLElement)} - The result of HTML parsing\r\n */\n\n\n static parseHTML(html, fragment = false) {\n const template = document.createElement(\"template\");\n template.innerHTML = html;\n const node = template.content.cloneNode(true);\n if (fragment) return node;\n return node.childNodes.length > 1 ? node.childNodes : node.childNodes[0];\n }\n /** Alternate name for {@link module:DOMTools.parseHTML} */\n\n\n static createElement(html, fragment = false) {\n return this.parseHTML(html, fragment);\n }\n /**\r\n * Takes a string of html and escapes it using the brower's own escaping mechanism.\r\n * @param {String} html - html to be escaped\r\n */\n\n\n static escapeHTML(html) {\n const textNode = document.createTextNode(\"\");\n const spanElement = document.createElement(\"span\");\n spanElement.append(textNode);\n textNode.nodeValue = html;\n return spanElement.innerHTML;\n }\n /**\r\n * Adds a list of classes from the target element.\r\n * @param {Element} element - Element to edit classes of\r\n * @param {...string} classes - Names of classes to add\r\n * @returns {Element} - `element` to allow for chaining\r\n */\n\n\n static addClass(element, ...classes) {\n classes = classes.flat().filter(c => c);\n\n for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(\" \");\n\n classes = classes.flat().filter(c => c);\n element.classList.add(...classes);\n return element;\n }\n /**\r\n * Removes a list of classes from the target element.\r\n * @param {Element} element - Element to edit classes of\r\n * @param {...string} classes - Names of classes to remove\r\n * @returns {Element} - `element` to allow for chaining\r\n */\n\n\n static removeClass(element, ...classes) {\n for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(\" \");\n\n classes = classes.flat().filter(c => c);\n element.classList.remove(...classes);\n return element;\n }\n /**\r\n * When only one argument is present: Toggle class value;\r\n * i.e., if class exists then remove it and return false, if not, then add it and return true.\r\n * When a second argument is present:\r\n * If the second argument evaluates to true, add specified class value, and if it evaluates to false, remove it.\r\n * @param {Element} element - Element to edit classes of\r\n * @param {string} classname - Name of class to toggle\r\n * @param {boolean} [indicator] - Optional indicator for if the class should be toggled\r\n * @returns {Element} - `element` to allow for chaining\r\n */\n\n\n static toggleClass(element, classname, indicator) {\n classname = classname.toString().split(\" \").filter(c => c);\n if (typeof indicator !== \"undefined\") classname.forEach(c => element.classList.toggle(c, indicator));else classname.forEach(c => element.classList.toggle(c));\n return element;\n }\n /**\r\n * Checks if an element has a specific class\r\n * @param {Element} element - Element to edit classes of\r\n * @param {string} classname - Name of class to check\r\n * @returns {boolean} - `true` if the element has the class, `false` otherwise.\r\n */\n\n\n static hasClass(element, classname) {\n return classname.toString().split(\" \").filter(c => c).every(c => element.classList.contains(c));\n }\n /**\r\n * Replaces one class with another\r\n * @param {Element} element - Element to edit classes of\r\n * @param {string} oldName - Name of class to replace\r\n * @param {string} newName - New name for the class\r\n * @returns {Element} - `element` to allow for chaining\r\n */\n\n\n static replaceClass(element, oldName, newName) {\n element.classList.replace(oldName, newName);\n return element;\n }\n /**\r\n * Appends `thisNode` to `thatNode`\r\n * @param {Node} thisNode - Node to be appended to another node\r\n * @param {Node} thatNode - Node for `thisNode` to be appended to\r\n * @returns {Node} - `thisNode` to allow for chaining\r\n */\n\n\n static appendTo(thisNode, thatNode) {\n if (typeof thatNode == \"string\") thatNode = this.query(thatNode);\n if (!thatNode) return null;\n thatNode.append(thisNode);\n return thisNode;\n }\n /**\r\n * Prepends `thisNode` to `thatNode`\r\n * @param {Node} thisNode - Node to be prepended to another node\r\n * @param {Node} thatNode - Node for `thisNode` to be prepended to\r\n * @returns {Node} - `thisNode` to allow for chaining\r\n */\n\n\n static prependTo(thisNode, thatNode) {\n if (typeof thatNode == \"string\") thatNode = this.query(thatNode);\n if (!thatNode) return null;\n thatNode.prepend(thisNode);\n return thisNode;\n }\n /**\r\n * Insert after a specific element, similar to jQuery's `thisElement.insertAfter(otherElement)`.\r\n * @param {Node} thisNode - The node to insert\r\n * @param {Node} targetNode - Node to insert after in the tree\r\n * @returns {Node} - `thisNode` to allow for chaining\r\n */\n\n\n static insertAfter(thisNode, targetNode) {\n targetNode.parentNode.insertBefore(thisNode, targetNode.nextSibling);\n return thisNode;\n }\n /**\r\n * Insert after a specific element, similar to jQuery's `thisElement.after(newElement)`.\r\n * @param {Node} thisNode - The node to insert\r\n * @param {Node} newNode - Node to insert after in the tree\r\n * @returns {Node} - `thisNode` to allow for chaining\r\n */\n\n\n static after(thisNode, newNode) {\n thisNode.parentNode.insertBefore(newNode, thisNode.nextSibling);\n return thisNode;\n }\n /**\r\n * Gets the next sibling element that matches the selector.\r\n * @param {Element} element - Element to get the next sibling of\r\n * @param {string} [selector=\"\"] - Optional selector\r\n * @returns {Element} - The sibling element\r\n */\n\n\n static next(element, selector = \"\") {\n return selector ? element.querySelector(\"+ \" + selector) : element.nextElementSibling;\n }\n /**\r\n * Gets all subsequent siblings.\r\n * @param {Element} element - Element to get next siblings of\r\n * @returns {NodeList} - The list of siblings\r\n */\n\n\n static nextAll(element) {\n return element.querySelectorAll(\"~ *\");\n }\n /**\r\n * Gets the subsequent siblings until an element matches the selector.\r\n * @param {Element} element - Element to get the following siblings of\r\n * @param {string} selector - Selector to stop at\r\n * @returns {Array<Element>} - The list of siblings\r\n */\n\n\n static nextUntil(element, selector) {\n const next = [];\n\n while (element.nextElementSibling && !element.nextElementSibling.matches(selector)) next.push(element = element.nextElementSibling);\n\n return next;\n }\n /**\r\n * Gets the previous sibling element that matches the selector.\r\n * @param {Element} element - Element to get the previous sibling of\r\n * @param {string} [selector=\"\"] - Optional selector\r\n * @returns {Element} - The sibling element\r\n */\n\n\n static previous(element, selector = \"\") {\n const previous = element.previousElementSibling;\n if (selector) return previous && previous.matches(selector) ? previous : null;\n return previous;\n }\n /**\r\n * Gets all preceeding siblings.\r\n * @param {Element} element - Element to get preceeding siblings of\r\n * @returns {NodeList} - The list of siblings\r\n */\n\n\n static previousAll(element) {\n const previous = [];\n\n while (element.previousElementSibling) previous.push(element = element.previousElementSibling);\n\n return previous;\n }\n /**\r\n * Gets the preceeding siblings until an element matches the selector.\r\n * @param {Element} element - Element to get the preceeding siblings of\r\n * @param {string} selector - Selector to stop at\r\n * @returns {Array<Element>} - The list of siblings\r\n */\n\n\n static previousUntil(element, selector) {\n const previous = [];\n\n while (element.previousElementSibling && !element.previousElementSibling.matches(selector)) previous.push(element = element.previousElementSibling);\n\n return previous;\n }\n /**\r\n * Find which index in children a certain node is. Similar to jQuery's `$.index()`\r\n * @param {HTMLElement} node - The node to find its index in parent\r\n * @returns {number} Index of the node\r\n */\n\n\n static indexInParent(node) {\n const children = node.parentNode.childNodes;\n let num = 0;\n\n for (let i = 0; i < children.length; i++) {\n if (children[i] == node) return num;\n if (children[i].nodeType == 1) num++;\n }\n\n return -1;\n }\n /** Shorthand for {@link module:DOMTools.indexInParent} */\n\n\n static index(node) {\n return this.indexInParent(node);\n }\n /**\r\n * Gets the parent of the element if it matches the selector,\r\n * otherwise returns null.\r\n * @param {Element} element - Element to get parent of\r\n * @param {string} [selector=\"\"] - Selector to match parent\r\n * @returns {(Element|null)} - The sibling element or null\r\n */\n\n\n static parent(element, selector = \"\") {\n return !selector || element.parentElement.matches(selector) ? element.parentElement : null;\n }\n /**\r\n * Gets all children of Element that match the selector if provided.\r\n * @param {Element} element - Element to get all children of\r\n * @param {string} selector - Selector to match the children to\r\n * @returns {Array<Element>} - The list of children\r\n */\n\n\n static findChild(element, selector) {\n return element.querySelector(\":scope > \" + selector);\n }\n /**\r\n * Gets all children of Element that match the selector if provided.\r\n * @param {Element} element - Element to get all children of\r\n * @param {string} selector - Selector to match the children to\r\n * @returns {Array<Element>} - The list of children\r\n */\n\n\n static findChildren(element, selector) {\n return element.querySelectorAll(\":scope > \" + selector);\n }\n /**\r\n * Gets all ancestors of Element that match the selector if provided.\r\n * @param {Element} element - Element to get all parents of\r\n * @param {string} [selector=\"\"] - Selector to match the parents to\r\n * @returns {Array<Element>} - The list of parents\r\n */\n\n\n static parents(element, selector = \"\") {\n const parents = [];\n if (selector) while (element.parentElement && element.parentElement.closest(selector)) parents.push(element = element.parentElement.closest(selector));else while (element.parentElement) parents.push(element = element.parentElement);\n return parents;\n }\n /**\r\n * Gets the ancestors until an element matches the selector.\r\n * @param {Element} element - Element to get the ancestors of\r\n * @param {string} selector - Selector to stop at\r\n * @returns {Array<Element>} - The list of parents\r\n */\n\n\n static parentsUntil(element, selector) {\n const parents = [];\n\n while (element.parentElement && !element.parentElement.matches(selector)) parents.push(element = element.parentElement);\n\n return parents;\n }\n /**\r\n * Gets all siblings of the element that match the selector.\r\n * @param {Element} element - Element to get all siblings of\r\n * @param {string} [selector=\"*\"] - Selector to match the siblings to\r\n * @returns {Array<Element>} - The list of siblings\r\n */\n\n\n static siblings(element, selector = \"*\") {\n return Array.from(element.parentElement.children).filter(e => e != element && e.matches(selector));\n }\n /**\r\n * Sets or gets css styles for a specific element. If `value` is provided\r\n * then it sets the style and returns the element to allow for chaining,\r\n * otherwise returns the style. \r\n * @param {Element} element - Element to set the CSS of\r\n * @param {string} attribute - Attribute to get or set\r\n * @param {string} [value] - Value to set for attribute\r\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\r\n */\n\n\n static css(element, attribute, value) {\n if (typeof value == \"undefined\") return global.getComputedStyle(element)[attribute];\n element.style[attribute] = value;\n return element;\n }\n /**\r\n * Sets or gets the width for a specific element. If `value` is provided\r\n * then it sets the width and returns the element to allow for chaining,\r\n * otherwise returns the width. \r\n * @param {Element} element - Element to set the CSS of\r\n * @param {string} [value] - Width to set\r\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\r\n */\n\n\n static width(element, value) {\n if (typeof value == \"undefined\") return parseInt(getComputedStyle(element).width);\n element.style.width = value;\n return element;\n }\n /**\r\n * Sets or gets the height for a specific element. If `value` is provided\r\n * then it sets the height and returns the element to allow for chaining,\r\n * otherwise returns the height. \r\n * @param {Element} element - Element to set the CSS of\r\n * @param {string} [value] - Height to set\r\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\r\n */\n\n\n static height(element, value) {\n if (typeof value == \"undefined\") return parseInt(getComputedStyle(element).height);\n element.style.height = value;\n return element;\n }\n /**\r\n * Sets the inner text of an element if given a value, otherwise returns it.\r\n * @param {Element} element - Element to set the text of\r\n * @param {string} [text] - Content to set\r\n * @returns {string} - Either the string set by this call or the current text content of the node.\r\n */\n\n\n static text(element, text) {\n if (typeof text == \"undefined\") return element.textContent;\n return element.textContent = text;\n }\n /**\r\n * Returns the innerWidth of the element.\r\n * @param {Element} element - Element to retrieve inner width of\r\n * @return {number} - The inner width of the element.\r\n */\n\n\n static innerWidth(element) {\n return element.clientWidth;\n }\n /**\r\n * Returns the innerHeight of the element.\r\n * @param {Element} element - Element to retrieve inner height of\r\n * @return {number} - The inner height of the element.\r\n */\n\n\n static innerHeight(element) {\n return element.clientHeight;\n }\n /**\r\n * Returns the outerWidth of the element.\r\n * @param {Element} element - Element to retrieve outer width of\r\n * @return {number} - The outer width of the element.\r\n */\n\n\n static outerWidth(element) {\n return element.offsetWidth;\n }\n /**\r\n * Returns the outerHeight of the element.\r\n * @param {Element} element - Element to retrieve outer height of\r\n * @return {number} - The outer height of the element.\r\n */\n\n\n static outerHeight(element) {\n return element.offsetHeight;\n }\n /**\r\n * Gets the offset of the element in the page.\r\n * @param {Element} element - Element to get offset of\r\n * @return {Offset} - The offset of the element\r\n */\n\n\n static offset(element) {\n return element.getBoundingClientRect();\n }\n\n static get listeners() {\n return this._listeners || (this._listeners = {});\n }\n /**\r\n * This is similar to jQuery's `on` function and can *hopefully* be used in the same way.\r\n * \r\n * Rather than attempt to explain, I'll show some example usages.\r\n * \r\n * The following will add a click listener (in the `myPlugin` namespace) to `element`.\r\n * `DOMTools.on(element, \"click.myPlugin\", () => {console.log(\"clicked!\");});`\r\n * \r\n * The following will add a click listener (in the `myPlugin` namespace) to `element` that only fires when the target is a `.block` element.\r\n * `DOMTools.on(element, \"click.myPlugin\", \".block\", () => {console.log(\"clicked!\");});`\r\n * \r\n * The following will add a click listener (without namespace) to `element`.\r\n * `DOMTools.on(element, \"click\", () => {console.log(\"clicked!\");});`\r\n * \r\n * The following will add a click listener (without namespace) to `element` that only fires once.\r\n * `const cancel = DOMTools.on(element, \"click\", () => {console.log(\"fired!\"); cancel();});`\r\n * \r\n * @param {Element} element - Element to add listener to\r\n * @param {string} event - Event to listen to with option namespace (e.g. \"event.namespace\")\r\n * @param {(string|callable)} delegate - Selector to run on element to listen to\r\n * @param {callable} [callback] - Function to fire on event\r\n * @returns {module:DOMTools~CancelListener} - A function that will undo the listener\r\n */\n\n\n static on(element, event, delegate, callback) {\n const [type, namespace] = event.split(\".\");\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? callback : function (event) {\n if (event.target.matches(delegate)) {\n callback(event);\n }\n };\n element.addEventListener(type, eventFunc);\n\n const cancel = () => {\n element.removeEventListener(type, eventFunc);\n };\n\n if (namespace) {\n if (!this.listeners[namespace]) this.listeners[namespace] = [];\n\n const newCancel = () => {\n cancel();\n this.listeners[namespace].splice(this.listeners[namespace].findIndex(l => l.event == type && l.element == element), 1);\n };\n\n this.listeners[namespace].push({\n event: type,\n element: element,\n cancel: newCancel\n });\n return newCancel;\n }\n\n return cancel;\n }\n /**\r\n * Functionality for this method matches {@link module:DOMTools.on} but automatically cancels itself\r\n * and removes the listener upon the first firing of the desired event.\r\n * \r\n * @param {Element} element - Element to add listener to\r\n * @param {string} event - Event to listen to with option namespace (e.g. \"event.namespace\")\r\n * @param {(string|callable)} delegate - Selector to run on element to listen to\r\n * @param {callable} [callback] - Function to fire on event\r\n * @returns {module:DOMTools~CancelListener} - A function that will undo the listener\r\n */\n\n\n static once(element, event, delegate, callback) {\n const [type, namespace] = event.split(\".\");\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? function (event) {\n callback(event);\n element.removeEventListener(type, eventFunc);\n } : function (event) {\n if (!event.target.matches(delegate)) return;\n callback(event);\n element.removeEventListener(type, eventFunc);\n };\n element.addEventListener(type, eventFunc);\n\n const cancel = () => {\n element.removeEventListener(type, eventFunc);\n };\n\n if (namespace) {\n if (!this.listeners[namespace]) this.listeners[namespace] = [];\n\n const newCancel = () => {\n cancel();\n this.listeners[namespace].splice(this.listeners[namespace].findIndex(l => l.event == type && l.element == element), 1);\n };\n\n this.listeners[namespace].push({\n event: type,\n element: element,\n cancel: newCancel\n });\n return newCancel;\n }\n\n return cancel;\n }\n\n static __offAll(event, element) {\n const [type, namespace] = event.split(\".\");\n\n let matchFilter = listener => listener.event == type,\n defaultFilter = _ => _;\n\n if (element) matchFilter = l => l.event == type && l.element == element, defaultFilter = l => l.element == element;\n const listeners = this.listeners[namespace] || [];\n const list = type ? listeners.filter(matchFilter) : listeners.filter(defaultFilter);\n\n for (let c = 0; c < list.length; c++) list[c].cancel();\n }\n /**\r\n * This is similar to jQuery's `off` function and can *hopefully* be used in the same way.\r\n * \r\n * Rather than attempt to explain, I'll show some example usages.\r\n * \r\n * The following will remove a click listener called `onClick` (in the `myPlugin` namespace) from `element`.\r\n * `DOMTools.off(element, \"click.myPlugin\", onClick);`\r\n * \r\n * The following will remove a click listener called `onClick` (in the `myPlugin` namespace) from `element` that only fired when the target is a `.block` element.\r\n * `DOMTools.off(element, \"click.myPlugin\", \".block\", onClick);`\r\n * \r\n * The following will remove a click listener (without namespace) from `element`.\r\n * `DOMTools.off(element, \"click\", onClick);`\r\n * \r\n * The following will remove all listeners in namespace `myPlugin` from `element`.\r\n * `DOMTools.off(element, \".myPlugin\");`\r\n * \r\n * The following will remove all click listeners in namespace `myPlugin` from *all elements*.\r\n * `DOMTools.off(\"click.myPlugin\");`\r\n * \r\n * The following will remove all listeners in namespace `myPlugin` from *all elements*.\r\n * `DOMTools.off(\".myPlugin\");`\r\n * \r\n * @param {(Element|string)} element - Element to remove listener from\r\n * @param {string} [event] - Event to listen to with option namespace (e.g. \"event.namespace\")\r\n * @param {(string|callable)} [delegate] - Selector to run on element to listen to\r\n * @param {callable} [callback] - Function to fire on event\r\n * @returns {Element} - The original element to allow for chaining\r\n */\n\n\n static off(element, event, delegate, callback) {\n if (typeof element == \"string\") return this.__offAll(element);\n const [type, namespace] = event.split(\".\");\n if (namespace) return this.__offAll(event, element);\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? callback : function (event) {\n if (event.target.matches(delegate)) {\n callback(event);\n }\n };\n element.removeEventListener(type, eventFunc);\n return element;\n }\n /**\r\n * Adds a listener for when the node is added/removed from the document body.\r\n * The listener is automatically removed upon firing.\r\n * @param {HTMLElement} node - node to wait for\r\n * @param {callable} callback - function to be performed on event\r\n * @param {boolean} onMount - determines if it should fire on Mount or on Unmount\r\n */\n\n\n static onMountChange(node, callback, onMount = true) {\n const wrappedCallback = () => {\n this.observer.unsubscribe(wrappedCallback);\n callback();\n };\n\n this.observer.subscribe(wrappedCallback, mutation => {\n const nodes = Array.from(onMount ? mutation.addedNodes : mutation.removedNodes);\n const directMatch = nodes.indexOf(node) > -1;\n const parentMatch = nodes.some(parent => parent.contains(node));\n return directMatch || parentMatch;\n });\n return node;\n }\n /** Shorthand for {@link module:DOMTools.onMountChange} with third parameter `true` */\n\n\n static onMount(node, callback) {\n return this.onMountChange(node, callback);\n }\n /** Shorthand for {@link module:DOMTools.onMountChange} with third parameter `false` */\n\n\n static onUnmount(node, callback) {\n return this.onMountChange(node, callback, false);\n }\n /** Alias for {@link module:DOMTools.onMount} */\n\n\n static onAdded(node, callback) {\n return this.onMount(node, callback);\n }\n /** Alias for {@link module:DOMTools.onUnmount} */\n\n\n static onRemoved(node, callback) {\n return this.onUnmount(node, callback, false);\n }\n /**\r\n * Helper function which combines multiple elements into one parent element\r\n * @param {Array<HTMLElement>} elements - array of elements to put into a single parent\r\n */\n\n\n static wrap(elements) {\n const domWrapper = this.parseHTML(`<div class=\"dom-wrapper\"></div>`);\n\n for (let e = 0; e < elements.length; e++) domWrapper.appendChild(elements[e]);\n\n return domWrapper;\n }\n /**\r\n * Resolves the node to an HTMLElement. This is mainly used by library modules.\r\n * @param {(jQuery|Element)} node - node to resolve\r\n */\n\n\n static resolveElement(node) {\n if (!(node instanceof jQuery) && !(node instanceof Element)) return undefined;\n return node instanceof jQuery ? node[0] : node;\n }\n\n}//# sourceURL=[module]\n//# sourceM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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/domtools.js\n")},"./src/modules/pluginCertifier.js":/*!****************************************!*\
|
|
!*** ./src/modules/pluginCertifier.js ***!
|
|
\****************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return PluginCertifier; });\n/* harmony import */ var node_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-fetch */ \"node-fetch\");\n/* harmony import */ var node_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_fetch__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! crypto */ \"crypto\");\n/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ui/tooltipWrap */ \"./src/ui/tooltipWrap.js\");\n\n\n\n\n\nconst debug = true;\nconst cache = {};\nconst cache2 = {};\nconst PinnedModule = BDModules.get(e => e.default && e.default.getPinnedMessages)[0].default;\nconst ChannelModule = BDModules.get(e => e.default && e.default.getChannelId)[0].default;\nconst fetchMessagesModule = BDModules.get(e => e.default && e.default.fetchMessages)[0].default;\nconst fetchMessagesModule2 = BDModules.get(e => e.default && e.default.fetchMessages)[1].default;\nconst getMessagesModule = BDModules.get(e => e.default && e.default.getMessages)[0].default;\nclass PluginCertifier {\n constructor() {}\n\n start() {\n const dispatcher = window.Lightcord.DiscordModules.dispatcher;\n const constants = window.Lightcord.DiscordModules.constants;\n const originalFetchMessages = fetchMessagesModule.fetchMessages;\n\n fetchMessagesModule.fetchMessages = function () {\n const returnValue = originalFetchMessages.apply(this, arguments);\n\n if (returnValue instanceof Promise) {\n returnValue.then(() => {\n const ev = getMessagesModule.getMessages(ChannelModule.getChannelId());\n process.nextTick(() => {\n for (const message of ev._array) {\n const attachments = message.attachments || [];\n if (attachments.length === 0) continue; // no attachments\n\n attachments.forEach(attachment => {\n processAttachment(attachment);\n });\n }\n });\n });\n }\n\n return returnValue;\n };\n\n const originalFetchMessages2 = fetchMessagesModule2.fetchMessages;\n\n fetchMessagesModule2.fetchMessages = function () {\n const returnValue = originalFetchMessages2.apply(this, arguments);\n\n if (returnValue instanceof Promise) {\n returnValue.then(() => {\n const ev = getMessagesModule.getMessages(ChannelModule.getChannelId());\n process.nextTick(() => {\n for (const message of ev._array) {\n const attachments = message.attachments || [];\n if (attachments.length === 0) continue; // no attachments\n\n attachments.forEach(attachment => {\n processAttachment(attachment);\n });\n }\n });\n });\n }\n\n return returnValue;\n };\n\n const alreadyUsed = {};\n const originalGetPinnedMessages = PinnedModule.getPinnedMessages.bind(PinnedModule);\n\n PinnedModule.getPinnedMessages = function () {\n const pinned = originalGetPinnedMessages(...arguments);\n if (!pinned || alreadyUsed[pinned.id]) return pinned;\n alreadyUsed[pinned.id] = true;\n setTimeout(() => {\n delete alreadyUsed[pinned.id];\n\n for (const message of pinned.messages) {\n const attachments = message.attachments || [];\n if (attachments.length === 0) continue; // no attachments\n\n attachments.forEach(attachment => {\n processAttachment(attachment);\n });\n }\n }, 50);\n return pinned;\n };\n\n dispatcher.subscribe(constants.ActionTypes.MESSAGE_CREATE, ev => {\n const message = ev.message;\n if (message.channel_id !== ChannelModule.getChannelId()) return;\n process.nextTick(() => {\n const attachments = message.attachments || [];\n if (attachments.length === 0) return; // no attachments\n\n attachments.forEach(attachment => {\n processAttachment(attachment);\n });\n });\n });\n const messages = getMessagesModule.getMessages(ChannelModule.getChannelId());\n process.nextTick(() => {\n for (const message of messages._array) {\n const attachments = message.attachments || [];\n if (attachments.length === 0) continue; // no attachments\n\n attachments.forEach(attachment => {\n processAttachment(attachment);\n });\n }\n });\n }\n\n}\n/*\r\nfunction checkViruses(hash, data){\r\n data = data.toString(\"utf8\").split(/[^\\w\\d]+/g)\r\n let isHarmful = false\r\n for(let keyword of data){\r\n for(let oof of [\r\n \"token\",\r\n \"email\",\r\n \"phone\",\r\n \"MFA\",\r\n \"2fa\",\r\n \"process.exit\",\r\n \"child_process\",\r\n \"localStorage\"\r\n ]){\r\n if(keyword.toLowerCase().includes(oof.toLowerCase())){\r\n console.log(keyword, oof)\r\n isHarmful = true\r\n break\r\n } \r\n }\r\n if(isHarmful)break\r\n }\r\n console.log(isHarmful)\r\n if(!isHarmful)return\r\n cache[hash] = {\r\n suspect: true,\r\n name: hashToUrl[hash].split(\"/\").pop(),\r\n type: hashToUrl[hash].endsWith(\".js\") ? \"Plugin\" : \"Theme\" \r\n }\r\n\r\n let elements = Array.from(document.querySelectorAll(`a[href=\"${hashToUrl[hash]}\"]`)).filter(e => !e.classList.contains(\"da-fileNameLink\")).map(e => e.parentElement)\r\n renderToElements(elements, cache[hash], cache[hash].name)\r\n}*/\n\nconst hashToUrl = {};\n\nfunction processAttachment(attachment) {\n if (!attachment.url.startsWith(\"https://cdn.discordapp.com/\")) return;\n if (!attachment.filename.endsWith(\".plugin.js\") && !attachment.filename.endsWith(\".theme.css\")) return;\n\n let nextHash = (hash, data) => {\n if (!cache[hash]) {\n node_fetch__WEBPACK_IMPORTED_MODULE_0___default()(\"https://raw.githubusercontent.com/Lightcord/filehashes/master/hashes/\" + hash, {\n headers: {\n \"User-Agent\": electron__WEBPACK_IMPORTED_MODULE_1__[\"remote\"].getCurrentWebContents().userAgent\n }\n }).then(async res => {\n if (res.status !== 200) return; //checkViruses(hash, data)\n\n const result = await res.json();\n debug && console.log(`Hash valid:`, result);\n cache[hash] = result;\n let elements = Array.from(document.querySelectorAll(`a[href=\"${attachment.url}\"]`)).filter(e => !e.classList.contains(\"da-fileNameLink\")).map(e => e.parentElement);\n renderToElements(elements, result, attachment.filename);\n }).catch(() => {});\n } else {\n const result = cache[hash];\n debug && console.log(`Hash Cached:`, result);\n let elements = Array.from(document.querySelectorAll(`a[href=\"${attachment.url}\"]`)).filter(e => !e.classList.contains(\"da-fileNameLink\")).map(e => e.parentElement);\n renderToElements(elements, result, attachment.filename);\n }\n };\n\n if (cache2[attachment.url]) return nextHash(cache2[attachment.url]);\n node_fetch__WEBPACK_IMPORTED_MODULE_0___default()(attachment.url, {\n headers: {\n \"User-Agent\": electron__WEBPACK_IMPORTED_MODULE_1__[\"remote\"].getCurrentWebContents().userAgent\n }\n }).then(res => {\n if (res.status !== 200) throw new Error(\"File doesn't exist.\");\n const hash = crypto__WEBPACK_IMPORTED_MODULE_2__[\"createHash\"](\"sha256\");\n let data = Buffer.alloc(0);\n res.body.on(\"data\", chunk => {\n data = Buffer.concat([data, chunk]);\n hash.update(chunk);\n });\n res.body.on(\"end\", () => {\n const hashResult = hash.digest(\"hex\");\n debug && console.log(`Calculated hash for file ${attachment.filename}: ${hashResult}`);\n cache2[attachment.url] = hashResult;\n hashToUrl[hashResult] = attachment.url;\n nextHash(hashResult, data);\n });\n }).catch(() => {});\n}\n\nconst flowerStarModule = BDModules.get(e => e.flowerStarContainer)[0];\nconst childModule = BDModules.get(e => e.childContainer)[0];\n/**\r\n * \r\n * @param {HTMLDivElement[]} elements \r\n * @param {{type: \"Theme\"|\"Plugin\", name: string, official?: boolean}|{suspect:true, type: \"Theme\"|\"Plugin\", name: string}} result\r\n */\n\nfunction renderToElements(elements, result, filename) {\n elements.forEach(e => {\n if (e.childNodes.length > 3) return;\n const div = document.createElement(\"div\");\n e.appendChild(div);\n /*\r\n if(result.suspect){\r\n e.style.backgroundColor = \"#E13838\"\r\n /**\r\n * \r\n * @param {HTMLElement} node \r\n */\n\n /*\r\n let nextNode = (node) => {\r\n for(let child of node.children){\r\n if(child.tagName === \"a\"){\r\n child.addEventListener(\"click\", (e) => {\r\n e.preventDefault()\r\n alert(\"You are about to download a suspect \"+result.type.toLowerCase()+\". Are you sure ? If yes, then please copy and paste the URL directly into your browser.\")\r\n })\r\n }else if([\"div\"].includes(child.tagName)){\r\n nextNode(child)\r\n }\r\n }\r\n }\r\n nextNode(e)\r\n }else */\n\n if (!result.official) {\n _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].reactDom.render(_v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n text: result.type + \" \" + result.name + \" is certified by Lightcord.\"\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"div\", {\n className: flowerStarModule.flowerStarContainer,\n style: {\n width: \"16px\",\n height: \"16px\"\n }\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"svg\", {\n className: flowerStarModule.flowerStar,\n \"aria-hidden\": \"false\",\n width: \"16px\",\n height: \"16px\",\n viewBox: \"0 0 16 15.2\"\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"path\", {\n fill: \"#4f545c\",\n \"fill-rule\": \"evenodd\",\n d: \"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z\"\n })), _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"div\", {\n className: childModule.childContainer\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"svg\", {\n \"aria-hidden\": \"false\",\n width: \"16px\",\n height: \"16px\",\n viewBox: \"0 0 16 15.2\"\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"path\", {\n fill: \"#ffffff\",\n d: \"M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z\"\n }))))), div);\n } else {\n _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].reactDom.render(_v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n text: result.type + \" \" + result.name + \" was made by the developers of Lightcord.\",\n style: \"brand\"\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"div\", {\n className: flowerStarModule.flowerStarContainer,\n style: {\n width: \"16px\",\n height: \"16px\"\n }\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"svg\", {\n className: flowerStarModule.flowerStar,\n \"aria-hidden\": \"false\",\n width: \"16px\",\n height: \"16px\",\n viewBox: \"0 0 16 15.2\",\n stroke: \"#36393f\",\n style: {\n color: \"#4087ed\"\n }\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z\"\n })), _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"div\", {\n className: childModule.childContainer\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"svg\", {\n \"aria-hidden\": \"false\",\n width: \"16px\",\n height: \"16px\",\n viewBox: \"0 0 16 15.2\"\n }, _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react.createElement(\"path\", {\n fill: \"#ffffff\",\n d: \"M10.7,5.28a2.9,2.9,0,0,0-2.11.86.11.11,0,0,0,0,.16l1.05.94a.11.11,0,0,0,.15,0,1.27,1.27,0,0,1,.9-.33c.65,0,.65.73.65.73a.64.64,0,0,1-.65.65,1.73,1.73,0,0,1-1.18-.54c-.31-.26-.36-.32-.73-.66S7.06,5.28,5.65,5.28A2.26,2.26,0,0,0,3.37,7.56,2.59,2.59,0,0,0,3.82,9a2.18,2.18,0,0,0,1.83.89,2.94,2.94,0,0,0,2.1-.81.11.11,0,0,0,0-.16L6.74,8A.11.11,0,0,0,6.6,8a1.58,1.58,0,0,1-.94.29h0A.71.71,0,0,1,5,7.56H5a.63.63,0,0,1,.65-.64c.71,0,1.42.75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cbiAgICBwcm9jZXNzLm5leHRUaWNrKCgpID0+IHtcbiAgICAgIGZvciAoY29uc3QgbWVzc2FnZSBvZiBtZXNzYWdlcy5fYXJyYXkpIHtcbiAgICAgICAgY29uc3QgYXR0YWNobWVudHMgPSBtZXNzYWdlLmF0dGFjaG1lbnRzIHx8IFtdO1xuICAgICAgICBpZiAoYXR0YWNobWVudHMubGVuZ3RoID09PSAwKSBjb250aW51ZTsgLy8gbm8gYXR0YWNobWVudHNcblxuICAgICAgICBhdHRhY2htZW50cy5mb3JFYWNoKGF0dGFjaG1lbnQgPT4ge1xuICAgICAgICAgIHByb2Nlc3NBdHRhY2htZW50KGF0dGFjaG1lbnQpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxuXG59XG4vKlxyXG5mdW5jdGlvbiBjaGVja1ZpcnVzZXMoaGFzaCwgZGF0YSl7XHJcbiAgICBkYXRhID0gZGF0YS50b1N0cmluZyhcInV0ZjhcIikuc3BsaXQoL1teXFx3XFxkXSsvZylcclxuICAgIGxldCBpc0hhcm1mdWwgPSBmYWxzZVxyXG4gICAgZm9yKGxldCBrZXl3b3JkIG9mIGRhdGEpe1xyXG4gICAgICAgIGZvcihsZXQgb29mIG9mIFtcclxuICAgICAgICAgICAgXCJ0b2tlblwiLFxyXG4gICAgICAgICAgICBcImVtYWlsXCIsXHJcbiAgICAgICAgICAgIFwicGhvbmVcIixcclxuICAgICAgICAgICAgXCJNRkFcIixcclxuICAgICAgICAgICAgXCIyZmFcIixcclxuICAgICAgICAgICAgXCJwcm9jZXNzLmV4aXRcIixcclxuICAgICAgICAgICAgXCJjaGlsZF9wcm9jZXNzXCIsXHJcbiAgICAgICAgICAgIFwibG9jYWxTdG9yYWdlXCJcclxuICAgICAgICBdKXtcclxuICAgICAgICAgICAgaWYoa2V5d29yZC50b0xvd2VyQ2FzZSgpLmluY2x1ZGVzKG9vZi50b0xvd2VyQ2FzZSgpKSl7XHJcbiAgICAgICAgICAgICAgICB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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/modules/pluginCertifier.js\n")},"./src/modules/pluginModule.js":/*!*************************************!*\
|
|
!*** ./src/modules/pluginModule.js ***!
|
|
\*************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _bdEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\n\n\n\nclass PluginModule {\n get folder() {\n return _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].pluginsFolder;\n }\n\n}\n\nPluginModule.prototype.loadPlugins = function () {\n this.loadPluginData();\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].splice(0, 0, ..._contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadPlugins());\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n let plugin, name;\n\n try {\n plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n name = plugin.getName();\n if (plugin.load && typeof plugin.load == \"function\") plugin.load();\n } catch (err) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", name + \" could not be loaded.\", err);\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].push({\n name: name,\n file: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].filename,\n message: \"load() could not be fired.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n });\n continue;\n }\n\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name]) _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name]) {\n try {\n plugin.start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin.getName()} v${plugin.getVersion()} has started.`);\n } catch (err) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", name + \" could not be started.\", err);\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].push({\n name: name,\n file: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].filename,\n message: \"start() could not be fired.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n });\n }\n }\n }\n\n this.savePluginData();\n\n __webpack_require__(/*! electron */ \"electron\").remote.getCurrentWebContents().on(\"did-navigate-in-page\", this.channelSwitch.bind(this)); // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"plugin\");\n\n};\n\nPluginModule.prototype.startPlugin = function (plugin, reload = false) {\n try {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} has started.`);\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} could not be started.`, {\n type: \"error\"\n });\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = false;\n this.savePluginData();\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", plugin + \" could not be started.\", err);\n }\n};\n\nPluginModule.prototype.stopPlugin = function (plugin, reload = false) {\n try {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.stop();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} has stopped.`);\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} could not be stopped.`, {\n type: \"error\"\n });\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName() + \" could not be stopped.\", err);\n }\n};\n\nPluginModule.prototype.enablePlugin = function (plugin, reload = false) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) return;\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = true;\n this.savePluginData();\n this.startPlugin(plugin, reload);\n};\n\nPluginModule.prototype.enable = function (plugin, reload = false) {\n return this.enablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.disablePlugin = function (plugin, reload = false) {\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) return;\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = false;\n this.savePluginData();\n this.stopPlugin(plugin, reload);\n};\n\nPluginModule.prototype.disable = function (plugin, reload = false) {\n return this.disablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.togglePlugin = function (plugin) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) this.disablePlugin(plugin);else this.enablePlugin(plugin);\n};\n\nPluginModule.prototype.toggle = function (plugin, reload = false) {\n return this.togglePlugin(plugin, reload);\n};\n\nPluginModule.prototype.loadPlugin = function (filename) {\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadContent(filename, \"plugin\");\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${filename} could not be loaded.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${filename} could not be loaded.`, error);\n }\n\n const plugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filename).plugin;\n\n try {\n if (plugin.load && typeof plugin.load == \"function\") plugin.load();\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [err]\n });\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin.getName()} v${plugin.getVersion()} was loaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin.getName()} v${plugin.getVersion()} was loaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-loaded\", plugin.getName());\n};\n\nPluginModule.prototype.unloadPlugin = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return;\n const plugin = bdplugin.plugin.getName();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) this.disablePlugin(plugin, true);\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].unloadContent(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].filename, \"plugin\");\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin];\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} could not be unloaded. It may have not been loaded yet.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${plugin} could not be unloaded. It may have not been loaded yet.`, error);\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin} was unloaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} was unloaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-unloaded\", plugin);\n};\n\nPluginModule.prototype.delete = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return;\n this.unloadPlugin(bdplugin.filename);\n\n const fullPath = __webpack_require__(/*! path */ \"path\").resolve(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].pluginsFolder, bdplugin.filename);\n\n __webpack_require__(/*! fs */ \"fs\").unlinkSync(fullPath);\n};\n\nPluginModule.prototype.reloadPlugin = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return this.loadPlugin(filenameOrName);\n const plugin = bdplugin.plugin.getName();\n const enabled = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin];\n if (enabled) this.stopPlugin(plugin, true);\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reloadContent(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].filename, \"plugin\");\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} could not be reloaded.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${plugin} could not be reloaded.`, error);\n }\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load && typeof _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load == \"function\") _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load();\n if (enabled) this.startPlugin(plugin, true);\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} was reloaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} was reloaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-reloaded\", plugin);\n};\n\nPluginModule.prototype.reload = function (name) {\n return this.reloadPlugin(name);\n};\n\nPluginModule.prototype.edit = function (filenameOrName) {\n console.log(\"Edit \" + filenameOrName);\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return;\n\n const fullPath = __webpack_require__(/*! path */ \"path\").resolve(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].pluginsFolder, bdplugin.filename);\n\n console.log(\"Edit \" + fullPath);\n\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(`${fullPath}`);\n};\n\nPluginModule.prototype.updatePluginList = function () {\n const results = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadNewContent(\"plugin\");\n\n for (const filename of results.added) this.loadPlugin(filename);\n\n for (const name of results.removed) this.unloadPlugin(name);\n};\n\nPluginModule.prototype.loadPluginData = function () {\n const saved = _dataStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSettingGroup(\"plugins\");\n\n if (saved) {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"], saved);\n }\n};\n\nPluginModule.prototype.savePluginData = function () {\n _dataStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setSettingGroup(\"plugins\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"]);\n};\n\nPluginModule.prototype.newMessage = function () {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.onMessage === \"function\") {\n try {\n plugin.onMessage();\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire onMessage for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\nPluginModule.prototype.channelSwitch = function () {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.onSwitch === \"function\") {\n try {\n plugin.onSwitch();\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire onSwitch for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\nPluginModule.prototype.rawObserver = function (e) {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.observer === \"function\") {\n try {\n plugin.observer(e);\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire observer for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new PluginModule());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9wbHVnaW5Nb2R1bGUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL21vZHVsZXMvcGx1Z2luTW9kdWxlLmpzP2FhN2YiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgYmRwbHVnaW5FcnJvcnMsIHBsdWdpbkNvb2tpZSwgc2V0dGluZ3NDb29raWUsIGJkcGx1Z2lucyB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IENvbnRlbnRNYW5hZ2VyIGZyb20gXCIuL2NvbnRlbnRNYW5hZ2VyXCI7XG5pbXBvcnQgRGF0YVN0b3JlIGZyb20gXCIuL2RhdGFTdG9yZVwiO1xuaW1wb3J0IEJERXZlbnRzIGZyb20gXCIuL2JkRXZlbnRzXCI7XG5pbXBvcnQgVXRpbHMgZnJvbSBcIi4vdXRpbHNcIjtcblxuY2xhc3MgUGx1Z2luTW9kdWxlIHtcbiAgZ2V0IGZvbGRlcigpIHtcbiAgICByZXR1cm4gQ29udGVudE1hbmFnZXIucGx1Z2luc0ZvbGRlcjtcbiAgfVxuXG59XG5cblBsdWdpbk1vZHVsZS5wcm90b3R5cGUubG9hZFBsdWdpbnMgPSBmdW5jdGlvbiAoKSB7XG4gIHRoaXMubG9hZFBsdW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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/modules/pluginModule.js\n")},"./src/modules/publicServers.js":/*!**************************************!*\
|
|
!*** ./src/modules/publicServers.js ***!
|
|
\**************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _webpackModules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./webpackModules */ \"./src/modules/webpackModules.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _ui_publicservers_publicServers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/publicservers/publicServers */ \"./src/ui/publicservers/publicServers.js\");\n/* harmony import */ var _ui_publicservers_layer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ui/publicservers/layer */ \"./src/ui/publicservers/layer.js\");\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class V2_PublicServers {\n constructor() {\n this._appendButton = this._appendButton.bind(this);\n }\n\n get component() {\n return _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_ui_publicservers_layer__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n rootId: \"pubslayerroot\",\n id: \"pubslayer\"\n }, _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_ui_publicservers_publicServers__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n rootId: \"pubslayerroot\"\n }));\n }\n\n get root() {\n const _root = document.getElementById(\"pubslayerroot\");\n\n if (!_root) {\n if (!this.injectRoot()) return null;\n return this.root;\n }\n\n return _root;\n }\n\n injectRoot() {\n let [classNameLayers] = [BDModules.get(e => e.layers && e.layer)[0].layers.split(\" \")[0]];\n const layers = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\".layers, .\" + classNameLayers);\n if (!layers) return false;\n layers.append(_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(\"<div id='pubslayerroot'>\"));\n return true;\n }\n\n render() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layers\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reactDom.render(this.component, root);\n }\n\n get button() {\n const btn = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(`<div id=\"bd-pub-li\" class=\"${_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].guildClasses.listItem}\">`);\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-1\"]) btn.style.display = \"none\";\n const label = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(`<div id=\"bd-pub-button\" class=\"${\"wrapper-25eVIn \" + _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].guildClasses.circleButtonMask}\">public</div>`);\n label.addEventListener(\"click\", () => {\n this.render();\n });\n btn.append(label);\n return btn;\n }\n\n _appendButton() {\n let [classNameScroller] = [BDModules.get(e => e.scroller && e.scrollbarWidth)[0].scroller];\n if (_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#bd-pub-li\")) return;\n const wrapper = _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].guildClasses.wrapper.split(\" \")[0];\n const guilds = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(`.${wrapper} .${classNameScroller} >:first-child`);\n _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].after(guilds, this.button);\n }\n\n addButton() {\n if (this.guildPatch) return;\n const GuildList = _webpackModules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].find(m => m.default && m.default.displayName == \"NavigableGuilds\");\n const GuildListOld = _webpackModules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].findByDisplayName(\"Guilds\");\n if (!GuildList && !GuildListOld) _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn(\"PublicServer\", \"Can't find GuildList component\");\n this.guildPatch = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].monkeyPatch(GuildList ? GuildList : GuildListOld.prototype, GuildList ? \"default\" : \"render\", {\n after: this._appendButton\n });\n\n this._appendButton();\n }\n\n removeButton() {\n this.guildPatch();\n delete this.guildPatch;\n _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#bd-pub-li\").remove();\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9wdWJsaWNTZXJ2ZXJzLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy9tb2R1bGVzL3B1YmxpY1NlcnZlcnMuanM/ZTBlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzZXR0aW5nc0Nvb2tpZSB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IEJEVjIgZnJvbSBcIi4vdjJcIjtcbmltcG9ydCB3ZWJwYWNrTW9kdWxlcyBmcm9tIFwiLi93ZWJwYWNrTW9kdWxlc1wiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuL2RvbXRvb2xzXCI7XG5pbXBvcnQgVjJDX1B1YmxpY1NlcnZlcnMgZnJvbSBcIi4uL3VpL3B1YmxpY3NlcnZlcnMvcHVibGljU2VydmVyc1wiO1xuaW1wb3J0IExheWVyIGZyb20gXCIuLi91aS9wdWJsaWNzZXJ2ZXJzL2xheWVyXCI7XG5leHBvcnQgZGVmYXVsdCBuZXcgY2xhc3MgVjJfUHVibGljU2VydmVycyB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHRoaXMuX2FwcGVuZEJ1dHRvbiA9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CIjYmQtcHViLWxpXCIpLnJlbW92ZSgpO1xuICB9XG5cbn0oKTsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/modules/publicServers.js\n")},"./src/modules/reactDevTools.js":/*!**************************************!*\
|
|
!*** ./src/modules/reactDevTools.js ***!
|
|
\**************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n\n\n\nconst electron = __webpack_require__(/*! electron */ \"electron\");\n\nconst fs = __webpack_require__(/*! fs */ \"fs\");\n\nconst path = __webpack_require__(/*! path */ \"path\");\n\nconst BrowserWindow = electron.remote.BrowserWindow;\nconst webContents = electron.remote.getCurrentWebContents();\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class reactDevTools {\n constructor() {\n let extensionPath = \"\";\n if (process.platform === \"win32\") extensionPath = path.resolve(process.env.LOCALAPPDATA, \"Google/Chrome/User Data\");else if (process.platform === \"linux\") extensionPath = path.resolve(process.env.HOME, \".config/google-chrome\");else if (process.platform === \"darwin\") extensionPath = path.resolve(process.env.HOME, \"Library/Application Support/Google/Chrome\");else extensionPath = path.resolve(process.env.HOME, \".config/chromium\");\n extensionPath += \"/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/\";\n\n if (fs.existsSync(extensionPath)) {\n const versions = fs.readdirSync(extensionPath);\n extensionPath = path.resolve(extensionPath, versions[versions.length - 1]);\n }\n\n this.extensionPath = extensionPath;\n this.isExtensionInstalled = fs.existsSync(extensionPath);\n this.listener = this.listener.bind(this);\n _0globals__WEBPACK_IMPORTED_MODULE_1__[\"settings\"][\"React DevTools\"].hidden = !this.isExtensionInstalled;\n }\n\n listener() {\n if (!this.isExtensionInstalled) return;\n BrowserWindow.removeDevToolsExtension(\"React Developer Tools\");\n const didInstall = BrowserWindow.addDevToolsExtension(this.extensionPath);\n if (didInstall) _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].log(\"React DevTools\", \"Successfully installed react devtools.\");else _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].err(\"React DevTools\", \"Couldn't find react devtools in chrome extensions!\");\n }\n\n start() {\n setImmediate(() => webContents.on(\"devtools-opened\", this.listener));\n if (webContents.isDevToolsOpened()) this.listener();\n }\n\n stop() {\n webContents.removeListener(\"devtools-opened\", this.listener);\n }\n\n}());//# sourceURL=[module]\n//# sour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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/reactDevTools.js\n")},"./src/modules/settingsPanel.js":/*!**************************************!*\
|
|
!*** ./src/modules/settingsPanel.js ***!
|
|
\**************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _settingsPanelSidebar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settingsPanelSidebar */ \"./src/modules/settingsPanelSidebar.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _bdEvents__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _coloredText__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./coloredText */ \"./src/modules/coloredText.js\");\n/* harmony import */ var _24hour__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./24hour */ \"./src/modules/24hour.js\");\n/* harmony import */ var _reactDevTools__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./reactDevTools */ \"./src/modules/reactDevTools.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _publicServers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./publicServers */ \"./src/modules/publicServers.js\");\n/* harmony import */ var _voiceMode__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./voiceMode */ \"./src/modules/voiceMode.js\");\n/* harmony import */ var _classNormalizer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./classNormalizer */ \"./src/modules/classNormalizer.js\");\n/* harmony import */ var _devMode__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./devMode */ \"./src/modules/devMode.js\");\n/* harmony import */ var _ui_tools__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../ui/tools */ \"./src/ui/tools.js\");\n/* harmony import */ var _ui_scroller__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../ui/scroller */ \"./src/ui/scroller.js\");\n/* harmony import */ var _ui_sectionedSettingsPanel__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../ui/sectionedSettingsPanel */ \"./src/ui/sectionedSettingsPanel.js\");\n/* harmony import */ var _ui_settingsPanel__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../ui/settingsPanel */ \"./src/ui/settingsPanel.js\");\n/* harmony import */ var _ui_cssEditor__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../ui/cssEditor */ \"./src/ui/cssEditor.js\");\n/* harmony import */ var _ui_addonlist__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../ui/addonlist */ \"./src/ui/addonlist.jsx\");\n/* harmony import */ var _ui_presenceSettings__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../ui/presenceSettings */ \"./src/ui/presenceSettings.jsx\");\n/* harmony import */ var _CustomRichPresence__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./CustomRichPresence */ \"./src/modules/CustomRichPresence.js\");\n/* harmony import */ var _ui_AccountInfos__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../ui/AccountInfos */ \"./src/ui/AccountInfos.jsx\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_24__);\n/* harmony import */ var _AntiAdDM__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./AntiAdDM */ \"./src/modules/AntiAdDM.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class V2_SettingsPanel {\n constructor() {\n this.sideBarOnClick = this.sideBarOnClick.bind(this);\n this.onChange = this.onChange.bind(this);\n this.updateSettings = this.updateSettings.bind(this);\n this.sidebar = new _settingsPanelSidebar__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.sideBarOnClick); // this.buildPluginProps = this.buildPluginProps.bind(this);\n // this.buildThemeProps = this.buildThemeProps.bind(this);\n\n this.showOriginal = this.showOriginal.bind(this);\n }\n\n get root() {\n const _root = _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].query(\"#bd-settingspane-container\");\n\n if (!_root) {\n if (!this.injectRoot()) return null;\n return this.root;\n }\n\n return _root;\n }\n\n injectRoot() {\n let [classNameLayer, classSidebar] = [BDModules.get(e => e.layer && e.animating)[0].layer.split(\" \")[0], BDModules.get(e => e.standardSidebarView)[0]];\n const sidebar = _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].query(\".\" + classNameLayer + \" .\" + classSidebar.standardSidebarView.split(\" \")[0] + \", .\" + classNameLayer + \" .ui-standard-sidebar-view\");\n if (!sidebar) return false;\n const root = _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].createElement(`<div id=\"bd-settingspane-container\" class=\"${classSidebar.contentRegion} content-region\">`);\n sidebar.append(root);\n _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].onRemoved(root, () => {\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.unmountComponentAtNode(root);\n });\n return true;\n }\n\n get coreSettings() {\n const settings = this.getSettings(\"core\");\n const categories = [...new Set(settings.map(s => s.category))];\n const sections = categories.map(c => {\n return {\n title: c,\n settings: settings.filter(s => s.category == c)\n };\n });\n return sections;\n }\n\n get lightcordSettings() {\n const settings = this.getSettings(\"lightcord\");\n const categories = [...new Set(settings.map(s => s.category))];\n const sections = categories.map(c => {\n return {\n title: c,\n settings: settings.filter(s => s.category == c)\n };\n });\n return sections;\n }\n\n get PresenceSettings() {\n return this.getSettings(\"status\");\n }\n\n get MsgLogSettings() {\n return this.getSettings(\"msglog\");\n }\n\n getSettings(category) {\n return Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"]).reduce((arr, key) => {\n const setting = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"][key];\n\n if (setting.cat === category && setting.implemented && !setting.hidden) {\n setting.text = key;\n arr.push(setting);\n }\n\n return arr;\n }, []);\n }\n\n sideBarOnClick(id) {\n const contentRegion = _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].query(\".contentRegion-3nDuYy, .content-region\");\n contentRegion.style.display = \"none\";\n this.root.style.display = \"\";\n\n switch (id) {\n case \"core\":\n this.renderCoreSettings();\n break;\n\n case \"customcss\":\n this.renderCustomCssEditor();\n break;\n\n case \"plugins\":\n case \"themes\":\n this.renderAddonPane(id);\n break;\n\n case \"lightcord\":\n this.renderLightCordSettings();\n break;\n\n case \"status\":\n this.renderPresenceSettings();\n break;\n\n case \"accountinfo\":\n this.renderAccountInfos();\n break;\n }\n }\n\n onClick() {}\n\n onChange(id, checked) {\n this.updateSettings(id, checked);\n }\n\n updateSettings(id, enabled) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][id] = enabled;\n\n if (id == \"bda-gs-2\") {\n if (enabled) _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].addClass(document.body, \"bd-minimal\");else _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeClass(document.body, \"bd-minimal\");\n }\n\n if (id == \"bda-gs-3\") {\n if (enabled) _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].addClass(document.body, \"bd-minimal-chan\");else _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeClass(document.body, \"bd-minimal-chan\");\n }\n\n if (id == \"bda-gs-1\") {\n if (enabled) _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].addButton();else _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].removeButton();\n }\n\n if (id == \"bda-gs-4\") {\n if (enabled) _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].start();else _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].stop();\n }\n\n if (id == \"bda-gs-5\") {\n if (enabled) _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].addClass(_domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].query(\"#app-mount\"), \"bda-dark\");else _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeClass(_domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].query(\"#app-mount\"), \"bda-dark\");\n }\n\n if (enabled && id == \"bda-gs-6\") _24hour__WEBPACK_IMPORTED_MODULE_8__[\"default\"].inject24Hour();\n\n if (id == \"bda-gs-7\") {\n if (enabled) _coloredText__WEBPACK_IMPORTED_MODULE_7__[\"default\"].injectColoredText();else _coloredText__WEBPACK_IMPORTED_MODULE_7__[\"default\"].removeColoredText();\n }\n\n if (id == \"fork-ps-4\") {\n if (enabled) _classNormalizer__WEBPACK_IMPORTED_MODULE_13__[\"default\"].start();else _classNormalizer__WEBPACK_IMPORTED_MODULE_13__[\"default\"].stop();\n }\n\n if (id == \"fork-ps-5\") {\n if (enabled) {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"theme\");\n } else {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].unwatchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].unwatchContent(\"theme\");\n }\n }\n\n if (id == \"fork-wp-1\") {\n _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setWindowPreference(\"transparent\", enabled);\n if (enabled) _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setWindowPreference(\"backgroundColor\", null);else _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setWindowPreference(\"backgroundColor\", \"#2f3136\");\n }\n\n if (id == \"bda-gs-8\") {\n if (enabled) _devMode__WEBPACK_IMPORTED_MODULE_14__[\"default\"].startDebugListener();else _devMode__WEBPACK_IMPORTED_MODULE_14__[\"default\"].stopDebugListener();\n }\n\n if (id == \"fork-dm-1\") {\n if (enabled) _devMode__WEBPACK_IMPORTED_MODULE_14__[\"default\"].startCopySelector();else _devMode__WEBPACK_IMPORTED_MODULE_14__[\"default\"].stopCopySelector();\n }\n\n if (id === \"reactDevTools\") {\n if (enabled) _reactDevTools__WEBPACK_IMPORTED_MODULE_9__[\"default\"].start();else _reactDevTools__WEBPACK_IMPORTED_MODULE_9__[\"default\"].stop();\n }\n\n if (id === \"lightcord-1\") {\n if (enabled) window.Lightcord.Settings.devMode = true;else window.Lightcord.Settings.devMode = false;\n }\n\n if (id === \"lightcord-2\") {\n if (enabled) window.Lightcord.Settings.callRingingBeat = true;else window.Lightcord.Settings.callRingingBeat = false;\n }\n\n if (id === \"lightcord-presence-1\") {\n if (enabled) _CustomRichPresence__WEBPACK_IMPORTED_MODULE_22__[\"default\"].enable();else _CustomRichPresence__WEBPACK_IMPORTED_MODULE_22__[\"default\"].disable();\n }\n\n if (id === \"lightcord-3\") {\n if (enabled) electron__WEBPACK_IMPORTED_MODULE_24__[\"remote\"].getCurrentWindow().setAlwaysOnTop(true);else electron__WEBPACK_IMPORTED_MODULE_24__[\"remote\"].getCurrentWindow().setAlwaysOnTop(false);\n }\n\n if (id === \"lightcord-4\") {\n if (enabled) {\n _AntiAdDM__WEBPACK_IMPORTED_MODULE_25__[\"default\"].enable();\n } else {\n _AntiAdDM__WEBPACK_IMPORTED_MODULE_25__[\"default\"].disable();\n }\n }\n\n this.saveSettings();\n }\n\n async initializeSettings() {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"].reactDevTools) _reactDevTools__WEBPACK_IMPORTED_MODULE_9__[\"default\"].start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-2\"]) _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].addClass(document.body, \"bd-minimal\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-3\"]) _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].addClass(document.body, \"bd-minimal-chan\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-1\"]) _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].addButton();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-4\"]) _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-5\"]) _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].addClass(_domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].query(\"#app-mount\"), \"bda-dark\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-6\"]) _24hour__WEBPACK_IMPORTED_MODULE_8__[\"default\"].inject24Hour();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-7\"]) _coloredText__WEBPACK_IMPORTED_MODULE_7__[\"default\"].injectColoredText();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-4\"]) _classNormalizer__WEBPACK_IMPORTED_MODULE_13__[\"default\"].start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"lightcord-1\"]) window.Lightcord.Settings.devMode = true;\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"lightcord-2\"]) window.Lightcord.Settings.callRingingBeat = true;\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"lightcord-presence-1\"]) _CustomRichPresence__WEBPACK_IMPORTED_MODULE_22__[\"default\"].enable();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"lightcord-3\"]) electron__WEBPACK_IMPORTED_MODULE_24__[\"remote\"].getCurrentWindow().setAlwaysOnTop(true);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"lightcord-4\"]) _AntiAdDM__WEBPACK_IMPORTED_MODULE_25__[\"default\"].enable();\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-5\"]) {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"theme\");\n }\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-8\"]) _devMode__WEBPACK_IMPORTED_MODULE_14__[\"default\"].startDebugListener();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-dm-1\"]) _devMode__WEBPACK_IMPORTED_MODULE_14__[\"default\"].startCopySelector();\n this.saveSettings();\n }\n\n saveSettings() {\n _dataStore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setSettingGroup(\"settings\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"]);\n _dataStore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setSettingGroup(\"rpc\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsRPC\"]);\n }\n\n loadSettings() {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"], _dataStore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSettingGroup(\"settings\"));\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsRPC\"], _dataStore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSettingGroup(\"rpc\"));\n }\n\n showOriginal() {\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.unmountComponentAtNode(this.root);\n this.root.style.display = \"none\";\n _domtools__WEBPACK_IMPORTED_MODULE_10__[\"default\"].query(\".\" + BDModules.get(e => e.contentRegion)[0].contentRegion.split(\" \")[0] + \", .content-region\").style.display = \"\";\n }\n\n renderSidebar() {\n const tabs = document.querySelectorAll(\"[class*='side-'] > [class*='item-']\");\n\n for (const element of tabs) {\n element.removeEventListener(\"click\", this.showOriginal);\n element.addEventListener(\"click\", this.showOriginal);\n }\n\n this.sidebar.render();\n }\n\n get coreComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_16__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true\n }, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_sectionedSettingsPanel__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"cspanel\",\n onChange: this.onChange,\n sections: this.coreSettings\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_15__[\"default\"], {\n key: \"tools\"\n }));\n }\n\n get lightcordComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_16__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true\n }, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_sectionedSettingsPanel__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"lspannel\",\n onChange: this.onChange,\n sections: this.lightcordSettings\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_15__[\"default\"], {\n key: \"tools\"\n }));\n }\n\n get PresenceComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_16__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true\n }, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_presenceSettings__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n key: \"lppannel\",\n onChange: this.onChange,\n settings: this.PresenceSettings\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_15__[\"default\"], {\n key: \"tools\"\n }));\n }\n\n get AccountInfosComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_16__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true\n }, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_AccountInfos__WEBPACK_IMPORTED_MODULE_23__[\"default\"], {\n key: \"lapannel\"\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_15__[\"default\"], {\n key: \"tools\"\n }));\n }\n\n get customCssComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_16__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true\n }, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_cssEditor__WEBPACK_IMPORTED_MODULE_19__[\"default\"], {\n key: \"csseditor\"\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_15__[\"default\"], {\n key: \"tools\"\n }));\n }\n\n renderCoreSettings() {\n const root = this.root;\n if (!root) return _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].err(\"SettingsPanel\", \"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.coreComponent, root);\n }\n\n renderLightCordSettings() {\n const root = this.root;\n if (!root) return _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].err(\"SettingsPanel\", \"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.lightcordComponent, root);\n }\n\n renderPresenceSettings() {\n const root = this.root;\n if (!root) return _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].err(\"SettingsPanel\", \"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.PresenceComponent, root);\n }\n\n renderAccountInfos() {\n const root = this.root;\n if (!root) return _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].err(\"SettingsPanel\", \"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.AccountInfosComponent, root);\n }\n\n renderCustomCssEditor() {\n const root = this.root;\n if (!root) return _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].err(\"SettingsPanel\", \"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.customCssComponent, root);\n } // renderAddonPane(type) {\n // const root = this.root;\n // if (!root) return Utils.err(\"SettingsPanel\", \"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n // BDV2.reactDom.render(this.contentComponent(type), root);\n // }\n\n\n renderAddonPane(type) {\n if (!this.root) return _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].err(\"SettingsPanel\", \"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\"); // I know this shouldn't be here, but when it isn't,\n // React refuses to change the button when going\n // between plugins and themes page... something\n // to debug later.\n\n class ContentList extends _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.Component {\n constructor(props) {\n super(props);\n this.prefix = this.props.type.replace(\"s\", \"\");\n this.onChange = this.onChange.bind(this);\n }\n\n componentDidMount() {\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${this.prefix}-reloaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${this.prefix}-loaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${this.prefix}-unloaded`, this.onChange);\n }\n\n componentWillUnmount() {\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${this.prefix}-reloaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${this.prefix}-loaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${this.prefix}-unloaded`, this.onChange);\n }\n\n onChange() {\n this.props.onChange(this.props.type);\n }\n\n render() {\n return this.props.children;\n }\n\n }\n\n const list = type === \"plugins\" ? Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]) : Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]);\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(ContentList, {\n type,\n onChange: this.sideBarOnClick\n }, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_addonlist__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n type,\n list\n })), this.root);\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9zZXR0aW5nc1BhbmVsLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy9tb2R1bGVzL3NldHRpbmdzUGFuZWwuanM/NTdiMCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzZXR0aW5ncywgc2V0dGluZ3NDb29raWUsIGJkcGx1Z2lucywgYmR0aGVtZXMsIHNldHRpbmdzUlBDIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgRGF0YVN0b3JlIGZyb20gXCIuL2RhdGFTdG9yZVwiO1xuaW1wb3J0IFYyX1NldHRpbmdzUGFuZWxfU2lkZWJhciBmcm9tIFwiLi9zZXR0aW5nc1BhbmVsU2lkZWJhclwiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi92MlwiO1xuaW1wb3J0IENvbnRlbnRNYW5hZ2VyIGZyb20gXCIuL2NvbnRlbnRNYW5hZ2VyXCI7XG5pbXBvcnQgQkRFdmVudHMgZnJvbSBcIi4vYmRFdmVudHNcIjtcbmltcG9ydCBjb2xvcmVkVGV4dCBmcm9tIFwiLi9jb2xvcmVkVGV4dFwiO1xuaW1wb3J0IHRmSG91ciBmcm9tIFwiLi8yNGhvdXJcIjtcbmltcG9ydCByZWFjdERldlRvb2xzIGZyb20gXCIuL3JlYWN0RGV2VG9vbHN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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/settingsPanel.js\n")},"./src/modules/settingsPanelSidebar.js":/*!*********************************************!*\
|
|
!*** ./src/modules/settingsPanelSidebar.js ***!
|
|
\*********************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2_SettingsPanel_Sidebar; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _ui_sidebar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ui/sidebar */ \"./src/ui/sidebar.js\");\n/* harmony import */ var _ui_icons_history__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/icons/history */ \"./src/ui/icons/history.jsx\");\n/* harmony import */ var _ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ui/tooltipWrap */ \"./src/ui/tooltipWrap.js\");\n\n\n\n\n\n\n\nclass V2_SettingsPanel_Sidebar {\n constructor(onClick) {\n this.onClick = onClick;\n }\n\n get items() {\n return [{\n text: \"Lightcord Settings\",\n id: \"lightcord\"\n }, {\n text: \"BetterDiscord Settings\",\n id: \"core\"\n }, {\n text: \"Plugins\",\n id: \"plugins\"\n }, {\n text: \"Themes\",\n id: \"themes\"\n }, {\n text: \"Custom CSS\",\n id: \"customcss\"\n }, {\n text: \"RichPresence\",\n id: \"status\"\n },\n /*{\r\n text: \"Message Logger\", \r\n id: \"msglog\"\r\n }, */\n {\n text: \"Account Info\",\n id: \"accountinfo\"\n }];\n }\n\n get component() {\n //<TooltipWrap color=\"black\" side=\"top\" text={title}>\n const changelogButton = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"Changelog\"\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n className: \"bd-changelog-button\",\n onClick: () => {\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].showChangelogModal(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdChangelog\"]);\n }\n }, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(_ui_icons_history__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n className: \"bd-icon\",\n size: \"16px\"\n })));\n return _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"span\", null, _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(_ui_sidebar__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n onClick: this.onClick,\n headerText: \"Bandaged BD\",\n headerButton: changelogButton,\n items: this.items\n }));\n }\n\n get root() {\n const _root = _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].query(\"#bd-settings-sidebar\");\n\n if (!_root) {\n if (!this.injectRoot()) return null;\n return this.root;\n }\n\n return _root;\n }\n\n injectRoot() {\n const tabs = _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].queryAll(\"[class*='side-'] > [class*='item-']:not([class*=Danger])\");\n const changeLog = tabs[tabs.length - 1];\n if (!changeLog) return false;\n changeLog.parentElement.insertBefore(_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].createElement(`<div id=\"bd-settings-sidebar\">`), changeLog.previousElementSibling);\n return true;\n }\n\n render() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: [class*='side-'] > [class*='item-']:not([class*=Danger])\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reactDom.render(this.component, root);\n _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].onRemoved(root, () => {\n _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reactDom.unmountComponentAtNode(root);\n });\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9zZXR0aW5nc1BhbmVsU2lkZWJhci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy9zZXR0aW5nc1BhbmVsU2lkZWJhci5qcz85ZTA2Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGJiZENoYW5nZWxvZyB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi92MlwiO1xuaW1wb3J0IERPTSBmcm9tIFwiLi9kb210b29sc1wiO1xuaW1wb3J0IFNpZGVCYXIgZnJvbSBcIi4uL3VpL3NpZGViYXJcIjtcbmltcG9ydCBIaXN0b3J5IGZyb20gXCIuLi91aS9pY29ucy9oaXN0b3J5XCI7XG5pbXBvcnQgVG9vbHRpcFdyYXAgZnJvbSBcIi4uL3VpL3Rvb2x0aXBXcmFwXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWMl9TZXR0aW5nc1BhbmVsX1NpZGViY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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/modules/settingsPanelSidebar.js\n")},"./src/modules/themeModule.js":/*!************************************!*\
|
|
!*** ./src/modules/themeModule.js ***!
|
|
\************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _bdEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n\n\n\n\n\n\n\nclass ThemeModule {\n get folder() {\n return _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].themesFolder;\n }\n\n}\n\nThemeModule.prototype.loadThemes = function () {\n this.loadThemeData();\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemeErrors\"].splice(0, 0, ..._contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadThemes());\n const themes = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]);\n\n for (let i = 0; i < themes.length; i++) {\n const theme = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][themes[i]];\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme.name]) _0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme.name] = false;\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme.name]) _domtools__WEBPACK_IMPORTED_MODULE_5__[\"default\"].addStyle(_domtools__WEBPACK_IMPORTED_MODULE_5__[\"default\"].escapeID(theme.id), unescape(theme.css));\n }\n\n for (const theme in _0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"]) {\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][theme]) delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme];\n }\n\n this.saveThemeData(); // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"theme\");\n};\n\nThemeModule.prototype.enableTheme = function (name, reload = false) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][name] = true;\n this.saveThemeData();\n const theme = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][name];\n _domtools__WEBPACK_IMPORTED_MODULE_5__[\"default\"].addStyle(_domtools__WEBPACK_IMPORTED_MODULE_5__[\"default\"].escapeID(theme.id), unescape(theme.css));\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${theme.name} v${theme.version} has been applied.`);\n};\n\nThemeModule.prototype.enable = function (name, reload = false) {\n return this.enableTheme(name, reload);\n};\n\nThemeModule.prototype.disableTheme = function (name, reload = false) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][name] = false;\n this.saveThemeData();\n const theme = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][name];\n _domtools__WEBPACK_IMPORTED_MODULE_5__[\"default\"].removeStyle(_domtools__WEBPACK_IMPORTED_MODULE_5__[\"default\"].escapeID(theme.id));\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${theme.name} v${theme.version} has been disabled.`);\n};\n\nThemeModule.prototype.disable = function (name, reload = false) {\n return this.disableTheme(name, reload);\n};\n\nThemeModule.prototype.toggleTheme = function (theme) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme]) this.disableTheme(theme);else this.enableTheme(theme);\n};\n\nThemeModule.prototype.toggle = function (name, reload = false) {\n return this.toggleTheme(name, reload);\n};\n\nThemeModule.prototype.loadTheme = function (filename) {\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadContent(filename, \"theme\");\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n themes: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${filename} could not be loaded. It may not have been loaded.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${filename} could not be loaded.`, error);\n }\n\n const theme = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]).find(p => p.filename == filename);\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${theme.name} v${theme.version} was loaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${theme.name} v${theme.version} was loaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"theme-loaded\", theme.name);\n};\n\nThemeModule.prototype.unloadTheme = function (filenameOrName) {\n const bdtheme = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][filenameOrName];\n if (!bdtheme) return;\n const theme = bdtheme.name;\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme]) this.disableTheme(theme, true);\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].unloadContent(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][theme].filename, \"theme\");\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][theme];\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n themes: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${theme} could not be unloaded. It may have not been loaded yet.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${theme} could not be unloaded. It may have not been loaded yet.`, error);\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${theme} was unloaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${theme} was unloaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"theme-unloaded\", theme);\n};\n\nThemeModule.prototype.delete = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][filenameOrName];\n if (!bdplugin) return;\n this.unloadTheme(bdplugin.filename);\n\n const fullPath = __webpack_require__(/*! path */ \"path\").resolve(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].pluginsFolder, bdplugin.filename);\n\n __webpack_require__(/*! fs */ \"fs\").unlinkSync(fullPath);\n};\n\nThemeModule.prototype.reloadTheme = function (filenameOrName) {\n const bdtheme = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][filenameOrName];\n if (!bdtheme) return this.loadTheme(filenameOrName);\n const theme = bdtheme.name;\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reloadContent(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][theme].filename, \"theme\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme]) this.disableTheme(theme, true), this.enableTheme(theme, true);\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n themes: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${theme} could not be reloaded.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${theme} could not be reloaded.`, error);\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${theme} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][theme].version} was reloaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${theme} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][theme].version} was reloaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"theme-reloaded\", theme);\n};\n\nThemeModule.prototype.reload = function (name) {\n return this.reloadTheme(name);\n};\n\nThemeModule.prototype.edit = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][filenameOrName];\n if (!bdplugin) return;\n\n const fullPath = __webpack_require__(/*! path */ \"path\").resolve(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].themesFolder, bdplugin.filename);\n\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(`${fullPath}`);\n};\n\nThemeModule.prototype.updateThemeList = function () {\n const results = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadNewContent(\"theme\");\n\n for (const filename of results.added) this.loadTheme(filename);\n\n for (const name of results.removed) this.unloadTheme(name);\n};\n\nThemeModule.prototype.loadThemeData = function () {\n const saved = _dataStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSettingGroup(\"themes\");\n\n if (saved) {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"], saved);\n }\n};\n\nThemeModule.prototype.saveThemeData = function () {\n _dataStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setSettingGroup(\"themes\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"]);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new ThemeModule());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy90aGVtZU1vZHVsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy90aGVtZU1vZHVsZS5qcz84YzQ3Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGJkdGhlbWVFcnJvcnMsIHRoZW1lQ29va2llLCBzZXR0aW5nc0Nvb2tpZSwgYmR0aGVtZXMgfSBmcm9tIFwiLi4vMGdsb2JhbHNcIjtcbmltcG9ydCBDb250ZW50TWFuYWdlciBmcm9tIFwiLi9jb250ZW50TWFuYWdlclwiO1xuaW1wb3J0IERhdGFTdG9yZSBmcm9tIFwiLi9kYXRhU3RvcmVcIjtcbmltcG9ydCBCREV2ZW50cyBmcm9tIFwiLi9iZEV2ZW50c1wiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuL2RvbXRvb2xzXCI7XG5cbmNsYXNzIFRoZW1lTW9kdWxlIHtcbiAgZ2V0IGZvbGRlcigpIHtcbiAgICByZXR1cm4gQ29udGVudE1hbmFnZXIudGhlbWVzRm9sZGVyO1xuICB9XG5cbn1cbl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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/modules/themeModule.js\n")},"./src/modules/utils.js":/*!******************************!*\
|
|
!*** ./src/modules/utils.js ***!
|
|
\******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Utils; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _webpackModules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./webpackModules */ \"./src/modules/webpackModules.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n\n\n\n\nclass Utils {\n /** Document/window width */\n static get screenWidth() {\n return Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n /** Document/window height */\n\n\n static get screenHeight() {\n return Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n }\n\n static get WindowConfigFile() {\n return this._windowConfigFile = null;\n }\n\n static getAllWindowPreferences() {\n return {\n transparent: true,\n frame: false\n };\n }\n\n static getWindowPreference(key) {\n if (key === \"transparent\") return true;\n if (key === \"frame\") return false;\n return null;\n }\n\n static setWindowPreference(key, value) {\n if (key === \"transparent\") return true;\n if (key === \"frame\") return false;\n return null;\n }\n\n static stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n\n return content;\n }\n\n static getTextArea() {\n return _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].query(\".\" + BDModules.get(e => e.channelTextArea && e.titleWrapper)[0].channelTextArea.split(\" \")[0] + \" textarea\");\n }\n\n static insertText(textarea, text) {\n textarea.focus();\n textarea.selectionStart = 0;\n textarea.selectionEnd = textarea.value.length;\n document.execCommand(\"insertText\", false, text);\n }\n\n static escapeID(id) {\n return id.replace(/^[^a-z]+|[^\\w-]+/gi, \"-\");\n }\n\n static log(moduleName, message) {\n console.log(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: #3a71c1; font-weight: 700;\", \"color: #3a71c1;\", \"\");\n }\n\n static warn(moduleName, message) {\n console.warn(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: #E8A400; font-weight: 700;\", \"color: #E8A400;\", \"\");\n }\n\n static err(moduleName, message, error) {\n console.log(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: red; font-weight: 700;\", \"color: red;\", \"\");\n\n if (error) {\n console.groupCollapsed(\"%cError: \" + error.message, \"color: red;\");\n console.error(error.stack);\n console.groupEnd();\n }\n }\n\n static escape(s) {\n return s.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n }\n\n static testJSON(data) {\n try {\n return JSON.parse(data);\n } catch (err) {\n return false;\n }\n }\n\n static isEmpty(obj) {\n if (obj == null || obj == undefined || obj == \"\") return true;\n if (typeof obj !== \"object\") return false;\n if (Array.isArray(obj)) return obj.length == 0;\n\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) return false;\n }\n\n return true;\n }\n\n static suppressErrors(method, message) {\n return (...params) => {\n try {\n return method(...params);\n } catch (e) {\n this.err(\"SuppressedError\", \"Error occurred in \" + message, e);\n }\n };\n }\n\n static monkeyPatch(what, methodName, options) {\n const {\n before,\n after,\n instead,\n once = false,\n silent = false,\n force = false\n } = options;\n const displayName = options.displayName || what.displayName || what[methodName].displayName || what.name || what.constructor.displayName || what.constructor.name;\n if (!silent) console.log(\"patch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n\n if (!what[methodName]) {\n if (force) what[methodName] = function () {};else return console.error(methodName, \"does not exist for\", displayName); // eslint-disable-line no-console\n }\n\n const origMethod = what[methodName];\n\n const cancel = () => {\n if (!silent) console.log(\"unpatch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n\n what[methodName] = origMethod;\n };\n\n what[methodName] = function () {\n const data = {\n thisObject: this,\n methodArguments: arguments,\n cancelPatch: cancel,\n originalMethod: origMethod,\n callOriginalMethod: () => data.returnValue = data.originalMethod.apply(data.thisObject, data.methodArguments)\n };\n\n if (instead) {\n const tempRet = Utils.suppressErrors(instead, \"`instead` callback of \" + what[methodName].displayName)(data);\n if (tempRet !== undefined) data.returnValue = tempRet;\n } else {\n if (before) Utils.suppressErrors(before, \"`before` callback of \" + what[methodName].displayName)(data);\n data.callOriginalMethod();\n if (after) Utils.suppressErrors(after, \"`after` callback of \" + what[methodName].displayName)(data);\n }\n\n if (once) cancel();\n return data.returnValue;\n };\n\n Object.assign(what[methodName], origMethod);\n what[methodName].__monkeyPatched = true;\n what[methodName].displayName = displayName;\n\n if (!what[methodName].__originalMethod) {\n what[methodName].__originalMethod = origMethod;\n\n what[methodName].toString = function () {\n return origMethod.toString();\n };\n }\n\n return cancel;\n }\n\n static onRemoved(node, callback) {\n const observer = new MutationObserver(mutations => {\n for (let m = 0; m < mutations.length; m++) {\n const mutation = mutations[m];\n const nodes = Array.from(mutation.removedNodes);\n const directMatch = nodes.indexOf(node) > -1;\n const parentMatch = nodes.some(parent => parent.contains(node));\n\n if (directMatch || parentMatch) {\n observer.disconnect();\n callback();\n }\n }\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n\n static getNestedProp(obj, path) {\n return path.split(/\\s?\\.\\s?/).reduce(function (obj, prop) {\n return obj && obj[prop];\n }, obj);\n }\n /**\r\n * This shows a toast similar to android towards the bottom of the screen.\r\n *\r\n * @param {string} content The string to show in the toast.\r\n * @param {object} options Options object. Optional parameter.\r\n * @param {string} options.type Changes the type of the toast stylistically and semantically. Choices: \"\", \"info\", \"success\", \"danger\"/\"error\", \"warning\"/\"warn\". Default: \"\"\r\n * @param {boolean} options.icon Determines whether the icon should show corresponding to the type. A toast without type will always have no icon. Default: true\r\n * @param {number} options.timeout Adjusts the time (in ms) the toast should be shown for before disappearing automatically. Default: 3000\r\n */\n\n\n static showToast(content, options = {}) {\n if (!document.querySelector(\".bd-toasts\")) {\n const container = document.querySelector(\".\" + BDModules.get(e => e.sidebar && e.hasNotice)[0].sidebar.split(\" \")[9] + \" + div\") || null;\n const memberlist = container ? container.querySelector(\".\" + BDModules.get(e => e.membersWrap)[0].membersWrap) : null;\n const form = container ? container.querySelector(\"form\") : null;\n const left = container ? container.getBoundingClientRect().left : 310;\n const right = memberlist ? memberlist.getBoundingClientRect().left : 0;\n const width = right ? right - container.getBoundingClientRect().left : Utils.screenWidth - left - 240;\n const bottom = form ? form.offsetHeight : 80;\n const toastWrapper = document.createElement(\"div\");\n toastWrapper.classList.add(\"bd-toasts\");\n toastWrapper.style.setProperty(\"left\", left + \"px\");\n toastWrapper.style.setProperty(\"width\", width + \"px\");\n toastWrapper.style.setProperty(\"bottom\", bottom + \"px\");\n document.querySelector(\"#app-mount\").appendChild(toastWrapper);\n }\n\n const {\n type = \"\",\n icon = true,\n timeout = 3000\n } = options;\n const toastElem = document.createElement(\"div\");\n toastElem.classList.add(\"bd-toast\");\n if (type) toastElem.classList.add(\"toast-\" + type);\n if (type && icon) toastElem.classList.add(\"icon\");\n toastElem.innerText = content;\n document.querySelector(\".bd-toasts\").appendChild(toastElem);\n setTimeout(() => {\n toastElem.classList.add(\"closing\");\n setTimeout(() => {\n toastElem.remove();\n if (!document.querySelectorAll(\".bd-toasts .bd-toast\").length) document.querySelector(\".bd-toasts\").remove();\n }, 300);\n }, timeout);\n }\n\n static alert(title, content) {\n let modalModule = BDModules.get(e => e.modal && e.inner && !e.hideOnFullscreen)[0];\n let headerModule = BDModules.get(e => e.header && e.responsiveWidthMobile && e.hideOnFullscreen)[0];\n let footer2Module = BDModules.get(e => e.header && e.responsiveWidthMobile && e.focusLock)[0];\n const modal = _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].createElement(`<div class=\"bd-modal-wrapper theme-dark\">\n <div class=\"bd-backdrop ${BDModules.get(e => e.backdrop && e.backdropWithLayer)[0].backdrop}\"></div>\n <div class=\"bd-modal ${modalModule.modal}\">\n <div class=\"bd-modal-inner ${modalModule.inner}\">\n <div class=\"header ${headerModule.header}\">\n <div class=\"title\">${title}</div>\n </div>\n <div class=\"bd-modal-body\">\n <div class=\"scroller-wrap fade\">\n <div class=\"scroller\">\n ${content}\n </div>\n </div>\n </div>\n <div class=\"footer ${headerModule.footer} ${footer2Module.footer}\">\n <button type=\"button\">Okay</button>\n </div>\n </div>\n </div>\n </div>`);\n modal.querySelector(\".footer button\").addEventListener(\"click\", () => {\n _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].addClass(modal, \"closing\");\n setTimeout(() => {\n modal.remove();\n closingListeners.forEach(listener => {\n try {\n listener();\n } catch (e) {\n console.error(e);\n }\n });\n }, 300);\n });\n modal.querySelector(\".bd-backdrop\").addEventListener(\"click\", () => {\n _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].addClass(modal, \"closing\");\n setTimeout(() => {\n modal.remove();\n closingListeners.forEach(listener => {\n try {\n listener();\n } catch (e) {\n console.error(e);\n }\n });\n }, 300);\n });\n _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].query(\"#app-mount\").append(modal);\n const closingListeners = [];\n return {\n close: () => {\n _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].addClass(modal, \"closing\");\n setTimeout(() => {\n modal.remove();\n closingListeners.forEach(listener => {\n try {\n listener();\n } catch (e) {\n console.error(e);\n }\n });\n }, 300);\n },\n onClose: listener => {\n closingListeners.push(listener);\n }\n };\n }\n\n static showContentErrors({\n plugins: pluginErrors = [],\n themes: themeErrors = []\n }) {\n if (!pluginErrors || !themeErrors) return;\n if (!pluginErrors.length && !themeErrors.length) return;\n let modalModule = BDModules.get(e => e.modal && e.inner && !e.hideOnFullscreen)[0];\n let headerModule = BDModules.get(e => e.header && e.responsiveWidthMobile && e.hideOnFullscreen)[0];\n let footer2Module = BDModules.get(e => e.header && e.responsiveWidthMobile && e.focusLock)[0];\n const modal = _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].createElement(`<div class=\"bd-modal-wrapper theme-dark\">\n <div class=\"bd-backdrop ${BDModules.get(e => e.backdrop && e.backdropWithLayer)[0].backdrop}\"></div>\n <div class=\"bd-modal bd-content-modal ${modalModule.modal}\">\n <div class=\"bd-modal-inner ${modalModule.inner}\">\n <div class=\"header ${headerModule.header}\"><div class=\"title\">Content Errors</div></div>\n <div class=\"bd-modal-body\">\n <div class=\"tab-bar-container\">\n <div class=\"tab-bar TOP\">\n <div class=\"tab-bar-item\">Plugins</div>\n <div class=\"tab-bar-item\">Themes</div>\n </div>\n </div>\n <div class=\"table-header\">\n <div class=\"table-column column-name\">Name</div>\n <div class=\"table-column column-message\">Message</div>\n <div class=\"table-column column-error\">Error</div>\n </div>\n <div class=\"scroller-wrap fade\">\n <div class=\"scroller\">\n \n </div>\n </div>\n </div>\n <div class=\"footer ${headerModule.footer} ${footer2Module.footer}\">\n <button type=\"button\">Okay</button>\n </div>\n </div>\n </div>\n </div>`);\n\n function generateTab(errors) {\n const container = _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].createElement(`<div class=\"errors\">`);\n\n for (const err of errors) {\n const error = _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].createElement(`<div class=\"error\">\n <div class=\"table-column column-name\">${err.name ? err.name : err.file}</div>\n <div class=\"table-column column-message\">${err.message}</div>\n <div class=\"table-column column-error\"><a class=\"error-link\" href=\"\">${err.error ? err.error.message : \"\"}</a></div>\n </div>`);\n container.append(error);\n\n if (err.error) {\n error.querySelectorAll(\"a\").forEach(el => el.addEventListener(\"click\", e => {\n e.preventDefault();\n Utils.err(\"ContentManager\", `Error details for ${err.name ? err.name : err.file}.`, err.error);\n }));\n }\n }\n\n return container;\n }\n\n const tabs = [generateTab(pluginErrors), generateTab(themeErrors)];\n modal.querySelectorAll(\".tab-bar-item\").forEach(el => el.addEventListener(\"click\", e => {\n e.preventDefault();\n const selected = modal.querySelector(\".tab-bar-item.selected\");\n if (selected) _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].removeClass(selected, \"selected\");\n _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].addClass(e.target, \"selected\");\n const scroller = modal.querySelector(\".scroller\");\n scroller.innerHTML = \"\";\n scroller.append(tabs[_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].index(e.target)]);\n }));\n modal.querySelector(\".footer button\").addEventListener(\"click\", () => {\n _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].addClass(modal, \"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n modal.querySelector(\".bd-backdrop\").addEventListener(\"click\", () => {\n _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].addClass(modal, \"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n _domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].query(\"#app-mount\").append(modal);\n if (pluginErrors.length) modal.querySelector(\".tab-bar-item\").click();else modal.querySelectorAll(\".tab-bar-item\")[1].click();\n }\n\n static showChangelogModal(options = {}) {\n const ModalStack = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"push\", \"update\", \"pop\", \"popWithKey\");\n const ChangelogClasses = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"fixed\", \"improved\");\n const TextElement = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByDisplayName(\"Text\");\n const FlexChild = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"Child\");\n const Titles = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"Tags\", \"default\");\n const Changelog = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].find(m => m.defaultProps && m.defaultProps.selectable == false);\n const MarkdownParser = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"defaultRules\", \"parse\");\n if (!Changelog || !ModalStack || !ChangelogClasses || !TextElement || !FlexChild || !Titles || !MarkdownParser) return;\n const {\n image = \"https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5\",\n description = \"\",\n changes = [],\n title = \"BandagedBD\",\n subtitle = `v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bbdVersion\"]}`,\n footer\n } = options;\n const ce = _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement;\n const changelogItems = [ce(\"img\", {\n src: image\n })];\n if (description) changelogItems.push(ce(\"p\", null, MarkdownParser.parse(description)));\n\n for (let c = 0; c < changes.length; c++) {\n const entry = changes[c];\n const type = ChangelogClasses[entry.type] ? ChangelogClasses[entry.type] : ChangelogClasses.added;\n const margin = c == 0 ? ChangelogClasses.marginTop : \"\";\n changelogItems.push(ce(\"h1\", {\n className: `${type} ${margin}`\n }, entry.title));\n const list = ce(\"ul\", null, entry.items.map(i => ce(\"li\", null, MarkdownParser.parse(i))));\n changelogItems.push(list);\n }\n\n const renderHeader = function () {\n return ce(FlexChild.Child, {\n grow: 1,\n shrink: 1\n }, ce(Titles.default, {\n tag: Titles.Tags.H4\n }, title), ce(TextElement, {\n size: TextElement.Sizes.SMALL,\n color: TextElement.Colors.STANDARD,\n className: ChangelogClasses.date\n }, subtitle));\n };\n\n const renderFooter = () => {\n const Anchor = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].find(m => m.displayName == \"Anchor\");\n const AnchorClasses = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"anchorUnderlineOnHover\") || {\n anchor: \"anchor-3Z-8Bb\",\n anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"\n };\n\n const joinSupportServer = click => {\n click.preventDefault();\n click.stopPropagation();\n ModalStack.pop();\n _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].joinBD2();\n };\n\n const supportLink = Anchor ? ce(Anchor, {\n onClick: joinSupportServer\n }, \"Join our Discord Server.\") : ce(\"a\", {\n className: `${AnchorClasses.anchor} ${AnchorClasses.anchorUnderlineOnHover}`,\n onClick: joinSupportServer\n }, \"Join our Discord Server.\");\n const defaultFooter = ce(TextElement, {\n size: TextElement.Sizes.SMALL,\n color: TextElement.Colors.STANDARD\n }, \"Need support? \", supportLink);\n return ce(FlexChild.Child, {\n grow: 1,\n shrink: 1\n }, footer ? footer : defaultFooter);\n };\n\n return ModalStack.push(function (props) {\n return ce(Changelog, Object.assign({\n className: ChangelogClasses.container,\n selectable: true,\n onScroll: _ => _,\n onClose: _ => _,\n renderHeader: renderHeader,\n renderFooter: renderFooter,\n children: changelogItems\n }, props));\n });\n }\n /**\r\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\r\n * @param {string} title - title of the modal\r\n * @param {(string|ReactElement|Array<string|ReactElement>)} children - a single or mixed array of react elements and strings. Every string is wrapped in Discord's `Markdown` component so strings will show and render properly.\r\n * @param {object} [options] - options to modify the modal\r\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\r\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\r\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\r\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\r\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\r\n * @param {string} [options.key] - key used to identify the modal. If not provided, one is generated and returned\r\n * @returns {string} - the key used for this modal\r\n */\n\n\n static showConfirmationModal(title, content, options = {}) {\n const ModalStack = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"push\", \"update\", \"pop\", \"popWithKey\");\n const Markdown = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByDisplayName(\"Markdown\");\n const ConfirmationModal = _webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].find(m => m.defaultProps && m.key && m.key() == \"confirm-modal\");\n if (!ModalStack || !ConfirmationModal || !Markdown) return Utils.alert(title, content);\n\n const emptyFunction = () => {};\n\n const {\n onConfirm = emptyFunction,\n onCancel = emptyFunction,\n confirmText = \"Okay\",\n cancelText = \"Cancel\",\n danger = false,\n key = undefined\n } = options;\n if (!Array.isArray(content)) content = [content];\n content = content.map(c => typeof c === \"string\" ? _v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].React.createElement(Markdown, null, c) : c);\n return ModalStack.push(ConfirmationModal, {\n header: title,\n children: content,\n red: danger,\n confirmText: confirmText,\n cancelText: cancelText,\n onConfirm: onConfirm,\n onCancel: onCancel\n }, key);\n }\n\n}\nUtils.showToast = Utils.suppressErrors(Utils.showToast, \"Could not show toast.\");//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy91dGlscy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy91dGlscy5qcz9jMGY3Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGJiZFZlcnNpb24sIHNldHRpbmdzQ29va2llIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgV2VicGFja01vZHVsZXMgZnJvbSBcIi4vd2VicGFja01vZHVsZXNcIjtcbmltcG9ydCBCRFYyIGZyb20gXCIuL3YyXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuL2RvbXRvb2xzXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBVdGlscyB7XG4gIC8qKiBEb2N1bWVudC93aW5kb3cgd2lkdGggKi9cbiAgc3RhdGljIGdldCBzY3JlZW5XaWR0aCgpIHtcbiAgICByZXR1cm4gTWF0aC5tYXgoZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmNsaWVudFdpZHRoLCB3aW5kb3cuaW5uZXJXaWR0aCB8fCAwKTtcbiAgfVxuICAvKiogRG9jdW1lbnQvd2luZG93IGhlaWdodCAqL1xuXG5cbiAgc3RhdGljIGdldCBzY3JlZW5IZWlnaHQoKSB7XG4gICAgcmV0dXJuIE1hdGgubWF4KGRvY3VtZW50LmRvY3VtZW50R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IGNsYXNzPVwidGl0bGVcIj4ke3RpdGxlfTwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJkLW1vZGFsLWJvZHlcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzY3JvbGxlci13cmFwIGZhZGVcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2Nyb2xsZXJcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHtjb250ZW50fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9vdGVyICR7aGVhZGVyTW9kdWxlLmZvb3Rlcn0gJHtmb290ZXIyTW9kdWxlLmZvb3Rlcn1cIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiPk9rYXk8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+YCk7XG4gICAgbW9kYWwucXVlcnlTZWxlY3RvcihcIi5mb290ZXIgYnV0dG9uXCIpLmFkZEV2ZW50TGlzdGVuZXIoXCJjbGlja1wiLCAoKSA9PiB7XG4gICAgICBET00uYWRkQ2xhc3MobW9kYWwsIFwiY2x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G1vZGFsID0gRE9NLmNyZWF0ZUVsZW1lbnQoYDxkaXYgY2xhc3M9XCJiZC1tb2RhbC13cmFwcGVyIHRoZW1lLWRhcmtcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJiZC1iYWNrZHJvcCAke0JETW9kdWxlcy5nZXQoZSA9PiBlLmJhY2tkcm9wICYmIGUuYmFja2Ryb3BXaXRoTGF5ZXIpWzBdLmJhY2tkcm9wfVwiPjwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJkLW1vZGFsIGJkLWNvbnRlbnQtbW9kYWwgJHttb2RhbE1vZHVsZS5tb2RhbH1cIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYmQtbW9kYWwtaW5uZXIgJHttb2RhbE1vZHVsZS5pbm5lcn1cIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImhlYWRlciAke2hlYWRlck1vZHVsZS5oZWFkZXJ9XCI+PGRpdiBjbGFzcz1cInRpdGxlXCI+Q29udGVudCBFcnJvcnM8L2Rpdj48L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJkLW1vZGFsLWJvZHlcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0YWItYmFyLWNvbnRhaW5lclwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0YWItYmFyIFRPUFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFiLWJhci1pdGVtXCI+UGx1Z2luczwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFiLWJhci1pdGVtXCI+VGhlbWVzPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0YWJsZS1oZWFkZXJcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFibGUtY29sdW1uIGNvbHVtbi1uYW1lXCI+TmFtZTwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0YWJsZS1jb2x1bW4gY29sdW1uLW1lc3NhZ2VcIj5NZXNzYWdlPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tZXJyb3JcIj5FcnJvcjwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2Nyb2xsZXItd3JhcCBmYWRlXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNjcm9sbGVyXCI+XG4gICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb290ZXIgJHtoZWFkZXJNb2R1bGUuZm9vdGVyfSAke2Zvb3RlcjJNb2R1bGUuZm9vdGVyfVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCI+T2theTwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5gKTtcblxuICAgIGZ1bmN0aW9uIGdlbmVyYXRlVGFiKGVycm9ycykge1xuICAgICAgY29uc3QgY29udGFpbmVyID0gRE9NLmNyZWF0ZUVsZW1lbnQoYDxkaXYgY2xhc3M9XCJlcnJvcnNcIj5gKTtcblxuICAgICAgZm9yIChjb25zdCBlcnIgb2YgZXJyb3JzKSB7XG4gICAgICAgIGNvbnN0IGVycm9yID0gRE9NLmNyZWF0ZUVsZW1lbnQoYDxkaXYgY2xhc3M9XCJlcnJvclwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tbmFtZVwiPiR7ZXJyLm5hbWUgPyBlcnIubmFtZSA6IGVyci5maWxlfTwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tbWVzc2FnZVwiPiR7ZXJyLm1lc3NhZ2V9PC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFibGUtY29sdW1uIGNvbHVtbi1lcnJvclwiPjxhIGNsYXNzPVwiZXJyb3ItbGlua1wiIGhyZWY9XCJcIj4ke2Vyci5lcnJvciA/IGVyci5lcnJvci5tZXNzYWdlIDogXCJcIn08L2E+PC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PmApO1xuICAgICAgICBjb250YWluZXIuYXB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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/utils.js\n")},"./src/modules/v2.js":/*!***************************!*\
|
|
!*** ./src/modules/v2.js ***!
|
|
\***************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class V2 {\n constructor() {\n this.editorDetached = false;\n\n this.WebpackModules = (() => {\n const req = webpackJsonp.push([[], {\n __extra_id__: (module, exports, req) => module.exports = req\n }, [[\"__extra_id__\"]]]);\n delete req.m.__extra_id__;\n delete req.c.__extra_id__;\n\n const shouldProtect = theModule => {\n if (theModule.remove && theModule.set && theModule.clear && theModule.get && !theModule.sort) return true;\n if (theModule.getToken || theModule.getEmail || theModule.showToken) return true;\n return false;\n };\n\n const protect = theModule => {\n if (theModule.remove && theModule.set && theModule.clear && theModule.get && !theModule.sort) return null;\n if (!theModule.getToken && !theModule.getEmail && !theModule.showToken) return theModule;\n const proxy = new Proxy(theModule, {\n getOwnPropertyDescriptor: function (obj, prop) {\n if (prop === \"getToken\" || prop === \"getEmail\" || prop === \"showToken\") return undefined;\n return Object.getOwnPropertyDescriptor(obj, prop);\n },\n get: function (obj, func) {\n if (func == \"getToken\") return () => \"mfa.XCnbKzo0CLIqdJzBnL0D8PfDruqkJNHjwHXtr39UU3F8hHx43jojISyi5jdjO52e9_e9MjmafZFFpc-seOMa\";\n if (func == \"getEmail\") return () => \"puppet11112@gmail.com\";\n if (func == \"showToken\") return () => true; // if (func == \"__proto__\") return proxy;\n\n return obj[func];\n }\n });\n return proxy;\n };\n\n const find = filter => {\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) return protect(m.default);\n if (m && filter(m)) return protect(m);\n }\n } // console.warn(\"Cannot find loaded module in cache\");\n\n\n return null;\n };\n\n const findAll = filter => {\n const modules = [];\n\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) modules.push(protect(m.default));else if (m && filter(m)) modules.push(protect(m));\n }\n }\n\n return modules;\n };\n\n const findByUniqueProperties = propNames => find(module => propNames.every(prop => module[prop] !== undefined));\n\n const findByPrototypes = protoNames => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\n\n const findByDisplayName = displayName => find(module => module.displayName === displayName);\n\n return {\n find,\n findAll,\n findByUniqueProperties,\n findByPrototypes,\n findByDisplayName\n };\n })();\n\n this.internal = {\n react: this.WebpackModules.findByUniqueProperties([\"Component\", \"PureComponent\", \"Children\", \"createElement\", \"cloneElement\"]),\n reactDom: this.WebpackModules.findByUniqueProperties([\"findDOMNode\"])\n };\n\n this.getInternalInstance = e => e[Object.keys(e).find(k => k.startsWith(\"__reactInternalInstance\"))];\n }\n\n initialize() {}\n\n joinBD1() {\n this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"0Tmfo5ZbORCRqbAd\");\n }\n\n leaveBD1() {\n this.GuildActions.leaveGuild(\"86004744966914048\");\n }\n\n joinBD2() {\n this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"2HScm8j\");\n }\n\n leaveBD2() {\n this.GuildActions.leaveGuild(\"280806472928198656\");\n }\n /**\r\n * @type {typeof React}\r\n */\n\n\n get react() {\n return this.internal.react;\n }\n /**\r\n * @type {typeof React}\r\n */\n\n\n get React() {\n return this.internal.react;\n }\n /**\r\n * @type {typeof import(\"react-dom\")}\r\n */\n\n\n get reactDom() {\n return this.internal.reactDom;\n }\n /**\r\n * @type {typeof import(\"react-dom\")}\r\n */\n\n\n get ReactDom() {\n return this.internal.reactDom;\n }\n /**\r\n * @type {typeof React.Component}\r\n */\n\n\n get reactComponent() {\n return this.internal.react.Component;\n }\n /**\r\n * @type {typeof React.Component}\r\n */\n\n\n get ReactComponent() {\n return this.internal.react.Component;\n }\n\n get anchorClasses() {\n return this.WebpackModules.findByUniqueProperties([\"anchorUnderlineOnHover\"]) || {\n anchor: \"anchor-3Z-8Bb\",\n anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"\n };\n }\n\n get slateEditorClasses() {\n return this.WebpackModules.findByUniqueProperties([\"slateTextArea\"]);\n }\n\n get messageClasses() {\n return this.WebpackModules.findByUniqueProperties([\"message\", \"containerCozy\"]);\n }\n\n get guildClasses() {\n const guildsWrapper = BDModules.get(e => e.wrapper && e.unreadMentionsBar)[0];\n const guilds = BDModules.get(e => e.guildsError && e.selected)[0];\n const pill = BDModules.get(e => e.blobContainer)[0];\n return Object.assign({}, guildsWrapper, guilds, pill);\n }\n\n get MessageContentComponent() {\n return this.WebpackModules.find(m => m.defaultProps && m.defaultProps.hasOwnProperty(\"disableButtons\"));\n }\n\n get MessageComponent() {\n return this.WebpackModules.find(m => m.default && m.default.displayName && m.default.displayName == \"Message\");\n }\n\n get TimeFormatter() {\n return this.WebpackModules.findByUniqueProperties([\"dateFormat\"]);\n }\n\n get TooltipWrapper() {\n return this.WebpackModules.findByDisplayName(\"Tooltip\");\n }\n\n get NativeModule() {\n return this.WebpackModules.findByUniqueProperties([\"setBadge\"]);\n }\n\n get InviteActions() {\n return this.WebpackModules.findByUniqueProperties([\"acceptInvite\"]);\n }\n\n get GuildActions() {\n return this.WebpackModules.findByUniqueProperties([\"leaveGuild\"]);\n }\n\n get Tooltips() {\n return this.WebpackModules.find(m => m.hide && m.show && !m.search && !m.submit && !m.search && !m.activateRagingDemon && !m.dismiss);\n }\n\n get KeyGenerator() {\n return this.WebpackModules.find(m => m.toString && /\"binary\"/.test(m.toString()));\n }\n\n get LayerStack() {\n return this.WebpackModules.findByUniqueProperties([\"popLayer\"]);\n }\n\n get UserStore() {\n return this.WebpackModules.findByUniqueProperties([\"getCurrentUser\"]);\n }\n\n get ChannelStore() {\n return this.WebpackModules.findByUniqueProperties([\"getChannel\"]);\n }\n\n get ChannelActions() {\n return this.WebpackModules.findByUniqueProperties([\"openPrivateChannel\"]);\n }\n\n get PrivateChannelActions() {\n return this.WebpackModules.findByUniqueProperties([\"selectPrivateChannel\"]);\n }\n\n openDM(userId) {\n const selfId = this.UserStore.getCurrentUser().id;\n if (selfId == userId) return;\n const privateChannelId = this.ChannelStore.getDMFromUserId(userId);\n if (privateChannelId) return this.PrivateChannelActions.selectPrivateChannel(privateChannelId);\n this.ChannelActions.openPrivateChannel(selfId, userId);\n }\n\n parseSettings(cat) {\n return Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"]).reduce((arr, key) => {\n const setting = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"][key];\n\n if (setting.cat === cat && setting.implemented && !setting.hidden) {\n setting.text = key;\n arr.push(setting);\n }\n\n return arr;\n }, []);\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy92Mi5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy92Mi5qcz84NTdiIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNldHRpbmdzIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5leHBvcnQgZGVmYXVsdCBuZXcgY2xhc3MgVjIge1xuICBjb25zdHJ1Y3RvcigpIHtcbiAgICB0aGlzLmVkaXRvckRldGFjaGVkID0gZmFsc2U7XG5cbiAgICB0aGlzLldlYnBhY2tNb2R1bGVzID0gKCgpID0+IHtcbiAgICAgIGNvbnN0IHJlcSA9IHdlYnBhY2tKc29ucC5wdXNoKFtbXSwge1xuICAgICAgICBfX2V4dHJhX2lkX186IChtb2R1bGUsIGV4cG9ydHMsIHJlcSkgPT4gbW9kdWxlLmV4cG9ydHMgPSByZXFcbiAgICAgIH0sIFtbXCJfX2V4dHJhX2lkX19cIl1dXSk7XG4gICAgICBkZWxldGUgcmVxLm0uX19leHRyYV9pZF9fO1xuICAgICAgZGVsZXRlIHJlcS5jLl9fZXh0cmFfaWRfXztcblxuICAgICAgY29uc3Qgc2hvdWxkUHJvdGVjdCA9IHRoZU1vZHVsZSA9PiB7XG4gICAgICAgIGlmICh0aGVNb2R1bGUucmVtb3ZlICYmIHRoZU1vZHVsZS5zZXQgJiYgdGhlTW9kdWxlLmNsZWFyICYmIHRoZU1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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/v2.js\n")},"./src/modules/voiceMode.js":/*!**********************************!*\
|
|
!*** ./src/modules/voiceMode.js ***!
|
|
\**********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n\nconst style = `\n .container-2Rl01u {\n display: none!important;\n }\n\n .chat-3bRxxu {\n display: none!important;\n }\n\n .sidebar-2K8pFh {\n flex-grow: 1!important;\n }\n`;\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class VoiceMode {\n start() {\n _domtools__WEBPACK_IMPORTED_MODULE_0__[\"default\"].addStyle(\"VoiceMode\", style);\n }\n\n stop() {\n _domtools__WEBPACK_IMPORTED_MODULE_0__[\"default\"].removeStyle(\"VoiceMode\");\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy92b2ljZU1vZGUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL21vZHVsZXMvdm9pY2VNb2RlLmpzP2Y4NDQiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERPTSBmcm9tIFwiLi9kb210b29sc1wiO1xuY29uc3Qgc3R5bGUgPSBgXG4gICAgLmNvbnRhaW5lci0yUmwwMXUge1xuICAgICAgICBkaXNwbGF5OiBub25lIWltcG9ydGFudDtcbiAgICB9XG5cbiAgICAuY2hhdC0zYlJ4eHUge1xuICAgICAgICBkaXNwbGF5OiBub25lIWltcG9ydGFudDtcbiAgICB9XG5cbiAgICAuc2lkZWJhci0ySzhwRmgge1xuICAgICAgICBmbGV4LWdyb3c6IDEhaW1wb3J0YW50O1xuICAgIH1cbmA7XG5leHBvcnQgZGVmYXVsdCBuZXcgY2xhc3MgVm9pY2VNb2RlIHtcbiAgc3RhcnQoKSB7XG4gICAgRE9NLmFkZFN0eWxlKFwiVm9pY2VNb2RlXCIsIHN0eWxlKTtcbiAgfVxuXG4gIHN0b3AoKSB7XG4gICAgRE9NLnJlbW92ZVN0eWxlKFwiVm9pY2VNb2RlXCIpO1xuICB9XG5cbn0oKTsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/voiceMode.js\n")},"./src/modules/webpackModules.js":/*!***************************************!*\
|
|
!*** ./src/modules/webpackModules.js ***!
|
|
\***************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\nconst req = webpackJsonp.push([[], {\n __extra_id__: (module, exports, req) => module.exports = req\n}, [[\"__extra_id__\"]]]);\ndelete req.m.__extra_id__;\ndelete req.c.__extra_id__;\n\nconst find = filter => {\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) return m.default;\n if (m && filter(m)) return m;\n }\n } // console.warn(\"Cannot find loaded module in cache\");\n\n\n return null;\n};\n\nconst findAll = filter => {\n const modules = [];\n\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) modules.push(m.default);else if (m && filter(m)) modules.push(m);\n }\n }\n\n return modules;\n};\n\nconst findByProps = (...propNames) => find(module => propNames.every(prop => module[prop] !== undefined));\n\nconst findByPrototypes = (...protoNames) => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\n\nconst findByDisplayName = displayName => find(module => module.displayName === displayName);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n find,\n findAll,\n findByProps,\n findByPrototypes,\n findByDisplayName\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy93ZWJwYWNrTW9kdWxlcy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvbW9kdWxlcy93ZWJwYWNrTW9kdWxlcy5qcz9iNDBkIl0sInNvdXJjZXNDb250ZW50IjpbImNvbnN0IHJlcSA9IHdlYnBhY2tKc29ucC5wdXNoKFtbXSwge1xuICBfX2V4dHJhX2lkX186IChtb2R1bGUsIGV4cG9ydHMsIHJlcSkgPT4gbW9kdWxlLmV4cG9ydHMgPSByZXFcbn0sIFtbXCJfX2V4dHJhX2lkX19cIl1dXSk7XG5kZWxldGUgcmVxLm0uX19leHRyYV9p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5UHJvdG90eXBlcyA9ICguLi5wcm90b05hbWVzKSA9PiBmaW5kKG1vZHVsZSA9PiBtb2R1bGUucHJvdG90eXBlICYmIHByb3RvTmFtZXMuZXZlcnkocHJvdG9Qcm9wID0+IG1vZHVsZS5wcm90b3R5cGVbcHJvdG9Qcm9wXSAhPT0gdW5kZWZpbmVkKSk7XG5cbmNvbnN0IGZpbmRCeURpc3BsYXlOYW1lID0gZGlzcGxheU5hbWUgPT4gZmluZChtb2R1bGUgPT4gbW9kdWxlLmRpc3BsYXlOYW1lID09PSBkaXNwbGF5TmFtZSk7XG5cbmV4cG9ydCBkZWZhdWx0IHtcbiAgZmluZCxcbiAgZmluZEFsbCxcbiAgZmluZEJ5UHJvcHMsXG4gIGZpbmRCeVByb3RvdHlwZXMsXG4gIGZpbmRCeURpc3BsYXlOYW1lXG59OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/modules/webpackModules.js\n")},"./src/svg/bug_hunter.jsx":/*!********************************!*\
|
|
!*** ./src/svg/bug_hunter.jsx ***!
|
|
\********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return BugHunterBadge; });\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nclass BugHunterBadge extends React.Component {\n render() {\n const props = this.props;\n return React.createElement(\"svg\", _extends({\n viewBox: \"0 0 31.3 29.5\"\n }, props, {\n height: \"100%\",\n width: props.size\n }), React.createElement(\"path\", {\n d: \"M22.8 1s12 8.2 7.4 19.7S16.6 29 20 25.6s-4-5.6-8.7-10L22.8 1\",\n fill: \"rgba(227,6,19,.6)\"\n }), React.createElement(\"path\", {\n d: \"M22.1 12.3c-2.5 3.2-6.1 4.8-8.9 4.3L3.6 28.8c-.7.9-1.9 1-2.8.3-.9-.7-1-1.9-.4-2.8L10 14.1c-1.3-2.5-.6-6.4 2-9.7 3.2-4 8-5.5 10.8-3.4s2.4 7.2-.7 11.3z\",\n fill: \"#e30613\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvc3ZnL2J1Z19odW50ZXIuanN4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy9zdmcvYnVnX2h1bnRlci5qc3g/NDhjNyJdLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBfZXh0ZW5kcygpIHsgX2V4dGVuZHMgPSBPYmplY3QuYXNzaWduIHx8IGZ1bmN0aW9uICh0YXJnZXQpIHsgZm9yICh2YXIgaSA9IDE7IGkgPCBhcmd1bWVudHMubGVuZ3RoOyBpKyspIHsgdmFyIHNvdXJjZSA9IGFyZ3VtZW50c1tpXTsgZm9yICh2YXIga2V5IGluIHNvdXJjZSkgeyBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHNvdXJjZSwga2V5KSkgeyB0YXJnZXRba2V5XSA9IHN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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/svg/bug_hunter.jsx\n")},"./src/svg/lightcord.jsx":/*!*******************************!*\
|
|
!*** ./src/svg/lightcord.jsx ***!
|
|
\*******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return LightcordLogo; });\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nclass LightcordLogo extends React.Component {\n render() {\n const props = this.props;\n return React.createElement(\"svg\", _extends({\n viewBox: \"0 0 168 168.69\"\n }, props, {\n height: \"100%\",\n width: props.size\n }), React.createElement(\"defs\", null, React.createElement(\"linearGradient\", {\n id: \"prefix__a\",\n x1: 66.7,\n y1: -487.7,\n x2: 66.7,\n y2: -508.73,\n gradientTransform: \"matrix(1 0 0 -1 0 -408)\",\n gradientUnits: \"userSpaceOnUse\"\n }, React.createElement(\"stop\", {\n offset: 0,\n stopColor: \"#e30613\"\n }), React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"#731a14\"\n })), React.createElement(\"linearGradient\", {\n id: \"prefix__b\",\n x1: 101.7,\n y1: -487.7,\n x2: 101.7,\n y2: -508.73,\n gradientTransform: \"matrix(1 0 0 -1 0 -408)\",\n gradientUnits: \"userSpaceOnUse\"\n }, React.createElement(\"stop\", {\n offset: 0,\n stopColor: \"#e20613\"\n }), React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"#731a13\"\n })), React.createElement(\"linearGradient\", {\n id: \"prefix__c\",\n x1: 84,\n y1: -408,\n x2: 84,\n y2: -576.69,\n gradientTransform: \"matrix(1 0 0 -1 0 -408)\",\n gradientUnits: \"userSpaceOnUse\"\n }, React.createElement(\"stop\", {\n offset: 0,\n stopColor: \"#e30613\"\n }), React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"#731a13\"\n }))), React.createElement(\"path\", {\n fill: \"#fff\",\n d: \"M14.9 35.3h139.2V133H14.9z\"\n }), React.createElement(\"path\", {\n d: \"M66.7 79.7c-5.4 0-9.8 4.7-9.8 10.5s4.4 10.5 9.8 10.5 9.8-4.7 9.8-10.5-4.4-10.5-9.8-10.5z\",\n fill: \"url(#prefix__a)\"\n }), React.createElement(\"path\", {\n d: \"M101.7 79.7c-5.4 0-9.8 4.7-9.8 10.5s4.4 10.5 9.8 10.5 9.8-4.7 9.8-10.5-4.4-10.5-9.8-10.5z\",\n fill: \"url(#prefix__b)\"\n }), React.createElement(\"path\", {\n d: \"M0 0v168l168 .69V0zm111.3 124.1s-3.4-4.1-6.3-7.7c12.6-3.5 17.4-11.3 17.4-11.3a52.52 52.52 0 01-11.1 5.6 68.63 68.63 0 01-38.9 4 70.12 70.12 0 01-14.1-4.1 48.88 48.88 0 01-7.1-3.3c-.3-.2-.6-.3-.9-.5a.76.76 0 00-.4-.2c-1.7-1-2.6-1.6-2.6-1.6s4.6 7.6 16.8 11.2c-2.9 3.6-6.4 7.9-6.4 7.9-21.2-.6-29.3-14.5-29.3-14.5 0-30.6 13.8-55.4 13.8-55.4 13.8-10.3 26.9-10 26.9-10l1 1.1C52.8 50.3 45 57.9 45 57.9a56.2 56.2 0 015.7-2.7 72.19 72.19 0 0121.8-6 8.75 8.75 0 011.6-.2 89.1 89.1 0 0119.4-.2 78.45 78.45 0 0128.9 9.1s-7.5-7.2-23.9-12.1l1.3-1.5s13.1-.3 26.9 10c0 0 13.8 24.8 13.8 55.4.1-.1-8 13.8-29.2 14.4z\",\n fill: \"url(#prefix__c)\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/svg/lightcord.jsx\n")},"./src/ui/AccountInfos.jsx":/*!*********************************!*\
|
|
!*** ./src/ui/AccountInfos.jsx ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_AccountInfos; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _settingsTitle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./settingsTitle */ \"./src/ui/settingsTitle.js\");\n/* harmony import */ var _settingsGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settingsGroup */ \"./src/ui/settingsGroup.js\");\n/* harmony import */ var _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_CustomRichPresence__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modules/CustomRichPresence */ \"./src/modules/CustomRichPresence.js\");\n/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./select */ \"./src/ui/select.jsx\");\n/* harmony import */ var _timestampRender__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./timestampRender */ \"./src/ui/timestampRender.js\");\n/* harmony import */ var _modules_domtools__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../modules/domtools */ \"./src/modules/domtools.js\");\n\n\n\n\n\n\n\n\n\n/**\r\n * @type {typeof import(\"react\")}\r\n */\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nlet contentModule = BDModules.get(e => e.contentColumn)[0];\nlet marginModule2 = BDModules.get(e => e.defaultMarginh5)[0];\nlet colorModule = BDModules.get(e => e.colorStandard)[0];\nlet sizeModule = BDModules.get(e => e.size32)[0];\nconst scrollbarModule1 = BDModules.get(e => e.scrollbarGhostHairline)[0];\nconst GuildModule = BDModules.get(e => e.default && e.default.getGuilds)[0].default;\nconst relationShipModule = BDModules.get(e => e.default && e.default.getRelationships)[0].default;\nconst sessionModule = BDModules.get(e => e.default && e.default.getSessions)[0].default;\nconst userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0].default;\nclass V2C_AccountInfos extends React.Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n return React.createElement(\"div\", {\n className: contentModule.contentColumn + \" \" + contentModule.contentColumnDefault + \" content-column default\",\n style: {\n padding: \"60px 40px 0px\"\n }\n }, React.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n text: \"Account Infos\"\n }), React.createElement(\"div\", null, React.createElement(\"h5\", {\n className: colorModule.colorStandard + \" \" + sizeModule.size14 + \" \" + marginModule2.h5 + \" \" + marginModule2.defaultMarginh5\n }, \"Profile\"), React.createElement(CodeContent, {\n content: this.getProfileValue(),\n language: \"diff\"\n }), React.createElement(\"h5\", {\n className: colorModule.colorStandard + \" \" + sizeModule.size14 + \" \" + marginModule2.h5 + \" \" + marginModule2.defaultMarginh5\n }, \"Statistics\"), React.createElement(CodeContent, {\n content: this.getStatistics(),\n language: \"diff\"\n }), React.createElement(\"h5\", {\n className: colorModule.colorStandard + \" \" + sizeModule.size14 + \" \" + marginModule2.h5 + \" \" + marginModule2.defaultMarginh5\n }, \"Connected Sessions\"), React.createElement(CodeContent, {\n content: this.getSessionValue(),\n language: \"diff\"\n })), React.createElement(\"div\", {\n className: BDModules.get(e => e.marginBottom20)[0].marginBottom20\n }));\n }\n\n getSessionValue() {\n const sessionsRaw = sessionModule.getSessions();\n const sessions = Object.keys(sessionsRaw).filter(e => e !== \"all\").map(e => sessionsRaw[e]);\n if (sessions.length === 0) return \"- No session detected. Please try in a few seconds\";\n return sessions.map(e => {\n return `+ id: ${e.sessionId}\n+ os: ${e.clientInfo.os[0].toUpperCase() + e.clientInfo.os.slice(1)}\n+ client: ${e.clientInfo.client}\n+ status: ${e.status}\n+ active: ${e.active ? \"Yes\" : \"No\"}\n+ Activities: ${e.activities.length}`;\n }).join(\"\\n\" + \"-\".repeat(38) + \"\\n\");\n }\n\n getProfileValue() {\n const user = userModule.getCurrentUser();\n /**\r\n * @type {Date}\r\n */\n\n const createdAt = user.createdAt;\n return `+ Username: ${user.username}\n+ Discriminator: ${user.discriminator}\n+ Tag: ${user.tag}\n+ ID: ${user.id}\n+ Avatar: ${user.avatar}\n+ Avatar URL: https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.${user.avatar.startsWith(\"a_\") ? \"gif\" : \"png\"}?size=4096\n+ Creation Date: ${createdAt.getDate().toString().padStart(2, \"0\")}/${(createdAt.getMonth() + 1).toString().padStart(2, \"0\")}/${createdAt.getFullYear().toString().padStart(2, \"0\")} ${createdAt.getHours().toString().padStart(2, \"0\")}h ${createdAt.getMinutes().toString().padStart(2, \"0\")}min ${createdAt.getSeconds()}s\n+ Flags: ${user.flags}\n+ Has Nitro: ${user.hasPremiumSubscription ? \"Yes\" : \"No\"}\n- Email: ${user.email}\n- 2FA: ${user.mfaEnabled ? \"Yes\" : \"No\"}\n- Has Been On Mobile: ${user.mobile ? \"Yes\" : \"No\"}\n- Phone: ${user.phone || \"None\"}\n- Verified: ${user.verified}`;\n }\n\n getStatistics() {\n const guilds = Object.values(GuildModule.getGuilds());\n const relations = Object.keys(relationShipModule.getRelationships());\n const friends = relations.filter(e => relationShipModule.isFriend(e));\n const blocked = relations.filter(e => relationShipModule.isBlocked(e));\n return `+ Server Count: ${guilds.length} servers\n+ Relations: ${relations.length} relations\n+ Friends Count: ${friends.length} friends\n- Blocked Users Count: ${blocked.length} blocked users`;\n }\n\n}\nconst hightlightJS = BDModules.get(e => e.highlight)[0];\nconst messageModule1 = BDModules.get(e => e.markup)[0];\nconst messageModule2 = BDModules.get(e => e.messageContent)[0];\n\nclass CodeContent extends React.Component {\n render() {\n return React.createElement(\"div\", {\n class: `${messageModule1.markup} ${messageModule2.messageContent}`\n }, React.createElement(\"pre\", null, React.createElement(\"code\", {\n class: `${scrollbarModule1.scrollbarGhostHairline} hljs`,\n dangerouslySetInnerHTML: {\n __html: hightlightJS.highlight(this.props.language, this.props.content).value\n }\n })), React.createElement(\"div\", {\n className: BDModules.get(e => e.marginBottom8)[0].marginBottom8\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvQWNjb3VudEluZm9zLmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvQWNjb3VudEluZm9zLmpzeD9hYTgyIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG5pbXBvcnQgVjJDX1NldHRpbmdzVGl0bGUg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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/AccountInfos.jsx\n")},"./src/ui/addoncard.jsx":/*!******************************!*\
|
|
!*** ./src/ui/addoncard.jsx ***!
|
|
\******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_PluginCard; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _modules_domtools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _xSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./xSvg */ \"./src/ui/xSvg.js\");\n/* harmony import */ var _reloadIcon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./reloadIcon */ \"./src/ui/reloadIcon.js\");\n/* harmony import */ var _icons_edit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icons/edit */ \"./src/ui/icons/edit.jsx\");\n/* harmony import */ var _icons_delete__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icons/delete */ \"./src/ui/icons/delete.jsx\");\n/* harmony import */ var _components_switch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/switch */ \"./src/ui/components/switch.jsx\");\n/* harmony import */ var _tooltipWrap__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./tooltipWrap */ \"./src/ui/tooltipWrap.js\");\n\n\n\n\n\n\n\n\n\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].React;\nconst anchorClasses = _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].anchorClasses;\nclass V2C_PluginCard extends _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n this.showSettings = this.showSettings.bind(this);\n this.setInitialState();\n this.hasSettings = this.props.addon.plugin && typeof this.props.addon.plugin.getSettingsPanel === \"function\";\n this.settingsPanel = \"\";\n this.edit = this.edit.bind(this);\n this.delete = this.delete.bind(this);\n this.reload = this.reload.bind(this);\n }\n\n setInitialState() {\n this.state = {\n checked: this.props.enabled,\n settings: false,\n reloads: 0\n };\n }\n\n showSettings() {\n if (!this.hasSettings) return;\n this.setState({\n settings: true\n });\n }\n\n closeSettings() {\n this.panelRef.current.innerHTML = \"\";\n this.setState({\n settingsOpen: false\n });\n }\n\n componentDidUpdate() {\n if (!this.state.settings) return;\n\n if (typeof this.settingsPanel === \"object\") {\n this.refs.settingspanel.appendChild(this.settingsPanel);\n }\n\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-3\"]) return;\n setImmediate(() => {\n const isHidden = (container, element) => {\n const cTop = container.scrollTop;\n const cBottom = cTop + container.clientHeight;\n const eTop = element.offsetTop;\n const eBottom = eTop + element.clientHeight;\n return eTop < cTop || eBottom > cBottom;\n };\n\n const thisNode = this.refs.cardNode;\n const container = thisNode.closest(\".scroller\");\n if (!isHidden(container, thisNode)) return;\n const thisNodeOffset = _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].offset(thisNode);\n const containerOffset = _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].offset(container);\n const original = container.scrollTop;\n const endPoint = thisNodeOffset.top - containerOffset.top + container.scrollTop - 30;\n _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].animate({\n duration: 300,\n update: function (progress) {\n if (endPoint > original) container.scrollTop = original + progress * (endPoint - original);else container.scrollTop = original - progress * (original - endPoint);\n }\n });\n });\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n get settingsComponent() {\n try {\n this.settingsPanel = this.props.addon.plugin.getSettingsPanel();\n } catch (err) {\n _modules_utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].err(\"Plugins\", \"Unable to get settings panel for \" + this.name + \".\", err);\n }\n\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card bd-addon-card settings-open ui-switch-item\",\n ref: \"cardNode\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n style: {\n \"float\": \"right\",\n \"cursor\": \"pointer\"\n },\n onClick: () => {\n this.refs.settingspanel.innerHTML = \"\";\n this.setState({\n settings: false\n });\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_xSvg__WEBPACK_IMPORTED_MODULE_4__[\"default\"], null)), typeof this.settingsPanel === \"object\" && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n id: `plugin-settings-${this.name}`,\n className: \"plugin-settings\",\n ref: \"settingspanel\"\n }), typeof this.settingsPanel !== \"object\" && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n id: `plugin-settings-${this.name}`,\n className: \"plugin-settings\",\n ref: \"settingspanel\",\n dangerouslySetInnerHTML: {\n __html: this.settingsPanel\n }\n }));\n }\n\n buildTitle(name, version, author) {\n const title = \"{{name}} v{{version}} by {{author}}\".split(/({{[A-Za-z]+}})/);\n const nameIndex = title.findIndex(s => s == \"{{name}}\");\n if (nameIndex) title[nameIndex] = React.createElement(\"span\", {\n className: \"name bda-name\"\n }, name);\n const versionIndex = title.findIndex(s => s == \"{{version}}\");\n if (nameIndex) title[versionIndex] = React.createElement(\"span\", {\n className: \"version bda-version\"\n }, version);\n const authorIndex = title.findIndex(s => s == \"{{author}}\");\n\n if (nameIndex) {\n const props = {\n className: \"author bda-author\"\n };\n\n if (author.link || author.id) {\n props.className += ` ${anchorClasses.anchor} ${anchorClasses.anchorUnderlineOnHover}`;\n props.target = \"_blank\";\n if (author.link) props.href = author.link;\n if (author.id) props.onClick = () => {\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LayerStack.popLayer();\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].openDM(author.id);\n };\n }\n\n title[authorIndex] = React.createElement(author.link || author.id ? \"a\" : \"span\", props, author.name);\n }\n\n return title.flat();\n }\n\n makeLink(title, url) {\n const props = {\n className: \"bda-link bda-link-website\",\n target: \"_blank\"\n };\n if (typeof url == \"string\") props.href = url;\n if (typeof url == \"function\") props.onClick = event => {\n event.preventDefault();\n event.stopPropagation();\n url();\n };\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"a\", props, title);\n }\n\n makeButton(title, children, action) {\n return React.createElement(_tooltipWrap__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: title\n }, React.createElement(\"div\", {\n className: \"bd-addon-button\",\n onClick: action\n }, children));\n }\n\n get links() {\n const links = [];\n const addon = this.props.addon;\n if (addon.website) links.push(this.makeLink(\"Website\", addon.website));\n if (addon.source) links.push(this.makeLink(\"Source\", addon.source));\n\n if (addon.invite) {\n links.push(this.makeLink(\"Support Server\", () => {\n const tester = /\\.gg\\/(.*)$/;\n let code = addon.invite;\n if (tester.test(code)) code = code.match(tester)[1];\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LayerStack.popLayer();\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].InviteActions.acceptInviteAndTransitionToInviteChannel(code);\n }));\n }\n\n if (addon.donate) links.push(this.makeLink(\"Donate\", addon.donate));\n if (addon.patreon) links.push(this.makeLink(\"Patreon\", addon.patreon));\n return links;\n }\n\n get footer() {\n const links = this.links;\n return (links.length || this.hasSettings) && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card-footer bda-footer\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"span\", {\n className: \"bd-addon-links bda-links\"\n }, ...links.map((element, index) => index < links.length - 1 ? [element, \" | \"] : element).flat()), this.hasSettings && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"button\", {\n onClick: this.showSettings,\n className: \"bd-button bda-settings-button\",\n disabled: !this.state.checked\n }, \"Settings\"));\n }\n\n onChange() {\n this.props.toggle && this.props.toggle(this.name);\n this.setState({\n checked: !this.state.checked\n });\n }\n\n edit() {\n this.props.edit(this.name);\n }\n\n delete() {\n this.props.remove(this.name);\n }\n\n reload() {\n this.props.reload(this.name);\n }\n\n get name() {\n return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getName() : this.props.addon.name);\n }\n\n get author() {\n return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getAuthor() : this.props.addon.author);\n }\n\n get description() {\n return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getDescription() : this.props.addon.description);\n }\n\n get version() {\n return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getVersion() : this.props.addon.version);\n }\n\n render() {\n if (this.state.settings) return this.settingsComponent;\n const {\n authorId,\n authorLink\n } = this.props.addon;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card bd-addon-card settings-closed ui-switch-item\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-addon-header bda-header\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card-title bda-header-title\"\n }, this.buildTitle(this.name, this.version, {\n name: this.author,\n id: authorId,\n link: authorLink\n })), _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-addon-controls bda-controls\"\n }, this.props.edit && this.makeButton(\"Edit\", React.createElement(_icons_edit__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n className: \"bd-icon\"\n }), this.edit), this.props.remove && this.makeButton(\"Delete\", React.createElement(_icons_delete__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n className: \"bd-icon\"\n }), this.delete), this.props.reload && this.makeButton(\"Reload\", React.createElement(_reloadIcon__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n className: \"bd-icon\"\n }), this.reload), React.createElement(_components_switch__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n onChange: this.onChange,\n checked: this.state.checked\n }))), _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-scroller-wrap bda-description-wrap scroller-wrap fade\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-scroller bd-addon-description bda-description scroller\"\n }, this.description)), this.footer);\n }\n\n}\nconst originalRender = V2C_PluginCard.prototype.render;\nObject.defineProperty(V2C_PluginCard.prototype, \"render\", {\n enumerable: false,\n configurable: false,\n set: function () {\n console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");\n },\n get: () => originalRender\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvYWRkb25jYXJkLmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvYWRkb25jYXJkLmpzeD9lYTY4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNldHRpbmdzQ29va2llIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuLi9tb2R1bGVzL3V0aWxzXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuLi9tb2R1bGVzL2RvbXRvb2xzXCI7XG5pbXBvcnQgWF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ZSBiZGEtbmFtZVwiXG4gICAgfSwgbmFtZSk7XG4gICAgY29uc3QgdmVyc2lvbkluZGV4ID0gdGl0bGUuZmluZEluZGV4KHMgPT4gcyA9PSBcInt7dmVyc2lvbn19XCIpO1xuICAgIGlmIChuYW1lSW5kZXgpIHRpdGxlW3ZlcnNpb25JbmRleF0gPSBSZWFjdC5jcmVhdGVFbGVtZW50KFwic3BhblwiLCB7XG4gICAgICBjbGFzc05hbWU6IFwidmVyc2lvbiBiZGEtdmVyc2lvblwiXG4gICAgfSwgdmVyc2lvbik7XG4gICAgY29uc3QgYXV0aG9ySW5kZXggPSB0aXRsZS5maW5kSW5kZXgocyA9PiBzID09IFwie3thdXRob3J9fVwiKTtcblxuICAgIGlmIChuYW1lSW5kZXgpIHtcbiAgICAgIGNvbnN0IHByb3BzID0ge1xuICAgICAgICBjbGFzc05hbWU6IFwiYXV0aG9yIGJkYS1hdXRob3JcIlxuICAgICAgfTtcblxuICAgICAgaWYgKGF1dGhvci5saW5rIHx8IGF1dGhvci5pZCkge1xuICAgICAgICBwcm9wcy5jbGFzc05hbWUgKz0gYCAke2FuY2hvckNsYXNzZXMuYW5jaG9yfSAke2FuY2hvckNsYXNzZXMuYW5jaG9yVW5kZXJsaW5lT25Ib3Zlcn1gO1xuICAgICAgICBwcm9wcy50YXJnZXQgPSBcIl9ibGFua1wiO1xuICAgICAgICBpZiAoYXV0aG9yLmxpbmspIHByb3BzLmhyZWYgPSBhdXRob3IubGluaztcbiAgICAgICAgaWYgKGF1dGhvci5pZCkgcHJvcHMub25DbGljayA9ICgpID0+IHtcbiAgICAgICAgICBCRFYyLkxheWVyU3RhY2sucG9wTGF5ZXIoKTtcbiAgICAgICAgICBCRFYyLm9wZW5ETShhdXRob3IuaWQpO1xuICAgICAgICB9O1xuICAgICAgfVxuXG4gICAgICB0aXRsZVthdXRob3JJbmRleF0gPSBSZWFjdC5jcmVhdGVFbGVtZW50KGF1dGhvci5saW5rIHx8IGF1dGhvci5pZCA/IFw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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/addoncard.jsx\n")},"./src/ui/addonlist.jsx":/*!******************************!*\
|
|
!*** ./src/ui/addonlist.jsx ***!
|
|
\******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CardList; });\n/* harmony import */ var _errorBoundary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errorBoundary */ \"./src/ui/errorBoundary.js\");\n/* harmony import */ var _contentColumn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentColumn */ \"./src/ui/contentColumn.js\");\n/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tools */ \"./src/ui/tools.js\");\n/* harmony import */ var _reloadIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reloadIcon */ \"./src/ui/reloadIcon.js\");\n/* harmony import */ var _addoncard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./addoncard */ \"./src/ui/addoncard.jsx\");\n/* harmony import */ var _scroller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scroller */ \"./src/ui/scroller.js\");\n/* harmony import */ var _components_dropdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/dropdown */ \"./src/ui/components/dropdown.jsx\");\n/* harmony import */ var _components_search__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/search */ \"./src/ui/components/search.jsx\");\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modules/contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modules/pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../modules/themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _modules_webpackModules__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../modules/webpackModules */ \"./src/modules/webpackModules.js\");\n/* harmony import */ var _modules_bdApi__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../modules/bdApi */ \"./src/modules/bdApi.js\");\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst Tooltip = _modules_webpackModules__WEBPACK_IMPORTED_MODULE_13__[\"default\"].findByDisplayName(\"Tooltip\");\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_10__[\"default\"].react;\nclass CardList extends _modules_v2__WEBPACK_IMPORTED_MODULE_10__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.state = {\n sort: \"name\",\n ascending: true,\n query: \"\"\n };\n this.isPlugins = this.props.type == \"plugins\";\n this.cookie = this.isPlugins ? _0globals__WEBPACK_IMPORTED_MODULE_8__[\"pluginCookie\"] : _0globals__WEBPACK_IMPORTED_MODULE_8__[\"themeCookie\"];\n this.manager = this.isPlugins ? _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__[\"default\"] : _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\n this.sort = this.sort.bind(this);\n this.reverse = this.reverse.bind(this);\n this.search = this.search.bind(this);\n }\n\n openFolder() {\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(this.isPlugins ? _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__[\"default\"].pluginsFolder : _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__[\"default\"].themesFolder);\n }\n\n edit(name) {\n console.log(name);\n this.manager.edit(name);\n }\n\n async delete(name) {\n const shouldDelete = await this.confirmDelete(name);\n if (!shouldDelete) return;\n this.manager.delete(name);\n }\n\n confirmDelete(name) {\n return new Promise(resolve => {\n _modules_bdApi__WEBPACK_IMPORTED_MODULE_14__[\"default\"].showConfirmationModal(\"Are You Sure?\", `Are you sure you want to delete ${name}?`, {\n danger: true,\n confirmText: \"Delete\",\n onConfirm: () => {\n resolve(true);\n },\n onCancel: () => {\n resolve(false);\n }\n });\n });\n }\n\n get sortOptions() {\n return [{\n label: \"Name\",\n value: \"name\"\n }, {\n label: \"Author\",\n value: \"author\"\n }, {\n label: \"Version\",\n value: \"version\"\n }, {\n label: \"Recently Added\",\n value: \"added\"\n }, {\n label: \"Last Modified\",\n value: \"modified\"\n }, {\n label: \"File Size\",\n value: \"size\"\n }];\n }\n\n get directions() {\n return [{\n label: \"Ascending\",\n value: true\n }, {\n label: \"Descending\",\n value: false\n }];\n }\n\n reverse(value) {\n this.setState({\n ascending: value\n });\n }\n\n sort(value) {\n this.setState({\n sort: value\n });\n }\n\n search(event) {\n this.setState({\n query: event.target.value.toLocaleLowerCase()\n });\n }\n\n getProps(addon) {\n return {\n key: this.getName(addon),\n enabled: this.cookie[this.getName(addon)],\n toggle: this.manager.toggle.bind(this.manager),\n //edit: this.edit.bind(this),\n remove: this.delete.bind(this),\n addon: addon\n };\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n getAddons() {\n const sortedAddons = this.props.list.sort((a, b) => {\n const cap = this.state.sort.charAt(0).toUpperCase() + this.state.sort.slice(1);\n const first = a.plugin && a.plugin[`get${cap}`] ? this.getString(a.plugin[`get${cap}`]()) : a[this.state.sort];\n const second = b.plugin && b.plugin[`get${cap}`] ? this.getString(b.plugin[`get${cap}`]()) : b[this.state.sort];\n if (typeof first == \"string\") return first.toLocaleLowerCase().localeCompare(second.toLocaleLowerCase());\n if (first > second) return 1;\n if (second > first) return -1;\n return 0;\n });\n if (!this.state.ascending) sortedAddons.reverse();\n const rendered = [];\n\n for (let a = 0; a < sortedAddons.length; a++) {\n const addon = sortedAddons[a];\n\n if (this.state.query) {\n let matches = null;\n const name = this.getName(addon);\n const author = this.getAuthor(addon);\n const description = this.getDescription(addon);\n const version = this.getVersion(addon);\n if (name) matches = name.toLocaleLowerCase().includes(this.state.query);\n if (author) matches = matches || author.toLocaleLowerCase().includes(this.state.query);\n if (description) matches = matches || description.toLocaleLowerCase().includes(this.state.query);\n if (version) matches = matches || version.toLocaleLowerCase().includes(this.state.query);\n if (!matches) continue;\n }\n\n const props = this.getProps(addon);\n rendered.push(React.createElement(_errorBoundary__WEBPACK_IMPORTED_MODULE_0__[\"default\"], null, React.createElement(_addoncard__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _extends({}, props, {\n reload: !_0globals__WEBPACK_IMPORTED_MODULE_8__[\"settingsCookie\"][\"fork-ps-5\"] && this.manager.reload.bind(this.manager)\n }))));\n }\n\n return rendered;\n }\n\n getName(addon) {\n return this.getString(addon.plugin ? addon.plugin.getName() : addon.name);\n }\n\n getAuthor(addon) {\n return this.getString(addon.plugin ? addon.plugin.getAuthor() : addon.author);\n }\n\n getDescription(addon) {\n return this.getString(addon.plugin ? addon.plugin.getDescription() : addon.description);\n }\n\n getVersion(addon) {\n return this.getString(addon.plugin ? addon.plugin.getVersion() : addon.version);\n }\n\n render() {\n const refreshIcon = React.createElement(Tooltip, {\n color: \"black\",\n position: \"top\",\n text: \"Reload List\"\n }, props => React.createElement(_reloadIcon__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _extends({}, props, {\n className: \"bd-icon bd-reload bd-reload-header\",\n size: \"18px\",\n onClick: async () => {\n if (this.isPlugins) _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__[\"default\"].updatePluginList();else _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__[\"default\"].updateThemeList();\n this.forceUpdate();\n }\n })));\n const addonCards = this.getAddons();\n return React.createElement(_scroller__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true\n }, React.createElement(_contentColumn__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n title: `${this.props.type.toUpperCase()}\u2014${addonCards.length}`\n }, React.createElement(\"button\", {\n key: \"folder-button\",\n className: \"bd-button bd-pfbtn\",\n onClick: this.openFolder.bind(this)\n }, \"Open \", this.isPlugins ? \"Plugin\" : \"Theme\", \" Folder\"), !_0globals__WEBPACK_IMPORTED_MODULE_8__[\"settingsCookie\"][\"fork-ps-5\"] && refreshIcon, React.createElement(\"div\", {\n className: \"bd-controls bd-addon-controls\"\n }, React.createElement(_components_search__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n onChange: this.search,\n placeholder: `Search ${this.props.type}...`\n }), React.createElement(\"div\", {\n className: \"bd-addon-dropdowns\"\n }, React.createElement(\"div\", {\n className: \"bd-select-wrapper\"\n }, React.createElement(\"label\", {\n className: \"bd-label\"\n }, \"Sort by:\"), React.createElement(_components_dropdown__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n options: this.sortOptions,\n onChange: this.sort,\n style: \"transparent\"\n })), React.createElement(\"div\", {\n className: \"bd-select-wrapper\"\n }, React.createElement(\"label\", {\n className: \"bd-label\"\n }, \"Order:\"), React.createElement(_components_dropdown__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n options: this.directions,\n onChange: this.reverse,\n style: \"transparent\"\n })))), React.createElement(\"div\", {\n className: \"bda-slist bd-addon-list\"\n }, addonCards)), React.createElement(_tools__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n key: \"tools\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvYWRkb25saXN0LmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvYWRkb25saXN0LmpzeD80OGQxIl0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIF9leHRlbmRzKCkgeyBfZXh0ZW5kcyA9IE9iamVjdC5hc3NpZ24gfHwgZnVuY3Rpb24gKHRhcmdldCkgeyBmb3IgKHZhciBpID0gMTsgaSA8IGFyZ3VtZW50cy5sZW5ndGg7IGkrKykgeyB2YXIgc291cmNlID0gYXJndW1lbnRzW2ldOyBmb3IgKHZhciBrZXkgaW4gc291cmNlKSB7IGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoc291cmNlLCBrZXkpKSB7IHRhcmdldFtrZXldID0gc291cmNlW2tleV07IH0gfSB9IHJldHVybiB0YXJnZXQ7IH07IHJldHVybiBfZXh0ZW5kcy5hcHBseSh0aGlzLCBhcmd1bWVudHMpOyB9XG5cbmltcG9ydCBFcnJvckJvdW5kYXJ5IGZyb20gXCIuL2Vycm9yQm91bmRhcnlcIjtcbmltcG9ydCBDb250ZW50Q29sdW1uIGZyb20gXCIuL2NvbnRlbnRDb2x1bW5cIjtcbmltcG9ydCBUb29scyBmcm9tIFwiLi90b29sc1wiO1xuaW1wb3J0IFJlbG9hZEljb24gZnJvbSBcIi4vcmVsb2FkSWNvblwiO1xuaW1wb3J0IEFkZG9uQ2FyZCBmcm9tIFwiLi9hZGRvbmNhcmRcIjtcbmltcG9ydCBTY3JvbGxlciBmcm9tIFwiLi9zY3JvbGxlclwiO1xuaW1wb3J0IERyb3Bkb3duIGZyb20gXCIuL2NvbXBvbmVudHMvZHJvcGRvd25cIjtcbmltcG9ydCBTZWFyY2ggZnJvbSBc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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/addonlist.jsx\n")},"./src/ui/bdLogo.js":/*!**************************!*\
|
|
!*** ./src/ui/bdLogo.js ***!
|
|
\**************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return BDLogo; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass BDLogo extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"svg\", {\n height: \"100%\",\n width: this.props.size || \"16px\",\n className: \"bd-logo \" + this.props.className,\n style: {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n },\n viewBox: \"0 0 2000 2000\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"metadata\", null), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"defs\", null, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"filter\", {\n id: \"shadow1\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"feDropShadow\", {\n \"dx\": \"20\",\n \"dy\": \"0\",\n \"stdDeviation\": \"20\",\n \"flood-color\": \"rgba(0,0,0,0.35)\"\n })), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"filter\", {\n id: \"shadow2\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"feDropShadow\", {\n \"dx\": \"15\",\n \"dy\": \"0\",\n \"stdDeviation\": \"20\",\n \"flood-color\": \"rgba(255,255,255,0.15)\"\n })), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"filter\", {\n id: \"shadow3\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"feDropShadow\", {\n \"dx\": \"10\",\n \"dy\": \"0\",\n \"stdDeviation\": \"20\",\n \"flood-color\": \"rgba(0,0,0,0.35)\"\n }))), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"g\", null, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"path\", {\n style: {\n filter: \"url(#shadow3)\"\n },\n d: \"M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z\",\n fill: \"#171717\",\n opacity: \"1\"\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"path\", {\n style: {\n filter: \"url(#shadow2)\"\n },\n d: \"M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z\",\n fill: \"#3E82E5\",\n opacity: \"1\"\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"path\", {\n style: {\n filter: \"url(#shadow1)\"\n },\n d: \"M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z\",\n fill: \"#FFFFFF\",\n opacity: \"1\"\n })));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvYmRMb2dvLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS9iZExvZ28uanM/MzYxYiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgQkRMb2dvIGV4dGVuZHMgQkRWMi5yZWFjdENvbXBvbmVudCB7XG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwic3ZnXCIsIHtcbiAgICAgIGhlaWdodDogXCIxMDAlXCIsXG4gICAgICB3aWR0aDogdGhpcy5wcm9wcy5zaXplIHx8IFwiMTZweFwiLFxuICAgICAgY2xhc3NOYW1lOiBcImJkLWxvZ28gXCIgKyB0aGlzLnByb3BzLmNsYXNzTmFtZSxcbiAgICAgIHN0eWxlOiB7XG4gICAgICAgIGZpbGxSdWxlOiBcImV2ZW5vZGRcIixcbiAgICAgICAgY2xpcFJ1bGU6IFwiZXZlbm9kZFwiLFxuICAgICAgICBzdHJva2VMaW5lY2FwOiBcInJvdW5kXCIsXG4gICAgICAgIHN0cm9rZUxpbmVqb2luOiBcInJvdW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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/bdLogo.js\n")},"./src/ui/checkbox.js":/*!****************************!*\
|
|
!*** ./src/ui/checkbox.js ***!
|
|
\****************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_Checkbox; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_Checkbox extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.onClick = this.onClick.bind(this);\n this.setInitialState();\n }\n\n setInitialState() {\n this.state = {\n checked: this.props.checked || false\n };\n }\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"li\", null, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"checkbox \" + BDModules.get(e => e.checkboxElement)[0].checkbox,\n onClick: this.onClick\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"checkbox-inner \" + BDModules.get(e => e.checkboxInner)[0].checkboxInner\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"input\", {\n className: BDModules.get(e => e.checkboxElement)[0].checkboxElement,\n checked: this.state.checked,\n onChange: () => {},\n type: \"checkbox\"\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"span\", null)), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"span\", null, this.props.text)));\n }\n\n onClick() {\n this.props.onChange(this.props.id, !this.state.checked);\n this.setState({\n checked: !this.state.checked\n });\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvY2hlY2tib3guanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL3VpL2NoZWNrYm94LmpzPzIzN2IiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEJEVjIgZnJvbSBcIi4uL21vZHVsZXMvdjJcIjtcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFYyQ19DaGVja2JveCBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgICB0aGlzLm9uQ2xpY2sgPSB0aGlzLm9uQ2xpY2suYmluZCh0aGlzKTtcbiAgICB0aGlzLnNldEluaXRpYWxTdGF0ZSgpO1xuICB9XG5cbiAgc2V0SW5pdGlhbFN0YXRlKCkge1xuICAgIHRoaXMuc3RhdGUgPSB7XG4gICAgICBjaGVja2VkOiB0aGlzLnByb3BzLmNoZWNrZWQgfHwgZmFsc2VcbiAgICB9O1xuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIHJldHVybiBCRFYyLnJlYWN0LmNyZWF0ZUVsZW1lbnQoXCJsaVwiLCBudWxsLCBCRFYyLnJlYWN0LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIiwge1xuICAgICAgY2xhc3NOYW1lOiBcImNoZWNrYm94IFwiICsgQkRNb2R1b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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/checkbox.js\n")},"./src/ui/components/dropdown.jsx":/*!****************************************!*\
|
|
!*** ./src/ui/components/dropdown.jsx ***!
|
|
\****************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Select; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _icons_downarrow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icons/downarrow */ \"./src/ui/icons/downarrow.jsx\");\n\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass Select extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n open: false,\n value: this.props.value || this.props.options[0].value\n };\n this.dropdown = React.createRef();\n this.onChange = this.onChange.bind(this);\n this.showMenu = this.showMenu.bind(this);\n this.hideMenu = this.hideMenu.bind(this);\n }\n\n showMenu(event) {\n event.preventDefault();\n this.setState({\n open: true\n }, () => {\n document.addEventListener(\"click\", this.hideMenu);\n });\n }\n\n hideMenu() {\n this.setState({\n open: false\n }, () => {\n document.removeEventListener(\"click\", this.hideMenu);\n });\n }\n\n onChange(value) {\n this.setState({\n value\n });\n if (this.props.onChange) this.props.onChange(value);\n }\n\n get selected() {\n return this.props.options.find(o => o.value == this.state.value);\n }\n\n get options() {\n const selected = this.selected;\n return React.createElement(\"div\", {\n className: \"bd-select-options\"\n }, this.props.options.map(opt => React.createElement(\"div\", {\n className: `bd-select-option${selected.value == opt.value ? \" selected\" : \"\"}`,\n onClick: this.onChange.bind(this, opt.value)\n }, opt.label)));\n }\n\n render() {\n const style = this.props.style == \"transparent\" ? \" bd-select-transparent\" : \"\";\n const isOpen = this.state.open ? \" menu-open\" : \"\";\n return React.createElement(\"div\", {\n className: `bd-select${style}${isOpen}`,\n onClick: this.showMenu,\n ref: this.dropdown\n }, React.createElement(\"div\", {\n className: \"bd-select-value\"\n }, this.selected.label), React.createElement(_icons_downarrow__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n className: \"bd-select-arrow\"\n }), this.state.open && this.options);\n }\n\n} // return <div className=\"bd-select-wrap\">\n// <label className=\"bd-label\">{this.props.label}</label>\n// <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\n// <div className=\"bd-select-controls\">\n// <div className=\"bd-select-value\">{this.selected.label}</div>\n// <Arrow className=\"bd-select-arrow\" />\n// </div>\n// </div>\n// {this.state.open && this.options}\n// </div>;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvY29tcG9uZW50cy9kcm9wZG93bi5qc3guanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL3VpL2NvbXBvbmVudHMvZHJvcGRvd24uanN4PzE0YTEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEJEVjIgZnJvbSBcIi4uLy4uL21vZHVsZXMvdjJcIjtcbmltcG9ydCBBcnJvdyBmcm9tIFwiLi4vaWNvbnMvZG93bmFycm93XCI7XG5jb25zdCBSZWFjdCA9IEJEVjIuUmVhY3Q7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBTZWxlY3QgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgICB0aGlzLnN0YXRlID0ge1xuICAg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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/components/dropdown.jsx\n")},"./src/ui/components/search.jsx":/*!**************************************!*\
|
|
!*** ./src/ui/components/search.jsx ***!
|
|
\**************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Search; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _icons_search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icons/search */ \"./src/ui/icons/search.jsx\");\n\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass Search extends React.Component {\n render() {\n return React.createElement(\"div\", {\n className: \"bd-search-wrapper\"\n }, React.createElement(\"input\", {\n onChange: this.props.onChange,\n onKeyDown: this.props.onKeyDown,\n type: \"text\",\n className: \"bd-search\",\n placeholder: this.props.placeholder,\n maxLength: \"50\"\n }), React.createElement(_icons_search__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvY29tcG9uZW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sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/components/search.jsx\n")},"./src/ui/components/switch.jsx":/*!**************************************!*\
|
|
!*** ./src/ui/components/switch.jsx ***!
|
|
\**************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Switch; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass Switch extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n checked: this.props.checked\n };\n this.onChange = this.onChange.bind(this);\n }\n\n onChange() {\n if (this.props.disabled) return;\n this.props.onChange(!this.state.checked);\n this.setState({\n checked: !this.state.checked\n });\n }\n\n render() {\n const enabledClass = this.props.disabled ? \" bd-switch-disabled\" : \"\";\n const checkedClass = this.state.checked ? \" bd-switch-checked\" : \"\";\n return React.createElement(\"div\", {\n className: `bd-switch` + enabledClass + checkedClass\n }, React.createElement(\"input\", {\n type: \"checkbox\",\n id: this.props.id,\n className: `bd-checkbox`,\n disabled: this.props.disabled,\n checked: this.state.checked,\n onChange: this.onChange\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvY29tcG9uZW50cy9zd2l0Y2guanN4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS9jb21wb25lbnRzL3N3aXRjaC5qc3g/MWRkOCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQkRWMiBmcm9tIFwiLi4vLi4vbW9kdWxlcy92MlwiO1xuY29uc3QgUmVhY3QgPSBCRFYyLlJlYWN0O1xuZXh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wcm9wcy5kaXNhYmxlZCxcbiAgICAgIGNoZWNrZWQ6IHRoaXMuc3RhdGUuY2hlY2tlZCxcbiAgICAgIG9uQ2hhbmdlOiB0aGlzLm9uQ2hhbmdlXG4gICAgfSkpO1xuICB9XG5cbn0iXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/components/switch.jsx\n")},"./src/ui/contentColumn.js":/*!*********************************!*\
|
|
!*** ./src/ui/contentColumn.js ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_ContentColumn; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_ContentColumn extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n static get displayName() {\n return \"ContentColumn\";\n }\n\n render() {\n let contentModule = BDModules.get(e => e.contentColumn)[0];\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: contentModule.contentColumn + \" \" + contentModule.contentColumnDefault + \" content-column default\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"h2\", {\n className: \"ui-form-title h2 margin-reset margin-bottom-20\"\n }, this.props.title), this.props.children);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvY29udGVudENvbHVtbi5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvY29udGVudENvbHVtbi5qcz9kNWMzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWMkNfQ29udGVudENvbHVtbiBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgfVxuXG4gIHN0YXRpYyBnZXQgZGlzcGxheU5hbWUoKSB7XG4gICAgcmV0dXJuIFwiQ29udGVudENvbHVtblwiO1xuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIGxldCBjb250ZW50TW9kdWxlID0gQkRNb2R1bGVzLmdldChlID0+IGUuY29udGVudENvbHVtbilbMF07XG4gICAgcmV0dXJuIEJEVjIucmVhY3QuY3JlYXRlRWxlbWVudChcImRpdlwiLCB7XG4gICAgICBjbGFzc05hbWU6IGNvbnRlbnRNb2R1bGUuY29udGVudENvbHVtbiArIFwiIFwiICsgY29udGVudE1vZHVsZS5jb250ZW50Q29sdW1uRGVmYXVsdCArIFwiIGNvbnRlbnQtY29sdW1uIGRlZmF1bHRcIlxuICAgIH0sIEJEVjIucmVhY3QuY3JlYXRlRWxlbWVudChcImgyXCIsIHtcbiAgICAgIGNsYXNzTmFtZTogXCJ1aS1mb3JtLXRpdGxlIGgyIG1hcmdpbi1yZXNldCBtYXJnaW4tYm90dG9tLTIwXCJcbiAgICB9LCB0aGlzLnByb3BzLnRpdGxlKSwgdGhpcy5wcm9wcy5jaGlsZHJlbik7XG4gIH1cblxufSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/contentColumn.js\n")},"./src/ui/cssEditor.js":/*!*****************************!*\
|
|
!*** ./src/ui/cssEditor.js ***!
|
|
\*****************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_CssEditor; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_settingsPanel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/settingsPanel */ \"./src/modules/settingsPanel.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _modules_domtools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modules/domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _settingsTitle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./settingsTitle */ \"./src/ui/settingsTitle.js\");\n/* harmony import */ var _checkbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./checkbox */ \"./src/ui/checkbox.js\");\n/* harmony import */ var _cssEditorDetached__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cssEditorDetached */ \"./src/ui/cssEditorDetached.js\");\n\n\n\n\n\n\n\n\nclass V2C_CssEditor extends _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n const self = this;\n self.props.lines = 0;\n self.setInitialState();\n self.attach = self.attach.bind(self);\n self.detachedEditor = _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(_cssEditorDetached__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n attach: self.attach\n });\n self.onClick = self.onClick.bind(self);\n self.updateCss = self.updateCss.bind(self);\n self.saveCss = self.saveCss.bind(self);\n self.detach = self.detach.bind(self);\n }\n\n setInitialState() {\n this.state = {\n detached: this.props.detached || _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].editorDetached\n };\n }\n\n componentDidMount() {\n // this.updateLineCount();\n this.editor = ace.edit(\"bd-customcss-editor\");\n this.editor.setTheme(\"ace/theme/monokai\");\n this.editor.session.setMode(\"ace/mode/css\");\n this.editor.setShowPrintMargin(false);\n this.editor.setFontSize(14);\n this.editor.on(\"change\", () => {\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-css-0\"]) return;\n this.saveCss();\n this.updateCss();\n });\n }\n\n componentWillUnmount() {\n this.editor.destroy();\n }\n\n componentDidUpdate(prevProps, prevState) {\n const self = this;\n\n if (prevState.detached && !self.state.detached) {\n _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reactDom.unmountComponentAtNode(self.detachedRoot);\n }\n }\n\n codeMirror() {}\n\n get options() {\n return {\n lineNumbers: true,\n mode: \"css\",\n indentUnit: 4,\n theme: \"material\",\n scrollbarStyle: \"simple\"\n };\n }\n\n get css() {\n const _ccss = _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getBDData(\"bdcustomcss\");\n\n let ccss = \"\";\n\n if (_ccss && _ccss !== \"\") {\n ccss = atob(_ccss);\n }\n\n return ccss;\n }\n\n updateLineCount() {\n const lineCount = this.refs.editor.value.split(\"\\n\").length;\n if (lineCount == this.props.lines) return;\n this.refs.lines.textContent = Array.from(new Array(lineCount), (_, i) => i + 1).join(\".\\n\") + \".\";\n this.props.lines = lineCount;\n }\n\n render() {\n const self = this;\n const {\n detached\n } = self.state;\n let contentModule = BDModules.get(e => e.contentColumn)[0];\n return _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n className: contentModule.contentColumn + \" \" + contentModule.contentColumnDefault + \" content-column default\",\n style: {\n padding: \"60px 40px 0px\"\n }\n }, detached && _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n id: \"editor-detached\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n text: \"Custom CSS Editor\"\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"h3\", null, \"Editor Detached\"), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"button\", {\n className: \"btn btn-primary\",\n onClick: () => {\n self.attach();\n }\n }, \"Attach\")), !detached && _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", null, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n text: \"Custom CSS Editor\"\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n className: \"editor-wrapper\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n id: \"bd-customcss-editor\",\n className: \"editor\",\n ref: \"editor\"\n }, self.css)), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n id: \"bd-customcss-attach-controls\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"ul\", {\n className: \"checkbox-group\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(_checkbox__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n id: \"live-update\",\n text: \"Live Update\",\n onChange: this.onChange,\n checked: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-css-0\"]\n })), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n id: \"bd-customcss-detach-controls-button\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"button\", {\n style: {\n borderRadius: \"3px 0 0 3px\",\n borderRight: \"1px solid #3f4146\"\n },\n className: \"btn btn-primary\",\n onClick: () => {\n self.onClick(\"update\");\n }\n }, \"Update\"), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"button\", {\n style: {\n borderRadius: \"0\",\n borderLeft: \"1px solid #2d2d2d\",\n borderRight: \"1px solid #2d2d2d\"\n },\n className: \"btn btn-primary\",\n onClick: () => {\n self.onClick(\"save\");\n }\n }, \"Save\"), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"button\", {\n style: {\n borderRadius: \"0 3px 3px 0\",\n borderLeft: \"1px solid #3f4146\"\n },\n className: \"btn btn-primary\",\n onClick: () => {\n self.onClick(\"detach\");\n }\n }, \"Detach\"), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"span\", {\n style: {\n fontSize: \"10px\",\n marginLeft: \"5px\"\n }\n }, \"Unsaved changes are lost on detach\"), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n className: \"help-text\"\n }, \"Press \", _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"code\", {\n className: \"inline\"\n }, \"ctrl\"), \"+\", _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"span\", {\n className: \"inline\"\n }, \",\"), \" with the editor focused to access the editor's settings.\")))));\n }\n\n onClick(arg) {\n const self = this;\n\n switch (arg) {\n case \"update\":\n self.updateCss();\n break;\n\n case \"save\":\n self.saveCss();\n break;\n\n case \"detach\":\n self.detach();\n break;\n }\n }\n\n onChange(id, checked) {\n switch (id) {\n case \"live-update\":\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-css-0\"] = checked;\n _modules_settingsPanel__WEBPACK_IMPORTED_MODULE_1__[\"default\"].saveSettings();\n break;\n }\n }\n\n updateCss() {\n _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].removeStyle(\"customcss\");\n _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].addStyle(\"customcss\", this.editor.session.getValue());\n }\n\n saveCss() {\n _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setBDData(\"bdcustomcss\", btoa(this.editor.session.getValue()));\n }\n\n detach() {\n const self = this;\n self.setState({\n detached: true\n });\n const droot = self.detachedRoot;\n\n if (!droot) {\n console.log(\"FAILED TO INJECT ROOT: .app\");\n return;\n }\n\n _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reactDom.render(self.detachedEditor, droot);\n }\n\n get detachedRoot() {\n const _root = _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#bd-customcss-detach-container\");\n\n if (!_root) {\n if (!this.injectDetachedRoot()) return null;\n return this.detachedRoot;\n }\n\n return _root;\n }\n\n injectDetachedRoot() {\n const app = _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\".app, .\" + BDModules.get(e => e.app && e.layers)[0].app.split(\" \")[0]);\n if (!app) return false;\n _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].insertAfter(_modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(`<div id=\"bd-customcss-detach-container\">`), app);\n return true;\n }\n\n attach() {\n const self = this;\n self.setState({\n detached: false\n });\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvY3NzRWRpdG9yLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS9jc3NFZGl0b3IuanM/MDYxOCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzZXR0aW5nc0Nvb2tpZSB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IFNldHRpbmdzIGZyb20gXCIuLi9tb2R1bGVzL3NldHRpbmdzUGFuZWxcIjtcbmltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG5pbXBvcnQgRGF0YVN0b3JlIGZyb20gXCIuLi9tb2R1bGVzL2RhdGFTdG9yZVwiO1xuaW1wb3J0IERPTSBmcm9tIFwiLi4vbW9kdWxlcy9kb210b29sc1wiO1xuaW1wb3J0IFNldHRpbmdzVGl0bGUgZnJvbSBcIi4vc2V0dGluZ3NUaXRsZVwiO1xuaW1wb3J0IENoZWNrYm94IGZyb20gXCIuL2NoZWNrYm94XCI7XG5pbXBvcnQgVjJDX0Nzc0VkaXRvckRldGFjaGVkIGZyb20gXCIuL2Nzc0VkaXRvckRldGFjaGVkXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWMkNfQ3NzRWRpdG9yIGV4dGVuZHMgQkRWMi5yZWFjdENvbXBvbmVudCB7XG4gIGNvbnN0cnVjdG9yKHByb3BzKSB7XG4gICAgc3VwZXIocHJvcHMpO1xuICAgIGNvbnN0IHNlbGYgPSB0aGlzO1xuICAgIHNlbGYucHJvcHMubGluZXMgPSAwO1xuICAgIHNlbGYuc2V0SW5pdGlhbFN0YXRlKCk7XG4gICAgc2VsZi5hdHRhY2ggPSBzZWxmLmF0dGFjaC5iaW5k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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/cssEditor.js\n")},"./src/ui/cssEditorDetached.js":/*!*************************************!*\
|
|
!*** ./src/ui/cssEditorDetached.js ***!
|
|
\*************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_CssEditorDetached; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_settingsPanel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/settingsPanel */ \"./src/modules/settingsPanel.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _modules_domtools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modules/domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _checkbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checkbox */ \"./src/ui/checkbox.js\");\n\n\n\n\n\n\nclass V2C_CssEditorDetached extends _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n const self = this;\n self.onClick = self.onClick.bind(self);\n self.updateCss = self.updateCss.bind(self);\n self.saveCss = self.saveCss.bind(self);\n self.onChange = self.onChange.bind(self);\n }\n\n componentDidMount() {\n _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].addClass(_modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#app-mount\"), \"bd-detached-editor\");\n _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].editorDetached = true; // this.updateLineCount();\n\n this.editor = ace.edit(\"bd-customcss-editor-detached\");\n this.editor.setTheme(\"ace/theme/monokai\");\n this.editor.session.setMode(\"ace/mode/css\");\n this.editor.setShowPrintMargin(false);\n this.editor.setFontSize(14);\n this.editor.on(\"change\", () => {\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-css-0\"]) return;\n this.saveCss();\n this.updateCss();\n });\n }\n\n componentWillUnmount() {\n _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].removeClass(_modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#app-mount\"), \"bd-detached-editor\");\n _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].editorDetached = false;\n this.editor.destroy();\n }\n\n updateLineCount() {\n const lineCount = this.refs.editor.value.split(\"\\n\").length;\n if (lineCount == this.props.lines) return;\n this.refs.lines.textContent = Array.from(new Array(lineCount), (_, i) => i + 1).join(\".\\n\") + \".\";\n this.props.lines = lineCount;\n }\n\n get options() {\n return {\n lineNumbers: true,\n mode: \"css\",\n indentUnit: 4,\n theme: \"material\",\n scrollbarStyle: \"simple\"\n };\n }\n\n get css() {\n const _ccss = _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getBDData(\"bdcustomcss\");\n\n let ccss = \"\";\n\n if (_ccss && _ccss !== \"\") {\n ccss = atob(_ccss);\n }\n\n return ccss;\n }\n\n get root() {\n const _root = _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#bd-customcss-detach-container\");\n\n if (!_root) {\n if (!this.injectRoot()) return null;\n return this.detachedRoot;\n }\n\n return _root;\n }\n\n injectRoot() {\n const app = _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\".app, .\" + BDModules.get(e => e.app && e.layers)[0].app.split(\" \")[0]);\n if (!app) return false;\n _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].insertAfter(_modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(`<div id=\"bd-customcss-detach-container\">`), app);\n return true;\n }\n\n render() {\n const self = this;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n className: \"bd-detached-css-editor\",\n id: \"bd-customcss-detach-editor\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n id: \"bd-customcss-innerpane\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n className: \"editor-wrapper\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n id: \"bd-customcss-editor-detached\",\n className: \"editor\",\n ref: \"editor\"\n }, self.css)), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n id: \"bd-customcss-attach-controls\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"ul\", {\n className: \"checkbox-group\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(_checkbox__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n id: \"live-update\",\n text: \"Live Update\",\n onChange: self.onChange,\n checked: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-css-0\"]\n })), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"div\", {\n id: \"bd-customcss-detach-controls-button\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"button\", {\n style: {\n borderRadius: \"3px 0 0 3px\",\n borderRight: \"1px solid #3f4146\"\n },\n className: \"btn btn-primary\",\n onClick: () => {\n self.onClick(\"update\");\n }\n }, \"Update\"), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"button\", {\n style: {\n borderRadius: \"0\",\n borderLeft: \"1px solid #2d2d2d\",\n borderRight: \"1px solid #2d2d2d\"\n },\n className: \"btn btn-primary\",\n onClick: () => {\n self.onClick(\"save\");\n }\n }, \"Save\"), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"button\", {\n style: {\n borderRadius: \"0 3px 3px 0\",\n borderLeft: \"1px solid #3f4146\"\n },\n className: \"btn btn-primary\",\n onClick: () => {\n self.onClick(\"attach\");\n }\n }, \"Attach\"), _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].react.createElement(\"span\", {\n style: {\n fontSize: \"10px\",\n marginLeft: \"5px\"\n }\n }, \"Unsaved changes are lost on attach\")))));\n }\n\n onChange(id, checked) {\n switch (id) {\n case \"live-update\":\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-css-0\"] = checked;\n _modules_settingsPanel__WEBPACK_IMPORTED_MODULE_1__[\"default\"].saveSettings();\n break;\n }\n }\n\n onClick(id) {\n const self = this;\n\n switch (id) {\n case \"attach\":\n if (_modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#editor-detached\")) self.props.attach();\n _modules_v2__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reactDom.unmountComponentAtNode(self.root);\n self.root.remove();\n break;\n\n case \"update\":\n self.updateCss();\n break;\n\n case \"save\":\n self.saveCss();\n break;\n }\n }\n\n updateCss() {\n _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].removeStyle(\"customcss\");\n _modules_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].addStyle(\"customcss\", this.editor.session.getValue());\n }\n\n saveCss() {\n _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setBDData(\"bdcustomcss\", btoa(this.editor.session.getValue()));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvY3NzRWRpdG9yRGV0YWNoZWQuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL3VpL2Nzc0VkaXRvckRldGFjaGVkLmpzPzBkMDIiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc2V0dGluZ3NDb29raWUgfSBmcm9tIFwiLi4vMGdsb2JhbHNcIjtcbmltcG9ydCBTZXR0aW5ncyBmcm9tIFwiLi4vbW9kdWxlcy9zZXR0aW5nc1BhbmVsXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuaW1wb3J0IERhdGFTdG9yZSBmcm9tIFwiLi4vbW9kdWxlcy9kYXRhU3RvcmVcIjtcbmltcG9ydCBET00gZnJvbSBcIi4uL21vZHVsZXMvZG9tdG9vbHNcIjtcbmltcG9ydCBDaGVja2JveCBmcm9tIFwiLi9jaGVja2JveFwiO1xuZXhwb3J0IGRlZmF1b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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/cssEditorDetached.js\n")},"./src/ui/errorBoundary.js":/*!*********************************!*\
|
|
!*** ./src/ui/errorBoundary.js ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return BDErrorBoundary; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass BDErrorBoundary extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false\n };\n }\n\n componentDidCatch() {\n this.setState({\n hasError: true\n });\n }\n\n render() {\n if (this.state.hasError) return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"react-error\"\n }, \"Component Error\");\n return this.props.children;\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJ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ons/delete.jsx":/*!*********************************!*\
|
|
!*** ./src/ui/icons/delete.jsx ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Delete; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass Delete extends React.Component {\n render() {\n const size = this.props.size || \"24px\";\n return React.createElement(\"svg\", {\n className: this.props.className || \"\",\n fill: \"#FFFFFF\",\n viewBox: \"0 0 24 24\",\n style: {\n width: size,\n height: size\n },\n onClick: this.props.onClick\n }, React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0V0z\"\n }), React.createElement(\"path\", {\n d: \"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z\"\n }), React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvaWNvbnMvZGVsZXRlLmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvaWNvbnMvZGVsZXRlLmpzeD8yYWE5Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi8uLi9tb2R1bGVzL3YyXCI7XG5jb25zdCBSZWFjdCA9IEJEVjIuUmVhY3Q7XG5leHBvcn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ICB9XG5cbn0iXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/icons/delete.jsx\n")},"./src/ui/icons/downarrow.jsx":/*!************************************!*\
|
|
!*** ./src/ui/icons/downarrow.jsx ***!
|
|
\************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return DownArrow; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass DownArrow extends React.Component {\n render() {\n const size = this.props.size || \"16px\";\n return React.createElement(\"svg\", {\n className: this.props.className || \"\",\n fill: \"#FFFFFF\",\n viewBox: \"0 0 24 24\",\n style: {\n width: size,\n height: size\n }\n }, React.createElement(\"path\", {\n d: \"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvaWNvbnMvZG93bmFycm93LmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2Nv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O0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/icons/downarrow.jsx\n")},"./src/ui/icons/edit.jsx":/*!*******************************!*\
|
|
!*** ./src/ui/icons/edit.jsx ***!
|
|
\*******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Edit; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass Edit extends React.Component {\n render() {\n const size = this.props.size || \"24px\";\n return React.createElement(\"svg\", {\n className: this.props.className || \"\",\n viewBox: \"0 0 24 24\",\n fill: \"#FFFFFF\",\n style: {\n width: size,\n height: size\n },\n onClick: this.props.onClick\n }, React.createElement(\"path\", {\n d: \"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\"\n }), React.createElement(\"path\", {\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvaWNvbnMvZWRpdC5qc3guanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL3VpL2ljb25zL2VkaXQuanN4PzNiNDciXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEJEVjIgZnJvbSBcIi4uLy4uL21vZHVsZXMvdjJcIjtcbmNvbnN0IFJlYWN0ID0gQkRWMi5SZWFjdDtcbmV4cG9ydCBkZWZhd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0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/icons/edit.jsx\n")},"./src/ui/icons/history.jsx":/*!**********************************!*\
|
|
!*** ./src/ui/icons/history.jsx ***!
|
|
\**********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return History; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n{\n /* <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"white\" width=\"18px\" height=\"18px\">\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\r\n <path d=\"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z\"/>\r\n </svg> */\n}\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass History extends React.Component {\n render() {\n const size = this.props.size || \"18px\";\n return React.createElement(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"#FFFFFF\",\n className: this.props.className || \"\",\n style: {\n width: size,\n height: size\n },\n onClick: this.props.onClick\n }, React.createElement(\"path\", {\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n }), React.createElement(\"path\", {\n d: \"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/icons/history.jsx\n")},"./src/ui/icons/search.jsx":/*!*********************************!*\
|
|
!*** ./src/ui/icons/search.jsx ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Search; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass Search extends React.Component {\n render() {\n const size = this.props.size || \"16px\";\n return React.createElement(\"svg\", {\n className: this.props.className || \"\",\n fill: \"#FFFFFF\",\n viewBox: \"0 0 24 24\",\n style: {\n width: size,\n height: size\n }\n }, React.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0V0z\"\n }), React.createElement(\"path\", {\n d: \"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvaWNvbnMvc2VhcmNoLmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvaWNvbnMvc2VhcmNoLmpzeD9jM2E5Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9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ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/icons/search.jsx\n")},"./src/ui/presenceSettings.jsx":/*!*************************************!*\
|
|
!*** ./src/ui/presenceSettings.jsx ***!
|
|
\*************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_PresenceSettings; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _settingsTitle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./settingsTitle */ \"./src/ui/settingsTitle.js\");\n/* harmony import */ var _settingsGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settingsGroup */ \"./src/ui/settingsGroup.js\");\n/* harmony import */ var _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_CustomRichPresence__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modules/CustomRichPresence */ \"./src/modules/CustomRichPresence.js\");\n/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./select */ \"./src/ui/select.jsx\");\n/* harmony import */ var _timestampRender__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./timestampRender */ \"./src/ui/timestampRender.js\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_8__);\n\n\n\n\n\n\n\n\n\n/**\r\n * @type {typeof import(\"react\")}\r\n */\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].React;\nclass V2C_PresenceSettings extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n data: _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getSettingGroup(\"rpc\") || _0globals__WEBPACK_IMPORTED_MODULE_4__[\"defaultRPC\"],\n assets: []\n };\n this.preview = null;\n this.isfetching = false;\n\n if (this.state.data.application_id) {\n this.fetchAssets();\n }\n }\n /**\r\n * \r\n * @param {InputText} setting \r\n */\n\n\n onChange(setting, value) {\n let defaultSetting = RPCProps.find(e => e.id === setting.props.id);\n this.setState({\n data: Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_4__[\"settingsRPC\"], this.state.data, {\n [defaultSetting.id]: !!value ? value : null\n }),\n assets: this.state.assets\n });\n\n if (setting.props.id === \"application_id\") {\n this.fetchAssets();\n }\n\n _modules_dataStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].setSettingGroup(\"rpc\", _0globals__WEBPACK_IMPORTED_MODULE_4__[\"settingsRPC\"]);\n this.preview.forceUpdate();\n _modules_CustomRichPresence__WEBPACK_IMPORTED_MODULE_5__[\"default\"].set(_0globals__WEBPACK_IMPORTED_MODULE_4__[\"settingsRPC\"]);\n }\n\n fetchAssets() {\n if (this.isfetching === true) {\n let app = this.state.data.application_id;\n setTimeout(() => {\n if (this.state.data.application_id !== app) {\n return;\n }\n\n this.fetchAssets();\n }, 5000);\n }\n\n if (!this.state.data.application_id) {\n this.setState({\n data: this.state.data,\n assets: []\n });\n return;\n }\n\n this.isfetching = true;\n _modules_CustomRichPresence__WEBPACK_IMPORTED_MODULE_5__[\"default\"].fetchAssets(this.state.data.application_id).then(assets => {\n this.isfetching = false;\n this.setState({\n data: this.state.data,\n assets: Object.keys(assets).map(k => {\n let asset = assets[k];\n return {\n id: asset.id,\n name: asset.name,\n type: asset.type\n };\n })\n });\n this.forceUpdate();\n }).catch(() => {\n this.isfetching = false;\n this.setState({\n data: this.state.data,\n assets: []\n });\n this.forceUpdate();\n });\n }\n\n updatePreview(data) {\n this.setState({\n data\n });\n }\n\n render() {\n let contentModule = BDModules.get(e => e.contentColumn)[0];\n return React.createElement(\"div\", {\n className: contentModule.contentColumn + \" \" + contentModule.contentColumnDefault + \" content-column default\",\n style: {\n padding: \"60px 40px 0px\"\n }\n }, React.createElement(_settingsGroup__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n title: \"RichPresence Settings\",\n settings: this.props.settings,\n onChange: this.props.onChange\n }), React.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n text: \"RichPresence\"\n }), React.createElement(\"div\", null, RPCProps.map(e => {\n if (e.type === \"text\") {\n return React.createElement(InputText, {\n setting: e,\n manager: this,\n id: e.id\n });\n } else if (e.type === \"number\") {\n let array = [React.createElement(InputNumber, {\n setting: e,\n manager: this,\n id: e.id\n })];\n /*\r\n if(e.id === \"timestamps.start\"){\r\n array.unshift(<DiscordButton title=\"Copy Current Timestamp\" onClick={() => {\r\n DiscordNative.clipboard.copy(Date.now()+\"\")\r\n }} />)\r\n }*/\n\n return array;\n } else if (e.type === \"choice\") {\n if ([\"assets.small\", \"assets.large\"].includes(e.id)) {\n return React.createElement(InputChoice, {\n setting: e,\n manager: this,\n id: e.id,\n choices: [{\n value: \"none\",\n label: \"No assets\"\n }].concat(this.state.assets.map(e => {\n return {\n value: \"asset-\" + e.id,\n label: e.name\n };\n }))\n });\n } else {\n return \"Unknown choice.\";\n }\n }\n })), React.createElement(\"div\", null, React.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n text: \"Preview\"\n }), React.createElement(RpcPreview, {\n settings: this\n })), React.createElement(\"div\", {\n className: BDModules.get(e => e.marginBottom20)[0].marginBottom20\n }), React.createElement(\"button\", {\n style: {\n opacity: 0.01\n },\n onClick: window.ohgodohfuck\n }, \"Oh god Oh fuck\"), React.createElement(\"button\", {\n style: {\n opacity: 0.01\n },\n onclick: () => {\n electron__WEBPACK_IMPORTED_MODULE_8__[\"remote\"].shell.openExternal(\"https://www.youtube.com/watch?v=LkYa7rps_g4\", {\n activate: false\n });\n }\n }, \"See ? I pulled a litle sneaky on ya\"));\n }\n\n}\nconst RPCProps = [{\n title: \"Application ID\",\n id: \"application_id\",\n type: \"number\"\n}, {\n title: \"Name\",\n id: \"name\",\n type: \"text\"\n}, {\n title: \"Details\",\n id: \"details\",\n type: \"text\"\n}, {\n title: \"State\",\n id: \"state\",\n type: \"text\"\n}, {\n title: \"Timestamp Start\",\n id: \"timestamps.start\",\n type: \"number\"\n}, {\n title: \"LargeAsset\",\n id: \"assets.large\",\n type: \"choice\"\n}, {\n title: \"SmallAsset\",\n id: \"assets.small\",\n type: \"choice\"\n}];\n\nclass InputText extends React.Component {\n render() {\n let setting = this.props.setting;\n let rowModule = BDModules.get(e => e.removeKeybind)[0];\n let marginModule = BDModules.get(e => e.marginBottom20)[0];\n let marginModule2 = BDModules.get(e => e.defaultMarginh5)[0];\n let colorModule = BDModules.get(e => e.colorStandard)[0];\n let sizeModule = BDModules.get(e => e.size32)[0];\n let flexModule = BDModules.get(e => e._horizontal)[0];\n let inputModule = BDModules.get(e => e.inputMini)[0];\n let sizeModule2 = BDModules.get(e => e.size16 && e.size20)[0];\n return React.createElement(\"div\", {\n className: rowModule.row + \" \" + marginModule.marginBottom20\n }, React.createElement(\"div\", {\n className: `${rowModule.item} ${flexModule.flexChild}`\n }, React.createElement(\"h5\", {\n className: colorModule.colorStandard + \" \" + sizeModule.size14 + \" \" + marginModule2.h5 + \" \" + marginModule2.defaultMarginh5\n }, setting.title), React.createElement(\"div\", {\n className: inputModule.inputWrapper\n }, React.createElement(\"input\", {\n class: `${inputModule.inputDefault} ${sizeModule2.size16}`,\n name: \"state\",\n type: \"text\",\n placeholder: \"\",\n maxlength: \"999\",\n value: this.props.manager.state.data[setting.id],\n onChange: ev => {\n this.props.manager.onChange(this, ev.target.value);\n }\n }))), React.createElement(\"div\", {\n class: `${BDModules.get(e => e.divider && Object.keys(e).length === 1)[0].divider} ${BDModules.get(e => e.dividerDefault)[0].dividerDefault}`\n }));\n }\n\n}\n\nclass InputNumber extends React.Component {\n render() {\n let setting = this.props.setting;\n let rowModule = BDModules.get(e => e.removeKeybind)[0];\n let marginModule = BDModules.get(e => e.marginBottom20)[0];\n let marginModule2 = BDModules.get(e => e.defaultMarginh5)[0];\n let colorModule = BDModules.get(e => e.colorStandard)[0];\n let sizeModule = BDModules.get(e => e.size32)[0];\n let flexModule = BDModules.get(e => e._horizontal)[0];\n let inputModule = BDModules.get(e => e.inputMini)[0];\n let sizeModule2 = BDModules.get(e => e.size16 && e.size20)[0];\n let euhModule1 = BDModules.get(e => e.colorTransparent)[0];\n return React.createElement(\"div\", {\n className: rowModule.row + \" \" + marginModule.marginBottom20\n }, React.createElement(\"div\", {\n className: `${rowModule.item} ${flexModule.flexChild}`\n }, React.createElement(\"h5\", {\n className: colorModule.colorStandard + \" \" + sizeModule.size14 + \" \" + marginModule2.h5 + \" \" + marginModule2.defaultMarginh5\n }, setting.title), React.createElement(\"div\", {\n className: inputModule.inputWrapper\n }, React.createElement(\"input\", {\n class: `${inputModule.inputDefault} ${sizeModule2.size16}`,\n name: \"state\",\n type: \"text\",\n placeholder: \"\",\n maxlength: \"999\",\n value: this.props.manager.state.data[setting.id],\n onChange: ev => {\n let newValue = ev.target.value.replace(/[^\\d]+/g, \"\");\n\n if (newValue !== ev.target.value) {\n ev.target.value = newValue;\n }\n\n this.props.manager.onChange(this, newValue);\n }\n })), setting.id === \"timestamps.start\" ? React.createElement(\"div\", {\n className: BDModules.get(e => e.buttonWrapper)[0].buttonWrapper\n }, React.createElement(\"button\", {\n type: \"button\",\n class: `${flexModule.flexChild} ${euhModule1.button} ${euhModule1.lookFilled} ${euhModule1.colorBrand} ${euhModule1.sizeSmall} ${euhModule1.grow}`,\n style: {\n flex: \"0 1 auto\"\n },\n onClick: () => {\n DiscordNative.clipboard.copy(Date.now() + \"\");\n }\n }, React.createElement(\"div\", {\n class: euhModule1.contents\n }, \"Copy current timestamp\"))) : null), React.createElement(\"div\", {\n class: `${BDModules.get(e => e.divider && Object.keys(e).length === 1)[0].divider} ${BDModules.get(e => e.dividerDefault)[0].dividerDefault}`\n }));\n }\n\n}\n\nclass InputChoice extends React.Component {\n onChange(data) {\n this.props.manager.onChange(this, data.value === \"none\" ? null : data.value.replace(\"asset-\", \"\"));\n }\n\n render() {\n let setting = this.props.setting;\n let rowModule = BDModules.get(e => e.removeKeybind)[0];\n let marginModule = BDModules.get(e => e.marginBottom20)[0];\n let marginModule2 = BDModules.get(e => e.defaultMarginh5)[0];\n let colorModule = BDModules.get(e => e.colorStandard)[0];\n let sizeModule = BDModules.get(e => e.size32)[0];\n let flexModule = BDModules.get(e => e._horizontal)[0];\n let options = this.props.choices;\n return React.createElement(\"div\", {\n className: rowModule.row + \" \" + marginModule.marginBottom20\n }, React.createElement(\"div\", {\n className: `${rowModule.item} ${flexModule.flexChild}`\n }, React.createElement(\"h5\", {\n className: colorModule.colorStandard + \" \" + sizeModule.size14 + \" \" + marginModule2.h5 + \" \" + marginModule2.defaultMarginh5\n }, setting.title), React.createElement(_select__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n value: \"asset-\" + this.props.manager.state.data[setting.id] || false,\n onChange: this.onChange.bind(this),\n options: options\n })), React.createElement(\"div\", {\n class: `${BDModules.get(e => e.divider && Object.keys(e).length === 1)[0].divider} ${BDModules.get(e => e.dividerDefault)[0].dividerDefault}`\n }));\n }\n\n}\n\nclass DiscordButton extends React.Component {\n render() {\n let setting = this.props.setting;\n let rowModule = BDModules.get(e => e.removeKeybind)[0];\n let marginModule = BDModules.get(e => e.marginBottom20)[0];\n let marginModule2 = BDModules.get(e => e.defaultMarginh5)[0];\n let colorModule = BDModules.get(e => e.colorStandard)[0];\n let sizeModule = BDModules.get(e => e.size32)[0];\n let flexModule = BDModules.get(e => e._horizontal)[0];\n let euhModule1 = BDModules.get(e => e.colorTransparent)[0];\n let options = this.props.choices;\n return React.createElement(\"div\", {\n className: rowModule.row + \" \" + marginModule.marginBottom20\n }, React.createElement(\"div\", {\n className: `${rowModule.item} ${flexModule.flexChild}`\n }, React.createElement(\"div\", {\n className: BDModules.get(e => e.buttonWrapper)[0].buttonWrapper\n }, React.createElement(\"button\", {\n type: \"button\",\n class: `${flexModule.flexChild} ${euhModule1.button} ${euhModule1.lookFilled} ${euhModule1.colorBrand} ${euhModule1.sizeSmall} ${euhModule1.grow}`,\n style: {\n flex: \"0 1 auto\"\n },\n onClick: this.onClick\n }, React.createElement(\"div\", {\n class: euhModule1.contents\n }, this.props.title)))));\n }\n\n}\n\nclass RpcPreview extends React.Component {\n constructor(props = {}) {\n super(props);\n this.state = {\n active: \"profile\"\n };\n this.tabs = [];\n this.props.settings.preview = this;\n }\n\n changeTab(tab) {\n let ancientTab = this.state.active;\n if (ancientTab === tab.props.id) return;\n this.tabs.forEach(e => {\n e.setActive(false);\n });\n tab.setActive(true);\n this.setState({\n active: tab.props.id\n });\n }\n\n render() {\n let preview = new this.preview({\n preview: this\n });\n preview.setState(this.state.rpc);\n return React.createElement(\"div\", {\n className: \"lc-tabWrapper\"\n }, React.createElement(\"div\", {\n className: \"lc-tabnav\",\n style: {\n flex: \"0 1 auto\"\n }\n }, React.createElement(Tab, {\n preview: this,\n title: \"Full Profile\",\n id: \"profile\"\n }), React.createElement(Tab, {\n preview: this,\n title: \"User Popout\",\n id: \"popout\"\n })), preview.render());\n }\n\n isActive(tab) {\n return this.state.active === tab;\n }\n\n get preview() {\n if (this.state.active === \"profile\") return Profile;\n return Popout;\n }\n\n}\n\nclass Tab extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n active: props.preview.isActive(props.id)\n };\n props.preview.tabs.push(this);\n }\n\n setActive(isActive) {\n this.setState({\n active: !!isActive\n });\n }\n\n render() {\n let className = `lc-navItem`;\n\n if (this.state.active) {\n className += ` lc-navItemActive`;\n } else {\n className += ` lc-navItemInactive`;\n }\n\n return React.createElement(\"div\", {\n className: className,\n onClick: () => {\n this.props.preview.changeTab(this);\n }\n }, this.props.title);\n }\n\n}\n\nclass Popout extends React.Component {\n render() {\n let user = BDModules.get(e => e.default && e.default.getCurrentUser)[0].default.getCurrentUser();\n let avatarURL = user.getAvatarURL(user.avatar.startsWith(\"a_\") ? \"gif\" : \"png\");\n let [rootModule1, flexModule1, stylingModule1, nameTagModule1, activityModule1, textModule1, sizeModule1, scrollerModule1, noteModule1, protipModule1, colorModule1, Messages, avatarModule1] = [BDModules.get(e => e.userPopout)[0], BDModules.get(e => e._horizontal)[0], BDModules.get(e => e.vertical && e.alignStretch && !e.streamerModeEnabledBtn)[0], BDModules.get(e => e.bot)[0], BDModules.get(e => e.activityUserPopout)[0], BDModules.get(e => e.muted && e.wrapper && e.base)[0], BDModules.get(e => e.size32)[0], BDModules.get(e => e.themeGhostHairlineChannels)[0], BDModules.get(e => e.note && Object.keys(e).length === 1)[0], BDModules.get(e => e.pro && e.inline)[0], BDModules.get(e => e.colorStandard)[0], BDModules.get(e => e.default && e.default.Messages)[0].default.Messages, BDModules.get(e => e.pointerEvents)[0]];\n let data = Object.assign({}, _0globals__WEBPACK_IMPORTED_MODULE_4__[\"defaultRPC\"], this.props.preview.props.settings.state.data);\n timestampClass = timestampClass || activityModule1.timestamp;\n return React.createElement(\"div\", {\n className: \"lc-userPopout\"\n }, React.createElement(\"div\", {\n class: rootModule1.userPopout,\n role: \"dialog\",\n tabindex: \"-1\"\n }, React.createElement(\"div\", {\n class: rootModule1.headerPlaying\n }, React.createElement(\"div\", {\n class: `${flexModule1.flex} ${stylingModule1.vertical} ${stylingModule1.justifyCenter} ${stylingModule1.alignCenter} ${stylingModule1.noWrap} ${rootModule1.headerTop}`,\n style: {\n flex: \"1 1 auto\"\n }\n }, React.createElement(\"div\", {\n class: rootModule1.avatarWrapperNormal,\n role: \"button\",\n tabindex: \"0\"\n }, React.createElement(\"div\", {\n class: avatarModule1,\n role: \"img\",\n style: {\n width: \"80px\",\n height: \"80px\"\n }\n }, React.createElement(\"svg\", {\n width: \"92\",\n height: \"80\",\n viewBox: \"0 0 92 80\",\n class: `${avatarModule1.mask} ${avatarModule1.svg}`\n }, React.createElement(\"foreignObject\", {\n x: \"0\",\n y: \"0\",\n width: \"80\",\n height: \"80\",\n mask: \"url(#svg-mask-avatar-status-round-80)\"\n }, React.createElement(\"img\", {\n src: avatarURL,\n alt: \" \",\n class: avatarModule1.avatar\n })), React.createElement(Status, null))), React.createElement(\"svg\", {\n width: \"80\",\n height: \"80\",\n class: rootModule1.avatarHint,\n viewBox: \"0 0 80 80\"\n }, React.createElement(\"foreignObject\", {\n x: \"0\",\n y: \"0\",\n width: \"80\",\n height: \"80\",\n mask: \"url(#svg-mask-avatar-status-round-80)\"\n }, React.createElement(\"div\", {\n class: rootModule1.avatarHintInner\n }, Messages.VIEW_PROFILE)))), React.createElement(\"div\", {\n class: rootModule1.headerText\n }, React.createElement(\"div\", {\n class: `${flexModule1.flex} ${stylingModule1.horizontal} ${stylingModule1.justifyStart} ${stylingModule1.alignCenter} ${stylingModule1.noWrap}`,\n style: {\n flex: \"1 1 auto\"\n }\n }, React.createElement(\"div\", {\n class: `${rootModule1.headerTagNoNickname} ${nameTagModule1.nameTag}`\n }, React.createElement(\"span\", {\n class: `${nameTagModule1.username} ${rootModule1.headerTagUsernameNoNickname}`\n }, user.username), React.createElement(\"span\", null, \"#\", user.discriminator))))), React.createElement(\"div\", {\n class: `${activityModule1.activityUserPopout} ${rootModule1.activity}`\n }, React.createElement(\"h3\", {\n class: `${activityModule1.headerTextNormal} ${textModule1.base} ${sizeModule1.size12}`\n }, Messages.USER_ACTIVITY_HEADER_PLAYING), React.createElement(\"div\", {\n class: activityModule1.bodyNormal\n }, (() => {\n if (!data[\"assets.large\"]) return null;\n let images = [];\n\n if (data[\"assets.large\"]) {\n images.push(React.createElement(\"img\", {\n alt: \"\",\n src: `https://cdn.discordapp.com/app-assets/${data.application_id}/${data[\"assets.large\"]}.png`,\n class: `${activityModule1.assetsLargeImageUserPopout} ${data[\"assets.small\"] ? activityModule1.assetsLargeMaskUserPopout : \"\"}`\n }));\n }\n\n if (data[\"assets.small\"]) {\n images.push(React.createElement(\"img\", {\n alt: \"\",\n src: `https://cdn.discordapp.com/app-assets/${data.application_id}/${data[\"assets.small\"]}.png`,\n class: activityModule1.assetsSmallImageUserPopout\n }));\n }\n\n return React.createElement(\"div\", {\n class: activityModule1.assets\n }, images);\n })(), React.createElement(\"div\", {\n class: activityModule1.contentImagesUserPopout,\n style: {\n flex: \"1 1 auto\"\n }\n }, (() => {\n if (!data.name) return null;\n return React.createElement(\"h3\", {\n class: `${activityModule1.nameNormal} ${textModule1.base} ${sizeModule1.size14}`,\n title: data.name\n }, React.createElement(\"span\", {\n class: activityModule1.activityName\n }, data.name));\n })(), (() => {\n if (!data.details) return null;\n return React.createElement(\"div\", {\n title: data.title,\n class: activityModule1.details\n }, data.details);\n })(), (() => {\n if (!data.state) return null;\n return React.createElement(\"div\", {\n class: activityModule1.state\n }, React.createElement(\"span\", {\n title: data.state\n }, data.state));\n })(), (() => {\n if (!data[\"timestamps.start\"]) return null;\n let timeComponent = Object(_timestampRender__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(Timestamp, Messages);\n return React.createElement(\"div\", {\n class: activityModule1.timestamp\n }, React.createElement(timeComponent, {\n timestamps: {\n end: null,\n start: data[\"timestamps.start\"]\n }\n }));\n })())))), React.createElement(\"div\", {\n class: `${scrollerModule1.scrollerWrap} ${rootModule1.body} ${scrollerModule1.scrollerThemed} ${scrollerModule1.themeGhostHairline} ${scrollerModule1.scrollerFade}`\n }, React.createElement(\"div\", {\n class: `${scrollerModule1.scroller} ${rootModule1.bodyInner}`\n }, React.createElement(\"div\", {\n class: rootModule1.bodyTitle\n }, Messages.NOTE), React.createElement(\"div\", {\n class: `${noteModule1.note} ${rootModule1.note}`\n }, React.createElement(\"textarea\", {\n placeholder: Messages.NOTE_PLACEHOLDER,\n maxlength: \"256\",\n autocorrect: \"off\",\n class: BDModules.get(e => e.scrollbarGhostHairline)[0].scrollbarGhostHairline,\n style: {\n height: \"36px\"\n },\n disabled: true\n })))), React.createElement(\"div\", {\n class: rootModule1.footer\n }, React.createElement(\"div\", {\n class: `${rootModule1.protip} ${protipModule1.inline}`\n }, React.createElement(\"h3\", {\n class: `${protipModule1.pro} ${textModule1.base} ${sizeModule1.size12}`,\n style: {\n color: \"rgb(67, 181, 129)\"\n }\n }, Messages.PINNED_MESSAGES_PRO_TIP), React.createElement(\"div\", {\n class: `${colorModule1.colorStandard} ${sizeModule1.size14} ${protipModule1.tip}`\n }, Messages.CONTEXT_MENU_HINT)))));\n }\n\n}\n\nclass Status extends React.Component {\n render() {\n let status = BDModules.get(e => e.default && e.default.getPresence)[0].default.getPresence().status;\n if (status === \"invisible\") status = \"offline\";\n let className = BDModules.get(e => e.pointerEvents)[0].pointerEvents;\n return React.createElement(\"rect\", {\n width: \"16\",\n height: \"16\",\n x: \"60\",\n y: \"60\",\n fill: \"#ffffff\",\n mask: `url(#svg-mask-status-${status})`,\n className: className\n });\n }\n\n}\n\nlet timestampClass = \"\";\n\nclass Profile extends React.Component {\n render() {\n let user = BDModules.get(e => e.default && e.default.getCurrentUser)[0].default.getCurrentUser();\n let avatarURL = user.getAvatarURL(user.avatar.startsWith(\"a_\") ? \"gif\" : \"png\");\n let [flexModule1, stylingModule1, rootModule1, avatarModule1, nameTagModule1, activityModule1, textModule1, sizeModule1, scrollerModule1, noteModule1, Messages] = [BDModules.get(e => e.flex && e._horizontal)[0], BDModules.get(e => e.vertical && e.alignStretch && !e.streamerModeEnabledBtn)[0], BDModules.get(e => e.topSectionStreaming)[0], BDModules.get(e => e.pointerEvents)[0], BDModules.get(e => e.bot)[0], BDModules.get(e => e.activityProfile)[0], BDModules.get(e => e.muted && e.wrapper && e.base)[0], BDModules.get(e => e.size32)[0], BDModules.get(e => e.scrollerFade)[0], BDModules.get(e => e.note && Object.keys(e).length === 1)[0], BDModules.get(e => e.default && e.default.Messages)[0].default.Messages];\n let data = Object.assign({}, _0globals__WEBPACK_IMPORTED_MODULE_4__[\"defaultRPC\"], this.props.preview.props.settings.state.data);\n timestampClass = timestampClass || activityModule1.timestamp;\n return [React.createElement(\"div\", {\n className: \"lc-tab\"\n }, React.createElement(\"div\", {\n class: `${flexModule1.flex} ${stylingModule1.vertical} ${stylingModule1.justifyStart} ${stylingModule1.alignStretch} ${stylingModule1.noWrap} ${rootModule1.root}`,\n style: {\n flex: \"1 1 auto\"\n }\n }, React.createElement(\"div\", {\n class: rootModule1.topSectionPlaying\n }, React.createElement(\"header\", {\n class: rootModule1.header\n }, React.createElement(\"div\", {\n class: `${rootModule1.avatar} ${avatarModule1.wrapper}`,\n role: \"img\",\n style: {\n width: \"80px\",\n height: \"80px\"\n }\n }, React.createElement(\"svg\", {\n width: \"92\",\n height: \"80\",\n viewBox: \"0 0 92 80\",\n class: `${avatarModule1.mask} ${avatarModule1.svg}`\n }, React.createElement(\"foreignObject\", {\n x: \"0\",\n y: \"0\",\n width: \"80\",\n height: \"80\",\n mask: \"url(#svg-mask-avatar-status-round-80)\"\n }, React.createElement(\"img\", {\n src: avatarURL,\n alt: \" \",\n class: avatarModule1.avatar\n })), React.createElement(Status, null))), React.createElement(\"div\", {\n class: `${rootModule1.headerInfo}`\n }, React.createElement(\"div\", {\n class: `${rootModule1.nameTag} ${nameTagModule1.nameTag}`\n }, React.createElement(\"span\", {\n class: `${rootModule1.username} ${rootModule1.username}`\n }, user.username), React.createElement(\"span\", {\n class: rootModule1.discriminator\n }, \"#\", user.discriminator)), React.createElement(\"div\", {\n class: `${flexModule1.flex} ${flexModule1.horizontal} ${stylingModule1.justifyStart} ${stylingModule1.alignStretch} ${stylingModule1.noWrap} ${rootModule1.profileBadges}`,\n style: {\n flex: \"1 1 auto\"\n }\n }, React.createElement(Badges, null)))), React.createElement(\"div\", {\n class: rootModule1.headerFill\n }, React.createElement(\"div\", {\n class: `${activityModule1.activityProfile} ${rootModule1.activity}`\n }, React.createElement(\"h3\", {\n class: `${activityModule1.headerTextNormal} ${textModule1.base} ${sizeModule1.size12}`\n }, Messages.USER_ACTIVITY_HEADER_PLAYING), React.createElement(\"div\", {\n class: activityModule1.bodyNormal\n }, (() => {\n if (!data[\"assets.large\"]) return null;\n let images = [];\n\n if (data[\"assets.large\"]) {\n images.push(React.createElement(\"img\", {\n alt: \"\",\n src: `https://cdn.discordapp.com/app-assets/${data.application_id}/${data[\"assets.large\"]}.png`,\n class: `${activityModule1.assetsLargeImageProfile} ${data[\"assets.small\"] ? activityModule1.assetsLargeMaskProfile : \"\"}`\n }));\n }\n\n if (data[\"assets.small\"]) {\n images.push(React.createElement(\"img\", {\n alt: \"\",\n src: `https://cdn.discordapp.com/app-assets/${data.application_id}/${data[\"assets.small\"]}.png`,\n class: activityModule1.assetsSmallImageProfile\n }));\n }\n\n return React.createElement(\"div\", {\n class: activityModule1.assets\n }, images);\n })(), React.createElement(\"div\", {\n class: activityModule1.contentImagesProfile,\n style: {\n flex: \"1 1 auto\"\n }\n }, (() => {\n if (!data.name) return null;\n return React.createElement(\"h3\", {\n class: `${activityModule1.nameNormal} ${textModule1.base} ${sizeModule1.size14}`,\n title: data.name\n }, React.createElement(\"span\", {\n class: activityModule1.activityName\n }, data.name));\n })(), (() => {\n if (!data.details) return null;\n return React.createElement(\"div\", {\n title: data.title,\n class: activityModule1.details\n }, data.details);\n })(), (() => {\n if (!data.state) return null;\n return React.createElement(\"div\", {\n class: activityModule1.state\n }, React.createElement(\"span\", {\n title: data.state\n }, data.state));\n })(), (() => {\n if (!data[\"timestamps.start\"]) return null;\n let timeComponent = Object(_timestampRender__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(Timestamp, Messages);\n return React.createElement(\"div\", {\n class: activityModule1.timestamp\n }, React.createElement(timeComponent, {\n timestamps: {\n end: null,\n start: data[\"timestamps.start\"]\n }\n }));\n })()))))), React.createElement(\"div\", {\n class: rootModule1.body\n }, React.createElement(\"div\", {\n class: `${scrollerModule1.scrollerWrap} ${scrollerModule1.scrollerFade}`\n }, React.createElement(\"div\", {\n class: scrollerModule1.scroller\n }, React.createElement(\"div\", {\n class: rootModule1.userInfoSection\n }, React.createElement(\"div\", {\n class: rootModule1.userInfoSectionHeader\n }, Messages.NOTE), React.createElement(\"div\", {\n class: `${rootModule1.note} ${noteModule1.note}`\n }, React.createElement(\"textarea\", {\n placeholder: Messages.NOTE_PLACEHOLDER,\n maxlength: \"256\",\n autocorrect: \"off\",\n class: BDModules.get(e => e.scrollbarGhostHairline)[0].scrollbarGhostHairline,\n style: {\n height: \"40px\"\n },\n disabled: true\n }))), React.createElement(ConnectedAccounts, null)))))), React.createElement(\"div\", {\n class: \"lc- \"\n })];\n }\n\n}\n\nclass ConnectedAccounts extends React.Component {\n render() {\n let accounts = [];\n let rootModule1 = BDModules.get(e => e.topSectionStreaming)[0];\n let AccountModule1 = BDModules.get(e => e.default && e.default.getAccounts)[0].default;\n let accs = AccountModule1.getAccounts().filter(e => e.visibility === 1);\n\n for (let acc of accs) {\n accounts.push(React.createElement(ConnectedAccount, {\n acc: acc\n }));\n }\n\n if (accounts.length > 0) {\n return React.createElement(\"div\", {\n class: rootModule1.userInfoSection\n }, React.createElement(\"div\", {\n class: rootModule1.connectedAccounts\n }, accounts));\n }\n\n return null;\n }\n\n}\n\nclass ConnectedAccount extends React.Component {\n render() {\n let [flexModule1, stylingModule1, rootModule1, flowerModule1, anchorModule1, SocialConstants] = [BDModules.get(e => e.flex && e._horizontal)[0], BDModules.get(e => e.vertical && e.alignStretch && !e.streamerModeEnabledBtn)[0], BDModules.get(e => e.topSectionStreaming)[0], BDModules.get(e => e.flowerStarContainer)[0], BDModules.get(e => e.anchor)[0], BDModules.get(e => e.default && e.default.get && e.default.map)[0].default];\n let acc = this.props.acc;\n let constantsSocial = SocialConstants.get(acc.type);\n return React.createElement(\"div\", {\n class: `${flexModule1.flex} ${flexModule1.horizontal} ${stylingModule1.justifyStart} ${stylingModule1.alignCenter} ${stylingModule1.noWrap} ${rootModule1.connectedAccount}`,\n style: {\n flex: \"0 1 auto\"\n }\n }, React.createElement(\"img\", {\n alt: `Logo ${constantsSocial.name}`,\n class: rootModule1.connectedAccountIcon,\n src: constantsSocial.icon.color || constantsSocial.icon.white || constantsSocial.icon.grey\n }), React.createElement(\"div\", {\n class: rootModule1.connectedAccountNameInner\n }, React.createElement(\"div\", {\n class: rootModule1.connectedAccountName\n }, acc.name), acc.verified ? React.createElement(\"span\", null, React.createElement(\"div\", {\n class: `${flowerModule1.flowerStarContainer} ${rootModule1.connectedAccountVerifiedIcon}`,\n style: {\n width: \"16px\",\n height: \"16px\"\n }\n }, React.createElement(\"svg\", {\n class: flowerModule1.flowerStar,\n width: \"16\",\n height: \"16\",\n viewBox: \"0 0 16 15.2\"\n }, React.createElement(\"path\", {\n fill: \"#4f545c\",\n \"fill-rule\": \"evenodd\",\n d: \"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z\"\n })), React.createElement(\"div\", {\n class: flowerModule1.childContainer\n }, React.createElement(\"svg\", {\n width: \"16\",\n height: \"16\",\n viewBox: \"0 0 16 15.2\"\n }, React.createElement(\"path\", {\n d: \"M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z\",\n fill: \"#ffffff\"\n }))))) : null), React.createElement(\"a\", {\n class: `${anchorModule1.anchor} ${anchorModule1.anchorUnderlineOnHover}`,\n rel: \"noreferrer noopener\",\n target: \"_blank\",\n role: \"button\",\n tabindex: \"0\"\n }, React.createElement(\"svg\", {\n class: rootModule1.connectedAccountOpenIcon,\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\"\n }, React.createElement(\"path\", {\n fill: \"currentColor\",\n d: \"M10 5V3H5.375C4.06519 3 3 4.06519 3 5.375V18.625C3 19.936 4.06519 21 5.375 21H18.625C19.936 21 21 19.936 21 18.625V14H19V19H5V5H10Z\"\n }), React.createElement(\"path\", {\n fill: \"currentColor\",\n d: \"M21 2.99902H14V4.99902H17.586L9.29297 13.292L10.707 14.706L19 6.41302V9.99902H21V2.99902Z\"\n }))));\n }\n\n}\n\nclass Badges extends React.Component {\n render() {\n let user = BDModules.get(e => e.default && e.default.getCurrentUser)[0].default.getCurrentUser();\n let rootModule = BDModules.get(e => e.topSectionStreaming)[0];\n let UserFlags = BDModules.get(e => e.UserFlags)[0].UserFlags;\n let badges = [];\n let serialized = [];\n\n for (let flagName in UserFlags) {\n if (user.hasFlag(UserFlags[flagName])) serialized.push(flagName);\n }\n\n for (let flagName of serialized) {\n let searchable = `profileBadge${flagName.toLowerCase().replace(/_/g, \" \").split(\" \").map(e => e[0].toUpperCase() + e.slice(1)).join(\"\")}`;\n searchable = searchable.replace(\"HypesquadOnline\", \"HypeSquadOnline\");\n if (!rootModule[searchable]) continue;\n badges.push(React.createElement(Badge, {\n name: searchable\n }));\n }\n\n if (user.hasPremiumSubscription) {\n badges.push(React.createElement(Badge, {\n name: \"profileBadgePremium\"\n }));\n }\n\n return badges;\n }\n\n}\n\nclass Badge extends React.Component {\n render() {\n let rootModule1 = BDModules.get(e => e.topSectionStreaming)[0];\n return React.createElement(\"div\", {\n class: rootModule1.profileBadgeWrapper\n }, React.createElement(\"div\", null, React.createElement(\"div\", {\n class: \"\",\n role: \"button\",\n tabindex: \"0\"\n }, React.createElement(\"div\", {\n class: `${rootModule1.profileBadge} ${rootModule1[this.props.name]}`\n }))));\n }\n\n}\n\nclass Timestamp extends React.Component {\n render() {\n return React.createElement(\"div\", {\n className: timestampClass\n }, this.props.message);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvcHJlc2VuY2VTZXR0aW5ncy5qc3guanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL3VpL3ByZXNlbmNlU2V0dGluZ3MuanN4P2NlZWYiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEJEVjIgZnJvbSBcIi4uL21vZHVsZXMvdjJcIjtcbmltcG9ydCBWMkNfU2V0dGluZ3NUaXRsZSBmcm9tIFwiLi9zZXR0aW5nc1RpdGxlXCI7XG5pbXBvcnQgVjJDX1NldHRpbmdzR3JvdXAgZnJvbSBcIi4vc2V0dGluZ3NHcm91cFwiO1xuaW1wb3J0IGRhdGFTdG9yZSBmcm9tIFwiLi4vbW9kdWxlcy9kYXRhU3RvcmVcIjtcbmltcG9ydCB7IGRlZmF1bHRSUEMsIHNldHRpbmdzUlBDIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQ3VzdG9tUmljaFByZXNlbmNlIGZyb20gXCIuLi9tb2R1bGVzL0N1c3RvbVJpY2hQcmVzZW5jZVwiO1xuaW1wb3J0IFNlbGVjdCBmcm9tIFwiLi9zZWxlY3RcIjtcbmltcG9ydCB0aW1lc3RhbXBSZW5kZXIgZnJvbSBcIi4vdGltZXN0YW1wUmVuZGVyXCI7XG5pbXBvcnQgeyByZW1vdGUgfSBmcm9tIFwiZWxlY3Ryb25cIjtcbi8qKl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hdGUubm93KCkrXCJcIilcclxuICAgICAgICB9fSAvPilcclxuICAgICAgICB9Ki9cblxuICAgICAgICByZXR1cm4gYXJyYXk7XG4gICAgICB9IGVsc2UgaWYgKGUudHlwZSA9PT0gXCJjaG9pY2VcIikge1xuICAgICAgICBpZiAoW1wiYXNzZXRzLnNtYWxsXCIsIFwiYXNzZXRzLmxhcmdlXCJdLmluY2x1ZGVzKGUuaWQpKSB7XG4gICAgICAgICAgcmV0dXJuIFJlYWN0LmNyZWF0ZUVsZW1lbnQoSW5wdXRDaG9pY2UsIHtcbiAgICAgICAgICAgIHNldHRpbmc6IGUsXG4gICAgICAgICAgICBtYW5hZ2VyOiB0aGlzLFxuICAgICAgICAgICAgaWQ6IGUuaWQsXG4gICAgICAgICAgICBjaG9pY2VzOiBbe1xuICAgICAgICAgICAgICB2YWx1ZTogXCJub25lXCIsXG4gICAgICAgICAgICAgIGxhYmVsOiBcIk5vIGFzc2V0c1wiXG4gICAgICAgICAgICB9XS5jb25jYXQodGhpcy5zdGF0ZS5hc3NldHMubWFwKGUgPT4ge1xuICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHZhbHVlOiBcImFzc2V0LVwiICsgZS5pZCxcbiAgICAgICAgICAgICAgICBsYWJlbDogZS5uYW1lXG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9KSlcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXR1cm4gXCJVbmtub3duIGNob2ljZS5cIjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pKSwgUmVhY3QuY3JlYXRlRWxlbWVudChcImRpdlwiLCBudWxsLCBSZWFjdC5jcmVhdGVFbGVtZW50KFYyQ19TZXR0aW5nc1RpdGxlLCB7XG4gICAgICB0ZXh0OiBcIlByZXZpZXdcIlxuICAgIH0pLCBSZWFjdC5jcmVhdGVFbGVtZW50KFJwY1ByZXZpZXcsIHtcbiAgICAgIHNldHRpbmdzO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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/presenceSettings.jsx\n")},"./src/ui/publicservers/layer.js":/*!***************************************!*\
|
|
!*** ./src/ui/publicservers/layer.js ***!
|
|
\***************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_Layer; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_domtools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../modules/domtools */ \"./src/modules/domtools.js\");\n\n\nclass V2C_Layer extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.keyupListener = this.keyupListener.bind(this);\n }\n\n keyupListener(e) {\n if (e.which === 27) {\n _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactDom.unmountComponentAtNode(this.refs.root.parentNode);\n }\n }\n\n componentDidMount() {\n window.addEventListener(\"keyup\", this.keyupListener);\n const thisNode = _modules_domtools__WEBPACK_IMPORTED_MODULE_1__[\"default\"].query(`#${this.props.id}`);\n _modules_domtools__WEBPACK_IMPORTED_MODULE_1__[\"default\"].animate({\n duration: 200,\n update: function (progress) {\n thisNode.style.transform = `scale(${1.1 - 0.1 * progress}) translateZ(0px)`;\n thisNode.style.opacity = progress;\n\n if (progress == 1) {\n setImmediate(() => {\n thisNode.style.transform = \"\";\n thisNode.style.opacity = \"\";\n });\n }\n }\n });\n }\n\n componentWillUnmount() {\n window.removeEventListener(\"keyup\", this.keyupListener);\n const thisNode = _modules_domtools__WEBPACK_IMPORTED_MODULE_1__[\"default\"].query(`#${this.props.id}`);\n _modules_domtools__WEBPACK_IMPORTED_MODULE_1__[\"default\"].animate({\n duration: 200,\n update: function (progress) {\n thisNode.style.transform = `scale(${1.1 - 0.1 * (1 - progress)}) translateZ(0px)`;\n thisNode.style.opacity = 1 - progress;\n\n if (progress == 1) {\n setImmediate(() => {\n thisNode.remove();\n });\n }\n }\n });\n const layer = _modules_domtools__WEBPACK_IMPORTED_MODULE_1__[\"default\"].query(\".publicServersOpen\");\n layer.classList.remove(\"publicServersOpen\");\n _modules_domtools__WEBPACK_IMPORTED_MODULE_1__[\"default\"].animate({\n duration: 200,\n update: function (progress) {\n layer.style.transform = `scale(${0.07 * progress + 0.93}) translateZ(0px)`;\n layer.style.opacity = progress;\n\n if (progress == 1) {\n setImmediate(() => {\n layer.style.transform = \"\";\n layer.style.opacity = \"\";\n });\n }\n }\n });\n }\n\n componentWillMount() {\n const layer = _modules_domtools__WEBPACK_IMPORTED_MODULE_1__[\"default\"].query(\"[class*=\\\"layer-\\\"]\");\n layer.classList.add(\"publicServersOpen\");\n _modules_domtools__WEBPACK_IMPORTED_MODULE_1__[\"default\"].animate({\n duration: 200,\n update: function (progress) {\n layer.style.transform = `scale(${0.07 * (1 - progress) + 0.93}) translateZ(0px)`;\n layer.style.opacity = 1 - progress;\n }\n });\n }\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"layer bd-layer \" + BDModules.get(e => e.layer && e.animating)[0].layer,\n id: this.props.id,\n ref: \"root\",\n style: {\n opacity: 0,\n transform: \"scale(1.1) translateZ(0px)\"\n }\n }, this.props.children);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvcHVibGljc2VydmVycy9sYXllci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvcHVibGljc2VydmVycy9sYXllci5qcz9lNDFk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\
|
|
!*** ./src/ui/publicservers/publicServers.js ***!
|
|
\***********************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_PublicServers; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tools */ \"./src/ui/tools.js\");\n/* harmony import */ var _settingsTitle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../settingsTitle */ \"./src/ui/settingsTitle.js\");\n/* harmony import */ var _tabBarSeparator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../tabBarSeparator */ \"./src/ui/tabBarSeparator.js\");\n/* harmony import */ var _tabBarHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../tabBarHeader */ \"./src/ui/tabBarHeader.js\");\n/* harmony import */ var _tabBarItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tabBarItem */ \"./src/ui/tabBarItem.js\");\n/* harmony import */ var _serverCard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./serverCard */ \"./src/ui/publicservers/serverCard.js\");\n/* harmony import */ var _sidebarView__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sidebarView */ \"./src/ui/publicservers/sidebarView.js\");\n\n\n\n\n\n\n\n\nclass V2C_PublicServers extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.setInitialState();\n this.close = this.close.bind(this);\n this.changeCategory = this.changeCategory.bind(this);\n this.search = this.search.bind(this);\n this.searchKeyDown = this.searchKeyDown.bind(this);\n this.checkConnection = this.checkConnection.bind(this);\n this.join = this.join.bind(this);\n this.connect = this.connect.bind(this);\n this.GuildStore = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].WebpackModules.findByUniqueProperties([\"getGuilds\"]);\n this.AvatarDefaults = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].WebpackModules.findByUniqueProperties([\"getUserAvatarURL\", \"DEFAULT_AVATARS\"]);\n this.InviteActions = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].WebpackModules.findByUniqueProperties([\"acceptInvite\"]);\n this.SortedGuildStore = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].WebpackModules.findByUniqueProperties([\"getSortedGuilds\"]);\n }\n\n componentDidMount() {\n this.checkConnection();\n }\n\n setInitialState() {\n this.state = {\n selectedCategory: -1,\n title: \"Loading...\",\n loading: true,\n servers: [],\n next: null,\n connection: {\n state: 0,\n user: null\n }\n };\n }\n\n close() {\n _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactDom.unmountComponentAtNode(document.getElementById(this.props.rootId));\n }\n\n search(query, clear) {\n const self = this;\n fetch(`${self.endPoint}${query}${query ? \"&schema=new\" : \"?schema=new\"}`, {\n method: \"get\"\n }).then(async res => {\n if (res.status !== 200) throw await res.text();\n let data = await res.json();\n let servers = data.results.reduce((arr, server) => {\n server.joined = false;\n arr.push(server); // arr.push(<ServerCard server={server} join={self.join}/>);\n\n return arr;\n }, []);\n\n if (!clear) {\n servers = self.state.servers.concat(servers);\n } else {//servers.unshift(self.bdServer);\n }\n\n let end = data.size + data.from;\n data.next = `?from=${end}`;\n if (self.state.term) data.next += `&term=${self.state.term}`;\n if (self.state.selectedCategory) data.next += `&category=${self.categoryButtons[self.state.selectedCategory]}`;\n\n if (end >= data.total) {\n end = data.total;\n data.next = null;\n }\n\n let title = `Showing 1-${end} of ${data.total} results in ${self.categoryButtons[self.state.selectedCategory]}`;\n if (self.state.term) title += ` for ${self.state.term}`;\n self.setState({\n loading: false,\n title: title,\n servers: servers,\n next: data.next\n });\n\n if (clear) {\n //console.log(self);\n self.refs.sbv.refs.contentScroller.scrollTop = 0;\n }\n }).catch(err => {\n console.error(err);\n return self.setState({\n loading: false,\n title: \"Failed to load servers. Check console for details\"\n });\n });\n }\n\n async join(serverCard) {\n if (serverCard.props.pinned) return this.InviteActions.acceptInvite(serverCard.props.invite_code);\n await fetch(`${this.joinEndPoint}/${serverCard.props.server.identifier}`, {\n method: \"GET\",\n credentials: \"include\",\n mode: \"cors\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n serverCard.setState({\n joined: true\n });\n }\n\n connect() {\n const self = this;\n const options = self.windowOptions;\n options.x = Math.round(window.screenX + window.innerWidth / 2 - options.width / 2);\n options.y = Math.round(window.screenY + window.innerHeight / 2 - options.height / 2);\n self.joinWindow = new (window.require(\"electron\").remote.BrowserWindow)(options);\n const url = \"https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=https://auth.discordservers.com/info\";\n self.joinWindow.webContents.on(\"did-navigate\", (event, url) => {\n if (url != \"https://auth.discordservers.com/info\") return;\n self.joinWindow.close();\n self.checkConnection();\n });\n self.joinWindow.loadURL(url);\n }\n\n get windowOptions() {\n return {\n width: 500,\n height: 550,\n backgroundColor: \"#282b30\",\n show: true,\n resizable: false,\n maximizable: false,\n minimizable: false,\n alwaysOnTop: true,\n frame: false,\n center: false,\n webPreferences: {\n nodeIntegration: false\n }\n };\n }\n\n get bdServer() {\n const server = {\n name: \"BetterDiscord\",\n online: \"7500+\",\n members: \"20000+\",\n categories: [\"community\", \"programming\", \"support\"],\n description: \"Official BetterDiscord server for support etc\",\n identifier: \"86004744966914048\",\n iconUrl: \"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp\",\n nativejoin: true,\n invite_code: \"0Tmfo5ZbORCRqbAd\",\n pinned: true\n };\n const server2 = {\n name: \"Lightcord\",\n online: \"30+\",\n members: \"50+\",\n categories: [\"community\", \"programming\", \"support\"],\n description: \"Official Lightcord server for support etc\",\n identifier: \"86004744966914048\",\n iconUrl: \"https://cdn.discordapp.com/icons/705908350218666117/05a5652f7d1d0ae328ca7d6e2354a82a.webp\",\n nativejoin: true,\n invite_code: \"7eFff2A\",\n pinned: true\n };\n const guildList = this.SortedGuildStore.getFlattenedGuildIds();\n const defaultList = this.AvatarDefaults.DEFAULT_AVATARS;\n return [_modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_serverCard__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n server: server2,\n pinned: true,\n join: this.join,\n guildList: guildList,\n fallback: defaultList[Math.floor(Math.random() * 5)]\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_serverCard__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n server: server,\n pinned: true,\n join: this.join,\n guildList: guildList,\n fallback: defaultList[Math.floor(Math.random() * 5)]\n })];\n }\n\n get endPoint() {\n return \"https://search.discordservers.com\";\n }\n\n get joinEndPoint() {\n return \"https://j.discordservers.com\";\n }\n\n get connectEndPoint() {\n return \"https://join.discordservers.com/connect\";\n }\n\n async checkConnection() {\n const self = this;\n\n try {\n const response = await fetch(`https://auth.discordservers.com/info`, {\n method: \"GET\",\n credentials: \"include\",\n mode: \"cors\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n const data = await response.json();\n self.setState({\n selectedCategory: 0,\n connection: {\n state: 2,\n user: data\n }\n });\n self.search(\"\", true);\n } catch (error) {\n console.error(error);\n self.setState({\n title: \"Not connected to discordservers.com!\",\n loading: true,\n selectedCategory: -1,\n connection: {\n state: 1,\n user: null\n }\n });\n }\n }\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_sidebarView__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n ref: \"sbv\"\n }, this.component);\n }\n\n get component() {\n return {\n sidebar: {\n component: this.sidebar\n },\n content: {\n component: this.content\n },\n tools: {\n component: _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tools__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n key: \"pt\",\n ref: \"tools\",\n onClick: this.close\n })\n }\n };\n }\n\n get sidebar() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"sidebar\",\n key: \"ps\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-tab-bar SIDE\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-tab-bar-header\",\n style: {\n fontSize: \"16px\"\n }\n }, \"Public Servers\"), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarSeparator__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null), this.searchInput, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarSeparator__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarHeader__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n text: \"Categories\"\n }), this.categoryButtons.map((value, index) => {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarItem__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n id: index,\n onClick: this.changeCategory,\n key: index,\n text: value,\n selected: this.state.selectedCategory === index\n });\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarSeparator__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null), this.footer, this.connection));\n }\n\n get searchInput() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-form-item\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-text-input flex-vertical\",\n style: {\n width: \"172px\",\n marginLeft: \"10px\"\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"input\", {\n ref: \"searchinput\",\n onKeyDown: this.searchKeyDown,\n onChange: () => {},\n type: \"text\",\n className: \"input default\",\n placeholder: \"Search...\",\n maxLength: \"50\"\n })));\n }\n\n searchKeyDown(e) {\n const self = this;\n if (self.state.loading || e.which !== 13) return;\n self.setState({\n loading: true,\n title: \"Loading...\",\n term: e.target.value\n });\n let query = `?term=${e.target.value}`;\n\n if (self.state.selectedCategory !== 0) {\n query += `&category=${self.categoryButtons[self.state.selectedCategory]}`;\n }\n\n self.search(query, true);\n }\n\n get categoryButtons() {\n return [\"All\", \"FPS Games\", \"MMO Games\", \"Strategy Games\", \"MOBA Games\", \"RPG Games\", \"Tabletop Games\", \"Sandbox Games\", \"Simulation Games\", \"Music\", \"Community\", \"Language\", \"Programming\", \"Other\"];\n }\n\n changeCategory(id) {\n const self = this;\n if (self.state.loading) return;\n self.refs.searchinput.value = \"\";\n self.setState({\n loading: true,\n selectedCategory: id,\n title: \"Loading...\",\n term: null\n });\n\n if (id === 0) {\n self.search(\"\", true);\n return;\n }\n\n self.search(`?category=${self.categoryButtons[id]}`, true);\n }\n\n get content() {\n const self = this;\n const guildList = this.SortedGuildStore.getFlattenedGuildIds();\n const defaultList = this.AvatarDefaults.DEFAULT_AVATARS;\n if (self.state.connection.state === 1) return self.notConnected;\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0];\n return [_modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n ref: \"content\",\n key: \"pc\",\n className: columnModule.contentColumn + \" \" + columnModule.contentColumn + \" content-column default\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n text: self.state.title\n }), self.bdServer, self.state.servers.map(server => {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_serverCard__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n key: server.identifier,\n server: server,\n join: self.join,\n guildList: guildList,\n fallback: defaultList[Math.floor(Math.random() * 5)]\n });\n }), self.state.next && _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"button\", {\n type: \"button\",\n onClick: () => {\n if (self.state.loading) return;\n self.setState({\n loading: true\n });\n self.search(self.state.next, false);\n },\n className: \"ui-button filled brand small grow\",\n style: {\n width: \"100%\",\n marginTop: \"10px\",\n marginBottom: \"10px\"\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-button-contents\"\n }, self.state.loading ? \"Loading\" : \"Load More\")), self.state.servers.length > 0 && _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n text: self.state.title\n }))];\n }\n\n get notConnected() {\n const self = this; //return BDV2.react.createElement(SettingsTitle, { text: self.state.title });\n\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0];\n return [_modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n key: \"ncc\",\n ref: \"content\",\n className: columnModule.contentColumn + \" \" + columnModule.contentColumn + \" content-column default\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"h2\", {\n className: \"ui-form-title h2 margin-reset margin-bottom-20\"\n }, \"Not connected to discordservers.com!\", _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"button\", {\n onClick: self.connect,\n type: \"button\",\n className: \"ui-button filled brand small grow\",\n style: {\n display: \"inline-block\",\n minHeight: \"18px\",\n marginLeft: \"10px\",\n lineHeight: \"14px\"\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-button-contents\"\n }, \"Connect\"))), self.bdServer)];\n }\n\n get footer() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-tab-bar-header\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"a\", {\n href: \"https://discordservers.com\",\n target: \"_blank\"\n }, \"Discordservers.com\"));\n }\n\n get connection() {\n const self = this;\n const {\n connection\n } = self.state;\n if (connection.state !== 2) return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"span\", null);\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"span\", null, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarSeparator__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"span\", {\n style: {\n color: \"#b9bbbe\",\n fontSize: \"10px\",\n marginLeft: \"10px\"\n }\n }, \"Connected as: \", `${connection.user.username}#${connection.user.discriminator}`), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n style: {\n padding: \"5px 10px 0 10px\"\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"button\", {\n style: {\n width: \"100%\",\n minHeight: \"20px\"\n },\n type: \"button\",\n className: \"ui-button filled brand small grow\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-button-contents\",\n onClick: self.connect\n }, \"Reconnect\"))));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvcHVibGljc2VydmVycy9wdWJsaWNTZXJ2ZXJzLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS9wdW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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/publicservers/publicServers.js\n")},"./src/ui/publicservers/serverCard.js":/*!********************************************!*\
|
|
!*** ./src/ui/publicservers/serverCard.js ***!
|
|
\********************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_ServerCard; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_ServerCard extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n if (!this.props.server.iconUrl) this.props.server.iconUrl = this.props.fallback;\n this.state = {\n imageError: false,\n joined: this.props.guildList.includes(this.props.server.identifier)\n };\n }\n\n render() {\n const {\n server\n } = this.props;\n let cardModule = BDModules.get(e => e.card && e.cardPrimary)[0];\n let flexModule = BDModules.get(e => e.flexChild && e._horizontalReverse)[0];\n let wrapModule = BDModules.get(e => e.noWrap && !e.streamerModeEnabled)[0];\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", // cardPrimary-1Hv-to\n {\n className: `${cardModule.card} ${cardModule.cardPrimary} ${BDModules.get(e => e.marginBottom8)[0].marginBottom8} bd-server-card${server.pinned ? \" bd-server-card-pinned\" : \"\"}`\n }, // BDV2.react.createElement(\n // \"div\",\n // { className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY flex-1O1GKY directionRow-3v3tfG justifyStart-2yIZo0 alignStretch-1hwxMa noWrap-3jynv6\" },\n _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"img\", {\n ref: \"img\",\n className: \"bd-server-image\",\n src: server.iconUrl,\n onError: this.handleError.bind(this)\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: flexModule.flexChild + \" bd-server-content\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: flexModule.horizontal + \" \" + wrapModule.noWrap + \" bd-server-header\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"h5\", {\n className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-name\"\n }, server.name), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"h5\", {\n className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-member-count\"\n }, server.members, \" Members\")), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: flexModule.horizontal + \" \" + wrapModule.noWrap\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y bd-server-description-container\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"scroller-2FKFPG scroller bd-server-description\"\n }, server.description))), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6 bd-server-footer\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"flexChild-faoVW3 bd-server-tags\",\n style: {\n flex: \"1 1 auto\"\n }\n }, server.categories.join(\", \")), this.state.joined && _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"button\", {\n type: \"button\",\n className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN colorGreen-29iAKY\",\n style: {\n minHeight: \"12px\",\n marginTop: \"4px\",\n backgroundColor: \"#3ac15c\"\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-button-contents\"\n }, \"Joined\")), server.error && _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"button\", {\n type: \"button\",\n className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN disabled-9aF2ug\",\n style: {\n minHeight: \"12px\",\n marginTop: \"4px\",\n backgroundColor: \"#c13a3a\"\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-button-contents\"\n }, \"Error\")), !server.error && !this.state.joined && _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"button\", {\n type: \"button\",\n className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN\",\n style: {\n minHeight: \"12px\",\n marginTop: \"4px\"\n },\n onClick: () => {\n this.join();\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-button-contents\"\n }, \"Join\")))) // )\n );\n }\n\n handleError() {\n this.props.server.iconUrl = this.props.fallback;\n this.setState({\n imageError: true\n });\n }\n\n join() {\n this.props.join(this); //this.setState({joined: true});\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvcHVibGljc2VydmVycy9zZXJ2ZXJDYXJkLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS9wdWJsaWNzZXJ2ZXJzL3NlcnZlckNhcmQuanM/MmE0ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQkRWMiBmcm9tIFwiLi4vLi4vbW9kdWxlcy92MlwiO1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgVjJDX1NlcnZlckNhcmQgZXh0ZW5kcyBCRFYyLnJlYWN0Q29tcG9uZW50IHtcbiAgY29uc3RydWN0b3IocHJvcHMpIHtcbiAgICBzdXBlcihwcm9wcyk7XG4gICAgaWYgKCF0aGlzLnByb3BzLnNlcnZlci5pY29uVXJsKSB0aGlz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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/publicservers/serverCard.js\n")},"./src/ui/publicservers/sidebarView.js":/*!*********************************************!*\
|
|
!*** ./src/ui/publicservers/sidebarView.js ***!
|
|
\*********************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_SidebarView; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _scroller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scroller */ \"./src/ui/scroller.js\");\n\n\nclass V2C_SidebarView extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n const {\n sidebar,\n content,\n tools\n } = this.props.children;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"standardSidebarView-3F1I7i ui-standard-sidebar-view\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"sidebarRegion-VFTUkN sidebar-region\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_scroller__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n key: \"sidebarScroller\",\n ref: \"sidebarScroller\",\n sidebar: true,\n fade: sidebar.fade || true,\n dark: sidebar.dark || true\n }, sidebar.component)), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"contentRegion-3nDuYy content-region\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"contentTransitionWrap-3hqOEW content-transition-wrap\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"scrollerWrap-2lJEkd firefoxFixScrollFlex-cnI2ix contentRegionScrollerWrap-3YZXdm content-region-scroller-wrap scrollerThemed-2oenus themeGhost-28MSn0 scrollerTrack-1ZIpsv\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"scroller-2FKFPG firefoxFixScrollFlex-cnI2ix contentRegionScroller-26nc1e content-region-scroller scroller\",\n ref: \"contentScroller\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default\"\n }, content.component), tools.component)))));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvcHVibGljc2VydmVycy9zaWRlYmFyVmlldy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvcHVibGljc2VydmVycy9zaWRlYmFyVmlldy5qcz85OTE1Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi8uLi9tb2R1bGVzL3YyXCI7XG5pbXBvcnQgU2Nyb2xsZXIgZnJvbSBcIi4uL3Njcm9sbGVyXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWMkNfU2lkZWJhclZpZXcgZXh0ZW5kcyBCRFYyLnJlYWN0Q29tcG9uZW50IHtcbiAgY29uc3RydWN0b3IocHJvcHMpIHtcbiAgICBzdXBlcihwcm9wcyk7XG4gIH1cblxuICByZW5kZXIoKSB7XG4gICAgY29uc3Qge1xuICAgICAgc2lkZWJhcixcbiAgICAgIGNvbnRlbnQsXG4gICAgICB0b29sc1xuICAgIH0gPSB0aGlzLnByb3BzLmNoaWxkcmVuO1xuICAgIHJldHVybiBCRFYyLnJlYWN0LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIiwge1xuICAgICAgY2xhc3NOYW1lOiBcInN0YW5kYXJkU2lkZWJhclZpZXctM0YxSTdpIHVpLXN0YW5kYXJkLXNpZGViYXItdmlld1wiXG4gICAgfSwgQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwiZGl2XCIsIHtcbiAgICAgIGNsYXNzTmFtZTogXCJzaWRlYmFyUmVnaW9uLVZGVFVrTiBzaWRlYmFyLXJlZ2lvblwiXG4gICAgfSwgQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFNjcm9sbGVyLCB7XG4gICAgICBrZXk6IFwic2lkZWJhclNjcm9sbGVyXCIsXG4gICAgICByZWY6IFwic2lk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ImRpdlwiLCB7XG4gICAgICBjbGFzc05hbWU6IFwiY29udGVudENvbHVtbi0yaHJJWUggY29udGVudENvbHVtbkRlZmF1bHQtMVZRa0dNIGNvbnRlbnQtY29sdW1uIGRlZmF1bHRcIlxuICAgIH0sIGNvbnRlbnQuY29tcG9uZW50KSwgdG9vbHMuY29tcG9uZW50KSkpKSk7XG4gIH1cblxufSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/publicservers/sidebarView.js\n")},"./src/ui/reloadIcon.js":/*!******************************!*\
|
|
!*** ./src/ui/reloadIcon.js ***!
|
|
\******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_ReloadIcon; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_ReloadIcon extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"#dcddde\",\n className: \"bd-reload \" + this.props.className,\n onClick: this.props.onClick,\n style: {\n width: this.props.size || \"24px\",\n height: this.props.size || \"24px\"\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"path\", {\n d: \"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\"\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"path\", {\n fill: \"none\",\n d: \"M0 0h24v24H0z\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvcmVsb2FkSWNvbi5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvcmVsb2FkSWNvbi5qcz9iZTcwIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWMkNfUmVsb2FkSWNvbiBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgfVxuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwic3ZnXCIsIHtcbiAgICAgIHhtbG5zOiBcImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnXCIsXG4gICAgICB2aWV3Qm94OiBcIjAgMCAyNCAyNFwiLFxuICAgICAgZmlsbDogXCIjZGNkZGRlXCIsXG4gICAgICBjbGFzc05hbWU6IFwiYmQtcmVsb2FkIFwiICsgdGhpcy5wcm9wcy5jbGFzc05hbWUsXG4gICAgICBvbkNsaWNrOiB0aGlzLnByb3BzLm9uQ2xpY2ssXG4gICAgICBzdHlsZToge1xuICAgICAgICB3aWR0aDogdGhpcy5wcm9wcy5zaXplIHx8IFwiMjRweFwiLFxuICAgICAgICBoZWlnaHQ6IHRoaXMucHJvcHMuc2l6ZSB8fCBcIjI0cHhcIlxuICAgICAgfVxuICAgIH0sIEJEVjIucmVhY3QuY3JlYXRlRWxlbWVudChcInBhdGhcIiwge1xuICAgICAgZDogXCJNMTcuNjUgNi4zNUMxNi4yIDQuOSAxNC4yMSA0IDEyIDRjLTQuNDIgMC03Ljk5IDMuNTgtNy45OSA4czMuNTcgOCA3Ljk5IDhjMy43MyAwIDYuODQtMi41NSA3LjczLTZoLTIuMDhjLS44MiAyLjMzLTMuMDQgNC01LjY1IDQtMy4zMSAwLTYtMi42OS02LTZzMi42OS02IDYtNmMxLjY2IDAgMy4xNC42OSA0LjIyIDEuNzhMMTMgMTFoN1Y0bC0yLjM1IDIuMzV6XCJcbiAgICB9KSwgQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwicGF0aFwiLCB7XG4gICAgICBmaWxsOiBcIm5vbmVcIixcbiAgICAgIGQ6IFwiTTAgMGgyNHYyNEgwelwiXG4gICAgfSkpO1xuICB9XG5cbn0iXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/reloadIcon.js\n")},"./src/ui/scroller.js":/*!****************************!*\
|
|
!*** ./src/ui/scroller.js ***!
|
|
\****************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_Scroller; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_Scroller extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n //scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y\n let scrollerModule1 = BDModules.get(e => e.scrollerHorizontal)[0];\n let scrollerModule2 = BDModules.get(e => e.sidebarRegionScroller)[0];\n let wrapperClass = `${scrollerModule1.scrollerWrap} ${scrollerModule1.scrollerThemed} ${scrollerModule1.themeGhostHairline}${this.props.fade ? \" \" + scrollerModule1.scrollerFade : \"\"}`;\n let scrollerClass = scrollerModule1.scroller + \" scroller\";\n /* fuck */\n\n if (this.props.sidebar) scrollerClass += ` ${scrollerModule2.sidebarRegionScroller} sidebar-region-scroller`;\n\n if (this.props.contentColumn) {\n scrollerClass += \" \" + scrollerModule2.contentRegionScroller + \" content-region-scroller\";\n /* fuck */\n\n wrapperClass = `${scrollerModule1.scrollerWrap} ${scrollerModule2.contentRegionScrollerWrap} content-region-scroller-wrap ${scrollerModule1.scrollerThemed} ${scrollerModule1.themeGhost} ${scrollerModule1.scrollerTrack}`;\n }\n\n const {\n children\n } = this.props;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n key: \"scrollerwrap\",\n className: wrapperClass\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n key: \"scroller\",\n ref: \"scroller\",\n className: scrollerClass\n }, children));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ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VyQ2xhc3NcbiAgICB9LCBjaGlsZHJlbikpO1xuICB9XG5cbn0iXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/scroller.js\n")},"./src/ui/sectionedSettingsPanel.js":/*!******************************************!*\
|
|
!*** ./src/ui/sectionedSettingsPanel.js ***!
|
|
\******************************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_SectionedSettingsPanel; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _settingsGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./settingsGroup */ \"./src/ui/settingsGroup.js\");\n\n\nclass V2C_SectionedSettingsPanel extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0];\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: columnModule.contentColumn + \" \" + columnModule.contentColumnDefault + \" content-column default\"\n }, this.props.sections.map(section => {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_settingsGroup__WEBPACK_IMPORTED_MODULE_1__[\"default\"], Object.assign({}, section, {\n onChange: this.props.onChange\n }));\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvc2VjdGlvbmVkU2V0dGluZ3NQYW5lbC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvc2VjdGlvbmVkU2V0dGluZ3NQYW5lbC5qcz9hZjUyIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG5pbXBvcnQgU2V0dGluZ3NHcm91cCBmcm9tIFwiLi9zZXR0aW5nc0dyb3VwXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWMkNfU2VjdGlvbmVkU2V0dGluZ3NQYW5lbCBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgfVxuXG4gIHJlbmRlcigpIHtcbiAgICBsZXQgY29sdW1uTW9kdWxlID0gQkRNb2R1bGVzLmdldChlID0+IGUuY29udGVudENvbHVtbkRlZmF1bHQpWzBdO1xuICAgIHJldHVybiBCRFYyLnJlYWN0LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIiwge1xuICAgICAgY2xhc3NOYW1lOiBjb2x1bW5Nb2R1bGUuY29udGVudENvbHVtbiArIFwiIFwiICsgY29sdW1uTW9kdWxlLmNvbnRlbnRDb2x1bW5EZWZhdWx0ICsgXCIgY29udGVudC1jb2x1bW4gZGVmYXVsdFwiXG4gICAgfSwgdGhpcy5wcm9wcy5zZWN0aW9ucy5tYXAoc2VjdGlvbiA9PiB7XG4gICAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFNldHRpbmdzR3JvdXAsIE9iamVjdC5hc3NpZ24oe30sIHNlY3Rpb24sIHtcbiAgICAgICAgb25DaGFuZ2U6IHRoaXMucHJvcHMub25DaGFuZ2VcbiAgICAgIH0pKTtcbiAgICB9KSk7XG4gIH1cblxufSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/sectionedSettingsPanel.js\n")},"./src/ui/select.jsx":/*!***************************!*\
|
|
!*** ./src/ui/select.jsx ***!
|
|
\***************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Select; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\n/**\r\n * @type {typeof import(\"react\")}\r\n */\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react;\nclass Select extends React.Component {\n handleChange(value) {\n this.props.value = value;\n if (typeof this.props.onChange == \"function\") this.props.onChange(value, this);\n this.forceUpdate();\n }\n\n render() {\n let flex = BDModules.get(e => e.default && e.default.Wrap && e.default.Direction && e.default.Child)[0].default;\n let nativeSelect = BDModules.get(e => e.default && e.default.displayName === \"SelectTempWrapper\")[0].default;\n return React.createElement(\"flex\", {\n direction: flex.Direction.HORIZONTAL,\n align: flex.Align.CENTER\n }, React.createElement(nativeSelect, Object.assign({}, this.props, {\n onChange: this.handleChange.bind(this)\n })));\n /*\r\n return BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Flex, {\r\n className: BDFDB.disCN.selectwrapper,\r\n direction: InternalComponents.LibraryComponents.Flex.Direction.HORIZONTAL,\r\n align: InternalComponents.LibraryComponents.Flex.Align.CENTER,\r\n children: BDFDB.ReactUtils.createElement(InternalComponents.NativeSubComponents.Select, Object.assign({}, this.props, {\r\n onChange: this.handleChange.bind(this)\r\n }))\r\n });*/\n }\n\n}\n;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvc2VsZWN0LmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvc2VsZWN0LmpzeD8yNTIzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG4vKipcclxuICogQHR5cGUge3R5cGVvZiBpbXBvcnQoXCJyZWFjdFwiKX1cclxuICovXG5cbmNvbnN0IFJlYWN0ID0gQkRWMi5yZWFjdDtcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFNlbGVjdCBleHRlbmRzIFJlYWN0LkNvbXBvbmVudCB7XG4gIGhhbmRsZUNoYW5nZSh2YWx1ZSkge1xuICAgIHRoaXMucHJvcHMudmFsdWUgPSB2YWx1ZTtcbiAgICBpZiAodHlwZW9mIHRoaXMucHJvcHMub25DaGFuZ2UgPT0gXCJmdW5jdGlvblwiKSB0aGlzLnByb3BzLm9uQ2hhbmdlKHZhbHVlLCB0aGlzKTtcbiAgICB0aGlzLmZvcmNlVXBkYXRlKCk7XG4gIH1cblxuICByZW5kZXIoKSB7XG4gICAgbGV0IGZsZXggPSBCRE1vZHVsZXMuZ2V0KGUgPT4gZS5kZWZhdWx0ICYmIGUuZGVmYXVsdC5XcmFwICYmIGUuZGVmYXVsdC5EaXJlY3Rpb24gJiYgZS5kZWZhdWx0LkNoaWxkKVswXS5kZWZhdWx0O1xuICAgIGxldCBuYXRpdmVTZWxlY3QgPSBCRE1vZH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fSkpXHJcbiAgICB9KTsqL1xuICB9XG5cbn1cbjsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/select.jsx\n")},"./src/ui/settingsGroup.js":/*!*********************************!*\
|
|
!*** ./src/ui/settingsGroup.js ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_SettingsGroup; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _settingsTitle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settingsTitle */ \"./src/ui/settingsTitle.js\");\n/* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./switch */ \"./src/ui/switch.js\");\n\n\n\n\nclass V2C_SettingsGroup extends _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n const {\n title,\n settings,\n button\n } = this.props;\n const buttonComponent = button ? _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"button\", {\n key: \"title-button\",\n className: \"bd-pfbtn\",\n onClick: button.onClick\n }, button.title) : null;\n return [_modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n text: title\n }), buttonComponent, settings.map(setting => {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_switch__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n id: setting.id,\n key: setting.id,\n data: setting,\n checked: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][setting.id],\n onChange: (id, checked) => {\n this.props.onChange(id, checked);\n }\n });\n })];\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvc2V0dGluZ3NHcm91cC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvc2V0dGluZ3NHcm91cC5qcz8zYzIzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNldHRpbmdzQ29va2llIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuaW1wb3J0IFNldHRpbmdzVGl0bGUgZnJvbSBcIi4vc2V0dGluZ3NUaXRsZVwiO1xuaW1wb3J0IFN3aXRjaCBmcm9tIFwiLi9zd2l0Y2hcIjtcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFYyQ19TZXR0aW5nc0dyb3VwIGV4dGVuZHMgQkRWMi5yZWFjdENvbXBvbmVudCB7XG4gIGNvbnN0cnVjdG9yKHByb3BzKSB7XG4gICAgc3VwZXIocHJvcHMpO1xuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHtcbiAgICAgIHRpdGxlLFxuICAgICAgc2V0dGluZ3MsXG4gICAgICBidXR0b25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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/settingsGroup.js\n")},"./src/ui/settingsPanel.js":/*!*********************************!*\
|
|
!*** ./src/ui/settingsPanel.js ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_SettingsPanel; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _settingsTitle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settingsTitle */ \"./src/ui/settingsTitle.js\");\n/* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./switch */ \"./src/ui/switch.js\");\n\n\n\n\nclass V2C_SettingsPanel extends _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n const {\n settings\n } = this.props;\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0];\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: columnModule.contentColumn + \" \" + columnModule.contentColumnDefault + \" content-column default\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_settingsTitle__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n text: this.props.title\n }), this.props.button && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"button\", {\n key: \"title-button\",\n className: \"bd-pfbtn\",\n onClick: this.props.button.onClick\n }, this.props.button.title), settings.map(setting => {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_switch__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n id: setting.id,\n key: setting.id,\n data: setting,\n checked: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][setting.id],\n onChange: (id, checked) => {\n this.props.onChange(id, checked);\n }\n });\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvc2V0dGluZ3NQYW5lbC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvc2V0dGluZ3NQYW5lbC5qcz81NzYwIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNldHRpbmdzQ29va2llIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuaW1wb3J0IFNldHRpbmdzVGl0bGUgZnJvbSBcIi4vc2V0dGluZ3NUaXRsZVwiO1xuaW1wb3J0IFN3aXRjaCBmcm9tIFwiLi9zd2l0Y2hcIjtcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFYyQ19TZXR0aW5nc1BhbmVsIGV4dGVuZHMgQkRWMi5yZWFjdENvbXBvbmVudCB7XG4gIGNvbnN0cnVjdG9yKHByb3BzKSB7XG4gICAgc3VwZXIocHJvcHMpO1xuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHtcbiAgICAgIHNldHRpbmdzXG4gICAgfSA9IHRoaXMucHJvcHM7XG4gICAgbGV0IGNvbHVtbk1vZHVsZSA9IEJETW9kdWxlcy5nZXQoZSA9PiBlLmNvbnRlbnRDb2x1bW5EZWZhdWx0KVswXTtcbiAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwi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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/settingsPanel.js\n")},"./src/ui/settingsTitle.js":/*!*********************************!*\
|
|
!*** ./src/ui/settingsTitle.js ***!
|
|
\*********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_SettingsTitle; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_SettingsTitle extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n } //h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi da-h2 da-title da-size16 da-height20 da-weightSemiBold defaultColor-1_ajX0 da-defaultColor marginTop60-3PGbtK da-marginTop60 marginBottom20-32qID7 da-marginBottom20\n\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"h2\", {\n className: \"ui-form-title h2 margin-reset margin-bottom-20 \" + BDModules.get(e => e.marginTop60)[0].marginTop60\n }, this.props.text);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvc2V0dGluZ3NUaXRsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdW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/settingsTitle.js\n")},"./src/ui/sidebar.js":/*!***************************!*\
|
|
!*** ./src/ui/sidebar.js ***!
|
|
\***************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_SideBar; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _tabBarSeparator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tabBarSeparator */ \"./src/ui/tabBarSeparator.js\");\n/* harmony import */ var _tabBarHeader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tabBarHeader */ \"./src/ui/tabBarHeader.js\");\n/* harmony import */ var _tabBarItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tabBarItem */ \"./src/ui/tabBarItem.js\");\n\n\n\n\nclass V2C_SideBar extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n const si = document.querySelector(\"[class*=side-] > [class*=selected]\");\n if (si) this.scn = si.className;\n const ns = document.querySelector(\"[class*=side-] > [class*='item-']:not([class*=selected])\");\n if (ns) this.nscn = ns.className;\n const tabs = document.querySelectorAll(\"[class*='side-'] > [class*='item-']\");\n\n for (const element of tabs) {\n element.addEventListener(\"click\", () => {\n this.setState({\n selected: null\n });\n });\n }\n\n this.setInitialState();\n this.onClick = this.onClick.bind(this);\n this.setSelected = this.setSelected.bind(this);\n }\n\n setInitialState() {\n const self = this;\n self.state = {\n selected: null,\n items: self.props.items\n };\n const initialSelection = self.props.items.find(item => {\n return item.selected;\n });\n\n if (initialSelection) {\n self.state.selected = initialSelection.id;\n }\n }\n\n render() {\n const self = this;\n const {\n headerText\n } = self.props;\n const {\n items,\n selected\n } = self.state;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", null, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarSeparator__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarHeader__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n text: headerText,\n button: this.props.headerButton\n }), items.map(item => {\n const {\n id,\n text\n } = item;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_tabBarItem__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n key: id,\n selected: selected === id,\n text: text,\n id: id,\n onClick: self.onClick\n });\n }));\n }\n\n setSelected(e) {\n e.target.className = this.scn;\n }\n\n onClick(id) {\n const si = document.querySelector(\"[class*=side] > [class*=selected]\");\n\n if (si) {\n si.removeEventListener(\"click\", this.setSelected);\n si.addEventListener(\"click\", this.setSelected);\n si.className = this.nscn;\n }\n\n this.setState({\n selected: null\n });\n this.setState({\n selected: id\n });\n if (this.props.onClick) this.props.onClick(id);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvc2lkZWJhci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvc2lkZWJhci5qcz9lYjY1Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG5pbXBvcnQgVGFiQmFyU2VwYXJhdG9yIGZyb20gXCIuL3RhYkJhclNlcGFyYXRvclwiO1xuaW1wb3J0IFRhYkJhckhlYWRlciBmcm9tIFwiLi90YWJCYXJIZWFkZXJcIjtcbmltcG9ydCBUYWJCYXJJdGVtIGZyb20gXCIuL3RhYkJhckl0ZW1cIjtcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFYyQ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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/sidebar.js\n")},"./src/ui/switch.js":/*!**************************!*\
|
|
!*** ./src/ui/switch.js ***!
|
|
\**************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return SwitchItem; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _components_switch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/switch */ \"./src/ui/components/switch.jsx\");\n\n\nclass SwitchItem extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n }\n\n onChange() {\n this.props.checked = !this.props.checked;\n this.props.onChange(this.props.id, this.props.checked);\n }\n\n render() {\n const {\n text,\n info\n } = this.props.data;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"h3\", {\n className: \"ui-form-title h3 margin-reset margin-reset ui-flex-child\"\n }, text), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_components_switch__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n onChange: this.onChange,\n checked: this.props.checked\n })), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-form-text style-description margin-top-4\",\n style: {\n flex: \"1 1 auto\"\n }\n }, info));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvc3dpdGNoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS9zd2l0Y2guanM/YjA2YSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuaW1wb3J0IFN3aXRjaCBmcm9tIFwiLi9jb21wb25lbnRzL3N3aXRjaFwiO1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgU3dpdGNoSXRlbSBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgICB0aGlzLm9uQ2hhbmdlID0gdGhpcy5vbkNoYW5nZS5iaW5kKHRoaXMpO1xuICB9XG5cbiAgb25DaGFuZ2UoKSB7XG4gICAgdGhpcy5wcm9wcy5jaGVja2VkID0gIXRoaXMucHJvcHMuY2hlY2tlZDtcbiAgICB0aGlzLnByb3BzLm9uQ2hhbmdlK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9cIlxuICAgICAgfVxuICAgIH0sIGluZm8pKTtcbiAgfVxuXG59Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/switch.js\n")},"./src/ui/tabBarHeader.js":/*!********************************!*\
|
|
!*** ./src/ui/tabBarHeader.js ***!
|
|
\********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_TabBarHeader; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_TabBarHeader extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-tab-bar-header\"\n }, this.props.text, this.props.button);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvdGFiQmFySGVhZGVyLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS90YWJCYXJIZWFkZXIuanM/MTM0ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgVjJDX1RhYkJhckhlYWRlciBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgfVxuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwiZGl2XCIsIHtcbiAgICAgIGNsYXNzTmFtZTogXCJ1aS10YWItYmFyLWhlYWRlclwiXG4gICAgfSwgdGhpcy5wcm9wcy50ZXh0LCB0aGlzLnByb3BzLmJ1dHRvbik7XG4gIH1cblxufSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/tabBarHeader.js\n")},"./src/ui/tabBarItem.js":/*!******************************!*\
|
|
!*** ./src/ui/tabBarItem.js ***!
|
|
\******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_TabBarItem; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_TabBarItem extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.setInitialState();\n this.onClick = this.onClick.bind(this);\n }\n\n setInitialState() {\n this.state = {\n selected: this.props.selected || false\n };\n }\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: `ui-tab-bar-item${this.props.selected ? \" selected\" : \"\"}`,\n onClick: this.onClick\n }, this.props.text);\n }\n\n onClick() {\n if (this.props.onClick) {\n this.props.onClick(this.props.id);\n }\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvdGFiQmFySXRlbS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvdGFiQmFySXRlbS5qcz81YzZhIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWMkNfVGFiQmFySXRlbSBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgICB0aGlzLnNldEluaXRpYWxTdGF0ZSgpO1xuICAgIHRoaXMub25DbGljayA9IHRoaXMub25DbGljay5iaW5kKHRoaXMpO1xuICB9XG5cbiAgc2V0SW5pdGlhbFN0YXRlKCkge1xuICAgIHRoaXMuc3RhdGUgPSB7XG4gICAgICBzZWxlY3RlZDogdGhpcy5wcm9wcy5zZWxlY3RlZCB8fCBmYWxzZVxuICAgIH07XG4gIH1cblxuICByZW5kZXIoKSB7XG4gICAgcmV0dXJuIEJEVjIucmVhY3QuY3JlYXRlRWxlbWVudChcImRpdlwiLCB7XG4gICAgICBjbGFzc05hbWU6IGB1aS10YWItYmFyLWl0ZW0ke3RoaXMucHJvcHMuc2VsZWN0ZWQgPyBcIiBzZWxlY3RlZFwiIDogXCJcIn1gLFxuICAgICAgb25DbGljazogdGhpcy5vbkNsaWNrXG4gICAgfSwgdGhpcy5wcm9wcy50ZXh0KTtcbiAgfVxuXG4gIG9uQ2xpY2soKSB7XG4gICAgaWYgKHRoaXMucHJvcHMub25DbGljaykge1xuICAgICAgdGhpcy5wcm9wcy5vbkNsaWNrKHRoaXMucHJvcHMuaWQpO1xuICAgIH1cbiAgfVxuXG59Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/tabBarItem.js\n")},"./src/ui/tabBarSeparator.js":/*!***********************************!*\
|
|
!*** ./src/ui/tabBarSeparator.js ***!
|
|
\***********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_TabBarSeparator; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_TabBarSeparator extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"ui-tab-bar-separator margin-top-8 margin-bottom-8\"\n });\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvdGFiQmFyU2VwYXJhdG9yLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS90YWJCYXJTZXBhcmF0b3IuanM/MzI0MiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgVjJDX1RhYkJhclNlcGFyYXRvciBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgfVxuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwiZGl2XCIsIHtcbiAgICAgIGNsYXNzTmFtZTogXCJ1aS10YWItYmFyLXNlcGFyYXRvciBtYXJnaW4tdG9wLTggbWFyZ2luLWJvdHRvbS04XCJcbiAgICB9KTtcbiAgfVxuXG59Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/tabBarSeparator.js\n")},"./src/ui/timestampRender.js":/*!***********************************!*\
|
|
!*** ./src/ui/timestampRender.js ***!
|
|
\***********************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\n\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react;\nconst intervalModule1 = BDModules.get(e => e.Interval)[0];\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (component, Messages) {\n class TimeRender extends React.PureComponent {\n constructor(props) {\n super(props);\n this._interval = new intervalModule1.Interval();\n this.state = Object.assign({}, this.getUpdatedTime());\n }\n\n componentDidMount() {\n let self = this;\n\n this._interval.start(1e3, function () {\n return self.setState(self.getUpdatedTime());\n });\n }\n\n componentWillUnmount() {\n this._interval.stop();\n }\n\n componentDidUpdate(activity) {\n if (activity.timestamps.end === this.props.timestamps.end && activity.timestamps.start === this.props.timestamps.start) return;\n this.setState(this.getUpdatedTime());\n }\n\n getUpdatedTime() {\n let timestamps = this.props.timestamps;\n let now = Date.now() / 1e3;\n\n if (null != timestamps.end) {\n return this.getDiff(now, checkUnix(timestamps.end) / 1e3);\n }\n\n if (null != timestamps.start) {\n return this.getDiff(checkUnix(timestamps.start) / 1e3, now);\n }\n\n return {\n hours: 0,\n minutes: 0,\n seconds: 0\n };\n }\n\n renderTime(number, removeZero) {\n if (removeZero === undefined) removeZero = false;\n if (removeZero && number <= 0) return -1;\n if (number < 10) return \"0\" + number;\n return number;\n }\n\n getDiff(timestamp, now) {\n let hours = Math.max(now - timestamp, 0);\n let seconds = Math.floor(hours) % 60;\n let minutes = Math.floor(hours / 60) % 60;\n return {\n hours: Math.floor(hours / 3600) % 24,\n minutes,\n seconds\n };\n }\n\n render() {\n let props = this.props;\n let timestamps = props.timestamps;\n\n let usedProps = function (props, items) {\n if (null == props) return {};\n let timestamps = {};\n let keys = Object.keys(props);\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n\n if (!items.indexOf(key) >= 0) {\n timestamps[key] = props[key];\n }\n }\n\n return timestamps;\n }(props, [\"timestamps\"]);\n\n let state = this.state;\n let hours = state.hours;\n let minutes = state.minutes;\n let seconds = state.seconds;\n let data = {\n hours: this.renderTime(hours, !0),\n minutes: this.renderTime(minutes),\n seconds: this.renderTime(seconds)\n };\n\n if (timestamps.end !== null) {\n return React.createElement(component, Object.assign({}, usedProps, {\n message: Messages.USER_ACTIVITY_TIMESTAMP_END.format(data)\n }));\n }\n\n if (timestamps.start !== null) {\n return React.createElement(component, Object.assign({}, usedProps, {\n message: Messages.USER_ACTIVITY_TIMESTAMP_START.format(data)\n }));\n }\n\n return null;\n }\n\n }\n\n return TimeRender;\n});\n;\n\nfunction checkUnix(e) {\n return (\"\" + e).length < 13 ? 1e3 * e : e;\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvdGltZXN0YW1wUmVuZGVyLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQmV0dGVyRGlzY29yZC8uL3NyYy91aS90aW1lc3RhbXBSZW5kZXIuanM/ZTFlNCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IEJEVjIgZnJvbSBcIi4uL21vZHVsZXMvdjJcIjtcbmNvbnN0IFJlYWN0ID0gQkRWMi5yZWFjdDtcbmNvbnN0IGludGVydmFsTW9kdWxlMSA9IEJETW9kdWxlcy5nZXQoZSA9PiBlLkludGVydmFsKVswXTtcbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIChjb21wb25lbnQsIE1lc3NhZ2VzKSB7XG4gIGNsYXNzIFRpbWVSZW5kZXIgZXh0ZW5kcyBSZWFjdC5QdXJlQ29tcG9uZW50IHtcbiAgICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgICAgc3VwZXIocHJvcHMpO1xuICAgICAgdGhpcy5faW50ZXJ2YWwgPSBuZXcgaW50ZXJ2YWxNb2R1bGUxLkludGVydmFsKCk7XG4gICAgICB0aGlzLnN0YXRlID0gT2JqZWN0LmFzc2lnbih7fSwgdGhpcy5nZXRVcGRhdGVkVGltZSgpKTtcbiAgICB9XG5cbiAgICBjb21wb25lbnREaWRNb3VudCgpIHtcbiAgICAgIGxldCBzZWxmID0gdGhpcztcblxuICAgICAgdGhpcy5faW50ZXJ2YWwuc3RhcnQoMWUzLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiBzZWxmLnNldFN0YXRlKHNlbGYuZ2V0VXBkYXRlZFRpbWUoKSk7XG4gICAg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YWxzZTtcbiAgICAgIGlmIChyZW1vdmVaZXJvICYmIG51bWJlciA8PSAwKSByZXR1cm4gLTE7XG4gICAgICBpZiAobnVtYmVyIDwgMTApIHJldHVybiBcIjBcIiArIG51bWJlcjtcbiAgICAgIHJldHVybiBudW1iZXI7XG4gICAgfVxuXG4gICAgZ2V0RGlmZih0aW1lc3RhbXAsIG5vdykge1xuICAgICAgbGV0IGhvdXJzID0gTWF0aC5tYXgobm93IC0gdGltZXN0YW1wLCAwKTtcbiAgICAgIGxldCBzZWNvbmRzID0gTWF0aC5mbG9vcihob3VycykgJSA2MDtcbiAgICAgIGxldCBtaW51dGVzID0gTWF0aC5mbG9vcihob3VycyAvIDYwKSAlIDYwO1xuICAgICAgcmV0dXJuIHtcbiAgICAgICAgaG91cnM6IE1hdGguZmxvb3IoaG91cnMgLyAzNjAwKSAlIDI0LFxuICAgICAgICBtaW51dGVzLFxuICAgICAgICBzZWNvbmRzXG4gICAgICB9O1xuICAgIH1cblxuICAgIHJlbmRlcigpIHtcbiAgICAgIGxldCBwcm9wcyA9IHRoaXMucHJvcHM7XG4gICAgICBsZXQgdGltZXN0YW1wcyA9IHByb3BzLnRpbWVzdGFtcHM7XG5cbiAgICAgIGxldCB1c2VkUHJvcHMgPSBmdW5jdGlvbiAocHJvcHMsIGl0ZW1zKSB7XG4gICAgICAgIGlmIChudWxsID09IHByb3BzKSByZXR1cm4ge307XG4gICAgICAgIGxldCB0aW1lc3RhbXBzID0ge307XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMocHJvcHMpO1xuXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuXG4gICAgICAgICAgaWYgKCFpdGVtcy5pbmRleE9mKGtleSkgPj0gMCkge1xuICAgICAgICAgICAgdGltZXN0YW1wc1trZXldID0gcHJvcHNba2V5XTtcbiAgICAgICAgICB9XG4gICA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//# sourceURL=webpack-internal:///./src/ui/timestampRender.js\n")},"./src/ui/tools.js":/*!*************************!*\
|
|
!*** ./src/ui/tools.js ***!
|
|
\*************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_Tools; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _xSvg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xSvg */ \"./src/ui/xSvg.js\");\n\n\nclass V2C_Tools extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.onClick = this.onClick.bind(this);\n }\n\n render() {\n let toolsModule = BDModules.get(e => e.toolsContainer)[0];\n let containerModule = BDModules.get(e => e.container && e.closeButton && e.closeButtonBold)[0];\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"tools-container \" + toolsModule.toolsContainer\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"tools \" + toolsModule.tools\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: containerModule.container\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"btn-close \" + containerModule.closeButton,\n onClick: this.onClick\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(_xSvg__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null)), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"div\", {\n className: \"esc-text \" + containerModule.keybind\n }, \"ESC\"))));\n }\n\n onClick() {\n if (this.props.onClick) {\n this.props.onClick();\n }\n\n const closeButton = document.querySelector(\".\" + BDModules.get(e => e.closeButton && e.keybindBold)[0].closeButton.split(\" \")[0]);\n if (closeButton) closeButton.click();\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvdG9vbHMuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL3VpL3Rvb2xzLmpzPzA3ZWQiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEJEVjIgZnJvbSBcIi4uL21vZHVsZXMvdjJcIjtcbmltcG9ydCBYU3ZnIGZyb20gXCIuL3hTdmdcIjtcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFYyQ19Ub29scyBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgICB0aGlzLm9uQ2xpY2sgPSB0aGlzLm9uQ2xpY2suYmluZCh0aGlzKTtcbiAgfVxuXG4gIHJlbmRlcigpIHtcbiAgICBsZXQgdG9vbHNNb2R1bGUgPSBCRE1vZHVsZXMuZ2V0KGUgPT4gZS50b29sc0NvbnRhaW5lcilbMF07XG4gICAgbGV0IGNvbnRhaW5lck1vZHVsZSA9IEJETW9kdWxlcy5nZXQoZSA9PiBlLmNvbnRhaW5lciAmJiBlLmNsb3NlQnV0dG9uICYmIGUuY2xvc2VCdXR0b25Cb2xkKVswXTtcbiAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwiZGl2XCIsIHtcbiAgICAgIGNsYXNzTmFtZTogXCJ0b29scy1jb250YWluZXIgXCIgKyB0b29sc01vZHVsZS50b29sc0NvbnRhaW5lclxuICAgIH0sIEJEVjIucmVhY3QuY3JlYXRlRWxlbWVudChcImRpdlwiLCB7XG4gICAgICBjbGFzc05hbWU6IFwidG9vbHMgXCIgKyB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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/tools.js\n")},"./src/ui/tooltip.js":/*!***************************!*\
|
|
!*** ./src/ui/tooltip.js ***!
|
|
\***************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return EmulatedTooltip; });\n/* harmony import */ var _modules_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _modules_webpackModules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/webpackModules */ \"./src/modules/webpackModules.js\");\n/**\r\n * Tooltip that automatically show and hide themselves on mouseenter and mouseleave events.\r\n * Will also remove themselves if the node to watch is removed from DOM through\r\n * a MutationObserver.\r\n *\r\n * Note this is not using Discord's internals but normal DOM manipulation and emulates\r\n * Discord's own tooltips as closely as possible.\r\n *\r\n * @module EmulatedTooltip\r\n * @version 0.0.1\r\n */\n\n //<div class=\"layer-v9HyYc disabledPointerEvents-1ptgTB\" style=\"position: absolute; left: 237px; bottom: 51px;\">\n//\t<div class=\"tooltip-2QfLtc tooltipTop-XDDSxx tooltipBlack-PPG47z tooltipDisablePointerEvents-3eaBGN\" style=\"opacity: 1; transform: none;\">\n//\t\t<div class=\"tooltipPointer-3ZfirK\"></div>\n//\t\t<div class=\"tooltipContent-bqVLWK\">User Settings</div>\n//\t</div>\n//</div>\n//<div class=\"layer-v9HyYc\" style=\"top: 860px; left: 632.5px;\">\n//\t<div class=\"tooltip-2QfLtc tooltipBlack-PPG47z tooltipTop-XDDSxx\">\n//\t\t<div class=\"tooltipPointer-3ZfirK\"></div>\n//\t\tChangelog\n//\t</div>\n//</div>\n\nconst TooltipClasses = _modules_webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"tooltip\", \"tooltipBlack\");\nconst TooltipLayers = _modules_webpackModules__WEBPACK_IMPORTED_MODULE_1__[\"default\"].findByProps(\"layer\", \"layerContainer\");\n\nconst getClass = function (sideOrColor) {\n const upperCase = sideOrColor[0].toUpperCase() + sideOrColor.slice(1);\n const tooltipClass = TooltipClasses[`tooltip${upperCase}`];\n if (tooltipClass) return tooltipClass;\n return null;\n};\n\nconst classExists = function (sideOrColor) {\n return getClass(sideOrColor) ? true : false;\n};\n\nconst toPx = function (value) {\n return `${value}px`;\n};\n/* <div class=\"layer-v9HyYc da-layer\" style=\"left: 234.5px; bottom: 51px;\">\r\n <div class=\"tooltip-2QfLtc da-tooltip tooltipTop-XDDSxx tooltipBlack-PPG47z\">\r\n <div class=\"tooltipPointer-3ZfirK da-tooltipPointer\"></div>\r\n User Settings\r\n </div>\r\n</div> */\n\n\nclass EmulatedTooltip {\n /**\r\n *\r\n * @constructor\r\n * @param {(HTMLElement|jQuery)} node - DOM node to monitor and show the tooltip on\r\n * @param {string} tip - string to show in the tooltip\r\n * @param {object} options - additional options for the tooltip\r\n * @param {string} [options.style=black] - correlates to the discord styling/colors (black, brand, green, grey, red, yellow)\r\n * @param {string} [options.side=top] - can be any of top, right, bottom, left\r\n * @param {boolean} [options.preventFlip=false] - prevents moving the tooltip to the opposite side if it is too big or goes offscreen\r\n * @param {boolean} [options.disabled=false] - whether the tooltip should be disabled from showing on hover\r\n */\n constructor(node, text, options = {}) {\n const {\n style = \"black\",\n side = \"top\",\n preventFlip = false,\n disabled = false\n } = options;\n this.node = node instanceof jQuery ? node[0] : node;\n this.label = text;\n this.style = style.toLowerCase();\n this.side = side.toLowerCase();\n this.preventFlip = preventFlip;\n this.disabled = disabled;\n if (!classExists(this.side)) return _modules_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].err(\"EmulatedTooltip\", `Side ${this.side} does not exist.`);\n if (!classExists(this.style)) return _modules_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].err(\"EmulatedTooltip\", `Style ${this.style} does not exist.`);\n this.element = document.createElement(\"div\");\n this.element.className = TooltipLayers.layer + \" \" + TooltipLayers.disabledPointerEvents;\n this.tooltipElement = document.createElement(\"div\");\n this.tooltipElement.className = `${TooltipClasses.tooltip} ${getClass(this.style)}`;\n this.labelElement = document.createElement(\"div\");\n this.labelElement.className = TooltipClasses.tooltipContent;\n const pointerElement = document.createElement(\"div\");\n pointerElement.className = TooltipClasses.tooltipPointer;\n this.tooltipElement.append(pointerElement);\n this.tooltipElement.append(this.labelElement);\n this.element.append(this.tooltipElement);\n this.node.addEventListener(\"mouseenter\", () => {\n if (this.disabled) return;\n this.show();\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n const nodes = Array.from(mutation.removedNodes);\n const directMatch = nodes.indexOf(this.node) > -1;\n const parentMatch = nodes.some(parent => parent.contains(this.node));\n\n if (directMatch || parentMatch) {\n this.hide();\n observer.disconnect();\n }\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n });\n this.node.addEventListener(\"mouseleave\", () => {\n this.hide();\n });\n }\n /** Container where the tooltip will be appended. */\n\n\n get container() {\n return document.querySelector(\".\" + BDModules.get(e => e.popouts)[0].popouts.split(\" \")[0] + \" ~ .\" + BDModules.get(e => e.layerContainer)[0].layerContainer.split(\" \")[0]);\n }\n /** Boolean representing if the tooltip will fit on screen above the element */\n\n\n get canShowAbove() {\n return this.node.getBoundingClientRect().top - this.element.offsetHeight >= 0;\n }\n /** Boolean representing if the tooltip will fit on screen below the element */\n\n\n get canShowBelow() {\n return this.node.getBoundingClientRect().top + this.node.offsetHeight + this.element.offsetHeight <= _modules_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].screenHeight;\n }\n /** Boolean representing if the tooltip will fit on screen to the left of the element */\n\n\n get canShowLeft() {\n return this.node.getBoundingClientRect().left - this.element.offsetWidth >= 0;\n }\n /** Boolean representing if the tooltip will fit on screen to the right of the element */\n\n\n get canShowRight() {\n return this.node.getBoundingClientRect().left + this.node.offsetWidth + this.element.offsetWidth <= _modules_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].screenWidth;\n }\n /** Hides the tooltip. Automatically called on mouseleave. */\n\n\n hide() {\n this.element.remove();\n this.tooltipElement.className = this._className;\n }\n /** Shows the tooltip. Automatically called on mouseenter. Will attempt to flip if position was wrong. */\n\n\n show() {\n this.tooltipElement.className = `${TooltipClasses.tooltip} ${getClass(this.style)}`;\n this.labelElement.textContent = this.label;\n this.container.append(this.element);\n\n if (this.side == \"top\") {\n if (this.canShowAbove || !this.canShowAbove && this.preventFlip) this.showAbove();else this.showBelow();\n }\n\n if (this.side == \"bottom\") {\n if (this.canShowBelow || !this.canShowBelow && this.preventFlip) this.showBelow();else this.showAbove();\n }\n\n if (this.side == \"left\") {\n if (this.canShowLeft || !this.canShowLeft && this.preventFlip) this.showLeft();else this.showRight();\n }\n\n if (this.side == \"right\") {\n if (this.canShowRight || !this.canShowRight && this.preventFlip) this.showRight();else this.showLeft();\n }\n }\n /** Force showing the tooltip above the node. */\n\n\n showAbove() {\n this.tooltipElement.classList.add(getClass(\"top\"));\n this.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top - this.element.offsetHeight - 10));\n this.centerHorizontally();\n }\n /** Force showing the tooltip below the node. */\n\n\n showBelow() {\n this.tooltipElement.classList.add(getClass(\"bottom\"));\n this.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top + this.node.offsetHeight + 10));\n this.centerHorizontally();\n }\n /** Force showing the tooltip to the left of the node. */\n\n\n showLeft() {\n this.tooltipElement.classList.add(getClass(\"left\"));\n this.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left - this.element.offsetWidth - 10));\n this.centerVertically();\n }\n /** Force showing the tooltip to the right of the node. */\n\n\n showRight() {\n this.tooltipElement.classList.add(getClass(\"right\"));\n this.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left + this.node.offsetWidth + 10));\n this.centerVertically();\n }\n\n centerHorizontally() {\n const nodecenter = this.node.getBoundingClientRect().left + this.node.offsetWidth / 2;\n this.element.style.setProperty(\"left\", toPx(nodecenter - this.element.offsetWidth / 2));\n }\n\n centerVertically() {\n const nodecenter = this.node.getBoundingClientRect().top + this.node.offsetHeight / 2;\n this.element.style.setProperty(\"top\", toPx(nodecenter - this.element.offsetHeight / 2));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvdG9vbHRpcC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkvdG9vbHRpcC5qcz85NDllIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxyXG4gKiBUb29sdGlwIHRoYXQgYXV0b21hdGljYWxseSBzaG93IGFuZCBoaWRlIHRoZW1zZWx2ZXMgb24gbW91c2VlbnRlciBhbmQgbW91c2VsZWF2ZSBldmVudHMuXHJcbiAqIFdpbGwgYWxzbyByZW1vdmUgdGhlbXNlbHZlcyBpZiB0aGUgbm9kZSB0byB3YXRjaCBpcyByZW1vdmVkIGZyb20gRE9NIHRocm91Z2hcclxuICogYSBNdXRhdGlvbk9ic2VydmVyLlxyXG4gKlxyXG4gKiBOb3RlIHRoaXMgaXMgbm90IHVzaW5nIERpc2NvcmQncyBpbnRlcm5hbHMgYnV0IG5vcm1hbCBET00gbWFuaXB1bGF0aW9uIGFuZCBlbXVsYXRlc1xyXG4gKiBEaXNjb3JkJ3Mgb3duIHRvb2x0aXBzIGFzIGNsb3NlbHkgYXMgcG9zc2libGUuXHJcbiAqXHJcbiAqIEBtb2R1bGUgRW11bGF0ZWRUb29sdGlwXHJcbiAqIEB2ZXJzaW9uIDAuMC4xXHJcbiAqL1xuaW1wb3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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/tooltip.js\n")},"./src/ui/tooltipWrap.js":/*!*******************************!*\
|
|
!*** ./src/ui/tooltipWrap.js ***!
|
|
\*******************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tooltip */ \"./src/ui/tooltip.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (class extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n async componentDidMount() {\n const {\n style = \"black\",\n side = \"top\",\n text = \"\"\n } = this.props;\n this.node = _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactDom.findDOMNode(this);\n this.tooltip = new _tooltip__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.node, text, {\n style,\n side\n });\n }\n\n componentWillUnmount() {\n this.tooltip.hide();\n delete this.tooltip;\n }\n\n render() {\n return this.props.children;\n }\n\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvdG9vbHRpcFdyYXAuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9CZXR0ZXJEaXNjb3JkLy4vc3JjL3VpL3Rvb2x0aXBXcmFwLmpzPzk5ZTEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEJEVjIgZnJvbSBcIi4uL21vZHVsZXMvdjJcIjtcbmltcG9ydCBUb29sdGlwIGZyb20gXCIuL3Rvb2x0aXBcIjtcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIGV4dGVuZHMgQkRWMi5yZWFjdENvbXBvbmVudCB7XG4gIGNvbnN0cnVjdG9yKHByb3BzKSB7XG4gICAgc3VwZXIocHJvcHMpO1xuICB9XG5cbiAgYXN5bmMgY29tcG9uZW50RGlkTW91bnQoKSB7XG4gICAgY29uc3Qge1xuICAgICAgc3R5bGUgPSBcImJsYWNrXCIsXG4gICAgICBzaWRlID0gXCJ0b3BcIixcbiAgICAgIHRleHQgPSBcIlwiXG4gICAgfSA9IHRoaXMucHJvcHM7XG4gICAgdGhpcy5ub2RlID0gQkRWMi5yZWFjdERvbS5maW5kRE9NTm9kZSh0aGlzKTtcbiAgICB0aGlzLnRvb2x0aXAgPSBuZXcgVG9vbHRpcCh0aGlzLm5vZGUsIHRleHQsIHtcbiAgICAgIHN0eWxlLFxuICAgICAgc2lkZVxuICAgIH0pO1xuICB9XG5cbiAgY29tcG9uZW50V2lsbFVubW91bnQoKSB7XG4gICAgdGhpcy50b29sdGlwLmhpZGUoKTtcbiAgICBkZWxldGUgdGhpcy50b29sdGlwO1xuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIHJldHVybiB0aGlzLnByb3BzLmNoaWxkcmVuO1xuICB9XG5cbn0iXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/tooltipWrap.js\n")},"./src/ui/xSvg.js":/*!************************!*\
|
|
!*** ./src/ui/xSvg.js ***!
|
|
\************************/ /*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_XSvg; });\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n\nclass V2C_XSvg extends _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 12 12\",\n style: {\n width: \"18px\",\n height: \"18px\"\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"g\", {\n className: \"background\",\n fill: \"none\",\n fillRule: \"evenodd\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"path\", {\n d: \"M0 0h12v12H0\"\n }), _modules_v2__WEBPACK_IMPORTED_MODULE_0__[\"default\"].react.createElement(\"path\", {\n className: \"fill\",\n fill: \"#dcddde\",\n d: \"M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6\"\n })));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkveFN2Zy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0JldHRlckRpc2NvcmQvLi9zcmMvdWkveFN2Zy5qcz84MDhjIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBCRFYyIGZyb20gXCIuLi9tb2R1bGVzL3YyXCI7XG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWMkNfWFN2ZyBleHRlbmRzIEJEVjIucmVhY3RDb21wb25lbnQge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIHN1cGVyKHByb3BzKTtcbiAgfVxuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwic3ZnXCIsIHtcbiAgICAgIHhtbG5zOiBcImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnXCIsXG4gICAgICB2aWV3Qm94OiBcIjAgMCAxMiAxMlwiLFxuICAgICAgc3R5bGU6IHtcbiAgICAgICAgd2lkdGg6IFwiMThweFwiLFxuICAgICAgICBoZWlnaHQ6IFwiMThweFwiXG4gICAgICB9XG4gICAgfSwgQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwiZ1wiLCB7XG4gICAgICBjbGFzc05hbWU6IFwiYmFja2dyb3VuZFwiLFxuICAgICAgZmlsbDogXCJub25lXCIsXG4gICAgICBmaWxsUnVsZTogXCJldmVub2RkXCJcbiAgICB9LCBCRFYyLnJlYWN0LmNyZWF0ZUVsZW1lbnQoXCJwYXRoXCIsIHtcbiAgICAgIGQ6IFwiTTAgMGgxMnYxMkgwXCJcbiAgICB9KSwgQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KFwicGF0aFwiLCB7XG4gICAgICBjbGFzc05hbWU6IFwiZmlsbFwiLFxuICAgICAgZmlsbDogXCIjZGNkZGRlXCIsXG4gICAgICBkOiBcIk05LjUgMy4yMDVMOC43OTUgMi41IDYgNS4yOTUgMy4yMDUgMi41bC0uNzA1LjcwNUw1LjI5NSA2IDIuNSA4Ljc5NWwuNzA1LjcwNUw2IDYuNzA1IDguNzk1IDkuNWwuNzA1LS43MDVMNi43MDUgNlwiXG4gICAgfSkpKTtcbiAgfVxuXG59Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/xSvg.js\n")},crypto:/*!*************************!*\
|
|
!*** external "crypto" ***!
|
|
\*************************/ /*! no static exports found */function(e){e.exports=require("crypto")},electron:/*!***************************!*\
|
|
!*** external "electron" ***!
|
|
\***************************/ /*! no static exports found */function(e){e.exports=require("electron")},events:/*!*************************!*\
|
|
!*** external "events" ***!
|
|
\*************************/ /*! no static exports found */function(e){e.exports=require("events")},fs:/*!*********************!*\
|
|
!*** external "fs" ***!
|
|
\*********************/ /*! no static exports found */function(e){e.exports=require("fs")},mkdirp:/*!*************************!*\
|
|
!*** external "mkdirp" ***!
|
|
\*************************/ /*! no static exports found */function(e){e.exports=require("mkdirp")},module:/*!*************************!*\
|
|
!*** external "module" ***!
|
|
\*************************/ /*! no static exports found */function(e){e.exports=require("module")},"node-fetch":/*!*****************************!*\
|
|
!*** external "node-fetch" ***!
|
|
\*****************************/ /*! no static exports found */function(e){e.exports=require("node-fetch")},path:/*!***********************!*\
|
|
!*** external "path" ***!
|
|
\***********************/ /*! no static exports found */function(e){e.exports=require("path")},request:/*!**************************!*\
|
|
!*** external "request" ***!
|
|
\**************************/ /*! no static exports found */function(e){e.exports=require("request")},rimraf:/*!*************************!*\
|
|
!*** external "rimraf" ***!
|
|
\*************************/ /*! no static exports found */function(e){e.exports=require("rimraf")},yauzl:/*!************************!*\
|
|
!*** external "yauzl" ***!
|
|
\************************/ /*! no static exports found */function(e){e.exports=require("yauzl")}}); |