/*
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 { ColumnFilterCondition } from "./ColumnFilterCondition";
import { ColumnFilterConditionCollection } from "./ColumnFilterConditionCollection";
import { Base, typeCast, markType } from "igniteui-webcomponents-core";
import { FilterFactory } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
export let ColumnFilterConditionGroup = /*@__PURE__*/ (() => {
    class ColumnFilterConditionGroup extends ColumnFilterCondition {
        constructor() {
            super();
            this.f = false;
            this.e = null;
            this.e = new ColumnFilterConditionCollection();
            this.f = false;
        }
        b() {
            return true;
        }
        equals(a) {
            if (a == null) {
                return false;
            }
            if (!(typeCast(ColumnFilterConditionGroup.$, a) !== null)) {
                return false;
            }
            let b = a;
            if (b.g != this.g) {
                return false;
            }
            for (let c = 0; c < this.g; c++) {
                if (!Base.equalsStatic(this.item(c), b.item(c))) {
                    return false;
                }
            }
            return true;
        }
        get g() {
            return this.e.count;
        }
        h(a) {
            this.e.add(a);
        }
        j(a) {
            this.e.remove(a);
        }
        k(a) {
            this.e.removeAt(a);
        }
        item(a, b) {
            if (arguments.length === 2) {
                this.e._inner[a] = b;
                return b;
            }
            else {
                return this.e._inner[a];
            }
        }
        i() {
            this.e.clear();
        }
        c() {
            let a = new Array(this.e.count);
            for (let b = 0; b < this.e.count; b++) {
                a[b] = this.e._inner[b];
            }
            return a;
        }
        a(a, b) {
            if (this.e.count == 0) {
                return null;
            }
            let c = this.e._inner[this.e.count - 1].a(a, b);
            for (let 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 = /*@__PURE__*/ markType(ColumnFilterConditionGroup, 'ColumnFilterConditionGroup', ColumnFilterCondition.$);
    return ColumnFilterConditionGroup;
})();
//# sourceMappingURL=ColumnFilterConditionGroup.js.map
