UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

2,624 lines 94.3 kB
/*
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 { AnnotationLayer } from "./AnnotationLayer";
import { DependencyProperty } from "igniteui-angular-core";
import { Base, runOn, delegateCombine, String_$type, typeCast, Array_$type, enumGetBox, EnumUtil, fromEnum, delegateRemove, Point_$type, Date_$type, markType, markDep } from "igniteui-angular-core";
import { Series } from "./Series";
import { CalloutPlacementPositionsCollection } from "./CalloutPlacementPositionsCollection";
import { HighlightedValueLabelMode_$type } from "igniteui-angular-core";
import { AutoCalloutVisibilityMode_$type } from "./AutoCalloutVisibilityMode";
import { Brush } from "igniteui-angular-core";
import { Thickness } from "igniteui-angular-core";
import { CalloutCollisionMode_$type } from "igniteui-angular-core";
import { FontUtil } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { BindingFormatter } from "igniteui-angular-core";
import { CalloutLayerFrame } from "./CalloutLayerFrame";
import { Size } from "igniteui-angular-core";
import { HashSet$1 } from "igniteui-angular-core";
import { CalloutAnnotationWrapper } from "./CalloutAnnotationWrapper";
import { List$1 } from "igniteui-angular-core";
import { LinkedList$1 } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { LinkedListNode$1 } from "igniteui-angular-core";
import { LabelCollisionManager } from "igniteui-angular-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { CalloutAnnotation } from "./CalloutAnnotation";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { CalloutLabelUpdatingEventArgs } from "./CalloutLabelUpdatingEventArgs";
import { CalloutSeriesSelectingEventArgs } from "./CalloutSeriesSelectingEventArgs";
import { UserAnnotationDataContext } from "./UserAnnotationDataContext";
import { CalloutStyleUpdatingEventArgs } from "./CalloutStyleUpdatingEventArgs";
import { BrushUtilCore } from "igniteui-angular-core";
import { LabelCollisionInfo } from "igniteui-angular-core";
import { BrushUtil } from "igniteui-angular-core";
import { CalloutRenderStyleUpdatingEventArgs } from "./CalloutRenderStyleUpdatingEventArgs";
import { ImageLoadParam } from "igniteui-angular-core";
import { ImageLoader } from "igniteui-angular-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { QuadTreeBoundingBox } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ViewportUtils } from "./ViewportUtils";
import { CalloutBadgeInfo } from "./CalloutBadgeInfo";
import { CalloutContentUpdatingEventArgs } from "./CalloutContentUpdatingEventArgs";
import { CalloutKey } from "./CalloutKey";
import { DataContext } from "igniteui-angular-core";
import { HashPool$2 } from "igniteui-angular-core";
import { AxisRange } from "./AxisRange";
import { Tuple$2 } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_, isInfinity } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { FastItemObjectColumn } from "igniteui-angular-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { TextBlock } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
import { Rectangle } from "igniteui-angular-core";
import { Line } from "igniteui-angular-core";
import { Image } from "igniteui-angular-core";
import { TranslateTransform } from "igniteui-angular-core";
import { CalloutViewHelper } from "./CalloutViewHelper";
/**
 * @hidden
 */
