/*
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 { AnchoredCategorySeries } from "./AnchoredCategorySeries";
import { IHorizontalAnchoredCategorySeriesInteractionManager_$type } from "./IHorizontalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-react-core";
import { runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType, markDep } from "igniteui-react-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
import { TrendLineType_$type } from "igniteui-react-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-react-core";
/**
 * @hidden
 */
var HorizontalAnchoredCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(HorizontalAnchoredCategorySeries, _super);
    function HorizontalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.qf = null;
        _this.qb = null;
        _this.qh = null;
        _this.qd = 0;
        return _this;
    }
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "qg", {
        get: function () {
            var _this = this;
            if (this.qf == null) {
                this.qf = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.b2.n; });
            }
            return this.qf;
        },
        enumerable: true,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.prototype.h1 = function () {
        _super.prototype.h1.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    HorizontalAnchoredCategorySeries.prototype.bd = function () {
        if (this.be == 0) {
            return 1;
        }
        else {
            return _super.prototype.bd.call(this);
        }
    };
    HorizontalAnchoredCategorySeries.prototype.nj = function () {
        return this.qb;
    };
    HorizontalAnchoredCategorySeries.prototype.n3 = function () {
        return this.qh;
    };
    HorizontalAnchoredCategorySeries.prototype.l6 = function (a) {
        if (this.nk == null || this.nk.m.count == 0 || !this.hasMarkers || !this.md()) {
            return Rect.empty;
        }
        return this.qg.d$d(this, this.nk.m, a, runOn(this, this.qt));
    };
    HorizontalAnchoredCategorySeries.prototype.qt = function (a) {
        return this.pb.c5(a);
    };
    HorizontalAnchoredCategorySeries.prototype.ql = function (a, b, c) {
        return this.qg.d$c(this, this.n3(), a, b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.ah = function (a) {
        return this.qg.d$a(this, this.nk.f, this.ok(this.bi), this.ol(this.bi), a);
    };
    HorizontalAnchoredCategorySeries.prototype.ai = function (a) {
        return this.qg.d$b(this, this.nk.f, this.ok(this.bi), this.ol(this.bi), a);
    };
    HorizontalAnchoredCategorySeries.prototype.dh = function (a, b) {
        if (this.dg(a, b)) {
            return true;
        }
        if (this.me(a, b)) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.no.r(this.nj(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    HorizontalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        var a = this.getEffectiveViewport1(this.bi);
        return this.nj().getCategorySize(this.bi.bs, this.bi.br, a);
    };
    HorizontalAnchoredCategorySeries.prototype.en = function (a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nj();
        var f = new ScalerParams(0, this.bs.n2, this.bi.br, e.ca, d);
        var g = this.no.r(e, this.bs.n2, this.bi.br, d);
        return this.ep(this.valueColumn, a, e, f, g, runOn(this, this.oi), b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.fe = function (a, b) {
        return this.ff(a, b, this.nj(), runOn(this, this.oi), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.fc = function (a, b) {
        return this.fd(a, b, this.nj(), runOn(this, this.oi), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.d9 = function (a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.ea(a, b, this.nj(), d, e, this.valueColumn.count, runOn(this, this.oi));
    };
    HorizontalAnchoredCategorySeries.prototype.lv = function (a, b, c) {
        if (this.nj() == null || this.n3() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.lx(a, b, c, this.no.r(this.nj(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.n3(), this.nj(), null, null, null);
    };
    HorizontalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.qb;
    };
    HorizontalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.qh;
    };
    HorizontalAnchoredCategorySeries.prototype.pt = function (a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.pu = function (a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.oe = function () {
        return this.qh != null && this.qh.cn();
    };
    HorizontalAnchoredCategorySeries.prototype.qp = function (a) {
        this.qb = a;
    };
    HorizontalAnchoredCategorySeries.prototype.qq = function (a) {
        this.qh = a;
    };
    HorizontalAnchoredCategorySeries.prototype.nd = function (a, b) {
        return this.o8(a, b, this.qb);
    };
    HorizontalAnchoredCategorySeries.prototype.i7 = function (a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.qp(this.xAxis);
                if (this.pb.cz) {
                    this.pb.cy = CategoryTrendLineManagerFactory.a(this.pb.cy, this.qb, this.j5, this, this.b2);
                }
                break;
            case "TrendLineType":
                var e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.pb.cy = CategoryTrendLineManagerFactory.a(this.pb.cy, this.qb, this.j5, this, this.b2);
                }
                break;
        }
        _super.prototype.i7.call(this, a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.h7(typeCast(Axis.$, c));
                    this.jc(typeCast(Axis.$, d));
                    this.qp(this.xAxis);
                    this.ns.cn.g(this.eu);
                    this.jl(false);
                    this.it();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.h7(typeCast(Axis.$, c));
                    this.jc(typeCast(Axis.$, d));
                    this.qq(this.yAxis);
                    this.ns.cn.g(this.eu);
                    this.oe();
                    this.jl(false);
                    this.it();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.kv(true);
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.h6 = function (a, b, c, d) {
        _super.prototype.h6.call(this, a, b, c, d);
        if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
            this.qb.i$i();
        }
        switch (a) {
            case 4:
                if (this.qb != null) {
                    this.qb.cn();
                }
                if (this.qh != null && !this.qh.cn()) {
                    this.jl(true);
                }
                break;
            case 1:
                if (this.qb != null) {
                    this.qb.cn();
                }
                if (this.qh != null && !this.qh.cn()) {
                    this.jl(true);
                }
                break;
            case 0:
                if (this.qb != null) {
                    this.qb.cn();
                }
                if (this.qh != null && !this.qh.cn()) {
                    this.jl(true);
                }
                break;
            case 2:
                if (this.pm != null && this.pb.cn.d > 0 && this.qh != null && !this.qh.cn()) {
                    this.jl(true);
                }
                break;
            case 3:
                if (d == this.pm) {
                    if (this.qb != null) {
                        this.qb.cn();
                    }
                    if (this.qh != null && !this.qh.cn()) {
                        this.jl(true);
                    }
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.qj = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b7) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.qk = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "qe", {
        get: function () {
            return this.qd;
        },
        set: function (a) {
            var b = this.qe;
            if (a != b) {
                this.qd = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.qe));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.of;
        },
        enumerable: true,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::qr', [CategoryAxisBase.$, null], 'YAxis::qs', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { HorizontalAnchoredCategorySeries };
//# sourceMappingURL=HorizontalAnchoredCategorySeries.js.map
