<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <!-- App Icons -->
    <link rel="icon" type="image/x-icon" href="/favicon.ico" />
    <link rel="icon" type="image/png" sizes="192x192" href="/icon-192x192.png" />
    <link rel="icon" type="image/png" sizes="512x512" href="/icon-512x512.png" />
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png" />
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png" />
    <link rel="apple-touch-icon" sizes="167x167" href="/apple-touch-icon-167x167.png" />
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png" />
    <link rel="shortcut icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes, viewport-fit=cover" />
    
    <!-- Cache Control - allow Cloudflare edge caching -->
    <meta http-equiv="Cache-Control" content="public, max-age=0, must-revalidate" />

    <!-- Primary Meta Tags -->
    <title>BankX Dashboard | Real-time Crypto Price Tracker & DeFi Portfolio Analytics</title>
    <meta name="title" content="BankX Dashboard | Real-time Crypto Price Tracker & DeFi Portfolio Analytics">
    <meta name="description" content="Professional crypto dashboard for BankX and XSD stablecoin. Track real-time prices across Ethereum, BSC, Arbitrum, Polygon, Optimism, Base & Avalanche. Monitor wallet balances, arbitrage opportunities, and set price alerts. Free DeFi portfolio tracker with multi-chain support.">
    <meta name="keywords" content="BankX, XSD stablecoin, silver-pegged cryptocurrency, crypto price tracker, DeFi dashboard, multi-chain wallet, blockchain portfolio, Ethereum price, BSC tracker, Arbitrum analytics, crypto arbitrage, real-time crypto prices, DeFi portfolio tracker, cryptocurrency dashboard, Web3 wallet tracker, BankX token price, XSD price chart, crypto alerts, stablecoin tracker, decentralized finance, blockchain explorer, silver-pegged token">
    <meta name="author" content="BankX">
    <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
    <meta name="googlebot" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
    <meta name="bingbot" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
    <meta name="google" content="notranslate">
    <meta name="language" content="English">
    <meta name="revisit-after" content="1 day">
    <meta name="rating" content="general">
    <meta name="distribution" content="global">
    <meta name="classification" content="Cryptocurrency, Finance, Technology">

    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://bankxdashboard.com/">
    <meta property="og:title" content="BankX Dashboard | Real-time Crypto Price Tracker & DeFi Portfolio Analytics">
    <meta property="og:description" content="Professional crypto dashboard for BankX and XSD stablecoin. Track real-time prices across 8+ blockchains, monitor wallet balances, and discover arbitrage opportunities. Free multi-chain DeFi portfolio tracker.">
    <meta property="og:image" content="https://bankxdashboard.com/BankX X 400 x 400 Socials.jpg">
    <meta property="og:image:alt" content="BankX Dashboard - Real-time Cryptocurrency Price Tracker">
    <meta property="og:image:width" content="400">
    <meta property="og:image:height" content="400">
    <meta property="og:site_name" content="BankX Dashboard">
    <meta property="og:locale" content="en_US">

    <!-- Twitter -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@bankxio">
    <meta name="twitter:creator" content="@bankxio">
    <meta name="twitter:url" content="https://bankxdashboard.com/">
    <meta name="twitter:title" content="BankX Dashboard | Real-time Crypto Price Tracker & DeFi Portfolio Analytics">
    <meta name="twitter:description" content="Professional crypto dashboard for BankX and XSD stablecoin. Track real-time prices across 8+ blockchains, monitor wallet balances, and discover arbitrage opportunities.">
    <meta name="twitter:image" content="https://bankxdashboard.com/BankX X 400 x 400 Socials.jpg">
    <meta name="twitter:image:alt" content="BankX Dashboard - Real-time Cryptocurrency Price Tracker">

    <!-- Theme Color and PWA Settings -->
    <meta name="theme-color" content="#0ea5e9" media="(prefers-color-scheme: dark)">
    <meta name="theme-color" content="#0ea5e9" media="(prefers-color-scheme: light)">
    <meta name="msapplication-TileColor" content="#0ea5e9">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    
    <!-- Canonical URL -->
    <link rel="canonical" href="https://bankxdashboard.com/">

    <!-- Additional SEO Meta Tags -->
    <meta name="geo.region" content="US">
    <meta name="geo.placename" content="United States">
    <meta name="application-name" content="BankX Dashboard">
    <meta name="subject" content="Cryptocurrency Price Tracking and DeFi Portfolio Management">
    <meta name="coverage" content="Worldwide">

    <!-- Structured Data for Rich Search Results -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebApplication",
      "name": "BankX Dashboard",
      "description": "Professional cryptocurrency price tracker and DeFi portfolio analytics for BankX and XSD stablecoin across multiple blockchains",
      "url": "https://bankxdashboard.com",
      "applicationCategory": "FinanceApplication",
      "operatingSystem": "Any",
      "browserRequirements": "Requires JavaScript. Requires HTML5.",
      "offers": {
        "@type": "Offer",
        "price": "0",
        "priceCurrency": "USD"
      },
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "4.8",
        "ratingCount": "150"
      },
      "author": {
        "@type": "Organization",
        "name": "BankX",
        "url": "https://bankxdashboard.com",
        "sameAs": [
          "https://x.com/bankxio",
          "https://t.me/BankXio",
          "https://www.youtube.com/@BankXio"
        ]
      }
    }
    </script>

    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Organization",
      "name": "BankX",
      "url": "https://bankxdashboard.com",
      "logo": "https://bankxdashboard.com/BankX X 400 x 400 Socials.jpg",
      "sameAs": [
        "https://x.com/bankxio",
        "https://t.me/BankXio",
        "https://www.youtube.com/@BankXio",
        "https://rumble.com/c/BankXio"
      ],
      "contactPoint": {
        "@type": "ContactPoint",
        "contactType": "customer support",
        "url": "https://bankxdashboard.com/contact"
      }
    }
    </script>
    
    <!-- CLOUDFLARE OPTIMIZATION: DNS Prefetch and Preconnect -->
    <link rel="preconnect" href="https://fonts.googleapis.com" crossorigin>
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link rel="dns-prefetch" href="https://fonts.googleapis.com">
    <link rel="dns-prefetch" href="https://fonts.gstatic.com">

    <!-- CLOUDFLARE OPTIMIZATION: Supabase connection optimized dynamically via environment variables -->

    <!-- CLOUDFLARE OPTIMIZATION: RPC endpoints for blockchain data -->
    <link rel="dns-prefetch" href="https://eth.llamarpc.com" />
    <link rel="dns-prefetch" href="https://bsc-dataseed1.defibit.io" />
    <link rel="dns-prefetch" href="https://arb1.arbitrum.io" />
    <link rel="dns-prefetch" href="https://polygon-rpc.com" />
    <link rel="dns-prefetch" href="https://mainnet.optimism.io" />
    <link rel="dns-prefetch" href="https://mainnet.base.org" />
    <link rel="dns-prefetch" href="https://api.avax.network" />
    
    <!-- Load Google Fonts directly - more reliable than Inter CDN -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">

    <!-- PWA manifest -->
    <link rel="manifest" href="/manifest.json">

    <!-- Humans and Security -->
    <link rel="author" href="/humans.txt">
    
    <!-- PWA meta tags for better installation -->
    <meta name="apple-mobile-web-app-title" content="BankX">
    <meta name="application-name" content="BankX Dashboard">
    <meta name="msapplication-TileImage" content="/icon-144x144.png">
    <meta name="msapplication-TileColor" content="#0ea5e9">
    <meta name="msapplication-config" content="none">
    <meta name="format-detection" content="telephone=no">

    <!-- iOS Splash Screens -->
    <link rel="apple-touch-startup-image" href="/icon-512x512.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)">
    <link rel="apple-touch-startup-image" href="/icon-512x512.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)">
    <link rel="apple-touch-startup-image" href="/icon-512x512.png" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)">
    <link rel="apple-touch-startup-image" href="/icon-512x512.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)">
    
    <!-- System font fallback -->
    <style>body,html{font-display:swap;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.font-loading{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.font-inter{font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}*{font-feature-settings:"cv11","ss01";font-variant-numeric:tabular-nums}</style>

    <!-- React Scheduler Polyfill - Must run before React loads -->
    <script>
      // Ensure performance.now is available for React scheduler
      if (typeof performance === 'undefined') {
        window.performance = {};
      }
      if (typeof performance.now === 'undefined') {
        performance.now = function() {
          return Date.now();
        };
      }

      // Ensure globalThis is available
      if (typeof globalThis === 'undefined') {
        window.globalThis = window;
      }

      // CRITICAL: Chunk loading error handling with automatic cache clearing + forced reload
      var _chunkErrorHandled = false;
      window.addEventListener('error', function(e) {
        // Only handle JS asset errors — do NOT match generic ReferenceErrors
        // from running code (those are application bugs, not stale-chunk issues)
        var isStaleChunkError =
          (e.filename && e.filename.includes('/assets/') && e.filename.includes('.js')) &&
          e.message && (
            e.message.includes('Failed to fetch') ||
            e.message.includes('Unexpected token') ||
            e.message.includes('Loading chunk') ||
            e.message.includes('SyntaxError') ||
            e.message.includes('Cannot access') ||
            e.message.includes('before initialization')
          );

        if (isStaleChunkError && !_chunkErrorHandled) {
          _chunkErrorHandled = true;
          console.error('Stale chunk detected, clearing caches and reloading:', e.message);

          var doReload = function() {
            // Force hard reload bypassing all caches
            window.location.reload();
          };

          if ('caches' in window) {
            caches.keys().then(function(cacheNames) {
              return Promise.all(cacheNames.map(function(n) { return caches.delete(n); }));
            }).then(doReload).catch(doReload);
          } else {
            doReload();
          }
        }
      }, true);
    </script>
    <script type="module" crossorigin src="/assets/main-BwkabGO5.js"></script>
    <link rel="modulepreload" crossorigin href="/assets/vendor-react-BPur_XLK.js">
    <link rel="modulepreload" crossorigin href="/assets/vendor-HLbXPq-k.js">
    <link rel="modulepreload" crossorigin href="/assets/vendor-web3-DrZtKKeG.js">
    <link rel="modulepreload" crossorigin href="/assets/vendor-query-BvDTgjfX.js">
    <link rel="modulepreload" crossorigin href="/assets/vendor-supabase-CAhXXhSP.js">
    <link rel="modulepreload" crossorigin href="/assets/vendor-dompurify-QVBlkSfT.js">
    <link rel="modulepreload" crossorigin href="/assets/vendor-framer-CkFbLMfL.js">
    <link rel="stylesheet" crossorigin href="/assets/main-9otvT8be.css">
  </head>
  <body>
    <div id="root"></div>
    
    <!-- Service Worker Registration & PWA Detection -->
    <script>
      // CRITICAL: Clear YouTube thumbnail cache on every load
      if ('caches' in window) {
        caches.keys().then(function(cacheNames) {
          cacheNames.forEach(function(cacheName) {
            if (cacheName.includes('image') || cacheName.includes('bankx')) {
              caches.open(cacheName).then(function(cache) {
                cache.keys().then(function(requests) {
                  requests.forEach(function(request) {
                    if (request.url.includes('ytimg.com') ||
                        request.url.includes('youtube.com') ||
                        request.url.includes('img.youtube.com') ||
                        request.url.includes('i.ytimg.com') ||
                        request.url.includes('yt3.')) {
                      cache.delete(request);
                      console.log('[Cache] Cleared YouTube thumbnail:', request.url);
                    }
                  });
                });
              });
            }
          });
        });
      }

      // Service Worker Registration with aggressive updates
      if ('serviceWorker' in navigator) {
        window.addEventListener('load', function() {
          // EMERGENCY FIX: Version check auto-reload DISABLED to prevent loops
          // Service worker will update naturally without forcing reloads

          // Register new service worker
          navigator.serviceWorker
            .register('/sw.js', {
              scope: '/',
              updateViaCache: 'none'
            })
            .then(function(registration) {
              console.log('[PWA] Service Worker registered successfully:', registration.scope);

              // EMERGENCY FIX: Auto-update checks and reloads DISABLED
              // These were causing infinite reload loops
              // Service worker will update naturally on next manual page load
              console.log('[PWA] Service Worker registered (auto-updates disabled)');
            })
            .catch(function(error) {
              console.warn('[PWA] Service Worker registration failed:', error);
            });
        });

        // Handle controller change
        navigator.serviceWorker.addEventListener('controllerchange', function() {
          console.log('[PWA] New service worker activated, clearing YouTube cache...');

          // Clear YouTube cache when new service worker activates
          if ('caches' in window) {
            caches.keys().then(function(cacheNames) {
              cacheNames.forEach(function(cacheName) {
                if (cacheName.includes('image') || cacheName.includes('bankx')) {
                  caches.open(cacheName).then(function(cache) {
                    cache.keys().then(function(requests) {
                      requests.forEach(function(request) {
                        if (request.url.includes('ytimg.com') ||
                            request.url.includes('youtube.com') ||
                            request.url.includes('yt3.')) {
                          cache.delete(request);
                        }
                      });
                    });
                  });
                }
              });
            });
          }
        });
      }

      // PWA Installation Detection
      try {
        // Check if running as standalone PWA
        const isStandalone = window.matchMedia('(display-mode: standalone)').matches ||
                            window.navigator.standalone === true;

        if (isStandalone) {
          document.documentElement.classList.add('pwa-installed');
          document.body.classList.add('pwa-standalone');
        }

        // Listen for display mode changes
        window.matchMedia('(display-mode: standalone)').addEventListener('change', function(e) {
          if (e.matches) {
            document.documentElement.classList.add('pwa-installed');
            document.body.classList.add('pwa-standalone');
          } else {
            document.documentElement.classList.remove('pwa-installed');
            document.body.classList.remove('pwa-standalone');
          }
        });

        // Listen for app installed event
        window.addEventListener('appinstalled', function() {
          console.log('[PWA] App successfully installed');
          document.documentElement.classList.add('pwa-installed');
          window.dispatchEvent(new CustomEvent('pwa-installed'));
        });
      } catch (error) {
        console.log('[PWA] Detection error:', error);
      }
    </script>
  </body>
</html>