/* Minification failed. Returning unminified contents.
(749,56-57): run-time error JS1195: Expected expression: .
 */

function getCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) === ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) === 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}


function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
    var expires = "expires=" + d.toGMTString();
    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}


function validateEmail($email) {
    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,10})?$/;
    return emailReg.test($email);
}

function validateHash($hashValue) {
    var hashReg = /^([a-zA-Z0-9/\-:_\s \\]*)$/;
    return hashReg.test($hashValue);
}

function getBaseUrlAndPath() {
    var path = $("#hdnPath").val();
    var host = window.location.host;
    var protocol = window.location.protocol;
    var pathname = window.location.pathname;
    pathname = path !== "" ? pathname.split('/')[2] : pathname.split('/')[1];
    pathname = (typeof (pathname) !== "undefined" && pathname !== "") ? pathname : "en";

    return protocol + "//" + host + path + "/" + pathname;
}

$(document).ready(function () {
    var path = $("#hdnPath").val();
    var host = window.location.host;
    var protocol = window.location.protocol;
    
    var SsoCookie = "";
    var DisplayName = $("#hdnDisplayName").val();
    //alert("test");
    //alert(welcomeUser);
    $("#WelcomeUser").text(DisplayName);

    //login direct link
    if (SsoCookie === "" && window.location.href.toLowerCase().endsWith("#login") !== false) {
        $("#loginLink")[0].click();
    }
    else if (SsoCookie === "" && window.location.href.toLowerCase().endsWith("#forgotpassword") !== false) {
        $("#loginLink")[0].click();
    }
    else if (SsoCookie === "" && window.location.href.toLowerCase().endsWith("#register") !== false) {
        $("#registerLink")[0].click();
    }


    /*var cNameDomain = $("#hdnCNameDomain").val();
    if (window.location.protocol == "https:" && window.location.href.toLowerCase().indexOf(cNameDomain.toLowerCase()) > -1 && window.location.host.toLowerCase() != cNameDomain.toLowerCase()) {
        window.location.href = "https:" + window.location.href.substring(window.location.protocol.length).replace(window.location.host.toLowerCase(), cNameDomain.toLowerCase());
    }*/

    var pathname = location.pathname;
    pathname = path !== "" ? pathname.split('/')[2] : pathname.split('/')[1];
    pathname = (typeof (pathname) !== "undefined" && pathname !== "") ? pathname : "en";

    $('#backToTop').click(function () {
        $('html,body').animate({
            scrollTop: 0
        }, 1000);
    });

    $("#notes-wrapper").addClass("pull-left");

    $("#showMenu:visible").hide();

    $("a#liLoggedIn").click(function () {
        $("#showMenu").toggle();
    });

    SsoCookie = getCookie("beacon");
    if (SsoCookie !== "" && SsoCookie !== null && SsoCookie !== false) {
        $("#ulLogIn").hide();
        $("#ulLoggedIn").show();
        if (window.location.href.endsWith("#")) {
            const hash = window.location.hash;
            history.scrollRestoration = 'manual';
            if (validateHash(hash)) {
                window.location.href = hash;
            }
            history.pushState('', document.title, window.location.pathname);
        }
    }
    else {
        $("#ulLogIn").show();
        $("#ulLoggedIn").hide();
        $('a#liLoggedIn').hide();
    }

    function GTMSubmit(eventName) {
        var dataLayer = window.dataLayer = window.dataLayer || [];

        dataLayer.push({
            'event': eventName,
            'eventAction': 'submit'
        });
    }

    $(".applyFilter a").on("click", function () {
        $(".table-filter-content").hide();
        $(".filter_toggle_button").removeClass("active");
    });

    function toggleBodyAndFooter() {
        if ($("#burger").hasClass("is-selected") && $(window).width() < 1024) {
            $(".bodyID").hide();
            $(".footerID").hide();
        } else {
            $(".bodyID").show();
            $(".footerID").show();
        }
    }

    $("#burger").on("click", toggleBodyAndFooter);
    $(window).resize(toggleBodyAndFooter);

    var autoUrl = protocol + "//" + host + path + "/" + pathname + "/Methodology/GlossaryKeys/";

    $("#txtAuto").autocomplete({
        minLength: 1,
        source: function (request, response) {

            $.ajax({
                type: "post",
                url: autoUrl,
                dataType: "json",
                data: {
                    key: request.term
                },
                success: function (data) {
                    response(data.slice(0, 20))
                }
            });
        }
        ,
        select: function (e, ui) {

            var key = ui.item.value;

            loadFilter(key);

        }

    });

    $.ui.autocomplete.prototype._renderItem = function (ul, item) {

        //  var term = this.term.label.substring(0, 1).toString().toUpperCase() + this.term.substring(1);
        item.label = item.label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(this.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<span style='color:#d6002a;font-weight:bold'>$1</span>");
        var lbl = item.label;

        return $("<li></li>")
            .data("item.autocomplete", item)
            .append("<strong style='color:#999999'>" + lbl + "</strong>")
            .appendTo(ul);
    };



    $('#txtAuto').keypress(function (e) {

        if (e.keyCode === '13') {

            $("#btnFilter").trigger("click");
            return false;
        }
    });


    $("#btnFilter").on("click", function () {

        var search = $("#txtAuto").val();

        loadFilter(search);
    });

    $("#btnFilter").hover(function () {
        $(this).css("background-color", "black");
        $(this).css("color", "white");
    }, function () {
        $(this).css("background-color", "#d6002a");
        $(this).css("color", "white");
    });

    function loadFilter(search) {

        GtmAnalyticsPush("Introduction", "Search", search);

        var url = protocol + "//" + host + path + "/" + pathname + "/our-methodology/glossary";

        $.ajax({
            type: "post",
            url: url,
            dataType: "json",
            data: {
                key: search
            },
            success: function (data) {
                var result = $.parseJSON(data);
                $("#glossary").empty();

                if (result !== null && result !== "") {

                    $.each(result, function (idx, val) {
                        var row = " <div class=\"filterable-list__row\"><div class=\"filterable-list__cell item-type__text\">" + val.Key + "</div><div class=\"filterable-list__cell item-type__content\"><p class=\"with-out-weight\">" + htmlDecode(val.Value) + "</p></div></div>";
                        $("#glossary").append(row);
                        $("#glossaryNotFound").css("display", "none");
                    });
                } else {
                    $("#glossary").empty();
                    $("#glossary").css({ border: "none", outline: "none" });
                    $("#glossaryNotFound").css("display", "block");
                    var dataReg = "/^([a-zA-Z0-9/\-_#]*)$/"
                    if (typeof (row) !== "undefined" && row != "" && dataReg.test(row)) {
                        $("#glossary").append(row);
                    }

                }
                $("#glossary a.link").on("click", function () {
                    var key = $(this).text().trim();
                    loadFilter(key);
                    return false;
                });

            },
            error: function (jqXHR, exception) {

            }

        });

        return false;
    }
    function htmlDecode(value) {
        // alert(value);
        //return $('<div/>').html(value).text();
        var txt = document.createElement("textarea");
        txt.innerHTML = value;
        return txt.value;
    }

    $("#glossary a.link").on("click", function () {
        var key = $(this).text().trim();
        loadFilter(key);
        return false;
    });

    //Software User Manuals Search Results
    var softwareUrl = protocol + "//" + host + path + "/" + pathname + "/Content/SoftwareManualsSearchResult/";

    $("#txtManuals").autocomplete({
        minLength: 1,
        source: function (request, response) {

            $.ajax({
                type: "post",
                url: softwareUrl,
                dataType: "json",
                data: {
                    Key: request.term
                },
                success: function (data) {
                    response(data.slice(0, 20));
                }
            });
        },
        select: function (e, ui) {

            var key = ui.item.value;

            loadSearch(key);

        }

    });

    $('#txtManuals').keypress(function (e) {
        if (e.keyCode === '13') {
            $("#btnSearch").trigger("click");
            return false;
        }
    });

    $("#btnSearch").on("click", function () {
        var search = $("#txtManuals").val();
        loadSearch(search);
    });

    function loadSearch(search) {
        $(this).attr("data-gtm-label", search);
        $(this).attr("data-gtm-category", "Software & Manuals Feed");
        $(this).attr("data-gtm-action", "Search");
        GtmAnalyticsPush("Software & Manuals Feed", "Search", search);
        row = 24;       
        var newurl = protocol + "//" + host + path + "/" + pathname + "/Content/SearchSoftwareUserManuals";

        $.ajax({
            type: "post",
            url: newurl,
            dataType: "html",
            indexValue: { value1: row },
            data: {
                type: typeFilter,
                name: search,
                rows: row
            },
            success: function (data, status, xhr) {
                $('#softwareUserManualResult').empty();
                $('#softwareUserManualResult').html(data);
                if (parseInt(xhr.getResponseHeader("totalItems")) <= this.indexValue.value1) {
                    $("#loadMoreManuals").hide();
                }
                else {
                    $("#loadMoreManuals").show();
                }
                loadGtmInPartialView();
            },
            error: function (jqXHR, exception) {

            }

        });
        return false;
    }


    //$("#glossary tbody a.link").on("click", function () {
    //    var key = $(this).text().trim();
    //    loadSearch(key);
    //    return false;
    //});

    $("div.HolidayTop").hide();
    sessionStorage.removeItem("page");
    var pageinit = 9;
    var size = 5;
    sessionStorage.setItem("page", pageinit);
  
    $("#HolidayLoadMore").on("click", function () {
        var pagesize = sessionStorage.getItem("page");
        var total = $("div.holidayID").length;

        if (pagesize === pageinit) {
            pagesize = parseInt(size) + parseInt(pageinit);
            sessionStorage.setItem("page", pagesize);
        } else {
            pagesize = parseInt(sessionStorage.getItem("page")) + size;
            sessionStorage.setItem("page", pagesize);
        }

        if (pagesize <= total) {
            $("div.holidayID").slice(0, pagesize).show();
            $(this).attr("style", "display:block;");
            $("div.HolidayTop").hide();
            return false;
        }
        else {
            $("div.holidayID").slice(0, pagesize).show();
            $(this).attr("style", "display:none;");
            $("div.HolidayTop").show();
        }
        return false;
    });



    // search results related to methodology landing page
    var methodologyUrl = protocol + "//" + host + path + "/" + pathname + "/Methodology/MethodologySearchResult/";

    $("#txtMethodologySearch").autocomplete({
        minLength: 3,
        source: function (request, response) {

            $.ajax({
                type: "post",
                url: methodologyUrl,
                dataType: "json",
                data: {
                    key: request.term
                },
                success: function (data) {
                    response(data.slice(0, 20))
                    $("p.mserror").hide();
                }
            });
        },
        select: function (e, ui) {
            if (key !== null && key !== "") {
                var key = ui.item.value;
            }
        }
    });


    $("#btnmethodologysearch").on("click", function () {
        var search = $("#txtMethodologySearch").val();
        $(this).attr("data-gtm-label", search);
        $(this).attr("data-gtm-category", "Introduction");
        $(this).attr("data-gtm-action", "Search");
        GtmAnalyticsPush("Introduction", "Search", search);
        if (search !== "") {
            $("p.mserror").hide();
            loadmethodology(search);
        }
        else {
            $("#EnterKeyWord").show();
            $("#NoRecords").hide();
        }
    });

    function loadmethodology(search) {
        var newurl = protocol + "//" + host + path + "/" + pathname + "/Methodology/MethodologySearch/";

        $.ajax({
            type: "post",
            url: newurl,
            dataType: "json",
            data: {
                title: search
            },
            success: function (data) {

                if (data.Value === null || data.Value === "") {
                    $("#NoRecords").show();
                    $("#EnterKeyWord").hide();
                }
                else {
                    $("p.mserror").hide();
                    window.location.href = data.Value;
                }
            },
            error: function (jqXHR, exception) {

            }

        });

        return false;
    }
    // search results related to price assessment landing page
    var priceAssessmentUrl = protocol + "//" + host + path + "/" + pathname + "/Methodology/priceAssessmentSearchResult/";

    $("#txtPriceAssessmentSearch").autocomplete({
        minLength: 3,
        source: function (request, response) {
            $.ajax({
                type: "post",
                url: priceAssessmentUrl,
                dataType: "json",
                data: {

                    key: request.term
                },
                success: function (data) {
                    response(data.slice(0, 20));
                    $("p.mserror").hide();
                }
            });
        },
        select: function (e, ui) {
            var key = ui.item.value;

        }
    });
    $("#txtPriceAssessmentSearch").on("change", function () {
        $("p.mserror").hide();
    });

    $("#btnPriceAssessmentsearch").on("click", function () {
        var search = $("#txtPriceAssessmentSearch").val();
        $(this).attr("data-gtm-label", "Find Price Assessment_"+ search);
        $(this).attr("data-gtm-category", "Find Price Assessments");
        $(this).attr("data-gtm-action", "Search");
        GtmAnalyticsPush("Find Price Assessments", "Search", "Find Price Assessment_" +search);

        if (search !== "") {
            $("p.mserror").hide();
            loadpriceassessment(search);
        }
        else {
            $("#EnterKeyWord").show();
        }
    });



    function loadpriceassessment(search) {

        var newurl = protocol + "//" + host + path + "/" + pathname + "/Methodology/PriceAssessmentSearch/";

        $.ajax({
            type: "post",
            url: newurl,
            dataType: "json",
            data: {
                title: search
            },
            success: function (data) {

                if (data.Value === null || data.Value === "") {
                    $("#NoRecords").show();
                }
                else {
                    $("p.mserror").hide();
                    window.location.href = data.Value
                }
            },
            error: function (jqXHR, exception) {

            }

        });

        return false;
    }

    $('.loader').hide();

    $(".cls").on("click", function () {
        $(this).parent("ul.parent").hide();
    });

    var rowValue = $("#hdnLoad").val();
    var rowTVValue = $("#hdnTVLoad").val();

    $("#loadPA").on("click", function () {
        $('.loader').show();
        var loadrow = $("#hdnLoad").val();
        var loadUrl = protocol + "//" + host + path + "/" + pathname + "/Methodology/GetMorePriceAssessments/";
        var commodity = $("#hdnCommodity").val();
        GetMoreRows("#PAList", loadrow, commodity, "#loadPA", loadUrl);
    });

    $("#loadMS").on("click", function () {
        $('.loader').show();
        var loadrow = $("#hdnLoad").val();
        var loadUrl = protocol + "//" + host + path + "/" + pathname + "/Methodology/GetMoreMethodologySpecifications/";
        var commodity = $("#hdnCommodity").val();
        GetMoreRows("#MSList", loadrow, commodity, "#loadMS", loadUrl);
    });
    $(".cls").on("click", function () {
        rowTVValue = 5;
    });
    $("#loadTV").on("click", function () {

        var loadrow = $("#hdnTVLoad").val();
        var loadUrl = protocol + "//" + host + path + "/" + pathname + "/support/GetMoreTrainingVideos/";
        var commodity = $("#hdnTVCommodity").val();

        GetMoreRows("#TVList", loadrow, commodity, "#loadTV", loadUrl);
        return false;
    });
    function GetMoreRows(ListName, Rows, Commodity, ButtonID, LoadUrl) {
        rowTVValue = parseInt(rowTVValue) + parseInt(Rows);

        $.ajax({
            type: "Post",
            dataType: "html",
            data: { filter: Commodity, rows: rowTVValue, },
            url: LoadUrl,
            success: function (response, status, xhr) {
                $('.loader').hide();
                var IdNameReg = "/^([a-zA-Z0-9/\-_#]*)$/"
                if (ListName != "" && IdNameReg.test(ListName)) {
                    $(ListName).empty();
                    $(ListName).html(response);
                }
                if (ButtonID != "" && IdNameReg.test(ButtonID)) {
                    if (parseInt(xhr.getResponseHeader("TotalCount")) < rowTVValue) {
                        $(ButtonID).hide();
                        $("#backToTop").show();
                    }
                    else {
                        $(ButtonID).show();
                        $("#backToTop").hide();
                    }
                }
                
            },
            complete: function (response) {
                console.log(response.responseText);
            },
            failure: function (response) {
                console.log(response.responseText);
            },
            error: function (response) {
                console.log(response.responseText);
            }
        });
        return false;
    }


});
function HideButton() {
    var rowTVValue = $("#hdnTVTotalLoad").val();
    if (parseInt(rowTVValue) > 5) {
        $("#backToTop").hide();
        $("#loadTV").show();
    } else {

        $("#backToTop").hide();
        $("#loadTV").hide();
    }
}
function ShowLoader() {
    $('.loader').show();
}
function HideLoader() {
    $('.loader').hide();
}

function stopVideo() {
    var iFrame = $(event.target).closest("div.reveal-overlay").find(".podcast_iframe");
    if (iFrame !== null) {
        var iframeElement = document.getElementById(iFrame[0].id);
        if (iframeElement !== null) {
            var iframeSrc = iframeElement.src;
            iframeElement.src = iframeSrc;
        }
    }
};

function GtmAnalyticsPush(category, action, label) {
    window.dataLayer.push({
        'event': 'gtm.event',
        'action': action,
        'category': category,
        'label': label
    });
};

function loadGtmInPartialView()
{
    $("a.js-gtm-tag:not(.gtm-bound)").each(function (index) {
        $(this).addClass('gtm-bound').on("click", function () {

            GtmAnalyticsPush($(this).attr('data-gtm-category'), $(this).attr('data-gtm-action'), $(this).attr('data-gtm-label'));
        });
    });
};

(function () {
    const domainsToDecorate = [
        '.spglobal.com',
        '.platts.com',
        'localhost'
    ], queryParams = [
        'utm_term',
        'utm_campaign',
        'utm_content',
        'utm_medium',
        'utm_source',
        'utm_id',
    ];

    const links = document.querySelectorAll('a');

    // check if links contain domain from the domainsToDecorate array and then decorates
    for (var linkIndex = 0; linkIndex < links.length; linkIndex++) {
        for (var domainIndex = 0; domainIndex < domainsToDecorate.length; domainIndex++) {
            if (links[linkIndex].href.indexOf(domainsToDecorate[domainIndex]) > -1 && links[linkIndex].href.indexOf("#") === -1) {
                links[linkIndex].href = decorateUrl(links[linkIndex].href);
            }
        }
    }
    // decorates the URL with query params
    function decorateUrl(urlToDecorate) {
        var collectedQueryParams = [];
        for (var queryIndex = 0; queryIndex < queryParams.length; queryIndex++) {
            if (getQueryParam(queryParams[queryIndex])) {
                collectedQueryParams.push(queryParams[queryIndex] + '=' + getQueryParam(queryParams[queryIndex]))
            }
        }

        if (collectedQueryParams.length === 0) {
            return urlToDecorate;
        }

        urlToDecorate = (urlToDecorate.indexOf('?') === -1) ? urlToDecorate + '?' : urlToDecorate + '&';
        return urlToDecorate + collectedQueryParams.join('&');
    }

    // borrowed from https://stackoverflow.com/questions/831030/
    // a function that retrieves the value of a query parameter
    function getQueryParam(name) {
        if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(window.location.search))
            return decodeURIComponent(name[1]);
    }

})();

