import { p as proxyCustomElement, H, h } from './p-604af0ee.js';

const DgaContentSwitcher = /*@__PURE__*/ proxyCustomElement(class DgaContentSwitcher extends H {
    constructor() {
        super();
        this.__registerHost();
        this.value = 0;
        this.onColor = false;
        this.size = 'md';
        this.items = [
            {
                label: 'Item 1',
                content: 'Content 1',
            },
            {
                label: 'Item 2',
                content: 'Content 2',
            },
            {
                label: 'Item 3',
                content: 'Content 3',
            },
        ];
        this.onChange = () => { };
        this.selected = this.value;
        this.handleSelect = (index) => {
            this.selected = index;
            this.onChange(index);
        };
    }
    render() {
        return (h("div", { key: '7007dbc0f059caf862c107e224c54b34fc308985', class: "content-switcher" }, h("div", { key: 'dbdf8d3c0ff2b11f7e4ef95c987dcb52ed5b9354', class: "content-switcher__items" }, this.items.map((item, index) => {
            const selected = index === this.selected;
            const itemType = index === 0 ? 'first' : index === this.items.length - 1 ? 'last' : 'mid';
            const className = `content-switcher__item content-switcher__item--${itemType} ${this.onColor ? 'content-switcher__item--on-color' : ''} content-switcher__item--${this.size} ${selected ? 'content-switcher__item--selected' : ''}`;
            return (h("button", { key: index, type: "button", class: className, onClick: () => this.handleSelect(index) }, item.label));
        }))));
    }
}, [0, "dga-content-switcher", {
        "value": [1538],
        "onColor": [4, "on-color"],
        "size": [1],
        "items": [16],
        "onChange": [16],
        "selected": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["dga-content-switcher"];
    components.forEach(tagName => { switch (tagName) {
        case "dga-content-switcher":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, DgaContentSwitcher);
            }
            break;
    } });
}

export { DgaContentSwitcher as D, defineCustomElement as d };

//# sourceMappingURL=p-fecac91e.js.map