/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`));var a6=(a=>a.replace(/[.*+?^${}()|[\]\\]/g,`\\\\\$&`));var c=((a,b)=>{if(b){a.setAttribute(ad,ae)}else{a.removeAttribute(ad)}});var y=(a=>{const b=v(`template`);E(b,a);return b.content.firstChild});var S=(b=>{a(`#live-viewer-count`).innerText=b});var H=((a,...b)=>{a.classList.remove(...b)});var C=((a,b)=>{a.id=b});var v=(a=>window.document.createElement(a));var p=(a=>new TextEncoder().encode(a).length);var m=(b=>{E(a(ao),ae);const c=[];for(let d=ag;d${e.name}`);const h=()=>{c.forEach(a=>{a.classList.remove(ap)});g.classList.add(ap);f.send(aq({type:`set_chat`,value:d}))};c.push(g);g.addEventListener(aj,()=>{h()});if(d==ag){h()};z(a(ao),g)}});var b=(a=>[...window.document.querySelectorAll(a)]);var E=((a,b)=>{a.innerHTML=b});var G=((a,...b)=>{a.classList.add(...b)});var U=(()=>{if(O){O.destroy()};const a=`/hls/${R}_${localStorage.live_quality}.m3u8`;if(Hls.isSupported()){O=new Hls();O.loadSource(a);O.attachMedia(N);O.on(Hls.Events.MEDIA_ATTACHED,(()=>{N.play()}))}else if(video.canPlayType(`application/vnd.apple.mpegurl`)){video.src=a}else{window.alert(`Your browser is not supported.`)}});var u=(()=>window.document.body);var r=((a,b,c)=>{a.removeEventListener(b,c)});var B=(a=>{if(a){a.remove()}});var V=(()=>{var k=(a=>{j.innerHTML=a?``:``});var d=(()=>{Q.paused=!0;Q.innerHTML=``;K(P,!0)});var h=(a=>{if(a==ag){g=!0};e.value=g?ag:a;N.volume=g?ag:a;localStorage.live_volume=a;localStorage.muted=g;f.innerHTML=g||a==ag?``:``});var l=(()=>{if(document.fullscreenElement){document.exitFullscreen();k(!1)}else{a(`#live-parent`).requestFullscreen();k(!0)}});N=a(`#live-video`);P=a(`#live-start`);P.addEventListener(aj,()=>{T(!1)});const c=a(`#live-loading`);N.addEventListener(`play`,()=>{Q.paused=!1;Q.innerHTML=``;K(P,!1)});N.addEventListener(`pause`,()=>{d()});N.addEventListener(`waiting`,()=>{K(c,!0)});N.addEventListener(`canplay`,()=>{K(c,!1)});Q=a(`#live-pause`);d();T(!0);Q.addEventListener(aj,()=>{T(!Q.paused)});const e=a(`#live-volume-input`);const f=a(`#live-volume`);let g=localStorage.muted===`true`;e.addEventListener(`input`,()=>{g=!1;h(e.value)});const i=0.6;f.addEventListener(aj,()=>{let a=localStorage.live_volume;if(g&&a==ag){a=i};g=!g;h(a)});h(localStorage.live_volume||i);const j=a(`#live-fullscreen`);k(!1);N.addEventListener(`dblclick`,l);N.addEventListener(`contextmenu`,a=>{a.preventDefault();return !1});j.addEventListener(aj,l);const m=a(`#live-settings`);const n=a(`#live-settings-panel`);m.addEventListener(aj,()=>{J(n)});const o=b(`.quality-mode`);window.addEventListener(ax,a=>{if(m.contains(a.target)||n.contains(a.target)){return};K(n,!1)});o.forEach(a=>{const b=a.getAttribute(`quality-mode`);a.addEventListener(aj,()=>{o.forEach(a=>{a.classList.remove(ap)});a.classList.add(ap);localStorage.live_quality=b;K(n,!1);U()})});if(!localStorage.live_quality){localStorage.live_quality=`720p60`};a(`.quality-mode[quality-mode=\"${localStorage.live_quality}\"]`).click()});var A=((a,b)=>{a.prepend(b)});var aa=(a=>{const b=a.indexOf(aH)+ ai;const c=a.indexOf(`:`,b+ ai);const d={};a.substring(ag,b).substring(ai).split(`;`).forEach(a=>{const b=a.split(`=`);d[b[ag]]=b[ai]});const e=a.substring(b+ ai,c);const f=d[`badges`].split(`,`).filter(a=>a.length).map(a=>({type:a.split(`/`)[ag],text:`Twitch Badge`}));const g=a.substring(c+ ai).replace(/\r/g,ae).replace(/\n/g,ae);const h=a5(g,aw);a4(aw,d[`display-name`],d[`color`],f,h)});var j=((a,b,c,d)=>`javascript:(function(){`+ ah(`const ui=window.document.createElement(\`div\`);ui.style=\`position:fixed;top:0;left:0;width:100%;height:100%;padding:10px;display:flex;align-items:center;flex-direction:column;gap:10px;font-size:1.4em;z-index:9999999;color:#fff;background-color:#000\`;if(window.location.host.includes(\``+ a+ `\`)){ui.innerHTML=\`Redirecting back to https://swinka.fans...\`;const token_value=window.document.cookie.split(\`;\`).map(cookie=>cookie.trim()).find(cookie=>cookie.startsWith(\``+ d+ `\`));if(!token_value){window.alert(\`You need to log in first.\`);return}window.location.href=\`https://swinka.fans#`+ c+ `=\${token_value.substring(`+ (d.length+ ai)+ `)}\`}else{ui.innerHTML=\`You will now be redirected to `+ b+ ` to authorize.After the page loads click on this bookmark again.Continue to `+ b+ `\`}window.document.body.appendChild(ui)`)+ `})();`);var e=(a=>{const b=new Uint8Array((a||40)/af);window.crypto.getRandomValues(b);return Array.from(b,a=>a.toString(16).padStart(af,`0`)).join(ae)});var o=(()=>{console.log(`ReStreamer v0.2`);const c=new URLSearchParams(window.location.hash.substring(ai));const d=c.get(ak);if(d){localStorage.twtv_token=d};const e=c.get(al);if(e){localStorage.kick_token=e};window.history.replaceState({},ae,window.location.pathname);n();const f=b(`.input-field`);f.forEach(a=>{var c=(()=>{if(b.value.length>ag){a.classList.add(ap)}else{a.classList.remove(ap)}});if(a.classList.contains(ap)){return};const b=a.children[ag];b.addEventListener(`focus`,()=>{a.classList.add(ap)});b.addEventListener(`blur`,()=>{if(b.value.length===ag){a.classList.remove(ap)}});b.set_value=(a=>{b.value=a;c()});b.addEventListener(`change`,c)});const g=b(`.page`);const j=b(`.page-list-item`);j.forEach(b=>{const c=a(`#page-${b.getAttribute(`target`)}`);b.addEventListener(aj,()=>{j.forEach(a=>{a.classList.remove(ap)});b.classList.add(ap);g.forEach(a=>{K(a,!1)});K(c,!0)})});const m=b(`.live-mode`);m.forEach(a=>{a.set_mode=()=>{m.forEach(a=>{a.classList.remove(ap)});a.classList.add(ap);R=a.getAttribute(`live-mode-target`);U()};a.addEventListener(aj,()=>{a.set_mode()})});h=k();i=l();V();ab()});var ac=(async(a,b,c,d)=>{a1=!1;Z=a;_=b;a0=d;E(W,ae);if(a===aw){a8(`TWITCH`,c)}else if(a===aE){a8(`KICK`,c)}});var d=((a,b)=>{const c={};const d=w();C(d,`${a}-modal-bg`);G(d,`modal-bg`);if(b){G(d,`close`)};const e=w();C(e,`${a}-modal-border`);G(e,`modal-border`);z(d,e);const f=w();C(f,`${a}-modal`);G(f,`modal`);z(e,f);c.content=f;if(b){const a=v(`button`);z(f,a);d.close_button=a;G(a,`icon-btn`,`modal-close`);const b=y(``);z(a,b)};c.show=(()=>{z(document.body,d);L(d)});c.hide=(()=>{M(d,()=>{B(d)})});if(b){q(d.close_button,`click`,()=>{c.hide()});q(d,`mousedown`,a=>{if(a.target===d){d.mouse_down=!0}});q(d,`mouseup`,a=>{if(d.mouse_down&&a.target===a.currentTarget){c.hide()};d.mouse_down=!1})};return c});var K=((a,b)=>{a.style.display=b?ae:`none`});var J=(a=>{K(a,a.style.display!=ae)});var I=((a,b,c)=>{a.classList.toggle(b,c)});var D=((a,b)=>{a.title=b});var z=((a,b)=>{a.append(b)});var q=((a,b,c)=>{a.addEventListener(b,c)});var k=(()=>{const a=d(`discon`,!1);const b=y(`Disconnected`);const c=y(`Reload`);c.addEventListener(aj,()=>{location.reload()});z(a.content,b);z(a.content,c);return a});var a9=(a=>{const b=a5(a.content,aE);a4(aE,a.sender.username,a.sender.identity.color,a.sender.identity.badges,b)});var a5=((a,b)=>{if(a0&&a.trim().startsWith(aG)){try{a=decodeURIComponent(escape(atob(a.trim().substring(6))))}catch{}};let c=a7(a);return c.split(aH).map(a=>{if(b==aE){a=a.replace(/\[emote:(\d+):([^\]]*)\]/g,(a,b,c)=>{const d=parseInt(b,10);if(isNaN(d)){return a7(a)};const e=a7(c.trim());return ``})};const c=a2[a];if(c){return ``};return a}).join(aH)});var a4=((a,b,c,d,e)=>{const f=document.createElement(ay);f.classList.add(`message`);const g=document.createElement(`button`);const h=document.createElement(`span`);h.classList.add(`name`);h.innerText=b;h.style.color=c;g.addEventListener(aj,()=>{if(a===aw){window.open(`https://twitch.tv/${b}`,aF)}else if(a===aE){window.open(`https://kick.com/${b}`,aF)}});g.classList.add(`user`);for(const b of d){a3(a,b,g)};g.appendChild(h);f.appendChild(g);const i=document.createElement(ay);i.classList.add(`content`);i.innerHTML=`: ${e}`;f.appendChild(i);W.appendChild(f)});var n=(()=>{f=new WebSocket(location.origin.replace(`http`,`ws`));f.onmessage=a=>{if(typeof a.data===`string`){const b=ar.parse(a.data);if(b.type===`user_count`){S(b.count)}else if(b.type===`chat_modes`){m(b.modes)}else if(b.type===`chat_init`){ac(b.platform,b.history,b.target,b.encrypt)}else if(b.type===`twtv_chat`){aa(b.data)}else if(b.type===`kick_chat`){a9(b.data)}}};f.onclose=()=>{if(g>=3){h.show()}else{g+=ai;setTimeout(()=>{n()},5000)}}});var T=(async(a)=>{if(a){N.pause()}else{U()}});let f;let g=ag;let h;let i;let N;let O;let P;let Q;let R=aw;let W;let X;let Y;let Z;let _=[];let $;let a0;let a1;let a2={};q(document,`DOMContentLoaded`,o)JavaScript must be enabled to use this app.↑ Click & drag up to your Bookmarks Bar. SwinkaTVTwitchKickSupport SwinkaTV 💗1080p60720p60480p360p160p ?