import { h } from "@stencil/core";
import { isNestedInIfxComponent } from "../..//shared/utils/dom-utils";
import { detectFramework } from "../..//shared/utils/framework-detection";
import { trackComponent } from "../../shared/utils/tracking";
export class Indicator {
    el;
    filteredNumber;
    inverted = false;
    ariaLabel;
    variant = "number";
    number = 0;
    handleNumber() {
        this.filteredNumber =
            !isNaN(this.number) && this.number > 99 ? "99+" : this.number;
    }
    componentWillLoad() {
        this.handleNumber();
    }
    async componentDidLoad() {
        if (!isNestedInIfxComponent(this.el)) {
            const framework = detectFramework();
            trackComponent("ifx-indicator", await framework);
        }
    }
    componentWillUpdate() {
        this.handleNumber();
    }
    render() {
        return (h("div", { key: 'a1a7ac09b2a5426a6023489a5b32bad48d236d19', "aria-label": this.ariaLabel, class: "indicator__container" }, this.variant === "number" && (h("div", { key: 'a8698480f035da024310a5f05a73185dcc2f810f', class: `number__container ${this.inverted ? "inverted" : ""}` }, h("div", { key: '370b7c8bd78a5ec8a95adf08602d4fbf80773001', class: "number__wrapper" }, this.filteredNumber))), this.variant === "dot" && h("div", { key: 'f90308b1653054e2447395b606ee9f9ce56eed49', class: "dot__wrapper" })));
    }
    static get is() { return "ifx-indicator"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["indicator.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["indicator.css"]
        };
    }
    static get properties() {
        return {
            "inverted": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "inverted",
                "defaultValue": "false"
            },
            "ariaLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string | null",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "aria-label"
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "variant",
                "defaultValue": "\"number\""
            },
            "number": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "number",
                "defaultValue": "0"
            }
        };
    }
    static get states() {
        return {
            "filteredNumber": {}
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=indicator.js.map
