/*
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 { NativeUIElementBridge } from "./NativeUIElementBridge";
import { runOn, enumGetBox, EnumUtil, markType } from "./type";
import { NativeUIInputChangingEventArgs } from "./NativeUIInputChangingEventArgs";
import { NativeUIDisplayDensity_$type } from "./NativeUIDisplayDensity";
/**
 * @hidden
 */
export let IgcInputBridge = /*@__PURE__*/ (() => {
    class IgcInputBridge extends NativeUIElementBridge {
        constructor() {
            super(...arguments);
            this.d = null;
            this.c = null;
            this.e = null;
        }
        addHandler(a, b, c, d) {
            switch (c) {
                case 0:
                    let e = a;
                    this.d = e.listen("igcInput", runOn(this, this.f));
                    this.c = d;
                    this.e = b;
                    break;
            }
        }
        f(a) {
            if (this.c != null) {
                let b = new NativeUIInputChangingEventArgs();
                this.c(this.e, b);
            }
        }
        getValue(a, b) {
            switch (b) {
                case 2: return a.getProperty("value");
                case 1:
                    let c = a.getProperty("size");
                    let d = 1;
                    switch (c) {
                        case "small":
                            d = 2;
                            break;
                        case "medium":
                            d = 3;
                            break;
                        case "large":
                            d = 1;
                            break;
                        default:
                            d = 1;
                            break;
                    }
                    return enumGetBox(NativeUIDisplayDensity_$type, d);
            }
            return null;
        }
        removeHandler(a, b, c, d) {
            switch (c) {
                case 1:
                    if (this.d != null) {
                        this.d();
                    }
                    this.c = null;
                    this.e = null;
                    break;
            }
        }
        setValue(a, b, c) {
            switch (b) {
                case 3:
                    a.setProperty("value", c);
                    break;
                case 1:
                    let d = "large";
                    switch (EnumUtil.getEnumValue(NativeUIDisplayDensity_$type, c)) {
                        case 0:
                            d = "large";
                            break;
                        case 1:
                            d = "large";
                            break;
                        case 2:
                            d = "small";
                            break;
                        case 3:
                            d = "medium";
                            break;
                    }
                    a.setProperty("size", d);
                    break;
            }
        }
    }
    IgcInputBridge.$t = markType(IgcInputBridge, 'IgcInputBridge', NativeUIElementBridge.$);
    return IgcInputBridge;
})();
