/*
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 { MarkerSeries } from "./MarkerSeries";
import { Base, runOn, delegateCombine, Number_$type, enumGetBox, Point_$type, typeCast, fromEnum, markType, markDep } from "igniteui-react-core";
import { PolarAxisInfoCache } from "./PolarAxisInfoCache";
import { SeriesRenderer$2 } from "./SeriesRenderer$2";
import { PolarFrame } from "./PolarFrame";
import { DependencyProperty } from "igniteui-react-core";
import { NumericAngleAxis } from "./NumericAngleAxis";
import { NumericRadiusAxis } from "./NumericRadiusAxis";
import { TrendLineType_$type } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { DoubleCollection } from "igniteui-react-core";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { HighlightingInfo } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { PolarAxes } from "./PolarAxes";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { SeriesRenderingArguments } from "./SeriesRenderingArguments";
import { AxisRange } from "./AxisRange";
import { Dictionary$2 } from "igniteui-react-core";
import { OwnedPoint } from "./OwnedPoint";
import { GeometryUtil } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { HashPool$2 } from "igniteui-react-core";
import { Clipper } from "igniteui-react-core";
import { PolarTrendLineManager } from "./PolarTrendLineManager";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { AssigningPolarStyleEventArgs } from "./AssigningPolarStyleEventArgs";
import { AssigningPolarMarkerStyleEventArgs } from "./AssigningPolarMarkerStyleEventArgs";
import { SeriesRenderManager } from "./SeriesRenderManager";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, isInfinity } from "igniteui-react-core";
import { Defaults } from "./Defaults";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { GeometryGroup } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
 * @hidden
 */
