/*
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 { TickmarkValues } from "./TickmarkValues";
import { LinearCategorySnapper } from "./LinearCategorySnapper";
import { markType } from "igniteui-react-core/ES5/type";
import { truncate } from "igniteui-react-core/ES5/number";
var CategoryTickmarkValues = /** @class */ (function (_super) {
    tslib_1.__extends(CategoryTickmarkValues, _super);
    function CategoryTickmarkValues() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.v = 0;
        _this.z = 0;
        _this.aa = null;
        _this.ab = null;
        _this.x = false;
        _this.w = null;
        _this.y = 0;
        _this.t = null;
        _this.u = null;
        return _this;
    }
    CategoryTickmarkValues.prototype.s = function (a) {
        _super.prototype.s.call(this, a);
        var b = a.a;
        this.v = b;
        this.z = a.q;
        this.aa = a.r;
        this.ab = a.s;
        this.x = a.e;
        this.w = a.c;
        var c = new LinearCategorySnapper(1, a.n, a.m, a.k, a.l, b, a.h);
        var d = c.g;
        if (a.i != -1) {
            d = a.i;
        }
        var e = Math.floor((a.n - a.g) / d);
        var f = Math.ceil((a.m - a.g) / d);
        var g = truncate(e);
        var h = truncate(f);
        var i = truncate(c.h);
        if (a.p != -1) {
            i = a.p;
        }
        this.m = d;
        this.n = a.j;
        this.p = g;
        this.q = h;
        this.r = i;
        this.y = a.g;
    };
    CategoryTickmarkValues.prototype.j = function () {
        var a = this.p;
        var b = this.q - a + 1;
        if (b < 0) {
            b = 0;
        }
        if (this.t == null || this.t.length != b) {
            this.t = new Array(b);
        }
        var c = this.t;
        for (var d = 0; d < b; ++d) {
            var e = this.y + (d + a) * this.m;
            c[d] = e;
        }
        return c;
    };
    CategoryTickmarkValues.prototype.k = function () {
        var a = this.m;
        var b = this.q;
        var c = this.p;
        var d = this.z;
        var e = this.v;
        a = Math.min(a, 20);
        var f = 0;
        for (var g = c; g < b; ++g) {
            if (e != 0 && d != 0) {
                for (var h = 0; h < truncate(a); h++) {
                    for (var i = 0; i < d; i++) {
                        f++;
                    }
                }
            }
        }
        if (this.u == null || this.u.length != f) {
            this.u = new Array(f);
        }
        var j = this.u;
        var k = 0;
        for (var l = c; l < b; ++l) {
            if (e != 0 && d != 0) {
                for (var m = 0; m < truncate(a); m++) {
                    for (var n = 0; n < d; n++) {
                        var o = this.w(n);
                        var p = m + (l * a) + o;
                        j[k] = p;
                        k++;
                    }
                }
            }
        }
        return this.u;
    };
    CategoryTickmarkValues.$t = markType(CategoryTickmarkValues, 'CategoryTickmarkValues', TickmarkValues.$);
    return CategoryTickmarkValues;
}(TickmarkValues));
export { CategoryTickmarkValues };
