/*
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-react-core";
import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView";
import { Rect } from "igniteui-react-core";
import { Extensions } from "igniteui-react-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-react-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-react-core";
import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager";
import { AxisLabelManager } from "./AxisLabelManager";
import { ViewportUtils } from "./ViewportUtils";
import { GeometryUtil } from "igniteui-react-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-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { RangeInfo } from "./RangeInfo";
import { isNaN_, isInfinity } from "igniteui-react-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters";
import { MathUtil } from "igniteui-react-core";
import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters";
import { PathGeometry } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { ArcSegment } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { CategoryAxisBaseView } from "./CategoryAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
export let AngleAxisLabelPanel = /*@__PURE__*/ (() => {
    class AngleAxisLabelPanel extends AxisLabelPanelBase {
        ae() {
            return new AngleAxisLabelPanelView(this);
        }
        ch(a) {
            super.ch(a);
            this.c9 = a;
        }
        constructor() {
            super();
            this.da = false;
            this.di = null;
            this.df = 0;
            this.dc = 0;
            this.de = 0;
            this.dd = 0;
            this.db = 0;
        }
        at(a, b) {
            if (!Extensions.b(b)) {
                return false;
            }
            if (this.ad == null || this.ad.ke.isEmpty) {
                return super.at(a, b);
            }
            return true;
        }
        a5() {
            let a = new List$1(Rect.$, 0);
            let b = new List$1(Boolean_$type, 0);
            if (this.bb.count != this.ba.count) {
                return a;
            }
            let c = 1;
            if (typeCast(CategoryAngleAxis.$, this.ad) !== null) {
                c = this.ad.mj();
            }
            else if (typeCast(NumericAngleAxis.$, this.ad) !== null) {
                c = this.ad.nj();
            }
            if (c == 2) {
                this.c9.a0(a, b);
            }
            else {
                this.c9.a1(a, b);
            }
            let d = false;
            this.ao = this.an(a, b);
            if (!this.ad.b8()) {
                d = true;
                switch (c) {
                    case 1:
                        this.dk();
                        break;
                    case 2:
                        this.dj();
                        break;
                }
            }
            else {
                d = true;
                this.c9.ac();
            }
            if (d) {
                for (let e = 0; e < a.count; e++) {
                    let f = this.bb._inner[e];
                    let g = this.ba._inner[e];
                    let h = a._inner[e];
                    let i = this.di(g.c, h.width, h.height);
                    let j = i.x - this.bk(f) / 2;
                    let k = i.y - this.bj(f) / 2;
                    h.x = j;
                    h.y = k;
                    a._inner[e] = h;
                }
            }
            return a;
        }
        dk() {
            this.bh = this.df / 2;
            this.bh = this.bh + this.dg();
        }
        dj() {
            this.bh = 5;
            this.bh = this.bh + this.dh();
        }
        dh() {
            let a;
            let b;
            b = this.ad;
            a = null;
            if (b != null) {
                a = typeCast(XamDataChart.$, b.bi);
            }
            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.aw) !== null && e.aw.bb.count > 0 && (!e.b8()) && !e.b5() && (e.aj == null || this.ad.aj == null || e.aj.np == b.aj.np)) {
                    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.mi == 2) {
                        g += h.aw.db;
                    }
                    else {
                        g += c._inner[f - 1].aw.bh;
                    }
                }
                else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                    let i = c._inner[f - 1];
                    if (i.mi == 2) {
                        g += i.aw.db;
                    }
                    else {
                        g += c._inner[f - 1].aw.bh;
                    }
                }
            }
            return g;
        }
        dg() {
            let a;
            let b;
            b = this.ad;
            a = null;
            if (b != null) {
                a = typeCast(XamDataChart.$, b.bi);
            }
            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.aw) !== null && e.aw.bb.count > 0 && (!e.b8()) && !e.b5() && (e.aj == null || this.ad.aj == null || e.aj.np == b.aj.np)) {
                    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.mi == 2) {
                        g += i.aw.db;
                    }
                    else {
                        g += c._inner[f - 1].aw.bh;
                    }
                }
                else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                    let j = c._inner[f - 1];
                    if (j.ni == 2) {
                        g += j.aw.db;
                    }
                    else {
                        g += c._inner[f - 1].aw.bh;
                    }
                }
                g += c._inner[f].aw.bh * 2 + h;
            }
            return g;
        }
        ai() {
            return 4;
        }
        ay(a) {
            return a == 4 || a == 5;
        }
    }
    AngleAxisLabelPanel.$t = /*@__PURE__*/ markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$);
    return AngleAxisLabelPanel;
})();
/**
 * @hidden
 */
