diff --git a/Commands/index.js b/Commands/index.js index be98599..4efbdf5 100644 --- a/Commands/index.js +++ b/Commands/index.js @@ -1,19 +1,19 @@ -(function(O,Ce,r,p,k,N,u,e,be,b,o,I,ve){"use strict";const Re=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}},Ie=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Ne=async function(){const t=await(await fetch("https://catfact.ninja/fact")).json();return{text:t.fact,length:t.length}},Se=async function(t){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${t.replace("webp","png")}`)).json()},we=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}},W=p.findByProps("sendMessage"),G=function(t){let a=t.text;return r.storage.factSettings?.includeCitation&&t.source&&(a+=` +(function(re,ze,r,p,G,S,u,e,je,b,o,I,v,O,ie,He){"use strict";const Ke=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}},qe=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Ye=async function(){const t=await(await fetch("https://catfact.ninja/fact")).json();return{text:t.fact,length:t.length}},Xe=async function(t){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${t.replace("webp","png")}`)).json()},Je=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}},se=p.findByProps("sendMessage"),oe=function(t){let a=t.text;return r.storage.factSettings?.includeCitation&&t.source&&(a+=` -Source: ${t.source}`),a},Ee={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 Ne(),s=Date.now().toString();return W.sendMessage(a.channel.id,{content:G(n)},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[CatFact] Error:",n),{type:4}}}},Ae={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 Ie(),s=Date.now().toString();return W.sendMessage(a.channel.id,{content:G(n)},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[DogFact] Error:",n),{type:4}}}},De={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 Re(),s=Date.now().toString();return W.sendMessage(a.channel.id,{content:G(n)},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[UselessFact] Error:",n),{type:4}}}},w={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},Te={DETAILED:"detailed"},H="",B={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."},j={SEMICOL:"; ",NEW_LINE:` -`},ke="Nothing to see here, huh...",K="github.com/fres621/vendetta-plugins",S={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},Be=p.findByProps("sendMessage","receiveMessage"),E=p.findByProps("sendBotMessage"),q=(function(){try{return p.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),X=function(t){return Object.keys(t).includes(K)},Y=function(t){return Object.values(t).find(function(a){return a.id==K})?.enabled},J=function(t){return t.find(function(a){return a.name===Te.DETAILED})?.value??!1},$=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(j.SEMICOL)||"Unknown"},Q=function(t){return t.join(j.NEW_LINE).trimEnd()},x=function(t){return Q(t).length},L=async function(t,a){const n=Date.now().toString();await Be.sendMessage(t,{content:Q(a)},void 0,{nonce:n})},Z=function(t,a){return[`**My ${t} List | ${a} ${t}s**`,H]};async function $e(t,a){try{const n=J(t),s=r.storage.themeListAlwaysDetailed??!1;if(!k.themes||typeof k.themes!="object"){const C=a.channel.id;return E.sendBotMessage(C,"No themes found or themes not loaded yet."),{type:4}}const i=Object.values(k.themes),c=a.channel.id,d=Z("Theme",Object.keys(k.themes).length);if(i.length)for(const C of i){if(!C||typeof C!="object")continue;const{selected:y,data:f,id:R}=C,A=f?.name||"Unknown Theme",D=f?.description||"No description",F=f?.authors;n||s?d.push(`> **Name**: ${A}`,`> **Selected**: ${y?S.SELECTED:S.NOT_SELECTED}`,`> **Description**: ${D}`,`> **Authors**: ${$(F)}`,`> **[Install!](${R||"unknown"})**`,H):d.push(`> ${y?S.SELECTED:S.NOT_SELECTED} **${A}** by ${$(F)}`)}else d.push(ke);const g=x(d)>q;if(g&&!X(N.plugins))E.sendBotMessage(c,B.SLM_NOT_INSTALLED);else if(g&&!Y(N.plugins))E.sendBotMessage(c,B.SLM_NOT_ENABLED);else{if(x(d)>2e3)return u.alerts.showConfirmationAlert({content:w.CONTENT,confirmText:w.CONFIRM,cancelText:w.CANCEL,onConfirm:async function(){return await L(c,d)}});await L(c,d)}}catch(n){return console.error("[ThemeList] Error:",n),{type:4}}}async function xe(t,a){try{const n=J(t),s=r.storage.pluginListAlwaysDetailed??!1,i=a.channel.id;if(!N.plugins||typeof N.plugins!="object")return E.sendBotMessage(i,"No plugins found or plugins not loaded yet."),{type:4};const c=Z("Plugin",Object.keys(N.plugins).length);for(const g of Object.values(N.plugins)){if(!g||typeof g!="object")continue;const{enabled:C,manifest:y,id:f}=g,R=y?.name||"Unknown Plugin",A=y?.description||"No description",D=y?.authors;n||s?c.push(`> **Name**: ${R}`,`> **Status**: ${C?S.ENABLED:S.DISABLED}`,`> **Description**: ${A}`,`> **Authors**: ${$(D)}`,`> **[Install!](${f||"unknown"})**`,H):c.push(`> ${C?S.ENABLED:S.DISABLED} **${R}** by ${$(D)}`)}const d=x(c)>q;if(d&&!X(N.plugins))E.sendBotMessage(i,B.SLM_NOT_INSTALLED);else if(d&&!Y(N.plugins))E.sendBotMessage(i,B.SLM_NOT_ENABLED);else{if(x(c)>2e3)return u.alerts.showConfirmationAlert({content:w.CONTENT,confirmText:w.CONFIRM,cancelText:w.CANCEL,onConfirm:async function(){return await L(i,c)}});await L(i,c)}}catch(n){return console.error("[PluginList] Error:",n),{type:4}}}const Le={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:xe,applicationId:"-1",inputType:1,type:1},Pe={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:$e,applicationId:"-1",inputType:1,type:1},Me=p.findByStoreName("UserStore"),_e=p.findByProps("sendMessage"),Ve={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 Me.getUser(t[0].value)).getAvatarURL(512),s=await Se(n),i=Date.now().toString();return _e.sendMessage(a.channel.id,{content:s.url},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[PetPet] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Fe=p.findByProps("sendMessage"),Ue=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),ee=async function(t){const a="https://konachan.com/post.json",n=t?"rating:explicit":"rating:safe",s=Math.floor(Math.random()*100);try{const i=await(await fetch(`${a}?tags=${n}&limit=1&page=${s}`)).json();return!Array.isArray(i)||i.length===0?null:i[0].file_url}catch(i){return console.error("[KonoChan Randomizer] Error fetching image:",i),null}},te=function(){return u.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:null,confirmColor:"brand",isDismissable:!0})},ae={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},Oe={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[ae],execute:async function(t,a){try{const n=new Map(t.map(function(c){return[c.name,c]})).get("nsfw")?.value||!1,s=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSelf] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${s}`),n&&!a.channel.nsfw&&!s)return te(),{type:4};const i=await ee(n);return i?(Ue.sendBotMessage(a.channel.id,`Here's your random image: ${i}`),{type:4}):{type:4}}catch(n){return console.error("[KonoSelf] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},We={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:[ae],execute:async function(t,a){try{const n=new Map(t.map(function(d){return[d.name,d]})).get("nsfw")?.value||!1,s=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSend] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${s}`),n&&!a.channel.nsfw&&!s)return te(),{type:4};const i=await ee(n);if(!i)return{type:4};const c=Date.now().toString();return Fe.sendMessage(a.channel.id,{content:i},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[KonoSend] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},ne=p.findByProps("getAPIBaseURL","get"),Ge=p.findByProps("sendMessage"),P=async function(t,a,n){const s=a?`&author_id=${a}`:"",i=n?`&channel_id=${n}`:"",c=a?"":"&min_id=0";return(await ne.get({url:`/guilds/${t}/messages/search`,query:`include_nsfw=true${s}${i}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},re=async function(t,a){const n=a?`&author_id=${a}`:"",s=a?"":"&min_id=0";return(await ne.get({url:`/channels/${t}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${n}${s}`})).body.messages[0][0]},He={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(R){return[R.name,R]})),s=n.get("user")?.value,i=n.get("channel")?.value,c=n.get("send")?.value,d=a.guild?.id,g=a.channel.id,C=a.channel.type===1;let y="https://discord.com/channels/",f;if(!s&&!i)C?(f=await re(g),y+=`@me/${g}/${f.id}`):(f=await P(d),y+=`${d}/${f.channel_id}/${f.id}`);else if(s)C?(f=await re(g,s),y+=`@me/${g}/${f.id}`):(f=await P(d,s),y+=`${d}/${f.channel_id}/${f.id}`);else if(i){if(C)return{type:4};f=await P(d,null,i),y+=`${d}/${i}/${f.id}`}else{if(C)return{type:4};f=await P(d,s,i),y+=`${d}/${i}/${f.id}`}if(c){const R=Date.now().toString();return Ge.sendMessage(a.channel.id,{content:y},void 0,{nonce:R}),{type:4}}else return e.ReactNative.Linking.openURL(y),{type:4}}catch(n){return console.error("[FirstMessage] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},ze=p.findByProps("sendMessage"),je=p.findByProps("sendBotMessage","sendMessage","receiveMessage");function Ke(){let{height:t,width:a,scale:n}=e.ReactNative.Dimensions.get("screen");return t*=n,a*=n,{width:a,height:t}}function qe(){try{const t=new Date,a=new Date(t.getTime()+t.getTimezoneOffset()*6e4),n=a.getFullYear(),s=String(a.getMonth()+1).padStart(2,"0"),i=String(a.getDate()).padStart(2,"0"),c=String(a.getHours()).padStart(2,"0"),d=String(a.getMinutes()).padStart(2,"0"),g=String(a.getSeconds()).padStart(2,"0");return`${n}-${s}-${i} ${c}:${d}:${g}`}catch{return"Unknown"}}function Xe(){try{const t=p.findByProps("memory");if(!t)return{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"};const{cpuCoreCount:a,cpuPercentage:n,memory:s}=t,i=n?n.toFixed(2)+"%":"N/A",c=s?parseFloat((s/1e3).toPrecision(3))+" MB":"N/A";return{cpuCoreCount:a,cpuPerc:i,memUsage:c}}catch(t){return console.warn("Hardware info unavailable:",t),{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"}}}function Ye(){try{const{NativeModules:t}=e.ReactNative;return(t.InfoDictionaryManager??t.RTNClientInfoManager)||{}}catch(t){return console.warn("Discord info unavailable:",t),{}}}function Je(){try{const{cpuCoreCount:t,cpuPerc:a,memUsage:n}=Xe(),s=Ye(),{vendetta:i,discord:c,react:d,hermes:g,os:C,device:y}=be.getDebugInfo(),f=qe(),{version:R,bytecodeVersion:A}=g||{},{version:D,nativeVersion:F}=d||{},{name:ye,version:Gt,sdk:me}=C||{},{manufacturer:Ht,brand:pe,model:he,codename:zt}=y||{},{version:jt}=i||{},{version:Kt,build:qt}=c||{},Xt=ye=="iOS"?zt:`${pe} ${he}`,{width:Yt,height:Jt}=Ke(),U={Device:{Device:Xt||"Unknown",Model:he||"Unknown",Manufacturer:Ht||"Unknown",Brand:pe||"Unknown",Display:`${Yt}x${Jt}`},Hardware:{"CPU Cores":t||"N/A","CPU Usage":a,"Memory Usage":n},Software:{OS:ye||"Unknown",Version:Gt||"Unknown"},Discord:{Version:Kt||"Unknown",Build:qt||"Unknown",Vendetta:jt||"Unknown"},React:{Version:D||"Unknown","Hermes Bytecode":A||"Unknown",Hermes:R||"Unknown",Native:F||"Unknown"},Time:{UTC:f}};return window.enmity&&(U.Discord.Enmity=window.enmity.version),window.aliucord&&(U.Discord.Aliucord=window.aliucord.version),me&&(U.Software["SDK Version"]=me),U}catch(t){throw console.error("Error generating system info:",t),t}}const se=["device","hardware","software","discord","react","time","ephemeral"];for(const t of se)r.storage[t]===void 0&&(r.storage[t]=!0);function Qe(t,a){try{const n=[`__System Information__ -`],s=Je();Object.keys(s).forEach(function(d){const g=r.storage[d.toLowerCase()],C=t.find(function(y){return y.name==d.toLowerCase()})?.value??g;(C||g)&&!(g&&!C)&&(n.push(`[**${d}**]`),Object.keys(s[d]).forEach(function(y){n.push(`> ${y}: ${s[d][y]}`)}))});const i=r.storage.ephemeral,c=t.find(function(d){return d.name=="ephemeral"})?.value??i;if((c||i)&&!(i&&!c))return je.sendBotMessage(a.channel.id,n.join(` -`)),{type:4};{const d=Date.now().toString();return ze.sendMessage(a.channel.id,{content:n.join(` -`)},void 0,{nonce:d}),{type:4}}}catch(n){return console.error("[Sysinfo] Error:",n),{type:4}}}const Ze={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},...se.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:Qe,applicationId:"-1",inputType:1,type:1},ie=p.findByProps("sendMessage","receiveMessage"),et=p.findByStoreName("SpotifyStore");async function tt(t,a){return r.storage.enabledCommands?.spotifyTrack?M(a,function(n){return`https://open.spotify.com/track/${n.id}`}):{type:4}}async function at(t,a){return r.storage.enabledCommands?.spotifyAlbum?M(a,function(n){return`https://open.spotify.com/album/${n.album.id}`}):{type:4}}async function nt(t,a){return r.storage.enabledCommands?.spotifyArtists?M(a,function(n){return n.artists.map(function(s){return`[${s.name}](${s.external_urls.spotify})`}).join(` -`)}):{type:4}}async function rt(t,a){return r.storage.enabledCommands?.spotifyCover?M(a,function(n){return n.album.image.url}):{type:4}}async function M(t,a){try{const n=t.channel.id,s=et?.getTrack?.();if(!s){const d=Date.now().toString();return ie.sendMessage(n,{content:"You are not listening to any track."},void 0,{nonce:d}),{type:4}}const i=a(s),c=Date.now().toString();return ie.sendMessage(n,{content:i},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[Spotify Command] Error:",n),{type:4}}}const st={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:tt},it={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:at},ot={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},ct={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:rt},lt=p.findByProps("sendMessage"),dt={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 s=await we(n);if(!s)return console.log("[Gary Command] No image URL received"),{type:4};console.log(`[Gary Command] Sending image: ${s}`);const i=Date.now().toString();return lt.sendMessage(a.channel.id,{content:s},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[Gary] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},oe=p.findByProps("sendMessage","receiveMessage"),ut=p.findByProps("getLastSelectedChannelId"),gt=p.findByProps("createBotMessage"),ft=p.findByProps("BOT_AVATARS");function _(t,a,n){const s=t??ut?.getChannelId?.(),i=gt.createBotMessage({channelId:s,content:"",embeds:n});i.author.username="Astolfo",i.author.avatar="Astolfo",ft.BOT_AVATARS.Astolfo="https://i.pinimg.com/736x/50/77/1f/50771f45b1c015cfbb8b0853ba7b8521.jpg",typeof a=="string"?i.content=a:Object.assign(i,a),oe.receiveMessage(s,i)}const yt={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(g){return g.name==="nsfw"})?.value;let s=t.find(function(g){return g.name==="sort"})?.value;const i=t.find(function(g){return g.name==="silent"})?.value;if(typeof s>"u"&&(s=r.storage.sortdefs),!["best","hot","new","rising","top","controversial"].includes(s)){_(a.channel.id,"Incorrect sorting type. Valid options are\n`best`, `hot`, `new`, `rising`, `top`, `controversial`.",[]);return}if(n&&!await new Promise(function(g){u.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 g(!0)},cancelText:"Cancel",onCancel:function(){return g(!1)}})}))return{type:4};let c=await fetch(`https://www.reddit.com/r/femboy/${s}.json?limit=100`).then(function(g){return g.json()});if(!a.channel.nsfw_&&n&&r.storage.nsfwwarn&&!(i??!0)){_(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/${s}.json?limit=100`).then(function(g){return g.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(g){return g.json()});if(i??!0)_(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 g=Date.now().toString();oe.sendMessage(a.channel.id,{content:c?.url_overridden_by_dest??c?.url},void 0,{nonce:g})}}catch(n){console.error("[LoveFemboys] Error:",n),_(a.channel.id,"ERROR !!!!!!!!!!!! \u{1F62D}\u{1F62D}\u{1F62D} Check debug logs!! \u{1F97A}\u{1F97A}\u{1F97A}",[])}}},mt=p.findByProps("sendMessage"),pt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),ht={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(y){return y.name==="query"})?.value,s=t.find(function(y){return y.name==="send"})?.value||!1,i=t.find(function(y){return y.name==="ephemeral"})?.value||!1;if(!n){const y="\u274C Query parameter is required!";return i?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}!i&&!s&&b.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 g=await d.json();if(!g.success){const y=`\u274C Failed to lookup IP information for: ${n}`;return i?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const C=`\`\`\`json -${JSON.stringify(g,null,4)} -\`\`\``;if(i)return{type:4,data:{content:C,flags:64}};if(s){const y=Date.now().toString();return mt.sendMessage(a.channel.id,{content:C},void 0,{nonce:y}),{type:4}}else return pt.sendBotMessage(a.channel.id,C),{type:4}}catch(n){console.error("[IP] Command error:",n);const s=`\u274C An error occurred while looking up IP information: ${n.message||"Unknown error"}`;return t?.find?.(function(i){return i.name==="ephemeral"})?.value??!1?{type:4,data:{content:s,flags:64}}:(b.showToast(s,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Ct=p.findByProps("sendMessage"),bt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),vt=["avatar","classic","cuddle","fox_girl","gecg","holo","kemonomimi","kiss","neko","ngif","smug","spank","tickle","waifu","wallpaper","woof"];async function Rt(t,a){const n=[];for(let s=0;s0&&await new Promise(function(d){return setTimeout(d,1e3)});const i=await fetch(`https://nekos.life/api/v2/img/${t}`);if(!i.ok){console.error(`[NekosLife] API request failed: ${i.status}`);continue}const c=await i.json();c.url&&n.push(c.url)}catch(i){console.error(`[NekosLife] Error fetching image ${s+1}:`,i)}return n}function It(t){return!t||typeof t!="string"?!1:vt.includes(t.toLowerCase().trim())}const Nt={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(f){return f.name==="category"})?.value,s=t.find(function(f){return f.name==="limit"})?.value,i=t.find(function(f){return f.name==="send"})?.value||!1,c=t.find(function(f){return f.name==="ephemeral"})?.value||!1;if(console.log("[NekosLife] Parsed values:",{categoryInput:n,limitInput:s,shouldSend:i,isEphemeral:c}),!n||typeof n!="string"){const f="\u274C Category is required! Examples: neko, waifu, cuddle, kiss";return console.error("[NekosLife] No category provided"),c?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}const d=n.toLowerCase().trim();if(!It(d)){const f=`\u274C Invalid SFW category "${n}". Valid: neko, waifu, cuddle, kiss, holo, etc.`;return c?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}let g=1;s!=null&&(g=parseInt(String(s))||1,g=Math.max(1,Math.min(5,g))),console.log("[NekosLife] Processing SFW request:",{category:d,limit:g,shouldSend:i,isEphemeral:c}),c||b.showToast(`Fetching ${g} SFW image(s) from nekos.life...`,o.getAssetIDByName("DownloadIcon"));const C=await Rt(d,g);if(C.length===0){const f="\u274C Failed to fetch images from nekos.life. Try again later!";return c?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}const y=C.join(` -`);if(c)return console.log("[NekosLife] Sending ephemeral response"),{type:4,data:{content:y,flags:64}};if(i){console.log("[NekosLife] Sending to chat");const f=Date.now().toString();return Ct.sendMessage(a.channel.id,{content:y},void 0,{nonce:f}),{type:4}}else return console.log("[NekosLife] Sending as bot message"),bt.sendBotMessage(a.channel.id,y),{type:4}}catch(n){console.error("[NekosLife] Command error:",n);const s="\u274C An error occurred while fetching images.";return t?.find?.(function(i){return i.name==="ephemeral"})?.value??!1?{type:4,data:{content:s,flags:64}}:(b.showToast(s,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},St=p.findByProps("sendBotMessage","sendMessage"),T=p.findByProps("getAllFriendInvites","createFriendInvite","revokeFriendInvites");p.findByProps("get","post");const wt=p.findByProps("getCurrentUser")?.getCurrentUser;function V(t,a){const n=Date.now().toString();St.sendMessage(t.channel.id,{content:a},void 0,{nonce:n})}const Et={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(!wt?.().phone)return b.showToast("You need a phone number connected to your account!",getAssetIDByName("Small")),{type:4};const n=await T.createFriendInvite({code:null,recipient_phone_number_or_email:null,contact_visibility:0,filter_visibilities:[],filtered_invite_suggestions_index:0});if(n?.code){const s=Math.floor(new Date(n.expires_at).getTime()/1e3),i=`https://discord.gg/${n.code} \xB7 Expires: `;V(a,i),b.showToast("Friend invite created!",getAssetIDByName("Check"))}else throw new Error("No invite code generated");return{type:4}}catch(n){return console.error("[FriendInvite] Create error:",n),b.showToast("Error creating friend invite",getAssetIDByName("Small")),{type:4}}}},At={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 T.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites found",getAssetIDByName("Info")),{type:4};const s=n.map(function(i){const c=Math.floor(new Date(i.expires_at).getTime()/1e3);return`_https://discord.gg/${i.code}_ \xB7 Expires: \xB7 Uses: \`${i.uses}/${i.max_uses}\``});return V(a,`**Your Active Friend Invites:** -${s.join(` -`)}`),{type:4}}catch(n){return console.error("[FriendInvite] View error:",n),b.showToast("Error viewing friend invites",getAssetIDByName("Small")),{type:4}}}},Dt={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 T.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites to revoke",getAssetIDByName("Info")),{type:4};await T.revokeFriendInvites();const s=await T.getAllFriendInvites();return s.length===0?(V(a,`\u2705 Successfully revoked all ${n.length} friend invite(s)!`),b.showToast(`Revoked ${n.length} invite(s)`,getAssetIDByName("Check"))):(V(a,`\u26A0\uFE0F Partially revoked invites. ${s.length} invite(s) remain active.`),b.showToast("Partial revocation",getAssetIDByName("Warning"))),{type:4}}catch(n){return console.error("[FriendInvite] Revoke error:",n),b.showToast("Error revoking friend invites",getAssetIDByName("Small")),{type:4}}}};var ce,le,de,ue,ge,fe;const{ScrollView:v}=e.ReactNative,{FormRow:l,FormSwitchRow:m}=ve.Forms;(ce=r.storage).factSettings??(ce.factSettings={sendAsReply:!0,includeCitation:!1}),(le=r.storage).listSettings??(le.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),(de=r.storage).garySettings??(de.garySettings={imageSource:"gary"}),(ue=r.storage).enabledCommands??(ue.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}),(ge=r.storage).pendingRestart??(ge.pendingRestart=!1),(fe=r.storage).hiddenSettings??(fe.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1});function h({title:t,icon:a,children:n,padding:s=!1}){const i=e.stylesheet.createThemedStyleSheet({main:{backgroundColor:u.semanticColors.CARD_PRIMARY_BG,borderColor:u.semanticColors.BORDER_FAINT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1},titleContainer:{marginBottom:8,marginHorizontal:0,marginTop:8,gap:4,flexDirection:"row",alignItems:"center"},icon:{width:16,height:16,marginTop:1.5,tintColor:u.semanticColors.TEXT_MUTED},titleText:{fontSize:14,fontWeight:"600",color:u.semanticColors.TEXT_MUTED}});return e.React.createElement(e.ReactNative.View,{style:{marginHorizontal:16,marginTop:16}},t&&e.React.createElement(e.ReactNative.View,{style:i.titleContainer},a&&e.React.createElement(e.ReactNative.Image,{style:i.icon,source:a,resizeMode:"cover"}),e.React.createElement(e.ReactNative.Text,{style:i.titleText},t.toUpperCase())),e.React.createElement(e.ReactNative.View,{style:i.main},s?e.React.createElement(e.ReactNative.View,{style:{paddingHorizontal:16,paddingVertical:16}},n):n))}function Tt({onHiddenUnlock:t}){const[a,n]=e.React.useState(0),[s,i]=e.React.useState(null),c=e.stylesheet.createThemedStyleSheet({container:{flexDirection:"column",alignItems:"center",paddingVertical:24,paddingHorizontal:16},title:{fontSize:28,fontWeight:"700",color:u.semanticColors.TEXT_NORMAL,marginBottom:4},subtitle:{fontSize:16,fontWeight:"500",color:u.semanticColors.TEXT_MUTED},iconContainer:{backgroundColor:u.semanticColors.BACKGROUND_SECONDARY,borderRadius:16,padding:12,marginBottom:16},icon:{width:32,height:32,tintColor:u.semanticColors.TEXT_NORMAL}}),d=function(){if(r.storage.hiddenSettings.enabled){r.storage.hiddenSettings.visible=!r.storage.hiddenSettings.visible,b.showToast(`Hidden settings ${r.storage.hiddenSettings.visible?"visible":"hidden"}`,o.getAssetIDByName("SettingsIcon")),t?.();return}s&&clearTimeout(s);const g=setTimeout(function(){n(0)},1e3);i(g);const C=a+1;n(C),!(C<10)&&(b.showToast("\u{1F513} Hidden settings unlocked!",o.getAssetIDByName("CheckmarkIcon")),r.storage.hiddenSettings.enabled=!0,r.storage.hiddenSettings.visible=!0,n(0),t?.())};return e.React.createElement(e.ReactNative.View,{style:c.container},e.React.createElement(e.ReactNative.Pressable,{style:c.iconContainer,onPress:d},e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("SettingsIcon"),style:c.icon})),e.React.createElement(e.ReactNative.Text,{style:c.title},"Commands"),e.React.createElement(e.ReactNative.Text,{style:c.subtitle},"A collection of useful commands"))}function kt(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},tableHeader:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,backgroundColor:u.semanticColors.BACKGROUND_MODIFIER_ACCENT,borderBottomWidth:2,borderBottomColor:u.semanticColors.BORDER_STRONG},headerText:{fontSize:14,fontWeight:"700",color:u.semanticColors.TEXT_NORMAL,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:u.semanticColors.BORDER_FAINT},categoryName:{fontSize:16,fontWeight:"500",color:u.semanticColors.TEXT_NORMAL,flex:2},categoryValue:{fontSize:14,color:u.semanticColors.TEXT_MUTED,fontFamily:"monospace",flex:2,textAlign:"center"},sfwBadgeContainer:{flex:1,alignItems:"center"},sfwBadge:{backgroundColor:u.semanticColors.STATUS_POSITIVE,paddingHorizontal:8,paddingVertical:4,borderRadius:12},badgeText:{fontSize:12,fontWeight:"600",color:u.semanticColors.WHITE},infoText:{fontSize:14,color:u.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(s,i){return s.name.localeCompare(i.name)});return e.React.createElement(v,{style:t.container},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{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,` +Source: ${t.source}`),a},Qe={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 Ye(),i=Date.now().toString();return se.sendMessage(a.channel.id,{content:oe(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[CatFact] Error:",n),{type:4}}}},Ze={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 qe(),i=Date.now().toString();return se.sendMessage(a.channel.id,{content:oe(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[DogFact] Error:",n),{type:4}}}},et={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 Ke(),i=Date.now().toString();return se.sendMessage(a.channel.id,{content:oe(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[UselessFact] Error:",n),{type:4}}}},T={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},tt={DETAILED:"detailed"},ce="",z={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."},pe={SEMICOL:"; ",NEW_LINE:` +`},at="Nothing to see here, huh...",me="github.com/fres621/vendetta-plugins",E={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},nt=p.findByProps("sendMessage","receiveMessage"),D=p.findByProps("sendBotMessage"),he=(function(){try{return p.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),Ce=function(t){return Object.keys(t).includes(me)},be=function(t){return Object.values(t).find(function(a){return a.id==me})?.enabled},Re=function(t){return t.find(function(a){return a.name===tt.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(pe.SEMICOL)||"Unknown"},ve=function(t){return t.join(pe.NEW_LINE).trimEnd()},H=function(t){return ve(t).length},K=async function(t,a){const n=Date.now().toString();await nt.sendMessage(t,{content:ve(a)},void 0,{nonce:n})},Ie=function(t,a){return[`**My ${t} List | ${a} ${t}s**`,ce]};async function rt(t,a){try{const n=Re(t),i=r.storage.themeListAlwaysDetailed??!1;if(!G.themes||typeof G.themes!="object"){const g=a.channel.id;return D.sendBotMessage(g,"No themes found or themes not loaded yet."),{type:4}}const s=Object.values(G.themes),c=a.channel.id,d=Ie("Theme",Object.keys(G.themes).length);if(s.length)for(const g of s){if(!g||typeof g!="object")continue;const{selected:f,data:y,id:C}=g,N=y?.name||"Unknown Theme",A=y?.description||"No description",k=y?.authors;n||i?d.push(`> **Name**: ${N}`,`> **Selected**: ${f?E.SELECTED:E.NOT_SELECTED}`,`> **Description**: ${A}`,`> **Authors**: ${j(k)}`,`> **[Install!](${C||"unknown"})**`,ce):d.push(`> ${f?E.SELECTED:E.NOT_SELECTED} **${N}** by ${j(k)}`)}else d.push(at);const l=H(d)>he;if(l&&!Ce(S.plugins))D.sendBotMessage(c,z.SLM_NOT_INSTALLED);else if(l&&!be(S.plugins))D.sendBotMessage(c,z.SLM_NOT_ENABLED);else{if(H(d)>2e3)return u.alerts.showConfirmationAlert({content:T.CONTENT,confirmText:T.CONFIRM,cancelText:T.CANCEL,onConfirm:async function(){return await K(c,d)}});await K(c,d)}}catch(n){return console.error("[ThemeList] Error:",n),{type:4}}}async function it(t,a){try{const n=Re(t),i=r.storage.pluginListAlwaysDetailed??!1,s=a.channel.id;if(!S.plugins||typeof S.plugins!="object")return D.sendBotMessage(s,"No plugins found or plugins not loaded yet."),{type:4};const c=Ie("Plugin",Object.keys(S.plugins).length);for(const l of Object.values(S.plugins)){if(!l||typeof l!="object")continue;const{enabled:g,manifest:f,id:y}=l,C=f?.name||"Unknown Plugin",N=f?.description||"No description",A=f?.authors;n||i?c.push(`> **Name**: ${C}`,`> **Status**: ${g?E.ENABLED:E.DISABLED}`,`> **Description**: ${N}`,`> **Authors**: ${j(A)}`,`> **[Install!](${y||"unknown"})**`,ce):c.push(`> ${g?E.ENABLED:E.DISABLED} **${C}** by ${j(A)}`)}const d=H(c)>he;if(d&&!Ce(S.plugins))D.sendBotMessage(s,z.SLM_NOT_INSTALLED);else if(d&&!be(S.plugins))D.sendBotMessage(s,z.SLM_NOT_ENABLED);else{if(H(c)>2e3)return u.alerts.showConfirmationAlert({content:T.CONTENT,confirmText:T.CONFIRM,cancelText:T.CANCEL,onConfirm:async function(){return await K(s,c)}});await K(s,c)}}catch(n){return console.error("[PluginList] Error:",n),{type:4}}}const st={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:it,applicationId:"-1",inputType:1,type:1},ot={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:rt,applicationId:"-1",inputType:1,type:1},ct=p.findByStoreName("UserStore"),lt=p.findByProps("sendMessage"),dt={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 ct.getUser(t[0].value)).getAvatarURL(512),i=await Xe(n),s=Date.now().toString();return lt.sendMessage(a.channel.id,{content:i.url},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[PetPet] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},ut=p.findByProps("sendMessage"),gt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),we=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}},Se=function(){return u.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:null,confirmColor:"brand",isDismissable:!0})},Ee={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},ft={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[Ee],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 Se(),{type:4};const s=await we(n);return s?(gt.sendBotMessage(a.channel.id,`Here's your random image: ${s}`),{type:4}):{type:4}}catch(n){return console.error("[KonoSelf] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},yt={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:[Ee],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 Se(),{type:4};const s=await we(n);if(!s)return{type:4};const c=Date.now().toString();return ut.sendMessage(a.channel.id,{content:s},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[KonoSend] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Ne=p.findByProps("getAPIBaseURL","get"),pt=p.findByProps("sendMessage"),mt=async function(t,a,n){const i=a?`&author_id=${a}`:"",s=n?`&channel_id=${n}`:"",c=a?"":"&min_id=0";return(await Ne.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]},ht=async function(t,a){const n=a?`&author_id=${a}`:"",i=a?"":"&min_id=0";return(await Ne.get({url:`/channels/${t}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${n}${i}`})).body.messages[0][0]},Ct={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(C){return[C.name,C]})),i=n.get("user")?.value,s=n.get("channel")?.value,c=n.get("send")?.value,d=a.guild?.id,l=a.channel.id,g=a.channel.type===1;if(g&&s)return{type:4};let f="https://discord.com/channels/",y;if(g)y=await ht(l,i),f+=`@me/${l}/${y.id}`;else{y=await mt(d,i,s);const C=s||y.channel_id;f+=`${d}/${C}/${y.id}`}if(c){const C=Date.now().toString();pt.sendMessage(a.channel.id,{content:f},void 0,{nonce:C})}else e.ReactNative.Linking.openURL(f);return{type:4}}catch(n){return console.error("[FirstMessage] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},bt=p.findByProps("sendMessage"),Rt=p.findByProps("sendBotMessage","sendMessage","receiveMessage");function vt(){let{height:t,width:a,scale:n}=e.ReactNative.Dimensions.get("screen");return t*=n,a*=n,{width:a,height:t}}function It(){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 wt(){try{const t=p.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 St(){try{const{NativeModules:t}=e.ReactNative;return(t.InfoDictionaryManager??t.RTNClientInfoManager)||{}}catch(t){return console.warn("Discord info unavailable:",t),{}}}function Et(){try{const{cpuCoreCount:t,cpuPerc:a,memUsage:n}=wt(),i=St(),{vendetta:s,discord:c,react:d,hermes:l,os:g,device:f}=je.getDebugInfo(),y=It(),{version:C,bytecodeVersion:N}=l||{},{version:A,nativeVersion:k}=d||{},{name:U,version:R,sdk:w}=g||{},{manufacturer:ae,brand:W,model:Oe,codename:wa}=f||{},{version:Sa}=s||{},{version:Ea,build:Na}=c||{},Aa=U=="iOS"?wa:`${W} ${Oe}`,{width:Ta,height:Da}=vt(),ne={Device:{Device:Aa||"Unknown",Model:Oe||"Unknown",Manufacturer:ae||"Unknown",Brand:W||"Unknown",Display:`${Ta}x${Da}`},Hardware:{"CPU Cores":t||"N/A","CPU Usage":a,"Memory Usage":n},Software:{OS:U||"Unknown",Version:R||"Unknown"},Discord:{Version:Ea||"Unknown",Build:Na||"Unknown",Vendetta:Sa||"Unknown"},React:{Version:A||"Unknown","Hermes Bytecode":N||"Unknown",Hermes:C||"Unknown",Native:k||"Unknown"},Time:{UTC:y}};return window.enmity&&(ne.Discord.Enmity=window.enmity.version),window.aliucord&&(ne.Discord.Aliucord=window.aliucord.version),w&&(ne.Software["SDK Version"]=w),ne}catch(t){throw console.error("Error generating system info:",t),t}}const Ae=["device","hardware","software","discord","react","time","ephemeral"];for(const t of Ae)r.storage[t]===void 0&&(r.storage[t]=!0);function Nt(t,a){try{const n=[`__System Information__ +`],i=Et();Object.keys(i).forEach(function(d){const l=r.storage[d.toLowerCase()],g=t.find(function(f){return f.name==d.toLowerCase()})?.value??l;(g||l)&&!(l&&!g)&&(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 Rt.sendBotMessage(a.channel.id,n.join(` +`)),{type:4};{const d=Date.now().toString();return bt.sendMessage(a.channel.id,{content:n.join(` +`)},void 0,{nonce:d}),{type:4}}}catch(n){return console.error("[Sysinfo] Error:",n),{type:4}}}const At={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},...Ae.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:Nt,applicationId:"-1",inputType:1,type:1},Te=p.findByProps("sendMessage","receiveMessage"),Tt=p.findByStoreName("SpotifyStore");async function Dt(t,a){return r.storage.enabledCommands?.spotifyTrack?q(a,function(n){return`https://open.spotify.com/track/${n.id}`}):{type:4}}async function kt(t,a){return r.storage.enabledCommands?.spotifyAlbum?q(a,function(n){return`https://open.spotify.com/album/${n.album.id}`}):{type:4}}async function Bt(t,a){return r.storage.enabledCommands?.spotifyArtists?q(a,function(n){return n.artists.map(function(i){return`[${i.name}](${i.external_urls.spotify})`}).join(` +`)}):{type:4}}async function xt(t,a){return r.storage.enabledCommands?.spotifyCover?q(a,function(n){return n.album.image.url}):{type:4}}async function q(t,a){try{const n=t.channel.id,i=Tt?.getTrack?.();if(!i){const d=Date.now().toString();return Te.sendMessage(n,{content:"You are not listening to any track."},void 0,{nonce:d}),{type:4}}const s=a(i),c=Date.now().toString();return Te.sendMessage(n,{content:s},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[Spotify Command] Error:",n),{type:4}}}const Pt={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:Dt},$t={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:kt},Lt={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:Bt},Ft={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:xt},Mt=p.findByProps("sendMessage"),_t={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 Je(n);if(!i)return console.log("[Gary Command] No image URL received"),{type:4};console.log(`[Gary Command] Sending image: ${i}`);const s=Date.now().toString();return Mt.sendMessage(a.channel.id,{content:i},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[Gary] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},De=p.findByProps("sendMessage","receiveMessage"),Vt=p.findByProps("getLastSelectedChannelId"),Ut=p.findByProps("createBotMessage"),Wt=p.findByProps("BOT_AVATARS");function Y(t,a,n){const i=t??Vt?.getChannelId?.(),s=Ut.createBotMessage({channelId:i,content:"",embeds:n});s.author.username="Astolfo",s.author.avatar="Astolfo",Wt.BOT_AVATARS.Astolfo="https://i.pinimg.com/736x/50/77/1f/50771f45b1c015cfbb8b0853ba7b8521.jpg",typeof a=="string"?s.content=a:Object.assign(s,a),De.receiveMessage(i,s)}const Gt={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)){Y(a.channel.id,"Incorrect sorting type. Valid options are\n`best`, `hot`, `new`, `rising`, `top`, `controversial`.",[]);return}if(n&&!await new Promise(function(l){u.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{type:4};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)){Y(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)Y(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();De.sendMessage(a.channel.id,{content:c?.url_overridden_by_dest??c?.url},void 0,{nonce:l})}}catch(n){console.error("[LoveFemboys] Error:",n),Y(a.channel.id,"ERROR !!!!!!!!!!!! \u{1F62D}\u{1F62D}\u{1F62D} Check debug logs!! \u{1F97A}\u{1F97A}\u{1F97A}",[])}}},Ot=p.findByProps("sendMessage"),zt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),jt={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}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}!s&&!i&&b.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}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}const g=`\`\`\`json +${JSON.stringify(l,null,4)} +\`\`\``;if(s)return{type:4,data:{content:g,flags:64}};if(i){const f=Date.now().toString();return Ot.sendMessage(a.channel.id,{content:g},void 0,{nonce:f}),{type:4}}else return zt.sendBotMessage(a.channel.id,g),{type:4}}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}}:(b.showToast(i,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Ht=p.findByProps("sendMessage"),Kt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),qt=["avatar","classic","cuddle","fox_girl","gecg","holo","kemonomimi","kiss","neko","ngif","smug","spank","tickle","waifu","wallpaper","woof"];async function Yt(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 Xt(t){return!t||typeof t!="string"?!1:qt.includes(t.toLowerCase().trim())}const Jt={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(y){return y.name==="category"})?.value,i=t.find(function(y){return y.name==="limit"})?.value,s=t.find(function(y){return y.name==="send"})?.value||!1,c=t.find(function(y){return y.name==="ephemeral"})?.value||!1;if(console.log("[NekosLife] Parsed values:",{categoryInput:n,limitInput:i,shouldSend:s,isEphemeral:c}),!n||typeof n!="string"){const y="\u274C Category is required! Examples: neko, waifu, cuddle, kiss";return console.error("[NekosLife] No category provided"),c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const d=n.toLowerCase().trim();if(!Xt(d)){const y=`\u274C Invalid SFW category "${n}". Valid: neko, waifu, cuddle, kiss, holo, etc.`;return c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}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||b.showToast(`Fetching ${l} SFW image(s) from nekos.life...`,o.getAssetIDByName("DownloadIcon"));const g=await Yt(d,l);if(g.length===0){const y="\u274C Failed to fetch images from nekos.life. Try again later!";return c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const f=g.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 y=Date.now().toString();return Ht.sendMessage(a.channel.id,{content:f},void 0,{nonce:y}),{type:4}}else return console.log("[NekosLife] Sending as bot message"),Kt.sendBotMessage(a.channel.id,f),{type:4}}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}}:(b.showToast(i,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Qt=p.findByProps("sendBotMessage","sendMessage"),B=p.findByProps("getAllFriendInvites","createFriendInvite","revokeFriendInvites");p.findByProps("get","post");const Zt=p.findByProps("getCurrentUser")?.getCurrentUser;function X(t,a){const n=Date.now().toString();Qt.sendMessage(t.channel.id,{content:a},void 0,{nonce:n})}const ea={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(!Zt?.().phone)return b.showToast("You need a phone number connected to your account!",getAssetIDByName("Small")),{type:4};const n=await B.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: `;X(a,s),b.showToast("Friend invite created!",getAssetIDByName("Check"))}else throw new Error("No invite code generated");return{type:4}}catch(n){return console.error("[FriendInvite] Create error:",n),b.showToast("Error creating friend invite",getAssetIDByName("Small")),{type:4}}}},ta={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 B.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites found",getAssetIDByName("Info")),{type:4};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 X(a,`**Your Active Friend Invites:** +${i.join(` +`)}`),{type:4}}catch(n){return console.error("[FriendInvite] View error:",n),b.showToast("Error viewing friend invites",getAssetIDByName("Small")),{type:4}}}},aa={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 B.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites to revoke",getAssetIDByName("Info")),{type:4};await B.revokeFriendInvites();const i=await B.getAllFriendInvites();return i.length===0?(X(a,`\u2705 Successfully revoked all ${n.length} friend invite(s)!`),b.showToast(`Revoked ${n.length} invite(s)`,getAssetIDByName("Check"))):(X(a,`\u26A0\uFE0F Partially revoked invites. ${i.length} invite(s) remain active.`),b.showToast("Partial revocation",getAssetIDByName("Warning"))),{type:4}}catch(n){return console.error("[FriendInvite] Revoke error:",n),b.showToast("Error revoking friend invites",getAssetIDByName("Small")),{type:4}}}};function na(){const[t,a]=e.React.useState(0),[n,i]=e.React.useState(null),[s,c]=e.React.useState(null),[d,l]=e.React.useState(!1);e.React.useEffect(function(){r.storage.sidebarEnabled===void 0&&(r.storage.sidebarEnabled=!0)},[]);const g=p.findByProps("getUser","getCurrentUser")?.getCurrentUser?.(),{getUserAvatarURL:f}=p.findByProps("getUserAvatarURL")||{},{getDefaultAvatarURL:y}=p.findByProps("getDefaultAvatarURL")||{},C=e.stylesheet.createThemedStyleSheet({container:{flexDirection:"row",alignItems:"center",paddingVertical:24,paddingHorizontal:16,width:"100%",justifyContent:"center"},leftSection:{flexDirection:"row",alignItems:"center",flex:1,gap:20,maxWidth:500},avatarContainer:{position:"relative",width:96,height:96,justifyContent:"center",alignItems:"center"},avatarWrapper:{width:96,height:96,borderRadius:24,backgroundColor:u.semanticColors.BACKGROUND_SECONDARY,justifyContent:"center",alignItems:"center",overflow:"hidden",borderWidth:2,borderColor:u.semanticColors.BACKGROUND_TERTIARY},avatar:{width:92,height:92,borderRadius:22},cogwheelBackground:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:24,justifyContent:"center",alignItems:"center",opacity:0},cogwheelIcon:{width:32,height:32,tintColor:u.semanticColors.INTERACTIVE_ACTIVE},textContainer:{flex:1,marginLeft:4},title:{fontSize:28,fontWeight:"700",color:u.semanticColors.MOBILE_TEXT_HEADING_PRIMARY,marginBottom:4,textAlign:"left"},subtitle:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"left",lineHeight:20},avatarPlaceholder:{width:48,height:48,tintColor:u.semanticColors.INTERACTIVE_NORMAL},animatedIndicator:{position:"absolute",top:8,right:8,backgroundColor:"rgba(0, 0, 0, 0.7)",borderRadius:10,width:20,height:20,justifyContent:"center",alignItems:"center",zIndex:1},gifText:{color:"#FFFFFF",fontSize:10,fontWeight:"bold"}});e.React.useEffect(function(){if(g){let R,w=!1;const ae=g.avatar?.startsWith("a_");if(f&&g.avatar)R=f(g,ae),w=ae;else if(y)R=y(g);else if(g.avatar){const W=g.avatar.startsWith("a_");R=`https://cdn.discordapp.com/avatars/${g.id}/${g.avatar}.${W?"gif":"png"}?size=256`,w=W}else R=`https://cdn.discordapp.com/embed/avatars/${g.discriminator?parseInt(g.discriminator)%5:(parseInt(g.id)>>22)%6}.png`;c(R),l(w)}},[g]);const N=function(){if(r.storage.hiddenSettings?.enabled){r.storage.hiddenSettings.visible=!r.storage.hiddenSettings.visible,b.showToast(`Hidden settings ${r.storage.hiddenSettings.visible?"visible":"hidden"}`,o.getAssetIDByName("SettingsIcon"));return}n&&clearTimeout(n);const R=setTimeout(function(){a(0)},1e3);i(R);const w=t+1;a(w),!(w<10)&&(b.showToast("Hidden settings unlocked!",o.getAssetIDByName("CheckmarkIcon")),r.storage.hiddenSettings={...r.storage.hiddenSettings,enabled:!0,visible:!0},a(0))},A=function(){const R=!r.storage.sidebarEnabled;r.storage.sidebarEnabled=R,r.storage.pendingRestart=!0,b.showToast(`Sidebar ${R?"enabled":"disabled"}. Restart Discord to apply.`,o.getAssetIDByName(R?"CheckmarkIcon":"XIcon"))},[k,U]=e.React.useState(!1);return e.React.createElement(e.ReactNative.View,{style:C.container},e.React.createElement(e.ReactNative.View,{style:C.leftSection},e.React.createElement(e.ReactNative.Pressable,{style:C.avatarContainer,onPress:N,onPressIn:function(){return U(!0)},onPressOut:function(){return U(!1)},delayLongPress:500,onLongPress:A},e.React.createElement(e.ReactNative.View,{style:C.avatarWrapper},s?e.React.createElement(e.React.Fragment,null,e.React.createElement(e.ReactNative.Image,{source:{uri:s},style:C.avatar,resizeMode:"cover"}),d&&e.React.createElement(e.ReactNative.View,{style:C.animatedIndicator},e.React.createElement(e.ReactNative.Text,{style:C.gifText},"GIF"))):e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("ic_account_circle_24px"),style:C.avatarPlaceholder})),e.React.createElement(e.ReactNative.View,{style:[C.cogwheelBackground,{opacity:k?.8:0}]},e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("SettingsIcon"),style:C.cogwheelIcon}))),e.React.createElement(e.ReactNative.View,{style:C.textContainer},e.React.createElement(e.ReactNative.Text,{style:C.title},"Commands"),e.React.createElement(e.ReactNative.Text,{style:C.subtitle},"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:u.rawColors.PLUM_18,borderColor:u.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:u.semanticColors.TEXT_MUTED},titleText:{fontSize:14,fontWeight:"600",color:u.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:x,FormRow:P}=v.Forms;function ra(){I.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:u.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(x,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("ArrowAngleLeftUpIcon")}),value:r.storage.factSettings.sendAsReply,onValueChange:function(a){r.storage.factSettings.sendAsReply=a}}),e.React.createElement(x,{label:"Include Source Citation",subLabel:"Include the source of facts when available",leading:e.React.createElement(P.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(x,{label:"/catfact",subLabel:"Get random cat facts",leading:e.React.createElement(P.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(x,{label:"/dogfact",subLabel:"Get random dog facts",leading:e.React.createElement(P.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(x,{label:"/useless",subLabel:"Get random useless facts",leading:e.React.createElement(P.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:J,FormRow:Q}=v.Forms;function ia(){I.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:u.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(J,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("PuzzlePieceIcon")}),value:r.storage.listSettings.pluginListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.pluginListAlwaysDetailed=a}}),e.React.createElement(J,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",leading:e.React.createElement(Q.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(J,{label:"/plugin-list",subLabel:"List all installed plugins",leading:e.React.createElement(Q.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(J,{label:"/theme-list",subLabel:"List all installed themes",leading:e.React.createElement(Q.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:le,FormRow:de}=v.Forms;function sa(){I.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:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Image Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(le,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",leading:e.React.createElement(de.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(le,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",leading:e.React.createElement(de.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(le,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",leading:e.React.createElement(de.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:$,FormRow:L}=v.Forms;function oa(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(i){return i+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:16,textAlign:"center"},currentText:{fontSize:14,color:u.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($,{label:"/gary",subLabel:"Send random Gary images to channel",leading:e.React.createElement(L.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($,{label:"Gary API",subLabel:"Original Gary the cat images from api.garythe.cat",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="gary",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="gary",t())}}),e.React.createElement($,{label:"Cat API",subLabel:"Random cat pictures from thecatapi.com",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="catapi",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="catapi",t())}}),e.React.createElement($,{label:"Minker API",subLabel:"Minky images from minky.materii.dev",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="minker",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="minker",t())}}),e.React.createElement($,{label:"Goober API",subLabel:"Goober images from api.garythe.cat/goober",leading:e.React.createElement(L.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:Z,FormRow:ee}=v.Forms;function ca(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20}});return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Spotify Commands",icon:o.getAssetIDByName("SpotifyNeutralIcon")},e.React.createElement(Z,{label:"/spotify track",subLabel:"Share your current Spotify track",leading:e.React.createElement(ee.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(Z,{label:"/spotify album",subLabel:"Share your current track's album",leading:e.React.createElement(ee.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(Z,{label:"/spotify artists",subLabel:"Share your current track's artists",leading:e.React.createElement(ee.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(Z,{label:"/spotify cover",subLabel:"Share your current track's cover",leading:e.React.createElement(ee.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 la(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},tableHeader:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,backgroundColor:u.semanticColors.BACKGROUND_MODIFIER_ACCENT,borderBottomWidth:2,borderBottomColor:u.semanticColors.BORDER_STRONG},headerText:{fontSize:14,fontWeight:"700",color:u.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:u.semanticColors.BORDER_FAINT},categoryName:{fontSize:16,fontWeight:"500",color:u.semanticColors.HEADER_PRIMARY,flex:2},categoryValue:{fontSize:14,color:u.semanticColors.TEXT_MUTED,fontFamily:"monospace",flex:2,textAlign:"center"},sfwBadgeContainer:{flex:1,alignItems:"center"},sfwBadge:{backgroundColor:u.semanticColors.STATUS_POSITIVE,paddingHorizontal:8,paddingVertical:4,borderRadius:12},badgeText:{fontSize:12,fontWeight:"600",color:u.semanticColors.TEXT_NORMAL},infoText:{fontSize:14,color:u.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(h,{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(s,i){return e.React.createElement(e.ReactNative.View,{key:i,style:t.categoryItem},e.React.createElement(e.ReactNative.Text,{style:t.categoryName},s.name),e.React.createElement(e.ReactNative.Text,{style:t.categoryValue},s.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"))))}))))}function Bt(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0);e.NavigationNative.useNavigation();const a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},warningText:{fontSize:14,color:u.semanticColors.TEXT_DANGER,textAlign:"center",lineHeight:20,fontWeight:"600"},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20,marginTop:8}});return e.React.createElement(v,{style:a.container},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{title:"\u26A0\uFE0F 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(h,{title:"Hidden Commands",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(m,{label:"/lovefemboys",subLabel:"Get random femboy images from r/femboys (NSFW content available)",leading:e.React.createElement(l.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(h,{title:"NSFW Bypass Options",icon:o.getAssetIDByName("WarningIcon")},e.React.createElement(m,{label:"KonoChan NSFW Bypass",subLabel:"Allow NSFW KonoChan content in non-NSFW channels (USE WITH CAUTION)",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("ShieldIcon")}),value:r.storage.hiddenSettings.konochanBypassNsfw,onValueChange:function(n){n?u.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(h,{title:"Hidden Settings Control",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(m,{label:"Keep Hidden Settings Visible",subLabel:"Keep this section visible even when navigating away",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("EyeIcon")}),value:r.storage.hiddenSettings.visible,onValueChange:function(n){r.storage.hiddenSettings.visible=n}}),e.React.createElement(l,{label:"Reset Hidden Settings",subLabel:"Hide this section and disable all hidden commands",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("TrashIcon")}),onPress:function(){u.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,b.showToast("Hidden settings reset",o.getAssetIDByName("CheckmarkIcon"))},cancelText:"Cancel"})}}))))}function $t(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(v,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY}},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{title:"Fact Display Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(m,{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(m,{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(h,{title:"Available Fact Commands",icon:o.getAssetIDByName("BookmarkIcon")},e.React.createElement(m,{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(m,{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(m,{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()}}))))}function xt(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(s){return s+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:16,textAlign:"center"},currentText:{fontSize:14,color:u.semanticColors.TEXT_NORMAL,textAlign:"center",fontWeight:"600"}}),n=r.storage.garySettings.imageSource;return e.React.createElement(v,{style:a.container},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{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(l.Icon,{source:o.getAssetIDByName("AttachmentIcon")}),value:r.storage.enabledCommands.gary,onValueChange:function(s){r.storage.enabledCommands.gary=s,r.storage.pendingRestart=!0,t()}})),e.React.createElement(h,{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(h,{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(l.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="gary",onValueChange:function(s){s&&(r.storage.garySettings.imageSource="gary",t())}}),e.React.createElement(m,{label:"Cat API",subLabel:"Random cat pictures from thecatapi.com",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="catapi",onValueChange:function(s){s&&(r.storage.garySettings.imageSource="catapi",t())}}),e.React.createElement(m,{label:"Minker API",subLabel:"Minky images from minky.materii.dev",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="minker",onValueChange:function(s){s&&(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(l.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="goober",onValueChange:function(s){s&&(r.storage.garySettings.imageSource="goober",t())}})),e.React.createElement(h,{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"))))}function Lt(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(v,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY}},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{title:"List Display Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(m,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("PuzzlePieceIcon")}),value:r.storage.listSettings.pluginListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.pluginListAlwaysDetailed=a}}),e.React.createElement(m,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("PaintPaletteIcon")}),value:r.storage.listSettings.themeListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.themeListAlwaysDetailed=a}})),e.React.createElement(h,{title:"Available List Commands",icon:o.getAssetIDByName("ListViewIcon")},e.React.createElement(m,{label:"/plugin-list",subLabel:"List all installed plugins",leading:e.React.createElement(l.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(m,{label:"/theme-list",subLabel:"List all installed themes",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("PaintPaletteIcon")}),value:r.storage.enabledCommands.themeList,onValueChange:function(a){r.storage.enabledCommands.themeList=a,r.storage.pendingRestart=!0,t()}}))))}function Pt(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(v,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY}},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{title:"Image Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(m,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",leading:e.React.createElement(l.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(h,{title:"KonoChan Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(m,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",leading:e.React.createElement(l.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(m,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:r.storage.enabledCommands.konosend,onValueChange:function(a){r.storage.enabledCommands.konosend=a,r.storage.pendingRestart=!0,t()}}))))}function Mt(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20}});return e.React.createElement(v,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY}},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{title:"Spotify Commands",icon:o.getAssetIDByName("SpotifyNeutralIcon")},e.React.createElement(m,{label:"/spotify track",subLabel:"Share your current Spotify track",leading:e.React.createElement(l.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(m,{label:"/spotify album",subLabel:"Share your current track's album",leading:e.React.createElement(l.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(m,{label:"/spotify artists",subLabel:"Share your current track's artists",leading:e.React.createElement(l.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(m,{label:"/spotify cover",subLabel:"Share your current track's cover",leading:e.React.createElement(l.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(h,{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 _t(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(v,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY}},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{title:"Message Commands",icon:o.getAssetIDByName("ChatIcon")},e.React.createElement(m,{label:"/firstmessage",subLabel:"Get the first message in a channel",leading:e.React.createElement(l.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(h,{title:"System Commands",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(m,{label:"/sysinfo",subLabel:"Display system information",leading:e.React.createElement(l.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(h,{title:"Friend Invites",icon:o.getAssetIDByName("UserAddIcon")},e.React.createElement(m,{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(m,{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(m,{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()}}))))}function Vt(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.NavigationNative.useNavigation();return e.React.createElement(v,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY}},e.React.createElement(h,{title:"IP Commands",icon:o.getAssetIDByName("GlobeEarthIcon")},e.React.createElement(m,{label:"/ip",subLabel:"Get your current IP address",leading:e.React.createElement(l.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(h,{title:"NekosLife Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(m,{label:"/nekoslife",subLabel:"Get images/gifs from nekos.life",leading:e.React.createElement(l.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(l,{label:"View Categories",subLabel:"See all 16 available categories",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("BookOpenIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return a.push("VendettaCustomPage",{title:"NekosLife Categories",render:kt})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}}))}function Ft(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},creditItem:{flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:20,backgroundColor:u.semanticColors.CARD_PRIMARY_BG,borderRadius:12,marginHorizontal:16,marginVertical:6,shadowColor:u.semanticColors.BLACK,shadowOffset:{width:0,height:1},shadowOpacity:.1,shadowRadius:2,elevation:2},avatar:{width:48,height:48,borderRadius:24,marginRight:16,backgroundColor:u.semanticColors.BACKGROUND_SECONDARY},textContainer:{flex:1},commandText:{fontSize:17,fontWeight:"600",color:u.semanticColors.TEXT_NORMAL,marginBottom:4},authorText:{fontSize:15,color:u.semanticColors.TEXT_MUTED,marginBottom:2},linkText:{fontSize:13,color:u.semanticColors.TEXT_BRAND,fontWeight:"500"},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:20,textAlign:"center",lineHeight:20},versionText:{fontSize:15,color:u.semanticColors.TEXT_NORMAL,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(s){e.ReactNative.Linking.openURL(s)};return e.React.createElement(v,{style:t.container},e.React.createElement(e.ReactNative.View,{style:{paddingVertical:16}},e.React.createElement(h,{title:"Plugin Authors",icon:o.getAssetIDByName("HeartIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.infoText},"Thanks to this developers for creating such a nice plugins!",` -`,"Tap on any developer to visit their GitHub profile.")),a.map(function(s,i){return e.React.createElement(e.ReactNative.Pressable,{key:i,style:t.creditItem,onPress:function(){return n(s.github)},android_ripple:{color:u.semanticColors.ANDROID_RIPPLE,radius:200}},e.React.createElement(e.ReactNative.Image,{source:{uri:s.avatar},style:t.avatar}),e.React.createElement(e.ReactNative.View,{style:t.textContainer},e.React.createElement(e.ReactNative.Text,{style:t.commandText},s.command),e.React.createElement(e.ReactNative.Text,{style:t.authorText},"by ",s.author),e.React.createElement(e.ReactNative.Text,{style:t.linkText},s.github.replace("https://github.com/","@"))))}),e.React.createElement(h,{title:"About",icon:o.getAssetIDByName("InfoIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.versionText},"Commands Plugin Collection",` -`,"Version 1.2.1"))))}function Ut(){I.useProxy(r.storage);const t=e.NavigationNative.useNavigation(),[,a]=e.React.useReducer(function(n){return n+1},0);return e.React.useEffect(function(){return function(){r.storage.pendingRestart&&(r.storage.pendingRestart=!1,u.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null}))}},[]),e.React.createElement(v,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY}},e.React.createElement(Tt,{onHiddenUnlock:a}),e.React.createElement(h,{title:"Command Categories",icon:o.getAssetIDByName("ChannelListIcon")},e.React.createElement(l,{label:"Facts Commands",subLabel:"Cat facts, dog facts, and useless facts",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("BookmarkIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Facts Commands",render:$t})}}),e.React.createElement(l,{label:"List Commands",subLabel:"Plugin lists and theme lists",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("ListViewIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"List Commands",render:Lt})}}),e.React.createElement(l,{label:"Image Commands",subLabel:"PetPet, KonoChan, and image utilities",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("ImageIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Image Commands",render:Pt})}}),e.React.createElement(l,{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(l.Icon,{source:o.getAssetIDByName("CameraIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Gary Commands",render:xt})}}),e.React.createElement(l,{label:"Spotify Commands",subLabel:"Share your Spotify activity",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Spotify Commands",render:Mt})}}),e.React.createElement(l,{label:"Aliucord Commands",subLabel:"Commands from Aliucord",leading:e.React.createElement(l.Icon,{source:{uri:"https://avatars.githubusercontent.com/u/78881422?s=200&v=4"}}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Aliucord",render:Vt})}}),e.React.createElement(l,{label:"Other Commands",subLabel:"Utility and system commands",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("WrenchIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Other Commands",render:_t})}})),r.storage.hiddenSettings?.visible&&e.React.createElement(h,{title:"\u{1F513} Hidden Settings",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(l,{label:"Hidden Commands",subLabel:"Access to experimental and NSFW commands",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("EyeIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Hidden Settings",render:Bt})}})),e.React.createElement(h,{title:"\u{1F3F7}\uFE0F Other",icon:o.getAssetIDByName("InformationIcon")},e.React.createElement(l,{label:"Credits",subLabel:"View original authors of the plugins",leading:e.React.createElement(l.Icon,{source:o.getAssetIDByName("HeartIcon")}),trailing:e.React.createElement(l.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Credits",render:Ft})}})),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 Ot={catfact:Ee,dogfact:Ae,useless:De,petpet:Ve,pluginList:Le,themeList:Pe,konoself:Oe,konosend:We,firstmessage:He,sysinfo:Ze,spotifyTrack:st,spotifyAlbum:it,spotifyArtists:ot,spotifyCover:ct,gary:dt,ip:ht,lovefemboys:yt,nekoslife:Nt,friendInviteCreate:Et,friendInviteView:At,friendInviteRevoke:Dt};let z=[];var Wt={onLoad:function(){for(const[t,a]of Object.entries(Ot))r.storage.enabledCommands[t]&&z.push(Ce.registerCommand(a))},onUnload:function(){z.forEach(function(t){return t()}),z=[]},settings:Ut};return O.default=Wt,Object.defineProperty(O,"__esModule",{value:!0}),O})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.debug,vendetta.ui.toasts,vendetta.ui.assets,vendetta.storage,vendetta.ui.components); +`,"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:ke,FormRow:F}=v.Forms;function da(){I.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:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"IP Commands",icon:o.getAssetIDByName("GlobeEarthIcon")},e.React.createElement(ke,{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(ke,{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:la})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}}))}const{FormSwitchRow:M,FormRow:Be}=v.Forms;function ua(){I.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:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Message Commands",icon:o.getAssetIDByName("ChatIcon")},e.React.createElement(M,{label:"/firstmessage",subLabel:"Get the first message in a channel",leading:e.React.createElement(Be.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(M,{label:"/sysinfo",subLabel:"Display system information",leading:e.React.createElement(Be.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(M,{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(M,{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(M,{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:ue,FormRow:_}=v.Forms;function ga(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},warningText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20,fontWeight:"600"},infoText:{fontSize:14,color:u.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(ue,{label:"/lovefemboys",subLabel:"Get random femboy images from r/femboys (NSFW content available)",leading:e.React.createElement(_.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(ue,{label:"KonoChan NSFW Bypass",subLabel:"Allow NSFW KonoChan content in non-NSFW channels (USE WITH CAUTION)",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("ShieldIcon")}),value:r.storage.hiddenSettings.konochanBypassNsfw,onValueChange:function(n){n?u.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(ue,{label:"Keep Hidden Settings Visible",subLabel:"Keep this section visible even when navigating away",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("EyeIcon")}),value:r.storage.hiddenSettings.visible,onValueChange:function(n){r.storage.hiddenSettings.visible=n}}),e.React.createElement(_,{label:"Reset Hidden Settings",subLabel:"Hide this section and disable all hidden commands",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("TrashIcon")}),onPress:function(){u.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,b.showToast("Hidden settings reset",o.getAssetIDByName("CheckmarkIcon"))},cancelText:"Cancel"})}})))}function fa(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},scrollContent:{paddingVertical:16,paddingHorizontal:12,alignItems:"stretch"},groupWrapper:{marginHorizontal:16,marginTop:16,maxWidth:"100%"},groupMain:{backgroundColor:u.rawColors.PLUM_18,borderColor:u.semanticColors.CARD_BACKGROUND_DEFAULT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1,maxWidth:"100%"},cardPressable:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:12},avatarContainer:{width:56,height:56,borderRadius:12,overflow:"hidden",backgroundColor:u.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:u.semanticColors.MOBILE_TEXT_HEADING_PRIMARY,marginBottom:2},authorText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:6},linkText:{fontSize:13,color:u.semanticColors.LINK,fontWeight:"600"},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:20,textAlign:"center",lineHeight:20},versionText:{fontSize:15,color:u.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:u.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 xe,Pe,$e,Le,Fe,Me,_e;const{FormRow:h}=v.Forms;(xe=r.storage).factSettings??(xe.factSettings={sendAsReply:!0,includeCitation:!1}),(Pe=r.storage).listSettings??(Pe.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),($e=r.storage).garySettings??($e.garySettings={imageSource:"gary"}),(Le=r.storage).enabledCommands??(Le.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}),(Fe=r.storage).pendingRestart??(Fe.pendingRestart=!1),(Me=r.storage).hiddenSettings??(Me.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1}),(_e=r.storage).sidebarEnabled??(_e.sidebarEnabled=!0);function Ve(){I.useProxy(r.storage);const t=e.NavigationNative.useNavigation();return e.React.useEffect(function(){return function(){r.storage.pendingRestart&&(r.storage.pendingRestart=!1,u.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:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,maxWidth:"100%"},showsVerticalScrollIndicator:!1},e.React.createElement(na,null),e.React.createElement(m,{title:"Command Categories",icon:o.getAssetIDByName("ChannelListIcon")},e.React.createElement(h,{label:"Facts Commands",subLabel:"Cat facts, dog facts, and useless facts",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("BookmarkIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Facts Commands",render:ra})}}),e.React.createElement(h,{label:"List Commands",subLabel:"Plugin lists and theme lists",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("ListViewIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"List Commands",render:ia})}}),e.React.createElement(h,{label:"Image Commands",subLabel:"PetPet, KonoChan, and image utilities",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("ImageIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Image Commands",render:sa})}}),e.React.createElement(h,{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(h.Icon,{source:o.getAssetIDByName("CameraIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Gary Commands",render:oa})}}),e.React.createElement(h,{label:"Spotify Commands",subLabel:"Share your Spotify activity",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Spotify Commands",render:ca})}}),e.React.createElement(h,{label:"Aliucord Commands",subLabel:"Commands from Aliucord",leading:e.React.createElement(h.Icon,{source:{uri:"https://avatars.githubusercontent.com/u/78881422?s=200&v=4"}}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Aliucord",render:da})}}),e.React.createElement(h,{label:"Other Commands",subLabel:"Utility and system commands",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("WrenchIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Other Commands",render:ua})}})),r.storage.hiddenSettings?.visible&&e.React.createElement(m,{title:"Hidden Settings",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(h,{label:"Hidden Commands",subLabel:"Access to experimental and NSFW commands",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("EyeIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Hidden Settings",render:ga})}})),e.React.createElement(m,{title:"Other",icon:o.getAssetIDByName("CircleInformationIcon-primary")},e.React.createElement(h,{label:"Credits",subLabel:"View original authors of the plugins",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("HeartIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Credits",render:fa})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}})))}const{FormSection:ya,FormRow:ge}=v.Forms,{TableRowIcon:pa}=p.findByProps("TableRowIcon"),V=window.bunny,Ue=V?.metro?.findByPropsLazy("getRootNavigationRef"),fe=V?.metro?.findByPropsLazy("SETTING_RENDERER_CONFIG"),We=V?.metro?.findByPropsLazy("createList"),Ge=V?.metro?.findByNameLazy("SettingsOverviewScreen",!1);function ma({tabs:t}){const a=e.NavigationNative.useNavigation();return e.React.createElement(ge,{label:t.title(),leading:e.React.createElement(ge.Icon,{source:t.icon}),trailing:e.React.createElement(e.React.Fragment,{},[t.trailing?t.trailing():null,e.React.createElement(ge.Arrow,{key:"arrow"})]),onPress:function(){const n=t.page;a.navigate("VendettaCustomPage",{title:t.title(),render:function(){return e.React.createElement(n)}})}})}function ha(t,a){try{a.push(O.after("default",V?.metro?.findByPropsLazy(["renderTitle","sections"],!1),function(n,i){const s=ie.findInReactTree(i.props.children,function(c){return c.type?.name==="UserSettingsOverview"});s&&a.push(O.after("render",s.type.prototype,function(c,d){const l=ie.findInReactTree(d.props.children,function(g){return g?.children?.[1]?.type===ya})?.children;if(l){const g=l.findIndex(function(f){return["BILLING_SETTINGS","PREMIUM_SETTINGS"].includes(f?.props?.label)});l.splice(-~g||4,0,e.React.createElement(ma,{key:t.key,tabs:t}))}}))},!0))}catch(n){He.logger.info("Panel UI patch failed graciously \u{1F494}",n)}}function Ca(t,a){if(!fe||!Ue){console.warn("[Commands Plugin] Missing required constants for tabs UI patch");return}const n={[t.key]:{type:"pressable",title:t.title,icon:t.icon,IconComponent:t.icon&&function(){return e.React.createElement(pa,{source:t.icon})},usePredicate:t.predicate,useTrailing:t.trailing,onPress:function(){const c=Ue.getRootNavigationRef(),d=t.page;c.navigate("VendettaCustomPage",{title:t.title(),render:function(){return e.React.createElement(d)}})},withArrow:!0}};let i=fe.SETTING_RENDERER_CONFIG;Object.defineProperty(fe,"SETTING_RENDERER_CONFIG",{enumerable:!0,configurable:!0,get:function(){return{...i,...n}},set:function(c){return i=c}});const s=Symbol("pinToSettings meow meow");try{if(!We)return;a.push(O.after("createList",We,function(c,d){if(!c[0][s]){c[0][s]=!0;const[l]=c,g=l.sections?.find(function(f){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(y){return f.label===y&&f.title===y})});g?.settings&&(g.settings=[...g.settings,t.key])}}))}catch{if(!Ge)return;a.push(O.after("default",Ge,function(c,d){if(!c[0][s]){c[0][s]=!0;const{sections:l}=ie.findInReactTree(d,function(f){return f.props?.sections}).props,g=l?.find(function(f){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(y){return f.label===y&&f.title===y})});g?.settings&&(g.settings=[...g.settings,t.key])}}))}}function ba(t){const a=[];let n=!1;const i=t.predicate||function(){return!0};return t.predicate=function(){return n?!1:i()},ha(t,a),Ca(t,a),a.push(function(){return n=!0}),function(){for(const s of a)s()}}function Ra(){if(r.storage.sidebarEnabled===!1)return console.log("[Commands Plugin] Sidebar disabled in settings"),function(){};console.log("[Commands Plugin] Patching sidebar...");try{const t=ba({key:"CommandsPlugin",icon:o.getAssetIDByName("SettingsIcon"),title:function(){return"Commands"},predicate:function(){return r.storage.sidebarEnabled!==!1},page:Ve});return console.log("[Commands Plugin] Successfully patched sidebar"),t}catch(t){return console.error("[Commands Plugin] Failed to patch sidebar:",t),function(){}}}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}),r.storage.sidebarEnabled===void 0&&(r.storage.sidebarEnabled=!0);const va={catfact:Qe,dogfact:Ze,useless:et,petpet:dt,pluginList:st,themeList:ot,konoself:ft,konosend:yt,firstmessage:Ct,sysinfo:At,spotifyTrack:Pt,spotifyAlbum:$t,spotifyArtists:Lt,spotifyCover:Ft,gary:_t,ip:jt,lovefemboys:Gt,nekoslife:Jt,friendInviteCreate:ea,friendInviteView:ta,friendInviteRevoke:aa};let ye=[],te;var Ia={onLoad:function(){if(console.log("[Commands Plugin] Loading..."),r.storage.sidebarEnabled!==!1)try{te=Ra(),console.log("[Commands Plugin] Sidebar patched successfully")}catch(t){console.error("[Commands Plugin] Failed to patch sidebar:",t)}for(const[t,a]of Object.entries(va))if(r.storage.enabledCommands[t])try{ye.push(ze.registerCommand(a)),console.log(`[Commands Plugin] Registered command: ${t}`)}catch(n){console.error(`[Commands Plugin] Failed to register command ${t}:`,n)}},onUnload:function(){if(console.log("[Commands Plugin] Unloading..."),ye.forEach(function(t){try{t()}catch{}}),ye=[],te)try{te(),te=void 0,console.log("[Commands Plugin] Sidebar unpatched")}catch(t){console.error("[Commands Plugin] Failed to unpatch sidebar:",t)}},settings:Ve};return re.default=Ia,Object.defineProperty(re,"__esModule",{value:!0}),re})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.debug,vendetta.ui.toasts,vendetta.ui.assets,vendetta.storage,vendetta.ui.components,vendetta.patcher,vendetta.utils,vendetta); diff --git a/Commands/manifest.json b/Commands/manifest.json index cc64029..99a9e96 100644 --- a/Commands/manifest.json +++ b/Commands/manifest.json @@ -1 +1 @@ -{"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":"2e4fc1bc2999f3b03026cc1e8695b82a78a8f7bd3532e062c2b59fc6477d46a1"} \ No newline at end of file +{"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":"68ba57347171e6f89e402339c78da49080c396ad7cee67f2edfbd29289198fc3"} \ No newline at end of file diff --git a/multi-scrobbler/index.js b/multi-scrobbler/index.js index b191699..110d0e1 100644 --- a/multi-scrobbler/index.js +++ b/multi-scrobbler/index.js @@ -1 +1 @@ -(function(x,f,r,_,ht,M,Q,E,S,Z,xe,ee){"use strict";const l={DEFAULT_APP_NAME:"Music",DEFAULT_TIME_INTERVAL:5,APPLICATION_ID:"1054951789318909972",MIN_UPDATE_INTERVAL:3,MAX_RETRY_ATTEMPTS:3,RETRY_DELAY:5e3,SERVICES:{lastfm:{name:"Last.fm",baseUrl:"http://ws.audioscrobbler.com/2.0",requiresApiKey:!0,requiresToken:!1},librefm:{name:"Libre.fm",baseUrl:"http://libre.fm/api",requiresApiKey:!0,requiresToken:!1},listenbrainz:{name:"ListenBrainz",baseUrl:"http://api.listenbrainz.org/1",requiresApiKey:!1,requiresToken:!0}},DEFAULT_COVER_HASHES:["2a96cbd8b46e442fc41c2b86b821562f","c6f59c1e5e7240a4c0d427abd71f3dbb"],DEFAULT_SETTINGS:{username:"",apiKey:"",appName:"Music",timeInterval:5,showTimestamp:!0,listeningTo:!0,ignoreSpotify:!0,ignoreYouTubeMusic:!0,ignoreKizzy:!0,ignoreMetrolist:!0,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 V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fe(e,t){for(var n=0;n10&&(b.serviceErrors[e]=b.serviceErrors[e].slice(-10)),he(`${e} error:`,t)}function ve(){b.lastSuccessfulUpdate=new Date().toISOString(),j("Successful update recorded at:",b.lastSuccessfulUpdate)}function H(e){return H=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},H(e)}function me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(me=function(){return!!e})()}function je(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xe(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function He(e,t){return t&&(Xe(t)==="object"||typeof t=="function")?t:je(e)}function te(e,t,n){return t=H(t),He(e,me()?Reflect.construct(t,n||[],H(e).constructor):t.apply(e,n))}function ne(e,t){return ne=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},ne(e,t)}function re(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&&ne(e,t)}let ie=(function(){function e(){V(this,e)}return F(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),X(this.getServiceName().toLowerCase(),n),new Error(`${this.getServiceName()} API Error: ${n}`)}},{key:"getErrorMessage",value:function(t){return t.error&&l.API_ERROR_CODES[t.error]?l.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}`),ye();const i=await fetch(t,{...n,headers:{"User-Agent":"Vendetta Multi-Service Scrobbler/3.0.0",...n.headers}});if(!i.ok){const s=new Error(`HTTP ${i.status}: ${i.statusText}`);throw X(this.getServiceName().toLowerCase(),s.message),s}const a=await i.json();return a.error&&await this.handleError(a),this.retryCount=0,a}catch(i){if(this.retryCount++,this.retryCount>l.MAX_RETRY_ATTEMPTS)throw this.retryCount=0,X(this.getServiceName().toLowerCase(),`Max retries exceeded: ${i.message}`),i;return this.logVerbose(`Request failed, retrying (${this.retryCount}/${l.MAX_RETRY_ATTEMPTS})`),await new Promise(function(a){return setTimeout(a,l.RETRY_DELAY)}),this.makeRequest(t,n)}}},{key:"isDefaultCover",value:function(t){return t?l.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})(),We=(function(e){re(t,e);function t(){return V(this,t),te(this,t,arguments)}return F(t,[{key:"getServiceName",value:function(){return"Last.fm"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{if(!o.username||!o.apiKey)throw new Error("Username or API key not set");const n=new URLSearchParams({method:"user.getinfo",user:o.username,api_key:o.apiKey,format:"json"}),i=`${l.SERVICES.lastfm.baseUrl}?${n}`;return await this.makeRequest(i),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{if(!o.username||!o.apiKey)throw new Error("Username or API key not set");this.logVerbose("Fetching latest scrobble for user:",o.username);const n=new URLSearchParams({method:"user.getrecenttracks",user:o.username,api_key:o.apiKey,limit:"1",extended:"1",format:"json"}),i=`${l.SERVICES.lastfm.baseUrl}?${n}`,a=(await this.makeRequest(i))?.recenttracks?.track?.[0];if(!a)throw new Error("No tracks found");this.logVerbose("Raw track data:",a);const s=!!a["@attr"]?.nowplaying,c=a.date?.uts?parseInt(a.date.uts):Math.floor(Date.now()/1e3);let g=null,d=null;if(s)try{const L=new URLSearchParams({method:"track.getInfo",track:a.name,artist:a.artist.name,api_key:o.apiKey,format:"json"}),C=`${l.SERVICES.lastfm.baseUrl}?${L}`,R=await this.makeRequest(C);R?.track?.duration&&(g=parseInt(R.track.duration),g>0&&(g=Math.floor(g/1e3),d=c+g))}catch(L){this.logVerbose("Failed to fetch track duration:",L)}const v=this.processAlbumArt(a.image?.find(function(L){return L.size==="large"})?.["#text"]),k={name:a.name,artist:a.artist.name,album:a.album["#text"],albumArt:v,url:a.url,date:a.date?.["#text"]??"now",nowPlaying:s,loved:a.loved==="1",from:c,to:d,duration:g};return this.logVerbose("Processed track:",k),this.log(`${s?"Now playing":"Last played"}:`,`${k.artist} - ${k.name}`),k}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ie),Je=(function(e){re(t,e);function t(){return V(this,t),te(this,t,arguments)}return F(t,[{key:"getServiceName",value:function(){return"Libre.fm"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=o.librefmUsername,i=o.librefmApiKey;if(!n||!i)throw new Error("Username or API key not set for Libre.fm");const a=new URLSearchParams({method:"user.getinfo",user:n,api_key:i,format:"json"}),s=`${l.SERVICES.librefm.baseUrl}?${a}`;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=o.librefmUsername,i=o.librefmApiKey;if(!n||!i)throw new Error("Username or API key not set for Libre.fm");this.logVerbose("Fetching latest scrobble for user:",n);const a=new URLSearchParams({method:"user.getrecenttracks",user:n,api_key:i,limit:"1",extended:"1",format:"json"}),s=`${l.SERVICES.librefm.baseUrl}?${a}`,c=(await this.makeRequest(s))?.recenttracks?.track?.[0];if(!c)throw new Error("No tracks found");this.logVerbose("Raw track data:",c);const g=!!c["@attr"]?.nowplaying,d=c.date?.uts?parseInt(c.date.uts):Math.floor(Date.now()/1e3);let v=null,k=null;if(g)try{const R=new URLSearchParams({method:"track.getInfo",track:c.name,artist:c.artist.name,api_key:i,format:"json"}),U=`${l.SERVICES.librefm.baseUrl}?${R}`,Ke=await this.makeRequest(U);Ke?.track?.duration&&(v=parseInt(Ke.track.duration),v>0&&(v=Math.floor(v/1e3),k=d+v))}catch(R){this.logVerbose("Failed to fetch track duration:",R)}const L=this.processAlbumArt(c.image?.find(function(R){return R.size==="large"})?.["#text"]),C={name:c.name,artist:c.artist.name,album:c.album["#text"],albumArt:L,url:c.url,date:c.date?.["#text"]??"now",nowPlaying:g,loved:c.loved==="1",from:d,to:k,duration:v};return this.logVerbose("Processed track:",C),this.log(`${g?"Now playing":"Last played"}:`,`${C.artist} - ${C.name}`),C}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ie),Qe=(function(e){re(t,e);function t(){return V(this,t),te(this,t,arguments)}return F(t,[{key:"getServiceName",value:function(){return"ListenBrainz"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=o.listenbrainzUsername,i=o.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");const a=`${l.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,s={};return i&&(s.Authorization=`Token ${i}`),await this.makeRequest(a,{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=o.listenbrainzUsername,i=o.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");this.logVerbose("Fetching latest scrobble for user:",n);let a=null;try{const C=`${l.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/playing-now`,R={};i&&(R.Authorization=`Token ${i}`);const U=await this.makeRequest(C,{headers:R});U.listens&&U.listens.length>0&&(a=U.listens[0],a.playing_now=!0)}catch(C){this.logVerbose("No currently playing track or failed to fetch:",C)}let s;if(a)s=a,this.logVerbose("Using currently playing track");else{const C=`${l.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,R={};i&&(R.Authorization=`Token ${i}`);const U=await this.makeRequest(C,{headers:R});if(!U.listens||U.listens.length===0)throw new Error("No listens found");s=U.listens[0],this.logVerbose("Using latest completed listen")}this.logVerbose("Raw listen data:",s);const c=!!s.playing_now,g=s.listened_at||Math.floor(Date.now()/1e3);let d=null,v=null;s.track_metadata.additional_info?.duration_ms&&(d=Math.floor(s.track_metadata.additional_info.duration_ms/1e3),c&&d>0&&(v=g+d));const k=null;s.track_metadata.additional_info?.release_mbid;const L={name:s.track_metadata.track_name,artist:s.track_metadata.artist_name,album:s.track_metadata.release_name||"",albumArt:k,url:s.track_metadata.additional_info?.origin_url||`https://listenbrainz.org/user/${n}`,date:c?"now":new Date(g*1e3).toISOString(),nowPlaying:c,loved:!1,from:g,to:v,duration:d};return this.logVerbose("Processed track:",L),this.log(`${c?"Now playing":"Last played"}:`,`${L.artist} - ${L.name}`),L}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})(ie);const T=(function(){function e(){V(this,e),this.serviceInstances=new Map}return F(e,[{key:"getService",value:function(t){this.serviceInstances||(this.serviceInstances=new Map);const n=t||o.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(o.service)}},{key:"createService",value:function(t){switch(t){case"lastfm":return new We;case"librefm":return new Je;case"listenbrainz":return new Qe;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 Se(e){if(!e||e<0)return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`:`${n}:${i.toString().padStart(2,"0")}`}function Ee(){return Math.floor(Date.now()/1e3)}var Ze=(function(e){return e[e.PLAYING=0]="PLAYING",e[e.STREAMING=1]="STREAMING",e[e.LISTENING=2]="LISTENING",e[e.COMPETING=5]="COMPETING",e})(Ze||{});const A=function(...e){return console.log("[Scrobble Plugin]",...e)},B=function(...e){return console.error("[Scrobble Plugin] Error:",...e)},I=function(...e){return o.verboseLogging&&console.log("[Scrobble Plugin] Verbose:",...e)},ae=(function(){function e(){V(this,e)}return F(e,[{key:"updateActivity",value:async function(){if(y.pluginStopped){I("Plugin is stopped, skipping update"),this.stopUpdates();return}const t=T.getCurrentService().getServiceName();I(`Fetching latest track from ${t}...`);let n=!1;try{if(o.ignoreSpotify){if(q.findActivity(function(c){return c.sync_id})){I("Spotify is currently playing, clearing activity"),P("isSpotifyIgnored",!0),O();return}P("isSpotifyIgnored",!1)}if(o.ignoreYouTubeMusic){if(q.findActivity(function(c){return c.name==="YouTube Music"||c.application_id==="463097721130188830"||c.name&&c.name.toLowerCase().includes("youtube music")})){I("YouTube Music is currently playing, clearing activity"),P("isYouTubeMusicIgnored",!0),O();return}P("isYouTubeMusicIgnored",!1)}if(o.ignoreKizzy){if(q.findActivity(function(c){return c.name&&c.name.toLowerCase()==="kizzy"})){I("Kizzy is currently playing, clearing activity"),P("isKizzyIgnored",!0),O();return}P("isKizzyIgnored",!1)}if(o.ignoreMetrolist){if(q.findActivity(function(c){return c.name&&c.name.toLowerCase()==="metrolist"})){I("Metrolist is currently playing, clearing activity"),P("isMetrolistIgnored",!0),O();return}P("isMetrolistIgnored",!1)}ye();const i=await T.getCurrentService().fetchLatestScrobble();if(P("lastTrack",i),!i.nowPlaying){I("Track is not currently playing"),O();return}if(y.lastTrackUrl===i.url){I("Track hasn't changed"),ve(),this.consecutiveFailures=0;return}n=!0,A(`\u{1F3B5} Track changed: ${i.artist} - ${i.name}`);let a;if(i.nowPlaying&&o.showTimestamp&&i.from){const c=Ee();let g=i.from;if(g0){const d=Math.min(i.duration*.1,30);g=c-d}else g=c;I("had to estimate start time")}a={start:g*1e3},i.to&&(a.end=i.to*1e3)}I(`\u{1F3AF} Preparing RPC update for: ${i.artist} - ${i.name}`);const s={name:o.appName||l.DEFAULT_APP_NAME,flags:0,type:o.listeningTo?2:0,details:i.name,state:`by ${i.artist}`,status_display_type:1,application_id:l.APPLICATION_ID};if(s.name.includes("{{")){const c={artist:i.artist,name:i.name,album:i.album,service:t};for(const[g,d]of Object.entries(c))s.name=s.name.replace(new RegExp(`{{${g}}}`,"g"),d||"")}if(a&&(s.timestamps=a,I("Timestamps set:",{start:new Date(a.start).toISOString(),end:a.end?new Date(a.end).toISOString():"none",duration:i.duration?Se(i.duration):"unknown"})),i.album||i.albumArt){const c=i.albumArt?[i.albumArt]:[],g=await qe(c);if(g[0]){const d=i.album?`on ${i.album}`:`${i.artist} - ${i.name}`,v=o.showTimestamp&&i.duration?` \u2022 ${Se(i.duration)}`:"";s.assets={large_image:g[0],large_text:d+v},I("Album art set:",g[0])}else i.album&&(s.assets={large_text:`on ${i.album}`})}I("Setting Discord activity:",s),P("lastActivity",s),await be(s),y.lastTrackUrl=i.url,this.currentActivity=s,y.lastActivity=s,this.consecutiveFailures=0,this.lastUpdateTime=Ee(),ve(),A(`\u2705 RPC updated successfully: ${i.artist} - ${i.name}`)}catch(i){B("Update failed:",i),X(o.service,i.message),this.handleError(i)}}},{key:"handleError",value:function(t){this.consecutiveFailures++,P("lastError",t),B(`Failure ${this.consecutiveFailures}/${l.MAX_RETRY_ATTEMPTS}:`,t.message),this.consecutiveFailures>=l.MAX_RETRY_ATTEMPTS&&(B("Max retry attempts reached, initiating reconnection..."),this.startReconnection())}},{key:"startReconnection",value:function(){var t=this;this.isReconnecting||(this.isReconnecting=!0,this.stopUpdates(),A("Starting reconnection process..."),this.reconnectTimer=setInterval(function(){A("Attempting to reconnect..."),t.initialize().then(function(){A("Reconnection successful!"),t.stopReconnection()}).catch(function(n){B("Reconnection attempt failed:",n.message)})},l.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(y.pluginStopped)throw new Error("Plugin is stopped");const n=T.getCurrentService().getServiceName();A(`Initializing with ${n}...`);try{if(!await T.validateCurrentService())throw new Error(`Invalid credentials for ${n}`);A(`${n} credentials validated successfully`)}catch(a){throw B(`Failed to validate ${n} credentials:`,a),a}this.stopUpdates(),A("\u{1F3B5} checking for already playing songs..."),await this.updateActivity();const i=Math.max((Number(o.timeInterval)||l.DEFAULT_SETTINGS.timeInterval)*1e3,l.MIN_UPDATE_INTERVAL*1e3);this.updateTimer=setInterval(function(){return t.updateActivity()},i),A(`Update timer started with interval: ${i}ms (${i/1e3}s)`)}},{key:"stop",value:function(){if(!y.pluginStopped){A("Stopping plugin..."),y.pluginStopped=!0;try{this.stopUpdates(),this.stopReconnection(),O(),A("Plugin stopped successfully")}catch(t){console.error("[Scrobble Plugin] Stop error:",t)}}}},{key:"switchService",value:async function(t){if(y.pluginStopped)return;A(`Switching to ${t}...`);const n=!y.pluginStopped;this.stop();try{T.clearCache(),y.lastTrackUrl=void 0,this.currentActivity=void 0,this.lastUpdateTime=0,n&&(y.pluginStopped=!1,await this.initialize())}catch(i){B("Failed to switch service:",i)}}},{key:"getStatus",value:function(){const t=T.getCurrentService().getServiceName();return{running:!y.pluginStopped,service:t,consecutiveFailures:this.consecutiveFailures,isReconnecting:this.isReconnecting,lastTrackUrl:y.lastTrackUrl,updateInterval:this.updateTimer?"Active":"Inactive"}}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e})().getInstance(),et=function(){return ae.initialize()},se=function(){return ae.stop()},tt=function(e){return ae.switchService(e)};var we,Re,Te,Ie,Ae,ke,Le,Ce,Pe,Ne,$e,Ue,_e,De;const{ScrollView:K}=_.findByProps("ScrollView"),{TableRowGroup:w,TableSwitchRow:$,Stack:N,TableRow:u}=_.findByProps("TableSwitchRow","TableRowGroup","Stack","TableRow"),{TextInput:D}=_.findByProps("TextInput");(we=f.plugin.storage).username??(we.username=""),(Re=f.plugin.storage).apiKey??(Re.apiKey=""),(Te=f.plugin.storage).appName??(Te.appName="Music"),(Ie=f.plugin.storage).timeInterval??(Ie.timeInterval=5),(Ae=f.plugin.storage).showTimestamp??(Ae.showTimestamp=!0),(ke=f.plugin.storage).listeningTo??(ke.listeningTo=!0),(Le=f.plugin.storage).ignoreSpotify??(Le.ignoreSpotify=!0),(Ce=f.plugin.storage).verboseLogging??(Ce.verboseLogging=!1),(Pe=f.plugin.storage).service??(Pe.service="lastfm"),(Ne=f.plugin.storage).librefmUsername??(Ne.librefmUsername=""),($e=f.plugin.storage).librefmApiKey??($e.librefmApiKey=""),(Ue=f.plugin.storage).listenbrainzUsername??(Ue.listenbrainzUsername=""),(_e=f.plugin.storage).listenbrainzToken??(_e.listenbrainzToken=""),(De=f.plugin.storage).addToSidebar??(De.addToSidebar=!0);const p=function(e,t){return f.plugin.storage[e]??t},m=function(e,t){return f.plugin.storage[e]=t};function nt(){M.useProxy(f.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){E.showToast("Testing Last.fm connection...",S.getAssetIDByName("ClockIcon"));try{await T.testService("lastfm")?E.showToast("\u2705 Last.fm connection successful!",S.getAssetIDByName("CheckIcon")):E.showToast("\u274C Last.fm connection failed",S.getAssetIDByName("XIcon"))}catch{E.showToast("\u274C Connection error",S.getAssetIDByName("XIcon"))}};return r.React.createElement(K,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(N,{spacing:8},r.React.createElement(w,{title:"Credentials"},r.React.createElement(N,{spacing:4},r.React.createElement(D,{placeholder:"Last.fm Username",value:p("username"),onChange:function(n){m("username",n),e()},isClearable:!0}),r.React.createElement(D,{placeholder:"Last.fm API Key",value:p("apiKey"),onChange:function(n){m("apiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(w,{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 Q.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),E.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",S.getAssetIDByName("XIcon"))}}}))),r.React.createElement(r.ReactNative.View,{style:{height:64}}))}function rt(){M.useProxy(f.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){E.showToast("Testing Libre.fm connection...",S.getAssetIDByName("ClockIcon"));try{await T.testService("librefm")?E.showToast("\u2705 Libre.fm connection successful!",S.getAssetIDByName("CheckIcon")):E.showToast("\u274C Libre.fm connection failed",S.getAssetIDByName("XIcon"))}catch{E.showToast("\u274C Connection error",S.getAssetIDByName("XIcon"))}};return r.React.createElement(K,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(N,{spacing:8},r.React.createElement(w,{title:"Credentials"},r.React.createElement(N,{spacing:4},r.React.createElement(D,{placeholder:"Libre.fm Username",value:p("librefmUsername"),onChange:function(n){m("librefmUsername",n),e()},isClearable:!0}),r.React.createElement(D,{placeholder:"Libre.fm API Key",value:p("librefmApiKey"),onChange:function(n){m("librefmApiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(w,{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 Q.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),E.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",S.getAssetIDByName("XIcon"))}}}))),r.React.createElement(r.ReactNative.View,{style:{height:64}}))}function it(){M.useProxy(f.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){E.showToast("Testing ListenBrainz connection...",S.getAssetIDByName("ClockIcon"));try{await T.testService("listenbrainz")?E.showToast("\u2705 ListenBrainz connection successful!",S.getAssetIDByName("CheckIcon")):E.showToast("\u274C ListenBrainz connection failed",S.getAssetIDByName("XIcon"))}catch{E.showToast("\u274C Connection error",S.getAssetIDByName("XIcon"))}};return r.React.createElement(K,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(N,{spacing:8},r.React.createElement(w,{title:"Credentials"},r.React.createElement(N,{spacing:4},r.React.createElement(D,{placeholder:"ListenBrainz Username",value:p("listenbrainzUsername"),onChange:function(n){m("listenbrainzUsername",n),e()},isClearable:!0}),r.React.createElement(D,{placeholder:"ListenBrainz Token (for private profiles)",value:p("listenbrainzToken"),onChange:function(n){m("listenbrainzToken",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(w,{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 Q.Linking.openURL("https://listenbrainz.org/settings/")}catch(n){console.error("Failed to open ListenBrainz settings URL:",n),E.showToast("Failed to open web browser. Please visit: https://listenbrainz.org/settings/",S.getAssetIDByName("XIcon"))}}}))),r.React.createElement(r.ReactNative.View,{style:{height:64}}))}function at(){M.useProxy(f.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(K,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(N,{spacing:8},r.React.createElement(w,{title:"Activity Display"},r.React.createElement(N,{spacing:4},r.React.createElement(D,{placeholder:`App Name (Default: ${l.DEFAULT_SETTINGS.appName})`,value:p("appName",l.DEFAULT_SETTINGS.appName),onChange:function(t){m("appName",t),e()},isClearable:!0}),r.React.createElement(D,{placeholder:`Update Interval (Default: ${l.DEFAULT_SETTINGS.timeInterval}s)`,value:String(p("timeInterval",l.DEFAULT_SETTINGS.timeInterval)),onChange:function(t){const n=Number(t);n>=l.MIN_UPDATE_INTERVAL&&(m("timeInterval",n),e())},keyboardType:"numeric",isClearable:!0}))),r.React.createElement(w,{title:"Activity Options"},r.React.createElement($,{label:"Show as Listening",subLabel:"Display as 'Listening to' instead of 'Playing'",value:p("listeningTo",l.DEFAULT_SETTINGS.listeningTo),onValueChange:function(t){m("listeningTo",t),e()}}),r.React.createElement($,{label:"Show Timestamp",subLabel:"Display track progress and duration",value:p("showTimestamp",l.DEFAULT_SETTINGS.showTimestamp),onValueChange:function(t){m("showTimestamp",t),e()}}),r.React.createElement($,{label:"Ignore Spotify",subLabel:"Don't show activity when Spotify is playing",value:p("ignoreSpotify",l.DEFAULT_SETTINGS.ignoreSpotify),onValueChange:function(t){m("ignoreSpotify",t),e()}}),r.React.createElement($,{label:"Ignore YouTube Music",subLabel:"Don't show activity when YouTube Music is playing (PC client)",value:p("ignoreYouTubeMusic",l.DEFAULT_SETTINGS.ignoreYouTubeMusic),onValueChange:function(t){m("ignoreYouTubeMusic",t),e()}}),r.React.createElement($,{label:"Ignore Kizzy",subLabel:"Don't show activity when Kizzy is playing",value:p("ignoreKizzy",l.DEFAULT_SETTINGS.ignoreKizzy),onValueChange:function(t){m("ignoreKizzy",t),e()}}),r.React.createElement($,{label:"Ignore Metrolist",subLabel:"Don't show activity when Metrolist is playing",value:p("ignoreMetrolist",l.DEFAULT_SETTINGS.ignoreMetrolist),onValueChange:function(t){m("ignoreMetrolist",t),e()}}))),r.React.createElement(r.ReactNative.View,{style:{height:64}}))}function st(){M.useProxy(f.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(K,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(N,{spacing:8},r.React.createElement(w,{title:"Logging Options"},r.React.createElement($,{label:"Verbose Logging",subLabel:"Enable detailed console logging for debugging",value:p("verboseLogging",l.DEFAULT_SETTINGS.verboseLogging),onValueChange:function(t){m("verboseLogging",t),e()}})),r.React.createElement(w,{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(w,{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"}))),r.React.createElement(r.ReactNative.View,{style:{height:64}}))}function ze(){M.useProxy(f.plugin.storage);const e=r.NavigationNative.useNavigation(),[,t]=r.React.useReducer(function(a){return a+1},0),n=p("service"),i=function(a){switch(a){case"lastfm":return p("username")&&p("apiKey")?"\u2705 Configured":"\u274C Missing credentials";case"librefm":return p("librefmUsername")&&p("librefmApiKey")?"\u2705 Configured":"\u274C Missing credentials";case"listenbrainz":return p("listenbrainzUsername")?"\u2705 Configured":"\u274C Missing username";default:return"\u2753 Unknown"}};return r.React.createElement(K,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(N,{spacing:8},r.React.createElement(w,{title:"Active Service"},r.React.createElement(u,{label:"Current Service",subLabel:n?`Using: ${T.getServiceDisplayName(n)}`:"No service selected"}),["lastfm","librefm","listenbrainz"].map(function(a){return r.React.createElement($,{key:a,label:T.getServiceDisplayName(a),subLabel:i(a),value:n===a,onValueChange:function(s){s&&a!==n&&(m("service",a),t())}})})),r.React.createElement(w,{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:nt})}}),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:rt})}}),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:it})}})),r.React.createElement(w,{title:"Plugin Configuration"},r.React.createElement(u,{label:"Display Settings",subLabel:"Customize how music activity appears",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Display Settings",render:at})}}),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:st})}}),r.React.createElement($,{label:"Add to Sidebar",subLabel:"Show plugin in Discord settings",value:p("addToSidebar",!1),onValueChange:function(a){m("addToSidebar",a),t()}})),r.React.createElement(w,{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.2.0"}))),r.React.createElement(r.ReactNative.View,{style:{height:64}}))}const{FormSection:ot,FormRow:oe}=xe.Forms,{TableRowIcon:ct}=_.findByProps("TableRowIcon"),W=window.bunny,Me=W?.metro?.findByPropsLazy("getRootNavigationRef"),ce=W?.metro?.findByPropsLazy("SETTING_RENDERER_CONFIG"),Ve=W?.metro?.findByNameLazy("SettingsOverviewScreen",!1);function lt({tabs:e}){const t=r.NavigationNative.useNavigation();return r.React.createElement(oe,{label:e.title(),leading:r.React.createElement(oe.Icon,{source:e.icon}),trailing:r.React.createElement(r.React.Fragment,{},[e.trailing?e.trailing():null,r.React.createElement(oe.Arrow,{key:"arrow"})]),onPress:function(){const n=e.page;t.navigate("VendettaCustomPage",{title:e.title(),render:function(){return r.React.createElement(n)}})}})}function ut(e,t){try{t.push(Z.after("default",W?.metro?.findByNameLazy("UserSettingsOverviewWrapper",!1),function(n,i){const a=ee.findInReactTree(i.props.children,function(s){return s.type?.name==="UserSettingsOverview"});a&&t.push(Z.after("render",a.type.prototype,function(s,c){const g=ee.findInReactTree(c.props.children,function(d){return d?.children?.[1]?.type===ot})?.children;if(g){const d=g.findIndex(function(v){return["BILLING_SETTINGS","PREMIUM_SETTINGS"].includes(v?.props?.label)});g.splice(-~d||4,0,r.React.createElement(lt,{key:e.key,tabs:e}))}}))},!0))}catch(n){f.logger.info("Panel UI patch failed graciously \u{1F494}",n)}}function gt(e,t){if(!ce||!Ve||!Me){console.warn("[LastFm] Missing required constants for tabs UI patch");return}const n={};n[e.key]={type:"pressable",title:e.title,icon:e.icon,IconComponent:e.icon&&function(){const s=typeof e.icon=="object"&&e.icon.uri!==void 0?e.icon.uri:e.icon;return r.React.createElement(ct,{source:s})},usePredicate:e.predicate,useTrailing:e.trailing,onPress:function(){const s=Me.getRootNavigationRef(),c=e.page;s.navigate("VendettaCustomPage",{title:e.title(),render:function(){return r.React.createElement(c)}})},withArrow:!0};let i=ce.SETTING_RENDERER_CONFIG;Object.defineProperty(ce,"SETTING_RENDERER_CONFIG",{enumerable:!0,configurable:!0,get:function(){return{...i,...n}},set:function(s){return i=s}});const a=Symbol("LastFm-pinToSettings");t.push(Z.after("default",Ve,function(s,c){if(!s[0][a]){s[0][a]=!0;const{sections:g}=ee.findInReactTree(c,function(v){return v.props?.sections}).props,d=g?.find(function(v){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(k){return v.label===k&&v.title===k})});d?.settings&&(d.settings=[...d.settings,e.key])}}))}function ft(e){const t=[];let n=!1;const i=e.predicate||function(){return!0};return e.predicate=function(){return n?!1:i()},ut(e,t),gt(e,t),t.push(function(){return n=!0}),function(){for(const a of t)a()}}function Fe(){if(!f.plugin.storage.addToSidebar)return console.log("[Multi Scrobbler] Sidebar disabled in settings"),function(){};console.log("[Multi Scrobbler] Patching sidebar using custom patchSettingsPin...");try{const e=ft({key:"LastFmScrobbler",icon:S.getAssetIDByName("MusicIcon"),title:function(){return"Multi Scrobbler"},predicate:function(){return f.plugin.storage.addToSidebar===!0},page:ze});return console.log("[Multi Scrobbler] Successfully patched sidebar"),e}catch(e){return console.error("[Multi Scrobbler] Failed to patch sidebar:",e),function(){}}}var Oe;const y={pluginStopped:!1,lastActivity:void 0,updateInterval:void 0,lastTrackUrl:void 0},le=[];let z;const Be=l.DEFAULT_SETTINGS;for(const e of Object.keys(Be))f.plugin.storage[e]=f.plugin.storage[e]??Be[e];(Oe=f.plugin.storage).addToSidebar??(Oe.addToSidebar=!1);const o=new Proxy(f.plugin.storage,{get(e,t){return e[t]},set(e,t,n){return e[t]=n,!0}});let J=0;const ue=3,dt=5e3,h=function(...e){return console.log("[Scrobble Plugin]",...e)},ge=function(...e){return console.error("[Scrobble Plugin] Error:",...e)};async function Y(){try{await et(),J=0,h("Plugin initialized successfully")}catch(e){ge("Initialization failed:",e),J++,J10&&(w.serviceErrors[e]=w.serviceErrors[e].slice(-10)),Se(`${e} error:`,t)}function Ie(){w.lastSuccessfulUpdate=new Date().toISOString(),Q("Successful update recorded at:",w.lastSuccessfulUpdate)}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Z(e)}function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ke=function(){return!!e})()}function ot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function ct(e,t){return t&&(lt(t)==="object"||typeof t=="function")?t:ot(e)}function se(e,t,n){return t=Z(t),ct(e,ke()?Reflect.construct(t,n||[],Z(e).constructor):t.apply(e,n))}function oe(e,t){return oe=Object.setPrototypeOf||function(a,s){return a.__proto__=s,a},oe(e,t)}function le(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&&oe(e,t)}let ce=(function(){function e(){M(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),J(this.getServiceName().toLowerCase(),n),new Error(`${this.getServiceName()} API Error: ${n}`)}},{key:"getErrorMessage",value:function(t){return t.error&&h.API_ERROR_CODES[t.error]?h.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}`),Te();const a=await fetch(t,{...n,headers:{"User-Agent":"Vendetta Multi-Service Scrobbler/3.0.0",...n.headers}});if(!a.ok){const i=new Error(`HTTP ${a.status}: ${a.statusText}`);throw J(this.getServiceName().toLowerCase(),i.message),i}const s=await a.json();return s.error&&await this.handleError(s),this.retryCount=0,s}catch(a){if(this.retryCount++,this.retryCount>h.MAX_RETRY_ATTEMPTS)throw this.retryCount=0,J(this.getServiceName().toLowerCase(),`Max retries exceeded: ${a.message}`),a;return this.logVerbose(`Request failed, retrying (${this.retryCount}/${h.MAX_RETRY_ATTEMPTS})`),await new Promise(function(s){return setTimeout(s,h.RETRY_DELAY)}),this.makeRequest(t,n)}}},{key:"isDefaultCover",value:function(t){return t?h.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})(),ut=(function(e){le(t,e);function t(){return M(this,t),se(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"Last.fm"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{if(!o.username||!o.apiKey)throw new Error("Username or API key not set");const n=new URLSearchParams({method:"user.getinfo",user:o.username,api_key:o.apiKey,format:"json"}),a=`${h.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(!o.username||!o.apiKey)throw new Error("Username or API key not set");this.logVerbose("Fetching latest scrobble for user:",o.username);const n=new URLSearchParams({method:"user.getrecenttracks",user:o.username,api_key:o.apiKey,limit:"1",extended:"1",format:"json"}),a=`${h.SERVICES.lastfm.baseUrl}?${n}`,s=(await this.makeRequest(a))?.recenttracks?.track?.[0];if(!s)throw new Error("No tracks found");this.logVerbose("Raw track data:",s);const i=!!s["@attr"]?.nowplaying,u=s.date?.uts?parseInt(s.date.uts):Math.floor(Date.now()/1e3);let g=null,f=null;if(i)try{const L=new URLSearchParams({method:"track.getInfo",track:s.name,artist:s.artist.name,api_key:o.apiKey,format:"json"}),C=`${h.SERVICES.lastfm.baseUrl}?${L}`,A=await this.makeRequest(C);A?.track?.duration&&(g=parseInt(A.track.duration),g>0&&(g=Math.floor(g/1e3),f=u+g))}catch(L){this.logVerbose("Failed to fetch track duration:",L)}const b=this.processAlbumArt(s.image?.find(function(L){return L.size==="large"})?.["#text"]),k={name:s.name,artist:s.artist.name,album:s.album["#text"],albumArt:b,url:s.url,date:s.date?.["#text"]??"now",nowPlaying:i,loved:s.loved==="1",from:u,to:f,duration:g};return this.logVerbose("Processed track:",k),this.log(`${i?"Now playing":"Last played"}:`,`${k.artist} - ${k.name}`),k}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ce),gt=(function(e){le(t,e);function t(){return M(this,t),se(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"Libre.fm"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=o.librefmUsername,a=o.librefmApiKey;if(!n||!a)throw new Error("Username or API key not set for Libre.fm");const s=new URLSearchParams({method:"user.getinfo",user:n,api_key:a,format:"json"}),i=`${h.SERVICES.librefm.baseUrl}?${s}`;return await this.makeRequest(i),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{const n=o.librefmUsername,a=o.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 s=new URLSearchParams({method:"user.getrecenttracks",user:n,api_key:a,limit:"1",extended:"1",format:"json"}),i=`${h.SERVICES.librefm.baseUrl}?${s}`,u=(await this.makeRequest(i))?.recenttracks?.track?.[0];if(!u)throw new Error("No tracks found");this.logVerbose("Raw track data:",u);const g=!!u["@attr"]?.nowplaying,f=u.date?.uts?parseInt(u.date.uts):Math.floor(Date.now()/1e3);let b=null,k=null;if(g)try{const A=new URLSearchParams({method:"track.getInfo",track:u.name,artist:u.artist.name,api_key:a,format:"json"}),U=`${h.SERVICES.librefm.baseUrl}?${A}`,te=await this.makeRequest(U);te?.track?.duration&&(b=parseInt(te.track.duration),b>0&&(b=Math.floor(b/1e3),k=f+b))}catch(A){this.logVerbose("Failed to fetch track duration:",A)}const L=this.processAlbumArt(u.image?.find(function(A){return A.size==="large"})?.["#text"]),C={name:u.name,artist:u.artist.name,album:u.album["#text"],albumArt:L,url:u.url,date:u.date?.["#text"]??"now",nowPlaying:g,loved:u.loved==="1",from:f,to:k,duration:b};return this.logVerbose("Processed track:",C),this.log(`${g?"Now playing":"Last played"}:`,`${C.artist} - ${C.name}`),C}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ce),ft=(function(e){le(t,e);function t(){return M(this,t),se(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"ListenBrainz"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=o.listenbrainzUsername,a=o.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");const s=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,i={};return a&&(i.Authorization=`Token ${a}`),await this.makeRequest(s,{headers:i}),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{const n=o.listenbrainzUsername,a=o.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");this.logVerbose("Fetching latest scrobble for user:",n);let s=null;try{const C=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/playing-now`,A={};a&&(A.Authorization=`Token ${a}`);const U=await this.makeRequest(C,{headers:A});U.listens&&U.listens.length>0&&(s=U.listens[0],s.playing_now=!0)}catch(C){this.logVerbose("No currently playing track or failed to fetch:",C)}let i;if(s)i=s,this.logVerbose("Using currently playing track");else{const C=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,A={};a&&(A.Authorization=`Token ${a}`);const U=await this.makeRequest(C,{headers:A});if(!U.listens||U.listens.length===0)throw new Error("No listens found");i=U.listens[0],this.logVerbose("Using latest completed listen")}this.logVerbose("Raw listen data:",i);const u=!!i.playing_now,g=i.listened_at||Math.floor(Date.now()/1e3);let f=null,b=null;i.track_metadata.additional_info?.duration_ms&&(f=Math.floor(i.track_metadata.additional_info.duration_ms/1e3),u&&f>0&&(b=g+f));const k=null;i.track_metadata.additional_info?.release_mbid;const L={name:i.track_metadata.track_name,artist:i.track_metadata.artist_name,album:i.track_metadata.release_name||"",albumArt:k,url:i.track_metadata.additional_info?.origin_url||`https://listenbrainz.org/user/${n}`,date:u?"now":new Date(g*1e3).toISOString(),nowPlaying:u,loved:!1,from:g,to:b,duration:f};return this.logVerbose("Processed track:",L),this.log(`${u?"Now playing":"Last played"}:`,`${L.artist} - ${L.name}`),L}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})(ce);const x=(function(){function e(){M(this,e),this.serviceInstances=new Map}return B(e,[{key:"getService",value:function(t){this.serviceInstances||(this.serviceInstances=new Map);const n=t||o.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(o.service)}},{key:"createService",value:function(t){switch(t){case"lastfm":return new ut;case"librefm":return new gt;case"listenbrainz":return new ft;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 Le(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 Ae(){return Math.floor(Date.now()/1e3)}var dt=(function(e){return e[e.PLAYING=0]="PLAYING",e[e.STREAMING=1]="STREAMING",e[e.LISTENING=2]="LISTENING",e[e.COMPETING=5]="COMPETING",e})(dt||{});const N=function(...e){return console.log("[Scrobble Plugin]",...e)},K=function(...e){return console.error("[Scrobble Plugin] Error:",...e)},$=function(...e){return o.verboseLogging&&console.log("[Scrobble Plugin] Verbose:",...e)},ue=(function(){function e(){M(this,e)}return B(e,[{key:"updateActivity",value:async function(){if(S.pluginStopped){$("Plugin is stopped, skipping update"),this.stopUpdates();return}const t=x.getCurrentService().getServiceName();$(`Fetching latest track from ${t}...`);let n=!1;try{if(o.ignoreList&&o.ignoreList.length>0){const u=at.findActivity(function(g){return g.name?o.ignoreList.some(function(f){return g.name.toLowerCase().includes(f.toLowerCase())}):!1});if(u){$(`Ignored app (${u.name}) is currently playing, clearing activity`),ae();return}}Te();const a=await x.getCurrentService().fetchLatestScrobble();if(ie("lastTrack",a),!a.nowPlaying){$("Track is not currently playing"),ae();return}if(S.lastTrackUrl===a.url){$("Track hasn't changed"),Ie(),this.consecutiveFailures=0;return}n=!0,N(`\u{1F3B5} Track changed: ${a.artist} - ${a.name}`);let s;if(a.nowPlaying&&o.showTimestamp&&a.from){const u=Ae();let g=a.from;if(g0){const f=Math.min(a.duration*.1,30);g=u-f}else g=u;$("had to estimate start time")}s={start:g*1e3},a.to&&(s.end=a.to*1e3)}$(`\u{1F3AF} Preparing RPC update for: ${a.artist} - ${a.name}`);const i={name:o.appName||h.DEFAULT_APP_NAME,flags:0,type:o.listeningTo?2:0,details:a.name,state:`${a.artist}`,status_display_type:1,application_id:h.APPLICATION_ID};if(i.name.includes("{{")){const u={artist:a.artist,name:a.name,album:a.album,service:t};for(const[g,f]of Object.entries(u))i.name=i.name.replace(new RegExp(`{{${g}}}`,"g"),f||"")}if(s&&(i.timestamps=s,$("Timestamps set:",{start:new Date(s.start).toISOString(),end:s.end?new Date(s.end).toISOString():"none",duration:a.duration?Le(a.duration):"unknown"})),a.album||a.albumArt){const u=a.albumArt?[a.albumArt]:[];let g=(await st(u))[0];if(g){if(i.assets={large_image:g},o.showLargeText){let f="";if(o.showAlbumInTooltip&&a.album&&(f+=`on ${a.album}`),o.showDurationInTooltip&&a.duration){const b=Le(a.duration);f?f+=` \u2022 ${b}`:f=b}f&&(i.assets.large_text=f)}$("Album art set:",g),i.assets.large_text&&$("Tooltip text set:",i.assets.large_text)}else a.album&&o.showLargeText&&o.showAlbumInTooltip&&(i.assets={large_text:`on ${a.album}`})}$("Setting Discord activity:",i),ie("lastActivity",i),await Ee(i),S.lastTrackUrl=a.url,this.currentActivity=i,S.lastActivity=i,this.consecutiveFailures=0,this.lastUpdateTime=Ae(),Ie(),N(`\u2705 RPC updated successfully: ${a.artist} - ${a.name}`)}catch(a){K("Update failed:",a),J(o.service,a.message),this.handleError(a)}}},{key:"handleError",value:function(t){this.consecutiveFailures++,ie("lastError",t),K(`Failure ${this.consecutiveFailures}/${h.MAX_RETRY_ATTEMPTS}:`,t.message),this.consecutiveFailures>=h.MAX_RETRY_ATTEMPTS&&(K("Max retry attempts reached, initiating reconnection..."),this.startReconnection())}},{key:"startReconnection",value:function(){var t=this;this.isReconnecting||(this.isReconnecting=!0,this.stopUpdates(),N("Starting reconnection process..."),this.reconnectTimer=setInterval(function(){N("Attempting to reconnect..."),t.initialize().then(function(){N("Reconnection successful!"),t.stopReconnection()}).catch(function(n){K("Reconnection attempt failed:",n.message)})},h.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(S.pluginStopped)throw new Error("Plugin is stopped");const n=x.getCurrentService().getServiceName();N(`Initializing with ${n}...`);try{if(!await x.validateCurrentService())throw new Error(`Invalid credentials for ${n}`);N(`${n} credentials validated successfully`)}catch(s){throw K(`Failed to validate ${n} credentials:`,s),s}this.stopUpdates(),N("\u{1F3B5} checking for already playing songs..."),await this.updateActivity();const a=Math.max((Number(o.timeInterval)||h.DEFAULT_SETTINGS.timeInterval)*1e3,h.MIN_UPDATE_INTERVAL*1e3);this.updateTimer=setInterval(function(){return t.updateActivity()},a),N(`Update timer started with interval: ${a}ms (${a/1e3}s)`)}},{key:"stop",value:function(){if(!S.pluginStopped){N("Stopping plugin..."),S.pluginStopped=!0;try{this.stopUpdates(),this.stopReconnection(),ae(),N("Plugin stopped successfully")}catch(t){console.error("[Scrobble Plugin] Stop error:",t)}}}},{key:"switchService",value:async function(t){if(S.pluginStopped)return;N(`Switching to ${t}...`);const n=!S.pluginStopped;this.stop();try{x.clearCache(),S.lastTrackUrl=void 0,this.currentActivity=void 0,this.lastUpdateTime=0,n&&(S.pluginStopped=!1,await this.initialize())}catch(a){K("Failed to switch service:",a)}}},{key:"getStatus",value:function(){const t=x.getCurrentService().getServiceName();return{running:!S.pluginStopped,service:t,consecutiveFailures:this.consecutiveFailures,isReconnecting:this.isReconnecting,lastTrackUrl:S.lastTrackUrl,updateInterval:this.updateTimer?"Active":"Inactive"}}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e})().getInstance(),pt=function(){return ue.initialize()},ge=function(){return ue.stop()},ht=function(e){return ue.switchService(e)},{ScrollView:F}=z.findByProps("ScrollView"),{TableRowGroup:E,TableSwitchRow:Ce,TableCheckboxRow:j,Stack:P,TableRow:c}=z.findByProps("TableSwitchRow","TableCheckboxRow","TableRowGroup","Stack","TableRow"),{TextInput:_}=z.findByProps("TextInput");function bt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){T.showToast("Testing Last.fm connection...",v.getAssetIDByName("ClockIcon"));try{await Y.testService("lastfm")?T.showToast("\u2705 Last.fm connection successful!",v.getAssetIDByName("CheckIcon")):T.showToast("\u274C Last.fm connection failed",v.getAssetIDByName("XIcon"))}catch{T.showToast("\u274C Connection error",v.getAssetIDByName("XIcon"))}};return r.React.createElement(F,{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:l("username"),onChange:function(n){I("username",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"Last.fm API Key",value:l("apiKey"),onChange:function(n){I("apiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(c,{label:"Test Connection",subLabel:"Verify your Last.fm credentials",trailing:r.React.createElement(c.Arrow,null),onPress:t}),r.React.createElement(c,{label:"Get API Key",subLabel:"Create a Last.fm API key at last.fm/api/account/create",trailing:r.React.createElement(c.Arrow,null),onPress:async function(){try{await re.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),T.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",v.getAssetIDByName("XIcon"))}}}))))}function yt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){T.showToast("Testing Libre.fm connection...",v.getAssetIDByName("ClockIcon"));try{await Y.testService("librefm")?T.showToast("\u2705 Libre.fm connection successful!",v.getAssetIDByName("CheckIcon")):T.showToast("\u274C Libre.fm connection failed",v.getAssetIDByName("XIcon"))}catch{T.showToast("\u274C Connection error",v.getAssetIDByName("XIcon"))}};return r.React.createElement(F,{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:l("librefmUsername"),onChange:function(n){I("librefmUsername",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"Libre.fm API Key",value:l("librefmApiKey"),onChange:function(n){I("librefmApiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(c,{label:"Test Connection",subLabel:"Verify your Libre.fm credentials",trailing:r.React.createElement(c.Arrow,null),onPress:t}),r.React.createElement(c,{label:"Get API Key",subLabel:"Create a Last.fm API key (compatible with Libre.fm)",trailing:r.React.createElement(c.Arrow,null),onPress:async function(){try{await re.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),T.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",v.getAssetIDByName("XIcon"))}}}))))}function mt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){T.showToast("Testing ListenBrainz connection...",v.getAssetIDByName("ClockIcon"));try{await Y.testService("listenbrainz")?T.showToast("\u2705 ListenBrainz connection successful!",v.getAssetIDByName("CheckIcon")):T.showToast("\u274C ListenBrainz connection failed",v.getAssetIDByName("XIcon"))}catch{T.showToast("\u274C Connection error",v.getAssetIDByName("XIcon"))}};return r.React.createElement(F,{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:l("listenbrainzUsername"),onChange:function(n){I("listenbrainzUsername",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"ListenBrainz Token (for private profiles)",value:l("listenbrainzToken"),onChange:function(n){I("listenbrainzToken",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(c,{label:"Test Connection",subLabel:"Verify your ListenBrainz credentials",trailing:r.React.createElement(c.Arrow,null),onPress:t}),r.React.createElement(c,{label:"Get User Token",subLabel:"Get your ListenBrainz user token at listenbrainz.org/settings/",trailing:r.React.createElement(c.Arrow,null),onPress:async function(){try{await re.Linking.openURL("https://listenbrainz.org/settings/")}catch(n){console.error("Failed to open ListenBrainz settings URL:",n),T.showToast("Failed to open web browser. Please visit: https://listenbrainz.org/settings/",v.getAssetIDByName("XIcon"))}}}))))}function vt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(F,{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: ${h.DEFAULT_SETTINGS.appName})`,value:l("appName",h.DEFAULT_SETTINGS.appName),onChange:function(t){I("appName",t),e()},isClearable:!0}),r.React.createElement(_,{placeholder:`Update Interval (Default: ${h.DEFAULT_SETTINGS.timeInterval}s)`,value:String(l("timeInterval",h.DEFAULT_SETTINGS.timeInterval)),onChange:function(t){const n=Number(t);n>=h.MIN_UPDATE_INTERVAL&&(I("timeInterval",n),e())},keyboardType:"numeric",isClearable:!0}))),r.React.createElement(E,{title:"About Display Settings"},r.React.createElement(c,{label:"App Name",subLabel:"The name shown in Discord for your activity"}),r.React.createElement(c,{label:"Update Interval",subLabel:"How often the plugin checks for new tracks (in seconds)"}),r.React.createElement(c,{label:"Minimum Interval",subLabel:`The plugin will never check more frequently than ${h.MIN_UPDATE_INTERVAL} seconds`}))))}function wt(){D.useProxy(p.plugin.storage);const[e,t]=r.React.useState(null),[n,a]=r.React.useState(!0),[s,i]=r.React.useState(0),[u,g]=r.React.useState(!1),f={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},b=function(d){return d?Array.isArray(d)?d.filter(function(y){return y&&typeof y=="string"}):d["#text"]?d["#text"].split(/[,;&]/).map(function(y){return y.trim()}).filter(function(y){return y.length>0}):typeof d=="string"?d.split(/[,;&]/).map(function(y){return y.trim()}).filter(function(y){return y.length>0}):["Unknown Artist"]:["Unknown Artist"]},k=function(d){return!d||d.length===0?"Unknown Artist":d.length===1?d[0]:d.length===2?`${d[0]} & ${d[1]}`:`${d.slice(0,-1).join(", ")} & ${d[d.length-1]}`};r.React.useEffect(function(){(async function(){if(!l("username")||!l("apiKey")){t(f),g(!0),a(!1);return}try{a(!0);const d=await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${l("username")}&api_key=${l("apiKey")}&format=json&limit=1`)).json();if(d.recenttracks&&d.recenttracks.track&&d.recenttracks.track.length>0){const y=d.recenttracks.track[0],O=b(y.artist);let tt=180;try{const Ut=O[0]||"Unknown Artist",me=await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=${l("apiKey")}&artist=${encodeURIComponent(Ut)}&track=${encodeURIComponent(y.name)}&format=json&username=${l("username")}`)).json();me.track&&me.track.duration&&(tt=Math.floor(me.track.duration/1e3))}catch{console.log("Could not fetch track duration, using default")}t({name:y.name||"Unknown Track",artist:k(O),artists:O,album:y.album?.["#text"]||"Unknown Album",image:y.image?.[2]?.["#text"]||y.image?.[1]?.["#text"]||null,nowPlaying:y["@attr"]?.nowplaying==="true",duration:tt,startTime:y["@attr"]?.nowplaying==="true"?Math.floor(Date.now()/1e3)-60:null}),g(!1)}else t(f),g(!0)}catch(d){console.error("Failed to fetch preview data, using fallback:",d),t(f),g(!0)}finally{a(!1)}})()},[l("username"),l("apiKey")]),r.React.useEffect(function(){if(!e?.nowPlaying||!l("showTimestamp"))return;const d=setInterval(function(){if(e.startTime&&e.duration){const y=Math.floor(Date.now()/1e3)-e.startTime,O=Math.min(y/e.duration,1);i(O)}},1e3);return function(){return clearInterval(d)}},[e,l("showTimestamp")]);const L=function(d){const y=Math.floor(d/60),O=Math.floor(d%60);return`${y}:${O.toString().padStart(2,"0")}`},C=function(){let d="";if(l("showAlbumInTooltip")&&e?.album&&(d+=`on ${e.album}`),l("showDurationInTooltip")&&e?.duration){const y=` \u2022 ${L(e.duration)}`;d?d+=y:d=L(e.duration)}return d||"No tooltip text"},A=function(){return e?.duration?e.nowPlaying?{current:s*e.duration,total:e.duration,progress:s}:{current:e.duration*.3,total:e.duration,progress:.3}:{current:0,total:0,progress:0}},U=l("listeningTo")?"Listening to":"Playing",te=l("appName","Music");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 ye=A(),et=C();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},U," ",te),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),l("showLargeText")&&et!=="No tooltip text"&&r.React.createElement(r.ReactNative.Text,{style:m.tooltipText,numberOfLines:1},et),l("showTimestamp")&&e.duration&&r.React.createElement(r.ReactNative.View,{style:m.progressContainer},r.React.createElement(r.ReactNative.Text,{style:m.timeText},L(ye.current)),r.React.createElement(r.ReactNative.View,{style:m.progressBar},r.React.createElement(r.ReactNative.View,{style:[m.progressFill,{width:`${ye.progress*100}%`}]})),r.React.createElement(r.ReactNative.Text,{style:m.timeText},L(ye.total))))))}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(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(i){return i+1},0),t=l("listeningTo",h.DEFAULT_SETTINGS.listeningTo),n=l("showTimestamp",h.DEFAULT_SETTINGS.showTimestamp),a=function(){const i=!t;I("listeningTo",i),!i&&n&&I("showTimestamp",!1),e()},s=function(){t&&(I("showTimestamp",!n),e())};return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(wt,null),r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"RPC Display Options"},r.React.createElement(j,{label:"Show as Listening",subLabel:"Display as 'Listening to' instead of 'Playing'",checked:t,onPress:a}),r.React.createElement(j,{label:"Show Tooltip Text",subLabel:"Show album name and track duration in Discord activity tooltip",checked:l("showLargeText",!0),onPress:function(){const i=l("showLargeText",!0);I("showLargeText",!i),e()}}),!t&&r.React.createElement(c,{label:"Timestamp Unavailable",subLabel:"Enable 'Show as Listening' to use timestamp feature",disabled:!0,dimmed:!0}),r.React.createElement(j,{label:"Show Timestamp",subLabel:"Display track progress and duration",checked:n,onPress:s,disabled:!t}),r.React.createElement(j,{label:"Show Album in Tooltip",subLabel:"Include album name in the tooltip text",checked:l("showAlbumInTooltip",!0),onPress:function(){const i=l("showAlbumInTooltip",!0);I("showAlbumInTooltip",!i),e()}}),r.React.createElement(j,{label:"Show Duration in Tooltip",subLabel:"Include track duration in the tooltip text",checked:l("showDurationInTooltip",!0),onPress:function(){const i=l("showDurationInTooltip",!0);I("showDurationInTooltip",!i),e()}}))))}function Et(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(i){return i+1},0),[t,n]=r.React.useState(""),a=function(){if(!t.trim()){T.showToast("Please enter an app name",v.getAssetIDByName("Small"));return}const i=l("ignoreList",[]);i.includes(t.trim())?T.showToast("App already in ignore list",v.getAssetIDByName("Warning")):(I("ignoreList",[...i,t.trim()]),n(""),e(),T.showToast("App added to ignore list",v.getAssetIDByName("Check")))},s=function(i){const u=l("ignoreList",[]);I("ignoreList",u.filter(function(g){return g!==i})),e(),T.showToast("App removed from ignore list",v.getAssetIDByName("Check"))};return r.React.createElement(F,{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(c,{label:"Add to Ignore List",subLabel:"Add the current app name to your ignore list",trailing:r.React.createElement(c.Arrow,null),onPress:a})),l("ignoreList",[]).length>0&&r.React.createElement(E,{title:"Ignored Apps"},l("ignoreList",[]).map(function(i,u){return r.React.createElement(c,{key:u,label:i,trailing:r.React.createElement(r.ReactNative.TouchableOpacity,{onPress:function(){return s(i)},style:{padding:8,backgroundColor:"#ff4d4d",borderRadius:12,width:24,height:24,justifyContent:"center",alignItems:"center"}},r.React.createElement(r.ReactNative.Image,{source:v.getAssetIDByName("TrashIcon"),style:{width:14,height:14,tintColor:"#ffffff"}}))})})),r.React.createElement(E,{title:"About Ignore List"},r.React.createElement(c,{label:"How it Works",subLabel:"When any app in your ignore list is active, your music status will be hidden"}),r.React.createElement(c,{label:"Detection",subLabel:"Apps are detected by their Discord activity name"}),r.React.createElement(c,{label:"Examples",subLabel:"Spotify, YouTube Music, Kizzy, Metrolist, echo"}))))}function St(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Logging Options"},r.React.createElement(Ce,{label:"Verbose Logging",subLabel:"Enable detailed console logging for debugging",value:l("verboseLogging",h.DEFAULT_SETTINGS.verboseLogging),onValueChange:function(t){I("verboseLogging",t),e()}})),r.React.createElement(E,{title:"Debug Information"},r.React.createElement(c,{label:"Console Logging",subLabel:"Logs are written to the browser/app console when verbose is enabled"}),r.React.createElement(c,{label:"Error Tracking",subLabel:"Connection errors and API failures are automatically logged"})),r.React.createElement(E,{title:"Log Information"},r.React.createElement(c,{label:"API Calls",subLabel:"All API requests are logged when verbose is enabled"}),r.React.createElement(c,{label:"Track Updates",subLabel:"Song changes and RPC updates are logged"}),r.React.createElement(c,{label:"Error Details",subLabel:"Connection errors and retries are logged"}))))}var Pe,Ne,$e,Ue,De,_e,ze,xe,Fe,Ve,Me,Be,Oe,Ke,je,Ge,qe;(Pe=p.plugin.storage).username??(Pe.username=""),(Ne=p.plugin.storage).apiKey??(Ne.apiKey=""),($e=p.plugin.storage).appName??($e.appName="Music"),(Ue=p.plugin.storage).timeInterval??(Ue.timeInterval=5),(De=p.plugin.storage).showTimestamp??(De.showTimestamp=!0),(_e=p.plugin.storage).listeningTo??(_e.listeningTo=!0),(ze=p.plugin.storage).verboseLogging??(ze.verboseLogging=!1),(xe=p.plugin.storage).service??(xe.service="lastfm"),(Fe=p.plugin.storage).librefmUsername??(Fe.librefmUsername=""),(Ve=p.plugin.storage).librefmApiKey??(Ve.librefmApiKey=""),(Me=p.plugin.storage).listenbrainzUsername??(Me.listenbrainzUsername=""),(Be=p.plugin.storage).listenbrainzToken??(Be.listenbrainzToken=""),(Oe=p.plugin.storage).addToSidebar??(Oe.addToSidebar=!0),(Ke=p.plugin.storage).showLargeText??(Ke.showLargeText=!0),(je=p.plugin.storage).ignoreList??(je.ignoreList=[]),(Ge=p.plugin.storage).showAlbumInTooltip??(Ge.showAlbumInTooltip=!0),(qe=p.plugin.storage).showDurationInTooltip??(qe.showDurationInTooltip=!0);const l=function(e,t){return p.plugin.storage[e]??t},I=function(e,t){return p.plugin.storage[e]=t},Y=(function(){function e(){M(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=l("username"),n=l("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=l("librefmUsername"),n=l("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=l("listenbrainzUsername"),n=l("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 Ye(){D.useProxy(p.plugin.storage);const e=r.NavigationNative.useNavigation(),[,t]=r.React.useReducer(function(s){return s+1},0),n=l("service"),a=function(s){switch(s){case"lastfm":return l("username")&&l("apiKey")?"\u2705 Configured":"\u274C Missing credentials";case"librefm":return l("librefmUsername")&&l("librefmApiKey")?"\u2705 Configured":"\u274C Missing credentials";case"listenbrainz":return l("listenbrainzUsername")?"\u2705 Configured":"\u274C Missing username";default:return"\u2753 Unknown"}};return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Active Service"},r.React.createElement(c,{label:"Current Service",subLabel:n?`Using: ${Y.getServiceDisplayName(n)}`:"No service selected"}),["lastfm","librefm","listenbrainz"].map(function(s){return r.React.createElement(j,{key:s,label:Y.getServiceDisplayName(s),subLabel:a(s),checked:n===s,onPress:function(){s!==n&&(I("service",s),t())}})})),r.React.createElement(E,{title:"Service Configuration"},r.React.createElement(c,{label:"Last.fm Settings",subLabel:"Configure Last.fm credentials and options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Last.fm Settings",render:bt})}}),r.React.createElement(c,{label:"Libre.fm Settings",subLabel:"Configure Libre.fm credentials and options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Libre.fm Settings",render:yt})}}),r.React.createElement(c,{label:"ListenBrainz Settings",subLabel:"Configure ListenBrainz credentials and options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"ListenBrainz Settings",render:mt})}})),r.React.createElement(E,{title:"Plugin Configuration"},r.React.createElement(c,{label:"Display Settings",subLabel:"Customize app name and update interval",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Display Settings",render:vt})}}),r.React.createElement(c,{label:"RPC Customization",subLabel:"Customize Discord rich presence display options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"RPC Customization",render:Rt})}}),r.React.createElement(c,{label:"Ignore List",subLabel:"Configure apps that should hide your status",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Ignore List Settings",render:Et})}}),r.React.createElement(c,{label:"Logging Settings",subLabel:"Configure logging and debugging options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Logging Settings",render:St})}}),r.React.createElement(Ce,{label:"Add to Sidebar",subLabel:"Show plugin in Discord settings",value:l("addToSidebar",!1),onValueChange:function(s){I("addToSidebar",s),t()}})),r.React.createElement(E,{title:"About"},r.React.createElement(c,{label:"Multi Scrobbler",subLabel:"Show off your music status from multiple services"}),r.React.createElement(c,{label:"Author",subLabel:"kmmiio99o"}),r.React.createElement(c,{label:"Version",subLabel:"1.3.2"}))))}const{FormSection:Tt,FormRow:fe}=rt.Forms,{TableRowIcon:It}=z.findByProps("TableRowIcon"),W=window.bunny,We=W?.metro?.findByPropsLazy("getRootNavigationRef"),de=W?.metro?.findByPropsLazy("SETTING_RENDERER_CONFIG"),Xe=W?.metro?.findByPropsLazy("createList"),He=W?.metro?.findByNameLazy("SettingsOverviewScreen",!1);function kt({tabs:e}){const t=r.NavigationNative.useNavigation();return r.React.createElement(fe,{label:e.title(),leading:r.React.createElement(fe.Icon,{source:e.icon}),trailing:r.React.createElement(r.React.Fragment,{},[e.trailing?e.trailing():null,r.React.createElement(fe.Arrow,{key:"arrow"})]),onPress:function(){const n=e.page;t.navigate("VendettaCustomPage",{title:e.title(),render:function(){return r.React.createElement(n)}})}})}function Lt(e,t){try{t.push(H.after("default",W?.metro?.findByPropsLazy(["renderTitle","sections"],!1),function(n,a){const s=ne.findInReactTree(a.props.children,function(i){return i.type?.name==="UserSettingsOverview"});s&&t.push(H.after("render",s.type.prototype,function(i,u){const g=ne.findInReactTree(u.props.children,function(f){return f?.children?.[1]?.type===Tt})?.children;if(g){const f=g.findIndex(function(b){return["BILLING_SETTINGS","PREMIUM_SETTINGS"].includes(b?.props?.label)});g.splice(-~f||4,0,r.React.createElement(kt,{key:e.key,tabs:e}))}}))},!0))}catch(n){p.logger.info("Panel UI patch failed graciously \u{1F494}",n)}}function At(e,t){if(!de||!We){console.warn("[LastFm] Missing required constants for tabs UI patch");return}const n={[e.key]:{type:"pressable",title:e.title,icon:e.icon,IconComponent:e.icon&&function(){return r.React.createElement(It,{source:e.icon})},usePredicate:e.predicate,useTrailing:e.trailing,onPress:function(){const i=We.getRootNavigationRef(),u=e.page;i.navigate("VendettaCustomPage",{title:e.title(),render:function(){return r.React.createElement(u)}})},withArrow:!0}};let a=de.SETTING_RENDERER_CONFIG;Object.defineProperty(de,"SETTING_RENDERER_CONFIG",{enumerable:!0,configurable:!0,get:function(){return{...a,...n}},set:function(i){return a=i}});const s=Symbol("pinToSettings meow meow");try{if(!Xe)return;t.push(H.after("createList",Xe,function(i,u){if(!i[0][s]){i[0][s]=!0;const[g]=i,f=g.sections?.find(function(b){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(k){return b.label===k&&b.title===k})});f?.settings&&(f.settings=[...f.settings,e.key])}}))}catch{if(!He)return;t.push(H.after("default",He,function(i,u){if(!i[0][s]){i[0][s]=!0;const{sections:g}=ne.findInReactTree(u,function(b){return b.props?.sections}).props,f=g?.find(function(b){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(k){return b.label===k&&b.title===k})});f?.settings&&(f.settings=[...f.settings,e.key])}}))}}function Ct(e){const t=[];let n=!1;const a=e.predicate||function(){return!0};return e.predicate=function(){return n?!1:a()},Lt(e,t),At(e,t),t.push(function(){return n=!0}),function(){for(const s of t)s()}}function Qe(){if(!p.plugin.storage.addToSidebar)return console.log("[Multi Scrobbler] Sidebar disabled in settings"),function(){};console.log("[Multi Scrobbler] Patching sidebar using custom patchSettingsPin...");try{const e=Ct({key:"LastFmScrobbler",icon:v.getAssetIDByName("MusicIcon"),title:function(){return"Multi Scrobbler"},predicate:function(){return p.plugin.storage.addToSidebar===!0},page:Ye});return console.log("[Multi Scrobbler] Successfully patched sidebar"),e}catch(e){return console.error("[Multi Scrobbler] Failed to patch sidebar:",e),function(){}}}var Je;const S={pluginStopped:!1,lastActivity:void 0,updateInterval:void 0,lastTrackUrl:void 0},pe=[];let V;const Ze=h.DEFAULT_SETTINGS;for(const e of Object.keys(Ze))p.plugin.storage[e]=p.plugin.storage[e]??Ze[e];(Je=p.plugin.storage).addToSidebar??(Je.addToSidebar=!1);const o=new Proxy(p.plugin.storage,{get(e,t){return e[t]},set(e,t,n){return e[t]=n,!0}});let ee=0;const he=3,Pt=5e3,R=function(...e){return console.log("[Scrobble Plugin]",...e)},be=function(...e){return console.error("[Scrobble Plugin] Error:",...e)};async function X(){try{await pt(),ee=0,R("Plugin initialized successfully")}catch(e){be("Initialization failed:",e),ee++,ee