/*
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 "./HighlightingInfo";
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 {
        cg() {
            return new ScatterBaseView(this);
        }
        ng() {
            super.ng();
            this.xAxis = null;
            this.yAxis = null;
        }
        o0(a) {
            super.o0(a);
            this.vv = a;
        }
        get_e9() {
            return true;
        }
        ag() {
            return [this.xAxis, this.yAxis];
        }
        ju(a, b) {
            let c = this.lv(b);
            if (c == ScatterBase.$$p[12]) {
                return this.jv(a, b, this.xl);
            }
            if (c == ScatterBase.$$p[16]) {
                return this.jv(a, b, this.xt);
            }
            return null;
        }
        ds(a, b, c, d) {
            if (!this.hasMarkers) {
                return false;
            }
            let e = this.xAxis;
            let f = new ScalerParams(1, this.cy.tn, this.tw, e.ch);
            f.c = this.getEffectiveViewport1(this.cj);
            let g = this.yAxis;
            let h = new ScalerParams(1, this.cy.tn, this.tw, g.ch);
            h.c = this.getEffectiveViewport1(this.cj);
            a.clear();
            this.t9.ci((i) => {
                if (i._visibility == 0) {
                    let j = new SeriesPointOfInterest();
                    let k = i.n;
                    let l = i.o;
                    if (k < this.tw.left || k > this.tw.right || l < this.tw.top || l > this.tw.bottom) {
                        return;
                    }
                    j.b = e.em(k, f);
                    j.c = g.em(l, h);
                    j.a = i.content;
                    a.add(j);
                }
            });
            return true;
        }
        bx() {
            if (this.by == 0) {
                if (this.w1 <= 2000) {
                    return 1;
                }
                else {
                    return super.bx();
                }
            }
            else {
                return super.bx();
            }
        }
        tu(a) {
            if (!this.hasMarkers || !this.uc()) {
                return Rect.empty;
            }
            let b = this.t9.b1(this.tc(a));
            if (b != null) {
                return this.t9.cs(b);
            }
            return Rect.empty;
        }
        f4(a, b) {
            if (this.ud(a, b)) {
                return true;
            }
            return false;
        }
        constructor() {
            super();
            this.vu = null;
            this.v8 = null;
            this.v9 = null;
            this.zc = null;
            this.zd = null;
            this.v3 = 1;
            this.vf = null;
            this.vg = null;
            this.v0 = null;
            this.v2 = null;
            this.vy = null;
            this.we = false;
            this.wd = false;
            this.vq = null;
            this.vr = null;
            this.assigningScatterStyle = null;
            this.assigningScatterMarkerStyle = null;
            this.v7 = null;
            this.v1 = null;
            this.vx = null;
            this.wc = true;
            this.wr = 0;
            this.ws = 0;
            this.wt = 0;
            this.wu = 0;
            this.v4 = this.v5();
            this.v7 = new ScatterSeriesRenderManager();
            this.v1 = new ScatterFrame();
            this.zd = Rect.empty;
            this.zc = Rect.empty;
        }
        get wa() {
            return this.v8;
        }
        set wa(a) {
            if (this.v8 != a) {
                let b = this.wa;
                this.v8 = a;
                this.raisePropertyChanged("XColumn", b, this.wa);
            }
        }
        get wb() {
            return this.v9;
        }
        set wb(a) {
            if (this.v9 != a) {
                let b = this.wb;
                this.v9 = a;
                this.raisePropertyChanged("YColumn", b, this.wb);
            }
        }
        fn() {
            return this.highlightedItemsSource != null || (this.w5 != null && this.w7 != null);
        }
        wp() {
            return false;
        }
        g0() {
            let a = super.g0();
            {
                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.x0));
                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.xz));
                a.add(c);
            }
            if (this.wp()) {
                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.wp()) {
                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.px));
                a.add(e);
            }
            if (!this.wp()) {
                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.px));
                a.add(f);
            }
            return a;
        }
        xz(a, b) {
            if (this.w5 != null) {
                b.value = this.w5;
                return;
            }
            b.value = this.xl;
        }
        x0(a, b) {
            if (this.w7 != null) {
                b.value = this.w7;
                return;
            }
            b.value = this.xt;
        }
        get y9() {
            return this.c(ScatterBase.yk);
        }
        set y9(a) {
            this.h(ScatterBase.yk, a);
        }
        get GetErrorBarsXAxis() {
            return this.xAxis;
        }
        get GetErrorBarsYAxis() {
            return this.yAxis;
        }
        ob() {
            super.ob();
            if (this.xAxis != null) {
                this.xAxis.h8(false);
            }
            if (this.yAxis != null) {
                this.yAxis.h8(false);
            }
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            if (this.vv.c0.g$b(a, b, c, d)) {
                this.pp(false);
                this.ol();
            }
            switch (b) {
                case "FastItemsSource":
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.wa);
                        c.deregisterColumn(this.wb);
                        this.wa = null;
                        this.wb = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.wa = this.c3(this.xl);
                        this.wb = this.c3(this.xt);
                    }
                    if ((this.yAxis != null && !this.yAxis.c1()) || (this.xAxis != null && !this.xAxis.c1())) {
                        this.pp(this.fq && 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.pp(false);
                    }
                    this.ol();
                    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.pp(false);
                    }
                    this.ol();
                    break;
                case ScatterBase.$$p[12]:
                    if (this.c6 != null) {
                        this.c6.deregisterColumn(this.wa);
                        this.wa = this.c3(this.xl);
                    }
                    break;
                case "XColumn":
                    this.vv.c0.g$i();
                    if (this.xAxis != null && !this.xAxis.c1()) {
                        this.pp(this.fq && this.dn);
                    }
                    break;
                case ScatterBase.$$p[16]:
                    if (this.c6 != null) {
                        this.c6.deregisterColumn(this.wb);
                        this.wb = this.c3(this.xt);
                    }
                    break;
                case "YColumn":
                    this.vv.c0.g$i();
                    if (this.yAxis != null && !this.yAxis.c1()) {
                        this.pp(this.fq && this.dn);
                    }
                    break;
                case ScatterBase.$$p[7]:
                    this.pp(false);
                    this.ol();
                    break;
                case ScatterBase.$$p[8]:
                    this.pp(false);
                    this.ol();
                    break;
                case "TransitionProgress":
                    this.v2.c(this.iv, this.v0, this.vy);
                    this.xv();
                    try {
                        if (this.dl(this.cj)) {
                            return;
                        }
                        if ((Math.round(this.iv * 100000) / 100000) == 1) {
                            this.yh(this.vy, this.vv);
                        }
                        else {
                            this.yh(this.v2, this.vv);
                        }
                        if (this.cy != null) {
                            this.cy.on(this);
                        }
                    }
                    finally {
                        this.yi();
                    }
                    break;
                case "TrendLineBrush":
                    this.pe(b);
                    break;
                case ScatterBase.$$p[0]:
                    if (this.vw != null) {
                        this.vw.r = this;
                    }
                    this.pp(false);
                    this.ol();
                    break;
                case "TrendLineType":
                    this.ol();
                    break;
                case ScatterBase.$$p[4]:
                    this.we = this.wm();
                    this.pp(false);
                    break;
                case ScatterBase.$$p[3]:
                    this.wd = this.wl();
                    this.pp(false);
                    break;
                case ScatterBase.$$p[5]:
                    this.v4 = this.v5();
                    break;
            }
        }
        wm() {
            return this.wi;
        }
        wl() {
            return this.wh;
        }
        wg(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        wf(a) {
            if (typeCast(NumericXAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        yi() {
            this.zc = Rect.empty;
            this.zd = Rect.empty;
        }
        xv() {
            let a = this.getViewInfo(this.zc, this.zd);
            this.zc = a.p0;
            this.zd = a.p1;
        }
        wk(a, b) {
            if (b != 3) {
                return true;
            }
            if (a == null) {
                return true;
            }
            if (this.xl == a || this.xt == a) {
                return true;
            }
            return false;
        }
        no(a, b, c, d) {
            let e = false;
            if (!this.wk(d, a)) {
                return;
            }
            this.vv.c0.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.wc = true;
            }
            else if (a == 1) {
                for (let f = b; f < b + c; f++) {
                    this.wr += this.wa.item(f);
                    this.ws += this.wb.item(f);
                }
                this.wt = this.wr / this.wa.count;
                this.wu = this.ws / this.wb.count;
            }
            if (e) {
                this.pp(true);
            }
        }
        x9(a) {
            this.ya(a, null);
        }
        ya(a, b) {
            let c = this.wa != null ? this.wa.count : 0;
            let d = this.wb != null ? this.wb.count : 0;
            let e = Math.min(c, d);
            if (e <= this.w1) {
                a.m.clear();
                let f = new List$1(OwnedPoint.$, 0);
                for (let g of fromEnum(a.u.values)) {
                    f.add(g);
                }
                let h = this.c6;
                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 });
                        }
                    }
                }
            }
        }
        aq(a) {
            if (a != null && a == this.xAxis && this.wa != null) {
                return new AxisRange(this.wa.minimum, this.wa.maximum);
            }
            if (a != null && a == this.yAxis && this.wb != null) {
                return new AxisRange(this.wb.minimum, this.wb.maximum);
            }
            return null;
        }
        jr(a) {
            let b = this.i8(a);
            if (this.c6 != null && b >= 0 && b < this.c6.count) {
                return this.c6.item(b);
            }
            return null;
        }
        get v4() {
            return this.v3;
        }
        set v4(a) {
            let b = this.v3;
            this.v3 = a;
            if (b != this.v3) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.v3));
            }
        }
        v5() {
            if (this.v6 != 0) {
                return this.v6;
            }
            return this.wj ? 4 : 1;
        }
        i8(a) {
            let b = truncate(Math.round(this.hv(a)));
            return b;
        }
        hv(a) {
            switch (this.v4) {
                case 1: return this.wx(a);
                case 3: return this.wy(a);
                case 2: return this.wv(a);
                case 4: return this.ww(a);
            }
            return -1;
        }
        ww(a) {
            return this.wz(a, false);
        }
        wv(a) {
            let b = this.tc(a);
            let c = b.x;
            let d = b.y;
            if (this.c6 == null || this.xAxis == null || this.yAxis == null || this.wa == null || this.wb == null) {
                return -1;
            }
            if (this.c6.count > this.w0) {
                return -1;
            }
            this.xy();
            let e = this.vf;
            let f = this.vg;
            if (e == null || f == null) {
                return -1;
            }
            let g = 1.7976931348623157E+308;
            let h = -1;
            for (let i = 0; i < this.wa.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;
        }
        xy() {
            let a = this.cj.by;
            let b = this.cj.bx;
            let c = this.getEffectiveViewport();
            if (this.vu == null) {
                return;
            }
            let d = new ScalerParams(0, a, b, this.vu.d, c);
            let e = ((() => {
                let $ret = new ScalerParams(0, a, b, this.vu.e, c);
                $ret.b = this.h2();
                return $ret;
            })());
            if (this.vf == null || this.vg == null) {
                let f = arrayShallowClone(this.wa.asArray());
                let g = arrayShallowClone(this.wb.asArray());
                this.xAxis.hn(boxArray$1(f), 0, f.length, d);
                this.yAxis.hn(boxArray$1(g), 0, g.length, e);
                this.vf = f;
                this.vg = g;
            }
        }
        get_wj() {
            return false;
        }
        get wj() {
            return this.get_wj();
        }
        wz(a, b) {
            if (!this.wj) {
                return -1;
            }
            let c = { $type: Point_$type, x: 0, y: 0 };
            let d = true;
            let e = this.vz();
            if (e == null) {
                return -1;
            }
            if (e.m == null) {
                return -1;
            }
            if (this.c6 == null || this.c6.count > this.w0) {
                return -1;
            }
            this.xy();
            let f = this.vf;
            let g = this.vg;
            if (f == null || g == null) {
                return -1;
            }
            let h = this.tc(a);
            let i = 1.7976931348623157E+308;
            let j = -1;
            for (let k = 0; k < this.vf.length; k++) {
                let l = { $type: Point_$type, x: this.vf[k], y: this.vg[k] };
                if (k > 0) {
                    if (!b || e.j.containsKey(this.c6.item(k)) || e.j.containsKey(this.c6.item(k - 1))) {
                        let m = GeometryUtil.d(h, c, l);
                        if (m < i) {
                            i = m;
                            j = k;
                        }
                    }
                }
                c = l;
            }
            if (j >= 0) {
                let n = { $type: Point_$type, x: this.vf[j], y: this.vg[j] };
                let o = { $type: Point_$type, x: this.vf[j - 1], y: this.vg[j - 1] };
                if (!b || (e.j.containsKey(this.c6.item(j)) && e.j.containsKey(this.c6.item(j - 1)))) {
                    let p = GeometryUtil.h(h, o, n);
                    return (j - 1) + p;
                }
                else if (e.j.containsKey(this.c6.item(j))) {
                    return j;
                }
                else {
                    return j - 1;
                }
            }
            return -1;
        }
        wy(a) {
            return this.wz(a, true);
        }
        wx(a) {
            let b = null;
            let c = 1.7976931348623157E+308;
            let d = this.tc(a);
            let e = d.x;
            let f = d.y;
            if (this.vv.c1.e > this.w0) {
                return -1;
            }
            this.vv.c8((g) => {
                if (g._visibility == 0) {
                    let h = this.vv.cs(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;
        }
        th(a, b, c) {
            if (this.xAxis == null || this.yAxis == null || this.wa == null || this.wb == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            let d = this.cj.by;
            let e = this.cj.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.h2();
                return $ret;
            })());
            if (b) {
                let i = this.hv(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.c6.count - 1) {
                    k = this.c6.count - 1;
                }
                if (j > this.c6.count - 1) {
                    j = this.c6.count - 1;
                }
                if (k == j) {
                    let l = this.xAxis.ej(this.wa.item(j), g);
                    let m = this.yAxis.ej(this.wb.item(j), h);
                    return { $type: Point_$type, x: l, y: m };
                }
                let n = i - Math.floor(i);
                let o = this.xAxis.ej(this.wa.item(j), g);
                let p = this.yAxis.ej(this.wb.item(j), h);
                let q = this.xAxis.ej(this.wa.item(k), g);
                let r = this.yAxis.ej(this.wb.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.i8(a);
                if (u == -1) {
                    return { $type: Point_$type, x: NaN, y: NaN };
                }
                let v = this.xAxis.ej(this.wa.item(u), g);
                let w = this.yAxis.ej(this.wb.item(u), h);
                return { $type: Point_$type, x: v, y: w };
            }
        }
        fo(a) {
            let b = this.cy != null ? this.cy.tn : Rect.empty;
            b = b.copy();
            let c = this.cy != null ? this.cy.t2 : Rect.empty;
            let d = new Rect(0, 0, 0, 1, 1);
            let e = this.tq(this.cj);
            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.h2();
                return $ret;
            })());
            let h = !b.isEmpty && !c.isEmpty && this.c6 != null ? this.c6.indexOf(a) : -1;
            let i = this.xAxis != null && this.wa != null && h < this.wa.count ? this.xAxis.ej(this.wa.item(h), f) : NaN;
            let j = this.yAxis != null && this.wb != null && h < this.wb.count ? this.yAxis.ej(this.wb.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.cr != null) {
                this.cr.au(this.cy, b, true);
            }
            return h >= 0;
        }
        qm(a, b) {
            this.pp(false);
        }
        qn(a, b) {
            this.pp(false);
        }
        vz() {
            let a = this.vy;
            if (this.dj()) {
                if (this.cz.g) {
                    this.cz.t();
                }
                a = this.v2;
            }
            return a;
        }
        xw(a, b, c, d, e) {
            b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
            let f = this.getEffectiveViewport1(a);
            let g = this.c6;
            let h;
            let i;
            let j = ((() => {
                let $ret = new ScalerParams(0, d, e, this.vu.d, f);
                $ret.c = this.getEffectiveViewport1(a);
                return $ret;
            })());
            let k = ((() => {
                let $ret = new ScalerParams(0, d, e, this.vu.e, f);
                $ret.c = this.getEffectiveViewport1(a);
                $ret.b = this.h2();
                return $ret;
            })());
            let l = false;
            let m = 0;
            if (this.cy != null) {
                if (this.cy.fb()) {
                    let n = this.cy.lo(d, j);
                    l = n.c;
                    m = n.d;
                }
            }
            for (let o = 0; o < c; o++) {
                h = this.wa.item(o);
                i = this.wb.item(o);
                let p = { $type: Point_$type, x: this.vu.a.ej(h, j), y: this.vu.b.ej(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;
                        })()));
                    }
                }
            }
        }
        x6(a, b) {
            this.vf = null;
            this.vg = null;
            a.j.clear();
            a.n.clear();
            a.h.clear();
            a.l.clear();
            a.i.clear();
            a.k.clear();
            let c = Math.min(this.wa != null ? this.wa.count : 0, this.wb != null ? this.wb.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.h2();
                return $ret;
            })());
            h.c = this.getEffectiveViewport1(b);
            if (c < 1) {
                return;
            }
            this.vu = ((() => {
                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.c6;
                return $ret;
            })());
            let i = b;
            if (c <= this.w1) {
                this.xw(i, a, c, d, e);
            }
            if (this.uc()) {
                b.cy.l(a.j, this.w1, d, e, this.hj);
            }
            let j = ((() => {
                let $ret = new Clipper(0, e, false);
                $ret.i = a.n;
                return $ret;
            })());
            let k = this.to(b);
            let l = this.xAxis.em(k.left, g);
            let m = this.xAxis.em(k.right, g);
            b.c0.h(a.n, this.trendLineType, this.wa, this.wb, this.trendLinePeriod, (n) => this.xAxis.ej(n, g), (n) => this.yAxis.ej(n, h), ((() => {
                let $ret = new TrendResolutionParams();
                $ret.d = this.hj;
                $ret.h = e;
                $ret.i = d;
                return $ret;
            })()), j, l, m);
            this.x4(a, b);
        }
        nj(a, b) {
            super.nj(a, b);
            let c = b;
            c.c7(a);
        }
        get_es() {
            return true;
        }
        vo(a, b, c) {
            return null;
        }
        vp(a, b, c) {
            let d = this.vz();
            let e = this.vv.b1(this.tc(b));
            let f = -1;
            if (e == null) {
                if (a != null) {
                    f = this.c6.indexOf(a);
                }
                else {
                    return null;
                }
            }
            else {
                f = e.ak;
            }
            if (f == -1) {
                return null;
            }
            let 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;
        }
        ty(a, b) {
            if (this.ua != 1 && this.ua != 13) {
                let c = this.t9.ct();
                let d = (c.width / 2) + (this.uf / 2);
                let e = (c.height / 2) + (this.uf / 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);
        }
        vn(a, b, c) {
            let d = new HighlightingInfo();
            d.b = this;
            d.h = 0;
            d.g = this.c6.count - 1;
            d.d = true;
            if (c != null && c.h == d.h && c.g == d.g) {
                return c;
            }
            return d;
        }
        ax(a, b, c) {
            if (this.du && this.fc(this.bs) && !c) {
                let d = this.vo(a, b, this.vq);
                this.vq = d;
                return d;
            }
            else {
                let e = this.vn(a, b, this.vq);
                this.vq = e;
                return e;
            }
        }
        ay(a, b, c) {
            if (this.fc(this.bs) && !c) {
                let d = this.vp(a, b, this.vr);
                this.vr = d;
                return d;
            }
            else {
                let e = this.vn(a, b, this.vr);
                e.e = true;
                this.vr = e;
                return e;
            }
        }
        wo() {
            return (this.assigningScatterStyle != null && this.we) || (this.bs != 1);
        }
        wn() {
            return (this.assigningScatterMarkerStyle != null && this.wd) || (this.bs != 1);
        }
        yh(a, b) {
            this.ow();
            let c = b.bx;
            this.vu = ((() => {
                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.uc()) {
                b.cy.j(a.j, this.ue);
                if (this.wn()) {
                    this.xx(b, a);
                }
            }
            b.cp();
            let d = ((() => {
                let $ret = new Clipper(1, NaN, c.bottom, NaN, c.top, false);
                $ret.i = b.c0.g$j.an;
                return $ret;
            })());
            b.c0.g$h(a.n, d);
            this.ye(a, b);
        }
        vi(a, b) {
            return this.vj(a, b);
        }
        vj(a, b) {
            if (b < a || a < 0 || a > this.wa.count || b < 0 || b > this.wa.count) {
                return null;
            }
            let c = new Array((b - a) + 1);
            for (let d = a; d <= b; d++) {
                let e = d;
                c[d - a] = this.c6.item(d);
            }
            return c;
        }
        xx(a, b) {
            a.b6 = true;
            this.v7.ay(this, this.wn(), runOn(this, this.vi));
            let c = this.v7.d;
            let d = c != null;
            let e = this.getEffectiveViewport1(a);
            let f = this.c6 == null ? 0 : this.c6.count;
            this.vv.ci((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.x1(h, f, a.q);
                    }
                    this.v7.ac(g, i);
                }
            });
        }
        x2(a, b, c) {
            let d = this.bs != 1;
            this.v7.a0(this.v7.b, a, b, false);
            this.v7.ab(this.hh);
            let e = this.v7.ax;
            let f = null;
            let g = this.c6;
            if (d && this.cy != null) {
                f = this.cy.a7.getHighlightingInfo(this, g, e.o, e.n, false);
                e.b = f;
            }
            e.f = c;
            this.yc(e);
            this.v7.z(this, f, c, d, a < 0);
        }
        x1(a, b, c) {
            let d = this.bs != 1;
            this.v7.a0(this.v7.d, a, b, true);
            this.v7.aa(this.hh);
            let e = this.v7.aw;
            let f = null;
            let g = this.c6;
            let h = null;
            if (d && this.cy != null) {
                f = this.cy.a7.getHighlightingInfo(this, g, e.o, e.n, true);
                if (this.cy.a7.isCrossSeriesHighlight(this)) {
                    h = this.cy.a7.getHighlightingInfo(this, g, e.o, e.n, true);
                }
                e.b = f;
            }
            e.f = c;
            this.yb(e);
            this.v7.y(this, f, c, d, e.m, this.cy.a7.totalHighlightingProgress);
        }
        yc(a) {
            if (this.assigningScatterStyle != null && this.we) {
                this.assigningScatterStyle(this, a);
            }
        }
        yb(a) {
            if (this.assigningScatterMarkerStyle != null && this.wd) {
                this.assigningScatterMarkerStyle(this, a);
            }
        }
        x4(a, b) {
            let c = new ErrorBarsHelper(this, b);
            if (this.vw == null) {
                return;
            }
            let d = this.vw.u;
            let e = this.vw.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.x7(k, c, d, h, i, true);
                            h = l.p3;
                            i = l.p4;
                            break;
                        case 0:
                            let m = this.x5(k, c, d, h, i, true);
                            h = m.p3;
                            i = m.p4;
                            break;
                        case 2:
                            let n = this.x3(k, c, d, j, h, i, true);
                            h = n.p4;
                            i = n.p5;
                            break;
                        case 3:
                            let o = this.x8(c, d, f, h, i, true);
                            f = o.p2;
                            h = o.p3;
                            i = o.p4;
                            break;
                        case 4:
                            let p = this.x5(k, c, d, h, i, true);
                            h = p.p3;
                            i = p.p4;
                            break;
                    }
                    ;
                    let q = new OwnedPoint();
                    q.c = c.l(d, this.vu.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.x7(k, c, e, h, i, false);
                            h = r.p3;
                            i = r.p4;
                            break;
                        case 0:
                            let s = this.x5(k, c, e, h, i, false);
                            h = s.p3;
                            i = s.p4;
                            break;
                        case 2:
                            let t = this.x3(k, c, e, j, h, i, false);
                            h = t.p4;
                            i = t.p5;
                            break;
                        case 3:
                            let u = this.x8(c, e, g, h, i, false);
                            g = u.p2;
                            h = u.p3;
                            i = u.p4;
                            break;
                        case 4:
                            let v = this.x5(k, c, e, h, i, false);
                            h = v.p3;
                            i = v.p4;
                            break;
                    }
                    ;
                    let w = new OwnedPoint();
                    w.c = c.m(e, this.vu.b, k.c, g);
                    w.a = k.a;
                    a.l.addItem(j, w);
                    a.k.addItem(j, [h, i]);
                }
            }
        }
        x7(a, b, c, d, e, f) {
            if (f) {
                let g;
                let h, i;
                i = this.vu.a;
                if (this.vw.s == 0) {
                    g = a.c.x;
                    h = this.vu.a;
                }
                else {
                    g = a.c.y;
                    h = this.vu.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.vu.b;
                if (this.vw.t == 0) {
                    k = a.c.x;
                    l = this.vu.a;
                }
                else {
                    k = a.c.y;
                    l = this.vu.b;
                }
                let n = b.f(k, c, l, m, d, e);
                d = n.p4;
                e = n.p5;
            }
            return {
                p3: d,
                p4: e
            };
        }
        x5(a, b, c, d, e, f) {
            if (f) {
                let g = b.j(a.c.x, c, this.vu.a, d, e);
                d = g.p3;
                e = g.p4;
            }
            else {
                let h = b.j(a.c.y, c, this.vu.b, d, e);
                d = h.p3;
                e = h.p4;
            }
            return {
                p3: d,
                p4: e
            };
        }
        x3(a, b, c, d, e, f, g) {
            let h = c.getItemColumn();
            let i = this.c6.indexOf(d);
            if (h != null && i < h.count) {
                let j = h.item(i);
                if (g) {
                    let k = b.h(a.c.x, j, this.vu.a, e, f);
                    e = k.p3;
                    f = k.p4;
                }
                else {
                    let l = b.h(a.c.y, j, this.vu.b, e, f);
                    e = l.p3;
                    f = l.p4;
                }
            }
            else {
                e = NaN;
                f = NaN;
            }
            return {
                p4: e,
                p5: f
            };
        }
        x8(a, b, c, d, e, f) {
            let g = a.i(b, c);
            c = g.p1;
            if (f) {
                let h = a.k(c, b, this.vu.a, d, e);
                d = h.p3;
                e = h.p4;
            }
            else {
                let i = a.k(c, b, this.vu.b, d, e);
                d = i.p3;
                e = i.p4;
            }
            return {
                p2: c,
                p3: d,
                p4: e
            };
        }
        ye(a, b) {
            if (!b.o() || this.vw == null) {
                b.c9();
                return;
            }
            this.yf(a, b);
            this.yg(a, b);
        }
        yf(a, b) {
            b.c5();
            let c = new ErrorBarsHelper(this, b);
            let d = new PathGeometry();
            let e = this.vw.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.vw.o == 1 || this.vw.o == 2) {
                            c.d(d, i, g, true);
                        }
                        if (this.vw.o == 1 || this.vw.o == 3) {
                            c.d(d, i, h, false);
                        }
                    }
                }
            }
            b.da(d);
        }
        yg(a, b) {
            b.c6();
            let c = new ErrorBarsHelper(this, b);
            let d = new PathGeometry();
            let e = this.vw.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.vw.p == 1 || this.vw.p == 2) {
                            c.e(d, i, g, true);
                        }
                        if (this.vw.p == 1 || this.vw.p == 3) {
                            c.e(d, i, h, false);
                        }
                    }
                }
            }
        }
        gl(a, b, c) {
            let d = true;
            if (!super.gl(a, b, c) || b.isEmpty || a.isEmpty || this.xAxis == null || this.yAxis == null || this.xAxis.bi == null || this.yAxis.bi == null || this.wa == null || this.wb == null || this.wa.count == 0 || this.wb.count == 0 || this.c6 == null || this.c6.count != this.wa.count || this.c6.count != this.wb.count || this.xAxis.bi == null || this.yAxis.bi == null || this.xAxis.lx == this.xAxis.lw || this.yAxis.lx == this.yAxis.lw) {
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            if (!this.zc.isEmpty && !this.zd.isEmpty) {
                a = this.zc;
                b = this.zd;
                return {
                    p0: a,
                    p1: b
                };
            }
            a = this.cj.bx;
            b = this.cj.by;
            return {
                p0: a,
                p1: b
            };
        }
        pq(a) {
            super.pq(a);
            this.xv();
            try {
                if (this.dl(this.cj)) {
                    return;
                }
                if (this.c6 != null && this.c6.count > this.w1) {
                    a = false;
                }
                if (this.fp(a) && !this.f0) {
                    let b = this.v0;
                    if (this.dj()) {
                        if (this.cz.g) {
                            this.cz.t();
                        }
                        this.v0 = this.v2;
                        this.v2 = b;
                    }
                    else {
                        this.v0 = this.vy;
                        this.vy = b;
                    }
                    this.x6(this.vy, this.vv);
                    this.p3();
                }
                else {
                    if (!this.f0) {
                        this.x6(this.vy, this.vv);
                    }
                    this.yh(this.vy, this.vv);
                }
            }
            finally {
                this.yi();
            }
        }
        qd() {
            super.qd();
            if (this.index < 0) {
                return;
            }
            this.vv.dd();
        }
        pr(a, b) {
            super.pr(a, b);
            if (!this.f8) {
                this.cj.a4(b);
                return;
            }
            this.cj.a4(b);
            if (this.dl(this.ci)) {
                return;
            }
            let c = typeCast(ScatterBaseView.$, this.ci);
            if (!this.f1) {
                this.v1 = new ScatterFrame();
                this.x6(this.v1, c);
            }
            this.f1 = false;
            this.yh(this.v1, c);
            this.f8 = false;
        }
        po(a, b, c, d, e) {
            super.po(a, b, c, d, e);
            let f = this.a7.a$h.item(d);
            let g = f;
            f.a3(c);
            if (this.dl(g)) {
                return;
            }
            if (this.vx == null) {
                this.vx = new ScatterFrame();
            }
            this.x6(this.vx, g);
            this.yh(this.vx, g);
        }
        yd(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);
            }
        }
        vh(a, b, c, d, e) {
            if (c == null || c.length != this.vu.c.count) {
                c = new Array(this.vu.c.count);
                for (let f = 0; f < this.vu.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.h2();
                return $ret;
            })());
            let j = this.to(a);
            let k = this.vu.a.em(j.left, h);
            let l = this.vu.a.em(j.right, h);
            let m = this.vu.b.em(j.bottom, i);
            let n = this.vu.b.em(j.top, i);
            if (this.vu.d) {
                let o = k;
                k = l;
                l = o;
            }
            if (this.vu.e) {
                let p = m;
                m = n;
                n = p;
            }
            let q = this.vu;
            let r = q.a;
            let s = q.b;
            let t;
            let u;
            let v = this.wa;
            let w = this.wb;
            let x = false;
            let y = 0;
            let z = 0;
            if (this.cy != null) {
                if (this.cy.fb()) {
                    let aa = this.cy.lo(d, h);
                    x = aa.c;
                    y = aa.d;
                    z = r.em(0 + y, h);
                    let ab = r.em(0, h);
                    z -= ab;
                }
            }
            for (let ac = 0; ac < this.vu.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.ej(t, h);
                        c[ac].y = s.ej(u, i);
                    }
                    else {
                        if ((t + z) >= k && (t + z) <= l && u >= m && u <= n) {
                            c[ac].x = r.ej(t, h) + y;
                            c[ac].y = s.ej(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.ej(t, h);
                        c[ac].y = s.ej(u, i);
                    }
                    else {
                        c[ac].x = NaN;
                        c[ac].y = NaN;
                    }
                }
            }
            return c;
        }
        wq(a, b) {
            if (b == null) {
                b = new List$1(Number_$type, 2, a.e);
            }
            else {
                b.clear();
            }
            let c = 0;
            let d = this.c6;
            for (let e of fromEnum(a.c)) {
                b.add(d.indexOf(e));
            }
            return b;
        }
        n1(a) {
            super.n1(a);
            this.a9.exportTrendlineData(this, a, this.vv.c0.g$j);
        }
        h2() {
            return Series.h3(this.wb, null);
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.jr(c);
            let e = d == null ? NaN : this.h1(d, "XMemberPath");
            let f = d == null ? NaN : this.h1(d, "YMemberPath");
            let g = new DataLegendSeriesValueInfo();
            g.l = e;
            g.a = 13;
            g.p = "X";
            g.q = this.xl != null ? this.xl : "X";
            g.r = this.xh != null ? this.xh : "X:";
            g.s = this.xj != null ? this.xj : "";
            let h = new DataLegendSeriesValueInfo();
            h.l = f;
            h.a = 14;
            h.p = "Y";
            h.q = this.xt != null ? this.xt : "Y";
            h.r = this.xp != null ? this.xp : "Y:";
            h.s = this.xr != null ? this.xr : "";
            let i = new DataLegendSeriesContext();
            i.f = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(g);
                $ret.add(h);
                return $ret;
            })());
            i.b = this.aw();
            return i;
        }
        yj() {
            if (this.wc) {
                this.wr = 0;
                this.ws = 0;
                for (let a = 0; a < this.wa.count; a++) {
                    this.wr += this.wa.item(a);
                    this.ws += this.wb.item(a);
                }
                this.wt = this.wr / this.wa.count;
                this.wu = this.ws / this.wb.count;
                this.wc = false;
            }
        }
        ic(a, b) {
            if (b == null || !b.cj) {
                return NaN;
            }
            if (b != this.xAxis && b != this.yAxis) {
                return NaN;
            }
            let c = this.am(a);
            if (b.cp) {
                return c[1];
            }
            else {
                return c[0];
            }
        }
        am(a) {
            let b = NaN;
            let c = NaN;
            switch (a) {
                case 5:
                case 2:
                    b = this.wa.maximum;
                    c = this.wb.maximum;
                    break;
                case 4:
                case 1:
                    b = this.wa.minimum;
                    c = this.wb.minimum;
                    break;
                case 6:
                case 3:
                    if (this.wc) {
                        this.yj();
                    }
                    b = this.wt;
                    c = this.wu;
                    break;
            }
            return [b, c];
        }
        tl(a) {
            let b = this.getEffectiveViewport1(this.cj);
            let c = new ScalerParams(0, this.cj.by, this.cj.bx, this.xAxis.ch, b);
            c.c = b;
            let d = isNaN_(a[0]) ? NaN : this.xAxis.ej(a[0], c);
            c = new ScalerParams(0, this.cj.by, this.cj.bx, this.yAxis.ch, b);
            c.b = this.h2();
            c.c = b;
            let e = isNaN_(a[1]) ? NaN : this.yAxis.ej(a[1], c);
            return { $type: Point_$type, x: d, y: e };
        }
        tk(a) {
            let b = this.am(a);
            return this.tl(b);
        }
    }
    ScatterBase.$t = /*@__PURE__*/ markType(ScatterBase, 'ScatterBase', MarkerSeries.$, [ISupportsErrorBars_$type, ITrendLineSeries_$type]);
    ScatterBase.yk = /*@__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:vw:yl', [ScatterErrorBarSettings.$, null], 'HighlightedXMemberPath:w5:ym', [2, null], 'HighlightedYMemberPath:w7:yn', [2, null], 'IsCustomScatterMarkerStyleAllowed:wh:yo', [0, false], 'IsCustomScatterStyleAllowed:wi:yp', [0, false], 'ItemSearchMode:v6:yq', [ScatterItemSearchMode_$type, /*@__PURE__*/ enumGetBox(ScatterItemSearchMode_$type, 0)], 'ItemSearchThreshold:w0:yr', [1, 10000], 'MarkerCollisionAvoidance:vm:ys', [CollisionAvoidanceType_$type, /*@__PURE__*/ enumGetBox(CollisionAvoidanceType_$type, 0)], 'MaximumMarkers:w1:yt', [1, 400], 'XAxis::y1', [NumericXAxis.$, null], 'XMemberAsLegendLabel:xh:y2', [2, null], 'XMemberAsLegendUnit:xj:y3', [2, null], 'XMemberPath:xl:y4', [2, null], 'YAxis::y5', [NumericYAxis.$, null], 'YMemberAsLegendLabel:xp:y6', [2, null], 'YMemberAsLegendUnit:xr:y7', [2, null], 'YMemberPath:xt:y8', [2, null], 'TrendLineType::yz', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness::yy', [1, 1.5], 'TrendLinePeriod::yx', [1, 7], 'TrendLineBrush::yu', [Brush.$, null], 'TrendLineZIndex:w2:y0', [1, 1001], 'TrendLineDashArray:za:yv', [DoubleCollection.$], 'TrendLineDashCap:zb:yw', [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.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 = /*@__PURE__*/ markType(ScatterSeriesRenderManager, 'ScatterSeriesRenderManager', SeriesRenderManager.$);
    return ScatterSeriesRenderManager;
})();
/**
 * @hidden
 */
