/*
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 { Axis } from "./Axis";
import { DependencyProperty } from "igniteui-react-core";
import { DataToolTipLayerGroupingMode_$type } from "igniteui-react-core";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core";
import { Base, enumGetBox, EnumUtil, fromEnum, typeCast, String_$type, typeGetValue, Point_$type, Array_$type, markType, markDep, runOn, TypeRegistrar } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { RectUtil } from "igniteui-react-core";
import { DataTooltipGroupedPositionX_$type } from "igniteui-react-core";
import { DataTooltipGroupedPositionY_$type } from "igniteui-react-core";
import { DataAbbreviationMode_$type } from "igniteui-react-core";
import { DataLegendValueMode_$type } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { DataLegendHeaderDateMode_$type } from "igniteui-react-core";
import { DataLegendHeaderTimeMode_$type } from "igniteui-react-core";
import { DataLegendSummaryType_$type } from "igniteui-react-core";
import { LegendItemBadgeShape_$type } from "igniteui-react-core";
import { DataLegendUnitsMode_$type } from "igniteui-react-core";
import { DataLegendLabelMode_$type } from "igniteui-react-core";
import { DataToolTipLayerFrame } from "./DataToolTipLayerFrame";
import { Dictionary$2 } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Pool$1 } from "igniteui-react-core";
import { DataToolTipSeriesInfo } from "./DataToolTipSeriesInfo";
import { DataContext } from "igniteui-react-core";
import { DataTooltipCollisionInfo } from "./DataTooltipCollisionInfo";
import { DeviceUtils } from "igniteui-react-core";
import { HashSet$1 } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
import { stringEmpty } from "igniteui-react-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { PointerTooltip } from "./PointerTooltip";
import { IOnDemandRender_$type } from "igniteui-react-core";
/**
 * @hidden
 */
