leftControls.appendChild(trackDetailedModelStatsEl);
  }

  let loadEventFired = false;
  let htmlImportsLoaded = false;
  const maybeOnLoad = () => {
    if (loadEventFired && htmlImportsLoaded) onLoad();
  };

  window.addEventListener('load', () => {
    loadEventFired = true;
    maybeOnLoad();
  });

  window.addEventListener('HTMLImportsLoaded', () => {
    htmlImportsLoaded = true;
    maybeOnLoad();
  });

  </script>
</body>
</html>
