/*
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.$;
        }
        bk() {
            return new RangeAreaSeries();
        }
        ct() {
            return new RangeAreaSeriesView(this);
        }
        q7(a) {
            super.q7(a);
            this.acc = a;
        }
        get_ex() {
            return true;
        }
        get_ew() {
            return true;
        }
        acd(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;
        }
        gx(a, b) {
            if (this.gw(a, b)) {
                return true;
            }
            if (this.xr(a, b)) {
                return true;
            }
            return false;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        pb(a, b) {
            super.pb(a, b);
            let c = b;
            c.dl();
        }
        aax(a, b) {
            super.aax(a, b);
            let c = a.h.count;
            let d = new List$1(Array_$type, 2, c);
            for (let e = 0; e < c; e++) {
                let f = a.h._inner[e];
                let g = new Array(4);
                g[0] = f[0];
                g[1] = f[1];
                let h = a.h._inner[a.h.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.zc.a2(this, this.zw(), runOn(this, this.yw), this.z5(b), this.z6(b));
            let k = false;
            let l = this.zc.b;
            if (l != null) {
                k = true;
            }
            if (k) {
                let m = new ScalerParams(0, b.ca, b.b9, this.xAxis.df, j);
                this.aat(d, -1, this.lowColumn.count, this.xAxis, m, b.t, -1);
            }
            let n = i.dv;
            let o = i.dw;
            let p = i.dq;
            this.zc.ad(n, true, false, true, true);
            this.zc.ad(o, true, false, true, true);
            this.zc.ad(p, false, true, false, false);
            if (b.dd(a)) {
                i.dm(a.h.count, d, false);
                b.dg(a);
            }
            i.dq._opacity = this.zc.j * this.ia;
        }
        qa(a, b, c) {
            this.aap(a, b, c, this.y3, 1);
        }
        ak(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            this.qa(a, c, b);
            return c.toArray();
        }
        get useHighMarkerFidelity() {
            return this.z0;
        }
    }
    RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
})();
/**
 * @hidden
 */
export let RangeAreaSeriesView = /*@__PURE__*/ (() => {
    class RangeAreaSeriesView extends RangeCategorySeriesView {
        constructor(a) {
            super(a);
            this.dk = null;
            this.dt = new Polyline();
            this.dp = new Polygon();
            this.du = new Polyline();
            this.ds = new Polyline();
            this.dr = new Polyline();
            this.dn = new Polygon();
            this.dk = a;
        }
        a4() {
            super.a4();
            if (!this.t) {
                this.dk.xk = 1;
            }
        }
        get dv() {
            return this.dt;
        }
        get dq() {
            return this.dp;
        }
        get dw() {
            return this.du;
        }
        dl() {
            this.dp.an.clear();
            this.dt.an.clear();
            this.du.an.clear();
        }
        dm(a, b, c) {
            this.dj(this.dt, this.dp, this.du, a, b, c);
            this.a2();
        }
        bq() {
            super.bq();
            this.dr.an = this.dt.an;
            this.ds.an = this.du.an;
            this.dn.an = this.dp.an;
            let a = this.b3();
            this.dr._stroke = a;
            this.dr.ad = this.f.ig + 3;
            this.ds._stroke = a;
            this.ds.ad = this.f.ig + 3;
            this.dn._fill = a;
            this.dn._opacity = 1;
        }
        bj(a, b) {
            super.bj(a, b);
            if (a.d) {
                if (b) {
                    a.u(this.dn);
                    a.v(this.dr);
                    a.v(this.ds);
                }
                else {
                    a.u(this.dp);
                    a.v(this.dt);
                    a.v(this.du);
                }
            }
        }
        ax(a) {
            super.ax(a);
            this.f.bc.exportPolylineData(a, this.dt, "lowerShape", ["Lower"]);
            this.f.bc.exportPolylineData(a, this.du, "upperShape", ["Upper", "Main"]);
            this.f.bc.exportPolygonData(a, this.dp, "fillShape", ["Fill"]);
        }
    }
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
})();
