/*
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 { Frame } from "./Frame";
import { DictInterpolator$3 } from "./DictInterpolator$3";
import { OwnedPoint } from "./OwnedPoint";
import { Dictionary$2 } from "igniteui-react-core/ES5/Dictionary$2";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { Base, Point_$type, Array_$type, runOn, fromEnum, markType } from "igniteui-react-core/ES5/type";
import { isNaN_ } from "igniteui-react-core/ES5/number";
var ScatterFrameBase$1 = /** @class */ (function (_super) {
    tslib_1.__extends(ScatterFrameBase$1, _super);
    function ScatterFrameBase$1($t) {
        var _this = _super.call(this) || this;
        _this.$t = null;
        _this.f = null;
        _this.o = null;
        _this.j = null;
        _this.g = null;
        _this.m = null;
        _this.n = null;
        _this.h = null;
        _this.l = null;
        _this.i = null;
        _this.k = null;
        _this.$t = $t;
        _this.$type = _this.$type.specialize(_this.$t);
        _this.m = new List$1(Point_$type, 0);
        _this.g = new Dictionary$2(Base.$, OwnedPoint.$, 0);
        _this.j = new Dictionary$2(Base.$, OwnedPoint.$, 0);
        _this.n = new List$1(Point_$type, 0);
        _this.h = new Dictionary$2(Base.$, OwnedPoint.$, 0);
        _this.l = new Dictionary$2(Base.$, OwnedPoint.$, 0);
        _this.i = new Dictionary$2(Base.$, Array_$type, 0);
        _this.k = new Dictionary$2(Base.$, Array_$type, 0);
        _this.o = function (a, b, c) { return a; };
        _this.f = new DictInterpolator$3(Base.$, OwnedPoint.$, _this.$t, runOn(_this, _this.s), function (a) { return a.a; }, function (a) { return !isNaN_(a.c.x) && !isNaN_(a.c.y); }, function () { return new OwnedPoint(); });
        return _this;
    }
    ScatterFrameBase$1.prototype.c = function (a, b, c) {
        var d = b;
        var e = c;
        if (d == null || e == null) {
            return;
        }
        this.f.e(this.g, a, d.g, e.g, d, e);
        Frame.a(this.m, a, d.m, e.m);
        this.f.e(this.j, a, d.j, e.j, d, e);
        this.f.e(this.h, a, d.h, e.h, d, e);
        this.f.e(this.l, a, d.l, e.l, d, e);
        this.p(this.j, a, d, e);
        Frame.a(this.n, a, d.n, e.n);
        this.i = e.i;
        this.k = e.k;
        this.r(a, d, e);
    };
    ScatterFrameBase$1.prototype.r = function (a, b, c) {
    };
    ScatterFrameBase$1.prototype.p = function (a, b, c, d) {
        var _loop_1 = function (e) {
            if (a.containsKey(e.a)) {
                return "continue";
            }
            var f;
            if (!((function () { var g = d.g.tryGetValue(e.a, f); f = g.p1; return g.ret; })()) || (f.b.x == e.b.x && f.b.y == e.b.y)) {
                return "continue";
            }
            var g = new OwnedPoint();
            this_1.s(g, b, e, f, c, d);
            if (isNaN_(g.c.x) || isNaN_(g.c.y)) {
                return "continue";
            }
            a.addItem(g.a, g);
        };
        var this_1 = this;
        try {
            for (var _a = tslib_1.__values(fromEnum(c.g.values)), _b = _a.next(); !_b.done; _b = _a.next()) {
                var e = _b.value;
                _loop_1(e);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
            }
            finally { if (e_1) throw e_1.error; }
        }
        var e_1, _c;
    };
    ScatterFrameBase$1.prototype.q = function (a, b, c, d) {
        if (c != null) {
            a.b = { $type: Point_$type, x: c.b.x, y: c.b.y };
        }
        else if (d != null) {
            a.b = { $type: Point_$type, x: d.b.x, y: d.b.y };
        }
    };
    ScatterFrameBase$1.prototype.s = function (a, b, c, d, e, f) {
        var g;
        var h;
        if (c == null) {
            if (d != null) {
                var i_1;
                if (((function () { var j = e.g.tryGetValue(d.a, i_1); i_1 = j.p1; return j.ret; })())) {
                    g = i_1;
                }
                else {
                    g = this.o(d, e, f);
                }
            }
            else {
                a.c = { $type: Point_$type, x: NaN, y: NaN };
                return;
            }
        }
        else {
            g = c;
            if (a.a == null) {
                a.a = c.a;
            }
        }
        if (d == null) {
            if (c != null) {
                var j_1;
                if (((function () { var k = f.g.tryGetValue(c.a, j_1); j_1 = k.p1; return k.ret; })())) {
                    h = j_1;
                }
                else {
                    a.c = { $type: Point_$type, x: NaN, y: NaN };
                    return;
                }
            }
            else {
                a.c = { $type: Point_$type, x: NaN, y: NaN };
                return;
            }
        }
        else {
            h = d;
            if (a.a == null) {
                a.a = d.a;
            }
        }
        this.q(a, b, g, h);
        if (isNaN_(g.c.x) || isNaN_(g.c.y)) {
            g = h;
        }
        this.t(a, b, g, h);
    };
    ScatterFrameBase$1.prototype.t = function (a, b, c, d) {
        var e = 1 - b;
        a.c = { $type: Point_$type, x: c.c.x * e + d.c.x * b, y: c.c.y * e + d.c.y * b };
    };
    ScatterFrameBase$1.$t = markType(ScatterFrameBase$1, 'ScatterFrameBase$1', Frame.$);
    return ScatterFrameBase$1;
}(Frame));
export { ScatterFrameBase$1 };
