{% set stepLinks = [] %}
{% if stepNames is not defined %}
{% set stepNames = stepNames is defined ? stepNames : {
0 : hasTickets and demi_core_configuration('getNeverSkipCart',[]==true) ? 'demi.booking.cart.cart-additional-offers'|trans : 'demi.booking.additional-offers'|trans,
1: 'demi.booking.personal-data'|trans
} %}
{% set stepLinks = {
0: demi_checkoutUrl('cart', 'step1'),
1: demi_checkoutUrl('checkout', 'customer')
} %}
{% if hasInsurance is defined and hasInsurance == true %}
{% set stepNames = stepNames|merge(['demi.booking.insurance'|trans]) %}
{% set steps = steps + 1 %}
{% set stepLinks = stepLinks|merge([demi_checkoutUrl('checkout', 'insurance')]) %}
{% endif %}
{% if steps > 3 %}
{% set stepNames = stepNames|merge(['demi.booking.optional-data'|trans]) %}
{% set stepLinks = stepLinks|merge([demi_checkoutUrl('checkout', 'optionalData')]) %}
{% endif %}
{% if hasAdditionalPrePaymentStep is defined and hasAdditionalPrePaymentStep == true %}
{% set stepNames = stepNames|merge(['demi.booking.additional-pre-payment-step'|trans]) %}
{% set stepLinks = stepLinks|merge([demi_checkoutUrl('checkout', 'additionalPrePayment')]) %}
{% endif %}
{% set stepNames = stepNames|merge(['demi.booking.payment'|trans]) %}
{% set stepLinks = stepLinks|merge([demi_checkoutUrl('checkout', 'check')]) %}
{% endif %}
{% if hasTickets %}
{% set ticketStepNames = [] %}
{% for index, step in stepNames %}
{% set ticketStepNames = ticketStepNames|merge([step]) %}
{% if index == 0 %}
{% set ticketStepNames = ticketStepNames|merge(['demi.booking.step.tickets'|trans]) %}
{% endif %}
{% endfor %}
{% set stepNames = ticketStepNames %}
{% set ticketStepLinks = [] %}
{% if stepLinks|length > 0 %}
{% for index, step in stepLinks %}
{% set ticketStepLinks = ticketStepLinks|merge([step]) %}
{% if index == 0 %}
{% set ticketStepLinks = ticketStepLinks|merge([demi_checkoutUrl('ticket', 'overview')]) %}
{% endif %}
{% endfor %}
{% endif %}
{% set stepLinks = ticketStepLinks %}
{% set steps = steps + 1 %}
{% set currentStep = currentStep >= 1 and not ticketOverview ? currentStep + 1 : currentStep %}
{% endif %}
{% if disableNavigationViaProgressbar is defined and disableNavigationViaProgressbar == true %}
{% set stepLinks = [] %}
{% endif %}
{% set progressString = demi_fillTranslation({'[STEP_FROM]': currentStep + 1, '[STEP_TO]': steps}, 'demi.booking.progress-from-to') %}
<div class="p-4 bg-white box-shadow">
<div class="container">
<section class="step-progress row row--gutter-width-6 align-items-center" title="{{ progressString }}" aria-label="{{ progressString }}">
<div class="col">
<div class="step-progress__bar">
{% for i in 0..(steps-1) %}
<div class="step-progress__bar-item {{ i < currentStep ? 'is-done' : '' }} {{ i == currentStep ? 'is-active' : '' }}">
<div class="step-progress__icon">
{% if i < currentStep %}
<span class="demi-icon demi-icon-check text-white step-progress__icon-inner" aria-hidden="true"></span>
{% else %}
<span class="step-progress__icon-inner step-progress__icon-number">{{ i + 1 }}</span>
{% endif %}
</div>
<div class="step-progress__text">
{% if i < currentStep and stepLinks[i] is defined %} <a href="{{ stepLinks[i] }}">{% endif %}
{{ stepNames[i] }}
{% if i < currentStep and stepLinks[i] is defined %} </a>{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
</section>
</div>
</div>