function postBookmarkDetails(bookmark, postAction, onActionComplete) {
    postAction = postAction ? postAction.toLowerCase() : postAction;
    let res = { isSuccess: false, isLimitExceeded: false, branchId: bookmark.BranchId };
    if (postAction !== "delete" && postAction !== "save") {
        onActionComplete(res);
        return;
    }

    const url = getBaseUrlAndPath() + "/UserProfile/UpdateBookmarkDetails";
    $.ajax({
        type: "Post",
        url: url,
        data: { Bookmark: bookmark, postAction: postAction },
        success: function (response) {
            
            if (response == 'success') {
                res.isSuccess = true;
            } else if (response == 'limit_exceed') {
                res.isLimitExceeded = true;
            }
            onActionComplete(res);
        },
        failure: function (response) {
            console.log(response.responseText);
            onActionComplete(res);
        },
        error: function (response) {
            console.log(response.responseText);
            onActionComplete(res);
        }
    });
}

function isLoggedIn() {
    var userType = document.getElementById("usertype")?.value?.toLowerCase();
    return userType && userType !== "anonymous";
}
;
$(document).ready(function () {
    $(document).on("click", "a.fa-print", function (e) {
        var printButton = $(e.target);
        $('.article__wrapper').removeClass("print-current");
        var parentWrapper = printButton.parents('.article__wrapper');
        parentWrapper.addClass("print-current");
        window.print();
        return false;
    });

    $(".pdfdownload").on().click(function (e) {
        var downloadButton = $(e.target);
        $('.article__wrapper').removeClass("download-current");
        var parentWrapper = downloadButton.parents('.article__wrapper');
        parentWrapper.addClass("download-current");
        var url = $(".fa-download").attr("st_url") + "?action=pdf";
        window.open(url);
        return false;
    });

    $(".printagenda").on().click(function (e) {
        var printButton = $(e.target);
        var printdata = $(".printable-agenda").html();
        $("p.printdata").show();
        //console.log(printdata);
        $("p.printdata").append(printdata);
        $(".printagenda").hide();
        $(".intro-copy").hide();
        $(".printdata .accordion__content").css("display", "block");
        $(".printdata .is-accordion-submenu-parent").attr("aria-expanded", "true");
        $('.events-detail__second-column').hide();
        $('.events-detail__full-columns-wrap').hide();
        //$('.events-detail__hero-wrapper').hide();
        $('.printable-agenda').hide();
        $(".events-detail__first-column").css("width", "100%");
        $(".events-detail__first-column").css("flex", "0 0 100%");
        $('.js-event-detail-tabs').hide();
        $('.events-detail__hero .card__background-image').hide();
        window.print();
        $("p.printdata").hide();
        $("p.printdata").empty();
        $(".printagenda").show();
        $('.events-detail__second-column').show();
        $('.events-detail__full-columns-wrap').show();
        //$('.events-detail__hero-wrapper').show();	
        $('.printable-agenda').show();
        $(".events-detail__first-column").css("width", "62%");
        $(".events-detail__first-column").css("flex", "0 0 62%");
        $('.js-event-detail-tabs').show();
        $(".intro-copy").show();
        $('.events-detail__hero .card__background-image').show();
        return false;
    });

});;
!function (e) { if (!e.hasInitialised) { var t = { escapeRegExp: function (e) { return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") }, hasClass: function (e, t) { var i = " "; return 1 === e.nodeType && (i + e.className + i).replace(/[\n\t]/g, i).indexOf(i + t + i) >= 0 }, addClass: function (e, t) { e.className += " " + t }, removeClass: function (e, t) { var i = new RegExp("\\b" + this.escapeRegExp(t) + "\\b"); e.className = e.className.replace(i, "") }, interpolateString: function (e, t) { var i = /{{([a-z][a-z0-9\-_]*)}}/gi; return e.replace(i, function (e) { return t(arguments[1]) || "" }) }, getCookie: function (e) { var t = "; " + document.cookie, i = t.split("; " + e + "="); return 2 != i.length ? void 0 : i.pop().split(";").shift() }, setCookie: function (e, t, i, n, o) { var s = new Date; s.setDate(s.getDate() + (i || 365)); var r = [e + "=" + t, "expires=" + s.toUTCString(), "path=" + (o || "/")]; n && r.push("domain=" + n), document.cookie = r.join(";") }, deepExtend: function (e, t) { for (var i in t) t.hasOwnProperty(i) && (i in e && this.isPlainObject(e[i]) && this.isPlainObject(t[i]) ? this.deepExtend(e[i], t[i]) : e[i] = t[i]); return e }, throttle: function (e, t) { var i = !1; return function () { i || (e.apply(this, arguments), i = !0, setTimeout(function () { i = !1 }, t)) } }, hash: function (e) { var t, i, n, o = 0; if (0 === e.length) return o; for (t = 0, n = e.length; t < n; ++t)i = e.charCodeAt(t), o = (o << 5) - o + i, o |= 0; return o }, normaliseHex: function (e) { return "#" == e[0] && (e = e.substr(1)), 3 == e.length && (e = e[0] + e[0] + e[1] + e[1] + e[2] + e[2]), e }, getContrast: function (e) { e = this.normaliseHex(e); var t = parseInt(e.substr(0, 2), 16), i = parseInt(e.substr(2, 2), 16), n = parseInt(e.substr(4, 2), 16), o = (299 * t + 587 * i + 114 * n) / 1e3; return o >= 128 ? "#000" : "#fff" }, getLuminance: function (e) { var t = parseInt(this.normaliseHex(e), 16), i = 38, n = (t >> 16) + i, o = (t >> 8 & 255) + i, s = (255 & t) + i, r = (16777216 + 65536 * (n < 255 ? n < 1 ? 0 : n : 255) + 256 * (o < 255 ? o < 1 ? 0 : o : 255) + (s < 255 ? s < 1 ? 0 : s : 255)).toString(16).slice(1); return "#" + r }, isMobile: function () { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) }, isPlainObject: function (e) { return "object" == typeof e && null !== e && e.constructor == Object } }; e.status = { deny: "deny", allow: "allow", dismiss: "dismiss" }, e.transitionEnd = function () { var e = document.createElement("div"), t = { t: "transitionend", OT: "oTransitionEnd", msT: "MSTransitionEnd", MozT: "transitionend", WebkitT: "webkitTransitionEnd" }; for (var i in t) if (t.hasOwnProperty(i) && "undefined" != typeof e.style[i + "ransition"]) return t[i]; return "" }(), e.hasTransition = !!e.transitionEnd; var i = Object.keys(e.status).map(t.escapeRegExp); e.customStyles = {}, e.Popup = function () { function n() { this.initialise.apply(this, arguments) } function o(e) { this.openingTimeout = null, t.removeClass(e, "cc-invisible") } function s(t) { t.style.display = "none", t.removeEventListener(e.transitionEnd, this.afterTransition), this.afterTransition = null } function r() { var t = this.options.onInitialise.bind(this); if (!window.navigator.cookieEnabled) return t(e.status.deny), !0; if (window.CookiesOK || window.navigator.CookiesOK) return t(e.status.allow), !0; var i = Object.keys(e.status), n = this.getStatus(), o = i.indexOf(n) >= 0; return o && t(n), o } function a() { var e = this.options.position.split("-"), t = []; return e.forEach(function (e) { t.push("cc-" + e) }), t } function c() { var e = this.options, i = "top" == e.position || "bottom" == e.position ? "banner" : "floating"; t.isMobile() && (i = "floating"); var n = ["cc-" + i, "cc-type-" + e.type, "cc-theme-" + e.theme]; e["static"] && n.push("cc-static"), n.push.apply(n, a.call(this)); p.call(this, this.options.palette); return this.customStyleSelector && n.push(this.customStyleSelector), n } function l() { var e = {}, i = this.options; i.showLink || (i.elements.link = "", i.elements.messagelink = i.elements.message), Object.keys(i.elements).forEach(function (n) { e[n] = t.interpolateString(i.elements[n], function (e) { var t = i.content[e]; return e && "string" == typeof t && t.length ? t : "" }) }); var n = i.compliance[i.type]; n || (n = i.compliance.info), e.compliance = t.interpolateString(n, function (t) { return e[t] }); var o = i.layouts[i.layout]; return o || (o = i.layouts.basic), t.interpolateString(o, function (t) { return e[t] }) } function u(i) { var n = this.options, o = document.createElement("div"), s = n.container && 1 === n.container.nodeType ? n.container : document.body; o.innerHTML = i; var r = o.children[0]; return r.style.display = "none", t.hasClass(r, "cc-window") && e.hasTransition && t.addClass(r, "cc-invisible"), this.onButtonClick = h.bind(this), r.addEventListener("click", this.onButtonClick), n.autoAttach && (s.firstChild ? s.insertBefore(r, s.firstChild) : s.appendChild(r)), r } function h(n) { var o = n.target; if (t.hasClass(o, "cc-btn")) { var s = o.className.match(new RegExp("\\bcc-(" + i.join("|") + ")\\b")), r = s && s[1] || !1; r && (this.setStatus(r), this.close(!0)) } t.hasClass(o, "cc-close") && (this.setStatus(e.status.dismiss), this.close(!0)), t.hasClass(o, "cc-revoke") && this.revokeChoice() } function p(e) { var i = t.hash(JSON.stringify(e)), n = "cc-color-override-" + i, o = t.isPlainObject(e); return this.customStyleSelector = o ? n : null, o && d(i, e, "." + n), o } function d(i, n, o) { if (e.customStyles[i]) return void ++e.customStyles[i].references; var s = {}, r = n.popup, a = n.button, c = n.highlight; r && (r.text = r.text ? r.text : t.getContrast(r.background), r.link = r.link ? r.link : r.text, s[o + ".cc-window"] = ["color: " + r.text, "background-color: " + r.background], s[o + ".cc-revoke"] = ["color: " + r.text, "background-color: " + r.background], s[o + " .cc-link," + o + " .cc-link:active," + o + " .cc-link:visited"] = ["color: " + r.link], a && (a.text = a.text ? a.text : t.getContrast(a.background), a.border = a.border ? a.border : "transparent", s[o + " .cc-btn"] = ["color: " + a.text, "border-color: " + a.border, "background-color: " + a.background], "transparent" != a.background && (s[o + " .cc-btn:hover, " + o + " .cc-btn:focus"] = ["background-color: " + v(a.background)]), c ? (c.text = c.text ? c.text : t.getContrast(c.background), c.border = c.border ? c.border : "transparent", s[o + " .cc-highlight .cc-btn:first-child"] = ["color: " + c.text, "border-color: " + c.border, "background-color: " + c.background]) : s[o + " .cc-highlight .cc-btn:first-child"] = ["color: " + r.text])); var l = document.createElement("style"); document.head.appendChild(l), e.customStyles[i] = { references: 1, element: l.sheet }; var u = -1; for (var h in s) s.hasOwnProperty(h) && l.sheet.insertRule(h + "{" + s[h].join(";") + "}", ++u) } function v(e) { return e = t.normaliseHex(e), "000000" == e ? "#222" : t.getLuminance(e) } function f(i) { if (t.isPlainObject(i)) { var n = t.hash(JSON.stringify(i)), o = e.customStyles[n]; if (o && !--o.references) { var s = o.element.ownerNode; s && s.parentNode && s.parentNode.removeChild(s), e.customStyles[n] = null } } } function m(e, t) { for (var i = 0, n = e.length; i < n; ++i) { var o = e[i]; if (o instanceof RegExp && o.test(t) || "string" == typeof o && o.length && o === t) return !0 } return !1 } function b() { var t = this.setStatus.bind(this), i = this.options.dismissOnTimeout; "number" == typeof i && i >= 0 && (this.dismissTimeout = window.setTimeout(function () { t(e.status.dismiss) }, Math.floor(i))); var n = this.options.dismissOnScroll; if ("number" == typeof n && n >= 0) { var o = function (i) { window.pageYOffset > Math.floor(n) && (t(e.status.dismiss), window.removeEventListener("scroll", o), this.onWindowScroll = null) }; this.onWindowScroll = o, window.addEventListener("scroll", o) } } function y() { if ("info" != this.options.type && (this.options.revokable = !0), t.isMobile() && (this.options.animateRevokable = !1), this.options.revokable) { var e = a.call(this); this.options.animateRevokable && e.push("cc-animate"), this.customStyleSelector && e.push(this.customStyleSelector); var i = this.options.revokeBtn.replace("{{classes}}", e.join(" ")); this.revokeBtn = u.call(this, i); var n = this.revokeBtn; if (this.options.animateRevokable) { var o = t.throttle(function (e) { var i = !1, o = 20, s = window.innerHeight - 20; t.hasClass(n, "cc-top") && e.clientY < o && (i = !0), t.hasClass(n, "cc-bottom") && e.clientY > s && (i = !0), i ? t.hasClass(n, "cc-active") || t.addClass(n, "cc-active") : t.hasClass(n, "cc-active") && t.removeClass(n, "cc-active") }, 200); this.onMouseMove = o, window.addEventListener("mousemove", o) } } } var g = { enabled: !0, container: null, cookie: { name: "cookieconsent_status", path: "/", domain: "", expiryDays: 365 }, onPopupOpen: function () { }, onPopupClose: function () { }, onInitialise: function (e) { }, onStatusChange: function (e, t) { }, onRevokeChoice: function () { }, content: { header: "Cookies used on the website!", message: "This website uses cookies to ensure you get the best experience on our website.", dismiss: "Got it!", allow: "Allow cookies", deny: "Decline", link: "Learn more", href: "http://cookiesandyou.com", close: "&#x274c;" }, elements: { header: '<span class="cc-header">{{header}}</span>&nbsp;', message: '<span id="cookieconsent:desc" class="cc-message">{{message}}</span>', messagelink: '<span id="cookieconsent:desc" class="cc-message">{{message}} <a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" target="_blank">{{link}}</a></span>', dismiss: '<a aria-label="dismiss cookie message" role=button tabindex="0" class="cc-btn cc-dismiss">{{dismiss}}</a>', allow: '<a aria-label="allow cookies" role=button tabindex="0"  class="cc-btn cc-allow">{{allow}}</a>', deny: '<a aria-label="deny cookies" role=button tabindex="0" class="cc-btn cc-deny">{{deny}}</a>', link: '<a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" target="_blank">{{link}}</a>', close: '<span aria-label="dismiss cookie message" role=button tabindex="0" class="cc-close">{{close}}</span>' }, window: '<div role="dialog" aria-live="polite" aria-label="cookieconsent" aria-describedby="cookieconsent:desc" class="cc-window {{classes}}"><!--googleoff: all-->{{children}}<!--googleon: all--></div>', revokeBtn: '<div class="cc-revoke {{classes}}">Cookie Policy</div>', compliance: { info: '<div class="cc-compliance">{{dismiss}}</div>', "opt-in": '<div class="cc-compliance cc-highlight">{{dismiss}}{{allow}}</div>', "opt-out": '<div class="cc-compliance cc-highlight">{{deny}}{{dismiss}}</div>' }, type: "info", layouts: { basic: "{{messagelink}}{{compliance}}", "basic-close": "{{messagelink}}{{compliance}}{{close}}", "basic-header": "{{header}}{{message}}{{link}}{{compliance}}" }, layout: "basic", position: "bottom", theme: "block", "static": !1, palette: null, revokable: !1, animateRevokable: !0, showLink: !0, dismissOnScroll: !1, dismissOnTimeout: !1, autoOpen: !0, autoAttach: !0, whitelistPage: [], blacklistPage: [], overrideHTML: null }; return n.prototype.initialise = function (e) { this.options && this.destroy(), t.deepExtend(this.options = {}, g), t.isPlainObject(e) && t.deepExtend(this.options, e), r.call(this) && (this.options.enabled = !1), m(this.options.blacklistPage, location.pathname) && (this.options.enabled = !1), m(this.options.whitelistPage, location.pathname) && (this.options.enabled = !0); var i = this.options.window.replace("{{classes}}", c.call(this).join(" ")).replace("{{children}}", l.call(this)), n = this.options.overrideHTML; if ("string" == typeof n && n.length && (i = n), this.options["static"]) { var o = u.call(this, '<div class="cc-grower">' + i + "</div>"); o.style.display = "", this.element = o.firstChild, this.element.style.display = "none", t.addClass(this.element, "cc-invisible") } else this.element = u.call(this, i); b.call(this), y.call(this), this.options.autoOpen && this.autoOpen() }, n.prototype.destroy = function () { this.onButtonClick && this.element && (this.element.removeEventListener("click", this.onButtonClick), this.onButtonClick = null), this.dismissTimeout && (clearTimeout(this.dismissTimeout), this.dismissTimeout = null), this.onWindowScroll && (window.removeEventListener("scroll", this.onWindowScroll), this.onWindowScroll = null), this.onMouseMove && (window.removeEventListener("mousemove", this.onMouseMove), this.onMouseMove = null), this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element), this.element = null, this.revokeBtn && this.revokeBtn.parentNode && this.revokeBtn.parentNode.removeChild(this.revokeBtn), this.revokeBtn = null, f(this.options.palette), this.options = null }, n.prototype.open = function (t) { if (this.element) return this.isOpen() || (e.hasTransition ? this.fadeIn() : this.element.style.display = "", this.options.revokable && this.toggleRevokeButton(), this.options.onPopupOpen.call(this)), this }, n.prototype.close = function (t) { if (this.element) return this.isOpen() && (e.hasTransition ? this.fadeOut() : this.element.style.display = "none", t && this.options.revokable && this.toggleRevokeButton(!0), this.options.onPopupClose.call(this)), this }, n.prototype.fadeIn = function () { var i = this.element; if (e.hasTransition && i && (this.afterTransition && s.call(this, i), t.hasClass(i, "cc-invisible"))) { if (i.style.display = "", this.options["static"]) { var n = this.element.clientHeight; this.element.parentNode.style.maxHeight = n + "px" } var r = 20; this.openingTimeout = setTimeout(o.bind(this, i), r) } }, n.prototype.fadeOut = function () { var i = this.element; e.hasTransition && i && (this.openingTimeout && (clearTimeout(this.openingTimeout), o.bind(this, i)), t.hasClass(i, "cc-invisible") || (this.options["static"] && (this.element.parentNode.style.maxHeight = ""), this.afterTransition = s.bind(this, i), i.addEventListener(e.transitionEnd, this.afterTransition), t.addClass(i, "cc-invisible"))) }, n.prototype.isOpen = function () { return this.element && "" == this.element.style.display && (!e.hasTransition || !t.hasClass(this.element, "cc-invisible")) }, n.prototype.toggleRevokeButton = function (e) { this.revokeBtn && (this.revokeBtn.style.display = e ? "" : "none") }, n.prototype.revokeChoice = function (e) { this.options.enabled = !0, this.clearStatus(), this.options.onRevokeChoice.call(this), e || this.autoOpen() }, n.prototype.hasAnswered = function (t) { return Object.keys(e.status).indexOf(this.getStatus()) >= 0 }, n.prototype.hasConsented = function (t) { var i = this.getStatus(); return i == e.status.allow || i == e.status.dismiss }, n.prototype.autoOpen = function (e) { !this.hasAnswered() && this.options.enabled && this.open() }, n.prototype.setStatus = function (i) { var n = this.options.cookie, o = t.getCookie(n.name), s = Object.keys(e.status).indexOf(o) >= 0; Object.keys(e.status).indexOf(i) >= 0 ? (t.setCookie(n.name, i, n.expiryDays, n.domain, n.path), this.options.onStatusChange.call(this, i, s)) : this.clearStatus() }, n.prototype.getStatus = function () { return t.getCookie(this.options.cookie.name) }, n.prototype.clearStatus = function () { var e = this.options.cookie; t.setCookie(e.name, "", -1, e.domain, e.path) }, n }(), e.Location = function () { function e(e) { t.deepExtend(this.options = {}, s), t.isPlainObject(e) && t.deepExtend(this.options, e), this.currentServiceIndex = -1 } function i(e, t, i) { var n, o = document.createElement("script"); o.type = "text/" + (e.type || "javascript"), o.src = e.src || e, o.async = !1, o.onreadystatechange = o.onload = function () { var e = o.readyState; clearTimeout(n), t.done || e && !/loaded|complete/.test(e) || (t.done = !0, t(), o.onreadystatechange = o.onload = null) }, document.body.appendChild(o), n = setTimeout(function () { t.done = !0, t(), o.onreadystatechange = o.onload = null }, i) } function n(e, t, i, n, o) { var s = new (window.XMLHttpRequest || window.ActiveXObject)("MSXML2.XMLHTTP.3.0"); if (s.open(n ? "POST" : "GET", e, 1), s.setRequestHeader("X-Requested-With", "XMLHttpRequest"), s.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), Array.isArray(o)) for (var r = 0, a = o.length; r < a; ++r) { var c = o[r].split(":", 2); s.setRequestHeader(c[0].replace(/^\s+|\s+$/g, ""), c[1].replace(/^\s+|\s+$/g, "")) } "function" == typeof t && (s.onreadystatechange = function () { s.readyState > 3 && t(s) }), s.send(n) } function o(e) { return new Error("Error [" + (e.code || "UNKNOWN") + "]: " + e.error) } var s = { timeout: 5e3, services: ["freegeoip", "ipinfo", "maxmind"], serviceDefinitions: { freegeoip: function () { return { url: "//freegeoip.net/json/?callback={callback}", isScript: !0, callback: function (e, t) { try { var i = JSON.parse(t); return i.error ? o(i) : { code: i.country_code } } catch (n) { return o({ error: "Invalid response (" + n + ")" }) } } } }, ipinfo: function () { return { url: "//ipinfo.io", headers: ["Accept: application/json"], callback: function (e, t) { try { var i = JSON.parse(t); return i.error ? o(i) : { code: i.country } } catch (n) { return o({ error: "Invalid response (" + n + ")" }) } } } }, ipinfodb: function (e) { return { url: "//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}", isScript: !0, callback: function (e, t) { try { var i = JSON.parse(t); return "ERROR" == i.statusCode ? o({ error: i.statusMessage }) : { code: i.countryCode } } catch (n) { return o({ error: "Invalid response (" + n + ")" }) } } } }, maxmind: function () { return { url: "//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js", isScript: !0, callback: function (e) { return window.geoip2 ? void geoip2.country(function (t) { try { e({ code: t.country.iso_code }) } catch (i) { e(o(i)) } }, function (t) { e(o(t)) }) : void e(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope")) } } } } }; return e.prototype.getNextService = function () { var e; do e = this.getServiceByIdx(++this.currentServiceIndex); while (this.currentServiceIndex < this.options.services.length && !e); return e }, e.prototype.getServiceByIdx = function (e) { var i = this.options.services[e]; if ("function" == typeof i) { var n = i(); return n.name && t.deepExtend(n, this.options.serviceDefinitions[n.name](n)), n } return "string" == typeof i ? this.options.serviceDefinitions[i]() : t.isPlainObject(i) ? this.options.serviceDefinitions[i.name](i) : null }, e.prototype.locate = function (e, t) { var i = this.getNextService(); return i ? (this.callbackComplete = e, this.callbackError = t, void this.runService(i, this.runNextServiceOnError.bind(this))) : void t(new Error("No services to run")) }, e.prototype.setupUrl = function (e) { var t = this.getCurrentServiceOpts(); return e.url.replace(/\{(.*?)\}/g, function (i, n) { if ("callback" === n) { var o = "callback" + Date.now(); return window[o] = function (t) { e.__JSONP_DATA = JSON.stringify(t) }, o } if (n in t.interpolateUrl) return t.interpolateUrl[n] }) }, e.prototype.runService = function (e, t) { var o = this; if (e && e.url && e.callback) { var s = e.isScript ? i : n, r = this.setupUrl(e); s(r, function (i) { var n = i ? i.responseText : ""; e.__JSONP_DATA && (n = e.__JSONP_DATA, delete e.__JSONP_DATA), o.runServiceCallback.call(o, t, e, n) }, this.options.timeout, e.data, e.headers) } }, e.prototype.runServiceCallback = function (e, t, i) { var n = this, o = function (t) { s || n.onServiceResult.call(n, e, t) }, s = t.callback(o, i); s && this.onServiceResult.call(this, e, s) }, e.prototype.onServiceResult = function (e, t) { t instanceof Error || t && t.error ? e.call(this, t, null) : e.call(this, null, t) }, e.prototype.runNextServiceOnError = function (e, t) { if (e) { this.logError(e); var i = this.getNextService(); i ? this.runService(i, this.runNextServiceOnError.bind(this)) : this.completeService.call(this, this.callbackError, new Error("All services failed")) } else this.completeService.call(this, this.callbackComplete, t) }, e.prototype.getCurrentServiceOpts = function () { var e = this.options.services[this.currentServiceIndex]; return "string" == typeof e ? { name: e } : "function" == typeof e ? e() : t.isPlainObject(e) ? e : {} }, e.prototype.completeService = function (e, t) { this.currentServiceIndex = -1, e && e(t) }, e.prototype.logError = function (e) { var t = this.currentServiceIndex, i = this.getServiceByIdx(t); console.error("The service[" + t + "] (" + i.url + ") responded with the following error", e) }, e }(), e.Law = function () { function e(e) { this.initialise.apply(this, arguments) } var i = { regionalLaw: !0, hasLaw: ["AT", "BE", "BG", "HR", "CZ", "CY", "DK", "EE", "FI", "FR", "DE", "EL", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "SK", "SI", "ES", "SE", "GB", "UK"], revokable: ["HR", "CY", "DK", "EE", "FR", "DE", "LV", "LT", "NL", "PT", "ES"], explicitAction: ["HR", "IT", "ES"] }; return e.prototype.initialise = function (e) { t.deepExtend(this.options = {}, i), t.isPlainObject(e) && t.deepExtend(this.options, e) }, e.prototype.get = function (e) { var t = this.options; return { hasLaw: t.hasLaw.indexOf(e) >= 0, revokable: t.revokable.indexOf(e) >= 0, explicitAction: t.explicitAction.indexOf(e) >= 0 } }, e.prototype.applyLaw = function (e, t) { var i = this.get(t); return i.hasLaw || (e.enabled = !1), this.options.regionalLaw && (i.revokable && (e.revokable = !0), i.explicitAction && (e.dismissOnScroll = !1, e.dismissOnTimeout = !1)), e }, e }(), e.initialise = function (t, i, n) { var o = new e.Law(t.law); i || (i = function () { }), n || (n = function () { }), e.getCountryCode(t, function (n) { delete t.law, delete t.location, n.code && (t = o.applyLaw(t, n.code)), i(new e.Popup(t)) }, function (i) { delete t.law, delete t.location, n(i, new e.Popup(t)) }) }, e.getCountryCode = function (t, i, n) { if (t.law && t.law.countryCode) return void i({ code: t.law.countryCode }); if (t.location) { var o = new e.Location(t.location); return void o.locate(function (e) { i(e || {}) }, n) } i({}) }, e.utils = t, e.hasInitialised = !0, window.cookieconsent = e } }(window.cookieconsent || {});;
!function(e){function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}var t={};__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.i=function(e){return e},__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="/",__webpack_require__(__webpack_require__.s=384)}({343:function(e,t){!function(t,r){var n=function(e,t){"use strict";if(t.getElementsByClassName){var r,n,i=t.documentElement,s=e.Date,a=e.HTMLPictureElement,c=e.addEventListener,o=e.setTimeout,u=e.requestAnimationFrame||o,l=e.requestIdleCallback,d=/^picture$/i,f=["load","error","lazyincluded","_lazyloaded"],p={},g=Array.prototype.forEach,m=function(e,t){return p[t]||(p[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),p[t].test(e.getAttribute("class")||"")&&p[t]},h=function(e,t){m(e,t)||e.setAttribute("class",(e.getAttribute("class")||"").trim()+" "+t)},A=function(e,t){var r;(r=m(e,t))&&e.setAttribute("class",(e.getAttribute("class")||"").replace(r," "))},v=function(e,t,r){var n=r?"addEventListener":"removeEventListener";r&&v(e,t),f.forEach(function(r){e[n](r,t)})},y=function(e,n,i,s,a){var c=t.createEvent("Event");return i||(i={}),i.instance=r,c.initEvent(n,!s,!a),c.detail=i,e.dispatchEvent(c),c},b=function(t,r){var i;!a&&(i=e.picturefill||n.pf)?(r&&r.src&&!t.getAttribute("srcset")&&t.setAttribute("srcset",r.src),i({reevaluate:!0,elements:[t]})):r&&r.src&&(t.src=r.src)},w=function(e,t){return(getComputedStyle(e,null)||{})[t]},z=function(e,t,r){for(r=r||e.offsetWidth;r<n.minSize&&t&&!e._lazysizesWidth;)r=t.offsetWidth,t=t.parentNode;return r},_=function(){var e,r,n=[],i=[],s=n,a=function(){var t=s;for(s=n.length?i:n,e=!0,r=!1;t.length;)t.shift()();e=!1},c=function(n,i){e&&!i?n.apply(this,arguments):(s.push(n),r||(r=!0,(t.hidden?o:u)(a)))};return c._lsFlush=a,c}(),S=function(e,t){return t?function(){_(e)}:function(){var t=this,r=arguments;_(function(){e.apply(t,r)})}},C=function(e){var t,r=0,i=n.throttleDelay,a=n.ricTimeout,c=function(){t=!1,r=s.now(),e()},u=l&&a>49?function(){l(c,{timeout:a}),a!==n.ricTimeout&&(a=n.ricTimeout)}:S(function(){o(c)},!0);return function(e){var n;(e=!0===e)&&(a=33),t||(t=!0,n=i-(s.now()-r),n<0&&(n=0),e||n<9?u():o(u,n))}},E=function(e){var t,r,n=function(){t=null,e()},i=function(){var e=s.now()-r;e<99?o(i,99-e):(l||n)(n)};return function(){r=s.now(),t||(t=o(i,99))}};!function(){var t,r={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};n=e.lazySizesConfig||e.lazysizesConfig||{};for(t in r)t in n||(n[t]=r[t]);e.lazySizesConfig=n,o(function(){n.init&&k()})}();var x=function(){var a,u,l,f,p,z,x,k,M,L,R,P,I=/^img$/i,D=/^iframe$/i,B="onscroll"in e&&!/(gle|ing)bot/.test(navigator.userAgent),W=0,O=0,j=-1,N=function(e){O--,(!e||O<0||!e.target)&&(O=0)},q=function(e){return null==P&&(P="hidden"==w(t.body,"visibility")),P||"hidden"!=w(e.parentNode,"visibility")&&"hidden"!=w(e,"visibility")},F=function(e,r){var n,s=e,a=q(e);for(k-=r,R+=r,M-=r,L+=r;a&&(s=s.offsetParent)&&s!=t.body&&s!=i;)(a=(w(s,"opacity")||1)>0)&&"visible"!=w(s,"overflow")&&(n=s.getBoundingClientRect(),a=L>n.left&&M<n.right&&R>n.top-1&&k<n.bottom+1);return a},$=function(){var e,s,c,o,l,d,p,g,m,h,A,v,y=r.elements;if((f=n.loadMode)&&O<8&&(e=y.length)){for(s=0,j++,h=!n.expand||n.expand<1?i.clientHeight>500&&i.clientWidth>500?500:370:n.expand,r._defEx=h,A=h*n.expFactor,v=n.hFac,P=null,W<A&&O<1&&j>2&&f>2&&!t.hidden?(W=A,j=0):W=f>1&&j>1&&O<6?h:0;s<e;s++)if(y[s]&&!y[s]._lazyRace)if(B)if((g=y[s].getAttribute("data-expand"))&&(d=1*g)||(d=W),m!==d&&(z=innerWidth+d*v,x=innerHeight+d,p=-1*d,m=d),c=y[s].getBoundingClientRect(),(R=c.bottom)>=p&&(k=c.top)<=x&&(L=c.right)>=p*v&&(M=c.left)<=z&&(R||L||M||k)&&(n.loadHidden||q(y[s]))&&(u&&O<3&&!g&&(f<3||j<4)||F(y[s],d))){if(X(y[s]),l=!0,O>9)break}else!l&&u&&!o&&O<4&&j<4&&f>2&&(a[0]||n.preloadAfterLoad)&&(a[0]||!g&&(R||L||M||k||"auto"!=y[s].getAttribute(n.sizesAttr)))&&(o=a[0]||y[s]);else X(y[s]);o&&!l&&X(o)}},H=C($),U=function(e){var t=e.target;if(t._lazyCache)return void delete t._lazyCache;N(e),h(t,n.loadedClass),A(t,n.loadingClass),v(t,G),y(t,"lazyloaded")},Q=S(U),G=function(e){Q({target:e.target})},V=function(e,t){try{e.contentWindow.location.replace(t)}catch(r){e.src=t}},K=function(e){var t,r=e.getAttribute(n.srcsetAttr);(t=n.customMedia[e.getAttribute("data-media")||e.getAttribute("media")])&&e.setAttribute("media",t),r&&e.setAttribute("srcset",r)},J=S(function(e,t,r,i,s){var a,c,u,f,p,m;(p=y(e,"lazybeforeunveil",t)).defaultPrevented||(i&&(r?h(e,n.autosizesClass):e.setAttribute("sizes",i)),c=e.getAttribute(n.srcsetAttr),a=e.getAttribute(n.srcAttr),s&&(u=e.parentNode,f=u&&d.test(u.nodeName||"")),m=t.firesLoad||"src"in e&&(c||a||f),p={target:e},h(e,n.loadingClass),m&&(clearTimeout(l),l=o(N,2500),v(e,G,!0)),f&&g.call(u.getElementsByTagName("source"),K),c?e.setAttribute("srcset",c):a&&!f&&(D.test(e.nodeName)?V(e,a):e.src=a),s&&(c||f)&&b(e,{src:a})),e._lazyRace&&delete e._lazyRace,A(e,n.lazyClass),_(function(){var t=e.complete&&e.naturalWidth>1;m&&!t||(t&&h(e,"ls-is-cached"),U(p),e._lazyCache=!0,o(function(){"_lazyCache"in e&&delete e._lazyCache},9))},!0)}),X=function(e){var t,r=I.test(e.nodeName),i=r&&(e.getAttribute(n.sizesAttr)||e.getAttribute("sizes")),s="auto"==i;(!s&&u||!r||!e.getAttribute("src")&&!e.srcset||e.complete||m(e,n.errorClass)||!m(e,n.lazyClass))&&(t=y(e,"lazyunveilread").detail,s&&T.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,O++,J(e,t,s,i,r))},Y=function(){if(!u){if(s.now()-p<999)return void o(Y,999);var e=E(function(){n.loadMode=3,H()});u=!0,n.loadMode=3,H(),c("scroll",function(){3==n.loadMode&&(n.loadMode=2),e()},!0)}};return{_:function(){p=s.now(),r.elements=t.getElementsByClassName(n.lazyClass),a=t.getElementsByClassName(n.lazyClass+" "+n.preloadClass),c("scroll",H,!0),c("resize",H,!0),e.MutationObserver?new MutationObserver(H).observe(i,{childList:!0,subtree:!0,attributes:!0}):(i.addEventListener("DOMNodeInserted",H,!0),i.addEventListener("DOMAttrModified",H,!0),setInterval(H,999)),c("hashchange",H,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(e){t.addEventListener(e,H,!0)}),/d$|^c/.test(t.readyState)?Y():(c("load",Y),t.addEventListener("DOMContentLoaded",H),o(Y,2e4)),r.elements.length?($(),_._lsFlush()):H()},checkElems:H,unveil:X}}(),T=function(){var e,r=S(function(e,t,r,n){var i,s,a;if(e._lazysizesWidth=n,n+="px",e.setAttribute("sizes",n),d.test(t.nodeName||""))for(i=t.getElementsByTagName("source"),s=0,a=i.length;s<a;s++)i[s].setAttribute("sizes",n);r.detail.dataAttr||b(e,r.detail)}),i=function(e,t,n){var i,s=e.parentNode;s&&(n=z(e,s,n),i=y(e,"lazybeforesizes",{width:n,dataAttr:!!t}),i.defaultPrevented||(n=i.detail.width)&&n!==e._lazysizesWidth&&r(e,s,i,n))},s=function(){var t,r=e.length;if(r)for(t=0;t<r;t++)i(e[t])},a=E(s);return{_:function(){e=t.getElementsByClassName(n.autosizesClass),c("resize",a)},checkElems:a,updateElem:i}}(),k=function(){k.i||(k.i=!0,T._(),x._())};return r={cfg:n,autoSizer:T,loader:x,init:k,uP:b,aC:h,rC:A,hC:m,fire:y,gW:z,rAF:_}}}(t,t.document);t.lazySizes=n,"object"==typeof e&&e.exports&&(e.exports=n)}(window)},344:function(e,t,r){"use strict";function createPlaceholder(e,t){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='"+e+"' height='"+t+"'%3E%3C/svg%3E"}function polyfillCurrentSrc(e){if(e.srcset&&!u&&window.picturefill){var t=window.picturefill._;e[t.ns]&&e[t.ns].evaled||t.fillImg(e,{reselect:!0}),e[t.ns].curSrc||(e[t.ns].supported=!1,t.fillImg(e,{reselect:!0})),e.currentSrc=e[t.ns].curSrc||e.src}}function getStyle(e){for(var t,r=getComputedStyle(e).fontFamily,n={};null!==(t=i.exec(r));)n[t[1]]=t[2];return n}function setPlaceholder(e,t,r){var n=createPlaceholder(t||1,r||0);l.call(e,"src")!==n&&d.call(e,"src",n)}function onImageReady(e,t){e.naturalWidth?t(e):setTimeout(onImageReady,100,e,t)}function fixOne(e){var t=getStyle(e),r=e[n];if(t["object-fit"]=t["object-fit"]||"fill",!r.img){if("fill"===t["object-fit"])return;if(!r.skipTest&&a&&!t["object-position"])return}if(!r.img){r.img=new Image(e.width,e.height),r.img.srcset=l.call(e,"data-ofi-srcset")||e.srcset,r.img.src=l.call(e,"data-ofi-src")||e.src,d.call(e,"data-ofi-src",e.src),e.srcset&&d.call(e,"data-ofi-srcset",e.srcset),setPlaceholder(e,e.naturalWidth||e.width,e.naturalHeight||e.height),e.srcset&&(e.srcset="");try{keepSrcUsable(e)}catch(e){window.console&&console.warn("https://bit.ly/ofi-old-browser")}}polyfillCurrentSrc(r.img),e.style.backgroundImage='url("'+(r.img.currentSrc||r.img.src).replace(/"/g,'\\"')+'")',e.style.backgroundPosition=t["object-position"]||"center",e.style.backgroundRepeat="no-repeat",e.style.backgroundOrigin="content-box",/scale-down/.test(t["object-fit"])?onImageReady(r.img,function(){r.img.naturalWidth>e.width||r.img.naturalHeight>e.height?e.style.backgroundSize="contain":e.style.backgroundSize="auto"}):e.style.backgroundSize=t["object-fit"].replace("none","auto").replace("fill","100% 100%"),onImageReady(r.img,function(t){setPlaceholder(e,t.naturalWidth,t.naturalHeight)})}function keepSrcUsable(e){var t={get:function(t){return e[n].img[t||"src"]},set:function(t,r){return e[n].img[r||"src"]=t,d.call(e,"data-ofi-"+r,t),fixOne(e),t}};Object.defineProperty(e,"src",t),Object.defineProperty(e,"currentSrc",{get:function(){return t.get("currentSrc")}}),Object.defineProperty(e,"srcset",{get:function(){return t.get("srcset")},set:function(e){return t.set(e,"srcset")}})}function fix(e,t){var r=!f&&!e;if(t=t||{},e=e||"img",c&&!t.skipTest||!o)return!1;"img"===e?e=document.getElementsByTagName("img"):"string"==typeof e?e=document.querySelectorAll(e):"length"in e||(e=[e]);for(var i=0;i<e.length;i++)e[i][n]=e[i][n]||{skipTest:t.skipTest},fixOne(e[i]);r&&(document.body.addEventListener("load",function(e){"IMG"===e.target.tagName&&fix(e.target,{skipTest:t.skipTest})},!0),f=!0,e="img"),t.watchMQ&&window.addEventListener("resize",fix.bind(null,e,{skipTest:t.skipTest}))}var n="bfred-it:object-fit-images",i=/(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g,s="undefined"==typeof Image?{style:{"object-position":1}}:new Image,a="object-fit"in s.style,c="object-position"in s.style,o="background-size"in s.style,u="string"==typeof s.currentSrc,l=s.getAttribute,d=s.setAttribute,f=!1;fix.supportsObjectFit=a,fix.supportsObjectPosition=c,function(){function getOfiImageMaybe(e,t){return e[n]&&e[n].img&&("src"===t||"srcset"===t)?e[n].img:e}c||(HTMLImageElement.prototype.getAttribute=function(e){return l.call(getOfiImageMaybe(this,e),e)},HTMLImageElement.prototype.setAttribute=function(e,t){return d.call(getOfiImageMaybe(this,e),e,String(t))})}(),e.exports=fix},345:function(e,t,r){var n;!function(e){var t=navigator.userAgent;e.HTMLPictureElement&&/ecko/.test(t)&&t.match(/rv\:(\d+)/)&&RegExp.$1<45&&addEventListener("resize",function(){var t,r=document.createElement("source"),n=function(e){var t,n,i=e.parentNode;"PICTURE"===i.nodeName.toUpperCase()?(t=r.cloneNode(),i.insertBefore(t,i.firstElementChild),setTimeout(function(){i.removeChild(t)})):(!e._pfLastSize||e.offsetWidth>e._pfLastSize)&&(e._pfLastSize=e.offsetWidth,n=e.sizes,e.sizes+=",100vw",setTimeout(function(){e.sizes=n}))},i=function(){var e,t=document.querySelectorAll("picture > img, img[srcset][sizes]");for(e=0;e<t.length;e++)n(t[e])},s=function(){clearTimeout(t),t=setTimeout(i,99)},a=e.matchMedia&&matchMedia("(orientation: landscape)"),c=function(){s(),a&&a.addListener&&a.addListener(s)};return r.srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",/^[c|i]|d$/.test(document.readyState||"")?c():document.addEventListener("DOMContentLoaded",c),s}())}(window),function(i,s,a){"use strict";function isSpace(e){return" "===e||"\t"===e||"\n"===e||"\f"===e||"\r"===e}function updateMetrics(){x=!1,M=i.devicePixelRatio,T={},k={},l.DPR=M||1,L.width=Math.max(i.innerWidth||0,A.clientWidth),L.height=Math.max(i.innerHeight||0,A.clientHeight),L.vw=L.width/100,L.vh=L.height/100,u=[L.height,L.width,M].join("-"),L.em=l.getEmValue(),L.rem=L.em}function chooseLowRes(e,t,r,n){var i,s,a,c;return"saveData"===y.algorithm?e>2.7?c=r+1:(s=t-r,i=Math.pow(e-.6,1.5),a=s*i,n&&(a+=.1*i),c=e+a):c=r>1?Math.sqrt(e*t):e,c>r}function applyBestCandidate(e){var t,r=l.getSet(e),n=!1;"pending"!==r&&(n=u,r&&(t=l.setRes(r),l.applySetCandidate(t,e))),e[l.ns].evaled=n}function ascendingSort(e,t){return e.res-t.res}function setSrcToCur(e,t,r){var n;return!r&&t&&(r=e[l.ns].sets,r=r&&r[r.length-1]),n=getCandidateForSrc(t,r),n&&(t=l.makeUrl(t),e[l.ns].curSrc=t,e[l.ns].curCan=n,n.res||$(n,n.set.sizes)),n}function getCandidateForSrc(e,t){var r,n,i;if(e&&t)for(i=l.parseSet(t),e=l.makeUrl(e),r=0;r<i.length;r++)if(e===l.makeUrl(i[r].url)){n=i[r];break}return n}function getAllSourceElements(e,t){var r,n,i,s,a=e.getElementsByTagName("source");for(r=0,n=a.length;r<n;r++)i=a[r],i[l.ns]=!0,(s=i.getAttribute("srcset"))&&t.push({srcset:s,media:i.getAttribute("media"),type:i.getAttribute("type"),sizes:i.getAttribute("sizes")})}function parseSrcset(e,t){function collectCharacters(t){var r,n=t.exec(e.substring(o));if(n)return r=n[0],o+=r.length,r}function parseDescriptors(){var e,i,s,a,c,o,l,d,f,p=!1,g={};for(a=0;a<n.length;a++)c=n[a],o=c[c.length-1],l=c.substring(0,c.length-1),d=parseInt(l,10),f=parseFloat(l),O.test(l)&&"w"===o?((e||i)&&(p=!0),0===d?p=!0:e=d):j.test(l)&&"x"===o?((e||i||s)&&(p=!0),f<0?p=!0:i=f):O.test(l)&&"h"===o?((s||i)&&(p=!0),0===d?p=!0:s=d):p=!0;p||(g.url=r,e&&(g.w=e),i&&(g.d=i),s&&(g.h=s),s||i||e||(g.d=1),1===g.d&&(t.has1x=!0),g.set=t,u.push(g))}for(var r,n,i,s,a,c=e.length,o=0,u=[];;){if(collectCharacters(D),o>=c)return u;r=collectCharacters(B),n=[],","===r.slice(-1)?(r=r.replace(W,""),parseDescriptors()):function(){for(collectCharacters(I),i="",s="in descriptor";;){if(a=e.charAt(o),"in descriptor"===s)if(isSpace(a))i&&(n.push(i),i="",s="after descriptor");else{if(","===a)return o+=1,i&&n.push(i),void parseDescriptors();if("("===a)i+=a,s="in parens";else{if(""===a)return i&&n.push(i),void parseDescriptors();i+=a}}else if("in parens"===s)if(")"===a)i+=a,s="in descriptor";else{if(""===a)return n.push(i),void parseDescriptors();i+=a}else if("after descriptor"===s)if(isSpace(a));else{if(""===a)return void parseDescriptors();s="in descriptor",o-=1}o+=1}}()}}function parseSizes(e){var t,r,n,i,s,a,c=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,o=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for(r=function(e){function pushComponent(){r&&(n.push(r),r="")}function pushComponentArray(){n[0]&&(i.push(n),n=[])}for(var t,r="",n=[],i=[],s=0,a=0,c=!1;;){if(""===(t=e.charAt(a)))return pushComponent(),pushComponentArray(),i;if(c){if("*"===t&&"/"===e[a+1]){c=!1,a+=2,pushComponent();continue}a+=1}else{if(isSpace(t)){if(e.charAt(a-1)&&isSpace(e.charAt(a-1))||!r){a+=1;continue}if(0===s){pushComponent(),a+=1;continue}t=" "}else if("("===t)s+=1;else if(")"===t)s-=1;else{if(","===t){pushComponent(),pushComponentArray(),a+=1;continue}if("/"===t&&"*"===e.charAt(a+1)){c=!0,a+=2;continue}}r+=t,a+=1}}}(e),n=r.length,t=0;t<n;t++)if(i=r[t],s=i[i.length-1],function(e){return!!(c.test(e)&&parseFloat(e)>=0)||(!!o.test(e)||("0"===e||"-0"===e||"+0"===e))}(s)){if(a=s,i.pop(),0===i.length)return a;if(i=i.join(" "),l.matchesMedia(i))return a}return"100vw"}s.createElement("picture");var c,o,u,l={},d=!1,f=function(){},p=s.createElement("img"),g=p.getAttribute,m=p.setAttribute,h=p.removeAttribute,A=s.documentElement,v={},y={algorithm:""},b=navigator.userAgent,w=/rident/.test(b)||/ecko/.test(b)&&b.match(/rv\:(\d+)/)&&RegExp.$1>35,z="currentSrc",_=/\s+\+?\d+(e\d+)?w/,S=/(\([^)]+\))?\s*(.+)/,C=i.picturefillCFG,E="font-size:100%!important;",x=!0,T={},k={},M=i.devicePixelRatio,L={px:1,in:96},R=s.createElement("a"),P=!1,I=/^[ \t\n\r\u000c]+/,D=/^[, \t\n\r\u000c]+/,B=/^[^ \t\n\r\u000c]+/,W=/[,]+$/,O=/^\d+$/,j=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,N=function(e,t,r,n){e.addEventListener?e.addEventListener(t,r,n||!1):e.attachEvent&&e.attachEvent("on"+t,r)},q=function(e){var t={};return function(r){return r in t||(t[r]=e(r)),t[r]}},F=function(){var e=/^([\d\.]+)(em|vw|px)$/,t=function(){for(var e=arguments,t=0,r=e[0];++t in e;)r=r.replace(e[t],e[++t]);return r},r=q(function(e){return"return "+t((e||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")+";"});return function(t,n){var i;if(!(t in T))if(T[t]=!1,n&&(i=t.match(e)))T[t]=i[1]*L[i[2]];else try{T[t]=new Function("e",r(t))(L)}catch(e){}return T[t]}}(),$=function(e,t){return e.w?(e.cWidth=l.calcListLength(t||"100vw"),e.res=e.w/e.cWidth):e.res=e.d,e},H=function(e){if(d){var t,r,n,i=e||{};if(i.elements&&1===i.elements.nodeType&&("IMG"===i.elements.nodeName.toUpperCase()?i.elements=[i.elements]:(i.context=i.elements,i.elements=null)),t=i.elements||l.qsa(i.context||s,i.reevaluate||i.reselect?l.sel:l.selShort),n=t.length){for(l.setupRun(i),P=!0,r=0;r<n;r++)l.fillImg(t[r],i);l.teardownRun(i)}}};i.console&&console.warn,z in p||(z="src"),v["image/jpeg"]=!0,v["image/gif"]=!0,v["image/png"]=!0,v["image/svg+xml"]=s.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),l.ns=("pf"+(new Date).getTime()).substr(0,9),l.supSrcset="srcset"in p,l.supSizes="sizes"in p,l.supPicture=!!i.HTMLPictureElement,l.supSrcset&&l.supPicture&&!l.supSizes&&function(e){p.srcset="data:,a",e.src="data:,a",l.supSrcset=p.complete===e.complete,l.supPicture=l.supSrcset&&l.supPicture}(s.createElement("img")),l.supSrcset&&!l.supSizes?function(){var e="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",t=s.createElement("img"),r=function(){2===t.width&&(l.supSizes=!0),o=l.supSrcset&&!l.supSizes,d=!0,setTimeout(H)};t.onload=r,t.onerror=r,t.setAttribute("sizes","9px"),t.srcset=e+" 1w,data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw== 9w",t.src=e}():d=!0,l.selShort="picture>img,img[srcset]",l.sel=l.selShort,l.cfg=y,l.DPR=M||1,l.u=L,l.types=v,l.setSize=f,l.makeUrl=q(function(e){return R.href=e,R.href}),l.qsa=function(e,t){return"querySelector"in e?e.querySelectorAll(t):[]},l.matchesMedia=function(){return i.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?l.matchesMedia=function(e){return!e||matchMedia(e).matches}:l.matchesMedia=l.mMQ,l.matchesMedia.apply(this,arguments)},l.mMQ=function(e){return!e||F(e)},l.calcLength=function(e){var t=F(e,!0)||!1;return t<0&&(t=!1),t},l.supportsType=function(e){return!e||v[e]},l.parseSize=q(function(e){var t=(e||"").match(S);return{media:t&&t[1],length:t&&t[2]}}),l.parseSet=function(e){return e.cands||(e.cands=parseSrcset(e.srcset,e)),e.cands},l.getEmValue=function(){var e;if(!c&&(e=s.body)){var t=s.createElement("div"),r=A.style.cssText,n=e.style.cssText;t.style.cssText="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",A.style.cssText=E,e.style.cssText=E,e.appendChild(t),c=t.offsetWidth,e.removeChild(t),c=parseFloat(c,10),A.style.cssText=r,e.style.cssText=n}return c||16},l.calcListLength=function(e){if(!(e in k)||y.uT){var t=l.calcLength(parseSizes(e));k[e]=t||L.width}return k[e]},l.setRes=function(e){var t;if(e){t=l.parseSet(e);for(var r=0,n=t.length;r<n;r++)$(t[r],e.sizes)}return t},l.setRes.res=$,l.applySetCandidate=function(e,t){if(e.length){var r,n,i,s,a,c,o,u,d,f=t[l.ns],p=l.DPR;if(c=f.curSrc||t[z],o=f.curCan||setSrcToCur(t,c,e[0].set),o&&o.set===e[0].set&&((d=w&&!t.complete&&o.res-.1>p)||(o.cached=!0,o.res>=p&&(a=o))),!a)for(e.sort(ascendingSort),s=e.length,a=e[s-1],n=0;n<s;n++)if(r=e[n],r.res>=p){i=n-1,a=e[i]&&(d||c!==l.makeUrl(r.url))&&chooseLowRes(e[i].res,r.res,p,e[i].cached)?e[i]:r;break}a&&(u=l.makeUrl(a.url),f.curSrc=u,f.curCan=a,u!==c&&l.setSrc(t,a),l.setSize(t))}},l.setSrc=function(e,t){var r;e.src=t.url,"image/svg+xml"===t.set.type&&(r=e.style.width,e.style.width=e.offsetWidth+1+"px",e.offsetWidth+1&&(e.style.width=r))},l.getSet=function(e){var t,r,n,i=!1,s=e[l.ns].sets;for(t=0;t<s.length&&!i;t++)if(r=s[t],r.srcset&&l.matchesMedia(r.media)&&(n=l.supportsType(r.type))){"pending"===n&&(r=n),i=r;break}return i},l.parseSets=function(e,t,r){var n,i,s,a,c=t&&"PICTURE"===t.nodeName.toUpperCase(),u=e[l.ns];(void 0===u.src||r.src)&&(u.src=g.call(e,"src"),u.src?m.call(e,"data-pfsrc",u.src):h.call(e,"data-pfsrc")),(void 0===u.srcset||r.srcset||!l.supSrcset||e.srcset)&&(n=g.call(e,"srcset"),u.srcset=n,a=!0),u.sets=[],c&&(u.pic=!0,getAllSourceElements(t,u.sets)),u.srcset?(i={srcset:u.srcset,sizes:g.call(e,"sizes")},u.sets.push(i),(s=(o||u.src)&&_.test(u.srcset||""))||!u.src||getCandidateForSrc(u.src,i)||i.has1x||(i.srcset+=", "+u.src,i.cands.push({url:u.src,d:1,set:i}))):u.src&&u.sets.push({srcset:u.src,sizes:null}),u.curCan=null,u.curSrc=void 0,u.supported=!(c||i&&!l.supSrcset||s&&!l.supSizes),a&&l.supSrcset&&!u.supported&&(n?(m.call(e,"data-pfsrcset",n),e.srcset=""):h.call(e,"data-pfsrcset")),u.supported&&!u.srcset&&(!u.src&&e.src||e.src!==l.makeUrl(u.src))&&(null===u.src?e.removeAttribute("src"):e.src=u.src),u.parsed=!0},l.fillImg=function(e,t){var r,n=t.reselect||t.reevaluate;e[l.ns]||(e[l.ns]={}),r=e[l.ns],(n||r.evaled!==u)&&(r.parsed&&!t.reevaluate||l.parseSets(e,e.parentNode,t),r.supported?r.evaled=u:applyBestCandidate(e))},l.setupRun=function(){P&&!x&&M===i.devicePixelRatio||updateMetrics()},l.supPicture?(H=f,l.fillImg=f):function(){var e,t=i.attachEvent?/d$|^c/:/d$|^c|^i/,r=function(){var i=s.readyState||"";n=setTimeout(r,"loading"===i?200:999),s.body&&(l.fillImgs(),(e=e||t.test(i))&&clearTimeout(n))},n=setTimeout(r,s.body?9:99),a=A.clientHeight,c=function(){x=Math.max(i.innerWidth||0,A.clientWidth)!==L.width||A.clientHeight!==a,a=A.clientHeight,x&&l.fillImgs()};N(i,"resize",function(e,t){var r,n,i=function(){var s=new Date-n;s<t?r=setTimeout(i,t-s):(r=null,e())};return function(){n=new Date,r||(r=setTimeout(i,t))}}(c,99)),N(s,"readystatechange",r)}(),l.picturefill=H,l.fillImgs=H,l.teardownRun=f,H._=l,i.picturefillCFG={pf:l,push:function(e){var t=e.shift();"function"==typeof l[t]?l[t].apply(l,e):(y[t]=e[0],P&&l.fillImgs({reselect:!0}))}};for(;C&&C.length;)i.picturefillCFG.push(C.shift());i.picturefill=H,"object"==typeof e&&"object"==typeof e.exports?e.exports=H:void 0!==(n=function(){return H}.call(t,r,t,e))&&(e.exports=n),l.supPicture||(v["image/webp"]=function(e,t){var r=new i.Image;return r.onerror=function(){v[e]=!1,H()},r.onload=function(){v[e]=1===r.width,H()},r.src=t,"pending"}("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))}(window,document)},384:function(e,t,r){"use strict";r(345),r(343);var n=r(344);(0,function(e){return e&&e.__esModule?e:{default:e}}(n).default)({watchMQ:!0})}});;

$(document).ready(function () {
    // sites dropdown
    $('.sites-link__cta').click(function () {
        $('.sites-link__dropdown').slideToggle();

        var ctalink = this;
        if ($(ctalink).attr("aria-expanded") == "true") {
            $(ctalink).attr("aria-expanded", "false");
        }
        else {
            $(ctalink).attr("aria-expanded", "true");
        }

        if ($(ctalink).next().next(".sites-link__dropdown").attr("aria-hidden") == "true") {
            $(ctalink).next().next(".sites-link__dropdown").attr("aria-hidden", "false");
        }
        else {
            $(ctalink).next().next(".sites-link__dropdown").attr("aria-hidden", "true");
        }

    })

    // sites dropdown close
    $('.sites-link__close a').click(function () {
        $('.sites-link__dropdown').slideUp();
        $('.sites-link__cta').attr("aria-expanded", "false");
        $('.sites-link__cta').next("ul").attr("aria-hidden", "true");
    })

    // sites dropdown close on  click outside
    $(document).mouseup(function (e) {
        var container = $(".sites-link");
        if (!container.is(e.target) && container.has(e.target).length === 0) {
            $('.sites-link__dropdown').slideUp();
            $('.sites-link__cta').attr("aria-expanded", "false");
            $('.sites-link__cta').next().next("ul").attr("aria-hidden", "true");
        }
    });


    // Dropdown menus display under the main menu in mobile view
    function moveDiv() {
        if ($(window).outerWidth() < 1024) {
            $('.top-navigation-container__right').appendTo('.navigation__mobile-wrapper');
        } else {
            $('.top-navigation-container__right').appendTo('.top-navigation-container');
        }
    }
    moveDiv();
    $(window).resize(moveDiv);

    // Custom dropdown menus for utility navigation

    $('.linkCta').click(function () {
        var that = this;

        $('.linkCta').each(function () {
            if (this != that) {
                if ($(this).attr("aria-expanded") == "true") {
                    //do something
                    $(this).next("ul").slideToggle('fast');
                    $(this).attr("aria-expanded", "false");
                    $(this).next("ul").attr("aria-hidden", "true");
                }
            }


        });

        if ($(that).attr("aria-expanded") == "true") {
            $(that).attr("aria-expanded", "false");
        }
        else {
            $(that).attr("aria-expanded", "true");
        }

        if ($(that).next("ul").attr("aria-hidden") == "true") {
            $(that).next("ul").attr("aria-hidden", "false");
        }
        else {
            $(that).next("ul").attr("aria-hidden", "true");
        }

        $(that).next("ul").slideToggle('fast');



    })

    //Utility navigation close on click on out side
    $(document).mouseup(function (e) {
        var container123 = $(".utility-dropdown");
        if (!container123.is(e.target) && container123.has(e.target).length === 0) {
            $('.utility-dropdown ul').slideUp('fast');
            $('.linkCta').attr("aria-expanded", "false");
            $('.linkCta').next("ul").attr("aria-hidden", "true");
        }
    });

    // dropdown close on focus out
    $('.sites-link__close a').on('keydown', function (e) {
        //on pressing tab key
        if (e.which == 9) {
            if (!e.shiftKey) {
                $('.sites-link__dropdown').slideUp();
                $('.sites-link__cta').attr("aria-expanded", "false");
                $('.sites-link__cta').next().next("ul").attr("aria-hidden", "true");
            }
        }
    });
    $('.sites-link > a').on('keydown', function (e) {
        //on pressing tab key
        if (e.which == 9) {
            if (e.shiftKey) {
                $('.sites-link__dropdown').slideUp();
                $('.sites-link__cta').attr("aria-expanded", "false");
                $('.sites-link__cta').next().next("ul").attr("aria-hidden", "true");
            }
        }
    });

    $('.utility-dropdown-data li:last-child a').on('keydown', function (e) {
        //on pressing tab key
        if (e.which == 9) {
            if (!e.shiftKey) {
                $('.utility-dropdown ul').slideUp('fast');
                $('.linkCta').attr("aria-expanded", "false");
                $('.linkCta').next("ul").attr("aria-hidden", "true");
            }
        }
    });

    $('.utility-dropdown > a').on('keydown', function (e) {
        //on pressing tab key
        if (e.which == 9) {
            if (e.shiftKey) {
                $('.utility-dropdown ul').slideUp('fast');
                $('.linkCta').attr("aria-expanded", "false");
                $('.linkCta').next("ul").attr("aria-hidden", "true");
            }
        }
    });
});
