$(document).ready(function () {

    $(document).on('click', "#start-tour", function (event) {
        $('#tour-rewatch-modal').modal('show');

    });


    $("#tour-rewatch-form").on("click", "#saveBtn-tour-rewatch", function () {

        var form = document.getElementById("tour-rewatch-form");
        let url = $(`#tour-rewatch-form`).attr('data-url');

        $.ajax({
            type: "POST",
            url: url,
            data: new FormData(form),
            contentType: false,
            processData: false,
            dataType: "json",
            success: function (response) {
                if (response.url) {
                    window.location.href = response.url;
                }

            },
            error: function (response) {
            }
        });


    });


});
