From ca79a2c57effbd91448ea61cd329d3f1c186adb3 Mon Sep 17 00:00:00 2001 From: everestmcarthur Date: Sat, 1 Aug 2026 16:06:41 +0000 Subject: [PATCH] deploy: 18ee67bbd52c9a2881df468f7811806f4305eb6f --- copy-role-color/install/index.js | 2 +- copy-role-color/install/manifest.json | 2 +- fake-profile-themes-and-effects/install/index.js | 2 +- fake-profile-themes-and-effects/install/manifest.json | 2 +- pronoun-db/install/index.js | 2 +- pronoun-db/install/manifest.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/copy-role-color/install/index.js b/copy-role-color/install/index.js index bef3176..be49523 100644 --- a/copy-role-color/install/index.js +++ b/copy-role-color/install/index.js @@ -1 +1 @@ -(function(a,i,l,p,s,d,f,y){"use strict";function g(o,c,t,r){try{return t()}catch(e){return r.error(`[${o}] Failed to apply the "${c}" patch, that surface will be skipped: ${e}`),function(){}}}function h(o,c,t){const r=Object.entries(t).map(function([e,n]){return g(o,e,n,c)});return function(){return r.forEach(function(e){return e()})}}function b(){const o=l.findByName("ThemedRolePill",!1);return o?p.after("default",o,function(c,t){try{if(!t?.props?.onPress)return;const r=s.findInReactTree(t,function(n){return n?.props?.roleColor}),e=s.findInReactTree(t,function(n){return n?.props?.style?.[0]?.borderRadius&&typeof n?.props?.style?.[1]?.backgroundColor=="string"&&n.props.style[1].backgroundColor.startsWith("#")})?.props?.style?.[1]?.backgroundColor??r?.props?.roleColor;if(!e)return;t.props.onLongPress=function(){d.clipboard.setString(e),y.showToast("Copied role color to clipboard",f.getAssetIDByName("ic_message_copy"))}}catch{}}):function(){}}let u=function(){};var m={onLoad:function(){u=h("CopyRoleColor",i.logger,{"role pill long-press":b})},onUnload:function(){return u()}};return a.default=m,Object.defineProperty(a,"__esModule",{value:!0}),a})({},vendetta,vendetta.metro,vendetta.patcher,vendetta.utils,vendetta.metro.common,vendetta.ui.assets,vendetta.ui.toasts); +(function(c,l,i,p,s,d,f,y){"use strict";function g(o,a,t,r){try{return t()}catch(e){return r.error(`[${o}] Failed to apply the "${a}" patch, that surface will be skipped: ${e}`),function(){}}}function h(o,a,t){const r=Object.entries(t).map(function([e,n]){return g(o,e,n,a)});return function(){return r.forEach(function(e){return e()})}}function b(){const o=i.findByName("RolePill",!1)??i.findByName("ThemedRolePill",!1);return o?p.after("default",o,function(a,t){try{if(!t?.props?.onPress)return;const r=s.findInReactTree(t,function(n){return n?.props?.roleColor}),e=s.findInReactTree(t,function(n){return n?.props?.style?.[0]?.borderRadius&&typeof n?.props?.style?.[1]?.backgroundColor=="string"&&n.props.style[1].backgroundColor.startsWith("#")})?.props?.style?.[1]?.backgroundColor??r?.props?.roleColor;if(!e)return;t.props.onLongPress=function(){d.clipboard.setString(e),y.showToast("Copied role color to clipboard",f.getAssetIDByName("ic_message_copy"))}}catch{}}):function(){}}let u=function(){};var m={onLoad:function(){u=h("CopyRoleColor",l.logger,{"role pill long-press":b})},onUnload:function(){return u()}};return c.default=m,Object.defineProperty(c,"__esModule",{value:!0}),c})({},vendetta,vendetta.metro,vendetta.patcher,vendetta.utils,vendetta.metro.common,vendetta.ui.assets,vendetta.ui.toasts); diff --git a/copy-role-color/install/manifest.json b/copy-role-color/install/manifest.json index 24f5ec9..3d2b961 100644 --- a/copy-role-color/install/manifest.json +++ b/copy-role-color/install/manifest.json @@ -1 +1 @@ -{"name":"CopyRoleColor","description":"Long-press a role pill (member list, role list) to copy its color as hex.","authors":[{"name":"everestmcarthur"},{"name":"MSMA"}],"main":"index.js","hash":"e8448ac839287147e8c5b63198b2a40b8a85a2d7e9aab8f48acf93e6ed5c00c6"} \ No newline at end of file +{"name":"CopyRoleColor","description":"Long-press a role pill (member list, role list) to copy its color as hex.","authors":[{"name":"everestmcarthur"},{"name":"MSMA"}],"main":"index.js","hash":"34828c5d47ad8a234fd22550bb2ec927132c5f8e800a4ec2a4ef48a01af9ca56"} \ No newline at end of file diff --git a/fake-profile-themes-and-effects/install/index.js b/fake-profile-themes-and-effects/install/index.js index ff23f99..4266ec9 100644 --- a/fake-profile-themes-and-effects/install/index.js +++ b/fake-profile-themes-and-effects/install/index.js @@ -1 +1 @@ -(function(Q,ze,He,c,A,o,Me,p,x,u,Ve,k,I,Ge){"use strict";function We(e,t,n,i){try{return n()}catch(r){return i.error(`[${e}] Failed to apply the "${t}" patch, that surface will be skipped: ${r}`),function(){}}}function Ke(e,t,n){const i=Object.entries(n).map(function([r,l]){return We(e,r,l,t)});return function(){return i.forEach(function(r){return r()})}}const z=He.FluxDispatcher,je=c.findByStoreName("CollectiblesPurchaseStore"),Z=c.findByStoreName("ProfileEffectStore"),N=c.findByStoreName("UserProfileStore"),v=c.findByStoreName("UserStore"),Xe=Me.semanticColors,Ye=c.find(function(e){return e.default?.internal?.resolveSemanticColor})?.default.internal.resolveSemanticColor??c.find(function(e){return e.meta?.resolveSemanticColor})?.meta.resolveSemanticColor??function(){};function U(e,t,n){for(const i of t){const r=Xe?.[i];if(r)try{const l=Ye(e,r);if(l)return l}catch{}}return n}const Qe=c.findByProps("useAvatarColors")?.useAvatarColors??function(){},me=c.findByProps("getProfileTheme").getProfileTheme,q=c.findByProps("useThemeContext")?.useThemeContext??function(){return{}},Ze=c.findByProps("ThemeContextProvider")?.ThemeContextProvider??function({children:e}){return e};function J(){z.dispatch({type:"USER_SETTINGS_ACCOUNT_SUBMIT_SUCCESS"})}let _=!0;function qe(e){const[t,n]=o.useState(function(){return _=e});return[t,function(i){n(_=i),J()}]}let S=null;function Je(e){const[t,n]=o.useState(function(){return S=e});return[t,function(i){n(S=i),_&&J()}]}let E=null;function $e(e){const[t,n]=o.useState(function(){return E=e});return[t,function(i){n(E=i),_&&J()}]}let O;function $(e){O=e}const et=function(){let e=c.findByName("useProfileTheme",!1);return e?function(){return A.after("default",e,function([t],n){const{user:i}=t;return(i!=null&&i.id===O||"pendingThemeColors"in t)&&_&&(S!==null?(n.theme=me(S),n.primaryColor=S,n.secondaryColor=E??S):E!==null&&(n.theme=me(E),n.primaryColor=E,n.secondaryColor=E)),n})}:(e=c.findByName("useProfileThemeColors",!1),e?function(){return A.after("default",e,function([t,n,i],r){if((t!=null&&t.id===O||i)&&_){if(S!==null)return[S,E??S];if(E!==null)return[E,E]}return r})}:function(){return function(){return!0}})}(),tt=function(){return A.instead("getPurchase",je,function(e,t){return O?{purchasedAt:new Date}:t(e)})},w=String.fromCodePoint(8203),b=4096,y=917504,ee=y+b-1;function te(e,t){return String.fromCodePoint(...[...`[#${e.toString(16)},#${t.toString(16)}]`].map(function(n){return n.codePointAt(0)+y}))}function pe(e){const[t,n]=e.matchAll(/(?<=#)[\dA-Fa-f]{1,6}/g);return[t?parseInt(t[0],16):-1,n?parseInt(n[0],16):-1]}function ne(e){if(e===0)return String.fromCodePoint(y);let t="";for(;e>0;e=Math.trunc(e/b))t=String.fromCodePoint(e%b+y)+t;return t}function L(e){if(e==="")return-1;let t=0;for(let n=0;n16777215)return-2;t+=e.codePointAt(n)*b**(e.length-1-n)}return t}function H(e){if(e===0n)return String.fromCodePoint(y);let t="";for(;e>0n;e/=BigInt(b))t=String.fromCodePoint(Number(e%BigInt(b))+y)+t;return t}function M(e){if(e==="")return-1n;let t=0n;for(let n=0;n=10000000000000000000n)return-2n;t+=BigInt(e.codePointAt(n))*BigInt(b)**BigInt(e.length-1-n)}return t}function nt(e,t,n,i){let r="";if(i){if(e>=0)return t>=0?r=te(e,t):r=te(e,e),n&&(r+=w+H(BigInt(n))),r;if(t>=0)return r=te(t,t),n&&(r+=w+H(BigInt(n))),r}else if(e>=0){if(r=ne(e),t>=0&&e!==t)return r+=w+ne(t),n&&(r+=w+H(BigInt(n))),r}else t>=0&&(r=ne(t));return n&&(r+=w+w+H(BigInt(n))),r}function re(e){const t=["","",""];let n=0;for(const i of e){const r=i.codePointAt(0);if(r===8203){if(n>=2)break;n++}else if(r>=y&&r<=ee)t[n]+=String.fromCodePoint(r-y);else if(n>0||t[0])break}return t}function he(e){for(const t of e){const n=t.codePointAt(0);if(n>=y&&n<=ee||n===8203)return!0}return!1}function Ee(e){return[...e].filter(function(t){const n=t.codePointAt(0);return(nee)&&n!==8203}).join("").trim()}function V(e,t,n){t>-1?(e.themeColors=[t,n>-1?n:t],e.premiumType=2):n>-1&&(e.themeColors=[n,n],e.premiumType=2)}function G(e,t){t>-1n&&(e.profileEffectId=e.profileEffectID=t.toString(),e.premiumType=2)}const rt=function(){return A.after("getUserProfile",N,function(e,t){if(!t||t.profileFetchFailed)return t;if(p.storage.prioritizeNitro){if(t.themeColors){if(!(t.profileEffectId||t.profileEffectID)){const r=re(t.bio);L(r[0])===-2?G(t,M(r[1])):G(t,M(r[2]))}return t}else if(t.profileEffectId||t.profileEffectID){const r=re(t.bio),l=L(r[0]);return l===-2?V(t,...pe(r[0])):V(t,l,L(r[1])),t}}const n=re(t.bio),i=L(n[0]);return i===-2?(V(t,...pe(n[0])),G(t,M(n[1]))):(V(t,i,L(n[1])),G(t,M(n[2]))),t})},oe=c.findByName("ProfileEffectRecord");(function(e){return e[e.AVATAR_DECORATION=0]="AVATAR_DECORATION",e[e.PROFILE_EFFECT=1]="PROFILE_EFFECT",e[e.NONE=100]="NONE",e[e.BUNDLE=1e3]="BUNDLE",e})({});const ot=c.findByPropsAll("NONE_ITEM");let it,ye;const ct=function(){return ot.map(function(e){return A.after("default",e,function(t,n){if(O){const i=Z.profileEffects;it!==i?(n.splice(1),n[0].items.splice(1),Z.profileEffects.forEach(function(r){n[0].items.push(new oe(r))}),ye=n):n=ye}return n})})};function Pe(e){return typeof e[Symbol.iterator]=="function"}function ie(e){return e!==null&&typeof e=="object"}function ce(e){return ie(e)&&"type"in e}function Se(e){return"children"in e.props}function lt(e){return"_context"in e}function st(e){return"render"in e}function ft(e){return"type"in e}function B(e){return typeof e=="symbol"?Symbol.keyFor(e)||null:typeof e=="function"?e.displayName||e.name||null:lt(e)?e._context.displayName||null:e.displayName?e.displayName:st(e)?e.render.displayName||e.render.name||null:ft(e)?B(e.type):null}function W(e,t,n=200){if(ie(e))if(Pe(e)){if(n>0)for(const i of e){const r=W(i,t,n-1);if(r)return r}}else{if(t(e))return e;if(Se(e))return W(e.props.children,t,n-1)}return null}function K(e,t,n=200){if(ie(e)){if(Pe(e)){if(n>0)for(const i of e){const r=K(i,t,n-1);if(r)return r}}else if(Se(e))return t(e.props.children)?e:K(e.props.children,t,n-1)}return null}const ge=c.findByName("EditProfileEffectActionSheet");let le;function ut(e){const{currentEffectId:t,effects:n,onSelect:i,user:r}=e,l=ge({user:r}),h=q(),P=o.useMemo(function(){return n.map(function(f){return{items:new oe(f)}})},[n]);if(p.storage.forceFallbackEffectPicker)return o.createElement(j,e);let g=!1;const a=W(l,function(f){return B(f.type)==="EditProfileEffectInner"?!0:"profileEffects"in f.props&&"selectedProfileEffect"in f.props&&typeof f.props.setSelectedProfileEffect=="function"?g=!0:!1});if(!a)return le||o.createElement(j,e);const C=W(l,function(f){return B(f.type)==="Button"});if(!C)return le||o.createElement(j,e);if(g){a.props.selectedProfileEffect===void 0&&a.props.setSelectedProfileEffect(e.currentEffectId?{id:e.currentEffectId}:null),a.props.profileEffects=e.effects;const f=K(l,function(s){return Array.isArray(s)&&s.some(function(d){return B(d.type)==="DisplayBanner"})});if(f){const s=l;f.props.children=o.createElement(Ze,{theme:s.props.theme,primaryColor:s.props.primaryColor,secondaryColor:s.props.secondaryColor,children:f.props.children}),s.props.theme=h.theme,s.props.primaryColor=h.primaryColor,s.props.secondaryColor=h.secondaryColor}}else a.props.selectedProfileEffect===void 0&&a.props.setSelectedProfileEffect(t?new oe({id:t}):null),a.props.purchases=P;return $(r.id),C.props.onPress=function(){$(void 0),i(n.find(function(f){return f.id===a.props.selectedProfileEffect?.id})?.config??null)},le=l}const at=ge?ut:j,Ce=c.findByProps("triggerHapticFeedback"),dt=Ce?.HapticFeedbackTypes??{},mt=Ce?.triggerHapticFeedback??function(){},pt=k.getAssetIDByName("img_none"),ht=c.findByProps("DEFAULT_PROFILE_EFFECT_WH_RATIO")?.DEFAULT_PROFILE_EFFECT_WH_RATIO??45/88,Et=k.getAssetIDByName("sample-profile-small")??{uri:"https://discordapp.com/assets/f328a6f8209d4f1f5022.png"};k.getAssetIDByName("toast_copy_link"),k.getAssetIDByName("Small");const se=c.findByProps("Radius")?.Radius??{},T=c.findByProps("Spacing")?.Spacing??{},yt=c.findByProps("SafeAreaContext")?.SafeAreaContext,Pt=c.findByName("useWindowDimensions")??function(){},Ae=3;function be({label:e,isSelected:t,size:n,colors:i,onPress:r,style:l,children:h}){const[P,g,a]=i;return o.createElement(ve,{accessibilityLabel:e,accessibilityRole:"button",accessibilityState:{selected:t},disabled:t,onPress:function(){mt(dt.IMPACT_LIGHT),r()},style:[{height:n,width:n,overflow:"hidden",backgroundColor:g,borderColor:P,borderRadius:se.sm,borderWidth:2},t&&{borderColor:a},l]},h)}function j({currentEffectId:e,effects:t,onSelect:n}){const[i,r]=o.useState(e),[l,h]=o.useState(0),{theme:P}=q(),g=o.useMemo(function(){return[U(P,["BACKGROUND_PRIMARY","BACKGROUND_BASE_LOWER","BACKGROUND_BASE_LOW"],"#1E1F22"),U(P,["BACKGROUND_FLOATING","MOBILE_FLOATINGBAR_BACKGROUND","BACKGROUND_BASE_LOWER"],"#2B2D31"),U(P,["BUTTON_OUTLINE_BRAND_BORDER_ACTIVE","BORDER_FOCUS"],"#5865F2")]},[P]),a=Pt(),C=o.useContext(yt),f=o.useMemo(function(){const s=Ve.chunk([null,...t],Ae),d=s[s.length-1];for(;d.length<3;)d.push(void 0);return s},[t]);return o.createElement(Ct,{transparentHeader:!0,scrollable:!0,startExpanded:!0,startHeight:a.height-C.top},o.createElement(At,{scrollsToTop:!1},o.createElement(u.View,{style:{flex:1,flexDirection:"column",alignItems:"center",paddingBottom:88}},o.createElement(X,{variant:"redesign/heading-18/bold",color:"header-primary",style:{margin:T.PX_16}},e?"Change Effect":"Add Profile Effect"),o.createElement(u.View,{style:{width:"72%",minHeight:38}},o.createElement(X,{variant:"heading-md/bold",color:"header-primary",style:{textAlign:"center"}},t.find(function(s){return s.id===i})?.config.title??"None")),o.createElement(u.View,{style:{flex:1,width:"92%",marginTop:3}},o.createElement(wt,{accessibilityLabel:"Profile Effect Selection Section",numColumns:1,estimatedItemSize:98,ItemSeparatorComponent:function(){return o.createElement(u.View,{style:{height:T.PX_16}})},contentContainerStyle:{paddingHorizontal:T.PX_4},data:f,extraData:i,renderItem:function({item:s}){return o.createElement(u.View,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:T.PX_16}},s.map(function(d){return d?o.createElement(be,{label:d.config.accessibilityLabel,isSelected:d.id===i,size:l,colors:g,onPress:function(){r(d.id)}},o.createElement(Re,{effect:d.config})):d===null?o.createElement(be,{label:"None",isSelected:!i,size:l,colors:g,onPress:function(){r(void 0)},style:{alignItems:"center",justifyContent:"center"}},o.createElement(we,{source:pt,size:we.Sizes.LARGE}),o.createElement(X,{variant:"text-sm/medium",color:"header-primary",style:{marginTop:T.PX_4}},"None")):o.createElement(u.View,{style:{width:l,height:l}})}))},onLayout:function(s){h((s.nativeEvent.layout.width-64)/Ae)}})))),o.createElement(F,{text:"Apply",textStyle:{fontSize:16},onPress:function(){n(t.find(function(s){return s.id===i})?.config??null)},style:{position:"absolute",right:0,bottom:0,left:0,height:48,marginHorizontal:36,marginBottom:T.PX_48,borderRadius:se.round}}))}const St=c.findByName("showCustomColorPickerActionSheet")??function(){};function Be(e){return e.color??=0,St(e)}const fe="__FPTE__";function gt(e,t){function n(i){i.key===fe&&(z.unsubscribe("HIDE_ACTION_SHEET",n),$(void 0))}z.subscribe("HIDE_ACTION_SHEET",n),bt({content:o.createElement(at,{effects:Z.profileEffects,onSelect:function(i){e(i),Bt(fe)},user:v.getCurrentUser(),currentEffectId:t}),key:fe})}const Ct=c.findByProps("BottomSheet")?.BottomSheet??c.findByProps("ActionSheet")?.ActionSheet??function(){throw new Error("FakeProfileThemesAndEffects threw an error to avoid an otherwise-inevitable, unrecoverable freeze.")},At=c.findByProps("BottomSheetScrollView")?.BottomSheetScrollView??function(){return null},Te=c.findByProps("showActionSheet"),bt=Te?.showActionSheet??function(){},Bt=Te?.default?.hideActionSheet??function(){},Tt=I.Forms.FormSection,Ft=I.Forms.FormRow,Fe=I.Forms.FormRadioRow,Ie=I.Forms.FormSwitchRow,It=I.Forms.FormCardSection,_e=c.findByProps("saveProfileChanges");function _t({guildId:e}){const[t,n]=Je(null),[i,r]=$e(null),[l,h]=o.useState(null);qe(!0);const[P,g]=o.useState(!1),{theme:a}=q(),[C,f]=o.useMemo(function(){return[U(a,["HEADER_SECONDARY","TEXT_MUTED","TEXT_SUBTLE"],"#B5BAC1"),U(a,["BACKGROUND_ACCENT","BACKGROUND_BASE_LOWER","BACKGROUND_BASE_LOW"],"#1E1F22")]},[a]),s=Qe(v.getCurrentUser()?.getAvatarURL(e,80)??"",f,!1),[d,ae]=o.useState(null);o.useEffect(function(){const R=v.getCurrentUser();if(!R)return;const m=N.getUserProfile(R.id);m&&ae(m.bio??null)},[]);const D=d!==null&&he(d),Y=t!==null||i!==null||l!==null,xe=nt(t??-1,i??-1,l?.id??"",P);function xt(){const R=v.getCurrentUser();if(!R)return;let m=d??"";if(D&&!Y){m=Ee(m);try{_e.saveProfileChanges({...N.getUserProfile(R.id),bio:m}),ae(m),x.showToast("FPTE removed!")}catch(de){x.showToast("Failed to update bio!"),console.error(de)}return}if(xe){he(m)&&(m=Ee(m)),m.length>0&&(m+=" "),m+=xe;try{_e.saveProfileChanges({...N.getUserProfile(R.id),bio:m}),ae(m),x.showToast("FPTE applied!")}catch(de){x.showToast("Failed to update bio!"),console.error(de)}}}const kt=D&&!Y?"Remove FPTE":"Apply FPTE",ke=Y||D;return o.createElement(It,{title:o.createElement(u.View,{style:{flexDirection:"row",alignItems:"center"}},o.createElement(u.Text,{style:{fontSize:16,color:"#FFFFFF"}},"FPTE Builder"),o.createElement(u.Text,{style:{color:D?"#4CAF50":"#F44336",fontSize:17,marginLeft:8}},D?"Active":"Inactive")),cardStyle:{backgroundColor:"transparent"}},o.createElement(u.View,{style:{flexDirection:"row",justifyContent:"space-between"}},o.createElement(ue,{fgColor:C,label:"Primary",bgColor:t,onPress:function(){return Be({color:t,onSelect:n,suggestedColors:s})}}),o.createElement(ue,{fgColor:C,label:"Accent",bgColor:i,onPress:function(){return Be({color:i,onSelect:r,suggestedColors:s})}}),o.createElement(ue,{fgColor:C,label:"Effect",onPress:function(){return gt(h,l?.id)}},l&&o.createElement(Re,{effect:l,style:{width:"140%",height:"100%"}})),o.createElement(u.View,{style:{flexDirection:"column",alignItems:"center",marginLeft:12}},o.createElement(F,{text:kt,size:F.Sizes.SMALL,onPress:xt,style:{marginBottom:6,paddingHorizontal:12,opacity:ke?1:0},pointerEvents:ke?"auto":"none"}),o.createElement(F,{text:"Reset",look:F.Looks.LINK,color:F.Colors.TRANSPARENT,size:F.Sizes.SMALL,...Y?{}:{pointerEvents:"none",style:{opacity:0}},onPress:function(){n(null),r(null),h(null)}}))))}const ue=function({label:e,fgColor:t,bgColor:n,onPress:i,children:r}){return o.createElement(u.View,{style:{width:50}},o.createElement(ve,{accessibilityLabel:e,accessibilityRole:"button",onPress:i,style:[{display:"flex",alignItems:"center",justifyContent:"center",height:50,overflow:"hidden",borderColor:t,borderStyle:"dashed",borderWidth:2,borderRadius:se.xs},n!=null&&{backgroundColor:"#"+n.toString(16).padStart(6,"0"),borderStyle:"solid"},!!r&&{borderWidth:0}]},r??(n==null&&o.createElement(Rt,{fill:t,width:"40%",height:"40%",viewBox:"0 0 144 144"},o.createElement(Nt,{d:"M144 64H80V0H64v64H0v16h64v64h16V80h64Z"})))),!!e&&o.createElement(X,{variant:"text-sm/normal",style:{marginTop:T.PX_4,textAlign:"center"}},e))},F=I.Button,we=c.findByProps("IconSizes")?.default??function(){return null},Re=function({effect:e,style:t}){return o.createElement(u.View,{style:t},o.createElement(u.Image,{resizeMode:"cover",source:Et,style:{width:"100%",height:"100%"}}),o.createElement(u.Image,{alt:e.accessibilityLabel,resizeMethod:"resize",resizeMode:"cover",source:{uri:e.thumbnailPreviewSrc},style:{position:"absolute",width:"100%",aspectRatio:ht}}))},X=c.findByProps("TextStyleSheet")?.Text??function(){return null},wt=c.findByName("FlashList")??function(){return null},Ne=c.findByProps("Svg"),Rt=Ne?.Svg??function(){return null},Nt=Ne?.Path??function(){return null},ve=c.findByProps("PressableOpacity")?.PressableOpacity??function(){return null},vt=c.findByName("UserProfileEditForm",!1),Ut=function(){return A.after("default",vt,function(e,t){if(p.storage.hideBuilder)return t;const n=K(t,function(i){return Array.isArray(i)&&i.some(function(r){return ce(r)&&B(r.type)==="UserProfileEditFormTextField"})});if(n){const i=n.props.children.reduce(function(r,l,h){return ce(l)&&B(l.type)==="UserProfileEditFormTextField"&&r.push(h),r},[]);i.length>=3&&n.props.children.splice(i[2]+1,0,o.createElement(_t,null))}return t})},Ue=c.findByName("UserProfileEditForm",!1);function Oe(e){if(!e||ce(e)&&B(e.type)==="UserProfilePremiumUpsellCard")return null;if(e.props?.children){let t=e.props.children;Array.isArray(t)||(t=[t]);const n=t.map(Oe).filter(function(i){return i!==null});e.props.children=n.length===1?n[0]:n}return e}const Ot=function(){Ue&&A.after("default",Ue,function(e,t){return Oe(t)||t})};function Lt(){return Ge.useProxy(p.storage),o.createElement(u.ScrollView,null,o.createElement(Tt,{title:"Settings"},o.createElement(Ft,{label:"Source to prioritize"}),o.createElement(Fe,{label:"Nitro",selected:!!p.storage.prioritizeNitro,onPress:function(){p.storage.prioritizeNitro=!0}}),o.createElement(Fe,{label:"About Me",selected:!p.storage.prioritizeNitro,onPress:function(){p.storage.prioritizeNitro=!1}}),o.createElement(Ie,{label:"Hide Builder",subLabel:"Hide the FPTE Builder in the User Profile and Server Profiles settings pages",value:!!p.storage.hideBuilder,onValueChange:function(e){p.storage.hideBuilder=e}}),o.createElement(Ie,{label:"Force fallback effect picker",value:!!p.storage.forceFallbackEffectPicker,onValueChange:function(e){p.storage.forceFallbackEffectPicker=e}})))}function Le(){const e=v.getCurrentUser();if(!e)return;const t=N.getUserProfile(e.id);t&&z.dispatch({type:"USER_PROFILE_FETCH_SUCCESS",user:e,user_profile:t,connected_accounts:t.connectedAccounts})}let De=function(){};var Dt={onLoad(){De=Ke("FakeProfileThemesAndEffects",ze.logger,{"purchase check":tt,"user profile data":rt,"profile effect sections":function(){const e=ct();return function(){return e.forEach(function(t){return t()})}},"profile theme":et,"profile edit form":Ut,"nitro upsell card":Ot}),Le()},onUnload(){De(),Le()},settings:Lt};return Q.default=Dt,Object.defineProperty(Q,"__esModule",{value:!0}),Q})({},vendetta,vendetta.metro.common,vendetta.metro,vendetta.patcher,window.React,vendetta.ui,vendetta.plugin,vendetta.ui.toasts,vendetta.metro.common.ReactNative,lodash,vendetta.ui.assets,vendetta.ui.components,vendetta.storage); +(function(Q,ze,He,c,A,o,Me,p,x,u,Ve,k,I,Ge){"use strict";function We(e,t,n,i){try{return n()}catch(r){return i.error(`[${e}] Failed to apply the "${t}" patch, that surface will be skipped: ${r}`),function(){}}}function Ke(e,t,n){const i=Object.entries(n).map(function([r,l]){return We(e,r,l,t)});return function(){return i.forEach(function(r){return r()})}}const z=He.FluxDispatcher,je=c.findByStoreName("CollectiblesPurchaseStore"),Z=c.findByStoreName("ProfileEffectStore"),N=c.findByStoreName("UserProfileStore"),v=c.findByStoreName("UserStore"),Xe=Me.semanticColors,Ye=c.find(function(e){return e.default?.internal?.resolveSemanticColor})?.default.internal.resolveSemanticColor??c.find(function(e){return e.meta?.resolveSemanticColor})?.meta.resolveSemanticColor??function(){};function U(e,t,n){for(const i of t){const r=Xe?.[i];if(r)try{const l=Ye(e,r);if(l)return l}catch{}}return n}const Qe=c.findByProps("useAvatarColors")?.useAvatarColors??function(){},me=c.findByProps("getProfileTheme")?.getProfileTheme??function(e){return e==null?null:"dark"},q=c.findByProps("useThemeContext")?.useThemeContext??function(){return{}},Ze=c.findByProps("ThemeContextProvider")?.ThemeContextProvider??function({children:e}){return e};function J(){z.dispatch({type:"USER_SETTINGS_ACCOUNT_SUBMIT_SUCCESS"})}let _=!0;function qe(e){const[t,n]=o.useState(function(){return _=e});return[t,function(i){n(_=i),J()}]}let S=null;function Je(e){const[t,n]=o.useState(function(){return S=e});return[t,function(i){n(S=i),_&&J()}]}let E=null;function $e(e){const[t,n]=o.useState(function(){return E=e});return[t,function(i){n(E=i),_&&J()}]}let O;function $(e){O=e}const et=function(){let e=c.findByName("useProfileTheme",!1);return e?function(){return A.after("default",e,function([t],n){const{user:i}=t;return(i!=null&&i.id===O||"pendingThemeColors"in t)&&_&&(S!==null?(n.theme=me(S),n.primaryColor=S,n.secondaryColor=E??S):E!==null&&(n.theme=me(E),n.primaryColor=E,n.secondaryColor=E)),n})}:(e=c.findByName("useProfileThemeColors",!1),e?function(){return A.after("default",e,function([t,n,i],r){if((t!=null&&t.id===O||i)&&_){if(S!==null)return[S,E??S];if(E!==null)return[E,E]}return r})}:function(){return function(){return!0}})}(),tt=function(){return A.instead("getPurchase",je,function(e,t){return O?{purchasedAt:new Date}:t(e)})},w=String.fromCodePoint(8203),b=4096,y=917504,ee=y+b-1;function te(e,t){return String.fromCodePoint(...[...`[#${e.toString(16)},#${t.toString(16)}]`].map(function(n){return n.codePointAt(0)+y}))}function pe(e){const[t,n]=e.matchAll(/(?<=#)[\dA-Fa-f]{1,6}/g);return[t?parseInt(t[0],16):-1,n?parseInt(n[0],16):-1]}function ne(e){if(e===0)return String.fromCodePoint(y);let t="";for(;e>0;e=Math.trunc(e/b))t=String.fromCodePoint(e%b+y)+t;return t}function L(e){if(e==="")return-1;let t=0;for(let n=0;n16777215)return-2;t+=e.codePointAt(n)*b**(e.length-1-n)}return t}function H(e){if(e===0n)return String.fromCodePoint(y);let t="";for(;e>0n;e/=BigInt(b))t=String.fromCodePoint(Number(e%BigInt(b))+y)+t;return t}function M(e){if(e==="")return-1n;let t=0n;for(let n=0;n=10000000000000000000n)return-2n;t+=BigInt(e.codePointAt(n))*BigInt(b)**BigInt(e.length-1-n)}return t}function nt(e,t,n,i){let r="";if(i){if(e>=0)return t>=0?r=te(e,t):r=te(e,e),n&&(r+=w+H(BigInt(n))),r;if(t>=0)return r=te(t,t),n&&(r+=w+H(BigInt(n))),r}else if(e>=0){if(r=ne(e),t>=0&&e!==t)return r+=w+ne(t),n&&(r+=w+H(BigInt(n))),r}else t>=0&&(r=ne(t));return n&&(r+=w+w+H(BigInt(n))),r}function re(e){const t=["","",""];let n=0;for(const i of e){const r=i.codePointAt(0);if(r===8203){if(n>=2)break;n++}else if(r>=y&&r<=ee)t[n]+=String.fromCodePoint(r-y);else if(n>0||t[0])break}return t}function he(e){for(const t of e){const n=t.codePointAt(0);if(n>=y&&n<=ee||n===8203)return!0}return!1}function Ee(e){return[...e].filter(function(t){const n=t.codePointAt(0);return(nee)&&n!==8203}).join("").trim()}function V(e,t,n){t>-1?(e.themeColors=[t,n>-1?n:t],e.premiumType=2):n>-1&&(e.themeColors=[n,n],e.premiumType=2)}function G(e,t){t>-1n&&(e.profileEffectId=e.profileEffectID=t.toString(),e.premiumType=2)}const rt=function(){return A.after("getUserProfile",N,function(e,t){if(!t||t.profileFetchFailed)return t;if(p.storage.prioritizeNitro){if(t.themeColors){if(!(t.profileEffectId||t.profileEffectID)){const r=re(t.bio);L(r[0])===-2?G(t,M(r[1])):G(t,M(r[2]))}return t}else if(t.profileEffectId||t.profileEffectID){const r=re(t.bio),l=L(r[0]);return l===-2?V(t,...pe(r[0])):V(t,l,L(r[1])),t}}const n=re(t.bio),i=L(n[0]);return i===-2?(V(t,...pe(n[0])),G(t,M(n[1]))):(V(t,i,L(n[1])),G(t,M(n[2]))),t})},oe=c.findByName("ProfileEffectRecord");(function(e){return e[e.AVATAR_DECORATION=0]="AVATAR_DECORATION",e[e.PROFILE_EFFECT=1]="PROFILE_EFFECT",e[e.NONE=100]="NONE",e[e.BUNDLE=1e3]="BUNDLE",e})({});const ot=c.findByPropsAll("NONE_ITEM");let it,ye;const ct=function(){return ot.map(function(e){return A.after("default",e,function(t,n){if(O){const i=Z.profileEffects;it!==i?(n.splice(1),n[0].items.splice(1),Z.profileEffects.forEach(function(r){n[0].items.push(new oe(r))}),ye=n):n=ye}return n})})};function Pe(e){return typeof e[Symbol.iterator]=="function"}function ie(e){return e!==null&&typeof e=="object"}function ce(e){return ie(e)&&"type"in e}function Se(e){return"children"in e.props}function lt(e){return"_context"in e}function st(e){return"render"in e}function ft(e){return"type"in e}function B(e){return typeof e=="symbol"?Symbol.keyFor(e)||null:typeof e=="function"?e.displayName||e.name||null:lt(e)?e._context.displayName||null:e.displayName?e.displayName:st(e)?e.render.displayName||e.render.name||null:ft(e)?B(e.type):null}function W(e,t,n=200){if(ie(e))if(Pe(e)){if(n>0)for(const i of e){const r=W(i,t,n-1);if(r)return r}}else{if(t(e))return e;if(Se(e))return W(e.props.children,t,n-1)}return null}function K(e,t,n=200){if(ie(e)){if(Pe(e)){if(n>0)for(const i of e){const r=K(i,t,n-1);if(r)return r}}else if(Se(e))return t(e.props.children)?e:K(e.props.children,t,n-1)}return null}const ge=c.findByName("EditProfileEffectActionSheet");let le;function ut(e){const{currentEffectId:t,effects:n,onSelect:i,user:r}=e,l=ge({user:r}),h=q(),P=o.useMemo(function(){return n.map(function(f){return{items:new oe(f)}})},[n]);if(p.storage.forceFallbackEffectPicker)return o.createElement(j,e);let g=!1;const a=W(l,function(f){return B(f.type)==="EditProfileEffectInner"?!0:"profileEffects"in f.props&&"selectedProfileEffect"in f.props&&typeof f.props.setSelectedProfileEffect=="function"?g=!0:!1});if(!a)return le||o.createElement(j,e);const C=W(l,function(f){return B(f.type)==="Button"});if(!C)return le||o.createElement(j,e);if(g){a.props.selectedProfileEffect===void 0&&a.props.setSelectedProfileEffect(e.currentEffectId?{id:e.currentEffectId}:null),a.props.profileEffects=e.effects;const f=K(l,function(s){return Array.isArray(s)&&s.some(function(d){return B(d.type)==="DisplayBanner"})});if(f){const s=l;f.props.children=o.createElement(Ze,{theme:s.props.theme,primaryColor:s.props.primaryColor,secondaryColor:s.props.secondaryColor,children:f.props.children}),s.props.theme=h.theme,s.props.primaryColor=h.primaryColor,s.props.secondaryColor=h.secondaryColor}}else a.props.selectedProfileEffect===void 0&&a.props.setSelectedProfileEffect(t?new oe({id:t}):null),a.props.purchases=P;return $(r.id),C.props.onPress=function(){$(void 0),i(n.find(function(f){return f.id===a.props.selectedProfileEffect?.id})?.config??null)},le=l}const at=ge?ut:j,Ce=c.findByProps("triggerHapticFeedback"),dt=Ce?.HapticFeedbackTypes??{},mt=Ce?.triggerHapticFeedback??function(){},pt=k.getAssetIDByName("img_none"),ht=c.findByProps("DEFAULT_PROFILE_EFFECT_WH_RATIO")?.DEFAULT_PROFILE_EFFECT_WH_RATIO??45/88,Et=k.getAssetIDByName("sample-profile-small")??{uri:"https://discordapp.com/assets/f328a6f8209d4f1f5022.png"};k.getAssetIDByName("toast_copy_link"),k.getAssetIDByName("Small");const se=c.findByProps("Radius")?.Radius??{},T=c.findByProps("Spacing")?.Spacing??{},yt=c.findByProps("SafeAreaContext")?.SafeAreaContext,Pt=c.findByName("useWindowDimensions")??function(){},Ae=3;function be({label:e,isSelected:t,size:n,colors:i,onPress:r,style:l,children:h}){const[P,g,a]=i;return o.createElement(ve,{accessibilityLabel:e,accessibilityRole:"button",accessibilityState:{selected:t},disabled:t,onPress:function(){mt(dt.IMPACT_LIGHT),r()},style:[{height:n,width:n,overflow:"hidden",backgroundColor:g,borderColor:P,borderRadius:se.sm,borderWidth:2},t&&{borderColor:a},l]},h)}function j({currentEffectId:e,effects:t,onSelect:n}){const[i,r]=o.useState(e),[l,h]=o.useState(0),{theme:P}=q(),g=o.useMemo(function(){return[U(P,["BACKGROUND_PRIMARY","BACKGROUND_BASE_LOWER","BACKGROUND_BASE_LOW"],"#1E1F22"),U(P,["BACKGROUND_FLOATING","MOBILE_FLOATINGBAR_BACKGROUND","BACKGROUND_BASE_LOWER"],"#2B2D31"),U(P,["BUTTON_OUTLINE_BRAND_BORDER_ACTIVE","BORDER_FOCUS"],"#5865F2")]},[P]),a=Pt(),C=o.useContext(yt),f=o.useMemo(function(){const s=Ve.chunk([null,...t],Ae),d=s[s.length-1];for(;d.length<3;)d.push(void 0);return s},[t]);return o.createElement(Ct,{transparentHeader:!0,scrollable:!0,startExpanded:!0,startHeight:a.height-C.top},o.createElement(At,{scrollsToTop:!1},o.createElement(u.View,{style:{flex:1,flexDirection:"column",alignItems:"center",paddingBottom:88}},o.createElement(X,{variant:"redesign/heading-18/bold",color:"header-primary",style:{margin:T.PX_16}},e?"Change Effect":"Add Profile Effect"),o.createElement(u.View,{style:{width:"72%",minHeight:38}},o.createElement(X,{variant:"heading-md/bold",color:"header-primary",style:{textAlign:"center"}},t.find(function(s){return s.id===i})?.config.title??"None")),o.createElement(u.View,{style:{flex:1,width:"92%",marginTop:3}},o.createElement(wt,{accessibilityLabel:"Profile Effect Selection Section",numColumns:1,estimatedItemSize:98,ItemSeparatorComponent:function(){return o.createElement(u.View,{style:{height:T.PX_16}})},contentContainerStyle:{paddingHorizontal:T.PX_4},data:f,extraData:i,renderItem:function({item:s}){return o.createElement(u.View,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:T.PX_16}},s.map(function(d){return d?o.createElement(be,{label:d.config.accessibilityLabel,isSelected:d.id===i,size:l,colors:g,onPress:function(){r(d.id)}},o.createElement(Re,{effect:d.config})):d===null?o.createElement(be,{label:"None",isSelected:!i,size:l,colors:g,onPress:function(){r(void 0)},style:{alignItems:"center",justifyContent:"center"}},o.createElement(we,{source:pt,size:we.Sizes.LARGE}),o.createElement(X,{variant:"text-sm/medium",color:"header-primary",style:{marginTop:T.PX_4}},"None")):o.createElement(u.View,{style:{width:l,height:l}})}))},onLayout:function(s){h((s.nativeEvent.layout.width-64)/Ae)}})))),o.createElement(F,{text:"Apply",textStyle:{fontSize:16},onPress:function(){n(t.find(function(s){return s.id===i})?.config??null)},style:{position:"absolute",right:0,bottom:0,left:0,height:48,marginHorizontal:36,marginBottom:T.PX_48,borderRadius:se.round}}))}const St=c.findByName("showCustomColorPickerActionSheet")??function(){};function Be(e){return e.color??=0,St(e)}const fe="__FPTE__";function gt(e,t){function n(i){i.key===fe&&(z.unsubscribe("HIDE_ACTION_SHEET",n),$(void 0))}z.subscribe("HIDE_ACTION_SHEET",n),bt({content:o.createElement(at,{effects:Z.profileEffects,onSelect:function(i){e(i),Bt(fe)},user:v.getCurrentUser(),currentEffectId:t}),key:fe})}const Ct=c.findByProps("BottomSheet")?.BottomSheet??c.findByProps("ActionSheet")?.ActionSheet??function(){throw new Error("FakeProfileThemesAndEffects threw an error to avoid an otherwise-inevitable, unrecoverable freeze.")},At=c.findByProps("BottomSheetScrollView")?.BottomSheetScrollView??function(){return null},Te=c.findByProps("showActionSheet"),bt=Te?.showActionSheet??function(){},Bt=Te?.default?.hideActionSheet??function(){},Tt=I.Forms.FormSection,Ft=I.Forms.FormRow,Fe=I.Forms.FormRadioRow,Ie=I.Forms.FormSwitchRow,It=I.Forms.FormCardSection,_e=c.findByProps("saveProfileChanges");function _t({guildId:e}){const[t,n]=Je(null),[i,r]=$e(null),[l,h]=o.useState(null);qe(!0);const[P,g]=o.useState(!1),{theme:a}=q(),[C,f]=o.useMemo(function(){return[U(a,["HEADER_SECONDARY","TEXT_MUTED","TEXT_SUBTLE"],"#B5BAC1"),U(a,["BACKGROUND_ACCENT","BACKGROUND_BASE_LOWER","BACKGROUND_BASE_LOW"],"#1E1F22")]},[a]),s=Qe(v.getCurrentUser()?.getAvatarURL(e,80)??"",f,!1),[d,ae]=o.useState(null);o.useEffect(function(){const R=v.getCurrentUser();if(!R)return;const m=N.getUserProfile(R.id);m&&ae(m.bio??null)},[]);const D=d!==null&&he(d),Y=t!==null||i!==null||l!==null,xe=nt(t??-1,i??-1,l?.id??"",P);function xt(){const R=v.getCurrentUser();if(!R)return;let m=d??"";if(D&&!Y){m=Ee(m);try{_e.saveProfileChanges({...N.getUserProfile(R.id),bio:m}),ae(m),x.showToast("FPTE removed!")}catch(de){x.showToast("Failed to update bio!"),console.error(de)}return}if(xe){he(m)&&(m=Ee(m)),m.length>0&&(m+=" "),m+=xe;try{_e.saveProfileChanges({...N.getUserProfile(R.id),bio:m}),ae(m),x.showToast("FPTE applied!")}catch(de){x.showToast("Failed to update bio!"),console.error(de)}}}const kt=D&&!Y?"Remove FPTE":"Apply FPTE",ke=Y||D;return o.createElement(It,{title:o.createElement(u.View,{style:{flexDirection:"row",alignItems:"center"}},o.createElement(u.Text,{style:{fontSize:16,color:"#FFFFFF"}},"FPTE Builder"),o.createElement(u.Text,{style:{color:D?"#4CAF50":"#F44336",fontSize:17,marginLeft:8}},D?"Active":"Inactive")),cardStyle:{backgroundColor:"transparent"}},o.createElement(u.View,{style:{flexDirection:"row",justifyContent:"space-between"}},o.createElement(ue,{fgColor:C,label:"Primary",bgColor:t,onPress:function(){return Be({color:t,onSelect:n,suggestedColors:s})}}),o.createElement(ue,{fgColor:C,label:"Accent",bgColor:i,onPress:function(){return Be({color:i,onSelect:r,suggestedColors:s})}}),o.createElement(ue,{fgColor:C,label:"Effect",onPress:function(){return gt(h,l?.id)}},l&&o.createElement(Re,{effect:l,style:{width:"140%",height:"100%"}})),o.createElement(u.View,{style:{flexDirection:"column",alignItems:"center",marginLeft:12}},o.createElement(F,{text:kt,size:F.Sizes.SMALL,onPress:xt,style:{marginBottom:6,paddingHorizontal:12,opacity:ke?1:0},pointerEvents:ke?"auto":"none"}),o.createElement(F,{text:"Reset",look:F.Looks.LINK,color:F.Colors.TRANSPARENT,size:F.Sizes.SMALL,...Y?{}:{pointerEvents:"none",style:{opacity:0}},onPress:function(){n(null),r(null),h(null)}}))))}const ue=function({label:e,fgColor:t,bgColor:n,onPress:i,children:r}){return o.createElement(u.View,{style:{width:50}},o.createElement(ve,{accessibilityLabel:e,accessibilityRole:"button",onPress:i,style:[{display:"flex",alignItems:"center",justifyContent:"center",height:50,overflow:"hidden",borderColor:t,borderStyle:"dashed",borderWidth:2,borderRadius:se.xs},n!=null&&{backgroundColor:"#"+n.toString(16).padStart(6,"0"),borderStyle:"solid"},!!r&&{borderWidth:0}]},r??(n==null&&o.createElement(Rt,{fill:t,width:"40%",height:"40%",viewBox:"0 0 144 144"},o.createElement(Nt,{d:"M144 64H80V0H64v64H0v16h64v64h16V80h64Z"})))),!!e&&o.createElement(X,{variant:"text-sm/normal",style:{marginTop:T.PX_4,textAlign:"center"}},e))},F=I.Button,we=c.findByProps("IconSizes")?.default??function(){return null},Re=function({effect:e,style:t}){return o.createElement(u.View,{style:t},o.createElement(u.Image,{resizeMode:"cover",source:Et,style:{width:"100%",height:"100%"}}),o.createElement(u.Image,{alt:e.accessibilityLabel,resizeMethod:"resize",resizeMode:"cover",source:{uri:e.thumbnailPreviewSrc},style:{position:"absolute",width:"100%",aspectRatio:ht}}))},X=c.findByProps("TextStyleSheet")?.Text??function(){return null},wt=c.findByName("FlashList")??function(){return null},Ne=c.findByProps("Svg"),Rt=Ne?.Svg??function(){return null},Nt=Ne?.Path??function(){return null},ve=c.findByProps("PressableOpacity")?.PressableOpacity??function(){return null},vt=c.findByName("UserProfileEditForm",!1),Ut=function(){return A.after("default",vt,function(e,t){if(p.storage.hideBuilder)return t;const n=K(t,function(i){return Array.isArray(i)&&i.some(function(r){return ce(r)&&B(r.type)==="UserProfileEditFormTextField"})});if(n){const i=n.props.children.reduce(function(r,l,h){return ce(l)&&B(l.type)==="UserProfileEditFormTextField"&&r.push(h),r},[]);i.length>=3&&n.props.children.splice(i[2]+1,0,o.createElement(_t,null))}return t})},Ue=c.findByName("UserProfileEditForm",!1);function Oe(e){if(!e||ce(e)&&B(e.type)==="UserProfilePremiumUpsellCard")return null;if(e.props?.children){let t=e.props.children;Array.isArray(t)||(t=[t]);const n=t.map(Oe).filter(function(i){return i!==null});e.props.children=n.length===1?n[0]:n}return e}const Ot=function(){Ue&&A.after("default",Ue,function(e,t){return Oe(t)||t})};function Lt(){return Ge.useProxy(p.storage),o.createElement(u.ScrollView,null,o.createElement(Tt,{title:"Settings"},o.createElement(Ft,{label:"Source to prioritize"}),o.createElement(Fe,{label:"Nitro",selected:!!p.storage.prioritizeNitro,onPress:function(){p.storage.prioritizeNitro=!0}}),o.createElement(Fe,{label:"About Me",selected:!p.storage.prioritizeNitro,onPress:function(){p.storage.prioritizeNitro=!1}}),o.createElement(Ie,{label:"Hide Builder",subLabel:"Hide the FPTE Builder in the User Profile and Server Profiles settings pages",value:!!p.storage.hideBuilder,onValueChange:function(e){p.storage.hideBuilder=e}}),o.createElement(Ie,{label:"Force fallback effect picker",value:!!p.storage.forceFallbackEffectPicker,onValueChange:function(e){p.storage.forceFallbackEffectPicker=e}})))}function Le(){const e=v.getCurrentUser();if(!e)return;const t=N.getUserProfile(e.id);t&&z.dispatch({type:"USER_PROFILE_FETCH_SUCCESS",user:e,user_profile:t,connected_accounts:t.connectedAccounts})}let De=function(){};var Dt={onLoad(){De=Ke("FakeProfileThemesAndEffects",ze.logger,{"purchase check":tt,"user profile data":rt,"profile effect sections":function(){const e=ct();return function(){return e.forEach(function(t){return t()})}},"profile theme":et,"profile edit form":Ut,"nitro upsell card":Ot}),Le()},onUnload(){De(),Le()},settings:Lt};return Q.default=Dt,Object.defineProperty(Q,"__esModule",{value:!0}),Q})({},vendetta,vendetta.metro.common,vendetta.metro,vendetta.patcher,window.React,vendetta.ui,vendetta.plugin,vendetta.ui.toasts,vendetta.metro.common.ReactNative,lodash,vendetta.ui.assets,vendetta.ui.components,vendetta.storage); diff --git a/fake-profile-themes-and-effects/install/manifest.json b/fake-profile-themes-and-effects/install/manifest.json index 29882e9..f6fe530 100644 --- a/fake-profile-themes-and-effects/install/manifest.json +++ b/fake-profile-themes-and-effects/install/manifest.json @@ -1 +1 @@ -{"name":"FakeProfileThemesAndEffects","description":"Profile theming and profile effects without Nitro, by hiding the color/effect data in your About Me using invisible zero-width characters.","authors":[{"name":"everestmcarthur"},{"name":"ryan"},{"name":"シグマ siguma"}],"main":"index.js","vendetta":{"icon":"ic_profile_24px"},"hash":"242d3a82b401819fdca86f6b90dbe21f9b3708a1117c2ae0ecdc8ebad119d0f1"} \ No newline at end of file +{"name":"FakeProfileThemesAndEffects","description":"Profile theming and profile effects without Nitro, by hiding the color/effect data in your About Me using invisible zero-width characters.","authors":[{"name":"everestmcarthur"},{"name":"ryan"},{"name":"シグマ siguma"}],"main":"index.js","vendetta":{"icon":"ic_profile_24px"},"hash":"3710bf5a7c5a53fe220a27708c6c0fc65ea3297fd10589feb4e1ba2851d0067f"} \ No newline at end of file diff --git a/pronoun-db/install/index.js b/pronoun-db/install/index.js index 59d6c8b..b2a6e43 100644 --- a/pronoun-db/install/index.js +++ b/pronoun-db/install/index.js @@ -1 +1 @@ -(function(c,w,l,v,d,n,b){"use strict";const E={he:"he/him",she:"she/her",they:"they/them",it:"it/its",any:"any",other:"other",ask:"ask",avoid:"avoid, use name"};function P(e){if(e?.length)return e.map(function(t){return E[t]??t}).join(" / ")}const i=new Map,a=new Map;let u=new Set,f;function h(e,t){a.get(e)?.forEach(function(r){return r(t)}),a.delete(e)}async function $(){const e=[...u];if(u=new Set,!!e.length)try{const t=await(await d.safeFetch(`https://pronoundb.org/api/v2/lookup?platform=discord&ids=${e.join(",")}`,{headers:{Accept:"application/json"}})).json();for(const r of e){const o=P(t?.[r]?.sets?.en);i.set(r,o??null),h(r,o)}}catch{for(const t of e)i.set(t,null),h(t,void 0)}}function T(e){return i.get(e)??void 0}function k(e,t){return i.has(e)?(t(i.get(e)??void 0),function(){}):(a.has(e)||a.set(e,new Set),a.get(e).add(t),u.add(e),clearTimeout(f),f=setTimeout($,150),function(){return a.get(e)?.delete(t)})}const{Text:S}=n.ReactNative,p=l.findByName("UserProfileSection",!1);function I({userId:e}){const[t,r]=n.React.useState(function(){return T(e)});return n.React.useEffect(function(){return k(e,r)},[e]),!t||!p?null:n.React.createElement(p,{title:"Pronouns"},n.React.createElement(S,{style:{fontSize:16}},t))}const{ScrollView:A,View:N}=n.ReactNative;function j({children:e}){return n.React.createElement(A,{style:{flex:1}},e,n.React.createElement(N,{style:{height:24}}))}const{View:F,Text:H}=n.ReactNative;function y({children:e,style:t}){return n.React.createElement(F,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},n.React.createElement(H,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{TouchableOpacity:U,Text:V}=n.ReactNative;function z({label:e,onPress:t,disabled:r,style:o}){return n.React.createElement(U,{disabled:r,onPress:t,style:[{backgroundColor:"#5865F2",borderRadius:8,padding:10,alignItems:"center",opacity:r?.5:1},o]},n.React.createElement(V,{style:{color:"white",fontWeight:"600"}},e))}const{View:B,Linking:D}=n.ReactNative,{FormSection:x}=b.Forms,C="https://pronoundb.org/";function L(){return n.React.createElement(j,null,n.React.createElement(x,{title:"How this works"},n.React.createElement(y,null,"This plugin doesn't have anything to configure here - there's no API key or toggle, because pronouns aren't Discord data. They come from PronounDB, a separate service where people manually set their own pronouns and link the profile to their Discord account."),n.React.createElement(y,null,"That means a user's pronouns will only show up if THEY set them at pronoundb.org - not because of anything you enable here. If you want your own pronouns to show up for other people running this plugin, set them yourself at the link below."),n.React.createElement(B,{style:{paddingHorizontal:16,paddingTop:4}},n.React.createElement(z,{label:"Open pronoundb.org",onPress:function(){return D.openURL(C)}}))))}const g=l.find(function(e){return e?.type?.name==="UserProfile"});function M(){return g?v.after("type",g,function(e,t){try{const r=d.findInReactTree(t,function(s){return Array.isArray(s?.props?.children)&&s.props.children.some(function(m){return m?.type?.name==="UserProfileBio"})})?.props?.children;if(!Array.isArray(r))return;const o=r.find(function(s){return typeof s?.props?.displayProfile?.userId=="string"})?.props?.displayProfile?.userId;if(!o)return;r.unshift(React.createElement(I,{userId:o}))}catch{}}):function(){}}let R=function(){};var O={onLoad:function(){try{R=M()}catch(e){w.logger.error(`[PronounDB] Failed to apply the profile patch: ${e}`)}},onUnload:function(){return R()},settings:L};return c.default=O,Object.defineProperty(c,"__esModule",{value:!0}),c})({},vendetta,vendetta.metro,vendetta.patcher,vendetta.utils,vendetta.metro.common,vendetta.ui.components); +(function(c,b,u,v,d,n,E){"use strict";const P={he:"he/him",she:"she/her",they:"they/them",it:"it/its",any:"any",other:"other",ask:"ask",avoid:"avoid, use name"};function $(e){if(e?.length)return e.map(function(t){return P[t]??t}).join(" / ")}const i=new Map,o=new Map;let l=new Set,f;function h(e,t){o.get(e)?.forEach(function(r){return r(t)}),o.delete(e)}async function T(){const e=[...l];if(l=new Set,!!e.length)try{const t=await(await d.safeFetch(`https://pronoundb.org/api/v2/lookup?platform=discord&ids=${e.join(",")}`,{headers:{Accept:"application/json"}})).json();for(const r of e){const a=$(t?.[r]?.sets?.en);i.set(r,a??null),h(r,a)}}catch{for(const t of e)i.set(t,null),h(t,void 0)}}function k(e){return i.get(e)??void 0}function S(e,t){return i.has(e)?(t(i.get(e)??void 0),function(){}):(o.has(e)||o.set(e,new Set),o.get(e).add(t),l.add(e),clearTimeout(f),f=setTimeout(T,150),function(){return o.get(e)?.delete(t)})}const{Text:I}=n.ReactNative,p=u.findByName("UserProfileSection",!1);function A({userId:e}){const[t,r]=n.React.useState(function(){return k(e)});return n.React.useEffect(function(){return S(e,r)},[e]),!t||!p?null:n.React.createElement(p,{title:"Pronouns"},n.React.createElement(I,{style:{fontSize:16}},t))}const{ScrollView:U,View:N}=n.ReactNative;function j({children:e}){return n.React.createElement(U,{style:{flex:1}},e,n.React.createElement(N,{style:{height:24}}))}const{View:C,Text:F}=n.ReactNative;function y({children:e,style:t}){return n.React.createElement(C,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},n.React.createElement(F,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{TouchableOpacity:H,Text:V}=n.ReactNative;function z({label:e,onPress:t,disabled:r,style:a}){return n.React.createElement(H,{disabled:r,onPress:t,style:[{backgroundColor:"#5865F2",borderRadius:8,padding:10,alignItems:"center",opacity:r?.5:1},a]},n.React.createElement(V,{style:{color:"white",fontWeight:"600"}},e))}const{View:B,Linking:D}=n.ReactNative,{FormSection:M}=E.Forms,m="https://pronoundb.org/";function x(){return n.React.createElement(j,null,n.React.createElement(M,{title:"How this works"},n.React.createElement(y,null,"This plugin doesn't have anything to configure here - there's no API key or toggle, because pronouns aren't Discord data. They come from PronounDB, a separate service where people manually set their own pronouns and link the profile to their Discord account."),n.React.createElement(y,null,"That means a user's pronouns will only show up if THEY set them at pronoundb.org - not because of anything you enable here. If you want your own pronouns to show up for other people running this plugin, set them yourself at the link below."),n.React.createElement(B,{style:{paddingHorizontal:16,paddingTop:4}},n.React.createElement(z,{label:"Open pronoundb.org",onPress:function(){return D.openURL(m)}}))))}const g=u.find(function(e){return e?.type?.name==="UserProfileContent"})??u.find(function(e){return e?.type?.name==="UserProfile"});function L(){return g?v.after("type",g,function(e,t){try{const r=d.findInReactTree(t,function(s){return Array.isArray(s?.props?.children)&&s.props.children.some(function(w){return w?.type?.name==="UserProfileAboutMeCard"||w?.type?.name==="UserProfileBio"})})?.props?.children;if(!Array.isArray(r))return;const a=r.find(function(s){return typeof s?.props?.displayProfile?.userId=="string"})?.props?.displayProfile?.userId;if(!a)return;r.unshift(React.createElement(A,{userId:a}))}catch{}}):function(){}}let R=function(){};var O={onLoad:function(){try{R=L()}catch(e){b.logger.error(`[PronounDB] Failed to apply the profile patch: ${e}`)}},onUnload:function(){return R()},settings:x};return c.default=O,Object.defineProperty(c,"__esModule",{value:!0}),c})({},vendetta,vendetta.metro,vendetta.patcher,vendetta.utils,vendetta.metro.common,vendetta.ui.components); diff --git a/pronoun-db/install/manifest.json b/pronoun-db/install/manifest.json index a478b9e..b3be8c7 100644 --- a/pronoun-db/install/manifest.json +++ b/pronoun-db/install/manifest.json @@ -1 +1 @@ -{"name":"PronounDB","description":"Shows a user's pronouns in their profile, if they've set them at pronoundb.org - see the plugin settings for details.","authors":[{"name":"everestmcarthur"}],"main":"index.js","vendetta":{"icon":"ic_group"},"hash":"d2636beadb89325f5c9f75306cb0f0e426f540bfadfac3b90bf0837e34d69d34"} \ No newline at end of file +{"name":"PronounDB","description":"Shows a user's pronouns in their profile, if they've set them at pronoundb.org - see the plugin settings for details.","authors":[{"name":"everestmcarthur"}],"main":"index.js","vendetta":{"icon":"ic_group"},"hash":"e19735c18fb09158bb2a1433d9f370fadc971f3ac67e1378e2ca05c297bc2184"} \ No newline at end of file