/*
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-react-core";
import { List$1 } from "igniteui-react-core";
import { Polyline } from "igniteui-react-core";
import { Polygon } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { isNaN_ } from "igniteui-react-core";
import { RangeCategorySeriesView } from "./RangeCategorySeriesView";
/**
 * @hidden
 */
export let RangeAreaSeries = /*@__PURE__*/ (() => {
    class RangeAreaSeries extends HorizontalRangeCategorySeries {
        bc() {
            return new RangeAreaSeries();
        }
        cd() {
            return new RangeAreaSeriesView(this);
        }
        o2(a) {
            super.o2(a);
            this.ym = a;
        }
        get_ea() {
            return true;
        }
        get_d9() {
            return true;
        }
        yn(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;
        }
        f5(a, b) {
            if (this.f4(a, b)) {
                return true;
            }
            if (this.uf(a, b)) {
                return true;
            }
            return false;
        }
        constructor() {
            super();
            this.ab = RangeAreaSeries.$;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        nk(a, b) {
            super.nk(a, b);
            let c = b;
            c.c6();
        }
        w7(a, b) {
            super.w7(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.vw.a2(this, this.wg(), runOn(this, this.vh), this.wp(b), this.wq(b));
            let k = false;
            let l = this.vw.b;
            if (l != null) {
                k = true;
            }
            if (k) {
                let m = new ScalerParams(0, b.by, b.bx, this.xAxis.ch, j);
                this.w3(d, -1, this.lowColumn.count, this.xAxis, m, b.q);
            }
            let n = i.df;
            let o = i.dg;
            let p = i.da;
            this.vw.ad(n, true, false, true, true);
            this.vw.ad(o, true, false, true, true);
            this.vw.ad(p, false, true, false, false);
            if (b.cy(a)) {
                i.c7(a.f.count, d, false);
                b.c1(a);
            }
            i.da._opacity = this.vw.j * this.hg;
        }
        get useHighMarkerFidelity() {
            return this.wk;
        }
    }
    RangeAreaSeries.$t = /*@__PURE__*/ markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
})();
/**
 * @hidden
 */
export let RangeAreaSeriesView = /*@__PURE__*/ (() => {
    class RangeAreaSeriesView extends RangeCategorySeriesView {
        constructor(a) {
            super(a);
            this.c5 = null;
            this.dd = new Polyline();
            this.c9 = new Polygon();
            this.de = new Polyline();
            this.dc = new Polyline();
            this.db = new Polyline();
            this.c8 = new Polygon();
            this.c5 = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.c5.uc = 1;
            }
        }
        get df() {
            return this.dd;
        }
        get da() {
            return this.c9;
        }
        get dg() {
            return this.de;
        }
        c6() {
            this.c9.an.clear();
            this.dd.an.clear();
            this.de.an.clear();
        }
        c7(a, b, c) {
            this.c4(this.dd, this.c9, this.de, a, b, c);
            this.as();
        }
        be() {
            super.be();
            this.db.an = this.dd.an;
            this.dc.an = this.de.an;
            this.c8.an = this.c9.an;
            let a = this.br();
            this.db._stroke = a;
            this.db.ad = this.e.hl + 3;
            this.dc._stroke = a;
            this.dc.ad = this.e.hl + 3;
            this.c8._fill = a;
            this.c8._opacity = 1;
        }
        a8(a, b) {
            super.a8(a, b);
            if (a.d) {
                if (b) {
                    a.u(this.c8);
                    a.v(this.db);
                    a.v(this.dc);
                }
                else {
                    a.u(this.c9);
                    a.v(this.dd);
                    a.v(this.de);
                }
            }
        }
        an(a) {
            super.an(a);
            this.e.a5.exportPolylineData(a, this.dd, "lowerShape", ["Lower"]);
            this.e.a5.exportPolylineData(a, this.de, "upperShape", ["Upper", "Main"]);
            this.e.a5.exportPolygonData(a, this.c9, "fillShape", ["Fill"]);
        }
    }
    RangeAreaSeriesView.$t = /*@__PURE__*/ markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
})();
