/* Minification failed. Returning unminified contents.
(1,16): run-time error CSS1031: Expected selector, found '='
(1,16): run-time error CSS1025: Expected comma or open brace, found '='
(4,13): run-time error CSS1031: Expected selector, found ';'
(4,13): run-time error CSS1025: Expected comma or open brace, found ';'
(6,21): run-time error CSS1031: Expected selector, found ';'
(6,21): run-time error CSS1025: Expected comma or open brace, found ';'
(8,1): run-time error CSS1019: Unexpected token, found '$'
(8,2): run-time error CSS1019: Unexpected token, found '('
(8,11): run-time error CSS1031: Expected selector, found ')'
(8,11): run-time error CSS1025: Expected comma or open brace, found ')'
(272,2): run-time error CSS1019: Unexpected token, found ')'
(274,10): run-time error CSS1031: Expected selector, found 'sSchoonmakenCallback('
(274,10): run-time error CSS1025: Expected comma or open brace, found 'sSchoonmakenCallback('
(278,10): run-time error CSS1031: Expected selector, found 'dFacRglCallback('
(278,10): run-time error CSS1025: Expected comma or open brace, found 'dFacRglCallback('
(307,10): run-time error CSS1031: Expected selector, found 'refreshWW('
(307,10): run-time error CSS1025: Expected comma or open brace, found 'refreshWW('
(315,16): run-time error CSS1031: Expected selector, found 'refreshWW2('
(315,16): run-time error CSS1025: Expected comma or open brace, found 'refreshWW2('
(347,10): run-time error CSS1031: Expected selector, found 'iFacRglCallback('
(347,10): run-time error CSS1025: Expected comma or open brace, found 'iFacRglCallback('
(357,10): run-time error CSS1031: Expected selector, found 'setArtikelIDUitvoering('
(357,10): run-time error CSS1025: Expected comma or open brace, found 'setArtikelIDUitvoering('
(361,10): run-time error CSS1031: Expected selector, found 'setCatIDUitvoering('
(361,10): run-time error CSS1025: Expected comma or open brace, found 'setCatIDUitvoering('
(366,10): run-time error CSS1031: Expected selector, found 'sShoppingBagCallback('
(366,10): run-time error CSS1025: Expected comma or open brace, found 'sShoppingBagCallback('
(396,10): run-time error CSS1031: Expected selector, found 'btn_OrderPrivacy('
(396,10): run-time error CSS1025: Expected comma or open brace, found 'btn_OrderPrivacy('
(416,1): run-time error CSS1019: Unexpected token, found '$'
(416,2): run-time error CSS1019: Unexpected token, found '('
(416,11): run-time error CSS1031: Expected selector, found ')'
(416,11): run-time error CSS1025: Expected comma or open brace, found ')'
(446,2): run-time error CSS1019: Unexpected token, found ')'
(459,1): run-time error CSS1019: Unexpected token, found '!'
(459,2): run-time error CSS1019: Unexpected token, found 'function('
(459,14): run-time error CSS1031: Expected selector, found ')'
(459,14): run-time error CSS1025: Expected comma or open brace, found ')'
(459,159): run-time error CSS1019: Unexpected token, found '('
(459,165): run-time error CSS1031: Expected selector, found 'function('
(459,8204): run-time error CSS1019: Unexpected token, found ')'
 */
var artDeleted = 0;

var elem,
    newValue;

var newValue, target;

