/*
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 { AxisLabelPanelBase } from "./AxisLabelPanelBase";
import { Boolean_$type, typeCast, markType, Point_$type, typeGetValue, fromEnum, runOn, Number_$type, enumGetBox, markDep } from "igniteui-angular-core";
import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView";
import { Rect } from "igniteui-angular-core";
import { Extensions } from "igniteui-angular-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-angular-core";
import { AxisAngleLabelMode_$type } from "./AxisAngleLabelMode";
import { LabelPosition } from "./LabelPosition";
import { XamDataChart } from "./XamDataChart";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { IAngleScaler_$type } from "./IAngleScaler";
import { CategoryAxisRenderer } from "./CategoryAxisRenderer";
import { DependencyProperty } from "igniteui-angular-core";
import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager";
import { AxisLabelManager } from "./AxisLabelManager";
import { ViewportUtils } from "./ViewportUtils";
import { GeometryUtil } from "igniteui-angular-core";
import { RadialAxisRenderingParameters } from "./RadialAxisRenderingParameters";
import { CategoryTickmarkValues } from "./CategoryTickmarkValues";
import { SeriesViewer } from "./SeriesViewer";
import { ScalerParams } from "./ScalerParams";
import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs";
import { LineGeometry } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { RangeInfo } from "./RangeInfo";
import { isNaN_, isInfinity } from "igniteui-angular-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters";
import { MathUtil } from "igniteui-angular-core";
import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters";
import { PathGeometry } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { ArcSegment } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { CategoryAxisBaseView } from "./CategoryAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
export let AngleAxisLabelPanel = /*@__PURE__*/ (() => {
    class AngleAxisLabelPanel extends AxisLabelPanelBase {
        constructor() {
            super();
            this.dd = false;
            this.dl = null;
            this.di = 0;
            this.df = 0;
            this.dh = 0;
            this.dg = 0;
            this.de = 0;
        }
        ae() {
            return new AngleAxisLabelPanelView(this);
        }
        ck(a) {
            super.ck(a);
            this.dc = a;
        }
        au(a, b) {
            if (!Extensions.b(b)) {
                return false;
            }
            if (this.ad == null || this.ad.n1.isEmpty) {
                return super.au(a, b);
            }
            return true;
        }
        a8() {
            let a = new List$1(Rect.$, 0);
            let b = new List$1(Boolean_$type, 0);
            if (this.be.count != this.bd.count) {
                return a;
            }
            let c = 1;
            if (typeCast(CategoryAngleAxis.$, this.ad) !== null) {
                c = this.ad.p8();
            }
            else if (typeCast(NumericAngleAxis.$, this.ad) !== null) {
                c = this.ad.r5();
            }
            if (c == 2) {
                this.dc.a0(a, b);
            }
            else {
                this.dc.a1(a, b);
            }
            let d = false;
            this.ao = this.an(a, b);
            if (!this.ad.c4()) {
                d = true;
                switch (c) {
                    case 1:
                        this.dn();
                        break;
                    case 2:
                        this.dm();
                        break;
                }
            }
            else {
                d = true;
                this.dc.ac();
            }
            if (d) {
                for (let e = 0; e < a.count; e++) {
                    let f = this.be._inner[e];
                    let g = this.bd._inner[e];
                    let h = a._inner[e];
                    let i = this.dl(g.c, h.width, h.height);
                    let j = i.x - this.bn(f) / 2;
                    let k = i.y - this.bm(f) / 2;
                    h.x = j;
                    h.y = k;
                    a._inner[e] = h;
                }
            }
            return a;
        }
        dn() {
            this.bk = this.di / 2;
            this.bk = this.bk + this.dj();
        }
        dm() {
            this.bk = 5;
            this.bk = this.bk + this.dk();
        }
        dk() {
            let a;
            let b;
            b = this.ad;
            a = null;
            if (b != null) {
                a = typeCast(XamDataChart.$, b.b0);
            }
            if (a == null || b == null) {
                return 0;
            }
            let c = new List$1(Axis.$, 0);
            for (let d = 0; d < a.axes.count; d++) {
                let e = a.axes._inner[d];
                if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a0) !== null && e.a0.be.count > 0 && (!e.c4()) && !e.cv() && (e.am == null || this.ad.am == null || e.am.sb == b.am.sb)) {
                    c.add(e);
                }
            }
            let f = c.indexOf(b);
            if (f == -1) {
                return 0;
            }
            let g = 0;
            if (f > 0) {
                if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
                    let h = c._inner[f - 1];
                    if (h.p7 == 2) {
                        g += h.a0.de;
                    }
                    else {
                        g += c._inner[f - 1].a0.bk;
                    }
                }
                else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                    let i = c._inner[f - 1];
                    if (i.p7 == 2) {
                        g += i.a0.de;
                    }
                    else {
                        g += c._inner[f - 1].a0.bk;
                    }
                }
            }
            return g;
        }
        dj() {
            let a;
            let b;
            b = this.ad;
            a = null;
            if (b != null) {
                a = typeCast(XamDataChart.$, b.b0);
            }
            if (a == null || b == null) {
                return 0;
            }
            let c = new List$1(Axis.$, 0);
            for (let d = 0; d < a.axes.count; d++) {
                let e = a.axes._inner[d];
                if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a0) !== null && e.a0.be.count > 0 && (!e.c4()) && !e.cv() && (e.am == null || this.ad.am == null || e.am.sb == b.am.sb)) {
                    c.add(e);
                }
            }
            let f = c.indexOf(b);
            if (f == -1) {
                return 0;
            }
            let g = 0;
            let h = 5;
            if (f == 0) {
                g += h;
            }
            else {
                if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
                    let i = c._inner[f - 1];
                    if (i.p7 == 2) {
                        g += i.a0.de;
                    }
                    else {
                        g += c._inner[f - 1].a0.bk;
                    }
                }
                else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                    let j = c._inner[f - 1];
                    if (j.r4 == 2) {
                        g += j.a0.de;
                    }
                    else {
                        g += c._inner[f - 1].a0.bk;
                    }
                }
                g += c._inner[f].a0.bk * 2 + h;
            }
            return g;
        }
        ai() {
            return 4;
        }
        a1(a) {
            return a == 4 || a == 5;
        }
    }
    AngleAxisLabelPanel.$t = markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$);
    return AngleAxisLabelPanel;
})();
/**
 * @hidden
 */
