"use strict";
var getArrayOfElements = function (n) {
        return Array.prototype.slice.call(document.querySelectorAll(n))
    },
    getUrlParameter = function (n) {
        n = n.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
        var i = new RegExp("[\\?&]" + n + "=([^&#]*)"),
            t = i.exec(location.search);
        return t === null ? "" : decodeURIComponent(t[1].replace(/\+/g, " "))
    },
    isSafari = function () {
        var n = navigator.userAgent.toLowerCase().indexOf("safari/") > -1;
        n && document.body.classList.add("safari-ios")
    };
document.addEventListener("DOMContentLoaded", function () {
    var mx = document.getElementById("menu_btn"),
        t = document.getElementById("navTrigger"),
        r = document.getElementById("triggerText"),
        u = document.getElementById("navigation"),
        h = getArrayOfElements("[data-meganavlist]"),
        c = getArrayOfElements("[data-login]"),
        f = document.getElementById("cookiePolicy"),
        l = getArrayOfElements("[data-modal-bg]"),
        i, s, n;
    document.addEventListener("scroll", function () {
        window.scrollY > 80 ? document.body.classList.add("body--scrolled") : document.body.classList.remove("body--scrolled")
    });
    t.addEventListener("click", function () {
        u.classList.toggle("active");
        document.body.classList.toggle("sidebar-open");
      
    });
    l.map(function (n) {
        n.addEventListener("click", function () {
            document.body.classList.toggle("sidebar-open");
            u.classList.remove("active");
            e(t, r)
        })
    });
    h.map(function (n) {
        n.addEventListener("click", function () {
            n.classList.toggle("active")
        })
    });
    c.map(function (n) {
        n.addEventListener("click", function () {
            n.classList.toggle("active")
        })
    });
    var o = function (n, t, i) {
            var r, u;
            i ? (r = new Date, r.setTime(r.getTime() + i * 864e5), u = "; expires=" + r.toGMTString()) : u = "";
            document.cookie = n + "=" + t + u + "; path=/"
        },
        a = function (n) {
            for (var t, r = n + "=", u = document.cookie.split(";"), i = 0; i < u.length; i++) {
                for (t = u[i]; t.charAt(0) == " ";) t = t.substring(1, t.length);
                if (t.indexOf(r) == 0) return t.substring(r.length, t.length)
            }
            return null
        },
        y = function (n) {
            o(n, "", -1)
        },
        v = function () {
            var n = a("cookieAccepted");
            (n != null || n != undefined) && document.body.classList.add("hide-cookies")
        };
    v();
    f && f.addEventListener("click", function () {
        document.body.classList.add("hide-cookies");
        o("cookieAccepted", !0, 7)
    });
    i = getArrayOfElements("[data-dprbutton]");
    s = function () {
        i.length > 0 && i.map(function (n) {
            console.log(n);
            n.addEventListener("click", function () {
                console.log(n.attributes);
                dataLayer.push({
                    productID: n.attributes["data-dprbutton"].value
                });
                dataLayer.push({
                    event: "DPRClick"
                })
            })
        })
    };
    s();
    $(".home-slider").slick({
        dots: !1,
        infinite: !1,
        arrows: !1,
        speed: 300,
        centerMode: !1,
        variableWidth: !0,
        draggable: !1,
        responsive: [{
            breakpoint: 1200,
            settings: {
                draggable: !0
            }
        }]
    });
    n = $(".testimonial-slider");
    n.slick({
        fade: !0,
        arrows: !1
    });
    Array.from(document.getElementsByClassName("slider-buttons__next")).forEach(function (t) {
        t.addEventListener("click", function () {
            n.slick("slickNext")
        })
    });
    Array.from(document.getElementsByClassName("slider-buttons__prev")).forEach(function (t) {
        t.addEventListener("click", function () {
            n.slick("slickPrev")
        })
    })
})