/*
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-angular-core";
import { Path } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { SplineSeriesBaseView } from "./SplineSeriesBaseView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
export let SplineAreaSeries = /*@__PURE__*/ (() => {
    class SplineAreaSeries extends SplineSeriesBase {
        constructor() {
            super();
            this.v3 = null;
            this.v3 = new CategoryLineRasterizer();
            this.ab = SplineAreaSeries.$;
        }
        get_df() {
            return true;
        }
        get_ej() {
            return true;
        }
        by() {
            return new SplineAreaSeriesView(this);
        }
        r7() {
            return 1;
        }
        l4(a) {
            super.l4(a);
            this.v4 = a;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        b4() {
            if (this.b5 == 0) {
                return 2;
            }
            return super.b4();
        }
        k2(a, b) {
            super.k2(a, b);
            let c = b;
            c.dd();
        }
        ez(a, b) {
            let c = this.ps(this.px(a), true, false);
            if (this.va(a, c, b)) {
                return true;
            }
            if (this.ey(a, b)) {
                return true;
            }
            if (this.qo(a, b)) {
                return true;
            }
            return false;
        }
        tf(a, b) {
            super.tf(a, b);
            let c = this.r6.cr.d;
            let d = typeCast(SplineAreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(b);
            this.r5.a2(this, this.sp(), runOn(this, this.rq), this.sx(b), this.sy(b));
            let g = false;
            let h = this.r5.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.bv, b.bu, this.u0.cg, f);
                this.tb(e, -1, this.valueColumn.count, this.u0, i, b.q);
            }
            let j = d.dp;
            let k = d.dq;
            let l = d.dr;
            let m = d.ds;
            this.r5.ad(j, true, false, true, true);
            this.r5.ad(k, true, false, true, true);
            this.r5.ad(l, false, true, false, false);
            this.r5.ad(m, false, true, false, false);
            l._opacity = this.r5.j * this.fu;
            m._opacity = 0.5 * this.r5.j * this.fu;
            if (b.cv(a)) {
                d.df(a.f.count, e, true, c, this.fx, (n, o, p, q, r) => this.uh(n, a.f.count, b), 1, a.f.count == 1 ? null : this.to(e, e.count - 1, b.bu, b.bv, true));
                b.cy(a);
            }
            let n = this.fetchYAxis();
        }
        get useHighMarkerFidelity() {
            return this.ss;
        }
    }
    SplineAreaSeries.$t = markType(SplineAreaSeries, 'SplineAreaSeries', SplineSeriesBase.$);
    return SplineAreaSeries;
})();
/**
 * @hidden
 */
export let SplineAreaSeriesView = /*@__PURE__*/ (() => {
    class SplineAreaSeriesView extends SplineSeriesBaseView {
        constructor(a) {
            super(a);
            this.dc = null;
            this.dk = new Path();
            this.dm = new Path();
            this.dl = new Path();
            this.dn = new Path();
            this.dg = new Path();
            this.di = new Path();
            this.dh = new Path();
            this.dj = new Path();
            this.dc = a;
        }
        as() {
            super.as();
            if (!this.q) {
                this.dc.ql = Defaults.e;
            }
        }
        get dp() {
            return this.dm;
        }
        get dq() {
            return this.dn;
        }
        get dr() {
            return this.dk;
        }
        get ds() {
            return this.dl;
        }
        dd() {
            this.dk.an = null;
            this.dl.an = null;
            this.dm.an = null;
            this.dn.an = null;
            this.aq();
        }
        de(a, b, c, d, e, f, g) {
            this.df(a, b, c, d, e, f, g, null);
        }
        df(a, b, c, d, e, f, g, h) {
            this.dc.v3.a = typeCast(ISortingAxis_$type, this.ct.fetchXAxis()) !== null ? true : false;
            this.dc.v3.j(this.dk, this.dm, this.dl, this.dn, a, b, c, d, e, f, g, h);
            this.aq();
        }
        bc() {
            super.bc();
            this.dg.an = this.dk.an;
            this.di.an = this.dm.an;
            this.dh.an = this.dl.an;
            this.dj.an = this.dn.an;
            let a = this.bo();
            this.dg._fill = a;
            this.dg._opacity = 1;
            this.dh._fill = a;
            this.dh._opacity = 1;
            this.di._stroke = a;
            this.di.ad = this.e.fy + 3;
            this.dj._stroke = a;
            this.dj.ad = this.e.fy + 3;
        }
        a6(a, b) {
            super.a6(a, b);
            if (b) {
                a.t(this.dg);
                a.t(this.dh);
                a.t(this.di);
                a.t(this.dj);
            }
            else {
                a.t(this.dk);
                a.t(this.dl);
                a.t(this.dm);
                a.t(this.dn);
            }
        }
        al(a) {
            super.al(a);
            this.e.a9.exportPathData(a, this.dm, "lowerShape", ["Lower"]);
            this.e.a9.exportPathData(a, this.dn, "upperShape", ["Upper", "Main"]);
            this.e.a9.exportPathData(a, this.dl, "translucentShape", ["Translucent"]);
            this.e.a9.exportPathData(a, this.dk, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.ph = a;
            this.e.g1 = 5;
            this.e.g2 = 1;
            this.e.g3 = -3;
        }
    }
    SplineAreaSeriesView.$t = markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
    return SplineAreaSeriesView;
})();
