/*
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 { GridColumnOptionsViewBase } from "./GridColumnOptionsViewBase";
import { DomWrapper_$type } from "igniteui-webcomponents-core";
import { List$1 } from "igniteui-webcomponents-core";
import { Size } from "igniteui-webcomponents-core";
import { GridColumnOptionsUtilities } from "./GridColumnOptionsUtilities";
import { runOn, delegateCombine, markType } from "igniteui-webcomponents-core";
import { GridColumnOptionsSimpleSectionBase } from "./GridColumnOptionsSimpleSectionBase";
import { StringComparer } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
export let GridColumnPinOptionsView = /*@__PURE__*/ (() => {
    class GridColumnPinOptionsView extends GridColumnOptionsViewBase {
        constructor() {
            super(...arguments);
            this.y = null;
            this.z = null;
            this.q = null;
            this.v = null;
            this.u = null;
            this.o = null;
            this.p = null;
            this.r = null;
            this.s = null;
            this.t = false;
        }
        get n() {
            return this.b;
        }
        w() {
            let a = this.e;
            let b = this.n;
            this.u = a.createElement("div");
            let c = new List$1(DomWrapper_$type, 0);
            let d = ((() => { let e = GridColumnOptionsUtilities.f(a, GridColumnPinOptionsView.aa, b.p, b.j, new Size(1, 18, 18), this.o, this.r, this.y, true, true); this.o = e.p5; this.r = e.p6; this.y = e.p7; return e.ret; })());
            let e = ((() => { let f = GridColumnOptionsUtilities.f(a, GridColumnPinOptionsView.ab, b.p, b.j, new Size(1, 18, 18), this.p, this.s, this.z, false, true); this.p = f.p5; this.s = f.p6; this.z = f.p7; return f.ret; })());
            c.add(d);
            c.add(e);
            let f = [this.o, this.p];
            let g = ((() => { let h = GridColumnOptionsUtilities.h(a, f, c, b.p, b.j, this.q); this.q = h.p5; return h.ret; })());
            let h = this.q;
            h.selectionChanged = delegateCombine(h.selectionChanged, runOn(this, this.ae));
            this.u.append(g);
            return this.u;
        }
        x() {
            let a = this.e.createElement("label");
            return a;
        }
        af() {
            if (null == this.r || null == this.s) {
                return;
            }
            let a = this.n.b2;
            let t1 = a;
            L0: while (true) {
                switch (t1) {
                    case 0:
                        this.r.svgPath = GridColumnPinOptionsView.aa;
                        this.s.svgPath = GridColumnPinOptionsView.ab;
                        break;
                    case 1:
                        this.r.svgPath = GridColumnPinOptionsView.ac;
                        this.s.svgPath = GridColumnPinOptionsView.ab;
                        break;
                    case 2:
                        this.r.svgPath = GridColumnPinOptionsView.aa;
                        this.s.svgPath = GridColumnPinOptionsView.ad;
                        break;
                    default:
                        t1 = 0;
                        continue L0;
                }
                break;
            }
        }
        ag() {
            if (null == this.q) {
                return;
            }
            this.t = true;
            try {
                let a = this.n.b2;
                switch (a) {
                    case 0:
                        this.q.d = [];
                        break;
                    case 1:
                        this.q.d = [0];
                        break;
                    case 2:
                        this.q.d = [1];
                        break;
                }
            }
            finally {
                this.t = false;
            }
        }
        k() {
            super.k();
            if (null == this.g || null == this.e) {
                return;
            }
            this.v = this.x();
            let a = this.w();
            let b = this.e;
            let c = this.g;
            c.setStyleProperty("display", "flex");
            c.setStyleProperty("flex-direction", "row");
            c.setStyleProperty("flex-wrap", "no-wrap");
            c.setStyleProperty("justify-content", "space-between");
            c.setStyleProperty("align-items", "center");
            c.append(this.v);
            c.append(a);
        }
        m() {
            super.m();
            this.ag();
            this.af();
            let a = this.n;
            if (null != this.v) {
                this.v.setRawText(a.bw);
                if (a.bu) {
                    this.g.setStyleProperty("display", "flex");
                    this.v.setStyleProperty("display", "inline-block");
                }
                else {
                    this.g.setStyleProperty("display", "block");
                    this.v.setStyleProperty("display", "none");
                }
                this.v.setStyleProperty("font", a.aa.fontString);
            }
            if (null != this.y) {
                this.y.setRawText(this.n.b4);
            }
            if (null != this.z) {
                this.z.setRawText(this.n.b8);
            }
            a.bf(this.o);
            a.bf(this.p);
            a.be(this.q);
        }
        ae(a, b) {
            if (this.t) {
                return;
            }
            let c;
            if (null == this.q || null == this.q.d || 0 == this.q.d.length) {
                c = 0;
            }
            else {
                if (this.q.d.length > 1) {
                }
                let d = this.q.d[0];
                switch (d) {
                    case 0:
                        c = 1;
                        break;
                    case 1:
                        c = 2;
                        break;
                    default:
                        c = 0;
                        break;
                }
            }
            this.n.b2 = c;
            this.af();
        }
    }
    GridColumnPinOptionsView.$t = /*@__PURE__*/ markType(GridColumnPinOptionsView, 'GridColumnPinOptionsView', GridColumnOptionsViewBase.$);
    GridColumnPinOptionsView.aa = "M13.2,3.8l7.1,7.1l-2.8-0.1l-3.4,3.4l0.1,4.2l-3.5-3.5l-5.4,5.4l-1.4,0l0-1.4l5.4-5.4L5.7,9.8l4.2,0.1l3.4-3.4L13.2,3.8z";
    GridColumnPinOptionsView.ab = "M10.8,3.8l-7.1,7.1l2.8-0.1l3.4,3.4l-0.1,4.2l3.5-3.5l5.4,5.4l1.4,0l0-1.4l-5.4-5.4l3.5-3.5l-4.2,0.1l-3.4-3.4L10.8,3.8z";
    GridColumnPinOptionsView.ac = "M3,3.4l19,17.1l-1.3,1.2L12.1,14l-4.9,4.9l-1.4-0.1l-0.1-1.4l4.8-4.8l-8.9-8L3,3.4z M14.9,2.3l7.5,7.5l-2.8-0.1L16.1,13 l0,0.3l-5.4-4.8l0.9,0L15,5.1L14.9,2.3z";
    GridColumnPinOptionsView.ad = "M21,3.4L2,20.5l1.3,1.2l8.5-7.7l4.9,4.9l1.4-0.1l0.1-1.4l-4.8-4.8l8.9-8L21,3.4z M9.1,2.3L1.7,9.8l2.8-0.1L7.9,13l0,0.3 l5.4-4.8l-0.9,0L9,5.1L9.1,2.3z";
    return GridColumnPinOptionsView;
})();
/**
 * @hidden
 */
