/*
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 { __extends } from "tslib";
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
 */
var HorizontalAnchoredCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAnchoredCategorySeries, _super);
    function HorizontalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.aby = null;
        _this.abu = null;
        _this.ab0 = null;
        _this.abw = 0;
        return _this;
    }
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "abz", {
        get: function () {
            var _this = this;
            if (this.aby == null) {
                this.aby = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.dp.n; });
            }
            return this.aby;
        },
        enumerable: false,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.prototype.o0 = function () {
        _super.prototype.o0.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    HorizontalAnchoredCategorySeries.prototype.ci = function () {
        return 1;
    };
    HorizontalAnchoredCategorySeries.prototype.cj = function () {
        if (this.yAxis != null && this.yAxis.ch) {
            return 4;
        }
        return 3;
    };
    HorizontalAnchoredCategorySeries.prototype.b0 = function () {
        if (this.b1 == 0) {
            return 1;
        }
        else {
            return _super.prototype.b0.call(this);
        }
    };
    HorizontalAnchoredCategorySeries.prototype.yk = function () {
        return this.abu;
    };
    HorizontalAnchoredCategorySeries.prototype.y0 = function () {
        return this.ab0;
    };
    HorizontalAnchoredCategorySeries.prototype.wj = function (a) {
        if (this.yl == null || this.yl.n.count == 0 || !this.hasMarkers || !this.w8()) {
            return Rect.empty;
        }
        return this.abz.d$d(this, this.yl.n, a, runOn(this, this.acc));
    };
    HorizontalAnchoredCategorySeries.prototype.acc = function (a) {
        return this.aae.de(a);
    };
    HorizontalAnchoredCategorySeries.prototype.ab4 = function (a, b, c) {
        return this.abz.d$c(this, this.y0(), a, b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.aj = function (a) {
        return this.abz.d$a(this, this.yl.f, this.zm(this.ct), this.zn(this.ct), a);
    };
    HorizontalAnchoredCategorySeries.prototype.ak = function (a) {
        return this.abz.d$b(this, this.yl.f, this.zm(this.ct), this.zn(this.ct), a);
    };
    HorizontalAnchoredCategorySeries.prototype.gu = function (a, b) {
        if (this.gt(a, b)) {
            return true;
        }
        if (this.w9(a, b)) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.yq.r(this.yk(), this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
    };
    HorizontalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        var a = this.getEffectiveViewport1(this.ct);
        return this.yk().getCategorySize(this.ct.by, this.ct.bx, a);
    };
    HorizontalAnchoredCategorySeries.prototype.i3 = function (a, b, c) {
        if (this.c9 == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.yk();
        if (e == null) {
            return NaN;
        }
        var f = new ScalerParams(0, this.c9.vl, this.ct.bx, e.ch, d);
        var g = this.yq.r(e, this.c9.vl, this.ct.bx, d);
        return this.i5(this.valueColumn, a, e, f, g, runOn(this, this.zk), b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.j8 = function (a, b) {
        return this.j9(a, b, this.yk(), runOn(this, this.zk), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.j6 = function (a, b) {
        return this.j7(a, b, this.yk(), runOn(this, this.zk), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.im = function (a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.io(a, b, this.yk(), d, e, this.valueColumn.count, runOn(this, this.zk));
    };
    HorizontalAnchoredCategorySeries.prototype.v6 = function (a, b, c) {
        if (this.yk() == null || this.y0() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.v8(a, b, c, this.yq.r(this.yk(), this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.y0(), this.yk(), null, null, null);
    };
    HorizontalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.abu;
    };
    HorizontalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.ab0;
    };
    HorizontalAnchoredCategorySeries.prototype.aa8 = function (a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.aa9 = function (a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.zg = function () {
        return this.ab0 != null && this.ab0.c1();
    };
    HorizontalAnchoredCategorySeries.prototype.ab8 = function (a) {
        this.abu = a;
    };
    HorizontalAnchoredCategorySeries.prototype.ab9 = function (a) {
        this.ab0 = a;
    };
    HorizontalAnchoredCategorySeries.prototype.ye = function (a, b) {
        return this.aab(a, b, this.abu);
    };
    HorizontalAnchoredCategorySeries.prototype.q5 = function (a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.ab8(this.xAxis);
                if (this.aae.c8) {
                    this.aae.c7 = CategoryTrendLineManagerFactory.a(this.aae.c7, this.abu, this.sp, this, this.dp);
                }
                break;
            case "TrendLineType":
                var e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.aae.c7 = CategoryTrendLineManagerFactory.a(this.aae.c7, this.abu, this.sp, this, this.dp);
                }
                break;
        }
        _super.prototype.q5.call(this, a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.pa(typeCast(Axis.$, c));
                    this.rd(typeCast(Axis.$, d));
                    this.ab8(this.xAxis);
                    this.yu.cw.g(this.ib);
                    this.rn(false);
                    this.qh();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.pa(typeCast(Axis.$, c));
                    this.rd(typeCast(Axis.$, d));
                    this.ab9(this.yAxis);
                    if (this.c9 != null) {
                        this.c9.nq();
                    }
                    this.yu.cw.g(this.ib);
                    this.zg();
                    this.rn(false);
                    this.qh();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.l7(true);
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.o9 = function (a, b, c, d) {
        _super.prototype.o9.call(this, a, b, c, d);
        if (this.abu != null && typeCast(ISortingAxis_$type, this.abu) !== null) {
            this.abu.i$i();
        }
        switch (a) {
            case 4:
                if (this.abu != null) {
                    this.abu.c1();
                }
                if (this.ab0 != null && !this.ab0.c1()) {
                    this.rn(true);
                }
                break;
            case 1:
                if (this.abu != null) {
                    this.abu.c1();
                }
                if (this.ab0 != null && !this.ab0.c1()) {
                    this.rn(true);
                }
                break;
            case 0:
                if (this.abu != null) {
                    this.abu.c1();
                }
                if (this.ab0 != null && !this.ab0.c1()) {
                    this.rn(true);
                }
                break;
            case 2:
                if (this.aau != null && this.aae.cw.d > 0 && this.ab0 != null && !this.ab0.c1()) {
                    this.rn(true);
                }
                break;
            case 3:
                if (d == this.aau) {
                    if (this.abu != null) {
                        this.abu.c1();
                    }
                    if (this.ab0 != null && !this.ab0.c1()) {
                        this.rn(true);
                    }
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.ab2 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.ab3 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "abx", {
        get: function () {
            return this.abw;
        },
        set: function (a) {
            var b = this.abx;
            if (a != b) {
                this.abw = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.abx));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.zh;
        },
        enumerable: false,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::aca', [CategoryAxisBase.$, null], 'YAxis::acb', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { HorizontalAnchoredCategorySeries };
