(function ($) {
    if(Mapbender.configuration){
        $(Mapbender.setup);
    } else {
        var url = '{{ path('mapbender_core_application_configuration', {'slug': application.slug})  | raw }}';
        $.ajax({
            url: url + window.location.search,
            contentType: 'json'
        }).done(function (data, textStatus, jqXHR) {
            Mapbender.configuration = data;
            $(Mapbender.setup);
        }).fail(function (jqXHR, textStatus, errorThrown) {
            Mapbender.info("Load application's configuration: " + errorThrown);
        });
    }
})(jQuery);