import { __extends } from "tslib";
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxNumericAngleAxisComponent } from "./igx-numeric-angle-axis-component";
import { IgxNumericRadiusAxisComponent } from "./igx-numeric-radius-axis-component";
import { TrendLineType_$type } from "igniteui-angular-core";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { IgxAssigningPolarStyleEventArgs } from "./igx-assigning-polar-style-event-args";
import { IgxAssigningPolarMarkerStyleEventArgs } from "./igx-assigning-polar-marker-style-event-args";
import { IgxMarkerSeriesComponent } from "./igx-marker-series-component";
import { ensureBool, ensureEnum, brushToString, stringToBrush, toPoint, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the base class from which all IgxDataChartComponent polar series are derived.
*/
var IgxPolarBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxPolarBaseComponent, _super);
    function IgxPolarBaseComponent() {
        var _this = _super.call(this) || this;
        _this._assigningPolarStyle = null;
        _this._assigningPolarMarkerStyle = null;
        return _this;
    }
    Object.defineProperty(IgxPolarBaseComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "isPolar", {
        /**
         * Checks if this series is a polar series
        */
        get: function () {
            return this.i.d6;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "angleMemberPath", {
        /**
         * Gets or sets the path to use to find the angle values for the series.
        */
        get: function () {
            return this.i.td;
        },
        set: function (v) {
            this.i.td = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "radiusMemberPath", {
        /**
         * Gets or sets the path to use to get the radius values for the series.
        */
        get: function () {
            return this.i.tr;
        },
        set: function (v) {
            this.i.tr = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "angleAxis", {
        /**
         * Gets the effective angle axis for the current series object.
        */
        get: function () {
            if (this.i.rt == null) {
                return null;
            }
            if (!this.i.rt.externalObject) {
                var e = IgxNumericAngleAxisComponent._createFromInternal(this.i.rt);
                if (e) {
                    e._implementation = this.i.rt;
                }
                this.i.rt.externalObject = e;
            }
            return this.i.rt.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.rt = null : this.i.rt = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "radiusAxis", {
        /**
         * Gets the effective radius axis for the current series object.
        */
        get: function () {
            if (this.i.ru == null) {
                return null;
            }
            if (!this.i.ru.externalObject) {
                var e = IgxNumericRadiusAxisComponent._createFromInternal(this.i.ru);
                if (e) {
                    e._implementation = this.i.ru;
                }
                this.i.ru.externalObject = e;
            }
            return this.i.ru.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.ru = null : this.i.ru = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "useCartesianInterpolation", {
        /**
         * Gets or sets whether Cartesian Interpolation should be used rather than Archimedian
         * spiral based interpolation.
        */
        get: function () {
            return this.i.st;
        },
        set: function (v) {
            this.i.st = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "maximumMarkers", {
        /**
         * Gets or sets the maximum number of markers displayed by the current series.
         * If more than the specified number of markers are visible, the polar series will automatically
         * choose a representative set.
        */
        get: function () {
            return this.i.s3;
        },
        set: function (v) {
            this.i.s3 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLineType", {
        /**
         * Gets or sets the trend type for the current series object.
        */
        get: function () {
            return this.i.sb;
        },
        set: function (v) {
            this.i.sb = ensureEnum(TrendLineType_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLineBrush", {
        /**
         * Gets or sets the brush that specifies how the current series
         * object's trend line is drawn.
        */
        get: function () {
            return brushToString(this.i.uu);
        },
        set: function (v) {
            this.i.uu = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "actualTrendLineBrush", {
        /**
         * Gets the effective TrendLineBrush for this series.
        */
        get: function () {
            return brushToString(this.i.ut);
        },
        set: function (v) {
            this.i.ut = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLineThickness", {
        /**
         * Gets or sets the thickness of the current series object's trend line.
        */
        get: function () {
            return this.i.s1;
        },
        set: function (v) {
            this.i.s1 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLinePeriod", {
        /**
         * Gets or sets the moving average period for the current series object.
        */
        get: function () {
            return this.i.s4;
        },
        set: function (v) {
            this.i.s4 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLineZIndex", {
        /**
         * Sets or Gets the Trendline Z index.
        */
        get: function () {
            return this.i.s5;
        },
        set: function (v) {
            this.i.s5 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "clipSeriesToBounds", {
        /**
         * Gets or sets whether to clip the series to the bounds.
         * Setting this to true can effect performance.
        */
        get: function () {
            return this.i.sk;
        },
        set: function (v) {
            this.i.sk = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "actualItemSearchMode", {
        get: function () {
            return this.i.r7;
        },
        set: function (v) {
            this.i.r7 = ensureEnum(ScatterItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "itemSearchMode", {
        /**
         * Gets or sets the mode the series will use to find the closest point to the cursor.
        */
        get: function () {
            return this.i.r9;
        },
        set: function (v) {
            this.i.r9 = ensureEnum(ScatterItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "itemSearchThreshold", {
        /**
         * Gets or sets the threshold to use when searching for items using ItemSearchMode.
        */
        get: function () {
            return this.i.s2;
        },
        set: function (v) {
            this.i.s2 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "isCustomPolarStyleAllowed", {
        /**
         * Gets or sets whether this Polar series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.sn;
        },
        set: function (v) {
            this.i.sn = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "isCustomPolarMarkerStyleAllowed", {
        /**
         * Gets or sets whether this Polar series should allow custom style overrides of its individual marker visuals.
        */
        get: function () {
            return this.i.sm;
        },
        set: function (v) {
            this.i.sm = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "radiusMemberAsLegendLabel", {
        /**
         * Gets or sets the label displayed before series' radius value in the Data Legend.
        */
        get: function () {
            return this.i.tn;
        },
        set: function (v) {
            this.i.tn = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "angleMemberAsLegendLabel", {
        /**
         * Gets or sets the label displayed before series' angle value in the Data Legend.
        */
        get: function () {
            return this.i.s9;
        },
        set: function (v) {
            this.i.s9 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "radiusMemberAsLegendUnit", {
        /**
         * Gets or sets the unit displayed after series' radius value in the Data Legend.
        */
        get: function () {
            return this.i.tp;
        },
        set: function (v) {
            this.i.tp = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "angleMemberAsLegendUnit", {
        /**
         * Gets or sets the unit displayed after series' angle value in the Data Legend.
        */
        get: function () {
            return this.i.tb;
        },
        set: function (v) {
            this.i.tb = v;
        },
        enumerable: false,
        configurable: true
    });
    IgxPolarBaseComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.angleAxis && this.angleAxis.name && this.angleAxis.name == name) {
            return this.angleAxis;
        }
        if (this.radiusAxis && this.radiusAxis.name && this.radiusAxis.name == name) {
            return this.radiusAxis;
        }
        return null;
    };
    IgxPolarBaseComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.angleAxis && this.angleAxis._styling) {
            this.angleAxis._styling(container, component, this);
        }
        if (this.radiusAxis && this.radiusAxis._styling) {
            this.radiusAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Scrolls the requested item into view, if possible.
    
    * @param item  * The item to scroll into view.
    */
    IgxPolarBaseComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.en(item);
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxPolarBaseComponent.prototype.getItem = function (world) {
        var iv = this.i.ht(toPoint(world));
        return (iv);
    };
    /**
     * Gets the index of the item that resides at the provided world coordinates.
    
    * @param world  * The world coordinates of the requested item.
    */
    IgxPolarBaseComponent.prototype.getItemIndex = function (world) {
        var iv = this.i.hd(toPoint(world));
        return (iv);
    };
    IgxPolarBaseComponent.prototype.getExactItemIndex = function (world) {
        var iv = this.i.f5(toPoint(world));
        return (iv);
    };
    IgxPolarBaseComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.pl(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgxPolarBaseComponent.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.hw(item, memberPathName);
        return (iv);
    };
    /**
     * Determine if object can be used as RadiusAxis
    
    * @param axis  * The object to check
    */
    IgxPolarBaseComponent.prototype.canUseAsRadiusAxis = function (axis) {
        var iv = this.i.sj(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as AngleAxis
    
    * @param axis  * The object to check
    */
    IgxPolarBaseComponent.prototype.canUseAsAngleAxis = function (axis) {
        var iv = this.i.si(axis);
        return (iv);
    };
    Object.defineProperty(IgxPolarBaseComponent.prototype, "assigningPolarStyle", {
        /**
         * Event raised when Assigning Category Style
        */
        get: function () {
            var _this = this;
            if (this._assigningPolarStyle == null) {
                this._assigningPolarStyle = new EventEmitter();
                this.i.assigningPolarStyle = delegateCombine(this.i.assigningPolarStyle, function (o, e) {
                    var outerArgs = new IgxAssigningPolarStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningPolarStyle) {
                        _this.beforeAssigningPolarStyle(_this, outerArgs);
                    }
                    _this._assigningPolarStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningPolarStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "assigningPolarMarkerStyle", {
        /**
         * Event raised when Assigning Polar Marker Style
        */
        get: function () {
            var _this = this;
            if (this._assigningPolarMarkerStyle == null) {
                this._assigningPolarMarkerStyle = new EventEmitter();
                this.i.assigningPolarMarkerStyle = delegateCombine(this.i.assigningPolarMarkerStyle, function (o, e) {
                    var outerArgs = new IgxAssigningPolarMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningPolarMarkerStyle) {
                        _this.beforeAssigningPolarMarkerStyle(_this, outerArgs);
                    }
                    _this._assigningPolarMarkerStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningPolarMarkerStyle;
        },
        enumerable: false,
        configurable: true
    });
    IgxPolarBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxPolarBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxPolarBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxPolarBaseComponent, selector: "ng-component", inputs: { angleMemberPath: "angleMemberPath", radiusMemberPath: "radiusMemberPath", angleAxis: "angleAxis", radiusAxis: "radiusAxis", useCartesianInterpolation: "useCartesianInterpolation", maximumMarkers: "maximumMarkers", trendLineType: "trendLineType", trendLineBrush: "trendLineBrush", actualTrendLineBrush: "actualTrendLineBrush", trendLineThickness: "trendLineThickness", trendLinePeriod: "trendLinePeriod", trendLineZIndex: "trendLineZIndex", clipSeriesToBounds: "clipSeriesToBounds", actualItemSearchMode: "actualItemSearchMode", itemSearchMode: "itemSearchMode", itemSearchThreshold: "itemSearchThreshold", isCustomPolarStyleAllowed: "isCustomPolarStyleAllowed", isCustomPolarMarkerStyleAllowed: "isCustomPolarMarkerStyleAllowed", radiusMemberAsLegendLabel: "radiusMemberAsLegendLabel", angleMemberAsLegendLabel: "angleMemberAsLegendLabel", radiusMemberAsLegendUnit: "radiusMemberAsLegendUnit", angleMemberAsLegendUnit: "angleMemberAsLegendUnit" }, outputs: { assigningPolarStyle: "assigningPolarStyle", assigningPolarMarkerStyle: "assigningPolarMarkerStyle" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
    return IgxPolarBaseComponent;
}(IgxMarkerSeriesComponent));
export { IgxPolarBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxPolarBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: "",
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { angleMemberPath: [{
                type: Input
            }], radiusMemberPath: [{
                type: Input
            }], angleAxis: [{
                type: Input
            }], radiusAxis: [{
                type: Input
            }], useCartesianInterpolation: [{
                type: Input
            }], maximumMarkers: [{
                type: Input
            }], trendLineType: [{
                type: Input
            }], trendLineBrush: [{
                type: Input
            }], actualTrendLineBrush: [{
                type: Input
            }], trendLineThickness: [{
                type: Input
            }], trendLinePeriod: [{
                type: Input
            }], trendLineZIndex: [{
                type: Input
            }], clipSeriesToBounds: [{
                type: Input
            }], actualItemSearchMode: [{
                type: Input
            }], itemSearchMode: [{
                type: Input
            }], itemSearchThreshold: [{
                type: Input
            }], isCustomPolarStyleAllowed: [{
                type: Input
            }], isCustomPolarMarkerStyleAllowed: [{
                type: Input
            }], radiusMemberAsLegendLabel: [{
                type: Input
            }], angleMemberAsLegendLabel: [{
                type: Input
            }], radiusMemberAsLegendUnit: [{
                type: Input
            }], angleMemberAsLegendUnit: [{
                type: Input
            }], assigningPolarStyle: [{
                type: Output
            }], assigningPolarMarkerStyle: [{
                type: Output
            }] } });
