/*
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 { Base, Point_$type, markType } from "igniteui-react-core/ES5/type";
var Frame = /** @class */ (function (_super) {
    tslib_1.__extends(Frame, _super);
    function Frame() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Frame.a = function (a, b, c, d) {
        var e = c.count;
        var f = d.count;
        var g = Math.max(e, f);
        var h = 1 - b;
        if (a.count < g) {
            a.s(a.count, new Array(g - a.count));
        }
        if (a.count > g) {
            a.v(g, a.count - g);
        }
        for (var i = 0; i < Math.min(e, f); ++i) {
            a._inner[i] = { $type: Point_$type, x: c._inner[i].x * h + d._inner[i].x * b, y: c._inner[i].y * h + d._inner[i].y * b };
        }
        if (e < f) {
            var j = e > 0 ? c._inner[e - 1] : { $type: Point_$type, x: 0, y: 0 };
            for (var k = e; k < f; ++k) {
                a._inner[k] = { $type: Point_$type, x: j.x * h + d._inner[k].x * b, y: j.y * h + d._inner[k].y * b };
            }
        }
        if (e > f) {
            var l = f > 0 ? d._inner[f - 1] : { $type: Point_$type, x: 0, y: 0 };
            for (var m = f; m < e; ++m) {
                a._inner[m] = { $type: Point_$type, x: c._inner[m].x * h + l.x * b, y: c._inner[m].y * h + l.y * b };
            }
        }
    };
    Frame.d = function (a, b, c, d, e) {
        var f = c.count;
        var g = d.count;
        var h = Math.max(f, g);
        var i = 1 - b;
        if (a.count < h) {
            a.s(a.count, new Array(h - a.count));
        }
        if (a.count > h) {
            a.v(h, a.count - h);
        }
        var j;
        var k;
        for (var l = 0; l < Math.min(f, g); ++l) {
            j = b * e._inner[l];
            j = j > 1 ? 1 : j;
            k = 1 - j;
            a._inner[l] = { $type: Point_$type, x: c._inner[l].x * k + d._inner[l].x * j, y: c._inner[l].y * k + d._inner[l].y * j };
        }
        if (f < g) {
            var m = f > 0 ? c._inner[f - 1] : { $type: Point_$type, x: 0, y: 0 };
            for (var n = f; n < g; ++n) {
                j = b * e._inner[n];
                j = j > 1 ? 1 : j;
                k = 1 - j;
                a._inner[n] = { $type: Point_$type, x: m.x * k + d._inner[n].x * j, y: m.y * k + d._inner[n].y * j };
            }
        }
        if (f > g) {
            var o = g > 0 ? d._inner[g - 1] : { $type: Point_$type, x: 0, y: 0 };
            for (var p = g; p < f; ++p) {
                j = b * e._inner[p];
                j = j > 1 ? 1 : j;
                k = 1 - j;
                a._inner[p] = { $type: Point_$type, x: c._inner[p].x * k + o.x * j, y: c._inner[p].y * k + o.y * j };
            }
        }
    };
    Frame.b = function (a, b, c, d) {
        var e = c.count;
        var f = d.count;
        var g = Math.max(e, f);
        var h = 1 - b;
        if (a.count < g) {
            var i = new Array(g - a.count);
            for (var j = 0; j < g - a.count; j++) {
                i[j] = 0;
            }
            a.s(a.count, i);
        }
        if (a.count > g) {
            a.v(g, a.count - g);
        }
        for (var k = 0; k < Math.min(e, f); ++k) {
            a._inner[k] = c._inner[k] * h + d._inner[k] * b;
        }
        if (e < f) {
            var l = e > 0 ? c._inner[e - 1] : 0;
            for (var m = e; m < f; ++m) {
                a._inner[m] = l * h + d._inner[m] * b;
            }
        }
        if (e > f) {
            var n = f > 0 ? d._inner[f - 1] : 0;
            for (var o = f; o < e; ++o) {
                a._inner[o] = c._inner[o] * h + n * b;
            }
        }
    };
    Frame.e = function (a, b, c, d, e) {
        var f = c.count;
        var g = d.count;
        var h = Math.max(f, g);
        var i = 1 - b;
        if (a.count < h) {
            var j = new Array(h - a.count);
            for (var k = 0; k < h - a.count; k++) {
                j[k] = 0;
            }
            a.s(a.count, j);
        }
        if (a.count > h) {
            a.v(h, a.count - h);
        }
        var l;
        var m;
        for (var n = 0; n < Math.min(f, g); ++n) {
            l = b * e._inner[n];
            l = l > 1 ? 1 : l;
            m = 1 - l;
            a._inner[n] = c._inner[n] * m + d._inner[n] * l;
        }
        if (f < g) {
            var o = f > 0 ? c._inner[f - 1] : 0;
            for (var p = f; p < g; ++p) {
                l = b * e._inner[p];
                l = l > 1 ? 1 : l;
                m = 1 - l;
                a._inner[p] = o * m + d._inner[p] * l;
            }
        }
        if (f > g) {
            var q = g > 0 ? d._inner[g - 1] : 0;
            for (var r = g; r < f; ++r) {
                l = b * e._inner[r];
                l = l > 1 ? 1 : l;
                m = 1 - l;
                a._inner[r] = c._inner[r] * m + q * l;
            }
        }
    };
    Frame.$t = markType(Frame, 'Frame');
    return Frame;
}(Base));
export { Frame };
