function Y(e,t,i){return window.enmity.settings.getBoolean(e,t,i)}function j(e){window.enmity.plugins.registerPlugin(e)}const E={byProps:(...e)=>window.enmity.modules.filters.byProps(...e),byName:(e,t)=>window.enmity.modules.filters.byName(e,t),byTypeName:(e,t)=>window.enmity.modules.filters.byTypeName(e,t),byDisplayName:(e,t)=>window.enmity.modules.filters.byDisplayName(e,t)};function k(...e){return window.enmity.modules.bulk(...e)}function F(...e){return window.enmity.modules.getByProps(...e)}window.enmity.modules.common;const p=window.enmity.modules.common.Constants;window.enmity.modules.common.Clipboard,window.enmity.modules.common.Assets,window.enmity.modules.common.Messages,window.enmity.modules.common.Clyde,window.enmity.modules.common.Avatars;const $=window.enmity.modules.common.Native,n=window.enmity.modules.common.React;window.enmity.modules.common.Dispatcher;const D=window.enmity.modules.common.Storage,y=window.enmity.modules.common.Toasts,A=window.enmity.modules.common.Dialog;window.enmity.modules.common.Token;const M=window.enmity.modules.common.REST;window.enmity.modules.common.Settings,window.enmity.modules.common.Users,window.enmity.modules.common.Navigation,window.enmity.modules.common.NavigationNative,window.enmity.modules.common.NavigationStack,window.enmity.modules.common.Theme,window.enmity.modules.common.Linking;const N=window.enmity.modules.common.StyleSheet;window.enmity.modules.common.ColorMap,window.enmity.modules.common.Components,window.enmity.modules.common.Locale,window.enmity.modules.common.Profiles,window.enmity.modules.common.Lodash,window.enmity.modules.common.Logger,window.enmity.modules.common.Flux,window.enmity.modules.common.SVG,window.enmity.modules.common.Scenes;function z(e){return window.enmity.patcher.create(e)}const{components:o}=window.enmity;o.Alert,o.Button,o.FlatList;const W=o.Image;o.ImageBackground,o.KeyboardAvoidingView,o.Modal,o.Pressable,o.RefreshControl;const J=o.ScrollView;o.SectionList,o.StatusBar,o.StyleSheet,o.Switch;const f=o.Text;o.TextInput,o.TouchableHighlight;const _=o.TouchableOpacity;o.TouchableWithoutFeedback,o.Touchable;const S=o.View;o.VirtualizedList,o.Form,o.FormArrow,o.FormCTA,o.FormCTAButton,o.FormCardSection,o.FormCheckbox;const L=o.FormDivider;o.FormHint,o.FormIcon,o.FormInput,o.FormLabel,o.FormRadio;const l=o.FormRow,P=o.FormSection;o.FormSelect,o.FormSubLabel;const q=o.FormSwitch;o.FormTernaryCheckBox,o.FormText,o.FormTextColors,o.FormTextSizes;const U=e=>{let t=0;for(let i in e)t++;return t};function r(e){return window.enmity.assets.getIDByName(e)}const c={Debug:r("debug"),Retry:r("ic_message_retry"),Failed:r("Small"),Cancel:r("ic_megaphone_nsfw_16px"),Add:r("add_white"),Delete:r("ic_message_delete"),Clear:r("ic_clear_all_24px"),Pencil:r("ic_pencil_24px"),Success:r("ic_selection_checked_24px"),Warning:r("ic_warning_24px"),Copy:r("toast_copy_link"),Open:r("ic_leave_stage"),Clipboard:r("pending-alert"),Initial:r("coffee"),Shield:r("ic_person_shield"),Debug_Command:{Sent:r("ic_application_command_24px"),Clock:r("clock")},Settings:{Toasts:{Context:r("toast_image_saved"),Settings:r("ic_selection_checked_24px")},Self:r("friends_toast_icon"),Share:r("share"),Robot:r("ic_robot_24px"),Commands:r("ic_profile_badge_bot_commands"),Debug:r("ic_rulebook_16px")}},I=e=>{y.open({content:`Copied ${e} to clipboard.`,source:c.Clipboard})},K=e=>{let t=e.split(` `).map(i=>{if(i!="")return`"${i.replaceAll(":",'":"').replace(" ","")}",`});return t[0]=`{${t[0]}`,t[U(t)]=`${t[U(t)]}}`,t=t.join(""),t=t.replaceAll("undefined",""),t=t.split("").reverse().join("").replace(",","").split("").reverse().join(""),t};async function Q(){try{let e=await D.getItem("device_list");if(e)return JSON.parse(e);let t=(await M.get("https://gist.githubusercontent.com/adamawolf/3048717/raw/1ee7e1a93dff9416f6ff34dd36b0ffbad9b956e9/Apple_mobile_device_types.txt")).text,i=K(t);await D.setItem("device_list",i);let a=await D.getItem("device_list");return JSON.parse(a)}catch(e){console.warn(`[SpinsPlugins Local Error \u2014 Issue when getting devices: ${e}]`);return}}async function X(e,t,i){let a=await Q();return`**[${e}] Debug Information** > **Plugin Version:** ${t} > **Plugin Build:** ${i.split("-")[1]} > **Discord Build:** ${$.InfoDictionaryManager.Version} (${$.InfoDictionaryManager.Build}) > **Software Version:** ${$.DCDDeviceManager.systemVersion} > **Device:** ${a[$.DCDDeviceManager.device]}`}const{native:v}=window.enmity;function Z(){v.reload()}v.version,v.build,v.device,v.version;const ee=F("transitionToGuild");async function te({manifest:e}){const t=`${e.sourceUrl}?${Math.floor(Math.random()*1001)}.js`,i=await(await M.get(t)).text;let a=i.match(/\d\.\d\.\d+/g),s=i.match(/patch\-\d\.\d\.\d+/g);return!a||!s?H(e.name,e.version):(a=a[0],s=s[0],a!=e.version?V(t,a,s.split("-")[1],e,!1):s!=e.build?V(t,a,s.split("-")[1],e,!0):H(e.name,e.version))}const V=(e,t,i,a,s)=>{const u=s?i:t;A.show({title:"Update found",body:`A newer ${s?"build":"version"} is available for ${a.name}. ${s?` The version will remain at ${t}, but the build will update to ${i}.`:""} Would you like to install ${s?`build \`${i}\``:`version \`${t}\``} now?`,confirmText:"Update",cancelText:"Not now",onConfirm:()=>ne(e,u,a,s)})},H=(e,t)=>{console.log(`[${e}] Plugin is on the latest version, which is ${t}`),y.open({content:`${e} is on latest version (${t})`,source:c.Success})};async function ne(e,t,i,a){window.enmity.plugins.installPlugin(e,({data:s})=>{s=="installed_plugin"||s=="overridden_plugin"?A.show({title:`Updated ${i.name}`,body:`Successfully updated to ${a?"build":"version"} \`${t}\`. Would you like to reload Discord now?`,confirmText:"Yep!",cancelText:"Not now",onConfirm:()=>{Z()}}):A.show({title:"Error",body:`Something went wrong while updating ${i.name}.`,confirmText:"Report this issue",cancelText:"Cancel",onConfirm:()=>{ee.openURL(`https://github.com/spinfal/enmity-plugins/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBUG%5D%20${i.name}%20Update%20Error%3A%20${a?`b${t}`:`v${t}`}`)}})})}const T=window.enmity.modules.common.Components.General.Animated,[C,oe]=k(E.byProps("transitionToGuild"),E.byProps("setString")),m=N.createThemedStyleSheet({container:{paddingTop:30,paddingLeft:20,marginBottom:-5,flexDirection:"row"},text_container:{paddingLeft:15,paddingTop:5,flexDirection:"column",flexWrap:"wrap"},image:{width:75,height:75,borderRadius:10},main_text:{opacity:.975,letterSpacing:.25,fontFamily:p.Fonts.DISPLAY_NORMAL},header:{color:p.ThemeColorMap.HEADER_PRIMARY,fontFamily:p.Fonts.DISPLAY_BOLD,fontSize:25,letterSpacing:.25},sub_header:{color:p.ThemeColorMap.HEADER_SECONDARY,opacity:.975,fontSize:12.75}});var ie=({manifest:e})=>{const t=n.useRef(new T.Value(1)).current,i=()=>{T.spring(t,{toValue:1.1,duration:250,useNativeDriver:!0}).start()},a=()=>{T.spring(t,{toValue:1,duration:250,useNativeDriver:!0}).start()},s=()=>{C.openURL("https://spin.rip/")},u={transform:[{scale:t}]};return n.createElement(n.Fragment,null,n.createElement(S,{style:m.container},n.createElement(_,{onPress:s,onPressIn:i,onPressOut:a},n.createElement(T.View,{style:[u]},n.createElement(W,{style:[m.image],source:{uri:"https://cdn.spin.rip/r/l9uevwe4ia0.jpg"}}))),n.createElement(S,{style:m.text_container},n.createElement(_,{onPress:()=>{C.openURL(e.sourceUrl)}},n.createElement(f,{style:[m.main_text,m.header]},e.name," ")),n.createElement(S,{style:{flexDirection:"row"}},n.createElement(f,{style:[m.main_text,m.sub_header]},"A plugin by"),n.createElement(_,{onPress:()=>{C.openURL("https://spin.rip/")}},n.createElement(f,{style:[m.main_text,m.sub_header,{paddingLeft:4,fontFamily:p.Fonts.DISPLAY_BOLD}]},e.authors[0].name))),n.createElement(S,{style:{flexDirection:"row"}},n.createElement(f,{style:[m.main_text,m.sub_header]},"Settings page by"),n.createElement(_,{onPress:()=>{C.openURL("https://github.com/acquitelol/")}},n.createElement(f,{style:[m.main_text,m.sub_header,{paddingLeft:4,fontFamily:p.Fonts.DISPLAY_BOLD}]},"Rosie<3"))),n.createElement(S,null,n.createElement(_,{style:{flexDirection:"row"},onPress:()=>{oe.setString(`**${e.name}** v${e.version}`),I("plugin name and version")}},n.createElement(f,{style:[m.main_text,m.sub_header]},"Version:"),n.createElement(f,{style:[m.main_text,m.sub_header,{paddingLeft:4,fontFamily:p.Fonts.DISPLAY_BOLD}]},e.version," "))))))};const[ae,O]=k(E.byProps("transitionToGuild","openURL"),E.byProps("setString","getString")),h=N.createThemedStyleSheet({bottom_padding:{paddingBottom:25},icon:{color:p.ThemeColorMap.INTERACTIVE_NORMAL},item:{color:p.ThemeColorMap.TEXT_MUTED},text_container:{display:"flex",flexDirection:"column"}});var se=({manifest:e,settings:t,hasToasts:i,children:a,commands:s})=>n.createElement(J,null,n.createElement(ie,{manifest:e}),a,s&&n.createElement(P,{title:"Plugin Commands"},s.map(u=>n.createElement(l,{label:`/${u.name}`,subLabel:u.description,leading:n.createElement(l.Icon,{style:h.icon,source:c.Settings.Commands}),trailing:l.Arrow,onPress:function(){O.setString(`/${u.name}`),I(`the command ${u.name}`)}}))),n.createElement(P,{title:"Utility"},i&&n.createElement(n.Fragment,null,n.createElement(l,{label:"Initialization Toasts",leading:n.createElement(l.Icon,{style:h.icon,source:c.Settings.Toasts.Context}),subLabel:`If available, show toasts when ${e.name} is starting`,trailing:n.createElement(q,{value:t.getBoolean(`${e.name}-toastEnable`,!1),onValueChange:()=>{t.toggle(`${e.name}-toastEnable`,!1),y.open({content:`Successfully ${t.getBoolean(`${e.name}-toastEnable`,!1)?"enabled":"disabled"} initialization toasts.`,source:c.Success})}})}),n.createElement(L,null)),n.createElement(l,{label:"Copy Debug Info",subLabel:`Copy useful debug information of ${e.name} to clipboard.`,leading:n.createElement(l.Icon,{style:h.icon,source:c.Settings.Debug}),trailing:l.Arrow,onPress:async function(){O.setString(await X(e.name,e.version,e.build)),I("plugin debug information")}}),n.createElement(L,null),n.createElement(l,{label:"Clear Device List Cache",subLabel:"Remove the fetched device list storage. This will not clear Discord's or your iDevice's cache.",leading:n.createElement(l.Icon,{style:h.icon,source:c.Delete}),trailing:l.Arrow,onPress:async function(){await D.removeItem("device_list"),y.open({content:"Cleared device list storage.",source:c.Success})}})),n.createElement(P,{title:"Source"},n.createElement(l,{label:"Check for Updates",subLabel:`Check for any plugin updates for ${e.name}.`,leading:n.createElement(l.Icon,{style:h.icon,source:c.Copy}),trailing:l.Arrow,onPress:()=>{te({manifest:e})}}),n.createElement(L,null),n.createElement(l,{label:"Source",subLabel:`View ${e.name} source code`,leading:n.createElement(l.Icon,{style:h.icon,source:c.Open}),trailing:l.Arrow,onPress:()=>{ae.openURL(`https://github.com/spinfal/enmity-plugins/tree/master/${e.name}`)}})),n.createElement(l,{style:h.bottom_padding,label:`Plugin Version: ${e.version} Plugin Build: ${e.build.split("-").pop()}`})),re="HideBlockedMessages",le="1.3.6",me="patch-1.0.14",ce="For when you really need to shut someone the f*** up.",de=[{name:"Marek (modified by spin)",id:"308440976723148800"}],ue="#ff0069",pe="https://raw.githubusercontent.com/spinfal/enmity-plugins/master/dist/HideBlockedMessages.js",d={name:re,version:le,build:me,description:ce,authors:de,color:ue,sourceUrl:pe};const x=z(d.name),B=F("_currentDispatchActionType","_subscriptions","_waitQueue"),R=F("isBlocked","isFriend"),ge={...d,onStart(){let e=0;const t=3,i=()=>{const a=Y(d.name,`${d.name}-toastEnable`,!1);try{e++,console.log(`${d.name} delayed start attempt ${e}/${t}.`),a&&y.open({content:`${d.name} start attempt ${e}/${t}.`,source:c.Debug});const s=B._actionHandlers._orderedActionHandlers.LOAD_MESSAGES_SUCCESS.find(g=>g.name==="MessageStore"),u=B._actionHandlers._orderedActionHandlers.MESSAGE_CREATE.find(g=>g.name==="MessageStore"),G=B._actionHandlers._orderedActionHandlers.MESSAGE_UPDATE.find(g=>g.name==="MessageStore");x.before(u,"actionHandler",(g,w)=>{const b=w[0].message;w[0].message=R.isBlocked(b?.author?.id)?null:b}),x.before(G,"actionHandler",(g,w)=>{const b=w[0].message;w[0].message=R.isBlocked(b?.author?.id)?null:b}),x.before(s,"actionHandler",(g,w)=>{w[0].messages=w[0].messages.filter(b=>!R.isBlocked(b.author.id))}),console.log(`${d.name} delayed start successful.`),a&&y.open({content:`${d.name} start successful.`,source:c.Success})}catch(s){console.log(`[${d.name} Error]`,s),e{i()},300)},onStop(){x.unpatchAll()},patches:[],getSettingsPanel({settings:e}){return n.createElement(se,{manifest:d,settings:e,hasToasts:!0,commands:null})}};j(ge);