/*
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 { ScatterBase } from "./ScatterBase";
import { IScaleLegendSeries_$type } from "igniteui-react-core";
import { ISupportsSizeScale_$type } from "./ISupportsSizeScale";
import { ISupportsFillScale_$type } from "./ISupportsFillScale";
import { Base, typeCast, Point_$type, fromEnum, markType, markDep, enumGetBox, runOn } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { UIElement } from "igniteui-react-core";
import { ActualRange } from "./ActualRange";
import { DependencyProperty } from "igniteui-react-core";
import { SizeScale } from "./SizeScale";
import { BrushScale } from "./BrushScale";
import { ScatterFrame } from "./ScatterFrame";
import { IChartLegend_$type } from "igniteui-react-core";
import { ValueBrushScale } from "./ValueBrushScale";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { ScatterBaseView } from "./ScatterBaseView";
import { ScalerParams } from "./ScalerParams";
import { Dictionary$2 } from "igniteui-react-core";
import { OwnedPoint } from "./OwnedPoint";
import { BubbleMarkerManager } from "./BubbleMarkerManager";
import { IChartItemLegend_$type } from "igniteui-react-core";
import { IChartScaleLegend_$type } from "igniteui-react-core";
import { ContentControl } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { DeviceUtils } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_, isInfinity, logBase } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { BrushSelectionMode_$type } from "./BrushSelectionMode";
import { ScatterTrendLineManager } from "./ScatterTrendLineManager";
import { Defaults } from "./Defaults";
/**
 * @hidden
 */