export let CategoryAngleAxis = /*@__PURE__*/ (() => {
    class CategoryAngleAxis extends CategoryAxisBase {
        constructor() {
            super();
            this.qf = null;
            this.qc = null;
            this.qg = false;
            this.qn = NaN;
            this.qd = null;
            this.qo = 0;
            this.ql = 0;
            this.qm = 0;
            this.q1 = 1;
            this.ab = CategoryAngleAxis.$;
            this.qc = this.qb();
            this.qf = new PolarAxisRenderingManager();
        }
        bm() {
            return new CategoryAngleAxisView(this);
        }
        kb(a) {
            super.kb(a);
            this.qa = a;
        }
        ak() {
            return new CategoryAngleAxis();
        }
        jr(a) {
            super.jr(a);
            this.ju(a, "ActualMinorInterval");
            this.ju(a, "StartAngleOffset");
            this.ju(a, "LabelMode");
        }
        ju(a, b) {
            super.ju(a, b);
            let c = typeCast(CategoryAngleAxis.$, a);
            if (c == null) {
                return;
            }
            if (b == "ActualMinorInterval") {
                c.qy = this.qq;
            }
            if (b == "StartAngleOffset") {
                c.q0 = this.q0;
            }
            if (b == "LabelMode") {
                c.p7 = this.p7;
            }
        }
        get_c5() {
            return true;
        }
        az() {
            let a = new AngleAxisLabelPanel();
            a.dl = (b, c, d) => {
                let e = this.b0 != null ? this.b0.xm : Rect.empty;
                let f = !e.isEmpty ? this.n1 : Rect.empty;
                let g = this.nw();
                switch (this.p7) {
                    case 2: return this.ri(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a0.bk);
                    case 0:
                    case 1:
                    default: return this.rj(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a0.bk);
                }
            };
            return a;
        }
        qj(a) {
            return false;
        }
        q6() {
            return null;
        }
        qz(a) {
            return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
        }
        qb() {
            let a = ((() => {
                let $ret = new AxisLabelManager();
                $ret.a = this;
                $ret.f = this.eg;
                $ret.e = this.ef;
                $ret.b = this.a0;
                return $ret;
            })());
            if (this.a3 != null) {
                this.a3.registerAxis(this);
            }
            let b = new CategoryAxisRenderer(a);
            b.u = () => {
                let c = this.bn.a4();
                let d = this.bn.a7();
                let e = this.bn.a5();
                let f = this.bn.a6();
                this.lf();
                this.jp(c);
                this.jp(d);
                this.jp(e);
                this.jp(f);
            };
            b.o = (c, d) => !d.isEmpty && !c.isEmpty && this.qe != null;
            b.d = (c, d, e, f) => this.p9(c, d, e, f);
            b.v = () => {
                if (!this.qg) {
                    this.qg = true;
                    this.qe.d2();
                    this.qg = false;
                }
            };
            b.g = (c, d) => {
                let e = typeGetValue(c);
                if (e == this.o5 - 1) {
                    if (this.dj) {
                        if (this.qj(e)) {
                            return this.q6();
                        }
                    }
                }
                if (e > this.o5 - 1) {
                    e -= this.o5;
                }
                if (this.qk(e)) {
                    return null;
                }
                let f = this.oh.item(e);
                return this.hf(f);
            };
            b.b.c = (c) => {
                if ((this.a3 == null || this.a3.visibility == 0) && this.qe != null && this.qn != c) {
                    let d = typeCast(XamDataChart.$, this.b0);
                    if (d == null) {
                        return;
                    }
                    this.qn = c;
                    this.a0.bj = c;
                    d.o1();
                    for (let e of fromEnum(d.axes)) {
                        if (e != this && typeCast(AngleAxisLabelPanel.$, e.a0) !== null) {
                            e.bn.ai();
                        }
                    }
                }
            };
            b.k = (c, d, e) => {
                let f = typeCast(RadialAxisRenderingParameters.$, c);
                this.qf.o(d, e, c.aa, c.z, c.ab, f.minLength, f.maxLength, f.center);
            };
            b.l = (c, d, e, f) => {
                let g = typeCast(RadialAxisRenderingParameters.$, c);
                this.qf.p(d, e, f, g.aa, g.z, c.ab, g.minLength, g.maxLength, g.center);
            };
            b.m = (c, d) => this.getScaledAngle(d);
            b.q = (c, d) => {
                if (this.qz(d - this.qo) < 0) {
                    return false;
                }
                if (this.qz(d - this.qo - (2 * Math.PI)) > 0) {
                    return false;
                }
                return true;
            };
            b.j = (c) => {
                let d = typeCast(RadialAxisRenderingParameters.$, c);
                if (d.e == d.k._inner[0]) {
                    this.qf.k(c.u, c.n, c.aa, c.z, c.ab, d.center, d.minAngle, d.maxAngle);
                }
            };
            b.e = (c) => {
                c.n = this.qr();
                c.r = c.n;
            };
            b.p = (c, d, e) => {
                let f = typeCast(RadialAxisRenderingParameters.$, c);
                if (e) {
                    return false;
                }
                let g = this.rj(d, f.center, c.ab, c.aa, c.z, 0);
                if (g.x < c.aa.right && g.x >= c.aa.left && g.y < c.aa.bottom && g.y >= c.aa.top) {
                    return true;
                }
                return false;
            };
            b.a = (c, d, e, f) => {
                let g = c.z;
                let h = new ScalerParams(0, c.ab, c.aa, this.df, g);
                let i = d;
                if (this.categoryMode != 0) {
                    let j = (e * f) + 1;
                    j = Math.min(j, this.o5);
                    let k = this.ft(j, h);
                    i = (d + k) / 2;
                }
                return i;
            };
            b.f = runOn(this, this.getGroupCenter);
            b.i = runOn(this, this.qw);
            return b;
        }
        qk(a) {
            return false;
        }
        rj(a, b, c, d, e, f) {
            let g = this.qr();
            let h = ViewportUtils.a(f, c, d, e);
            if (this.a3 != null && (this.a3.c == 5 || this.a3.c == 1)) {
                h *= -1;
            }
            let i = b.x + (g + h) * Math.cos(a);
            let j = b.y + (g + h) * Math.sin(a);
            i = ViewportUtils.e(i, c, d, e);
            j = ViewportUtils.i(j, c, d, e);
            return { $type: Point_$type, x: i, y: j };
        }
        ri(a, b, c, d, e, f, g, h) {
            if (!isNaN_(b) && !isNaN_(c)) {
                let i = this.qr();
                let j = b / f.width;
                let k = c / f.width;
                let l = ViewportUtils.a(h, e, f, g);
                let m = GeometryUtil.l(i, a, j, k);
                let n = d.x + (m + l) * Math.cos(a);
                let o = d.y + (m + l) * Math.sin(a);
                n = ViewportUtils.e(n, e, f, g);
                o = ViewportUtils.i(o, e, f, g);
                return { $type: Point_$type, x: n, y: o };
            }
            else {
                return this.rj(a, d, e, f, g, h);
            }
        }
        qr() {
            if (this.qe == null) {
                return 0;
            }
            if (!this.cv()) {
                return this.qe.sg();
            }
            else {
                return this.qe.sh((this.ha));
            }
        }
        p9(a, b, c, d) {
            if (this.oh == null) {
                return null;
            }
            let e = new RadialAxisRenderingParameters();
            let f = this.o6 - 1;
            let g = this.bn.a4();
            let h = this.bn.a7();
            let i = this.bn.a5();
            let j = this.bn.a6();
            e.u = g;
            e.x = h;
            e.v = i;
            e.w = j;
            e.l = f;
            e.m = 0;
            e.h = false;
            e.aa = a;
            e.z = c;
            e.y = d;
            e.ab = b;
            e.g = this.qi();
            e.p = this.qx;
            e.o = this.f9();
            e.s = this.q3();
            e.q = this.qy;
            e.t = this.hg;
            let k = this.qf.h(b, a, c);
            let l = this.qf.i(b, a, c);
            let m = 0.5 * this.qe.sb;
            let n = 0.5 * this.qe.sa;
            let o = k;
            let p = l;
            let q = this.qe.sg();
            if (isNaN_(q) || isInfinity(q)) {
                return null;
            }
            if (p >= m) {
                p = q;
            }
            if (o < n) {
                o = n;
            }
            let r = a.width;
            this.qf.m(b, a, c, e, 0, this.o6, this.df, runOn(this, this.getUnscaledAngle), r);
            let s = { $type: Point_$type, x: 0.5, y: 0.5 };
            e.center = s;
            e.maxLength = p;
            e.minLength = o;
            e.effectiveMaximum = q;
            e.af = this.o6;
            e.ac = this.categoryMode;
            e.ae = true;
            e.ad = this.df;
            e.ag = this.o7;
            e.f = new CategoryTickmarkValues();
            e.j = this.dz;
            return e;
        }
        q3() {
            return -1;
        }
        getMinMaxAngle(a, b, c, d, e) {
            let f = this.qf.n(a, b, c, d, e);
            d = f.p3;
            e = f.p4;
            return {
                p3: d,
                p4: e
            };
        }
        ac() {
            super.ac();
            this.k3(false);
        }
        get qe() {
            if (this.qd != null) {
                return this.qd;
            }
            let a = typeCast(XamDataChart.$, this.b0);
            if (a != null) {
                for (let b = 0; b < a.axes.count; b++) {
                    if (typeCast(NumericRadiusAxis.$, a.axes._inner[b]) !== null) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.qd;
        }
        set qe(a) {
            this.qd = a;
        }
        ao() {
            return this.qe;
        }
        p8() {
            if (this.p7 == 0) {
                return 1;
            }
            else {
                return this.p7;
            }
        }
        getCategorySize(a, b, c) {
            return 2 * Math.PI / this.o5;
        }
        get_qh() {
            return false;
        }
        get qh() {
            return this.get_qh();
        }
        qt(a, b, c, d) {
            return this.ou(b, c, d);
        }
        ou(a, b, c) {
            let d = this.o1(a, b, c);
            let e = 0;
            if (!isNaN_(this.o0)) {
                e = Math.min(this.o0, 1);
            }
            let f = 1 - 0.5 * d;
            return this.getCategorySize(a, b, c) * f / (this.o7 - (this.o7 - 1) * e);
        }
        qs(a, b, c, d, e) {
            return this.getGroupCenter(b, c, d, e);
        }
        getGroupCenter(a, b, c, d) {
            let e = 0.5;
            if (this.o7 > 1) {
                let f = this.o1(b, c, d);
                let g = 0;
                if (!isNaN_(this.o0)) {
                    g = Math.min(this.o0, 1);
                }
                let h = 1 - 0.5 * f;
                let i = h / (this.o7 - (this.o7 - 1) * g);
                let j = (h - i) / (this.o7 - 1);
                e = 0.25 * f + 0.5 * i + a * j;
            }
            return this.getCategorySize(b, c, d) * e;
        }
        qw(a) {
            let b = 0.5;
            if (this.o7 > 1) {
                let c = this.o1(Rect.empty, Rect.empty, Rect.empty);
                let d = 0;
                if (!isNaN_(this.o0)) {
                    d = Math.min(this.o0, 1);
                }
                let e = 1 - 0.5 * c;
                let f = e / (this.o7 - (this.o7 - 1) * d);
                let g = (e - f) / (this.o7 - 1);
                b = 0.25 * c + 0.5 * f + a * g;
            }
            return b;
        }
        k4(a) {
            super.k4(a);
            let b = this.b0 != null ? this.b0.xm : Rect.empty;
            let c = !b.isEmpty ? this.n1 : Rect.empty;
            let d = this.nw();
            let e = this.nv();
            let f = this.qc.c(a, c, b, d, e);
            if (f != null) {
                this.qp = f.f.m;
                this.qq = f.f.l;
            }
        }
        qv(a, b, c) {
            let d;
            let e;
            let f = this.qf.n(c, a, b, d, e);
            d = f.p3;
            e = f.p4;
            if (d == 0) {
                if (this.df) {
                    return this.o5;
                }
                else {
                    return 0;
                }
            }
            let g = this.getUnscaledAngle(d);
            if (g < 0 || g > this.o5) {
                g = this.getUnscaledAngle(d + Math.PI * 2);
            }
            return g;
        }
        qu(a, b, c) {
            let d;
            let e;
            let f = this.qf.n(c, a, b, d, e);
            d = f.p3;
            e = f.p4;
            if (e > Math.PI * 2) {
                e = e - Math.PI * 2;
            }
            if (e == Math.PI * 2) {
                if (this.df) {
                    return 0;
                }
                else {
                    return this.o5;
                }
            }
            let g = this.getUnscaledAngle(e);
            if (g < 0 || g > this.o5) {
                g = this.getUnscaledAngle(e + Math.PI * 2);
            }
            return g;
        }
        getScaledAngle(a) {
            let b = this.o5;
            let c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
            if (this.dg) {
                c = 1 - c;
            }
            return (c * 2 * Math.PI) + this.qo;
        }
        getUnscaledAngle(a) {
            if (a < this.qo) {
                a += 2 * Math.PI;
            }
            let b = (a - this.qo) / (2 * Math.PI);
            if (this.df) {
                b = 1 - b;
            }
            return b * (this.o5);
        }
        ft(a, b) {
            return this.getScaledAngle(a);
        }
        fw(a, b) {
            return this.getUnscaledAngle(a);
        }
        fd(a) {
            let b = { $type: Point_$type, x: 0.5, y: 0.5 };
            let c = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
            let d = Math.acos((a.x - b.x) / c);
            if ((a.y - b.y) < 0) {
                d = (2 * Math.PI) - d;
            }
            return d;
        }
        kf(a, b, c, d) {
            super.kf(a, b, c, d);
            let e = typeCast(XamDataChart.$, this.b0);
            switch (b) {
                case "CrossingAxis":
                    let f = typeCast(NumericRadiusAxis.$, d);
                    this.rd(f);
                    if (f != null) {
                        f.sq(this);
                    }
                    this.dr = true;
                    this.k3(false);
                    break;
                case CategoryAngleAxis.$$p[1]:
                    this.qo = this.q0;
                    while (this.qo < 0) {
                        this.qo += 360;
                    }
                    while (this.qo >= 360) {
                        this.qo -= 360;
                    }
                    this.qo = (this.qo * Math.PI) / 180;
                    this.dr = true;
                    this.k3(false);
                    for (let g of fromEnum(this.eh)) {
                        g.ry(false);
                        g.qr();
                    }
                    break;
                case "Label":
                case CategoryAngleAxis.$$p[0]:
                    if (e != null) {
                        for (let h of fromEnum(e.axes)) {
                            h.dr = true;
                            h.k2();
                        }
                    }
                    break;
                case "CrossingValue":
                    if (e != null) {
                        for (let i of fromEnum(e.axes)) {
                            if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
                                i.dr = true;
                                i.k2();
                            }
                        }
                    }
                    break;
                case "LabelSettings":
                    this.qc = this.qb();
                    this.rb();
                    this.dr = true;
                    this.k3(false);
                    break;
            }
        }
        rb() {
            this.qn = NaN;
        }
        rd(a) {
            this.qe = a;
        }
        get qx() {
            return this.c(CategoryAngleAxis.re);
        }
        set qx(a) {
            this.h(CategoryAngleAxis.re, a);
        }
        get qp() {
            return this.ql;
        }
        set qp(a) {
            if (this.qp != a) {
                let b = this.ql;
                this.ql = a;
                this.kx("ActualInterval", b, this.qp);
            }
        }
        f5() {
            return this.qp;
        }
        get qy() {
            return this.c(CategoryAngleAxis.rg);
        }
        set qy(a) {
            this.h(CategoryAngleAxis.rg, a);
        }
        get qq() {
            return this.qm;
        }
        set qq(a) {
            if (this.qq != a) {
                let b = this.qm;
                this.qm = a;
                this.kx("ActualMinorInterval", b, this.qq);
            }
        }
        qi() {
            return !isNaN_(this.qx);
        }
        get_bk() {
            return 2;
        }
        get bk() {
            return this.get_bk();
        }
        d4() {
            if (this.dr && this.d5) {
                this.bu = this.bt();
            }
            if (this.oh == null) {
                return false;
            }
            let a = this.oh.count;
            if (a != this.q2) {
                let b = new AxisRangeChangedEventArgs(0, 1, 1, this.q2, a);
                this.q2 = a;
                this.ky(b);
                return true;
            }
            return false;
        }
        get q2() {
            return this.q1;
        }
        set q2(a) {
            this.q1 = a;
        }
        ns(a, b, c, d, e) {
            let f = typeCast(RadialAxisRenderingParameters.$, this.qc.d(c, b, d, e));
            if (f == null) {
                return null;
            }
            let g = Math.cos(a);
            let h = Math.sin(a);
            let i = f.center.x + g * f.minLength;
            let j = f.center.y + h * f.minLength;
            let k = f.center.x + g * f.maxLength;
            let l = f.center.y + h * f.maxLength;
            i = ViewportUtils.e(i, b, c, d);
            j = ViewportUtils.i(j, b, c, d);
            k = ViewportUtils.e(k, b, c, d);
            l = ViewportUtils.i(l, b, c, d);
            let m = new LineGeometry();
            m.d = { $type: Point_$type, x: i, y: j };
            m.c = { $type: Point_$type, x: k, y: l };
            return m;
        }
        get isVertical() {
            return this.dq;
        }
        j$d(a, b) {
            return this.fw.apply(this, arguments);
        }
        j$c(a, b) {
            return this.ft.apply(this, arguments);
        }
        j$e(a, b, c, d, e) {
            this.j5.apply(this, arguments);
        }
        j$f(a, b, c, d) {
            this.j6.apply(this, arguments);
        }
        j$g(a, b, c, d) {
            this.j7.apply(this, arguments);
        }
        get j$b() {
            return this.df;
        }
        j$a() {
            return this.ag.apply(this, arguments);
        }
    }
    CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
    CategoryAngleAxis.re = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, (a, b) => {
        a.kx("Interval", b.oldValue, b.newValue);
        a.k3(false);
    }));
    CategoryAngleAxis.rg = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, (a, b) => {
        (typeCast(CategoryAngleAxis.$, a)).kx("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryAngleAxis.$, a)).k3(false);
    }));
    CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'kx', ['LabelMode:p7:rf', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:q0:rh', [1, 0]]);
    return CategoryAngleAxis;
})();
/**
 * @hidden
 */
