/*
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 * as tslib_1 from "tslib";
import { Base, runOn, delegateCombine, Point_$type, markType } from "igniteui-webcomponents-core";
import { IDraggerView_$type } from "./IDraggerView";
import { CanvasGestureDOMEventProxy } from "igniteui-webcomponents-core";
import { Rect } from "igniteui-webcomponents-core";
import { BaseDOMEventProxy } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var DraggerView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(DraggerView, _super);
    function DraggerView(a) {
        var _this = _super.call(this) || this;
        _this._model = null;
        _this.c = null;
        _this.a = null;
        _this.model = a;
        return _this;
    }
    Object.defineProperty(DraggerView.prototype, "model", {
        get: function () {
            return this._model;
        },
        set: function (a) {
            this._model = a;
        },
        enumerable: true,
        configurable: true
    });
    DraggerView.prototype.provideContainer = function (a) {
        if (a == null) {
            if (this.c != null) {
                this.c = null;
            }
            if (this.a != null) {
                this.a.al = null;
                this.a.ar();
            }
            return;
        }
        this.c = a;
        var b = Math.round(this.c.rootWrapper.width());
        var c = Math.round(this.c.rootWrapper.height());
        this.a = new CanvasGestureDOMEventProxy(this.c.rootWrapper, this.c, true);
        this.a.c3 = true;
        var d = this.a;
        d.onMouseOver = delegateCombine(d.onMouseOver, runOn(this, this.d));
        var e = this.a;
        e.onMouseUp = delegateCombine(e.onMouseUp, runOn(this, this.e));
        this.a.al = runOn(this, this.b);
        this.model.viewportWidth = b;
        this.model.viewportHeight = c;
    };
    DraggerView.prototype.onDetachedFromUI = function () {
        if (this.a != null) {
            this.a.bc(this.c.rootWrapper, "");
        }
    };
    DraggerView.prototype.onAttachedToUI = function () {
        if (this.a != null) {
            this.a.aq(this.c.rootWrapper, "");
        }
    };
    DraggerView.prototype.b = function (a) {
        return this.model.isDragActive;
    };
    DraggerView.prototype.d = function (a, b, c) {
        this.f(a);
    };
    DraggerView.prototype.e = function (a) {
        this.g(a);
    };
    DraggerView.prototype.captureMouse = function () {
    };
    DraggerView.prototype.releaseMouse = function () {
    };
    DraggerView.prototype.transformPoint = function (a, b) {
        var c = BaseDOMEventProxy.cz(this.c.rootWrapper);
        var d = { $type: Point_$type, x: a - c.x, y: b - c.y };
        return d;
    };
    DraggerView.prototype.f = function (a) {
        this.model.onMouseMove(a.x, a.y);
    };
    DraggerView.prototype.g = function (a) {
        this.model.onMouseUp(a.x, a.y);
    };
    DraggerView.prototype.onViewportSizeChanged = function (a, b) {
        this.a.bg = new Rect(0, 0, 0, a, b);
    };
    DraggerView.$t = markType(DraggerView, 'DraggerView', Base.$, [IDraggerView_$type]);
    return DraggerView;
}(Base));
export { DraggerView };
//# sourceMappingURL=DraggerView.js.map
