/*
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 * as tslib_1 from "tslib";
import { FinancialSeries } from "./FinancialSeries";
import { DependencyProperty } from "igniteui-react-core/ES5/DependencyProperty";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Type, typeCast, markType } from "igniteui-react-core/ES5/type";
import { Rect } from "igniteui-react-core/ES5/Rect";
import { ScalerParams } from "./ScalerParams";
import { AxisRange } from "./AxisRange";
import { PropertyMetadata } from "igniteui-react-core/ES5/PropertyMetadata";
import { isNaN_ } from "igniteui-react-core/ES5/number";
var FinancialOverlay = /** @class */ (function (_super) {
    tslib_1.__extends(FinancialOverlay, _super);
    function FinancialOverlay() {
        var _this = _super.call(this) || this;
        _this.o6 = false;
        _this.o6 = false;
        return _this;
    }
    FinancialOverlay.prototype.ho = function (a, b, c, d) {
        _super.prototype.ho.call(this, a, b, c, d);
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            this.lw.i$i();
        }
        this.mc.bs.e(this.eo);
        this.o7();
        if (this.mg != null) {
            this.mg.ck();
        }
        this.i1(true);
    };
    FinancialOverlay.prototype.get_ds = function () {
        return true;
    };
    Object.defineProperty(FinancialOverlay.prototype, "ds", {
        get: function () {
            return this.get_ds();
        },
        enumerable: true,
        configurable: true
    });
    FinancialOverlay.prototype.io = function (a, b, c, d) {
        switch (b) {
            case "FastItemsSource":
                this.o6 = false;
                break;
            case FinancialOverlay.$$p[0]:
                this.o6 = false;
                this.i1(false);
                this.h8();
                break;
            case "XAxis":
                this.o6 = false;
                break;
        }
        _super.prototype.io.call(this, a, b, c, d);
    };
    FinancialOverlay.prototype.bd = function () {
        if (this.be == 0) {
            return 1;
        }
        else {
            return _super.prototype.bd.call(this);
        }
    };
    FinancialOverlay.prototype.de = function (a, b) {
        if (this.dd(a, b)) {
            return true;
        }
        return false;
    };
    FinancialOverlay.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.i1(false);
    };
    FinancialOverlay.prototype.c6 = function (a) {
        var b = this.bz != null ? this.bz.indexOf(a) : -1;
        var c = this.bi.bq;
        c = c.copy();
        var d = this.bi.bp;
        var e = new Rect(0, 0, 0, 1, 1);
        var f = this.lg(this.bi);
        var g = new ScalerParams(0, e, e, this.lw.b8, f);
        var h = new ScalerParams(0, e, e, this.mg.b8, f);
        if (b >= 0 && Rect.l_op_Inequality(c, null) && Rect.l_op_Inequality(d, null)) {
            if (this.lw != null) {
                var i = this.lw.dt(b, g);
                if (i < c.left + 0.1 * c.width) {
                    i = i + 0.4 * c.width;
                }
                if (i > c.right - 0.1 * c.width) {
                    i = i - 0.4 * c.width;
                }
                c.x = i - 0.5 * c.width;
            }
            if (this.mg != null && this.mm != null && this.mk != null && b < this.mm.count && b < this.mk.count) {
                var j = this.mg.dt(this.mm.item(b), h);
                var k = this.mg.dt(this.mk.item(b), h);
                if (!isNaN_(j) && !isNaN_(k)) {
                    var l = Math.abs(j - k);
                    if (c.height < l) {
                        c.height = l;
                        c.y = Math.min(j, k);
                    }
                    else {
                        if (j < c.top + 0.1 * c.height) {
                            j = j + 0.4 * c.height;
                        }
                        if (j > c.bottom - 0.1 * c.height) {
                            j = j - 0.4 * c.height;
                        }
                        c.y = j - 0.5 * c.height;
                    }
                }
            }
            this.bn.ap(this.bs, c, true);
        }
        return b >= 0;
    };
    FinancialOverlay.prototype.an = function (a) {
        if (a != null && a == this.mg && this.mm != null && this.mk != null) {
            return new AxisRange(this.mm.minimum, this.mk.maximum);
        }
        return null;
    };
    FinancialOverlay.$t = markType(FinancialOverlay, 'FinancialOverlay', FinancialSeries.$);
    return FinancialOverlay;
}(FinancialSeries));
export { FinancialOverlay };
Type.dep(DependencyProperty, PropertyMetadata, FinancialOverlay, 'raisePropertyChanged', ['IgnoreFirst:o8:pa', [1, 0]]);
/*<BeginStatics Name="Infragistics.Controls.Charts.FinancialOverlay" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.FinancialOverlay" />*/
