From 8edf2689056d47673f23b572e3cd6e1f213344c5 Mon Sep 17 00:00:00 2001 From: everestmcarthur Date: Sun, 2 Aug 2026 15:49:09 +0000 Subject: [PATCH] deploy: e9e918f25d365c0c75381cc53f8c34d1651aeea5 --- rose-utils/install/index.js | 8 ++++---- rose-utils/install/manifest.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rose-utils/install/index.js b/rose-utils/install/index.js index 1970875..04ab00a 100644 --- a/rose-utils/install/index.js +++ b/rose-utils/install/index.js @@ -1,5 +1,5 @@ -(function(N,$,s,r,y,le,d,F,f,L,_){"use strict";function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var n=0;nt&&(n.message.communicationDisabled=!0)}}))},onStop(){}}});const Ce=s.findByStoreName("ThemeStore"),Ee=s.find(function(e){return e?.default?.internal?.resolveSemanticColor})?.default?.internal?.resolveSemanticColor??s.find(function(e){return e?.meta?.resolveSemanticColor})?.meta?.resolveSemanticColor??function(){};function q(e,t=Ce?.theme){if(e)try{return Ee(t,e)}catch{return}}const{View:Te,Text:Ne}=r.ReactNative,Q={destructive:{bg:"#F23F42",fg:"#FFFFFF"},default:{bg:"#4E5058",fg:"#FFFFFF"}};function Fe({variant:e="default",children:t}){const n=Q[e]??Q.default;return r.React.createElement(Te,{style:{backgroundColor:n.bg,borderRadius:4,paddingHorizontal:4,paddingVertical:1,marginLeft:4,alignSelf:"center"}},r.React.createElement(Ne,{style:{color:n.fg,fontSize:10,fontWeight:"700",textTransform:"uppercase"}},t))}var Le="f47fd463dcaac61e.png",_e="f944dbd033a60207.png",Be="88eacd3588829ded.png",Pe="4d1aef97fe869aaf.png",Me="3a73d84a21043a5e.png",Ue="8b628d7e3fc05957.png",xe="cb7a2c9b3fb9561c.png",Oe="11d89273b5bd6cc6.png",We="ea31146eb15fdde7.png",Ve="b0d124bd12658047.png",je="cb8b45023e70bb61.png",Ge="a738efc867a225ee.png",ze="cba17334eeaf3198.png",Ye="fead9e69933db668.png",He="fead9e69933db668.png",Je="d6a4e512cdcf1078.png",Ke="9901722947705011.png",qe=function(e){return e.Lock="Lock",e.Warning="Warning",e.Controller="Controller",e}(qe||{});function Qe(e,t){if(e==="Lock")return t?We:Oe;if(e==="Warning")return t?Ke:Je;if(e==="Controller")return Be}const Xe={Lock:["#f0b232","STATUS_WARNING"],Warning:["#f23f43","STATUS_DANGER"],Controller:["#23a55a","STATUS_POSITIVE"]},Ze=[{name:"Announcements",kind:"Lock",base:Le},{name:"Announcements",kind:"Warning",base:_e},{name:"Text",kind:"Lock",base:Ge},{name:"Text",kind:"Warning",base:ze},{name:"Text",kind:"Controller",base:je},{name:"Voice",kind:"Lock",base:Ye},{name:"Voice",kind:"Warning",base:He},{name:"Forum",kind:"Lock",base:Pe},{name:"Forum",kind:"Warning",base:Me},{name:"Stage",kind:"Lock",bottom:!0,base:Ve},{name:"Stage",kind:"Warning",bottom:!0,base:0},{name:"Image",kind:"Lock",bottom:!0,base:Ue},{name:"Image",kind:"Warning",bottom:!0,base:xe}],X=s.findByName("ChannelInfo",!1),Z=s.findByProps("BaseChannelIcon");var et=new h({id:"colorful-channels",label:"Colorful Channels",meta:{sublabel:"Gives channel icons with symbols colors to make them more aesthetically pleasing",category:u.Useful},settings:{nsfwTag:{label:"NSFW tag",subLabel:"Adds a red NSFW tag next to channel names",type:"toggle",default:!0},colorIcons:{label:"Colored icon symbols",subLabel:"Turns locked channel symbols yellow, NSFW channel symbols red",type:"toggle",default:!0},colorIconsFallback:{label:"Fallback colors for colored icon symbols",subLabel:"Uses yellow, red and green colors regardless of theme",type:"toggle",default:!1}},handlers:{onStart(){var e=this;this.storage.options.nsfwTag&&X&&this.patches.add(y.after("default",X,function([{channel:t}],n){return r.React.createElement(r.React.Fragment,{},t?.nsfw_&&r.React.createElement(Fe,{variant:"destructive"},"nsfw"),n)})),this.storage.options.colorIcons&&Z?.BaseChannelIcon&&this.patches.add(y.after("BaseChannelIcon",Z,function([{source:t,style:n}],a){try{const o=typeof t?.original=="number"?f.getAssetByID(t.original)?.name:typeof t=="number"?f.getAssetByID(t)?.name:null;if(!o)return;const i=Ze.find(function(T){return o===`${T.name}${T.kind}Icon`});if(!i)return;const[l,g]=Xe[i.kind],m=Qe(i.kind,i.bottom),c=a?.props?.color?.replace(/-/g,"_")?.toUpperCase(),S=c&&L.semanticColors?.[c]?q(L.semanticColors[c]):void 0,w=r.ReactNative.StyleSheet.flatten([n,a?.props?.style,{width:18,height:18,tintColor:S}]),E=e.storage.options.colorIconsFallback?l:q(L.semanticColors?.[g])??l;return r.React.createElement(r.ReactNative.View,{},r.React.createElement(r.ReactNative.Image,{style:w,source:i.base}),r.React.createElement(r.ReactNative.View,{style:{position:"absolute",right:0,bottom:0}},r.React.createElement(r.ReactNative.Image,{style:{...w,tintColor:E},source:m})))}catch{return}}))},onStop(){}}});const U=s.findByProps("openLazy","hideActionSheet"),{ActionSheetRow:b}=s.findByProps("ActionSheetRow")??{},C=new Set;let I=null;function tt(e,t){return b?r.React.createElement(b,{label:e.label,subLabel:e.sublabel,icon:e.icon?r.React.createElement(b.Icon,{source:f.getAssetIDByName(e.icon)}):void 0,onPress:function(){try{e.onPress(t)}finally{U?.hideActionSheet?.()}},key:e.key}):null}function nt(e){const t=[];for(const n of C)try{for(const a of n(e)){const o=tt(a,e);o&&t.push(o)}}catch{}return t}function at(){return y.before("openLazy",U,function([e,t,n]){t!=="MessageLongPressActionSheet"||!n?.message||e.then(function(a){a.__roseUtilsActiveMessage=n.message,!a.__roseUtilsPatched&&(a.__roseUtilsPatched=!0,y.after("default",a,function(o,i){try{const l=nt(a.__roseUtilsActiveMessage);if(!l.length)return;const g=_.findInReactTree(i,function(c){return Array.isArray(c)&&c[0]?.type?.name==="ActionSheetRowGroup"});if(Array.isArray(g)&&g.length&&b){let c=!1;for(const S of g){const w=_.findInReactTree(S,function(E){return Array.isArray(E)&&E.some(function(T){return T?.type?.name==="ActionSheetRow"})});if(Array.isArray(w)){w.push(...l),c=!0;break}}if(!c&&typeof g.unshift=="function"&&b.Group&&(g.unshift(r.React.createElement(b.Group,{},l)),c=!0),c)return}const m=_.findInReactTree(i,function(c){return Array.isArray(c)&&c.length>0&&c.every(function(S){return typeof S?.props?.label=="string"&&typeof S?.props?.onPress=="function"})});Array.isArray(m)&&m.push(...l)}catch{}}))})})}function p(e){return!I&&U&&(I=at()),C.add(e),function(){C.delete(e),C.size===0&&I&&(I(),I=null)}}const rt=s.findByProps("DeveloperMode","DarkSidebar"),ee=s.findByStoreName("PresenceStore");function ot(e){const t=e?.interaction??e?.interactionMetadata??e?.interaction_metadata;return t?.id?{id:String(t.id),name:t.name}:null}function it(e){const t=ot(e);return t?[{key:"rose-utils-copy-command-id",label:"Copy Command ID",sublabel:t.name?`/${t.name}`:"Slash command interaction",icon:"ic_copy_24px",onPress:function(){r.clipboard.setString(t.id),d.showToast("Copied command ID to clipboard",f.getAssetIDByName("ic_copy_24px"))}}]:[]}function st(e){if(!ee?.getActivities)return[];const t=e?.author?.id;if(!t)return[];let n;try{n=ee.getActivities(t)}catch{return[]}if(!Array.isArray(n))return[];const a=n.filter(function(o){return o?.application_id??o?.applicationId});return a.length?a.map(function(o,i){const l=String(o.application_id??o.applicationId);return{key:`rose-utils-copy-activity-id-${i}`,label:a.length>1?`Copy Activity ID (${o.name??i+1})`:"Copy Activity/Game ID",sublabel:o.name,icon:"ic_copy_24px",onPress:function(){r.clipboard.setString(l),d.showToast(`Copied ${o.name??"activity"} ID to clipboard`,f.getAssetIDByName("ic_copy_24px"))}}}):[]}var lt=new h({id:"enforce-developer-mode",label:"Developer Mode",meta:{sublabel:"Turns on Discord's real Developer Mode (all its native Copy ID options) and adds extra copy-ID tools slash commands and activities don't get natively",category:u.Useful},settings:{keepNativeOn:{label:"Keep native Developer Mode on",subLabel:"Re-asserts Discord's own Developer Mode setting - it tends to reset itself on Revenge-based clients",type:"toggle",default:!0},copyCommandId:{label:"Copy Command ID",subLabel:"Adds a row to the message long-press menu for messages sent via a slash command",type:"toggle",default:!0},copyActivityId:{label:"Copy Activity/Game ID",subLabel:"Adds a row to the message long-press menu to copy the author's current game/activity application ID (not every activity type has one, e.g. a plain custom status)",type:"toggle",default:!0}},handlers:{onStart(){if(this.storage.options.keepNativeOn){const e=rt?.DeveloperMode;if(e?.getSetting&&e?.updateSetting){const t=function(){try{e.getSetting()||e.updateSetting(!0)}catch{}};t(),this.patches.add(D("USER_SETTINGS_PROTO_UPDATE",t));const n=setInterval(t,5e3);this.patches.add(function(){return clearInterval(n)})}}this.storage.options.copyCommandId&&this.patches.add(p(it)),this.storage.options.copyActivityId&&this.patches.add(p(st))},onStop(){}}});const v="ic_copy_24px";function R(e,t){r.clipboard.setString(e),d.showToast(t,f.getAssetIDByName(v))}function ct(e){const t=e?.webhookId??e?.webhook_id;return t?[{key:"rose-utils-copy-webhook-id",label:"Copy Webhook ID",icon:v,onPress:function(){return R(String(t),"Copied webhook ID to clipboard")}}]:[]}function ut(e){const t=e?.nonce;return t?[{key:"rose-utils-copy-nonce",label:"Copy Nonce",icon:v,onPress:function(){return R(String(t),"Copied nonce to clipboard")}}]:[]}function dt(e){const t=e?.attachments;if(!Array.isArray(t)||!t.length)return[];const n=t.map(function(a){return a?.id}).filter(Boolean);return n.length?[{key:"rose-utils-copy-attachment-ids",label:n.length>1?`Copy Attachment IDs (${n.length})`:"Copy Attachment ID",icon:v,onPress:function(){return R(n.join(", "),`Copied ${n.length} attachment ID${n.length===1?"":"s"} to clipboard`)}}]:[]}function ft(e){const t=e?.messageReference??e?.message_reference,n=t?.messageId??t?.message_id;return n?[{key:"rose-utils-copy-referenced-id",label:"Copy Replied-to Message ID",icon:v,onPress:function(){return R(String(n),"Copied replied-to message ID to clipboard")}}]:[]}function pt(e){return e?.id?[{key:"rose-utils-copy-debug-info",label:"Copy Message Debug Info",sublabel:"Type, flags, and timestamps",icon:v,onPress:function(){const t={id:e.id,channelId:e.channelId??e.channel_id,type:e.type,flags:e.flags,timestamp:e.timestamp,editedTimestamp:e.editedTimestamp??e.edited_timestamp};R(JSON.stringify(t,null,2),"Copied message debug info to clipboard")}}]:[]}var gt=new h({id:"message-dev-tools",label:"Message Dev Tools",meta:{sublabel:"Extra copy-ID rows in the message long-press menu, beyond what Discord's Developer Mode gives you natively",category:u.Useful},settings:{copyWebhookId:{label:"Copy Webhook ID",subLabel:"For messages sent by a webhook",type:"toggle",default:!0},copyNonce:{label:"Copy Nonce",subLabel:"The client-generated ID used to match an optimistic send to its real message",type:"toggle",default:!0},copyAttachmentIds:{label:"Copy Attachment ID(s)",type:"toggle",default:!0},copyReferencedId:{label:"Copy Replied-to Message ID",type:"toggle",default:!0},copyDebugInfo:{label:"Copy Message Debug Info",subLabel:"Type, flags, and creation/edit timestamps as JSON",type:"toggle",default:!0}},handlers:{onStart(){const e=this.storage.options;e.copyWebhookId&&this.patches.add(p(ct)),e.copyNonce&&this.patches.add(p(ut)),e.copyAttachmentIds&&this.patches.add(p(dt)),e.copyReferencedId&&this.patches.add(p(ft)),e.copyDebugInfo&&this.patches.add(p(pt))},onStop(){}}});const yt=1420070400000n;function te(e){const t=e.trim();if(!/^\d{15,20}$/.test(t))return null;try{const n=(BigInt(t)>>22n)+yt;return new Date(Number(n))}catch{return null}}function ht(e){return te(e)?.toISOString()??null}var bt=new h({id:"snowflake-tools",label:"Snowflake Tools",meta:{sublabel:"Decode any Discord ID's creation timestamp - useful after copying an ID with Developer Mode",category:u.Useful},settings:{decodeClipboard:{label:"Decode ID(s) in clipboard",subLabel:"Copy one or more Discord IDs first (one per line, or comma-separated), then tap this",type:"button",action(){r.clipboard.getString().then(function(e){const t=e.split(/[\s,]+/).map(function(o){return o.trim()}).filter(Boolean);if(!t.length){d.showToast("Clipboard is empty",void 0);return}const n=t.map(function(o){const i=ht(o);return i?`${o} -> ${i}`:`${o} -> not a valid snowflake`}),a=n.join(` -`);r.clipboard.setString(a),d.showToast(`Decoded ${n.length} ID${n.length===1?"":"s"} - result copied`,f.getAssetIDByName("ic_copy_24px"))})}}},handlers:{onStart(){},onStop(){}}});const ne=s.findByStoreName("GuildStore"),ae=s.findByStoreName("RelationshipStore"),re=s.findByStoreName("GuildMemberStore"),vt=s.findByStoreName("UserStore"),x="ic_copy_24px";function oe(e,t){r.clipboard.setString(e),d.showToast(t,f.getAssetIDByName(x))}function ie(e){return e?.guildId??e?.guild_id??null}function mt(e){const t=ie(e);if(!t||!ne?.getGuild)return[];const n=ne.getGuild(t);return n?[{key:"rose-utils-copy-server-info",label:"Copy Server Info",sublabel:n.name,icon:x,onPress:function(){const a={id:t,name:n.name,ownerId:n.ownerId,createdAt:te(t)?.toISOString(),boostTier:n.premiumTier,boostCount:n.premiumSubscriberCount,verificationLevel:n.verificationLevel,vanityURLCode:n.vanityURLCode,description:n.description,features:n.features};oe(JSON.stringify(a,null,2),"Copied server info to clipboard")}}]:[]}function St(e){const t=ie(e);if(!t||!ae?.getFriendIDs||!re?.getMember)return[];let n;try{n=ae.getFriendIDs()}catch{return[]}return!Array.isArray(n)||!n.length?[]:[{key:"rose-utils-copy-friends-in-server",label:"Copy Friends In This Server",sublabel:"Only counts friends already loaded into this server's member list this session",icon:x,onPress:function(){const a=n.filter(function(o){try{return!!re.getMember(t,o)}catch{return!1}}).map(function(o){return vt?.getUser?.(o)?.username??o});oe(a.length?a.join(", "):"(none found - they may just not be loaded into the member list yet)",`Copied ${a.length} friend${a.length===1?"":"s"} in this server to clipboard`)}}]}var It=new h({id:"server-info-tools",label:"Server Info Tools",meta:{sublabel:"Adds Copy Server Info and Copy Friends In This Server rows to the message long-press menu",category:u.Useful},settings:{copyServerInfo:{label:"Copy Server Info",subLabel:"Boost tier, verification level, features, vanity URL, creation date, and more",type:"toggle",default:!0},copyFriendsInServer:{label:"Copy Friends In This Server",subLabel:"Cross-references your friends list against this server's cached member list",type:"toggle",default:!0}},handlers:{onStart(){const e=this.storage.options;e.copyServerInfo&&this.patches.add(p(mt)),e.copyFriendsInServer&&this.patches.add(p(St))},onStop(){}}}),O=[be,Ae,ke,et,lt,gt,bt,It];const{ScrollView:Rt,View:wt}=r.ReactNative;function $t({children:e}){return r.React.createElement(Rt,{style:{flex:1}},e,r.React.createElement(wt,{style:{height:24}}))}const{View:At,Text:Dt}=r.ReactNative;function kt({children:e,style:t}){return r.React.createElement(At,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},r.React.createElement(Dt,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{FormSection:Ct,FormSwitchRow:se,FormRow:W}=F.Forms;function Et(e,t){return typeof e.subLabel=="function"?e.subLabel(t):e.subLabel}function Tt({module:e,settingKey:t}){const n=e.settings[t];if(n.predicate&&!n.predicate.call(e))return null;const a=e.storage.options[t],o=Et(n,a),i=!e.storage.enabled;return n.type==="toggle"?r.React.createElement(se,{label:n.label,subLabel:o,value:!!a,disabled:i,onValueChange:function(l){e.storage.options[t]=l,e.restart()}}):n.type==="button"?r.React.createElement(W,{label:n.label,subLabel:o,disabled:i,onPress:function(){return n.action.call(e)}}):r.React.createElement(W,{label:n.label,subLabel:[o,a].filter(Boolean).join(" - "),disabled:i,onPress:function(){const l=n.choices.indexOf(a);e.storage.options[t]=n.choices[(l+1)%n.choices.length],e.restart()}})}function Nt({module:e}){e.useRefresh();const t=Object.entries(e.errors);return r.React.createElement(Ct,{title:e.label},r.React.createElement(se,{label:"Enabled",subLabel:e.meta.sublabel,value:!!e.storage.enabled,onValueChange:function(){return e.toggle()}}),e.storage.enabled&&Object.keys(e.settings).map(function(n){return r.React.createElement(Tt,{key:n,module:e,settingKey:n})}),t.length>0&&r.React.createElement(W,{label:`${t.length} error${t.length===1?"":"s"} - tap to copy`,onPress:function(){const n=t.map(function([a,o]){return`[${e.label}] ${a} -${o}`}).join(` +(function(_,A,s,a,v,pe,g,x,y,M,U){"use strict";function H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y(e,t){for(var n=0;nt&&(n.message.communicationDisabled=!0)}}))},onStop(){}}});const Fe=s.findByStoreName("ThemeStore"),Be=s.find(function(e){return e?.default?.internal?.resolveSemanticColor})?.default?.internal?.resolveSemanticColor??s.find(function(e){return e?.meta?.resolveSemanticColor})?.meta?.resolveSemanticColor??function(){};function ee(e,t=Fe?.theme){if(e)try{return Be(t,e)}catch{return}}const{View:Pe,Text:_e}=a.ReactNative,te={destructive:{bg:"#F23F42",fg:"#FFFFFF"},default:{bg:"#4E5058",fg:"#FFFFFF"}};function xe({variant:e="default",children:t}){const n=te[e]??te.default;return a.React.createElement(Pe,{style:{backgroundColor:n.bg,borderRadius:4,paddingHorizontal:4,paddingVertical:1,marginLeft:4,alignSelf:"center"}},a.React.createElement(_e,{style:{color:n.fg,fontSize:10,fontWeight:"700",textTransform:"uppercase"}},t))}var Me="f47fd463dcaac61e.png",Ue="f944dbd033a60207.png",Oe="88eacd3588829ded.png",We="4d1aef97fe869aaf.png",ze="3a73d84a21043a5e.png",je="8b628d7e3fc05957.png",Ve="cb7a2c9b3fb9561c.png",Ge="11d89273b5bd6cc6.png",He="ea31146eb15fdde7.png",Ye="b0d124bd12658047.png",Je="cb8b45023e70bb61.png",Ke="a738efc867a225ee.png",qe="cba17334eeaf3198.png",Qe="fead9e69933db668.png",Xe="fead9e69933db668.png",Ze="d6a4e512cdcf1078.png",et="9901722947705011.png",tt=function(e){return e.Lock="Lock",e.Warning="Warning",e.Controller="Controller",e}(tt||{});function nt(e,t){if(e==="Lock")return t?He:Ge;if(e==="Warning")return t?et:Ze;if(e==="Controller")return Oe}const at={Lock:["#f0b232","STATUS_WARNING"],Warning:["#f23f43","STATUS_DANGER"],Controller:["#23a55a","STATUS_POSITIVE"]},rt=[{name:"Announcements",kind:"Lock",base:Me},{name:"Announcements",kind:"Warning",base:Ue},{name:"Text",kind:"Lock",base:Ke},{name:"Text",kind:"Warning",base:qe},{name:"Text",kind:"Controller",base:Je},{name:"Voice",kind:"Lock",base:Qe},{name:"Voice",kind:"Warning",base:Xe},{name:"Forum",kind:"Lock",base:We},{name:"Forum",kind:"Warning",base:ze},{name:"Stage",kind:"Lock",bottom:!0,base:Ye},{name:"Stage",kind:"Warning",bottom:!0,base:0},{name:"Image",kind:"Lock",bottom:!0,base:je},{name:"Image",kind:"Warning",bottom:!0,base:Ve}],ne=s.findByName("ChannelInfo",!1),ae=s.findByProps("BaseChannelIcon");var it=new S({id:"colorful-channels",label:"Colorful Channels",meta:{sublabel:"Gives channel icons with symbols colors to make them more aesthetically pleasing",category:f.Useful},settings:{nsfwTag:{label:"NSFW tag",subLabel:"Adds a red NSFW tag next to channel names",type:"toggle",default:!0},colorIcons:{label:"Colored icon symbols",subLabel:"Turns locked channel symbols yellow, NSFW channel symbols red",type:"toggle",default:!0},colorIconsFallback:{label:"Fallback colors for colored icon symbols",subLabel:"Uses yellow, red and green colors regardless of theme",type:"toggle",default:!1}},handlers:{onStart(){var e=this;this.storage.options.nsfwTag&&ne&&this.patches.add(v.after("default",ne,function([{channel:t}],n){return a.React.createElement(a.React.Fragment,{},t?.nsfw_&&a.React.createElement(xe,{variant:"destructive"},"nsfw"),n)})),this.storage.options.colorIcons&&ae?.BaseChannelIcon&&this.patches.add(v.after("BaseChannelIcon",ae,function([{source:t,style:n}],r){try{const i=typeof t?.original=="number"?y.getAssetByID(t.original)?.name:typeof t=="number"?y.getAssetByID(t)?.name:null;if(!i)return;const o=rt.find(function(P){return i===`${P.name}${P.kind}Icon`});if(!o)return;const[c,l]=at[o.kind],d=nt(o.kind,o.bottom),u=r?.props?.color?.replace(/-/g,"_")?.toUpperCase(),p=u&&M.semanticColors?.[u]?ee(M.semanticColors[u]):void 0,h=a.ReactNative.StyleSheet.flatten([n,r?.props?.style,{width:18,height:18,tintColor:p}]),B=e.storage.options.colorIconsFallback?c:ee(M.semanticColors?.[l])??c;return a.React.createElement(a.ReactNative.View,{},a.React.createElement(a.ReactNative.Image,{style:h,source:o.base}),a.React.createElement(a.ReactNative.View,{style:{position:"absolute",right:0,bottom:0}},a.React.createElement(a.ReactNative.Image,{style:{...h,tintColor:B},source:d})))}catch{return}}))},onStop(){}}});const j=s.findByProps("openLazy","hideActionSheet"),{ActionSheetRow:m}=s.findByProps("ActionSheetRow")??{},N=new Set;let I=null;function ot(e,t){return m?a.React.createElement(m,{label:e.label,subLabel:e.sublabel,icon:e.icon?a.React.createElement(m.Icon,{source:y.getAssetIDByName(e.icon)}):void 0,onPress:function(){try{e.onPress(t)}finally{j?.hideActionSheet?.()}},key:e.key}):null}function st(e){const t=[];for(const n of N)try{for(const r of n(e)){const i=ot(r,e);i&&t.push(i)}}catch{}return t}function lt(){return v.before("openLazy",j,function([e,t,n]){t!=="MessageLongPressActionSheet"||!n?.message||e.then(function(r){r.__roseUtilsActiveMessage=n.message,!r.__roseUtilsPatched&&(r.__roseUtilsPatched=!0,v.after("default",r,function(i,o){try{const c=st(r.__roseUtilsActiveMessage);if(!c.length)return;const l=U.findInReactTree(o,function(u){return Array.isArray(u)&&u[0]?.type?.name==="ActionSheetRowGroup"});if(Array.isArray(l)&&l.length&&m){let u=!1;for(const p of l){const h=U.findInReactTree(p,function(B){return Array.isArray(B)&&B.some(function(P){return P?.type?.name==="ActionSheetRow"})});if(Array.isArray(h)){h.push(...c),u=!0;break}}if(!u&&typeof l.unshift=="function"&&m.Group&&(l.unshift(a.React.createElement(m.Group,{},c)),u=!0),u)return}const d=U.findInReactTree(o,function(u){return Array.isArray(u)&&u.length>0&&u.every(function(p){return typeof p?.props?.label=="string"&&typeof p?.props?.onPress=="function"})});Array.isArray(d)&&d.push(...c)}catch{}}))})})}function b(e){return!I&&j&&(I=lt()),N.add(e),function(){N.delete(e),N.size===0&&I&&(I(),I=null)}}const ct=s.findByProps("DeveloperMode","DarkSidebar"),re=s.findByStoreName("PresenceStore");function ut(e){const t=e?.interaction??e?.interactionMetadata??e?.interaction_metadata;return t?.id?{id:String(t.id),name:t.name}:null}function dt(e){const t=ut(e);return t?[{key:"rose-utils-copy-command-id",label:"Copy Command ID",sublabel:t.name?`/${t.name}`:"Slash command interaction",icon:"ic_copy_24px",onPress:function(){a.clipboard.setString(t.id),g.showToast("Copied command ID to clipboard",y.getAssetIDByName("ic_copy_24px"))}}]:[]}function ft(e){if(!re?.getActivities)return[];const t=e?.author?.id;if(!t)return[];let n;try{n=re.getActivities(t)}catch{return[]}if(!Array.isArray(n))return[];const r=n.filter(function(i){return i?.application_id??i?.applicationId});return r.length?r.map(function(i,o){const c=String(i.application_id??i.applicationId);return{key:`rose-utils-copy-activity-id-${o}`,label:r.length>1?`Copy Activity ID (${i.name??o+1})`:"Copy Activity/Game ID",sublabel:i.name,icon:"ic_copy_24px",onPress:function(){a.clipboard.setString(c),g.showToast(`Copied ${i.name??"activity"} ID to clipboard`,y.getAssetIDByName("ic_copy_24px"))}}}):[]}var pt=new S({id:"enforce-developer-mode",label:"Developer Mode",meta:{sublabel:"Turns on Discord's real Developer Mode (all its native Copy ID options) and adds extra copy-ID tools slash commands and activities don't get natively",category:f.Useful},settings:{keepNativeOn:{label:"Keep native Developer Mode on",subLabel:"Re-asserts Discord's own Developer Mode setting - it tends to reset itself on Revenge-based clients",type:"toggle",default:!0},copyCommandId:{label:"Copy Command ID",subLabel:"Adds a row to the message long-press menu for messages sent via a slash command",type:"toggle",default:!0},copyActivityId:{label:"Copy Activity/Game ID",subLabel:"Adds a row to the message long-press menu to copy the author's current game/activity application ID (not every activity type has one, e.g. a plain custom status)",type:"toggle",default:!0}},handlers:{onStart(){if(this.storage.options.keepNativeOn){const e=ct?.DeveloperMode;if(e?.getSetting&&e?.updateSetting){const t=function(){try{e.getSetting()||e.updateSetting(!0)}catch{}};t(),this.patches.add(k("USER_SETTINGS_PROTO_UPDATE",t));const n=setInterval(t,5e3);this.patches.add(function(){return clearInterval(n)})}}this.storage.options.copyCommandId&&this.patches.add(b(dt)),this.storage.options.copyActivityId&&this.patches.add(b(ft))},onStop(){}}});const R="ic_copy_24px";function w(e,t){a.clipboard.setString(e),g.showToast(t,y.getAssetIDByName(R))}function gt(e){const t=e?.webhookId??e?.webhook_id;return t?[{key:"rose-utils-copy-webhook-id",label:"Copy Webhook ID",icon:R,onPress:function(){return w(String(t),"Copied webhook ID to clipboard")}}]:[]}function yt(e){const t=e?.nonce;return t?[{key:"rose-utils-copy-nonce",label:"Copy Nonce",icon:R,onPress:function(){return w(String(t),"Copied nonce to clipboard")}}]:[]}function ht(e){const t=e?.attachments;if(!Array.isArray(t)||!t.length)return[];const n=t.map(function(r){return r?.id}).filter(Boolean);return n.length?[{key:"rose-utils-copy-attachment-ids",label:n.length>1?`Copy Attachment IDs (${n.length})`:"Copy Attachment ID",icon:R,onPress:function(){return w(n.join(", "),`Copied ${n.length} attachment ID${n.length===1?"":"s"} to clipboard`)}}]:[]}function bt(e){const t=e?.messageReference??e?.message_reference,n=t?.messageId??t?.message_id;return n?[{key:"rose-utils-copy-referenced-id",label:"Copy Replied-to Message ID",icon:R,onPress:function(){return w(String(n),"Copied replied-to message ID to clipboard")}}]:[]}function vt(e){return e?.id?[{key:"rose-utils-copy-debug-info",label:"Copy Message Debug Info",sublabel:"Type, flags, and timestamps",icon:R,onPress:function(){const t={id:e.id,channelId:e.channelId??e.channel_id,type:e.type,flags:e.flags,timestamp:e.timestamp,editedTimestamp:e.editedTimestamp??e.edited_timestamp};w(JSON.stringify(t,null,2),"Copied message debug info to clipboard")}}]:[]}var St=new S({id:"message-dev-tools",label:"Message Dev Tools",meta:{sublabel:"Extra copy-ID rows in the message long-press menu, beyond what Discord's Developer Mode gives you natively",category:f.Useful},settings:{copyWebhookId:{label:"Copy Webhook ID",subLabel:"For messages sent by a webhook",type:"toggle",default:!0},copyNonce:{label:"Copy Nonce",subLabel:"The client-generated ID used to match an optimistic send to its real message",type:"toggle",default:!0},copyAttachmentIds:{label:"Copy Attachment ID(s)",type:"toggle",default:!0},copyReferencedId:{label:"Copy Replied-to Message ID",type:"toggle",default:!0},copyDebugInfo:{label:"Copy Message Debug Info",subLabel:"Type, flags, and creation/edit timestamps as JSON",type:"toggle",default:!0}},handlers:{onStart(){const e=this.storage.options;e.copyWebhookId&&this.patches.add(b(gt)),e.copyNonce&&this.patches.add(b(yt)),e.copyAttachmentIds&&this.patches.add(b(ht)),e.copyReferencedId&&this.patches.add(b(bt)),e.copyDebugInfo&&this.patches.add(b(vt))},onStop(){}}});const mt=1420070400000n;function ie(e){const t=e.trim();if(!/^\d{15,20}$/.test(t))return null;try{const n=(BigInt(t)>>22n)+mt;return new Date(Number(n))}catch{return null}}function Rt(e){return ie(e)?.toISOString()??null}var It=new S({id:"snowflake-tools",label:"Snowflake Tools",meta:{sublabel:"Decode any Discord ID's creation timestamp - useful after copying an ID with Developer Mode",category:f.Useful},settings:{decodeClipboard:{label:"Decode ID(s) in clipboard",subLabel:"Copy one or more Discord IDs first (one per line, or comma-separated), then tap this",type:"button",action(){a.clipboard.getString().then(function(e){const t=e.split(/[\s,]+/).map(function(i){return i.trim()}).filter(Boolean);if(!t.length){g.showToast("Clipboard is empty",void 0);return}const n=t.map(function(i){const o=Rt(i);return o?`${i} -> ${o}`:`${i} -> not a valid snowflake`}),r=n.join(` +`);a.clipboard.setString(r),g.showToast(`Decoded ${n.length} ID${n.length===1?"":"s"} - result copied`,y.getAssetIDByName("ic_copy_24px"))})}}},handlers:{onStart(){},onStop(){}}});const oe=s.findByStoreName("GuildStore"),se=s.findByStoreName("RelationshipStore"),le=s.findByStoreName("GuildMemberStore"),wt=s.findByStoreName("UserStore"),V="ic_copy_24px";function ce(e,t){a.clipboard.setString(e),g.showToast(t,y.getAssetIDByName(V))}function ue(e){return e?.guildId??e?.guild_id??null}function Ct(e){const t=ue(e);if(!t||!oe?.getGuild)return[];const n=oe.getGuild(t);return n?[{key:"rose-utils-copy-server-info",label:"Copy Server Info",sublabel:n.name,icon:V,onPress:function(){const r={id:t,name:n.name,ownerId:n.ownerId,createdAt:ie(t)?.toISOString(),boostTier:n.premiumTier,boostCount:n.premiumSubscriberCount,verificationLevel:n.verificationLevel,vanityURLCode:n.vanityURLCode,description:n.description,features:n.features};ce(JSON.stringify(r,null,2),"Copied server info to clipboard")}}]:[]}function $t(e){const t=ue(e);if(!t||!se?.getFriendIDs||!le?.getMember)return[];let n;try{n=se.getFriendIDs()}catch{return[]}return!Array.isArray(n)||!n.length?[]:[{key:"rose-utils-copy-friends-in-server",label:"Copy Friends In This Server",sublabel:"Only counts friends already loaded into this server's member list this session",icon:V,onPress:function(){const r=n.filter(function(i){try{return!!le.getMember(t,i)}catch{return!1}}).map(function(i){return wt?.getUser?.(i)?.username??i});ce(r.length?r.join(", "):"(none found - they may just not be loaded into the member list yet)",`Copied ${r.length} friend${r.length===1?"":"s"} in this server to clipboard`)}}]}var Dt=new S({id:"server-info-tools",label:"Server Info Tools",meta:{sublabel:"Adds Copy Server Info and Copy Friends In This Server rows to the message long-press menu",category:f.Useful},settings:{copyServerInfo:{label:"Copy Server Info",subLabel:"Boost tier, verification level, features, vanity URL, creation date, and more",type:"toggle",default:!0},copyFriendsInServer:{label:"Copy Friends In This Server",subLabel:"Cross-references your friends list against this server's cached member list",type:"toggle",default:!0}},handlers:{onStart(){const e=this.storage.options;e.copyServerInfo&&this.patches.add(b(Ct)),e.copyFriendsInServer&&this.patches.add(b($t))},onStop(){}}}),L=[Ie,Te,Le,it,pt,St,It,Dt];const{ScrollView:At,View:Et}=a.ReactNative;function kt({children:e}){return a.React.createElement(At,{style:{flex:1}},e,a.React.createElement(Et,{style:{height:24}}))}const{View:Tt,Text:Nt}=a.ReactNative;function de({children:e,style:t}){return a.React.createElement(Tt,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},a.React.createElement(Nt,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{View:C,Text:$,TouchableOpacity:D}=a.ReactNative,{FormSection:Lt,FormSwitchRow:fe,FormRow:G,FormInput:Ft}=x.Forms;function Bt(e,t){return typeof e.subLabel=="function"?e.subLabel(t):e.subLabel}function Pt(e,t){if(!t)return!0;const n=t.toLowerCase();return e.label.toLowerCase().includes(n)||e.meta.sublabel.toLowerCase().includes(n)?!0:Object.values(e.settings).some(function(r){return r.label.toLowerCase().includes(n)?!0:(typeof r.subLabel=="string"?r.subLabel:void 0)?.toLowerCase().includes(n)??!1})}function F(e,t){for(const n of e)n.storage.enabled!==t&&n.toggle()}function _t({module:e,settingKey:t}){const n=e.settings[t];if(n.predicate&&!n.predicate.call(e))return null;const r=e.storage.options[t],i=Bt(n,r),o=!e.storage.enabled;return n.type==="toggle"?a.React.createElement(fe,{label:n.label,subLabel:i,value:!!r,disabled:o,onValueChange:function(c){e.storage.options[t]=c,e.restart()}}):n.type==="button"?a.React.createElement(G,{label:n.label,subLabel:i,disabled:o,onPress:function(){return n.action.call(e)}}):a.React.createElement(G,{label:n.label,subLabel:[i,r].filter(Boolean).join(" - "),disabled:o,onPress:function(){const c=n.choices.indexOf(r);e.storage.options[t]=n.choices[(c+1)%n.choices.length],e.restart()}})}function xt({module:e}){e.useRefresh();const t=Object.entries(e.errors);return a.React.createElement(Lt,{title:e.label},a.React.createElement(fe,{label:"Enabled",subLabel:e.meta.sublabel,value:!!e.storage.enabled,onValueChange:function(){return e.toggle()}}),e.storage.enabled&&Object.keys(e.settings).map(function(n){return a.React.createElement(_t,{key:n,module:e,settingKey:n})}),t.length>0&&a.React.createElement(G,{label:`${t.length} error${t.length===1?"":"s"} - tap to copy`,onPress:function(){const n=t.map(function([r,i]){return`[${e.label}] ${r} +${i}`}).join(` -`);r.clipboard.setString(n),d.showToast("Copied - paste this when reporting the issue",void 0)}}))}const Ft=[u.Useful,u.Fixes,u.Fun];function Lt(){return r.React.createElement($t,null,r.React.createElement(kt,null,"RoseUtils is a collection of small, independent utilities - toggle whichever ones you want. Fork of nexpid's NexxUtils, with fixes for lookups that broke on newer Discord versions. If a module shows an error below, tap it to copy the details for a bug report."),Ft.flatMap(function(e){return O.filter(function(t){return t.meta.category===e}).map(function(t){return r.React.createElement(Nt,{key:t.id,module:t})})}))}var _t={onLoad(){A.modules??={};for(const e of O)try{e.storage.enabled&&e.start()}catch(t){$.logger.error(`[RoseUtils] Failed to start "${e.label}" on load: ${t}`)}},onUnload(){for(const e of O)try{e.stop()}catch(t){$.logger.error(`[RoseUtils] Failed to stop "${e.label}" cleanly: ${t}`)}},settings:Lt};return N.default=_t,Object.defineProperty(N,"__esModule",{value:!0}),N})({},vendetta,vendetta.metro,vendetta.metro.common,vendetta.patcher,vendetta.plugin,vendetta.ui.toasts,vendetta.ui.components,vendetta.ui.assets,vendetta.ui,vendetta.utils); +`);a.clipboard.setString(n),g.showToast("Copied - paste this when reporting the issue",void 0)}}))}function Mt({category:e,mods:t,collapsed:n,onToggleCollapse:r}){const i=t.filter(function(o){return o.storage.enabled}).length;return a.React.createElement(C,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:20,paddingBottom:4}},a.React.createElement(D,{onPress:r,style:{flexDirection:"row",alignItems:"center",flexShrink:1}},a.React.createElement($,{style:{fontSize:12,fontWeight:"700",opacity:.6}},n?"\u25B8":"\u25BE"," ",e.toUpperCase()," \xB7 ",i,"/",t.length)),a.React.createElement(C,{style:{flexDirection:"row"}},a.React.createElement(D,{onPress:function(){return F(t,!0)}},a.React.createElement($,{style:{fontSize:12,fontWeight:"600",opacity:.6}},"All")),a.React.createElement(D,{onPress:function(){return F(t,!1)},style:{marginLeft:16}},a.React.createElement($,{style:{fontSize:12,fontWeight:"600",opacity:.6}},"None"))))}const Ut=[f.Useful,f.Fixes,f.Fun];function Ot(){for(const l of L)l.useRefresh();const[e,t]=a.React.useState(""),[n,r]=a.React.useState(new Set),i=e.trim().length>0,o=Ut.map(function(l){return{category:l,mods:L.filter(function(d){return d.meta.category===l&&Pt(d,e.trim())})}}).filter(function({mods:l}){return l.length>0}),c=o.flatMap(function({mods:l}){return l});return a.React.createElement(kt,null,a.React.createElement(de,null,"RoseUtils is a collection of small, independent utilities - toggle whichever ones you want. Fork of nexpid's NexxUtils, with fixes for lookups that broke on newer Discord versions. If a module shows an error below, tap it to copy the details for a bug report."),a.React.createElement(C,{style:{paddingHorizontal:16}},a.React.createElement(Ft,{title:"Search",placeholder:"Search modules and settings...",value:e,onChange:t,autoCorrect:!1,autoCapitalize:"none"})),a.React.createElement(C,{style:{flexDirection:"row",justifyContent:"flex-end",paddingHorizontal:16,paddingTop:8}},a.React.createElement(D,{onPress:function(){return F(c,!0)}},a.React.createElement($,{style:{fontSize:13,fontWeight:"600",opacity:.75}},"Enable ",i?"matching":"all")),a.React.createElement(D,{onPress:function(){return F(c,!1)},style:{marginLeft:16}},a.React.createElement($,{style:{fontSize:13,fontWeight:"600",opacity:.75}},"Disable ",i?"matching":"all"))),c.length===0&&a.React.createElement(de,null,'No modules or settings match "',e.trim(),'".'),o.map(function({category:l,mods:d}){const u=!i&&n.has(l);return a.React.createElement(C,{key:l},a.React.createElement(Mt,{category:l,mods:d,collapsed:u,onToggleCollapse:function(){r(function(p){const h=new Set(p);return h.has(l)?h.delete(l):h.add(l),h})}}),!u&&d.map(function(p){return a.React.createElement(xt,{key:p.id,module:p})}))}))}var Wt={onLoad(){E.modules??={};for(const e of L)try{e.storage.enabled&&e.start()}catch(t){A.logger.error(`[RoseUtils] Failed to start "${e.label}" on load: ${t}`)}},onUnload(){for(const e of L)try{e.stop()}catch(t){A.logger.error(`[RoseUtils] Failed to stop "${e.label}" cleanly: ${t}`)}},settings:Ot};return _.default=Wt,Object.defineProperty(_,"__esModule",{value:!0}),_})({},vendetta,vendetta.metro,vendetta.metro.common,vendetta.patcher,vendetta.plugin,vendetta.ui.toasts,vendetta.ui.components,vendetta.ui.assets,vendetta.ui,vendetta.utils); diff --git a/rose-utils/install/manifest.json b/rose-utils/install/manifest.json index 2db6f23..3148fce 100644 --- a/rose-utils/install/manifest.json +++ b/rose-utils/install/manifest.json @@ -1 +1 @@ -{"name":"RoseUtils","description":"A small collection of independent utilities - Spotify listen-along, a Tenor download fix, colorful channel icons, and more. Fork of nexpid's NexxUtils.","authors":[{"name":"everestmcarthur"},{"name":"nexpid"}],"main":"index.js","hash":"395e341a784c7918a27e3525fa5dad9e365700156e2ee9b2525accbf80992118"} \ No newline at end of file +{"name":"RoseUtils","description":"A small collection of independent utilities - Spotify listen-along, a Tenor download fix, colorful channel icons, and more. Fork of nexpid's NexxUtils.","authors":[{"name":"everestmcarthur"},{"name":"nexpid"}],"main":"index.js","hash":"509905d3a4ff4710fb6ef9cff8d0a6342ebfa3830372ae2b7011fc1847489e82"} \ No newline at end of file