const { Button, Select, Input, Icon } = window.FriendsCarsDesignSystem_f69f0e; const HERO_SLIDES = ["gle", "thar", "e250", "520d", "crysta", "creta-new", "sonet", "fronx"].map((id) => window.FLEET.find((c) => c.id === id)).filter(Boolean); const SLIDE_MS = 6400; const splitName = (c) => { const model = c.name.replace(c.marque, "").replace(/[()]/g, "").trim(); return [c.marque, model || c.name]; }; function HeroStage({ onNavigate, onBook }) { const [i, setI] = React.useState(0); const [hold, setHold] = React.useState(false); const [stageRef, o] = window.usePointerParallax(1); React.useEffect(() => { if (hold) return; const t = setTimeout(() => setI((n) => (n + 1) % HERO_SLIDES.length), SLIDE_MS); return () => clearTimeout(t); }, [i, hold]); /* Scroll parallax + cinematic fade-off. rAF-throttled, skipped for reduced motion. */ React.useEffect(() => { const el = stageRef.current; if (!el || window.matchMedia("(prefers-reduced-motion:reduce)").matches) return; let raf = 0, last = -1; const paint = () => { raf = 0; const y = Math.min(window.scrollY, 900); if (y === last) return; last = y; el.style.setProperty("--sy", (y * 0.16).toFixed(1) + "px"); el.style.setProperty("--fade", Math.max(0, 1 - y / 720).toFixed(3)); }; const on = () => { if (!raf) raf = requestAnimationFrame(paint); }; window.addEventListener("scroll", on, { passive: true }); paint(); return () => { window.removeEventListener("scroll", on); if (raf) cancelAnimationFrame(raf); }; }, [stageRef]); const car = HERO_SLIDES[i]; const [marque, model] = splitName(car); const go = (n) => setI((n + HERO_SLIDES.length) % HERO_SLIDES.length); const queue = HERO_SLIDES.slice(i + 1).concat(HERO_SLIDES.slice(0, i)); return (
setHold(true)} onMouseLeave={() => setHold(false)}>
{HERO_SLIDES.map((c, n) => (
{c.name
))}

{"Self-drive car rental in " + window.BIZ.city + " · Since " + window.BIZ.since}

{car.fuel}{car.gearbox}{car.seats} seats{window.BIZ.kmPerDay} km / day

Seventy cars, delivered to your door in {window.BIZ.city} and taken back from it.

{window.rupees(car.price)} / day
{queue.map((c) => ( ))}
{("0" + (i + 1)).slice(-2)} / {("0" + HERO_SLIDES.length).slice(-2)}
); } function BookingPanel({ onSubmit }) { const today = new Date().toISOString().slice(0, 10); const [cat, setCat] = React.useState(""); const [car, setCar] = React.useState(""); const cars = window.FLEET.filter((c) => !cat || c.cat === cat); return (
Check availability or call {window.BIZ.phone1}
setCar(e.target.value)} options={cars.map((c) => ({ value: c.id, label: c.name }))} />
); } Object.assign(window, { HeroStage, BookingPanel });