$(document).ready(function () {

    //new keuzehulpProducts();
    $(document).on('keypress', '.txtQuantity', function (key) {
        if (key.charCode < 48 || key.charCode > 57) {
            return false;
        }
    });

    $(document).on('blur', '.txtQuantity', function () {
        if (!this.value) {
            $(this).val(1);
        }
    });

    $(document).on("click touch", ".txtQtyPlusProduct", function (e) {
        e.preventDefault();

        var currentVal = parseInt($(this).parent(".Qty").find(".txtQuantity").val());
        if (bOverzicht) {
            $(this).parent(".Qty").find(".txtQuantity").val(currentVal + 1);
        } else {
            $(".txtQuantity").val(currentVal + 1);
        }
    });

    $(document).on("click touch", ".txtQtyMinProduct", function (e) {
        e.preventDefault();

        var currentVal = parseInt($(this).parent(".Qty").find(".txtQuantity").val());

        if (bOverzicht) {
            if (currentVal == 1) {
                $(this).parent(".Qty").find(".txtQuantity").val(1);
            } else {
                $(this).parent(".Qty").find(".txtQuantity").val(currentVal - 1);
            }
        } else {
            if (currentVal == 1) {
                $(".txtQuantity").val(1);
            } else {
                $(".txtQuantity").val(currentVal - 1);
            }
        }
    });

    $('.rund').hide();
    $(".step .JScollapse").click(function (e) {
       /* $(".step .rund").hide();*/
        $(this).next().toggle();
    });

    if ($(window).width() > 1200) {
        $('#stickyWinkelwagen').scrollToFixed({
            marginTop: 150,
            removeOffsets: true,
            limit: function () {
                return $('.questions').offset().top - $('#stickyWinkelwagen').outerHeight(true) - 150;
            }
        });
    }

    if ($(window).width() > 1200) {
        $('#stickyButtonWW').scrollToFixed({
            marginTop: 650,
            removeOffsets: true,
            limit: function () {
                return $('.questions').offset().top - $('#stickyButtonWW').outerHeight(true) - 50;
            }
        });
    }

    const inputBMin = document.getElementById("txtAantalPersonen2");
    const hidMin = document.getElementById("hidMinBestel");
    inputBMin.attributes.min.nodeValue = hidMin.attributes.value.nodeValue;

    $(window).keydown(function (event) {
        if (event.keyCode == 13) {
            event.preventDefault();
            return false;
        }
    });

    $('.items').on('click', function (e) {
        $('label', $(this)).trigger('click');
    });

    $('.items label').on('click', function (e) {
        e.stopPropagation();
    });

    $('.JSuitvoeringItems input').change(function () {
        $('.JSuitvoeringItems').find('input').prop('checked', false); //Radio
        $(this).prop('checked', true);
        $("#divItem").removeClass("selected");
    });

    $('.step5 input').change(function () {
        $('.step5').find('input').prop('checked', false); //Radio
        $(this).prop('checked', true);
    });
    //lightbox.option({
    //    'resizeDuration': 200,
    //    'wrapAround': true
    //})
    $(document).on("click", ".aRemoveItem", function () {
        console.log('test');
        //target = $(this).parent().parent();
        var odata = {
            iFacRglID: $(this).data('id')
        }
        artDeleted = $(this).data('artikel-id');
        AjaxRequest("POST", "/Winkelwagen.aspx/dFacRgl", odata, "", "json", "dFacRglCallback");
    });

    $(document).on("click", ".btn-remove", function () {
        console.log('test');
        //target = $(this).parent().parent();
        var odata = {
            iArtikelID: $(this).data('artikel-id')
        }
        artDeleted = $(this).data('artikel-id');
        AjaxRequest("POST", "/Winkelwagen.aspx/dFacRglByArtikelID", odata, "", "json", "dFacRglCallback");
    });


    $('.aProductLink').click(function () {
        var iVlees = parseInt($("#hidCountVleessoorten").val());
        var maxVlees = parseInt($("#hidMaxVleessoorten").val());
        let containsExtra = $(this).parent(".divItem")[0].classList.contains("extra");
        
        if ((iVlees + 1) > maxVlees && !containsExtra){
            return;
        }

        var iArtikelID = $(this).parent(".divItem").data("artikel-id");

        var AantalStuks = 0
        AantalStuks = $(this).parent().find('#txtAantalstuks').val();

        var odata = {
            iArtikelID: iArtikelID,
            iArtikelVariantID: $('.JSuitvoeringItems input:checked').val() || 0,
            iAantal: AantalStuks || 1,
            iTaalID: 51,
            iAantalPersonen: $('#txtAantalPersonen2').val(),
            iArtikelIDUitvoering: $('.JSuitvoeringItems input:checked').val() || 0,
            iArtikelIDUpgrade: 0
        }

        $('#divItem[data-artikel-id="' + iArtikelID + '"]').addClass('selected');
            AjaxRequest("POST", "/Data/shopping-cart.aspx/iFacRgl", odata, "", "json", "iFacRglCallback");
    });

    var bCountChanged = false;

    var txtPersMin = parseInt($("#txtAantalPersonen2").attr("min")) || 1;

    $('#txtAantalPersonen2').on("blur", function (e) {
        var val = parseInt($(this).val());
        if (val < txtPersMin) { $(this).val(txtPersMin) }

    });

    var txtAantalMin = parseInt($("#txtQuantity").attr("min")) || 1;

    $('#txtQuantity').on("blur", function (e) {
        var val = parseInt($(this).val());
        if (val < txtAantalMin) { $(this).val(txtAantalMin) }

    });

    $('#txtAantalPersonen2').on("change keydown keyup", function (e) {
        var val = parseInt($(this).val());

        if (val >= txtPersMin) {

            var allin = document.getElementById('hidAllIn').value;

            if (allin) {
                var odata = {
                    bBorden: $('.rblBorden').find('input[type=radio]:checked').val(),
                    iAantalPersonen: $('#txtAantalPersonen2').val()
                }

                AjaxRequest("POST", "/Data/shopping-cart.aspx/iuBorden", odata, "", "json", "refreshWW");
            }

            refreshWW();
        }
    });

    $('#txtAantalPersonen2').on("change keydown keyup", function (e) {
        var val = parseInt($(this).val());

        if (val >= txtPersMin) {

            var allin = document.getElementById('hidAllIn').value;

            if (allin) {
                var odata = {
                    sBbq: $('.rblBBQ').find('input[type=radio]:checked').val(),
                    iAantalPersonen: $('#txtAantalPersonen2').val()
                }

                AjaxRequest("POST", "/Data/shopping-cart.aspx/iuBBQ", odata, "", "json", "refreshWW");
            }

            refreshWW();
        }
    });

    $("#txtAantalPersonen2").val(txtPersMin);

    $('.collection a.JScollapse').click(function (e) {
        var anchor = $(this).attr('href').replace("#", ".");
        if ($(anchor).hasClass('open')) {
            $(anchor).removeClass('close');
        } else {
            $(anchor).addClass('open');
        }
    });

    $('.rblSchoonmaken input').change(() => {
        var odata = {
            iArtikelID: $(".rblSchoonmaken").find('input[type=radio]:checked').val(),
            iArtikelVariantID: 0,
            iAantal: 1
        }

        AjaxRequest("POST", "/Data/shopping-cart.aspx/iFacRgl", odata, "", "json", "sSchoonmakenCallback");
    });

    refreshWW();

    $('.rblBorden input').change(() => {
        var odata = {
            bBorden: $('.rblBorden').find('input[type=radio]:checked').val(),
            iAantalPersonen: $('#txtAantalPersonen2').val()
        }

        AjaxRequest("POST", "/Data/shopping-cart.aspx/iuBorden", odata, "", "json", "refreshWW");
    });

    refreshWW();

    $('.rblBBQ input').change(() => {
        var odata = {
            sBBQ: $('.rblBBQ').find('input[type=radio]:checked').val(),
            iAantalPersonen: $('#txtAantalPersonen2').val()
        }

        AjaxRequest("POST", "/Data/shopping-cart.aspx/iuBBQ", odata, "", "json", "refreshWW");
    });

    refreshWW();


    var odata = {
        sBBQ: $('.rblBBQ').find('input[type=radio]:checked').val(),
        iAantalPersonen: $('#txtAantalPersonen2').val()
    }

    AjaxRequest("POST", "/Data/shopping-cart.aspx/iuBBQ", odata, "", "json", "refreshWW");
});

