/*
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 * as tslib_1 from "tslib";
import { MarkerSeries } from "./MarkerSeries";
import { ISupportsErrorBars_$type } from "./ISupportsErrorBars";
import { ITrendLineSeries_$type } from "./ITrendLineSeries";
import { ScatterAxisInfoCache } from "./ScatterAxisInfoCache";
import { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { Series } from "./Series";
import { TrendLineType_$type } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { DoubleCollection } from "igniteui-react-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { ScatterErrorBarSettings } from "./ScatterErrorBarSettings";
import { HighlightingInfo } from "./HighlightingInfo";
import { ScatterFrame } from "./ScatterFrame";
import { Base, enumGetBox, Number_$type, typeCast, fromEnum, Point_$type, runOn, markType, markDep, PointUtil } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { Clipper } from "igniteui-react-core";
import { OwnedPoint } from "./OwnedPoint";
import { Dictionary$2 } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { GeometryUtil } from "igniteui-react-core";
import { HashPool$2 } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { ScatterTrendLineManager } from "./ScatterTrendLineManager";
import { Thickness } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { AssigningScatterStyleEventArgs } from "./AssigningScatterStyleEventArgs";
import { AssigningScatterMarkerStyleEventArgs } from "./AssigningScatterMarkerStyleEventArgs";
import { SeriesRenderManager } from "./SeriesRenderManager";
import { ErrorBarsHelper } from "./ErrorBarsHelper";
import { PathGeometry } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, isInfinity } from "igniteui-react-core";
import { boxArray$1, arrayShallowClone } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { DataTemplateMeasureInfo } from "igniteui-react-core";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
 * @hidden
 */
