{% set currency = demi_paymentGetCurrency() %}
{% set currency = currency is not empty ? currency : demi_paymentGetDefaultCurrency('symbol') %}
{% set position = demi_core_configuration('getDefaultPosition',[]) %}
{% if position is not empty %}
{% set pos = {'lat': position.getLatitude(), 'lng': position.getLongitude()} %}
{% else %}
{% set pos = null %}
{% endif %}
{% set selectableRoomQuantity = tvbPackage is defined and tvbPackage is not null ? false : demi_core_configuration('getEnableUnitSearch',[]) %}
{% do jsConfig().add({
'lang': app.request.locale,
'local': app.request.locale ~ "-" ~ demi_findFirstRegionforLanguage(app.request.locale),
'admin': editmode ? true : false,
'currency': currency,
'currencyCode': demi_paymentGetDefaultCurrency(),
'isClickable': true,
'isPhone': pimcore_device().isPhone(),
'maxNightsSelectionCalendar': demi_core_configuration('getMaxNightsSelectionCalendar',[]),
'tracking': true,
'googleMapAPIKey': demi_getMapsKey(),
'accommodationMapDefaultPosition': pos,
'accommodationMapDefaultZoom': demi_core_configuration('getDefaultZoomLevel',[]),
'maxProspectSelection': demi_core_configuration('getMaxAmountBrochures',[]),
'selectableRoomQuantity': selectableRoomQuantity
}) %}
{% set dsiOptions = demi_getDsiOptions() %}
{% set currentDate = carbon().create() %}
{% if dsiOptions['vacancySync'] is defined and dsiOptions['vacancySync']['days'] is defined and dsiOptions['vacancySync']['days']>0%}
{% set currentDate = currentDate.addDays(dsiOptions['vacancySync']['days']) %}
{% do jsConfig().add({'maxDate': currentDate.format('Y') ~ '-' ~ currentDate.format('m') ~ '-' ~ currentDate.format('d') ~'T00:00'}) %}
{% endif %}