/*
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";
import { ISortingAxis_$type } from "./ISortingAxis";
import { typeCast, markType, markDep } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { AxisRange } from "./AxisRange";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
/**
 * @hidden
 */
var FinancialOverlay = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(FinancialOverlay, _super);
    function FinancialOverlay() {
        var _this = _super.call(this) || this;
        _this.rq = false;
        _this.rq = false;
        return _this;
    }
    FinancialOverlay.prototype.jo = function (a, b, c, d) {
        _super.prototype.jo.call(this, a, b, c, d);
        if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
            this.oh.i$i();
        }
        this.ox.bx.e(this.fq);
        this.rr();
        if (this.o2 != null) {
            this.o2.cn();
        }
        this.k3(true);
    };
    FinancialOverlay.prototype.get_eb = function () {
        return true;
    };
    FinancialOverlay.prototype.kp = function (a, b, c, d) {
        switch (b) {
            case "FastItemsSource":
                this.rq = false;
                break;
            case FinancialOverlay.$$p[0]:
                this.rq = false;
                this.k3(false);
                this.ka();
                break;
            case "XAxis":
                this.rq = false;
                break;
        }
        _super.prototype.kp.call(this, a, b, c, d);
    };
    FinancialOverlay.prototype.bj = function () {
        if (this.bk == 0) {
            return 1;
        }
        else {
            return _super.prototype.bj.call(this);
        }
    };
    FinancialOverlay.prototype.dy = function (a, b) {
        if (this.dx(a, b)) {
            return true;
        }
        return false;
    };
    FinancialOverlay.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.k3(false);
    };
    FinancialOverlay.prototype.dq = function (a) {
        var b = this.cd != null ? this.cd.indexOf(a) : -1;
        var c = this.bs.bv;
        c = c.copy();
        var d = this.bs.bu;
        var e = new Rect(0, 0, 0, 1, 1);
        var f = this.n0(this.bs);
        var g = new ScalerParams(0, e, e, this.oh.ca, f);
        var h = new ScalerParams(0, e, e, this.o2.ca, f);
        h.b = this.fa();
        if (b >= 0 && Rect.l_op_Inequality(c, null) && Rect.l_op_Inequality(d, null)) {
            if (this.oh != null) {
                var i = this.oh.dz(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.o2 != null && this.pb != null && this.pa != null && b < this.pb.count && b < this.pa.count) {
                var j = this.o2.dz(this.pb.item(b), h);
                var k = this.o2.dz(this.pa.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.b1.ap(this.b6, c, true);
        }
        return b >= 0;
    };
    FinancialOverlay.prototype.ao = function (a) {
        if (a != null && a == this.o2 && this.pb != null && this.pa != null) {
            return new AxisRange(this.pb.minimum, this.pa.maximum);
        }
        return null;
    };
    FinancialOverlay.$t = markType(FinancialOverlay, 'FinancialOverlay', FinancialSeries.$);
    FinancialOverlay.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialOverlay, 'raisePropertyChanged', ['IgnoreFirst:rs:ru', [1, 0]]);
    return FinancialOverlay;
}(FinancialSeries));
export { FinancialOverlay };
//# sourceMappingURL=FinancialOverlay.js.map
