/*
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 { __extends, __values } from "tslib";
import { ShapeSeriesBase } from "./ShapeSeriesBase";
import { ShapeAxisInfoCache } from "./ShapeAxisInfoCache";
import { StyleSelector } from "./StyleSelector";
import { DependencyProperty } from "igniteui-angular-core";
import { Style } from "igniteui-angular-core";
import { MarkerType_$type } from "./MarkerType";
import { DataTemplate } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { MarkerOutlineMode_$type } from "./MarkerOutlineMode";
import { MarkerFillMode_$type } from "./MarkerFillMode";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { Base, runOn, enumGetBox, Number_$type, typeCast, fromEnum, markType, markDep, PointUtil } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { OwnedPoint } from "./OwnedPoint";
import { ShapeSeriesViewBase } from "./ShapeSeriesViewBase";
import { Marker } from "./Marker";
import { MarkerSeries } from "./MarkerSeries";
import { BrushUtil } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { HashPool$2 } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { RectUtil } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { isNaN_, isInfinity } from "igniteui-angular-core";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { DataTemplateMeasureInfo } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { Defaults } from "./Defaults";
import { DataTemplatePassInfo } from "igniteui-angular-core";
import { DataTemplateRenderInfo } from "igniteui-angular-core";
import { MarkerVisualData } from "./MarkerVisualData";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var ScatterPolygonSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ScatterPolygonSeries, _super);
    function ScatterPolygonSeries() {
        var _this = _super.call(this) || this;
        _this.td = null;
        _this.ta = new ScalerParams(1, ScatterPolygonSeries.uj, ScatterPolygonSeries.uj, false);
        _this.tb = new ScalerParams(1, ScatterPolygonSeries.uj, ScatterPolygonSeries.uj, false);
        _this.tz = null;
        _this.s5 = 1;
        _this.s1 = 1;
        _this.ab = ScatterPolygonSeries.$;
        return _this;
    }
    ScatterPolygonSeries.prototype.get_ea = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.get_d5 = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.rk = function () {
        return this.tf();
    };
    ScatterPolygonSeries.prototype.sj = function (a) {
        var _this = this;
        var b = a;
        b.cv(this.ul);
        b.cw(this.te);
        _super.prototype.sj.call(this, a);
        if (this.cy(a)) {
            return;
        }
        var c, d;
        var e = a.getViewInfo(c, d);
        c = e.p0;
        d = e.p1;
        var f = this.getEffectiveViewport1(a);
        this.ta = new ScalerParams(1, d, c, this.qt.cg);
        this.ta.c = f;
        this.tb = new ScalerParams(1, d, c, this.qv.cg);
        this.tb.c = f;
        if (c.width < 1 || c.height < 1) {
            return;
        }
        this.td = ((function () {
            var $ret = new ShapeAxisInfoCache();
            $ret.a = _this.qt;
            $ret.b = _this.qv;
            $ret.e = _this.qt.cg;
            $ret.f = _this.qv.cg;
            $ret.d = _this.cl;
            $ret.c = _this.q3;
            return $ret;
        })());
        if (this.tf()) {
            var g = new Dictionary$2(Base.$, OwnedPoint.$, 0);
            b.dd.l(g, 400, d, c, this.fx);
            b.dd.j(g, false);
            if (this.ri()) {
                this.tw(a);
            }
        }
    };
    ScatterPolygonSeries.prototype.tw = function (a) {
        var _this = this;
        a.dh = true;
        this.q0.ay(this, this.ri(), runOn(this, this.qi));
        var b = this.q0.d;
        var c = b != null;
        var d = this.getEffectiveViewport1(a);
        var e = this.cl == null ? 0 : this.cl.count;
        a.dt(function (f) {
            if (f._visibility == 0) {
                var g = f.ak;
                var h = f.content;
                if (h == null) {
                    h = new DataContext();
                    f.content = h;
                }
                if (c) {
                    _this.se(g, e, a.q);
                }
                _this.q0.ac(f, h);
            }
        });
    };
    ScatterPolygonSeries.prototype.tf = function () {
        return this.tz != null && ((this.s9 != 1 && this.s9 != 0) || this.t0 != null);
    };
    ScatterPolygonSeries.prototype.by = function () {
        return new ScatterPolygonSeriesView(this);
    };
    ScatterPolygonSeries.prototype.l4 = function (a) {
        _super.prototype.l4.call(this, a);
        this.tc = a;
    };
    ScatterPolygonSeries.prototype.get_hasMarkers = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.pc = function () {
        return this.uf;
    };
    ScatterPolygonSeries.prototype.pd = function () {
        return this.ug;
    };
    ScatterPolygonSeries.prototype.nj = function () {
        return this.ty;
    };
    ScatterPolygonSeries.prototype.i2 = function () {
        return this.i3(this, this.tz);
    };
    ScatterPolygonSeries.prototype.f6 = function () {
        return this.th;
    };
    Object.defineProperty(ScatterPolygonSeries.prototype, "s6", {
        get: function () {
            return this.s5;
        },
        set: function (a) {
            this.s5 = a;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeries.prototype.s8 = function () {
        if (this.s7 == 0) {
            return 1;
        }
        return this.s7;
    };
    ScatterPolygonSeries.prototype.m5 = function (a) {
        _super.prototype.m5.call(this, a);
        this.s7 = a;
    };
    Object.defineProperty(ScatterPolygonSeries.prototype, "s2", {
        get: function () {
            return this.s1;
        },
        set: function (a) {
            this.s1 = a;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeries.prototype.s4 = function () {
        if (this.s3 == 0) {
            return 2;
        }
        return this.s3;
    };
    ScatterPolygonSeries.prototype.m4 = function (a) {
        _super.prototype.m4.call(this, a);
        this.s3 = a;
    };
    ScatterPolygonSeries.prototype.m6 = function (a) {
        _super.prototype.m6.call(this, a);
        this.th = a;
    };
    ScatterPolygonSeries.prototype.m1 = function () {
        _super.prototype.m1.call(this);
        if (this.index < 0) {
            return;
        }
        if (this.t0 != null) {
            this.tc.ds();
            this.tc.dp();
        }
        else {
            var a = MarkerSeries.qm(this, this.s9);
            var b = MarkerSeries.qu(a);
            if (b == null) {
                this.ty = MarkerSeries.q8;
            }
            else {
                this.tc.dl(b);
            }
        }
        if (this.uh != null && this.s9 != 13) {
            this.tc.dq();
            this.tc.dm();
        }
        else {
            if (this.s9 == 13) {
                this.uf = this.b1.bq();
            }
            else {
                if (this.s2 != 2) {
                    if (this.ce != null) {
                        var c = this.ce.sl(this.index);
                        if (!isNaN_(this.fw) && this.fw != 1) {
                            c = BrushUtil.p(c, this.fw);
                        }
                        this.uf = c;
                    }
                    else {
                        this.uf = null;
                    }
                }
            }
        }
        if (this.ui != null) {
            this.tc.dr();
            this.tc.dn();
        }
        else {
            if (this.s9 == 13) {
                this.ug = this.b1.bq();
            }
            else {
                if (this.s7 == 2) {
                    this.ug = this.uf;
                }
                else {
                    this.ug = this.ce == null ? null : this.ce.sm(this.index);
                }
            }
        }
        if (this.s2 == 2 && this.uh == null && this.s9 != 13) {
            if (this.ug != null) {
                var d = this.ug;
                if (!isNaN_(this.fw) && this.fw != 1) {
                    d = BrushUtil.p(d, this.fw);
                }
                this.uf = d;
            }
            else {
                this.uf = null;
            }
        }
    };
    ScatterPolygonSeries.prototype.lz = function () {
        _super.prototype.lz.call(this);
        this.s6 = this.s8();
        this.s2 = this.s4();
    };
    ScatterPolygonSeries.prototype.l9 = function (a, b, c, d) {
        _super.prototype.l9.call(this, a, b, c, d);
        switch (b) {
            case ScatterPolygonSeries.$$p[3]:
            case ScatterPolygonSeries.$$p[11]:
            case ScatterPolygonSeries.$$p[7]:
            case ScatterPolygonSeries.$$p[9]:
            case ScatterPolygonSeries.$$p[10]:
                this.m1();
                this.l6();
                break;
            case ScatterPolygonSeries.$$p[6]:
                this.s6 = this.s8();
                this.m1();
                this.l6();
                break;
            case ScatterPolygonSeries.$$p[5]:
                this.s2 = this.s4();
                this.m1();
                this.l6();
                break;
            case ScatterPolygonSeries.$$p[2]:
                this.tz = d;
                if (c == MarkerSeries.q8 || d == MarkerSeries.q8 || (c == null || d != null)) {
                    this.tc.du();
                    this.mn(false);
                }
                this.b1.bj();
                if (this.toolTip != null && this.d2) {
                    this.a7.a$aj(this, this.toolTip);
                }
                this.mn(false);
                this.lu();
                break;
            case ScatterPolygonSeries.$$p[12]:
                this.tc.cv(this.ul);
                this.mn(false);
                this.lu();
                break;
            case ScatterPolygonSeries.$$p[13]:
                this.tc.cw(this.te);
                this.mn(false);
                this.lu();
                break;
            case ScatterPolygonSeries.$$p[4]:
                this.mn(false);
                this.lu();
                break;
            case ScatterPolygonSeries.$$p[0]:
            case ScatterPolygonSeries.$$p[1]:
                if (this.tf()) {
                    this.mn(false);
                }
                break;
        }
    };
    ScatterPolygonSeries.prototype.au = function (a, b) {
        var c = this.tc.b1(a);
        var d = null;
        if (c != null) {
            d = c.content;
        }
        if (d != null) {
            return d;
        }
        return _super.prototype.au.call(this, a, b);
    };
    ScatterPolygonSeries.prototype.tx = function (a, b) {
        var e_1, _a, e_2, _b;
        var c = new List$1(Base.$, 0);
        try {
            for (var _c = __values(fromEnum(b.c)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var d = _d.value;
                if (!a.containsKey(d)) {
                    c.add1(d);
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(c)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var e = _f.value;
                b.h(e);
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
    };
    ScatterPolygonSeries.prototype.c2 = function (a, b, c, d) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var e = this.qt;
        var f = new ScalerParams(1, this.ce.ta, this.p7, e.cg);
        f.c = this.getEffectiveViewport1(this.b1);
        var g = this.qv;
        var h = new ScalerParams(1, this.ce.ta, this.p7, g.cg);
        h.c = this.getEffectiveViewport1(this.b1);
        a.clear();
        this.tc.dt(function (i) {
            if (i._visibility == 0) {
                var j = new SeriesPointOfInterest();
                var k = i.n;
                var l = i.o;
                if (k < _this.p7.left || k > _this.p7.right || l < _this.p7.top || l > _this.p7.bottom) {
                    return;
                }
                j.b = e.el(k, f);
                j.c = g.el(l, h);
                j.a = i.content;
                a.add(j);
            }
        });
        return true;
    };
    ScatterPolygonSeries.prototype.sz = function (a, b, c, d, e) {
        var _this = this;
        if (c == null || c.length != this.td.d.count) {
            c = new Array(this.td.d.count);
            for (var f = 0; f < this.td.d.count; f++) {
                c[f] = PointUtil.create();
            }
        }
        var g = ((function () {
            var $ret = new ScalerParams(1, d, e, _this.qt.cg);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var h = ((function () {
            var $ret = new ScalerParams(1, d, e, _this.qv.cg);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var i = this.pz(a);
        var j = this.td.a.el(i.left, g);
        var k = this.td.a.el(i.right, g);
        var l = this.td.b.el(i.bottom, h);
        var m = this.td.b.el(i.top, h);
        if (this.td.e) {
            var n = j;
            j = k;
            k = n;
        }
        if (this.td.f) {
            var o = l;
            l = m;
            m = o;
        }
        var p = this.td;
        var q = p.a;
        var r = p.b;
        var s;
        var t;
        var u = g.d.left;
        var v = g.d.right;
        var w = h.d.top;
        var x = h.d.bottom;
        for (var y = 0; y < this.td.d.count; y++) {
            s = 0;
            t = 0;
            var z = null;
            var aa = a.b9.tryGetValue(y, z);
            z = aa.p1;
            if (z == null) {
                c[y].x = NaN;
                c[y].y = NaN;
            }
            else {
                var ab = z.c;
                var ac = RectUtil.l(ab);
                s = ac.x;
                t = ac.y;
                if (s >= u && s <= v && t >= w && t <= x) {
                    c[y].x = s;
                    c[y].y = t;
                }
                else {
                    c[y].x = NaN;
                    c[y].y = NaN;
                }
            }
        }
        return c;
    };
    ScatterPolygonSeries.prototype.tg = function (a, b) {
        var e_3, _a;
        if (b == null) {
            b = new List$1(Number_$type, 2, a.e);
        }
        else {
            b.clear();
        }
        var c = 0;
        var d = this.cl;
        try {
            for (var _b = __values(fromEnum(a.c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                b.add(d.indexOf(e));
                c++;
            }
        }
        catch (e_3_1) {
            e_3 = { error: e_3_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_3)
                    throw e_3.error;
            }
        }
        return b;
    };
    ScatterPolygonSeries.$t = markType(ScatterPolygonSeries, 'ScatterPolygonSeries', ShapeSeriesBase.$);
    ScatterPolygonSeries.uj = new Rect(0, 0, 0, 1, 1);
    ScatterPolygonSeries.$$p = markDep(DependencyProperty, PropertyMetadata, ScatterPolygonSeries, 'raisePropertyChanged', ['ActualMarkerBrush:uf:t1', [Brush.$], 'ActualMarkerOutline:ug:t2', [Brush.$], 'ActualMarkerTemplate:ty:t3', [DataTemplate.$, null], 'MarkerBrush:uh:t4', [Brush.$], 'MarkerCollisionAvoidance:s0:t5', [CollisionAvoidanceType_$type, enumGetBox(CollisionAvoidanceType_$type, 0)], 'MarkerFillMode:s3:t6', [MarkerFillMode_$type, enumGetBox(MarkerFillMode_$type, 0)], 'MarkerOutlineMode:s7:t7', [MarkerOutlineMode_$type, enumGetBox(MarkerOutlineMode_$type, 0)], 'MarkerOutline:ui:t8', [Brush.$], 'MarkerStyle:uk:t9', [Style.$], 'MarkerTemplate:t0:ua', [DataTemplate.$, null], 'MarkerThickness:th:ub', [1, DeviceUtils.g(2)], 'MarkerType:s9:uc', [MarkerType_$type, enumGetBox(MarkerType_$type, 1)], 'ShapeStyle:ul:ud', [Style.$, null], 'ShapeStyleSelector:te:ue', [StyleSelector.$, null]]);
    return ScatterPolygonSeries;
}(ShapeSeriesBase));
export { ScatterPolygonSeries };
/**
 * @hidden
 */
var ScatterPolygonSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ScatterPolygonSeriesView, _super);
    function ScatterPolygonSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.dh = false;
        _this.c8 = null;
        _this.dj = null;
        _this.de = null;
        _this.dc = null;
        _this.dg = false;
        _this.df = null;
        _this.dk = null;
        _this.c9 = new Marker();
        _this.d1 = null;
        _this.c9 = new Marker();
        _this.c9.content = new DataContext();
        _this.de = a;
        _this.df = new HashPool$2(Base.$, Marker.$);
        _this.dk = new List$1(Marker.$, 0);
        _this.dv(_this.df);
        _this.dc = new NumericMarkerManager(1, function (b) { return _this.df.item(b); }, function (b) { return _this.de.td.d.item(b); }, runOn(_this, _this.dz), runOn(_this, _this.c7), runOn(_this, _this.di), function () { return _this.de.s0; });
        _this.dc.q = runOn(_this, _this.d2);
        return _this;
    }
    ScatterPolygonSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
            this.de.ui = Defaults.am;
            this.de.g4 = Defaults.z;
            this.de.th = Defaults.y;
            this.de.s9 = Defaults.f;
            this.de.s3 = Defaults.b;
        }
    };
    Object.defineProperty(ScatterPolygonSeriesView.prototype, "dd", {
        get: function () {
            return this.dc;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeriesView.prototype.dz = function (a) {
        this.de.tx(a, this.df);
    };
    ScatterPolygonSeriesView.prototype.c7 = function () {
        this.c8 = this.de.sz(this, this.df, this.c8, this.bv, this.bu);
        return this.c8;
    };
    ScatterPolygonSeriesView.prototype.di = function () {
        this.dj = this.de.tg(this.df, this.dj);
        return this.dj;
    };
    ScatterPolygonSeriesView.prototype.c2 = function (a, b) {
        return this.c3(a, b, true);
    };
    ScatterPolygonSeriesView.prototype.cj = function (a, b, c) {
        _super.prototype.cj.call(this, a, b, c);
        ShapeSeriesViewBase.ci(this, a, b);
    };
    ScatterPolygonSeriesView.prototype.ch = function (a, b) {
        var c = a;
        if (c == null) {
            return;
        }
        c.an = b;
    };
    ScatterPolygonSeriesView.prototype.dt = function (a) {
        this.df.f(a);
    };
    ScatterPolygonSeriesView.prototype.dv = function (a) {
        a.create = runOn(this, this.db);
        a.destroy = runOn(this, this.dx);
        a.activate = runOn(this, this.dw);
        a.disactivate = runOn(this, this.dy);
    };
    ScatterPolygonSeriesView.prototype.db = function () {
        var _this = this;
        var a = new Marker();
        if (!this.dg) {
            a.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this.e;
                return $ret;
            })());
        }
        a.ah = this.e.ty;
        this.dk.add(a);
        return a;
    };
    ScatterPolygonSeriesView.prototype.b1 = function (a) {
        var b = this.da(a, 0);
        if (b == null) {
            b = this.da(a, 3);
        }
        return b;
    };
    ScatterPolygonSeriesView.prototype.da = function (a, b) {
        var c;
        var d;
        var e;
        var f;
        for (var g = this.dk.count - 1; g >= 0; g--) {
            var h = this.dk._inner[g];
            if (h._visibility == 1 || h._opacity == 0) {
                continue;
            }
            c = (h.m / 2) + b;
            d = (h.l / 2) + b;
            e = h.ai;
            f = h.aj;
            if ((h.n + e) - c <= a.x && (h.n + e) + c >= a.x && (h.o + f) - d <= a.y && (h.o + f) + d >= a.y) {
                return h;
            }
        }
        return null;
    };
    ScatterPolygonSeriesView.prototype.dx = function (a) {
        a.content = null;
        this.dk.remove(a);
    };
    ScatterPolygonSeriesView.prototype.dw = function (a) {
        a._visibility = 0;
    };
    ScatterPolygonSeriesView.prototype.dy = function (a) {
        if (a.content != null) {
            (typeCast(DataContext.$, a.content)).item = null;
        }
        a._visibility = 1;
    };
    ScatterPolygonSeriesView.prototype.d0 = function (a) {
        this.dg = a;
    };
    ScatterPolygonSeriesView.prototype.bh = function (a, b) {
        _super.prototype.bh.call(this, a, b);
        if (!this.dh) {
            var c = a;
            var d = c.content;
            if (d != null) {
                if (this.de.uf != null) {
                    d.actualItemBrush = this.de.uf;
                }
                else {
                    d.actualItemBrush = this.b3.o5;
                }
                if (this.de.uf != null) {
                    d.outline = this.de.ug;
                }
                else {
                    d.outline = this.b3.o8;
                }
                d.thickness = this.de.th;
            }
        }
    };
    ScatterPolygonSeriesView.prototype.bi = function (a, b) {
        _super.prototype.bi.call(this, a, b);
        var c = a;
        this.c9._visibility = c._visibility;
        this.c9.ah = c.ah;
        this.c9.width = c.width;
        this.c9.height = c.height;
        this.c9.m = c.m;
        this.c9.l = c.l;
        this.c9.n = c.n;
        this.c9.o = c.o;
        var d = this.bp(b);
        var e = this.c9.content;
        var f = c.content;
        e.item = f.item;
        e.series = f.series;
        e.thickness = f.thickness;
        if (e != null) {
            e.actualItemBrush = d;
            e.outline = d;
            e.thickness = this.de.th + 3;
        }
    };
    ScatterPolygonSeriesView.prototype.a5 = function (a, b) {
        _super.prototype.a5.call(this, a, b);
        var c = new DataTemplatePassInfo();
        c.isHitTestRender = b;
        c.context = a.h();
        c.viewportTop = this.bu.top;
        c.viewportLeft = this.bu.left;
        c.viewportWidth = this.bu.width;
        c.viewportHeight = this.bu.height;
        c.passID = "Markers";
        var d = new DataTemplateRenderInfo();
        d.passInfo = c;
        d.isHitTestRender = b;
        var e = new DataTemplateMeasureInfo();
        e.passInfo = c;
        var f = false;
        var g = a.h();
        e.context = g;
        d.context = g;
        var h = 0;
        var i = 0;
        if (this.de.ty != null && this.de.ty.passStarting != null) {
            this.de.ty.passStarting(c);
        }
        for (var j = 0; j < this.dk.count; j++) {
            var k = this.dk._inner[j];
            if (k._visibility == 1) {
                continue;
            }
            this.bg(k, j, b);
            if (b) {
                k = this.c9;
            }
            if (!f) {
                e.width = k.width;
                e.height = k.height;
                e.renderOffsetX = 0;
                e.renderOffsetY = 0;
                e.renderContext = a;
                var l = k.ah;
                if (l.measure != null) {
                    e.data = k.content;
                    l.measure(e);
                    f = e.isConstant;
                    if (f) {
                        h = e.width;
                        i = e.height;
                    }
                }
                d.availableWidth = e.width;
                d.availableHeight = e.height;
                d.renderOffsetX = e.renderOffsetX;
                d.renderOffsetY = e.renderOffsetY;
                d.renderContext = a;
            }
            else {
                d.availableWidth = h;
                d.availableHeight = i;
            }
            if (!isNaN_(k.width) && !isInfinity(k.width)) {
                d.availableWidth = k.width;
            }
            if (!isNaN_(k.height) && !isInfinity(k.height)) {
                d.availableHeight = k.height;
            }
            a.q(d, k);
            k.m = d.availableWidth;
            k.l = d.availableHeight;
            k.ai = d.renderOffsetX;
            k.aj = d.renderOffsetY;
        }
        if (this.de.ty != null && this.de.ty.passCompleted != null) {
            this.de.ty.passCompleted(c);
        }
    };
    ScatterPolygonSeriesView.prototype.ds = function () {
        this.de.ty = null;
    };
    ScatterPolygonSeriesView.prototype.dp = function () {
        this.de.ty = null;
        this.de.ty = this.de.t0;
    };
    ScatterPolygonSeriesView.prototype.dq = function () {
        this.de.uf = null;
    };
    ScatterPolygonSeriesView.prototype.dm = function () {
        this.de.uf = null;
        if (!isNaN_(this.e.fw) && this.e.fw != 1) {
            var a = BrushUtil.p(this.de.uh, this.e.fw);
            this.de.uf = a;
        }
        else {
            this.de.uf = this.de.uh;
        }
    };
    ScatterPolygonSeriesView.prototype.dr = function () {
        this.de.ug = null;
    };
    ScatterPolygonSeriesView.prototype.dn = function () {
        this.de.ug = null;
        this.de.ug = this.de.ui;
    };
    ScatterPolygonSeriesView.prototype.dl = function (a) {
        switch (a) {
            case "CircleMarkerTemplate":
                this.de.ty = this.de.ce.pm;
                break;
            case "TriangleMarkerTemplate":
                this.de.ty = this.de.ce.pv;
                break;
            case "PyramidMarkerTemplate":
                this.de.ty = this.de.ce.ps;
                break;
            case "SquareMarkerTemplate":
                this.de.ty = this.de.ce.pt;
                break;
            case "DiamondMarkerTemplate":
                this.de.ty = this.de.ce.pn;
                break;
            case "PentagonMarkerTemplate":
                this.de.ty = this.de.ce.pq;
                break;
            case "HexagonMarkerTemplate":
                this.de.ty = this.de.ce.po;
                break;
            case "TetragramMarkerTemplate":
                this.de.ty = this.de.ce.pq;
                break;
            case "PentagramMarkerTemplate":
                this.de.ty = this.de.ce.pr;
                break;
            case "HexagramMarkerTemplate":
                this.de.ty = this.de.ce.pp;
                break;
        }
    };
    ScatterPolygonSeriesView.prototype.du = function () {
        var e_4, _a;
        try {
            for (var _b = __values(fromEnum(this.dk)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.ah = this.de.ty;
            }
        }
        catch (e_4_1) {
            e_4 = { error: e_4_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_4)
                    throw e_4.error;
            }
        }
        this.aq();
    };
    ScatterPolygonSeriesView.prototype.d2 = function (a) {
        if (this.d1 == null) {
            this.d1 = new DataTemplateMeasureInfo();
            this.d1.context = this.k.h();
        }
        this.d1.width = a.width;
        this.d1.height = a.height;
        this.d1.data = a.content;
        var b = a.ah;
        if (b.measure != null) {
            b.measure(this.d1);
        }
        return new Size(1, this.d1.width, this.d1.height);
    };
    ScatterPolygonSeriesView.prototype.al = function (a) {
        var e_5, _a;
        var b = a;
        _super.prototype.al.call(this, b);
        try {
            for (var _b = __values(fromEnum(this.df.c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = this.df.item(c);
                if (d._visibility != 1) {
                    var e = typeCast(ScatterPolygonSeries.$, this.e);
                    var f = this.e.a9.getMarkerVisualData(e, d, e.ty);
                    b.markerShapes.add(typeCast(MarkerVisualData.$, f));
                }
            }
        }
        catch (e_5_1) {
            e_5 = { error: e_5_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_5)
                    throw e_5.error;
            }
        }
    };
    ScatterPolygonSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'><span";
        var b = this.e.a7.a$r(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.de.title + "</span><br/>";
        a += "</div>";
        return a;
    };
    ScatterPolygonSeriesView.$t = markType(ScatterPolygonSeriesView, 'ScatterPolygonSeriesView', ShapeSeriesViewBase.$);
    return ScatterPolygonSeriesView;
}(ShapeSeriesViewBase));
export { ScatterPolygonSeriesView };
