{% trans_default_domain 'credits_membership' %}
{% apply spaceless %}
{%- if purchaseResult is defined or ((app.request.hasPreviousSession or app.session.started) and app.session.flashBag.has('credits_membership_purchase_status')) -%}
{% set purchaseData = purchaseResult is defined ? purchaseResult : app.session.flashBag.get('credits_membership_purchase_status')[0] %}
<div class="modal fade dark-modal" id="credits-membership-purchase-status-popup" tabindex="-1" role="dialog" aria-labelledby="credits-membership-purchase-status-popup-header" aria-hidden="true">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<a href="#" class="close" data-dismiss="modal" aria-label="{{ 'general.close'|trans({}, 'popup') }}">
<em class="icon ni ni-cross"></em>
</a>
{% if purchaseData.status is same as(true) %}
<div class="modal-header text-center justify-content-center border-bottom-0" id="credits-membership-purchase-status-popup-header">
<div>
<div class="mb-4 mt-2 credits-membership-purchase-status-popup-icon">
<em class="icon dp-icon-success"></em>
</div>
<h4 class="mb-4 justify-content-center align-items-center">{{ 'success'|trans({}, 'popup') }}</h4>
<p>
{{ 'result_popup.success.text'|trans }}
</p>
</div>
</div>
<div class="modal-body">
<div class="form-group text-center">
<a href="#" class="btn btn-primary btn-lg w-100 justify-content-center" data-dismiss="modal" aria-label="{{ 'general.close'|trans({}, 'popup') }}">
{{ 'general.close'|trans({}, 'popup') }}
</a>
</div>
</div>
{% elseif purchaseData.status is same as(false) %}
<div class="modal-header text-center justify-content-center border-bottom-0" id="credits-membership-purchase-status-popup-header">
<div>
<div class="mb-4 mt-2 credits-membership-purchase-status-popup-icon">
<em class="icon dp-icon-failed"></em>
</div>
<h2 class="mb-4 justify-content-center">
{{ 'result_popup.declined.headline'|trans }}
</h2>
<h5 class="mb-2">
{{ 'result_popup.declined.text'|trans }}
</h5>
</div>
</div>
<div class="modal-body">
<div class="form-group text-center">
<a href="#" class="btn btn-primary btn-lg w-100 justify-content-center" data-dismiss="modal" aria-label="{{ 'general.close'|trans({}, 'popup') }}">
{{ 'general.close'|trans({}, 'popup') }}
</a>
</div>
</div>
{% else %}
<div class="modal-header text-center justify-content-center border-bottom-0" id="credits-membership-purchase-status-popup-header">
<div>
<div class="mb-4 mt-2 credits-membership-purchase-status-popup-icon">
<div class="spinner-border" role="status"><span class="sr-only">{{ 'loading'|trans({}, 'messages') }}</span></div>
</div>
<h2 class="mb-4 justify-content-center">
{{ 'result_popup.processing.headline'|trans }}
</h2>
<h5 class="mb-5">
{{ 'result_popup.processing.text'|trans }}
</h5>
<p class="w-75 m-auto">
{% trans with {'{ support_link }': path('contact')} %}result_popup.processing.text2{% endtrans %}
</p>
</div>
</div>
<div class="modal-body" id="purchase-processing" data-check-url="{{ purchaseData.checkPath }}">
<div class="form-group text-center">
<a href="#" class="btn btn-primary btn-lg w-100 justify-content-center" data-dismiss="modal" aria-label="{{ 'general.close'|trans({}, 'popup') }}">
{{ 'general.close'|trans({}, 'popup') }}
</a>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% endapply %}