/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { ScatterBase } from "./ScatterBase";
import { IScaleLegendSeries_$type } from "igniteui-react-core";
import { ISupportsSizeScale_$type } from "./ISupportsSizeScale";
import { ISupportsFillScale_$type } from "./ISupportsFillScale";
import { List$1 } from "igniteui-react-core";
import { UIElement } from "igniteui-react-core";
import { Base, typeCast, Point_$type, fromEnum, markType, markDep, enumGetBox, runOn } 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 { OwnedPoint } from "./OwnedPoint";
import { Dictionary$2 } from "igniteui-react-core";
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 { 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";
/**
 * @hidden
 */
var BubbleSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(BubbleSeries, _super);
    function BubbleSeries() {
        var _this = _super.call(this) || this;
        _this.ub = null;
        _this.ua = null;
        _this.ta = null;
        _this.s2 = null;
        _this.s1 = null;
        _this.s0 = null;
        _this.ab = BubbleSeries.$;
        _this.p8 = new ScatterFrame();
        _this.qa = new ScatterFrame();
        _this.p7 = new ScatterFrame();
        return _this;
    }
    BubbleSeries.prototype.bp = function () {
        return new BubbleSeriesView(this);
    };
    BubbleSeries.prototype.kk = function (a) {
        _super.prototype.kk.call(this, a);
        this.sy = a;
    };
    BubbleSeries.prototype.fr = function () {
        return 0.7;
    };
    BubbleSeries.prototype.oc = function () {
        if (this.ob == 0) {
            return 2;
        }
        return _super.prototype.oc.call(this);
    };
    BubbleSeries.prototype.isAttachedTo = function (a) {
        return this.az == a;
    };
    BubbleSeries.prototype.cv = function () {
        return true;
    };
    BubbleSeries.prototype.jx = function (a) {
        _super.prototype.jx.call(this, a);
        if (this.s5 != null && this.ta != null && this.ta.count > 0) {
            for (var b = 0; b < this.ta.count; b++) {
                a(this.ta._inner[b]);
            }
        }
    };
    Object.defineProperty(BubbleSeries.prototype, "s4", {
        get: function () {
            return this.s6;
        },
        enumerable: true,
        configurable: true
    });
    BubbleSeries.prototype.t9 = function (a) {
        var b = typeCast(CustomPaletteBrushScale.$, this.sx);
        var c = typeCast(ValueBrushScale.$, this.sx);
        var d = this.sx;
        if (b != null && this.cd != null) {
            return b.getBrush1(a, this.cd.count);
        }
        else if (c != null) {
            return c.getBrushByIndex(a, this.s3);
        }
        else if (d != null) {
            return d.getBrush(a);
        }
        return null;
    };
    Object.defineProperty(BubbleSeries.prototype, "legendReady", {
        get: function () {
            return this.s6 != null && this.s6.count != 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "minScaleText", {
        get: function () {
            var a = this.sw(this.sz).b;
            return (Math.round(a * 1000) / 1000).toString();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "maxScaleText", {
        get: function () {
            var a = this.sw(this.sz).a;
            return (Math.round(a * 1000) / 1000).toString();
        },
        enumerable: true,
        configurable: true
    });
    BubbleSeries.prototype.forScaleColors = function (a) {
        for (var b = 0; b < this.s6.count; b++) {
            if (this.sx == null || !this.sx.isReady) {
                return false;
            }
            var c = NaN;
            if (this.s3 != null) {
                c = (this.s3.item(b) - this.s3.minimum) / (this.s3.maximum - this.s3.minimum);
            }
            var d = (this.s6.item(b) - this.s6.minimum) / (this.s6.maximum - this.s6.minimum);
            if (isNaN_(c)) {
                c = 0;
            }
            if (isNaN_(d)) {
                d = c;
            }
            var e = this.pj;
            var f = this.t9(b);
            var g = f != null ? f : e;
            a(g, d);
        }
        return true;
    };
    BubbleSeries.prototype.gt = function (a, b) {
        var c = this.ic(b);
        if (c == BubbleSeries.$$p[3]) {
            return this.gu(a, b, this.tl);
        }
        if (c == BubbleSeries.$$p[7]) {
            return this.gu(a, b, this.tr);
        }
        if (c == ScatterBase.$$p[8]) {
            return this.gu(a, b, this.rf);
        }
        if (c == ScatterBase.$$p[10]) {
            return this.gu(a, b, this.rj);
        }
        if (c == BubbleSeries.$$p[0]) {
            return this.gu(a, b, this.tg);
        }
        return _super.prototype.gt.call(this, a, b);
    };
    Object.defineProperty(BubbleSeries.prototype, "s6", {
        get: function () {
            return this.s2;
        },
        set: function (a) {
            if (this.s2 != a) {
                var b = this.s6;
                this.s2 = a;
                this.raisePropertyChanged("RadiusColumn", b, this.s6);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "s5", {
        get: function () {
            return this.s1;
        },
        set: function (a) {
            if (this.s1 != a) {
                var b = this.s5;
                this.s1 = a;
                this.raisePropertyChanged("LabelColumn", b, this.s5);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "s3", {
        get: function () {
            return this.s0;
        },
        set: function (a) {
            if (this.s0 != a) {
                var b = this.s3;
                this.s0 = a;
                this.raisePropertyChanged("FillColumn", b, this.s3);
            }
        },
        enumerable: true,
        configurable: true
    });
    BubbleSeries.prototype.rm = function (a, b, c, d, e) {
        if (c <= this.q3) {
            b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
        }
        var f = this.q3;
        var g = this.cd;
        var h;
        var i;
        var j = this.getEffectiveViewport1(a);
        var k = new ScalerParams(0, d, e, this.p3.d, j);
        var l = new ScalerParams(0, d, e, this.p3.e, j);
        var m = false;
        var n = 0;
        if (this.b6 != null) {
            if (this.b6.ea()) {
                var o = this.b6.ik(d, k);
                m = o.c;
                n = o.d;
            }
        }
        var _loop_1 = function (p) {
            h = this_1.qi.item(p);
            i = this_1.qj.item(p);
            var q = { $type: Point_$type, x: this_1.p3.a.dz(h, k), y: this_1.p3.b.dz(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)) {
                var r_1 = g.item(p);
                if (c <= f) {
                    if (!b.g.containsKey(r_1)) {
                        var s_1 = { $type: Point_$type, x: h, y: i };
                        b.g.addItem(r_1, ((function () {
                            var $ret = new OwnedPoint();
                            $ret.a = r_1;
                            $ret.b = s_1;
                            $ret.c = q;
                            return $ret;
                        })()));
                    }
                }
            }
        };
        var this_1 = this;
        for (var p = 0; p < c; p++) {
            _loop_1(p);
        }
    };
    BubbleSeries.prototype.ru = function (a, b) {
        var c = typeCast(BubbleSeriesView.$, b);
        var d = c.cv;
        d.m = this.s6;
        _super.prototype.ru.call(this, a, b);
        var e = Math.min(this.qi != null ? this.qi.count : 0, this.qj != null ? this.qj.count : 0);
        if (e < 1) {
            return;
        }
        c.dh();
        c.di();
    };
    BubbleSeries.prototype.tw = function () {
        if (this.b6 == null) {
            return;
        }
        if (this.az == null) {
            return;
        }
        if (this.az.isItemwise) {
            var a = this.az;
            this.az.clearLegendItemsForSeries(this);
            this.tv();
            a.renderItemwiseContent(this);
        }
        if (this.az.isScale) {
            var b = this.az;
            b.restoreOriginalState();
            b.initializeLegend(this);
        }
    };
    BubbleSeries.tb = function (a, b, c, d, e) {
        if (e <= a || isNaN_(e) || isInfinity(e)) {
            return c;
        }
        if (e >= b) {
            return d;
        }
        var f = c + ((d - c) / (b - a)) * (e - a);
        return f;
    };
    BubbleSeries.tc = function (a, b, c, d, logBase_, e) {
        var f = logBase(e, logBase_);
        var g = logBase(a, logBase_);
        var h = logBase(b, logBase_);
        return BubbleSeries.tb(g, h, c, d, f);
    };
    BubbleSeries.prototype.ec = function (a, b, c) {
        var d = _super.prototype.ec.call(this, a, b, c);
        if (this.s6 == null || this.cd == null || this.s6.count == 0 || this.cd.count != this.s6.count) {
            d = false;
        }
        return d;
    };
    BubbleSeries.prototype.qr = function (a, b) {
        if (b != 3) {
            return true;
        }
        if (a == null) {
            return true;
        }
        if (this.rf == a || this.rj == a || this.tr == a) {
            return true;
        }
        return false;
    };
    BubbleSeries.prototype.tv = function () {
        var _this = this;
        var a = typeCast(IChartLegend_$type, this.az);
        if (a == null || this.cd == null) {
            return;
        }
        this.ta = new List$1(UIElement.$, 0);
        var b = typeCast(CustomPaletteBrushScale.$, this.sx);
        var c = typeCast(ValueBrushScale.$, this.sx);
        var d = this.sx;
        var e = this.sv();
        var f = e.b;
        var g = e.a;
        var h = this.cd;
        var _loop_2 = function (i) {
            var j = null;
            if (c != null && this_2.s3 != null) {
                var k = this_2.s3.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);
            }
            var l = new ContentControl();
            var m = this_2.s5 != null && this_2.s5.item(i) != null ? this_2.s5.item(i).toString() : "";
            l.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this;
                $ret.item = h.item(i);
                $ret.itemBrush = j;
                $ret.itemLabel = m;
                return $ret;
            })());
            var n = this_2.lt;
            if (n == null) {
                n = this_2.bs.bl(this_2.by);
            }
            l.ah = n;
            this_2.ta.add(l);
        };
        var this_2 = this;
        for (var i = 0; i < h.count; i++) {
            _loop_2(i);
        }
    };
    BubbleSeries.prototype.jo = function (a, b, c, d) {
        _super.prototype.jo.call(this, a, b, c, d);
        if (this.sz != null) {
            this.sz.aa();
        }
        if (this.sx != null) {
            this.sx.w();
        }
        this.tw();
    };
    BubbleSeries.prototype.j4 = function () {
        _super.prototype.j4.call(this);
        this.tw();
    };
    BubbleSeries.prototype.j9 = function () {
        _super.prototype.j9.call(this);
        this.tw();
    };
    BubbleSeries.prototype.kp = function (a, b, c, d) {
        var e_1, _a;
        _super.prototype.kp.call(this, a, b, c, d);
        switch (b) {
            case "FastItemsSource":
                if (this.sz != null) {
                    this.sz.aa();
                }
                if (this.sx != null) {
                    this.sx.w();
                }
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    c.deregisterColumn(this.s6);
                    c.deregisterColumn(this.s3);
                    c.deregisterColumn(this.s5);
                    this.s6 = null;
                    this.s3 = null;
                    this.s5 = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    this.s6 = this.ca(this.tr);
                    if (!stringIsNullOrEmpty(this.tg)) {
                        this.s3 = this.ca(this.tg);
                    }
                    this.s5 = this.cc(this.tl);
                }
                this.k3(false);
                this.tw();
                break;
            case BubbleSeries.$$p[7]:
                if (this.sz != null) {
                    this.sz.aa();
                }
                if (this.cd != null) {
                    this.cd.deregisterColumn(this.s6);
                    this.s6 = this.ca(this.tr);
                    this.tw();
                }
                break;
            case "RadiusColumn":
                if (this.sz != null) {
                    this.sz.aa();
                }
                this.p4.cx.g$i();
                this.k3(false);
                this.kb();
                break;
            case BubbleSeries.$$p[8]:
                if (c != null) {
                    c.l.remove(this);
                    c.aa();
                }
                if (d != null) {
                    d.l.add(this);
                    d.aa();
                }
                this.k3(false);
                this.ka();
                break;
            case BubbleSeries.$$p[9]:
                this.k3(false);
                this.ka();
                break;
            case "DiscreteLegendItemTemplate":
                this.tw();
                break;
            case BubbleSeries.$$p[1]:
                if (c != null) {
                    c.o.remove(this);
                    c.w();
                }
                if (d != null) {
                    d.o.add(this);
                    d.w();
                }
                this.k3(false);
                this.tw();
                this.ka();
                break;
            case BubbleSeries.$$p[2]:
            case BubbleSeries.$$p[6]:
            case BubbleSeries.$$p[5]:
            case BubbleSeries.$$p[4]:
                this.k3(false);
                this.tw();
                this.ka();
                break;
            case "FillColumn":
                this.k3(false);
                this.ka();
                break;
            case BubbleSeries.$$p[0]:
                if (this.sx != null) {
                    this.sx.w();
                }
                if (this.cd != null) {
                    this.cd.deregisterColumn(this.s3);
                    this.s3 = this.ca(this.tg);
                    this.tw();
                }
                break;
            case BubbleSeries.$$p[3]:
                if (this.cd != null) {
                    this.cd.deregisterColumn(this.s5);
                    this.s5 = this.cc(this.tl);
                    this.tw();
                }
                break;
            case "ActualLegend":
                var e = typeCast(IChartLegend_$type, c);
                if (e != null && e.isItemwise) {
                    var f = typeCast(IChartItemLegend_$type, e);
                    f.clearLegendItemsForSeries(this);
                }
                if (e != null && e.isScale) {
                    var g = typeCast(IChartScaleLegend_$type, e);
                    var h = true;
                    var i = null;
                    if (this.b6 != null) {
                        try {
                            for (var _b = tslib_1.__values(fromEnum(this.b6.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                                var j = _c.value;
                                if (j.legend == g) {
                                    i = j;
                                    h = false;
                                }
                            }
                        }
                        catch (e_1_1) {
                            e_1 = { error: e_1_1 };
                        }
                        finally {
                            try {
                                if (_c && !_c.done && (_a = _b.return))
                                    _a.call(_b);
                            }
                            finally {
                                if (e_1)
                                    throw e_1.error;
                            }
                        }
                    }
                    if (h) {
                        g.restoreOriginalState();
                    }
                    else {
                        g.initializeLegend(typeCast(IScaleLegendSeries_$type, i));
                    }
                }
                this.tw();
                break;
            case "SeriesViewer":
                this.tw();
                break;
        }
    };
    BubbleSeries.prototype.updateSizeScaleGlobals = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.s6 != null) {
            a.b = this.s6.minimum;
            a.a = this.s6.maximum;
        }
        if (this.sz != null) {
            this.sz.ab(a.b, a.a);
        }
    };
    BubbleSeries.prototype.updateFillScaleGlobals = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.s3 != null) {
            a.b = this.s3.minimum;
            a.a = this.s3.maximum;
        }
        if (this.sx != null) {
            this.sx.y(a.b, a.a);
        }
    };
    BubbleSeries.prototype.sw = function (a) {
        var b = new ActualRange();
        b.b = NaN;
        b.a = NaN;
        if (this.s6 != null) {
            b.b = this.s6.minimum;
            b.a = this.s6.maximum;
        }
        if (a != null) {
            a.x();
            if (this.s9) {
                b.b = a.globalMinimum;
                b.a = a.globalMaximum;
            }
        }
        return b;
    };
    BubbleSeries.prototype.sv = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.s3 != null) {
            a.b = this.s3.minimum;
            a.a = this.s3.maximum;
        }
        var b = typeCast(ValueBrushScale.$, this.sx);
        if (b != null) {
            b.s();
            if (this.s7 && this.sx.o.count > 1) {
                a.b = b.q;
                a.a = b.p;
            }
        }
        return a;
    };
    BubbleSeries.prototype.ty = function (a, b, c, d) {
        var e = c.width;
        if (!this.bs.bu.isEmpty) {
            e = this.bs.bu.width;
        }
        else if (this.b6 != null && !this.b6.o7.isEmpty) {
            e = this.b6.o7.width;
        }
        var f = DeviceUtils.c(e);
        var g = this.sz || ((function () {
            var $ret = new SizeScale();
            $ret.minimumValue = f / 10;
            $ret.maximumValue = f / 5;
            return $ret;
        })());
        if (g != null) {
            var h = g.minimumValue;
            var i = g.maximumValue;
            var j = g.logarithmBase;
            var k = this.sw(g);
            var l = k.b;
            var m = k.a;
            if (g.isLogarithmic) {
                for (var n = 0; n < b.count; n++) {
                    b._inner[n] = BubbleSeries.tc(l, m, h, i, j, b._inner[n]);
                }
            }
            else {
                for (var o = 0; o < b.count; o++) {
                    b._inner[o] = BubbleSeries.tb(l, m, h, i, b._inner[o]);
                }
            }
        }
        var p = 1;
        p = DeviceUtils.d();
        var q = this.sz == null;
        if (d) {
            var r = c.width / e;
            for (var s = 0; s < b.count; s++) {
                if (q) {
                    b._inner[s] = b._inner[s] / p;
                }
                b._inner[s] = b._inner[s] * r;
            }
        }
        for (var t = 0; t < a.count; t++) {
            var u = a._inner[t];
            if (q && !d) {
                u.width = Math.max(0, b._inner[t] / p);
                u.height = Math.max(0, b._inner[t] / p);
            }
            else {
                u.width = Math.max(0, b._inner[t]);
                u.height = Math.max(0, b._inner[t]);
            }
        }
    };
    BubbleSeries.prototype.tx = function (a) {
        var b = typeCast(BubbleSeriesView.$, this.br);
        this.sy.b3 = false;
        if (b != null) {
            b.b3 = false;
        }
        var c = typeCast(CustomPaletteBrushScale.$, this.sx);
        var d = typeCast(ValueBrushScale.$, this.sx);
        var e = this.sx;
        var f = this.sv();
        var g = f.b;
        var h = f.a;
        var i = this.sx == null || !this.sx.isReady || (d != null && this.tg == null);
        if (i) {
            this.sy.dg();
            if (b != null) {
                b.dg();
            }
            return;
        }
        this.sy.b3 = true;
        if (b != null) {
            b.b3 = true;
        }
        var j = a.count;
        var k = this.cd;
        for (var l = 0; l < j; l++) {
            var m = a._inner[l];
            var n = typeCast(DataContext.$, m.content);
            if (n != null) {
                var o = null;
                var p = k.indexOf(n.item);
                if (c != null) {
                    o = c.getBrush1(p, k.count);
                }
                else if (d != null && this.s3 != null) {
                    var q = this.s3.item(p);
                    o = d.getBrushByRange(q, g, h);
                }
                else if (e != null) {
                    o = e.getBrush(p);
                }
                else {
                    if (this.pl == null) {
                        o = this.pj;
                    }
                    else {
                        o = this.pl;
                    }
                }
                var r = null;
                if (this.pm == null) {
                    r = this.pk;
                }
                else {
                    r = this.pm;
                }
                if (this.s8 && o != null) {
                    r = o;
                }
                if (r != null && !isNaN_(this.te)) {
                    r = BrushUtil.l(r, this.te);
                }
                if (o != null && !isNaN_(this.td)) {
                    o = BrushUtil.l(o, this.td);
                }
                n.itemBrush = o;
                n.actualItemBrush = o;
                n.outline = r;
            }
        }
    };
    BubbleSeries.prototype.get_dd = function () {
        return false;
    };
    Object.defineProperty(BubbleSeries.prototype, "actualMarkerBrush", {
        get: function () {
            return this.pj;
        },
        enumerable: true,
        configurable: true
    });
    BubbleSeries.$t = markType(BubbleSeries, 'BubbleSeries', ScatterBase.$, [IScaleLegendSeries_$type, ISupportsSizeScale_$type, ISupportsFillScale_$type]);
    BubbleSeries.$$p = markDep(DependencyProperty, PropertyMetadata, BubbleSeries, 'raisePropertyChanged', ['FillMemberPath:tg:tz', [2], 'FillScale:sx:t0', [BrushScale.$], 'FillScaleUseGlobalValues:s7:t1', [0, false], 'LabelMemberPath:tl:t2', [2], 'MarkerBrushBrightness:td:t3', [1, NaN], 'MarkerOutlineBrightness:te:t4', [1, NaN], 'MarkerOutlineUsesFillScale:s8:t5', [0, false], 'RadiusMemberPath:tr:t6', [2, null], 'RadiusScale:sz:t7', [SizeScale.$], 'RadiusScaleUseGlobalValues:s9:t8', [0, false]]);
    return BubbleSeries;
}(ScatterBase));
export { BubbleSeries };
/**
 * @hidden
 */
