import { __spreadArray } from "tslib";
var __DEV__ = process.env.NODE_ENV !== 'production';
var warning = function (_shouldBeTrue, _format) {
    var _args = [];
    for (var _i = 2; _i < arguments.length; _i++) {
        _args[_i - 2] = arguments[_i];
    }
};
if (__DEV__) {
    var printWarning_1 = function (format) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        var argIndex = 0;
        var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; });
        if (typeof console !== 'undefined') {
            console.error(message);
        }
        try {
            throw new Error(message);
        }
        catch (x) {
        }
    };
    warning = function (shouldBeTrue, format) {
        var args = [];
        for (var _i = 2; _i < arguments.length; _i++) {
            args[_i - 2] = arguments[_i];
        }
        if (format === undefined) {
            throw new Error('`warning(shouldBeTrue, format, ...args)` requires a warning ' +
                'message argument');
        }
        if (!shouldBeTrue) {
            printWarning_1.apply(void 0, __spreadArray([format], args));
        }
    };
}
export { warning };
export default warning;
