/*
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 { TickmarkValues } from "./TickmarkValues";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { LogarithmicNumericSnapper } from "./LogarithmicNumericSnapper";
import { Number_$type, typeGetValue, markType } from "igniteui-react-core/ES2015/type";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { truncate, logBase } from "igniteui-react-core/ES2015/number";
export class LogarithmicTickmarkValues extends TickmarkValues {
    constructor() {
        super(...arguments);
        this.t = null;
        this.u = null;
    }
    s(a) {
        super.s(a);
        let b = new LogarithmicNumericSnapper(a.n, a.m, this.x, a.k);
        this.m = 1;
        this.r = truncate(b.h);
        this.p = truncate(Math.floor(logBase(Math.max(4.94065645841247E-324, a.n), this.x)));
        this.q = truncate(Math.ceil(logBase(Math.max(4.94065645841247E-324, a.m), this.x)));
    }
    get x() {
        return typeGetValue(this.c(LogarithmicTickmarkValues.z));
    }
    set x(a) {
        this.h(LogarithmicTickmarkValues.z, a);
    }
    v(a) {
        let b = a * this.m;
        return Math.pow(this.x, b);
    }
    j() {
        let a = this.p;
        let b = this.q;
        let c = this.o;
        let d = 0;
        for (let e = a; e <= b; ++e) {
            let f = this.v(e);
            if (f <= c) {
                d++;
            }
        }
        if (this.t == null || this.t.length != d) {
            this.t = new Array(d);
        }
        let g = this.t;
        let h = 0;
        for (let i = a; i <= b; ++i) {
            let j = this.v(i);
            if (j <= c) {
                g[h] = j;
                h++;
            }
        }
        return g;
    }
    k() {
        let a = this.p;
        let b = this.q;
        let c = this.x;
        let d = this.r;
        let e = this.o;
        let f = 0;
        for (let g = a; g <= b; ++g) {
            let h = this.v(g);
            let i = Math.pow(c, g);
            for (let j = 1; j < this.r - 1; ++j) {
                let k = h + j * i;
                if (k <= e) {
                    f++;
                }
            }
        }
        if (this.u == null || this.u.length != f) {
            this.u = new Array(f);
        }
        let l = this.u;
        let m = 0;
        for (let n = a; n <= b; ++n) {
            let o = this.v(n);
            let p = Math.pow(c, n);
            for (let q = 1; q < this.r - 1; ++q) {
                let r = o + q * p;
                if (r <= e) {
                    l[m] = r;
                    m++;
                }
            }
        }
        return l;
    }
}
LogarithmicTickmarkValues.z = DependencyProperty.i("LogarithmBase", Number_$type, LogarithmicTickmarkValues.$, new PropertyMetadata(2, 10, (a, b) => {
}));
LogarithmicTickmarkValues.$t = markType(LogarithmicTickmarkValues, 'LogarithmicTickmarkValues', TickmarkValues.$);
/*<BeginStatics Name="Infragistics.Controls.Charts.LogarithmicTickmarkValues" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.LogarithmicTickmarkValues" />*/
