/*
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-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 { Axis } from "./Axis";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
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
 */
export let HorizontalAnchoredCategorySeries = /*@__PURE__*/ (() => {
    class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
        constructor() {
            super(...arguments);
            this.y1 = null;
            this.yx = null;
            this.y3 = null;
            this.yz = 0;
        }
        get y2() {
            if (this.y1 == null) {
                this.y1 = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.da.n);
            }
            return this.y1;
        }
        nh() {
            super.nh();
            this.xAxis = null;
            this.yAxis = null;
        }
        cb() {
            return 1;
        }
        cc() {
            if (this.yAxis != null && this.yAxis.ch) {
                return 4;
            }
            return 3;
        }
        bu() {
            if (this.bv == 0) {
                return 1;
            }
            else {
                return super.bu();
            }
        }
        vn() {
            return this.yx;
        }
        v3() {
            return this.y3;
        }
        tw(a) {
            if (this.vo == null || this.vo.m.count == 0 || !this.hasMarkers || !this.ue()) {
                return Rect.empty;
            }
            return this.y2.d$d(this, this.vo.m, a, runOn(this, this.zf));
        }
        zf(a) {
            return this.xh.dc(a);
        }
        y7(a, b, c) {
            return this.y2.d$c(this, this.v3(), a, b, c);
        }
        ah(a) {
            return this.y2.d$a(this, this.vo.f, this.wp(this.cg), this.wq(this.cg), a);
        }
        ai(a) {
            return this.y2.d$b(this, this.vo.f, this.wp(this.cg), this.wq(this.cg), a);
        }
        f5(a, b) {
            if (this.f4(a, b)) {
                return true;
            }
            if (this.uf(a, b)) {
                return true;
            }
            return false;
        }
        getOffsetValue() {
            return this.vt.r(this.vn(), this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg));
        }
        getCategoryWidth() {
            let a = this.getEffectiveViewport1(this.cg);
            return this.vn().getCategorySize(this.cg.by, this.cg.bx, a);
        }
        ia(a, b, c) {
            if (this.cv == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.cg);
            let e = this.vn();
            if (e == null) {
                return NaN;
            }
            let f = new ScalerParams(0, this.cv.tr, this.cg.bx, e.ch, d);
            let g = this.vt.r(e, this.cv.tr, this.cg.bx, d);
            return this.ic(this.valueColumn, a, e, f, g, runOn(this, this.wn), b, c);
        }
        jg(a, b) {
            return this.jh(a, b, this.vn(), runOn(this, this.wn), this.valueColumn);
        }
        je(a, b) {
            return this.jf(a, b, this.vn(), runOn(this, this.wn), this.valueColumn);
        }
        hu(a, b, c, d, e) {
            if (this.valueColumn == null) {
                return Number.POSITIVE_INFINITY;
            }
            return this.hv(a, b, this.vn(), d, e, this.valueColumn.count, runOn(this, this.wn));
        }
        tj(a, b, c) {
            if (this.vn() == null || this.v3() == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            return this.tl(a, b, c, this.vt.r(this.vn(), this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.v3(), this.vn(), null, null, null);
        }
        fetchXAxis() {
            return this.yx;
        }
        fetchYAxis() {
            return this.y3;
        }
        yb(a) {
            this.xAxis = typeCast(CategoryAxisBase.$, a);
        }
        yc(a) {
            this.yAxis = typeCast(NumericYAxis.$, a);
        }
        wj() {
            return this.y3 != null && this.y3.c1();
        }
        zb(a) {
            this.yx = a;
        }
        zc(a) {
            this.y3 = a;
        }
        vh(a, b) {
            return this.xe(a, b, this.yx);
        }
        pa(a, b, c, d) {
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    this.zb(this.xAxis);
                    if (this.xh.c6) {
                        this.xh.c5 = CategoryTrendLineManagerFactory.a(this.xh.c5, this.yx, this.qt, this, this.da);
                    }
                    break;
                case "TrendLineType":
                    let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                    if (e != 0) {
                        this.xh.c5 = CategoryTrendLineManagerFactory.a(this.xh.c5, this.yx, this.qt, this, this.da);
                    }
                    break;
            }
            super.pa(a, b, c, d);
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    if (c != d) {
                        this.nq(typeCast(Axis.$, c));
                        this.ph(typeCast(Axis.$, d));
                        this.zb(this.xAxis);
                        this.vx.cu.g(this.hk);
                        this.pr(false);
                        this.om();
                    }
                    break;
                case HorizontalAnchoredCategorySeries.$$p[1]:
                    if (c != d) {
                        this.nq(typeCast(Axis.$, c));
                        this.ph(typeCast(Axis.$, d));
                        this.zc(this.yAxis);
                        if (this.cv != null) {
                            this.cv.mg();
                        }
                        this.vx.cu.g(this.hk);
                        this.wj();
                        this.pr(false);
                        this.om();
                    }
                    break;
                case "CategoryMode":
                    if (this.xAxis != null) {
                        this.xAxis.l5(true);
                    }
                    break;
            }
        }
        np(a, b, c, d) {
            super.np(a, b, c, d);
            if (this.yx != null && typeCast(ISortingAxis_$type, this.yx) !== null) {
                this.yx.i$i();
            }
            switch (a) {
                case 4:
                    if (this.yx != null) {
                        this.yx.c1();
                    }
                    if (this.y3 != null && !this.y3.c1()) {
                        this.pr(true);
                    }
                    break;
                case 1:
                    if (this.yx != null) {
                        this.yx.c1();
                    }
                    if (this.y3 != null && !this.y3.c1()) {
                        this.pr(true);
                    }
                    break;
                case 0:
                    if (this.yx != null) {
                        this.yx.c1();
                    }
                    if (this.y3 != null && !this.y3.c1()) {
                        this.pr(true);
                    }
                    break;
                case 2:
                    if (this.xx != null && this.xh.cu.d > 0 && this.y3 != null && !this.y3.c1()) {
                        this.pr(true);
                    }
                    break;
                case 3:
                    if (d == this.xx) {
                        if (this.yx != null) {
                            this.yx.c1();
                        }
                        if (this.y3 != null && !this.y3.c1()) {
                            this.pr(true);
                        }
                    }
                    break;
            }
        }
        y5(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
                return true;
            }
            return false;
        }
        y6(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get y0() {
            return this.yz;
        }
        set y0(a) {
            let b = this.y0;
            if (a != b) {
                this.yz = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.y0));
            }
        }
        get useHighMarkerFidelity() {
            return this.wk;
        }
    }
    HorizontalAnchoredCategorySeries.$t = /*@__PURE__*/ markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::zd', [CategoryAxisBase.$, null], 'YAxis::ze', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
})();
