import { h, Host } from "@stencil/core";
export class PnlanguageSelectorOption {
    constructor() {
        this.name = '';
        this.code = '';
        this.url = '';
        this.selected = false;
        this.currentLanguage = undefined;
    }
    spanEl;
    setCurrentLanguage;
    onOptionClick() {
        const currentlanguage = {
            name: this.name,
            code: this.code,
            url: this.url,
            current: true,
        };
        this.setCurrentLanguage.emit(currentlanguage);
    }
    componentDidLoad() {
        if (this.spanEl) {
            this.spanEl.setAttribute("xml:lang", this.code);
        }
    }
    render() {
        return (h(Host, { key: '120a44817be4b93b3032a3ad9594490ad08c71ab', role: "listitem", selected: this.selected + '', code: this.code, name: this.name }, !this.url ? (h("button", { class: "languageselector-button", "data-langcode": this.code, onClick: this.onOptionClick.bind(this) }, h("span", { class: "languageselector-radio-outer" }, h("span", { class: "languageselector-radio-inner" })), h("span", { ref: (el) => (this.spanEl = el), lang: this.code, class: "languageselector-itemtext" }, this.name, " - ", this.code))) : (h("a", { href: this.url, target: "_self", class: "languageselector-link", "data-langcode": this.code }, h("span", { class: "languageselector-radio-outer" }, h("span", { class: "languageselector-radio-inner" })), h("span", { ref: (el) => (this.spanEl = el), lang: this.code, class: "languageselector-itemtext" }, this.name, " - ", this.code)))));
    }
    static get is() { return "pn-language-selector-option"; }
    static get originalStyleUrls() {
        return {
            "$": ["pn-language-selector-option.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["pn-language-selector-option.css"]
        };
    }
    static get properties() {
        return {
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "What you write in the comment block above each prop is what ends up in the description fields in the prop table in the documentation"
                },
                "attribute": "name",
                "reflect": false,
                "defaultValue": "''"
            },
            "code": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "code",
                "reflect": false,
                "defaultValue": "''"
            },
            "url": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "url",
                "reflect": false,
                "defaultValue": "''"
            },
            "selected": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "selected",
                "reflect": false,
                "defaultValue": "false"
            },
            "currentLanguage": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "current-language",
                "reflect": false
            }
        };
    }
    static get events() {
        return [{
                "method": "setCurrentLanguage",
                "name": "setCurrentLanguage",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=pn-language-selector-option.js.map
