/*
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 { __extends } from "tslib";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { IUnknownValuePlotting_$type } from "igniteui-angular-core";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { typeCast, runOn, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ChartSelection } from "./ChartSelection";
import { PropertyMetadata } from "igniteui-angular-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
var AreaSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AreaSeries, _super);
    function AreaSeries() {
        var _this = _super.call(this) || this;
        _this.acv = null;
        _this.acv = new CategoryLineRasterizer();
        _this.ab = AreaSeries.$;
        _this.ace = 0;
        return _this;
    }
    AreaSeries.prototype.bj = function () {
        return new AreaSeries();
    };
    AreaSeries.prototype.cs = function () {
        return new AreaSeriesView(this);
    };
    AreaSeries.prototype.y2 = function () {
        return 1;
    };
    AreaSeries.prototype.cy = function () {
        if (this.cz == 0) {
            return 2;
        }
        return _super.prototype.cy.call(this);
    };
    AreaSeries.prototype.qz = function (a) {
        _super.prototype.qz.call(this, a);
        this.acu = a;
    };
    AreaSeries.prototype.get_ev = function () {
        return true;
    };
    AreaSeries.prototype.get_eu = function () {
        return true;
    };
    AreaSeries.prototype.preferredCategoryMode = function (a) {
        return this.ace;
    };
    AreaSeries.prototype.gw = function (a, b) {
        var c = this.wa(this.wf(a), true, false);
        if (this.acl(a, c, b)) {
            return true;
        }
        if (this.gv(a, b)) {
            return true;
        }
        if (this.xf(a, b)) {
            return true;
        }
        return false;
    };
    AreaSeries.prototype.o5 = function (a, b) {
        _super.prototype.o5.call(this, a, b);
        var c = b;
        c.dg();
    };
    AreaSeries.prototype.aai = function (a, b) {
        var _this = this;
        _super.prototype.aai.call(this, a, b);
        var c = b.cw.d;
        var d = typeCast(AreaSeriesView.$, b);
        var e = a.f;
        var f = this.getEffectiveViewport1(d);
        this.y0.a2(this, this.zk(), runOn(this, this.yk), this.zt(b), this.zu(b));
        var g = false;
        var h = this.y0.b;
        if (h != null) {
            g = true;
        }
        if (g) {
            var i = new ScalerParams(0, b.by, b.bx, this.acb.ch, f);
            this.aae(e, -1, this.valueColumn.count, this.acb, i, b.q, -1);
        }
        var j = d.ds;
        var k = d.dt;
        var l = d.du;
        var m = d.dv;
        this.y0.ad(j, true, false, true, true);
        this.y0.ad(k, true, false, true, true);
        this.y0.ad(l, false, true, false, false);
        this.y0.ad(m, false, true, false, false);
        if (b.c0(a)) {
            d.di(e.count, e, true, c, this.id, function (n, o, p, q, r) { return _this.abr(n, a.f.count, b); }, this.unknownValuePlotting, e.count == 1 ? null : this.aas(e, e.count - 1, b.bx, b.by, true));
            b.c3(a);
        }
        var n = this.fetchYAxis();
        l._opacity = this.y0.j * this.h9;
        m._opacity = 0.5 * this.y0.j * this.h9;
    };
    AreaSeries.prototype.q7 = function (a, b, c, d) {
        _super.prototype.q7.call(this, a, b, c, d);
        switch (b) {
            case AreaSeries.$$p[0]:
                this.yx.m = this.unknownValuePlotting == 0;
                this.rp(false);
                this.qj();
                break;
        }
    };
    AreaSeries.prototype.ak = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        this.p2(a, c, b);
        return c.toArray();
    };
    AreaSeries.prototype.p2 = function (a, b, c) {
        this.aaa(a, b, c, this.yr, 0);
    };
    Object.defineProperty(AreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.zo;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::acx', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return AreaSeries;
}(HorizontalAnchoredCategorySeries));
export { AreaSeries };
/**
 * @hidden
 */
var AreaSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AreaSeriesView, _super);
    function AreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.df = null;
        _this.dn = new Path();
        _this.dq = new Path();
        _this.dp = new Path();
        _this.dr = new Path();
        _this.dj = new Path();
        _this.dl = new Path();
        _this.dk = new Path();
        _this.dm = new Path();
        _this.df = a;
        return _this;
    }
    AreaSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        if (!this.q) {
            this.df.w8 = Defaults.e;
        }
    };
    Object.defineProperty(AreaSeriesView.prototype, "ds", {
        get: function () {
            return this.dq;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dt", {
        get: function () {
            return this.dr;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "du", {
        get: function () {
            return this.dn;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dv", {
        get: function () {
            return this.dp;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeriesView.prototype.dg = function () {
        this.dn.an = null;
        this.dp.an = null;
        this.dq.an = null;
        this.dr.an = null;
        this.as();
    };
    AreaSeriesView.prototype.dh = function (a, b, c, d, e, f, g) {
        this.di(a, b, c, d, e, f, g, null);
    };
    AreaSeriesView.prototype.di = function (a, b, c, d, e, f, g, h) {
        this.df.acv.a = typeCast(ISortingAxis_$type, this.cy.fetchXAxis()) !== null ? true : false;
        this.df.acv.j(this.dn, this.dq, this.dp, this.dr, a, b, c, d, e, f, g, h);
        this.as();
    };
    AreaSeriesView.prototype.be = function () {
        _super.prototype.be.call(this);
        this.dj.an = this.dn.an;
        this.dl.an = this.dq.an;
        this.dk.an = this.dp.an;
        this.dm.an = this.dr.an;
        var a = this.br();
        this.dj._fill = a;
        this.dj._opacity = 1;
        this.dk._fill = a;
        this.dk._opacity = 1;
        this.dl._stroke = a;
        this.dl.ad = this.e.ie + 3;
        this.dm._stroke = a;
        this.dm.ad = this.e.ie + 3;
    };
    AreaSeriesView.prototype.a8 = function (a, b) {
        _super.prototype.a8.call(this, a, b);
        if (b) {
            a.t(this.dj);
            a.t(this.dk);
            a.t(this.dl);
            a.t(this.dm);
        }
        else {
            a.t(this.dn);
            a.t(this.dp);
            a.t(this.dq);
            a.t(this.dr);
        }
    };
    AreaSeriesView.prototype.an = function (a) {
        _super.prototype.an.call(this, a);
        this.e.bc.exportPathData(a, this.dq, "lowerShape", ["Lower"]);
        this.e.bc.exportPathData(a, this.dr, "upperShape", ["Upper", "Main"]);
        this.e.bc.exportPathData(a, this.dp, "translucentShape", ["Translucent"]);
        this.e.bc.exportPathData(a, this.dn, "fillShape", ["Fill"]);
    };
    AreaSeriesView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.vz = a;
        this.e.jm = 5;
        this.e.jn = 1;
        this.e.jo = -3;
    };
    AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
}(AnchoredCategorySeriesView));
export { AreaSeriesView };
