/*
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";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { SplineSeriesBaseView } from "./SplineSeriesBaseView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
/**
 * @hidden
 */
export let SplineSeries = /*@__PURE__*/ (() => {
    class SplineSeries extends SplineSeriesBase {
        bi() {
            return new SplineSeries();
        }
        get_fy() {
            return true;
        }
        cq() {
            return new SplineSeriesView(this);
        }
        ze() {
            return true;
        }
        qw(a) {
            super.qw(a);
            this.acx = a;
        }
        constructor() {
            super();
            this.acw = null;
            this.acw = new CategoryLineRasterizer();
            this.ab = SplineSeries.$;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        o2(a, b) {
            super.o2(a, b);
            let c = b;
            c.di();
        }
        z3(a, b) {
            super.z3(a, b);
            let c = b;
            let d = c.cw.d;
            let e = typeCast(SplineSeriesView.$, b);
            let f = a.f;
            let g = this.getEffectiveViewport1(b);
            this.ys.a2(this, this.zc(), runOn(this, this.yd), this.zl(b), this.zm(b));
            let h = false;
            let i = this.ys.b;
            if (i != null) {
                h = true;
            }
            if (h) {
                let j = new ScalerParams(0, b.by, b.bx, this.abt.ch, g);
                this.zz(f, -1, this.valueColumn.count, this.abt, j, b.q, -1);
            }
            let k = e.dp;
            let l = e.dq;
            let m = e.dn;
            this.ys.ad(k, true, false, true, false);
            this.ys.ad(l, true, false, true, false);
            this.ys.ad(m, false, true, false, false);
            m._opacity = 0.75 * this.ys.j;
            if (b.c0(a)) {
                e.dj(f.count, f, true, 1, this.aab(f, f.count - 1, b.bx, b.by), d, this.ib);
                b.c3(a);
            }
        }
        get useHighMarkerFidelity() {
            return this.zg;
        }
    }
    SplineSeries.$t = /*@__PURE__*/ markType(SplineSeries, 'SplineSeries', SplineSeriesBase.$);
    return SplineSeries;
})();
/**
 * @hidden
 */
export let SplineSeriesView = /*@__PURE__*/ (() => {
    class SplineSeriesView extends SplineSeriesBaseView {
        constructor(a) {
            super(a);
            this.dh = null;
            this.ds = new Path();
            this.dr = new Path();
            this.dt = new Path();
            this.dm = new Path();
            this.dl = new Path();
            this.dk = new Path();
            this.dh = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.dh.w1 = Defaults.e;
            }
        }
        get dp() {
            return this.ds;
        }
        get dq() {
            return this.dt;
        }
        get dn() {
            return this.dr;
        }
        di() {
            this.dr.an = null;
            this.ds.an = null;
            this.dt.an = null;
            this.as();
        }
        dj(a, b, c, d, e, f, g) {
            this.dh.acw.a = typeCast(ISortingAxis_$type, this.cy.fetchXAxis()) !== null ? true : false;
            this.dh.acw.m(this.ds, this.dr, this.dt, a, b, c, d, e, f, g);
            this.as();
        }
        be() {
            super.be();
            this.dl.an = this.ds.an;
            this.dm.an = this.dt.an;
            this.dk.an = this.dr.an;
            let a = this.br();
            this.dl._stroke = a;
            this.dl.ad = this.e.ic + 3;
            this.dm._stroke = a;
            this.dm.ad = this.e.ic + 3;
            this.dk._fill = a;
            this.dk._opacity = 1;
        }
        a8(a, b) {
            super.a8(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.dk);
                    a.t(this.dl);
                    a.t(this.dm);
                }
                else {
                    a.t(this.dr);
                    a.t(this.ds);
                    a.t(this.dt);
                }
            }
        }
        an(a) {
            super.an(a);
            this.e.bb.exportPathData(a, this.ds, "lowerShape", ["Lower", "Main"]);
            this.e.bb.exportPathData(a, this.dt, "upperShape", ["Upper"]);
            this.e.bb.exportPathData(a, this.dr, "translucentShape", ["Translucent"]);
        }
    }
    SplineSeriesView.$t = /*@__PURE__*/ markType(SplineSeriesView, 'SplineSeriesView', SplineSeriesBaseView.$);
    return SplineSeriesView;
})();
