/*
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";
import { DependencyProperty } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-angular-core";
/**
 * @hidden
 */
export let StrategyBasedIndicator = /*@__PURE__*/ (() => {
    class StrategyBasedIndicator extends FinancialIndicator {
        constructor() {
            super();
            this.acj();
        }
        acj() {
            this.ab4 = this.ab5;
            this.ab = this.aci;
        }
        acb() {
            return -2147483648;
        }
        ack(a) {
        }
        acd() {
            return -2147483648;
        }
        aca() {
            return -2147483648;
        }
        static aco(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.ab8.add(c);
            return d;
        }
        static acn(a, b) {
            return StrategyBasedIndicator.aco(a, b, "Period");
        }
        static acl(a, b) {
            return StrategyBasedIndicator.aco(a, b, "LongPeriod");
        }
        static acp(a, b) {
            return StrategyBasedIndicator.aco(a, b, "ShortPeriod");
        }
        abh(a, b) {
            let c = this.xt(a, b);
            let d = this.xu(c);
            return this.ab4.b(c, d);
        }
        abe(a, b) {
            let c = this.xt(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.yp(this.abh(a, b))) {
                return false;
            }
            let d = this.xu(c);
            if (this.aba != null) {
                c.minimumValue = this.aba.c;
                c.maximumValue = this.aba.b;
            }
            let e = this.ab4.a(c, d);
            for (let f = 0; f < this.abj && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.xz != null && this.ab7(c)) {
                this.xz.d2();
            }
            return e;
        }
        ab7(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.aba;
                this.aba = new AxisRange(a.minimumValue, a.maximumValue);
                return this.ab6(b, this.aba);
            }
            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.aba;
            this.aba = new AxisRange(c, d);
            return this.ab6(f, this.aba);
        }
        ab6(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;
        }
        acc(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;
        }
        xt(a, b) {
            let c = super.xt(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.acc(this.acb());
            c.shortPeriod = this.acc(this.acd());
            c.longPeriod = this.acc(this.aca());
            c.multiplier = this.ab9();
            return c;
        }
        ab9() {
            return 1;
        }
        static acm(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.ab8.add("Multiplier");
            return c;
        }
        rg(a, b, c, d) {
            super.rg(a, b, c, d);
            if (StrategyBasedIndicator.ab8.contains(b)) {
                if (this.xz != null && !this.xz.d2()) {
                    this.xx.cd.e(this.ie);
                    this.abe(0, this.indicatorColumn.count);
                    if (this.abb.cn) {
                        this.abb.cl.g$m();
                    }
                    this.ry(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.ab8 = new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
