Lightcord/BetterDiscordApp/dist/index.min.js.map

1 line
595 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["webpack://BetterDiscord/webpack/bootstrap","webpack://BetterDiscord/external \"electron\"","webpack://BetterDiscord/external \"path\"","webpack://BetterDiscord/external \"fs\"","webpack://BetterDiscord/external \"crypto\"","webpack://BetterDiscord/external \"node-fetch\"","webpack://BetterDiscord/external \"events\"","webpack://BetterDiscord/external \"module\"","webpack://BetterDiscord/./src/0globals.js","webpack://BetterDiscord/./src/modules/webpackModules.js","webpack://BetterDiscord/./src/modules/dataStore.js","webpack://BetterDiscord/./src/modules/bdEvents.js","webpack://BetterDiscord/./src/modules/pluginModule.js","webpack://BetterDiscord/./src/ui/tooltip.js","webpack://BetterDiscord/./src/ui/tooltipWrap.js","webpack://BetterDiscord/./src/modules/pluginCertifier.js","webpack://BetterDiscord/./src/modules/contentManager.js","webpack://BetterDiscord/./src/modules/domtools.js","webpack://BetterDiscord/./src/modules/themeModule.js","webpack://BetterDiscord/./src/modules/v2.js","webpack://BetterDiscord/./src/modules/utils.js","webpack://BetterDiscord/./src/modules/settingsPanelSidebar.js","webpack://BetterDiscord/./src/modules/coloredText.js","webpack://BetterDiscord/./src/modules/24hour.js","webpack://BetterDiscord/./src/ui/settingsTitle.js","webpack://BetterDiscord/./src/ui/tabBarSeparator.js","webpack://BetterDiscord/./src/ui/publicservers/serverCard.js","webpack://BetterDiscord/./src/modules/hooks.js","webpack://BetterDiscord/./src/ui/publicservers/publicServers.js","webpack://BetterDiscord/./src/svg/bug_hunter.jsx","webpack://BetterDiscord/./src/svg/circus.jsx","webpack://BetterDiscord/./src/modules/distant.js","webpack://BetterDiscord/./src/modules/Layers.jsx","webpack://BetterDiscord/./src/modules/publicServers.js","webpack://BetterDiscord/./src/modules/voiceMode.js","webpack://BetterDiscord/./src/modules/classNormalizer.js","webpack://BetterDiscord/./src/modules/devMode.js","webpack://BetterDiscord/./src/ui/components/switch.jsx","webpack://BetterDiscord/./src/ui/switch.js","webpack://BetterDiscord/./src/ui/margintop.jsx","webpack://BetterDiscord/./src/ui/settingsGroup.jsx","webpack://BetterDiscord/./src/ui/sectionedSettingsPanel.js","webpack://BetterDiscord/./src/ui/checkbox.js","webpack://BetterDiscord/./src/ui/cssEditorDetached.js","webpack://BetterDiscord/./src/ui/cssEditor.js","webpack://BetterDiscord/./src/ui/errorBoundary.js","webpack://BetterDiscord/./src/ui/contentColumn.js","webpack://BetterDiscord/./src/ui/reloadIcon.js","webpack://BetterDiscord/./src/ui/xSvg.js","webpack://BetterDiscord/./src/ui/icons/edit.jsx","webpack://BetterDiscord/./src/ui/icons/delete.jsx","webpack://BetterDiscord/./src/ui/addoncard.jsx","webpack://BetterDiscord/./src/ui/icons/downarrow.jsx","webpack://BetterDiscord/./src/ui/components/dropdown.jsx","webpack://BetterDiscord/./src/ui/icons/search.jsx","webpack://BetterDiscord/./src/ui/components/search.jsx","webpack://BetterDiscord/./src/ui/addonlist.jsx","webpack://BetterDiscord/./src/modules/CustomRichPresence.js","webpack://BetterDiscord/./src/ui/presenceSettings.jsx","webpack://BetterDiscord/./src/ui/AccountInfos.jsx","webpack://BetterDiscord/./src/modules/AntiAdDM.js","webpack://BetterDiscord/./src/modules/blurPrivate.js","webpack://BetterDiscord/./src/modules/disableTyping.js","webpack://BetterDiscord/./src/ui/ApiPreview.jsx","webpack://BetterDiscord/./src/ui/icons/history.jsx","webpack://BetterDiscord/./src/modules/popoutWindow.js","webpack://BetterDiscord/./src/modules/settingsPanel.js","webpack://BetterDiscord/./src/ui/bdLogo.js","webpack://BetterDiscord/./src/svg/Lightcord.jsx","webpack://BetterDiscord/./src/modules/emojiModule.js","webpack://BetterDiscord/./src/modules/core.js","webpack://BetterDiscord/./src/modules/bdApi.js","webpack://BetterDiscord/./src/localStorageFix.js","webpack://BetterDiscord/./src/index.js","webpack://BetterDiscord/./src/loadingIcon.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","minimumDiscordVersion","currentDiscordVersion","window","DiscordNative","remoteApp","getVersion","minSupportedVersion","bbdVersion","bbdChangelog","description","changes","title","type","items","settings","id","info","implemented","hidden","cat","category","experimental","process","platform","defaultCookie","settingsCookie","settingsRPC","defaultRPC","Date","now","lightcordSettings","defaultLightcordSettings","bdpluginErrors","bdthemeErrors","bdConfig","BetterDiscordConfig","bdthemes","bdplugins","pluginCookie","themeCookie","req","webpackJsonp","push","__extra_id__","find","filter","default","mod","findAll","findByProps","propNames","every","prop","undefined","findByPrototypes","protoNames","protoProp","findByDisplayName","displayName","Lightcord","BetterDiscord","WebpackModules","__non_webpack_require__","fs","path","releaseChannel","globals","app","getReleaseChannel","dataPath","env","APPDATA","join","HOME","XDG_CONFIG_HOME","constructor","this","data","stable","canary","ptb","pluginData","DataStore","initialize","existsSync","BDFile","writeFileSync","JSON","stringify","parse","readFileSync","settingsFile","unlinkSync","assign","setBDData","err","console","error","Utils","alert","_injectionPath","_configFile","resolve","injectionPath","_BDFile","_settingsFile","getPluginFile","pluginName","ContentManager","pluginsFolder","getSettingGroup","setSettingGroup","getBDData","getPluginData","setPluginData","deletePluginData","EventEmitter","super","BDEvents","dispatch","eventName","args","emit","off","eventAction","removeListener","PluginModule","loadPlugins","async","loadPluginData","splice","plugins","keys","length","plugin","getName","load","file","filename","message","stack","start","showToast","Promise","setTimeout","savePluginData","remote","getCurrentWebContents","on","channelSwitch","startPlugin","reload","stopPlugin","stop","enablePlugin","enable","disablePlugin","disable","togglePlugin","toggle","loadPlugin","loadContent","showContentErrors","values","log","unloadPlugin","filenameOrName","bdplugin","unloadContent","delete","fullPath","reloadPlugin","enabled","reloadContent","edit","shell","openItem","updatePluginList","results","loadNewContent","added","removed","saved","newMessage","onMessage","onSwitch","rawObserver","e","observer","TooltipClasses","TooltipLayers","getTooltipClasses","getTooltipLayers","getClass","sideOrColor","upperCase","toUpperCase","slice","tooltipClass","classExists","toPx","EmulatedTooltip","node","text","options","style","side","preventFlip","disabled","attachEvents","jQuery","label","toLowerCase","element","document","createElement","className","layer","disabledPointerEvents","tooltipElement","tooltip","labelElement","tooltipContent","pointerElement","tooltipPointer","append","addEventListener","show","MutationObserver","mutations","forEach","mutation","nodes","Array","from","removedNodes","directMatch","indexOf","parentMatch","some","parent","contains","hide","disconnect","observe","body","subtree","childList","querySelector","removeDa","BDModules","popouts","layerContainer","getBoundingClientRect","top","offsetHeight","screenHeight","left","offsetWidth","screenWidth","remove","_className","textContent","container","canShowAbove","showAbove","showBelow","canShowBelow","canShowLeft","showLeft","showRight","canShowRight","classList","add","setProperty","centerHorizontally","centerVertically","nodecenter","React","Component","props","BDV2","reactDom","findDOMNode","Tooltip","componentWillUnmount","render","children","cache","cache2","PluginCertifier","patch","attachment","nextTick","getElementById","url","startsWith","endsWith","nodeFetch","headers","electron","userAgent","then","res","status","Error","hash","crypto","Buffer","alloc","chunk","concat","update","hashResult","digest","hashToUrl","checkHash","result","div","childNodes","flowerStarModule","flowerStarContainer","childModule","childContainer","suspect","parentNode","borderColor","nextNode","child","tagName","preventDefault","stopImmediatePropagation","showConfirmationModal","harm","confirmText","cancelText","danger","onCancel","onConfirm","openExternal","href","includes","react","tooltipWrap","width","height","svg","viewBox","x","y","mask","fill","pointerEvents","official","span","display","float","flowerStar","stroke","color","onClick","link","getKeyedArray","content","buffer","installPath","contentManager","_pluginsFolder","_themesFolder","catch","cursor","fill-rule","class","renderToElements","elem","processAttachment","isTrusted","tests","threats","checkViruses","resultCallback","removeCallback","isHarmful","no_comments","toString","replace","trim","test","scrpt","exec","split","pop","json","processFile","__path","isFromLoader","createReadStream","addonCache","timestamp","saveAddonCache","basename","obj","arr","k","save","generateKey","encryptSettingsCache","cipher","encrypted","final","Api","ensureExported","ObjectStorage","localStorageModule","localStorage","impl","set","btoa","setInterval","val","safeJSONParse","atob","isArray","Module","globalPaths","getAppPath","MetaError","originalJSRequire","_extensions","originalCSSRequire","splitRegex","escapedAtRegex","hasPatched","timeCache","watchers","patchExtensions","getContentRequire","realpathSync","loadAddonCertifierCache","dataStore","decipher","decrypted","decryptSettingsCache","watchContent","contentType","isPlugin","baseFolder","themesFolder","fileEnding","watch","persistent","eventType","statSync","code","pluginModule","themeModule","unloadTheme","isFile","stats","mtime","getTime","loadTheme","reloadTheme","unwatchContent","close","extractMeta","firstLine","parseOldMeta","parseNewMeta","meta","rawMeta","substring","lastIndexOf","parsed","testJSON","format","block","out","field","accum","line","charAt","substr","self","originalRequire","possiblePath","Reflect","apply","arguments","stripBOM","atimeMs","modified","mtimeMs","size","css","_compile","isEmpty","warn","makePlaceholderPlugin","getAuthor","getDescription","source","website","escapeID","isLoaded","cantUnload","basedir","files","readdirSync","contentList","map","f","errors","loadAllContent","loadThemes","DOMTools","head","script","src","onload","timing","_","duration","performance","requestAnimationFrame","animate","time","timeFraction","progress","selector","parseHTML","NodeList","nodeType","query","baseElement","querySelectorAll","html","fragment","template","innerHTML","cloneNode","textNode","createTextNode","spanElement","nodeValue","classes","flat","classname","indicator","oldName","newName","thisNode","thatNode","prepend","targetNode","insertBefore","nextSibling","newNode","nextElementSibling","next","matches","previous","previousElementSibling","num","indexInParent","parentElement","parents","closest","attribute","global","getComputedStyle","parseInt","clientWidth","clientHeight","_listeners","event","delegate","callback","namespace","hasDelegate","eventFunc","target","cancel","removeEventListener","listeners","newCancel","findIndex","matchFilter","listener","defaultFilter","list","__offAll","onMount","wrappedCallback","unsubscribe","subscribe","addedNodes","onMountChange","onUnmount","elements","domWrapper","appendChild","Element","DOM","ThemeModule","loadThemeData","themes","theme","addStyle","unescape","saveThemeData","enableTheme","bdEvents","version","disableTheme","removeStyle","toggleTheme","bdtheme","updateThemeList","editorDetached","protect","theModule","isDefault","clear","sort","getToken","getEmail","showToken","proxy","Proxy","getOwnPropertyDescriptor","func","__proto__","findByUniqueProperties","internal","getInternalInstance","V2","joinBD1","InviteActions","acceptInviteAndTransitionToInviteChannel","leaveBD1","GuildActions","leaveGuild","joinBD2","leaveBD2","joinLC","leaveLC","anchor","anchorUnderlineOnHover","guildsWrapper","wrapper","unreadMentionsBar","guilds","guildsError","selected","pill","blobContainer","defaultProps","search","submit","activateRagingDemon","dismiss","openDM","userId","selfId","UserStore","getCurrentUser","privateChannelId","ChannelStore","getDMFromUserId","PrivateChannelActions","selectPrivateChannel","ChannelActions","openPrivateChannel","parseSettings","reduce","setting","Math","max","documentElement","innerWidth","innerHeight","_windowConfigFile","transparent","frame","charCodeAt","channelTextArea","titleWrapper","textarea","focus","selectionStart","selectionEnd","execCommand","moduleName","groupCollapsed","groupEnd","string","replacement","RegExp","method","params","what","methodName","before","after","instead","once","silent","force","origMethod","canceled","thisObject","methodArguments","cancelPatch","originalMethod","callOriginalMethod","returnValue","tempRet","suppressErrors","__monkeyPatched","__originalMethod","sidebar","hasNotice","form","bottom","toastWrapper","icon","timeout","toastElem","innerText","modalModule","modal","inner","hideOnFullscreen","headerModule","header","responsiveWidthMobile","footer2Module","focusLock","backdrop","backdropWithLayer","footer","addClass","closingListeners","onClose","pluginErrors","themeErrors","generateTab","el","tabs","removeClass","scroller","index","click","ModalStack","ChangelogClasses","TextElement","FlexChild","Titles","Changelog","selectable","MarkdownParser","image","subtitle","ce","changelogItems","entry","margin","marginTop","renderHeader","Child","grow","shrink","tag","Tags","H4","Sizes","SMALL","Colors","STANDARD","date","renderFooter","Anchor","AnchorClasses","joinSupportServer","stopPropagation","supportLink","defaultFooter","onScroll","ModalActions","Markdown","ConfirmationModal","emptyFunction","openModal","red","modalKey","V2_SettingsPanel_Sidebar","panels","register","panel","component","getComponent","Settings","devMode","section","LCitems","LCDevItems","injectColoredText","cancelColoredText","MessageComponent","monkeyPatch","childrenMessageContent","messageContent","originalType","roleColor","colorString","removeColoredText","classNameMarkup","markup","inject24Hour","cancel24Hour","twelveHour","convert","matched","match","padStart","cancelCozy","TimeFormatter","cancelCompact","remove24Hour","V2C_SettingsTitle","reactComponent","V2C_TabBarSeparator","V2C_ServerCard","server","iconUrl","fallback","state","imageError","joined","guildList","identifier","cardModule","card","cardPrimary","flexModule","flexChild","_horizontalReverse","wrapModule","noWrap","streamerModeEnabled","marginBottom8","pinned","ref","onError","handleError","draggable","horizontal","members","flex","categories","minHeight","backgroundColor","setState","useState","SettingsView","V2C_PublicServers","setInitialState","changeCategory","searchKeyDown","checkConnection","connect","GuildStore","AvatarDefaults","SortedGuildStore","hooks","componentDidMount","selectedCategory","loading","servers","connection","user","categorySlugs","fetch","searchEndPoint","end","term","categoryButtons","total","serverCard","acceptInvite","invite_code","joinEndPoint","credentials","windowOptions","round","screenX","screenY","win","joinWindow","webContents","loadURL","setMenuBarVisibility","resizable","maximizable","minimizable","alwaysOnTop","center","webPreferences","nodeIntegration","getFlattenedGuildIds","defaultList","DEFAULT_AVATARS","ServerCard","online","nativejoin","floor","random","response","onSetSection","sections","searchInput","getThis","setValue","marginLeft","serchinput","refs","searchinput","onKeyDown","onChange","placeholder","maxLength","which","notConnected","columnModule","contentColumnDefault","contentColumn","SettingsTitle","bdServer","marginBottom","lineHeight","forceUpdate","useEffect","TabBarSeparator","fontSize","username","discriminator","padding","BugHunterBadge","Circus","xmlns","cx","cy","uuidv4","awaitingBadgesPromises","badgesToFetch","_cache","badges","DistantServer","newPromise","badge","Constants","defaultUsers","fetchedBadges","users","handleRequest","Routes","responseBody","promise","user_id","LightcordError","route","SERVER_URL","Authorization","reject","scopes","layers","Layers","inject","isInjected","classNameLayers","v2","ReactInstance","FindReact","createLayer","getLayer","lay","LayerModules","Layer","animation","Value","keydown","ev","componentWillEnter","toValue","componentWillLeave","interpolation","interpolate","inputRange","outputRange","opacity","transform","scale","Div","__SECRET_EMOTION__","position","right","overflow","WebkitBoxOrient","WebkitBoxDirection","msFlexDirection","flexDirection","zIndex","paddingTop","_appendButton","V2_PublicServers","rootId","btn","guildClasses","listItem","circleButtonMask","classNametutorialContainer","downloadProgress","tutorialContainer","button","addButton","guildPatch","GuildList","webpackModules","GuildListOld","removeButton","randClass","ClassNormalizer","unpatchClassModules","moduleFilter","revertElement","patchClassModules","normalizeElement","patchDOMMethods","patchClassModule","unpatchClassModule","shouldIgnore","isNaN","baseClassName","componentName","classNames","normalClass","camelCase","newString","clen","newClass","toRemove","DOMTokenList","token","tokens","debugListener","copySelectorListener","startDebugListener","startCopySelector","stopDebugListener","stopCopySelector","getSelector","classLayer","classItems","menu","cm","cmWrap","styleFlexible","accommodateScrollbar","clientY","clientX","setAttribute","scrollerClasses","scrollerWrap","scrollerThemed","themeGhostHairline","removeCM","keyCode","cmg","cmi","item","labelContainer","colorDefault","NativeModule","copy","queryAll","focused","separator","scrollHeight","names","unshift","ownerDocument","entries","Switch","checked","switch","Components","inputs","classnames","getClassName","SwitchItem","beta","userSettingsVoice","formModule","switchItem","betaClassNames","marginModule","marginTop60","MarginTop","V2C_SettingsGroup","renderOldSettings","buttonComponent","componentDidCatch","errInfo","FormSection","FormText","hideBorder","DEFAULT","Themes","note","setImmediate","V2C_SectionedSettingsPanel","SettingsGroup","V2C_Checkbox","checkboxElement","checkbox","checkboxInner","V2C_CssEditorDetached","updateCss","saveCss","editor","ace","setTheme","session","setMode","setShowPrintMargin","setFontSize","destroy","updateLineCount","lineCount","lines","lineNumbers","indentUnit","scrollbarStyle","_ccss","ccss","_root","injectRoot","detachedRoot","insertAfter","Checkbox","borderRadius","borderRight","borderLeft","saveSettings","attach","unmountComponentAtNode","root","getValue","V2C_CssEditor","detachedEditor","detach","detached","componentDidUpdate","prevProps","prevState","codeMirror","arg","droot","injectDetachedRoot","BDErrorBoundary","hasError","originalRender","configurable","V2C_ContentColumn","V2C_ReloadIcon","V2C_XSvg","fillRule","Edit","Delete","anchorClasses","V2C_PluginCard","showSettings","hasSettings","addon","getSettingsPanel","settingsPanel","reloads","trusted","closeSettings","panelRef","current","settingsOpen","settingspanel","cardNode","cTop","scrollTop","cBottom","eTop","offsetTop","eBottom","isHidden","thisNodeOffset","offset","containerOffset","original","endPoint","getString","XSvg","dangerouslySetInnerHTML","__html","buildTitle","author","nameIndex","versionIndex","authorIndex","LayerStack","popLayer","makeLink","makeButton","action","unmounted","links","invite","tester","donate","patreon","settingsComponent","authorId","authorLink","isScanning","DownArrow","Select","open","dropdown","createRef","showMenu","hideMenu","opt","isOpen","Search","onFocus","onBlur","CardList","ascending","isPlugins","cookie","manager","reverse","onAddonChanges","openFolder","openPath","confirmDelete","BdApi","toLocaleLowerCase","getProps","getAddons","sortedAddons","a","b","cap","first","second","localeCompare","rendered","renderCheckUpdates","ZeresPluginLibrary","PluginUpdates","checkAll","tooltipIsShowing","onMouseLeave","Button","look","hoverColor","onRightClick","checkUpdateButton","refreshIcon","addonCards","sortOptions","directions","dispatcher","Dispatcher","ActionTypes","pid","game","application_id","details","timestamps","assets","large_image","small_image","sendGame","LOCAL_ACTIVITY_UPDATE","socketId","activity","formatedGame","applicationId","getAssets","V2C_PresenceSettingsModules","V2C_PresenceSettings","preview","isfetching","fetchAssets","assetComponents","Set","updateWhenFetched","comp","defaultSetting","RPCProps","CustomRichPresence","asset","updatePreview","marginBottom20","optionsComponents","RpcPreview","ohgodohfuck","_optionsComponents","InputText","InputNumber","InputChoice","choices","inputTextModules","InputNumberModules","InputChoiceModules","PureComponent","removeKeybind","defaultMarginh5","colorStandard","size32","_horizontal","inputMini","size16","size20","input","TextInput","lastEdited","isTiming","rowModule","marginModule2","colorModule","sizeModule","inputModule","sizeModule2","row","size14","h5","Divider","colorTransparent","clipboard","Dropdown","emptyClasses","popoutModules","UserPopoutComponent","PopoutProps","profileModules","UserProfileComponent","ProfileProps","connectedProfileStore","DividerModules","divider","dividerDefault","active","changeTab","tab","setActive","Tab","rpc","isActive","Profile","Popout","PresenceErrorCatcher","emptyStateImage","emptyState","emptyStateHeader","emptyStateSubtext","role","tabindex","UserPopout","userModule","render1","guildId","channelId","disableUserProfileLink","_UserPopout","popout","excludeProperties","UserProfile","render2","render3","render4","profile","scrollbarModule1","scrollbarGhostHairline","GuildModule","getGuilds","relationShipModule","getRelationships","sessionModule","getSessions","V2C_AccountInfos","CodeContent","getProfileValue","language","getStatistics","getSessionValue","sessionsRaw","sessions","sessionId","clientInfo","os","client","activities","repeat","createdAt","avatarURL","avatar","getAvatarURL","getDate","getMonth","getFullYear","getHours","getMinutes","getSeconds","flags","hasPremiumSubscription","email","mfaEnabled","mobile","phone","verified","nsfwAllowed","relations","friends","isFriend","blocked","isBlocked","hightlightJS","highlight","messageModule1","messageModule2","listLanguages","DiscordModules","ChannelModule","getChannel","hasChannel","addRelationship","DMModule","closePrivateChannel","antiDM","bot","guild_id","channel","channel_id","EmbedsContains","location","embeds","embed","fields","selectors","standardSidebarView","defaultClassName","selects","userSettingsAccount","paymentSourceRow","subText","descriptionWrapper","viewBody","userSettingsSecurity","getSelectors","startTyping","typingModule","stopTyping","DisableTyping","ApiPreview","states","allComponents","general","AlertBox","compName","compPath","ComponentPreview","AllPreviews","getStrForProp","lang","String","$$typeof","for","generateCode","openTag","propStrings","childrenProp","str","propObject","isLast","childrenData","help","success","SettingSubTitle","searchable","Tabs","ErrorCatcher","CodeBlock","History","windows","Map","init","popoutModule","getWindow","applyThemes","removeThemes","themeName","existing","removeAttribute","BDSidebarHeader","sidebarComponents","Separator","Header","Item","changelogButton","showChangelogModal","isClearingCache","updateSettings","registerComponents","makeComponent","lightcordComponent","PresenceComponent","AccountInfosComponent","ApiPreviewComponent","coreComponent","customCssComponent","renderAddonPane","getSettings","publicServersModule","voiceMode","tfHour","coloredText","setWindowPreference","dMode","callRingingBeat","settingsStore","showCurrentGame","updateRemoteSettings","getCurrentWindow","setAlwaysOnTop","AntiAdDM","blurPrivate","disableTyping","appSettings","getGlobal","relaunch","exit","popoutWindow","core","methods","NotificationsUseShim","loadSettings","renderSidebar","SectionedSettingsPanel","coreSettings","isChecked","ipc","send","argv","quit","clearCache","PresenceSettings","CssEditor","ContentList","prefix","SettingComponent","BDLogo","clipRule","strokeLinecap","strokeLinejoin","LightcordLogo","x1","y1","x2","y2","gradientTransform","gradientUnits","stopColor","EmojiRegex","CustomEmojiModule","CustomEmoji","EmojiModuleApi","getCustomEmojiById","AutocompleteModule","AutoCompletionTemplates","getAutocompleteOptions","EmojiModuleQuery","queryEmojiResults","Messages","EMOJI_MATCHING","guildModule","getGuild","isFetching","emojiSearch","getDisambiguatedEmojiContext","LIGHTCORD_EMOJIS","arg1","arg2","condition","setEmojiUsable","queryResults","renderResults","D","emojis","EMOJI","Emoji","emoji","uniqueName","sentinel","guild","getPlainText","isAnimated","animated","managed","originalName","getRawText","cancelEmojiRender","cancelEmoteRender","getNestedProp","newContent","hasParsed","raw","words","word","emojiId","jumboable","shift","u","onHover","R","Title","classNameLayer","classNameSocialLinks","classNameModal","EmojiFilterModule","isEmojiDisabled","isUsable","usable","surrogates","diversity","Core","setConfig","config","hasStarted","setMethods","ED","WebSocket","patchAttributes","initSettings","checkForGuilds","initializeSettings","getElementsByClassName","initObserver","previousVersion","EmojiModule","patchSocial","patchGuildPills","patchGuildListItems","patchGuildSeparator","patchMessageHeader","patchMemberList","patchAttachment","haveInstalledDefault","logo","attribsPatchs","cancelPatchAttributes","DiscordTag","DiscordTagComp","badgeDiv","TooltipWrap","applyBadges","timesChecked","blob","deferLoaded","readyState","injectExternals","getPredicateSections","settingModule","poped","mlen","animating","socialLinks","getAttribute","socialPatch","TabBar","socialModule1","newOne","returnVal","classNameColorMuted","sizes","classNameVersionHash","colorMuted","versionHash","branch","additional","size12","commit","originalVersions","chat","blockDiv","distant","getBadges","scope","div2","guildListItemsPatch","GuildClasses","getGuildClasses","listItemClass","blobClass","GuildComponent","return","guildData","unread","audio","video","animatable","guildPillPatch","guildPill","hovered","guildSeparatorPatch","Guilds","guildComponents","GuildSeparator","AttachmentPatch","Attachment","messageHeaderPatch","MessageHeader","memberListPatch","MemberListItem","renderDecorators","updateInjector","ReactDom","ReactComponent","WindowConfigFile","getAllWindowPreferences","getWindowPreference","addScript","removeScript","mainCore","protos","getData","loadData","saveData","setData","deleteData","onRemoved","isPluginEnabled","isThemeEnabled","isSettingEnabled","enableSetting","disableSetting","toggleSetting","makeAddonAPI","folder","isEnabled","getAll","Plugins","contentWindowGetter","HTMLIFrameElement","contentWindow","writable","Function","oOpen","XMLHttpRequest","localStorageFix","v2Loader","loadingIcon","deprecateGlobal","globalKeys","Globals","CoreWrapper"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW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YAAYzC,EAAU++C,GAClB2F,GAAKC,UAAU3kD,GACf0kD,GAAKI,WAAW/F,GAGpBhD,OAEI2I,GAAK3I","file":"index.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","module.exports = require(\"electron\");","module.exports = require(\"path\");","module.exports = require(\"fs\");","module.exports = require(\"crypto\");","module.exports = require(\"node-fetch\");","module.exports = require(\"events\");","module.exports = require(\"module\");","export const minimumDiscordVersion = \"0.0.307\";\nexport const currentDiscordVersion = (window.DiscordNative && window.DiscordNative.remoteApp && window.DiscordNative.remoteApp.getVersion && window.DiscordNative.remoteApp.getVersion()) || \"0.0.307\";\nexport const minSupportedVersion = \"0.3.0\";\nexport const bbdVersion = \"0.3.5\";\nexport const bbdChangelog = {\n description: \"Big things are coming.\",\n changes: [\n {\n title: \"Bug Fixes\",\n type: \"fixed\",\n items: [\n \"Some fixes related to showing modals in the `BdApi`.\",\n \"Fixed the open folder buttons for plugins and themes\"\n ]\n }\n ]\n};\n\nexport const settings = {\n \"Custom css live update\": {id: \"bda-css-0\", info: \"\", implemented: true, hidden: true, cat: \"core\"},\n \"Custom css auto udpate\": {id: \"bda-css-1\", info: \"\", implemented: true, hidden: true, cat: \"core\"},\n \"BetterDiscord Blue\": {id: \"bda-gs-b\", info: \"Replace Discord blue with BD Blue\", implemented: false, hidden: false, cat: \"core\"},\n\n /* Core */\n /* ====== */\n \"Public Servers\": {id: \"bda-gs-1\", info: \"Display public servers button\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Minimal Mode\": {id: \"bda-gs-2\", info: \"Hide elements and reduce the size of elements.\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Voice Mode\": {id: \"bda-gs-4\", info: \"Only show voice chat\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Hide Channels\": {id: \"bda-gs-3\", info: \"Hide channels in minimal mode\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Dark Mode\": {id: \"bda-gs-5\", info: \"Make certain elements dark by default(wip)\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Voice Disconnect\": {id: \"bda-dc-0\", info: \"Disconnect from voice server when closing Discord\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"24 Hour Timestamps\": {id: \"bda-gs-6\", info: \"Replace 12hr timestamps with proper ones\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Colored Text\": {id: \"bda-gs-7\", info: \"Make text color the same as role color\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Normalize Classes\": {id: \"fork-ps-4\", info: \"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n\n /* Content */\n \"Content Error Modal\": {id: \"fork-ps-1\", info: \"Shows a modal with plugin/theme errors\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Scan Plugins\": {id: \"fork-ps-6\", info: \"Scan plugins for any threat that can be hidden inside.\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Show Toasts\": {id: \"fork-ps-2\", info: \"Shows a small notification for important information\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"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: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Automatic Loading\": {id: \"fork-ps-5\", info: \"Automatically loads, reloads, and unloads plugins and themes\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Enable Edit Button\": {id: \"fork-ps-7\", info: \"Enable an Edit Button on the plugin and theme panel.\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Themes in Popout Window\": {id: \"lightcord-9\", info: \"Enable themes in Popout Window. (For example, when detaching screenshare.)\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\", experimental: true},\n\n /* Developer */\n \"Developer Mode\": \t {id: \"bda-gs-8\", info: \"Developer Mode Toggle\", implemented: true, hidden: false, cat: \"core\", category: \"developer settings\"},\n \"Copy Selector\":\t\t\t {id: \"fork-dm-1\", info: \"Adds a \\\"Copy Selector\\\" option to context menus when developer mode is active\", implemented: true, hidden: false, cat: \"core\", category: \"developer settings\"},\n\n /** Lightcord */\n \"Disable BetterDiscord\": {id: \"bd-disable\", info: \"Disable Betterdiscord (plugins, themes, etc) (Not implemented).\", implemented: false, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Blur Personal Information\": {id: \"lightcord-6\", info: \"Blur sensitive informations like email, payment infos and more.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Calling Ring Beat\": {id: \"lightcord-2\", info: \"Enable Discord's special calling beat.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Developer Options\": {id: \"lightcord-1\", info: \"Enable Discord's & Lightcord's Internal Developer Options. This allow the \\\"Experiments\\\" tab, the \\\"Developer Options\\\" tab and the \\\"Lightcord Api\\\" section.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Ad Block\": {id: \"lightcord-4\", info: \"Block any BOT that dms you with an invite link. Even in an embed.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Enable Lightcord Servers\": {id: \"lightcord-5\", info: \"Enable Lightcord's servers. Disabling this will disable custom badges.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Disable typing\": {id: \"lightcord-7\", info: \"Don't let other see you're typing.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Lightcord Tabs\": {id: \"lightcord-8\", info: \"Allows you to launch multiple instances of Lightcord in the same window.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\", experimental: true},\n \"Use Notification Shim\": {id: \"lightcord-10\", info: \"Basically don't use Windows's Notifications.\", implemented: true, hidden: process.platform !== \"win32\", cat: \"lightcord\", category: \"Lightcord\", experimental: false},\n\n /** Lightcord Window */\n \"Always-on-Top\": {id: \"lightcord-3\", info: \"Enable the window's Always-on-Top mode, where Lightcord stays on top of other applications.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Window\"},\n \"No Window Bounds\": {id: \"no_window_bound\", info: \"Disable Window Bounds. Can be useful if you use a window manager.\", implemented: true, hidden: process.platform !== \"linux\", cat: \"lightcord\", category: \"Window\"},\n \"Enable Glasstron\": {id: \"enable_glasstron\", info: \"Enable Glasstron. If you're not using transparent themes, this can reduce lag.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Window\"},\n \n /** RichPresence */\n \"Enable\": {id: \"lightcord-presence-1\", info: \"Enable RichPresence below.\", implemented: true, hidden: false, cat: \"status\"}\n};\n\nexport const defaultCookie = {\n \"bda-gs-1\": true,\n \"bda-gs-2\": false,\n \"bda-gs-3\": false,\n \"bda-gs-4\": false,\n \"bda-gs-5\": true,\n \"bda-gs-6\": false,\n \"bda-gs-7\": false,\n \"bda-gs-8\": false,\n \"bda-es-0\": true,\n \"bda-es-1\": true,\n \"bda-es-2\": true,\n \"bda-es-4\": false,\n \"bda-es-6\": true,\n \"bda-es-7\": true,\n \"bda-gs-b\": false,\n \"bda-es-8\": true,\n \"bda-dc-0\": false,\n \"bda-css-0\": false,\n \"bda-css-1\": false,\n \"bda-es-9\": true,\n \"fork-dm-1\": false,\n \"fork-ps-1\": true,\n \"fork-ps-2\": true,\n \"fork-ps-3\": true,\n \"fork-ps-4\": true,\n \"fork-ps-5\": true,\n \"fork-ps-6\": true,\n \"fork-ps-7\": false,\n \"fork-es-2\": false,\n \"fork-es-3\": true,\n \"fork-wp-1\": false,\n \"fork-wp-2\": false,\n \"fork-beta\": true,\n \"lightcord-1\": false,\n \"lightcord-2\": true,\n \"lightcord-presence-1\": false,\n \"lightcord-3\": false,\n \"lightcord-4\": false,\n \"lightcord-5\": true,\n \"lightcord-6\": true,\n \"lightcord-7\": false,\n \"lightcord-8\": false,\n \"lightcord-9\": false,\n \"lightcord-10\": false,\n \"no_window_bound\": false,\n};\n\n\nexport const settingsCookie = {};\n\nexport const settingsRPC = {};\nexport const defaultRPC = {\n \"name\": \"Lightcord\",\n \"application_id\": \"711416957718757418\",\n \"state\": \"Lightcord Client\",\n \"details\": \"Browsing Discord\",\n \"timestamps.start\": Date.now(),\n \"assets.small\": null,\n \"assets.large\": \"712323821037682791\"\n}\n\nexport const lightcordSettings = {};\nexport const defaultLightcordSettings = {};\n\nexport const bdpluginErrors = [];\nexport const bdthemeErrors = []; // define for backwards compatibility\n\nexport const bdConfig = Object.create(BetterDiscordConfig);\n\nexport const bdthemes = {};\nexport const bdplugins = {};\n\nexport const pluginCookie = {};\nexport const themeCookie = {};","const req = webpackJsonp.push([[], {__extra_id__: (module, exports, req) => module.exports = req}, [[\"__extra_id__\"]]]);\ndelete req.m.__extra_id__;\ndelete req.c.__extra_id__;\nconst find = (filter) => {\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) return m.default;\n if (m && filter(m))\treturn m;\n }\n }\n // console.warn(\"Cannot find loaded module in cache\");\n return null;\n};\n\nconst findAll = (filter) => {\n const modules = [];\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) modules.push(m.default);\n else if (m && filter(m)) modules.push(m);\n }\n }\n return modules;\n};\n\nconst findByProps = (...propNames) => find(module => propNames.every(prop => module[prop] !== undefined));\nconst findByPrototypes = (...protoNames) => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\nconst findByDisplayName = (displayName) => find(module => module.displayName === displayName);\n\nlet mod = {find, findAll, findByProps, findByPrototypes, findByDisplayName};\nexport default mod\n\nwindow.Lightcord.BetterDiscord.WebpackModules = mod","const __non_webpack_require__ = window.require\n\nimport Utils from \"./utils\";\nimport ContentManager from \"./contentManager\";\n\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst releaseChannel = DiscordNative.globals ? DiscordNative.globals.releaseChannel : DiscordNative.app ? DiscordNative.app.getReleaseChannel() : \"stable\";\n\nlet dataPath = \"\";\nif (process.platform === \"win32\") dataPath = process.env.APPDATA;\nelse if (process.platform === \"darwin\") dataPath = path.join(process.env.HOME, \"Library\", \"Preferences\");\nelse dataPath = process.env.XDG_CONFIG_HOME ? process.env.XDG_CONFIG_HOME : path.join(process.env.HOME, \".config\");\ndataPath = path.join(dataPath, \"BetterDiscord\");\n\nexport default new class DataStore {\n constructor() {\n this.data = {settings: {stable: {}, canary: {}, ptb: {}}};\n this.pluginData = {};\n window.Lightcord.BetterDiscord.DataStore = this\n }\n\n initialize() {\n try {\n if (!fs.existsSync(this.BDFile)) fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\n const data = JSON.parse(fs.readFileSync(this.BDFile, \"utf-8\"))\n if (data.hasOwnProperty(\"settings\")) this.data = data;\n if (!fs.existsSync(this.settingsFile)) return;\n let settings = __non_webpack_require__(this.settingsFile);\n fs.unlinkSync(this.settingsFile);\n if (settings.hasOwnProperty(\"settings\")) settings = Object.assign({stable: {}, canary: {}, ptb: {}}, {[releaseChannel]: settings});\n else settings = Object.assign({stable: {}, canary: {}, ptb: {}}, settings);\n this.setBDData(\"settings\", settings);\n }\n catch (err) {\n console.error(err);\n Utils.alert(\"Corrupt Storage\", \"The bd storage has somehow become corrupt. You may either try to salvage the file or delete it then reload.\");\n }\n }\n\n get injectionPath() {\n return this._injectionPath = null;\n if (this._injectionPath) return this._injectionPath;\n const electron = require(\"electron\").remote.app;\n const base = electron.getAppPath();\n const roamingBase = electron.getPath(\"userData\");\n const roamingLocation = path.resolve(roamingBase, electron.getVersion(), \"modules\", \"discord_desktop_core\", \"injector\");\n const location = path.resolve(base, \"..\", \"app\");\n const realLocation = fs.existsSync(location) ? location : fs.existsSync(roamingLocation) ? roamingLocation : null;\n if (!realLocation) return this._injectionPath = null;\n return this._injectionPath = realLocation;\n }\n\n get configFile() {return this._configFile || (this._configFile = path.resolve(this.injectionPath, \"betterdiscord\", \"config.json\"));}\n get BDFile() {return this._BDFile || (this._BDFile = path.resolve(dataPath, \"bdstorage.json\"));}\n get settingsFile() {return this._settingsFile || (this._settingsFile = path.resolve(dataPath, \"bdsettings.json\"));}\n getPluginFile(pluginName) {return path.resolve(ContentManager.pluginsFolder, pluginName + \".config.json\");}\n\n getSettingGroup(key) {\n return this.data.settings[releaseChannel][key] || null;\n }\n\n setSettingGroup(key, data) {\n this.data.settings[releaseChannel][key] = data;\n fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\n }\n\n getBDData(key) {\n return this.data[key] || \"\";\n }\n\n setBDData(key, value) {\n this.data[key] = value;\n fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\n }\n\n getPluginData(pluginName, key) {\n if (this.pluginData[pluginName] !== undefined) return this.pluginData[pluginName][key];\n if (!fs.existsSync(this.getPluginFile(pluginName))) return undefined;\n this.pluginData[pluginName] = JSON.parse(fs.readFileSync(this.getPluginFile(pluginName)));\n return this.pluginData[pluginName][key];\n }\n\n setPluginData(pluginName, key, value) {\n if (value === undefined) return;\n if (this.pluginData[pluginName] === undefined) this.pluginData[pluginName] = {};\n this.pluginData[pluginName][key] = value;\n fs.writeFileSync(this.getPluginFile(pluginName), JSON.stringify(this.pluginData[pluginName], null, 4), \"utf-8\");\n }\n\n deletePluginData(pluginName, key) {\n if (this.pluginData[pluginName] === undefined) this.pluginData[pluginName] = {};\n delete this.pluginData[pluginName][key];\n fs.writeFileSync(this.getPluginFile(pluginName), JSON.stringify(this.pluginData[pluginName], null, 4), \"utf-8\");\n }\n};","/* BDEvents */\nconst EventEmitter = require(\"events\");\nexport default new class BDEvents extends EventEmitter {\n constructor(){\n super()\n window.Lightcord.BetterDiscord.BDEvents = this\n }\n dispatch(eventName, ...args) {this.emit(eventName, ...args);}\n off(eventName, eventAction) {this.removeListener(eventName, eventAction);}\n};","import {bdpluginErrors, pluginCookie, settingsCookie, bdplugins} from \"../0globals\";\nimport ContentManager from \"./contentManager\";\nimport DataStore from \"./dataStore\";\nimport BDEvents from \"./bdEvents\";\nimport Utils from \"./utils\";\n\nclass PluginModule {\n constructor(){\n window.Lightcord.BetterDiscord.PluginModule = this\n }\n get folder() {return ContentManager.pluginsFolder;}\n}\n\nPluginModule.prototype.loadPlugins = async function () {\n this.loadPluginData();\n bdpluginErrors.splice(0, 0, ...(await ContentManager.loadPlugins()));\n const plugins = Object.keys(bdplugins);\n for (let i = 0; i < plugins.length; i++) {\n let plugin, name;\n\n try {\n plugin = bdplugins[plugins[i]].plugin;\n name = plugin.getName();\n if (plugin.load && typeof(plugin.load) == \"function\") plugin.load();\n } catch (err) {\n pluginCookie[name] = false;\n Utils.err(\"Plugins\", name + \" could not be loaded.\", err);\n bdpluginErrors.push({name: name, file: bdplugins[plugins[i]].filename, message: \"load() could not be fired.\", error: {message: err.message, stack: err.stack}});\n continue;\n }\n\n if (!pluginCookie[name]) pluginCookie[name] = false;\n\n if (pluginCookie[name]) {\n try {\n plugin.start();\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin.getName()} v${plugin.getVersion()} has started.`);\n } catch (err) {\n pluginCookie[name] = false;\n Utils.err(\"Plugins\", name + \" could not be started.\", err);\n bdpluginErrors.push({name: name, file: bdplugins[plugins[i]].filename, message: \"start() could not be fired.\", error: {message: err.message, stack: err.stack}});\n }\n }\n\n await new Promise((resolve) => setTimeout(resolve, 10))\n }\n this.savePluginData();\n\n require(\"electron\").remote.getCurrentWebContents().on(\"did-navigate-in-page\", this.channelSwitch.bind(this));\n // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"plugin\");\n};\n\nPluginModule.prototype.startPlugin = function(plugin, reload = false) {\n try {\n bdplugins[plugin].plugin.start();\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${bdplugins[plugin].plugin.getName()} v${bdplugins[plugin].plugin.getVersion()} has started.`);\n }\n catch (err) {\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${bdplugins[plugin].plugin.getName()} v${bdplugins[plugin].plugin.getVersion()} could not be started.`, {type: \"error\"});\n pluginCookie[plugin] = false;\n this.savePluginData();\n Utils.err(\"Plugins\", plugin + \" could not be started.\", err);\n }\n};\n\nPluginModule.prototype.stopPlugin = function(plugin, reload = false) {\n try {\n bdplugins[plugin].plugin.stop();\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${bdplugins[plugin].plugin.getName()} v${bdplugins[plugin].plugin.getVersion()} has stopped.`);\n }\n catch (err) {\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${bdplugins[plugin].plugin.getName()} v${bdplugins[plugin].plugin.getVersion()} could not be stopped.`, {type: \"error\"});\n Utils.err(\"Plugins\", bdplugins[plugin].plugin.getName() + \" could not be stopped.\", err);\n }\n};\n\nPluginModule.prototype.enablePlugin = function (plugin, reload = false) {\n if (pluginCookie[plugin]) return;\n pluginCookie[plugin] = true;\n this.savePluginData();\n this.startPlugin(plugin, reload);\n};\n\nPluginModule.prototype.enable = function (plugin, reload = false) {\n return this.enablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.disablePlugin = function (plugin, reload = false) {\n if (!pluginCookie[plugin]) return;\n pluginCookie[plugin] = false;\n this.savePluginData();\n this.stopPlugin(plugin, reload);\n};\n\nPluginModule.prototype.disable = function (plugin, reload = false) {\n return this.disablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.togglePlugin = function (plugin) {\n if (pluginCookie[plugin]) this.disablePlugin(plugin);\n else this.enablePlugin(plugin);\n};\n\nPluginModule.prototype.toggle = function (plugin, reload = false) {\n return this.togglePlugin(plugin, reload);\n};\n\nPluginModule.prototype.loadPlugin = async function(filename) {\n const error = await ContentManager.loadContent(filename, \"plugin\");\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({plugins: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${filename} could not be loaded.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${filename} could not be loaded.`, error);\n }\n const plugin = Object.values(bdplugins).find(p => (console.log(p.filename, filename)) || p.filename == filename).plugin;\n try { if (plugin.load && typeof(plugin.load) == \"function\") plugin.load();}\n catch (err) {if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({plugins: [err]});}\n Utils.log(\"ContentManager\", `${plugin.getName()} v${plugin.getVersion()} was loaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin.getName()} v${plugin.getVersion()} was loaded.`, {type: \"success\"});\n BDEvents.dispatch(\"plugin-loaded\", plugin.getName());\n};\n\nPluginModule.prototype.unloadPlugin = function(filenameOrName) {\n const bdplugin = Object.values(bdplugins).find(p => p.filename == filenameOrName) || bdplugins[filenameOrName];\n if (!bdplugin) return;\n const plugin = bdplugin.plugin.getName();\n if (pluginCookie[plugin]) this.disablePlugin(plugin, true);\n const error = ContentManager.unloadContent(bdplugins[plugin].filename, \"plugin\");\n delete bdplugins[plugin];\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({plugins: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin} could not be unloaded. It may have not been loaded yet.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${plugin} could not be unloaded. It may have not been loaded yet.`, error);\n }\n Utils.log(\"ContentManager\", `${plugin} was unloaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin} was unloaded.`, {type: \"success\"});\n BDEvents.dispatch(\"plugin-unloaded\", plugin);\n};\n\nPluginModule.prototype.delete = function(filenameOrName) {\n const bdplugin = Object.values(bdplugins).find(p => p.filename == filenameOrName) || bdplugins[filenameOrName];\n if (!bdplugin) return;\n this.unloadPlugin(bdplugin.filename);\n const fullPath = require(\"path\").resolve(ContentManager.pluginsFolder, bdplugin.filename);\n require(\"fs\").unlinkSync(fullPath);\n};\n\nPluginModule.prototype.reloadPlugin = async function(filenameOrName) {\n const bdplugin = Object.values(bdplugins).find(p => p.filename == filenameOrName) || bdplugins[filenameOrName];\n if (!bdplugin) return this.loadPlugin(filenameOrName);\n const plugin = bdplugin.plugin.getName();\n const enabled = pluginCookie[plugin];\n if (enabled) this.stopPlugin(plugin, true);\n const error = await ContentManager.reloadContent(bdplugins[plugin].filename, \"plugin\");\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({plugins: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin} could not be reloaded.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${plugin} could not be reloaded.`, error);\n }\n if (bdplugins[plugin].plugin.load && typeof(bdplugins[plugin].plugin.load) == \"function\") bdplugins[plugin].plugin.load();\n if (enabled) this.startPlugin(plugin, true);\n Utils.log(\"ContentManager\", `${plugin} v${bdplugins[plugin].plugin.getVersion()} was reloaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin} v${bdplugins[plugin].plugin.getVersion()} was reloaded.`, {type: \"success\"});\n BDEvents.dispatch(\"plugin-reloaded\", plugin);\n};\n\nPluginModule.prototype.reload = function(name) {\n return this.reloadPlugin(name);\n};\n\nPluginModule.prototype.edit = function(filenameOrName) {\n console.log(\"Edit \" + filenameOrName);\n const bdplugin = Object.values(bdplugins).find(p => p.filename == filenameOrName) || bdplugins[filenameOrName];\n if (!bdplugin) return;\n const fullPath = require(\"path\").resolve(ContentManager.pluginsFolder, bdplugin.filename);\n console.log(\"Edit \" + fullPath);\n require(\"electron\").shell.openItem(`${fullPath}`);\n};\n\nPluginModule.prototype.updatePluginList = function() {\n const results = ContentManager.loadNewContent(\"plugin\");\n for (const filename of results.added) this.loadPlugin(filename);\n for (const name of results.removed) this.unloadPlugin(name);\n};\n\nPluginModule.prototype.loadPluginData = function () {\n const saved = DataStore.getSettingGroup(\"plugins\");\n if (saved) {\n Object.assign(pluginCookie, saved);\n }\n};\n\nPluginModule.prototype.savePluginData = function () {\n DataStore.setSettingGroup(\"plugins\", pluginCookie);\n};\n\nPluginModule.prototype.newMessage = function () {\n const plugins = Object.keys(bdplugins);\n for (let i = 0; i < plugins.length; i++) {\n const plugin = bdplugins[plugins[i]].plugin;\n if (!pluginCookie[plugin.getName()]) continue;\n if (typeof plugin.onMessage === \"function\") {\n try { plugin.onMessage(); }\n catch (err) { Utils.err(\"Plugins\", \"Unable to fire onMessage for \" + plugin.getName() + \".\", err); }\n }\n }\n};\n\nPluginModule.prototype.channelSwitch = function () {\n const plugins = Object.keys(bdplugins);\n for (let i = 0; i < plugins.length; i++) {\n const plugin = bdplugins[plugins[i]].plugin;\n if (!pluginCookie[plugin.getName()]) continue;\n if (typeof plugin.onSwitch === \"function\") {\n try { plugin.onSwitch(); }\n catch (err) { Utils.err(\"Plugins\", \"Unable to fire onSwitch for \" + plugin.getName() + \".\", err); }\n }\n }\n};\n\nPluginModule.prototype.rawObserver = function(e) {\n const plugins = Object.keys(bdplugins);\n for (let i = 0; i < plugins.length; i++) {\n const plugin = bdplugins[plugins[i]].plugin;\n if (!pluginCookie[plugin.getName()]) continue;\n if (typeof plugin.observer === \"function\") {\n try { plugin.observer(e); }\n catch (err) { Utils.err(\"Plugins\", \"Unable to fire observer for \" + plugin.getName() + \".\", err); }\n }\n }\n};\n\nexport default new PluginModule();","/**\n * Tooltip that automatically show and hide themselves on mouseenter and mouseleave events.\n * Will also remove themselves if the node to watch is removed from DOM through\n * a MutationObserver.\n *\n * Note this is not using Discord's internals but normal DOM manipulation and emulates\n * Discord's own tooltips as closely as possible.\n *\n * @module EmulatedTooltip\n * @version 0.0.1\n */\n\nimport Utils from \"../modules/utils\";\nimport WebpackModules from \"../modules/webpackModules\";\nlet TooltipClasses\nfunction getTooltipClasses(){\n\tif(TooltipClasses)return TooltipClasses\n\treturn TooltipClasses = WebpackModules.findByProps(\"tooltip\", \"tooltipBlack\");\n}\nlet TooltipLayers\nfunction getTooltipLayers(){\n\tif(TooltipLayers)return TooltipLayers\n\treturn TooltipLayers = WebpackModules.findByProps(\"layer\", \"layerContainer\");\n}\n\nconst getClass = function(sideOrColor) {\n const upperCase = sideOrColor[0].toUpperCase() + sideOrColor.slice(1);\n const tooltipClass = getTooltipClasses()[`tooltip${upperCase}`];\n if (tooltipClass) return tooltipClass;\n return null;\n};\n\nconst classExists = function(sideOrColor) {\n return getClass(sideOrColor) ? true : false;\n};\n\nconst toPx = function(value) {\n return `${value}px`;\n};\n\nexport default class EmulatedTooltip {\n\t/**\n\t *\n\t * @constructor\n\t * @param {(HTMLElement|jQuery)} node - DOM node to monitor and show the tooltip on\n\t * @param {string} tip - string to show in the tooltip\n\t * @param {object} options - additional options for the tooltip\n\t * @param {string} [options.style=black] - correlates to the discord styling/colors (black, brand, green, grey, red, yellow)\n\t * @param {string} [options.side=top] - can be any of top, right, bottom, left\n\t * @param {boolean} [options.preventFlip=false] - prevents moving the tooltip to the opposite side if it is too big or goes offscreen\n * @param {boolean} [options.disabled=false] - whether the tooltip should be disabled from showing on hover\n * @param {boolean} [options.attachEvents=true] - whether the tooltip should listen to mouseenter and mouseleave events.\n\t */\n\tconstructor(node, text, options = {}) {\n\t\tconst {style = \"black\", side = \"top\", preventFlip = false, disabled = false, attachEvents = true} = options;\n\t\tthis.node = node instanceof jQuery ? node[0] : node;\n this.label = text;\n this.style = style.toLowerCase();\n\t\tthis.side = side.toLowerCase();\n this.preventFlip = preventFlip;\n this.disabled = disabled;\n\n if (!classExists(this.side)) return Utils.err(\"EmulatedTooltip\", `Side ${this.side} does not exist.`);\n\t\tif (!classExists(this.style)) return Utils.err(\"EmulatedTooltip\", `Style ${this.style} does not exist.`);\n\t\t\n\t\tthis.element = document.createElement(\"div\");\n\t\tthis.element.className = getTooltipLayers().layer + \" \" + getTooltipLayers().disabledPointerEvents;\n\n\t\tthis.tooltipElement = document.createElement(\"div\");\n\t\tthis.tooltipElement.className = `${getTooltipClasses().tooltip} ${getClass(this.style)}`;\n\n\t\tthis.labelElement = document.createElement(\"div\");\n\t\tthis.labelElement.className = getTooltipClasses().tooltipContent\n\n\t\tconst pointerElement = document.createElement(\"div\");\n\t\tpointerElement.className = getTooltipClasses().tooltipPointer;\n\n\t\tthis.tooltipElement.append(pointerElement);\n\t\tthis.tooltipElement.append(this.labelElement);\n\t\tthis.element.append(this.tooltipElement);\n\n\t\tif(attachEvents){\n\t\t\tthis.node.addEventListener(\"mouseenter\", () => {\n\t\t\t\tif (this.disabled) return;\n\t\t\t\tthis.show();\n\t\n\t\t\t\tconst observer = new MutationObserver((mutations) => {\n\t\t\t\t\tmutations.forEach((mutation) => {\n\t\t\t\t\t\tconst nodes = Array.from(mutation.removedNodes);\n\t\t\t\t\t\tconst directMatch = nodes.indexOf(this.node) > -1;\n\t\t\t\t\t\tconst parentMatch = nodes.some(parent => parent.contains(this.node));\n\t\t\t\t\t\tif (directMatch || parentMatch) {\n\t\t\t\t\t\t\tthis.hide();\n\t\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\n\t\t\t\tobserver.observe(document.body, {subtree: true, childList: true});\n\t\t\t});\n\t\n\t\t\tthis.node.addEventListener(\"mouseleave\", () => {\n\t\t\t\tthis.hide();\n\t\t\t});\n\t\t}\n }\n\n /** Container where the tooltip will be appended. */\n get container() { \n\t\treturn document.querySelector(\".\"+Utils.removeDa(BDModules.get(e => e.popouts)[0].popouts)+\" ~ .\"+Utils.removeDa(BDModules.get(e => e.layerContainer)[0].layerContainer)); \n\t}\n /** Boolean representing if the tooltip will fit on screen above the element */\n get canShowAbove() { return this.node.getBoundingClientRect().top - this.element.offsetHeight >= 0; }\n /** Boolean representing if the tooltip will fit on screen below the element */\n get canShowBelow() { return this.node.getBoundingClientRect().top + this.node.offsetHeight + this.element.offsetHeight <= Utils.screenHeight; }\n /** Boolean representing if the tooltip will fit on screen to the left of the element */\n get canShowLeft() { return this.node.getBoundingClientRect().left - this.element.offsetWidth >= 0; }\n /** Boolean representing if the tooltip will fit on screen to the right of the element */\n\tget canShowRight() { return this.node.getBoundingClientRect().left + this.node.offsetWidth + this.element.offsetWidth <= Utils.screenWidth; }\n\n /** Hides the tooltip. Automatically called on mouseleave. */\n\thide() {\n this.element.remove();\n this.tooltipElement.className = this._className;\n\t}\n\n /** Shows the tooltip. Automatically called on mouseenter. Will attempt to flip if position was wrong. */\n\tshow() {\n this.tooltipElement.className = `${getTooltipClasses().tooltip} ${getClass(this.style)}`;\n\t\tthis.labelElement.textContent = this.label;\n\t\tthis.container.append(this.element);\n\n\t\tif (this.side == \"top\") {\n\t\t\tif (this.canShowAbove || (!this.canShowAbove && this.preventFlip)) this.showAbove();\n\t\t\telse this.showBelow();\n\t\t}\n\n\t\tif (this.side == \"bottom\") {\n\t\t\tif (this.canShowBelow || (!this.canShowBelow && this.preventFlip)) this.showBelow();\n\t\t\telse this.showAbove();\n\t\t}\n\n\t\tif (this.side == \"left\") {\n\t\t\tif (this.canShowLeft || (!this.canShowLeft && this.preventFlip)) this.showLeft();\n\t\t\telse this.showRight();\n\t\t}\n\n\t\tif (this.side == \"right\") {\n\t\t\tif (this.canShowRight || (!this.canShowRight && this.preventFlip)) this.showRight();\n\t\t\telse this.showLeft();\n\t\t}\n\t}\n\n /** Force showing the tooltip above the node. */\n\tshowAbove() {\n\t\tthis.tooltipElement.classList.add(getClass(\"top\"));\n\t\tthis.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top - this.element.offsetHeight - 10));\n\t\tthis.centerHorizontally();\n\t}\n\n /** Force showing the tooltip below the node. */\n\tshowBelow() {\n\t\tthis.tooltipElement.classList.add(getClass(\"bottom\"));\n\t\tthis.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top + this.node.offsetHeight + 10));\n\t\tthis.centerHorizontally();\n\t}\n\n /** Force showing the tooltip to the left of the node. */\n\tshowLeft() {\n\t\tthis.tooltipElement.classList.add(getClass(\"left\"));\n\t\tthis.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left - this.element.offsetWidth - 10));\n\t\tthis.centerVertically();\n\t}\n\n /** Force showing the tooltip to the right of the node. */\n\tshowRight() {\n\t\tthis.tooltipElement.classList.add(getClass(\"right\"));\n\t\tthis.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left + this.node.offsetWidth + 10));\n\t\tthis.centerVertically();\n\t}\n\n\tcenterHorizontally() {\n const nodecenter = this.node.getBoundingClientRect().left + (this.node.offsetWidth / 2);\n this.element.style.setProperty(\"left\", toPx(nodecenter - (this.element.offsetWidth / 2)));\n\t}\n\n\tcenterVertically() {\n\t\tconst nodecenter = this.node.getBoundingClientRect().top + (this.node.offsetHeight / 2);\n\t\tthis.element.style.setProperty(\"top\", toPx(nodecenter - (this.element.offsetHeight / 2)));\n\t}\n}","import BDV2 from \"../modules/v2\";\nimport Tooltip from \"./tooltip\";\n\nexport default class extends React.Component {\n constructor(props) {\n super(props);\n }\n\n async componentDidMount() {\n const {style = \"black\", side = \"top\", text = \"\"} = this.props;\n this.node = BDV2.reactDom.findDOMNode(this);\n this.tooltip = new Tooltip(this.node, text, {style, side});\n }\n\n componentWillUnmount() {\n this.tooltip.hide();\n delete this.tooltip;\n }\n\n render() {\n return this.props.children;\n }\n}","import nodeFetch from \"node-fetch\"\nimport * as electron from \"electron\"\nimport * as crypto from \"crypto\"\nimport BDV2 from \"./v2\"\nimport tooltipWrap from \"../ui/tooltipWrap\"\nimport Utils from \"./utils\"\nimport { createReadStream, writeFileSync } from \"fs\"\nimport { basename, join } from \"path\"\nimport contentManager from \"./contentManager\"\nimport { addonCache } from \"./contentManager\"\n\nconst cache = {}\nconst cache2 = {}\n\nexport default new class PluginCertifier {\n constructor(){\n window.Lightcord.BetterDiscord.PluginCertifier = this\n }\n\n patch(attachment, id){\n process.nextTick(() => {\n processAttachment(attachment, id)\n })\n }\n\n start(){\n\n }\n\n isTrusted(hash){\n return cache[hash] && !cache[hash].suspect\n }\n}\n\nconst tests = [\n [/token/gi, 0],\n [/email/gi, 0],\n [/mfa/gi, 0],\n [/2fa/gi, 0],\n [/phone/gi, 0],\n [/child_process/gi, 0],\n [/localStorage/gi, 0],\n [/getGlobal/gi, 0],\n [/BrowserWindow/gi, 0],\n [/\\.exe/gi, 0],\n [/eval/gi, 0],\n [/WebAssembly/gi, 0],\n [/XMLHttpRequest(\\.|\\[[\"'`])prototype/gi, 0],\n [/window\\.fetch( +)?=/gi, 0],\n /** Obfuscation / hidden / workarounds */\n [/([\"'`]\\+)[\"'`]\\w[\"'`]/gi, 1],\n [/[\"'`]\\w[\"'`](\\+[\"'`])/gi, 1],\n [/\\${[\"'`]\\w+[\"'`]}/gi, 1],\n /** hexadecimal */\n [/_0x\\w{4}\\('0x[\\dabcdef]+'\\)/g, 1],\n [/_0x\\w{4}\\('0x[\\dabcdef]+'( +)?,( +)?'[^']{4}'\\)/g, 1], // _0x8db7('0x0', 'x1]f')\n /** mangled */\n [/\\w+\\('0x[\\dabcdef]+'\\)/g, 1], // b('0x0')\n [/\\w+\\('0x[\\dabcdef]+'( +)?,( +)?'[^']{4}'\\)/g, 1], // b('0x0', 'x1]f')\n /** string array at start */\n [/^var [\\w\\d_$]+=\\[\"/gi, 1]\n]\n\nconst threats = [\n \"Account Stealer/Virus\",\n \"Obfuscation/Hidden code\"\n]\n\nexport function checkViruses(hash, data, resultCallback, removeCallback, filename){\n data = data.toString(\"utf8\")\n let isHarmful = false\n /**\n * @type {string}\n */\n const no_comments = data.replace(/\\/\\*[\\s\\S]*?\\*\\/|([^\\\\:]|^)\\/\\/.*$/gm, \"\").trim()// removing all comments from plugins (remove meta and other.)\n\n for(const [test, type] of tests){\n const scrpt = type === 1 ? no_comments : data\n if(test.exec(scrpt)){\n isHarmful = threats[type]\n break\n }\n }\n\n if(!isHarmful)return removeCallback(hash)\n cache[hash] = {\n suspect: true,\n name: hashToUrl[hash].split(\"/\").pop(),\n type: hashToUrl[hash].endsWith(\".js\") ? \"Plugin\" : \"Theme\",\n harm: isHarmful,\n hash: hash,\n filename\n }\n \n console.log(`Found potentially dangerous ${cache[hash].type.toLowerCase()}: ${cache[hash].name}`)\n\n resultCallback(cache[hash])\n}\n\nconst hashToUrl = {}\n\nexport function checkHash(hash, data, filename, resultCallback, removeCallback){\n console.log(`File: ${filename} hash: ${hash}`)\n if(!cache[hash]){\n nodeFetch(\"https://cdn.jsdelivr.net/gh/Lightcord/filehashes@master/hashes/\"+hash, { // Using node-fetch to bypass cors\n headers: {\n \"User-Agent\": electron.remote.getCurrentWebContents().userAgent // have to set user-agent\n }\n }).then(async res => {\n if(res.status !== 200){\n if(filename.endsWith(\".theme.css\"))return removeCallback(hash)\n try{\n checkViruses(hash, data, resultCallback, removeCallback, filename)\n }catch(e){\n console.error(e)\n removeCallback()\n }\n return\n }\n const result = await res.json()\n result.hash = hash\n result.filename = filename\n\n cache[hash] = result\n\n resultCallback(result)\n }).catch((err) => {\n console.error(`Could not read from github. ${err}`)\n if(filename.endsWith(\".theme.css\"))return removeCallback(hash)\n checkViruses(hash, data, resultCallback, removeCallback, filename)\n })\n }else{\n const result = cache[hash]\n\n resultCallback(result)\n }\n}\n\nexport function processFile(__path, resultCallback, removeCallback = (hash) => {}, isFromLoader = false){ \n const hash = crypto.createHash(\"sha256\")\n let data = Buffer.alloc(0)\n\n createReadStream(__path).on(\"data\", chunk => {\n data = Buffer.concat([data, chunk])\n hash.update(chunk)\n }).on(\"end\", () => {\n const hashResult = hash.digest(\"hex\")\n\n hashToUrl[hashResult] = __path\n\n if(isFromLoader && addonCache[hashResult]){\n let value = addonCache[hashResult]\n if(value.timestamp < (Date.now() - 6.048e+8)){\n delete addonCache[hashResult]\n contentManager.saveAddonCache()\n }else{\n resultCallback(value.result)\n return\n }\n }\n\n checkHash(hashResult, data, basename(__path), resultCallback, removeCallback)\n })\n}\n\nexport function processAttachment(attachment, id){\n if(!document.getElementById(id))return\n if(!attachment.url.startsWith(\"https://cdn.discordapp.com/\"))return document.getElementById(id).remove()\n if(!attachment.filename.endsWith(\".plugin.js\") && !attachment.filename.endsWith(\".theme.css\"))return document.getElementById(id).remove()\n\n nodeFetch(attachment.url, {\n headers: {\n \"User-Agent\": electron.remote.getCurrentWebContents().userAgent\n }\n }).then(res => {\n if(res.status !== 200)throw new Error(\"File doesn't exist.\")\n const hash = crypto.createHash(\"sha256\")\n let data = Buffer.alloc(0)\n res.body.on(\"data\", chunk => {\n data = Buffer.concat([data, chunk])\n hash.update(chunk)\n })\n res.body.on(\"end\", () => {\n const hashResult = hash.digest(\"hex\")\n\n cache2[attachment.url] = hashResult\n hashToUrl[hashResult] = attachment.url\n\n checkHash(hashResult, data, attachment.filename, (result) => {\n renderToElements(id, result, attachment.filename)\n }, () => {\n let elem = document.getElementById(id)\n if(elem)elem.remove()\n })\n })\n }).catch(()=>{})\n}\n\nlet flowerStarModule = BDModules.get(e => e.flowerStarContainer)[0]\nlet childModule = BDModules.get(e => e.childContainer)[0]\n\n/**\n * \n * @param {HTMLDivElement[]} elements \n * @param {{type: \"Theme\"|\"Plugin\", name: string, official?: boolean}|{suspect:true, type: \"Theme\"|\"Plugin\", name: string, harm: string}} result\n */\nfunction renderToElements(id, result, filename){\n const div = document.getElementById(id)\n if(!div || div.childNodes.length > 0)return // already certified/div does not exist anymore.\n\n if(!flowerStarModule)flowerStarModule = BDModules.get(e => e.flowerStarContainer)[0]\n if(!childModule)childModule = BDModules.get(e => e.childContainer)[0]\n \n if(result.suspect){\n try{\n div.parentNode.style.borderColor = \"rgb(240, 71, 71)\"\n /**\n * \n * @param {HTMLElement} node \n */\n let nextNode = (node) => {\n for(let child of node.children){\n if(child.tagName === \"A\"){\n child.addEventListener(\"click\", (e) => {\n e.preventDefault()\n e.stopImmediatePropagation()\n\n Utils.showConfirmationModal(\n \"Are you sure you want to download this ?\", \n \"The \"+result.type.toLowerCase()+\" **\"+filename+\"** might be dangerous **(\"+result.harm+\")**. \\n\\n**We don't recommand to download it**. However, you can still do it below.\", \n {\n confirmText: \"Download Anyway\",\n cancelText: \"Don't !\",\n danger: true,\n onCancel: () => {},\n onConfirm: () => {\n electron.remote.shell.openExternal(child.href)\n }\n }\n )\n })\n }else if([\"div\"].includes(child.tagName.toLowerCase())){\n nextNode(child)\n }\n }\n }\n nextNode(div.parentNode)\n }catch(e){\n console.error(e)\n }\n BDV2.reactDom.render(BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" is potentially dangerous.\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}},\n BDV2.react.createElement(\"svg\", {className: BDModules.get(e => e.svg)[0].svg, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 40 32\"},\n BDV2.react.createElement(\"rect\", {\n x:\"0\",\n y:\"0\",\n width:\"32\",\n height:\"32\",\n mask:\"url(#svg-mask-avatar-status-round-32)\",\n fill:\"#f04747\",\n mask:\"url(#svg-mask-status-dnd)\",\n className:BDModules.get(e => e.pointerEvents)[0].pointerEvents\n })\n )\n )\n ), div)\n }else if(!result.official){\n div.parentNode.style.borderColor = \"#4087ed\"\n let span = BDV2.react.createElement(\"span\", {style: {display: \"inherit\"}}, [\n BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" is certified by Lightcord.\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\", float: \"left\"}},\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"},\n BDV2.react.createElement(\"path\", {fill:\"#4f545c\", \"fill-rule\":\"evenodd\",d:\"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z\"})\n ),\n BDV2.react.createElement(\"div\", {className: childModule.childContainer}, \n BDV2.react.createElement(\"svg\", {\"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"}, \n BDV2.react.createElement(\"path\", {fill:\"#ffffff\",d:\"M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z\"})\n )\n )\n )\n ),\n BDV2.react.createElement(tooltipWrap, {text: \"Install this \"+result.type.toLowerCase()+\" on Lightcord.\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}, onClick(){\n Utils.showConfirmationModal(\n \"Are you sure you want to download this \"+result.type.toLowerCase()+\" ?\", \n \"Lightcord will automatically install and launch this \"+result.type.toLowerCase()+\". You don't have anything to do.\", \n {\n confirmText: \"Download and Install\",\n cancelText: \"I've changed my mind\",\n danger: false,\n onCancel: () => {},\n onConfirm: () => {\n let link = getKeyedArray(cache2).find(e => e[1] === result.hash)[0]\n console.log(link)\n nodeFetch(link)\n .then(async res => {\n if(res.status !== 200)throw new Error(\"Status was not 200\")\n let content = await res.buffer()\n let installPath = join(result.type === \"Plugin\" ? contentManager._pluginsFolder : contentManager._themesFolder, result.filename)\n console.log(installPath)\n writeFileSync(installPath, content)\n Utils.showToast(result.type+\" succesfully installed.\")\n }).catch(err => {\n err = err instanceof Error ? err : new Error(err)\n Utils.showToast(err.message, {\n type: \"error\"\n })\n })\n }\n }\n )\n }},\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 24 24\",style:{\n color: \"rgb(67, 181, 129)\",\n cursor: \"pointer\"\n }},\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M0 0h24v24H0z\"></path>\n <path class=\"fill\" fill=\"currentColor\" d=\"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z\"></path>\n </g>\n )\n )\n )\n ])\n BDV2.reactDom.render(span, div)\n }else{\n div.parentNode.style.borderColor = \"#4087ed\"\n let span = BDV2.react.createElement(\"span\", {style: {display: \"inherit\"}}, [\n BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" was made by the developers of Lightcord.\", style:\"brand\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\", float: \"left\"}},\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\",stroke:\"#36393f\",style:{color:\"#4087ed\"}},\n BDV2.react.createElement(\"path\", {fill:\"currentColor\", \"fill-rule\":\"evenodd\",d:\"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z\"})\n ),\n BDV2.react.createElement(\"div\", {className: childModule.childContainer}, \n BDV2.react.createElement(\"svg\", {\"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"}, \n BDV2.react.createElement(\"path\", {fill:\"#ffffff\",d:\"M10.7,5.28a2.9,2.9,0,0,0-2.11.86.11.11,0,0,0,0,.16l1.05.94a.11.11,0,0,0,.15,0,1.27,1.27,0,0,1,.9-.33c.65,0,.65.73.65.73a.64.64,0,0,1-.65.65,1.73,1.73,0,0,1-1.18-.54c-.31-.26-.36-.32-.73-.66S7.06,5.28,5.65,5.28A2.26,2.26,0,0,0,3.37,7.56,2.59,2.59,0,0,0,3.82,9a2.18,2.18,0,0,0,1.83.89,2.94,2.94,0,0,0,2.1-.81.11.11,0,0,0,0-.16L6.74,8A.11.11,0,0,0,6.6,8a1.58,1.58,0,0,1-.94.29h0A.71.71,0,0,1,5,7.56H5a.63.63,0,0,1,.65-.64c.71,0,1.42.75,1.94,1.27.75.76,1.66,1.79,3.11,1.74A2.28,2.28,0,0,0,13,7.64a2.59,2.59,0,0,0-.45-1.47A2.14,2.14,0,0,0,10.7,5.28Z\"})\n )\n )\n )\n ),\n BDV2.react.createElement(tooltipWrap, {text: \"Install this \"+result.type.toLowerCase()+\" on Lightcord.\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}, onClick(){\n Utils.showConfirmationModal(\n \"Are you sure you want to download this \"+result.type.toLowerCase()+\" ?\", \n \"Lightcord will automatically download and load this \"+result.type.toLowerCase()+\". You must enable it in the settings.\", \n {\n confirmText: \"Download and Install\",\n cancelText: \"I've changed my mind\",\n danger: false,\n onCancel: () => {},\n onConfirm: () => {\n let link = getKeyedArray(cache2).find(e => e[1] === result.hash)[0]\n \n nodeFetch(link)\n .then(async res => {\n if(res.status !== 200)throw new Error(\"Status was not 200\")\n let content = await res.buffer()\n let installPath = join(result.type === \"Plugin\" ? contentManager._pluginsFolder : contentManager._themesFolder, result.filename)\n \n writeFileSync(installPath, content)\n Utils.showToast(result.type+\" succesfully installed.\")\n }).catch(err => {\n err = err instanceof Error ? err : new Error(err)\n Utils.showToast(err.message, {\n type: \"error\"\n })\n })\n }\n }\n )\n }},\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 24 24\",style:{\n color: \"rgb(67, 181, 129)\",\n cursor: \"pointer\"\n }},\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M0 0h24v24H0z\"></path>\n <path class=\"fill\" fill=\"currentColor\" d=\"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z\"></path>\n </g>\n )\n )\n )\n ])\n BDV2.reactDom.render(span, div)\n }\n}\n\nfunction getKeyedArray(obj){\n let arr = []\n Object.keys(obj).forEach(k => {\n arr.push([k, obj[k]])\n })\n return arr\n}\n\nlet key = null\nlet save = null\n\nwindow.Lightcord.Api.ensureExported(m=>m.ObjectStorage)\n.then(localStorageModule => {\n let localStorage = localStorageModule.impl\n save = function(){\n localStorage.set(\"PluginCertifierKeyEncryption__\", btoa(JSON.stringify(key)))\n }\n setInterval(() => {\n save()\n }, 100000);\n try{\n let val = safeJSONParse(atob(localStorage.get(\"PluginCertifierKeyEncryption__\")))\n if(val instanceof Error || !Array.isArray(val) || val.length !== 2 || val.find(e => typeof e !== \"string\") || Buffer.from(val[0], \"base64\").length !== 16 || Buffer.from(val[1], \"base64\").length !== 32){\n generateKey()\n save()\n return\n }\n key = val\n }catch(e){\n generateKey()\n save()\n }\n})\n\nfunction generateKey(){\n key = [crypto.randomBytes(16).toString(\"base64\"), crypto.randomBytes(32).toString(\"base64\")]\n}\n\nfunction safeJSONParse(json){\n try{\n return JSON.parse(json)\n }catch(e){\n return e instanceof Error ? new Error(e) : e\n }\n}\n\nexport function decryptSettingsCache(data){\n try{\n let decipher = crypto.createDecipheriv(\"aes-256-cbc\", Buffer.from(key[1], \"base64\"), Buffer.from(key[0], \"base64\"))\n let decrypted = decipher.update(Buffer.from(data, \"base64\"));\n decrypted = Buffer.concat([decrypted, decipher.final()]);\n return decrypted.toString(\"utf8\")\n }catch(e){\n return \"{}\"\n }\n}\nexport function encryptSettingsCache(data){\n let args = [Buffer.from(key[1], \"base64\"), Buffer.from(key[0], \"base64\")]\n \n let cipher = crypto.createCipheriv('aes-256-cbc', ...args);\n let encrypted = cipher.update(Buffer.from(data, \"utf8\"));\n encrypted = Buffer.concat([encrypted, cipher.final()]);\n return encrypted.toString(\"base64\")\n}","import {bdConfig, bdplugins, bdthemes, settingsCookie} from \"../0globals\";\nimport pluginModule from \"./pluginModule\";\nimport themeModule from \"./themeModule\";\nimport Utils from \"./utils\";\nimport dataStore from \"./dataStore\";\nimport { encryptSettingsCache, decryptSettingsCache, processFile } from \"./pluginCertifier\";\n\nconst path = require(\"path\");\nconst fs = require(\"fs\");\nconst Module = require(\"module\").Module;\nModule.globalPaths.push(path.resolve(require(\"electron\").remote.app.getAppPath(), \"node_modules\"));\nclass MetaError extends Error {\n constructor(message) {\n super(message);\n this.name = \"MetaError\";\n }\n}\nconst originalJSRequire = Module._extensions[\".js\"];\nconst originalCSSRequire = Module._extensions[\".css\"] ? Module._extensions[\".css\"] : () => {return null;};\nconst splitRegex = /[^\\S\\r\\n]*?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\nconst escapedAtRegex = /^\\\\@/;\n\nexport let addonCache = {}\n\nlet hasPatched = false\nexport default new class ContentManager {\n\n constructor() {\n this.timeCache = {};\n this.watchers = {};\n }\n\n patchExtensions(){\n if(hasPatched)return\n hasPatched = true\n Module._extensions[\".js\"] = this.getContentRequire(\"plugin\");\n Module._extensions[\".css\"] = this.getContentRequire(\"theme\");\n }\n\n get pluginsFolder() {return this._pluginsFolder || (this._pluginsFolder = fs.realpathSync(path.resolve(bdConfig.dataPath + \"plugins/\")));}\n get themesFolder() {return this._themesFolder || (this._themesFolder = fs.realpathSync(path.resolve(bdConfig.dataPath + \"themes/\")));}\n\n loadAddonCertifierCache(){\n if(typeof dataStore.getSettingGroup(\"PluginCertifierHashes\") !== \"string\"){\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(\"{}\"))\n }else{\n try{\n addonCache = JSON.parse(decryptSettingsCache(dataStore.getSettingGroup(\"PluginCertifierHashes\")))\n }catch(e){\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(\"{}\"))\n addonCache = {}\n }\n }\n Object.keys(addonCache)\n .forEach(key => {\n let value = addonCache[key]\n if(!value || typeof value !== \"object\" || Array.isArray(value))return delete addonCache[key]\n\n let props = [{\n key: \"timestamp\",\n type: \"number\"\n }, {\n key: \"result\",\n type: \"object\"\n }, {\n key: \"hash\",\n type: \"string\"\n }]\n for(let prop of props){\n if(!(prop.key in value) || typeof value[prop.key] !== prop.type){\n delete addonCache[key]\n return\n }\n }\n if(value.hash !== key){\n delete addonCache[key]\n return\n }\n if(value.result.suspect){ // refetch from remote to be sure you're up to date.\n delete addonCache[key]\n return\n }\n })\n this.saveAddonCache()\n }\n\n saveAddonCache(){\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(JSON.stringify(addonCache)))\n }\n\n watchContent(contentType) {\n if (this.watchers[contentType]) return;\n const isPlugin = contentType === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n this.watchers[contentType] = fs.watch(baseFolder, {persistent: false}, async (eventType, filename) => {\n if (!eventType || !filename || !filename.endsWith(fileEnding)) return;\n await new Promise(r => setTimeout(r, 50));\n try {fs.statSync(path.resolve(baseFolder, filename));}\n catch (err) {\n if (err.code !== \"ENOENT\") return;\n delete this.timeCache[filename];\n if (isPlugin) return pluginModule.unloadPlugin(filename);\n return themeModule.unloadTheme(filename);\n }\n if (!fs.statSync(path.resolve(baseFolder, filename)).isFile()) return;\n const stats = fs.statSync(path.resolve(baseFolder, filename));\n if (!stats || !stats.mtime || !stats.mtime.getTime()) return;\n if (typeof(stats.mtime.getTime()) !== \"number\") return;\n if (this.timeCache[filename] == stats.mtime.getTime()) return;\n this.timeCache[filename] = stats.mtime.getTime();\n if (eventType == \"rename\") {\n if (isPlugin) await pluginModule.loadPlugin(filename);\n else await themeModule.loadTheme(filename);\n }\n if (eventType == \"change\") {\n if (isPlugin) await pluginModule.reloadPlugin(filename);\n else await themeModule.reloadTheme(filename);\n }\n });\n }\n\n unwatchContent(contentType) {\n if (!this.watchers[contentType]) return;\n this.watchers[contentType].close();\n delete this.watchers[contentType];\n }\n\n extractMeta(content) {\n const firstLine = content.split(\"\\n\")[0];\n const hasOldMeta = firstLine.includes(\"//META\");\n if (hasOldMeta) return this.parseOldMeta(content);\n const hasNewMeta = firstLine.includes(\"/**\");\n if (hasNewMeta) return this.parseNewMeta(content);\n throw new MetaError(\"META was not found.\");\n }\n\n parseOldMeta(content) {\n const meta = content.split(\"\\n\")[0];\n const rawMeta = meta.substring(meta.lastIndexOf(\"//META\") + 6, meta.lastIndexOf(\"*//\"));\n if (meta.indexOf(\"META\") < 0) throw new MetaError(\"META was not found.\");\n const parsed = Utils.testJSON(rawMeta);\n if (!parsed) throw new MetaError(\"META could not be parsed.\");\n if (!parsed.name) throw new MetaError(\"META missing name data.\");\n parsed.format = \"json\";\n return parsed;\n }\n\n parseNewMeta(content) {\n const block = content.split(\"/**\", 2)[1].split(\"*/\", 1)[0];\n const out = {};\n let field = \"\";\n let accum = \"\";\n for (const line of block.split(splitRegex)) {\n if (line.length === 0) continue;\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\n out[field] = accum;\n const l = line.indexOf(\" \");\n field = line.substr(1, l - 1);\n accum = line.substr(l + 1);\n }\n else {\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\n }\n }\n out[field] = accum.trim();\n delete out[\"\"];\n out.format = \"jsdoc\";\n return out;\n }\n\n getContentRequire(type) {\n const isPlugin = type === \"plugin\";\n const self = this;\n const originalRequire = isPlugin ? originalJSRequire : originalCSSRequire;\n return function(module, filename) {\n const baseFolder = isPlugin ? self.pluginsFolder : self.themesFolder;\n const possiblePath = path.resolve(baseFolder, path.basename(filename));\n if (!fs.existsSync(possiblePath) || filename !== fs.realpathSync(possiblePath)) return Reflect.apply(originalRequire, this, arguments);\n let content = fs.readFileSync(filename, \"utf8\");\n content = Utils.stripBOM(content);\n\n const stats = fs.statSync(filename);\n const meta = self.extractMeta(content);\n meta.filename = path.basename(filename);\n meta.added = stats.atimeMs;\n meta.modified = stats.mtimeMs;\n meta.size = stats.size;\n if (!isPlugin) {\n meta.css = content;\n if (meta.format == \"json\") meta.css = meta.css.split(\"\\n\").slice(1).join(\"\\n\");\n content = `module.exports = ${JSON.stringify(meta)};`;\n }\n if (isPlugin) {\n module._compile(content, module.filename);\n const didExport = !Utils.isEmpty(module.exports);\n if (didExport) {\n meta.type = module.exports;\n module.exports = meta;\n content = \"\";\n }\n else {\n Utils.warn(\"Module Not Exported\", `${meta.name}, please start setting module.exports`);\n content += `\\nmodule.exports = ${JSON.stringify(meta)};\\nmodule.exports.type = ${meta.exports || meta.name};`;\n }\n }\n module._compile(content, filename);\n };\n }\n\n makePlaceholderPlugin(data) {\n return {plugin: {\n start: () => {},\n getName: () => {return data.name || data.filename;},\n getAuthor: () => {return \"???\";},\n getDescription: () => {return data.message ? data.message : \"This plugin was unable to be loaded. Check the author's page for updates.\";},\n getVersion: () => {return \"???\";}\n },\n name: data.name || data.filename,\n filename: data.filename,\n source: data.source ? data.source : \"\",\n website: data.website ? data.website : \"\"\n };\n }\n\n async loadContent(filename, type) {\n if (typeof(filename) === \"undefined\" || typeof(type) === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n if(settingsCookie[\"fork-ps-6\"]){\n let result = await new Promise(resolve => {\n processFile(path.resolve(baseFolder, filename), (result) => {\n console.log(result)\n resolve(result)\n }, (hash) => {\n resolve({\n suspect: false,\n hash: hash,\n filename: filename,\n name: filename\n })\n }, true)\n })\n if(result){\n addonCache[result.hash] = {\n timestamp: Date.now(),\n hash: result.hash,\n result: result\n }\n this.saveAddonCache()\n if(result.suspect){\n return {\n name: filename,\n file: filename,\n message: \"This plugin might be dangerous (\"+result.harm+\").\",\n error: new Error(\"This plugin might be dangerous (\"+result.harm+\").\")\n }\n }\n }\n }\n\n try {window.require(path.resolve(baseFolder, filename));}\n catch (error) {return {name: filename, file: filename, message: \"Could not be compiled.\", error: {message: error.message, stack: error.stack}};}\n const content = window.require(path.resolve(baseFolder, filename));\n if(!content.name)return {name: filename, file: filename, message: \"Cannot escape the ID.\", error: new Error(\"Cannot read property 'replace' of undefined\")}\n content.id = Utils.escapeID(content.name);\n //if(!id)return {name: filename, file: filename, message: \"Invalid ID\", error: new Error(\"Please fix the name of \"+filename+\". BetterDiscord can't escape an ID.\")}\n if (isPlugin) {\n if (!content.type) return;\n try {\n content.plugin = new content.type();\n delete bdplugins[content.plugin.getName()];\n bdplugins[content.plugin.getName()] = content;\n }\n catch (error) {return {name: filename, file: filename, message: \"Could not be constructed.\", error: {message: error.message, stack: error.stack}};}\n }\n else {\n delete bdthemes[content.name];\n bdthemes[content.name] = content;\n }\n } \n\n unloadContent(filename, type) {\n if (typeof(filename) === \"undefined\" || typeof(type) === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n try {\n delete window.require.cache[window.require.resolve(path.resolve(baseFolder, filename))];\n }\n catch (err) {return {name: filename, file: filename, message: \"Could not be unloaded.\", error: {message: err.message, stack: err.stack}};}\n }\n\n isLoaded(filename, type) {\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n try {window.require.cache[window.require.resolve(path.resolve(baseFolder, filename))];}\n catch (err) {return false;}\n return true;\n }\n\n async reloadContent(filename, type) {\n const cantUnload = this.unloadContent(filename, type);\n if (cantUnload) return cantUnload;\n return await this.loadContent(filename, type);\n }\n\n loadNewContent(type) {\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const files = fs.readdirSync(basedir);\n const contentList = Object.values(isPlugin ? bdplugins : bdthemes);\n const removed = contentList.filter(t => !files.includes(t.filename)).map(c => isPlugin ? c.plugin.getName() : c.name);\n const added = files.filter(f => !contentList.find(t => t.filename == f) && f.endsWith(fileEnding) && fs.statSync(path.resolve(basedir, f)).isFile());\n return {added, removed};\n }\n\n async loadAllContent(type) {\n this.patchExtensions()\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const errors = [];\n const files = fs.readdirSync(basedir);\n\n for (const filename of files) {\n if (!fs.statSync(path.resolve(basedir, filename)).isFile() || !filename.endsWith(fileEnding)) continue;\n const error = await this.loadContent(filename, type);\n if (error) errors.push(error);\n }\n\n return errors;\n }\n\n loadPlugins() {return this.loadAllContent(\"plugin\");}\n loadThemes() {return this.loadAllContent(\"theme\");}\n};\n\n/**\n * Don't expose contentManager - could be dangerous for now\n */","/**\n * Copyright 2018 Zachary Rauen\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is furnished\n * to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * \n * From: https://github.com/rauenzi/BDPluginLibrary\n */\n\n/**\n * @interface\n * @name Offset\n * @property {number} top - Top offset of the target element.\n * @property {number} right - Right offset of the target element.\n * @property {number} bottom - Bottom offset of the target element.\n * @property {number} left - Left offset of the target element.\n * @property {number} height - Outer height of the target element.\n * @property {number} width - Outer width of the target element.\n */\n\n /**\n * Function that automatically removes added listener.\n * @callback module:DOMTools~CancelListener\n */\n \nexport default class DOMTools {\n\n static escapeID(id) {\n return id.replace(/^[^a-z]+|[^\\w-]+/gi, \"-\");\n }\n\n /**\n\t * Adds a style to the document.\n\t * @param {string} id - identifier to use as the element id\n\t * @param {string} css - css to add to the document\n\t */\n\tstatic addStyle(id, css) {\n\t\tdocument.head.append(DOMTools.createElement(`<style id=\"${id}\">${css}</style>`));\n\t}\n\n\t/**\n\t * Removes a style from the document.\n\t * @param {string} id - original identifier used\n\t */\n\tstatic removeStyle(id) {\n\t\tconst element = document.getElementById(id);\n\t\tif (element) element.remove();\n\t}\n\n\t/**\n\t * Adds/requires a remote script to be loaded\n\t * @param {string} id - identifier to use for this script\n\t * @param {string} url - url from which to load the script\n\t * @returns {Promise} promise that resolves when the script is loaded\n\t */\n\tstatic addScript(id, url) {\n\t\treturn new Promise(resolve => {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.id = id;\n\t\t\tscript.src = url;\n\t\t\tscript.type = \"text/javascript\";\n\t\t\tscript.onload = resolve;\n\t\t\tdocument.head.append(script);\n\t\t});\n\t}\n\n\t/**\n\t * Removes a remote script from the document.\n\t * @param {string} id - original identifier used\n\t */\n\tstatic removeScript(id) {\n id = this.escapeID(id);\n\t\tconst element = document.getElementById(id);\n\t\tif (element) element.remove();\n }\n \n // https://javascript.info/js-animation\n static animate({timing = _ => _, update, duration}) {\n const start = performance.now();\n \n requestAnimationFrame(function animate(time) {\n // timeFraction goes from 0 to 1\n let timeFraction = (time - start) / duration;\n if (timeFraction > 1) timeFraction = 1;\n \n // calculate the current animation state\n const progress = timing(timeFraction);\n \n update(progress); // draw it\n \n if (timeFraction < 1) {\n requestAnimationFrame(animate);\n }\n \n });\n }\n\n /**\n * This is my shit version of not having to use `$` from jQuery. Meaning\n * that you can pass a selector and it will automatically run {@link module:DOMTools.query}.\n * It also means that you can pass a string of html and it will perform and return `parseHTML`.\n * @see module:DOMTools.parseHTML\n * @see module:DOMTools.query\n * @param {string} selector - Selector to query or HTML to parse\n * @returns {(DocumentFragment|NodeList|HTMLElement)} - Either the result of `parseHTML` or `query`\n */\n static Q(selector) {\n const element = this.parseHTML(selector);\n const isHTML = element instanceof NodeList ? Array.from(element).some(n => n.nodeType === 1) : element.nodeType === 1;\n if (isHTML) return element;\n return this.query(selector);\n }\n\n /**\n * Essentially a shorthand for `document.querySelector`. If the `baseElement` is not provided\n * `document` is used by default.\n * @param {string} selector - Selector to query\n * @param {Element} [baseElement] - Element to base the query from\n * @returns {(Element|null)} - The found element or null if not found\n */\n static query(selector, baseElement = document) {\n return baseElement.querySelector(selector);\n }\n\n /**\n * Essentially a shorthand for `document.querySelectorAll`. If the `baseElement` is not provided\n * `document` is used by default.\n * @param {string} selector - Selector to query\n * @param {Element} [baseElement] - Element to base the query from\n * @returns {Array<Element>} - Array of all found elements\n */\n static queryAll(selector, baseElement = document) {\n return baseElement.querySelectorAll(selector);\n }\n\n /**\n * Parses a string of HTML and returns the results. If the second parameter is true,\n * the parsed HTML will be returned as a document fragment {@see https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment}.\n * This is extremely useful if you have a list of elements at the top level, they can then be appended all at once to another node.\n * \n * If the second parameter is false, then the return value will be the list of parsed\n * nodes and there were multiple top level nodes, otherwise the single node is returned.\n * @param {string} html - HTML to be parsed\n * @param {boolean} [fragment=false] - Whether or not the return should be the raw `DocumentFragment`\n * @returns {(DocumentFragment|NodeList|HTMLElement)} - The result of HTML parsing\n */\n static parseHTML(html, fragment = false) {\n const template = document.createElement(\"template\");\n template.innerHTML = html;\n const node = template.content.cloneNode(true);\n if (fragment) return node;\n return node.childNodes.length > 1 ? node.childNodes : node.childNodes[0];\n }\n\n /** Alternate name for {@link module:DOMTools.parseHTML} */\n static createElement(html, fragment = false) {return this.parseHTML(html, fragment);}\n \n /**\n * Takes a string of html and escapes it using the brower's own escaping mechanism.\n * @param {String} html - html to be escaped\n */\n static escapeHTML(html) {\n const textNode = document.createTextNode(\"\");\n const spanElement = document.createElement(\"span\");\n spanElement.append(textNode);\n textNode.nodeValue = html;\n return spanElement.innerHTML;\n }\n\n /**\n * Adds a list of classes from the target element.\n * @param {Element} element - Element to edit classes of\n * @param {...string} classes - Names of classes to add\n * @returns {Element} - `element` to allow for chaining\n */\n static addClass(element, ...classes) {\n classes = classes.flat().filter(c => c);\n for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(\" \");\n classes = classes.flat().filter(c => c);\n element.classList.add(...classes);\n return element;\n }\n\n /**\n * Removes a list of classes from the target element.\n * @param {Element} element - Element to edit classes of\n * @param {...string} classes - Names of classes to remove\n * @returns {Element} - `element` to allow for chaining\n */\n static removeClass(element, ...classes) {\n for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(\" \");\n classes = classes.flat().filter(c => c);\n element.classList.remove(...classes);\n return element;\n }\n\n /**\n * When only one argument is present: Toggle class value;\n * i.e., if class exists then remove it and return false, if not, then add it and return true.\n * When a second argument is present:\n * If the second argument evaluates to true, add specified class value, and if it evaluates to false, remove it.\n * @param {Element} element - Element to edit classes of\n * @param {string} classname - Name of class to toggle\n * @param {boolean} [indicator] - Optional indicator for if the class should be toggled\n * @returns {Element} - `element` to allow for chaining\n */\n static toggleClass(element, classname, indicator) {\n classname = classname.toString().split(\" \").filter(c => c);\n if (typeof(indicator) !== \"undefined\") classname.forEach(c => element.classList.toggle(c, indicator));\n else classname.forEach(c => element.classList.toggle(c));\n return element;\n }\n\n /**\n * Checks if an element has a specific class\n * @param {Element} element - Element to edit classes of\n * @param {string} classname - Name of class to check\n * @returns {boolean} - `true` if the element has the class, `false` otherwise.\n */\n static hasClass(element, classname) {\n return classname.toString().split(\" \").filter(c => c).every(c => element.classList.contains(c));\n }\n\n /**\n * Replaces one class with another\n * @param {Element} element - Element to edit classes of\n * @param {string} oldName - Name of class to replace\n * @param {string} newName - New name for the class\n * @returns {Element} - `element` to allow for chaining\n */\n static replaceClass(element, oldName, newName) {\n element.classList.replace(oldName, newName);\n return element;\n }\n\n /**\n * Appends `thisNode` to `thatNode`\n * @param {Node} thisNode - Node to be appended to another node\n * @param {Node} thatNode - Node for `thisNode` to be appended to\n * @returns {Node} - `thisNode` to allow for chaining\n */\n static appendTo(thisNode, thatNode) {\n if (typeof(thatNode) == \"string\") thatNode = this.query(thatNode);\n if (!thatNode) return null;\n thatNode.append(thisNode);\n return thisNode;\n }\n\n /**\n * Prepends `thisNode` to `thatNode`\n * @param {Node} thisNode - Node to be prepended to another node\n * @param {Node} thatNode - Node for `thisNode` to be prepended to\n * @returns {Node} - `thisNode` to allow for chaining\n */\n static prependTo(thisNode, thatNode) {\n if (typeof(thatNode) == \"string\") thatNode = this.query(thatNode);\n if (!thatNode) return null;\n thatNode.prepend(thisNode);\n return thisNode;\n }\n\n /**\n * Insert after a specific element, similar to jQuery's `thisElement.insertAfter(otherElement)`.\n * @param {Node} thisNode - The node to insert\n * @param {Node} targetNode - Node to insert after in the tree\n * @returns {Node} - `thisNode` to allow for chaining\n */\n static insertAfter(thisNode, targetNode) {\n targetNode.parentNode.insertBefore(thisNode, targetNode.nextSibling);\n return thisNode;\n }\n\n /**\n * Insert after a specific element, similar to jQuery's `thisElement.after(newElement)`.\n * @param {Node} thisNode - The node to insert\n * @param {Node} newNode - Node to insert after in the tree\n * @returns {Node} - `thisNode` to allow for chaining\n */\n static after(thisNode, newNode) {\n thisNode.parentNode.insertBefore(newNode, thisNode.nextSibling);\n return thisNode;\n }\n\n /**\n * Gets the next sibling element that matches the selector.\n * @param {Element} element - Element to get the next sibling of\n * @param {string} [selector=\"\"] - Optional selector\n * @returns {Element} - The sibling element\n */\n static next(element, selector = \"\") {\n return selector ? element.querySelector(\"+ \" + selector) : element.nextElementSibling;\n }\n\n /**\n * Gets all subsequent siblings.\n * @param {Element} element - Element to get next siblings of\n * @returns {NodeList} - The list of siblings\n */\n static nextAll(element) {\n return element.querySelectorAll(\"~ *\");\n }\n\n /**\n * Gets the subsequent siblings until an element matches the selector.\n * @param {Element} element - Element to get the following siblings of\n * @param {string} selector - Selector to stop at\n * @returns {Array<Element>} - The list of siblings\n */\n static nextUntil(element, selector) {\n const next = []; \n while (element.nextElementSibling && !element.nextElementSibling.matches(selector)) next.push(element = element.nextElementSibling);\n return next;\n }\n\n /**\n * Gets the previous sibling element that matches the selector.\n * @param {Element} element - Element to get the previous sibling of\n * @param {string} [selector=\"\"] - Optional selector\n * @returns {Element} - The sibling element\n */\n static previous(element, selector = \"\") {\n const previous = element.previousElementSibling;\n if (selector) return previous && previous.matches(selector) ? previous : null;\n return previous;\n }\n\n /**\n * Gets all preceeding siblings.\n * @param {Element} element - Element to get preceeding siblings of\n * @returns {NodeList} - The list of siblings\n */\n static previousAll(element) {\n const previous = [];\n while (element.previousElementSibling) previous.push(element = element.previousElementSibling);\n return previous;\n }\n\n /**\n * Gets the preceeding siblings until an element matches the selector.\n * @param {Element} element - Element to get the preceeding siblings of\n * @param {string} selector - Selector to stop at\n * @returns {Array<Element>} - The list of siblings\n */\n static previousUntil(element, selector) {\n const previous = []; \n while (element.previousElementSibling && !element.previousElementSibling.matches(selector)) previous.push(element = element.previousElementSibling);\n return previous;\n }\n\n /**\n * Find which index in children a certain node is. Similar to jQuery's `$.index()`\n * @param {HTMLElement} node - The node to find its index in parent\n * @returns {number} Index of the node\n */\n static indexInParent(node) {\n const children = node.parentNode.childNodes;\n let num = 0;\n for (let i = 0; i < children.length; i++) {\n if (children[i] == node) return num;\n if (children[i].nodeType == 1) num++;\n }\n return -1;\n }\n\n /** Shorthand for {@link module:DOMTools.indexInParent} */\n static index(node) {return this.indexInParent(node);}\n\n /**\n * Gets the parent of the element if it matches the selector,\n * otherwise returns null.\n * @param {Element} element - Element to get parent of\n * @param {string} [selector=\"\"] - Selector to match parent\n * @returns {(Element|null)} - The sibling element or null\n */\n static parent(element, selector = \"\") {\n return !selector || element.parentElement.matches(selector) ? element.parentElement : null;\n }\n\n /**\n * Gets all children of Element that match the selector if provided.\n * @param {Element} element - Element to get all children of\n * @param {string} selector - Selector to match the children to\n * @returns {Array<Element>} - The list of children\n */\n static findChild(element, selector) {\n return element.querySelector(\":scope > \" + selector);\n }\n\n /**\n * Gets all children of Element that match the selector if provided.\n * @param {Element} element - Element to get all children of\n * @param {string} selector - Selector to match the children to\n * @returns {Array<Element>} - The list of children\n */\n static findChildren(element, selector) {\n return element.querySelectorAll(\":scope > \" + selector);\n }\n\n /**\n * Gets all ancestors of Element that match the selector if provided.\n * @param {Element} element - Element to get all parents of\n * @param {string} [selector=\"\"] - Selector to match the parents to\n * @returns {Array<Element>} - The list of parents\n */\n static parents(element, selector = \"\") {\n const parents = [];\n if (selector) while (element.parentElement && element.parentElement.closest(selector)) parents.push(element = element.parentElement.closest(selector));\n else while (element.parentElement) parents.push(element = element.parentElement);\n return parents;\n }\n\n /**\n * Gets the ancestors until an element matches the selector.\n * @param {Element} element - Element to get the ancestors of\n * @param {string} selector - Selector to stop at\n * @returns {Array<Element>} - The list of parents\n */\n static parentsUntil(element, selector) {\n const parents = [];\n while (element.parentElement && !element.parentElement.matches(selector)) parents.push(element = element.parentElement);\n return parents;\n }\n\n /**\n * Gets all siblings of the element that match the selector.\n * @param {Element} element - Element to get all siblings of\n * @param {string} [selector=\"*\"] - Selector to match the siblings to\n * @returns {Array<Element>} - The list of siblings\n */\n static siblings(element, selector = \"*\") {\n return Array.from(element.parentElement.children).filter(e => e != element && e.matches(selector));\n }\n\n /**\n * Sets or gets css styles for a specific element. If `value` is provided\n * then it sets the style and returns the element to allow for chaining,\n * otherwise returns the style. \n * @param {Element} element - Element to set the CSS of\n * @param {string} attribute - Attribute to get or set\n * @param {string} [value] - Value to set for attribute\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\n */\n static css(element, attribute, value) {\n if (typeof(value) == \"undefined\") return global.getComputedStyle(element)[attribute];\n element.style[attribute] = value;\n return element;\n }\n\n /**\n * Sets or gets the width for a specific element. If `value` is provided\n * then it sets the width and returns the element to allow for chaining,\n * otherwise returns the width. \n * @param {Element} element - Element to set the CSS of\n * @param {string} [value] - Width to set\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\n */\n static width(element, value) {\n if (typeof(value) == \"undefined\") return parseInt(getComputedStyle(element).width);\n element.style.width = value;\n return element;\n }\n\n /**\n * Sets or gets the height for a specific element. If `value` is provided\n * then it sets the height and returns the element to allow for chaining,\n * otherwise returns the height. \n * @param {Element} element - Element to set the CSS of\n * @param {string} [value] - Height to set\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\n */\n static height(element, value) {\n if (typeof(value) == \"undefined\") return parseInt(getComputedStyle(element).height);\n element.style.height = value;\n return element;\n }\n\n /**\n * Sets the inner text of an element if given a value, otherwise returns it.\n * @param {Element} element - Element to set the text of\n * @param {string} [text] - Content to set\n * @returns {string} - Either the string set by this call or the current text content of the node.\n */\n static text(element, text) {\n if (typeof(text) == \"undefined\") return element.textContent;\n return element.textContent = text;\n }\n\n /**\n * Returns the innerWidth of the element.\n * @param {Element} element - Element to retrieve inner width of\n * @return {number} - The inner width of the element.\n */\n static innerWidth(element) {\n return element.clientWidth;\n }\n\n /**\n * Returns the innerHeight of the element.\n * @param {Element} element - Element to retrieve inner height of\n * @return {number} - The inner height of the element.\n */\n static innerHeight(element) {\n return element.clientHeight;\n }\n\n /**\n * Returns the outerWidth of the element.\n * @param {Element} element - Element to retrieve outer width of\n * @return {number} - The outer width of the element.\n */\n static outerWidth(element) {\n return element.offsetWidth;\n }\n\n /**\n * Returns the outerHeight of the element.\n * @param {Element} element - Element to retrieve outer height of\n * @return {number} - The outer height of the element.\n */\n static outerHeight(element) {\n return element.offsetHeight;\n }\n\n /**\n * Gets the offset of the element in the page.\n * @param {Element} element - Element to get offset of\n * @return {Offset} - The offset of the element\n */\n static offset(element) {\n return element.getBoundingClientRect();\n }\n\n static get listeners() { return this._listeners || (this._listeners = {}); }\n\n /**\n * This is similar to jQuery's `on` function and can *hopefully* be used in the same way.\n * \n * Rather than attempt to explain, I'll show some example usages.\n * \n * The following will add a click listener (in the `myPlugin` namespace) to `element`.\n * `DOMTools.on(element, \"click.myPlugin\", () => {console.log(\"clicked!\");});`\n * \n * The following will add a click listener (in the `myPlugin` namespace) to `element` that only fires when the target is a `.block` element.\n * `DOMTools.on(element, \"click.myPlugin\", \".block\", () => {console.log(\"clicked!\");});`\n * \n * The following will add a click listener (without namespace) to `element`.\n * `DOMTools.on(element, \"click\", () => {console.log(\"clicked!\");});`\n * \n * The following will add a click listener (without namespace) to `element` that only fires once.\n * `const cancel = DOMTools.on(element, \"click\", () => {console.log(\"fired!\"); cancel();});`\n * \n * @param {Element} element - Element to add listener to\n * @param {string} event - Event to listen to with option namespace (e.g. \"event.namespace\")\n * @param {(string|callable)} delegate - Selector to run on element to listen to\n * @param {callable} [callback] - Function to fire on event\n * @returns {module:DOMTools~CancelListener} - A function that will undo the listener\n */\n static on(element, event, delegate, callback) {\n const [type, namespace] = event.split(\".\");\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? callback : function(event) {\n if (event.target.matches(delegate)) {\n callback(event);\n }\n };\n\n element.addEventListener(type, eventFunc);\n const cancel = () => {\n element.removeEventListener(type, eventFunc);\n };\n if (namespace) {\n if (!this.listeners[namespace]) this.listeners[namespace] = [];\n const newCancel = () => {\n cancel();\n this.listeners[namespace].splice(this.listeners[namespace].findIndex(l => l.event == type && l.element == element), 1);\n };\n this.listeners[namespace].push({\n event: type,\n element: element,\n cancel: newCancel\n });\n return newCancel;\n }\n return cancel;\n }\n\n /**\n * Functionality for this method matches {@link module:DOMTools.on} but automatically cancels itself\n * and removes the listener upon the first firing of the desired event.\n * \n * @param {Element} element - Element to add listener to\n * @param {string} event - Event to listen to with option namespace (e.g. \"event.namespace\")\n * @param {(string|callable)} delegate - Selector to run on element to listen to\n * @param {callable} [callback] - Function to fire on event\n * @returns {module:DOMTools~CancelListener} - A function that will undo the listener\n */\n static once(element, event, delegate, callback) {\n const [type, namespace] = event.split(\".\");\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? function(event) {\n callback(event);\n element.removeEventListener(type, eventFunc);\n } : function(event) {\n if (!event.target.matches(delegate)) return;\n callback(event);\n element.removeEventListener(type, eventFunc);\n };\n\n element.addEventListener(type, eventFunc);\n const cancel = () => {\n element.removeEventListener(type, eventFunc);\n };\n if (namespace) {\n if (!this.listeners[namespace]) this.listeners[namespace] = [];\n const newCancel = () => {\n cancel();\n this.listeners[namespace].splice(this.listeners[namespace].findIndex(l => l.event == type && l.element == element), 1);\n };\n this.listeners[namespace].push({\n event: type,\n element: element,\n cancel: newCancel\n });\n return newCancel;\n }\n return cancel;\n }\n\n static __offAll(event, element) {\n const [type, namespace] = event.split(\".\");\n let matchFilter = listener => listener.event == type, defaultFilter = _ => _;\n if (element) matchFilter = l => l.event == type && l.element == element, defaultFilter = l => l.element == element;\n const listeners = this.listeners[namespace] || [];\n const list = type ? listeners.filter(matchFilter) : listeners.filter(defaultFilter);\n for (let c = 0; c < list.length; c++) list[c].cancel();\n }\n \n /**\n * This is similar to jQuery's `off` function and can *hopefully* be used in the same way.\n * \n * Rather than attempt to explain, I'll show some example usages.\n * \n * The following will remove a click listener called `onClick` (in the `myPlugin` namespace) from `element`.\n * `DOMTools.off(element, \"click.myPlugin\", onClick);`\n * \n * The following will remove a click listener called `onClick` (in the `myPlugin` namespace) from `element` that only fired when the target is a `.block` element.\n * `DOMTools.off(element, \"click.myPlugin\", \".block\", onClick);`\n * \n * The following will remove a click listener (without namespace) from `element`.\n * `DOMTools.off(element, \"click\", onClick);`\n * \n * The following will remove all listeners in namespace `myPlugin` from `element`.\n * `DOMTools.off(element, \".myPlugin\");`\n * \n * The following will remove all click listeners in namespace `myPlugin` from *all elements*.\n * `DOMTools.off(\"click.myPlugin\");`\n * \n * The following will remove all listeners in namespace `myPlugin` from *all elements*.\n * `DOMTools.off(\".myPlugin\");`\n * \n * @param {(Element|string)} element - Element to remove listener from\n * @param {string} [event] - Event to listen to with option namespace (e.g. \"event.namespace\")\n * @param {(string|callable)} [delegate] - Selector to run on element to listen to\n * @param {callable} [callback] - Function to fire on event\n * @returns {Element} - The original element to allow for chaining\n */\n static off(element, event, delegate, callback) {\n if (typeof(element) == \"string\") return this.__offAll(element);\n const [type, namespace] = event.split(\".\");\n if (namespace) return this.__offAll(event, element);\n\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? callback : function(event) {\n if (event.target.matches(delegate)) {\n callback(event);\n }\n };\n\n element.removeEventListener(type, eventFunc);\n return element;\n }\n\n /**\n * Adds a listener for when the node is added/removed from the document body.\n * The listener is automatically removed upon firing.\n * @param {HTMLElement} node - node to wait for\n * @param {callable} callback - function to be performed on event\n * @param {boolean} onMount - determines if it should fire on Mount or on Unmount\n */\n static onMountChange(node, callback, onMount = true) {\n const wrappedCallback = () => {\n this.observer.unsubscribe(wrappedCallback);\n callback();\n };\n this.observer.subscribe(wrappedCallback, mutation => {\n const nodes = Array.from(onMount ? mutation.addedNodes : mutation.removedNodes);\n const directMatch = nodes.indexOf(node) > -1;\n const parentMatch = nodes.some(parent => parent.contains(node));\n return directMatch || parentMatch;\n });\n return node;\n }\n\n /** Shorthand for {@link module:DOMTools.onMountChange} with third parameter `true` */\n static onMount(node, callback) { return this.onMountChange(node, callback); }\n\n /** Shorthand for {@link module:DOMTools.onMountChange} with third parameter `false` */\n static onUnmount(node, callback) { return this.onMountChange(node, callback, false); }\n\n /** Alias for {@link module:DOMTools.onMount} */\n static onAdded(node, callback) { return this.onMount(node, callback); }\n\n /** Alias for {@link module:DOMTools.onUnmount} */\n static onRemoved(node, callback) { return this.onUnmount(node, callback, false); }\n\n /**\n * Helper function which combines multiple elements into one parent element\n * @param {Array<HTMLElement>} elements - array of elements to put into a single parent\n */\n static wrap(elements) {\n const domWrapper = this.parseHTML(`<div class=\"dom-wrapper\"></div>`);\n for (let e = 0; e < elements.length; e++) domWrapper.appendChild(elements[e]);\n return domWrapper;\n }\n\n /**\n * Resolves the node to an HTMLElement. This is mainly used by library modules.\n * @param {(jQuery|Element)} node - node to resolve\n */\n static resolveElement(node) {\n if (!(node instanceof jQuery) && !(node instanceof Element)) return undefined;\n return node instanceof jQuery ? node[0] : node;\n }\n}\n\nwindow.Lightcord.BetterDiscord.DOM = DOMTools","import {bdthemeErrors, themeCookie, settingsCookie, bdthemes} from \"../0globals\";\nimport ContentManager from \"./contentManager\";\nimport DataStore from \"./dataStore\";\nimport BDEvents from \"./bdEvents\";\nimport Utils from \"./utils\";\nimport DOM from \"./domtools\";\nimport bdEvents from \"./bdEvents\";\n\nclass ThemeModule {\n constructor(){\n window.Lightcord.BetterDiscord.ThemeModule = this\n }\n get folder() {return ContentManager.themesFolder;}\n}\n\nThemeModule.prototype.loadThemes = async function () {\n this.loadThemeData();\n bdthemeErrors.splice(0, 0, ...(await ContentManager.loadThemes()));\n const themes = Object.keys(bdthemes);\n\n for (let i = 0; i < themes.length; i++) {\n const theme = bdthemes[themes[i]];\n if (!themeCookie[theme.name]) themeCookie[theme.name] = false;\n if (themeCookie[theme.name]) DOM.addStyle(DOM.escapeID(theme.id), unescape(theme.css));\n\n await new Promise((resolve) => setTimeout(resolve, 10))\n }\n for (const theme in themeCookie) {\n if (!bdthemes[theme]) delete themeCookie[theme];\n }\n this.saveThemeData();\n // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"theme\");\n};\n\nThemeModule.prototype.enableTheme = function(name, reload = false) {\n themeCookie[name] = true;\n this.saveThemeData();\n const theme = bdthemes[name];\n DOM.addStyle(DOM.escapeID(theme.id), unescape(theme.css));\n bdEvents.dispatch(\"theme-enabled\")\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${theme.name} v${theme.version} has been applied.`);\n};\n\nThemeModule.prototype.enable = function (name, reload = false) {\n return this.enableTheme(name, reload);\n};\n\nThemeModule.prototype.disableTheme = function(name, reload = false) {\n themeCookie[name] = false;\n this.saveThemeData();\n const theme = bdthemes[name];\n DOM.removeStyle(DOM.escapeID(theme.id));\n bdEvents.dispatch(\"theme-disabled\")\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${theme.name} v${theme.version} has been disabled.`);\n};\n\nThemeModule.prototype.disable = function (name, reload = false) {\n return this.disableTheme(name, reload);\n};\n\nThemeModule.prototype.toggleTheme = function(theme) {\n if (themeCookie[theme]) this.disableTheme(theme);\n else this.enableTheme(theme);\n};\n\nThemeModule.prototype.toggle = function (name) {\n return this.toggleTheme(name);\n};\n\nThemeModule.prototype.loadTheme = async function(filename) {\n const error = await ContentManager.loadContent(filename, \"theme\");\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${filename} could not be loaded. It may not have been loaded.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${filename} could not be loaded.`, error);\n }\n const theme = Object.values(bdthemes).find(p => p.filename == filename);\n Utils.log(\"ContentManager\", `${theme.name} v${theme.version} was loaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme.name} v${theme.version} was loaded.`, {type: \"success\"});\n BDEvents.dispatch(\"theme-loaded\", theme.name);\n};\n\nThemeModule.prototype.unloadTheme = function(filenameOrName) {\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\n if (!bdtheme) return;\n const theme = bdtheme.name;\n if (themeCookie[theme]) this.disableTheme(theme, true);\n const error = ContentManager.unloadContent(bdthemes[theme].filename, \"theme\");\n delete bdthemes[theme];\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} could not be unloaded. It may have not been loaded yet.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${theme} could not be unloaded. It may have not been loaded yet.`, error);\n }\n Utils.log(\"ContentManager\", `${theme} was unloaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} was unloaded.`, {type: \"success\"});\n BDEvents.dispatch(\"theme-unloaded\", theme);\n};\n\nThemeModule.prototype.delete = function(filenameOrName) {\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\n if (!bdtheme) return;\n this.unloadTheme(bdtheme.filename);\n const fullPath = require(\"path\").resolve(ContentManager.themesFolder, bdtheme.filename);\n require(\"fs\").unlinkSync(fullPath);\n};\n\nThemeModule.prototype.reloadTheme = async function(filenameOrName) {\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\n if (!bdtheme) return this.loadTheme(filenameOrName);\n const theme = bdtheme.name;\n const error = await ContentManager.reloadContent(bdthemes[theme].filename, \"theme\");\n if (themeCookie[theme]) this.disableTheme(theme, true), this.enableTheme(theme, true);\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} could not be reloaded.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${theme} could not be reloaded.`, error);\n }\n Utils.log(\"ContentManager\", `${theme} v${bdthemes[theme].version} was reloaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} v${bdthemes[theme].version} was reloaded.`, {type: \"success\"});\n BDEvents.dispatch(\"theme-reloaded\", theme);\n};\n\nThemeModule.prototype.reload = function(name) {\n return this.reloadTheme(name);\n};\n\nThemeModule.prototype.edit = function(filenameOrName) {\n const bdplugin = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\n if (!bdplugin) return;\n const fullPath = require(\"path\").resolve(ContentManager.themesFolder, bdplugin.filename);\n require(\"electron\").shell.openItem(`${fullPath}`);\n};\n\nThemeModule.prototype.updateThemeList = function() {\n const results = ContentManager.loadNewContent(\"theme\");\n for (const filename of results.added) this.loadTheme(filename);\n for (const name of results.removed) this.unloadTheme(name);\n};\n\nThemeModule.prototype.loadThemeData = function() {\n const saved = DataStore.getSettingGroup(\"themes\");\n if (saved) {\n Object.assign(themeCookie, saved);\n }\n};\n\nThemeModule.prototype.saveThemeData = function () {\n DataStore.setSettingGroup(\"themes\", themeCookie);\n};\n\nexport default new ThemeModule();","import {settings} from \"../0globals\";\nimport themeModule from \"./themeModule\";\n\nexport default new class V2 {\n\n constructor() {\n this.editorDetached = false;\n this.WebpackModules = (() => {\n const req = webpackJsonp.push([[], {__extra_id__: (module, exports, req) => module.exports = req}, [[\"__extra_id__\"]]]);\n delete req.m.__extra_id__;\n delete req.c.__extra_id__;\n\n const shouldProtect = theModule => {\n if (theModule.remove && theModule.set && theModule.clear && theModule.get && !theModule.sort) return true;\n if (theModule.getToken || theModule.getEmail || theModule.showToken) return true;\n return false;\n };\n\n const protect = (theModule, isDefault) => {\n let mod = !isDefault ? theModule.default : theModule\n if(!mod)return theModule\n if (mod.remove && mod.set && mod.clear && mod.get && !mod.sort) return null;\n if (!mod.getToken && !mod.getEmail && !mod.showToken)return theModule\n\n const proxy = new Proxy(mod, {\n getOwnPropertyDescriptor: function(obj, prop) {\n if (prop === \"getToken\" || prop === \"getEmail\" || prop === \"showToken\") return undefined;\n return Object.getOwnPropertyDescriptor(obj, prop);\n },\n get: function(obj, func) {\n if (func == \"getToken\" && obj.getToken) return () => \"mfa.XCnbKzo0CLIqdJzBnL0D8PfDruqkJNHjwHXtr39UU3F8hHx43jojISyi5jdjO52e9_e9MjmafZFFpc-seOMa\";\n if (func == \"getEmail\" && obj.getEmail) return () => \"puppet11112@gmail.com\";\n if (func == \"showToken\" && obj.showToken) return () => true;\n if (func == \"__proto__\" && obj.__proto__) return proxy;\n \n return obj[func];\n }\n });\n\n if(!isDefault){\n return Object.assign({}, theModule, {default: proxy})\n }\n\n return proxy;\n };\n\n const find = (filter) => {\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) return protect(m.default, true);\n if (m && filter(m))\treturn protect(m, false);\n }\n }\n // console.warn(\"Cannot find loaded module in cache\");\n return null;\n };\n\n const findAll = (filter) => {\n const modules = [];\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) modules.push(protect(m.default, true));\n else if (m && filter(m)) modules.push(protect(m, false));\n }\n }\n return modules;\n };\n\n const findByUniqueProperties = (propNames) => find(module => propNames.every(prop => module[prop] !== undefined));\n const findByPrototypes = (protoNames) => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\n const findByDisplayName = (displayName) => find(module => module.displayName === displayName);\n\n return {find, findAll, findByUniqueProperties, findByPrototypes, findByDisplayName};\n })();\n\n this.internal = {\n react: this.WebpackModules.findByUniqueProperties([\"Component\", \"PureComponent\", \"Children\", \"createElement\", \"cloneElement\"]),\n reactDom: this.WebpackModules.findByUniqueProperties([\"findDOMNode\"])\n };\n this.getInternalInstance = e => e[Object.keys(e).find(k => k.startsWith(\"__reactInternalInstance\"))];\n window.Lightcord.BetterDiscord.V2 = this\n }\n\n initialize() {\n\n }\n\n joinBD1() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"0Tmfo5ZbORCRqbAd\");}\n leaveBD1() {this.GuildActions.leaveGuild(\"86004744966914048\");}\n\n joinBD2() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"2HScm8j\");}\n leaveBD2() {this.GuildActions.leaveGuild(\"280806472928198656\");}\n\n joinLC() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"7eFff2A\");}\n leaveLC() {this.GuildActions.leaveGuild(\"705908350218666117\");}\n\n /**\n * @type {typeof React}\n */\n get react() {return this.internal.react;}\n /**\n * @type {typeof React}\n */\n get React() {return this.internal.react;}\n /**\n * @type {typeof import(\"react-dom\")}\n */\n get reactDom() {return this.internal.reactDom;}\n /**\n * @type {typeof import(\"react-dom\")}\n */\n get ReactDom() {return this.internal.reactDom;}\n /**\n * @type {typeof React.Component}\n */\n get reactComponent() {return this.internal.react.Component;}\n /**\n * @type {typeof React.Component}\n */\n get ReactComponent() {return this.internal.react.Component;}\n\n get anchorClasses() {return this.WebpackModules.findByUniqueProperties([\"anchorUnderlineOnHover\"]) || {anchor: \"anchor-3Z-8Bb\", anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"};}\n get slateEditorClasses() {return this.WebpackModules.findByUniqueProperties([\"slateTextArea\"]);}\n get messageClasses() {return this.WebpackModules.findByUniqueProperties([\"message\", \"containerCozy\"]);}\n get guildClasses() {\n\t\tconst guildsWrapper = BDModules.get(e => e.wrapper && e.unreadMentionsBar)[0];\n const guilds = BDModules.get(e => e.guildsError && e.selected)[0]\n const pill = BDModules.get(e => e.blobContainer)[0]\n return Object.assign({}, guildsWrapper, guilds, pill);\n\t}\n\n get MessageContentComponent() {return this.WebpackModules.find(m => m.defaultProps && m.defaultProps.hasOwnProperty(\"disableButtons\"));}\n get MessageComponent() {return this.WebpackModules.find(m => m.default && m.default.displayName && m.default.displayName == \"Message\");}\n get TimeFormatter() {return this.WebpackModules.findByUniqueProperties([\"dateFormat\"]);}\n get TooltipWrapper() {return this.WebpackModules.findByDisplayName(\"Tooltip\");}\n get NativeModule() {return this.WebpackModules.findByUniqueProperties([\"setBadge\"]);}\n get InviteActions() {return this.WebpackModules.findByUniqueProperties([\"acceptInvite\"]);}\n get GuildActions() {return this.WebpackModules.findByUniqueProperties([\"leaveGuild\"]);}\n get Tooltips() {return this.WebpackModules.find(m => m.hide && m.show && !m.search && !m.submit && !m.search && !m.activateRagingDemon && !m.dismiss);}\n get KeyGenerator() {return this.WebpackModules.find(m => m.toString && /\"binary\"/.test(m.toString()));}\n get LayerStack() {return this.WebpackModules.findByUniqueProperties([\"popLayer\"]);}\n get UserStore() {return this.WebpackModules.findByUniqueProperties([\"getCurrentUser\"]);}\n get ChannelStore() {return this.WebpackModules.findByUniqueProperties([\"getChannel\"]);}\n get ChannelActions() {return this.WebpackModules.findByUniqueProperties([\"openPrivateChannel\"]);}\n get PrivateChannelActions() {return this.WebpackModules.findByUniqueProperties([\"selectPrivateChannel\"]);}\n\n openDM(userId) {\n const selfId = this.UserStore.getCurrentUser().id;\n if (selfId == userId) return;\n const privateChannelId = this.ChannelStore.getDMFromUserId(userId);\n if (privateChannelId) return this.PrivateChannelActions.selectPrivateChannel(privateChannelId);\n this.ChannelActions.openPrivateChannel(selfId, userId);\n }\n\n parseSettings(cat) {\n return Object.keys(settings).reduce((arr, key) => {\n const setting = settings[key];\n if (setting.cat === cat && setting.implemented && !setting.hidden) {\n setting.text = key;\n arr.push(setting);\n } return arr;\n }, []);\n }\n\n};","import {bbdVersion} from \"../0globals\";\nimport WebpackModules from \"./webpackModules\";\nimport BDV2 from \"./v2\";\nimport DOM from \"./domtools\";\nexport default class Utils {\n /** Document/window width */\n static get screenWidth() { return Math.max(document.documentElement.clientWidth, window.innerWidth || 0); }\n /** Document/window height */\n static get screenHeight() { return Math.max(document.documentElement.clientHeight, window.innerHeight || 0); }\n\n static get WindowConfigFile() {\n return this._windowConfigFile = null;\n }\n\n static getAllWindowPreferences() {\n return {\n transparent: true,\n frame: false\n };\n }\n \n static getWindowPreference(key) {\n if (key === \"transparent\") return true;\n if (key === \"frame\") return false;\n return null;\n }\n \n static setWindowPreference(key, value) {\n if (key === \"transparent\") return true;\n if (key === \"frame\") return false;\n return null;\n }\n\n static stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n }\n\n static getTextArea() {\n return DOM.query(\".\"+removeDa(BDModules.get(e => e.channelTextArea && e.titleWrapper)[0].channelTextArea)+\" textarea\");\n }\n\n static insertText(textarea, text) {\n textarea.focus();\n textarea.selectionStart = 0;\n textarea.selectionEnd = textarea.value.length;\n document.execCommand(\"insertText\", false, text);\n }\n\n static escapeID(id) {\n return id.replace(/^[^a-z]+|[^\\w-]+/gi, \"-\");\n }\n\n static log(moduleName, message) {\n console.log(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: #3a71c1; font-weight: 700;\", \"color: #3a71c1;\", \"\");\n }\n\n static warn(moduleName, message) {\n console.warn(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: #E8A400; font-weight: 700;\", \"color: #E8A400;\", \"\");\n }\n\n static err(moduleName, message, error) {\n console.log(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: red; font-weight: 700;\", \"color: red;\", \"\");\n if (error) {\n console.groupCollapsed(\"%cError: \" + error.message, \"color: red;\");\n console.error(error.stack);\n console.groupEnd();\n }\n }\n\n /**\n * Format strings with placeholders (`{{placeholder}}`) into full strings.\n * Quick example: `PluginUtilities.formatString(\"Hello, {{user}}\", {user: \"Zerebos\"})`\n * would return \"Hello, Zerebos\".\n * @param {string} string - string to format\n * @param {object} values - object literal of placeholders to replacements\n * @returns {string} the properly formatted string\n */\n static formatString(string, values) {\n for (const val in values) {\n let replacement = values[val];\n if (Array.isArray(replacement)) replacement = JSON.stringify(replacement);\n if (typeof(replacement) === \"object\" && replacement !== null) replacement = replacement.toString();\n string = string.replace(new RegExp(`{{${val}}}`, \"g\"), replacement);\n }\n return string;\n }\n\n static escape(s) {\n return s.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n }\n\n static testJSON(data) {\n try {\n return JSON.parse(data);\n }\n catch (err) {\n return false;\n }\n }\n\n static isEmpty(obj) {\n if (obj == null || obj == undefined || obj == \"\") return true;\n if (typeof(obj) !== \"object\") return false;\n if (Array.isArray(obj)) return obj.length == 0;\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) return false;\n }\n return true;\n }\n\n static suppressErrors(method, message) {\n return (...params) => {\n try { return method(...params);\t}\n catch (e) { this.err(\"SuppressedError\", \"Error occurred in \" + message, e); }\n };\n }\n\n static monkeyPatch(what, methodName, options) {\n const {before, after, instead, once = false, silent = false, force = false} = options;\n const displayName = options.displayName || what.displayName || what[methodName].displayName || what.name || what.constructor.displayName || what.constructor.name;\n if (!silent) console.log(\"patch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n if (!what[methodName]) {\n if (force) what[methodName] = function() {};\n else return console.error(methodName, \"does not exist for\", displayName); // eslint-disable-line no-console\n }\n const origMethod = what[methodName];\n let canceled = false\n const cancel = () => {\n if (!silent) console.log(\"unpatch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n //what[methodName] = origMethod;\n canceled = true // this allow to monkeypatch more than one time.\n };\n what[methodName] = function() {\n if(canceled){\n return origMethod.call(this, ...arguments)\n }\n const data = {\n thisObject: this,\n methodArguments: arguments,\n cancelPatch: cancel,\n originalMethod: origMethod,\n callOriginalMethod: () => data.returnValue = data.originalMethod.apply(data.thisObject, data.methodArguments)\n };\n if (instead) {\n const tempRet = Utils.suppressErrors(instead, \"`instead` callback of \" + what[methodName].displayName)(data);\n if (tempRet !== undefined) data.returnValue = tempRet;\n }\n else {\n if (before) Utils.suppressErrors(before, \"`before` callback of \" + what[methodName].displayName)(data);\n data.callOriginalMethod();\n if (after) Utils.suppressErrors(after, \"`after` callback of \" + what[methodName].displayName)(data);\n }\n if (once) cancel();\n return data.returnValue;\n };\n Object.assign(what[methodName], origMethod);\n what[methodName].__monkeyPatched = true;\n what[methodName].displayName = displayName;\n if (!what[methodName].__originalMethod) {\n what[methodName].__originalMethod = origMethod;\n what[methodName].toString = function() {return origMethod.toString();};\n }\n return cancel;\n }\n\n static onRemoved(node, callback) {\n const observer = new MutationObserver((mutations) => {\n for (let m = 0; m < mutations.length; m++) {\n const mutation = mutations[m];\n const nodes = Array.from(mutation.removedNodes);\n const directMatch = nodes.indexOf(node) > -1;\n const parentMatch = nodes.some(parent => parent.contains(node));\n if (directMatch || parentMatch) {\n observer.disconnect();\n callback();\n }\n }\n });\n\n observer.observe(document.body, {subtree: true, childList: true});\n }\n\n static getNestedProp(obj, path) {\n return path.split(/\\s?\\.\\s?/).reduce(function(obj, prop) {\n return obj && obj[prop];\n }, obj);\n }\n\n /**\n * This shows a toast similar to android towards the bottom of the screen.\n *\n * @param {string} content The string to show in the toast.\n * @param {object} options Options object. Optional parameter.\n * @param {string} options.type Changes the type of the toast stylistically and semantically. Choices: \"\", \"info\", \"success\", \"danger\"/\"error\", \"warning\"/\"warn\". Default: \"\"\n * @param {boolean} options.icon Determines whether the icon should show corresponding to the type. A toast without type will always have no icon. Default: true\n * @param {number} options.timeout Adjusts the time (in ms) the toast should be shown for before disappearing automatically. Default: 3000\n */\n static showToast(content, options = {}) {\n if (!document.querySelector(\".bd-toasts\")) {\n const container = document.querySelector(\".\"+removeDa(BDModules.get(e => e.sidebar && e.hasNotice)[0].sidebar)+\" + div\") || null;\n const form = container ? container.querySelector(\"form\") : null;\n const bottom = form ? form.offsetHeight : 80;\n const toastWrapper = document.createElement(\"div\");\n toastWrapper.classList.add(\"bd-toasts\");\n toastWrapper.style.setProperty(\"bottom\", bottom+\"px\");\n document.querySelector(\"#app-mount\").appendChild(toastWrapper);\n }\n const toastWrapper = document.querySelector(\".bd-toasts\")\n const {type = \"\", icon = true, timeout = 3000} = options;\n const toastElem = document.createElement(\"div\");\n toastElem.classList.add(\"bd-toast\");\n if (type) toastElem.classList.add(\"toast-\" + type);\n if (type && icon) toastElem.classList.add(\"icon\");\n toastElem.innerText = content;\n toastWrapper.appendChild(toastElem);\n toastWrapper.style.setProperty(\"left\", `calc(50% - ${toastWrapper.offsetWidth / 2}px)`);\n setTimeout(() => {\n toastElem.classList.add(\"closing\");\n setTimeout(() => {\n toastElem.remove();\n if (!document.querySelectorAll(\".bd-toasts .bd-toast\").length) document.querySelector(\".bd-toasts\").remove();\n }, 300);\n }, timeout);\n }\n\n static alert(title, content) {\n let modalModule = BDModules.get(e => e.modal && e.inner && !e.hideOnFullscreen)[0]\n let headerModule = BDModules.get(e => e.header && e.responsiveWidthMobile && e.hideOnFullscreen)[0]\n let footer2Module = BDModules.get(e => e.header && e.responsiveWidthMobile && e.focusLock)[0]\n const modal = DOM.createElement(`<div class=\"bd-modal-wrapper theme-dark\">\n <div class=\"bd-backdrop ${BDModules.get(e => e.backdrop && e.backdropWithLayer)[0].backdrop}\"></div>\n <div class=\"bd-modal ${modalModule.modal}\">\n <div class=\"bd-modal-inner ${modalModule.inner}\">\n <div class=\"header ${headerModule.header}\">\n <div class=\"title\">${title}</div>\n </div>\n <div class=\"bd-modal-body\">\n <div class=\"scroller-wrap fade\">\n <div class=\"scroller\">\n ${content}\n </div>\n </div>\n </div>\n <div class=\"footer ${headerModule.footer} ${footer2Module.footer}\">\n <button type=\"button\">Okay</button>\n </div>\n </div>\n </div>\n </div>`);\n modal.querySelector(\".footer button\").addEventListener(\"click\", () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { \n modal.remove(); \n closingListeners.forEach((listener) => {\n try{\n listener()\n }catch(e){\n console.error(e)\n }\n })\n }, 300);\n });\n modal.querySelector(\".bd-backdrop\").addEventListener(\"click\", () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { \n modal.remove(); \n closingListeners.forEach((listener) => {\n try{\n listener()\n }catch(e){\n console.error(e)\n }\n })\n }, 300);\n });\n DOM.query(\"#app-mount\").append(modal);\n const closingListeners = []\n return {\n close: () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { \n modal.remove(); \n closingListeners.forEach((listener) => {\n try{\n listener()\n }catch(e){\n console.error(e)\n }\n })\n }, 300);\n },\n onClose: (listener) => {\n closingListeners.push(listener)\n }\n }\n }\n\n static showContentErrors({plugins: pluginErrors = [], themes: themeErrors = []}) {\n if (!pluginErrors || !themeErrors) return;\n if (!pluginErrors.length && !themeErrors.length) return;\n let modalModule = BDModules.get(e => e.modal && e.inner && !e.hideOnFullscreen)[0]\n let headerModule = BDModules.get(e => e.header && e.responsiveWidthMobile && e.hideOnFullscreen)[0]\n let footer2Module = BDModules.get(e => e.header && e.responsiveWidthMobile && e.focusLock)[0]\n const modal = DOM.createElement(`<div class=\"bd-modal-wrapper theme-dark\">\n <div class=\"bd-backdrop ${BDModules.get(e => e.backdrop && e.backdropWithLayer)[0].backdrop}\"></div>\n <div class=\"bd-modal bd-content-modal ${modalModule.modal}\">\n <div class=\"bd-modal-inner ${modalModule.inner}\">\n <div class=\"header ${headerModule.header}\"><div class=\"title\">Content Errors</div></div>\n <div class=\"bd-modal-body\">\n <div class=\"tab-bar-container\">\n <div class=\"tab-bar TOP\">\n <div class=\"tab-bar-item\">Plugins</div>\n <div class=\"tab-bar-item\">Themes</div>\n </div>\n </div>\n <div class=\"table-header\">\n <div class=\"table-column column-name\">Name</div>\n <div class=\"table-column column-message\">Message</div>\n <div class=\"table-column column-error\">Error</div>\n </div>\n <div class=\"scroller-wrap fade\">\n <div class=\"scroller\">\n \n </div>\n </div>\n </div>\n <div class=\"footer ${headerModule.footer} ${footer2Module.footer}\">\n <button type=\"button\">Okay</button>\n </div>\n </div>\n </div>\n </div>`);\n \n function generateTab(errors) {\n const container = DOM.createElement(`<div class=\"errors\">`);\n for (const err of errors) {\n const error = DOM.createElement(`<div class=\"error\">\n <div class=\"table-column column-name\">${err.name ? err.name : err.file}</div>\n <div class=\"table-column column-message\">${err.message}</div>\n <div class=\"table-column column-error\"><a class=\"error-link\" href=\"\">${err.error ? err.error.message : \"\"}</a></div>\n </div>`);\n container.append(error);\n if (err.error) {\n error.querySelectorAll(\"a\").forEach(el => el.addEventListener(\"click\", (e) => {\n e.preventDefault();\n Utils.err(\"ContentManager\", `Error details for ${err.name ? err.name : err.file}.`, err.error);\n }));\n }\n }\n return container;\n }\n \n const tabs = [generateTab(pluginErrors), generateTab(themeErrors)];\n \n modal.querySelectorAll(\".tab-bar-item\").forEach(el => el.addEventListener(\"click\", (e) => {\n e.preventDefault();\n const selected = modal.querySelector(\".tab-bar-item.selected\");\n if (selected) DOM.removeClass(selected, \"selected\");\n DOM.addClass(e.target, \"selected\");\n const scroller = modal.querySelector(\".scroller\");\n scroller.innerHTML = \"\";\n scroller.append(tabs[DOM.index(e.target)]);\n }));\n \n modal.querySelector(\".footer button\").addEventListener(\"click\", () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { modal.remove(); }, 300);\n });\n modal.querySelector(\".bd-backdrop\").addEventListener(\"click\", () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { modal.remove(); }, 300);\n });\n DOM.query(\"#app-mount\").append(modal);\n if (pluginErrors.length) modal.querySelector(\".tab-bar-item\").click();\n else modal.querySelectorAll(\".tab-bar-item\")[1].click();\n }\n\n static showChangelogModal(options = {}) {\n const ModalStack = WebpackModules.findByProps(\"push\", \"update\", \"pop\", \"popWithKey\");\n const ChangelogClasses = WebpackModules.findByProps(\"fixed\", \"improved\");\n const TextElement = WebpackModules.findByDisplayName(\"Text\");\n const FlexChild = WebpackModules.findByProps(\"Child\");\n const Titles = WebpackModules.findByProps(\"Tags\", \"default\");\n const Changelog = WebpackModules.find(m => m.defaultProps && m.defaultProps.selectable == false);\n const MarkdownParser = WebpackModules.findByProps(\"defaultRules\", \"parse\");\n if (!Changelog || !ModalStack || !ChangelogClasses || !TextElement || !FlexChild || !Titles || !MarkdownParser) return;\n \n const {\n image = \"https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5\", \n description = \"\", \n changes = [], \n title = \"BandagedBD\", \n subtitle = `v${bbdVersion}`, \n footer\n } = options;\n const ce = BDV2.React.createElement;\n const changelogItems = [ce(\"img\", {src: image})];\n if (description) changelogItems.push(ce(\"p\", null, MarkdownParser.parse(description)));\n for (let c = 0; c < changes.length; c++) {\n const entry = changes[c];\n const type = ChangelogClasses[entry.type] ? ChangelogClasses[entry.type] : ChangelogClasses.added;\n const margin = c == 0 ? ChangelogClasses.marginTop : \"\";\n changelogItems.push(ce(\"h1\", {className: `${type} ${margin}`,}, entry.title));\n const list = ce(\"ul\", null, entry.items.map(i => ce(\"li\", null, MarkdownParser.parse(i))));\n changelogItems.push(list);\n }\n const renderHeader = function() {\n return ce(FlexChild.Child, {grow: 1, shrink: 1},\n ce(Titles.default, {tag: Titles.Tags.H4}, title),\n ce(TextElement,{size: TextElement.Sizes.SMALL, color: TextElement.Colors.STANDARD, className: ChangelogClasses.date}, subtitle)\n );\n };\n \n const renderFooter = () => {\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n const AnchorClasses = WebpackModules.findByProps(\"anchorUnderlineOnHover\") || {anchor: \"anchor-3Z-8Bb\", anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"};\n const joinSupportServer = (click) => {\n click.preventDefault();\n click.stopPropagation();\n ModalStack.pop();\n BDV2.joinBD2();\n };\n const supportLink = Anchor ? ce(Anchor, {onClick: joinSupportServer}, \"Join our Discord Server.\") : ce(\"a\", {className: `${AnchorClasses.anchor} ${AnchorClasses.anchorUnderlineOnHover}`, onClick: joinSupportServer}, \"Join our Discord Server.\");\n const defaultFooter = ce(TextElement,{size: TextElement.Sizes.SMALL, color: TextElement.Colors.STANDARD}, \"Need support? \", supportLink);\n return ce(FlexChild.Child, {grow: 1, shrink: 1}, footer ? footer : defaultFooter);\n };\n\n return ModalStack.push(function(props) {\n return ce(Changelog, Object.assign({\n className: ChangelogClasses.container,\n selectable: true,\n onScroll: _ => _,\n onClose: _ => _,\n renderHeader: renderHeader,\n renderFooter: renderFooter,\n children: changelogItems\n }, props));\n });\n }\n\n /**\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\n * @param {string} title - title of the modal\n * @param {(string|ReactElement|Array<string|ReactElement>)} children - a single or mixed array of react elements and strings. Every string is wrapped in Discord's `Markdown` component so strings will show and render properly.\n * @param {object} [options] - options to modify the modal\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\n * @param {string} [options.key] - key used to identify the modal. If not provided, one is generated and returned\n * @returns {string} - the key used for this modal\n */\n static showConfirmationModal(title, content, options = {}) {\n const ModalActions = WebpackModules.findByProps(\"openModal\", \"updateModal\");\n const Markdown = WebpackModules.findByDisplayName(\"Markdown\");\n const ConfirmationModal = WebpackModules.findByDisplayName(\"ConfirmModal\");\n if (!ModalActions || !ConfirmationModal || !Markdown) return Utils.alert(title, content);\n\n const emptyFunction = () => {};\n const {onConfirm = emptyFunction, onCancel = emptyFunction, confirmText = \"Okay\", cancelText = \"Cancel\", danger = false, key = undefined} = options;\n\n if (!Array.isArray(content)) content = [content];\n content = content.map(c => typeof(c) === \"string\" ? BDV2.React.createElement(Markdown, null, c) : c);\n return ModalActions.openModal(props => {\n return BDV2.React.createElement(ConfirmationModal, Object.assign({\n header: title,\n red: danger,\n confirmText: confirmText,\n cancelText: cancelText,\n onConfirm: onConfirm,\n onCancel: onCancel\n }, props), content);\n }, {modalKey: key});\n }\n\n static get removeDa(){\n return removeDa\n }\n}\n\nfunction removeDa(className){\n if(!className)return className\n return className.split(\" \").filter(e => !e.startsWith(\"da-\")).join(\" \")\n}\n\nUtils.showToast = Utils.suppressErrors(Utils.showToast, \"Could not show toast.\");\n\nwindow.Lightcord.BetterDiscord.Utils = Utils","export default class V2_SettingsPanel_Sidebar {\n\n constructor() {\n this.panels = {}\n }\n\n register(panel, component){\n this.panels[panel] = component\n }\n\n getComponent(panel, sidebar){\n return this.panels[panel](sidebar)\n }\n\n get items() {\n return [{\n text: \"BetterDiscord Settings\", \n id: \"core\"\n }, {\n text: \"Plugins\", \n id: \"plugins\"\n }, {\n text: \"Themes\", \n id: \"themes\"\n }, {\n text: \"Custom CSS\", \n id: \"customcss\"\n }];\n }\n\n get LCitems(){\n let items = [\n {\n text: \"Lightcord Settings\",\n id: \"lightcord\"\n }, {\n text: \"RichPresence\", \n id: \"status\"\n }, {\n text: \"Account Info\",\n id: \"accountinfo\"\n }\n ]\n return items\n }\n\n get LCDevItems(){\n let items = []\n if(!window.Lightcord.Settings.devMode)return items\n items.push(...[\n {\n section: \"DIVIDER\"\n },\n {\n section: \"HEADER\",\n label: \"Lightcord Api\"\n },\n {\n text: \"Components Preview\",\n id: \"lcapipreview\"\n }\n ])\n return items\n }\n\n render(sidebar) {\n return [\n {\n section: \"HEADER\",\n label: \"Lightcord\"\n },\n ...this.LCitems.map(e => {\n return {\n section: e.id,\n label: e.text,\n element: this.getComponent(e.id, sidebar)\n }\n }),\n ...this.LCDevItems.map(e => {\n if(e.section)return e\n return {\n section: e.id,\n label: e.text,\n element: this.getComponent(e.id, sidebar)\n }\n }),\n {\n section: \"DIVIDER\"\n },\n {\n section: \"CUSTOM\",\n element: this.getComponent(\"BDChangelogTitle\")\n },\n ...this.items.map(e => {\n return {\n section: e.id,\n label: e.text,\n element: this.getComponent(e.id, sidebar)\n }\n }),\n {\n section: \"DIVIDER\"\n }\n ]\n }\n}\n\n/**\n * No need to export settingsPanelSidebar on window\n */","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"./v2\";\nimport Utils from \"./utils\";\n\nexport default new class ColoredText {\n injectColoredText() {\n if (this.cancelColoredText) return;\n if (!BDV2.MessageComponent) return;\n\n this.cancelColoredText = Utils.monkeyPatch(BDV2.MessageComponent, \"default\", {before: (data) => {\n const props = data.methodArguments[0];\n if (!props || !props.childrenMessageContent) return;\n const messageContent = props.childrenMessageContent;\n\n if (!messageContent.type || !messageContent.type.type || messageContent.type.type.displayName != \"MessageContent\") return;\n const originalType = messageContent.type.type;\n if (originalType.__originalMethod) return; // Don't patch again\n messageContent.type.type = function(props) {\n const returnValue = originalType(props);\n const roleColor = settingsCookie[\"bda-gs-7\"] ? props.message.colorString || \"\" : \"\";\n returnValue.props.style = {color: roleColor};\n return returnValue;\n };\n\n messageContent.type.type.__originalMethod = originalType;\n Object.assign(messageContent.type.type, originalType);\n }});\n }\n\n removeColoredText() {\n let classNameMarkup = BDModules.get(e => e.markup)[0].markup\n document.querySelectorAll(\".\"+classNameMarkup.split(\" \")[0]).forEach(elem => {\n elem.style.setProperty(\"color\", \"\");\n });\n }\n};","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"./v2\";\nimport Utils from \"./utils\";\n\nexport default new class TFHour {\n inject24Hour() {\n if (this.cancel24Hour) return;\n\n const twelveHour = new RegExp(`([0-9]{1,2}):([0-9]{1,2})\\\\s(AM|PM)`);\n const convert = (data) => {\n if (!settingsCookie[\"bda-gs-6\"]) return;\n const matched = data.returnValue.match(twelveHour);\n if (!matched || matched.length !== 4) return;\n if (matched[3] === \"AM\") return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"00\" : matched[1].padStart(2, \"0\")}:${matched[2]}`);\n return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"12\" : parseInt(matched[1]) + 12}:${matched[2]}`);\n };\n\n const cancelCozy = Utils.monkeyPatch(BDV2.TimeFormatter, \"calendarFormat\", {after: convert}); // Called in Cozy mode\n const cancelCompact = Utils.monkeyPatch(BDV2.TimeFormatter, \"dateFormat\", {after: convert}); // Called in Compact mode\n this.cancel24Hour = () => {cancelCozy(); cancelCompact();}; // Cancel both\n }\n\n remove24Hour() {\n if (this.cancel24Hour) this.cancel24Hour();\n }\n};","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_SettingsTitle extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n//h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi da-h2 da-title da-size16 da-height20 da-weightSemiBold defaultColor-1_ajX0 da-defaultColor marginTop60-3PGbtK da-marginTop60 marginBottom20-32qID7 da-marginBottom20\n render() {\n return BDV2.react.createElement(\n \"h2\",\n {className: \"ui-form-title h2 margin-reset margin-bottom-20\"},\n this.props.text\n );\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_TabBarSeparator extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return BDV2.react.createElement(\"div\", {className: \"ui-tab-bar-separator margin-top-8 margin-bottom-8\"});\n }\n}","import BDV2 from \"../../modules/v2\";\n\nexport default class V2C_ServerCard extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n if (!this.props.server.iconUrl) this.props.server.iconUrl = this.props.fallback;\n this.state = {\n imageError: false,\n joined: this.props.guildList.includes(this.props.server.identifier)\n };\n }\n\n render() {\n const {server} = this.props;\n let cardModule = BDModules.get(e => e.card && e.cardPrimary)[0]\n let flexModule = BDModules.get(e => e.flexChild && e._horizontalReverse)[0]\n let wrapModule = BDModules.get(e => e.noWrap && !e.streamerModeEnabled)[0]\n return BDV2.react.createElement(\n \"div\", // cardPrimary-1Hv-to\n {className: `${cardModule.card} ${cardModule.cardPrimary} ${BDModules.get(e => e.marginBottom8)[0].marginBottom8} bd-server-card${server.pinned ? \" bd-server-card-pinned\" : \"\"}`},\n // BDV2.react.createElement(\n // \"div\",\n // { className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY flex-1O1GKY directionRow-3v3tfG justifyStart-2yIZo0 alignStretch-1hwxMa noWrap-3jynv6\" },\n BDV2.react.createElement(\"img\", {ref: \"img\", className: \"bd-server-image\", src: server.iconUrl, onError: this.handleError.bind(this), draggable: false}),\n BDV2.react.createElement(\n \"div\",\n {className: flexModule.flexChild+\" bd-server-content\"},\n BDV2.react.createElement(\n \"div\",\n {className: flexModule.horizontal+\" \"+wrapModule.noWrap+\" bd-server-header\"},\n BDV2.react.createElement(\n \"h5\",\n {className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-name\"},\n server.name\n ),\n BDV2.react.createElement(\n \"h5\",\n {className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-member-count\"},\n server.members,\n \" Members\"\n )\n ),\n BDV2.react.createElement(\n \"div\",\n {className: flexModule.horizontal+\" \"+wrapModule.noWrap},\n BDV2.react.createElement(\n \"div\",\n {className: \"scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y bd-server-description-container\"},\n BDV2.react.createElement(\n \"div\",\n {className: \"scroller-2FKFPG scroller bd-server-description\"},\n server.description\n )\n )\n ),\n BDV2.react.createElement(\n \"div\",\n {className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6 bd-server-footer\"},\n BDV2.react.createElement(\n \"div\",\n {className: \"flexChild-faoVW3 bd-server-tags\", style: {flex: \"1 1 auto\"}},\n server.categories.join(\", \")\n ),\n this.state.joined && BDV2.react.createElement(\n \"button\",\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN colorGreen-29iAKY\", style: {minHeight: \"12px\", marginTop: \"4px\", backgroundColor: \"#3ac15c\"}},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n \"Joined\"\n )\n ),\n server.error && BDV2.react.createElement(\n \"button\",\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN disabled-9aF2ug\", style: {minHeight: \"12px\", marginTop: \"4px\", backgroundColor: \"#c13a3a\"}},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n \"Error\"\n )\n ),\n !server.error && !this.state.joined && BDV2.react.createElement(\n \"button\",\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN\", style: {minHeight: \"12px\", marginTop: \"4px\"}, onClick: () => {this.join();}},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n \"Join\"\n )\n )\n )\n )\n // )\n );\n }\n\n handleError() {\n this.props.server.iconUrl = this.props.fallback;\n this.setState({imageError: true});\n }\n\n join() {\n this.props.join(this);\n //this.setState({joined: true});\n }\n}","import BDV2 from \"./v2\"\nconst {useState} = BDV2.react\n\n\nexport function useForceUpdate(){\n return useState()[1];\n}","import BDV2 from \"../../modules/v2\";\n\nimport SettingsTitle from \"../settingsTitle\";\nimport TabBarSeparator from \"../tabBarSeparator\";\n\nimport ServerCard from \"./serverCard\";\nimport { useForceUpdate } from \"../../modules/hooks\";\n\nlet SettingsView\nexport default class V2C_PublicServers extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n this.setInitialState();\n this.close = this.close.bind(this);\n this.changeCategory = this.changeCategory.bind(this);\n this.search = this.search.bind(this);\n this.searchKeyDown = this.searchKeyDown.bind(this);\n this.checkConnection = this.checkConnection.bind(this);\n this.join = this.join.bind(this);\n this.connect = this.connect.bind(this);\n\n this.GuildStore = BDV2.WebpackModules.findByUniqueProperties([\"getGuilds\"]);\n this.AvatarDefaults = BDV2.WebpackModules.findByUniqueProperties([\"getUserAvatarURL\", \"DEFAULT_AVATARS\"]);\n this.InviteActions = BDV2.WebpackModules.findByUniqueProperties([\"acceptInvite\"]);\n this.SortedGuildStore = BDV2.WebpackModules.findByUniqueProperties([\"getSortedGuilds\"]);\n\n this.hooks = []\n }\n\n componentDidMount() {\n this.checkConnection();\n }\n\n setInitialState() {\n this.state = {\n selectedCategory: -1,\n title: \"Loading...\",\n loading: true,\n servers: [],\n next: null,\n connection: {\n state: 0,\n user: null\n },\n section: this.categorySlugs[0],\n theme: \"dark\"\n };\n }\n\n close() {\n this.props.close()\n }\n\n search(query, clear) {\n const self = this;\n fetch(`${self.searchEndPoint}${query}${query ? \"&schema=new\" : \"?schema=new\"}`, {\n method: \"get\"\n }).then(async res => {\n if(res.status !== 200)throw await res.text()\n let data = await res.json()\n \n let servers = data.results.reduce((arr, server) => {\n server.joined = false;\n arr.push(server);\n // arr.push(<ServerCard server={server} join={self.join}/>);\n return arr;\n }, []);\n\n if (!clear) {\n servers = self.state.servers.concat(servers);\n }\n else {\n //servers.unshift(self.bdServer);\n }\n\n let end = data.size + data.from;\n data.next = `?from=${end}`;\n if (self.state.term) data.next += `&term=${self.state.term}`;\n if (self.state.selectedCategory) data.next += `&category=${self.categoryButtons[self.state.selectedCategory]}`;\n if (end >= data.total) {\n end = data.total;\n data.next = null;\n }\n\n let title = `Showing 1-${end} of ${data.total} results in ${self.categoryButtons[self.state.selectedCategory]}`;\n if (self.state.term) title += ` for ${self.state.term}`;\n\n self.setState({\n loading: false,\n title: title,\n servers: servers,\n next: data.next\n });\n }).catch((err) => {\n console.error(err)\n return self.setState({\n loading: false,\n title: \"Failed to load servers. Check console for details\"\n });\n })\n }\n\n async join(serverCard) {\n if (serverCard.props.pinned) return this.InviteActions.acceptInvite(serverCard.props.invite_code);\n\n await fetch(`${this.joinEndPoint}/${serverCard.props.server.identifier}`,{\n method: \"GET\",\n credentials: \"include\",\n mode: \"cors\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n\n serverCard.setState({joined: true});\n }\n\n connect() {\n const self = this;\n const options = self.windowOptions;\n options.x = Math.round(window.screenX + window.innerWidth / 2 - options.width / 2);\n options.y = Math.round(window.screenY + window.innerHeight / 2 - options.height / 2);\n\n const win = self.joinWindow = new (window.require(\"electron\").remote.BrowserWindow)(options);\n const url = \"https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=https://auth.discordservers.com/info\";\n win.webContents.on(\"did-navigate\", (event, url) => {\n if (url != \"https://auth.discordservers.com/info\") return;\n win.close();\n self.checkConnection();\n });\n win.loadURL(url);\n win.setMenuBarVisibility(false)\n }\n\n get windowOptions() {\n return {\n width: 500,\n height: 550,\n backgroundColor: \"#282b30\",\n show: true,\n resizable: false,\n maximizable: false,\n minimizable: false,\n alwaysOnTop: true,\n frame: true,\n center: false,\n webPreferences: {\n nodeIntegration: false\n }\n };\n }\n\n get bdServer() {\n const server = {\n name: \"BetterDiscord\",\n online: \"30000+\",\n members: \"70000+\",\n categories: [\"community\", \"programming\", \"support\"],\n description: \"Official BetterDiscord server for support etc\",\n identifier: \"86004744966914048\",\n iconUrl: \"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp\",\n nativejoin: true,\n invite_code: \"0Tmfo5ZbORCRqbAd\",\n pinned: true\n };\n const server2 = {\n name: \"Lightcord\",\n online: \"100+\",\n members: \"300+\",\n categories: [\"community\", \"programming\", \"support\"],\n description: \"Official Lightcord server for support etc\",\n identifier: \"705908350218666117\",\n iconUrl: \"https://github.com/lightcord.png\",\n nativejoin: true,\n invite_code: \"7eFff2A\",\n pinned: true\n };\n const guildList = this.SortedGuildStore.getFlattenedGuildIds();\n const defaultList = this.AvatarDefaults.DEFAULT_AVATARS;\n return [\n BDV2.react.createElement(ServerCard, {server: server2, pinned: true, join: this.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]}),\n BDV2.react.createElement(ServerCard, {server: server, pinned: true, join: this.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]})\n ]\n }\n\n get searchEndPoint() {\n return \"https://search.discordservers.com\";\n }\n\n get joinEndPoint() {\n return \"https://j.discordservers.com\";\n }\n\n get connectEndPoint() {\n return \"https://join.discordservers.com/connect\";\n }\n\n async checkConnection() {\n const self = this;\n try {\n const response = await fetch(`https://auth.discordservers.com/info`,{\n method: \"GET\",\n credentials: \"include\",\n mode: \"cors\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n const text = await response.text()\n if(!text){\n self.setState({\n title: \"Not connected to discordservers.com!\",\n loading: true,\n selectedCategory: -1,\n connection: {\n state: 1,\n user: null\n }\n });\n return\n }\n const data = JSON.parse(text)\n self.setState({\n selectedCategory: 0,\n connection: {\n state: 2,\n user: data\n }\n });\n self.search(\"\", true);\n }\n catch (error) {\n console.error(error)\n self.setState({\n title: \"Not connected to discordservers.com!\",\n loading: true,\n selectedCategory: -1,\n connection: {\n state: 1,\n user: null\n }\n });\n }\n }\n\n render() {\n this.hooks.forEach((e) => e())\n SettingsView = SettingsView || BDV2.WebpackModules.findByDisplayName(\"SettingsView\")\n return BDV2.react.createElement(\"div\", {id: \"pubslayerroot\"}, \n BDV2.react.createElement(\"div\", {id: \"pubslayer\"}, BDV2.react.createElement(SettingsView, {\n onSetSection: (section) => {\n this.changeCategory(this.categorySlugs.indexOf(section))\n },\n sections: this.sections,\n onClose: this.close,\n section: this.state.section\n }))\n );\n }\n\n get sections(){\n let sections = []\n sections.push({\n section: \"HEADER\",\n label: \"Public Servers\"\n }, {\n section: \"DIVIDER\"\n }, {\n section: \"CUSTOM\",\n element: this.searchInput.bind(null, () => this, this.searchKeyDown)\n }, {\n section: \"DIVIDER\"\n }, {\n section: \"HEADER\",\n label: \"Categories\"\n }, ...this.categoryButtons.map((value, index) => {\n return {\n section: this.categorySlugs[index],\n label: value,\n element: this.content.bind(null, () => this)\n }\n }), {\n section: \"DIVIDER\"\n }, {\n section: \"CUSTOM\",\n element: this.footer\n }, {\n section: \"CUSTOM\",\n element: this.connection.bind(null, () => this)\n })\n return sections\n }\n \n searchInput(getThis, searchKeyDown) {\n const [value, setValue] = BDV2.react.useState(\"\")\n return BDV2.react.createElement(\n \"div\",\n {className: \"ui-form-item\"},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-text-input flex-vertical\", style: {width: \"172px\", marginLeft: \"10px\"}},\n BDV2.react.createElement(\"input\", {\n ref: (serchinput) => (getThis().refs.searchinput = serchinput), \n onKeyDown: searchKeyDown, \n onChange: (e) => {\n setValue(e.target.value)\n }, \n type: \"text\", \n className: \"input default\", \n placeholder: \"Search...\", \n maxLength: \"50\",\n value: value\n })\n )\n );\n }\n\n searchKeyDown(e) {\n const self = this;\n if (self.state.loading || e.which !== 13) return;\n self.setState({\n loading: true,\n title: \"Loading...\",\n term: e.target.value\n });\n let query = `?term=${e.target.value}`;\n if (self.state.selectedCategory !== 0) {\n query += `&category=${self.categoryButtons[self.state.selectedCategory]}`;\n }\n self.search(query, true);\n }\n\n get categorySlugs(){\n return this.categoryButtons.map(e => e.toLowerCase().replace(/[^\\w\\d]+/g, \"_\"))\n }\n\n get categoryButtons() {\n return [\"All\", \"FPS Games\", \"MMO Games\", \"Strategy Games\", \"MOBA Games\", \"RPG Games\", \"Tabletop Games\", \"Sandbox Games\", \"Simulation Games\", \"Music\", \"Community\", \"Language\", \"Programming\", \"Other\"];\n }\n\n changeCategory(id) {\n const self = this;\n if (self.state.loading) return;\n self.setState({\n loading: true,\n selectedCategory: id,\n title: \"Loading...\",\n term: null,\n section: self.categorySlugs[id]\n });\n if (id === 0) {\n self.search(\"\", true);\n return;\n }\n self.search(`?category=${self.categoryButtons[id]}`, true);\n }\n\n content(getThis) {\n const self = getThis();\n self.useState()\n const guildList = self.SortedGuildStore.getFlattenedGuildIds();\n const defaultList = self.AvatarDefaults.DEFAULT_AVATARS;\n if (self.state.connection.state === 1) return BDV2.react.createElement(self.notConnected.bind(null, getThis));\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0]\n return [BDV2.react.createElement(\n \"div\",\n {ref: (ref) => {\n (self.refs.content = ref)\n }, key: \"pc\", className: columnModule.contentColumn+\" \"+columnModule.contentColumn+\" content-column default\"},\n BDV2.react.createElement(SettingsTitle, {text: self.state.title}),\n self.bdServer,\n self.state.servers.map((server) => {\n return BDV2.react.createElement(ServerCard, {key: server.identifier, server: server, join: self.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]});\n }),\n self.state.next && BDV2.react.createElement(\n \"button\",\n {type: \"button\", onClick: () => {\n if (self.state.loading) return;self.setState({loading: true}); self.search(self.state.next, false);\n }, className: \"ui-button filled brand small grow\", style: {width: \"100%\", marginTop: \"10px\", marginBottom: \"10px\"}},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n self.state.loading ? \"Loading\" : \"Load More\"\n )\n ),\n self.state.servers.length > 0 && BDV2.react.createElement(SettingsTitle, {text: self.state.title})\n )];\n }\n\n notConnected(getThis) {\n const self = getThis();\n //return BDV2.react.createElement(SettingsTitle, { text: self.state.title });\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0]\n return [BDV2.react.createElement(\n \"div\",\n {key: \"ncc\", ref: (ref) => (self.refs.content = ref), className: columnModule.contentColumn+\" \"+columnModule.contentColumn+\" content-column default\"},\n BDV2.react.createElement(\n \"h2\",\n {className: \"ui-form-title h2 margin-reset margin-bottom-20\"},\n \"Not connected to discordservers.com!\",\n BDV2.react.createElement(\n \"button\",\n {\n onClick: self.connect,\n type: \"button\",\n className: \"ui-button filled brand small grow\",\n style: {\n display: \"inline-block\",\n minHeight: \"18px\",\n marginLeft: \"10px\",\n lineHeight: \"14px\"\n }\n },\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n \"Connect\"\n )\n )\n ), self.bdServer\n )];\n }\n\n footer() {\n return BDV2.react.createElement(\n \"div\",\n {className: \"ui-tab-bar-header\"},\n BDV2.react.createElement(\n \"a\",\n {href: \"https://discordservers.com\", target: \"_blank\"},\n \"Discordservers.com\"\n )\n );\n }\n\n useState(){\n const forceUpdate = useForceUpdate()\n BDV2.React.useEffect(() => {\n const listener = () => {\n forceUpdate()\n }\n this.hooks.push(listener)\n return () => {\n const index = this.hooks.findIndex(e => e===listener)\n if(index < 0)return\n this.hooks.splice(index, 1)\n }\n }, [])\n }\n\n connection(getThis) {\n const self = getThis();\n self.useState()\n const {connection} = self.state;\n if (connection.state !== 2) return BDV2.react.createElement(\"span\", null);\n\n return BDV2.react.createElement(\n \"span\",\n null,\n BDV2.react.createElement(TabBarSeparator, null),\n BDV2.react.createElement(\n \"span\",\n {style: {color: \"#b9bbbe\", fontSize: \"10px\", marginLeft: \"10px\"}},\n \"Connected as: \",\n `${connection.user.username}#${connection.user.discriminator}`\n ),\n BDV2.react.createElement(\n \"div\",\n {style: {padding: \"5px 10px 0 10px\"}},\n BDV2.react.createElement(\n \"button\",\n {style: {width: \"100%\", minHeight: \"20px\"}, type: \"button\", className: \"ui-button filled brand small grow\"},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\", onClick: self.connect},\n \"Reconnect\"\n )\n )\n )\n );\n }\n}","export default class BugHunterBadge extends React.Component {\n render(){\n const props = this.props\n\n return (\n <svg viewBox=\"0 0 31.3 29.5\" {...props.svg} height=\"100%\">\n <path d=\"M22.8 1s12 8.2 7.4 19.7S16.6 29 20 25.6s-4-5.6-8.7-10L22.8 1\" fill=\"rgba(227,6,19,.6)\" />\n <path d=\"M22.1 12.3c-2.5 3.2-6.1 4.8-8.9 4.3L3.6 28.8c-.7.9-1.9 1-2.8.3-.9-.7-1-1.9-.4-2.8L10 14.1c-1.3-2.5-.6-6.4 2-9.7 3.2-4 8-5.5 10.8-3.4s2.4 7.2-.7 11.3z\" fill=\"#e30613\" />\n </svg>\n )\n } \n}","export default class Circus extends React.Component {\n render(){\n return (<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\" {...this.props.svg} height=\"100%\">\n <path\n fill=\"#DD2E44\"\n d=\"M33 33a2 2 0 01-2 2H5a2 2 0 01-2-2l1-12h28l1 12z\"\n ></path>\n <path\n fill=\"#EA596E\"\n d=\"M13 35c-.792-1.875-1.75-3.291-3.417-4.666 1.75-1.459 4.542-5.5 5.25-8.292s2.75 8.125 2.042 10.625S13 35 13 35zm10.303 0c.791-1.875 1.75-3.291 3.416-4.666-1.75-1.459-4.541-5.5-5.25-8.292-.707-2.792-2.75 8.125-2.04 10.625.708 2.5 3.874 2.333 3.874 2.333z\"\n ></path>\n <path\n fill=\"#BE1931\"\n d=\"M3.728 24.263A2.5 2.5 0 008 22.5c0-.565-.195-1.081-.511-1.5H4l-.272 3.263zm28.544 0L32 21h-3.489A2.482 2.482 0 0028 22.5a2.5 2.5 0 004.272 1.763z\"\n ></path>\n <circle cx=\"14\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\n <circle cx=\"22\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\n <circle cx=\"10\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\n <circle cx=\"26\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\n <path d=\"M23 35H13s2-6 2-13h6c0 7 2 13 2 13zM17 2h2v7h-2z\"></path>\n <path\n fill=\"#55ACEE\"\n d=\"M18.838.206C17.667.042 17 .318 17 1.418v1c0 1.1.865 1.753 1.923 1.451l5.154-.901c1.715-.343 1.548-1.593.085-1.884L18.838.206z\"\n ></path>\n <path\n fill=\"#CCD6DD\"\n d=\"M18 6l-.081.123C10.938 16.981 3 15.015 3 19v2.5a2.5 2.5 0 004.95.5H12a2 2 0 004 0h4a2 2 0 004 0h4.05a2.5 2.5 0 004.95-.5V19c0-4-8-2-15-13z\"\n ></path>\n <g fill=\"#F5F8FA\">\n <path d=\"M17.948 6.078l-.03.045C17.132 11.619 10.811 16.126 8 18v4a2 2 0 004 0v-4c.982-.982 5.813-6.787 5.984-11.732-.01-.064-.027-.126-.036-.19zm.08.398C18.324 11.374 23.031 17.031 24 18v4a2 2 0 004 0v-4c-2.75-1.833-8.953-6.19-9.972-11.524z\"></path>\n <path d=\"M17.984 6.27C17.922 8.346 17.606 16.394 16 18v4a2 2 0 004 0v-4c-1.564-1.564-1.905-9.241-1.979-11.559-.011-.057-.027-.113-.037-.171z\"></path>\n </g>\n </svg>\n )\n } \n}","import BugHunterBadge from \"../svg/bug_hunter\"\nimport nodeFetch from \"node-fetch\"\nimport { settingsCookie } from \"../0globals\";\nimport Circus from \"../svg/circus\";\n\nexport function uuidv4() { // Generate UUID (No crypto rng)\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n} \n\nconst awaitingBadgesPromises = {}\nlet badgesToFetch = []\n\nexport default new class DistantServer {\n constructor(){\n this._cache = {\n badges: {\n\n }\n }\n window.Lightcord.BetterDiscord.DistantServer = this\n }\n\n get cache(){\n return this._cache\n }\n\n set cache(data){\n if(typeof data !== \"object\" || typeof this._cache !== \"object\")return this._cache = data\n return this._cache = Object.assign(this._cache, data)\n }\n\n /**\n * Get custom badges from the user ID.\n * @param {string} user The user ID \n * @returns {Promise<Constants[\"badges\"]>}\n */\n async getBadges(user){\n if(this.cache.badges[user])return this.cache.badges[user]\n if(awaitingBadgesPromises[user])return awaitingBadgesPromises[user]\n\n let resolve\n const newPromise = new Promise((res) => (resolve = res))\n awaitingBadgesPromises[user] = newPromise\n\n const badges = []\n for(let badge of Constants.badges){\n if(badge.defaultUsers.includes(user))badges.push(badge)\n }\n const fetchedBadges = await new Promise((resolve) => {\n if(!settingsCookie[\"lightcord-5\"])return resolve([])\n badgesToFetch.push([user, resolve])\n setTimeout(() => {\n let users = badgesToFetch\n if(users.length === 0)return\n badgesToFetch = []\n handleRequest(Routes.badges, \"POST\", JSON.stringify(users.map(e => e[0])))\n .then(async res => {\n if(res.status !== 200){// Couldn't fetch badges: server error\n users.forEach(data => {\n data[1]([])// resolve no badge fetched\n })\n }\n const responseBody = await res.json()\n \n for(let user of responseBody){\n let promise = users.find(promise => promise[0] === user.user_id)\n promise[1](user.badges)\n }\n }).catch((err) => {// Couldn't fetch badges: error\n if(!(err instanceof LightcordError))console.error(err)\n users.forEach(data => {\n data[1]([])// resolve no badge fetched\n })\n })\n }, 0)\n })\n for(let badge of fetchedBadges){\n if(!Constants.badges.find(e => e.id === badge))continue // We do not have the Component, skip it.\n if(badges.find(e => e.id === badge))continue // Already inserted.\n badges.push(Constants.badges.find(e => e.id === badge))\n }\n this.cache = {\n badges: Object.assign(this.cache.badges, {[user]: badges})\n }\n setTimeout(() => {\n delete this.cache.badges[user]\n }, 600000);\n\n resolve(badges)\n delete awaitingBadgesPromises[user]\n return badges\n }\n}\n\nconst handleRequest = function(route, method, data){\n if(!settingsCookie[\"lightcord-5\"]){\n return Promise.reject(new LightcordError(\"The current settings blocked the request.\"))\n }\n return nodeFetch(`${Constants.SERVER_URL}/api/v1${route}`, {\n method,\n headers: {\n \"CLIENT\": \"Lightcord\",\n \"Authorization\": window.Lightcord.Api.Authorization || \"None::Anonymous\"\n },\n ...(data ? {\n body: data\n } : {})\n })\n}\n\nclass LightcordError extends Error {\n constructor(){\n super(...arguments)\n this.name = \"LightcordError\"\n }\n}\n\nexport const Constants = {\n SERVER_URL: \"https://lightcord.deroku.xyz\",\n badges: [ // TODO: Add more badges + server side svg\n {\n name: \"Lightcord Bug Hunter\",\n id: \"f04698f5-816b-41e3-bd01-92291193d7a5\",\n defaultUsers: [\n \"696481194443014174\",\n \"696003456611385396\"\n ],\n scopes: [],\n component: BugHunterBadge,\n href: \"https://github.com/lightcord/lightcord/wiki/badges#bug_hunter\"\n }, {\n name: \"Buffoon\",\n id: \"06904d31-65b4-41ec-a50c-8658bbd1af96\",\n defaultUsers: [\n \"389016895543705602\",\n \"664600134528663565\",\n \"625350657829896224\"\n ],\n scopes: [],\n component: Circus,\n href: \"https://youtu.be/EJtb6z-dlT8?t=145\"\n }\n ]\n}\n\nexport const Routes = {\n badges: `/users/badges`\n}","import Utils from \"./utils\";\nimport v2 from \"./v2\";\nimport { uuidv4 } from \"./distant\";\nimport { timingSafeEqual } from \"crypto\";\n\nexport default new class Layers {\n constructor(){\n this.layers = []\n window.Lightcord.BetterDiscord.Layers = this\n }\n\n get isInjected(){\n return !!document.querySelector(\"div.Layers.injected\")\n }\n\n inject(){\n if(this.isInjected)return\n let [\n classNameLayers\n ] = [\n Utils.removeDa(v2.WebpackModules.find(e => e.layers && e.layer).layers)\n ]\n const layers = document.querySelector(\".\"+classNameLayers);\n if (!layers) return false;\n const ReactInstance = Lightcord.Api.Utils.FindReact(layers, 1)\n if(!ReactInstance)return layers\n this.ReactInstance = ReactInstance\n let render = ReactInstance.render\n ReactInstance.render = () => {\n let returnValue = render.call(ReactInstance)\n let classList = returnValue.props.children[1].props.className.split(\" \")\n classList.push(\"Layers\")\n classList.push(\"injected\")\n returnValue.props.children[1].props.className = classList.join(\" \")\n\n this.layers.forEach(layer => {\n returnValue.props.children[1].props.children.push(layer[1])\n })\n\n return returnValue\n }\n ReactInstance.forceUpdate()\n }\n\n createLayer(children, props = {}){\n let id = uuidv4()\n let layer = null\n this.layers.push([id, <Layer {...props} getLayer={lay => {\n layer = lay\n }} key={id} id={id} remove={() => {\n let index = this.layers.findIndex(e => e[0] === id)\n if(index === -1)return\n this.layers.splice(index, 1)\n layer = null\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\n this.inject()\n }}>{children}</Layer>])\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\n this.inject()\n return {\n remove: () => {\n if(!layer){\n let index = this.layers.findIndex(e => e[0] === id)\n if(index === -1)return\n this.layers.splice(index, 1)\n layer = null\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\n this.inject()\n }else{\n layer.remove()\n }\n }\n }\n }\n}\n\n\nlet LayerModules\nexport class Layer extends React.Component {\n constructor(){\n super(...arguments)\n this.state = {\n animation: new this.modules[0].default.Value(0)\n } \n this.props.getLayer(this)\n this.keydown = this.keydown.bind(this)\n }\n\n keydown(e){\n if (e.which === 27) {\n this.remove()\n }\n }\n\n get modules(){\n return LayerModules || (LayerModules = [\n v2.WebpackModules.find(e => e.default && e.default.Value && e.default.div)\n ])\n }\n\n componentWillUnmount(){\n window.removeEventListener(\"keydown\", this.keydown)\n }\n\n componentDidMount(ev){\n window.addEventListener(\"keydown\", this.keydown)\n }\n\n remove(){\n this.props.remove()\n }\n\n componentWillEnter(ev){\n this.modules[0].default.timing(this.state.animation, {\n toValue: 1,\n duration: 100\n }).start(ev)\n }\n\n componentWillLeave(ev){\n this.modules[0].default.timing(this.state.animation, {\n toValue: 0,\n duration: 100\n }).start(ev)\n }\n\n render(){\n let interpolation = this.state.animation.interpolate({\n inputRange: [0, 1],\n outputRange: [1.07, 1]\n })\n let style = {\n opacity: this.state.animation,\n transform: [{\n scale: interpolation\n }]\n }\n let Div = this.modules[0].default.div\n return <Div className={[__SECRET_EMOTION__.css({\n backgroundColor:\"var(--background-primary)\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n display: \"flex\",\n overflow: \"hidden\",\n WebkitBoxOrient: \"vertical\",\n WebkitBoxDirection: \"normal\",\n msFlexDirection: \"column\",\n flexDirection: \"column\",\n zIndex: 101\n }),process.platform===\"win32\"?__SECRET_EMOTION__.css({\n top: \"-22px\",\n paddingTop: \"22px\"\n }):null,...(this.props.className?this.props.className.split(\" \"):[])].filter(e=>e).join(\" \") || null} style={style}>\n {this.props.children(() => {\n this.remove()\n })}\n </Div>\n }\n}\nLayer.defaultProps = {\n id: null,\n children: null\n}","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"./v2\";\nimport webpackModules from \"./webpackModules\";\nimport Utils from \"./utils\";\nimport DOM from \"./domtools\";\n\nimport V2C_PublicServers from \"../ui/publicservers/publicServers\";\nimport Layers from \"./Layers\";\n\nexport default new class V2_PublicServers {\n\n constructor() {\n this._appendButton = this._appendButton.bind(this);\n window.Lightcord.BetterDiscord.V2_PublicServers = this\n }\n\n render() {\n Layers.createLayer((close) => {\n return BDV2.react.createElement(V2C_PublicServers, {rootId: \"pubslayerroot\", close})\n })\n }\n\n get button() {\n const btn = DOM.createElement(`<div id=\"bd-pub-li\" class=\"${BDV2.guildClasses.listItem}\">`);\n if (!settingsCookie[\"bda-gs-1\"]) btn.style.display = \"none\";\n const label = DOM.createElement(`<div id=\"bd-pub-button\" class=\"${\"wrapper-25eVIn \" + BDV2.guildClasses.circleButtonMask}\">public</div>`);\n label.addEventListener(\"click\", () => {this.render();});\n btn.append(label);\n return btn;\n }\n\n _appendButton() {\n let [\n classNametutorialContainer\n ] = [\n Utils.removeDa(BDModules.get(e => e.downloadProgress && e.tutorialContainer)[0].tutorialContainer)\n ]\n if (DOM.query(\"#bd-pub-li\")) return;\n const guilds = DOM.query(`div.${classNametutorialContainer} > div`);\n DOM.after(guilds, this.button);\n }\n\n addButton() {\n if (this.guildPatch) return;\n const GuildList = webpackModules.find(m => m.default && m.default.displayName == \"NavigableGuilds\");\n const GuildListOld = webpackModules.findByDisplayName(\"Guilds\");\n if (!GuildList && !GuildListOld) Utils.warn(\"PublicServer\", \"Can't find GuildList component\");\n this.guildPatch = Utils.monkeyPatch(GuildList ? GuildList : GuildListOld.prototype, GuildList ? \"default\" : \"render\", {after: this._appendButton});\n this._appendButton();\n }\n\n removeButton() {\n this.guildPatch();\n delete this.guildPatch;\n const button = DOM.query(\"#bd-pub-li\");\n if (button) button.remove();\n }\n};","import DOM from \"./domtools\";\n\nconst style = `\n .container-2Rl01u {\n display: none!important;\n }\n\n .chat-3bRxxu {\n display: none!important;\n }\n\n .sidebar-2K8pFh {\n flex-grow: 1!important;\n }\n`;\n\nexport default new class VoiceMode {\n start() {\n DOM.addStyle(\"VoiceMode\", style);\n }\n\n stop() {\n DOM.removeStyle(\"VoiceMode\");\n }\n};","import WebpackModules from \"./webpackModules\";\n\nconst normalizedPrefix = \"da\";\nconst randClass = new RegExp(`^(?!${normalizedPrefix}-)((?:[A-Za-z]|[0-9]|-)+)-(?:[A-Za-z]|[0-9]|-|_){6}$`);\n\nexport default new class ClassNormalizer {\n constructor(){\n window.Lightcord.BetterDiscord.ClassNormalizer = this\n }\n stop() {\n if (!this.hasPatched) return;\n this.unpatchClassModules(WebpackModules.findAll(this.moduleFilter.bind(this)));\n this.revertElement(document.querySelector(\"#app-mount\"));\n this.hasPatched = false;\n }\n\n start() {\n if (this.hasPatched) return;\n this.patchClassModules(WebpackModules.findAll(this.moduleFilter.bind(this)));\n this.normalizeElement(document.querySelector(\"#app-mount\"));\n this.hasPatched = true;\n this.patchDOMMethods();\n }\n\n patchClassModules(modules) {\n for (const module of modules) {\n this.patchClassModule(normalizedPrefix, module);\n }\n }\n\n unpatchClassModules(modules) {\n for (const module of modules) {\n this.unpatchClassModule(normalizedPrefix, module);\n }\n }\n\n shouldIgnore(value) {\n if (!isNaN(value)) return true;\n if (value.endsWith(\"px\") || value.endsWith(\"ch\") || value.endsWith(\"em\") || value.endsWith(\"ms\")) return true;\n if (value.startsWith(\"layerContainer-\")) return true;\n if (value.startsWith(\"#\") && (value.length == 7 || value.length == 4)) return true;\n if (value.includes(\"calc(\") || value.includes(\"rgba\")) return true;\n return false;\n }\n\n moduleFilter(module) {\n if (typeof module !== \"object\" || Array.isArray(module)) return false;\n if (module.__esModule) return false;\n if (!Object.keys(module).length) return false;\n for (const baseClassName in module) {\n const value = module[baseClassName];\n if (typeof value !== \"string\") return false;\n if (this.shouldIgnore(value)) continue;\n if (value.split(\"-\").length === 1) return false;\n if (!randClass.test(value.split(\" \")[0])) return false;\n }\n\n return true;\n }\n\n patchClassModule(componentName, classNames) {\n for (const baseClassName in classNames) {\n const value = classNames[baseClassName];\n if (this.shouldIgnore(value)) continue;\n const classList = value.split(\" \");\n for (const normalClass of classList) {\n const match = normalClass.match(randClass);\n if (!match || !match.length || match.length < 2) continue; // Shouldn't ever happen since they passed the moduleFilter, but you never know\n const camelCase = match[1].split(\"-\").map((s, i) => i ? s[0].toUpperCase() + s.slice(1) : s).join(\"\");\n classNames[baseClassName] += ` ${componentName}-${camelCase}`;\n }\n }\n }\n\n unpatchClassModule(componentName, classNames) {\n for (const baseClassName in classNames) {\n const value = classNames[baseClassName];\n if (this.shouldIgnore(value)) continue;\n let newString = \"\";\n const classList = value.split(\" \");\n for (const normalClass of classList) {\n if (normalClass.startsWith(`${componentName}-`)) continue;\n newString += ` ${normalClass}`;\n }\n classNames[baseClassName] = newString.trim();\n }\n }\n\n normalizeElement(element) {\n if (!(element instanceof Element)) return;\n const classes = element.classList;\n for (let c = 0, clen = classes.length; c < clen; c++) {\n if (!randClass.test(classes[c])) continue;\n const match = classes[c].match(randClass)[1];\n const newClass = match.split(\"-\").map((s, i) => i ? s[0].toUpperCase() + s.slice(1) : s).join(\"\");\n element.classList.add(`${normalizedPrefix}-${newClass}`);\n }\n for (const child of element.children) this.normalizeElement(child);\n }\n\n revertElement(element) {\n if (!(element instanceof Element)) return;\n if (element.children && element.children.length) this.revertElement(element.children[0]);\n if (element.nextElementSibling) this.revertElement(element.nextElementSibling);\n const classes = element.classList;\n const toRemove = [];\n for (let c = 0; c < classes.length; c++) {\n if (classes[c].startsWith(`${normalizedPrefix}-`)) toRemove.push(classes[c]);\n }\n element.classList.remove(...toRemove);\n }\n\n patchDOMMethods() {\n const contains = DOMTokenList.prototype.contains;\n DOMTokenList.prototype.contains = function(token) {\n // const tokens = token.split(\" \");\n return Reflect.apply(contains, this, [token.split(\" \")[0]]);\n // return tokens.every(t => contains.call(this, t));\n };\n\n const add = DOMTokenList.prototype.add;\n DOMTokenList.prototype.add = function(...tokens) {\n for (let t = 0; t < tokens.length; t++) {\n tokens[t] = tokens[t].split(\" \")[0];\n }\n return Reflect.apply(add, this, tokens);\n };\n\n const remove = DOMTokenList.prototype.remove;\n DOMTokenList.prototype.remove = function(...tokens) {\n for (let t = 0; t < tokens.length; t++) {\n tokens[t] = tokens[t].split(\" \")[0];\n }\n return Reflect.apply(remove, this, tokens);\n };\n }\n\n};","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"./v2\";\nimport DOM from \"./domtools\";\nimport Utils from \"./utils\";\n\nexport default new class DevMode {\n constructor() {\n this.debugListener = this.debugListener.bind(this);\n this.copySelectorListener = this.copySelectorListener.bind(this);\n }\n\n start() {\n this.startDebugListener();\n if (settingsCookie[\"fork-dm-1\"]) this.startCopySelector();\n }\n \n stop() {\n this.stopDebugListener();\n this.stopCopySelector();\n }\n\n startDebugListener() {\n this.stopDebugListener();\n document.addEventListener(\"keydown\", this.debugListener);\n }\n\n stopDebugListener() {\n document.removeEventListener(\"keydown\", this.debugListener);\n }\n\n startCopySelector() {\n this.stopCopySelector();\n document.addEventListener(\"contextmenu\", this.copySelectorListener);\n }\n\n stopCopySelector() {\n document.removeEventListener(\"contextmenu\", this.copySelectorListener);\n }\n\n debugListener(e) {\n if (e.which === 119 || e.which == 118) {//F8\n console.log(\"%c[%cDevMode%c] %cBreak/Resume\", \"color: red;\", \"color: #303030; font-weight:700;\", \"color:red;\", \"\");\n debugger; // eslint-disable-line no-debugger\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n copySelectorListener(e) {\n try{\n e.stopPropagation();\n const selector = this.getSelector(e.target);\n \n let [\n classLayer, \n classItems\n ] = [\n BDModules.get((e) => e.layer && typeof e.layer === \"string\" && e.disabledPointerEvents)[0],\n BDModules.get((e) => e.menu)[0]\n ]\n \n function attach() {\n if(!classItems || !classLayer.layer)return console.log(classItems, classLayer.layer)\n\n let cm = DOM.query(\".\"+Utils.removeDa(classItems.menu));\n if (!cm) {\n const container = DOM.query(\"#app-mount > .\"+Utils.removeDa(classLayer.layerContainer));\n const cmWrap = DOM.createElement(`<div class=\"${classLayer.layer}\">`);\n cm = DOM.createElement(`<div class=\"${classItems.menu} ${classItems.styleFlexible} ${classItems.accommodateScrollbar} bd-context-menu\" style=\"\"></div>`);\n cmWrap.append(cm);\n container.append(cmWrap);\n cmWrap.style.top = e.clientY + \"px\";\n cmWrap.style.left = e.clientX + \"px\";\n cmWrap.setAttribute(\"role\", \"menu\")\n cmWrap.setAttribute(\"tabindex\", \"-1\")\n cmWrap.id = \"bd-copy-selector-context\"\n cmWrap.setAttribute(\"aria-label\", \"Copy Selector Actions\")\n\n const scrollerClasses = BDModules.get((e) => e.scrollerWrap)[0]\n const scrollerWrap = DOM.createElement(`<div class=\"${scrollerClasses.scrollerWrap} ${scrollerClasses.scrollerThemed} ${scrollerClasses.themeGhostHairline}\"></div>`)\n const scroller = DOM.createElement(`<div class=\"${BDModules.get(e => e.scroller)[0].scroller} ${classItems.scroller}\"></div>`)\n scrollerWrap.append(scroller)\n cm.append(scrollerWrap)\n\n const removeCM = function(e) {\n if (e.keyCode && e.keyCode !== 27) return;\n cmWrap.remove();\n document.removeEventListener(\"click\", removeCM);\n document.removeEventListener(\"contextmenu\", removeCM);\n document.removeEventListener(\"keyup\", removeCM);\n };\n document.addEventListener(\"click\", removeCM);\n document.addEventListener(\"contextmenu\", removeCM);\n document.addEventListener(\"keyup\", removeCM);\n }\n const cmWrap = cm.parentElement\n \n const scroller = cm.childNodes[0].childNodes[0]\n const cmg = DOM.createElement(`<div role=\"group\"></div>`);\n /**\n * @type {HTMLElement}\n */\n const cmi = DOM.createElement(`<div class=\"${classItems.item} ${classItems.labelContainer} ${classItems.colorDefault}\" role=\"menuitem\" id=\"bd-copy-selector-item-cm\"></div>`);\n cmi.append(DOM.createElement(`<div class=\"${classItems.label}\">Copy Selector</div>`));\n cmi.addEventListener(\"click\", () => {\n BDV2.NativeModule.copy(selector);\n cmWrap.style.display = \"none\"\n });\n cmi.addEventListener(\"mouseover\", (e) => {\n let elements = DOM.queryAll(\"div[role=menuitem].\"+Utils.removeDa(classItems.focused))\n elements && elements.forEach(elem => elem.classList.remove(classItems.focused))\n cmi.classList.add(classItems.focused)\n })\n cmi.addEventListener(\"mouseout\", (e) => {\n cmi.classList.remove(classItems.focused)\n })\n cmg.append(cmi);\n if(scroller.childNodes.length){ // apend a separator\n const separator = DOM.createElement(`<div role=\"separator\" class=\"${classItems.separator}\"></div>`)\n scroller.append(separator)\n }\n scroller.append(cmg);\n if(cmWrap.clientHeight < cmWrap.scrollHeight){\n console.log(\"overflowing \"+cmWrap.style.top)\n cmWrap.style.top = (cmWrap.style.top - cmg.clientHeight) + \"px\";\n console.log(\"overflowing\"+cmWrap.style.top)\n }\n }\n \n setTimeout(attach, 1);\n }catch(e){\n console.error(e)\n }\n }\n\n getSelector(element) {\n if (element.id) return `#${element.id}`;\n /**\n * \n * @param {HTMLElement} el \n */\n function fullPath(el){\n var names = [];\n while (el.parentNode){\n if (el.id){\n names.unshift('#'+el.id);\n break;\n }else{\n if (el==el.ownerDocument.documentElement) names.unshift(el.tagName.toLowerCase()+Array.from(el.classList.entries()).map(e => \".\"+e).join(\"\"));\n else{\n for (var c=1,e=el;e.previousElementSibling;e=e.previousElementSibling,c++);\n names.unshift(el.tagName.toLowerCase()+((typeof el.className === \"string\" && el.className) || \"\").split(\" \").filter(e => !!e).map(e => \".\"+e).join(\"\")+\":nth-child(\"+c+\")\");\n }\n el=el.parentNode;\n }\n }\n return names.join(\" > \");\n }\n return fullPath(element)\n }\n};","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class Switch extends React.Component {\n constructor(props) {\n super(props);\n this.state = {checked: this.props.checked};\n this.onChange = this.onChange.bind(this);\n this.switch = <Lightcord.Api.Components.inputs.Switch onChange={this.onChange} value={this.state.checked} />\n }\n\n onChange(value) {\n if (this.props.disabled) return;\n this.props.onChange(value);\n this.setState({checked: value});\n }\n\n render() {\n return this.switch\n }\n}","import BDV2 from \"../modules/v2\";\nimport Switch from \"./components/switch\";\n\nlet classnames = []\nfunction getClassName(name){\n let className = classnames.find(e => e.startsWith(name+\"-\"))\n if(className)return className\n className = BDModules.get(e => e[name])[0][name]\n classnames.push(className)\n return className\n}\n\nexport default class SwitchItem extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n }\n\n onChange() {\n this.props.checked = !this.props.checked;\n this.props.onChange(this.props.id, this.props.checked);\n }\n\n render() {\n let {text, info} = this.props.data;\n if(!classnames.find(e => e.startsWith(\"beta-\"))){\n classnames.push(BDModules.get(e => e.beta && (!e.container && !e.userSettingsVoice))[0].beta)\n }\n if(this.props.data.experimental){\n info = [\n info,\n React.createElement(\"sup\", {className: getClassName(\"beta\")}, \"(EXPERIMENTAL)\")\n ]\n }\n return BDV2.react.createElement(\"div\", {className: \"ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item\"},\n BDV2.react.createElement(\"div\", {className: \"ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap\"},\n BDV2.react.createElement(\"h3\", {key: \"title\", className: \"ui-form-title h3 margin-reset margin-reset ui-flex-child\"}, text),\n BDV2.react.createElement(Switch, {key: \"switch\", onChange: this.onChange, checked: this.props.checked})\n ),\n BDV2.react.createElement(\"div\", {className: \"ui-form-text style-description margin-top-4\", style: {flex: \"1 1 auto\"}}, info)\n );\n }\n}","let marginModule = BDModules.get(e => e.marginTop60)[0]\n\nexport default class MarginTop extends React.Component {\n render(){\n if(!marginModule)marginModule = BDModules.get(e => e.marginTop60)[0]\n return <div className={marginModule.marginTop60}></div>\n }\n}","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"../modules/v2\";\n\nimport SettingsTitle from \"./settingsTitle\";\nimport Switch from \"./switch\";\nimport MarginTop from \"./margintop\";\n\nlet formModule\nlet switchItem\nlet betaClassNames\nexport default class V2C_SettingsGroup extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n error: false\n }\n }\n\n renderOldSettings() {\n const {title, settings, button} = this.props;\n const buttonComponent = button ? BDV2.react.createElement(\"button\", {key: \"title-button\", className: \"bd-pfbtn\", onClick: button.onClick}, button.title) : null;\n return [BDV2.react.createElement(SettingsTitle, {text: title}),\n buttonComponent,\n settings.map(setting => {\n return BDV2.react.createElement(Switch, {id: setting.id, key: setting.id, data: setting, checked: settingsCookie[setting.id], onChange: (id, checked) => {\n this.props.onChange(id, checked);\n }});\n })];\n }\n\n componentDidCatch(err, errInfo){\n console.log(err, errInfo)\n this.setState({\n error: true\n })\n }\n\n render(){\n if(this.state.error){\n try{\n return this.renderOldSettings()\n }catch(e){\n console.error(e)\n return null\n }\n }else{\n try{\n if(!formModule)formModule = BDV2.WebpackModules.find(e => e.FormSection)\n if(!switchItem)switchItem = BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"SwitchItem\")\n if(!betaClassNames)betaClassNames = BDV2.WebpackModules.find(e => e.beta && (!e.container && !e.userSettingsVoice))\n \n let children = []\n if(this.props.description){\n children.push(<formModule.FormText type=\"description\" selectable={false}>\n {this.props.description}\n </formModule.FormText>, <MarginTop></MarginTop>)\n }\n children.push(...this.props.settings.map(setting => {\n let info = [\n setting.text\n ]\n if(setting.experimental){\n info.push(<sup className={betaClassNames.beta}>(EXPERIMENTAL)</sup>)\n }\n return <switchItem.default onChange={(ev) => {\n this.props.onChange(setting.id, ev.target.checked);\n this.forceUpdate()\n }} key={setting.id} value={settingsCookie[setting.id]} className={__SECRET_EMOTION__.css({\n marginBottom: \"20px\"\n })} disabled={false} hideBorder={false}\n size={switchItem.default.Sizes.DEFAULT} theme={switchItem.default.Themes.DEFAULT} note={setting.info}>\n {info}\n </switchItem.default>\n }))\n return <formModule.FormSection tag=\"h2\" title={this.props.title}>\n {children}\n </formModule.FormSection>\n }catch(e){\n console.error(e)\n setImmediate(()=>{\n this.setState({\n error: true\n })\n })\n return null\n }\n }\n }\n}","import BDV2 from \"../modules/v2\";\n\nimport SettingsGroup from \"./settingsGroup\";\nimport MarginTop from \"./margintop\";\n\nexport default class V2C_SectionedSettingsPanel extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n }\n\n render() {\n return this.props.sections.map((section, i) => {\n return [\n i !== 0 ? BDV2.react.createElement(MarginTop, {}) : null,\n BDV2.react.createElement(SettingsGroup, Object.assign({}, section, {onChange: this.props.onChange}))\n ]\n })\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_Checkbox extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n this.onClick = this.onClick.bind(this);\n this.setInitialState();\n }\n\n setInitialState() {\n this.state = {\n checked: this.props.checked || false\n };\n }\n\n render() {\n return BDV2.react.createElement(\n \"li\",\n null,\n BDV2.react.createElement(\n \"div\",\n {className: \"checkbox \"+BDModules.get(e => e.checkboxElement)[0].checkbox, onClick: this.onClick},\n BDV2.react.createElement(\n \"div\",\n {className: \"checkbox-inner \"+BDModules.get(e => e.checkboxInner)[0].checkboxInner},\n BDV2.react.createElement(\"input\", {className: BDModules.get(e => e.checkboxElement)[0].checkboxElement, checked: this.state.checked, onChange: () => {}, type: \"checkbox\"}),\n BDV2.react.createElement(\"span\", null)\n ),\n BDV2.react.createElement(\n \"span\",\n null,\n this.props.text\n )\n )\n );\n }\n\n onClick() {\n this.props.onChange(this.props.id, !this.state.checked);\n this.setState({\n checked: !this.state.checked\n });\n }\n}","import {settingsCookie} from \"../0globals\";\nimport Settings from \"../modules/settingsPanel\";\nimport BDV2 from \"../modules/v2\";\nimport DataStore from \"../modules/dataStore\";\nimport DOM from \"../modules/domtools\";\nimport Utils from \"../modules/utils\"\n\nimport Checkbox from \"./checkbox\";\n\nexport default class V2C_CssEditorDetached extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n const self = this;\n self.onClick = self.onClick.bind(self);\n self.updateCss = self.updateCss.bind(self);\n self.saveCss = self.saveCss.bind(self);\n self.onChange = self.onChange.bind(self);\n }\n\n componentDidMount() {\n DOM.addClass(DOM.query(\"#app-mount\"), \"bd-detached-editor\");\n BDV2.editorDetached = true;\n // this.updateLineCount();\n this.editor = ace.edit(\"bd-customcss-editor-detached\");\n this.editor.setTheme(\"ace/theme/discord\");\n this.editor.session.setMode(\"ace/mode/css\");\n this.editor.setShowPrintMargin(false);\n this.editor.setFontSize(14);\n this.editor.on(\"change\", () => {\n if (!settingsCookie[\"bda-css-0\"]) return;\n this.saveCss();\n this.updateCss();\n });\n\n }\n\n componentWillUnmount() {\n DOM.removeClass(DOM.query(\"#app-mount\"), \"bd-detached-editor\");\n BDV2.editorDetached = false;\n this.editor.destroy();\n }\n\n updateLineCount() {\n const lineCount = this.refs.editor.value.split(\"\\n\").length;\n if (lineCount == this.props.lines) return;\n this.refs.lines.textContent = Array.from(new Array(lineCount), (_, i) => i + 1).join(\".\\n\") + \".\";\n this.props.lines = lineCount;\n }\n\n get options() {\n return {\n lineNumbers: true,\n mode: \"css\",\n indentUnit: 4,\n theme: \"material\",\n scrollbarStyle: \"simple\"\n };\n }\n\n get css() {\n const _ccss = DataStore.getBDData(\"bdcustomcss\");\n let ccss = \"\";\n if (_ccss && _ccss !== \"\") {\n ccss = Buffer.from(_ccss, \"base64\").toString(\"utf8\");\n }\n return ccss;\n }\n\n get root() {\n const _root = DOM.query(\"#bd-customcss-detach-container\");\n if (!_root) {\n if (!this.injectRoot()) return null;\n return this.detachedRoot;\n }\n return _root;\n }\n\n injectRoot() {\n const app = DOM.query(\".app, .\"+Utils.removeDa(BDModules.get(e => e.app && e.layers)[0].app));\n if (!app) return false;\n DOM.insertAfter(DOM.createElement(`<div id=\"bd-customcss-detach-container\">`), app);\n return true;\n }\n\n render() {\n const self = this;\n return BDV2.react.createElement(\n \"div\",\n {className: \"bd-detached-css-editor\", id: \"bd-customcss-detach-editor\"},\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-innerpane\"},\n BDV2.react.createElement(\"div\", {className: \"editor-wrapper\"},\n BDV2.react.createElement(\"div\", {id: \"bd-customcss-editor-detached\", className: \"editor\", ref: \"editor\"}, self.css)\n ),\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-attach-controls\"},\n BDV2.react.createElement(\n \"ul\",\n {className: \"checkbox-group\"},\n BDV2.react.createElement(Checkbox, {id: \"live-update\", text: \"Live Update\", onChange: self.onChange, checked: settingsCookie[\"bda-css-0\"]})\n ),\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-detach-controls-button\"},\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"3px 0 0 3px\", borderRight: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"update\");\n }},\n \"Update\"\n ),\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"0\", borderLeft: \"1px solid #2d2d2d\", borderRight: \"1px solid #2d2d2d\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"save\");\n }},\n \"Save\"\n ),\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"0 3px 3px 0\", borderLeft: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"attach\");\n }},\n \"Attach\"\n ),\n BDV2.react.createElement(\n \"span\",\n {style: {fontSize: \"10px\", marginLeft: \"5px\"}},\n \"Unsaved changes are lost on attach\"\n )\n )\n )\n )\n );\n }\n\n onChange(id, checked) {\n switch (id) {\n case \"live-update\":\n settingsCookie[\"bda-css-0\"] = checked;\n Settings.saveSettings();\n break;\n }\n }\n\n onClick(id) {\n const self = this;\n switch (id) {\n case \"attach\":\n if (DOM.query(\"#editor-detached\")) self.props.attach();\n BDV2.reactDom.unmountComponentAtNode(self.root);\n self.root.remove();\n break;\n case \"update\":\n self.updateCss();\n break;\n case \"save\":\n self.saveCss();\n break;\n }\n }\n\n updateCss() {\n DOM.removeStyle(\"customcss\");\n DOM.addStyle(\"customcss\", this.editor.session.getValue());\n }\n\n saveCss() {\n DataStore.setBDData(\"bdcustomcss\", Buffer.from(this.editor.session.getValue(), \"utf-8\").toString(\"base64\"));\n }\n}","import {settingsCookie} from \"../0globals\";\nimport Settings from \"../modules/settingsPanel\";\nimport BDV2 from \"../modules/v2\";\nimport DataStore from \"../modules/dataStore\";\nimport DOM from \"../modules/domtools\";\nimport Utils from \"../modules/utils\"\n\nimport SettingsTitle from \"./settingsTitle\";\nimport Checkbox from \"./checkbox\";\nimport V2C_CssEditorDetached from \"./cssEditorDetached\";\n\nexport default class V2C_CssEditor extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n const self = this;\n self.props.lines = 0;\n self.setInitialState();\n self.attach = self.attach.bind(self);\n self.detachedEditor = BDV2.react.createElement(V2C_CssEditorDetached, {attach: self.attach});\n self.onClick = self.onClick.bind(self);\n self.updateCss = self.updateCss.bind(self);\n self.saveCss = self.saveCss.bind(self);\n self.detach = self.detach.bind(self);\n }\n\n setInitialState() {\n this.state = {\n detached: this.props.detached || BDV2.editorDetached\n };\n }\n\n componentDidMount() {\n // this.updateLineCount();\n this.editor = ace.edit(\"bd-customcss-editor\");\n this.editor.setTheme(\"ace/theme/discord\");\n this.editor.session.setMode(\"ace/mode/css\");\n this.editor.setShowPrintMargin(false);\n this.editor.setFontSize(14);\n this.editor.on(\"change\", () => {\n if (!settingsCookie[\"bda-css-0\"]) return;\n this.saveCss();\n this.updateCss();\n });\n }\n\n componentWillUnmount() {\n this.editor.destroy();\n }\n\n componentDidUpdate(prevProps, prevState) {\n const self = this;\n if (prevState.detached && !self.state.detached) {\n BDV2.reactDom.unmountComponentAtNode(self.detachedRoot);\n }\n }\n\n codeMirror() {\n }\n\n get options() {\n return {\n lineNumbers: true,\n mode: \"css\",\n indentUnit: 4,\n theme: \"material\",\n scrollbarStyle: \"simple\"\n };\n }\n\n get css() {\n const _ccss = DataStore.getBDData(\"bdcustomcss\");\n let ccss = \"\";\n if (_ccss && _ccss !== \"\") {\n ccss = Buffer.from(_ccss, \"base64\").toString(\"utf8\");\n }\n return ccss;\n }\n\n updateLineCount() {\n const lineCount = this.refs.editor.value.split(\"\\n\").length;\n if (lineCount == this.props.lines) return;\n this.refs.lines.textContent = Array.from(new Array(lineCount), (_, i) => i + 1).join(\".\\n\") + \".\";\n this.props.lines = lineCount;\n }\n\n render() {\n const self = this;\n\n const {detached} = self.state;\n return [\n detached && BDV2.react.createElement(\n \"div\",\n {id: \"editor-detached\"},\n BDV2.react.createElement(SettingsTitle, {text: \"Custom CSS Editor\"}),\n BDV2.react.createElement(\n \"h3\",\n null,\n \"Editor Detached\"\n ),\n BDV2.react.createElement(\n \"button\",\n {className: \"btn btn-primary\", onClick: () => {\n self.attach();\n }},\n \"Attach\"\n )\n ),\n !detached && BDV2.react.createElement(\n \"div\",\n null,\n BDV2.react.createElement(SettingsTitle, {text: \"Custom CSS Editor\"}),\n BDV2.react.createElement(\"div\", {className: \"editor-wrapper\"},\n BDV2.react.createElement(\"div\", {id: \"bd-customcss-editor\", className: \"editor\", ref: \"editor\"}, self.css)\n ),\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-attach-controls\"},\n BDV2.react.createElement(\n \"ul\",\n {className: \"checkbox-group\"},\n BDV2.react.createElement(Checkbox, {id: \"live-update\", text: \"Live Update\", onChange: this.onChange, checked: settingsCookie[\"bda-css-0\"]})\n ),\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-detach-controls-button\"},\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"3px 0 0 3px\", borderRight: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"update\");\n }},\n \"Update\"\n ),\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"0\", borderLeft: \"1px solid #2d2d2d\", borderRight: \"1px solid #2d2d2d\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"save\");\n }},\n \"Save\"\n ),\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"0 3px 3px 0\", borderLeft: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"detach\");\n }},\n \"Detach\"\n ),\n BDV2.react.createElement(\n \"span\",\n {style: {fontSize: \"10px\", marginLeft: \"5px\"}},\n \"Unsaved changes are lost on detach\"\n ),\n BDV2.react.createElement(\"div\", {className: \"help-text\"},\n \"Press \",\n BDV2.react.createElement(\"code\", {className: \"inline\"}, \"ctrl\"),\n \"+\",\n BDV2.react.createElement(\"span\", {className: \"inline\"}, \",\"),\n \" with the editor focused to access the editor's settings.\"\n )\n )\n )\n )\n ]\n }\n\n onClick(arg) {\n const self = this;\n switch (arg) {\n case \"update\":\n self.updateCss();\n break;\n case \"save\":\n self.saveCss();\n break;\n case \"detach\":\n self.detach();\n break;\n }\n }\n\n onChange(id, checked) {\n switch (id) {\n case \"live-update\":\n settingsCookie[\"bda-css-0\"] = checked;\n Settings.saveSettings();\n break;\n }\n }\n\n updateCss() {\n DOM.removeStyle(\"customcss\");\n DOM.addStyle(\"customcss\", this.editor.session.getValue());\n }\n\n saveCss() {\n DataStore.setBDData(\"bdcustomcss\", Buffer.from(this.editor.session.getValue(), \"utf-8\").toString(\"base64\"));\n }\n\n detach() {\n const self = this;\n self.setState({\n detached: true\n });\n const droot = self.detachedRoot;\n if (!droot) {\n console.log(\"FAILED TO INJECT ROOT: .app\");\n return;\n }\n BDV2.reactDom.render(self.detachedEditor, droot);\n }\n\n get detachedRoot() {\n const _root = DOM.query(\"#bd-customcss-detach-container\");\n if (!_root) {\n if (!this.injectDetachedRoot()) return null;\n return this.detachedRoot;\n }\n return _root;\n }\n\n injectDetachedRoot() {\n const app = DOM.query(\".app, .\"+Utils.removeDa(BDModules.get(e => e.app && e.layers)[0].app));\n if (!app) return false;\n DOM.insertAfter(DOM.createElement(`<div id=\"bd-customcss-detach-container\">`), app);\n return true;\n }\n\n attach() {\n const self = this;\n self.setState({\n detached: false\n });\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class BDErrorBoundary extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n this.state = {hasError: false};\n }\n\n componentDidCatch() {\n this.setState({hasError: true});\n }\n\n render() {\n if (this.state.hasError) return BDV2.react.createElement(\"div\", {className: \"react-error\"}, \"Component Error\"); \n return this.props.children; \n }\n}\n\nconst originalRender = BDErrorBoundary.prototype.render;\nObject.defineProperty(BDErrorBoundary.prototype, \"render\", {\n enumerable: false,\n configurable: false,\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\n get: () => originalRender\n}); ","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_ContentColumn extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n\n static get displayName() {return \"ContentColumn\";}\n\n render() {\n //let contentModule = BDModules.get(e => e.contentColumn)[0]\n let title = this.props.title ? BDV2.react.createElement(\"h2\", {className: \"ui-form-title h2 margin-reset margin-bottom-20\"}, this.props.title) : null\n return [\n title,\n this.props.children\n ]\n return BDV2.react.createElement(\n \"div\",\n {className: contentModule.contentColumn + \" \"+contentModule.contentColumnDefault+\" content-column default\", style: {padding: \"60px 40px 0px\"}},\n title,\n this.props.children\n );\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_ReloadIcon extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return BDV2.react.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"#dcddde\",\n className: \"bd-reload \" + this.props.className,\n onClick: this.props.onClick,\n style: {width: this.props.size || \"24px\", height: this.props.size || \"24px\"}\n },\n BDV2.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\"}),\n BDV2.react.createElement(\"path\", {fill: \"none\", d: \"M0 0h24v24H0z\"})\n );\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_XSvg extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return BDV2.react.createElement(\n \"svg\",\n {xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 12 12\", style: {width: \"18px\", height: \"18px\"}},\n BDV2.react.createElement(\n \"g\",\n {className: \"background\", fill: \"none\", fillRule: \"evenodd\"},\n BDV2.react.createElement(\"path\", {d: \"M0 0h12v12H0\"}),\n BDV2.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\"})\n )\n );\n }\n}","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class Edit extends React.Component {\n render() {\n const size = this.props.size || \"24px\";\n return <svg className={this.props.className || \"\"} viewBox=\"0 0 24 24\" fill=\"var(--text-normal)\" style={{width: size, height: size}} onClick={this.props.onClick}>\n <path d=\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\" />\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n </svg>;\n }\n}","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class Delete extends React.Component {\n render() {\n const size = this.props.size || \"24px\";\n return <svg className={this.props.className || \"\"} fill=\"var(--text-normal)\" viewBox=\"0 0 24 24\" style={{width: size, height: size}} onClick={this.props.onClick}>\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><path d=\"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z\"/>\n <path fill=\"none\" d=\"M0 0h24v24H0z\"/>\n </svg>;\n }\n}","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"../modules/v2\";\nimport Utils from \"../modules/utils\";\nimport DOM from \"../modules/domtools\";\n\nimport XSvg from \"./xSvg\";\nimport ReloadIcon from \"./reloadIcon\";\nimport EditIcon from \"./icons/edit\";\nimport DeleteIcon from \"./icons/delete\";\nimport Switch from \"./components/switch\";\nimport TooltipWrap from \"./tooltipWrap\";\nimport { processFile } from \"../modules/pluginCertifier\";\nimport contentManager from \"../modules/contentManager\";\nimport { resolve } from \"path\";\n\nconst React = BDV2.React;\nconst anchorClasses = BDV2.anchorClasses;\n\nexport default class V2C_PluginCard extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n this.showSettings = this.showSettings.bind(this);\n this.setInitialState();\n this.hasSettings = this.props.addon.plugin && typeof(this.props.addon.plugin.getSettingsPanel) === \"function\";\n this.settingsPanel = \"\";\n\n this.edit = this.edit.bind(this);\n this.delete = this.delete.bind(this);\n this.reload = this.reload.bind(this);\n }\n\n setInitialState() {\n this.state = {\n checked: this.props.enabled,\n settings: false,\n reloads: 0,\n trusted: false\n };\n }\n\n showSettings() {\n if (!this.hasSettings) return;\n this.setState({settings: true});\n }\n\n closeSettings() {\n this.panelRef.current.innerHTML = \"\";\n this.setState({settingsOpen: false});\n }\n\n componentDidUpdate() {\n if (!this.state.settings) return;\n if (typeof this.settingsPanel === \"object\") {\n this.refs.settingspanel.appendChild(this.settingsPanel);\n }\n\n if (!settingsCookie[\"fork-ps-3\"]) return;\n setImmediate(() => {\n const isHidden = (container, element) => {\n if(!container){\n console.error(new Error(`Container is undefined.`))\n return false\n }\n const cTop = container.scrollTop;\n const cBottom = cTop + container.clientHeight;\n const eTop = element.offsetTop;\n const eBottom = eTop + element.clientHeight;\n return (eTop < cTop || eBottom > cBottom);\n };\n\n const thisNode = this.refs.cardNode;\n const container = thisNode.closest(\"div[class*=\\\"contentRegionScroller-\\\"]\")\n if (!isHidden(container, thisNode)) return;\n const thisNodeOffset = DOM.offset(thisNode);\n const containerOffset = DOM.offset(container);\n const original = container.scrollTop;\n const endPoint = thisNodeOffset.top - containerOffset.top + container.scrollTop - 30;\n DOM.animate({\n duration: 300,\n update: function(progress) {\n if (endPoint > original) container.scrollTop = original + (progress * (endPoint - original));\n else container.scrollTop = original - (progress * (original - endPoint));\n }\n });\n });\n }\n\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n get settingsComponent() {\n try { this.settingsPanel = this.props.addon.plugin.getSettingsPanel(); }\n catch (err) { Utils.err(\"Plugins\", \"Unable to get settings panel for \" + this.name + \".\", err); }\n\n return BDV2.react.createElement(\"div\", {className: \"bd-card bd-addon-card settings-open ui-switch-item\", ref: \"cardNode\"},\n BDV2.react.createElement(\"div\", {style: {\"float\": \"right\", \"cursor\": \"pointer\"}, onClick: () => {\n this.refs.settingspanel.innerHTML = \"\";\n this.setState({settings: false});\n }},\n BDV2.react.createElement(XSvg, null)\n ),\n typeof this.settingsPanel === \"object\" && BDV2.react.createElement(\"div\", {id: `plugin-settings-${this.name}`, className: \"plugin-settings\", ref: \"settingspanel\"}),\n typeof this.settingsPanel !== \"object\" && BDV2.react.createElement(\"div\", {id: `plugin-settings-${this.name}`, className: \"plugin-settings\", ref: \"settingspanel\", dangerouslySetInnerHTML: {__html: this.settingsPanel}})\n );\n }\n\n buildTitle(name, version, author) {\n const title = \"{{name}} v{{version}} by {{author}}\".split(/({{[A-Za-z]+}})/);\n const nameIndex = title.findIndex(s => s == \"{{name}}\");\n if (nameIndex) title[nameIndex] = React.createElement(\"span\", {className: \"name bda-name\"}, name);\n const versionIndex = title.findIndex(s => s == \"{{version}}\");\n if (nameIndex) title[versionIndex] = React.createElement(\"span\", {className: \"version bda-version\"}, version);\n const authorIndex = title.findIndex(s => s == \"{{author}}\");\n if (nameIndex) {\n const props = {className: \"author bda-author\"};\n if (author.link || author.id) {\n props.className += ` ${anchorClasses.anchor} ${anchorClasses.anchorUnderlineOnHover}`;\n props.target = \"_blank\";\n\n if (author.link) props.href = author.link;\n if (author.id) props.onClick = () => {BDV2.LayerStack.popLayer(); BDV2.openDM(author.id);};\n }\n title[authorIndex] = React.createElement(author.link || author.id ? \"a\" : \"span\", props, author.name);\n }\n return title.flat();\n }\n\n makeLink(title, url) {\n const props = {className: \"bda-link bda-link-website\", target: \"_blank\"};\n if (typeof(url) == \"string\") props.href = url;\n if (typeof(url) == \"function\") props.onClick = (event) => {event.preventDefault(); event.stopPropagation(); url();};\n return BDV2.react.createElement(\"a\", props, title);\n }\n\n makeButton(title, children, action) {\n return <TooltipWrap color=\"black\" side=\"top\" text={title}>\n <div className=\"bd-addon-button\" onClick={action}>{children}</div>\n </TooltipWrap>;\n }\n\n componentWillUnmount(){\n this.unmounted = true\n }\n\n get links() {\n const links = [];\n const addon = this.props.addon;\n if (addon.website) links.push(this.makeLink(\"Website\", addon.website));\n if (addon.source) links.push(this.makeLink(\"Source\", addon.source));\n if (addon.invite) {\n links.push(this.makeLink(\"Support Server\", () => {\n const tester = /\\.gg\\/(.*)$/;\n let code = addon.invite;\n if (tester.test(code)) code = code.match(tester)[1];\n BDV2.LayerStack.popLayer();\n BDV2.InviteActions.acceptInviteAndTransitionToInviteChannel(code);\n }));\n }\n if (addon.donate) links.push(this.makeLink(\"Donate\", addon.donate));\n if (addon.patreon) links.push(this.makeLink(\"Patreon\", addon.patreon));\n return links;\n }\n\n get footer() {\n const links = this.links;\n return (links.length || this.hasSettings) && BDV2.react.createElement(\"div\", {className: \"bd-card-footer bda-footer\"},\n BDV2.react.createElement(\"span\", {className: \"bd-addon-links bda-links\"},\n ...(links.map((element, index) => index < links.length - 1 ? [element, \" | \"] : element).flat())\n ),\n this.hasSettings && BDV2.react.createElement(\"button\", {onClick: this.showSettings, className: \"bd-button bda-settings-button\", disabled: !this.state.checked}, \"Settings\")\n );\n }\n\n onChange() {\n this.props.toggle && this.props.toggle(this.name);\n this.setState({checked: !this.state.checked});\n }\n\n edit() {this.props.edit(this.name);}\n delete() {this.props.remove(this.name);}\n reload() {this.props.reload(this.name);}\n\n get name() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getName() : this.props.addon.name);}\n get author() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getAuthor() : this.props.addon.author);}\n get description() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getDescription() : this.props.addon.description);}\n get version() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getVersion() : this.props.addon.version);}\n\n render() {\n if (this.state.settings) return this.settingsComponent;\n const {authorId, authorLink} = this.props.addon;\n\n const style = {}\n if(settingsCookie[\"fork-ps-6\"]){\n if(!this.isScanning){\n this.isScanning = true\n processFile(resolve(this.props.addon.filename.endsWith(\".plugin.js\") ? contentManager.pluginsFolder : contentManager.themesFolder, this.props.addon.filename), (result) => {\n if(this.unmounted)return\n \n this.setState({\n isTrusted: result.suspect ? \"suspect\" : true\n })\n }, () => {})\n }else{\n if(this.state.isTrusted === true){\n style.borderColor = \"#4087ed\"\n }\n if(this.state.isTrusted === \"suspect\"){\n style.borderColor = \"rgb(240, 71, 71)\"\n }\n }\n }\n \n return BDV2.react.createElement(\"div\", {className: \"bd-card bd-addon-card settings-closed ui-switch-item\", style},\n BDV2.react.createElement(\"div\", {className: \"bd-addon-header bda-header\"},\n BDV2.react.createElement(\"div\", {className: \"bd-card-title bda-header-title\"}, this.buildTitle(this.name, this.version, {name: this.author, id: authorId, link: authorLink})),\n BDV2.react.createElement(\"div\", {className: \"bd-addon-controls bda-controls\"},\n this.props.edit && this.makeButton(\"Edit\", <EditIcon className=\"bd-icon\" />, this.edit),\n this.props.remove && this.makeButton(\"Delete\", <DeleteIcon className=\"bd-icon\" />, this.delete),\n this.props.reload && this.makeButton(\"Reload\", <ReloadIcon className=\"bd-icon\" />, this.reload),\n React.createElement(Switch, {onChange: this.onChange, checked: this.state.checked})\n )\n ),\n BDV2.react.createElement(\"div\", {className: \"bd-scroller-wrap bda-description-wrap scroller-wrap fade\"},\n BDV2.react.createElement(\"div\", {className: \"bd-scroller bd-addon-description bda-description scroller\"}, this.description)\n ),\n this.footer\n );\n }\n}\n\nconst originalRender = V2C_PluginCard.prototype.render;\nObject.defineProperty(V2C_PluginCard.prototype, \"render\", {\n enumerable: false,\n configurable: false,\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\n get: () => originalRender\n});","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class DownArrow extends React.Component {\n render() {\n const size = this.props.size || \"16px\";\n return <svg className={this.props.className || \"\"} fill=\"var(--text-normal)\" viewBox=\"0 0 24 24\" style={{width: size, height: size}}>\n <path d=\"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z\"/>\n </svg>;\n }\n}","import BDV2 from \"../../modules/v2\";\nimport Arrow from \"../icons/downarrow\";\n\nconst React = BDV2.React;\n\n\nexport default class Select extends React.Component {\n constructor(props) {\n super(props);\n this.state = {open: false, value: this.props.value || this.props.options[0].value};\n this.dropdown = React.createRef();\n this.onChange = this.onChange.bind(this);\n this.showMenu = this.showMenu.bind(this);\n this.hideMenu = this.hideMenu.bind(this);\n }\n\n showMenu(event) {\n event.preventDefault();\n this.setState({open: true}, () => {\n document.addEventListener(\"click\", this.hideMenu);\n });\n }\n\n hideMenu() {\n this.setState({open: false}, () => {\n document.removeEventListener(\"click\", this.hideMenu);\n });\n }\n\n onChange(value) {\n this.setState({value});\n if (this.props.onChange) this.props.onChange(value);\n }\n\n get selected() {return this.props.options.find(o => o.value == this.state.value);}\n\n get options() {\n const selected = this.selected;\n return <div className=\"bd-select-options\">\n {this.props.options.map(opt => \n <div className={`bd-select-option${selected.value == opt.value ? \" selected\" : \"\"}`} onClick={this.onChange.bind(this, opt.value)}>{opt.label}</div>\n )}\n </div>;\n }\n\n render() {\n const style = this.props.style == \"transparent\" ? \" bd-select-transparent\" : \"\";\n const isOpen = this.state.open ? \" menu-open\" : \"\";\n return <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\n <div className=\"bd-select-value\">{this.selected.label}</div>\n <Arrow className=\"bd-select-arrow\" />\n {this.state.open && this.options}\n </div>;\n }\n}\n\n// return <div className=\"bd-select-wrap\">\n// <label className=\"bd-label\">{this.props.label}</label>\n// <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\n// <div className=\"bd-select-controls\">\n// <div className=\"bd-select-value\">{this.selected.label}</div>\n// <Arrow className=\"bd-select-arrow\" />\n// </div>\n// </div>\n// {this.state.open && this.options}\n// </div>;","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class Search extends React.Component {\n render() {\n const size = this.props.size || \"16px\";\n return <svg className={this.props.className || \"\"} fill=\"var(--text-normal)\" viewBox=\"0 0 24 24\" style={{width: size, height: size}}>\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\"/>\n <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/>\n </svg>;\n }\n}","import BDV2 from \"../../modules/v2\";\nimport SearchIcon from \"../icons/search\";\n\nconst React = BDV2.React;\n\nexport default class Search extends React.Component {\n constructor(props){\n super(props)\n this.state = {\n focused: false\n }\n }\n render() {\n const className = [\"bd-search-wrapper\"]\n if(this.state.focused)className.push(\"focused\")\n return <div className={className.join(\" \")}>\n <input onChange={this.props.onChange} onKeyDown={this.props.onKeyDown} type=\"text\" \n className=\"bd-search\" placeholder={this.props.placeholder} maxLength=\"50\" \n onFocus={() => {\n this.setState({focused: true})\n }} onBlur={() => {\n this.setState({focused: false})\n }}/>\n <SearchIcon />\n </div>;\n }\n}","import ErrorBoundary from \"./errorBoundary\";\nimport ContentColumn from \"./contentColumn\";\nimport ReloadIcon from \"./reloadIcon\";\nimport AddonCard from \"./addoncard\";\nimport Dropdown from \"./components/dropdown\";\nimport Search from \"./components/search\";\n\nimport {settingsCookie, pluginCookie, themeCookie, bdplugins, bdthemes} from \"../0globals\";\nimport ContentManager from \"../modules/contentManager\";\nimport BDV2 from \"../modules/v2\";\nimport pluginModule from \"../modules/pluginModule\";\nimport themeModule from \"../modules/themeModule\";\nimport WebpackModules from \"../modules/webpackModules\";\nimport BdApi from \"../modules/bdApi\";\nimport Utils from \"../modules/utils\";\nimport TooltipWrap from \"./tooltipWrap\";\nimport bdEvents from \"../modules/bdEvents\";\nimport EmulatedTooltip from \"./tooltip\";\n\nconst Tooltip = WebpackModules.findByDisplayName(\"Tooltip\");\n\nconst React = BDV2.react;\n\nexport default class CardList extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n this.state = {sort: \"name\", ascending: true, query: \"\"};\n this.isPlugins = this.props.type == \"plugins\";\n this.cookie = this.isPlugins ? pluginCookie : themeCookie;\n this.manager = this.isPlugins ? pluginModule : themeModule;\n\n this.sort = this.sort.bind(this);\n this.reverse = this.reverse.bind(this);\n this.search = this.search.bind(this);\n\n this.onAddonChanges = function(){\n this.forceUpdate()\n }\n this.onAddonChanges = this.onAddonChanges.bind(this)\n }\n\n componentDidMount(){\n const type = (this.isPlugins ? \"plugin\" : \"theme\") + \"-\"\n bdEvents.on(`${type}loaded`, this.onAddonChanges)\n bdEvents.on(`${type}unloaded`, this.onAddonChanges)\n bdEvents.on(`${type}reloaded`, this.onAddonChanges)\n }\n\n componentWillUnmount(){\n const type = (this.isPlugins ? \"plugin\" : \"theme\") + \"-\"\n bdEvents.off(`${type}loaded`, this.onAddonChanges)\n bdEvents.off(`${type}unloaded`, this.onAddonChanges)\n bdEvents.off(`${type}reloaded`, this.onAddonChanges)\n }\n\n openFolder() {\n const shell = require(\"electron\").shell;\n const open = shell.openPath || shell.openItem;\n open(this.isPlugins ? ContentManager.pluginsFolder : ContentManager.themesFolder);\n }\n\n edit(name) {\n console.log(name);\n this.manager.edit(name);\n }\n\n async delete(name) {\n const shouldDelete = await this.confirmDelete(name);\n if (!shouldDelete) return;\n this.manager.delete(name);\n }\n\n confirmDelete(name) {\n return new Promise(resolve => {\n BdApi.showConfirmationModal(\"Are You Sure?\", `Are you sure you want to delete ${name}?`, {\n danger: true,\n confirmText: \"Delete\",\n onConfirm: () => {resolve(true);},\n onCancel: () => {resolve(false);}\n });\n });\n }\n\n get sortOptions() {\n return [\n {label: \"Name\", value: \"name\"},\n {label: \"Author\", value: \"author\"},\n {label: \"Version\", value: \"version\"},\n {label: \"Recently Added\", value: \"added\"},\n {label: \"Last Modified\", value: \"modified\"},\n {label: \"File Size\", value: \"size\"},\n ];\n }\n\n get directions() {\n return [\n {label: \"Ascending\", value: true},\n {label: \"Descending\", value: false}\n ];\n }\n\n reverse(value) {\n this.setState({ascending: value});\n }\n\n sort(value) {\n this.setState({sort: value});\n }\n\n search(event) {\n this.setState({query: event.target.value.toLocaleLowerCase()});\n }\n\n getProps(addon) {\n return {\n key: this.getName(addon),\n enabled: this.cookie[this.getName(addon)],\n toggle: this.manager.toggle.bind(this.manager),\n edit: settingsCookie[\"fork-ps-7\"] ? this.edit.bind(this) : null,\n remove: this.delete.bind(this),\n addon: addon,\n hash: addon.hash\n };\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n get list(){\n return this.props.type === \"plugins\" ? Object.values(bdplugins) : Object.values(bdthemes);\n }\n\n getAddons() {\n const sortedAddons = this.list.sort((a, b) => {\n const cap = this.state.sort.charAt(0).toUpperCase() + this.state.sort.slice(1);\n const first = a.plugin && a.plugin[`get${cap}`] ? this.getString(a.plugin[`get${cap}`]()) : this.getString(a[this.state.sort]);\n const second = b.plugin && b.plugin[`get${cap}`] ? this.getString(b.plugin[`get${cap}`]()) : this.getString(b[this.state.sort]);\n if (typeof(first) == \"string\") return first.toLocaleLowerCase().localeCompare(second.toLocaleLowerCase());\n if (first > second) return 1;\n if (second > first) return -1;\n return 0;\n });\n if (!this.state.ascending) sortedAddons.reverse();\n const rendered = [];\n for (let a = 0; a < sortedAddons.length; a++) {\n const addon = sortedAddons[a];\n if (this.state.query) {\n let matches = null;\n const name = this.getName(addon);\n const author = this.getAuthor(addon);\n const description = this.getDescription(addon);\n const version = this.getVersion(addon);\n if (name) matches = name.toLocaleLowerCase().includes(this.state.query);\n if (author) matches = matches || author.toLocaleLowerCase().includes(this.state.query);\n if (description) matches = matches || description.toLocaleLowerCase().includes(this.state.query);\n if (version) matches = matches || version.toLocaleLowerCase().includes(this.state.query);\n if (!matches) continue;\n }\n const props = this.getProps(addon);\n rendered.push(<ErrorBoundary><AddonCard {...props} reload={!settingsCookie[\"fork-ps-5\"] && this.manager.reload.bind(this.manager)} /></ErrorBoundary>);\n }\n return rendered;\n }\n\n getName(addon) {return this.getString(addon.plugin ? addon.plugin.getName() : addon.name);}\n getAuthor(addon) {return this.getString(addon.plugin ? addon.plugin.getAuthor() : addon.author);}\n getDescription(addon) {return this.getString(addon.plugin ? addon.plugin.getDescription() : addon.description);}\n getVersion(addon) {return this.getString(addon.plugin ? addon.plugin.getVersion() : addon.version);}\n\n renderCheckUpdates(){\n if(!window.ZeresPluginLibrary)return null\n if(!window.PluginUpdates)return null\n if(typeof window.PluginUpdates.checkAll !== \"function\")return null\n if(!this.isPlugins)return null\n\n let tooltipIsShowing = false\n let tooltip\n return <TooltipWrap text=\"Checks for updates of plugins that support this feature. Right-click for a list.\">\n <span style={{marginLeft: \"10px\"}} onMouseLeave={() => {\n tooltipIsShowing = false\n tooltip.hide()\n }}>\n <Lightcord.Api.Components.inputs.Button ref=\"checkUpdateButton\" color=\"brand\" look=\"filled\" size=\"min\" hoverColor=\"default\" onClick={() => {\n try{\n Utils.showToast(\"Plugin update check in progress.\", {type: \"info\"})\n window.PluginUpdates.checkAll()\n .then(() => {\n Utils.showToast(\"Plugin update check complete.\", {type: \"success\"})\n }).catch(err => {\n console.error(err)\n Utils.showToast(\"An error occured while checking update.\", {type: \"error\"})\n })\n }catch(e){\n console.error(e)\n Utils.showToast(\"An error occured while checking update.\", {type: \"error\"})\n }\n }} wrapper={false} disabled={false} onRightClick={() => {\n if(!this.refs.checkUpdateButton)return\n if (!window.PluginUpdates || !window.PluginUpdates.plugins) return;\n if(tooltipIsShowing)return\n tooltip = new EmulatedTooltip(this.refs.checkUpdateButton.refs.original.refs.button, Object.values(window.PluginUpdates.plugins).map(p => p.name).join(\", \"), {\n side: \"bottom\",\n attachEvents: false\n })\n tooltip.show()\n tooltipIsShowing = true\n }}>\n Check for Updates\n </Lightcord.Api.Components.inputs.Button>\n </span>\n </TooltipWrap>\n }\n\n render() {\n const refreshIcon = <Tooltip color=\"black\" position=\"top\" text=\"Reload List\">\n {(props) => \n <ReloadIcon {...props} className=\"bd-icon bd-reload bd-reload-header\" size=\"18px\" onClick={async () => {\n if (this.isPlugins) pluginModule.updatePluginList();\n else themeModule.updateThemeList();\n this.forceUpdate();\n }} />\n }</Tooltip>;\n const addonCards = this.getAddons();\n\n return <ContentColumn title={`${this.props.type.toUpperCase()}—${addonCards.length}`}>\n <Lightcord.Api.Components.inputs.Button key=\"folder-button\" color=\"brand\" \n look=\"filled\" size=\"min\" hoverColor=\"default\" onClick={this.openFolder.bind(this)} wrapper={false}\n style={{\n marginLeft: \"10px\"\n }}>\n Open {this.isPlugins ? \"Plugin\" : \"Theme\"} Folder\n </Lightcord.Api.Components.inputs.Button>\n {this.renderCheckUpdates()}\n {!settingsCookie[\"fork-ps-5\"] && refreshIcon}\n <div className=\"bd-controls bd-addon-controls\">\n <Search onChange={this.search} placeholder={`Search ${this.props.type}...`} />\n <div className=\"bd-addon-dropdowns\">\n <div className=\"bd-select-wrapper\">\n <label className=\"bd-label\">Sort by:</label>\n <Dropdown options={this.sortOptions} onChange={this.sort} style=\"transparent\" />\n </div>\n <div className=\"bd-select-wrapper\">\n <label className=\"bd-label\">Order:</label>\n <Dropdown options={this.directions} onChange={this.reverse} style=\"transparent\" />\n </div>\n \n </div>\n </div>\n <div className=\"bda-slist bd-addon-list\">{addonCards}</div>\n </ContentColumn>\n }\n}\n\nconst originalRender = CardList.prototype.render;\nObject.defineProperty(CardList.prototype, \"render\", {\n enumerable: false,\n configurable: false,\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\n get: () => originalRender\n});","import {settingsRPC, defaultRPC} from \"../0globals\";\n\nconst dispatcher = BDModules.get(m=>m.Dispatcher&&m.default&&m.default.dispatch)[0].default\nconst ActionTypes = BDModules.get(m=>m.ActionTypes)[0].ActionTypes\n\nconst socketId = \"lightcord-spoof-socket\"\nconst pid = process.pid\n\nexport default new class CustomRichPresence {\n constructor(){\n this.enabled = false\n\n this.game = settingsRPC\n }\n \n get formatedGame(){\n if(!this.game)return null\n if(this.enabled === false)return null\n let game = {\n name: this.game.name || defaultRPC.name,\n application_id: this.game.application_id || defaultRPC.application_id,\n details: this.game.details || undefined,\n state: this.game.state || undefined,\n timestamps: this.game[\"timestamps.start\"] ? {\n start: this.game[\"timestamps.start\"]\n } : undefined,\n assets: this.game[\"assets.large\"] ? {\n large_image: this.game[\"assets.large\"],\n small_image: this.game[\"assets.small\"] || undefined\n } : undefined\n }\n return game\n }\n\n sendGame(){\n dispatcher.dispatch({\n type: ActionTypes.LOCAL_ACTIVITY_UPDATE,\n socketId,\n pid,\n activity: this.formatedGame\n }) \n }\n\n enable() {\n if(this.enabled)return\n this.enabled = true\n console.log(\"Enabling custom RichPresence\")\n\n this.set(settingsRPC || Object.create(defaultRPC))\n\n this.sendGame()\n }\n\n disable() {\n if(!this.enabled)return\n this.enabled = false\n console.log(\"Disabling custom RichPresence\")\n\n this.sendGame()\n }\n\n async fetchAssets(applicationId){\n let assets = await BDModules.get(e => e.getAssets)[0].getAssets(applicationId)\n if(assets.undefined && typeof assets.undefined === \"number\"){\n throw new Error(\"Unknown Application\")\n }\n return assets\n }\n\n set(activity){\n this.game = activity\n\n this.sendGame()\n }\n}","import BDV2 from \"../modules/v2\";\nimport V2C_SettingsTitle from \"./settingsTitle\";\nimport V2C_SettingsGroup from \"./settingsGroup\";\nimport dataStore from \"../modules/dataStore\";\nimport { defaultRPC, settingsRPC } from \"../0globals\";\nimport CustomRichPresence from \"../modules/CustomRichPresence\"\nimport { remote } from \"electron\";\nimport MarginTop from \"./margintop\";\nimport Utils from \"../modules/utils\";\n\nconst React = BDV2.React;\n\nlet V2C_PresenceSettingsModules\nexport default class V2C_PresenceSettings extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n data: dataStore.getSettingGroup(\"rpc\") || defaultRPC,\n assets: []\n }\n\n this.preview = null\n this.isfetching = false\n if(this.state.data.application_id){\n this.fetchAssets()\n }\n\n this.assetComponents = new Set()\n }\n\n updateWhenFetched(comp){\n this.assetComponents.add(comp)\n }\n\n /**\n * \n * @param {InputText} setting \n */\n onChange(setting, value){\n let defaultSetting = RPCProps.find(e => e.id === setting.props.id)\n\n this.setState({\n data: Object.assign(settingsRPC, this.state.data, {\n [defaultSetting.id]: !!value ? value : null\n }),\n assets: this.state.assets\n })\n if(setting.props.id === \"application_id\"){\n this.fetchAssets()\n }\n\n dataStore.setSettingGroup(\"rpc\", settingsRPC);\n this.preview.forceUpdate()\n CustomRichPresence.set(settingsRPC)\n }\n\n fetchAssets(){\n if(this.isfetching === true){\n let app = this.state.data.application_id\n setTimeout(() => {\n if(this.state.data.application_id !== app){\n return\n }\n this.fetchAssets()\n }, 5000);\n }\n if(!this.state.data.application_id){\n this.setState({\n data: this.state.data,\n assets: []\n })\n this.forceUpdate()\n this.assetComponents.forEach(e => e.forceUpdate())\n return\n }\n this.isfetching = true\n CustomRichPresence.fetchAssets(this.state.data.application_id)\n .then(assets => {\n this.isfetching = false\n this.setState({\n data: this.state.data,\n assets: Object.keys(assets).map(k => {\n let asset = assets[k]\n return {\n id: asset.id,\n name: asset.name,\n type: asset.type\n }\n })\n })\n this.forceUpdate()\n this.assetComponents.forEach(e => e.forceUpdate())\n }).catch(() => {\n this.isfetching = false\n this.setState({\n data: this.state.data,\n assets: []\n })\n this.forceUpdate()\n this.assetComponents.forEach(e => e.forceUpdate())\n })\n }\n\n updatePreview(data){\n this.setState({\n data\n })\n }\n\n get modules(){\n return V2C_PresenceSettingsModules || (V2C_PresenceSettingsModules = [\n BDModules.get(e => e.marginBottom20)[0]\n ])\n }\n\n render() {\n let [\n marginModule\n ] = this.modules\n return [\n <V2C_SettingsGroup title=\"RichPresence Settings\" settings={this.props.settings} onChange={this.props.onChange}/>,\n <MarginTop />,\n <V2C_SettingsTitle text=\"RichPresence\"/>,\n <div>\n {/** options */}\n {this.optionsComponents}\n </div>,\n <div>\n <MarginTop />\n <V2C_SettingsTitle text=\"Preview\"/>\n {/** preview */}\n <RpcPreview settings={this}/>\n </div>,\n <div className={marginModule.marginBottom20}></div>,\n <button style={{opacity: 0.01}} onClick={window.ohgodohfuck}>\n Oh god Oh fuck\n </button>,\n <button style={{opacity: 0.01}} onClick={() => {\n remote.shell.openExternal(\"https://www.youtube.com/watch?v=LkYa7rps_g4\")\n }}>\n See ? I pulled a litle sneaky on ya\n </button>\n ]\n }\n\n get optionsComponents(){\n return this._optionsComponents || (this._optionsComponents = RPCProps.map(e => {\n if(e.type === \"text\"){\n return <InputText setting={e} manager={this} id={e.id}/>\n }else if(e.type === \"number\"){\n let array = [<InputNumber setting={e} manager={this} id={e.id}/>]/*\n if(e.id === \"timestamps.start\"){\n array.unshift(<DiscordButton title=\"Copy Current Timestamp\" onClick={() => {\n DiscordNative.clipboard.copy(Date.now()+\"\")\n }} />)\n }*/\n return array\n }else if(e.type === \"choice\"){\n if([\"assets.small\", \"assets.large\"].includes(e.id)){\n return <InputChoice setting={e} manager={this} id={e.id} choices={[{value: \"none\", label: \"No assets\"}].concat(this.state.assets.map(e => {\n return {\n value: \"asset-\"+e.id,\n label: e.name\n }\n }))}/>\n }else{\n return \"Unknown choice.\"\n }\n }\n }))\n }\n}\nconst RPCProps = [\n {\n title: \"Application ID\",\n id: \"application_id\",\n type: \"number\",\n placeholder: \"711416957718757418\"\n },\n {\n title: \"Name\",\n id: \"name\",\n type: \"text\",\n placeholder: \"Lightcord\"\n },\n {\n title: \"Details\",\n id: \"details\",\n type: \"text\",\n placeholder: \"Browsing Discord\"\n },\n {\n title: \"State\",\n id: \"state\",\n type: \"text\",\n placeholder: \"Lightcord Client\"\n },\n {\n title: \"Timestamp Start\",\n id: \"timestamps.start\",\n type: \"number\",\n get placeholder(){\n return Date.now()\n }\n },\n {\n title: \"LargeAsset\",\n id: \"assets.large\",\n type: \"choice\"\n },\n {\n title: \"SmallAsset\",\n id: \"assets.small\",\n type: \"choice\"\n },\n]\n\nlet inputTextModules\nclass InputText extends React.PureComponent {\n get modules(){\n if(inputTextModules && inputTextModules[0])return inputTextModules\n return inputTextModules = [\n BDModules.get(e => e.removeKeybind)[0],\n BDModules.get(e => e.marginBottom20)[0],\n BDModules.get(e => e.defaultMarginh5)[0],\n BDModules.get(e => e.colorStandard)[0],\n BDModules.get(e => e.size32)[0],\n BDModules.get(e => e._horizontal)[0],\n BDModules.get(e => e.inputMini)[0],\n BDModules.get(e => e.size16 && e.size20)[0],\n ]\n }\n\n constructor(props){\n super(props)\n let setting = this.props.setting\n this.state = {\n data: this.props.manager.state.data[setting.id]\n }\n\n this.input = <window.Lightcord.Api.Components.inputs.TextInput placeholder={setting.placeholder} name={setting.id} value={this.state.data} onChange={(value) => {\n this.setState({\n data: value\n })\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\n this.props.manager.onChange(this, value)\n this.lastEdited = Date.now()\n }else if(!this.isTiming){\n this.isTiming = setTimeout(() => {\n this.props.manager.onChange(this, this.state.data)\n this.isTiming = null\n this.lastEdited = Date.now()\n }, 500);\n }\n }} type=\"text\"/>\n }\n\n render(){\n let setting = this.props.setting\n\n let [\n rowModule,\n marginModule,\n marginModule2,\n colorModule,\n sizeModule,\n flexModule,\n inputModule,\n sizeModule2,\n ] = this.modules\n\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n {setting.title}\n </h5>\n {this.input}\n </div>\n <Divider/>\n </div>)\n }\n}\n\nlet InputNumberModules\nclass InputNumber extends React.PureComponent {\n get modules(){\n return InputNumberModules || (InputNumberModules = [\n BDModules.get(e => e.removeKeybind)[0],\n BDModules.get(e => e.marginBottom20)[0],\n BDModules.get(e => e.defaultMarginh5)[0],\n BDModules.get(e => e.colorStandard)[0],\n BDModules.get(e => e.size32)[0],\n BDModules.get(e => e._horizontal)[0],\n BDModules.get(e => e.inputMini)[0],\n BDModules.get(e => e.size16 && e.size20)[0],\n BDModules.get(e => e.colorTransparent)[0],\n ])\n }\n\n constructor(props){\n super(props)\n let setting = this.props.setting\n this.state = {\n data: this.props.manager.state.data[setting.id]\n }\n\n this.input = <window.Lightcord.Api.Components.inputs.TextInput placeholder={setting.placeholder} name={setting.id} value={this.state.data} type=\"number\" onChange={(value, name, input) => {\n value = value.replace(/[^\\d]+/g, \"\")\n if(value == this.state.data){\n input.setValue(value)\n return\n }\n\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\n this.props.manager.onChange(this, value)\n this.lastEdited = Date.now()\n }else if(!this.isTiming){\n this.isTiming = setTimeout(() => {\n this.props.manager.onChange(this, this.state.data)\n this.isTiming = null\n this.lastEdited = Date.now()\n }, 500);\n }\n this.setState({\n data: value\n })\n }} type=\"text\"/>\n }\n\n render(){\n let setting = this.props.setting\n\n let [\n rowModule,\n marginModule,\n marginModule2,\n colorModule,\n sizeModule,\n flexModule,\n ] = this.modules\n\n\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n {setting.title}\n </h5>\n {this.input}\n {setting.id === \"timestamps.start\" ? \n <Lightcord.Api.Components.inputs.Button onClick={() => {\n DiscordNative.clipboard.copy(Date.now()+\"\")\n }} color=\"brand\">Copy current timestamp</Lightcord.Api.Components.inputs.Button> : null}\n </div>\n <Divider/>\n </div>)\n }\n}\n\nlet InputChoiceModules\nclass InputChoice extends React.PureComponent {\n constructor(props){\n super(props)\n let setting = this.props.setting\n this.state = {\n data: this.props.manager.state.data[setting.id] ? \"asset-\"+this.props.manager.state.data[setting.id] : \"none\"\n }\n this.props.manager.updateWhenFetched(this)\n }\n\n onChange(data){\n let value = data.value\n\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\n this.props.manager.onChange(this, value === \"none\" ? null : value.replace(\"asset-\", \"\"))\n this.lastEdited = Date.now()\n }else if(!this.isTiming){\n this.isTiming = setTimeout(() => {\n this.props.manager.onChange(this, this.state.data === \"none\" ? null : this.state.data.replace(\"asset-\", \"\"))\n this.isTiming = null\n this.lastEdited = Date.now()\n }, 500);\n }\n this.setState({\n data: value\n })\n this.forceUpdate()\n }\n \n get modules(){\n return InputChoiceModules || (InputChoiceModules = [\n BDModules.get(e => e.removeKeybind)[0],\n BDModules.get(e => e.marginBottom20)[0],\n BDModules.get(e => e.defaultMarginh5)[0],\n BDModules.get(e => e.colorStandard)[0],\n BDModules.get(e => e.size32)[0],\n BDModules.get(e => e._horizontal)[0]\n ])\n }\n\n render(){\n let setting = this.props.setting\n\n let [\n rowModule,\n marginModule,\n marginModule2,\n colorModule,\n sizeModule,\n flexModule\n ] = this.modules\n \n let options = this.props.manager.state.assets.map(e => {\n return {\n value: \"asset-\"+e.id,\n label: e.name\n }\n })\n\n options.unshift({\n value: \"none\",\n label: \"No assets\"\n })\n\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n {setting.title}\n </h5>\n <window.Lightcord.Api.Components.inputs.Dropdown value={this.state.data} options={options} onChange={this.onChange.bind(this)} />\n {/*<Select value={this.state.data} onChange={this.onChange.bind(this)} options={options}/>*/}\n </div>\n <Divider/>\n </div>)\n }\n}\n\nlet DividerModules = []\nclass Divider extends React.PureComponent {\n get modules(){\n return DividerModules&&DividerModules[0] ? DividerModules : (DividerModules = [\n BDModules.get(e => e.divider && Object.keys(e).length === 1)[0],\n BDModules.get(e => e.dividerDefault)[0]\n ])\n }\n\n render(){\n let [\n divider,\n dividerDefault\n ] = this.modules\n\n return <div class={`${divider.divider} ${dividerDefault.dividerDefault}`}></div>\n }\n}\n\nclass DiscordButton extends React.Component {\n render(){\n let rowModule = BDModules.get(e => e.removeKeybind)[0]\n let marginModule = BDModules.get(e => e.marginBottom20)[0]\n let flexModule = BDModules.get(e => e._horizontal)[0]\n\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\n <Lightcord.Api.Components.inputs.Button onClick={this.props.onClick} color=\"brand\">\n {this.props.title}\n </Lightcord.Api.Components.inputs.Button>\n </div>\n </div>)\n }\n}\n\nclass RpcPreview extends React.Component {\n constructor(props = {}){\n super(props)\n this.state = {\n active: \"profile\"\n }\n this.tabs = []\n\n this.props.settings.preview = this\n }\n\n changeTab(tab){\n let ancientTab = this.state.active\n if(ancientTab === tab.props.id)return\n\n this.tabs.forEach(e => {\n e.setActive(false)\n })\n tab.setActive(true)\n this.setState({\n active: tab.props.id\n })\n }\n\n render(){\n return (<div className=\"lc-tabWrapper\">\n <div className=\"lc-tabnav\" style={{flex: \"0 1 auto\"}}>\n <Tab preview={this} title=\"Full Profile\" id=\"profile\"/>\n <Tab preview={this} title=\"User Popout\" id=\"popout\"/>\n </div>\n <PresenceErrorCatcher preview={this.preview} state={this.state.rpc} props={{preview: this}} key={this.state.active} />\n </div>)\n } \n\n isActive(tab){\n return this.state.active === tab\n }\n\n get preview(){\n if(this.state.active === \"profile\")return Profile\n return Popout\n }\n}\n\nclass Tab extends React.Component {\n constructor(props){\n super(props)\n\n this.state = {\n active: props.preview.isActive(props.id)\n }\n props.preview.tabs.push(this)\n }\n\n setActive(isActive){\n this.setState({\n active: !!isActive\n })\n }\n\n render(){\n let className = `lc-navItem`\n if(this.state.active){\n className += ` lc-navItemActive`\n }else{\n className += ` lc-navItemInactive`\n }\n return (<div className={className} onClick={()=>{\n this.props.preview.changeTab(this)\n }}>\n {this.props.title}\n </div>)\n }\n}\n\nlet emptyClasses\nclass PresenceErrorCatcher extends React.Component {\n componentDidCatch(err, errInfo){\n console.error(err, errInfo)\n this.setState({\n error: true\n })\n }\n render(){\n if(!this.state){\n this.state = {\n error: false\n }\n }\n if(!this.state.error){\n try{\n const preview = new this.props.preview(this.props.props)\n preview.setState(this.props.state)\n return preview.render()\n }catch(err){\n console.error(err)\n this.state.error = true\n return this.render()\n }\n }else{\n emptyClasses = emptyClasses || BDV2.WebpackModules.find(e => e.emptyStateImage && e.emptyState)\n if(!emptyClasses){\n Utils.showToast(\"An error occured. Please check the console for more informations.\")\n return null\n }\n return <div style={{\n margin: \"20px\"\n }}>\n <div style={{\n backgroundColor: \"var(--background-primary)\", \n padding: \"30px 30px\", \n borderRadius: \"8px\"\n }} className={`lc-tab-box-shadow ${emptyClasses.emptyState}`}>\n <div className={emptyClasses.emptyStateImage} style={{\n marginTop: \"20px\"\n }}>\n\n </div>\n <div className={emptyClasses.emptyStateHeader}>An error occured</div>\n <p className={emptyClasses.emptyStateSubtext}>\n Please check the console for more informations. Join our ­\n <a className={`${BDV2.anchorClasses.anchor} ${BDV2.anchorClasses.anchorUnderlineOnHover}`} role=\"button\" tabindex={0} onClick={() => {\n BDV2.joinLC()\n }}>\n support server\n </a>\n ­ for help.\n </p>\n </div>\n </div>\n }\n }\n}\n\nlet popoutModules\nlet UserPopoutComponent\nlet PopoutProps\nclass Popout extends React.Component {\n get modules(){\n return popoutModules || (popoutModules = [\n BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"UserPopout\"),\n BDV2.WebpackModules.find(e => e.default && e.default.getCurrentUser)\n ])\n }\n\n getComponent(){\n let [\n UserPopout,\n userModule\n ] = this.modules\n\n const user = userModule.default.getCurrentUser()\n return React.createElement(() => {\n let render1 = UserPopout.default({\n userId: user.id, \n guildId: null, \n channelId: null, \n disableUserProfileLink: true\n })\n UserPopoutComponent = render1.type\n PopoutProps = render1.props\n return this.render()\n }, null)\n }\n\n render(){\n if(!UserPopoutComponent)return this.getComponent()\n let [\n _UserPopout,\n userModule\n ] = this.modules\n\n const user = userModule.default.getCurrentUser()\n\n let data = Object.assign({}, defaultRPC, this.props.preview.props.settings.state.data)\n const activity = (function(){\n if(!this.game)return null\n let game = {\n name: this.game.name || defaultRPC.name,\n application_id: this.game.application_id || defaultRPC.application_id,\n details: this.game.details || undefined,\n state: this.game.state || undefined,\n timestamps: this.game[\"timestamps.start\"] ? {\n start: this.game[\"timestamps.start\"]\n } : undefined,\n assets: this.game[\"assets.large\"] ? {\n large_image: this.game[\"assets.large\"],\n small_image: this.game[\"assets.small\"] || undefined\n } : undefined,\n type: 0\n }\n return game\n }).call({\n game: data\n })\n\n const popout = new UserPopoutComponent(Object.assign({}, PopoutProps, {\n activity: activity,\n userId: user.id\n })).render().props.children // bypass tracking\n\n // remove the stop propagation shit.\n const container = <div {...window.Lightcord.Api._.excludeProperties(popout.props, [\"onClick\", \"onContextMenu\"])} />\n\n return <div className=\"lc-userPopout lc-tab-box-shadow\">\n {container}\n </div>\n }\n}\n\nlet profileModules\nlet UserProfileComponent\nlet ProfileProps\nlet connectedProfileStore\nclass Profile extends React.Component {\n get modules(){\n return profileModules || (profileModules = [\n BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"UserProfile\"),\n BDV2.WebpackModules.find(e => e.default && e.default.getCurrentUser)\n ])\n }\n\n render(){\n let [\n UserProfile,\n userModule\n ] = this.modules\n\n const user = userModule.default.getCurrentUser()\n if(!UserProfileComponent){\n const render1 = new UserProfile.default({\n user: user\n }).render()\n connectedProfileStore = render1.type\n const render2 = new render1.type(render1.props).render()\n const render3 = render2.type.render(render2.props, null)\n const render4 = new render3.type(render3.props).render()\n UserProfileComponent = render4.type\n }\n if(!UserProfileComponent)throw new Error(`Couldn't find the UserProfileComponent component.`)\n\n let data = Object.assign({}, defaultRPC, this.props.preview.props.settings.state.data)\n const activity = (function(){\n if(!this.game)return null\n let game = {\n name: this.game.name || defaultRPC.name,\n application_id: this.game.application_id || defaultRPC.application_id,\n details: this.game.details || undefined,\n state: this.game.state || undefined,\n timestamps: this.game[\"timestamps.start\"] ? {\n start: this.game[\"timestamps.start\"]\n } : undefined,\n assets: this.game[\"assets.large\"] ? {\n large_image: this.game[\"assets.large\"],\n small_image: this.game[\"assets.small\"] || undefined\n } : undefined,\n type: 0\n }\n return game\n }).call({\n game: data\n })\n\n ProfileProps = new connectedProfileStore({\n user: user,\n close: () => {}\n }).render().props\n const profile = new UserProfileComponent(Object.assign({}, ProfileProps, {\n activity: activity\n })).render().props.children // bypass tracking\n\n profile.props.style = {\n width: \"auto\"\n }\n\n return <div className=\"lc-tab lc-tab-box-shadow\">\n {profile}\n </div>\n }\n}","import BDV2 from \"../modules/v2\";\nimport V2C_SettingsTitle from \"./settingsTitle\";\n\n/**\n * @type {typeof import(\"react\")}\n */\nconst React = BDV2.React;\n\nlet marginModule2 = BDModules.get(e => e.defaultMarginh5)[0]\nlet colorModule = BDModules.get(e => e.colorStandard)[0]\nlet sizeModule = BDModules.get(e => e.size32)[0]\nlet scrollbarModule1 = BDModules.get(e => e.scrollbarGhostHairline)[0]\nconst GuildModule = BDModules.get(e => e.default && e.default.getGuilds)[0].default\nconst relationShipModule = BDModules.get(e => e.default && e.default.getRelationships)[0].default\nconst sessionModule = BDModules.get(e => e.default && e.default.getSessions)[0].default\nconst userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0].default\n\nexport default class V2C_AccountInfos extends React.Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n if(!marginModule2)marginModule2 = BDModules.get(e => e.defaultMarginh5)[0]\n if(!colorModule)colorModule = BDModules.get(e => e.colorStandard)[0]\n if(!sizeModule)sizeModule = BDModules.get(e => e.size32)[0]\n return [\n <V2C_SettingsTitle text=\"Account Infos\"/>,\n <div>\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n Profile\n </h5>\n <CodeContent content={this.getProfileValue()} language=\"diff\" />\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n Statistics\n </h5>\n <CodeContent content={this.getStatistics()} language=\"diff\" />\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n Connected Sessions\n </h5>\n <CodeContent content={this.getSessionValue()} language=\"diff\" />\n </div>,\n <div className={BDModules.get(e => e.marginBottom20)[0].marginBottom20}></div>\n ]\n }\n\n getSessionValue(){\n const sessionsRaw = sessionModule.getSessions()\n const sessions = Object.keys(sessionsRaw).filter(e => e !== \"all\").map(e => sessionsRaw[e])\n\n if(sessions.length === 0)return \"- No session detected. Please try in a few seconds\"\n \n return sessions.map(e => {\n return `+ id: ${e.sessionId}\n+ os: ${e.clientInfo.os[0].toUpperCase()+e.clientInfo.os.slice(1)}\n+ client: ${e.clientInfo.client}\n+ status: ${e.status}\n+ Activities: ${e.activities.length}`\n }).join(\"\\n\"+\"-\".repeat(38)+\"\\n\")\n }\n\n getProfileValue(){\n const user = userModule.getCurrentUser()\n /**\n * @type {Date}\n */\n const createdAt = user.createdAt\n\n let avatarURL = user.avatarURL\n if(user.avatar && user.avatar.startsWith(\"a_\")){\n avatarURL = user.getAvatarURL(\"gif\")\n }\n\n if(avatarURL.startsWith(\"/\")){\n avatarURL = \"https://discord.com\"+avatarURL\n }\n if(avatarURL.endsWith(\"?size=128\")){\n avatarURL = avatarURL.replace(\"?size=128\", \"?size=4096\")\n }\n\n return `+ Username: ${user.username}\n+ Discriminator: ${user.discriminator}\n+ Tag: ${user.tag}\n+ ID: ${user.id}\n+ Avatar: ${user.avatar}\n+ Avatar URL: ${avatarURL}\n+ Creation Date: ${(createdAt.getDate()).toString().padStart(2, \"0\")}/${(createdAt.getMonth()+1).toString().padStart(2, \"0\")}/${(createdAt.getFullYear()).toString().padStart(2, \"0\")} ${createdAt.getHours().toString().padStart(2, \"0\")}h ${createdAt.getMinutes().toString().padStart(2, \"0\")}min ${createdAt.getSeconds()}s\n+ Flags: ${user.flags}\n+ Has Nitro: ${user.hasPremiumSubscription ? \"Yes\" : \"No\"}\n- Email: ${user.email}\n- 2FA: ${user.mfaEnabled ? \"Yes\" : \"No\"}\n- Has Been On Mobile: ${user.mobile ? \"Yes\" : \"No\"}\n- Phone: ${user.phone || \"None\"}\n- Verified: ${user.verified}\n- Can See NSFW Channels: ${user.nsfwAllowed}`;\n }\n\n getStatistics(){\n\n const guilds = Object.values(GuildModule.getGuilds())\n const relations = Object.keys(relationShipModule.getRelationships())\n const friends = relations.filter(e => relationShipModule.isFriend(e))\n const blocked = relations.filter(e => relationShipModule.isBlocked(e))\n\n return `+ Server Count: ${guilds.length} servers\n+ Relations: ${relations.length} relations\n+ Friends Count: ${friends.length} friends\n- Blocked Users Count: ${blocked.length} blocked users`\n }\n}\n\n\nlet hightlightJS = BDModules.get(e => e.highlight)[0]\nlet messageModule1 = BDModules.get(e => e.markup)[0]\nlet messageModule2 = BDModules.get(e => e.messageContent)[0]\n\nclass CodeContent extends React.Component {\n render(){\n if(!messageModule1)messageModule1 = BDModules.get(e => e.markup)[0]\n if(!messageModule2)messageModule2 = BDModules.get(e => e.messageContent)[0]\n if(!scrollbarModule1)scrollbarModule1 = BDModules.get(e => e.scrollbarGhostHairline)[0]\n if(!hightlightJS)hightlightJS = BDModules.get(e => e.listLanguages)[0]\n return (<div class={`${messageModule1.markup} ${messageModule2.messageContent}`}>\n <pre>\n <code class={`${scrollbarModule1.scrollbarGhostHairline} hljs`} dangerouslySetInnerHTML={{__html: hightlightJS.highlight(this.props.language, this.props.content).value}}>\n\n </code>\n </pre>\n <div className={BDModules.get(e => e.marginBottom8)[0].marginBottom8}></div>\n </div>)\n }\n}","import Utils from \"./utils\"\n\nconst dispatcher = window.Lightcord.DiscordModules.dispatcher\nconst ChannelModule = BDModules.get(e => e.default && e.default.getChannel && e.default.hasChannel)[0].default\nlet relationShipModule = BDModules.get(e => e.default && e.default.addRelationship)[0]\nlet DMModule = BDModules.get(e => e.default && e.default.closePrivateChannel)[0]\n\nconst blocked = {}\n\nlet userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0]\nfunction getCurrentUser(){\n if(userModule)return userModule.default.getCurrentUser()\n return null\n}\n\nexport default new class AntiBotDM {\n constructor(){\n this.antiDM = this.antiDM.bind(this)\n this.enabled = false\n }\n\n enable(){\n if(this.enabled)return\n this.enabled = true\n\n dispatcher.subscribe(\"MESSAGE_CREATE\", this.antiDM)\n }\n\n disable(){\n if(!this.enabled)return\n this.enabled = false\n\n dispatcher.unsubscribe(\"MESSAGE_CREATE\", this.antiDM)\n }\n\n antiDM(ev){\n if(!ev.message.author.bot)return\n if(ev.message.author.id === getCurrentUser().id)\n if(ev.message.guild_id)return\n\n const channel = ChannelModule.getChannel(ev.message.channel_id)\n if(!channel)return // might be broken\n\n if(channel.type !== 1)return\n\n if(blocked[ev.message.author.id])return // If the user unblock the bot, Don't block it again.\n\n if(scanMessage(ev.message)){\n blocked[ev.message.author.id] = true\n Utils.showToast(`[AdBlock]: Blocked ${ev.message.author.username}#${ev.message.author.discriminator}`, {\n \"type\": \"warning\"\n })\n if(!relationShipModule)relationShipModule = BDModules.get(e => e.default && e.default.addRelationship)[0]\n relationShipModule.default.addRelationship(ev.message.author.id, {\n location: \"ContextMenu\"\n }, 2)\n if(!DMModule)DMModule = BDModules.get(e => e.default && e.default.closePrivateChannel)[0]\n DMModule.default.closePrivateChannel(channel.id, false)\n }\n }\n}\n\nfunction scanMessage(message){\n if(/(discord\\.gg|discord\\.com\\/invite\\/|discordapp\\.com\\/invite\\/)/g.test(message.content))return true\n if(EmbedsContains(message, \"discord.gg/\") || EmbedsContains(message, \"discord.com/invite/\") || EmbedsContains(message, \"discordapp.com/invite/\"))return true\n\n return false\n}\nfunction EmbedsContains(message, search){\n let embeds = message.embeds || []\n if(embeds.length === 0)return false\n return embeds.map(embed => {\n if(embed.type !== \"rich\")return false\n if((embed.title || \"\").includes(search))return true\n if((embed.description || \"\").includes(search))return true\n if(((embed.footer || \"\") && embed.footer.text || \"\").includes(search))return true\n if((embed.fields || []).map(e => {\n return e.value.includes(search) || e.name.includes(search)\n }).includes(true))return true\n return false\n\n }).includes(true)\n}","/**\n * Credits to @hellbound1337 on github for the css\n */\n\nimport DOMTools from \"./domtools\"\nimport Utils from \"./utils\"\n\nlet selectors\nconst removeDa = Utils.removeDa\nfunction getSelectors(){\n let standardSidebarView = BDModules.get(e => e.standardSidebarView)[0]\n if(!standardSidebarView)return null\n let defaultClassName = removeDa(standardSidebarView.standardSidebarView)\n let selects = []\n let userSettingsAccount = BDModules.get(e => e.userSettingsAccount)[0]\n const children = BDModules.get(e => typeof e.children === \"string\")[0]\n selects.push(`#app-mount .${defaultClassName} .payment-info .${removeDa(BDModules.get(e => e.description && typeof e.description === \"string\" && e.description.includes(\"formText\"))[0].description)}`)\n selects.push(`#app-mount .${defaultClassName} .${removeDa(BDModules.get(e => e.paymentSourceRow)[0].paymentSourceRow)} .${removeDa(BDModules.get(e => e.subText && e.descriptionWrapper)[0].subText)}`)\n if(userSettingsAccount){\n selects.push(`#app-mount .${defaultClassName} .${removeDa(userSettingsAccount.userSettingsAccount)} div:nth-child(2)>div:nth-child(2)>.${removeDa(BDModules.get(e => e.viewBody)[0].viewBody)}`)\n selects.push(`.${removeDa(userSettingsAccount.userSettingsSecurity)} .${removeDa(children.children)} > div:nth-child(2)`)\n }\n console.log(selects)\n return selects\n}\n\nexport default new class BlurPrivate {\n constructor(){\n this.enabled = false\n }\n\n enable(){\n if(this.enabled)return\n this.enabled = true\n selectors = selectors || getSelectors()\n\n if(!selectors)console.error(new Error(\"Couldn't find selectors to blur personnal informations.\"))\n DOMTools.addStyle(\"blurPrivate\", `\n${selectors.join(\", \")} {\n transition: all 150ms cubic-bezier(.55,.085,.68,.53);\n filter: blur(4px);\n opacity: .8;\n}\n\n${selectors.map(e => e+\":hover\").join(\", \")} {\n transition: all 150ms cubic-bezier(.55,.09,.68,.53);\n filter: none;\n opacity: 1;\n}`)\n }\n\n disable(){\n if(!this.enabled)return\n this.enabled = false\n DOMTools.removeStyle(\"blurPrivate\")\n }\n}","export default new class DisableTyping {\n constructor(){\n window.Lightcord.Api.ensureExported(e => e.default && e.default.startTyping)\n .then(typingModule => {\n let self = this\n const startTyping = typingModule.default.startTyping\n typingModule.default.startTyping = function(){\n if(self.disabled)return startTyping.call(this, ...arguments)\n }\n const stopTyping = typingModule.default.stopTyping\n typingModule.default.stopTyping = function(){\n if(self.disabled)return stopTyping.call(this, ...arguments)\n }\n this.disabled = true\n })\n window.Lightcord.BetterDiscord.DisableTyping = this\n }\n\n disable(){\n this.disabled = true\n }\n\n enable(){\n this.disabled = false\n }\n}","// Good luck to read my code, Even me can't read it properly.\n\nimport { stat } from \"fs\"\nimport { uuidv4 } from \"../modules/distant\"\nimport webpackModules from \"../modules/webpackModules\"\nimport { remote } from \"electron\"\nimport MarginTop from \"./margintop\"\n\nlet formModule\nexport default class ApiPreview extends React.PureComponent {\n constructor(){\n super(...arguments)\n this.state = {\n states: []\n }\n }\n\n render(){\n if(!formModule)formModule = webpackModules.find(e => e.FormSection)\n /** \n * @type {Function[]}\n */\n const allComponents = [...new Set(Object.keys(window.Lightcord.Api.Components).map(e => {\n return Object.keys(window.Lightcord.Api.Components[e]).map(k => window.Lightcord.Api.Components[e][k])\n }).flat())]\n return [\n <formModule.FormSection tag=\"h2\" title=\"Lightcord's Api Availlable components\">\n <formModule.FormText type=\"description\" className=\"\" selectable={false}>\n These components are here for the plugin devs. They can quickly embed any component below with this panel.\n <div style={{marginTop: \"20px\"}}></div>\n <Lightcord.Api.Components.general.AlertBox type=\"info\">All these components have error handling. If you want none, add `.original` after the component path.</Lightcord.Api.Components.general.AlertBox>\n <Lightcord.Api.Components.general.AlertBox type=\"warn\">We do not recommend modifying these component with plugins. Only do this if you know what you are doing.</Lightcord.Api.Components.general.AlertBox>\n </formModule.FormText>\n <MarginTop></MarginTop>\n <Lightcord.Api.Components.inputs.Button color=\"brand\" look=\"outlined\" size=\"medium\" hoverColor=\"green\" onClick={() => {\n remote.shell.openExternal(\"https://lightcord.deroku.xyz/LightcordApi/docs\")\n }} wrapper={false}>\n Documentation\n </Lightcord.Api.Components.inputs.Button>\n </formModule.FormSection>,\n allComponents.map(comp => {\n const compName = comp.displayName || comp.name\n const compPath = `Lightcord.Api.Components.${Object.keys(window.Lightcord.Api.Components).find(e => window.Lightcord.Api.Components[e][compName])}.${compName}`\n return <ComponentPreview key={compPath} comp={comp} />\n })\n ]\n }\n\n get renders(){\n\n }\n}\n\nclass ComponentPreview extends React.Component {\n constructor(props){\n super(props)\n this.state = {\n tab: \"preview\",\n elem: props.comp,\n options: {}\n }\n }\n\n render(){\n const comp = this.props.comp\n let AllPreviews = []\n if(comp.AllPreviews)AllPreviews = comp.AllPreviews\n let state = this.state\n let getProps = () => {\n let final = {}\n AllPreviews.forEach(category => {\n final[Object.keys(category[0])[0]] = category[0][Object.keys(category[0])[0]]\n })\n Object.keys(state.options).forEach(key => {\n final[key] = AllPreviews.find(e => e.find(e => e[key]))[state.options[key]][key]\n })\n return final\n }\n let renderPreview = () => {\n return <div style={{margin: \"20px\"}}>\n <div style={{\n backgroundColor: \"var(--background-secondary)\", \n padding: \"30px 30px\", \n borderRadius: \"8px\"\n }} className=\"lc-tab-box-shadow\">\n {React.createElement(comp, getProps())}\n </div>\n </div>\n }\n let renderCode = () => {\n return <div style={{margin: \"20px\"}}>\n <div style={{\n backgroundColor: \"var(--background-secondary)\", \n padding: \"30px 30px\", \n borderRadius: \"8px\"\n }} className=\"lc-tab-box-shadow\">\n <window.Lightcord.Api.Components.general.SettingSubTitle>\n JSX\n </window.Lightcord.Api.Components.general.SettingSubTitle>\n <window.Lightcord.Api.Components.general.ErrorCatcher>\n {React.createElement(() => {\n return <window.Lightcord.Api.Components.general.CodeBlock language=\"jsx\" content={generateCode(\"jsx\")}/>\n })}\n </window.Lightcord.Api.Components.general.ErrorCatcher>\n <window.Lightcord.Api.Components.general.SettingSubTitle> \n React\n </window.Lightcord.Api.Components.general.SettingSubTitle>\n <window.Lightcord.Api.Components.general.ErrorCatcher>\n {React.createElement(() => {\n return <window.Lightcord.Api.Components.general.CodeBlock language=\"js\" content={generateCode(\"react\")}/>\n })}\n </window.Lightcord.Api.Components.general.ErrorCatcher>\n </div>\n </div>\n }\n let getStrForProp = (value, compPath, lang) => {\n if(typeof value === \"string\"){\n return value\n }else if(typeof value === \"boolean\"){\n return String(value)\n }else if(typeof value === \"function\"){\n return value.toString()\n }else if(typeof value === \"object\"){\n if(value && value.$$typeof && (value.$$typeof === Symbol.for(\"react.element\") || value.$$typeof === 0xeac7)){\n if(compPath === \"Lightcord.Api.Components.general.Tabs\"){\n if(lang === \"react\"){\n return `React.createElement(\"div\", {style: {\nmarginTop: \"20px\", marginBottom: \"20px\"\n}},\nReact.createElement(\"div\", {style: {\nbackgroundColor: \"var(--background-secondary)\",\npadding: \"30px 30px\",\nborderRadius: \"8px\"\n}, className: \"lc-tab-box-shadow\" },\nReact.createElement(Lightcord.Api.Components.general.Title, null, \"Preview tabs\")\n)\n)`\n }else if(lang === \"jsx\"){\n return `<div style={{\nmarginTop: \"20px\", marginBottom: \"20px\"\n}}>\n<div style={{\n backgroundColor: \"var(--background-secondary)\", \n padding: \"30px 30px\", \n borderRadius: \"8px\"\n}} className=\"lc-tab-box-shadow\">\n <Lightcord.Api.Components.general.Title>Preview tabs</Lightcord.Api.Components.general.Title>\n</div>\n</div>`\n }\n }\n return \"Your components here.\"\n }\n return JSON.stringify(value, null, \" \")\n }else if(typeof value === \"number\"){\n return String(value)\n }\n return String(value)\n }\n let generateCode = function(lang){ // code formatting is hard\n const compName = comp.displayName || comp.name\n let categories = Object.keys(window.Lightcord.Api.Components)\n const compCategory = categories.find(e => window.Lightcord.Api.Components[e][compName])\n const compPath = `Lightcord.Api.Components.${compCategory}.${compName}`\n const props = getProps()\n\n if(lang === \"jsx\"){\n let propStrings = []\n let childrenProp = null\n Object.keys(props).forEach(key => {\n if(key == \"children\"){\n childrenProp = getStrForProp(props[key], compPath, lang)\n }else{\n let str = key+\"=\"\n if(typeof props[key] === \"string\"){\n str += JSON.stringify(props[key])\n }else{\n str += `{${getStrForProp(props[key], compPath, lang)}}`\n }\n propStrings.push(str)\n }\n })\n let openTag\n if(childrenProp){\n openTag = `<${compPath} ${propStrings.join(\" \")}>`\n let closeTag = `</${compPath}>`\n return `${openTag}\\n ${childrenProp}\\n${closeTag}`\n }else{\n openTag = `<${compPath} ${propStrings.join(\" \")}/>`\n return openTag\n }\n }else if(lang === \"react\"){\n let children = props.children || null\n delete props.children\n if(children && children.$$typeof && (children.$$typeof === Symbol.for(\"react.element\") || children.$$typeof === 0xeac7)){\n children = getStrForProp(children, compPath, lang)\n }\n let propStrings = []\n Object.keys(props).forEach(key => {\n let visibleKey = /[^\\w\\d_]/g.test(key) ? JSON.stringify(key) : key\n let str = visibleKey+\": \"\n if(typeof props[key] === \"string\"){\n str += JSON.stringify(props[key])\n }else{\n str += getStrForProp(props[key], compPath, lang).split(\"\\n\").map((str, i) => {\n if(i === 0)return str\n return \" \" + str\n }).join(\"\\n\")\n }\n propStrings.push(str)\n })\n let propObject = \"{\"\n if(propStrings.length){\n propStrings.forEach((str, i) => {\n let isLast = i === propStrings.length - 1\n let isFirst = i === 0\n if(!isFirst){\n propObject += \",\"\n }\n propObject += \"\\n \"\n propObject += str\n if(isLast){\n propObject +=\"\\n}\"\n }\n })\n }else{\n propObject += \"}\"\n }\n let childrenData = typeof children === \"string\" && children.startsWith(\"React.createElement\") ? children : JSON.stringify(children)\n return `React.createElement(${compPath}, ${propObject}, ${childrenData})`\n }\n }\n let help = comp.help || {}\n let info = help.info ? <window.Lightcord.Api.Components.general.AlertBox type=\"info\">\n {help.info}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n let warn = help.warn ? <window.Lightcord.Api.Components.general.AlertBox type=\"warn\">\n {help.warn}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n let danger = help.danger ? <window.Lightcord.Api.Components.general.AlertBox type=\"danger\">\n {help.danger}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n let error = help.error ? <window.Lightcord.Api.Components.general.AlertBox type=\"error\">\n {help.error}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n let success = help.success ? <window.Lightcord.Api.Components.general.AlertBox type=\"success\">\n {help.success}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n return (<div>\n <window.Lightcord.Api.Components.general.SettingsTitle>\n {comp.displayName || comp.name}\n </window.Lightcord.Api.Components.general.SettingsTitle>\n {info}\n {success}\n {warn}\n {error}\n {danger}\n {AllPreviews.map(category => {\n if(category[0].onClick)return null\n if(category[0].text)return null\n if(category[0].children)return null\n if(category.length === 1)return null\n \n let key = Object.keys(category[0])[0]\n return [\n <window.Lightcord.Api.Components.general.SettingSubTitle>\n {key}\n </window.Lightcord.Api.Components.general.SettingSubTitle>,\n <window.Lightcord.Api.Components.inputs.Dropdown options={category.map((e, index) => {\n return {\n value: \"opt-\"+index,\n label: JSON.stringify(e[Object.keys(e)[0]])\n }\n })} value={\"opt-\"+(state.options[key] || \"0\")} onChange={(value) => {\n this.setState({\n options: Object.assign({}, state.options, {\n [key]: (value.value || \"0\").replace(\"opt-\", \"\")\n })\n })\n }} searchable={true}/>,\n <div style={{marginBottom: \"8px\"}}></div>\n ]\n })}\n <window.Lightcord.Api.Components.general.Tabs tabs={[{label: \"Preview\", id: \"preview\"}, {label: \"Code\", id: \"code\"}]} \n active={state.tab} children={state.tab === \"preview\" ? renderPreview() : renderCode()} onChange={(tab) => {\n this.setState({\n tab\n })\n }}/>\n </div>)\n }\n}","{/* <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"white\" width=\"18px\" height=\"18px\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z\"/>\n</svg> */}\n\nimport BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class History extends React.Component {\n render() {\n const size = this.props.size || \"18px\";\n return <svg viewBox=\"0 0 24 24\" fill=\"var(--text-normal)\" className={this.props.className || \"\"} style={{width: size, height: size}} onClick={this.props.onClick}>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z\"/>\n </svg>;\n }\n}","import { themeCookie } from \"../0globals\"\nimport bdEvents from \"./bdEvents\"\nimport DOM from \"./domtools\"\n\nexport default new class popoutWindow {\n constructor(){\n /**\n * @type {Map<string, Window>}\n */\n this.windows = new Map()\n this.enabled = false\n this.init()\n }\n\n async init(){\n let popoutModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getWindow)\n window.Lightcord.DiscordModules.dispatcher.subscribe(\"POPOUT_WINDOW_OPEN\", (ev) => {\n setImmediate(() => {\n /**\n * @type {Window}\n */\n const window = popoutModule.default.getWindow(ev.key)\n this.windows.set(ev.key, window)\n\n let classList = window.document.body.classList\n classList.add(\"window-popout\")\n classList.add(\"lightcord\")\n classList.add(\"lightcord\")\n\n this.update(ev.key)\n })\n })\n window.Lightcord.DiscordModules.dispatcher.subscribe(\"POPOUT_WINDOW_CLOSE\", (ev) => {\n setImmediate(() => {\n this.windows.delete(ev.key)\n })\n })\n bdEvents.on(\"theme-enabled\", () => {\n this.update()\n })\n bdEvents.on(\"theme-disabled\", () => {\n this.update()\n })\n bdEvents.on(\"theme-reloaded\", () => {\n this.update()\n })\n bdEvents.on(\"theme-unloaded\", () => {\n this.update()\n })\n bdEvents.on(\"theme-loaded\", () => {\n this.update()\n })\n }\n\n enable(){\n this.enabled = true\n this.update()\n }\n\n disable(){\n this.enabled = false\n this.update()\n }\n\n update(key){\n if(!this.windows.size)return\n if(!this.enabled){\n return this.removeThemes(key)\n }else{\n return this.applyThemes(key)\n }\n }\n\n removeThemes(key){\n if(this.enabled)return\n if(key){\n let window = this.windows.get(key)\n if(!window)return\n let document = window.document\n\n for(let style of document.querySelectorAll(\"style[data-lightcord-theme=true]\")){\n style.remove()\n }\n }else{\n for(let key of this.windows.keys()){\n this.removeThemes(key)\n }\n }\n }\n\n applyThemes(key){\n if(!this.enabled)return\n if(key){\n let window = this.windows.get(key)\n if(!window)return\n let document = window.document\n\n for(let style of document.querySelectorAll(\"style[data-lightcord-theme=true]\")){\n style.setAttribute(\"will-remove\", \"true\")\n }\n\n Object.keys(bdthemes)\n .forEach(themeName => {\n if(!themeCookie[themeName])return // theme disabled\n const theme = bdthemes[themeName]\n if(!theme)return //:shrug:\n\n let existing = document.querySelector(\"style[data-lightcord-theme=true]#\"+DOM.escapeID(theme.id))\n if(existing){\n existing.innerHTML = unescape(theme.css)\n existing.removeAttribute(\"will-remove\")\n }else{\n const style = document.createElement(\"style\")\n style.id = DOM.escapeID(theme.id)\n style.innerHTML = unescape(theme.css)\n style.setAttribute(\"data-lightcord-theme\", \"true\")\n document.head.append(style)\n }\n })\n\n for(let style of document.querySelectorAll(\"style[will-remove=true]\")){\n style.remove()\n }\n }else{\n for(let key of this.windows.keys()){\n this.applyThemes(key)\n }\n }\n }\n}","import {settings, settingsCookie, settingsRPC, lightcordSettings} from \"../0globals\";\nimport DataStore from \"./dataStore\";\nimport V2_SettingsPanel_Sidebar from \"./settingsPanelSidebar\";\nimport Utils from \"./utils\";\nimport BDV2 from \"./v2\";\nimport ContentManager from \"./contentManager\";\nimport coloredText from \"./coloredText\";\nimport tfHour from \"./24hour\";\nimport DOM from \"./domtools\";\n\nimport publicServersModule from \"./publicServers\";\nimport voiceMode from \"./voiceMode\";\nimport ClassNormalizer from \"./classNormalizer\";\nimport dMode from \"./devMode\";\n\nimport SectionedSettingsPanel from \"../ui/sectionedSettingsPanel\";\nimport CssEditor from \"../ui/cssEditor\";\nimport CardList from \"../ui/addonlist\";\nimport V2C_PresenceSettings from \"../ui/presenceSettings\";\nimport CustomRichPresence from \"./CustomRichPresence\";\nimport V2C_AccountInfos from \"../ui/AccountInfos\";\nimport { remote } from \"electron\";\nimport AntiAdDM from \"./AntiAdDM\";\nimport blurPrivate from \"./blurPrivate\";\nimport disableTyping from \"./disableTyping\";\nimport ApiPreview from \"../ui/ApiPreview\";\nimport Switch from \"../ui/switch\";\nimport MarginTop from \"../ui/margintop\";\nimport webpackModules from \"./webpackModules\";\nimport tooltipWrap from \"../ui/tooltipWrap\";\nimport History from \"../ui/icons/history\";\nimport core from \"./core\";\nimport popoutWindow from \"./popoutWindow\";\n\nclass BDSidebarHeader extends React.PureComponent {\n render(){\n let sidebarComponents = webpackModules.find(e => e.Separator && e.Header && e.Item)\n\n const changelogButton = React.createElement(tooltipWrap, {color: \"black\", side: \"top\", text: \"Changelog\"}, \n React.createElement(\"span\", {style: {float: \"right\", cursor: \"pointer\"}, className: \"bd-changelog-button\", onClick: () => {Utils.showChangelogModal(bbdChangelog);}},\n React.createElement(History, {className: \"bd-icon\", size: \"16px\"})\n )\n );\n let rendered = new sidebarComponents.Header({\n children: React.createElement(\"span\", null, \"Bandaged BD\", changelogButton),\n className: \"ui-tab-bar-header\"\n })\n return rendered\n }\n}\n\nlet isClearingCache = false\n\nexport default new class V2_SettingsPanel {\n\n constructor() {\n this.onChange = this.onChange.bind(this);\n this.updateSettings = this.updateSettings.bind(this);\n this.sidebar = new V2_SettingsPanel_Sidebar();\n\n this.registerComponents()\n }\n\n registerComponents(){\n /** Lightcord */\n this.sidebar.register(\"lightcord\", makeComponent(this.lightcordComponent.bind(this)))\n this.sidebar.register(\"status\", makeComponent(this.PresenceComponent.bind(this)))\n this.sidebar.register(\"accountinfo\", makeComponent(this.AccountInfosComponent.bind(this)))\n this.sidebar.register(\"lcapipreview\", makeComponent(this.ApiPreviewComponent.bind(this)))\n\n /* Bandaged BD */\n this.sidebar.register(\"BDChangelogTitle\", makeComponent(() => {\n return new BDSidebarHeader().render()\n }))\n this.sidebar.register(\"core\", makeComponent(this.coreComponent.bind(this)))\n this.sidebar.register(\"customcss\", makeComponent(this.customCssComponent.bind(this)))\n this.sidebar.register(\"plugins\", makeComponent(this.renderAddonPane(\"plugins\")))\n this.sidebar.register(\"themes\", makeComponent(this.renderAddonPane(\"themes\")))\n }\n \n get coreSettings() {\n const settings = this.getSettings(\"core\");\n const categories = [...new Set(settings.map(s => s.category))];\n const sections = categories.map(c => {return {title: c, settings: settings.filter(s => s.category == c)};});\n return sections;\n }\n\n get lightcordSettings() {\n const settings = this.getSettings(\"lightcord\");\n const categories = [...new Set(settings.map(s => s.category))];\n const sections = categories.map(c => {return {title: c, settings: settings.filter(s => s.category == c)};});\n return sections;\n }\n\n get PresenceSettings() {\n return this.getSettings(\"status\")\n }\n\n getSettings(category) {\n return Object.keys(settings).reduce((arr, key) => {\n const setting = settings[key];\n if (setting.cat === category && setting.implemented && !setting.hidden) {\n setting.text = key;\n arr.push(setting);\n }\n return arr;\n }, []);\n }\n\n\n onChange(id, checked, sidebar) {\n this.updateSettings(id, checked, sidebar);\n }\n\n updateSettings(id, enabled, sidebar) {\n if(![\"lightcord-8\", \"no_window_bound\", \"enable_glasstron\", \"lightcord-10\"].includes(id))settingsCookie[id] = enabled;\n\n if (id == \"bda-gs-2\") {\n if (enabled) DOM.addClass(document.body, \"bd-minimal\");\n else DOM.removeClass(document.body, \"bd-minimal\");\n }\n\n if (id == \"bda-gs-3\") {\n if (enabled) DOM.addClass(document.body, \"bd-minimal-chan\");\n else DOM.removeClass(document.body, \"bd-minimal-chan\");\n }\n\n if (id == \"bda-gs-1\") {\n if (enabled) publicServersModule.addButton();\n else publicServersModule.removeButton();\n }\n\n if (id == \"bda-gs-4\") {\n if (enabled) voiceMode.start();\n else voiceMode.stop();\n }\n\n if (id == \"bda-gs-5\") {\n if (enabled) DOM.addClass(DOM.query(\"#app-mount\"), \"bda-dark\");\n else DOM.removeClass(DOM.query(\"#app-mount\"), \"bda-dark\");\n }\n\n if (enabled && id == \"bda-gs-6\") tfHour.inject24Hour();\n\n if (id == \"bda-gs-7\") {\n if (enabled) coloredText.injectColoredText();\n else coloredText.removeColoredText();\n }\n\n if (id == \"fork-ps-4\") {\n if (enabled) ClassNormalizer.start();\n else ClassNormalizer.stop();\n }\n\n if (id == \"fork-ps-5\") {\n if (enabled) {\n ContentManager.watchContent(\"plugin\");\n ContentManager.watchContent(\"theme\");\n }\n else {\n ContentManager.unwatchContent(\"plugin\");\n ContentManager.unwatchContent(\"theme\");\n }\n }\n\n if (id == \"fork-wp-1\") {\n Utils.setWindowPreference(\"transparent\", enabled);\n if (enabled) Utils.setWindowPreference(\"backgroundColor\", null);\n else Utils.setWindowPreference(\"backgroundColor\", \"#2f3136\");\n }\n\n\n if (id == \"bda-gs-8\") {\n if (enabled) dMode.startDebugListener();\n else dMode.stopDebugListener();\n }\n\n if (id == \"fork-dm-1\") {\n if (enabled) dMode.startCopySelector();\n else dMode.stopCopySelector();\n }\n\n if (id === \"lightcord-1\") {\n if (enabled) window.Lightcord.Settings.devMode = true\n else window.Lightcord.Settings.devMode = false\n sidebar.forceUpdate()\n }\n if (id === \"lightcord-2\") {\n if (enabled) window.Lightcord.Settings.callRingingBeat = true\n else window.Lightcord.Settings.callRingingBeat = false\n }\n if (id === \"lightcord-presence-1\") {\n if (enabled) {\n CustomRichPresence.enable()\n const settingsStore = BDModules.get(e => e.default && typeof e.default === \"object\" && \"showCurrentGame\" in e.default)[0]\n if(settingsStore && !settingsStore.default.showCurrentGame){\n BDModules.get(e => e.default && e.default.updateRemoteSettings)[0].default.updateRemoteSettings({\n showCurrentGame: true\n })\n }\n }\n else CustomRichPresence.disable()\n }\n if (id === \"lightcord-3\") {\n if (enabled) remote.getCurrentWindow().setAlwaysOnTop(true)\n else remote.getCurrentWindow().setAlwaysOnTop(false)\n }\n if (id === \"lightcord-4\") {\n if(enabled){\n AntiAdDM.enable()\n }else{\n AntiAdDM.disable()\n }\n }\n if (id === \"lightcord-6\") {\n if(enabled){\n blurPrivate.enable()\n }else{\n blurPrivate.disable()\n }\n }\n if (id === \"lightcord-7\") {\n if(enabled){\n disableTyping.enable()\n }else{\n disableTyping.disable()\n }\n }\n if (id === \"lightcord-8\"){\n let appSettings = remote.getGlobal(\"appSettings\")\n appSettings.set(\"isTabs\", enabled)\n appSettings.save()\n remote.app.relaunch()\n remote.app.exit()\n }\n if (id === \"lightcord-9\") {\n popoutWindow[enabled ? \"enable\" : \"disable\"]()\n }\n if (id === \"lightcord-10\"){\n core.methods.NotificationsUseShim(enabled)\n return\n }\n if (id === \"no_window_bound\"){\n let appSettings = remote.getGlobal(\"appSettings\")\n appSettings.set(\"NO_WINDOWS_BOUND\", enabled)\n\n appSettings.delete(\"IS_MAXIMIZED\")\n appSettings.delete(\"IS_MINIMIZED\") \n appSettings.delete(\"WINDOW_BOUNDS\")\n \n appSettings.save()\n remote.app.relaunch()\n remote.app.exit()\n }\n if (id === \"enable_glasstron\"){\n let appSettings = remote.getGlobal(\"appSettings\")\n appSettings.set(\"GLASSTRON\", enabled)\n appSettings.save()\n remote.app.relaunch()\n remote.app.exit()\n }\n\n this.saveSettings();\n }\n\n async initializeSettings() {\n if (settingsCookie[\"bda-gs-2\"]) DOM.addClass(document.body, \"bd-minimal\");\n if (settingsCookie[\"bda-gs-3\"]) DOM.addClass(document.body, \"bd-minimal-chan\");\n if (settingsCookie[\"bda-gs-1\"]) publicServersModule.addButton();\n if (settingsCookie[\"bda-gs-4\"]) voiceMode.start();\n if (settingsCookie[\"bda-gs-5\"]) DOM.addClass(DOM.query(\"#app-mount\"), \"bda-dark\");\n if (settingsCookie[\"bda-gs-6\"]) tfHour.inject24Hour();\n if (settingsCookie[\"bda-gs-7\"]) coloredText.injectColoredText();\n if (settingsCookie[\"fork-ps-4\"]) ClassNormalizer.start();\n if (settingsCookie[\"lightcord-1\"]) window.Lightcord.Settings.devMode = true\n if (settingsCookie[\"lightcord-2\"]) window.Lightcord.Settings.callRingingBeat = true\n if (settingsCookie[\"lightcord-presence-1\"]) CustomRichPresence.enable()\n if (settingsCookie[\"lightcord-3\"]) remote.getCurrentWindow().setAlwaysOnTop(true)\n if (settingsCookie[\"lightcord-4\"]) AntiAdDM.enable()\n if (settingsCookie[\"lightcord-6\"]) blurPrivate.enable()\n if (settingsCookie[\"lightcord-7\"]) disableTyping.enable()\n if (settingsCookie[\"lightcord-9\"]) popoutWindow.enable()\n\n if (settingsCookie[\"fork-ps-5\"]) {\n ContentManager.watchContent(\"plugin\");\n ContentManager.watchContent(\"theme\");\n }\n\n if (settingsCookie[\"bda-gs-8\"]) dMode.startDebugListener();\n if (settingsCookie[\"fork-dm-1\"]) dMode.startCopySelector();\n\n this.saveSettings();\n }\n\n saveSettings() {\n DataStore.setSettingGroup(\"settings\", settingsCookie);\n DataStore.setSettingGroup(\"rpc\", settingsRPC);\n DataStore.setSettingGroup(\"lightcord-settings\", lightcordSettings);\n }\n\n loadSettings() {\n Object.assign(settingsCookie, DataStore.getSettingGroup(\"settings\"));\n Object.assign(settingsRPC, DataStore.getSettingGroup(\"rpc\"));\n console.log(lightcordSettings, DataStore.getSettingGroup(\"lightcord-settings\"))\n Object.assign(lightcordSettings, DataStore.getSettingGroup(\"lightcord-settings\"));\n }\n\n renderSidebar(sidebar) {\n return this.sidebar.render(sidebar);\n }\n\n coreComponent() {\n return BDV2.react.createElement(SectionedSettingsPanel, {key: \"cspanel\", onChange: this.onChange, sections: this.coreSettings})\n }\n\n lightcordComponent(sidebar, forceUpdate) {\n let appSettings = remote.getGlobal(\"appSettings\")\n return [\n this.lightcordSettings.map((section, i) => {\n return [\n (i === 0 ? null : BDV2.react.createElement(MarginTop)),\n BDV2.react.createElement(\"h2\", {className: \"ui-form-title h2 margin-reset margin-bottom-20\"}, section.title),\n section.settings.map(setting => {\n let isChecked = settingsCookie[setting.id]\n if(setting.id === \"lightcord-8\")isChecked = appSettings.get(\"isTabs\", false);\n if(setting.id === \"no_window_bound\")isChecked = appSettings.get(\"NO_WINDOWS_BOUND\", false)\n if(setting.id === \"enable_glasstron\")isChecked = appSettings.get(\"GLASSTRON\", true)\n if(setting.id === \"lightcord-10\")isChecked = !appSettings.get(\"DEFAULT_NOTIFICATIONS\", true)\n let returnValue = BDV2.react.createElement(Switch, {id: setting.id, key: setting.id, data: setting, checked: isChecked, onChange: (id, checked) => {\n this.onChange(id, checked, sidebar);\n }})\n if(setting.id == \"lightcord-8\" && isChecked){\n return [\n returnValue,\n React.createElement(Lightcord.Api.Components.inputs.Button, {\n color: \"green\",\n look: \"outlined\",\n size: \"small\",\n hoverColor: \"brand\",\n onClick: () => {\n DiscordNative.ipc.send(\"NEW_TAB\")\n },\n wrapper: false,\n disabled: false\n }, \"Open a new Tab\")\n ]\n }\n return returnValue\n })\n ]\n }), \n BDV2.react.createElement(window.Lightcord.Api.Components.inputs.Button, {\n color: \"yellow\",\n look: \"ghost\",\n size: \"medium\",\n hoverColor: \"red\",\n onClick(){\n console.log(\"Should relaunch\")\n remote.app.relaunch({\n args: remote.process.argv.slice(1).concat([\"--disable-betterdiscord\"])\n })\n remote.app.quit()\n },\n wrapper: true\n }, \"Relaunch without BetterDiscord\"),\n React.createElement(Lightcord.Api.Components.inputs.Button, {\n color: \"yellow\",\n look: \"ghost\",\n size: \"medium\",\n hoverColor: \"red\",\n onClick: () => {\n if(isClearingCache)return\n isClearingCache = true\n Utils.showToast(\"Clearing cache...\", {\n type: \"info\"\n })\n forceUpdate()\n remote.getCurrentWebContents().session.clearCache()\n .then(() => {\n Utils.showToast(\"Cache is cleared !\", {\n type: \"success\"\n })\n isClearingCache = false\n forceUpdate()\n }).catch(err => {\n console.error(err)\n Utils.showToast(\"An error occured. Check console for more informations.\", {\n type: \"error\"\n })\n isClearingCache = false\n forceUpdate()\n })\n },\n wrapper: true,\n disabled: isClearingCache\n }, \"Clear cache\")\n ]\n }\n\n PresenceComponent() {\n return BDV2.react.createElement(V2C_PresenceSettings, {\n key: \"lppannel\",\n onChange: this.onChange, \n settings: this.PresenceSettings\n })\n }\n\n AccountInfosComponent() {\n return BDV2.react.createElement(V2C_AccountInfos, {\n key: \"lapannel\"\n })\n }\n\n ApiPreviewComponent() {\n return BDV2.react.createElement(ApiPreview, {\n key: \"lapipannel\"\n })\n }\n\n customCssComponent() {\n return BDV2.react.createElement(CssEditor, {key: \"csseditor\"})\n }\n\n renderAddonPane(type) {\n // I know this shouldn't be here, but when it isn't,\n // React refuses to change the button when going\n // between plugins and themes page... something\n // to debug later.\n class ContentList extends BDV2.react.Component {\n constructor(props) {\n super(props);\n this.prefix = this.props.type.replace(\"s\", \"\");\n }\n \n onChange() {\n this.props.onChange(this.props.type);\n }\n \n render() {return this.props.children;}\n }\n const originalRender = ContentList.prototype.render;\n Object.defineProperty(ContentList.prototype, \"render\", {\n enumerable: false,\n configurable: false,\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\n get: () => originalRender\n });\n return function(){\n return BDV2.react.createElement(ContentList, {type}, BDV2.react.createElement(CardList, {type}))\n }\n }\n};\n\n/**\n * No need to export settingsPanel on window\n */\n\nfunction makeComponent(children){\n class SettingComponent extends React.Component {\n render(){\n return children(sidebar, () => this.forceUpdate())\n }\n }\n let sidebar\n return (s) => {\n sidebar = s\n return SettingComponent\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class BDLogo extends BDV2.reactComponent {\n render() {\n return BDV2.react.createElement(\n \"svg\",\n {height: \"100%\", width: this.props.size || \"16px\", className: \"bd-logo \" + this.props.className, style: {fillRule: \"evenodd\", clipRule: \"evenodd\", strokeLinecap: \"round\", strokeLinejoin: \"round\"}, viewBox: \"0 0 2000 2000\"},\n BDV2.react.createElement(\"metadata\", null),\n BDV2.react.createElement(\"defs\", null,\n BDV2.react.createElement(\"filter\", {id: \"shadow1\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"20\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(0,0,0,0.35)\"})),\n BDV2.react.createElement(\"filter\", {id: \"shadow2\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"15\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(255,255,255,0.15)\"})),\n BDV2.react.createElement(\"filter\", {id: \"shadow3\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"10\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(0,0,0,0.35)\"}))\n ),\n BDV2.react.createElement(\"g\", null,\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow3)\"}, d: \"M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z\", fill: \"#171717\", opacity: \"1\"}),\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow2)\"}, d: \"M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z\", fill: \"#3E82E5\", opacity: \"1\"}),\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow1)\"}, d: \"M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z\", fill: \"#FFFFFF\", opacity: \"1\"})\n )\n );\n }\n}","export default class LightcordLogo extends React.Component {\n render(){\n const props = this.props\n return (\n <svg viewBox=\"0 0 168 168.69\" {...props} height=\"100%\" width={props.size}>\n <defs>\n <linearGradient id=\"prefix__a\" x1={66.7} y1={-487.7} x2={66.7} y2={-508.73} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\n <stop offset={0} stopColor=\"#e30613\" />\n <stop offset={1} stopColor=\"#731a14\" />\n </linearGradient>\n <linearGradient id=\"prefix__b\" x1={101.7} y1={-487.7} x2={101.7} y2={-508.73} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\n <stop offset={0} stopColor=\"#e20613\" />\n <stop offset={1} stopColor=\"#731a13\" />\n </linearGradient>\n <linearGradient id=\"prefix__c\" x1={84} y1={-408} x2={84} y2={-576.69} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\n <stop offset={0} stopColor=\"#e30613\" />\n <stop offset={1} stopColor=\"#731a13\" />\n </linearGradient>\n </defs>\n <path fill=\"#fff\" d=\"M14.9 35.3h139.2V133H14.9z\" />\n <path d=\"M66.7 79.7c-5.4 0-9.8 4.7-9.8 10.5s4.4 10.5 9.8 10.5 9.8-4.7 9.8-10.5-4.4-10.5-9.8-10.5z\" fill=\"url(#prefix__a)\" />\n <path d=\"M101.7 79.7c-5.4 0-9.8 4.7-9.8 10.5s4.4 10.5 9.8 10.5 9.8-4.7 9.8-10.5-4.4-10.5-9.8-10.5z\" fill=\"url(#prefix__b)\" />\n <path d=\"M0 0v168l168 .69V0zm111.3 124.1s-3.4-4.1-6.3-7.7c12.6-3.5 17.4-11.3 17.4-11.3a52.52 52.52 0 01-11.1 5.6 68.63 68.63 0 01-38.9 4 70.12 70.12 0 01-14.1-4.1 48.88 48.88 0 01-7.1-3.3c-.3-.2-.6-.3-.9-.5a.76.76 0 00-.4-.2c-1.7-1-2.6-1.6-2.6-1.6s4.6 7.6 16.8 11.2c-2.9 3.6-6.4 7.9-6.4 7.9-21.2-.6-29.3-14.5-29.3-14.5 0-30.6 13.8-55.4 13.8-55.4 13.8-10.3 26.9-10 26.9-10l1 1.1C52.8 50.3 45 57.9 45 57.9a56.2 56.2 0 015.7-2.7 72.19 72.19 0 0121.8-6 8.75 8.75 0 011.6-.2 89.1 89.1 0 0119.4-.2 78.45 78.45 0 0128.9 9.1s-7.5-7.2-23.9-12.1l1.3-1.5s13.1-.3 26.9 10c0 0 13.8 24.8 13.8 55.4.1-.1-8 13.8-29.2 14.4z\" fill=\"url(#prefix__c)\" />\n </svg>\n )\n }\n}","import BDV2 from \"./v2\";\nimport Utils from \"./utils\";\n\nconst Constants = {\n EmojiRegex: /<a?\\.(\\w+)\\.(\\d+)>/g\n}\n\nlet CustomEmojiModule = BDModules.get(e => e.CustomEmoji)[0]\nlet EmojiModuleApi = BDModules.get(e => e.default && e.default.getCustomEmojiById)[0]\nlet AutocompleteModule = BDModules.get(e => e.default && e.default.displayName === \"Autocomplete\")[0]\nlet AutoCompletionTemplates = BDModules.get(e => e.getAutocompleteOptions)[0]\nlet EmojiModuleQuery = BDModules.get(e => e.default && e.default.queryEmojiResults)[0]\nlet Messages = BDModules.get(e => e.default && e.default.Messages && e.default.Messages.EMOJI_MATCHING)[0]\nlet guildModule = BDModules.get(e => e.default && e.default.getGuild && e.default.getGuilds && !e.default.isFetching)[0]\nlet emojiSearch = BDModules.get(e => e.default && e.default.getDisambiguatedEmojiContext)\n\nexport default new class EmojiModule {\n constructor(){\n this.init().catch(err => Utils.err(\"EmojiModule\", \"An error occured\", err)) // better logging\n }\n\n async init(){\n /** Emoji AutoComplete */\n if(!AutocompleteModule)AutocompleteModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"Autocomplete\")\n if(!AutoCompletionTemplates)AutoCompletionTemplates = await window.Lightcord.Api.ensureExported(e => e.getAutocompleteOptions)\n if(!EmojiModuleQuery)EmojiModuleQuery = await window.Lightcord.Api.ensureExported(e => e.default && e.default.queryEmojiResults)\n if(!Messages)Messages = await window.Lightcord.Api.ensureExported(e => e.default && e.default.Messages && e.default.Messages.EMOJI_MATCHING)\n if(!guildModule)guildModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getGuild && e.default.getGuilds && !e.default.isFetching)\n if(!emojiSearch)emojiSearch = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getDisambiguatedEmojiContext)\n\n if(AutocompleteModule && AutoCompletionTemplates && EmojiModuleQuery && Messages && guildModule && emojiSearch){\n console.log(`Patching getAutocompleteOptions of AutoCompletionTemplates`, AutoCompletionTemplates)\n const getAutocompleteOptions = AutoCompletionTemplates.getAutocompleteOptions\n AutoCompletionTemplates.getAutocompleteOptions = function(e, t, n, r, a){\n const value = getAutocompleteOptions.call(this, ...arguments)\n value.LIGHTCORD_EMOJIS = {\n matches(arg1, arg2){\n let condition = arg2.length > 1 && \".\" === arg1\n setEmojiUsable(condition)\n return condition\n },\n queryResults(t){\n let results = EmojiModuleQuery.default.queryEmojiResults(t, e)\n return results\n },\n renderResults(e, t, n, r, a){\n return D(e, t, a.emojis, n, r, Messages.default.Messages.EMOJI_MATCHING, Messages.default.Messages.EMOJI, AutocompleteModule.default.Emoji, (function(e) {\n return {\n emoji: e,\n key: e.id || e.uniqueName || e.name,\n sentinel: \".\",\n guild: null != e.guildId ? guildModule.default.getGuild(e.guildId) : null\n }\n }), (function(e) {\n return \".\" + e + \".\"\n }))\n },\n getPlainText(id, guild){\n var emojis = guild.emojis;\n if (null == emojis || null == emojis[id]) return \"\";\n var emoji = emojis[id],\n isAnimated = emoji.animated ? \"a\" : \"\";\n return emoji.managed || null == emoji.id ? \".\" + emoji.name + \".\" : \"<\" + isAnimated + \".\" + (emoji.originalName || emoji.name) + \".\" + emoji.id + \">\"\n },\n getRawText(id, guild){\n var emojis = guild.emojis;\n if (null == emojis || null == emojis[id]) return \"\";\n var emoji = emojis[id],\n isAnimated = emoji.animated ? \"a\" : \"\";\n return emoji.managed || null == emoji.id ? \".\" + emoji.name + \".\" : \"<\" + isAnimated + \".\" + (emoji.originalName || emoji.name) + \".\" + emoji.id + \">\"\n }\n }\n return value\n }\n }else{\n console.error(new Error(\"Couldn't start autocompletion of Lightcord's emojis.\"))\n }\n\n /** Emoji display */\n while (!BDV2.MessageComponent) await new Promise(resolve => setTimeout(resolve, 100));\n\n if (!this.cancelEmojiRender){ // TODO: Proper emoji formatting / rendering\n this.cancelEmoteRender = Utils.monkeyPatch(BDV2.MessageComponent, \"default\", {before: (data) => {\n const message = Utils.getNestedProp(data.methodArguments[0], \"childrenMessageContent.props.message\")\n if(!message)return\n const content = Utils.getNestedProp(data.methodArguments[0], \"childrenMessageContent.props.content\")\n if(!content || !content.length)return\n \n /**\n * @type {{\n * raw: string,\n * name: string,\n * id: string,\n * animated: boolean\n * }[]}\n */\n let emojis = []\n \n const newContent = []\n for(let node of content){\n if (typeof(node) !== \"string\") {\n newContent.push(node)\n continue\n };\n let parsed;\n let hasParsed = false\n \n do {\n parsed = Constants.EmojiRegex.exec(node);\n if (parsed) {\n hasParsed = true\n if(!EmojiModuleApi)EmojiModuleApi = BDModules.get(e => e.default && e.default.getCustomEmojiById)[0]\n const emoji = EmojiModuleApi.default.getCustomEmojiById(parsed[2])\n if(emoji){\n emojis.push({\n animated: emoji.animated,\n name: emoji.name,\n id: emoji.id,\n raw: parsed[0]\n })\n }else{\n emojis.push({\n animated: parsed[0].startsWith(\"<a\"),\n name: parsed[1],\n id: parsed[2],\n raw: parsed[0]\n })\n }\n }\n } while (parsed);\n \n if(hasParsed){\n const words = node.split(\" \").map((word, index, arr) => {\n if(!word)return \"\"\n const emoji = emojis.find(e => e.raw == word)\n if(!emoji)return word\n if(!CustomEmojiModule)CustomEmojiModule = BDModules.get(e => e.CustomEmoji)[0]\n return React.createElement(CustomEmojiModule.CustomEmoji, {\n emoji: {\n name: `.${emoji.name}.`,\n emojiId: emoji.id,\n animated: emoji.animated,\n jumboable: arr.length === 1 && content.length === 1\n }\n })\n }).reduce((previous, current) => {\n if(previous.length === 0)return [current]\n if(typeof current === \"string\"){\n if(typeof previous[previous.length - 1] === \"string\"){\n previous[previous.length - 1] += ` ${current}`\n return previous\n }\n previous.push(\" \"+current)\n return previous\n }\n previous.push(\" \", current)\n return previous\n }, [])\n newContent.push(...words)\n }else{\n newContent.push(node)\n }\n }\n while(data.methodArguments[0].childrenMessageContent.props.content[0]){\n data.methodArguments[0].childrenMessageContent.props.content.shift()\n }\n while(newContent[0]){\n data.methodArguments[0].childrenMessageContent.props.content.push(newContent.shift())\n }\n }});\n }/*\n let userModule\n window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"EmojiPickerListRow\")\n .then(EmojiPickerListRow => {\n let classs = EmojiPickerListRow.default\n EmojiPickerListRow.default = class EmojiPickerListRow extends React.Component {\n constructor(props){\n super(props)\n }\n\n render(){\n if(!userModule)userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0]\n if(!userModule)return React.createElement(classs, this.props)\n let user = userModule.default.getCurrentUser()\n if(!user.hasPremiumSubscription)return React.createElement(classs, this.props)\n\n return React.createElement(classs, Object.assign({}, this.props, {\n emojiDescriptors: this.props.emojiDescriptors.map(e => {\n e.isDisabled = false\n })\n })) \n }\n }\n EmojiPickerListRow.default.displayName = \"EmojiPickerListRow\"\n })*/\n }\n\n disable(){\n if (!this.cancelEmoteRender) return;\n this.cancelEmoteRender();\n this.cancelEmoteRender = null;\n }\n\n start(){\n \n }\n}\n\nfunction D(e, t, n, r, o, i, s, u, l, c) {\n if (null == n || 0 === n.length) return null;\n var d = n.map((function(e, n) {\n return React.createElement(u, Object.assign({\n onClick: o,\n onHover: r,\n selected: t === n,\n index: n\n }, l(e, n)))\n }));\n return [R(i, s, e, c), d]\n}\n\nfunction R(e, t, n, r) {\n var a = (n.length > 0 ? e.format({\n prefix: r(n)\n }) : t)\n if(Array.isArray(a)){\n a.unshift(React.createElement(\"strong\", {}, \"[Lightcord] \"))\n }else{\n a = \"[LIGHTCORD] \"+a\n }\n return React.createElement(AutocompleteModule.default.Title, {\n title: a\n }, a)\n}\nR.displayName = \"renderHeader\";\n\nlet EmojiFilterModule = BDModules.get(e => e.default && e.default.isEmojiDisabled)[0]\nlet isEmojiDisabled = EmojiFilterModule && EmojiFilterModule.default.isEmojiDisabled\nlet isUsable = false\nlet hasPatched = false\n\nfunction setEmojiUsable(usable){\n isUsable = usable\n if(hasPatched)return\n if(!EmojiFilterModule)EmojiFilterModule = BDModules.get(e => e.default && e.default.isEmojiDisabled)[0]\n if(!EmojiFilterModule)return\n if(!isEmojiDisabled)isEmojiDisabled = EmojiFilterModule.default.isEmojiDisabled\n\n hasPatched = true\n EmojiFilterModule.default.isEmojiDisabled = function(emoji){\n if(isUsable){\n if(emoji.surrogates || emoji.diversity)return true\n return false\n }\n return isEmojiDisabled.call(this, ...arguments)\n }\n}","import {bdConfig, minSupportedVersion, bbdVersion, settingsCookie, bdpluginErrors, bdthemeErrors, bbdChangelog, defaultCookie, currentDiscordVersion, defaultRPC, settingsRPC, lightcordSettings} from \"../0globals\";\nimport Utils from \"./utils\";\n\nimport BDV2 from \"./v2\";\nimport settingsPanel from \"./settingsPanel\";\nimport pluginModule from \"./pluginModule\";\nimport themeModule from \"./themeModule\";\nimport DataStore from \"./dataStore\";\nimport WebpackModules from \"./webpackModules\";\nimport DOM from \"./domtools\";\n\nimport BDLogo from \"../ui/bdLogo\";\nimport TooltipWrap from \"../ui/tooltipWrap\";\nimport LightcordLogo from \"../svg/Lightcord\";\nimport PluginCertifier from \"./pluginCertifier\";\nimport distant, { uuidv4 } from \"./distant\";\nimport EmojiModule from \"./emojiModule\"\nimport {remote as electron} from \"electron\"\nimport v2 from \"./v2\";\nimport contentManager from \"./contentManager\";\n\nlet methods\nfunction Core() {}\n\n\nCore.prototype.setConfig = function(config) {\n if (this.hasStarted) return;\n Object.assign(bdConfig, config);\n};\n\nObject.defineProperty(Core.prototype, \"methods\", {\n get(){\n return methods\n }\n})\n\nCore.prototype.setMethods = function(m) {\n if (this.hasStarted) return;\n methods = m\n};\n\nCore.prototype.init = async function() {\n if (this.hasStarted) return;\n this.hasStarted = true;\n\n if (!Array.prototype.flat) {\n Utils.alert(\"Not Supported\", \"BetterDiscord v\" + bbdVersion + \" does not support this old version (\" + currentDiscordVersion + \") of Discord. Please update your Discord installation before proceeding.\");\n return;\n }\n\n if (bdConfig.version < minSupportedVersion) {\n Utils.alert(\"Not Supported\", \"BetterDiscord v\" + bdConfig.version + \" (your version)\" + \" is not supported by the latest js (\" + bbdVersion + \").<br><br> Please download the latest version from <a href='https://github.com/rauenzi/BetterDiscordApp/releases/latest' target='_blank'>GitHub</a>\");\n return;\n }\n\n if (window.ED) {\n Utils.alert(\"Not Supported\", \"BandagedBD does not work with EnhancedDiscord. Please uninstall one of them.\");\n return;\n }\n\n if (window.WebSocket && window.WebSocket.name && window.WebSocket.name.includes(\"Patched\")) {\n Utils.alert(\"Not Supported\", \"BandagedBD does not work with Powercord. Please uninstall one of them.\");\n return;\n }\n\n Utils.suppressErrors(this.patchAttributes.bind(this), \"LC Plugin Certifier Patch\")();\n\n Utils.log(\"Startup\", \"Initializing Settings\");\n this.initSettings();\n\n await this.checkForGuilds();\n BDV2.initialize();\n Utils.log(\"Startup\", \"Updating Settings\");\n settingsPanel.initializeSettings();\n\n Utils.log(\"Startup\", \"Loading Addons Cache\")\n await contentManager.loadAddonCertifierCache()\n\n Utils.log(\"Startup\", \"Loading Plugins\");\n await pluginModule.loadPlugins();\n\n Utils.log(\"Startup\", \"Loading Themes\");\n await themeModule.loadThemes();\n\n DOM.addStyle(\"customcss\", Buffer.from(DataStore.getBDData(\"bdcustomcss\"), \"base64\").toString(\"utf8\"));\n\n window.addEventListener(\"beforeunload\", function() {\n if (settingsCookie[\"bda-dc-0\"]) document.querySelector(\".btn.btn-disconnect\").click();\n });\n\n PluginCertifier.start()\n\n Utils.log(\"Startup\", \"Removing Loading Icon\");\n if (document.getElementsByClassName(\"bd-loaderv2\").length) document.getElementsByClassName(\"bd-loaderv2\")[0].remove();\n Utils.log(\"Startup\", \"Initializing Main Observer\");\n this.initObserver();\n\n // Show loading errors\n if (settingsCookie[\"fork-ps-1\"]) {\n Utils.log(\"Startup\", \"Collecting Startup Errors\");\n Utils.showContentErrors({plugins: bdpluginErrors, themes: bdthemeErrors});\n }\n\n const previousVersion = DataStore.getBDData(\"version\");\n if (bbdVersion > previousVersion) {\n if (bbdChangelog) this.showChangelogModal(bbdChangelog);\n DataStore.setBDData(\"version\", bbdVersion);\n }\n\n EmojiModule.start()\n\n Utils.suppressErrors(this.patchSocial.bind(this), \"BD Social Patch\")();\n Utils.suppressErrors(this.patchGuildPills.bind(this), \"BD Guild Pills Patch\")();\n Utils.suppressErrors(this.patchGuildListItems.bind(this), \"BD Guild List Items Patch\")();\n Utils.suppressErrors(this.patchGuildSeparator.bind(this), \"BD Guild Separator Patch\")();\n Utils.suppressErrors(this.patchMessageHeader.bind(this), \"BD Badge Chat Patch\")();\n Utils.suppressErrors(this.patchMemberList.bind(this), \"BD Badge Member List Patch\")();\n Utils.suppressErrors(this.patchAttachment.bind(this), \"LC Plugin Certifier Patch\")();\n\n if(bdConfig.haveInstalledDefault){\n let alert = Utils.alert(\"First Installation\", \"As it is the first time you install Lightcord, We added two default themes and one default plugin in your plugin/theme folder. Check it in the Plugin/Theme settings.\")\n await new Promise((resolve) => {\n alert.onClose(resolve)\n })\n }\n const logo = document.querySelector(\"#app-mount > div.typeWindows-1za-n7.withFrame-haYltI.titleBar-AC4pGV.horizontalReverse-3tRjY7.flex-1O1GKY.directionRowReverse-m8IjIq.justifyStart-2NDFzi.alignStretch-DpGPf3.da-typeWindows.da-withFrame.da-titleBar.da-horizontalReverse.da-flex.da-directionRowReverse.da-justifyStart.da-alignStretch > div.wordmarkWindows-1v0lYD.wordmark-2iDDfm.da-wordmarkWindows.da-wordmark\")\n if(logo){\n logo.style.top = \"3px\"\n logo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"10\" width=\"70\" viewBox=\"0 0 72.54 10\" style=\"margin-left: -5px, margin-top: 10px\">\n <path fill=\"currentColor\" d=\"M44.81,9.67V6.33c0-1.21,2.13-1.49,2.78-.28l2-.81A3.53,3.53,0,0,0,46.2,3c-1.92,0-3.81,1.13-3.81,3.33V9.67c0,2.21,1.89,3.33,3.77,3.33a3.87,3.87,0,0,0,3.45-2.18l-2.12-1C47,11.17,44.81,10.85,44.81,9.67ZM10.68,12.89h2.41V3.17H10.68ZM71.76,3.14H68.19V7.23L70.57,9.4v-4h1.27c.81,0,1.21.41,1.21,1v3c0,.63-.38,1.05-1.21,1.05H68.18v2.31h3.57c1.92,0,3.72-1,3.72-3.2V6.39C75.48,4.13,73.68,3.14,71.76,3.14ZM54.22,3c-2,0-4,1.1-4,3.34V9.66c0,2.23,2,3.34,4,3.34s3.95-1.11,3.95-3.34V6.34C58.19,4.11,56.2,3,54.22,3Zm1.55,6.66c0,.7-.78,1.06-1.54,1.06s-1.55-.35-1.55-1.06V6.34c0-.72.75-1.1,1.5-1.1s1.59.35,1.59,1.1ZM66.84,6.34c0-2.29-1.58-3.2-3.55-3.2H59.46v9.73h2.45V9.77h.43l2.22,3.09h3L65,9.52C66.13,9.15,66.84,8.14,66.84,6.34ZM63.33,7.65H61.91V5.43h1.42A1.11,1.11,0,1,1,63.33,7.65ZM29.83,13h2.42V3.06H29.83V6.73l-3,0V3.09H24.7v9.78h2.14V8.68l3,0ZM17.16,9.76V6.42c0-1.21,2.13-1.49,2.78-.28l2-.81a3.55,3.55,0,0,0-3.36-2.24c-1.92,0-3.81,1.13-3.81,3.33V9.76c0,2.21,2,3.15,3.9,3.15s3.58-1,3.58-3V7.58H18.79l0,1.36H20.3v.77C20.3,10.92,17.16,10.94,17.16,9.76Z\" transform=\"translate(-2.93 -3)\"/>\n <polygon fill=\"currentColor\" points=\"35.91 0.06 38.43 0.06 38.43 1.84 35.92 1.81 35.97 10 33.55 10 33.49 1.75 30.98 1.74 30.98 0.06 33.49 0.06 35.91 0.06\"/>\n <polygon fill=\"currentColor\" points=\"0 9.97 6.5 10 6.5 7.63 2.41 7.63 2.41 0.26 0 2.26 0 9.97\"/>\n</svg>`\n }\n};\n\nCore.prototype.patchAttributes = async function() {\n let attribsPatchs = []\n this.cancelPatchAttributes = function() {\n attribsPatchs.forEach(e => e())\n }\n\n while(!v2.MessageComponent)await new Promise(resolve => setTimeout(resolve, 100))\n \n // TODO: try to patch correctly the user popout on a next update\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"DiscordTag\")\n .then(DiscordTag => {\n let DiscordTagComp = DiscordTag.default\n DiscordTag.default = function(props){\n let returnValue = DiscordTagComp(props)\n\n let id = uuidv4()\n\n let badgeDiv = BDV2.React.createElement(\"div\", {\n style: {\n display: \"inline\",\n marginTop: \"5px\"\n }\n }, BDV2.React.createElement(\"span\", {\n id: \"badges-\"+id,\n key: \"badges-\"+id,\n style: {\n display: \"inherit\"\n }\n }))\n\n let children = [returnValue]\n\n if (props.user.id === \"249746236008169473\") { // Rauenzi: BandagedBD Developer\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n } else if (props.user.id === \"696481194443014174\" || props.user.id === \"696003456611385396\"){ // Not Thomiz: Lightcord Developer, Phorcys: Lightcord Developer\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n }\n\n children.push(badgeDiv)\n let div = BDV2.React.createElement(\"div\", {\n style: {\n display: \"block\"\n }\n }, children)\n applyBadges(id, props.user, false)\n\n return div\n }\n DiscordTag.default.displayName = DiscordTagComp.displayName\n })\n\n attribsPatchs.push(Utils.monkeyPatch(v2.MessageComponent, \"default\", {after: (data) => {\n if(data.methodArguments[0].childrenMessageContent.props.message){ // this can be a blocked message (not opened)\n data.returnValue.props[\"data-message-id\"] = data.methodArguments[0].childrenMessageContent.props.message.id\n }\n }}))\n /*\n attribsPatchs.push(Utils.monkeyPatch(v2.MessageComponent, \"default\", {after: (data) => {\n data.returnValue.props[\"message-id\"] = data.methodArguments[0].childrenMessageContent.props.message.id\n }}))*/\n}\n\nCore.prototype.checkForGuilds = function() {\n let timesChecked = 0;\n return new Promise(resolve => {\n const checkForGuilds = function() {\n const wrapper = BDV2.guildClasses.wrapper.split(\" \")[0];\n if (document.querySelectorAll(`.${wrapper}`).length > 0) timesChecked++;\n const guild = BDV2.guildClasses.listItem.split(\" \")[0];\n const blob = BDV2.guildClasses.blobContainer.split(\" \")[0];\n if (document.querySelectorAll(`.${wrapper} .${guild} .${blob}`).length > 0) return resolve(bdConfig.deferLoaded = true);\n else if (timesChecked >= 50) return resolve(bdConfig.deferLoaded = true);\n setTimeout(checkForGuilds, 100);\n };\n if (document.readyState != \"loading\") setTimeout(checkForGuilds, 100);\n document.addEventListener(\"DOMContentLoaded\", () => {setTimeout(checkForGuilds, 100);});\n });\n};\n\nCore.prototype.injectExternals = async function() {\n // No externals\n};\n\nCore.prototype.initSettings = function () {\n DataStore.initialize();\n if(!DataStore.getSettingGroup(\"lightcord-settings\")){\n for(let key in lightcordSettings){\n delete lightcordSettings[key]\n }\n }\n if(!DataStore.getSettingGroup(\"rpc\")){\n Object.assign(settingsRPC, defaultRPC);\n }\n if(!DataStore.getSettingGroup(\"settings\")){\n Object.assign(settingsCookie, defaultCookie);\n settingsPanel.saveSettings();\n } else {\n settingsPanel.loadSettings();\n for (const setting in defaultCookie) {\n if (settingsCookie[setting] == undefined) {\n settingsCookie[setting] = defaultCookie[setting];\n settingsPanel.saveSettings();\n }\n }\n }\n window.Lightcord.Api.ensureExported(e => e.default && e.default.prototype && e.default.prototype.getPredicateSections)\n .then(settingModule => {\n\n let getPredicateSections = settingModule.default.prototype.getPredicateSections\n settingModule.default.prototype.getPredicateSections = function(){\n let result = getPredicateSections.call(this, ...arguments)\n\n if(!result[1])return result\n if(result[1].section === \"My Account\"){ // user settings, not guild settings\n let poped = []\n \n poped.push(result.pop())\n poped.push(result.pop())\n poped.push(result.pop())\n poped.push(result.pop())\n\n result.push(...settingsPanel.renderSidebar(this))\n\n while(poped[0]){\n result.push(poped.pop())\n }\n }\n console.log(result)\n return result\n }\n })\n};\n\n\nlet classNameLayer\nlet classNameSocialLinks\nlet classNameModal\n\nCore.prototype.initObserver = function () {\n const mainObserver = new MutationObserver((mutations) => {\n for (let i = 0, mlen = mutations.length; i < mlen; i++) {\n const mutation = mutations[i];\n if (typeof pluginModule !== \"undefined\") pluginModule.rawObserver(mutation);\n\n // if there was nothing added, skip\n if (!mutation.addedNodes.length || !(mutation.addedNodes[0] instanceof Element)) continue;\n\n const node = mutation.addedNodes[0];\n\n if(!classNameLayer)classNameLayer = BDModules.get((e) => e.layer && typeof e.layer === \"string\" && e.animating)[0].layer\n if(!classNameSocialLinks)classNameSocialLinks = BDModules.get((e) => e.socialLinks && typeof e.socialLinks === \"string\")[0].socialLinks\n if(!classNameModal)classNameModal = BDModules.get((e) => e.modal && typeof e.modal === \"string\" && e.inner && typeof e.inner === \"string\" && !e.responsiveWidthMobile)[0].modal\n\n if (node.classList.contains(classNameLayer)) {\n if (node.getAttribute(\"aria-label\") === \"GUILD_SETTINGS\"){\n node.setAttribute(\"layer-id\", \"server-settings\");\n node.setAttribute(\"id\", \"server-settings\");\n }\n\n if (node.getElementsByClassName(classNameSocialLinks).length) {\n node.setAttribute(\"layer-id\", \"user-settings\");\n node.setAttribute(\"id\", \"user-settings\");\n }\n }\n\n if (node.parentElement == document.body && node.querySelector(\"#ace_settingsmenu\")) node.id = \"ace_settingsmenu_container\";\n\n // Emoji Picker\n //node.getElementsByClassName(\"emojiPicker-3m1S-j\").length && !node.querySelector(\".emojiPicker-3m1S-j\").parentElement.classList.contains(\"animatorLeft-1EQxU0\")\n //if (node.classList.contains(classNameLayer2) && node.getElementsByClassName(classNameEmojiPicker).length && !node.querySelector(\".\"+classNameEmojiPicker).parentElement.classList.contains(classNameAnimatorLeft)) quickEmoteMenu.obsCallback(node);\n\n }\n });\n\n mainObserver.observe(document, {\n childList: true,\n subtree: true\n });\n};\n\nCore.prototype.showChangelogModal = function(options = {}) {\n return Utils.showChangelogModal(options);\n};\n\nCore.prototype.alert = function(title, content) {\n return Utils.alert(title, content);\n};\n\nCore.prototype.patchSocial = function() {\n if (this.socialPatch) return;\n const TabBar = WebpackModules.find(m => m.displayName == \"TabBar\");\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n if (!TabBar) return;\n this.socialPatch = Utils.monkeyPatch(TabBar.prototype, \"render\", {after: (data) => {\n const children = data.returnValue.props.children;\n if (!children || !children.length || children.length < 3) return;\n if (children[children.length - 3].type.displayName !== \"Separator\") return;\n if (!children[children.length - 2].type.toString().includes(\"socialLinks\")) return;\n if (Anchor) {\n let socialModule1 = BDModules.get(e => e.socialLinks)[0]\n const original = children[children.length - 2].type;\n const newOne = function() {\n const returnVal = original(...arguments);\n returnVal.props.children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord\"},\n BDV2.React.createElement(Anchor, {className: \"bd-social-link \"+socialModule1.link, href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-social-logo\"})\n )\n )\n );\n returnVal.props.children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD\"},\n BDV2.React.createElement(Anchor, {className: \"bd-social-link \"+socialModule1.link, href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-social-logo\"})\n )\n )\n );\n return returnVal;\n };\n children[children.length - 2].type = newOne;\n }\n\n let [\n classNameColorMuted,\n sizes,\n classNameVersionHash\n ] = [\n BDModules.get(e => e.colorMuted)[0].colorMuted,\n BDModules.get(e => e.size32)[0],\n BDModules.get(e => e.versionHash)[0].versionHash\n ]\n\n const versionHash = `(${bdConfig.hash ? bdConfig.hash.substring(0, 7) : bdConfig.branch})`;\n const additional = [\n BDV2.react.createElement(\"div\", {className: `${classNameColorMuted} ${sizes.size12}`}, `Lightcord ${electron.getGlobal(\"BuildInfo\").version} `, BDV2.react.createElement(\"span\", {className: classNameVersionHash+\" da-versionHash\"}, `(${(electron.getGlobal(\"BuildInfo\").commit || \"Unknown\").slice(0, 7)})`)),\n BDV2.react.createElement(\"div\", {className: `${classNameColorMuted} ${sizes.size12}`}, `BBD ${bbdVersion} `, BDV2.react.createElement(\"span\", {className: classNameVersionHash+\" da-versionHash\"}, versionHash))\n ]\n \n\n const originalVersions = children[children.length - 1].type;\n children[children.length - 1].type = function() {\n const returnVal = originalVersions(...arguments);\n returnVal.props.children.splice(1, 0, additional);\n return returnVal;\n };\n }});\n};\n\nconst getGuildClasses = function() {\n const guildsWrapper = WebpackModules.findByProps(\"wrapper\", \"unreadMentionsBar\");\n const guilds = WebpackModules.findByProps(\"guildsError\", \"selected\");\n const pill = WebpackModules.findByProps(\"blobContainer\");\n return Object.assign({}, guildsWrapper, guilds, pill);\n};\n\nCore.prototype.patchGuildListItems = function() {\n if (this.guildListItemsPatch) return;\n const GuildClasses = getGuildClasses();\n const listItemClass = GuildClasses.listItem.split(\" \")[0];\n const blobClass = GuildClasses.blobContainer.split(\" \")[0];\n const reactInstance = BDV2.getInternalInstance(document.querySelector(`.${listItemClass} .${blobClass}`).parentElement);\n const GuildComponent = reactInstance.return.type;\n if (!GuildComponent) return;\n this.guildListItemsPatch = Utils.monkeyPatch(GuildComponent.prototype, \"render\", {after: (data) => {\n if (data.returnValue && data.thisObject) {\n const returnValue = data.returnValue;\n const guildData = data.thisObject.props;\n let className = returnValue.props.className\n className += \" bd-guild\";\n if (guildData.unread) className += \" bd-unread\";\n if (guildData.selected) className += \" bd-selected\";\n if (guildData.audio) className += \" bd-audio\";\n if (guildData.video) className += \" bd-video\";\n if (guildData.badge) className += \" bd-badge\";\n if (guildData.animatable) className += \" bd-animatable\";\n returnValue.props.className = className\n return returnValue;\n }\n }});\n};\n\nCore.prototype.patchGuildPills = function() {\n if (this.guildPillPatch) return;\n const guildPill = WebpackModules.find(m => m.default && !m.default.displayName && m.default.toString && m.default.toString().includes(\"translate3d\"));\n if (!guildPill) return;\n this.guildPillPatch = Utils.monkeyPatch(guildPill, \"default\", {after: (data) => {\n const props = data.methodArguments[0];\n if (props.unread) data.returnValue.props.className += \" bd-unread\";\n if (props.selected) data.returnValue.props.className += \" bd-selected\";\n if (props.hovered) data.returnValue.props.className += \" bd-hovered\";\n return data.returnValue;\n }});\n};\n\nCore.prototype.patchGuildSeparator = function() {\n if (this.guildSeparatorPatch) return;\n const Guilds = WebpackModules.findByDisplayName(\"Guilds\");\n const guildComponents = WebpackModules.findByProps(\"renderListItem\");\n if (!guildComponents || !Guilds) return;\n const GuildSeparator = function() {\n const returnValue = guildComponents.Separator(...arguments);\n returnValue.props.className += \" bd-guild-separator\";\n return returnValue;\n };\n this.guildSeparatorPatch = Utils.monkeyPatch(Guilds.prototype, \"render\", {after: (data) => {\n data.returnValue.props.children[1].props.children[3].type = GuildSeparator;\n }});\n};\n\nCore.prototype.patchAttachment = function() {\n if (this.AttachmentPatch) return;\n const Attachment = BDModules.get(e => e.default && e.default.displayName === \"Attachment\")[0] // temporary\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n if (!Anchor || !Attachment || !Attachment.default) return;\n this.AttachmentPatch = Utils.monkeyPatch(Attachment, \"default\", {after: (data) => {\n if(!settingsCookie[\"fork-ps-6\"])return\n const attachment = data.methodArguments[0] || null\n const children = Utils.getNestedProp(data.returnValue, \"props.children\");\n\n if (!children || !attachment || !attachment.url)return\n if (!Array.isArray(children)) return;\n\n const id = uuidv4()\n children.push(BDV2.react.createElement(\"span\", {\n id: \"certified-\"+id\n }))\n PluginCertifier.patch(attachment, \"certified-\"+id)\n }})\n}\n\nCore.prototype.patchMessageHeader = function() {\n if (this.messageHeaderPatch) return;\n const MessageHeader = WebpackModules.findByProps(\"MessageTimestamp\");\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n if (!Anchor || !MessageHeader || !MessageHeader.default) return;\n this.messageHeaderPatch = Utils.monkeyPatch(MessageHeader, \"default\", {after: (data) => {\n const author = Utils.getNestedProp(data.methodArguments[0], \"message.author\");\n // const header = Utils.getNestedProp(data.returnValue, \"props.children.1.props\");\n const children = Utils.getNestedProp(data.returnValue, \"props.children.1.props.children.1.props.children\");\n if (!children || !author || !author.id)return\n // if (header && header.className) header.className += \" \"\n if (!Array.isArray(children)) return;\n if (author.id === \"249746236008169473\") { // Rauenzi: BandagedBD Developer\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n } else if (author.id === \"696481194443014174\" || author.id === \"696003456611385396\"){ // Not Thomiz: Lightcord Developer, Phorcys: Lightcord Developer\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n }\n const id = uuidv4()\n children.push(\n BDV2.React.createElement(\"div\", {\n id: \"badges-\"+id,\n style: {\n display: \"inline\"\n }\n })\n )\n applyBadges(id, author, true)\n }});\n};\n\nfunction applyBadges(id, user, chat){\n process.nextTick(() => {\n const div = document.getElementById(\"badges-\"+id)\n if(!div || div.childNodes.length > 0)return\n if(div.childNodes.length)return\n let blockDiv = document.createElement(\"div\")\n blockDiv.style.display = \"none\"\n div.appendChild(blockDiv)\n\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n\n distant.getBadges(user.id)\n .then(badges => {\n badges.forEach(badge => {\n const props = {\n svg: {\n size: \"16px\", \n className: \"bd-logo\",\n width: \"16px\", \n }\n }\n badge.scopes.forEach(scope => {\n if(scope === \"user\"){// require user\n props.user = user\n }\n }) \n if(!badge.href){\n props.Anchor = Anchor\n props.href = {\n className: chat ? \"bd-chat-badge\" : \"bd-member-badge\", \n title: badge.name, \n target: \"_blank\"\n }\n }\n const element = BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: badge.name},\n badge.href ? BDV2.react.createElement(Anchor, {\n href: badge.href,\n className: chat ? \"bd-chat-badge\" : \"bd-member-badge\", \n title: badge.name, \n target: \"_blank\"\n }, BDV2.React.createElement(badge.component, props)) : BDV2.React.createElement(badge.component, props)\n )\n const div2 = document.createElement(\"div\")\n BDV2.reactDom.render(element, div2)\n div2.childNodes.forEach(node => {\n div.appendChild(node)\n })\n })\n })\n })\n}\n\nCore.prototype.patchMemberList = function() {\n if (this.memberListPatch) return;\n const MemberListItem = WebpackModules.findByDisplayName(\"MemberListItem\");\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n if (!Anchor || !MemberListItem || !MemberListItem.prototype || !MemberListItem.prototype.renderDecorators) return;\n this.memberListPatch = Utils.monkeyPatch(MemberListItem.prototype, \"renderDecorators\", {after: (data) => {\n const user = Utils.getNestedProp(data.thisObject, \"props.user\");\n const children = Utils.getNestedProp(data.returnValue, \"props.children\");\n if (!children || !user || !user.id)return\n // if (header && header.className) header.className += \" \"\n if (!Array.isArray(children)) return;\n if (user.id === \"249746236008169473\") {\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-member-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n } else if (user.id === \"696481194443014174\" || user.id === \"696003456611385396\"){\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-member-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n }\n const id = uuidv4()\n children.push(\n BDV2.React.createElement(\"div\", {id: \"badges-\"+id})\n )\n applyBadges(id, user, false)\n }});\n};\n\nCore.prototype.updateInjector = async function() {\n // There will never be an injection path, so we do not need the code below. \n // Insert comments so it will be erased when production.\n \n const injectionPath = DataStore.injectionPath;\n if (!injectionPath) return false;\n\n /*\n\n const fs = require(\"fs\");\n const path = require(\"path\");\n const rmrf = require(\"rimraf\");\n const yauzl = require(\"yauzl\");\n const mkdirp = require(\"mkdirp\");\n const request = require(\"request\");\n\n const parentPath = path.resolve(injectionPath, \"..\");\n const folderName = path.basename(injectionPath);\n const zipLink = \"https://github.com/rauenzi/BetterDiscordApp/archive/injector.zip\";\n const savedZip = path.resolve(parentPath, \"injector.zip\");\n const extractedFolder = path.resolve(parentPath, \"BetterDiscordApp-injector\");\n\n // Download the injector zip file\n Utils.log(\"InjectorUpdate\", \"Downloading \" + zipLink);\n let success = await new Promise(resolve => {\n request.get({url: zipLink, encoding: null}, async (error, response, body) => {\n if (error || response.statusCode !== 200) return resolve(false);\n // Save a backup in case someone has their own copy\n const alreadyExists = await new Promise(res => fs.exists(savedZip, res));\n if (alreadyExists) await new Promise(res => fs.rename(savedZip, `${savedZip}.bak${Math.round(performance.now())}`, res));\n\n Utils.log(\"InjectorUpdate\", \"Writing \" + savedZip);\n fs.writeFile(savedZip, body, err => resolve(!err));\n });\n });\n if (!success) return success;\n\n // Check and delete rename extraction\n const alreadyExists = await new Promise(res => fs.exists(extractedFolder, res));\n if (alreadyExists) await new Promise(res => fs.rename(extractedFolder, `${extractedFolder}.bak${Math.round(performance.now())}`, res));\n \n // Unzip the downloaded zip file\n const zipfile = await new Promise(r => yauzl.open(savedZip, {lazyEntries: true}, (err, zip) => r(zip)));\n zipfile.on(\"entry\", function(entry) {\n // Skip directories, they are handled with mkdirp\n if (entry.fileName.endsWith(\"/\")) return zipfile.readEntry();\n\n Utils.log(\"InjectorUpdate\", \"Extracting \" + entry.fileName);\n // Make any needed parent directories\n const fullPath = path.resolve(parentPath, entry.fileName);\n mkdirp.sync(path.dirname(fullPath));\n zipfile.openReadStream(entry, function(err, readStream) {\n if (err) return success = false;\n readStream.on(\"end\", function() {zipfile.readEntry();}); // Go to next file after this\n readStream.pipe(fs.createWriteStream(fullPath));\n });\n });\n zipfile.readEntry(); // Start reading\n\n // Wait for the final file to finish\n await new Promise(resolve => zipfile.once(\"end\", resolve));\n\n // Save a backup in case something goes wrong during final step\n const backupFolder = path.resolve(parentPath, `${folderName}.bak${Math.round(performance.now())}`);\n await new Promise(resolve => fs.rename(injectionPath, backupFolder, resolve));\n\n // Rename the extracted folder to what it should be\n Utils.log(\"InjectorUpdate\", `Renaming ${path.basename(extractedFolder)} to ${folderName}`);\n success = await new Promise(resolve => fs.rename(extractedFolder, injectionPath, err => resolve(!err)));\n if (!success) {\n Utils.err(\"InjectorUpdate\", \"Failed to rename the final directory\");\n return success;\n }\n\n // If rename had issues, delete what we tried to rename and restore backup\n if (!success) {\n Utils.err(\"InjectorUpdate\", \"Something went wrong... restoring backups.\");\n await new Promise(resolve => rmrf(extractedFolder, resolve));\n await new Promise(resolve => fs.rename(backupFolder, injectionPath, resolve));\n return success;\n }\n\n // If we've gotten to this point, everything should have gone smoothly.\n // Cleanup the backup folder then remove the zip\n await new Promise(resolve => rmrf(backupFolder, resolve));\n await new Promise(resolve => fs.unlink(savedZip, resolve));\n\n Utils.log(\"InjectorUpdate\", \"Injector Updated!\");\n return success;*/\n};\n\nexport default new Core();\n\n/**\n * Don't expose core - could be dangerous for now\n */","import {pluginCookie, themeCookie, bdplugins, bdthemes, settingsCookie, settings} from \"../0globals\";\nimport mainCore from \"./core\";\nimport Utils from \"./utils\";\nimport BDV2 from \"./v2\";\nimport DataStore from \"./dataStore\";\nimport pluginModule from \"./pluginModule\";\nimport themeModule from \"./themeModule\";\nimport settingsPanel from \"./settingsPanel\";\nimport DOM from \"./domtools\";\n\nconst BdApi = {\n get React() { return BDV2.React; },\n get ReactDOM() { return BDV2.ReactDom; },\n get ReactComponent() {return BDV2.ReactComponent;},\n get WindowConfigFile() {return Utils.WindowConfigFile;},\n get settings() {return settings;},\n get emotes() {return null}, // deprecated, deleted all emotes from betterdiscord.\n get screenWidth() { return Math.max(document.documentElement.clientWidth, window.innerWidth || 0); },\n get screenHeight() { return Math.max(document.documentElement.clientHeight, window.innerHeight || 0); }\n};\n\nBdApi.getAllWindowPreferences = function() {\n return Utils.getAllWindowPreferences();\n};\n\nBdApi.getWindowPreference = function(key) {\n return Utils.getWindowPreference(key);\n};\n\nBdApi.setWindowPreference = function(key, value) {\n return Utils.setWindowPreference(key, value);\n};\n\n//Inject CSS to document head\n//id = id of element\n//css = custom css\nBdApi.injectCSS = function (id, css) {\n DOM.addStyle(DOM.escapeID(id), css);\n};\n\n//Clear css/remove any element\n//id = id of element\nBdApi.clearCSS = function (id) {\n DOM.removeStyle(DOM.escapeID(id));\n};\n\n//Inject CSS to document head\n//id = id of element\n//css = custom css\nBdApi.linkJS = function (id, url) {\n DOM.addScript(DOM.escapeID(id), url);\n};\n\n//Clear css/remove any element\n//id = id of element\nBdApi.unlinkJS = function (id) {\n DOM.removeScript(DOM.escapeID(id));\n};\n\n//Get another plugin\n//name = name of plugin\nBdApi.getPlugin = function (name) {\n if (bdplugins.hasOwnProperty(name)) {\n return bdplugins[name].plugin;\n }\n return null;\n};\n\n//Get BetterDiscord Core\nBdApi.getCore = function () {\n Utils.warn(\"Deprecation Notice\", `BdApi.getCore() will be removed in future versions.`);\n return mainCore;\n};\n\n/**\n * Shows a generic but very customizable modal.\n * @param {string} title - title of the modal\n * @param {string} content - a string of text to display in the modal\n */\nBdApi.alert = function (title, content) {\n return Utils.showConfirmationModal(title, content, {cancelText: null});\n};\n\n/**\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\n * @param {string} title - title of the modal\n * @param {(string|ReactElement|Array<string|ReactElement>)} children - a single or mixed array of react elements and strings. Every string is wrapped in Discord's `Markdown` component so strings will show and render properly.\n * @param {object} [options] - options to modify the modal\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\n * @param {string} [options.key] - key used to identify the modal. If not provided, one is generated and returned\n * @returns {string} - the key used for this modal\n */\nBdApi.showConfirmationModal = function (title, content, options = {}) {\n return Utils.showConfirmationModal(title, content, options);\n};\n\n//Show toast alert\nBdApi.showToast = function(content, options = {}) {\n Utils.showToast(content, options);\n};\n\n// Finds module\nBdApi.findModule = function(filter) {\n return BDV2.WebpackModules.find(filter);\n};\n\n// Finds module\nBdApi.findAllModules = function(filter) {\n return BDV2.WebpackModules.findAll(filter);\n};\n\n// Finds module\nBdApi.findModuleByProps = function(...props) {\n return BDV2.WebpackModules.findByUniqueProperties(props);\n};\n\nBdApi.findModuleByPrototypes = function(...protos) {\n return BDV2.WebpackModules.findByPrototypes(protos);\n};\n\nBdApi.findModuleByDisplayName = function(name) {\n return BDV2.WebpackModules.findByDisplayName(name);\n};\n\n// Gets react instance\nBdApi.getInternalInstance = function(node) {\n if (!(node instanceof window.jQuery) && !(node instanceof Element)) return undefined;\n if (node instanceof jQuery) node = node[0];\n return BDV2.getInternalInstance(node);\n};\n\n// Gets data\nBdApi.loadData = function(pluginName, key) {\n return DataStore.getPluginData(pluginName, key);\n};\n\nBdApi.getData = BdApi.loadData;\n\n// Sets data\nBdApi.saveData = function(pluginName, key, data) {\n return DataStore.setPluginData(pluginName, key, data);\n};\n\nBdApi.setData = BdApi.saveData;\n\n// Deletes data\nBdApi.deleteData = function(pluginName, key) {\n return DataStore.deletePluginData(pluginName, key);\n};\n\n// Patches other functions\nBdApi.monkeyPatch = function(what, methodName, options) {\n return Utils.monkeyPatch(what, methodName, options);\n};\n\n// Event when element is removed\nBdApi.onRemoved = function(node, callback) {\n return Utils.onRemoved(node, callback);\n};\n\n// Wraps function in try..catch\nBdApi.suppressErrors = function(method, message) {\n return Utils.suppressErrors(method, message);\n};\n\n// Tests for valid JSON\nBdApi.testJSON = function(data) {\n return Utils.testJSON(data);\n};\n\nBdApi.isPluginEnabled = function(name) {\n return !!pluginCookie[name];\n};\n\nBdApi.isThemeEnabled = function(name) {\n return !!themeCookie[name];\n};\n\nBdApi.isSettingEnabled = function(id) {\n return !!settingsCookie[id];\n};\n\nBdApi.enableSetting = function(id) {\n return settingsPanel.onChange(id, true);\n};\n\nBdApi.disableSetting = function(id) {\n return settingsPanel.onChange(id, false);\n};\n\nBdApi.toggleSetting = function(id) {\n return settingsPanel.onChange(id, !settingsCookie[id]);\n};\n\n// Gets data\nBdApi.getBDData = function(key) {\n return DataStore.getBDData(key);\n};\n\n// Sets data\nBdApi.setBDData = function(key, data) {\n return DataStore.setBDData(key, data);\n};\n\n\n\nconst makeAddonAPI = (cookie, list, manager) => new class AddonAPI {\n\n get folder() {return manager.folder;}\n\n isEnabled(name) {\n return !!cookie[name];\n }\n\n enable(name) {\n return manager.enable(name);\n }\n\n disable(name) {\n return manager.disable(name);\n }\n\n toggle(name) {\n if (cookie[name]) this.disable(name);\n else this.enable(name);\n }\n\n reload(name) {\n return manager.reload(name);\n }\n\n get(name) {\n if (list.hasOwnProperty(name)) {\n if (list[name].plugin) return list[name].plugin;\n return list[name];\n }\n return null;\n }\n\n getAll() {\n return Object.keys(list).map(k => this.get(k)).filter(a => a);\n }\n};\n\nBdApi.Plugins = makeAddonAPI(pluginCookie, bdplugins, pluginModule);\nBdApi.Themes = makeAddonAPI(themeCookie, bdthemes, themeModule);\n\nexport default BdApi;\n\nwindow.Lightcord.BetterDiscord.BdApi = BdApi","export default function() {\n const contentWindowGetter = Object.getOwnPropertyDescriptor(HTMLIFrameElement.prototype, \"contentWindow\").get;\n Object.defineProperty(HTMLIFrameElement.prototype, \"contentWindow\", {\n get: function () {\n const contentWindow = Reflect.apply(contentWindowGetter, this, arguments);\n return new Proxy(contentWindow, {\n getOwnPropertyDescriptor: function(obj, prop) {\n if (prop === \"localStorage\") return undefined;\n return Object.getOwnPropertyDescriptor(obj, prop);\n },\n get: function(obj, prop) {\n if (prop === \"localStorage\") return null;\n const val = obj[prop];\n if (typeof val === \"function\") return val.bind(obj);\n return val;\n }\n });\n }\n });\n\n // Prevent interception by patching Reflect.apply and Function.prototype.bind\n Object.defineProperty(Reflect, \"apply\", {value: Reflect.apply, writable: false, configurable: false});\n Object.defineProperty(Function.prototype, \"bind\", {value: Function.prototype.bind, writable: false, configurable: false});\n\n const oOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function() {\n const url = arguments[1];\n if (url.toLowerCase().includes(\"api/webhooks\")) return null;\n return Reflect.apply(oOpen, this, arguments);\n };\n}","import localStorageFix from \"./localStorageFix\";\nimport loadingIcon from \"./loadingIcon\";\nlocalStorageFix();\nloadingIcon();\n\nconst deprecateGlobal = (key, value) => {\n Object.defineProperty(window, key, {\n get() {\n Utils.warn(\"Deprecated Global\", `\"${key}\" will be removed in future versions. Please only use BdApi.`);\n return value;\n }\n }); \n};\n\n\nimport * as Globals from \"./0globals\";\n\nconst globalKeys = Object.keys(Globals);\nfor (const key of globalKeys) deprecateGlobal(key, Globals[key]);\n\n\nimport BdApi from \"./modules/bdApi\";\nimport BDV2 from \"./modules/v2\";\nimport pluginModule from \"./modules/pluginModule\";\nimport themeModule from \"./modules/themeModule\";\nimport Utils from \"./modules/utils\";\nimport BDEvents from \"./modules/bdEvents\";\nimport settingsPanel from \"./modules/settingsPanel\";\nimport DataStore from \"./modules/dataStore\";\nimport ContentManager from \"./modules/contentManager\";\nimport ClassNormalizer from \"./modules/classNormalizer\";\n\ndeprecateGlobal(\"BDV2\", BDV2);\ndeprecateGlobal(\"pluginModule\", pluginModule);\ndeprecateGlobal(\"themeModule\", themeModule);\ndeprecateGlobal(\"Utils\", Utils);\ndeprecateGlobal(\"BDEvents\", BDEvents);\ndeprecateGlobal(\"settingsPanel\", settingsPanel);\ndeprecateGlobal(\"DataStore\", DataStore);\ndeprecateGlobal(\"ContentManager\", ContentManager);\ndeprecateGlobal(\"ClassNormalizer\", ClassNormalizer);\n\nwindow.BdApi = BdApi;\n\nimport Core from \"./modules/core\";\ndeprecateGlobal(\"mainCore\", Core);\n\n// TODO: Change Init mode and stop using CoreWrapper.\nexport default class CoreWrapper {\n constructor(bdConfig, methods) {\n Core.setConfig(bdConfig);\n Core.setMethods(methods);\n }\n\n init() {\n // deprecateGlobal(\"mainCore\", this.mainCore);\n Core.init();\n }\n}","export default () => {\n const v2Loader = document.createElement(\"div\");\n v2Loader.className = \"bd-loaderv2\";\n v2Loader.title = \"BandagedBD is loading...\";\n document.body.appendChild(v2Loader);\n};"],"sourceRoot":""}