/* global React */ const { useState, useMemo, useCallback } = React; /* ============================== TopBar ============================== */ function TopBar({ cartCount, onOpenCart, niche }) { return (
Heliance
{niche}
Aide
); } /* ============================== Hero ============================== */ function Hero({ data }) { return (
); } /* ============================== HowToOrder (3 étapes) ============================== */ function HowToOrder() { return (
1 Ajoutez vos references
2 Choisissez la livraison
3 Envoyez par WhatsApp
); } /* ============================== SectionHeader ============================== */ function SectionHeader({ title, count, index }) { const idx = String(index).padStart(2, "0"); return (

{title}

{count} ref. § {idx}
); } /* ============================== ColorSwatches ============================== */ function ColorSwatches({ colors, selectedIdx, onSelect }) { if (!colors || colors.length === 0) return null; if (colors.length === 1 && colors[0].label === "Unique") { return 1 coloris; } return (
{colors.map((c, i) => (
); } /* ============================== ProductCard ============================== */ function ProductCard({ item, cart, onAdd, onRemove }) { const [selectedIdx, setSelectedIdx] = useState(0); const color = item.colors[selectedIdx] || item.colors[0]; const key = item.ref + "::" + (color ? color.label : "Unique"); const qty = cart[key] || 0; const priceFr = item.price.toFixed(2).replace(".", ","); const themeChip = item.theme && item.theme !== "Marin" ? item.theme : null; const displayImg = (color && color.img) || item.img; return (
0 ? " is-added" : "")}>
{displayImg ? {item.name} :
} {qty > 0 && {qty}}
{item.ref} {themeChip && <> · {themeChip}}
{item.name}
{priceFr} € HT
{qty === 0 ? ( ) : (
{qty}
)}
); } /* ============================== OrderBar ============================== */ function OrderBar({ count, total, onOpenCart, onOrder }) { const totalFr = total.toFixed(2).replace(".", ","); return (
Panier · {count} {count === 1 ? "référence" : "références"}
{totalFr} € HT
Sans minimum d'achat · livraison offerte partout, même à l'étranger
); } /* ============================== CartDrawer ============================== */ function CartDrawer({ open, lines, total, delivery, deliveryIdx, onSelectDelivery, onClose, onAdd, onRemove, onOrder }) { const fmt = (n) => n.toFixed(2).replace(".", ","); const opts = (delivery && delivery.options) || []; const deliv = opts[deliveryIdx] || opts[0] || { price: 0 }; const grand = total + (deliv.price || 0); return ( <>
); } /* ============================== ValidityFooter ============================== */ function ValidityFooter({ data, deliveryIdx, onSelectDelivery }) { const fmt = (n) => n.toFixed(2).replace(".", ","); const opts = (data.delivery && data.delivery.options) || []; return ( ); } /* ============================== Icons ============================== */ function WaIcon() { return ( ); } function CloseIcon() { return ( ); } /* ============================== WhatsAppFloating ============================== */ function WhatsAppFloating({ number, niche }) { const greeting = `Bonjour, je consulte votre selection ${niche || "Heliance"}. J'aurais une question.`; const url = `https://wa.me/${(number || "").replace(/\D/g, "")}?text=${encodeURIComponent(greeting)}`; return ( Discuter ); } Object.assign(window, { TopBar, Hero, SectionHeader, ProductCard, ColorSwatches, OrderBar, CartDrawer, ValidityFooter, WhatsAppFloating, WaIcon, CloseIcon });