diff --git a/server-drawer/install/index.js b/server-drawer/install/index.js index a266e79..3662bf8 100644 --- a/server-drawer/install/index.js +++ b/server-drawer/install/index.js @@ -1 +1 @@ -(function(G,K,f,i,a,n,r,Z,k,Q,$,Je){"use strict";function Xe(e){const t=i.findByProps("useIsMobileQuestDockRendered");if(!t?.useIsMobileQuestDockRendered)return!1;const o=t.useIsMobileQuestDockRendered;return t.useIsMobileQuestDockRendered=function(...s){return o.apply(this,s),!0},e.push(function(){t.useIsMobileQuestDockRendered=o}),!0}function Ye(e){const t=i.findByProps("useIsMobileQuestDockRenderedBase");if(!t?.useIsMobileQuestDockRenderedBase)return!1;const o=t.useIsMobileQuestDockRenderedBase;return t.useIsMobileQuestDockRenderedBase=function(...s){return o.apply(this,s),!0},e.push(function(){t.useIsMobileQuestDockRenderedBase=o}),!0}function Ke(e){const t=i.findByProps("useMobileQuestDock");if(!t?.useMobileQuestDock)return!1;const o=t.useMobileQuestDock;return t.useMobileQuestDock=function(...s){return o.apply(this,s)||{id:"server-drawer",config:{quest_content_type:0,assets:{questBarHeroVideo:null,questBarHero:null},features:[]},userStatus:{enrolledAt:"2099-01-01",claimedAt:null},benefits:{rewards:[]},guildId:"0",tasks:[]}},e.push(function(){t.useMobileQuestDock=o}),!0}const Ze="[ServerDrawer]";function $e(e){const t=i.findByProps("getQuestAsset");if(!t?.getQuestAsset)return console.log(Ze,"WARN: getQuestAsset not found"),!1;const o=t.getQuestAsset;return t.getQuestAsset=function(...s){try{return o.apply(this,s)}catch{return{url:null,isAnimated:!1}}},e.push(function(){t.getQuestAsset=o}),!0}function p(e){let t,o=!1;return function(){if(o)return t;const s=e();return s!=null&&(t=s,o=!0),s??void 0}}const pe=i.findByStoreName("GuildStore"),Ne=i.findByProps("useStateFromStores"),et=i.findByProps("colors","unsafe_rawColors")?.colors;function ye({id:e,size:t=48}){const o=Ne?.useStateFromStores?.([pe],function(){return pe?.getGuild?.(e)},[e])??null;if(!o)return null;const s=t>=40?16:8;return o.icon?n.createElement(r.Image,{source:{uri:`https://cdn.discordapp.com/icons/${o.id}/${o.icon}.png?size=${t*2}`},style:{width:t,height:t,borderRadius:s}}):n.createElement(r.View,{style:[be.fallback,{width:t,height:t,borderRadius:s,backgroundColor:et?.BG_ACCENT??"#5865f2"}]},n.createElement(r.Text,{style:[be.letter,{fontSize:Math.max(10,t*.4)}]},o.name?.split(" ").map(function(l){return l[0]}).join("").slice(0,2).toUpperCase()||"?"))}const be=r.StyleSheet.create({fallback:{alignItems:"center",justifyContent:"center"},letter:{color:"#fff",fontWeight:"700"}}),tt=i.findByStoreName("ThemeStore"),nt=i.find(function(e){return e?.default?.internal?.resolveSemanticColor})?.default?.internal?.resolveSemanticColor??i.find(function(e){return e?.meta?.resolveSemanticColor})?.meta?.resolveSemanticColor??function(){};function rt(e,t=tt?.theme){if(e)try{return nt(t,e)}catch{return}}const me=i.findByProps("TextStyleSheet")?.TextStyleSheet,Se=i.findByProps("triggerHapticFeedback","HapticFeedbackTypes");function M(e,t){return rt(e)??t}const D=12,N=12,Ce=42,ee=220,Ee=4,F=16,v=20,ke={tension:200,friction:20};function ot({visible:e,items:t,title:o,anchorX:s,anchorY:l,onClose:u}){const{width:c,height:y}=r.Dimensions.get("window"),I=(o?N+20+Ee:0)+t.length*Ce;let S=s,b=l+48+10;S+ee>c-D&&(S=c-ee-D),Sy-D&&(b=l-I-10),b0?n.createElement(r.View,{style:T.outline},n.createElement(r.View,{style:T.badge},n.createElement(r.Text,{style:T.text},t>99?"99+":String(t)))):o?n.createElement(r.View,{style:T.dotOutline},n.createElement(r.View,{style:T.dot})):null:null}function Re({node:e,onPick:t}){const o=n.useRef(null),s=n.useRef(new r.Animated.Value(1)).current,l=function(){return r.Animated.spring(s,{toValue:.85,useNativeDriver:!0}).start()},u=function(){return r.Animated.spring(s,{toValue:1,useNativeDriver:!0}).start()},[c,y]=n.useState({visible:!1,items:[],title:"",x:0,y:0}),I=n.useCallback(function(){const E=e.id,d=st?.getGuild?.(E);if(!d)return;const g=o.current;if(!g?.measure)return;const B=[{label:"Mark as Read",action:function(){return ut(E)}},{label:"Copy Server ID",action:function(){a.clipboard.setString(E),k.showToast("Copied server ID",void 0)}}];g.measure(function(x,H,V,ce,Y,P){y({visible:!0,items:B,title:d.name,x:Y,y:P})})},[e.id]),S=n.useCallback(function(){Ie?.triggerHapticFeedback?.(Ie.HapticFeedbackTypes.IMPACT_MEDIUM),I()},[I]),b=e.id;return n.createElement(n.Fragment,null,n.createElement(r.Pressable,{onPressIn:l,onPressOut:u,onPress:function(){return t(b)},onLongPress:S,delayLongPress:500},n.createElement(r.View,{ref:o,style:De.outer,collapsable:!1},n.createElement(r.Animated.View,{style:[De.icon,{transform:[{scale:s}]}]},n.createElement(ye,{id:b})),n.createElement(ct,{guildId:b}))),n.createElement(ot,{visible:c.visible,items:c.items,title:c.title,anchorX:c.x,anchorY:c.y,onClose:function(){return y(function(E){return{...E,visible:!1}})}}))}const De=r.StyleSheet.create({outer:{width:L,height:L},icon:{width:L,height:L,borderRadius:16,overflow:"hidden"}}),T=r.StyleSheet.create({outline:{position:"absolute",bottom:-3,right:-3,minWidth:23,minHeight:23,borderRadius:12,backgroundColor:"#1a1a2e",alignItems:"center",justifyContent:"center"},badge:{minWidth:19,height:19,borderRadius:9,backgroundColor:"#ed4245",alignItems:"center",justifyContent:"center",paddingHorizontal:5},text:{color:"#fff",fontSize:10,fontWeight:"700",lineHeight:19},dotOutline:{position:"absolute",bottom:-2,right:-2,width:14,height:14,borderRadius:7,backgroundColor:"#1a1a2e",alignItems:"center",justifyContent:"center"},dot:{width:10,height:10,borderRadius:5,backgroundColor:"#ed4245"}}),dt=i.findByProps("useStateFromStores");i.findByProps("colors","unsafe_rawColors")?.colors;const Be=i.findByStoreName("ExpandedGuildFolderStore");function ft(e){return dt?.useStateFromStores?.([Be],function(){const t=Be?.getExpandedFolders?.();return t instanceof Set?t.has(e):!1},[e])??!1}const ht=i.findByProps("toggleGuildFolderExpand"),gt=i.findByProps("useStateFromStores"),Pe=i.findByStoreName("GuildReadStateStore"),w=48,re=16,pt=[{top:6,left:6},{top:6,right:6},{bottom:6,left:6},{bottom:6,right:6}],Fe=$.getAssetIDByName("FolderIcon");function Te(e){return e==null?"#5865f2":`#${e.toString(16).padStart(6,"0")}`}function yt({node:e}){const t=gt?.useStateFromStores?.([Pe],function(){let o=0;for(const s of e.children)o+=Pe?.getMentionCount?.(s.id)??0;return o},[e.children])??0;return t>0?n.createElement(r.View,{style:se.outline},n.createElement(r.View,{style:se.badge},n.createElement(r.Text,{style:se.text},t>99?"99+":String(t)))):null}function bt({node:e}){Z.useProxy(f.storage);const t=Te(e.color);return n.createElement(r.View,{style:j.outer},n.createElement(r.View,{style:[j.icon,{backgroundColor:t}]},f.storage.hideFolderIcons?n.createElement(r.View,{style:j.plainIcon},n.createElement(r.Image,{source:Fe,style:oe.folderImg,tintColor:"#fff"})):e.children.slice(0,4).map(function(o,s){return n.createElement(r.View,{key:o.id,style:[j.cell,pt[s]]},n.createElement(ye,{id:o.id,size:re}))})),n.createElement(yt,{node:e}))}const j=r.StyleSheet.create({outer:{width:w,height:w},icon:{width:w,height:w,borderRadius:16,overflow:"hidden"},cell:{position:"absolute",width:re,height:re,borderRadius:8,overflow:"hidden"},plainIcon:{width:w,height:w,alignItems:"center",justifyContent:"center"}});function mt({children:e}){const t=n.useRef(new r.Animated.Value(0)).current;return n.useEffect(function(){r.Animated.timing(t,{toValue:1,duration:180,useNativeDriver:!0}).start()},[]),n.createElement(r.Animated.View,{style:{opacity:t}},e)}function St({node:e,onPick:t}){const o=ft(e.id),s=function(){ht?.toggleGuildFolderExpand?.(e.id)};return o?n.createElement(n.Fragment,null,n.createElement(r.Pressable,{onPress:s},n.createElement(r.View,{style:[oe.openIcon,{backgroundColor:Te(e.color)}]},n.createElement(r.Image,{source:Fe,style:oe.folderImg,tintColor:"#fff"}))),e.children.map(function(l){return n.createElement(mt,{key:l.id},n.createElement(Re,{node:l,onPick:t}))})):n.createElement(r.Pressable,{onPress:s},n.createElement(bt,{node:e}))}const oe=r.StyleSheet.create({openIcon:{width:w,height:w,borderRadius:16,alignItems:"center",justifyContent:"center"},folderImg:{width:24,height:24}}),se=r.StyleSheet.create({outline:{position:"absolute",bottom:-3,right:-3,minWidth:23,minHeight:23,borderRadius:12,backgroundColor:"#1a1a2e",alignItems:"center",justifyContent:"center"},badge:{minWidth:19,height:19,borderRadius:9,backgroundColor:"#ed4245",alignItems:"center",justifyContent:"center",paddingHorizontal:5},text:{color:"#fff",fontSize:10,fontWeight:"700",lineHeight:19}}),_=48,Ct=$.getAssetIDByName("ChatIcon"),Ae=i.findByProps("triggerHapticFeedback","HapticFeedbackTypes"),xe=i.findByProps("selectPrivateChannel"),Et=i.findByName("SelectedChannelStore"),kt=i.findByProps("useStateFromStores"),He=i.findByProps("getGuildId"),wt=i.findByProps("colors","unsafe_rawColors")?.colors;function It(){if(Ae?.triggerHapticFeedback(Ae.HapticFeedbackTypes.SOFT),xe?.selectPrivateChannel){const e=Et?.getLastSelectedChannelId?.();xe.selectPrivateChannel(e)}}function Rt(){const e=kt?.useStateFromStores?.([He],function(){return He?.getGuildId?.()==null})??!1;return n.createElement(r.Pressable,{onPress:It,style:Ve.outer},n.createElement(r.View,{style:[Ve.icon,{backgroundColor:e?wt?.BG_ACCENT??"#5865f2":"rgba(128,128,128,0.24)"}]},n.createElement(r.Image,{source:Ct,style:{width:24,height:24,tintColor:"#fff"}})))}const Ve=r.StyleSheet.create({outer:{width:_,height:_},icon:{width:_,height:_,borderRadius:16,alignItems:"center",justifyContent:"center"}}),Ge=48,Dt=$.getAssetIDByName("CheckmarkLargeIcon"),Bt=i.findByStoreName("SortedGuildStore"),z=i.findByStoreName("GuildChannelStore"),Pt=i.findByStoreName("ChannelStore"),Ft=p(function(){return i.findByProps("triggerHapticFeedback","HapticFeedbackTypes")}),Tt=p(function(){return i.findByProps("bulkAck","ackChannel")}),At=p(function(){return i.findByProps("ReadStateTypes","UnreadSetting")?.ReadStateTypes});function xt(){const e=(Bt?.getGuildsTree?.()?.root?.children??[]).filter(function(s){return s?.type!=="root"}),t=[],o=function(s){for(const l of s)l.type==="folder"?o(l.children??[]):l.id!=null&&t.push(String(l.id))};return o(e),t}function Ht(){const e=Tt(),t=At();if(!e?.bulkAck||t?.CHANNEL==null||!z?.getSelectableChannelIds||!z?.getVocalChannelIds){k.showToast("Couldn't find Discord's read-state action - this may be unavailable on your version.",void 0);return}const o=xt();if(o.length===0){k.showToast("Nothing to mark as read.",void 0);return}const s=[];for(const l of o){const u=[...z.getSelectableChannelIds(l)??[],...z.getVocalChannelIds(l)??[]];for(const c of u)s.push({channelId:c,readStateType:t.CHANNEL,messageId:Pt?.getChannel?.(c)?.lastMessageId??null})}if(s.length===0){k.showToast("Nothing to mark as read.",void 0);return}e.bulkAck(s),k.showToast(`Marked ${s.length} channel${s.length===1?"":"s"} as read`,void 0)}function Vt(){const e=n.useCallback(function(){const t=Ft();t?.triggerHapticFeedback?.(t.HapticFeedbackTypes.SOFT),Ht()},[]);return n.createElement(r.Pressable,{onPress:e,style:Gt.outer},n.createElement(r.Image,{source:Dt,style:{width:24,height:24,tintColor:"#80848e"}}))}const Gt=r.StyleSheet.create({outer:{width:Ge,height:Ge,alignItems:"center",justifyContent:"center"}}),Qt=i.findByProps("useStateFromStores"),Qe=i.findByStoreName("SortedGuildStore"),Mt=p(function(){return i.findByProps("getRootNavigationRef")}),Me=p(function(){return i.findByProps("triggerHapticFeedback","HapticFeedbackTypes")}),vt=p(function(){return i.findByProps("transitionToGuild")}),Lt=p(function(){return i.find(function(e){return typeof e?.handleCreateJoinGuildPress=="function"})}),Ot=p(function(){return i.find(function(e){return e?.CirclePlusIcon})?.CirclePlusIcon}),jt=p(function(){return i.findByProps("colors","unsafe_rawColors")?.unsafe_rawColors}),_t=i.find(function(e){return e?.QuestDockExternalCoordinationContext}),ve=_t?.QuestDockExternalCoordinationContext,Le=i.find(function(e){return e?.QuestDockMode?.COLLAPSED!=null})?.QuestDockMode,W=48,U=6,zt=12;function Wt(){const e=n.useRef(new r.Animated.Value(1)).current,t=n.useCallback(function(){r.Animated.spring(e,{toValue:.9,useNativeDriver:!0}).start()},[e]),o=n.useCallback(function(){r.Animated.spring(e,{toValue:1,useNativeDriver:!0}).start()},[e]),s=n.useCallback(function(){const c=Me();c?.triggerHapticFeedback?.(c.HapticFeedbackTypes.SOFT),Lt()?.handleCreateJoinGuildPress?.()},[]),l=Ot(),u=jt();return n.createElement(r.Pressable,{onPress:s,onPressIn:t,onPressOut:o},n.createElement(r.Animated.View,{style:[q.createJoin,{backgroundColor:u?.GREEN_360,transform:[{scale:e}]}]},l?n.createElement(l,{size:"md",color:u?.WHITE}):n.createElement(r.Text,{style:[q.createJoinFallback,{color:u?.WHITE}]},"+")))}function Oe({gestureContext:e}){const t=n.useCallback(function(d){const g=Me();g?.triggerHapticFeedback?.(g.HapticFeedbackTypes.SOFT);const B=vt();B?.transitionToGuild?B.transitionToGuild(d):Mt()?.getRootNavigationRef?.()?.navigate("guilds",{guildId:d})},[]),o=Qt?.useStateFromStores?.([Qe],function(){return(Qe?.getGuildsTree()?.root?.children||[]).filter(function(d){return d.type!=="root"})})??[],s=e?n.useContext(e):null,l=s?.minExpandedContentHeight,u=n.useCallback(function(d){if(!l)return;const g=d.nativeEvent.layout.height;l.get()!==g&&l.set(g)},[l]),c=(ve?n.useContext(ve):null)?.setRestingQuestDockMode,y=s?.questDockWrapperSpecs;n.useEffect(function(){if(!c||!Le||!y)return;const d=r.BackHandler.addEventListener("hardwareBackPress",function(){return(y.get()?.height??56)>80?(c(Le.COLLAPSED),!0):!1});return function(){return d.remove()}},[c,y]);const{width:I}=r.Dimensions.get("window"),S=Math.max(3,Math.floor((I-zt*2+U)/(W+U))),b=S*W+(S-1)*U,E=Math.max(0,(I-b)/2);return n.createElement(r.View,{style:q.alignTop},n.createElement(r.View,{style:[q.grid,{paddingHorizontal:E,gap:U}],onLayout:u},n.createElement(Rt,null),o.map(function(d){return d.type==="folder"?n.createElement(St,{key:d.id,node:d,onPick:t}):n.createElement(Re,{key:d.id,node:d,onPick:t})}),n.createElement(Wt,null),n.createElement(Vt,null)))}const q=r.StyleSheet.create({alignTop:{flex:1,justifyContent:"flex-start",alignItems:"flex-start"},grid:{flexDirection:"row",flexWrap:"wrap",paddingTop:4,paddingBottom:16},createJoin:{width:W,height:W,borderRadius:16,alignItems:"center",justifyContent:"center"},createJoinFallback:{fontSize:28,fontWeight:"700",lineHeight:30}}),ie=new Map,le=[];let C=null,J=!1;function Ut(e,t,o){ie.set(e,{replacement:t,extraProps:o})}function qt(e,t){le.push({predicate:e,replacement:t})}function Jt(e){if(J)return;if(C=a.React.createElement,!C){console.warn("[ServerDrawer] React.createElement is null, skipping patch");return}const t=function(o,s,...l){if(!C)return a.React.createElement(o,s,...l);if(s)for(const{predicate:c,replacement:y}of le)try{if(c(s))return y?C.call(a.React,y,s,...l):null}catch{}const u=ie.get(o);if(u){const c=u.extraProps?{...s,...u.extraProps}:s;return C.call(a.React,u.replacement,c,...l)}return C.call(a.React,o,s,...l)};Object.assign(t,C),a.React.createElement=t,J=!0,e.push(function(){J&&C&&(a.React.createElement=C,J=!1),ie.clear(),le.length=0})}const ae="[ServerDrawer]";let ue=null;function je(){return ue||(ue=i.find(function(e){return e?.QuestDockGestureContext})?.QuestDockGestureContext??null),ue}function Xt(e){const t=i.find(function(s){return s?.type?.displayName==="QuestDockContentExpanded"||s?.type?.name==="QuestDockContentExpanded"});if(!t?.type)return console.log(ae,"WARN: QuestDockContentExpanded not found (will retry)"),!1;const o=t.type;return Ut(o,Oe,{gestureContext:je()}),t.type=function(){return a.React.createElement(Oe,{gestureContext:je()})},e.push(function(){t.type=o}),console.log(ae,"PATCH: QuestDockContentExpanded replaced"),!0}function A(e,t){const o=i.find(function(u){return u?.type?.displayName===e||u?.type?.name===e});if(!o?.type)return console.log(ae,`WARN: ${e} not found`),!1;const s=o.type,l=s;return o.type=function(){return null},l&&(Object.defineProperties(o.type,Object.getOwnPropertyDescriptors(l)),o.type.displayName=e),t.push(function(){o.type=s}),!0}const Yt="[ServerDrawer]";function Kt(e){return qt(function(t){return t?.nativeID==="guilds-bar-view"},null),e.push(function(){}),console.log(Yt,"PATCH: guilds-bar-view createElement calls now render nothing"),!0}function Zt(e){const t=i.findByStoreName("ExpandedGuildFolderStore");if(!t?.getExpandedFolders)return!1;const o=function({folderId:s}){if(!f.storage.autoCollapseFolders||s==null)return;const l=t.getExpandedFolders();if(!(!(l instanceof Set)||!l.has(s)))for(const u of l)u!==s&&a.FluxDispatcher.dispatch({type:"TOGGLE_GUILD_FOLDER_EXPAND",folderId:u})};return a.FluxDispatcher.subscribe("TOGGLE_GUILD_FOLDER_EXPAND",o),e.push(function(){return a.FluxDispatcher.unsubscribe("TOGGLE_GUILD_FOLDER_EXPAND",o)}),!0}const{ScrollView:$t,View:Nt}=a.ReactNative;function en({children:e}){return a.React.createElement($t,{style:{flex:1}},e,a.React.createElement(Nt,{style:{height:24}}))}const{View:tn,Text:nn}=a.ReactNative;function _e({children:e,style:t}){return a.React.createElement(tn,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},a.React.createElement(nn,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{FormSection:ze,FormSwitchRow:X}=Je.Forms;function rn(){return Z.useProxy(f.storage),a.React.createElement(en,null,a.React.createElement(_e,null,"Server Drawer takes over the Quest Dock (the strip above the tab bar) to show your servers as a grid instead - tap to expand, long-press a server for its usual context menu, the chat bubble jumps to DMs, the + button creates or joins a server through Discord's own modal, and the check button marks every channel in every server as read."),a.React.createElement(ze,{title:"Layout"},a.React.createElement(X,{label:"Hide the left server rail",subLabel:"Your servers and DMs already live in the drawer, so the rail is redundant",value:f.storage.hideGuildsBar!==!1,onValueChange:function(e){f.storage.hideGuildsBar=e,qe()}}),a.React.createElement(X,{label:"Unread badges",subLabel:"Show mention counts and unread dots on server icons in the drawer",value:f.storage.showUnreadBadges!==!1,onValueChange:function(e){f.storage.showUnreadBadges=e}})),a.React.createElement(ze,{title:"Folders"},a.React.createElement(X,{label:"Auto-collapse other folders",subLabel:"Opening a folder collapses any other folder that was already open",value:!!f.storage.autoCollapseFolders,onValueChange:function(e){f.storage.autoCollapseFolders=e}}),a.React.createElement(X,{label:"Hide icons in collapsed folders",subLabel:"Show a plain folder icon instead of a 4-server preview",value:!!f.storage.hideFolderIcons,onValueChange:function(e){f.storage.hideFolderIcons=e}})),a.React.createElement(_e,null,"The folder options above are ported from fres621's BetterFolders - its other half (hiding icons in the native left server rail) patched a component that no longer exists in current Discord builds, so it's been rebuilt here instead, where it actually applies to what you see."))}let h=[],m;function on(e,t){try{return t()}catch(o){return K.logger.error(`[ServerDrawer] "${e}" patch threw, skipping: ${o}`),!1}}function We(){const e={questDockRender:function(){return Xe(h)},questDockBase:function(){return Ye(h)},mobileQuestDock:function(){return Ke(h)},getQuestAsset:function(){return $e(h)},expanded:function(){return Xt(h)},collapsed:function(){return A("QuestDockContentCollapsed",h)},enrolledHeader:function(){return A("QuestDockEnrolledHeader",h)},unenrolledHeader:function(){return A("QuestDockUnenrolledHeader",h)},enrolledBody:function(){return A("QuestDockEnrolledBody",h)},unenrolledBody:function(){return A("QuestDockUnenrolledBody",h)},autoCollapseFolders:function(){return Zt(h)},...f.storage.hideGuildsBar?{hideGuildsBar:function(){return Kt(h)}}:{}};Jt(h);const t=new Set(Object.keys(e)),o=new Set,s=function(){for(const l of t)on(l,e[l])&&(o.add(l),t.delete(l));t.size===0&&m&&(clearInterval(m),m=void 0)};if(s(),t.size>0){let l=0;m=setInterval(function(){s(),++l>=50&&m&&(clearInterval(m),m=void 0,t.size>0&&K.logger.error(`[ServerDrawer] Gave up waiting on: ${[...t].join(", ")}`))},200)}K.logger.log(`[ServerDrawer] onLoad: applied immediately - ${[...o].join(", ")||"none"}${t.size?`, still waiting on ${[...t].join(", ")}`:""}`)}function Ue(){m&&(clearInterval(m),m=void 0);for(const e of h)try{e()}catch{}h=[]}function qe(){Ue(),We()}var sn={onLoad:function(){f.storage.hideGuildsBar??=!0,f.storage.showUnreadBadges??=!0,f.storage.autoCollapseFolders??=!1,f.storage.hideFolderIcons??=!1,We()},onUnload:function(){return Ue()},settings:rn};return G.default=sn,G.restart=qe,Object.defineProperty(G,"__esModule",{value:!0}),G})({},vendetta,vendetta.plugin,vendetta.metro,vendetta.metro.common,window.React,vendetta.metro.common.ReactNative,vendetta.storage,vendetta.ui.toasts,vendetta.ui,vendetta.ui.assets,vendetta.ui.components); +(function(V,Y,f,i,c,n,r,K,k,G,Z,Je){"use strict";function Xe(e){const t=i.findByProps("useIsMobileQuestDockRendered");if(!t?.useIsMobileQuestDockRendered)return!1;const o=t.useIsMobileQuestDockRendered;return t.useIsMobileQuestDockRendered=function(...s){return o.apply(this,s),!0},e.push(function(){t.useIsMobileQuestDockRendered=o}),!0}function Ye(e){const t=i.findByProps("useIsMobileQuestDockRenderedBase");if(!t?.useIsMobileQuestDockRenderedBase)return!1;const o=t.useIsMobileQuestDockRenderedBase;return t.useIsMobileQuestDockRenderedBase=function(...s){return o.apply(this,s),!0},e.push(function(){t.useIsMobileQuestDockRenderedBase=o}),!0}function Ke(e){const t=i.findByProps("useMobileQuestDock");if(!t?.useMobileQuestDock)return!1;const o=t.useMobileQuestDock;return t.useMobileQuestDock=function(...s){return o.apply(this,s)||{id:"server-drawer",config:{quest_content_type:0,assets:{questBarHeroVideo:null,questBarHero:null},features:[]},userStatus:{enrolledAt:"2099-01-01",claimedAt:null},benefits:{rewards:[]},guildId:"0",tasks:[]}},e.push(function(){t.useMobileQuestDock=o}),!0}const Ze="[ServerDrawer]";function $e(e){const t=i.findByProps("getQuestAsset");if(!t?.getQuestAsset)return console.log(Ze,"WARN: getQuestAsset not found"),!1;const o=t.getQuestAsset;return t.getQuestAsset=function(...s){try{return o.apply(this,s)}catch{return{url:null,isAnimated:!1}}},e.push(function(){t.getQuestAsset=o}),!0}function S(e){let t,o=!1;return function(){if(o)return t;const s=e();return s!=null&&(t=s,o=!0),s??void 0}}const pe=i.findByStoreName("GuildStore"),Ne=i.findByProps("useStateFromStores"),et=i.findByProps("colors","unsafe_rawColors")?.colors;function ge({id:e,size:t=48}){const o=Ne?.useStateFromStores?.([pe],function(){return pe?.getGuild?.(e)},[e])??null;if(!o)return null;const s=t>=40?16:8;return o.icon?n.createElement(r.Image,{source:{uri:`https://cdn.discordapp.com/icons/${o.id}/${o.icon}.png?size=${t*2}`},style:{width:t,height:t,borderRadius:s}}):n.createElement(r.View,{style:[ye.fallback,{width:t,height:t,borderRadius:s,backgroundColor:et?.BG_ACCENT??"#5865f2"}]},n.createElement(r.Text,{style:[ye.letter,{fontSize:Math.max(10,t*.4)}]},o.name?.split(" ").map(function(l){return l[0]}).join("").slice(0,2).toUpperCase()||"?"))}const ye=r.StyleSheet.create({fallback:{alignItems:"center",justifyContent:"center"},letter:{color:"#fff",fontWeight:"700"}}),tt=i.findByStoreName("ThemeStore"),nt=i.find(function(e){return e?.default?.internal?.resolveSemanticColor})?.default?.internal?.resolveSemanticColor??i.find(function(e){return e?.meta?.resolveSemanticColor})?.meta?.resolveSemanticColor??function(){};function ot(e,t=tt?.theme){if(e)try{return nt(t,e)}catch{return}}const be=i.findByProps("TextStyleSheet")?.TextStyleSheet,me=i.findByProps("triggerHapticFeedback","HapticFeedbackTypes");function Q(e,t){return ot(e)??t}const D=12,$=12,Se=42,N=220,Ce=4,P=16,v=20,Ee={tension:200,friction:20};function rt({visible:e,items:t,title:o,anchorX:s,anchorY:l,onClose:a}){const{width:u,height:y}=r.Dimensions.get("window"),h=(o?$+20+Ce:0)+t.length*Se;let b=s,p=l+48+10;b+N>u-D&&(b=u-N-D),by-D&&(p=l-h-10),p0?n.createElement(r.View,{style:F.outline},n.createElement(r.View,{style:F.badge},n.createElement(r.Text,{style:F.text},t>99?"99+":String(t)))):o?n.createElement(r.View,{style:F.dotOutline},n.createElement(r.View,{style:F.dot})):null:null}function Ie({node:e,onPick:t}){const o=n.useRef(null),s=n.useRef(new r.Animated.Value(1)).current,l=function(){return r.Animated.spring(s,{toValue:.85,useNativeDriver:!0}).start()},a=function(){return r.Animated.spring(s,{toValue:1,useNativeDriver:!0}).start()},[u,y]=n.useState({visible:!1,items:[],title:"",x:0,y:0}),h=n.useCallback(function(){const E=e.id,d=st?.getGuild?.(E);if(!d)return;const m=o.current;if(!m?.measure)return;const R=[{label:"Mark as Read",action:function(){return ut(E)}},{label:"Copy Server ID",action:function(){c.clipboard.setString(E),k.showToast("Copied server ID",void 0)}}];m.measure(function(T,A,H,ue,X,B){y({visible:!0,items:R,title:d.name,x:X,y:B})})},[e.id]),b=n.useCallback(function(){we?.triggerHapticFeedback?.(we.HapticFeedbackTypes.IMPACT_MEDIUM),h()},[h]),p=e.id;return n.createElement(n.Fragment,null,n.createElement(r.Pressable,{onPressIn:l,onPressOut:a,onPress:function(){return t(p)},onLongPress:b,delayLongPress:500},n.createElement(r.View,{ref:o,style:De.outer,collapsable:!1},n.createElement(r.Animated.View,{style:[De.icon,{transform:[{scale:s}]}]},n.createElement(ge,{id:p})),n.createElement(ct,{guildId:p}))),n.createElement(rt,{visible:u.visible,items:u.items,title:u.title,anchorX:u.x,anchorY:u.y,onClose:function(){return y(function(E){return{...E,visible:!1}})}}))}const De=r.StyleSheet.create({outer:{width:M,height:M},icon:{width:M,height:M,borderRadius:16,overflow:"hidden"}}),F=r.StyleSheet.create({outline:{position:"absolute",bottom:-3,right:-3,minWidth:23,minHeight:23,borderRadius:12,backgroundColor:"#1a1a2e",alignItems:"center",justifyContent:"center"},badge:{minWidth:19,height:19,borderRadius:9,backgroundColor:"#ed4245",alignItems:"center",justifyContent:"center",paddingHorizontal:5},text:{color:"#fff",fontSize:10,fontWeight:"700",lineHeight:19},dotOutline:{position:"absolute",bottom:-2,right:-2,width:14,height:14,borderRadius:7,backgroundColor:"#1a1a2e",alignItems:"center",justifyContent:"center"},dot:{width:10,height:10,borderRadius:5,backgroundColor:"#ed4245"}}),dt=i.findByProps("useStateFromStores");i.findByProps("colors","unsafe_rawColors")?.colors;const Re=i.findByStoreName("ExpandedGuildFolderStore");function ft(e){return dt?.useStateFromStores?.([Re],function(){const t=Re?.getExpandedFolders?.();return t instanceof Set?t.has(e):!1},[e])??!1}const ht=i.findByProps("toggleGuildFolderExpand"),pt=i.findByProps("useStateFromStores"),Be=i.findByStoreName("GuildReadStateStore"),w=48,ne=16,gt=[{top:6,left:6},{top:6,right:6},{bottom:6,left:6},{bottom:6,right:6}],Pe=Z.getAssetIDByName("FolderIcon");function Fe(e){return e==null?"#5865f2":`#${e.toString(16).padStart(6,"0")}`}function yt({node:e}){const t=pt?.useStateFromStores?.([Be],function(){let o=0;for(const s of e.children)o+=Be?.getMentionCount?.(s.id)??0;return o},[e.children])??0;return t>0?n.createElement(r.View,{style:re.outline},n.createElement(r.View,{style:re.badge},n.createElement(r.Text,{style:re.text},t>99?"99+":String(t)))):null}function bt({node:e}){K.useProxy(f.storage);const t=Fe(e.color);return n.createElement(r.View,{style:j.outer},n.createElement(r.View,{style:[j.icon,{backgroundColor:t}]},f.storage.hideFolderIcons?n.createElement(r.View,{style:j.plainIcon},n.createElement(r.Image,{source:Pe,style:oe.folderImg,tintColor:"#fff"})):e.children.slice(0,4).map(function(o,s){return n.createElement(r.View,{key:o.id,style:[j.cell,gt[s]]},n.createElement(ge,{id:o.id,size:ne}))})),n.createElement(yt,{node:e}))}const j=r.StyleSheet.create({outer:{width:w,height:w},icon:{width:w,height:w,borderRadius:16,overflow:"hidden"},cell:{position:"absolute",width:ne,height:ne,borderRadius:8,overflow:"hidden"},plainIcon:{width:w,height:w,alignItems:"center",justifyContent:"center"}});function mt({children:e}){const t=n.useRef(new r.Animated.Value(0)).current;return n.useEffect(function(){r.Animated.timing(t,{toValue:1,duration:180,useNativeDriver:!0}).start()},[]),n.createElement(r.Animated.View,{style:{opacity:t}},e)}function St({node:e,onPick:t}){const o=ft(e.id),s=function(){ht?.toggleGuildFolderExpand?.(e.id)};return o?n.createElement(n.Fragment,null,n.createElement(r.Pressable,{onPress:s},n.createElement(r.View,{style:[oe.openIcon,{backgroundColor:Fe(e.color)}]},n.createElement(r.Image,{source:Pe,style:oe.folderImg,tintColor:"#fff"}))),e.children.map(function(l){return n.createElement(mt,{key:l.id},n.createElement(Ie,{node:l,onPick:t}))})):n.createElement(r.Pressable,{onPress:s},n.createElement(bt,{node:e}))}const oe=r.StyleSheet.create({openIcon:{width:w,height:w,borderRadius:16,alignItems:"center",justifyContent:"center"},folderImg:{width:24,height:24}}),re=r.StyleSheet.create({outline:{position:"absolute",bottom:-3,right:-3,minWidth:23,minHeight:23,borderRadius:12,backgroundColor:"#1a1a2e",alignItems:"center",justifyContent:"center"},badge:{minWidth:19,height:19,borderRadius:9,backgroundColor:"#ed4245",alignItems:"center",justifyContent:"center",paddingHorizontal:5},text:{color:"#fff",fontSize:10,fontWeight:"700",lineHeight:19}}),O=48,Ct=Z.getAssetIDByName("ChatIcon"),xe=i.findByProps("triggerHapticFeedback","HapticFeedbackTypes"),Te=i.findByProps("selectPrivateChannel"),Et=i.findByName("SelectedChannelStore"),kt=i.findByProps("useStateFromStores"),Ae=i.findByProps("getGuildId"),wt=i.findByProps("colors","unsafe_rawColors")?.colors;function It(){if(xe?.triggerHapticFeedback(xe.HapticFeedbackTypes.SOFT),Te?.selectPrivateChannel){const e=Et?.getLastSelectedChannelId?.();Te.selectPrivateChannel(e)}}function Dt(){const e=kt?.useStateFromStores?.([Ae],function(){return Ae?.getGuildId?.()==null})??!1;return n.createElement(r.Pressable,{onPress:It,style:He.outer},n.createElement(r.View,{style:[He.icon,{backgroundColor:e?wt?.BG_ACCENT??"#5865f2":"rgba(128,128,128,0.24)"}]},n.createElement(r.Image,{source:Ct,style:{width:24,height:24,tintColor:"#fff"}})))}const He=r.StyleSheet.create({outer:{width:O,height:O},icon:{width:O,height:O,borderRadius:16,alignItems:"center",justifyContent:"center"}}),Ve=48,Rt=Z.getAssetIDByName("CheckmarkLargeIcon"),Bt=i.findByStoreName("SortedGuildStore"),_=i.findByStoreName("GuildChannelStore"),Pt=i.findByStoreName("ChannelStore"),Ft=S(function(){return i.findByProps("triggerHapticFeedback","HapticFeedbackTypes")}),xt=S(function(){return i.findByProps("bulkAck","ackChannel")}),Tt=S(function(){return i.findByProps("ReadStateTypes","UnreadSetting")?.ReadStateTypes});function At(){const e=(Bt?.getGuildsTree?.()?.root?.children??[]).filter(function(s){return s?.type!=="root"}),t=[],o=function(s){for(const l of s)l.type==="folder"?o(l.children??[]):l.id!=null&&t.push(String(l.id))};return o(e),t}function Ht(){const e=xt(),t=Tt();if(!e?.bulkAck||t?.CHANNEL==null||!_?.getSelectableChannelIds||!_?.getVocalChannelIds){k.showToast("Couldn't find Discord's read-state action - this may be unavailable on your version.",void 0);return}const o=At();if(o.length===0){k.showToast("Nothing to mark as read.",void 0);return}const s=[];for(const l of o){const a=[..._.getSelectableChannelIds(l)??[],..._.getVocalChannelIds(l)??[]];for(const u of a)s.push({channelId:u,readStateType:t.CHANNEL,messageId:Pt?.getChannel?.(u)?.lastMessageId??null})}if(s.length===0){k.showToast("Nothing to mark as read.",void 0);return}e.bulkAck(s),k.showToast(`Marked ${s.length} channel${s.length===1?"":"s"} as read`,void 0)}function Vt(){const e=n.useCallback(function(){const t=Ft();t?.triggerHapticFeedback?.(t.HapticFeedbackTypes.SOFT),Ht()},[]);return n.createElement(r.Pressable,{onPress:e,style:Gt.outer},n.createElement(r.Image,{source:Rt,style:{width:24,height:24,tintColor:"#80848e"}}))}const Gt=r.StyleSheet.create({outer:{width:Ve,height:Ve,alignItems:"center",justifyContent:"center"}}),Qt=i.findByProps("useStateFromStores"),Ge=i.findByStoreName("SortedGuildStore"),vt=S(function(){return i.findByProps("getRootNavigationRef")}),Qe=S(function(){return i.findByProps("triggerHapticFeedback","HapticFeedbackTypes")}),Mt=S(function(){return i.findByProps("transitionToGuild")}),Lt=S(function(){return i.find(function(e){return typeof e?.handleCreateJoinGuildPress=="function"})}),jt=S(function(){return i.find(function(e){return e?.CirclePlusIcon})?.CirclePlusIcon}),Ot=S(function(){return i.findByProps("colors","unsafe_rawColors")?.unsafe_rawColors}),_t=i.find(function(e){return e?.QuestDockExternalCoordinationContext}),ve=_t?.QuestDockExternalCoordinationContext,Me=i.find(function(e){return e?.QuestDockMode?.COLLAPSED!=null})?.QuestDockMode,z=48,W=6,zt=12;function Wt(){const e=n.useRef(new r.Animated.Value(1)).current,t=n.useCallback(function(){r.Animated.spring(e,{toValue:.9,useNativeDriver:!0}).start()},[e]),o=n.useCallback(function(){r.Animated.spring(e,{toValue:1,useNativeDriver:!0}).start()},[e]),s=n.useCallback(function(){const u=Qe();u?.triggerHapticFeedback?.(u.HapticFeedbackTypes.SOFT),Lt()?.handleCreateJoinGuildPress?.()},[]),l=jt(),a=Ot();return n.createElement(r.Pressable,{onPress:s,onPressIn:t,onPressOut:o},n.createElement(r.Animated.View,{style:[U.createJoin,{backgroundColor:a?.GREEN_360,transform:[{scale:e}]}]},l?n.createElement(l,{size:"md",color:a?.WHITE}):n.createElement(r.Text,{style:[U.createJoinFallback,{color:a?.WHITE}]},"+")))}function Le({gestureContext:e}){const t=n.useCallback(function(d){const m=Qe();m?.triggerHapticFeedback?.(m.HapticFeedbackTypes.SOFT);const R=Mt();R?.transitionToGuild?R.transitionToGuild(d):vt()?.getRootNavigationRef?.()?.navigate("guilds",{guildId:d})},[]),o=Qt?.useStateFromStores?.([Ge],function(){return(Ge?.getGuildsTree()?.root?.children||[]).filter(function(d){return d.type!=="root"})})??[],s=e?n.useContext(e):null,l=s?.minExpandedContentHeight,a=n.useCallback(function(d){if(!l)return;const m=d.nativeEvent.layout.height;l.get()!==m&&l.set(m)},[l]),u=(ve?n.useContext(ve):null)?.setRestingQuestDockMode,y=s?.questDockWrapperSpecs;n.useEffect(function(){if(!u||!Me||!y)return;const d=r.BackHandler.addEventListener("hardwareBackPress",function(){return(y.get()?.height??56)>80?(u(Me.COLLAPSED),!0):!1});return function(){return d.remove()}},[u,y]);const{width:h}=r.Dimensions.get("window"),b=Math.max(3,Math.floor((h-zt*2+W)/(z+W))),p=b*z+(b-1)*W,E=Math.max(0,(h-p)/2);return n.createElement(r.View,{style:U.alignTop},n.createElement(r.View,{style:[U.grid,{paddingHorizontal:E,gap:W}],onLayout:a},n.createElement(Dt,null),o.map(function(d){return d.type==="folder"?n.createElement(St,{key:d.id,node:d,onPick:t}):n.createElement(Ie,{key:d.id,node:d,onPick:t})}),n.createElement(Wt,null),n.createElement(Vt,null)))}const U=r.StyleSheet.create({alignTop:{flex:1,justifyContent:"flex-start",alignItems:"flex-start"},grid:{flexDirection:"row",flexWrap:"wrap",paddingTop:4,paddingBottom:16},createJoin:{width:z,height:z,borderRadius:16,alignItems:"center",justifyContent:"center"},createJoinFallback:{fontSize:28,fontWeight:"700",lineHeight:30}}),se=new Map,ie=[];let q=!1;function Ut(e,t,o){se.set(e,{replacement:t,extraProps:o})}function qt(e,t){ie.push({predicate:e,replacement:t})}function je(e,t){if(t)for(const{predicate:s,replacement:l}of ie)try{if(s(t))return l?{type:l,props:t}:null}catch{}const o=se.get(e);if(o)return{type:o.replacement,props:o.extraProps?{...t,...o.extraProps}:t}}function Jt(e){if(q)return;const t=c.React.createElement;if(!t){console.warn("[ServerDrawer] React.createElement is null, skipping patch");return}const o=function(a,u,...y){const h=je(a,u);return h===null?null:h?t.call(c.React,h.type,h.props,...y):t.call(c.React,a,u,...y)};Object.assign(o,t),c.React.createElement=o,q=!0;const s=i.find(function(a){return typeof a?.jsx=="function"&&typeof a?.jsxs=="function"&&"Fragment"in a}),l=[];if(s)for(const a of["jsx","jsxs"]){const u=s[a];typeof u=="function"&&(s[a]=function(y,h,...b){const p=je(y,h);return p===null?null:p?u.call(this,p.type,p.props,...b):u.call(this,y,h,...b)},l.push(function(){s[a]=u}))}else console.warn("[ServerDrawer] jsx-runtime module not found, only classic createElement calls will be intercepted");e.push(function(){q&&(c.React.createElement=t,q=!1),l.forEach(function(a){return a()}),se.clear(),ie.length=0})}const le="[ServerDrawer]";let ae=null;function Oe(){return ae||(ae=i.find(function(e){return e?.QuestDockGestureContext})?.QuestDockGestureContext??null),ae}function Xt(e){const t=i.find(function(s){return s?.type?.displayName==="QuestDockContentExpanded"||s?.type?.name==="QuestDockContentExpanded"});if(!t?.type)return console.log(le,"WARN: QuestDockContentExpanded not found (will retry)"),!1;const o=t.type;return Ut(o,Le,{gestureContext:Oe()}),t.type=function(){return c.React.createElement(Le,{gestureContext:Oe()})},e.push(function(){t.type=o}),console.log(le,"PATCH: QuestDockContentExpanded replaced"),!0}function x(e,t){const o=i.find(function(a){return a?.type?.displayName===e||a?.type?.name===e});if(!o?.type)return console.log(le,`WARN: ${e} not found`),!1;const s=o.type,l=s;return o.type=function(){return null},l&&(Object.defineProperties(o.type,Object.getOwnPropertyDescriptors(l)),o.type.displayName=e),t.push(function(){o.type=s}),!0}const Yt="[ServerDrawer]";function Kt(e){return qt(function(t){return t?.nativeID==="guilds-bar-view"},null),e.push(function(){}),console.log(Yt,"PATCH: guilds-bar-view createElement calls now render nothing"),!0}function Zt(e){const t=i.findByStoreName("ExpandedGuildFolderStore");if(!t?.getExpandedFolders)return!1;const o=function({folderId:s}){if(!f.storage.autoCollapseFolders||s==null)return;const l=t.getExpandedFolders();if(!(!(l instanceof Set)||!l.has(s)))for(const a of l)a!==s&&c.FluxDispatcher.dispatch({type:"TOGGLE_GUILD_FOLDER_EXPAND",folderId:a})};return c.FluxDispatcher.subscribe("TOGGLE_GUILD_FOLDER_EXPAND",o),e.push(function(){return c.FluxDispatcher.unsubscribe("TOGGLE_GUILD_FOLDER_EXPAND",o)}),!0}const{ScrollView:$t,View:Nt}=c.ReactNative;function en({children:e}){return c.React.createElement($t,{style:{flex:1}},e,c.React.createElement(Nt,{style:{height:24}}))}const{View:tn,Text:nn}=c.ReactNative;function _e({children:e,style:t}){return c.React.createElement(tn,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},c.React.createElement(nn,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{FormSection:ze,FormSwitchRow:J}=Je.Forms;function on(){return K.useProxy(f.storage),c.React.createElement(en,null,c.React.createElement(_e,null,"Server Drawer takes over the Quest Dock (the strip above the tab bar) to show your servers as a grid instead - tap to expand, long-press a server for its usual context menu, the chat bubble jumps to DMs, the + button creates or joins a server through Discord's own modal, and the check button marks every channel in every server as read."),c.React.createElement(ze,{title:"Layout"},c.React.createElement(J,{label:"Hide the left server rail",subLabel:"Your servers and DMs already live in the drawer, so the rail is redundant",value:f.storage.hideGuildsBar!==!1,onValueChange:function(e){f.storage.hideGuildsBar=e,qe()}}),c.React.createElement(J,{label:"Unread badges",subLabel:"Show mention counts and unread dots on server icons in the drawer",value:f.storage.showUnreadBadges!==!1,onValueChange:function(e){f.storage.showUnreadBadges=e}})),c.React.createElement(ze,{title:"Folders"},c.React.createElement(J,{label:"Auto-collapse other folders",subLabel:"Opening a folder collapses any other folder that was already open",value:!!f.storage.autoCollapseFolders,onValueChange:function(e){f.storage.autoCollapseFolders=e}}),c.React.createElement(J,{label:"Hide icons in collapsed folders",subLabel:"Show a plain folder icon instead of a 4-server preview",value:!!f.storage.hideFolderIcons,onValueChange:function(e){f.storage.hideFolderIcons=e}})),c.React.createElement(_e,null,"The folder options above are ported from fres621's BetterFolders - its other half (hiding icons in the native left server rail) patched a component that no longer exists in current Discord builds, so it's been rebuilt here instead, where it actually applies to what you see."))}let g=[],C;function rn(e,t){try{return t()}catch(o){return Y.logger.error(`[ServerDrawer] "${e}" patch threw, skipping: ${o}`),!1}}function We(){const e={questDockRender:function(){return Xe(g)},questDockBase:function(){return Ye(g)},mobileQuestDock:function(){return Ke(g)},getQuestAsset:function(){return $e(g)},expanded:function(){return Xt(g)},collapsed:function(){return x("QuestDockContentCollapsed",g)},enrolledHeader:function(){return x("QuestDockEnrolledHeader",g)},unenrolledHeader:function(){return x("QuestDockUnenrolledHeader",g)},enrolledBody:function(){return x("QuestDockEnrolledBody",g)},unenrolledBody:function(){return x("QuestDockUnenrolledBody",g)},autoCollapseFolders:function(){return Zt(g)},...f.storage.hideGuildsBar?{hideGuildsBar:function(){return Kt(g)}}:{}};Jt(g);const t=new Set(Object.keys(e)),o=new Set,s=function(){for(const l of t)rn(l,e[l])&&(o.add(l),t.delete(l));t.size===0&&C&&(clearInterval(C),C=void 0)};if(s(),t.size>0){let l=0;C=setInterval(function(){s(),++l>=50&&C&&(clearInterval(C),C=void 0,t.size>0&&Y.logger.error(`[ServerDrawer] Gave up waiting on: ${[...t].join(", ")}`))},200)}Y.logger.log(`[ServerDrawer] onLoad: applied immediately - ${[...o].join(", ")||"none"}${t.size?`, still waiting on ${[...t].join(", ")}`:""}`)}function Ue(){C&&(clearInterval(C),C=void 0);for(const e of g)try{e()}catch{}g=[]}function qe(){Ue(),We()}var sn={onLoad:function(){f.storage.hideGuildsBar??=!0,f.storage.showUnreadBadges??=!0,f.storage.autoCollapseFolders??=!1,f.storage.hideFolderIcons??=!1,We()},onUnload:function(){return Ue()},settings:on};return V.default=sn,V.restart=qe,Object.defineProperty(V,"__esModule",{value:!0}),V})({},vendetta,vendetta.plugin,vendetta.metro,vendetta.metro.common,window.React,vendetta.metro.common.ReactNative,vendetta.storage,vendetta.ui.toasts,vendetta.ui,vendetta.ui.assets,vendetta.ui.components); diff --git a/server-drawer/install/manifest.json b/server-drawer/install/manifest.json index fa0c7a3..5567555 100644 --- a/server-drawer/install/manifest.json +++ b/server-drawer/install/manifest.json @@ -1 +1 @@ -{"name":"ServerDrawer","description":"Replaces the Quest Dock with a server grid drawer above the YouBar - tap to expand, long-press a server for its context menu, plus a one-tap create/join button.","authors":[{"name":"everestmcarthur"},{"name":"kmmiio99o"},{"name":"fres"}],"main":"index.js","vendetta":{"icon":"ServerIcon"},"hash":"9d4e6347d8cf731d4c9bd16b5e9b12dd6114cf4fb509b75bd613966c29bd7a1b"} \ No newline at end of file +{"name":"ServerDrawer","description":"Replaces the Quest Dock with a server grid drawer above the YouBar - tap to expand, long-press a server for its context menu, plus a one-tap create/join button.","authors":[{"name":"everestmcarthur"},{"name":"kmmiio99o"},{"name":"fres"}],"main":"index.js","vendetta":{"icon":"ServerIcon"},"hash":"8edb53ca9da5e9f6921ce60879e632ca025570ed09f9a5358d929ef4258f5950"} \ No newline at end of file