/*
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";
export class SplineSeries extends SplineSeriesBase {
    constructor() {
        super();
        this.qg = null;
        this.qg = new CategoryLineRasterizer();
        this.ab = SplineSeries.$;
    }
    bf() {
        return new SplineSeriesView(this);
    }
    ii(a) {
        super.ii(a);
        this.qh = a;
    }
    preferredCategoryMode(a) {
        return 0;
    }
    hl(a, b) {
        super.hl(a, b);
        let c = b;
        c.c6();
    }
    ob(a, b) {
        super.ob(a, b);
        let c = b;
        let d = c.cl.d;
        let e = typeCast(SplineSeriesView.$, b);
        let f = a.f;
        let g = this.getEffectiveViewport1(b);
        this.m2.x(this, this.nn(), this.pn, runOn(this, this.mo), this.nv(b), this.nw(b));
        let h = false;
        let i = this.m2.c;
        if (i != null) {
            h = true;
        }
        if (h) {
            let j = new ScalerParams(0, b.bq, b.bp, this.pn.b8, g);
            this.n7(f, -1, this.valueColumn.count, this.pn, j, b.n);
        }
        let k = e.dc;
        let l = e.dd;
        let m = e.db;
        this.m2.ae(k, true, false, true, false);
        this.m2.ae(l, true, false, true, false);
        this.m2.ae(m, false, true, false, false);
        m._opacity = 0.75 * this.m2.i;
        if (b.cp(a)) {
            e.c7(f.count, f, true, 1, this.ol(f, f.count - 1, b.bp, b.bq), d, this.eo);
            b.cs(a);
        }
    }
    get useHighMarkerFidelity() {
        return this.nq;
    }
}
SplineSeries.$t = markType(SplineSeries, 'SplineSeries', SplineSeriesBase.$);
export class SplineSeriesView extends SplineSeriesBaseView {
    constructor(a) {
        super(a);
        this.c5 = null;
        this.df = new Path();
        this.de = new Path();
        this.dg = new Path();
        this.da = new Path();
        this.c9 = new Path();
        this.c8 = new Path();
        this.c5 = a;
    }
    get dc() {
        return this.df;
    }
    get dd() {
        return this.dg;
    }
    get db() {
        return this.de;
    }
    c6() {
        this.de.aj = null;
        this.df.aj = null;
        this.dg.aj = null;
        this.an();
    }
    c7(a, b, c, d, e, f, g) {
        this.c5.qg.a = typeCast(ISortingAxis_$type, this.cn.fetchXAxis()) !== null ? true : false;
        this.c5.qg.m(this.df, this.de, this.dg, a, b, c, d, e, f, g);
        this.an();
    }
    a9() {
        super.a9();
        this.c9.aj = this.df.aj;
        this.da.aj = this.dg.aj;
        this.c8.aj = this.de.aj;
        let a = this.bk();
        this.c9._stroke = a;
        this.c9.ac = this.e.es + 3;
        this.da._stroke = a;
        this.da.ac = this.e.es + 3;
        this.c8._fill = a;
        this.c8._opacity = 1;
    }
    a3(a, b) {
        super.a3(a, b);
        if (a.d) {
            if (b) {
                a.s(this.c8);
                a.s(this.c9);
                a.s(this.da);
            }
            else {
                a.s(this.de);
                a.s(this.df);
                a.s(this.dg);
            }
        }
    }
    ai(a) {
        super.ai(a);
        this.e.a2.exportPathData(a, this.df, "lowerShape", ["Lower", "Main"]);
        this.e.a2.exportPathData(a, this.dg, "upperShape", ["Upper"]);
        this.e.a2.exportPathData(a, this.de, "translucentShape", ["Translucent"]);
    }
}
SplineSeriesView.$t = markType(SplineSeriesView, 'SplineSeriesView', SplineSeriesBaseView.$);