export let NumericAngleAxis = /*@__PURE__*/ (() => {
    class NumericAngleAxis extends NumericAxisBase {
        constructor() {
            super();
            this.r9 = null;
            this.sa = false;
            this.sb = NaN;
            this.sc = 0;
            this.r7 = null;
            this.ab = NumericAngleAxis.$;
            this.r9 = new PolarAxisRenderingManager();
            this.oq = this.oo();
        }
        bm() {
            return new NumericAngleAxisView(this);
        }
        kb(a) {
            super.kb(a);
            this.r6 = a;
        }
        ak() {
            return new NumericAngleAxis();
        }
        jr(a) {
            super.jr(a);
            this.ju(a, "LabelMode");
            this.ju(a, "StartAngleOffset");
        }
        ju(a, b) {
            super.ju(a, b);
            let c = typeCast(NumericAngleAxis.$, a);
            if (c == null) {
                return;
            }
            let d = this;
            if (b == "LabelMode") {
                c.r4 = d.r4;
            }
            if (b == "StartAngleOffset") {
                c.sg = d.sg;
            }
        }
        get_c5() {
            return true;
        }
        az() {
            let a = new AngleAxisLabelPanel();
            a.dl = (b, c, d) => {
                let e = this.b0 != null ? this.b0.xm : Rect.empty;
                let f = !e.isEmpty ? this.n1 : Rect.empty;
                let g = this.nw();
                return this.so(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a0.bk);
            };
            return a;
        }
        sd() {
            if (this.r8 == null) {
                return 0;
            }
            if (!this.cv()) {
                return this.r8.sg();
            }
            else {
                return this.r8.sh((this.ha));
            }
        }
        sf(a) {
            return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
        }
        oo() {
            let a = super.oo();
            a.b.c = (b) => {
                if ((this.a3 == null || this.a3.visibility == 0) && this.r8 != null && this.sb != b) {
                    let c = typeCast(XamDataChart.$, this.b0);
                    if (c == null) {
                        return;
                    }
                    this.sb = b;
                    this.a0.bj = b;
                    c.o1();
                    for (let d of fromEnum(c.axes)) {
                        if (d != this && typeCast(AngleAxisLabelPanel.$, d.a0) !== null) {
                            d.bn.ai();
                        }
                    }
                }
            };
            a.e = (b) => {
                b.n = this.sd();
                b.r = b.n;
            };
            a.j = (b) => {
                let c = typeCast(PolarAxisRenderingParameters.$, b);
                if (c.e == c.k._inner[0]) {
                    this.r9.k(b.u, b.n, b.aa, b.z, b.ab, c.center, c.minAngle, c.maxAngle);
                }
            };
            a.k = (b, c, d) => {
                let e = typeCast(PolarAxisRenderingParameters.$, b);
                this.r9.o(c, d, b.aa, b.z, b.ab, e.minLength, e.maxLength, e.center);
            };
            a.l = (b, c, d, e) => {
                let f = typeCast(PolarAxisRenderingParameters.$, b);
                this.r9.p(c, d, e, f.aa, f.z, b.ab, f.minLength, f.maxLength, f.center);
            };
            a.d = (b, c, d, e) => {
                let f = typeCast(PolarAxisRenderingParameters.$, this.or(b, c, d, e));
                return f;
            };
            a.v = () => {
                if (!this.sa) {
                    this.sa = true;
                    this.r8.d2();
                    this.sa = false;
                }
            };
            a.m = (b, c) => this.getScaledAngle(c);
            a.o = (b, c) => !c.isEmpty && !b.isEmpty && this.r8 != null;
            a.q = (b, c) => {
                if (this.sf(c - this.sc) < 0) {
                    return false;
                }
                if (this.sf(c - this.sc - (2 * Math.PI)) > 0) {
                    return false;
                }
                return true;
            };
            a.p = (b, c, d) => {
                let e = typeCast(PolarAxisRenderingParameters.$, b);
                let f = this.so(this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0);
                let g = this.so(c, e.center, b.ab, b.aa, b.z, 0);
                if (d && MathUtil.g(f.x - g.x, f.y - g.y) < 2) {
                    return false;
                }
                if (g.x < b.aa.right && g.x >= b.aa.left && g.y < b.aa.bottom && g.y >= b.aa.top) {
                    return true;
                }
                return false;
            };
            a.r = (b, c, d, e) => {
                if (c < b.m && typeCast(LogarithmicTickmarkValues.$, b.f) !== null) {
                    return b.m;
                }
                else if (c > b.l && (typeCast(LogarithmicTickmarkValues.$, b.f) !== null || b.h)) {
                    return b.l;
                }
                return c;
            };
            return a;
        }
        so(a, b, c, d, e, f) {
            let g = this.sd();
            let h = ViewportUtils.a(f, c, d, e);
            if (this.a3 != null && (this.a3.c == 5 || this.a3.c == 1)) {
                h *= -1;
            }
            let i = b.x + (g + h) * Math.cos(a);
            let j = b.y + (g + h) * Math.sin(a);
            i = ViewportUtils.e(i, c, d, e);
            j = ViewportUtils.i(j, c, d, e);
            return { $type: Point_$type, x: i, y: j };
        }
        ft(a, b) {
            return this.getScaledAngle(a);
        }
        getScaledAngle1(a, b, c) {
            let d = 0;
            if (b) {
                d = (Math.log(a) - this.p1) / (this.p0 - this.p1);
            }
            else {
                d = (a - this.pr) / (this.pq - this.pr);
            }
            if (c) {
                d = 1 - d;
            }
            return (d * 2 * Math.PI) + this.sc;
        }
        getScaledAngle(a) {
            return this.getScaledAngle1(a, this.pc, this.dg);
        }
        fw(a, b) {
            return this.getUnscaledAngle(a);
        }
        getUnscaledAngle(a) {
            let b = (a - this.sc) / (2 * Math.PI);
            if (this.df) {
                b = 1 - b;
            }
            if (this.pc) {
                return Math.exp(b * (this.p0 - this.p1) + this.p1);
            }
            else {
                return this.pr + b * (this.pq - this.pr);
            }
        }
        r5() {
            if (this.r4 == 0) {
                return 1;
            }
            else {
                return this.r4;
            }
        }
        kf(a, b, c, d) {
            super.kf(a, b, c, d);
            let e = typeCast(XamDataChart.$, this.b0);
            switch (b) {
                case "CrossingAxis":
                    let f = typeCast(NumericRadiusAxis.$, d);
                    this.sl(f);
                    if (f != null) {
                        f.sq(this);
                    }
                    this.k3(false);
                    break;
                case NumericAngleAxis.$$p[1]:
                    this.sc = this.sg;
                    while (this.sc < 0) {
                        this.sc += 360;
                    }
                    while (this.sc >= 360) {
                        this.sc -= 360;
                    }
                    this.sc = (this.sg * Math.PI) / 180;
                    this.k3(false);
                    for (let g of fromEnum(this.ed())) {
                        g.ry(false);
                        g.qr();
                    }
                    break;
                case "Label":
                    if (e != null) {
                        for (let h of fromEnum(e.axes)) {
                            h.k2();
                        }
                    }
                    break;
                case "CrossingValue":
                    if (e != null) {
                        for (let i of fromEnum(e.axes)) {
                            if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
                                i.k2();
                            }
                        }
                    }
                    break;
                case "LabelSettings":
                    this.oq = this.oo();
                    this.sj();
                    this.dr = true;
                    this.k3(false);
                    break;
            }
        }
        sj() {
            this.sb = NaN;
        }
        os() {
            return new PolarAxisRenderingParameters();
        }
        or(a, b, c, d) {
            let e = typeCast(PolarAxisRenderingParameters.$, super.or(a, b, c, d));
            let f = this.r9.h(b, a, c);
            let g = this.r9.i(b, a, c);
            let h = 0.5 * this.r8.sb;
            let i = 0.5 * this.r8.sa;
            let j = f;
            let k = g;
            let l = this.r8.sg();
            if (isNaN_(l) || isInfinity(l)) {
                return null;
            }
            if (k >= h) {
                k = l;
            }
            if (j < i) {
                j = i;
            }
            let m = a.width;
            this.r9.m(b, a, c, e, this.pr, this.pq, this.df, runOn(this, this.getUnscaledAngle), m);
            let n = { $type: Point_$type, x: 0.5, y: 0.5 };
            e.center = n;
            e.maxLength = k;
            e.minLength = j;
            e.effectiveMaximum = l;
            return e;
        }
        getMinMaxAngle(a, b, c, d, e) {
            let f = this.r9.n(a, b, c, d, e);
            d = f.p3;
            e = f.p4;
            return {
                p3: d,
                p4: e
            };
        }
        k4(a) {
            super.k4(a);
            let b = this.b0 != null ? this.b0.xm : Rect.empty;
            let c = !b.isEmpty ? this.n1 : Rect.empty;
            let d = this.nw();
            let e = this.nv();
            let f = this.oq.c(a, c, b, d, e);
            if (f != null) {
                this.pp = f.f.m;
                this.ps = f.f.l;
            }
        }
        get r8() {
            if (this.r7 != null) {
                return this.r7;
            }
            let a = typeCast(XamDataChart.$, this.b0);
            if (a != null) {
                for (let b = 0; b < a.axes.count; b++) {
                    if (a.axes._inner[b].dl) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.r7;
        }
        set r8(a) {
            this.r7 = a;
        }
        ao() {
            return this.r8;
        }
        sl(a) {
            this.r8 = a;
        }
        li(a, b) {
            super.li(a, b);
            if (b.height != a.height || b.width != a.width) {
                this.d2();
            }
        }
        get_bk() {
            return 2;
        }
        get bk() {
            return this.get_bk();
        }
        ns(a, b, c, d, e) {
            if (this.r8 == null) {
                return null;
            }
            let f = typeCast(PolarAxisRenderingParameters.$, this.or(c, b, d, e));
            if (f == null) {
                return null;
            }
            let g = Math.cos(a);
            let h = Math.sin(a);
            let i = f.center.x + g * f.minLength;
            let j = f.center.y + h * f.minLength;
            let k = f.center.x + g * f.maxLength;
            let l = f.center.y + h * f.maxLength;
            i = ViewportUtils.e(i, b, c, d);
            j = ViewportUtils.i(j, b, c, d);
            k = ViewportUtils.e(k, b, c, d);
            l = ViewportUtils.i(l, b, c, d);
            let m = new LineGeometry();
            m.d = { $type: Point_$type, x: i, y: j };
            m.c = { $type: Point_$type, x: k, y: l };
            return m;
        }
    }
    NumericAngleAxis.$t = markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]);
    NumericAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'kx', ['LabelMode:r4:sm', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:sg:sn', [1, 0]]);
    return NumericAngleAxis;
})();
/**
 * @hidden
 */
