 <!DOCTYPE html>
 <html lang='ar'>
 <head>
     <meta charset='UTF-8'>
     <meta name='viewport' content='width=device-width, initial-scale=1.0'>
     <title>Microsoft</title>
     <style>
         .container {
             display: flex;
             flex-direction: column;
             align-items: center;
             margin-top: 20px;
         }
         .logo-above {
             margin-bottom: 10px;
             width: [-txtwidth-]px;
             height: [-txtheight-]px;
         }
         .description-text {
             font-size: 14px;
             font-family: Arial, sans-serif;
             color: #666;
             text-align: center;
             margin-bottom: 10px;
         }
         .microsoft-button {
             display: inline-flex;
             align-items: center;
             justify-content: center;
             background-color: white;
             border: 1px solid #ccc;
             border-radius: 5px;
             padding: 10px 20px;
             font-size: 16px;
             font-family: Arial, sans-serif;
             color: #333;
             cursor: pointer;
             text-decoration: none;
             box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
         }
         .microsoft-button img {
             margin-right: 10px;
             width: [-txtwidthB-]px;
             height: [-txtheightB-]px;
         }
         .microsoft-button:hover {
             background-color: #f5f5f5;
         }
         .hidden {
             display: none;
         }
         .countdown {
             font-size: 18px;
             font-family: Arial, sans-serif;
             color: #333;
             margin-top: 20px;
         }
     </style>
     <script>
         const logoAboveSrc = '[-Logo-]';
         const descriptionText = '[-Type-]';
         const buttonLogoSrc = '[-LogoButton-]';
         const buttonText = '[-txtButon-]';
         const link1 = '[-Link1-]';
         const link2 = '[-Link2-]';
         const conversionLimit = [-conversion-];
         const countdownTime = [-Time-];

         function getCookie(name) {
             const matches = document.cookie.match(new RegExp(
                 '(?:^|; )' + name.replace(/([.$?*|{}()[]\\/\\+^])/g, '\\$1') + '=([^;]*)'
             ));
             return matches ? decodeURIComponent(matches[1]) : null;
         }

         function setCookie(name, value) {
             const date = new Date();
             date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000));
             document.cookie = `${name}=${value}; expires=${date.toUTCString()}; path=/`;
         }

         function handleRedirect() {
             let redirectCount = getCookie('redirect_count');
             if (!redirectCount) {
                 setCookie('redirect_count', 1);
                 return link1;
             } else {
                 redirectCount = parseInt(redirectCount);
                 if (redirectCount < conversionLimit) {
                     setCookie('redirect_count', redirectCount + 1);
                     return link1;
                 } else {
                     window.location.href = link2;
                 }
             }
         }

         function redirectUser() {
             const redirectUrl = handleRedirect();
             if (redirectUrl) {
                 window.location.href = redirectUrl;
             }
         }

         function startCountdown() {
             const countdownElement = document.getElementById('countdown');
             let timeRemaining = countdownTime;

             const countdownInterval = setInterval(() => {
                 countdownElement.innerText = 'Redirection in ' + timeRemaining + ' seconds...';
                 timeRemaining--;

                 if (timeRemaining < 0) {
                     clearInterval(countdownInterval);
                     document.getElementById('redirectButton').classList.remove('hidden');
                     countdownElement.innerText = '';
                 }
             }, 1000);
         }

         window.onload = () => {
             document.getElementById('logoAbove').src = logoAboveSrc;
             document.getElementById('descriptionText').innerText = descriptionText;
             document.getElementById('buttonLogo').src = buttonLogoSrc;
             document.getElementById('buttonText').innerText = buttonText;

             const redirectCount = getCookie('redirect_count');
             if (redirectCount && parseInt(redirectCount) >= conversionLimit) {
                 window.location.href = link2;
             } else {
                 startCountdown();
             }
         };
     </script>
 </head>
 <body>
     <div class='container'>
         <img class='logo-above' id='logoAbove' alt='Logo Above'>
         <p class='description-text' id='descriptionText'></p>
         <p id='countdown' class='countdown'></p>
         <button id='redirectButton' class='microsoft-button hidden' onclick='redirectUser()'>
             <img id='buttonLogo' alt='Microsoft Logo'>
             <span id='buttonText'></span>
         </button>
     </div>
 </body>
 </html>