/*
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 { 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
 */
export let HorizontalRangeCategorySeries = /*@__PURE__*/ (() => {
    class HorizontalRangeCategorySeries extends RangeCategorySeries {
        fetchXAxis() {
            return this.xAxis;
        }
        fetchYAxis() {
            return this.yAxis;
        }
        ng() {
            super.ng();
            this.xAxis = null;
            this.yAxis = null;
        }
        ah(a) {
            let b = this.aj(this.vl(), this.vm.f, this.wn(this.cj), this.wo(this.cj), this.tm(a), true);
            if (b == null) {
                return null;
            }
            let c = b[0];
            let d = b[1];
            let e = new Array(1);
            let 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;
        }
        ai(a) {
            let b = this.aj(this.vl(), this.vm.f, this.wn(this.cj), this.wo(this.cj), this.tm(a), true);
            if (b == null) {
                return null;
            }
            let c = b[0];
            let d = b[1];
            let e = new Array(1);
            let 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;
        }
        get_e7() {
            return true;
        }
        bx() {
            if (this.by == 0) {
                return 1;
            }
            else {
                return super.bx();
            }
        }
        getOffsetValue() {
            return this.RangeFramePreparer.r(this.xAxis, this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj));
        }
        getCategoryWidth() {
            return this.xAxis.getCategorySize(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj));
        }
        jd(a, b) {
            return this.je(a, b, this.xAxis, runOn(this, this.wl), new RangeValueList(this.highColumn, this.lowColumn));
        }
        jf(a, b) {
            return this.jg(a, b, this.xAxis, runOn(this, this.wl), new RangeValueList(this.highColumn, this.lowColumn));
        }
        ht(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.xAxis.lf;
            return this.hu(a, b, this.xAxis, d, e, f, runOn(this, this.wl));
        }
        h9(a, b, c) {
            if (this.cy == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.cj);
            let e = new ScalerParams(0, this.cy.tn, this.cj.bx, this.xAxis.ch, d);
            let f = this.RangeFramePreparer.r(this.xAxis, this.cy.tn, this.cj.bx, d);
            return this.ib(new RangeValueList(this.highColumn, this.lowColumn), a, this.xAxis, e, f, runOn(this, this.wl), b, c);
        }
        h7(a, b, c) {
            if (this.cy == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.cj);
            let e = new ScalerParams(0, this.cy.tn, this.cj.bx, this.xAxis.ch, d);
            let f = this.RangeFramePreparer.r(this.xAxis, this.cy.tn, this.cj.bx, d);
            return this.ib(this.lowColumn, a, this.xAxis, e, f, runOn(this, this.wl), b, c);
        }
        h5(a, b, c) {
            if (this.cy == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.cj);
            let e = new ScalerParams(0, this.cy.tn, this.cj.bx, this.xAxis.ch, d);
            let f = this.RangeFramePreparer.r(this.xAxis, this.cy.tn, this.cj.bx, d);
            return this.ib(this.highColumn, a, this.xAxis, e, f, runOn(this, this.wl), b, c);
        }
        td(a, b, c) {
            return this.tj(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.yAxis, this.xAxis, runOn(this, this.h5), (d, e) => this.jg(d, e, this.xAxis, runOn(this, this.wl), this.highColumn), (d, e) => this.je(d, e, this.xAxis, runOn(this, this.wl), this.highColumn));
        }
        tf(a, b, c) {
            return this.tj(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.yAxis, this.xAxis, runOn(this, this.h7), (d, e) => this.jg(d, e, this.xAxis, runOn(this, this.wl), this.lowColumn), (d, e) => this.je(d, e, this.xAxis, runOn(this, this.wl), this.lowColumn));
        }
        th(a, b, c) {
            return this.tj(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.yAxis, this.xAxis, null, null, null);
        }
        wh() {
            return this.yAxis != null && this.yAxis.c1();
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            switch (b) {
                case HorizontalRangeCategorySeries.$$p[4]:
                    this.np(typeCast(Axis.$, c));
                    this.pf(typeCast(Axis.$, d));
                    this.vv.cu.g(this.hj);
                    this.pp(false);
                    this.ol();
                    break;
                case HorizontalRangeCategorySeries.$$p[5]:
                    this.np(typeCast(Axis.$, c));
                    this.pf(typeCast(Axis.$, d));
                    this.vv.cu.g(this.hj);
                    this.wh();
                    this.pp(false);
                    this.ol();
                    break;
            }
        }
        x3(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        x2(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
                return true;
            }
            return false;
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.h7(c, false, false);
            let e = this.h5(c, false, false);
            let f = new DataLegendSeriesValueInfo();
            f.a = 1;
            f.l = e > d ? d : e;
            f.p = "Low";
            f.q = this.xr != null ? this.xr : "Low";
            f.r = this.x8 != null ? this.x8 : "L:";
            f.s = this.ya != null ? this.ya : "";
            let g = new DataLegendSeriesValueInfo();
            g.a = 2;
            g.l = e > d ? e : d;
            g.p = "High";
            g.q = this.xo != null ? this.xo : "High";
            g.r = this.x4 != null ? this.x4 : "H:";
            g.s = this.x6 != null ? this.x6 : "";
            let 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;
            let 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;
            let j = new DataLegendSeriesContext();
            j.f = ((() => {
                let $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;
        }
        get useHighMarkerFidelity() {
            return this.wi;
        }
    }
    HorizontalRangeCategorySeries.$t = /*@__PURE__*/ markType(HorizontalRangeCategorySeries, 'HorizontalRangeCategorySeries', RangeCategorySeries.$);
    HorizontalRangeCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HorizontalRangeCategorySeries, 'raisePropertyChanged', ['HighMemberAsLegendLabel:x4:ye', [2, null], 'HighMemberAsLegendUnit:x6:yf', [2, null], 'LowMemberAsLegendLabel:x8:yg', [2, null], 'LowMemberAsLegendUnit:ya:yh', [2, null], 'XAxis::yi', [CategoryAxisBase.$, null], 'YAxis::yj', [NumericYAxis.$, null]]);
    return HorizontalRangeCategorySeries;
})();
