/*
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 { ExcelCalcErrorValue } from "./ExcelCalcErrorValue";
import { markType } from "igniteui-angular-core";
/**
 * @hidden
 */
var UltraCalcFunctionErrorType = /** @class */ (function (_super) {
    tslib_1.__extends(UltraCalcFunctionErrorType, _super);
    function UltraCalcFunctionErrorType() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    UltraCalcFunctionErrorType.prototype.evaluate = function (a, b) {
        var c;
        var d = a.pop();
        if (d.isError) {
            var e = d.toErrorValue();
            switch (e.code) {
                case 6:
                    c = 1;
                    break;
                case 2:
                    c = 2;
                    break;
                case 1:
                    c = 3;
                    break;
                case 0:
                    c = 4;
                    break;
                case 7:
                    c = 5;
                    break;
                case 4:
                    c = 6;
                    break;
                case 3:
                    c = 7;
                    break;
                default: return new ExcelCalcValue(new ExcelCalcErrorValue(3));
            }
            return new ExcelCalcValue(c);
        }
        else {
            return new ExcelCalcValue(new ExcelCalcErrorValue(3));
        }
    };
    UltraCalcFunctionErrorType.prototype.get_name = function () {
        return "errortype";
    };
    Object.defineProperty(UltraCalcFunctionErrorType.prototype, "name", {
        get: function () {
            return this.get_name();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionErrorType.prototype.get_minArgs = function () {
        return 1;
    };
    Object.defineProperty(UltraCalcFunctionErrorType.prototype, "minArgs", {
        get: function () {
            return this.get_minArgs();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionErrorType.prototype.get_maxArgs = function () {
        return 1;
    };
    Object.defineProperty(UltraCalcFunctionErrorType.prototype, "maxArgs", {
        get: function () {
            return this.get_maxArgs();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionErrorType.$t = markType(UltraCalcFunctionErrorType, 'UltraCalcFunctionErrorType', BuiltInFunctionBase.$);
    return UltraCalcFunctionErrorType;
}(BuiltInFunctionBase));
export { UltraCalcFunctionErrorType };
//# sourceMappingURL=UltraCalcFunctionErrorType.js.map