diff --git a/dist/vendetta.js b/dist/vendetta.js index 20634f56..d56505dc 100644 --- a/dist/vendetta.js +++ b/dist/vendetta.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var Ba=Object.defineProperty;var c=(e,t)=>()=>(e&&(t=e(e=0)),t);var N=(e,t)=>{for(var n in t)Ba(e,n,{get:t[n],enumerable:!0})};var Re,Ee,P,nt,ie,se,ce=c(()=>{"use strict";Re=window.nativeModuleProxy,Ee=Re.MMKVManager;P=Re.DCDFileManager??Re.RTNFileManager;nt=Re.InfoDictionaryManager??Re.RTNClientInfoManager;ie=Re.DCDDeviceManager??Re.RTNDeviceManager,se=Re.BundleUpdaterManager});var Xt={};N(Xt,{find:()=>X,findAll:()=>rt,findByDisplayName:()=>Yt,findByDisplayNameAll:()=>Ua,findByName:()=>D,findByNameAll:()=>Fa,findByProps:()=>u,findByPropsAll:()=>Oa,findByStoreName:()=>ye,findByTypeName:()=>Va,findByTypeNameAll:()=>Ga,modules:()=>Wt});var La,xr,Sr,Wt,X,rt,Tr,vr,Ir,Ar,ka,u,Oa,D,Fa,Yt,Ua,Va,Ga,ye,w=c(()=>{"use strict";La=window.ErrorUtils.getGlobalHandler(),xr=function(e){return Object.defineProperty(window.modules,e,{value:window.modules[e],enumerable:!1,configurable:!0,writable:!0})};for(let e in window.modules){let t=Number(e),n=window.modules[t]?.publicModule?.exports;if(!n||n===window||n.proxygone===null){xr(t);continue}}Sr=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function(n){let r=[];for(let o in e){let a=Number(o),s=e[a]?.publicModule?.exports;if(!e[a].isInitialized)try{window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(La)}catch{}if(!s){xr(a);continue}if(s.default&&s.__esModule&&n(s.default)){if(t)return s.default;r.push(s.default)}if(n(s)){if(t)return s;r.push(s)}}if(!t)return r}},Wt=window.modules,X=Sr(Wt,!0),rt=Sr(Wt),Tr=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},vr=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},Ir=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},Ar=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},ka=function(e){return function(t){return t.getName&&t.getName.length===0&&t.getName()===e}},u=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return X(vr(e,t))},Fa=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rt(vr(e,t))},Yt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return X(Ir(e,t))},Ua=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rt(Ir(e,t))},Va=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return X(Ar(e,t))},Ga=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rt(Ar(e,t))},ye=function(e){return X(ka(e))}});function W(e,t){return ht(e,t,{walkable:["props","children","child","sibling"]})}var Cr=c(()=>{"use strict";le()});function Zt(e,t,n,r){if(!(r>n.maxDepth)&&e){try{if(t(e))return e}catch{}if(Array.isArray(e)){for(let o of e)if(!(typeof o!="object"||o===null))try{let a=Zt(o,t,n,r+1);if(a)return a}catch{}}else if(typeof e=="object"){for(let o of Object.keys(e))if(!(typeof e[o]!="object"||e[o]===null)&&!(n.walkable.length&&!n.walkable.includes(o))&&!n.ignore.includes(o))try{let a=Zt(e[o],t,n,r+1);if(a)return a}catch{}}}}function ht(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Zt(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var Nr=c(()=>{"use strict"});async function we(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e4,r=await fetch(e,{signal:Ha(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function Ha(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var Pr=c(()=>{"use strict"});function qt(e){return Object.isFrozen(e)?Object.assign({},e):e}var Dr=c(()=>{"use strict"});function Z(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var Jt={};N(Jt,{findInReactTree:()=>W,findInTree:()=>ht,safeFetch:()=>we,unfreeze:()=>qt,without:()=>Z});var le=c(()=>{"use strict";Cr();Nr();Pr();Dr();Mr()});var Qt,re,Rt=c(()=>{Qt=["a","b","i"],re=new Map});function Br(e,t,n,r,o){let a=re.get(t)?.[e];if(!a)return o?Reflect.construct(t[e],n,r):t[e].apply(r,n);for(let l of a.b.values()){let d=l.call(r,n);Array.isArray(d)&&(n=d)}let s=[...a.i.values()].reduce(function(l,d){return function(){for(var p=arguments.length,O=new Array(p),F=0;F{Rt()});function en(e,t,n,r){let o=re.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),Qt.every(function(s){return a[s].size===0})&&(Reflect.defineProperty(e,t,{value:a.o,writable:!0,configurable:!0})||(e[t]=a.o),delete o[t]),Object.keys(o).length==0&&re.delete(e),!0):!1}function kr(){for(let[e,t]of re.entries())for(let n in t)for(let r of Qt)for(let o of t[n]?.[r].keys()??[])en(e,n,o,r)}var tn=c(()=>{Rt()});function Et(e){return function(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(typeof n[t]!="function")throw new Error(`${t} is not a function in ${n.constructor.name}`);re.has(n)||re.set(n,Object.create(null));let a=re.get(n);if(!a[t]){let d=n[t];a[t]={o:d,b:new Map,i:new Map,a:new Map};let p=function(C,H,$){let Ce=Br(t,n,H,C,$);return o&&l(),Ce},O=new Proxy(d,{apply:function(C,H,$){return p(H,$,!1)},construct:function(C,H){return p(d,H,!0)},get:function(C,H,$){return H=="toString"?d.toString.bind(d):Reflect.get(C,H,$)}});Reflect.defineProperty(n,t,{value:O,configurable:!0,writable:!0})||(n[t]=O)}let s=Symbol(),l=function(){return en(n,t,s,e)};return a[t][e].set(s,r),l}}var Or=c(()=>{Lr();Rt();tn()});var rn={};N(rn,{after:()=>R,before:()=>nn,instead:()=>q,unpatchAll:()=>kr});var nn,q,R,on=c(()=>{Or();tn();nn=Et("b"),q=Et("i"),R=Et("a")});var Fr,M=c(()=>{"use strict";on();on();Fr={...rn}});function sn(){return{listeners:Object.values(an).reduce(function(e,t){return e[t]=new Set,e},{}),on(e,t){this.listeners[e].has(t)||this.listeners[e].add(t)},off(e,t){this.listeners[e].delete(t)},once(e,t){var n=this;let r=function(o,a){n.off(o,r),t(o,a)};this.on(e,r)},emit(e,t){for(let n of this.listeners[e])n(e,t)}}}var an,Ur=c(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(an||(an={}))});var Vr,cn,Gr,ln,be,He,Hr=c(()=>{"use strict";ce();g();Vr=/[<>:"\/\\|?*]/g,cn=function(e){return m.Platform.select({default:e,ios:P.saveFileToGallery?e:`Documents/${e}`})},Gr=function(e){return Vr.test(e)&&(e=e.replace(Vr,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},ln=async function(e){await Ee.getItem(e)&&Ee.removeItem(e);let t=Gr(e);await P.fileExists(`${P.getConstants().DocumentsDirPath}/${t}`)&&await P.removeFile?.("documents",t)},be=function(e){let t=Gr(e);return He(t,async function(){try{let n=`${P.getConstants().DocumentsDirPath}/${t}`;if(await P.fileExists(n))return;let r=await Ee.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${P.getConstants().CacheDirPath}/mmkv/${e}`;await P.fileExists(o)?r=await P.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await P.writeFile("documents",cn(t),r,"utf8"),await Ee.getItem(e)!==null&&(Ee.removeItem(e),console.log(`Successfully migrated ${e} store from MMKV storage to fs`))}catch(n){console.error("Failed to migrate to fs from MMKVManager ",n)}}())},He=function(e,t){let n;return{get:async function(){await t;let r=`${P.getConstants().DocumentsDirPath}/${e}`;return!n&&!await P.fileExists(r)?(n=!0,P.writeFile("documents",cn(e),"{}","utf8")):JSON.parse(await P.readFile(r,"utf8"))},set:async function(r){await t,await P.writeFile("documents",cn(e),JSON.stringify(r),"utf8")}}}});var fn={};N(fn,{awaitSyncWrapper:()=>$e,createFileBackend:()=>He,createMMKVBackend:()=>be,createProxy:()=>zr,createStorage:()=>ue,purgeStorage:()=>ln,useProxy:()=>_,wrapSync:()=>_e});function zr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=sn();function n(r,o){return new Proxy(r,{get(a,s){if(s===$r)return t;let l=[...o,s],d=a[s];return d!=null?(t.emit("GET",{path:l,value:d}),typeof d=="object"?n(d,l):d):d},set(a,s,l){return a[s]=l,t.emit("SET",{path:[...o,s],value:l}),!0},deleteProperty(a,s){let l=delete a[s];return l&&t.emit("DEL",{path:[...o,s]}),l}})}return{proxy:n(e,[]),emitter:t}}function _(e){if(e[un])throw e[un];let t=e[$r];if(!t)throw new Error("InvalidArgumentExcpetion - storage[emitterSymbol] is "+typeof t);let[,n]=React.useReducer(function(r){return~r},0);return React.useEffect(function(){let r=function(){return n()};return t.on("SET",r),t.on("DEL",r),function(){t.off("SET",r),t.off("DEL",r)}},[]),e}async function ue(e){let t=await e.get(),{proxy:n,emitter:r}=zr(t),o=function(){return e.set(n)};return r.on("SET",o),r.on("DEL",o),n}function _e(e){let t,n,r=[],o=function(a){return t?a():r.push(a)};return e.then(function(a){t=a,r.forEach(function(s){return s()})}).catch(function(a){n=a}),new Proxy({},{...Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(function(a){return[a,function(s){for(var l=arguments.length,d=new Array(l>1?l-1:0),p=1;p{"use strict";Ur();Hr();$r=Symbol.for("vendetta.storage.emitter"),jr=Symbol.for("vendetta.storage.accessor"),un=Symbol.for("vendetta.storage.error");$e=function(e){return new Promise(function(t){return e[jr](t)})}});var mn,$a,B,Ne=c(()=>{"use strict";w();mn=u("setLogFn").default,$a=new mn("Opti"),B=$a});var En={};N(En,{color:()=>fe,fetchTheme:()=>ot,getCurrentTheme:()=>Me,getThemes:()=>Rn,initThemes:()=>hn,installTheme:()=>Pe,patchChatBackground:()=>pn,removeTheme:()=>gn,selectTheme:()=>De,themes:()=>I,updateThemes:()=>Wr});async function dn(e){if(typeof e!="object")throw new Error("Theme must be an object");await He("vendetta_theme.json").set(e)}function pn(){let e=Me()?.data?.background;if(!e)return;let t=D("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=u("MessagesWrapper");if(!n)return;let r=[R("default",t,function(o,a){return React.createElement(m.ImageBackground,{style:{flex:1,height:"100%"},source:{uri:e.url},blurRadius:typeof e.blur=="number"?e.blur:0,children:a})}),R("render",n.prototype,function(o,a){let s=W(a,function(l){return"HACK_fixModalInteraction"in l?.props&&l?.props?.style});s?s.props.style=Object.assign(m.StyleSheet.flatten(s.props.style??{}),{backgroundColor:"#0000"}):B.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function Kr(e){if(me.valid(e))return me(e).hex();let t=Number(m.processColor(e));return me.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function za(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=Kr(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=Kr(t[n]);m.Platform.OS==="android"&&Ka(t)}return e}function Ka(e){let t={BLACK_ALPHA_60:["BLACK",.6],BRAND_NEW_360_ALPHA_20:["BRAND_360",.2],BRAND_NEW_360_ALPHA_25:["BRAND_360",.25],BRAND_NEW_500_ALPHA_20:["BRAND_500",.2],PRIMARY_DARK_500_ALPHA_20:["PRIMARY_500",.2],PRIMARY_DARK_700_ALPHA_60:["PRIMARY_700",.6],STATUS_GREEN_500_ALPHA_20:["GREEN_500",.2],STATUS_RED_500_ALPHA_20:["RED_500",.2]};for(let n in t){let[r,o]=t[n];e[r]&&(e[n]=me(e[r]).alpha(o).hex())}}async function ot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;try{n=await(await we(e,{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch theme at ${e}`)}I[e]={id:e,selected:t,data:za(n)},t&&dn(I[e])}async function Pe(e){if(typeof e!="string"||e in I)throw new Error("Theme already installed");await ot(e)}async function De(e){if(e==="default")return await dn({});let t=Object.values(I).find(function(n){return n.selected})?.id;t&&(I[t].selected=!1),I[e].selected=!0,await dn(I[e])}async function gn(e){let t=I[e];return t.selected&&await De("default"),delete I[e],t.selected}function Me(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function Wr(){await $e(I);let e=Me();await Promise.allSettled(Object.keys(I).map(function(t){return ot(t,e?.id===t)}))}async function hn(){let e=Me();if(!e)return;let t=fe.default.unsafe_rawColors;fe.default.unsafe_rawColors=new Proxy(t,{get:function(n,r){return e?e.data?.rawColors?.[r]??Reflect.get(t,r):Reflect.get(t,r)}}),q("resolveSemanticColor",fe.default.meta??fe.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[s,l]=Yr(o,a),d=o==="amoled"?2:o==="light"?1:0;let p=ja[s]??s,O=(e.data?.semanticColors?.[s]??e.data?.semanticColors?.[p])?.[d];if(s==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return me(O||"black").alpha(1-e.data.background.alpha).hex();if(O)return O;let F=e.data?.rawColors?.[l.raw];return F?l.opacity===1?F:me(F).alpha(l.opacity).hex():r(...n)}),await Wr()}function Yr(e,t){let n=t[Yr._sym??=Object.getOwnPropertySymbols(t)[0]],r=fe.SemanticColor[n];return[n,r[e.toLowerCase()]]}function Rn(){var e=0;return Object.keys(I).forEach(function(t){return e++}),e}var fe,I,ja,z=c(()=>{"use strict";g();le();w();M();j();Ne();fe=u("SemanticColor"),I=_e(ue(be("VENDETTA_THEMES"))),ja={BG_BACKDROP:"BACKGROUND_FLOATING",BG_BASE_PRIMARY:"BACKGROUND_PRIMARY",BG_BASE_SECONDARY:"BACKGROUND_SECONDARY",BG_BASE_TERTIARY:"BACKGROUND_SECONDARY_ALT",BG_MOD_FAINT:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_STRONG:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_SUBTLE:"BACKGROUND_MODIFIER_ACCENT",BG_SURFACE_OVERLAY:"BACKGROUND_FLOATING",BG_SURFACE_OVERLAY_TMP:"BACKGROUND_FLOATING",BG_SURFACE_RAISED:"BACKGROUND_MOBILE_PRIMARY"}});var yt,Xr,m,me,wt=c(()=>{"use strict";z();M();yt=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},Xr=yt(function(e){return e?.default?.name==="requireNativeComponent"});Xr&&q("default",Xr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=yt(function(e){return e.createElement});m=yt(function(e){return e.AppRegistry}),me=yt(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{hn()}catch(e){console.error("[Vendetta] Failed to initialize themes...",e)}});var Sn={};N(Sn,{AsyncUsers:()=>at,Flux:()=>Ja,FluxDispatcher:()=>_t,Messages:()=>_n,NavigationNative:()=>pe,Profiles:()=>Be,React:()=>oe,ReactNative:()=>m,User:()=>Se,assets:()=>it,channels:()=>wn,chroma:()=>me,clipboard:()=>V,commands:()=>bt,constants:()=>xe,i18n:()=>de,invites:()=>Xa,lodash:()=>xt,moment:()=>xn,navigation:()=>Za,navigationStack:()=>qa,stylesheet:()=>U,toasts:()=>bn,url:()=>je,util:()=>Qa});function Ya(e){if(yn){for(let t in e)e[t]=new Proxy(m.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return Zr.isSemanticColor(a)?Zr.resolveSemanticColor(Wa.theme,a):a}});return e}}var Wa,yn,Zr,xe,wn,de,je,bn,Se,at,Be,U,V,it,Xa,bt,Za,qa,pe,_n,Ja,_t,oe,xn,xt,Qa,g=c(()=>{"use strict";w();wt();wt();wt();Wa=ye("ThemeStore"),yn=u("colors","unsafe_rawColors"),Zr=yn?.internal??yn?.meta;xe=u("Fonts","Permissions"),wn=u("getVoiceChannelId"),de=u("Messages"),je=u("openURL","openDeeplink"),bn=X(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),Se=u("getCurrentUser"),at=u("getUser","fetchProfile"),Be=u("showUserProfile"),U={...X(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:Ya,...u("createThemedStyleSheet")},V=u("setString","getString","hasString"),it=u("registerAsset"),Xa=u("acceptInviteAndTransitionToInviteChannel"),bt=u("getBuiltInCommands"),Za=u("pushLazy"),qa=u("createStackNavigator"),pe=u("NavigationContainer"),_n=u("sendBotMessage"),Ja=u("connectStores"),_t=u("_currentDispatchActionType"),oe=window.React,xn=u("isMoment"),xt=u("forEachRight"),Qa=u("inspect","isNullOrUndefined")});var vn={};N(vn,{all:()=>ge,find:()=>ei,getAssetByID:()=>ni,getAssetByName:()=>ti,getAssetIDByName:()=>f,patchAssets:()=>Tn});function Tn(){let e=R("registerAsset",it,function(t,n){let r=t[0];ge[r.name]={...r,id:n}});for(let t=1;;t++){let n=it.getAssetByID(t);if(!n)break;ge[n.name]||(ge[n.name]={...n,id:t})}return e}var ge,ei,ti,ni,f,x=c(()=>{"use strict";g();M();ge={};ei=function(e){return Object.values(ge).find(e)},ti=function(e){return ge[e]},ni=function(e){return it.getAssetByID(e)},f=function(e){return ge[e]?.id}});var In={};N(In,{showToast:()=>h});var ri,h,J=c(()=>{"use strict";w();g();({uuid4:ri}=u("uuid4")),h=function(e,t){return bn.open({key:`vd-toast-${ri()}`,content:e,source:t,icon:t})}});var i,Q,L=c(()=>{"use strict";j();i=_e(ue(be("VENDETTA_SETTINGS"))),Q=_e(ue(He("vendetta_loader.json")))});var Nn={};N(Nn,{connectToDebugger:()=>An,getDebugInfo:()=>Le,patchLogHook:()=>Cn,socket:()=>Y,toggleSafeMode:()=>st,versionHash:()=>St});async function st(){i.safeMode={...i.safeMode,enabled:!i.safeMode?.enabled},window.__vendetta_loader?.features.themes&&(Me()?.id&&(i.safeMode.currentThemeId=Me().id),i.safeMode?.enabled?await De("default"):i.safeMode?.currentThemeId&&await De(i.safeMode?.currentThemeId)),setTimeout(se.reload,400)}function An(e){if(Y!==void 0&&Y.readyState!==WebSocket.CLOSED&&Y.close(),!e){h("Invalid debugger URL!",f("Small"));return}Y=new WebSocket(`ws://${e}`),Y.addEventListener("open",function(){return h("Connected to debugger.",f("Check"))}),Y.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),Y.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),h("An error occurred with the debugger connection!",f("Small"))})}function Cn(){let e=R("nativeLoggingHook",globalThis,function(t){Y?.readyState===WebSocket.OPEN&&Y.send(JSON.stringify({message:t[0],level:t[1]})),B.log(t[0])});return function(){Y&&Y.close(),e()}}function Le(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=m.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:St,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:nt.Version,build:nt.Build},react:{version:React.version,nativeVersion:t.startsWith(n)?t.substring(n.length):`${o.major}.${o.minor}.${o.patch}`},hermes:{version:t,buildType:e.Build,bytecodeVersion:e["Bytecode Version"]},...m.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...m.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ie.device}},ios:{device:{manufacturer:ie.deviceManufacturer,brand:ie.deviceBrand,model:ie.deviceModel,codename:ie.device}}})}}var Y,St,ke=c(()=>{"use strict";g();M();z();ce();x();J();L();Ne();St="a476b0b"});var K,Tt,qr,ze,Ke=c(()=>{(function(e){e.BRAND="brand",e.RED="red",e.GREEN="green",e.PRIMARY="primary",e.TRANSPARENT="transparent",e.GREY="grey",e.LIGHTGREY="lightgrey",e.WHITE="white",e.LINK="link"})(K||(K={}));(function(e){e[e.BUILT_IN=0]="BUILT_IN",e[e.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",e[e.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",e[e.BOT=3]="BOT",e[e.PLACEHOLDER=4]="PLACEHOLDER"})(Tt||(Tt={}));(function(e){e[e.SUB_COMMAND=1]="SUB_COMMAND",e[e.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",e[e.STRING=3]="STRING",e[e.INTEGER=4]="INTEGER",e[e.BOOLEAN=5]="BOOLEAN",e[e.USER=6]="USER",e[e.CHANNEL=7]="CHANNEL",e[e.ROLE=8]="ROLE",e[e.MENTIONABLE=9]="MENTIONABLE",e[e.NUMBER=10]="NUMBER",e[e.ATTACHMENT=11]="ATTACHMENT"})(qr||(qr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(ze||(ze={}))});var Bn={};N(Bn,{patchCommands:()=>Dn,registerCommand:()=>Mn});function Dn(){let e=R("getBuiltInCommands",bt,function(t,n){let[r]=t;if(r===ze.CHAT)return[...n,...Pn]});return function(){Pn=[],e()}}function Mn(e){for(let t in e){let n=bt.getBuiltInCommands(ze.CHAT,!0,!1);n.sort(function(a,s){return parseInt(s.id)-parseInt(a.id)});let r=n[n.length-1],o=e[t];e[t]={id:(parseInt(r.id,10)-1).toString(),displayName:o.name,displayDescription:o.description,type:ze.CHAT,inputType:Tt.BUILT_IN,applicationId:"Opti",...o,__isOpti:!0}}Pn.push(...e)}var Pn,vt=c(()=>{"use strict";Ke();g();M();Pn=[]});var oi,ai,ii,Jr,Qr=c(()=>{"use strict";oi=function(e){return{status:"fulfilled",value:e}},ai=function(e){return{status:"rejected",reason:e}},ii=function(e){return Promise.resolve(e).then(oi,ai)},Jr=function(e){return Promise.all(Array.from(e).map(ii))}});var Un={};N(Un,{evalPlugin:()=>eo,fetchPlugin:()=>We,getPlugins:()=>On,getSettings:()=>Fn,initPlugins:()=>kn,installPlugin:()=>ve,plugins:()=>T,removePlugin:()=>Ln,startPlugin:()=>Ye,stopPlugin:()=>Xe});async function We(e){e.endsWith("/")||(e+="/");let t=T[e],n;try{n=await(await we(e+"manifest.json",{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch manifest for ${e}`)}let r;if(t?.manifest.hash!==n.hash)try{r=await(await we(e+(n.main||"index.js"),{cache:"no-store"})).text()}catch{}if(!r&&!t)throw new Error(`Failed to fetch JS for ${e}`);T[e]={id:e,manifest:n,enabled:t?.enabled??!1,update:t?.update??!0,js:r??t.js}}async function ve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.endsWith("/")||(e+="/"),typeof e!="string"||e in T)throw new Error("Plugin already installed");await We(e),t&&await Ye(e)}async function eo(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await ue(be(e.id))},logger:new mn(`Vendetta \xBB ${e.manifest.name}`)},n=`vendetta=>{return ${e.js}} +"use strict";(()=>{var Ba=Object.defineProperty;var c=(e,t)=>()=>(e&&(t=e(e=0)),t);var N=(e,t)=>{for(var n in t)Ba(e,n,{get:t[n],enumerable:!0})};var Re,Ee,P,nt,ie,se,ce=c(()=>{"use strict";Re=window.nativeModuleProxy,Ee=Re.MMKVManager;P=Re.DCDFileManager??Re.RTNFileManager;nt=Re.InfoDictionaryManager??Re.RTNClientInfoManager;ie=Re.DCDDeviceManager??Re.RTNDeviceManager,se=Re.BundleUpdaterManager});var Xt={};N(Xt,{find:()=>X,findAll:()=>rt,findByDisplayName:()=>Yt,findByDisplayNameAll:()=>Ua,findByName:()=>D,findByNameAll:()=>Fa,findByProps:()=>u,findByPropsAll:()=>Oa,findByStoreName:()=>ye,findByTypeName:()=>Va,findByTypeNameAll:()=>Ga,modules:()=>Wt});var La,xr,Sr,Wt,X,rt,Tr,vr,Ir,Ar,ka,u,Oa,D,Fa,Yt,Ua,Va,Ga,ye,w=c(()=>{"use strict";La=window.ErrorUtils.getGlobalHandler(),xr=function(e){return Object.defineProperty(window.modules,e,{value:window.modules[e],enumerable:!1,configurable:!0,writable:!0})};for(let e in window.modules){let t=Number(e),n=window.modules[t]?.publicModule?.exports;if(!n||n===window||n.proxygone===null){xr(t);continue}}Sr=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function(n){let r=[];for(let o in e){let a=Number(o),s=e[a]?.publicModule?.exports;if(!e[a].isInitialized)try{window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(La)}catch{}if(!s){xr(a);continue}if(s.default&&s.__esModule&&n(s.default)){if(t)return s.default;r.push(s.default)}if(n(s)){if(t)return s;r.push(s)}}if(!t)return r}},Wt=window.modules,X=Sr(Wt,!0),rt=Sr(Wt),Tr=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},vr=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},Ir=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},Ar=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},ka=function(e){return function(t){return t.getName&&t.getName.length===0&&t.getName()===e}},u=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return X(vr(e,t))},Fa=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rt(vr(e,t))},Yt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return X(Ir(e,t))},Ua=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rt(Ir(e,t))},Va=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return X(Ar(e,t))},Ga=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rt(Ar(e,t))},ye=function(e){return X(ka(e))}});function W(e,t){return ht(e,t,{walkable:["props","children","child","sibling"]})}var Cr=c(()=>{"use strict";le()});function Zt(e,t,n,r){if(!(r>n.maxDepth)&&e){try{if(t(e))return e}catch{}if(Array.isArray(e)){for(let o of e)if(!(typeof o!="object"||o===null))try{let a=Zt(o,t,n,r+1);if(a)return a}catch{}}else if(typeof e=="object"){for(let o of Object.keys(e))if(!(typeof e[o]!="object"||e[o]===null)&&!(n.walkable.length&&!n.walkable.includes(o))&&!n.ignore.includes(o))try{let a=Zt(e[o],t,n,r+1);if(a)return a}catch{}}}}function ht(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Zt(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var Nr=c(()=>{"use strict"});async function we(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e4,r=await fetch(e,{signal:Ha(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function Ha(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var Pr=c(()=>{"use strict"});function qt(e){return Object.isFrozen(e)?Object.assign({},e):e}var Dr=c(()=>{"use strict"});function Z(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var Jt={};N(Jt,{findInReactTree:()=>W,findInTree:()=>ht,safeFetch:()=>we,unfreeze:()=>qt,without:()=>Z});var le=c(()=>{"use strict";Cr();Nr();Pr();Dr();Mr()});var Qt,re,Rt=c(()=>{Qt=["a","b","i"],re=new Map});function Br(e,t,n,r,o){let a=re.get(t)?.[e];if(!a)return o?Reflect.construct(t[e],n,r):t[e].apply(r,n);for(let l of a.b.values()){let d=l.call(r,n);Array.isArray(d)&&(n=d)}let s=[...a.i.values()].reduce(function(l,d){return function(){for(var p=arguments.length,O=new Array(p),F=0;F{Rt()});function en(e,t,n,r){let o=re.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),Qt.every(function(s){return a[s].size===0})&&(Reflect.defineProperty(e,t,{value:a.o,writable:!0,configurable:!0})||(e[t]=a.o),delete o[t]),Object.keys(o).length==0&&re.delete(e),!0):!1}function kr(){for(let[e,t]of re.entries())for(let n in t)for(let r of Qt)for(let o of t[n]?.[r].keys()??[])en(e,n,o,r)}var tn=c(()=>{Rt()});function Et(e){return function(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(typeof n[t]!="function")throw new Error(`${t} is not a function in ${n.constructor.name}`);re.has(n)||re.set(n,Object.create(null));let a=re.get(n);if(!a[t]){let d=n[t];a[t]={o:d,b:new Map,i:new Map,a:new Map};let p=function(C,H,$){let Ce=Br(t,n,H,C,$);return o&&l(),Ce},O=new Proxy(d,{apply:function(C,H,$){return p(H,$,!1)},construct:function(C,H){return p(d,H,!0)},get:function(C,H,$){return H=="toString"?d.toString.bind(d):Reflect.get(C,H,$)}});Reflect.defineProperty(n,t,{value:O,configurable:!0,writable:!0})||(n[t]=O)}let s=Symbol(),l=function(){return en(n,t,s,e)};return a[t][e].set(s,r),l}}var Or=c(()=>{Lr();Rt();tn()});var rn={};N(rn,{after:()=>R,before:()=>nn,instead:()=>q,unpatchAll:()=>kr});var nn,q,R,on=c(()=>{Or();tn();nn=Et("b"),q=Et("i"),R=Et("a")});var Fr,M=c(()=>{"use strict";on();on();Fr={...rn}});function sn(){return{listeners:Object.values(an).reduce(function(e,t){return e[t]=new Set,e},{}),on(e,t){this.listeners[e].has(t)||this.listeners[e].add(t)},off(e,t){this.listeners[e].delete(t)},once(e,t){var n=this;let r=function(o,a){n.off(o,r),t(o,a)};this.on(e,r)},emit(e,t){for(let n of this.listeners[e])n(e,t)}}}var an,Ur=c(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(an||(an={}))});var Vr,cn,Gr,ln,be,He,Hr=c(()=>{"use strict";ce();g();Vr=/[<>:"\/\\|?*]/g,cn=function(e){return m.Platform.select({default:e,ios:P.saveFileToGallery?e:`Documents/${e}`})},Gr=function(e){return Vr.test(e)&&(e=e.replace(Vr,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},ln=async function(e){await Ee.getItem(e)&&Ee.removeItem(e);let t=Gr(e);await P.fileExists(`${P.getConstants().DocumentsDirPath}/${t}`)&&await P.removeFile?.("documents",t)},be=function(e){let t=Gr(e);return He(t,async function(){try{let n=`${P.getConstants().DocumentsDirPath}/${t}`;if(await P.fileExists(n))return;let r=await Ee.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${P.getConstants().CacheDirPath}/mmkv/${e}`;await P.fileExists(o)?r=await P.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await P.writeFile("documents",cn(t),r,"utf8"),await Ee.getItem(e)!==null&&(Ee.removeItem(e),console.log(`Successfully migrated ${e} store from MMKV storage to fs`))}catch(n){console.error("Failed to migrate to fs from MMKVManager ",n)}}())},He=function(e,t){let n;return{get:async function(){await t;let r=`${P.getConstants().DocumentsDirPath}/${e}`;return!n&&!await P.fileExists(r)?(n=!0,P.writeFile("documents",cn(e),"{}","utf8")):JSON.parse(await P.readFile(r,"utf8"))},set:async function(r){await t,await P.writeFile("documents",cn(e),JSON.stringify(r),"utf8")}}}});var fn={};N(fn,{awaitSyncWrapper:()=>$e,createFileBackend:()=>He,createMMKVBackend:()=>be,createProxy:()=>zr,createStorage:()=>ue,purgeStorage:()=>ln,useProxy:()=>_,wrapSync:()=>_e});function zr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=sn();function n(r,o){return new Proxy(r,{get(a,s){if(s===$r)return t;let l=[...o,s],d=a[s];return d!=null?(t.emit("GET",{path:l,value:d}),typeof d=="object"?n(d,l):d):d},set(a,s,l){return a[s]=l,t.emit("SET",{path:[...o,s],value:l}),!0},deleteProperty(a,s){let l=delete a[s];return l&&t.emit("DEL",{path:[...o,s]}),l}})}return{proxy:n(e,[]),emitter:t}}function _(e){if(e[un])throw e[un];let t=e[$r];if(!t)throw new Error("InvalidArgumentExcpetion - storage[emitterSymbol] is "+typeof t);let[,n]=React.useReducer(function(r){return~r},0);return React.useEffect(function(){let r=function(){return n()};return t.on("SET",r),t.on("DEL",r),function(){t.off("SET",r),t.off("DEL",r)}},[]),e}async function ue(e){let t=await e.get(),{proxy:n,emitter:r}=zr(t),o=function(){return e.set(n)};return r.on("SET",o),r.on("DEL",o),n}function _e(e){let t,n,r=[],o=function(a){return t?a():r.push(a)};return e.then(function(a){t=a,r.forEach(function(s){return s()})}).catch(function(a){n=a}),new Proxy({},{...Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(function(a){return[a,function(s){for(var l=arguments.length,d=new Array(l>1?l-1:0),p=1;p{"use strict";Ur();Hr();$r=Symbol.for("vendetta.storage.emitter"),jr=Symbol.for("vendetta.storage.accessor"),un=Symbol.for("vendetta.storage.error");$e=function(e){return new Promise(function(t){return e[jr](t)})}});var mn,$a,B,Ne=c(()=>{"use strict";w();mn=u("setLogFn").default,$a=new mn("Opti"),B=$a});var En={};N(En,{color:()=>fe,fetchTheme:()=>ot,getCurrentTheme:()=>Me,getThemes:()=>Rn,initThemes:()=>hn,installTheme:()=>Pe,patchChatBackground:()=>pn,removeTheme:()=>gn,selectTheme:()=>De,themes:()=>I,updateThemes:()=>Wr});async function dn(e){if(typeof e!="object")throw new Error("Theme must be an object");await He("vendetta_theme.json").set(e)}function pn(){let e=Me()?.data?.background;if(!e)return;let t=D("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=u("MessagesWrapper");if(!n)return;let r=[R("default",t,function(o,a){return React.createElement(m.ImageBackground,{style:{flex:1,height:"100%"},source:{uri:e.url},blurRadius:typeof e.blur=="number"?e.blur:0,children:a})}),R("render",n.prototype,function(o,a){let s=W(a,function(l){return"HACK_fixModalInteraction"in l?.props&&l?.props?.style});s?s.props.style=Object.assign(m.StyleSheet.flatten(s.props.style??{}),{backgroundColor:"#0000"}):B.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function Kr(e){if(me.valid(e))return me(e).hex();let t=Number(m.processColor(e));return me.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function za(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=Kr(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=Kr(t[n]);m.Platform.OS==="android"&&Ka(t)}return e}function Ka(e){let t={BLACK_ALPHA_60:["BLACK",.6],BRAND_NEW_360_ALPHA_20:["BRAND_360",.2],BRAND_NEW_360_ALPHA_25:["BRAND_360",.25],BRAND_NEW_500_ALPHA_20:["BRAND_500",.2],PRIMARY_DARK_500_ALPHA_20:["PRIMARY_500",.2],PRIMARY_DARK_700_ALPHA_60:["PRIMARY_700",.6],STATUS_GREEN_500_ALPHA_20:["GREEN_500",.2],STATUS_RED_500_ALPHA_20:["RED_500",.2]};for(let n in t){let[r,o]=t[n];e[r]&&(e[n]=me(e[r]).alpha(o).hex())}}async function ot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;try{n=await(await we(e,{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch theme at ${e}`)}I[e]={id:e,selected:t,data:za(n)},t&&dn(I[e])}async function Pe(e){if(typeof e!="string"||e in I)throw new Error("Theme already installed");await ot(e)}async function De(e){if(e==="default")return await dn({});let t=Object.values(I).find(function(n){return n.selected})?.id;t&&(I[t].selected=!1),I[e].selected=!0,await dn(I[e])}async function gn(e){let t=I[e];return t.selected&&await De("default"),delete I[e],t.selected}function Me(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function Wr(){await $e(I);let e=Me();await Promise.allSettled(Object.keys(I).map(function(t){return ot(t,e?.id===t)}))}async function hn(){let e=Me();if(!e)return;let t=fe.default.unsafe_rawColors;fe.default.unsafe_rawColors=new Proxy(t,{get:function(n,r){return e?e.data?.rawColors?.[r]??Reflect.get(t,r):Reflect.get(t,r)}}),q("resolveSemanticColor",fe.default.meta??fe.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[s,l]=Yr(o,a),d=o==="amoled"?2:o==="light"?1:0;let p=ja[s]??s,O=(e.data?.semanticColors?.[s]??e.data?.semanticColors?.[p])?.[d];if(s==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return me(O||"black").alpha(1-e.data.background.alpha).hex();if(O)return O;let F=e.data?.rawColors?.[l.raw];return F?l.opacity===1?F:me(F).alpha(l.opacity).hex():r(...n)}),await Wr()}function Yr(e,t){let n=t[Yr._sym??=Object.getOwnPropertySymbols(t)[0]],r=fe.SemanticColor[n];return[n,r[e.toLowerCase()]]}function Rn(){var e=0;return Object.keys(I).forEach(function(t){return e++}),e}var fe,I,ja,z=c(()=>{"use strict";g();le();w();M();j();Ne();fe=u("SemanticColor"),I=_e(ue(be("VENDETTA_THEMES"))),ja={BG_BACKDROP:"BACKGROUND_FLOATING",BG_BASE_PRIMARY:"BACKGROUND_PRIMARY",BG_BASE_SECONDARY:"BACKGROUND_SECONDARY",BG_BASE_TERTIARY:"BACKGROUND_SECONDARY_ALT",BG_MOD_FAINT:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_STRONG:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_SUBTLE:"BACKGROUND_MODIFIER_ACCENT",BG_SURFACE_OVERLAY:"BACKGROUND_FLOATING",BG_SURFACE_OVERLAY_TMP:"BACKGROUND_FLOATING",BG_SURFACE_RAISED:"BACKGROUND_MOBILE_PRIMARY"}});var yt,Xr,m,me,wt=c(()=>{"use strict";z();M();yt=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},Xr=yt(function(e){return e?.default?.name==="requireNativeComponent"});Xr&&q("default",Xr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=yt(function(e){return e.createElement});m=yt(function(e){return e.AppRegistry}),me=yt(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{hn()}catch(e){console.error("[Vendetta] Failed to initialize themes...",e)}});var Sn={};N(Sn,{AsyncUsers:()=>at,Flux:()=>Ja,FluxDispatcher:()=>_t,Messages:()=>_n,NavigationNative:()=>pe,Profiles:()=>Be,React:()=>oe,ReactNative:()=>m,User:()=>Se,assets:()=>it,channels:()=>wn,chroma:()=>me,clipboard:()=>V,commands:()=>bt,constants:()=>xe,i18n:()=>de,invites:()=>Xa,lodash:()=>xt,moment:()=>xn,navigation:()=>Za,navigationStack:()=>qa,stylesheet:()=>U,toasts:()=>bn,url:()=>je,util:()=>Qa});function Ya(e){if(yn){for(let t in e)e[t]=new Proxy(m.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return Zr.isSemanticColor(a)?Zr.resolveSemanticColor(Wa.theme,a):a}});return e}}var Wa,yn,Zr,xe,wn,de,je,bn,Se,at,Be,U,V,it,Xa,bt,Za,qa,pe,_n,Ja,_t,oe,xn,xt,Qa,g=c(()=>{"use strict";w();wt();wt();wt();Wa=ye("ThemeStore"),yn=u("colors","unsafe_rawColors"),Zr=yn?.internal??yn?.meta;xe=u("Fonts","Permissions"),wn=u("getVoiceChannelId"),de=u("Messages"),je=u("openURL","openDeeplink"),bn=X(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),Se=u("getCurrentUser"),at=u("getUser","fetchProfile"),Be=u("showUserProfile"),U={...X(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:Ya,...u("createThemedStyleSheet")},V=u("setString","getString","hasString"),it=u("registerAsset"),Xa=u("acceptInviteAndTransitionToInviteChannel"),bt=u("getBuiltInCommands"),Za=u("pushLazy"),qa=u("createStackNavigator"),pe=u("NavigationContainer"),_n=u("sendBotMessage"),Ja=u("connectStores"),_t=u("_currentDispatchActionType"),oe=window.React,xn=u("isMoment"),xt=u("forEachRight"),Qa=u("inspect","isNullOrUndefined")});var vn={};N(vn,{all:()=>ge,find:()=>ei,getAssetByID:()=>ni,getAssetByName:()=>ti,getAssetIDByName:()=>f,patchAssets:()=>Tn});function Tn(){let e=R("registerAsset",it,function(t,n){let r=t[0];ge[r.name]={...r,id:n}});for(let t=1;;t++){let n=it.getAssetByID(t);if(!n)break;ge[n.name]||(ge[n.name]={...n,id:t})}return e}var ge,ei,ti,ni,f,x=c(()=>{"use strict";g();M();ge={};ei=function(e){return Object.values(ge).find(e)},ti=function(e){return ge[e]},ni=function(e){return it.getAssetByID(e)},f=function(e){return ge[e]?.id}});var In={};N(In,{showToast:()=>h});var ri,h,J=c(()=>{"use strict";w();g();({uuid4:ri}=u("uuid4")),h=function(e,t){return bn.open({key:`vd-toast-${ri()}`,content:e,source:t,icon:t})}});var i,Q,L=c(()=>{"use strict";j();i=_e(ue(be("VENDETTA_SETTINGS"))),Q=_e(ue(He("vendetta_loader.json")))});var Nn={};N(Nn,{connectToDebugger:()=>An,getDebugInfo:()=>Le,patchLogHook:()=>Cn,socket:()=>Y,toggleSafeMode:()=>st,versionHash:()=>St});async function st(){i.safeMode={...i.safeMode,enabled:!i.safeMode?.enabled},window.__vendetta_loader?.features.themes&&(Me()?.id&&(i.safeMode.currentThemeId=Me().id),i.safeMode?.enabled?await De("default"):i.safeMode?.currentThemeId&&await De(i.safeMode?.currentThemeId)),setTimeout(se.reload,400)}function An(e){if(Y!==void 0&&Y.readyState!==WebSocket.CLOSED&&Y.close(),!e){h("Invalid debugger URL!",f("Small"));return}Y=new WebSocket(`ws://${e}`),Y.addEventListener("open",function(){return h("Connected to debugger.",f("Check"))}),Y.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),Y.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),h("An error occurred with the debugger connection!",f("Small"))})}function Cn(){let e=R("nativeLoggingHook",globalThis,function(t){Y?.readyState===WebSocket.OPEN&&Y.send(JSON.stringify({message:t[0],level:t[1]})),B.log(t[0])});return function(){Y&&Y.close(),e()}}function Le(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=m.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:St,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:nt.Version,build:nt.Build},react:{version:React.version,nativeVersion:t.startsWith(n)?t.substring(n.length):`${o.major}.${o.minor}.${o.patch}`},hermes:{version:t,buildType:e.Build,bytecodeVersion:e["Bytecode Version"]},...m.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...m.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ie.device}},ios:{device:{manufacturer:ie.deviceManufacturer,brand:ie.deviceBrand,model:ie.deviceModel,codename:ie.device}}})}}var Y,St,ke=c(()=>{"use strict";g();M();z();ce();x();J();L();Ne();St="dc777c9"});var K,Tt,qr,ze,Ke=c(()=>{(function(e){e.BRAND="brand",e.RED="red",e.GREEN="green",e.PRIMARY="primary",e.TRANSPARENT="transparent",e.GREY="grey",e.LIGHTGREY="lightgrey",e.WHITE="white",e.LINK="link"})(K||(K={}));(function(e){e[e.BUILT_IN=0]="BUILT_IN",e[e.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",e[e.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",e[e.BOT=3]="BOT",e[e.PLACEHOLDER=4]="PLACEHOLDER"})(Tt||(Tt={}));(function(e){e[e.SUB_COMMAND=1]="SUB_COMMAND",e[e.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",e[e.STRING=3]="STRING",e[e.INTEGER=4]="INTEGER",e[e.BOOLEAN=5]="BOOLEAN",e[e.USER=6]="USER",e[e.CHANNEL=7]="CHANNEL",e[e.ROLE=8]="ROLE",e[e.MENTIONABLE=9]="MENTIONABLE",e[e.NUMBER=10]="NUMBER",e[e.ATTACHMENT=11]="ATTACHMENT"})(qr||(qr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(ze||(ze={}))});var Bn={};N(Bn,{patchCommands:()=>Dn,registerCommand:()=>Mn});function Dn(){let e=R("getBuiltInCommands",bt,function(t,n){let[r]=t;if(r===ze.CHAT)return[...n,...Pn]});return function(){Pn=[],e()}}function Mn(e){for(let t in e){let n=bt.getBuiltInCommands(ze.CHAT,!0,!1);n.sort(function(a,s){return parseInt(s.id)-parseInt(a.id)});let r=n[n.length-1],o=e[t];e[t]={id:(parseInt(r.id,10)-1).toString(),displayName:o.name,displayDescription:o.description,type:ze.CHAT,inputType:Tt.BUILT_IN,applicationId:"Opti",...o,__isOpti:!0}}Pn.push(...e)}var Pn,vt=c(()=>{"use strict";Ke();g();M();Pn=[]});var oi,ai,ii,Jr,Qr=c(()=>{"use strict";oi=function(e){return{status:"fulfilled",value:e}},ai=function(e){return{status:"rejected",reason:e}},ii=function(e){return Promise.resolve(e).then(oi,ai)},Jr=function(e){return Promise.all(Array.from(e).map(ii))}});var Un={};N(Un,{evalPlugin:()=>eo,fetchPlugin:()=>We,getPlugins:()=>On,getSettings:()=>Fn,initPlugins:()=>kn,installPlugin:()=>ve,plugins:()=>T,removePlugin:()=>Ln,startPlugin:()=>Ye,stopPlugin:()=>Xe});async function We(e){e.endsWith("/")||(e+="/");let t=T[e],n;try{n=await(await we(e+"manifest.json",{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch manifest for ${e}`)}let r;if(t?.manifest.hash!==n.hash)try{r=await(await we(e+(n.main||"index.js"),{cache:"no-store"})).text()}catch{}if(!r&&!t)throw new Error(`Failed to fetch JS for ${e}`);T[e]={id:e,manifest:n,enabled:t?.enabled??!1,update:t?.update??!0,js:r??t.js}}async function ve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.endsWith("/")||(e+="/"),typeof e!="string"||e in T)throw new Error("Plugin already installed");await We(e),t&&await Ye(e)}async function eo(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await ue(be(e.id))},logger:new mn(`Vendetta \xBB ${e.manifest.name}`)},n=`vendetta=>{return ${e.js}} //# sourceURL=${e.id}`,r=(0,eval)(n)(t),o=typeof r=="function"?r():r;return o?.default??o??{}}async function Ye(e){e.endsWith("/")||(e+="/");let t=T[e];if(!t)throw new Error("Attempted to start non-existent plugin");try{if(!i.safeMode?.enabled){let n=await eo(t);Te[e]=n,n.onLoad?.()}t.enabled=!0}catch(n){B.error(`Plugin ${t.id} errored whilst loading, and will be unloaded`,n);try{Te[t.id]?.onUnload?.()}catch(r){B.error(`Plugin ${t.id} errored whilst unloading`,r)}delete Te[e],t.enabled=!1}}function Xe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.endsWith("/")||(e+="/");let n=T[e],r=Te[e];if(!n)throw new Error("Attempted to stop non-existent plugin");if(!i.safeMode?.enabled){try{r?.onUnload?.()}catch(o){B.error(`Plugin ${n.id} errored whilst unloading`,o)}delete Te[e]}t&&(n.enabled=!1)}async function Ln(e){e.endsWith("/")||(e+="/"),T[e].enabled&&Xe(e),delete T[e],await ln(e)}async function kn(){await $e(i),await $e(T);let e=Object.keys(T);return i.safeMode?.enabled||(await Jr(e.filter(function(t){return T[t].enabled}).map(async function(t){return T[t].update&&await We(t).catch(function(n){return B.error(n.message)}),await Ye(t)})),e.filter(function(t){return!T[t].enabled&&T[t].update}).forEach(function(t){return We(t)})),si}function On(){var e=0;return Object.keys(Te).forEach(function(t){return e++}),e}var T,Te,si,Fn,ae=c(()=>{"use strict";le();j();Qr();Ne();L();T=_e(ue(be("VENDETTA_PLUGINS"))),Te={};si=function(){return Object.keys(Te).forEach(function(e){return Xe(e,!1)})};Fn=function(e){return Te[e]?.settings}});var jn={};N(jn,{BADGES:()=>ci,DISCORD_SERVER:()=>Vn,DISCORD_SERVER_ID:()=>Gn,GITHUB:()=>$n,HTTP_REGEX:()=>li,HTTP_REGEX_MULTI:()=>lt,PLUGINS_CHANNEL_ID:()=>Hn,PROXY_PREFIX:()=>Oe,THEMES_CHANNEL_ID:()=>ct});var Vn,Gn,Hn,ct,$n,ci,Oe,li,lt,Fe=c(()=>{"use strict";Vn="https://discord.gg/zm5MWBPeRp",Gn="1228081962883747880",Hn="1228464451846672465",ct="1228464459295756358",$n="https://github.com/opti-mod",ci="https://raw.githubusercontent.com/opti-mod/badges/main/",Oe="https://vd-plugins.github.io/proxy",li=/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,lt=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g});function Ue(e){let{label:t,icon:n,noPadding:r=!1,noAnimation:o=!1,children:a}=e,{FormRow:s,FormDivider:l}=y,[d,p]=React.useState(!0);return React.createElement(React.Fragment,null,React.createElement(s,{label:t,leading:n&&React.createElement(s.Icon,{source:f(n)}),trailing:React.createElement(s.Arrow,{style:{transform:[{rotate:`${d?180:90}deg`}]}}),onPress:function(){p(!d),o||m.LayoutAnimation.configureNext(m.LayoutAnimation.Presets.easeInEaseOut)}}),!d&&React.createElement(React.Fragment,null,React.createElement(l,null),React.createElement(m.View,{style:!r&&{paddingHorizontal:15}},a)))}var to=c(()=>{"use strict";g();x();v()});function no(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ro=c(()=>{});function oo(e,t){for(var n=0;n{});function so(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var co=c(()=>{});function It(e,t){return It=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},It(e,t)}var lo=c(()=>{});function uo(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&It(e,t)}var fo=c(()=>{lo()});function ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ut(e)}var mo=c(()=>{});function po(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var go=c(()=>{});function ho(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Ro=c(()=>{});function Eo(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var yo=c(()=>{});function wo(e,t){return t&&(Eo(t)==="object"||typeof t=="function")?t:ho(e)}var bo=c(()=>{Ro();yo()});function _o(e){var t=po();return function(){var r=ut(e),o;if(t){var a=ut(this).constructor;o=Reflect.construct(r,arguments,a)}else o=r.apply(this,arguments);return wo(this,o)}}var xo=c(()=>{mo();go();bo()});var At,ui,A,zn=c(()=>{"use strict";ro();io();co();fo();xo();g();v();At=U.createThemedStyleSheet({view:{flex:1,flexDirection:"column",margin:10},title:{fontSize:20,textAlign:"center",marginBottom:5},br:{fontSize:0,paddingTop:10,paddingLeft:10,paddingRight:10}}),A=function(e){"use strict";uo(n,e);var t=_o(n);function n(r){no(this,n);var o;return o=t.call(this,r),o.state={hasErr:!1},o}return ao(n,[{key:"render",value:function(){var o=this;return this.state.hasErr?oe.createElement(m.ScrollView,{style:At.view},oe.createElement(y.FormText,{style:At.title},"Opti has encountered an error."),oe.createElement(Ie,{selectable:!0,style:{marginBottom:5,maxHeight:400}},this.state.errStack),oe.createElement(y.FormText,{style:At.br}," "),oe.createElement(b,{color:b.Colors.RED,size:b.Sizes.MEDIUM,look:b.Looks.FILLED,onPress:function(){return o.setState({hasErr:!1})},text:"Retry"}),oe.createElement(y.FormText,{style:At.br}," "),oe.createElement(b,{color:b.Colors.BRAND,size:b.Sizes.MEDIUM,look:b.Looks.FILLED,onPress:function(){return V.setString(""+o.state.errStack)},text:"Copy"})):this.props.children}}]),n}(ui=oe.Component);so(A,"getDerivedStateFromError",function(e){return{hasErr:!0,errText:e.message,errName:e.name,errCause:e.cause,errStack:e.stack}})});var Kn={};N(Kn,{rawColors:()=>fi,semanticColors:()=>S});var S,fi,Ve=c(()=>{"use strict";g();z();S=fe?.default?.colors??xe?.ThemeColorMap,fi=fe?.default?.unsafe_rawColors??xe?.Colors});function Ie(e){let{selectable:t,style:n,children:r}=e;return t?m.Platform.select({ios:React.createElement(mi,{style:n,children:r}),default:React.createElement(So,{style:n,children:r,selectable:!0})}):React.createElement(So,{style:n,children:r})}var To,mi,So,vo=c(()=>{"use strict";g();Ve();To=U.createThemedStyleSheet({codeBlock:{fontFamily:xe.Fonts.CODE_SEMIBOLD,fontSize:12,textAlignVertical:"center",backgroundColor:S.BACKGROUND_SECONDARY,color:S.TEXT_NORMAL,borderWidth:1,borderRadius:4,borderColor:S.BACKGROUND_TERTIARY,padding:10}}),mi=function(e){let{style:t,children:n}=e;return React.createElement(m.TextInput,{editable:!1,multiline:!0,style:[To.codeBlock,t&&t],value:n})},So=function(e){let{selectable:t,style:n,children:r}=e;return React.createElement(m.Text,{selectable:t,style:[To.codeBlock,n&&n]},r)}});function Ze(e){let{onChangeText:t,placeholder:n,style:r}=e;return React.createElement(di,{style:[pi.search,r],placeholder:n,onChangeText:t})}var di,pi,Io=c(()=>{"use strict";g();w();di=D("StaticSearchBarContainer"),pi=U.createThemedStyleSheet({search:{margin:0,padding:0,borderBottomWidth:0,backgroundColor:"none"}})});var Zn={};N(Zn,{Alert:()=>Wn,Button:()=>b,Codeblock:()=>Ie,ErrorBoundary:()=>A,Forms:()=>y,General:()=>gi,HelpMessage:()=>Yn,SafeAreaView:()=>Xn,Search:()=>Ze,Summary:()=>Ue});var y,gi,Wn,b,Yn,Xn,v=c(()=>{"use strict";w();to();zn();vo();Io();y=u("Form","FormSection"),gi=u("Button","Text","View"),Wn=Yt("FluxContainer(Alert)"),b=u("Looks","Colors","Sizes"),Yn=D("HelpMessage"),Xn=u("useSafeAreaInsets").SafeAreaView});function Ao(){return R("default",hi,function(e,t){let[{thread:n}]=e;if(n.guild_id!==Gn)return;let r;if(n.parent_id===Hn)r="Plugin";else if(n.parent_id===ct&&window.__vendetta_loader?.features.themes)r="Theme";else return;let{firstMessage:o}=yi(n),a=o?.content?.match(lt);if(!a)return;r==="Plugin"?a=a.filter(function(p){return p.startsWith(Oe)}):a=a.filter(function(p){return p.endsWith(".json")});let s=a[0];if(!s)return;let l=W(t,function(p){return p?.[0]?.key}),d=l[0].type;l.unshift(React.createElement(d,{key:"install"},React.createElement(Ri,{leading:React.createElement(Ei,{style:{opacity:1},source:f("ic_download_24px")}),label:`Install ${r}`,onPress:function(){return(r==="Plugin"?ve:Pe)(s).then(function(){h(`Successfully installed ${n.name}`,f("Check"))}).catch(function(p){h(p.message,f("Small"))}).finally(function(){return wi()})}})))})}var hi,Ri,Ei,yi,wi,Co=c(()=>{"use strict";w();Fe();M();ae();z();le();x();J();v();hi=D("ForumPostLongPressActionSheet",!1),{FormRow:Ri,FormIcon:Ei}=y,{useFirstForumPostMessage:yi}=u("useFirstForumPostMessage"),{hideActionSheet:wi}=u("openLazy","hideActionSheet")});function qn(e){let{title:t,confirmText:n,confirmColor:r,onConfirm:o,cancelText:a,placeholder:s,initialValue:l="",secureTextEntry:d}=e,[p,O]=React.useState(l),[F,C]=React.useState("");function H(){Promise.resolve(o(p)).then(function(){No.close()}).catch(function(Ce){C(Ce.message)})}return React.createElement(Wn,{title:t,confirmText:n,confirmColor:r,isConfirmButtonDisabled:F.length!==0,onConfirm:H,cancelText:a,onCancel:function(){return No.close()}},React.createElement(bi,{placeholder:s,value:p,onChange:function($){O(typeof $=="string"?$:$.text),F&&C("")},returnKeyType:"done",onSubmitEditing:H,error:F||void 0,secureTextEntry:d,autoFocus:!0,showBorder:!0,style:{paddingVertical:5,alignSelf:"stretch",paddingHorizontal:0}}))}var bi,No,Po=c(()=>{"use strict";w();v();({FormInput:bi}=y),No=u("openLazy","close")});var Qn={};N(Qn,{showConfirmationAlert:()=>ee,showCustomAlert:()=>Mo,showInputAlert:()=>Jn});function ee(e){let t=e;return t.body=e.content,delete t.content,t.isDismissable??=!0,Do.show(t)}var Do,Mo,Jn,Ge=c(()=>{"use strict";w();Po();Do=u("openLazy","close");Mo=function(e,t){return Do.openLazy({importer:async function(){return function(){return React.createElement(e,t)}}})},Jn=function(e){return Mo(qn,e)}});function Bo(e){return e.startsWith(Oe)?"Plugin":e.endsWith(".json")&&window.__vendetta_loader?.features.themes?"Theme":void 0}function Lo(e,t){(e==="Plugin"?ve:Pe)(t).then(function(){h("Successfully installed",f("Check"))}).catch(function(n){h(n.message,f("Small"))})}function ko(){let e=new Array;return e.push(R("showSimpleActionSheet",_i,function(t){if(t[0].key!=="LongPressUrl")return;let{header:{title:n},options:r}=t[0],o=Bo(n);o&&r.push({label:`Install ${o}`,onPress:function(){return Lo(o,n)}})})),e.push(q("handleClick",xi,async function(t,n){let{href:r}=t[0],o=Bo(r);if(!o)return n.apply(this,t);if(o==="Theme"&&vi(Ti())?.parent_id!==ct)return n.apply(this,t);ee({title:"Hold Up",content:["This link is a ",React.createElement(m.Text,{style:Ii["text-md/semibold"]},o),", would you like to install it?"],onConfirm:function(){return Lo(o,r)},confirmText:"Install",cancelText:"Cancel",secondaryConfirmText:"Open in Browser",onConfirmSecondary:function(){return Si(r)}})})),function(){return e.forEach(function(t){return t()})}}var _i,xi,Si,Ti,vi,Ii,Oo=c(()=>{"use strict";w();g();Fe();M();ae();z();Ge();x();J();_i=X(function(e){return e?.showSimpleActionSheet&&!Object.getOwnPropertyDescriptor(e,"showSimpleActionSheet")?.get}),xi=u("handleClick"),{openURL:Si}=je,{getChannelId:Ti}=wn,{getChannel:vi}=u("getChannel"),{TextStyleSheet:Ii}=u("TextStyleSheet")});function er(){let e=new Array;return e.push(Ao()),e.push(ko()),function(){return e.forEach(function(t){return t()})}}var Fo=c(()=>{"use strict";Co();Oo()});function Go(){return R("render",Ai.prototype,function(e,t){var n=this;if(!this.state.error)return;let r=Le();this.state.activeTab??="message";let o=Vo.find(function(l){return l.id===n.state.activeTab}),a=this.state.error[this.state.activeTab],s=[{text:"Restart Discord",onPress:this.handleReload},...i.safeMode?.enabled?[]:[{text:"Restart in Safe Mode",onPress:st}],{text:"Retry Render",color:K.RED,onPress:function(){return n.setState({info:null,error:null})}}];return React.createElement(A,null,React.createElement(Xn,{style:ft.container},React.createElement(m.View,{style:ft.header},t.props.Illustration&&React.createElement(t.props.Illustration,{style:{flex:1,resizeMode:"contain",maxHeight:96,paddingRight:4}}),React.createElement(m.View,{style:{flex:2,paddingLeft:4}},React.createElement(m.Text,{style:ft.headerTitle},t.props.title),React.createElement(m.Text,{style:ft.headerDescription},t.props.body))),React.createElement(m.View,{style:{flex:6}},React.createElement(m.View,{style:{paddingBottom:8}},React.createElement(Ci,{tabs:Vo,activeTab:this.state.activeTab,onTabSelected:function(l){n.setState({activeTab:l})}})),React.createElement(Ie,{selectable:!0,style:{flexBasis:"auto",marginBottom:8}},[`Discord: ${r.discord.build} (${r.os.name})`,`Vendetta: ${r.vendetta.version}`].join(` `)),React.createElement(Ie,{selectable:!0,style:{flex:1,textAlignVertical:"top"}},o?.trimWhitespace?a.split(` `).filter(function(l){return l.length!==0}).map(function(l){return l.trim()}).join(` @@ -6,7 +6,7 @@ by ${t.manifest.authors.map(function(l){return l.name}).join(", ")}`,headerIcon:t.manifest.vendetta?.icon||"ic_application_command_24px",toggleType:"switch",toggleValue:t.enabled,onToggleChange:function(l){try{l?Ye(t.id):Xe(t.id)}catch(d){h(d.message,f("Small"))}},descriptionLabel:t.manifest.description,overflowTitle:t.manifest.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Se.getUser(t.manifest.authors[0]?.id)?Be.showUserProfile({userId:t.manifest.authors[0]?.id}):at.fetchProfile(t.manifest.authors[0]?.id).then(function(){Be.showUserProfile({userId:t.manifest.authors[0]?.id})})}},{icon:"RetryIcon",label:"Refetch",onPress:async function(){qo(t,function(){We(t.id).then(async function(){h("Successfully refetched plugin.",f("toast_image_saved"))}).catch(function(){h("Failed to refetch plugin!",f("Small"))})})}},{icon:"copy",label:"Copy URL",onPress:function(){V.setString(t.id),h("Copied plugin URL to clipboard.",f("toast_copy_link"))}},{icon:"ic_download_24px",label:t.update?"Disable updates":"Enable updates",onPress:function(){t.update=!t.update,h(`${t.update?"Enabled":"Disabled"} updates for ${t.manifest.name}.`,f("toast_image_saved"))}},{icon:"ic_duplicate",label:"Clear data",isDestructive:!0,onPress:function(){return ee({title:"Wait!",content:`Are you sure you wish to clear the data of ${t.manifest.name}?`,confirmText:"Clear",cancelText:"Cancel",confirmColor:K.RED,onConfirm:function(){qo(t,function(){try{Ee.removeItem(t.id),h(`Cleared data for ${t.manifest.name}.`,f("trash"))}catch{h(`Failed to clear data for ${t.manifest.name}!`,f("Small"))}})}})}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return ee({title:"Wait!",content:`Are you sure you wish to delete ${t.manifest.name}? This will clear all of the plugin's data.`,confirmText:"Delete",cancelText:"Cancel",confirmColor:K.RED,onConfirm:function(){try{Ln(t.id),s(!0)}catch(l){h(l.message,f("Small"))}}})}}],actions:[...r?[{icon:"settings",onPress:function(){return o.push("VendettaCustomPage",{title:t.manifest.name,render:r})}}]:[]]})}var ar=c(()=>{"use strict";Ke();g();ae();ce();x();J();Ge();or()});function ir(){return _(i),React.createElement(Ae,{items:T,safeModeMessage:"Safe Mode prevents plugins from being loaded. To exit Safe Mode go to the 'Opti' tab and go back to Normal Mode.",card:dt})}var Jo=c(()=>{"use strict";j();ae();L();Dt();ar()});async function Qo(e,t){await De(e?t:"default"),se.reload()}function pt(e){let{item:t,index:n}=e;_(i);let[r,o]=React.useState(!1);if(r)return null;let a=t.data.authors;return React.createElement(mt,{index:n,headerLabel:`${t.data.name} ${a?` by ${a.map(function(s){return s.name}).join(", ")}`:""}`,headerIcon:"ic_theme_24px",descriptionLabel:t.data.description??"No description.",toggleType:i.safeMode?.enabled?void 0:"switch",toggleValue:t.selected,onToggleChange:function(s){Qo(s,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Se.getUser(t.data.authors[0]?.id)?Be.showUserProfile({userId:t.data.authors[0]?.id}):at.fetchProfile(t.data.authors[0]?.id).then(function(){Be.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){ot(t.id,t.selected).then(function(){t.selected?ee({title:"Theme refetched",content:"A reload is required to see the changes. Do you want to reload now?",confirmText:"Reload",cancelText:"Cancel",confirmColor:K.RED,onConfirm:function(){return se.reload()}}):h("Successfully refetched theme.",f("toast_image_saved"))}).catch(function(){h("Failed to refetch theme!",f("Small"))})}},{icon:"copy",label:"Copy URL",onPress:function(){V.setString(t.id),h("Copied theme URL to clipboard.",f("toast_copy_link"))}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return ee({title:"Wait!",content:`Are you sure you wish to delete ${t.data.name}?`,confirmText:"Delete",cancelText:"Cancel",confirmColor:K.RED,onConfirm:function(){gn(t.id).then(function(s){o(!0),s&&Qo(!1,t.id)}).catch(function(s){h(s.message,f("Small"))})}})}}]})}var sr=c(()=>{"use strict";Ke();g();z();j();ce();x();Ge();J();L();or()});function cr(){return _(i),React.createElement(Ae,{items:I,safeModeMessage:`You are in Safe Mode, meaning themes have been temporarily disabled.${i.safeMode?.currentThemeId?" If a theme appears to be causing the issue, you can press below to disable it.":""}`,safeModeExtras:i.safeMode?.currentThemeId?React.createElement(b,{text:"Disable Shader",color:K.BRAND,size:"small",onPress:function(){delete i.safeMode?.currentThemeId},style:{marginTop:8}}):void 0,card:pt})}var ea=c(()=>{"use strict";Ke();j();z();v();L();Dt();sr()});function Bt(){console.log("TweakManager has loaded SilentTyping."),ta=["startTyping","stopTyping"].map(function(e){return q(e,Vi,function(){})})}function Lt(){console.log("TweakManager has unloaded SilentTyping."),ta.forEach(function(e){return e()})}var Vi,ta,lr=c(()=>{"use strict";M();w();Vi=u("startTyping"),ta=[]});function kt(){console.log("TweakManager has loaded HideUnneccesaryButtons.");let e=["ic_thread_normal_24px","ic_gift","AppsIcon"].map(function(t){return f(t)});na=R("render",Gi.prototype,function(t,n){let r=W(n,function(a){return a.props?.canSendVoiceMessage});r&&(r.props.canSendVoiceMessage=!1);let o=W(n,function(a){return"forceAnimateButtons"in a.props&&a.props.actions});o.props.actions=o.props.actions.filter(function(a){return!e.includes(a.source)})})}function Ot(){console.log("TweakManager has unloaded HideUnneccesaryButtons.")}var Gi,na,ur=c(()=>{"use strict";M();w();x();le();Gi=D("ChatInput")});function Ft(){console.log("TweakManager has loaded TrustURLs."),ra.push(R("isTrustedDomain",Hi,function(){return!0}))}function Ut(){console.log("TweakManager has unloaded TrustURLs.");for(let e of ra)e()}var Hi,ra,fr=c(()=>{"use strict";M();w();Hi=ye("MaskedLinkStore"),ra=[]});function Vt(){console.log("TweakManager has loaded EnableExperiments.");try{Se.getCurrentUser().flags|=1,Se._dispatcher._actionHandlers._computeOrderedActionHandlers("OVERLAY_INITIALIZE").forEach(function(e){e.name.includes("Experiment")&&e.actionHandler({serializedExperimentStore:ji.getSerializedState(),user:{flags:1}})})}catch{let t=new Error;console.error(t.stack)}}function Gt(){console.log("TweakManager has unloaded EnableExperiments."),$i.unsubscribe("CONNECTION_OPEN")}var $i,ji,mr=c(()=>{"use strict";w();g();$i=u("_currentDispatchActionType"),ji=u("getSerializedState")});function Ht(){console.log("TweakManager has loaded RemoveDeletePrompts.");let e=u("show","openLazy");oa=q("show",e,function(t,n){t?.[0]?.title===de.Messages.DELETE_MESSAGE?t[0].onConfirm?.():n(...t)})}function $t(){console.log("TweakManager has unloaded RemoveDeletePrompt.")}var oa,dr=c(()=>{"use strict";M();w();g()});function pr(){let[e,t]=React.useState("");return _(i),i.tweaks??={},React.createElement(A,null,React.createElement(m.View,{style:{flex:1}},React.createElement(te,{label:"Tweaks",subLabel:`Right now most tweaks are ported Vendetta plugins. Want yours removed? Contact me and I'll remove it ASAP.`}),React.createElement(Je,null),React.createElement(te,{label:i.tweaks.silentTyping?.valueOf()?"Silent Typing (Enabled)":"Silent Typing (Disabled)",subLabel:"Hides that you are typing to other people.",leading:React.createElement(te.Icon,{source:f("bell")}),onPress:function(){i.tweaks.silentTyping??=!1,i.tweaks.silentTyping=!i.tweaks.silentTyping,(i.tweaks.silentTyping?Bt:Lt)()}}),React.createElement(Je,null),React.createElement(te,{label:i.tweaks.hideButtons?.valueOf()?"Remove Chat Buttons (Enabled)":"Remove Chat Buttons (Disabled)",subLabel:"Removes the Gift, Voice Message, and Activities buton.",leading:React.createElement(te.Icon,{source:f("ic_trash_24px")}),onPress:function(){i.tweaks.hideButtons??=!1,i.tweaks.hideButtons=!i.tweaks.hideButtons,(i.tweaks.hideButtons?kt:Ot)()}}),React.createElement(Je,null),React.createElement(te,{label:i.tweaks.trustURL?.valueOf()?"Trust All URLs (Enabled)":"Trust All URLs (Disabled)",subLabel:'Removes the "Trust This URL?" prompt.',leading:React.createElement(te.Icon,{source:f("unlocked")}),onPress:function(){i.tweaks.trustURL??=!1,i.tweaks.trustURL=!i.tweaks.trustURL,(i.tweaks.trustURL?Ft:Ut)()}}),React.createElement(Je,null),React.createElement(te,{label:i.tweaks.experiments?.valueOf()?"Staff Mode (Enabled)":"Staff Mode (Disabled)",subLabel:`Enables Discord Experiments - Port of EnableStaging made by acquitelol`,leading:React.createElement(te.Icon,{source:f("debug")}),onPress:function(){i.tweaks.experiments??=!0,i.tweaks.experiments=!i.tweaks.experiments,(i.tweaks.experiments?Vt:Gt)()}}),React.createElement(Je,null),React.createElement(te,{label:i.tweaks.fastdelete?.valueOf()?"Message Delete Prompt (Enabled)":"Message Delete Prompt (Disabled)",subLabel:"Delete messages without the warning prompt.",leading:React.createElement(te.Icon,{source:f("ic_message_delete")}),onPress:function(){i.tweaks.fastdelete??=!0,i.tweaks.fastdelete=!i.tweaks.fastdelete,(i.tweaks.fastdelete?Ht:$t)()}}),React.createElement(Je,null)))}var Je,te,aa=c(()=>{"use strict";g();v();x();lr();ur();fr();L();j();mr();dr();({FormDivider:Je,FormRow:te}=y)});function gr(){_(i);let[e,t]=React.useState(""),n=function(){switch(e){case"Plugins":return React.createElement(Ae,{items:T,card:dt});case"Shaders":return React.createElement(Ae,{items:I,card:pt})}};return React.createElement(m.View,{style:{flex:1}},React.createElement(b,{color:b.Colors.BRAND,size:b.Sizes.MEDIUM,look:b.Looks.FILLED,onPress:function(){return t("Plugins")},text:"Plugins"}),React.createElement(b,{color:b.Colors.BRAND,size:b.Sizes.MEDIUM,look:b.Looks.FILLED,onPress:function(){return t("Shaders")},text:"Shaders"}),React.createElement(m.View,null,n()))}var ia=c(()=>{"use strict";j();ae();z();L();Dt();ar();v();g();sr()});var Sm,Tm,vm,Im,Am,zi,Qe,jt,et,gt,sa,hr,zt=c(()=>{"use strict";g();ae();z();Ge();Ve();J();le();x();L();zn();$o();Zo();Jo();ea();Fe();aa();v();ia();({FormRow:Sm,FormSwitchRow:Tm,FormSection:vm,FormDivider:Im,FormInput:Am}=y),zi=U.createThemedStyleSheet({container:{flex:1,backgroundColor:S.BACKGROUND_MOBILE_PRIMARY}}),Qe=function(e,t){return t?xt.snakeCase(e).toUpperCase():e},jt=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},et=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:Qe("VendettaSettings",e),title:"Opti",icon:"https://raw.githubusercontent.com/Opti-mod/assets/main/Opti%202.png",render:rr},{key:Qe("VendettaSettingsTM",e),title:"Tweaks",icon:"ic_hammer_and_chisel_24px",render:pr},{key:Qe("VendettaAddons",e),title:"Addons",icon:"screenshare",render:gr},{key:Qe("VendettaPlugins",e),title:"Plugins",icon:"ic_behavior_24px",options:{headerRight:function(){return React.createElement(Ct,{alertTitle:"Install Plugin",installFunction:async function(t){if(!t.startsWith(Oe))setImmediate(function(){return ee({title:"Unproxied Plugin",content:"The plugin you are trying to install has not been proxied. Want to download it anyways?",confirmText:"Install",onConfirm:function(){return ve(t).then(function(){return h("Installed plugin",f("Check"))}).catch(function(n){return h(n?.message??`${n}`,f("Small"))})},cancelText:"Cancel"})});else return await ve(t)}})}},render:ir},{key:Qe("VendettaThemes",e),title:"Shaders",icon:"ic_theme_24px",shouldRender:function(){return window.__vendetta_loader?.features.hasOwnProperty("themes")??!0},options:{headerRight:function(){return!i.safeMode?.enabled&&React.createElement(Ct,{alertTitle:"Install Theme",installFunction:Pe})}},render:cr},{key:Qe("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=pe.useNavigation();return a.addListener("focus",function(){return a.setOptions(Z(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(A,null,React.createElement(n,null))}}]},gt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return et(e).filter(function(t){return t.shouldRender?.()??!0})},sa=function(){return jt(et(),function(e){return{title:e.title,render:e.render,...e.options}})},hr=function(){let e=et(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:gt(!0).map(function(t){return t.key})}},titleConfig:jt(e,"title"),relationships:jt(e,null),rendererConfigs:jt(e,function(t){let n=React.memo(function(r){let{navigation:o,route:a}=r;return o.addListener("focus",function(){return o.setOptions(t.options)}),React.createElement(m.View,{style:zi.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:t.icon?f(t.icon):null,screen:{route:xt.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function Er(){let e=pe.useNavigation();_(i);let t=gt();return React.createElement(A,null,React.createElement(Ki,{key:"Vendetta",title:`Opti ${i.safeMode?.enabled?" (Safe Mode)":""}`},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(Rr,{label:n.title,leading:React.createElement(Rr.Icon,{source:f(n.icon)}),trailing:Rr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(Wi,null))})))}var Rr,Ki,Wi,ca=c(()=>{"use strict";g();j();x();zt();v();L();({FormRow:Rr,FormSection:Ki,FormDivider:Wi}=y)});function yr(){let e=new Array;return e.push(R("default",Yi,function(t,n){return{...n,...sa()}})),R("default",Xi,function(t,n){let r=W(n.props.children,function(o){return o.type&&o.type.name==="UserSettingsOverview"});e.push(R("renderSupportAndAcknowledgements",r.type.prototype,function(o,a){let{props:{children:s}}=a,l=s.findIndex(function(d){return d?.type?.name==="UploadLogsButton"});l!==-1&&s.splice(l,1)})),e.push(R("render",r.type.prototype,function(o,a){let{props:{children:s}}=a,l=[de.Messages.BILLING_SETTINGS,de.Messages.PREMIUM_SETTINGS];s=W(s,function(p){return p.children?.[1].type?.name==="FormSection"}).children;let d=s.findIndex(function(p){return l.includes(p?.props.label)});s.splice(d===-1?4:d,0,React.createElement(Er,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Yi,Xi,la=c(()=>{"use strict";g();w();M();le();zt();ca();Yi=D("getScreens",!1),Xi=D("UserSettingsOverviewWrapper",!1)});function br(){let e=new Array;return qi(e)||Zi(e),function(){return e.forEach(function(t){return t?.()})}}function Zi(e){let t=u("useOverviewSettings"),n=u("getSettingTitleConfig"),r=u("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",s=u(o),l=!s,d=l?a:o,p=s??u(a);if(!p||!t)return;let O=et(!0),F=gt(!0),C=hr();e.push(R("useOverviewSettings",t,function(Ce,tt){return ua(tt,C.getLayout())})),e.push(R("getSettingTitleConfig",n,function(Ce,tt){return{...tt,...C.titleConfig}})),e.push(R(d,p,function(Ce,tt){let[Da]=Ce;return[...F.filter(function(ne){return Da.includes(ne.key)}).map(function(ne){return{type:"setting_search_result",ancestorRendererData:C.rendererConfigs[ne.key],setting:ne.key,title:C.titleConfig[ne.key],breadcrumbs:["Vendetta"],icon:C.rendererConfigs[ne.key].icon}}),...tt.filter(function(ne){return l||!O.map(function(Kt){return Kt.key}).includes(ne.setting)})].map(function(ne,Kt,Ma){return{...ne,index:Kt,total:Ma.length}})}));let H=r.SETTING_RELATIONSHIPS,$=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={...H,...C.relationships},r.SETTING_RENDERER_CONFIGS={...$,...C.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=H,r.SETTING_RENDERER_CONFIGS=$}),!0}function qi(e){let t=u("SearchableSettingsList"),n=u("SETTING_RENDERER_CONFIG"),r=u("getSettingListItems");if(!r||!t||!n)return!1;let o=et(!0),a=hr();e.push(nn("type",t.SearchableSettingsList,function(l){let[{sections:d}]=l;return ua(d,a.getLayout())})),e.push(R("getSettingListSearchResultItems",r,function(l,d){d.forEach(function(p){return o.some(function(O){return O.key===p.setting})&&(p.breadcrumbs=["Vendetta"])})}));let s=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...s,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=s}),!0}function ua(e,t){if(!Array.isArray(e)||e.find(function(o){return wr(o,"Vendetta")}))return;let n=e.findIndex(function(o){return wr(o,de.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return wr(o,de.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var wr,fa=c(()=>{"use strict";w();M();zt();g();wr=function(e,t){return e?.label===t||e?.title===t}});function _r(){let e=[yr(),br()];return function(){return e.forEach(function(t){return t?.()})}}var ma=c(()=>{"use strict";la();fa()});function ga(e){let{locale:t}=e;try{da&&(da.overrideTheme(Ji?.theme??"dark"),pa&&Qi.useAMOLEDTheme===2&&pa.setAMOLEDThemeEnabled(!0))}catch(n){B.error("Failed to fix theme...",n)}try{xn.locale(t.toLowerCase())}catch(n){B.error("Failed to fix timestamps...",n)}_t.unsubscribe("I18N_LOAD_SUCCESS",ga)}function ha(){return _t.subscribe("I18N_LOAD_SUCCESS",ga)}var da,pa,Ji,Qi,Ra=c(()=>{"use strict";g();w();Ne();da=u("updateTheme","overrideTheme"),pa=u("setAMOLEDThemeEnabled"),Ji=ye("ThemeStore"),Qi=ye("UnsyncedUserSettingsStore")});function Ea(){console.log("object object is not a function in String, fuck you, now its gone. no more strings to complain about.")}var ya=c(()=>{"use strict"});async function wa(e){return{patcher:Z(Fr,"unpatchAll"),metro:{...Xt,common:{...Sn}},constants:jn,utils:Jt,debug:Z(Nn,"versionHash","patchLogHook","toggleSafeMode"),ui:{components:Zn,toasts:In,alerts:Qn,assets:vn,...Kn},plugins:Z(Un,"initPlugins","evalPlugin"),themes:Z(En,"initThemes"),commands:Z(Bn,"patchCommands"),storage:fn,settings:i,loader:{identity:window.__vendetta_loader,config:Q},logger:B,version:St,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var ba=c(()=>{"use strict";M();Ne();L();Fe();ke();ae();z();vt();j();w();g();v();J();Ge();x();Ve();le()});function _a(){i.tweaks??={},console.log("TweakManager has initialized."),i.tweaks.trustURL==null&&(i.tweaks.trustURL=!1),i.tweaks.hideButtons==null&&(i.tweaks.hideButtons=!1),i.tweaks.silentTyping==null&&(i.tweaks.silentTyping=!1),i.tweaks.experiments==null&&(i.tweaks.experiments=!1),i.tweaks.fastdelete==null&&(i.tweaks.fastdelete=!1),(i.tweaks.trustURL?Ft:Ut)(),(i.tweaks.hideButtons?kt:Ot)(),(i.tweaks.silentTyping?Bt:Lt)(),(i.tweaks.experiments?Vt:Gt)(),(i.tweaks.fastdelete?Ht:$t)()}var xa=c(()=>{"use strict";L();lr();ur();fr();mr();dr()});var he,Sa,Ta=c(()=>{"use strict";g();ke();he=Le(),Sa=[{name:"debug",description:"Prints Optis debug information to chat.",execute(e,t){let n=`**Opti Debug Info** + Port of EnableStaging made by acquitelol`,leading:React.createElement(te.Icon,{source:f("debug")}),onPress:function(){i.tweaks.experiments??=!0,i.tweaks.experiments=!i.tweaks.experiments,(i.tweaks.experiments?Vt:Gt)()}}),React.createElement(Je,null),React.createElement(te,{label:i.tweaks.fastdelete?.valueOf()?"Message Delete Prompt (Enabled)":"Message Delete Prompt (Disabled)",subLabel:"Delete messages without the warning prompt.",leading:React.createElement(te.Icon,{source:f("ic_message_delete")}),onPress:function(){i.tweaks.fastdelete??=!0,i.tweaks.fastdelete=!i.tweaks.fastdelete,(i.tweaks.fastdelete?Ht:$t)()}}),React.createElement(Je,null)))}var Je,te,aa=c(()=>{"use strict";g();v();x();lr();ur();fr();L();j();mr();dr();({FormDivider:Je,FormRow:te}=y)});function gr(){_(i);let[e,t]=React.useState(""),n=function(){switch(e){case"Plugins":return React.createElement(Ae,{items:T,card:dt});case"Shaders":return React.createElement(Ae,{items:I,card:pt})}};return React.createElement(m.View,{style:{flexDirection:"row"}},React.createElement(b,{color:b.Colors.BRAND,size:b.Sizes.MEDIUM,look:b.Looks.FILLED,onPress:function(){return t("Plugins")},text:"Plugins"}),React.createElement(b,{color:b.Colors.BRAND,size:b.Sizes.MEDIUM,look:b.Looks.FILLED,onPress:function(){return t("Shaders")},text:"Shaders"}),React.createElement(m.View,null,n()))}var ia=c(()=>{"use strict";j();ae();z();L();Dt();ar();v();g();sr()});var Sm,Tm,vm,Im,Am,zi,Qe,jt,et,gt,sa,hr,zt=c(()=>{"use strict";g();ae();z();Ge();Ve();J();le();x();L();zn();$o();Zo();Jo();ea();Fe();aa();v();ia();({FormRow:Sm,FormSwitchRow:Tm,FormSection:vm,FormDivider:Im,FormInput:Am}=y),zi=U.createThemedStyleSheet({container:{flex:1,backgroundColor:S.BACKGROUND_MOBILE_PRIMARY}}),Qe=function(e,t){return t?xt.snakeCase(e).toUpperCase():e},jt=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},et=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:Qe("VendettaSettings",e),title:"Opti",icon:"https://raw.githubusercontent.com/Opti-mod/assets/main/Opti%202.png",render:rr},{key:Qe("VendettaSettingsTM",e),title:"Tweaks",icon:"ic_hammer_and_chisel_24px",render:pr},{key:Qe("VendettaAddons",e),title:"Addons",icon:"screenshare",render:gr},{key:Qe("VendettaPlugins",e),title:"Plugins",icon:"ic_behavior_24px",options:{headerRight:function(){return React.createElement(Ct,{alertTitle:"Install Plugin",installFunction:async function(t){if(!t.startsWith(Oe))setImmediate(function(){return ee({title:"Unproxied Plugin",content:"The plugin you are trying to install has not been proxied. Want to download it anyways?",confirmText:"Install",onConfirm:function(){return ve(t).then(function(){return h("Installed plugin",f("Check"))}).catch(function(n){return h(n?.message??`${n}`,f("Small"))})},cancelText:"Cancel"})});else return await ve(t)}})}},render:ir},{key:Qe("VendettaThemes",e),title:"Shaders",icon:"ic_theme_24px",shouldRender:function(){return window.__vendetta_loader?.features.hasOwnProperty("themes")??!0},options:{headerRight:function(){return!i.safeMode?.enabled&&React.createElement(Ct,{alertTitle:"Install Theme",installFunction:Pe})}},render:cr},{key:Qe("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=pe.useNavigation();return a.addListener("focus",function(){return a.setOptions(Z(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(A,null,React.createElement(n,null))}}]},gt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return et(e).filter(function(t){return t.shouldRender?.()??!0})},sa=function(){return jt(et(),function(e){return{title:e.title,render:e.render,...e.options}})},hr=function(){let e=et(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:gt(!0).map(function(t){return t.key})}},titleConfig:jt(e,"title"),relationships:jt(e,null),rendererConfigs:jt(e,function(t){let n=React.memo(function(r){let{navigation:o,route:a}=r;return o.addListener("focus",function(){return o.setOptions(t.options)}),React.createElement(m.View,{style:zi.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:t.icon?f(t.icon):null,screen:{route:xt.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function Er(){let e=pe.useNavigation();_(i);let t=gt();return React.createElement(A,null,React.createElement(Ki,{key:"Vendetta",title:`Opti ${i.safeMode?.enabled?" (Safe Mode)":""}`},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(Rr,{label:n.title,leading:React.createElement(Rr.Icon,{source:f(n.icon)}),trailing:Rr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(Wi,null))})))}var Rr,Ki,Wi,ca=c(()=>{"use strict";g();j();x();zt();v();L();({FormRow:Rr,FormSection:Ki,FormDivider:Wi}=y)});function yr(){let e=new Array;return e.push(R("default",Yi,function(t,n){return{...n,...sa()}})),R("default",Xi,function(t,n){let r=W(n.props.children,function(o){return o.type&&o.type.name==="UserSettingsOverview"});e.push(R("renderSupportAndAcknowledgements",r.type.prototype,function(o,a){let{props:{children:s}}=a,l=s.findIndex(function(d){return d?.type?.name==="UploadLogsButton"});l!==-1&&s.splice(l,1)})),e.push(R("render",r.type.prototype,function(o,a){let{props:{children:s}}=a,l=[de.Messages.BILLING_SETTINGS,de.Messages.PREMIUM_SETTINGS];s=W(s,function(p){return p.children?.[1].type?.name==="FormSection"}).children;let d=s.findIndex(function(p){return l.includes(p?.props.label)});s.splice(d===-1?4:d,0,React.createElement(Er,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Yi,Xi,la=c(()=>{"use strict";g();w();M();le();zt();ca();Yi=D("getScreens",!1),Xi=D("UserSettingsOverviewWrapper",!1)});function br(){let e=new Array;return qi(e)||Zi(e),function(){return e.forEach(function(t){return t?.()})}}function Zi(e){let t=u("useOverviewSettings"),n=u("getSettingTitleConfig"),r=u("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",s=u(o),l=!s,d=l?a:o,p=s??u(a);if(!p||!t)return;let O=et(!0),F=gt(!0),C=hr();e.push(R("useOverviewSettings",t,function(Ce,tt){return ua(tt,C.getLayout())})),e.push(R("getSettingTitleConfig",n,function(Ce,tt){return{...tt,...C.titleConfig}})),e.push(R(d,p,function(Ce,tt){let[Da]=Ce;return[...F.filter(function(ne){return Da.includes(ne.key)}).map(function(ne){return{type:"setting_search_result",ancestorRendererData:C.rendererConfigs[ne.key],setting:ne.key,title:C.titleConfig[ne.key],breadcrumbs:["Vendetta"],icon:C.rendererConfigs[ne.key].icon}}),...tt.filter(function(ne){return l||!O.map(function(Kt){return Kt.key}).includes(ne.setting)})].map(function(ne,Kt,Ma){return{...ne,index:Kt,total:Ma.length}})}));let H=r.SETTING_RELATIONSHIPS,$=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={...H,...C.relationships},r.SETTING_RENDERER_CONFIGS={...$,...C.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=H,r.SETTING_RENDERER_CONFIGS=$}),!0}function qi(e){let t=u("SearchableSettingsList"),n=u("SETTING_RENDERER_CONFIG"),r=u("getSettingListItems");if(!r||!t||!n)return!1;let o=et(!0),a=hr();e.push(nn("type",t.SearchableSettingsList,function(l){let[{sections:d}]=l;return ua(d,a.getLayout())})),e.push(R("getSettingListSearchResultItems",r,function(l,d){d.forEach(function(p){return o.some(function(O){return O.key===p.setting})&&(p.breadcrumbs=["Vendetta"])})}));let s=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...s,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=s}),!0}function ua(e,t){if(!Array.isArray(e)||e.find(function(o){return wr(o,"Vendetta")}))return;let n=e.findIndex(function(o){return wr(o,de.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return wr(o,de.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var wr,fa=c(()=>{"use strict";w();M();zt();g();wr=function(e,t){return e?.label===t||e?.title===t}});function _r(){let e=[yr(),br()];return function(){return e.forEach(function(t){return t?.()})}}var ma=c(()=>{"use strict";la();fa()});function ga(e){let{locale:t}=e;try{da&&(da.overrideTheme(Ji?.theme??"dark"),pa&&Qi.useAMOLEDTheme===2&&pa.setAMOLEDThemeEnabled(!0))}catch(n){B.error("Failed to fix theme...",n)}try{xn.locale(t.toLowerCase())}catch(n){B.error("Failed to fix timestamps...",n)}_t.unsubscribe("I18N_LOAD_SUCCESS",ga)}function ha(){return _t.subscribe("I18N_LOAD_SUCCESS",ga)}var da,pa,Ji,Qi,Ra=c(()=>{"use strict";g();w();Ne();da=u("updateTheme","overrideTheme"),pa=u("setAMOLEDThemeEnabled"),Ji=ye("ThemeStore"),Qi=ye("UnsyncedUserSettingsStore")});function Ea(){console.log("object object is not a function in String, fuck you, now its gone. no more strings to complain about.")}var ya=c(()=>{"use strict"});async function wa(e){return{patcher:Z(Fr,"unpatchAll"),metro:{...Xt,common:{...Sn}},constants:jn,utils:Jt,debug:Z(Nn,"versionHash","patchLogHook","toggleSafeMode"),ui:{components:Zn,toasts:In,alerts:Qn,assets:vn,...Kn},plugins:Z(Un,"initPlugins","evalPlugin"),themes:Z(En,"initThemes"),commands:Z(Bn,"patchCommands"),storage:fn,settings:i,loader:{identity:window.__vendetta_loader,config:Q},logger:B,version:St,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var ba=c(()=>{"use strict";M();Ne();L();Fe();ke();ae();z();vt();j();w();g();v();J();Ge();x();Ve();le()});function _a(){i.tweaks??={},console.log("TweakManager has initialized."),i.tweaks.trustURL==null&&(i.tweaks.trustURL=!1),i.tweaks.hideButtons==null&&(i.tweaks.hideButtons=!1),i.tweaks.silentTyping==null&&(i.tweaks.silentTyping=!1),i.tweaks.experiments==null&&(i.tweaks.experiments=!1),i.tweaks.fastdelete==null&&(i.tweaks.fastdelete=!1),(i.tweaks.trustURL?Ft:Ut)(),(i.tweaks.hideButtons?kt:Ot)(),(i.tweaks.silentTyping?Bt:Lt)(),(i.tweaks.experiments?Vt:Gt)(),(i.tweaks.fastdelete?Ht:$t)()}var xa=c(()=>{"use strict";L();lr();ur();fr();mr();dr()});var he,Sa,Ta=c(()=>{"use strict";g();ke();he=Le(),Sa=[{name:"debug",description:"Prints Optis debug information to chat.",execute(e,t){let n=`**Opti Debug Info** > **Opti Version**: ${he.vendetta.version} > **Discord Version**: ${he.discord.version} (Build ${he.discord.build}) > **Hermes**: ${he.hermes.version} @@ -14,6 +14,6 @@ Want yours removed? Contact me and I'll remove it ASAP.`}),React.createElement(J > **Device**: ${he.device.brand} > **OS**: ${he.os.name} ${he.os.version} > **Codename/Machine ID**: ${he.device.codename}`;_n.sendMessage(t.channel.id,{content:n})}}]});var va,Ia=c(()=>{"use strict";ce();va=[{name:"reload",description:"Reloads Discord.",execute(){se.reload()}}]});function Aa(){let e=[...Sa,...va];Mn(e)}var Ca=c(()=>{"use strict";vt();Ta();Ia()});var Na={};N(Na,{default:()=>es});async function es(){let e=await Promise.all([Cn(),Tn(),Dn(),pn(),ha(),Go(),_r(),er()]);window.vendetta=await wa(e),e.push(await kn()),e.push(await _a()),e.push(await Aa()),e.push(await Ea()),B.log("Opti has loaded!")}var Pa=c(()=>{"use strict";ke();vt();ae();z();x();Fo();Ho();ma();Ra();ya();Ne();ba();xa();Ca()});ce();console.log("Opti has loaded!");Object.freeze=Object;Object.seal=Object;Promise.resolve().then(()=>(Pa(),Na)).then(function(e){return e.default()}).catch(function(e){console.log(e?.stack??e.toString()),alert([`Opti failed to initialize. Some parts may not function properly. -`,`Build Number: ${nt.Build}`,"Opti Version: a476b0b",e?.stack||e.toString()].join(` +`,`Build Number: ${nt.Build}`,"Opti Version: dc777c9",e?.stack||e.toString()].join(` `))});})(); //# sourceURL=Vendetta diff --git a/src/ui/settings/pages/Addons.tsx b/src/ui/settings/pages/Addons.tsx index 0e90d0d8..965a51a4 100644 --- a/src/ui/settings/pages/Addons.tsx +++ b/src/ui/settings/pages/Addons.tsx @@ -25,7 +25,7 @@ export default function Addons() { } return ( - +