{% if packages is not defined %}{% set packages = null %}{% endif %}
{% if destinationPackages is not defined %}{% set destinationPackages = null %}{% endif %}
<section class="mt-4" data-track-content data-content-name="accommodation-packages">
{% if not isAffiliate %}
<h2 class="mb-4 text-primary">{{ "demi.detail.package-offers"|trans }}</h2>
{% endif %}
<div class="js-search-data__show-if-submitted" {{ availabilityIsChecked ? '' : 'hidden' }}>
{{ include('@ElementsDemiFrontend/Accommodation/includes/corridor-matrix.html.twig', {
'styleModifier': 'pt-3',
'type': 'packages'
}) }}
</div>
<div class="js-room-list" aria-live="polite">
<div class="js-room-list__loading" hidden>
<div class="card-body text-center py-5">
{{ include('@ElementsDemiFrontend/Includes/elements/spinner/loading-spinner.html.twig') }}
</div>
</div>
<div class="js-room-list__content mt-3" data-list="packages">
{% if packages is not empty or (destinationPackages is not empty and demi_core_configuration('getShowDestinationPackagesOnAccoDetail',[])) %}
<ul class="list-unstyled row row--vertical-gutter-30 vertical-gutter--4">
{% set position = 1 %}
{% if packages is not empty %}
{% for package in packages %}
<li class="col-4 vertical-gutter__item">
{% set productKey = demi_getCheapestProducts(package.getProducts()) %}
{% set productKeys = package.getProducts()|keys %}
{% set firstProductId = productKeys[productKey] %}
{{ include('@ElementsDemiFrontend/Includes/teaser/package-teaser.html.twig', {
'housePackageMaster': pimcore_object(package.getHousePackageMasterId()),
'cheapestProducts': [package.getProduct(firstProductId)],
'accommodation': accommodation,
'position': position}) }}
</li>
{% set position = position + 1 %}
{% endfor %}
{% endif %}
{% if destinationPackages is not empty and demi_core_configuration("getShowDestinationPackagesOnAccoDetail",[]) and not isAffiliate %}
{% for package in destinationPackages %}
<li class="col-4">
{{ include('@ElementsDemiFrontend/Includes/teaser/destinationPackage-teaser.html.twig', {
'destinationPackage': package,
'accommodation': accommodation,
'position': position})
}}
</li>
{% set position = position + 1 %}
{% endfor %}
{% endif %}
</ul>
{% endif %}
{% if packages is empty and destinationPackages is empty %}
<div class="card-body">
<div class="font-medium text-muted">
<div class="row row--gutter-width-10">
<div class="col col-auto">
<span class="demi-icon demi-icon-warning icon-in-text"
aria-label="{{ 'demi.warning'|trans }}"
title="{{ 'demi.warning'|trans }}"></span>
</div>
<div class="col">
{{ "demi.detail.no-packages"|trans }}
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
<div class="js-corridor__room-packages"></div>
</section>