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, toDoubleCollection, fromDoubleCollection, toPoint, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the base class from which all IgxDataChartComponent polar series are derived.
*/
export let IgxPolarBaseComponent = /*@__PURE__*/ (() => {
    class IgxPolarBaseComponent extends IgxMarkerSeriesComponent {
        constructor() {
            super();
            this._assigningPolarStyle = null;
            this._assigningPolarMarkerStyle = null;
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        /**
         * Checks if this series is a polar series
        */
        get isPolar() {
            return this.i.d9;
        }
        /**
         * Gets or sets the path to use to find the angle values for the series.
        */
        get angleMemberPath() {
            return this.i.tm;
        }
        set angleMemberPath(v) {
            this.i.tm = v;
        }
        /**
         * Gets or sets the path to use to get the radius values for the series.
        */
        get radiusMemberPath() {
            return this.i.t0;
        }
        set radiusMemberPath(v) {
            this.i.t0 = v;
        }
        /**
         * Gets the effective angle axis for the current series object.
        */
        get angleAxis() {
            const r = this.i.r2;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                let e = IgxNumericAngleAxisComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        }
        set angleAxis(v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.r2 = null : this.i.r2 = v.i;
        }
        /**
         * Gets the effective radius axis for the current series object.
        */
        get radiusAxis() {
            const r = this.i.r3;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                let e = IgxNumericRadiusAxisComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        }
        set radiusAxis(v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.r3 = null : this.i.r3 = v.i;
        }
        /**
         * Gets or sets whether Cartesian Interpolation should be used rather than Archimedian
         * spiral based interpolation.
        */
        get useCartesianInterpolation() {
            return this.i.s2;
        }
        set useCartesianInterpolation(v) {
            this.i.s2 = ensureBool(v);
        }
        /**
         * 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 maximumMarkers() {
            return this.i.tc;
        }
        set maximumMarkers(v) {
            this.i.tc = +v;
        }
        /**
         * Gets or sets the trend type for the current series object.
        */
        get trendLineType() {
            return this.i.sk;
        }
        set trendLineType(v) {
            this.i.sk = ensureEnum(TrendLineType_$type, v);
        }
        /**
         * Gets or sets the brush that specifies how the current series
         * object's trend line is drawn.
        */
        get trendLineBrush() {
            return brushToString(this.i.u3);
        }
        set trendLineBrush(v) {
            this.i.u3 = stringToBrush(v);
        }
        /**
         * Gets the effective TrendLineBrush for this series.
        */
        get actualTrendLineBrush() {
            return brushToString(this.i.u2);
        }
        set actualTrendLineBrush(v) {
            this.i.u2 = stringToBrush(v);
        }
        /**
         * Gets or sets the thickness of the current series object's trend line.
        */
        get trendLineThickness() {
            return this.i.ta;
        }
        set trendLineThickness(v) {
            this.i.ta = +v;
        }
        /**
         * Gets or sets a collection of double values that indicate the pattern of dashes and gaps that
         * is used to draw the trend line for the current series object.
        */
        get trendLineDashArray() {
            return fromDoubleCollection(this.i.u4);
        }
        set trendLineDashArray(v) {
            this.i.u4 = toDoubleCollection(v);
        }
        /**
         * Gets or sets the moving average period for the current series object.
        */
        get trendLinePeriod() {
            return this.i.td;
        }
        set trendLinePeriod(v) {
            this.i.td = +v;
        }
        /**
         * Sets or Gets the Trendline Z index.
        */
        get trendLineZIndex() {
            return this.i.te;
        }
        set trendLineZIndex(v) {
            this.i.te = +v;
        }
        /**
         * Gets or sets whether to clip the series to the bounds.
         * Setting this to true can effect performance.
        */
        get clipSeriesToBounds() {
            return this.i.st;
        }
        set clipSeriesToBounds(v) {
            this.i.st = ensureBool(v);
        }
        get actualItemSearchMode() {
            return this.i.sg;
        }
        set actualItemSearchMode(v) {
            this.i.sg = ensureEnum(ScatterItemSearchMode_$type, v);
        }
        /**
         * Gets or sets the mode the series will use to find the closest point to the cursor.
        */
        get itemSearchMode() {
            return this.i.si;
        }
        set itemSearchMode(v) {
            this.i.si = ensureEnum(ScatterItemSearchMode_$type, v);
        }
        /**
         * Gets or sets the threshold to use when searching for items using ItemSearchMode.
        */
        get itemSearchThreshold() {
            return this.i.tb;
        }
        set itemSearchThreshold(v) {
            this.i.tb = +v;
        }
        /**
         * Gets or sets whether this Polar series should allow custom style overrides of its individual visuals.
        */
        get isCustomPolarStyleAllowed() {
            return this.i.sw;
        }
        set isCustomPolarStyleAllowed(v) {
            this.i.sw = ensureBool(v);
        }
        /**
         * Gets or sets whether this Polar series should allow custom style overrides of its individual marker visuals.
        */
        get isCustomPolarMarkerStyleAllowed() {
            return this.i.sv;
        }
        set isCustomPolarMarkerStyleAllowed(v) {
            this.i.sv = ensureBool(v);
        }
        /**
         * Gets or sets the label displayed before series' radius value in the Data Legend.
        */
        get radiusMemberAsLegendLabel() {
            return this.i.tw;
        }
        set radiusMemberAsLegendLabel(v) {
            this.i.tw = v;
        }
        /**
         * Gets or sets the label displayed before series' angle value in the Data Legend.
        */
        get angleMemberAsLegendLabel() {
            return this.i.ti;
        }
        set angleMemberAsLegendLabel(v) {
            this.i.ti = v;
        }
        /**
         * Gets or sets the unit displayed after series' radius value in the Data Legend.
        */
        get radiusMemberAsLegendUnit() {
            return this.i.ty;
        }
        set radiusMemberAsLegendUnit(v) {
            this.i.ty = v;
        }
        /**
         * Gets or sets the unit displayed after series' angle value in the Data Legend.
        */
        get angleMemberAsLegendUnit() {
            return this.i.tk;
        }
        set angleMemberAsLegendUnit(v) {
            this.i.tk = v;
        }
        findByName(name) {
            var baseResult = super.findByName(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;
        }
        _styling(container, component, parent) {
            super._styling(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.
        */
        scrollIntoView(item) {
            let iv = this.i.eq(item);
            return (iv);
        }
        /**
         * Gets the item that is the best match for the specified world coordinates.
        
        * @param world  * The world coordinates to use.
        */
        getItem(world) {
            let iv = this.i.hy(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.
        */
        getItemIndex(world) {
            let iv = this.i.hi(toPoint(world));
            return (iv);
        }
        getExactItemIndex(world) {
            let iv = this.i.f9(toPoint(world));
            return (iv);
        }
        getSeriesValuePosition(world, useInterpolation, skipUnknowns) {
            let iv = this.i.ps(toPoint(world), useInterpolation, skipUnknowns);
            return fromPoint(iv);
        }
        getItemValue(item, memberPathName) {
            let iv = this.i.h1(item, memberPathName);
            return (iv);
        }
        /**
         * Determine if object can be used as RadiusAxis
        
        * @param axis  * The object to check
        */
        canUseAsRadiusAxis(axis) {
            let iv = this.i.ss(axis);
            return (iv);
        }
        /**
         * Determine if object can be used as AngleAxis
        
        * @param axis  * The object to check
        */
        canUseAsAngleAxis(axis) {
            let iv = this.i.sr(axis);
            return (iv);
        }
        /**
         * Event raised when Assigning Category Style
        */
        get assigningPolarStyle() {
            if (this._assigningPolarStyle == null) {
                this._assigningPolarStyle = new EventEmitter();
                this.i.assigningPolarStyle = delegateCombine(this.i.assigningPolarStyle, (o, e) => {
                    let outerArgs = new IgxAssigningPolarStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeAssigningPolarStyle) {
                        this.beforeAssigningPolarStyle(this, outerArgs);
                    }
                    this._assigningPolarStyle.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningPolarStyle;
        }
        /**
         * Event raised when Assigning Polar Marker Style
        */
        get assigningPolarMarkerStyle() {
            if (this._assigningPolarMarkerStyle == null) {
                this._assigningPolarMarkerStyle = new EventEmitter();
                this.i.assigningPolarMarkerStyle = delegateCombine(this.i.assigningPolarMarkerStyle, (o, e) => {
                    let outerArgs = new IgxAssigningPolarMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeAssigningPolarMarkerStyle) {
                        this.beforeAssigningPolarMarkerStyle(this, outerArgs);
                    }
                    this._assigningPolarMarkerStyle.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningPolarMarkerStyle;
        }
    }
    IgxPolarBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxPolarBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxPolarBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", 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", trendLineDashArray: "trendLineDashArray", 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;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", 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
            }], trendLineDashArray: [{
                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
            }] } });
