import { __extends } from "tslib";
import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxAxisComponent } from "./igx-axis-component";
import { OverlayTextLocation_$type } from "./OverlayTextLocation";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { IgxOverlayTextUpdatingEventArgs } from "./igx-overlay-text-updating-event-args";
import { IgxSeriesComponent } from "./igx-series-component";
import { ValueOverlay } from "./ValueOverlay";
import { ensureBool, brushToString, stringToBrush, ensureEnum, toPoint, fromPoint } from "igniteui-angular-core";
import { FontInfo } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis.
*/
var IgxValueOverlayComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxValueOverlayComponent, _super);
    function IgxValueOverlayComponent() {
        var _this = _super.call(this) || this;
        _this._stylingOverlayText = null;
        return _this;
    }
    IgxValueOverlayComponent.prototype.createImplementation = function () {
        return new ValueOverlay();
    };
    Object.defineProperty(IgxValueOverlayComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axis", {
        /**
         * Gets or sets the axis used by the value overlay.
        */
        get: function () {
            var r = this.i.xb;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxAxisComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.xb = null : this.i.xb = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "value", {
        /**
         * Gets or sets the value of the overlay.
        */
        get: function () {
            return this.i.yc;
        },
        set: function (v) {
            this.i.yc = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "isAxisAnnotationEnabled", {
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get: function () {
            return this.i.xj;
        },
        set: function (v) {
            this.i.xj = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationFormatLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for the axis annotation.
        */
        get: function () {
            return this.i.xd;
        },
        set: function (v) {
            this.i.xd = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.aan);
        },
        set: function (v) {
            this.i.aan = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.aal);
        },
        set: function (v) {
            this.i.aal = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.xr;
        },
        set: function (v) {
            this.i.xr = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated positions.
        */
        get: function () {
            return this.i.yd;
        },
        set: function (v) {
            this.i.yd = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.aam);
        },
        set: function (v) {
            this.i.aam = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingLeft", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.xt;
        },
        set: function (v) {
            this.i.xt = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingTop", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.xv;
        },
        set: function (v) {
            this.i.xv = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingRight", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.xu;
        },
        set: function (v) {
            this.i.xu = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingBottom", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.xs;
        },
        set: function (v) {
            this.i.xs = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.xw;
        },
        set: function (v) {
            this.i.xw = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "isValueOverlay", {
        /**
         * Gets whether the series is a value overlay.
        */
        get: function () {
            return this.i.isValueOverlay;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "labelResolved", {
        get: function () {
            return this.i.ys;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextLocation", {
        /**
         * Gets or sets location of the overlay text in relation to shape of data annotation.
        */
        get: function () {
            return this.i.xe;
        },
        set: function (v) {
            this.i.xe = ensureEnum(OverlayTextLocation_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextHorizontalMargin", {
        /**
         * Gets or sets the horizontal margin of the overlay text in relation to shape of data annotation.
        */
        get: function () {
            return this.i.x5;
        },
        set: function (v) {
            this.i.x5 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextVerticalMargin", {
        /**
         * Gets or sets the vertical margin of the overlay text in relation to shape of data annotation.
        */
        get: function () {
            return this.i.x7;
        },
        set: function (v) {
            this.i.x7 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextHorizontalPadding", {
        /**
         * Gets or sets the horizontal padding of the overlay text in relation to shape of data annotation.
        */
        get: function () {
            return this.i.x6;
        },
        set: function (v) {
            this.i.x6 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextVerticalPadding", {
        /**
         * Gets or sets the vertical padding of the overlay text in relation to shape of data annotation.
        */
        get: function () {
            return this.i.x8;
        },
        set: function (v) {
            this.i.x8 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextAngle", {
        /**
         * Gets or sets the angle rotation (in degrees) of the overlay text in relation to shape of data annotation.
        */
        get: function () {
            return this.i.xz;
        },
        set: function (v) {
            this.i.xz = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextColor", {
        /**
         * Gets or sets the color the overlay text.
        */
        get: function () {
            return brushToString(this.i.aaq);
        },
        set: function (v) {
            this.i.aaq = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBackground", {
        /**
         * Gets or sets the background the overlay text.
        */
        get: function () {
            return brushToString(this.i.aao);
        },
        set: function (v) {
            this.i.aao = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderColor", {
        /**
         * Gets or sets the border stroke of the overlay text.
        */
        get: function () {
            return brushToString(this.i.aap);
        },
        set: function (v) {
            this.i.aap = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderRadius", {
        /**
         * Gets or sets the border corner of the overlay text.
        */
        get: function () {
            return this.i.x1;
        },
        set: function (v) {
            this.i.x1 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderThickness", {
        /**
         * Gets or sets the border thickness of the overlay text.
        */
        get: function () {
            return this.i.x3;
        },
        set: function (v) {
            this.i.x3 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextVisible", {
        /**
         * Gets or sets whether the overlay text is visible in shape of data annotation
        */
        get: function () {
            return this.i.xn;
        },
        set: function (v) {
            this.i.xn = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayText", {
        /**
         * Gets or sets the text that will be displayed as the overlay annotation.
        */
        get: function () {
            return this.i.yt;
        },
        set: function (v) {
            this.i.yt = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextColorShift", {
        /**
         * Gets or sets the shift of the overlay text color based on OverlayTextColorMode. Value must range between -1.0 to 1.0, where 0 means no color shift.
        */
        get: function () {
            return this.i.x4;
        },
        set: function (v) {
            this.i.x4 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextColorMode", {
        /**
         * Gets or sets the mode used for shifting the background of overlay text based on the target series.
        */
        get: function () {
            return this.i.xa;
        },
        set: function (v) {
            this.i.xa = ensureEnum(AnnotationAppearanceMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextColorMatchLayer", {
        /**
         * Gets or sets whether the overlay text color matches brush of the layer
        */
        get: function () {
            return this.i.xm;
        },
        set: function (v) {
            this.i.xm = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBackgroundShift", {
        /**
         * Gets or sets the shift of the overlay background based on OverlayTextBackgroundMode. Value must range between -1.0 to 1.0, where 0 means no color shift.
        */
        get: function () {
            return this.i.x0;
        },
        set: function (v) {
            this.i.x0 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBackgroundMode", {
        /**
         * Gets or sets the mode used for shifting the background of overlay text based on the target series.
        */
        get: function () {
            return this.i.w8;
        },
        set: function (v) {
            this.i.w8 = ensureEnum(AnnotationAppearanceMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBackgroundMatchLayer", {
        /**
         * Gets or sets whether the overlay text background matches brush of the layer
        */
        get: function () {
            return this.i.xk;
        },
        set: function (v) {
            this.i.xk = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderShift", {
        /**
         * Gets or sets the shift of the overlay border based on OverlayTextBorderMode. Value must range between -1.0 to 1.0, where 0 means no color shift.
        */
        get: function () {
            return this.i.x2;
        },
        set: function (v) {
            this.i.x2 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderMode", {
        /**
         * Gets or sets the mode used for shifting the border of overlay text based on the target series.
        */
        get: function () {
            return this.i.w9;
        },
        set: function (v) {
            this.i.w9 = ensureEnum(AnnotationAppearanceMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderMatchLayer", {
        /**
         * Gets or sets whether the overlay text border matches brush of the layer
        */
        get: function () {
            return this.i.xl;
        },
        set: function (v) {
            this.i.xl = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextStyle", {
        /**
         * Gets or Sets the style to use for the display text.
        */
        get: function () {
            if (this.i.xi == null) {
                return null;
            }
            return this.i.xi.fontString;
        },
        set: function (v) {
            var fi = new FontInfo();
            fi.fontString = v;
            this.i.xi = fi;
        },
        enumerable: false,
        configurable: true
    });
    IgxValueOverlayComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.axis && this.axis.name && this.axis.name == name) {
            return this.axis;
        }
        return null;
    };
    IgxValueOverlayComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.axis && this.axis._styling) {
            this.axis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    IgxValueOverlayComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.i8(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgxValueOverlayComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.wm(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    /**
     * Gets the item index associated with the specified world position
    
    * @param world
    */
    IgxValueOverlayComponent.prototype.getItemIndex = function (world) {
        var iv = this.i.j7(toPoint(world));
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxValueOverlayComponent.prototype.getItem = function (world) {
        var iv = this.i.kr(toPoint(world));
        return (iv);
    };
    /**
     * Requests that the provided item should be brought into view if possible.
    
    * @param item  * The item to attempt to bring into view.
    */
    IgxValueOverlayComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.ge(item);
        return (iv);
    };
    /**
     * Gets the label for a data item.
    
    * @param value  * The unscaled value to get a label for.
    */
    IgxValueOverlayComponent.prototype.getLabel = function (value) {
        var iv = this.i.yq(value);
        return (iv);
    };
    Object.defineProperty(IgxValueOverlayComponent.prototype, "stylingOverlayText", {
        /**
         * Event raised when updating style of overlay text
        */
        get: function () {
            var _this = this;
            if (this._stylingOverlayText == null) {
                this._stylingOverlayText = new EventEmitter();
                this.i.stylingOverlayText = delegateCombine(this.i.stylingOverlayText, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxOverlayTextUpdatingEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeStylingOverlayText) {
                            _this.beforeStylingOverlayText(_this, outerArgs);
                        }
                        _this._stylingOverlayText.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._stylingOverlayText;
        },
        enumerable: false,
        configurable: true
    });
    IgxValueOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxValueOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxValueOverlayComponent, selector: "igx-value-overlay", inputs: { axis: "axis", value: "value", isAxisAnnotationEnabled: "isAxisAnnotationEnabled", axisAnnotationFormatLabel: "axisAnnotationFormatLabel", axisAnnotationTextColor: "axisAnnotationTextColor", axisAnnotationBackground: "axisAnnotationBackground", axisAnnotationBackgroundCornerRadius: "axisAnnotationBackgroundCornerRadius", axisAnnotationInterpolatedValuePrecision: "axisAnnotationInterpolatedValuePrecision", axisAnnotationOutline: "axisAnnotationOutline", axisAnnotationPaddingLeft: "axisAnnotationPaddingLeft", axisAnnotationPaddingTop: "axisAnnotationPaddingTop", axisAnnotationPaddingRight: "axisAnnotationPaddingRight", axisAnnotationPaddingBottom: "axisAnnotationPaddingBottom", axisAnnotationStrokeThickness: "axisAnnotationStrokeThickness", overlayTextLocation: "overlayTextLocation", overlayTextHorizontalMargin: "overlayTextHorizontalMargin", overlayTextVerticalMargin: "overlayTextVerticalMargin", overlayTextHorizontalPadding: "overlayTextHorizontalPadding", overlayTextVerticalPadding: "overlayTextVerticalPadding", overlayTextAngle: "overlayTextAngle", overlayTextColor: "overlayTextColor", overlayTextBackground: "overlayTextBackground", overlayTextBorderColor: "overlayTextBorderColor", overlayTextBorderRadius: "overlayTextBorderRadius", overlayTextBorderThickness: "overlayTextBorderThickness", overlayTextVisible: "overlayTextVisible", overlayText: "overlayText", overlayTextColorShift: "overlayTextColorShift", overlayTextColorMode: "overlayTextColorMode", overlayTextColorMatchLayer: "overlayTextColorMatchLayer", overlayTextBackgroundShift: "overlayTextBackgroundShift", overlayTextBackgroundMode: "overlayTextBackgroundMode", overlayTextBackgroundMatchLayer: "overlayTextBackgroundMatchLayer", overlayTextBorderShift: "overlayTextBorderShift", overlayTextBorderMode: "overlayTextBorderMode", overlayTextBorderMatchLayer: "overlayTextBorderMatchLayer", overlayTextStyle: "overlayTextStyle" }, outputs: { stylingOverlayText: "stylingOverlayText" }, providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueOverlayComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxValueOverlayComponent;
}(IgxSeriesComponent));
export { IgxValueOverlayComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueOverlayComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-value-overlay',
                    template: "",
                    providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueOverlayComponent; }) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { axis: [{
                type: Input
            }], value: [{
                type: Input
            }], isAxisAnnotationEnabled: [{
                type: Input
            }], axisAnnotationFormatLabel: [{
                type: Input
            }], axisAnnotationTextColor: [{
                type: Input
            }], axisAnnotationBackground: [{
                type: Input
            }], axisAnnotationBackgroundCornerRadius: [{
                type: Input
            }], axisAnnotationInterpolatedValuePrecision: [{
                type: Input
            }], axisAnnotationOutline: [{
                type: Input
            }], axisAnnotationPaddingLeft: [{
                type: Input
            }], axisAnnotationPaddingTop: [{
                type: Input
            }], axisAnnotationPaddingRight: [{
                type: Input
            }], axisAnnotationPaddingBottom: [{
                type: Input
            }], axisAnnotationStrokeThickness: [{
                type: Input
            }], overlayTextLocation: [{
                type: Input
            }], overlayTextHorizontalMargin: [{
                type: Input
            }], overlayTextVerticalMargin: [{
                type: Input
            }], overlayTextHorizontalPadding: [{
                type: Input
            }], overlayTextVerticalPadding: [{
                type: Input
            }], overlayTextAngle: [{
                type: Input
            }], overlayTextColor: [{
                type: Input
            }], overlayTextBackground: [{
                type: Input
            }], overlayTextBorderColor: [{
                type: Input
            }], overlayTextBorderRadius: [{
                type: Input
            }], overlayTextBorderThickness: [{
                type: Input
            }], overlayTextVisible: [{
                type: Input
            }], overlayText: [{
                type: Input
            }], overlayTextColorShift: [{
                type: Input
            }], overlayTextColorMode: [{
                type: Input
            }], overlayTextColorMatchLayer: [{
                type: Input
            }], overlayTextBackgroundShift: [{
                type: Input
            }], overlayTextBackgroundMode: [{
                type: Input
            }], overlayTextBackgroundMatchLayer: [{
                type: Input
            }], overlayTextBorderShift: [{
                type: Input
            }], overlayTextBorderMode: [{
                type: Input
            }], overlayTextBorderMatchLayer: [{
                type: Input
            }], overlayTextStyle: [{
                type: Input
            }], stylingOverlayText: [{
                type: Output
            }] } });
