/*
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 { __extends } from "tslib";
import { RadialBucketCalculator } from "./RadialBucketCalculator";
import { markType, typeCast, Point_$type, runOn, delegateCombine, enumGetBox, markDep } from "igniteui-react-core";
import { isNaN_, intDivide, isInfinity } from "igniteui-react-core";
import { RadialBase } from "./RadialBase";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { DependencyProperty } from "igniteui-react-core";
import { TrendLineType_$type } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { DoubleCollection } from "igniteui-react-core";
import { RadialFrame } from "./RadialFrame";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { FastItemCoalescingColumn } from "./FastItemCoalescingColumn";
import { ProportionalCategoryAngleAxis } from "./ProportionalCategoryAngleAxis";
import { List$1 } from "igniteui-react-core";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { RadialBaseView } from "./RadialBaseView";
import { CollisionAvoider } from "./CollisionAvoider";
import { Clipper } from "igniteui-react-core";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { RadialTrendLineManager } from "./RadialTrendLineManager";
import { CategoryMarkerManager } from "./CategoryMarkerManager";
import { PropertyMetadata } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
 * @hidden
 */
var AnchoredRadialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AnchoredRadialBucketCalculator, _super);
    function AnchoredRadialBucketCalculator(a) {
        var _this = _super.call(this, a) || this;
        _this.f = null;
        _this.f = a;
        return _this;
    }
    AnchoredRadialBucketCalculator.prototype.getBucket = function (a) {
        var b = this.f.c1.abw;
        var c = Math.min(a * this.b, b.count - 1);
        var d = Math.min(c + this.b - 1, b.count - 1);
        var e = NaN;
        var f = NaN;
        for (var g = c; g <= d; ++g) {
            var h = b.item(g);
            if (!isNaN_(e)) {
                if (!isNaN_(h)) {
                    e = Math.min(e, h);
                    f = Math.max(f, h);
                }
            }
            else {
                e = h;
                f = h;
            }
        }
        if (!isNaN_(e)) {
            return [0.5 * (c + d), e, f, 0];
        }
        return [0.5 * (c + d), NaN, NaN, 0];
    };
    AnchoredRadialBucketCalculator.$t = markType(AnchoredRadialBucketCalculator, 'AnchoredRadialBucketCalculator', RadialBucketCalculator.$);
    return AnchoredRadialBucketCalculator;
}(RadialBucketCalculator));
export { AnchoredRadialBucketCalculator };
/**
 * @hidden
 */
var AnchoredRadialSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AnchoredRadialSeries, _super);
    function AnchoredRadialSeries() {
        var _this = _super.call(this) || this;
        _this.abr = null;
        _this.ab1 = false;
        _this.abv = null;
        _this.adb = { $type: Point_$type, x: 0, y: 0 };
        _this.abt = null;
        _this.abs = null;
        _this.abx = false;
        _this.abt = new RadialFrame(3);
        _this.abr = new CategoryLineRasterizer();
        return _this;
    }
    AnchoredRadialSeries.prototype.cq = function () {
        return new AnchoredRadialSeriesView(this);
    };
    AnchoredRadialSeries.prototype.oz = function () {
        _super.prototype.oz.call(this);
        this.yq = null;
        this.yv = null;
    };
    AnchoredRadialSeries.prototype.mb = function () {
        return AnchoredRadialSeries.$$p[4];
    };
    AnchoredRadialSeries.prototype.ko = function (a, b) {
        var c = this.na(b);
        if (c == AnchoredRadialSeries.$$p[4]) {
            return this.kp(a, b, this.acl);
        }
        if (c == AnchoredRadialSeries.$$p[0]) {
            return this.kp(a, b, this.acd);
        }
        return _super.prototype.ko.call(this, a, b);
    };
    AnchoredRadialSeries.prototype.ma = function (a) {
        var b = this.na(a);
        if (b == AnchoredRadialSeries.$$p[4]) {
            return this.acl;
        }
        if (b == AnchoredRadialSeries.$$p[0]) {
            return this.acd;
        }
        return _super.prototype.ma.call(this, a);
    };
    AnchoredRadialSeries.prototype.ja = function (a) {
        if (a == this.yx) {
            return this.zz(this.abw.count - 1, this.abw.item(this.abw.count - 1));
        }
        return _super.prototype.ja.call(this, a);
    };
    AnchoredRadialSeries.prototype.kr = function (a) {
        if (this.yq != null && this.yq.cl) {
            if (a == this.yq.lh - 1) {
                return this.yx;
            }
        }
        return _super.prototype.kr.call(this, a);
    };
    AnchoredRadialSeries.prototype.qw = function (a) {
        _super.prototype.qw.call(this, a);
        this.abq = a;
    };
    AnchoredRadialSeries.prototype.j8 = function (a, b) {
        return this.j9(a, b, this.yq, null, this.abw);
    };
    AnchoredRadialSeries.prototype.j6 = function (a, b) {
        return this.j7(a, b, this.yq, null, this.abw);
    };
    AnchoredRadialSeries.prototype.im = function (a, b, c, d, e) {
        if (this.abw == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.io(a, b, this.yq, d, e, this.abw.count, null);
    };
    AnchoredRadialSeries.prototype.i3 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.ab7(this.yq, this.ct.by, this.ct.bx, d);
        var f = new ScalerParams(0, this.ct.by, this.ct.bx, this.yq.ch, d);
        f.c = this.c9.v0;
        var g = this.abw;
        if (this.ab1 && typeCast(FastItemCoalescingColumn.$, g) !== null) {
            g = new FastItemCoalescingColumn(this.yq, g.c, false);
        }
        return this.i5(g, a, this.yq, f, e, null, b, c);
    };
    AnchoredRadialSeries.prototype.v5 = function (a, b, c) {
        if (this.yv == null || this.yq == null || this.ct == null || this.ct.by.isEmpty || this.ct.bx.isEmpty) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        var d = this.getEffectiveViewport1(this.ct);
        var e = new ScalerParams(0, this.ct.by, this.ct.bx, this.yv.ch, d);
        e.c = this.getEffectiveViewport1(this.ct);
        var f = this.i3(a, b, c);
        f = this.yv.ek(f, e);
        var g = this.yy.c(a, this.ct.by, this.ct.bx, d);
        if (!b && this.yq != null) {
            var h = this.j8(a, c);
            var i = this.j6(a, c);
            var j = this.ab7(this.yq, this.ct.by, this.ct.bx, d);
            var k = new ScalerParams(0, this.ct.by, this.ct.bx, this.yq.ch, d);
            k.c = this.c9.v0;
            var l = this.im(a, h, this.yq, k, j);
            var m = this.im(a, i, this.yq, k, j);
            if (this.yq.cl) {
                if (m <= l) {
                    j = this.ab6(i, this.yq, this.ct.by, this.ct.bx, d);
                    if (isNaN_(j)) {
                        j = 0;
                    }
                    g = this.yq.ek(i, k) + j;
                }
                else {
                    j = this.ab6(h, this.yq, this.ct.by, this.ct.bx, d);
                    if (isNaN_(j)) {
                        j = 0;
                    }
                    g = this.yq.ek(h, k) + j;
                }
            }
            else {
                if (m <= l) {
                    g = this.yq.ek(i, k) + j;
                }
                else {
                    g = this.yq.ek(h, k) + j;
                }
            }
        }
        var n = this.yy.d(g, f, this.ct.by, this.ct.bx, this.ct.getEffectiveViewport());
        var o = this.yy.e(g, f, this.ct.by, this.ct.bx, this.ct.getEffectiveViewport());
        return { $type: Point_$type, x: n, y: o };
    };
    AnchoredRadialSeries.prototype.f9 = function () {
        return this.highlightedItemsSource != null || this.acd != null;
    };
    AnchoredRadialSeries.prototype.hr = function () {
        var a = _super.prototype.hr.call(this);
        {
            var b = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "ValueMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedValueMemberPath";
                $ret.q = true;
                return $ret;
            })());
            b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.acq));
            a.add(b);
        }
        return a;
    };
    AnchoredRadialSeries.prototype.acq = function (a, b) {
        if (this.acd != null) {
            b.value = this.acd;
            return;
        }
        b.value = this.acl;
    };
    Object.defineProperty(AnchoredRadialSeries.prototype, "abw", {
        get: function () {
            return this.abv;
        },
        set: function (a) {
            if (this.abv != a) {
                var b = this.abv;
                this.abv = a;
                this.raisePropertyChanged("ValueColumn", b, this.abv);
            }
        },
        enumerable: false,
        configurable: true
    });
    AnchoredRadialSeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = new DataLegendSeriesValueInfo();
        c.a = 0;
        this.ab1 = true;
        c.l = this.i3({ $type: Point_$type, x: a, y: b }, false, false);
        this.ab1 = false;
        c.q = "Value";
        c.r = this.acl != null ? this.acl : "Value";
        c.s = this.ach != null ? this.ach : "V:";
        c.t = this.acj != null ? this.acj : "";
        var d = new DataLegendSeriesContext();
        d.e = ((function () {
            var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
            $ret.add(c);
            return $ret;
        })());
        d.h = this.l9();
        return d;
    };
    Object.defineProperty(AnchoredRadialSeries.prototype, "ac7", {
        get: function () {
            return this.c(AnchoredRadialSeries.acu);
        },
        set: function (a) {
            this.h(AnchoredRadialSeries.acu, a);
        },
        enumerable: false,
        configurable: true
    });
    AnchoredRadialSeries.prototype.ax = function (a) {
        if (a != null && a == this.yq && this.abw != null && this.abw.count > 0) {
            return new AxisRange(0, this.abw.count - 1);
        }
        if (a != null && a == this.yv && this.abw != null && this.abw.count > 0) {
            return new AxisRange(this.abw.minimum, this.abw.maximum);
        }
        return null;
    };
    AnchoredRadialSeries.prototype.zz = function (a, b) {
        if (this.ab5) {
            var c = this.abw.c;
            if (a < 0) {
                return _super.prototype.zz.call(this, a, b);
            }
            if (a > c.count - 1) {
                if (typeCast(ProportionalCategoryAngleAxis.$, this.yq) !== null) {
                    var d = this.abw;
                    return d.f;
                }
                return _super.prototype.zz.call(this, a, b);
            }
            return c.item(a);
        }
        else {
            return _super.prototype.zz.call(this, a, b);
        }
    };
    AnchoredRadialSeries.prototype.di = function (a) {
        var b = _super.prototype.di.call(this, a);
        this.abx = false;
        if (this.yq != null && this.yq.cl) {
            this.abx = true;
            b = new FastItemCoalescingColumn(this.yq, b, this.ab5);
        }
        return b;
    };
    AnchoredRadialSeries.prototype.acp = function (a, b) {
        if (this.abx) {
            var c = b;
            var d = c.c;
            a.deregisterColumn(d);
        }
        else {
            a.deregisterColumn(b);
        }
    };
    AnchoredRadialSeries.prototype.q4 = function (a, b, c, d) {
        _super.prototype.q4.call(this, a, b, c, d);
        if (this.abq.c2.g$b(a, b, c, d)) {
            this.rm(false);
            this.qg();
        }
        var e = typeCast(NumericAxisBase.$, this.yv);
        switch (b) {
            case AnchoredRadialSeries.$$p[2]:
            case AnchoredRadialSeries.$$p[3]:
                this.qa();
                break;
            case AnchoredRadialSeries.$$p[1]:
            case RadialBase.$$p[0]:
                if (this.abw != null) {
                    this.acp(this.dl, this.abw);
                    this.abw = this.di(this.acl);
                }
                break;
            case "FastItemsSource":
                if (typeCast(IFastItemsSource_$type, c) !== null) {
                    this.acp(c, this.abw);
                    this.abw = null;
                }
                if (typeCast(IFastItemsSource_$type, d) !== null) {
                    this.abw = this.di(this.acl);
                    this.abq.cx.e(this.ib);
                }
                if (e != null && !e.c1()) {
                    this.abq.cx.e(this.ib);
                    this.rm(this.ge && c != null);
                }
                break;
            case AnchoredRadialSeries.$$p[4]:
                if (this.dl != null) {
                    this.acp(this.dl, this.abw);
                    this.abw = this.di(this.acl);
                }
                break;
            case "ValueColumn":
                if (e != null && !e.c1()) {
                    this.abq.cx.e(this.ib);
                    this.rm(this.ge && this.d5);
                }
                break;
            case "TrendLineBrush":
                this.ra(b);
                break;
            case "TrendLineType":
                this.qg();
                break;
        }
    };
    AnchoredRadialSeries.prototype.o8 = function (a, b, c, d) {
        _super.prototype.o8.call(this, a, b, c, d);
        switch (a) {
            case 4:
            case 1:
            case 0:
                this.abq.cx.e(this.ib);
                break;
        }
        this.abq.c2.g$e(a, b, c, d);
        switch (a) {
            case 4:
                if (this.yv != null && !this.yv.c1()) {
                    this.rm(true);
                }
                break;
            case 1:
                if (this.yv != null && !this.yv.c1()) {
                    this.rm(true);
                }
                break;
            case 0:
                if (this.yv != null && !this.yv.c1()) {
                    this.rm(true);
                }
                break;
            case 2:
                if (this.acl != null && this.abq.cx.b > 0 && this.yv != null && !this.yv.c1()) {
                    this.rm(true);
                }
                break;
            case 3:
                if (d == this.acl) {
                    if (this.yv != null && !this.yv.c1()) {
                        this.rm(true);
                    }
                }
                break;
        }
    };
    AnchoredRadialSeries.prototype.hc = function (a, b, c) {
        var d = _super.prototype.hc.call(this, a, b, c);
        var e = c;
        if (this.dl == null || this.dl.count == 0 || this.yq == null || this.abw == null || this.yq.lg == 0 || this.yv == null || isInfinity(this.yv.ly) || isInfinity(this.yv.lx) || e.cx.b < 1) {
            d = false;
        }
        return d;
    };
    AnchoredRadialSeries.prototype.getOffsetValue = function () {
        return this.ab7(this.yq, this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
    };
    AnchoredRadialSeries.prototype.getCategoryWidth = function () {
        return this.yq.getCategorySize(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
    };
    AnchoredRadialSeries.prototype.get_ab2 = function () {
        return false;
    };
    Object.defineProperty(AnchoredRadialSeries.prototype, "ab2", {
        get: function () {
            return this.get_ab2();
        },
        enumerable: false,
        configurable: true
    });
    AnchoredRadialSeries.prototype.get_ei = function () {
        return true;
    };
    AnchoredRadialSeries.prototype.get_f3 = function () {
        return this.yv != null && this.yv.ch;
    };
    AnchoredRadialSeries.prototype.ab7 = function (a, b, c, d) {
        var e = 0;
        var f = this.preferredCategoryMode(a);
        if (f == 0 && a.categoryMode != 0) {
            f = 1;
        }
        switch (f) {
            case 0:
                e = 0;
                break;
            case 1:
                e = 0.5 * a.getCategorySize(b, c, d);
                break;
            case 2:
                e = a.getGroupCenter(this.zy(), b, c, d);
                break;
        }
        if (a.ch) {
            e = -e;
        }
        return e;
    };
    AnchoredRadialSeries.prototype.ab6 = function (a, b, c, d, e) {
        var f = 0;
        var g = this.preferredCategoryMode(b);
        if (g == 0 && b.categoryMode != 0) {
            g = 1;
        }
        switch (g) {
            case 0:
                f = 0;
                break;
            case 1:
                f = 0.5 * b.m4(a, c, d, e);
                break;
            case 2:
                f = b.m3(a, this.zy(), c, d, e);
                break;
        }
        if (b.ch) {
            f = -f;
        }
        return f;
    };
    AnchoredRadialSeries.prototype.get_ab4 = function () {
        return false;
    };
    Object.defineProperty(AnchoredRadialSeries.prototype, "ab4", {
        get: function () {
            return this.get_ab4();
        },
        enumerable: false,
        configurable: true
    });
    AnchoredRadialSeries.prototype.get_aby = function () {
        return false;
    };
    Object.defineProperty(AnchoredRadialSeries.prototype, "aby", {
        get: function () {
            return this.get_aby();
        },
        enumerable: false,
        configurable: true
    });
    AnchoredRadialSeries.prototype.aay = function (a, b) {
        var _this = this;
        var c = b.by;
        var d = b.bx;
        var e = this.getEffectiveViewport1(b);
        var f = this.yq;
        var g = this.yv;
        var h = g.ly;
        var i = g.lx;
        a.f.clear();
        a.n.clear();
        a.q.clear();
        var j = this.w7();
        var k = 0;
        var l = b;
        var m = f.cl;
        var n = new CollisionAvoider();
        var o = 0;
        var p = 0;
        var q = b.cx.d;
        o = this.ab7(f, c, d, e);
        l.c2.i = this.yv.np;
        l.c2.h = this.yv.no;
        l.c2.j = function (r, s) { return _this.ab8(r, s, c, d, e); };
        l.c2.k = function (r, s) { return _this.ab9(r, s, c, d, e); };
        var r = ((function () {
            var $ret = new Clipper(0, d, false);
            $ret.i = a.q;
            return $ret;
        })());
        var s = ((function () {
            var $ret = new TrendResolutionParams();
            $ret.e = b.cx.b;
            $ret.f = b.cx.c;
            $ret.g = q;
            $ret.a = o;
            $ret.d = _this.ib;
            $ret.i = d;
            $ret.h = e;
            $ret.j = c;
            return $ret;
        })());
        l.c2.l(a.q, this.abu, this.abw, this.acb, function (t) { return _this.yq.getScaledAngle(t); }, function (t) { return _this.yv.nv(t); }, s, r);
        var t = true;
        if (this.ab3(b)) {
            q--;
        }
        for (var u = b.cx.c; u <= q; ++u) {
            var v = u;
            if (v * b.cx.b >= this.yq.lg) {
                v -= intDivide((this.yq.lg), b.cx.b);
            }
            var w = b.cx.getBucket(v);
            p = 0;
            if (m) {
                p = this.zq(v, c, d, e);
            }
            w[3] = p;
            if (!isNaN_(w[0])) {
                var x = false;
                if (m) {
                    o = this.ab6(v, f, c, d, e);
                    if (isNaN_(o)) {
                        o = 0;
                        x = true;
                    }
                }
                w[0] = f.getScaledAngle(w[0]) + o;
                if (w[1] < h || w[1] > i) {
                    if (this.ab4) {
                        if (w[1] > i && this.aby) {
                        }
                        else {
                            x = true;
                        }
                    }
                    else {
                        if (w[1] > i && this.aby) {
                        }
                        else {
                            continue;
                        }
                    }
                }
                if (x) {
                    w[1] = NaN;
                    w[2] = NaN;
                }
                w[1] = g.nv(w[1]);
                if (b.cx.b > 1) {
                    if (w[2] < h || w[2] > i) {
                        continue;
                    }
                    w[2] = g.nv(w[2]);
                }
                else {
                    w[2] = w[1];
                }
                if ((isNaN_(w[1]) || isNaN_(w[2])) && t && this.ab2 && this.ab0()) {
                    q++;
                }
                else {
                    t = false;
                }
                a.f.add(w);
                if (j) {
                    var y = Math.min(v * b.cx.b, this.dl.count - 1);
                    var z = false;
                    if (this.yq.cl) {
                        var aa = this.yq;
                        var ab = aa.hasOthersCategory && (v * b.cx.b) == this.yq.lg - 1;
                        z = ab;
                    }
                    var ac = this.yy.d(w[0], w[1], c, d, e);
                    var ad = this.yy.e(w[0], w[1], c, d, e);
                    var ae = new Rect(0, ac - 5, ad - 5, 11, 11);
                    if (!isNaN_(ac) && !isNaN_(ad) && !isInfinity(ac) && !isInfinity(ad) && n.tryAdd(ae)) {
                        a.n.add({ $type: Point_$type, x: w[0], y: w[1] });
                        var af = b.cy.item(k);
                        af.al = v;
                        af.ak = y;
                        af.content.item = this.dl.item(y);
                        if (z) {
                            af.ak = this.dl.count;
                            var ag = this.yq;
                            af.content.item = this.yx;
                        }
                        ++k;
                    }
                }
            }
            else {
                if (t && this.ab2 && this.ab0()) {
                    q++;
                }
            }
        }
        b.cy.count = k;
        return;
    };
    AnchoredRadialSeries.prototype.ab8 = function (a, b, c, d, e) {
        return this.yy.d(a, b, c, d, e);
    };
    AnchoredRadialSeries.prototype.ab9 = function (a, b, c, d, e) {
        return this.yy.e(a, b, c, d, e);
    };
    AnchoredRadialSeries.prototype.ab3 = function (a) {
        var b = a;
        return !this.ab2 && b.cx.c == 0 && b.cx.d == this.yq.lg;
    };
    AnchoredRadialSeries.prototype.abp = function (a, b, c) {
        var d = null;
        var e = c.by;
        var f = c.bx;
        if (b > -1 && !e.isEmpty && !f.isEmpty) {
            var g = a._inner[0][0] < f.left - 2000 ? f.left - 10 : NaN;
            var h = f.bottom + 10;
            var i = a._inner[b][0] > f.right + 2000 ? f.right + 10 : NaN;
            var j = f.top - 10;
            d = new Clipper(1, g, h, i, j, false);
        }
        return d;
    };
    AnchoredRadialSeries.prototype.act = function (a, b, c, d, e) {
        if (a.count > 0 && d.count > 0) {
            if (!e || this.abz()) {
                a.add(this.adb);
                a.add(a._inner[0]);
                d.add(this.adb);
                d.add(d._inner[0]);
            }
        }
    };
    AnchoredRadialSeries.prototype.ab0 = function () {
        return !this.abz();
    };
    AnchoredRadialSeries.prototype.abz = function () {
        var a = this.ct.by;
        return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
    };
    AnchoredRadialSeries.prototype.o2 = function (a, b) {
        _super.prototype.o2.call(this, a, b);
        var c = b;
        if (a) {
            c.cy.clear();
        }
        c.c2.g$d();
    };
    AnchoredRadialSeries.prototype.aa1 = function (a, b) {
        this.qs();
        var c = b.by;
        var d = b.bx;
        var e = this.getEffectiveViewport1(b);
        var f = this.wc(b);
        var g = b;
        g.c2.g$g(a.q);
        var h = new List$1(Point_$type, 0);
        for (var i = 0; i < a.n.count; i++) {
            var j = a.n._inner[i];
            var k = this.yy.d(j.x, j.y, c, d, e);
            var l = this.yy.e(j.x, j.y, c, d, e);
            var m = { $type: Point_$type, x: k, y: l };
            h.add(m);
        }
        CategoryMarkerManager.e(this, h, g.cy, this.w9);
        this.aco(b, a);
        g.cr();
        this.acn(d, c, e, f, g);
    };
    AnchoredRadialSeries.prototype.abo = function (a, b, c) {
        if (b < a || a < 0 || a > this.abw.count || b < 0 || b > this.abw.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.cn;
        var f = null;
        if (e) {
            f = c.i$b;
        }
        for (var g = a; g <= b; g++) {
            var h = g;
            if (e) {
                h = f._inner[h];
            }
            d[g - a] = this.dl.item(g);
        }
        return d;
    };
    AnchoredRadialSeries.prototype.acr = function (a, b, c, d, e, f) {
        var g = this.bv != 1;
        var h = this.cn != 1;
        var i = this.cm != 1;
        var j = this.d0;
        this.y6.a3(this.y6.d, d.cn, a, b, c, d, e, f, true);
        this.y6.aa(this.h9);
        var k = this.y6.ax;
        var l = null;
        var m = null;
        var n = null;
        var o = this.dl;
        var p = null;
        var q = null;
        var r = null;
        if (j && this.c9 != null && !k.e) {
            var s = this.vh(k.z);
            var t = this.vi(k.z);
            this.y6.ag = s;
            this.y6.ah = t;
            k.aa = s;
            k.ab = t;
        }
        if (g && this.c9 != null) {
            l = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, true);
            if (this.c9.dj.isCrossContextHighlight(this)) {
                p = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, true);
            }
            k.c = l;
        }
        if (h && this.c9 != null) {
            m = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, true);
            if (m == null && this.bl != null) {
                m = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, k.z, k.y, true);
            }
            if (this.c9.dk.isCrossContextHighlight(this)) {
                q = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, true);
            }
            k.d = m;
        }
        if (i && this.c9 != null) {
            n = this.c9.di.getHighlightingInfo(this, o, k.z, k.y, true);
            if (this.c9.di.isCrossContextHighlight(this)) {
                r = this.c9.di.getHighlightingInfo(this, o, k.z, k.y, true);
            }
            k.b = n;
        }
        k.h = f;
        this.aaz(k);
        this.y6.y(this, l, m, n, f, g, h, i, k.v, this.c9.dj.totalHighWaterMark, k.x, this.c9.dk.totalHighWaterMark, k.t, this.c9.di.totalHighWaterMark);
    };
    AnchoredRadialSeries.prototype.acs = function (a, b, c, d, e, f) {
        var g = this.bv != 1;
        var h = this.cn != 1;
        var i = this.cn != 1;
        var j = this.d0;
        this.y6.a3(this.y6.b, d.cn, a, b, c, d, e, f, false);
        this.y6.ab(this.h9);
        var k = this.y6.ay;
        var l = null;
        var m = null;
        var n = null;
        var o = this.dl;
        if (j && this.c9 != null && !k.e) {
            var p = this.vg(k.z);
            var q = this.vj(k.z);
            this.y6.ag = p;
            this.y6.ah = q;
            k.aa = p;
            k.ab = q;
        }
        if (g && this.c9 != null) {
            l = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, false);
            k.c = l;
        }
        if (h && this.c9 != null) {
            m = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, false);
            if (m == null && this.bl != null) {
                m = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, k.z, k.y, false);
            }
            k.d = m;
        }
        k.h = f;
        this.aa0(k);
        this.y6.z(this, l, m, n, f, g, h, i, b < 0);
    };
    AnchoredRadialSeries.prototype.aco = function (a, b) {
        a.b7 = true;
        this.y6.a1(this, this.zm(), runOn(this, this.ye), this.zw(a), this.zx(a));
        var c = this.y6.d;
        var d = c != null;
        var e = this.yq;
        if (e == null) {
            return;
        }
        var f = this.getEffectiveViewport1(a);
        var g = new ScalerParams(0, a.by, a.bx, e.ch, f);
        var h = this.dl == null ? 0 : this.dl.count;
        var i = a;
        var j = b.f;
        var k = i.cx.c;
        var l = i.cx.d;
        var m = i.cx.b;
        var n = k * m;
        for (var o = 0; o < a.cy.count; o++) {
            var p = a.cy.item(o);
            var q = p.content;
            if (d) {
                var r = p.al;
                this.acr(j, r, h, e, g, a.q);
            }
            this.y6.ac(p, q);
        }
    };
    AnchoredRadialSeries.prototype.acn = function (a, b, c, d, e) {
        e.c3(a, b, c, d);
    };
    AnchoredRadialSeries.prototype.sa = function () {
        _super.prototype.sa.call(this);
        if (this.index < 0) {
            return;
        }
        this.abq.c4();
    };
    AnchoredRadialSeries.prototype.ku = function (a, b) {
        if (a == this.abq.c2.g$j) {
            return null;
        }
        return _super.prototype.ku.call(this, a, b);
    };
    AnchoredRadialSeries.prototype.gb = function (a) {
        var b = this.ct.by;
        b = b.copy();
        var c = this.ct.bx;
        var d = !b.isEmpty && !c.isEmpty && this.dl != null ? this.dl.indexOf(a) : -1;
        if (this.yq == null || this.abw == null || this.yv == null) {
            return false;
        }
        if (d < 0 || d > this.abw.count - 1) {
            return false;
        }
        var e = this.yq.getScaledAngle(d);
        var f = this.yv.nv(this.abw.item(d));
        if (isNaN_(f)) {
            f = (this.yv.no + this.yv.np) / 2;
        }
        var g = 0.5 + (Math.cos(e) * f);
        var h = 0.5 + (Math.sin(e) * f);
        if (!isNaN_(g)) {
            if (g < b.left + 0.1 * b.width) {
                g = g + 0.4 * b.width;
                b.x = g - 0.5 * b.width;
            }
            if (g > b.right - 0.1 * b.width) {
                g = g - 0.4 * b.width;
                b.x = g - 0.5 * b.width;
            }
        }
        if (!isNaN_(h)) {
            if (h < b.top + 0.1 * b.height) {
                h = h + 0.4 * b.height;
                b.y = h - 0.5 * b.height;
            }
            if (h > b.bottom - 0.1 * b.height) {
                h = h - 0.4 * b.height;
                b.y = h - 0.5 * b.height;
            }
        }
        if (this.c1 != null) {
            this.c1.au(this.c9, b, true);
        }
        return d >= 0;
    };
    AnchoredRadialSeries.prototype.ro = function (a, b) {
        _super.prototype.ro.call(this, a, b);
        if (!this.gy) {
            this.ct.a4(b);
            return;
        }
        this.ct.a4(b);
        var c = typeCast(AnchoredRadialSeriesView.$, this.cs);
        c.cx.e(this.ib);
        if (this.d3(this.cs)) {
            return;
        }
        if (!this.gq) {
            this.abt = new RadialFrame(3);
            this.aay(this.abt, c);
        }
        this.gq = false;
        this.aa1(this.abt, c);
        this.gy = false;
    };
    AnchoredRadialSeries.prototype.rl = function (a, b, c, d, e) {
        _super.prototype.rl.call(this, a, b, c, d, e);
        var f = this.a9.a$j.item(d);
        var g = f;
        g.cx.e(this.ib);
        f.a3(c);
        if (this.d3(g)) {
            return;
        }
        if (this.abs == null) {
            this.abs = new RadialFrame(3);
        }
        this.abs.v();
        this.aay(this.abs, g);
        this.aa1(this.abs, g);
    };
    AnchoredRadialSeries.prototype.pu = function (a) {
        _super.prototype.pu.call(this, a);
        this.bb.exportTrendlineData(this, a, this.abq.c2.g$j);
    };
    AnchoredRadialSeries.$t = markType(AnchoredRadialSeries, 'AnchoredRadialSeries', RadialBase.$);
    AnchoredRadialSeries.acu = DependencyProperty.i("ActualTrendLineBrush", Brush.$, AnchoredRadialSeries.$, new PropertyMetadata(2, null, function (a, b) { return a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue); }));
    AnchoredRadialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, AnchoredRadialSeries, 'raisePropertyChanged', ['HighlightedValueMemberPath:acd:acv', [2, null], 'UseCategoryNormalizedValues:ab5:ac3', [0, false], 'ValueMemberAsLegendLabel:ach:ac4', [2, null], 'ValueMemberAsLegendUnit:acj:ac5', [2, null], 'ValueMemberPath:acl:ac6', [2, null], 'TrendLineType:abu:ac1', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness:aca:ac0', [1, 1.5], 'TrendLinePeriod:acb:acz', [1, 7], 'TrendLineZIndex:acc:ac2', [1, 1], 'TrendLineBrush:ac8:acw', [Brush.$, null], 'TrendLineDashArray:ac9:acx', [DoubleCollection.$], 'TrendLineDashCap:ada:acy', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)]]);
    return AnchoredRadialSeries;
}(RadialBase));
export { AnchoredRadialSeries };
/**
 * @hidden
 */
var AnchoredRadialSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AnchoredRadialSeriesView, _super);
    function AnchoredRadialSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.c1 = null;
        _this.c2 = null;
        _this.cx = new AnchoredRadialBucketCalculator(_this);
        _this.c1 = a;
        _this.c2 = new RadialTrendLineManager();
        return _this;
    }
    AnchoredRadialSeriesView.prototype.c3 = function (a, b, c, d) {
    };
    AnchoredRadialSeriesView.prototype.c4 = function () {
        this.c1.ac7 = null;
        if (this.c1.ac8 != null) {
            this.c1.ac7 = this.c1.ac8;
        }
        else {
            this.c1.ac7 = this.c1.u2;
        }
    };
    AnchoredRadialSeriesView.prototype.a7 = function (a, b) {
        if (a.d) {
            if (!b) {
            }
            if (this.c1.abu != 0 && !b) {
                var c = this.c2.g$j;
                c.ad = this.c1.aca;
                c._stroke = this.c1.ac7;
                c.ai = this.c1.ac9;
                c.aj = this.c1.ada;
                a.v(c);
            }
        }
        _super.prototype.a7.call(this, a, b);
    };
    AnchoredRadialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.c1.yq.f1 != null) {
            a += "<span>${item." + this.c1.yq.f1 + "}</span><br/>";
        }
        a += "<span";
        var b = this.e.a9.a$u(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.c1.title + ": </span><span class='ui-priority-primary'>" + "${item." + this.c1.acl + "}</span></div>";
        return a;
    };
    AnchoredRadialSeriesView.$t = markType(AnchoredRadialSeriesView, 'AnchoredRadialSeriesView', RadialBaseView.$);
    return AnchoredRadialSeriesView;
}(RadialBaseView));
export { AnchoredRadialSeriesView };
