// Ensure window.fetch has both getter and setter in iframe sandboxes
if (typeof window !== 'undefined') {
  try {
    let activeFetch = window.fetch;
    const desc = {
      get: () => activeFetch,
      set: (fn: typeof fetch) => {
        activeFetch = fn;
      },
      configurable: true,
      enumerable: true,
    };
    try {
      Object.defineProperty(window, 'fetch', desc);
    } catch {}
    try {
      if (typeof Window !== 'undefined' && Window.prototype) {
        Object.defineProperty(Window.prototype, 'fetch', desc);
      }
    } catch {}
  } catch {}
}

import {StrictMode} from 'react';
import {createRoot} from 'react-dom/client';
import App from './App.tsx';
import './index.css';

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <App />
  </StrictMode>,
);
