<h6 id="fileSize"></h6>


<div style="text-align: center;">
  <ul class="btn" style="list-style-type: none; padding: 0px; text-align: center;">
    <li style="display: inline; margin: 10px;">
          </li>
    <li style="display: inline; margin: 10px;">
      <a class="download" disabled="" href="app" id="downloadBtn" oncontextmenu="return false;" style="background-color: #ff6d00; border-radius: 5px; color: white; padding: 10px 20px; text-decoration: none;">
        APK Download
      </a>
    </li>
  </ul>
</div>
<script>
  const countdownTime = 15;
  const downloadButton = document.querySelector('#downloadBtn');
  const fileSizeDisplay = document.getElementById('fileSize');
  let timer = countdownTime;
  let adVisited = false;

  function updateCountdown() {
    if (timer > 0) {
      downloadButton.textContent = `Wait ${timer} sec...`;
      downloadButton.disabled = true;
      timer--;
      setTimeout(updateCountdown, 1000);
    } else {
      onCountdownEnd();
    }
  }

  function onCountdownEnd() {
    fetch('https://u.pcloud.link/publink/show?code=XZebs05Z7r9C13mD0NYR8P02ew7vr0ysakGX')
      .then(response => response.text())
      .then(data => {
        const linkRegex = /"downloadlink":\s*"([^"]+)"/;
        const match = data.match(linkRegex);

        const sizeRegex = /"size":\s*(\d+)/;
        const sizeMatch = data.match(sizeRegex);

        if (sizeMatch) {
          const fileSizeMB = (parseInt(sizeMatch[1]) / (1024 * 1024)).toFixed(2);
          fileSizeDisplay.textContent = `File Size: ${fileSizeMB} MB`;
        } else {
          fileSizeDisplay.textContent = 'File Size: Unknown';
        }

        if (match) {
          const downloadLink = match[1].replace(/\\/g, '');

          downloadButton.disabled = false;
          downloadButton.addEventListener('click', (event) => {
            event.preventDefault();

            if (!adVisited) {
             
              window.open('https://observeshaken.com/g6sf3vq1k?key=a8f76c07fbb276883fa456e8ad5ccc1f', '_blank');
              adVisited = true;
              downloadButton.textContent = 'Start Download';
            } else {
             
              downloadButton.setAttribute('href', downloadLink);
              downloadButton.textContent = 'Start Download';
              window.location.href = downloadLink; 
            }
          });

          downloadButton.textContent = 'Download Script';
        } else {
          downloadButton.textContent = '';
          downloadButton.disabled = true;
        }
      })
      .catch(() => {
        downloadButton.textContent = 'Error.';
        fileSizeDisplay.textContent = 'Error';
        downloadButton.disabled = true;
      });
  }

  downloadButton.addEventListener('click', (event) => {
    if (timer > 0) {
     
      event.preventDefault();
    }
  });

  window.onload = updateCountdown;
</script>

