rror = () => {
          events.close();
          setTimeout(connectSSE, 1000);
        };

        window.addEventListener('beforeunload', () => {
          events.close();
        });
      }

      connectSSE();
    </script>
  </head>

  <body class="overflow-hidden">
    <script>
      window.MASTRA_TELEMETRY_DISABLED = '%%MASTRA_TELEMETRY_DISABLED%%';
      window.MASTRA_SERVER_HOST = '%%MASTRA_SERVER_HOST%%';
      window.MASTRA_SERVER_PORT = '%%MASTRA_SERVER_PORT%%';
    </script>
    <div id="root