function sSchoonmakenCallback() {
    refreshWW();
}
    
function dFacRglCallback() {
    refreshWW();
    console.log(artDeleted);
    console.log($('a[data-item-id=' + artDeleted + ']'));
    $('#divItem[data-artikel-id="' + artDeleted + '"]').removeClass('selected');

    //console.log(sMsg);
    //$('.lblTotalExcl').html(sMsg.d.totaalExcl);
    //$('#divWinkelmandTotal').html(sMsg.d.totaalExcl);


    ////$('.lblVat').html(msg.d.btw);
    //$('.lblTotalIncl').html(sMsg.d.totaalIncl);
    //$('.lblDiscount').html(sMsg.d.korting);
    //$('.spanCountProducts').html(sMsg.d.aantal);
    //$(target.closest('.shoppingItem')).fadeOut('fast');
    //if (sMsg.d.aantal === "0") {
    //    $(".spanInfo").show();
    //    $(".btnCheckout").hide();
    //}
}
//function refreshWW() {
//    AjaxRequest("POST", "/Data/shopping-cart.aspx?lang=" +
//        $('#hidLanguage').val() +
//        "&iAantalPersonen=" + $('#txtAantalPersonen2').val() +
//        "&iArtikelIDUitvoering=" + $('.JSuitvoeringItems input:checked').val() +
//        "&iArtikelIDUpgrade=" + $('.step5 input:checked').val(), "", "", "html", "sShoppingBagCallback");
//}

