/*
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 { RangeCategorySeries } from "./RangeCategorySeries";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { Axis } from "./Axis";
import { Point_$type, runOn, typeCast, markType, markDep } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { RangeValueList } from "./RangeValueList";
import { ScalerParams } from "./ScalerParams";
import { CategoryXAxis } from "./CategoryXAxis";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
/**
 * @hidden
 */
var HorizontalRangeCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalRangeCategorySeries, _super);
    function HorizontalRangeCategorySeries() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    HorizontalRangeCategorySeries.prototype.fetchXAxis = function () {
        return this.xAxis;
    };
    HorizontalRangeCategorySeries.prototype.fetchYAxis = function () {
        return this.yAxis;
    };
    HorizontalRangeCategorySeries.prototype.nh = function () {
        _super.prototype.nh.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    HorizontalRangeCategorySeries.prototype.ah = function (a) {
        var b = this.aj(this.vn(), this.vo.f, this.wp(this.cg), this.wq(this.cg), this.to(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        f[0] = { $type: Point_$type, x: c[0], y: c[2] };
        f[1] = { $type: Point_$type, x: d[0], y: d[2] };
        e[0] = f;
        return e;
    };
    HorizontalRangeCategorySeries.prototype.ai = function (a) {
        var b = this.aj(this.vn(), this.vo.f, this.wp(this.cg), this.wq(this.cg), this.to(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        f[0] = { $type: Point_$type, x: c[0], y: c[1] };
        f[1] = { $type: Point_$type, x: d[0], y: d[1] };
        e[0] = f;
        return e;
    };
    HorizontalRangeCategorySeries.prototype.get_e8 = function () {
        return true;
    };
    HorizontalRangeCategorySeries.prototype.bu = function () {
        if (this.bv == 0) {
            return 1;
        }
        else {
            return _super.prototype.bu.call(this);
        }
    };
    HorizontalRangeCategorySeries.prototype.getOffsetValue = function () {
        return this.RangeFramePreparer.r(this.xAxis, this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg));
    };
    HorizontalRangeCategorySeries.prototype.getCategoryWidth = function () {
        return this.xAxis.getCategorySize(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg));
    };
    HorizontalRangeCategorySeries.prototype.je = function (a, b) {
        return this.jf(a, b, this.xAxis, runOn(this, this.wn), new RangeValueList(this.highColumn, this.lowColumn));
    };
    HorizontalRangeCategorySeries.prototype.jg = function (a, b) {
        return this.jh(a, b, this.xAxis, runOn(this, this.wn), new RangeValueList(this.highColumn, this.lowColumn));
    };
    HorizontalRangeCategorySeries.prototype.hu = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.xAxis.lf;
        return this.hv(a, b, this.xAxis, d, e, f, runOn(this, this.wn));
    };
    HorizontalRangeCategorySeries.prototype.ia = function (a, b, c) {
        if (this.cv == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.cg);
        var e = new ScalerParams(0, this.cv.tr, this.cg.bx, this.xAxis.ch, d);
        var f = this.RangeFramePreparer.r(this.xAxis, this.cv.tr, this.cg.bx, d);
        return this.ic(new RangeValueList(this.highColumn, this.lowColumn), a, this.xAxis, e, f, runOn(this, this.wn), b, c);
    };
    HorizontalRangeCategorySeries.prototype.h8 = function (a, b, c) {
        if (this.cv == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.cg);
        var e = new ScalerParams(0, this.cv.tr, this.cg.bx, this.xAxis.ch, d);
        var f = this.RangeFramePreparer.r(this.xAxis, this.cv.tr, this.cg.bx, d);
        return this.ic(this.lowColumn, a, this.xAxis, e, f, runOn(this, this.wn), b, c);
    };
    HorizontalRangeCategorySeries.prototype.h6 = function (a, b, c) {
        if (this.cv == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.cg);
        var e = new ScalerParams(0, this.cv.tr, this.cg.bx, this.xAxis.ch, d);
        var f = this.RangeFramePreparer.r(this.xAxis, this.cv.tr, this.cg.bx, d);
        return this.ic(this.highColumn, a, this.xAxis, e, f, runOn(this, this.wn), b, c);
    };
    HorizontalRangeCategorySeries.prototype.tf = function (a, b, c) {
        var _this = this;
        return this.tl(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.yAxis, this.xAxis, runOn(this, this.h6), function (d, e) { return _this.jh(d, e, _this.xAxis, runOn(_this, _this.wn), _this.highColumn); }, function (d, e) { return _this.jf(d, e, _this.xAxis, runOn(_this, _this.wn), _this.highColumn); });
    };
    HorizontalRangeCategorySeries.prototype.th = function (a, b, c) {
        var _this = this;
        return this.tl(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.yAxis, this.xAxis, runOn(this, this.h8), function (d, e) { return _this.jh(d, e, _this.xAxis, runOn(_this, _this.wn), _this.lowColumn); }, function (d, e) { return _this.jf(d, e, _this.xAxis, runOn(_this, _this.wn), _this.lowColumn); });
    };
    HorizontalRangeCategorySeries.prototype.tj = function (a, b, c) {
        return this.tl(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.yAxis, this.xAxis, null, null, null);
    };
    HorizontalRangeCategorySeries.prototype.wj = function () {
        return this.yAxis != null && this.yAxis.c1();
    };
    HorizontalRangeCategorySeries.prototype.pa = function (a, b, c, d) {
        _super.prototype.pa.call(this, a, b, c, d);
        switch (b) {
            case HorizontalRangeCategorySeries.$$p[4]:
                this.nq(typeCast(Axis.$, c));
                this.ph(typeCast(Axis.$, d));
                this.vx.cu.g(this.hk);
                this.pr(false);
                this.om();
                break;
            case HorizontalRangeCategorySeries.$$p[5]:
                this.nq(typeCast(Axis.$, c));
                this.ph(typeCast(Axis.$, d));
                this.vx.cu.g(this.hk);
                this.wj();
                this.pr(false);
                this.om();
                break;
        }
    };
    HorizontalRangeCategorySeries.prototype.x5 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    HorizontalRangeCategorySeries.prototype.x4 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
            return true;
        }
        return false;
    };
    HorizontalRangeCategorySeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = { $type: Point_$type, x: a, y: b };
        var d = this.h8(c, false, false);
        var e = this.h6(c, false, false);
        var f = new DataLegendSeriesValueInfo();
        f.a = 1;
        f.l = e > d ? d : e;
        f.p = "Low";
        f.q = this.xt != null ? this.xt : "Low";
        f.r = this.ya != null ? this.ya : "L:";
        f.s = this.yc != null ? this.yc : "";
        var g = new DataLegendSeriesValueInfo();
        g.a = 2;
        g.l = e > d ? e : d;
        g.p = "High";
        g.q = this.xq != null ? this.xq : "High";
        g.r = this.x6 != null ? this.x6 : "H:";
        g.s = this.x8 != null ? this.x8 : "";
        var h = new DataLegendSeriesValueInfo();
        h.a = 7;
        h.l = Math.abs(g.l - f.l);
        h.p = "Range";
        h.q = "Range";
        h.r = "R:";
        h.k = true;
        var i = new DataLegendSeriesValueInfo();
        i.a = 6;
        i.l = f.l + (h.l / 2);
        i.p = "Average";
        i.q = "Average";
        i.r = "A:";
        i.k = true;
        var j = new DataLegendSeriesContext();
        j.f = ((function () {
            var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
            $ret.add(g);
            $ret.add(f);
            $ret.add(h);
            $ret.add(i);
            return $ret;
        })());
        j.b = this.aw();
        return j;
    };
    Object.defineProperty(HorizontalRangeCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.wk;
        },
        enumerable: false,
        configurable: true
    });
    HorizontalRangeCategorySeries.$t = markType(HorizontalRangeCategorySeries, 'HorizontalRangeCategorySeries', RangeCategorySeries.$);
    HorizontalRangeCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalRangeCategorySeries, 'raisePropertyChanged', ['HighMemberAsLegendLabel:x6:yg', [2, null], 'HighMemberAsLegendUnit:x8:yh', [2, null], 'LowMemberAsLegendLabel:ya:yi', [2, null], 'LowMemberAsLegendUnit:yc:yj', [2, null], 'XAxis::yk', [CategoryAxisBase.$, null], 'YAxis::yl', [NumericYAxis.$, null]]);
    return HorizontalRangeCategorySeries;
}(RangeCategorySeries));
export { HorizontalRangeCategorySeries };
