import { toSpinal, initializePropertiesFromCss, NamePatcher } from "igniteui-angular-core";
//some of the build tools don't like styles not being an array literal for Angular
//export const LegendBaseStyles: string[] = [`
//`];
/**
 * Represents the base class for a legend in IgxDataChartComponent.
*/
var IgxLegendBaseComponent = /** @class */ /*@__PURE__*/ (function () {
    function IgxLegendBaseComponent() {
        this._zoneRunner = null;
        this.__p = null;
        this._hasUserValues = new Set();
        this._stylingContainer = null;
        this._stylingParent = null;
        this._inStyling = false;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
        }
    }
    Object.defineProperty(IgxLegendBaseComponent.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    IgxLegendBaseComponent.prototype.onImplementationCreated = function () {
    };
    Object.defineProperty(IgxLegendBaseComponent.prototype, "isItemwise", {
        /**
     * Gets if the legend is item-wise.
    */
        get: function () {
            return this.i.isItemwise;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxLegendBaseComponent.prototype, "isFinancial", {
        /**
         * Gets if the legend is a financial legend.
        */
        get: function () {
            return this.i.isFinancial;
        },
        enumerable: false,
        configurable: true
    });
    IgxLegendBaseComponent.prototype.findByName = function (name) {
        return null;
    };
    Object.defineProperty(IgxLegendBaseComponent.prototype, "hasUserValues", {
        get: function () {
            return this._hasUserValues;
        },
        enumerable: false,
        configurable: true
    });
    IgxLegendBaseComponent.prototype.__m = function (propertyName) {
        if (!this._inStyling) {
            this._hasUserValues.add(propertyName);
        }
    };
    IgxLegendBaseComponent.prototype._styling = function (container, component, parent) {
        if (this._inStyling) {
            return;
        }
        this._inStyling = true;
        this._stylingContainer = container;
        this._stylingParent = component;
        var genericPrefix = "";
        var typeName = this.i.$type.name;
        if (typeName.indexOf("Xam") === 0) {
            typeName = typeName.substring(3);
        }
        genericPrefix = toSpinal("LegendBaseComponent");
        var additionalPrefixes = [];
        var prefix = toSpinal(typeName);
        additionalPrefixes.push(prefix + "-");
        var b = this.i.$type.baseType;
        while (b && b.name != "Object" &&
            b.name != "Base" &&
            b.name != "Control" &&
            b.Name != "DependencyObject" &&
            b.Name != "FrameworkElement") {
            typeName = b.name;
            if (typeName.indexOf("Xam") === 0) {
                typeName = typeName.substring(3);
            }
            var basePrefix = toSpinal(typeName);
            additionalPrefixes.push(basePrefix + "-");
            b = b.baseType;
        }
        if (parent) {
            var parentTypeName = parent.i.$type.name;
            if (parentTypeName.indexOf("Xam") === 0) {
                parentTypeName = parentTypeName.substring(3);
            }
            var parentPrefix = toSpinal(parentTypeName);
            additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
            additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
        }
        initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
        if (this._otherStyling) {
            this._otherStyling(container, component, parent);
        }
        this._inStyling = false;
    };
    /**
 * Returns the legend visuals expressed as a serialized string.

*/
    IgxLegendBaseComponent.prototype.exportSerializedVisualData = function () {
        var iv = this.i.exportSerializedVisualData();
        return (iv);
    };
    return IgxLegendBaseComponent;
}());
export { IgxLegendBaseComponent };