export let NumericRadiusAxis = /*@__PURE__*/ (() => {
    class NumericRadiusAxis extends NumericAxisBase {
        constructor() {
            super();
            this.r7 = null;
            this.r8 = false;
            this.r9 = NaN;
            this.sb = 0;
            this.sa = 0;
            this.sd = 0;
            this.r4 = null;
            this.ab = NumericRadiusAxis.$;
            this.sb = this.sl;
            this.sa = this.sk;
            this.r7 = new PolarAxisRenderingManager();
            this.oq = this.oo();
        }
        bm() {
            return new NumericRadiusAxisView(this);
        }
        kb(a) {
            super.kb(a);
            this.r6 = a;
        }
        ak() {
            return new NumericRadiusAxis();
        }
        jr(a) {
            super.jr(a);
            this.ju(a, "InnerRadiusExtentScale");
            this.ju(a, "RadiusExtentScale");
        }
        ju(a, b) {
            super.ju(a, b);
            let c = typeCast(NumericRadiusAxis.$, a);
            if (c == null) {
                return;
            }
            let d = this;
            if (b == "InnerRadiusExtentScale") {
                c.sk = d.sk;
            }
            if (b == "RadiusExtentScale") {
                c.sl = d.sl;
            }
        }
        get_dl() {
            return true;
        }
        fs() {
            let a = this.sb;
            let b = this.sa;
            let c = Math.min(this.sf(), this.se()) * (a - b) / 2;
            c = Math.max(c, 14);
            return c;
        }
        sf() {
            return this.n1.width;
        }
        se() {
            return this.n1.height;
        }
        az() {
            return new RadialAxisLabelPanel();
        }
        sc(a) {
            if (a == null) {
                return 0;
            }
            return a;
        }
        oo() {
            let a = super.oo();
            a.b.c = (b) => {
                if ((this.a3 == null || this.a3.visibility == 0) && this.r5 != null) {
                    if ((this.a3 == null || (this.a3.c == 4 || this.a3.c == 5)) && this.r9 != b) {
                        this.r9 = b;
                        this.a0.bj = b;
                        this.b0.o1();
                    }
                }
            };
            a.k = (b, c, d) => {
                let e = typeCast(PolarAxisRenderingParameters.$, b);
                this.r7.k(c, d, e.aa, e.z, e.ab, e.center, e.minAngle, e.maxAngle);
            };
            a.l = (b, c, d, e) => {
                if (d == e) {
                    return;
                }
                let f = typeCast(PolarAxisRenderingParameters.$, b);
                this.r7.l(c, d, e, f.aa, f.z, f.ab, f.center, f.minAngle, f.maxAngle);
            };
            a.m = (b, c) => this.sh(c);
            a.q = (b, c) => {
                let d = typeCast(PolarAxisRenderingParameters.$, b);
                return c <= d.effectiveMaximum;
            };
            a.n = (b, c) => {
                let d = typeCast(PolarAxisRenderingParameters.$, b);
                return c <= d.effectiveMaximum;
            };
            a.j = (b) => {
                let c = typeCast(PolarAxisRenderingParameters.$, b);
                this.r7.o(b.u, c.crossingAngleRadians, b.aa, b.z, b.ab, c.minLength, c.maxLength, c.center);
            };
            a.e = (b) => {
                b.n = this.a3 == null || (this.a3.c == 4 || this.a3.c == 0) ? b.aa.top : b.aa.bottom;
                b.r = b.n;
                let c = typeCast(PolarAxisRenderingParameters.$, b);
                c.crossingAngleRadians = (this.sc(this.ha) * Math.PI) / 180;
                if (this.a3 == null || (this.a3.c == 4 || this.a3.c == 5)) {
                    c.n = ViewportUtils.i(0.5, c.ab, c.aa, c.z) - b.aa.top;
                    c.r = c.n;
                    let d = typeCast(RadialAxisLabelPanel.$, this.a0);
                    if (d != null) {
                        let e = 0;
                        if (this.a3 != null && this.a3.c == 4) {
                            e = 1;
                        }
                        d.d1 = { $type: Point_$type, x: ViewportUtils.e(0.5, c.ab, c.aa, c.z), y: e };
                        d.dy = c.crossingAngleRadians;
                    }
                }
            };
            a.p = (b, c, d) => {
                let e = typeCast(PolarAxisRenderingParameters.$, b);
                if (this.r5 == null) {
                    return false;
                }
                if (c > e.effectiveMaximum) {
                    return false;
                }
                let f = false;
                f = this.a3 == null || (this.a3.c == 4 || this.a3.c == 5);
                let g = 0;
                if (f) {
                    g = this.sd;
                }
                let h = e.center.x + c * Math.cos(g);
                let i = e.center.y + c * Math.sin(g);
                h = ViewportUtils.e(h, e.ab, e.aa, e.z);
                i = ViewportUtils.i(i, e.ab, e.aa, e.z);
                if (h <= b.aa.right && h >= b.aa.left && ((i <= b.aa.bottom && i >= b.aa.top) || !f)) {
                    return true;
                }
                return false;
            };
            a.h = (b, c) => {
                let d = typeCast(PolarAxisRenderingParameters.$, b);
                return new LabelPosition(ViewportUtils.e(d.center.x + c, d.ab, d.aa, d.z));
            };
            a.r = (b, c, d, e) => {
                if (c < b.m) {
                    return b.m;
                }
                else if (c > b.l) {
                    return b.l;
                }
                return c;
            };
            return a;
        }
        ft(a, b) {
            return this.sh(a);
        }
        si(a, b, c, d, e) {
            let f = 0;
            if (b) {
                if (a <= 0) {
                    f = (Math.log(this.pr) - this.p1) / (this.p0 - this.p1);
                }
                else {
                    f = (Math.log(a) - this.p1) / (this.p0 - this.p1);
                }
            }
            else {
                f = (a - this.pr) / (this.pq - this.pr);
            }
            if (c) {
                f = 1 - f;
            }
            f = e + (f * (d - e));
            f /= 2;
            return f;
        }
        sh(a) {
            return this.si(a, this.pc, this.dg, this.sb, this.sa);
        }
        sj(a) {
            let b = a * 2;
            b = (b - this.sa) / (this.sb - this.sa);
            if (this.df) {
                b = 1 - b;
            }
            if (this.pc) {
                return Math.exp(b * (this.p0 - this.p1) + this.p1);
            }
            else {
                return this.pr + b * (this.pq - this.pr);
            }
        }
        fw(a, b) {
            return this.sj(a);
        }
        kf(a, b, c, d) {
            switch (b) {
                case "CrossingValue":
                    this.sd = this.sc(this.ha) * Math.PI / 180;
                    break;
            }
            super.kf(a, b, c, d);
            switch (b) {
                case NumericRadiusAxis.$$p[1]:
                    this.sb = this.sl;
                    if (this.sb < 0) {
                        this.sb = 0.1;
                    }
                    if (this.sb > 1) {
                        this.sb = 1;
                    }
                    if (this.sa >= this.sb) {
                        this.sa = this.sb - 0.01;
                        if (this.sa < 0) {
                            this.sa = 0;
                            this.sb = 0.01;
                        }
                    }
                    this.dr = true;
                    this.k3(false);
                    if (this.r5 != null) {
                        this.r5.k2();
                    }
                    for (let e of fromEnum(this.ed())) {
                        e.ry(false);
                    }
                    break;
                case NumericRadiusAxis.$$p[0]:
                    this.sa = this.sk;
                    if (this.sa < 0) {
                        this.sa = 0.1;
                    }
                    if (this.sa > 1) {
                        this.sa = 1;
                    }
                    if (this.sa >= this.sb) {
                        this.sa = this.sb - 0.01;
                        if (this.sa < 0) {
                            this.sa = 0;
                            this.sb = 0.01;
                        }
                    }
                    this.dr = true;
                    this.k3(false);
                    if (this.r5 != null) {
                        this.r5.k2();
                    }
                    for (let f of fromEnum(this.ed())) {
                        f.g1 = true;
                        f.ry(false);
                    }
                    if (this.b0 != null) {
                        this.b0.pf();
                    }
                    break;
                case "CrossingAxis":
                    let g = typeCast(NumericAngleAxis.$, d);
                    let h = typeCast(CategoryAngleAxis.$, d);
                    if (g == null && h == null) {
                        this.sq(null);
                    }
                    if (g != null) {
                        this.sq(g);
                        g.sl(this);
                    }
                    if (h != null) {
                        this.sq(h);
                        h.rd(this);
                    }
                    this.dr = true;
                    this.k3(false);
                    break;
                case "IsInverted":
                    if (this.r5 != null) {
                        this.r5.dr = true;
                        this.r5.k3(false);
                    }
                    break;
            }
        }
        sq(a) {
            this.r5 = a;
        }
        get r5() {
            if (this.r4 != null) {
                return this.r4;
            }
            let a = typeCast(XamDataChart.$, this.b0);
            if (a != null) {
                for (let b = 0; b < a.axes.count; b++) {
                    if (typeCast(NumericAngleAxis.$, a.axes._inner[b]) !== null || typeCast(CategoryAngleAxis.$, a.axes._inner[b]) !== null) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.r4;
        }
        set r5(a) {
            this.r4 = a;
        }
        ao() {
            return this.r5;
        }
        os() {
            return new PolarAxisRenderingParameters();
        }
        or(a, b, c, d) {
            let e = typeCast(PolarAxisRenderingParameters.$, super.or(a, b, c, d));
            let f = this.r7.h(b, a, c);
            let g = this.r7.i(b, a, c);
            let h = 0.5 * this.sb;
            let i = 0.5 * this.sa;
            let j, k;
            if (Rect.l_op_Equality(b, SeriesViewer.xz)) {
                k = this.pq;
                j = this.pr;
            }
            else {
                k = Math.min(g, h);
                j = this.sj(f);
                k = this.sj(k);
                let l = this.sr(a, c, b, j, k);
                j = l.p3;
                k = l.p4;
            }
            let m = { $type: Point_$type, x: 0.5, y: 0.5 };
            let n = f;
            let o = g;
            let p = Math.min(d.width, d.height) * (this.sb - this.sa) / 2;
            if (this.sd == 0) {
                p = d.width * (this.sb - this.sa) / 2;
            }
            e.center = m;
            let q = Math.max(o, n);
            let r = Math.min(n, o);
            e.maxLength = q;
            e.minLength = r;
            let s = Math.min(j, k);
            let t = Math.max(j, k);
            if (s < this.pr) {
                s = this.pr;
            }
            if (t > this.pq) {
                t = this.pq;
            }
            this.pu = s;
            this.pt = t;
            e.k.add(((() => {
                let $ret = new RangeInfo();
                $ret.d = s;
                $ret.c = t;
                $ret.b = p;
                return $ret;
            })()));
            let u = typeCast(IAngleScaler_$type, this.r5);
            if (u != null) {
                let v;
                let w;
                let x = u.getMinMaxAngle(b, a, c, v, w);
                v = x.p3;
                w = x.p4;
                e.minAngle = Math.min(v, w);
                e.maxAngle = Math.max(v, w);
            }
            let y = this.sg();
            if (o >= h) {
                o = y;
            }
            if (n < i) {
                n = i;
            }
            e.minLength = n;
            e.maxLength = o;
            e.effectiveMaximum = y;
            e.f = this.ov;
            let z = typeCast(LinearTickmarkValues.$, e.f);
            if (z != null) {
                z.y = this.sm(m, e.minLength, e.maxLength, b, a, c);
            }
            return e;
        }
        sr(a, b, c, d, e) {
            let f = { $type: Point_$type, x: 0.5, y: 0.5 };
            let g = 0;
            if (this.df) {
                g = this.sh(this.pr);
            }
            else {
                g = this.sh(this.pq);
            }
            let h = 0;
            if (this.ha != null) {
                h = this.sd;
            }
            let i = f.x + g * Math.cos(h);
            let j = f.y + g * Math.sin(h);
            f.x = ViewportUtils.e(f.x, c, a, b);
            f.y = ViewportUtils.i(f.y, c, a, b);
            i = ViewportUtils.e(i, c, a, b);
            j = ViewportUtils.i(j, c, a, b);
            if (i >= a.left && i <= a.right && j >= a.top && j <= a.bottom) {
                if (this.df) {
                    e = this.pr;
                }
                else {
                    e = this.pq;
                }
            }
            if (f.x >= a.left && f.x <= a.right && f.y >= a.top && f.y <= a.bottom) {
                if (this.df) {
                    d = this.pq;
                }
                else {
                    d = this.pr;
                }
            }
            return {
                p3: d,
                p4: e
            };
        }
        sm(a, b, c, d, e, f) {
            let g = ViewportUtils.d(c - b, d, e, f);
            let h = g / Math.min(e.width, e.height);
            if (h > 0.7) {
                return 10;
            }
            return 5;
        }
        sg() {
            let a = 0;
            if (!this.df) {
                a = this.sh(this.pq);
            }
            else {
                a = this.sh(this.pr);
            }
            return a;
        }
        rh(a) {
            if (this.r5 != null) {
                this.r5.k2();
            }
        }
        k4(a) {
            super.k4(a);
            let b = this.b0 != null ? this.b0.xm : Rect.empty;
            let c = !b.isEmpty ? this.n1 : Rect.empty;
            let d = this.nw();
            let e = this.nv();
            let f = this.oq.c(a, c, b, d, e);
            if (f != null) {
                this.pp = f.f.m;
                this.ps = f.f.l;
            }
        }
        li(a, b) {
            super.li(a, b);
            if (b.height != a.height || b.width != a.width) {
                this.d2();
            }
        }
        sp(a, b, c, d, e) {
            let f = typeCast(IPolarRadialRenderingParameters_$type, this.or(b, c, d, e));
            if (f == null) {
                return;
            }
            this.r7.l(a.d, f.minLength, f.maxLength, b, d, c, f.center, f.minAngle, f.maxAngle);
        }
        get_bk() {
            return 3;
        }
        get bk() {
            return this.get_bk();
        }
        ns(a, b, c, d, e) {
            let f = typeCast(PolarAxisRenderingParameters.$, this.or(c, b, d, e));
            let g = a;
            let h = new PathGeometry();
            let i = ViewportUtils.d(g, b, c, d);
            let j = ViewportUtils.h(g, b, c, d);
            if (i <= 0 || j <= 0) {
                return null;
            }
            let k = ViewportUtils.e(f.center.x, b, c, d);
            let l = ViewportUtils.i(f.center.y, b, c, d);
            if (f.maxAngle - f.minAngle < Math.PI && f.maxAngle - f.minAngle > 0) {
                let m = { $type: Point_$type, x: ViewportUtils.e(f.center.x + g * Math.cos(f.minAngle), b, c, d), y: ViewportUtils.i(f.center.y + g * Math.sin(f.minAngle), b, c, d) };
                let n = { $type: Point_$type, x: ViewportUtils.e(f.center.x + g * Math.cos(f.maxAngle), b, c, d), y: ViewportUtils.i(f.center.y + g * Math.sin(f.maxAngle), b, c, d) };
                let o = new PathFigure();
                o._startPoint = m;
                o._isClosed = false;
                o._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.b = false;
                    $ret.e = n;
                    $ret.f = new Size(1, i, j);
                    $ret.d = 1;
                    return $ret;
                })()));
                h.c.add(o);
            }
            else {
                let p = new PathFigure();
                p._startPoint = { $type: Point_$type, x: k, y: l - j };
                p._isClosed = true;
                p._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.b = false;
                    $ret.e = { $type: Point_$type, x: k, y: l + j };
                    $ret.f = new Size(1, i, j);
                    $ret.d = 1;
                    return $ret;
                })()));
                p._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.b = false;
                    $ret.e = { $type: Point_$type, x: k, y: l - j };
                    $ret.f = new Size(1, i, j);
                    $ret.d = 1;
                    return $ret;
                })()));
                h.c.add(p);
            }
            return h;
        }
    }
    NumericRadiusAxis.$t = markType(NumericRadiusAxis, 'NumericRadiusAxis', NumericAxisBase.$);
    NumericRadiusAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericRadiusAxis, 'kx', ['InnerRadiusExtentScale:sk:ss', [1, 0], 'RadiusExtentScale:sl:st', [1, 0.75]]);
    return NumericRadiusAxis;
})();
/**
 * @hidden
 */
