define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Utils = /** @class */ (function () {
        function Utils() {
        }
        Utils.debounce = function (func, wait, immediate) {
            var _this = this;
            if (immediate === void 0) { immediate = false; }
            var timeout;
            return function () {
                var args = [];
                for (var _i = 0; _i < arguments.length; _i++) {
                    args[_i] = arguments[_i];
                }
                var later = function () {
                    timeout = null;
                    if (!immediate) {
                        func.apply(_this, args);
                    }
                    ;
                };
                var callNow = immediate && !timeout;
                clearTimeout(timeout);
                timeout = setTimeout(later, wait);
                if (callNow) {
                    func.apply(_this, args);
                }
                ;
            };
        };
        Utils.isTouchDevice = function () {
            try {
                document.createEvent('TouchEvent');
                return true;
            }
            catch (e) {
                return false;
            }
        };
        Utils.toggleNoScrollBodyState = function () {
            if (document.body.classList.contains('no-scroll')) {
                document.body.classList.remove('no-scroll');
            }
            else {
                document.body.classList.add('no-scroll');
            }
        };
        return Utils;
    }());
    exports.Utils = Utils;
});
//# sourceMappingURL=Utils.js.map