diff --git a/assets/vencord/vencord.js b/assets/vencord/vencord.js index 73f6ca4..bf67aea 100644 --- a/assets/vencord/vencord.js +++ b/assets/vencord/vencord.js @@ -28,6 +28,6 @@ ${R} `,x),ee.debug(`Patched Source `,g),g=x,m=w,S.delete(p.plugin)}}p.all||i.splice(s--,1)}}}}catch(n){ee.error("oopsie",n)}return e.original.call(window[ie],t)}e.original=window[ie].push,Object.defineProperty(window[ie],"push",{get:()=>e,set:t=>e.original=t,configurable:!0})}var Mi,ee,_i=a(()=>{"use strict";E();we();A();ee=new U("WebpackInterceptor","#8caaee");Object.defineProperty(window,ie,{get:()=>Mi,set:e=>{e?.push!==Array.prototype.push&&(ee.info(`Patching ${ie}.push`),Mt(e),Ma(),delete window[ie],window[ie]=e),Mi=e},configurable:!0})});function Fo(e){return Vencord.Webpack.Common.React.createElement(ze,{className:e.className,style:{padding:"2em",backgroundColor:"#e7828430",borderColor:"#e78284",color:"var(--text-normal)",...e.style}},e.children)}var Ao=a(()=>{"use strict";v()});var _a,Fi,Ai,q,Ze=a(()=>{"use strict";we();v();Ao();_a="#e78284",Fi=new U("React ErrorBoundary",_a),Ai={},q=class extends f.Component{static wrap(t){return n=>Vencord.Webpack.Common.React.createElement(q,null,Vencord.Webpack.Common.React.createElement(t,{...n}))}state={error:Ai,stack:"",message:""};static getDerivedStateFromError(t){let n=t?.stack??"",o=t?.message||String(t);if(t instanceof Error&&n){let r=n.indexOf(` `);r!==-1&&(o=n.slice(0,r),n=n.slice(r+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:n,message:o}}componentDidCatch(t,n){this.props.onError?.(t,n),Fi.error(`A component threw an Error -`,t),Fi.error("Component Stack",n.componentStack)}render(){if(this.state.error===Ai)return this.props.children;if(this.props.fallback)return Vencord.Webpack.Common.React.createElement(this.props.fallback,{children:this.props.children,...this.state});let t=this.props.message||"An error occurred while rendering this Component. More info can be found below and in your console.";return Vencord.Webpack.Common.React.createElement(Fo,{style:{overflow:"hidden"}},Vencord.Webpack.Common.React.createElement("h1",null,"Oh no!"),Vencord.Webpack.Common.React.createElement("p",null,t),Vencord.Webpack.Common.React.createElement("code",null,this.state.message,!!this.state.stack&&Vencord.Webpack.Common.React.createElement("pre",{className:$.marginTop8},this.state.stack)))}}});function se(e){return e.style??={},e.style.flexDirection||=e.flexDirection,e.style.gap??="1em",e.style.display="flex",Vencord.Webpack.Common.React.createElement("div",{...e},e.children)}var et=a(()=>{"use strict"});function Ni(e){let t=new Na({username:e.name,id:He(),bot:!0});return I.dispatch({type:"USER_UPDATE",user:t}),t}function No({plugin:e,onRestartNeeded:t,onClose:n,transitionState:o}){let[r,i]=f.useState([]),l=_e().plugins[e.name],[m,g]=f.useState({}),[b,S]=f.useState({}),s=()=>Object.values(b).every(x=>!x);f.useEffect(()=>{(async()=>{for(let x of e.authors.slice(0,6)){let R=x.id?await Ft.fetchUser(`${x.id}`).catch(()=>null):Ni(x);i(Q=>[...Q,R||Ni(x)])}})()},[]);function p(){if(!e.options){n();return}let x=!1;for(let[R,Q]of Object.entries(m)){let N=e.options[R];l[R]=Q,N?.onChange?.(Q),N?.restartNeeded&&(x=!0)}x&&t(),n()}function T(){if(!l||!e.options)return Vencord.Webpack.Common.React.createElement(u.FormText,null,"There are no settings for this plugin.");let x=[];for(let[N,Y]of Object.entries(e.options)){let ae=function(je){g(Rt=>({...Rt,[N]:je}))},ge=function(je){S(Rt=>({...Rt,[N]:je}))};var R=ae,Q=ge;let ce={onChange:ae,pluginSettings:l,id:N,onError:ge};switch(Y.type){case 4:{x.push(Vencord.Webpack.Common.React.createElement(Pr,{key:N,option:Y,...ce}));break}case 0:{x.push(Vencord.Webpack.Common.React.createElement(vr,{key:N,option:Y,...ce}));break}case 1:case 2:{x.push(Vencord.Webpack.Common.React.createElement(xr,{key:N,option:Y,...ce}));break}case 3:{x.push(Vencord.Webpack.Common.React.createElement(br,{key:N,option:Y,...ce}));break}case 5:{x.push(Vencord.Webpack.Common.React.createElement(Cr,{key:N,option:Y,...ce}));break}}}return Vencord.Webpack.Common.React.createElement(se,{flexDirection:"column",style:{gap:12}},x)}function w(x,R){let Q=e.authors.length-R,N=e.authors.length-Q,Y=N+e.authors.length-R;return Vencord.Webpack.Common.React.createElement(Se,{text:e.authors.slice(N,Y).map(ae=>ae.name).join(", ")},({onMouseEnter:ae,onMouseLeave:ge})=>Vencord.Webpack.Common.React.createElement("div",{className:Aa.moreUsers,onMouseEnter:ae,onMouseLeave:ge},"+",Q))}return Vencord.Webpack.Common.React.createElement(qe,{transitionState:o,size:"medium"},Vencord.Webpack.Common.React.createElement(vn,null,Vencord.Webpack.Common.React.createElement(ne,{variant:"heading-md/bold"},e.name)),Vencord.Webpack.Common.React.createElement(wn,{style:{marginBottom:8,marginTop:8}},Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h3"},"About ",e.name),Vencord.Webpack.Common.React.createElement(u.FormText,null,e.description),Vencord.Webpack.Common.React.createElement("div",{style:{marginTop:8,marginBottom:8,width:"fit-content"}},Vencord.Webpack.Common.React.createElement(Fa,{users:r,count:e.authors.length,guildId:void 0,renderIcon:!1,max:6,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:w}))),!!e.settingsAboutComponent&&Vencord.Webpack.Common.React.createElement("div",{style:{marginBottom:8}},Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(q,{message:"An error occurred while rendering this plugin's custom InfoComponent"},Vencord.Webpack.Common.React.createElement(e.settingsAboutComponent,null)))),Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h3"},"Settings"),T())),Vencord.Webpack.Common.React.createElement(Rn,null,Vencord.Webpack.Common.React.createElement(se,null,Vencord.Webpack.Common.React.createElement(M,{onClick:n,size:M.Sizes.SMALL,color:M.Colors.RED},"Exit Without Saving"),Vencord.Webpack.Common.React.createElement(Se,{text:"You must fix all errors before saving",shouldShow:!s()},({onMouseEnter:x,onMouseLeave:R})=>Vencord.Webpack.Common.React.createElement(M,{size:M.Sizes.SMALL,color:M.Colors.BRAND,onClick:p,onMouseEnter:x,onMouseLeave:R,disabled:!s()},"Save & Exit")))))}var Fa,Aa,Na,Di=a(()=>{"use strict";re();Fe();ue();mt();y();A();v();Ze();et();Nn();Fa=C(h.byCode("defaultRenderUser","showDefaultAvatarsForNullUsers")),Aa=C(h.byProps(["moreUsers","emptyUser","avatarContainer","clickableAvatar"])),Na=he(()=>F.getCurrentUser().constructor)});var Do,Oi,Li,Ui=a(()=>{"use strict";Do={marginTop:16,display:"grid",gridGap:16,gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))"},Oi={backgroundColor:"var(--background-modifier-selected)",color:"var(--interactive-active)",borderRadius:3,cursor:"pointer",display:"block",height:150,padding:10,width:"100%"},Li={gap:10,height:40,gridTemplateColumns:"1fr 150px",display:"grid"}});function La(e){B.show({message:e,type:B.Type.FAILURE,id:B.genId(),options:{position:B.Position.BOTTOM}})}function Vi({plugin:e,disabled:t,onRestartNeeded:n,onMouseEnter:o,onMouseLeave:r}){let i=_e().plugins[e.name];function l(){return i?.enabled||e.started}function m(){Qe.openModalLazy(async()=>b=>Vencord.Webpack.Common.React.createElement(No,{...b,plugin:e,onRestartNeeded:n}))}function g(){let b=l(),S=b?Co(e):Ct(e),s=b?"stop":"start";if(!S){La(`Failed to ${s} plugin: ${e.name}`);return}i.enabled=!i.enabled,e.patches&&n()}return Vencord.Webpack.Common.React.createElement(se,{style:Oi,flexDirection:"column",onClick:()=>m(),onMouseEnter:o,onMouseLeave:r},Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/bold"},e.name),Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal",style:{height:40,overflow:"hidden"}},e.description),Vencord.Webpack.Common.React.createElement(se,{flexDirection:"row-reverse",style:{marginTop:"auto",width:"100%",justifyContent:"space-between"}},Vencord.Webpack.Common.React.createElement(M,{onClick:b=>{b.preventDefault(),b.stopPropagation(),g()},disabled:t,color:l()?M.Colors.RED:M.Colors.GREEN},l()?"Disable":"Enable"),e.options&&Vencord.Webpack.Common.React.createElement(u.FormText,{style:{cursor:"pointer",margin:"auto 0 auto 10px"}},"Click to configure")))}function Ua(e){return Vencord.Webpack.Common.React.createElement(f.Fragment,null,Vencord.Webpack.Common.React.createElement(u.FormText,null,"This plugin is required by:"),e.map(t=>Vencord.Webpack.Common.React.createElement(u.FormText,{style:{margin:"0 auto"}},t)))}function Oo(e,t){return t[e]?.filter(n=>P.plugins[n].enabled)||[]}var Oa,Bi,$i,Gi=a(()=>{"use strict";Pt();Fe();vt();ue();dt();O();A();v();Ze();et();Di();Ui();Oa=C(h.byCode("optionClassName","popoutPosition","autoFocus","maxVisibleItems")),Bi=C(h.byProps(["inputDefault","inputWrapper"]));$i=q.wrap(function(){let t=_e(),n=f.useMemo(()=>new Ie,[]);f.useEffect(()=>()=>void(n.hasChanges&&Ee.show({title:"Restart required",body:Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement("p",null,"The following plugins require a restart:"),Vencord.Webpack.Common.React.createElement("div",null,n.map((s,p)=>Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,p>0&&", ",xe.parse("`"+s+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let o=f.useMemo(()=>{let s={};for(let p in V){let T=V[p].dependencies;if(T)for(let w of T)s[w]??=[],s[w].push(p)}return s},[]);function r(s){return!!o[s.name]?.filter(T=>t.plugins[T].enabled)?.length}let i=f.useMemo(()=>Object.values(V).sort((s,p)=>s.name.localeCompare(p.name)),[]),[l,m]=f.useState({value:"",status:"all"}),g=s=>m(p=>({...p,value:s})),b=s=>m(p=>({...p,status:s})),S=s=>{let p=l.status==="enabled"||l.status==="all",T=l.status==="disabled"||l.status==="all",w=t.plugins[s.name]?.enabled||s.started;return(p&&w||T&&!w)&&(s.name.toLowerCase().includes(l.value.toLowerCase())||s.description.toLowerCase().includes(l.value.toLowerCase()))};return Vencord.Webpack.Common.React.createElement(u.FormSection,{tag:"h1",title:"Vencord"},Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5",className:Te($.marginTop20,$.marginBottom8)},"Plugins"),Vencord.Webpack.Common.React.createElement("div",{style:Li},Vencord.Webpack.Common.React.createElement(de,{value:l.value,placeholder:"Search for a plugin...",onChange:g,style:{marginBottom:24}}),Vencord.Webpack.Common.React.createElement("div",{className:Bi.inputWrapper},Vencord.Webpack.Common.React.createElement(Oa,{className:Bi.inputDefault,options:[{label:"Show All",value:"all",default:!0},{label:"Show Enabled",value:"enabled"},{label:"Show Disabled",value:"disabled"}],serialize:s=>String(s),select:b,isSelected:s=>s===l.status,closeOnSelect:!0}))),Vencord.Webpack.Common.React.createElement("div",{style:Do},i?.length?i.filter(s=>!s.required&&!Oo(s.name,o).length&&S(s)).map(s=>{let T=o[s.name]?.filter(w=>t.plugins[w].enabled)?.length;return Vencord.Webpack.Common.React.createElement(Vi,{onRestartNeeded:()=>{n.handleChange(s.name)},disabled:s.required||!!T,plugin:s})}):Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal"},"No plugins meet search criteria.")),Vencord.Webpack.Common.React.createElement(u.FormDivider,null),Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5",className:Te($.marginTop20,$.marginBottom8)},"Required Plugins"),Vencord.Webpack.Common.React.createElement("div",{style:Do},i?.length?i.filter(s=>s.required||Oo(s.name,o).length&&S(s)).map(s=>{let T=o[s.name]?.filter(x=>t.plugins[x].enabled)?.length,w=s.required?"This plugin is required for Vencord to function.":Ua(Oo(s.name,o));return Vencord.Webpack.Common.React.createElement(Se,{text:w},({onMouseLeave:x,onMouseEnter:R})=>Vencord.Webpack.Common.React.createElement(Vi,{onMouseLeave:x,onMouseEnter:R,onRestartNeeded:()=>{n.handleChange(s.name)},disabled:s.required||!!T,plugin:s}))}):Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal"},"No plugins meet search criteria.")))})});var ji,zi=a(()=>{"use strict";Fe();dt();Ue();O();v();Ze();et();ji=q.wrap(function(){let[t,,n]=pe(()=>VencordNative.ipc.invoke(_.GET_SETTINGS_DIR),"Loading..."),o=_e(),r=f.useMemo(()=>new Ie,[]);return f.useEffect(()=>()=>void(r.hasChanges&&Ee.show({title:"Restart required",body:Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement("p",null,"The following plugins require a restart:"),Vencord.Webpack.Common.React.createElement("div",null,r.map((i,l)=>Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,l>0&&", ",xe.parse("`"+i+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]),Vencord.Webpack.Common.React.createElement(u.FormSection,{tag:"h1",title:"Vencord"},Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5"},"Settings"),Vencord.Webpack.Common.React.createElement(u.FormText,null,"Settings Directory: ",Vencord.Webpack.Common.React.createElement("code",{style:{userSelect:"text",cursor:"text"}},t)),Vencord.Webpack.Common.React.createElement(se,{className:$.marginBottom20,style:{marginTop:8}},Vencord.Webpack.Common.React.createElement(M,{onClick:()=>VencordNative.ipc.send(_.OPEN_EXTERNAL,t),size:M.Sizes.SMALL,disabled:n},"Launch Directory"),Vencord.Webpack.Common.React.createElement(M,{onClick:()=>VencordNative.ipc.send(_.OPEN_EXTERNAL,t+"/quickCss.css"),size:M.Sizes.SMALL,disabled:t==="Loading..."},"Open QuickCSS File")),Vencord.Webpack.Common.React.createElement(u.FormDivider,null),Vencord.Webpack.Common.React.createElement(at,{value:o.useQuickCss,onChange:i=>o.useQuickCss=i,note:"Loads styles from your QuickCss file"},"Use QuickCss"),!1,!1)})});var Wi=a(()=>{"use strict"});var Hi,Ki=a(()=>{"use strict";Ye();O();wt();v();Ze();Ao();et();Wi();Hi=null});var qi={};D(qi,{PluginSettings:()=>$i,Settings:()=>ji,Updater:()=>Hi});var Qi=a(()=>{"use strict";Gi();zi();Ki()});async function Ba(){if(await kt,To(),Yi=await Promise.resolve().then(()=>(Qi(),qi)),!1)try{}catch(e){}}var Yi,K=a(()=>{"use strict";Xo();vt();ue();ko();wt();A();sn();Fe();vt();_i();ko();wt();A();v();Ba()});var Va={};D(Va,{Api:()=>an,Components:()=>Yi,PlainSettings:()=>Pi,Plugins:()=>vo,QuickCss:()=>Ro,Settings:()=>P,Updater:()=>_o,Util:()=>Mn,Webpack:()=>Nt});var nt,is=new Promise(e=>{setTimeout(()=>{new QWebChannel(qt.webChannelTransport,function(t){nt=t.objects.webclass,e()})})});async function Uo(){nt||await is}window.VencordNative={getVersions:()=>({}),ipc:{send:async(e,...t)=>{await Uo(),nt.vencordSend(e,t)},sendSync:(e,...t)=>{if(e==="VencordGetSettings")return console.log(window.discordScreenaudioVencordSettings),window.discordScreenaudioVencordSettings||"{}";throw new Error("Synchroneous IPC not implemented")},on(e,t){},off(e,t){},invoke:async(e,...t)=>(await Uo(),nt.vencordSend(e,t))}};K();return rs(Va);})(); +`,t),Fi.error("Component Stack",n.componentStack)}render(){if(this.state.error===Ai)return this.props.children;if(this.props.fallback)return Vencord.Webpack.Common.React.createElement(this.props.fallback,{children:this.props.children,...this.state});let t=this.props.message||"An error occurred while rendering this Component. More info can be found below and in your console.";return Vencord.Webpack.Common.React.createElement(Fo,{style:{overflow:"hidden"}},Vencord.Webpack.Common.React.createElement("h1",null,"Oh no!"),Vencord.Webpack.Common.React.createElement("p",null,t),Vencord.Webpack.Common.React.createElement("code",null,this.state.message,!!this.state.stack&&Vencord.Webpack.Common.React.createElement("pre",{className:$.marginTop8},this.state.stack)))}}});function se(e){return e.style??={},e.style.flexDirection||=e.flexDirection,e.style.gap??="1em",e.style.display="flex",Vencord.Webpack.Common.React.createElement("div",{...e},e.children)}var et=a(()=>{"use strict"});function Ni(e){let t=new Na({username:e.name,id:He(),bot:!0});return I.dispatch({type:"USER_UPDATE",user:t}),t}function No({plugin:e,onRestartNeeded:t,onClose:n,transitionState:o}){let[r,i]=f.useState([]),l=_e().plugins[e.name],[m,g]=f.useState({}),[b,S]=f.useState({}),s=()=>Object.values(b).every(x=>!x);f.useEffect(()=>{(async()=>{for(let x of e.authors.slice(0,6)){let R=x.id?await Ft.fetchUser(`${x.id}`).catch(()=>null):Ni(x);i(Q=>[...Q,R||Ni(x)])}})()},[]);function p(){if(!e.options){n();return}let x=!1;for(let[R,Q]of Object.entries(m)){let N=e.options[R];l[R]=Q,N?.onChange?.(Q),N?.restartNeeded&&(x=!0)}x&&t(),n()}function T(){if(!l||!e.options)return Vencord.Webpack.Common.React.createElement(u.FormText,null,"There are no settings for this plugin.");let x=[];for(let[N,Y]of Object.entries(e.options)){let ae=function(je){g(Rt=>({...Rt,[N]:je}))},ge=function(je){S(Rt=>({...Rt,[N]:je}))};var R=ae,Q=ge;let ce={onChange:ae,pluginSettings:l,id:N,onError:ge};switch(Y.type){case 4:{x.push(Vencord.Webpack.Common.React.createElement(Pr,{key:N,option:Y,...ce}));break}case 0:{x.push(Vencord.Webpack.Common.React.createElement(vr,{key:N,option:Y,...ce}));break}case 1:case 2:{x.push(Vencord.Webpack.Common.React.createElement(xr,{key:N,option:Y,...ce}));break}case 3:{x.push(Vencord.Webpack.Common.React.createElement(br,{key:N,option:Y,...ce}));break}case 5:{x.push(Vencord.Webpack.Common.React.createElement(Cr,{key:N,option:Y,...ce}));break}}}return Vencord.Webpack.Common.React.createElement(se,{flexDirection:"column",style:{gap:12}},x)}function w(x,R){let Q=e.authors.length-R,N=e.authors.length-Q,Y=N+e.authors.length-R;return Vencord.Webpack.Common.React.createElement(Se,{text:e.authors.slice(N,Y).map(ae=>ae.name).join(", ")},({onMouseEnter:ae,onMouseLeave:ge})=>Vencord.Webpack.Common.React.createElement("div",{className:Aa.moreUsers,onMouseEnter:ae,onMouseLeave:ge},"+",Q))}return Vencord.Webpack.Common.React.createElement(qe,{transitionState:o,size:"medium"},Vencord.Webpack.Common.React.createElement(vn,null,Vencord.Webpack.Common.React.createElement(ne,{variant:"heading-md/bold"},e.name)),Vencord.Webpack.Common.React.createElement(wn,{style:{marginBottom:8,marginTop:8}},Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h3"},"About ",e.name),Vencord.Webpack.Common.React.createElement(u.FormText,null,e.description),Vencord.Webpack.Common.React.createElement("div",{style:{marginTop:8,marginBottom:8,width:"fit-content"}},Vencord.Webpack.Common.React.createElement(Fa,{users:r,count:e.authors.length,guildId:void 0,renderIcon:!1,max:6,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:w}))),!!e.settingsAboutComponent&&Vencord.Webpack.Common.React.createElement("div",{style:{marginBottom:8}},Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(q,{message:"An error occurred while rendering this plugin's custom InfoComponent"},Vencord.Webpack.Common.React.createElement(e.settingsAboutComponent,null)))),Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h3"},"Settings"),T())),Vencord.Webpack.Common.React.createElement(Rn,null,Vencord.Webpack.Common.React.createElement(se,null,Vencord.Webpack.Common.React.createElement(M,{onClick:n,size:M.Sizes.SMALL,color:M.Colors.RED},"Exit Without Saving"),Vencord.Webpack.Common.React.createElement(Se,{text:"You must fix all errors before saving",shouldShow:!s()},({onMouseEnter:x,onMouseLeave:R})=>Vencord.Webpack.Common.React.createElement(M,{size:M.Sizes.SMALL,color:M.Colors.BRAND,onClick:p,onMouseEnter:x,onMouseLeave:R,disabled:!s()},"Save & Exit")))))}var Fa,Aa,Na,Di=a(()=>{"use strict";re();Fe();ue();mt();y();A();v();Ze();et();Nn();Fa=C(h.byCode("defaultRenderUser","showDefaultAvatarsForNullUsers")),Aa=C(h.byProps(["moreUsers","emptyUser","avatarContainer","clickableAvatar"])),Na=he(()=>F.getCurrentUser().constructor)});var Do,Oi,Li,Ui=a(()=>{"use strict";Do={marginTop:16,display:"grid",gridGap:16,gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))"},Oi={backgroundColor:"var(--background-modifier-selected)",color:"var(--interactive-active)",borderRadius:3,cursor:"pointer",display:"block",height:150,padding:10,width:"100%"},Li={gap:10,height:40,gridTemplateColumns:"1fr 150px",display:"grid"}});function La(e){B.show({message:e,type:B.Type.FAILURE,id:B.genId(),options:{position:B.Position.BOTTOM}})}function Vi({plugin:e,disabled:t,onRestartNeeded:n,onMouseEnter:o,onMouseLeave:r}){let i=_e().plugins[e.name];function l(){return i?.enabled||e.started}function m(){Qe.openModalLazy(async()=>b=>Vencord.Webpack.Common.React.createElement(No,{...b,plugin:e,onRestartNeeded:n}))}function g(){let b=l(),S=b?Co(e):Ct(e),s=b?"stop":"start";if(!S){La(`Failed to ${s} plugin: ${e.name}`);return}i.enabled=!i.enabled,e.patches&&n()}return Vencord.Webpack.Common.React.createElement(se,{style:Oi,flexDirection:"column",onClick:()=>m(),onMouseEnter:o,onMouseLeave:r},Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/bold"},e.name),Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal",style:{height:40,overflow:"hidden"}},e.description),Vencord.Webpack.Common.React.createElement(se,{flexDirection:"row-reverse",style:{marginTop:"auto",width:"100%",justifyContent:"space-between"}},Vencord.Webpack.Common.React.createElement(M,{onClick:b=>{b.preventDefault(),b.stopPropagation(),g()},disabled:t,color:l()?M.Colors.RED:M.Colors.GREEN},l()?"Disable":"Enable"),e.options&&Vencord.Webpack.Common.React.createElement(u.FormText,{style:{cursor:"pointer",margin:"auto 0 auto 10px"}},"Click to configure")))}function Ua(e){return Vencord.Webpack.Common.React.createElement(f.Fragment,null,Vencord.Webpack.Common.React.createElement(u.FormText,null,"This plugin is required by:"),e.map(t=>Vencord.Webpack.Common.React.createElement(u.FormText,{style:{margin:"0 auto"}},t)))}function Oo(e,t){return t[e]?.filter(n=>P.plugins[n].enabled)||[]}var Oa,Bi,$i,Gi=a(()=>{"use strict";Pt();Fe();vt();ue();dt();O();A();v();Ze();et();Di();Ui();Oa=C(h.byCode("optionClassName","popoutPosition","autoFocus","maxVisibleItems")),Bi=C(h.byProps(["inputDefault","inputWrapper"]));$i=q.wrap(function(){let t=_e(),n=f.useMemo(()=>new Ie,[]);f.useEffect(()=>()=>void(n.hasChanges&&Ee.show({title:"Restart required",body:Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement("p",null,"The following plugins require a restart:"),Vencord.Webpack.Common.React.createElement("div",null,n.map((s,p)=>Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,p>0&&", ",xe.parse("`"+s+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let o=f.useMemo(()=>{let s={};for(let p in V){let T=V[p].dependencies;if(T)for(let w of T)s[w]??=[],s[w].push(p)}return s},[]);function r(s){return!!o[s.name]?.filter(T=>t.plugins[T].enabled)?.length}let i=f.useMemo(()=>Object.values(V).sort((s,p)=>s.name.localeCompare(p.name)),[]),[l,m]=f.useState({value:"",status:"all"}),g=s=>m(p=>({...p,value:s})),b=s=>m(p=>({...p,status:s})),S=s=>{let p=l.status==="enabled"||l.status==="all",T=l.status==="disabled"||l.status==="all",w=t.plugins[s.name]?.enabled||s.started;return(p&&w||T&&!w)&&(s.name.toLowerCase().includes(l.value.toLowerCase())||s.description.toLowerCase().includes(l.value.toLowerCase()))};return Vencord.Webpack.Common.React.createElement(u.FormSection,{tag:"h1",title:"Vencord"},Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5",className:Te($.marginTop20,$.marginBottom8)},"Plugins"),Vencord.Webpack.Common.React.createElement("div",{style:Li},Vencord.Webpack.Common.React.createElement(de,{value:l.value,placeholder:"Search for a plugin...",onChange:g,style:{marginBottom:24}}),Vencord.Webpack.Common.React.createElement("div",{className:Bi.inputWrapper},Vencord.Webpack.Common.React.createElement(Oa,{className:Bi.inputDefault,options:[{label:"Show All",value:"all",default:!0},{label:"Show Enabled",value:"enabled"},{label:"Show Disabled",value:"disabled"}],serialize:s=>String(s),select:b,isSelected:s=>s===l.status,closeOnSelect:!0}))),Vencord.Webpack.Common.React.createElement("div",{style:Do},i?.length?i.filter(s=>!s.required&&!Oo(s.name,o).length&&S(s)).map(s=>{let T=o[s.name]?.filter(w=>t.plugins[w].enabled)?.length;return Vencord.Webpack.Common.React.createElement(Vi,{onRestartNeeded:()=>{n.handleChange(s.name)},disabled:s.required||!!T,plugin:s})}):Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal"},"No plugins meet search criteria.")),Vencord.Webpack.Common.React.createElement(u.FormDivider,null),Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5",className:Te($.marginTop20,$.marginBottom8)},"Required Plugins"),Vencord.Webpack.Common.React.createElement("div",{style:Do},i?.length?i.filter(s=>s.required||Oo(s.name,o).length&&S(s)).map(s=>{let T=o[s.name]?.filter(x=>t.plugins[x].enabled)?.length,w=s.required?"This plugin is required for Vencord to function.":Ua(Oo(s.name,o));return Vencord.Webpack.Common.React.createElement(Se,{text:w},({onMouseLeave:x,onMouseEnter:R})=>Vencord.Webpack.Common.React.createElement(Vi,{onMouseLeave:x,onMouseEnter:R,onRestartNeeded:()=>{n.handleChange(s.name)},disabled:s.required||!!T,plugin:s}))}):Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal"},"No plugins meet search criteria.")))})});var ji,zi=a(()=>{"use strict";Fe();dt();Ue();O();v();Ze();et();ji=q.wrap(function(){let[t,,n]=pe(()=>VencordNative.ipc.invoke(_.GET_SETTINGS_DIR),"Loading..."),o=_e(),r=f.useMemo(()=>new Ie,[]);return f.useEffect(()=>()=>void(r.hasChanges&&Ee.show({title:"Restart required",body:Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement("p",null,"The following plugins require a restart:"),Vencord.Webpack.Common.React.createElement("div",null,r.map((i,l)=>Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,l>0&&", ",xe.parse("`"+i+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]),Vencord.Webpack.Common.React.createElement(u.FormSection,{tag:"h1",title:"Vencord"},Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5"},"Settings"),Vencord.Webpack.Common.React.createElement(u.FormText,null,"Settings Directory: ",Vencord.Webpack.Common.React.createElement("code",{style:{userSelect:"text",cursor:"text"}},t)),Vencord.Webpack.Common.React.createElement(se,{className:$.marginBottom20,style:{marginTop:8}},Vencord.Webpack.Common.React.createElement(M,{onClick:()=>VencordNative.ipc.send(_.OPEN_EXTERNAL,t),size:M.Sizes.SMALL,disabled:n},"Launch Directory"),Vencord.Webpack.Common.React.createElement(M,{onClick:()=>VencordNative.ipc.send(_.OPEN_EXTERNAL,t+"/quickCss.css"),size:M.Sizes.SMALL,disabled:t==="Loading..."},"Open QuickCSS File")),Vencord.Webpack.Common.React.createElement(u.FormDivider,null),Vencord.Webpack.Common.React.createElement(at,{value:o.useQuickCss,onChange:i=>o.useQuickCss=i,note:"Loads styles from your QuickCss file"},"Use QuickCss"),!1,!1)})});var Wi=a(()=>{"use strict"});var Hi,Ki=a(()=>{"use strict";Ye();O();wt();v();Ze();Ao();et();Wi();Hi=null});var qi={};D(qi,{PluginSettings:()=>$i,Settings:()=>ji,Updater:()=>Hi});var Qi=a(()=>{"use strict";Gi();zi();Ki()});async function Ba(){if(await kt,To(),Yi=await Promise.resolve().then(()=>(Qi(),qi)),!1)try{}catch(e){}}var Yi,K=a(()=>{"use strict";Xo();vt();ue();ko();wt();A();sn();Fe();vt();_i();ko();wt();A();v();Ba()});var Va={};D(Va,{Api:()=>an,Components:()=>Yi,PlainSettings:()=>Pi,Plugins:()=>vo,QuickCss:()=>Ro,Settings:()=>P,Updater:()=>_o,Util:()=>Mn,Webpack:()=>Nt});var nt,is=new Promise(e=>{setTimeout(()=>{new QWebChannel(qt.webChannelTransport,function(t){nt=t.objects.webclass,e()})})});async function Uo(){nt||await is}window.VencordNative={getVersions:()=>({}),ipc:{send:async(e,...t)=>{await Uo(),nt.vencordSend(e,t)},sendSync:(e,...t)=>{if(e==="VencordGetSettings")return window.discordScreenaudioVencordSettings||"{}";throw new Error("Synchroneous IPC not implemented")},on(e,t){},off(e,t){},invoke:async(e,...t)=>(await Uo(),e==="VencordSetSettings"&&(window.discordScreenaudioVencordSettings=t[0]),nt.vencordSend(e,t))}};K();return rs(Va);})(); //# sourceURL=VencordWeb /*! For license information please see browser.js.LEGAL.txt */ diff --git a/scripts/build_vencord.sh b/scripts/build_vencord.sh index fe5131c..23daa3b 100755 --- a/scripts/build_vencord.sh +++ b/scripts/build_vencord.sh @@ -14,9 +14,9 @@ if [ ! -d "Vencord" ]; then git clone https://github.com/Vendicated/Vencord.git cd Vencord else - echo_status "Pulling Vencord changes" + echo_status "Fetching Vencord changes" cd Vencord - git pull + git fetch fi echo_status "Checking out latest commit" diff --git a/src/webclass.cpp b/src/webclass.cpp index ced0b92..65ad2a5 100644 --- a/src/webclass.cpp +++ b/src/webclass.cpp @@ -26,7 +26,7 @@ QVariant WebClass::vencordSend(QString event, QVariantList args) { if (event == "VencordGetQuickCss") { if (QFile::exists(quickCssFile)) { QFile file(quickCssFile); - if (!file.open(QIODevice::WriteOnly)) + if (!file.open(QIODevice::ReadOnly)) qFatal("Failed to load %s with error: %s", quickCssFile.toLatin1().constData(), file.errorString().toLatin1().constData());