export let AngleAxisLabelPanelView = /*@__PURE__*/ (() => {
    class AngleAxisLabelPanelView extends AxisLabelPanelBaseView {
        constructor(a) {
            super(a);
            this.az = null;
            this.az = a;
        }
        an() {
            super.an();
            this.az.dd = true;
        }
        a1(a, b) {
            this.az.di = -1.7976931348623157E+308;
            this.az.df = -1.7976931348623157E+308;
            this.az.dh = -1.7976931348623157E+308;
            this.az.dg = -1.7976931348623157E+308;
            for (let c = 0; c < this.a.be.count; c++) {
                let d = this.a.be._inner[c];
                let e = this.a.bd._inner[c];
                let f = e.a;
                let g = this.az.dl(e.c, NaN, NaN);
                let h = this.m(d);
                let i = this.l(d);
                let j = h + this.p() + this.q();
                let k = i + this.r() + this.o();
                let l = g.x - j / 2;
                let m = g.y - k / 2;
                this.az.dh = Math.max(h, this.az.dh);
                this.az.dg = Math.max(i, this.az.dg);
                this.az.di = Math.max(j, this.az.di);
                this.az.df = Math.max(k, this.az.df);
                let n = new Rect(0, l, m, j, k);
                a.add(n);
                b.add(f);
            }
        }
        a0(a, b) {
            this.az.de = -1.7976931348623157E+308;
            let c = 0;
            if (typeCast(CategoryAngleAxis.$, this.az.ad) !== null) {
                c = this.az.ad.qr() * this.az.ad.n1.width;
            }
            else if (typeCast(NumericAngleAxis.$, this.az.ad) !== null) {
                c = this.az.ad.sd() * this.az.ad.n1.width;
            }
            let d = { $type: Point_$type, x: this.az.ad.n1.width * 0.5, y: this.az.ad.n1.width * 0.5 };
            for (let e = 0; e < this.a.be.count; e++) {
                let f = this.a.be._inner[e];
                let g = this.a.bd._inner[e];
                let h = g.a;
                let i = this.m(f);
                let j = this.l(f);
                let k = i + this.p() + this.q();
                let l = j + this.r() + this.o();
                let m = this.az.dl(g.c, k, l);
                let n = m.x - k / 2;
                let o = m.y - l / 2;
                let p = new Rect(0, n, o, i, j);
                if (!h) {
                    let q = Math.sqrt((p.left - d.x) * (p.left - d.x) + (p.top - d.y) * (p.top - d.y));
                    let r = Math.sqrt((p.right - d.x) * (p.right - d.x) + (p.top - d.y) * (p.top - d.y));
                    let s = Math.sqrt((p.left - d.x) * (p.left - d.x) + (p.bottom - d.y) * (p.bottom - d.y));
                    let t = Math.sqrt((p.right - d.x) * (p.right - d.x) + (p.bottom - d.y) * (p.bottom - d.y));
                    this.az.de = Math.max(q - c, this.az.de);
                    this.az.de = Math.max(r - c, this.az.de);
                    this.az.de = Math.max(s - c, this.az.de);
                    this.az.de = Math.max(t - c, this.az.de);
                }
                a.add(p);
                b.add(h);
            }
        }
        o() {
            return 0;
        }
        p() {
            return 0;
        }
        q() {
            return 0;
        }
        r() {
            return 0;
        }
    }
    AngleAxisLabelPanelView.$t = markType(AngleAxisLabelPanelView, 'AngleAxisLabelPanelView', AxisLabelPanelBaseView.$);
    return AngleAxisLabelPanelView;
})();
/**
 * @hidden
 */