var ScatterBase = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(ScatterBase, _super);
    function ScatterBase() {
        var _this = _super.call(this) || this;
        _this.p3 = null;
        _this.qg = null;
        _this.qh = null;
        _this.st = null;
        _this.su = null;
        _this.qb = 1;
        _this.po = null;
        _this.pp = null;
        _this.p8 = null;
        _this.qa = null;
        _this.p7 = null;
        _this.ql = false;
        _this.qk = false;
        _this.pz = null;
        _this.p0 = null;
        _this.assigningScatterStyle = null;
        _this.assigningScatterMarkerStyle = null;
        _this.qf = null;
        _this.p9 = null;
        _this.p6 = null;
        _this.qc = _this.qd();
        _this.qf = new ScatterSeriesRenderManager();
        _this.p9 = new ScatterFrame();
        _this.su = Rect.empty;
        _this.st = Rect.empty;
        return _this;
    }
    ScatterBase.prototype.bp = function () {
        return new ScatterBaseView(this);
    };
    ScatterBase.prototype.ji = function () {
        _super.prototype.ji.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    ScatterBase.prototype.kk = function (a) {
        _super.prototype.kk.call(this, a);
        this.p4 = a;
    };
    ScatterBase.prototype.get_dj = function () {
        return true;
    };
    ScatterBase.prototype.ag = function () {
        return [this.xAxis, this.yAxis];
    };
    ScatterBase.prototype.gt = function (a, b) {
        var c = this.ic(b);
        if (c == ScatterBase.$$p[8]) {
            return this.gu(a, b, this.rf);
        }
        if (c == ScatterBase.$$p[10]) {
            return this.gu(a, b, this.rj);
        }
        return null;
    };
    ScatterBase.prototype.ct = function (a, b, c) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var d = this.xAxis;
        var e = new ScalerParams(1, this.b6.os, this.n6, d.ca);
        e.c = this.getEffectiveViewport1(this.bs);
        var f = this.yAxis;
        var g = new ScalerParams(1, this.b6.os, this.n6, f.ca);
        g.c = this.getEffectiveViewport1(this.bs);
        a.clear();
        this.oh.cf(function (h) {
            if (h._visibility == 0) {
                var i = new SeriesPointOfInterest();
                var j = h.n;
                var k = h.o;
                if (j < _this.n6.left || j > _this.n6.right || k < _this.n6.top || k > _this.n6.bottom) {
                    return;
                }
                i.b = d.d2(j, e);
                i.c = f.d2(k, g);
                i.a = h.content;
                a.add(i);
            }
        });
        return true;
    };
    ScatterBase.prototype.bj = function () {
        if (this.bk == 0) {
            if (this.q3 <= 2000) {
                return 1;
            }
            else {
                return _super.prototype.bj.call(this);
            }
        }
        else {
            return _super.prototype.bj.call(this);
        }
    };
    ScatterBase.prototype.n4 = function (a) {
        if (!this.hasMarkers || !this.ok()) {
            return Rect.empty;
        }
        var b = this.oh.by(this.no(a));
        if (b != null) {
            return this.oh.cp(b);
        }
        return Rect.empty;
    };
    ScatterBase.prototype.dy = function (a, b) {
        if (this.ol(a, b)) {
            return true;
        }
        return false;
    };
    Object.defineProperty(ScatterBase.prototype, "qi", {
        get: function () {
            return this.qg;
        },
        set: function (a) {
            if (this.qg != a) {
                var b = this.qi;
                this.qg = a;
                this.raisePropertyChanged("XColumn", b, this.qi);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ScatterBase.prototype, "qj", {
        get: function () {
            return this.qh;
        },
        set: function (a) {
            if (this.qh != a) {
                var b = this.qj;
                this.qh = a;
                this.raisePropertyChanged("YColumn", b, this.qj);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ScatterBase.prototype, "sq", {
        get: function () {
            return this.c(ScatterBase.r7);
        },
        set: function (a) {
            this.h(ScatterBase.r7, a);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ScatterBase.prototype, "GetErrorBarsXAxis", {
        get: function () {
            return this.xAxis;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ScatterBase.prototype, "GetErrorBarsYAxis", {
        get: function () {
            return this.yAxis;
        },
        enumerable: true,
        configurable: true
    });
    ScatterBase.prototype.j2 = function () {
        _super.prototype.j2.call(this);
        if (this.xAxis != null) {
            this.xAxis.hc(false);
        }
        if (this.yAxis != null) {
            this.yAxis.hc(false);
        }
    };
    ScatterBase.prototype.kp = function (a, b, c, d) {
        _super.prototype.kp.call(this, a, b, c, d);
        if (this.p4.cx.g$b(a, b, c, d)) {
            this.k3(false);
            this.ka();
        }
        switch (b) {
            case "FastItemsSource":
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    c.deregisterColumn(this.qi);
                    c.deregisterColumn(this.qj);
                    this.qi = null;
                    this.qj = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    this.qi = this.ca(this.rf);
                    this.qj = this.ca(this.rj);
                }
                if ((this.yAxis != null && !this.yAxis.cn()) || (this.xAxis != null && !this.xAxis.cn())) {
                    this.k3(false);
                }
                break;
            case ScatterBase.$$p[7]:
                if (c != null) {
                    c.bx(this);
                }
                if (d != null) {
                    d.ck(this);
                }
                if ((this.xAxis != null && !this.xAxis.cn()) || (d == null && c != null)) {
                    this.k3(false);
                }
                this.ka();
                break;
            case ScatterBase.$$p[9]:
                if (c != null) {
                    c.bx(this);
                }
                if (d != null) {
                    d.ck(this);
                }
                if ((this.yAxis != null && !this.yAxis.cn()) || (d == null && c != null)) {
                    this.k3(false);
                }
                this.ka();
                break;
            case ScatterBase.$$p[8]:
                if (this.cd != null) {
                    this.cd.deregisterColumn(this.qi);
                    this.qi = this.ca(this.rf);
                }
                break;
            case "XColumn":
                this.p4.cx.g$i();
                if (this.xAxis != null && !this.xAxis.cn()) {
                    this.k3(false);
                }
                break;
            case ScatterBase.$$p[10]:
                if (this.cd != null) {
                    this.cd.deregisterColumn(this.qj);
                    this.qj = this.ca(this.rj);
                }
                break;
            case "YColumn":
                this.p4.cx.g$i();
                if (this.yAxis != null && !this.yAxis.cn()) {
                    this.k3(false);
                }
                break;
            case ScatterBase.$$p[5]:
                this.k3(false);
                this.ka();
                break;
            case ScatterBase.$$p[6]:
                this.k3(false);
                this.ka();
                break;
            case "TransitionProgress":
                this.qa.c(this.fw, this.p8, this.p7);
                this.rl();
                try {
                    if (this.cp(this.bs)) {
                        return;
                    }
                    if ((Math.round(this.fw * 100000) / 100000) == 1) {
                        this.r5(this.p7, this.p4);
                    }
                    else {
                        this.r5(this.qa, this.p4);
                    }
                    if (this.b6 != null) {
                        this.b6.k7(this);
                    }
                }
                finally {
                    this.r6();
                }
                break;
            case "TrendLineBrush":
                this.lg();
                break;
            case ScatterBase.$$p[0]:
                if (this.p5 != null) {
                    this.p5.r = this;
                }
                this.k3(false);
                this.ka();
                break;
            case "TrendLineType":
                this.ka();
                break;
            case ScatterBase.$$p[2]:
                this.ql = this.qt();
                this.k3(false);
                break;
            case ScatterBase.$$p[1]:
                this.qk = this.qs();
                this.k3(false);
                break;
            case ScatterBase.$$p[3]:
                this.qc = this.qd();
                break;
        }
    };
    ScatterBase.prototype.qt = function () {
        return this.qp;
    };
    ScatterBase.prototype.qs = function () {
        return this.qo;
    };
    ScatterBase.prototype.qn = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    ScatterBase.prototype.qm = function (a) {
        if (typeCast(NumericXAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    ScatterBase.prototype.r6 = function () {
        this.st = Rect.empty;
        this.su = Rect.empty;
    };
    ScatterBase.prototype.rl = function () {
        var a = this.getViewInfo(this.st, this.su);
        this.st = a.p0;
        this.su = a.p1;
    };
    ScatterBase.prototype.qr = function (a, b) {
        if (b != 3) {
            return true;
        }
        if (a == null) {
            return true;
        }
        if (this.rf == a || this.rj == a) {
            return true;
        }
        return false;
    };
    ScatterBase.prototype.jo = function (a, b, c, d) {
        var e = false;
        if (!this.qr(d, a)) {
            return;
        }
        this.p4.cx.g$e(a, b, c, d);
        if (this.xAxis != null && !this.xAxis.cn()) {
            e = true;
        }
        if (this.yAxis != null && !this.yAxis.cn()) {
            e = true;
        }
        if (e) {
            this.k3(true);
        }
    };
    ScatterBase.prototype.rx = function (a) {
        this.ry(a, null);
    };
    ScatterBase.prototype.ry = function (a, b) {
        var e_1, _a, e_2, _b;
        var c = this.qi != null ? this.qi.count : 0;
        var d = this.qj != null ? this.qj.count : 0;
        var e = Math.min(c, d);
        if (e <= this.q3) {
            a.m.clear();
            var f = new List$1(OwnedPoint.$, 0);
            try {
                for (var _c = tslib_1.__values(fromEnum(a.u.values)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var g = _d.value;
                    f.add(g);
                }
            }
            catch (e_1_1) {
                e_1 = { error: e_1_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_1)
                        throw e_1.error;
                }
            }
            var h_1 = this.cd;
            f.aa(function (i, j) {
                var k = h_1.indexOf(i.a);
                var l = h_1.indexOf(j.a);
                if (k < l) {
                    return -1;
                }
                if (k > l) {
                    return 1;
                }
                return 0;
            });
            if (b != null) {
                b.i = a.m;
            }
            try {
                for (var _e = tslib_1.__values(fromEnum(f)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var i = _f.value;
                    if (h_1.indexOf(i.a) >= 0) {
                        if (b != null) {
                            b.j(i.c);
                        }
                        else {
                            a.m.add({ $type: Point_$type, x: i.c.x, y: i.c.y });
                        }
                    }
                }
            }
            catch (e_2_1) {
                e_2 = { error: e_2_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_2)
                        throw e_2.error;
                }
            }
        }
    };
    ScatterBase.prototype.ao = function (a) {
        if (a != null && a == this.xAxis && this.qi != null) {
            return new AxisRange(this.qi.minimum, this.qi.maximum);
        }
        if (a != null && a == this.yAxis && this.qj != null) {
            return new AxisRange(this.qj.minimum, this.qj.maximum);
        }
        return null;
    };
    ScatterBase.prototype.gq = function (a) {
        var b = this.f9(a);
        if (this.cd != null && b >= 0 && b < this.cd.count) {
            return this.cd.item(b);
        }
        return null;
    };
    Object.defineProperty(ScatterBase.prototype, "qc", {
        get: function () {
            return this.qb;
        },
        set: function (a) {
            var b = this.qb;
            this.qb = a;
            if (b != this.qb) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.qb));
            }
        },
        enumerable: true,
        configurable: true
    });
    ScatterBase.prototype.qd = function () {
        if (this.qe != 0) {
            return this.qe;
        }
        return this.qq ? 4 : 1;
    };
    ScatterBase.prototype.f9 = function (a) {
        var b = truncate(Math.round(this.e4(a)));
        return b;
    };
    ScatterBase.prototype.e4 = function (a) {
        switch (this.qc) {
            case 1: return this.qz(a);
            case 3: return this.q0(a);
            case 2: return this.qx(a);
            case 4: return this.qy(a);
        }
        return -1;
    };
    ScatterBase.prototype.qy = function (a) {
        return this.q1(a, false);
    };
    ScatterBase.prototype.qx = function (a) {
        var b = this.no(a);
        var c = b.x;
        var d = b.y;
        if (this.cd == null || this.xAxis == null || this.yAxis == null || this.qi == null || this.qj == null) {
            return -1;
        }
        if (this.cd.count > this.q2) {
            return -1;
        }
        this.ro();
        var e = this.po;
        var f = this.pp;
        if (e == null || f == null) {
            return -1;
        }
        var g = 1.7976931348623157E+308;
        var h = -1;
        for (var i = 0; i < this.qi.count; i++) {
            var j = e[i];
            var k = f[i];
            var l = (c - j) * (c - j) + (d - k) * (d - k);
            if (l < g) {
                g = l;
                h = i;
            }
        }
        return h;
    };
    ScatterBase.prototype.ro = function () {
        var _this = this;
        var a = this.bs.bv;
        var b = this.bs.bu;
        var c = this.getEffectiveViewport();
        if (this.p3 == null) {
            return;
        }
        var d = new ScalerParams(0, a, b, this.p3.d, c);
        var e = ((function () {
            var $ret = new ScalerParams(0, a, b, _this.p3.e, c);
            $ret.b = _this.fa();
            return $ret;
        })());
        if (this.po == null || this.pp == null) {
            var f = arrayShallowClone(this.qi.asArray());
            var g = arrayShallowClone(this.qj.asArray());
            this.xAxis.gt(boxArray$1(f), 0, f.length, d);
            this.yAxis.gt(boxArray$1(g), 0, g.length, e);
            this.po = f;
            this.pp = g;
        }
    };
    ScatterBase.prototype.get_qq = function () {
        return false;
    };
    Object.defineProperty(ScatterBase.prototype, "qq", {
        get: function () {
            return this.get_qq();
        },
        enumerable: true,
        configurable: true
    });
    ScatterBase.prototype.q1 = function (a, b) {
        if (!this.qq) {
            return -1;
        }
        var c = { $type: Point_$type, x: 0, y: 0 };
        var d = true;
        var e = this.p7;
        if (this.cn()) {
            e = this.qa;
        }
        if (e == null) {
            return -1;
        }
        if (e.m == null) {
            return -1;
        }
        if (this.cd == null || this.cd.count > this.q2) {
            return -1;
        }
        this.ro();
        var f = this.po;
        var g = this.pp;
        if (f == null || g == null) {
            return -1;
        }
        var h = this.no(a);
        var i = 1.7976931348623157E+308;
        var j = -1;
        for (var k = 0; k < this.po.length; k++) {
            var l = { $type: Point_$type, x: this.po[k], y: this.pp[k] };
            if (k > 0) {
                if (!b || e.j.containsKey(this.cd.item(k)) || e.j.containsKey(this.cd.item(k - 1))) {
                    var m = GeometryUtil.d(h, c, l);
                    if (m < i) {
                        i = m;
                        j = k;
                    }
                }
            }
            c = l;
        }
        if (j >= 0) {
            var n = { $type: Point_$type, x: this.po[j], y: this.pp[j] };
            var o = { $type: Point_$type, x: this.po[j - 1], y: this.pp[j - 1] };
            if (!b || (e.j.containsKey(this.cd.item(j)) && e.j.containsKey(this.cd.item(j - 1)))) {
                var p = GeometryUtil.h(h, o, n);
                return (j - 1) + p;
            }
            else if (e.j.containsKey(this.cd.item(j))) {
                return j;
            }
            else {
                return j - 1;
            }
        }
        return -1;
    };
    ScatterBase.prototype.q0 = function (a) {
        return this.q1(a, true);
    };
    ScatterBase.prototype.qz = function (a) {
        var _this = this;
        var b = null;
        var c = 1.7976931348623157E+308;
        var d = this.no(a);
        var e = d.x;
        var f = d.y;
        if (this.p4.cy.e > this.q2) {
            return -1;
        }
        this.p4.c5(function (g) {
            if (g._visibility == 0) {
                var h = _this.p4.cp(g);
                var i = h.left + h.width / 2;
                var j = h.top + h.height / 2;
                var k = (e - i) * (e - i) + (f - j) * (f - j);
                if (k < c) {
                    c = k;
                    b = g;
                }
            }
        });
        if (b != null) {
            return b.ak;
        }
        return -1;
    };
    ScatterBase.prototype.nt = function (a, b, c) {
        var _this = this;
        if (this.xAxis == null || this.yAxis == null || this.qi == null || this.qj == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        var d = this.bs.bv;
        var e = this.bs.bu;
        var f = this.getEffectiveViewport();
        var g = new ScalerParams(0, d, e, this.xAxis.ca, f);
        var h = ((function () {
            var $ret = new ScalerParams(0, d, e, _this.yAxis.ca, f);
            $ret.b = _this.fa();
            return $ret;
        })());
        if (b) {
            var i = this.e4(a);
            if (i == -1) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            var j = truncate(Math.floor(i));
            var k = truncate(Math.ceil(i));
            if (j < 0) {
                j = 0;
            }
            if (k < 0) {
                k = 0;
            }
            if (k > this.cd.count - 1) {
                k = this.cd.count - 1;
            }
            if (j > this.cd.count - 1) {
                j = this.cd.count - 1;
            }
            if (k == j) {
                var l = this.xAxis.dz(this.qi.item(j), g);
                var m = this.yAxis.dz(this.qj.item(j), h);
                return { $type: Point_$type, x: l, y: m };
            }
            var n = i - Math.floor(i);
            var o = this.xAxis.dz(this.qi.item(j), g);
            var p = this.yAxis.dz(this.qj.item(j), h);
            var q = this.xAxis.dz(this.qi.item(k), g);
            var r = this.yAxis.dz(this.qj.item(k), h);
            var s = q - o;
            var t = r - p;
            return { $type: Point_$type, x: o + s * n, y: p + t * n };
        }
        else {
            var u = this.f9(a);
            if (u == -1) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            var v = this.xAxis.dz(this.qi.item(u), g);
            var w = this.yAxis.dz(this.qj.item(u), h);
            return { $type: Point_$type, x: v, y: w };
        }
    };
    ScatterBase.prototype.dq = function (a) {
        var _this = this;
        var b = this.b6 != null ? this.b6.os : Rect.empty;
        b = b.copy();
        var c = this.b6 != null ? this.b6.o7 : Rect.empty;
        var d = new Rect(0, 0, 0, 1, 1);
        var e = this.n0(this.bs);
        var f = new ScalerParams(0, d, d, this.xAxis.ca, e);
        var g = ((function () {
            var $ret = new ScalerParams(0, d, d, _this.yAxis.ca, e);
            $ret.b = _this.fa();
            return $ret;
        })());
        var h = !b.isEmpty && !c.isEmpty && this.cd != null ? this.cd.indexOf(a) : -1;
        var i = this.xAxis != null && this.qi != null && h < this.qi.count ? this.xAxis.dz(this.qi.item(h), f) : NaN;
        var j = this.yAxis != null && this.qj != null && h < this.qj.count ? this.yAxis.dz(this.qj.item(h), g) : NaN;
        if (!isNaN_(i)) {
            if (i < b.left + 0.1 * b.width) {
                i = i + 0.4 * b.width;
                b.x = i - 0.5 * b.width;
            }
            if (i > b.right - 0.1 * b.width) {
                i = i - 0.4 * b.width;
                b.x = i - 0.5 * b.width;
            }
        }
        if (!isNaN_(j)) {
            if (j < b.top + 0.1 * b.height) {
                j = j + 0.4 * b.height;
                b.y = j - 0.5 * b.height;
            }
            if (j > b.bottom - 0.1 * b.height) {
                j = j - 0.4 * b.height;
                b.y = j - 0.5 * b.height;
            }
        }
        if (this.b1 != null) {
            this.b1.ap(this.b6, b, true);
        }
        return h >= 0;
    };
    ScatterBase.prototype.ln = function (a, b) {
        this.k3(false);
    };
    ScatterBase.prototype.lo = function (a, b) {
        this.k3(false);
    };
    ScatterBase.prototype.rm = function (a, b, c, d, e) {
        var _this = this;
        b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
        var f = this.getEffectiveViewport1(a);
        var g = this.cd;
        var h;
        var i;
        var j = ((function () {
            var $ret = new ScalerParams(0, d, e, _this.p3.d, f);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var k = ((function () {
            var $ret = new ScalerParams(0, d, e, _this.p3.e, f);
            $ret.c = _this.getEffectiveViewport1(a);
            $ret.b = _this.fa();
            return $ret;
        })());
        var l = false;
        var m = 0;
        if (this.b6 != null) {
            if (this.b6.ea()) {
                var n = this.b6.ik(d, j);
                l = n.c;
                m = n.d;
            }
        }
        var _loop_1 = function (o) {
            h = this_1.qi.item(o);
            i = this_1.qj.item(o);
            var p = { $type: Point_$type, x: this_1.p3.a.dz(h, j), y: this_1.p3.b.dz(i, k) };
            if (l) {
                if (p.x < e.left || p.x > e.right) {
                    if (p.x + m >= e.left && p.x + m <= e.right) {
                        p = { $type: Point_$type, x: p.x + m, y: i };
                    }
                }
            }
            if (!isInfinity(p.x) && !isInfinity(p.y)) {
                var q_1 = g.item(o);
                if (!b.g.containsKey(q_1)) {
                    var r_1 = { $type: Point_$type, x: h, y: i };
                    var s_1 = { $type: Point_$type, x: p.x, y: p.y };
                    b.g.addItem(q_1, ((function () {
                        var $ret = new OwnedPoint();
                        $ret.a = q_1;
                        $ret.b = r_1;
                        $ret.c = s_1;
                        return $ret;
                    })()));
                }
            }
        };
        var this_1 = this;
        for (var o = 0; o < c; o++) {
            _loop_1(o);
        }
    };
    ScatterBase.prototype.ru = function (a, b) {
        var _this = this;
        this.po = null;
        this.pp = null;
        a.j.clear();
        a.n.clear();
        a.h.clear();
        a.l.clear();
        a.i.clear();
        a.k.clear();
        var c = Math.min(this.qi != null ? this.qi.count : 0, this.qj != null ? this.qj.count : 0);
        var d = b.bv;
        var e = b.bu;
        var f = this.getEffectiveViewport1(b);
        var g = new ScalerParams(0, d, e, this.xAxis.ca, f);
        g.c = this.getEffectiveViewport1(b);
        var h = ((function () {
            var $ret = new ScalerParams(0, d, e, _this.yAxis.ca, f);
            $ret.b = _this.fa();
            return $ret;
        })());
        h.c = this.getEffectiveViewport1(b);
        if (c < 1) {
            return;
        }
        this.p3 = ((function () {
            var $ret = new ScatterAxisInfoCache();
            $ret.a = _this.xAxis;
            $ret.b = _this.yAxis;
            $ret.d = _this.xAxis.ca;
            $ret.e = _this.yAxis.ca;
            $ret.c = _this.cd;
            return $ret;
        })());
        var i = b;
        if (c <= this.q3) {
            this.rm(i, a, c, d, e);
        }
        if (this.ok()) {
            b.cv.l(a.j, this.q3, d, e, this.fq);
        }
        var j = ((function () {
            var $ret = new Clipper(0, e, false);
            $ret.i = a.n;
            return $ret;
        })());
        var k = this.ny(b);
        var l = this.xAxis.d2(k.left, g);
        var m = this.xAxis.d2(k.right, g);
        b.cx.h(a.n, this.trendLineType, this.qi, this.qj, this.trendLinePeriod, function (n) { return _this.xAxis.dz(n, g); }, function (n) { return _this.yAxis.dz(n, h); }, ((function () {
            var $ret = new TrendResolutionParams();
            $ret.b = _this.fq;
            $ret.f = e;
            $ret.g = d;
            return $ret;
        })()), j, l, m);
        this.rs(a, b);
    };
    ScatterBase.prototype.jl = function (a, b) {
        _super.prototype.jl.call(this, a, b);
        var c = b;
        c.c4(a);
    };
    ScatterBase.prototype.get_da = function () {
        return true;
    };
    ScatterBase.prototype.px = function (a, b, c) {
        return null;
    };
    ScatterBase.prototype.py = function (a, b, c) {
        var d = this.p7;
        if (this.cn()) {
            d = this.qa;
        }
        var e = this.p4.by(this.no(b));
        var f = -1;
        if (e == null) {
            if (a != null) {
                f = this.cd.indexOf(a);
            }
            else {
                return null;
            }
        }
        else {
            f = e.ak;
        }
        if (f == -1) {
            return null;
        }
        var g = new HighlightingInfo();
        g.b = this;
        g.h = f;
        g.g = f;
        g.d = false;
        g.e = true;
        if (c != null && c.h == g.h && c.g == g.g) {
            return c;
        }
        return g;
    };
    ScatterBase.prototype.n7 = function () {
        if (this.oi != 1 && this.oi != 13) {
            var a = this.oh.cq();
            var b = (a.width / 2) + (this.on / 2);
            var c = (a.height / 2) + (this.on / 2);
            return new Thickness(1, b, c, b, c);
        }
        return new Thickness(1, 0, 0, 0, 0);
    };
    ScatterBase.prototype.pw = function (a, b, c) {
        var d = new HighlightingInfo();
        d.b = this;
        d.h = 0;
        d.g = this.cd.count - 1;
        d.d = true;
        if (c != null && c.h == d.h && c.g == d.g) {
            return c;
        }
        return d;
    };
    ScatterBase.prototype.au = function (a, b, c) {
        if (this.cu && this.dl(this.be) && !c) {
            var d = this.px(a, b, this.pz);
            this.pz = d;
            return d;
        }
        else {
            var e = this.pw(a, b, this.pz);
            this.pz = e;
            return e;
        }
    };
    ScatterBase.prototype.av = function (a, b, c) {
        if (this.dl(this.be) && !c) {
            var d = this.py(a, b, this.p0);
            this.p0 = d;
            return d;
        }
        else {
            var e = this.pw(a, b, this.p0);
            e.e = true;
            this.p0 = e;
            return e;
        }
    };
    ScatterBase.prototype.qv = function () {
        return (this.assigningScatterStyle != null && this.ql) || (this.be != 1);
    };
    ScatterBase.prototype.qu = function () {
        return (this.assigningScatterMarkerStyle != null && this.qk) || (this.be != 1);
    };
    ScatterBase.prototype.r5 = function (a, b) {
        var _this = this;
        var c = b.bu;
        this.p3 = ((function () {
            var $ret = new ScatterAxisInfoCache();
            $ret.a = _this.xAxis;
            $ret.b = _this.yAxis;
            $ret.d = _this.xAxis.ca;
            $ret.e = _this.yAxis.ca;
            return $ret;
        })());
        if (this.ok()) {
            b.cv.j(a.j, this.om);
            if (this.qu()) {
                this.rn(b, a);
            }
        }
        b.cm();
        var d = ((function () {
            var $ret = new Clipper(1, NaN, c.bottom, NaN, c.top, false);
            $ret.i = b.cx.g$j.ak;
            return $ret;
        })());
        b.cx.g$h(a.n, d);
        this.r2(a, b);
    };
    ScatterBase.prototype.pr = function (a, b) {
        return this.ps(a, b);
    };
    ScatterBase.prototype.ps = function (a, b) {
        if (b < a || a < 0 || a > this.qi.count || b < 0 || b > this.qi.count) {
            return null;
        }
        var c = new Array((b - a) + 1);
        for (var d = a; d <= b; d++) {
            var e = d;
            c[d - a] = this.cd.item(d);
        }
        return c;
    };
    ScatterBase.prototype.rn = function (a, b) {
        var _this = this;
        a.b3 = true;
        this.qf.aw(this, this.qu(), runOn(this, this.pr));
        var c = this.qf.d;
        var d = c != null;
        var e = this.getEffectiveViewport1(a);
        var f = this.cd == null ? 0 : this.cd.count;
        this.p4.cf(function (g) {
            if (g._visibility == 0) {
                var h = g.ak;
                var i = g.content;
                if (i == null) {
                    i = new DataContext();
                    g.content = i;
                }
                if (d) {
                    _this.rp(h, f, a.q);
                }
                _this.qf.ac(g, i);
            }
        });
    };
    ScatterBase.prototype.rq = function (a, b, c) {
        var d = this.be != 1;
        this.qf.ay(this.qf.b, a, b, false);
        this.qf.ab(this.es);
        var e = this.qf.av;
        var f = null;
        var g = this.cd;
        if (d && this.b6 != null) {
            f = this.b6.az.getHighlightingInfo(this, g, e.o, e.n, false);
            e.b = f;
        }
        e.f = c;
        this.r0(e);
        this.qf.z(this, f, c, d, a < 0);
    };
    ScatterBase.prototype.rp = function (a, b, c) {
        var d = this.be != 1;
        this.qf.ay(this.qf.d, a, b, true);
        this.qf.aa(this.es);
        var e = this.qf.au;
        var f = null;
        var g = this.cd;
        var h = null;
        if (d && this.b6 != null) {
            f = this.b6.az.getHighlightingInfo(this, g, e.o, e.n, true);
            if (this.b6.az.isCrossSeriesHighlight(this)) {
                h = this.b6.az.getHighlightingInfo(this, g, e.o, e.n, true);
            }
            e.b = f;
        }
        e.f = c;
        this.rz(e);
        this.qf.y(this, f, c, d, e.m, this.b6.az.totalHighlightingProgress);
    };
    ScatterBase.prototype.r0 = function (a) {
        if (this.assigningScatterStyle != null && this.ql) {
            this.assigningScatterStyle(this, a);
        }
    };
    ScatterBase.prototype.rz = function (a) {
        if (this.assigningScatterMarkerStyle != null && this.qk) {
            this.assigningScatterMarkerStyle(this, a);
        }
    };
    ScatterBase.prototype.rs = function (a, b) {
        var e_3, _a;
        var c = new ErrorBarsHelper(this, b);
        if (this.p5 == null) {
            return;
        }
        var d = this.p5.u;
        var e = this.p5.v;
        var f = 0;
        var g = 0;
        var h = 0;
        var i = 0;
        try {
            for (var _b = tslib_1.__values(fromEnum(a.j.keys)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var j = _c.value;
                var k = a.j.item(j);
                if (d != null) {
                    switch (d.getCalculatorType()) {
                        case 1:
                            var l = this.rv(k, c, d, h, i, true);
                            h = l.p3;
                            i = l.p4;
                            break;
                        case 0:
                            var m = this.rt(k, c, d, h, i, true);
                            h = m.p3;
                            i = m.p4;
                            break;
                        case 2:
                            var n = this.rr(k, c, d, j, h, i, true);
                            h = n.p4;
                            i = n.p5;
                            break;
                        case 3:
                            var o = this.rw(c, d, f, h, i, true);
                            f = o.p2;
                            h = o.p3;
                            i = o.p4;
                            break;
                        case 4:
                            var p = this.rt(k, c, d, h, i, true);
                            h = p.p3;
                            i = p.p4;
                            break;
                    }
                    ;
                    var q = new OwnedPoint();
                    q.c = c.l(d, this.p3.a, k.c, f);
                    q.a = k.a;
                    a.h.addItem(j, q);
                    a.i.addItem(j, [h, i]);
                }
                if (e != null) {
                    switch (e.getCalculatorType()) {
                        case 1:
                            var r = this.rv(k, c, e, h, i, false);
                            h = r.p3;
                            i = r.p4;
                            break;
                        case 0:
                            var s = this.rt(k, c, e, h, i, false);
                            h = s.p3;
                            i = s.p4;
                            break;
                        case 2:
                            var t = this.rr(k, c, e, j, h, i, false);
                            h = t.p4;
                            i = t.p5;
                            break;
                        case 3:
                            var u = this.rw(c, e, g, h, i, false);
                            g = u.p2;
                            h = u.p3;
                            i = u.p4;
                            break;
                        case 4:
                            var v = this.rt(k, c, e, h, i, false);
                            h = v.p3;
                            i = v.p4;
                            break;
                    }
                    ;
                    var w = new OwnedPoint();
                    w.c = c.m(e, this.p3.b, k.c, g);
                    w.a = k.a;
                    a.l.addItem(j, w);
                    a.k.addItem(j, [h, i]);
                }
            }
        }
        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;
            }
        }
    };
    ScatterBase.prototype.rv = function (a, b, c, d, e, f) {
        if (f) {
            var g = void 0;
            var h = void 0, i = void 0;
            i = this.p3.a;
            if (this.p5.s == 0) {
                g = a.c.x;
                h = this.p3.a;
            }
            else {
                g = a.c.y;
                h = this.p3.b;
            }
            var j = b.f(g, c, h, i, d, e);
            d = j.p4;
            e = j.p5;
        }
        else {
            var k = void 0;
            var l = void 0, m = void 0;
            m = this.p3.b;
            if (this.p5.t == 0) {
                k = a.c.x;
                l = this.p3.a;
            }
            else {
                k = a.c.y;
                l = this.p3.b;
            }
            var n = b.f(k, c, l, m, d, e);
            d = n.p4;
            e = n.p5;
        }
        return {
            p3: d,
            p4: e
        };
    };
    ScatterBase.prototype.rt = function (a, b, c, d, e, f) {
        if (f) {
            var g = b.j(a.c.x, c, this.p3.a, d, e);
            d = g.p3;
            e = g.p4;
        }
        else {
            var h = b.j(a.c.y, c, this.p3.b, d, e);
            d = h.p3;
            e = h.p4;
        }
        return {
            p3: d,
            p4: e
        };
    };
    ScatterBase.prototype.rr = function (a, b, c, d, e, f, g) {
        var h = c.getItemColumn();
        var i = this.cd.indexOf(d);
        if (h != null && i < h.count) {
            var j = h.item(i);
            if (g) {
                var k = b.h(a.c.x, j, this.p3.a, e, f);
                e = k.p3;
                f = k.p4;
            }
            else {
                var l = b.h(a.c.y, j, this.p3.b, e, f);
                e = l.p3;
                f = l.p4;
            }
        }
        else {
            e = NaN;
            f = NaN;
        }
        return {
            p4: e,
            p5: f
        };
    };
    ScatterBase.prototype.rw = function (a, b, c, d, e, f) {
        var g = a.i(b, c);
        c = g.p1;
        if (f) {
            var h = a.k(c, b, this.p3.a, d, e);
            d = h.p3;
            e = h.p4;
        }
        else {
            var i = a.k(c, b, this.p3.b, d, e);
            d = i.p3;
            e = i.p4;
        }
        return {
            p2: c,
            p3: d,
            p4: e
        };
    };
    ScatterBase.prototype.r2 = function (a, b) {
        if (!b.o() || this.p5 == null) {
            b.c6();
            return;
        }
        this.r3(a, b);
        this.r4(a, b);
    };
    ScatterBase.prototype.r3 = function (a, b) {
        var e_4, _a;
        b.c2();
        var c = new ErrorBarsHelper(this, b);
        var d = new PathGeometry();
        var e = this.p5.u;
        try {
            for (var _b = tslib_1.__values(fromEnum(a.j.keys)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var f = _c.value;
                if (e != null && a.i.containsKey(f)) {
                    var g = a.i.item(f)[0];
                    var h = a.i.item(f)[1];
                    if (!isNaN_(g) && !isNaN_(h)) {
                        var i = a.h.item(f).c;
                        if (this.p5.o == 1 || this.p5.o == 2) {
                            c.d(d, i, g, true);
                        }
                        if (this.p5.o == 1 || this.p5.o == 3) {
                            c.d(d, i, h, false);
                        }
                    }
                }
            }
        }
        catch (e_4_1) {
            e_4 = { error: e_4_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_4)
                    throw e_4.error;
            }
        }
        b.c7(d);
    };
    ScatterBase.prototype.r4 = function (a, b) {
        var e_5, _a;
        b.c3();
        var c = new ErrorBarsHelper(this, b);
        var d = new PathGeometry();
        var e = this.p5.v;
        try {
            for (var _b = tslib_1.__values(fromEnum(a.j.keys)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var f = _c.value;
                if (e != null && a.k.containsKey(f)) {
                    var g = a.k.item(f)[0];
                    var h = a.k.item(f)[1];
                    if (!isNaN_(g) && !isNaN_(h)) {
                        var i = a.l.item(f).c;
                        if (this.p5.p == 1 || this.p5.p == 2) {
                            c.e(d, i, g, true);
                        }
                        if (this.p5.p == 1 || this.p5.p == 3) {
                            c.e(d, i, h, false);
                        }
                    }
                }
            }
        }
        catch (e_5_1) {
            e_5 = { error: e_5_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_5)
                    throw e_5.error;
            }
        }
    };
    ScatterBase.prototype.ec = function (a, b, c) {
        var d = true;
        if (!_super.prototype.ec.call(this, a, b, c) || b.isEmpty || a.isEmpty || this.xAxis == null || this.yAxis == null || this.xAxis.bh == null || this.yAxis.bh == null || this.qi == null || this.qj == null || this.qi.count == 0 || this.qj.count == 0 || this.cd == null || this.cd.count != this.qi.count || this.cd.count != this.qj.count || this.xAxis.bh == null || this.yAxis.bh == null || this.xAxis.kd == this.xAxis.kc || this.yAxis.kd == this.yAxis.kc) {
            d = false;
        }
        return d;
    };
    ScatterBase.prototype.getViewInfo = function (a, b) {
        if (!this.st.isEmpty && !this.su.isEmpty) {
            a = this.st;
            b = this.su;
            return {
                p0: a,
                p1: b
            };
        }
        a = this.bs.bu;
        b = this.bs.bv;
        return {
            p0: a,
            p1: b
        };
    };
    ScatterBase.prototype.k4 = function (a) {
        this.rl();
        try {
            if (this.cp(this.bs)) {
                return;
            }
            if (this.cd != null && this.cd.count > this.q3) {
                a = false;
            }
            if (this.dr(a) && !this.dv) {
                var b = this.p8;
                if (this.cn()) {
                    if (this.b7.g) {
                        this.b7.t();
                    }
                    this.p8 = this.qa;
                    this.qa = b;
                }
                else {
                    this.p8 = this.p7;
                    this.p7 = b;
                }
                this.ru(this.p7, this.p4);
                this.lb();
            }
            else {
                if (!this.dv) {
                    this.ru(this.p7, this.p4);
                }
                this.r5(this.p7, this.p4);
            }
        }
        finally {
            this.r6();
        }
    };
    ScatterBase.prototype.lg = function () {
        _super.prototype.lg.call(this);
        if (this.gi < 0) {
            return;
        }
        this.p4.da();
    };
    ScatterBase.prototype.k5 = function (a, b) {
        _super.prototype.k5.call(this, a, b);
        if (!this.d2) {
            this.bs.a2(b);
            return;
        }
        this.bs.a2(b);
        if (this.cp(this.br)) {
            return;
        }
        var c = typeCast(ScatterBaseView.$, this.br);
        if (!this.dw) {
            this.p9 = new ScatterFrame();
            this.ru(this.p9, c);
        }
        this.dw = false;
        this.r5(this.p9, c);
        this.d2 = false;
    };
    ScatterBase.prototype.k2 = function (a, b, c, d, e) {
        _super.prototype.k2.call(this, a, b, c, d, e);
        var f = this.a3.a$h.item(d);
        var g = f;
        f.a1(c);
        if (this.cp(g)) {
            return;
        }
        if (this.p6 == null) {
            this.p6 = new ScatterFrame();
        }
        this.ru(this.p6, g);
        this.r5(this.p6, g);
    };
    ScatterBase.prototype.r1 = function (a, b) {
        var e_6, _a, e_7, _b;
        var c = new List$1(Base.$, 0);
        try {
            for (var _c = tslib_1.__values(fromEnum(b.c)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var d = _d.value;
                if (!a.containsKey(d)) {
                    c.add1(d);
                }
            }
        }
        catch (e_6_1) {
            e_6 = { error: e_6_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_6)
                    throw e_6.error;
            }
        }
        try {
            for (var _e = tslib_1.__values(fromEnum(c)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var e = _f.value;
                b.h(e);
            }
        }
        catch (e_7_1) {
            e_7 = { error: e_7_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_7)
                    throw e_7.error;
            }
        }
    };
    ScatterBase.prototype.pq = function (a, b, c, d, e) {
        var _this = this;
        if (c == null || c.length != this.p3.c.count) {
            c = new Array(this.p3.c.count);
            for (var f = 0; f < this.p3.c.count; f++) {
                c[f] = PointUtil.create();
            }
        }
        var g = this.getEffectiveViewport1(a);
        var h = ((function () {
            var $ret = new ScalerParams(0, d, e, _this.xAxis.ca, g);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var i = ((function () {
            var $ret = new ScalerParams(0, d, e, _this.yAxis.ca, g);
            $ret.c = _this.getEffectiveViewport1(a);
            $ret.b = _this.fa();
            return $ret;
        })());
        var j = this.ny(a);
        var k = this.p3.a.d2(j.left, h);
        var l = this.p3.a.d2(j.right, h);
        var m = this.p3.b.d2(j.bottom, i);
        var n = this.p3.b.d2(j.top, i);
        if (this.p3.d) {
            var o = k;
            k = l;
            l = o;
        }
        if (this.p3.e) {
            var p = m;
            m = n;
            n = p;
        }
        var q = this.p3;
        var r = q.a;
        var s = q.b;
        var t;
        var u;
        var v = this.qi;
        var w = this.qj;
        var x = false;
        var y = 0;
        var z = 0;
        if (this.b6 != null) {
            if (this.b6.ea()) {
                var aa = this.b6.ik(d, h);
                x = aa.c;
                y = aa.d;
                z = r.d2(0 + y, h);
                var ab = r.d2(0, h);
                z -= ab;
            }
        }
        for (var ac = 0; ac < this.p3.c.count; ac++) {
            t = v.item(ac);
            u = w.item(ac);
            if (x) {
                if (t >= k && t <= l && u >= m && u <= n) {
                    c[ac].x = r.dz(t, h);
                    c[ac].y = s.dz(u, i);
                }
                else {
                    if ((t + z) >= k && (t + z) <= l && u >= m && u <= n) {
                        c[ac].x = r.dz(t, h) + y;
                        c[ac].y = s.dz(u, i);
                    }
                    else {
                        c[ac].x = NaN;
                        c[ac].y = NaN;
                    }
                }
            }
            else {
                if (t >= k && t <= l && u >= m && u <= n) {
                    c[ac].x = r.dz(t, h);
                    c[ac].y = s.dz(u, i);
                }
                else {
                    c[ac].x = NaN;
                    c[ac].y = NaN;
                }
            }
        }
        return c;
    };
    ScatterBase.prototype.qw = function (a, b) {
        var e_8, _a;
        if (b == null) {
            b = new List$1(Number_$type, 2, a.e);
        }
        else {
            b.clear();
        }
        var c = 0;
        var d = this.cd;
        try {
            for (var _b = tslib_1.__values(fromEnum(a.c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                b.add(d.indexOf(e));
            }
        }
        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;
            }
        }
        return b;
    };
    ScatterBase.prototype.jv = function (a) {
        _super.prototype.jv.call(this, a);
        this.a5.exportTrendlineData(this, a, this.p4.cx.g$j);
    };
    ScatterBase.prototype.fa = function () {
        return Series.fb(this.qj, null);
    };
    ScatterBase.$t = markType(ScatterBase, 'ScatterBase', MarkerSeries.$, [ISupportsErrorBars_$type, ITrendLineSeries_$type]);
    ScatterBase.r7 = DependencyProperty.i("ActualTrendLineBrush", Brush.$, ScatterBase.$, new PropertyMetadata(2, null, function (a, b) { return a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue); }));
    ScatterBase.$$p = markDep(DependencyProperty, PropertyMetadata, ScatterBase, 'raisePropertyChanged', ['ErrorBarSettings:p5:r8', [ScatterErrorBarSettings.$, null], 'IsCustomScatterMarkerStyleAllowed:qo:r9', [0, false], 'IsCustomScatterStyleAllowed:qp:sa', [0, false], 'ItemSearchMode:qe:sb', [ScatterItemSearchMode_$type, enumGetBox(ScatterItemSearchMode_$type, 0)], 'ItemSearchThreshold:q2:sc', [1, 10000], 'MarkerCollisionAvoidance:pv:sd', [CollisionAvoidanceType_$type, enumGetBox(CollisionAvoidanceType_$type, 0)], 'MaximumMarkers:q3:se', [1, 400], 'XAxis::sm', [NumericXAxis.$, null], 'XMemberPath:rf:sn', [2, null], 'YAxis::so', [NumericYAxis.$, null], 'YMemberPath:rj:sp', [2, null], 'TrendLineType::sk', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness::sj', [1, 1.5], 'TrendLinePeriod::si', [1, 7], 'TrendLineBrush::sf', [Brush.$, null], 'TrendLineZIndex:q4:sl', [1, 1001], 'TrendLineDashArray:sr:sg', [DoubleCollection.$], 'TrendLineDashCap:ss:sh', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)]]);
    return ScatterBase;
}(MarkerSeries));
export { ScatterBase };
/**
 * @hidden
 */
var ScatterSeriesRenderManager = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(ScatterSeriesRenderManager, _super);
    function ScatterSeriesRenderManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.au = null;
        _this.av = null;
        return _this;
    }
    ScatterSeriesRenderManager.prototype.c = function () {
        this.au = new AssigningScatterMarkerStyleEventArgs();
        return this.au;
    };
    ScatterSeriesRenderManager.prototype.a = function () {
        this.av = new AssigningScatterStyleEventArgs();
        return this.av;
    };
    ScatterSeriesRenderManager.prototype.aw = function (a, b, c) {
        this.w(a, b, c);
    };
    ScatterSeriesRenderManager.prototype.ax = function (a, b, c) {
        this.x(a, b, c);
    };
    ScatterSeriesRenderManager.prototype.ay = function (a, b, c, d) {
        if (b == -1) {
            a.c = false;
            a.o = 0;
            a.n = c - 1;
        }
        else {
            if (d) {
                a.o = b;
                a.n = b;
            }
            else {
                a.c = false;
                a.o = b;
                a.n = b;
            }
        }
    };
    ScatterSeriesRenderManager.$t = markType(ScatterSeriesRenderManager, 'ScatterSeriesRenderManager', SeriesRenderManager.$);
    return ScatterSeriesRenderManager;
}(SeriesRenderManager));
export { ScatterSeriesRenderManager };
/**
 * @hidden
 */
var ScatterBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(ScatterBaseView, _super);
    function ScatterBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.cv = null;
        _this.ct = null;
        _this.cw = null;
        _this.c1 = null;
        _this.dc = null;
        _this.dd = null;
        _this.cx = null;
        _this.db = null;
        _this.cy = null;
        _this.cw = a;
        _this.cy = new HashPool$2(Base.$, Marker.$);
        _this.ch(_this.cy);
        _this.cx = new ScatterTrendLineManager();
        return _this;
    }
    ScatterBaseView.prototype.as = function () {
        _super.prototype.as.call(this);
        this.cv = this.cu();
        this.dc = new Path();
        this.dd = new Path();
        if (!this.q) {
            this.cw.q3 = 2000;
        }
    };
    ScatterBaseView.prototype.de = function (a) {
        if (this.db == null) {
            this.db = new DataTemplateMeasureInfo();
            this.db.context = this.k.g();
        }
        this.db.width = a.width;
        this.db.height = a.height;
        this.db.data = a.content;
        var b = a.ah;
        if (b.measure != null) {
            b.measure(this.db);
        }
        return new Size(1, this.db.width, this.db.height);
    };
    ScatterBaseView.prototype.cu = function () {
        var _this = this;
        var a = new NumericMarkerManager(1, function (b) { return _this.cy.item(b); }, function (b) { return _this.cw.p3.c.item(b); }, runOn(this, this.c9), runOn(this, this.cr), runOn(this, this.cz), function () { return _this.cw.pv; });
        a.q = runOn(this, this.de);
        return a;
    };
    ScatterBaseView.prototype.c9 = function (a) {
        this.cw.r1(a, this.cy);
    };
    ScatterBaseView.prototype.c0 = function () {
        return this.b4;
    };
    ScatterBaseView.prototype.cs = function () {
        return this.ct;
    };
    ScatterBaseView.prototype.cr = function () {
        this.ct = this.cw.pq(this, this.cy, this.ct, this.bv, this.bu);
        return this.ct;
    };
    ScatterBaseView.prototype.cz = function () {
        this.c1 = this.cw.qw(this.cy, this.c1);
        return this.c1;
    };
    ScatterBaseView.prototype.c2 = function () {
    };
    ScatterBaseView.prototype.c7 = function (a) {
    };
    ScatterBaseView.prototype.c3 = function () {
    };
    ScatterBaseView.prototype.c8 = function (a) {
    };
    ScatterBaseView.prototype.da = function () {
        if (this.cw.trendLineBrush != null) {
            this.cw.sq = this.cw.trendLineBrush;
        }
        else {
            this.cw.sq = this.cw.m9;
        }
    };
    ScatterBaseView.prototype.cf = function (a) {
        this.cy.f(a);
    };
    ScatterBaseView.prototype.c5 = function (a) {
        this.cy.g(a);
    };
    ScatterBaseView.prototype.c6 = function () {
    };
    ScatterBaseView.prototype.a5 = function (a, b) {
        _super.prototype.a5.call(this, a, b);
        if (a.d) {
            if (this.cw.trendLineType != 0 && !b) {
                var c = this.cx.g$j;
                c.ac = this.cw.trendLineThickness;
                c._stroke = this.cw.sq;
                c.ai = this.cw.sr;
                c.ad = this.cw.ss;
                a.u(c);
            }
        }
    };
    ScatterBaseView.prototype.c4 = function (a) {
        if (a) {
            this.c6();
            this.cy.clear();
        }
        this.cx.g$d();
        this.aq();
    };
    ScatterBaseView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'><span";
        var b = this.e.a3.a$r(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.cw.gy + "</span><br/><span>" + "x: </span><span class='ui-priority-primary'>${item." + this.cw.rf + "}</span><br/><span>" + "y: </span><span class='ui-priority-primary'>${item." + this.cw.rj + "}</span></div>";
        return a;
    };
    ScatterBaseView.$t = markType(ScatterBaseView, 'ScatterBaseView', MarkerSeriesView.$);
    return ScatterBaseView;
}(MarkerSeriesView));
export { ScatterBaseView };
//# sourceMappingURL=ScatterBase_combined.js.map
