/*
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";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { typeCast, runOn, enumGetBox, markType, markDep } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { PropertyMetadata } from "igniteui-react-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
export let AreaSeries = /*@__PURE__*/ (() => {
    class AreaSeries extends HorizontalAnchoredCategorySeries {
        bc() {
            return new AreaSeries();
        }
        cd() {
            return new AreaSeriesView(this);
        }
        vy() {
            return 1;
        }
        cj() {
            if (this.ck == 0) {
                return 2;
            }
            return super.cj();
        }
        o2(a) {
            super.o2(a);
            this.zg = a;
        }
        get_ea() {
            return true;
        }
        get_d9() {
            return true;
        }
        constructor() {
            super();
            this.zh = null;
            this.zh = new CategoryLineRasterizer();
            this.ab = AreaSeries.$;
            this.y0 = 0;
        }
        preferredCategoryMode(a) {
            return this.y0;
        }
        f5(a, b) {
            let c = this.tj(this.to(a), true, false);
            if (this.y7(a, c, b)) {
                return true;
            }
            if (this.f4(a, b)) {
                return true;
            }
            if (this.uf(a, b)) {
                return true;
            }
            return false;
        }
        nk(a, b) {
            super.nk(a, b);
            let c = b;
            c.de();
        }
        w7(a, b) {
            super.w7(a, b);
            let c = b.cu.d;
            let d = typeCast(AreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(d);
            this.vw.a2(this, this.wg(), runOn(this, this.vh), this.wp(b), this.wq(b));
            let g = false;
            let h = this.vw.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.by, b.bx, this.yx.ch, f);
                this.w3(e, -1, this.valueColumn.count, this.yx, i, b.q);
            }
            let j = d.dq;
            let k = d.dr;
            let l = d.ds;
            let m = d.dt;
            this.vw.ad(j, true, false, true, true);
            this.vw.ad(k, true, false, true, true);
            this.vw.ad(l, false, true, false, false);
            this.vw.ad(m, false, true, false, false);
            if (b.cy(a)) {
                d.dg(e.count, e, true, c, this.hk, (n, o, p, q, r) => this.yd(n, a.f.count, b), this.unknownValuePlotting, e.count == 1 ? null : this.xg(e, e.count - 1, b.bx, b.by, true));
                b.c1(a);
            }
            let n = this.fetchYAxis();
            l._opacity = this.vw.j * this.hg;
            m._opacity = 0.5 * this.vw.j * this.hg;
        }
        pa(a, b, c, d) {
            super.pa(a, b, c, d);
            switch (b) {
                case AreaSeries.$$p[0]:
                    this.vt.m = this.unknownValuePlotting == 0;
                    this.pr(false);
                    this.om();
                    break;
            }
        }
        get useHighMarkerFidelity() {
            return this.wk;
        }
    }
    AreaSeries.$t = /*@__PURE__*/ markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::zj', [UnknownValuePlotting_$type, /*@__PURE__*/ enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return AreaSeries;
})();
/**
 * @hidden
 */
export let AreaSeriesView = /*@__PURE__*/ (() => {
    class AreaSeriesView extends AnchoredCategorySeriesView {
        constructor(a) {
            super(a);
            this.dd = null;
            this.dl = new Path();
            this.dn = new Path();
            this.dm = new Path();
            this.dp = new Path();
            this.dh = new Path();
            this.dj = new Path();
            this.di = new Path();
            this.dk = new Path();
            this.dd = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.dd.uc = Defaults.e;
            }
        }
        get dq() {
            return this.dn;
        }
        get dr() {
            return this.dp;
        }
        get ds() {
            return this.dl;
        }
        get dt() {
            return this.dm;
        }
        de() {
            this.dl.an = null;
            this.dm.an = null;
            this.dn.an = null;
            this.dp.an = null;
            this.as();
        }
        df(a, b, c, d, e, f, g) {
            this.dg(a, b, c, d, e, f, g, null);
        }
        dg(a, b, c, d, e, f, g, h) {
            this.dd.zh.a = typeCast(ISortingAxis_$type, this.cw.fetchXAxis()) !== null ? true : false;
            this.dd.zh.j(this.dl, this.dn, this.dm, this.dp, a, b, c, d, e, f, g, h);
            this.as();
        }
        be() {
            super.be();
            this.dh.an = this.dl.an;
            this.dj.an = this.dn.an;
            this.di.an = this.dm.an;
            this.dk.an = this.dp.an;
            let a = this.br();
            this.dh._fill = a;
            this.dh._opacity = 1;
            this.di._fill = a;
            this.di._opacity = 1;
            this.dj._stroke = a;
            this.dj.ad = this.e.hl + 3;
            this.dk._stroke = a;
            this.dk.ad = this.e.hl + 3;
        }
        a8(a, b) {
            super.a8(a, b);
            if (b) {
                a.t(this.dh);
                a.t(this.di);
                a.t(this.dj);
                a.t(this.dk);
            }
            else {
                a.t(this.dl);
                a.t(this.dm);
                a.t(this.dn);
                a.t(this.dp);
            }
        }
        an(a) {
            super.an(a);
            this.e.a5.exportPathData(a, this.dn, "lowerShape", ["Lower"]);
            this.e.a5.exportPathData(a, this.dp, "upperShape", ["Upper", "Main"]);
            this.e.a5.exportPathData(a, this.dm, "translucentShape", ["Translucent"]);
            this.e.a5.exportPathData(a, this.dl, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.s8 = a;
            this.e.is = 5;
            this.e.it = 1;
            this.e.iu = -3;
        }
    }
    AreaSeriesView.$t = /*@__PURE__*/ markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
})();
