/*
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 { HorizontalRangeCategorySeries } from "./HorizontalRangeCategorySeries";
import { Array_$type, typeCast, runOn, markType } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Polyline } from "igniteui-angular-core";
import { Polygon } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ChartSelection } from "./ChartSelection";
import { isNaN_ } from "igniteui-angular-core";
import { RangeCategorySeriesView } from "./RangeCategorySeriesView";
/**
 * @hidden
 */
var RangeAreaSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RangeAreaSeries, _super);
    function RangeAreaSeries() {
        var _this = _super.call(this) || this;
        _this.ab = RangeAreaSeries.$;
        return _this;
    }
    RangeAreaSeries.prototype.bk = function () {
        return new RangeAreaSeries();
    };
    RangeAreaSeries.prototype.ct = function () {
        return new RangeAreaSeriesView(this);
    };
    RangeAreaSeries.prototype.q7 = function (a) {
        _super.prototype.q7.call(this, a);
        this.acc = a;
    };
    RangeAreaSeries.prototype.get_ex = function () {
        return true;
    };
    RangeAreaSeries.prototype.get_ew = function () {
        return true;
    };
    RangeAreaSeries.prototype.acd = function (a, b, c, d) {
        if (isNaN_(b.x) || isNaN_(b.y)) {
            return false;
        }
        if (isNaN_(c.x) || isNaN_(c.y)) {
            return false;
        }
        if ((a.y <= b.y && a.y >= c.y)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.gx = function (a, b) {
        if (this.gw(a, b)) {
            return true;
        }
        if (this.xr(a, b)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.preferredCategoryMode = function (a) {
        return 0;
    };
    RangeAreaSeries.prototype.pb = function (a, b) {
        _super.prototype.pb.call(this, a, b);
        var c = b;
        c.dl();
    };
    RangeAreaSeries.prototype.aax = function (a, b) {
        _super.prototype.aax.call(this, a, b);
        var c = a.h.count;
        var d = new List$1(Array_$type, 2, c);
        for (var e = 0; e < c; e++) {
            var f = a.h._inner[e];
            var g = new Array(4);
            g[0] = f[0];
            g[1] = f[1];
            var h = a.h._inner[a.h.count - 1 - e];
            g[2] = h[0];
            g[3] = h[2];
            d.add(g);
        }
        var i = typeCast(RangeAreaSeriesView.$, b);
        var j = this.getEffectiveViewport1(i);
        this.zc.a2(this, this.zw(), runOn(this, this.yw), this.z5(b), this.z6(b));
        var k = false;
        var l = this.zc.b;
        if (l != null) {
            k = true;
        }
        if (k) {
            var m = new ScalerParams(0, b.ca, b.b9, this.xAxis.df, j);
            this.aat(d, -1, this.lowColumn.count, this.xAxis, m, b.t, -1);
        }
        var n = i.dv;
        var o = i.dw;
        var p = i.dq;
        this.zc.ad(n, true, false, true, true);
        this.zc.ad(o, true, false, true, true);
        this.zc.ad(p, false, true, false, false);
        if (b.dd(a)) {
            i.dm(a.h.count, d, false);
            b.dg(a);
        }
        i.dq._opacity = this.zc.j * this.ia;
    };
    RangeAreaSeries.prototype.qa = function (a, b, c) {
        this.aap(a, b, c, this.y3, 1);
    };
    RangeAreaSeries.prototype.ak = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        this.qa(a, c, b);
        return c.toArray();
    };
    Object.defineProperty(RangeAreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.z0;
        },
        enumerable: false,
        configurable: true
    });
    RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
}(HorizontalRangeCategorySeries));
export { RangeAreaSeries };
/**
 * @hidden
 */
var RangeAreaSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RangeAreaSeriesView, _super);
    function RangeAreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.dk = null;
        _this.dt = new Polyline();
        _this.dp = new Polygon();
        _this.du = new Polyline();
        _this.ds = new Polyline();
        _this.dr = new Polyline();
        _this.dn = new Polygon();
        _this.dk = a;
        return _this;
    }
    RangeAreaSeriesView.prototype.a4 = function () {
        _super.prototype.a4.call(this);
        if (!this.t) {
            this.dk.xk = 1;
        }
    };
    Object.defineProperty(RangeAreaSeriesView.prototype, "dv", {
        get: function () {
            return this.dt;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "dq", {
        get: function () {
            return this.dp;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "dw", {
        get: function () {
            return this.du;
        },
        enumerable: false,
        configurable: true
    });
    RangeAreaSeriesView.prototype.dl = function () {
        this.dp.an.clear();
        this.dt.an.clear();
        this.du.an.clear();
    };
    RangeAreaSeriesView.prototype.dm = function (a, b, c) {
        this.dj(this.dt, this.dp, this.du, a, b, c);
        this.a2();
    };
    RangeAreaSeriesView.prototype.bq = function () {
        _super.prototype.bq.call(this);
        this.dr.an = this.dt.an;
        this.ds.an = this.du.an;
        this.dn.an = this.dp.an;
        var a = this.b3();
        this.dr._stroke = a;
        this.dr.ad = this.f.ig + 3;
        this.ds._stroke = a;
        this.ds.ad = this.f.ig + 3;
        this.dn._fill = a;
        this.dn._opacity = 1;
    };
    RangeAreaSeriesView.prototype.bj = function (a, b) {
        _super.prototype.bj.call(this, a, b);
        if (a.d) {
            if (b) {
                a.u(this.dn);
                a.v(this.dr);
                a.v(this.ds);
            }
            else {
                a.u(this.dp);
                a.v(this.dt);
                a.v(this.du);
            }
        }
    };
    RangeAreaSeriesView.prototype.ax = function (a) {
        _super.prototype.ax.call(this, a);
        this.f.bc.exportPolylineData(a, this.dt, "lowerShape", ["Lower"]);
        this.f.bc.exportPolylineData(a, this.du, "upperShape", ["Upper", "Main"]);
        this.f.bc.exportPolygonData(a, this.dp, "fillShape", ["Fill"]);
    };
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
}(RangeCategorySeriesView));
export { RangeAreaSeriesView };