export let GridColumnPinOptions = /*@__PURE__*/ (() => {
    class GridColumnPinOptions extends GridColumnOptionsSimpleSectionBase {
        constructor() {
            super();
            this.b1 = 0;
            this.b3 = "Left";
            this.b7 = "Right";
        }
        f() {
            return new GridColumnPinOptionsView();
        }
        get_by() {
            return "Pin";
        }
        get by() {
            return this.get_by();
        }
        bq() {
            if (null == this.column) {
                return false;
            }
            return true;
        }
        a5() {
            let a = this.column;
            this.b1 = a != null ? a.fk : 0;
            super.a5();
        }
        a6(a, b) {
            super.a6(a, b);
            let c = this.column;
            if (null == c) {
                return;
            }
            switch (b.propertyName) {
                case "Pinned":
                    this.b1 = c != null ? c.fk : 0;
                    this.b0.m();
                    break;
            }
        }
        bc(a, b, c) {
            super.bc(a, b, c);
            switch (a) {
                case "PinLeftCaption":
                case "PinRightCaption":
                    this.b0.m();
                    break;
            }
        }
        get b2() {
            let a = this.column;
            if (null != a) {
                return a.fk;
            }
            return this.b1;
        }
        set b2(a) {
            this.b1 = a;
            let b = this.c;
            let c = this.column;
            if (null != b && null != c) {
                b.tf(c, this.b1);
            }
        }
        get b0() {
            return this.e;
        }
        get b4() {
            return this.b3;
        }
        set b4(a) {
            if (0 == StringComparer.b.compare(a, this.b3)) {
                return;
            }
            let b = this.b3;
            this.b3 = a;
            this.ba("PinLeftCaption", b, this.b3);
        }
        get b8() {
            return this.b7;
        }
        set b8(a) {
            if (0 == StringComparer.b.compare(a, this.b7)) {
                return;
            }
            let b = this.b7;
            this.b7 = a;
            this.ba("PinRightCaption", b, this.b7);
        }
    }
    GridColumnPinOptions.$t = /*@__PURE__*/ markType(GridColumnPinOptions, 'GridColumnPinOptions', GridColumnOptionsSimpleSectionBase.$);
    return GridColumnPinOptions;
})();
//# sourceMappingURL=GridColumnPinOptionsView_combined.js.map