export let DataToolTipLayer = /*@__PURE__*/ (() => {
    class DataToolTipLayer extends AnnotationLayer {
        bc() {
            return new DataToolTipLayer();
        }
        get_d6() {
            return true;
        }
        constructor() {
            super();
            this.xr = 1;
            this.yt = new Dictionary$2(String_$type, Base.$, 0);
            this.yu = new List$1(String_$type, 0);
            this.xj = 8;
            this.xn = 11;
            this.x6 = null;
            this.xy = null;
            this.x1 = null;
            this.x3 = null;
            this.x0 = null;
            this.x2 = null;
            this.x5 = null;
            this.x4 = null;
            this.xz = null;
            let a = new DataToolTipLayerFrame();
            let b = new DataToolTipLayerFrame();
            let c = new DataToolTipLayerFrame();
            this.uh = a;
            this.ug = b;
            this.ui = c;
            this.ab = DataToolTipLayer.$;
        }
        cd() {
            return new DataToolTipLayerView(this);
        }
        o2(a) {
            super.o2(a);
            this.xv = a;
        }
        get_eh() {
            return true;
        }
        get xs() {
            return this.xr;
        }
        set xs(a) {
            let b = this.xr;
            this.xr = a;
            if (b != this.xr) {
                this.raisePropertyChanged("ActualGroupingMode", enumGetBox(DataToolTipLayerGroupingMode_$type, b), enumGetBox(DataToolTipLayerGroupingMode_$type, this.xr));
            }
        }
        xu() {
            let a = true;
            let b = true;
            let c = true;
            let d = true;
            if (this.xt != 0) {
                return this.xt;
            }
            let e = this.xa();
            if (e != null) {
                for (let f of fromEnum(e.db())) {
                    if (!f.d7 && !f.fa) {
                        a = false;
                    }
                    if (!f.d7 && !f.e3) {
                        b = false;
                    }
                    if (!f.d7 && !f.fb) {
                        c = false;
                    }
                    if (!f.d7 && !f.e7) {
                        d = false;
                    }
                }
            }
            if (a || b || c || d) {
                return 2;
            }
            return 1;
        }
        pa(a, b, c, d) {
            super.pa(a, b, c, d);
            switch (b) {
                case DataToolTipLayer.$$p[37]:
                    this.pr(true);
                    break;
                case DataToolTipLayer.$$p[44]:
                    this.pr(true);
                    break;
                case DataToolTipLayer.$$p[8]:
                    this.xs = this.xu();
                    break;
                case "ActualGroupingMode":
                    this.pr(true);
                    break;
                case DataToolTipLayer.$$p[6]:
                    this.xk = this.xm();
                    break;
                case DataToolTipLayer.$$p[7]:
                    this.xo = this.xq();
                    break;
                case "SeriesViewer":
                    this.xv.cl();
                    break;
                case DataToolTipLayer.$$p[26]:
                case DataToolTipLayer.$$p[20]:
                case DataToolTipLayer.$$p[5]:
                case DataToolTipLayer.$$p[19]:
                case DataToolTipLayer.$$p[4]:
                case DataToolTipLayer.$$p[45]:
                case DataToolTipLayer.$$p[47]:
                case DataToolTipLayer.$$p[48]:
                case DataToolTipLayer.$$p[49]:
                case DataToolTipLayer.$$p[46]:
                case DataToolTipLayer.$$p[52]:
                case DataToolTipLayer.$$p[51]:
                case DataToolTipLayer.$$p[50]:
                case DataToolTipLayer.$$p[53]:
                case DataToolTipLayer.$$p[54]:
                case DataToolTipLayer.$$p[58]:
                case DataToolTipLayer.$$p[57]:
                case DataToolTipLayer.$$p[56]:
                case DataToolTipLayer.$$p[55]:
                case "ValueTextStyle":
                case DataToolTipLayer.$$p[12]:
                case DataToolTipLayer.$$p[11]:
                case DataToolTipLayer.$$p[9]:
                case DataToolTipLayer.$$p[10]:
                case DataToolTipLayer.$$p[13]:
                case DataToolTipLayer.$$p[18]:
                case DataToolTipLayer.$$p[16]:
                case DataToolTipLayer.$$p[17]:
                case DataToolTipLayer.$$p[14]:
                case DataToolTipLayer.$$p[15]:
                case "HeaderTextStyle":
                case DataToolTipLayer.$$p[30]:
                case "SummaryTitleTextStyle":
                case DataToolTipLayer.$$p[33]:
                case DataToolTipLayer.$$p[32]:
                case DataToolTipLayer.$$p[31]:
                case DataToolTipLayer.$$p[29]:
                case DataToolTipLayer.$$p[36]:
                case "SummaryValueTextStyle":
                case DataToolTipLayer.$$p[28]:
                case DataToolTipLayer.$$p[27]:
                case "SummaryLabelTextStyle":
                case DataToolTipLayer.$$p[35]:
                case DataToolTipLayer.$$p[34]:
                case "SummaryUnitsTextStyle":
                case DataToolTipLayer.$$p[0]:
                case DataToolTipLayer.$$p[1]:
                case DataToolTipLayer.$$p[40]:
                case DataToolTipLayer.$$p[43]:
                case DataToolTipLayer.$$p[41]:
                case DataToolTipLayer.$$p[42]:
                case "UnitsTextStyle":
                case DataToolTipLayer.$$p[39]:
                case DataToolTipLayer.$$p[38]:
                case "TitleTextStyle":
                case DataToolTipLayer.$$p[21]:
                case DataToolTipLayer.$$p[22]:
                case DataToolTipLayer.$$p[23]:
                case "LabelTextStyle":
                    this.acb(b, c, d);
                    break;
            }
        }
        acb(a, b, c) {
            if (!this.yt.containsKey(a)) {
                this.yu.add(a);
                this.yt.addItem(a, c);
            }
            else {
                this.yt.item(a, c);
            }
            this.pr(true);
        }
        acf(a, b) {
            switch (a) {
                case DataToolTipLayer.$$p[8]:
                    this.xt = EnumUtil.getEnumValue(DataToolTipLayerGroupingMode_$type, b);
                    break;
                case DataToolTipLayer.$$p[24]:
                    this.yy = b;
                    break;
                case DataToolTipLayer.$$p[25]:
                    this.yz = b;
                    break;
                case DataToolTipLayer.$$p[2]:
                    this.yw = b;
                    break;
                case DataToolTipLayer.$$p[3]:
                    this.yx = b;
                    break;
                case DataToolTipLayer.$$p[6]:
                    this.xl = EnumUtil.getEnumValue(DataTooltipGroupedPositionX_$type, b);
                    break;
                case DataToolTipLayer.$$p[7]:
                    this.xp = EnumUtil.getEnumValue(DataTooltipGroupedPositionY_$type, b);
                    break;
                case DataToolTipLayer.$$p[26]:
                    this.yo = b;
                    break;
                case DataToolTipLayer.$$p[20]:
                    this.w8 = b;
                    break;
                case DataToolTipLayer.$$p[5]:
                    this.w3 = b;
                    break;
                case DataToolTipLayer.$$p[19]:
                    this.w7 = b;
                    break;
                case DataToolTipLayer.$$p[4]:
                    this.w2 = b;
                    break;
                case DataToolTipLayer.$$p[45]:
                    this.xc = EnumUtil.getEnumValue(DataAbbreviationMode_$type, b);
                    break;
                case DataToolTipLayer.$$p[47]:
                    this.zy = typeGetValue(b);
                    break;
                case DataToolTipLayer.$$p[48]:
                    this.zz = typeGetValue(b);
                    break;
                case DataToolTipLayer.$$p[49]:
                    this.xi = EnumUtil.getEnumValue(DataLegendValueMode_$type, b);
                    break;
                case DataToolTipLayer.$$p[46]:
                    this.abt = b;
                    break;
                case DataToolTipLayer.$$p[52]:
                    this.yq = b;
                    break;
                case DataToolTipLayer.$$p[51]:
                    this.abz = b;
                    break;
                case DataToolTipLayer.$$p[50]:
                    this.w9 = b;
                    break;
                case DataToolTipLayer.$$p[53]:
                    this.aeq = b;
                    break;
                case DataToolTipLayer.$$p[54]:
                    this.yr = b;
                    break;
                case DataToolTipLayer.$$p[58]:
                    this.ab8 = b;
                    break;
                case DataToolTipLayer.$$p[57]:
                    this.ys = b;
                    break;
                case DataToolTipLayer.$$p[56]:
                    this.aer = b;
                    break;
                case DataToolTipLayer.$$p[55]:
                    this.aeb = b;
                    break;
                case "ValueTextStyle":
                    this.yf = b;
                    break;
                case DataToolTipLayer.$$p[12]:
                    this.aah = b;
                    break;
                case DataToolTipLayer.$$p[11]:
                    this.w6 = b;
                    break;
                case DataToolTipLayer.$$p[9]:
                    this.aad = b;
                    break;
                case DataToolTipLayer.$$p[10]:
                    this.xd = EnumUtil.getEnumValue(DataLegendHeaderDateMode_$type, b);
                    break;
                case DataToolTipLayer.$$p[13]:
                    this.xe = EnumUtil.getEnumValue(DataLegendHeaderTimeMode_$type, b);
                    break;
                case DataToolTipLayer.$$p[18]:
                    this.aam = b;
                    break;
                case DataToolTipLayer.$$p[16]:
                    this.ad3 = b;
                    break;
                case DataToolTipLayer.$$p[17]:
                    this.aek = b;
                    break;
                case DataToolTipLayer.$$p[14]:
                    this.aej = b;
                    break;
                case DataToolTipLayer.$$p[15]:
                    this.yh = b;
                    break;
                case "HeaderTextStyle":
                    this.x7 = b;
                    break;
                case DataToolTipLayer.$$p[30]:
                    this.ad6 = b;
                    break;
                case "SummaryTitleTextStyle":
                    this.ya = b;
                    break;
                case DataToolTipLayer.$$p[33]:
                    this.xg = EnumUtil.getEnumValue(DataLegendSummaryType_$type, b);
                    break;
                case DataToolTipLayer.$$p[32]:
                    this.aa5 = b;
                    break;
                case DataToolTipLayer.$$p[31]:
                    this.aen = b;
                    break;
                case DataToolTipLayer.$$p[29]:
                    this.aem = b;
                    break;
                case DataToolTipLayer.$$p[36]:
                    this.ad8 = b;
                    break;
                case "SummaryValueTextStyle":
                    this.yc = b;
                    break;
                case DataToolTipLayer.$$p[28]:
                    this.aa0 = b;
                    break;
                case DataToolTipLayer.$$p[27]:
                    this.ad5 = b;
                    break;
                case "SummaryLabelTextStyle":
                    this.x9 = b;
                    break;
                case DataToolTipLayer.$$p[35]:
                    this.abb = b;
                    break;
                case DataToolTipLayer.$$p[34]:
                    this.ad7 = b;
                    break;
                case "SummaryUnitsTextStyle":
                    this.yb = b;
                    break;
                case DataToolTipLayer.$$p[0]:
                    this.aei = b;
                    break;
                case DataToolTipLayer.$$p[1]:
                    this.xx = EnumUtil.getEnumValue(LegendItemBadgeShape_$type, b);
                    break;
                case DataToolTipLayer.$$p[40]:
                    this.xh = EnumUtil.getEnumValue(DataLegendUnitsMode_$type, b);
                    break;
                case DataToolTipLayer.$$p[43]:
                    this.abm = b;
                    break;
                case DataToolTipLayer.$$p[41]:
                    this.aea = b;
                    break;
                case DataToolTipLayer.$$p[42]:
                    this.aep = b;
                    break;
                case "UnitsTextStyle":
                    this.ye = b;
                    break;
                case DataToolTipLayer.$$p[39]:
                    this.aeo = b;
                    break;
                case DataToolTipLayer.$$p[38]:
                    this.ad9 = b;
                    break;
                case "TitleTextStyle":
                    this.yd = b;
                    break;
                case DataToolTipLayer.$$p[21]:
                    this.xf = EnumUtil.getEnumValue(DataLegendLabelMode_$type, b);
                    break;
                case DataToolTipLayer.$$p[22]:
                    this.ad4 = b;
                    break;
                case DataToolTipLayer.$$p[23]:
                    this.ael = b;
                    break;
                case "LabelTextStyle":
                    this.x8 = b;
                    break;
            }
        }
        acc(a) {
            for (let b = 0; b < this.yu.count; b++) {
                let c = this.yu._inner[b];
                a.updatePropertyByName(c, this.yt.item(c));
            }
        }
        vt(a, b) {
            {
                if (!this.at.c) {
                    this.pr(b);
                }
            }
        }
        vu(a, b) {
            if (!this.at.c) {
                this.pr(b);
            }
        }
        vw(a, b) {
            super.vw(a, b);
            this.xr = this.xu();
            let c = a;
            let d = this.xv.b9;
            let e = this.yp;
            let f = false;
            c.m.clear();
            c.i.clear();
            c.l.clear();
            c.g.clear();
            c.f.clear();
            c.k.clear();
            c.j.clear();
            c.h.clear();
            if (isNaN_(this.wz.x) && isNaN_(this.wz.y)) {
                d.count = 0;
                return;
            }
            {
                if (this.xs == 2) {
                    let g = 0;
                    {
                        for (let h of fromEnum(this.cv.series)) {
                            if (this.un(h)) {
                                this.ace(h, c, e, f, g);
                                g++;
                            }
                            if (h.isStacked) {
                                h.n6((i) => {
                                    if (this.un(i)) {
                                        this.ace(i, c, e, f, g);
                                        g++;
                                    }
                                    if (i.dw) {
                                        i.n4((j) => {
                                            if (this.un(j)) {
                                                this.ace(j, c, e, f, g);
                                                g++;
                                            }
                                            return true;
                                        });
                                    }
                                    return true;
                                });
                            }
                            if (h.dw) {
                                h.n4((i) => {
                                    if (this.un(i)) {
                                        this.ace(i, c, e, f, g);
                                        g++;
                                    }
                                    return true;
                                });
                            }
                        }
                        this.aca(c);
                    }
                    d.count = g;
                }
                else {
                    let i = this.xa();
                    let j = this.yv(i);
                    let k = this.xw(i, j, e);
                    this.acd(k, c, e);
                }
            }
        }
        yv(a) {
            let b = new List$1(Series.$, 0);
            if (a == null) {
                return b;
            }
            for (let c of fromEnum(a.de)) {
                b.add(c);
            }
            return b;
        }
        xa() {
            if (this.xb != null) {
                return this.xb;
            }
            if (this.cv == null) {
                return null;
            }
            for (let a of fromEnum(this.cv.series)) {
                if (a.ed) {
                    let b = a.as();
                    if (b != null && b.co()) {
                        return b;
                    }
                }
            }
            for (let c of fromEnum(this.cv.series)) {
                if (!c.ed) {
                    let d = c.ag();
                    let e = d != null && d.length > 0 ? d[0] : null;
                    if (e != null && e.co()) {
                        return e;
                    }
                }
            }
            return null;
        }
        xw(a, b, c) {
            let d = 1.7976931348623157E+308;
            let e = -1.7976931348623157E+308;
            let f = new List$1(DataContext.$, 0);
            let g = new List$1(Base.$, 0);
            let h = false;
            let i = true;
            let j = { $type: Point_$type, x: NaN, y: NaN };
            let k = 0;
            let l = 0;
            for (let m = 0; m < b.count; m++) {
                let n = b.item(m);
                k = n.cv.l;
                l = n.cv.m;
                if (n.ed) {
                    let o = n;
                    let p = new List$1(Series.$, 0);
                    if (o.isStacked) {
                        o.n6((q) => {
                            p.add(q);
                            if (q.dw) {
                                q.n4((r) => {
                                    p.add(r);
                                    return true;
                                });
                            }
                            return true;
                        });
                    }
                    else if (o.dw) {
                        p.add(o);
                        o.n4((q) => {
                            p.add(q);
                            return true;
                        });
                    }
                    else {
                        p.add(o);
                    }
                    for (let q = 0; q < p.count; q++) {
                        let r = p._inner[q];
                        let s = p._inner[q];
                        if (!r.categoryAxis.co()) {
                            continue;
                        }
                        if (i) {
                            h = s.isVertical;
                        }
                        else {
                            if (h != s.isVertical) {
                                continue;
                            }
                        }
                        let t = this.vp(s);
                        if (!t.c) {
                            continue;
                        }
                        j = s.te(t.d);
                        let u = s.tj(t.d, c, false);
                        if (h) {
                            if (!isNaN_(u.y)) {
                                d = Math.min(d, u.y);
                                e = Math.max(e, u.y);
                            }
                        }
                        else {
                            if (!isNaN_(u.x)) {
                                d = Math.min(d, u.x);
                                e = Math.max(e, u.x);
                            }
                        }
                    }
                }
                else {
                    let v = n.ag();
                    for (let w = 0; w < v.length; w++) {
                        if (!v[w].co()) {
                            continue;
                        }
                    }
                    let x = n.tj(this.wz, c, false);
                    j = n.te(this.wz);
                    if (h) {
                        if (!isNaN_(x.y)) {
                            d = Math.min(d, x.y);
                            e = Math.max(e, x.y);
                        }
                    }
                    else {
                        if (!isNaN_(x.x)) {
                            d = Math.min(d, x.x);
                            e = Math.max(e, x.x);
                        }
                    }
                }
                let y = null;
                let z = n.js(this.wz);
                if (n.ei && z != null) {
                    y = n.av(z);
                }
                else {
                    y = new DataContext();
                    y.item = z;
                    y.series = n;
                }
                f.add(y);
            }
            let aa = 0;
            let ab = 0;
            if (h) {
                ab = (d + e) / 2;
                aa = this.ty.right;
                if (!isNaN_(j.x)) {
                    aa = j.x;
                }
                if (ab < 0 || ab > this.ty.bottom) {
                    ab = NaN;
                }
            }
            else {
                aa = (d + e) / 2;
                if (!isNaN_(j.y)) {
                    ab = j.y;
                }
                if (aa < 0 || aa > this.ty.right) {
                    aa = NaN;
                }
            }
            let ac = new DataToolTipSeriesInfo();
            ac.f = { $type: Point_$type, x: aa, y: ab };
            ac.e = { $type: Point_$type, x: j.x, y: j.y };
            ac.b = f;
            ac.a = h;
            return ac;
        }
        n9() {
            this.wz = { $type: Point_$type, x: NaN, y: NaN };
            this.pr(false);
            this.xv.cj(false);
        }
        oa() {
            this.wz = { $type: Point_$type, x: NaN, y: NaN };
            this.pr(false);
            this.xv.cj(true);
        }
        get aef() {
            let a = RectUtil.n(this.cg.bx);
            let b = new Size(1, this.cg.bx.width, this.cg.bx.height);
            return new Rect(3, a, b);
        }
        get aee() {
            let a = RectUtil.n(this.cg.bx);
            let b = new Size(1, this.cg.bx.width, this.cg.bx.height);
            return new Rect(3, this.xv.cm(a), b);
        }
        get aed() {
            let a = new Rect(0, 0, 0, this.cv.m, this.cv.l);
            let b = RectUtil.n(a);
            let c = new Size(1, a.width, a.height);
            return new Rect(3, this.xv.cm(b), c);
        }
        get aeh() {
            let a = { $type: Point_$type, x: 0, y: 0 };
            return new Rect(3, a, this.xv.cr());
        }
        aeg() {
            return this.aef;
        }
        yl(a, b, c) {
            if (Rect.l_op_Equality(a, Rect.empty)) {
                return false;
            }
            let d = a.top;
            return c < d;
        }
        yi(a, b, c, d) {
            if (Rect.l_op_Equality(a, Rect.empty)) {
                return false;
            }
            let e = a.bottom;
            return c + d.height >= e;
        }
        yj(a, b, c) {
            if (Rect.l_op_Equality(a, Rect.empty)) {
                return false;
            }
            let d = a.left;
            return c < d;
        }
        yk(a, b, c, d) {
            if (Rect.l_op_Equality(a, Rect.empty)) {
                return false;
            }
            let e = a.right;
            return c + d.width > e;
        }
        zo(a, b) {
            return a.top + b;
        }
        zm(a, b, c) {
            return a.bottom - c.height - b;
        }
        zn(a, b) {
            return ((a.bottom + a.top) / 2) - (b.height / 2);
        }
        zx(a, b, c, d, e) {
            let f = c.y - d.height - b;
            return f;
        }
        zv(a, b, c, d, e) {
            let f = c.y + b;
            return f;
        }
        zw(a, b, c, d, e) {
            let f = c.y - (d.height / 2);
            return f;
        }
        zr(a, b, c, d, e) {
            let f = c.y - d.height;
            f = f - b;
            return f;
        }
        zp(a, b, c, d, e) {
            let f = c.y;
            f = f + b;
            return f;
        }
        zq(a, b, c, d, e) {
            let f = c.y - (d.height / 2);
            return f;
        }
        y7(a, b) {
            return a.left + b;
        }
        y9(a, b, c) {
            return (a.right - (c.width)) - b;
        }
        y8(a, b, c) {
            return ((a.right + a.left) / 2) - (c.width / 2) + b;
        }
        zg(a, b, c, d, e) {
            let f = (c.x - d.width) - b;
            return f;
        }
        zi(a, b, c, d, e) {
            let f = c.x + b;
            return f;
        }
        zh(a, b, c, d, e) {
            let f = (c.x - (d.width / 2));
            f = f + b;
            return f;
        }
        zd(a, b, c, d, e) {
            let f = c.x - d.width;
            f = f - b;
            return f;
        }
        zf(a, b, c, d, e) {
            let f = c.x;
            f = f + b;
            return f;
        }
        ze(a, b, c, d, e) {
            let f = c.x - (d.width / 2);
            f = f + b;
            return f;
        }
        y3(a, b, c, d, e, f, g, h) {
            switch (a) {
                case 1:
                    {
                        return this.zr(e, b, h, f, true);
                    }
                case 2:
                    {
                        return this.zp(e, b, h, f, true);
                    }
                case 3:
                    {
                        return this.zq(e, b, h, f, true);
                    }
                case 5: return this.zs(e, c, b, h, f);
                case 6: return this.zt(e, c, b, h, f);
                case 4: return this.zu(e, c, b, h, f);
                case 8: return this.zj(e, c, b, h, f);
                case 9: return this.zk(e, c, b, h, f);
                case 7: return this.zl(e, c, b, h, f);
                case 13: return this.zo(d, b);
                case 14: return this.zm(d, b, f);
                case 15: return this.zn(d, f);
                case 10: return this.zx(e, b, g, f, true);
                case 12: return this.zw(e, b, g, f, true);
                case 11:
                default: return this.zv(e, b, g, f, true);
            }
        }
        za(a, b, c, d, e) {
            let f = d.x;
            f = f + b / 2;
            f = f - e.width;
            f = f - c;
            return f;
        }
        zb(a, b, c, d, e) {
            let f = d.x;
            f = f + b / 2;
            f = f - e.width / 2;
            f = f + c;
            return f;
        }
        zc(a, b, c, d, e) {
            let f = d.x;
            f = f + b / 2;
            f = f + c;
            return f;
        }
        y4(a, b, c, d, e) {
            let f = d.x;
            f = f - b / 2;
            f = f - e.width;
            f = f - c;
            return f;
        }
        y5(a, b, c, d, e) {
            let f = d.x;
            f = f - b / 2;
            f = f - e.width / 2;
            f = f + c;
            return f;
        }
        y6(a, b, c, d, e) {
            let f = d.x;
            f = f - b / 2;
            f = f + c;
            return f;
        }
        zl(a, b, c, d, e) {
            let f = d.y;
            f = f + b / 2;
            f = f - e.height;
            f = f - c;
            return f;
        }
        zk(a, b, c, d, e) {
            let f = d.y;
            f = f + b / 2;
            f = f - e.height / 2;
            f = f + c;
            return f;
        }
        zj(a, b, c, d, e) {
            let f = d.y;
            f = f + b / 2;
            f = f + c;
            return f;
        }
        zu(a, b, c, d, e) {
            let f = d.y;
            f = f - b / 2;
            f = f - e.height;
            f = f - c;
            return f;
        }
        zt(a, b, c, d, e) {
            let f = d.y;
            f = f - b / 2;
            f = f - e.height / 2;
            f = f + c;
            return f;
        }
        zs(a, b, c, d, e) {
            let f = d.y;
            f = f - b / 2;
            f = f + c;
            return f;
        }
        y2(a, b, c, d, e, f, g, h) {
            switch (a) {
                case 10: return this.zg(e, b, g, f, true);
                case 11: return this.zi(e, b, g, f, true);
                case 12: return this.zh(e, b, g, f, true);
                case 13: return this.y7(d, b);
                case 14: return this.y9(e, b, f);
                case 15: return this.y8(e, b, f);
                case 5: return this.y6(e, c, b, h, f);
                case 6: return this.y5(e, c, b, h, f);
                case 4: return this.y4(e, c, b, h, f);
                case 8: return this.zc(e, c, b, h, f);
                case 9: return this.zb(e, c, b, h, f);
                case 7: return this.za(e, c, b, h, f);
                case 1:
                    {
                        return this.zd(e, b, h, f, true);
                    }
                case 3:
                    {
                        return this.ze(e, b, h, f, true);
                    }
                case 2:
                default:
                    {
                        return this.zf(e, b, h, f, true);
                    }
            }
        }
        aec(a, b, c, d) {
            let e = this.xk;
            let f = this.xo;
            let g = this.xa();
            let h = 0;
            if (g != null && g.cb && this.cv != null) {
                h = g.getCategorySize(this.cv.tr, this.ty, this.getEffectiveViewport());
                if (g.categoryMode == 0) {
                    h = 0;
                }
            }
            let i = this.y0(e);
            let j = this.y1(f);
            let k = this.y2(e, i, h, this.aef, a, b, c, d);
            let l = this.y3(f, j, h, this.aef, a, b, c, d);
            let m = this.ym(a, i, k, b);
            let n = this.yn(a, j, l, b);
            if (!m) {
                let o = this.w4(e);
                let p = 0;
                while (!m && p < o.length) {
                    e = o[p];
                    i = this.y0(e);
                    k = this.y2(e, i, h, this.aef, a, b, c, d);
                    m = this.ym(a, i, k, b);
                    p++;
                }
            }
            if (!n) {
                let q = this.w5(f);
                let r = 0;
                while (!n && r < q.length) {
                    f = q[r];
                    j = this.y1(f);
                    l = this.y3(f, j, h, this.aef, a, b, c, d);
                    n = this.yn(a, j, l, b);
                    r++;
                }
            }
            return { $type: Point_$type, x: k, y: l };
        }
        y1(a) {
            if (!isNaN_(this.yz)) {
                return this.yz;
            }
            switch (a) {
                case 1: return this.yx;
                case 2: return this.yx;
                case 3: return 0;
                case 4: return this.yx;
                case 5: return this.yx;
                case 6: return this.yx;
                case 7: return this.yx;
                case 8: return this.yx;
                case 9: return 0;
                case 10: return this.yx;
                case 11: return this.yx;
                case 12: return 0;
                case 13: return this.yx;
                case 14: return this.yx;
                case 15: return 0;
            }
            return this.yx;
        }
        y0(a) {
            if (!isNaN_(this.yy)) {
                return this.yy;
            }
            switch (a) {
                case 4: return this.yw;
                case 6: return 0;
                case 5: return this.yw;
                case 13: return this.yw;
                case 15: return 0;
                case 14: return this.yw;
                case 7: return this.yw;
                case 9: return 0;
                case 8: return this.yw;
                case 1: return this.yw;
                case 3: return 0;
                case 2: return this.yw;
                case 10: return this.yw;
                case 12: return 0;
                case 11: return this.yw;
            }
            return this.yw;
        }
        w5(a) {
            let b = [a];
            switch (a) {
                case 1:
                    b = [2, 3];
                    break;
                case 2:
                    b = [1, 3];
                    break;
                case 3:
                    b = [1, 2];
                    break;
                case 4:
                    b = [8, 7, 3];
                    break;
                case 5:
                    b = [7, 8, 3];
                    break;
                case 6:
                    b = [9, 8, 4, 3];
                    break;
                case 7:
                    b = [5, 4, 2];
                    break;
                case 8:
                    b = [4, 5, 3];
                    break;
                case 9:
                    b = [6, 4, 8, 3];
                    break;
                case 10:
                    b = [11, 12];
                    break;
                case 11:
                    b = [10, 12];
                    break;
                case 12:
                    b = [10, 11];
                    break;
                case 13: break;
                case 14: break;
                case 15: break;
            }
            return b;
        }
        w4(a) {
            let b = [a];
            switch (a) {
                case 1:
                    b = [2, 3];
                    break;
                case 2:
                    b = [1, 3];
                    break;
                case 3:
                    b = [1, 2];
                    break;
                case 4:
                    b = [8, 7, 3];
                    break;
                case 5:
                    b = [7, 8, 1];
                    break;
                case 6:
                    b = [9, 8, 4, 3];
                    break;
                case 7:
                    b = [5, 4, 2];
                    break;
                case 8:
                    b = [4, 5, 3];
                    break;
                case 9:
                    b = [6, 4, 8, 3];
                    break;
                case 10:
                    b = [11, 12];
                    break;
                case 11:
                    b = [10, 12];
                    break;
                case 12:
                    b = [10, 11];
                    break;
                case 13: break;
                case 14: break;
                case 15: break;
            }
            return b;
        }
        ym(a, b, c, d) {
            return !(this.yj(a, b, c) || this.yk(a, b, c, d));
        }
        yn(a, b, c, d) {
            return !(this.yl(a, b, c) || this.yi(a, b, c, d));
        }
        aca(a) {
            let b = new List$1(DataTooltipCollisionInfo.$, 0);
            for (let c = 0; c < a.f.count; c++) {
                let d = new DataTooltipCollisionInfo();
                d.d = c;
                d.e = { $type: Point_$type, x: a.f._inner[c], y: a.g._inner[c] };
                d.c = a.k._inner[c];
                d.a = a.j._inner[c];
                d.b = a.m._inner[c];
                if (isNaN_(d.e.x) || isNaN_(d.e.y)) {
                    continue;
                }
                b.add(d);
            }
            b.aa((e, f) => {
                if (e.e.y < f.e.y) {
                    return -1;
                }
                if (e.e.y > f.e.y) {
                    return 1;
                }
                if (e.b < f.b) {
                    return -1;
                }
                if (e.b > f.b) {
                    return 1;
                }
                return 0;
            });
            let e = this.yg(b);
            if (!e) {
                return;
            }
            for (let f = 0; f < b.count - 1; f++) {
                let g = b._inner[f];
                let h = b._inner[f + 1];
                let i = new Rect(0, g.e.x, g.e.y, g.c, g.a);
                let j = new Rect(0, h.e.x, h.e.y, h.c, h.a);
                if (i.intersectsWith(j) || i.top > j.bottom) {
                    h.e = { $type: Point_$type, x: h.e.x, y: i.bottom + 1 };
                }
            }
            if (b._inner[b.count - 1].e.y + b._inner[b.count - 1].a > this.cg.bx.height) {
                b._inner[b.count - 1].e = { $type: Point_$type, x: b._inner[b.count - 1].e.x, y: b._inner[b.count - 1].e.y - ((b._inner[b.count - 1].e.y + b._inner[b.count - 1].a) - this.cg.bx.height) };
            }
            for (let k = b.count - 1; k >= 1; k--) {
                let l = b._inner[k];
                let m = b._inner[k - 1];
                let n = new Rect(0, l.e.x, l.e.y, l.c, l.a);
                let o = new Rect(0, m.e.x, m.e.y, m.c, m.a);
                if (n.intersectsWith(o) || n.top < o.bottom) {
                    m.e = { $type: Point_$type, x: m.e.x, y: n.top - (o.height + 1) };
                }
            }
            for (let p = 0; p < b.count; p++) {
                let q = b._inner[p].d;
                let r = b._inner[p];
                a.f._inner[q] = r.e.x;
                a.g._inner[q] = r.e.y;
            }
        }
        yg(a) {
            if (a.count <= 1) {
                return false;
            }
            let b = this.cg.bx;
            for (let c = 0; c < a.count - 1; c++) {
                let d = a._inner[c];
                let e = a._inner[c + 1];
                let f = new Rect(0, d.e.x, d.e.y, d.c, d.a);
                let g = new Rect(0, e.e.x, e.e.y, e.c, e.a);
                if (f.intersectsWith(g)) {
                    return true;
                }
            }
            return false;
        }
        ace(a, b, c, d, e) {
            let f = this.vp(a);
            if (!f.c) {
                return;
            }
            let g = a.tj(f.d, c, d);
            let h = this.xv.b9;
            let i = this.wz;
            if (!c) {
                i = this.to(g);
            }
            let j = a.js(i);
            let k = h.item(e);
            let l = this.cg.bx;
            let m = this.xv.b8(k);
            if (!Base.equalsStatic(m.target, this.cv)) {
                m.target = this.cv;
            }
            m.includedSeries = [a.dataLegendKey];
            this.acc(m);
            m.targetCursorPositionX = this.wz.x;
            m.targetCursorPositionY = this.wz.y;
            if (!this.xv.cb(k, a)) {
                return;
            }
            let n = this.xv.cq(k);
            b.i.add1(k);
            let o = g.x;
            let p = g.x;
            p = Math.max(p, l.left);
            p = Math.min(p, l.right);
            b.l.add(p);
            let q = g.y;
            q = Math.max(q, l.top);
            q = Math.min(q, l.bottom);
            b.m.add(q);
            let r = DeviceUtils.g(10);
            let s = g.x + r;
            if (s + n.width > l.right) {
                s = (o - n.width) - r;
            }
            if (s < l.left) {
                s = l.left;
            }
            b.f.add(s);
            let t = (g.y - n.height) - r;
            if (t + n.height > l.bottom) {
                t = (l.bottom - n.height) - r;
            }
            if (t < l.top) {
                t = l.top;
            }
            b.g.add(t);
            b.k.add(n.width);
            b.j.add(n.height);
            let u = this.su;
            if (u == null) {
                u = this.sy;
            }
            if (u == null) {
                u = a.su;
            }
            b.h.add(u);
        }
        acd(a, b, c) {
            this.xj = this.xm();
            this.xn = this.xq();
            let d = a.f;
            let e = a.e;
            let f = 0;
            let g = this.xv.b9.item(0);
            this.xv.cb(g, null);
            let h = this.xv.b8(g);
            if (!Base.equalsStatic(h.target, this.cv)) {
                h.target = this.cv;
            }
            let i = new List$1(String_$type, 0);
            let j = this.xa();
            if (j != null) {
                for (let k of fromEnum(j.db())) {
                    if (k.isStacked) {
                        k.n6((l) => {
                            i.add(l.dataLegendKey);
                            if (l.dw) {
                                l.n4((m) => {
                                    i.add(m.dataLegendKey);
                                    return true;
                                });
                            }
                            return true;
                        });
                    }
                    else if (k.dw) {
                        i.add(k.dataLegendKey);
                        k.n4((l) => {
                            i.add(l.dataLegendKey);
                            return true;
                        });
                    }
                    else {
                        i.add(k.dataLegendKey);
                    }
                }
                h.includedSeries = i.toArray();
            }
            else {
                h.includedSeries = null;
            }
            this.acc(h);
            h.targetCursorPositionX = this.wz.x;
            h.targetCursorPositionY = this.wz.y;
            let l = this.xv.cq(g);
            let m = 0;
            let n = 0;
            let o = 0;
            let p = 0;
            let q = false;
            let r = false;
            o = d.x;
            p = d.y;
            let s = this.cg.bx;
            let t = this.xv.cr();
            let u = this.aeg();
            let v = this.aec(u, l, e, d);
            let w = v.x;
            let x = v.y;
            {
            }
            b.l.add(w);
            b.m.add(x);
            b.f.add(w);
            b.g.add(x);
            b.k.add(l.width);
            b.j.add(l.height);
            b.i.add1(g);
            let y = null;
            b.h.add(y);
            this.xv.b9.count = 1;
        }
        z0(a) {
            return a.toolTip;
        }
        vz(a, b) {
            super.vz(a, b);
            let c = a;
            let d = c.m.count;
            let e = b.bx.left;
            let f = b.bx.right;
            let g = b.bx.top;
            let h = b.bx.bottom;
            for (let i = 0; i < d; i++) {
                if (isNaN_(c.l._inner[i]) || isNaN_(c.m._inner[i]) || isNaN_(c.f._inner[i]) || isNaN_(c.g._inner[i])) {
                    this.xv.ci(c.i._inner[i]);
                    continue;
                }
                let j = c.f._inner[i];
                let k = c.g._inner[i];
                let l = c.k._inner[i];
                let m = c.j._inner[i];
                let n = false;
                if (n) {
                    this.xv.ci(c.i._inner[i]);
                    continue;
                }
                let o = c.i._inner[i];
                let p = Math.min(c.f._inner[i], c.l._inner[i]);
                let q = Math.min(c.g._inner[i], c.m._inner[i]);
                let r = c.l._inner[i] - c.f._inner[i];
                let s = c.m._inner[i] - c.g._inner[i];
                if (o != null) {
                    this.xv.ck(o, p, q, r, s);
                }
            }
        }
        fn() {
            return true;
        }
        get xk() {
            return this.xj;
        }
        set xk(a) {
            let b = this.xj;
            this.xj = a;
            if (b != this.xj) {
                this.raisePropertyChanged("ActualGroupedPositionModeX", enumGetBox(DataTooltipGroupedPositionX_$type, b), enumGetBox(DataTooltipGroupedPositionX_$type, this.xj));
            }
        }
        xm() {
            if (this.cv == null) {
                return 2;
            }
            let a = false;
            let b = false;
            let c = false;
            let d = false;
            let e = this.xa();
            if (e == null) {
                return 2;
            }
            for (let f of fromEnum(e.de)) {
                if (f.ee) {
                    a = true;
                }
                if (f.isVertical) {
                    b = true;
                }
                if (f.e3) {
                    c = true;
                }
                if (f.fa) {
                    d = true;
                }
            }
            let g = ((() => {
                let $ret = new HashSet$1(DataTooltipGroupedPositionX_$type, 0);
                $ret.add_1(1);
                $ret.add_1(2);
                $ret.add_1(3);
                $ret.add_1(4);
                $ret.add_1(5);
                $ret.add_1(6);
                $ret.add_1(7);
                $ret.add_1(8);
                $ret.add_1(9);
                return $ret;
            })());
            let h = g.contains(this.xl);
            if (this.xl != 0) {
                if (h && b) {
                    return 11;
                }
                return this.xl;
            }
            if (c || d) {
                return 11;
            }
            if (b) {
                return 11;
            }
            if (a) {
                return 8;
            }
            return 8;
        }
        get xo() {
            return this.xn;
        }
        set xo(a) {
            let b = this.xn;
            this.xn = a;
            if (b != this.xn) {
                this.raisePropertyChanged("ActualPositionModeY", enumGetBox(DataTooltipGroupedPositionY_$type, b), enumGetBox(DataTooltipGroupedPositionY_$type, this.xn));
            }
        }
        xq() {
            if (this.cv == null) {
                return 11;
            }
            let a = false;
            let b = false;
            let c = false;
            let d = this.xa();
            if (d == null) {
                return 11;
            }
            for (let e of fromEnum(d.db())) {
                if (e.isVertical) {
                    a = true;
                }
                if (e.e3) {
                    b = true;
                }
                if (e.fa) {
                    c = true;
                }
            }
            let f = ((() => {
                let $ret = new HashSet$1(DataTooltipGroupedPositionY_$type, 0);
                $ret.add_1(1);
                $ret.add_1(2);
                $ret.add_1(3);
                $ret.add_1(4);
                $ret.add_1(5);
                $ret.add_1(6);
                $ret.add_1(7);
                $ret.add_1(8);
                $ret.add_1(9);
                return $ret;
            })());
            let g = f.contains(this.xp);
            if (this.xp != 0) {
                if (g && !a) {
                    return 11;
                }
                return this.xp;
            }
            if (b || c) {
                return 11;
            }
            if (a) {
                return 8;
            }
            if (!a) {
                return 11;
            }
            return 11;
        }
        get yf() {
            return this.x6;
        }
        set yf(a) {
            let b = this.x6;
            this.x6 = a;
            if (b != this.x6) {
                this.raisePropertyChanged("ValueTextStyle", b, this.x6);
            }
        }
        get x7() {
            return this.xy;
        }
        set x7(a) {
            let b = this.xy;
            this.xy = a;
            if (b != this.xy) {
                this.raisePropertyChanged("HeaderTextStyle", b, this.xy);
            }
        }
        get ya() {
            return this.x1;
        }
        set ya(a) {
            let b = this.x1;
            this.x1 = a;
            if (b != this.x1) {
                this.raisePropertyChanged("SummaryTitleTextStyle", b, this.x1);
            }
        }
        get yc() {
            return this.x3;
        }
        set yc(a) {
            let b = this.x3;
            this.x3 = a;
            if (b != this.x3) {
                this.raisePropertyChanged("SummaryValueTextStyle", b, this.x3);
            }
        }
        get x9() {
            return this.x0;
        }
        set x9(a) {
            let b = this.x0;
            this.x0 = a;
            if (b != this.x0) {
                this.raisePropertyChanged("SummaryLabelTextStyle", b, this.x0);
            }
        }
        get yb() {
            return this.x2;
        }
        set yb(a) {
            let b = this.x2;
            this.x2 = a;
            if (b != this.x2) {
                this.raisePropertyChanged("SummaryUnitsTextStyle", b, this.x2);
            }
        }
        get ye() {
            return this.x5;
        }
        set ye(a) {
            let b = this.x5;
            this.x5 = a;
            if (b != this.x5) {
                this.raisePropertyChanged("UnitsTextStyle", b, this.x5);
            }
        }
        get yd() {
            return this.x4;
        }
        set yd(a) {
            let b = this.x4;
            this.x4 = a;
            if (b != this.x4) {
                this.raisePropertyChanged("TitleTextStyle", b, this.x4);
            }
        }
        get x8() {
            return this.xz;
        }
        set x8(a) {
            let b = this.xz;
            this.xz = a;
            if (b != this.xz) {
                this.raisePropertyChanged("LabelTextStyle", b, this.xz);
            }
        }
    }
    DataToolTipLayer.$t = /*@__PURE__*/ markType(DataToolTipLayer, 'DataToolTipLayer', AnnotationLayer.$);
    DataToolTipLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, DataToolTipLayer, 'raisePropertyChanged', ['BadgeMargin:aei:acg', [Thickness.$, /*@__PURE__*/ new Thickness(1, 0, 0, 0, 0)], 'BadgeShape:xx:ach', [LegendItemBadgeShape_$type, /*@__PURE__*/ enumGetBox(LegendItemBadgeShape_$type, 0)], 'DefaultPositionOffsetX:yw:aci', [1, /*@__PURE__*/ DeviceUtils.g(10)], 'DefaultPositionOffsetY:yx:acj', [1, /*@__PURE__*/ DeviceUtils.g(10)], 'ExcludedColumns:w2:ack', [Array_$type, null], 'ExcludedSeries:w3:acl', [Array_$type, null], 'GroupedPositionModeX:xl:acm', [DataTooltipGroupedPositionX_$type, /*@__PURE__*/ enumGetBox(DataTooltipGroupedPositionX_$type, 0)], 'GroupedPositionModeY:xp:acn', [DataTooltipGroupedPositionY_$type, /*@__PURE__*/ enumGetBox(DataTooltipGroupedPositionY_$type, 0)], 'GroupingMode:xt:aco', [DataToolTipLayerGroupingMode_$type, /*@__PURE__*/ enumGetBox(DataToolTipLayerGroupingMode_$type, 0)], 'HeaderFormatCulture:aad:acp', [2, /*@__PURE__*/ stringEmpty()], 'HeaderFormatDate:xd:acq', [DataLegendHeaderDateMode_$type, /*@__PURE__*/ enumGetBox(DataLegendHeaderDateMode_$type, 0)], 'HeaderFormatSpecifiers:w6:acr', [Array_$type, null], 'HeaderFormatString:aah:acs', [2, null], 'HeaderFormatTime:xe:act', [DataLegendHeaderTimeMode_$type, /*@__PURE__*/ enumGetBox(DataLegendHeaderTimeMode_$type, 0)], 'HeaderRowMargin:aej:acu', [Thickness.$, /*@__PURE__*/ new Thickness(0, 5)], 'HeaderRowVisible:yh:acv', [0, true], 'HeaderTextColor:ad3:acw', [Brush.$, null], 'HeaderTextMargin:aek:acx', [Thickness.$, /*@__PURE__*/ new Thickness(1, 2, 0, 0, 0)], 'HeaderText:aam:acy', [2, null], 'IncludedColumns:w7:acz', [Array_$type, null], 'IncludedSeries:w8:ac0', [Array_$type, null], 'LabelDisplayMode:xf:ac1', [DataLegendLabelMode_$type, /*@__PURE__*/ enumGetBox(DataLegendLabelMode_$type, 0)], 'LabelTextColor:ad4:ac2', [Brush.$, null], 'LabelTextMargin:ael:ac3', [Thickness.$, /*@__PURE__*/ new Thickness(1, 8, 0, 0, 0)], 'PositionOffsetX:yy:ac4', [1, NaN], 'PositionOffsetY:yz:ac5', [1, NaN], 'ShouldUpdateWhenSeriesDataChanges:yo:ac6', [0, true], 'SummaryLabelTextColor:ad5:ac7', [Brush.$, null], 'SummaryLabelText:aa0:ac8', [2, null], 'SummaryRowMargin:aem:ac9', [Thickness.$, /*@__PURE__*/ new Thickness(0, 5)], 'SummaryTitleTextColor:ad6:ada', [Brush.$, null], 'SummaryTitleTextMargin:aen:adb', [Thickness.$, /*@__PURE__*/ new Thickness(1, 2, 0, 0, 0)], 'SummaryTitleText:aa5:adc', [2, null], 'SummaryType:xg:add', [DataLegendSummaryType_$type, /*@__PURE__*/ enumGetBox(DataLegendSummaryType_$type, 0)], 'SummaryUnitsTextColor:ad7:ade', [Brush.$, null], 'SummaryUnitsText:abb:adf', [2, null], 'SummaryValueTextColor:ad8:adg', [Brush.$, null], 'TargetAxis:xb:adh', [Axis.$, null], 'TitleTextColor:ad9:adi', [Brush.$, null], 'TitleTextMargin:aeo:adj', [Thickness.$, /*@__PURE__*/ new Thickness(1, 0, 0, 0, 0)], 'UnitsDisplayMode:xh:adk', [DataLegendUnitsMode_$type, /*@__PURE__*/ enumGetBox(DataLegendUnitsMode_$type, 0)], 'UnitsTextColor:aea:adl', [Brush.$, null], 'UnitsTextMargin:aep:adm', [Thickness.$, /*@__PURE__*/ new Thickness(1, 0, 0, 0, 0)], 'UnitsText:abm:adn', [2, null], 'UseInterpolation:yp:ado', [0, false], 'ValueFormatAbbreviation:xc:adp', [DataAbbreviationMode_$type, /*@__PURE__*/ enumGetBox(DataAbbreviationMode_$type, 0)], 'ValueFormatCulture:abt:adq', [2, /*@__PURE__*/ stringEmpty()], 'ValueFormatMaxFractions:zy:adr', [1, -1], 'ValueFormatMinFractions:zz:ads', [1, -1], 'ValueFormatMode:xi:adt', [DataLegendValueMode_$type, /*@__PURE__*/ enumGetBox(DataLegendValueMode_$type, 0)], 'ValueFormatSpecifiers:w9:adu', [Array_$type, null], 'ValueFormatString:abz:adv', [2, null], 'ValueFormatUseGrouping:yq:adw', [0, true], 'ValueRowMargin:aeq:adx', [Thickness.$, /*@__PURE__*/ new Thickness(0, 5)], 'ValueRowVisible:yr:ady', [0, true], 'ValueTextColor:aeb:adz', [Brush.$, null], 'ValueTextMargin:aer:ad0', [Thickness.$, /*@__PURE__*/ new Thickness(1, 2, 0, 2, 0)], 'ValueTextUseSeriesColors:ys:ad1', [0, false], 'ValueTextWhenMissingData:ab8:ad2', [2, "N/A"]]);
    return DataToolTipLayer;
})();
/**
 * @hidden
 */