function refreshWW() {
    AjaxRequest("POST", "/Data/shopping-cart.aspx?lang=" +
        $('#hidLanguage').val() +
        "&iAantalPersonen=" + $('#txtAantalPersonen2').val() +
        "&iArtikelIDUitvoering=" + $('.JSuitvoeringItems input:checked').val() +
        "&iArtikelIDUpgrade=" + $('.step5 input:checked').val() + "&iCurrentCatID=" + $('#hidCatID').val() + "&iArtikelSoort=" + $('#hidHapjes').val(), "", "", "html", "sShoppingBagCallback");
}

async function refreshWW2() {
    await AjaxRequest("POST", "/Data/shopping-cart.aspx?lang=" +
        $('#hidLanguage').val() +
        "&iAantalPersonen=" + $('#txtAantalPersonen2').val() +
        "&iArtikelIDUitvoering=" + $('.JSuitvoeringItems input:checked').val() +
        "&iArtikelIDUpgrade=" + $('.step5 input:checked').val(), "", "", "html", "sShoppingBagCallback");
}

//function keuzehulpProducts() {
//    var self = this;

//    this.products = $("[data-add-to-cart]");

//    this.products.click(async function () {
//        var product = JSON.stringify({
//            iArtikelID: $(this).data("artikel-id"),
//            iCatID: $(this).data("cat-id"),
//            iQuantity: parseInt($(this).parent().find("[data-qty]").val())
//        })
//        await $.ajax({
//            method: "POST",
//            url: "/category.aspx/insertHoofdFacRgl",
//            contentType: "application/json; charset=utf-8",
//            data: product,
//            success: async function () {
//                await refreshWW2();
//            }
//        })
//    });

//}

function iFacRglCallback() {
    if (sMsg.d.code === 1) {
        //$('.spanCountProducts').html(sMsg.d.aantal);
        refreshWW();
        return true;
    } else {
        return false;
    }
}

function setArtikelIDUitvoering(id) {
    $('#hidUitvoeringCatID').val(id);
}

function setCatIDUitvoering(id) {
    $('#hidCatID').val(id);
}


