/*
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 { ValueType, toNullable, typeCast, Number_$type, markStruct } from "igniteui-angular-core";
import { ST_Percentage } from "./ST_Percentage";
import { DocCoreUtils } from "./DocCoreUtils";
import { ArgumentOutOfRangeException } from "igniteui-angular-core";
import { truncate } from "igniteui-angular-core";
/**
 * @hidden
 */
var ST_PositiveFixedPercentage = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ST_PositiveFixedPercentage, _super);
    function ST_PositiveFixedPercentage(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = _super.call(this) || this;
        _this.a = new ST_Percentage();
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    var c = _rest[0];
                    DocCoreUtils.aw(ST_PositiveFixedPercentage.$, ST_Percentage.l(c), "value", 0, 100);
                    _this.a = c;
                }
                break;
        }
        return _this;
    }
    ST_PositiveFixedPercentage.prototype.equals = function (a) {
        var b = toNullable(ST_PositiveFixedPercentage.$, typeCast(ST_PositiveFixedPercentage.$, a));
        if (ST_PositiveFixedPercentage.j(b, toNullable(ST_PositiveFixedPercentage.$, null))) {
            return false;
        }
        return ST_PositiveFixedPercentage.g(this, b.getValueOrDefault());
    };
    ST_PositiveFixedPercentage.prototype.getHashCode = function () {
        return this.a.getHashCode();
    };
    ST_PositiveFixedPercentage.prototype.toString = function () {
        return this.u(1);
    };
    ST_PositiveFixedPercentage.prototype.u = function (a) {
        return this.a.r(a);
    };
    ST_PositiveFixedPercentage.f = function (a, b) {
        var c = ST_PositiveFixedPercentage.t(a, b);
        if (ST_PositiveFixedPercentage.j(c, toNullable(ST_PositiveFixedPercentage.$, null))) {
            return c.getValueOrDefault();
        }
        throw DocCoreUtils.n(ST_PositiveFixedPercentage.$, a);
    };
    ST_PositiveFixedPercentage.t = function (a, b) {
        return ST_PositiveFixedPercentage.s(ST_Percentage.q(a, b));
    };
    ST_PositiveFixedPercentage.o = function (a) {
        if (a < 0 || a > 1) {
            throw new ArgumentOutOfRangeException(1, "value");
        }
        return (a * 100);
    };
    ST_PositiveFixedPercentage.p = function (a) {
        return truncate((a * 1000));
    };
    ST_PositiveFixedPercentage.g = function (a, b) {
        return ST_Percentage.e(a.a, b.a);
    };
    ST_PositiveFixedPercentage.h = function (a, b) {
        if (!a.hasValue) {
            return !b.hasValue;
        }
        else if (!b.hasValue) {
            return false;
        }
        return ST_PositiveFixedPercentage.g(a.value, b.value);
    };
    ST_PositiveFixedPercentage.i = function (a, b) {
        return !(ST_PositiveFixedPercentage.g(a, b));
    };
    ST_PositiveFixedPercentage.j = function (a, b) {
        if (!a.hasValue) {
            return b.hasValue;
        }
        else if (!b.hasValue) {
            return true;
        }
        return ST_PositiveFixedPercentage.i(a.value, b.value);
    };
    ST_PositiveFixedPercentage.d = function (a) {
        return new ST_PositiveFixedPercentage(1, a);
    };
    ST_PositiveFixedPercentage.s = function (a) {
        if (!a.hasValue) {
            return toNullable(ST_PositiveFixedPercentage.$, null);
        }
        return toNullable(ST_PositiveFixedPercentage.$, ST_PositiveFixedPercentage.d(a.value));
    };
    ST_PositiveFixedPercentage.b = function (a) {
        return a.a;
    };
    ST_PositiveFixedPercentage.r = function (a) {
        if (!a.hasValue) {
            return toNullable(ST_Percentage.$, null);
        }
        return toNullable(ST_Percentage.$, ST_PositiveFixedPercentage.b(a.value));
    };
    ST_PositiveFixedPercentage.m = function (a) {
        return ST_Percentage.l(a.a);
    };
    ST_PositiveFixedPercentage.q = function (a) {
        if (!a.hasValue) {
            return toNullable(Number_$type, null);
        }
        return toNullable(Number_$type, ST_PositiveFixedPercentage.m(a.value));
    };
    ST_PositiveFixedPercentage.$t = markStruct(ST_PositiveFixedPercentage, 'ST_PositiveFixedPercentage');
    return ST_PositiveFixedPercentage;
}(ValueType));
export { ST_PositiveFixedPercentage };
