/*
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.acf = null;
            this.acb = null;
            this.ach = null;
            this.acd = 0;
        }
        get acg() {
            if (this.acf == null) {
                this.acf = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.dr.n);
            }
            return this.acf;
        }
        o2() {
            super.o2();
            this.xAxis = null;
            this.yAxis = null;
        }
        ck() {
            return 1;
        }
        cl() {
            if (this.yAxis != null && this.yAxis.ch) {
                return 4;
            }
            return 3;
        }
        b2() {
            if (this.b3 == 0) {
                return 1;
            }
            else {
                return super.b2();
            }
        }
        yq() {
            return this.acb;
        }
        y7() {
            return this.ach;
        }
        wn(a) {
            if (this.ys == null || this.ys.n.count == 0 || !this.hasMarkers || !this.xe()) {
                return Rect.empty;
            }
            return this.acg.d$d(this, this.ys.n, a, runOn(this, this.act));
        }
        act(a) {
            return this.aat.de(a);
        }
        acl(a, b, c) {
            return this.acg.d$c(this, this.y7(), a, b, c);
        }
        aj(a) {
            return this.acg.d$a(this, this.ys.f, this.zt(this.cv), this.zu(this.cv), a);
        }
        al(a) {
            return this.acg.d$b(this, this.ys.f, this.zt(this.cv), this.zu(this.cv), a);
        }
        gw(a, b) {
            if (this.gv(a, b)) {
                return true;
            }
            if (this.xf(a, b)) {
                return true;
            }
            return false;
        }
        getOffsetValue() {
            return this.yx.r(this.yq(), this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv));
        }
        getCategoryWidth() {
            let a = this.getEffectiveViewport1(this.cv);
            return this.yq().getCategorySize(this.cv.by, this.cv.bx, a);
        }
        i5(a, b, c) {
            if (this.db == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.cv);
            let e = this.yq();
            if (e == null) {
                return NaN;
            }
            let f = new ScalerParams(0, this.db.v4, this.cv.bx, e.ch, d);
            let g = this.yx.r(e, this.db.v4, this.cv.bx, d);
            return this.i7(this.valueColumn, a, e, f, g, runOn(this, this.zr), b, c);
        }
        ka(a, b) {
            return this.kb(a, b, this.yq(), runOn(this, this.zr), this.valueColumn);
        }
        j8(a, b) {
            return this.j9(a, b, this.yq(), runOn(this, this.zr), this.valueColumn);
        }
        ip(a, b, c, d, e) {
            if (this.valueColumn == null) {
                return Number.POSITIVE_INFINITY;
            }
            return this.iq(a, b, this.yq(), d, e, this.valueColumn.count, runOn(this, this.zr));
        }
        wa(a, b, c) {
            if (this.yq() == null || this.y7() == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            return this.wc(a, b, c, this.yx.r(this.yq(), this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv)), this.y7(), this.yq(), null, null, null);
        }
        fetchXAxis() {
            return this.acb;
        }
        fetchYAxis() {
            return this.ach;
        }
        abp(a) {
            this.xAxis = typeCast(CategoryAxisBase.$, a);
        }
        abq(a) {
            this.yAxis = typeCast(NumericYAxis.$, a);
        }
        zn() {
            return this.ach != null && this.ach.c1();
        }
        acp(a) {
            this.acb = a;
        }
        acq(a) {
            this.ach = a;
        }
        yk(a, b) {
            return this.aaq(a, b, this.acb);
        }
        q7(a, b, c, d) {
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    this.acp(this.xAxis);
                    if (this.aat.c8) {
                        this.aat.c7 = CategoryTrendLineManagerFactory.a(this.aat.c7, this.acb, this.st, this, this.dr);
                    }
                    break;
                case "TrendLineType":
                    let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                    if (e != 0) {
                        this.aat.c7 = CategoryTrendLineManagerFactory.a(this.aat.c7, this.acb, this.st, this, this.dr);
                    }
                    break;
            }
            super.q7(a, b, c, d);
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    if (c != d) {
                        this.pc(typeCast(Axis.$, c));
                        this.rf(typeCast(Axis.$, d));
                        this.acp(this.xAxis);
                        this.y1.cw.g(this.id);
                        this.rp(false);
                        this.qj();
                    }
                    break;
                case HorizontalAnchoredCategorySeries.$$p[1]:
                    if (c != d) {
                        this.pc(typeCast(Axis.$, c));
                        this.rf(typeCast(Axis.$, d));
                        this.acq(this.yAxis);
                        if (this.db != null) {
                            this.db.n2();
                        }
                        this.y1.cw.g(this.id);
                        this.zn();
                        this.rp(false);
                        this.qj();
                    }
                    break;
                case "CategoryMode":
                    if (this.xAxis != null) {
                        this.xAxis.ma(true);
                    }
                    break;
            }
        }
        pb(a, b, c, d) {
            super.pb(a, b, c, d);
            if (this.acb != null && typeCast(ISortingAxis_$type, this.acb) !== null) {
                this.acb.i$i();
            }
            switch (a) {
                case 4:
                    if (this.acb != null) {
                        this.acb.c1();
                    }
                    if (this.ach != null && !this.ach.c1()) {
                        this.rp(true);
                    }
                    break;
                case 1:
                    if (this.acb != null) {
                        this.acb.c1();
                    }
                    if (this.ach != null && !this.ach.c1()) {
                        this.rp(true);
                    }
                    break;
                case 0:
                    if (this.acb != null) {
                        this.acb.c1();
                    }
                    if (this.ach != null && !this.ach.c1()) {
                        this.rp(true);
                    }
                    break;
                case 2:
                    if (this.abb != null && this.aat.cw.d > 0 && this.ach != null && !this.ach.c1()) {
                        this.rp(true);
                    }
                    break;
                case 3:
                    if (d == this.abb) {
                        if (this.acb != null) {
                            this.acb.c1();
                        }
                        if (this.ach != null && !this.ach.c1()) {
                            this.rp(true);
                        }
                    }
                    break;
            }
        }
        acj(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
                return true;
            }
            return false;
        }
        ack(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get ace() {
            return this.acd;
        }
        set ace(a) {
            let b = this.ace;
            if (a != b) {
                this.acd = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.ace));
            }
        }
        get useHighMarkerFidelity() {
            return this.zo;
        }
    }
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::acr', [CategoryAxisBase.$, null], 'YAxis::acs', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
})();
