import { h, Host } from "@stencil/core";
import { getLoginUrl } from "./unifiedLoginHelper";
export class PnMarketwebSiteheaderLoginButton {
    constructor() {
        this.label = 'Log in';
        this.useMarketwebLogin = false;
        this.environment = 'local';
    }
    hostElement;
    loginUrl;
    componentWillLoad() {
        this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);
    }
    nagivateToLoginUrl() {
        const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;
        return navigationUrl;
    }
    render() {
        return (h(Host, { key: 'be5764812e9610f5799856b27aa4517469d9a24f' }, h("pn-button", { key: '4a6b17d0e79ddedd0d06094aac2a44c6f9fda666', href: this.nagivateToLoginUrl() }, this.label)));
    }
    static get is() { return "pn-marketweb-siteheader-login-button"; }
    static get originalStyleUrls() {
        return {
            "$": ["pn-marketweb-siteheader-login-button.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["pn-marketweb-siteheader-login-button.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "label",
                "reflect": false,
                "defaultValue": "'Log in'"
            },
            "useMarketwebLogin": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "use-marketweb-login",
                "reflect": false,
                "defaultValue": "false"
            },
            "environment": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "environment",
                "reflect": false,
                "defaultValue": "'local'"
            }
        };
    }
    static get elementRef() { return "hostElement"; }
}
//# sourceMappingURL=pn-marketweb-siteheader-login-button.js.map
