shadow-sm overflow-hidden" x-data="{ quantity: 0, max: <%= remaining %>, ticketTypeId: <%= id %>, name: '<%= name %>', price: <%= price_cents %> }" x-init=" $watch('quantity', (value) => { $dispatch('update-cart-item', { ticketTypeId: ticketTypeId, name: name, price: price, quantity: value, max: max }); }); $nextTick(() => { $dispatch('cart-initialized', { ticketTypeId: ticketTypeId }); }); " @update-cart-item.window=" if ($event.detail.ticketTypeId === ticketTypeId) { quantity = $event.detail.quantity; } " @cart-change.window=" if (!$event.detail.cart[ticketTypeId]) { quantity = 0; } " @restore-cart.window=" if ($event.detail.cart[ticketTypeId]) { quantity = $event.detail.cart[ticketTypeId].quantity; } ">

"><%= name %>

"><%= description %>

"> <%= number_to_currency(price_cents / 100.0, unit: "€") %>

<% if sold_out %> Épuisé <% else %> <%= remaining %> disponibles <% end %>
<% unless sold_out %>
<% else %>
Indisponible
<% end %>