/*
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-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { Axis } from "./Axis";
import { Point_$type, runOn, typeCast, markType, markDep } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { RangeValueList } from "./RangeValueList";
import { ScalerParams } from "./ScalerParams";
import { CategoryXAxis } from "./CategoryXAxis";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
/**
 * @hidden
 */
export let HorizontalRangeCategorySeries = /*@__PURE__*/ (() => {
    class HorizontalRangeCategorySeries extends RangeCategorySeries {
        fetchXAxis() {
            return this.xAxis;
        }
        fetchYAxis() {
            return this.yAxis;
        }
        ku() {
            super.ku();
            this.xAxis = null;
            this.yAxis = null;
        }
        ah(a) {
            let b = this.aj(this.rn(), this.ro.f, this.so(this.b0), this.sp(this.b0), this.po(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.rn(), this.ro.f, this.so(this.b0), this.sp(this.b0), this.po(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_eb() {
            return true;
        }
        bp() {
            if (this.bq == 0) {
                return 1;
            }
            else {
                return super.bp();
            }
        }
        getOffsetValue() {
            return this.RangeFramePreparer.r(this.xAxis, this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
        }
        getCategoryWidth() {
            return this.xAxis.getCategorySize(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
        }
        hh(a, b) {
            return this.hi(a, b, this.xAxis, runOn(this, this.sm), new RangeValueList(this.highColumn, this.lowColumn));
        }
        hj(a, b) {
            return this.hk(a, b, this.xAxis, runOn(this, this.sm), new RangeValueList(this.highColumn, this.lowColumn));
        }
        f3(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.xAxis.le;
            return this.f4(a, b, this.xAxis, d, e, f, runOn(this, this.sm));
        }
        gj(a, b, c) {
            if (this.cd == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.b0);
            let e = new ScalerParams(0, this.cd.sf, this.b0.bu, this.xAxis.cg, d);
            let f = this.RangeFramePreparer.r(this.xAxis, this.cd.sf, this.b0.bu, d);
            return this.gl(new RangeValueList(this.highColumn, this.lowColumn), a, this.xAxis, e, f, runOn(this, this.sm), b, c);
        }
        gh(a, b, c) {
            if (this.cd == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.b0);
            let e = new ScalerParams(0, this.cd.sf, this.b0.bu, this.xAxis.cg, d);
            let f = this.RangeFramePreparer.r(this.xAxis, this.cd.sf, this.b0.bu, d);
            return this.gl(this.lowColumn, a, this.xAxis, e, f, runOn(this, this.sm), b, c);
        }
        gf(a, b, c) {
            if (this.cd == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.b0);
            let e = new ScalerParams(0, this.cd.sf, this.b0.bu, this.xAxis.cg, d);
            let f = this.RangeFramePreparer.r(this.xAxis, this.cd.sf, this.b0.bu, d);
            return this.gl(this.highColumn, a, this.xAxis, e, f, runOn(this, this.sm), b, c);
        }
        ph(a, b, c) {
            return this.pn(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.yAxis, this.xAxis, runOn(this, this.gf), (d, e) => this.hk(d, e, this.xAxis, runOn(this, this.sm), this.highColumn), (d, e) => this.hi(d, e, this.xAxis, runOn(this, this.sm), this.highColumn));
        }
        pj(a, b, c) {
            return this.pn(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.yAxis, this.xAxis, runOn(this, this.gh), (d, e) => this.hk(d, e, this.xAxis, runOn(this, this.sm), this.lowColumn), (d, e) => this.hi(d, e, this.xAxis, runOn(this, this.sm), this.lowColumn));
        }
        pl(a, b, c) {
            return this.pn(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.yAxis, this.xAxis, null, null, null);
        }
        si() {
            return this.yAxis != null && this.yAxis.c0();
        }
        l3(a, b, c, d) {
            super.l3(a, b, c, d);
            switch (b) {
                case HorizontalRangeCategorySeries.$$p[4]:
                    this.k1(typeCast(Axis.$, c));
                    this.l8(typeCast(Axis.$, d));
                    this.rx.cr.g(this.ft);
                    this.mh(false);
                    this.lo();
                    break;
                case HorizontalRangeCategorySeries.$$p[5]:
                    this.k1(typeCast(Axis.$, c));
                    this.l8(typeCast(Axis.$, d));
                    this.rx.cr.g(this.ft);
                    this.si();
                    this.mh(false);
                    this.lo();
                    break;
            }
        }
        tw(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        tv(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
                return true;
            }
            return false;
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.gh(c, false, false);
            let e = this.gf(c, false, false);
            let f = new DataLegendSeriesValueInfo();
            f.a = 1;
            f.l = e > d ? d : e;
            f.p = this.to != null ? this.to : "High";
            f.q = this.t1 != null ? this.t1 : "L:";
            f.r = this.t3 != null ? this.t3 : "";
            let g = new DataLegendSeriesValueInfo();
            g.a = 2;
            g.l = e > d ? e : d;
            g.p = this.tl != null ? this.tl : "High";
            g.q = this.tx != null ? this.tx : "H:";
            g.r = this.tz != null ? this.tz : "";
            let h = new DataLegendSeriesValueInfo();
            h.a = 7;
            h.l = Math.abs(g.l - f.l);
            h.p = "Range";
            h.q = "R:";
            h.k = true;
            let i = new DataLegendSeriesValueInfo();
            i.a = 6;
            i.l = f.l + (h.l / 2);
            i.p = "Average";
            i.q = "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.av();
            return j;
        }
        get useHighMarkerFidelity() {
            return this.sj;
        }
    }
    HorizontalRangeCategorySeries.$t = markType(HorizontalRangeCategorySeries, 'HorizontalRangeCategorySeries', RangeCategorySeries.$);
    HorizontalRangeCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalRangeCategorySeries, 'raisePropertyChanged', ['HighMemberAsLegendLabel:tx:t7', [2, null], 'HighMemberAsLegendUnit:tz:t8', [2, null], 'LowMemberAsLegendLabel:t1:t9', [2, null], 'LowMemberAsLegendUnit:t3:ua', [2, null], 'XAxis::ub', [CategoryAxisBase.$, null], 'YAxis::uc', [NumericYAxis.$, null]]);
    return HorizontalRangeCategorySeries;
})();
