/*
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/ES2015/DependencyProperty";
import { NumericYAxis } from "./NumericYAxis";
import { Axis } from "./Axis";
import { Type, Point_$type, runOn, typeCast, markType } from "igniteui-react-core/ES2015/type";
import { RangeValueList } from "./RangeValueList";
import { ScalerParams } from "./ScalerParams";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
export class HorizontalRangeCategorySeries extends RangeCategorySeries {
    fetchXAxis() {
        return this.xAxis;
    }
    fetchYAxis() {
        return this.yAxis;
    }
    hm() {
        super.hm();
        this.xAxis = null;
        this.yAxis = null;
    }
    ah(a) {
        let b = this.aj(this.mx(), this.my.f, this.ny(this.bi), this.nz(this.bi), this.lf(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.mx(), this.my.f, this.ny(this.bi), this.nz(this.bi), this.lf(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_c3() {
        return true;
    }
    bd() {
        if (this.be == 0) {
            return 1;
        }
        else {
            return super.bd();
        }
    }
    getOffsetValue() {
        return this.RangeFramePreparer.r(this.xAxis, this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        return this.xAxis.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    e8(a, b) {
        return this.e9(a, b, this.xAxis, runOn(this, this.nw), new RangeValueList(this.highColumn, this.lowColumn));
    }
    fa(a, b) {
        return this.fb(a, b, this.xAxis, runOn(this, this.nw), new RangeValueList(this.highColumn, this.lowColumn));
    }
    d5(a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        let f = this.xAxis.jr;
        return this.d6(a, b, this.xAxis, d, e, f, runOn(this, this.nw));
    }
    ej(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = new ScalerParams(0, this.bs.mn, this.bi.br, this.xAxis.b8, d);
        let f = this.RangeFramePreparer.r(this.xAxis, this.bs.mn, this.bi.br, d);
        return this.el(new RangeValueList(this.highColumn, this.lowColumn), a, this.xAxis, e, f, runOn(this, this.nw), b, c);
    }
    eh(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = new ScalerParams(0, this.bs.mn, this.bi.br, this.xAxis.b8, d);
        let f = this.RangeFramePreparer.r(this.xAxis, this.bs.mn, this.bi.br, d);
        return this.el(this.lowColumn, a, this.xAxis, e, f, runOn(this, this.nw), b, c);
    }
    ef(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = new ScalerParams(0, this.bs.mn, this.bi.br, this.xAxis.b8, d);
        let f = this.RangeFramePreparer.r(this.xAxis, this.bs.mn, this.bi.br, d);
        return this.el(this.highColumn, a, this.xAxis, e, f, runOn(this, this.nw), b, c);
    }
    k8(a, b, c) {
        return this.le(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.yAxis, this.xAxis, runOn(this, this.ef), (d, e) => this.fb(d, e, this.xAxis, runOn(this, this.nw), this.highColumn), (d, e) => this.e9(d, e, this.xAxis, runOn(this, this.nw), this.highColumn));
    }
    la(a, b, c) {
        return this.le(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.yAxis, this.xAxis, runOn(this, this.eh), (d, e) => this.fb(d, e, this.xAxis, runOn(this, this.nw), this.lowColumn), (d, e) => this.e9(d, e, this.xAxis, runOn(this, this.nw), this.lowColumn));
    }
    lc(a, b, c) {
        return this.le(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.yAxis, this.xAxis, null, null, null);
    }
    ns() {
        return this.yAxis != null && this.yAxis.ck();
    }
    ir(a, b, c, d) {
        super.ir(a, b, c, d);
        switch (b) {
            case HorizontalRangeCategorySeries.$$p[0]:
                this.hs(typeCast(Axis.$, c));
                this.iw(typeCast(Axis.$, d));
                this.m6.cn.g(this.eq);
                this.i4(false);
                this.ib();
                break;
            case HorizontalRangeCategorySeries.$$p[1]:
                this.hs(typeCast(Axis.$, c));
                this.iw(typeCast(Axis.$, d));
                this.m6.cn.g(this.eq);
                this.ns();
                this.i4(false);
                this.ib();
                break;
        }
    }
    o5(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    o4(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    get useHighMarkerFidelity() {
        return this.nt;
    }
}
HorizontalRangeCategorySeries.$t = markType(HorizontalRangeCategorySeries, 'HorizontalRangeCategorySeries', RangeCategorySeries.$);
Type.dep(DependencyProperty, PropertyMetadata, HorizontalRangeCategorySeries, 'raisePropertyChanged', ['XAxis::o8', [CategoryAxisBase.$, null], 'YAxis::o9', [NumericYAxis.$, null]]);