function sShoppingBagCallback() {
    $('.divCartHolder').html($('.selector', $(sMsg)));
    $(".wwItem").each(function () {
        var aID = $(this).data("artikel-id");

        var target = $(".divItem[data-artikel-id='" + aID + "']")
        target.addClass("selected");
    });



    //var iVlees = parseInt($("#hidCountVleessoorten").val());
    //if (iVlees === 0) {
    //    $(".divItem.selected").removeClass("selected");
    //}


    //console.log($('a[data-artikel-id="' + 79163 + '"]'));
    //$('a[data-artikel-id="' + 79163 + '"]').removeClass('selected');
    //$('#divWinkelmandTotal').html($('.selector-price', $(sMsg)).text());
    //$('.liCart').addClass('show');


//$(document).ready(function () {
//    $('#list').click(function (event) { event.preventDefault(); $('#products .item').addClass('list-group-item');});
//    $('#grid').click(function (event) { event.preventDefault(); $('#products .item').removeClass('list-group-item'); $('#products .item').addClass('grid-group-item'); });
//});

}

function btn_OrderPrivacy() {
var fv = $('.divGlobalForm').data('formValidation');
    var bOk = true;

    //fv.revalidateField('ctl00$ContentPlaceHolder1$repArtUitvoering$ctl00$artikeluitvoering');

    //if (fv.isValidField('ctl00$ContentPlaceHolder1$repArtUitvoering$ctl00$artikeluitvoering') === false) {
    //    bOk = false;
    //}

    if (bOk) {
        __doPostBack('ctl00$ContentPlaceHolder1$btnOrder1', '')
    } else {
        var $sectionClone = $(".JSuitvoeringItems .help-block").clone();
        $('#messages').append($sectionClone);
        return false
    }
}
    

$(document).ready(function () {

    if ($(window).width() > 1024) {
        function resizeCols() {
            var autoheightParentSel = '.autoHeightContainer';
            var autoHeightChildSel = '.autoHeightChild';

            $(autoheightParentSel).each(function (i, item) {
                // remove old class
                $(item).find(autoHeightChildSel).css('height', '');
                var maxHeight = 0;
                $(item).find(autoHeightChildSel).each(function (ii, child) {
                    maxHeight = Math.max(maxHeight, $(child).outerHeight(true))
                });
                $(item).find(autoHeightChildSel).css('height', maxHeight + 'px');
            });
        }

        if ($('.autoHeightContainer').length > 0 && $('.autoHeightChild').length > 0) {
            // different refereshing techniques
            resizeCols();
            setTimeout(resizeCols, 0);
            setTimeout(resizeCols, 100);
            $(window).on('resize', resizeCols);
            $(window).on('load', resizeCols);
            // again after optional animations
            $(window).on('resize', function () { setTimeout(resizeCols, 150); setTimeout(resizeCols, 500) });
            $(window).on('load', function () { setTimeout(resizeCols, 150); setTimeout(resizeCols, 500) });
        }
    }
});

