]> _ Git - fluidbook-html5.git/commitdiff
wip #4319 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 2 Mar 2021 17:15:08 +0000 (18:15 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 2 Mar 2021 17:15:08 +0000 (18:15 +0100)
js/libs/fluidbook/cart/fluidbook.cart.grandvision.js
js/libs/fluidbook/fluidbook.menu.js
js/libs/perfect-scrollbar/perfect-scrollbar.js [new file with mode: 0644]
js/libs/perfect-scrollbar/perfect-scrollbar.min.js [deleted file]
style/cart/grandvision.less

index 6e846608912e454162abdc801e1efb0df419ae21..d933c3f7802f8ca3dcec1529b241114e1bfa61d2 100644 (file)
@@ -264,7 +264,7 @@ FluidbookCartGrandVision.prototype = {
             });
         });
 
-      //  $("#grandvision-selection .items").perfectScrollbar();
+      $("#grandvision-selection .items").perfectScrollbar();
 
         this.setBox();
         this.initSortable();
index 120d095bacb92b03d1e585c403b68c8d642fc4e7..f6ac12a6252903de687a5241d4f1a41fbc690d2c 100644 (file)
@@ -782,9 +782,9 @@ FluidbookMenu.prototype = {
                 h = rh * s;
                 w = rw * s;
                 $("#grandvision-cart").css('transform', 'scale(' + s + ')');
-                // setTimeout(function () {
-                //     $("#grandvision-selection .items").perfectScrollbar('update');
-                // }, 200);
+                setTimeout(function () {
+                    $("#grandvision-selection .items").perfectScrollbar('update');
+                }, 200);
                 break;
             case 'bookmarks':
                 if (this.fluidbook.mobilefirst.enabled) {
diff --git a/js/libs/perfect-scrollbar/perfect-scrollbar.js b/js/libs/perfect-scrollbar/perfect-scrollbar.js
new file mode 100644 (file)
index 0000000..194202a
--- /dev/null
@@ -0,0 +1,2698 @@
+/*!
+ * perfect-scrollbar v1.5.0
+ * Copyright 2020 Hyunje Jun, MDBootstrap and Contributors
+ * Licensed under MIT
+ */
+
+(function (global, factory) {
+    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+        typeof define === 'function' && define.amd ? define(factory) :
+            (global = global || self, global.PerfectScrollbar = factory());
+}(this, (function () { 'use strict';
+
+    function get(element) {
+        return getComputedStyle(element);
+    }
+
+    function set(element, obj) {
+        for (var key in obj) {
+            var val = obj[key];
+            if (typeof val === 'number') {
+                val = val + "px";
+            }
+            element.style[key] = val;
+        }
+        return element;
+    }
+
+    function div(className) {
+        var div = document.createElement('div');
+        div.className = className;
+        return div;
+    }
+
+    var elMatches =
+        typeof Element !== 'undefined' &&
+        (Element.prototype.matches ||
+            Element.prototype.webkitMatchesSelector ||
+            Element.prototype.mozMatchesSelector ||
+            Element.prototype.msMatchesSelector);
+
+    function matches(element, query) {
+        if (!elMatches) {
+            throw new Error('No element matching method supported');
+        }
+
+        return elMatches.call(element, query);
+    }
+
+    function remove(element) {
+        if (element.remove) {
+            element.remove();
+        } else {
+            if (element.parentNode) {
+                element.parentNode.removeChild(element);
+            }
+        }
+    }
+
+    function queryChildren(element, selector) {
+        return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
+        );
+    }
+
+    var cls = {
+        main: 'ps',
+        rtl: 'ps__rtl',
+        element: {
+            thumb: function (x) { return ("ps__thumb-" + x); },
+            rail: function (x) { return ("ps__rail-" + x); },
+            consuming: 'ps__child--consume',
+        },
+        state: {
+            focus: 'ps--focus',
+            clicking: 'ps--clicking',
+            active: function (x) { return ("ps--active-" + x); },
+            scrolling: function (x) { return ("ps--scrolling-" + x); },
+        },
+    };
+
+    /*
+     * Helper methods
+     */
+    var scrollingClassTimeout = { x: null, y: null };
+
+    function addScrollingClass(i, x) {
+        var classList = i.element.classList;
+        var className = cls.state.scrolling(x);
+
+        if (classList.contains(className)) {
+            clearTimeout(scrollingClassTimeout[x]);
+        } else {
+            classList.add(className);
+        }
+    }
+
+    function removeScrollingClass(i, x) {
+        scrollingClassTimeout[x] = setTimeout(
+            function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
+            i.settings.scrollingThreshold
+        );
+    }
+
+    function setScrollingClassInstantly(i, x) {
+        addScrollingClass(i, x);
+        removeScrollingClass(i, x);
+    }
+
+    var EventElement = function EventElement(element) {
+        this.element = element;
+        this.handlers = {};
+    };
+
+    var prototypeAccessors = { isEmpty: { configurable: true } };
+
+    EventElement.prototype.bind = function bind (eventName, handler) {
+        if (typeof this.handlers[eventName] === 'undefined') {
+            this.handlers[eventName] = [];
+        }
+        this.handlers[eventName].push(handler);
+        this.element.addEventListener(eventName, handler, false);
+    };
+
+    EventElement.prototype.unbind = function unbind (eventName, target) {
+        var this$1 = this;
+
+        this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
+            if (target && handler !== target) {
+                return true;
+            }
+            this$1.element.removeEventListener(eventName, handler, false);
+            return false;
+        });
+    };
+
+    EventElement.prototype.unbindAll = function unbindAll () {
+        for (var name in this.handlers) {
+            this.unbind(name);
+        }
+    };
+
+    prototypeAccessors.isEmpty.get = function () {
+        var this$1 = this;
+
+        return Object.keys(this.handlers).every(
+            function (key) { return this$1.handlers[key].length === 0; }
+        );
+    };
+
+    Object.defineProperties( EventElement.prototype, prototypeAccessors );
+
+    var EventManager = function EventManager() {
+        this.eventElements = [];
+    };
+
+    EventManager.prototype.eventElement = function eventElement (element) {
+        var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
+        if (!ee) {
+            ee = new EventElement(element);
+            this.eventElements.push(ee);
+        }
+        return ee;
+    };
+
+    EventManager.prototype.bind = function bind (element, eventName, handler) {
+        this.eventElement(element).bind(eventName, handler);
+    };
+
+    EventManager.prototype.unbind = function unbind (element, eventName, handler) {
+        var ee = this.eventElement(element);
+        ee.unbind(eventName, handler);
+
+        if (ee.isEmpty) {
+            // remove
+            this.eventElements.splice(this.eventElements.indexOf(ee), 1);
+        }
+    };
+
+    EventManager.prototype.unbindAll = function unbindAll () {
+        this.eventElements.forEach(function (e) { return e.unbindAll(); });
+        this.eventElements = [];
+    };
+
+    EventManager.prototype.once = function once (element, eventName, handler) {
+        var ee = this.eventElement(element);
+        var onceHandler = function (evt) {
+            ee.unbind(eventName, onceHandler);
+            handler(evt);
+        };
+        ee.bind(eventName, onceHandler);
+    };
+
+    function createEvent(name) {
+        if (typeof window.CustomEvent === 'function') {
+            return new CustomEvent(name);
+        } else {
+            var evt = document.createEvent('CustomEvent');
+            evt.initCustomEvent(name, false, false, undefined);
+            return evt;
+        }
+    }
+
+    function processScrollDiff(
+        i,
+        axis,
+        diff,
+        useScrollingClass,
+        forceFireReachEvent
+    ) {
+        if ( useScrollingClass === void 0 ) useScrollingClass = true;
+        if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
+
+        var fields;
+        if (axis === 'top') {
+            fields = [
+                'contentHeight',
+                'containerHeight',
+                'scrollTop',
+                'y',
+                'up',
+                'down' ];
+        } else if (axis === 'left') {
+            fields = [
+                'contentWidth',
+                'containerWidth',
+                'scrollLeft',
+                'x',
+                'left',
+                'right' ];
+        } else {
+            throw new Error('A proper axis should be provided');
+        }
+
+        processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
+    }
+
+    function processScrollDiff$1(
+        i,
+        diff,
+        ref,
+        useScrollingClass,
+        forceFireReachEvent
+    ) {
+        var contentHeight = ref[0];
+        var containerHeight = ref[1];
+        var scrollTop = ref[2];
+        var y = ref[3];
+        var up = ref[4];
+        var down = ref[5];
+        if ( useScrollingClass === void 0 ) useScrollingClass = true;
+        if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
+
+        var element = i.element;
+
+        // reset reach
+        i.reach[y] = null;
+
+        // 1 for subpixel rounding
+        if (element[scrollTop] < 1) {
+            i.reach[y] = 'start';
+        }
+
+        // 1 for subpixel rounding
+        if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
+            i.reach[y] = 'end';
+        }
+
+        if (diff) {
+            element.dispatchEvent(createEvent(("ps-scroll-" + y)));
+
+            if (diff < 0) {
+                element.dispatchEvent(createEvent(("ps-scroll-" + up)));
+            } else if (diff > 0) {
+                element.dispatchEvent(createEvent(("ps-scroll-" + down)));
+            }
+
+            if (useScrollingClass) {
+                setScrollingClassInstantly(i, y);
+            }
+        }
+
+        if (i.reach[y] && (diff || forceFireReachEvent)) {
+            element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
+        }
+    }
+
+    function toInt(x) {
+        return parseInt(x, 10) || 0;
+    }
+
+    function isEditable(el) {
+        return (
+            matches(el, 'input,[contenteditable]') ||
+            matches(el, 'select,[contenteditable]') ||
+            matches(el, 'textarea,[contenteditable]') ||
+            matches(el, 'button,[contenteditable]')
+        );
+    }
+
+    function outerWidth(element) {
+        var styles = get(element);
+        return (
+            toInt(styles.width) +
+            toInt(styles.paddingLeft) +
+            toInt(styles.paddingRight) +
+            toInt(styles.borderLeftWidth) +
+            toInt(styles.borderRightWidth)
+        );
+    }
+
+    var env = {
+        isWebKit:
+            typeof document !== 'undefined' &&
+            'WebkitAppearance' in document.documentElement.style,
+        supportsTouch:
+            typeof window !== 'undefined' &&
+            ('ontouchstart' in window ||
+                ('maxTouchPoints' in window.navigator &&
+                    window.navigator.maxTouchPoints > 0) ||
+                (window.DocumentTouch && document instanceof window.DocumentTouch)),
+        supportsIePointer:
+            typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
+        isChrome:
+            typeof navigator !== 'undefined' &&
+            /Chrome/i.test(navigator && navigator.userAgent),
+    };
+
+    function updateGeometry(i) {
+        var element = i.element;
+        var roundedScrollTop = Math.floor(element.scrollTop);
+        var rect = element.getBoundingClientRect();
+
+        i.containerWidth = Math.ceil(rect.width);
+        i.containerHeight = Math.ceil(rect.height);
+        i.contentWidth = element.scrollWidth;
+        i.contentHeight = element.scrollHeight;
+
+        if (!element.contains(i.scrollbarXRail)) {
+            // clean up and append
+            queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
+            );
+            element.appendChild(i.scrollbarXRail);
+        }
+        if (!element.contains(i.scrollbarYRail)) {
+            // clean up and append
+            queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
+            );
+            element.appendChild(i.scrollbarYRail);
+        }
+
+        if (
+            !i.settings.suppressScrollX &&
+            i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
+        ) {
+            i.scrollbarXActive = true;
+            i.railXWidth = i.containerWidth - i.railXMarginWidth;
+            i.railXRatio = i.containerWidth / i.railXWidth;
+            i.scrollbarXWidth = getThumbSize(
+                i,
+                toInt((i.railXWidth * i.containerWidth) / i.contentWidth)
+            );
+            i.scrollbarXLeft = toInt(
+                ((i.negativeScrollAdjustment + element.scrollLeft) *
+                    (i.railXWidth - i.scrollbarXWidth)) /
+                (i.contentWidth - i.containerWidth)
+            );
+        } else {
+            i.scrollbarXActive = false;
+        }
+
+        if (
+            !i.settings.suppressScrollY &&
+            i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
+        ) {
+            i.scrollbarYActive = true;
+            i.railYHeight = i.containerHeight - i.railYMarginHeight;
+            i.railYRatio = i.containerHeight / i.railYHeight;
+            i.scrollbarYHeight = getThumbSize(
+                i,
+                toInt((i.railYHeight * i.containerHeight) / i.contentHeight)
+            );
+            i.scrollbarYTop = toInt(
+                (roundedScrollTop * (i.railYHeight - i.scrollbarYHeight)) /
+                (i.contentHeight - i.containerHeight)
+            );
+        } else {
+            i.scrollbarYActive = false;
+        }
+
+        if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
+            i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
+        }
+        if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
+            i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
+        }
+
+        updateCss(element, i);
+
+        if (i.scrollbarXActive) {
+            element.classList.add(cls.state.active('x'));
+        } else {
+            element.classList.remove(cls.state.active('x'));
+            i.scrollbarXWidth = 0;
+            i.scrollbarXLeft = 0;
+            element.scrollLeft = i.isRtl === true ? i.contentWidth : 0;
+        }
+        if (i.scrollbarYActive) {
+            element.classList.add(cls.state.active('y'));
+        } else {
+            element.classList.remove(cls.state.active('y'));
+            i.scrollbarYHeight = 0;
+            i.scrollbarYTop = 0;
+            element.scrollTop = 0;
+        }
+    }
+
+    function getThumbSize(i, thumbSize) {
+        if (i.settings.minScrollbarLength) {
+            thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
+        }
+        if (i.settings.maxScrollbarLength) {
+            thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
+        }
+        return thumbSize;
+    }
+
+    function updateCss(element, i) {
+        var xRailOffset = { width: i.railXWidth };
+        var roundedScrollTop = Math.floor(element.scrollTop);
+
+        if (i.isRtl) {
+            xRailOffset.left =
+                i.negativeScrollAdjustment +
+                element.scrollLeft +
+                i.containerWidth -
+                i.contentWidth;
+        } else {
+            xRailOffset.left = element.scrollLeft;
+        }
+        if (i.isScrollbarXUsingBottom) {
+            xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
+        } else {
+            xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
+        }
+        set(i.scrollbarXRail, xRailOffset);
+
+        var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
+        if (i.isScrollbarYUsingRight) {
+            if (i.isRtl) {
+                yRailOffset.right =
+                    i.contentWidth -
+                    (i.negativeScrollAdjustment + element.scrollLeft) -
+                    i.scrollbarYRight -
+                    i.scrollbarYOuterWidth -
+                    9;
+            } else {
+                yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
+            }
+        } else {
+            if (i.isRtl) {
+                yRailOffset.left =
+                    i.negativeScrollAdjustment +
+                    element.scrollLeft +
+                    i.containerWidth * 2 -
+                    i.contentWidth -
+                    i.scrollbarYLeft -
+                    i.scrollbarYOuterWidth;
+            } else {
+                yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
+            }
+        }
+        set(i.scrollbarYRail, yRailOffset);
+
+        set(i.scrollbarX, {
+            left: i.scrollbarXLeft,
+            width: i.scrollbarXWidth - i.railBorderXWidth,
+        });
+        set(i.scrollbarY, {
+            top: i.scrollbarYTop,
+            height: i.scrollbarYHeight - i.railBorderYWidth,
+        });
+    }
+
+    function clickRail(i) {
+        var element = i.element;
+
+        i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
+        i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
+            var positionTop =
+                e.pageY -
+                window.pageYOffset -
+                i.scrollbarYRail.getBoundingClientRect().top;
+            var direction = positionTop > i.scrollbarYTop ? 1 : -1;
+
+            i.element.scrollTop += direction * i.containerHeight;
+            updateGeometry(i);
+
+            e.stopPropagation();
+        });
+
+        i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
+        i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
+            var positionLeft =
+                e.pageX -
+                window.pageXOffset -
+                i.scrollbarXRail.getBoundingClientRect().left;
+            var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
+
+            i.element.scrollLeft += direction * i.containerWidth;
+            updateGeometry(i);
+
+            e.stopPropagation();
+        });
+    }
+
+    function dragThumb(i) {
+        bindMouseScrollHandler(i, [
+            'containerWidth',
+            'contentWidth',
+            'pageX',
+            'railXWidth',
+            'scrollbarX',
+            'scrollbarXWidth',
+            'scrollLeft',
+            'x',
+            'scrollbarXRail' ]);
+        bindMouseScrollHandler(i, [
+            'containerHeight',
+            'contentHeight',
+            'pageY',
+            'railYHeight',
+            'scrollbarY',
+            'scrollbarYHeight',
+            'scrollTop',
+            'y',
+            'scrollbarYRail' ]);
+    }
+
+    function bindMouseScrollHandler(
+        i,
+        ref
+    ) {
+        var containerHeight = ref[0];
+        var contentHeight = ref[1];
+        var pageY = ref[2];
+        var railYHeight = ref[3];
+        var scrollbarY = ref[4];
+        var scrollbarYHeight = ref[5];
+        var scrollTop = ref[6];
+        var y = ref[7];
+        var scrollbarYRail = ref[8];
+
+        var element = i.element;
+
+        var startingScrollTop = null;
+        var startingMousePageY = null;
+        var scrollBy = null;
+
+        function mouseMoveHandler(e) {
+            if (e.touches && e.touches[0]) {
+                e[pageY] = e.touches[0].pageY;
+            }
+            element[scrollTop] =
+                startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
+            addScrollingClass(i, y);
+            updateGeometry(i);
+
+            e.stopPropagation();
+            e.preventDefault();
+        }
+
+        function mouseUpHandler() {
+            removeScrollingClass(i, y);
+            i[scrollbarYRail].classList.remove(cls.state.clicking);
+            i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
+        }
+
+        function bindMoves(e, touchMode) {
+            startingScrollTop = element[scrollTop];
+            if (touchMode && e.touches) {
+                e[pageY] = e.touches[0].pageY;
+            }
+            startingMousePageY = e[pageY];
+            scrollBy =
+                (i[contentHeight] - i[containerHeight]) /
+                (i[railYHeight] - i[scrollbarYHeight]);
+            if (!touchMode) {
+                i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
+                i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
+                e.preventDefault();
+            } else {
+                i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler);
+            }
+
+            i[scrollbarYRail].classList.add(cls.state.clicking);
+
+            e.stopPropagation();
+        }
+
+        i.event.bind(i[scrollbarY], 'mousedown', function (e) {
+            bindMoves(e);
+        });
+        i.event.bind(i[scrollbarY], 'touchstart', function (e) {
+            bindMoves(e, true);
+        });
+    }
+
+    function keyboard(i) {
+        var element = i.element;
+
+        var elementHovered = function () { return matches(element, ':hover'); };
+        var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
+
+        function shouldPreventDefault(deltaX, deltaY) {
+            var scrollTop = Math.floor(element.scrollTop);
+            if (deltaX === 0) {
+                if (!i.scrollbarYActive) {
+                    return false;
+                }
+                if (
+                    (scrollTop === 0 && deltaY > 0) ||
+                    (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
+                ) {
+                    return !i.settings.wheelPropagation;
+                }
+            }
+
+            var scrollLeft = element.scrollLeft;
+            if (deltaY === 0) {
+                if (!i.scrollbarXActive) {
+                    return false;
+                }
+                if (
+                    (scrollLeft === 0 && deltaX < 0) ||
+                    (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
+                ) {
+                    return !i.settings.wheelPropagation;
+                }
+            }
+            return true;
+        }
+
+        i.event.bind(i.ownerDocument, 'keydown', function (e) {
+            if (
+                (e.isDefaultPrevented && e.isDefaultPrevented()) ||
+                e.defaultPrevented
+            ) {
+                return;
+            }
+
+            if (!elementHovered() && !scrollbarFocused()) {
+                return;
+            }
+
+            var activeElement = document.activeElement
+                ? document.activeElement
+                : i.ownerDocument.activeElement;
+            if (activeElement) {
+                if (activeElement.tagName === 'IFRAME') {
+                    activeElement = activeElement.contentDocument.activeElement;
+                } else {
+                    // go deeper if element is a webcomponent
+                    while (activeElement.shadowRoot) {
+                        activeElement = activeElement.shadowRoot.activeElement;
+                    }
+                }
+                if (isEditable(activeElement)) {
+                    return;
+                }
+            }
+
+            var deltaX = 0;
+            var deltaY = 0;
+
+            switch (e.which) {
+                case 37: // left
+                    if (e.metaKey) {
+                        deltaX = -i.contentWidth;
+                    } else if (e.altKey) {
+                        deltaX = -i.containerWidth;
+                    } else {
+                        deltaX = -30;
+                    }
+                    break;
+                case 38: // up
+                    if (e.metaKey) {
+                        deltaY = i.contentHeight;
+                    } else if (e.altKey) {
+                        deltaY = i.containerHeight;
+                    } else {
+                        deltaY = 30;
+                    }
+                    break;
+                case 39: // right
+                    if (e.metaKey) {
+                        deltaX = i.contentWidth;
+                    } else if (e.altKey) {
+                        deltaX = i.containerWidth;
+                    } else {
+                        deltaX = 30;
+                    }
+                    break;
+                case 40: // down
+                    if (e.metaKey) {
+                        deltaY = -i.contentHeight;
+                    } else if (e.altKey) {
+                        deltaY = -i.containerHeight;
+                    } else {
+                        deltaY = -30;
+                    }
+                    break;
+                case 32: // space bar
+                    if (e.shiftKey) {
+                        deltaY = i.containerHeight;
+                    } else {
+                        deltaY = -i.containerHeight;
+                    }
+                    break;
+                case 33: // page up
+                    deltaY = i.containerHeight;
+                    break;
+                case 34: // page down
+                    deltaY = -i.containerHeight;
+                    break;
+                case 36: // home
+                    deltaY = i.contentHeight;
+                    break;
+                case 35: // end
+                    deltaY = -i.contentHeight;
+                    break;
+                default:
+                    return;
+            }
+
+            if (i.settings.suppressScrollX && deltaX !== 0) {
+                return;
+            }
+            if (i.settings.suppressScrollY && deltaY !== 0) {
+                return;
+            }
+
+            element.scrollTop -= deltaY;
+            element.scrollLeft += deltaX;
+            updateGeometry(i);
+
+            if (shouldPreventDefault(deltaX, deltaY)) {
+                e.preventDefault();
+            }
+        });
+    }
+
+    function wheel(i) {
+        var element = i.element;
+
+        function shouldPreventDefault(deltaX, deltaY) {
+            var roundedScrollTop = Math.floor(element.scrollTop);
+            var isTop = element.scrollTop === 0;
+            var isBottom =
+                roundedScrollTop + element.offsetHeight === element.scrollHeight;
+            var isLeft = element.scrollLeft === 0;
+            var isRight =
+                element.scrollLeft + element.offsetWidth === element.scrollWidth;
+
+            var hitsBound;
+
+            // pick axis with primary direction
+            if (Math.abs(deltaY) > Math.abs(deltaX)) {
+                hitsBound = isTop || isBottom;
+            } else {
+                hitsBound = isLeft || isRight;
+            }
+
+            return hitsBound ? !i.settings.wheelPropagation : true;
+        }
+
+        function getDeltaFromEvent(e) {
+            var deltaX = e.deltaX;
+            var deltaY = -1 * e.deltaY;
+
+            if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
+                // OS X Safari
+                deltaX = (-1 * e.wheelDeltaX) / 6;
+                deltaY = e.wheelDeltaY / 6;
+            }
+
+            if (e.deltaMode && e.deltaMode === 1) {
+                // Firefox in deltaMode 1: Line scrolling
+                deltaX *= 10;
+                deltaY *= 10;
+            }
+
+            if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
+                // IE in some mouse drivers
+                deltaX = 0;
+                deltaY = e.wheelDelta;
+            }
+
+            if (e.shiftKey) {
+                // reverse axis with shift key
+                return [-deltaY, -deltaX];
+            }
+            return [deltaX, deltaY];
+        }
+
+        function shouldBeConsumedByChild(target, deltaX, deltaY) {
+            // FIXME: this is a workaround for <select> issue in FF and IE #571
+            if (!env.isWebKit && element.querySelector('select:focus')) {
+                return true;
+            }
+
+            if (!element.contains(target)) {
+                return false;
+            }
+
+            var cursor = target;
+
+            while (cursor && cursor !== element) {
+                if (cursor.classList.contains(cls.element.consuming)) {
+                    return true;
+                }
+
+                var style = get(cursor);
+
+                // if deltaY && vertical scrollable
+                if (deltaY && style.overflowY.match(/(scroll|auto)/)) {
+                    var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
+                    if (maxScrollTop > 0) {
+                        if (
+                            (cursor.scrollTop > 0 && deltaY < 0) ||
+                            (cursor.scrollTop < maxScrollTop && deltaY > 0)
+                        ) {
+                            return true;
+                        }
+                    }
+                }
+                // if deltaX && horizontal scrollable
+                if (deltaX && style.overflowX.match(/(scroll|auto)/)) {
+                    var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
+                    if (maxScrollLeft > 0) {
+                        if (
+                            (cursor.scrollLeft > 0 && deltaX < 0) ||
+                            (cursor.scrollLeft < maxScrollLeft && deltaX > 0)
+                        ) {
+                            return true;
+                        }
+                    }
+                }
+
+                cursor = cursor.parentNode;
+            }
+
+            return false;
+        }
+
+        function mousewheelHandler(e) {
+            var ref = getDeltaFromEvent(e);
+            var deltaX = ref[0];
+            var deltaY = ref[1];
+
+            if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
+                return;
+            }
+
+            var shouldPrevent = false;
+            if (!i.settings.useBothWheelAxes) {
+                // deltaX will only be used for horizontal scrolling and deltaY will
+                // only be used for vertical scrolling - this is the default
+                element.scrollTop -= deltaY * i.settings.wheelSpeed;
+                element.scrollLeft += deltaX * i.settings.wheelSpeed;
+            } else if (i.scrollbarYActive && !i.scrollbarXActive) {
+                // only vertical scrollbar is active and useBothWheelAxes option is
+                // active, so let's scroll vertical bar using both mouse wheel axes
+                if (deltaY) {
+                    element.scrollTop -= deltaY * i.settings.wheelSpeed;
+                } else {
+                    element.scrollTop += deltaX * i.settings.wheelSpeed;
+                }
+                shouldPrevent = true;
+            } else if (i.scrollbarXActive && !i.scrollbarYActive) {
+                // useBothWheelAxes and only horizontal bar is active, so use both
+                // wheel axes for horizontal bar
+                if (deltaX) {
+                    element.scrollLeft += deltaX * i.settings.wheelSpeed;
+                } else {
+                    element.scrollLeft -= deltaY * i.settings.wheelSpeed;
+                }
+                shouldPrevent = true;
+            }
+
+            updateGeometry(i);
+
+            shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
+            if (shouldPrevent && !e.ctrlKey) {
+                e.stopPropagation();
+                e.preventDefault();
+            }
+        }
+
+        if (typeof window.onwheel !== 'undefined') {
+            i.event.bind(element, 'wheel', mousewheelHandler);
+        } else if (typeof window.onmousewheel !== 'undefined') {
+            i.event.bind(element, 'mousewheel', mousewheelHandler);
+        }
+    }
+
+    function touch(i) {
+        if (!env.supportsTouch && !env.supportsIePointer) {
+            return;
+        }
+
+        var element = i.element;
+
+        function shouldPrevent(deltaX, deltaY) {
+            var scrollTop = Math.floor(element.scrollTop);
+            var scrollLeft = element.scrollLeft;
+            var magnitudeX = Math.abs(deltaX);
+            var magnitudeY = Math.abs(deltaY);
+
+            if (magnitudeY > magnitudeX) {
+                // user is perhaps trying to swipe up/down the page
+
+                if (
+                    (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
+                    (deltaY > 0 && scrollTop === 0)
+                ) {
+                    // set prevent for mobile Chrome refresh
+                    return window.scrollY === 0 && deltaY > 0 && env.isChrome;
+                }
+            } else if (magnitudeX > magnitudeY) {
+                // user is perhaps trying to swipe left/right across the page
+
+                if (
+                    (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
+                    (deltaX > 0 && scrollLeft === 0)
+                ) {
+                    return true;
+                }
+            }
+
+            return true;
+        }
+
+        function applyTouchMove(differenceX, differenceY) {
+            element.scrollTop -= differenceY;
+            element.scrollLeft -= differenceX;
+
+            updateGeometry(i);
+        }
+
+        var startOffset = {};
+        var startTime = 0;
+        var speed = {};
+        var easingLoop = null;
+
+        function getTouch(e) {
+            if (e.targetTouches) {
+                return e.targetTouches[0];
+            } else {
+                // Maybe IE pointer
+                return e;
+            }
+        }
+
+        function shouldHandle(e) {
+            if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
+                return false;
+            }
+            if (e.targetTouches && e.targetTouches.length === 1) {
+                return true;
+            }
+            if (
+                e.pointerType &&
+                e.pointerType !== 'mouse' &&
+                e.pointerType !== e.MSPOINTER_TYPE_MOUSE
+            ) {
+                return true;
+            }
+            return false;
+        }
+
+        function touchStart(e) {
+            if (!shouldHandle(e)) {
+                return;
+            }
+
+            var touch = getTouch(e);
+
+            startOffset.pageX = touch.pageX;
+            startOffset.pageY = touch.pageY;
+
+            startTime = new Date().getTime();
+
+            if (easingLoop !== null) {
+                clearInterval(easingLoop);
+            }
+        }
+
+        function shouldBeConsumedByChild(target, deltaX, deltaY) {
+            if (!element.contains(target)) {
+                return false;
+            }
+
+            var cursor = target;
+
+            while (cursor && cursor !== element) {
+                if (cursor.classList.contains(cls.element.consuming)) {
+                    return true;
+                }
+
+                var style = get(cursor);
+
+                // if deltaY && vertical scrollable
+                if (deltaY && style.overflowY.match(/(scroll|auto)/)) {
+                    var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
+                    if (maxScrollTop > 0) {
+                        if (
+                            (cursor.scrollTop > 0 && deltaY < 0) ||
+                            (cursor.scrollTop < maxScrollTop && deltaY > 0)
+                        ) {
+                            return true;
+                        }
+                    }
+                }
+                // if deltaX && horizontal scrollable
+                if (deltaX && style.overflowX.match(/(scroll|auto)/)) {
+                    var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
+                    if (maxScrollLeft > 0) {
+                        if (
+                            (cursor.scrollLeft > 0 && deltaX < 0) ||
+                            (cursor.scrollLeft < maxScrollLeft && deltaX > 0)
+                        ) {
+                            return true;
+                        }
+                    }
+                }
+
+                cursor = cursor.parentNode;
+            }
+
+            return false;
+        }
+
+        function touchMove(e) {
+            if (shouldHandle(e)) {
+                var touch = getTouch(e);
+
+                var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
+
+                var differenceX = currentOffset.pageX - startOffset.pageX;
+                var differenceY = currentOffset.pageY - startOffset.pageY;
+
+                if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
+                    return;
+                }
+
+                applyTouchMove(differenceX, differenceY);
+                startOffset = currentOffset;
+
+                var currentTime = new Date().getTime();
+
+                var timeGap = currentTime - startTime;
+                if (timeGap > 0) {
+                    speed.x = differenceX / timeGap;
+                    speed.y = differenceY / timeGap;
+                    startTime = currentTime;
+                }
+
+                if (shouldPrevent(differenceX, differenceY)) {
+                    e.preventDefault();
+                }
+            }
+        }
+        function touchEnd() {
+            if (i.settings.swipeEasing) {
+                clearInterval(easingLoop);
+                easingLoop = setInterval(function() {
+                    if (i.isInitialized) {
+                        clearInterval(easingLoop);
+                        return;
+                    }
+
+                    if (!speed.x && !speed.y) {
+                        clearInterval(easingLoop);
+                        return;
+                    }
+
+                    if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
+                        clearInterval(easingLoop);
+                        return;
+                    }
+
+                    applyTouchMove(speed.x * 30, speed.y * 30);
+
+                    speed.x *= 0.8;
+                    speed.y *= 0.8;
+                }, 10);
+            }
+        }
+
+        if (env.supportsTouch) {
+            i.event.bind(element, 'touchstart', touchStart);
+            i.event.bind(element, 'touchmove', touchMove);
+            i.event.bind(element, 'touchend', touchEnd);
+        } else if (env.supportsIePointer) {
+            if (window.PointerEvent) {
+                i.event.bind(element, 'pointerdown', touchStart);
+                i.event.bind(element, 'pointermove', touchMove);
+                i.event.bind(element, 'pointerup', touchEnd);
+            } else if (window.MSPointerEvent) {
+                i.event.bind(element, 'MSPointerDown', touchStart);
+                i.event.bind(element, 'MSPointerMove', touchMove);
+                i.event.bind(element, 'MSPointerUp', touchEnd);
+            }
+        }
+    }
+
+    var defaultSettings = function () { return ({
+        handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
+        maxScrollbarLength: null,
+        minScrollbarLength: null,
+        scrollingThreshold: 1000,
+        scrollXMarginOffset: 0,
+        scrollYMarginOffset: 0,
+        suppressScrollX: false,
+        suppressScrollY: false,
+        swipeEasing: true,
+        useBothWheelAxes: false,
+        wheelPropagation: true,
+        wheelSpeed: 1,
+    }); };
+
+    var handlers = {
+        'click-rail': clickRail,
+        'drag-thumb': dragThumb,
+        keyboard: keyboard,
+        wheel: wheel,
+        touch: touch,
+    };
+
+    var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
+        var this$1 = this;
+        if ( userSettings === void 0 ) userSettings = {};
+
+        if (typeof element === 'string') {
+            element = document.querySelector(element);
+        }
+
+        if (!element || !element.nodeName) {
+            throw new Error('no element is specified to initialize PerfectScrollbar');
+        }
+
+        this.element = element;
+
+        element.classList.add(cls.main);
+
+        this.settings = defaultSettings();
+        for (var key in userSettings) {
+            this.settings[key] = userSettings[key];
+        }
+
+        this.containerWidth = null;
+        this.containerHeight = null;
+        this.contentWidth = null;
+        this.contentHeight = null;
+
+        var focus = function () { return element.classList.add(cls.state.focus); };
+        var blur = function () { return element.classList.remove(cls.state.focus); };
+
+        this.isRtl = get(element).direction === 'rtl';
+        if (this.isRtl === true) {
+            element.classList.add(cls.rtl);
+        }
+        this.isNegativeScroll = (function () {
+            var originalScrollLeft = element.scrollLeft;
+            var result = null;
+            element.scrollLeft = -1;
+            result = element.scrollLeft < 0;
+            element.scrollLeft = originalScrollLeft;
+            return result;
+        })();
+        this.negativeScrollAdjustment = this.isNegativeScroll
+            ? element.scrollWidth - element.clientWidth
+            : 0;
+        this.event = new EventManager();
+        this.ownerDocument = element.ownerDocument || document;
+
+        this.scrollbarXRail = div(cls.element.rail('x'));
+        element.appendChild(this.scrollbarXRail);
+        this.scrollbarX = div(cls.element.thumb('x'));
+        this.scrollbarXRail.appendChild(this.scrollbarX);
+        this.scrollbarX.setAttribute('tabindex', 0);
+        this.event.bind(this.scrollbarX, 'focus', focus);
+        this.event.bind(this.scrollbarX, 'blur', blur);
+        this.scrollbarXActive = null;
+        this.scrollbarXWidth = null;
+        this.scrollbarXLeft = null;
+        var railXStyle = get(this.scrollbarXRail);
+        this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
+        if (isNaN(this.scrollbarXBottom)) {
+            this.isScrollbarXUsingBottom = false;
+            this.scrollbarXTop = toInt(railXStyle.top);
+        } else {
+            this.isScrollbarXUsingBottom = true;
+        }
+        this.railBorderXWidth =
+            toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
+        // Set rail to display:block to calculate margins
+        set(this.scrollbarXRail, { display: 'block' });
+        this.railXMarginWidth =
+            toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
+        set(this.scrollbarXRail, { display: '' });
+        this.railXWidth = null;
+        this.railXRatio = null;
+
+        this.scrollbarYRail = div(cls.element.rail('y'));
+        element.appendChild(this.scrollbarYRail);
+        this.scrollbarY = div(cls.element.thumb('y'));
+        this.scrollbarYRail.appendChild(this.scrollbarY);
+        this.scrollbarY.setAttribute('tabindex', 0);
+        this.event.bind(this.scrollbarY, 'focus', focus);
+        this.event.bind(this.scrollbarY, 'blur', blur);
+        this.scrollbarYActive = null;
+        this.scrollbarYHeight = null;
+        this.scrollbarYTop = null;
+        var railYStyle = get(this.scrollbarYRail);
+        this.scrollbarYRight = parseInt(railYStyle.right, 10);
+        if (isNaN(this.scrollbarYRight)) {
+            this.isScrollbarYUsingRight = false;
+            this.scrollbarYLeft = toInt(railYStyle.left);
+        } else {
+            this.isScrollbarYUsingRight = true;
+        }
+        this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
+        this.railBorderYWidth =
+            toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
+        set(this.scrollbarYRail, { display: 'block' });
+        this.railYMarginHeight =
+            toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
+        set(this.scrollbarYRail, { display: '' });
+        this.railYHeight = null;
+        this.railYRatio = null;
+
+        this.reach = {
+            x:
+                element.scrollLeft <= 0
+                    ? 'start'
+                    : element.scrollLeft >= this.contentWidth - this.containerWidth
+                    ? 'end'
+                    : null,
+            y:
+                element.scrollTop <= 0
+                    ? 'start'
+                    : element.scrollTop >= this.contentHeight - this.containerHeight
+                    ? 'end'
+                    : null,
+        };
+
+        this.isAlive = true;
+
+        this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
+
+        this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
+        this.lastScrollLeft = element.scrollLeft; // for onScroll only
+        this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
+        updateGeometry(this);
+    };
+
+    PerfectScrollbar.prototype.update = function update () {
+        if (!this.isAlive) {
+            return;
+        }
+
+        // Recalcuate negative scrollLeft adjustment
+        this.negativeScrollAdjustment = this.isNegativeScroll
+            ? this.element.scrollWidth - this.element.clientWidth
+            : 0;
+
+        // Recalculate rail margins
+        set(this.scrollbarXRail, { display: 'block' });
+        set(this.scrollbarYRail, { display: 'block' });
+        this.railXMarginWidth =
+            toInt(get(this.scrollbarXRail).marginLeft) +
+            toInt(get(this.scrollbarXRail).marginRight);
+        this.railYMarginHeight =
+            toInt(get(this.scrollbarYRail).marginTop) +
+            toInt(get(this.scrollbarYRail).marginBottom);
+
+        // Hide scrollbars not to affect scrollWidth and scrollHeight
+        set(this.scrollbarXRail, { display: 'none' });
+        set(this.scrollbarYRail, { display: 'none' });
+
+        updateGeometry(this);
+
+        processScrollDiff(this, 'top', 0, false, true);
+        processScrollDiff(this, 'left', 0, false, true);
+
+        set(this.scrollbarXRail, { display: '' });
+        set(this.scrollbarYRail, { display: '' });
+    };
+
+    PerfectScrollbar.prototype.onScroll = function onScroll (e) {
+        if (!this.isAlive) {
+            return;
+        }
+
+        updateGeometry(this);
+        processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
+        processScrollDiff(
+            this,
+            'left',
+            this.element.scrollLeft - this.lastScrollLeft
+        );
+
+        this.lastScrollTop = Math.floor(this.element.scrollTop);
+        this.lastScrollLeft = this.element.scrollLeft;
+    };
+
+    PerfectScrollbar.prototype.destroy = function destroy () {
+        if (!this.isAlive) {
+            return;
+        }
+
+        this.event.unbindAll();
+        remove(this.scrollbarX);
+        remove(this.scrollbarY);
+        remove(this.scrollbarXRail);
+        remove(this.scrollbarYRail);
+        this.removePsClasses();
+
+        // unset elements
+        this.element = null;
+        this.scrollbarX = null;
+        this.scrollbarY = null;
+        this.scrollbarXRail = null;
+        this.scrollbarYRail = null;
+
+        this.isAlive = false;
+    };
+
+    PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
+        this.element.className = this.element.className
+            .split(' ')
+            .filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
+            .join(' ');
+    };
+
+    return PerfectScrollbar;
+
+})));
+//# sourceMappingURL=perfect-scrollbar.js.map
+/*!
+ * perfect-scrollbar v1.5.0
+ * Copyright 2020 Hyunje Jun, MDBootstrap and Contributors
+ * Licensed under MIT
+ */
+
+(function (global, factory) {
+    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+        typeof define === 'function' && define.amd ? define(factory) :
+            (global = global || self, global.PerfectScrollbar = factory());
+}(this, (function () { 'use strict';
+
+    function get(element) {
+        return getComputedStyle(element);
+    }
+
+    function set(element, obj) {
+        for (var key in obj) {
+            var val = obj[key];
+            if (typeof val === 'number') {
+                val = val + "px";
+            }
+            element.style[key] = val;
+        }
+        return element;
+    }
+
+    function div(className) {
+        var div = document.createElement('div');
+        div.className = className;
+        return div;
+    }
+
+    var elMatches =
+        typeof Element !== 'undefined' &&
+        (Element.prototype.matches ||
+            Element.prototype.webkitMatchesSelector ||
+            Element.prototype.mozMatchesSelector ||
+            Element.prototype.msMatchesSelector);
+
+    function matches(element, query) {
+        if (!elMatches) {
+            throw new Error('No element matching method supported');
+        }
+
+        return elMatches.call(element, query);
+    }
+
+    function remove(element) {
+        if (element.remove) {
+            element.remove();
+        } else {
+            if (element.parentNode) {
+                element.parentNode.removeChild(element);
+            }
+        }
+    }
+
+    function queryChildren(element, selector) {
+        return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
+        );
+    }
+
+    var cls = {
+        main: 'ps',
+        rtl: 'ps__rtl',
+        element: {
+            thumb: function (x) { return ("ps__thumb-" + x); },
+            rail: function (x) { return ("ps__rail-" + x); },
+            consuming: 'ps__child--consume',
+        },
+        state: {
+            focus: 'ps--focus',
+            clicking: 'ps--clicking',
+            active: function (x) { return ("ps--active-" + x); },
+            scrolling: function (x) { return ("ps--scrolling-" + x); },
+        },
+    };
+
+    /*
+     * Helper methods
+     */
+    var scrollingClassTimeout = { x: null, y: null };
+
+    function addScrollingClass(i, x) {
+        var classList = i.element.classList;
+        var className = cls.state.scrolling(x);
+
+        if (classList.contains(className)) {
+            clearTimeout(scrollingClassTimeout[x]);
+        } else {
+            classList.add(className);
+        }
+    }
+
+    function removeScrollingClass(i, x) {
+        scrollingClassTimeout[x] = setTimeout(
+            function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
+            i.settings.scrollingThreshold
+        );
+    }
+
+    function setScrollingClassInstantly(i, x) {
+        addScrollingClass(i, x);
+        removeScrollingClass(i, x);
+    }
+
+    var EventElement = function EventElement(element) {
+        this.element = element;
+        this.handlers = {};
+    };
+
+    var prototypeAccessors = { isEmpty: { configurable: true } };
+
+    EventElement.prototype.bind = function bind (eventName, handler) {
+        if (typeof this.handlers[eventName] === 'undefined') {
+            this.handlers[eventName] = [];
+        }
+        this.handlers[eventName].push(handler);
+        this.element.addEventListener(eventName, handler, false);
+    };
+
+    EventElement.prototype.unbind = function unbind (eventName, target) {
+        var this$1 = this;
+
+        this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
+            if (target && handler !== target) {
+                return true;
+            }
+            this$1.element.removeEventListener(eventName, handler, false);
+            return false;
+        });
+    };
+
+    EventElement.prototype.unbindAll = function unbindAll () {
+        for (var name in this.handlers) {
+            this.unbind(name);
+        }
+    };
+
+    prototypeAccessors.isEmpty.get = function () {
+        var this$1 = this;
+
+        return Object.keys(this.handlers).every(
+            function (key) { return this$1.handlers[key].length === 0; }
+        );
+    };
+
+    Object.defineProperties( EventElement.prototype, prototypeAccessors );
+
+    var EventManager = function EventManager() {
+        this.eventElements = [];
+    };
+
+    EventManager.prototype.eventElement = function eventElement (element) {
+        var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
+        if (!ee) {
+            ee = new EventElement(element);
+            this.eventElements.push(ee);
+        }
+        return ee;
+    };
+
+    EventManager.prototype.bind = function bind (element, eventName, handler) {
+        this.eventElement(element).bind(eventName, handler);
+    };
+
+    EventManager.prototype.unbind = function unbind (element, eventName, handler) {
+        var ee = this.eventElement(element);
+        ee.unbind(eventName, handler);
+
+        if (ee.isEmpty) {
+            // remove
+            this.eventElements.splice(this.eventElements.indexOf(ee), 1);
+        }
+    };
+
+    EventManager.prototype.unbindAll = function unbindAll () {
+        this.eventElements.forEach(function (e) { return e.unbindAll(); });
+        this.eventElements = [];
+    };
+
+    EventManager.prototype.once = function once (element, eventName, handler) {
+        var ee = this.eventElement(element);
+        var onceHandler = function (evt) {
+            ee.unbind(eventName, onceHandler);
+            handler(evt);
+        };
+        ee.bind(eventName, onceHandler);
+    };
+
+    function createEvent(name) {
+        if (typeof window.CustomEvent === 'function') {
+            return new CustomEvent(name);
+        } else {
+            var evt = document.createEvent('CustomEvent');
+            evt.initCustomEvent(name, false, false, undefined);
+            return evt;
+        }
+    }
+
+    function processScrollDiff(
+        i,
+        axis,
+        diff,
+        useScrollingClass,
+        forceFireReachEvent
+    ) {
+        if ( useScrollingClass === void 0 ) useScrollingClass = true;
+        if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
+
+        var fields;
+        if (axis === 'top') {
+            fields = [
+                'contentHeight',
+                'containerHeight',
+                'scrollTop',
+                'y',
+                'up',
+                'down' ];
+        } else if (axis === 'left') {
+            fields = [
+                'contentWidth',
+                'containerWidth',
+                'scrollLeft',
+                'x',
+                'left',
+                'right' ];
+        } else {
+            throw new Error('A proper axis should be provided');
+        }
+
+        processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
+    }
+
+    function processScrollDiff$1(
+        i,
+        diff,
+        ref,
+        useScrollingClass,
+        forceFireReachEvent
+    ) {
+        var contentHeight = ref[0];
+        var containerHeight = ref[1];
+        var scrollTop = ref[2];
+        var y = ref[3];
+        var up = ref[4];
+        var down = ref[5];
+        if ( useScrollingClass === void 0 ) useScrollingClass = true;
+        if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
+
+        var element = i.element;
+
+        // reset reach
+        i.reach[y] = null;
+
+        // 1 for subpixel rounding
+        if (element[scrollTop] < 1) {
+            i.reach[y] = 'start';
+        }
+
+        // 1 for subpixel rounding
+        if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
+            i.reach[y] = 'end';
+        }
+
+        if (diff) {
+            element.dispatchEvent(createEvent(("ps-scroll-" + y)));
+
+            if (diff < 0) {
+                element.dispatchEvent(createEvent(("ps-scroll-" + up)));
+            } else if (diff > 0) {
+                element.dispatchEvent(createEvent(("ps-scroll-" + down)));
+            }
+
+            if (useScrollingClass) {
+                setScrollingClassInstantly(i, y);
+            }
+        }
+
+        if (i.reach[y] && (diff || forceFireReachEvent)) {
+            element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
+        }
+    }
+
+    function toInt(x) {
+        return parseInt(x, 10) || 0;
+    }
+
+    function isEditable(el) {
+        return (
+            matches(el, 'input,[contenteditable]') ||
+            matches(el, 'select,[contenteditable]') ||
+            matches(el, 'textarea,[contenteditable]') ||
+            matches(el, 'button,[contenteditable]')
+        );
+    }
+
+    function outerWidth(element) {
+        var styles = get(element);
+        return (
+            toInt(styles.width) +
+            toInt(styles.paddingLeft) +
+            toInt(styles.paddingRight) +
+            toInt(styles.borderLeftWidth) +
+            toInt(styles.borderRightWidth)
+        );
+    }
+
+    var env = {
+        isWebKit:
+            typeof document !== 'undefined' &&
+            'WebkitAppearance' in document.documentElement.style,
+        supportsTouch:
+            typeof window !== 'undefined' &&
+            ('ontouchstart' in window ||
+                ('maxTouchPoints' in window.navigator &&
+                    window.navigator.maxTouchPoints > 0) ||
+                (window.DocumentTouch && document instanceof window.DocumentTouch)),
+        supportsIePointer:
+            typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
+        isChrome:
+            typeof navigator !== 'undefined' &&
+            /Chrome/i.test(navigator && navigator.userAgent),
+    };
+
+    function updateGeometry(i) {
+        var element = i.element;
+        var roundedScrollTop = Math.floor(element.scrollTop);
+        var rect = {width:element.clientWidth,height:element.clientHeight};
+
+        i.containerWidth = Math.ceil(rect.width);
+        i.containerHeight = Math.ceil(rect.height);
+        i.contentWidth = element.scrollWidth;
+        i.contentHeight = element.scrollHeight;
+
+        if (!element.contains(i.scrollbarXRail)) {
+            // clean up and append
+            queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
+            );
+            element.appendChild(i.scrollbarXRail);
+        }
+        if (!element.contains(i.scrollbarYRail)) {
+            // clean up and append
+            queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
+            );
+            element.appendChild(i.scrollbarYRail);
+        }
+
+        if (
+            !i.settings.suppressScrollX &&
+            i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
+        ) {
+            i.scrollbarXActive = true;
+            i.railXWidth = i.containerWidth - i.railXMarginWidth;
+            i.railXRatio = i.containerWidth / i.railXWidth;
+            i.scrollbarXWidth = getThumbSize(
+                i,
+                toInt((i.railXWidth * i.containerWidth) / i.contentWidth)
+            );
+            i.scrollbarXLeft = toInt(
+                ((i.negativeScrollAdjustment + element.scrollLeft) *
+                    (i.railXWidth - i.scrollbarXWidth)) /
+                (i.contentWidth - i.containerWidth)
+            );
+        } else {
+            i.scrollbarXActive = false;
+        }
+
+        if (
+            !i.settings.suppressScrollY &&
+            i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
+        ) {
+            i.scrollbarYActive = true;
+            i.railYHeight = i.containerHeight - i.railYMarginHeight;
+            i.railYRatio = i.containerHeight / i.railYHeight;
+            i.scrollbarYHeight = getThumbSize(
+                i,
+                toInt((i.railYHeight * i.containerHeight) / i.contentHeight)
+            );
+            i.scrollbarYTop = toInt(
+                (roundedScrollTop * (i.railYHeight - i.scrollbarYHeight)) /
+                (i.contentHeight - i.containerHeight)
+            );
+        } else {
+            i.scrollbarYActive = false;
+        }
+
+        if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
+            i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
+        }
+        if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
+            i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
+        }
+
+        updateCss(element, i);
+
+        if (i.scrollbarXActive) {
+            element.classList.add(cls.state.active('x'));
+        } else {
+            element.classList.remove(cls.state.active('x'));
+            i.scrollbarXWidth = 0;
+            i.scrollbarXLeft = 0;
+            element.scrollLeft = i.isRtl === true ? i.contentWidth : 0;
+        }
+        if (i.scrollbarYActive) {
+            element.classList.add(cls.state.active('y'));
+        } else {
+            element.classList.remove(cls.state.active('y'));
+            i.scrollbarYHeight = 0;
+            i.scrollbarYTop = 0;
+            element.scrollTop = 0;
+        }
+    }
+
+    function getThumbSize(i, thumbSize) {
+        if (i.settings.minScrollbarLength) {
+            thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
+        }
+        if (i.settings.maxScrollbarLength) {
+            thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
+        }
+        return thumbSize;
+    }
+
+    function updateCss(element, i) {
+        var xRailOffset = { width: i.railXWidth };
+        var roundedScrollTop = Math.floor(element.scrollTop);
+
+        if (i.isRtl) {
+            xRailOffset.left =
+                i.negativeScrollAdjustment +
+                element.scrollLeft +
+                i.containerWidth -
+                i.contentWidth;
+        } else {
+            xRailOffset.left = element.scrollLeft;
+        }
+        if (i.isScrollbarXUsingBottom) {
+            xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
+        } else {
+            xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
+        }
+        set(i.scrollbarXRail, xRailOffset);
+
+        var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
+        if (i.isScrollbarYUsingRight) {
+            if (i.isRtl) {
+                yRailOffset.right =
+                    i.contentWidth -
+                    (i.negativeScrollAdjustment + element.scrollLeft) -
+                    i.scrollbarYRight -
+                    i.scrollbarYOuterWidth -
+                    9;
+            } else {
+                yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
+            }
+        } else {
+            if (i.isRtl) {
+                yRailOffset.left =
+                    i.negativeScrollAdjustment +
+                    element.scrollLeft +
+                    i.containerWidth * 2 -
+                    i.contentWidth -
+                    i.scrollbarYLeft -
+                    i.scrollbarYOuterWidth;
+            } else {
+                yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
+            }
+        }
+        set(i.scrollbarYRail, yRailOffset);
+
+        set(i.scrollbarX, {
+            left: i.scrollbarXLeft,
+            width: i.scrollbarXWidth - i.railBorderXWidth,
+        });
+        set(i.scrollbarY, {
+            top: i.scrollbarYTop,
+            height: i.scrollbarYHeight - i.railBorderYWidth,
+        });
+    }
+
+    function clickRail(i) {
+        var element = i.element;
+
+        i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
+        i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
+            var positionTop =
+                e.pageY -
+                window.pageYOffset -
+                i.scrollbarYRail.getBoundingClientRect().top;
+            var direction = positionTop > i.scrollbarYTop ? 1 : -1;
+
+            i.element.scrollTop += direction * i.containerHeight;
+            updateGeometry(i);
+
+            e.stopPropagation();
+        });
+
+        i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
+        i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
+            var positionLeft =
+                e.pageX -
+                window.pageXOffset -
+                i.scrollbarXRail.getBoundingClientRect().left;
+            var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
+
+            i.element.scrollLeft += direction * i.containerWidth;
+            updateGeometry(i);
+
+            e.stopPropagation();
+        });
+    }
+
+    function dragThumb(i) {
+        bindMouseScrollHandler(i, [
+            'containerWidth',
+            'contentWidth',
+            'pageX',
+            'railXWidth',
+            'scrollbarX',
+            'scrollbarXWidth',
+            'scrollLeft',
+            'x',
+            'scrollbarXRail' ]);
+        bindMouseScrollHandler(i, [
+            'containerHeight',
+            'contentHeight',
+            'pageY',
+            'railYHeight',
+            'scrollbarY',
+            'scrollbarYHeight',
+            'scrollTop',
+            'y',
+            'scrollbarYRail' ]);
+    }
+
+    function bindMouseScrollHandler(
+        i,
+        ref
+    ) {
+        var containerHeight = ref[0];
+        var contentHeight = ref[1];
+        var pageY = ref[2];
+        var railYHeight = ref[3];
+        var scrollbarY = ref[4];
+        var scrollbarYHeight = ref[5];
+        var scrollTop = ref[6];
+        var y = ref[7];
+        var scrollbarYRail = ref[8];
+
+        var element = i.element;
+
+        var startingScrollTop = null;
+        var startingMousePageY = null;
+        var scrollBy = null;
+
+        function mouseMoveHandler(e) {
+            if (e.touches && e.touches[0]) {
+                e[pageY] = e.touches[0].pageY;
+            }
+            element[scrollTop] =
+                startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
+            addScrollingClass(i, y);
+            updateGeometry(i);
+
+            e.stopPropagation();
+            e.preventDefault();
+        }
+
+        function mouseUpHandler() {
+            removeScrollingClass(i, y);
+            i[scrollbarYRail].classList.remove(cls.state.clicking);
+            i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
+        }
+
+        function bindMoves(e, touchMode) {
+            startingScrollTop = element[scrollTop];
+            if (touchMode && e.touches) {
+                e[pageY] = e.touches[0].pageY;
+            }
+            startingMousePageY = e[pageY];
+            scrollBy =
+                (i[contentHeight] - i[containerHeight]) /
+                (i[railYHeight] - i[scrollbarYHeight]);
+            if (!touchMode) {
+                i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
+                i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
+                e.preventDefault();
+            } else {
+                i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler);
+            }
+
+            i[scrollbarYRail].classList.add(cls.state.clicking);
+
+            e.stopPropagation();
+        }
+
+        i.event.bind(i[scrollbarY], 'mousedown', function (e) {
+            bindMoves(e);
+        });
+        i.event.bind(i[scrollbarY], 'touchstart', function (e) {
+            bindMoves(e, true);
+        });
+    }
+
+    function keyboard(i) {
+        var element = i.element;
+
+        var elementHovered = function () { return matches(element, ':hover'); };
+        var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
+
+        function shouldPreventDefault(deltaX, deltaY) {
+            var scrollTop = Math.floor(element.scrollTop);
+            if (deltaX === 0) {
+                if (!i.scrollbarYActive) {
+                    return false;
+                }
+                if (
+                    (scrollTop === 0 && deltaY > 0) ||
+                    (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
+                ) {
+                    return !i.settings.wheelPropagation;
+                }
+            }
+
+            var scrollLeft = element.scrollLeft;
+            if (deltaY === 0) {
+                if (!i.scrollbarXActive) {
+                    return false;
+                }
+                if (
+                    (scrollLeft === 0 && deltaX < 0) ||
+                    (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
+                ) {
+                    return !i.settings.wheelPropagation;
+                }
+            }
+            return true;
+        }
+
+        i.event.bind(i.ownerDocument, 'keydown', function (e) {
+            if (
+                (e.isDefaultPrevented && e.isDefaultPrevented()) ||
+                e.defaultPrevented
+            ) {
+                return;
+            }
+
+            if (!elementHovered() && !scrollbarFocused()) {
+                return;
+            }
+
+            var activeElement = document.activeElement
+                ? document.activeElement
+                : i.ownerDocument.activeElement;
+            if (activeElement) {
+                if (activeElement.tagName === 'IFRAME') {
+                    activeElement = activeElement.contentDocument.activeElement;
+                } else {
+                    // go deeper if element is a webcomponent
+                    while (activeElement.shadowRoot) {
+                        activeElement = activeElement.shadowRoot.activeElement;
+                    }
+                }
+                if (isEditable(activeElement)) {
+                    return;
+                }
+            }
+
+            var deltaX = 0;
+            var deltaY = 0;
+
+            switch (e.which) {
+                case 37: // left
+                    if (e.metaKey) {
+                        deltaX = -i.contentWidth;
+                    } else if (e.altKey) {
+                        deltaX = -i.containerWidth;
+                    } else {
+                        deltaX = -30;
+                    }
+                    break;
+                case 38: // up
+                    if (e.metaKey) {
+                        deltaY = i.contentHeight;
+                    } else if (e.altKey) {
+                        deltaY = i.containerHeight;
+                    } else {
+                        deltaY = 30;
+                    }
+                    break;
+                case 39: // right
+                    if (e.metaKey) {
+                        deltaX = i.contentWidth;
+                    } else if (e.altKey) {
+                        deltaX = i.containerWidth;
+                    } else {
+                        deltaX = 30;
+                    }
+                    break;
+                case 40: // down
+                    if (e.metaKey) {
+                        deltaY = -i.contentHeight;
+                    } else if (e.altKey) {
+                        deltaY = -i.containerHeight;
+                    } else {
+                        deltaY = -30;
+                    }
+                    break;
+                case 32: // space bar
+                    if (e.shiftKey) {
+                        deltaY = i.containerHeight;
+                    } else {
+                        deltaY = -i.containerHeight;
+                    }
+                    break;
+                case 33: // page up
+                    deltaY = i.containerHeight;
+                    break;
+                case 34: // page down
+                    deltaY = -i.containerHeight;
+                    break;
+                case 36: // home
+                    deltaY = i.contentHeight;
+                    break;
+                case 35: // end
+                    deltaY = -i.contentHeight;
+                    break;
+                default:
+                    return;
+            }
+
+            if (i.settings.suppressScrollX && deltaX !== 0) {
+                return;
+            }
+            if (i.settings.suppressScrollY && deltaY !== 0) {
+                return;
+            }
+
+            element.scrollTop -= deltaY;
+            element.scrollLeft += deltaX;
+            updateGeometry(i);
+
+            if (shouldPreventDefault(deltaX, deltaY)) {
+                e.preventDefault();
+            }
+        });
+    }
+
+    function wheel(i) {
+        var element = i.element;
+
+        function shouldPreventDefault(deltaX, deltaY) {
+            var roundedScrollTop = Math.floor(element.scrollTop);
+            var isTop = element.scrollTop === 0;
+            var isBottom =
+                roundedScrollTop + element.offsetHeight === element.scrollHeight;
+            var isLeft = element.scrollLeft === 0;
+            var isRight =
+                element.scrollLeft + element.offsetWidth === element.scrollWidth;
+
+            var hitsBound;
+
+            // pick axis with primary direction
+            if (Math.abs(deltaY) > Math.abs(deltaX)) {
+                hitsBound = isTop || isBottom;
+            } else {
+                hitsBound = isLeft || isRight;
+            }
+
+            return hitsBound ? !i.settings.wheelPropagation : true;
+        }
+
+        function getDeltaFromEvent(e) {
+            var deltaX = e.deltaX;
+            var deltaY = -1 * e.deltaY;
+
+            if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
+                // OS X Safari
+                deltaX = (-1 * e.wheelDeltaX) / 6;
+                deltaY = e.wheelDeltaY / 6;
+            }
+
+            if (e.deltaMode && e.deltaMode === 1) {
+                // Firefox in deltaMode 1: Line scrolling
+                deltaX *= 10;
+                deltaY *= 10;
+            }
+
+            if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
+                // IE in some mouse drivers
+                deltaX = 0;
+                deltaY = e.wheelDelta;
+            }
+
+            if (e.shiftKey) {
+                // reverse axis with shift key
+                return [-deltaY, -deltaX];
+            }
+            return [deltaX, deltaY];
+        }
+
+        function shouldBeConsumedByChild(target, deltaX, deltaY) {
+            // FIXME: this is a workaround for <select> issue in FF and IE #571
+            if (!env.isWebKit && element.querySelector('select:focus')) {
+                return true;
+            }
+
+            if (!element.contains(target)) {
+                return false;
+            }
+
+            var cursor = target;
+
+            while (cursor && cursor !== element) {
+                if (cursor.classList.contains(cls.element.consuming)) {
+                    return true;
+                }
+
+                var style = get(cursor);
+
+                // if deltaY && vertical scrollable
+                if (deltaY && style.overflowY.match(/(scroll|auto)/)) {
+                    var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
+                    if (maxScrollTop > 0) {
+                        if (
+                            (cursor.scrollTop > 0 && deltaY < 0) ||
+                            (cursor.scrollTop < maxScrollTop && deltaY > 0)
+                        ) {
+                            return true;
+                        }
+                    }
+                }
+                // if deltaX && horizontal scrollable
+                if (deltaX && style.overflowX.match(/(scroll|auto)/)) {
+                    var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
+                    if (maxScrollLeft > 0) {
+                        if (
+                            (cursor.scrollLeft > 0 && deltaX < 0) ||
+                            (cursor.scrollLeft < maxScrollLeft && deltaX > 0)
+                        ) {
+                            return true;
+                        }
+                    }
+                }
+
+                cursor = cursor.parentNode;
+            }
+
+            return false;
+        }
+
+        function mousewheelHandler(e) {
+            var ref = getDeltaFromEvent(e);
+            var deltaX = ref[0];
+            var deltaY = ref[1];
+
+            if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
+                return;
+            }
+
+            var shouldPrevent = false;
+            if (!i.settings.useBothWheelAxes) {
+                // deltaX will only be used for horizontal scrolling and deltaY will
+                // only be used for vertical scrolling - this is the default
+                element.scrollTop -= deltaY * i.settings.wheelSpeed;
+                element.scrollLeft += deltaX * i.settings.wheelSpeed;
+            } else if (i.scrollbarYActive && !i.scrollbarXActive) {
+                // only vertical scrollbar is active and useBothWheelAxes option is
+                // active, so let's scroll vertical bar using both mouse wheel axes
+                if (deltaY) {
+                    element.scrollTop -= deltaY * i.settings.wheelSpeed;
+                } else {
+                    element.scrollTop += deltaX * i.settings.wheelSpeed;
+                }
+                shouldPrevent = true;
+            } else if (i.scrollbarXActive && !i.scrollbarYActive) {
+                // useBothWheelAxes and only horizontal bar is active, so use both
+                // wheel axes for horizontal bar
+                if (deltaX) {
+                    element.scrollLeft += deltaX * i.settings.wheelSpeed;
+                } else {
+                    element.scrollLeft -= deltaY * i.settings.wheelSpeed;
+                }
+                shouldPrevent = true;
+            }
+
+            updateGeometry(i);
+
+            shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
+            if (shouldPrevent && !e.ctrlKey) {
+                e.stopPropagation();
+                e.preventDefault();
+            }
+        }
+
+        if (typeof window.onwheel !== 'undefined') {
+            i.event.bind(element, 'wheel', mousewheelHandler);
+        } else if (typeof window.onmousewheel !== 'undefined') {
+            i.event.bind(element, 'mousewheel', mousewheelHandler);
+        }
+    }
+
+    function touch(i) {
+        if (!env.supportsTouch && !env.supportsIePointer) {
+            return;
+        }
+
+        var element = i.element;
+
+        function shouldPrevent(deltaX, deltaY) {
+            var scrollTop = Math.floor(element.scrollTop);
+            var scrollLeft = element.scrollLeft;
+            var magnitudeX = Math.abs(deltaX);
+            var magnitudeY = Math.abs(deltaY);
+
+            if (magnitudeY > magnitudeX) {
+                // user is perhaps trying to swipe up/down the page
+
+                if (
+                    (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
+                    (deltaY > 0 && scrollTop === 0)
+                ) {
+                    // set prevent for mobile Chrome refresh
+                    return window.scrollY === 0 && deltaY > 0 && env.isChrome;
+                }
+            } else if (magnitudeX > magnitudeY) {
+                // user is perhaps trying to swipe left/right across the page
+
+                if (
+                    (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
+                    (deltaX > 0 && scrollLeft === 0)
+                ) {
+                    return true;
+                }
+            }
+
+            return true;
+        }
+
+        function applyTouchMove(differenceX, differenceY) {
+            element.scrollTop -= differenceY;
+            element.scrollLeft -= differenceX;
+
+            updateGeometry(i);
+        }
+
+        var startOffset = {};
+        var startTime = 0;
+        var speed = {};
+        var easingLoop = null;
+
+        function getTouch(e) {
+            if (e.targetTouches) {
+                return e.targetTouches[0];
+            } else {
+                // Maybe IE pointer
+                return e;
+            }
+        }
+
+        function shouldHandle(e) {
+            if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
+                return false;
+            }
+            if (e.targetTouches && e.targetTouches.length === 1) {
+                return true;
+            }
+            if (
+                e.pointerType &&
+                e.pointerType !== 'mouse' &&
+                e.pointerType !== e.MSPOINTER_TYPE_MOUSE
+            ) {
+                return true;
+            }
+            return false;
+        }
+
+        function touchStart(e) {
+            if (!shouldHandle(e)) {
+                return;
+            }
+
+            var touch = getTouch(e);
+
+            startOffset.pageX = touch.pageX;
+            startOffset.pageY = touch.pageY;
+
+            startTime = new Date().getTime();
+
+            if (easingLoop !== null) {
+                clearInterval(easingLoop);
+            }
+        }
+
+        function shouldBeConsumedByChild(target, deltaX, deltaY) {
+            if (!element.contains(target)) {
+                return false;
+            }
+
+            var cursor = target;
+
+            while (cursor && cursor !== element) {
+                if (cursor.classList.contains(cls.element.consuming)) {
+                    return true;
+                }
+
+                var style = get(cursor);
+
+                // if deltaY && vertical scrollable
+                if (deltaY && style.overflowY.match(/(scroll|auto)/)) {
+                    var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
+                    if (maxScrollTop > 0) {
+                        if (
+                            (cursor.scrollTop > 0 && deltaY < 0) ||
+                            (cursor.scrollTop < maxScrollTop && deltaY > 0)
+                        ) {
+                            return true;
+                        }
+                    }
+                }
+                // if deltaX && horizontal scrollable
+                if (deltaX && style.overflowX.match(/(scroll|auto)/)) {
+                    var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
+                    if (maxScrollLeft > 0) {
+                        if (
+                            (cursor.scrollLeft > 0 && deltaX < 0) ||
+                            (cursor.scrollLeft < maxScrollLeft && deltaX > 0)
+                        ) {
+                            return true;
+                        }
+                    }
+                }
+
+                cursor = cursor.parentNode;
+            }
+
+            return false;
+        }
+
+        function touchMove(e) {
+            if (shouldHandle(e)) {
+                var touch = getTouch(e);
+
+                var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
+
+                var differenceX = currentOffset.pageX - startOffset.pageX;
+                var differenceY = currentOffset.pageY - startOffset.pageY;
+
+                if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
+                    return;
+                }
+
+                applyTouchMove(differenceX, differenceY);
+                startOffset = currentOffset;
+
+                var currentTime = new Date().getTime();
+
+                var timeGap = currentTime - startTime;
+                if (timeGap > 0) {
+                    speed.x = differenceX / timeGap;
+                    speed.y = differenceY / timeGap;
+                    startTime = currentTime;
+                }
+
+                if (shouldPrevent(differenceX, differenceY)) {
+                    e.preventDefault();
+                }
+            }
+        }
+        function touchEnd() {
+            if (i.settings.swipeEasing) {
+                clearInterval(easingLoop);
+                easingLoop = setInterval(function() {
+                    if (i.isInitialized) {
+                        clearInterval(easingLoop);
+                        return;
+                    }
+
+                    if (!speed.x && !speed.y) {
+                        clearInterval(easingLoop);
+                        return;
+                    }
+
+                    if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
+                        clearInterval(easingLoop);
+                        return;
+                    }
+
+                    applyTouchMove(speed.x * 30, speed.y * 30);
+
+                    speed.x *= 0.8;
+                    speed.y *= 0.8;
+                }, 10);
+            }
+        }
+
+        if (env.supportsTouch) {
+            i.event.bind(element, 'touchstart', touchStart);
+            i.event.bind(element, 'touchmove', touchMove);
+            i.event.bind(element, 'touchend', touchEnd);
+        } else if (env.supportsIePointer) {
+            if (window.PointerEvent) {
+                i.event.bind(element, 'pointerdown', touchStart);
+                i.event.bind(element, 'pointermove', touchMove);
+                i.event.bind(element, 'pointerup', touchEnd);
+            } else if (window.MSPointerEvent) {
+                i.event.bind(element, 'MSPointerDown', touchStart);
+                i.event.bind(element, 'MSPointerMove', touchMove);
+                i.event.bind(element, 'MSPointerUp', touchEnd);
+            }
+        }
+    }
+
+    var defaultSettings = function () { return ({
+        handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
+        maxScrollbarLength: null,
+        minScrollbarLength: null,
+        scrollingThreshold: 1000,
+        scrollXMarginOffset: 0,
+        scrollYMarginOffset: 0,
+        suppressScrollX: false,
+        suppressScrollY: false,
+        swipeEasing: true,
+        useBothWheelAxes: false,
+        wheelPropagation: true,
+        wheelSpeed: 1,
+    }); };
+
+    var handlers = {
+        'click-rail': clickRail,
+        'drag-thumb': dragThumb,
+        keyboard: keyboard,
+        wheel: wheel,
+        touch: touch,
+    };
+
+    var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
+        var this$1 = this;
+        if ( userSettings === void 0 ) userSettings = {};
+
+        if (typeof element === 'string') {
+            element = document.querySelector(element);
+        }
+
+        if (!element || !element.nodeName) {
+            throw new Error('no element is specified to initialize PerfectScrollbar');
+        }
+
+        this.element = element;
+
+        element.classList.add(cls.main);
+
+        this.settings = defaultSettings();
+        for (var key in userSettings) {
+            this.settings[key] = userSettings[key];
+        }
+
+        this.containerWidth = null;
+        this.containerHeight = null;
+        this.contentWidth = null;
+        this.contentHeight = null;
+
+        var focus = function () { return element.classList.add(cls.state.focus); };
+        var blur = function () { return element.classList.remove(cls.state.focus); };
+
+        this.isRtl = get(element).direction === 'rtl';
+        if (this.isRtl === true) {
+            element.classList.add(cls.rtl);
+        }
+        this.isNegativeScroll = (function () {
+            var originalScrollLeft = element.scrollLeft;
+            var result = null;
+            element.scrollLeft = -1;
+            result = element.scrollLeft < 0;
+            element.scrollLeft = originalScrollLeft;
+            return result;
+        })();
+        this.negativeScrollAdjustment = this.isNegativeScroll
+            ? element.scrollWidth - element.clientWidth
+            : 0;
+        this.event = new EventManager();
+        this.ownerDocument = element.ownerDocument || document;
+
+        this.scrollbarXRail = div(cls.element.rail('x'));
+        element.appendChild(this.scrollbarXRail);
+        this.scrollbarX = div(cls.element.thumb('x'));
+        this.scrollbarXRail.appendChild(this.scrollbarX);
+        this.scrollbarX.setAttribute('tabindex', 0);
+        this.event.bind(this.scrollbarX, 'focus', focus);
+        this.event.bind(this.scrollbarX, 'blur', blur);
+        this.scrollbarXActive = null;
+        this.scrollbarXWidth = null;
+        this.scrollbarXLeft = null;
+        var railXStyle = get(this.scrollbarXRail);
+        this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
+        if (isNaN(this.scrollbarXBottom)) {
+            this.isScrollbarXUsingBottom = false;
+            this.scrollbarXTop = toInt(railXStyle.top);
+        } else {
+            this.isScrollbarXUsingBottom = true;
+        }
+        this.railBorderXWidth =
+            toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
+        // Set rail to display:block to calculate margins
+        set(this.scrollbarXRail, { display: 'block' });
+        this.railXMarginWidth =
+            toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
+        set(this.scrollbarXRail, { display: '' });
+        this.railXWidth = null;
+        this.railXRatio = null;
+
+        this.scrollbarYRail = div(cls.element.rail('y'));
+        element.appendChild(this.scrollbarYRail);
+        this.scrollbarY = div(cls.element.thumb('y'));
+        this.scrollbarYRail.appendChild(this.scrollbarY);
+        this.scrollbarY.setAttribute('tabindex', 0);
+        this.event.bind(this.scrollbarY, 'focus', focus);
+        this.event.bind(this.scrollbarY, 'blur', blur);
+        this.scrollbarYActive = null;
+        this.scrollbarYHeight = null;
+        this.scrollbarYTop = null;
+        var railYStyle = get(this.scrollbarYRail);
+        this.scrollbarYRight = parseInt(railYStyle.right, 10);
+        if (isNaN(this.scrollbarYRight)) {
+            this.isScrollbarYUsingRight = false;
+            this.scrollbarYLeft = toInt(railYStyle.left);
+        } else {
+            this.isScrollbarYUsingRight = true;
+        }
+        this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
+        this.railBorderYWidth =
+            toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
+        set(this.scrollbarYRail, { display: 'block' });
+        this.railYMarginHeight =
+            toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
+        set(this.scrollbarYRail, { display: '' });
+        this.railYHeight = null;
+        this.railYRatio = null;
+
+        this.reach = {
+            x:
+                element.scrollLeft <= 0
+                    ? 'start'
+                    : element.scrollLeft >= this.contentWidth - this.containerWidth
+                    ? 'end'
+                    : null,
+            y:
+                element.scrollTop <= 0
+                    ? 'start'
+                    : element.scrollTop >= this.contentHeight - this.containerHeight
+                    ? 'end'
+                    : null,
+        };
+
+        this.isAlive = true;
+
+        this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
+
+        this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
+        this.lastScrollLeft = element.scrollLeft; // for onScroll only
+        this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
+        updateGeometry(this);
+    };
+
+    PerfectScrollbar.prototype.update = function update () {
+        if (!this.isAlive) {
+            return;
+        }
+
+        // Recalcuate negative scrollLeft adjustment
+        this.negativeScrollAdjustment = this.isNegativeScroll
+            ? this.element.scrollWidth - this.element.clientWidth
+            : 0;
+
+        // Recalculate rail margins
+        set(this.scrollbarXRail, { display: 'block' });
+        set(this.scrollbarYRail, { display: 'block' });
+        this.railXMarginWidth =
+            toInt(get(this.scrollbarXRail).marginLeft) +
+            toInt(get(this.scrollbarXRail).marginRight);
+        this.railYMarginHeight =
+            toInt(get(this.scrollbarYRail).marginTop) +
+            toInt(get(this.scrollbarYRail).marginBottom);
+
+        // Hide scrollbars not to affect scrollWidth and scrollHeight
+        set(this.scrollbarXRail, { display: 'none' });
+        set(this.scrollbarYRail, { display: 'none' });
+
+        updateGeometry(this);
+
+        processScrollDiff(this, 'top', 0, false, true);
+        processScrollDiff(this, 'left', 0, false, true);
+
+        set(this.scrollbarXRail, { display: '' });
+        set(this.scrollbarYRail, { display: '' });
+    };
+
+    PerfectScrollbar.prototype.onScroll = function onScroll (e) {
+        if (!this.isAlive) {
+            return;
+        }
+
+        updateGeometry(this);
+        processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
+        processScrollDiff(
+            this,
+            'left',
+            this.element.scrollLeft - this.lastScrollLeft
+        );
+
+        this.lastScrollTop = Math.floor(this.element.scrollTop);
+        this.lastScrollLeft = this.element.scrollLeft;
+    };
+
+    PerfectScrollbar.prototype.destroy = function destroy () {
+        if (!this.isAlive) {
+            return;
+        }
+
+        this.event.unbindAll();
+        remove(this.scrollbarX);
+        remove(this.scrollbarY);
+        remove(this.scrollbarXRail);
+        remove(this.scrollbarYRail);
+        this.removePsClasses();
+
+        // unset elements
+        this.element = null;
+        this.scrollbarX = null;
+        this.scrollbarY = null;
+        this.scrollbarXRail = null;
+        this.scrollbarYRail = null;
+
+        this.isAlive = false;
+    };
+
+    PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
+        this.element.className = this.element.className
+            .split(' ')
+            .filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
+            .join(' ');
+    };
+
+    return PerfectScrollbar;
+
+})));
+//# sourceMappingURL=perfect-scrollbar.js.map
diff --git a/js/libs/perfect-scrollbar/perfect-scrollbar.min.js b/js/libs/perfect-scrollbar/perfect-scrollbar.min.js
deleted file mode 100644 (file)
index abc813f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*!
- * perfect-scrollbar v1.5.0
- * Copyright 2020 Hyunje Jun, MDBootstrap and Contributors
- * Licensed under MIT
- */(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a=a||self,a.PerfectScrollbar=b())})(this,function(){'use strict';var u=Math.abs,v=Math.floor;function a(a){return getComputedStyle(a)}function b(a,b){for(var c in b){var d=b[c];"number"==typeof d&&(d+="px"),a.style[c]=d}return a}function c(a){var b=document.createElement("div");return b.className=a,b}function d(a,b){if(!w)throw new Error("No element matching method supported");return w.call(a,b)}function e(a){a.remove?a.remove():a.parentNode&&a.parentNode.removeChild(a)}function f(a,b){return Array.prototype.filter.call(a.children,function(a){return d(a,b)})}function g(a,b){var c=a.element.classList,d=z.state.scrolling(b);c.contains(d)?clearTimeout(A[b]):c.add(d)}function h(a,b){A[b]=setTimeout(function(){return a.isAlive&&a.element.classList.remove(z.state.scrolling(b))},a.settings.scrollingThreshold)}function j(a,b){g(a,b),h(a,b)}function k(a){if("function"==typeof window.CustomEvent)return new CustomEvent(a);var b=document.createEvent("CustomEvent");return b.initCustomEvent(a,!1,!1,void 0),b}function l(a,b,c,d,e){void 0===d&&(d=!0),void 0===e&&(e=!1);var f;if("top"===b)f=["contentHeight","containerHeight","scrollTop","y","up","down"];else if("left"===b)f=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");m(a,c,f,d,e)}function m(a,b,c,d,e){var f=c[0],g=c[1],h=c[2],i=c[3],l=c[4],m=c[5];void 0===d&&(d=!0),void 0===e&&(e=!1);var n=a.element;// reset reach
-    a.reach[i]=null,1>n[h]&&(a.reach[i]="start"),n[h]>a[f]-a[g]-1&&(a.reach[i]="end"),b&&(n.dispatchEvent(k("ps-scroll-"+i)),0>b?n.dispatchEvent(k("ps-scroll-"+l)):0<b&&n.dispatchEvent(k("ps-scroll-"+m)),d&&j(a,i)),a.reach[i]&&(b||e)&&n.dispatchEvent(k("ps-"+i+"-reach-"+a.reach[i]))}function n(a){return parseInt(a,10)||0}function o(a){return d(a,"input,[contenteditable]")||d(a,"select,[contenteditable]")||d(a,"textarea,[contenteditable]")||d(a,"button,[contenteditable]")}function p(b){var c=a(b);return n(c.width)+n(c.paddingLeft)+n(c.paddingRight)+n(c.borderLeftWidth)+n(c.borderRightWidth)}function q(a){var b=Math.ceil,c=a.element,d=v(c.scrollTop),g=c.getBoundingClientRect();a.containerWidth=b(g.width),a.containerHeight=b(g.height),a.contentWidth=c.scrollWidth,a.contentHeight=c.scrollHeight,c.contains(a.scrollbarXRail)||(f(c,z.element.rail("x")).forEach(function(a){return e(a)}),c.appendChild(a.scrollbarXRail)),c.contains(a.scrollbarYRail)||(f(c,z.element.rail("y")).forEach(function(a){return e(a)}),c.appendChild(a.scrollbarYRail)),!a.settings.suppressScrollX&&a.containerWidth+a.settings.scrollXMarginOffset<a.contentWidth?(a.scrollbarXActive=!0,a.railXWidth=a.containerWidth-a.railXMarginWidth,a.railXRatio=a.containerWidth/a.railXWidth,a.scrollbarXWidth=r(a,n(a.railXWidth*a.containerWidth/a.contentWidth)),a.scrollbarXLeft=n((a.negativeScrollAdjustment+c.scrollLeft)*(a.railXWidth-a.scrollbarXWidth)/(a.contentWidth-a.containerWidth))):a.scrollbarXActive=!1,!a.settings.suppressScrollY&&a.containerHeight+a.settings.scrollYMarginOffset<a.contentHeight?(a.scrollbarYActive=!0,a.railYHeight=a.containerHeight-a.railYMarginHeight,a.railYRatio=a.containerHeight/a.railYHeight,a.scrollbarYHeight=r(a,n(a.railYHeight*a.containerHeight/a.contentHeight)),a.scrollbarYTop=n(d*(a.railYHeight-a.scrollbarYHeight)/(a.contentHeight-a.containerHeight))):a.scrollbarYActive=!1,a.scrollbarXLeft>=a.railXWidth-a.scrollbarXWidth&&(a.scrollbarXLeft=a.railXWidth-a.scrollbarXWidth),a.scrollbarYTop>=a.railYHeight-a.scrollbarYHeight&&(a.scrollbarYTop=a.railYHeight-a.scrollbarYHeight),s(c,a),a.scrollbarXActive?c.classList.add(z.state.active("x")):(c.classList.remove(z.state.active("x")),a.scrollbarXWidth=0,a.scrollbarXLeft=0,c.scrollLeft=!0===a.isRtl?a.contentWidth:0),a.scrollbarYActive?c.classList.add(z.state.active("y")):(c.classList.remove(z.state.active("y")),a.scrollbarYHeight=0,a.scrollbarYTop=0,c.scrollTop=0)}function r(a,b){var c=Math.min,d=Math.max;return a.settings.minScrollbarLength&&(b=d(b,a.settings.minScrollbarLength)),a.settings.maxScrollbarLength&&(b=c(b,a.settings.maxScrollbarLength)),b}function s(a,c){var d={width:c.railXWidth},e=v(a.scrollTop);d.left=c.isRtl?c.negativeScrollAdjustment+a.scrollLeft+c.containerWidth-c.contentWidth:a.scrollLeft,c.isScrollbarXUsingBottom?d.bottom=c.scrollbarXBottom-e:d.top=c.scrollbarXTop+e,b(c.scrollbarXRail,d);var f={top:e,height:c.railYHeight};c.isScrollbarYUsingRight?c.isRtl?f.right=c.contentWidth-(c.negativeScrollAdjustment+a.scrollLeft)-c.scrollbarYRight-c.scrollbarYOuterWidth-9:f.right=c.scrollbarYRight-a.scrollLeft:c.isRtl?f.left=c.negativeScrollAdjustment+a.scrollLeft+2*c.containerWidth-c.contentWidth-c.scrollbarYLeft-c.scrollbarYOuterWidth:f.left=c.scrollbarYLeft+a.scrollLeft,b(c.scrollbarYRail,f),b(c.scrollbarX,{left:c.scrollbarXLeft,width:c.scrollbarXWidth-c.railBorderXWidth}),b(c.scrollbarY,{top:c.scrollbarYTop,height:c.scrollbarYHeight-c.railBorderYWidth})}function t(a,b){function c(b){b.touches&&b.touches[0]&&(b[k]=b.touches[0].pageY),s[o]=t+v*(b[k]-u),g(a,p),q(a),b.stopPropagation(),b.preventDefault()}function d(){h(a,p),a[r].classList.remove(z.state.clicking),a.event.unbind(a.ownerDocument,"mousemove",c)}function f(b,e){t=s[o],e&&b.touches&&(b[k]=b.touches[0].pageY),u=b[k],v=(a[j]-a[i])/(a[l]-a[n]),e?a.event.bind(a.ownerDocument,"touchmove",c):(a.event.bind(a.ownerDocument,"mousemove",c),a.event.once(a.ownerDocument,"mouseup",d),b.preventDefault()),a[r].classList.add(z.state.clicking),b.stopPropagation()}var i=b[0],j=b[1],k=b[2],l=b[3],m=b[4],n=b[5],o=b[6],p=b[7],r=b[8],s=a.element,t=null,u=null,v=null;a.event.bind(a[m],"mousedown",function(a){f(a)}),a.event.bind(a[m],"touchstart",function(a){f(a,!0)})}var w="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector),z={main:"ps",rtl:"ps__rtl",element:{thumb:function(a){return"ps__thumb-"+a},rail:function(a){return"ps__rail-"+a},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(a){return"ps--active-"+a},scrolling:function(a){return"ps--scrolling-"+a}}},A={x:null,y:null},B=function(a){this.element=a,this.handlers={}},C={isEmpty:{configurable:!0}};B.prototype.bind=function(a,b){"undefined"==typeof this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this.element.addEventListener(a,b,!1)},B.prototype.unbind=function(a,b){var c=this;this.handlers[a]=this.handlers[a].filter(function(d){return!!(b&&d!==b)||(c.element.removeEventListener(a,d,!1),!1)})},B.prototype.unbindAll=function(){for(var a in this.handlers)this.unbind(a)},C.isEmpty.get=function(){var a=this;return Object.keys(this.handlers).every(function(b){return 0===a.handlers[b].length})},Object.defineProperties(B.prototype,C);var D=function(){this.eventElements=[]};D.prototype.eventElement=function(a){var b=this.eventElements.filter(function(b){return b.element===a})[0];return b||(b=new B(a),this.eventElements.push(b)),b},D.prototype.bind=function(a,b,c){this.eventElement(a).bind(b,c)},D.prototype.unbind=function(a,b,c){var d=this.eventElement(a);d.unbind(b,c),d.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(d),1)},D.prototype.unbindAll=function(){this.eventElements.forEach(function(a){return a.unbindAll()}),this.eventElements=[]},D.prototype.once=function(a,b,c){var d=this.eventElement(a),e=function(a){d.unbind(b,e),c(a)};d.bind(b,e)};var E={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&0<window.navigator.maxTouchPoints||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},F=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},G={"click-rail":function(a){a.element;a.event.bind(a.scrollbarY,"mousedown",function(a){return a.stopPropagation()}),a.event.bind(a.scrollbarYRail,"mousedown",function(b){var c=b.pageY-window.pageYOffset-a.scrollbarYRail.getBoundingClientRect().top,d=c>a.scrollbarYTop?1:-1;a.element.scrollTop+=d*a.containerHeight,q(a),b.stopPropagation()}),a.event.bind(a.scrollbarX,"mousedown",function(a){return a.stopPropagation()}),a.event.bind(a.scrollbarXRail,"mousedown",function(b){var c=b.pageX-window.pageXOffset-a.scrollbarXRail.getBoundingClientRect().left,d=c>a.scrollbarXLeft?1:-1;a.element.scrollLeft+=d*a.containerWidth,q(a),b.stopPropagation()})},"drag-thumb":function(a){t(a,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),t(a,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(a){function b(b,d){var e=v(c.scrollTop);if(0===b){if(!a.scrollbarYActive)return!1;if(0===e&&0<d||e>=a.contentHeight-a.containerHeight&&0>d)return!a.settings.wheelPropagation}var f=c.scrollLeft;if(0===d){if(!a.scrollbarXActive)return!1;if(0===f&&0>b||f>=a.contentWidth-a.containerWidth&&0<b)return!a.settings.wheelPropagation}return!0}var c=a.element,f=function(){return d(c,":hover")},g=function(){return d(a.scrollbarX,":focus")||d(a.scrollbarY,":focus")};a.event.bind(a.ownerDocument,"keydown",function(d){if(!(d.isDefaultPrevented&&d.isDefaultPrevented()||d.defaultPrevented)&&(f()||g())){var e=document.activeElement?document.activeElement:a.ownerDocument.activeElement;if(e){if("IFRAME"===e.tagName)e=e.contentDocument.activeElement;else// go deeper if element is a webcomponent
-        for(;e.shadowRoot;)e=e.shadowRoot.activeElement;if(o(e))return}var h=0,i=0;switch(d.which){case 37:h=d.metaKey?-a.contentWidth:d.altKey?-a.containerWidth:-30;break;case 38:i=d.metaKey?a.contentHeight:d.altKey?a.containerHeight:30;break;case 39:h=d.metaKey?a.contentWidth:d.altKey?a.containerWidth:30;break;case 40:i=d.metaKey?-a.contentHeight:d.altKey?-a.containerHeight:-30;break;case 32:i=d.shiftKey?a.containerHeight:-a.containerHeight;break;case 33:i=a.containerHeight;break;case 34:i=-a.containerHeight;break;case 36:i=a.contentHeight;break;case 35:i=-a.contentHeight;break;default:return;}a.settings.suppressScrollX&&0!==h||a.settings.suppressScrollY&&0!==i||(c.scrollTop-=i,c.scrollLeft+=h,q(a),b(h,i)&&d.preventDefault())}})},wheel:function(b){function c(a,c){var d,e=v(h.scrollTop),f=0===h.scrollTop,g=e+h.offsetHeight===h.scrollHeight,i=0===h.scrollLeft,j=h.scrollLeft+h.offsetWidth===h.scrollWidth;return d=u(c)>u(a)?f||g:i||j,!d||!b.settings.wheelPropagation}function d(a){var b=a.deltaX,c=-1*a.deltaY;return("undefined"==typeof b||"undefined"==typeof c)&&(b=-1*a.wheelDeltaX/6,c=a.wheelDeltaY/6),a.deltaMode&&1===a.deltaMode&&(b*=10,c*=10),b!==b&&c!==c/* NaN checks */&&(b=0,c=a.wheelDelta),a.shiftKey?[-c,-b]:[b,c]}function f(b,c,d){// FIXME: this is a workaround for <select> issue in FF and IE #571
-        if(!E.isWebKit&&h.querySelector("select:focus"))return!0;if(!h.contains(b))return!1;for(var e=b;e&&e!==h;){if(e.classList.contains(z.element.consuming))return!0;var f=a(e);// if deltaY && vertical scrollable
-            if(d&&f.overflowY.match(/(scroll|auto)/)){var g=e.scrollHeight-e.clientHeight;if(0<g&&(0<e.scrollTop&&0>d||e.scrollTop<g&&0<d))return!0}// if deltaX && horizontal scrollable
-            if(c&&f.overflowX.match(/(scroll|auto)/)){var i=e.scrollWidth-e.clientWidth;if(0<i&&(0<e.scrollLeft&&0>c||e.scrollLeft<i&&0<c))return!0}e=e.parentNode}return!1}function g(a){var e=d(a),g=e[0],i=e[1];if(!f(a.target,g,i)){var j=!1;b.settings.useBothWheelAxes?b.scrollbarYActive&&!b.scrollbarXActive?(i?h.scrollTop-=i*b.settings.wheelSpeed:h.scrollTop+=g*b.settings.wheelSpeed,j=!0):b.scrollbarXActive&&!b.scrollbarYActive&&(g?h.scrollLeft+=g*b.settings.wheelSpeed:h.scrollLeft-=i*b.settings.wheelSpeed,j=!0):(h.scrollTop-=i*b.settings.wheelSpeed,h.scrollLeft+=g*b.settings.wheelSpeed),q(b),j=j||c(g,i),j&&!a.ctrlKey&&(a.stopPropagation(),a.preventDefault())}}var h=b.element;"undefined"==typeof window.onwheel?"undefined"!=typeof window.onmousewheel&&b.event.bind(h,"mousewheel",g):b.event.bind(h,"wheel",g)},touch:function(b){function c(a,c){var d=v(l.scrollTop),e=l.scrollLeft,f=u(a),g=u(c);if(g>f){// user is perhaps trying to swipe up/down the page
-        if(0>c&&d===b.contentHeight-b.containerHeight||0<c&&0===d)// set prevent for mobile Chrome refresh
-            return 0===window.scrollY&&0<c&&E.isChrome;}else if(f>g&&(0>a&&e===b.contentWidth-b.containerWidth||0<a&&0===e))// user is perhaps trying to swipe left/right across the page
-        return!0;return!0}function d(a,c){l.scrollTop-=c,l.scrollLeft-=a,q(b)}function f(a){return a.targetTouches?a.targetTouches[0]:a}function g(a){return!(a.pointerType&&"pen"===a.pointerType&&0===a.buttons)&&(!!(a.targetTouches&&1===a.targetTouches.length)||!!(a.pointerType&&"mouse"!==a.pointerType&&a.pointerType!==a.MSPOINTER_TYPE_MOUSE))}function h(a){if(g(a)){var b=f(a);m.pageX=b.pageX,m.pageY=b.pageY,n=new Date().getTime(),null!==p&&clearInterval(p)}}function i(b,c,d){if(!l.contains(b))return!1;for(var e=b;e&&e!==l;){if(e.classList.contains(z.element.consuming))return!0;var f=a(e);// if deltaY && vertical scrollable
-        if(d&&f.overflowY.match(/(scroll|auto)/)){var g=e.scrollHeight-e.clientHeight;if(0<g&&(0<e.scrollTop&&0>d||e.scrollTop<g&&0<d))return!0}// if deltaX && horizontal scrollable
-        if(c&&f.overflowX.match(/(scroll|auto)/)){var h=e.scrollWidth-e.clientWidth;if(0<h&&(0<e.scrollLeft&&0>c||e.scrollLeft<h&&0<c))return!0}e=e.parentNode}return!1}function j(a){if(g(a)){var b=f(a),e={pageX:b.pageX,pageY:b.pageY},h=e.pageX-m.pageX,j=e.pageY-m.pageY;if(i(a.target,h,j))return;d(h,j),m=e;var k=new Date().getTime(),l=k-n;0<l&&(o.x=h/l,o.y=j/l,n=k),c(h,j)&&a.preventDefault()}}function k(){b.settings.swipeEasing&&(clearInterval(p),p=setInterval(function(){return b.isInitialized?void clearInterval(p):o.x||o.y?.01>u(o.x)&&.01>u(o.y)?void clearInterval(p):void(d(30*o.x,30*o.y),o.x*=.8,o.y*=.8):void clearInterval(p)},10))}if(E.supportsTouch||E.supportsIePointer){var l=b.element,m={},n=0,o={},p=null;E.supportsTouch?(b.event.bind(l,"touchstart",h),b.event.bind(l,"touchmove",j),b.event.bind(l,"touchend",k)):E.supportsIePointer&&(window.PointerEvent?(b.event.bind(l,"pointerdown",h),b.event.bind(l,"pointermove",j),b.event.bind(l,"pointerup",k)):window.MSPointerEvent&&(b.event.bind(l,"MSPointerDown",h),b.event.bind(l,"MSPointerMove",j),b.event.bind(l,"MSPointerUp",k)))}}},H=function(d,e){var f=this;if(void 0===e&&(e={}),"string"==typeof d&&(d=document.querySelector(d)),!d||!d.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var g in this.element=d,d.classList.add(z.main),this.settings=F(),e)this.settings[g]=e[g];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var h=function(){return d.classList.add(z.state.focus)},i=function(){return d.classList.remove(z.state.focus)};this.isRtl="rtl"===a(d).direction,!0===this.isRtl&&d.classList.add(z.rtl),this.isNegativeScroll=function(){var a=d.scrollLeft,b=null;return d.scrollLeft=-1,b=0>d.scrollLeft,d.scrollLeft=a,b}(),this.negativeScrollAdjustment=this.isNegativeScroll?d.scrollWidth-d.clientWidth:0,this.event=new D,this.ownerDocument=d.ownerDocument||document,this.scrollbarXRail=c(z.element.rail("x")),d.appendChild(this.scrollbarXRail),this.scrollbarX=c(z.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",h),this.event.bind(this.scrollbarX,"blur",i),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var j=a(this.scrollbarXRail);this.scrollbarXBottom=parseInt(j.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=n(j.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=n(j.borderLeftWidth)+n(j.borderRightWidth),b(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=n(j.marginLeft)+n(j.marginRight),b(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=c(z.element.rail("y")),d.appendChild(this.scrollbarYRail),this.scrollbarY=c(z.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",h),this.event.bind(this.scrollbarY,"blur",i),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var k=a(this.scrollbarYRail);this.scrollbarYRight=parseInt(k.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=n(k.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p(this.scrollbarY):null,this.railBorderYWidth=n(k.borderTopWidth)+n(k.borderBottomWidth),b(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=n(k.marginTop)+n(k.marginBottom),b(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:0>=d.scrollLeft?"start":d.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:0>=d.scrollTop?"start":d.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(a){return G[a](f)}),this.lastScrollTop=v(d.scrollTop),this.lastScrollLeft=d.scrollLeft,this.event.bind(this.element,"scroll",function(a){return f.onScroll(a)}),q(this)};return H.prototype.update=function(){this.isAlive&&(// Recalcuate negative scrollLeft adjustment
-// Recalculate rail margins
-// Hide scrollbars not to affect scrollWidth and scrollHeight
-    this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,b(this.scrollbarXRail,{display:"block"}),b(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=n(a(this.scrollbarXRail).marginLeft)+n(a(this.scrollbarXRail).marginRight),this.railYMarginHeight=n(a(this.scrollbarYRail).marginTop)+n(a(this.scrollbarYRail).marginBottom),b(this.scrollbarXRail,{display:"none"}),b(this.scrollbarYRail,{display:"none"}),q(this),l(this,"top",0,!1,!0),l(this,"left",0,!1,!0),b(this.scrollbarXRail,{display:""}),b(this.scrollbarYRail,{display:""}))},H.prototype.onScroll=function(){this.isAlive&&(q(this),l(this,"top",this.element.scrollTop-this.lastScrollTop),l(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=v(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},H.prototype.destroy=function(){this.isAlive&&(// unset elements
-    this.event.unbindAll(),e(this.scrollbarX),e(this.scrollbarY),e(this.scrollbarXRail),e(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},H.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(a){return!a.match(/^ps([-_].+|)$/)}).join(" ")},H});
-//# sourceMappingURL=perfect-scrollbar.min.js.map
index 120e596d2ae4207154d4dd99c11c3297cc035fc0..bf5f7922679a809213f1437067ffa7fe072c1fa3 100644 (file)
 
       .items {
         width: 520px;
-        max-height: unit(@h - 170, px);
+        max-height: unit(@h - 150, px);
         position: relative;
 
         .item {