(function () { 'use strict'; const _0x5db4bc = document.querySelectorAll('[data-outside]'); const _0x4e548b = {}; const _0x2c2baf = document.querySelector(".player-button-play"); const _0x35fbf4 = document.querySelector(".visualizer"); const _0x52ef0a = document.querySelector('.song-now'); const _0x88f18a = document.getElementById("stations"); const _0x2af40c = document.querySelector(".station-name"); const _0x230a71 = document.querySelector('.station-description'); const _0x9a177c = document.querySelector(".header-logo-img"); const _0x32ca52 = document.querySelector(".player-artwork img:first-child"); const _0x4f1ff0 = document.querySelector(".player-cover-image"); const _0x4d0e83 = document.querySelector('.player-social'); const _0x4eb6ae = document.querySelector(".footer-app"); const _0xc0984c = document.querySelector(".footer-tv"); const _0xcc9105 = document.getElementById("modal-tv"); const _0x18bbd4 = document.querySelector(".player-program"); const _0x171620 = document.getElementById("lyrics"); const _0x4f5987 = document.getElementById("history"); let _0x2a51f3; let _0x58c67a; let _0x1f9cb3; let _0x5abd67; const _0xdb6d9f = new Audio(); _0xdb6d9f.crossOrigin = "anonymous"; let _0x1ffa1f = false; const _0x35a29b = { 'play': "", 'pause': "", 'facebook': "", 'twitter': "", 'instagram': "", 'youtube': "", 'tiktok': "", 'whatsapp': "", 'telegram': "", 'tv': "" }; function _0x6875f2(_0x29dd8c) { const _0x169cff = document.createElement("div"); _0x169cff.innerHTML = _0x29dd8c.trim(); return _0x169cff.firstChild; } function _0x43b9f5(_0x2f3710) { return new Promise((_0x25886, _0x4118c7) => { const _0x5506a3 = document.createElement("img"); _0x5506a3.crossOrigin = 'Anonymous'; _0x5506a3.src = "https://images.weserv.nl/?url=" + _0x2f3710; _0x5506a3.onload = () => _0x25886(_0x5506a3); _0x5506a3.onerror = _0x4118c7; }); } function _0x5b0c81() { if (_0xdb6d9f.paused) { _0x4693d2(_0xdb6d9f); } else { _0xbacef4(_0xdb6d9f); } } function _0x4693d2(_0x2be6fe, _0x50ad2d = null) { if (_0x50ad2d) { _0x2be6fe.src = _0x50ad2d; } _0x2be6fe.addEventListener('canplay', () => { _0x2be6fe.play(); _0x2c2baf.innerHTML = ""; _0x2c2baf.classList.add("is-active"); document.body.classList.add("is-playing"); }); if (!_0x1ffa1f) { _0x5ac54e(_0x2be6fe, _0x35fbf4); _0x1ffa1f = true; } _0x2be6fe.load(); } function _0xbacef4(_0x2076c6) { _0x2076c6.pause(); _0x2c2baf.innerHTML = ""; _0x2c2baf.classList.remove('is-active'); document.body.classList.remove("is-playing"); } function _0x4cdedf(_0x140720) { if (!_0x140720) { return; } const _0x5b8e26 = document.getElementById(_0x140720.dataset.outside); if (!_0x5b8e26) { return; } _0x140720.addEventListener('click', () => { _0x140720.classList.toggle('is-active'); _0x5b8e26.classList.toggle('is-active'); }); const _0x4593f6 = _0x43ed91 => { if (!_0x5b8e26.contains(_0x43ed91.target) && !_0x140720.contains(_0x43ed91.target)) { _0x140720.classList.remove('is-active'); _0x5b8e26.classList.remove('is-active'); } }; document.addEventListener("click", _0x4593f6); const _0x12e724 = _0x5b8e26.querySelector("[data-close]"); if (_0x12e724) { _0x12e724.onclick = function () { _0x140720.classList.remove('is-active'); _0x5b8e26.classList.remove('is-active'); }; } } _0x5db4bc.forEach(_0x1ee827 => { _0x4cdedf(_0x1ee827); }); function _0xdde489(_0x6f316a) { const _0x55788d = document.createElement("canvas"); _0x55788d.setAttribute('id', "visualizerCanvas"); _0x55788d.setAttribute("class", "visualizer-item"); _0x6f316a.appendChild(_0x55788d); _0x55788d.width = _0x6f316a.clientWidth; _0x55788d.height = _0x6f316a.clientHeight; return _0x55788d; } function _0x4bf99e(_0x577eae, _0x21f012) { _0x577eae.width = _0x21f012.clientWidth; _0x577eae.height = _0x21f012.clientHeight; } const _0x5ac54e = (_0x55d4f2, _0x4d062f) => { if (!_0x55d4f2 || !_0x4d062f) { return; } const _0xc2a0ec = { 'fftSize': _0x4d062f.dataset.fftSize || 0x800, 'numBars': _0x4d062f.dataset.bars || 0x28, 'maxHeight': _0x4d062f.dataset.maxHeight || 0xff }; const _0x3c5a5a = new AudioContext(); const _0x4f5af2 = _0x3c5a5a.createMediaElementSource(_0x55d4f2); const _0x2f50db = _0x3c5a5a.createAnalyser(); _0x4f5af2.connect(_0x2f50db); _0x4f5af2.connect(_0x3c5a5a.destination); const _0x4bae49 = new Uint8Array(_0x2f50db.frequencyBinCount); const _0x121666 = _0xdde489(_0x4d062f); const _0x266128 = _0x121666.getContext('2d'); const _0x3536e0 = () => { _0x4bf99e(_0x121666, _0x4d062f); _0x2f50db.getByteFrequencyData(_0x4bae49); if (_0xc2a0ec.fftSize) { _0x2f50db.fftSize = _0xc2a0ec.fftSize; } _0x266128.clearRect(0x0, 0x0, _0x121666.width, _0x121666.height); for (let _0x2d6eea = 0x0; _0x2d6eea < _0xc2a0ec.numBars; _0x2d6eea++) { const _0x17359a = Math.floor((_0x2d6eea + 0xa) * (_0x2d6eea < _0xc2a0ec.numBars / 0x2 ? 0x2 : 0x1)); const _0x7d713a = _0x4bae49[_0x17359a]; const _0x15df11 = Math.max(0x4, _0x7d713a || 0x0) + _0xc2a0ec.maxHeight / 0xff; const _0x1814dd = _0x121666.width / _0xc2a0ec.numBars; const _0x43c645 = _0x2d6eea * _0x1814dd; const _0x5caaed = _0x121666.height - _0x15df11; _0x266128.fillStyle = "white"; _0x266128.fillRect(_0x43c645, _0x5caaed, _0x1814dd + 0x1, _0x15df11); } requestAnimationFrame(_0x3536e0); }; _0x3536e0(); window.addEventListener('resize', () => { _0x4bf99e(_0x121666, _0x4d062f); }); }; async function _0x50b095({ artist: _0x53f9fc, title: _0x15edb7, art: _0x22c7d5, cover: _0x1b818e, server: _0x489d1c }) { let _0x3b034c = {}; let _0x37c545 = _0x53f9fc ? _0x53f9fc + " - " + _0x15edb7 : _0x15edb7; const _0x3161f7 = _0x37c545.toLowerCase(); if (_0x4e548b[_0x3161f7]) { return _0x4e548b[_0x3161f7]; } try { const _0x251f1a = await fetch("https://demo.jbcast.icu/getMusicInfo.php?artist=" + encodeURIComponent(_0x53f9fc) + "&title=" + encodeURIComponent(_0x15edb7) + "&service=" + _0x489d1c); if (_0x251f1a.ok) { _0x3b034c = await _0x251f1a.json(); } else { console.warn("Erro na API PHP, buscando no iTunes...", _0x251f1a.status); _0x3b034c = await _0x21809a(_0x53f9fc, _0x15edb7, _0x22c7d5, _0x1b818e); } } catch (_0x3e6c03) { console.error("Erro ao buscar dados:", _0x3e6c03); _0x3b034c = await _0x21809a(_0x53f9fc, _0x15edb7, _0x22c7d5, _0x1b818e); } _0x4e548b[_0x3161f7] = _0x3b034c; return _0x3b034c; } async function _0x21809a(_0x239e7f, _0x41f492, _0x4aed21, _0x5ea418) { let _0x533d00 = _0x239e7f ? _0x239e7f + " - " + _0x41f492 : _0x41f492; const _0x4556fb = _0x533d00.toLowerCase(); if (_0x4e548b[_0x4556fb]) { return _0x4e548b[_0x4556fb]; } try { const _0x43dda5 = await fetch("https://itunes.apple.com/search?term=" + encodeURIComponent(_0x533d00) + '&media=music&limit=1'); if (!_0x43dda5.ok) { throw new Error("Erro na requisição para o iTunes. Status: " + _0x43dda5.status); } const _0x505218 = await _0x43dda5.json(); if (_0x505218.resultCount > 0x0) { const _0x5e1010 = _0x505218.results[0x0]; const _0x3ad36b = { 'title': _0x5e1010.trackName || _0x41f492, 'artist': _0x5e1010.artistName || _0x239e7f, 'thumbnail': _0x5e1010.artworkUrl100 || _0x4aed21, 'art': _0x5e1010.artworkUrl100 ? _0x5e1010.artworkUrl100.replace(/100x100/, "600x600") : _0x4aed21, 'cover': _0x5e1010.artworkUrl100 ? _0x5e1010.artworkUrl100.replace(/100x100/, "1500x1500") : _0x5ea418, 'stream_url': _0x5e1010.trackViewUrl || "#not-found" }; _0x4e548b[_0x4556fb] = _0x3ad36b; return _0x3ad36b; } else { console.log("Nenhum resultado encontrado no iTunes."); return { 'title': _0x41f492, 'artist': _0x239e7f, 'art': _0x4aed21, 'cover': _0x5ea418, 'stream_url': '#not-found' }; } } catch (_0xd05fce) { console.error("Erro ao buscar dados do iTunes:", _0xd05fce); return { 'title': _0x41f492, 'artist': _0x239e7f, 'art': _0x4aed21, 'cover': _0x5ea418, 'stream_url': "#not-found" }; } } const _0x4666e2 = async (_0x53f407, _0x38e6ec) => { try { const _0x3a25c3 = await fetch("https://api.vagalume.com.br/search.php?apikey=1637b78dc3b129e6843ed674489a92d0&art=" + encodeURIComponent(_0x53f407) + '&mus=' + encodeURIComponent(_0x38e6ec)); const _0x379afe = await _0x3a25c3.json(); if (_0x379afe.type === "exact" || _0x379afe.type === "aprox") { const _0xffc010 = _0x379afe.mus[0x0].text; return _0xffc010; } else { return "Letra indisponível"; } } catch (_0x30d171) { console.error("Error fetching lyrics:", _0x30d171); return "Letra no disponible"; } }; function _0x35fc92(_0x4fb04e) { let _0x59a769; let _0x4bdfcd; if (_0x4fb04e.last_played) { _0x59a769 = _0x4fb04e.last_played.song; _0x4bdfcd = _0x4fb04e.last_played.artist; } else { if (_0x4fb04e.song && _0x4fb04e.artist) { _0x59a769 = _0x4fb04e.song; _0x4bdfcd = _0x4fb04e.artist; } else { if (_0x4fb04e.songtitle && _0x4fb04e.songtitle.includes(" - ")) { _0x59a769 = _0x4fb04e.songtitle.split(" - ")[0x0]; _0x4bdfcd = _0x4fb04e.songtitle.split(" - ")[0x1]; } else { if (_0x4fb04e.now_playing) { _0x59a769 = _0x4fb04e.now_playing.song.title; _0x4bdfcd = _0x4fb04e.now_playing.song.artist; } else { if (_0x4fb04e.artist && _0x4fb04e.title) { _0x59a769 = _0x4fb04e.title; _0x4bdfcd = _0x4fb04e.artist; } else { if (_0x4fb04e.currenttrack_title) { _0x59a769 = _0x4fb04e.currenttrack_title; _0x4bdfcd = _0x4fb04e.currenttrack_artist; } else if (_0x4fb04e.title && _0x4fb04e.djprofile && _0x4fb04e.djusername) { _0x59a769 = _0x4fb04e.title.split(" - ")[0x1]; _0x4bdfcd = _0x4fb04e.title.split(" - ")[0x0]; } else { _0x59a769 = _0x4fb04e.currentSong; _0x4bdfcd = _0x4fb04e.currentArtist; } } } } } } return { 'title': _0x59a769, 'artist': _0x4bdfcd }; } function _0x3547cb(_0x38cc38) { let _0x2bee84; let _0x4d0988; let _0x165311 = _0x38cc38.song_history || _0x38cc38.history || _0x38cc38.songHistory || []; _0x165311 = _0x165311.slice(0, 0); const _0x5f1648 = _0x165311.map(_0x5c6f68 => { if (_0x38cc38.song_history) { _0x2bee84 = _0x5c6f68.song.artist; _0x4d0988 = _0x5c6f68.song.title; } else { if (_0x38cc38.history) { _0x2bee84 = (_0x5c6f68.artist || '').replace(/^\d+\.\)\s/, '').replace(/
$/, ''); _0x4d0988 = (_0x5c6f68.song || '').replace(/^\d+\.\)\s/, '').replace(/
$/, ''); } else if (_0x38cc38.songHistory) { _0x2bee84 = _0x5c6f68.song.artist; _0x4d0988 = _0x5c6f68.song.title; } } return { 'artist': _0x2bee84, 'song': _0x4d0988 }; }); return _0x5f1648; } function _0x1c8bad(_0xd64ed6, _0x5888e7) { const _0x585208 = document.documentElement; const _0x1e571e = document.querySelector("meta[name=theme-color]"); if (_0xd64ed6.complete) { _0x585208.setAttribute("style", "--accent: rgb(" + _0x5888e7.getColor(_0xd64ed6) + ')'); _0x1e571e.setAttribute("content", 'rgb(' + _0x5888e7.getColor(_0xd64ed6) + ')'); } else { console.log("imagen no completa"); _0xd64ed6.addEventListener("load", function () { _0x585208.setAttribute("style", "--accent: rgb(" + _0x5888e7.getColor(_0xd64ed6) + ')'); _0x1e571e.setAttribute('content', "rgb(" + _0x5888e7.getColor(_0xd64ed6) + ')'); }); } } function _0x442470(_0x50a4ac) { const _0x20c6f0 = document.createElement("button"); _0x20c6f0.classList.add("player-button-tv", 'btn'); _0x20c6f0.innerHTML = "Tv ao vivo"; _0x20c6f0.addEventListener("click", () => { _0xcc9105.classList.add("is-active"); _0xbacef4(_0xdb6d9f); const _0x4553d0 = _0xcc9105.querySelector(".modal-body-video"); const _0x43b8f8 = _0xcc9105.querySelector("[data-close]"); const _0x411acc = document.createElement("iframe"); _0x411acc.src = _0x50a4ac; _0x411acc.allowFullscreen = true; _0x4553d0.appendChild(_0x411acc); _0x43b8f8.addEventListener("click", () => { _0xcc9105.classList.remove('is-active'); _0x411acc.remove(); }); }); _0xc0984c.appendChild(_0x20c6f0); } function _0x135c51(_0x309dc1) { if (!_0x309dc1) { return; } if (_0x309dc1.time) { const _0x406487 = document.createElement('div'); const _0x1196ff = document.createElement("span"); _0x406487.classList.add("player-program-time-container"); _0x1196ff.classList.add("player-program-badge"); _0x1196ff.textContent = "Agora"; _0x406487.appendChild(_0x1196ff); const _0x461c2d = document.createElement("span"); _0x461c2d.classList.add("player-program-time"); _0x461c2d.textContent = _0x309dc1.time; _0x406487.appendChild(_0x461c2d); _0x18bbd4.appendChild(_0x406487); } if (_0x309dc1.name) { const _0x4bf083 = document.createElement('span'); _0x4bf083.classList.add("player-program-name"); _0x4bf083.textContent = _0x309dc1.name; _0x18bbd4.appendChild(_0x4bf083); } if (_0x309dc1.description) { const _0x5d4712 = document.createElement("span"); _0x5d4712.classList.add("player-program-description"); _0x5d4712.textContent = _0x309dc1.description; _0x18bbd4.appendChild(_0x5d4712); } } function _0xf7aa6(_0x291713, _0xf1ad30) { const _0x2991df = document.createElement('a'); _0x2991df.classList.add('player-social-item'); _0x2991df.href = _0x291713; _0x2991df.target = "_blank"; _0x2991df.innerHTML = _0x35a29b[_0xf1ad30]; return _0x2991df; } function _0x1cda36(_0x198802, _0xc247da) { const _0x2cdb75 = document.createElement('a'); _0x2cdb75.classList.add("player-apps-item"); _0x2cdb75.href = _0x198802; _0x2cdb75.target = '_blank'; _0x2cdb75.innerHTML = "\"""; return _0x2cdb75; } function _0x40eb6c(_0x186619, _0x50ba48, _0x9fd446, _0x5de443) { const _0x222549 = document.createElement("button"); _0x222549.classList.add("station"); _0x222549.innerHTML = "\"station\""; _0x222549.dataset.index = _0x50ba48; _0x222549.dataset.hash = _0x186619.hash; if (_0x9fd446.stream_url === _0x186619.stream_url) { _0x222549.classList.add("is-active"); _0x58c67a = _0x222549; } _0x222549.addEventListener('click', () => { if (_0x222549.classList.contains("is-active")) { return; } if (_0x58c67a) { _0x58c67a.classList.remove("is-active"); } _0x222549.classList.add('is-active'); _0x58c67a = _0x222549; _0xfd3166(_0x186619); _0x4693d2(_0xdb6d9f, _0x186619.stream_url); if (_0x4f5987) { _0x4f5987.innerHTML = ''; } if (typeof _0x5de443 === "function") { _0x5de443(_0x186619); } }); return _0x222549; } function _0x3fe58c(_0x19c480, _0x1a2be5, _0x3685cd) { if (!_0x88f18a) { return; } _0x88f18a.innerHTML = ''; _0x19c480.forEach(async (_0x544374, _0x49f62a) => { const _0x1aef54 = document.createDocumentFragment(); const _0x1b5d9d = _0x40eb6c(_0x544374, _0x49f62a, _0x1a2be5, _0x3685cd); _0x1aef54.appendChild(_0x1b5d9d); _0x88f18a.appendChild(_0x1aef54); }); } function _0xfd3166(_0x910678) { _0x4d0e83.innerHTML = ''; _0x4eb6ae.innerHTML = ''; _0x18bbd4.innerHTML = ''; _0xc0984c.innerHTML = ''; _0x9a177c.src = _0x910678.logo; _0x32ca52.src = _0x910678.album; _0x4f1ff0.src = _0x910678.cover || _0x910678.album; _0x2af40c.textContent = _0x910678.name; _0x230a71.textContent = _0x910678.description; if (_0x910678.social && _0x4d0e83) { Object.keys(_0x910678.social).forEach(_0x1cadc3 => { _0x4d0e83.appendChild(_0xf7aa6(_0x910678.social[_0x1cadc3], _0x1cadc3)); }); } if (_0x910678.apps && _0x4eb6ae) { Object.keys(_0x910678.apps).forEach(_0x26d04c => { _0x4eb6ae.appendChild(_0x1cda36(_0x910678.apps[_0x26d04c], _0x26d04c)); }); } if (_0x910678.program && _0x18bbd4) { _0x135c51(_0x910678.program); } if (_0x910678.tv_url && _0xc0984c) { _0x442470(_0x910678.tv_url); } } function _0x163b31(_0x3d94b7) { const { title: _0x56f4be, artist: _0x1b5cce, album: _0x921e26, art: _0x168d10 } = _0x3d94b7; if ('mediaSession' in navigator) { navigator.mediaSession.metadata = new MediaMetadata({ 'title': _0x56f4be, 'artist': _0x1b5cce, 'album': _0x921e26, 'artwork': [{ 'src': _0x168d10, 'sizes': "512x512", 'type': "image/png" }] }); navigator.mediaSession.setActionHandler("play", () => { _0x4693d2(); }); navigator.mediaSession.setActionHandler('pause', () => { _0xbacef4(); }); } } function _0x3fc8b4(_0x344f3e) { _0x52ef0a.querySelector('.song-name').textContent = _0x344f3e.title; _0x52ef0a.querySelector(".song-artist").textContent = _0x344f3e.artist; const _0x43a4c0 = _0x52ef0a.querySelector('.player-artwork'); if (_0x43a4c0) { const _0x28f4d2 = document.createElement("img"); _0x28f4d2.src = _0x344f3e.art; _0x28f4d2.width = 0x258; _0x28f4d2.height = 0x258; _0x28f4d2.addEventListener("load", () => { _0x43a4c0.appendChild(_0x28f4d2); const _0x16bc15 = new ColorThief(); _0x43b9f5(_0x28f4d2.src).then(_0x552666 => { _0x1c8bad(_0x552666, _0x16bc15); }); setTimeout(() => { _0x43a4c0.querySelectorAll("img").forEach(_0x466810 => { _0x466810.style.transform = 'translateX(' + -_0x466810.width + 'px)'; _0x466810.addEventListener('transitionend', () => { _0x43a4c0.querySelectorAll("img:not(:last-child)").forEach(_0x21d643 => { _0x21d643.remove(); }); _0x466810.style.transition = "none"; _0x466810.style.transform = 'none'; setTimeout(() => { _0x466810.removeAttribute('style'); }, 0x3e8); }); }); }, 0x64); }); } if (_0x4f1ff0) { const _0xd01136 = new Image(); _0xd01136.src = _0x344f3e.cover || _0x344f3e.art; _0xd01136.addEventListener("load", () => { _0x4f1ff0.style.opacity = 0x0; _0x4f1ff0.addEventListener("transitionend", () => { _0x4f1ff0.src = _0x344f3e.cover || _0x344f3e.art; _0x4f1ff0.style.opacity = 0x1; }); }); } } function _0x53f842(_0x51f71c, _0x255b28, _0x35b7c6) { if (!_0x4f5987) { return; } _0x4f5987.innerHTML = "
\n
\n \n
\n
\n {{song}}\n {{artist}}\n
\n \n \n \n \n \n \n
".replace("{{art}}", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdj+P//PxcACQYDCF0ysWYAAAAASUVORK5CYII=").replace("{{song}}", "Cargando historial...").replace("{{artist}}", "Artista").replace('{{stream_url}}', "#not-found"); if (!_0x51f71c) { return; } _0x51f71c = _0x51f71c.slice(0, 15); const _0x4f1142 = _0x51f71c.map(async _0x56aec7 => { const { artist: _0x167407, song: _0x10f639 } = _0x56aec7; const { album: _0x1b4ee2, cover: _0xed961b } = _0x255b28; const _0x1f1879 = await _0x50b095({ 'artist': _0x167407, 'title': _0x10f639, 'art': _0x1b4ee2, 'cover': _0xed961b, 'server': _0x35b7c6 }); if (_0x35b7c6 === "deezer" && !_0x1f1879.stream_url) { _0x1f1879.stream_url = '#'; } return "
\n
\n \n
\n
\n {{song}}\n {{artist}}\n
\n \n \n \n \n \n \n
".replace('{{art}}', _0x1f1879.thumbnail || _0x1f1879.art).replace("{{song}}", _0x1f1879.title).replace('{{artist}}', _0x1f1879.artist).replace("{{stream_url}}", _0x1f1879.stream_url); }); Promise.all(_0x4f1142).then(_0x3a510e => { const _0x11abe8 = document.createDocumentFragment(); _0x3a510e.forEach(_0x3d9443 => { _0x11abe8.appendChild(_0x6875f2(_0x3d9443)); }); _0x4f5987.innerHTML = ''; _0x4f5987.appendChild(_0x11abe8); })["catch"](_0x1899b8 => { console.error('Error:', _0x1899b8); }); } function _0x3c8613(_0x151c86, _0x316709) { if (!_0x171620) { return; } _0x4666e2(_0x151c86, _0x316709).then(_0x2c0f89 => { const _0x7222b3 = document.createElement('p'); _0x7222b3.innerHTML = _0x2c0f89.replace(/\n/g, "
"); _0x171620.innerHTML = ''; _0x171620.appendChild(_0x7222b3); })["catch"](_0xfe6ffa => { console.error('Error:', _0xfe6ffa); }); } async function _0x3902a7() { try { const _0xbb2a3c = await fetch("/api_flux"); const _0x235a7d = await _0xbb2a3c.json(); if (_0x235a7d.status === 'ok') { const _0x242a1f = _0x235a7d.stations; _0x2a51f3 = _0x242a1f[0x0]; _0xfd3166(_0x2a51f3); _0xdb6d9f.src = _0x2a51f3.stream_url; _0x3fe58c(_0x242a1f, _0x2a51f3, _0x47fb16 => { _0x131e4(_0x47fb16); }); } else { console.error("Erro ao buscar dados da API:", _0x235a7d.status); } } catch (_0x636f) { console.error("Erro ao buscar dados da API:", _0x636f); } } async function _0x3d4c25() { try { document.body.classList.remove("preload"); await _0x3902a7(); _0x38f1ab(); if (_0x2c2baf !== null) { _0x2c2baf.addEventListener("click", _0x5b0c81); } _0x131e4(_0x2a51f3); const _0x20a2ea = document.querySelector(".player-button-forward-step"); const _0xd65f47 = document.querySelector(".player-button-backward-step"); if (_0x20a2ea) { _0x20a2ea.addEventListener("click", () => { const _0x2ad030 = _0x88f18a.querySelector(".is-active").nextElementSibling; if (_0x2ad030) { _0x2ad030.click(); } }); } if (_0xd65f47) { _0xd65f47.addEventListener("click", () => { const _0xf2c4a7 = _0x88f18a.querySelector(".is-active").previousElementSibling; if (_0xf2c4a7) { _0xf2c4a7.click(); } }); } let _0x399fd3 = false; document.body.addEventListener('click', () => { if (!_0x399fd3 && !_0xdb6d9f.playing) { _0x5b0c81(); _0x399fd3 = true; } }); } catch (_0x586951) { console.error("Erro ao inicializar a aplicação:", _0x586951); } } function _0x131e4(_0x4f9169) { if (_0x5abd67) { clearTimeout(_0x5abd67); } if (_0x2a51f3.stream_url !== _0x4f9169.stream_url) { _0x2a51f3 = _0x4f9169; } const _0x9e1b21 = _0x2a51f3.server || "itunes"; const _0x53496b = _0x2a51f3.api || 'https://api.twj.es/radio_info/?radio_url=' + _0x4f9169.stream_url; fetch(_0x53496b).then(_0x4f063 => _0x4f063.json()).then(async _0x2ca6fb => { const _0x48d377 = _0x35fc92(_0x2ca6fb); const _0x2481d3 = _0x48d377.title; if (_0x1f9cb3 !== _0x2481d3) { _0x1f9cb3 = _0x2481d3; let _0x1f488c = _0x48d377.artist; const _0x1da95d = _0x2a51f3.album; const _0xb3e72b = _0x2a51f3.cover; const _0x2634df = _0x3547cb(_0x2ca6fb); if (_0x2481d3 && _0x1f488c) { const _0xb8599e = await _0x50b095({ 'artist': _0x1f488c, 'title': _0x2481d3, 'art': _0x1da95d, 'cover': _0xb3e72b, 'server': _0x9e1b21 }); _0x3fc8b4(_0xb8599e); _0x163b31(_0xb8599e); _0x3c8613(_0xb8599e.artist, _0xb8599e.title); _0x53f842(_0x2634df, _0x2a51f3, _0x9e1b21); } else { console.log("Título ou artista undefined, não será feita a busca pela capa do álbum."); } } })["catch"](_0x1fc8f3 => console.log(_0x1fc8f3)); _0x5abd67 = setTimeout(() => { _0x131e4(_0x4f9169); }, 0x2710); } async function _0x38f1ab() { try { const _0x543f0a = await fetch("/api_flux"); const _0x133925 = await _0x543f0a.json(); const _0x1e0a70 = _0x133925.player_settings.selected_player; switch (_0x1e0a70) { case "player1": console.log(_0x1e0a70); break; case "player2": window.location.href = "single.html"; break; case "player3": window.location.href = 'index.html'; break; default: console.error("Player não reconhecido:", _0x1e0a70); window.location.href = "index.html"; } } catch (_0x5bc002) { console.error("Erro ao buscar dados da API:", _0x5bc002); } } const _0x23166a = document.querySelector(".player-volume"); const _0x34c6d6 = document.querySelector(".player-range-fill"); const _0x4e1ea4 = document.querySelector(".player-range-wrapper"); const _0x40a198 = document.querySelector('.player-range-thumb'); let _0x26f3fa = parseInt(localStorage.getItem("volume") || '100', 0xa) || 0x64; function _0x2e6484(_0x3ab1d5) { _0x34c6d6.style.width = _0x3ab1d5 + '%'; } function _0x555118(_0x75cd6) { const _0x2d8f8a = _0x4e1ea4.offsetWidth - _0x40a198.offsetWidth; const _0x395685 = _0x75cd6 / 0x64 * _0x2d8f8a; _0x40a198.style.left = _0x395685 + 'px'; } function _0x337266(_0x5b320f) { _0x23166a.value = _0x5b320f; _0x2e6484(_0x5b320f); _0x555118(_0x5b320f); localStorage.setItem("volume", _0x5b320f); _0xdb6d9f.volume = _0x5b320f / 0x64; } if (_0x23166a !== null) { _0x337266(_0x26f3fa); _0x23166a.addEventListener("input", _0x2324aa => { _0x337266(parseInt(_0x2324aa.target.value, 0xa)); }); _0x4e1ea4.addEventListener("mousedown", _0x32cda8 => { const _0x407d3f = _0x23166a.getBoundingClientRect(); const _0x3ad444 = _0x32cda8.clientX - _0x407d3f.left; const _0x2e2592 = _0x3ad444 / _0x23166a.offsetWidth * 0x64; const _0x471778 = Math.round((_0x23166a.max - _0x23166a.min) * (_0x2e2592 / 0x64)) + parseInt(_0x23166a.min); _0x337266(_0x471778); }); _0x40a198.addEventListener("mousedown", () => { document.addEventListener("mousemove", _0x38938e); }); } function _0x38938e(_0x4cd28f) { const _0x3e9334 = _0x23166a.getBoundingClientRect(); const _0x313df9 = _0x4cd28f.clientX - _0x3e9334.left; let _0x1b3217 = _0x313df9 / _0x23166a.offsetWidth * 0x64; _0x1b3217 = Math.max(0x0, Math.min(0x64, _0x1b3217)); const _0x1aa081 = Math.round((_0x23166a.max - _0x23166a.min) * (_0x1b3217 / 0x64)) + parseInt(_0x23166a.min); _0x337266(_0x1aa081); } document.addEventListener("mouseup", () => { document.removeEventListener("mousemove", _0x38938e); }); window.addEventListener("DOMContentLoaded", () => { document.body.classList.remove("preload"); let _0x360a44 = false; document.body.addEventListener('click', () => { if (!_0x360a44 && !_0xdb6d9f.playing) { _0x5b0c81(); _0x360a44 = true; } }); }); _0x3d4c25(); })();