BetterDiscordApp-rauenzi/js/main.min.js

1 line
104 KiB
JavaScript

var Core=function(e){var t={};function s(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,s),o.l=!0,o.exports}return s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=6)}([function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("electron")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("module")},function(e,t){e.exports=require("request")},function(e,t,s){"use strict";s.r(t);var n={};s.r(n),s.d(n,"Menu",function(){return ue}),s.d(n,"Card",function(){return de}),s.d(n,"Layer",function(){return he});var o={"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"},"Coloured Text":{id:"bda-gs-7",info:"Make text colour the same as role colour",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"},"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:!0,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"}},a={"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},r={local:!1,localServer:"//localhost:8080",minified:!0,version:"0.3.0",branch:"master",repo:"rauenzi",minSupportedVersion:"0.3.0",bbdVersion:"0.2.17"},i={},c={},l={},d={},u=[];class h{static get screenWidth(){return Math.max(document.documentElement.clientWidth,window.innerWidth||0)}static get screenHeight(){return Math.max(document.documentElement.clientHeight,window.innerHeight||0)}static stripBOM(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}static getTextArea(){return $(".channelTextArea-1LDbYG textarea")}static getInternalInstance(e){return e[Object.keys(e).find(e=>e.startsWith("__reactInternalInstance"))]||null}static insertText(e,t){e.focus(),e.selectionStart=0,e.selectionEnd=e.value.length,document.execCommand("insertText",!1,t)}static injectCss(e){$("<link/>",{type:"text/css",rel:"stylesheet",href:e}).appendTo($("head"))}static injectJs(e){return new Promise(t=>{$("<script/>",{type:"text/javascript",src:e,onload:t}).appendTo($("body"))})}static escapeID(e){return e.replace(/^[^a-z]+|[^\w-]+/gi,"")}static log(e,t){console.log(`%c[BandagedBD]%c [${e}]%c ${t}`,"color: #3a71c1; font-weight: 700;","color: #3a71c1;","")}static warn(e,t){console.warn(`%c[BandagedBD]%c [${e}]%c ${t}`,"color: #E8A400; font-weight: 700;","color: #E8A400;","")}static err(e,t,s){console.log(`%c[BandagedBD]%c [${e}]%c ${t}`,"color: red; font-weight: 700;","color: red;",""),s&&(console.groupCollapsed("%cError: "+s.message,"color: red;"),console.error(s.stack),console.groupEnd())}static escape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}static testJSON(e){try{return JSON.parse(e),!0}catch(e){return!1}}static suppressErrors(e,t){return(...s)=>{try{return e(...s)}catch(e){this.err("SuppressedError","Error occurred in "+t,e)}}}static monkeyPatch(e,t,s){const{before:n,after:o,instead:a,once:r=!1,silent:i=!1,force:c=!1}=s,l=s.displayName||e.displayName||e.name||e.constructor.displayName||e.constructor.name;if(i||console.log("patch",t,"of",l),!e[t]){if(!c)return console.error(t,"does not exist for",l);e[t]=function(){}}const d=e[t],u=()=>{i||console.log("unpatch",t,"of",l),e[t]=d};return e[t]=function(){const s={thisObject:this,methodArguments:arguments,cancelPatch:u,originalMethod:d,callOriginalMethod:()=>s.returnValue=s.originalMethod.apply(s.thisObject,s.methodArguments)};if(a){const n=h.suppressErrors(a,"`instead` callback of "+e[t].displayName)(s);void 0!==n&&(s.returnValue=n)}else n&&h.suppressErrors(n,"`before` callback of "+e[t].displayName)(s),s.callOriginalMethod(),o&&h.suppressErrors(o,"`after` callback of "+e[t].displayName)(s);return r&&u(),s.returnValue},e[t].__monkeyPatched=!0,e[t].__originalMethod||(e[t].__originalMethod=d),e[t].displayName="patched "+(e[t].displayName||t),u}static onRemoved(e,t){const s=new MutationObserver(n=>{for(let o=0;o<n.length;o++){const a=n[o],r=Array.from(a.removedNodes),i=r.indexOf(e)>-1,c=r.some(t=>t.contains(e));(i||c)&&(s.disconnect(),t())}});s.observe(document.body,{subtree:!0,childList:!0})}static memoizeObject(e){const t=new Proxy(e,{get:function(e,t){if(e.hasOwnProperty(t)){if(Object.getOwnPropertyDescriptor(e,t).get){let s=e[t];delete e[t],e[t]=s}return e[t]}},set:function(e,t,s){return e.hasOwnProperty(t)?this.err("MemoizedObject","Trying to overwrite existing property"):(e[t]=s,e[t])}});return Object.defineProperty(t,"hasOwnProperty",{value:function(e){return void 0!==this[e]}}),t}}const p=s(0),m=s(2),g=DiscordNative.globals.releaseChannel;var f=new class{constructor(){this.data={settings:{stable:{},canary:{},ptb:{}}},this.pluginData={}}initialize(){try{p.existsSync(this.BDFile)||p.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4));const e=require(this.BDFile);if(e.hasOwnProperty("settings")&&(this.data=e),!p.existsSync(this.settingsFile))return;let t=require(this.settingsFile);p.unlinkSync(this.settingsFile),t=t.hasOwnProperty("settings")?Object.assign({stable:{},canary:{},ptb:{}},{[g]:t}):Object.assign({stable:{},canary:{},ptb:{}},t),this.setBDData("settings",t)}catch(e){v.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=m.resolve(r.dataPath,"bdstorage.json"))}get settingsFile(){return this._settingsFile||(this._settingsFile=m.resolve(r.dataPath,"bdsettings.json"))}getPluginFile(e){return m.resolve(r.dataPath,"plugins",e+".config.json")}getSettingGroup(e){return this.data.settings[g][e]||null}setSettingGroup(e,t){this.data.settings[g][e]=t,p.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getBDData(e){return this.data[e]||""}setBDData(e,t){this.data[e]=t,p.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:p.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(p.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,s){void 0!==s&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=s,p.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],p.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};const b={get React(){return y.react},get ReactDOM(){return y.reactDom},get WindowConfigFile(){if(this._windowConfigFile)return this._windowConfigFile;const e=s(1).remote.app.getAppPath(),t=s(2),n=t.resolve(e,"..","app","config.json"),o=s(0);return o.existsSync(t.resolve(e,"..","app"))?(o.existsSync(n)||o.writeFileSync(n,JSON.stringify({})),this._windowConfigFile=n):this._windowConfigFile=null},getAllWindowPreferences:function(){return"win32"!==r.os&&"darwin"!==r.os||!this.WindowConfigFile?{}:require(this.WindowConfigFile)},getWindowPreference:function(e){if(("win32"===r.os||"darwin"===r.os)&&this.WindowConfigFile)return this.getAllWindowPreferences()[e]},setWindowPreference:function(e,t){if("win32"!==r.os&&"darwin"!==r.os||!this.WindowConfigFile)return;const n=s(0),o=this.getAllWindowPreferences();o[e]=t,delete s.c[this.WindowConfigFile],n.writeFileSync(this.WindowConfigFile,JSON.stringify(o,null,4))},injectCSS:function(e,t){$("head").append($("<style>",{id:h.escapeID(e),text:t}))},clearCSS:function(e){$("#"+h.escapeID(e)).remove()},linkJS:function(e,t){$("head").append($("<script>",{id:h.escapeID(e),src:t,type:"text/javascript"}))},unlinkJS:function(e){$("#"+h.escapeID(e)).remove()},getPlugin:function(e){return d.hasOwnProperty(e)?d[e].plugin:null},getCore:function(){return we},alert:function(e,t){const s=b.findModuleByProps("push","update","pop","popWithKey"),n=b.findModuleByPrototypes("handleCancel","handleSubmit","handleMinorConfirm");if(!s||!n)return we.alert(e,t);s.push(function(s){return b.React.createElement(n,Object.assign({title:e,body:t},s))})},showConfirmationModal:function(e,t,s={}){const n=b.findModuleByProps("push","update","pop","popWithKey"),o=b.findModuleByProps("Sizes","Weights"),a=b.findModule(e=>e.defaultProps&&e.key&&"confirm-modal"==e.key());if(!n||!a||!o)return we.alert(e,t);const{onConfirm:r,onCancel:i,confirmText:c,cancelText:l,danger:d=!1}=s;"string"==typeof t?t=o({color:o.Colors.PRIMARY,children:[t]}):Array.isArray(t)&&(t=o({color:o.Colors.PRIMARY,children:t})),t=[t];const u=()=>{};n.push(function(s){return b.React.createElement(a,Object.assign({header:e,children:t,red:d,confirmText:c||"Okay",cancelText:l||"Cancel",onConfirm:r||u,onCancel:i||u},s))})},showToast:function(e,t={}){we.showToast(e,t)},findModule:function(e){return y.WebpackModules.find(e)},findAllModules:function(e){return y.WebpackModules.findAll(e)},findModuleByProps:function(...e){return y.WebpackModules.findByUniqueProperties(e)},findModuleByPrototypes:function(...e){return y.WebpackModules.findByPrototypes(e)},findModuleByDisplayName:function(e){return y.WebpackModules.findByDisplayName(e)},getInternalInstance:function(e){if(e instanceof window.jQuery||e instanceof Element)return e instanceof jQuery&&(e=e[0]),y.getInternalInstance(e)},loadData:function(e,t){return f.getPluginData(e,t)}};b.getData=b.loadData,b.saveData=function(e,t,s){return f.setPluginData(e,t,s)},b.setData=b.saveData,b.deleteData=function(e,t){return f.deletePluginData(e,t)},b.monkeyPatch=function(e,t,s){return h.monkeyPatch(e,t,s)},b.onRemoved=function(e,t){return h.onRemoved(e,t)},b.suppressErrors=function(e,t){return h.suppressErrors(e,t)},b.testJSON=function(e){return h.testJSON(e)},b.isPluginEnabled=function(e){return!!i[e]},b.isThemeEnabled=function(e){return!!c[e]},b.isSettingEnabled=function(e){return!!a[e]},b.getBDData=function(e){return f.getBDData(e)},b.setBDData=function(e,t){return f.setBDData(e,t)};var v=b,y=new class{constructor(){this.editorDetached=!1,this.WebpackModules=(()=>{const e=webpackJsonp.push([[],{__extra_id__:(e,t,s)=>e.exports=s},[["__extra_id__"]]]);delete e.m.__extra_id__,delete e.c.__extra_id__;const t=t=>{for(const s in e.c)if(e.c.hasOwnProperty(s)){const n=e.c[s].exports;if(n&&n.__esModule&&n.default&&t(n.default))return n.default;if(n&&t(n))return n}return console.warn("Cannot find loaded module in cache"),null};return{find:t,findAll:t=>{const s=[];for(const n in e.c)if(e.c.hasOwnProperty(n)){const o=e.c[n].exports;o&&o.__esModule&&o.default&&t(o.default)?s.push(o.default):o&&t(o)&&s.push(o)}return s},findByUniqueProperties:e=>t(t=>e.every(e=>void 0!==t[e])),findByPrototypes:e=>t(t=>t.prototype&&e.every(e=>void 0!==t.prototype[e])),findByDisplayName:e=>t(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(){v.suppressErrors(this.patchGuildPills.bind(this),"BD Guild Pills Patch")(),v.suppressErrors(this.patchGuildListItems.bind(this),"BD Guild List Items Patch")(),v.suppressErrors(this.patchGuildSeparator.bind(this),"BD Guild Separator Patch")()}get react(){return this.internal.react}get reactDom(){return this.internal.reactDom}get reactComponent(){return this.internal.react.Component}get messageClasses(){return this.WebpackModules.findByUniqueProperties(["message","containerCozy"])}get guildClasses(){const e=this.WebpackModules.findByUniqueProperties(["wrapper","unreadMentionsBar"]),t=this.WebpackModules.findByUniqueProperties(["guildsError","selected"]),s=this.WebpackModules.findByUniqueProperties(["blobContainer"]);return Object.assign({},e,t,s)}get MessageContentComponent(){return this.WebpackModules.find(e=>e.defaultProps&&e.defaultProps.hasOwnProperty("disableButtons"))}get TimeFormatter(){return this.WebpackModules.findByUniqueProperties(["dateFormat"])}get TooltipWrapper(){return this.WebpackModules.findByDisplayName("TooltipDeprecated")}get NativeModule(){return this.WebpackModules.findByUniqueProperties(["setBadge"])}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()))}parseSettings(e){return Object.keys(o).reduce((t,s)=>{const n=o[s];return n.cat===e&&n.implemented&&!n.hidden&&(n.text=s,t.push(n)),t},[])}patchGuildListItems(){if(this.guildListItemsPatch)return;const e=this.guildClasses.listItem.split(" ")[0],t=this.guildClasses.blobContainer.split(" ")[0],s=v.getInternalInstance(document.querySelector(`.${e} .${t}`).parentElement).return.type;s&&(this.guildListItemsPatch=v.monkeyPatch(s.prototype,"render",{after:e=>{const t=e.returnValue,s=e.thisObject.props;return t.props.className+=" bd-guild",s.unread&&(t.props.className+=" bd-unread"),s.selected&&(t.props.className+=" bd-selected"),s.audio&&(t.props.className+=" bd-audio"),s.video&&(t.props.className+=" bd-video"),s.badge&&(t.props.className+=" bd-badge"),s.animatable&&(t.props.className+=" bd-animatable"),t}}))}patchGuildPills(){if(this.guildPillPatch)return;const e=v.findModule(e=>e.default&&e.default.toString&&e.default.toString().includes("translate3d"));e&&(this.guildPillPatch=v.monkeyPatch(e,"default",{after:e=>{const t=e.methodArguments[0];return t.unread&&(e.returnValue.props.className+=" bd-unread"),t.selected&&(e.returnValue.props.className+=" bd-selected"),t.hovered&&(e.returnValue.props.className+=" bd-hovered"),e.returnValue}}))}patchGuildSeparator(){if(this.guildSeparatorPatch)return;const e=v.findModuleByDisplayName("Guilds"),t=v.findModuleByProps("renderListItem");if(!t||!e)return;const s=function(){const e=t.Separator(...arguments);return e.props.className+=" bd-guild-separator",e};this.guildSeparatorPatch=v.monkeyPatch(e.prototype,"render",{after:e=>{e.returnValue.props.children[1].props.children[3].type=s}})}};const w=new RegExp("^(?!da-)((?:[A-Za-z]|[0-9]|-)+)-(?:[A-Za-z]|[0-9]|-|_){6}$");var C=new class{get id(){return"fork-ps-4"}get name(){return"ClassNormalizer"}stop(){this.hasPatched&&(this.unpatchClassModules(v.findAllModules(this.moduleFilter.bind(this))),this.revertElement(document.querySelector("#app-mount")),this.hasPatched=!1)}start(){this.hasPatched||(this.patchClassModules(v.findAllModules(this.moduleFilter.bind(this))),this.normalizeElement(document.querySelector("#app-mount")),this.hasPatched=!0)}patchClassModules(e){for(const t of e)this.patchClassModule("da",t)}unpatchClassModules(e){for(const t of e)this.unpatchClassModule("da",t)}shouldIgnore(e){return!isNaN(e)||(!!(e.endsWith("px")||e.endsWith("ch")||e.endsWith("em")||e.endsWith("ms"))||(!!e.startsWith("layerContainer-")||(!(!e.startsWith("#")||7!=e.length&&4!=e.length)||!(!e.includes("calc(")&&!e.includes("rgba")))))}moduleFilter(e){if("object"!=typeof e||Array.isArray(e))return!1;if(e.__esModule)return!1;if(!Object.keys(e).length)return!1;for(const t in e){const s=e[t];if("string"!=typeof s)return!1;if(!this.shouldIgnore(s)){if(1===s.split("-").length)return!1;if(!w.test(s.split(" ")[0]))return!1}}return!0}patchClassModule(e,t){for(const s in t){const n=t[s];if(this.shouldIgnore(n))continue;const o=n.split(" ");for(const n of o){const o=n.match(w)[1];if(!o)continue;const a=o.split("-").map((e,t)=>t?e[0].toUpperCase()+e.slice(1):e).join("");t[s]+=` ${e}-${a}`}}}unpatchClassModule(e,t){for(const s in t){const n=t[s];if(this.shouldIgnore(n))continue;let o="";const a=n.split(" ");for(const t of a)t.startsWith(`${e}-`)||(o+=` ${t}`);t[s]=o.trim()}}normalizeElement(e){if(!(e instanceof Element))return;const t=e.classList;for(let s=0,n=t.length;s<n;s++){if(!w.test(t[s]))continue;const n=t[s].match(w)[1].split("-").map((e,t)=>t?e[0].toUpperCase()+e.slice(1):e).join("");e.classList.add(`da-${n}`)}for(const t of e.children)this.normalizeElement(t)}revertElement(e){if(!(e instanceof Element))return;e.children&&e.children.length&&this.revertElement(e.children[0]),e.nextElementSibling&&this.revertElement(e.nextElementSibling);const t=e.classList,s=[];for(let e=0;e<t.length;e++)t[e].startsWith("da-")&&s.push(t[e]);e.classList.remove(...s)}};const k=s(3);var E=new class extends k{dispatch(e,...t){this.emit(e,...t)}off(e,t){this.removeListener(e,t)}};function x(){}x.prototype.loadPlugins=function(){this.loadPluginData();const e=B.loadPlugins(),t=Object.keys(d);for(let s=0;s<t.length;s++){let n,o;try{o=(n=d[t[s]].plugin).getName(),n.load&&"function"==typeof n.load&&n.load()}catch(n){i[o]=!1,h.err("Plugins",o+" could not be loaded.",n),e.push({name:o,file:d[t[s]].filename,message:"load() could not be fired.",error:{message:n.message,stack:n.stack}});continue}if(i[o]||(i[o]=!1),i[o])try{n.start(),a["fork-ps-2"]&&we.showToast(`${n.getName()} v${n.getVersion()} has started.`)}catch(n){i[o]=!1,h.err("Plugins",o+" could not be started.",n),e.push({name:o,file:d[t[s]].filename,message:"start() could not be fired.",error:{message:n.message,stack:n.stack}})}}return this.savePluginData(),s(1).remote.getCurrentWebContents().on("did-navigate-in-page",this.channelSwitch.bind(this)),e},x.prototype.startPlugin=function(e,t=!1){try{d[e].plugin.start(),a["fork-ps-2"]&&!t&&we.showToast(`${d[e].plugin.getName()} v${d[e].plugin.getVersion()} has started.`)}catch(s){a["fork-ps-2"]&&!t&&we.showToast(`${d[e].plugin.getName()} v${d[e].plugin.getVersion()} could not be started.`,{type:"error"}),i[e]=!1,this.savePluginData(),h.err("Plugins",name+" could not be started.",s)}},x.prototype.stopPlugin=function(e,t=!1){try{d[e].plugin.stop(),a["fork-ps-2"]&&!t&&we.showToast(`${d[e].plugin.getName()} v${d[e].plugin.getVersion()} has stopped.`)}catch(s){a["fork-ps-2"]&&!t&&we.showToast(`${d[e].plugin.getName()} v${d[e].plugin.getVersion()} could not be stopped.`,{type:"error"}),h.err("Plugins",d[e].plugin.getName()+" could not be stopped.",s)}},x.prototype.enablePlugin=function(e,t=!1){i[e]||(i[e]=!0,this.savePluginData(),this.startPlugin(e,t))},x.prototype.disablePlugin=function(e,t=!1){i[e]&&(i[e]=!1,this.savePluginData(),this.stopPlugin(e,t))},x.prototype.togglePlugin=function(e){i[e]?this.disablePlugin(e):this.enablePlugin(e)},x.prototype.loadPlugin=function(e){const t=B.loadContent(e,"plugin");if(t)return a["fork-ps-1"]&&we.showContentErrors({plugins:[t]}),a["fork-ps-2"]&&v.showToast(`${e} could not be loaded.`,{type:"error"}),h.err("ContentManager",`${e} could not be loaded.`,t);const s=Object.values(d).find(t=>t.filename==e).plugin;try{s.load&&"function"==typeof s.load&&s.load()}catch(e){a["fork-ps-1"]&&we.showContentErrors({plugins:[e]})}h.log("ContentManager",`${s.getName()} v${s.getVersion()} was loaded.`),a["fork-ps-2"]&&v.showToast(`${s.getName()} v${s.getVersion()} was loaded.`,{type:"success"}),E.dispatch("plugin-loaded",s.getName())},x.prototype.unloadPlugin=function(e){const t=Object.values(d).find(t=>t.filename==e)||d[e];if(!t)return;const s=t.plugin.getName();i[s]&&this.disablePlugin(s,!0);const n=B.unloadContent(d[s].filename,"plugin");if(delete d[s],n)return a["fork-ps-1"]&&we.showContentErrors({plugins:[n]}),a["fork-ps-2"]&&v.showToast(`${s} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),h.err("ContentManager",`${s} could not be unloaded. It may have not been loaded yet.`,n);h.log("ContentManager",`${s} was unloaded.`),a["fork-ps-2"]&&v.showToast(`${s} was unloaded.`,{type:"success"}),E.dispatch("plugin-unloaded",s)},x.prototype.reloadPlugin=function(e){const t=Object.values(d).find(t=>t.filename==e)||d[e];if(!t)return this.loadPlugin(e);const s=t.plugin.getName(),n=i[s];n&&this.stopPlugin(s,!0);const o=B.reloadContent(d[s].filename,"plugin");if(o)return a["fork-ps-1"]&&we.showContentErrors({plugins:[o]}),a["fork-ps-2"]&&v.showToast(`${s} could not be reloaded.`,{type:"error"}),h.err("ContentManager",`${s} could not be reloaded.`,o);d[s].plugin.load&&"function"==typeof d[s].plugin.load&&d[s].plugin.load(),n&&this.startPlugin(s,!0),h.log("ContentManager",`${s} v${d[s].plugin.getVersion()} was reloaded.`),a["fork-ps-2"]&&v.showToast(`${s} v${d[s].plugin.getVersion()} was reloaded.`,{type:"success"}),E.dispatch("plugin-reloaded",s)},x.prototype.updatePluginList=function(){const e=B.loadNewContent("plugin");for(const t of e.added)this.loadPlugin(t);for(const t of e.removed)this.unloadPlugin(t)},x.prototype.loadPluginData=function(){const e=f.getSettingGroup("plugins");e&&Object.assign(i,e)},x.prototype.savePluginData=function(){f.setSettingGroup("plugins",i)},x.prototype.newMessage=function(){const e=Object.keys(d);for(let t=0;t<e.length;t++){const s=d[e[t]].plugin;if(i[s.getName()]&&"function"==typeof s.onMessage)try{s.onMessage()}catch(e){h.err("Plugins","Unable to fire onMessage for "+s.getName()+".",e)}}},x.prototype.channelSwitch=function(){const e=Object.keys(d);for(let t=0;t<e.length;t++){const s=d[e[t]].plugin;if(i[s.getName()]&&"function"==typeof s.onSwitch)try{s.onSwitch()}catch(e){h.err("Plugins","Unable to fire onSwitch for "+s.getName()+".",e)}}},x.prototype.rawObserver=function(e){const t=Object.keys(d);for(let s=0;s<t.length;s++){const n=d[t[s]].plugin;if(i[n.getName()]&&"function"==typeof n.observer)try{n.observer(e)}catch(e){h.err("Plugins","Unable to fire observer for "+n.getName()+".",e)}}};var S=new x;function T(){}T.prototype.loadThemes=function(){this.loadThemeData();const e=B.loadThemes(),t=Object.keys(l);for(let e=0;e<t.length;e++){const s=l[t[e]].name;c[s]||(c[s]=!1),c[s]&&$("head").append($("<style>",{id:h.escapeID(s),text:unescape(l[s].css)}))}for(const e in c)l[e]||delete c[e];return this.saveThemeData(),e},T.prototype.enableTheme=function(e,t=!1){c[e]=!0,this.saveThemeData(),$("head").append($("<style>",{id:h.escapeID(e),text:unescape(l[e].css)})),a["fork-ps-2"]&&!t&&we.showToast(`${l[e].name} v${l[e].version} has been applied.`)},T.prototype.disableTheme=function(e,t=!1){c[e]=!1,this.saveThemeData(),$(`#${h.escapeID(l[e].name)}`).remove(),a["fork-ps-2"]&&!t&&we.showToast(`${l[e].name} v${l[e].version} has been disabled.`)},T.prototype.toggleTheme=function(e){c[e]?this.disableTheme(e):this.enableTheme(e)},T.prototype.loadTheme=function(e){const t=B.loadContent(e,"theme");if(t)return a["fork-ps-1"]&&we.showContentErrors({themes:[t]}),a["fork-ps-2"]&&v.showToast(`${e} could not be loaded. It may not have been loaded.`,{type:"error"}),h.err("ContentManager",`${e} could not be loaded.`,t);const s=Object.values(l).find(t=>t.filename==e);h.log("ContentManager",`${s.name} v${s.version} was loaded.`),a["fork-ps-2"]&&v.showToast(`${s.name} v${s.version} was loaded.`,{type:"success"}),E.dispatch("theme-loaded",s.name)},T.prototype.unloadTheme=function(e){const t=Object.values(l).find(t=>t.filename==e)||l[e];if(!t)return;const s=t.name;c[s]&&this.disableTheme(s,!0);const n=B.unloadContent(l[s].filename,"theme");if(delete l[s],n)return a["fork-ps-1"]&&we.showContentErrors({themes:[n]}),a["fork-ps-2"]&&v.showToast(`${s} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),h.err("ContentManager",`${s} could not be unloaded. It may have not been loaded yet.`,n);h.log("ContentManager",`${s} was unloaded.`),a["fork-ps-2"]&&v.showToast(`${s} was unloaded.`,{type:"success"}),E.dispatch("theme-unloaded",s)},T.prototype.reloadTheme=function(e){const t=Object.values(l).find(t=>t.filename==e)||l[e];if(!t)return this.loadTheme(e);const s=t.name,n=B.reloadContent(l[s].filename,"theme");if(c[s]&&(this.disableTheme(s,!0),this.enableTheme(s,!0)),n)return a["fork-ps-1"]&&we.showContentErrors({themes:[n]}),a["fork-ps-2"]&&v.showToast(`${s} could not be reloaded.`,{type:"error"}),h.err("ContentManager",`${s} could not be reloaded.`,n);h.log("ContentManager",`${s} v${l[s].version} was reloaded.`),a["fork-ps-2"]&&v.showToast(`${s} v${l[s].version} was reloaded.`,{type:"success"}),E.dispatch("theme-reloaded",s)},T.prototype.updateThemeList=function(){const e=B.loadNewContent("theme");for(const t of e.added)this.loadTheme(t);for(const t of e.removed)this.unloadTheme(t)},T.prototype.loadThemeData=function(){const e=f.getSettingGroup("themes");e&&Object.assign(c,e)},T.prototype.saveThemeData=function(){f.setSettingGroup("themes",c)};var D=new T;const N=s(2),P=s(0),M=s(4).Module;M.globalPaths.push(N.resolve(s(1).remote.app.getAppPath(),"node_modules"));class O extends Error{constructor(e){super(e),this.name="MetaError"}}const j=M._extensions[".js"],F=M._extensions[".css"]?M._extensions[".css"]:()=>null;var B=new class{constructor(){this.timeCache={},this.watchers={},M._extensions[".js"]=this.getContentRequire("plugin"),M._extensions[".css"]=this.getContentRequire("theme")}get pluginsFolder(){return this._pluginsFolder||(this._pluginsFolder=P.realpathSync(N.resolve(r.dataPath+"plugins/")))}get themesFolder(){return this._themesFolder||(this._themesFolder=P.realpathSync(N.resolve(r.dataPath+"themes/")))}watchContent(e){if(this.watchers[e])return;const t="plugin"===e,s=t?this.pluginsFolder:this.themesFolder,n=t?".plugin.js":".theme.css";this.watchers[e]=P.watch(s,{persistent:!1},async(e,o)=>{if(!e||!o||!o.endsWith(n))return;await new Promise(e=>setTimeout(e,50));try{P.statSync(N.resolve(s,o))}catch(e){if("ENOENT"!==e.code)return;return delete this.timeCache[o],t?S.unloadPlugin(o):D.unloadTheme(o)}if(!P.statSync(N.resolve(s,o)).isFile())return;const a=P.statSync(N.resolve(s,o));a&&a.mtime&&a.mtime.getTime()&&"number"==typeof a.mtime.getTime()&&this.timeCache[o]!=a.mtime.getTime()&&(this.timeCache[o]=a.mtime.getTime(),"rename"==e&&(t?S.loadPlugin(o):D.loadTheme(o)),"change"==e&&(t?S.reloadPlugin(o):D.reloadTheme(o)))})}unwatchContent(e){this.watchers[e]&&(this.watchers[e].close(),delete this.watchers[e])}extractMeta(e){const t=e.split("\n")[0],s=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//"));if(t.indexOf("META")<0)throw new O("META was not found.");if(!h.testJSON(s))throw new O("META could not be parsed.");const n=JSON.parse(s);if(!n.name)throw new O("META missing name data.");return n}getContentRequire(e){const t="plugin"===e,s=this,n=t?j:F;return function(e,o){const a=t?s.pluginsFolder:s.themesFolder,r=N.resolve(a,N.basename(o));if(!P.existsSync(r)||o!==P.realpathSync(r))return Reflect.apply(n,this,arguments);let i=P.readFileSync(o,"utf8");i=h.stripBOM(i);const c=s.extractMeta(i);c.filename=N.basename(o),t||(c.css=i.split("\n").slice(1).join("\n"),i=`module.exports = ${JSON.stringify(c)};`),t&&(i+=`\nmodule.exports = ${JSON.stringify(c)};\nmodule.exports.type = ${c.name};`),e._compile(i,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 s="plugin"===t,n=s?this.pluginsFolder:this.themesFolder;try{require(N.resolve(n,e))}catch(t){return{name:e,file:e,message:"Could not be compiled.",error:{message:t.message,stack:t.stack}}}const o=require(N.resolve(n,e));if(s){if(!o.type)return;try{o.plugin=new o.type,delete d[o.plugin.getName()],d[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 l[o.name],l[o.name]=o}unloadContent(e,t){if(void 0===e||void 0===t)return;const s="plugin"===t?this.pluginsFolder:this.themesFolder;try{delete require.cache[require.resolve(N.resolve(s,e))]}catch(t){return{name:e,file:e,message:"Could not be unloaded.",error:{message:t.message,stack:t.stack}}}}isLoaded(e,t){const s="plugin"===t?this.pluginsFolder:this.themesFolder;try{require.cache[require.resolve(N.resolve(s,e))]}catch(e){return!1}return!0}reloadContent(e,t){const s=this.unloadContent(e,t);return s||this.loadContent(e,t)}loadNewContent(e){const t="plugin"===e,s=t?".plugin.js":".theme.css",n=t?this.pluginsFolder:this.themesFolder,o=P.readdirSync(n),a=Object.values(t?d:l),r=a.filter(e=>!o.includes(e.filename)).map(e=>t?e.plugin.getName():e.name);return{added:o.filter(e=>!a.find(t=>t.filename==e)&&e.endsWith(s)&&P.statSync(N.resolve(n,e)).isFile()),removed:r}}loadAllContent(e){const t="plugin"===e,s=t?".plugin.js":".theme.css",n=t?this.pluginsFolder:this.themesFolder,o=[],a=P.readdirSync(n);for(const t of a){if(!P.statSync(N.resolve(n,t)).isFile()||!t.endsWith(s))continue;const a=this.loadContent(t,e);a&&o.push(a)}return o}loadPlugins(){return this.loadAllContent("plugin")}loadThemes(){return this.loadAllContent("theme")}};function A(){}A.prototype.enable=function(e){const t=this;this.disable(),$(window).on("keydown.bdDevmode",function(e){119!==e.which&&118!=e.which||console.log("%c[%cDevMode%c] %cBreak/Resume","color: red;","color: #303030; font-weight:700;","color:red;","")}),e&&$(document).on("contextmenu.bdDevmode",function(e){t.lastSelector=t.getSelector(e.toElement),setImmediate(function(){let s=$(".contextMenu-HLZMGh");s.length<=0&&((s=$('<div class="contextMenu-HLZMGh bd-context-menu"></div>')).addClass($(".app, .app-2rEoOp").hasClass("theme-dark")?"theme-dark":"theme-light"),s.appendTo(".app, .app-2rEoOp"),s.css("top",e.clientY),s.css("left",e.clientX),$(document).on("click.bdDevModeCtx",()=>{s.remove(),$(document).off(".bdDevModeCtx")}),$(document).on("contextmenu.bdDevModeCtx",()=>{s.remove(),$(document).off(".bdDevModeCtx")}),$(document).on("keyup.bdDevModeCtx",e=>{27===e.keyCode&&(s.remove(),$(document).off(".bdDevModeCtx"))}));const n=$("<div/>",{class:"itemGroup-1tL0uz"}),o=$("<div/>",{class:"item-1Yvehc",click:function(){y.NativeModule.copy(t.lastSelector),s.hide()}}).append($("<span/>",{text:"Copy Selector"}));n.append(o),s.append(n),s.hasClass("undefined")&&s.css("top","-="+n.outerHeight())}),e.stopPropagation()})},A.prototype.getRules=function(e,t=e.ownerDocument.styleSheets){return[].concat(...[...t].map(e=>[...e.cssRules||[]])).filter(t=>t&&t.selectorText&&e.matches(t.selectorText)&&t.style.length&&t.selectorText.split(", ").length<8)},A.prototype.getSelector=function(e){if(e.id)return`#${e.id}`;const t=this.getRules(e),s=t[t.length-1];return s?s.selectorText:e.classList.length?`.${Array.from(e.classList).join(".")}`:`.${Array.from(e.parentElement.classList).join(".")}`},A.prototype.disable=function(){$(window).off("keydown.bdDevmode"),$(document).off("contextmenu.bdDevmode"),$(document).off("contextmenu.bdDevModeCtx")};var I=new A;function L(){}L.prototype.init=function(){this.initialized=!0,$(document).on("mousedown",function(e){"rmenu"!=e.target.id&&$("#rmenu").remove()}),this.favoriteEmotes={};const e=f.getBDData("bdfavemotes");""!==e&&null!==e&&(this.favoriteEmotes=JSON.parse(atob(e)));let t="";t+='<div id="bda-qem">',t+=' <button class="active" id="bda-qem-twitch" onclick=\'quickEmoteMenu.switchHandler(this); return false;\'>Twitch</button>',t+=" <button id=\"bda-qem-favourite\" onclick='quickEmoteMenu.switchHandler(this); return false;'>Favourite</button>",t+=" <button id=\"bda-qem-emojis\" onclick='quickEmoteMenu.switchHandler(this); return false;'>Emojis</buttond>",t+="</div>",this.qmeHeader='<div id="bda-qem"> <button class="active" id="bda-qem-twitch" onclick=\'quickEmoteMenu.switchHandler(this); return false;\'>Twitch</button> <button id="bda-qem-favourite" onclick=\'quickEmoteMenu.switchHandler(this); return false;\'>Favourite</button> <button id="bda-qem-emojis" onclick=\'quickEmoteMenu.switchHandler(this); return false;\'>Emojis</buttond></div>';let s="";s+='<div id="bda-qem-twitch-container">',s+=' <div class="scroller-wrap scrollerWrap-2lJEkd fade">',s+=' <div class="scroller scroller-2FKFPG">',s+=' <div class="emote-menu-inner">';let n="";for(const e in window.bdEmotes.TwitchGlobal)window.bdEmotes.TwitchGlobal.hasOwnProperty(e)&&(s+='<div class="emote-container">',s+=' <img class="emote-icon" alt="" src="'+(n=window.bdEmotes.TwitchGlobal[e])+'" title="'+e+'">',s+=" </img>",s+="</div>");s+=" </div>",s+=" </div>",s+=" </div>",s+="</div>",this.teContainer=s;let o="";o+='<div id="bda-qem-favourite-container">',o+=' <div class="scroller-wrap scrollerWrap-2lJEkd fade">',o+=' <div class="scroller scroller-2FKFPG">',o+=' <div class="emote-menu-inner">';for(const e in this.favoriteEmotes)o+='<div class="emote-container">',o+=' <img class="emote-icon" alt="" src="'+(n=this.favoriteEmotes[e])+'" title="'+e+"\" oncontextmenu='quickEmoteMenu.favContext(event, this);'>",o+=" </img>",o+="</div>";o+=" </div>",o+=" </div>",o+=" </div>",o+="</div>",this.faContainer=o},L.prototype.favContext=function(e,t){e.stopPropagation();const s=$("<div>",{id:"removemenu","data-emoteid":$(t).prop("title"),text:"Remove",class:"bd-context-menu context-menu theme-dark"});return s.css({top:e.pageY-$("#bda-qem-favourite-container").offset().top,left:e.pageX-$("#bda-qem-favourite-container").offset().left}),$(t).parent().append(s),s.on("click",function(e){return e.preventDefault(),e.stopPropagation(),$(this).remove(),delete this.favoriteEmotes[$(this).data("emoteid")],this.updateFavorites(),!1}),!1},L.prototype.switchHandler=function(e){this.switchQem($(e).attr("id"))},L.prototype.switchQem=function(e){const t=$("#bda-qem-twitch"),s=$("#bda-qem-favourite"),n=$("#bda-qem-emojis");switch(t.removeClass("active"),s.removeClass("active"),n.removeClass("active"),$(".emojiPicker-3m1S-j").hide(),$("#bda-qem-favourite-container").hide(),$("#bda-qem-twitch-container").hide(),e){case"bda-qem-twitch":t.addClass("active"),$("#bda-qem-twitch-container").show();break;case"bda-qem-favourite":s.addClass("active"),$("#bda-qem-favourite-container").show();break;case"bda-qem-emojis":n.addClass("active"),$(".emojiPicker-3m1S-j").show(),$(".emojiPicker-3m1S-j .search-bar-inner input, .emojiPicker-3m1S-j .search-bar-inner input").focus()}this.lastTab=e;const o=$(".emote-icon");o.off(),o.on("click",function(){const e=$(this).attr("title"),t=h.getTextArea();h.insertText(t[0]," "==t.val().slice(-1)?t.val()+e:t.val()+" "+e)})},L.prototype.obsCallback=function(e){if(!this.initialized)return;const t=$(e);a["bda-es-9"]?t.removeClass("bda-qme-hidden"):t.addClass("bda-qme-hidden"),a["bda-es-0"]&&(t.prepend(this.qmeHeader),t.append(this.teContainer),t.append(this.faContainer),null==this.lastTab&&(this.lastTab="bda-qem-emojis"),this.switchQem(this.lastTab))},L.prototype.favorite=function(e,t){this.favoriteEmotes.hasOwnProperty(e)||(this.favoriteEmotes[e]=t),this.updateFavorites()},L.prototype.updateFavorites=function(){let e="";e+='<div id="bda-qem-favourite-container">',e+=' <div class="scroller-wrap scrollerWrap-2lJEkd fade">',e+=' <div class="scroller scroller-2FKFPG">',e+=' <div class="emote-menu-inner">';for(const t in this.favoriteEmotes){e+='<div class="emote-container">',e+=' <img class="emote-icon" alt="" src="'+this.favoriteEmotes[t]+'" title="'+t+'" oncontextmenu="quickEmoteMenu.favContext(event, this);">',e+=" </img>",e+="</div>"}e+=" </div>",e+=" </div>",e+=" </div>",e+="</div>",this.faContainer=e,$("#bda-qem-favourite-container").replaceWith(e),f.setBDData("bdfavemotes",btoa(JSON.stringify(this.favoriteEmotes)))};var R=new L;class G extends y.reactComponent{constructor(e){super(e),this.setInitialState(),this.onClick=this.onClick.bind(this)}setInitialState(){this.state={selected:this.props.selected||!1}}render(){return y.react.createElement("div",{className:`ui-tab-bar-item${this.props.selected?" selected":""}`,onClick:this.onClick},this.props.text)}onClick(){this.props.onClick&&this.props.onClick(this.props.id)}}class V extends y.reactComponent{constructor(e){super(e)}render(){return y.react.createElement("div",{className:"ui-tab-bar-separator margin-top-8 margin-bottom-8"})}}class q extends y.reactComponent{constructor(e){super(e)}render(){return y.react.createElement("div",{className:"ui-tab-bar-header"},this.props.text)}}class _{static get Item(){return G}static get Header(){return q}static get Separator(){return V}}class W extends y.reactComponent{constructor(e){super(e);const t=this,s=$("[class*=side] > [class*=selected]");s.length&&(t.scn=s.attr("class"));const n=$("[class*=side] > [class*=notSelected]");n.length&&(t.nscn=n.attr("class")),$("[class*='side-'] > [class*='item-']").on("click",()=>{t.setState({selected:null})}),t.setInitialState(),t.onClick=t.onClick.bind(t)}setInitialState(){const e=this;e.state={selected:null,items:e.props.items};const t=e.props.items.find(e=>e.selected);t&&(e.state.selected=t.id)}render(){const e=this,{headerText:t}=e.props,{items:s,selected:n}=e.state;return y.react.createElement("div",null,y.react.createElement(_.Separator,null),y.react.createElement(_.Header,{text:t}),s.map(t=>{const{id:s,text:o}=t;return y.react.createElement(_.Item,{key:s,selected:n===s,text:o,id:s,onClick:e.onClick})}))}onClick(e){const t=this,s=$("[class*=side] > [class*=selected]");s.length&&(s.off("click.bdsb").on("click.bsb",e=>{$(e.target).attr("class",t.scn)}),s.attr("class",t.nscn)),t.setState({selected:null}),t.setState({selected:e}),t.props.onClick&&t.props.onClick(e)}}class z{constructor(e){this.onClick=e}get items(){return[{text:"Settings",id:"core"},{text:"Emotes",id:"emotes"},{text:"Plugins",id:"plugins"},{text:"Themes",id:"themes"},{text:"Custom CSS",id:"customcss"}]}get component(){return y.react.createElement("span",null,y.react.createElement(W,{onClick:this.onClick,headerText:"Bandaged BD",items:this.items}),y.react.createElement("div",{style:{fontSize:"12px",fontWeight:"600",color:"#72767d",padding:"2px 10px"}},`BD v${r.version} by `,y.react.createElement("a",{href:"https://github.com/Jiiks/",target:"_blank"},"Jiiks")),y.react.createElement("div",{style:{fontSize:"12px",fontWeight:"600",color:"#72767d",padding:"2px 10px"}},`BBD v${r.bbdVersion} by `,y.react.createElement("a",{href:"https://github.com/rauenzi/",target:"_blank"},"Zerebos")))}get root(){const e=$("#bd-settings-sidebar");return e.length?e[0]:this.injectRoot()?this.root:null}injectRoot(){const e=$("[class*='side-'] > [class*='item-']:not([class*=Danger])").last();return!!e.length&&($("<span/>",{id:"bd-settings-sidebar"}).insertBefore(e.prev()),!0)}render(){const e=this.root;e?(y.reactDom.render(this.component,e),h.onRemoved(e,()=>{y.reactDom.unmountComponentAtNode(e)})):console.log("FAILED TO LOCATE ROOT: [class*='side-'] > [class*='item-']:not([class*=Danger])")}}class U extends y.reactComponent{constructor(e){super(e)}render(){let e=`scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d${this.props.fade?" scrollerFade-1Ijw5y":""}`,t="scroller-2FKFPG scroller";this.props.sidebar&&(t="scroller-2FKFPG firefoxFixScrollFlex-cnI2ix sidebarRegionScroller-3MXcoP sidebar-region-scroller scroller"),this.props.contentColumn&&(t="scroller-2FKFPG firefoxFixScrollFlex-cnI2ix contentRegionScroller-26nc1e content-region-scroller scroller",e="scrollerWrap-2lJEkd firefoxFixScrollFlex-cnI2ix contentRegionScrollerWrap-3YZXdm content-region-scroller-wrap scrollerThemed-2oenus themeGhost-28MSn0 scrollerTrack-1ZIpsv");const{children:s}=this.props;return y.react.createElement("div",{key:"scrollerwrap",className:e},y.react.createElement("div",{key:"scroller",ref:"scroller",className:t},s))}}class H extends y.reactComponent{constructor(e){super(e)}render(){return y.react.createElement("ul",{className:this.props.className},this.props.children)}}class J extends y.reactComponent{constructor(e){super(e)}render(){return y.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},y.react.createElement("h2",{className:"ui-form-title h2 margin-reset margin-bottom-20"},this.props.title),this.props.children)}}class Y extends y.reactComponent{constructor(e){super(e)}render(){return y.react.createElement("h2",{className:"ui-form-title h2 margin-reset margin-bottom-20 marginTop60-3PGbtK da-marginTop6"},this.props.text)}}class Q extends y.reactComponent{constructor(e){super(e),this.setInitialState(),this.onChange=this.onChange.bind(this)}setInitialState(){this.state={checked:this.props.checked}}render(){const{text:e,info:t}=this.props.data,{checked:s}=this.state;return y.react.createElement("div",{className:"ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item"},y.react.createElement("div",{className:"ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap"},y.react.createElement("h3",{className:"ui-form-title h3 margin-reset margin-reset ui-flex-child"},e),y.react.createElement("label",{className:"ui-switch-wrapper ui-flex-child",style:{flex:"0 0 auto"}},y.react.createElement("input",{className:"ui-switch-checkbox",type:"checkbox",checked:s,onChange:e=>this.onChange(e)}),y.react.createElement("div",{className:`ui-switch ${s?"checked":""}`}))),y.react.createElement("div",{className:"ui-form-text style-description margin-top-4",style:{flex:"1 1 auto"}},t))}onChange(){this.props.onChange(this.props.id,!this.state.checked),this.setState({checked:!this.state.checked})}}class Z extends y.reactComponent{constructor(e){super(e)}render(){const{title:e,settings:t,button:s}=this.props,n=s?y.react.createElement("button",{key:"title-button",className:"bd-pfbtn",onClick:s.onClick},s.title):null;return[y.react.createElement(Y,{text:e}),n,t.map(e=>y.react.createElement(Q,{id:e.id,key:e.id,data:e,checked:a[e.id],onChange:(e,t)=>{this.props.onChange(e,t)}}))]}}class K extends y.reactComponent{constructor(e){super(e)}render(){return y.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},this.props.sections.map(e=>y.react.createElement(Z,Object.assign({},e,this.props.onChange))))}}class X extends y.reactComponent{constructor(e){super(e)}render(){return y.react.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",style:{width:"18px",height:"18px"}},y.react.createElement("g",{className:"background",fill:"none",fillRule:"evenodd"},y.react.createElement("path",{d:"M0 0h12v12H0"}),y.react.createElement("path",{className:"fill",fill:"#dcddde",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"})))}}class ee extends y.reactComponent{constructor(e){super(e),this.onClick=this.onClick.bind(this)}render(){return y.react.createElement("div",{className:"tools-container toolsContainer-1edPuj"},y.react.createElement("div",{className:"tools tools-3-3s-N"},y.react.createElement("div",{className:"container-1sFeqf"},y.react.createElement("div",{className:"btn-close closeButton-1tv5uR",onClick:this.onClick},y.react.createElement(X,null)),y.react.createElement("div",{className:"esc-text keybind-KpFkfr"},"ESC"))))}onClick(){this.props.onClick&&this.props.onClick(),$(".closeButton-1tv5uR").first().click()}}class te extends y.reactComponent{constructor(e){super(e)}render(){const{settings:e}=this.props;return y.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},y.react.createElement(Y,{text:this.props.title}),this.props.button&&y.react.createElement("button",{key:"title-button",className:"bd-pfbtn",onClick:this.props.button.onClick},this.props.button.title),e.map(e=>y.react.createElement(Q,{id:e.id,key:e.id,data:e,checked:a[e.id],onChange:(e,t)=>{this.props.onChange(e,t)}})))}}class se extends y.reactComponent{constructor(e){super(e)}render(){return y.react.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#dcddde",className:"bd-reload "+this.props.className,onClick:this.props.onClick,style:{width:this.props.size||"24px",height:this.props.size||"24px"}},y.react.createElement("path",{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"}),y.react.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}}class ne extends y.reactComponent{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.showSettings=this.showSettings.bind(this),this.setInitialState(),this.hasSettings="function"==typeof this.props.plugin.getSettingsPanel,this.settingsPanel="",this.reload=this.reload.bind(this),this.onReload=this.onReload.bind(this)}setInitialState(){this.state={checked:i[this.props.plugin.getName()],settings:!1,reloads:0}}onReload(e){e===this.props.plugin.getName()&&this.setState({reloads:this.state.reloads+1})}componentDidUpdate(){if(this.state.settings){if("object"==typeof this.settingsPanel&&this.refs.settingspanel.appendChild(this.settingsPanel),!a["fork-ps-3"])return;const e=(e,t)=>{const s=e.scrollTop,n=s+e.clientHeight,o=t.offsetTop,a=o+t.clientHeight;return o<s||a>n},t=$(y.reactDom.findDOMNode(this)),s=t.parents(".scroller");if(!e(s[0],t[0]))return;s.animate({scrollTop:t.offset().top-s.offset().top+s.scrollTop()-30},300)}}reload(){const e=this.props.plugin.getName();S.reloadPlugin(e),this.props.plugin=d[e].plugin,this.onReload(this.props.plugin.getName())}getString(e){return"string"==typeof e?e:e.toString()}render(){const e=this,{plugin:t}=this.props,s=this.getString(t.getName()),n=this.getString(t.getAuthor()),o=this.getString(t.getDescription()),r=this.getString(t.getVersion()),i=d[s].website,c=d[s].source;if(this.state.settings){try{e.settingsPanel=t.getSettingsPanel()}catch(e){h.err("Plugins","Unable to get settings panel for "+t.getName()+".",e)}return y.react.createElement("li",{className:"settings-open ui-switch-item"},y.react.createElement("div",{style:{float:"right",cursor:"pointer"},onClick:()=>{this.refs.settingspanel.innerHTML="",e.setState({settings:!1})}},y.react.createElement(X,null)),"object"==typeof e.settingsPanel&&y.react.createElement("div",{id:`plugin-settings-${s}`,className:"plugin-settings",ref:"settingspanel"}),"object"!=typeof e.settingsPanel&&y.react.createElement("div",{id:`plugin-settings-${s}`,className:"plugin-settings",ref:"settingspanel",dangerouslySetInnerHTML:{__html:e.settingsPanel}}))}return y.react.createElement("li",{"data-name":s,"data-version":r,className:"settings-closed ui-switch-item"},y.react.createElement("div",{className:"bda-header"},y.react.createElement("span",{className:"bda-header-title"},y.react.createElement("span",{className:"bda-name"},s)," v",y.react.createElement("span",{className:"bda-version"},r)," by ",y.react.createElement("span",{className:"bda-author"},n)),y.react.createElement("div",{className:"bda-controls"},!a["fork-ps-5"]&&y.react.createElement(se,{className:"bd-reload-card",onClick:this.reload}),y.react.createElement("label",{className:"ui-switch-wrapper ui-flex-child",style:{flex:"0 0 auto"}},y.react.createElement("input",{checked:this.state.checked,onChange:this.onChange,className:"ui-switch-checkbox",type:"checkbox"}),y.react.createElement("div",{className:this.state.checked?"ui-switch checked":"ui-switch"})))),y.react.createElement("div",{className:"bda-description-wrap scroller-wrap fade"},y.react.createElement("div",{className:"bda-description scroller"},o)),(i||c||this.hasSettings)&&y.react.createElement("div",{className:"bda-footer"},y.react.createElement("span",{className:"bda-links"},i&&y.react.createElement("a",{className:"bda-link bda-link-website",href:i,target:"_blank"},"Website"),i&&c&&" | ",c&&y.react.createElement("a",{className:"bda-link bda-link-source",href:c,target:"_blank"},"Source")),this.hasSettings&&y.react.createElement("button",{onClick:this.showSettings,className:"bda-settings-button",disabled:!this.state.checked},"Settings")))}onChange(){this.setState({checked:!this.state.checked}),S.togglePlugin(this.props.plugin.getName())}showSettings(){this.hasSettings&&this.setState({settings:!0})}}class oe extends y.reactComponent{constructor(e){super(e),this.setInitialState(),this.onChange=this.onChange.bind(this),this.reload=this.reload.bind(this)}setInitialState(){this.state={checked:c[this.props.theme.name],reloads:0}}onReload(e){e===this.props.theme.name&&this.setState({reloads:this.state.reloads+1})}reload(){const e=this.props.theme.name;D.reloadTheme(e)?we.showToast(`Could not reload ${l[e].name}. Check console for details.`,{type:"error"}):we.showToast(`${l[e].name} v${l[e].version} has been reloaded.`,{type:"success"}),this.props.theme=l[e],this.onReload(this.props.theme.name)}render(){const{theme:e}=this.props,t=e.name,s=e.description,n=e.version,o=e.author,r=l[t].website,i=l[t].source;return y.react.createElement("li",{"data-name":t,"data-version":n,className:"settings-closed ui-switch-item"},y.react.createElement("div",{className:"bda-header"},y.react.createElement("span",{className:"bda-header-title"},y.react.createElement("span",{className:"bda-name"},t)," v",y.react.createElement("span",{className:"bda-version"},n)," by ",y.react.createElement("span",{className:"bda-author"},o)),y.react.createElement("div",{className:"bda-controls"},!a["fork-ps-5"]&&y.react.createElement(se,{className:"bd-reload-card",onClick:this.reload}),y.react.createElement("label",{className:"ui-switch-wrapper ui-flex-child",style:{flex:"0 0 auto"}},y.react.createElement("input",{checked:this.state.checked,onChange:this.onChange,className:"ui-switch-checkbox",type:"checkbox"}),y.react.createElement("div",{className:this.state.checked?"ui-switch checked":"ui-switch"})))),y.react.createElement("div",{className:"bda-description-wrap scroller-wrap fade"},y.react.createElement("div",{className:"bda-description scroller"},s)),(r||i)&&y.react.createElement("div",{className:"bda-footer"},y.react.createElement("span",{className:"bda-links"},r&&y.react.createElement("a",{className:"bda-link",href:r,target:"_blank"},"Website"),r&&i&&" | ",i&&y.react.createElement("a",{className:"bda-link",href:i,target:"_blank"},"Source"))))}onChange(){this.setState({checked:!this.state.checked}),D.toggleTheme(this.props.theme.name)}}class ae extends y.reactComponent{constructor(e){super(e),this.onClick=this.onClick.bind(this),this.setInitialState()}setInitialState(){this.state={checked:this.props.checked||!1}}render(){return y.react.createElement("li",null,y.react.createElement("div",{className:"checkbox checkbox-3kaeSU da-checkbox checkbox-3EVISJ da-checkbox",onClick:this.onClick},y.react.createElement("div",{className:"checkbox-inner checkboxInner-3yjcPe da-checkboxInner"},y.react.createElement("input",{className:"checkboxElement-1qV33p da-checkboxElement",checked:this.state.checked,onChange:()=>{},type:"checkbox"}),y.react.createElement("span",null)),y.react.createElement("span",null,this.props.text)))}onClick(){this.props.onChange(this.props.id,!this.state.checked),this.setState({checked:!this.state.checked})}}class re extends y.reactComponent{constructor(e){super(e),this.onClick=this.onClick.bind(this),this.updateCss=this.updateCss.bind(this),this.saveCss=this.saveCss.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){$("#app-mount").addClass("bd-detached-editor"),y.editorDetached=!0,this.editor=ace.edit("bd-customcss-editor-detached"),this.editor.setTheme("ace/theme/monokai"),this.editor.session.setMode("ace/mode/css"),this.editor.setShowPrintMargin(!1),this.editor.setFontSize(14),this.editor.on("change",()=>{a["bda-css-0"]&&(this.saveCss(),this.updateCss())})}componentWillUnmount(){$("#app-mount").removeClass("bd-detached-editor"),y.editorDetached=!1,this.editor.destroy()}updateLineCount(){const e=this.refs.editor.value.split("\n").length;e!=this.props.lines&&(this.refs.lines.textContent=Array.from(new Array(e),(e,t)=>t+1).join(".\n")+".",this.props.lines=e)}get options(){return{lineNumbers:!0,mode:"css",indentUnit:4,theme:"material",scrollbarStyle:"simple"}}get css(){const e=f.getBDData("bdcustomcss");let t="";return e&&""!==e&&(t=atob(e)),t}get root(){const e=$("#bd-customcss-detach-container");return e.length?e[0]:this.injectRoot()?this.detachedRoot:null}injectRoot(){return!!$(".app, .app-2rEoOp").length&&($("<div/>",{id:"bd-customcss-detach-container"}).insertAfter($(".app, .app-2rEoOp")),!0)}render(){const e=this;return y.react.createElement("div",{className:"bd-detached-css-editor",id:"bd-customcss-detach-editor"},y.react.createElement("div",{id:"bd-customcss-innerpane"},y.react.createElement("div",{className:"editor-wrapper"},y.react.createElement("div",{id:"bd-customcss-editor-detached",className:"editor",ref:"editor"},e.css)),y.react.createElement("div",{id:"bd-customcss-attach-controls"},y.react.createElement("ul",{className:"checkbox-group"},y.react.createElement(ae,{id:"live-update",text:"Live Update",onChange:e.onChange,checked:a["bda-css-0"]})),y.react.createElement("div",{id:"bd-customcss-detach-controls-button"},y.react.createElement("button",{style:{borderRadius:"3px 0 0 3px",borderRight:"1px solid #3f4146"},className:"btn btn-primary",onClick:()=>{e.onClick("update")}},"Update"),y.react.createElement("button",{style:{borderRadius:"0",borderLeft:"1px solid #2d2d2d",borderRight:"1px solid #2d2d2d"},className:"btn btn-primary",onClick:()=>{e.onClick("save")}},"Save"),y.react.createElement("button",{style:{borderRadius:"0 3px 3px 0",borderLeft:"1px solid #3f4146"},className:"btn btn-primary",onClick:()=>{e.onClick("attach")}},"Attach"),y.react.createElement("span",{style:{fontSize:"10px",marginLeft:"5px"}},"Unsaved changes are lost on attach")))))}onChange(e,t){switch(e){case"live-update":a["bda-css-0"]=t,we.saveSettings()}}onClick(e){const t=this;switch(e){case"attach":$("#editor-detached").length&&t.props.attach(),y.reactDom.unmountComponentAtNode(t.root),t.root.remove();break;case"update":t.updateCss();break;case"save":t.saveCss()}}updateCss(){0==$("#customcss").length&&$("head").append('<style id="customcss"></style>'),$("#customcss").text(this.editor.session.getValue()).detach().appendTo(document.head)}saveCss(){f.setBDData("bdcustomcss",btoa(this.editor.session.getValue()))}}class ie extends y.reactComponent{constructor(e){super(e),this.props.lines=0,this.setInitialState(),this.attach=this.attach.bind(this),this.detachedEditor=y.react.createElement(re,{attach:this.attach}),this.onClick=this.onClick.bind(this),this.updateCss=this.updateCss.bind(this),this.saveCss=this.saveCss.bind(this),this.detach=this.detach.bind(this)}setInitialState(){this.state={detached:this.props.detached||y.editorDetached}}componentDidMount(){this.editor=ace.edit("bd-customcss-editor"),this.editor.setTheme("ace/theme/monokai"),this.editor.session.setMode("ace/mode/css"),this.editor.setShowPrintMargin(!1),this.editor.setFontSize(14),this.editor.on("change",()=>{a["bda-css-0"]&&(this.saveCss(),this.updateCss())})}componentWillUnmount(){this.editor.destroy()}componentDidUpdate(e,t){t.detached&&!this.state.detached&&y.reactDom.unmountComponentAtNode(this.detachedRoot)}codeMirror(){}get options(){return{lineNumbers:!0,mode:"css",indentUnit:4,theme:"material",scrollbarStyle:"simple"}}get css(){const e=f.getBDData("bdcustomcss");let t="";return e&&""!==e&&(t=atob(e)),t}updateLineCount(){const e=this.refs.editor.value.split("\n").length;e!=this.props.lines&&(this.refs.lines.textContent=Array.from(new Array(e),(e,t)=>t+1).join(".\n")+".",this.props.lines=e)}render(){const e=this,{detached:t}=e.state;return y.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default",style:{padding:"60px 40px 0px"}},t&&y.react.createElement("div",{id:"editor-detached"},y.react.createElement(Y,{text:"Custom CSS Editor"}),y.react.createElement("h3",null,"Editor Detached"),y.react.createElement("button",{className:"btn btn-primary",onClick:()=>{e.attach()}},"Attach")),!t&&y.react.createElement("div",null,y.react.createElement(Y,{text:"Custom CSS Editor"}),y.react.createElement("div",{className:"editor-wrapper"},y.react.createElement("div",{id:"bd-customcss-editor",className:"editor",ref:"editor"},e.css)),y.react.createElement("div",{id:"bd-customcss-attach-controls"},y.react.createElement("ul",{className:"checkbox-group"},y.react.createElement(ae,{id:"live-update",text:"Live Update",onChange:this.onChange,checked:a["bda-css-0"]})),y.react.createElement("div",{id:"bd-customcss-detach-controls-button"},y.react.createElement("button",{style:{borderRadius:"3px 0 0 3px",borderRight:"1px solid #3f4146"},className:"btn btn-primary",onClick:()=>{e.onClick("update")}},"Update"),y.react.createElement("button",{style:{borderRadius:"0",borderLeft:"1px solid #2d2d2d",borderRight:"1px solid #2d2d2d"},className:"btn btn-primary",onClick:()=>{e.onClick("save")}},"Save"),y.react.createElement("button",{style:{borderRadius:"0 3px 3px 0",borderLeft:"1px solid #3f4146"},className:"btn btn-primary",onClick:()=>{e.onClick("detach")}},"Detach"),y.react.createElement("span",{style:{fontSize:"10px",marginLeft:"5px"}},"Unsaved changes are lost on detach"),y.react.createElement("div",{className:"help-text"},"Press ",y.react.createElement("code",{className:"inline"},"ctrl"),"+",y.react.createElement("span",{className:"inline"},",")," with the editor focused to access the editor's settings.")))))}onClick(e){switch(e){case"update":this.updateCss();break;case"save":this.saveCss();break;case"detach":this.detach()}}onChange(e,t){switch(e){case"live-update":a["bda-css-0"]=t,we.saveSettings()}}updateCss(){0==$("#customcss").length&&$("head").append('<style id="customcss"></style>'),$("#customcss").text(this.editor.session.getValue()).detach().appendTo(document.head)}saveCss(){f.setBDData("bdcustomcss",btoa(this.editor.session.getValue()))}detach(){this.setState({detached:!0});const e=this.detachedRoot;e?y.reactDom.render(this.detachedEditor,e):console.log("FAILED TO INJECT ROOT: .app")}get detachedRoot(){const e=$("#bd-customcss-detach-container");return e.length?e[0]:this.injectDetachedRoot()?this.detachedRoot:null}injectDetachedRoot(){return!!$(".app, .app-2rEoOp").length&&($("<div/>",{id:"bd-customcss-detach-container"}).insertAfter($(".app, .app-2rEoOp")),!0)}attach(){this.setState({detached:!1})}}class ce{constructor(e){this.sideBarOnClick=this.sideBarOnClick.bind(this),this.onChange=e.onChange,this.sidebar=new z(this.sideBarOnClick)}get root(){const e=$("#bd-settingspane-container");return e.length?e[0]:this.injectRoot()?this.root:null}injectRoot(){if(!$(".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view").length)return!1;const e=$("<div/>",{class:"contentRegion-3nDuYy content-region",id:"bd-settingspane-container"});return $(".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view").append(e),h.onRemoved(e[0],()=>{y.reactDom.unmountComponentAtNode(e[0])}),!0}get coreSettings(){const e=this.getSettings("core");return[...new Set(e.map(e=>e.category))].map(t=>({title:t,settings:e.filter(e=>e.category==t)}))}get emoteSettings(){return this.getSettings("emote")}getSettings(e){return Object.keys(o).reduce((t,s)=>{const n=o[s];return n.cat===e&&n.implemented&&!n.hidden&&(n.text=s,t.push(n)),t},[])}sideBarOnClick(e){const t=this;switch($(".contentRegion-3nDuYy, .content-region").first().hide(),$(t.root).show(),e){case"core":t.renderCoreSettings();break;case"emotes":t.renderEmoteSettings();break;case"customcss":t.renderCustomCssEditor();break;case"plugins":t.renderPluginPane();break;case"themes":t.renderThemePane()}}renderSidebar(){const e=this;$("[class*='side-'] > [class*='item-']").off("click.v2settingspanel").on("click.v2settingspanel",()=>{y.reactDom.unmountComponentAtNode(e.root),$(e.root).hide(),$(".contentRegion-3nDuYy, .content-region").first().show()}),e.sidebar.render()}get coreComponent(){return y.react.createElement(U,{contentColumn:!0,fade:!0,dark:!0,children:[y.react.createElement(K,{key:"cspanel",onChange:this.onChange,sections:this.coreSettings}),y.react.createElement(ee,{key:"tools"})]})}get emoteComponent(){return y.react.createElement(U,{contentColumn:!0,fade:!0,dark:!0,children:[y.react.createElement(te,{key:"espanel",title:"Emote Settings",onChange:this.onChange,settings:this.emoteSettings,button:{title:"Clear Emote Cache",onClick:()=>{be.clearEmoteData(),be.init(),R.init()}}}),y.react.createElement(ee,{key:"tools"})]})}get customCssComponent(){return y.react.createElement(U,{contentColumn:!0,fade:!0,dark:!0,children:[y.react.createElement(ie,{key:"csseditor"}),y.react.createElement(ee,{key:"tools"})]})}contentComponent(e){const t="plugins"==e?this.pluginsComponent:this.themesComponent,s=e.replace("s",""),n=this;return y.react.createElement(class extends y.react.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this)}componentDidMount(){E.on(`${s}-reloaded`,this.onChange),E.on(`${s}-loaded`,this.onChange),E.on(`${s}-unloaded`,this.onChange)}componentWillUnmount(){E.off(`${s}-reloaded`,this.onChange),E.off(`${s}-loaded`,this.onChange),E.off(`${s}-unloaded`,this.onChange)}onChange(){n.sideBarOnClick(e)}render(){return t}})}get pluginsComponent(){const e=Object.keys(d).sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).reduce((e,t)=>(e.push(y.react.createElement(ne,{key:t,plugin:d[t].plugin})),e),[]),t=y.react.createElement(H,{key:"plugin-list",className:"bda-slist",children:e}),n=!a["fork-ps-5"]&&y.react.createElement(se,{className:"bd-reload-header",size:"18px",onClick:async()=>{S.updatePluginList(),this.sideBarOnClick("plugins")}}),o=y.react.createElement("button",{key:"folder-button",className:"bd-pfbtn",onClick:()=>{s(1).shell.openItem(B.pluginsFolder)}},"Open Plugin Folder"),r=y.react.createElement(J,{key:"pcolumn",title:"Plugins",children:[n,o,t]});return y.react.createElement(U,{contentColumn:!0,fade:!0,dark:!0,children:[r,y.react.createElement(ee,{key:"tools"})]})}get themesComponent(){const e=Object.keys(l).sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).reduce((e,t)=>(e.push(y.react.createElement(oe,{key:t,theme:l[t]})),e),[]),t=y.react.createElement(H,{key:"theme-list",className:"bda-slist",children:e}),n=!a["fork-ps-5"]&&y.react.createElement(se,{className:"bd-reload-header",size:"18px",onClick:async()=>{D.updateThemeList(),this.sideBarOnClick("themes")}}),o=y.react.createElement("button",{key:"folder-button",className:"bd-pfbtn",onClick:()=>{s(1).shell.openItem(B.themesFolder)}},"Open Theme Folder"),r=y.react.createElement(J,{key:"tcolumn",title:"Themes",children:[n,o,t]});return y.react.createElement(U,{contentColumn:!0,fade:!0,dark:!0,children:[r,y.react.createElement(ee,{key:"tools"})]})}renderCoreSettings(){const e=this.root;e?y.reactDom.render(this.coreComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderEmoteSettings(){const e=this.root;e?y.reactDom.render(this.emoteComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderCustomCssEditor(){const e=this.root;e?y.reactDom.render(this.customCssComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderPluginPane(){const e=this.root;e?y.reactDom.render(this.contentComponent("plugins"),e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderThemePane(){const e=this.root;e?y.reactDom.render(this.contentComponent("themes"),e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}}class le extends y.reactComponent{constructor(e){super(e)}render(){const{sidebar:e,content:t,tools:s}=this.props.children;return y.react.createElement("div",{className:"standardSidebarView-3F1I7i ui-standard-sidebar-view"},y.react.createElement("div",{className:"sidebarRegion-VFTUkN sidebar-region"},y.react.createElement(U,{key:"sidebarScroller",ref:"sidebarScroller",sidebar:!0,fade:e.fade||!0,dark:e.dark||!0,children:e.component})),y.react.createElement("div",{className:"contentRegion-3nDuYy content-region"},y.react.createElement("div",{className:"contentTransitionWrap-3hqOEW content-transition-wrap"},y.react.createElement("div",{className:"scrollerWrap-2lJEkd firefoxFixScrollFlex-cnI2ix contentRegionScrollerWrap-3YZXdm content-region-scroller-wrap scrollerThemed-2oenus themeGhost-28MSn0 scrollerTrack-1ZIpsv"},y.react.createElement("div",{className:"scroller-2FKFPG firefoxFixScrollFlex-cnI2ix contentRegionScroller-26nc1e content-region-scroller scroller",ref:"contentScroller"},y.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},t.component),s.component)))))}}class de extends y.reactComponent{constructor(e){super(e),this.props.server.iconUrl||(this.props.server.iconUrl=this.props.fallback),this.state={imageError:!1,joined:this.props.guildList.includes(this.props.server.identifier)}}render(){const{server:e}=this.props;return y.react.createElement("div",{className:`card-3Qj_Yx cardPrimary-1Hv-to marginBottom8-AtZOdT bd-server-card${e.pinned?" bd-server-card-pinned":""}`},y.react.createElement("img",{ref:"img",className:"bd-server-image",src:e.iconUrl,onError:this.handleError.bind(this)}),y.react.createElement("div",{className:"flexChild-faoVW3 bd-server-content"},y.react.createElement("div",{className:"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6 bd-server-header"},y.react.createElement("h5",{className:"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-name"},e.name),y.react.createElement("h5",{className:"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-member-count"},e.members," Members")),y.react.createElement("div",{className:"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6"},y.react.createElement("div",{className:"scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y bd-server-description-container"},y.react.createElement("div",{className:"scroller-2FKFPG scroller bd-server-description"},e.description))),y.react.createElement("div",{className:"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6 bd-server-footer"},y.react.createElement("div",{className:"flexChild-faoVW3 bd-server-tags",style:{flex:"1 1 auto"}},e.categories.join(", ")),this.state.joined&&y.react.createElement("button",{type:"button",className:"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN colorGreen-29iAKY",style:{minHeight:"12px",marginTop:"4px",backgroundColor:"#3ac15c"}},y.react.createElement("div",{className:"ui-button-contents"},"Joined")),e.error&&y.react.createElement("button",{type:"button",className:"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN disabled-9aF2ug",style:{minHeight:"12px",marginTop:"4px",backgroundColor:"#c13a3a"}},y.react.createElement("div",{className:"ui-button-contents"},"Error")),!e.error&&!this.state.joined&&y.react.createElement("button",{type:"button",className:"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN",style:{minHeight:"12px",marginTop:"4px"},onClick:()=>{this.join()}},y.react.createElement("div",{className:"ui-button-contents"},"Join")))))}handleError(){this.props.server.iconUrl=this.props.fallback,this.setState({imageError:!0})}join(){this.props.join(this)}}class ue extends y.reactComponent{constructor(e){super(e),this.setInitialState(),this.close=this.close.bind(this),this.changeCategory=this.changeCategory.bind(this),this.search=this.search.bind(this),this.searchKeyDown=this.searchKeyDown.bind(this),this.checkConnection=this.checkConnection.bind(this),this.join=this.join.bind(this),this.connect=this.connect.bind(this),this.GuildStore=y.WebpackModules.findByUniqueProperties(["getGuilds"]),this.AvatarDefaults=y.WebpackModules.findByUniqueProperties(["getUserAvatarURL","DEFAULT_AVATARS"]),this.InviteActions=y.WebpackModules.findByUniqueProperties(["acceptInvite"]),this.SortedGuildStore=y.WebpackModules.findByUniqueProperties(["getSortedGuilds"])}componentDidMount(){this.checkConnection()}setInitialState(){this.state={selectedCategory:-1,title:"Loading...",loading:!0,servers:[],next:null,connection:{state:0,user:null}}}close(){y.reactDom.unmountComponentAtNode(document.getElementById(this.props.rootId))}search(e,t){const s=this;$.ajax({method:"GET",url:`${s.endPoint}${e}${e?"&schema=new":"?schema=new"}`,success:e=>{let n=e.results.reduce((e,t)=>(t.joined=!1,e.push(t),e),[]);t||(n=s.state.servers.concat(n));let o=e.size+e.from;e.next=`?from=${o}`,s.state.term&&(e.next+=`&term=${s.state.term}`),s.state.selectedCategory&&(e.next+=`&category=${s.categoryButtons[s.state.selectedCategory]}`),o>=e.total&&(o=e.total,e.next=null);let a=`Showing 1-${o} of ${e.total} results in ${s.categoryButtons[s.state.selectedCategory]}`;s.state.term&&(a+=` for ${s.state.term}`),s.setState({loading:!1,title:a,servers:n,next:e.next}),t&&(s.refs.sbv.refs.contentScroller.scrollTop=0)},error:()=>{s.setState({loading:!1,title:"Failed to load servers. Check console for details"})}})}join(e){if(e.props.pinned)return this.InviteActions.acceptInvite(e.props.invite_code);$.ajax({method:"GET",url:`${this.joinEndPoint}/${e.props.server.identifier}`,headers:{Accept:"application/json;","Content-Type":"application/json;","x-discord-token":this.state.connection.user.accessToken},crossDomain:!0,xhrFields:{withCredentials:!0},success:()=>{e.setState({joined:!0})}})}connect(){const e=this.windowOptions;e.x=Math.round(window.screenX+window.innerWidth/2-e.width/2),e.y=Math.round(window.screenY+window.innerHeight/2-e.height/2),this.joinWindow=new(window.require("electron").remote.BrowserWindow)(e);this.joinWindow.webContents.on("did-navigate",(e,t)=>{"https://auth.discordservers.com/info"==t&&(this.joinWindow.close(),this.checkConnection())}),this.joinWindow.loadURL("https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=https://auth.discordservers.com/info")}get windowOptions(){return{width:500,height:550,backgroundColor:"#282b30",show:!0,resizable:!1,maximizable:!1,minimizable:!1,alwaysOnTop:!0,frame:!1,center:!1,webPreferences:{nodeIntegration:!1}}}get bdServer(){const e=this.SortedGuildStore.guildPositions,t=this.AvatarDefaults.DEFAULT_AVATARS;return y.react.createElement(de,{server:{name:"BetterDiscord",online:"7500+",members:"20000+",categories:["community","programming","support"],description:"Official BetterDiscord server for support etc",identifier:"86004744966914048",iconUrl:"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp",nativejoin:!0,invite_code:"0Tmfo5ZbORCRqbAd",pinned:!0},pinned:!0,join:this.join,guildList:e,fallback:t[Math.floor(5*Math.random())]})}get endPoint(){return"https://search.discordservers.com"}get joinEndPoint(){return"https://j.discordservers.com"}get connectEndPoint(){return"https://join.discordservers.com/connect"}checkConnection(){const e=this;try{$.ajax({method:"GET",url:"https://auth.discordservers.com/info",headers:{Accept:"application/json;","Content-Type":"application/json;"},crossDomain:!0,xhrFields:{withCredentials:!0},success:t=>{e.setState({selectedCategory:0,connection:{state:2,user:t}}),e.search("",!0)},error:()=>{e.setState({title:"Not connected to discordservers.com!",loading:!0,selectedCategory:-1,connection:{state:1,user:null}})}})}catch(t){e.setState({title:"Not connected to discordservers.com!",loading:!0,selectedCategory:-1,connection:{state:1,user:null}})}}render(){return y.react.createElement(le,{ref:"sbv",children:this.component})}get component(){return{sidebar:{component:this.sidebar},content:{component:this.content},tools:{component:y.react.createElement(ee,{key:"pt",ref:"tools",onClick:this.close})}}}get sidebar(){return y.react.createElement("div",{className:"sidebar",key:"ps"},y.react.createElement("div",{className:"ui-tab-bar SIDE"},y.react.createElement("div",{className:"ui-tab-bar-header",style:{fontSize:"16px"}},"Public Servers"),y.react.createElement(_.Separator,null),this.searchInput,y.react.createElement(_.Separator,null),y.react.createElement(_.Header,{text:"Categories"}),this.categoryButtons.map((e,t)=>y.react.createElement(_.Item,{id:t,onClick:this.changeCategory,key:t,text:e,selected:this.state.selectedCategory===t})),y.react.createElement(_.Separator,null),this.footer,this.connection))}get searchInput(){return y.react.createElement("div",{className:"ui-form-item"},y.react.createElement("div",{className:"ui-text-input flex-vertical",style:{width:"172px",marginLeft:"10px"}},y.react.createElement("input",{ref:"searchinput",onKeyDown:this.searchKeyDown,onChange:()=>{},type:"text",className:"input default",placeholder:"Search...",maxLength:"50"})))}searchKeyDown(e){const t=this;if(t.state.loading||13!==e.which)return;t.setState({loading:!0,title:"Loading...",term:e.target.value});let s=`?term=${e.target.value}`;0!==t.state.selectedCategory&&(s+=`&category=${t.categoryButtons[t.state.selectedCategory]}`),t.search(s,!0)}get categoryButtons(){return["All","FPS Games","MMO Games","Strategy Games","MOBA Games","RPG Games","Tabletop Games","Sandbox Games","Simulation Games","Music","Community","Language","Programming","Other"]}changeCategory(e){const t=this;t.state.loading||(t.refs.searchinput.value="",t.setState({loading:!0,selectedCategory:e,title:"Loading...",term:null}),0!==e?t.search(`?category=${t.categoryButtons[e]}`,!0):t.search("",!0))}get content(){const e=this,t=this.SortedGuildStore.guildPositions,s=this.AvatarDefaults.DEFAULT_AVATARS;return 1===e.state.connection.state?e.notConnected:[y.react.createElement("div",{ref:"content",key:"pc",className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},y.react.createElement(Y,{text:e.state.title}),e.bdServer,e.state.servers.map(n=>y.react.createElement(de,{key:n.identifier,server:n,join:e.join,guildList:t,fallback:s[Math.floor(5*Math.random())]})),e.state.next&&y.react.createElement("button",{type:"button",onClick:()=>{e.state.loading||(e.setState({loading:!0}),e.search(e.state.next,!1))},className:"ui-button filled brand small grow",style:{width:"100%",marginTop:"10px",marginBottom:"10px"}},y.react.createElement("div",{className:"ui-button-contents"},e.state.loading?"Loading":"Load More")),e.state.servers.length>0&&y.react.createElement(Y,{text:e.state.title}))]}get notConnected(){return[y.react.createElement("div",{key:"ncc",ref:"content",className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},y.react.createElement("h2",{className:"ui-form-title h2 margin-reset margin-bottom-20"},"Not connected to discordservers.com!",y.react.createElement("button",{onClick:this.connect,type:"button",className:"ui-button filled brand small grow",style:{display:"inline-block",minHeight:"18px",marginLeft:"10px",lineHeight:"14px"}},y.react.createElement("div",{className:"ui-button-contents"},"Connect"))),this.bdServer)]}get footer(){return y.react.createElement("div",{className:"ui-tab-bar-header"},y.react.createElement("a",{href:"https://discordservers.com",target:"_blank"},"Discordservers.com"))}get connection(){const{connection:e}=this.state;return 2!==e.state?y.react.createElement("span",null):y.react.createElement("span",null,y.react.createElement(_.Separator,null),y.react.createElement("span",{style:{color:"#b9bbbe",fontSize:"10px",marginLeft:"10px"}},"Connected as: ",`${e.user.username}#${e.user.discriminator}`),y.react.createElement("div",{style:{padding:"5px 10px 0 10px"}},y.react.createElement("button",{style:{width:"100%",minHeight:"20px"},type:"button",className:"ui-button filled brand small grow"},y.react.createElement("div",{className:"ui-button-contents",onClick:this.connect},"Reconnect"))))}}class he extends y.reactComponent{constructor(e){super(e)}componentDidMount(){$(window).on(`keyup.${this.props.id}`,e=>{27===e.which&&y.reactDom.unmountComponentAtNode(this.refs.root.parentNode)}),$(`#${this.props.id}`).animate({opacity:1},{step:function(e){$(this).css("transform",`scale(${1.1-.1*e}) translateZ(0px)`)},duration:200,done:()=>{$(`#${this.props.id}`).css("opacity","").css("transform","")}})}componentWillUnmount(){$(window).off(`keyup.${this.props.id}`),$(`#${this.props.id}`).animate({opacity:0},{step:function(e){$(this).css("transform",`scale(${1.1-.1*e}) translateZ(0px)`)},duration:200,done:()=>{$(`#${this.props.rootId}`).remove()}}),$('[class*="layer-"]').removeClass("publicServersOpen").animate({opacity:1},{step:function(e){$(this).css("transform",`scale(${.07*e+.93}) translateZ(0px)`)},duration:200,done:()=>{$('[class*="layer-"]').css("opacity","").css("transform","")}})}componentWillMount(){$('[class*="layer-"]').addClass("publicServersOpen").animate({opacity:0},{step:function(e){$(this).css("transform",`scale(${.07*e+.93}) translateZ(0px)`)},duration:200})}render(){return y.react.createElement("div",{className:"layer bd-layer layer-3QrUeG",id:this.props.id,ref:"root",style:{opacity:0,transform:"scale(1.1) translateZ(0px)"}},this.props.children)}}var pe=new class{initialize(){const e=y.guildClasses.wrapper.split(" ")[0];$(`.${e} .scroller-2FKFPG >:first-child`).after(this.button)}get component(){return y.react.createElement(n.Layer,{rootId:"pubslayerroot",id:"pubslayer",children:y.react.createElement(n.Menu,{rootId:"pubslayerroot"})})}get root(){const e=document.getElementById("pubslayerroot");return e||(this.injectRoot()?this.root:null)}injectRoot(){return!!$(".layers, .layers-3iHuyZ").length&&($(".layers, .layers-3iHuyZ").append($("<div/>",{id:"pubslayerroot"})),!0)}render(){const e=this.root;e?y.reactDom.render(this.component,e):console.log("FAILED TO LOCATE ROOT: .layers")}get button(){return $("<div/>",{class:y.guildClasses.listItem,id:"bd-pub-li",style:a["bda-gs-1"]?"":"display: none;"}).append($("<div/>",{class:"wrapper-25eVIn "+y.guildClasses.circleButtonMask,text:"public",id:"bd-pub-button",click:()=>{this.render()}}))}},me=new class{enable(){$(".scroller.guild-channels ul").first().css("display","none"),$(".scroller.guild-channels header").first().css("display","none"),$(".app.flex-vertical, .app-2rEoOp").first().css("overflow","hidden"),$(".chat-3bRxxu").first().css("visibility","hidden").css("min-width","0px"),$(".flex-vertical.channels-wrap").first().css("flex-grow","100000"),$(".guild-header .btn.btn-hamburger").first().css("visibility","hidden")}disable(){$(".scroller.guild-channels ul").first().css("display",""),$(".scroller.guild-channels header").first().css("display",""),$(".app.flex-vertical, .app-2rEoOp").first().css("overflow",""),$(".chat-3bRxxu").first().css("visibility","").css("min-width",""),$(".flex-vertical.channels-wrap").first().css("flex-grow",""),$(".guild-header .btn.btn-hamburger").first().css("visibility","")}};class ge extends y.reactComponent{constructor(e){super(e);const t=!!(R&&R.favoriteEmotes&&R.favoriteEmotes[this.label]);this.state={shouldAnimate:!this.animateOnHover,isFavorite:t},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onClick=this.onClick.bind(this)}get animateOnHover(){return a["fork-es-2"]}get label(){return this.props.modifier?`${this.props.name}:${this.props.modifier}`:this.props.name}get modifierClass(){return this.props.modifier?` emote${this.props.modifier}`:""}onMouseEnter(){!this.state.shouldAnimate&&this.animateOnHover&&this.setState({shouldAnimate:!0}),!this.state.isFavorite&&R.favoriteEmotes[this.label]?this.setState({isFavorite:!0}):this.state.isFavorite&&!R.favoriteEmotes[this.label]&&this.setState({isFavorite:!1})}onMouseLeave(){this.state.shouldAnimate&&this.animateOnHover&&this.setState({shouldAnimate:!1})}onClick(e){this.props.onClick&&this.props.onClick(e)}render(){return y.react.createElement(y.TooltipWrapper,{color:"black",position:"top",text:this.label,delay:750},y.react.createElement("div",{className:"emotewrapper"+(this.props.jumboable?" jumboable":""),onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onClick:this.onClick},y.react.createElement("img",{draggable:!1,className:"emote"+this.modifierClass+(this.props.jumboable?" jumboable":"")+(this.state.shouldAnimate?"":" stop-animation"),dataModifier:this.props.modifier,alt:this.label,src:this.props.url}),y.react.createElement("input",{className:"fav"+(this.state.isFavorite?" active":""),title:"Favorite!",type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),this.state.isFavorite?(delete R.favoriteEmotes[this.label],R.updateFavorites()):R.favorite(this.label,this.props.url),this.setState({isFavorite:!this.state.isFavorite})}})))}}function fe(){Object.defineProperty(this,"categories",{get:function(){const e=[];for(const t in window.bdEmoteSettingIDs)a[window.bdEmoteSettingIDs[t]]&&e.push(t);return e}})}window.emotesFfz={},window.emotesBTTV={},window.emotesBTTV2={},window.emotesTwitch={},window.subEmotesTwitch={},window.bdEmotes={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{},BTTV2:{}},window.bdEmoteSettingIDs={TwitchGlobal:"bda-es-7",TwitchSubscriber:"bda-es-7",BTTV:"bda-es-2",FrankerFaceZ:"bda-es-1",BTTV2:"bda-es-2"},fe.prototype.init=async function(){this.modifiers=["flip","spin","pulse","spin2","spin3","1spin","2spin","3spin","tr","bl","br","shake","shake2","shake3","flap"],this.overrides=["twitch","bttv","ffz"];const e={TwitchGlobal:{url:"https://twitchemotes.com/api_cache/v3/global.json",backup:"https://rauenzi.github.io/BetterDiscordApp/data/emotedata_twitch_global.json",variable:"TwitchGlobal",oldVariable:"emotesTwitch",getEmoteURL:e=>`https://static-cdn.jtvnw.net/emoticons/v1/${e.id}/1.0`,getOldData:(e,t)=>({id:e.match(/\/([0-9]+)\//)[1],code:t,emoticon_set:0,description:null})},TwitchSubscriber:{url:"https://rauenzi.github.io/BetterDiscordApp/data/emotedata_twitch_subscriber.json",variable:"TwitchSubscriber",oldVariable:"subEmotesTwitch",getEmoteURL:e=>`https://static-cdn.jtvnw.net/emoticons/v1/${e}/1.0`,getOldData:e=>e.match(/\/([0-9]+)\//)[1]},FrankerFaceZ:{url:"https://rauenzi.github.io/BetterDiscordApp/data/emotedata_ffz.json",variable:"FrankerFaceZ",oldVariable:"emotesFfz",getEmoteURL:e=>`https://cdn.frankerfacez.com/emoticon/${e}/1`,getOldData:e=>e.match(/\/([0-9]+)\//)[1]},BTTV:{url:"https://api.betterttv.net/emotes",variable:"BTTV",oldVariable:"emotesBTTV",parser:e=>{const t={};for(let s=0,n=e.emotes.length;s<n;s++){const n=e.emotes[s];t[n.regex]=n.url}return t},getEmoteURL:e=>`${e}`,getOldData:e=>e},BTTV2:{url:"https://rauenzi.github.io/BetterDiscordApp/data/emotedata_bttv.json",variable:"BTTV2",oldVariable:"emotesBTTV2",getEmoteURL:e=>`https://cdn.betterttv.net/emote/${e}/1x`,getOldData:e=>e.match(/emote\/(.+)\//)[1]}};for(await this.getBlacklist(),await this.loadEmoteData(e);!y.MessageContentComponent;)await new Promise(e=>setTimeout(e,100));this.cancelEmoteRender||(this.cancelEmoteRender=h.monkeyPatch(y.MessageContentComponent.prototype,"render",{after:({returnValue:e})=>{h.monkeyPatch(e.props,"children",{silent:!0,after:({returnValue:e})=>{if(0==this.categories.length)return;const t=e.props.children[1];if(!t.props.children)return;const s=t.props.children[1];if(s&&s.length){for(let e=0;e<s.length;e++){const t=s[e];if("string"!=typeof t)continue;const n=t.split(/([^\s]+)([\s]|$)/g);for(let t=0,o=this.categories.length;t<o;t++)for(let o=0,r=n.length;o<r;o++){const r=n[o].split(":"),i=r[0];let c=r[1]?r[1]:"",l=c.slice(0);if(i.length<4||u.includes(i))continue;this.modifiers.includes(c)&&a["bda-es-8"]||(c=""),this.overrides.includes(l)?c=l:l="";let d=this.categories[t];if("twitch"===l?window.bdEmotes.TwitchGlobal[i]?d="TwitchGlobal":window.bdEmotes.TwitchSubscriber[i]&&(d="TwitchSubscriber"):"bttv"===l?window.bdEmotes.BTTV[i]?d="BTTV":window.bdEmotes.BTTV2[i]&&(d="BTTV2"):"ffz"===l&&window.bdEmotes.FrankerFaceZ[i]&&(d="FrankerFaceZ"),!window.bdEmotes[d][i]||!a[window.bdEmoteSettingIDs[d]])continue;const p=s[e].match(new RegExp(`([\\s]|^)${h.escape(c?i+":"+c:i)}([\\s]|$)`));if(!p)continue;const m=s[e].substring(0,p.index+p[1].length),g=s[e].substring(p.index+p[0].length-p[2].length);s[e]=m;const f=y.react.createElement(ge,{name:i,url:window.bdEmotes[d][i],modifier:c});s.splice(e+1,0,g),s.splice(e+1,0,f)}}if(s.every(e=>"string"==typeof e&&""==e.replace(/\s*/,"")||(!(!e.type||"BDEmote"!=e.type.name)||!!(e.props&&e.props.children&&e.props.children.props&&e.props.children.props.emojiName))))for(const e of s)"object"==typeof e&&("BDEmote"==e.type.name?e.props.jumboable=!0:e.props&&e.props.children&&e.props.children.props&&e.props.children.props.emojiName&&(e.props.children.props.jumboable=!0))}}})}}))},fe.prototype.disable=function(){this.disableAutoCapitalize(),this.cancelEmoteRender||(this.cancelEmoteRender(),this.cancelEmoteRender=null)},fe.prototype.clearEmoteData=async function(){const e=s(0),t=r.dataPath+"emote_data.json";e.existsSync(t)&&e.unlinkSync(t),f.setBDData("emoteCacheDate",(new Date).toJSON()),window.bdEmotes={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{},BTTV2:{}}},fe.prototype.goBack=async function(e){for(const t in e)for(const s in window.bdEmotes[e[t].variable])window[e[t].oldVariable][s]=e[t].getOldData(window.bdEmotes[e[t].variable][s],s)},fe.prototype.isCacheValid=function(){const e=f.getBDData("emoteCacheDays")||f.setBDData("emoteCacheDays",7)||7,t=new Date(f.getBDData("emoteCacheDate")||null),s=new Date;return!(Math.round(Math.abs((s.getTime()-t.getTime())/864e5))>e)||(f.setBDData("emoteCacheDate",s.toJSON()),!1)},fe.prototype.loadEmoteData=async function(e){const t=s(0),n=r.dataPath+"emote_data.json";if(t.existsSync(n)&&this.isCacheValid()){a["fork-ps-2"]&&v.showToast("Loading emotes from cache.",{type:"info"}),h.log("Emotes","Loading emotes from local cache.");const s=await new Promise(e=>{t.readFile(n,"utf8",(t,s)=>{h.log("Emotes","Emotes loaded from cache."),t&&(s={}),e(s)})});let o=h.testJSON(s);o&&(window.bdEmotes=JSON.parse(s));for(const t in e)o=Object.keys(window.bdEmotes[e[t].variable]).length>0;if(o)return void(a["fork-ps-2"]&&v.showToast("Emotes successfully loaded.",{type:"success"}));h.log("Emotes","Cache was corrupt, downloading..."),t.unlinkSync(n)}if(a["fork-es-3"]){a["fork-ps-2"]&&v.showToast("Downloading emotes in the background do not reload.",{type:"info"});for(const t in e){await new Promise(e=>setTimeout(e,1e3));const s=await this.downloadEmotes(e[t]);window.bdEmotes[e[t].variable]=s}a["fork-ps-2"]&&v.showToast("All emotes successfully downloaded.",{type:"success"});try{t.writeFileSync(n,JSON.stringify(window.bdEmotes),"utf8")}catch(e){h.err("Emotes","Could not save emote data.",e)}}},fe.prototype.downloadEmotes=function(e){const t=s(5),n={url:e.url,timeout:e.timeout?e.timeout:5e3};return h.log("Emotes",`Downloading: ${e.variable} (${e.url})`),new Promise((s,o)=>{t(n,(t,n,a)=>{if(t)return h.err("Emotes","Could not download "+e.variable,t),e.backup?(e.url=e.backup,e.backup=null,e.backupParser&&(e.parser=e.backupParser),s(this.downloadEmotes(e))):o({});let r={};try{r=JSON.parse(a)}catch(t){return h.err("Emotes","Could not download "+e.variable,t),e.backup?(e.url=e.backup,e.backup=null,e.backupParser&&(e.parser=e.backupParser),s(this.downloadEmotes(e))):o({})}"function"==typeof e.parser&&(r=e.parser(r));for(const t in r)t.length<4||u.includes(t)?delete r[t]:r[t]=e.getEmoteURL(r[t]);s(r),h.log("Emotes","Downloaded: "+e.variable)})})},fe.prototype.getBlacklist=function(){return new Promise(e=>{$.getJSON("https://rauenzi.github.io/BetterDiscordApp/data/emotefilter.json",function(t){e(u.push(...t.blacklist))})})},fe.prototype.autoCapitalize=function(){a["bda-es-4"]&&!this.autoCapitalizeActive&&($("body").on("keyup.bdac change.bdac paste.bdac",$(".channelTextArea-1LDbYG textarea:first"),()=>{const e=$(".channelTextArea-1LDbYG textarea:first").val();if(null==e)return;const t=e.split(" ").pop();if(t.length>3){if("danSgame"==t)return;const s=this.capitalize(t.toLowerCase());null!=s&&h.insertText(h.getTextArea()[0],e.replace(t,s))}}),this.autoCapitalizeActive=!0)},fe.prototype.capitalize=function(e){const t=window.bdEmotes.TwitchGlobal;for(const s in t)if(t.hasOwnProperty(s)&&e==(s+"").toLowerCase())return s},fe.prototype.disableAutoCapitalize=function(){this.autoCapitalizeActive=!1,$("body").off(".bdac")};var be=new fe,ve=new class{constructor(){this.renderer=new ce({onChange:this.updateSettings.bind(this)})}renderSidebar(){this.renderer.renderSidebar()}updateSettings(e,t){a[e]=t,"bda-es-0"==e&&(t?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide()),"bda-gs-2"==e&&(t?$("body").addClass("bd-minimal"):$("body").removeClass("bd-minimal")),"bda-gs-3"==e&&(t?$("body").addClass("bd-minimal-chan"):$("body").removeClass("bd-minimal-chan")),"bda-gs-1"==e&&(t?$("#bd-pub-li").show():$("#bd-pub-li").hide()),"bda-gs-4"==e&&(t?me.enable():me.disable()),"bda-gs-5"==e&&(t?$("#app-mount").addClass("bda-dark"):$("#app-mount").removeClass("bda-dark")),t&&"bda-gs-6"==e&&we.inject24Hour(),"bda-gs-7"==e&&(t?we.injectColoredText():we.removeColoredText()),"bda-es-4"==e&&(t?be.autoCapitalize():be.disableAutoCapitalize()),"fork-ps-4"==e&&(t?C.start():C.stop()),"fork-ps-5"==e&&(t?(B.watchContent("plugin"),B.watchContent("theme")):(B.unwatchContent("plugin"),B.unwatchContent("theme"))),"fork-wp-1"==e&&(v.setWindowPreference("transparent",t),t?v.setWindowPreference("backgroundColor",null):v.setWindowPreference("backgroundColor","#2f3136")),"bda-gs-8"==e&&(t?I.enable(a["fork-dm-1"]):I.disable()),we.saveSettings()}initializeSettings(){a["bda-es-0"]&&$("#twitchcord-button-container").show(),a["bda-gs-2"]&&$("body").addClass("bd-minimal"),a["bda-gs-3"]&&$("body").addClass("bd-minimal-chan"),a["bda-gs-1"]&&$("#bd-pub-li").show(),a["bda-gs-4"]&&me.enable(),a["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),a["bda-gs-6"]&&we.inject24Hour(),a["bda-gs-7"]&&we.injectColoredText(),a["bda-es-4"]&&be.autoCapitalize(),a["fork-ps-4"]&&C.start(),a["fork-ps-5"]&&(B.watchContent("plugin"),B.watchContent("theme")),a["bda-gs-8"]&&I.enable(a["fork-dm-1"]),we.saveSettings()}};function ye(){}ye.prototype.setConfig=function(e){Object.assign(r,e)},ye.prototype.init=async function(){if(r.version<r.minSupportedVersion)return void this.alert("Not Supported","BetterDiscord v"+r.version+" (your version) is not supported by the latest js ("+r.bbdVersion+").<br><br> Please download the latest version from <a href='https://github.com/rauenzi/BetterDiscordApp/releases/latest' target='_blank'>GitHub</a>");const e=r.updater?r.updater.LatestVersion:r.latestVersion;e>r.version&&this.alert("Update Available",`\n An update for BandagedBD is available (${e})! Please Reinstall!<br /><br />\n <a href='https://github.com/rauenzi/BetterDiscordApp/releases/latest' target='_blank'>Download Installer</a>\n `),h.log("Startup","Initializing Settings"),this.initSettings(),h.log("Startup","Initializing EmoteModule"),window.emotePromise=be.init().then(()=>{be.initialized=!0,h.log("Startup","Initializing QuickEmoteMenu"),R.init()}),this.injectExternals(),await this.checkForGuilds(),y.initialize(),h.log("Startup","Updating Settings"),ve.initializeSettings(),h.log("Startup","Loading Plugins");const t=S.loadPlugins();h.log("Startup","Loading Themes");const s=D.loadThemes();$("#customcss").detach().appendTo(document.head),window.addEventListener("beforeunload",function(){a["bda-dc-0"]&&document.querySelector(".btn.btn-disconnect").click()}),pe.initialize(),be.autoCapitalize(),h.log("Startup","Removing Loading Icon"),document.getElementsByClassName("bd-loaderv2")[0].remove(),h.log("Startup","Initializing Main Observer"),this.initObserver(),a["fork-ps-1"]&&(h.log("Startup","Collecting Startup Errors"),this.showContentErrors({plugins:t,themes:s}))},ye.prototype.checkForGuilds=function(){return new Promise(e=>{const t=function(){const s=y.guildClasses.wrapper.split(" ")[0],n=y.guildClasses.listItem.split(" ")[0],o=y.guildClasses.blobContainer.split(" ")[0];if(document.querySelectorAll(`.${s} .${n} .${o}`).length>0)return e(r.deferLoaded=!0);setTimeout(t,100)};$(document).ready(function(){setTimeout(t,100)})})},ye.prototype.injectExternals=async function(){await h.injectJs("https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js"),window.require.original&&(window.require=window.require.original)},ye.prototype.initSettings=function(){if(f.initialize(),!f.getSettingGroup("settings"))return this.saveSettings();const e=this.loadSettings();$('<style id="customcss">').text(atob(f.getBDData("bdcustomcss"))).appendTo(document.head);for(const t in e)void 0!==e[t]&&(a[t]=e[t]);this.saveSettings()},ye.prototype.saveSettings=function(){f.setSettingGroup("settings",a)},ye.prototype.loadSettings=function(){return f.getSettingGroup("settings")},ye.prototype.initObserver=function(){new MutationObserver(e=>{for(let t=0,s=e.length;t<s;t++){const s=e[t];if(void 0!==S&&S.rawObserver(s),!(s.addedNodes.length&&s.addedNodes[0]instanceof Element))continue;const n=s.addedNodes[0];n.classList.contains("layer-3QrUeG")&&(n.getElementsByClassName("guild-settings-base-section").length&&n.setAttribute("layer-id","server-settings"),n.getElementsByClassName("socialLinks-3jqNFy").length&&(n.setAttribute("layer-id","user-settings"),n.setAttribute("id","user-settings"),document.getElementById("bd-settings-sidebar")||ve.renderSidebar())),n.classList.contains("popout-3sVMXz")&&!n.classList.contains("popoutLeft-30WmrD")&&n.getElementsByClassName("emojiPicker-3m1S-j").length&&R.obsCallback(n)}}).observe(document,{childList:!0,subtree:!0})},ye.prototype.inject24Hour=function(){if(this.cancel24Hour)return;const e=new RegExp("([0-9]{1,2}):([0-9]{1,2})\\s(AM|PM)"),t=t=>{if(!a["bda-gs-6"])return;const s=t.returnValue.match(e);return s&&4===s.length?"AM"===s[3]?t.returnValue=t.returnValue.replace(s[0],`${"12"===s[1]?"00":s[1].padStart(2,"0")}:${s[2]}`):t.returnValue=t.returnValue.replace(s[0],`${"12"===s[1]?"12":parseInt(s[1])+12}:${s[2]}`):void 0},s=h.monkeyPatch(y.TimeFormatter,"calendarFormat",{after:t}),n=h.monkeyPatch(y.TimeFormatter,"dateFormat",{after:t});this.cancel24Hour=()=>{s(),n()}},ye.prototype.injectColoredText=function(){this.cancelColoredText||(this.cancelColoredText=h.monkeyPatch(y.MessageContentComponent.prototype,"render",{after:e=>{a["bda-gs-7"]&&h.monkeyPatch(e.returnValue.props,"children",{silent:!0,after:({returnValue:t})=>{const s=t.props.children[1],n=e.thisObject.props.message.colorString;return s&&n&&(s.props.style={color:n}),t}})}}))},ye.prototype.removeColoredText=function(){document.querySelectorAll(".markup-2BOw-j").forEach(e=>{e.style.setProperty("color","")})},ye.prototype.alert=function(e,t){const s=$(`<div class="bd-modal-wrapper theme-dark">\n <div class="bd-backdrop backdrop-1wrmKB"></div>\n <div class="bd-modal modal-1UGdnR">\n <div class="bd-modal-inner inner-1JeGVc">\n <div class="header header-1R_AjF">\n <div class="title">${e}</div>\n </div>\n <div class="bd-modal-body">\n <div class="scroller-wrap fade">\n <div class="scroller">\n ${t}\n </div>\n </div>\n </div>\n <div class="footer footer-2yfCgX">\n <button type="button">Okay</button>\n </div>\n </div>\n </div>\n </div>`);s.find(".footer button").on("click",()=>{s.addClass("closing"),setTimeout(()=>{s.remove()},300)}),s.find(".bd-backdrop").on("click",()=>{s.addClass("closing"),setTimeout(()=>{s.remove()},300)}),s.appendTo("#app-mount")},ye.prototype.showContentErrors=function({plugins:e=[],themes:t=[]}){if(!e||!t)return;if(!e.length&&!t.length)return;const s=$('<div class="bd-modal-wrapper theme-dark">\n <div class="bd-backdrop backdrop-1wrmKB"></div>\n <div class="bd-modal bd-content-modal modal-1UGdnR">\n <div class="bd-modal-inner inner-1JeGVc">\n <div class="header header-1R_AjF"><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 footer-2yfCgX">\n <button type="button">Okay</button>\n </div>\n </div>\n </div>\n </div>');function n(e){const t=$('<div class="errors">');for(const s of e){const e=$(`<div class="error">\n <div class="table-column column-name">${s.name?s.name:s.file}</div>\n <div class="table-column column-message">${s.message}</div>\n <div class="table-column column-error"><a class="error-link" href="">${s.error?s.error.message:""}</a></div>\n </div>`);t.append(e),s.error&&e.find("a").on("click",e=>{e.preventDefault(),h.err("ContentManager",`Error details for ${s.name?s.name:s.file}.`,s.error)})}return t}const o=[n(e),n(t)];s.find(".tab-bar-item").on("click",e=>{e.preventDefault(),s.find(".tab-bar-item").removeClass("selected"),$(e.target).addClass("selected"),s.find(".scroller").empty().append(o[$(e.target).index()])}),s.find(".footer button").on("click",()=>{s.addClass("closing"),setTimeout(()=>{s.remove()},300)}),s.find(".bd-backdrop").on("click",()=>{s.addClass("closing"),setTimeout(()=>{s.remove()},300)}),s.appendTo("#app-mount"),e.length?s.find(".tab-bar-item")[0].click():s.find(".tab-bar-item")[1].click()},ye.prototype.showToast=function(e,t={}){if(!r.deferLoaded)return;if(!document.querySelector(".bd-toasts")){const e=document.createElement("div");e.classList.add("bd-toasts");const t=document.querySelector(".chat-3bRxxu form, #friends, .noChannel-Z1DQK7, .activityFeed-28jde9");e.style.setProperty("left",t?t.getBoundingClientRect().left+"px":"0px"),e.style.setProperty("width",t?t.offsetWidth+"px":"100%"),e.style.setProperty("bottom",(document.querySelector(".chat-3bRxxu form")?document.querySelector(".chat-3bRxxu form").offsetHeight:80)+"px"),document.querySelector(".app, .app-2rEoOp").appendChild(e)}const{type:s="",icon:n=!0,timeout:o=3e3}=t,a=document.createElement("div");a.classList.add("bd-toast"),s&&a.classList.add("toast-"+s),s&&n&&a.classList.add("icon"),a.innerText=e,document.querySelector(".bd-toasts").appendChild(a),setTimeout(()=>{a.classList.add("closing"),setTimeout(()=>{a.remove(),document.querySelectorAll(".bd-toasts .bd-toast").length||document.querySelector(".bd-toasts").remove()},300)},o)};var we=new ye;s.d(t,"default",function(){return ke}),function(){const e=s(0),t=process.platform,n=("win32"===t?process.env.APPDATA:"darwin"===t?process.env.HOME+"/Library/Preferences":process.env.HOME+"/.config")+"/BetterDiscord/";let o={};if(e.existsSync(`${n}localStorage.json`))try{o=JSON.parse(e.readFileSync(`${n}localStorage.json`))}catch(e){console.log(e)}else if(e.existsSync("localStorage.json"))try{o=JSON.parse(e.readFileSync("localStorage.json"))}catch(e){console.log(e)}const a=o;a.setItem=function(e,t){a[e]=t,this.save()},a.getItem=function(e){return a[e]||null},a.save=function(){e.writeFileSync(`${n}localStorage.json`,JSON.stringify(this),null,4)};const r=new Proxy(a,{set:function(e,t,s){a[t]=s,a.save()},get:function(e,t){return a[t]||null}});window.localStorage=r}();const Ce=document.createElement("div");Ce.className="bd-loaderv2",Ce.title="BandagedBD is loading...",document.body.appendChild(Ce),window.BdApi=v,window.settings=o,window.settingsCookie=a,window.pluginCookie=i,window.themeCookie=c,window.pluginModule=S,window.themeModule=D,window.bdthemes=l,window.bdplugins=d,window.bemotes=u,window.bdPluginStorage=class{static get(e,t){return h.warn("Deprecation Notice",`${e}, please use BdApi.loadData() or BdApi.getData(). bdPluginStorage may be removed in future versions.`),f.getPluginData(e,t)||null}static set(e,t,s){if(h.warn("Deprecation Notice",`${e}, please use BdApi.saveData() or BdApi.setData(). bdPluginStorage may be removed in future versions.`),void 0===s)return h.warn("Deprecation Notice","Trying to set undefined value in plugin "+e);f.setPluginData(e,t,s)}static delete(e,t){h.warn("Deprecation Notice",`${e}, please use BdApi.deleteData(). bdPluginStorage may be removed in future versions.`),f.deletePluginData(e,t)}};class ke{constructor(e){we.setConfig(e)}init(){we.init()}}}]).default;