/*
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.yz = null;
            this.yv = null;
            this.y1 = null;
            this.yx = 0;
        }
        get y0() {
            if (this.yz == null) {
                this.yz = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.c9.n);
            }
            return this.yz;
        }
        ng() {
            super.ng();
            this.xAxis = null;
            this.yAxis = null;
        }
        ce() {
            return 1;
        }
        cf() {
            if (this.yAxis != null && this.yAxis.ch) {
                return 4;
            }
            return 3;
        }
        bx() {
            if (this.by == 0) {
                return 1;
            }
            else {
                return super.bx();
            }
        }
        vl() {
            return this.yv;
        }
        v6() {
            return this.y1;
        }
        tu(a) {
            if (this.vm == null || this.vm.m.count == 0 || !this.hasMarkers || !this.uc()) {
                return Rect.empty;
            }
            return this.y0.d$d(this, this.vm.m, a, runOn(this, this.zd));
        }
        zd(a) {
            return this.xf.dc(a);
        }
        y5(a, b, c) {
            return this.y0.d$c(this, this.v6(), a, b, c);
        }
        ah(a) {
            return this.y0.d$a(this, this.vm.f, this.wn(this.cj), this.wo(this.cj), a);
        }
        ai(a) {
            return this.y0.d$b(this, this.vm.f, this.wn(this.cj), this.wo(this.cj), a);
        }
        f4(a, b) {
            if (this.f3(a, b)) {
                return true;
            }
            if (this.ud(a, b)) {
                return true;
            }
            return false;
        }
        getOffsetValue() {
            return this.vr.r(this.vl(), this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj));
        }
        getCategoryWidth() {
            let a = this.getEffectiveViewport1(this.cj);
            return this.vl().getCategorySize(this.cj.by, this.cj.bx, a);
        }
        h9(a, b, c) {
            if (this.cy == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.cj);
            let e = this.vl();
            if (e == null) {
                return NaN;
            }
            let f = new ScalerParams(0, this.cy.tn, this.cj.bx, e.ch, d);
            let g = this.vr.r(e, this.cy.tn, this.cj.bx, d);
            return this.ib(this.valueColumn, a, e, f, g, runOn(this, this.wl), b, c);
        }
        jf(a, b) {
            return this.jg(a, b, this.vl(), runOn(this, this.wl), this.valueColumn);
        }
        jd(a, b) {
            return this.je(a, b, this.vl(), runOn(this, this.wl), this.valueColumn);
        }
        ht(a, b, c, d, e) {
            if (this.valueColumn == null) {
                return Number.POSITIVE_INFINITY;
            }
            return this.hu(a, b, this.vl(), d, e, this.valueColumn.count, runOn(this, this.wl));
        }
        th(a, b, c) {
            if (this.vl() == null || this.v6() == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            return this.tj(a, b, c, this.vr.r(this.vl(), this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.v6(), this.vl(), null, null, null);
        }
        fetchXAxis() {
            return this.yv;
        }
        fetchYAxis() {
            return this.y1;
        }
        x9(a) {
            this.xAxis = typeCast(CategoryAxisBase.$, a);
        }
        ya(a) {
            this.yAxis = typeCast(NumericYAxis.$, a);
        }
        wh() {
            return this.y1 != null && this.y1.c1();
        }
        y9(a) {
            this.yv = a;
        }
        za(a) {
            this.y1 = a;
        }
        vf(a, b) {
            return this.xc(a, b, this.yv);
        }
        o8(a, b, c, d) {
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    this.y9(this.xAxis);
                    if (this.xf.c6) {
                        this.xf.c5 = CategoryTrendLineManagerFactory.a(this.xf.c5, this.yv, this.qr, this, this.c9);
                    }
                    break;
                case "TrendLineType":
                    let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                    if (e != 0) {
                        this.xf.c5 = CategoryTrendLineManagerFactory.a(this.xf.c5, this.yv, this.qr, this, this.c9);
                    }
                    break;
            }
            super.o8(a, b, c, d);
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    if (c != d) {
                        this.np(typeCast(Axis.$, c));
                        this.pf(typeCast(Axis.$, d));
                        this.y9(this.xAxis);
                        this.vv.cu.g(this.hj);
                        this.pp(false);
                        this.ol();
                    }
                    break;
                case HorizontalAnchoredCategorySeries.$$p[1]:
                    if (c != d) {
                        this.np(typeCast(Axis.$, c));
                        this.pf(typeCast(Axis.$, d));
                        this.za(this.yAxis);
                        if (this.cy != null) {
                            this.cy.mf();
                        }
                        this.vv.cu.g(this.hj);
                        this.wh();
                        this.pp(false);
                        this.ol();
                    }
                    break;
                case "CategoryMode":
                    if (this.xAxis != null) {
                        this.xAxis.l5(true);
                    }
                    break;
            }
        }
        no(a, b, c, d) {
            super.no(a, b, c, d);
            if (this.yv != null && typeCast(ISortingAxis_$type, this.yv) !== null) {
                this.yv.i$i();
            }
            switch (a) {
                case 4:
                    if (this.yv != null) {
                        this.yv.c1();
                    }
                    if (this.y1 != null && !this.y1.c1()) {
                        this.pp(true);
                    }
                    break;
                case 1:
                    if (this.yv != null) {
                        this.yv.c1();
                    }
                    if (this.y1 != null && !this.y1.c1()) {
                        this.pp(true);
                    }
                    break;
                case 0:
                    if (this.yv != null) {
                        this.yv.c1();
                    }
                    if (this.y1 != null && !this.y1.c1()) {
                        this.pp(true);
                    }
                    break;
                case 2:
                    if (this.xv != null && this.xf.cu.d > 0 && this.y1 != null && !this.y1.c1()) {
                        this.pp(true);
                    }
                    break;
                case 3:
                    if (d == this.xv) {
                        if (this.yv != null) {
                            this.yv.c1();
                        }
                        if (this.y1 != null && !this.y1.c1()) {
                            this.pp(true);
                        }
                    }
                    break;
            }
        }
        y3(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
                return true;
            }
            return false;
        }
        y4(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get yy() {
            return this.yx;
        }
        set yy(a) {
            let b = this.yy;
            if (a != b) {
                this.yx = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.yy));
            }
        }
        get useHighMarkerFidelity() {
            return this.wi;
        }
    }
    HorizontalAnchoredCategorySeries.$t = /*@__PURE__*/ markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::zb', [CategoryAxisBase.$, null], 'YAxis::zc', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
})();
