// Object 1 — Lead section + register-interest form + brochure modal. function Lead({ t, onSubmit, onBrochure, onViewing }) { const [form, setForm] = React.useState({ first: '', last: '', email: '', phone: '', interest: '', market: '', consent: false, }); const [errors, setErrors] = React.useState({}); const [submitted, setSubmitted] = React.useState(false); function update(k, v) { setForm(f => ({ ...f, [k]: v })); setErrors(e => ({ ...e, [k]: null })); } function validate() { const e = {}; if (!form.first.trim()) e.first = '✕'; if (!form.last.trim()) e.last = '✕'; if (!/^\S+@\S+\.\S+$/.test(form.email)) e.email = '✕'; if (!/^[\+0-9\s\-()]{7,}$/.test(form.phone)) e.phone = '✕'; if (!form.interest) e.interest = '✕'; if (!form.market) e.market = '✕'; if (!form.consent) e.consent = '✕'; return e; } function handleSubmit(ev) { ev.preventDefault(); const e = validate(); setErrors(e); if (Object.keys(e).length === 0) { setSubmitted(true); onSubmit && onSubmit(form); } } const ctaActions = [ () => document.getElementById('register-form')?.scrollIntoView({ behavior: 'smooth', block: 'center' }), () => onBrochure(), () => onViewing(), () => window.open('https://wa.me/971523810148', '_blank'), ]; return (
{t.lead.ctas.map((c, i) => ( ))}
{!submitted ? (

{t.lead.formTitle}

{t.lead.formSub}

update('first', e.target.value)} />
update('last', e.target.value)} />
update('email', e.target.value)} />
update('phone', e.target.value)} placeholder="+971 …" />
) : (

{t.lead.successTitle}

{t.lead.successBody}

project=w1nner · locale={t.dir === 'rtl' ? 'ar' : 'en'} · src=microsite

)}
); } function BrochureModal({ t, open, onClose }) { const [email, setEmail] = React.useState(''); const [done, setDone] = React.useState(false); const [err, setErr] = React.useState(''); React.useEffect(() => { if (!open) { setEmail(''); setDone(false); setErr(''); } }, [open]); if (!open) return null; function submit(e) { e.preventDefault(); if (!/^\S+@\S+\.\S+$/.test(email)) { setErr(t.dir === 'rtl' ? 'يرجى إدخال بريد صحيح' : 'Please enter a valid email'); return; } setDone(true); } return (
e.stopPropagation()}> {!done ? ( <>

{t.brochure.title}

{t.brochure.sub}

{ setEmail(e.target.value); setErr(''); }} autoFocus /> {err &&
{err}
}
) : (

{t.lead.successTitle}

{t.dir === 'rtl' ? 'يتم إرسال الكتيب إلى بريدك خلال دقائق.' : 'The brochure will arrive in your inbox within a few minutes.'}

)}
); } function ViewingModal({ t, open, onClose }) { const [form, setForm] = React.useState({ name: '', email: '', when: '' }); const [done, setDone] = React.useState(false); React.useEffect(() => { if (!open) { setForm({ name: '', email: '', when: '' }); setDone(false); } }, [open]); if (!open) return null; function submit(e) { e.preventDefault(); setDone(true); } return (
e.stopPropagation()}> {!done ? ( <>

{t.dir === 'rtl' ? 'احجز معاينةً خاصة' : 'Book a private viewing'}

{t.dir === 'rtl' ? 'صالة العرض في وسط مدينة دبي. عند الطلب.' : 'Sales gallery, Downtown Dubai. By appointment.'}

setForm(f => ({...f, name: e.target.value}))} required />
setForm(f => ({...f, email: e.target.value}))} required />
setForm(f => ({...f, when: e.target.value}))} required />
) : (

{t.lead.successTitle}

{t.dir === 'rtl' ? 'سنؤكد الموعد خلال يوم عمل.' : 'We will confirm the appointment within one business day.'}

)}
); } function WhatsAppFab() { return ( ); } Object.assign(window, { Lead, BrochureModal, ViewingModal, WhatsAppFab });