/*
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 { __extends } from "tslib";
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
 */
var StraightNumericAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.nj = null;
        _this.nn = false;
        _this.nx();
        return _this;
    }
    StraightNumericAxisBase.prototype.a4 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.hs = function (a) {
        _super.prototype.hs.call(this, a);
        this.nm = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "nl", {
        get: function () {
            return this.c(StraightNumericAxisBase.nz);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.nz, a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.nv = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.nx();
        c.h2("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.nk = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_ni = function () {
        if (this.nj == null) {
            this.nx();
        }
        return this.nj;
    };
    StraightNumericAxisBase.prototype.set_ni = function (a) {
        var b = this.nj != a;
        if (b) {
            var c = this.nj;
            this.nj = a;
            this.h2("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "ni", {
        get: function () {
            return this.get_ni();
        },
        set: function (a) {
            this.set_ni(a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.prototype.my = function (a, b, c, d, e, f, g) {
        var h = this.ni.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.nw = function (a) {
        var b = this.nn;
        this.nn = true;
        a();
        this.nn = b;
    };
    StraightNumericAxisBase.prototype.nx = function () {
        var a = this.nl;
        if (a == null) {
            a = this.k3();
        }
        this.ni = a;
        if (this.ni == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.ns();
    };
    StraightNumericAxisBase.prototype.ns = function () {
        this.nm.bk();
    };
    StraightNumericAxisBase.prototype.hw = function (a, b, c, d) {
        if (this.nn) {
            return;
        }
        _super.prototype.hw.call(this, 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;
        }
    };
    StraightNumericAxisBase.prototype.nu = function () {
        this.ni.y(this.lx);
    };
    StraightNumericAxisBase.prototype.nt = function () {
        this.ni.x(this.lw);
    };
    StraightNumericAxisBase.prototype.no = function (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 = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.nz = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.nv));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'h2', ['ScaleMode:nh:ny', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
/**
 * @hidden
 */
var StraightNumericAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(StraightNumericAxisBaseView, _super);
    function StraightNumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bj = null;
        _this.bj = a;
        return _this;
    }
    StraightNumericAxisBaseView.prototype.bk = function () {
        this.bj.ni.x(this.bj.lw);
        this.bj.ni.y(this.bj.lx);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
