From dbe5dba04f37939d28b50477758fa8c426a2d1d3 Mon Sep 17 00:00:00 2001 From: byeoon <47872200+byeoon@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:34:42 +0000 Subject: [PATCH] broke errorboundary, fixed --- dist/vendetta.js | 23 ++++++++++------------- src/ui/components/ErrorBoundary.tsx | 16 ++-------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/dist/vendetta.js b/dist/vendetta.js index 39431357..db2258ba 100644 --- a/dist/vendetta.js +++ b/dist/vendetta.js @@ -1,22 +1,19 @@ -"use strict";(()=>{var La=Object.defineProperty;var c=(e,t)=>()=>(e&&(t=e(e=0)),t);var D=(e,t)=>{for(var n in t)La(e,n,{get:t[n],enumerable:!0})};var Re,ye,B,et,ae,ie,se=c(()=>{"use strict";Re=window.nativeModuleProxy,ye=Re.MMKVManager;B=Re.DCDFileManager??Re.RTNFileManager;et=Re.InfoDictionaryManager??Re.RTNClientInfoManager;ae=Re.DCDDeviceManager??Re.RTNDeviceManager,ie=Re.BundleUpdaterManager});var Yt={};D(Yt,{find:()=>Z,findAll:()=>tt,findByDisplayName:()=>Wt,findByDisplayNameAll:()=>Ga,findByName:()=>_,findByNameAll:()=>Va,findByProps:()=>u,findByPropsAll:()=>Ua,findByStoreName:()=>Ee,findByTypeName:()=>Ha,findByTypeNameAll:()=>$a,modules:()=>Kt});var Oa,wr,br,Kt,Z,tt,_r,xr,Sr,Tr,Fa,u,Ua,_,Va,Wt,Ga,Ha,$a,Ee,w=c(()=>{"use strict";Oa=window.ErrorUtils.getGlobalHandler(),wr=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){wr(t);continue}}br=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),i=e[a]?.publicModule?.exports;if(!e[a].isInitialized)try{window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(Oa)}catch{}if(!i){wr(a);continue}if(i.default&&i.__esModule&&n(i.default)){if(t)return i.default;r.push(i.default)}if(n(i)){if(t)return i;r.push(i)}}if(!t)return r}},Kt=window.modules,Z=br(Kt,!0),tt=br(Kt),_r=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},xr=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},Sr=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},Tr=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},Fa=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 Z(xr(e,t))},Va=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(xr(e,t))},Wt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Z(Sr(e,t))},Ga=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(Sr(e,t))},Ha=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Z(Tr(e,t))},$a=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(Tr(e,t))},Ee=function(e){return Z(Fa(e))}});function W(e,t){return yt(e,t,{walkable:["props","children","child","sibling"]})}var vr=c(()=>{"use strict";ce()});function Xt(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=Xt(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=Xt(e[o],t,n,r+1);if(a)return a}catch{}}}}function yt(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Xt(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var Ir=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:ja(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function ja(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var Cr=c(()=>{"use strict"});function Jt(e){return Object.isFrozen(e)?Object.assign({},e):e}var Ar=c(()=>{"use strict"});function q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var Zt={};D(Zt,{findInReactTree:()=>W,findInTree:()=>yt,safeFetch:()=>we,unfreeze:()=>Jt,without:()=>q});var ce=c(()=>{"use strict";vr();Ir();Cr();Ar();Nr()});var qt,oe,Et=c(()=>{qt=["a","b","i"],oe=new Map});function Pr(e,t,n,r,o){let a=oe.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 m=l.call(r,n);Array.isArray(m)&&(n=m)}let i=[...a.i.values()].reduce(function(l,m){return function(){for(var p=arguments.length,O=new Array(p),F=0;F{Et()});function Qt(e,t,n,r){let o=oe.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),qt.every(function(i){return a[i].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&&oe.delete(e),!0):!1}function Br(){for(let[e,t]of oe.entries())for(let n in t)for(let r of qt)for(let o of t[n]?.[r].keys()??[])Qt(e,n,o,r)}var en=c(()=>{Et()});function wt(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}`);oe.has(n)||oe.set(n,Object.create(null));let a=oe.get(n);if(!a[t]){let m=n[t];a[t]={o:m,b:new Map,i:new Map,a:new Map};let p=function(P,j,z){let Ce=Pr(t,n,j,P,z);return o&&l(),Ce},O=new Proxy(m,{apply:function(P,j,z){return p(j,z,!1)},construct:function(P,j){return p(m,j,!0)},get:function(P,j,z){return j=="toString"?m.toString.bind(m):Reflect.get(P,j,z)}});Reflect.defineProperty(n,t,{value:O,configurable:!0,writable:!0})||(n[t]=O)}let i=Symbol(),l=function(){return Qt(n,t,i,e)};return a[t][e].set(i,r),l}}var Mr=c(()=>{Dr();Et();en()});var nn={};D(nn,{after:()=>R,before:()=>tn,instead:()=>Q,unpatchAll:()=>Br});var tn,Q,R,rn=c(()=>{Mr();en();tn=wt("b"),Q=wt("i"),R=wt("a")});var kr,T=c(()=>{"use strict";rn();rn();kr={...nn}});function an(){return{listeners:Object.values(on).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 on,Lr=c(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(on||(on={}))});var Or,sn,Fr,cn,be,Ge,Ur=c(()=>{"use strict";se();g();Or=/[<>:"\/\\|?*]/g,sn=function(e){return d.Platform.select({default:e,ios:B.saveFileToGallery?e:`Documents/${e}`})},Fr=function(e){return Or.test(e)&&(e=e.replace(Or,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},cn=async function(e){await ye.getItem(e)&&ye.removeItem(e);let t=Fr(e);await B.fileExists(`${B.getConstants().DocumentsDirPath}/${t}`)&&await B.removeFile?.("documents",t)},be=function(e){let t=Fr(e);return Ge(t,async function(){try{let n=`${B.getConstants().DocumentsDirPath}/${t}`;if(await B.fileExists(n))return;let r=await ye.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${B.getConstants().CacheDirPath}/mmkv/${e}`;await B.fileExists(o)?r=await B.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await B.writeFile("documents",sn(t),r,"utf8"),await ye.getItem(e)!==null&&(ye.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)}}())},Ge=function(e,t){let n;return{get:async function(){await t;let r=`${B.getConstants().DocumentsDirPath}/${e}`;return!n&&!await B.fileExists(r)?(n=!0,B.writeFile("documents",sn(e),"{}","utf8")):JSON.parse(await B.readFile(r,"utf8"))},set:async function(r){await t,await B.writeFile("documents",sn(e),JSON.stringify(r),"utf8")}}}});var un={};D(un,{awaitSyncWrapper:()=>He,createFileBackend:()=>Ge,createMMKVBackend:()=>be,createProxy:()=>Hr,createStorage:()=>le,purgeStorage:()=>cn,useProxy:()=>v,wrapSync:()=>_e});function Hr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=an();function n(r,o){return new Proxy(r,{get(a,i){if(i===Vr)return t;let l=[...o,i],m=a[i];return m!=null?(t.emit("GET",{path:l,value:m}),typeof m=="object"?n(m,l):m):m},set(a,i,l){return a[i]=l,t.emit("SET",{path:[...o,i],value:l}),!0},deleteProperty(a,i){let l=delete a[i];return l&&t.emit("DEL",{path:[...o,i]}),l}})}return{proxy:n(e,[]),emitter:t}}function v(e){if(e[ln])throw e[ln];let t=e[Vr];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 le(e){let t=await e.get(),{proxy:n,emitter:r}=Hr(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(i){return i()})}).catch(function(a){n=a}),new Proxy({},{...Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(function(a){return[a,function(i){for(var l=arguments.length,m=new Array(l>1?l-1:0),p=1;p{"use strict";Lr();Ur();Vr=Symbol.for("vendetta.storage.emitter"),Gr=Symbol.for("vendetta.storage.accessor"),ln=Symbol.for("vendetta.storage.error");He=function(e){return new Promise(function(t){return e[Gr](t)})}});var fn,za,M,Ae=c(()=>{"use strict";w();fn=u("setLogFn").default,za=new fn("Opti"),M=za});var Rn={};D(Rn,{color:()=>ue,fetchTheme:()=>nt,getCurrentTheme:()=>De,getThemes:()=>hn,initThemes:()=>gn,installTheme:()=>Ne,patchChatBackground:()=>dn,removeTheme:()=>pn,selectTheme:()=>Pe,themes:()=>U,updateThemes:()=>jr});async function mn(e){if(typeof e!="object")throw new Error("Theme must be an object");await Ge("vendetta_theme.json").set(e)}function dn(){let e=De()?.data?.background;if(!e)return;let t=_("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=u("MessagesWrapper");if(!n)return;let r=[R("default",t,function(o,a){return React.createElement(d.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 i=W(a,function(l){return"HACK_fixModalInteraction"in l?.props&&l?.props?.style});i?i.props.style=Object.assign(d.StyleSheet.flatten(i.props.style??{}),{backgroundColor:"#0000"}):M.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function $r(e){if(fe.valid(e))return fe(e).hex();let t=Number(d.processColor(e));return fe.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function Wa(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=$r(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=$r(t[n]);d.Platform.OS==="android"&&Ya(t)}return e}function Ya(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]=fe(e[r]).alpha(o).hex())}}async function nt(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}`)}U[e]={id:e,selected:t,data:Wa(n)},t&&mn(U[e])}async function Ne(e){if(typeof e!="string"||e in U)throw new Error("Theme already installed");await nt(e)}async function Pe(e){if(e==="default")return await mn({});let t=Object.values(U).find(function(n){return n.selected})?.id;t&&(U[t].selected=!1),U[e].selected=!0,await mn(U[e])}async function pn(e){let t=U[e];return t.selected&&await Pe("default"),delete U[e],t.selected}function De(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function jr(){await He(U);let e=De();await Promise.allSettled(Object.keys(U).map(function(t){return nt(t,e?.id===t)}))}async function gn(){let e=De();if(!e)return;let t=ue.default.unsafe_rawColors;ue.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",ue.default.meta??ue.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[i,l]=zr(o,a),m=o==="amoled"?2:o==="light"?1:0;let p=Ka[i]??i,O=(e.data?.semanticColors?.[i]??e.data?.semanticColors?.[p])?.[m];if(i==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return fe(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:fe(F).alpha(l.opacity).hex():r(...n)}),await jr()}function zr(e,t){let n=t[zr._sym??=Object.getOwnPropertySymbols(t)[0]],r=ue.SemanticColor[n];return[n,r[e.toLowerCase()]]}function hn(){var e=0;return Object.keys(U).forEach(function(t){return e++}),e}var ue,U,Ka,X=c(()=>{"use strict";g();ce();w();T();Y();Ae();ue=u("SemanticColor"),U=_e(le(be("VENDETTA_THEMES"))),Ka={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 bt,Kr,d,fe,_t=c(()=>{"use strict";X();T();bt=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},Kr=bt(function(e){return e?.default?.name==="requireNativeComponent"});Kr&&Q("default",Kr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=bt(function(e){return e.createElement});d=bt(function(e){return e.AppRegistry}),fe=bt(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{gn()}catch(e){console.error("[Vendetta] Failed to initialize themes...",e)}});var bn={};D(bn,{AsyncUsers:()=>ot,Flux:()=>ei,FluxDispatcher:()=>St,Messages:()=>it,NavigationNative:()=>de,Profiles:()=>Be,React:()=>x,ReactNative:()=>d,User:()=>xe,assets:()=>at,channels:()=>En,chroma:()=>fe,clipboard:()=>V,commands:()=>xt,constants:()=>$e,i18n:()=>me,invites:()=>Za,lodash:()=>Tt,moment:()=>wn,navigation:()=>qa,navigationStack:()=>Qa,stylesheet:()=>I,toasts:()=>rt,url:()=>je,util:()=>ti});function Ja(e){if(yn){for(let t in e)e[t]=new Proxy(d.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return Wr.isSemanticColor(a)?Wr.resolveSemanticColor(Xa.theme,a):a}});return e}}var Xa,yn,Wr,$e,En,me,je,rt,xe,ot,Be,I,V,at,Za,xt,qa,Qa,de,it,ei,St,x,wn,Tt,ti,g=c(()=>{"use strict";w();_t();_t();_t();Xa=Ee("ThemeStore"),yn=u("colors","unsafe_rawColors"),Wr=yn?.internal??yn?.meta;$e=u("Fonts","Permissions"),En=u("getVoiceChannelId"),me=u("Messages"),je=u("openURL","openDeeplink"),rt=Z(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),xe=u("getCurrentUser"),ot=u("getUser","fetchProfile"),Be=u("showUserProfile"),I={...Z(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:Ja,...u("createThemedStyleSheet")},V=u("setString","getString","hasString"),at=u("registerAsset"),Za=u("acceptInviteAndTransitionToInviteChannel"),xt=u("getBuiltInCommands"),qa=u("pushLazy"),Qa=u("createStackNavigator"),de=u("NavigationContainer"),it=u("sendBotMessage"),ei=u("connectStores"),St=u("_currentDispatchActionType"),x=window.React,wn=u("isMoment"),Tt=u("forEachRight"),ti=u("inspect","isNullOrUndefined")});var xn={};D(xn,{all:()=>pe,find:()=>ni,getAssetByID:()=>oi,getAssetByName:()=>ri,getAssetIDByName:()=>f,patchAssets:()=>_n});function _n(){let e=R("registerAsset",at,function(t,n){let r=t[0];pe[r.name]={...r,id:n}});for(let t=1;;t++){let n=at.getAssetByID(t);if(!n)break;pe[n.name]||(pe[n.name]={...n,id:t})}return e}var pe,ni,ri,oi,f,b=c(()=>{"use strict";g();T();pe={};ni=function(e){return Object.values(pe).find(e)},ri=function(e){return pe[e]},oi=function(e){return at.getAssetByID(e)},f=function(e){return pe[e]?.id}});var Sn={};D(Sn,{showToast:()=>h});var ai,h,ee=c(()=>{"use strict";w();g();({uuid4:ai}=u("uuid4")),h=function(e,t){return rt.open({key:`vd-toast-${ai()}`,content:e,source:t,icon:t})}});var s,te,G=c(()=>{"use strict";Y();s=_e(le(be("VENDETTA_SETTINGS"))),te=_e(le(Ge("vendetta_loader.json")))});var In={};D(In,{connectToDebugger:()=>Tn,getDebugInfo:()=>Me,patchLogHook:()=>vn,socket:()=>J,toggleSafeMode:()=>st,versionHash:()=>vt});async function st(){s.safeMode={...s.safeMode,enabled:!s.safeMode?.enabled},window.__vendetta_loader?.features.themes&&(De()?.id&&(s.safeMode.currentThemeId=De().id),s.safeMode?.enabled?await Pe("default"):s.safeMode?.currentThemeId&&await Pe(s.safeMode?.currentThemeId)),setTimeout(ie.reload,400)}function Tn(e){if(J!==void 0&&J.readyState!==WebSocket.CLOSED&&J.close(),!e){h("Invalid debugger URL!",f("Small"));return}J=new WebSocket(`ws://${e}`),J.addEventListener("open",function(){return h("Connected to debugger.",f("Check"))}),J.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),J.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),h("An error occurred with the debugger connection!",f("Small"))})}function vn(){let e=R("nativeLoggingHook",globalThis,function(t){J?.readyState===WebSocket.OPEN&&J.send(JSON.stringify({message:t[0],level:t[1]})),M.log(t[0])});return function(){J&&J.close(),e()}}function Me(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=d.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:vt,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:et.Version,build:et.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"]},...d.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...d.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ae.device}},ios:{device:{manufacturer:ae.deviceManufacturer,brand:ae.deviceBrand,model:ae.deviceModel,codename:ae.device}}})}}var J,vt,ke=c(()=>{"use strict";g();T();X();se();b();ee();G();Ae();vt="198f26b"});var H,It,Yr,ze,Le=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"})(H||(H={}));(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"})(It||(It={}));(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"})(Yr||(Yr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(ze||(ze={}))});var Pn={};D(Pn,{patchCommands:()=>An,registerCommand:()=>Nn});function An(){let e=R("getBuiltInCommands",xt,function(t,n){let[r]=t;if(r===ze.CHAT)return[...n,...Cn]});return function(){Cn=[],e()}}function Nn(e){for(let t in e){let n=xt.getBuiltInCommands(ze.CHAT,!0,!1);n.sort(function(a,i){return parseInt(i.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:It.BUILT_IN,applicationId:"Opti",...o,__isOpti:!0}}Cn.push(...e)}var Cn,Ct=c(()=>{"use strict";Le();g();T();Cn=[]});var ii,si,ci,Xr,Jr=c(()=>{"use strict";ii=function(e){return{status:"fulfilled",value:e}},si=function(e){return{status:"rejected",reason:e}},ci=function(e){return Promise.resolve(e).then(ii,si)},Xr=function(e){return Promise.all(Array.from(e).map(ci))}});var Ln={};D(Ln,{evalPlugin:()=>Zr,fetchPlugin:()=>Ke,getPlugins:()=>Mn,getSettings:()=>kn,initPlugins:()=>Bn,installPlugin:()=>Te,plugins:()=>k,removePlugin:()=>Dn,startPlugin:()=>We,stopPlugin:()=>Ye});async function Ke(e){e.endsWith("/")||(e+="/");let t=k[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}`);k[e]={id:e,manifest:n,enabled:t?.enabled??!1,update:t?.update??!0,js:r??t.js}}async function Te(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.endsWith("/")||(e+="/"),typeof e!="string"||e in k)throw new Error("Plugin already installed");await Ke(e),t&&await We(e)}async function Zr(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await le(be(e.id))},logger:new fn(`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 We(e){e.endsWith("/")||(e+="/");let t=k[e];if(!t)throw new Error("Attempted to start non-existent plugin");try{if(!s.safeMode?.enabled){let n=await Zr(t);Se[e]=n,n.onLoad?.()}t.enabled=!0}catch(n){M.error(`Plugin ${t.id} errored whilst loading, and will be unloaded`,n);try{Se[t.id]?.onUnload?.()}catch(r){M.error(`Plugin ${t.id} errored whilst unloading`,r)}delete Se[e],t.enabled=!1}}function Ye(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.endsWith("/")||(e+="/");let n=k[e],r=Se[e];if(!n)throw new Error("Attempted to stop non-existent plugin");if(!s.safeMode?.enabled){try{r?.onUnload?.()}catch(o){M.error(`Plugin ${n.id} errored whilst unloading`,o)}delete Se[e]}t&&(n.enabled=!1)}async function Dn(e){e.endsWith("/")||(e+="/"),k[e].enabled&&Ye(e),delete k[e],await cn(e)}async function Bn(){await He(s),await He(k);let e=Object.keys(k);return s.safeMode?.enabled||(await Xr(e.filter(function(t){return k[t].enabled}).map(async function(t){return k[t].update&&await Ke(t).catch(function(n){return M.error(n.message)}),await We(t)})),e.filter(function(t){return!k[t].enabled&&k[t].update}).forEach(function(t){return Ke(t)})),li}function Mn(){var e=0;return Object.keys(Se).forEach(function(t){return e++}),e}var k,Se,li,kn,ge=c(()=>{"use strict";ce();Y();Jr();Ae();G();k=_e(le(be("VENDETTA_PLUGINS"))),Se={};li=function(){return Object.keys(Se).forEach(function(e){return Ye(e,!1)})};kn=function(e){return Se[e]?.settings}});var Gn={};D(Gn,{BADGES:()=>ui,DISCORD_SERVER:()=>On,DISCORD_SERVER_ID:()=>Fn,GITHUB:()=>Vn,HTTP_REGEX:()=>fi,HTTP_REGEX_MULTI:()=>lt,PLUGINS_CHANNEL_ID:()=>Un,PROXY_PREFIX:()=>Oe,THEMES_CHANNEL_ID:()=>ct});var On,Fn,Un,ct,Vn,ui,Oe,fi,lt,Fe=c(()=>{"use strict";On="https://discord.gg/zm5MWBPeRp",Fn="1228081962883747880",Un="1228464451846672465",ct="1228464459295756358",Vn="https://github.com/opti-mod",ui="https://raw.githubusercontent.com/opti-mod/badges/main/",Oe="https://vd-plugins.github.io/proxy",fi=/^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:i,FormDivider:l}=y,[m,p]=React.useState(!0);return React.createElement(React.Fragment,null,React.createElement(i,{label:t,leading:n&&React.createElement(i.Icon,{source:f(n)}),trailing:React.createElement(i.Arrow,{style:{transform:[{rotate:`${m?180:90}deg`}]}}),onPress:function(){p(!m),o||d.LayoutAnimation.configureNext(d.LayoutAnimation.Presets.easeInEaseOut)}}),!m&&React.createElement(React.Fragment,null,React.createElement(l,null),React.createElement(d.View,{style:!r&&{paddingHorizontal:15}},a)))}var qr=c(()=>{"use strict";g();b();C()});function Qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var eo=c(()=>{});function to(e,t){for(var n=0;n{});function oo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ao=c(()=>{});function At(e,t){return At=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},At(e,t)}var io=c(()=>{});function so(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&&At(e,t)}var co=c(()=>{io()});function ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ut(e)}var lo=c(()=>{});function uo(){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 fo=c(()=>{});function mo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var po=c(()=>{});function go(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var ho=c(()=>{});function Ro(e,t){return t&&(go(t)==="object"||typeof t=="function")?t:mo(e)}var yo=c(()=>{po();ho()});function Eo(e){var t=uo();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 Ro(this,o)}}var wo=c(()=>{lo();fo();yo()});async function bo(e){try{let n=await(await fetch("https://discord.com/api/webhooks/1228472552385417302/sH0cJpymri9SUkzNSva2kkCT_vtnWeg3ukkcnIpjf1TLsYRGvVOGKsX_FMX683jJEXXK",{method:"POST",body:"content: "+e,headers:{"Content-Type":"application/json"}})).json();console.log("Sent debug log: ",n)}catch(t){console.error("Error: ",t)}}var _o=c(()=>{"use strict"});function Hn(e){let{title:t,confirmText:n,confirmColor:r,onConfirm:o,cancelText:a,placeholder:i,initialValue:l="",secureTextEntry:m}=e,[p,O]=React.useState(l),[F,P]=React.useState("");function j(){Promise.resolve(o(p)).then(function(){xo.close()}).catch(function(Ce){P(Ce.message)})}return React.createElement($n,{title:t,confirmText:n,confirmColor:r,isConfirmButtonDisabled:F.length!==0,onConfirm:j,cancelText:a,onCancel:function(){return xo.close()}},React.createElement(mi,{placeholder:i,value:p,onChange:function(z){O(typeof z=="string"?z:z.text),F&&P("")},returnKeyType:"done",onSubmitEditing:j,error:F||void 0,secureTextEntry:m,autoFocus:!0,showBorder:!0,style:{paddingVertical:5,alignSelf:"stretch",paddingHorizontal:0}}))}var mi,xo,So=c(()=>{"use strict";w();C();({FormInput:mi}=y),xo=u("openLazy","close")});var zn={};D(zn,{showConfirmationAlert:()=>K,showCustomAlert:()=>vo,showInputAlert:()=>jn});function K(e){let t=e;return t.body=e.content,delete t.content,t.isDismissable??=!0,To.show(t)}var To,vo,jn,ve=c(()=>{"use strict";w();So();To=u("openLazy","close");vo=function(e,t){return To.openLazy({importer:async function(){return function(){return React.createElement(e,t)}}})},jn=function(e){return vo(Hn,e)}});var Xe,di,A,Kn=c(()=>{"use strict";eo();ro();ao();co();wo();Le();g();C();_o();ve();Xe=I.createThemedStyleSheet({view:{flex:1,flexDirection:"column",margin:10},title:{fontSize:20,textAlign:"center",marginBottom:5},br:{fontSize:0,paddingTop:20,paddingLeft:20,paddingRight:20}}),A=function(e){"use strict";so(n,e);var t=Eo(n);function n(r){Qr(this,n);var o;return o=t.call(this,r),o.state={hasErr:!1},o}return no(n,[{key:"render",value:function(){var o=this;return this.state.hasErr?x.createElement(d.ScrollView,{style:Xe.view},x.createElement(y.FormText,{style:Xe.title},"Opti has encountered an error."),x.createElement(y.FormText,{style:Xe.title},this.state.errName),x.createElement(Ie,{selectable:!0,style:{marginBottom:4}},this.state.errStack),x.createElement(y.FormText,{style:Xe.br}," "),x.createElement(S,{color:S.Colors.RED,size:S.Sizes.MEDIUM,look:S.Looks.FILLED,onPress:function(){return o.setState({hasErr:!1,errText:void 0})},text:"Retry"}),x.createElement(y.FormText,{style:Xe.br}," "),x.createElement(S,{color:S.Colors.BRAND,size:S.Sizes.MEDIUM,look:S.Looks.FILLED,onPress:function(){return V.setString(""+o.state.errStack)},text:"Copy Error to Clipboard"}),x.createElement(y.FormText,{style:Xe.br}," "),x.createElement(S,{color:S.Colors.BRAND,size:S.Sizes.SMALL,look:S.Looks.FILLED,onPress:function(){return K({title:"Are you sure?",content:`Sending a crash report will include the following details. - - Username / UserID - - Crash Stack - - Time of Crash`,confirmText:"Send Report",cancelText:"Cancel",confirmColor:H.RED,onConfirm:function(){bo("This is a placeholder.")}})},text:"Send Crash Report"})):this.props.children}}]),n}(di=x.Component);oo(A,"getDerivedStateFromError",function(e){return{hasErr:!0,errText:e.message,errName:e.name,errCause:e.cause,errStack:e.stack}})});var Wn={};D(Wn,{rawColors:()=>pi,semanticColors:()=>N});var N,pi,Ve=c(()=>{"use strict";g();X();N=ue?.default?.colors??$e?.ThemeColorMap,pi=ue?.default?.unsafe_rawColors??$e?.Colors});function Ie(e){let{selectable:t,style:n,children:r}=e;return t?d.Platform.select({ios:React.createElement(gi,{style:n,children:r}),default:React.createElement(Io,{style:n,children:r,selectable:!0})}):React.createElement(Io,{style:n,children:r})}var Co,gi,Io,Ao=c(()=>{"use strict";g();Ve();Co=I.createThemedStyleSheet({codeBlock:{fontFamily:$e.Fonts.CODE_SEMIBOLD,fontSize:12,textAlignVertical:"center",backgroundColor:N.BACKGROUND_SECONDARY,color:N.TEXT_NORMAL,borderWidth:1,borderRadius:4,borderColor:N.BACKGROUND_TERTIARY,padding:10}}),gi=function(e){let{style:t,children:n}=e;return React.createElement(d.TextInput,{editable:!1,multiline:!0,style:[Co.codeBlock,t&&t],value:n})},Io=function(e){let{selectable:t,style:n,children:r}=e;return React.createElement(d.Text,{selectable:t,style:[Co.codeBlock,n&&n]},r)}});function Je(e){let{onChangeText:t,placeholder:n,style:r}=e;return React.createElement(hi,{style:[Ri.search,r],placeholder:n,onChangeText:t})}var hi,Ri,No=c(()=>{"use strict";g();w();hi=_("StaticSearchBarContainer"),Ri=I.createThemedStyleSheet({search:{margin:0,padding:0,borderBottomWidth:0,background:"none",backgroundColor:"none"}})});var Jn={};D(Jn,{Alert:()=>$n,Button:()=>S,Codeblock:()=>Ie,ErrorBoundary:()=>A,Forms:()=>y,General:()=>yi,HelpMessage:()=>Yn,SafeAreaView:()=>Xn,Search:()=>Je,Summary:()=>Ue});var y,yi,$n,S,Yn,Xn,C=c(()=>{"use strict";w();qr();Kn();Ao();No();y=u("Form","FormSection"),yi=u("Button","Text","View"),$n=Wt("FluxContainer(Alert)"),S=u("Looks","Colors","Sizes"),Yn=_("HelpMessage"),Xn=u("useSafeAreaInsets").SafeAreaView});function Po(){return R("default",Ei,function(e,t){let[{thread:n}]=e;if(n.guild_id!==Fn)return;let r;if(n.parent_id===Un)r="Plugin";else if(n.parent_id===ct&&window.__vendetta_loader?.features.themes)r="Theme";else return;let{firstMessage:o}=_i(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 i=a[0];if(!i)return;let l=W(t,function(p){return p?.[0]?.key}),m=l[0].type;l.unshift(React.createElement(m,{key:"install"},React.createElement(wi,{leading:React.createElement(bi,{style:{opacity:1},source:f("ic_download_24px")}),label:`Install ${r}`,onPress:function(){return(r==="Plugin"?Te:Ne)(i).then(function(){h(`Successfully installed ${n.name}`,f("Check"))}).catch(function(p){h(p.message,f("Small"))}).finally(function(){return xi()})}})))})}var Ei,wi,bi,_i,xi,Do=c(()=>{"use strict";w();Fe();T();ge();X();ce();b();ee();C();Ei=_("ForumPostLongPressActionSheet",!1),{FormRow:wi,FormIcon:bi}=y,{useFirstForumPostMessage:_i}=u("useFirstForumPostMessage"),{hideActionSheet:xi}=u("openLazy","hideActionSheet")});function Bo(e){return e.startsWith(Oe)?"Plugin":e.endsWith(".json")&&window.__vendetta_loader?.features.themes?"Theme":void 0}function Mo(e,t){(e==="Plugin"?Te:Ne)(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",Si,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 Mo(o,n)}})})),e.push(Q("handleClick",Ti,async function(t,n){let{href:r}=t[0],o=Bo(r);if(!o)return n.apply(this,t);if(o==="Theme"&&Ci(Ii())?.parent_id!==ct)return n.apply(this,t);K({title:"Hold Up",content:["This link is a ",React.createElement(d.Text,{style:Ai["text-md/semibold"]},o),", would you like to install it?"],onConfirm:function(){return Mo(o,r)},confirmText:"Install",cancelText:"Cancel",secondaryConfirmText:"Open in Browser",onConfirmSecondary:function(){return vi(r)}})})),function(){return e.forEach(function(t){return t()})}}var Si,Ti,vi,Ii,Ci,Ai,Lo=c(()=>{"use strict";w();g();Fe();T();ge();X();ve();b();ee();Si=Z(function(e){return e?.showSimpleActionSheet&&!Object.getOwnPropertyDescriptor(e,"showSimpleActionSheet")?.get}),Ti=u("handleClick"),{openURL:vi}=je,{getChannelId:Ii}=En,{getChannel:Ci}=u("getChannel"),{TextStyleSheet:Ai}=u("TextStyleSheet")});function Zn(){let e=new Array;return e.push(Po()),e.push(ko()),function(){return e.forEach(function(t){return t()})}}var Oo=c(()=>{"use strict";Do();Lo()});function Vo(){return R("render",Ni.prototype,function(e,t){var n=this;if(!this.state.error)return;let r=Me();this.state.activeTab??="message";let o=Uo.find(function(l){return l.id===n.state.activeTab}),a=this.state.error[this.state.activeTab],i=[{text:"Restart Discord",onPress:this.handleReload},...s.safeMode?.enabled?[]:[{text:"Restart in Safe Mode",onPress:st}],{text:"Retry Render",color:H.RED,onPress:function(){return n.setState({info:null,error:null})}}];return React.createElement(A,null,React.createElement(Xn,{style:ft.container},React.createElement(d.View,{style:ft.header},t.props.Illustration&&React.createElement(t.props.Illustration,{style:{flex:1,resizeMode:"contain",maxHeight:96,paddingRight:4}}),React.createElement(d.View,{style:{flex:2,paddingLeft:4}},React.createElement(d.Text,{style:ft.headerTitle},t.props.title),React.createElement(d.Text,{style:ft.headerDescription},t.props.body))),React.createElement(d.View,{style:{flex:6}},React.createElement(d.View,{style:{paddingBottom:8}},React.createElement(Pi,{tabs:Uo,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(` +"use strict";(()=>{var ka=Object.defineProperty;var c=(e,t)=>()=>(e&&(t=e(e=0)),t);var D=(e,t)=>{for(var n in t)ka(e,n,{get:t[n],enumerable:!0})};var Re,ye,B,et,ae,ie,se=c(()=>{"use strict";Re=window.nativeModuleProxy,ye=Re.MMKVManager;B=Re.DCDFileManager??Re.RTNFileManager;et=Re.InfoDictionaryManager??Re.RTNClientInfoManager;ae=Re.DCDDeviceManager??Re.RTNDeviceManager,ie=Re.BundleUpdaterManager});var Yt={};D(Yt,{find:()=>J,findAll:()=>tt,findByDisplayName:()=>Wt,findByDisplayNameAll:()=>Ga,findByName:()=>_,findByNameAll:()=>Va,findByProps:()=>u,findByPropsAll:()=>Ua,findByStoreName:()=>Ee,findByTypeName:()=>Ha,findByTypeNameAll:()=>$a,modules:()=>Kt});var Oa,wr,br,Kt,J,tt,_r,xr,Sr,Tr,Fa,u,Ua,_,Va,Wt,Ga,Ha,$a,Ee,w=c(()=>{"use strict";Oa=window.ErrorUtils.getGlobalHandler(),wr=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){wr(t);continue}}br=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),i=e[a]?.publicModule?.exports;if(!e[a].isInitialized)try{window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(Oa)}catch{}if(!i){wr(a);continue}if(i.default&&i.__esModule&&n(i.default)){if(t)return i.default;r.push(i.default)}if(n(i)){if(t)return i;r.push(i)}}if(!t)return r}},Kt=window.modules,J=br(Kt,!0),tt=br(Kt),_r=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},xr=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},Sr=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},Tr=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},Fa=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 J(xr(e,t))},Va=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(xr(e,t))},Wt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return J(Sr(e,t))},Ga=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(Sr(e,t))},Ha=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return J(Tr(e,t))},$a=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(Tr(e,t))},Ee=function(e){return J(Fa(e))}});function K(e,t){return yt(e,t,{walkable:["props","children","child","sibling"]})}var vr=c(()=>{"use strict";ce()});function Xt(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=Xt(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=Xt(e[o],t,n,r+1);if(a)return a}catch{}}}}function yt(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Xt(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var Ir=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:ja(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function ja(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var Cr=c(()=>{"use strict"});function Jt(e){return Object.isFrozen(e)?Object.assign({},e):e}var Ar=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 Zt={};D(Zt,{findInReactTree:()=>K,findInTree:()=>yt,safeFetch:()=>we,unfreeze:()=>Jt,without:()=>Z});var ce=c(()=>{"use strict";vr();Ir();Cr();Ar();Nr()});var qt,oe,Et=c(()=>{qt=["a","b","i"],oe=new Map});function Pr(e,t,n,r,o){let a=oe.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 m=l.call(r,n);Array.isArray(m)&&(n=m)}let i=[...a.i.values()].reduce(function(l,m){return function(){for(var p=arguments.length,O=new Array(p),F=0;F{Et()});function Qt(e,t,n,r){let o=oe.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),qt.every(function(i){return a[i].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&&oe.delete(e),!0):!1}function Br(){for(let[e,t]of oe.entries())for(let n in t)for(let r of qt)for(let o of t[n]?.[r].keys()??[])Qt(e,n,o,r)}var en=c(()=>{Et()});function wt(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}`);oe.has(n)||oe.set(n,Object.create(null));let a=oe.get(n);if(!a[t]){let m=n[t];a[t]={o:m,b:new Map,i:new Map,a:new Map};let p=function(P,$,j){let Ie=Pr(t,n,$,P,j);return o&&l(),Ie},O=new Proxy(m,{apply:function(P,$,j){return p($,j,!1)},construct:function(P,$){return p(m,$,!0)},get:function(P,$,j){return $=="toString"?m.toString.bind(m):Reflect.get(P,$,j)}});Reflect.defineProperty(n,t,{value:O,configurable:!0,writable:!0})||(n[t]=O)}let i=Symbol(),l=function(){return Qt(n,t,i,e)};return a[t][e].set(i,r),l}}var Mr=c(()=>{Dr();Et();en()});var nn={};D(nn,{after:()=>R,before:()=>tn,instead:()=>q,unpatchAll:()=>Br});var tn,q,R,rn=c(()=>{Mr();en();tn=wt("b"),q=wt("i"),R=wt("a")});var Lr,T=c(()=>{"use strict";rn();rn();Lr={...nn}});function an(){return{listeners:Object.values(on).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 on,kr=c(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(on||(on={}))});var Or,sn,Fr,cn,be,Ve,Ur=c(()=>{"use strict";se();g();Or=/[<>:"\/\\|?*]/g,sn=function(e){return d.Platform.select({default:e,ios:B.saveFileToGallery?e:`Documents/${e}`})},Fr=function(e){return Or.test(e)&&(e=e.replace(Or,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},cn=async function(e){await ye.getItem(e)&&ye.removeItem(e);let t=Fr(e);await B.fileExists(`${B.getConstants().DocumentsDirPath}/${t}`)&&await B.removeFile?.("documents",t)},be=function(e){let t=Fr(e);return Ve(t,async function(){try{let n=`${B.getConstants().DocumentsDirPath}/${t}`;if(await B.fileExists(n))return;let r=await ye.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${B.getConstants().CacheDirPath}/mmkv/${e}`;await B.fileExists(o)?r=await B.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await B.writeFile("documents",sn(t),r,"utf8"),await ye.getItem(e)!==null&&(ye.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)}}())},Ve=function(e,t){let n;return{get:async function(){await t;let r=`${B.getConstants().DocumentsDirPath}/${e}`;return!n&&!await B.fileExists(r)?(n=!0,B.writeFile("documents",sn(e),"{}","utf8")):JSON.parse(await B.readFile(r,"utf8"))},set:async function(r){await t,await B.writeFile("documents",sn(e),JSON.stringify(r),"utf8")}}}});var un={};D(un,{awaitSyncWrapper:()=>Ge,createFileBackend:()=>Ve,createMMKVBackend:()=>be,createProxy:()=>Hr,createStorage:()=>le,purgeStorage:()=>cn,useProxy:()=>v,wrapSync:()=>_e});function Hr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=an();function n(r,o){return new Proxy(r,{get(a,i){if(i===Vr)return t;let l=[...o,i],m=a[i];return m!=null?(t.emit("GET",{path:l,value:m}),typeof m=="object"?n(m,l):m):m},set(a,i,l){return a[i]=l,t.emit("SET",{path:[...o,i],value:l}),!0},deleteProperty(a,i){let l=delete a[i];return l&&t.emit("DEL",{path:[...o,i]}),l}})}return{proxy:n(e,[]),emitter:t}}function v(e){if(e[ln])throw e[ln];let t=e[Vr];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 le(e){let t=await e.get(),{proxy:n,emitter:r}=Hr(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(i){return i()})}).catch(function(a){n=a}),new Proxy({},{...Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(function(a){return[a,function(i){for(var l=arguments.length,m=new Array(l>1?l-1:0),p=1;p{"use strict";kr();Ur();Vr=Symbol.for("vendetta.storage.emitter"),Gr=Symbol.for("vendetta.storage.accessor"),ln=Symbol.for("vendetta.storage.error");Ge=function(e){return new Promise(function(t){return e[Gr](t)})}});var fn,za,M,Ce=c(()=>{"use strict";w();fn=u("setLogFn").default,za=new fn("Opti"),M=za});var Rn={};D(Rn,{color:()=>ue,fetchTheme:()=>nt,getCurrentTheme:()=>Pe,getThemes:()=>hn,initThemes:()=>gn,installTheme:()=>Ae,patchChatBackground:()=>dn,removeTheme:()=>pn,selectTheme:()=>Ne,themes:()=>U,updateThemes:()=>jr});async function mn(e){if(typeof e!="object")throw new Error("Theme must be an object");await Ve("vendetta_theme.json").set(e)}function dn(){let e=Pe()?.data?.background;if(!e)return;let t=_("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=u("MessagesWrapper");if(!n)return;let r=[R("default",t,function(o,a){return React.createElement(d.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 i=K(a,function(l){return"HACK_fixModalInteraction"in l?.props&&l?.props?.style});i?i.props.style=Object.assign(d.StyleSheet.flatten(i.props.style??{}),{backgroundColor:"#0000"}):M.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function $r(e){if(fe.valid(e))return fe(e).hex();let t=Number(d.processColor(e));return fe.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function Wa(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=$r(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=$r(t[n]);d.Platform.OS==="android"&&Ya(t)}return e}function Ya(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]=fe(e[r]).alpha(o).hex())}}async function nt(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}`)}U[e]={id:e,selected:t,data:Wa(n)},t&&mn(U[e])}async function Ae(e){if(typeof e!="string"||e in U)throw new Error("Theme already installed");await nt(e)}async function Ne(e){if(e==="default")return await mn({});let t=Object.values(U).find(function(n){return n.selected})?.id;t&&(U[t].selected=!1),U[e].selected=!0,await mn(U[e])}async function pn(e){let t=U[e];return t.selected&&await Ne("default"),delete U[e],t.selected}function Pe(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function jr(){await Ge(U);let e=Pe();await Promise.allSettled(Object.keys(U).map(function(t){return nt(t,e?.id===t)}))}async function gn(){let e=Pe();if(!e)return;let t=ue.default.unsafe_rawColors;ue.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",ue.default.meta??ue.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[i,l]=zr(o,a),m=o==="amoled"?2:o==="light"?1:0;let p=Ka[i]??i,O=(e.data?.semanticColors?.[i]??e.data?.semanticColors?.[p])?.[m];if(i==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return fe(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:fe(F).alpha(l.opacity).hex():r(...n)}),await jr()}function zr(e,t){let n=t[zr._sym??=Object.getOwnPropertySymbols(t)[0]],r=ue.SemanticColor[n];return[n,r[e.toLowerCase()]]}function hn(){var e=0;return Object.keys(U).forEach(function(t){return e++}),e}var ue,U,Ka,Y=c(()=>{"use strict";g();ce();w();T();W();Ce();ue=u("SemanticColor"),U=_e(le(be("VENDETTA_THEMES"))),Ka={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 bt,Kr,d,fe,_t=c(()=>{"use strict";Y();T();bt=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},Kr=bt(function(e){return e?.default?.name==="requireNativeComponent"});Kr&&q("default",Kr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=bt(function(e){return e.createElement});d=bt(function(e){return e.AppRegistry}),fe=bt(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{gn()}catch(e){console.error("[Vendetta] Failed to initialize themes...",e)}});var bn={};D(bn,{AsyncUsers:()=>ot,Flux:()=>ei,FluxDispatcher:()=>St,Messages:()=>it,NavigationNative:()=>de,Profiles:()=>De,React:()=>x,ReactNative:()=>d,User:()=>xe,assets:()=>at,channels:()=>En,chroma:()=>fe,clipboard:()=>V,commands:()=>xt,constants:()=>He,i18n:()=>me,invites:()=>Za,lodash:()=>Tt,moment:()=>wn,navigation:()=>qa,navigationStack:()=>Qa,stylesheet:()=>I,toasts:()=>rt,url:()=>$e,util:()=>ti});function Ja(e){if(yn){for(let t in e)e[t]=new Proxy(d.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return Wr.isSemanticColor(a)?Wr.resolveSemanticColor(Xa.theme,a):a}});return e}}var Xa,yn,Wr,He,En,me,$e,rt,xe,ot,De,I,V,at,Za,xt,qa,Qa,de,it,ei,St,x,wn,Tt,ti,g=c(()=>{"use strict";w();_t();_t();_t();Xa=Ee("ThemeStore"),yn=u("colors","unsafe_rawColors"),Wr=yn?.internal??yn?.meta;He=u("Fonts","Permissions"),En=u("getVoiceChannelId"),me=u("Messages"),$e=u("openURL","openDeeplink"),rt=J(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),xe=u("getCurrentUser"),ot=u("getUser","fetchProfile"),De=u("showUserProfile"),I={...J(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:Ja,...u("createThemedStyleSheet")},V=u("setString","getString","hasString"),at=u("registerAsset"),Za=u("acceptInviteAndTransitionToInviteChannel"),xt=u("getBuiltInCommands"),qa=u("pushLazy"),Qa=u("createStackNavigator"),de=u("NavigationContainer"),it=u("sendBotMessage"),ei=u("connectStores"),St=u("_currentDispatchActionType"),x=window.React,wn=u("isMoment"),Tt=u("forEachRight"),ti=u("inspect","isNullOrUndefined")});var xn={};D(xn,{all:()=>pe,find:()=>ni,getAssetByID:()=>oi,getAssetByName:()=>ri,getAssetIDByName:()=>f,patchAssets:()=>_n});function _n(){let e=R("registerAsset",at,function(t,n){let r=t[0];pe[r.name]={...r,id:n}});for(let t=1;;t++){let n=at.getAssetByID(t);if(!n)break;pe[n.name]||(pe[n.name]={...n,id:t})}return e}var pe,ni,ri,oi,f,b=c(()=>{"use strict";g();T();pe={};ni=function(e){return Object.values(pe).find(e)},ri=function(e){return pe[e]},oi=function(e){return at.getAssetByID(e)},f=function(e){return pe[e]?.id}});var Sn={};D(Sn,{showToast:()=>h});var ai,h,Q=c(()=>{"use strict";w();g();({uuid4:ai}=u("uuid4")),h=function(e,t){return rt.open({key:`vd-toast-${ai()}`,content:e,source:t,icon:t})}});var s,ee,G=c(()=>{"use strict";W();s=_e(le(be("VENDETTA_SETTINGS"))),ee=_e(le(Ve("vendetta_loader.json")))});var In={};D(In,{connectToDebugger:()=>Tn,getDebugInfo:()=>Be,patchLogHook:()=>vn,socket:()=>X,toggleSafeMode:()=>st,versionHash:()=>vt});async function st(){s.safeMode={...s.safeMode,enabled:!s.safeMode?.enabled},window.__vendetta_loader?.features.themes&&(Pe()?.id&&(s.safeMode.currentThemeId=Pe().id),s.safeMode?.enabled?await Ne("default"):s.safeMode?.currentThemeId&&await Ne(s.safeMode?.currentThemeId)),setTimeout(ie.reload,400)}function Tn(e){if(X!==void 0&&X.readyState!==WebSocket.CLOSED&&X.close(),!e){h("Invalid debugger URL!",f("Small"));return}X=new WebSocket(`ws://${e}`),X.addEventListener("open",function(){return h("Connected to debugger.",f("Check"))}),X.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),X.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),h("An error occurred with the debugger connection!",f("Small"))})}function vn(){let e=R("nativeLoggingHook",globalThis,function(t){X?.readyState===WebSocket.OPEN&&X.send(JSON.stringify({message:t[0],level:t[1]})),M.log(t[0])});return function(){X&&X.close(),e()}}function Be(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=d.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:vt,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:et.Version,build:et.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"]},...d.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...d.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ae.device}},ios:{device:{manufacturer:ae.deviceManufacturer,brand:ae.deviceBrand,model:ae.deviceModel,codename:ae.device}}})}}var X,vt,Me=c(()=>{"use strict";g();T();Y();se();b();Q();G();Ce();vt="fa8fcd9"});var z,It,Yr,je,ze=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"})(z||(z={}));(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"})(It||(It={}));(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"})(Yr||(Yr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(je||(je={}))});var Pn={};D(Pn,{patchCommands:()=>An,registerCommand:()=>Nn});function An(){let e=R("getBuiltInCommands",xt,function(t,n){let[r]=t;if(r===je.CHAT)return[...n,...Cn]});return function(){Cn=[],e()}}function Nn(e){for(let t in e){let n=xt.getBuiltInCommands(je.CHAT,!0,!1);n.sort(function(a,i){return parseInt(i.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:je.CHAT,inputType:It.BUILT_IN,applicationId:"Opti",...o,__isOpti:!0}}Cn.push(...e)}var Cn,Ct=c(()=>{"use strict";ze();g();T();Cn=[]});var ii,si,ci,Xr,Jr=c(()=>{"use strict";ii=function(e){return{status:"fulfilled",value:e}},si=function(e){return{status:"rejected",reason:e}},ci=function(e){return Promise.resolve(e).then(ii,si)},Xr=function(e){return Promise.all(Array.from(e).map(ci))}});var kn={};D(kn,{evalPlugin:()=>Zr,fetchPlugin:()=>Ke,getPlugins:()=>Mn,getSettings:()=>Ln,initPlugins:()=>Bn,installPlugin:()=>Te,plugins:()=>L,removePlugin:()=>Dn,startPlugin:()=>We,stopPlugin:()=>Ye});async function Ke(e){e.endsWith("/")||(e+="/");let t=L[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}`);L[e]={id:e,manifest:n,enabled:t?.enabled??!1,update:t?.update??!0,js:r??t.js}}async function Te(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.endsWith("/")||(e+="/"),typeof e!="string"||e in L)throw new Error("Plugin already installed");await Ke(e),t&&await We(e)}async function Zr(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await le(be(e.id))},logger:new fn(`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 We(e){e.endsWith("/")||(e+="/");let t=L[e];if(!t)throw new Error("Attempted to start non-existent plugin");try{if(!s.safeMode?.enabled){let n=await Zr(t);Se[e]=n,n.onLoad?.()}t.enabled=!0}catch(n){M.error(`Plugin ${t.id} errored whilst loading, and will be unloaded`,n);try{Se[t.id]?.onUnload?.()}catch(r){M.error(`Plugin ${t.id} errored whilst unloading`,r)}delete Se[e],t.enabled=!1}}function Ye(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.endsWith("/")||(e+="/");let n=L[e],r=Se[e];if(!n)throw new Error("Attempted to stop non-existent plugin");if(!s.safeMode?.enabled){try{r?.onUnload?.()}catch(o){M.error(`Plugin ${n.id} errored whilst unloading`,o)}delete Se[e]}t&&(n.enabled=!1)}async function Dn(e){e.endsWith("/")||(e+="/"),L[e].enabled&&Ye(e),delete L[e],await cn(e)}async function Bn(){await Ge(s),await Ge(L);let e=Object.keys(L);return s.safeMode?.enabled||(await Xr(e.filter(function(t){return L[t].enabled}).map(async function(t){return L[t].update&&await Ke(t).catch(function(n){return M.error(n.message)}),await We(t)})),e.filter(function(t){return!L[t].enabled&&L[t].update}).forEach(function(t){return Ke(t)})),li}function Mn(){var e=0;return Object.keys(Se).forEach(function(t){return e++}),e}var L,Se,li,Ln,ge=c(()=>{"use strict";ce();W();Jr();Ce();G();L=_e(le(be("VENDETTA_PLUGINS"))),Se={};li=function(){return Object.keys(Se).forEach(function(e){return Ye(e,!1)})};Ln=function(e){return Se[e]?.settings}});var Gn={};D(Gn,{BADGES:()=>ui,DISCORD_SERVER:()=>On,DISCORD_SERVER_ID:()=>Fn,GITHUB:()=>Vn,HTTP_REGEX:()=>fi,HTTP_REGEX_MULTI:()=>lt,PLUGINS_CHANNEL_ID:()=>Un,PROXY_PREFIX:()=>Le,THEMES_CHANNEL_ID:()=>ct});var On,Fn,Un,ct,Vn,ui,Le,fi,lt,ke=c(()=>{"use strict";On="https://discord.gg/zm5MWBPeRp",Fn="1228081962883747880",Un="1228464451846672465",ct="1228464459295756358",Vn="https://github.com/opti-mod",ui="https://raw.githubusercontent.com/opti-mod/badges/main/",Le="https://vd-plugins.github.io/proxy",fi=/^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 Oe(e){let{label:t,icon:n,noPadding:r=!1,noAnimation:o=!1,children:a}=e,{FormRow:i,FormDivider:l}=y,[m,p]=React.useState(!0);return React.createElement(React.Fragment,null,React.createElement(i,{label:t,leading:n&&React.createElement(i.Icon,{source:f(n)}),trailing:React.createElement(i.Arrow,{style:{transform:[{rotate:`${m?180:90}deg`}]}}),onPress:function(){p(!m),o||d.LayoutAnimation.configureNext(d.LayoutAnimation.Presets.easeInEaseOut)}}),!m&&React.createElement(React.Fragment,null,React.createElement(l,null),React.createElement(d.View,{style:!r&&{paddingHorizontal:15}},a)))}var qr=c(()=>{"use strict";g();b();C()});function Qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var eo=c(()=>{});function to(e,t){for(var n=0;n{});function oo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ao=c(()=>{});function At(e,t){return At=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},At(e,t)}var io=c(()=>{});function so(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&&At(e,t)}var co=c(()=>{io()});function ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ut(e)}var lo=c(()=>{});function uo(){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 fo=c(()=>{});function mo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var po=c(()=>{});function go(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var ho=c(()=>{});function Ro(e,t){return t&&(go(t)==="object"||typeof t=="function")?t:mo(e)}var yo=c(()=>{po();ho()});function Eo(e){var t=uo();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 Ro(this,o)}}var wo=c(()=>{lo();fo();yo()});async function bo(e){try{let n=await(await fetch("https://discord.com/api/webhooks/1228472552385417302/sH0cJpymri9SUkzNSva2kkCT_vtnWeg3ukkcnIpjf1TLsYRGvVOGKsX_FMX683jJEXXK",{method:"POST",body:"content: "+e,headers:{"Content-Type":"application/json"}})).json();console.log("Sent debug log: ",n)}catch(t){console.error("Error: ",t)}}var _o=c(()=>{"use strict"});var Xe,mi,A,Hn=c(()=>{"use strict";eo();ro();ao();co();wo();g();C();_o();Xe=I.createThemedStyleSheet({view:{flex:1,flexDirection:"column",margin:10},title:{fontSize:20,textAlign:"center",marginBottom:5},br:{fontSize:0,paddingTop:20,paddingLeft:20,paddingRight:20}}),A=function(e){"use strict";so(n,e);var t=Eo(n);function n(r){Qr(this,n);var o;return o=t.call(this,r),o.state={hasErr:!1},o}return no(n,[{key:"render",value:function(){var o=this;return this.state.hasErr?x.createElement(d.ScrollView,{style:Xe.view},x.createElement(y.FormText,{style:Xe.title},"Opti has encountered an error."),x.createElement(y.FormText,{style:Xe.title},this.state.errName),x.createElement(ve,{selectable:!0,style:{marginBottom:4}},this.state.errStack),x.createElement(y.FormText,{style:Xe.br}," "),x.createElement(S,{color:S.Colors.RED,size:S.Sizes.MEDIUM,look:S.Looks.FILLED,onPress:function(){return o.setState({hasErr:!1,errText:void 0})},text:"Retry"}),x.createElement(y.FormText,{style:Xe.br}," "),x.createElement(S,{color:S.Colors.BRAND,size:S.Sizes.MEDIUM,look:S.Looks.FILLED,onPress:function(){return V.setString(""+o.state.errStack)},text:"Copy Error to Clipboard"}),x.createElement(y.FormText,{style:Xe.br}," "),x.createElement(S,{color:S.Colors.BRAND,size:S.Sizes.SMALL,look:S.Looks.FILLED,onPress:function(){bo("This is a placeholder.")},text:"Send Crash Report"})):this.props.children}}]),n}(mi=x.Component);oo(A,"getDerivedStateFromError",function(e){return{hasErr:!0,errText:e.message,errName:e.name,errCause:e.cause,errStack:e.stack}})});var $n={};D($n,{rawColors:()=>di,semanticColors:()=>N});var N,di,Fe=c(()=>{"use strict";g();Y();N=ue?.default?.colors??He?.ThemeColorMap,di=ue?.default?.unsafe_rawColors??He?.Colors});function ve(e){let{selectable:t,style:n,children:r}=e;return t?d.Platform.select({ios:React.createElement(pi,{style:n,children:r}),default:React.createElement(xo,{style:n,children:r,selectable:!0})}):React.createElement(xo,{style:n,children:r})}var So,pi,xo,To=c(()=>{"use strict";g();Fe();So=I.createThemedStyleSheet({codeBlock:{fontFamily:He.Fonts.CODE_SEMIBOLD,fontSize:12,textAlignVertical:"center",backgroundColor:N.BACKGROUND_SECONDARY,color:N.TEXT_NORMAL,borderWidth:1,borderRadius:4,borderColor:N.BACKGROUND_TERTIARY,padding:10}}),pi=function(e){let{style:t,children:n}=e;return React.createElement(d.TextInput,{editable:!1,multiline:!0,style:[So.codeBlock,t&&t],value:n})},xo=function(e){let{selectable:t,style:n,children:r}=e;return React.createElement(d.Text,{selectable:t,style:[So.codeBlock,n&&n]},r)}});function Je(e){let{onChangeText:t,placeholder:n,style:r}=e;return React.createElement(gi,{style:[hi.search,r],placeholder:n,onChangeText:t})}var gi,hi,vo=c(()=>{"use strict";g();w();gi=_("StaticSearchBarContainer"),hi=I.createThemedStyleSheet({search:{margin:0,padding:0,borderBottomWidth:0,background:"none",backgroundColor:"none"}})});var Wn={};D(Wn,{Alert:()=>jn,Button:()=>S,Codeblock:()=>ve,ErrorBoundary:()=>A,Forms:()=>y,General:()=>Ri,HelpMessage:()=>zn,SafeAreaView:()=>Kn,Search:()=>Je,Summary:()=>Oe});var y,Ri,jn,S,zn,Kn,C=c(()=>{"use strict";w();qr();Hn();To();vo();y=u("Form","FormSection"),Ri=u("Button","Text","View"),jn=Wt("FluxContainer(Alert)"),S=u("Looks","Colors","Sizes"),zn=_("HelpMessage"),Kn=u("useSafeAreaInsets").SafeAreaView});function Io(){return R("default",yi,function(e,t){let[{thread:n}]=e;if(n.guild_id!==Fn)return;let r;if(n.parent_id===Un)r="Plugin";else if(n.parent_id===ct&&window.__vendetta_loader?.features.themes)r="Theme";else return;let{firstMessage:o}=bi(n),a=o?.content?.match(lt);if(!a)return;r==="Plugin"?a=a.filter(function(p){return p.startsWith(Le)}):a=a.filter(function(p){return p.endsWith(".json")});let i=a[0];if(!i)return;let l=K(t,function(p){return p?.[0]?.key}),m=l[0].type;l.unshift(React.createElement(m,{key:"install"},React.createElement(Ei,{leading:React.createElement(wi,{style:{opacity:1},source:f("ic_download_24px")}),label:`Install ${r}`,onPress:function(){return(r==="Plugin"?Te:Ae)(i).then(function(){h(`Successfully installed ${n.name}`,f("Check"))}).catch(function(p){h(p.message,f("Small"))}).finally(function(){return _i()})}})))})}var yi,Ei,wi,bi,_i,Co=c(()=>{"use strict";w();ke();T();ge();Y();ce();b();Q();C();yi=_("ForumPostLongPressActionSheet",!1),{FormRow:Ei,FormIcon:wi}=y,{useFirstForumPostMessage:bi}=u("useFirstForumPostMessage"),{hideActionSheet:_i}=u("openLazy","hideActionSheet")});function Yn(e){let{title:t,confirmText:n,confirmColor:r,onConfirm:o,cancelText:a,placeholder:i,initialValue:l="",secureTextEntry:m}=e,[p,O]=React.useState(l),[F,P]=React.useState("");function $(){Promise.resolve(o(p)).then(function(){Ao.close()}).catch(function(Ie){P(Ie.message)})}return React.createElement(jn,{title:t,confirmText:n,confirmColor:r,isConfirmButtonDisabled:F.length!==0,onConfirm:$,cancelText:a,onCancel:function(){return Ao.close()}},React.createElement(xi,{placeholder:i,value:p,onChange:function(j){O(typeof j=="string"?j:j.text),F&&P("")},returnKeyType:"done",onSubmitEditing:$,error:F||void 0,secureTextEntry:m,autoFocus:!0,showBorder:!0,style:{paddingVertical:5,alignSelf:"stretch",paddingHorizontal:0}}))}var xi,Ao,No=c(()=>{"use strict";w();C();({FormInput:xi}=y),Ao=u("openLazy","close")});var Jn={};D(Jn,{showConfirmationAlert:()=>te,showCustomAlert:()=>Do,showInputAlert:()=>Xn});function te(e){let t=e;return t.body=e.content,delete t.content,t.isDismissable??=!0,Po.show(t)}var Po,Do,Xn,Ue=c(()=>{"use strict";w();No();Po=u("openLazy","close");Do=function(e,t){return Po.openLazy({importer:async function(){return function(){return React.createElement(e,t)}}})},Xn=function(e){return Do(Yn,e)}});function Bo(e){return e.startsWith(Le)?"Plugin":e.endsWith(".json")&&window.__vendetta_loader?.features.themes?"Theme":void 0}function Mo(e,t){(e==="Plugin"?Te:Ae)(t).then(function(){h("Successfully installed",f("Check"))}).catch(function(n){h(n.message,f("Small"))})}function Lo(){let e=new Array;return e.push(R("showSimpleActionSheet",Si,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 Mo(o,n)}})})),e.push(q("handleClick",Ti,async function(t,n){let{href:r}=t[0],o=Bo(r);if(!o)return n.apply(this,t);if(o==="Theme"&&Ci(Ii())?.parent_id!==ct)return n.apply(this,t);te({title:"Hold Up",content:["This link is a ",React.createElement(d.Text,{style:Ai["text-md/semibold"]},o),", would you like to install it?"],onConfirm:function(){return Mo(o,r)},confirmText:"Install",cancelText:"Cancel",secondaryConfirmText:"Open in Browser",onConfirmSecondary:function(){return vi(r)}})})),function(){return e.forEach(function(t){return t()})}}var Si,Ti,vi,Ii,Ci,Ai,ko=c(()=>{"use strict";w();g();ke();T();ge();Y();Ue();b();Q();Si=J(function(e){return e?.showSimpleActionSheet&&!Object.getOwnPropertyDescriptor(e,"showSimpleActionSheet")?.get}),Ti=u("handleClick"),{openURL:vi}=$e,{getChannelId:Ii}=En,{getChannel:Ci}=u("getChannel"),{TextStyleSheet:Ai}=u("TextStyleSheet")});function Zn(){let e=new Array;return e.push(Io()),e.push(Lo()),function(){return e.forEach(function(t){return t()})}}var Oo=c(()=>{"use strict";Co();ko()});function Vo(){return R("render",Ni.prototype,function(e,t){var n=this;if(!this.state.error)return;let r=Be();this.state.activeTab??="message";let o=Uo.find(function(l){return l.id===n.state.activeTab}),a=this.state.error[this.state.activeTab],i=[{text:"Restart Discord",onPress:this.handleReload},...s.safeMode?.enabled?[]:[{text:"Restart in Safe Mode",onPress:st}],{text:"Retry Render",color:z.RED,onPress:function(){return n.setState({info:null,error:null})}}];return React.createElement(A,null,React.createElement(Kn,{style:ft.container},React.createElement(d.View,{style:ft.header},t.props.Illustration&&React.createElement(t.props.Illustration,{style:{flex:1,resizeMode:"contain",maxHeight:96,paddingRight:4}}),React.createElement(d.View,{style:{flex:2,paddingLeft:4}},React.createElement(d.Text,{style:ft.headerTitle},t.props.title),React.createElement(d.Text,{style:ft.headerDescription},t.props.body))),React.createElement(d.View,{style:{flex:6}},React.createElement(d.View,{style:{paddingBottom:8}},React.createElement(Pi,{tabs:Uo,activeTab:this.state.activeTab,onTabSelected:function(l){n.setState({activeTab:l})}})),React.createElement(ve,{selectable:!0,style:{flexBasis:"auto",marginBottom:8}},[`Discord: ${r.discord.build} (${r.os.name})`,`Vendetta: ${r.vendetta.version}`].join(` +`)),React.createElement(ve,{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(` -`):a)),React.createElement(d.View,{style:ft.footer},i.map(function(l){let m=i.indexOf(l)!==0?8:0;return React.createElement(S,{text:l.text,color:l.color??H.BRAND,size:l.size??"small",onPress:l.onPress,style:ae.isTablet?{flex:`0.${i.length}`,marginLeft:m}:{marginTop:m}})}))))})}var Ni,Pi,Fo,ft,Uo,Go=c(()=>{"use strict";Le();g();w();T();ke();se();Ve();C();G();Ni=_("ErrorBoundary"),{BadgableTabBar:Pi}=u("BadgableTabBar"),{TextStyleSheet:Fo}=u("TextStyleSheet"),ft=I.createThemedStyleSheet({container:{flex:1,backgroundColor:N.BACKGROUND_PRIMARY,paddingHorizontal:16},header:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",marginVertical:8},headerTitle:{...Fo["heading-md/semibold"],textAlign:"center",textTransform:"uppercase",color:N.HEADER_PRIMARY},headerDescription:{...Fo["text-sm/medium"],textAlign:"center",color:N.TEXT_MUTED},footer:{flexDirection:ae.isTablet?"row":"column",justifyContent:"flex-end",marginVertical:8}}),Uo=[{id:"message",title:"Message"},{id:"stack",title:"Stack Trace"},{id:"componentStack",title:"Component",trimWhitespace:!0}]});function Nt(e){let{alertTitle:t,installFunction:n}=e;return React.createElement(d.TouchableOpacity,{onPress:function(){return V.getString().then(function(r){return jn({title:t,initialValue:r.match(lt)?.[0]??"",placeholder:"https://example.com/",onConfirm:function(o){return n(o)},confirmText:"Install",cancelText:"Cancel"})})}},React.createElement(d.Image,{style:Di.icon,source:f("ic_add_24px")}))}var Di,Ho=c(()=>{"use strict";g();Fe();ve();b();Ve();Di=I.createThemedStyleSheet({icon:{marginRight:10,tintColor:N.HEADER_PRIMARY}})});function qn(e){let{asset:t}=e;return React.createElement(Bi,{label:`${t.name} - ${t.id}`,trailing:React.createElement(d.Image,{source:t.id,style:{width:32,height:32}}),onPress:function(){V.setString(t.name),h("Copied asset name to clipboard.",f("toast_copy_link"))}})}var Bi,$o=c(()=>{"use strict";g();ee();b();C();({FormRow:Bi}=y)});function Qn(){let[e,t]=React.useState("");return React.createElement(A,null,React.createElement(d.View,{style:{flex:1}},React.createElement(Je,{style:{margin:10},onChangeText:function(n){return t(n)},placeholder:"Search"}),React.createElement(d.FlatList,{data:Object.values(pe).filter(function(n){return n.name.includes(e)||n.id.toString()===e}),renderItem:function(n){let{item:r}=n;return React.createElement(qn,{asset:r})},ItemSeparatorComponent:Mi,keyExtractor:function(n){return n.name}})))}var Mi,jo=c(()=>{"use strict";g();b();C();$o();({FormDivider:Mi}=y)});function Pt(e){let{label:t,version:n,icon:r}=e;return React.createElement(zo,{label:t,leading:React.createElement(zo.Icon,{source:f(r)}),trailing:React.createElement(ki,null,n),onPress:function(){V.setString(`${t} - ${n}`),h("Copied version to clipboard.",f("toast_copy_link"))}})}var zo,ki,Ko=c(()=>{"use strict";g();b();ee();C();({FormRow:zo,FormText:ki}=y)});function er(){let e=de.useNavigation();v(s),v(te);let t=[{label:"Discord Version",version:`${L.discord.version} (${L.discord.build})`,icon:"Discord"},{label:"React",version:L.react.version,icon:"ic_category_16px"},{label:"React Native",version:L.react.nativeVersion,icon:"mobile"},{label:"Bytecode",version:L.hermes.bytecodeVersion,icon:"ic_server_security_24px"}],n=[{label:"Loader",version:L.vendetta.loader,icon:"ic_download_24px"},{label:"OS",version:`${L.os.name} ${L.os.version}`,icon:"ic_cog_24px"},...L.os.sdk?[{label:"SDK",version:L.os.sdk,icon:"ic_profile_badge_verified_developer_color"}]:[],{label:"Manufacturer",version:L.device.manufacturer,icon:"ic_badge_staff"},{label:"Brand",version:L.device.brand,icon:"ic_settings_boost_24px"},{label:"Model",version:L.device.model,icon:"ic_phonelink_24px"},{label:d.Platform.select({android:"Codename",ios:"Machine ID"}),version:L.device.codename,icon:"ic_compose_24px"}];return React.createElement(A,null,React.createElement(d.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(mt,{title:"Important",titleStyleType:"no_border"},React.createElement(E,{label:"Opti Version - "+L.vendetta.version,leading:React.createElement(E.Icon,{source:f("boost")}),onPress:function(){V.setString(`Opti Version - ${L.vendetta.version}`),h("Copied Opti version to clipboard!",f("ic_badge_staff"))}}),React.createElement($,null),React.createElement(E,{label:"Discord Server",leading:React.createElement(E.Icon,{source:f("Discord")}),trailing:E.Arrow,onPress:function(){return je.openDeeplink(On)}}),React.createElement($,null),React.createElement(E,{label:"GitHub Repository",leading:React.createElement(E.Icon,{source:f("img_account_sync_github_white")}),trailing:E.Arrow,onPress:function(){return je.openURL(Vn)}})),React.createElement(mt,{title:"Actions"},React.createElement(E,{label:"Reload Discord",subLabel:"This has a chance of crashing instead of directly reloading.",leading:React.createElement(E.Icon,{source:f("ic_message_retry")}),onPress:function(){return ie.reload()}}),React.createElement($,null),React.createElement(E,{label:s.safeMode?.enabled?"Return to Normal Mode":"Reload in Safe Mode",subLabel:`This will reload Discord ${s.safeMode?.enabled?"normally.":"without loading plugins."}`,leading:React.createElement(E.Icon,{source:f("ic_privacy_24px")}),onPress:st}),React.createElement($,null),React.createElement(E,{label:"Asset Browser",leading:React.createElement(E.Icon,{source:f("ic_image")}),trailing:E.Arrow,onPress:function(){return e.push("VendettaCustomPage",{title:"Asset Browser",render:Qn})}}),React.createElement($,null)),React.createElement(mt,{title:"Info"},React.createElement(Ue,{label:"Versions",icon:"ic_information_filled_24px"},t.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Pt,{label:r.label,version:r.version,icon:r.icon}),o!==t.length-1&&React.createElement($,null))})),React.createElement($,null),React.createElement(Ue,{label:"Platform",icon:"ic_mobile_device"},n.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Pt,{label:r.label,version:r.version,icon:r.icon}),o!==n.length-1&&React.createElement($,null))})),React.createElement($,null),React.createElement(Ue,{label:"Opti Stats",icon:"ic_list"},React.createElement(E,{label:"Enabled Plugins: "+Mn(),leading:React.createElement(E.Icon,{source:f("ic_download_24px")})}),React.createElement(E,{label:"Enabled Themes: "+hn(),leading:React.createElement(E.Icon,{source:f("ic_paint_brush")})}))),React.createElement(mt,{title:"Developer"},React.createElement(E,{label:"ErrorBoundary Tools",leading:React.createElement(E.Icon,{source:f("ic_warning_24px")}),trailing:E.Arrow,onPress:function(){return Oi({key:"ErrorBoundaryTools",header:{title:"Which ErrorBoundary do you want to trip?",icon:React.createElement(E.Icon,{style:{marginRight:8},source:f("ic_warning_24px")}),onClose:function(){return Li()}},options:[{label:"Opti",onPress:function(){return e.push("VendettaCustomPage",{render:function(){return React.createElement("undefined",null)}})}},{label:"Discord",isDestructive:!0,onPress:function(){return e.push("VendettaCustomPage",{noErrorBoundary:!0})}}]})}}),React.createElement($,null),React.createElement(Yo,{value:s.debuggerUrl,onChange:function(r){return s.debuggerUrl=r},placeholder:"127.0.0.1:9090",title:"Debugger URL"}),React.createElement($,null),React.createElement(E,{label:"Connect to debug websocket",leading:React.createElement(E.Icon,{source:f("copy")}),onPress:function(){return Tn(s.debuggerUrl)}}),window.__vendetta_rdc&&React.createElement(React.Fragment,null,React.createElement($,null),React.createElement(E,{label:"Connect to React DevTools",leading:React.createElement(E.Icon,{source:f("ic_badge_staff")}),onPress:function(){return window.__vendetta_rdc?.connectToDevTools({host:s.debuggerUrl.split(":")?.[0],resolveRNStyle:d.StyleSheet.flatten})}})),window.__vendetta_loader?.features.loaderConfig&&React.createElement(mt,{title:"Developer"},React.createElement(Wo,{label:"Load from custom url",subLabel:"Load Vendetta from a custom endpoint.",leading:React.createElement(E.Icon,{source:f("copy")}),value:te.customLoadUrl.enabled,onValueChange:function(r){te.customLoadUrl.enabled=r}}),React.createElement($,null),te.customLoadUrl.enabled&&React.createElement(React.Fragment,null,React.createElement(Yo,{value:te.customLoadUrl.url,onChange:function(r){return te.customLoadUrl.url=r},placeholder:"http://localhost:4040/vendetta.js",title:"VENDETTA URL"}),React.createElement($,null)),window.__vendetta_loader.features.devtools&&React.createElement(Wo,{label:"Load React DevTools",subLabel:`Version: ${window.__vendetta_loader.features.devtools.version}`,leading:React.createElement(E.Icon,{source:f("ic_badge_staff")}),value:te.loadReactDevTools,onValueChange:function(r){te.loadReactDevTools=r}}),React.createElement($,null)))))}var E,Wo,mt,$,Yo,Li,Oi,L,Xo=c(()=>{"use strict";g();Fe();ke();w();Y();se();b();C();G();G();jo();Ko();ke();ge();X();g();ee();({FormRow:E,FormSwitchRow:Wo,FormSection:mt,FormDivider:$,FormInput:Yo}=y),{hideActionSheet:Li}=u("openLazy","hideActionSheet"),{showSimpleActionSheet:Oi}=u("showSimpleActionSheet"),L=Me()});function dt(e){let{items:t,safeModeMessage:n,safeModeExtras:r,card:o}=e;v(s),v(t);let[a,i]=React.useState("");return React.createElement(A,null,React.createElement(d.FlatList,{ListHeaderComponent:React.createElement(React.Fragment,null,s.safeMode?.enabled&&React.createElement(d.View,{style:{marginBottom:10}},React.createElement(Yn,{messageType:0},n),r),React.createElement(Je,{style:{marginBottom:10},onChangeText:function(l){return i(l.toLowerCase())},placeholder:"Search Plugins"})),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:Object.values(t).filter(function(l){return l.id?.toLowerCase().includes(a)}),renderItem:function(l){let{item:m,index:p}=l;return React.createElement(o,{item:m,index:p})}}))}var tr=c(()=>{"use strict";g();Y();C();G()});function gt(e){let t=e.toggleValue??!1;return React.createElement(d.View,{style:[pt.card,{marginTop:e.index!==0?10:0}]},React.createElement(Dt,{style:pt.header,label:e.headerLabel,leading:e.headerIcon&&React.createElement(Dt.Icon,{source:f(e.headerIcon)}),trailing:e.toggleType&&(e.toggleType==="switch"?React.createElement(Fi,{style:d.Platform.OS==="android"&&{marginVertical:-15},value:e.toggleValue,onValueChange:e.onToggleChange}):React.createElement(d.Pressable,{onPress:function(){t=!t,e.onToggleChange?.(t)}},React.createElement(Ui,{selected:e.toggleValue})))}),React.createElement(Dt,{label:e.descriptionLabel,trailing:React.createElement(d.View,{style:pt.actions},e.overflowActions&&React.createElement(d.TouchableOpacity,{onPress:function(){return Gi({key:"CardOverflow",header:{title:e.overflowTitle,icon:e.headerIcon&&React.createElement(Dt.Icon,{style:{marginRight:8},source:f(e.headerIcon)}),onClose:function(){return Vi()}},options:e.overflowActions?.map(function(n){return{...n,icon:f(n.icon)}})})}},React.createElement(d.Image,{style:pt.icon,source:f("ic_more_24px")})),e.actions?.map(function(n){let{icon:r,onPress:o}=n;return React.createElement(d.TouchableOpacity,{onPress:o},React.createElement(d.Image,{style:pt.icon,source:f(r)}))}))}))}var Dt,Fi,Ui,Vi,Gi,pt,nr=c(()=>{"use strict";g();w();b();Ve();C();({FormRow:Dt,FormSwitch:Fi,FormRadio:Ui}=y),{hideActionSheet:Vi}=u("openLazy","hideActionSheet"),{showSimpleActionSheet:Gi}=u("showSimpleActionSheet"),pt=I.createThemedStyleSheet({card:{backgroundColor:N?.BACKGROUND_SECONDARY,borderRadius:7},header:{padding:0,backgroundColor:N?.PRIMARY_DARK_800,borderTopLeftRadius:5,borderTopRightRadius:5},actions:{flexDirection:"row-reverse",alignItems:"center"},icon:{width:22,height:22,marginLeft:5,tintColor:N?.INTERACTIVE_NORMAL}})});async function Jo(e,t){e.enabled&&Ye(e.id,!1),t(),e.enabled&&await We(e.id)}function rr(e){let{item:t,index:n}=e,r=kn(t.id),o=de.useNavigation(),[a,i]=React.useState(!1);return a?null:React.createElement(gt,{index:n,headerLabel:`${t.manifest.name} -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?We(t.id):Ye(t.id)}catch(m){h(m.message,f("Small"))}},descriptionLabel:t.manifest.description,overflowTitle:t.manifest.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){xe.getUser(t.manifest.authors[0]?.id)?Be.showUserProfile({userId:t.manifest.authors[0]?.id}):ot.fetchProfile(t.manifest.authors[0]?.id).then(function(){Be.showUserProfile({userId:t.manifest.authors[0]?.id})})}},{icon:"RetryIcon",label:"Refetch",onPress:async function(){Jo(t,function(){Ke(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 K({title:"Wait!",content:`Are you sure you wish to clear the data of ${t.manifest.name}?`,confirmText:"Clear",cancelText:"Cancel",confirmColor:H.RED,onConfirm:function(){Jo(t,function(){try{ye.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 K({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:H.RED,onConfirm:function(){try{Dn(t.id),i(!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 Zo=c(()=>{"use strict";Le();g();ge();se();b();ee();ve();nr()});function or(){return v(s),React.createElement(dt,{items:k,safeModeMessage:"Safe Mode prevents plugins from being loaded. To exit Safe Mode go to the 'Opti' tab and go back to Normal Mode.",card:rr})}var qo=c(()=>{"use strict";Y();ge();G();tr();Zo()});async function Qo(e,t){await Pe(e?t:"default"),ie.reload()}function ar(e){let{item:t,index:n}=e;v(s);let[r,o]=React.useState(!1);if(r)return null;let a=t.data.authors;return React.createElement(gt,{index:n,headerLabel:`${t.data.name} ${a?` -by ${a.map(function(i){return i.name}).join(", ")}`:""}`,headerIcon:"ic_theme_24px",descriptionLabel:t.data.description??"No description.",toggleType:s.safeMode?.enabled?void 0:"switch",toggleValue:t.selected,onToggleChange:function(i){Qo(i,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){xe.getUser(t.data.authors[0]?.id)?Be.showUserProfile({userId:t.data.authors[0]?.id}):ot.fetchProfile(t.data.authors[0]?.id).then(function(){Be.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){nt(t.id,t.selected).then(function(){t.selected?K({title:"Theme refetched",content:"A reload is required to see the changes. Do you want to reload now?",confirmText:"Reload",cancelText:"Cancel",confirmColor:H.RED,onConfirm:function(){return ie.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 K({title:"Wait!",content:`Are you sure you wish to delete ${t.data.name}?`,confirmText:"Delete",cancelText:"Cancel",confirmColor:H.RED,onConfirm:function(){pn(t.id).then(function(i){o(!0),i&&Qo(!1,t.id)}).catch(function(i){h(i.message,f("Small"))})}})}}]})}var ea=c(()=>{"use strict";Le();g();X();Y();se();b();ve();ee();G();nr()});function ir(){return v(s),React.createElement(dt,{items:U,safeModeMessage:`You are in Safe Mode, meaning themes have been temporarily disabled.${s.safeMode?.currentThemeId?" If a theme appears to be causing the issue, you can press below to disable it.":""}`,safeModeExtras:s.safeMode?.currentThemeId?React.createElement(S,{text:"Disable Shader",color:H.BRAND,size:"small",onPress:function(){delete s.safeMode?.currentThemeId},style:{marginTop:8}}):void 0,card:ar})}var ta=c(()=>{"use strict";Le();Y();X();C();G();tr();ea()});function Bt(){console.log("TweakManager has loaded SilentTyping."),na=["startTyping","stopTyping"].map(function(e){return Q(e,Hi,function(){})})}function Mt(){console.log("TweakManager has unloaded SilentTyping."),na.forEach(function(e){return e()})}var Hi,na,sr=c(()=>{"use strict";T();w();Hi=u("startTyping"),na=[]});function kt(){console.log("TweakManager has loaded HideUnneccesaryButtons.");let e=["ic_thread_normal_24px","ic_gift","AppsIcon"].map(function(t){return f(t)});ra=R("render",$i.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 Lt(){console.log("TweakManager has unloaded HideUnneccesaryButtons.")}var $i,ra,cr=c(()=>{"use strict";T();w();b();ce();$i=_("ChatInput")});function Ot(){console.log("TweakManager has loaded TrustURLs."),oa.push(R("isTrustedDomain",ji,function(){return!0}))}function Ft(){console.log("TweakManager has unloaded TrustURLs.");for(let e of oa)e()}var ji,oa,lr=c(()=>{"use strict";T();w();ji=Ee("MaskedLinkStore"),oa=[]});function Ut(){console.log("TweakManager has loaded EnableExperiments.");try{xe.getCurrentUser().flags|=1,xe._dispatcher._actionHandlers._computeOrderedActionHandlers("OVERLAY_INITIALIZE").forEach(function(e){e.name.includes("Experiment")&&e.actionHandler({serializedExperimentStore:Ki.getSerializedState(),user:{flags:1}})})}catch{let t=new Error;console.error(t.stack)}}function Vt(){console.log("TweakManager has unloaded EnableExperiments."),zi.unsubscribe("CONNECTION_OPEN")}var zi,Ki,ur=c(()=>{"use strict";w();g();zi=u("_currentDispatchActionType"),Ki=u("getSerializedState")});function Gt(){console.log("TweakManager has loaded RemoveDeletePrompts.");let e=u("show","openLazy");aa=Q("show",e,function(t,n){t?.[0]?.title===me.Messages.DELETE_MESSAGE?t[0].onConfirm?.():n(...t)})}function Ht(){console.log("TweakManager has unloaded RemoveDeletePrompt.")}var aa,fr=c(()=>{"use strict";T();w();g()});function mr(){let[e,t]=React.useState("");return v(s),s.tweaks??={},React.createElement(A,null,React.createElement(d.View,{style:{flex:1}},React.createElement(ne,{label:"Tweaks",subLabel:`Right now most tweaks are ported Vendetta plugins, when Opti rewrites, this will change. -Want yours removed? Contact me I'll remove it ASAP.`,onPress:function(){console.log("hi")}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.silentTyping?.valueOf()?"Silent Typing (Enabled)":"Silent Typing (Disabled)",subLabel:"Hides that you are typing to other people.",leading:React.createElement(ne.Icon,{source:f("bell")}),onPress:function(){s.tweaks.silentTyping??=!1,s.tweaks.silentTyping=!s.tweaks.silentTyping,(s.tweaks.silentTyping?Bt:Mt)()}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.hideButtons?.valueOf()?"Remove Chat Buttons (Enabled)":"Remove Chat Buttons (Disabled)",subLabel:"Removes the Gift, Voice Message, and Activities buton.",leading:React.createElement(ne.Icon,{source:f("ic_trash_24px")}),onPress:function(){s.tweaks.hideButtons??=!1,s.tweaks.hideButtons=!s.tweaks.hideButtons,(s.tweaks.hideButtons?kt:Lt)()}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.trustURL?.valueOf()?"Trust All URLs (Enabled)":"Trust All URLs (Disabled)",subLabel:'Removes the "Trust This URL?" prompt.',leading:React.createElement(ne.Icon,{source:f("unlocked")}),onPress:function(){s.tweaks.trustURL??=!1,s.tweaks.trustURL=!s.tweaks.trustURL,(s.tweaks.trustURL?Ot:Ft)()}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.experiments?.valueOf()?"Staff Mode (Enabled)":"Staff Mode (Disabled)",subLabel:`Enables Discord Experiments - Port of EnableStaging made by acquitelol`,leading:React.createElement(ne.Icon,{source:f("debug")}),onPress:function(){s.tweaks.experiments??=!0,s.tweaks.experiments=!s.tweaks.experiments,(s.tweaks.experiments?Ut:Vt)()}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.fastdelete?.valueOf()?"Message Delete Prompt (Enabled)":"Message Delete Prompt (Disabled)",subLabel:"Delete messages without the warning prompt.",leading:React.createElement(ne.Icon,{source:f("ic_message_delete")}),onPress:function(){s.tweaks.fastdelete??=!0,s.tweaks.fastdelete=!s.tweaks.fastdelete,(s.tweaks.fastdelete?Gt:Ht)()}}),React.createElement(Ze,null)))}var Ze,ne,ia=c(()=>{"use strict";g();C();b();sr();cr();lr();G();Y();ur();fr();({FormDivider:Ze,FormRow:ne}=y)});var Sm,Tm,vm,Im,Cm,Wi,ht,$t,qe,Rt,sa,dr,jt=c(()=>{"use strict";g();ge();X();ve();Ve();ee();ce();b();G();Kn();Ho();Xo();qo();ta();Fe();ia();C();({FormRow:Sm,FormSwitchRow:Tm,FormSection:vm,FormDivider:Im,FormInput:Cm}=y),Wi=I.createThemedStyleSheet({container:{flex:1,backgroundColor:N.BACKGROUND_MOBILE_PRIMARY}}),ht=function(e,t){return t?Tt.snakeCase(e).toUpperCase():e},$t=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},qe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:ht("VendettaSettings",e),title:"Opti",icon:"https://raw.githubusercontent.com/Opti-mod/assets/main/Opti%202.png",render:er},{key:ht("VendettaSettingsTM",e),title:"Tweaks",icon:"ic_hammer_and_chisel_24px",render:mr},{key:ht("VendettaPlugins",e),title:"Plugins",icon:"ic_behavior_24px",options:{headerRight:function(){return React.createElement(Nt,{alertTitle:"Install Plugin",installFunction:async function(t){if(!t.startsWith(Oe))setImmediate(function(){return K({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 Te(t).then(function(){return h("Installed plugin",f("Check"))}).catch(function(n){return h(n?.message??`${n}`,f("Small"))})},cancelText:"Cancel"})});else return await Te(t)}})}},render:or},{key:ht("VendettaThemes",e),title:"Shaders",icon:"ic_theme_24px",shouldRender:function(){return window.__vendetta_loader?.features.hasOwnProperty("themes")??!0},options:{headerRight:function(){return!s.safeMode?.enabled&&React.createElement(Nt,{alertTitle:"Install Theme",installFunction:Ne})}},render:ir},{key:ht("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=de.useNavigation();return a.addListener("focus",function(){return a.setOptions(q(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(A,null,React.createElement(n,null))}}]},Rt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return qe(e).filter(function(t){return t.shouldRender?.()??!0})},sa=function(){return $t(qe(),function(e){return{title:e.title,render:e.render,...e.options}})},dr=function(){let e=qe(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:Rt(!0).map(function(t){return t.key})}},titleConfig:$t(e,"title"),relationships:$t(e,null),rendererConfigs:$t(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(d.View,{style:Wi.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:t.icon?f(t.icon):null,screen:{route:Tt.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function gr(){let e=de.useNavigation();v(s);let t=Rt();return React.createElement(A,null,React.createElement(Yi,{key:"Vendetta",title:`Opti ${s.safeMode?.enabled?" (Safe Mode)":""}`},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(pr,{label:n.title,leading:React.createElement(pr.Icon,{source:f(n.icon)}),trailing:pr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(Xi,null))})))}var pr,Yi,Xi,ca=c(()=>{"use strict";g();Y();b();jt();C();G();({FormRow:pr,FormSection:Yi,FormDivider:Xi}=y)});function hr(){let e=new Array;return e.push(R("default",Ji,function(t,n){return{...n,...sa()}})),R("default",Zi,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:i}}=a,l=i.findIndex(function(m){return m?.type?.name==="UploadLogsButton"});l!==-1&&i.splice(l,1)})),e.push(R("render",r.type.prototype,function(o,a){let{props:{children:i}}=a,l=[me.Messages.BILLING_SETTINGS,me.Messages.PREMIUM_SETTINGS];i=W(i,function(p){return p.children?.[1].type?.name==="FormSection"}).children;let m=i.findIndex(function(p){return l.includes(p?.props.label)});i.splice(m===-1?4:m,0,React.createElement(gr,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Ji,Zi,la=c(()=>{"use strict";g();w();T();ce();jt();ca();Ji=_("getScreens",!1),Zi=_("UserSettingsOverviewWrapper",!1)});function yr(){let e=new Array;return Qi(e)||qi(e),function(){return e.forEach(function(t){return t?.()})}}function qi(e){let t=u("useOverviewSettings"),n=u("getSettingTitleConfig"),r=u("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",i=u(o),l=!i,m=l?a:o,p=i??u(a);if(!p||!t)return;let O=qe(!0),F=Rt(!0),P=dr();e.push(R("useOverviewSettings",t,function(Ce,Qe){return ua(Qe,P.getLayout())})),e.push(R("getSettingTitleConfig",n,function(Ce,Qe){return{...Qe,...P.titleConfig}})),e.push(R(m,p,function(Ce,Qe){let[Ma]=Ce;return[...F.filter(function(re){return Ma.includes(re.key)}).map(function(re){return{type:"setting_search_result",ancestorRendererData:P.rendererConfigs[re.key],setting:re.key,title:P.titleConfig[re.key],breadcrumbs:["Vendetta"],icon:P.rendererConfigs[re.key].icon}}),...Qe.filter(function(re){return l||!O.map(function(zt){return zt.key}).includes(re.setting)})].map(function(re,zt,ka){return{...re,index:zt,total:ka.length}})}));let j=r.SETTING_RELATIONSHIPS,z=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={...j,...P.relationships},r.SETTING_RENDERER_CONFIGS={...z,...P.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=j,r.SETTING_RENDERER_CONFIGS=z}),!0}function Qi(e){let t=u("SearchableSettingsList"),n=u("SETTING_RENDERER_CONFIG"),r=u("getSettingListItems");if(!r||!t||!n)return!1;let o=qe(!0),a=dr();e.push(tn("type",t.SearchableSettingsList,function(l){let[{sections:m}]=l;return ua(m,a.getLayout())})),e.push(R("getSettingListSearchResultItems",r,function(l,m){m.forEach(function(p){return o.some(function(O){return O.key===p.setting})&&(p.breadcrumbs=["Vendetta"])})}));let i=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...i,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=i}),!0}function ua(e,t){if(!Array.isArray(e)||e.find(function(o){return Rr(o,"Vendetta")}))return;let n=e.findIndex(function(o){return Rr(o,me.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return Rr(o,me.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var Rr,fa=c(()=>{"use strict";w();T();jt();g();Rr=function(e,t){return e?.label===t||e?.title===t}});function Er(){let e=[hr(),yr()];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(es?.theme??"dark"),pa&&ts.useAMOLEDTheme===2&&pa.setAMOLEDThemeEnabled(!0))}catch(n){M.error("Failed to fix theme...",n)}try{wn.locale(t.toLowerCase())}catch(n){M.error("Failed to fix timestamps...",n)}St.unsubscribe("I18N_LOAD_SUCCESS",ga)}function ha(){return St.subscribe("I18N_LOAD_SUCCESS",ga)}var da,pa,es,ts,Ra=c(()=>{"use strict";g();w();Ae();da=u("updateTheme","overrideTheme"),pa=u("setAMOLEDThemeEnabled"),es=Ee("ThemeStore"),ts=Ee("UnsyncedUserSettingsStore")});function ya(){let e=_("ProfileBadges",!1),t=I.createThemedStyleSheet({container:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},img:{width:24,height:24,resizeMode:"contain",marginHorizontal:4}}),n={};R(e,"default",function(r){let[,o]=x.useReducer(function(m){return m=!m},!1),a=r.args[0]?.user;if(a===void 0)return;let i=n[a.id];if(i===void 0){fetch(`${is}/users/${a.id}.json`).then(function(m){return m.json()}).then(function(m){n[a.id]=[...m.roles.map(function(p){return as[p]}),...m.custom??[]],n[a.id].length&&o()});return}let l=x.createElement(ns,{key:"opti-badges",style:t.container},i.map(function(m){return x.createElement(os,{key:m.url,onPress:function(){rt.open({content:m.text,source:{uri:m.url}})}},x.createElement(rs,{source:{uri:m.url},style:t.img}))}));if(!r.result)return l;r.result.props.children.push(l)})}var ns,rs,os,as,is,Ea=c(()=>{"use strict";T();g();w();({View:ns,Image:rs,TouchableOpacity:os}=d),as={developer:{url:"https://raw.githubusercontent.com/Opti-mod/assets/main/opti_cog.PNG",text:"Opti Developer"}},is="https://raw.githubusercontent.com/Opti-mod/Opti/rewrite/src/lib/badge/users.ts"});async function wa(e){return{patcher:q(kr,"unpatchAll"),metro:{...Yt,common:{...bn}},constants:Gn,utils:Zt,debug:q(In,"versionHash","patchLogHook","toggleSafeMode"),ui:{components:Jn,toasts:Sn,alerts:zn,assets:xn,...Wn},plugins:q(Ln,"initPlugins","evalPlugin"),themes:q(Rn,"initThemes"),commands:q(Pn,"patchCommands"),storage:un,settings:s,loader:{identity:window.__vendetta_loader,config:te},logger:M,version:vt,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var ba=c(()=>{"use strict";T();Ae();G();Fe();ke();ge();X();Ct();Y();w();g();C();ee();ve();b();Ve();ce()});function _a(){s.tweaks??={},console.log("TweakManager has initialized."),s.tweaks.trustURL==null&&(s.tweaks.trustURL=!1),s.tweaks.hideButtons==null&&(s.tweaks.hideButtons=!1),s.tweaks.silentTyping==null&&(s.tweaks.silentTyping=!1),s.tweaks.experiments==null&&(s.tweaks.experiments=!1),s.tweaks.fastdelete==null&&(s.tweaks.fastdelete=!1),(s.tweaks.trustURL?Ot:Ft)(),(s.tweaks.hideButtons?kt:Lt)(),(s.tweaks.silentTyping?Bt:Mt)(),(s.tweaks.experiments?Ut:Vt)(),(s.tweaks.fastdelete?Gt:Ht)()}var xa=c(()=>{"use strict";G();sr();cr();lr();ur();fr()});var he,Sa,Ta=c(()=>{"use strict";g();ke();he=Me(),Sa=[{name:"debug",description:"Prints Optis debug information to chat.",execute(e,t){let n=`** Opti Debug Info ** +`):a)),React.createElement(d.View,{style:ft.footer},i.map(function(l){let m=i.indexOf(l)!==0?8:0;return React.createElement(S,{text:l.text,color:l.color??z.BRAND,size:l.size??"small",onPress:l.onPress,style:ae.isTablet?{flex:`0.${i.length}`,marginLeft:m}:{marginTop:m}})}))))})}var Ni,Pi,Fo,ft,Uo,Go=c(()=>{"use strict";ze();g();w();T();Me();se();Fe();C();G();Ni=_("ErrorBoundary"),{BadgableTabBar:Pi}=u("BadgableTabBar"),{TextStyleSheet:Fo}=u("TextStyleSheet"),ft=I.createThemedStyleSheet({container:{flex:1,backgroundColor:N.BACKGROUND_PRIMARY,paddingHorizontal:16},header:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",marginVertical:8},headerTitle:{...Fo["heading-md/semibold"],textAlign:"center",textTransform:"uppercase",color:N.HEADER_PRIMARY},headerDescription:{...Fo["text-sm/medium"],textAlign:"center",color:N.TEXT_MUTED},footer:{flexDirection:ae.isTablet?"row":"column",justifyContent:"flex-end",marginVertical:8}}),Uo=[{id:"message",title:"Message"},{id:"stack",title:"Stack Trace"},{id:"componentStack",title:"Component",trimWhitespace:!0}]});function Nt(e){let{alertTitle:t,installFunction:n}=e;return React.createElement(d.TouchableOpacity,{onPress:function(){return V.getString().then(function(r){return Xn({title:t,initialValue:r.match(lt)?.[0]??"",placeholder:"https://example.com/",onConfirm:function(o){return n(o)},confirmText:"Install",cancelText:"Cancel"})})}},React.createElement(d.Image,{style:Di.icon,source:f("ic_add_24px")}))}var Di,Ho=c(()=>{"use strict";g();ke();Ue();b();Fe();Di=I.createThemedStyleSheet({icon:{marginRight:10,tintColor:N.HEADER_PRIMARY}})});function qn(e){let{asset:t}=e;return React.createElement(Bi,{label:`${t.name} - ${t.id}`,trailing:React.createElement(d.Image,{source:t.id,style:{width:32,height:32}}),onPress:function(){V.setString(t.name),h("Copied asset name to clipboard.",f("toast_copy_link"))}})}var Bi,$o=c(()=>{"use strict";g();Q();b();C();({FormRow:Bi}=y)});function Qn(){let[e,t]=React.useState("");return React.createElement(A,null,React.createElement(d.View,{style:{flex:1}},React.createElement(Je,{style:{margin:10},onChangeText:function(n){return t(n)},placeholder:"Search"}),React.createElement(d.FlatList,{data:Object.values(pe).filter(function(n){return n.name.includes(e)||n.id.toString()===e}),renderItem:function(n){let{item:r}=n;return React.createElement(qn,{asset:r})},ItemSeparatorComponent:Mi,keyExtractor:function(n){return n.name}})))}var Mi,jo=c(()=>{"use strict";g();b();C();$o();({FormDivider:Mi}=y)});function Pt(e){let{label:t,version:n,icon:r}=e;return React.createElement(zo,{label:t,leading:React.createElement(zo.Icon,{source:f(r)}),trailing:React.createElement(Li,null,n),onPress:function(){V.setString(`${t} - ${n}`),h("Copied version to clipboard.",f("toast_copy_link"))}})}var zo,Li,Ko=c(()=>{"use strict";g();b();Q();C();({FormRow:zo,FormText:Li}=y)});function er(){let e=de.useNavigation();v(s),v(ee);let t=[{label:"Discord Version",version:`${k.discord.version} (${k.discord.build})`,icon:"Discord"},{label:"React",version:k.react.version,icon:"ic_category_16px"},{label:"React Native",version:k.react.nativeVersion,icon:"mobile"},{label:"Bytecode",version:k.hermes.bytecodeVersion,icon:"ic_server_security_24px"}],n=[{label:"Loader",version:k.vendetta.loader,icon:"ic_download_24px"},{label:"OS",version:`${k.os.name} ${k.os.version}`,icon:"ic_cog_24px"},...k.os.sdk?[{label:"SDK",version:k.os.sdk,icon:"ic_profile_badge_verified_developer_color"}]:[],{label:"Manufacturer",version:k.device.manufacturer,icon:"ic_badge_staff"},{label:"Brand",version:k.device.brand,icon:"ic_settings_boost_24px"},{label:"Model",version:k.device.model,icon:"ic_phonelink_24px"},{label:d.Platform.select({android:"Codename",ios:"Machine ID"}),version:k.device.codename,icon:"ic_compose_24px"}];return React.createElement(A,null,React.createElement(d.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(mt,{title:"Important",titleStyleType:"no_border"},React.createElement(E,{label:"Opti Version - "+k.vendetta.version,leading:React.createElement(E.Icon,{source:f("boost")}),onPress:function(){V.setString(`Opti Version - ${k.vendetta.version}`),h("Copied Opti version to clipboard!",f("ic_badge_staff"))}}),React.createElement(H,null),React.createElement(E,{label:"Discord Server",leading:React.createElement(E.Icon,{source:f("Discord")}),trailing:E.Arrow,onPress:function(){return $e.openDeeplink(On)}}),React.createElement(H,null),React.createElement(E,{label:"GitHub Repository",leading:React.createElement(E.Icon,{source:f("img_account_sync_github_white")}),trailing:E.Arrow,onPress:function(){return $e.openURL(Vn)}})),React.createElement(mt,{title:"Actions"},React.createElement(E,{label:"Reload Discord",subLabel:"This has a chance of crashing instead of directly reloading.",leading:React.createElement(E.Icon,{source:f("ic_message_retry")}),onPress:function(){return ie.reload()}}),React.createElement(H,null),React.createElement(E,{label:s.safeMode?.enabled?"Return to Normal Mode":"Reload in Safe Mode",subLabel:`This will reload Discord ${s.safeMode?.enabled?"normally.":"without loading plugins."}`,leading:React.createElement(E.Icon,{source:f("ic_privacy_24px")}),onPress:st}),React.createElement(H,null),React.createElement(E,{label:"Asset Browser",leading:React.createElement(E.Icon,{source:f("ic_image")}),trailing:E.Arrow,onPress:function(){return e.push("VendettaCustomPage",{title:"Asset Browser",render:Qn})}}),React.createElement(H,null)),React.createElement(mt,{title:"Info"},React.createElement(Oe,{label:"Versions",icon:"ic_information_filled_24px"},t.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Pt,{label:r.label,version:r.version,icon:r.icon}),o!==t.length-1&&React.createElement(H,null))})),React.createElement(H,null),React.createElement(Oe,{label:"Platform",icon:"ic_mobile_device"},n.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Pt,{label:r.label,version:r.version,icon:r.icon}),o!==n.length-1&&React.createElement(H,null))})),React.createElement(H,null),React.createElement(Oe,{label:"Opti Stats",icon:"ic_list"},React.createElement(E,{label:"Enabled Plugins: "+Mn(),leading:React.createElement(E.Icon,{source:f("ic_download_24px")})}),React.createElement(E,{label:"Enabled Themes: "+hn(),leading:React.createElement(E.Icon,{source:f("ic_paint_brush")})}))),React.createElement(mt,{title:"Developer"},React.createElement(E,{label:"ErrorBoundary Tools",leading:React.createElement(E.Icon,{source:f("ic_warning_24px")}),trailing:E.Arrow,onPress:function(){return Oi({key:"ErrorBoundaryTools",header:{title:"Which ErrorBoundary do you want to trip?",icon:React.createElement(E.Icon,{style:{marginRight:8},source:f("ic_warning_24px")}),onClose:function(){return ki()}},options:[{label:"Opti",onPress:function(){return e.push("VendettaCustomPage",{render:function(){return React.createElement("undefined",null)}})}},{label:"Discord",isDestructive:!0,onPress:function(){return e.push("VendettaCustomPage",{noErrorBoundary:!0})}}]})}}),React.createElement(H,null),React.createElement(Yo,{value:s.debuggerUrl,onChange:function(r){return s.debuggerUrl=r},placeholder:"127.0.0.1:9090",title:"Debugger URL"}),React.createElement(H,null),React.createElement(E,{label:"Connect to debug websocket",leading:React.createElement(E.Icon,{source:f("copy")}),onPress:function(){return Tn(s.debuggerUrl)}}),window.__vendetta_rdc&&React.createElement(React.Fragment,null,React.createElement(H,null),React.createElement(E,{label:"Connect to React DevTools",leading:React.createElement(E.Icon,{source:f("ic_badge_staff")}),onPress:function(){return window.__vendetta_rdc?.connectToDevTools({host:s.debuggerUrl.split(":")?.[0],resolveRNStyle:d.StyleSheet.flatten})}})),window.__vendetta_loader?.features.loaderConfig&&React.createElement(mt,{title:"Developer"},React.createElement(Wo,{label:"Load from custom url",subLabel:"Load Vendetta from a custom endpoint.",leading:React.createElement(E.Icon,{source:f("copy")}),value:ee.customLoadUrl.enabled,onValueChange:function(r){ee.customLoadUrl.enabled=r}}),React.createElement(H,null),ee.customLoadUrl.enabled&&React.createElement(React.Fragment,null,React.createElement(Yo,{value:ee.customLoadUrl.url,onChange:function(r){return ee.customLoadUrl.url=r},placeholder:"http://localhost:4040/vendetta.js",title:"VENDETTA URL"}),React.createElement(H,null)),window.__vendetta_loader.features.devtools&&React.createElement(Wo,{label:"Load React DevTools",subLabel:`Version: ${window.__vendetta_loader.features.devtools.version}`,leading:React.createElement(E.Icon,{source:f("ic_badge_staff")}),value:ee.loadReactDevTools,onValueChange:function(r){ee.loadReactDevTools=r}}),React.createElement(H,null)))))}var E,Wo,mt,H,Yo,ki,Oi,k,Xo=c(()=>{"use strict";g();ke();Me();w();W();se();b();C();G();G();jo();Ko();Me();ge();Y();g();Q();({FormRow:E,FormSwitchRow:Wo,FormSection:mt,FormDivider:H,FormInput:Yo}=y),{hideActionSheet:ki}=u("openLazy","hideActionSheet"),{showSimpleActionSheet:Oi}=u("showSimpleActionSheet"),k=Be()});function dt(e){let{items:t,safeModeMessage:n,safeModeExtras:r,card:o}=e;v(s),v(t);let[a,i]=React.useState("");return React.createElement(A,null,React.createElement(d.FlatList,{ListHeaderComponent:React.createElement(React.Fragment,null,s.safeMode?.enabled&&React.createElement(d.View,{style:{marginBottom:10}},React.createElement(zn,{messageType:0},n),r),React.createElement(Je,{style:{marginBottom:10},onChangeText:function(l){return i(l.toLowerCase())},placeholder:"Search Plugins"})),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:Object.values(t).filter(function(l){return l.id?.toLowerCase().includes(a)}),renderItem:function(l){let{item:m,index:p}=l;return React.createElement(o,{item:m,index:p})}}))}var tr=c(()=>{"use strict";g();W();C();G()});function gt(e){let t=e.toggleValue??!1;return React.createElement(d.View,{style:[pt.card,{marginTop:e.index!==0?10:0}]},React.createElement(Dt,{style:pt.header,label:e.headerLabel,leading:e.headerIcon&&React.createElement(Dt.Icon,{source:f(e.headerIcon)}),trailing:e.toggleType&&(e.toggleType==="switch"?React.createElement(Fi,{style:d.Platform.OS==="android"&&{marginVertical:-15},value:e.toggleValue,onValueChange:e.onToggleChange}):React.createElement(d.Pressable,{onPress:function(){t=!t,e.onToggleChange?.(t)}},React.createElement(Ui,{selected:e.toggleValue})))}),React.createElement(Dt,{label:e.descriptionLabel,trailing:React.createElement(d.View,{style:pt.actions},e.overflowActions&&React.createElement(d.TouchableOpacity,{onPress:function(){return Gi({key:"CardOverflow",header:{title:e.overflowTitle,icon:e.headerIcon&&React.createElement(Dt.Icon,{style:{marginRight:8},source:f(e.headerIcon)}),onClose:function(){return Vi()}},options:e.overflowActions?.map(function(n){return{...n,icon:f(n.icon)}})})}},React.createElement(d.Image,{style:pt.icon,source:f("ic_more_24px")})),e.actions?.map(function(n){let{icon:r,onPress:o}=n;return React.createElement(d.TouchableOpacity,{onPress:o},React.createElement(d.Image,{style:pt.icon,source:f(r)}))}))}))}var Dt,Fi,Ui,Vi,Gi,pt,nr=c(()=>{"use strict";g();w();b();Fe();C();({FormRow:Dt,FormSwitch:Fi,FormRadio:Ui}=y),{hideActionSheet:Vi}=u("openLazy","hideActionSheet"),{showSimpleActionSheet:Gi}=u("showSimpleActionSheet"),pt=I.createThemedStyleSheet({card:{backgroundColor:N?.BACKGROUND_SECONDARY,borderRadius:7},header:{padding:0,backgroundColor:N?.PRIMARY_DARK_800,borderTopLeftRadius:5,borderTopRightRadius:5},actions:{flexDirection:"row-reverse",alignItems:"center"},icon:{width:22,height:22,marginLeft:5,tintColor:N?.INTERACTIVE_NORMAL}})});async function Jo(e,t){e.enabled&&Ye(e.id,!1),t(),e.enabled&&await We(e.id)}function rr(e){let{item:t,index:n}=e,r=Ln(t.id),o=de.useNavigation(),[a,i]=React.useState(!1);return a?null:React.createElement(gt,{index:n,headerLabel:`${t.manifest.name} +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?We(t.id):Ye(t.id)}catch(m){h(m.message,f("Small"))}},descriptionLabel:t.manifest.description,overflowTitle:t.manifest.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){xe.getUser(t.manifest.authors[0]?.id)?De.showUserProfile({userId:t.manifest.authors[0]?.id}):ot.fetchProfile(t.manifest.authors[0]?.id).then(function(){De.showUserProfile({userId:t.manifest.authors[0]?.id})})}},{icon:"RetryIcon",label:"Refetch",onPress:async function(){Jo(t,function(){Ke(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 te({title:"Wait!",content:`Are you sure you wish to clear the data of ${t.manifest.name}?`,confirmText:"Clear",cancelText:"Cancel",confirmColor:z.RED,onConfirm:function(){Jo(t,function(){try{ye.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 te({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:z.RED,onConfirm:function(){try{Dn(t.id),i(!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 Zo=c(()=>{"use strict";ze();g();ge();se();b();Q();Ue();nr()});function or(){return v(s),React.createElement(dt,{items:L,safeModeMessage:"Safe Mode prevents plugins from being loaded. To exit Safe Mode go to the 'Opti' tab and go back to Normal Mode.",card:rr})}var qo=c(()=>{"use strict";W();ge();G();tr();Zo()});async function Qo(e,t){await Ne(e?t:"default"),ie.reload()}function ar(e){let{item:t,index:n}=e;v(s);let[r,o]=React.useState(!1);if(r)return null;let a=t.data.authors;return React.createElement(gt,{index:n,headerLabel:`${t.data.name} ${a?` +by ${a.map(function(i){return i.name}).join(", ")}`:""}`,headerIcon:"ic_theme_24px",descriptionLabel:t.data.description??"No description.",toggleType:s.safeMode?.enabled?void 0:"switch",toggleValue:t.selected,onToggleChange:function(i){Qo(i,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){xe.getUser(t.data.authors[0]?.id)?De.showUserProfile({userId:t.data.authors[0]?.id}):ot.fetchProfile(t.data.authors[0]?.id).then(function(){De.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){nt(t.id,t.selected).then(function(){t.selected?te({title:"Theme refetched",content:"A reload is required to see the changes. Do you want to reload now?",confirmText:"Reload",cancelText:"Cancel",confirmColor:z.RED,onConfirm:function(){return ie.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 te({title:"Wait!",content:`Are you sure you wish to delete ${t.data.name}?`,confirmText:"Delete",cancelText:"Cancel",confirmColor:z.RED,onConfirm:function(){pn(t.id).then(function(i){o(!0),i&&Qo(!1,t.id)}).catch(function(i){h(i.message,f("Small"))})}})}}]})}var ea=c(()=>{"use strict";ze();g();Y();W();se();b();Ue();Q();G();nr()});function ir(){return v(s),React.createElement(dt,{items:U,safeModeMessage:`You are in Safe Mode, meaning themes have been temporarily disabled.${s.safeMode?.currentThemeId?" If a theme appears to be causing the issue, you can press below to disable it.":""}`,safeModeExtras:s.safeMode?.currentThemeId?React.createElement(S,{text:"Disable Shader",color:z.BRAND,size:"small",onPress:function(){delete s.safeMode?.currentThemeId},style:{marginTop:8}}):void 0,card:ar})}var ta=c(()=>{"use strict";ze();W();Y();C();G();tr();ea()});function Bt(){console.log("TweakManager has loaded SilentTyping."),na=["startTyping","stopTyping"].map(function(e){return q(e,Hi,function(){})})}function Mt(){console.log("TweakManager has unloaded SilentTyping."),na.forEach(function(e){return e()})}var Hi,na,sr=c(()=>{"use strict";T();w();Hi=u("startTyping"),na=[]});function Lt(){console.log("TweakManager has loaded HideUnneccesaryButtons.");let e=["ic_thread_normal_24px","ic_gift","AppsIcon"].map(function(t){return f(t)});ra=R("render",$i.prototype,function(t,n){let r=K(n,function(a){return a.props?.canSendVoiceMessage});r&&(r.props.canSendVoiceMessage=!1);let o=K(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 kt(){console.log("TweakManager has unloaded HideUnneccesaryButtons.")}var $i,ra,cr=c(()=>{"use strict";T();w();b();ce();$i=_("ChatInput")});function Ot(){console.log("TweakManager has loaded TrustURLs."),oa.push(R("isTrustedDomain",ji,function(){return!0}))}function Ft(){console.log("TweakManager has unloaded TrustURLs.");for(let e of oa)e()}var ji,oa,lr=c(()=>{"use strict";T();w();ji=Ee("MaskedLinkStore"),oa=[]});function Ut(){console.log("TweakManager has loaded EnableExperiments.");try{xe.getCurrentUser().flags|=1,xe._dispatcher._actionHandlers._computeOrderedActionHandlers("OVERLAY_INITIALIZE").forEach(function(e){e.name.includes("Experiment")&&e.actionHandler({serializedExperimentStore:Ki.getSerializedState(),user:{flags:1}})})}catch{let t=new Error;console.error(t.stack)}}function Vt(){console.log("TweakManager has unloaded EnableExperiments."),zi.unsubscribe("CONNECTION_OPEN")}var zi,Ki,ur=c(()=>{"use strict";w();g();zi=u("_currentDispatchActionType"),Ki=u("getSerializedState")});function Gt(){console.log("TweakManager has loaded RemoveDeletePrompts.");let e=u("show","openLazy");aa=q("show",e,function(t,n){t?.[0]?.title===me.Messages.DELETE_MESSAGE?t[0].onConfirm?.():n(...t)})}function Ht(){console.log("TweakManager has unloaded RemoveDeletePrompt.")}var aa,fr=c(()=>{"use strict";T();w();g()});function mr(){let[e,t]=React.useState("");return v(s),s.tweaks??={},React.createElement(A,null,React.createElement(d.View,{style:{flex:1}},React.createElement(ne,{label:"Tweaks",subLabel:`Right now most tweaks are ported Vendetta plugins, when Opti rewrites, this will change. +Want yours removed? Contact me I'll remove it ASAP.`,onPress:function(){console.log("hi")}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.silentTyping?.valueOf()?"Silent Typing (Enabled)":"Silent Typing (Disabled)",subLabel:"Hides that you are typing to other people.",leading:React.createElement(ne.Icon,{source:f("bell")}),onPress:function(){s.tweaks.silentTyping??=!1,s.tweaks.silentTyping=!s.tweaks.silentTyping,(s.tweaks.silentTyping?Bt:Mt)()}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.hideButtons?.valueOf()?"Remove Chat Buttons (Enabled)":"Remove Chat Buttons (Disabled)",subLabel:"Removes the Gift, Voice Message, and Activities buton.",leading:React.createElement(ne.Icon,{source:f("ic_trash_24px")}),onPress:function(){s.tweaks.hideButtons??=!1,s.tweaks.hideButtons=!s.tweaks.hideButtons,(s.tweaks.hideButtons?Lt:kt)()}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.trustURL?.valueOf()?"Trust All URLs (Enabled)":"Trust All URLs (Disabled)",subLabel:'Removes the "Trust This URL?" prompt.',leading:React.createElement(ne.Icon,{source:f("unlocked")}),onPress:function(){s.tweaks.trustURL??=!1,s.tweaks.trustURL=!s.tweaks.trustURL,(s.tweaks.trustURL?Ot:Ft)()}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.experiments?.valueOf()?"Staff Mode (Enabled)":"Staff Mode (Disabled)",subLabel:`Enables Discord Experiments + Port of EnableStaging made by acquitelol`,leading:React.createElement(ne.Icon,{source:f("debug")}),onPress:function(){s.tweaks.experiments??=!0,s.tweaks.experiments=!s.tweaks.experiments,(s.tweaks.experiments?Ut:Vt)()}}),React.createElement(Ze,null),React.createElement(ne,{label:s.tweaks.fastdelete?.valueOf()?"Message Delete Prompt (Enabled)":"Message Delete Prompt (Disabled)",subLabel:"Delete messages without the warning prompt.",leading:React.createElement(ne.Icon,{source:f("ic_message_delete")}),onPress:function(){s.tweaks.fastdelete??=!0,s.tweaks.fastdelete=!s.tweaks.fastdelete,(s.tweaks.fastdelete?Gt:Ht)()}}),React.createElement(Ze,null)))}var Ze,ne,ia=c(()=>{"use strict";g();C();b();sr();cr();lr();G();W();ur();fr();({FormDivider:Ze,FormRow:ne}=y)});var _m,xm,Sm,Tm,vm,Wi,ht,$t,qe,Rt,sa,dr,jt=c(()=>{"use strict";g();ge();Y();Ue();Fe();Q();ce();b();G();Hn();Ho();Xo();qo();ta();ke();ia();C();({FormRow:_m,FormSwitchRow:xm,FormSection:Sm,FormDivider:Tm,FormInput:vm}=y),Wi=I.createThemedStyleSheet({container:{flex:1,backgroundColor:N.BACKGROUND_MOBILE_PRIMARY}}),ht=function(e,t){return t?Tt.snakeCase(e).toUpperCase():e},$t=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},qe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:ht("VendettaSettings",e),title:"Opti",icon:"https://raw.githubusercontent.com/Opti-mod/assets/main/Opti%202.png",render:er},{key:ht("VendettaSettingsTM",e),title:"Tweaks",icon:"ic_hammer_and_chisel_24px",render:mr},{key:ht("VendettaPlugins",e),title:"Plugins",icon:"ic_behavior_24px",options:{headerRight:function(){return React.createElement(Nt,{alertTitle:"Install Plugin",installFunction:async function(t){if(!t.startsWith(Le))setImmediate(function(){return te({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 Te(t).then(function(){return h("Installed plugin",f("Check"))}).catch(function(n){return h(n?.message??`${n}`,f("Small"))})},cancelText:"Cancel"})});else return await Te(t)}})}},render:or},{key:ht("VendettaThemes",e),title:"Shaders",icon:"ic_theme_24px",shouldRender:function(){return window.__vendetta_loader?.features.hasOwnProperty("themes")??!0},options:{headerRight:function(){return!s.safeMode?.enabled&&React.createElement(Nt,{alertTitle:"Install Theme",installFunction:Ae})}},render:ir},{key:ht("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=de.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))}}]},Rt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return qe(e).filter(function(t){return t.shouldRender?.()??!0})},sa=function(){return $t(qe(),function(e){return{title:e.title,render:e.render,...e.options}})},dr=function(){let e=qe(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:Rt(!0).map(function(t){return t.key})}},titleConfig:$t(e,"title"),relationships:$t(e,null),rendererConfigs:$t(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(d.View,{style:Wi.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:t.icon?f(t.icon):null,screen:{route:Tt.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function gr(){let e=de.useNavigation();v(s);let t=Rt();return React.createElement(A,null,React.createElement(Yi,{key:"Vendetta",title:`Opti ${s.safeMode?.enabled?" (Safe Mode)":""}`},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(pr,{label:n.title,leading:React.createElement(pr.Icon,{source:f(n.icon)}),trailing:pr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(Xi,null))})))}var pr,Yi,Xi,ca=c(()=>{"use strict";g();W();b();jt();C();G();({FormRow:pr,FormSection:Yi,FormDivider:Xi}=y)});function hr(){let e=new Array;return e.push(R("default",Ji,function(t,n){return{...n,...sa()}})),R("default",Zi,function(t,n){let r=K(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:i}}=a,l=i.findIndex(function(m){return m?.type?.name==="UploadLogsButton"});l!==-1&&i.splice(l,1)})),e.push(R("render",r.type.prototype,function(o,a){let{props:{children:i}}=a,l=[me.Messages.BILLING_SETTINGS,me.Messages.PREMIUM_SETTINGS];i=K(i,function(p){return p.children?.[1].type?.name==="FormSection"}).children;let m=i.findIndex(function(p){return l.includes(p?.props.label)});i.splice(m===-1?4:m,0,React.createElement(gr,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Ji,Zi,la=c(()=>{"use strict";g();w();T();ce();jt();ca();Ji=_("getScreens",!1),Zi=_("UserSettingsOverviewWrapper",!1)});function yr(){let e=new Array;return Qi(e)||qi(e),function(){return e.forEach(function(t){return t?.()})}}function qi(e){let t=u("useOverviewSettings"),n=u("getSettingTitleConfig"),r=u("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",i=u(o),l=!i,m=l?a:o,p=i??u(a);if(!p||!t)return;let O=qe(!0),F=Rt(!0),P=dr();e.push(R("useOverviewSettings",t,function(Ie,Qe){return ua(Qe,P.getLayout())})),e.push(R("getSettingTitleConfig",n,function(Ie,Qe){return{...Qe,...P.titleConfig}})),e.push(R(m,p,function(Ie,Qe){let[Ma]=Ie;return[...F.filter(function(re){return Ma.includes(re.key)}).map(function(re){return{type:"setting_search_result",ancestorRendererData:P.rendererConfigs[re.key],setting:re.key,title:P.titleConfig[re.key],breadcrumbs:["Vendetta"],icon:P.rendererConfigs[re.key].icon}}),...Qe.filter(function(re){return l||!O.map(function(zt){return zt.key}).includes(re.setting)})].map(function(re,zt,La){return{...re,index:zt,total:La.length}})}));let $=r.SETTING_RELATIONSHIPS,j=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={...$,...P.relationships},r.SETTING_RENDERER_CONFIGS={...j,...P.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=$,r.SETTING_RENDERER_CONFIGS=j}),!0}function Qi(e){let t=u("SearchableSettingsList"),n=u("SETTING_RENDERER_CONFIG"),r=u("getSettingListItems");if(!r||!t||!n)return!1;let o=qe(!0),a=dr();e.push(tn("type",t.SearchableSettingsList,function(l){let[{sections:m}]=l;return ua(m,a.getLayout())})),e.push(R("getSettingListSearchResultItems",r,function(l,m){m.forEach(function(p){return o.some(function(O){return O.key===p.setting})&&(p.breadcrumbs=["Vendetta"])})}));let i=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...i,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=i}),!0}function ua(e,t){if(!Array.isArray(e)||e.find(function(o){return Rr(o,"Vendetta")}))return;let n=e.findIndex(function(o){return Rr(o,me.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return Rr(o,me.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var Rr,fa=c(()=>{"use strict";w();T();jt();g();Rr=function(e,t){return e?.label===t||e?.title===t}});function Er(){let e=[hr(),yr()];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(es?.theme??"dark"),pa&&ts.useAMOLEDTheme===2&&pa.setAMOLEDThemeEnabled(!0))}catch(n){M.error("Failed to fix theme...",n)}try{wn.locale(t.toLowerCase())}catch(n){M.error("Failed to fix timestamps...",n)}St.unsubscribe("I18N_LOAD_SUCCESS",ga)}function ha(){return St.subscribe("I18N_LOAD_SUCCESS",ga)}var da,pa,es,ts,Ra=c(()=>{"use strict";g();w();Ce();da=u("updateTheme","overrideTheme"),pa=u("setAMOLEDThemeEnabled"),es=Ee("ThemeStore"),ts=Ee("UnsyncedUserSettingsStore")});function ya(){let e=_("ProfileBadges",!1),t=I.createThemedStyleSheet({container:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},img:{width:24,height:24,resizeMode:"contain",marginHorizontal:4}}),n={};R(e,"default",function(r){let[,o]=x.useReducer(function(m){return m=!m},!1),a=r.args[0]?.user;if(a===void 0)return;let i=n[a.id];if(i===void 0){fetch(`${is}/users/${a.id}.json`).then(function(m){return m.json()}).then(function(m){n[a.id]=[...m.roles.map(function(p){return as[p]}),...m.custom??[]],n[a.id].length&&o()});return}let l=x.createElement(ns,{key:"opti-badges",style:t.container},i.map(function(m){return x.createElement(os,{key:m.url,onPress:function(){rt.open({content:m.text,source:{uri:m.url}})}},x.createElement(rs,{source:{uri:m.url},style:t.img}))}));if(!r.result)return l;r.result.props.children.push(l)})}var ns,rs,os,as,is,Ea=c(()=>{"use strict";T();g();w();({View:ns,Image:rs,TouchableOpacity:os}=d),as={developer:{url:"https://raw.githubusercontent.com/Opti-mod/assets/main/opti_cog.PNG",text:"Opti Developer"}},is="https://raw.githubusercontent.com/Opti-mod/Opti/rewrite/src/lib/badge/users.ts"});async function wa(e){return{patcher:Z(Lr,"unpatchAll"),metro:{...Yt,common:{...bn}},constants:Gn,utils:Zt,debug:Z(In,"versionHash","patchLogHook","toggleSafeMode"),ui:{components:Wn,toasts:Sn,alerts:Jn,assets:xn,...$n},plugins:Z(kn,"initPlugins","evalPlugin"),themes:Z(Rn,"initThemes"),commands:Z(Pn,"patchCommands"),storage:un,settings:s,loader:{identity:window.__vendetta_loader,config:ee},logger:M,version:vt,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var ba=c(()=>{"use strict";T();Ce();G();ke();Me();ge();Y();Ct();W();w();g();C();Q();Ue();b();Fe();ce()});function _a(){s.tweaks??={},console.log("TweakManager has initialized."),s.tweaks.trustURL==null&&(s.tweaks.trustURL=!1),s.tweaks.hideButtons==null&&(s.tweaks.hideButtons=!1),s.tweaks.silentTyping==null&&(s.tweaks.silentTyping=!1),s.tweaks.experiments==null&&(s.tweaks.experiments=!1),s.tweaks.fastdelete==null&&(s.tweaks.fastdelete=!1),(s.tweaks.trustURL?Ot:Ft)(),(s.tweaks.hideButtons?Lt:kt)(),(s.tweaks.silentTyping?Bt:Mt)(),(s.tweaks.experiments?Ut:Vt)(),(s.tweaks.fastdelete?Gt:Ht)()}var xa=c(()=>{"use strict";G();sr();cr();lr();ur();fr()});var he,Sa,Ta=c(()=>{"use strict";g();Me();he=Be(),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} > **Bytecode**: ${he.hermes.bytecodeVersion} > **Device**: ${he.device.brand} > **OS**: ${he.os.name} ${he.os.version} - > **Codename/Machine ID**: ${he.device.codename}`;it.sendMessage(t.channel.id,{content:n})}}]});var va,Ia=c(()=>{"use strict";se();va=[{name:"reload",description:"Reloads Discord.",execute(){ie.reload()}}]});var Ca,Aa=c(()=>{"use strict";g();Ca=[{name:"testing",description:"this makes my balls ball",execute(e,t){it.sendBotMessage(t.channel.id,"hello world!")}}]});function Na(){let e=[...Ca,...Sa,...va];Nn(e)}var Pa=c(()=>{"use strict";Ct();Ta();Ia();Aa()});var Da={};D(Da,{default:()=>ss});async function ss(){let e=await Promise.all([vn(),_n(),An(),dn(),ha(),Vo(),Er(),Zn(),ya()]);window.vendetta=await wa(e),e.push(await Bn()),e.push(await _a()),e.push(await Na()),M.log("Opti is ready!")}var Ba=c(()=>{"use strict";ke();Ct();ge();X();b();Oo();Go();ma();Ra();Ea();Ae();ba();xa();Pa()});se();console.log("Opti has loaded!");Object.freeze=Object;Object.seal=Object;Promise.resolve().then(()=>(Ba(),Da)).then(function(e){return e.default()}).catch(function(e){console.log(e?.stack??e.toString()),alert([`Opti failed to initialize and plugins will not be loaded. -`,`Build Number: ${et.Build}`,"Opti Version: 198f26b",e?.stack||e.toString()].join(` + > **Codename/Machine ID**: ${he.device.codename}`;it.sendMessage(t.channel.id,{content:n})}}]});var va,Ia=c(()=>{"use strict";se();va=[{name:"reload",description:"Reloads Discord.",execute(){ie.reload()}}]});var Ca,Aa=c(()=>{"use strict";g();Ca=[{name:"testing",description:"this makes my balls ball",execute(e,t){it.sendBotMessage(t.channel.id,"hello world!")}}]});function Na(){let e=[...Ca,...Sa,...va];Nn(e)}var Pa=c(()=>{"use strict";Ct();Ta();Ia();Aa()});var Da={};D(Da,{default:()=>ss});async function ss(){let e=await Promise.all([vn(),_n(),An(),dn(),ha(),Vo(),Er(),Zn(),ya()]);window.vendetta=await wa(e),e.push(await Bn()),e.push(await _a()),e.push(await Na()),M.log("Opti is ready!")}var Ba=c(()=>{"use strict";Me();Ct();ge();Y();b();Oo();Go();ma();Ra();Ea();Ce();ba();xa();Pa()});se();console.log("Opti has loaded!");Object.freeze=Object;Object.seal=Object;Promise.resolve().then(()=>(Ba(),Da)).then(function(e){return e.default()}).catch(function(e){console.log(e?.stack??e.toString()),alert([`Opti failed to initialize and plugins will not be loaded. +`,`Build Number: ${et.Build}`,"Opti Version: fa8fcd9",e?.stack||e.toString()].join(` `))});})(); //# sourceURL=Vendetta diff --git a/src/ui/components/ErrorBoundary.tsx b/src/ui/components/ErrorBoundary.tsx index 9ec39b3b..55e99540 100644 --- a/src/ui/components/ErrorBoundary.tsx +++ b/src/ui/components/ErrorBoundary.tsx @@ -68,21 +68,9 @@ export default class ErrorBoundary extends React.Component - showConfirmationAlert({ - title: "Are you sure?", - content: `Sending a crash report will include the following details. - - Username / UserID - - Crash Stack - - Time of Crash`, - confirmText: "Send Report", - cancelText: "Cancel", - confirmColor: ButtonColors.RED, - onConfirm: () => { + onPress={() => { sendCrashReport("This is a placeholder."); - } - }) - } + }} text="Send Crash Report" />