/*
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-react-core/ES5/DependencyProperty";
import { NumericScaler } from "./NumericScaler";
import { ArgumentNullException } from "igniteui-react-core/ES5/ArgumentNullException";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { Type, enumGetBox, typeCast, markType } from "igniteui-react-core/ES5/type";
import { PropertyMetadata } from "igniteui-react-core/ES5/PropertyMetadata";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
var StraightNumericAxisBase = /** @class */ (function (_super) {
    tslib_1.__extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.k6 = null;
        _this.la = false;
        _this.lk();
        return _this;
    }
    StraightNumericAxisBase.prototype.a1 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.gl = function (a) {
        _super.prototype.gl.call(this, a);
        this.k9 = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "k8", {
        get: function () {
            return this.c(StraightNumericAxisBase.lm);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.lm, a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.li = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.lk();
        c.gt("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.k7 = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_k5 = function () {
        if (this.k6 == null) {
            this.lk();
        }
        return this.k6;
    };
    StraightNumericAxisBase.prototype.set_k5 = function (a) {
        var b = this.k6 != a;
        if (b) {
            var c = this.k6;
            this.k6 = a;
            this.gt("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "k5", {
        get: function () {
            return this.get_k5();
        },
        set: function (a) {
            this.set_k5(a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.prototype.kr = function (a, b, c, d, e, f, g) {
        var h = this.k5.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.lj = function (a) {
        var b = this.la;
        this.la = true;
        a();
        this.la = b;
    };
    StraightNumericAxisBase.prototype.lk = function () {
        var a = this.k8;
        if (a == null) {
            a = this.ja();
        }
        this.k5 = a;
        if (this.k5 == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.lf();
    };
    StraightNumericAxisBase.prototype.lf = function () {
        this.k9.bg();
    };
    StraightNumericAxisBase.prototype.gn = function (a, b, c, d) {
        if (this.la) {
            return;
        }
        _super.prototype.gn.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[2]:
                this.lk();
                break;
            case NumericAxisBase.$$p[1]:
                this.lk();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.lk();
                break;
            case "Scaler":
                this.lk();
                break;
            case "ActualScaler":
                this.jh = typeCast(LogarithmicScaler.$, this.k5) !== null;
                this.lf();
                this.ck();
                this.gz(false);
                break;
            case "ActualMaximumValue":
                this.lg();
                break;
            case "ActualMinimumValue":
                this.lh();
                this.lk();
                break;
        }
    };
    StraightNumericAxisBase.prototype.lh = function () {
        this.k5.y(this.jw);
    };
    StraightNumericAxisBase.prototype.lg = function () {
        this.k5.x(this.jv);
    };
    StraightNumericAxisBase.prototype.lb = function (a, b) {
        if (a < this.jw) {
            a = this.jw;
        }
        else if (a > this.jv) {
            a = this.jv;
        }
        if (!b.ce) {
            return (a - this.jw) / (this.jv - this.jw);
        }
        else {
            return (a - this.jv) / (this.jw - this.jv);
        }
    };
    StraightNumericAxisBase.lm = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.li));
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
Type.dep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'gt', ['ScaleMode:k4:ll', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
var StraightNumericAxisBaseView = /** @class */ (function (_super) {
    tslib_1.__extends(StraightNumericAxisBaseView, _super);
    function StraightNumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bf = null;
        _this.bf = a;
        return _this;
    }
    StraightNumericAxisBaseView.prototype.bg = function () {
        this.bf.k5.x(this.bf.jv);
        this.bf.k5.y(this.bf.jw);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
/*<BeginStatics Name="Infragistics.Controls.Charts.StraightNumericAxisBase" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.StraightNumericAxisBase" />*/
