/*
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 { __extends } from "tslib";
import { FinancialSeries } from "./FinancialSeries";
import { DependencyProperty } from "igniteui-angular-core";
import { ISortingAxis_$type } from "./ISortingAxis";
import { typeCast, markType, markDep } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { AxisRange } from "./AxisRange";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
/**
 * @hidden
 */
var FinancialOverlay = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialOverlay, _super);
    function FinancialOverlay() {
        var _this = _super.call(this) || this;
        _this.aa0 = false;
        _this.aa0 = false;
        return _this;
    }
    FinancialOverlay.prototype.get_e8 = function () {
        return true;
    };
    FinancialOverlay.prototype.pb = function (a, b, c, d) {
        _super.prototype.pb.call(this, a, b, c, d);
        if (this.w6 != null && typeCast(ISortingAxis_$type, this.w6) !== null) {
            this.w6.i$i();
        }
        this.xn.b0.e(this.id);
        this.aa1();
        if (this.xp != null) {
            this.xp.c1();
        }
        this.rr(true);
    };
    FinancialOverlay.prototype.get_hd = function () {
        return true;
    };
    FinancialOverlay.prototype.q9 = function (a, b, c, d) {
        switch (b) {
            case "FastItemsSource":
                this.aa0 = false;
                break;
            case FinancialOverlay.$$p[0]:
                this.aa0 = false;
                this.rr(false);
                this.ql();
                break;
            case "XAxis":
                this.aa0 = false;
                break;
        }
        _super.prototype.q9.call(this, a, b, c, d);
    };
    FinancialOverlay.prototype.b2 = function () {
        if (this.b3 == 0) {
            return 1;
        }
        else {
            return _super.prototype.b2.call(this);
        }
    };
    FinancialOverlay.prototype.gw = function (a, b) {
        if (this.gv(a, b)) {
            return true;
        }
        return false;
    };
    FinancialOverlay.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.rr(false);
    };
    FinancialOverlay.prototype.gd = function (a) {
        var b = this.dn != null ? this.dn.indexOf(a) : -1;
        var c = this.cv.by;
        c = c.copy();
        var d = this.cv.bx;
        var e = new Rect(0, 0, 0, 1, 1);
        var f = this.wl(this.cv);
        var g = new ScalerParams(0, e, e, this.w6.ch, f);
        var h = new ScalerParams(0, e, e, this.xp.ch, f);
        h.b = this.iy();
        if (b >= 0 && Rect.l_op_Inequality(c, null) && Rect.l_op_Inequality(d, null)) {
            if (this.w6 != null) {
                var i = this.w6.el(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.xp != null && this.x1 != null && this.x0 != null && b < this.x1.count && b < this.x0.count) {
                var j = this.xp.el(this.x1.item(b), h);
                var k = this.xp.el(this.x0.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.c3.au(this.db, c, true);
        }
        return b >= 0;
    };
    FinancialOverlay.prototype.ay = function (a) {
        if (a != null && a == this.xp && this.x1 != null && this.x0 != null) {
            return new AxisRange(this.x1.minimum, this.x0.maximum);
        }
        return null;
    };
    FinancialOverlay.$t = markType(FinancialOverlay, 'FinancialOverlay', FinancialSeries.$);
    FinancialOverlay.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialOverlay, 'raisePropertyChanged', ['IgnoreFirst:aa2:aa4', [1, 0]]);
    return FinancialOverlay;
}(FinancialSeries));
export { FinancialOverlay };
