/*
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-react-core/ES2015/type";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-react-core/ES2015/number";
export class StrategyBasedIndicator extends FinancialIndicator {
    constructor() {
        super();
        this.qe();
    }
    qe() {
        this.pz = this.p0;
        this.ab = this.qd;
    }
    p6() {
        return -2147483648;
    }
    qf(a) {
    }
    p8() {
        return -2147483648;
    }
    p5() {
        return -2147483648;
    }
    static qj(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.p3.add(c);
        return d;
    }
    static qi(a, b) {
        return StrategyBasedIndicator.qj(a, b, "Period");
    }
    static qg(a, b) {
        return StrategyBasedIndicator.qj(a, b, "LongPeriod");
    }
    static qk(a, b) {
        return StrategyBasedIndicator.qj(a, b, "ShortPeriod");
    }
    pc(a, b) {
        let c = this.l8(a, b);
        let d = this.l9(c);
        return this.pz.b(c, d);
    }
    o9(a, b) {
        let c = this.l8(a, b);
        if (b == 0) {
            return false;
        }
        if (!this.m3(this.pc(a, b))) {
            return false;
        }
        let d = this.l9(c);
        if (this.o6 != null) {
            c.minimumValue = this.o6.c;
            c.maximumValue = this.o6.b;
        }
        let e = this.pz.a(c, d);
        for (let f = 0; f < this.pe && f < c.indicatorColumn.count; f++) {
            c.indicatorColumn.item(f, NaN);
        }
        if (this.mg != null && this.p2(c)) {
            this.mg.ck();
        }
        return e;
    }
    p2(a) {
        if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
            let b = this.o6;
            this.o6 = new AxisRange(a.minimumValue, a.maximumValue);
            return this.p1(b, this.o6);
        }
        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.o6;
        this.o6 = new AxisRange(c, d);
        return this.p1(f, this.o6);
    }
    p1(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;
    }
    p7(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;
    }
    l8(a, b) {
        let c = super.l8(a, b);
        c.indicatorColumn = this.indicatorColumn;
        c.period = this.p7(this.p6());
        c.shortPeriod = this.p7(this.p8());
        c.longPeriod = this.p7(this.p5());
        c.multiplier = this.p4();
        return c;
    }
    p4() {
        return 1;
    }
    static qh(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.p3.add("Multiplier");
        return c;
    }
    io(a, b, c, d) {
        super.io(a, b, c, d);
        if (StrategyBasedIndicator.p3.contains(b)) {
            if (this.mg != null && !this.mg.ck()) {
                this.mc.bs.e(this.eo);
                this.o9(0, this.indicatorColumn.count);
                if (this.o7.b2) {
                    this.o7.b0.g$i();
                }
                this.i1(false);
            }
        }
    }
}
StrategyBasedIndicator.p3 = new List$1(String_$type, 0);
StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
/*<BeginStatics Name="Infragistics.Controls.Charts.StrategyBasedIndicator" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.StrategyBasedIndicator" />*/
