"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class SelectionChip {
    handleButtonClick(originalEvent) {
        let expanded = this.state.expanded;
        let selected = this.state.selected;
        if (!this.input.disabled) {
            if (this.input.variant === "menu") {
                expanded = !expanded;
                this.state.expanded = expanded;
            }
            else {
                selected = !selected;
                this.state.selected = selected;
            }
            this.emit("click", {
                expanded,
                selected,
                originalEvent,
            });
        }
    }
    onMount() {
        this.state.mounted = true;
    }
    onCreate() {
        this.state = {
            selected: false,
            expanded: false,
            mounted: false,
        };
    }
    onInput(input) {
        this.state.selected = input.selected || false;
        this.state.expanded = input.expanded || false;
    }
}
module.exports = SelectionChip;
