/*
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 { AnchoredRadialSeries } from "./AnchoredRadialSeries";
import { UnknownValuePlotting_$type } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { Array_$type, Point_$type, 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 { ViewportUtils } from "./ViewportUtils";
import { PropertyMetadata } from "igniteui-angular-core";
import { AnchoredRadialSeriesView } from "./AnchoredRadialSeriesView";
import { Defaults } from "./Defaults";
/**
 * @hidden
 */
export let RadialAreaSeries = /*@__PURE__*/ (() => {
    class RadialAreaSeries extends AnchoredRadialSeries {
        constructor() {
            super();
            this.ab = RadialAreaSeries.$;
        }
        get_dd() {
            return true;
        }
        bx() {
            return new RadialAreaSeriesView(this);
        }
        ly(a) {
            super.ly(a);
            this.t6 = a;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        kx(a, b) {
            super.kx(a, b);
            this.t6.c1();
        }
        sp(a, b) {
            super.sp(a, b);
            let c = b.bv;
            let d = b.bu;
            let e = b;
            if (b.o() && !c.isEmpty && !d.isEmpty && this.rk != null && this.rr != null) {
                let f = a.f;
                let g = f.count;
                let h = new List$1(Array_$type, 2, g);
                let i = 0;
                for (let j = 0; j < g; j++) {
                    let k = new Array(4);
                    h.add(k);
                    k[0] = this.rs.d(a.f._inner[j][0], a.f._inner[j][1], c, d);
                    k[1] = this.rs.e(a.f._inner[j][0], a.f._inner[j][1], c, d);
                    k[2] = this.rs.d(a.f._inner[j][0], a.f._inner[j][2], c, d);
                    let l = a.f._inner[j][2];
                    k[3] = this.rs.e(a.f._inner[j][0], l, c, d);
                    if (l > i) {
                        i = l;
                    }
                }
                let m = ViewportUtils.c(0.5, c, d);
                let n = ViewportUtils.f(0.5, c, d);
                this.t5 = { $type: Point_$type, x: m, y: n };
                let o = this.getEffectiveViewport1(e);
                this.ry.a0(this, this.sa(), runOn(this, this.rh), this.sc(b), this.sd(b));
                let p = false;
                let q = this.ry.b;
                if (q != null) {
                    p = true;
                }
                if (p) {
                    let r = new ScalerParams(0, b.bv, b.bu, this.rk.cg, o);
                    this.to(f, -1, this.s3.count, this.rk, r, b.q);
                }
                let s = e.c9;
                let t = e.da;
                let u = e.c7;
                let v = e.c8;
                this.ry.ad(s, true, false, true, true);
                this.ry.ad(t, true, false, true, true);
                this.ry.ad(u, false, true, false, false);
                this.ry.ad(v, false, true, false, false);
                e.c2(a.f.count, h, false, this.t6.cs.b, this.ft, runOn(this, this.tp), this.t7);
                u._opacity = this.ry.j * this.fq;
                v._opacity = 0.5 * this.ry.j * this.fq;
            }
        }
        l3(a, b, c, d) {
            super.l3(a, b, c, d);
            switch (b) {
                case RadialAreaSeries.$$p[0]:
                    this.mh(false);
                    this.lo();
                    break;
            }
        }
        get_s6() {
            return true;
        }
    }
    RadialAreaSeries.$t = markType(RadialAreaSeries, 'RadialAreaSeries', AnchoredRadialSeries.$);
    RadialAreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, RadialAreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting:t7:t9', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return RadialAreaSeries;
})();
/**
 * @hidden
 */
export let RadialAreaSeriesView = /*@__PURE__*/ (() => {
    class RadialAreaSeriesView extends AnchoredRadialSeriesView {
        constructor(a) {
            super(a);
            this.c0 = null;
            this.c7 = new Path();
            this.c9 = new Path();
            this.c8 = new Path();
            this.da = new Path();
            this.c3 = new Path();
            this.c5 = new Path();
            this.c4 = new Path();
            this.c6 = new Path();
            this.c0 = a;
        }
        as() {
            super.as();
            if (!this.q) {
                this.c0.qc = Defaults.e;
            }
        }
        c1() {
            this.c7.ak = null;
            this.c9.ak = null;
            this.c8.ak = null;
            this.da.ak = null;
            this.c3.ak = null;
            this.c5.ak = null;
            this.c4.ak = null;
            this.c6.ak = null;
            this.aq();
        }
        c2(a, b, c, d, e, f, g) {
            this.cw.sy.i(this.c7, this.c9, this.c8, this.da, a, b, c, d, e, f, g);
            this.aq();
        }
        bb() {
            super.bb();
        }
        bc() {
            super.bc();
            let a = this.bo();
            this.c5.ak = this.c9.ak;
            this.c6.ak = this.da.ak;
            this.c3.ak = this.c7.ak;
            this.c4.ak = this.c8.ak;
            this.c5._stroke = a;
            this.c5.ac = this.e.fu + 3;
            this.c6._stroke = a;
            this.c6.ac = this.e.fu + 3;
            this.c3._fill = a;
            this.c3._opacity = 1;
            this.c4._fill = a;
            this.c4._opacity = 1;
        }
        a6(a, b) {
            super.a6(a, b);
            if (a.d) {
                if (b) {
                    a.s(this.c3);
                    a.s(this.c4);
                    a.s(this.c5);
                    a.s(this.c6);
                }
                else {
                    a.s(this.c7);
                    a.s(this.c8);
                    a.s(this.c9);
                    a.s(this.da);
                }
            }
        }
        al(a) {
            super.al(a);
            this.e.a8.exportPathData(a, this.c9, "lowerShape", ["Lower"]);
            this.e.a8.exportPathData(a, this.da, "upperShape", ["Upper", "Main"]);
            this.e.a8.exportPathData(a, this.c8, "translucentShape", ["Translucent"]);
            this.e.a8.exportPathData(a, this.c7, "fillShape", ["Fill"]);
        }
    }
    RadialAreaSeriesView.$t = markType(RadialAreaSeriesView, 'RadialAreaSeriesView', AnchoredRadialSeriesView.$);
    return RadialAreaSeriesView;
})();
