/*
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 * as tslib_1 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 */ (function (_super) {
    tslib_1.__extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.le = null;
        _this.li = false;
        _this.ls();
        return _this;
    }
    StraightNumericAxisBase.prototype.a1 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.gs = function (a) {
        _super.prototype.gs.call(this, a);
        this.lh = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "lg", {
        get: function () {
            return this.c(StraightNumericAxisBase.lu);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.lu, a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.lq = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.ls();
        c.g0("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.lf = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_ld = function () {
        if (this.le == null) {
            this.ls();
        }
        return this.le;
    };
    StraightNumericAxisBase.prototype.set_ld = function (a) {
        var b = this.le != a;
        if (b) {
            var c = this.le;
            this.le = a;
            this.g0("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "ld", {
        get: function () {
            return this.get_ld();
        },
        set: function (a) {
            this.set_ld(a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.prototype.kz = function (a, b, c, d, e, f, g) {
        var h = this.ld.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.lr = function (a) {
        var b = this.li;
        this.li = true;
        a();
        this.li = b;
    };
    StraightNumericAxisBase.prototype.ls = function () {
        var a = this.lg;
        if (a == null) {
            a = this.ji();
        }
        this.ld = a;
        if (this.ld == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.ln();
    };
    StraightNumericAxisBase.prototype.ln = function () {
        this.lh.bh();
    };
    StraightNumericAxisBase.prototype.gu = function (a, b, c, d) {
        if (this.li) {
            return;
        }
        _super.prototype.gu.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[2]:
                this.ls();
                break;
            case NumericAxisBase.$$p[1]:
                this.ls();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.ls();
                break;
            case "Scaler":
                this.ls();
                break;
            case "ActualScaler":
                this.jp = typeCast(LogarithmicScaler.$, this.ld) !== null;
                this.ln();
                this.cl();
                this.g6(false);
                break;
            case "ActualMaximumValue":
                this.lo();
                break;
            case "ActualMinimumValue":
                this.lp();
                this.ls();
                break;
        }
    };
    StraightNumericAxisBase.prototype.lp = function () {
        this.ld.y(this.j4);
    };
    StraightNumericAxisBase.prototype.lo = function () {
        this.ld.x(this.j3);
    };
    StraightNumericAxisBase.prototype.lj = function (a, b) {
        if (a < this.j4) {
            a = this.j4;
        }
        else if (a > this.j3) {
            a = this.j3;
        }
        if (!b.cf) {
            return (a - this.j4) / (this.j3 - this.j4);
        }
        else {
            return (a - this.j3) / (this.j4 - this.j3);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.lu = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.lq));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'g0', ['ScaleMode:lc:lt', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
/**
 * @hidden
 */
var StraightNumericAxisBaseView = /** @class */ (function (_super) {
    tslib_1.__extends(StraightNumericAxisBaseView, _super);
    function StraightNumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bg = null;
        _this.bg = a;
        return _this;
    }
    StraightNumericAxisBaseView.prototype.bh = function () {
        this.bg.ld.x(this.bg.j3);
        this.bg.ld.y(this.bg.j4);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
//# sourceMappingURL=StraightNumericAxisBase_combined.js.map