UNPKG

igniteui-webcomponents-charts

Version:

Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.

2,121 lines 71.5 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 { __extends, __values } from "tslib";
import { AnnotationLayer } from "./AnnotationLayer";
import { Axis } from "./Axis";
import { DependencyProperty } from "igniteui-webcomponents-core";
import { DataToolTipLayerGroupingMode_$type } from "igniteui-webcomponents-core";
import { Series } from "./Series";
import { Rect } from "igniteui-webcomponents-core";
import { Base, enumGetBox, EnumUtil, fromEnum, typeCast, String_$type, typeGetValue, Point_$type, Array_$type, markType, markDep, runOn, TypeRegistrar } from "igniteui-webcomponents-core";
import { Size } from "igniteui-webcomponents-core";
import { RectUtil } from "igniteui-webcomponents-core";
import { DataTooltipGroupedPositionX_$type } from "igniteui-webcomponents-core";
import { DataTooltipGroupedPositionY_$type } from "igniteui-webcomponents-core";
import { DataAbbreviationMode_$type } from "igniteui-webcomponents-core";
import { DataLegendValueMode_$type } from "igniteui-webcomponents-core";
import { Thickness } from "igniteui-webcomponents-core";
import { Brush } from "igniteui-webcomponents-core";
import { DataLegendHeaderDateMode_$type } from "igniteui-webcomponents-core";
import { DataLegendHeaderTimeMode_$type } from "igniteui-webcomponents-core";
import { DataLegendSummaryType_$type } from "igniteui-webcomponents-core";
import { LegendItemBadgeShape_$type } from "igniteui-webcomponents-core";
import { DataLegendLayoutMode_$type } from "igniteui-webcomponents-core";
import { DataLegendUnitsMode_$type } from "igniteui-webcomponents-core";
import { DataLegendLabelMode_$type } from "igniteui-webcomponents-core";
import { DataToolTipLayerFrame } from "./DataToolTipLayerFrame";
import { Dictionary$2 } from "igniteui-webcomponents-core";
import { List$1 } from "igniteui-webcomponents-core";
import { Pool$1 } from "igniteui-webcomponents-core";
import { DataToolTipSeriesInfo } from "./DataToolTipSeriesInfo";
import { DataContext } from "igniteui-webcomponents-core";
import { DataTooltipCollisionInfo } from "./DataTooltipCollisionInfo";
import { DeviceUtils } from "igniteui-webcomponents-core";
import { HashSet$1 } from "igniteui-webcomponents-core";
import { PropertyMetadata } from "igniteui-webcomponents-core";
import { isNaN_ } from "igniteui-webcomponents-core";
import { stringEmpty } from "igniteui-webcomponents-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { PointerTooltip } from "./PointerTooltip";
import { IOnDemandRender_$type } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var DataToolTipLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataToolTipLayer, _super);
    function DataToolTipLayer() {
        var _this = _super.call(this) || this;
        _this.aa0 = 1;
        _this.ab5 = new Dictionary$2(String_$type, Base.$, 0);
        _this.ab6 = new List$1(String_$type, 0);
        _this.aas = 8;
        _this.aaw = 11;
        _this.abg = null;
        _this.aa8 = null;
        _this.aa7 = null;
        _this.abb = null;
        _this.abd = null;
        _this.aba = null;
        _this.abc = null;
        _this.abf = null;
        _this.abe = null;
        _this.aa9 = null;
        var a = new DataToolTipLayerFrame();
        var b = new DataToolTipLayerFrame();
        var c = new DataToolTipLayerFrame();
        _this.xh = a;
        _this.xg = b;
        _this.xi = c;
        _this.ab = DataToolTipLayer.$;
        return _this;
    }
    DataToolTipLayer.prototype.bk = function () {
        return new DataToolTipLayer();
    };
    DataToolTipLayer.prototype.get_et = function () {
        return true;
    };
    DataToolTipLayer.prototype.ct = function () {
        return new DataToolTipLayerView(this);
    };
    DataToolTipLayer.prototype.q3 = function (a) {
        _super.prototype.q3.call(this, a);
        this.aa4 = a;
    };
    DataToolTipLayer.prototype.get_e4 = function () {
        return true;
    };
    Object.defineProperty(DataToolTipLayer.prototype, "aa1", {
        get: function () {
            return this.aa0;
        },
        set: function (a) {
            var b = this.aa0;
            this.aa0 = a;
            if (b != this.aa0) {
                this.raisePropertyChanged("ActualGroupingMode", enumGetBox(DataToolTipLayerGroupingMode_$type, b), enumGetBox(DataToolTipLayerGroupingMode_$type, this.aa0));
            }
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.prototype.aa3 = function () {
        var e_1, _a;
        var a = true;
        var b = true;
        var c = true;
        var d = true;
        if (this.aa2 != 0) {
            return this.aa2;
        }
        var e = this.aai();
        if (e != null) {
            try {
                for (var _b = __values(fromEnum(e.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var f = _c.value;
                    if (!f.eu && !f.fx) {
                        a = false;
                    }
                    if (!f.eu && !f.fq) {
                        b = false;
                    }
                    if (!f.eu && !f.fy) {
                        c = false;
                    }
                    if (!f.eu && !f.fu) {
                        d = false;
                    }
                }
            }
            catch (e_1_1) {
                e_1 = { error: e_1_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_1)
                        throw e_1.error;
                }
            }
        }
        if (a || b || c || d) {
            return 2;
        }
        return 1;
    };
    DataToolTipLayer.prototype.rc = function (a, b, c, d) {
        _super.prototype.rc.call(this, a, b, c, d);
        switch (b) {
            case DataToolTipLayer.$$p[42]:
                this.ru(true);
                break;
            case DataToolTipLayer.$$p[49]:
                this.ru(true);
                break;
            case DataToolTipLayer.$$p[12]:
                this.aa1 = this.aa3();
                break;
            case "ActualGroupingMode":
                this.ru(true);
                break;
            case DataToolTipLayer.$$p[10]:
                this.aat = this.aav();
                break;
            case DataToolTipLayer.$$p[11]:
                this.aax = this.aaz();
                break;
            case "SeriesViewer":
                this.aa4.c1();
                break;
            case DataToolTipLayer.$$p[31]:
            case DataToolTipLayer.$$p[24]:
            case DataToolTipLayer.$$p[5]:
            case DataToolTipLayer.$$p[23]:
            case DataToolTipLayer.$$p[4]:
            case DataToolTipLayer.$$p[28]:
            case DataToolTipLayer.$$p[50]:
            case DataToolTipLayer.$$p[52]:
            case DataToolTipLayer.$$p[53]:
            case DataToolTipLayer.$$p[54]:
            case DataToolTipLayer.$$p[51]:
            case DataToolTipLayer.$$p[57]:
            case DataToolTipLayer.$$p[56]:
            case DataToolTipLayer.$$p[55]:
            case DataToolTipLayer.$$p[58]:
            case DataToolTipLayer.$$p[59]:
            case DataToolTipLayer.$$p[63]:
            case DataToolTipLayer.$$p[62]:
            case DataToolTipLayer.$$p[61]:
            case DataToolTipLayer.$$p[60]:
            case "ValueTextStyle":
            case DataToolTipLayer.$$p[16]:
            case DataToolTipLayer.$$p[15]:
            case DataToolTipLayer.$$p[13]:
            case DataToolTipLayer.$$p[14]:
            case DataToolTipLayer.$$p[17]:
            case DataToolTipLayer.$$p[22]:
            case DataToolTipLayer.$$p[20]:
            case DataToolTipLayer.$$p[21]:
            case DataToolTipLayer.$$p[18]:
            case DataToolTipLayer.$$p[19]:
            case "HeaderTextStyle":
            case DataToolTipLayer.$$p[8]:
            case DataToolTipLayer.$$p[9]:
            case DataToolTipLayer.$$p[6]:
            case DataToolTipLayer.$$p[7]:
            case "GroupTextStyle":
            case DataToolTipLayer.$$p[35]:
            case "SummaryTitleTextStyle":
            case DataToolTipLayer.$$p[38]:
            case DataToolTipLayer.$$p[37]:
            case DataToolTipLayer.$$p[36]:
            case DataToolTipLayer.$$p[34]:
            case DataToolTipLayer.$$p[41]:
            case "SummaryValueTextStyle":
            case DataToolTipLayer.$$p[33]:
            case DataToolTipLayer.$$p[32]:
            case "SummaryLabelTextStyle":
            case DataToolTipLayer.$$p[40]:
            case DataToolTipLayer.$$p[39]:
            case "SummaryUnitsTextStyle":
            case DataToolTipLayer.$$p[0]:
            case DataToolTipLayer.$$p[1]:
            case DataToolTipLayer.$$p[45]:
            case DataToolTipLayer.$$p[48]:
            case DataToolTipLayer.$$p[46]:
            case DataToolTipLayer.$$p[47]:
            case "UnitsTextStyle":
            case DataToolTipLayer.$$p[44]:
            case DataToolTipLayer.$$p[43]:
            case "TitleTextStyle":
            case DataToolTipLayer.$$p[25]:
            case DataToolTipLayer.$$p[26]:
            case DataToolTipLayer.$$p[27]:
            case "LabelTextStyle":
                this.aft(b, c, d);
                break;
        }
    };
    DataToolTipLayer.prototype.aft = function (a, b, c) {
        if (!this.ab5.containsKey(a)) {
            this.ab6.add(a);
            this.ab5.addItem(a, c);
        }
        else {
            this.ab5.item(a, c);
        }
        this.ru(true);
    };
    DataToolTipLayer.prototype.afx = function (a, b) {
        switch (a) {
            case DataToolTipLayer.$$p[12]:
                this.aa2 = EnumUtil.getEnumValue(DataToolTipLayerGroupingMode_$type, b);
                break;
            case DataToolTipLayer.$$p[29]:
                this.aca = b;
                break;
            case DataToolTipLayer.$$p[30]:
                this.acb = b;
                break;
            case DataToolTipLayer.$$p[2]:
                this.ab8 = b;
                break;
            case DataToolTipLayer.$$p[3]:
                this.ab9 = b;
                break;
            case DataToolTipLayer.$$p[10]:
                this.aau = EnumUtil.getEnumValue(DataTooltipGroupedPositionX_$type, b);
                break;
            case DataToolTipLayer.$$p[11]:
                this.aay = EnumUtil.getEnumValue(DataTooltipGroupedPositionY_$type, b);
                break;
            case DataToolTipLayer.$$p[31]:
                this.ab0 = b;
                break;
            case DataToolTipLayer.$$p[24]:
                this.aag = b;
                break;
            case DataToolTipLayer.$$p[5]:
                this.aab = b;
                break;
            case DataToolTipLayer.$$p[23]:
                this.aaf = b;
                break;
            case DataToolTipLayer.$$p[4]:
                this.aaa = b;
                break;
            case DataToolTipLayer.$$p[50]:
                this.aak = EnumUtil.getEnumValue(DataAbbreviationMode_$type, b);
                break;
            case DataToolTipLayer.$$p[52]:
                this.ada = typeGetValue(b);
                break;
            case DataToolTipLayer.$$p[53]:
                this.adb = typeGetValue(b);
                break;
            case DataToolTipLayer.$$p[54]:
                this.aar = EnumUtil.getEnumValue(DataLegendValueMode_$type, b);
                break;
            case DataToolTipLayer.$$p[51]:
                this.afb = b;
                break;
            case DataToolTipLayer.$$p[57]:
                this.ab2 = b;
                break;
            case DataToolTipLayer.$$p[56]:
                this.afh = b;
                break;
            case DataToolTipLayer.$$p[55]:
                this.aah = b;
                break;
            case DataToolTipLayer.$$p[58]:
                this.aig = b;
                break;
            case DataToolTipLayer.$$p[59]:
                this.ab3 = b;
                break;
            case DataToolTipLayer.$$p[63]:
                this.afq = b;
                break;
            case DataToolTipLayer.$$p[62]:
                this.ab4 = b;
                break;
            case DataToolTipLayer.$$p[61]:
                this.aih = b;
                break;
            case DataToolTipLayer.$$p[60]:
                this.ahz = b;
                break;
            case "ValueTextStyle":
                this.abq = b;
                break;
            case DataToolTipLayer.$$p[16]:
                this.ady = b;
                break;
            case DataToolTipLayer.$$p[15]:
                this.aae = b;
                break;
            case DataToolTipLayer.$$p[13]:
                this.adu = b;
                break;
            case DataToolTipLayer.$$p[14]:
                this.aal = EnumUtil.getEnumValue(DataLegendHeaderDateMode_$type, b);
                break;
            case DataToolTipLayer.$$p[17]:
                this.aam = EnumUtil.getEnumValue(DataLegendHeaderTimeMode_$type, b);
                break;
            case DataToolTipLayer.$$p[22]:
                this.ad3 = b;
                break;
            case DataToolTipLayer.$$p[20]:
                this.ahr = b;
                break;
            case DataToolTipLayer.$$p[21]:
                this.aia = b;
                break;
            case DataToolTipLayer.$$p[18]:
                this.ah9 = b;
                break;
            case DataToolTipLayer.$$p[19]:
                this.abt = b;
                break;
            case "HeaderTextStyle":
                this.abi = b;
                break;
            case DataToolTipLayer.$$p[28]:
                this.aao = EnumUtil.getEnumValue(DataLegendLayoutMode_$type, b);
                break;
            case DataToolTipLayer.$$p[8]:
                this.ahq = b;
                break;
            case DataToolTipLayer.$$p[9]:
                this.ah8 = b;
                break;
            case DataToolTipLayer.$$p[6]:
                this.ah7 = b;
                break;
            case DataToolTipLayer.$$p[7]:
                this.abs = b;
                break;
            case "GroupTextStyle":
                this.abh = b;
                break;
            case DataToolTipLayer.$$p[35]:
                this.ahu = b;
                break;
            case "SummaryTitleTextStyle":
                this.abl = b;
                break;
            case DataToolTipLayer.$$p[38]:
                this.aap = EnumUtil.getEnumValue(DataLegendSummaryType_$type, b);
                break;
            case DataToolTipLayer.$$p[37]:
                this.aen = b;
                break;
            case DataToolTipLayer.$$p[36]:
                this.aid = b;
                break;
            case DataToolTipLayer.$$p[34]:
                this.aic = b;
                break;
            case DataToolTipLayer.$$p[41]:
                this.ahw = b;
                break;
            case "SummaryValueTextStyle":
                this.abn = b;
                break;
            case DataToolTipLayer.$$p[33]:
                this.aei = b;
                break;
            case DataToolTipLayer.$$p[32]:
                this.aht = b;
                break;
            case "SummaryLabelTextStyle":
                this.abk = b;
                break;
            case DataToolTipLayer.$$p[40]:
                this.aet = b;
                break;
            case DataToolTipLayer.$$p[39]:
                this.ahv = b;
                break;
            case "SummaryUnitsTextStyle":
                this.abm = b;
                break;
            case DataToolTipLayer.$$p[0]:
                this.ah6 = b;
                break;
            case DataToolTipLayer.$$p[1]:
                this.aa6 = EnumUtil.getEnumValue(LegendItemBadgeShape_$type, b);
                break;
            case DataToolTipLayer.$$p[45]:
                this.aaq = EnumUtil.getEnumValue(DataLegendUnitsMode_$type, b);
                break;
            case DataToolTipLayer.$$p[48]:
                this.ae4 = b;
                break;
            case DataToolTipLayer.$$p[46]:
                this.ahy = b;
                break;
            case DataToolTipLayer.$$p[47]:
                this.aif = b;
                break;
            case "UnitsTextStyle":
                this.abp = b;
                break;
            case DataToolTipLayer.$$p[44]:
                this.aie = b;
                break;
            case DataToolTipLayer.$$p[43]:
                this.ahx = b;
                break;
            case "TitleTextStyle":
                this.abo = b;
                break;
            case DataToolTipLayer.$$p[25]:
                this.aan = EnumUtil.getEnumValue(DataLegendLabelMode_$type, b);
                break;
            case DataToolTipLayer.$$p[26]:
                this.ahs = b;
                break;
            case DataToolTipLayer.$$p[27]:
                this.aib = b;
                break;
            case "LabelTextStyle":
                this.abj = b;
                break;
        }
    };
    DataToolTipLayer.prototype.afu = function (a) {
        for (var b = 0; b < this.ab6.count; b++) {
            var c = this.ab6._inner[b];
            a.updatePropertyByName(c, this.ab5.item(c));
        }
    };
    DataToolTipLayer.prototype.yv = function (a, b) {
        {
            if (!this.a1.c) {
                this.ru(b);
            }
        }
    };
    DataToolTipLayer.prototype.yw = function (a, b) {
        if (!this.a1.c) {
            this.ru(b);
        }
    };
    DataToolTipLayer.prototype.yy = function (a, b) {
        var e_2, _a;
        var _this = this;
        _super.prototype.yy.call(this, a, b);
        this.aa0 = this.aa3();
        var c = a;
        var d = this.aa4.cp;
        var e = this.ab1;
        var 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.z7.x) && isNaN_(this.z7.y)) {
            d.count = 0;
            return;
        }
        {
            if (this.aa1 == 2) {
                var g_1 = 0;
                {
                    try {
                        for (var _b = __values(fromEnum(this.dc.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                            var h = _c.value;
                            if (this.xn(h)) {
                                this.afw(h, c, e, f, g_1);
                                g_1++;
                            }
                            if (h.isStacked) {
                                h.p5(function (i) {
                                    if (_this.xn(i)) {
                                        _this.afw(i, c, e, f, g_1);
                                        g_1++;
                                    }
                                    if (i.ei) {
                                        i.p3(function (j) {
                                            if (_this.xn(j)) {
                                                _this.afw(j, c, e, f, g_1);
                                                g_1++;
                                            }
                                            return true;
                                        });
                                    }
                                    return true;
                                });
                            }
                            if (h.ei) {
                                h.p3(function (i) {
                                    if (_this.xn(i)) {
                                        _this.afw(i, c, e, f, g_1);
                                        g_1++;
                                    }
                                    return true;
                                });
                            }
                        }
                    }
                    catch (e_2_1) {
                        e_2 = { error: e_2_1 };
                    }
                    finally {
                        try {
                            if (_c && !_c.done && (_a = _b.return))
                                _a.call(_b);
                        }
                        finally {
                            if (e_2)
                                throw e_2.error;
                        }
                    }
                    this.afs(c);
                }
                d.count = g_1;
            }
            else {
                var i = this.aai();
                var j = this.ab7(i);
                var k = this.aa5(i, j, e);
                this.afv(k, c, e);
            }
        }
    };
    DataToolTipLayer.prototype.ab7 = function (a) {
        var e_3, _a;
        var b = new List$1(Series.$, 0);
        if (a == null) {
            return b;
        }
        try {
            for (var _b = __values(fromEnum(a.df)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                b.add(c);
            }
        }
        catch (e_3_1) {
            e_3 = { error: e_3_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_3)
                    throw e_3.error;
            }
        }
        return b;
    };
    DataToolTipLayer.prototype.aai = function () {
        var e_4, _a, e_5, _b;
        if (this.aaj != null) {
            return this.aaj;
        }
        if (this.dc == null) {
            return null;
        }
        try {
            for (var _c = __values(fromEnum(this.dc.series)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var a = _d.value;
                if (a.e0) {
                    var b = a.a0();
                    if (b != null && b.co()) {
                        return b;
                    }
                }
            }
        }
        catch (e_4_1) {
            e_4 = { error: e_4_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_4)
                    throw e_4.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(this.dc.series)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var c = _f.value;
                if (!c.e0) {
                    var d = c.ai();
                    var e = d != null && d.length > 0 ? d[0] : null;
                    if (e != null && e.co()) {
                        return e;
                    }
                }
            }
        }
        catch (e_5_1) {
            e_5 = { error: e_5_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_5)
                    throw e_5.error;
            }
        }
        return null;
    };
    DataToolTipLayer.prototype.aa5 = function (a, b, c) {
        var d = 1.7976931348623157E+308;
        var e = -1.7976931348623157E+308;
        var f = new List$1(DataContext.$, 0);
        var g = new List$1(Base.$, 0);
        var h = false;
        var i = true;
        var j = { $type: Point_$type, x: NaN, y: NaN };
        var k = 0;
        var l = 0;
        var _loop_1 = function (m) {
            var n = b.item(m);
            k = n.dc.l;
            l = n.dc.m;
            if (n.e0) {
                var o = n;
                var p_1 = new List$1(Series.$, 0);
                if (o.isStacked) {
                    o.p5(function (q) {
                        p_1.add(q);
                        if (q.ei) {
                            q.p3(function (r) {
                                p_1.add(r);
                                return true;
                            });
                        }
                        return true;
                    });
                }
                else if (o.ei) {
                    p_1.add(o);
                    o.p3(function (q) {
                        p_1.add(q);
                        return true;
                    });
                }
                else {
                    p_1.add(o);
                }
                for (var q = 0; q < p_1.count; q++) {
                    var r = p_1._inner[q];
                    var s = p_1._inner[q];
                    if (s.dc == null) {
                        continue;
                    }
                    if (!r.categoryAxis.co()) {
                        continue;
                    }
                    if (i) {
                        h = s.isVertical;
                    }
                    else {
                        if (h != s.isVertical) {
                            continue;
                        }
                    }
                    var t = this_1.yr(s);
                    if (!t.c) {
                        continue;
                    }
                    j = s.wc(t.d);
                    var u = s.wh(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 {
                var v = n.ai();
                for (var w = 0; w < v.length; w++) {
                    if (!v[w].co()) {
                        continue;
                    }
                }
                var x = n.wh(this_1.z7, c, false);
                j = n.wc(this_1.z7);
                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);
                    }
                }
            }
            var y = null;
            var z = n.ko(this_1.z7);
            if (n.e5 && z != null) {
                y = n.a3(z);
            }
            else {
                y = new DataContext();
                y.item = z;
                y.series = n;
            }
            f.add(y);
        };
        var this_1 = this;
        for (var m = 0; m < b.count; m++) {
            _loop_1(m);
        }
        var aa = 0;
        var ab = 0;
        if (h) {
            ab = (d + e) / 2;
            aa = this.wx.right;
            if (!isNaN_(j.x)) {
                aa = j.x;
            }
            if (ab < 0 || ab > this.wx.bottom) {
                ab = NaN;
            }
        }
        else {
            aa = (d + e) / 2;
            if (!isNaN_(j.y)) {
                ab = j.y;
            }
            if (aa < 0 || aa > this.wx.right) {
                aa = NaN;
            }
        }
        var 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;
    };
    DataToolTipLayer.prototype.p9 = function () {
        this.z7 = { $type: Point_$type, x: NaN, y: NaN };
        this.ru(false);
        this.aa4.cz(false);
    };
    DataToolTipLayer.prototype.qa = function () {
        this.z7 = { $type: Point_$type, x: NaN, y: NaN };
        this.ru(false);
        this.aa4.cz(true);
    };
    Object.defineProperty(DataToolTipLayer.prototype, "ah3", {
        get: function () {
            var a = RectUtil.n(this.cw.b9);
            var b = new Size(1, this.cw.b9.width, this.cw.b9.height);
            return new Rect(3, a, b);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ah2", {
        get: function () {
            var a = RectUtil.n(this.cw.b9);
            var b = new Size(1, this.cw.b9.width, this.cw.b9.height);
            return new Rect(3, this.aa4.c2(a), b);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ah1", {
        get: function () {
            var a = new Rect(0, 0, 0, this.dc.m, this.dc.l);
            var b = RectUtil.n(a);
            var c = new Size(1, a.width, a.height);
            return new Rect(3, this.aa4.c2(b), c);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ah5", {
        get: function () {
            var a = { $type: Point_$type, x: 0, y: 0 };
            return new Rect(3, a, this.aa4.c7());
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.prototype.ah4 = function () {
        return this.ah3;
    };
    DataToolTipLayer.prototype.abx = function (a, b, c) {
        if (Rect.l_op_Equality(a, Rect.empty)) {
            return false;
        }
        var d = a.top;
        return c < d;
    };
    DataToolTipLayer.prototype.abu = function (a, b, c, d) {
        if (Rect.l_op_Equality(a, Rect.empty)) {
            return false;
        }
        var e = a.bottom;
        return c + d.height >= e;
    };
    DataToolTipLayer.prototype.abv = function (a, b, c) {
        if (Rect.l_op_Equality(a, Rect.empty)) {
            return false;
        }
        var d = a.left;
        return c < d;
    };
    DataToolTipLayer.prototype.abw = function (a, b, c, d) {
        if (Rect.l_op_Equality(a, Rect.empty)) {
            return false;
        }
        var e = a.right;
        return c + d.width > e;
    };
    DataToolTipLayer.prototype.ac0 = function (a, b) {
        return a.top + b;
    };
    DataToolTipLayer.prototype.acy = function (a, b, c) {
        return a.bottom - c.height - b;
    };
    DataToolTipLayer.prototype.acz = function (a, b) {
        return ((a.bottom + a.top) / 2) - (b.height / 2);
    };
    DataToolTipLayer.prototype.ac9 = function (a, b, c, d, e) {
        var f = c.y - d.height - b;
        return f;
    };
    DataToolTipLayer.prototype.ac7 = function (a, b, c, d, e) {
        var f = c.y + b;
        return f;
    };
    DataToolTipLayer.prototype.ac8 = function (a, b, c, d, e) {
        var f = c.y - (d.height / 2);
        return f;
    };
    DataToolTipLayer.prototype.ac3 = function (a, b, c, d, e) {
        var f = c.y - d.height;
        f = f - b;
        return f;
    };
    DataToolTipLayer.prototype.ac1 = function (a, b, c, d, e) {
        var f = c.y;
        f = f + b;
        return f;
    };
    DataToolTipLayer.prototype.ac2 = function (a, b, c, d, e) {
        var f = c.y - (d.height / 2);
        return f;
    };
    DataToolTipLayer.prototype.acj = function (a, b) {
        return a.left + b;
    };
    DataToolTipLayer.prototype.acl = function (a, b, c) {
        return (a.right - (c.width)) - b;
    };
    DataToolTipLayer.prototype.ack = function (a, b, c) {
        return ((a.right + a.left) / 2) - (c.width / 2) + b;
    };
    DataToolTipLayer.prototype.acs = function (a, b, c, d, e) {
        var f = (c.x - d.width) - b;
        return f;
    };
    DataToolTipLayer.prototype.acu = function (a, b, c, d, e) {
        var f = c.x + b;
        return f;
    };
    DataToolTipLayer.prototype.act = function (a, b, c, d, e) {
        var f = (c.x - (d.width / 2));
        f = f + b;
        return f;
    };
    DataToolTipLayer.prototype.acp = function (a, b, c, d, e) {
        var f = c.x - d.width;
        f = f - b;
        return f;
    };
    DataToolTipLayer.prototype.acr = function (a, b, c, d, e) {
        var f = c.x;
        f = f + b;
        return f;
    };
    DataToolTipLayer.prototype.acq = function (a, b, c, d, e) {
        var f = c.x - (d.width / 2);
        f = f + b;
        return f;
    };
    DataToolTipLayer.prototype.acf = function (a, b, c, d, e, f, g, h) {
        switch (a) {
            case 1:
                {
                    return this.ac3(e, b, h, f, true);
                }
            case 2:
                {
                    return this.ac1(e, b, h, f, true);
                }
            case 3:
                {
                    return this.ac2(e, b, h, f, true);
                }
            case 5: return this.ac4(e, c, b, h, f);
            case 6: return this.ac5(e, c, b, h, f);
            case 4: return this.ac6(e, c, b, h, f);
            case 8: return this.acv(e, c, b, h, f);
            case 9: return this.acw(e, c, b, h, f);
            case 7: return this.acx(e, c, b, h, f);
            case 13: return this.ac0(d, b);
            case 14: return this.acy(d, b, f);
            case 15: return this.acz(d, f);
            case 10: return this.ac9(e, b, g, f, true);
            case 12: return this.ac8(e, b, g, f, true);
            case 11:
            default: return this.ac7(e, b, g, f, true);
        }
    };
    DataToolTipLayer.prototype.acm = function (a, b, c, d, e) {
        var f = d.x;
        f = f + b / 2;
        f = f - e.width;
        f = f - c;
        return f;
    };
    DataToolTipLayer.prototype.acn = function (a, b, c, d, e) {
        var f = d.x;
        f = f + b / 2;
        f = f - e.width / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.aco = function (a, b, c, d, e) {
        var f = d.x;
        f = f + b / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.acg = function (a, b, c, d, e) {
        var f = d.x;
        f = f - b / 2;
        f = f - e.width;
        f = f - c;
        return f;
    };
    DataToolTipLayer.prototype.ach = function (a, b, c, d, e) {
        var f = d.x;
        f = f - b / 2;
        f = f - e.width / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.aci = function (a, b, c, d, e) {
        var f = d.x;
        f = f - b / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.acx = function (a, b, c, d, e) {
        var f = d.y;
        f = f + b / 2;
        f = f - e.height;
        f = f - c;
        return f;
    };
    DataToolTipLayer.prototype.acw = function (a, b, c, d, e) {
        var f = d.y;
        f = f + b / 2;
        f = f - e.height / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.acv = function (a, b, c, d, e) {
        var f = d.y;
        f = f + b / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.ac6 = function (a, b, c, d, e) {
        var f = d.y;
        f = f - b / 2;
        f = f - e.height;
        f = f - c;
        return f;
    };
    DataToolTipLayer.prototype.ac5 = function (a, b, c, d, e) {
        var f = d.y;
        f = f - b / 2;
        f = f - e.height / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.ac4 = function (a, b, c, d, e) {
        var f = d.y;
        f = f - b / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.ace = function (a, b, c, d, e, f, g, h) {
        switch (a) {
            case 10: return this.acs(e, b, g, f, true);
            case 11: return this.acu(e, b, g, f, true);
            case 12: return this.act(e, b, g, f, true);
            case 13: return this.acj(d, b);
            case 14: return this.acl(e, b, f);
            case 15: return this.ack(e, b, f);
            case 5: return this.aci(e, c, b, h, f);
            case 6: return this.ach(e, c, b, h, f);
            case 4: return this.acg(e, c, b, h, f);
            case 8: return this.aco(e, c, b, h, f);
            case 9: return this.acn(e, c, b, h, f);
            case 7: return this.acm(e, c, b, h, f);
            case 1:
                {
                    return this.acp(e, b, h, f, true);
                }
            case 3:
                {
                    return this.acq(e, b, h, f, true);
                }
            case 2:
            default:
                {
                    return this.acr(e, b, h, f, true);
                }
        }
    };
    DataToolTipLayer.prototype.ah0 = function (a, b, c, d) {
        var e = this.aat;
        var f = this.aax;
        var g = this.aai();
        var h = 0;
        if (g != null && g.cb && this.dc != null) {
            h = g.getCategorySize(this.dc.wh, this.wx, this.getEffectiveViewport());
            if (g.categoryMode == 0) {
                h = 0;
            }
        }
        var i = this.acc(e);
        var j = this.acd(f);
        var k = this.ace(e, i, h, this.ah3, a, b, c, d);
        var l = this.acf(f, j, h, this.ah3, a, b, c, d);
        var m = this.aby(a, i, k, b);
        var n = this.abz(a, j, l, b);
        if (!m) {
            var o = this.aac(e);
            var p = 0;
            while (!m && p < o.length) {
                e = o[p];
                i = this.acc(e);
                k = this.ace(e, i, h, this.ah3, a, b, c, d);
                m = this.aby(a, i, k, b);
                p++;
            }
        }
        if (!n) {
            var q = this.aad(f);
            var r = 0;
            while (!n && r < q.length) {
                f = q[r];
                j = this.acd(f);
                l = this.acf(f, j, h, this.ah3, a, b, c, d);
                n = this.abz(a, j, l, b);
                r++;
            }
        }
        return { $type: Point_$type, x: k, y: l };
    };
    DataToolTipLayer.prototype.acd = function (a) {
        if (!isNaN_(this.acb)) {
            return this.acb;
        }
        switch (a) {
            case 1: return this.ab9;
            case 2: return this.ab9;
            case 3: return 0;
            case 4: return this.ab9;
            case 5: return this.ab9;
            case 6: return this.ab9;
            case 7: return this.ab9;
            case 8: return this.ab9;
            case 9: return 0;
            case 10: return this.ab9;
            case 11: return this.ab9;
            case 12: return 0;
            case 13: return this.ab9;
            case 14: return this.ab9;
            case 15: return 0;
        }
        return this.ab9;
    };
    DataToolTipLayer.prototype.acc = function (a) {
        if (!isNaN_(this.aca)) {
            return this.aca;
        }
        switch (a) {
            case 4: return this.ab8;
            case 6: return 0;
            case 5: return this.ab8;
            case 13: return this.ab8;
            case 15: return 0;
            case 14: return this.ab8;
            case 7: return this.ab8;
            case 9: return 0;
            case 8: return this.ab8;
            case 1: return this.ab8;
            case 3: return 0;
            case 2: return this.ab8;
            case 10: return this.ab8;
            case 12: return 0;
            case 11: return this.ab8;
        }
        return this.ab8;
    };
    DataToolTipLayer.prototype.aad = function (a) {
        var b = [a];
        switch (a) {
            case 1:
                b = [2, 3, 13, 14];
                break;
            case 2:
                b = [1, 3, 14, 13];
                break;
            case 3:
                b = [1, 2];
                break;
            case 4:
                b = [8, 7, 3, 13, 14];
                break;
            case 5:
                b = [7, 8, 3, 13, 14];
                break;
            case 6:
                b = [9, 8, 4, 3];
                break;
            case 7:
                b = [5, 4, 2, 14, 13];
                break;
            case 8:
                b = [4, 5, 3, 14, 13];
                break;
            case 9:
                b = [6, 4, 8, 3];
                break;
            case 10:
                b = [11, 12, 2, 1, 3, 13, 14];
                break;
            case 11:
                b = [10, 12, 1, 2, 3, 14, 13];
                break;
            case 12:
                b = [10, 11];
                break;
            case 13: break;
            case 14: break;
            case 15: break;
        }
        return b;
    };
    DataToolTipLayer.prototype.aac = function (a) {
        var b = [a];
        switch (a) {
            case 1:
                b = [2, 3, 13, 14];
                break;
            case 2:
                b = [1, 3, 14, 13];
                break;
            case 3:
                b = [1, 2];
                break;
            case 4:
                b = [8, 7, 3, 13, 14];
                break;
            case 5:
                b = [7, 8, 1, 14, 13];
                break;
            case 6:
                b = [9, 8, 4, 3];
                break;
            case 7:
                b = [5, 4, 2, 14, 13];
                break;
            case 8:
                b = [4, 5, 3, 13, 14];
                break;
            case 9:
                b = [6, 4, 8, 3];
                break;
            case 10:
                b = [11, 12, 2, 1, 3, 13, 14];
                break;
            case 11:
                b = [10, 12, 1, 2, 3, 14, 13];
                break;
            case 12:
                b = [10, 11];
                break;
            case 13: break;
            case 14: break;
            case 15: break;
        }
        return b;
    };
    DataToolTipLayer.prototype.aby = function (a, b, c, d) {
        return !(this.abv(a, b, c) || this.abw(a, b, c, d));
    };
    DataToolTipLayer.prototype.abz = function (a, b, c, d) {
        return !(this.abx(a, b, c) || this.abu(a, b, c, d));
    };
    DataToolTipLayer.prototype.afs = function (a) {
        var b = new List$1(DataTooltipCollisionInfo.$, 0);
        for (var c = 0; c < a.f.count; c++) {
            var 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(function (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;
        });
        var e = this.abr(b);
        if (!e) {
            return;
        }
        for (var f = 0; f < b.count - 1; f++) {
            var g = b._inner[f];
            var h = b._inner[f + 1];
            var i = new Rect(0, g.e.x, g.e.y, g.c, g.a);
            var 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.cw.b9.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.cw.b9.height) };
        }
        for (var k = b.count - 1; k >= 1; k--) {
            var l = b._inner[k];
            var m = b._inner[k - 1];
            var n = new Rect(0, l.e.x, l.e.y, l.c, l.a);
            var 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 (var p = 0; p < b.count; p++) {
            var q = b._inner[p].d;
            var r = b._inner[p];
            a.f._inner[q] = r.e.x;
            a.g._inner[q] = r.e.y;
        }
    };
    DataToolTipLayer.prototype.abr = function (a) {
        if (a.count <= 1) {
            return false;
        }
        var b = this.cw.b9;
        for (var c = 0; c < a.count - 1; c++) {
            var d = a._inner[c];
            var e = a._inner[c + 1];
            var f = new Rect(0, d.e.x, d.e.y, d.c, d.a);
            var g = new Rect(0, e.e.x, e.e.y, e.c, e.a);
            if (f.intersectsWith(g)) {
                return true;
            }
        }
        return false;
    };
    DataToolTipLayer.prototype.afw = function (a, b, c, d, e) {
        var _this = this;
        var f = this.yr(a);
        if (!f.c) {
            return;
        }
        var g = a.wh(f.d, c, d);
        var h = this.aa4.cp;
        var i = this.z7;
        if (!c) {
            i = this.wm(g);
        }
        var j = a.ko(i);
        var k = h.item(e);
        var l = this.cw.b9;
        var m = this.aa4.co(k);
        if (!Base.equalsStatic(m.target, this.dc)) {
            m.target = this.dc;
        }
        var n = new List$1(String_$type, 0);
        if (a.ei && this.aa1 == 2) {
            a.p3(function (o) {
                if (_this.xn(o)) {
                    n.add(o.dataLegendKey);
                }
                return true;
            });
        }
        m.includedSeries = [a.dataLegendKey];
        m.excludedSeries = n.toArray();
        this.afu(m);
        m.targetCursorPositionX = this.z7.x;
        m.targetCursorPositionY = this.z7.y;
        if (!this.aa4.cr(k, a)) {
            return;
        }
        var o = this.aa4.c6(k);
        b.i.add1(k);
        var p = g.x;
        var q = g.x;
        q = Math.max(q, l.left);
        q = Math.min(q, l.right);
        b.l.add(q);
        var r = g.y;
        r = Math.max(r, l.top);
        r = Math.min(r, l.bottom);
        b.m.add(r);
        var s = DeviceUtils.g(10);
        var t = g.x + s;
        if (t + o.width > l.right) {
            t = (l.right - o.width) - s;
        }
        if (t < l.left) {
            t = l.left;
        }
        b.f.add(t);
        var u = (g.y - o.height) - s;
        if (u + o.height > l.bottom) {
            u = (l.bottom - o.height) - s;
        }
        if (u < l.top) {
            u = l.top;
        }
        b.g.add(u);
        b.k.add(o.width);
        b.j.add(o.height);
        var v = this.ve;
        if (v == null) {
            v = this.vk;
        }
        if (v == null) {
            v = a.ve;
        }
        b.h.add(v);
    };
    DataToolTipLayer.prototype.afv = function (a, b, c) {
        var e_6, _a;
        this.aas = this.aav();
        this.aaw = this.aaz();
        var d = a.f;
        var e = a.e;
        var f = 0;
        var g = this.aa4.cp.item(0);
        this.aa4.cr(g, null);
        var h = this.aa4.co(g);
        if (!Base.equalsStatic(h.target, this.dc)) {
            h.target = this.dc;
        }
        var i = new List$1(String_$type, 0);
        var j = this.aai();
        if (j != null) {
            try {
                for (var _b = __values(fromEnum(j.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var k = _c.value;
                    if (k.isStacked) {
                        k.p5(function (l) {
                            i.add(l.dataLegendKey);
                            if (l.ei) {
                                l.p3(function (m) {
                                    i.add(m.dataLegendKey);
                                    return true;
                                });
                            }
                            return true;
                        });
                    }
                    else if (k.ei) {
                        i.add(k.dataLegendKey);
                        k.p3(function (l) {
                            i.add(l.dataLegendKey);
                            return true;
                        });
                    }
                    else {
                        i.add(k.dataLegendKey);
                    }
                }
            }
            catch (e_6_1) {
                e_6 = { error: e_6_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_6)
                        throw e_6.error;
                }
            }
            h.includedSeries = i.toArray();
            h.excludedSeries = null;
        }
        else {
            h.includedSeries = null;
            h.excludedSeries = null;
        }
        this.afu(h);
        h.targetCursorPositionX = this.z7.x;
        h.targetCursorPositionY = this.z7.y;
        var l = this.aa4.c6(g);
        var m = 0;
        var n = 0;
        var o = 0;
        var p = 0;
        var q = false;
        var r = false;
        o = d.x;
        p = d.y;
        var s = this.cw.b9;
        var t = this.aa4.c7();
        var u = this.ah4();
        var v = this.ah0(u, l, e, d);
        var w = v.x;
        var 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);
        var y = null;
        b.h.add(y);
        this.aa4.cp.count = 1;
    };
    DataToolTipLayer.prototype.adc = function (a) {
        return a.toolTip;
    };
    DataToolTipLayer.prototype.y1 = function (a, b) {
        _super.prototype.y1.call(this, a, b);
        var c = a;
        var d = c.m.count;
        var e = b.b9.left;
        var f = b.b9.right;
        var g = b.b9.top;
        var h = b.b9.bottom;
        for (var 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.aa4.cy(c.i._inner[i]);
                continue;
            }
            var j = c.f._inner[i];
            var k = c.g._inner[i];
            var l = c.k._inner[i];
            var m = c.j._inner[i];
            var n = false;
            if (n) {
                this.aa4.cy(c.i._inner[i]);
                continue;
            }
            var o = c.i._inner[i];
            var p = Math.min(c.f._inner[i], c.l._inner[i]);
            var q = Math.min(c.g._inner[i], c.m._inner[i]);
            var r = c.l._inner[i] - c.f._inner[i];
            var s = c.m._inner[i] - c.g._inner[i];
            if (o != null) {
                this.aa4.c0(o, p, q, r, s);
            }
        }
    };
    DataToolTipLayer.prototype.gb = function () {
        return true;
    };
    Object.defineProperty(DataToolTipLayer.prototype, "aat", {
        get: function () {
            return this.aas;
        },
        set: function (a) {
            var b = this.aas;
            this.aas = a;
            if (b != this.aas) {
                this.raisePropertyChanged("ActualGroupedPositionModeX", enumGetBox(DataTooltipGroupedPositionX_$type, b), enumGetBox(DataTooltipGroupedPositionX_$type, this.aas));
            }
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.prototype.aav = function () {
        var e_7, _a;
        if (this.dc == null) {
            return 2;
        }
        var a = false;
        var b = false;
        var c = false;
        var d = false;
        var e = this.aai();
        if (e == null) {
            if (this.aau != 0) {
                return this.aau;
            }
            else {
                return 2;
            }
        }
        try {
            for (var _b = __values(fromEnum(e.df)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var f = _c.value;
                if (f.e1) {
                    a = true;
                }
                if (f.isVertical) {
                    b = true;
                }
                if (f.fq) {
                    c = true;
                }
                if (f.fx) {
                    d = true;
                }
            }
        }
        catch (e_7_1) {
            e_7 = { error: e_7_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_7)
                    throw e_7.error;
            }
        }
        var g = ((function () {
            var $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;
        })());
        var h = g.contains(this.aau);
        if (this.aau != 0) {
            return this.aau;
        }
        if (h && b) {
            return 11;
        }
        if (c || d) {
            return 11;
        }
        if (b) {
            return 11;
        }
        if (a) {
            return 8;
        }
        return 8;
    };
    Object.defineProperty(DataToolTipLayer.prototype, "aax", {
        get: function () {
            return this.aaw;
        },
        set: function (a) {
            var b = this.aaw;
            this.aaw = a;
            if (b != this.aaw) {
                this.raisePropertyChanged("ActualPositionModeY", enumGetBox(DataTooltipGroupedPositionY_$type, b), enumGetBox(DataTooltipGroupedPositionY_$type, this.aaw));
            }
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.prototype.aaz = function () {
        var e_8, _a;
        if (this.dc == null) {
            return 11;
        }
        var a = false;
        var b = false;
        var c = false;
        var d = this.aai();
        if (d == null) {
            if (this.aay != 0) {
                return this.aay;
            }
            else {
                return 11;
            }
        }
        try {
            for (var _b = __values(fromEnum(d.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                if (e.isVertical) {
                    a = true;
                }
                if (e.fq) {
                    b = true;
                }
                if (e.fx) {
                    c = true;
                }
            }
        }
        catch (e_8_1) {
            e_8 = { error: e_8_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_8)
                    throw e_8.error;
            }
        }
        var f = ((function () {
            var $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;
        })());
        var g = f.contains(this.aay);
        if (this.aay != 0) {
            return this.aay;
        }
        if (g && !a) {
            return 11;
        }
        if (b || c) {
            return 11;
        }
        if (a) {
            return 8;
        }
        if (!a) {
            return 11;
        }
        return 11;
    };
    Object.defineProperty(DataToolTipLayer.prototype, "abq", {
        get: function () {
            return this.abg;
        },
        set: function (a) {
            var b = this.abg;
            this.abg = a;
            if (b != this.abg) {
                this.raisePropertyChanged("ValueTextStyle", b, this.abg);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abi", {
        get: function () {
            return this.aa8;
        },
        set: function (a) {
            var b = this.aa8;
            this.aa8 = a;
            if (b != this.aa8) {
                this.raisePropertyChanged("HeaderTextStyle", b, this.aa8);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abh", {
        get: function () {
            return this.aa7;
        },
        set: function (a) {
            var b = this.aa7;
            this.aa7 = a;
            if (b != this.aa7) {
                this.raisePropertyChanged("GroupTextStyle", b, this.aa7);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abl", {
        get: function () {
            return this.abb;
        },
        set: function (a) {
            var b = this.abb;
            this.abb = a;
            if (b != this.abb) {
                this.raisePropertyChanged("SummaryTitleTextStyle", b, this.abb);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abn", {
        get: function () {
            return this.abd;
        },
        set: function (a) {
            var b = this.abd;
            this.abd = a;
            if (b != this.abd) {
                this.raisePropertyChanged("SummaryValueTextStyle", b, this.abd);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abk", {
        get: function () {
            return this.aba;
        },
        set: function (a) {
            var b = this.aba;
            this.aba = a;
            if (b != this.aba) {
                this.raisePropertyChanged("SummaryLabelTextStyle", b, this.aba);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abm", {
        get: function () {
            return this.abc;
        },
        set: function (a) {
            var b = this.abc;
            this.abc = a;
            if (b != this.abc) {
                this.raisePropertyChanged("SummaryUnitsTextStyle", b, this.abc);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abp", {
        get: function () {
            return this.abf;
        },
        set: function (a) {
            var b = this.abf;
            this.abf = a;
            if (b != this.abf) {
                this.raisePropertyChanged("UnitsTextStyle", b, this.abf);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abo", {
        get: function () {
            return this.abe;
        },
        set: function (a) {
            var b = this.abe;
            this.abe = a;
            if (b != this.abe) {
                this.raisePropertyChanged("TitleTextStyle", b, this.abe);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abj", {
        get: function () {
            return this.aa9;
        },
        set: function (a) {
            var b = this.aa9;
            this.aa9 = a;
            if (b != this.aa9) {
                this.raisePropertyChanged("LabelTextStyle", b, this.aa9);
            }
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.$t = markType(DataToolTipLayer, 'DataToolTipLayer', AnnotationLayer.$);
    DataToolTipLayer.$$p = markDep(DependencyProperty, PropertyMetadata, DataToolTipLayer, 'raisePropertyChanged', ['BadgeMargin:ah6:afy', [Thickness.$, new Thickness(1, 0, 0, 0, 0)], 'BadgeShape:aa6:afz', [LegendItemBadgeShape_$type, enumGetBox(LegendItemBadgeShape_$type, 0)], 'DefaultPositionOffsetX:ab8:af0', [1, DeviceUtils.g(10)], 'DefaultPositionOffsetY:ab9:af1', [1, DeviceUtils.g(10)], 'ExcludedColumns:aaa:af2', [Array_$type, null], 'ExcludedSeries:aab:af3', [Array_$type, null], 'GroupRowMargin:ah7:af7', [Thickness.$, new Thickness(0, 5)], 'GroupRowVisible:abs:af8', [0, false], 'GroupTextColor:ahq:af9', [Brush.$, null], 'GroupTextMargin:ah8:aga', [Thickness.$, new Thickness(1, 2, 0, 0, 0)], 'GroupedPositionModeX:aau:af4', [DataTooltipGroupedPositionX_$type, enumGetBox(DataTooltipGroupedPositionX_$type, 0)], 'GroupedPositionModeY:aay:af5', [DataTooltipGroupedPositionY_$type, enumGetBox(DataTooltipGroupedPositionY_$type, 0)], 'GroupingMode:aa2:af6', [DataToolTipLayerGroupingMode_$type, enumGetBox(DataToolTipLayerGroupingMode_$type, 0)], 'HeaderFormatCulture:adu:agb', [2, stringEmpty()], 'HeaderFormatDate:aal:agc', [DataLegendHeaderDateMode_$type, enumGetBox(DataLegendHeaderDateMode_$type, 0)], 'HeaderFormatSpecifiers:aae:agd', [Array_$type, null], 'HeaderFormatString:ady:age', [2, null], 'HeaderFormatTime:aam:agf', [DataLegendHeaderTimeMode_$type, enumGetBox(DataLegendHeaderTimeMode_$type, 0)], 'HeaderRowMargin:ah9:agg', [Thickness.$, new Thickness(0, 5)], 'HeaderRowVisible:abt:agh', [0, true], 'HeaderTextColor:ahr:agi', [Brush.$, null], 'HeaderTextMargin:aia:agj', [Thickness.$, new Thickness(1, 2, 0, 0, 0)], 'HeaderText:ad3:agk', [2, null], 'IncludedColumns:aaf:agl', [Array_$type, null], 'IncludedSeries:aag:agm', [Array_$type, null], 'LabelDisplayMode:aan:agn', [DataLegendLabelMode_$type, enumGetBox(DataLegendLabelMode_$type, 0)], 'LabelTextColor:ahs:ago', [Brush.$, null], 'LabelTextMargin:aib:agp', [Thickness.$, new Thickness(1, 8, 0, 0, 0)], 'LayoutMode:aao:agq', [DataLegendLayoutMode_$type, enumGetBox(DataLegendLayoutMode_$type, 0)], 'PositionOffsetX:aca:agr', [1, NaN], 'PositionOffsetY:acb:ags', [1, NaN], 'ShouldUpdateWhenSeriesDataChanges:ab0:agt', [0, true], 'SummaryLabelTextColor:aht:agu', [Brush.$, null], 'SummaryLabelText:aei:agv', [2, null], 'SummaryRowMargin:aic:agw', [Thickness.$, new Thickness(0, 5)], 'SummaryTitleTextColor:ahu:agx', [Brush.$, null], 'SummaryTitleTextMargin:aid:agy', [Thickness.$, new Thickness(1, 2, 0, 0, 0)], 'SummaryTitleText:aen:agz', [2, null], 'SummaryType:aap:ag0', [DataLegendSummaryType_$type, enumGetBox(DataLegendSummaryType_$type, 0)], 'SummaryUnitsTextColor:ahv:ag1', [Brush.$, null], 'SummaryUnitsText:aet:ag2', [2, null], 'SummaryValueTextColor:ahw:ag3', [Brush.$, null], 'TargetAxis:aaj:ag4', [Axis.$, null], 'TitleTextColor:ahx:ag5', [Brush.$, null], 'TitleTextMargin:aie:ag6', [Thickness.$, new Thickness(1, 0, 0, 0, 0)], 'UnitsDisplayMode:aaq:ag7', [DataLegendUnitsMode_$type, enumGetBox(DataLegendUnitsMode_$type, 0)], 'UnitsTextColor:ahy:ag8', [Brush.$, null], 'UnitsTextMargin:aif:ag9', [Thickness.$, new Thickness(1, 0, 0, 0, 0)], 'UnitsText:ae4:aha', [2, null], 'UseInterpolation:ab1:ahb', [0, false], 'ValueFormatAbbreviation:aak:ahc', [DataAbbreviationMode_$type, enumGetBox(DataAbbreviationMode_$type, 0)], 'ValueFormatCulture:afb:ahd', [2, stringEmpty()], 'ValueFormatMaxFractions:ada:ahe', [1, -1], 'ValueFormatMinFractions:adb:ahf', [1, -1], 'ValueFormatMode:aar:ahg', [DataLegendValueMode_$type, enumGetBox(DataLegendValueMode_$type, 0)], 'ValueFormatSpecifiers:aah:ahh', [Array_$type, null], 'ValueFormatString:afh:ahi', [2, null], 'ValueFormatUseGrouping:ab2:ahj', [0, true], 'ValueRowMargin:aig:ahk', [Thickness.$, new Thickness(0, 5)], 'ValueRowVisible:ab3:ahl', [0, true], 'ValueTextColor:ahz:ahm', [Brush.$, null], 'ValueTextMargin:aih:ahn', [Thickness.$, new Thickness(1, 2, 0, 2, 0)], 'ValueTextUseSeriesColors:ab4:aho', [0, false], 'ValueTextWhenMissingData:afq:ahp', [2, "N/A"]]);
    return DataToolTipLayer;
}(AnnotationLayer));
export { DataToolTipLayer };
/**
 * @hidden
 */
var DataToolTipLayerView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataToolTipLayerView, _super);
    function DataToolTipLayerView(a) {
        var _this = _super.call(this, a) || this;
        _this.cp = null;
        _this.cs = null;
        _this.cn = null;
        _this.cq = false;
        _this._htmlTest = null;
        _this.cn = a;
        _this.htmlTest = /^[^<]*(<[\w\W]+>)[^>]*$/;
        _this.cs = new List$1(PointerTooltip.$, 0);
        return _this;
    }
    DataToolTipLayerView.prototype.as = function () {
        _super.prototype.as.call(this);
        for (var a = 0; a < this.cp.a.count; a++) {
            this.cp.a._inner[a].br();
        }
        for (var b = 0; b < this.cp.b.count; b++) {
            this.cp.b._inner[b].br();
        }
        this.cp.clear();
    };
    DataToolTipLayerView.prototype.ct = function () {
        var a = new PointerTooltip();
        a.bw(this.f.j0);
        a._visibility = 1;
        a.ap = this.f.dc.c9.k;
        var b = null;
        if (TypeRegistrar.isRegistered("XamDataLegend")) {
            b = TypeRegistrar.create("XamDataLegend");
        }
        b.pixelScalingRatio = 1;
        b.isEmbeddedInDataTooltip = true;
        if (this.f.dc != null) {
            var c = this.f.dc.c9.j.ae.createElement("div");
            var ren_ = this.f.dc.c9.j.ae.getSubRenderer(c);
            var len_ = b;
            len_.provideContainer(ren_);
        }
        a.ai = typeCast(IOnDemandRender_$type, b);
        a.ai.shouldOnDemandRender = true;
        this.cs.add(a);
        return a;
    };
    DataToolTipLayerView.prototype.cv = function (a) {
        var b = a;
    };
    DataToolTipLayerView.prototype.cx = function (a) {
        var b = a;
        b._visibility = 1;
    };
    DataToolTipLayerView.prototype.cw = function (a) {
        var b = a;
        b.bz();
        b.content = null;
        this.cs.remove1(a);
    };
    DataToolTipLayerView.prototype.a4 = function () {
        var _this = this;
        _super.prototype.a4.call(this);
        this.cp = ((function () {
            var $ret = new Pool$1(Base.$);
            $ret.create = runOn(_this, _this.ct);
            $ret.activate = runOn(_this, _this.cv);
            $ret.disactivate = runOn(_this, _this.cx);
            $ret.destroy = runOn(_this, _this.cw);
            return $ret;
        })());
    };
    Object.defineProperty(DataToolTipLayerView.prototype, "htmlTest", {
        get: function () {
            return this._htmlTest;
        },
        set: function (a) {
            this._htmlTest = a;
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayerView.prototype.cr = function (a, b) {
        var c = a;
        var d = c.ai;
        return true;
    };
    DataToolTipLayerView.prototype.c6 = function (a) {
        var b = a;
        var c = new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
        b.cy = 1;
        var d = b.cx(new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
        b.cy = 0;
        return d;
    };
    DataToolTipLayerView.prototype.c5 = function () {
        if (this.f.dc != null) {
            var a = this.f.dc.wa();
            var b = this.f.dc.c9.a8;
            var c = this.f.dc.c9.a7;
            return new Rect(0, 0, 0, b, c);
        }
        return Rect.empty;
    };
    DataToolTipLayerView.prototype.c4 = function () {
        if (this.f.dc != null) {
            var a = this.f.dc.wa();
            var b = this.f.dc.c9.a8;
            var c = this.f.dc.c9.a7;
            return new Rect(0, 0, 0, b, c);
        }
        return Rect.empty;
    };
    DataToolTipLayerView.prototype.c3 = function () {
        var a = 0;
        var b = 0;
        if (this.f.dc != null) {
            var c = this.f.dc.wa();
            a += c.x;
            b += c.y;
            var d = this.f.dc.c9.a8;
            var e = this.f.dc.c9.a7;
            return new Rect(0, a, b, d, e);
        }
        return Rect.empty;
    };
    DataToolTipLayerView.prototype.c2 = function (a) {
        var b = 0;
        var c = 0;
        if (this.f.dc != null) {
            var d = this.f.dc.wa();
            b += d.x;
            c += d.y;
        }
        return { $type: Point_$type, x: b + a.x, y: c + a.y };
    };
    DataToolTipLayerView.prototype.c0 = function (a, b, c, d, e) {
        var f = null;
        if (this.f.dc != null) {
            f = this.f.dc.c9.j.i();
        }
        var 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;
    };
    DataToolTipLayerView.prototype.c7 = function () {
        var a = (window.innerWidth);
        var b = (window.innerHeight);
        return new Size(1, a, b);
    };
    DataToolTipLayerView.prototype.cy = function (a) {
        if (a != null) {
            var b = a;
            b._visibility = 1;
        }
    };
    DataToolTipLayerView.prototype.c1 = function () {
        if (this.f.dc == null) {
            this.cz(true);
        }
    };
    DataToolTipLayerView.prototype.bj = function (a, b) {
        _super.prototype.bj.call(this, a, b);
        if (b) {
            return;
        }
        var c = 0;
        var d = 0;
        var e = this.f.dc;
        if (e != null) {
            var f = e.c9.j.b8();
            c += f.x;
            d += f.y;
        }
        for (var g = 0; g < this.cs.count; g++) {
            this.cs._inner[g].by(this.cs._inner[g].n + c, this.cs._inner[g].o + d);
        }
    };
    DataToolTipLayerView.prototype.ax = function (a) {
        _super.prototype.ax.call(this, a);
        for (var b = 0; b < this.cs.count; b++) {
            var c = this.cs._inner[b];
            var d = 0;
            var e = 0;
            if (this.f.dc != null) {
                var f = this.f.dc.wa();
                d += f.x;
                e += f.y;
            }
            var g = c.a5();
            var h = c.n - d;
            var i = c.o - e;
            var j = c.ai;
            var k = null;
            if (j != null) {
                k = j.exportVisualData();
            }
            this.f.bc.addPointerTooltipWithDataLegend(a, g, h, i, k);
        }
    };
    DataToolTipLayerView.prototype.co = function (a) {
        var b = a;
        var c = b.ai;
        return c;
    };
    DataToolTipLayerView.prototype.cz = function (a) {
        this.a2();
        for (var b = 0; b < this.cs.count; b++) {
            this.cy(this.cs._inner[b]);
            if (a) {
                this.cs._inner[b].bs();
            }
        }
    };
    DataToolTipLayerView.$t = markType(DataToolTipLayerView, 'DataToolTipLayerView', AnnotationLayerView.$);
    return DataToolTipLayerView;
}(AnnotationLayerView));
export { DataToolTipLayerView };