/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { BuiltInFunctionBase } from "./BuiltInFunctionBase";
import { ExcelCalcValue } from "./ExcelCalcValue";
import { typeCast, Date_$type, markType } from "igniteui-angular-core";
/**
 * @hidden
 */
var UltraCalcFunctionN = /** @class */ (function (_super) {
    tslib_1.__extends(UltraCalcFunctionN, _super);
    function UltraCalcFunctionN() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    UltraCalcFunctionN.prototype.evaluate = function (a, b) {
        var c = a.pop();
        if (c.isError) {
            return new ExcelCalcValue(c.toErrorValue());
        }
        var d;
        if (c.isBoolean) {
            d = c._toBoolean1() ? 1 : 0;
            return new ExcelCalcValue(d);
        }
        var e = c._getResolvedValue();
        if (typeCast(Date_$type, e) !== null) {
            return new ExcelCalcValue(e);
        }
        if (typeof e === 'string') {
            return new ExcelCalcValue(0);
        }
        var f = ((function () { var g = c._toDouble1(d); d = g.p0; return g.ret; })());
        if (f) {
            return new ExcelCalcValue(d);
        }
        return new ExcelCalcValue(0);
    };
    UltraCalcFunctionN.prototype.get_name = function () {
        return "n";
    };
    Object.defineProperty(UltraCalcFunctionN.prototype, "name", {
        get: function () {
            return this.get_name();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionN.prototype.get_minArgs = function () {
        return 1;
    };
    Object.defineProperty(UltraCalcFunctionN.prototype, "minArgs", {
        get: function () {
            return this.get_minArgs();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionN.prototype.get_maxArgs = function () {
        return 1;
    };
    Object.defineProperty(UltraCalcFunctionN.prototype, "maxArgs", {
        get: function () {
            return this.get_maxArgs();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionN.prototype.doesParameterAllowIntermediateResultArray = function (a, b) {
        return (b == false);
    };
    UltraCalcFunctionN.$t = markType(UltraCalcFunctionN, 'UltraCalcFunctionN', BuiltInFunctionBase.$);
    return UltraCalcFunctionN;
}(BuiltInFunctionBase));
export { UltraCalcFunctionN };
//# sourceMappingURL=UltraCalcFunctionN.js.map