/*
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";
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) {
    tslib_1.__extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.lm = null;
        _this.lq = false;
        _this.l0();
        return _this;
    }
    StraightNumericAxisBase.prototype.a3 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.gx = function (a) {
        _super.prototype.gx.call(this, a);
        this.lp = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "lo", {
        get: function () {
            return this.c(StraightNumericAxisBase.l2);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.l2, a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.ly = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.l0();
        c.g5("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.ln = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_ll = function () {
        if (this.lm == null) {
            this.l0();
        }
        return this.lm;
    };
    StraightNumericAxisBase.prototype.set_ll = function (a) {
        var b = this.lm != a;
        if (b) {
            var c = this.lm;
            this.lm = a;
            this.g5("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "ll", {
        get: function () {
            return this.get_ll();
        },
        set: function (a) {
            this.set_ll(a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.prototype.k7 = function (a, b, c, d, e, f, g) {
        var h = this.ll.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.lz = function (a) {
        var b = this.lq;
        this.lq = true;
        a();
        this.lq = b;
    };
    StraightNumericAxisBase.prototype.l0 = function () {
        var a = this.lo;
        if (a == null) {
            a = this.jq();
        }
        this.ll = a;
        if (this.ll == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.lv();
    };
    StraightNumericAxisBase.prototype.lv = function () {
        this.lp.bh();
    };
    StraightNumericAxisBase.prototype.gz = function (a, b, c, d) {
        if (this.lq) {
            return;
        }
        _super.prototype.gz.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[2]:
                this.l0();
                break;
            case NumericAxisBase.$$p[1]:
                this.l0();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.l0();
                break;
            case "Scaler":
                this.l0();
                break;
            case "ActualScaler":
                this.jx = typeCast(LogarithmicScaler.$, this.ll) !== null;
                this.lv();
                this.cn();
                this.hb(false);
                break;
            case "ActualMaximumValue":
                this.lw();
                break;
            case "ActualMinimumValue":
                this.lx();
                this.l0();
                break;
        }
    };
    StraightNumericAxisBase.prototype.lx = function () {
        this.ll.y(this.kc);
    };
    StraightNumericAxisBase.prototype.lw = function () {
        this.ll.x(this.kb);
    };
    StraightNumericAxisBase.prototype.lr = function (a, b) {
        if (a < this.kc) {
            a = this.kc;
        }
        else if (a > this.kb) {
            a = this.kb;
        }
        if (!b.ch) {
            return (a - this.kc) / (this.kb - this.kc);
        }
        else {
            return (a - this.kb) / (this.kc - this.kb);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.l2 = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.ly));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'g5', ['ScaleMode:lk:l1', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
/**
 * @hidden
 */
var StraightNumericAxisBaseView = /** @class */ /*@__PURE__*/ (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.ll.x(this.bg.kb);
        this.bg.ll.y(this.bg.kc);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
//# sourceMappingURL=StraightNumericAxisBase_combined.js.map
