/*
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 { SplineSeriesBase } from "./SplineSeriesBase";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { typeCast, runOn, markType } from "igniteui-react-core/ES2015/type";
import { Path } from "igniteui-react-core/ES2015/Path";
import { ScalerParams } from "./ScalerParams";
import { SplineSeriesBaseView } from "./SplineSeriesBaseView";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core/ES2015/Color";
export class SplineAreaSeries extends SplineSeriesBase {
    constructor() {
        super();
        this.qg = null;
        this.qg = new CategoryLineRasterizer();
        this.ab = SplineAreaSeries.$;
    }
    bf() {
        return new SplineAreaSeriesView(this);
    }
    m4() {
        return 1;
    }
    ii(a) {
        super.ii(a);
        this.qh = a;
    }
    preferredCategoryMode(a) {
        return 0;
    }
    hl(a, b) {
        super.hl(a, b);
        let c = b;
        c.c6();
    }
    de(a, b) {
        let c = this.k9(this.lc(a), true, false);
        if (this.px(a, c, b)) {
            return true;
        }
        if (this.dd(a, b)) {
            return true;
        }
        if (this.ls(a, b)) {
            return true;
        }
        return false;
    }
    ob(a, b) {
        super.ob(a, b);
        let c = this.m3.cl.d;
        let d = typeCast(SplineAreaSeriesView.$, b);
        let e = a.f;
        let f = this.getEffectiveViewport1(b);
        this.m2.x(this, this.nn(), this.pn, runOn(this, this.mo), this.nv(b), this.nw(b));
        let g = false;
        let h = this.m2.c;
        if (h != null) {
            g = true;
        }
        if (g) {
            let i = new ScalerParams(0, b.bq, b.bp, this.pn.b8, f);
            this.n7(e, -1, this.valueColumn.count, this.pn, i, b.n);
        }
        let j = d.dd;
        let k = d.de;
        let l = d.dg;
        let m = d.di;
        this.m2.ae(j, true, false, true, true);
        this.m2.ae(k, true, false, true, true);
        this.m2.ae(l, false, true, false, false);
        this.m2.ae(m, false, true, false, false);
        l._opacity = this.m2.i * this.d1;
        m._opacity = 0.5 * this.m2.i * this.d1;
        if (b.cp(a)) {
            d.c8(a.f.count, e, true, c, this.eo, (n, o, p, q, r) => this.o7(n, a.f.count, b), 1, a.f.count == 1 ? null : this.om(e, e.count - 1, b.bp, b.bq, true));
            b.cs(a);
        }
        let n = this.fetchYAxis();
    }
    get useHighMarkerFidelity() {
        return this.nq;
    }
}
SplineAreaSeries.$t = markType(SplineAreaSeries, 'SplineAreaSeries', SplineSeriesBase.$);
export class SplineAreaSeriesView extends SplineSeriesBaseView {
    constructor(a) {
        super(a);
        this.c5 = null;
        this.df = new Path();
        this.dj = new Path();
        this.dh = new Path();
        this.dk = new Path();
        this.c9 = new Path();
        this.db = new Path();
        this.da = new Path();
        this.dc = new Path();
        this.c5 = a;
    }
    ap() {
        super.ap();
        if (!this.n) {
            this.e.bj = 1;
        }
    }
    get dd() {
        return this.dj;
    }
    get de() {
        return this.dk;
    }
    get dg() {
        return this.df;
    }
    get di() {
        return this.dh;
    }
    c6() {
        this.df.aj = null;
        this.dh.aj = null;
        this.dj.aj = null;
        this.dk.aj = null;
        this.an();
    }
    c7(a, b, c, d, e, f, g) {
        this.c8(a, b, c, d, e, f, g, null);
    }
    c8(a, b, c, d, e, f, g, h) {
        this.c5.qg.a = typeCast(ISortingAxis_$type, this.cn.fetchXAxis()) !== null ? true : false;
        this.c5.qg.j(this.df, this.dj, this.dh, this.dk, a, b, c, d, e, f, g, h);
        this.an();
    }
    a9() {
        super.a9();
        this.c9.aj = this.df.aj;
        this.db.aj = this.dj.aj;
        this.da.aj = this.dh.aj;
        this.dc.aj = this.dk.aj;
        let a = this.bk();
        this.c9._fill = a;
        this.c9._opacity = 1;
        this.da._fill = a;
        this.da._opacity = 1;
        this.db._stroke = a;
        this.db.ac = this.e.es + 3;
        this.dc._stroke = a;
        this.dc.ac = this.e.es + 3;
    }
    a3(a, b) {
        super.a3(a, b);
        if (b) {
            a.s(this.c9);
            a.s(this.da);
            a.s(this.db);
            a.s(this.dc);
        }
        else {
            a.s(this.df);
            a.s(this.dh);
            a.s(this.dj);
            a.s(this.dk);
        }
    }
    ai(a) {
        super.ai(a);
        this.e.a2.exportPathData(a, this.dj, "lowerShape", ["Lower"]);
        this.e.a2.exportPathData(a, this.dk, "upperShape", ["Upper", "Main"]);
        this.e.a2.exportPathData(a, this.dh, "translucentShape", ["Translucent"]);
        this.e.a2.exportPathData(a, this.df, "fillShape", ["Fill"]);
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.ky = a;
        this.e.ep = 5;
        this.e.eq = 1;
        this.e.er = -3;
    }
}
SplineAreaSeriesView.$t = markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
