/*
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 { FinancialIndicator } from "./FinancialIndicator";
import { String_$type, Number_$type, typeCast, fromEnum, markType } from "igniteui-angular-core/ES2015/type";
import { DependencyProperty } from "igniteui-angular-core/ES2015/DependencyProperty";
import { PropertyMetadata } from "igniteui-angular-core/ES2015/PropertyMetadata";
import { List$1 } from "igniteui-angular-core/ES2015/List$1";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-angular-core/ES2015/number";
/**
 * @hidden
 */
export class StrategyBasedIndicator extends FinancialIndicator {
    constructor() {
        super();
        this.qi();
    }
    qi() {
        this.p3 = this.p4;
        this.ab = this.qh;
    }
    qa() {
        return -2147483648;
    }
    qj(a) {
    }
    qc() {
        return -2147483648;
    }
    p9() {
        return -2147483648;
    }
    static qn(a, b, c) {
        let d = DependencyProperty.i(c, Number_$type, b, new PropertyMetadata(2, a, (e, f) => (typeCast(StrategyBasedIndicator.$, e)).raisePropertyChanged(c, f.oldValue, f.newValue)));
        StrategyBasedIndicator.p7.add(c);
        return d;
    }
    static qm(a, b) {
        return StrategyBasedIndicator.qn(a, b, "Period");
    }
    static qk(a, b) {
        return StrategyBasedIndicator.qn(a, b, "LongPeriod");
    }
    static qo(a, b) {
        return StrategyBasedIndicator.qn(a, b, "ShortPeriod");
    }
    pg(a, b) {
        let c = this.mc(a, b);
        let d = this.md(c);
        return this.p3.b(c, d);
    }
    pd(a, b) {
        let c = this.mc(a, b);
        if (b == 0) {
            return false;
        }
        if (!this.m9(this.pg(a, b))) {
            return false;
        }
        let d = this.md(c);
        if (this.pa != null) {
            c.minimumValue = this.pa.c;
            c.maximumValue = this.pa.b;
        }
        let e = this.p3.a(c, d);
        for (let f = 0; f < this.pi && f < c.indicatorColumn.count; f++) {
            c.indicatorColumn.item(f, NaN);
        }
        if (this.ml != null && this.p6(c)) {
            this.ml.ck();
        }
        return e;
    }
    p6(a) {
        if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
            let b = this.pa;
            this.pa = new AxisRange(a.minimumValue, a.maximumValue);
            return this.p5(b, this.pa);
        }
        let c = 1.7976931348623157E+308;
        let d = -1.7976931348623157E+308;
        for (let e of fromEnum(a.indicatorColumn)) {
            if (!isNaN_(e)) {
                c = Math.min(c, e);
                d = Math.max(d, e);
            }
        }
        let f = this.pa;
        this.pa = new AxisRange(c, d);
        return this.p5(f, this.pa);
    }
    p5(a, b) {
        if (a == null || b == null) {
            return true;
        }
        if (a.c != b.c) {
            return true;
        }
        if (a.b != b.b) {
            return true;
        }
        return false;
    }
    qb(a) {
        if (a == -2147483648) {
            return 0;
        }
        if (a > this.indicatorColumn.count && this.indicatorColumn.count > 0) {
            a = this.indicatorColumn.count - 1;
        }
        if (a < 1) {
            return 1;
        }
        return a;
    }
    mc(a, b) {
        let c = super.mc(a, b);
        c.indicatorColumn = this.indicatorColumn;
        c.period = this.qb(this.qa());
        c.shortPeriod = this.qb(this.qc());
        c.longPeriod = this.qb(this.p9());
        c.multiplier = this.p8();
        return c;
    }
    p8() {
        return 1;
    }
    static ql(a, b) {
        let c = DependencyProperty.i("Multiplier", Number_$type, b, new PropertyMetadata(2, a, (d, e) => (typeCast(StrategyBasedIndicator.$, d)).raisePropertyChanged("Multiplier", e.oldValue, e.newValue)));
        StrategyBasedIndicator.p7.add("Multiplier");
        return c;
    }
    is(a, b, c, d) {
        super.is(a, b, c, d);
        if (StrategyBasedIndicator.p7.contains(b)) {
            if (this.ml != null && !this.ml.ck()) {
                this.mg.bu.e(this.er);
                this.pd(0, this.indicatorColumn.count);
                if (this.pb.b4) {
                    this.pb.b2.g$i();
                }
                this.i5(false);
            }
        }
    }
}
StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
StrategyBasedIndicator.p7 = new List$1(String_$type, 0);
//# sourceMappingURL=StrategyBasedIndicator.js.map