/*
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 { EventProxy } from "./EventProxy";
import { Point_$type, runOn, markType, PointUtil, String_$type, Delegate_$type } from "./type";
import { Rect } from "./Rect";
import { MouseEventArgs } from "./MouseEventArgs";
import { Dictionary$2 } from "./Dictionary$2";
import { List$1 } from "./List$1";
export class BaseDOMEventProxy extends EventProxy {
    constructor() {
        super(...arguments);
        this.bs = null;
        this.bm = false;
        this.br = null;
        this.bf = false;
        this.bp = 0;
        this.bq = 0;
        this.bn = 0;
        this.bo = 0;
        this.bt = 0;
        this.cr = null;
        this.cq = null;
        this.be = false;
        this.bu = -1;
        this.bi = false;
        this.bg = false;
        this.bd = false;
    }
    d() {
        let a = new DOMEventProxy(this.bs, this.br, this.bm);
        a.z = this.z;
        a.aj = this.aj;
        return a;
    }
    bb(a) {
        return DOMEventProxy.cs(a);
    }
    ci(a) {
        if (!this.ab) {
            if (this.bh(a)) {
                a.preventDefault();
            }
        }
    }
    bh(e_) {
        return (e_.originalEvent.cancelable || e_.originalEvent.cancelable == undefined);
    }
    ce() {
        let source_ = this.bs.getNativeElement();
        BaseDOMEventProxy.ch(source_);
    }
    static ch(source_) {
        if (BaseDOMEventProxy.bk) {
            source_.style.touchAction = 'none';
        }
        else {
            source_.style.msTouchAction = 'none';
        }
        source_.style.msUserSelect = 'none';
        source_.style.webkitTouchCallout = 'none';
        source_.style.webkitUserSelect = 'none';
        source_.style.khtmlUserSelect = 'none';
        source_.style.mozUserSelect = 'none';
        source_.style.userSelect = 'none';
    }
    static cb(source_) {
        if (BaseDOMEventProxy.bk) {
            source_.style.touchAction = 'auto';
        }
        else {
            source_.style.msTouchAction = 'auto';
        }
        source_.style.msUserSelect = 'auto';
        source_.style.webkitTouchCallout = 'none';
        source_.style.webkitUserSelect = 'auto';
        source_.style.khtmlUserSelect = 'auto';
        source_.style.mozUserSelect = 'auto';
        source_.style.userSelect = 'auto';
    }
    cc() {
        let source_ = this.bs.getNativeElement();
        BaseDOMEventProxy.cb(source_);
    }
    ao() {
        super.ao();
        if (!this.ab) {
            this.ce();
        }
        else {
            this.cc();
        }
    }
    bz() {
        let ver_ = -1;
        let matchIE_ = /Trident\/([\d.]+)/;
        if ((matchIE_.exec(navigator.userAgent) != null)) {
            ver_ = (parseFloat(RegExp.$1));
        }
        return ver_;
    }
    by() {
        let ver_ = -1;
        let matchIE_ = /Edge\/([\d.]+)/;
        if ((matchIE_.exec(navigator.userAgent) != null)) {
            ver_ = (parseFloat(RegExp.$1));
        }
        return ver_;
    }
    static cg(e_) {
        let a = BaseDOMEventProxy.b0 >= 6;
        let oe_ = e_.originalEvent;
        if ((((typeof e_.pageX == 'undefined')) || a) && oe_.clientX != null) {
            let od_;
            if ((e_.target !== undefined)) {
                od_ = e_.target.ownerDocument;
            }
            else {
                od_ = e_.originalEvent.target.ownerDocument;
            }
            let ed_ = od_ ? od_ : document;
            let doc_ = ed_.documentElement;
            let body_ = ed_.body;
            let clientX_ = oe_.clientX;
            let clientY_ = oe_.clientY;
            let scrollLeft_ = doc_ && doc_.scrollLeft || body_ && body_.scrollLeft || 0;
            let scrollTop_ = doc_ && doc_.scrollTop || body_ && body_.scrollTop || 0;
            let clientLeft_ = doc_ && doc_.clientLeft || body_ && body_.clientLeft || 0;
            let clientTop_ = doc_ && doc_.clientTop || body_ && body_.clientTop || 0;
            e_.pageX = clientX_ + (scrollLeft_ - clientLeft_);
            e_.pageY = clientY_ + (scrollTop_ - clientTop_);
        }
        if ((!e_.pageX)) {
            e_.pageX = e_.originalEvent.pageX;
        }
        if ((!e_.pageY)) {
            e_.pageY = e_.originalEvent.pageY;
        }
        if (((typeof e_.button == 'undefined')) && ((typeof oe_.button != 'undefined'))) {
            e_.button = oe_.button;
        }
    }
    static cs(a) {
        let b = BaseDOMEventProxy.b0 >= 6;
        let source_ = a.getNativeElement();
        let d_ = source_.ownerDocument;
        let doc_ = d_ ? d_.documentElement : null;
        let z_ = doc_ ? doc_.msContentZoomFactor : null;
        let body_ = doc_.body;
        if ((z_ && z_ > 1) || b) {
            let rect_ = source_.getBoundingClientRect();
            let x_ = (rect_.left);
            let y_ = (rect_.top);
            let scrollLeft_ = (doc_ && doc_.scrollLeft || body_ && body_.scrollLeft || 0);
            let scrollTop_ = (doc_ && doc_.scrollTop || body_ && body_.scrollTop || 0);
            let clientLeft_ = (doc_ && doc_.clientLeft || body_ && body_.clientLeft || 0);
            let clientTop_ = (doc_ && doc_.clientTop || body_ && body_.clientTop || 0);
            let c = x_ + scrollLeft_ - clientLeft_;
            let d = y_ + scrollTop_ - clientTop_;
            return new Rect(0, c, d, 0, 0);
        }
        else {
            let e = a.getOffset();
            return new Rect(0, e.left, e.top, 0, 0);
        }
    }
    get bw() {
        return this.bt;
    }
    set bw(a) {
        this.bt = a;
    }
    cl(a) {
        this.al = a;
        BaseDOMEventProxy.cg(a);
        let b = BaseDOMEventProxy.cs(this.bs);
        this.bp = a.pageX - b.left;
        this.bq = a.pageY - b.top;
        this.bn = this.bp - this.bc.left;
        this.bo = this.bq - this.bc.top;
        this.cr = { $type: Point_$type, x: this.bp, y: this.bq };
        this.cq = { $type: Point_$type, x: this.bn, y: this.bo };
    }
    cm(e_) {
        this.al = e_;
        BaseDOMEventProxy.cg(e_);
        if (BaseDOMEventProxy.bj || BaseDOMEventProxy.bk) {
            let a = e_.pageX;
            let b = e_.pageY;
            let c = BaseDOMEventProxy.cs(this.bs);
            this.bp = a - c.left;
            this.bq = b - c.top;
        }
        else {
            this.bt = 0;
            if (!e_.originalEvent.targetTouches || e_.originalEvent.targetTouches.length < 1) {
                return;
            }
            ;
            this.bt = (e_.originalEvent.targetTouches.length);
            let d = (e_.originalEvent.targetTouches[0].pageX);
            let e = (e_.originalEvent.targetTouches[0].pageY);
            let f = BaseDOMEventProxy.cs(this.bs);
            this.bp = d - f.left;
            this.bq = e - f.top;
        }
        this.bn = this.bp - this.bc.left;
        this.bo = this.bq - this.bc.top;
        this.cr = { $type: Point_$type, x: this.bp, y: this.bq };
        this.cq = { $type: Point_$type, x: this.bn, y: this.bo };
    }
    ca(e_) {
        this.ck(e_);
        if (this.aa(this.cr, false, true)) {
            let deltaY_ = 0;
            let ev_ = e_;
            deltaY_ = (ev_.originalEvent ? ev_.originalEvent.deltaY : ev_.deltaY);
            let deltaX_ = 0;
            deltaX_ = (ev_.originalEvent ? ev_.originalEvent.deltaX : ev_.deltaX);
            let a = (ev_.originalEvent ? (ev_.originalEvent.deltaMode == 1) : (ev_.deltaMode == 1));
            if (a) {
                deltaY_ = deltaY_ * 40;
                deltaX_ = deltaX_ * 40;
            }
            let b = this.af(this.cq, deltaY_);
            if (b) {
                this.ci(e_);
            }
        }
    }
    b8(e_) {
        this.ck(e_);
        if (this.aa(this.cr, false, true)) {
            let delta_ = 0;
            if (e_.wheelDelta) {
                delta_ = e_.wheelDelta / 120;
            }
            ;
            if (e_.originalEvent && e_.originalEvent.wheelDelta) {
                delta_ = e_.originalEvent.wheelDelta / 120;
            }
            ;
            if (e_.detail) {
                delta_ = -e_.detail / 3;
            }
            ;
            if (e_.originalEvent && e_.originalEvent.detail) {
                delta_ = -e_.originalEvent.detail / 3;
            }
            ;
            delta_ = delta_ / 10;
            let a = this.af(this.cq, delta_);
            if (a) {
                this.ci(e_);
            }
        }
    }
    cf() {
        if (this.be) {
            if (this.bu == -1) {
                this.bu = this.br.setTimeout(runOn(this, this.cd), 500);
            }
            else {
                window.clearTimeout(this.bu);
                this.bu = -1;
                this.bu = this.br.setTimeout(runOn(this, this.cd), 500);
            }
        }
    }
    b1() {
        this.be = true;
        if (this.bu != -1) {
            window.clearTimeout(this.bu);
            this.bu = -1;
        }
    }
    cd() {
        this.be = false;
    }
    get bl() {
        return this.bg;
    }
    set bl(a) {
        this.bg = a;
    }
    b6(a) {
        if (this.bg || this.be) {
            return;
        }
        this.cl(a);
        if (this.bi) {
            this.bi = false;
            this.a0(this.cq);
        }
    }
    b7(a) {
        if (this.bg || this.be) {
            return;
        }
        this.cl(a);
        this.ck(a);
        let b = new MouseEventArgs();
        b.position = this.cr;
        if (this.aa(this.cr, false, false)) {
            if (!this.bi) {
                this.bi = true;
                this.az(this.cr);
            }
            this.a1(this.cr, true, false);
            this.aq(this.cq, false);
        }
        else if (this.bi) {
            this.b6(a);
        }
    }
    cj(a) {
        this.bs.focus();
    }
    b5(a) {
        if (this.bg || this.be) {
            return;
        }
        this.cj(a);
        this.cl(a);
        this.ck(a);
        if (this.aa(this.cr, false, false)) {
            this.bd = true;
            this.ay(this.cr);
            this.ar(this.cq, false);
            this.ci(a);
        }
    }
    cn(a) {
        if (this.bg || this.be) {
            return;
        }
        if (this.bd) {
            this.b9(a);
        }
    }
    b9(a) {
        if (this.bg || this.be) {
            return;
        }
        this.ck(a);
        if (PointUtil.equals(this.cr, null) || PointUtil.equals(this.cq, null)) {
            this.cl(a);
        }
        let b = this.aa(this.cr, false, false) || this.bd || this.bi;
        this.bd = false;
        this.a2(this.cr);
        this.ap(this.cq, false);
        if (b) {
            this.ci(a);
        }
    }
    b2(a) {
        this.b3(a, true);
    }
    b4(a) {
        this.b3(a, false);
    }
    cp(a) {
        return BaseDOMEventProxy.co(a);
    }
    static co(a) {
        let b;
        switch (a.which) {
            case 33:
                b = 10;
                break;
            case 34:
                b = 11;
                break;
            case 36:
                b = 13;
                break;
            case 37:
                b = 14;
                break;
            case 38:
                b = 15;
                break;
            case 39:
                b = 16;
                break;
            case 40:
                b = 17;
                break;
            case 9:
                b = 2;
                break;
            case 32:
                b = 9;
                break;
            case 13:
                b = 3;
                break;
            case 27:
                b = 8;
                break;
            case 16:
                b = 4;
                break;
            case 17:
                b = 5;
                break;
            case 18:
                b = 6;
                break;
            case 8:
                b = 1;
                break;
            case 35:
                b = 12;
                break;
            case 45:
                b = 18;
                break;
            case 46:
                b = 19;
                break;
            case 106:
                b = 78;
                break;
            case 107:
                b = 79;
                break;
            case 109:
                b = 80;
                break;
            case 110:
                b = 81;
                break;
            case 111:
                b = 82;
                break;
            case 220:
                b = 85;
                break;
            case 192:
                b = 86;
                break;
            case 191:
                b = 84;
                break;
            case 186:
                b = 83;
                break;
            case 189:
                b = 88;
                break;
            case 187:
                b = 87;
                break;
            default:
                if (112 <= a.which && a.which <= 123) {
                    b = (56 + a.which - 112);
                }
                else if (65 <= a.which && a.which <= 90) {
                    b = (30 + a.which - 65);
                }
                else if (48 <= a.which && a.which <= 57) {
                    b = (20 + a.which - 48);
                }
                else if (96 <= a.which && a.which <= 105) {
                    b = (68 + a.which - 96);
                }
                else {
                    b = 0;
                }
                break;
        }
        return b;
    }
    b3(a, b) {
        let c = this.cp(a);
        let d = c != 0;
        this.ck(a);
        if (d) {
            let e = false;
            if (b) {
                e = this.ad(c);
            }
            else {
                e = this.ae(c);
            }
            if (e) {
                this.ci(a);
            }
        }
    }
    ck(a) {
        this.al = a;
        this.a9 = 0;
        if (a.shiftKey) {
            this.a9 = this.a9 | 4;
        }
        if (a.altKey) {
            this.a9 = this.a9 | 1;
        }
        if (a.ctrlKey) {
            this.a9 = this.a9 | 2;
        }
        this.ag = a.button == 2;
    }
    ba() {
        let a = BaseDOMEventProxy.cs(this.bs);
        let b = a.left;
        let c = a.top;
        return { $type: Point_$type, x: b, y: c };
    }
}
BaseDOMEventProxy.bj = false;
BaseDOMEventProxy.bk = false;
BaseDOMEventProxy.b0 = 0;
BaseDOMEventProxy.bx = 0;
BaseDOMEventProxy.$t = markType(BaseDOMEventProxy, 'BaseDOMEventProxy', EventProxy.$);
export class DOMEventProxy extends BaseDOMEventProxy {
    constructor(a, b, c) {
        super();
        this.c4 = 0;
        this.c5 = "";
        this.cu = false;
        this.c1 = null;
        this.cx = new Dictionary$2(String_$type, List$1.$.specialize(Delegate_$type), 0);
        this.ds = null;
        this.c2 = -1;
        this.dt = null;
        this.cz = 0;
        this.c0 = 0;
        this.cy = 5;
        this.ct = false;
        this.dr = null;
        this.bm = c;
        this.br = b;
        this.aj = (d) => true;
        this.z = false;
        DOMEventProxy.c3++;
        this.c4 = DOMEventProxy.c3;
        this.c5 = ".DOMProxy" + this.c4.toString();
        this.a9 = 0;
        this.bs = a;
        BaseDOMEventProxy.bj = false;
        try {
            BaseDOMEventProxy.bj = (window.navigator.msPointerEnabled && MSGesture !== undefined);
        }
        catch (d) {
        }
        BaseDOMEventProxy.bk = false;
        try {
            BaseDOMEventProxy.bk = (window.PointerEvent || window.navigator.pointerEnabled);
        }
        catch (e) {
        }
        BaseDOMEventProxy.b0 = this.bz();
        BaseDOMEventProxy.bx = this.by();
        this.am(this.bs, "");
        this.ai = (f) => true;
    }
    c6(a, b, c) {
    }
    am(a, b) {
        let c = a;
        let d = this.c5 + b;
        if (!this.br.supportsDOMEvents()) {
            return;
        }
        let e = new List$1(Delegate_$type, 0);
        this.cx.addItem(d, e);
        this.c6(a, b, e);
        if ((!BaseDOMEventProxy.bj && !BaseDOMEventProxy.bk)) {
            e.add(c.listen("mousemove", runOn(this, this.b7)));
            e.add(c.listen("mouseleave", runOn(this, this.b6)));
            e.add(c.listen("mousedown", runOn(this, this.b5)));
            e.add(c.listen("mouseup", runOn(this, this.b9)));
            e.add(this.br.globalListen("window", "mouseup", runOn(this, this.cn)));
        }
        e.add(c.listen("keydown", runOn(this, this.b2)));
        e.add(c.listen("keyup", runOn(this, this.b4)));
        let source_ = this.bs.getNativeElement();
        if (!this.ab) {
            BaseDOMEventProxy.ch(source_);
        }
        if (BaseDOMEventProxy.bj || BaseDOMEventProxy.bk) {
            let f = this.bs.getNativeElement();
            if ((window.MSGesture !== undefined)) {
                let g = (new MSGesture());
                g.target = f;
                this.c1 = g;
                e.add(c.listen("MSGestureStart", runOn(this, this.c9)));
                e.add(c.listen("MSGestureChange", runOn(this, this.c7)));
                e.add(c.listen("MSGestureEnd", runOn(this, this.c8)));
            }
            if (BaseDOMEventProxy.bk) {
                e.add(c.listen("pointerdown", runOn(this, this.dc)));
                e.add(c.listen("pointerup", runOn(this, this.df)));
                e.add(c.listen("pointercancel", runOn(this, this.db)));
                e.add(c.listen("pointermove", runOn(this, this.dd)));
                e.add(c.listen("pointerout", runOn(this, this.de)));
                e.add(c.listen("lostpointercapture", runOn(this, this.da)));
            }
            else {
                e.add(c.listen("MSPointerDown", runOn(this, this.dc)));
                e.add(c.listen("MSPointerUp", runOn(this, this.df)));
                e.add(c.listen("MSPointerCancel", runOn(this, this.db)));
                e.add(c.listen("MSPointerMove", runOn(this, this.dd)));
                e.add(c.listen("MSPointerOut", runOn(this, this.de)));
                e.add(c.listen("MSLostPointerCapture", runOn(this, this.da)));
            }
        }
        if (this.bm) {
            e.add(c.listen("wheel", runOn(this, this.ca)));
        }
        else {
            e.add(c.listen("DOMMouseScroll", runOn(this, this.b8)));
            e.add(c.listen("mousewheel", runOn(this, this.b8)));
        }
        e.add(c.listen("gesturestart", runOn(this, this.c9)));
        e.add(c.listen("gesturechange", runOn(this, this.c7)));
        e.add(c.listen("gestureend", runOn(this, this.c8)));
        e.add(c.listen("touchstart", runOn(this, this.di)));
        e.add(c.listen("touchmove", runOn(this, this.dh)));
        e.add(c.listen("touchend", runOn(this, this.dg)));
    }
    df(e_) {
        let a = this.cv(e_);
        if (a) {
            this.bw = this.bw - 1;
            if (this.bw < 0) {
                this.bw = 0;
            }
        }
        if (this.bw < 2 && this.cu && a) {
            this.cu = false;
            let b = (e_.originalEvent.scale);
            this.aw(this.cq, b);
        }
        else {
            if (a) {
                this.dg(e_);
            }
            else {
                this.b9(e_);
            }
        }
    }
    da(e_) {
        let a = this.cv(e_);
        if (a) {
            this.bw--;
            if (this.bw < 0) {
                this.bw = 0;
            }
        }
        if (this.bw < 2 && this.cu && a) {
            this.cu = false;
            let b = (e_.originalEvent.scale);
            this.aw(this.cq, b);
        }
    }
    db(e_) {
        let a = this.cv(e_);
        if (a) {
            this.bw--;
            if (this.bw < 0) {
                this.bw = 0;
            }
        }
        if (this.bw < 2 && this.cu && a) {
            this.cu = false;
            let b = (e_.originalEvent.scale);
            this.aw(this.cq, b);
        }
    }
    dc(e_) {
        let a = this.cv(e_);
        if (this.c1 != null && a) {
            this.bw++;
            this.c1.addPointer((e_.originalEvent.pointerId));
        }
        let eventSource_ = this.bs.getNativeElement();
        if (BaseDOMEventProxy.bk) {
            eventSource_.setPointerCapture(e_.originalEvent.pointerId);
        }
        else {
            eventSource_.msSetPointerCapture(e_.originalEvent.pointerId);
        }
        if (this.bw > 1 && !this.cu && a) {
            this.cu = true;
            this.cm(e_);
            let b = (e_.originalEvent.scale);
            this.a4(this.cq, b);
        }
        else {
            if (a) {
                this.di(e_);
            }
            else {
                this.b5(e_);
            }
        }
    }
    cv(e_) {
        let pointerEvent_ = e_.originalEvent;
        let a = false;
        if (BaseDOMEventProxy.bk) {
            a = (pointerEvent_.pointerType == 'touch');
        }
        else {
            a = (pointerEvent_.pointerType == pointerEvent_.MSPOINTER_TYPE_TOUCH);
        }
        return a;
    }
    dd(e_) {
        let a = this.cv(e_);
        if (this.cu) {
            return;
        }
        if (a) {
            this.dh(e_);
        }
        else {
            this.b7(e_);
        }
    }
    de(e_) {
        let a = this.cv(e_);
        if (this.cu) {
            return;
        }
        if (a) {
        }
        else {
            this.b6(e_);
        }
    }
    c9(e_) {
        this.bi = true;
        this.ck(e_);
        this.cm(e_);
        this.dk();
        if (this.aa(this.cr, true, false)) {
            this.ci(e_);
            if ((BaseDOMEventProxy.bj || BaseDOMEventProxy.bk) && this.bw < 2) {
                return;
            }
            let a = (e_.originalEvent.scale);
            this.a4(this.cq, a);
        }
    }
    c7(e_) {
        this.bi = true;
        this.ck(e_);
        this.cm(e_);
        if (this.aa(this.cr, true, false)) {
            this.ci(e_);
            if ((BaseDOMEventProxy.bj || BaseDOMEventProxy.bk) && this.bw < 2) {
                return;
            }
            let a = (e_.originalEvent.scale);
            this.a3(this.cq, a);
        }
    }
    c8(e_) {
        this.ci(e_);
        let a = (e_.originalEvent.scale);
        this.bi = false;
        this.ck(e_);
        this.cm(e_);
        if ((!BaseDOMEventProxy.bj && !BaseDOMEventProxy.bk) || this.cu) {
            this.aw(this.cq, a);
        }
    }
    di(e_) {
        this.bi = true;
        this.ck(e_);
        this.cm(e_);
        this.ds = this.cq;
        if (this.aa(this.cr, true, false)) {
            if (!this.z) {
                this.ci(e_);
            }
            else {
                this.bl = true;
            }
            this.a1(this.cr, false, true);
            this.ay(this.cr);
            this.ar(this.cq, true);
            this.dn();
        }
    }
    dn() {
        if (this.c2 == -1) {
            this.cz = this.cr.x;
            this.c0 = this.cr.y;
            this.c2 = this.br.setTimeout(runOn(this, this.dl), 1500);
        }
    }
    dk() {
        if (Math.abs(this.cz - this.cr.x) > this.cy || Math.abs(this.c0 - this.cr.y) > this.cy) {
            this.dp();
        }
    }
    dp() {
        if (this.c2 != -1) {
            window.clearTimeout(this.c2);
            this.c2 = -1;
        }
    }
    dl() {
        this.c2 = -1;
        if (this.bl) {
            this.bl = false;
            this.b1();
        }
        this.ax(this.cq);
    }
    dh(a) {
        this.bi = true;
        this.ck(a);
        this.cm(a);
        if (this.bl) {
            if (this.aa(this.cr, true, false) && this.cw()) {
                this.bl = false;
                this.b1();
            }
        }
        this.dk();
        this.dq();
        if (this.aa(this.cr, true, false) && this.bw == 1 && !this.bl) {
            this.ci(a);
            if (!this.ct) {
                this.ct = true;
                this.dr = this.cq;
                this.av(this.dr);
            }
            else {
                this.a1(this.cr, true, true);
                this.aq(this.cq, true);
                this.au(this.cq);
            }
        }
    }
    cw() {
        let a = { $type: Point_$type, x: this.ds.x - this.cq.x, y: this.ds.y - this.cq.y };
        if (Math.abs(a.x) < 2 && Math.abs(a.y) < 2) {
            return false;
        }
        if (Math.abs(a.x) > Math.abs(a.y)) {
            a.y = 0;
        }
        if (Math.abs(a.y) > Math.abs(a.x)) {
            a.x = 0;
        }
        return this.aj(a);
    }
    dg(a) {
        this.bi = false;
        this.ck(a);
        this.cm(a);
        this.dp();
        if (this.bl) {
            this.bl = false;
            this.b1();
        }
        this.ci(a);
        this.a1(this.cr, false, true);
        this.a2(this.cr);
        if (this.bw == 0) {
            this.dm(this.cr);
            this.cf();
        }
        if (this.ct && this.bw == 0) {
            this.ct = false;
            this.dr = null;
            this.at(this.cq);
            this.cf();
        }
        this.ap(this.cq, true);
    }
    dm(a) {
        if (Rect.l_op_Equality(this.dt, null)) {
            this.dt = new Rect(0, a.x - 50, a.y - 50, 100, 100);
            this.br.setTimeout(runOn(this, this.dq), 500);
        }
        else {
            if (a.x >= this.dt.x && a.x <= this.dt.right && a.y >= this.dt.y && a.y <= this.dt.bottom) {
                this.dq();
                this.as(a);
            }
        }
    }
    dq() {
        this.dt = null;
    }
    dj(a) {
        if (this.cx.containsKey(a)) {
            let b = this.cx.item(a);
            this.cx.removeItem(a);
            for (let c = 0; c < b.count; c++) {
                b._inner[c]();
            }
            b.clear();
        }
    }
    a8(a, b) {
        let c = a;
        let d = this.c5 + b;
        this.dj(d);
    }
    an() {
        if (this.bs == null) {
            return;
        }
        this.dj(this.c5);
        this.bs = null;
    }
}
DOMEventProxy.c3 = 0;
DOMEventProxy.$t = markType(DOMEventProxy, 'DOMEventProxy', BaseDOMEventProxy.$);
/*<BeginStatics Name="Infragistics.Controls.BaseDOMEventProxy" />*/
/*<EndStatics Name="Infragistics.Controls.BaseDOMEventProxy" />*/
/*<BeginStatics Name="Infragistics.Controls.DOMEventProxy" />*/
/*<EndStatics Name="Infragistics.Controls.DOMEventProxy" />*/
//# sourceMappingURL=BaseDOMEventProxy_combined.js.map