/*
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 { 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 "igniteui-react-core";
import { ScatterFrame } from "./ScatterFrame";
import { Base, runOn, delegateCombine, enumGetBox, Number_$type, typeCast, fromEnum, Point_$type, 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 { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
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 { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } 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
 */
export let ScatterBase = /*@__PURE__*/ (() => {
    class ScatterBase extends MarkerSeries {
        cq() {
            return new ScatterBaseView(this);
        }
        o0() {
            super.o0();
            this.xAxis = null;
            this.yAxis = null;
        }
        qx(a) {
            super.qx(a);
            this.yp = a;
        }
        get_fu() {
            return true;
        }
        ai() {
            return [this.xAxis, this.yAxis];
        }
        ko(a, b) {
            let c = this.nb(b);
            if (c == ScatterBase.$$p[12]) {
                return this.kp(a, b, this.aal);
            }
            if (c == ScatterBase.$$p[16]) {
                return this.kp(a, b, this.aat);
            }
            if (c == ScatterBase.$$p[1]) {
                return this.kp(a, b, this.z5);
            }
            if (c == ScatterBase.$$p[2]) {
                return this.kp(a, b, this.z7);
            }
            return null;
        }
        mb(a) {
            let b = this.nb(a);
            if (b == ScatterBase.$$p[12]) {
                return this.aal;
            }
            if (b == ScatterBase.$$p[16]) {
                return this.aat;
            }
            if (b == ScatterBase.$$p[1]) {
                return this.z5;
            }
            if (b == ScatterBase.$$p[2]) {
                return this.z7;
            }
            return super.mb(a);
        }
        d9(a, b, c, d) {
            if (!this.hasMarkers) {
                return false;
            }
            let e = this.xAxis;
            let f = new ScalerParams(1, this.c9.vl, this.wl, e.ch);
            f.c = this.getEffectiveViewport1(this.ct);
            let g = this.yAxis;
            let h = new ScalerParams(1, this.c9.vl, this.wl, g.ch);
            h.c = this.getEffectiveViewport1(this.ct);
            a.clear();
            this.wy.cj((i) => {
                if (i._visibility == 0) {
                    let j = new SeriesPointOfInterest();
                    let k = i.n;
                    let l = i.o;
                    if (k < this.wl.left || k > this.wl.right || l < this.wl.top || l > this.wl.bottom) {
                        return;
                    }
                    j.d = e.en(k, f);
                    j.e = g.en(l, h);
                    j.b = i.content;
                    j.g = this.va;
                    j.c = i.ak;
                    if (this.g7) {
                        j.g = this.vh(i.ak);
                    }
                    a.add(j);
                }
            });
            return true;
        }
        b0() {
            if (this.b1 == 0) {
                if (this.z1 <= 2000) {
                    return 1;
                }
                else {
                    return super.b0();
                }
            }
            else {
                return super.b0();
            }
        }
        wj(a) {
            if (!this.hasMarkers || !this.w8()) {
                return Rect.empty;
            }
            let b = this.wy.b1(this.v1(a));
            if (b != null) {
                return this.wy.cu(b);
            }
            return Rect.empty;
        }
        gu(a, b) {
            if (this.w9(a, b)) {
                return true;
            }
            return false;
        }
        constructor() {
            super();
            this.yo = null;
            this.y7 = null;
            this.y8 = null;
            this.acc = null;
            this.acd = null;
            this.yx = 1;
            this.ye = null;
            this.yf = null;
            this.yu = null;
            this.yw = null;
            this.ys = null;
            this.zd = false;
            this.zc = false;
            this.y5 = null;
            this.y6 = null;
            this.assigningScatterStyle = null;
            this.assigningScatterMarkerStyle = null;
            this.y1 = null;
            this.yv = null;
            this.yr = null;
            this.zb = true;
            this.zq = 0;
            this.zr = 0;
            this.zs = 0;
            this.zt = 0;
            this.yy = this.yz();
            this.y1 = new ScatterSeriesRenderManager();
            this.yv = new ScatterFrame();
            this.acd = Rect.empty;
            this.acc = Rect.empty;
        }
        get y9() {
            return this.y7;
        }
        set y9(a) {
            if (this.y7 != a) {
                let b = this.y9;
                this.y7 = a;
                this.raisePropertyChanged("XColumn", b, this.y9);
            }
        }
        get za() {
            return this.y8;
        }
        set za(a) {
            if (this.y8 != a) {
                let b = this.za;
                this.y8 = a;
                this.raisePropertyChanged("YColumn", b, this.za);
            }
        }
        f9() {
            return this.highlightedItemsSource != null || (this.z5 != null && this.z7 != null);
        }
        zo() {
            return false;
        }
        hr() {
            let a = super.hr();
            {
                let b = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "YMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedYMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.aa0));
                a.add(b);
            }
            {
                let c = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "XMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedXMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.aaz));
                a.add(c);
            }
            if (this.zo()) {
                let d = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "DashArray";
                    $ret.p = true;
                    $ret.x = ((() => {
                        let $ret = new DoubleCollection();
                        $ret.add(5);
                        $ret.add(5);
                        return $ret;
                    })());
                    $ret.q = true;
                    return $ret;
                })());
                a.add(d);
            }
            if (!this.zo()) {
                let e = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Brush";
                    $ret.p = true;
                    $ret.y = "ActualBrush";
                    $ret.q = true;
                    return $ret;
                })());
                e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.rv));
                a.add(e);
            }
            if (!this.zo()) {
                let f = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Outline";
                    $ret.p = true;
                    $ret.y = "ActualOutline";
                    $ret.q = true;
                    return $ret;
                })());
                f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.rv));
                a.add(f);
            }
            return a;
        }
        aaz(a, b) {
            if (this.z5 != null) {
                b.value = this.z5;
                return;
            }
            b.value = this.aal;
        }
        aa0(a, b) {
            if (this.z7 != null) {
                b.value = this.z7;
                return;
            }
            b.value = this.aat;
        }
        get ab9() {
            return this.c(ScatterBase.abk);
        }
        set ab9(a) {
            this.h(ScatterBase.abk, a);
        }
        get GetErrorBarsXAxis() {
            return this.xAxis;
        }
        get GetErrorBarsYAxis() {
            return this.yAxis;
        }
        p6() {
            super.p6();
            if (this.xAxis != null) {
                this.xAxis.h9(false);
            }
            if (this.yAxis != null) {
                this.yAxis.h9(false);
            }
        }
        q5(a, b, c, d) {
            super.q5(a, b, c, d);
            if (this.yp.c2.g$b(a, b, c, d)) {
                this.rn(false);
                this.qh();
            }
            switch (b) {
                case ScatterBase.$$p[10]:
                case ScatterBase.$$p[14]:
                case ScatterBase.$$p[11]:
                case ScatterBase.$$p[15]:
                    this.qb();
                    break;
                case "FastItemsSource":
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.y9);
                        c.deregisterColumn(this.za);
                        this.y9 = null;
                        this.za = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.y9 = this.di(this.aal);
                        this.za = this.di(this.aat);
                    }
                    if ((this.yAxis != null && !this.yAxis.c1()) || (this.xAxis != null && !this.xAxis.c1())) {
                        this.rn(this.ge && c != null);
                    }
                    break;
                case ScatterBase.$$p[9]:
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    if ((this.xAxis != null && !this.xAxis.c1()) || (d == null && c != null)) {
                        this.rn(false);
                    }
                    this.qh();
                    break;
                case ScatterBase.$$p[13]:
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    if ((this.yAxis != null && !this.yAxis.c1()) || (d == null && c != null)) {
                        this.rn(false);
                    }
                    this.qh();
                    break;
                case ScatterBase.$$p[12]:
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.y9);
                        this.y9 = this.di(this.aal);
                    }
                    break;
                case "XColumn":
                    this.yp.c2.g$i();
                    if (this.xAxis != null && !this.xAxis.c1()) {
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case ScatterBase.$$p[16]:
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.za);
                        this.za = this.di(this.aat);
                    }
                    break;
                case "YColumn":
                    this.yp.c2.g$i();
                    if (this.yAxis != null && !this.yAxis.c1()) {
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case ScatterBase.$$p[7]:
                    this.rn(false);
                    this.qh();
                    break;
                case ScatterBase.$$p[8]:
                    this.rn(false);
                    this.qh();
                    break;
                case "TransitionProgress":
                    this.yw.c(this.jo, this.yu, this.ys);
                    this.aav();
                    try {
                        if (this.d3(this.ct)) {
                            return;
                        }
                        if ((Math.round(this.jo * 100000) / 100000) == 1) {
                            this.abh(this.ys, this.yp);
                        }
                        else {
                            this.abh(this.yw, this.yp);
                        }
                        if (this.c9 != null) {
                            this.c9.qa(this);
                        }
                    }
                    finally {
                        this.abi();
                    }
                    break;
                case "TrendLineBrush":
                    this.rb(b);
                    break;
                case ScatterBase.$$p[0]:
                    if (this.yq != null) {
                        this.yq.r = this;
                    }
                    this.rn(false);
                    this.qh();
                    break;
                case "TrendLineType":
                    this.qh();
                    break;
                case ScatterBase.$$p[4]:
                    this.zd = this.zl();
                    this.rn(false);
                    break;
                case ScatterBase.$$p[3]:
                    this.zc = this.zk();
                    this.rn(false);
                    break;
                case ScatterBase.$$p[5]:
                    this.yy = this.yz();
                    break;
            }
        }
        zl() {
            return this.zh;
        }
        zk() {
            return this.zg;
        }
        zf(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        ze(a) {
            if (typeCast(NumericXAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        abi() {
            this.acc = Rect.empty;
            this.acd = Rect.empty;
        }
        aav() {
            let a = this.getViewInfo(this.acc, this.acd);
            this.acc = a.p0;
            this.acd = a.p1;
        }
        zj(a, b) {
            if (b != 3) {
                return true;
            }
            if (a == null) {
                return true;
            }
            if (this.aal == a || this.aat == a) {
                return true;
            }
            return false;
        }
        o9(a, b, c, d) {
            let e = false;
            if (!this.zj(d, a)) {
                return;
            }
            this.yp.c2.g$e(a, b, c, d);
            if (this.xAxis != null && !this.xAxis.c1()) {
                e = true;
            }
            if (this.yAxis != null && !this.yAxis.c1()) {
                e = true;
            }
            if (a == 0 || a == 2 || a == 3 || a == 4) {
                this.zb = true;
            }
            else if (a == 1) {
                for (let f = b; f < b + c; f++) {
                    this.zq += this.y9.item(f);
                    this.zr += this.za.item(f);
                }
                this.zs = this.zq / this.y9.count;
                this.zt = this.zr / this.za.count;
            }
            if (e) {
                this.rn(true);
            }
        }
        aa9(a) {
            this.aba(a, null);
        }
        aba(a, b) {
            let c = this.y9 != null ? this.y9.count : 0;
            let d = this.za != null ? this.za.count : 0;
            let e = Math.min(c, d);
            if (e <= this.z1) {
                a.m.clear();
                let f = new List$1(OwnedPoint.$, 0);
                for (let g of fromEnum(a.u.values)) {
                    f.add(g);
                }
                let h = this.dl;
                f.aa((i, j) => {
                    let k = h.indexOf(i.a);
                    let l = h.indexOf(j.a);
                    if (k < l) {
                        return -1;
                    }
                    if (k > l) {
                        return 1;
                    }
                    return 0;
                });
                if (b != null) {
                    b.i = a.m;
                }
                for (let i of fromEnum(f)) {
                    if (h.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 });
                        }
                    }
                }
            }
        }
        ax(a) {
            if (a != null && a == this.xAxis && this.y9 != null) {
                return new AxisRange(this.y9.minimum, this.y9.maximum);
            }
            if (a != null && a == this.yAxis && this.za != null) {
                return new AxisRange(this.za.minimum, this.za.maximum);
            }
            return null;
        }
        kl(a) {
            let b = this.j1(a);
            if (this.dl != null && b >= 0 && b < this.dl.count) {
                return this.dl.item(b);
            }
            return null;
        }
        get yy() {
            return this.yx;
        }
        set yy(a) {
            let b = this.yx;
            this.yx = a;
            if (b != this.yx) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.yx));
            }
        }
        yz() {
            if (this.y0 != 0) {
                return this.y0;
            }
            return this.zi ? 4 : 1;
        }
        j1(a) {
            let b = truncate(Math.round(this.ip(a)));
            return b;
        }
        ip(a) {
            switch (this.yy) {
                case 1: return this.zx(a);
                case 3: return this.zy(a);
                case 2: return this.zv(a);
                case 4: return this.zw(a);
                case 5: return this.zu(a);
            }
            return -1;
        }
        zw(a) {
            return this.zz(a, false);
        }
        zv(a) {
            let b = this.v1(a);
            let c = b.x;
            let d = b.y;
            if (this.dl == null || this.xAxis == null || this.yAxis == null || this.y9 == null || this.za == null) {
                return -1;
            }
            if (this.dl.count > this.z0) {
                return -1;
            }
            this.aay();
            let e = this.ye;
            let f = this.yf;
            if (e == null || f == null) {
                return -1;
            }
            let g = 1.7976931348623157E+308;
            let h = -1;
            for (let i = 0; i < this.y9.count; i++) {
                let j = e[i];
                let k = f[i];
                let l = (c - j) * (c - j) + (d - k) * (d - k);
                if (l < g) {
                    g = l;
                    h = i;
                }
            }
            return h;
        }
        aay() {
            let a = this.ct.by;
            let b = this.ct.bx;
            let c = this.getEffectiveViewport();
            if (this.yo == null) {
                return;
            }
            let d = new ScalerParams(0, a, b, this.yo.d, c);
            let e = ((() => {
                let $ret = new ScalerParams(0, a, b, this.yo.e, c);
                $ret.b = this.iw();
                return $ret;
            })());
            if (this.ye == null || this.yf == null) {
                let f = arrayShallowClone(this.y9.asArray());
                let g = arrayShallowClone(this.za.asArray());
                this.xAxis.ho(boxArray$1(f), 0, f.length, d);
                this.yAxis.ho(boxArray$1(g), 0, g.length, e);
                this.ye = f;
                this.yf = g;
            }
        }
        get_zi() {
            return false;
        }
        get zi() {
            return this.get_zi();
        }
        zz(a, b) {
            if (!this.zi) {
                return -1;
            }
            let c = { $type: Point_$type, x: 0, y: 0 };
            let d = true;
            let e = this.yt();
            if (e == null) {
                return -1;
            }
            if (e.m == null) {
                return -1;
            }
            if (this.dl == null || this.dl.count > this.z0) {
                return -1;
            }
            this.aay();
            let f = this.ye;
            let g = this.yf;
            if (f == null || g == null) {
                return -1;
            }
            let h = this.v1(a);
            let i = 1.7976931348623157E+308;
            let j = -1;
            for (let k = 0; k < this.ye.length; k++) {
                let l = { $type: Point_$type, x: this.ye[k], y: this.yf[k] };
                if (k > 0) {
                    if (!b || e.j.containsKey(this.dl.item(k)) || e.j.containsKey(this.dl.item(k - 1))) {
                        let m = GeometryUtil.g(h, c, l);
                        if (m < i) {
                            i = m;
                            j = k;
                        }
                    }
                }
                c = l;
            }
            if (j >= 0) {
                let n = { $type: Point_$type, x: this.ye[j], y: this.yf[j] };
                let o = { $type: Point_$type, x: this.ye[j - 1], y: this.yf[j - 1] };
                if (!b || (e.j.containsKey(this.dl.item(j)) && e.j.containsKey(this.dl.item(j - 1)))) {
                    let p = GeometryUtil.l(h, o, n);
                    return (j - 1) + p;
                }
                else if (e.j.containsKey(this.dl.item(j))) {
                    return j;
                }
                else {
                    return j - 1;
                }
            }
            return -1;
        }
        zy(a) {
            return this.zz(a, true);
        }
        zu(a) {
            let b = this.v1(a);
            let c = b.x;
            let d = b.y;
            if (this.yp.c3.e > this.z0) {
                return -1;
            }
            let e = -1;
            this.wy.ck((f) => {
                let g = this.yp.cu(f);
                let h = g.left;
                let i = g.top;
                let j = g.width;
                let k = g.height;
                if (this.w5) {
                    let l = h + j / 2;
                    let m = i + k / 2;
                    let n = (j / 2) * (j / 2);
                    let o = (c - l) * (c - l) + (d - m) * (d - m);
                    if (o < n) {
                        if (e == -1) {
                            e = f.ak;
                        }
                    }
                }
                else {
                    if (c > h && c < h + j && d > i && d < i + k) {
                        if (e == -1) {
                            e = f.ak;
                        }
                    }
                }
            });
            return e;
        }
        zx(a) {
            let b = null;
            let c = 1.7976931348623157E+308;
            let d = this.v1(a);
            let e = d.x;
            let f = d.y;
            if (this.yp.c3.e > this.z0) {
                return -1;
            }
            this.yp.da((g) => {
                if (g._visibility == 0) {
                    let h = this.yp.cu(g);
                    let i = h.left + h.width / 2;
                    let j = h.top + h.height / 2;
                    let k = (e - i) * (e - i) + (f - j) * (f - j);
                    if (k < c) {
                        c = k;
                        b = g;
                    }
                }
            });
            if (b != null) {
                return b.ak;
            }
            return -1;
        }
        v6(a, b, c) {
            if (this.xAxis == null || this.yAxis == null || this.y9 == null || this.za == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            let d = this.ct.by;
            let e = this.ct.bx;
            let f = this.getEffectiveViewport();
            let g = new ScalerParams(0, d, e, this.xAxis.ch, f);
            let h = ((() => {
                let $ret = new ScalerParams(0, d, e, this.yAxis.ch, f);
                $ret.b = this.iw();
                return $ret;
            })());
            if (b) {
                let i = this.ip(a);
                if (i == -1) {
                    return { $type: Point_$type, x: NaN, y: NaN };
                }
                let j = truncate(Math.floor(i));
                let k = truncate(Math.ceil(i));
                if (j < 0) {
                    j = 0;
                }
                if (k < 0) {
                    k = 0;
                }
                if (k > this.dl.count - 1) {
                    k = this.dl.count - 1;
                }
                if (j > this.dl.count - 1) {
                    j = this.dl.count - 1;
                }
                if (k == j) {
                    let l = this.xAxis.ek(this.y9.item(j), g);
                    let m = this.yAxis.ek(this.za.item(j), h);
                    return { $type: Point_$type, x: l, y: m };
                }
                let n = i - Math.floor(i);
                let o = this.xAxis.ek(this.y9.item(j), g);
                let p = this.yAxis.ek(this.za.item(j), h);
                let q = this.xAxis.ek(this.y9.item(k), g);
                let r = this.yAxis.ek(this.za.item(k), h);
                let s = q - o;
                let t = r - p;
                return { $type: Point_$type, x: o + s * n, y: p + t * n };
            }
            else {
                let u = this.j1(a);
                if (u == -1) {
                    return { $type: Point_$type, x: NaN, y: NaN };
                }
                let v = this.xAxis.ek(this.y9.item(u), g);
                let w = this.yAxis.ek(this.za.item(u), h);
                return { $type: Point_$type, x: v, y: w };
            }
        }
        gb(a) {
            let b = this.c9 != null ? this.c9.vl : Rect.empty;
            b = b.copy();
            let c = this.c9 != null ? this.c9.v0 : Rect.empty;
            let d = new Rect(0, 0, 0, 1, 1);
            let e = this.wf(this.ct);
            let f = new ScalerParams(0, d, d, this.xAxis.ch, e);
            let g = ((() => {
                let $ret = new ScalerParams(0, d, d, this.yAxis.ch, e);
                $ret.b = this.iw();
                return $ret;
            })());
            let h = !b.isEmpty && !c.isEmpty && this.dl != null ? this.dl.indexOf(a) : -1;
            let i = this.xAxis != null && this.y9 != null && h < this.y9.count ? this.xAxis.ek(this.y9.item(h), f) : NaN;
            let j = this.yAxis != null && this.za != null && h < this.za.count ? this.yAxis.ek(this.za.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.c1 != null) {
                this.c1.au(this.c9, b, true);
            }
            return h >= 0;
        }
        sk(a, b) {
            this.rn(false);
        }
        sl(a, b) {
            this.rn(false);
        }
        yt() {
            let a = this.ys;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                a = this.yw;
            }
            return a;
        }
        aaw(a, b, c, d, e) {
            b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
            let f = this.getEffectiveViewport1(a);
            let g = this.dl;
            let h;
            let i;
            let j = ((() => {
                let $ret = new ScalerParams(0, d, e, this.yo.d, f);
                $ret.c = this.getEffectiveViewport1(a);
                return $ret;
            })());
            let k = ((() => {
                let $ret = new ScalerParams(0, d, e, this.yo.e, f);
                $ret.c = this.getEffectiveViewport1(a);
                $ret.b = this.iw();
                return $ret;
            })());
            let l = false;
            let m = 0;
            if (this.c9 != null) {
                if (this.c9.fz()) {
                    let n = this.c9.mt(d, j);
                    l = n.c;
                    m = n.d;
                }
            }
            for (let o = 0; o < c; o++) {
                h = this.y9.item(o);
                i = this.za.item(o);
                let p = { $type: Point_$type, x: this.yo.a.ek(h, j), y: this.yo.b.ek(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)) {
                    let q = g.item(o);
                    if (!b.g.containsKey(q)) {
                        let r = { $type: Point_$type, x: h, y: i };
                        let s = { $type: Point_$type, x: p.x, y: p.y };
                        b.g.addItem(q, ((() => {
                            let $ret = new OwnedPoint();
                            $ret.a = q;
                            $ret.b = r;
                            $ret.c = s;
                            return $ret;
                        })()));
                    }
                }
            }
        }
        aa6(a, b) {
            this.ye = null;
            this.yf = null;
            a.j.clear();
            a.n.clear();
            a.h.clear();
            a.l.clear();
            a.i.clear();
            a.k.clear();
            let c = Math.min(this.y9 != null ? this.y9.count : 0, this.za != null ? this.za.count : 0);
            let d = b.by;
            let e = b.bx;
            let f = this.getEffectiveViewport1(b);
            let g = new ScalerParams(0, d, e, this.xAxis.ch, f);
            g.c = this.getEffectiveViewport1(b);
            let h = ((() => {
                let $ret = new ScalerParams(0, d, e, this.yAxis.ch, f);
                $ret.b = this.iw();
                return $ret;
            })());
            h.c = this.getEffectiveViewport1(b);
            if (c < 1) {
                return;
            }
            this.yo = ((() => {
                let $ret = new ScatterAxisInfoCache();
                $ret.a = this.xAxis;
                $ret.b = this.yAxis;
                $ret.d = this.xAxis.ch;
                $ret.e = this.yAxis.ch;
                $ret.c = this.dl;
                return $ret;
            })());
            let i = b;
            if (c <= this.z1) {
                this.aaw(i, a, c, d, e);
            }
            if (this.w8()) {
                b.c0.l(a.j, this.z1, d, e, this.ib);
            }
            let j = ((() => {
                let $ret = new Clipper(0, e, false);
                $ret.i = a.n;
                return $ret;
            })());
            let k = this.wd(b);
            let l = this.xAxis.en(k.left, g);
            let m = this.xAxis.en(k.right, g);
            b.c2.h(a.n, this.trendLineType, this.y9, this.za, this.trendLinePeriod, (n) => this.xAxis.ek(n, g), (n) => this.yAxis.ek(n, h), ((() => {
                let $ret = new TrendResolutionParams();
                $ret.d = this.ib;
                $ret.i = e;
                $ret.h = f;
                $ret.j = d;
                return $ret;
            })()), j, l, m);
            this.aa4(a, b);
        }
        o3(a, b) {
            super.o3(a, b);
            let c = b;
            c.c9(a);
        }
        get_fc() {
            return true;
        }
        y3(a, b, c) {
            return null;
        }
        y4(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.yt();
            let e = this.yp.b1(this.v1(b));
            let f = -1;
            if (e == null) {
                if (a != null) {
                    f = this.dl.indexOf(a);
                }
                else {
                    return null;
                }
            }
            else {
                f = e.ak;
            }
            if (f == -1) {
                return null;
            }
            let g = new HighlightingInfo();
            g.i = this;
            g.g = f;
            g.f = f;
            g.c = false;
            g.d = true;
            if (c != null && c.g == g.g && c.f == g.f) {
                return c;
            }
            return g;
        }
        wn(a, b) {
            if (this.w0 != 1 && this.w0 != 13) {
                let c = this.wy.cv();
                let d = (c.width / 2) + (this.xb / 2);
                let e = (c.height / 2) + (this.xb / 2);
                let f = d;
                let g = d;
                let h = e;
                let i = e;
                if (a == 2 || a == 4) {
                    f = 0;
                }
                if (a == 2 || a == 3) {
                    g = 0;
                }
                if (b == 2 || b == 3) {
                    h = 0;
                }
                if (b == 2 || b == 4) {
                    i = 0;
                }
                return new Thickness(1, f, h, g, i);
            }
            return new Thickness(1, 0, 0, 0, 0);
        }
        y2(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dl.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        de(a, b, c) {
            if (this.eb && this.fx(this.bv) && !c) {
                let d = this.y3(a, b, this.y5);
                this.y5 = d;
                return d;
            }
            else {
                let e = this.y2(a, b, this.y5);
                this.y5 = e;
                return e;
            }
        }
        df(a, b, c) {
            if (this.fx(this.bv) && !c) {
                let d = this.y4(a, b, this.y6);
                this.y6 = d;
                return d;
            }
            else {
                let e = this.y2(a, b, this.y6);
                e.d = true;
                this.y6 = e;
                return e;
            }
        }
        zn() {
            return (this.assigningScatterStyle != null && this.zd) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
        }
        zm() {
            return (this.assigningScatterMarkerStyle != null && this.zc) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
        }
        abh(a, b) {
            this.qt();
            let c = b.bx;
            this.yo = ((() => {
                let $ret = new ScatterAxisInfoCache();
                $ret.a = this.xAxis;
                $ret.b = this.yAxis;
                $ret.d = this.xAxis.ch;
                $ret.e = this.yAxis.ch;
                return $ret;
            })());
            if (this.w8()) {
                b.c0.j(a.j, this.xa);
                if (this.zm()) {
                    this.aax(b, a);
                }
            }
            b.cr();
            let d = ((() => {
                let $ret = new Clipper(1, NaN, c.bottom, NaN, c.top, false);
                $ret.i = b.c2.g$j.an;
                return $ret;
            })());
            b.c2.g$h(a.n, d);
            this.abe(a, b);
        }
        yh(a, b) {
            return this.yi(a, b);
        }
        yi(a, b) {
            if (b < a || a < 0 || a > this.y9.count || b < 0 || b > this.y9.count) {
                return null;
            }
            let c = new Array((b - a) + 1);
            for (let d = a; d <= b; d++) {
                let e = d;
                c[d - a] = this.dl.item(d);
            }
            return c;
        }
        aax(a, b) {
            a.b7 = true;
            this.y1.ay(this, this.zm(), runOn(this, this.yh));
            let c = this.y1.d;
            let d = c != null;
            let e = this.getEffectiveViewport1(a);
            let f = this.dl == null ? 0 : this.dl.count;
            this.yp.cj((g) => {
                if (g._visibility == 0) {
                    let h = g.ak;
                    let i = g.content;
                    if (i == null) {
                        i = new DataContext();
                        g.content = i;
                    }
                    if (d) {
                        this.aa1(h, f, a.q);
                    }
                    this.y1.ac(g, i);
                }
            });
        }
        aa2(a, b, c) {
            let d = this.bv != 1;
            let e = this.cn != 1;
            let f = this.cm != 1;
            this.y1.a0(this.y1.b, a, b, false);
            this.y1.ab(this.h9);
            let g = this.y1.ax;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dl;
            if (d && this.c9 != null) {
                h = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, false);
                g.c = h;
            }
            if (e && this.c9 != null) {
                h = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, false);
                g.d = h;
            }
            if (f && this.c9 != null) {
                h = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, false);
                g.b = h;
            }
            g.h = c;
            this.abc(g);
            this.y1.z(this, h, i, j, c, d, e, f, a < 0);
        }
        aa1(a, b, c) {
            let d = this.bv != 1;
            let e = this.cn != 1;
            let f = this.cm != 1;
            this.y1.a0(this.y1.d, a, b, true);
            this.y1.aa(this.h9);
            let g = this.y1.aw;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dl;
            let l = null;
            let m = null;
            let n = null;
            if (d && this.c9 != null) {
                h = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.c9.dj.isCrossContextHighlight(this)) {
                    l = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.c = h;
            }
            if (e && this.c9 != null) {
                i = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                if (i == null && this.bl != null) {
                    i = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, g.z, g.y, true);
                }
                if (this.c9.dk.isCrossContextHighlight(this)) {
                    m = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            if (f && this.c9 != null) {
                j = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.c9.di.isCrossContextHighlight(this)) {
                    n = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            g.h = c;
            this.abb(g);
            this.y1.y(this, h, i, j, c, d, e, f, g.v, this.c9.dj.totalHighWaterMark, g.x, this.c9.dk.totalHighWaterMark, g.t, this.c9.di.totalHighWaterMark);
        }
        abc(a) {
            if (this.assigningScatterStyle != null && this.zd) {
                this.assigningScatterStyle(this, a);
            }
        }
        abb(a) {
            if (this.assigningScatterMarkerStyle != null && this.zc) {
                this.assigningScatterMarkerStyle(this, a);
            }
        }
        aa4(a, b) {
            let c = new ErrorBarsHelper(this, b);
            if (this.yq == null) {
                return;
            }
            let d = this.yq.u;
            let e = this.yq.v;
            let f = 0;
            let g = 0;
            let h = 0;
            let i = 0;
            for (let j of fromEnum(a.j.keys)) {
                let k = a.j.item(j);
                if (d != null) {
                    switch (d.getCalculatorType()) {
                        case 1:
                            let l = this.aa7(k, c, d, h, i, true);
                            h = l.p3;
                            i = l.p4;
                            break;
                        case 0:
                            let m = this.aa5(k, c, d, h, i, true);
                            h = m.p3;
                            i = m.p4;
                            break;
                        case 2:
                            let n = this.aa3(k, c, d, j, h, i, true);
                            h = n.p4;
                            i = n.p5;
                            break;
                        case 3:
                            let o = this.aa8(c, d, f, h, i, true);
                            f = o.p2;
                            h = o.p3;
                            i = o.p4;
                            break;
                        case 4:
                            let p = this.aa5(k, c, d, h, i, true);
                            h = p.p3;
                            i = p.p4;
                            break;
                    }
                    ;
                    let q = new OwnedPoint();
                    q.c = c.l(d, this.yo.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:
                            let r = this.aa7(k, c, e, h, i, false);
                            h = r.p3;
                            i = r.p4;
                            break;
                        case 0:
                            let s = this.aa5(k, c, e, h, i, false);
                            h = s.p3;
                            i = s.p4;
                            break;
                        case 2:
                            let t = this.aa3(k, c, e, j, h, i, false);
                            h = t.p4;
                            i = t.p5;
                            break;
                        case 3:
                            let u = this.aa8(c, e, g, h, i, false);
                            g = u.p2;
                            h = u.p3;
                            i = u.p4;
                            break;
                        case 4:
                            let v = this.aa5(k, c, e, h, i, false);
                            h = v.p3;
                            i = v.p4;
                            break;
                    }
                    ;
                    let w = new OwnedPoint();
                    w.c = c.m(e, this.yo.b, k.c, g);
                    w.a = k.a;
                    a.l.addItem(j, w);
                    a.k.addItem(j, [h, i]);
                }
            }
        }
        aa7(a, b, c, d, e, f) {
            if (f) {
                let g;
                let h, i;
                i = this.yo.a;
                if (this.yq.s == 0) {
                    g = a.c.x;
                    h = this.yo.a;
                }
                else {
                    g = a.c.y;
                    h = this.yo.b;
                }
                let j = b.f(g, c, h, i, d, e);
                d = j.p4;
                e = j.p5;
            }
            else {
                let k;
                let l, m;
                m = this.yo.b;
                if (this.yq.t == 0) {
                    k = a.c.x;
                    l = this.yo.a;
                }
                else {
                    k = a.c.y;
                    l = this.yo.b;
                }
                let n = b.f(k, c, l, m, d, e);
                d = n.p4;
                e = n.p5;
            }
            return {
                p3: d,
                p4: e
            };
        }
        aa5(a, b, c, d, e, f) {
            if (f) {
                let g = b.j(a.c.x, c, this.yo.a, d, e);
                d = g.p3;
                e = g.p4;
            }
            else {
                let h = b.j(a.c.y, c, this.yo.b, d, e);
                d = h.p3;
                e = h.p4;
            }
            return {
                p3: d,
                p4: e
            };
        }
        aa3(a, b, c, d, e, f, g) {
            let h = c.getItemColumn();
            let i = this.dl.indexOf(d);
            if (h != null && i < h.count) {
                let j = h.item(i);
                if (g) {
                    let k = b.h(a.c.x, j, this.yo.a, e, f);
                    e = k.p3;
                    f = k.p4;
                }
                else {
                    let l = b.h(a.c.y, j, this.yo.b, e, f);
                    e = l.p3;
                    f = l.p4;
                }
            }
            else {
                e = NaN;
                f = NaN;
            }
            return {
                p4: e,
                p5: f
            };
        }
        aa8(a, b, c, d, e, f) {
            let g = a.i(b, c);
            c = g.p1;
            if (f) {
                let h = a.k(c, b, this.yo.a, d, e);
                d = h.p3;
                e = h.p4;
            }
            else {
                let i = a.k(c, b, this.yo.b, d, e);
                d = i.p3;
                e = i.p4;
            }
            return {
                p2: c,
                p3: d,
                p4: e
            };
        }
        abe(a, b) {
            if (!b.o() || this.yq == null) {
                b.db();
                return;
            }
            this.abf(a, b);
            this.abg(a, b);
        }
        abf(a, b) {
            b.c7();
            let c = new ErrorBarsHelper(this, b);
            let d = new PathGeometry();
            let e = this.yq.u;
            for (let f of fromEnum(a.j.keys)) {
                if (e != null && a.i.containsKey(f)) {
                    let g = a.i.item(f)[0];
                    let h = a.i.item(f)[1];
                    if (!isNaN_(g) && !isNaN_(h)) {
                        let i = a.h.item(f).c;
                        if (this.yq.o == 1 || this.yq.o == 2) {
                            c.d(d, i, g, true);
                        }
                        if (this.yq.o == 1 || this.yq.o == 3) {
                            c.d(d, i, h, false);
                        }
                    }
                }
            }
            b.dc(d);
        }
        abg(a, b) {
            b.c8();
            let c = new ErrorBarsHelper(this, b);
            let d = new PathGeometry();
            let e = this.yq.v;
            for (let f of fromEnum(a.j.keys)) {
                if (e != null && a.k.containsKey(f)) {
                    let g = a.k.item(f)[0];
                    let h = a.k.item(f)[1];
                    if (!isNaN_(g) && !isNaN_(h)) {
                        let i = a.l.item(f).c;
                        if (this.yq.p == 1 || this.yq.p == 2) {
                            c.e(d, i, g, true);
                        }
                        if (this.yq.p == 1 || this.yq.p == 3) {
                            c.e(d, i, h, false);
                        }
                    }
                }
            }
        }
        hc(a, b, c) {
            let d = true;
            if (!super.hc(a, b, c) || b.isEmpty || a.isEmpty || this.xAxis == null || this.yAxis == null || this.xAxis.bi == null || this.yAxis.bi == null || this.y9 == null || this.za == null || this.y9.count == 0 || this.za.count == 0 || this.dl == null || this.dl.count != this.y9.count || this.dl.count != this.za.count || this.xAxis.bi == null || this.yAxis.bi == null || this.xAxis.ly == this.xAxis.lx || this.yAxis.ly == this.yAxis.lx) {
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            if (!this.acc.isEmpty && !this.acd.isEmpty) {
                a = this.acc;
                b = this.acd;
                return {
                    p0: a,
                    p1: b
                };
            }
            a = this.ct.bx;
            b = this.ct.by;
            return {
                p0: a,
                p1: b
            };
        }
        ro(a) {
            super.ro(a);
            this.aav();
            try {
                if (this.d3(this.ct)) {
                    return;
                }
                if (this.dl != null && this.dl.count > this.z1) {
                    a = false;
                }
                if (this.gd(a) && !this.gp) {
                    let b = this.yu;
                    if (this.d1()) {
                        if (this.da.g) {
                            this.da.t();
                        }
                        this.yu = this.yw;
                        this.yw = b;
                    }
                    else {
                        this.yu = this.ys;
                        this.ys = b;
                    }
                    this.aa6(this.ys, this.yp);
                    this.r1();
                }
                else {
                    if (!this.gp) {
                        this.aa6(this.ys, this.yp);
                    }
                    this.abh(this.ys, this.yp);
                }
            }
            finally {
                this.abi();
            }
        }
        sb() {
            super.sb();
            if (this.index < 0) {
                return;
            }
            this.yp.df();
        }
        rp(a, b) {
            super.rp(a, b);
            if (!this.gy) {
                this.ct.a4(b);
                return;
            }
            this.ct.a4(b);
            if (this.d3(this.cs)) {
                return;
            }
            let c = typeCast(ScatterBaseView.$, this.cs);
            if (!this.gq) {
                this.yv = new ScatterFrame();
                this.aa6(this.yv, c);
            }
            this.gq = false;
            this.abh(this.yv, c);
            this.gy = false;
        }
        rm(a, b, c, d, e) {
            super.rm(a, b, c, d, e);
            let f = this.a9.a$j.item(d);
            let g = f;
            f.a3(c);
            if (this.d3(g)) {
                return;
            }
            if (this.yr == null) {
                this.yr = new ScatterFrame();
            }
            this.aa6(this.yr, g);
            this.abh(this.yr, g);
        }
        abd(a, b) {
            let c = new List$1(Base.$, 0);
            for (let d of fromEnum(b.c)) {
                if (!a.containsKey(d)) {
                    c.add1(d);
                }
            }
            for (let e of fromEnum(c)) {
                b.h(e);
            }
        }
        yg(a, b, c, d, e) {
            if (c == null || c.length != this.yo.c.count) {
                c = new Array(this.yo.c.count);
                for (let f = 0; f < this.yo.c.count; f++) {
                    c[f] = PointUtil.create();
                }
            }
            let g = this.getEffectiveViewport1(a);
            let h = ((() => {
                let $ret = new ScalerParams(0, d, e, this.xAxis.ch, g);
                $ret.c = this.getEffectiveViewport1(a);
                return $ret;
            })());
            let i = ((() => {
                let $ret = new ScalerParams(0, d, e, this.yAxis.ch, g);
                $ret.c = this.getEffectiveViewport1(a);
                $ret.b = this.iw();
                return $ret;
            })());
            let j = this.wd(a);
            let k = this.yo.a.en(j.left, h);
            let l = this.yo.a.en(j.right, h);
            let m = this.yo.b.en(j.bottom, i);
            let n = this.yo.b.en(j.top, i);
            if (this.yo.d) {
                let o = k;
                k = l;
                l = o;
            }
            if (this.yo.e) {
                let p = m;
                m = n;
                n = p;
            }
            let q = this.yo;
            let r = q.a;
            let s = q.b;
            let t;
            let u;
            let v = this.y9;
            let w = this.za;
            let x = false;
            let y = 0;
            let z = 0;
            if (this.c9 != null) {
                if (this.c9.fz()) {
                    let aa = this.c9.mt(d, h);
                    x = aa.c;
                    y = aa.d;
                    z = r.en(0 + y, h);
                    let ab = r.en(0, h);
                    z -= ab;
                }
            }
            for (let ac = 0; ac < this.yo.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.ek(t, h);
                        c[ac].y = s.ek(u, i);
                    }
                    else {
                        if ((t + z) >= k && (t + z) <= l && u >= m && u <= n) {
                            c[ac].x = r.ek(t, h) + y;
                            c[ac].y = s.ek(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.ek(t, h);
                        c[ac].y = s.ek(u, i);
                    }
                    else {
                        c[ac].x = NaN;
                        c[ac].y = NaN;
                    }
                }
            }
            return c;
        }
        zp(a, b) {
            if (b == null) {
                b = new List$1(Number_$type, 2, a.e);
            }
            else {
                b.clear();
            }
            let c = 0;
            let d = this.dl;
            for (let e of fromEnum(a.c)) {
                b.add(d.indexOf(e));
            }
            return b;
        }
        pv(a) {
            super.pv(a);
            this.bb.exportTrendlineData(this, a, this.yp.c2.g$j);
        }
        iw() {
            return Series.ix(this.za, null);
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.kl(c);
            let e = d == null ? NaN : this.iv(d, "XMemberPath");
            let f = d == null ? NaN : this.iv(d, "YMemberPath");
            let g = new DataLegendSeriesValueInfo();
            g.l = e;
            g.a = 13;
            g.q = "X";
            g.r = this.aal != null ? this.aal : "X";
            g.s = this.aah != null ? this.aah : "X:";
            g.t = this.aaj != null ? this.aaj : "";
            let h = new DataLegendSeriesValueInfo();
            h.l = f;
            h.a = 14;
            h.q = "Y";
            h.r = this.aat != null ? this.aat : "Y";
            h.s = this.aap != null ? this.aap : "Y:";
            h.t = this.aar != null ? this.aar : "";
            let i = new DataLegendSeriesContext();
            i.e = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(g);
                $ret.add(h);
                return $ret;
            })());
            i.h = this.ma();
            return i;
        }
        abj() {
            if (this.zb) {
                this.zq = 0;
                this.zr = 0;
                for (let a = 0; a < this.y9.count; a++) {
                    this.zq += this.y9.item(a);
                    this.zr += this.za.item(a);
                }
                this.zs = this.zq / this.y9.count;
                this.zt = this.zr / this.za.count;
                this.zb = false;
            }
        }
        i6(a, b) {
            if (b == null || !b.cj) {
                return NaN;
            }
            if (b != this.xAxis && b != this.yAxis) {
                return NaN;
            }
            let c = this.ap(a);
            if (b.cp) {
                return c[1];
            }
            else {
                return c[0];
            }
        }
        ap(a) {
            let b = NaN;
            let c = NaN;
            switch (a) {
                case 5:
                case 2:
                    b = this.y9.maximum;
                    c = this.za.maximum;
                    break;
                case 4:
                case 1:
                    b = this.y9.minimum;
                    c = this.za.minimum;
                    break;
                case 6:
                case 3:
                    if (this.zb) {
                        this.abj();
                    }
                    b = this.zs;
                    c = this.zt;
                    break;
            }
            return [b, c];
        }
        wa(a) {
            let b = this.getEffectiveViewport1(this.ct);
            let c = new ScalerParams(0, this.ct.by, this.ct.bx, this.xAxis.ch, b);
            c.c = b;
            let d = isNaN_(a[0]) ? NaN : this.xAxis.ek(a[0], c);
            c = new ScalerParams(0, this.ct.by, this.ct.bx, this.yAxis.ch, b);
            c.b = this.iw();
            c.c = b;
            let e = isNaN_(a[1]) ? NaN : this.yAxis.ek(a[1], c);
            return { $type: Point_$type, x: d, y: e };
        }
        v9(a) {
            let b = this.ap(a);
            return this.wa(b);
        }
    }
    ScatterBase.$t = /*@__PURE__*/ markType(ScatterBase, 'ScatterBase', MarkerSeries.$, [ISupportsErrorBars_$type, ITrendLineSeries_$type]);
    ScatterBase.abk = /*@__PURE__*/ DependencyProperty.i("ActualTrendLineBrush", Brush.$, ScatterBase.$, /*@__PURE__*/ new PropertyMetadata(2, null, (a, b) => a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue)));
    ScatterBase.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, ScatterBase, 'raisePropertyChanged', ['ErrorBarSettings:yq:abl', [ScatterErrorBarSettings.$, null], 'HighlightedXMemberPath:z5:abm', [2, null], 'HighlightedYMemberPath:z7:abn', [2, null], 'IsCustomScatterMarkerStyleAllowed:zg:abo', [0, false], 'IsCustomScatterStyleAllowed:zh:abp', [0, false], 'ItemSearchMode:y0:abq', [ScatterItemSearchMode_$type, /*@__PURE__*/ enumGetBox(ScatterItemSearchMode_$type, 0)], 'ItemSearchThreshold:z0:abr', [1, 10000], 'MarkerCollisionAvoidance:yl:abs', [CollisionAvoidanceType_$type, /*@__PURE__*/ enumGetBox(CollisionAvoidanceType_$type, 0)], 'MaximumMarkers:z1:abt', [1, 400], 'XAxis::ab1', [NumericXAxis.$, null], 'XMemberAsLegendLabel:aah:ab2', [2, null], 'XMemberAsLegendUnit:aaj:ab3', [2, null], 'XMemberPath:aal:ab4', [2, null], 'YAxis::ab5', [NumericYAxis.$, null], 'YMemberAsLegendLabel:aap:ab6', [2, null], 'YMemberAsLegendUnit:aar:ab7', [2, null], 'YMemberPath:aat:ab8', [2, null], 'TrendLineType::abz', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness::aby', [1, 1.5], 'TrendLinePeriod::abx', [1, 7], 'TrendLineBrush::abu', [Brush.$, null], 'TrendLineZIndex:z2:ab0', [1, 1001], 'TrendLineDashArray:aca:abv', [DoubleCollection.$], 'TrendLineDashCap:acb:abw', [PenLineCap_$type, /*@__PURE__*/ enumGetBox(PenLineCap_$type, 0)]]);
    return ScatterBase;
})();
/**
 * @hidden
 */
