/*
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 { PolarLineSeriesBase } from "./PolarLineSeriesBase";
import { DependencyProperty } from "igniteui-react-core";
import { runOn, markType, markDep } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { PolarLineSeriesBaseView } from "./PolarLineSeriesBaseView";
import { PathGeometry } from "igniteui-react-core";
import { Defaults } from "./Defaults";
import { Extensions } from "igniteui-react-core";
import { Numeric } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
export let PolarSplineAreaSeries = /*@__PURE__*/ (() => {
    class PolarSplineAreaSeries extends PolarLineSeriesBase {
        wr() {
            return false;
        }
        get_d8() {
            return true;
        }
        get_fd() {
            return true;
        }
        cg() {
            return new PolarSplineAreaSeriesView(this);
        }
        o0(a) {
            super.o0(a);
            this.zm = a;
        }
        constructor() {
            super();
            this.ab = PolarSplineAreaSeries.$;
        }
        zk(a) {
            let b = a;
            b.c8();
        }
        zl(a, b) {
            this.zk(b);
            if (a.m.count < 1) {
                return;
            }
            let c = b;
            c.c9(a.m, this.zn);
            this.v3.az(this, this.wq(), runOn(this, this.vg));
            let d = false;
            let e = this.v3.b;
            if (e != null) {
                d = true;
            }
            if (d) {
                this.x5(-1, this.wc.count, b.q);
            }
            let f = c.df;
            let g = c.de;
            this.v3.ad(f, true, false, true, true);
            this.v3.ad(g, false, true, false, false);
            g._opacity = this.v3.j * this.hf;
        }
        get_zh() {
            return true;
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            switch (b) {
                case PolarSplineAreaSeries.$$p[0]:
                    this.pp(false);
                    break;
            }
        }
    }
    PolarSplineAreaSeries.$t = /*@__PURE__*/ markType(PolarSplineAreaSeries, 'PolarSplineAreaSeries', PolarLineSeriesBase.$);
    PolarSplineAreaSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, PolarSplineAreaSeries, 'raisePropertyChanged', ['Stiffness:zn:zp', [1, 0.5]]);
    return PolarSplineAreaSeries;
})();
/**
 * @hidden
 */
export let PolarSplineAreaSeriesView = /*@__PURE__*/ (() => {
    class PolarSplineAreaSeriesView extends PolarLineSeriesBaseView {
        constructor(a) {
            super(a);
            this.c7 = null;
            this.dd = ((() => {
                let $ret = new Path();
                $ret.an = new PathGeometry();
                return $ret;
            })());
            this.dc = ((() => {
                let $ret = new Path();
                $ret.an = new PathGeometry();
                return $ret;
            })());
            this.db = ((() => {
                let $ret = new Path();
                $ret.an = new PathGeometry();
                return $ret;
            })());
            this.da = ((() => {
                let $ret = new Path();
                $ret.an = new PathGeometry();
                return $ret;
            })());
            this.c7 = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.c7.ua = Defaults.e;
            }
        }
        get de() {
            return this.dc;
        }
        get df() {
            return this.dd;
        }
        c8() {
            Extensions.e(this.dc.an);
            Extensions.e(this.dd.an);
            Extensions.e(this.da.an);
            Extensions.e(this.db.an);
            this.as();
        }
        c9(a, b) {
            this.dd.an.c = Numeric.h(a.count + 1, (c) => c < a.count ? a._inner[c].x : a._inner[c - a.count].x, (c) => c < a.count ? a._inner[c].y : a._inner[c - a.count].y, b);
            this.dc.an.c = Numeric.h(a.count + 1, (c) => c < a.count ? a._inner[c].x : a._inner[c - a.count].x, (c) => c < a.count ? a._inner[c].y : a._inner[c - a.count].y, b);
            this.as();
        }
        bd() {
            super.bd();
        }
        be() {
            super.be();
            let a = this.br();
            this.da.an = this.dc.an;
            this.db.an = this.dd.an;
            this.da._fill = a;
            this.da._opacity = 1;
            this.db._stroke = a;
            this.db.ad = this.e.hk + 3;
        }
        a8(a, b) {
            super.a8(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.da);
                    a.t(this.db);
                }
                else {
                    a.t(this.dc);
                    a.t(this.dd);
                }
            }
        }
        an(a) {
            super.an(a);
            this.e.a9.exportPathData(a, this.dd, "polarShape", ["Main"]);
            this.e.a9.exportPathData(a, this.dc, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.s6 = a;
            this.e.ir = 5;
            this.e.is = 5;
            this.e.it = 5;
        }
    }
    PolarSplineAreaSeriesView.$t = /*@__PURE__*/ markType(PolarSplineAreaSeriesView, 'PolarSplineAreaSeriesView', PolarLineSeriesBaseView.$);
    return PolarSplineAreaSeriesView;
})();
