/*
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 { Base, String_$type, fromEnum, markType } from "./type";
import { ISummaryResult_$type } from "./ISummaryResult";
import { FastIterationDictionary$2 } from "./FastIterationDictionary$2";
import { List$1 } from "./List$1";
import { stringIsNullOrWhiteSpace } from "./string";
/**
 * @hidden
 */
export let DataSourceSpecialRow = /*@__PURE__*/ (() => {
    class DataSourceSpecialRow extends Base {
        constructor() {
            super(...arguments);
            this.$$isSpecialRow = true;
            this.f = new FastIterationDictionary$2(String_$type, Base.$, 0);
            this.e = new FastIterationDictionary$2(String_$type, Base.$, 0);
            this._rowType = 0;
            this._targetRow = null;
            this._level = 0;
            this._summaryResults = null;
        }
        get rowType() {
            return this._rowType;
        }
        set rowType(a) {
            this._rowType = a;
        }
        get targetRow() {
            return this._targetRow;
        }
        set targetRow(a) {
            this._targetRow = a;
        }
        get level() {
            return this._level;
        }
        set level(a) {
            this._level = a;
        }
        get summaryResults() {
            return this._summaryResults;
        }
        set summaryResults(a) {
            this._summaryResults = a;
        }
        getValue(a) {
            if (a == "SectionInformation") {
                return this.e;
            }
            let b = null;
            if (((() => { let c = this.f.h(a, b); b = c.p1; return c.ret; })())) {
                return b;
            }
            b = this.getSummaryValue(a);
            return b;
        }
        getSectionValue(a) {
            if (a == "SectionInformation") {
                return this.e;
            }
            let b = null;
            if (((() => { let c = this.e.h(a, b); b = c.p1; return c.ret; })())) {
                return b;
            }
            b = this.getSummaryValue(a);
            return b;
        }
        setValue(a, b) {
            this.f.item(a, b);
        }
        setSectionValue(a, b) {
            this.e.item(a, b);
        }
        getSectionKeys() {
            let a = new Array(this.e.r);
            let b = 0;
            for (let c of fromEnum(this.e.m)) {
                a[b] = c;
                b++;
            }
            return a;
        }
        getSummaryValue(a) {
            if (this.summaryResults != null) {
                for (let b = 0; b < this.summaryResults.length; b++) {
                    if (this.summaryResults[b] != null && this.summaryResults[b].propertyName == a) {
                        return this.summaryResults[b].value;
                    }
                }
            }
            return null;
        }
        getSummaryResults(a) {
            if (stringIsNullOrWhiteSpace(a)) {
                return this.summaryResults;
            }
            let b = new List$1(ISummaryResult_$type, 0);
            for (let c = 0; c < this.summaryResults.length; c++) {
                if (this.summaryResults[c] != null && this.summaryResults[c].propertyName == a) {
                    b.add(this.summaryResults[c]);
                }
            }
            return b.toArray();
        }
        isHeaderSame(a) {
            if (a.rowType != 1) {
                return false;
            }
            if (a.e.r != this.e.r) {
                return false;
            }
            for (let b = 0; b < a.e.o.count; b++) {
                let c = a.e.o._inner[b];
                let d = a.e.q._inner[b];
                if (!this.e.d(c)) {
                    return false;
                }
                if (this.e.item(c) == null) {
                    if (this.e.item(c) != d) {
                        return false;
                    }
                    continue;
                }
                if (!Base.equalsStatic(this.e.item(c), d)) {
                    return false;
                }
            }
            return true;
        }
    }
    DataSourceSpecialRow.$t = /*@__PURE__*/ markType(DataSourceSpecialRow, 'DataSourceSpecialRow');
    return DataSourceSpecialRow;
})();
//# sourceMappingURL=DataSourceSpecialRow.js.map
