From fa551b5aa845bcca33bf56e82a0f5d39a88e65c6 Mon Sep 17 00:00:00 2001 From: everestmcarthur Date: Sat, 1 Aug 2026 20:04:30 +0000 Subject: [PATCH] deploy: 5fbb0321c6c8b59860008849a67f1bf51320c27e --- server-drawer/install/index.js | 2 +- server-drawer/install/manifest.json | 2 +- you-bar-plus/install/index.js | 2 +- you-bar-plus/install/manifest.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server-drawer/install/index.js b/server-drawer/install/index.js index 59ce66e..7e782fe 100644 --- a/server-drawer/install/index.js +++ b/server-drawer/install/index.js @@ -1 +1 @@ -(function(v,Z,f,c,n,o,l,$,k,Q,N,Ke){"use strict";function I(e){const t=window?.modules;if(t)for(const r in t){let s;try{s=window.__r(Number(r))}catch{continue}if(s)try{if(e(s))return s;if(s.default!=null&&e(s.default))return s.default}catch{}}}function m(...e){return I(function(t){return e.every(function(r){return t?.[r]!==void 0})})}function Ye(e){return I(function(t){return typeof t?.getName=="function"&&t.getName.length===0&&t.getName()===e})}function Ze(e){const t=m("useIsMobileQuestDockRendered");if(!t?.useIsMobileQuestDockRendered)return!1;const r=t.useIsMobileQuestDockRendered;return t.useIsMobileQuestDockRendered=function(...s){return r.apply(this,s),!0},e.push(function(){t.useIsMobileQuestDockRendered=r}),!0}function $e(e){const t=m("useIsMobileQuestDockRenderedBase");if(!t?.useIsMobileQuestDockRenderedBase)return!1;const r=t.useIsMobileQuestDockRenderedBase;return t.useIsMobileQuestDockRenderedBase=function(...s){return r.apply(this,s),!0},e.push(function(){t.useIsMobileQuestDockRenderedBase=r}),!0}function Ne(e){const t=m("useMobileQuestDock");if(!t?.useMobileQuestDock)return!1;const r=t.useMobileQuestDock;return t.useMobileQuestDock=function(...s){return r.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=r}),!0}const et="[ServerDrawer]";function tt(e){const t=m("getQuestAsset");if(!t?.getQuestAsset)return console.log(et,"WARN: getQuestAsset not found"),!1;const r=t.getQuestAsset;return t.getQuestAsset=function(...s){try{return r.apply(this,s)}catch{return{url:null,isAnimated:!1}}},e.push(function(){t.getQuestAsset=r}),!0}function C(e){let t,r=!1;return function(){if(r)return t;const s=e();return s!=null&&(t=s,r=!0),s??void 0}}const ye=l.findByStoreName("GuildStore"),nt=l.findByProps("useStateFromStores"),rt=l.findByProps("colors","unsafe_rawColors")?.colors;function me({id:e,size:t=48}){const r=nt?.useStateFromStores?.([ye],function(){return ye?.getGuild?.(e)},[e])??null;if(!r)return null;const s=t>=40?16:8;return r.icon?n.createElement(o.Image,{source:{uri:`https://cdn.discordapp.com/icons/${r.id}/${r.icon}.png?size=${t*2}`},style:{width:t,height:t,borderRadius:s}}):n.createElement(o.View,{style:[be.fallback,{width:t,height:t,borderRadius:s,backgroundColor:rt?.BG_ACCENT??"#5865f2"}]},n.createElement(o.Text,{style:[be.letter,{fontSize:Math.max(10,t*.4)}]},r.name?.split(" ").map(function(i){return i[0]}).join("").slice(0,2).toUpperCase()||"?"))}const be=o.StyleSheet.create({fallback:{alignItems:"center",justifyContent:"center"},letter:{color:"#fff",fontWeight:"700"}}),ot=l.findByStoreName("ThemeStore"),st=l.find(function(e){return e?.default?.internal?.resolveSemanticColor})?.default?.internal?.resolveSemanticColor??l.find(function(e){return e?.meta?.resolveSemanticColor})?.meta?.resolveSemanticColor??function(){};function it(e,t=ot?.theme){if(e)try{return st(t,e)}catch{return}}const Se=l.findByProps("TextStyleSheet")?.TextStyleSheet,Ce=l.findByProps("triggerHapticFeedback","HapticFeedbackTypes");function M(e,t){return it(e)??t}const F=12,ee=12,Ee=42,te=220,we=4,P=16,L=20,ke={tension:200,friction:20};function lt({visible:e,items:t,title:r,anchorX:s,anchorY:i,onClose:a}){const{width:u,height:y}=o.Dimensions.get("window"),h=(r?ee+20+we:0)+t.length*Ee;let b=s,g=i+48+10;b+te>u-F&&(b=u-te-F),by-F&&(g=i-h-10),g0?n.createElement(o.View,{style:T.outline},n.createElement(o.View,{style:T.badge},n.createElement(o.Text,{style:T.text},t>99?"99+":String(t)))):r?n.createElement(o.View,{style:T.dotOutline},n.createElement(o.View,{style:T.dot})):null:null}function Re({node:e,onPick:t}){const r=n.useRef(null),s=n.useRef(new o.Animated.Value(1)).current,i=function(){return o.Animated.spring(s,{toValue:.85,useNativeDriver:!0}).start()},a=function(){return o.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 w=e.id,d=at?.getGuild?.(w);if(!d)return;const S=r.current;if(!S?.measure)return;const B=[{label:"Mark as Read",action:function(){return ft(w)}},{label:"Copy Server ID",action:function(){c.clipboard.setString(w),k.showToast("Copied server ID",void 0)}}];S.measure(function(H,V,G,de,Y,x){y({visible:!0,items:B,title:d.name,x:Y,y:x})})},[e.id]),b=n.useCallback(function(){De?.triggerHapticFeedback?.(De.HapticFeedbackTypes.IMPACT_MEDIUM),h()},[h]),g=e.id;return n.createElement(n.Fragment,null,n.createElement(o.Pressable,{onPressIn:i,onPressOut:a,onPress:function(){return t(g)},onLongPress:b,delayLongPress:500},n.createElement(o.View,{ref:r,style:Fe.outer,collapsable:!1},n.createElement(o.Animated.View,{style:[Fe.icon,{transform:[{scale:s}]}]},n.createElement(me,{id:g})),n.createElement(ht,{guildId:g}))),n.createElement(lt,{visible:u.visible,items:u.items,title:u.title,anchorX:u.x,anchorY:u.y,onClose:function(){return y(function(w){return{...w,visible:!1}})}}))}const Fe=o.StyleSheet.create({outer:{width:j,height:j},icon:{width:j,height:j,borderRadius:16,overflow:"hidden"}}),T=o.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"}}),gt=l.findByProps("useStateFromStores");l.findByProps("colors","unsafe_rawColors")?.colors;const Be=l.findByStoreName("ExpandedGuildFolderStore");function pt(e){return gt?.useStateFromStores?.([Be],function(){const t=Be?.getExpandedFolders?.();return t instanceof Set?t.has(e):!1},[e])??!1}const yt=l.findByProps("toggleGuildFolderExpand"),mt=l.findByProps("useStateFromStores"),xe=l.findByStoreName("GuildReadStateStore"),D=48,oe=16,bt=[{top:6,left:6},{top:6,right:6},{bottom:6,left:6},{bottom:6,right:6}],Pe=N.getAssetIDByName("FolderIcon");function Te(e){return e==null?"#5865f2":`#${e.toString(16).padStart(6,"0")}`}function St({node:e}){const t=mt?.useStateFromStores?.([xe],function(){let r=0;for(const s of e.children)r+=xe?.getMentionCount?.(s.id)??0;return r},[e.children])??0;return t>0?n.createElement(o.View,{style:ie.outline},n.createElement(o.View,{style:ie.badge},n.createElement(o.Text,{style:ie.text},t>99?"99+":String(t)))):null}function Ct({node:e}){$.useProxy(f.storage);const t=Te(e.color);return n.createElement(o.View,{style:_.outer},n.createElement(o.View,{style:[_.icon,{backgroundColor:t}]},f.storage.hideFolderIcons?n.createElement(o.View,{style:_.plainIcon},n.createElement(o.Image,{source:Pe,style:se.folderImg,tintColor:"#fff"})):e.children.slice(0,4).map(function(r,s){return n.createElement(o.View,{key:r.id,style:[_.cell,bt[s]]},n.createElement(me,{id:r.id,size:oe}))})),n.createElement(St,{node:e}))}const _=o.StyleSheet.create({outer:{width:D,height:D},icon:{width:D,height:D,borderRadius:16,overflow:"hidden"},cell:{position:"absolute",width:oe,height:oe,borderRadius:8,overflow:"hidden"},plainIcon:{width:D,height:D,alignItems:"center",justifyContent:"center"}});function Et({children:e}){const t=n.useRef(new o.Animated.Value(0)).current;return n.useEffect(function(){o.Animated.timing(t,{toValue:1,duration:180,useNativeDriver:!0}).start()},[]),n.createElement(o.Animated.View,{style:{opacity:t}},e)}function wt({node:e,onPick:t}){const r=pt(e.id),s=function(){yt?.toggleGuildFolderExpand?.(e.id)};return r?n.createElement(n.Fragment,null,n.createElement(o.Pressable,{onPress:s},n.createElement(o.View,{style:[se.openIcon,{backgroundColor:Te(e.color)}]},n.createElement(o.Image,{source:Pe,style:se.folderImg,tintColor:"#fff"}))),e.children.map(function(i){return n.createElement(Et,{key:i.id},n.createElement(Re,{node:i,onPick:t}))})):n.createElement(o.Pressable,{onPress:s},n.createElement(Ct,{node:e}))}const se=o.StyleSheet.create({openIcon:{width:D,height:D,borderRadius:16,alignItems:"center",justifyContent:"center"},folderImg:{width:24,height:24}}),ie=o.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}}),z=48,kt=N.getAssetIDByName("ChatIcon"),Ae=l.findByProps("triggerHapticFeedback","HapticFeedbackTypes"),He=l.findByProps("selectPrivateChannel"),It=l.findByName("SelectedChannelStore"),Dt=l.findByProps("useStateFromStores"),Ve=l.findByProps("getGuildId"),Rt=l.findByProps("colors","unsafe_rawColors")?.colors;function Ft(){if(Ae?.triggerHapticFeedback(Ae.HapticFeedbackTypes.SOFT),He?.selectPrivateChannel){const e=It?.getLastSelectedChannelId?.();He.selectPrivateChannel(e)}}function Bt(){const e=Dt?.useStateFromStores?.([Ve],function(){return Ve?.getGuildId?.()==null})??!1;return n.createElement(o.Pressable,{onPress:Ft,style:Ge.outer},n.createElement(o.View,{style:[Ge.icon,{backgroundColor:e?Rt?.BG_ACCENT??"#5865f2":"rgba(128,128,128,0.24)"}]},n.createElement(o.Image,{source:kt,style:{width:24,height:24,tintColor:"#fff"}})))}const Ge=o.StyleSheet.create({outer:{width:z,height:z},icon:{width:z,height:z,borderRadius:16,alignItems:"center",justifyContent:"center"}}),ve=48,xt=N.getAssetIDByName("CheckmarkLargeIcon"),Pt=l.findByStoreName("SortedGuildStore"),U=l.findByStoreName("GuildChannelStore"),Tt=l.findByStoreName("ChannelStore"),At=C(function(){return m("triggerHapticFeedback","HapticFeedbackTypes")}),Ht=C(function(){return m("bulkAck","ackChannel")}),Vt=C(function(){return m("ReadStateTypes","UnreadSetting")?.ReadStateTypes});function Gt(){const e=(Pt?.getGuildsTree?.()?.root?.children??[]).filter(function(s){return s?.type!=="root"}),t=[],r=function(s){for(const i of s)i.type==="folder"?r(i.children??[]):i.id!=null&&t.push(String(i.id))};return r(e),t}function vt(){const e=Ht(),t=Vt();if(!e?.bulkAck||t?.CHANNEL==null||!U?.getSelectableChannelIds||!U?.getVocalChannelIds){k.showToast("Couldn't find Discord's read-state action - this may be unavailable on your version.",void 0);return}const r=Gt();if(r.length===0){k.showToast("Nothing to mark as read.",void 0);return}const s=[];for(const i of r){const a=[...U.getSelectableChannelIds(i)??[],...U.getVocalChannelIds(i)??[]];for(const u of a)s.push({channelId:u,readStateType:t.CHANNEL,messageId:Tt?.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 Qt(){const e=n.useCallback(function(){const t=At();t?.triggerHapticFeedback?.(t.HapticFeedbackTypes.SOFT),vt()},[]);return n.createElement(o.Pressable,{onPress:e,style:Mt.outer},n.createElement(o.Image,{source:xt,style:{width:24,height:24,tintColor:"#80848e"}}))}const Mt=o.StyleSheet.create({outer:{width:ve,height:ve,alignItems:"center",justifyContent:"center"}}),Lt=l.findByProps("useStateFromStores"),Qe=l.findByStoreName("SortedGuildStore"),jt=C(function(){return m("getRootNavigationRef")}),Me=C(function(){return m("triggerHapticFeedback","HapticFeedbackTypes")}),Ot=C(function(){return m("transitionToGuild")}),_t=C(function(){return I(function(e){return typeof e?.handleCreateJoinGuildPress=="function"})}),zt=C(function(){return I(function(e){return e?.CirclePlusIcon})?.CirclePlusIcon}),Ut=C(function(){return m("colors","unsafe_rawColors")?.unsafe_rawColors}),Wt=l.find(function(e){return e?.QuestDockExternalCoordinationContext}),Le=Wt?.QuestDockExternalCoordinationContext,je=l.find(function(e){return e?.QuestDockMode?.COLLAPSED!=null})?.QuestDockMode,W=48,q=6,qt=12;function Xt(){const e=n.useRef(new o.Animated.Value(1)).current,t=n.useCallback(function(){o.Animated.spring(e,{toValue:.9,useNativeDriver:!0}).start()},[e]),r=n.useCallback(function(){o.Animated.spring(e,{toValue:1,useNativeDriver:!0}).start()},[e]),s=n.useCallback(function(){const u=Me();u?.triggerHapticFeedback?.(u.HapticFeedbackTypes.SOFT),_t()?.handleCreateJoinGuildPress?.()},[]),i=zt(),a=Ut();return n.createElement(o.Pressable,{onPress:s,onPressIn:t,onPressOut:r},n.createElement(o.Animated.View,{style:[X.createJoin,{backgroundColor:a?.GREEN_360,transform:[{scale:e}]}]},i?n.createElement(i,{size:"md",color:a?.WHITE}):n.createElement(o.Text,{style:[X.createJoinFallback,{color:a?.WHITE}]},"+")))}function Oe({gestureContext:e}){const t=n.useCallback(function(d){const S=Me();S?.triggerHapticFeedback?.(S.HapticFeedbackTypes.SOFT);const B=Ot();B?.transitionToGuild?B.transitionToGuild(d):jt()?.getRootNavigationRef?.()?.navigate("guilds",{guildId:d})},[]),r=Lt?.useStateFromStores?.([Qe],function(){return(Qe?.getGuildsTree()?.root?.children||[]).filter(function(d){return d.type!=="root"})})??[],s=e?n.useContext(e):null,i=s?.minExpandedContentHeight,a=n.useCallback(function(d){if(!i)return;const S=d.nativeEvent.layout.height;i.get()!==S&&i.set(S)},[i]),u=(Le?n.useContext(Le):null)?.setRestingQuestDockMode,y=s?.questDockWrapperSpecs;n.useEffect(function(){if(!u||!je||!y)return;const d=o.BackHandler.addEventListener("hardwareBackPress",function(){return(y.get()?.height??56)>80?(u(je.COLLAPSED),!0):!1});return function(){return d.remove()}},[u,y]);const{width:h}=o.Dimensions.get("window"),b=Math.max(3,Math.floor((h-qt*2+q)/(W+q))),g=b*W+(b-1)*q,w=Math.max(0,(h-g)/2);return n.createElement(o.View,{style:X.alignTop},n.createElement(o.View,{style:[X.grid,{paddingHorizontal:w,gap:q}],onLayout:a},n.createElement(Bt,null),r.map(function(d){return d.type==="folder"?n.createElement(wt,{key:d.id,node:d,onPick:t}):n.createElement(Re,{key:d.id,node:d,onPick:t})}),n.createElement(Xt,null),n.createElement(Qt,null)))}const X=o.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}}),le=new Map,ae=[];let J=!1;function Jt(e,t,r){le.set(e,{replacement:t,extraProps:r})}function Kt(e,t){ae.push({predicate:e,replacement:t})}function _e(e,t){if(t)for(const{predicate:s,replacement:i}of ae)try{if(s(t))return i?{type:i,props:t}:null}catch{}const r=le.get(e);if(r)return{type:r.replacement,props:r.extraProps?{...t,...r.extraProps}:t}}function Yt(e){if(J)return;const t=c.React.createElement;if(!t){console.warn("[ServerDrawer] React.createElement is null, skipping patch");return}const r=function(a,u,...y){const h=_e(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(r,t),c.React.createElement=r,J=!0;const s=I(function(a){return typeof a?.jsx=="function"&&typeof a?.jsxs=="function"&&"Fragment"in a}),i=[];if(s)for(const a of["jsx","jsxs"]){const u=s[a];typeof u=="function"&&(s[a]=function(y,h,...b){const g=_e(y,h);return g===null?null:g?u.call(this,g.type,g.props,...b):u.call(this,y,h,...b)},i.push(function(){s[a]=u}))}else console.warn("[ServerDrawer] jsx-runtime module not found, only classic createElement calls will be intercepted");e.push(function(){J&&(c.React.createElement=t,J=!1),i.forEach(function(a){return a()}),le.clear(),ae.length=0})}const ue="[ServerDrawer]";let ce=null;function ze(){return ce||(ce=I(function(e){return e?.QuestDockGestureContext})?.QuestDockGestureContext??null),ce}function Zt(e){const t=I(function(s){return s?.type?.displayName==="QuestDockContentExpanded"||s?.type?.name==="QuestDockContentExpanded"});if(!t?.type)return console.log(ue,"WARN: QuestDockContentExpanded not found (will retry)"),!1;const r=t.type;return Jt(r,Oe,{gestureContext:ze()}),t.type=function(){return c.React.createElement(Oe,{gestureContext:ze()})},e.push(function(){t.type=r}),console.log(ue,"PATCH: QuestDockContentExpanded replaced"),!0}function A(e,t){const r=I(function(a){return a?.type?.displayName===e||a?.type?.name===e});if(!r?.type)return console.log(ue,`WARN: ${e} not found`),!1;const s=r.type,i=s;return r.type=function(){return null},i&&(Object.defineProperties(r.type,Object.getOwnPropertyDescriptors(i)),r.type.displayName=e),t.push(function(){r.type=s}),!0}const $t="[ServerDrawer]";function Nt(e){return Kt(function(t){return t?.nativeID==="guilds-bar-view"},null),e.push(function(){}),console.log($t,"PATCH: guilds-bar-view createElement calls now render nothing"),!0}function en(e){const t=Ye("ExpandedGuildFolderStore");if(!t?.getExpandedFolders)return!1;const r=function({folderId:s}){if(!f.storage.autoCollapseFolders||s==null)return;const i=t.getExpandedFolders();if(!(!(i instanceof Set)||!i.has(s)))for(const a of i)a!==s&&c.FluxDispatcher.dispatch({type:"TOGGLE_GUILD_FOLDER_EXPAND",folderId:a})};return c.FluxDispatcher.subscribe("TOGGLE_GUILD_FOLDER_EXPAND",r),e.push(function(){return c.FluxDispatcher.unsubscribe("TOGGLE_GUILD_FOLDER_EXPAND",r)}),!0}const{ScrollView:tn,View:nn}=c.ReactNative;function rn({children:e}){return c.React.createElement(tn,{style:{flex:1}},e,c.React.createElement(nn,{style:{height:24}}))}const{View:on,Text:sn}=c.ReactNative;function Ue({children:e,style:t}){return c.React.createElement(on,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},c.React.createElement(sn,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{FormSection:We,FormSwitchRow:K}=Ke.Forms;function ln(){return $.useProxy(f.storage),c.React.createElement(rn,null,c.React.createElement(Ue,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(We,{title:"Layout"},c.React.createElement(K,{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,Je()}}),c.React.createElement(K,{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(We,{title:"Folders"},c.React.createElement(K,{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(K,{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(Ue,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 p=[],E;function an(e,t){try{return t()}catch(r){return Z.logger.error(`[ServerDrawer] "${e}" patch threw, skipping: ${r}`),!1}}function qe(){const e={questDockRender:function(){return Ze(p)},questDockBase:function(){return $e(p)},mobileQuestDock:function(){return Ne(p)},getQuestAsset:function(){return tt(p)},expanded:function(){return Zt(p)},collapsed:function(){return A("QuestDockContentCollapsed",p)},enrolledHeader:function(){return A("QuestDockEnrolledHeader",p)},unenrolledHeader:function(){return A("QuestDockUnenrolledHeader",p)},enrolledBody:function(){return A("QuestDockEnrolledBody",p)},unenrolledBody:function(){return A("QuestDockUnenrolledBody",p)},autoCollapseFolders:function(){return en(p)},...f.storage.hideGuildsBar?{hideGuildsBar:function(){return Nt(p)}}:{}};Yt(p);const t=new Set(Object.keys(e)),r=new Set,s=function(){for(const i of t)an(i,e[i])&&(r.add(i),t.delete(i));t.size===0&&E&&(clearInterval(E),E=void 0)};if(s(),t.size>0){let i=0;E=setInterval(function(){s(),++i>=50&&E&&(clearInterval(E),E=void 0,t.size>0&&Z.logger.error(`[ServerDrawer] Gave up waiting on: ${[...t].join(", ")}`))},200)}Z.logger.log(`[ServerDrawer] onLoad: applied immediately - ${[...r].join(", ")||"none"}${t.size?`, still waiting on ${[...t].join(", ")}`:""}`)}function Xe(){E&&(clearInterval(E),E=void 0);for(const e of p)try{e()}catch{}p=[]}function Je(){Xe(),qe()}var un={onLoad:function(){f.storage.hideGuildsBar??=!0,f.storage.showUnreadBadges??=!0,f.storage.autoCollapseFolders??=!1,f.storage.hideFolderIcons??=!1,qe()},onUnload:function(){return Xe()},settings:ln};return v.default=un,v.restart=Je,Object.defineProperty(v,"__esModule",{value:!0}),v})({},vendetta,vendetta.plugin,vendetta.metro.common,window.React,vendetta.metro.common.ReactNative,vendetta.metro,vendetta.storage,vendetta.ui.toasts,vendetta.ui,vendetta.ui.assets,vendetta.ui.components); +(function(v,Z,f,c,n,r,l,$,k,Q,N,Ye){"use strict";const ee=new Map;function Ze(){const e=window?.modules;if(e)for(const t in e){const o=Number(t);if(!ee.has(o))try{const s=window.__r(o);s&&ee.set(o,s)}catch{}}}function I(e){Ze();for(const t of ee.values())try{if(e(t))return t;if(t?.default!=null&&e(t.default))return t.default}catch{}}function m(...e){return I(function(t){return e.every(function(o){return t?.[o]!==void 0})})}function $e(e){return I(function(t){return typeof t?.getName=="function"&&t.getName.length===0&&t.getName()===e})}function Ne(e){const t=m("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 et(e){const t=m("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 tt(e){const t=m("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 nt="[ServerDrawer]";function ot(e){const t=m("getQuestAsset");if(!t?.getQuestAsset)return console.log(nt,"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 C(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 me=l.findByStoreName("GuildStore"),rt=l.findByProps("useStateFromStores"),st=l.findByProps("colors","unsafe_rawColors")?.colors;function be({id:e,size:t=48}){const o=rt?.useStateFromStores?.([me],function(){return me?.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:[Se.fallback,{width:t,height:t,borderRadius:s,backgroundColor:st?.BG_ACCENT??"#5865f2"}]},n.createElement(r.Text,{style:[Se.letter,{fontSize:Math.max(10,t*.4)}]},o.name?.split(" ").map(function(i){return i[0]}).join("").slice(0,2).toUpperCase()||"?"))}const Se=r.StyleSheet.create({fallback:{alignItems:"center",justifyContent:"center"},letter:{color:"#fff",fontWeight:"700"}}),it=l.findByStoreName("ThemeStore"),lt=l.find(function(e){return e?.default?.internal?.resolveSemanticColor})?.default?.internal?.resolveSemanticColor??l.find(function(e){return e?.meta?.resolveSemanticColor})?.meta?.resolveSemanticColor??function(){};function at(e,t=it?.theme){if(e)try{return lt(t,e)}catch{return}}const Ce=l.findByProps("TextStyleSheet")?.TextStyleSheet,we=l.findByProps("triggerHapticFeedback","HapticFeedbackTypes");function M(e,t){return at(e)??t}const F=12,te=12,Ee=42,ne=220,ke=4,P=16,L=20,Ie={tension:200,friction:20};function ut({visible:e,items:t,title:o,anchorX:s,anchorY:i,onClose:a}){const{width:u,height:y}=r.Dimensions.get("window"),h=(o?te+20+ke:0)+t.length*Ee;let b=s,g=i+48+10;b+ne>u-F&&(b=u-ne-F),by-F&&(g=i-h-10),g0?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 Fe({node:e,onPick:t}){const o=n.useRef(null),s=n.useRef(new r.Animated.Value(1)).current,i=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=ct?.getGuild?.(E);if(!d)return;const S=o.current;if(!S?.measure)return;const B=[{label:"Mark as Read",action:function(){return gt(E)}},{label:"Copy Server ID",action:function(){c.clipboard.setString(E),k.showToast("Copied server ID",void 0)}}];S.measure(function(H,V,G,fe,Y,x){y({visible:!0,items:B,title:d.name,x:Y,y:x})})},[e.id]),b=n.useCallback(function(){Re?.triggerHapticFeedback?.(Re.HapticFeedbackTypes.IMPACT_MEDIUM),h()},[h]),g=e.id;return n.createElement(n.Fragment,null,n.createElement(r.Pressable,{onPressIn:i,onPressOut:a,onPress:function(){return t(g)},onLongPress:b,delayLongPress:500},n.createElement(r.View,{ref:o,style:Be.outer,collapsable:!1},n.createElement(r.Animated.View,{style:[Be.icon,{transform:[{scale:s}]}]},n.createElement(be,{id:g})),n.createElement(pt,{guildId:g}))),n.createElement(ut,{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 Be=r.StyleSheet.create({outer:{width:j,height:j},icon:{width:j,height:j,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"}}),yt=l.findByProps("useStateFromStores");l.findByProps("colors","unsafe_rawColors")?.colors;const xe=l.findByStoreName("ExpandedGuildFolderStore");function mt(e){return yt?.useStateFromStores?.([xe],function(){const t=xe?.getExpandedFolders?.();return t instanceof Set?t.has(e):!1},[e])??!1}const bt=l.findByProps("toggleGuildFolderExpand"),St=l.findByProps("useStateFromStores"),Pe=l.findByStoreName("GuildReadStateStore"),D=48,se=16,Ct=[{top:6,left:6},{top:6,right:6},{bottom:6,left:6},{bottom:6,right:6}],Te=N.getAssetIDByName("FolderIcon");function Ae(e){return e==null?"#5865f2":`#${e.toString(16).padStart(6,"0")}`}function wt({node:e}){const t=St?.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:le.outline},n.createElement(r.View,{style:le.badge},n.createElement(r.Text,{style:le.text},t>99?"99+":String(t)))):null}function Et({node:e}){$.useProxy(f.storage);const t=Ae(e.color);return n.createElement(r.View,{style:_.outer},n.createElement(r.View,{style:[_.icon,{backgroundColor:t}]},f.storage.hideFolderIcons?n.createElement(r.View,{style:_.plainIcon},n.createElement(r.Image,{source:Te,style:ie.folderImg,tintColor:"#fff"})):e.children.slice(0,4).map(function(o,s){return n.createElement(r.View,{key:o.id,style:[_.cell,Ct[s]]},n.createElement(be,{id:o.id,size:se}))})),n.createElement(wt,{node:e}))}const _=r.StyleSheet.create({outer:{width:D,height:D},icon:{width:D,height:D,borderRadius:16,overflow:"hidden"},cell:{position:"absolute",width:se,height:se,borderRadius:8,overflow:"hidden"},plainIcon:{width:D,height:D,alignItems:"center",justifyContent:"center"}});function kt({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 It({node:e,onPick:t}){const o=mt(e.id),s=function(){bt?.toggleGuildFolderExpand?.(e.id)};return o?n.createElement(n.Fragment,null,n.createElement(r.Pressable,{onPress:s},n.createElement(r.View,{style:[ie.openIcon,{backgroundColor:Ae(e.color)}]},n.createElement(r.Image,{source:Te,style:ie.folderImg,tintColor:"#fff"}))),e.children.map(function(i){return n.createElement(kt,{key:i.id},n.createElement(Fe,{node:i,onPick:t}))})):n.createElement(r.Pressable,{onPress:s},n.createElement(Et,{node:e}))}const ie=r.StyleSheet.create({openIcon:{width:D,height:D,borderRadius:16,alignItems:"center",justifyContent:"center"},folderImg:{width:24,height:24}}),le=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}}),z=48,Dt=N.getAssetIDByName("ChatIcon"),He=l.findByProps("triggerHapticFeedback","HapticFeedbackTypes"),Ve=l.findByProps("selectPrivateChannel"),Rt=l.findByName("SelectedChannelStore"),Ft=l.findByProps("useStateFromStores"),Ge=l.findByProps("getGuildId"),Bt=l.findByProps("colors","unsafe_rawColors")?.colors;function xt(){if(He?.triggerHapticFeedback(He.HapticFeedbackTypes.SOFT),Ve?.selectPrivateChannel){const e=Rt?.getLastSelectedChannelId?.();Ve.selectPrivateChannel(e)}}function Pt(){const e=Ft?.useStateFromStores?.([Ge],function(){return Ge?.getGuildId?.()==null})??!1;return n.createElement(r.Pressable,{onPress:xt,style:ve.outer},n.createElement(r.View,{style:[ve.icon,{backgroundColor:e?Bt?.BG_ACCENT??"#5865f2":"rgba(128,128,128,0.24)"}]},n.createElement(r.Image,{source:Dt,style:{width:24,height:24,tintColor:"#fff"}})))}const ve=r.StyleSheet.create({outer:{width:z,height:z},icon:{width:z,height:z,borderRadius:16,alignItems:"center",justifyContent:"center"}}),Qe=48,Tt=N.getAssetIDByName("CheckmarkLargeIcon"),At=l.findByStoreName("SortedGuildStore"),U=l.findByStoreName("GuildChannelStore"),Ht=l.findByStoreName("ChannelStore"),Vt=C(function(){return m("triggerHapticFeedback","HapticFeedbackTypes")}),Gt=C(function(){return m("bulkAck","ackChannel")}),vt=C(function(){return m("ReadStateTypes","UnreadSetting")?.ReadStateTypes});function Qt(){const e=(At?.getGuildsTree?.()?.root?.children??[]).filter(function(s){return s?.type!=="root"}),t=[],o=function(s){for(const i of s)i.type==="folder"?o(i.children??[]):i.id!=null&&t.push(String(i.id))};return o(e),t}function Mt(){const e=Gt(),t=vt();if(!e?.bulkAck||t?.CHANNEL==null||!U?.getSelectableChannelIds||!U?.getVocalChannelIds){k.showToast("Couldn't find Discord's read-state action - this may be unavailable on your version.",void 0);return}const o=Qt();if(o.length===0){k.showToast("Nothing to mark as read.",void 0);return}const s=[];for(const i of o){const a=[...U.getSelectableChannelIds(i)??[],...U.getVocalChannelIds(i)??[]];for(const u of a)s.push({channelId:u,readStateType:t.CHANNEL,messageId:Ht?.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 Lt(){const e=n.useCallback(function(){const t=Vt();t?.triggerHapticFeedback?.(t.HapticFeedbackTypes.SOFT),Mt()},[]);return n.createElement(r.Pressable,{onPress:e,style:jt.outer},n.createElement(r.Image,{source:Tt,style:{width:24,height:24,tintColor:"#80848e"}}))}const jt=r.StyleSheet.create({outer:{width:Qe,height:Qe,alignItems:"center",justifyContent:"center"}}),Ot=l.findByProps("useStateFromStores"),Me=l.findByStoreName("SortedGuildStore"),_t=C(function(){return m("getRootNavigationRef")}),Le=C(function(){return m("triggerHapticFeedback","HapticFeedbackTypes")}),zt=C(function(){return m("transitionToGuild")}),Ut=C(function(){return I(function(e){return typeof e?.handleCreateJoinGuildPress=="function"})}),Wt=C(function(){return I(function(e){return e?.CirclePlusIcon})?.CirclePlusIcon}),qt=C(function(){return m("colors","unsafe_rawColors")?.unsafe_rawColors}),Xt=l.find(function(e){return e?.QuestDockExternalCoordinationContext}),je=Xt?.QuestDockExternalCoordinationContext,Oe=l.find(function(e){return e?.QuestDockMode?.COLLAPSED!=null})?.QuestDockMode,W=48,q=6,Jt=12;function Kt(){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=Le();u?.triggerHapticFeedback?.(u.HapticFeedbackTypes.SOFT),Ut()?.handleCreateJoinGuildPress?.()},[]),i=Wt(),a=qt();return n.createElement(r.Pressable,{onPress:s,onPressIn:t,onPressOut:o},n.createElement(r.Animated.View,{style:[X.createJoin,{backgroundColor:a?.GREEN_360,transform:[{scale:e}]}]},i?n.createElement(i,{size:"md",color:a?.WHITE}):n.createElement(r.Text,{style:[X.createJoinFallback,{color:a?.WHITE}]},"+")))}function _e({gestureContext:e}){const t=n.useCallback(function(d){const S=Le();S?.triggerHapticFeedback?.(S.HapticFeedbackTypes.SOFT);const B=zt();B?.transitionToGuild?B.transitionToGuild(d):_t()?.getRootNavigationRef?.()?.navigate("guilds",{guildId:d})},[]),o=Ot?.useStateFromStores?.([Me],function(){return(Me?.getGuildsTree()?.root?.children||[]).filter(function(d){return d.type!=="root"})})??[],s=e?n.useContext(e):null,i=s?.minExpandedContentHeight,a=n.useCallback(function(d){if(!i)return;const S=d.nativeEvent.layout.height;i.get()!==S&&i.set(S)},[i]),u=(je?n.useContext(je):null)?.setRestingQuestDockMode,y=s?.questDockWrapperSpecs;n.useEffect(function(){if(!u||!Oe||!y)return;const d=r.BackHandler.addEventListener("hardwareBackPress",function(){return(y.get()?.height??56)>80?(u(Oe.COLLAPSED),!0):!1});return function(){return d.remove()}},[u,y]);const{width:h}=r.Dimensions.get("window"),b=Math.max(3,Math.floor((h-Jt*2+q)/(W+q))),g=b*W+(b-1)*q,E=Math.max(0,(h-g)/2);return n.createElement(r.View,{style:X.alignTop},n.createElement(r.View,{style:[X.grid,{paddingHorizontal:E,gap:q}],onLayout:a},n.createElement(Pt,null),o.map(function(d){return d.type==="folder"?n.createElement(It,{key:d.id,node:d,onPick:t}):n.createElement(Fe,{key:d.id,node:d,onPick:t})}),n.createElement(Kt,null),n.createElement(Lt,null)))}const X=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}}),ae=new Map,ue=[];let J=!1;function Yt(e,t,o){ae.set(e,{replacement:t,extraProps:o})}function Zt(e,t){ue.push({predicate:e,replacement:t})}function ze(e,t){if(t)for(const{predicate:s,replacement:i}of ue)try{if(s(t))return i?{type:i,props:t}:null}catch{}const o=ae.get(e);if(o)return{type:o.replacement,props:o.extraProps?{...t,...o.extraProps}:t}}function $t(e){if(J)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=ze(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,J=!0;const s=I(function(a){return typeof a?.jsx=="function"&&typeof a?.jsxs=="function"&&"Fragment"in a}),i=[];if(s)for(const a of["jsx","jsxs"]){const u=s[a];typeof u=="function"&&(s[a]=function(y,h,...b){const g=ze(y,h);return g===null?null:g?u.call(this,g.type,g.props,...b):u.call(this,y,h,...b)},i.push(function(){s[a]=u}))}else console.warn("[ServerDrawer] jsx-runtime module not found, only classic createElement calls will be intercepted");e.push(function(){J&&(c.React.createElement=t,J=!1),i.forEach(function(a){return a()}),ae.clear(),ue.length=0})}const ce="[ServerDrawer]";let de=null;function Ue(){return de||(de=I(function(e){return e?.QuestDockGestureContext})?.QuestDockGestureContext??null),de}function Nt(e){const t=I(function(s){return s?.type?.displayName==="QuestDockContentExpanded"||s?.type?.name==="QuestDockContentExpanded"});if(!t?.type)return console.log(ce,"WARN: QuestDockContentExpanded not found (will retry)"),!1;const o=t.type;return Yt(o,_e,{gestureContext:Ue()}),t.type=function(){return c.React.createElement(_e,{gestureContext:Ue()})},e.push(function(){t.type=o}),console.log(ce,"PATCH: QuestDockContentExpanded replaced"),!0}function A(e,t){const o=I(function(a){return a?.type?.displayName===e||a?.type?.name===e});if(!o?.type)return console.log(ce,`WARN: ${e} not found`),!1;const s=o.type,i=s;return o.type=function(){return null},i&&(Object.defineProperties(o.type,Object.getOwnPropertyDescriptors(i)),o.type.displayName=e),t.push(function(){o.type=s}),!0}const en="[ServerDrawer]";function tn(e){return Zt(function(t){return t?.nativeID==="guilds-bar-view"},null),e.push(function(){}),console.log(en,"PATCH: guilds-bar-view createElement calls now render nothing"),!0}function nn(e){const t=$e("ExpandedGuildFolderStore");if(!t?.getExpandedFolders)return!1;const o=function({folderId:s}){if(!f.storage.autoCollapseFolders||s==null)return;const i=t.getExpandedFolders();if(!(!(i instanceof Set)||!i.has(s)))for(const a of i)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:on,View:rn}=c.ReactNative;function sn({children:e}){return c.React.createElement(on,{style:{flex:1}},e,c.React.createElement(rn,{style:{height:24}}))}const{View:ln,Text:an}=c.ReactNative;function We({children:e,style:t}){return c.React.createElement(ln,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},c.React.createElement(an,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{FormSection:qe,FormSwitchRow:K}=Ye.Forms;function un(){return $.useProxy(f.storage),c.React.createElement(sn,null,c.React.createElement(We,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(qe,{title:"Layout"},c.React.createElement(K,{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,Ke()}}),c.React.createElement(K,{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(qe,{title:"Folders"},c.React.createElement(K,{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(K,{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(We,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 p=[],w;function cn(e,t){try{return t()}catch(o){return Z.logger.error(`[ServerDrawer] "${e}" patch threw, skipping: ${o}`),!1}}function Xe(){const e={questDockRender:function(){return Ne(p)},questDockBase:function(){return et(p)},mobileQuestDock:function(){return tt(p)},getQuestAsset:function(){return ot(p)},expanded:function(){return Nt(p)},collapsed:function(){return A("QuestDockContentCollapsed",p)},enrolledHeader:function(){return A("QuestDockEnrolledHeader",p)},unenrolledHeader:function(){return A("QuestDockUnenrolledHeader",p)},enrolledBody:function(){return A("QuestDockEnrolledBody",p)},unenrolledBody:function(){return A("QuestDockUnenrolledBody",p)},autoCollapseFolders:function(){return nn(p)},...f.storage.hideGuildsBar?{hideGuildsBar:function(){return tn(p)}}:{}};$t(p);const t=new Set(Object.keys(e)),o=new Set,s=function(){for(const i of t)cn(i,e[i])&&(o.add(i),t.delete(i));t.size===0&&w&&(clearInterval(w),w=void 0)};if(s(),t.size>0){let i=0;w=setInterval(function(){s(),++i>=50&&w&&(clearInterval(w),w=void 0,t.size>0&&Z.logger.error(`[ServerDrawer] Gave up waiting on: ${[...t].join(", ")}`))},200)}Z.logger.log(`[ServerDrawer] onLoad: applied immediately - ${[...o].join(", ")||"none"}${t.size?`, still waiting on ${[...t].join(", ")}`:""}`)}function Je(){w&&(clearInterval(w),w=void 0);for(const e of p)try{e()}catch{}p=[]}function Ke(){Je(),Xe()}var dn={onLoad:function(){f.storage.hideGuildsBar??=!0,f.storage.showUnreadBadges??=!0,f.storage.autoCollapseFolders??=!1,f.storage.hideFolderIcons??=!1,Xe()},onUnload:function(){return Je()},settings:un};return v.default=dn,v.restart=Ke,Object.defineProperty(v,"__esModule",{value:!0}),v})({},vendetta,vendetta.plugin,vendetta.metro.common,window.React,vendetta.metro.common.ReactNative,vendetta.metro,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 ec9d727..42b9954 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":"62da0b243b3340111493d8ac2b66fdb23f7115b94b46134db13f2d05353c33b8"} \ 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":"04043e6e6dd35166e5b53c10e790c71dbc13eb0856ead7a23214b875472170e4"} \ No newline at end of file diff --git a/you-bar-plus/install/index.js b/you-bar-plus/install/index.js index ff908c9..78679e7 100644 --- a/you-bar-plus/install/index.js +++ b/you-bar-plus/install/index.js @@ -1 +1 @@ -(function(d,v,i,h,n,B,p,R,b){"use strict";function S(t,e,o,r){try{return o()}catch(a){return r.error(`[${t}] Failed to apply the "${e}" patch, that surface will be skipped: ${a}`),function(){}}}function E(t,e,o){const r=Object.entries(o).map(function([a,u]){return S(t,a,u,e)});return function(){return r.forEach(function(a){return a()})}}function P(t,e,o=100){let r=!1,a;const u=t();return u?(e(u),{cancel(){}}):(a=setInterval(function(){if(r)return;const c=t();c&&(r=!0,clearInterval(a),e(c))},o),{cancel(){r=!0,a&&clearInterval(a)}})}function F(t){const e=window?.modules;if(e)for(const o in e){let r;try{r=window.__r(Number(o))}catch{continue}if(r)try{if(t(r))return r;if(r.default!=null&&t(r.default))return r.default}catch{}}}function I(t){return F(function(e){return e?.name===t||e?.displayName===t||e?.type?.name===t||e?.type?.displayName===t})}let l=function(){};function N(){let t=function(){};const e=P(function(){return I("YouBarNotificationsButton")},function(o){t=D(o)});return function(){e.cancel(),t()}}function D(t){const e=h.findByProps("openUserSettings"),o=h.findByProps("transitionToGuild"),r=p.getAssetIDByName("ChatIcon"),a=p.getAssetIDByName("SettingsIcon");return B.instead("type",t,function(u,c){try{const[,k]=n.React.useReducer(function(x){return~x},0);l=function(){return k()};const s=c(...u);if(!s?.props?.children)return s;const w=s.props.children.type,f=s.props.children.props;return n.React.createElement(n.React.Fragment,null,i.storage.showDMButton&&n.React.createElement(w,{variant:f?.variant||"tertiary",size:f?.size||"sm",icon:r,onPress:function(){return o?.transitionToGuild?.("@me")}}),i.storage.showSettingsButton&&n.React.createElement(w,{variant:f?.variant||"tertiary",size:f?.size||"sm",icon:a,onPress:function(){return e?.openUserSettings?.()}}),s)}catch{return c(...u)}})}const{ScrollView:M,View:V}=n.ReactNative;function Y({children:t}){return n.React.createElement(M,{style:{flex:1}},t,n.React.createElement(V,{style:{height:24}}))}const{View:m,Text:z}=n.ReactNative;function $({children:t,style:e}){return n.React.createElement(m,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},e]},n.React.createElement(z,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},t))}const{FormSection:C,FormSwitchRow:y}=b.Forms;function T(){return R.useProxy(i.storage),n.React.useEffect(function(){return function(){return l()}},[]),n.React.createElement(Y,null,n.React.createElement($,null,"Fork of Purple-EyeZ's YouBar+, ported to Revenge's Vendetta-compat API with a fix for a startup race that could silently skip the button patch for an entire session."),n.React.createElement(C,{title:"Buttons"},n.React.createElement(y,{label:"Direct Messages button",subLabel:"Show the DM button in the YouBar",value:!!i.storage.showDMButton,onValueChange:function(t){i.storage.showDMButton=t,l()}}),n.React.createElement(y,{label:"Settings button",subLabel:"Show the Settings button in the YouBar",value:!!i.storage.showSettingsButton,onValueChange:function(t){i.storage.showSettingsButton=t,l()}})))}let g=function(){};var _={onLoad:function(){i.storage.showDMButton??=!1,i.storage.showSettingsButton??=!0,g=E("YouBar+",v.logger,{"YouBar buttons":N})},onUnload:function(){return g()},settings:T};return d.default=_,Object.defineProperty(d,"__esModule",{value:!0}),d})({},vendetta,vendetta.plugin,vendetta.metro,vendetta.metro.common,vendetta.patcher,vendetta.ui.assets,vendetta.storage,vendetta.ui.components); +(function(d,B,i,p,n,R,y,b,S){"use strict";function E(t,e,r,a){try{return r()}catch(o){return a.error(`[${t}] Failed to apply the "${e}" patch, that surface will be skipped: ${o}`),function(){}}}function P(t,e,r){const a=Object.entries(r).map(function([o,u]){return E(t,o,u,e)});return function(){return a.forEach(function(o){return o()})}}function F(t,e,r=100){let a=!1,o;const u=t();return u?(e(u),{cancel(){}}):(o=setInterval(function(){if(a)return;const c=t();c&&(a=!0,clearInterval(o),e(c))},r),{cancel(){a=!0,o&&clearInterval(o)}})}const h=new Map;function I(){const t=window?.modules;if(t)for(const e in t){const r=Number(e);if(!h.has(r))try{const a=window.__r(r);a&&h.set(r,a)}catch{}}}function N(t){I();for(const e of h.values())try{if(t(e))return e;if(e?.default!=null&&t(e.default))return e.default}catch{}}function D(t){return N(function(e){return e?.name===t||e?.displayName===t||e?.type?.name===t||e?.type?.displayName===t})}let l=function(){};function M(){let t=function(){};const e=F(function(){return D("YouBarNotificationsButton")},function(r){t=V(r)});return function(){e.cancel(),t()}}function V(t){const e=p.findByProps("openUserSettings"),r=p.findByProps("transitionToGuild"),a=y.getAssetIDByName("ChatIcon"),o=y.getAssetIDByName("SettingsIcon");return R.instead("type",t,function(u,c){try{const[,A]=n.React.useReducer(function(L){return~L},0);l=function(){return A()};const s=c(...u);if(!s?.props?.children)return s;const v=s.props.children.type,f=s.props.children.props;return n.React.createElement(n.React.Fragment,null,i.storage.showDMButton&&n.React.createElement(v,{variant:f?.variant||"tertiary",size:f?.size||"sm",icon:a,onPress:function(){return r?.transitionToGuild?.("@me")}}),i.storage.showSettingsButton&&n.React.createElement(v,{variant:f?.variant||"tertiary",size:f?.size||"sm",icon:o,onPress:function(){return e?.openUserSettings?.()}}),s)}catch{return c(...u)}})}const{ScrollView:Y,View:m}=n.ReactNative;function z({children:t}){return n.React.createElement(Y,{style:{flex:1}},t,n.React.createElement(m,{style:{height:24}}))}const{View:$,Text:C}=n.ReactNative;function T({children:t,style:e}){return n.React.createElement($,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},e]},n.React.createElement(C,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},t))}const{FormSection:_,FormSwitchRow:g}=S.Forms;function k(){return b.useProxy(i.storage),n.React.useEffect(function(){return function(){return l()}},[]),n.React.createElement(z,null,n.React.createElement(T,null,"Fork of Purple-EyeZ's YouBar+, ported to Revenge's Vendetta-compat API with a fix for a startup race that could silently skip the button patch for an entire session."),n.React.createElement(_,{title:"Buttons"},n.React.createElement(g,{label:"Direct Messages button",subLabel:"Show the DM button in the YouBar",value:!!i.storage.showDMButton,onValueChange:function(t){i.storage.showDMButton=t,l()}}),n.React.createElement(g,{label:"Settings button",subLabel:"Show the Settings button in the YouBar",value:!!i.storage.showSettingsButton,onValueChange:function(t){i.storage.showSettingsButton=t,l()}})))}let w=function(){};var x={onLoad:function(){i.storage.showDMButton??=!1,i.storage.showSettingsButton??=!0,w=P("YouBar+",B.logger,{"YouBar buttons":M})},onUnload:function(){return w()},settings:k};return d.default=x,Object.defineProperty(d,"__esModule",{value:!0}),d})({},vendetta,vendetta.plugin,vendetta.metro,vendetta.metro.common,vendetta.patcher,vendetta.ui.assets,vendetta.storage,vendetta.ui.components); diff --git a/you-bar-plus/install/manifest.json b/you-bar-plus/install/manifest.json index 8817263..d0aa83d 100644 --- a/you-bar-plus/install/manifest.json +++ b/you-bar-plus/install/manifest.json @@ -1 +1 @@ -{"name":"YouBar+","description":"Adds up to 2 configurable buttons (Direct Messages, Settings, or none) to the YouBar, in whatever order you pick.","authors":[{"name":"everestmcarthur"},{"name":"Purple_Ξye™"}],"main":"index.js","hash":"56e58af103a1dd3367cc7d92c48a0ec571187849f3a833875ea1165ccd743c7b"} \ No newline at end of file +{"name":"YouBar+","description":"Adds up to 2 configurable buttons (Direct Messages, Settings, or none) to the YouBar, in whatever order you pick.","authors":[{"name":"everestmcarthur"},{"name":"Purple_Ξye™"}],"main":"index.js","hash":"d73c15987b30a195ee5043525a3c55d0fa00aa31ed3fc6aafa88be1931bf3180"} \ No newline at end of file