export let CalloutLayer = /*@__PURE__*/ (() => {
    class CalloutLayer extends AnnotationLayer {
        constructor() {
            super();
            this.ab0 = false;
            this.abv = false;
            this.abx = false;
            this.abw = true;
            this.aid = new Size(1, 0, 0);
            this.abu = true;
            this.calloutStyleUpdating = null;
            this.calloutRenderStyleUpdating = null;
            this.abg = null;
            this.abh = null;
            this.abi = null;
            this.abf = null;
            this.abe = null;
            this.acr = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            this.acu = new List$1(CalloutAnnotationWrapper.$, 0);
            this.acv = new List$1(CalloutAnnotationWrapper.$, 0);
            this.aa4 = null;
            this.aas = null;
            this.abd = null;
            this.abp = null;
            this.abb = null;
            this.acw = new List$1(CalloutAnnotationWrapper.$, 0);
            this.acx = new List$1(CalloutAnnotationWrapper.$, 0);
            this.adk = 0;
            this.ac0 = -1;
            this.acz = -1;
            this.acs = new LinkedList$1(CalloutAnnotationWrapper.$);
            this.acp = new Dictionary$2(CalloutAnnotationWrapper.$, LinkedListNode$1.$.specialize(CalloutAnnotationWrapper.$), 0);
            this.abq = null;
            this.aib = new Rect(0, 0, 0, 1, 1);
            this.ab2 = false;
            this.ab4 = false;
            this.adj = 0;
            this.aia = Rect.empty;
            this.ab1 = false;
            this.ab3 = false;
            this.calloutContentUpdating = null;
            this.calloutLabelUpdating = null;
            this.calloutSeriesSelecting = null;
            this.act = new List$1(SeriesPointOfInterest.$, 0);
            this.ab6 = false;
            this.ab7 = false;
            this.ac1 = 0;
            this.ab5 = false;
            this.aav = null;
            this.aby = false;
            this.abz = true;
            this.aaw = 1;
            FastItemObjectColumn.m();
            this.aas = null;
            this.aa4 = new CalloutPlacementPositionsCollection();
            let a = this.aa4;
            a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.afv));
            this.x6 = true;
            let b = new CalloutLayerFrame();
            let c = new CalloutLayerFrame();
            let d = new CalloutLayerFrame();
            let e = this.km / 1000;
            this.xx = b;
            this.xw = c;
            this.xy = d;
            this.ab = CalloutLayer.$;
        }
        bk() {
            return new CalloutLayer();
        }
        get_eq() {
            return true;
        }
        afv(a, b) {
            this.af4();
        }
        af4() {
            this.aas = this.aau(this.aa5);
            this.af1();
        }
        afw(a, b) {
            this.acv.clear();
            this.r8(false);
        }
        po(a, b, c, d) {
            super.po(a, b, c, d);
            let e = this.acq();
            switch (a) {
                case 3:
                    this.agd(b, e, true);
                    break;
                case 1:
                    for (let f = b; f < b + c; f++) {
                        let g = new CalloutAnnotation();
                        let h = new CalloutAnnotationWrapper();
                        h.b = g;
                        h.b.series = this.aba;
                        this.acv.insert(f, h);
                        this.agd(f, e, false);
                    }
                    break;
                case 0:
                    this.acv.v(b, c);
                    break;
                case 2:
                    for (let i = b; i < b + c; i++) {
                        this.agd(i, e, true);
                    }
                    break;
                case 4:
                    this.acv.clear();
                    for (let j = 0; j < this.dp.count; j++) {
                        let k = new CalloutAnnotation();
                        let l = new CalloutAnnotationWrapper();
                        l.b = k;
                        l.b.series = this.aba;
                        this.acv.add(l);
                        this.agd(j, e, false);
                    }
                    break;
            }
            this.r8(true);
        }
        gl(a) {
            return false;
        }
        aif() {
            let a = new Thickness(0, DeviceUtils.g(3));
            if (isNaN_(this.aie.left) || isNaN_(this.aie.top) || isNaN_(this.aie.right) || isNaN_(this.aie.bottom)) {
                a = new Thickness(0, DeviceUtils.g(3));
            }
            else {
                a = this.aie;
            }
            return a;
        }
        xe() {
            if (!this.abu) {
                return this.aid;
            }
            let a = 0;
            let b = 0;
            if (!this.aca) {
                this.aid = new Size(1, 0, 0);
                return this.aid;
            }
            if (this.acc) {
                this.ab0 = true;
                let c = new CalloutLayerFrame();
                this.zf(c, this.cw);
                this.ab0 = false;
                if (this.acw != null && this.acw.count == 0) {
                    this.aid = new Size(1, 0, 0);
                    return this.aid;
                }
            }
            let d = this.aif();
            let e = -1.7976931348623157E+308;
            let f = -1.7976931348623157E+308;
            for (let g = 0; g < this.acw.count; g++) {
                let h = this.acw._inner[g].b.text;
                let i = this.aa3.da(h, d, null);
                if (!isNaN_(i.height)) {
                    f = Math.max(i.height, f);
                }
                if (!isNaN_(i.width)) {
                    e = Math.max(i.width, e);
                }
            }
            a = f;
            b = e;
            if (!isNaN_(this.adg)) {
                a += this.adg;
            }
            if (!isNaN_(this.adg)) {
                b += this.adg;
            }
            if (!isNaN_(this.ada)) {
                a = Math.max(a, this.ada);
            }
            if (!isNaN_(this.ac8)) {
                a = Math.min(a, this.ac8);
            }
            if (!isNaN_(this.adb)) {
                b = Math.max(b, this.adb);
            }
            if (!isNaN_(this.ac9)) {
                b = Math.min(b, this.ac9);
            }
            this.abw = false;
            this.aid = new Size(1, b, a);
            return this.aid;
        }
        acq() {
            let a = new Dictionary$2(String_$type, Series.$, 0);
            if (this.dc != null) {
                for (let b = 0; b < this.dc.b9.count; b++) {
                    let c = this.dc.b9._inner[b];
                    if (c.name != null && !a.containsKey(c.name)) {
                        a.addItem(c.name, c);
                    }
                }
            }
            return a;
        }
        agd(a, b, c) {
            if (this.abo == null || this.abm == null) {
                return;
            }
            let d = a;
            if (this.abn != null) {
                d = this.abn.item(a);
            }
            let e = this.abo.item(a);
            let f = this.abm.item(a);
            let g = this.acv._inner[a];
            if (this.abl != null) {
                if (g.b.ao != this.abl.item(a)) {
                    g.b.key = this.abl.item(a);
                }
            }
            if (this.acp.containsKey(g)) {
                g.b = this.acp.item(g).c.b;
            }
            g.b.xValue = d;
            g.b.yValue = e;
            g.b.badgeImage = this.aex(a);
            if (this.calloutLabelUpdating != null) {
                let h = ((() => {
                    let $ret = new CalloutLabelUpdatingEventArgs();
                    $ret.d = d;
                    $ret.e = e;
                    $ret.item = this.dp.item(a);
                    $ret.c = f;
                    return $ret;
                })());
                this.calloutLabelUpdating(this, h);
                if (h.c != null && !Base.equalsStatic(h.c, g.b.bc)) {
                    let i = h.c;
                    if (this.aav != null) {
                        g.b.text = this.aav.i(i);
                    }
                    else {
                        g.b.text = i != null ? i.toString() : "";
                    }
                }
            }
            else {
                if (this.aav != null) {
                    g.b.text = this.aav.i(f);
                }
                else {
                    g.b.text = f != null ? f.toString() : "";
                }
            }
            if (this.abk != null) {
                g.b.content = this.abk.item(a);
            }
            else {
                g.b.content = this.dp.item(a);
            }
            g.b.n = typeCast(UserAnnotationDataContext.$, this.dp.item(a));
            if (this.calloutSeriesSelecting != null) {
                let j = ((() => {
                    let $ret = new CalloutSeriesSelectingEventArgs();
                    $ret.c = d;
                    $ret.d = e;
                    $ret.item = this.dp.item(a);
                    return $ret;
                })());
                this.calloutSeriesSelecting(this, j);
                if (j.a != null) {
                    g.b.series = j.a;
                }
                else if (j.e != null) {
                    if (b.containsKey(j.e)) {
                        g.b.series = b.item(j.e);
                    }
                }
            }
            this.age(g);
            if (c && g.c != null) {
                this.agf(g.c, g);
            }
        }
        age(a) {
            let b = new Thickness(0, DeviceUtils.g(3));
            if (isNaN_(this.aie.left) || isNaN_(this.aie.top) || isNaN_(this.aie.right) || isNaN_(this.aie.bottom)) {
                b = new Thickness(0, DeviceUtils.g(3));
            }
            else {
                b = this.aie;
            }
            let c = DeviceUtils.g(3);
            if (isNaN_(this.ac7)) {
                c = DeviceUtils.g(3);
            }
            else {
                c = this.ac7;
            }
            let d = this.aa3.c4(a.b.l, a.b.itemColor);
            let e = this.aa3.c8(a.b.l, a.b.itemColor);
            let f = this.aa3.c6(a.b.l, a.b.itemColor);
            let g = this.ah2 != null && !this.acl ? this.ah2 : d;
            let h = this.ah9 != null ? this.ah9 : null;
            let i = this.ah7 != null ? this.ah7 : this.aa3.c7();
            let j = this.ah5 != null ? this.ah5 : this.aa3.c5();
            let k = this.ah8 != null && !this.acm ? this.ah8 : e;
            let l = this.ah6 != null ? this.ah6 : f;
            let m = isNaN_(this.adh) ? 0 : this.adh;
            if (h == null && (this.acj || this.ah7 != null || this.ah5 != null)) {
                let n = g;
                if (n == null || BrushUtilCore.a(g)) {
                    n = this.dc != null ? this.dc.x7 : null;
                    if (a.c != null && (a.c.b == 8 || a.c.b == 9)) {
                        n = a.b.itemColor;
                    }
                    if (n == null || BrushUtilCore.a(g)) {
                        n = BrushUtil.j(255, 255, 255, 255);
                    }
                }
                h = BrushUtil.l(n, j, i);
            }
            if (h == null) {
                h = this.aa3.c7();
            }
            let o = this.ah3 != null ? this.ah3 : this.ab8 ? d : h;
            let p = this.ah4 != null ? this.ah4 : this.ab8 ? e : h;
            let q = !isNaN_(this.ac5) ? this.ac5 : 1;
            let r = !isNaN_(this.ac4) ? this.ac4 : 10;
            let s = !isNaN_(this.ac6) ? this.ac6 : 10;
            let t = !isNaN_(this.ac3) ? this.ac3 : 5;
            let u = !isNaN_(this.ac2) ? this.ac2 : 5;
            let v = this.ab9;
            let w = a.b.bb;
            if (!v) {
                t = 0;
                q = 0;
                r = 0;
                s = 0;
                w = null;
            }
            if (this.ach && this.calloutStyleUpdating != null) {
                let x = new CalloutStyleUpdatingEventArgs();
                x.item = a.b.an;
                x.xValue = a.b.ap;
                x.yValue = a.b.aq;
                x.series = a.b.l;
                x.background = g;
                x.backgroundCorner = c;
                x.textColor = h;
                x.outline = k;
                x.leaderBrush = l;
                x.strokeThickness = m;
                x.badgeOutline = p;
                x.badgeCorner = u;
                x.badgeBackground = o;
                x.badgeThickness = q;
                x.badgeHeight = r;
                x.badgeWidth = s;
                x.badgeVisible = v;
                x.badgeGap = t;
                x.badgeImage = w;
                x.bacgkroundPaddingLeft = b.left;
                x.bacgkroundPaddingTop = b.top;
                x.bacgkroundPaddingBottom = b.bottom;
                x.bacgkroundPaddingRight = b.right;
                x.o = a.b.n;
                this.calloutStyleUpdating(this, x);
                g = x.background;
                h = x.textColor;
                k = x.outline;
                l = x.leaderBrush;
                m = x.strokeThickness;
                c = x.backgroundCorner;
                p = x.badgeOutline;
                o = x.badgeBackground;
                v = x.badgeVisible;
                b = new Thickness(1, x.bacgkroundPaddingLeft, x.bacgkroundPaddingTop, x.bacgkroundPaddingRight, x.bacgkroundPaddingBottom);
                if (v) {
                    q = x.badgeThickness;
                    r = x.badgeHeight;
                    s = x.badgeWidth;
                    t = x.badgeGap;
                    w = x.badgeImage;
                    u = x.badgeCorner;
                }
                else {
                    t = 0;
                    q = 0;
                    r = 0;
                    s = 0;
                    w = null;
                }
            }
            a.b.backgroundPadding = b;
            a.b.backgroundCornerRadius = c;
            a.b.background = g;
            a.b.textColor = h;
            a.b.outline = k;
            a.b.leaderBrush = l;
            a.b.strokeThickness = m;
            a.b.badgeGap = t;
            a.b.badgeCorner = u;
            a.b.badgeBackground = o;
            a.b.badgeOutline = p;
            a.b.badgeThickness = q;
            a.b.badgeHeight = r;
            a.b.badgeWidth = s;
            a.b.badgeVisible = v;
            a.b.badgeImage = w;
        }
        kz(a, b) {
            let c = this.no(b);
            if (c == CalloutLayer.$$p[44]) {
                return this.k0(a, b, this.afa);
            }
            if (c == CalloutLayer.$$p[55]) {
                return this.k0(a, b, this.afq);
            }
            if (c == CalloutLayer.$$p[56]) {
                return this.k0(a, b, this.aft);
            }
            if (c == CalloutLayer.$$p[41]) {
                return this.k0(a, b, this.ae4);
            }
            if (c == CalloutLayer.$$p[35]) {
                return this.k0(a, b, this.aev);
            }
            return super.kz(a, b);
        }
        mo(a) {
            let b = this.no(a);
            if (b == CalloutLayer.$$p[44]) {
                return this.afa;
            }
            if (b == CalloutLayer.$$p[55]) {
                return this.afq;
            }
            if (b == CalloutLayer.$$p[56]) {
                return this.aft;
            }
            if (b == CalloutLayer.$$p[41]) {
                return this.ae4;
            }
            if (b == CalloutLayer.$$p[35]) {
                return this.aev;
            }
            return super.mo(a);
        }
        get abm() {
            return this.abg;
        }
        set abm(a) {
            if (this.abg != a) {
                let b = this.abg;
                this.abg = a;
                this.raisePropertyChanged("LabelColumn", b, this.abg);
            }
        }
        get abn() {
            return this.abh;
        }
        set abn(a) {
            if (this.abh != a) {
                let b = this.abh;
                this.abh = a;
                this.raisePropertyChanged("XColumn", b, this.abh);
            }
        }
        get abo() {
            return this.abi;
        }
        set abo(a) {
            if (this.abi != a) {
                let b = this.abi;
                this.abi = a;
                this.raisePropertyChanged("YColumn", b, this.abi);
            }
        }
        get abl() {
            return this.abf;
        }
        set abl(a) {
            if (this.abf != a) {
                let b = this.abf;
                this.abf = a;
                this.raisePropertyChanged("KeyColumn", b, this.abf);
            }
        }
        get abk() {
            return this.abe;
        }
        set abk(a) {
            if (this.abe != a) {
                let b = this.abe;
                this.abe = a;
                this.raisePropertyChanged("ContentColumn", b, this.abe);
            }
        }
        afy(a, b) {
            if (b.propertyName == CalloutAnnotation.$$p[24] || b.propertyName == CalloutAnnotation.$$p[25]) {
                let c = a.k;
                if (!this.acr.contains(c)) {
                    this.acr.add_1(c);
                    this.acu.add(c);
                    this.r8(false);
                }
            }
        }
        ct() {
            return new CalloutLayerView(this);
        }
        rh(a) {
            super.rh(a);
            this.aa3 = a;
        }
        get aa5() {
            return this.aa4;
        }
        set aa5(a) {
            let b = this.aa5;
            if (a != b) {
                this.aa4 = a;
                this.raisePropertyChanged("AllowedPositions", b, this.aa5);
            }
        }
        g0(a) {
            if (this.aba == null) {
                return true;
            }
            if (this.aba == a) {
                return true;
            }
            return false;
        }
        get aay() {
            return EnumUtil.getEnumValue(AutoCalloutVisibilityMode_$type, this.c(CalloutLayer.ahe));
        }
        set aay(a) {
            this.h(CalloutLayer.ahe, enumGetBox(AutoCalloutVisibilityMode_$type, a));
        }
        get aax() {
            return this.aaw;
        }
        set aax(a) {
            this.aaw = a;
        }
        get abj() {
            return this.abd;
        }
        set abj(a) {
            if (this.abd != a) {
                let b = this.abd;
                this.abd = a;
                this.raisePropertyChanged("CalloutBadgeImageColumn", b, this.abd);
            }
        }
        aga() {
            this.dp.deregisterColumn(this.abj);
            this.abp = ImageLoadParam.a(this.adz, "{", "}");
            if (stringIsNullOrEmpty(this.abp.value)) {
                this.abj = null;
            }
            else {
                this.abj = this.dn(this.abp.value);
            }
        }
        aex(a) {
            if (this.abj != null && this.abj.count > a) {
                let b = this.abj.item(a);
                let c = this.abp.b(b);
                return c;
            }
            else {
                return null;
            }
        }
        provideRenderer(a) {
            super.provideRenderer(a);
            ImageLoader.d = a;
            if (this.aa3 != null) {
                this.aa3.cw = a;
            }
        }
        get aie() {
            return new Thickness(1, this.add, this.adf, this.ade, this.adc);
        }
        get abc() {
            if (this.abb == null) {
                this.abb = FontUtil.toFontInfo(this.j8, this.afg);
            }
            return this.abb;
        }
        zd(a, b) {
            if (this.aba == null || this.aba == a) {
                if (!this.a1.c) {
                    this.r8(b);
                }
            }
        }
        zf(a, b) {
            super.zf(a, b);
            let c = a;
            c.ac.clear();
            c.ad.clear();
            c.z.clear();
            c.r.clear();
            c.u.clear();
            c.t.clear();
            c.w.clear();
            c.y.clear();
            c.x.clear();
            c.v.clear();
            c.s.clear();
            c.aa.clear();
            c.ab.clear();
            c.ag.clear();
            c.ah.clear();
            c.ae.clear();
            c.af.clear();
            c.i.clear();
            c.n.clear();
            c.l.clear();
            c.q.clear();
            c.k.clear();
            c.j.clear();
            c.o.clear();
            c.p.clear();
            c.m.clear();
            let d = this.acy();
            let e = new List$1(CalloutAnnotationWrapper.$, 0);
            let f = Number.POSITIVE_INFINITY;
            let g = true;
            if (this.ace) {
                if (this.x4(this.aba)) {
                    if (typeCast(IHasCategoryAxis_$type, this.aba) !== null) {
                        let h = this.aba.i3() > 0 ? this.aba.i3() : this.aba.getCategoryWidth();
                        if (!isNaN_(h) && !isInfinity(h) && h > 0) {
                            f = Math.min(f, h);
                        }
                    }
                    this.af6(this.aba, c, e);
                }
                else {
                    for (let i of fromEnum(this.dc.b9)) {
                        if (this.x4(i)) {
                            if (typeCast(IHasCategoryAxis_$type, i) !== null) {
                                let j = i.i3() > 0 ? i.i3() : i.getCategoryWidth();
                                if (!isNaN_(j) && !isInfinity(j) && j > 0) {
                                    f = Math.min(f, j);
                                }
                            }
                            if (!i.ev) {
                                if (!i.isVertical) {
                                    g = false;
                                }
                            }
                            let k = false;
                            if (i.ei && this.aa9 == 0 || this.aa9 == 3 || this.aa9 == 2) {
                                if (this.aa9 == 0 || this.aa9 == 2) {
                                    k = true;
                                }
                                i.qf((l) => {
                                    this.af6(l, c, e);
                                    return true;
                                });
                            }
                            if (!k) {
                                this.af6(i, c, e);
                            }
                        }
                    }
                }
            }
            if (this.ace && this.aax == 2) {
                let l = 0;
                let m = 0;
                let n = 1.7976931348623157E+308;
                let o = 1.7976931348623157E+308;
                let p = -1.7976931348623157E+308;
                let q = -1.7976931348623157E+308;
                if (e.count > 0) {
                    if (e._inner[0].c != null) {
                        l = e._inner[0].e;
                        m = e._inner[0].f;
                    }
                    for (let r = 0; r < e.count; r++) {
                        let s = e._inner[r];
                        if (s.c != null) {
                            let t = s.e;
                            let u = s.f;
                            if (t != l) {
                                n = Math.min(n, Math.abs(t - l));
                            }
                            if (u != m) {
                                o = Math.min(o, Math.abs(u - m));
                            }
                            p = Math.max(s.c.p + s.c.p, p);
                            q = Math.max(s.c.o + s.c.o, q);
                        }
                    }
                    if (g) {
                        if (!isNaN_(f) && !isInfinity(f)) {
                            if (q > f) {
                                e.clear();
                            }
                        }
                        else {
                            if (q > o) {
                                e.clear();
                            }
                        }
                    }
                    else {
                        if (!isNaN_(f) && !isInfinity(f)) {
                            if (p > f) {
                                e.clear();
                            }
                        }
                        else {
                            if (p > n) {
                                e.clear();
                            }
                        }
                    }
                }
            }
            let v = this.adk <= 0 && e.count > 0;
            let w = this.adk > 0 && e.count <= 0;
            let x = v || w;
            let y = this.adk != e.count;
            if (v && this.acd) {
                return;
            }
            if (!this.ab0) {
                this.af5(c, d, e);
            }
            let z = this.da.ix();
            let aa = this.da.iw();
            let ab = z != this.ac0;
            let ac = aa != this.acz;
            let ad = ab || ac;
            if (ad) {
                this.ac0 = z;
                this.acz = aa;
            }
            this.adk = e.count;
            if (this.ab0) {
                return;
            }
            if (!this.abv && this.aca && this.acb && e.count > 0 && e.count == this.adk && this.aax == 2) {
                this.abv = true;
                this.af8();
            }
        }
        s9(a, b) {
            super.s9(a, b);
            let c = b.width - this.aib.width;
            let d = b.height - this.aib.height;
            let e = 0;
            if (Math.abs(c) > Math.abs(d)) {
                e = c;
                this.ac1 = c * this.xd.width;
            }
            else {
                e = d;
                this.ac1 = d * this.xd.height;
            }
            if (e > 0 && this.ac1 > 5) {
                this.ab7 = true;
            }
            if (e < 0 && this.ac1 > 5) {
                this.ab6 = true;
            }
        }
        s8(a, b) {
            super.s8(a, b);
            if (!a.equals1(b)) {
                this.ab5 = true;
            }
        }
        get aic() {
            return this.aia;
        }
        set aic(a) {
            this.aia = a;
        }
        af5(a, b, c) {
            if (this.dc != null) {
                this.aib = this.dc.yr;
            }
            if (this.xd.isEmpty) {
                return;
            }
            this.aic = new Rect(0, this.xd.left, this.xd.top, this.xd.width, this.xd.height);
            if (this.abq != null && this.aes != null && this.aes != this.abq.bd) {
                this.af0();
            }
            if (this.abq != null && this.abq.j != this.abs()) {
                this.af0();
            }
            if (this.abq == null) {
                let d = this.abr();
                if (d != null) {
                    this.abq = d;
                    let e = this.abq;
                    e.labelsMoved = delegateCombine(e.labelsMoved, runOn(this, this.afx));
                }
                else {
                    let f = this.w4(this.cw);
                    let g = new Array(2);
                    g[0] = 0;
                    g[1] = 3;
                    if (this.aba != null) {
                        if (this.aba.isVertical) {
                            g = new Array(2);
                            g[0] = 2;
                            g[1] = 1;
                        }
                    }
                    else {
                        let h = false;
                        if (this.dc != null && this.dc.b9.count > 0) {
                            h = true;
                            for (let i of fromEnum(this.dc.b9)) {
                                if (!i.ev) {
                                    if (!i.isVertical) {
                                        h = false;
                                    }
                                }
                            }
                        }
                        if (h) {
                            g = new Array(2);
                            g[0] = 2;
                            g[1] = 1;
                        }
                    }
                    if (this.aa0 == 4 || this.aa0 == 6) {
                        g = new Array(4);
                        g[0] = 10;
                        g[1] = 11;
                        g[2] = 8;
                        g[3] = 9;
                    }
                    if (this.aa0 == 5) {
                        g = new Array(4);
                        g[0] = 9;
                        g[1] = 10;
                        g[2] = 11;
                        g[3] = 8;
                    }
                    if (this.aa0 == 7) {
                        g = new Array(4);
                        g = new Array(4);
                        g[0] = 8;
                        g[1] = 10;
                        g[2] = 11;
                        g[3] = 9;
                    }
                    this.abq = new LabelCollisionManager(this.xd.right, this.xd.bottom, this.xd, this.aa3.k(), this.adg, this.abs(), g, this.ado(), this.adn(), this.acf, this.aas);
                    this.abq.v = this.aci;
                    if (this.aes != null) {
                        this.abq.bd = this.aes;
                        this.abq.bb = this;
                    }
                    let j = this.abq;
                    j.labelsMoved = delegateCombine(j.labelsMoved, runOn(this, this.afx));
                }
            }
            if (this.ab6) {
                this.ab6 = false;
                if (this.abq.a9 > 2) {
                    this.ab4 = true;
                }
            }
            if (this.ab7) {
                this.ab7 = false;
                if (this.ac1 > 5) {
                    this.ab4 = true;
                }
            }
            if (this.ab5) {
                this.ab5 = false;
                this.abq.bs(this.xd.right, this.xd.bottom, this.xd);
                this.ab4 = true;
            }
            let k = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            let l = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            let m = new List$1(CalloutAnnotationWrapper.$, 0);
            let n = new List$1(CalloutAnnotationWrapper.$, 0);
            let o = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            for (let p = 0; p < b.count; p++) {
                o.add_1(b._inner[p]);
            }
            for (let q = 0; q < c.count; q++) {
                o.add_1(c._inner[q]);
            }
            let r = this.acs.c;
            while (r != null) {
                let s = r.a;
                if (!o.contains(r.c)) {
                    n.add(r.c);
                    l.add_1(r.c);
                    let t = r.c.b;
                    t.propertyChanged = delegateRemove(t.propertyChanged, runOn(this, this.afy));
                    this.acs.h(r);
                    this.acp.removeItem(r.c);
                    this.abq.br(r.c.c);
                }
                r = s;
            }
            for (let u = 0; u < b.count; u++) {
                if (!this.acp.containsKey(b._inner[u])) {
                    this.acs.f(b._inner[u]);
                    let v = b._inner[u].b;
                    v.propertyChanged = delegateCombine(v.propertyChanged, runOn(this, this.afy));
                    this.acp.addItem(b._inner[u], this.acs.d);
                    m.add(b._inner[u]);
                    k.add_1(b._inner[u]);
                    this.ab4 = true;
                }
            }
            for (let w = 0; w < c.count; w++) {
                if (!this.acp.containsKey(c._inner[w])) {
                    this.acs.f(c._inner[w]);
                    this.acp.addItem(c._inner[w], this.acs.d);
                    let x = c._inner[w].b;
                    x.propertyChanged = delegateCombine(x.propertyChanged, runOn(this, this.afy));
                    m.add(c._inner[w]);
                    k.add_1(c._inner[w]);
                    this.ab4 = true;
                }
            }
            if (this.ab1 == true) {
                this.ab1 = false;
                this.ab4 = true;
            }
            let y = false;
            if (this.acu.count > 0) {
                y = true;
                this.acu.clear();
                this.acr.clear();
            }
            r = this.acs.c;
            while (r != null) {
                let z = this.abt(r.c);
                if (z == null) {
                    return;
                }
                if (!Base.equalsStatic(z, r.c.c.e)) {
                    let aa = false;
                    if (r.c.c.e == null) {
                        aa = true;
                    }
                    let ab = r.c.c;
                    ab.s = z.d;
                    ab.t = z.e;
                    if (!isNaN_(ab.s) && !isNaN_(ab.t)) {
                        ab.r = z.g;
                        ab.q = z.f;
                        if (ab.c == null) {
                            this.abq.ad(ab, false);
                        }
                        if (aa) {
                            this.abq.be(ab);
                        }
                        else {
                            this.abq.bo(ab);
                        }
                    }
                }
                r = r.a;
            }
            let ac = this.abq.ba();
            let ad = this.abq.af();
            if (!this.ab4 && y && (ac != 0 || ad)) {
                {
                    this.ab4 = true;
                }
            }
            if (ad) {
                if (this.abq.x()) {
                    this.ab4 = true;
                }
            }
            if (this.ab4 && (ac != 0 || ad || this.ab2)) {
                this.ab2 = false;
                this.ab4 = false;
                this.adj = 0x7FFFFFFF;
                if (this.aes != null) {
                    let ae = true;
                    for (let af = 0; af < this.dc.b9.count; af++) {
                        let ag = this.dc.b9._inner[af];
                        if (ag.ev && typeCast(CalloutLayer.$, ag) !== null) {
                            let ah = ag;
                            if (ah.aes == this.aes) {
                                if (!ah.aic.equals1(this.abq.b0)) {
                                    ae = false;
                                    break;
                                }
                            }
                        }
                    }
                    if (ae) {
                        this.abq.bv();
                    }
                    else {
                        this.abq.bf();
                        this.abq.bg();
                    }
                }
                else {
                    this.abq.bv();
                }
            }
            else {
                this.abq.bg();
            }
            let ai = this.acs.c;
            let aj;
            let ak;
            let al;
            let am;
            let an;
            let ao;
            let ap;
            let aq;
            let ar;
            let as;
            let at;
            let au;
            let av;
            let aw;
            let ax;
            let ay;
            let az;
            let a0;
            let a1;
            let a2;
            let a3;
            let a4;
            let a5;
            let a6 = NaN;
            let a7 = NaN;
            let a8 = this.acg;
            let a9 = this.aci;
            let ba = this.cw.b5();
            while (ai != null) {
                let bb = ai.c;
                let bc = bb.b;
                aj = bc.cl;
                ak = bc.cq;
                al = bc.cp;
                am = bc.backgroundPadding.left;
                an = bc.backgroundPadding.top;
                ao = bc.backgroundPadding.right;
                ap = bc.backgroundPadding.bottom;
                ar = bc.backgroundCornerRadius;
                aq = bc.al;
                as = bc.cr;
                at = bc.bc;
                au = bc.an;
                az = bc.cm;
                a0 = bc.cn;
                a2 = bc.aj;
                a3 = bc.ai;
                a4 = bc.ak;
                a1 = bc.q;
                a6 = bc.ah;
                a7 = bc.ag;
                a5 = bc.bb;
                let bd = bb.c;
                av = bd.s - (bd.k - bd.p);
                aw = bd.t - (bd.l - bd.o);
                ax = bd.k - bd.p;
                ay = bd.l - bd.o;
                let be = false;
                if (a9) {
                    if (bd.c != null && this.abq.ab(bd.c)) {
                        be = true;
                    }
                }
                if (bb.c.h && !be) {
                    av = NaN;
                    aw = NaN;
                }
                if (!bb.c.h && (bb.c.b == 8 || bb.c.b == 9)) {
                    al = ba;
                    av = bd.k;
                    aw = bd.l;
                }
                if (be) {
                    at = this.afi(bb, at);
                    let bf = this.abq.as(bb.c.c);
                    if (bf > 0) {
                        ax += bf;
                        av -= bf;
                    }
                }
                if (a8) {
                    let bg = new CalloutRenderStyleUpdatingEventArgs();
                    bg.background = aj;
                    bg.outline = ak;
                    bg.leaderBrush = al;
                    bg.strokeThickness = aq;
                    bg.textColor = as;
                    bg.item = au;
                    bg.series = bc.l;
                    bg.actualPosition = bd.b;
                    bg.xValue = bc.ap;
                    bg.yValue = bc.aq;
                    bg.width = bd.p * 2;
                    bg.height = bd.o * 2;
                    bg.badgeOutline = a0;
                    bg.badgeBackground = az;
                    bg.badgeThickness = a2;
                    bg.badgeImage = a5;
                    bg.backgroundCorner = ar;
                    bg.l = bb.b.n;
                    if (this.calloutRenderStyleUpdating != null) {
                        this.calloutRenderStyleUpdating(this, bg);
                        aj = bg.background;
                        ak = bg.outline;
                        al = bg.leaderBrush;
                        aq = bg.strokeThickness;
                        as = bg.textColor;
                        a0 = bg.badgeOutline;
                        az = bg.badgeBackground;
                        a2 = bg.badgeThickness;
                        a5 = bg.badgeImage;
                        ar = bg.backgroundCorner;
                    }
                }
                a.z.add1(bb);
                a.r.add(aj);
                a.u.add(ak);
                a.t.add(al);
                a.w.add(am);
                a.y.add(an);
                a.x.add(ao);
                a.v.add(ap);
                a.s.add(ar);
                a.aa.add(aq);
                a.ab.add(as);
                a.ac.add1(at);
                a.ad.add1(au);
                a.i.add(az);
                a.n.add(a0);
                a.l.add(a3);
                a.q.add(a4);
                a.j.add(a7);
                a.k.add(a6);
                a.o.add(a2);
                a.p.add(a1);
                a.m.add1(a5);
                a.ag.add(av);
                a.ah.add(aw);
                a.ae.add(ax);
                a.af.add(ay);
                ai = ai.a;
            }
        }
        afi(a, b) {
            let c = Math.max(this.abq.as(a.c.c), this.abq.at(a.c.c));
            if (c <= 0) {
                return b;
            }
            let d = b.length;
            let e = this.aa3.da(b, a.b.backgroundPadding, null);
            let f = e.width;
            let g = f - c;
            while (f - g > 0.0001 && d > 0) {
                d--;
                b = b.substr(0, d) + "…";
                e = this.aa3.da(b, a.b.backgroundPadding, null);
                f = e.width;
            }
            return b;
        }
        af0() {
            if (this.abq != null) {
                let a = this.acs.c;
                while (a != null) {
                    let b = a.c.c;
                    if (b != null) {
                        this.abq.br(b);
                    }
                    a = a.a;
                }
                let c = this.abq;
                c.labelsMoved = delegateRemove(c.labelsMoved, runOn(this, this.afx));
                this.abq = null;
            }
            this.afz();
        }
        abr() {
            if (this.dc == null) {
                return null;
            }
            for (let a = 0; a < this.dc.b9.count; a++) {
                let b = this.dc.b9._inner[a];
                if (b.ev && typeCast(CalloutLayer.$, b) !== null) {
                    let c = b;
                    if (c != this) {
                        if (c.aes != null && c.aes == this.aes) {
                            if (c.abq != null) {
                                return c.abq;
                            }
                        }
                    }
                }
            }
            return null;
        }
        adn() {
            return 20000;
        }
        ado() {
            return 300;
        }
        abs() {
            switch (this.aa0) {
                case 0: return 2;
                case 2: return 1;
                case 3: return 2;
                case 1: return 0;
                case 4: return 3;
                case 7: return 7;
                case 5: return 5;
                case 6: return 6;
            }
            return 2;
        }
        afx(a) {
            let b = this.abq.ba();
            let c = this.adj;
            if (b < this.adj) {
                this.adj = b;
                if (c != 0x7FFFFFFF) {
                    this.r8(false);
                }
            }
        }
        abt(a) {
            let b = this.aba;
            if (a.b.l != null) {
                b = a.b.l;
            }
            if (b == null) {
                for (let c = 0; c < this.dc.b9.count; c++) {
                    let d = this.dc.b9._inner[c];
                    if (!d.ev) {
                        b = d;
                        break;
                    }
                }
            }
            if (b == null) {
                return null;
            }
            let e = b.ai();
            let f = b.i5();
            let g = null;
            let h = null;
            let i = false;
            for (let j = 0; j < e.length; j++) {
                if (e[j] == null) {
                    continue;
                }
                if (e[j].dc) {
                    i = true;
                    g = e[j];
                }
                else if (e[j].du) {
                    i = true;
                    h = e[j];
                }
                else if (e[j].dy) {
                    h = e[j];
                }
                else {
                    g = e[j];
                }
            }
            if (g == null || h == null) {
                return null;
            }
            if (!g.dx() || !h.dx()) {
                return null;
            }
            let k = 0;
            let l = 0;
            if (g.df && g.categoryMode != 0) {
                if (b.fa) {
                    k = b.getOffsetValue();
                }
                else if (b.e1) {
                    k = b.getOffsetValue();
                }
            }
            if (h.df && h.categoryMode != 0) {
                if (b.e1) {
                    l = b.getOffsetValue();
                }
            }
            let m = new ScalerParams(0, this.dc.yr, g.o6, g.dn, g.o1());
            m.b = f;
            let n = new ScalerParams(0, this.dc.yr, h.o6, h.dn, h.o1());
            n.b = f;
            let o = 0;
            let p = 0;
            if (i) {
                o = g.f6(this.adi(a.b.ap), m) + k;
                p = h.f6(this.adi(a.b.aq), n) + l;
                let q = o;
                let r = p;
                let s = { $type: Point_$type, x: 0.5, y: 0.5 };
                let t = s.x + (r * Math.cos(q));
                o = ViewportUtils.e(t, m.e, m.d, m.c);
                let u = s.y + (r * Math.sin(q));
                p = ViewportUtils.i(u, n.e, n.d, n.c);
            }
            else {
                o = g.f6(this.adi(a.b.ap), m) + k;
                p = h.f6(this.adi(a.b.aq), n) + l;
            }
            let v = new QuadTreeBoundingBox();
            v.d = o;
            v.e = p;
            v.g = 3;
            v.f = 3;
            v.i = a.b;
            return v;
        }
        adi(a) {
            if (typeCast(Date_$type, a) !== null) {
                return a.getTime();
            }
            if (a == null) {
                return 0;
            }
            return a;
        }
        acy() {
            let a = new List$1(CalloutAnnotationWrapper.$, 0);
            for (let b = 0; b < this.acv.count; b++) {
                if (stringIsNullOrEmpty(this.acv._inner[b].b.bc)) {
                    continue;
                }
                if (this.acv._inner[b].c == null) {
                    let c = new LabelCollisionInfo();
                    this.acv._inner[b].c = c;
                    let d = this.acv._inner[b];
                    this.agf(c, d);
                }
                let e = this.abt(this.acv._inner[b]);
                if (e == null || e.d < this.xd.left || e.d > this.xd.right || e.e < this.xd.top || e.e > this.xd.bottom) {
                    continue;
                }
                a.add(this.acv._inner[b]);
            }
            return a;
        }
        agf(a, b) {
            let c = ((() => {
                let $ret = new CalloutBadgeInfo();
                $ret.badgeHeight = b.b.badgeHeight;
                $ret.badgeWidth = b.b.badgeWidth;
                $ret.badgeVisible = b.b.badgeVisible;
                $ret.badgeThickness = b.b.badgeThickness;
                $ret.badgeGap = b.b.badgeGap;
                $ret.badgeCorner = b.b.badgeCorner;
                $ret.badgeImage = b.b.badgeImage;
                return $ret;
            })());
            let d = this.aa3.da(this.adp(b), b.b.backgroundPadding, c);
            if (a.c != null) {
                a.c.f = d.height / 2;
                a.c.g = d.width / 2;
            }
            a.o = d.height / 2;
            a.p = d.width / 2;
        }
        adp(a) {
            return a.b.bc;
        }
        x4(a) {
            if (!super.x4(a)) {
                return false;
            }
            if (this.afd != null) {
                if (a.isFragment) {
                    let b = a.nn();
                    if (!Base.equalsStatic(this.afd, b)) {
                        return false;
                    }
                }
                else {
                    if (!Base.equalsStatic(this.afd, a.name)) {
                        return false;
                    }
                }
            }
            return true;
        }
        q4() {
            super.q4();
            if (!this.a1.c && !this.d4()) {
                return;
            }
            if (this.abz) {
                this.abz = false;
                this.af7();
                this.af2();
            }
            if (this.d4()) {
                this.agc(this.xy, false);
            }
            else {
                this.agc(this.xw, false);
            }
        }
        af3() {
            if (!this.ab3) {
                this.ab3 = true;
                this.r8(true);
            }
        }
        af6(a, b, c) {
            let d = false;
            if (this.ab3) {
                this.ab3 = false;
                d = true;
            }
            a.kr = this.aav;
            if (!a.go && a.ed(this.act, this.aco, this.ack, this.adl, false)) {
                let e = this.act;
                for (let f = 0; f < this.act.count; f++) {
                    let g = e._inner[f];
                    let h = g.b != null ? g.b.item : null;
                    let i = g.b.item != null ? g.b.item : g.b;
                    let j = g.g;
                    let k = a;
                    let l = new CalloutKey(i, k);
                    let m = new CalloutAnnotationWrapper();
                    let n = new CalloutAnnotation();
                    m.b = n;
                    n.key = l;
                    n.badgeImage = this.aex(g.c);
                    let o = false;
                    if (this.acp.containsKey(m)) {
                        m = this.acp.item(m).c;
                        n = m.b;
                        o = d;
                    }
                    else {
                        o = true;
                    }
                    let p = n.ap;
                    let q = n.aq;
                    if (this.adi(p) != this.adi(g.d) && (!isNaN_(this.adi(p)) || !isNaN_(this.adi(g.d)))) {
                        n.xValue = g.d;
                    }
                    if (this.adi(q) != this.adi(g.e) && (!isNaN_(this.adi(q)) || !isNaN_(this.adi(g.e)))) {
                        n.yValue = g.e;
                    }
                    n.itemColor = j;
                    n.series = a;
                    let r = false;
                    if (g.f != n.bn) {
                        n.bn = g.f;
                        r = true;
                    }
                    if (o || r) {
                        if (this.calloutLabelUpdating != null) {
                            let s = ((() => {
                                let $ret = new CalloutLabelUpdatingEventArgs();
                                $ret.d = n.ap;
                                $ret.e = n.aq;
                                $ret.item = h;
                                $ret.a = a;
                                $ret.f = a.name;
                                $ret.c = g.f;
                                return $ret;
                            })());
                            this.calloutLabelUpdating(this, s);
                            if (s.c != null && !Base.equalsStatic(s.c, m.b.bc)) {
                                let t = s.c;
                                if (this.aav != null) {
                                    m.b.text = this.aav.i(t);
                                }
                                else {
                                    m.b.text = t != null ? t.toString() : "";
                                }
                            }
                        }
                        else {
                            if (g.f != null) {
                                n.text = g.f;
                            }
                        }
                    }
                    if (n.bc == null) {
                        continue;
                    }
                    if (o || r) {
                        if (this.calloutContentUpdating != null) {
                            let u = ((() => {
                                let $ret = new CalloutContentUpdatingEventArgs();
                                $ret.c = n.ap;
                                $ret.d = n.aq;
                                $ret.item = h;
                                $ret.a = i;
                                return $ret;
                            })());
                            this.calloutContentUpdating(this, u);
                            if (u.a != null && u.a != m.b.an) {
                                m.b.content = u.a;
                            }
                        }
                        else {
                            if (i != null && i != m.b.an) {
                                m.b.content = i;
                            }
                        }
                    }
                    if (o) {
                        this.age(m);
                    }
                    if (m.c == null) {
                        let v = new LabelCollisionInfo();
                        m.c = v;
                        this.agf(v, m);
                    }
                    let w = this.abt(m);
                    if (w == null || w.d < this.xd.left || w.d > this.xd.right || w.e < this.xd.top || w.e > this.xd.bottom) {
                        continue;
                    }
                    m.e = w.d;
                    m.f = w.e;
                    if (g.a != null) {
                        m.c.a = g.a;
                    }
                    c.add(m);
                }
            }
            a.kr = null;
        }
        b3() {
            return 1;
        }
        a2(a, b) {
            let c = this.abq.i(a, b);
            if (c == null) {
                return null;
            }
            return c.y;
        }
        g2(a, b) {
            if (this.abq == null) {
                return false;
            }
            return this.abq.i(a, b) != null;
        }
        agc(a, b) {
            let c = 0;
            let d = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            for (c = 0; c < a.ac.count; c++) {
                let e = a.z._inner[c];
                if (isNaN_(a.ag._inner[c]) || isNaN_(a.ah._inner[c])) {
                    continue;
                }
                let f = this.aa3.cr.item(e);
                d.add_1(e);
                if (f.x != a.ac._inner[c]) {
                    f.x = a.ac._inner[c];
                    let g = f.aw();
                }
                f.t = a.aa._inner[c];
                f.am = a.r._inner[c];
                f.ap = a.ab._inner[c];
                f.ao = f.t > 0 ? a.u._inner[c] : this.cw.b5();
                f.an = a.t._inner[c];
                f.az = new Thickness(1, a.w._inner[c], a.y._inner[c], a.x._inner[c], a.v._inner[c]);
                f.s = a.s._inner[c];
                f.ak = a.i._inner[c];
                f.q = a.o._inner[c];
                f.al = a.n._inner[c];
                f.p = a.l._inner[c];
                f.r = a.q._inner[c];
                f.h = a.p._inner[c];
                f.o = a.k._inner[c];
                f.n = a.j._inner[c];
                f.aa = typeCast(String_$type, a.m._inner[c]);
                d.add_1(e);
                if (f.x != a.ac._inner[c]) {
                    f.x = a.ac._inner[c];
                    let h = f.aw();
                }
                this.aa3.c2(f, Math.min(a.ae._inner[c], a.ae._inner[c] + a.ag._inner[c]), Math.min(a.af._inner[c], a.af._inner[c] + a.ah._inner[c]));
                this.aa3.c3(f, e, a.ad._inner[c]);
                f.ar = { $type: Point_$type, x: a.ag._inner[c], y: a.ah._inner[c] };
            }
            let i = new List$1(CalloutAnnotationWrapper.$, 0);
            for (let j of fromEnum(this.aa3.cr.c)) {
                if (!d.contains(j)) {
                    i.add(j);
                }
            }
            for (let k = 0; k < i.count; k++) {
                this.aa3.cr.h(i._inner[k]);
            }
        }
        zi(a, b) {
            super.zi(a, b);
            if (this.d4()) {
                this.agc(this.xy, true);
            }
            else {
                this.agc(this.xw, false);
            }
        }
        gg() {
            return true;
        }
        rq(a, b, c, d) {
            super.rq(a, b, c, d);
            switch (b) {
                case CalloutLayer.$$p[48]:
                    this.abb = null;
                    this.aa3.c1();
                    this.r8(true);
                    break;
                case CalloutLayer.$$p[46]:
                case CalloutLayer.$$p[47]:
                    this.r8(true);
                    break;
                case CalloutLayer.$$p[42]:
                case CalloutLayer.$$p[43]:
                    if (this.ae7 != null) {
                        this.aav = new BindingFormatter();
                        this.aav.j = this.ae7;
                        this.aav.d = this.aat;
                    }
                    else {
                        this.aav = null;
                    }
                    break;
                case CalloutLayer.$$p[34]:
                case CalloutLayer.$$p[36]:
                    this.r8(true);
                    break;
                case "SeriesViewer":
                    if (c != null) {
                        let e = c;
                        e.seriesAnimating = delegateRemove(e.seriesAnimating, runOn(this, this.agb));
                    }
                    if (d != null) {
                        let f = d;
                        f.seriesAnimating = delegateCombine(f.seriesAnimating, runOn(this, this.agb));
                    }
                    if (d == null) {
                        this.af0();
                    }
                    break;
                case "AutoCalloutVisibilityMode":
                    this.aax = this.aaz();
                    this.af1();
                    break;
                case "AllowedPositions":
                    if (c != null) {
                        let g = c;
                        g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.afv));
                    }
                    if (d != null) {
                        let h = d;
                        h.collectionChanged = delegateCombine(h.collectionChanged, runOn(this, this.afv));
                    }
                    this.aas = this.aau(this.aa5);
                    this.af1();
                    break;
                case CalloutLayer.$$p[37]:
                case CalloutLayer.$$p[38]:
                case CalloutLayer.$$p[1]:
                case CalloutLayer.$$p[25]:
                case CalloutLayer.$$p[23]:
                case CalloutLayer.$$p[50]:
                case CalloutLayer.$$p[53]:
                case CalloutLayer.$$p[40]:
                case CalloutLayer.$$p[39]:
                case CalloutLayer.$$p[27]:
                case CalloutLayer.$$p[29]:
                case CalloutLayer.$$p[28]:
                case CalloutLayer.$$p[26]:
                case "Visibility":
                    this.af1();
                    break;
                case CalloutLayer.$$p[15]:
                case CalloutLayer.$$p[21]:
                case CalloutLayer.$$p[20]:
                case CalloutLayer.$$p[18]:
                case CalloutLayer.$$p[16]:
                case CalloutLayer.$$p[19]:
                case CalloutLayer.$$p[17]:
                case CalloutLayer.$$p[32]:
                    this.af8();
                    break;
                case CalloutLayer.$$p[30]:
                case CalloutLayer.$$p[31]:
                case CalloutLayer.$$p[33]:
                case CalloutLayer.$$p[12]:
                    this.af1();
                    break;
                case CalloutLayer.$$p[45]:
                    this.af1();
                    if (this.abq != null) {
                        this.abq.v = d;
                    }
                    break;
                case CalloutLayer.$$p[44]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.abm);
                        this.abm = this.dn(this.afa);
                    }
                    break;
                case "LabelColumn":
                    this.af1();
                    break;
                case CalloutLayer.$$p[8]:
                case CalloutLayer.$$p[2]:
                case CalloutLayer.$$p[9]:
                case CalloutLayer.$$p[11]:
                case CalloutLayer.$$p[5]:
                case CalloutLayer.$$p[7]:
                case CalloutLayer.$$p[10]:
                case CalloutLayer.$$p[4]:
                case CalloutLayer.$$p[3]:
                case "CalloutBadgeImageColumn":
                    this.af1();
                    break;
                case CalloutLayer.$$p[6]:
                    if (this.dp != null) {
                        this.aga();
                    }
                    break;
                case CalloutLayer.$$p[35]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.abk);
                        this.abk = this.dn(this.aev);
                    }
                    break;
                case "ContentColumn":
                    this.af1();
                    break;
                case CalloutLayer.$$p[55]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.abn);
                        this.abn = stringIsNullOrEmpty(this.afq) == false ? this.dn(this.afq) : null;
                    }
                    break;
                case "XColumn":
                    this.af1();
                    break;
                case CalloutLayer.$$p[56]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.abo);
                        this.abo = this.dn(this.aft);
                    }
                    break;
                case "YColumn":
                    this.af1();
                    break;
                case CalloutLayer.$$p[41]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.abl);
                        this.abl = this.dn(this.ae4);
                    }
                    break;
                case "KeyColumn":
                    this.af1();
                    break;
                case "FastItemsSource":
                    this.ab1 = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.abm);
                        c.deregisterColumn(this.abk);
                        c.deregisterColumn(this.abn);
                        c.deregisterColumn(this.abo);
                        c.deregisterColumn(this.abl);
                        c.deregisterColumn(this.abj);
                        this.abj = null;
                        this.abm = null;
                        this.abk = null;
                        this.abn = null;
                        this.abo = null;
                        this.abl = null;
                        this.acv.clear();
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.aga();
                        this.abm = this.dn(this.afa);
                        this.abk = this.dn(this.aev);
                        if (stringIsNullOrEmpty(this.afq) == false) {
                            this.abn = this.dn(this.afq);
                        }
                        this.abo = this.dn(this.aft);
                        this.abl = this.dn(this.ae4);
                        this.acv.clear();
                        let i = this.acq();
                        if (this.dp.count > 0) {
                            for (let j = 0; j < this.dp.count; j++) {
                                let k = new CalloutAnnotation();
                                let l = new CalloutAnnotationWrapper();
                                l.b = k;
                                l.b.series = this.aba;
                                this.acv.add(l);
                                this.agd(j, i, false);
                            }
                        }
                    }
                    this.af1();
                    break;
            }
        }
        aaz() {
            if (this.aay == 0) {
                return 1;
            }
            return this.aay;
        }
        aau(a) {
            if (a == null || a.count == 0) {
                return null;
            }
            let b = new Array(a.count);
            for (let c = 0; c < a.count; c++) {
                b[c] = a._inner[c];
            }
            return b;
        }
        agb(a) {
            if (a.ev) {
                return;
            }
            if ((a == this.aba || this.aba == null) && this.ace) {
                this.r8(false);
            }
        }
        af1() {
            if (this.abw) {
                this.af7();
                this.abw = false;
            }
            if (this.abz == false) {
                this.abz = true;
                this.r8(false);
            }
        }
        ax(a, b, c) {
            let d = this.getEffectiveViewport();
            let e = this.dc.y9;
            let f = this.xe();
            let g = 0;
            if (b.dy) {
                let h = new ScalerParams(0, c, e, !b.dn, d);
                let i = b.f9(0, h);
                let j = b.f9(f.height, h);
                g = Math.abs(j - i);
                return new AxisRange(a.c - g, a.b + g);
            }
            else {
                let k = new ScalerParams(0, c, e, b.dn, d);
                let l = b.f9(0, k);
                let m = b.f9(f.width, k);
                g = Math.abs(m - l);
                return new AxisRange(a.c - g, a.b + g);
            }
        }
        af7() {
            if (this.da == null) {
                return;
            }
            let a = this.da.b9;
            if (a == null) {
                return;
            }
            let b = this.da.zq;
            if (b == null) {
                return;
            }
            if (this.acd) {
                return;
            }
            if (!this.abx) {
                let c = this.aid;
                let d = this.xe();
                if (c.width == d.width && c.height == d.height) {
                    return;
                }
            }
            this.abu = false;
            for (let e of fromEnum(b)) {
                e.kl();
                e.ee(true);
            }
            this.abu = true;
        }
        af8() {
            if (this.dc == null) {
                return;
            }
            if (this.abx) {
                return;
            }
            if (this.acd) {
                return;
            }
            let a = this.aid;
            let b = this.xe();
            if (a.width == b.width && a.height == b.height) {
                return;
            }
            this.abx = true;
            this.ab2 = true;
            this.ab4 = true;
            this.abw = true;
            this.af7();
            this.abw = false;
            if (this.abz == false) {
                this.abz = true;
                this.r8(false);
            }
            this.abx = false;
        }
        afz() {
            this.aa3.cr.clear();
            this.acs.g();
            this.acp.clear();
        }
        af2() {
            if (this.abo == null || this.abm == null) {
                let a = this.acs.c;
                while (a != null) {
                    this.age(a.c);
                    a = a.a;
                }
                return;
            }
            let b = this.acq();
            for (let c = 0; c < this.abo.count; c++) {
                let d;
                if (this.acv.count <= c) {
                    let e = new CalloutAnnotation();
                    d = new CalloutAnnotationWrapper();
                    d.b = e;
                    d.b.series = this.aba;
                    d.b.badgeImage = this.aex(c);
                    this.acv.add(d);
                }
                else {
                    d = this.acv._inner[c];
                }
                this.agd(c, b, false);
            }
        }
        af9() {
            this.ab2 = true;
            this.ab4 = true;
            this.af1();
        }
        ww(a, b, c) {
            for (let d of fromEnum(this.aa3.cr.c)) {
                let e = d.c.p;
                let f = d.c.o;
                let g = d.c.k - e - d.b.strokeThickness;
                let h = d.c.l - f - d.b.strokeThickness;
                let i = { $type: Point_$type, x: g, y: h };
                let j = this.w2(i);
                let k = d.c.k + e;
                let l = d.c.l + f;
                let m = { $type: Point_$type, x: k, y: l };
                let n = this.w2(m);
                if (a.x > j.x && a.y > j.y && a.x < n.x && a.y < n.y) {
                    return i;
                }
            }
            return super.ww(a, b, c);
        }
        kw(a) {
            for (let b of fromEnum(this.aa3.cr.c)) {
                let c = b.c.p;
                let d = b.c.o;
                let e = b.c.k - c;
                let f = b.c.l - d;
                let g = this.w2({ $type: Point_$type, x: e, y: f });
                let h = this.w2({ $type: Point_$type, x: this.xd.left + c * 2, y: this.xd.top + d * 2 });
                if (a.x > g.x && a.y > g.y && a.x < g.x + h.x && a.y < g.y + h.y) {
                    return new Tuple$2(CalloutAnnotationWrapper.$, CalloutView.$, b, this.aa3.cr.item(b));
                }
            }
            return super.kw(a);
        }
        get_e6() {
            return true;
        }
    }
    CalloutLayer.$t = markType(CalloutLayer, 'CalloutLayer', AnnotationLayer.$);
    CalloutLayer.ahe = DependencyProperty.i("AutoCalloutVisibilityMode", AutoCalloutVisibilityMode_$type, CalloutLayer.$, new PropertyMetadata(2, enumGetBox(AutoCalloutVisibilityMode_$type, 0), (a, b) => a.raisePropertyChanged("AutoCalloutVisibilityMode", b.oldValue, b.newValue)));
    CalloutLayer.$$p = markDep(DependencyProperty, PropertyMetadata, CalloutLayer, 'raisePropertyChanged', ['AutoCalloutLabelPrecision:adl:agg', [1, 5], 'CalloutBackground:ah2:agh', [Brush.$, null], 'CalloutBadgeBackground:ah3:agi', [Brush.$, null], 'CalloutBadgeCorner:ac2:agj', [1, 0], 'CalloutBadgeGap:ac3:agk', [1, 5], 'CalloutBadgeHeight:ac4:agl', [1, 10], 'CalloutBadgeImageMemberPath:adz:agm', [2, null], 'CalloutBadgeMatchSeries:ab8:agn', [0, false], 'CalloutBadgeOutline:ah4:ago', [Brush.$, null], 'CalloutBadgeThickness:ac5:agp', [1, NaN], 'CalloutBadgeVisible:ab9:agq', [0, false], 'CalloutBadgeWidth:ac6:agr', [1, 10], 'CalloutCollisionMode:aa0:ags', [CalloutCollisionMode_$type, enumGetBox(CalloutCollisionMode_$type, 3)], 'CalloutCornerRadius:ac7:agt', [1, NaN], 'CalloutDarkTextColor:ah5:agu', [Brush.$, null], 'CalloutExpandsAxisBufferEnabled:aca:agv', [0, false], 'CalloutExpandsAxisBufferMaxHeight:ac8:agw', [1, 400], 'CalloutExpandsAxisBufferMaxWidth:ac9:agx', [1, 400], 'CalloutExpandsAxisBufferMinHeight:ada:agy', [1, 20], 'CalloutExpandsAxisBufferMinWidth:adb:agz', [1, 20], 'CalloutExpandsAxisBufferOnInitialVisibility:acb:ag0', [0, false], 'CalloutExpandsAxisBufferOnlyWhenVisible:acc:ag1', [0, false], 'CalloutInterpolatedValuePrecision:adm:ag2', [1, -1], 'CalloutLeaderBrush:ah6:ag3', [Brush.$, null], 'CalloutLightTextColor:ah7:ag4', [Brush.$, null], 'CalloutOutline:ah8:ag5', [Brush.$, null], 'CalloutPaddingBottom:adc:ag6', [1, NaN], 'CalloutPaddingLeft:add:ag7', [1, NaN], 'CalloutPaddingRight:ade:ag8', [1, NaN], 'CalloutPaddingTop:adf:ag9', [1, NaN], 'CalloutPositionPadding:adg:aha', [1, 10], 'CalloutStrokeThickness:adh:ahb', [1, NaN], 'CalloutSuspendedWhenShiftingToVisible:acd:ahc', [0, false], 'CalloutTextColor:ah9:ahd', [Brush.$, null], 'CollisionChannel:aes:ahf', [2, null], 'ContentMemberPath:aev:ahg', [2, null], 'HighlightedValueLabelMode:aa9:ahh', [HighlightedValueLabelMode_$type, enumGetBox(HighlightedValueLabelMode_$type, 0)], 'IsAutoCalloutBehaviorEnabled:ace:ahi', [0, false], 'IsCalloutOffsettingEnabled:acf:ahj', [0, true], 'IsCustomCalloutRenderStyleEnabled:acg:ahk', [0, false], 'IsCustomCalloutStyleEnabled:ach:ahl', [0, false], 'KeyMemberPath:ae4:ahm', [2, null], 'LabelFormat:ae7:ahn', [2, null], 'LabelFormatSpecifiers:aat:aho', [Array_$type, null], 'LabelMemberPath:afa:ahp', [2, null], 'ShouldTruncateOnBoundaryCollisions:aci:ahq', [0, false], 'TargetSeriesName:afd:ahr', [2, null], 'TargetSeries:aba:ahs', [Series.$, null], 'TextStyle:afg:aht', [2, null], 'UseAutoContrastingLabelColors:acj:ahu', [0, false], 'UseInterpolatedValueForAutoCalloutLabels:ack:ahv', [0, false], 'UseItemColorForFill:acl:ahw', [0, false], 'UseItemColorForOutline:acm:ahx', [0, false], 'UseSeriesColorForOutline:acn:ahy', [0, false], 'UseValueForAutoCalloutLabels:aco:ahz', [0, true], 'XMemberPath:afq:ah0', [2, null], 'YMemberPath:aft:ah1', [2, null]]);
    return CalloutLayer;
})();
/**
 * @hidden
 */
