/*
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 { HorizontalRangeCategorySeries } from "./HorizontalRangeCategorySeries";
import { Array_$type, typeCast, runOn, markType } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Polyline } from "igniteui-angular-core";
import { Polygon } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { isNaN_ } from "igniteui-angular-core";
import { RangeCategorySeriesView } from "./RangeCategorySeriesView";
/**
 * @hidden
 */
export class RangeAreaSeries extends HorizontalRangeCategorySeries {
    constructor() {
        super();
        this.ab = RangeAreaSeries.$;
    }
    bf() {
        return new RangeAreaSeriesView(this);
    }
    iu(a) {
        super.iu(a);
        this.pj = a;
    }
    get_ck() {
        return true;
    }
    pk(a, b, c, d) {
        if (isNaN_(b.x) || isNaN_(b.y)) {
            return false;
        }
        if (isNaN_(c.x) || isNaN_(c.y)) {
            return false;
        }
        if ((a.y <= b.y && a.y >= c.y)) {
            return true;
        }
        return false;
    }
    dh(a, b) {
        if (this.dg(a, b)) {
            return true;
        }
        if (this.l4(a, b)) {
            return true;
        }
        return false;
    }
    preferredCategoryMode(a) {
        return 0;
    }
    hv(a, b) {
        super.hv(a, b);
        let c = b;
        c.cz();
    }
    oo(a, b) {
        super.oo(a, b);
        let c = a.f.count;
        let d = new List$1(Array_$type, 2, c);
        for (let e = 0; e < c; e++) {
            let f = a.f._inner[e];
            let g = new Array(4);
            g[0] = f[0];
            g[1] = f[1];
            let h = a.f._inner[a.f.count - 1 - e];
            g[2] = h[0];
            g[3] = h[2];
            d.add(g);
        }
        let i = typeCast(RangeAreaSeriesView.$, b);
        let j = this.getEffectiveViewport1(i);
        this.ne.x(this, this.nz(), this.xAxis, runOn(this, this.m0), this.n7(b), this.n8(b));
        let k = false;
        let l = this.ne.c;
        if (l != null) {
            k = true;
        }
        if (k) {
            let m = new ScalerParams(0, b.bs, b.br, this.xAxis.b8, j);
            this.ok(d, -1, this.lowColumn.count, this.xAxis, m, b.n);
        }
        let n = i.c7;
        let o = i.c9;
        let p = i.c3;
        this.ne.ae(n, true, false, true, true);
        this.ne.ae(o, true, false, true, true);
        this.ne.ae(p, false, true, false, false);
        if (b.cr(a)) {
            i.c0(a.f.count, d, false);
            b.cu(a);
        }
        i.c3._opacity = this.ne.i * this.d6;
    }
    get useHighMarkerFidelity() {
        return this.n2;
    }
}
RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
/**
 * @hidden
 */
export class RangeAreaSeriesView extends RangeCategorySeriesView {
    constructor(a) {
        super(a);
        this.cy = null;
        this.c6 = new Polyline();
        this.c2 = new Polygon();
        this.c8 = new Polyline();
        this.c5 = new Polyline();
        this.c4 = new Polyline();
        this.c1 = new Polygon();
        this.cy = a;
    }
    ap() {
        super.ap();
        if (!this.n) {
            this.e.bj = 1;
        }
    }
    get c7() {
        return this.c6;
    }
    get c3() {
        return this.c2;
    }
    get c9() {
        return this.c8;
    }
    cz() {
        this.c2.ak.clear();
        this.c6.ak.clear();
        this.c8.ak.clear();
    }
    c0(a, b, c) {
        this.cx(this.c6, this.c2, this.c8, a, b, c);
        this.an();
    }
    a9() {
        super.a9();
        this.c4.ak = this.c6.ak;
        this.c5.ak = this.c8.ak;
        this.c1.ak = this.c2.ak;
        let a = this.bl();
        this.c4._stroke = a;
        this.c4.ac = this.e.ey + 3;
        this.c5._stroke = a;
        this.c5.ac = this.e.ey + 3;
        this.c1._fill = a;
        this.c1._opacity = 1;
    }
    a3(a, b) {
        super.a3(a, b);
        if (a.d) {
            if (b) {
                a.t(this.c1);
                a.u(this.c4);
                a.u(this.c5);
            }
            else {
                a.t(this.c2);
                a.u(this.c6);
                a.u(this.c8);
            }
        }
    }
    ai(a) {
        super.ai(a);
        this.e.a2.exportPolylineData(a, this.c6, "lowerShape", ["Lower"]);
        this.e.a2.exportPolylineData(a, this.c8, "upperShape", ["Upper", "Main"]);
        this.e.a2.exportPolygonData(a, this.c2, "fillShape", ["Fill"]);
    }
}
RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
//# sourceMappingURL=RangeAreaSeries_combined.js.map