/*
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-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
 */
var AreaSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AreaSeries, _super);
    function AreaSeries() {
        var _this = _super.call(this) || this;
        _this.acd = null;
        _this.acd = new CategoryLineRasterizer();
        _this.ab = AreaSeries.$;
        _this.abw = 0;
        return _this;
    }
    AreaSeries.prototype.bi = function () {
        return new AreaSeries();
    };
    AreaSeries.prototype.cq = function () {
        return new AreaSeriesView(this);
    };
    AreaSeries.prototype.yu = function () {
        return 1;
    };
    AreaSeries.prototype.cw = function () {
        if (this.cx == 0) {
            return 2;
        }
        return _super.prototype.cw.call(this);
    };
    AreaSeries.prototype.qw = function (a) {
        _super.prototype.qw.call(this, a);
        this.acc = a;
    };
    AreaSeries.prototype.get_et = function () {
        return true;
    };
    AreaSeries.prototype.get_es = function () {
        return true;
    };
    AreaSeries.prototype.preferredCategoryMode = function (a) {
        return this.abw;
    };
    AreaSeries.prototype.gu = function (a, b) {
        var c = this.v5(this.wa(a), true, false);
        if (this.ab3(a, c, b)) {
            return true;
        }
        if (this.gt(a, b)) {
            return true;
        }
        if (this.w8(a, b)) {
            return true;
        }
        return false;
    };
    AreaSeries.prototype.o2 = function (a, b) {
        _super.prototype.o2.call(this, a, b);
        var c = b;
        c.dg();
    };
    AreaSeries.prototype.z3 = function (a, b) {
        var _this = this;
        _super.prototype.z3.call(this, a, b);
        var c = b.cw.d;
        var d = typeCast(AreaSeriesView.$, b);
        var e = a.f;
        var f = this.getEffectiveViewport1(d);
        this.ys.a2(this, this.zc(), runOn(this, this.yd), this.zl(b), this.zm(b));
        var g = false;
        var h = this.ys.b;
        if (h != null) {
            g = true;
        }
        if (g) {
            var i = new ScalerParams(0, b.by, b.bx, this.abt.ch, f);
            this.zz(e, -1, this.valueColumn.count, this.abt, i, b.q, -1);
        }
        var j = d.ds;
        var k = d.dt;
        var l = d.du;
        var m = d.dv;
        this.ys.ad(j, true, false, true, true);
        this.ys.ad(k, true, false, true, true);
        this.ys.ad(l, false, true, false, false);
        this.ys.ad(m, false, true, false, false);
        if (b.c0(a)) {
            d.di(e.count, e, true, c, this.ib, function (n, o, p, q, r) { return _this.aa9(n, a.f.count, b); }, this.unknownValuePlotting, e.count == 1 ? null : this.aac(e, e.count - 1, b.bx, b.by, true));
            b.c3(a);
        }
        var n = this.fetchYAxis();
        l._opacity = this.ys.j * this.h7;
        m._opacity = 0.5 * this.ys.j * this.h7;
    };
    AreaSeries.prototype.q4 = function (a, b, c, d) {
        _super.prototype.q4.call(this, a, b, c, d);
        switch (b) {
            case AreaSeries.$$p[0]:
                this.yp.m = this.unknownValuePlotting == 0;
                this.rm(false);
                this.qg();
                break;
        }
    };
    Object.defineProperty(AreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.zg;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::acf', [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.w1 = 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.acd.a = typeCast(ISortingAxis_$type, this.cy.fetchXAxis()) !== null ? true : false;
        this.df.acd.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.ic + 3;
        this.dm._stroke = a;
        this.dm.ad = this.e.ic + 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.bb.exportPathData(a, this.dq, "lowerShape", ["Lower"]);
        this.e.bb.exportPathData(a, this.dr, "upperShape", ["Upper", "Main"]);
        this.e.bb.exportPathData(a, this.dp, "translucentShape", ["Translucent"]);
        this.e.bb.exportPathData(a, this.dn, "fillShape", ["Fill"]);
    };
    AreaSeriesView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.vu = a;
        this.e.jk = 5;
        this.e.jl = 1;
        this.e.jm = -3;
    };
    AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
}(AnchoredCategorySeriesView));
export { AreaSeriesView };
