import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrPropertyUpdatedEventArgs } from "igniteui-react-core";
import { IgrSeriesLayerPropertyOverlayValueResolvingEventArgs } from "./igr-series-layer-property-overlay-value-resolving-event-args";
import { SeriesLayerPropertyOverlay as SeriesLayerPropertyOverlay_internal } from "./SeriesLayerPropertyOverlay";
import { ensureBool } from "igniteui-react-core";
/**
 * Represents an axis annotation
*/
var IgrSeriesLayerPropertyOverlay = /** @class */ /*@__PURE__*/ (function () {
    function IgrSeriesLayerPropertyOverlay() {
        this.mounted = false;
        this._propertyUpdated = null;
        this._propertyUpdated_wrapped = null;
        this._valueResolving = null;
        this._valueResolving_wrapped = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._initializeAdapters) {
            this._initializeAdapters();
        }
    }
    IgrSeriesLayerPropertyOverlay.prototype.createImplementation = function () {
        return new SeriesLayerPropertyOverlay_internal();
    };
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    IgrSeriesLayerPropertyOverlay.prototype.onImplementationCreated = function () {
    };
    IgrSeriesLayerPropertyOverlay.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._initializeAdapters) {
            this._initializeAdapters();
        }
    };
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "isSourceOverlay", {
        /**
         * Gets or sets whether this property overlay targets the source series instead of the current layer while the layer is present.
        */
        get: function () {
            return this.i.r;
        },
        set: function (v) {
            this.i.r = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "isAlwaysApplied", {
        /**
         * Gets or sets whether this property overlay should be applied to the source or target even if the source property wasn't mutated.
        */
        get: function () {
            return this.i.p;
        },
        set: function (v) {
            this.i.p = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "internalPropertyName", {
        get: function () {
            return this.i.aa;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "propertyName", {
        /**
         * Gets or sets the property to overlay on the series or series layer.
        */
        get: function () {
            return this.i.ad;
        },
        set: function (v) {
            this.i.ad = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "currentValuePropertyName", {
        /**
         * Gets or sets the property from which to get the current value, if different from property name.
        */
        get: function () {
            return this.i.y;
        },
        set: function (v) {
            this.i.y = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "value", {
        /**
         * Gets or sets the value to overlay on the series or series layer.
        */
        get: function () {
            return this.i.x;
        },
        set: function (v) {
            this.i.x = v;
        },
        enumerable: false,
        configurable: true
    });
    IgrSeriesLayerPropertyOverlay.prototype.findByName = function (name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        return null;
    };
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "propertyUpdated", {
        /**
         * Event raised when a property value is changed.
        */
        get: function () {
            return this._propertyUpdated;
        },
        set: function (ev) {
            var _this = this;
            if (this._propertyUpdated_wrapped !== null) {
                this.i.propertyUpdated = delegateRemove(this.i.propertyUpdated, this._propertyUpdated_wrapped);
                this._propertyUpdated_wrapped = null;
                this._propertyUpdated = null;
            }
            this._propertyUpdated = ev;
            this._propertyUpdated_wrapped = function (o, e) {
                var outerArgs = new IgrPropertyUpdatedEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforePropertyUpdated) {
                    _this.beforePropertyUpdated(_this, outerArgs);
                }
                if (_this._propertyUpdated) {
                    _this._propertyUpdated(_this, outerArgs);
                }
            };
            this.i.propertyUpdated = delegateCombine(this.i.propertyUpdated, this._propertyUpdated_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrSeriesLayerPropertyOverlay.prototype, "valueResolving", {
        get: function () {
            return this._valueResolving;
        },
        set: function (ev) {
            var _this = this;
            if (this._valueResolving_wrapped !== null) {
                this.i.valueResolving = delegateRemove(this.i.valueResolving, this._valueResolving_wrapped);
                this._valueResolving_wrapped = null;
                this._valueResolving = null;
            }
            this._valueResolving = ev;
            this._valueResolving_wrapped = function (o, e) {
                var outerArgs = new IgrSeriesLayerPropertyOverlayValueResolvingEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeValueResolving) {
                    _this.beforeValueResolving(_this, outerArgs);
                }
                if (_this._valueResolving) {
                    _this._valueResolving(_this, outerArgs);
                }
            };
            this.i.valueResolving = delegateCombine(this.i.valueResolving, this._valueResolving_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    return IgrSeriesLayerPropertyOverlay;
}());
export { IgrSeriesLayerPropertyOverlay };
