import { __extends } from "tslib";
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { IgxSeriesComponent } from "./igx-series-component";
import { Visibility_$type } from "igniteui-angular-core";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { CrosshairLayer } from "./CrosshairLayer";
import { ensureBool, brushToString, stringToBrush, ensureEnum } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgxCrosshairLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxCrosshairLayerComponent, _super);
    function IgxCrosshairLayerComponent() {
        return _super.call(this) || this;
    }
    IgxCrosshairLayerComponent.prototype.createImplementation = function () {
        return new CrosshairLayer();
    };
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "isAnnotationHoverLayer", {
        /**
         * Gets whether the series is an annotation layer displayed only when hovering over the chart.
        */
        get: function () {
            return this.i.et;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "isAnnotationCrosshairLayer", {
        /**
         * Gets whether the series is an crosshair annotation layer.
        */
        get: function () {
            return this.i.er;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "horizontalLineStroke", {
        /**
         * Gets or sets the color to use for the horizontal line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ac0);
        },
        set: function (v) {
            this.i.ac0 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "verticalLineStroke", {
        /**
         * Gets or sets the color to use for vertical line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ac1);
        },
        set: function (v) {
            this.i.ac1 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "targetSeriesName", {
        /**
         * Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            return this.i.abc;
        },
        set: function (v) {
            this.i.abc = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "targetSeries", {
        /**
         * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            var r = this.i.aai;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxSeriesComponent._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.aai = null : this.i.aai = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "useInterpolation", {
        /**
         * Gets or sets whether to use value interpolation when drawing a line through the best value for the cursor position.
        */
        get: function () {
            return this.i.aap;
        },
        set: function (v) {
            this.i.aap = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "isAxisAnnotationEnabled", {
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get: function () {
            return this.i.aal;
        },
        set: function (v) {
            this.i.aal = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the x axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ac4);
        },
        set: function (v) {
            this.i.ac4 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ac2);
        },
        set: function (v) {
            this.i.ac2 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aas;
        },
        set: function (v) {
            this.i.aas = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.aa4;
        },
        set: function (v) {
            this.i.aa4 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the x axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ac3);
        },
        set: function (v) {
            this.i.ac3 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationPaddingLeft", {
        /**
         * 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.aau;
        },
        set: function (v) {
            this.i.aau = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationPaddingTop", {
        /**
         * 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.aaw;
        },
        set: function (v) {
            this.i.aaw = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationPaddingRight", {
        /**
         * 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.aav;
        },
        set: function (v) {
            this.i.aav = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationPaddingBottom", {
        /**
         * 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.aat;
        },
        set: function (v) {
            this.i.aat = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationPaddingLeft", {
        /**
         * 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.aa0;
        },
        set: function (v) {
            this.i.aa0 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationPaddingTop", {
        /**
         * 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.aa2;
        },
        set: function (v) {
            this.i.aa2 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationPaddingRight", {
        /**
         * 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.aa1;
        },
        set: function (v) {
            this.i.aa1 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationPaddingBottom", {
        /**
         * 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.aaz;
        },
        set: function (v) {
            this.i.aaz = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "xAxisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aax;
        },
        set: function (v) {
            this.i.aax = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the y axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ac7);
        },
        set: function (v) {
            this.i.ac7 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ac5);
        },
        set: function (v) {
            this.i.ac5 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aay;
        },
        set: function (v) {
            this.i.aay = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.aa5;
        },
        set: function (v) {
            this.i.aa5 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the y axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ac6);
        },
        set: function (v) {
            this.i.ac6 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "yAxisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aa3;
        },
        set: function (v) {
            this.i.aa3 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "verticalLineVisibility", {
        /**
         * Gets or sets whether to display the vertical line.
        */
        get: function () {
            return this.i.add;
        },
        set: function (v) {
            this.i.add = ensureEnum(Visibility_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "horizontalLineVisibility", {
        /**
         * Gets or sets whether to display the horizontal line.
        */
        get: function () {
            return this.i.adc;
        },
        set: function (v) {
            this.i.adc = ensureEnum(Visibility_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "skipUnknownValues", {
        /**
         * Gets or sets whether to skip unknown values when searching for series values.
        */
        get: function () {
            return this.i.aao;
        },
        set: function (v) {
            this.i.aao = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "skipAxisAnnotationOnZeroValueFragments", {
        /**
         * Gets or sets whether axis annotation are skipped for zero-value fragments in a given position.
        */
        get: function () {
            return this.i.aan;
        },
        set: function (v) {
            this.i.aan = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCrosshairLayerComponent.prototype, "skipAxisAnnotationOnInvalidData", {
        /**
         * Gets or sets whether axis annotation are skipped for invalid data in a given position.
        */
        get: function () {
            return this.i.aam;
        },
        set: function (v) {
            this.i.aam = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    IgxCrosshairLayerComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
            return this.targetSeries;
        }
        return null;
    };
    IgxCrosshairLayerComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.targetSeries && this.targetSeries._styling) {
            this.targetSeries._styling(container, component, this);
        }
        this._inStyling = false;
    };
    IgxCrosshairLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCrosshairLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxCrosshairLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxCrosshairLayerComponent, selector: "igx-crosshair-layer", inputs: { horizontalLineStroke: "horizontalLineStroke", verticalLineStroke: "verticalLineStroke", targetSeriesName: "targetSeriesName", targetSeries: "targetSeries", useInterpolation: "useInterpolation", isAxisAnnotationEnabled: "isAxisAnnotationEnabled", xAxisAnnotationTextColor: "xAxisAnnotationTextColor", xAxisAnnotationBackground: "xAxisAnnotationBackground", xAxisAnnotationBackgroundCornerRadius: "xAxisAnnotationBackgroundCornerRadius", xAxisAnnotationInterpolatedValuePrecision: "xAxisAnnotationInterpolatedValuePrecision", xAxisAnnotationOutline: "xAxisAnnotationOutline", xAxisAnnotationPaddingLeft: "xAxisAnnotationPaddingLeft", xAxisAnnotationPaddingTop: "xAxisAnnotationPaddingTop", xAxisAnnotationPaddingRight: "xAxisAnnotationPaddingRight", xAxisAnnotationPaddingBottom: "xAxisAnnotationPaddingBottom", yAxisAnnotationPaddingLeft: "yAxisAnnotationPaddingLeft", yAxisAnnotationPaddingTop: "yAxisAnnotationPaddingTop", yAxisAnnotationPaddingRight: "yAxisAnnotationPaddingRight", yAxisAnnotationPaddingBottom: "yAxisAnnotationPaddingBottom", xAxisAnnotationStrokeThickness: "xAxisAnnotationStrokeThickness", yAxisAnnotationTextColor: "yAxisAnnotationTextColor", yAxisAnnotationBackground: "yAxisAnnotationBackground", yAxisAnnotationBackgroundCornerRadius: "yAxisAnnotationBackgroundCornerRadius", yAxisAnnotationInterpolatedValuePrecision: "yAxisAnnotationInterpolatedValuePrecision", yAxisAnnotationOutline: "yAxisAnnotationOutline", yAxisAnnotationStrokeThickness: "yAxisAnnotationStrokeThickness", verticalLineVisibility: "verticalLineVisibility", horizontalLineVisibility: "horizontalLineVisibility", skipUnknownValues: "skipUnknownValues", skipAxisAnnotationOnZeroValueFragments: "skipAxisAnnotationOnZeroValueFragments", skipAxisAnnotationOnInvalidData: "skipAxisAnnotationOnInvalidData" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxCrosshairLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCrosshairLayerComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxCrosshairLayerComponent;
}(IgxAnnotationLayerComponent));
export { IgxCrosshairLayerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCrosshairLayerComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-crosshair-layer',
                    template: "",
                    providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxCrosshairLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCrosshairLayerComponent; }) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { horizontalLineStroke: [{
                type: Input
            }], verticalLineStroke: [{
                type: Input
            }], targetSeriesName: [{
                type: Input
            }], targetSeries: [{
                type: Input
            }], useInterpolation: [{
                type: Input
            }], isAxisAnnotationEnabled: [{
                type: Input
            }], xAxisAnnotationTextColor: [{
                type: Input
            }], xAxisAnnotationBackground: [{
                type: Input
            }], xAxisAnnotationBackgroundCornerRadius: [{
                type: Input
            }], xAxisAnnotationInterpolatedValuePrecision: [{
                type: Input
            }], xAxisAnnotationOutline: [{
                type: Input
            }], xAxisAnnotationPaddingLeft: [{
                type: Input
            }], xAxisAnnotationPaddingTop: [{
                type: Input
            }], xAxisAnnotationPaddingRight: [{
                type: Input
            }], xAxisAnnotationPaddingBottom: [{
                type: Input
            }], yAxisAnnotationPaddingLeft: [{
                type: Input
            }], yAxisAnnotationPaddingTop: [{
                type: Input
            }], yAxisAnnotationPaddingRight: [{
                type: Input
            }], yAxisAnnotationPaddingBottom: [{
                type: Input
            }], xAxisAnnotationStrokeThickness: [{
                type: Input
            }], yAxisAnnotationTextColor: [{
                type: Input
            }], yAxisAnnotationBackground: [{
                type: Input
            }], yAxisAnnotationBackgroundCornerRadius: [{
                type: Input
            }], yAxisAnnotationInterpolatedValuePrecision: [{
                type: Input
            }], yAxisAnnotationOutline: [{
                type: Input
            }], yAxisAnnotationStrokeThickness: [{
                type: Input
            }], verticalLineVisibility: [{
                type: Input
            }], horizontalLineVisibility: [{
                type: Input
            }], skipUnknownValues: [{
                type: Input
            }], skipAxisAnnotationOnZeroValueFragments: [{
                type: Input
            }], skipAxisAnnotationOnInvalidData: [{
                type: Input
            }] } });
