/*
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 { ChartSelection } from "./ChartSelection";
import { CollisionRect } 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 {
        cs() {
            return new PolarBaseView(this);
        }
        qz(a) {
            super.qz(a);
            this.yv = a;
        }
        o2() {
            super.o2();
            this.yr = null;
            this.ys = null;
        }
        get_fp() {
            return true;
        }
        eb(a, b, c, d, e) {
            if (!this.hasMarkers) {
                return false;
            }
            let f = this.yr;
            let g = new ScalerParams(1, this.db.v4, this.wq, f.ch);
            g.c = this.getEffectiveViewport1(this.cv);
            let h = this.ys;
            let i = new ScalerParams(1, this.db.v4, this.wq, h.ch);
            i.c = this.getEffectiveViewport1(this.cv);
            a.clear();
            this.w4.cj((j) => {
                if (j._visibility == 0) {
                    let k = new SeriesPointOfInterest();
                    let l = j.n;
                    let m = j.o;
                    if (l < this.wq.left || l > this.wq.right || m < this.wq.top || m > this.wq.bottom) {
                        return;
                    }
                    let n;
                    let o;
                    let p = this.yt.f(l, m, this.cv.by, this.cv.bx, this.cv.getEffectiveViewport(), n, o);
                    n = p.p5;
                    o = p.p6;
                    k.d = n;
                    k.e = o;
                    k.b = j.content;
                    k.g = this.ve;
                    k.c = j.ak;
                    if (this.g9) {
                        k.g = this.vl(j.ak);
                    }
                    a.add(k);
                }
            });
            return true;
        }
        constructor() {
            super();
            this.yw = null;
            this.yn = null;
            this.yu = null;
            this.acd = null;
            this.acc = null;
            this.acb = null;
            this.y8 = null;
            this.zf = null;
            this.zg = null;
            this.y0 = new PolarFrame();
            this.y2 = new PolarFrame();
            this.yy = new PolarFrame();
            this.yt = null;
            this.zy = null;
            this.y4 = 1;
            this.zk = false;
            this.zj = false;
            this.zd = null;
            this.ze = null;
            this.assigningPolarStyle = null;
            this.assigningPolarMarkerStyle = null;
            this.y3 = null;
            this.y1 = null;
            this.yx = null;
            this.y3 = new PolarSeriesRenderManager();
            this.y5 = this.y6();
            this.y1 = new PolarFrame();
            this.y2.x = runOn(this, this.aca);
            this.y0.x = runOn(this, this.aca);
            this.yy.x = runOn(this, this.aca);
            this.y8 = new SeriesRenderer$2(PolarFrame.$, PolarBaseView.$, 0, runOn(this, this.abb), runOn(this, this.abf), runOn(this, this.d3), runOn(this, this.r5), runOn(this, this.aa4));
        }
        aa4() {
            if (this.dc.g) {
                this.dc.t();
            }
        }
        aa6() {
            this.yt.e(this.yw.w, this.zh, this.zi, this.acd, this.acc, this.acb, (a, b) => Math.cos(b), (a, b) => Math.sin(b), true);
        }
        gb() {
            return this.highlightedItemsSource != null || (this.aam != null && this.aak != null);
        }
        zw() {
            return false;
        }
        ht() {
            let a = super.ht();
            {
                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.aa7));
                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.aa8));
                a.add(c);
            }
            if (this.zw()) {
                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.zw()) {
                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.ry));
                a.add(e);
            }
            if (!this.zw()) {
                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.ry));
                a.add(f);
            }
            return a;
        }
        aa8(a, b) {
            if (this.aam != null) {
                b.value = this.aam;
                return;
            }
            b.value = this.aaz;
        }
        aa7(a, b) {
            if (this.aak != null) {
                b.value = this.aak;
                return;
            }
            b.value = this.aah;
        }
        get zh() {
            return this.zf;
        }
        set zh(a) {
            if (this.zf != a) {
                let b = this.zh;
                this.zf = a;
                this.raisePropertyChanged("AngleColumn", b, this.zh);
            }
        }
        get zi() {
            return this.zg;
        }
        set zi(a) {
            if (this.zg != a) {
                let b = this.zi;
                this.zg = a;
                this.raisePropertyChanged("RadiusColumn", b, this.zi);
            }
        }
        get ab5() {
            return this.c(PolarBase.abg);
        }
        set ab5(a) {
            this.h(PolarBase.abg, a);
        }
        yz() {
            let a = this.yy;
            if (this.d3()) {
                if (this.dc.g) {
                    this.dc.t();
                }
                a = this.y2;
            }
            return a;
        }
        p9() {
            super.p9();
            if (this.ys != null) {
                this.ys.ib(false);
            }
            if (this.yr != null) {
                this.yr.ib(false);
            }
        }
        pb(a, b, c, d) {
            let e = false;
            this.yv.c0.g$e(a, b, c, d);
            if (this.yr != null && !this.yr.c1()) {
                e = true;
            }
            if (this.ys != null && !this.ys.c1()) {
                e = true;
            }
            if (e) {
                this.rp(true);
            }
        }
        so(a, b) {
            this.rp(false);
        }
        sp(a, b) {
            this.rp(false);
        }
        he(a, b, c) {
            let d = true;
            if (!super.he(a, b, c) || !c.o() || b.isEmpty || a.isEmpty || this.yr == null || this.ys == null || this.zh == null || this.zi == null || this.zh.count == 0 || this.zi.count == 0 || this.dn == null || this.dn.count != this.zh.count || this.dn.count != this.zi.count || this.yt == null || this.yr.bi == null || this.ys.bi == null || this.yr.l4 == this.yr.l3 || this.ys.l4 == this.ys.l3) {
                d = false;
            }
            return d;
        }
        rq(a) {
            super.rq(a);
            let b;
            let c;
            let d = this.getViewInfo(c, b);
            c = d.p0;
            b = d.p1;
            if (!this.he(c, b, this.cv)) {
                this.o5(true, this.cv);
                return;
            }
            this.acd = b;
            this.acc = c;
            this.acb = this.cv.getEffectiveViewport();
            this.yu = new PolarAxisInfoCache(this.yr, this.ys, this.dn);
            let e = new SeriesRenderingArguments(this, c, b, a, this.gr);
            let f = this.y8.g(e, this.y0, this.yy, this.y2, this.yv);
            this.y0 = f.p1;
            this.yy = f.p2;
            this.y2 = f.p3;
        }
        aca(a) {
            let b = this.yt.h(a.x, a.y, this.acd, this.acc, this.acb, this.yu.e, this.yu.d, this.yu.g, this.yu.f, this.yu.i, this.yu.h);
            return b;
        }
        ay(a) {
            if (a != null && a == this.yr && this.zh != null) {
                return new AxisRange(this.zh.minimum, this.zh.maximum);
            }
            if (a != null && a == this.ys && this.zi != null) {
                return new AxisRange(this.zi.minimum, this.zi.maximum);
            }
            return null;
        }
        gd(a) {
            let b = this.cv.by;
            b = b.copy();
            let c = this.cv.bx;
            let d = !b.isEmpty && !c.isEmpty && this.dn != null ? this.dn.indexOf(a) : -1;
            if (this.yr == null || this.zh == null || this.ys == null || this.zi == null) {
                return false;
            }
            if (d < 0 || d > this.zh.count - 1 || d > this.zi.count - 1) {
                return false;
            }
            let e = this.yr.getScaledAngle(this.zh.item(d));
            let f = this.ys.od(this.zi.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.c3 != null) {
                this.c3.au(this.db, b, true);
            }
            return d >= 0;
        }
        kn(a) {
            let b = this.j3(a);
            if (this.dn != null && b >= 0 && b < this.dn.count) {
                return this.dn.item(b);
            }
            return null;
        }
        j3(a) {
            let b = truncate(Math.round(this.ir(a)));
            return b;
        }
        ir(a) {
            switch (this.y5) {
                case 1: return this.z2(a);
                case 3: return this.z3(a);
                case 2: return this.z0(a);
                case 4: return this.z1(a);
            }
            return -1;
        }
        z1(a) {
            return this.z4(a, false);
        }
        z0(a) {
            let b = this.v5(a);
            let c = b.x;
            let d = b.y;
            if (this.dn == null || this.yr == null || this.ys == null || this.zh == null || this.zi == null) {
                return -1;
            }
            if (this.dn.count > this.z6) {
                return -1;
            }
            if (!this.zo()) {
                return -1;
            }
            let e = this.zy;
            let f = 1.7976931348623157E+308;
            let g = -1;
            for (let h = 0; h < this.zh.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;
        }
        zo() {
            let a = this.yy;
            if (this.d3()) {
                a = this.y2;
            }
            if (a == null || a.w.count == 0) {
                return false;
            }
            this.zy = a.w;
            return true;
        }
        z4(a, b) {
            if (!this.zr) {
                return -1;
            }
            let c = { $type: Point_$type, x: 0, y: 0 };
            let d = true;
            let e = this.yy;
            if (this.d3()) {
                e = this.y2;
            }
            if (e == null) {
                return -1;
            }
            if (e.m == null) {
                return -1;
            }
            if (this.dn == null || this.dn.count > this.z6) {
                return -1;
            }
            if (!this.zo()) {
                return -1;
            }
            let f = this.zy;
            let g = this.v5(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.dn.item(j)) || e.j.containsKey(this.dn.item(j - 1))) {
                        let l = GeometryUtil.h(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.dn.item(i)) && e.j.containsKey(this.dn.item(i - 1)))) {
                    let o = GeometryUtil.m(g, n, m);
                    return (i - 1) + o;
                }
                else if (e.j.containsKey(this.dn.item(i))) {
                    return i;
                }
                else {
                    return i - 1;
                }
            }
            return -1;
        }
        z3(a) {
            return this.z4(a, true);
        }
        z2(a) {
            let b = null;
            let c = 1.7976931348623157E+308;
            let d = this.v5(a);
            let e = d.x;
            let f = d.y;
            if (this.yv.c1.e > this.z6) {
                return -1;
            }
            this.yv.c4((g) => {
                if (g._visibility == 0) {
                    let h = this.yv.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;
        }
        wa(a, b, c) {
            if (this.yr == null || this.ys == null || this.zh == null || this.zi == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            let d = this.cv.by;
            let e = this.cv.bx;
            let f = this.getEffectiveViewport();
            let g = new ScalerParams(0, d, e, this.yr.ch, f);
            let h = ((() => {
                let $ret = new ScalerParams(0, d, e, this.ys.ch, f);
                $ret.b = this.iy();
                return $ret;
            })());
            if (b) {
                let i = this.ir(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.dn.count - 1) {
                    k = this.dn.count - 1;
                }
                if (j > this.dn.count - 1) {
                    j = this.dn.count - 1;
                }
                if (k == j) {
                    return this.yt.h(this.zh.item(j), this.zi.item(j), d, e, f, this.yu.e, this.yu.d, this.yu.g, this.yu.f, this.yu.i, this.yu.h);
                }
                let l = i - Math.floor(i);
                let m = this.yt.h(this.zh.item(j), this.zi.item(j), d, e, f, this.yu.e, this.yu.d, this.yu.g, this.yu.f, this.yu.i, this.yu.h);
                let n = this.yt.h(this.zh.item(k), this.zi.item(k), d, e, f, this.yu.e, this.yu.d, this.yu.g, this.yu.f, this.yu.i, this.yu.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.j3(a);
                if (u == -1) {
                    return { $type: Point_$type, x: NaN, y: NaN };
                }
                return this.yt.h(this.zh.item(u), this.zi.item(u), d, e, f, this.yu.e, this.yu.d, this.yu.g, this.yu.f, this.yu.i, this.yu.h);
            }
        }
        ai() {
            return [this.yr, this.ys];
        }
        kq(a, b) {
            let c = this.nd(b);
            if (c == PolarBase.$$p[3]) {
                return this.kr(a, b, this.aah);
            }
            if (c == PolarBase.$$p[15]) {
                return this.kr(a, b, this.aaz);
            }
            if (c == PolarBase.$$p[5]) {
                return this.kr(a, b, this.aak);
            }
            if (c == PolarBase.$$p[6]) {
                return this.kr(a, b, this.aam);
            }
            return super.kq(a, b);
        }
        md(a) {
            let b = this.nd(a);
            if (b == PolarBase.$$p[3]) {
                return this.aah;
            }
            if (b == PolarBase.$$p[15]) {
                return this.aaz;
            }
            if (b == PolarBase.$$p[5]) {
                return this.aak;
            }
            if (b == PolarBase.$$p[6]) {
                return this.aam;
            }
            return super.md(a);
        }
        q7(a, b, c, d) {
            super.q7(a, b, c, d);
            if (this.yv.c0.g$b(a, b, c, d)) {
                this.rp(false);
                this.qj();
            }
            switch (b) {
                case PolarBase.$$p[1]:
                case PolarBase.$$p[2]:
                case PolarBase.$$p[13]:
                case PolarBase.$$p[14]:
                    this.qd();
                    break;
                case "FastItemsSource":
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.zh);
                        c.deregisterColumn(this.zi);
                        this.zh = null;
                        this.zi = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.zh = this.dk(this.aah);
                        this.zi = this.dk(this.aaz);
                    }
                    if ((this.ys != null && !this.ys.c1()) || (this.yr != null && !this.yr.c1())) {
                        this.rp(this.gg && c != null);
                    }
                    break;
                case PolarBase.$$p[0]:
                    if (this.yr != null && this.ys != null) {
                        this.yt = new PolarAxes(this.ys, this.yr);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    if (this.yr != null && !this.yr.c1()) {
                        this.rp(false);
                    }
                    else if (c != null && d == null) {
                        this.o5(true, this.cv);
                    }
                    break;
                case PolarBase.$$p[12]:
                    if (this.yr != null && this.ys != null) {
                        this.yt = new PolarAxes(this.ys, this.yr);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    if (this.ys != null && !this.ys.c1()) {
                        this.rp(false);
                    }
                    else if (c != null && d == null) {
                        this.o5(true, this.cv);
                    }
                    if (this.yr != null && !this.yr.c1()) {
                        this.yr.h7();
                    }
                    break;
                case PolarBase.$$p[3]:
                    if (this.dn != null) {
                        this.dn.deregisterColumn(this.zh);
                        this.zh = this.dk(this.aah);
                    }
                    break;
                case "AngleColumn":
                    this.yv.c0.g$i();
                    if (this.yr != null && !this.yr.c1()) {
                        this.rp(this.gg && this.d7);
                    }
                    break;
                case PolarBase.$$p[15]:
                    if (this.dn != null) {
                        this.dn.deregisterColumn(this.zi);
                        this.zi = this.dk(this.aaz);
                    }
                    break;
                case "RadiusColumn":
                    this.yv.c0.g$i();
                    if (this.ys != null && !this.ys.c1()) {
                        this.rp(this.gg && this.d7);
                    }
                    break;
                case PolarBase.$$p[16]:
                    this.rp(false);
                    this.qj();
                    break;
                case PolarBase.$$p[11]:
                    this.rp(false);
                    this.qj();
                    break;
                case "TransitionProgress":
                    this.yu = new PolarAxisInfoCache(this.yr, this.ys, this.dn);
                    this.acd = this.cv.by;
                    this.acc = this.cv.bx;
                    this.acb = this.cv.getEffectiveViewport();
                    this.y2.v = this.zx;
                    this.y2.c(this.jq, this.y0, this.yy);
                    if (this.d5(this.cv)) {
                        return;
                    }
                    if (this.jq == 1) {
                        this.abf(this.yy, this.yv);
                        this.qm();
                    }
                    else {
                        this.abf(this.y2, this.yv);
                    }
                    if (this.db != null) {
                        this.db.qo(this);
                    }
                    break;
                case "TrendLineBrush":
                    this.rd(b);
                    break;
                case PolarBase.$$p[4]:
                    this.rp(false);
                    this.qj();
                    break;
                case "TrendLineType":
                    this.qj();
                    break;
                case PolarBase.$$p[8]:
                    this.zk = this.zt();
                    this.rp(false);
                    break;
                case PolarBase.$$p[7]:
                    this.zj = this.zs();
                    this.rp(false);
                    break;
                case PolarBase.$$p[9]:
                    this.y5 = this.y6();
                    break;
            }
        }
        get y5() {
            return this.y4;
        }
        set y5(a) {
            let b = this.y4;
            this.y4 = a;
            if (b != this.y4) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.y4));
            }
        }
        y6() {
            if (this.y7 != 0) {
                return this.y7;
            }
            return this.zr ? 4 : 1;
        }
        get_zr() {
            return false;
        }
        get zr() {
            return this.get_zr();
        }
        zt() {
            return this.zq;
        }
        zs() {
            return this.zp;
        }
        zm(a) {
            if (typeCast(NumericRadiusAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        zl(a) {
            if (typeCast(NumericAngleAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        o5(a, b) {
            super.o5(a, b);
            let c = b;
            if (a) {
                c.c1.clear();
            }
            c.c0.g$d();
        }
        yo(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;
        }
        aa3(a, b, c, d) {
            a.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, b);
            let e = this.dn;
            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.zh.item(f), y: this.zi.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;
                    })()));
                }
            }
        }
        abb(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.zh != null ? this.zh.count : 0, this.zi != null ? this.zi.count : 0);
            if (f < 1) {
                return;
            }
            this.yu = new PolarAxisInfoCache(this.yr, this.ys, this.dn);
            this.yw = a;
            this.acc = d;
            this.acd = c;
            this.acb = b.getEffectiveViewport();
            b.cy.l(a.j, this.z7, c, d, this.id);
            if (f <= this.z7) {
                this.aa3(a, f, c, d);
            }
            let g = this.yo(d, a.n);
            let h = Math.min(this.yr.l4, this.yr.l3);
            let i = Math.max(this.yr.l3, this.yr.l4);
            b.c0.i = this.zx;
            b.c0.h = 0;
            b.c0.k = this.ys.n7;
            b.c0.j = this.ys.n6;
            b.c0.l = (j, k) => this.yt.c(j, k, c, d, e, Math.cos);
            b.c0.m = (j, k) => this.yt.d(j, k, c, d, e, Math.sin);
            let j = new List$1(Number_$type, 0);
            for (let k = 0; k < this.zh.count; k++) {
                if (this.zh.item(k) >= h && this.zh.item(k) <= i) {
                    j.add(this.zh.item(k));
                }
            }
            let l = this.zi;
            if (j.count != this.zh.count) {
                l = new List$1(Number_$type, 0);
                for (let m = 0; m < this.zh.count; m++) {
                    if (this.zh.item(m) >= h && this.zh.item(m) <= i) {
                        l.add(this.zi.item(m));
                    }
                }
            }
            b.c0.n(a.n, this.y9, j, l, this.z8, runOn(this.yr, this.yr.getScaledAngle), runOn(this.ys, this.ys.od), ((() => {
                let $ret = new TrendResolutionParams();
                $ret.d = this.id;
                $ret.i = d;
                $ret.h = e;
                $ret.j = c;
                return $ret;
            })()), g, h, i);
        }
        get_fe() {
            return true;
        }
        zb(a, b, c) {
            return null;
        }
        zc(a, b, c) {
            if (this.dn == null) {
                return null;
            }
            let d = this.yz();
            let e = this.yv.b1(this.v5(b));
            let f = -1;
            if (e == null) {
                if (a != null) {
                    f = this.dn.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;
        }
        za(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dn.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        dg(a, b, c) {
            if (this.ed && this.fz(this.bx) && !c) {
                let d = this.zb(a, b, this.zd);
                this.zd = d;
                return d;
            }
            else {
                let e = this.za(a, b, this.zd);
                this.zd = e;
                return e;
            }
        }
        dh(a, b, c) {
            if (this.fz(this.bx) && !c) {
                let d = this.zc(a, b, this.ze);
                this.ze = d;
                return d;
            }
            else {
                let e = this.za(a, b, this.ze);
                e.d = true;
                this.ze = e;
                return e;
            }
        }
        zv() {
            return (this.assigningPolarStyle != null && this.zk) || (this.bx != 1) || this.d2 || (this.cp != 1) || (this.co != 1);
        }
        zu() {
            return (this.assigningPolarMarkerStyle != null && this.zj) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
        }
        abf(a, b) {
            this.qv();
            let c = b.by;
            let d = b.bx;
            let e = this.getEffectiveViewport1(b);
            let f = this.wh(b);
            this.yu = new PolarAxisInfoCache(this.yr, this.ys, this.dn);
            if (this.xe()) {
                b.cy.j(a.j, this.xg);
                if (this.zu()) {
                    this.aa5(b, a);
                }
            }
            b.cr();
            let g = this.yo(d, b.c0.g$j.an);
            b.c0.g$h(a.n, g);
            this.aa2(d, c, e, f, b);
        }
        yl(a, b) {
            return this.ym(a, b);
        }
        ym(a, b) {
            if (b < a || a < 0 || a > this.zh.count || b < 0 || b > this.zh.count) {
                return null;
            }
            let c = new Array((b - a) + 1);
            for (let d = a; d <= b; d++) {
                let e = d;
                c[d - a] = this.dn.item(d);
            }
            return c;
        }
        aa5(a, b) {
            a.b7 = true;
            this.y3.ay(this, this.zu(), runOn(this, this.yl));
            let c = this.y3.d;
            let d = c != null;
            let e = this.getEffectiveViewport1(a);
            let f = this.dn == null ? 0 : this.dn.count;
            this.yv.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.aa9(h, f, a.q);
                    }
                    this.y3.ac(g, i);
                }
            });
        }
        aba(a, b, c) {
            let d = this.bx != 1;
            let e = this.cp != 1;
            let f = this.co != 1;
            this.y3.a0(this.y3.b, a, b, false);
            this.y3.ab(this.ib);
            let g = this.y3.ax;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dn;
            if (d && this.db != null) {
                h = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, false);
                g.c = h;
            }
            if (e && this.db != null) {
                i = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, false);
                if (i == null && this.bn != null) {
                    i = this.db.dm.getHighlightingInfo(this.bn, this.bn.dn, g.z, g.y, false);
                }
                g.d = i;
            }
            if (f && this.db != null) {
                j = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, false);
                g.b = j;
            }
            g.h = c;
            this.abd(g);
            this.y3.z(this, h, i, j, c, d, e, f, a < 0);
        }
        aa9(a, b, c) {
            let d = this.bx != 1;
            let e = this.cp != 1;
            let f = this.co != 1;
            this.y3.a0(this.y3.d, a, b, true);
            this.y3.aa(this.ib);
            let g = this.y3.aw;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dn;
            let l = null;
            let m = null;
            let n = null;
            if (d && this.db != null) {
                h = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.db.dl.isCrossContextHighlight(this)) {
                    l = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.c = h;
            }
            if (e && this.db != null) {
                i = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, true);
                if (i == null && this.bn != null) {
                    i = this.db.dm.getHighlightingInfo(this.bn, this.bn.dn, g.z, g.y, true);
                }
                if (this.db.dm.isCrossContextHighlight(this)) {
                    m = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            if (f && this.db != null) {
                j = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.db.dk.isCrossContextHighlight(this)) {
                    n = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            g.h = c;
            this.abc(g);
            this.y3.y(this, h, i, j, c, d, e, f, g.v, this.db.dl.totalHighWaterMark, g.x, this.db.dm.totalHighWaterMark, g.t, this.db.dk.totalHighWaterMark);
        }
        abd(a) {
            if (this.assigningPolarStyle != null && this.zk) {
                this.assigningPolarStyle(this, a);
            }
        }
        abc(a) {
            if (this.assigningPolarMarkerStyle != null && this.zj) {
                this.assigningPolarMarkerStyle(this, a);
            }
        }
        aa2(a, b, c, d, e) {
            e.c3(a, b, c, d);
        }
        sf() {
            super.sf();
            if (this.index < 0) {
                return;
            }
            this.yv.c6();
        }
        rr(a, b) {
            super.rr(a, b);
            if (!this.g0) {
                this.cv.a4(b);
                return;
            }
            this.cv.a4(b);
            if (this.d5(this.cu)) {
                return;
            }
            let c = this.cu;
            if (!this.gs) {
                this.y1 = new PolarFrame();
                this.abb(this.y1, c);
            }
            this.gs = false;
            this.abf(this.y1, c);
            this.g0 = false;
        }
        ro(a, b, c, d, e) {
            super.ro(a, b, c, d, e);
            let f = this.ba.a$j.item(d);
            let g = f;
            f.a3(c);
            if (this.d5(g)) {
                return;
            }
            if (this.yx == null) {
                this.yx = new PolarFrame();
            }
            this.abb(this.yx, g);
            this.abf(this.yx, g);
        }
        abe(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);
            }
        }
        yk(a, b, c) {
            this.aa6();
            return this.yw.w.toArray();
        }
        zz(a) {
            let b = new List$1(Number_$type, 0);
            let c = this.dn;
            for (let d of fromEnum(this.yv.c1.c)) {
                b.add(c.indexOf(d));
            }
            return b;
        }
        ab9(a) {
            return { $type: Point_$type, x: this.zh.item(a), y: this.zi.item(a) };
        }
        px(a) {
            super.px(a);
            this.bc.exportTrendlineData(this, a, this.yv.c0.g$j);
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.kn(c);
            let e = d == null ? NaN : this.ix(d, "RadiusMemberPath");
            let f = d == null ? NaN : this.ix(d, "AngleMemberPath");
            let g = new DataLegendSeriesValueInfo();
            g.l = e;
            g.a = 11;
            g.r = this.aaz != null ? this.aaz : "Radius";
            g.q = "Radius";
            g.s = this.aav != null ? this.aav : "R:";
            g.t = this.aax != null ? this.aax : "";
            let h = new DataLegendSeriesValueInfo();
            h.l = f;
            h.a = 10;
            h.r = this.aah != null ? this.aah : "Angle";
            h.q = "Angle";
            h.s = this.aad != null ? this.aad : "A:";
            h.t = this.aaf != null ? this.aaf : "";
            let i = new DataLegendSeriesContext();
            i.e = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(g);
                $ret.add(h);
                return $ret;
            })());
            i.h = this.mc();
            return i;
        }
        ak(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            this.p2(a, c, b);
            return c.toArray();
        }
        p2(a, b, c) {
            let d = this.cv.by;
            let e = this.cv.bx;
            let f = this.getEffectiveViewport1(this.cv);
            let g = this.wh(this.cv);
            let h = new CollisionRect(0, a);
            let i = this.ys.k5(e, d, f, g);
            for (let j = 0; j < this.dn.count; j++) {
                let k = this.yr.getScaledAngle(this.zh.item(j));
                let l = this.ys.od(this.zi.item(j));
                let m = this.yt.c(k, l, d, e, f, Math.cos);
                let n = this.yt.d(k, l, d, e, f, Math.sin);
                if (h.containsLocation(m, n)) {
                    if (c == 7 || c == 6) {
                        b.add(((() => {
                            let $ret = new ChartSelection();
                            $ret.series = this;
                            return $ret;
                        })()));
                        return;
                    }
                    else if (c == 2 || c == 1) {
                        b.add(((() => {
                            let $ret = new ChartSelection();
                            $ret.item = this.dn.item(j);
                            return $ret;
                        })()));
                    }
                    else {
                        b.add(((() => {
                            let $ret = new ChartSelection();
                            $ret.item = this.dn.item(j);
                            $ret.series = this;
                            return $ret;
                        })()));
                    }
                }
            }
        }
    }
    PolarBase.$t = /*@__PURE__*/ markType(PolarBase, 'PolarBase', MarkerSeries.$);
    PolarBase.abg = /*@__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:yr:abh', [NumericAngleAxis.$, null], 'AngleMemberAsLegendLabel:aad:abi', [2, null], 'AngleMemberAsLegendUnit:aaf:abj', [2, null], 'AngleMemberPath:aah:abk', [2], 'ClipSeriesToBounds:zn:abl', [0, false], 'HighlightedAngleMemberPath:aak:abm', [2, null], 'HighlightedRadiusMemberPath:aam:abn', [2, null], 'IsCustomPolarMarkerStyleAllowed:zp:abo', [0, false], 'IsCustomPolarStyleAllowed:zq:abp', [0, false], 'ItemSearchMode:y7:abq', [ScatterItemSearchMode_$type, /*@__PURE__*/ enumGetBox(ScatterItemSearchMode_$type, 0)], 'ItemSearchThreshold:z6:abr', [1, 10000], 'MaximumMarkers:z7:abs', [1, 400], 'RadiusAxis:ys:abt', [NumericRadiusAxis.$, null], 'RadiusMemberAsLegendLabel:aav:abu', [2, null], 'RadiusMemberAsLegendUnit:aax:abv', [2, null], 'RadiusMemberPath:aaz:abw', [2], 'UseCartesianInterpolation:zx:ab4', [0, true], 'TrendLineType:y9:ab2', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness:z5:ab1', [1, 1.5], 'TrendLinePeriod:z8:ab0', [1, 7], 'TrendLineZIndex:z9:ab3', [1, 1], 'TrendLineBrush:ab6:abx', [Brush.$, null], 'TrendLineDashArray:ab7:aby', [DoubleCollection.$], 'TrendLineDashCap:ab8:abz', [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.z7 = 1000;
                this.b4.w8 = Defaults.e;
            }
        }
        c4(a) {
            this.c1.g(a);
        }
        cx() {
            let a = new NumericMarkerManager(0, (b) => this.c1.item(b), (b) => this.cz.yu.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.ab9);
            return a;
        }
        c5(a) {
            this.cz.abe(a, this.c1);
        }
        cw() {
            return this.cz.yk(this.c1, this.by, this.bx);
        }
        c2() {
            return this.cz.zz(this.c1);
        }
        c3(a, b, c, d) {
            if (this.cz.zn) {
                let e = new GeometryGroup();
                this.cz.ys.ol(e, a, b, c, d);
            }
            else {
            }
        }
        c6() {
            if (this.cz.ab6 != null) {
                this.cz.ab5 = this.cz.ab6;
            }
            else {
                this.cz.ab5 = this.cz.u7;
            }
        }
        cj(a) {
            this.c1.f(a);
        }
        a7(a, b) {
            if (a.d) {
                if (this.cz.y9 != 0 && !b) {
                    let c = this.c0.g$j;
                    c.ad = this.cz.z5;
                    c._stroke = this.cz.ab5;
                    c.aj = this.cz.ab8;
                    c.ai = this.cz.ab7;
                    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.aah + "}" + "</span><br/><span";
            let b = this.e.ba.a$u(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            a += ">" + this.cz.title + ": </span><span class='ui-priority-primary'>" + "${item." + this.cz.aaz + "}</span></div>";
            return a;
        }
    }
    PolarBaseView.$t = /*@__PURE__*/ markType(PolarBaseView, 'PolarBaseView', MarkerSeriesView.$);
    return PolarBaseView;
})();