export let PolarBase = /*@__PURE__*/ (() => {
    class PolarBase extends MarkerSeries {
        cq() {
            return new PolarBaseView(this);
        }
        qw(a) {
            super.qw(a);
            this.yo = a;
        }
        oz() {
            super.oz();
            this.yk = null;
            this.yl = null;
        }
        get_fn() {
            return true;
        }
        d9(a, b, c, d) {
            if (!this.hasMarkers) {
                return false;
            }
            let e = this.yk;
            let f = new ScalerParams(1, this.c9.vl, this.wk, e.ch);
            f.c = this.getEffectiveViewport1(this.ct);
            let g = this.yl;
            let h = new ScalerParams(1, this.c9.vl, this.wk, g.ch);
            h.c = this.getEffectiveViewport1(this.ct);
            a.clear();
            this.wx.cj((i) => {
                if (i._visibility == 0) {
                    let j = new SeriesPointOfInterest();
                    let k = i.n;
                    let l = i.o;
                    if (k < this.wk.left || k > this.wk.right || l < this.wk.top || l > this.wk.bottom) {
                        return;
                    }
                    let m;
                    let n;
                    let o = this.ym.f(k, l, this.ct.by, this.ct.bx, this.ct.getEffectiveViewport(), m, n);
                    m = o.p5;
                    n = o.p6;
                    j.d = m;
                    j.e = n;
                    j.b = i.content;
                    j.g = this.u9;
                    j.c = i.ak;
                    if (this.g7) {
                        j.g = this.vg(i.ak);
                    }
                    a.add(j);
                }
            });
            return true;
        }
        constructor() {
            super();
            this.yp = null;
            this.yg = null;
            this.yn = null;
            this.ab6 = null;
            this.ab5 = null;
            this.ab4 = null;
            this.y1 = null;
            this.y8 = null;
            this.y9 = null;
            this.yt = new PolarFrame();
            this.yv = new PolarFrame();
            this.yr = new PolarFrame();
            this.ym = null;
            this.zr = null;
            this.yx = 1;
            this.zd = false;
            this.zc = false;
            this.y6 = null;
            this.y7 = null;
            this.assigningPolarStyle = null;
            this.assigningPolarMarkerStyle = null;
            this.yw = null;
            this.yu = null;
            this.yq = null;
            this.yw = new PolarSeriesRenderManager();
            this.yy = this.yz();
            this.yu = new PolarFrame();
            this.yv.x = runOn(this, this.ab3);
            this.yt.x = runOn(this, this.ab3);
            this.yr.x = runOn(this, this.ab3);
            this.y1 = new SeriesRenderer$2(PolarFrame.$, PolarBaseView.$, 0, runOn(this, this.aa4), runOn(this, this.aa8), runOn(this, this.d1), runOn(this, this.r0), runOn(this, this.aax));
        }
        aax() {
            if (this.da.g) {
                this.da.t();
            }
        }
        aaz() {
            this.ym.e(this.yp.w, this.za, this.zb, this.ab6, this.ab5, this.ab4, (a, b) => Math.cos(b), (a, b) => Math.sin(b), true);
        }
        f9() {
            return this.highlightedItemsSource != null || (this.aaf != null && this.aad != null);
        }
        zp() {
            return false;
        }
        hr() {
            let a = super.hr();
            {
                let b = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "AngleMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedAngleMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.aa0));
                a.add(b);
            }
            {
                let c = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "RadiusMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedRadiusMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.aa1));
                a.add(c);
            }
            if (this.zp()) {
                let d = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "DashArray";
                    $ret.p = true;
                    $ret.x = ((() => {
                        let $ret = new DoubleCollection();
                        $ret.add(5);
                        $ret.add(5);
                        return $ret;
                    })());
                    $ret.q = true;
                    return $ret;
                })());
                a.add(d);
            }
            if (!this.zp()) {
                let e = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Brush";
                    $ret.p = true;
                    $ret.y = "ActualBrush";
                    $ret.q = true;
                    return $ret;
                })());
                e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.ru));
                a.add(e);
            }
            if (!this.zp()) {
                let f = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Outline";
                    $ret.p = true;
                    $ret.y = "ActualOutline";
                    $ret.q = true;
                    return $ret;
                })());
                f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.ru));
                a.add(f);
            }
            return a;
        }
        aa1(a, b) {
            if (this.aaf != null) {
                b.value = this.aaf;
                return;
            }
            b.value = this.aas;
        }
        aa0(a, b) {
            if (this.aad != null) {
                b.value = this.aad;
                return;
            }
            b.value = this.aaa;
        }
        get za() {
            return this.y8;
        }
        set za(a) {
            if (this.y8 != a) {
                let b = this.za;
                this.y8 = a;
                this.raisePropertyChanged("AngleColumn", b, this.za);
            }
        }
        get zb() {
            return this.y9;
        }
        set zb(a) {
            if (this.y9 != a) {
                let b = this.zb;
                this.y9 = a;
                this.raisePropertyChanged("RadiusColumn", b, this.zb);
            }
        }
        get aby() {
            return this.c(PolarBase.aa9);
        }
        set aby(a) {
            this.h(PolarBase.aa9, a);
        }
        ys() {
            let a = this.yr;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                a = this.yv;
            }
            return a;
        }
        p5() {
            super.p5();
            if (this.yl != null) {
                this.yl.h9(false);
            }
            if (this.yk != null) {
                this.yk.h9(false);
            }
        }
        o8(a, b, c, d) {
            let e = false;
            this.yo.c0.g$e(a, b, c, d);
            if (this.yk != null && !this.yk.c1()) {
                e = true;
            }
            if (this.yl != null && !this.yl.c1()) {
                e = true;
            }
            if (e) {
                this.rm(true);
            }
        }
        sj(a, b) {
            this.rm(false);
        }
        sk(a, b) {
            this.rm(false);
        }
        hc(a, b, c) {
            let d = true;
            if (!super.hc(a, b, c) || !c.o() || b.isEmpty || a.isEmpty || this.yk == null || this.yl == null || this.za == null || this.zb == null || this.za.count == 0 || this.zb.count == 0 || this.dl == null || this.dl.count != this.za.count || this.dl.count != this.zb.count || this.ym == null || this.yk.bi == null || this.yl.bi == null || this.yk.ly == this.yk.lx || this.yl.ly == this.yl.lx) {
                d = false;
            }
            return d;
        }
        rn(a) {
            super.rn(a);
            let b;
            let c;
            let d = this.getViewInfo(c, b);
            c = d.p0;
            b = d.p1;
            if (!this.hc(c, b, this.ct)) {
                this.o2(true, this.ct);
                return;
            }
            this.ab6 = b;
            this.ab5 = c;
            this.ab4 = this.ct.getEffectiveViewport();
            this.yn = new PolarAxisInfoCache(this.yk, this.yl, this.dl);
            let e = new SeriesRenderingArguments(this, c, b, a, this.gp);
            let f = this.y1.g(e, this.yt, this.yr, this.yv, this.yo);
            this.yt = f.p1;
            this.yr = f.p2;
            this.yv = f.p3;
        }
        ab3(a) {
            let b = this.ym.h(a.x, a.y, this.ab6, this.ab5, this.ab4, this.yn.e, this.yn.d, this.yn.g, this.yn.f, this.yn.i, this.yn.h);
            return b;
        }
        ax(a) {
            if (a != null && a == this.yk && this.za != null) {
                return new AxisRange(this.za.minimum, this.za.maximum);
            }
            if (a != null && a == this.yl && this.zb != null) {
                return new AxisRange(this.zb.minimum, this.zb.maximum);
            }
            return null;
        }
        gb(a) {
            let b = this.ct.by;
            b = b.copy();
            let c = this.ct.bx;
            let d = !b.isEmpty && !c.isEmpty && this.dl != null ? this.dl.indexOf(a) : -1;
            if (this.yk == null || this.za == null || this.yl == null || this.zb == null) {
                return false;
            }
            if (d < 0 || d > this.za.count - 1 || d > this.zb.count - 1) {
                return false;
            }
            let e = this.yk.getScaledAngle(this.za.item(d));
            let f = this.yl.nv(this.zb.item(d));
            let g = 0.5 + (Math.cos(e) * f);
            let h = 0.5 + (Math.sin(e) * f);
            if (!isNaN_(g)) {
                if (g < b.left + 0.1 * b.width) {
                    g = g + 0.4 * b.width;
                    b.x = g - 0.5 * b.width;
                }
                if (g > b.right - 0.1 * b.width) {
                    g = g - 0.4 * b.width;
                    b.x = g - 0.5 * b.width;
                }
            }
            if (!isNaN_(h)) {
                if (h < b.top + 0.1 * b.height) {
                    h = h + 0.4 * b.height;
                    b.y = h - 0.5 * b.height;
                }
                if (h > b.bottom - 0.1 * b.height) {
                    h = h - 0.4 * b.height;
                    b.y = h - 0.5 * b.height;
                }
            }
            if (this.c1 != null) {
                this.c1.au(this.c9, b, true);
            }
            return d >= 0;
        }
        kl(a) {
            let b = this.j1(a);
            if (this.dl != null && b >= 0 && b < this.dl.count) {
                return this.dl.item(b);
            }
            return null;
        }
        j1(a) {
            let b = truncate(Math.round(this.ip(a)));
            return b;
        }
        ip(a) {
            switch (this.yy) {
                case 1: return this.zv(a);
                case 3: return this.zw(a);
                case 2: return this.zt(a);
                case 4: return this.zu(a);
            }
            return -1;
        }
        zu(a) {
            return this.zx(a, false);
        }
        zt(a) {
            let b = this.v0(a);
            let c = b.x;
            let d = b.y;
            if (this.dl == null || this.yk == null || this.yl == null || this.za == null || this.zb == null) {
                return -1;
            }
            if (this.dl.count > this.zz) {
                return -1;
            }
            if (!this.zh()) {
                return -1;
            }
            let e = this.zr;
            let f = 1.7976931348623157E+308;
            let g = -1;
            for (let h = 0; h < this.za.count; h++) {
                let i = e._inner[h].x;
                let j = e._inner[h].y;
                let k = (c - i) * (c - i) + (d - j) * (d - j);
                if (k < f) {
                    f = k;
                    g = h;
                }
            }
            return g;
        }
        zh() {
            let a = this.yr;
            if (this.d1()) {
                a = this.yv;
            }
            if (a == null || a.w.count == 0) {
                return false;
            }
            this.zr = a.w;
            return true;
        }
        zx(a, b) {
            if (!this.zk) {
                return -1;
            }
            let c = { $type: Point_$type, x: 0, y: 0 };
            let d = true;
            let e = this.yr;
            if (this.d1()) {
                e = this.yv;
            }
            if (e == null) {
                return -1;
            }
            if (e.m == null) {
                return -1;
            }
            if (this.dl == null || this.dl.count > this.zz) {
                return -1;
            }
            if (!this.zh()) {
                return -1;
            }
            let f = this.zr;
            let g = this.v0(a);
            let h = 1.7976931348623157E+308;
            let i = -1;
            for (let j = 0; j < f.count; j++) {
                let k = f._inner[j];
                if (j > 0) {
                    if (isNaN_(k.x) || isNaN_(k.y) || isNaN_(c.x) || isNaN_(c.y)) {
                        c = k;
                        continue;
                    }
                    if (!b || e.j.containsKey(this.dl.item(j)) || e.j.containsKey(this.dl.item(j - 1))) {
                        let l = GeometryUtil.g(g, c, k);
                        if (l < h) {
                            h = l;
                            i = j;
                        }
                    }
                }
                c = k;
            }
            if (i >= 0) {
                let m = f._inner[i];
                let n = f._inner[i - 1];
                if (!b || (e.j.containsKey(this.dl.item(i)) && e.j.containsKey(this.dl.item(i - 1)))) {
                    let o = GeometryUtil.l(g, n, m);
                    return (i - 1) + o;
                }
                else if (e.j.containsKey(this.dl.item(i))) {
                    return i;
                }
                else {
                    return i - 1;
                }
            }
            return -1;
        }
        zw(a) {
            return this.zx(a, true);
        }
        zv(a) {
            let b = null;
            let c = 1.7976931348623157E+308;
            let d = this.v0(a);
            let e = d.x;
            let f = d.y;
            if (this.yo.c1.e > this.zz) {
                return -1;
            }
            this.yo.c4((g) => {
                if (g._visibility == 0) {
                    let h = this.yo.cu(g);
                    let i = h.left + h.width / 2;
                    let j = h.top + h.height / 2;
                    let k = (e - i) * (e - i) + (f - j) * (f - j);
                    if (k < c) {
                        c = k;
                        b = g;
                    }
                }
            });
            if (b != null) {
                return b.ak;
            }
            return -1;
        }
        v5(a, b, c) {
            if (this.yk == null || this.yl == null || this.za == null || this.zb == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            let d = this.ct.by;
            let e = this.ct.bx;
            let f = this.getEffectiveViewport();
            let g = new ScalerParams(0, d, e, this.yk.ch, f);
            let h = ((() => {
                let $ret = new ScalerParams(0, d, e, this.yl.ch, f);
                $ret.b = this.iw();
                return $ret;
            })());
            if (b) {
                let i = this.ip(a);
                if (i == -1) {
                    return { $type: Point_$type, x: NaN, y: NaN };
                }
                let j = truncate(Math.floor(i));
                let k = truncate(Math.ceil(i));
                if (j < 0) {
                    j = 0;
                }
                if (k < 0) {
                    k = 0;
                }
                if (k > this.dl.count - 1) {
                    k = this.dl.count - 1;
                }
                if (j > this.dl.count - 1) {
                    j = this.dl.count - 1;
                }
                if (k == j) {
                    return this.ym.h(this.za.item(j), this.zb.item(j), d, e, f, this.yn.e, this.yn.d, this.yn.g, this.yn.f, this.yn.i, this.yn.h);
                }
                let l = i - Math.floor(i);
                let m = this.ym.h(this.za.item(j), this.zb.item(j), d, e, f, this.yn.e, this.yn.d, this.yn.g, this.yn.f, this.yn.i, this.yn.h);
                let n = this.ym.h(this.za.item(k), this.zb.item(k), d, e, f, this.yn.e, this.yn.d, this.yn.g, this.yn.f, this.yn.i, this.yn.h);
                let o = m.x;
                let p = m.y;
                let q = n.x;
                let r = n.y;
                let s = q - o;
                let t = r - p;
                return { $type: Point_$type, x: o + s * l, y: p + t * l };
            }
            else {
                let u = this.j1(a);
                if (u == -1) {
                    return { $type: Point_$type, x: NaN, y: NaN };
                }
                return this.ym.h(this.za.item(u), this.zb.item(u), d, e, f, this.yn.e, this.yn.d, this.yn.g, this.yn.f, this.yn.i, this.yn.h);
            }
        }
        ai() {
            return [this.yk, this.yl];
        }
        ko(a, b) {
            let c = this.na(b);
            if (c == PolarBase.$$p[3]) {
                return this.kp(a, b, this.aaa);
            }
            if (c == PolarBase.$$p[15]) {
                return this.kp(a, b, this.aas);
            }
            if (c == PolarBase.$$p[5]) {
                return this.kp(a, b, this.aad);
            }
            if (c == PolarBase.$$p[6]) {
                return this.kp(a, b, this.aaf);
            }
            return super.ko(a, b);
        }
        ma(a) {
            let b = this.na(a);
            if (b == PolarBase.$$p[3]) {
                return this.aaa;
            }
            if (b == PolarBase.$$p[15]) {
                return this.aas;
            }
            if (b == PolarBase.$$p[5]) {
                return this.aad;
            }
            if (b == PolarBase.$$p[6]) {
                return this.aaf;
            }
            return super.ma(a);
        }
        q4(a, b, c, d) {
            super.q4(a, b, c, d);
            if (this.yo.c0.g$b(a, b, c, d)) {
                this.rm(false);
                this.qg();
            }
            switch (b) {
                case PolarBase.$$p[1]:
                case PolarBase.$$p[2]:
                case PolarBase.$$p[13]:
                case PolarBase.$$p[14]:
                    this.qa();
                    break;
                case "FastItemsSource":
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.za);
                        c.deregisterColumn(this.zb);
                        this.za = null;
                        this.zb = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.za = this.di(this.aaa);
                        this.zb = this.di(this.aas);
                    }
                    if ((this.yl != null && !this.yl.c1()) || (this.yk != null && !this.yk.c1())) {
                        this.rm(this.ge && c != null);
                    }
                    break;
                case PolarBase.$$p[0]:
                    if (this.yk != null && this.yl != null) {
                        this.ym = new PolarAxes(this.yl, this.yk);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    if (this.yk != null && !this.yk.c1()) {
                        this.rm(false);
                    }
                    else if (c != null && d == null) {
                        this.o2(true, this.ct);
                    }
                    break;
                case PolarBase.$$p[12]:
                    if (this.yk != null && this.yl != null) {
                        this.ym = new PolarAxes(this.yl, this.yk);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    if (this.yl != null && !this.yl.c1()) {
                        this.rm(false);
                    }
                    else if (c != null && d == null) {
                        this.o2(true, this.ct);
                    }
                    if (this.yk != null && !this.yk.c1()) {
                        this.yk.h5();
                    }
                    break;
                case PolarBase.$$p[3]:
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.za);
                        this.za = this.di(this.aaa);
                    }
                    break;
                case "AngleColumn":
                    this.yo.c0.g$i();
                    if (this.yk != null && !this.yk.c1()) {
                        this.rm(this.ge && this.d5);
                    }
                    break;
                case PolarBase.$$p[15]:
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.zb);
                        this.zb = this.di(this.aas);
                    }
                    break;
                case "RadiusColumn":
                    this.yo.c0.g$i();
                    if (this.yl != null && !this.yl.c1()) {
                        this.rm(this.ge && this.d5);
                    }
                    break;
                case PolarBase.$$p[16]:
                    this.rm(false);
                    this.qg();
                    break;
                case PolarBase.$$p[11]:
                    this.rm(false);
                    this.qg();
                    break;
                case "TransitionProgress":
                    this.yn = new PolarAxisInfoCache(this.yk, this.yl, this.dl);
                    this.ab6 = this.ct.by;
                    this.ab5 = this.ct.bx;
                    this.ab4 = this.ct.getEffectiveViewport();
                    this.yv.v = this.zq;
                    this.yv.c(this.jo, this.yt, this.yr);
                    if (this.d3(this.ct)) {
                        return;
                    }
                    if (this.jo == 1) {
                        this.aa8(this.yr, this.yo);
                        this.qj();
                    }
                    else {
                        this.aa8(this.yv, this.yo);
                    }
                    if (this.c9 != null) {
                        this.c9.qa(this);
                    }
                    break;
                case "TrendLineBrush":
                    this.ra(b);
                    break;
                case PolarBase.$$p[4]:
                    this.rm(false);
                    this.qg();
                    break;
                case "TrendLineType":
                    this.qg();
                    break;
                case PolarBase.$$p[8]:
                    this.zd = this.zm();
                    this.rm(false);
                    break;
                case PolarBase.$$p[7]:
                    this.zc = this.zl();
                    this.rm(false);
                    break;
                case PolarBase.$$p[9]:
                    this.yy = this.yz();
                    break;
            }
        }
        get yy() {
            return this.yx;
        }
        set yy(a) {
            let b = this.yx;
            this.yx = a;
            if (b != this.yx) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.yx));
            }
        }
        yz() {
            if (this.y0 != 0) {
                return this.y0;
            }
            return this.zk ? 4 : 1;
        }
        get_zk() {
            return false;
        }
        get zk() {
            return this.get_zk();
        }
        zm() {
            return this.zj;
        }
        zl() {
            return this.zi;
        }
        zf(a) {
            if (typeCast(NumericRadiusAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        ze(a) {
            if (typeCast(NumericAngleAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        o2(a, b) {
            super.o2(a, b);
            let c = b;
            if (a) {
                c.c1.clear();
            }
            c.c0.g$d();
        }
        yh(a, b) {
            let c = a.top - 10;
            let d = a.bottom + 10;
            let e = a.left - 10;
            let f = a.right + 10;
            let g = ((() => {
                let $ret = new Clipper(1, e, d, f, c, false);
                $ret.i = b;
                return $ret;
            })());
            return g;
        }
        aaw(a, b, c, d) {
            a.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, b);
            let e = this.dl;
            for (let f = 0; f < b; f++) {
                let g = a.w._inner[f];
                if (!isInfinity(g.x) && !isInfinity(g.y)) {
                    let h = { $type: Point_$type, x: this.za.item(f), y: this.zb.item(f) };
                    let i = { $type: Point_$type, x: g.x, y: g.y };
                    a.g.addItem(e.item(f), ((() => {
                        let $ret = new OwnedPoint();
                        $ret.a = e.item(f);
                        $ret.b = h;
                        $ret.c = i;
                        return $ret;
                    })()));
                }
            }
        }
        aa4(a, b) {
            let c = b.by;
            let d = b.bx;
            let e = b.getEffectiveViewport();
            a.j.clear();
            a.n.clear();
            let f = Math.min(this.za != null ? this.za.count : 0, this.zb != null ? this.zb.count : 0);
            if (f < 1) {
                return;
            }
            this.yn = new PolarAxisInfoCache(this.yk, this.yl, this.dl);
            this.yp = a;
            this.ab5 = d;
            this.ab6 = c;
            this.ab4 = b.getEffectiveViewport();
            b.cy.l(a.j, this.z0, c, d, this.ib);
            if (f <= this.z0) {
                this.aaw(a, f, c, d);
            }
            let g = this.yh(d, a.n);
            let h = Math.min(this.yk.ly, this.yk.lx);
            let i = Math.max(this.yk.lx, this.yk.ly);
            b.c0.i = this.zq;
            b.c0.h = 0;
            b.c0.k = this.yl.np;
            b.c0.j = this.yl.no;
            b.c0.l = (j, k) => this.ym.c(j, k, c, d, e, Math.cos);
            b.c0.m = (j, k) => this.ym.d(j, k, c, d, e, Math.sin);
            let j = new List$1(Number_$type, 0);
            for (let k = 0; k < this.za.count; k++) {
                if (this.za.item(k) >= h && this.za.item(k) <= i) {
                    j.add(this.za.item(k));
                }
            }
            let l = this.zb;
            if (j.count != this.za.count) {
                l = new List$1(Number_$type, 0);
                for (let m = 0; m < this.za.count; m++) {
                    if (this.za.item(m) >= h && this.za.item(m) <= i) {
                        l.add(this.zb.item(m));
                    }
                }
            }
            b.c0.n(a.n, this.y2, j, l, this.z1, runOn(this.yk, this.yk.getScaledAngle), runOn(this.yl, this.yl.nv), ((() => {
                let $ret = new TrendResolutionParams();
                $ret.d = this.ib;
                $ret.i = d;
                $ret.h = e;
                $ret.j = c;
                return $ret;
            })()), g, h, i);
        }
        get_fc() {
            return true;
        }
        y4(a, b, c) {
            return null;
        }
        y5(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.ys();
            let e = this.yo.b1(this.v0(b));
            let f = -1;
            if (e == null) {
                if (a != null) {
                    f = this.dl.indexOf(a);
                }
                else {
                    return null;
                }
            }
            else {
                f = e.ak;
            }
            if (f == -1) {
                return null;
            }
            let g = new HighlightingInfo();
            g.i = this;
            g.g = f;
            g.f = f;
            g.c = false;
            g.d = true;
            if (c != null && c.g == g.g && c.f == g.f) {
                return c;
            }
            return g;
        }
        y3(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dl.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        de(a, b, c) {
            if (this.eb && this.fx(this.bv) && !c) {
                let d = this.y4(a, b, this.y6);
                this.y6 = d;
                return d;
            }
            else {
                let e = this.y3(a, b, this.y6);
                this.y6 = e;
                return e;
            }
        }
        df(a, b, c) {
            if (this.fx(this.bv) && !c) {
                let d = this.y5(a, b, this.y7);
                this.y7 = d;
                return d;
            }
            else {
                let e = this.y3(a, b, this.y7);
                e.d = true;
                this.y7 = e;
                return e;
            }
        }
        zo() {
            return (this.assigningPolarStyle != null && this.zd) || (this.bv != 1) || this.d0 || (this.cn != 1) || (this.cm != 1);
        }
        zn() {
            return (this.assigningPolarMarkerStyle != null && this.zc) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
        }
        aa8(a, b) {
            this.qs();
            let c = b.by;
            let d = b.bx;
            let e = this.getEffectiveViewport1(b);
            let f = this.wc(b);
            this.yn = new PolarAxisInfoCache(this.yk, this.yl, this.dl);
            if (this.w7()) {
                b.cy.j(a.j, this.w9);
                if (this.zn()) {
                    this.aay(b, a);
                }
            }
            b.cr();
            let g = this.yh(d, b.c0.g$j.an);
            b.c0.g$h(a.n, g);
            this.aav(d, c, e, f, b);
        }
        ye(a, b) {
            return this.yf(a, b);
        }
        yf(a, b) {
            if (b < a || a < 0 || a > this.za.count || b < 0 || b > this.za.count) {
                return null;
            }
            let c = new Array((b - a) + 1);
            for (let d = a; d <= b; d++) {
                let e = d;
                c[d - a] = this.dl.item(d);
            }
            return c;
        }
        aay(a, b) {
            a.b7 = true;
            this.yw.ay(this, this.zn(), runOn(this, this.ye));
            let c = this.yw.d;
            let d = c != null;
            let e = this.getEffectiveViewport1(a);
            let f = this.dl == null ? 0 : this.dl.count;
            this.yo.cj((g) => {
                if (g._visibility == 0) {
                    let h = g.ak;
                    let i = g.content;
                    if (i == null) {
                        i = new DataContext();
                        g.content = i;
                    }
                    if (d) {
                        this.aa2(h, f, a.q);
                    }
                    this.yw.ac(g, i);
                }
            });
        }
        aa3(a, b, c) {
            let d = this.bv != 1;
            let e = this.cn != 1;
            let f = this.cm != 1;
            this.yw.a0(this.yw.b, a, b, false);
            this.yw.ab(this.h9);
            let g = this.yw.ax;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dl;
            if (d && this.c9 != null) {
                h = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, false);
                g.c = h;
            }
            if (e && this.c9 != null) {
                i = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, false);
                if (i == null && this.bl != null) {
                    i = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, g.z, g.y, false);
                }
                g.d = i;
            }
            if (f && this.c9 != null) {
                j = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, false);
                g.b = j;
            }
            g.h = c;
            this.aa6(g);
            this.yw.z(this, h, i, j, c, d, e, f, a < 0);
        }
        aa2(a, b, c) {
            let d = this.bv != 1;
            let e = this.cn != 1;
            let f = this.cm != 1;
            this.yw.a0(this.yw.d, a, b, true);
            this.yw.aa(this.h9);
            let g = this.yw.aw;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dl;
            let l = null;
            let m = null;
            let n = null;
            if (d && this.c9 != null) {
                h = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.c9.dj.isCrossContextHighlight(this)) {
                    l = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.c = h;
            }
            if (e && this.c9 != null) {
                i = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                if (i == null && this.bl != null) {
                    i = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, g.z, g.y, true);
                }
                if (this.c9.dk.isCrossContextHighlight(this)) {
                    m = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            if (f && this.c9 != null) {
                j = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.c9.di.isCrossContextHighlight(this)) {
                    n = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            g.h = c;
            this.aa5(g);
            this.yw.y(this, h, i, j, c, d, e, f, g.v, this.c9.dj.totalHighWaterMark, g.x, this.c9.dk.totalHighWaterMark, g.t, this.c9.di.totalHighWaterMark);
        }
        aa6(a) {
            if (this.assigningPolarStyle != null && this.zd) {
                this.assigningPolarStyle(this, a);
            }
        }
        aa5(a) {
            if (this.assigningPolarMarkerStyle != null && this.zc) {
                this.assigningPolarMarkerStyle(this, a);
            }
        }
        aav(a, b, c, d, e) {
            e.c3(a, b, c, d);
        }
        sa() {
            super.sa();
            if (this.index < 0) {
                return;
            }
            this.yo.c6();
        }
        ro(a, b) {
            super.ro(a, b);
            if (!this.gy) {
                this.ct.a4(b);
                return;
            }
            this.ct.a4(b);
            if (this.d3(this.cs)) {
                return;
            }
            let c = this.cs;
            if (!this.gq) {
                this.yu = new PolarFrame();
                this.aa4(this.yu, c);
            }
            this.gq = false;
            this.aa8(this.yu, c);
            this.gy = false;
        }
        rl(a, b, c, d, e) {
            super.rl(a, b, c, d, e);
            let f = this.a9.a$j.item(d);
            let g = f;
            f.a3(c);
            if (this.d3(g)) {
                return;
            }
            if (this.yq == null) {
                this.yq = new PolarFrame();
            }
            this.aa4(this.yq, g);
            this.aa8(this.yq, g);
        }
        aa7(a, b) {
            let c = new List$1(Base.$, 0);
            for (let d of fromEnum(b.c)) {
                if (!a.containsKey(d)) {
                    c.add1(d);
                }
            }
            for (let e of fromEnum(c)) {
                b.h(e);
            }
        }
        yd(a, b, c) {
            this.aaz();
            return this.yp.w.toArray();
        }
        zs(a) {
            let b = new List$1(Number_$type, 0);
            let c = this.dl;
            for (let d of fromEnum(this.yo.c1.c)) {
                b.add(c.indexOf(d));
            }
            return b;
        }
        ab2(a) {
            return { $type: Point_$type, x: this.za.item(a), y: this.zb.item(a) };
        }
        pu(a) {
            super.pu(a);
            this.bb.exportTrendlineData(this, a, this.yo.c0.g$j);
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.kl(c);
            let e = d == null ? NaN : this.iv(d, "RadiusMemberPath");
            let f = d == null ? NaN : this.iv(d, "AngleMemberPath");
            let g = new DataLegendSeriesValueInfo();
            g.l = e;
            g.a = 11;
            g.r = this.aas != null ? this.aas : "Radius";
            g.q = "Radius";
            g.s = this.aao != null ? this.aao : "R:";
            g.t = this.aaq != null ? this.aaq : "";
            let h = new DataLegendSeriesValueInfo();
            h.l = f;
            h.a = 10;
            h.r = this.aaa != null ? this.aaa : "Angle";
            h.q = "Angle";
            h.s = this.z6 != null ? this.z6 : "A:";
            h.t = this.z8 != null ? this.z8 : "";
            let i = new DataLegendSeriesContext();
            i.e = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(g);
                $ret.add(h);
                return $ret;
            })());
            i.h = this.l9();
            return i;
        }
    }
    PolarBase.$t = /*@__PURE__*/ markType(PolarBase, 'PolarBase', MarkerSeries.$);
    PolarBase.aa9 = /*@__PURE__*/ DependencyProperty.i("ActualTrendLineBrush", Brush.$, PolarBase.$, /*@__PURE__*/ new PropertyMetadata(2, null, (a, b) => a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue)));
    PolarBase.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, PolarBase, 'raisePropertyChanged', ['AngleAxis:yk:aba', [NumericAngleAxis.$, null], 'AngleMemberAsLegendLabel:z6:abb', [2, null], 'AngleMemberAsLegendUnit:z8:abc', [2, null], 'AngleMemberPath:aaa:abd', [2], 'ClipSeriesToBounds:zg:abe', [0, false], 'HighlightedAngleMemberPath:aad:abf', [2, null], 'HighlightedRadiusMemberPath:aaf:abg', [2, null], 'IsCustomPolarMarkerStyleAllowed:zi:abh', [0, false], 'IsCustomPolarStyleAllowed:zj:abi', [0, false], 'ItemSearchMode:y0:abj', [ScatterItemSearchMode_$type, /*@__PURE__*/ enumGetBox(ScatterItemSearchMode_$type, 0)], 'ItemSearchThreshold:zz:abk', [1, 10000], 'MaximumMarkers:z0:abl', [1, 400], 'RadiusAxis:yl:abm', [NumericRadiusAxis.$, null], 'RadiusMemberAsLegendLabel:aao:abn', [2, null], 'RadiusMemberAsLegendUnit:aaq:abo', [2, null], 'RadiusMemberPath:aas:abp', [2], 'UseCartesianInterpolation:zq:abx', [0, true], 'TrendLineType:y2:abv', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness:zy:abu', [1, 1.5], 'TrendLinePeriod:z1:abt', [1, 7], 'TrendLineZIndex:z2:abw', [1, 1], 'TrendLineBrush:abz:abq', [Brush.$, null], 'TrendLineDashArray:ab0:abr', [DoubleCollection.$], 'TrendLineDashCap:ab1:abs', [PenLineCap_$type, /*@__PURE__*/ enumGetBox(PenLineCap_$type, 0)]]);
    return PolarBase;
})();
/**
 * @hidden
 */
