import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { a as angle_up, b as angle_down } from './angle_up.js';

const translations = {
    sv: {
        toggleLinkTitleText: `Välj kundnummer`,
    },
    en: {
        toggleLinkTitleText: `Choose customernumber`,
    },
    da: {
        toggleLinkTitleText: `Vælg kundenummer`,
    },
    no: {
        toggleLinkTitleText: `Velg kundenummer`,
    },
    fi: {
        toggleLinkTitleText: `Valitse asiakasnumero`,
    },
    de: {
        toggleLinkTitleText: `Kundennummer auswählen`,
    },
};

const pnCustomernumberSelectorCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}.customernumber-container{position:relative;padding:0;display:flex;flex-direction:column;border-radius:0.8rem;border:0.1rem solid #969087;transition:border 0.15s ease}.customernumber-container:hover,pn-customernumber-selector[open] .customernumber-container{border-color:#005d92}pn-customernumber-selector[open] .customernumber-container{border-bottom-left-radius:0;border-bottom-right-radius:0}.customernumber-toggle{display:flex;z-index:11;position:relative;margin:0;border-radius:0.8rem;padding:1rem;border:0;background:transparent;font-size:1em;text-align:left;outline:0;cursor:pointer}.customernumber-toggle pn-icon{align-self:center}.customernumber-selected{flex-grow:1;max-width:calc(100% - 2.4rem);overflow:hidden}.customernumber-selected-title{color:#005d92}.customernumber-selected-description{font-size:0.875em;width:100%;overflow:hidden;text-overflow:ellipsis}.customernumber-options{position:absolute;z-index:10;left:-0.1rem;right:-0.1rem;top:100%;border:0.1rem solid #005d92;border-bottom-left-radius:0.8rem;border-bottom-right-radius:0.8rem;max-height:0;opacity:0;transform-origin:top left;transition:transform 0.2s cubic-bezier(0.6, 0, 0.4, 1) 0.15s, opacity 0.1s linear, max-height 0.1s ease;overflow-y:auto}pn-customernumber-selector[open] .customernumber-options{opacity:1;transition-delay:0s;max-height:500rem}";
const PnCustomernumberSelectorStyle0 = pnCustomernumberSelectorCss;

const PnCustomernumberSelector$1 = /*@__PURE__*/ proxyCustomElement(class PnCustomernumberSelector extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.language = 'sv';
        this.open = false;
        this.heading = '';
        this.description = '';
        this.i18n = translations['en'];
    }
    get hostElement() { return this; }
    componentWillLoad() {
        this.init();
    }
    init() {
        this.setTranslations();
    }
    setTranslations() {
        if (this.language && translations[this.language]) {
            this.i18n = translations[this.language];
        }
    }
    render() {
        return (h(Host, { key: 'bbd904651e0633f63710fb35c55a2111d5d11b6d' }, h("div", { key: '1886681049eeb333415707e03fd0be499d6c8a23', class: "customernumber-container" }, h("button", { key: '4d19bb8b8db7572bc458789a9f8b29cb7997271f', class: "customernumber-toggle", "aria-label": this.i18n.toggleLinkTitleText, onClick: () => (this.open = !this.open) }, h("div", { key: 'f6f279cebff751b9e2dff23d20f549fb45e08e94', class: "customernumber-selected" }, h("strong", { key: '8559bcaca559b178eca30bcc369801fdf7de13fc', class: "customernumber-selected-title" }, this.heading), h("div", { key: '4da037f182af3504e48dde62ccd34f1f92061589', class: "customernumber-selected-description" }, this.description)), h("pn-icon", { key: 'e07f3077cc6e42a2f8439952ab892d978bb47da9', icon: this.open ? angle_up : angle_down, small: "false", color: "blue700" })), h("div", { key: '51e476f711faea616d1943d47223f3e2a1393bad', class: "customernumber-options" }, h("slot", { key: 'b8dcd760530fedfe50fb5bc17be55e0d296e8668' })))));
    }
    static get style() { return PnCustomernumberSelectorStyle0; }
}, [4, "pn-customernumber-selector", {
        "language": [1537],
        "open": [1540],
        "heading": [1],
        "description": [1],
        "i18n": [32]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["pn-customernumber-selector"];
    components.forEach(tagName => { switch (tagName) {
        case "pn-customernumber-selector":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, PnCustomernumberSelector$1);
            }
            break;
    } });
}

const PnCustomernumberSelector = PnCustomernumberSelector$1;
const defineCustomElement = defineCustomElement$1;

export { PnCustomernumberSelector, defineCustomElement };

//# sourceMappingURL=pn-customernumber-selector.js.map