export let BubbleSeries = /*@__PURE__*/ (() => {
    class BubbleSeries extends ScatterBase {
        bi() {
            return new BubbleSeries();
        }
        get_eg() {
            return true;
        }
        cq() {
            return new BubbleSeriesView(this);
        }
        qw(a) {
            super.qw(a);
            this.acg = a;
        }
        jj() {
            return 0.7;
        }
        ws() {
            if (this.wr == 0) {
                return 2;
            }
            return super.ws();
        }
        constructor() {
            super();
            this.ad6 = null;
            this.ad5 = null;
            this.act = null;
            this.acl = null;
            this.ack = null;
            this.acj = null;
            this.ach = null;
            this.ab = BubbleSeries.$;
            this.yt = new ScatterFrame();
            this.yv = new ScatterFrame();
            this.yr = new ScatterFrame();
        }
        isAttachedTo(a) {
            return this.a4 == a;
        }
        ef() {
            return true;
        }
        px(a) {
            super.px(a);
            if (this.aco != null && this.act != null && this.act.count > 0) {
                for (let b = 0; b < this.act.count; b++) {
                    a(this.act._inner[b]);
                }
            }
        }
        get acn() {
            return this.acp;
        }
        get_isColoredItemwise() {
            return this.acm != null && this.acm.count > 0;
        }
        ad4(a) {
            let b = typeCast(CustomPaletteBrushScale.$, this.acf);
            let c = typeCast(ValueBrushScale.$, this.acf);
            let d = this.acf;
            if (b != null && this.dl != null) {
                return b.getBrush1(a, this.dl.count);
            }
            else if (c != null) {
                return c.getBrushByIndex(a, this.acm);
            }
            else if (d != null) {
                return d.getBrush(a);
            }
            return null;
        }
        get legendReady() {
            return this.acp != null && this.acp.count != 0;
        }
        get minScaleText() {
            let a = this.ace(this.aci).b;
            return (Math.round(a * 1000) / 1000).toString();
        }
        get maxScaleText() {
            let a = this.ace(this.aci).a;
            return (Math.round(a * 1000) / 1000).toString();
        }
        forScaleColors(a) {
            for (let b = 0; b < this.acp.count; b++) {
                if (this.acf == null || !this.acf.isReady) {
                    return false;
                }
                let c = NaN;
                if (this.acm != null) {
                    c = (this.acm.item(b) - this.acm.minimum) / (this.acm.maximum - this.acm.minimum);
                }
                let d = (this.acp.item(b) - this.acp.minimum) / (this.acp.maximum - this.acp.minimum);
                if (isNaN_(c)) {
                    c = 0;
                }
                if (isNaN_(d)) {
                    d = c;
                }
                let e = this.x8;
                let f = this.ad4(b);
                let g = f != null ? f : e;
                a(g, d);
            }
            return true;
        }
        ko(a, b) {
            let c = this.na(b);
            if (c == BubbleSeries.$$p[5]) {
                return this.kp(a, b, this.ac8);
            }
            if (c == BubbleSeries.$$p[11]) {
                return this.kp(a, b, this.adi);
            }
            if (c == ScatterBase.$$p[12]) {
                return this.kp(a, b, this.aak);
            }
            if (c == ScatterBase.$$p[16]) {
                return this.kp(a, b, this.aas);
            }
            if (c == BubbleSeries.$$p[2]) {
                return this.kp(a, b, this.ac3);
            }
            return super.ko(a, b);
        }
        ma(a) {
            let b = this.na(a);
            if (b == BubbleSeries.$$p[5]) {
                return this.ac8;
            }
            if (b == BubbleSeries.$$p[11]) {
                return this.adi;
            }
            if (b == ScatterBase.$$p[12]) {
                return this.aak;
            }
            if (b == ScatterBase.$$p[16]) {
                return this.aas;
            }
            if (b == BubbleSeries.$$p[2]) {
                return this.ac3;
            }
            return super.ma(a);
        }
        get acp() {
            return this.acl;
        }
        set acp(a) {
            if (this.acl != a) {
                let b = this.acp;
                this.acl = a;
                this.raisePropertyChanged("RadiusColumn", b, this.acp);
            }
        }
        get aco() {
            return this.ack;
        }
        set aco(a) {
            if (this.ack != a) {
                let b = this.aco;
                this.ack = a;
                this.raisePropertyChanged("LabelColumn", b, this.aco);
            }
        }
        get acm() {
            return this.acj;
        }
        set acm(a) {
            if (this.acj != a) {
                let b = this.acm;
                this.acj = a;
                this.raisePropertyChanged("FillColumn", b, this.acm);
            }
        }
        aav(a, b, c, d, e) {
            if (c <= this.z0) {
                b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
            }
            let f = this.z0;
            let g = this.dl;
            let h;
            let i;
            let j = this.getEffectiveViewport1(a);
            let k = new ScalerParams(0, d, e, this.yn.d, j);
            let l = new ScalerParams(0, d, e, this.yn.e, j);
            let m = false;
            let n = 0;
            if (this.c9 != null) {
                if (this.c9.fz()) {
                    let o = this.c9.mt(d, k);
                    m = o.c;
                    n = o.d;
                }
            }
            for (let p = 0; p < c; p++) {
                h = this.y8.item(p);
                i = this.y9.item(p);
                let q = { $type: Point_$type, x: this.yn.a.ek(h, k), y: this.yn.b.ek(i, l) };
                if (m) {
                    if (q.x < e.left || q.x > e.right) {
                        if (q.x + n >= e.left && q.x + n <= e.right) {
                            q = { $type: Point_$type, x: q.x + n, y: i };
                        }
                    }
                }
                if (!isInfinity(q.x) && !isInfinity(q.y)) {
                    let r = g.item(p);
                    if (c <= f) {
                        if (!b.g.containsKey(r)) {
                            let s = { $type: Point_$type, x: h, y: i };
                            b.g.addItem(r, ((() => {
                                let $ret = new OwnedPoint();
                                $ret.a = r;
                                $ret.b = s;
                                $ret.c = q;
                                return $ret;
                            })()));
                        }
                    }
                }
            }
        }
        aa5(a, b) {
            let c = typeCast(BubbleSeriesView.$, b);
            let d = c.c0;
            d.m = this.acp;
            super.aa5(a, b);
            let e = Math.min(this.y8 != null ? this.y8.count : 0, this.y9 != null ? this.y9.count : 0);
            if (e < 1) {
                return;
            }
            c.dm();
            c.dn();
        }
        adn() {
            if (this.c9 == null) {
                return;
            }
            if (this.a4 == null) {
                return;
            }
            if (this.a4.isItemwise) {
                let a = this.a4;
                this.a4.clearLegendItemsForSeries(this);
                this.adm();
                a.renderItemwiseContent(this);
            }
            if (this.a4.isScale) {
                let b = this.a4;
                b.restoreOriginalState();
                b.initializeLegend(this);
            }
        }
        static acu(a, b, c, d, e) {
            if (e <= a || isNaN_(e) || isInfinity(e)) {
                return c;
            }
            if (e >= b) {
                return d;
            }
            let f = c + ((d - c) / (b - a)) * (e - a);
            return f;
        }
        static acv(a, b, c, d, logBase_, e) {
            let f = logBase(e, logBase_);
            let g = logBase(a, logBase_);
            let h = logBase(b, logBase_);
            return BubbleSeries.acu(g, h, c, d, f);
        }
        hc(a, b, c) {
            let d = super.hc(a, b, c);
            if (this.acp == null || this.dl == null || this.acp.count == 0 || this.dl.count != this.acp.count) {
                d = false;
            }
            return d;
        }
        zi(a, b) {
            if (b != 3) {
                return true;
            }
            if (a == null) {
                return true;
            }
            if (this.aak == a || this.aas == a || this.adi == a) {
                return true;
            }
            return false;
        }
        adm() {
            let a = typeCast(IChartLegend_$type, this.a4);
            if (a == null || this.dl == null) {
                return;
            }
            this.act = new List$1(UIElement.$, 0);
            let b = typeCast(CustomPaletteBrushScale.$, this.acf);
            let c = typeCast(ValueBrushScale.$, this.acf);
            let d = this.acf;
            let e = this.acd();
            let f = e.b;
            let g = e.a;
            let h = this.dl;
            for (let i = 0; i < h.count; i++) {
                let j = null;
                if (c != null && this.acm != null) {
                    let k = this.acm.item(i);
                    j = c.getBrushByRange(k, f, g);
                }
                else if (b != null) {
                    j = b.getBrush1(i, h.count);
                }
                else if (d != null) {
                    j = d.getBrush(i);
                }
                let l = new ContentControl();
                let m = this.aco != null && this.aco.item(i) != null ? this.aco.item(i).toString() : "";
                l.content = ((() => {
                    let $ret = new DataContext();
                    $ret.series = this;
                    $ret.item = h.item(i);
                    $ret.itemBrush = j;
                    $ret.itemLabel = m;
                    return $ret;
                })());
                let n = this.sq;
                if (n == null) {
                    n = this.ct.bn(this.cy);
                }
                l.ah = n;
                this.act.add(l);
            }
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            if (this.aci != null) {
                this.aci.aa();
            }
            if (this.acf != null) {
                this.acf.x();
            }
            this.adn();
        }
        p8() {
            super.p8();
            this.adn();
        }
        qf() {
            super.qf();
            this.adn();
        }
        q4(a, b, c, d) {
            super.q4(a, b, c, d);
            switch (b) {
                case ScatterBase.$$p[10]:
                case ScatterBase.$$p[14]:
                case ScatterBase.$$p[11]:
                case ScatterBase.$$p[15]:
                case BubbleSeries.$$p[9]:
                case BubbleSeries.$$p[10]:
                    this.qa();
                    break;
                case "FastItemsSource":
                    if (this.aci != null) {
                        this.aci.aa();
                    }
                    if (this.acf != null) {
                        this.acf.x();
                    }
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.acp);
                        c.deregisterColumn(this.acm);
                        c.deregisterColumn(this.aco);
                        this.acp = null;
                        this.acm = null;
                        this.aco = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.acp = this.di(this.adi);
                        if (!stringIsNullOrEmpty(this.ac3)) {
                            this.acm = this.di(this.ac3);
                        }
                        this.aco = this.dk(this.ac8);
                    }
                    this.rm(false);
                    this.adn();
                    break;
                case BubbleSeries.$$p[11]:
                    if (this.aci != null) {
                        this.aci.aa();
                    }
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.acp);
                        this.acp = this.di(this.adi);
                        this.adn();
                    }
                    break;
                case "RadiusColumn":
                    if (this.aci != null) {
                        this.aci.aa();
                    }
                    this.yo.c2.g$i();
                    this.rm(this.ge && this.d5);
                    this.qh();
                    break;
                case BubbleSeries.$$p[12]:
                    if (c != null) {
                        c.l.remove(this);
                        c.aa();
                    }
                    if (d != null) {
                        d.l.add(this);
                        d.aa();
                    }
                    this.rm(false);
                    this.qg();
                    break;
                case BubbleSeries.$$p[13]:
                    this.rm(false);
                    this.qg();
                    break;
                case "DiscreteLegendItemTemplate":
                    this.adn();
                    break;
                case BubbleSeries.$$p[3]:
                    if (c != null) {
                        c.o.remove(this);
                        c.x();
                    }
                    if (d != null) {
                        d.o.add(this);
                        d.x();
                    }
                    this.rm(false);
                    this.adn();
                    this.qg();
                    break;
                case BubbleSeries.$$p[4]:
                case BubbleSeries.$$p[8]:
                case BubbleSeries.$$p[7]:
                case BubbleSeries.$$p[6]:
                    this.rm(false);
                    this.adn();
                    this.qg();
                    break;
                case "FillColumn":
                    this.rm(this.ge && this.d5);
                    this.qg();
                    break;
                case BubbleSeries.$$p[2]:
                    if (this.acf != null) {
                        this.acf.x();
                    }
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.acm);
                        this.acm = this.di(this.ac3);
                        this.adn();
                    }
                    break;
                case BubbleSeries.$$p[5]:
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.aco);
                        this.aco = this.dk(this.ac8);
                        this.adn();
                    }
                    break;
                case "ActualLegend":
                    let e = typeCast(IChartLegend_$type, c);
                    if (e != null && e.isItemwise) {
                        let f = typeCast(IChartItemLegend_$type, e);
                        f.clearLegendItemsForSeries(this);
                    }
                    if (e != null && e.isScale) {
                        let g = typeCast(IChartScaleLegend_$type, e);
                        let h = true;
                        let i = null;
                        if (this.c9 != null) {
                            for (let j of fromEnum(this.c9.series)) {
                                if (j.legend == g) {
                                    i = j;
                                    h = false;
                                }
                            }
                        }
                        if (h) {
                            g.restoreOriginalState();
                        }
                        else {
                            g.initializeLegend(typeCast(IScaleLegendSeries_$type, i));
                        }
                    }
                    this.adn();
                    break;
                case "SeriesViewer":
                    this.adn();
                    break;
            }
        }
        updateSizeScaleGlobals() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.acp != null) {
                a.b = this.acp.minimum;
                a.a = this.acp.maximum;
            }
            if (this.aci != null) {
                this.aci.ab(a.b, a.a);
            }
        }
        updateFillScaleGlobals() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.acm != null) {
                a.b = this.acm.minimum;
                a.a = this.acm.maximum;
            }
            if (this.acf != null) {
                this.acf.z(a.b, a.a);
            }
        }
        ace(a) {
            let b = new ActualRange();
            b.b = NaN;
            b.a = NaN;
            if (this.acp != null) {
                b.b = this.acp.minimum;
                b.a = this.acp.maximum;
            }
            if (a != null) {
                a.x();
                if (this.acs) {
                    b.b = a.globalMinimum;
                    b.a = a.globalMaximum;
                }
            }
            return b;
        }
        acd() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.acm != null) {
                a.b = this.acm.minimum;
                a.a = this.acm.maximum;
            }
            let b = typeCast(ValueBrushScale.$, this.acf);
            if (b != null) {
                b.s();
                if (this.acq && this.acf.o.count > 1) {
                    a.b = b.q;
                    a.a = b.p;
                }
            }
            return a;
        }
        adp(a, b, c, d) {
            let e = c.width;
            if (!this.ct.bx.isEmpty) {
                e = this.ct.bx.width;
            }
            else if (this.c9 != null && !this.c9.v0.isEmpty) {
                e = this.c9.v0.width;
            }
            let f = DeviceUtils.c(e);
            this.ach = this.aci || ((() => {
                let $ret = new SizeScale();
                $ret.minimumValue = f / 10;
                $ret.maximumValue = f / 5;
                return $ret;
            })());
            if (this.ach != null) {
                let g = this.ach.minimumValue;
                let h = this.ach.maximumValue;
                let i = this.ach.logarithmBase;
                let j = this.ace(this.ach);
                let k = j.b;
                let l = j.a;
                if (this.ach.isLogarithmic) {
                    for (let m = 0; m < b.count; m++) {
                        b._inner[m] = BubbleSeries.acv(k, l, g, h, i, b._inner[m]);
                    }
                }
                else {
                    for (let n = 0; n < b.count; n++) {
                        b._inner[n] = BubbleSeries.acu(k, l, g, h, b._inner[n]);
                    }
                }
            }
            let o = 1;
            o = DeviceUtils.d();
            let p = this.aci == null;
            if (d) {
                let q = c.width / e;
                for (let r = 0; r < b.count; r++) {
                    if (p) {
                        b._inner[r] = b._inner[r] / o;
                    }
                    b._inner[r] = b._inner[r] * q;
                }
            }
            for (let s = 0; s < a.count; s++) {
                let t = a._inner[s];
                if (p && !d) {
                    t.width = Math.max(0, b._inner[s] / o);
                    t.height = Math.max(0, b._inner[s] / o);
                }
                else {
                    t.width = Math.max(0, b._inner[s]);
                    t.height = Math.max(0, b._inner[s]);
                }
            }
        }
        ado(a) {
            let b = typeCast(BubbleSeriesView.$, this.cs);
            this.acg.b7 = false;
            if (b != null) {
                b.b7 = false;
            }
            let c = typeCast(CustomPaletteBrushScale.$, this.acf);
            let d = typeCast(ValueBrushScale.$, this.acf);
            let e = this.acf;
            let f = this.acd();
            let g = f.b;
            let h = f.a;
            let i = this.acf == null || !this.acf.isReady || (d != null && this.ac3 == null);
            if (i) {
                this.acg.dl();
                if (b != null) {
                    b.dl();
                }
                return;
            }
            this.acg.b7 = true;
            if (b != null) {
                b.b7 = true;
            }
            let j = a.count;
            let k = this.dl;
            for (let l = 0; l < j; l++) {
                let m = a._inner[l];
                let n = typeCast(DataContext.$, m.content);
                if (n != null) {
                    let o = null;
                    let p = k.indexOf(n.item);
                    if (c != null) {
                        o = c.getBrush1(p, k.count);
                    }
                    else if (d != null && this.acm != null) {
                        let q = this.acm.item(p);
                        o = d.getBrushByRange(q, g, h);
                    }
                    else if (e != null) {
                        o = e.getBrush(p);
                    }
                    else {
                        if (this.ya == null) {
                            o = this.x8;
                        }
                        else {
                            o = this.ya;
                        }
                    }
                    let r = null;
                    if (this.yb == null) {
                        r = this.x9;
                    }
                    else {
                        r = this.yb;
                    }
                    if (this.acr && o != null) {
                        r = o;
                    }
                    if (r != null && !isNaN_(this.acx)) {
                        r = BrushUtil.m(r, this.acx);
                    }
                    if (o != null && !isNaN_(this.acw)) {
                        o = BrushUtil.m(o, this.acw);
                    }
                    n.itemBrush = o;
                    n.actualItemBrush = o;
                    n.outline = r;
                }
            }
        }
        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.a = 13;
            g.l = e;
            g.q = "X";
            g.r = this.aak != null ? this.aak : "X";
            g.s = this.aag != null ? this.aag : "X:";
            g.t = this.aai != null ? this.aai : "";
            let h = new DataLegendSeriesValueInfo();
            h.l = f;
            h.a = 14;
            h.q = "Y";
            h.r = this.aas != null ? this.aas : "Y";
            h.s = this.aao != null ? this.aao : "Y:";
            h.t = this.aaq != null ? this.aaq : "";
            let i = new DataLegendSeriesContext();
            i.e = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(g);
                $ret.add(h);
                return $ret;
            })());
            i.h = this.l9();
            if (!stringIsNullOrEmpty(this.adi)) {
                let j = d == null ? NaN : this.iv(d, "RadiusMemberPath");
                let k = new DataLegendSeriesValueInfo();
                k.l = j;
                k.a = 11;
                k.q = "Radius";
                k.r = this.adi != null ? this.adi : "Radius";
                k.s = this.ade != null ? this.ade : "R:";
                k.t = this.adg != null ? this.adg : "";
                i.e.add(k);
            }
            else if (this.ach != null) {
                let l = new DataLegendSeriesValueInfo();
                l.l = this.ach.maximumValue;
                l.a = 11;
                l.q = "Radius";
                l.r = this.adi != null ? this.adi : "Radius";
                l.s = this.ade != null ? this.ade : "R:";
                l.t = this.adg != null ? this.adg : "";
                i.e.add(l);
            }
            if (!stringIsNullOrEmpty(this.ac3)) {
                let m = d == null ? NaN : this.iv(d, "FillMemberPath");
                let n = new DataLegendSeriesValueInfo();
                n.l = m;
                n.a = 12;
                n.q = "Fill";
                n.r = this.ac3 != null ? this.ac3 : "Fill";
                n.s = this.acz != null ? this.acz : "F:";
                n.t = this.ac1 != null ? this.ac1 : "";
                i.e.add(n);
            }
            return i;
        }
        get actualMarkerBrush() {
            return this.x8;
        }
    }
    BubbleSeries.$t = /*@__PURE__*/ markType(BubbleSeries, 'BubbleSeries', ScatterBase.$, [IScaleLegendSeries_$type, ISupportsSizeScale_$type, ISupportsFillScale_$type]);
    BubbleSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, BubbleSeries, 'raisePropertyChanged', ['FillMemberAsLegendLabel:acz:adq', [2, null], 'FillMemberAsLegendUnit:ac1:adr', [2, null], 'FillMemberPath:ac3:ads', [2], 'FillScale:acf:adt', [BrushScale.$], 'FillScaleUseGlobalValues:acq:adu', [0, false], 'LabelMemberPath:ac8:adv', [2], 'MarkerBrushBrightness:acw:adw', [1, NaN], 'MarkerOutlineBrightness:acx:adx', [1, NaN], 'MarkerOutlineUsesFillScale:acr:ady', [0, false], 'RadiusMemberAsLegendLabel:ade:adz', [2, null], 'RadiusMemberAsLegendUnit:adg:ad0', [2, null], 'RadiusMemberPath:adi:ad1', [2, null], 'RadiusScale:aci:ad2', [SizeScale.$], 'RadiusScaleUseGlobalValues:acs:ad3', [0, false]]);
    return BubbleSeries;
})();
/**
 * @hidden
 */
