import { h, Host } from "@stencil/core";
import state from "./pn-profile-modal-store";
export class PnProfileModalType {
    constructor() {
        this.typeid = '';
        this.name = 'false';
        this.selected = false;
        this.selectedprofile = null;
    }
    hostElement;
    onSelectedChange() {
        if (this.selected) {
            state.selectedType = this.name;
        }
        state.selectedProfile = '';
        [...this.hostElement.querySelectorAll('pn-profile-modal-profile')].map(x => {
            x.setAttribute('selected', 'false');
        });
    }
    render() {
        return (h(Host, { key: 'd34b3a25b0f60ac52c17bdcb1989ef59f6131c9b', selected: (state.selectedType === this.name) + '', "selected-profile": state.selectedProfile + '' }, h("slot", { key: 'd91f5074b557b20bdeab4d2359a054490cee2711' })));
    }
    static get is() { return "pn-profile-modal-type"; }
    static get originalStyleUrls() {
        return {
            "$": ["pn-profile-modal-type.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["pn-profile-modal-type.css"]
        };
    }
    static get properties() {
        return {
            "typeid": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "typeid",
                "reflect": true,
                "defaultValue": "''"
            },
            "name": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "name",
                "reflect": false,
                "defaultValue": "'false'"
            },
            "selected": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "selected",
                "reflect": false,
                "defaultValue": "false"
            },
            "selectedprofile": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "selectedprofile",
                "reflect": false,
                "defaultValue": "null"
            }
        };
    }
    static get elementRef() { return "hostElement"; }
    static get watchers() {
        return [{
                "propName": "selected",
                "methodName": "onSelectedChange"
            }];
    }
}
//# sourceMappingURL=pn-profile-modal-type.js.map