export let PolarSeriesRenderManager = /*@__PURE__*/ (() => {
    class PolarSeriesRenderManager extends SeriesRenderManager {
        constructor() {
            super(...arguments);
            this.aw = null;
            this.ax = null;
        }
        c() {
            this.aw = new AssigningPolarMarkerStyleEventArgs();
            return this.aw;
        }
        a() {
            this.ax = new AssigningPolarStyleEventArgs();
            return this.ax;
        }
        ay(a, b, c) {
            this.w(a, b, c);
        }
        az(a, b, c) {
            this.x(a, b, c);
        }
        a0(a, b, c, d) {
            if (b == -1) {
                a.e = false;
                a.z = 0;
                a.y = c - 1;
            }
            else {
                if (d) {
                    a.z = b;
                    a.y = b;
                }
                else {
                    a.e = false;
                    a.z = b;
                    a.y = b;
                }
            }
        }
    }
    PolarSeriesRenderManager.$t = /*@__PURE__*/ markType(PolarSeriesRenderManager, 'PolarSeriesRenderManager', SeriesRenderManager.$);
    return PolarSeriesRenderManager;
})();
/**
 * @hidden
 */
export let PolarBaseView = /*@__PURE__*/ (() => {
    class PolarBaseView extends MarkerSeriesView {
        constructor(a) {
            super(a);
            this.cz = null;
            this.cy = null;
            this.c0 = null;
            this.c1 = null;
            this.cz = a;
            this.c1 = new HashPool$2(Base.$, Marker.$);
            this.cm(this.c1);
            this.c0 = new PolarTrendLineManager();
        }
        au() {
            super.au();
            this.cy = this.cx();
            if (!this.q) {
                this.cz.z0 = 1000;
                this.b4.w1 = Defaults.e;
            }
        }
        c4(a) {
            this.c1.g(a);
        }
        cx() {
            let a = new NumericMarkerManager(0, (b) => this.c1.item(b), (b) => this.cz.yn.c.item(b), runOn(this, this.c5), runOn(this, this.cw), runOn(this, this.c2));
            a.n = true;
            a.p = runOn(this.cz, this.cz.ab2);
            return a;
        }
        c5(a) {
            this.cz.aa7(a, this.c1);
        }
        cw() {
            return this.cz.yd(this.c1, this.by, this.bx);
        }
        c2() {
            return this.cz.zs(this.c1);
        }
        c3(a, b, c, d) {
            if (this.cz.zg) {
                let e = new GeometryGroup();
                this.cz.yl.n3(e, a, b, c, d);
            }
            else {
            }
        }
        c6() {
            if (this.cz.abz != null) {
                this.cz.aby = this.cz.abz;
            }
            else {
                this.cz.aby = this.cz.u2;
            }
        }
        cj(a) {
            this.c1.f(a);
        }
        a7(a, b) {
            if (a.d) {
                if (this.cz.y2 != 0 && !b) {
                    let c = this.c0.g$j;
                    c.ad = this.cz.zy;
                    c._stroke = this.cz.aby;
                    c.aj = this.cz.ab1;
                    c.ai = this.cz.ab0;
                    a.v(c);
                }
            }
            super.a7(a, b);
        }
        c7() {
            return Rect.empty;
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'><span>" + "${item." + this.cz.aaa + "}" + "</span><br/><span";
            let b = this.e.a9.a$u(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            a += ">" + this.cz.title + ": </span><span class='ui-priority-primary'>" + "${item." + this.cz.aas + "}</span></div>";
            return a;
        }
    }
    PolarBaseView.$t = /*@__PURE__*/ markType(PolarBaseView, 'PolarBaseView', MarkerSeriesView.$);
    return PolarBaseView;
})();
