/*
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, markType } from "igniteui-webcomponents-core";
import { Color } from "igniteui-webcomponents-core";
import { CellModel } from "./CellModel";
import { FontUtil } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
export let ContentCellModelHelper = /*@__PURE__*/ (() => {
    class ContentCellModelHelper extends Base {
        static g(a) {
            if (a == null) {
                return ContentCellModelHelper.f;
            }
            return a.color;
        }
        static c(a, b, c) {
            switch (c) {
                case 0:
                    a.setRawStyleProperty("text-align", "left");
                    break;
                case 1:
                    a.setRawStyleProperty("text-align", "center");
                    break;
                case 2:
                    a.setRawStyleProperty("text-align", "right");
                    break;
                case 3:
                    a.setRawStyleProperty("text-align", "center");
                    break;
            }
        }
        static e(a, b, c) {
            switch (c) {
                case 0:
                    b.setRawStyleProperty("vertical-align", "top");
                    break;
                case 1:
                    b.setRawStyleProperty("vertical-align", "center");
                    break;
                case 2:
                    b.setRawStyleProperty("vertical-align", "bottom");
                    break;
                case 3:
                    b.setRawStyleProperty("vertical-align", "center");
                    break;
            }
        }
        static a(a, b, c, d, e) {
            if (b.as) {
                if (b.ax(CellModel.ei) || b.ax(CellModel.dw) || b.ax(CellModel.gf) || b.aw("IsRowPinned") || b.aw("IsRowSticky") || b.aw("PinnedRowOpacity")) {
                    let f = Math.min(1, Math.max(0, b.cb));
                    let g = b.bz * (1 - f);
                    d.setRawStyleProperty("opacity", g.toString());
                    if (b.a4) {
                        e.b6(b.bz * f);
                    }
                }
                if (b.ax(CellModel.d7)) {
                    ContentCellModelHelper.d(d, b.kg);
                    if (b.a4) {
                        e.b3(b.kg);
                    }
                }
                if (b.ax(CellModel.fj)) {
                    switch (b.z) {
                        case 0:
                            d.setRawStyleProperty("white-space", "nowrap");
                            d.setRawStyleProperty("text-overflow", "ellipsis");
                            break;
                        case 3:
                        case 2:
                            d.setRawStyleProperty("white-space", "pre-wrap");
                            d.setRawStyleProperty("text-overflow", "ellipsis");
                            break;
                        case 1:
                            d.setRawStyleProperty("white-space", "nowrap");
                            d.setRawStyleProperty("text-overflow", "clip");
                            break;
                    }
                }
                if (b.ax(CellModel.e2) || b.ax(CellModel.ge)) {
                    let h = b.f;
                    let i = b.h;
                    ContentCellModelHelper.c(c, d, h);
                    e.bf(c, d, h);
                    ContentCellModelHelper.e(c, d, i);
                    if (b.a4) {
                        e.b2(h, i);
                    }
                }
                if (b.aw("ActualFontInfo")) {
                    ContentCellModelHelper.b(a, d, b.ad);
                }
                if (b.aw("IsEdited") || b.aw("IsDeleted")) {
                    if (b.ay || b.av) {
                        if (b.av) {
                            d.setRawStyleProperty("text-decoration", "line-through");
                        }
                        else {
                            d.setRawStyleProperty("text-decoration", "none");
                        }
                    }
                    else {
                        d.setRawStyleProperty("text-decoration", "none");
                    }
                }
            }
        }
        static b(a, b, c) {
            if (c == null) {
                c = FontUtil.getDefaultFont(a);
            }
            b.setRawStyleProperty("font", c.fontString);
        }
        static d(a, b) {
            let c = ContentCellModelHelper.g(b);
            a.setRawStyleProperty("color", c.colorString);
        }
    }
    ContentCellModelHelper.$t = /*@__PURE__*/ markType(ContentCellModelHelper, 'ContentCellModelHelper');
    ContentCellModelHelper.f = /*@__PURE__*/ Color.u(0, 0, 0, 0);
    return ContentCellModelHelper;
})();
//# sourceMappingURL=ContentCellModelHelper.js.map
