import * as tslib_1 from "tslib";
import * as React from 'react';
import { ZoomSliderOrientation_$type } from './ZoomSliderOrientation';
import { ZoomSliderResolvingAxisValueEventArgs } from './igr-zoom-slider-resolving-axis-value-event-args';
import { RectChangedEventArgs } from "igniteui-react-core/ES5/igr-rect-changed-event-args";
import { ZoomSlider } from "./ZoomSlider";
import { fromRect, toRect, ensureEnum, brushToString, stringToBrush, ensureBool, initializePropertiesFromCss, isValidProp } from "igniteui-react-core/ES5/componentUtil";
import { FontInfo } from "igniteui-react-core/ES5/FontInfo";
import { ReactRenderer } from "igniteui-react-core/ES5/react-renderer";
import { delegateCombine, delegateRemove } from "igniteui-react-core/ES5/type";
export var IgxZoomSliderComponent_PROVIDERS = [];
var ZoomSliderStylingDefaults = {};
var IgrZoomSlider = /** @class */ (function (_super) {
    tslib_1.__extends(IgrZoomSlider, _super);
    function IgrZoomSlider(props) {
        var _this = _super.call(this, props) || this;
        _this._wrapper = null;
        _this._implementation = null;
        _this._resolvingAxisValue = null;
        _this._resolvingAxisValue_wrapped = null;
        _this._windowRectChanged = null;
        _this._windowRectChanged_wrapped = null;
        _this._getMainRef = _this._getMainRef.bind(_this);
        _this._implementation = _this.createImplementation();
        if (document) {
            _this._container = document.createElement("div");
            _this._container.style.display = "block";
            _this._container.style.width = "100%";
            _this._container.style.height = "100%";
        }
        var root;
        root = _this._container;
        if (_this._container != null) {
            root = _this._container;
        }
        var ren = new ReactRenderer(root, document, true, ZoomSliderStylingDefaults);
        _this._wrapper = ren;
        var zoomSlider = _this.i;
        _this._zoomSlider = zoomSlider;
        zoomSlider.provideContainer(ren);
        zoomSlider.notifySizeChanged();
        _this.initializeProperties();
        ren.addSizeWatcher(function () {
            _this._zoomSlider.notifySizeChanged();
        });
        return _this;
    }
    Object.defineProperty(IgrZoomSlider.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (value) {
            this._height = value;
            if (this._elRef) {
                this._elRef.style.height = value;
                this._zoomSlider.notifySizeChanged();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "width", {
        get: function () {
            return this._width;
        },
        set: function (value) {
            this._width = value;
            if (this._elRef) {
                this._elRef.style.height = value;
                this._zoomSlider.notifySizeChanged();
            }
        },
        enumerable: true,
        configurable: true
    });
    IgrZoomSlider.prototype._getMainRef = function (ref) {
        this._elRef = ref;
    };
    IgrZoomSlider.prototype.render = function () {
        var div = React.createElement("div", {
            ref: this._getMainRef
        });
        //}
        return div;
    };
    IgrZoomSlider.prototype.initializeProperties = function () {
        var e_1, _a;
        try {
            for (var _b = tslib_1.__values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this[p] = this.props[p];
                }
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
    };
    // supports angular themes or custom properties set in CSS
    IgrZoomSlider.prototype.updateStyle = function () {
        initializePropertiesFromCss(this._elRef, this, "zoom-slider-");
    };
    IgrZoomSlider.prototype.componentWillUnmount = function () {
        this._zoomSlider.destroy();
        this._wrapper.destroy();
    };
    IgrZoomSlider.prototype.componentDidMount = function () {
        this._elRef.style.width = this._width ? this._width : "";
        this._elRef.style.height = this._height ? this._height : "";
        this._elRef.appendChild(this._container);
        this._zoomSlider.notifySizeChanged();
        this.initializeContent();
    };
    IgrZoomSlider.prototype.initializeContent = function () {
        this.updateStyle();
    };
    IgrZoomSlider.prototype.createImplementation = function () {
        return new ZoomSlider();
    };
    Object.defineProperty(IgrZoomSlider.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "panTransitionDuration", {
        get: function () {
            return this.i.bl;
        },
        set: function (v) {
            this.i.bl = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "maxZoomWidth", {
        get: function () {
            return this.i.bg;
        },
        set: function (v) {
            this.i.bg = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "pixelScalingRatio", {
        /**
         * Gets or sets the scaling value used to affect the pixel density of the control.
         * A higher scaling ratio will produce crisper visuals at the expense of memory.  Lower values will cause the control
         * to appear blurry.
        */
        get: function () {
            return this.i.bi;
        },
        set: function (v) {
            this.i.bi = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "actualPixelScalingRatio", {
        get: function () {
            return this.i.a4;
        },
        set: function (v) {
            this.i.a4 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "windowRect", {
        get: function () {
            return fromRect(this.i.windowRect);
        },
        set: function (v) {
            this.i.windowRect = toRect(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "minZoomWidth", {
        get: function () {
            return this.i.bh;
        },
        set: function (v) {
            this.i.bh = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "startInset", {
        get: function () {
            return this.i.startInset;
        },
        set: function (v) {
            this.i.startInset = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "endInset", {
        get: function () {
            return this.i.endInset;
        },
        set: function (v) {
            this.i.endInset = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "trackStartInset", {
        get: function () {
            return this.i.trackStartInset;
        },
        set: function (v) {
            this.i.trackStartInset = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "trackEndInset", {
        get: function () {
            return this.i.trackEndInset;
        },
        set: function (v) {
            this.i.trackEndInset = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "barExtent", {
        get: function () {
            return this.i.barExtent;
        },
        set: function (v) {
            this.i.barExtent = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "orientation", {
        get: function () {
            return this.i.e;
        },
        set: function (v) {
            this.i.e = ensureEnum(ZoomSliderOrientation_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerThumbBrush", {
        get: function () {
            return brushToString(this.i.e8);
        },
        set: function (v) {
            this.i.e8 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerThumbStrokeThickness", {
        get: function () {
            return this.i.be;
        },
        set: function (v) {
            this.i.be = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherThumbStrokeThickness", {
        get: function () {
            return this.i.a9;
        },
        set: function (v) {
            this.i.a9 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherThumbBrush", {
        get: function () {
            return brushToString(this.i.e0);
        },
        set: function (v) {
            this.i.e0 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerThumbOutline", {
        get: function () {
            return brushToString(this.i.e9);
        },
        set: function (v) {
            this.i.e9 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherThumbOutline", {
        get: function () {
            return brushToString(this.i.e1);
        },
        set: function (v) {
            this.i.e1 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerThumbRidgesBrush", {
        get: function () {
            return brushToString(this.i.fa);
        },
        set: function (v) {
            this.i.fa = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherThumbRidgesBrush", {
        get: function () {
            return brushToString(this.i.e2);
        },
        set: function (v) {
            this.i.e2 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerThumbWidth", {
        get: function () {
            return this.i.bf;
        },
        set: function (v) {
            this.i.bf = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherThumbWidth", {
        get: function () {
            return this.i.ba;
        },
        set: function (v) {
            this.i.ba = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerThumbHeight", {
        get: function () {
            return this.i.bd;
        },
        set: function (v) {
            this.i.bd = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherThumbHeight", {
        get: function () {
            return this.i.a8;
        },
        set: function (v) {
            this.i.a8 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerShadeBrush", {
        get: function () {
            return brushToString(this.i.e6);
        },
        set: function (v) {
            this.i.e6 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerShadeOutline", {
        get: function () {
            return brushToString(this.i.e7);
        },
        set: function (v) {
            this.i.e7 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerShadeStrokeThickness", {
        get: function () {
            return this.i.bc;
        },
        set: function (v) {
            this.i.bc = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherShadeBrush", {
        get: function () {
            return brushToString(this.i.ey);
        },
        set: function (v) {
            this.i.ey = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherShadeOutline", {
        get: function () {
            return brushToString(this.i.ez);
        },
        set: function (v) {
            this.i.ez = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherShadeStrokeThickness", {
        get: function () {
            return this.i.a7;
        },
        set: function (v) {
            this.i.a7 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "barBrush", {
        get: function () {
            return brushToString(this.i.et);
        },
        set: function (v) {
            this.i.et = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "barOutline", {
        get: function () {
            return brushToString(this.i.eu);
        },
        set: function (v) {
            this.i.eu = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "barStrokeThickness", {
        get: function () {
            return this.i.a5;
        },
        set: function (v) {
            this.i.a5 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "rangeThumbBrush", {
        get: function () {
            return brushToString(this.i.fb);
        },
        set: function (v) {
            this.i.fb = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "rangeThumbOutline", {
        get: function () {
            return brushToString(this.i.fc);
        },
        set: function (v) {
            this.i.fc = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "rangeThumbStrokeThickness", {
        get: function () {
            return this.i.bj;
        },
        set: function (v) {
            this.i.bj = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "rangeThumbRidgesBrush", {
        get: function () {
            return brushToString(this.i.fd);
        },
        set: function (v) {
            this.i.fd = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerCalloutBrush", {
        get: function () {
            return brushToString(this.i.e3);
        },
        set: function (v) {
            this.i.e3 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerCalloutTextColor", {
        get: function () {
            return brushToString(this.i.e5);
        },
        set: function (v) {
            this.i.e5 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerCalloutOutline", {
        get: function () {
            return brushToString(this.i.e4);
        },
        set: function (v) {
            this.i.e4 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "lowerCalloutStrokeThickness", {
        get: function () {
            return this.i.bb;
        },
        set: function (v) {
            this.i.bb = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherCalloutBrush", {
        get: function () {
            return brushToString(this.i.ev);
        },
        set: function (v) {
            this.i.ev = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherCalloutTextColor", {
        get: function () {
            return brushToString(this.i.ex);
        },
        set: function (v) {
            this.i.ex = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherCalloutOutline", {
        get: function () {
            return brushToString(this.i.ew);
        },
        set: function (v) {
            this.i.ew = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "higherCalloutStrokeThickness", {
        get: function () {
            return this.i.a6;
        },
        set: function (v) {
            this.i.a6 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "isCustomThumbProvided", {
        get: function () {
            return this.i.ab;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "isCustomRangeThumbProvided", {
        get: function () {
            return this.i.z;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "isCustomBarProvided", {
        get: function () {
            return this.i.y;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "isCustomShadeProvided", {
        get: function () {
            return this.i.aa;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "areThumbCalloutsEnabled", {
        get: function () {
            return this.i.q;
        },
        set: function (v) {
            this.i.q = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "thumbCalloutTextStyle", {
        get: function () {
            if (this.i.o == null) {
                return null;
            }
            return this.i.o.fontString;
        },
        set: function (v) {
            var fi = new FontInfo();
            fi.fontString = v;
            this.i.o = fi;
        },
        enumerable: true,
        configurable: true
    });
    /**
 * Release any resources held by the ZoomSlider.

*/
    IgrZoomSlider.prototype.destroy = function () {
        this.i.destroy();
    };
    /**
     * Called by the UI framework to provide a UI container for rendering this control.
    
    * @param container  * The UI container element.
    */
    IgrZoomSlider.prototype.provideContainer = function (container) {
        this.i.provideContainer(container);
    };
    IgrZoomSlider.prototype.flush = function () {
        this.i.c3();
    };
    IgrZoomSlider.prototype.trackDirty = function () {
        this.i.trackDirty();
    };
    /**
     * Shows the ZoomSlider.
    
    */
    IgrZoomSlider.prototype.show = function () {
        this.i.show();
    };
    /**
     * Hides the ZoomSlider.
    
    */
    IgrZoomSlider.prototype.hide = function () {
        this.i.hide();
    };
    Object.defineProperty(IgrZoomSlider.prototype, "resolvingAxisValue", {
        get: function () {
            return this._resolvingAxisValue;
        },
        set: function (ev) {
            var _this = this;
            if (this._resolvingAxisValue_wrapped !== null) {
                this.i.resolvingAxisValue = delegateRemove(this.i.resolvingAxisValue, this._resolvingAxisValue_wrapped);
                this._resolvingAxisValue_wrapped = null;
                this._resolvingAxisValue = null;
            }
            this._resolvingAxisValue = ev;
            this._resolvingAxisValue_wrapped = function (o, e) {
                var outerArgs = new ZoomSliderResolvingAxisValueEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeResolvingAxisValue) {
                    _this.beforeResolvingAxisValue(_this, outerArgs);
                }
                if (_this._resolvingAxisValue) {
                    _this._resolvingAxisValue(_this, outerArgs);
                }
            };
            this.i.resolvingAxisValue = delegateCombine(this.i.resolvingAxisValue, this._resolvingAxisValue_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrZoomSlider.prototype, "windowRectChanged", {
        /**
         * Occurs just after the current ZoomSlider's window rectangle is changed.
        */
        get: function () {
            return this._windowRectChanged;
        },
        set: function (ev) {
            var _this = this;
            if (this._windowRectChanged_wrapped !== null) {
                this.i.windowRectChanged = delegateRemove(this.i.windowRectChanged, this._windowRectChanged_wrapped);
                this._windowRectChanged_wrapped = null;
                this._windowRectChanged = null;
            }
            this._windowRectChanged = ev;
            this._windowRectChanged_wrapped = function (o, e) {
                var outerArgs = new RectChangedEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeWindowRectChanged) {
                    _this.beforeWindowRectChanged(_this, outerArgs);
                }
                if (_this._windowRectChanged) {
                    _this._windowRectChanged(_this, outerArgs);
                }
            };
            this.i.windowRectChanged = delegateCombine(this.i.windowRectChanged, this._windowRectChanged_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgrZoomSlider;
}(React.Component));
export { IgrZoomSlider };
