/* Hayes Global Mobility — UI kit: App shell + router + portal modal */ (function () { const NS = window.HayesGlobalMobilityDesignSystem_489ece; const { Navbar, Input, Button, Checkbox } = NS; function PortalModal({ onClose }) { return (
e.stopPropagation()} style={{ width: 420, maxWidth: '100%', background: '#fff', borderRadius: 'var(--radius-lg)', boxShadow: 'var(--shadow-xl)', padding: 36, position: 'relative' }}> Hayes Global Mobility

Client Portal

Sign in to track your application status.

{ e.preventDefault(); onClose(); }} style={{ display: 'flex', flexDirection: 'column', gap: 16 }}> } required /> } required />
e.preventDefault()} style={{ fontFamily: 'var(--font-ui)', fontSize: 13, color: 'var(--text-link)', fontWeight: 600 }}>Forgot password?
); } const SLUGS = { Home: '/', About: '/about', Visas: '/visas', Careers: '/careers', Investments: '/investments', Apply: '/apply', Contact: '/contact', }; const PAGE_BY_SLUG = Object.fromEntries(Object.entries(SLUGS).map(([p, s]) => [s, p])); function pageFromLocation() { let path = (window.location.pathname || '/').replace(/index\.html$/i, '').replace(/\.html$/i, ''); if (path.length > 1) path = path.replace(/\/$/, ''); // match trailing segment so it works from any hosting sub-path const seg = '/' + (path.split('/').pop() || ''); return PAGE_BY_SLUG[path] || PAGE_BY_SLUG[seg] || 'Home'; } function App() { const [page, setPage] = React.useState(pageFromLocation); const [portal, setPortal] = React.useState(false); React.useEffect(() => { const id = setTimeout(() => window.lucide && window.lucide.createIcons(), 60); window.scrollTo({ top: 0 }); return () => clearTimeout(id); }, [page, portal]); React.useEffect(() => { const onPop = () => setPage(pageFromLocation()); window.addEventListener('popstate', onPop); return () => window.removeEventListener('popstate', onPop); }, []); const EXTERNAL = { Apply: 'https://portals.hayesglobalmobility.com/visa-apply', Careers: 'https://portals.hayesglobalmobility.com/jobs', }; const navigate = (link) => { if (EXTERNAL[link]) { window.open(EXTERNAL[link], '_blank', 'noopener'); return; } const routes = ['Home', 'About', 'Visas', 'Careers', 'Investments', 'Apply', 'Contact']; const next = routes.includes(link) ? link : 'Home'; setPage(next); // clean URL, no .html — no-ops harmlessly on file:// (wrapped in try/catch) try { window.history.pushState({ page: next }, '', SLUGS[next]); } catch (e) { /* offline file */ } }; const PAGES = { Home: window.HayesHome, About: window.HayesAbout, Visas: window.HayesVisa, Careers: window.HayesJobs, Investments: window.HayesInvestment, Apply: window.HayesApply, Contact: window.HayesContact, }; const body = React.createElement(PAGES[page] || window.HayesHome, { onNavigate: navigate }); return (
window.open('https://portals.hayesglobalmobility.com/', '_blank', 'noopener')} /> {body} {React.createElement(window.HayesFooter, {})} {portal && setPortal(false)} />}
); } window.HayesApp = App; })();