/*
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 { ColumnFilterCondition } from "./ColumnFilterCondition";
import { ColumnFilterConditionCollection } from "./ColumnFilterConditionCollection";
import { Base, typeCast, markType } from "igniteui-webcomponents-core";
import { FilterFactory } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var ColumnFilterConditionGroup = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(ColumnFilterConditionGroup, _super);
    function ColumnFilterConditionGroup() {
        var _this = _super.call(this) || this;
        _this.f = false;
        _this.e = null;
        _this.e = new ColumnFilterConditionCollection();
        _this.f = false;
        return _this;
    }
    ColumnFilterConditionGroup.prototype.b = function () {
        return true;
    };
    ColumnFilterConditionGroup.prototype.equals = function (a) {
        if (a == null) {
            return false;
        }
        if (!(typeCast(ColumnFilterConditionGroup.$, a) !== null)) {
            return false;
        }
        var b = a;
        if (b.g != this.g) {
            return false;
        }
        for (var c = 0; c < this.g; c++) {
            if (!Base.equalsStatic(this.item(c), b.item(c))) {
                return false;
            }
        }
        return true;
    };
    Object.defineProperty(ColumnFilterConditionGroup.prototype, "g", {
        get: function () {
            return this.e.count;
        },
        enumerable: true,
        configurable: true
    });
    ColumnFilterConditionGroup.prototype.h = function (a) {
        this.e.add(a);
    };
    ColumnFilterConditionGroup.prototype.j = function (a) {
        this.e.remove(a);
    };
    ColumnFilterConditionGroup.prototype.k = function (a) {
        this.e.removeAt(a);
    };
    ColumnFilterConditionGroup.prototype.item = function (a, b) {
        if (arguments.length === 2) {
            this.e._inner[a] = b;
            return b;
        }
        else {
            return this.e._inner[a];
        }
    };
    ColumnFilterConditionGroup.prototype.i = function () {
        this.e.clear();
    };
    ColumnFilterConditionGroup.prototype.c = function () {
        var a = new Array(this.e.count);
        for (var b = 0; b < this.e.count; b++) {
            a[b] = this.e._inner[b];
        }
        return a;
    };
    ColumnFilterConditionGroup.prototype.a = function (a, b) {
        if (this.e.count == 0) {
            return null;
        }
        var c = this.e._inner[this.e.count - 1].a(a, b);
        for (var d = this.e.count - 2; d >= 0; d--) {
            if (this.f) {
                c = FilterFactory.instance.or(this.e._inner[d].a(a, b), c);
            }
            else {
                c = FilterFactory.instance.and(this.e._inner[d].a(a, b), c);
            }
        }
        return c;
    };
    ColumnFilterConditionGroup.$t = markType(ColumnFilterConditionGroup, 'ColumnFilterConditionGroup', ColumnFilterCondition.$);
    return ColumnFilterConditionGroup;
}(ColumnFilterCondition));
export { ColumnFilterConditionGroup };
//# sourceMappingURL=ColumnFilterConditionGroup.js.map