export let ScatterSeriesRenderManager = /*@__PURE__*/ (() => {
    class ScatterSeriesRenderManager extends SeriesRenderManager {
        constructor() {
            super(...arguments);
            this.aw = null;
            this.ax = null;
        }
        c() {
            this.aw = new AssigningScatterMarkerStyleEventArgs();
            return this.aw;
        }
        a() {
            this.ax = new AssigningScatterStyleEventArgs();
            return this.ax;
        }
        ay(a, b, c) {
            this.w(a, b, c);
        }
        az(a, b, c) {
            this.x(a, b, c);
        }
        a0(a, b, c, d) {
            if (b == -1) {
                a.e = false;
                a.z = 0;
                a.y = c - 1;
            }
            else {
                if (d) {
                    a.z = b;
                    a.y = b;
                }
                else {
                    a.e = false;
                    a.z = b;
                    a.y = b;
                }
            }
        }
    }
    ScatterSeriesRenderManager.$t = /*@__PURE__*/ markType(ScatterSeriesRenderManager, 'ScatterSeriesRenderManager', SeriesRenderManager.$);
    return ScatterSeriesRenderManager;
})();
/**
 * @hidden
 */
export let ScatterBaseView = /*@__PURE__*/ (() => {
    class ScatterBaseView extends MarkerSeriesView {
        constructor(a) {
            super(a);
            this.c0 = null;
            this.cy = null;
            this.c1 = null;
            this.c6 = null;
            this.dh = null;
            this.di = null;
            this.c2 = null;
            this.dg = null;
            this.c3 = null;
            this.c1 = a;
            this.c3 = new HashPool$2(Base.$, Marker.$);
            this.cm(this.c3);
            this.c2 = new ScatterTrendLineManager();
        }
        au() {
            super.au();
            this.c0 = this.cz();
            this.dh = new Path();
            this.di = new Path();
            if (!this.q) {
                this.c1.z1 = 2000;
            }
        }
        dj(a) {
            if (this.dg == null) {
                this.dg = new DataTemplateMeasureInfo();
                this.dg.context = this.k.h();
            }
            this.dg.width = a.width;
            this.dg.height = a.height;
            this.dg.data = a.content;
            let b = a.ah;
            if (b.measure != null) {
                b.measure(this.dg);
            }
            return new Size(1, this.dg.width, this.dg.height);
        }
        cz() {
            let a = new NumericMarkerManager(1, (b) => this.c3.item(b), (b) => this.c1.yo.c.item(b), runOn(this, this.de), runOn(this, this.cw), runOn(this, this.c4), () => this.c1.yl);
            a.q = runOn(this, this.dj);
            return a;
        }
        de(a) {
            this.c1.abd(a, this.c3);
        }
        c5() {
            return this.b8;
        }
        cx() {
            return this.cy;
        }
        cw() {
            this.cy = this.c1.yg(this, this.c3, this.cy, this.by, this.bx);
            return this.cy;
        }
        c4() {
            this.c6 = this.c1.zp(this.c3, this.c6);
            return this.c6;
        }
        c7() {
        }
        dc(a) {
        }
        c8() {
        }
        dd(a) {
        }
        df() {
            if (this.c1.trendLineBrush != null) {
                this.c1.ab9 = this.c1.trendLineBrush;
            }
            else {
                this.c1.ab9 = this.c1.u3;
            }
        }
        cj(a) {
            this.c3.f(a);
        }
        da(a) {
            this.c3.g(a);
        }
        db() {
        }
        a7(a, b) {
            super.a7(a, b);
            if (a.d) {
                if (this.c1.trendLineType != 0 && !b) {
                    let c = this.c2.g$j;
                    c.ad = this.c1.trendLineThickness;
                    c._stroke = this.c1.ab9;
                    c.ai = this.c1.aca;
                    c.aj = this.c1.acb;
                    a.v(c);
                }
            }
        }
        c9(a) {
            if (a) {
                this.db();
                this.c3.clear();
            }
            this.c2.g$d();
            this.as();
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'><span";
            let b = this.e.a9.a$u(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            a += ">" + this.c1.title + "</span><br/><span>" + "x: </span><span class='ui-priority-primary'>${item." + this.c1.aal + "}</span><br/><span>" + "y: </span><span class='ui-priority-primary'>${item." + this.c1.aat + "}</span></div>";
            return a;
        }
    }
    ScatterBaseView.$t = /*@__PURE__*/ markType(ScatterBaseView, 'ScatterBaseView', MarkerSeriesView.$);
    return ScatterBaseView;
})();
