/*
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 { AnchoredCategorySeries } from "./AnchoredCategorySeries";
import { IHorizontalAnchoredCategorySeriesInteractionManager_$type } from "./IHorizontalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core";
import { runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
import { TrendLineType_$type } from "igniteui-angular-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-angular-core";
/**
 * @hidden
 */
export class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
    constructor() {
        super(...arguments);
        this.p2 = null;
        this.py = null;
        this.p4 = null;
        this.p0 = 0;
    }
    get p3() {
        if (this.p2 == null) {
            this.p2 = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.b2.n);
        }
        return this.p2;
    }
    ht() {
        super.ht();
        this.xAxis = null;
        this.yAxis = null;
    }
    bd() {
        if (this.be == 0) {
            return 1;
        }
        else {
            return super.bd();
        }
    }
    m6() {
        return this.py;
    }
    nq() {
        return this.p4;
    }
    lw(a) {
        if (this.m7 == null || this.m7.m.count == 0 || !this.hasMarkers || !this.l3()) {
            return Rect.empty;
        }
        return this.p3.d$d(this, this.m7.m, a, runOn(this, this.qg));
    }
    qg(a) {
        return this.oy.c5(a);
    }
    p8(a, b, c) {
        return this.p3.d$c(this, this.nq(), a, b, c);
    }
    ah(a) {
        return this.p3.d$a(this, this.m7.f, this.n7(this.bi), this.n8(this.bi), a);
    }
    ai(a) {
        return this.p3.d$b(this, this.m7.f, this.n7(this.bi), this.n8(this.bi), a);
    }
    dh(a, b) {
        if (this.dg(a, b)) {
            return true;
        }
        if (this.l4(a, b)) {
            return true;
        }
        return false;
    }
    getOffsetValue() {
        return this.nb.r(this.m6(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        let a = this.getEffectiveViewport1(this.bi);
        return this.m6().getCategorySize(this.bi.bs, this.bi.br, a);
    }
    en(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.m6();
        let f = new ScalerParams(0, this.bs.mq, this.bi.br, e.b8, d);
        let g = this.nb.r(e, this.bs.mq, this.bi.br, d);
        return this.ep(this.valueColumn, a, e, f, g, runOn(this, this.n5), b, c);
    }
    fe(a, b) {
        return this.ff(a, b, this.m6(), runOn(this, this.n5), this.valueColumn);
    }
    fc(a, b) {
        return this.fd(a, b, this.m6(), runOn(this, this.n5), this.valueColumn);
    }
    d9(a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.ea(a, b, this.m6(), d, e, this.valueColumn.count, runOn(this, this.n5));
    }
    ll(a, b, c) {
        if (this.m6() == null || this.nq() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.ln(a, b, c, this.nb.r(this.m6(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.nq(), this.m6(), null, null, null);
    }
    fetchXAxis() {
        return this.py;
    }
    fetchYAxis() {
        return this.p4;
    }
    pg(a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    }
    ph(a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    }
    n1() {
        return this.p4 != null && this.p4.cl();
    }
    qc(a) {
        this.py = a;
    }
    qd(a) {
        this.p4 = a;
    }
    m0(a, b) {
        return this.ov(a, b, this.py);
    }
    iz(a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.qc(this.xAxis);
                if (this.oy.cz) {
                    this.oy.cy = CategoryTrendLineManagerFactory.a(this.oy.cy, this.py, this.jx, this, this.b2);
                }
                break;
            case "TrendLineType":
                let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.oy.cy = CategoryTrendLineManagerFactory.a(this.oy.cy, this.py, this.jx, this, this.b2);
                }
                break;
        }
        super.iz(a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.hz(typeCast(Axis.$, c));
                    this.i4(typeCast(Axis.$, d));
                    this.qc(this.xAxis);
                    this.nf.cn.g(this.eu);
                    this.jd(false);
                    this.ik();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.hz(typeCast(Axis.$, c));
                    this.i4(typeCast(Axis.$, d));
                    this.qd(this.yAxis);
                    this.nf.cn.g(this.eu);
                    this.n1();
                    this.jd(false);
                    this.ik();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.kn(true);
                }
                break;
        }
    }
    hy(a, b, c, d) {
        super.hy(a, b, c, d);
        if (this.py != null && typeCast(ISortingAxis_$type, this.py) !== null) {
            this.py.i$i();
        }
        switch (a) {
            case 4:
                if (this.py != null) {
                    this.py.cl();
                }
                if (this.p4 != null && !this.p4.cl()) {
                    this.jd(true);
                }
                break;
            case 1:
                if (this.py != null) {
                    this.py.cl();
                }
                if (this.p4 != null && !this.p4.cl()) {
                    this.jd(true);
                }
                break;
            case 0:
                if (this.py != null) {
                    this.py.cl();
                }
                if (this.p4 != null && !this.p4.cl()) {
                    this.jd(true);
                }
                break;
            case 2:
                if (this.o9 != null && this.oy.cn.d > 0 && this.p4 != null && !this.p4.cl()) {
                    this.jd(true);
                }
                break;
            case 3:
                if (d == this.o9) {
                    if (this.py != null) {
                        this.py.cl();
                    }
                    if (this.p4 != null && !this.p4.cl()) {
                        this.jd(true);
                    }
                }
                break;
        }
    }
    p6(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    p7(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    get p1() {
        return this.p0;
    }
    set p1(a) {
        let b = this.p1;
        if (a != b) {
            this.p0 = a;
            this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.p1));
        }
    }
    get useHighMarkerFidelity() {
        return this.n2;
    }
}
HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::qe', [CategoryAxisBase.$, null], 'YAxis::qf', [NumericYAxis.$, null]]);
//# sourceMappingURL=HorizontalAnchoredCategorySeries.js.map