/*
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-angular-core";
import { NumericScaler } from "./NumericScaler";
import { enumGetBox, typeCast, markType, markDep } from "igniteui-angular-core";
import { ArgumentNullException } from "igniteui-angular-core";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-angular-core";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
var StraightNumericAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.ni = null;
        _this.nm = false;
        _this.nw();
        return _this;
    }
    StraightNumericAxisBase.prototype.a3 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.hr = function (a) {
        _super.prototype.hr.call(this, a);
        this.nl = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "nk", {
        get: function () {
            return this.c(StraightNumericAxisBase.ny);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.ny, a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.nu = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.nw();
        c.h1("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.nj = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_nh = function () {
        if (this.ni == null) {
            this.nw();
        }
        return this.ni;
    };
    StraightNumericAxisBase.prototype.set_nh = function (a) {
        var b = this.ni != a;
        if (b) {
            var c = this.ni;
            this.ni = a;
            this.h1("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "nh", {
        get: function () {
            return this.get_nh();
        },
        set: function (a) {
            this.set_nh(a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.prototype.mx = function (a, b, c, d, e, f, g) {
        var h = this.nh.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.nv = function (a) {
        var b = this.nm;
        this.nm = true;
        a();
        this.nm = b;
    };
    StraightNumericAxisBase.prototype.nw = function () {
        var a = this.nk;
        if (a == null) {
            a = this.k2();
        }
        this.nh = a;
        if (this.nh == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.nr();
    };
    StraightNumericAxisBase.prototype.nr = function () {
        this.nl.bk();
    };
    StraightNumericAxisBase.prototype.hv = function (a, b, c, d) {
        if (this.nm) {
            return;
        }
        _super.prototype.hv.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[6]:
                this.nw();
                break;
            case NumericAxisBase.$$p[5]:
                this.nw();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.nw();
                break;
            case "Scaler":
                this.nw();
                break;
            case "ActualScaler":
                this.la = typeCast(LogarithmicScaler.$, this.nh) !== null;
                this.nr();
                this.c0();
                this.h7(false);
                break;
            case "ActualMaximumValue":
                this.ns();
                break;
            case "ActualMinimumValue":
                this.nt();
                this.nw();
                break;
        }
    };
    StraightNumericAxisBase.prototype.nt = function () {
        this.nh.y(this.lw);
    };
    StraightNumericAxisBase.prototype.ns = function () {
        this.nh.x(this.lv);
    };
    StraightNumericAxisBase.prototype.nn = function (a, b) {
        if (a < this.lw) {
            a = this.lw;
        }
        else if (a > this.lv) {
            a = this.lv;
        }
        if (!b.co) {
            return (a - this.lw) / (this.lv - this.lw);
        }
        else {
            return (a - this.lv) / (this.lw - this.lv);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.ny = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.nu));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'h1', ['ScaleMode:ng:nx', [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.nh.x(this.bj.lv);
        this.bj.nh.y(this.bj.lw);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