export let CustomPaletteBrushScale = /*@__PURE__*/ (() => {
    class CustomPaletteBrushScale extends BrushScale {
        constructor() {
            super();
        }
        getBrush1(a, b) {
            if (this.brushes == null || this.brushes.count == 0) {
                return null;
            }
            if (this.brushSelectionMode == 0) {
                return super.getBrush(a % this.brushes.count);
            }
            let c = BubbleSeries.acu(0, b - 1, 0, this.brushes.count - 1, a);
            return this.ab(c);
        }
        get_isReady() {
            return this.brushes != null && this.brushes.count > 0;
        }
    }
    CustomPaletteBrushScale.$t = /*@__PURE__*/ markType(CustomPaletteBrushScale, 'CustomPaletteBrushScale', BrushScale.$);
    CustomPaletteBrushScale.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, CustomPaletteBrushScale, 'v', ['BrushSelectionMode', [BrushSelectionMode_$type, /*@__PURE__*/ enumGetBox(BrushSelectionMode_$type, 0)]]);
    return CustomPaletteBrushScale;
})();
/**
 * @hidden
 */
export let BubbleSeriesView = /*@__PURE__*/ (() => {
    class BubbleSeriesView extends ScatterBaseView {
        constructor(a) {
            super(a);
            this.dk = null;
            this.dk = a;
            this.c2 = new ScatterTrendLineManager();
        }
        au() {
            super.au();
            if (!this.q) {
                this.b4.w1 = Defaults.e;
            }
        }
        cz() {
            return new BubbleMarkerManager((a) => this.c3.item(a), (a) => this.c1.yn.c.item(a), runOn(this, this.de), runOn(this, this.cw), runOn(this, this.c4));
        }
        dm() {
            let a = this.c0;
            this.dk.adp(a.n, a.o, this.bx, this == this.e.cs);
            this.as();
        }
        dn() {
            let a = this.c0;
            this.dk.ado(a.n);
        }
        dl() {
            let a = this.c0;
            for (let b of fromEnum(a.n)) {
                let c = typeCast(DataContext.$, b.content);
                if (c != null) {
                    c.itemBrush = null;
                    c.outline = null;
                }
            }
        }
        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.dk.title + "</span><br/><span>" + "(${item." + this.dk.aak + "}, ${item." + this.dk.aas + "})</span>";
            if (!stringIsNullOrEmpty(this.dk.adi)) {
                a += "<span>, Radius: ${item." + this.dk.adi + "}</span>";
            }
            a += "</div>";
            return a;
        }
    }
    BubbleSeriesView.$t = /*@__PURE__*/ markType(BubbleSeriesView, 'BubbleSeriesView', ScatterBaseView.$);
    return BubbleSeriesView;
})();
