(function (global, factory) {
    if (typeof define === 'function' && define.amd) {
        define(['exports', 'module', './jquery', './internal/deprecation', './internal/globalize'], factory);
    } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
        factory(exports, module, require('./jquery'), require('./internal/deprecation'), require('./internal/globalize'));
    } else {
        var mod = {
            exports: {}
        };
        factory(mod.exports, mod, global.$, global.deprecation, global.globalize);
        global.setVisible = mod.exports;
    }
})(this, function (exports, module, _jquery, _internalDeprecation, _internalGlobalize) {
    'use strict';

    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

    var _$ = _interopRequireDefault(_jquery);

    var _globalize = _interopRequireDefault(_internalGlobalize);

    /**
     * Shortcut function adds or removes 'hidden' classname to an element based on a passed boolean.
     *
     * @param {String | Element} element The element or an ID to show or hide.
     * @param {boolean} show true to show, false to hide.
     *
     * @returns {undefined}
     */
    function setVisible(element, show) {
        if (!(element = (0, _$['default'])(element))) {
            return;
        }

        (0, _$['default'])(element).each(function () {
            var isHidden = (0, _$['default'])(this).hasClass('hidden');

            if (isHidden && show) {
                (0, _$['default'])(this).removeClass('hidden');
            } else if (!isHidden && !show) {
                (0, _$['default'])(this).addClass('hidden');
            }
        });
    }

    var setVisible = (0, _internalDeprecation.fn)(setVisible, 'setVisible', {
        sinceVersion: '5.9.0',
        extraInfo: 'No alternative will be provided. Use jQuery.addClass() / removeClass() instead.'
    });

    (0, _globalize['default'])('setVisible', setVisible);

    module.exports = setVisible;
});
//# sourceMappingURL=../../js/aui/set-visible.js.map