\n\n","src/main.tsx":"import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router, Route, Routes } from 'react-router-dom';\nimport './index.css';\nimport Home from './components/Home';\n\nconst App = () => (\n \n \n } />\n \n \n);\n\nconst rootElement = document.getElementById('root');\nif (rootElement) {\n const root = ReactDOM.createRoot(rootElement);\n root.render();\n}\n","src/App.tsx":"import React from 'react';\nimport { BrowserRouter as Router, Route, Routes } from 'react-router-dom';\nimport Home from './components/Home';\nimport { LucideHome } from 'lucide-react';\n\nconst App: React.FC = () => {\n return (\n \n
\n \n \n } />\n \n
\n
\n );\n};\n\nexport default App;\n","src/pages/Home.tsx":"// This file is redundant and can be removed as Home component is defined in src/components/Home.tsx","src/components/Home.tsx":"import React from 'react';\n\nconst Home: React.FC = () => {\n return (\n
\n Hello World\n
\n );\n};\n\nexport default Home;\n","src/styles.css":"/* Tailwind CSS base styles */\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n/* Custom global styles */\nbody {\n @apply bg-red-500 text-white;\n}\n\nh1, h2, h3, h4, h5, h6 {\n @apply font-bold;\n}\n\np {\n @apply mb-4;\n}\n\n/* Specific styles for the Home page text section */\n.home-text-section {\n @apply bg-red-500 text-white text-center p-5;\n font-size: 24px;\n}"}; function resolvePath(base, relative) { if (!relative.startsWith('.')) return relative; const stack = base.split('/'); stack.pop(); const parts = relative.split('/'); for (let i = 0; i < parts.length; i++) { if (parts[i] === '.') continue; if (parts[i] === '..') stack.pop(); else stack.push(parts[i]); } return stack.join('/'); } function getFileContent(path) { if (window.__SOURCES__[path]) return { content: window.__SOURCES__[path], finalPath: path }; const extensions = ['.tsx', '.ts', '.jsx', '.js', '.css', '.json']; for (let ext of extensions) { if (window.__SOURCES__[path + ext]) return { content: window.__SOURCES__[path + ext], finalPath: path + ext }; } for (let ext of extensions) { if (window.__SOURCES__[path + '/index' + ext]) return { content: window.__SOURCES__[path + '/index' + ext], finalPath: path + '/index' + ext }; } return null; } window.require = function(path, base = '') { if (path === 'react') return window.React; if (path === 'react-dom') return window.ReactDOM; if (path === 'react-dom/client') return window.ReactDOM; if (path === '@supabase/supabase-js') return window.supabase; if (path === 'lucide-react') return window.lucide; if (path === 'react-router-dom') { return { ...window.ReactRouterDOM, BrowserRouter: window.ReactRouterDOM.HashRouter }; } const resolvedPath = resolvePath(base, path); const fileInfo = getFileContent(resolvedPath); if (!fileInfo) { console.warn('Module not found:', path, 'Resolved:', resolvedPath); return {}; } const { content, finalPath } = fileInfo; if (window.__MODULES__[finalPath]) return window.__MODULES__[finalPath].exports; if (finalPath.endsWith('.css')) { const style = document.createElement('style'); style.textContent = content; document.head.appendChild(style); window.__MODULES__[finalPath] = { exports: {} }; return {}; } if (finalPath.endsWith('.json')) { try { const json = JSON.parse(content); window.__MODULES__[finalPath] = { exports: json }; return json; } catch(e) {} } if (finalPath.endsWith('.html')) { window.__MODULES__[finalPath] = { exports: content }; return content; } const trimmed = content.trim(); if (trimmed.startsWith(' window.require(p, finalPath)); window.__MODULES__[finalPath] = module; return module.exports; } catch (e) { console.error('Compilation Error in ' + finalPath, e); throw e; } }; // --- BOOTSTRAP (FIXED) --- window.onload = function() { try { const rootEl = document.getElementById('root'); if (!rootEl) throw new Error("Missing #root element"); // 1. AUTO-DETECT APP COMPONENT // We prioritize mounting App.tsx directly because main.tsx often fails (empty/commented out) const appFile = ['src/App.tsx', 'src/App.jsx', 'src/App.js', 'App.tsx', 'App.jsx', 'App.js'].find(p => window.__SOURCES__[p]); let mounted = false; if (appFile) { console.log('Attempting to auto-mount App from:', appFile); try { const mod = window.require(appFile); const App = mod.default || mod.App; if (App && (typeof App === 'function' || typeof App === 'object')) { const React = window.React; const ReactDOM = window.ReactDOM; const { HashRouter } = window.ReactRouterDOM; // FORCE MOUNT const root = ReactDOM.createRoot(rootEl); root.render(React.createElement(HashRouter, {}, React.createElement(App))); mounted = true; console.log('Successfully mounted App.'); } else { console.warn('App module found but default export is not a valid React component:', App); } } catch(e) { console.warn('Failed to auto-mount App:', e); } } // 2. FALLBACK: EXECUTE ENTRY FILE (main.tsx) // Only do this if auto-mount failed or wasn't attempted if (!mounted) { const entry = "src/main.tsx"; if (entry && window.__SOURCES__[entry]) { console.log('Executing entry file:', entry); window.require(entry); } else { // 3. FINAL FALLBACK: VISIBLE ERROR // Prevent white screen at all costs document.body.innerHTML = `

Preview Failed to Mount

No valid App.tsx or executing main.tsx found.

`; } } } catch (e) { console.error('Bootstrap Error:', e); window.onerror(e.message, '', 0, 0, e); } };