export let CalloutLayerView = /*@__PURE__*/ (() => {
    class CalloutLayerView extends AnnotationLayerView {
        constructor(a) {
            super(a);
            this.cn = null;
            this.cs = null;
            this.cw = null;
            this.cr = null;
            this.ct = NaN;
            this.co = null;
            this.cn = a;
            this.cs = new List$1(CalloutView.$, 0);
        }
        c0() {
            this.a2();
        }
        cv() {
            if (this.cn == null) {
                return null;
            }
            return this.cn.j8;
        }
        a4() {
            super.a4();
            this.cr = ((() => {
                let $ret = new HashPool$2(CalloutAnnotationWrapper.$, CalloutView.$);
                $ret.create = runOn(this, this.cp);
                $ret.activate = runOn(this, this.cx);
                $ret.disactivate = runOn(this, this.cz);
                $ret.destroy = runOn(this, this.cy);
                return $ret;
            })());
        }
        cp() {
            let a = new CalloutView(this);
            this.cs.add(a);
            return a;
        }
        cx(a) {
            a.a0 = 0;
        }
        cz(a) {
            a.a0 = 1;
        }
        cy(a) {
            this.cs.remove(a);
        }
        c9(a) {
            if (a == null) {
                return a;
            }
            return BrushUtil.o(a, 0.1);
        }
        bj(a, b) {
            super.bj(a, b);
            a.af(this.cq());
            if (a.d && !b) {
                for (let c = 0; c < this.cs.count; c++) {
                    let d = this.cs._inner[c];
                    if (d.a0 == 0) {
                        d.ae(a);
                    }
                }
            }
        }
        cq() {
            if (this.cn.abc != null) {
                return this.cn.abc;
            }
            return this.f.dc.getFontInfo();
        }
        ax(a) {
            super.ax(a);
            for (let b = 0; b < this.cs.count; b++) {
                let c = this.cs._inner[b];
                if (c.a0 != 0) {
                    continue;
                }
                c.ab(this.cn, this.cq(), a);
            }
        }
        db(a) {
            this.m.af(this.cq());
            this.ct = this.cu();
            let b = this.m.aj(a, this.ct, true);
            return new Size(1, b.c, b.b);
        }
        cu() {
            let a = this.cq();
            if (isNaN_(this.ct)) {
                let b = FontUtil.getCurrentFontHeight(this.f.dc.dw.j.ae, a);
                this.ct = b;
            }
            return this.ct;
        }
        da(a, b, c) {
            if (this.co == null) {
                this.co = new CalloutView(this);
            }
            this.co.x = a;
            this.co.az = b;
            if (c != null && c.badgeVisible) {
                this.co.o = c.badgeGap;
                this.co.p = c.badgeHeight;
                this.co.r = c.badgeWidth;
                this.co.h = c.badgeVisible;
                this.co.q = c.badgeThickness;
                this.co.aa = c.badgeImage;
            }
            else {
                this.co.o = 0;
                this.co.p = 0;
                this.co.r = 0;
                this.co.q = 0;
                this.co.aa = null;
                this.co.h = false;
            }
            let d = this.co.aw();
            this.co.x = null;
            return d;
        }
        c2(a, b, c) {
            a.u = b;
            a.v = c;
        }
        c3(a, b, c) {
            a.af(this.f, b, c);
        }
        c4(a, b) {
            if (b != null && this.cn.acl) {
                return this.c9(b);
            }
            if (a != null) {
                return this.c9(a.v0);
            }
            return this.f.v0;
        }
        c7() {
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 255, 255, 255);
                return $ret;
            })());
        }
        c5() {
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 0, 0, 0);
                return $ret;
            })());
        }
        c8(a, b) {
            if (b != null && this.cn.acm) {
                return this.c9(b);
            }
            if (this.cn.acn) {
                if (a != null) {
                    return this.c9(a.v0);
                }
            }
            if (a != null) {
                return this.c9(a.vx);
            }
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 255, 255, 255);
                return $ret;
            })());
        }
        c6(a, b) {
            if (b != null && this.cn.acm) {
                return this.c9(b);
            }
            if (a != null) {
                return this.c9(a.vt);
            }
            return this.f.vt;
        }
        c1() {
            this.ct = NaN;
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'>                  \r\n                <div class='ui-chart-user-annotation-tooltip-main-content'></div>           \r\n                <div class='ui-chart-user-annotation-tooltip-template-content'>\r\n                </div>\r\n            </div>";
            return a;
        }
    }
    CalloutLayerView.$t = markType(CalloutLayerView, 'CalloutLayerView', AnnotationLayerView.$);
    return CalloutLayerView;
})();
/**
 * @hidden
 */
