/*
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 { Base, String_$type, markType } from "igniteui-webcomponents-core";
import { List$1 } from "igniteui-webcomponents-core";
import { stringContains, stringReplace, stringIsNullOrEmpty } from "igniteui-webcomponents-core";
import { tryParseNumber } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
export let ColumnWidth = /*@__PURE__*/ (() => {
    class ColumnWidth extends Base {
        constructor() {
            super(...arguments);
            this.g = null;
            this.c = false;
            this.f = 0;
            this.d = 0;
        }
        get e() {
            return this.d;
        }
        set e(a) {
            this.d = a;
        }
        static get a() {
            return ((() => {
                let $ret = new ColumnWidth();
                $ret.c = true;
                $ret.e = 0;
                $ret.f = 1;
                return $ret;
            })());
        }
        static parse(a) {
            if (a == null) {
                return new ColumnWidth();
            }
            a = a.trim();
            let b = stringContains(a, "*");
            if (b || stringContains(a, "min=") || stringContains(a, "Min=") || stringContains(a, ",")) {
                let c = new ColumnWidth();
                c.c = b;
                a = stringReplace(a, " ", "");
                a = stringReplace(a, "min=", ",");
                a = stringReplace(a, "Min=", ",");
                a = stringReplace(a, "*,,", "*");
                a = stringReplace(a, "*,", "*");
                a = stringReplace(a, ",,", ",");
                let d = a.split('*');
                let e = new List$1(String_$type, 0);
                for (let f = 0; f < d.length; f++) {
                    let g = d[f].split(',');
                    for (let h = 0; h < g.length; h++) {
                        e.add(g[h]);
                    }
                }
                let i = e._inner[0];
                if (i != null) {
                    i = i.trim();
                }
                let j;
                if (stringIsNullOrEmpty(i)) {
                    j = 1;
                }
                else {
                    if (!((() => { let k = tryParseNumber(i, j); j = k.p1; return k.ret; })())) {
                        return new ColumnWidth();
                    }
                }
                c.f = j;
                if (e.count > 1 && e._inner[1] != null) {
                    e._inner[1] = stringReplace(e._inner[1], ">", "");
                    let k;
                    if (((() => { let l = tryParseNumber(e._inner[1], k); k = l.p1; return l.ret; })())) {
                        c.e = k;
                    }
                }
                return c;
            }
            else {
                let l = new ColumnWidth();
                l.c = false;
                let m;
                if (!((() => { let n = tryParseNumber(a, m); m = n.p1; return n.ret; })())) {
                    return new ColumnWidth();
                }
                l.f = m;
                return l;
            }
        }
    }
    ColumnWidth.$t = /*@__PURE__*/ markType(ColumnWidth, 'ColumnWidth');
    return ColumnWidth;
})();
//# sourceMappingURL=ColumnWidth.js.map
