var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import '../buttons/tool-icon-button.js';
import { WithDisposable } from '@blockeditor/lit';
import { html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { UngroupButtonIcon } from '../../../../_common/icons/index.js';
import { GroupElement } from '../../../../surface-block/index.js';
let EdgelessUngroupButton = class EdgelessUngroupButton extends WithDisposable(LitElement) {
    render() {
        return html `<edgeless-tool-icon-button
      .class=${'edgeless-component-toolbar-ungroup-button'}
      .iconContainerPadding=${2}
      @click=${() => {
            const { selectionManager } = this.surface.edgeless;
            if (selectionManager.firstElement instanceof GroupElement) {
                this.surface.group.ungroup(selectionManager.firstElement);
            }
        }}
      .tooltip=${'Ungroup'}
      .tipPosition=${'bottom'}
    >
      ${UngroupButtonIcon}
    </edgeless-tool-icon-button> `;
    }
};
__decorate([
    property({ attribute: false })
], EdgelessUngroupButton.prototype, "surface", void 0);
EdgelessUngroupButton = __decorate([
    customElement('edgeless-ungroup-button')
], EdgelessUngroupButton);
export { EdgelessUngroupButton };
//# sourceMappingURL=ungroup-button.js.map