export let CalloutView = /*@__PURE__*/ (() => {
    class CalloutView extends Base {
        constructor(a) {
            super();
            this.w = null;
            this.f = false;
            this.a = null;
            this.a0 = 0;
            this.e = null;
            this.aj = null;
            this.au = null;
            this.aq = { $type: Point_$type, x: 0, y: 0 };
            this.as = null;
            this.at = null;
            this.ai = null;
            this.d = new ImageLoader();
            this.ay = new Thickness(0, 0);
            this.ax = null;
            this.m = 0;
            this.u = 0;
            this.v = 0;
            this.g = true;
            this.l = 0;
            this.k = 0;
            this.y = null;
            this.z = "";
            this.c = null;
            this.as = new Line();
            this.as.ab = false;
            this.as._stroke = ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 0, 0, 0);
                return $ret;
            })());
            this.as.ad = 2;
            this.at = new Rectangle();
            this.at.ab = false;
            this.at.ad = 1;
            this.at._stroke = ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 0, 0, 0);
                return $ret;
            })());
            this.at._fill = ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(155, 255, 255, 255);
                return $ret;
            })());
            this.at.width = 0;
            this.at.height = 0;
            this.ai = new Image();
            this.aj = new TextBlock();
            this.au = new Rectangle();
            this.au.ad = 0;
            this.a = a;
            this.a0 = 0;
            let b = this.d;
            b.loadCompleted = delegateCombine(b.loadCompleted, runOn(this, this.ac));
        }
        ac(a, b) {
            let c = this.y;
            let d = b.d;
            if (d == c && c != this.z) {
                this.f = true;
                this.w = b.b;
                this.z = c;
                if (this.a != null) {
                    this.a.c0();
                }
            }
        }
        i() {
            if (!this.h || this.at.height <= 0 || isNaN_(this.at.height) || this.at.width <= 0 || isNaN_(this.at.width)) {
                return false;
            }
            return true;
        }
        ae(a) {
            this.e = a;
            let b = CalloutViewHelper.a(this.ay, this.aj.m, this.aj.l, this.at.width, this.at.height, this.o, this.h);
            a.aa();
            a.ai(this.u, this.v);
            let c = new TranslateTransform();
            c.j = this.ax.left;
            c.k = this.ax.top;
            this.au.j = c;
            a.s(this.as);
            a.aa();
            this.au.width = b.f.width;
            this.au.height = b.f.height;
            this.au.ap = this.m;
            this.au.aq = this.m;
            a.k(this.au.j);
            a.w(this.au);
            let d = b.e;
            let e = b.d;
            if (b.a) {
                this.at.n = b.b;
                this.at.o = b.c;
                this.at.ap = this.k;
                this.at.aq = this.k;
                a.w(this.at);
                if (this.f && this.w != null) {
                    let f = this.q;
                    let g = this.at.n + (f / 2);
                    let h = this.at.o + (f / 2);
                    let i = this.at.width - this.q;
                    let j = this.at.height - this.q;
                    a.aa();
                    let k = new Rectangle();
                    k.n = g;
                    k.o = h;
                    k.width = i;
                    k.height = j;
                    k.ap = this.at.ap;
                    k.aq = this.at.aq;
                    a.ad(k);
                    a.n(this.w, 1, g, h, i, j);
                    a.z();
                }
            }
            this.aj.ag = true;
            this.aj.o = d;
            this.aj.n = e;
            a.x(this.aj);
            a.z();
            a.z();
        }
        get ar() {
            return this.aq;
        }
        set ar(a) {
            if (this.aq.x != a.x || this.aq.y != a.y) {
                this.aq = a;
                this.ah();
            }
        }
        get ap() {
            return this.aj.ao;
        }
        set ap(a) {
            this.aj.ao = a;
        }
        get ao() {
            return this.au._stroke;
        }
        set ao(a) {
            this.au._stroke = a;
        }
        get an() {
            return this.as._stroke;
        }
        set an(a) {
            this.as._stroke = a;
        }
        get am() {
            return this.au._fill;
        }
        set am(a) {
            this.au._fill = a;
        }
        get t() {
            return this.au.ad;
        }
        set t(a) {
            this.au.ad = a;
        }
        get az() {
            return this.ay;
        }
        set az(a) {
            this.ay = a;
        }
        get s() {
            return this.m;
        }
        set s(a) {
            this.m = a;
        }
        get x() {
            return this.aj.al;
        }
        set x(a) {
            if (a == null) {
                this.aj.al = "";
            }
            else {
                this.aj.al = a.toString();
            }
            this.ah();
        }
        ah() {
            if (!this.j) {
                this.as._visibility = 1;
                this.ax = new Thickness(0, 0);
                return;
            }
            this.ad();
            this.as._visibility = 0;
            let a = this.av();
            let b = CalloutViewHelper.e(this.ar, a.width, a.height, this.as);
            this.ax = b;
        }
        get ak() {
            return this.at._fill;
        }
        set ak(a) {
            this.at._fill = a;
        }
        get al() {
            return this.at._stroke;
        }
        set al(a) {
            this.at._stroke = a;
        }
        get q() {
            return this.at.ad;
        }
        set q(a) {
            if (this.at.ad != a) {
                this.at.ad = a;
            }
        }
        get p() {
            return this.at.height;
        }
        set p(a) {
            if (this.at.height != a) {
                this.at.height = a;
            }
        }
        get r() {
            return this.at.width;
        }
        set r(a) {
            if (this.at.width != a) {
                this.at.width = a;
            }
        }
        get h() {
            return this.at._visibility == 0;
        }
        set h(a) {
            this.at._visibility = a ? 0 : 1;
        }
        get j() {
            return this.g;
        }
        set j(a) {
            this.g = a;
            this.ah();
        }
        get o() {
            return this.l;
        }
        set o(a) {
            this.l = a;
        }
        get n() {
            return this.k;
        }
        set n(a) {
            this.k = a;
        }
        get aa() {
            return this.y;
        }
        set aa(a) {
            if (this.y != a) {
                this.y = a;
                this.ag();
            }
        }
        ag() {
            this.f = false;
            if (stringIsNullOrEmpty(this.y)) {
                this.ai.ac = null;
                this.z = null;
            }
            else {
                if (this.y != this.z) {
                    this.d.request(this.y);
                }
            }
        }
        aw() {
            this.ad();
            let a = this.av();
            return a;
        }
        ad() {
            let a = this.a.db(this.aj);
            this.aj.m = a.width;
            this.aj.l = a.height;
        }
        av() {
            return CalloutViewHelper.d(this.ay, this.aj.m, this.aj.l, this.at.width, this.at.height, this.o, this.h);
        }
        af(a, b, c) {
            if (this.c == null) {
                this.c = new DataContext();
            }
            this.c.series = a;
            this.c.item = c;
            if (b.c != null) {
                b.c.y = this.c;
            }
        }
        ab(a, b, c) {
            a.bc.exportCalloutData(this.u, this.v, this.ax.left, this.ax.top, c, this.au, this.at, this.aj, b, this.as, "callout", ["Main", "Callout"]);
        }
        b(a = null) {
            let b = a;
            if (b == null) {
                b = this.a;
            }
            let c = new CalloutView(b);
            c.a0 = this.a0;
            c.u = this.u;
            c.v = this.v;
            c.ap = this.ap;
            c.ao = this.ao;
            c.an = this.an;
            c.am = this.am;
            c.t = this.t;
            c.az = this.az;
            c.s = this.s;
            c.x = this.x;
            c.ar = this.ar;
            c.ak = this.ak;
            c.al = this.al;
            c.q = this.q;
            c.r = this.r;
            c.p = this.p;
            c.h = this.h;
            c.o = this.o;
            c.n = this.n;
            c.aa = this.aa;
            c.f = this.f;
            c.w = this.w;
            c.z = this.z;
            return c;
        }
    }
    CalloutView.$t = markType(CalloutView, 'CalloutView');
    return CalloutView;
})();