/*
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 { BuiltInFunctionBase } from "./BuiltInFunctionBase";
import { ExcelCalcValue } from "./ExcelCalcValue";
import { StringBuilder } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { fromEn, markType } from "igniteui-angular-core";
/**
 * @hidden
 */
export class UltraCalcFunctionConcatenate extends BuiltInFunctionBase {
    evaluate(a, b) {
        let c = new StringBuilder(0);
        let d = new List$1(ExcelCalcValue.$, 0);
        for (let e = 0; e < b; e++) {
            d.add(a.pop());
        }
        for (let f = d.count; f > 0; f--) {
            let g = d._inner[f - 1];
            if (!true && g.isReference && g.toReference().isEnumerable) {
                let h = g.toReference().references;
                for (let i of fromEn(h)) {
                    if (i.value.isError) {
                        return new ExcelCalcValue(i.value.toErrorValue());
                    }
                    c.l(i.value.toString());
                }
            }
            else {
                if (g.isError) {
                    return new ExcelCalcValue(g.toErrorValue());
                }
                c.l(g.toString());
            }
        }
        return new ExcelCalcValue(c.toString());
    }
    canParameterBeEnumerable(a) {
        return true;
    }
    get_name() {
        return "concatenate";
    }
    get name() {
        return this.get_name();
    }
    get_minArgs() {
        return 1;
    }
    get minArgs() {
        return this.get_minArgs();
    }
    get_maxArgs() {
        return 0x7FFFFFFF;
    }
    get maxArgs() {
        return this.get_maxArgs();
    }
    doesParameterAllowIntermediateResultArray(a, b) {
        return true;
    }
}
UltraCalcFunctionConcatenate.$t = markType(UltraCalcFunctionConcatenate, 'UltraCalcFunctionConcatenate', BuiltInFunctionBase.$);
//# sourceMappingURL=UltraCalcFunctionConcatenate.js.map