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