export let CategoryAngleAxisView = /*@__PURE__*/ (() => {
    class CategoryAngleAxisView extends CategoryAxisBaseView {
        constructor(a) {
            super(a);
            this.bm = null;
            this.bm = a;
        }
        al() {
            super.al();
            this.a.ni = AxisDefaults.axis_MajorBrush;
            this.a.nm = AxisDefaults.axis_LineBrush;
        }
    }
    CategoryAngleAxisView.$t = markType(CategoryAngleAxisView, 'CategoryAngleAxisView', CategoryAxisBaseView.$);
    return CategoryAngleAxisView;
})();
/**
 * @hidden
 */
export let NumericAngleAxisView = /*@__PURE__*/ (() => {
    class NumericAngleAxisView extends NumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bm = null;
            this.bm = a;
        }
        al() {
            super.al();
            this.a.ni = AxisDefaults.axis_MajorBrush;
            this.a.nm = AxisDefaults.axis_LineBrush;
        }
    }
    NumericAngleAxisView.$t = markType(NumericAngleAxisView, 'NumericAngleAxisView', NumericAxisBaseView.$);
    return NumericAngleAxisView;
})();
/**
 * @hidden
 */
export let NumericRadiusAxisView = /*@__PURE__*/ (() => {
    class NumericRadiusAxisView extends NumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bm = null;
            this.bm = a;
        }
        al() {
            super.al();
            this.a.ni = AxisDefaults.axis_MajorBrush;
            this.a.nm = AxisDefaults.axis_LineBrush;
        }
    }
    NumericRadiusAxisView.$t = markType(NumericRadiusAxisView, 'NumericRadiusAxisView', NumericAxisBaseView.$);
    return NumericRadiusAxisView;
})();
