/*
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 { NumericAxisBase } from "./NumericAxisBase";
import { NumericScaleMode_$type } from "./NumericScaleMode";
import { DependencyProperty } from "igniteui-react-core";
import { NumericScaler } from "./NumericScaler";
import { enumGetBox, typeCast, markType, markDep } from "igniteui-react-core";
import { ArgumentNullException } from "igniteui-react-core";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-react-core";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
export let StraightNumericAxisBase = /*@__PURE__*/ (() => {
    class StraightNumericAxisBase extends NumericAxisBase {
        constructor() {
            super();
            this.nj = null;
            this.nn = false;
            this.nx();
        }
        a4() {
            return new StraightNumericAxisBaseView(this);
        }
        hs(a) {
            super.hs(a);
            this.nm = a;
        }
        get nl() {
            return this.c(StraightNumericAxisBase.nz);
        }
        set nl(a) {
            this.h(StraightNumericAxisBase.nz, a);
        }
        static nv(a, b) {
            let c = typeCast(StraightNumericAxisBase.$, a);
            c.nx();
            c.h2("Scaler", b.oldValue, b.newValue);
        }
        nk() {
            return null;
        }
        get_ni() {
            if (this.nj == null) {
                this.nx();
            }
            return this.nj;
        }
        set_ni(a) {
            let b = this.nj != a;
            if (b) {
                let c = this.nj;
                this.nj = a;
                this.h2("ActualScaler", c, a);
            }
        }
        get ni() {
            return this.get_ni();
        }
        set ni(a) {
            this.set_ni(a);
        }
        my(a, b, c, d, e, f, g) {
            let h = this.ni.t(a, b, c, f, g);
            f = h.p3;
            g = h.p4;
            return {
                p5: f,
                p6: g
            };
        }
        nw(a) {
            let b = this.nn;
            this.nn = true;
            a();
            this.nn = b;
        }
        nx() {
            let a = this.nl;
            if (a == null) {
                a = this.k3();
            }
            this.ni = a;
            if (this.ni == null) {
                throw new ArgumentNullException(0, "ActualScaler");
            }
            this.ns();
        }
        ns() {
            this.nm.bk();
        }
        hw(a, b, c, d) {
            if (this.nn) {
                return;
            }
            super.hw(a, b, c, d);
            switch (b) {
                case NumericAxisBase.$$p[6]:
                    this.nx();
                    break;
                case NumericAxisBase.$$p[5]:
                    this.nx();
                    break;
                case StraightNumericAxisBase.$$p[0]:
                    this.nx();
                    break;
                case "Scaler":
                    this.nx();
                    break;
                case "ActualScaler":
                    this.lb = typeCast(LogarithmicScaler.$, this.ni) !== null;
                    this.ns();
                    this.c1();
                    this.h8(false);
                    break;
                case "ActualMaximumValue":
                    this.nt();
                    break;
                case "ActualMinimumValue":
                    this.nu();
                    this.nx();
                    break;
            }
        }
        nu() {
            this.ni.y(this.lx);
        }
        nt() {
            this.ni.x(this.lw);
        }
        no(a, b) {
            if (a < this.lx) {
                a = this.lx;
            }
            else if (a > this.lw) {
                a = this.lw;
            }
            if (!b.cp) {
                return (a - this.lx) / (this.lw - this.lx);
            }
            else {
                return (a - this.lw) / (this.lx - this.lw);
            }
        }
    }
    StraightNumericAxisBase.$t = /*@__PURE__*/ markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.nz = /*@__PURE__*/ DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, /*@__PURE__*/ new PropertyMetadata(2, null, StraightNumericAxisBase.nv));
    StraightNumericAxisBase.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'h2', ['ScaleMode:nh:ny', [NumericScaleMode_$type, /*@__PURE__*/ enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
})();
/**
 * @hidden
 */
export let StraightNumericAxisBaseView = /*@__PURE__*/ (() => {
    class StraightNumericAxisBaseView extends NumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bj = null;
            this.bj = a;
        }
        bk() {
            this.bj.ni.x(this.bj.lw);
            this.bj.ni.y(this.bj.lx);
        }
    }
    StraightNumericAxisBaseView.$t = /*@__PURE__*/ markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
})();
