/*
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 { PolarBase } from "./PolarBase";
import { PathRenderer } from "./PathRenderer";
import { DefaultFlattener } from "./DefaultFlattener";
import { PolarBaseView } from "./PolarBaseView";
import { Number_$type, Point_$type, markType } from "igniteui-react-core/ES2015/type";
import { PolarLinePlanner } from "./PolarLinePlanner";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { isNaN_ } from "igniteui-react-core/ES2015/number";
import { Color } from "igniteui-react-core/ES2015/Color";
export class PolarLineSeriesBase extends PolarBase {
    constructor() {
        super();
        this.oq = null;
        this.os = null;
        this.or = null;
        this.oq = new PathRenderer(1, new DefaultFlattener());
        this.os = new PathRenderer(0);
    }
    bf() {
        return new PolarLineSeriesBaseView(this);
    }
    il(a) {
        super.il(a);
        this.ot = a;
    }
    ou() {
        return 1;
    }
    get_ox() {
        return false;
    }
    get ox() {
        return this.get_ox();
    }
    get_oz() {
        return false;
    }
    get oz() {
        return this.get_oz();
    }
    n0(a, b) {
        super.n0(a, b);
        a.m.clear();
        let c = b.bs;
        let d = b.br;
        let e = this.m9 != null ? this.m9.count : 0;
        let f = this.na != null ? this.na.count : 0;
        let g = Math.min(e, f);
        let h = ((() => {
            let $ret = new PolarLinePlanner();
            $ret.m = (i) => this.mx.a.getScaledAngle1(this.m9.item(i), this.mx.e, this.mx.d);
            $ret.q = g;
            $ret.n = (i) => this.mv.lj(this.na.item(i), this.mx.g, this.mx.f, this.mx.i, this.mx.h);
            $ret.l = this.eq;
            $ret.f = this.nf;
            $ret.b = this.ou();
            $ret.o = (i) => this.o0(a, i);
            $ret.p = (i) => this.o1(a, i);
            $ret.ab = d;
            $ret.ac = c;
            $ret.d = this.oz;
            $ret.c = this.ox;
            return $ret;
        })());
        let i = new List$1(Number_$type, 0);
        for (let j = 0; j < g; j++) {
            if (this.oy(j)) {
                i.add(j);
            }
        }
        if (this.oz && i.count > 0) {
            i.add(i._inner[0]);
        }
        h.x(a.m, i);
    }
    o0(a, b) {
        return a.w._inner[b].x;
    }
    o1(a, b) {
        return a.w._inner[b].y;
    }
    ow() {
        return !this.ov();
    }
    ov() {
        let a = this.bs.mn;
        return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
    }
    oy(a) {
        return (this.m9.item(a) >= this.mx.a.jx && this.m9.item(a) <= this.mx.a.jw && this.na.item(a) >= this.mx.b.jx && this.na.item(a) <= this.mx.b.jw) || (isNaN_(this.m9.item(a)) || isNaN_(this.na.item(a)));
    }
    ho(a, b) {
        super.ho(a, b);
        this.o2(b);
    }
    n2(a, b) {
        super.n2(a, b);
        if (this.nf) {
            this.or = this.oq;
        }
        else {
            this.or = this.os;
        }
        this.or.b = this.ou();
        this.o2(b);
        this.o3(a, b);
    }
}
PolarLineSeriesBase.$t = markType(PolarLineSeriesBase, 'PolarLineSeriesBase', PolarBase.$);
export class PolarLineSeriesBaseView extends PolarBaseView {
    constructor(a) {
        super(a);
        this.cy = null;
        this.cy = a;
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k1 = a;
        this.e.er = 3;
        this.e.es = 1;
        this.e.et = 4;
        this.e.ds = false;
    }
}
PolarLineSeriesBaseView.$t = markType(PolarLineSeriesBaseView, 'PolarLineSeriesBaseView', PolarBaseView.$);