export let ScatterBaseView = /*@__PURE__*/ (() => {
    class ScatterBaseView extends MarkerSeriesView {
        constructor(a) {
            super(a);
            this.cy = null;
            this.cw = null;
            this.cz = null;
            this.c4 = null;
            this.df = null;
            this.dg = null;
            this.c0 = null;
            this.de = null;
            this.c1 = null;
            this.cz = a;
            this.c1 = new HashPool$2(Base.$, Marker.$);
            this.ck(this.c1);
            this.c0 = new ScatterTrendLineManager();
        }
        au() {
            super.au();
            this.cy = this.cx();
            this.df = new Path();
            this.dg = new Path();
            if (!this.q) {
                this.cz.w1 = 2000;
            }
        }
        dh(a) {
            if (this.de == null) {
                this.de = new DataTemplateMeasureInfo();
                this.de.context = this.k.h();
            }
            this.de.width = a.width;
            this.de.height = a.height;
            this.de.data = a.content;
            let b = a.ah;
            if (b.measure != null) {
                b.measure(this.de);
            }
            return new Size(1, this.de.width, this.de.height);
        }
        cx() {
            let a = new NumericMarkerManager(1, (b) => this.c1.item(b), (b) => this.cz.vu.c.item(b), runOn(this, this.dc), runOn(this, this.cu), runOn(this, this.c2), () => this.cz.vm);
            a.q = runOn(this, this.dh);
            return a;
        }
        dc(a) {
            this.cz.yd(a, this.c1);
        }
        c3() {
            return this.b7;
        }
        cv() {
            return this.cw;
        }
        cu() {
            this.cw = this.cz.vh(this, this.c1, this.cw, this.by, this.bx);
            return this.cw;
        }
        c2() {
            this.c4 = this.cz.wq(this.c1, this.c4);
            return this.c4;
        }
        c5() {
        }
        da(a) {
        }
        c6() {
        }
        db(a) {
        }
        dd() {
            if (this.cz.trendLineBrush != null) {
                this.cz.y9 = this.cz.trendLineBrush;
            }
            else {
                this.cz.y9 = this.cz.ss;
            }
        }
        ci(a) {
            this.c1.f(a);
        }
        c8(a) {
            this.c1.g(a);
        }
        c9() {
        }
        a7(a, b) {
            super.a7(a, b);
            if (a.d) {
                if (this.cz.trendLineType != 0 && !b) {
                    let c = this.c0.g$j;
                    c.ad = this.cz.trendLineThickness;
                    c._stroke = this.cz.y9;
                    c.ai = this.cz.za;
                    c.aj = this.cz.zb;
                    a.v(c);
                }
            }
        }
        c7(a) {
            if (a) {
                this.c9();
                this.c1.clear();
            }
            this.c0.g$d();
            this.as();
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'><span";
            let b = this.e.a7.a$r(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            a += ">" + this.cz.title + "</span><br/><span>" + "x: </span><span class='ui-priority-primary'>${item." + this.cz.xl + "}</span><br/><span>" + "y: </span><span class='ui-priority-primary'>${item." + this.cz.xt + "}</span></div>";
            return a;
        }
    }
    ScatterBaseView.$t = /*@__PURE__*/ markType(ScatterBaseView, 'ScatterBaseView', MarkerSeriesView.$);
    return ScatterBaseView;
})();