export let CategoryAngleAxis = /*@__PURE__*/ (() => {
    class CategoryAngleAxis extends CategoryAxisBase {
        a4() {
            return new CategoryAngleAxisView(this);
        }
        ht(a) {
            super.ht(a);
            this.ml = a;
        }
        get_b9() {
            return true;
        }
        constructor() {
            super();
            this.mq = null;
            this.mn = null;
            this.mr = false;
            this.my = NaN;
            this.mo = null;
            this.mz = 0;
            this.mw = 0;
            this.mx = 0;
            this.nc = 1;
            this.ab = CategoryAngleAxis.$;
            this.mn = this.mm();
            this.mq = new PolarAxisRenderingManager();
        }
        av() {
            let a = new AngleAxisLabelPanel();
            a.di = (b, c, d) => {
                let e = this.bi != null ? this.bi.vl : Rect.empty;
                let f = !e.isEmpty ? this.ke : Rect.empty;
                let g = this.j9();
                switch (this.mi) {
                    case 2: return this.ns(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.aw.bh);
                    case 0:
                    case 1:
                    default: return this.nt(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.aw.bh);
                }
            };
            return a;
        }
        mu(a) {
            return false;
        }
        ng() {
            return null;
        }
        na(a) {
            return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
        }
        mm() {
            let a = ((() => {
                let $ret = new AxisLabelManager();
                $ret.a = this;
                $ret.f = this.dd;
                $ret.e = this.dc;
                $ret.b = this.aw;
                return $ret;
            })());
            if (this.az != null) {
                this.az.registerAxis(this);
            }
            let b = new CategoryAxisRenderer(a);
            b.u = () => {
                let c = this.a5.a4();
                let d = this.a5.a7();
                let e = this.a5.a5();
                let f = this.a5.a6();
                this.im();
                this.hj(c);
                this.hj(d);
                this.hj(e);
                this.hj(f);
            };
            b.o = (c, d) => !d.isEmpty && !c.isEmpty && this.mp != null;
            b.d = (c, d, e, f) => this.mk(c, d, e, f);
            b.v = () => {
                if (!this.mr) {
                    this.mr = true;
                    this.mp.c1();
                    this.mr = false;
                }
            };
            b.g = (c, d) => {
                let e = typeGetValue(c);
                if (e == this.lg - 1) {
                    if (this.cl) {
                        if (this.mu(e)) {
                            return this.ng();
                        }
                    }
                }
                if (e > this.lg - 1) {
                    e -= this.lg;
                }
                if (this.mv(e)) {
                    return null;
                }
                let f = this.ks.item(e);
                return this.f0(f);
            };
            b.b.c = (c) => {
                if ((this.az == null || this.az.visibility == 0) && this.mp != null && this.my != c) {
                    let d = typeCast(XamDataChart.$, this.bi);
                    if (d == null) {
                        return;
                    }
                    this.my = c;
                    this.aw.bg = c;
                    d.nr();
                    for (let e of fromEnum(d.axes)) {
                        if (e != this && typeCast(AngleAxisLabelPanel.$, e.aw) !== null) {
                            e.a5.ai();
                        }
                    }
                }
            };
            b.k = (c, d, e) => {
                let f = typeCast(RadialAxisRenderingParameters.$, c);
                this.mq.o(d, e, c.z, c.y, c.aa, f.minLength, f.maxLength, f.center);
            };
            b.l = (c, d, e, f) => {
                let g = typeCast(RadialAxisRenderingParameters.$, c);
                this.mq.p(d, e, f, g.z, g.y, c.aa, g.minLength, g.maxLength, g.center);
            };
            b.m = (c, d) => this.getScaledAngle(d);
            b.q = (c, d) => {
                if (this.na(d - this.mz) < 0) {
                    return false;
                }
                if (this.na(d - this.mz - (2 * Math.PI)) > 0) {
                    return false;
                }
                return true;
            };
            b.j = (c) => {
                let d = typeCast(RadialAxisRenderingParameters.$, c);
                if (d.e == d.k._inner[0]) {
                    this.mq.k(c.t, c.n, c.z, c.y, c.aa, d.center, d.minAngle, d.maxAngle);
                }
            };
            b.e = (c) => {
                c.n = this.m2();
                c.r = c.n;
            };
            b.p = (c, d, e) => {
                let f = typeCast(RadialAxisRenderingParameters.$, c);
                if (e) {
                    return false;
                }
                let g = this.nt(d, f.center, c.aa, c.z, c.y, 0);
                if (g.x < c.z.right && g.x >= c.z.left && g.y < c.z.bottom && g.y >= c.z.top) {
                    return true;
                }
                return false;
            };
            b.a = (c, d, e, f) => {
                let g = c.y;
                let h = new ScalerParams(0, c.aa, c.z, this.ch, g);
                let i = d;
                if (this.categoryMode != 0) {
                    let j = (e * f) + 1;
                    j = Math.min(j, this.lg);
                    let k = this.ek(j, h);
                    i = (d + k) / 2;
                }
                return i;
            };
            b.f = runOn(this, this.getGroupCenter);
            b.i = runOn(this, this.m7);
            return b;
        }
        mv(a) {
            return false;
        }
        nt(a, b, c, d, e, f) {
            let g = this.m2();
            let h = ViewportUtils.a(f, c, d, e);
            if (this.az != null && (this.az.c == 5 || this.az.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 };
        }
        ns(a, b, c, d, e, f, g, h) {
            if (!isNaN_(b) && !isNaN_(c)) {
                let i = this.m2();
                let j = b / f.width;
                let k = c / f.width;
                let l = ViewportUtils.a(h, e, f, g);
                let m = GeometryUtil.k(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.nt(a, d, e, f, g, h);
            }
        }
        m2() {
            if (this.mp == null) {
                return 0;
            }
            if (!this.b5()) {
                return this.mp.nu();
            }
            else {
                return this.mp.nv((this.fw));
            }
        }
        mk(a, b, c, d) {
            if (this.ks == null) {
                return null;
            }
            let e = new RadialAxisRenderingParameters();
            let f = this.lh - 1;
            let g = this.a5.a4();
            let h = this.a5.a7();
            let i = this.a5.a5();
            let j = this.a5.a6();
            e.t = g;
            e.w = h;
            e.u = i;
            e.v = j;
            e.l = f;
            e.m = 0;
            e.h = false;
            e.z = a;
            e.y = c;
            e.x = d;
            e.aa = b;
            e.g = this.mt();
            e.p = this.m8;
            e.o = this.ez();
            e.q = this.m9;
            e.s = this.f1;
            let k = this.mq.h(b, a, c);
            let l = this.mq.i(b, a, c);
            let m = 0.5 * this.mp.np;
            let n = 0.5 * this.mp.no;
            let o = k;
            let p = l;
            let q = this.mp.nu();
            if (isNaN_(q) || isInfinity(q)) {
                return null;
            }
            if (p >= m) {
                p = q;
            }
            if (o < n) {
                o = n;
            }
            let r = a.width;
            this.mq.m(b, a, c, e, 0, this.lh, this.ch, 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.ae = this.lh;
            e.ab = this.categoryMode;
            e.ad = true;
            e.ac = this.ch;
            e.af = this.li;
            e.f = new CategoryTickmarkValues();
            e.j = this.cy;
            return e;
        }
        getMinMaxAngle(a, b, c, d, e) {
            let f = this.mq.n(a, b, c, d, e);
            d = f.p3;
            e = f.p4;
            return {
                p3: d,
                p4: e
            };
        }
        ac() {
            super.ac();
            this.h9(false);
        }
        get mp() {
            if (this.mo != null) {
                return this.mo;
            }
            let a = typeCast(XamDataChart.$, this.bi);
            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.mo;
        }
        set mp(a) {
            this.mo = a;
        }
        ak() {
            return this.mp;
        }
        mj() {
            if (this.mi == 0) {
                return 1;
            }
            else {
                return this.mi;
            }
        }
        getCategorySize(a, b, c) {
            return 2 * Math.PI / this.lg;
        }
        get_ms() {
            return false;
        }
        get ms() {
            return this.get_ms();
        }
        m4(a, b, c, d) {
            return this.k5(b, c, d);
        }
        k5(a, b, c) {
            let d = this.lc(a, b, c);
            let e = 0;
            if (!isNaN_(this.lb)) {
                e = Math.min(this.lb, 1);
            }
            let f = 1 - 0.5 * d;
            return this.getCategorySize(a, b, c) * f / (this.li - (this.li - 1) * e);
        }
        m3(a, b, c, d, e) {
            return this.getGroupCenter(b, c, d, e);
        }
        getGroupCenter(a, b, c, d) {
            let e = 0.5;
            if (this.li > 1) {
                let f = this.lc(b, c, d);
                let g = 0;
                if (!isNaN_(this.lb)) {
                    g = Math.min(this.lb, 1);
                }
                let h = 1 - 0.5 * f;
                let i = h / (this.li - (this.li - 1) * g);
                let j = (h - i) / (this.li - 1);
                e = 0.25 * f + 0.5 * i + a * j;
            }
            return this.getCategorySize(b, c, d) * e;
        }
        m7(a) {
            let b = 0.5;
            if (this.li > 1) {
                let c = this.lc(Rect.empty, Rect.empty, Rect.empty);
                let d = 0;
                if (!isNaN_(this.lb)) {
                    d = Math.min(this.lb, 1);
                }
                let e = 1 - 0.5 * c;
                let f = e / (this.li - (this.li - 1) * d);
                let g = (e - f) / (this.li - 1);
                b = 0.25 * c + 0.5 * f + a * g;
            }
            return b;
        }
        ia(a) {
            super.ia(a);
            let b = this.bi != null ? this.bi.vl : Rect.empty;
            let c = !b.isEmpty ? this.ke : Rect.empty;
            let d = this.j9();
            let e = this.j8();
            let f = this.mn.c(a, c, b, d, e);
            if (f != null) {
                this.m0 = f.f.m;
                this.m1 = f.f.l;
            }
        }
        m6(a, b, c) {
            let d;
            let e;
            let f = this.mq.n(c, a, b, d, e);
            d = f.p3;
            e = f.p4;
            if (d == 0) {
                if (this.ch) {
                    return this.lg;
                }
                else {
                    return 0;
                }
            }
            let g = this.getUnscaledAngle(d);
            if (g < 0 || g > this.lg) {
                g = this.getUnscaledAngle(d + Math.PI * 2);
            }
            return g;
        }
        m5(a, b, c) {
            let d;
            let e;
            let f = this.mq.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.ch) {
                    return 0;
                }
                else {
                    return this.lg;
                }
            }
            let g = this.getUnscaledAngle(e);
            if (g < 0 || g > this.lg) {
                g = this.getUnscaledAngle(e + Math.PI * 2);
            }
            return g;
        }
        getScaledAngle(a) {
            let b = this.lg;
            let c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
            if (this.ci) {
                c = 1 - c;
            }
            return (c * 2 * Math.PI) + this.mz;
        }
        getUnscaledAngle(a) {
            if (a < this.mz) {
                a += 2 * Math.PI;
            }
            let b = (a - this.mz) / (2 * Math.PI);
            if (this.ch) {
                b = 1 - b;
            }
            return b * (this.lg);
        }
        ek(a, b) {
            return this.getScaledAngle(a);
        }
        en(a, b) {
            return this.getUnscaledAngle(a);
        }
        d4(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;
        }
        hx(a, b, c, d) {
            super.hx(a, b, c, d);
            let e = typeCast(XamDataChart.$, this.bi);
            switch (b) {
                case "CrossingAxis":
                    let f = typeCast(NumericRadiusAxis.$, d);
                    this.nn(f);
                    if (f != null) {
                        f.n4(this);
                    }
                    this.cq = true;
                    this.h9(false);
                    break;
                case CategoryAngleAxis.$$p[1]:
                    this.mz = this.nb;
                    while (this.mz < 0) {
                        this.mz += 360;
                    }
                    while (this.mz >= 360) {
                        this.mz -= 360;
                    }
                    this.mz = (this.mz * Math.PI) / 180;
                    this.cq = true;
                    this.h9(false);
                    for (let g of fromEnum(this.de)) {
                        g.rm(false);
                        g.qg();
                    }
                    break;
                case "Label":
                case CategoryAngleAxis.$$p[0]:
                    if (e != null) {
                        for (let h of fromEnum(e.axes)) {
                            h.cq = true;
                            h.h8();
                        }
                    }
                    break;
                case "CrossingValue":
                    if (e != null) {
                        for (let i of fromEnum(e.axes)) {
                            if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
                                i.cq = true;
                                i.h8();
                            }
                        }
                    }
                    break;
                case "LabelSettings":
                    this.mn = this.mm();
                    this.nl();
                    this.cq = true;
                    this.h9(false);
                    break;
            }
        }
        nl() {
            this.my = NaN;
        }
        nn(a) {
            this.mp = a;
        }
        get m8() {
            return this.c(CategoryAngleAxis.no);
        }
        set m8(a) {
            this.h(CategoryAngleAxis.no, a);
        }
        get m0() {
            return this.mw;
        }
        set m0(a) {
            if (this.m0 != a) {
                let b = this.mw;
                this.mw = a;
                this.h3("ActualInterval", b, this.m0);
            }
        }
        ew() {
            return this.m0;
        }
        get m9() {
            return this.c(CategoryAngleAxis.nq);
        }
        set m9(a) {
            this.h(CategoryAngleAxis.nq, a);
        }
        get m1() {
            return this.mx;
        }
        set m1(a) {
            if (this.m1 != a) {
                let b = this.mx;
                this.mx = a;
                this.h3("ActualMinorInterval", b, this.m1);
            }
        }
        mt() {
            return !isNaN_(this.m8);
        }
        get_a2() {
            return 2;
        }
        get a2() {
            return this.get_a2();
        }
        c3() {
            if (this.cq && this.c4) {
                this.bc = this.bb();
            }
            if (this.ks == null) {
                return false;
            }
            let a = this.ks.count;
            if (a != this.nd) {
                let b = new AxisRangeChangedEventArgs(0, 1, 1, this.nd, a);
                this.nd = a;
                this.h4(b);
                return true;
            }
            return false;
        }
        get nd() {
            return this.nc;
        }
        set nd(a) {
            this.nc = a;
        }
        j6(a, b, c, d, e) {
            let f = typeCast(RadialAxisRenderingParameters.$, this.mn.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.cp;
        }
        j$d(a, b) {
            return this.en.apply(this, arguments);
        }
        j$c(a, b) {
            return this.ek.apply(this, arguments);
        }
        j$e(a, b, c, d, e) {
            this.hn.apply(this, arguments);
        }
        j$f(a, b, c, d) {
            this.ho.apply(this, arguments);
        }
        j$g(a, b, c, d) {
            this.hp.apply(this, arguments);
        }
        get j$b() {
            return this.ch;
        }
        j$a() {
            return this.ag.apply(this, arguments);
        }
    }
    CategoryAngleAxis.$t = /*@__PURE__*/ markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
    CategoryAngleAxis.no = /*@__PURE__*/ DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, /*@__PURE__*/ new PropertyMetadata(2, NaN, (a, b) => {
        a.h3("Interval", b.oldValue, b.newValue);
        a.h9(false);
    }));
    CategoryAngleAxis.nq = /*@__PURE__*/ DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, /*@__PURE__*/ new PropertyMetadata(2, NaN, (a, b) => {
        (typeCast(CategoryAngleAxis.$, a)).h3("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryAngleAxis.$, a)).h9(false);
    }));
    CategoryAngleAxis.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'h3', ['LabelMode:mi:np', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:nb:nr', [1, 0]]);
    return CategoryAngleAxis;
})();
/**
 * @hidden
 */
export let NumericAngleAxis = /*@__PURE__*/ (() => {
    class NumericAngleAxis extends NumericAxisBase {
        a4() {
            return new NumericAngleAxisView(this);
        }
        ht(a) {
            super.ht(a);
            this.nk = a;
        }
        get_b9() {
            return true;
        }
        constructor() {
            super();
            this.nn = null;
            this.no = false;
            this.np = NaN;
            this.nq = 0;
            this.nl = null;
            this.ab = NumericAngleAxis.$;
            this.nn = new PolarAxisRenderingManager();
            this.k1 = this.kz();
        }
        av() {
            let a = new AngleAxisLabelPanel();
            a.di = (b, c, d) => {
                let e = this.bi != null ? this.bi.vl : Rect.empty;
                let f = !e.isEmpty ? this.ke : Rect.empty;
                let g = this.j9();
                return this.n2(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.aw.bh);
            };
            return a;
        }
        nr() {
            if (this.nm == null) {
                return 0;
            }
            if (!this.b5()) {
                return this.nm.nu();
            }
            else {
                return this.nm.nv((this.fw));
            }
        }
        nt(a) {
            return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
        }
        kz() {
            let a = super.kz();
            a.b.c = (b) => {
                if ((this.az == null || this.az.visibility == 0) && this.nm != null && this.np != b) {
                    let c = typeCast(XamDataChart.$, this.bi);
                    if (c == null) {
                        return;
                    }
                    this.np = b;
                    this.aw.bg = b;
                    c.nr();
                    for (let d of fromEnum(c.axes)) {
                        if (d != this && typeCast(AngleAxisLabelPanel.$, d.aw) !== null) {
                            d.a5.ai();
                        }
                    }
                }
            };
            a.e = (b) => {
                b.n = this.nr();
                b.r = b.n;
            };
            a.j = (b) => {
                let c = typeCast(PolarAxisRenderingParameters.$, b);
                if (c.e == c.k._inner[0]) {
                    this.nn.k(b.t, b.n, b.z, b.y, b.aa, c.center, c.minAngle, c.maxAngle);
                }
            };
            a.k = (b, c, d) => {
                let e = typeCast(PolarAxisRenderingParameters.$, b);
                this.nn.o(c, d, b.z, b.y, b.aa, e.minLength, e.maxLength, e.center);
            };
            a.l = (b, c, d, e) => {
                let f = typeCast(PolarAxisRenderingParameters.$, b);
                this.nn.p(c, d, e, f.z, f.y, b.aa, f.minLength, f.maxLength, f.center);
            };
            a.d = (b, c, d, e) => {
                let f = typeCast(PolarAxisRenderingParameters.$, this.k2(b, c, d, e));
                return f;
            };
            a.v = () => {
                if (!this.no) {
                    this.no = true;
                    this.nm.c1();
                    this.no = false;
                }
            };
            a.m = (b, c) => this.getScaledAngle(c);
            a.o = (b, c) => !c.isEmpty && !b.isEmpty && this.nm != null;
            a.q = (b, c) => {
                if (this.nt(c - this.nq) < 0) {
                    return false;
                }
                if (this.nt(c - this.nq - (2 * Math.PI)) > 0) {
                    return false;
                }
                return true;
            };
            a.p = (b, c, d) => {
                let e = typeCast(PolarAxisRenderingParameters.$, b);
                let f = this.n2(this.getScaledAngle(e.l), e.center, b.aa, b.z, b.y, 0);
                let g = this.n2(c, e.center, b.aa, b.z, b.y, 0);
                if (d && MathUtil.g(f.x - g.x, f.y - g.y) < 2) {
                    return false;
                }
                if (g.x < b.z.right && g.x >= b.z.left && g.y < b.z.bottom && g.y >= b.z.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;
        }
        n2(a, b, c, d, e, f) {
            let g = this.nr();
            let h = ViewportUtils.a(f, c, d, e);
            if (this.az != null && (this.az.c == 5 || this.az.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 };
        }
        ek(a, b) {
            return this.getScaledAngle(a);
        }
        getScaledAngle1(a, b, c) {
            let d = 0;
            if (b) {
                d = (Math.log(a) - this.l4) / (this.l3 - this.l4);
            }
            else {
                d = (a - this.ly) / (this.lx - this.ly);
            }
            if (c) {
                d = 1 - d;
            }
            return (d * 2 * Math.PI) + this.nq;
        }
        getScaledAngle(a) {
            return this.getScaledAngle1(a, this.lk, this.ci);
        }
        en(a, b) {
            return this.getUnscaledAngle(a);
        }
        getUnscaledAngle(a) {
            let b = (a - this.nq) / (2 * Math.PI);
            if (this.ch) {
                b = 1 - b;
            }
            if (this.lk) {
                return Math.exp(b * (this.l3 - this.l4) + this.l4);
            }
            else {
                return this.ly + b * (this.lx - this.ly);
            }
        }
        nj() {
            if (this.ni == 0) {
                return 1;
            }
            else {
                return this.ni;
            }
        }
        hx(a, b, c, d) {
            super.hx(a, b, c, d);
            let e = typeCast(XamDataChart.$, this.bi);
            switch (b) {
                case "CrossingAxis":
                    let f = typeCast(NumericRadiusAxis.$, d);
                    this.nz(f);
                    if (f != null) {
                        f.n4(this);
                    }
                    this.h9(false);
                    break;
                case NumericAngleAxis.$$p[1]:
                    this.nq = this.nu;
                    while (this.nq < 0) {
                        this.nq += 360;
                    }
                    while (this.nq >= 360) {
                        this.nq -= 360;
                    }
                    this.nq = (this.nu * Math.PI) / 180;
                    this.h9(false);
                    for (let g of fromEnum(this.db())) {
                        g.rm(false);
                        g.qg();
                    }
                    break;
                case "Label":
                    if (e != null) {
                        for (let h of fromEnum(e.axes)) {
                            h.h8();
                        }
                    }
                    break;
                case "CrossingValue":
                    if (e != null) {
                        for (let i of fromEnum(e.axes)) {
                            if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
                                i.h8();
                            }
                        }
                    }
                    break;
                case "LabelSettings":
                    this.k1 = this.kz();
                    this.nx();
                    this.cq = true;
                    this.h9(false);
                    break;
            }
        }
        nx() {
            this.np = NaN;
        }
        k3() {
            return new PolarAxisRenderingParameters();
        }
        k2(a, b, c, d) {
            let e = typeCast(PolarAxisRenderingParameters.$, super.k2(a, b, c, d));
            let f = this.nn.h(b, a, c);
            let g = this.nn.i(b, a, c);
            let h = 0.5 * this.nm.np;
            let i = 0.5 * this.nm.no;
            let j = f;
            let k = g;
            let l = this.nm.nu();
            if (isNaN_(l) || isInfinity(l)) {
                return null;
            }
            if (k >= h) {
                k = l;
            }
            if (j < i) {
                j = i;
            }
            let m = a.width;
            this.nn.m(b, a, c, e, this.ly, this.lx, this.ch, 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.nn.n(a, b, c, d, e);
            d = f.p3;
            e = f.p4;
            return {
                p3: d,
                p4: e
            };
        }
        ia(a) {
            super.ia(a);
            let b = this.bi != null ? this.bi.vl : Rect.empty;
            let c = !b.isEmpty ? this.ke : Rect.empty;
            let d = this.j9();
            let e = this.j8();
            let f = this.k1.c(a, c, b, d, e);
            if (f != null) {
                this.lw = f.f.m;
                this.lz = f.f.l;
            }
        }
        get nm() {
            if (this.nl != null) {
                return this.nl;
            }
            let a = typeCast(XamDataChart.$, this.bi);
            if (a != null) {
                for (let b = 0; b < a.axes.count; b++) {
                    if (a.axes._inner[b].cm) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.nl;
        }
        set nm(a) {
            this.nl = a;
        }
        ak() {
            return this.nm;
        }
        nz(a) {
            this.nm = a;
        }
        iq(a, b) {
            super.iq(a, b);
            if (b.height != a.height || b.width != a.width) {
                this.c1();
            }
        }
        get_a2() {
            return 2;
        }
        get a2() {
            return this.get_a2();
        }
        j6(a, b, c, d, e) {
            if (this.nm == null) {
                return null;
            }
            let f = typeCast(PolarAxisRenderingParameters.$, this.k2(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 = /*@__PURE__*/ markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]);
    NumericAngleAxis.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'h3', ['LabelMode:ni:n0', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:nu:n1', [1, 0]]);
    return NumericAngleAxis;
})();
/**
 * @hidden
 */
export let NumericRadiusAxis = /*@__PURE__*/ (() => {
    class NumericRadiusAxis extends NumericAxisBase {
        a4() {
            return new NumericRadiusAxisView(this);
        }
        ht(a) {
            super.ht(a);
            this.nk = a;
        }
        get_cm() {
            return true;
        }
        ej() {
            let a = this.np;
            let b = this.no;
            let c = Math.min(this.nt(), this.ns()) * (a - b) / 2;
            c = Math.max(c, 14);
            return c;
        }
        nt() {
            return this.ke.width;
        }
        ns() {
            return this.ke.height;
        }
        constructor() {
            super();
            this.nl = null;
            this.nm = false;
            this.nn = NaN;
            this.np = 0;
            this.no = 0;
            this.nr = 0;
            this.ni = null;
            this.ab = NumericRadiusAxis.$;
            this.np = this.nz;
            this.no = this.ny;
            this.nl = new PolarAxisRenderingManager();
            this.k1 = this.kz();
        }
        av() {
            return new RadialAxisLabelPanel();
        }
        nq(a) {
            if (a == null) {
                return 0;
            }
            return a;
        }
        kz() {
            let a = super.kz();
            a.b.c = (b) => {
                if ((this.az == null || this.az.visibility == 0) && this.nj != null) {
                    if ((this.az == null || (this.az.c == 4 || this.az.c == 5)) && this.nn != b) {
                        this.nn = b;
                        this.aw.bg = b;
                        this.bi.nr();
                    }
                }
            };
            a.k = (b, c, d) => {
                let e = typeCast(PolarAxisRenderingParameters.$, b);
                this.nl.k(c, d, e.z, e.y, e.aa, e.center, e.minAngle, e.maxAngle);
            };
            a.l = (b, c, d, e) => {
                if (d == e) {
                    return;
                }
                let f = typeCast(PolarAxisRenderingParameters.$, b);
                this.nl.l(c, d, e, f.z, f.y, f.aa, f.center, f.minAngle, f.maxAngle);
            };
            a.m = (b, c) => this.nv(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.nl.o(b.t, c.crossingAngleRadians, b.z, b.y, b.aa, c.minLength, c.maxLength, c.center);
            };
            a.e = (b) => {
                b.n = this.az == null || (this.az.c == 4 || this.az.c == 0) ? b.z.top : b.z.bottom;
                b.r = b.n;
                let c = typeCast(PolarAxisRenderingParameters.$, b);
                c.crossingAngleRadians = (this.nq(this.fw) * Math.PI) / 180;
                if (this.az == null || (this.az.c == 4 || this.az.c == 5)) {
                    c.n = ViewportUtils.i(0.5, c.aa, c.z, c.y) - b.z.top;
                    c.r = c.n;
                    let d = typeCast(RadialAxisLabelPanel.$, this.aw);
                    if (d != null) {
                        let e = 0;
                        if (this.az != null && this.az.c == 4) {
                            e = 1;
                        }
                        d.dy = { $type: Point_$type, x: ViewportUtils.e(0.5, c.aa, c.z, c.y), y: e };
                        d.dv = c.crossingAngleRadians;
                    }
                }
            };
            a.p = (b, c, d) => {
                let e = typeCast(PolarAxisRenderingParameters.$, b);
                if (this.nj == null) {
                    return false;
                }
                if (c > e.effectiveMaximum) {
                    return false;
                }
                let f = false;
                f = this.az == null || (this.az.c == 4 || this.az.c == 5);
                let g = 0;
                if (f) {
                    g = this.nr;
                }
                let h = e.center.x + c * Math.cos(g);
                let i = e.center.y + c * Math.sin(g);
                h = ViewportUtils.e(h, e.aa, e.z, e.y);
                i = ViewportUtils.i(i, e.aa, e.z, e.y);
                if (h <= b.z.right && h >= b.z.left && ((i <= b.z.bottom && i >= b.z.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.aa, d.z, d.y));
            };
            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;
        }
        ek(a, b) {
            return this.nv(a);
        }
        nw(a, b, c, d, e) {
            let f = 0;
            if (b) {
                if (a <= 0) {
                    f = (Math.log(this.ly) - this.l4) / (this.l3 - this.l4);
                }
                else {
                    f = (Math.log(a) - this.l4) / (this.l3 - this.l4);
                }
            }
            else {
                f = (a - this.ly) / (this.lx - this.ly);
            }
            if (c) {
                f = 1 - f;
            }
            f = e + (f * (d - e));
            f /= 2;
            return f;
        }
        nv(a) {
            return this.nw(a, this.lk, this.ci, this.np, this.no);
        }
        nx(a) {
            let b = a * 2;
            b = (b - this.no) / (this.np - this.no);
            if (this.ch) {
                b = 1 - b;
            }
            if (this.lk) {
                return Math.exp(b * (this.l3 - this.l4) + this.l4);
            }
            else {
                return this.ly + b * (this.lx - this.ly);
            }
        }
        en(a, b) {
            return this.nx(a);
        }
        hx(a, b, c, d) {
            switch (b) {
                case "CrossingValue":
                    this.nr = this.nq(this.fw) * Math.PI / 180;
                    break;
            }
            super.hx(a, b, c, d);
            switch (b) {
                case NumericRadiusAxis.$$p[1]:
                    this.np = this.nz;
                    if (this.np < 0) {
                        this.np = 0.1;
                    }
                    if (this.np > 1) {
                        this.np = 1;
                    }
                    if (this.no >= this.np) {
                        this.no = this.np - 0.01;
                        if (this.no < 0) {
                            this.no = 0;
                            this.np = 0.01;
                        }
                    }
                    this.cq = true;
                    this.h9(false);
                    if (this.nj != null) {
                        this.nj.h8();
                    }
                    for (let e of fromEnum(this.db())) {
                        e.rm(false);
                    }
                    break;
                case NumericRadiusAxis.$$p[0]:
                    this.no = this.ny;
                    if (this.no < 0) {
                        this.no = 0.1;
                    }
                    if (this.no > 1) {
                        this.no = 1;
                    }
                    if (this.no >= this.np) {
                        this.no = this.np - 0.01;
                        if (this.no < 0) {
                            this.no = 0;
                            this.np = 0.01;
                        }
                    }
                    this.cq = true;
                    this.h9(false);
                    if (this.nj != null) {
                        this.nj.h8();
                    }
                    for (let f of fromEnum(this.db())) {
                        f.gy = true;
                        f.rm(false);
                    }
                    if (this.bi != null) {
                        this.bi.n5();
                    }
                    break;
                case "CrossingAxis":
                    let g = typeCast(NumericAngleAxis.$, d);
                    let h = typeCast(CategoryAngleAxis.$, d);
                    if (g == null && h == null) {
                        this.n4(null);
                    }
                    if (g != null) {
                        this.n4(g);
                        g.nz(this);
                    }
                    if (h != null) {
                        this.n4(h);
                        h.nn(this);
                    }
                    this.cq = true;
                    this.h9(false);
                    break;
                case "IsInverted":
                    if (this.nj != null) {
                        this.nj.cq = true;
                        this.nj.h9(false);
                    }
                    break;
            }
        }
        n4(a) {
            this.nj = a;
        }
        get nj() {
            if (this.ni != null) {
                return this.ni;
            }
            let a = typeCast(XamDataChart.$, this.bi);
            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.ni;
        }
        set nj(a) {
            this.ni = a;
        }
        ak() {
            return this.nj;
        }
        k3() {
            return new PolarAxisRenderingParameters();
        }
        k2(a, b, c, d) {
            let e = typeCast(PolarAxisRenderingParameters.$, super.k2(a, b, c, d));
            let f = this.nl.h(b, a, c);
            let g = this.nl.i(b, a, c);
            let h = 0.5 * this.np;
            let i = 0.5 * this.no;
            let j, k;
            if (Rect.l_op_Equality(b, SeriesViewer.vx)) {
                k = this.lx;
                j = this.ly;
            }
            else {
                k = Math.min(g, h);
                j = this.nx(f);
                k = this.nx(k);
                let l = this.n5(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.np - this.no) / 2;
            if (this.nr == 0) {
                p = d.width * (this.np - this.no) / 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.ly) {
                s = this.ly;
            }
            if (t > this.lx) {
                t = this.lx;
            }
            this.l1 = s;
            this.l0 = 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.nj);
            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.nu();
            if (o >= h) {
                o = y;
            }
            if (n < i) {
                n = i;
            }
            e.minLength = n;
            e.maxLength = o;
            e.effectiveMaximum = y;
            e.f = this.k6;
            let z = typeCast(LinearTickmarkValues.$, e.f);
            if (z != null) {
                z.y = this.n0(m, e.minLength, e.maxLength, b, a, c);
            }
            return e;
        }
        n5(a, b, c, d, e) {
            let f = { $type: Point_$type, x: 0.5, y: 0.5 };
            let g = 0;
            if (this.ch) {
                g = this.nv(this.ly);
            }
            else {
                g = this.nv(this.lx);
            }
            let h = 0;
            if (this.fw != null) {
                h = this.nr;
            }
            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.ch) {
                    e = this.ly;
                }
                else {
                    e = this.lx;
                }
            }
            if (f.x >= a.left && f.x <= a.right && f.y >= a.top && f.y <= a.bottom) {
                if (this.ch) {
                    d = this.lx;
                }
                else {
                    d = this.ly;
                }
            }
            return {
                p3: d,
                p4: e
            };
        }
        n0(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;
        }
        nu() {
            let a = 0;
            if (!this.ch) {
                a = this.nv(this.lx);
            }
            else {
                a = this.nv(this.ly);
            }
            return a;
        }
        m3(a) {
            if (this.nj != null) {
                this.nj.h8();
            }
        }
        ia(a) {
            super.ia(a);
            let b = this.bi != null ? this.bi.vl : Rect.empty;
            let c = !b.isEmpty ? this.ke : Rect.empty;
            let d = this.j9();
            let e = this.j8();
            let f = this.k1.c(a, c, b, d, e);
            if (f != null) {
                this.lw = f.f.m;
                this.lz = f.f.l;
            }
        }
        iq(a, b) {
            super.iq(a, b);
            if (b.height != a.height || b.width != a.width) {
                this.c1();
            }
        }
        n3(a, b, c, d, e) {
            let f = typeCast(IPolarRadialRenderingParameters_$type, this.k2(b, c, d, e));
            if (f == null) {
                return;
            }
            this.nl.l(a.d, f.minLength, f.maxLength, b, d, c, f.center, f.minAngle, f.maxAngle);
        }
        get_a2() {
            return 3;
        }
        get a2() {
            return this.get_a2();
        }
        j6(a, b, c, d, e) {
            let f = typeCast(PolarAxisRenderingParameters.$, this.k2(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 = /*@__PURE__*/ markType(NumericRadiusAxis, 'NumericRadiusAxis', NumericAxisBase.$);
    NumericRadiusAxis.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, NumericRadiusAxis, 'h3', ['InnerRadiusExtentScale:ny:n6', [1, 0], 'RadiusExtentScale:nz:n7', [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.da = true;
        }
        a1(a, b) {
            this.az.df = -1.7976931348623157E+308;
            this.az.dc = -1.7976931348623157E+308;
            this.az.de = -1.7976931348623157E+308;
            this.az.dd = -1.7976931348623157E+308;
            for (let c = 0; c < this.a.bb.count; c++) {
                let d = this.a.bb._inner[c];
                let e = this.a.ba._inner[c];
                let f = e.a;
                let g = this.az.di(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.de = Math.max(h, this.az.de);
                this.az.dd = Math.max(i, this.az.dd);
                this.az.df = Math.max(j, this.az.df);
                this.az.dc = Math.max(k, this.az.dc);
                let n = new Rect(0, l, m, j, k);
                a.add(n);
                b.add(f);
            }
        }
        a0(a, b) {
            this.az.db = -1.7976931348623157E+308;
            let c = 0;
            if (typeCast(CategoryAngleAxis.$, this.az.ad) !== null) {
                c = this.az.ad.m2() * this.az.ad.ke.width;
            }
            else if (typeCast(NumericAngleAxis.$, this.az.ad) !== null) {
                c = this.az.ad.nr() * this.az.ad.ke.width;
            }
            let d = { $type: Point_$type, x: this.az.ad.ke.width * 0.5, y: this.az.ad.ke.width * 0.5 };
            for (let e = 0; e < this.a.bb.count; e++) {
                let f = this.a.bb._inner[e];
                let g = this.a.ba._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.di(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.db = Math.max(q - c, this.az.db);
                    this.az.db = Math.max(r - c, this.az.db);
                    this.az.db = Math.max(s - c, this.az.db);
                    this.az.db = Math.max(t - c, this.az.db);
                }
                a.add(p);
                b.add(h);
            }
        }
        o() {
            return 0;
        }
        p() {
            return 0;
        }
        q() {
            return 0;
        }
        r() {
            return 0;
        }
    }
    AngleAxisLabelPanelView.$t = /*@__PURE__*/ 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.jx = AxisDefaults.h;
            this.a.j0 = AxisDefaults.g;
        }
    }
    CategoryAngleAxisView.$t = /*@__PURE__*/ 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.jx = AxisDefaults.h;
            this.a.j0 = AxisDefaults.g;
        }
    }
    NumericAngleAxisView.$t = /*@__PURE__*/ 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.jx = AxisDefaults.h;
            this.a.j0 = AxisDefaults.g;
        }
    }
    NumericRadiusAxisView.$t = /*@__PURE__*/ markType(NumericRadiusAxisView, 'NumericRadiusAxisView', NumericAxisBaseView.$);
    return NumericRadiusAxisView;
})();
