/*
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 { Axis } from "./Axis";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
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 let HorizontalAnchoredCategorySeries = /*@__PURE__*/ (() => {
    class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
        constructor() {
            super(...arguments);
            this.act = null;
            this.acp = null;
            this.acv = null;
            this.acr = 0;
        }
        get acu() {
            if (this.act == null) {
                this.act = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.ds.n);
            }
            return this.act;
        }
        o8() {
            super.o8();
            this.xAxis = null;
            this.yAxis = null;
        }
        cl() {
            return 1;
        }
        cm() {
            if (this.yAxis != null && this.yAxis.df) {
                return 4;
            }
            return 3;
        }
        b3() {
            if (this.b4 == 0) {
                return 1;
            }
            else {
                return super.b3();
            }
        }
        y2() {
            return this.acp;
        }
        zj() {
            return this.acv;
        }
        wz(a) {
            if (this.y4 == null || this.y4.p.count == 0 || !this.hasMarkers || !this.xq()) {
                return Rect.empty;
            }
            return this.acu.d$d(this, this.y4.p, a, runOn(this, this.ac7));
        }
        ac7(a) {
            return this.aa7.ds(a);
        }
        acz(a, b, c) {
            return this.acu.d$c(this, this.zj(), a, b, c);
        }
        aj(a) {
            return this.acu.d$a(this, this.y4.h, this.z5(this.cw), this.z6(this.cw), a);
        }
        al(a) {
            return this.acu.d$b(this, this.y4.h, this.z5(this.cw), this.z6(this.cw), a);
        }
        gx(a, b) {
            if (this.gw(a, b)) {
                return true;
            }
            if (this.xr(a, b)) {
                return true;
            }
            return false;
        }
        getOffsetValue() {
            return this.y9.r(this.y2(), this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
        }
        getCategoryWidth() {
            let a = this.getEffectiveViewport1(this.cw);
            return this.y2().getCategorySize(this.cw.ca, this.cw.b9, a);
        }
        i8(a, b, c) {
            if (this.dc == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.cw);
            let e = this.y2();
            if (e == null) {
                return NaN;
            }
            let f = new ScalerParams(0, this.dc.xm, this.cw.b9, e.df, d);
            let g = this.y9.r(e, this.dc.xm, this.cw.b9, d);
            return this.ja(this.valueColumn, a, e, f, g, runOn(this, this.z3), b, c);
        }
        ke(a, b) {
            return this.kf(a, b, this.y2(), runOn(this, this.z3), this.valueColumn);
        }
        kc(a, b) {
            return this.kd(a, b, this.y2(), runOn(this, this.z3), this.valueColumn);
        }
        ir(a, b, c, d, e) {
            if (this.valueColumn == null) {
                return Number.POSITIVE_INFINITY;
            }
            return this.is(a, b, this.y2(), d, e, this.valueColumn.count, runOn(this, this.z3));
        }
        wm(a, b, c) {
            if (this.y2() == null || this.zj() == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            return this.wo(a, b, c, this.y9.r(this.y2(), this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.zj(), this.y2(), null, null, null);
        }
        fetchXAxis() {
            return this.acp;
        }
        fetchYAxis() {
            return this.acv;
        }
        ab3(a) {
            this.xAxis = typeCast(CategoryAxisBase.$, a);
        }
        ab4(a) {
            this.yAxis = typeCast(NumericYAxis.$, a);
        }
        zz() {
            return this.acv != null && this.acv.d2();
        }
        ac3(a) {
            this.acp = a;
        }
        ac4(a) {
            this.acv = a;
        }
        yw(a, b) {
            return this.aa4(a, b, this.acp);
        }
        rg(a, b, c, d) {
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    this.ac3(this.xAxis);
                    if (this.aa7.dl) {
                        this.aa7.dk = CategoryTrendLineManagerFactory.a(this.aa7.dk, this.acp, this.s3, this, this.ds);
                        this.aa7.dk.g$b = this.trendLineType;
                        this.aa7.dk.g$f = this.trendLinePeriod;
                    }
                    break;
                case "TrendLineType":
                    let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                    if (e != 0) {
                        this.aa7.dk = CategoryTrendLineManagerFactory.a(this.aa7.dk, this.acp, this.s3, this, this.ds);
                        this.aa7.dk.g$b = this.trendLineType;
                        this.aa7.dk.g$f = this.trendLinePeriod;
                    }
                    break;
            }
            super.rg(a, b, c, d);
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    if (c != d) {
                        this.pi(typeCast(Axis.$, c));
                        this.ro(typeCast(Axis.$, d));
                        this.ac3(this.xAxis);
                        this.zd.c9.g(this.ie);
                        this.ry(false);
                        this.qr();
                    }
                    break;
                case HorizontalAnchoredCategorySeries.$$p[1]:
                    if (c != d) {
                        this.pi(typeCast(Axis.$, c));
                        this.ro(typeCast(Axis.$, d));
                        this.ac4(this.yAxis);
                        if (this.dc != null) {
                            this.dc.o0();
                        }
                        this.zd.c9.g(this.ie);
                        this.zz();
                        this.ry(false);
                        this.qr();
                    }
                    break;
                case "CategoryMode":
                    if (this.xAxis != null) {
                        this.xAxis.pw(true);
                    }
                    break;
            }
        }
        ph(a, b, c, d) {
            super.ph(a, b, c, d);
            if (this.acp != null && typeCast(ISortingAxis_$type, this.acp) !== null) {
                this.acp.i$i();
            }
            switch (a) {
                case 4:
                    if (this.acp != null) {
                        this.acp.d2();
                    }
                    if (this.acv != null && !this.acv.d2()) {
                        this.ry(true);
                    }
                    break;
                case 1:
                    if (this.acp != null) {
                        this.acp.d2();
                    }
                    if (this.acv != null && !this.acv.d2()) {
                        this.ry(true);
                    }
                    break;
                case 0:
                    if (this.acp != null) {
                        this.acp.d2();
                    }
                    if (this.acv != null && !this.acv.d2()) {
                        this.ry(true);
                    }
                    break;
                case 2:
                    if (this.abp != null && this.aa7.c9.d > 0 && this.acv != null && !this.acv.d2()) {
                        this.ry(true);
                    }
                    break;
                case 3:
                    if (d == this.abp) {
                        if (this.acp != null) {
                            this.acp.d2();
                        }
                        if (this.acv != null && !this.acv.d2()) {
                            this.ry(true);
                        }
                    }
                    break;
            }
        }
        acx(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.dc) {
                return true;
            }
            return false;
        }
        acy(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get acs() {
            return this.acr;
        }
        set acs(a) {
            let b = this.acs;
            if (a != b) {
                this.acr = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.acs));
            }
        }
        get useHighMarkerFidelity() {
            return this.z0;
        }
    }
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::ac5', [CategoryAxisBase.$, null], 'YAxis::ac6', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
})();
