/*
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 { PolarBase } from "./PolarBase";
import { PathRenderer } from "./PathRenderer";
import { DefaultFlattener } from "./DefaultFlattener";
import { PolarBaseView } from "./PolarBaseView";
import { Number_$type, Point_$type, markType } from "igniteui-angular-core";
import { PolarLinePlanner } from "./PolarLinePlanner";
import { List$1 } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
var PolarLineSeriesBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarLineSeriesBase, _super);
    function PolarLineSeriesBase() {
        var _this = _super.call(this) || this;
        _this.acq = null;
        _this.acs = null;
        _this.acr = null;
        _this.acq = new PathRenderer(1, new DefaultFlattener());
        _this.acs = new PathRenderer(0);
        return _this;
    }
    PolarLineSeriesBase.prototype.get_z3 = function () {
        return true;
    };
    PolarLineSeriesBase.prototype.z8 = function () {
        return true;
    };
    PolarLineSeriesBase.prototype.ct = function () {
        return new PolarLineSeriesBaseView(this);
    };
    PolarLineSeriesBase.prototype.q7 = function (a) {
        _super.prototype.q7.call(this, a);
        this.act = a;
    };
    PolarLineSeriesBase.prototype.acu = function () {
        return 1;
    };
    PolarLineSeriesBase.prototype.get_acx = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "acx", {
        get: function () {
            return this.get_acx();
        },
        enumerable: false,
        configurable: true
    });
    PolarLineSeriesBase.prototype.get_acz = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "acz", {
        get: function () {
            return this.get_acz();
        },
        enumerable: false,
        configurable: true
    });
    PolarLineSeriesBase.prototype.abn = function (a, b) {
        var _this = this;
        _super.prototype.abn.call(this, a, b);
        a.n.clear();
        var c = b.ca;
        var d = b.b9;
        var e = b.getEffectiveViewport();
        var f = this.zt != null ? this.zt.count : 0;
        var g = this.zu != null ? this.zu.count : 0;
        var h = Math.min(f, g);
        var i = ((function () {
            var $ret = new PolarLinePlanner();
            $ret.m = function (j) { return _this.y6.a.getScaledAngle1(_this.zt.item(j), _this.y6.e, _this.y6.d); };
            $ret.q = h;
            $ret.n = function (j) { return _this.y4.si(_this.zu.item(j), _this.y6.g, _this.y6.f, _this.y6.i, _this.y6.h); };
            $ret.l = _this.ie;
            $ret.f = _this.z9;
            $ret.b = _this.acu();
            $ret.o = function (j) { return _this.ac0(a, j); };
            $ret.p = function (j) { return _this.ac1(a, j); };
            $ret.ad = d;
            $ret.ac = e;
            $ret.ae = c;
            $ret.d = _this.acz;
            $ret.c = _this.acx;
            return $ret;
        })());
        var j = new List$1(Number_$type, 0);
        for (var k = 0; k < h; k++) {
            if (this.acy(k)) {
                j.add(k);
            }
        }
        if (this.acz && j.count > 0) {
            j.add(j._inner[0]);
        }
        i.x(a.n, j);
    };
    PolarLineSeriesBase.prototype.ac0 = function (a, b) {
        return a.x._inner[b].x;
    };
    PolarLineSeriesBase.prototype.ac1 = function (a, b) {
        return a.x._inner[b].y;
    };
    PolarLineSeriesBase.prototype.acw = function () {
        return !this.acv();
    };
    PolarLineSeriesBase.prototype.acv = function () {
        var a = this.dc.xm;
        return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
    };
    PolarLineSeriesBase.prototype.acy = function (a) {
        return (this.zt.item(a) >= this.y6.a.pr && this.zt.item(a) <= this.y6.a.pq && this.zu.item(a) >= this.y6.b.pr && this.zu.item(a) <= this.y6.b.pq) || (isNaN_(this.zt.item(a)) || isNaN_(this.zu.item(a)));
    };
    PolarLineSeriesBase.prototype.pb = function (a, b) {
        _super.prototype.pb.call(this, a, b);
        this.ac2(b);
    };
    PolarLineSeriesBase.prototype.abr = function (a, b) {
        _super.prototype.abr.call(this, a, b);
        if (this.z9) {
            this.acr = this.acq;
        }
        else {
            this.acr = this.acs;
        }
        this.acr.b = this.acu();
        this.ac2(b);
        this.ac3(a, b);
    };
    PolarLineSeriesBase.$t = markType(PolarLineSeriesBase, 'PolarLineSeriesBase', PolarBase.$);
    return PolarLineSeriesBase;
}(PolarBase));
export { PolarLineSeriesBase };
/**
 * @hidden
 */
var PolarLineSeriesBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarLineSeriesBaseView, _super);
    function PolarLineSeriesBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.dl = null;
        _this.dl = a;
        return _this;
    }
    PolarLineSeriesBaseView.prototype.an = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.f.wb = a;
        this.f.jq = 3;
        this.f.jr = 1;
        this.f.js = 4;
        this.f.hd = false;
    };
    PolarLineSeriesBaseView.$t = markType(PolarLineSeriesBaseView, 'PolarLineSeriesBaseView', PolarBaseView.$);
    return PolarLineSeriesBaseView;
}(PolarBaseView));
export { PolarLineSeriesBaseView };