var CustomPaletteBrushScale = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(CustomPaletteBrushScale, _super);
    function CustomPaletteBrushScale() {
        return _super.call(this) || this;
    }
    CustomPaletteBrushScale.prototype.getBrush1 = function (a, b) {
        if (this.brushes == null || this.brushes.count == 0) {
            return null;
        }
        if (this.brushSelectionMode == 0) {
            return _super.prototype.getBrush.call(this, a % this.brushes.count);
        }
        var c = BubbleSeries.tb(0, b - 1, 0, this.brushes.count - 1, a);
        return this.aa(c);
    };
    CustomPaletteBrushScale.prototype.get_isReady = function () {
        return this.brushes != null && this.brushes.count > 0;
    };
    CustomPaletteBrushScale.$t = markType(CustomPaletteBrushScale, 'CustomPaletteBrushScale', BrushScale.$);
    CustomPaletteBrushScale.$$p = markDep(DependencyProperty, PropertyMetadata, CustomPaletteBrushScale, 'u', ['BrushSelectionMode', [BrushSelectionMode_$type, enumGetBox(BrushSelectionMode_$type, 0)]]);
    return CustomPaletteBrushScale;
}(BrushScale));
export { CustomPaletteBrushScale };
/**
 * @hidden
 */
var BubbleSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(BubbleSeriesView, _super);
    function BubbleSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.df = null;
        _this.df = a;
        _this.cx = new ScatterTrendLineManager();
        return _this;
    }
    BubbleSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
            this.b1.oi = 2;
            this.e.bx = 4;
        }
    };
    BubbleSeriesView.prototype.cu = function () {
        var _this = this;
        return new BubbleMarkerManager(function (a) { return _this.cy.item(a); }, function (a) { return _this.cw.p3.c.item(a); }, runOn(this, this.c9), runOn(this, this.cr), runOn(this, this.cz));
    };
    BubbleSeriesView.prototype.dh = function () {
        var a = this.cv;
        this.df.ty(a.n, a.o, this.bu, this == this.e.br);
        this.aq();
    };
    BubbleSeriesView.prototype.di = function () {
        var a = this.cv;
        this.df.tx(a.n);
    };
    BubbleSeriesView.prototype.dg = function () {
        var e_2, _a;
        var a = this.cv;
        try {
            for (var _b = tslib_1.__values(fromEnum(a.n)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = typeCast(DataContext.$, b.content);
                if (c != null) {
                    c.itemBrush = null;
                    c.outline = null;
                }
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
    };
    BubbleSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'><span";
        var b = this.e.a3.a$r(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.df.gy + "</span><br/><span>" + "(${item." + this.df.rf + "}, ${item." + this.df.rj + "})</span>";
        if (!stringIsNullOrEmpty(this.df.tr)) {
            a += "<span>, Radius: ${item." + this.df.tr + "}</span>";
        }
        a += "</div>";
        return a;
    };
    BubbleSeriesView.$t = markType(BubbleSeriesView, 'BubbleSeriesView', ScatterBaseView.$);
    return BubbleSeriesView;
}(ScatterBaseView));
export { BubbleSeriesView };
//# sourceMappingURL=BubbleSeries_combined.js.map
