/*
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 { StraightNumericAxisBase } from "./StraightNumericAxisBase";
import { IScaler_$type } from "./IScaler";
import { markType, TypeRegistrar } from "igniteui-react-core";
import { HorizontalAxisLabelPanel } from "./HorizontalAxisLabelPanel";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { RangeInfo } from "./RangeInfo";
import { HorizontalLogarithmicScaler } from "./HorizontalLogarithmicScaler";
import { FastHorizontalLinearScaler } from "./FastHorizontalLinearScaler";
import { isNaN_ } from "igniteui-react-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
/**
 * @hidden
 */
export let NumericXAxis = /*@__PURE__*/ (() => {
    class NumericXAxis extends StraightNumericAxisBase {
        constructor() {
            super();
            this.ab = NumericXAxis.$;
            this.jn = this.jl();
        }
        a3() {
            return new NumericXAxisView(this);
        }
        gx(a) {
            super.gx(a);
            this.l3 = a;
        }
        au() {
            if (this.cr) {
                return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel'));
            }
            else {
                return new HorizontalAxisLabelPanel();
            }
        }
        jl() {
            let a = super.jl();
            a.b.c = (b) => {
                if ((this.ay == null || this.ay.visibility == 0) && this.ai != null) {
                    this.av.a9 = b;
                    if (this.ay != null && (this.ay.location == 4 || this.ay.location == 5)) {
                        this.bh.it();
                    }
                }
            };
            a.k = (b, c, d) => this.hl(c, d, b.z, b.b, false);
            a.l = (b, c, d, e) => this.hm(c, d, e, b.z);
            a.m = (b, c) => {
                let d = b.y;
                let e = new ScalerParams(0, b.aa, b.z, this.cb, d);
                return this.dy(c, e);
            };
            a.q = (b, c) => true;
            a.j = (b) => this.gv(b.t, b.n, b.z, b.a, true);
            a.e = (b) => {
                b.n = b.z.bottom;
                if (this.ai != null && this.ai.bh != null) {
                    let c = b.n;
                    let d = b.r;
                    let e = this.hg(c, d, b.aa, b.z, b.y, b.z.top, b.z.bottom);
                    c = e.p0;
                    d = e.p1;
                    b.n = c;
                    b.r = d;
                }
            };
            a.p = (b, c, d) => {
                let e = Math.round(c);
                return e >= Math.floor(b.z.left) && e <= Math.ceil(b.z.right);
            };
            return a;
        }
        dy(a, b) {
            if (this.lm != null) {
                return this.lm.p(a, b);
            }
            return this.ll.p(a, b);
        }
        d1(a, b) {
            if (this.lm != null) {
                return this.lm.q(a, b);
            }
            return this.ll.q(a, b);
        }
        gs(a, b, c, d) {
            if (this.lm != null) {
                this.lm.v(a, b, c, d);
                return;
            }
            this.ll.v(a, b, c, d);
        }
        gr(a, b, c, d, e) {
            if (this.lm != null) {
                this.lm.u(a, b, c, d, e);
                return;
            }
            this.ll.u(a, b, c, d, e);
        }
        gt(a, b, c, d) {
            if (this.lm != null) {
                this.lm.j(a, b, c, d);
                return;
            }
            this.ll.j(a, b, c, d);
        }
        l4(a, b) {
            if (this.bh == null || a == NaN || b == NaN) {
                return;
            }
            let c = this.lr(a, this);
            let d = this.lr(b, this);
            if (c == NaN || d == NaN) {
                return;
            }
            this.bh.oi = new Rect(0, c, this.bh.oi.y, d - c, this.bh.oi.height);
        }
        jo(a, b, c, d) {
            let e = d;
            let f = super.jo(a, b, c, d);
            let g = new ScalerParams(0, b, a, this.ca, c);
            let h = NaN;
            let i = NaN;
            if (!this.ca && b.right == 1) {
                i = this.kb;
            }
            else if (this.ca && b.left == 0) {
                h = this.kb;
            }
            if (isNaN_(h)) {
                h = this.d1(e.left, g);
            }
            if (isNaN_(i)) {
                i = this.d1(e.right, g);
            }
            let j = Math.min(h, i);
            let k = Math.max(h, i);
            this.kf = j;
            this.ke = k;
            f.k.add(((() => {
                let $ret = new RangeInfo();
                $ret.d = j;
                $ret.c = k;
                $ret.b = e.width;
                return $ret;
            })()));
            return f;
        }
        hc(a) {
            super.hc(a);
            let b = this.bh != null ? this.bh.n2 : Rect.empty;
            let c = !b.isEmpty ? this.i9 : Rect.empty;
            let d = this.i4();
            let e = this.i3();
            let f = this.jn.c(a, c, b, d, e);
            if (f != null) {
                this.ka = f.f.m;
                this.kd = f.f.l;
            }
        }
        hn(a, b) {
            super.hn(a, b);
            if (b.height != a.height) {
                this.cn();
            }
        }
        get_a1() {
            return 0;
        }
        get a1() {
            return this.get_a1();
        }
        jq() {
            if (this.j1) {
                return new HorizontalLogarithmicScaler();
            }
            switch (this.lk) {
                case 0: return new FastHorizontalLinearScaler();
                case 1: return new HorizontalLogarithmicScaler();
            }
            return null;
        }
        j$c(a, b) {
            return this.d1.apply(this, arguments);
        }
        j$b(a, b) {
            return this.dy.apply(this, arguments);
        }
        j$d(a, b, c, d, e) {
            this.gr.apply(this, arguments);
        }
        j$e(a, b, c, d) {
            this.gs.apply(this, arguments);
        }
        j$f(a, b, c, d) {
            this.gt.apply(this, arguments);
        }
        get j$a() {
            return this.ca;
        }
    }
    NumericXAxis.$t = /*@__PURE__*/ markType(NumericXAxis, 'NumericXAxis', StraightNumericAxisBase.$, [IScaler_$type]);
    return NumericXAxis;
})();
/**
 * @hidden
 */
export let NumericXAxisView = /*@__PURE__*/ (() => {
    class NumericXAxisView extends StraightNumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bi = null;
            this.bi = a;
        }
    }
    NumericXAxisView.$t = /*@__PURE__*/ markType(NumericXAxisView, 'NumericXAxisView', StraightNumericAxisBaseView.$);
    return NumericXAxisView;
})();
//# sourceMappingURL=NumericXAxis_combined.js.map
