/*
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.nk = null;
            this.no = false;
            this.ny();
        }
        a4() {
            return new StraightNumericAxisBaseView(this);
        }
        ht(a) {
            super.ht(a);
            this.nn = a;
        }
        get nm() {
            return this.c(StraightNumericAxisBase.n0);
        }
        set nm(a) {
            this.h(StraightNumericAxisBase.n0, a);
        }
        static nw(a, b) {
            let c = typeCast(StraightNumericAxisBase.$, a);
            c.ny();
            c.h3("Scaler", b.oldValue, b.newValue);
        }
        nl() {
            return null;
        }
        get_nj() {
            if (this.nk == null) {
                this.ny();
            }
            return this.nk;
        }
        set_nj(a) {
            let b = this.nk != a;
            if (b) {
                let c = this.nk;
                this.nk = a;
                this.h3("ActualScaler", c, a);
            }
        }
        get nj() {
            return this.get_nj();
        }
        set nj(a) {
            this.set_nj(a);
        }
        mz(a, b, c, d, e, f, g) {
            let h = this.nj.t(a, b, c, f, g);
            f = h.p3;
            g = h.p4;
            return {
                p5: f,
                p6: g
            };
        }
        nx(a) {
            let b = this.no;
            this.no = true;
            a();
            this.no = b;
        }
        ny() {
            let a = this.nm;
            if (a == null) {
                a = this.k4();
            }
            this.nj = a;
            if (this.nj == null) {
                throw new ArgumentNullException(0, "ActualScaler");
            }
            this.nt();
        }
        nt() {
            this.nn.bn();
        }
        hx(a, b, c, d) {
            if (this.no) {
                return;
            }
            super.hx(a, b, c, d);
            switch (b) {
                case NumericAxisBase.$$p[6]:
                    this.ny();
                    break;
                case NumericAxisBase.$$p[5]:
                    this.ny();
                    break;
                case StraightNumericAxisBase.$$p[0]:
                    this.ny();
                    break;
                case "Scaler":
                    this.ny();
                    break;
                case "ActualScaler":
                    this.lc = typeCast(LogarithmicScaler.$, this.nj) !== null;
                    this.nt();
                    this.c1();
                    this.h9(false);
                    break;
                case "ActualMaximumValue":
                    this.nu();
                    break;
                case "ActualMinimumValue":
                    this.nv();
                    this.ny();
                    break;
            }
        }
        nv() {
            this.nj.y(this.ly);
        }
        nu() {
            this.nj.x(this.lx);
        }
        np(a, b) {
            if (a < this.ly) {
                a = this.ly;
            }
            else if (a > this.lx) {
                a = this.lx;
            }
            if (!b.cp) {
                return (a - this.ly) / (this.lx - this.ly);
            }
            else {
                return (a - this.lx) / (this.ly - this.lx);
            }
        }
    }
    StraightNumericAxisBase.$t = /*@__PURE__*/ markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.n0 = /*@__PURE__*/ DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, /*@__PURE__*/ new PropertyMetadata(2, null, StraightNumericAxisBase.nw));
    StraightNumericAxisBase.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'h3', ['ScaleMode:ni:nz', [NumericScaleMode_$type, /*@__PURE__*/ enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
})();
/**
 * @hidden
 */
export let StraightNumericAxisBaseView = /*@__PURE__*/ (() => {
    class StraightNumericAxisBaseView extends NumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bm = null;
            this.bm = a;
        }
        bn() {
            this.bm.nj.x(this.bm.lx);
            this.bm.nj.y(this.bm.ly);
        }
    }
    StraightNumericAxisBaseView.$t = /*@__PURE__*/ markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
})();
