var __spreadArrays = (this && this.__spreadArrays) || function () {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
};
var OVERLAY_OPEN_CLASS = 'anj-overlay-open';
var ActionKey;
(function (ActionKey) {
    ActionKey["ArrowUp"] = "ArrowUp";
    ActionKey["ArrowDown"] = "ArrowDown";
    ActionKey["Enter"] = "Enter";
    ActionKey["Escape"] = "Escape";
})(ActionKey || (ActionKey = {}));
var ActionKeys = Object.values(ActionKey);
var BreakPoint;
(function (BreakPoint) {
    BreakPoint[BreakPoint["Xsmall"] = 0] = "Xsmall";
    BreakPoint[BreakPoint["Small"] = 576] = "Small";
    BreakPoint[BreakPoint["Medium"] = 768] = "Medium";
    BreakPoint[BreakPoint["Large"] = 992] = "Large";
    BreakPoint[BreakPoint["Xlarge"] = 1200] = "Xlarge";
})(BreakPoint || (BreakPoint = {}));
var PagerSizeOption;
(function (PagerSizeOption) {
    PagerSizeOption[PagerSizeOption["Xsmall"] = 10] = "Xsmall";
    PagerSizeOption[PagerSizeOption["Small"] = 15] = "Small";
    PagerSizeOption[PagerSizeOption["Medium"] = 20] = "Medium";
    PagerSizeOption[PagerSizeOption["Large"] = 30] = "Large";
    PagerSizeOption[PagerSizeOption["XLarge"] = 50] = "XLarge";
})(PagerSizeOption || (PagerSizeOption = {}));
var boolValueChanged = function (newValue, oldValue) {
    return !(!newValue && !oldValue);
};
var onBoolValueChanged = function (newValue, oldValue, cb) {
    var changed = boolValueChanged(newValue, oldValue);
    if (changed) {
        cb(newValue);
    }
    return newValue;
};
var coerceToNumber = function (value, defValue) {
    return typeof value === 'string' && !isNaN(value) ? parseInt(value, 10) : defValue;
};
var concatClasses = function () {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    var classList = [];
    // Really wanted to do this as a reducer but it never worked out
    args.forEach(function (arg) {
        classList = arg && Array.isArray(arg) ? classList.concat(arg) : classList.concat([arg]);
    });
    return classList.join(' ');
};
var debounce = function (func, wait) {
    if (wait === void 0) { wait = 0; }
    var timer;
    return function () {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
        }
        clearTimeout(timer);
        timer = setTimeout.apply(void 0, __spreadArrays([func, wait], args));
    };
};
var debounceEvent = function (event, wait) {
    var original = event._original || event;
    return {
        _original: event,
        emit: debounce(original.emit.bind(original), wait)
    };
};
var derivedId = function (id, postfix) {
    return id + "-" + postfix;
};
var evalToBool = function (value) {
    return value !== null && value !== 'false' && value !== '0';
};
var enterAsClick = function (cb) {
    return function (event) {
        if (event.code === 'Enter') {
            cb(event);
        }
    };
};
var hasValue = function (value) {
    if (Array.isArray(value)) {
        return value.length > 0;
    }
    else if (typeof value === 'string') {
        return (value && value.trim().length > 0);
    }
    else {
        return (value !== null && value !== undefined);
    }
};
export { ActionKey as A, BreakPoint as B, OVERLAY_OPEN_CLASS as O, PagerSizeOption as P, ActionKeys as a, boolValueChanged as b, coerceToNumber as c, concatClasses as d, debounce as e, debounceEvent as f, derivedId as g, evalToBool as h, enterAsClick as i, hasValue as j, onBoolValueChanged as o };
