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 { html, customElement, property, when } from '../../../external/lit/index.js';
import { UmbActionExecutedEvent } from '../event/index.js';
import { UmbLitElement } from '../lit-element/index.js';
const elementName = 'umb-entity-bulk-action';
let UmbEntityBulkActionDefaultElement = class UmbEntityBulkActionDefaultElement extends UmbLitElement {
    async #onClick(event) {
        if (!this.api)
            return;
        event.stopPropagation();
        await this.api.execute().catch(() => { });
        this.dispatchEvent(new UmbActionExecutedEvent());
    }
    render() {
        return html `
			<uui-button color="default" look="secondary" label=${this.localize.string(this.manifest?.meta.label ?? '')} @click=${this.#onClick}>
				${when(this.manifest?.meta.icon, () => html `<uui-icon name=${this.manifest.meta.icon}></uui-icon>`)}
				<span>${this.localize.string(this.manifest?.meta.label ?? '')}</span>
			</uui-button>
		`;
    }
};
__decorate([
    property({ attribute: false })
], UmbEntityBulkActionDefaultElement.prototype, "manifest", void 0);
UmbEntityBulkActionDefaultElement = __decorate([
    customElement(elementName)
], UmbEntityBulkActionDefaultElement);
export { UmbEntityBulkActionDefaultElement };
export default UmbEntityBulkActionDefaultElement;
