/*
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 { ChartSelection } from "./ChartSelection";
import { isNaN_ } from "igniteui-angular-core";
import { RangeCategorySeriesView } from "./RangeCategorySeriesView";
/**
 * @hidden
 */
export let RangeAreaSeries = /*@__PURE__*/ (() => {
    class RangeAreaSeries extends HorizontalRangeCategorySeries {
        constructor() {
            super();
            this.ab = RangeAreaSeries.$;
        }
        bj() {
            return new RangeAreaSeries();
        }
        cs() {
            return new RangeAreaSeriesView(this);
        }
        q1(a) {
            super.q1(a);
            this.ab0 = a;
        }
        get_ev() {
            return true;
        }
        get_eu() {
            return true;
        }
        ab1(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;
        }
        gw(a, b) {
            if (this.gv(a, b)) {
                return true;
            }
            if (this.xh(a, b)) {
                return true;
            }
            return false;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        o5(a, b) {
            super.o5(a, b);
            let c = b;
            c.c8();
        }
        aak(a, b) {
            super.aak(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.y2.a2(this, this.zm(), runOn(this, this.ym), this.zv(b), this.zw(b));
            let k = false;
            let l = this.y2.b;
            if (l != null) {
                k = true;
            }
            if (k) {
                let m = new ScalerParams(0, b.by, b.bx, this.xAxis.ch, j);
                this.aag(d, -1, this.lowColumn.count, this.xAxis, m, b.q, -1);
            }
            let n = i.dh;
            let o = i.di;
            let p = i.dc;
            this.y2.ad(n, true, false, true, true);
            this.y2.ad(o, true, false, true, true);
            this.y2.ad(p, false, true, false, false);
            if (b.c0(a)) {
                i.c9(a.f.count, d, false);
                b.c3(a);
            }
            i.dc._opacity = this.y2.j * this.h9;
        }
        p4(a, b, c) {
            this.aac(a, b, c, this.yt, 1);
        }
        ak(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            this.p4(a, c, b);
            return c.toArray();
        }
        get useHighMarkerFidelity() {
            return this.zq;
        }
    }
    RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
})();
/**
 * @hidden
 */
export let RangeAreaSeriesView = /*@__PURE__*/ (() => {
    class RangeAreaSeriesView extends RangeCategorySeriesView {
        constructor(a) {
            super(a);
            this.c7 = null;
            this.df = new Polyline();
            this.db = new Polygon();
            this.dg = new Polyline();
            this.de = new Polyline();
            this.dd = new Polyline();
            this.da = new Polygon();
            this.c7 = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.c7.xa = 1;
            }
        }
        get dh() {
            return this.df;
        }
        get dc() {
            return this.db;
        }
        get di() {
            return this.dg;
        }
        c8() {
            this.db.an.clear();
            this.df.an.clear();
            this.dg.an.clear();
        }
        c9(a, b, c) {
            this.c6(this.df, this.db, this.dg, a, b, c);
            this.as();
        }
        be() {
            super.be();
            this.dd.an = this.df.an;
            this.de.an = this.dg.an;
            this.da.an = this.db.an;
            let a = this.br();
            this.dd._stroke = a;
            this.dd.ad = this.e.ie + 3;
            this.de._stroke = a;
            this.de.ad = this.e.ie + 3;
            this.da._fill = a;
            this.da._opacity = 1;
        }
        a8(a, b) {
            super.a8(a, b);
            if (a.d) {
                if (b) {
                    a.u(this.da);
                    a.v(this.dd);
                    a.v(this.de);
                }
                else {
                    a.u(this.db);
                    a.v(this.df);
                    a.v(this.dg);
                }
            }
        }
        an(a) {
            super.an(a);
            this.e.bc.exportPolylineData(a, this.df, "lowerShape", ["Lower"]);
            this.e.bc.exportPolylineData(a, this.dg, "upperShape", ["Upper", "Main"]);
            this.e.bc.exportPolygonData(a, this.db, "fillShape", ["Fill"]);
        }
    }
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
})();
