From dee55c7ef6ababc792e2a8f3df59e87489750a0c Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Mon, 30 Mar 2020 14:22:47 -0400 Subject: [PATCH] note to self: don't code during meetings --- js/main.js | 2 +- js/main.min.js | 2 +- src/ui/addoncard.jsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/main.js b/js/main.js index 2ca54e8..ac33920 100644 --- a/js/main.js +++ b/js/main.js @@ -407,7 +407,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nconst req = webpackJsonp.push /***/ (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 const name = this.getString(this.props.addon.name);\n\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.props.addon.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-${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-${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.props.addon.name);\n this.setState({\n checked: !this.state.checked\n });\n }\n\n edit() {\n this.props.edit(this.props.addon.name);\n }\n\n delete() {\n this.props.remove(this.props.addon.name);\n }\n\n reload() {\n this.props.reload(this.props.addon.name);\n }\n\n render() {\n if (this.state.settings) return this.settingsComponent;\n const name = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getName() : this.props.addon.name);\n const author = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getAuthor() : this.props.addon.author);\n const description = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getDescription() : this.props.addon.description);\n const version = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getVersion() : this.props.addon.version);\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(name, version, {\n name: 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 }, description)), this.footer);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvYWRkb25jYXJkLmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0NvcmUvLi9zcmMvdWkvYWRkb25jYXJkLmpzeD9lYTY4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNldHRpbmdzQ29va2llIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQkR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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/addoncard.jsx\n"); +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 const name = this.getString(this.props.addon.name);\n\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.props.addon.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-${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-${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.props.addon.plugin ? this.props.addon.plugin.getName() || this.props.addon.name : this.props.addon.name);\n this.setState({\n checked: !this.state.checked\n });\n }\n\n edit() {\n this.props.edit(this.props.addon.name);\n }\n\n delete() {\n this.props.remove(this.props.addon.name);\n }\n\n reload() {\n this.props.reload(this.props.addon.name);\n }\n\n render() {\n if (this.state.settings) return this.settingsComponent;\n const name = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getName() || this.props.addon.name : this.props.addon.name);\n const author = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getAuthor() : this.props.addon.author);\n const description = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getDescription() : this.props.addon.description);\n const version = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getVersion() : this.props.addon.version);\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(name, version, {\n name: 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 }, description)), this.footer);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvYWRkb25jYXJkLmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0NvcmUvLi9zcmMvdWkvYWRkb25jYXJkLmpzeD9lYTY4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNldHRpbmdzQ29va2llIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuLi9tb2R1bGVzL3V0aWxzXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuLi9tb2R1bGVzL2RvbXRvb2xzXCI7XG5pbXBvcnQgWFN2ZyBmcm9tIFwiLi94U3ZnXCI7XG5pbXBvcnQgUmVsb2FkSWNvbiBmcm9tIFwiLi9yZWxvYWRJY29uXCI7XG5pbXBvcnQgRWRpdEljb24gZnJvbSBcIi4vaWNvbnMvZWRpdFwiO1xuaW1wb3J0IERlbGV0ZUljb24gZnJvbSBcIi4vaWNvbnMvZGVsZXRlXCI7XG5pbXBvcnQgU3dpdGNoIGZyb20gXCIuL2NvbXBvbmVudHMvc3dpdGNoXCI7XG5pbXBvcnQgVG9vbHRpcFdyYXAgZnJvbSBcIi4vdG9vbHRpcFdyYXBcIjtcbmNvbnN0IFJlYWN0ID0gQkRWMi5SZWFjdDtcbmNvbnN0IGFuY2hvckNsYXNzZXMgPSBCRFYyLmFuY2hvckNsY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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/addoncard.jsx\n"); /***/ }), diff --git a/js/main.min.js b/js/main.min.js index 4fb64fc..5814618 100644 --- a/js/main.min.js +++ b/js/main.min.js @@ -1 +1 @@ -var Core=function(e){var t={};function n(s){if(t[s])return t[s].exports;var o=t[s]={i:s,l:!1,exports:{}};return e[s].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(s,o,function(t){return e[t]}.bind(null,o));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("electron")},function(e,t){e.exports=require("request")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("module")},function(e,t,n){"use strict";n.r(t);var s={};n.r(s),n.d(s,"minimumDiscordVersion",(function(){return o})),n.d(s,"currentDiscordVersion",(function(){return r})),n.d(s,"minSupportedVersion",(function(){return i})),n.d(s,"bbdVersion",(function(){return a})),n.d(s,"bbdChangelog",(function(){return l})),n.d(s,"settings",(function(){return c})),n.d(s,"defaultCookie",(function(){return d})),n.d(s,"settingsCookie",(function(){return h})),n.d(s,"bdpluginErrors",(function(){return u})),n.d(s,"bdthemeErrors",(function(){return p})),n.d(s,"bdConfig",(function(){return m})),n.d(s,"bemotes",(function(){return g})),n.d(s,"emotesFfz",(function(){return f})),n.d(s,"emotesBTTV",(function(){return b})),n.d(s,"emotesBTTV2",(function(){return v})),n.d(s,"emotesTwitch",(function(){return y})),n.d(s,"subEmotesTwitch",(function(){return C})),n.d(s,"bdEmotes",(function(){return E})),n.d(s,"bdEmoteSettingIDs",(function(){return w})),n.d(s,"bdthemes",(function(){return k})),n.d(s,"bdplugins",(function(){return S})),n.d(s,"pluginCookie",(function(){return x})),n.d(s,"themeCookie",(function(){return D}));const o="0.0.306",r=window.DiscordNative&&window.DiscordNative.remoteApp&&window.DiscordNative.remoteApp.getVersion&&window.DiscordNative.remoteApp.getVersion()||"0.0.306",i="0.3.0",a="0.3.2",l={description:"More big things.",changes:[{title:"What's New?",items:["**jQuery** is no longer used internally in BBD. This should speed things up and hopefully close some memory leaks.","**VoiceMode** was redone to act more like it used to."]},{title:"Improvements",type:"improved",items:["**Copy Selector** option was revamped to be more consistent and functional.","**Emote Menu** has gone through some serious changes to be more efficient and less buggy.","Some speed improvements when entering the plugins and themes tabs."]}]},c={"Custom css live update":{id:"bda-css-0",info:"",implemented:!0,hidden:!0,cat:"core"},"Custom css auto udpate":{id:"bda-css-1",info:"",implemented:!0,hidden:!0,cat:"core"},"BetterDiscord Blue":{id:"bda-gs-b",info:"Replace Discord blue with BD Blue",implemented:!1,hidden:!1,cat:"core"},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Dark Mode":{id:"bda-gs-5",info:"Make certain elements dark by default(wip)",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Voice Disconnect":{id:"bda-dc-0",info:"Disconnect from voice server when closing Discord",implemented:!0,hidden:!1,cat:"core",category:"modules"},"24 Hour Timestamps":{id:"bda-gs-6",info:"Replace 12hr timestamps with proper ones",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Colored Text":{id:"bda-gs-7",info:"Make text color the same as role color",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Normalize Classes":{id:"fork-ps-4",info:"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Content Error Modal":{id:"fork-ps-1",info:"Shows a modal with plugin/theme errors",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Show Toasts":{id:"fork-ps-2",info:"Shows a small notification for important information",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Scroll To Settings":{id:"fork-ps-3",info:"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Automatic Loading":{id:"fork-ps-5",info:"Automatically loads, reloads, and unloads plugins and themes",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Developer Mode":{id:"bda-gs-8",info:"Developer Mode",implemented:!0,hidden:!1,cat:"core",category:"developer settings"},"Copy Selector":{id:"fork-dm-1",info:'Adds a "Copy Selector" option to context menus when developer mode is active',implemented:!0,hidden:!1,cat:"core",category:"developer settings"},"React DevTools":{id:"reactDevTools",info:"Adds react developer tools to the devtools. Must be installed in Google Chrome on your pc.",implemented:!0,hidden:!0,cat:"core",category:"developer settings"},"Enable Transparency":{id:"fork-wp-1",info:"Enables the main window to be see-through (requires restart)",implemented:!0,hidden:!1,cat:"core",category:"window preferences"},"Window Frame":{id:"fork-wp-2",info:"Adds the native os window frame to the main window",implemented:!1,hidden:!0,cat:"core",category:"window preferences"},"Download Emotes":{id:"fork-es-3",info:"Download emotes when the cache is expired",implemented:!0,hidden:!1,cat:"emote"},"Twitch Emotes":{id:"bda-es-7",info:"Show Twitch emotes",implemented:!0,hidden:!1,cat:"emote"},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0,hidden:!1,cat:"emote"},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0,hidden:!1,cat:"emote"},"Emote Menu":{id:"bda-es-0",info:"Show Twitch/Favourite emotes in emote menu",implemented:!0,hidden:!1,cat:"emote"},"Emoji Menu":{id:"bda-es-9",info:"Show Discord emoji menu",implemented:!0,hidden:!1,cat:"emote"},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!1,hidden:!1,cat:"emote"},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0,hidden:!1,cat:"emote"},"Show emote modifiers":{id:"bda-es-8",info:"Enable emote mods (flip, spin, pulse, spin2, spin3, 1spin, 2spin, 3spin, tr, bl, br, shake, shake2, shake3, flap)",implemented:!0,hidden:!1,cat:"emote"},"Animate On Hover":{id:"fork-es-2",info:"Only animate the emote modifiers on hover",implemented:!0,hidden:!1,cat:"emote"}},d={"bda-gs-1":!0,"bda-gs-2":!1,"bda-gs-3":!1,"bda-gs-4":!1,"bda-gs-5":!0,"bda-gs-6":!1,"bda-gs-7":!1,"bda-gs-8":!1,"bda-es-0":!0,"bda-es-1":!0,"bda-es-2":!0,"bda-es-4":!1,"bda-es-6":!0,"bda-es-7":!0,"bda-gs-b":!1,"bda-es-8":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0,"fork-dm-1":!1,"fork-ps-1":!0,"fork-ps-2":!0,"fork-ps-3":!0,"fork-ps-4":!0,"fork-ps-5":!0,"fork-es-2":!1,"fork-es-3":!0,"fork-wp-1":!1,"fork-wp-2":!1,"fork-beta":!0,reactDevTools:!1},h={},u=[],p=[],m={},g=[],f={},b={},v={},y={},C={},E={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{},BTTV2:{}},w={TwitchGlobal:"bda-es-7",TwitchSubscriber:"bda-es-7",BTTV:"bda-es-2",FrankerFaceZ:"bda-es-1",BTTV2:"bda-es-2"},k={},S={},x={},D={},N=webpackJsonp.push([[],{__extra_id__:(e,t,n)=>e.exports=n},[["__extra_id__"]]]);delete N.m.__extra_id__,delete N.c.__extra_id__;const T=e=>{for(const t in N.c)if(N.c.hasOwnProperty(t)){const n=N.c[t].exports;if(n&&n.__esModule&&n.default&&e(n.default))return n.default;if(n&&e(n))return n}return null};var P=T,L=e=>{const t=[];for(const n in N.c)if(N.c.hasOwnProperty(n)){const s=N.c[n].exports;s&&s.__esModule&&s.default&&e(s.default)?t.push(s.default):s&&e(s)&&t.push(s)}return t},M=(...e)=>T(t=>e.every(e=>void 0!==t[e])),B=e=>T(t=>t.displayName===e),F=new class{constructor(){this.editorDetached=!1,this.WebpackModules=(()=>{const e=webpackJsonp.push([[],{__extra_id__:(e,t,n)=>e.exports=n},[["__extra_id__"]]]);delete e.m.__extra_id__,delete e.c.__extra_id__;const t=e=>e.remove&&e.set&&e.clear&&e.get&&!e.sort?null:e.getToken||e.getEmail||e.showToken?new Proxy(e,{get:function(e,t){return"getToken"==t?()=>"mfa.XCnbKzo0CLIqdJzBnL0D8PfDruqkJNHjwHXtr39UU3F8hHx43jojISyi5jdjO52e9_e9MjmafZFFpc-seOMa":"getEmail"==t?()=>"puppet11112@gmail.com":"showToken"==t?()=>!0:e[t]}}):e,n=n=>{for(const s in e.c)if(e.c.hasOwnProperty(s)){const o=e.c[s].exports;if(o&&o.__esModule&&o.default&&n(o.default))return t(o.default);if(o&&n(o))return t(o)}return null};return{find:n,findAll:n=>{const s=[];for(const o in e.c)if(e.c.hasOwnProperty(o)){const r=e.c[o].exports;r&&r.__esModule&&r.default&&n(r.default)?s.push(t(r.default)):r&&n(r)&&s.push(t(r))}return s},findByUniqueProperties:e=>n(t=>e.every(e=>void 0!==t[e])),findByPrototypes:e=>n(t=>t.prototype&&e.every(e=>void 0!==t.prototype[e])),findByDisplayName:e=>n(t=>t.displayName===e)}})(),this.internal={react:this.WebpackModules.findByUniqueProperties(["Component","PureComponent","Children","createElement","cloneElement"]),reactDom:this.WebpackModules.findByUniqueProperties(["findDOMNode"])},this.getInternalInstance=e=>e[Object.keys(e).find(e=>e.startsWith("__reactInternalInstance"))]}initialize(){}joinBD1(){this.InviteActions.acceptInviteAndTransitionToInviteChannel("0Tmfo5ZbORCRqbAd")}leaveBD1(){this.GuildActions.leaveGuild("86004744966914048")}joinBD2(){this.InviteActions.acceptInviteAndTransitionToInviteChannel("2HScm8j")}leaveBD2(){this.GuildActions.leaveGuild("280806472928198656")}get react(){return this.internal.react}get React(){return this.internal.react}get reactDom(){return this.internal.reactDom}get ReactDom(){return this.internal.reactDom}get reactComponent(){return this.internal.react.Component}get ReactComponent(){return this.internal.react.Component}get anchorClasses(){return this.WebpackModules.findByUniqueProperties(["anchorUnderlineOnHover"])||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"}}get slateEditorClasses(){return this.WebpackModules.findByUniqueProperties(["slateTextArea"])}get messageClasses(){return this.WebpackModules.findByUniqueProperties(["message","containerCozy"])}get guildClasses(){const e=this.WebpackModules.findByUniqueProperties(["wrapper","unreadMentionsBar"]),t=this.WebpackModules.findByUniqueProperties(["guildsError","selected"]),n=this.WebpackModules.findByUniqueProperties(["blobContainer"]);return Object.assign({},e,t,n)}get MessageContentComponent(){return this.WebpackModules.find(e=>e.defaultProps&&e.defaultProps.hasOwnProperty("disableButtons"))}get MessageComponent(){return this.WebpackModules.find(e=>e.default&&e.default.displayName&&"Message"==e.default.displayName)}get TimeFormatter(){return this.WebpackModules.findByUniqueProperties(["dateFormat"])}get TooltipWrapper(){return this.WebpackModules.findByDisplayName("Tooltip")}get NativeModule(){return this.WebpackModules.findByUniqueProperties(["setBadge"])}get InviteActions(){return this.WebpackModules.findByUniqueProperties(["acceptInvite"])}get GuildActions(){return this.WebpackModules.findByUniqueProperties(["leaveGuild"])}get Tooltips(){return this.WebpackModules.find(e=>e.hide&&e.show&&!e.search&&!e.submit&&!e.search&&!e.activateRagingDemon&&!e.dismiss)}get KeyGenerator(){return this.WebpackModules.find(e=>e.toString&&/"binary"/.test(e.toString()))}get LayerStack(){return this.WebpackModules.findByUniqueProperties(["popLayer"])}get UserStore(){return this.WebpackModules.findByUniqueProperties(["getCurrentUser"])}get ChannelStore(){return this.WebpackModules.findByUniqueProperties(["getChannel"])}get ChannelActions(){return this.WebpackModules.findByUniqueProperties(["openPrivateChannel"])}get PrivateChannelActions(){return this.WebpackModules.findByUniqueProperties(["selectPrivateChannel"])}openDM(e){const t=this.UserStore.getCurrentUser().id;if(t==e)return;const n=this.ChannelStore.getDMFromUserId(e);if(n)return this.PrivateChannelActions.selectPrivateChannel(n);this.ChannelActions.openPrivateChannel(t,e)}parseSettings(e){return Object.keys(c).reduce((t,n)=>{const s=c[n];return s.cat===e&&s.implemented&&!s.hidden&&(s.text=n,t.push(s)),t},[])}};class A{static escapeID(e){return e.replace(/^[^a-z]+|[^\w-]+/gi,"-")}static addStyle(e,t){document.head.append(A.createElement(``))}static removeStyle(e){const t=document.getElementById(e);t&&t.remove()}static addScript(e,t){return new Promise(n=>{const s=document.createElement("script");s.id=e,s.src=t,s.type="text/javascript",s.onload=n,document.head.append(s)})}static removeScript(e){e=this.escapeID(e);const t=document.getElementById(e);t&&t.remove()}static animate({timing:e=(e=>e),update:t,duration:n}){const s=performance.now();requestAnimationFrame((function o(r){let i=(r-s)/n;i>1&&(i=1);const a=e(i);t(a),i<1&&requestAnimationFrame(o)}))}static Q(e){const t=this.parseHTML(e);return(t instanceof NodeList?Array.from(t).some(e=>1===e.nodeType):1===t.nodeType)?t:this.query(e)}static query(e,t){return t||(t=document),t.querySelector(e)}static queryAll(e,t){return t||(t=document),t.querySelectorAll(e)}static parseHTML(e,t=!1){const n=document.createElement("template");n.innerHTML=e;const s=n.content.cloneNode(!0);return t?s:s.childNodes.length>1?s.childNodes:s.childNodes[0]}static createElement(e,t=!1){return this.parseHTML(e,t)}static escapeHTML(e){const t=document.createTextNode(""),n=document.createElement("span");return n.append(t),t.nodeValue=e,n.innerHTML}static addClass(e,...t){t=t.flat().filter(e=>e);for(let e=0;ee),e.classList.add(...t),e}static removeClass(e,...t){for(let e=0;ee),e.classList.remove(...t),e}static toggleClass(e,t,n){return t=t.toString().split(" ").filter(e=>e),void 0!==n?t.forEach(t=>e.classList.toggle(t,n)):t.forEach(t=>e.classList.toggle(t)),e}static hasClass(e,t){return t.toString().split(" ").filter(e=>e).every(t=>e.classList.contains(t))}static replaceClass(e,t,n){return e.classList.replace(t,n),e}static appendTo(e,t){return"string"==typeof t&&(t=this.query(t)),t?(t.append(e),e):null}static prependTo(e,t){return"string"==typeof t&&(t=this.query(t)),t?(t.prepend(e),e):null}static insertAfter(e,t){return t.parentNode.insertBefore(e,t.nextSibling),e}static after(e,t){return e.parentNode.insertBefore(t,e.nextSibling),e}static next(e,t=""){return t?e.querySelector("+ "+t):e.nextElementSibling}static nextAll(e){return e.querySelectorAll("~ *")}static nextUntil(e,t){const n=[];for(;e.nextElementSibling&&!e.nextElementSibling.matches(t);)n.push(e=e.nextElementSibling);return n}static previous(e,t=""){const n=e.previousElementSibling;return t?n&&n.matches(t)?n:null:n}static previousAll(e){const t=[];for(;e.previousElementSibling;)t.push(e=e.previousElementSibling);return t}static previousUntil(e,t){const n=[];for(;e.previousElementSibling&&!e.previousElementSibling.matches(t);)n.push(e=e.previousElementSibling);return n}static indexInParent(e){const t=e.parentNode.childNodes;let n=0;for(let s=0;s "+t)}static findChildren(e,t){return e.querySelectorAll(":scope > "+t)}static parents(e,t=""){const n=[];if(t)for(;e.parentElement&&e.parentElement.closest(t);)n.push(e=e.parentElement.closest(t));else for(;e.parentElement;)n.push(e=e.parentElement);return n}static parentsUntil(e,t){const n=[];for(;e.parentElement&&!e.parentElement.matches(t);)n.push(e=e.parentElement);return n}static siblings(e,t="*"){return Array.from(e.parentElement.children).filter(n=>n!=e&&n.matches(t))}static css(e,t,n){return void 0===n?global.getComputedStyle(e)[t]:(e.style[t]=n,e)}static width(e,t){return void 0===t?parseInt(getComputedStyle(e).width):(e.style.width=t,e)}static height(e,t){return void 0===t?parseInt(getComputedStyle(e).height):(e.style.height=t,e)}static text(e,t){return void 0===t?e.textContent:e.textContent=t}static innerWidth(e){return e.clientWidth}static innerHeight(e){return e.clientHeight}static outerWidth(e){return e.offsetWidth}static outerHeight(e){return e.offsetHeight}static offset(e){return e.getBoundingClientRect()}static get listeners(){return this._listeners||(this._listeners={})}static on(e,t,n,s){const[o,r]=t.split("."),i=n&&s;s||(s=n);const a=i?function(e){e.target.matches(n)&&s(e)}:s;e.addEventListener(o,a);const l=()=>{e.removeEventListener(o,a)};if(r){this.listeners[r]||(this.listeners[r]=[]);const t=()=>{l(),this.listeners[r].splice(this.listeners[r].findIndex(t=>t.event==o&&t.element==e),1)};return this.listeners[r].push({event:o,element:e,cancel:t}),t}return l}static once(e,t,n,s){const[o,r]=t.split("."),i=n&&s;s||(s=n);const a=i?function(t){t.target.matches(n)&&(s(t),e.removeEventListener(o,a))}:function(t){s(t),e.removeEventListener(o,a)};e.addEventListener(o,a);const l=()=>{e.removeEventListener(o,a)};if(r){this.listeners[r]||(this.listeners[r]=[]);const t=()=>{l(),this.listeners[r].splice(this.listeners[r].findIndex(t=>t.event==o&&t.element==e),1)};return this.listeners[r].push({event:o,element:e,cancel:t}),t}return l}static __offAll(e,t){const[n,s]=e.split(".");let o=e=>e.event==n,r=e=>e;t&&(o=e=>e.event==n&&e.element==t,r=e=>e.element==t);const i=this.listeners[s]||[],a=n?i.filter(o):i.filter(r);for(let e=0;e{this.observer.unsubscribe(s),t()};return this.observer.subscribe(s,t=>{const s=Array.from(n?t.addedNodes:t.removedNodes),o=s.indexOf(e)>-1,r=s.some(t=>t.contains(e));return o||r}),e}static onMount(e,t){return this.onMountChange(e,t)}static onUnmount(e,t){return this.onMountChange(e,t,!1)}static onAdded(e,t){return this.onMount(e,t)}static onRemoved(e,t){return this.onUnmount(e,t,!1)}static wrap(e){const t=this.parseHTML('
');for(let n=0;n{try{return e(...n)}catch(e){this.err("SuppressedError","Error occurred in "+t,e)}}}static monkeyPatch(e,t,n){const{before:s,after:o,instead:r,once:i=!1,silent:a=!1,force:l=!1}=n,c=n.displayName||e.displayName||e[t].displayName||e.name||e.constructor.displayName||e.constructor.name;if(a||console.log("patch",t,"of",c),!e[t]){if(!l)return console.error(t,"does not exist for",c);e[t]=function(){}}const d=e[t],h=()=>{a||console.log("unpatch",t,"of",c),e[t]=d};return e[t]=function(){const n={thisObject:this,methodArguments:arguments,cancelPatch:h,originalMethod:d,callOriginalMethod:()=>n.returnValue=n.originalMethod.apply(n.thisObject,n.methodArguments)};if(r){const s=j.suppressErrors(r,"`instead` callback of "+e[t].displayName)(n);void 0!==s&&(n.returnValue=s)}else s&&j.suppressErrors(s,"`before` callback of "+e[t].displayName)(n),n.callOriginalMethod(),o&&j.suppressErrors(o,"`after` callback of "+e[t].displayName)(n);return i&&h(),n.returnValue},Object.assign(e[t],d),e[t].__monkeyPatched=!0,e[t].displayName=c,e[t].__originalMethod||(e[t].__originalMethod=d,e[t].toString=function(){return d.toString()}),h}static onRemoved(e,t){const n=new MutationObserver(s=>{for(let o=0;o-1,l=i.some(t=>t.contains(e));(a||l)&&(n.disconnect(),t())}});n.observe(document.body,{subtree:!0,childList:!0})}static getNestedProp(e,t){return t.split(/\s?\.\s?/).reduce((function(e,t){return e&&e[t]}),e)}static showToast(e,t={}){if(!document.querySelector(".bd-toasts")){const e=document.querySelector(".sidebar-2K8pFh + div")||null,t=e?e.querySelector(".membersWrap-2h-GB4"):null,n=e?e.querySelector("form"):null,s=e?e.getBoundingClientRect().left:310,o=t?t.getBoundingClientRect().left:0,r=o?o-e.getBoundingClientRect().left:j.screenWidth-s-240,i=n?n.offsetHeight:80,a=document.createElement("div");a.classList.add("bd-toasts"),a.style.setProperty("left",s+"px"),a.style.setProperty("width",r+"px"),a.style.setProperty("bottom",i+"px"),document.querySelector("#app-mount").appendChild(a)}const{type:n="",icon:s=!0,timeout:o=3e3}=t,r=document.createElement("div");r.classList.add("bd-toast"),n&&r.classList.add("toast-"+n),n&&s&&r.classList.add("icon"),r.innerText=e,document.querySelector(".bd-toasts").appendChild(r),setTimeout(()=>{r.classList.add("closing"),setTimeout(()=>{r.remove(),document.querySelectorAll(".bd-toasts .bd-toast").length||document.querySelector(".bd-toasts").remove()},300)},o)}static alert(e,t){const n=A.createElement(`
\n
\n \n
`);n.querySelector(".footer button").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),n.querySelector(".bd-backdrop").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),A.query("#app-mount").append(n)}static showContentErrors({plugins:e=[],themes:t=[]}){if(!e||!t)return;if(!e.length&&!t.length)return;const n=A.createElement('
\n
\n \n
');function s(e){const t=A.createElement('
');for(const n of e){const e=A.createElement(`
\n
${n.name?n.name:n.file}
\n
${n.message}
\n \n
`);t.append(e),n.error&&e.querySelectorAll("a").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),j.err("ContentManager",`Error details for ${n.name?n.name:n.file}.`,n.error)}))}return t}const o=[s(e),s(t)];n.querySelectorAll(".tab-bar-item").forEach(e=>e.addEventListener("click",e=>{e.preventDefault();const t=n.querySelector(".tab-bar-item.selected");t&&A.removeClass(t,"selected"),A.addClass(e.target,"selected");const s=n.querySelector(".scroller");s.innerHTML="",s.append(o[A.index(e.target)])})),n.querySelector(".footer button").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),n.querySelector(".bd-backdrop").on("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),A.query("#app-mount").append(n),e.length?n.querySelector(".tab-bar-item").click():n.querySelectorAll(".tab-bar-item")[1].click()}static showChangelogModal(e={}){const t=M("push","update","pop","popWithKey"),n=M("fixed","improved"),s=M("Sizes","Weights"),o=M("Child"),r=M("Tags","default"),i=P(e=>e.defaultProps&&0==e.defaultProps.selectable),l=M("defaultRules","parse");if(!(i&&t&&n&&s&&o&&r&&l))return;const{image:c="https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5",description:d="",changes:h=[],title:u="BandagedBD",subtitle:p=`v${a}`,footer:m}=e,g=F.React.createElement,f=[g("img",{src:c})];d&&f.push(g("p",null,l.parse(d)));for(let e=0;eg("li",null,l.parse(e))));f.push(r)}const b=function(){return g(o.Child,{grow:1,shrink:1},g(r.default,{tag:r.Tags.H4},u),g(s,{size:s.Sizes.SMALL,color:s.Colors.PRIMARY,className:n.date},p))},v=()=>{const e=P(e=>"Anchor"==e.displayName),n=M("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},r=e=>{e.preventDefault(),e.stopPropagation(),t.pop(),F.joinBD2()},i=e?g(e,{onClick:r},"Join our Discord Server."):g("a",{className:`${n.anchor} ${n.anchorUnderlineOnHover}`,onClick:r},"Join our Discord Server."),a=g(s,{size:s.Sizes.SMALL,color:s.Colors.PRIMARY},"Need support? ",i);return g(o.Child,{grow:1,shrink:1},m||a)};t.push((function(e){return g(i,Object.assign({className:n.container,selectable:!0,onScroll:e=>e,onClose:e=>e,renderHeader:b,renderFooter:v,children:f},e))}))}}j.showToast=j.suppressErrors(j.showToast,"Could not show toast.");const O=n(4);var I=new class extends O{dispatch(e,...t){this.emit(e,...t)}off(e,t){this.removeListener(e,t)}};function R(){}R.prototype.loadPlugins=function(){this.loadPluginData(),u.splice(0,0,...Y.loadPlugins());const e=Object.keys(S);for(let t=0;tt.filename==e).plugin;try{n.load&&"function"==typeof n.load&&n.load()}catch(e){h["fork-ps-1"]&&j.showContentErrors({plugins:[e]})}j.log("ContentManager",`${n.getName()} v${n.getVersion()} was loaded.`),h["fork-ps-2"]&&j.showToast(`${n.getName()} v${n.getVersion()} was loaded.`,{type:"success"}),I.dispatch("plugin-loaded",n.getName())},R.prototype.unloadPlugin=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;const n=t.plugin.getName();x[n]&&this.disablePlugin(n,!0);const s=Y.unloadContent(S[n].filename,"plugin");if(delete S[n],s)return h["fork-ps-1"]&&j.showContentErrors({plugins:[s]}),h["fork-ps-2"]&&j.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),j.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);j.log("ContentManager",`${n} was unloaded.`),h["fork-ps-2"]&&j.showToast(`${n} was unloaded.`,{type:"success"}),I.dispatch("plugin-unloaded",n)},R.prototype.delete=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;this.unloadPlugin(t.filename);const s=n(1).resolve(Y.pluginsFolder,t.filename);n(0).unlinkSync(s)},R.prototype.reloadPlugin=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return this.loadPlugin(e);const n=t.plugin.getName(),s=x[n];s&&this.stopPlugin(n,!0);const o=Y.reloadContent(S[n].filename,"plugin");if(o)return h["fork-ps-1"]&&j.showContentErrors({plugins:[o]}),h["fork-ps-2"]&&j.showToast(`${n} could not be reloaded.`,{type:"error"}),j.err("ContentManager",`${n} could not be reloaded.`,o);S[n].plugin.load&&"function"==typeof S[n].plugin.load&&S[n].plugin.load(),s&&this.startPlugin(n,!0),j.log("ContentManager",`${n} v${S[n].plugin.getVersion()} was reloaded.`),h["fork-ps-2"]&&j.showToast(`${n} v${S[n].plugin.getVersion()} was reloaded.`,{type:"success"}),I.dispatch("plugin-reloaded",n)},R.prototype.reload=function(e){return this.reloadPlugin(e)},R.prototype.edit=function(e){console.log("Edit "+e);const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;const s=n(1).resolve(Y.pluginsFolder,t.filename);console.log("Edit "+s),n(2).shell.openItem(`${s}`)},R.prototype.updatePluginList=function(){const e=Y.loadNewContent("plugin");for(const t of e.added)this.loadPlugin(t);for(const t of e.removed)this.unloadPlugin(t)},R.prototype.loadPluginData=function(){const e=ee.getSettingGroup("plugins");e&&Object.assign(x,e)},R.prototype.savePluginData=function(){ee.setSettingGroup("plugins",x)},R.prototype.newMessage=function(){const e=Object.keys(S);for(let t=0;tt.filename==e);j.log("ContentManager",`${n.name} v${n.version} was loaded.`),h["fork-ps-2"]&&j.showToast(`${n.name} v${n.version} was loaded.`,{type:"success"}),I.dispatch("theme-loaded",n.name)},q.prototype.unloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const n=t.name;D[n]&&this.disableTheme(n,!0);const s=Y.unloadContent(k[n].filename,"theme");if(delete k[n],s)return h["fork-ps-1"]&&j.showContentErrors({themes:[s]}),h["fork-ps-2"]&&j.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),j.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);j.log("ContentManager",`${n} was unloaded.`),h["fork-ps-2"]&&j.showToast(`${n} was unloaded.`,{type:"success"}),I.dispatch("theme-unloaded",n)},q.prototype.delete=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;this.unloadTheme(t.filename);const s=n(1).resolve(Y.pluginsFolder,t.filename);n(0).unlinkSync(s)},q.prototype.reloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return this.loadTheme(e);const n=t.name,s=Y.reloadContent(k[n].filename,"theme");if(D[n]&&(this.disableTheme(n,!0),this.enableTheme(n,!0)),s)return h["fork-ps-1"]&&j.showContentErrors({themes:[s]}),h["fork-ps-2"]&&j.showToast(`${n} could not be reloaded.`,{type:"error"}),j.err("ContentManager",`${n} could not be reloaded.`,s);j.log("ContentManager",`${n} v${k[n].version} was reloaded.`),h["fork-ps-2"]&&j.showToast(`${n} v${k[n].version} was reloaded.`,{type:"success"}),I.dispatch("theme-reloaded",n)},q.prototype.reload=function(e){return this.reloadTheme(e)},q.prototype.edit=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const s=n(1).resolve(Y.themesFolder,t.filename);n(2).shell.openItem(`${s}`)},q.prototype.updateThemeList=function(){const e=Y.loadNewContent("theme");for(const t of e.added)this.loadTheme(t);for(const t of e.removed)this.unloadTheme(t)},q.prototype.loadThemeData=function(){const e=ee.getSettingGroup("themes");e&&Object.assign(D,e)},q.prototype.saveThemeData=function(){ee.setSettingGroup("themes",D)};var _=new q;const W=n(1),H=n(0),G=n(5).Module;G.globalPaths.push(W.resolve(n(2).remote.app.getAppPath(),"node_modules"));class z extends Error{constructor(e){super(e),this.name="MetaError"}}const V=G._extensions[".js"],U=G._extensions[".css"]?G._extensions[".css"]:()=>null,J=/[^\S\r\n]*?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,Q=/^\\@/;var Y=new class{constructor(){this.timeCache={},this.watchers={},G._extensions[".js"]=this.getContentRequire("plugin"),G._extensions[".css"]=this.getContentRequire("theme")}get pluginsFolder(){return this._pluginsFolder||(this._pluginsFolder=H.realpathSync(W.resolve(m.dataPath+"plugins/")))}get themesFolder(){return this._themesFolder||(this._themesFolder=H.realpathSync(W.resolve(m.dataPath+"themes/")))}watchContent(e){if(this.watchers[e])return;const t="plugin"===e,n=t?this.pluginsFolder:this.themesFolder,s=t?".plugin.js":".theme.css";this.watchers[e]=H.watch(n,{persistent:!1},async(e,o)=>{if(!e||!o||!o.endsWith(s))return;await new Promise(e=>setTimeout(e,50));try{H.statSync(W.resolve(n,o))}catch(e){if("ENOENT"!==e.code)return;return delete this.timeCache[o],t?$.unloadPlugin(o):_.unloadTheme(o)}if(!H.statSync(W.resolve(n,o)).isFile())return;const r=H.statSync(W.resolve(n,o));r&&r.mtime&&r.mtime.getTime()&&"number"==typeof r.mtime.getTime()&&this.timeCache[o]!=r.mtime.getTime()&&(this.timeCache[o]=r.mtime.getTime(),"rename"==e&&(t?$.loadPlugin(o):_.loadTheme(o)),"change"==e&&(t?$.reloadPlugin(o):_.reloadTheme(o)))})}unwatchContent(e){this.watchers[e]&&(this.watchers[e].close(),delete this.watchers[e])}extractMeta(e){const t=e.split("\n")[0];if(t.includes("//META"))return this.parseOldMeta(e);if(t.includes("/**"))return this.parseNewMeta(e);throw new z("META was not found.")}parseOldMeta(e){const t=e.split("\n")[0],n=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//"));if(t.indexOf("META")<0)throw new z("META was not found.");const s=j.testJSON(n);if(!s)throw new z("META could not be parsed.");if(!s.name)throw new z("META missing name data.");return s.format="json",s}parseNewMeta(e){const t=e.split("/**",2)[1].split("*/",1)[0],n={};let s="",o="";for(const e of t.split(J))if(0!==e.length)if("@"===e.charAt(0)&&" "!==e.charAt(1)){n[s]=o;const t=e.indexOf(" ");s=e.substr(1,t-1),o=e.substr(t+1)}else o+=" "+e.replace("\\n","\n").replace(Q,"@");return n[s]=o.trim(),delete n[""],n.format="jsdoc",n}getContentRequire(e){const t="plugin"===e,n=this,s=t?V:U;return function(e,o){const r=t?n.pluginsFolder:n.themesFolder,i=W.resolve(r,W.basename(o));if(!H.existsSync(i)||o!==H.realpathSync(i))return Reflect.apply(s,this,arguments);let a=H.readFileSync(o,"utf8");a=j.stripBOM(a);const l=H.statSync(o),c=n.extractMeta(a);if(c.filename=W.basename(o),c.added=l.atimeMs,c.modified=l.mtimeMs,c.size=l.size,t||(c.css=a,"json"==c.format&&(c.css=c.css.split("\n").slice(1).join("\n")),a=`module.exports = ${JSON.stringify(c)};`),t){e._compile(a,e.filename),!j.isEmpty(e.exports)?(c.type=e.exports,e.exports=c,a=""):a+=`\nmodule.exports = ${JSON.stringify(c)};\nmodule.exports.type = ${c.exports||c.name};`}e._compile(a,o)}}makePlaceholderPlugin(e){return{plugin:{start:()=>{},getName:()=>e.name||e.filename,getAuthor:()=>"???",getDescription:()=>e.message?e.message:"This plugin was unable to be loaded. Check the author's page for updates.",getVersion:()=>"???"},name:e.name||e.filename,filename:e.filename,source:e.source?e.source:"",website:e.website?e.website:""}}loadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t,s=n?this.pluginsFolder:this.themesFolder;try{require(W.resolve(s,e))}catch(t){return{name:e,file:e,message:"Could not be compiled.",error:{message:t.message,stack:t.stack}}}const o=require(W.resolve(s,e));if(o.id=j.escapeID(o.name),n){if(!o.type)return;try{o.plugin=new o.type,delete S[o.plugin.getName()],S[o.plugin.getName()]=o}catch(t){return{name:e,file:e,message:"Could not be constructed.",error:{message:t.message,stack:t.stack}}}}else delete k[o.name],k[o.name]=o}unloadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{delete require.cache[require.resolve(W.resolve(n,e))]}catch(t){return{name:e,file:e,message:"Could not be unloaded.",error:{message:t.message,stack:t.stack}}}}isLoaded(e,t){const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{require.cache[require.resolve(W.resolve(n,e))]}catch(e){return!1}return!0}reloadContent(e,t){const n=this.unloadContent(e,t);return n||this.loadContent(e,t)}loadNewContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,o=H.readdirSync(s),r=Object.values(t?S:k),i=r.filter(e=>!o.includes(e.filename)).map(e=>t?e.plugin.getName():e.name);return{added:o.filter(e=>!r.find(t=>t.filename==e)&&e.endsWith(n)&&H.statSync(W.resolve(s,e)).isFile()),removed:i}}loadAllContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,o=[],r=H.readdirSync(s);for(const t of r){if(!H.statSync(W.resolve(s,t)).isFile()||!t.endsWith(n))continue;const r=this.loadContent(t,e);r&&o.push(r)}return o}loadPlugins(){return this.loadAllContent("plugin")}loadThemes(){return this.loadAllContent("theme")}};const Z=n(0),K=n(1),X=DiscordNative.globals.releaseChannel;var ee=new class{constructor(){this.data={settings:{stable:{},canary:{},ptb:{}}},this.pluginData={}}initialize(){try{Z.existsSync(this.BDFile)||Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4));const e=require(this.BDFile);if(e.hasOwnProperty("settings")&&(this.data=e),!Z.existsSync(this.settingsFile))return;let t=require(this.settingsFile);Z.unlinkSync(this.settingsFile),t=t.hasOwnProperty("settings")?Object.assign({stable:{},canary:{},ptb:{}},{[X]:t}):Object.assign({stable:{},canary:{},ptb:{}},t),this.setBDData("settings",t)}catch(e){console.error(e),j.alert("Corrupt Storage","The bd storage has somehow become corrupt. You may either try to salvage the file or delete it then reload.")}}get BDFile(){return this._BDFile||(this._BDFile=K.resolve(m.dataPath,"bdstorage.json"))}get settingsFile(){return this._settingsFile||(this._settingsFile=K.resolve(m.dataPath,"bdsettings.json"))}getPluginFile(e){return K.resolve(Y.pluginsFolder,e+".config.json")}getSettingGroup(e){return this.data.settings[X][e]||null}setSettingGroup(e,t){this.data.settings[X][e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getBDData(e){return this.data[e]||""}setBDData(e,t){this.data[e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:Z.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(Z.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,n){void 0!==n&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=n,Z.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4)))}deletePluginData(e,t){void 0===this.pluginData[e]&&(this.pluginData[e]={}),delete this.pluginData[e][t],Z.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};function te(){this.switchHandler=this.switchHandler.bind(this),this.favContext=this.favContext.bind(this)}const ne=function(e){const t=e.target.getAttribute("title"),n=document.querySelector(`.${F.slateEditorClasses.slateTextArea.split(" ")[0]}`);if(n){const e=F.getInternalInstance(n),s=j.getNestedProp(e,"memoizedProps.children.props.editor.insertText");s&&s(` ${t} `)}else{const e=j.getTextArea();j.insertText(e," "==e.value.slice(-1)?e.value+t:e.value+" "+t)}},se=function(e,t,{click:n=ne,contextmenu:s}={}){const o=A.createElement(`
${e}
`);return n&&o.addEventListener("click",n),s&&o.addEventListener("contextmenu",s),o};te.prototype.init=function(){this.initialized=!0,this.favoriteEmotes={};const e=ee.getBDData("bdfavemotes");""!==e&&null!==e&&(this.favoriteEmotes=JSON.parse(atob(e))),this.qmeHeader=A.createElement('
'),this.twitchButton=A.createElement(''),this.favoriteButton=A.createElement(''),this.emojiButton=A.createElement('\n
\n
\n \n `);n.querySelector(".footer button").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),n.querySelector(".bd-backdrop").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),A.query("#app-mount").append(n)}static showContentErrors({plugins:e=[],themes:t=[]}){if(!e||!t)return;if(!e.length&&!t.length)return;const n=A.createElement('
\n
\n \n
');function s(e){const t=A.createElement('
');for(const n of e){const e=A.createElement(`
\n
${n.name?n.name:n.file}
\n
${n.message}
\n \n
`);t.append(e),n.error&&e.querySelectorAll("a").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),j.err("ContentManager",`Error details for ${n.name?n.name:n.file}.`,n.error)}))}return t}const o=[s(e),s(t)];n.querySelectorAll(".tab-bar-item").forEach(e=>e.addEventListener("click",e=>{e.preventDefault();const t=n.querySelector(".tab-bar-item.selected");t&&A.removeClass(t,"selected"),A.addClass(e.target,"selected");const s=n.querySelector(".scroller");s.innerHTML="",s.append(o[A.index(e.target)])})),n.querySelector(".footer button").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),n.querySelector(".bd-backdrop").on("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),A.query("#app-mount").append(n),e.length?n.querySelector(".tab-bar-item").click():n.querySelectorAll(".tab-bar-item")[1].click()}static showChangelogModal(e={}){const t=M("push","update","pop","popWithKey"),n=M("fixed","improved"),s=M("Sizes","Weights"),o=M("Child"),r=M("Tags","default"),i=P(e=>e.defaultProps&&0==e.defaultProps.selectable),l=M("defaultRules","parse");if(!(i&&t&&n&&s&&o&&r&&l))return;const{image:c="https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5",description:d="",changes:h=[],title:u="BandagedBD",subtitle:p=`v${a}`,footer:m}=e,g=F.React.createElement,f=[g("img",{src:c})];d&&f.push(g("p",null,l.parse(d)));for(let e=0;eg("li",null,l.parse(e))));f.push(r)}const b=function(){return g(o.Child,{grow:1,shrink:1},g(r.default,{tag:r.Tags.H4},u),g(s,{size:s.Sizes.SMALL,color:s.Colors.PRIMARY,className:n.date},p))},v=()=>{const e=P(e=>"Anchor"==e.displayName),n=M("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},r=e=>{e.preventDefault(),e.stopPropagation(),t.pop(),F.joinBD2()},i=e?g(e,{onClick:r},"Join our Discord Server."):g("a",{className:`${n.anchor} ${n.anchorUnderlineOnHover}`,onClick:r},"Join our Discord Server."),a=g(s,{size:s.Sizes.SMALL,color:s.Colors.PRIMARY},"Need support? ",i);return g(o.Child,{grow:1,shrink:1},m||a)};t.push((function(e){return g(i,Object.assign({className:n.container,selectable:!0,onScroll:e=>e,onClose:e=>e,renderHeader:b,renderFooter:v,children:f},e))}))}}j.showToast=j.suppressErrors(j.showToast,"Could not show toast.");const O=n(4);var I=new class extends O{dispatch(e,...t){this.emit(e,...t)}off(e,t){this.removeListener(e,t)}};function R(){}R.prototype.loadPlugins=function(){this.loadPluginData(),u.splice(0,0,...Y.loadPlugins());const e=Object.keys(S);for(let t=0;tt.filename==e).plugin;try{n.load&&"function"==typeof n.load&&n.load()}catch(e){h["fork-ps-1"]&&j.showContentErrors({plugins:[e]})}j.log("ContentManager",`${n.getName()} v${n.getVersion()} was loaded.`),h["fork-ps-2"]&&j.showToast(`${n.getName()} v${n.getVersion()} was loaded.`,{type:"success"}),I.dispatch("plugin-loaded",n.getName())},R.prototype.unloadPlugin=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;const n=t.plugin.getName();x[n]&&this.disablePlugin(n,!0);const s=Y.unloadContent(S[n].filename,"plugin");if(delete S[n],s)return h["fork-ps-1"]&&j.showContentErrors({plugins:[s]}),h["fork-ps-2"]&&j.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),j.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);j.log("ContentManager",`${n} was unloaded.`),h["fork-ps-2"]&&j.showToast(`${n} was unloaded.`,{type:"success"}),I.dispatch("plugin-unloaded",n)},R.prototype.delete=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;this.unloadPlugin(t.filename);const s=n(1).resolve(Y.pluginsFolder,t.filename);n(0).unlinkSync(s)},R.prototype.reloadPlugin=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return this.loadPlugin(e);const n=t.plugin.getName(),s=x[n];s&&this.stopPlugin(n,!0);const o=Y.reloadContent(S[n].filename,"plugin");if(o)return h["fork-ps-1"]&&j.showContentErrors({plugins:[o]}),h["fork-ps-2"]&&j.showToast(`${n} could not be reloaded.`,{type:"error"}),j.err("ContentManager",`${n} could not be reloaded.`,o);S[n].plugin.load&&"function"==typeof S[n].plugin.load&&S[n].plugin.load(),s&&this.startPlugin(n,!0),j.log("ContentManager",`${n} v${S[n].plugin.getVersion()} was reloaded.`),h["fork-ps-2"]&&j.showToast(`${n} v${S[n].plugin.getVersion()} was reloaded.`,{type:"success"}),I.dispatch("plugin-reloaded",n)},R.prototype.reload=function(e){return this.reloadPlugin(e)},R.prototype.edit=function(e){console.log("Edit "+e);const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;const s=n(1).resolve(Y.pluginsFolder,t.filename);console.log("Edit "+s),n(2).shell.openItem(`${s}`)},R.prototype.updatePluginList=function(){const e=Y.loadNewContent("plugin");for(const t of e.added)this.loadPlugin(t);for(const t of e.removed)this.unloadPlugin(t)},R.prototype.loadPluginData=function(){const e=ee.getSettingGroup("plugins");e&&Object.assign(x,e)},R.prototype.savePluginData=function(){ee.setSettingGroup("plugins",x)},R.prototype.newMessage=function(){const e=Object.keys(S);for(let t=0;tt.filename==e);j.log("ContentManager",`${n.name} v${n.version} was loaded.`),h["fork-ps-2"]&&j.showToast(`${n.name} v${n.version} was loaded.`,{type:"success"}),I.dispatch("theme-loaded",n.name)},q.prototype.unloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const n=t.name;D[n]&&this.disableTheme(n,!0);const s=Y.unloadContent(k[n].filename,"theme");if(delete k[n],s)return h["fork-ps-1"]&&j.showContentErrors({themes:[s]}),h["fork-ps-2"]&&j.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),j.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);j.log("ContentManager",`${n} was unloaded.`),h["fork-ps-2"]&&j.showToast(`${n} was unloaded.`,{type:"success"}),I.dispatch("theme-unloaded",n)},q.prototype.delete=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;this.unloadTheme(t.filename);const s=n(1).resolve(Y.pluginsFolder,t.filename);n(0).unlinkSync(s)},q.prototype.reloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return this.loadTheme(e);const n=t.name,s=Y.reloadContent(k[n].filename,"theme");if(D[n]&&(this.disableTheme(n,!0),this.enableTheme(n,!0)),s)return h["fork-ps-1"]&&j.showContentErrors({themes:[s]}),h["fork-ps-2"]&&j.showToast(`${n} could not be reloaded.`,{type:"error"}),j.err("ContentManager",`${n} could not be reloaded.`,s);j.log("ContentManager",`${n} v${k[n].version} was reloaded.`),h["fork-ps-2"]&&j.showToast(`${n} v${k[n].version} was reloaded.`,{type:"success"}),I.dispatch("theme-reloaded",n)},q.prototype.reload=function(e){return this.reloadTheme(e)},q.prototype.edit=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const s=n(1).resolve(Y.themesFolder,t.filename);n(2).shell.openItem(`${s}`)},q.prototype.updateThemeList=function(){const e=Y.loadNewContent("theme");for(const t of e.added)this.loadTheme(t);for(const t of e.removed)this.unloadTheme(t)},q.prototype.loadThemeData=function(){const e=ee.getSettingGroup("themes");e&&Object.assign(D,e)},q.prototype.saveThemeData=function(){ee.setSettingGroup("themes",D)};var _=new q;const W=n(1),H=n(0),G=n(5).Module;G.globalPaths.push(W.resolve(n(2).remote.app.getAppPath(),"node_modules"));class z extends Error{constructor(e){super(e),this.name="MetaError"}}const V=G._extensions[".js"],U=G._extensions[".css"]?G._extensions[".css"]:()=>null,J=/[^\S\r\n]*?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,Q=/^\\@/;var Y=new class{constructor(){this.timeCache={},this.watchers={},G._extensions[".js"]=this.getContentRequire("plugin"),G._extensions[".css"]=this.getContentRequire("theme")}get pluginsFolder(){return this._pluginsFolder||(this._pluginsFolder=H.realpathSync(W.resolve(m.dataPath+"plugins/")))}get themesFolder(){return this._themesFolder||(this._themesFolder=H.realpathSync(W.resolve(m.dataPath+"themes/")))}watchContent(e){if(this.watchers[e])return;const t="plugin"===e,n=t?this.pluginsFolder:this.themesFolder,s=t?".plugin.js":".theme.css";this.watchers[e]=H.watch(n,{persistent:!1},async(e,o)=>{if(!e||!o||!o.endsWith(s))return;await new Promise(e=>setTimeout(e,50));try{H.statSync(W.resolve(n,o))}catch(e){if("ENOENT"!==e.code)return;return delete this.timeCache[o],t?$.unloadPlugin(o):_.unloadTheme(o)}if(!H.statSync(W.resolve(n,o)).isFile())return;const r=H.statSync(W.resolve(n,o));r&&r.mtime&&r.mtime.getTime()&&"number"==typeof r.mtime.getTime()&&this.timeCache[o]!=r.mtime.getTime()&&(this.timeCache[o]=r.mtime.getTime(),"rename"==e&&(t?$.loadPlugin(o):_.loadTheme(o)),"change"==e&&(t?$.reloadPlugin(o):_.reloadTheme(o)))})}unwatchContent(e){this.watchers[e]&&(this.watchers[e].close(),delete this.watchers[e])}extractMeta(e){const t=e.split("\n")[0];if(t.includes("//META"))return this.parseOldMeta(e);if(t.includes("/**"))return this.parseNewMeta(e);throw new z("META was not found.")}parseOldMeta(e){const t=e.split("\n")[0],n=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//"));if(t.indexOf("META")<0)throw new z("META was not found.");const s=j.testJSON(n);if(!s)throw new z("META could not be parsed.");if(!s.name)throw new z("META missing name data.");return s.format="json",s}parseNewMeta(e){const t=e.split("/**",2)[1].split("*/",1)[0],n={};let s="",o="";for(const e of t.split(J))if(0!==e.length)if("@"===e.charAt(0)&&" "!==e.charAt(1)){n[s]=o;const t=e.indexOf(" ");s=e.substr(1,t-1),o=e.substr(t+1)}else o+=" "+e.replace("\\n","\n").replace(Q,"@");return n[s]=o.trim(),delete n[""],n.format="jsdoc",n}getContentRequire(e){const t="plugin"===e,n=this,s=t?V:U;return function(e,o){const r=t?n.pluginsFolder:n.themesFolder,i=W.resolve(r,W.basename(o));if(!H.existsSync(i)||o!==H.realpathSync(i))return Reflect.apply(s,this,arguments);let a=H.readFileSync(o,"utf8");a=j.stripBOM(a);const l=H.statSync(o),c=n.extractMeta(a);if(c.filename=W.basename(o),c.added=l.atimeMs,c.modified=l.mtimeMs,c.size=l.size,t||(c.css=a,"json"==c.format&&(c.css=c.css.split("\n").slice(1).join("\n")),a=`module.exports = ${JSON.stringify(c)};`),t){e._compile(a,e.filename),!j.isEmpty(e.exports)?(c.type=e.exports,e.exports=c,a=""):a+=`\nmodule.exports = ${JSON.stringify(c)};\nmodule.exports.type = ${c.exports||c.name};`}e._compile(a,o)}}makePlaceholderPlugin(e){return{plugin:{start:()=>{},getName:()=>e.name||e.filename,getAuthor:()=>"???",getDescription:()=>e.message?e.message:"This plugin was unable to be loaded. Check the author's page for updates.",getVersion:()=>"???"},name:e.name||e.filename,filename:e.filename,source:e.source?e.source:"",website:e.website?e.website:""}}loadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t,s=n?this.pluginsFolder:this.themesFolder;try{require(W.resolve(s,e))}catch(t){return{name:e,file:e,message:"Could not be compiled.",error:{message:t.message,stack:t.stack}}}const o=require(W.resolve(s,e));if(o.id=j.escapeID(o.name),n){if(!o.type)return;try{o.plugin=new o.type,delete S[o.plugin.getName()],S[o.plugin.getName()]=o}catch(t){return{name:e,file:e,message:"Could not be constructed.",error:{message:t.message,stack:t.stack}}}}else delete k[o.name],k[o.name]=o}unloadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{delete require.cache[require.resolve(W.resolve(n,e))]}catch(t){return{name:e,file:e,message:"Could not be unloaded.",error:{message:t.message,stack:t.stack}}}}isLoaded(e,t){const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{require.cache[require.resolve(W.resolve(n,e))]}catch(e){return!1}return!0}reloadContent(e,t){const n=this.unloadContent(e,t);return n||this.loadContent(e,t)}loadNewContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,o=H.readdirSync(s),r=Object.values(t?S:k),i=r.filter(e=>!o.includes(e.filename)).map(e=>t?e.plugin.getName():e.name);return{added:o.filter(e=>!r.find(t=>t.filename==e)&&e.endsWith(n)&&H.statSync(W.resolve(s,e)).isFile()),removed:i}}loadAllContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,o=[],r=H.readdirSync(s);for(const t of r){if(!H.statSync(W.resolve(s,t)).isFile()||!t.endsWith(n))continue;const r=this.loadContent(t,e);r&&o.push(r)}return o}loadPlugins(){return this.loadAllContent("plugin")}loadThemes(){return this.loadAllContent("theme")}};const Z=n(0),K=n(1),X=DiscordNative.globals.releaseChannel;var ee=new class{constructor(){this.data={settings:{stable:{},canary:{},ptb:{}}},this.pluginData={}}initialize(){try{Z.existsSync(this.BDFile)||Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4));const e=require(this.BDFile);if(e.hasOwnProperty("settings")&&(this.data=e),!Z.existsSync(this.settingsFile))return;let t=require(this.settingsFile);Z.unlinkSync(this.settingsFile),t=t.hasOwnProperty("settings")?Object.assign({stable:{},canary:{},ptb:{}},{[X]:t}):Object.assign({stable:{},canary:{},ptb:{}},t),this.setBDData("settings",t)}catch(e){console.error(e),j.alert("Corrupt Storage","The bd storage has somehow become corrupt. You may either try to salvage the file or delete it then reload.")}}get BDFile(){return this._BDFile||(this._BDFile=K.resolve(m.dataPath,"bdstorage.json"))}get settingsFile(){return this._settingsFile||(this._settingsFile=K.resolve(m.dataPath,"bdsettings.json"))}getPluginFile(e){return K.resolve(Y.pluginsFolder,e+".config.json")}getSettingGroup(e){return this.data.settings[X][e]||null}setSettingGroup(e,t){this.data.settings[X][e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getBDData(e){return this.data[e]||""}setBDData(e,t){this.data[e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:Z.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(Z.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,n){void 0!==n&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=n,Z.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4)))}deletePluginData(e,t){void 0===this.pluginData[e]&&(this.pluginData[e]={}),delete this.pluginData[e][t],Z.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};function te(){this.switchHandler=this.switchHandler.bind(this),this.favContext=this.favContext.bind(this)}const ne=function(e){const t=e.target.getAttribute("title"),n=document.querySelector(`.${F.slateEditorClasses.slateTextArea.split(" ")[0]}`);if(n){const e=F.getInternalInstance(n),s=j.getNestedProp(e,"memoizedProps.children.props.editor.insertText");s&&s(` ${t} `)}else{const e=j.getTextArea();j.insertText(e," "==e.value.slice(-1)?e.value+t:e.value+" "+t)}},se=function(e,t,{click:n=ne,contextmenu:s}={}){const o=A.createElement(`
${e}
`);return n&&o.addEventListener("click",n),s&&o.addEventListener("contextmenu",s),o};te.prototype.init=function(){this.initialized=!0,this.favoriteEmotes={};const e=ee.getBDData("bdfavemotes");""!==e&&null!==e&&(this.favoriteEmotes=JSON.parse(atob(e))),this.qmeHeader=A.createElement('
'),this.twitchButton=A.createElement(''),this.favoriteButton=A.createElement(''),this.emojiButton=A.createElement('