/*
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.s9 = null;
        _this.s6 = new ScalerParams(1, ScatterPolygonSeries.uf, ScatterPolygonSeries.uf, false);
        _this.s7 = new ScalerParams(1, ScatterPolygonSeries.uf, ScatterPolygonSeries.uf, false);
        _this.tv = null;
        _this.s1 = 1;
        _this.sx = 1;
        _this.ab = ScatterPolygonSeries.$;
        return _this;
    }
    ScatterPolygonSeries.prototype.get_d8 = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.get_d3 = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.rg = function () {
        return this.tb();
    };
    ScatterPolygonSeries.prototype.sf = function (a) {
        var _this = this;
        var b = a;
        b.cv(this.uh);
        b.cw(this.ta);
        _super.prototype.sf.call(this, a);
        if (this.cx(a)) {
            return;
        }
        var c, d;
        var e = a.getViewInfo(c, d);
        c = e.p0;
        d = e.p1;
        var f = this.getEffectiveViewport1(a);
        this.s6 = new ScalerParams(1, d, c, this.qp.cg);
        this.s6.c = f;
        this.s7 = new ScalerParams(1, d, c, this.qr.cg);
        this.s7.c = f;
        if (c.width < 1 || c.height < 1) {
            return;
        }
        this.s9 = ((function () {
            var $ret = new ShapeAxisInfoCache();
            $ret.a = _this.qp;
            $ret.b = _this.qr;
            $ret.e = _this.qp.cg;
            $ret.f = _this.qr.cg;
            $ret.d = _this.ck;
            $ret.c = _this.qz;
            return $ret;
        })());
        if (this.tb()) {
            var g = new Dictionary$2(Base.$, OwnedPoint.$, 0);
            b.dd.l(g, 400, d, c, this.fv);
            b.dd.j(g, false);
            if (this.re()) {
                this.ts(a);
            }
        }
    };
    ScatterPolygonSeries.prototype.ts = function (a) {
        var _this = this;
        a.dh = true;
        this.qw.aw(this, this.re(), runOn(this, this.qe));
        var b = this.qw.d;
        var c = b != null;
        var d = this.getEffectiveViewport1(a);
        var e = this.ck == null ? 0 : this.ck.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.sa(g, e, a.q);
                }
                _this.qw.ac(f, h);
            }
        });
    };
    ScatterPolygonSeries.prototype.tb = function () {
        return this.tv != null && ((this.s5 != 1 && this.s5 != 0) || this.tw != null);
    };
    ScatterPolygonSeries.prototype.bx = function () {
        return new ScatterPolygonSeriesView(this);
    };
    ScatterPolygonSeries.prototype.l2 = function (a) {
        _super.prototype.l2.call(this, a);
        this.s8 = a;
    };
    ScatterPolygonSeries.prototype.get_hasMarkers = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.pa = function () {
        return this.ub;
    };
    ScatterPolygonSeries.prototype.pb = function () {
        return this.uc;
    };
    ScatterPolygonSeries.prototype.nh = function () {
        return this.tu;
    };
    ScatterPolygonSeries.prototype.i0 = function () {
        return this.i1(this, this.tv);
    };
    ScatterPolygonSeries.prototype.f4 = function () {
        return this.td;
    };
    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 1;
        }
        return this.s3;
    };
    ScatterPolygonSeries.prototype.m3 = function (a) {
        _super.prototype.m3.call(this, a);
        this.s3 = a;
    };
    Object.defineProperty(ScatterPolygonSeries.prototype, "sy", {
        get: function () {
            return this.sx;
        },
        set: function (a) {
            this.sx = a;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeries.prototype.s0 = function () {
        if (this.sz == 0) {
            return 2;
        }
        return this.sz;
    };
    ScatterPolygonSeries.prototype.m2 = function (a) {
        _super.prototype.m2.call(this, a);
        this.sz = a;
    };
    ScatterPolygonSeries.prototype.m4 = function (a) {
        _super.prototype.m4.call(this, a);
        this.td = a;
    };
    ScatterPolygonSeries.prototype.mz = function () {
        _super.prototype.mz.call(this);
        if (this.index < 0) {
            return;
        }
        if (this.tw != null) {
            this.s8.ds();
            this.s8.dp();
        }
        else {
            var a = MarkerSeries.qi(this, this.s5);
            var b = MarkerSeries.qq(a);
            if (b == null) {
                this.tu = MarkerSeries.q4;
            }
            else {
                this.s8.dl(b);
            }
        }
        if (this.ud != null && this.s5 != 13) {
            this.s8.dq();
            this.s8.dm();
        }
        else {
            if (this.s5 == 13) {
                this.ub = this.b0.bq();
            }
            else {
                if (this.sy != 2) {
                    if (this.cd != null) {
                        var c = this.cd.sk(this.index);
                        if (!isNaN_(this.fu) && this.fu != 1) {
                            c = BrushUtil.o(c, this.fu);
                        }
                        this.ub = c;
                    }
                    else {
                        this.ub = null;
                    }
                }
            }
        }
        if (this.ue != null) {
            this.s8.dr();
            this.s8.dn();
        }
        else {
            if (this.s5 == 13) {
                this.uc = this.b0.bq();
            }
            else {
                if (this.s3 == 2) {
                    this.uc = this.ub;
                }
                else {
                    this.uc = this.cd == null ? null : this.cd.sl(this.index);
                }
            }
        }
        if (this.sy == 2 && this.ud == null && this.s5 != 13) {
            if (this.uc != null) {
                var d = this.uc;
                if (!isNaN_(this.fu) && this.fu != 1) {
                    d = BrushUtil.o(d, this.fu);
                }
                this.ub = d;
            }
            else {
                this.ub = null;
            }
        }
    };
    ScatterPolygonSeries.prototype.lx = function () {
        _super.prototype.lx.call(this);
        this.s2 = this.s4();
        this.sy = this.s0();
    };
    ScatterPolygonSeries.prototype.l7 = function (a, b, c, d) {
        _super.prototype.l7.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.mz();
                this.l4();
                break;
            case ScatterPolygonSeries.$$p[6]:
                this.s2 = this.s4();
                this.mz();
                this.l4();
                break;
            case ScatterPolygonSeries.$$p[5]:
                this.sy = this.s0();
                this.mz();
                this.l4();
                break;
            case ScatterPolygonSeries.$$p[2]:
                this.tv = d;
                if (c == MarkerSeries.q4 || d == MarkerSeries.q4 || (c == null || d != null)) {
                    this.s8.du();
                    this.ml(false);
                }
                this.b0.bj();
                if (this.toolTip != null && this.d0) {
                    this.a6.a$aj(this, this.toolTip);
                }
                this.ml(false);
                this.ls();
                break;
            case ScatterPolygonSeries.$$p[12]:
                this.s8.cv(this.uh);
                this.ml(false);
                this.ls();
                break;
            case ScatterPolygonSeries.$$p[13]:
                this.s8.cw(this.ta);
                this.ml(false);
                this.ls();
                break;
            case ScatterPolygonSeries.$$p[4]:
                this.ml(false);
                this.ls();
                break;
            case ScatterPolygonSeries.$$p[0]:
            case ScatterPolygonSeries.$$p[1]:
                if (this.tb()) {
                    this.ml(false);
                }
                break;
        }
    };
    ScatterPolygonSeries.prototype.at = function (a, b) {
        var c = this.s8.b1(a);
        var d = null;
        if (c != null) {
            d = c.content;
        }
        if (d != null) {
            return d;
        }
        return _super.prototype.at.call(this, a, b);
    };
    ScatterPolygonSeries.prototype.tt = 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.c1 = function (a, b, c, d) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var e = this.qp;
        var f = new ScalerParams(1, this.cd.s9, this.p3, e.cg);
        f.c = this.getEffectiveViewport1(this.b0);
        var g = this.qr;
        var h = new ScalerParams(1, this.cd.s9, this.p3, g.cg);
        h.c = this.getEffectiveViewport1(this.b0);
        a.clear();
        this.s8.dt(function (i) {
            if (i._visibility == 0) {
                var j = new SeriesPointOfInterest();
                var k = i.n;
                var l = i.o;
                if (k < _this.p3.left || k > _this.p3.right || l < _this.p3.top || l > _this.p3.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.sv = function (a, b, c, d, e) {
        var _this = this;
        if (c == null || c.length != this.s9.d.count) {
            c = new Array(this.s9.d.count);
            for (var f = 0; f < this.s9.d.count; f++) {
                c[f] = PointUtil.create();
            }
        }
        var g = ((function () {
            var $ret = new ScalerParams(1, d, e, _this.qp.cg);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var h = ((function () {
            var $ret = new ScalerParams(1, d, e, _this.qr.cg);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var i = this.pv(a);
        var j = this.s9.a.el(i.left, g);
        var k = this.s9.a.el(i.right, g);
        var l = this.s9.b.el(i.bottom, h);
        var m = this.s9.b.el(i.top, h);
        if (this.s9.e) {
            var n = j;
            j = k;
            k = n;
        }
        if (this.s9.f) {
            var o = l;
            l = m;
            m = o;
        }
        var p = this.s9;
        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.s9.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.tc = 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.ck;
        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.uf = new Rect(0, 0, 0, 1, 1);
    ScatterPolygonSeries.$$p = markDep(DependencyProperty, PropertyMetadata, ScatterPolygonSeries, 'raisePropertyChanged', ['ActualMarkerBrush:ub:tx', [Brush.$], 'ActualMarkerOutline:uc:ty', [Brush.$], 'ActualMarkerTemplate:tu:tz', [DataTemplate.$, null], 'MarkerBrush:ud:t0', [Brush.$], 'MarkerCollisionAvoidance:sw:t1', [CollisionAvoidanceType_$type, enumGetBox(CollisionAvoidanceType_$type, 0)], 'MarkerFillMode:sz:t2', [MarkerFillMode_$type, enumGetBox(MarkerFillMode_$type, 0)], 'MarkerOutlineMode:s3:t3', [MarkerOutlineMode_$type, enumGetBox(MarkerOutlineMode_$type, 0)], 'MarkerOutline:ue:t4', [Brush.$], 'MarkerStyle:ug:t5', [Style.$], 'MarkerTemplate:tw:t6', [DataTemplate.$, null], 'MarkerThickness:td:t7', [1, DeviceUtils.g(2)], 'MarkerType:s5:t8', [MarkerType_$type, enumGetBox(MarkerType_$type, 1)], 'ShapeStyle:uh:t9', [Style.$, null], 'ShapeStyleSelector:ta:ua', [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.s9.d.item(b); }, runOn(_this, _this.dz), runOn(_this, _this.c7), runOn(_this, _this.di), function () { return _this.de.sw; });
        _this.dc.q = runOn(_this, _this.d2);
        return _this;
    }
    ScatterPolygonSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
            this.de.ue = Defaults.am;
            this.de.g1 = Defaults.z;
            this.de.td = Defaults.y;
            this.de.s5 = Defaults.f;
            this.de.sz = Defaults.b;
        }
    };
    Object.defineProperty(ScatterPolygonSeriesView.prototype, "dd", {
        get: function () {
            return this.dc;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeriesView.prototype.dz = function (a) {
        this.de.tt(a, this.df);
    };
    ScatterPolygonSeriesView.prototype.c7 = function () {
        this.c8 = this.de.sv(this, this.df, this.c8, this.bv, this.bu);
        return this.c8;
    };
    ScatterPolygonSeriesView.prototype.di = function () {
        this.dj = this.de.tc(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.ak = 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.tu;
        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.ub != null) {
                    d.actualItemBrush = this.de.ub;
                }
                else {
                    d.actualItemBrush = this.b3.o3;
                }
                if (this.de.ub != null) {
                    d.outline = this.de.uc;
                }
                else {
                    d.outline = this.b3.o6;
                }
                d.thickness = this.de.td;
            }
        }
    };
    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.td + 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.tu != null && this.de.tu.passStarting != null) {
            this.de.tu.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.tu != null && this.de.tu.passCompleted != null) {
            this.de.tu.passCompleted(c);
        }
    };
    ScatterPolygonSeriesView.prototype.ds = function () {
        this.de.tu = null;
    };
    ScatterPolygonSeriesView.prototype.dp = function () {
        this.de.tu = null;
        this.de.tu = this.de.tw;
    };
    ScatterPolygonSeriesView.prototype.dq = function () {
        this.de.ub = null;
    };
    ScatterPolygonSeriesView.prototype.dm = function () {
        this.de.ub = null;
        if (!isNaN_(this.e.fu) && this.e.fu != 1) {
            var a = BrushUtil.o(this.de.ud, this.e.fu);
            this.de.ub = a;
        }
        else {
            this.de.ub = this.de.ud;
        }
    };
    ScatterPolygonSeriesView.prototype.dr = function () {
        this.de.uc = null;
    };
    ScatterPolygonSeriesView.prototype.dn = function () {
        this.de.uc = null;
        this.de.uc = this.de.ue;
    };
    ScatterPolygonSeriesView.prototype.dl = function (a) {
        switch (a) {
            case "CircleMarkerTemplate":
                this.de.tu = this.de.cd.pl;
                break;
            case "TriangleMarkerTemplate":
                this.de.tu = this.de.cd.pu;
                break;
            case "PyramidMarkerTemplate":
                this.de.tu = this.de.cd.pr;
                break;
            case "SquareMarkerTemplate":
                this.de.tu = this.de.cd.ps;
                break;
            case "DiamondMarkerTemplate":
                this.de.tu = this.de.cd.pm;
                break;
            case "PentagonMarkerTemplate":
                this.de.tu = this.de.cd.pp;
                break;
            case "HexagonMarkerTemplate":
                this.de.tu = this.de.cd.pn;
                break;
            case "TetragramMarkerTemplate":
                this.de.tu = this.de.cd.pp;
                break;
            case "PentagramMarkerTemplate":
                this.de.tu = this.de.cd.pq;
                break;
            case "HexagramMarkerTemplate":
                this.de.tu = this.de.cd.po;
                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.tu;
            }
        }
        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.a8.getMarkerVisualData(e, d, e.tu);
                    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.a6.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 };
