/* !
  Copyright (c) 2018 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/
import { __read, __spreadArray } from "tslib";
function classNames() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    var classes = [];
    var _loop_1 = function (i) {
        var arg = args[i];
        if (!arg)
            return "continue";
        var argType = typeof arg;
        if (argType === 'string' || argType === 'number') {
            classes.push(arg);
        }
        else if (Array.isArray(arg)) {
            if (arg.length) {
                var inner = classes.push(classNames.apply(void 0, __spreadArray([], __read(arg), false)));
                if (inner) {
                    classes.push(inner);
                }
            }
        }
        else if (argType === 'object') {
            if (arg.toString === Object.prototype.toString) {
                Object.keys(arg).forEach(function (key) {
                    arg[key] && classes.push(key);
                });
            }
            else {
                classes.push(arg.toString());
            }
        }
    };
    for (var i = 0; i < args.length; i++) {
        _loop_1(i);
    }
    return classes.join(' ');
}
export default classNames;
//# sourceMappingURL=classnames.js.map