/*
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.ads = null;
            this.ads = new CategoryLineRasterizer();
            this.ab = SplineAreaSeries.$;
        }
        bk() {
            return new SplineAreaSeries();
        }
        get_ew() {
            return true;
        }
        get_f1() {
            return true;
        }
        ct() {
            return new SplineAreaSeriesView(this);
        }
        ze() {
            return 1;
        }
        q7(a) {
            super.q7(a);
            this.adt = a;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        cz() {
            if (this.c0 == 0) {
                return 2;
            }
            return super.cz();
        }
        pb(a, b) {
            super.pb(a, b);
            let c = b;
            c.dw();
        }
        gx(a, b) {
            let c = this.wm(this.wr(a), true, false);
            if (this.acz(a, c, b)) {
                return true;
            }
            if (this.gw(a, b)) {
                return true;
            }
            if (this.xr(a, b)) {
                return true;
            }
            return false;
        }
        aax(a, b) {
            super.aax(a, b);
            let c = this.zd.c9.d;
            let d = typeCast(SplineAreaSeriesView.$, b);
            let e = a.h;
            let f = this.getEffectiveViewport1(b);
            this.zc.a2(this, this.zw(), runOn(this, this.yw), this.z5(b), this.z6(b));
            let g = false;
            let h = this.zc.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.ca, b.b9, this.acp.df, f);
                this.aat(e, -1, this.valueColumn.count, this.acp, i, b.t, -1);
            }
            let j = d.d7;
            let k = d.d8;
            let l = d.d9;
            let m = d.ea;
            this.zc.ad(j, true, false, true, true);
            this.zc.ad(k, true, false, true, true);
            this.zc.ad(l, false, true, false, false);
            this.zc.ad(m, false, true, false, false);
            l._opacity = this.zc.j * this.ia;
            m._opacity = 0.5 * this.zc.j * this.ia;
            if (b.dd(a)) {
                d.dy(a.h.count, e, true, c, this.ie, (n, o, p, q, r) => this.ab5(n, a.h.count, b), 1, a.h.count == 1 ? null : this.aa6(e, e.count - 1, b.b9, b.ca, true));
                b.dg(a);
            }
            let n = this.fetchYAxis();
        }
        get useHighMarkerFidelity() {
            return this.z0;
        }
    }
    SplineAreaSeries.$t = markType(SplineAreaSeries, 'SplineAreaSeries', SplineSeriesBase.$);
    return SplineAreaSeries;
})();
/**
 * @hidden
 */
export let SplineAreaSeriesView = /*@__PURE__*/ (() => {
    class SplineAreaSeriesView extends SplineSeriesBaseView {
        constructor(a) {
            super(a);
            this.dv = null;
            this.d3 = new Path();
            this.d5 = new Path();
            this.d4 = new Path();
            this.d6 = new Path();
            this.dz = new Path();
            this.d1 = new Path();
            this.d0 = new Path();
            this.d2 = new Path();
            this.dv = a;
        }
        a4() {
            super.a4();
            if (!this.t) {
                this.dv.xk = Defaults.e;
            }
        }
        get d7() {
            return this.d5;
        }
        get d8() {
            return this.d6;
        }
        get d9() {
            return this.d3;
        }
        get ea() {
            return this.d4;
        }
        dw() {
            this.d3.an = null;
            this.d4.an = null;
            this.d5.an = null;
            this.d6.an = null;
            this.a2();
        }
        dx(a, b, c, d, e, f, g) {
            this.dy(a, b, c, d, e, f, g, null);
        }
        dy(a, b, c, d, e, f, g, h) {
            this.dv.ads.a = typeCast(ISortingAxis_$type, this.db.fetchXAxis()) !== null ? true : false;
            this.dv.ads.j(this.d3, this.d5, this.d4, this.d6, a, b, c, d, e, f, g, h);
            this.a2();
        }
        bq() {
            super.bq();
            this.dz.an = this.d3.an;
            this.d1.an = this.d5.an;
            this.d0.an = this.d4.an;
            this.d2.an = this.d6.an;
            let a = this.b3();
            this.dz._fill = a;
            this.dz._opacity = 1;
            this.d0._fill = a;
            this.d0._opacity = 1;
            this.d1._stroke = a;
            this.d1.ad = this.f.ig + 3;
            this.d2._stroke = a;
            this.d2.ad = this.f.ig + 3;
        }
        bj(a, b) {
            super.bj(a, b);
            if (b) {
                a.t(this.dz);
                a.t(this.d0);
                a.t(this.d1);
                a.t(this.d2);
            }
            else {
                a.t(this.d3);
                a.t(this.d4);
                a.t(this.d5);
                a.t(this.d6);
            }
        }
        ax(a) {
            super.ax(a);
            this.f.bc.exportPathData(a, this.d5, "lowerShape", ["Lower"]);
            this.f.bc.exportPathData(a, this.d6, "upperShape", ["Upper", "Main"]);
            this.f.bc.exportPathData(a, this.d4, "translucentShape", ["Translucent"]);
            this.f.bc.exportPathData(a, this.d3, "fillShape", ["Fill"]);
        }
        an() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.f.wb = a;
            this.f.jq = 5;
            this.f.jr = 1;
            this.f.js = -3;
        }
    }
    SplineAreaSeriesView.$t = markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
    return SplineAreaSeriesView;
})();
