/*
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 { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { IUnknownValuePlotting_$type } from "igniteui-react-core/ES2015/IUnknownValuePlotting";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-react-core/ES2015/UnknownValuePlotting";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { Type, typeCast, runOn, enumGetBox, markType } from "igniteui-react-core/ES2015/type";
import { Path } from "igniteui-react-core/ES2015/Path";
import { ScalerParams } from "./ScalerParams";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core/ES2015/Color";
/**
 * @hidden
 */
export class AreaSeries extends HorizontalAnchoredCategorySeries {
    constructor() {
        super();
        this.qb = null;
        this.qb = new CategoryLineRasterizer();
        this.ab = AreaSeries.$;
        this.pu = 0;
    }
    bf() {
        return new AreaSeriesView(this);
    }
    m9() {
        return 1;
    }
    im(a) {
        super.im(a);
        this.qa = a;
    }
    get_ck() {
        return true;
    }
    preferredCategoryMode(a) {
        return this.pu;
    }
    dg(a, b) {
        let c = this.le(this.lh(a), true, false);
        if (this.p1(a, c, b)) {
            return true;
        }
        if (this.df(a, b)) {
            return true;
        }
        if (this.lx(a, b)) {
            return true;
        }
        return false;
    }
    hp(a, b) {
        super.hp(a, b);
        let c = b;
        c.c7();
    }
    oh(a, b) {
        super.oh(a, b);
        let c = b.cn.d;
        let d = typeCast(AreaSeriesView.$, b);
        let e = a.f;
        let f = this.getEffectiveViewport1(d);
        this.m7.x(this, this.ns(), this.pr, runOn(this, this.mt), this.n0(b), this.n1(b));
        let g = false;
        let h = this.m7.c;
        if (h != null) {
            g = true;
        }
        if (g) {
            let i = new ScalerParams(0, b.bs, b.br, this.pr.b8, f);
            this.od(e, -1, this.valueColumn.count, this.pr, i, b.n);
        }
        let j = d.de;
        let k = d.df;
        let l = d.dh;
        let m = d.dj;
        this.m7.ae(j, true, false, true, true);
        this.m7.ae(k, true, false, true, true);
        this.m7.ae(l, false, true, false, false);
        this.m7.ae(m, false, true, false, false);
        if (b.cr(a)) {
            d.c9(e.count, e, true, c, this.er, (n, o, p, q, r) => this.pb(n, a.f.count, b), this.unknownValuePlotting, e.count == 1 ? null : this.oq(e, e.count - 1, b.br, b.bs, true));
            b.cu(a);
        }
        let n = this.fetchYAxis();
        l._opacity = this.m7.i * this.d3;
        m._opacity = 0.5 * this.m7.i * this.d3;
    }
    is(a, b, c, d) {
        super.is(a, b, c, d);
        switch (b) {
            case AreaSeries.$$p[0]:
                this.m4.m = this.unknownValuePlotting == 0;
                this.i6(false);
                this.ic();
                break;
        }
    }
    get useHighMarkerFidelity() {
        return this.nv;
    }
}
AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
Type.dep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::qd', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
/**
 * @hidden
 */
export class AreaSeriesView extends AnchoredCategorySeriesView {
    constructor(a) {
        super(a);
        this.c6 = null;
        this.dg = new Path();
        this.dk = new Path();
        this.di = new Path();
        this.dl = new Path();
        this.da = new Path();
        this.dc = new Path();
        this.db = new Path();
        this.dd = new Path();
        this.c6 = a;
    }
    ap() {
        super.ap();
        if (!this.n) {
            this.e.bj = 1;
        }
    }
    get de() {
        return this.dk;
    }
    get df() {
        return this.dl;
    }
    get dh() {
        return this.dg;
    }
    get dj() {
        return this.di;
    }
    c7() {
        this.dg.aj = null;
        this.di.aj = null;
        this.dk.aj = null;
        this.dl.aj = null;
        this.an();
    }
    c8(a, b, c, d, e, f, g) {
        this.c9(a, b, c, d, e, f, g, null);
    }
    c9(a, b, c, d, e, f, g, h) {
        this.c6.qb.a = typeCast(ISortingAxis_$type, this.cp.fetchXAxis()) !== null ? true : false;
        this.c6.qb.j(this.dg, this.dk, this.di, this.dl, a, b, c, d, e, f, g, h);
        this.an();
    }
    a9() {
        super.a9();
        this.da.aj = this.dg.aj;
        this.dc.aj = this.dk.aj;
        this.db.aj = this.di.aj;
        this.dd.aj = this.dl.aj;
        let a = this.bl();
        this.da._fill = a;
        this.da._opacity = 1;
        this.db._fill = a;
        this.db._opacity = 1;
        this.dc._stroke = a;
        this.dc.ac = this.e.ev + 3;
        this.dd._stroke = a;
        this.dd.ac = this.e.ev + 3;
    }
    a3(a, b) {
        super.a3(a, b);
        if (b) {
            a.s(this.da);
            a.s(this.db);
            a.s(this.dc);
            a.s(this.dd);
        }
        else {
            a.s(this.dg);
            a.s(this.di);
            a.s(this.dk);
            a.s(this.dl);
        }
    }
    ai(a) {
        super.ai(a);
        this.e.a2.exportPathData(a, this.dk, "lowerShape", ["Lower"]);
        this.e.a2.exportPathData(a, this.dl, "upperShape", ["Upper", "Main"]);
        this.e.a2.exportPathData(a, this.di, "translucentShape", ["Translucent"]);
        this.e.a2.exportPathData(a, this.dg, "fillShape", ["Fill"]);
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k3 = a;
        this.e.es = 5;
        this.e.et = 1;
        this.e.eu = -3;
    }
}
AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
