From b0eb9187c1274fa8122f9feb3b6ef3192399031d Mon Sep 17 00:00:00 2001 From: kmmiio99o Date: Sun, 24 May 2026 14:08:13 +0000 Subject: [PATCH] deploy: 84c70a3c7bc45b4ee02f44346666fb3a78b1bf1c --- ChatboxAvatar/index.js | 1 + ChatboxAvatar/manifest.json | 1 + Commands/index.js | 19 ------------------- Commands/manifest.json | 1 - multi-scrobbler/index.js | 1 - multi-scrobbler/manifest.json | 1 - 6 files changed, 2 insertions(+), 22 deletions(-) create mode 100644 ChatboxAvatar/index.js create mode 100644 ChatboxAvatar/manifest.json delete mode 100644 Commands/index.js delete mode 100644 Commands/manifest.json delete mode 100644 multi-scrobbler/index.js delete mode 100644 multi-scrobbler/manifest.json diff --git a/ChatboxAvatar/index.js b/ChatboxAvatar/index.js new file mode 100644 index 0000000..84d7d4c --- /dev/null +++ b/ChatboxAvatar/index.js @@ -0,0 +1 @@ +(function(w,A,r,n,e,a,m){"use strict";var b,C,E,k;const{ScrollView:F}=n.ReactNative,{TableRowGroup:f,TableCheckboxRow:i,Stack:H}=r.findByProps("TableCheckboxRow","TableRowGroup","Stack");(b=e.plugin.storage).pressAction??(b.pressAction="profile"),(C=e.plugin.storage).longPressAction??(C.longPressAction="server"),(E=e.plugin.storage).showStatusCutout??(E.showStatusCutout=!1),(k=e.plugin.storage).collapseWhileTyping??(k.collapseWhileTyping=!1);function O(){m.useProxy(e.plugin.storage);const[,t]=n.React.useReducer(function(c){return c+1},0);return n.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},n.React.createElement(H,{spacing:8},n.React.createElement(f,{title:"Avatar Press Action"},n.React.createElement(i,{label:"Open Profile",checked:e.plugin.storage.pressAction==="profile",onPress:function(){e.plugin.storage.pressAction="profile",t()}}),n.React.createElement(i,{label:"Open Status Picker",checked:e.plugin.storage.pressAction==="server",onPress:function(){e.plugin.storage.pressAction="server",t()}})),n.React.createElement(f,{title:"Avatar Long-Press Action"},n.React.createElement(i,{label:"Open Profile",checked:e.plugin.storage.longPressAction==="profile",onPress:function(){e.plugin.storage.longPressAction="profile",t()}}),n.React.createElement(i,{label:"Open Status Picker",checked:e.plugin.storage.longPressAction==="server",onPress:function(){e.plugin.storage.longPressAction="server",t()}})),n.React.createElement(f,{title:"Status Icon"},n.React.createElement(i,{label:"Show",checked:!!e.plugin.storage.showStatusCutout,onPress:function(){e.plugin.storage.showStatusCutout=!0,t()}}),n.React.createElement(i,{label:"Hide",checked:!e.plugin.storage.showStatusCutout,onPress:function(){e.plugin.storage.showStatusCutout=!1,t()}})),n.React.createElement(f,{title:"Collapse While Typing"},n.React.createElement(i,{label:"Collapse avatar while typing",checked:!!e.plugin.storage.collapseWhileTyping,onPress:function(){e.plugin.storage.collapseWhileTyping=!0,t()}}),n.React.createElement(i,{label:"Always show avatar",checked:!e.plugin.storage.collapseWhileTyping,onPress:function(){e.plugin.storage.collapseWhileTyping=!1,t()}}))))}const h=r.findByProps("useStateFromStores"),T=r.findByDisplayName("ChatInputActions"),I=r.findByDisplayName("ChatInputSendButton");let B=!1,l;const{Pressable:z,View:L,Animated:d}=n.ReactNative,U=new d.Value(0),W=r.findByProps("default","AvatarSizes","getStatusSize")?.default,v=r.findByStoreName("UserStore"),N=r.findByStoreName("SelectedChannelStore"),x=r.findByStoreName("ChannelStore"),D=r.findByStoreName("SelfPresenceStore"),R=r.findByName("showUserProfileActionSheet"),$=r.findByProps("showYouAccountActionSheet");function j(){const[t,c]=a.useState(!1),s=h?.useStateFromStores?.([v],function(){return v?.getCurrentUser?.()}),S=h?.useStateFromStores?.([D],function(){return D?.getStatus?.()}),o=e.plugin.storage,g=h?.useStateFromStores?.([N],function(){return N?.getCurrentlySelectedChannelId?.()}),y=h?.useStateFromStores?.([x],function(){return x?.getChannel?.(g)},[g]),P=a.useRef(U).current;if(a.useEffect(function(){const u=setInterval(function(){c(B)},100);return function(){return clearInterval(u)}},[]),a.useEffect(function(){const u=o.collapseWhileTyping&&t;d.parallel([d.timing(P,{toValue:u?1:0,duration:200,useNativeDriver:!1})]).start()},[t,o.collapseWhileTyping,P]),!s)return null;const V=function(){const u=$?.showYouAccountActionSheet;if(typeof u=="function")try{u(!0,!0);return}catch{}R?.({userId:s.id,channelId:y?.id??g})},Y=function(){switch(o.pressAction){case"profile":R?.({userId:s.id,channelId:y?.id??g});break;case"server":V();break}},M=function(){switch(o.longPressAction){case"profile":R?.({userId:s.id,channelId:y?.id??g});break;case"server":V();break}};return a.createElement(d.View,{style:{height:40,width:P.interpolate({inputRange:[0,1],outputRange:[40,0]}),marginHorizontal:P.interpolate({inputRange:[0,1],outputRange:[4,0]}),flexShrink:0,flexDirection:"row",alignItems:"center",justifyContent:"center",overflow:o.collapseWhileTyping?"hidden":"visible"}},a.createElement(z,{onPress:Y,onLongPress:M},W&&a.createElement(W,{user:s,guildId:y?.guild_id,status:o.showStatusCutout?S:void 0,avatarDecoration:s?.avatarDecoration,animate:!o.collapseWhileTyping||!t})))}const p=[];var G={onLoad(){!T?.prototype?.render||!I?.prototype?.render||(p.push(A.after("render",T.prototype,function(t,c){return a.createElement(L,{style:{flexDirection:"row",alignItems:"center"}},c,a.createElement(j))})),p.push(A.after("render",I.prototype,function(t,c){setImmediate(function(){setImmediate(function(){if(t?.[1]?.current){l=t[1].current;const s=l?.setHasText;p.push(function(){l&&s&&(l.setHasText=s)}),l&&(l.setHasText=function(S){if(B=S,s)return s.call(l,S)})}})})})))},onUnload(){for(const t of p)t?.();p.length=0},settings:O};return w.default=G,Object.defineProperty(w,"__esModule",{value:!0}),w})({},vendetta.patcher,vendetta.metro,vendetta.metro.common,vendetta,window.React,vendetta.storage); diff --git a/ChatboxAvatar/manifest.json b/ChatboxAvatar/manifest.json new file mode 100644 index 0000000..0372893 --- /dev/null +++ b/ChatboxAvatar/manifest.json @@ -0,0 +1 @@ +{"authors":[{"name":"Cynosphere","id":"150745989836308480"},{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","vendetta":{"icon":"UserSquareIcon"},"name":"Chatbox Avatar","description":"Quickly view your profile from the chatbox.","hash":"e0851ea8a5c04157c20fc4de4767b1e03b49c2eff39730bdb0b2674bdbd9e9cb"} \ No newline at end of file diff --git a/Commands/index.js b/Commands/index.js deleted file mode 100644 index 0987613..0000000 --- a/Commands/index.js +++ /dev/null @@ -1,19 +0,0 @@ -(function(Z,Ue,r,u,p,O,E,g,e,ce,o,w,S){"use strict";const We=async function(){const t=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:t.text,source:t.source,language:t.language}},Oe=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Ge=async function(){const t=await(await fetch("https://catfact.ninja/fact")).json();return{text:t.fact,length:t.length}},je=async function(t){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${t.replace("webp","png")}`)).json()},He=async function(t="gary"){try{switch(t){case"gary":return(await(await fetch("https://api.garythe.cat/gary")).json()).url;case"goober":return(await(await fetch("https://api.garythe.cat/goober")).json()).url;case"catapi":return(await(await fetch("https://api.thecatapi.com/v1/images/search")).json())[0].url;case"minker":return"https://minky.materii.dev/";default:throw new Error("Invalid Gary image source value")}}catch(a){return console.error(`[Gary API] Error fetching image from ${t}:`,a),null}},ee=u.findByProps("sendMessage"),te=function(t){let a=t.text;return r.storage.factSettings?.includeCitation&&t.source&&(a+=` - -Source: ${t.source}`),a},ze={name:"catfact",displayName:"catfact",description:"Sends a random cat fact.",displayDescription:"Sends a random cat fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await Ge(),i=Date.now().toString();return ee.sendMessage(a.channel.id,{content:te(n)},void 0,{nonce:i}),null}catch(n){return console.error("[CatFact] Error:",n),p.showToast("Failed to fetch cat fact",3e3),null}}},Ke={name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await Oe(),i=Date.now().toString();return ee.sendMessage(a.channel.id,{content:te(n)},void 0,{nonce:i}),null}catch(n){return console.error("[DogFact] Error:",n),p.showToast("Failed to fetch dog fact",3e3),null}}},qe={name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await We(),i=Date.now().toString();return ee.sendMessage(a.channel.id,{content:te(n)},void 0,{nonce:i}),null}catch(n){return console.error("[UselessFact] Error:",n),p.showToast("Failed to fetch useless fact",3e3),null}}},D={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},Xe={DETAILED:"detailed"},ae="",G={SLM_NOT_INSTALLED:"This list is over 2000 characters. Install the Split Large Messages plugin to send it.",SLM_NOT_ENABLED:"This list is over 2000 characters. Enable the Split Large Messages plugin to send it."},le={SEMICOL:"; ",NEW_LINE:` -`},Ye="Nothing to see here, huh...",de="github.com/fres621/vendetta-plugins",A={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},Je=u.findByProps("sendMessage","receiveMessage"),k=u.findByProps("sendBotMessage"),ue=(function(){try{return u.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),ge=function(t){return Object.keys(t).includes(de)},fe=function(t){return Object.values(t).find(function(a){return a.id==de})?.enabled},ye=function(t){return t.find(function(a){return a.name===Xe.DETAILED})?.value??!1},j=function(t){return!t||!Array.isArray(t)||t.length===0?"Unknown":t.filter(function(a){return a&&(typeof a=="string"||typeof a=="object"&&a.name)}).map(function(a){return typeof a=="string"?a:a.name||"Unknown"}).join(le.SEMICOL)||"Unknown"},he=function(t){return t.join(le.NEW_LINE).trimEnd()},H=function(t){return he(t).length},z=async function(t,a){const n=Date.now().toString();await Je.sendMessage(t,{content:he(a)},void 0,{nonce:n})},me=function(t,a){return[`**My ${t} List | ${a} ${t}s**`,ae]};async function Qe(t,a){try{const n=ye(t),i=r.storage.themeListAlwaysDetailed??!1;if(!O.themes||typeof O.themes!="object"){const y=a.channel.id;return k.sendBotMessage(y,"No themes found or themes not loaded yet."),null}const s=Object.values(O.themes),c=a.channel.id,d=me("Theme",Object.keys(O.themes).length);if(s.length)for(const y of s){if(!y||typeof y!="object")continue;const{selected:f,data:h,id:b}=y,I=h?.name||"Unknown Theme",R=h?.description||"No description",N=h?.authors;n||i?d.push(`> **Name**: ${I}`,`> **Selected**: ${f?A.SELECTED:A.NOT_SELECTED}`,`> **Description**: ${R}`,`> **Authors**: ${j(N)}`,`> **[Install!](${b||"unknown"})**`,ae):d.push(`> ${f?A.SELECTED:A.NOT_SELECTED} **${I}** by ${j(N)}`)}else d.push(Ye);const l=H(d)>ue;if(l&&!ge(E.plugins))k.sendBotMessage(c,G.SLM_NOT_INSTALLED);else if(l&&!fe(E.plugins))k.sendBotMessage(c,G.SLM_NOT_ENABLED);else{if(H(d)>2e3)return g.alerts.showConfirmationAlert({content:D.CONTENT,confirmText:D.CONFIRM,cancelText:D.CANCEL,onConfirm:async function(){return await z(c,d)}});await z(c,d)}}catch(n){return console.error("[ThemeList] Error:",n),null}}async function Ze(t,a){try{const n=ye(t),i=r.storage.pluginListAlwaysDetailed??!1,s=a.channel.id;if(!E.plugins||typeof E.plugins!="object")return k.sendBotMessage(s,"No plugins found or plugins not loaded yet."),null;const c=me("Plugin",Object.keys(E.plugins).length);for(const l of Object.values(E.plugins)){if(!l||typeof l!="object")continue;const{enabled:y,manifest:f,id:h}=l,b=f?.name||"Unknown Plugin",I=f?.description||"No description",R=f?.authors;n||i?c.push(`> **Name**: ${b}`,`> **Status**: ${y?A.ENABLED:A.DISABLED}`,`> **Description**: ${I}`,`> **Authors**: ${j(R)}`,`> **[Install!](${h||"unknown"})**`,ae):c.push(`> ${y?A.ENABLED:A.DISABLED} **${b}** by ${j(R)}`)}const d=H(c)>ue;if(d&&!ge(E.plugins))k.sendBotMessage(s,G.SLM_NOT_INSTALLED);else if(d&&!fe(E.plugins))k.sendBotMessage(s,G.SLM_NOT_ENABLED);else{if(H(c)>2e3)return g.alerts.showConfirmationAlert({content:D.CONTENT,confirmText:D.CONFIRM,cancelText:D.CANCEL,onConfirm:async function(){return await z(s,c)}});await z(s,c)}}catch(n){return console.error("[PluginList] Error:",n),null}}const et={name:"plugin-list",displayName:"plugin list",description:"Send your plugin list to the current channel",displayDescription:"Send your plugin list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:Ze,applicationId:"-1",inputType:1,type:1},tt={name:"theme-list",displayName:"theme list",description:"Send your theme list to the current channel",displayDescription:"Send your theme list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:Qe,applicationId:"-1",inputType:1,type:1},at=u.findByStoreName("UserStore"),nt=u.findByProps("sendMessage"),rt={name:"petpet",displayName:"petpet",description:"PetPet someone",displayDescription:"PetPet someone",options:[{name:"user",description:"The user(or their id) to be patted",type:6,required:!0,displayName:"user",displayDescription:"The user(or their id) to be patted"}],execute:async function(t,a){try{const n=(await at.getUser(t[0].value)).getAvatarURL(512),i=await je(n),s=Date.now().toString();return nt.sendMessage(a.channel.id,{content:i.url},void 0,{nonce:s}),null}catch(n){return console.error("[PetPet] Error:",n),null}},applicationId:"-1",inputType:1,type:1},it=u.findByProps("sendMessage"),st=u.findByProps("sendBotMessage","sendMessage","receiveMessage"),pe=async function(t){const a="https://konachan.com/post.json",n=t?"rating:explicit":"rating:safe",i=Math.floor(Math.random()*100);try{const s=await(await fetch(`${a}?tags=${n}&limit=1&page=${i}`)).json();return!Array.isArray(s)||s.length===0?null:s[0].file_url}catch(s){return console.error("[KonoChan Randomizer] Error fetching image:",s),null}},Ce=function(){return new Promise(function(t){g.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:"Cancel",confirmColor:"brand",isDismissable:!0,onConfirm:function(){return t(!0)},onCancel:function(){return t(!1)}})})},be={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},ot={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[be],execute:async function(t,a){try{const n=new Map((t||[]).map(function(c){return[c.name,c]})).get("nsfw")?.value||!1,i=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSelf] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${i}`),n&&!a.channel.nsfw&&!i)return Ce(),null;const s=await pe(n);return s&&st.sendBotMessage(a.channel.id,`Here's your random image: ${s}`),null}catch(n){return console.error("[KonoSelf] Error:",n),null}},applicationId:"-1",inputType:1,type:1},ct={name:"konosend",displayName:"konosend",description:"Fetch a random image from KonoChan and send it to the channel.",displayDescription:"Fetch a random image from KonoChan and send it to the channel.",options:[be],execute:async function(t,a){try{const n=new Map((t||[]).map(function(d){return[d.name,d]})).get("nsfw")?.value||!1,i=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSend] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${i}`),n&&!a.channel.nsfw&&!i)return Ce(),null;const s=await pe(n);if(!s)return null;const c=Date.now().toString();return it.sendMessage(a.channel.id,{content:s},void 0,{nonce:c}),null}catch(n){return console.error("[KonoSend] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},ve=u.findByProps("getAPIBaseURL","get"),lt=u.findByProps("sendMessage"),dt=async function(t,a,n){const i=a?`&author_id=${a}`:"",s=n?`&channel_id=${n}`:"",c=a?"":"&min_id=0";return(await ve.get({url:`/guilds/${t}/messages/search`,query:`include_nsfw=true${i}${s}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},ut=async function(t,a){const n=a?`&author_id=${a}`:"",i=a?"":"&min_id=0";return(await ve.get({url:`/channels/${t}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${n}${i}`})).body.messages[0][0]},gt={name:"firstmessage",displayName:"firstmessage",description:"Tired of scrolling to first message?",displayDescription:"Tired of scrolling to first message?",options:[{name:"user",displayName:"user",description:"Target user to get their first message in this server/dm",displayDescription:"Target user to get their first message in this server/dm",type:6,required:!1},{name:"channel",displayName:"channel",description:"Target channel to get first message of",displayDescription:"Target channel to get first message of",type:7,required:!1},{name:"send",displayName:"send",description:"Whether to send the resulting url",displayDescription:"Whether to send the resulting url",type:5,required:!1}],execute:async function(t,a){try{const n=new Map(t.map(function(b){return[b.name,b]})),i=n.get("user")?.value,s=n.get("channel")?.value,c=n.get("send")?.value,d=a.guild?.id,l=a.channel.id,y=a.channel.type===1;if(y&&s)return p.showToast("Channel option cannot be used in DMs",3e3),null;let f="https://discord.com/channels/",h;if(y)h=await ut(l,i),f+=`@me/${l}/${h.id}`;else{h=await dt(d,i,s);const b=s||h.channel_id;f+=`${d}/${b}/${h.id}`}if(c){const b=Date.now().toString();lt.sendMessage(a.channel.id,{content:f},void 0,{nonce:b})}else e.ReactNative.Linking.openURL(f);return null}catch(n){return console.error("[FirstMessage] Error:",n),p.showToast("Failed to fetch first message",3e3),null}},applicationId:"-1",inputType:1,type:1},ft=u.findByProps("sendMessage"),yt=u.findByProps("sendBotMessage","sendMessage","receiveMessage");function ht(){let{height:t,width:a,scale:n}=e.ReactNative.Dimensions.get("screen");return t*=n,a*=n,{width:a,height:t}}function mt(){try{const t=new Date,a=new Date(t.getTime()+t.getTimezoneOffset()*6e4),n=a.getFullYear(),i=String(a.getMonth()+1).padStart(2,"0"),s=String(a.getDate()).padStart(2,"0"),c=String(a.getHours()).padStart(2,"0"),d=String(a.getMinutes()).padStart(2,"0"),l=String(a.getSeconds()).padStart(2,"0");return`${n}-${i}-${s} ${c}:${d}:${l}`}catch{return"Unknown"}}function pt(){try{const t=u.findByProps("memory");if(!t)return{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"};const{cpuCoreCount:a,cpuPercentage:n,memory:i}=t,s=n?n.toFixed(2)+"%":"N/A",c=i?parseFloat((i/1e3).toPrecision(3))+" MB":"N/A";return{cpuCoreCount:a,cpuPerc:s,memUsage:c}}catch(t){return console.warn("Hardware info unavailable:",t),{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"}}}function Ct(){try{const{NativeModules:t}=e.ReactNative;return(t.InfoDictionaryManager??t.RTNClientInfoManager)||{}}catch(t){return console.warn("Discord info unavailable:",t),{}}}function bt(){try{const{cpuCoreCount:t,cpuPerc:a,memUsage:n}=pt(),i=Ct(),s=(typeof ce.getDebugInfo=="function"?ce.getDebugInfo():{})||{},{vendetta:c,discord:d,react:l,hermes:y,os:f,device:h}=s,b=mt(),{version:I,bytecodeVersion:R}=y||{},{version:N,nativeVersion:B}=l||{},{name:v,version:T,sdk:W}=f||{},{manufacturer:x,brand:_e,model:Fe,codename:va}=h||{},{version:Ra}=c||{},{version:Ia,build:wa}=d||{},Sa=v=="iOS"?va:`${_e} ${Fe}`,{width:Na,height:Ea}=ht(),Ve={Device:{Device:Sa||"Unknown",Model:Fe||"Unknown",Manufacturer:x||"Unknown",Brand:_e||"Unknown",Display:`${Na}x${Ea}`},Hardware:{"CPU Cores":t||"N/A","CPU Usage":a,"Memory Usage":n},Software:{OS:v||"Unknown",Version:T||"Unknown"},Discord:{Version:Ia||"Unknown",Build:wa||"Unknown",Vendetta:Ra||"Unknown"},React:{Version:N||"Unknown","Hermes Bytecode":R||"Unknown",Hermes:I||"Unknown",Native:B||"Unknown"},Time:{UTC:b}};return W&&(Ve.Software["SDK Version"]=W),Ve}catch(t){throw console.error("Error generating system info:",t),t}}const Re=["device","hardware","software","discord","react","time","ephemeral"];for(const t of Re)r.storage[t]===void 0&&(r.storage[t]=!0);function vt(t,a){try{const n=[`__System Information__ -`],i=bt();Object.keys(i).forEach(function(d){const l=r.storage[d.toLowerCase()],y=t.find(function(f){return f.name==d.toLowerCase()})?.value??l;(y||l)&&!(l&&!y)&&(n.push(`[**${d}**]`),Object.keys(i[d]).forEach(function(f){n.push(`> ${f}: ${i[d][f]}`)}))});const s=r.storage.ephemeral,c=t.find(function(d){return d.name=="ephemeral"})?.value??s;if((c||s)&&!(s&&!c))return yt.sendBotMessage(a.channel.id,n.join(` -`)),null;{const d=Date.now().toString();return ft.sendMessage(a.channel.id,{content:n.join(` -`)},void 0,{nonce:d}),null}}catch(n){return console.error("[Sysinfo] Error:",n),null}}const Rt={name:"sysinfo",displayName:"sysinfo",description:"Display system information",displayDescription:"Display system information",options:[{name:"ephemeral",displayName:"ephemeral",description:"Keep sysinfo ephemeral (default: true)",displayDescription:"Keep sysinfo ephemeral (default: true)",type:5,required:!1},...Re.slice(0,-1).map(function(t){return{name:t,displayName:t,description:`Display the ${t} section. Set default in settings.`,displayDescription:`Display the ${t} section. Set default in settings.`,type:5,required:!1}})],execute:vt,applicationId:"-1",inputType:1,type:1},Ie=u.findByProps("sendMessage","receiveMessage"),It=u.findByStoreName("SpotifyStore");async function wt(t,a){return r.storage.enabledCommands?.spotifyTrack?K(a,function(n){return`https://open.spotify.com/track/${n.id}`}):null}async function St(t,a){return r.storage.enabledCommands?.spotifyAlbum?K(a,function(n){return`https://open.spotify.com/album/${n.album.id}`}):null}async function Nt(t,a){return r.storage.enabledCommands?.spotifyArtists?K(a,function(n){return n.artists.map(function(i){return`[${i.name}](${i.external_urls.spotify})`}).join(` -`)}):null}async function Et(t,a){return r.storage.enabledCommands?.spotifyCover?K(a,function(n){return n.album.image.url}):null}async function K(t,a){try{const n=t.channel.id,i=It?.getTrack?.();if(!i){const d=Date.now().toString();return Ie.sendMessage(n,{content:"You are not listening to any track."},void 0,{nonce:d}),null}const s=a(i),c=Date.now().toString();return Ie.sendMessage(n,{content:s},void 0,{nonce:c}),null}catch(n){return console.error("[Spotify Command] Error:",n),null}}const At={name:"spotify track",displayName:"spotify track",description:"Sends your current Spotify track",displayDescription:"Sends your current Spotify track",applicationId:"-1",inputType:1,type:1,execute:wt},Tt={name:"spotify album",displayName:"spotify album",description:"Sends your current track's album",displayDescription:"Sends your current track's album",applicationId:"-1",inputType:1,type:1,execute:St},Dt={name:"spotify artists",displayName:"spotify artists",description:"Sends your current track's artists",displayDescription:"Sends your current track's artists",applicationId:"-1",inputType:1,type:1,execute:Nt},kt={name:"spotify cover",displayName:"spotify cover",description:"Sends your current track's cover",displayDescription:"Sends your current track's cover",applicationId:"-1",inputType:1,type:1,execute:Et},Bt=u.findByProps("sendMessage"),xt={name:"gary",displayName:"gary",description:"Send a random Gary image to the channel.",displayDescription:"Send a random Gary image to the channel.",options:[],execute:async function(t,a){try{r.storage.garySettings||(r.storage.garySettings={imageSource:"gary"});const n=r.storage.garySettings.imageSource||"gary";console.log(`[Gary Command] Using image source: ${n}`);const i=await He(n);if(!i)return console.log("[Gary Command] No image URL received"),null;console.log(`[Gary Command] Sending image: ${i}`);const s=Date.now().toString();return Bt.sendMessage(a.channel.id,{content:i},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[Gary] Error:",n),null}},applicationId:"-1",inputType:1,type:1},we=u.findByProps("sendMessage","receiveMessage"),Pt=u.findByProps("getLastSelectedChannelId"),$t=u.findByProps("createBotMessage"),Lt=u.findByProps("BOT_AVATARS");function q(t,a,n){const i=t??Pt?.getChannelId?.(),s=$t.createBotMessage({channelId:i,content:"",embeds:n});s.author.username="Astolfo",s.author.avatar="Astolfo",Lt.BOT_AVATARS.Astolfo="https://i.pinimg.com/736x/50/77/1f/50771f45b1c015cfbb8b0853ba7b8521.jpg",typeof a=="string"?s.content=a:Object.assign(s,a),we.receiveMessage(i,s)}const Mt={name:"lovefemboys",displayName:"lovefemboys",description:"Get an image of a femboy",displayDescription:"Get an image of a femboy",options:[{name:"nsfw",displayName:"nsfw",description:"Get the result from r/femboys instead of r/femboy (NSFW)",displayDescription:"Get the result from r/femboys instead of r/femboy (NSFW)",required:!1,type:5},{name:"sort",displayName:"sort",description:"Changes the way reddit sorts.",displayDescription:"Changes the way reddit sorts",required:!1,type:3},{name:"silent",displayName:"silent",description:"Makes it so only you can see the message.",displayDescription:"Makes it so only you can see the message.",required:!1,type:5}],applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=t.find(function(l){return l.name==="nsfw"})?.value;let i=t.find(function(l){return l.name==="sort"})?.value;const s=t.find(function(l){return l.name==="silent"})?.value;if(typeof i>"u"&&(i=r.storage.sortdefs),!["best","hot","new","rising","top","controversial"].includes(i)){q(a.channel.id,"Incorrect sorting type. Valid options are\n`best`, `hot`, `new`, `rising`, `top`, `controversial`.",[]);return}if(n&&!await new Promise(function(l){g.alerts.showConfirmationAlert({title:"\u26A0\uFE0F NSFW Content Warning",content:"This command will send NSFW (Not Safe For Work) content from r/femboys. Are you sure you want to continue?",confirmText:"Yes, Continue",onConfirm:function(){return l(!0)},cancelText:"Cancel",onCancel:function(){return l(!1)}})}))return null;let c=await fetch(`https://www.reddit.com/r/femboy/${i}.json?limit=100`).then(function(l){return l.json()});if(!a.channel.nsfw_&&n&&r.storage.nsfwwarn&&!(s??!0)){q(a.channel.id,`This channel is not marked as NSFW -(You can disable this check in plugin settings)`,[]);return}n&&(c=await fetch(`https://www.reddit.com/r/femboys/${i}.json?limit=100`).then(function(l){return l.json()})),c=c.data?.children?.[Math.floor(Math.random()*c.data?.children?.length)]?.data;const d=await fetch(`https://www.reddit.com/u/${c?.author}/about.json`).then(function(l){return l.json()});if(s??!0)q(a.channel.id,"",[{type:"rich",title:c?.title,url:`https://reddit.com${c?.permalink}`,author:{name:`u/${c?.author} \u2022 r/${c?.subreddit}`,proxy_icon_url:d?.data.icon_img.split("?")[0],icon_url:d?.data.icon_img.split("?")[0]},image:{proxy_url:c?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??c?.url.replace(/.gifv$/g,".gif"),url:c?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??c?.url?.replace(/.gifv$/g,".gif"),width:c?.preview?.images?.[0]?.source?.width,height:c?.preview?.images?.[0]?.source?.height},color:"0xf4b8e4"}]);else{const l=Date.now().toString();we.sendMessage(a.channel.id,{content:c?.url_overridden_by_dest??c?.url},void 0,{nonce:l})}}catch(n){console.error("[LoveFemboys] Error:",n),q(a.channel.id,"ERROR !!!!!!!!!!!! \u{1F62D}\u{1F62D}\u{1F62D} Check debug logs!! \u{1F97A}\u{1F97A}\u{1F97A}",[])}}},_t=u.findByProps("sendMessage"),Ft=u.findByProps("sendBotMessage","sendMessage","receiveMessage"),Vt={name:"ip",displayName:"ip",description:"IP address and domain lookup",displayDescription:"IP address and domain lookup",options:[{name:"query",displayName:"query",description:"Enter IPv4/IPv6 address or domain name",displayDescription:"Enter IPv4/IPv6 address or domain name",type:3,required:!0},{name:"send",displayName:"send",description:"Send to chat",displayDescription:"Send to chat",type:5,required:!1},{name:"ephemeral",displayName:"ephemeral",description:"Send as ephemeral message (only you can see)",displayDescription:"Send as ephemeral message (only you can see)",type:5,required:!1}],execute:async function(t,a){try{const n=t.find(function(f){return f.name==="query"})?.value,i=t.find(function(f){return f.name==="send"})?.value||!1,s=t.find(function(f){return f.name==="ephemeral"})?.value||!1;if(!n){const f="\u274C Query parameter is required!";return s?{type:4,data:{content:f,flags:64}}:(p.showToast(f,o.getAssetIDByName("CircleXIcon")),null)}!s&&!i&&p.showToast(`Looking up IP information for ${n}...`,o.getAssetIDByName("DownloadIcon"));const c=`http://ipwhois.app/json/${encodeURIComponent(n)}?objects=success,ip,type,as,org,isp,continent,country,country_capital,city,region,country_phone,latitude,longitude,timezone,currency,completed_requests`,d=await fetch(c);if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const l=await d.json();if(!l.success){const f=`\u274C Failed to lookup IP information for: ${n}`;return s?{type:4,data:{content:f,flags:64}}:(p.showToast(f,o.getAssetIDByName("CircleXIcon")),null)}const y=`\`\`\`json -${JSON.stringify(l,null,4)} -\`\`\``;if(s)return{type:4,data:{content:y,flags:64}};if(i){const f=Date.now().toString();return _t.sendMessage(a.channel.id,{content:y},void 0,{nonce:f}),{type:4}}else return Ft.sendBotMessage(a.channel.id,y),null}catch(n){console.error("[IP] Command error:",n);const i=`\u274C An error occurred while looking up IP information: ${n.message||"Unknown error"}`;return t?.find?.(function(s){return s.name==="ephemeral"})?.value??!1?{type:4,data:{content:i,flags:64}}:(p.showToast(i,o.getAssetIDByName("CircleXIcon")),null)}},applicationId:"-1",inputType:1,type:1},Ut=u.findByProps("sendMessage"),Wt=u.findByProps("sendBotMessage","sendMessage","receiveMessage"),Ot=["avatar","classic","cuddle","fox_girl","gecg","holo","kemonomimi","kiss","neko","ngif","smug","spank","tickle","waifu","wallpaper","woof"];async function Gt(t,a){const n=[];for(let i=0;i0&&await new Promise(function(d){return setTimeout(d,1e3)});const s=await fetch(`https://nekos.life/api/v2/img/${t}`);if(!s.ok){console.error(`[NekosLife] API request failed: ${s.status}`);continue}const c=await s.json();c.url&&n.push(c.url)}catch(s){console.error(`[NekosLife] Error fetching image ${i+1}:`,s)}return n}function jt(t){return!t||typeof t!="string"?!1:Ot.includes(t.toLowerCase().trim())}const Ht={name:"nekoslife",displayName:"nekoslife",description:"Get SFW images/gifs from nekos.life",displayDescription:"Get SFW images/gifs from nekos.life",options:[{name:"category",displayName:"category",description:"Category name (e.g. neko, waifu, cuddle, etc.)",displayDescription:"Category name (e.g. neko, waifu, cuddle, etc.)",type:3,required:!0},{name:"limit",displayName:"limit",description:"Number of images (1-5, default: 1)",displayDescription:"Number of images (1-5, default: 1)",type:4,required:!1},{name:"send",displayName:"send",description:"Send to chat",displayDescription:"Send to chat",type:5,required:!1},{name:"ephemeral",displayName:"ephemeral",description:"Send as ephemeral message (only you can see)",displayDescription:"Send as ephemeral message (only you can see)",type:5,required:!1}],execute:async function(t,a){try{console.log("[NekosLife] Command executed with args:",t);const n=t.find(function(h){return h.name==="category"})?.value,i=t.find(function(h){return h.name==="limit"})?.value,s=t.find(function(h){return h.name==="send"})?.value||!1,c=t.find(function(h){return h.name==="ephemeral"})?.value||!1;if(console.log("[NekosLife] Parsed values:",{categoryInput:n,limitInput:i,shouldSend:s,isEphemeral:c}),!n||typeof n!="string"){const h="\u274C Category is required! Examples: neko, waifu, cuddle, kiss";return console.error("[NekosLife] No category provided"),c?{type:4,data:{content:h,flags:64}}:(p.showToast(h,o.getAssetIDByName("CircleXIcon")),null)}const d=n.toLowerCase().trim();if(!jt(d)){const h=`\u274C Invalid SFW category "${n}". Valid: neko, waifu, cuddle, kiss, holo, etc.`;return c?{type:4,data:{content:h,flags:64}}:(p.showToast(h,o.getAssetIDByName("CircleXIcon")),null)}let l=1;i!=null&&(l=parseInt(String(i))||1,l=Math.max(1,Math.min(5,l))),console.log("[NekosLife] Processing SFW request:",{category:d,limit:l,shouldSend:s,isEphemeral:c}),c||p.showToast(`Fetching ${l} SFW image(s) from nekos.life...`,o.getAssetIDByName("DownloadIcon"));const y=await Gt(d,l);if(y.length===0){const h="\u274C Failed to fetch images from nekos.life. Try again later!";return c?{type:4,data:{content:h,flags:64}}:(p.showToast(h,o.getAssetIDByName("CircleXIcon")),null)}const f=y.join(` -`);if(c)return console.log("[NekosLife] Sending ephemeral response"),{type:4,data:{content:f,flags:64}};if(s){console.log("[NekosLife] Sending to chat");const h=Date.now().toString();return Ut.sendMessage(a.channel.id,{content:f},void 0,{nonce:h}),null}else return console.log("[NekosLife] Sending as bot message"),Wt.sendBotMessage(a.channel.id,f),null}catch(n){console.error("[NekosLife] Command error:",n);const i="\u274C An error occurred while fetching images.";return t?.find?.(function(s){return s.name==="ephemeral"})?.value??!1?{type:4,data:{content:i,flags:64}}:(p.showToast(i,o.getAssetIDByName("CircleXIcon")),null)}},applicationId:"-1",inputType:1,type:1},zt=u.findByProps("sendBotMessage","sendMessage"),P=u.findByProps("getAllFriendInvites","createFriendInvite","revokeFriendInvites"),Kt=u.findByProps("getCurrentUser")?.getCurrentUser;function Se(t,a){const n=Date.now().toString();zt.sendMessage(t.channel.id,{content:a},void 0,{nonce:n})}const qt={name:"invite create",displayName:"invite create",description:"Generates a friend invite link.",displayDescription:"Generates a friend invite link.",type:1,applicationId:"-1",inputType:1,execute:async function(t,a){try{if(!Kt?.().phone)return p.showToast("You need a phone number connected to your account!",o.getAssetIDByName("Small")),null;const n=await P.createFriendInvite({code:null,recipient_phone_number_or_email:null,contact_visibility:0,filter_visibilities:[],filtered_invite_suggestions_index:0});if(n?.code){const i=Math.floor(new Date(n.expires_at).getTime()/1e3),s=`https://discord.gg/${n.code} \xB7 Expires: `;Se(a,s),p.showToast("Friend invite created!",o.getAssetIDByName("Check"))}else throw new Error("No invite code generated");return null}catch(n){return console.error("[FriendInvite] Create error:",n),p.showToast("Error creating friend invite",o.getAssetIDByName("Small")),null}}},Xt={name:"view invites",displayName:"view invites",description:"View your current friend invite links that you've made.",displayDescription:"View your current friend invite links that you've made.",type:1,applicationId:"-1",execute:async function(t,a){try{const n=await P.getAllFriendInvites();if(!n?.length)return p.showToast("No active friend invites found",o.getAssetIDByName("Info")),null;const i=n.map(function(s){const c=Math.floor(new Date(s.expires_at).getTime()/1e3);return`_https://discord.gg/${s.code}_ \xB7 Expires: \xB7 Uses: \`${s.uses}/${s.max_uses}\``});return Se(a,`**Your Active Friend Invites:** -${i.join(` -`)}`),null}catch(n){return console.error("[FriendInvite] View error:",n),p.showToast("Error viewing friend invites",o.getAssetIDByName("Small")),null}}},Yt={name:"revoke invites",displayName:"revoke invites",description:"Revoke all your friend invite links.",displayDescription:"Revoke all your friend invite links.",type:1,applicationId:"-1",inputType:1,execute:async function(t,a){try{const n=await P.getAllFriendInvites();if(!n?.length)return p.showToast("No active friend invites to revoke",o.getAssetIDByName("Info")),null;await P.revokeFriendInvites();const i=await P.getAllFriendInvites();return i.length===0?p.showToast(`Successfully revoked all ${n.length} friend invite(s)!`,o.getAssetIDByName("Check")):p.showToast(`\u26A0\uFE0F Partially revoked invites. ${i.length} invite(s) remain active.`,o.getAssetIDByName("Warning")),null}catch(n){return console.error("[FriendInvite] Revoke error:",n),p.showToast("Error revoking friend invites",o.getAssetIDByName("Small")),null}}};function Jt(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function Qt(t,a){for(var n=0;n>22)%6}.png`;c(v),l(T)}},[y]);const I=function(){if(r.storage.hiddenSettings?.enabled){r.storage.hiddenSettings.visible=!r.storage.hiddenSettings.visible,p.showToast(`Hidden settings ${r.storage.hiddenSettings.visible?"visible":"hidden"}`,o.getAssetIDByName("SettingsIcon"));return}n&&clearTimeout(n);const v=setTimeout(function(){a(0)},1e3);i(v);const T=t+1;a(T),!(T<10)&&(p.showToast("Hidden settings unlocked!",o.getAssetIDByName("CheckmarkIcon")),r.storage.hiddenSettings={...r.storage.hiddenSettings,enabled:!0,visible:!0},a(0))},R=function(){const v=!r.storage.sidebarEnabled;r.storage.sidebarEnabled=v,r.storage.pendingRestart=!0,p.showToast(`Sidebar ${v?"enabled":"disabled"}. Restart Discord to apply.`,o.getAssetIDByName(v?"CheckmarkIcon":"XIcon"))},[N,B]=e.React.useState(!1);return e.React.createElement(e.ReactNative.View,{style:b.container},e.React.createElement(e.ReactNative.View,{style:b.leftSection},e.React.createElement(e.ReactNative.Pressable,{style:b.avatarContainer,onPress:I,onPressIn:function(){return B(!0)},onPressOut:function(){return B(!1)},delayLongPress:500,onLongPress:R},e.React.createElement(e.ReactNative.View,{style:b.avatarWrapper},s?e.React.createElement(e.React.Fragment,null,e.React.createElement(e.ReactNative.Image,{source:{uri:s},style:b.avatar,resizeMode:"cover"}),d&&e.React.createElement(e.ReactNative.View,{style:b.animatedIndicator})):e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("ic_account_circle_24px"),style:b.avatarPlaceholder})),e.React.createElement(e.ReactNative.View,{style:[b.cogwheelBackground,{opacity:N?.8:0}]},e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("SettingsIcon"),style:b.cogwheelIcon}))),e.React.createElement(e.ReactNative.View,{style:b.textContainer},e.React.createElement(Ae,{variant:"display-md",color:"TEXT_DEFAULT",align:"left"},"Commands"),e.React.createElement(Ae,{variant:"text-md/bold",color:"TEXT_MUTED",align:"left"},"A collection of useful commands for Vendetta like clients"))))}function m({title:t,icon:a,children:n,padding:i=!1}){const s=e.stylesheet.createThemedStyleSheet({main:{backgroundColor:g.rawColors.PLUM_18,borderColor:g.semanticColors.CARD_BACKGROUND_DEFAULT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1,maxWidth:"100%"},titleContainer:{marginBottom:8,marginHorizontal:16,marginTop:8,gap:4,flexDirection:"row",alignItems:"center"},icon:{width:16,height:16,marginTop:1.5,tintColor:g.semanticColors.TEXT_MUTED},titleText:{fontSize:14,fontWeight:"600",color:g.semanticColors.TEXT_MUTED},wrapper:{marginHorizontal:16,marginTop:16,maxWidth:"100%"}});return e.React.createElement(e.ReactNative.View,{style:s.wrapper},t&&e.React.createElement(e.ReactNative.View,{style:s.titleContainer},a&&e.React.createElement(e.ReactNative.Image,{style:s.icon,source:a,resizeMode:"cover"}),e.React.createElement(e.ReactNative.Text,{style:s.titleText},t.toUpperCase())),e.React.createElement(e.ReactNative.View,{style:s.main},i?e.React.createElement(e.ReactNative.View,{style:{paddingHorizontal:16,paddingVertical:16}},n):n))}const{FormSwitchRow:$,FormRow:L}=S.Forms;function oa(){w.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Fact Display Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement($,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ArrowAngleLeftUpIcon")}),value:r.storage.factSettings.sendAsReply,onValueChange:function(a){r.storage.factSettings.sendAsReply=a}}),e.React.createElement($,{label:"Include Source Citation",subLabel:"Include the source of facts when available",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("LinkIcon")}),value:r.storage.factSettings.includeCitation,onValueChange:function(a){r.storage.factSettings.includeCitation=a}})),e.React.createElement(m,{title:"Available Fact Commands",icon:o.getAssetIDByName("BookmarkIcon")},e.React.createElement($,{label:"/catfact",subLabel:"Get random cat facts",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.catfact,onValueChange:function(a){r.storage.enabledCommands.catfact=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement($,{label:"/dogfact",subLabel:"Get random dog facts",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.dogfact,onValueChange:function(a){r.storage.enabledCommands.dogfact=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement($,{label:"/useless",subLabel:"Get random useless facts",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.useless,onValueChange:function(a){r.storage.enabledCommands.useless=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:X,FormRow:Y}=S.Forms;function ca(){w.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"List Display Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(X,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",leading:e.React.createElement(Y.Icon,{source:o.getAssetIDByName("PuzzlePieceIcon")}),value:r.storage.listSettings.pluginListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.pluginListAlwaysDetailed=a}}),e.React.createElement(X,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",leading:e.React.createElement(Y.Icon,{source:o.getAssetIDByName("PaintPaletteIcon")}),value:r.storage.listSettings.themeListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.themeListAlwaysDetailed=a}})),e.React.createElement(m,{title:"Available List Commands",icon:o.getAssetIDByName("ListViewIcon")},e.React.createElement(X,{label:"/plugin-list",subLabel:"List all installed plugins",leading:e.React.createElement(Y.Icon,{source:o.getAssetIDByName("PuzzlePieceIcon")}),value:r.storage.enabledCommands.pluginList,onValueChange:function(a){r.storage.enabledCommands.pluginList=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(X,{label:"/theme-list",subLabel:"List all installed themes",leading:e.React.createElement(Y.Icon,{source:o.getAssetIDByName("PaintPaletteIcon")}),value:r.storage.enabledCommands.themeList,onValueChange:function(a){r.storage.enabledCommands.themeList=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:re,FormRow:ie}=S.Forms;function la(){w.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Image Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(re,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",leading:e.React.createElement(ie.Icon,{source:o.getAssetIDByName("HandRequestSpeakIcon")}),value:r.storage.enabledCommands.petpet,onValueChange:function(a){r.storage.enabledCommands.petpet=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"KonoChan Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(re,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",leading:e.React.createElement(ie.Icon,{source:o.getAssetIDByName("EyeIcon")}),value:r.storage.enabledCommands.konoself,onValueChange:function(a){r.storage.enabledCommands.konoself=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(re,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",leading:e.React.createElement(ie.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:r.storage.enabledCommands.konosend,onValueChange:function(a){r.storage.enabledCommands.konosend=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:M,FormRow:_}=S.Forms;function da(){w.useProxy(r.storage);const[,t]=e.React.useReducer(function(i){return i+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},infoText:{fontSize:14,color:g.semanticColors.TEXT_MUTED,marginBottom:16,textAlign:"center"},currentText:{fontSize:14,color:g.semanticColors.TEXT_MUTED,textAlign:"center",fontWeight:"600"}}),n=r.storage.garySettings.imageSource;return e.React.createElement(e.ReactNative.ScrollView,{style:a.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Gary Command Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(M,{label:"/gary",subLabel:"Send random Gary images to channel",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("AttachmentIcon")}),value:r.storage.enabledCommands.gary,onValueChange:function(i){r.storage.enabledCommands.gary=i,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"Image Source Selection",icon:o.getAssetIDByName("DownloadIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.infoText},"Choose which API the /gary command should use to fetch images.")),e.React.createElement(m,{title:"API Options",icon:o.getAssetIDByName("CloudIcon")},e.React.createElement(M,{label:"Gary API",subLabel:"Original Gary the cat images from api.garythe.cat",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="gary",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="gary",t())}}),e.React.createElement(M,{label:"Cat API",subLabel:"Random cat pictures from thecatapi.com",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="catapi",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="catapi",t())}}),e.React.createElement(M,{label:"Minker API",subLabel:"Minky images from minky.materii.dev",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="minker",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="minker",t())}}),e.React.createElement(M,{label:"Goober API",subLabel:"Goober images from api.garythe.cat/goober",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="goober",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="goober",t())}})),e.React.createElement(m,{title:"Current Selection",icon:o.getAssetIDByName("CheckmarkIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.currentText},"Currently using:"," ",n==="gary"?"Gary API":n==="catapi"?"Cat API":n==="minker"?"Minker API":n==="goober"?"Goober API":"Gary API")))}const{FormSwitchRow:J,FormRow:Q}=S.Forms;function ua(){w.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({infoText:{fontSize:14,color:g.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20}});return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Spotify Commands",icon:o.getAssetIDByName("SpotifyNeutralIcon")},e.React.createElement(J,{label:"/spotify track",subLabel:"Share your current Spotify track",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyTrack,onValueChange:function(n){r.storage.enabledCommands.spotifyTrack=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(J,{label:"/spotify album",subLabel:"Share your current track's album",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyAlbum,onValueChange:function(n){r.storage.enabledCommands.spotifyAlbum=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(J,{label:"/spotify artists",subLabel:"Share your current track's artists",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyArtists,onValueChange:function(n){r.storage.enabledCommands.spotifyArtists=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(J,{label:"/spotify cover",subLabel:"Share your current track's cover",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyCover,onValueChange:function(n){r.storage.enabledCommands.spotifyCover=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"About Spotify Commands",icon:o.getAssetIDByName("InfoIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.infoText},"These commands allow you to share your current Spotify activity in Discord. Make sure you have Spotify connected to Discord for these commands to work properly.")))}function ga(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},tableHeader:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,backgroundColor:g.semanticColors.BACKGROUND_MODIFIER_ACCENT,borderBottomWidth:2,borderBottomColor:g.semanticColors.BORDER_STRONG},headerText:{fontSize:14,fontWeight:"700",color:g.semanticColors.HEADER_PRIMARY,textTransform:"uppercase"},nameHeader:{flex:2},codeHeader:{flex:2,textAlign:"center"},badgeHeader:{flex:1,textAlign:"center"},categoryItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,borderBottomWidth:1,borderBottomColor:g.semanticColors.BORDER_FAINT},categoryName:{fontSize:16,fontWeight:"500",color:g.semanticColors.HEADER_PRIMARY,flex:2},categoryValue:{fontSize:14,color:g.semanticColors.TEXT_MUTED,fontFamily:"monospace",flex:2,textAlign:"center"},sfwBadgeContainer:{flex:1,alignItems:"center"},sfwBadge:{backgroundColor:g.semanticColors.STATUS_POSITIVE,paddingHorizontal:8,paddingVertical:4,borderRadius:12},badgeText:{fontSize:12,fontWeight:"600",color:g.semanticColors.TEXT_NORMAL},infoText:{fontSize:14,color:g.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20}}),a=[{name:"Avatar",value:"avatar"},{name:"Classic",value:"classic"},{name:"Cuddle",value:"cuddle"},{name:"Fox Girl",value:"fox_girl"},{name:"Gecg",value:"gecg"},{name:"Holo",value:"holo"},{name:"Kemonomimi",value:"kemonomimi"},{name:"Kiss",value:"kiss"},{name:"Neko",value:"neko"},{name:"Neko GIF",value:"ngif"},{name:"Smug",value:"smug"},{name:"Spank",value:"spank"},{name:"Tickle",value:"tickle"},{name:"Waifu",value:"waifu"},{name:"Wallpaper",value:"wallpaper"},{name:"Woof",value:"woof"}],n=a.sort(function(i,s){return i.name.localeCompare(s.name)});return e.React.createElement(e.ReactNative.ScrollView,{style:t.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"\u{1F4CA} Category Statistics",icon:o.getAssetIDByName("ChartIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.infoText},"Total SFW Categories: ",a.length,` - -`,"Use these category names with the /nekoslife command.",` -`,"All categories are Safe For Work (SFW).")),e.React.createElement(m,{title:"\u{1F4CB} SFW Categories",icon:o.getAssetIDByName("ListViewIcon")},e.React.createElement(e.ReactNative.View,{style:t.tableHeader},e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.nameHeader]},"Category Name"),e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.codeHeader]},"Command Code"),e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.badgeHeader]},"Type")),n.map(function(i,s){return e.React.createElement(e.ReactNative.View,{key:s,style:t.categoryItem},e.React.createElement(e.ReactNative.Text,{style:t.categoryName},i.name),e.React.createElement(e.ReactNative.Text,{style:t.categoryValue},i.value),e.React.createElement(e.ReactNative.View,{style:t.sfwBadgeContainer},e.React.createElement(e.ReactNative.View,{style:t.sfwBadge},e.React.createElement(e.ReactNative.Text,{style:t.badgeText},"SFW"))))})))}const{FormSwitchRow:Te,FormRow:F}=S.Forms;function fa(){w.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.NavigationNative.useNavigation();return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"IP Commands",icon:o.getAssetIDByName("GlobeEarthIcon")},e.React.createElement(Te,{label:"/ip",subLabel:"Get your current IP address",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("GlobeEarthIcon")}),value:r.storage.enabledCommands.ip,onValueChange:function(n){r.storage.enabledCommands.ip=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"NekosLife Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(Te,{label:"/nekoslife",subLabel:"Get images/gifs from nekos.life",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:r.storage.enabledCommands.nekoslife,onValueChange:function(n){r.storage.enabledCommands.nekoslife=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(F,{label:"View Categories",subLabel:"See all 16 available categories",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("BookOpenIcon")}),trailing:e.React.createElement(F.Arrow,null),onPress:function(){return a.push("VendettaCustomPage",{title:"NekosLife Categories",render:ga})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}}))}const{FormSwitchRow:V,FormRow:De}=S.Forms;function ya(){w.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Message Commands",icon:o.getAssetIDByName("ChatIcon")},e.React.createElement(V,{label:"/firstmessage",subLabel:"Get the first message in a channel",leading:e.React.createElement(De.Icon,{source:o.getAssetIDByName("ChatIcon")}),value:r.storage.enabledCommands.firstmessage,onValueChange:function(a){r.storage.enabledCommands.firstmessage=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"System Commands",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(V,{label:"/sysinfo",subLabel:"Display system information",leading:e.React.createElement(De.Icon,{source:o.getAssetIDByName("SettingsIcon")}),value:r.storage.enabledCommands.sysinfo,onValueChange:function(a){r.storage.enabledCommands.sysinfo=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"Friend Invites",icon:o.getAssetIDByName("UserAddIcon")},e.React.createElement(V,{label:"/invite create",subLabel:"Generate a friend invite link",value:r.storage.enabledCommands.friendInviteCreate,onValueChange:function(a){r.storage.enabledCommands.friendInviteCreate=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(V,{label:"/view invites",subLabel:"View your current friend invites",value:r.storage.enabledCommands.friendInviteView,onValueChange:function(a){r.storage.enabledCommands.friendInviteView=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(V,{label:"/revoke invites",subLabel:"Revoke all your friend invites",value:r.storage.enabledCommands.friendInviteRevoke,onValueChange:function(a){r.storage.enabledCommands.friendInviteRevoke=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:se,FormRow:U}=S.Forms;function ha(){w.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},warningText:{fontSize:14,color:g.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20,fontWeight:"600"},infoText:{fontSize:14,color:g.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20,marginTop:8}});return e.React.createElement(e.ReactNative.ScrollView,{style:a.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Warning",icon:o.getAssetIDByName("WarningIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.warningText},"These are hidden commands that may contain mature content or experimental features."),e.React.createElement(e.ReactNative.Text,{style:a.infoText},"Use at your own discretion. Commands in this section are disabled by default.")),e.React.createElement(m,{title:"Hidden Commands",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(se,{label:"/lovefemboys",subLabel:"Get random femboy images from r/femboys (NSFW content available)",leading:e.React.createElement(U.Icon,{source:o.getAssetIDByName("HeartIcon")}),value:r.storage.enabledCommands.lovefemboys,onValueChange:function(n){r.storage.enabledCommands.lovefemboys=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"NSFW Bypass Options",icon:o.getAssetIDByName("WarningIcon")},e.React.createElement(se,{label:"KonoChan NSFW Bypass",subLabel:"Allow NSFW KonoChan content in non-NSFW channels (USE WITH CAUTION)",leading:e.React.createElement(U.Icon,{source:o.getAssetIDByName("ShieldIcon")}),value:r.storage.hiddenSettings.konochanBypassNsfw,onValueChange:function(n){n?g.alerts.showConfirmationAlert({title:"\u26A0\uFE0F NSFW Bypass Warning",content:"Enabling this allows NSFW content from KonoChan to be sent in any channel, including non-NSFW channels. This could violate server rules or Discord ToS. Use responsibly!",confirmText:"I Understand",cancelText:"Cancel",onConfirm:function(){r.storage.hiddenSettings.konochanBypassNsfw=!0,t()},onCancel:function(){}}):(r.storage.hiddenSettings.konochanBypassNsfw=!1,t())}})),e.React.createElement(m,{title:"Hidden Settings Control",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(se,{label:"Keep Hidden Settings Visible",subLabel:"Keep this section visible even when navigating away",leading:e.React.createElement(U.Icon,{source:o.getAssetIDByName("EyeIcon")}),value:r.storage.hiddenSettings.visible,onValueChange:function(n){r.storage.hiddenSettings.visible=n}}),e.React.createElement(U,{label:"Reset Hidden Settings",subLabel:"Hide this section and disable all hidden commands",leading:e.React.createElement(U.Icon,{source:o.getAssetIDByName("TrashIcon")}),onPress:function(){g.alerts.showConfirmationAlert({title:"Reset Hidden Settings",content:"This will hide the hidden settings section and disable all hidden commands. Are you sure?",confirmText:"Reset",onConfirm:function(){r.storage.hiddenSettings.enabled=!1,r.storage.hiddenSettings.visible=!1,r.storage.hiddenSettings.konochanBypassNsfw=!1,r.storage.enabledCommands.lovefemboys=!1,r.storage.pendingRestart=!0,p.showToast("Hidden settings reset",o.getAssetIDByName("CheckmarkIcon"))},cancelText:"Cancel"})}})))}function ma(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},scrollContent:{paddingVertical:16,paddingHorizontal:12,alignItems:"stretch"},groupWrapper:{marginHorizontal:16,marginTop:16,maxWidth:"100%"},groupMain:{backgroundColor:g.rawColors.PLUM_18,borderColor:g.semanticColors.CARD_BACKGROUND_DEFAULT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1,maxWidth:"100%"},rippleContainer:{borderRadius:16,overflow:"hidden"},cardPressable:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:12},avatarContainer:{width:56,height:56,borderRadius:12,overflow:"hidden",backgroundColor:g.semanticColors.BACKGROUND_SECONDARY,justifyContent:"center",alignItems:"center",marginRight:12},avatar:{width:56,height:56,borderRadius:12,resizeMode:"cover"},textContainer:{flex:1,justifyContent:"center"},commandText:{fontSize:16,fontWeight:"700",color:g.semanticColors.MOBILE_TEXT_HEADING_PRIMARY,marginBottom:2},authorText:{fontSize:14,color:g.semanticColors.TEXT_MUTED,marginBottom:6},linkText:{fontSize:13,color:g.semanticColors.LINK,fontWeight:"600"},infoText:{fontSize:14,color:g.semanticColors.TEXT_MUTED,marginBottom:20,textAlign:"center",lineHeight:20},versionText:{fontSize:15,color:g.semanticColors.TEXT_MUTED,textAlign:"center",fontWeight:"600",lineHeight:22}}),a=[{command:"Facts Commands",author:"jdev082",avatar:"https://github.com/jdev082.png",github:"https://github.com/jdev082"},{command:"List Commands",author:"Kitomanari",avatar:"https://github.com/Kitosight.png",github:"https://github.com/Kitosight"},{command:"PetPet",author:"wolfieeee",avatar:"https://github.com/WolfPlugs.png",github:"https://github.com/WolfPlugs"},{command:"KonoChan Commands",author:"btmc727 & Rico040",avatar:"https://github.com/OTKUSteyler.png",github:"https://github.com/OTKUSteyler"},{command:"FirstMessage Command",author:"sapphire",avatar:"https://github.com/aeongdesu.png",github:"https://github.com/aeongdesu"},{command:"Sysinfo Command",author:"mugman",avatar:"https://github.com/mugman174.png",github:"https://github.com/mugman174"},{command:"Spotify Commands",author:"Kitomanari",avatar:"https://github.com/Kitosight.png",github:"https://github.com/Kitosight"},{command:"Gary Command",author:"Zach Orange",avatar:"https://github.com/IAmGaryTheCat.png",github:"https://github.com/IAmGaryTheCat"},{command:"IP & NekosLife Commands",author:"scruzism",avatar:"https://github.com/scrazzz.png",github:"https://github.com/scrazzz"},{command:"FriendInvites",author:"nikosszzz",avatar:"https://github.com/nikosszzz.png",github:"https://github.com/nikosszzz"}],n=function(l){e.ReactNative.Linking.openURL(l)},i=o.getAssetIDByName("HeartIcon"),s=o.getAssetIDByName("ic_information_24px"),c=typeof i=="number"?i:void 0,d=typeof s=="number"?s:void 0;return e.React.createElement(e.ReactNative.ScrollView,{style:t.container,contentContainerStyle:t.scrollContent},e.React.createElement(m,{title:"Plugin Authors",icon:c,padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.infoText},"Thanks to these developers for creating such great plugins!",` -`,"Tap any developer to visit their GitHub profile.")),a.map(function(l){return e.React.createElement(e.ReactNative.View,{key:l.github,style:t.groupWrapper},e.React.createElement(e.ReactNative.View,{style:t.groupMain},e.React.createElement(e.ReactNative.View,{style:t.rippleContainer},e.React.createElement(e.ReactNative.Pressable,{style:t.cardPressable,onPress:function(){return n(l.github)},android_ripple:{color:g.semanticColors.ANDROID_RIPPLE,borderless:!1,radius:200},accessibilityRole:"button"},e.React.createElement(e.ReactNative.View,{style:t.avatarContainer},e.React.createElement(e.ReactNative.Image,{source:{uri:l.avatar},style:t.avatar})),e.React.createElement(e.ReactNative.View,{style:t.textContainer},e.React.createElement(e.ReactNative.Text,{numberOfLines:1,style:t.commandText},l.command),e.React.createElement(e.ReactNative.Text,{numberOfLines:1,style:t.authorText},"by ",l.author))))))}),e.React.createElement(m,{title:"About",icon:d,padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.versionText},"Commands Plugin Collection",` -`,"Version 1.3.0")))}var ke,Be,xe,Pe,$e,Le,Me;const{FormRow:C}=S.Forms;(ke=r.storage).factSettings??(ke.factSettings={sendAsReply:!0,includeCitation:!1}),(Be=r.storage).listSettings??(Be.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),(xe=r.storage).garySettings??(xe.garySettings={imageSource:"gary"}),(Pe=r.storage).enabledCommands??(Pe.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0,ip:!0,lovefemboys:!1,nekoslife:!1,friendInviteCreate:!0,friendInviteView:!0,friendInviteRevoke:!0}),($e=r.storage).pendingRestart??($e.pendingRestart=!1),(Le=r.storage).hiddenSettings??(Le.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1}),(Me=r.storage).sidebarEnabled??(Me.sidebarEnabled=!1);function pa(){w.useProxy(r.storage);const t=e.NavigationNative.useNavigation();return e.React.useEffect(function(){return function(){r.storage.pendingRestart&&(r.storage.pendingRestart=!1,g.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null,onConfirm:function(){}}))}},[]),e.React.createElement(e.ReactNative.View,{style:{flex:1}},e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,maxWidth:"100%"},showsVerticalScrollIndicator:!1},e.React.createElement(sa,null),e.React.createElement(m,{title:"Command Categories",icon:o.getAssetIDByName("ChannelListIcon")},e.React.createElement(C,{label:"Facts Commands",subLabel:"Cat facts, dog facts, and useless facts",leading:e.React.createElement(C.Icon,{source:o.getAssetIDByName("BookmarkIcon")}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Facts Commands",render:oa})}}),e.React.createElement(C,{label:"List Commands",subLabel:"Plugin lists and theme lists",leading:e.React.createElement(C.Icon,{source:o.getAssetIDByName("ListViewIcon")}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"List Commands",render:ca})}}),e.React.createElement(C,{label:"Image Commands",subLabel:"PetPet, KonoChan, and image utilities",leading:e.React.createElement(C.Icon,{source:o.getAssetIDByName("ImageIcon")}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Image Commands",render:la})}}),e.React.createElement(C,{label:"Gary Commands",subLabel:`Gary images - Current: ${r.storage.garySettings.imageSource==="gary"?"Gary API":r.storage.garySettings.imageSource==="catapi"?"Cat API":r.storage.garySettings.imageSource==="minker"?"Minker API":r.storage.garySettings.imageSource==="goober"?"Goober API":"Gary API"}`,leading:e.React.createElement(C.Icon,{source:o.getAssetIDByName("CameraIcon")}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Gary Commands",render:da})}}),e.React.createElement(C,{label:"Spotify Commands",subLabel:"Share your Spotify activity",leading:e.React.createElement(C.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Spotify Commands",render:ua})}}),e.React.createElement(C,{label:"Aliucord Commands",subLabel:"Commands from Aliucord",leading:e.React.createElement(C.Icon,{source:{uri:"https://avatars.githubusercontent.com/u/78881422?s=200&v=4"}}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Aliucord",render:fa})}}),e.React.createElement(C,{label:"Other Commands",subLabel:"Utility and system commands",leading:e.React.createElement(C.Icon,{source:o.getAssetIDByName("WrenchIcon")}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Other Commands",render:ya})}})),r.storage.hiddenSettings?.visible&&e.React.createElement(m,{title:"Hidden Settings",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(C,{label:"Hidden Commands",subLabel:"Access to experimental and NSFW commands",leading:e.React.createElement(C.Icon,{source:o.getAssetIDByName("EyeIcon")}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Hidden Settings",render:ha})}})),e.React.createElement(m,{title:"Other",icon:o.getAssetIDByName("CircleInformationIcon-primary")},e.React.createElement(C,{label:"Credits",subLabel:"View original authors of the plugins",leading:e.React.createElement(C.Icon,{source:o.getAssetIDByName("HeartIcon")}),trailing:e.React.createElement(C.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Credits",render:ma})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}})))}r.storage.factSettings||(r.storage.factSettings={sendAsReply:!0,includeCitation:!1}),r.storage.listSettings||(r.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),r.storage.garySettings||(r.storage.garySettings={imageSource:"gary"}),r.storage.enabledCommands||(r.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0,ip:!0,lovefemboys:!1,nekoslife:!1,friendInviteCreate:!0,friendInviteView:!0,friendInviteRevoke:!0}),r.storage.hiddenSettings||(r.storage.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1});const Ca={catfact:ze,dogfact:Ke,useless:qe,petpet:rt,pluginList:et,themeList:tt,konoself:ot,konosend:ct,firstmessage:gt,sysinfo:Rt,spotifyTrack:At,spotifyAlbum:Tt,spotifyArtists:Dt,spotifyCover:kt,gary:xt,ip:Vt,lovefemboys:Mt,nekoslife:Ht,friendInviteCreate:qt,friendInviteView:Xt,friendInviteRevoke:Yt};let oe=[];var ba={onLoad:function(){console.log("[Commands Plugin] Loading...");for(const[t,a]of Object.entries(Ca))if(r.storage.enabledCommands[t])try{oe.push(Ue.registerCommand(a)),console.log(`[Commands Plugin] Registered command: ${t}`)}catch(n){console.error(`[Commands Plugin] Failed to register command ${t}:`,n)}},onUnload:function(){console.log("[Commands Plugin] Unloading..."),oe.forEach(function(t){try{t()}catch{}}),oe=[]},settings:pa};return Z.default=ba,Object.defineProperty(Z,"__esModule",{value:!0}),Z})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.ui.toasts,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.debug,vendetta.ui.assets,vendetta.storage,vendetta.ui.components); diff --git a/Commands/manifest.json b/Commands/manifest.json deleted file mode 100644 index dec2ae7..0000000 --- a/Commands/manifest.json +++ /dev/null @@ -1 +0,0 @@ -{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","version":"1.0.0","hash":"cbf315c386bc5594b7e4618c7432ebad64bc3073234b892e62b00fa10b000823"} \ No newline at end of file diff --git a/multi-scrobbler/index.js b/multi-scrobbler/index.js deleted file mode 100644 index 167731a..0000000 --- a/multi-scrobbler/index.js +++ /dev/null @@ -1 +0,0 @@ -(function(q,p,r,V,ft,$,Z,S,R){"use strict";const d={DEFAULT_APP_NAME:"Music",DEFAULT_TIME_INTERVAL:5,APPLICATION_ID:"1368513179272871956",MIN_UPDATE_INTERVAL:3,MAX_RETRY_ATTEMPTS:3,RETRY_DELAY:5e3,SERVICES:{lastfm:{name:"Last.fm",baseUrl:"https://ws.audioscrobbler.com/2.0",requiresApiKey:!0,requiresToken:!1},librefm:{name:"Libre.fm",baseUrl:"https://libre.fm/2.0",requiresApiKey:!0,requiresToken:!1},listenbrainz:{name:"ListenBrainz",baseUrl:"https://api.listenbrainz.org/1",requiresApiKey:!0,requiresToken:!0}},DEFAULT_HEADERS:{},DEFAULT_COVER_HASHES:["2a96cbd8b46e442fc41c2b86b821562f"],DEFAULT_SETTINGS:{username:"",apiKey:"",appName:"Music",timeInterval:5,showTimestamp:!0,listeningTo:!0,showLargeText:!0,ignoreYouTubeMusic:!1,verboseLogging:!1,service:void 0,librefmUsername:"",librefmApiKey:"",listenbrainzUsername:"",listenbrainzToken:""},API_ERROR_CODES:{2:"Invalid service",3:"Invalid method",4:"Invalid format",5:"Invalid parameters",6:"Invalid resource specified",7:"Invalid session key",8:"Invalid API key",9:"Invalid session",10:"Invalid API signature",11:"Service offline",13:"Invalid method signature supplied",16:"Service temporarily unavailable",26:"Suspended API key",29:"Rate limit exceeded"}};function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ce(e,t){for(var n=0;n10&&(w.serviceErrors[e]=w.serviceErrors[e].slice(-10)),fe(`${e} error:`,t)}function pe(){w.lastSuccessfulUpdate=new Date().toISOString(),X("Successful update recorded at:",w.lastSuccessfulUpdate)}function Q(e){return Q=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(e)}function be(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(be=function(){return!!e})()}function Oe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ke(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function je(e,t){return t&&(Ke(t)==="object"||typeof t=="function")?t:Oe(e)}function te(e,t,n){return t=Q(t),je(e,be()?Reflect.construct(t,n||[],Q(e).constructor):t.apply(e,n))}function re(e,t){return re=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},re(e,t)}function ne(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&&re(e,t)}let ae=(function(){function e(){F(this,e)}return B(e,[{key:"log",value:function(...t){console.log(`[${this.getServiceName()}]`,...t)}},{key:"logError",value:function(...t){console.error(`[${this.getServiceName()}] Error:`,...t)}},{key:"logVerbose",value:function(...t){console.log(`[${this.getServiceName()}] Verbose:`,...t)}},{key:"handleError",value:async function(t){this.lastError=t.error||0;const n=this.getErrorMessage(t);throw this.logError(n),H(this.getServiceName().toLowerCase(),n),new Error(`${this.getServiceName()} API Error: ${n}`)}},{key:"getErrorMessage",value:function(t){return t.error&&d.API_ERROR_CODES[t.error]?d.API_ERROR_CODES[t.error]:t.message||t.toString()||"Unknown error"}},{key:"makeRequest",value:async function(t,n={}){try{this.logVerbose(`Making request to: ${t}`),de();const a=await fetch(t,{...n,headers:{"User-Agent":"Vendetta Multi-Service Scrobbler/3.0.0",...n.headers}});if(!a.ok){const s=new Error(`HTTP ${a.status}: ${a.statusText}`);throw H(this.getServiceName().toLowerCase(),s.message),s}const i=await a.json();return i.error&&await this.handleError(i),this.retryCount=0,i}catch(a){if(this.retryCount++,this.retryCount>d.MAX_RETRY_ATTEMPTS)throw this.retryCount=0,H(this.getServiceName().toLowerCase(),`Max retries exceeded: ${a.message}`),a;return this.logVerbose(`Request failed, retrying (${this.retryCount}/${d.MAX_RETRY_ATTEMPTS})`),await new Promise(function(i){return setTimeout(i,d.RETRY_DELAY)}),this.makeRequest(t,n)}}},{key:"isDefaultCover",value:function(t){return t?d.DEFAULT_COVER_HASHES.some(function(n){return t.includes(n)}):!0}},{key:"processAlbumArt",value:function(t){return!t||this.isDefaultCover(t)?null:t}},{key:"getLastError",value:function(){return this.lastError}},{key:"resetRetryCount",value:function(){this.retryCount=0}}]),e})(),Ge=(function(e){ne(t,e);function t(){return F(this,t),te(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"Last.fm"}},{key:"logVerbose",value:function(...n){l.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{if(!l.username||!l.apiKey)throw new Error("Username or API key not set");const n=new URLSearchParams({method:"user.getinfo",user:l.username,api_key:l.apiKey,format:"json"}),a=`${d.SERVICES.lastfm.baseUrl}?${n}`;return await this.makeRequest(a),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{if(!l.username||!l.apiKey)throw new Error("Username or API key not set");this.logVerbose("Fetching latest scrobble for user:",l.username);const n=new URLSearchParams({method:"user.getrecenttracks",user:l.username,api_key:l.apiKey,limit:"1",extended:"1",format:"json"}),a=`${d.SERVICES.lastfm.baseUrl}?${n}`,i=(await this.makeRequest(a))?.recenttracks?.track?.[0];if(!i)throw new Error("No tracks found");this.logVerbose("Raw track data:",i);const s=!!i["@attr"]?.nowplaying,o=i.date?.uts?parseInt(i.date.uts):Math.floor(Date.now()/1e3);let g=null,b=null;if(s)try{const C=new URLSearchParams({method:"track.getInfo",track:i.name,artist:i.artist.name,api_key:l.apiKey,format:"json"}),N=`${d.SERVICES.lastfm.baseUrl}?${C}`,h=await this.makeRequest(N);h?.track?.duration&&(g=parseInt(h.track.duration),g>0&&(g=Math.floor(g/1e3),b=o+g))}catch(C){this.logVerbose("Failed to fetch track duration:",C)}const k=this.processAlbumArt(i.image?.find(function(C){return C.size==="large"})?.["#text"]),U={name:i.name,artist:i.artist.name,album:i.album["#text"],albumArt:k,url:i.url,date:i.date?.["#text"]??"now",nowPlaying:s,loved:i.loved==="1",from:o,to:b,duration:g};return this.logVerbose("Processed track:",U),this.log(`${s?"Now playing":"Last played"}:`,`${U.artist} - ${U.name}`),U}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ae),qe=(function(e){ne(t,e);function t(){return F(this,t),te(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"Libre.fm"}},{key:"logVerbose",value:function(...n){l.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=l.librefmUsername,a=l.librefmApiKey;if(!n||!a)throw new Error("Username or API key not set for Libre.fm");const i=new URLSearchParams({method:"user.getinfo",user:n,api_key:a,format:"json"}),s=`${d.SERVICES.librefm.baseUrl}?${i}`;return await this.makeRequest(s),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{const n=l.librefmUsername,a=l.librefmApiKey;if(!n||!a)throw new Error("Username or API key not set for Libre.fm");this.logVerbose("Fetching latest scrobble for user:",n);const i=new URLSearchParams({method:"user.getrecenttracks",user:n,api_key:a,limit:"1",extended:"1",format:"json"}),s=`${d.SERVICES.librefm.baseUrl}?${i}`,o=(await this.makeRequest(s))?.recenttracks?.track?.[0];if(!o)throw new Error("No tracks found");this.logVerbose("Raw track data:",o);const g=!!o["@attr"]?.nowplaying,b=o.date?.uts?parseInt(o.date.uts):Math.floor(Date.now()/1e3);let k=null,U=null;if(g)try{const h=new URLSearchParams({method:"track.getInfo",track:o.name,artist:o.artist.name,api_key:a,format:"json"}),D=`${d.SERVICES.librefm.baseUrl}?${h}`,A=await this.makeRequest(D);A?.track?.duration&&(k=parseInt(A.track.duration),k>0&&(k=Math.floor(k/1e3),U=b+k))}catch(h){this.logVerbose("Failed to fetch track duration:",h)}const C=this.processAlbumArt(o.image?.find(function(h){return h.size==="large"})?.["#text"]),N={name:o.name,artist:o.artist.name,album:o.album["#text"],albumArt:C,url:o.url,date:o.date?.["#text"]??"now",nowPlaying:g,loved:o.loved==="1",from:b,to:U,duration:k};return this.logVerbose("Processed track:",N),this.log(`${g?"Now playing":"Last played"}:`,`${N.artist} - ${N.name}`),N}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ae),Ye=(function(e){ne(t,e);function t(){return F(this,t),te(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"ListenBrainz"}},{key:"logVerbose",value:function(...n){l.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=l.listenbrainzUsername,a=l.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");const i=`${d.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,s={};return a&&(s.Authorization=`Token ${a}`),await this.makeRequest(i,{headers:s}),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{const n=l.listenbrainzUsername,a=l.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");this.logVerbose("Fetching latest scrobble for user:",n);let i=null;const s=function(h){if(h){if(Array.isArray(h.listens))return h.listens;if(h.payload&&Array.isArray(h.payload.listens))return h.payload.listens;if(h.data&&Array.isArray(h.data.listens))return h.data.listens}};try{const h=`${d.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/playing-now`,D={};a&&(D.Authorization=`Token ${a}`);const A=await this.makeRequest(h,{headers:D}),x=s(A);x&&x.length>0&&(i=x[0],i.playing_now=!0)}catch(h){this.logVerbose("No currently playing track or failed to fetch:",h)}let o;if(i)o=i,this.logVerbose("Using currently playing track");else{const h=`${d.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,D={};a&&(D.Authorization=`Token ${a}`);const A=await this.makeRequest(h,{headers:D}),x=(function(){if(A){if(Array.isArray(A.listens))return A.listens;if(A.payload&&Array.isArray(A.payload.listens))return A.payload.listens;if(A.data&&Array.isArray(A.data.listens))return A.data.listens}})();if(!x||x.length===0)throw new Error("No listens found");o=x[0],this.logVerbose("Using latest completed listen")}this.logVerbose("Raw listen data:",o);const g=!!o.playing_now,b=o.listened_at||Math.floor(Date.now()/1e3);let k=null,U=null;o.track_metadata.additional_info?.duration_ms&&(k=Math.floor(o.track_metadata.additional_info.duration_ms/1e3),g&&k>0&&(U=b+k));const C=null;o.track_metadata.additional_info?.release_mbid;const N={name:o.track_metadata.track_name,artist:o.track_metadata.artist_name,album:o.track_metadata.release_name||"",albumArt:C,url:o.track_metadata.additional_info?.origin_url||`https://listenbrainz.org/player/${o.track_metadata.additional_info?.recording_mbid||`${encodeURIComponent(o.track_metadata.artist_name)}/${encodeURIComponent(o.track_metadata.track_name)}`}`,date:g?"now":new Date(b*1e3).toISOString(),nowPlaying:g,loved:!1,from:b,to:U,duration:k};return this.logVerbose("Processed track:",N),this.log(`${g?"Now playing":"Last played"}:`,`${N.artist} - ${N.name}`),N}catch(n){throw this.logError("Failed to fetch latest listen:",n),n}}},{key:"getErrorMessage",value:function(n){return n.error?n.error:n.message?n.message:n.toString()||"Unknown error"}}]),t})(ae);const O=(function(){function e(){F(this,e),this.serviceInstances=new Map}return B(e,[{key:"getService",value:function(t){this.serviceInstances||(this.serviceInstances=new Map);const n=t||l.service;if(!n)throw new Error("[ServiceFactory] No service type specified and no default service configured");return this.serviceInstances.has(n)||this.serviceInstances.set(n,this.createService(n)),this.serviceInstances.get(n)}},{key:"getCurrentService",value:function(){return this.getService(l.service)}},{key:"createService",value:function(t){switch(t){case"lastfm":return new Ge;case"librefm":return new qe;case"listenbrainz":return new Ye;default:throw new Error(`[ServiceFactory] Unknown service type: ${t}`)}}},{key:"clearCache",value:function(){this.serviceInstances?this.serviceInstances.clear():this.serviceInstances=new Map}},{key:"validateCurrentService",value:function(){return this.getCurrentService().validateCredentials()}},{key:"testService",value:async function(t){try{return await this.getService(t).validateCredentials()}catch(n){return console.error(`[ServiceFactory] Failed to test ${t}:`,n),!1}}},{key:"getSupportedServices",value:function(){return["lastfm","librefm","listenbrainz"]}},{key:"getServiceDisplayName",value:function(t){return this.getService(t).getServiceName()}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e})().getInstance();function he(e){if(!e||e<0)return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),a=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`:`${n}:${a.toString().padStart(2,"0")}`}function ye(){return Math.floor(Date.now()/1e3)}var We=(function(e){return e[e.PLAYING=0]="PLAYING",e[e.STREAMING=1]="STREAMING",e[e.LISTENING=2]="LISTENING",e[e.COMPETING=5]="COMPETING",e})(We||{});const I=function(...e){return console.log("[Scrobble Plugin]",...e)},z=function(...e){return console.error("[Scrobble Plugin] Error:",...e)},L=function(...e){return l.verboseLogging&&console.log("[Scrobble Plugin] Verbose:",...e)},ie=(function(){function e(){F(this,e)}return B(e,[{key:"updateActivity",value:async function(){if(v.pluginStopped){I("Plugin is stopped; skipping activity updates and clearing timers"),L("Plugin is stopped, skipping update");try{this.stopUpdates(),L("Update timers cleared due to stopped plugin")}catch(a){z("Error while stopping updates for stopped plugin:",a)}return}const t=O.getCurrentService().getServiceName();L(`Fetching latest track from ${t}...`);let n=!1;try{if(l.ignoreList&&l.ignoreList.length>0){const o=Fe.findActivity(function(g){return g.name?l.ignoreList.some(function(b){return g.name.toLowerCase().includes(b.toLowerCase())}):!1});if(o){I(`Ignored app (${o.name}) is currently active; clearing activity and skipping updates`),L(`Ignored app (${o.name}) is currently playing, clearing activity`);try{j("ignoredActivity",o.name)}catch(g){L("Failed to set debug info for ignored activity:",g)}ee();return}}de();const a=await O.getCurrentService().fetchLatestScrobble();if(j("lastTrack",a),!a.nowPlaying){I("No currently playing track reported by service; clearing activity and skipping RPC update"),L("Track is not currently playing");try{j("lastTrack_nowPlaying",!1)}catch(o){L("Failed to set debug info for nowPlaying:",o)}ee();return}if(v.lastTrackUrl===a.url){I("Track unchanged; skipping Discord RPC update"),L("Track hasn't changed"),pe(),this.consecutiveFailures=0;return}n=!0,I(`\u{1F3B5} Track changed: ${a.artist} - ${a.name}`);let i;if(a.nowPlaying&&l.showTimestamp&&a.from){const o=ye();let g=a.from;if(g0){const b=Math.min(a.duration*.1,30);g=o-b}else g=o;L("had to estimate start time")}i={start:g*1e3},a.to&&(i.end=a.to*1e3)}L(`\u{1F3AF} Preparing RPC update for: ${a.artist} - ${a.name}`);const s={name:l.appName||d.DEFAULT_APP_NAME,flags:0,type:l.listeningTo?2:0,details:a.name,state:`${a.artist}`,status_display_type:1,application_id:d.APPLICATION_ID};if(s.name.includes("{{")){const o={artist:a.artist,name:a.name,album:a.album,service:t};for(const[g,b]of Object.entries(o))s.name=s.name.replace(new RegExp(`{{${g}}}`,"g"),b||"")}if(i&&(s.timestamps=i,L("Timestamps set:",{start:new Date(i.start).toISOString(),end:i.end?new Date(i.end).toISOString():"none",duration:a.duration?he(a.duration):"unknown"})),a.album||a.albumArt){const o=a.albumArt?[a.albumArt]:[];let g=(await Be(o))[0];if(g){if(s.assets={large_image:g},l.showLargeText){let b="";if(l.showAlbumInTooltip&&a.album&&(b+=`on ${a.album}`),l.showDurationInTooltip&&a.duration){const k=he(a.duration);b?b+=` \u2022 ${k}`:b=k}b&&(s.assets.large_text=b)}L("Album art set:",g),s.assets.large_text&&L("Tooltip text set:",s.assets.large_text)}else a.album&&l.showLargeText&&l.showAlbumInTooltip&&(s.assets={large_text:`on ${a.album}`})}L("Setting Discord activity:",s),j("lastActivity",s),await ge(s),v.lastTrackUrl=a.url,this.currentActivity=s,v.lastActivity=s,this.consecutiveFailures=0,this.lastUpdateTime=ye(),pe(),I(`\u2705 RPC updated successfully: ${a.artist} - ${a.name}`)}catch(a){z("Update failed:",a);try{H(l.service,a.message)}catch(i){z("Failed to record service error:",i)}try{j("lastUpdateError",{message:a.message,service:l.service,lastTrackUrl:v.lastTrackUrl})}catch(i){L("Failed to set debug info for last update error:",i)}this.handleError(a)}}},{key:"handleError",value:function(t){this.consecutiveFailures++,j("lastError",t),z(`Failure ${this.consecutiveFailures}/${d.MAX_RETRY_ATTEMPTS}:`,t.message),this.consecutiveFailures>=d.MAX_RETRY_ATTEMPTS&&(z("Max retry attempts reached, initiating reconnection..."),this.startReconnection())}},{key:"startReconnection",value:function(){var t=this;this.isReconnecting||(this.isReconnecting=!0,this.stopUpdates(),I("Starting reconnection process..."),this.reconnectTimer=setInterval(function(){I("Attempting to reconnect..."),t.initialize().then(function(){I("Reconnection successful!"),t.stopReconnection()}).catch(function(n){z("Reconnection attempt failed:",n.message)})},d.RETRY_DELAY))}},{key:"stopReconnection",value:function(){try{this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=void 0),this.isReconnecting=!1,this.consecutiveFailures=0}catch(t){console.error("[Scrobble Plugin] Reconnection cleanup error:",t)}}},{key:"stopUpdates",value:function(){try{this.updateTimer&&(clearInterval(this.updateTimer),this.updateTimer=void 0)}catch(t){console.error("[Scrobble Plugin] Timer cleanup error:",t)}}},{key:"initialize",value:async function(){var t=this;if(v.pluginStopped)throw new Error("Plugin is stopped");const n=O.getCurrentService().getServiceName();I(`Initializing with ${n}...`);try{if(!await O.validateCurrentService())throw new Error(`Invalid credentials for ${n}`);I(`${n} credentials validated successfully`)}catch(i){throw z(`Failed to validate ${n} credentials:`,i),i}this.stopUpdates(),I("\u{1F3B5} checking for already playing songs..."),await this.updateActivity();const a=Math.max((Number(l.timeInterval)||d.DEFAULT_SETTINGS.timeInterval)*1e3,d.MIN_UPDATE_INTERVAL*1e3);this.updateTimer=setInterval(function(){return t.updateActivity()},a),I(`Update timer started with interval: ${a}ms (${a/1e3}s)`)}},{key:"stop",value:function(){if(!v.pluginStopped){I("Stopping plugin..."),v.pluginStopped=!0;try{this.stopUpdates(),this.stopReconnection(),ee(),I("Plugin stopped successfully")}catch(t){console.error("[Scrobble Plugin] Stop error:",t)}}}},{key:"switchService",value:async function(t){if(v.pluginStopped)return;I(`Switching to ${t}...`);const n=!v.pluginStopped;this.stop();try{O.clearCache(),v.lastTrackUrl=void 0,this.currentActivity=void 0,this.lastUpdateTime=0,n&&(v.pluginStopped=!1,await this.initialize())}catch(a){z("Failed to switch service:",a)}}},{key:"getStatus",value:function(){const t=O.getCurrentService().getServiceName();return{running:!v.pluginStopped,service:t,consecutiveFailures:this.consecutiveFailures,isReconnecting:this.isReconnecting,lastTrackUrl:v.lastTrackUrl,updateInterval:this.updateTimer?"Active":"Inactive"}}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e})().getInstance(),Xe=function(){return ie.initialize()},se=function(){return ie.stop()},He=function(e){return ie.switchService(e)},{ScrollView:M}=V.findByProps("ScrollView"),{TableRowGroup:E,TableSwitchRow:me,TableCheckboxRow:G,Stack:P,TableRow:u}=V.findByProps("TableSwitchRow","TableCheckboxRow","TableRowGroup","Stack","TableRow"),{TextInput:_}=V.findByProps("TextInput");function Qe(){$.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){S.showToast("Testing Last.fm connection...",R.getAssetIDByName("ClockIcon"));try{await Y.testService("lastfm")?S.showToast("\u2705 Last.fm connection successful!",R.getAssetIDByName("CheckIcon")):S.showToast("\u274C Last.fm connection failed",R.getAssetIDByName("XIcon"))}catch{S.showToast("\u274C Connection error",R.getAssetIDByName("XIcon"))}};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:"Last.fm Username",value:c("username"),onChange:function(n){T("username",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"Last.fm API Key",value:c("apiKey"),onChange:function(n){T("apiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(u,{label:"Test Connection",subLabel:"Verify your Last.fm credentials",trailing:r.React.createElement(u.Arrow,null),onPress:t}),r.React.createElement(u,{label:"Get API Key",subLabel:"Create a Last.fm API key at last.fm/api/account/create",trailing:r.React.createElement(u.Arrow,null),onPress:async function(){try{await Z.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),S.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",R.getAssetIDByName("XIcon"))}}}))))}function Je(){$.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){S.showToast("Testing Libre.fm connection...",R.getAssetIDByName("ClockIcon"));try{await Y.testService("librefm")?S.showToast("\u2705 Libre.fm connection successful!",R.getAssetIDByName("CheckIcon")):S.showToast("\u274C Libre.fm connection failed",R.getAssetIDByName("XIcon"))}catch{S.showToast("\u274C Connection error",R.getAssetIDByName("XIcon"))}};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:"Libre.fm Username",value:c("librefmUsername"),onChange:function(n){T("librefmUsername",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"Libre.fm API Key",value:c("librefmApiKey"),onChange:function(n){T("librefmApiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(u,{label:"Test Connection",subLabel:"Verify your Libre.fm credentials",trailing:r.React.createElement(u.Arrow,null),onPress:t}),r.React.createElement(u,{label:"Get API Key",subLabel:"Create a Last.fm API key (compatible with Libre.fm)",trailing:r.React.createElement(u.Arrow,null),onPress:async function(){try{await Z.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),S.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",R.getAssetIDByName("XIcon"))}}}))))}function Ze(){$.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){S.showToast("Testing ListenBrainz connection...",R.getAssetIDByName("ClockIcon"));try{await Y.testService("listenbrainz")?S.showToast("\u2705 ListenBrainz connection successful!",R.getAssetIDByName("CheckIcon")):S.showToast("\u274C ListenBrainz connection failed",R.getAssetIDByName("XIcon"))}catch{S.showToast("\u274C Connection error",R.getAssetIDByName("XIcon"))}};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:"ListenBrainz Username",value:c("listenbrainzUsername"),onChange:function(n){T("listenbrainzUsername",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"ListenBrainz Token",value:c("listenbrainzToken"),onChange:function(n){T("listenbrainzToken",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(u,{label:"Test Connection",subLabel:"Verify your ListenBrainz credentials",trailing:r.React.createElement(u.Arrow,null),onPress:t}),r.React.createElement(u,{label:"Get User Token",subLabel:"Get your ListenBrainz user token at listenbrainz.org/settings/",trailing:r.React.createElement(u.Arrow,null),onPress:async function(){try{await Z.Linking.openURL("https://listenbrainz.org/settings/")}catch(n){console.error("Failed to open ListenBrainz settings URL:",n),S.showToast("Failed to open web browser. Please visit: https://listenbrainz.org/settings/",R.getAssetIDByName("XIcon"))}}}))))}function et(){$.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Activity Display"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:`App Name (Default: ${d.DEFAULT_SETTINGS.appName})`,value:c("appName",d.DEFAULT_SETTINGS.appName),onChange:function(t){T("appName",t),e()},isClearable:!0}),r.React.createElement(_,{placeholder:`Update Interval (Default: ${d.DEFAULT_SETTINGS.timeInterval}s)`,value:String(c("timeInterval",d.DEFAULT_SETTINGS.timeInterval)),onChange:function(t){const n=Number(t);n>=d.MIN_UPDATE_INTERVAL&&(T("timeInterval",n),e())},keyboardType:"numeric",isClearable:!0}))),r.React.createElement(E,{title:"About Display Settings"},r.React.createElement(u,{label:"App Name",subLabel:"The name shown in Discord for your activity"}),r.React.createElement(u,{label:"Update Interval",subLabel:"How often the plugin checks for new tracks (in seconds)"}),r.React.createElement(u,{label:"Minimum Interval",subLabel:`The plugin will never check more frequently than ${d.MIN_UPDATE_INTERVAL} seconds`}))))}function tt(){$.useProxy(p.plugin.storage);const[e,t]=r.React.useState(null),[n,a]=r.React.useState(!0),[i,s]=r.React.useState(0),[o,g]=r.React.useState(!1),b={name:"Bohemian Rhapsody",artist:"Queen",artists:["Queen"],album:"A Night at the Opera",image:null,nowPlaying:!0,duration:354,startTime:Math.floor(Date.now()/1e3)-120},k=function(f){return f?Array.isArray(f)?f.filter(function(y){return y&&typeof y=="string"}):f["#text"]?f["#text"].split(/[,;&]/).map(function(y){return y.trim()}).filter(function(y){return y.length>0}):typeof f=="string"?f.split(/[,;&]/).map(function(y){return y.trim()}).filter(function(y){return y.length>0}):["Unknown Artist"]:["Unknown Artist"]},U=function(f){return!f||f.length===0?"Unknown Artist":f.length===1?f[0]:f.length===2?`${f[0]} & ${f[1]}`:`${f.slice(0,-1).join(", ")} & ${f[f.length-1]}`};r.React.useEffect(function(){(async function(){if(!c("username")||!c("apiKey")){t(b),g(!0),a(!1);return}try{a(!0);const f=await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${c("username")}&api_key=${c("apiKey")}&format=json&limit=1`)).json();if(f.recenttracks&&f.recenttracks.track&&f.recenttracks.track.length>0){const y=f.recenttracks.track[0],K=k(y.artist);let Me=180;try{const gt=K[0]||"Unknown Artist",le=await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=${c("apiKey")}&artist=${encodeURIComponent(gt)}&track=${encodeURIComponent(y.name)}&format=json&u[...]`)).json();le.track&&le.track.duration&&(Me=Math.floor(le.track.duration/1e3))}catch{console.log("Could not fetch track duration, using default")}t({name:y.name||"Unknown Track",artist:U(K),artists:K,album:y.album?.["#text"]||"Unknown Album",image:y.image?.[2]?.["#text"]||y.image?.[1]?.["#text"]||null,nowPlaying:y["@attr"]?.nowplaying==="true",duration:Me,startTime:y["@attr"]?.nowplaying==="true"?Math.floor(Date.now()/1e3)-60:null}),g(!1)}else t(b),g(!0)}catch(f){console.error("Failed to fetch preview data, using fallback:",f),t(b),g(!0)}finally{a(!1)}})()},[c("username"),c("apiKey")]),r.React.useEffect(function(){if(!e?.nowPlaying||!c("showTimestamp"))return;const f=setInterval(function(){if(e.startTime&&e.duration){const y=Math.floor(Date.now()/1e3)-e.startTime,K=Math.min(y/e.duration,1);s(K)}},1e3);return function(){return clearInterval(f)}},[e,c("showTimestamp")]);const C=function(f){const y=Math.floor(f/60),K=Math.floor(f%60);return`${y}:${K.toString().padStart(2,"0")}`},N=function(){let f="";if(c("showAlbumInTooltip")&&e?.album&&(f+=`on ${e.album}`),c("showDurationInTooltip")&&e?.duration){const y=` \u2022 ${C(e.duration)}`;f?f+=y:f=C(e.duration)}return f||"No tooltip text"},h=function(){return e?.duration?e.nowPlaying?{current:i*e.duration,total:e.duration,progress:i}:{current:e.duration*.3,total:e.duration,progress:.3}:{current:0,total:0,progress:0}},D=c("listeningTo")?"Listening to":"Playing",A=c("appName")||"Music",x=c("showLargeText",!0),ut=c("showTimestamp",!1);if(n)return r.React.createElement(r.ReactNative.View,{style:m.container},r.React.createElement(r.ReactNative.View,{style:m.loadingContent},r.React.createElement(r.ReactNative.View,{style:m.loadingSpinner}),r.React.createElement(r.ReactNative.Text,{style:m.loadingText},"Loading preview...")));if(!e)return r.React.createElement(r.ReactNative.View,{style:m.container},r.React.createElement(r.ReactNative.Text,{style:m.centeredText},"Unable to load preview"));const oe=h(),ze=N();return r.React.createElement(r.ReactNative.View,{style:m.previewContainer},r.React.createElement(r.ReactNative.View,{style:m.header},r.React.createElement(r.ReactNative.Text,{style:m.activityType},D," ",A),r.React.createElement(r.ReactNative.Text,{style:m.rpcPreviewText,numberOfLines:1},"RPC Preview")),r.React.createElement(r.ReactNative.View,{style:m.content},r.React.createElement(r.ReactNative.View,{style:m.albumArt},e.image?r.React.createElement(r.ReactNative.Image,{source:{uri:e.image},style:m.albumImage,resizeMode:"cover"}):r.React.createElement(r.ReactNative.Text,{style:m.musicIcon},"\u{1F3B5}")),r.React.createElement(r.ReactNative.View,{style:m.trackInfo},r.React.createElement(r.ReactNative.Text,{style:m.trackName,numberOfLines:1},e.name),r.React.createElement(r.ReactNative.Text,{style:m.artistName,numberOfLines:1},e.artist),x&&ze!=="No tooltip text"&&r.React.createElement(r.ReactNative.Text,{style:m.tooltipText,numberOfLines:1},ze),ut&&e.duration?r.React.createElement(r.ReactNative.View,{style:m.progressContainer},r.React.createElement(r.ReactNative.Text,{style:m.timeText},C(oe.current)),r.React.createElement(r.ReactNative.View,{style:m.progressBar},r.React.createElement(r.ReactNative.View,{style:[m.progressFill,{width:`${oe.progress*100}%`}]})),r.React.createElement(r.ReactNative.Text,{style:m.timeText},C(oe.total))):null)))}const m=r.ReactNative.StyleSheet.create({container:{backgroundColor:"#1e1f22",borderRadius:12,padding:16,marginHorizontal:10,marginBottom:16,borderWidth:1,borderColor:"#3a3c41",alignItems:"center",justifyContent:"center",minHeight:120},loadingContent:{alignItems:"center",justifyContent:"center"},loadingSpinner:{width:20,height:20,borderRadius:10,borderWidth:2,borderColor:"#5865f2",borderTopColor:"transparent",marginBottom:8},previewContainer:{backgroundColor:"#1e1f22",borderRadius:12,padding:16,marginHorizontal:10,marginBottom:16,borderWidth:1,borderColor:"#3a3c41"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,gap:8},content:{flexDirection:"row",alignItems:"center"},albumArt:{width:80,height:80,backgroundColor:"#2b2d31",borderRadius:12,justifyContent:"center",alignItems:"center",marginRight:16,borderWidth:1,borderColor:"#40444b",overflow:"hidden",flexShrink:0},trackInfo:{flex:1,minWidth:0},progressContainer:{flexDirection:"row",alignItems:"center",gap:8,marginTop:6},progressBar:{flex:1,height:2,backgroundColor:"#2b2d31",borderRadius:3,overflow:"hidden"},progressFill:{height:2,backgroundColor:"#5865f2",borderRadius:3},loadingText:{color:"#949ba4",fontSize:14,fontWeight:"500"},centeredText:{color:"#949ba4",fontSize:14,fontWeight:"500",textAlign:"center"},activityType:{color:"#dbdee1",fontSize:14,fontWeight:"600",flex:1},rpcPreviewText:{color:"#80848e",fontSize:12,fontStyle:"italic",flexShrink:0},albumImage:{width:80,height:80,borderRadius:12},musicIcon:{color:"#80848e",fontSize:32},trackName:{color:"#ffffff",fontSize:16,fontWeight:"700",marginBottom:4},artistName:{color:"#b5bac1",fontSize:14,fontWeight:"500",marginBottom:4},tooltipText:{color:"#80848e",fontSize:12,fontStyle:"italic",marginBottom:6},timeText:{color:"#80848e",fontSize:11,fontWeight:"500",minWidth:35,textAlign:"center"}});function rt(){$.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(s){return s+1},0),t=c("listeningTo",d.DEFAULT_SETTINGS.listeningTo),n=c("showTimestamp",d.DEFAULT_SETTINGS.showTimestamp),a=function(){const s=!t;T("listeningTo",s),!s&&n&&T("showTimestamp",!1),e()},i=function(){t&&(T("showTimestamp",!n),e())};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(tt,null),r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"RPC Display Options"},r.React.createElement(G,{label:"Show as Listening",subLabel:"Display as 'Listening to' instead of 'Playing'",checked:t,onPress:a}),r.React.createElement(G,{label:"Show Tooltip Text",subLabel:"Show album name and track duration in Discord activity tooltip",checked:c("showLargeText",!0),onPress:function(){const s=c("showLargeText",!0);T("showLargeText",!s),e()}}),!t&&r.React.createElement(u,{label:"Timestamp Unavailable",subLabel:"Enable 'Show as Listening' to use timestamp feature",disabled:!0,dimmed:!0}),r.React.createElement(G,{label:"Show Timestamp",subLabel:"Display track progress and duration",checked:n,onPress:i,disabled:!t}),r.React.createElement(G,{label:"Show Album in Tooltip",subLabel:"Include album name in the tooltip text",checked:c("showAlbumInTooltip",!0),onPress:function(){const s=c("showAlbumInTooltip",!0);T("showAlbumInTooltip",!s),e()}}),r.React.createElement(G,{label:"Show Duration in Tooltip",subLabel:"Include track duration in the tooltip text",checked:c("showDurationInTooltip",!0),onPress:function(){const s=c("showDurationInTooltip",!0);T("showDurationInTooltip",!s),e()}}))))}function nt(){$.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(s){return s+1},0),[t,n]=r.React.useState(""),a=function(){if(!t.trim()){S.showToast("Please enter an app name",R.getAssetIDByName("Small"));return}const s=c("ignoreList",[]);s.includes(t.trim())?S.showToast("App already in ignore list",R.getAssetIDByName("Warning")):(T("ignoreList",[...s,t.trim()]),n(""),e(),S.showToast("App added to ignore list",R.getAssetIDByName("Check")))},i=function(s){const o=c("ignoreList",[]);T("ignoreList",o.filter(function(g){return g!==s})),e(),S.showToast("App removed from ignore list",R.getAssetIDByName("Check"))};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Add App to Ignore"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:"Enter app name",value:t,onChange:n,isClearable:!0,onSubmitEditing:a,returnKeyType:"done"}))),r.React.createElement(E,null,r.React.createElement(u,{label:"Add to Ignore List",subLabel:"Add the current app name to your ignore list",trailing:r.React.createElement(u.Arrow,null),onPress:a})),c("ignoreList",[]).length>0&&r.React.createElement(E,{title:"Ignored Apps"},c("ignoreList",[]).map(function(s,o){return r.React.createElement(u,{key:o,label:s,trailing:r.React.createElement(r.ReactNative.TouchableOpacity,{onPress:function(){return i(s)},style:{padding:8,backgroundColor:"#ff4d4d",borderRadius:12,width:24,height:24,justifyContent:"center",alignItems:"center"}},r.React.createElement(r.ReactNative.Image,{source:R.getAssetIDByName("TrashIcon"),style:{width:14,height:14,tintColor:"#ffffff"}}))})})),r.React.createElement(E,{title:"About Ignore List"},r.React.createElement(u,{label:"How it Works",subLabel:"When any app in your ignore list is active, your music status will be hidden"}),r.React.createElement(u,{label:"Detection",subLabel:"Apps are detected by their Discord activity name"}),r.React.createElement(u,{label:"Examples",subLabel:"Spotify, YouTube Music, Kizzy, Metrolist, echo"}))))}function at(){$.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Logging Options"},r.React.createElement(me,{label:"Verbose Logging",subLabel:"Enable detailed console logging for debugging",value:c("verboseLogging",d.DEFAULT_SETTINGS.verboseLogging),onValueChange:function(t){T("verboseLogging",t),e()}})),r.React.createElement(E,{title:"Debug Information"},r.React.createElement(u,{label:"Console Logging",subLabel:"Logs are written to the browser/app console when verbose is enabled"}),r.React.createElement(u,{label:"Error Tracking",subLabel:"Connection errors and API failures are automatically logged"})),r.React.createElement(E,{title:"Log Information"},r.React.createElement(u,{label:"API Calls",subLabel:"All API requests are logged when verbose is enabled"}),r.React.createElement(u,{label:"Track Updates",subLabel:"Song changes and RPC updates are logged"}),r.React.createElement(u,{label:"Error Details",subLabel:"Connection errors and retries are logged"}))))}var we,ve,Re,Ee,Se,Te,ke,Ie,Ae,Le,Ce,Pe,Ne,Ue,$e,_e,De;(we=p.plugin.storage).username??(we.username=""),(ve=p.plugin.storage).apiKey??(ve.apiKey=""),(Re=p.plugin.storage).appName??(Re.appName="Music"),(Ee=p.plugin.storage).timeInterval??(Ee.timeInterval=5),(Se=p.plugin.storage).showTimestamp??(Se.showTimestamp=!0),(Te=p.plugin.storage).listeningTo??(Te.listeningTo=!0),(ke=p.plugin.storage).verboseLogging??(ke.verboseLogging=!1),(Ie=p.plugin.storage).service??(Ie.service="lastfm"),(Ae=p.plugin.storage).librefmUsername??(Ae.librefmUsername=""),(Le=p.plugin.storage).librefmApiKey??(Le.librefmApiKey=""),(Ce=p.plugin.storage).listenbrainzUsername??(Ce.listenbrainzUsername=""),(Pe=p.plugin.storage).listenbrainzToken??(Pe.listenbrainzToken=""),(Ne=p.plugin.storage).addToSidebar??(Ne.addToSidebar=!0),(Ue=p.plugin.storage).showLargeText??(Ue.showLargeText=!0),($e=p.plugin.storage).ignoreList??($e.ignoreList=[]),(_e=p.plugin.storage).showAlbumInTooltip??(_e.showAlbumInTooltip=!0),(De=p.plugin.storage).showDurationInTooltip??(De.showDurationInTooltip=!0);const c=function(e,t){return p.plugin.storage[e]??t},T=function(e,t){return p.plugin.storage[e]=t},Y=(function(){function e(){F(this,e)}return B(e,null,[{key:"getServiceDisplayName",value:function(t){switch(t){case"lastfm":return"Last.fm";case"librefm":return"Libre.fm";case"listenbrainz":return"ListenBrainz";default:return"Unknown"}}},{key:"testService",value:async function(t){try{switch(t){case"lastfm":return await this.testLastFmConnection();case"librefm":return await this.testLibreFmConnection();case"listenbrainz":return await this.testListenBrainzConnection();default:return!1}}catch(n){return console.error(`Error testing ${t}:`,n),!1}}},{key:"testLastFmConnection",value:async function(){const t=c("username"),n=c("apiKey");if(!t||!n)return!1;try{return!(await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=${t}&api_key=${n}&format=json`)).json()).error}catch(a){return console.error("Last.fm connection test failed:",a),!1}}},{key:"testLibreFmConnection",value:async function(){const t=c("librefmUsername"),n=c("librefmApiKey");if(!t||!n)return!1;try{return!(await(await fetch(`https://libre.fm/2.0/?method=user.getinfo&user=${t}&api_key=${n}&format=json`)).json()).error}catch(a){return console.error("Libre.fm connection test failed:",a),!1}}},{key:"testListenBrainzConnection",value:async function(){const t=c("listenbrainzUsername"),n=c("listenbrainzToken");if(!t)return!1;try{const a={"Content-Type":"application/json"};return n&&(a.Authorization=`Token ${n}`),(await fetch(`https://api.listenbrainz.org/1/user/${t}/listen-count`,{headers:a})).status===200}catch(a){return console.error("ListenBrainz connection test failed:",a),!1}}}]),e})();function it(){$.useProxy(p.plugin.storage);const e=r.NavigationNative.useNavigation(),[,t]=r.React.useReducer(function(i){return i+1},0),n=c("service"),a=function(i){switch(i){case"lastfm":return c("username")&&c("apiKey")?"\u2705 Configured":"\u274C Missing credentials";case"librefm":return c("librefmUsername")&&c("librefmApiKey")?"\u2705 Configured":"\u274C Missing credentials";case"listenbrainz":return c("listenbrainzUsername")?"\u2705 Configured":"\u274C Missing username";default:return"\u2753 Unknown"}};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Active Service"},r.React.createElement(u,{label:"Current Service",subLabel:n?`Using: ${Y.getServiceDisplayName(n)}`:"No service selected"}),["lastfm","librefm","listenbrainz"].map(function(i){return r.React.createElement(G,{key:i,label:Y.getServiceDisplayName(i),subLabel:a(i),checked:n===i,onPress:function(){i!==n&&(T("service",i),t())}})})),r.React.createElement(E,{title:"Service Configuration"},r.React.createElement(u,{label:"Last.fm Settings",subLabel:"Configure Last.fm credentials and options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Last.fm Settings",render:Qe})}}),r.React.createElement(u,{label:"Libre.fm Settings",subLabel:"Configure Libre.fm credentials and options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Libre.fm Settings",render:Je})}}),r.React.createElement(u,{label:"ListenBrainz Settings",subLabel:"Configure ListenBrainz credentials and options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"ListenBrainz Settings",render:Ze})}})),r.React.createElement(E,{title:"Plugin Configuration"},r.React.createElement(u,{label:"Display Settings",subLabel:"Customize app name and update interval",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Display Settings",render:et})}}),r.React.createElement(u,{label:"RPC Customization",subLabel:"Customize Discord rich presence display options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"RPC Customization",render:rt})}}),r.React.createElement(u,{label:"Ignore List",subLabel:"Configure apps that should hide your status",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Ignore List Settings",render:nt})}}),r.React.createElement(u,{label:"Logging Settings",subLabel:"Configure logging and debugging options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Logging Settings",render:at})}}),r.React.createElement(me,{label:"Add to Sidebar",subLabel:"Show plugin in Discord settings",value:c("addToSidebar",!1),onValueChange:function(i){T("addToSidebar",i),t()},disabled:!0})),r.React.createElement(E,{title:"About"},r.React.createElement(u,{label:"Multi Scrobbler",subLabel:"Show off your music status from multiple services"}),r.React.createElement(u,{label:"Author",subLabel:"kmmiio99o"}),r.React.createElement(u,{label:"Version",subLabel:"1.3.2"}))))}const v={pluginStopped:!1,lastActivity:void 0,updateInterval:void 0,lastTrackUrl:void 0},xe=d.DEFAULT_SETTINGS;Object.keys(xe).forEach(function(e){p.plugin.storage[e]=p.plugin.storage[e]??xe[e]});const l=new Proxy(p.plugin.storage,{get(e,t){return e[t]},set(e,t,n){return e[t]=n,!0}});let J=0;const st=3,ot=5e3;async function W(){try{await Xe(),J=0,console.log("[Multi-Scrobbler] Successfully connected")}catch(e){console.error("[Multi-Scrobbler] Initialization error:",e),J++,J