/*!
 * Lightbox v2.8.2
 * by Lokesh Dhakar
 *
 * More info:
 * http://lokeshdhakar.com/projects/lightbox2/
 *
 * Copyright 2007, 2015 Lokesh Dhakar
 * Released under the MIT license
 * https://github.com/lokesh/lightbox2/blob/master/LICENSE
 */
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.lightbox=b(a.jQuery)}(this,function(a){function b(b){this.album=[],this.currentImageIndex=void 0,this.init(),this.options=a.extend({},this.constructor.defaults),this.option(b)}return b.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:500,fitImagesInViewport:!0,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1},b.prototype.option=function(b){a.extend(this.options,b)},b.prototype.imageCountLabel=function(a,b){return this.options.albumLabel.replace(/%1/g,a).replace(/%2/g,b)},b.prototype.init=function(){this.enable(),this.build()},b.prototype.enable=function(){var b=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(c){return b.start(a(c.currentTarget)),!1})},b.prototype.build=function(){var b=this;a('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(a("body")),this.$lightbox=a("#lightbox"),this.$overlay=a("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return b.end(),!1}),this.$lightbox.hide().on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$outerContainer.on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return 0===b.currentImageIndex?b.changeImage(b.album.length-1):b.changeImage(b.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return b.currentImageIndex===b.album.length-1?b.changeImage(0):b.changeImage(b.currentImageIndex+1),!1}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return b.end(),!1})},b.prototype.start=function(b){function c(a){d.album.push({link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,e=a(window);e.on("resize",a.proxy(this.sizeOverlay,this)),a("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var f,g=0,h=b.attr("data-lightbox");if(h){f=a(b.prop("tagName")+'[data-lightbox="'+h+'"]');for(var i=0;i<f.length;i=++i)c(a(f[i])),f[i]===b[0]&&(g=i)}else if("lightbox"===b.attr("rel"))c(b);else{f=a(b.prop("tagName")+'[rel="'+b.attr("rel")+'"]');for(var j=0;j<f.length;j=++j)c(a(f[j])),f[j]===b[0]&&(g=j)}var k=e.scrollTop()+this.options.positionFromTop,l=e.scrollLeft();this.$lightbox.css({top:k+"px",left:l+"px"}).fadeIn(this.options.fadeDuration),this.options.disableScrolling&&a("body").addClass("lb-disable-scrolling"),this.changeImage(g)},b.prototype.changeImage=function(b){var c=this;this.disableKeyboardNav();var d=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),a(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var e=new Image;e.onload=function(){var f,g,h,i,j,k,l;d.attr("src",c.album[b].link),f=a(e),d.width(e.width),d.height(e.height),c.options.fitImagesInViewport&&(l=a(window).width(),k=a(window).height(),j=l-c.containerLeftPadding-c.containerRightPadding-20,i=k-c.containerTopPadding-c.containerBottomPadding-120,c.options.maxWidth&&c.options.maxWidth<j&&(j=c.options.maxWidth),c.options.maxHeight&&c.options.maxHeight<j&&(i=c.options.maxHeight),(e.width>j||e.height>i)&&(e.width/j>e.height/i?(h=j,g=parseInt(e.height/(e.width/h),10),d.width(h),d.height(g)):(g=i,h=parseInt(e.width/(e.height/g),10),d.width(h),d.height(g)))),c.sizeContainer(d.width(),d.height())},e.src=this.album[b].link,this.currentImageIndex=b},b.prototype.sizeOverlay=function(){this.$overlay.width(a(document).width()).height(a(document).height())},b.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(g),d.$lightbox.find(".lb-prevLink").height(h),d.$lightbox.find(".lb-nextLink").height(h),d.showImage()}var d=this,e=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),g=a+this.containerLeftPadding+this.containerRightPadding,h=b+this.containerTopPadding+this.containerBottomPadding;e!==g||f!==h?this.$outerContainer.animate({width:g,height:h},this.options.resizeDuration,"swing",function(){c()}):c()},b.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},b.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=this.options.alwaysShowNavOnTouchDevices?!0:!1}catch(b){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),a&&this.$lightbox.find(".lb-next").css("opacity","1"))))},b.prototype.updateDetails=function(){var b=this;if("undefined"!=typeof this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title&&this.$lightbox.find(".lb-caption").html(this.album[this.currentImageIndex].title).fadeIn("fast").find("a").on("click",function(b){void 0!==a(this).attr("target")?window.open(a(this).attr("href"),a(this).attr("target")):location.href=a(this).attr("href")}),this.album.length>1&&this.options.showImageNumberLabel){var c=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(c).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return b.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var a=new Image;a.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){var b=new Image;b.src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")},b.prototype.keyboardAction=function(a){var b=27,c=37,d=39,e=a.keyCode,f=String.fromCharCode(e).toLowerCase();e===b||f.match(/x|o|c/)?this.end():"p"===f||e===c?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===f||e===d)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),a("select, object, embed").css({visibility:"visible"}),this.options.disableScrolling&&a("body").removeClass("lb-disable-scrolling")},new b});
//# sourceMappingURL=lightbox.min.map