export let DataToolTipLayerView = /*@__PURE__*/ (() => {
    class DataToolTipLayerView extends AnnotationLayerView {
        constructor(a) {
            super(a);
            this.b9 = null;
            this.cc = null;
            this.b7 = null;
            this.ca = false;
            this._htmlTest = null;
            this.b7 = a;
            this.htmlTest = /^[^<]*(<[\w\W]+>)[^>]*$/;
            this.cc = new List$1(PointerTooltip.$, 0);
        }
        ak() {
            super.ak();
            for (let a = 0; a < this.b9.a.count; a++) {
                this.b9.a._inner[a].br();
            }
            for (let b = 0; b < this.b9.b.count; b++) {
                this.b9.b._inner[b].br();
            }
            this.b9.clear();
        }
        cd() {
            let a = new PointerTooltip();
            a.bw(this.e.i5);
            a._visibility = 1;
            a.ap = this.e.cv.cu.k;
            let b = null;
            if (TypeRegistrar.isRegistered("XamDataLegend")) {
                b = TypeRegistrar.create("XamDataLegend");
            }
            b.pixelScalingRatio = 1;
            if (this.e.cv != null) {
                let c = this.e.cv.cu.j.ae.createElement("div");
                let ren_ = this.e.cv.cu.j.ae.getSubRenderer(c);
                let len_ = b;
                len_.provideContainer(ren_);
            }
            a.ai = typeCast(IOnDemandRender_$type, b);
            a.ai.shouldOnDemandRender = true;
            this.cc.add(a);
            return a;
        }
        cf(a) {
            let b = a;
        }
        ch(a) {
            let b = a;
            b._visibility = 1;
        }
        cg(a) {
            let b = a;
            b.bz();
            b.content = null;
            this.cc.remove1(a);
        }
        au() {
            super.au();
            this.b9 = ((() => {
                let $ret = new Pool$1(Base.$);
                $ret.create = runOn(this, this.cd);
                $ret.activate = runOn(this, this.cf);
                $ret.disactivate = runOn(this, this.ch);
                $ret.destroy = runOn(this, this.cg);
                return $ret;
            })());
        }
        get htmlTest() {
            return this._htmlTest;
        }
        set htmlTest(a) {
            this._htmlTest = a;
        }
        cb(a, b) {
            let c = a;
            let d = c.ai;
            return true;
        }
        cq(a) {
            let b = a;
            let c = new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
            b.cy = 1;
            let d = b.cx(new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
            b.cy = 0;
            return d;
        }
        cp() {
            if (this.e.cv != null) {
                let a = this.e.cv.tk();
                let b = this.e.cv.cu.a8;
                let c = this.e.cv.cu.a7;
                return new Rect(0, 0, 0, b, c);
            }
            return Rect.empty;
        }
        co() {
            if (this.e.cv != null) {
                let a = this.e.cv.tk();
                let b = this.e.cv.cu.a8;
                let c = this.e.cv.cu.a7;
                return new Rect(0, 0, 0, b, c);
            }
            return Rect.empty;
        }
        cn() {
            let a = 0;
            let b = 0;
            if (this.e.cv != null) {
                let c = this.e.cv.tk();
                a += c.x;
                b += c.y;
                let d = this.e.cv.cu.a8;
                let e = this.e.cv.cu.a7;
                return new Rect(0, a, b, d, e);
            }
            return Rect.empty;
        }
        cm(a) {
            let b = 0;
            let c = 0;
            if (this.e.cv != null) {
                let d = this.e.cv.tk();
                b += d.x;
                c += d.y;
            }
            return { $type: Point_$type, x: b + a.x, y: c + a.y };
        }
        ck(a, b, c, d, e) {
            let f = null;
            if (this.e.cv != null) {
                f = this.e.cv.cu.j.i();
            }
            let g = a;
            if (g == null) {
                return;
            }
            if (d == 0 && e == 0) {
                g.cy = 1;
            }
            else {
                g.cy = 0;
            }
            g.aq = f;
            g.cs = { $type: Point_$type, x: d, y: e };
            g._visibility = 0;
            g.n = b;
            g.o = c;
        }
        cr() {
            let a = (window.innerWidth);
            let b = (window.innerHeight);
            return new Size(1, a, b);
        }
        ci(a) {
            if (a != null) {
                let b = a;
                b._visibility = 1;
            }
        }
        cl() {
            if (this.e.cv == null) {
                this.cj(true);
            }
        }
        a8(a, b) {
            super.a8(a, b);
            if (b) {
                return;
            }
            let c = 0;
            let d = 0;
            let e = this.e.cv;
            if (e != null) {
                let f = e.cu.j.b8();
                c += f.x;
                d += f.y;
            }
            for (let g = 0; g < this.cc.count; g++) {
                this.cc._inner[g].by(this.cc._inner[g].n + c, this.cc._inner[g].o + d);
            }
        }
        an(a) {
            super.an(a);
            for (let b = 0; b < this.cc.count; b++) {
                let c = this.cc._inner[b];
                let d = 0;
                let e = 0;
                if (this.e.cv != null) {
                    let f = this.e.cv.tk();
                    d += f.x;
                    e += f.y;
                }
                let g = c.a5();
                let h = c.n - d;
                let i = c.o - e;
                let j = c.ai;
                let k = null;
                if (j != null) {
                    k = j.exportVisualData();
                }
                this.e.a5.addPointerTooltipWithDataLegend(a, g, h, i, k);
            }
        }
        b8(a) {
            let b = a;
            return b.ai;
        }
        cj(a) {
            this.as();
            for (let b = 0; b < this.cc.count; b++) {
                this.ci(this.cc._inner[b]);
                if (a) {
                    this.cc._inner[b].bs();
                }
            }
        }
    }
    DataToolTipLayerView.$t = /*@__PURE__*/ markType(DataToolTipLayerView, 'DataToolTipLayerView', AnnotationLayerView.$);
    return DataToolTipLayerView;
})();
