diff --git a/dist/assets/index-DqpJaBxD.js b/dist/assets/index-DRHktLL-.js similarity index 85% rename from dist/assets/index-DqpJaBxD.js rename to dist/assets/index-DRHktLL-.js index 104769c..eb81b77 100644 --- a/dist/assets/index-DqpJaBxD.js +++ b/dist/assets/index-DRHktLL-.js @@ -14,4 +14,4 @@ * @vue/runtime-dom v3.4.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const bl="http://www.w3.org/2000/svg",yl="http://www.w3.org/1998/Math/MathML",Ie=typeof document<"u"?document:null,Is=Ie&&Ie.createElement("template"),vl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Ie.createElementNS(bl,e):t==="mathml"?Ie.createElementNS(yl,e):n?Ie.createElement(e,{is:n}):Ie.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ie.createTextNode(e),createComment:e=>Ie.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ie.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{Is.innerHTML=s==="svg"?`${e}`:s==="mathml"?`${e}`:e;const c=Is.content;if(s==="svg"||s==="mathml"){const a=c.firstChild;for(;a.firstChild;)c.appendChild(a.firstChild);c.removeChild(a)}t.insertBefore(c,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},je="transition",Et="animation",yt=Symbol("_vtc"),ro={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},wl=oe({},ui,ro),tt=(e,t=[])=>{R(e)?e.forEach(n=>n(...t)):e&&e(...t)},Fs=e=>e?R(e)?e.some(t=>t.length>1):e.length>1:!1;function xl(e){const t={};for(const A in e)A in ro||(t[A]=e[A]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:a=o,appearActiveClass:f=i,appearToClass:d=c,leaveFromClass:y=`${n}-leave-from`,leaveActiveClass:x=`${n}-leave-active`,leaveToClass:L=`${n}-leave-to`}=e,j=Cl(r),M=j&&j[0],Y=j&&j[1],{onBeforeEnter:K,onEnter:F,onEnterCancelled:p,onLeave:S,onLeaveCancelled:v,onBeforeAppear:N=K,onAppear:de=F,onAppearCancelled:ie=p}=t,B=(A,q,le)=>{Be(A,q?d:c),Be(A,q?f:i),le&&le()},W=(A,q)=>{A._isLeaving=!1,Be(A,y),Be(A,L),Be(A,x),q&&q()},Z=A=>(q,le)=>{const Ye=A?de:F,se=()=>B(q,A,le);tt(Ye,[q,se]),Ns(()=>{Be(q,A?a:o),Re(q,A?d:c),Fs(Ye)||Hs(q,s,M,se)})};return oe(t,{onBeforeEnter(A){tt(K,[A]),Re(A,o),Re(A,i)},onBeforeAppear(A){tt(N,[A]),Re(A,a),Re(A,f)},onEnter:Z(!1),onAppear:Z(!0),onLeave(A,q){A._isLeaving=!0;const le=()=>W(A,q);Re(A,y),Re(A,x),io(),Ns(()=>{A._isLeaving&&(Be(A,y),Re(A,L),Fs(S)||Hs(A,s,Y,le))}),tt(S,[A,le])},onEnterCancelled(A){B(A,!1),tt(p,[A])},onAppearCancelled(A){B(A,!0),tt(ie,[A])},onLeaveCancelled(A){W(A),tt(v,[A])}})}function Cl(e){if(e==null)return null;if(J(e))return[En(e.enter),En(e.leave)];{const t=En(e);return[t,t]}}function En(e){return wo(e)}function Re(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[yt]||(e[yt]=new Set)).add(t)}function Be(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[yt];n&&(n.delete(t),n.size||(e[yt]=void 0))}function Ns(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let El=0;function Hs(e,t,n,s){const r=e._endId=++El,o=()=>{r===e._endId&&s()};if(n)return setTimeout(o,n);const{type:i,timeout:c,propCount:a}=oo(e,t);if(!i)return s();const f=i+"end";let d=0;const y=()=>{e.removeEventListener(f,x),o()},x=L=>{L.target===e&&++d>=a&&y()};setTimeout(()=>{d(n[j]||"").split(", "),r=s(`${je}Delay`),o=s(`${je}Duration`),i=js(r,o),c=s(`${Et}Delay`),a=s(`${Et}Duration`),f=js(c,a);let d=null,y=0,x=0;t===je?i>0&&(d=je,y=i,x=o.length):t===Et?f>0&&(d=Et,y=f,x=a.length):(y=Math.max(i,f),d=y>0?i>f?je:Et:null,x=d?d===je?o.length:a.length:0);const L=d===je&&/\b(transform|all)(,|$)/.test(s(`${je}Property`).toString());return{type:d,timeout:y,propCount:x,hasTransform:L}}function js(e,t){for(;e.lengthks(n)+ks(e[s])))}function ks(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function io(){return document.body.offsetHeight}function Sl(e,t,n){const s=e[yt];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Bs=Symbol("_vod"),Tl=Symbol("_vsh"),Ol=Symbol(""),Al=/(^|;)\s*display\s*:/;function Pl(e,t,n){const s=e.style,r=ne(n);let o=!1;if(n&&!r){if(t)if(ne(t))for(const i of t.split(";")){const c=i.slice(0,i.indexOf(":")).trim();n[c]==null&&Zt(s,c,"")}else for(const i in t)n[i]==null&&Zt(s,i,"");for(const i in n)i==="display"&&(o=!0),Zt(s,i,n[i])}else if(r){if(t!==n){const i=s[Ol];i&&(n+=";"+i),s.cssText=n,o=Al.test(n)}}else t&&e.removeAttribute("style");Bs in e&&(e[Bs]=o?s.display:"",e[Tl]&&(s.display="none"))}const Ds=/\s*!important$/;function Zt(e,t,n){if(R(n))n.forEach(s=>Zt(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=$l(e,t);Ds.test(n)?e.setProperty(ut(s),n.replace(Ds,""),"important"):e[s]=n}}const Us=["Webkit","Moz","ms"],Sn={};function $l(e,t){const n=Sn[t];if(n)return n;let s=lt(t);if(s!=="filter"&&s in e)return Sn[t]=s;s=sr(s);for(let r=0;rTn||(Nl.then(()=>Tn=0),Tn=Date.now());function jl(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;xe(kl(s,n.value),t,5,[s])};return n.value=e,n.attached=Hl(),n}function kl(e,t){if(R(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const zs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Bl=(e,t,n,s,r,o)=>{const i=r==="svg";t==="class"?Sl(e,s,i):t==="style"?Pl(e,n,s):on(t)?Dn(t)||Il(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Dl(e,t,s,i))?(Ml(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ks(e,t,s,i,o,t!=="value")):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Ks(e,t,s,i))};function Dl(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&zs(t)&&H(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return zs(t)&&ne(n)?!1:t in e}const lo=new WeakMap,co=new WeakMap,rn=Symbol("_moveCb"),qs=Symbol("_enterCb"),ao={name:"TransitionGroup",props:oe({},wl,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ul(),s=ai();let r,o;return Ir(()=>{if(!r.length)return;const i=e.moveClass||`${e.name||"v"}-move`;if(!zl(r[0].el,n.vnode.el,i))return;r.forEach(Kl),r.forEach(Wl);const c=r.filter(Gl);io(),c.forEach(a=>{const f=a.el,d=f.style;Re(f,i),d.transform=d.webkitTransform=d.transitionDuration="";const y=f[rn]=x=>{x&&x.target!==f||(!x||/transform$/.test(x.propertyName))&&(f.removeEventListener("transitionend",y),f[rn]=null,Be(f,i))};f.addEventListener("transitionend",y)})}),()=>{const i=U(e),c=xl(i);let a=i.tag||me;if(r=[],o)for(let f=0;fdelete e.mode;ao.props;const Vl=ao;function Kl(e){const t=e.el;t[rn]&&t[rn](),t[qs]&&t[qs]()}function Wl(e){co.set(e,e.el.getBoundingClientRect())}function Gl(e){const t=lo.get(e),n=co.get(e),s=t.left-n.left,r=t.top-n.top;if(s||r){const o=e.el.style;return o.transform=o.webkitTransform=`translate(${s}px,${r}px)`,o.transitionDuration="0s",e}}function zl(e,t,n){const s=e.cloneNode(),r=e[yt];r&&r.forEach(c=>{c.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(c=>c&&s.classList.add(c)),s.style.display="none";const o=t.nodeType===1?t:t.parentNode;o.appendChild(s);const{hasTransform:i}=oo(s);return o.removeChild(s),i}const ql=oe({patchProp:Bl},vl);let Js;function Jl(){return Js||(Js=Bi(ql))}const Yl=(...e)=>{const t=Jl().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Xl(s);if(!r)return;const o=t._component;!H(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.innerHTML="";const i=n(r,!1,Zl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function Zl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Xl(e){return ne(e)?document.querySelector(e):e}var Ql=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ec=window.device,b={},kn=[];window.device=b;var Ft=window.document.documentElement,tc=window.navigator.userAgent.toLowerCase(),Ys=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","pov_tv","hbbtv","ce-html"];b.macos=function(){return ee("mac")};b.ios=function(){return b.iphone()||b.ipod()||b.ipad()};b.iphone=function(){return!b.windows()&&ee("iphone")};b.ipod=function(){return ee("ipod")};b.ipad=function(){var e=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return ee("ipad")||e};b.android=function(){return!b.windows()&&ee("android")};b.androidPhone=function(){return b.android()&&ee("mobile")};b.androidTablet=function(){return b.android()&&!ee("mobile")};b.blackberry=function(){return ee("blackberry")||ee("bb10")};b.blackberryPhone=function(){return b.blackberry()&&!ee("tablet")};b.blackberryTablet=function(){return b.blackberry()&&ee("tablet")};b.windows=function(){return ee("windows")};b.windowsPhone=function(){return b.windows()&&ee("phone")};b.windowsTablet=function(){return b.windows()&&ee("touch")&&!b.windowsPhone()};b.fxos=function(){return(ee("(mobile")||ee("(tablet"))&&ee(" rv:")};b.fxosPhone=function(){return b.fxos()&&ee("mobile")};b.fxosTablet=function(){return b.fxos()&&ee("tablet")};b.meego=function(){return ee("meego")};b.cordova=function(){return window.cordova&&location.protocol==="file:"};b.nodeWebkit=function(){return Ql(window.process)==="object"};b.mobile=function(){return b.androidPhone()||b.iphone()||b.ipod()||b.windowsPhone()||b.blackberryPhone()||b.fxosPhone()||b.meego()};b.tablet=function(){return b.ipad()||b.androidTablet()||b.blackberryTablet()||b.windowsTablet()||b.fxosTablet()};b.desktop=function(){return!b.tablet()&&!b.mobile()};b.television=function(){for(var e=0;e1};b.landscape=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?os(screen.orientation.type,"landscape"):b.ios()&&Object.prototype.hasOwnProperty.call(window,"orientation")?Math.abs(window.orientation)===90:window.innerHeight/window.innerWidth<1};b.noConflict=function(){return window.device=ec,this};function os(e,t){return e.indexOf(t)!==-1}function ee(e){return os(tc,e)}function uo(e){return Ft.className.match(new RegExp(e,"i"))}function te(e){var t=null;uo(e)||(t=Ft.className.replace(/^\s+|\s+$/g,""),Ft.className=t+" "+e)}function Zs(e){uo(e)&&(Ft.className=Ft.className.replace(" "+e,""))}b.ios()?b.ipad()?te("ios ipad tablet"):b.iphone()?te("ios iphone mobile"):b.ipod()&&te("ios ipod mobile"):b.macos()?te("macos desktop"):b.android()?b.androidTablet()?te("android tablet"):te("android mobile"):b.blackberry()?b.blackberryTablet()?te("blackberry tablet"):te("blackberry mobile"):b.windows()?b.windowsTablet()?te("windows tablet"):b.windowsPhone()?te("windows mobile"):te("windows desktop"):b.fxos()?b.fxosTablet()?te("fxos tablet"):te("fxos mobile"):b.meego()?te("meego mobile"):b.nodeWebkit()?te("node-webkit"):b.television()?te("television"):b.desktop()&&te("desktop");b.cordova()&&te("cordova");function Xt(){b.landscape()?(Zs("portrait"),te("landscape"),Xs("landscape")):(Zs("landscape"),te("portrait"),Xs("portrait")),fo()}function Xs(e){for(var t=0;t{n.value=document.querySelector(".top")});async function d(F){if(await t.value.push(F),n.value.scrollTo({top:n.value.scrollHeight,behavior:"smooth"}),o.value){s.value.currentTime=0,s.value.play();var p=new SpeechSynthesisUtterance(F.tts);p.pitch=1,p.rate=1,window.speechSynthesis.speak(p)}}function y(F){o.value=!o.value,o.value?(s.value.play(),r.value="Disable Sound"):r.value="Enable Sound"}let x=0,L="https://corsproxy.io/?"+encodeURIComponent(`https://gateway.gofundme.com/web-gateway/v1/feed/${f}/donations?limit=10`);setInterval(()=>{fetch(L).then(F=>F.json()).then(F=>{for(x!=0&&F.references.donations.reverse(),M=0;Mp.json()).then(p=>console.log(p))}const K=function(F){const p=JSON.parse(F.data);switch(p.metadata.message_type!="session_keepalive"&&console.log(p),p.metadata.message_type){case"session_welcome":M==0?Y(p.payload.session.id):j[M-1].close();break;case"session_reconnect":M++,j[M]=new WebSocket(p.payload.session.reconnect_url);break;case"notification":let S=p.payload.event.notice_type,v={id:p.metadata.message_id,user:p.payload.event.chatter_user_name,text:p.payload.event.message.text??"",type:p.payload.event.notice_type};switch(["sub","resub","sub_gift","community_sub_gift"].includes(S)&&(v.tier=p.payload.event[S].sub_tier/1e3),["sub","resub"].includes(S)&&(v.is_prime=p.payload.event[S].is_prime,v.color="-green-600"),["sub_gift","community_sub_gift"].includes(S)&&(v.user_total=p.payload.event[S].cumulative_total??0,v.color="-orange-600"),p.payload.event.notice_type){case"sub":v.nice_name="Sub",v.tts=`${v.user} subbed at tier ${v.tier}: ${v.text}`;break;case"resub":v.nice_name="ReSub",v.months=p.payload.event[S].cumulative_months,v.tts=`${v.user} resubbed at tier ${v.tier}, total ${v.months} months: ${v.text}`;break;case"sub_gift":v.nice_name="Gift x1",v.recipient=p.payload.event[S].recipient_user_name,v.exclude=!!p.payload.event[S].community_gift_id,v.tts=`${v.user} gifted a tier ${v.tier} sub to ${v.recipient}`;break;case"community_sub_gift":v.type="sub_gift",v.nice_name="Gift x"+p.payload.event[S].total,v.text="Gifted "+p.payload.event[S].total+" subs",v.tts=`${v.user} gifted ${p.payload.event[S].total} subs`;break;case"raid":v.color="-purple-600",v.nice_name="Raid x"+p.payload.event[S].viewer_count,v.raider=p.payload.event[S].user_name,v.tts=`${v.raider} raided with ${p.payload.event[S].viewer_count} viewers`;break}v.exclude||d(v);break}};if(j[M].onmessage=K,a){let F=[{metadata:{message_id:"GD60uGl4b-rsculGOvnG3CbfWub8sU0-kLka5QQTklE=",message_type:"notification",message_timestamp:"2024-09-02T16:45:07.795455639Z",subscription_type:"channel.chat.notification",subscription_version:"1"},payload:{subscription:{id:"8bfaa271-dacf-45ad-9252-82961b8e4558",status:"enabled",type:"channel.chat.notification",version:"1",condition:{broadcaster_user_id:"171093413",user_id:"54096715"},transport:{method:"websocket",session_id:"AgoQZGprB1c1S96FME9t0ZuU4hIGY2VsbC1j"},created_at:"2024-09-02T16:42:14.02277498Z",cost:0},event:{broadcaster_user_id:"171093413",broadcaster_user_login:"pablogz205",broadcaster_user_name:"PabloGz205",source_broadcaster_user_id:null,source_broadcaster_user_login:null,source_broadcaster_user_name:null,chatter_user_id:"54492353",chatter_user_login:"keepcalmcallsoul",chatter_user_name:"keepcalmcallsoul",chatter_is_anonymous:!1,color:"#8A2BE2",badges:[{set_id:"subscriber",id:"9",info:"9"}],source_badges:null,system_message:"keepcalmcallsoul subscribed at Tier 1. They've subscribed for 9 months!",message_id:"d6deea58-ce6e-4217-905d-67670369b628",source_message_id:null,message:{text:"what do you think about the mclaren?",fragments:[{type:"text",text:"what do you think about the mclaren?",cheermote:null,emote:null,mention:null}]},notice_type:"resub",sub:null,resub:{cumulative_months:9,duration_months:9,streak_months:null,sub_tier:"1000",is_prime:!1,is_gift:!1,gifter_is_anonymous:null,gifter_user_id:null,gifter_user_name:null,gifter_user_login:null},sub_gift:null,community_sub_gift:null,gift_paid_upgrade:null,prime_paid_upgrade:null,pay_it_forward:null,raid:null,unraid:null,announcement:null,bits_badge_tier:null,charity_donation:null,shared_chat_sub:null,shared_chat_resub:null,shared_chat_sub_gift:null,shared_chat_community_sub_gift:null,shared_chat_gift_paid_upgrade:null,shared_chat_prime_paid_upgrade:null,shared_chat_pay_it_forward:null,shared_chat_raid:null,shared_chat_announcement:null}}},{metadata:{message_id:"andpZpHdH68c9LktLSFNbxmK2O0HT0430OD61ytoXXA=",message_type:"notification",message_timestamp:"2024-09-02T17:13:31.221692812Z",subscription_type:"channel.chat.notification",subscription_version:"1"},payload:{subscription:{id:"8bfaa271-dacf-45ad-9252-82961b8e4558",status:"enabled",type:"channel.chat.notification",version:"1",condition:{broadcaster_user_id:"171093413",user_id:"54096715"},transport:{method:"websocket",session_id:"AgoQZGprB1c1S96FME9t0ZuU4hIGY2VsbC1j"},created_at:"2024-09-02T16:42:14.02277498Z",cost:0},event:{broadcaster_user_id:"171093413",broadcaster_user_login:"pablogz205",broadcaster_user_name:"PabloGz205",source_broadcaster_user_id:null,source_broadcaster_user_login:null,source_broadcaster_user_name:null,chatter_user_id:"54096715",chatter_user_login:"deleterr",chatter_user_name:"Deleterr",chatter_is_anonymous:!1,color:"#28D74B",badges:[{set_id:"moderator",id:"1",info:""},{set_id:"subscriber",id:"9",info:"9"},{set_id:"sub-gifter",id:"10",info:""}],source_badges:null,system_message:"Deleterr gifted a Tier 1 sub to JmsTV! They have given 11 Gift Subs in the channel!",message_id:"0001ee46-e128-4435-848c-ad24401abe86",source_message_id:null,message:{text:"",fragments:[]},notice_type:"sub_gift",sub:null,resub:null,sub_gift:{duration_months:1,cumulative_total:11,recipient_user_id:"108600558",recipient_user_name:"JmsTV",recipient_user_login:"jmstv",sub_tier:"1000",community_gift_id:null},community_sub_gift:null,gift_paid_upgrade:null,prime_paid_upgrade:null,pay_it_forward:null,raid:null,unraid:null,announcement:null,bits_badge_tier:null,charity_donation:null,shared_chat_sub:null,shared_chat_resub:null,shared_chat_sub_gift:null,shared_chat_community_sub_gift:null,shared_chat_gift_paid_upgrade:null,shared_chat_prime_paid_upgrade:null,shared_chat_pay_it_forward:null,shared_chat_raid:null,shared_chat_announcement:null}}}];setInterval(()=>{for(let p of F)if(!(Math.random()>.25))switch(p.metadata.message_type!="session_keepalive"&&console.log(p),p.metadata.message_type){case"session_welcome":M==0?Y(p.payload.session.id):j[M-1].close();break;case"session_reconnect":M++,j[M]=new WebSocket(p.payload.session.reconnect_url);break;case"notification":let S=p.payload.event.notice_type,v={id:p.metadata.message_id,user:p.payload.event.chatter_user_name,text:p.payload.event.message.text??""};switch(["sub","resub","sub_gift","community_sub_gift"].includes(S)&&(v.tier=p.payload.event[S].sub_tier/1e3),["sub","resub"].includes(S)&&(v.is_prime=p.payload.event[S].is_prime,v.color="-green-600"),["sub_gift","community_sub_gift"].includes(S)&&(v.user_total=p.payload.event[S].cumulative_total??0,v.color="-orange-600"),p.payload.event.notice_type){case"sub":v.nice_name="Sub",v.tts=`${v.user} subbed at tier ${v.tier}: ${v.text}`;break;case"resub":v.nice_name="ReSub",v.months=p.payload.event[S].cumulative_months,v.tts=`${v.user} resubbed at tier ${v.tier}, total ${v.months} months: ${v.text}`;break;case"sub_gift":v.nice_name="Gift x1",v.recipient=p.payload.event[S].recipient_user_name,v.exclude=!!p.payload.event[S].community_gift_id,v.tts=`${v.user} gifted a tier ${v.tier} sub to ${v.recipient}`;break;case"community_sub_gift":v.nice_name="Gift x"+p.payload.event[S].total,v.text="Gifted "+p.payload.event[S].total+" subs",v.tts=`${v.user} gifted ${p.payload.event[S].total} subs`;break;case"raid":v.color="-purple-600",v.nice_name="Raid x"+p.payload.event[S].viewer_count,v.raider=p.payload.event[S].user_name,v.tts=`${v.raider} raided with ${p.payload.event[S].viewer_count} viewers`;break}v.exclude||d(v);break}},3e3)}return(F,p)=>(Se(),$e(me,null,[ce("audio",{controls:"",class:"hidden",ref_key:"notifyAudio",ref:s},[sc,to(" Your browser does not support the audio element. ")],512),ce("button",{onClick:y,class:"bg-purple-700 hover:bg-purple-800 text-white font-bold py-2 px-4 rounded-full m-4 absolute z-40 right-3 top-0 drop-shadow-lg"},ke(r.value),1),ce("div",rc,[ye(Vl,{name:"notification",tag:"div"},{default:$r(()=>[(Se(!0),$e(me,null,xi(t.value,S=>(Se(),$e("div",{key:S.id,class:$t([S.type+" border"+S.color,"bg-slate-800 rounded-lg p-2 mb-3 w-full border-2"])},[ce("div",oc,[ce("div",ic,[S.nice_name?(Se(),$e("div",{key:0,class:$t(["bg"+S.color,"notify-pill-nobg"])},ke(S.nice_name),3)):Ct("",!0),S.tier?(Se(),$e("div",lc,"Tier "+ke(S.tier),1)):Ct("",!0),S.months?(Se(),$e("div",cc,ke(S.months)+" months",1)):Ct("",!0),S.is_prime?(Se(),$e("div",ac,"Prime")):Ct("",!0),S.user_total?(Se(),$e("div",uc,ke(S.user_total)+" total",1)):Ct("",!0)])]),ce("div",fc,ke(S.raider||S.user),1),ce("div",dc,ke(S.text||"Gifted to "+S.recipient),1)],2))),128))]),_:1})])],64))}},pc=["src"],_c={__name:"ChatFeed",setup(e){const t=nt(""),n=nt(null),s=new URL(window.location.href),r=s.searchParams.get("channel")??"pablogz205",o=s.searchParams.get("size")??1,i=s.searchParams.get("font")??1;t.value=`https://www.giambaj.it/twitch/jchat/v2/?channel=${r}&size=${o}&font=${i}`,Nt(()=>{var a=document.querySelector(".chat-scroll-container");a.scrollTop=a.scrollHeight,a.addEventListener("scroll",function(){var f=document.querySelector(".scroll-to-bottom-button");a.scrollTop+a.clientHeight(Se(),$e("div",{class:"chat-scroll-container",ref_key:"chatScrollContainer",ref:n},[ce("iframe",{class:"chat-frame",src:t.value},null,8,pc),ce("button",{class:"scroll-to-bottom-button absolute bottom-4 bg-orange-600 rounded p-2 font-bold left-[50%] translate-x-[-50%] transition-all duration-300",onClick:c},"Scroll to bottom")],512))}},gc={class:"h-dvh"},mc={class:"resizeable-container"},bc={class:"top"},yc=ce("div",{class:"resize"},null,-1),vc={class:"bottom"},wc={__name:"App",setup(e){return Nt(()=>{var t=document.querySelector(".resize"),n=document.querySelector(".top"),s=document.querySelector(".resizeable-container"),r=!1,o=0;function i(f){r=!0,b.mobile()?b.landscape()?o=f.touches[0].clientX:o=f.touches[0].clientY:o=f.y}function c(f){b.mobile()?b.landscape()?o=f.touches[0].clientX:o=f.touches[0].clientY:o=f.y,r&&(b.mobile()&&b.landscape()?n.style.width=o-t.getBoundingClientRect().width/2+"px":n.style.height=o-t.getBoundingClientRect().height/2+"px",f.preventDefault())}function a(f){r=!1}t.addEventListener("mousedown",i),t.addEventListener("touchstart",i),s.addEventListener("mousemove",c),s.addEventListener("touchmove",c),s.addEventListener("mouseup",a),s.addEventListener("touchend",a),b.mobile()&&b.landscape()?n.style.width=window.innerWidth/2+"px":n.style.height=window.innerHeight/3+"px",b.onChangeOrientation(f=>{b.mobile()&&(f==="landscape"?(n.scrollTop=n.scrollHeight,n.style.height="",n.style.width=window.innerHeight/2+"px"):(n.style.width="",n.style.height=window.innerWidth/3+"px"))})}),(t,n)=>(Se(),$e("main",gc,[ce("div",mc,[ce("div",bc,[ye(hc)]),yc,ce("div",vc,[ye(_c)])])]))}};Yl(wc).mount("#app"); +**/const bl="http://www.w3.org/2000/svg",yl="http://www.w3.org/1998/Math/MathML",Ie=typeof document<"u"?document:null,Is=Ie&&Ie.createElement("template"),vl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Ie.createElementNS(bl,e):t==="mathml"?Ie.createElementNS(yl,e):n?Ie.createElement(e,{is:n}):Ie.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ie.createTextNode(e),createComment:e=>Ie.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ie.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{Is.innerHTML=s==="svg"?`${e}`:s==="mathml"?`${e}`:e;const c=Is.content;if(s==="svg"||s==="mathml"){const a=c.firstChild;for(;a.firstChild;)c.appendChild(a.firstChild);c.removeChild(a)}t.insertBefore(c,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},je="transition",Et="animation",yt=Symbol("_vtc"),ro={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},wl=oe({},ui,ro),tt=(e,t=[])=>{R(e)?e.forEach(n=>n(...t)):e&&e(...t)},Fs=e=>e?R(e)?e.some(t=>t.length>1):e.length>1:!1;function xl(e){const t={};for(const A in e)A in ro||(t[A]=e[A]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:a=o,appearActiveClass:f=i,appearToClass:d=c,leaveFromClass:y=`${n}-leave-from`,leaveActiveClass:x=`${n}-leave-active`,leaveToClass:L=`${n}-leave-to`}=e,j=Cl(r),M=j&&j[0],Y=j&&j[1],{onBeforeEnter:K,onEnter:F,onEnterCancelled:p,onLeave:S,onLeaveCancelled:v,onBeforeAppear:N=K,onAppear:de=F,onAppearCancelled:ie=p}=t,B=(A,q,le)=>{Be(A,q?d:c),Be(A,q?f:i),le&&le()},W=(A,q)=>{A._isLeaving=!1,Be(A,y),Be(A,L),Be(A,x),q&&q()},Z=A=>(q,le)=>{const Ye=A?de:F,se=()=>B(q,A,le);tt(Ye,[q,se]),Ns(()=>{Be(q,A?a:o),Re(q,A?d:c),Fs(Ye)||Hs(q,s,M,se)})};return oe(t,{onBeforeEnter(A){tt(K,[A]),Re(A,o),Re(A,i)},onBeforeAppear(A){tt(N,[A]),Re(A,a),Re(A,f)},onEnter:Z(!1),onAppear:Z(!0),onLeave(A,q){A._isLeaving=!0;const le=()=>W(A,q);Re(A,y),Re(A,x),io(),Ns(()=>{A._isLeaving&&(Be(A,y),Re(A,L),Fs(S)||Hs(A,s,Y,le))}),tt(S,[A,le])},onEnterCancelled(A){B(A,!1),tt(p,[A])},onAppearCancelled(A){B(A,!0),tt(ie,[A])},onLeaveCancelled(A){W(A),tt(v,[A])}})}function Cl(e){if(e==null)return null;if(J(e))return[En(e.enter),En(e.leave)];{const t=En(e);return[t,t]}}function En(e){return wo(e)}function Re(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[yt]||(e[yt]=new Set)).add(t)}function Be(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[yt];n&&(n.delete(t),n.size||(e[yt]=void 0))}function Ns(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let El=0;function Hs(e,t,n,s){const r=e._endId=++El,o=()=>{r===e._endId&&s()};if(n)return setTimeout(o,n);const{type:i,timeout:c,propCount:a}=oo(e,t);if(!i)return s();const f=i+"end";let d=0;const y=()=>{e.removeEventListener(f,x),o()},x=L=>{L.target===e&&++d>=a&&y()};setTimeout(()=>{d(n[j]||"").split(", "),r=s(`${je}Delay`),o=s(`${je}Duration`),i=js(r,o),c=s(`${Et}Delay`),a=s(`${Et}Duration`),f=js(c,a);let d=null,y=0,x=0;t===je?i>0&&(d=je,y=i,x=o.length):t===Et?f>0&&(d=Et,y=f,x=a.length):(y=Math.max(i,f),d=y>0?i>f?je:Et:null,x=d?d===je?o.length:a.length:0);const L=d===je&&/\b(transform|all)(,|$)/.test(s(`${je}Property`).toString());return{type:d,timeout:y,propCount:x,hasTransform:L}}function js(e,t){for(;e.lengthks(n)+ks(e[s])))}function ks(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function io(){return document.body.offsetHeight}function Sl(e,t,n){const s=e[yt];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Bs=Symbol("_vod"),Tl=Symbol("_vsh"),Ol=Symbol(""),Al=/(^|;)\s*display\s*:/;function Pl(e,t,n){const s=e.style,r=ne(n);let o=!1;if(n&&!r){if(t)if(ne(t))for(const i of t.split(";")){const c=i.slice(0,i.indexOf(":")).trim();n[c]==null&&Zt(s,c,"")}else for(const i in t)n[i]==null&&Zt(s,i,"");for(const i in n)i==="display"&&(o=!0),Zt(s,i,n[i])}else if(r){if(t!==n){const i=s[Ol];i&&(n+=";"+i),s.cssText=n,o=Al.test(n)}}else t&&e.removeAttribute("style");Bs in e&&(e[Bs]=o?s.display:"",e[Tl]&&(s.display="none"))}const Ds=/\s*!important$/;function Zt(e,t,n){if(R(n))n.forEach(s=>Zt(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=$l(e,t);Ds.test(n)?e.setProperty(ut(s),n.replace(Ds,""),"important"):e[s]=n}}const Us=["Webkit","Moz","ms"],Sn={};function $l(e,t){const n=Sn[t];if(n)return n;let s=lt(t);if(s!=="filter"&&s in e)return Sn[t]=s;s=sr(s);for(let r=0;rTn||(Nl.then(()=>Tn=0),Tn=Date.now());function jl(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;xe(kl(s,n.value),t,5,[s])};return n.value=e,n.attached=Hl(),n}function kl(e,t){if(R(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const zs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Bl=(e,t,n,s,r,o)=>{const i=r==="svg";t==="class"?Sl(e,s,i):t==="style"?Pl(e,n,s):on(t)?Dn(t)||Il(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Dl(e,t,s,i))?(Ml(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ks(e,t,s,i,o,t!=="value")):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Ks(e,t,s,i))};function Dl(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&zs(t)&&H(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return zs(t)&&ne(n)?!1:t in e}const lo=new WeakMap,co=new WeakMap,rn=Symbol("_moveCb"),qs=Symbol("_enterCb"),ao={name:"TransitionGroup",props:oe({},wl,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ul(),s=ai();let r,o;return Ir(()=>{if(!r.length)return;const i=e.moveClass||`${e.name||"v"}-move`;if(!zl(r[0].el,n.vnode.el,i))return;r.forEach(Kl),r.forEach(Wl);const c=r.filter(Gl);io(),c.forEach(a=>{const f=a.el,d=f.style;Re(f,i),d.transform=d.webkitTransform=d.transitionDuration="";const y=f[rn]=x=>{x&&x.target!==f||(!x||/transform$/.test(x.propertyName))&&(f.removeEventListener("transitionend",y),f[rn]=null,Be(f,i))};f.addEventListener("transitionend",y)})}),()=>{const i=U(e),c=xl(i);let a=i.tag||me;if(r=[],o)for(let f=0;fdelete e.mode;ao.props;const Vl=ao;function Kl(e){const t=e.el;t[rn]&&t[rn](),t[qs]&&t[qs]()}function Wl(e){co.set(e,e.el.getBoundingClientRect())}function Gl(e){const t=lo.get(e),n=co.get(e),s=t.left-n.left,r=t.top-n.top;if(s||r){const o=e.el.style;return o.transform=o.webkitTransform=`translate(${s}px,${r}px)`,o.transitionDuration="0s",e}}function zl(e,t,n){const s=e.cloneNode(),r=e[yt];r&&r.forEach(c=>{c.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(c=>c&&s.classList.add(c)),s.style.display="none";const o=t.nodeType===1?t:t.parentNode;o.appendChild(s);const{hasTransform:i}=oo(s);return o.removeChild(s),i}const ql=oe({patchProp:Bl},vl);let Js;function Jl(){return Js||(Js=Bi(ql))}const Yl=(...e)=>{const t=Jl().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Xl(s);if(!r)return;const o=t._component;!H(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.innerHTML="";const i=n(r,!1,Zl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function Zl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Xl(e){return ne(e)?document.querySelector(e):e}var Ql=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ec=window.device,b={},kn=[];window.device=b;var Ft=window.document.documentElement,tc=window.navigator.userAgent.toLowerCase(),Ys=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","pov_tv","hbbtv","ce-html"];b.macos=function(){return ee("mac")};b.ios=function(){return b.iphone()||b.ipod()||b.ipad()};b.iphone=function(){return!b.windows()&&ee("iphone")};b.ipod=function(){return ee("ipod")};b.ipad=function(){var e=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return ee("ipad")||e};b.android=function(){return!b.windows()&&ee("android")};b.androidPhone=function(){return b.android()&&ee("mobile")};b.androidTablet=function(){return b.android()&&!ee("mobile")};b.blackberry=function(){return ee("blackberry")||ee("bb10")};b.blackberryPhone=function(){return b.blackberry()&&!ee("tablet")};b.blackberryTablet=function(){return b.blackberry()&&ee("tablet")};b.windows=function(){return ee("windows")};b.windowsPhone=function(){return b.windows()&&ee("phone")};b.windowsTablet=function(){return b.windows()&&ee("touch")&&!b.windowsPhone()};b.fxos=function(){return(ee("(mobile")||ee("(tablet"))&&ee(" rv:")};b.fxosPhone=function(){return b.fxos()&&ee("mobile")};b.fxosTablet=function(){return b.fxos()&&ee("tablet")};b.meego=function(){return ee("meego")};b.cordova=function(){return window.cordova&&location.protocol==="file:"};b.nodeWebkit=function(){return Ql(window.process)==="object"};b.mobile=function(){return b.androidPhone()||b.iphone()||b.ipod()||b.windowsPhone()||b.blackberryPhone()||b.fxosPhone()||b.meego()};b.tablet=function(){return b.ipad()||b.androidTablet()||b.blackberryTablet()||b.windowsTablet()||b.fxosTablet()};b.desktop=function(){return!b.tablet()&&!b.mobile()};b.television=function(){for(var e=0;e1};b.landscape=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?os(screen.orientation.type,"landscape"):b.ios()&&Object.prototype.hasOwnProperty.call(window,"orientation")?Math.abs(window.orientation)===90:window.innerHeight/window.innerWidth<1};b.noConflict=function(){return window.device=ec,this};function os(e,t){return e.indexOf(t)!==-1}function ee(e){return os(tc,e)}function uo(e){return Ft.className.match(new RegExp(e,"i"))}function te(e){var t=null;uo(e)||(t=Ft.className.replace(/^\s+|\s+$/g,""),Ft.className=t+" "+e)}function Zs(e){uo(e)&&(Ft.className=Ft.className.replace(" "+e,""))}b.ios()?b.ipad()?te("ios ipad tablet"):b.iphone()?te("ios iphone mobile"):b.ipod()&&te("ios ipod mobile"):b.macos()?te("macos desktop"):b.android()?b.androidTablet()?te("android tablet"):te("android mobile"):b.blackberry()?b.blackberryTablet()?te("blackberry tablet"):te("blackberry mobile"):b.windows()?b.windowsTablet()?te("windows tablet"):b.windowsPhone()?te("windows mobile"):te("windows desktop"):b.fxos()?b.fxosTablet()?te("fxos tablet"):te("fxos mobile"):b.meego()?te("meego mobile"):b.nodeWebkit()?te("node-webkit"):b.television()?te("television"):b.desktop()&&te("desktop");b.cordova()&&te("cordova");function Xt(){b.landscape()?(Zs("portrait"),te("landscape"),Xs("landscape")):(Zs("landscape"),te("portrait"),Xs("portrait")),fo()}function Xs(e){for(var t=0;t{n.value=document.querySelector(".top")});async function d(F){if(await t.value.push(F),n.value.scrollTo({top:n.value.scrollHeight,behavior:"smooth"}),o.value){s.value.currentTime=0,s.value.play();var p=new SpeechSynthesisUtterance(F.tts);p.pitch=1,p.rate=1,window.speechSynthesis.speak(p)}}function y(F){o.value=!o.value,o.value?(s.value.play(),r.value="Disable Sound"):r.value="Enable Sound"}let x=0,L="https://corsproxy.io/?"+encodeURIComponent(`https://gateway.gofundme.com/web-gateway/v1/feed/${f}/donations?limit=10`);setInterval(()=>{fetch(L).then(F=>F.json()).then(F=>{for(x!=0&&F.references.donations.reverse(),M=0;Mp.json()).then(p=>console.log(p))}const K=function(F){const p=JSON.parse(F.data);switch(p.metadata.message_type!="session_keepalive"&&console.log(p),p.metadata.message_type){case"session_welcome":M==0?Y(p.payload.session.id):j[M-1].close();break;case"session_reconnect":M++,j[M]=new WebSocket(p.payload.session.reconnect_url);break;case"notification":let S=p.payload.event.notice_type,v={id:p.metadata.message_id,user:p.payload.event.chatter_user_name,text:p.payload.event.message.text??"",type:p.payload.event.notice_type};switch(["sub","resub","sub_gift","community_sub_gift"].includes(S)&&(v.tier=p.payload.event[S].sub_tier/1e3),["sub","resub"].includes(S)&&(v.is_prime=p.payload.event[S].is_prime,v.color="-green-600"),["sub_gift","community_sub_gift"].includes(S)&&(v.user_total=p.payload.event[S].cumulative_total??0,v.color="-orange-600"),p.payload.event.notice_type){case"sub":v.nice_name="Sub",v.tts=`${v.user} subbed at tier ${v.tier}: ${v.text}`;break;case"resub":v.nice_name="ReSub",v.months=p.payload.event[S].cumulative_months,v.tts=`${v.user} resubbed at tier ${v.tier}, total ${v.months} months: ${v.text}`;break;case"sub_gift":v.nice_name="Gift x1",v.recipient=p.payload.event[S].recipient_user_name,v.exclude=!!p.payload.event[S].community_gift_id,v.tts=`${v.user} gifted a tier ${v.tier} sub to ${v.recipient}`;break;case"community_sub_gift":v.type="sub_gift",v.nice_name="Gift x"+p.payload.event[S].total,v.text="Gifted "+p.payload.event[S].total+" subs",v.tts=`${v.user} gifted ${p.payload.event[S].total} subs`;break;case"raid":v.color="-purple-600",v.nice_name="Raid x"+p.payload.event[S].viewer_count,v.raider=p.payload.event[S].user_name,v.tts=`${v.raider} raided with ${p.payload.event[S].viewer_count} viewers`;break}v.exclude||d(v);break}};if(j[M].onmessage=K,a){let F=[{metadata:{message_id:"GD60uGl4b-rsculGOvnG3CbfWub8sU0-kLka5QQTklE=",message_type:"notification",message_timestamp:"2024-09-02T16:45:07.795455639Z",subscription_type:"channel.chat.notification",subscription_version:"1"},payload:{subscription:{id:"8bfaa271-dacf-45ad-9252-82961b8e4558",status:"enabled",type:"channel.chat.notification",version:"1",condition:{broadcaster_user_id:"171093413",user_id:"54096715"},transport:{method:"websocket",session_id:"AgoQZGprB1c1S96FME9t0ZuU4hIGY2VsbC1j"},created_at:"2024-09-02T16:42:14.02277498Z",cost:0},event:{broadcaster_user_id:"171093413",broadcaster_user_login:"pablogz205",broadcaster_user_name:"PabloGz205",source_broadcaster_user_id:null,source_broadcaster_user_login:null,source_broadcaster_user_name:null,chatter_user_id:"54492353",chatter_user_login:"keepcalmcallsoul",chatter_user_name:"keepcalmcallsoul",chatter_is_anonymous:!1,color:"#8A2BE2",badges:[{set_id:"subscriber",id:"9",info:"9"}],source_badges:null,system_message:"keepcalmcallsoul subscribed at Tier 1. They've subscribed for 9 months!",message_id:"d6deea58-ce6e-4217-905d-67670369b628",source_message_id:null,message:{text:"what do you think about the mclaren?",fragments:[{type:"text",text:"what do you think about the mclaren?",cheermote:null,emote:null,mention:null}]},notice_type:"resub",sub:null,resub:{cumulative_months:9,duration_months:9,streak_months:null,sub_tier:"1000",is_prime:!1,is_gift:!1,gifter_is_anonymous:null,gifter_user_id:null,gifter_user_name:null,gifter_user_login:null},sub_gift:null,community_sub_gift:null,gift_paid_upgrade:null,prime_paid_upgrade:null,pay_it_forward:null,raid:null,unraid:null,announcement:null,bits_badge_tier:null,charity_donation:null,shared_chat_sub:null,shared_chat_resub:null,shared_chat_sub_gift:null,shared_chat_community_sub_gift:null,shared_chat_gift_paid_upgrade:null,shared_chat_prime_paid_upgrade:null,shared_chat_pay_it_forward:null,shared_chat_raid:null,shared_chat_announcement:null}}},{metadata:{message_id:"andpZpHdH68c9LktLSFNbxmK2O0HT0430OD61ytoXXA=",message_type:"notification",message_timestamp:"2024-09-02T17:13:31.221692812Z",subscription_type:"channel.chat.notification",subscription_version:"1"},payload:{subscription:{id:"8bfaa271-dacf-45ad-9252-82961b8e4558",status:"enabled",type:"channel.chat.notification",version:"1",condition:{broadcaster_user_id:"171093413",user_id:"54096715"},transport:{method:"websocket",session_id:"AgoQZGprB1c1S96FME9t0ZuU4hIGY2VsbC1j"},created_at:"2024-09-02T16:42:14.02277498Z",cost:0},event:{broadcaster_user_id:"171093413",broadcaster_user_login:"pablogz205",broadcaster_user_name:"PabloGz205",source_broadcaster_user_id:null,source_broadcaster_user_login:null,source_broadcaster_user_name:null,chatter_user_id:"54096715",chatter_user_login:"deleterr",chatter_user_name:"Deleterr",chatter_is_anonymous:!1,color:"#28D74B",badges:[{set_id:"moderator",id:"1",info:""},{set_id:"subscriber",id:"9",info:"9"},{set_id:"sub-gifter",id:"10",info:""}],source_badges:null,system_message:"Deleterr gifted a Tier 1 sub to JmsTV! They have given 11 Gift Subs in the channel!",message_id:"0001ee46-e128-4435-848c-ad24401abe86",source_message_id:null,message:{text:"",fragments:[]},notice_type:"sub_gift",sub:null,resub:null,sub_gift:{duration_months:1,cumulative_total:11,recipient_user_id:"108600558",recipient_user_name:"JmsTV",recipient_user_login:"jmstv",sub_tier:"1000",community_gift_id:null},community_sub_gift:null,gift_paid_upgrade:null,prime_paid_upgrade:null,pay_it_forward:null,raid:null,unraid:null,announcement:null,bits_badge_tier:null,charity_donation:null,shared_chat_sub:null,shared_chat_resub:null,shared_chat_sub_gift:null,shared_chat_community_sub_gift:null,shared_chat_gift_paid_upgrade:null,shared_chat_prime_paid_upgrade:null,shared_chat_pay_it_forward:null,shared_chat_raid:null,shared_chat_announcement:null}}}];setInterval(()=>{for(let p of F)if(!(Math.random()>.25))switch(p.metadata.message_type!="session_keepalive"&&console.log(p),p.metadata.message_type){case"session_welcome":M==0?Y(p.payload.session.id):j[M-1].close();break;case"session_reconnect":M++,j[M]=new WebSocket(p.payload.session.reconnect_url);break;case"notification":let S=p.payload.event.notice_type,v={id:p.metadata.message_id,user:p.payload.event.chatter_user_name,text:p.payload.event.message.text??""};switch(["sub","resub","sub_gift","community_sub_gift"].includes(S)&&(v.tier=p.payload.event[S].sub_tier/1e3),["sub","resub"].includes(S)&&(v.is_prime=p.payload.event[S].is_prime,v.color="-green-600"),["sub_gift","community_sub_gift"].includes(S)&&(v.user_total=p.payload.event[S].cumulative_total??0,v.color="-orange-600"),p.payload.event.notice_type){case"sub":v.nice_name="Sub",v.tts=`${v.user} subbed at tier ${v.tier}: ${v.text}`;break;case"resub":v.nice_name="ReSub",v.months=p.payload.event[S].cumulative_months,v.tts=`${v.user} resubbed at tier ${v.tier}, total ${v.months} months: ${v.text}`;break;case"sub_gift":v.nice_name="Gift x1",v.recipient=p.payload.event[S].recipient_user_name,v.exclude=!!p.payload.event[S].community_gift_id,v.tts=`${v.user} gifted a tier ${v.tier} sub to ${v.recipient}`;break;case"community_sub_gift":v.nice_name="Gift x"+p.payload.event[S].total,v.text="Gifted "+p.payload.event[S].total+" subs",v.tts=`${v.user} gifted ${p.payload.event[S].total} subs`;break;case"raid":v.color="-purple-600",v.nice_name="Raid x"+p.payload.event[S].viewer_count,v.raider=p.payload.event[S].user_name,v.tts=`${v.raider} raided with ${p.payload.event[S].viewer_count} viewers`;break}v.exclude||d(v);break}},3e3)}return(F,p)=>(Se(),$e(me,null,[ce("audio",{controls:"",class:"hidden",ref_key:"notifyAudio",ref:s},[sc,to(" Your browser does not support the audio element. ")],512),ce("button",{onClick:y,class:"bg-purple-700 hover:bg-purple-800 text-white font-bold py-2 px-4 rounded-full m-4 absolute z-40 right-3 top-0 drop-shadow-lg"},ke(r.value),1),ce("div",rc,[ye(Vl,{name:"notification",tag:"div"},{default:$r(()=>[(Se(!0),$e(me,null,xi(t.value,S=>(Se(),$e("div",{key:S.id,class:$t([S.type+" border"+S.color,"bg-slate-800 rounded-lg p-2 mb-3 w-full border-2"])},[ce("div",oc,[ce("div",ic,[S.nice_name?(Se(),$e("div",{key:0,class:$t(["bg"+S.color,"notify-pill-nobg"])},ke(S.nice_name),3)):Ct("",!0),S.tier?(Se(),$e("div",lc,"Tier "+ke(S.tier),1)):Ct("",!0),S.months?(Se(),$e("div",cc,ke(S.months)+" months",1)):Ct("",!0),S.is_prime?(Se(),$e("div",ac,"Prime")):Ct("",!0),S.user_total?(Se(),$e("div",uc,ke(S.user_total)+" total",1)):Ct("",!0)])]),ce("div",fc,ke(S.raider||S.user),1),ce("div",dc,ke(S.text||"Gifted to "+S.recipient),1)],2))),128))]),_:1})])],64))}},pc=["src"],_c={__name:"ChatFeed",setup(e){const t=nt(""),n=nt(null),s=new URL(window.location.href),r=s.searchParams.get("channel")??"pablogz205",o=s.searchParams.get("size")??1,i=s.searchParams.get("font")??1;t.value=`https://www.giambaj.it/twitch/jchat/v2/?channel=${r}&size=${o}&font=${i}`,Nt(()=>{var a=document.querySelector(".chat-scroll-container");a.scrollTop=a.scrollHeight,a.addEventListener("scroll",function(){var f=document.querySelector(".scroll-to-bottom-button");a.scrollTop+a.clientHeight(Se(),$e("div",{class:"chat-scroll-container",ref_key:"chatScrollContainer",ref:n},[ce("iframe",{class:"chat-frame",src:t.value},null,8,pc),ce("button",{class:"scroll-to-bottom-button absolute bottom-4 bg-orange-600 rounded p-2 font-bold left-[50%] translate-x-[-50%] transition-all duration-300",onClick:c},"Scroll to bottom")],512))}},gc={class:"h-dvh"},mc={class:"resizeable-container"},bc={class:"top"},yc=ce("div",{class:"resize"},null,-1),vc={class:"bottom"},wc={__name:"App",setup(e){return Nt(()=>{var t=document.querySelector(".resize"),n=document.querySelector(".top"),s=document.querySelector(".resizeable-container"),r=!1,o=0;function i(f){r=!0,b.mobile()?b.landscape()?o=f.touches[0].clientX:o=f.touches[0].clientY:o=f.y}function c(f){b.mobile()?b.landscape()?o=f.touches[0].clientX:o=f.touches[0].clientY:o=f.y,r&&(b.mobile()&&b.landscape()?n.style.width=o-t.getBoundingClientRect().width/2+"px":n.style.height=o-t.getBoundingClientRect().height/2+"px",f.preventDefault())}function a(f){r=!1}t.addEventListener("mousedown",i),t.addEventListener("touchstart",i),s.addEventListener("mousemove",c),s.addEventListener("touchmove",c),s.addEventListener("mouseup",a),s.addEventListener("touchend",a),b.mobile()&&b.landscape()?n.style.width=window.innerWidth/2+"px":n.style.height=window.innerHeight/3+"px",b.onChangeOrientation(f=>{b.mobile()&&(f==="landscape"?(n.scrollTop=n.scrollHeight,n.style.height="",n.style.width=window.innerHeight/2+"px"):(n.style.width="",n.style.height=window.innerWidth/3+"px"))})}),(t,n)=>(Se(),$e("main",gc,[ce("div",mc,[ce("div",bc,[ye(hc)]),yc,ce("div",vc,[ye(_c)])])]))}};Yl(wc).mount("#app"); diff --git a/dist/index.html b/dist/index.html index 22ac38a..bcc44b4 100644 --- a/dist/index.html +++ b/dist/index.html @@ -4,7 +4,7 @@ Split Feed for Twitch by Deleter - + diff --git a/src/components/NotificationFeed.vue b/src/components/NotificationFeed.vue index 1e96712..b075710 100644 --- a/src/components/NotificationFeed.vue +++ b/src/components/NotificationFeed.vue @@ -69,11 +69,11 @@ setInterval(() => { let donation = data.references.donations[i]; if (lastDonation == 0) { - lastDonation = donation.id; + lastDonation = donation.donation_id; break; } - if (donation.id <= lastDonation) { + if (donation.donation_id <= lastDonation) { break; } @@ -87,7 +87,7 @@ setInterval(() => { }; addNotification(notification); - lastDonation = donation.id; + lastDonation = donation.donation_id; } }); }, 30000);