/**
 * Fires the client-side Meta Pixel Lead event with the same eventID as server CAPI
 * so Meta can deduplicate browser + server events.
 */
export function trackMetaLead(eventId: string | undefined): void {
  if (typeof window === 'undefined' || !eventId) return;
  const fbq = (window as Window & { fbq?: (method: string, eventName: string, params?: object, options?: { eventID?: string }) => void }).fbq;
  if (fbq) fbq('track', 'Lead', {}, { eventID: eventId });
}
