/*
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 { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-angular-core/ES2015/DependencyProperty";
import { CategoryYAxis } from "./CategoryYAxis";
import { IVerticalAnchoredCategorySeriesInteractionManager_$type } from "./IVerticalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core/ES2015/DVContainer";
import { Type, runOn, typeCast, EnumUtil, markType } from "igniteui-angular-core/ES2015/type";
import { Axis } from "./Axis";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-angular-core/ES2015/Rect";
import { TrendLineType_$type } from "igniteui-angular-core/ES2015/TrendLineType";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { PropertyMetadata } from "igniteui-angular-core/ES2015/PropertyMetadata";
import { truncate } from "igniteui-angular-core/ES2015/number";
/**
 * @hidden
 */
export class VerticalAnchoredCategorySeries extends AnchoredCategorySeries {
    constructor() {
        super(...arguments);
        this.pr = null;
    }
    hn() {
        super.hn();
        this.xAxis = null;
        this.yAxis = null;
    }
    get ps() {
        if (this.pr == null) {
            this.pr = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, () => this.b2.n);
        }
        return this.pr;
    }
    get_isVertical() {
        return true;
    }
    my() {
        return this.yAxis;
    }
    ni() {
        return this.xAxis;
    }
    getOffsetValue() {
        return this.m3.r(this.my(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        return this.yAxis.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    e9(a, b) {
        return this.fa(a, b, this.my(), runOn(this, this.nx), this.valueColumn);
    }
    fb(a, b) {
        return this.fc(a, b, this.my(), runOn(this, this.nx), this.valueColumn);
    }
    d6(a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.d7(a, b, this.yAxis, d, e, this.valueColumn.count, runOn(this, this.nx));
    }
    bd() {
        if (this.be == 0) {
            return 1;
        }
        else {
            return super.bd();
        }
    }
    lo(a) {
        if (!this.hasMarkers || !this.lv()) {
            return Rect.empty;
        }
        return this.ps.e$b(this, this.mz.m, a, runOn(this, this.p0));
    }
    p0(a) {
        return this.oq.c5(a);
    }
    dg(a, b) {
        if (this.df(a, b)) {
            return true;
        }
        if (this.lw(a, b)) {
            return true;
        }
        return false;
    }
    ek(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.my();
        let f = new ScalerParams(0, this.bs.mq, this.bi.br, e.b8, d);
        let g = this.m3.r(e, this.bs.mq, this.bi.br, d);
        return this.em(this.valueColumn, a, e, f, g, runOn(this, this.nx), b, c);
    }
    ld(a, b, c) {
        let d = this.my();
        return this.lf(a, b, c, this.m3.r(d, this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ni(), d, null, null, null);
    }
    fetchXAxis() {
        return this.xAxis;
    }
    fetchYAxis() {
        return this.yAxis;
    }
    o8(a) {
        this.xAxis = typeCast(NumericXAxis.$, a);
    }
    o9(a) {
        this.yAxis = typeCast(CategoryYAxis.$, a);
    }
    nt() {
        return this.xAxis != null && this.xAxis.ck();
    }
    ms(a, b) {
        return this.on(a, b, this.yAxis);
    }
    d8(a) {
        return this.ps.e$a(this, a);
    }
    nx(a) {
        return this.ea(a, this.my());
    }
    e5(a) {
        return truncate(Math.round(this.d8(a)));
    }
    fm(a) {
        let b = this.e5(a);
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    }
    is(a, b, c, d) {
        super.is(a, b, c, d);
        switch (b) {
            case VerticalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.ht(typeCast(Axis.$, c));
                    this.ix(typeCast(Axis.$, d));
                    this.m7.cn.g(this.er);
                    this.i5(false);
                    this.ic();
                }
                break;
            case VerticalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.ht(typeCast(Axis.$, c));
                    this.ix(typeCast(Axis.$, d));
                    this.m7.cn.g(this.er);
                    this.nt();
                    this.i5(false);
                    this.ic();
                }
                break;
            case "TrendLineType":
                let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.oq.cy = CategoryTrendLineManagerFactory.a(this.oq.cy, this.yAxis, this.jp, this, this.b2);
                }
                break;
        }
    }
    pv(a) {
        if (typeCast(CategoryYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    pu(a) {
        if (typeCast(NumericXAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    get useHighMarkerFidelity() {
        return this.nu;
    }
}
VerticalAnchoredCategorySeries.$t = markType(VerticalAnchoredCategorySeries, 'VerticalAnchoredCategorySeries', AnchoredCategorySeries.$);
Type.dep(DependencyProperty, PropertyMetadata, VerticalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::py', [NumericXAxis.$, null], 'YAxis::pz', [CategoryYAxis.$, null]]);
//# sourceMappingURL=VerticalAnchoredCategorySeries.js.map