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 { UMB_ENTITY_WORKSPACE_CONTEXT } from '../../contexts/index.js';
import { html, customElement, state, nothing, css } from '../../../../../external/lit/index.js';
import { UmbLitElement } from '../../../lit-element/index.js';
import { UmbTextStyles } from '../../../style/index.js';
let UmbWorkspaceEntityActionMenuElement = class UmbWorkspaceEntityActionMenuElement extends UmbLitElement {
    constructor() {
        super();
        this.consumeContext(UMB_ENTITY_WORKSPACE_CONTEXT, (context) => {
            this._workspaceContext = context;
            this.observe(this._workspaceContext?.unique, (unique) => {
                this._unique = unique;
                // TODO: the context does not have an observable for the entity type, so we need to use the
                // getEntityType method until we can add an observable for it.
                this._entityType = this._workspaceContext?.getEntityType();
            });
        });
    }
    render() {
        if (!this._entityType)
            return nothing;
        if (this._unique === undefined)
            return nothing;
        return html `<umb-entity-actions-dropdown
			data-mark="workspace:action-menu-button"
			label=${this.localize.term('general_actions')}>
			<uui-symbol-more slot="label"></uui-symbol-more>
		</umb-entity-actions-dropdown>`;
    }
    static { this.styles = [
        UmbTextStyles,
        css `
			:host {
				height: 100%;
				margin-left: calc(var(--uui-size-layout-1) * -1);
			}

			umb-entity-actions-dropdown {
				height: 100%;
			}
		`,
    ]; }
};
__decorate([
    state()
], UmbWorkspaceEntityActionMenuElement.prototype, "_unique", void 0);
__decorate([
    state()
], UmbWorkspaceEntityActionMenuElement.prototype, "_entityType", void 0);
UmbWorkspaceEntityActionMenuElement = __decorate([
    customElement('umb-workspace-entity-action-menu')
], UmbWorkspaceEntityActionMenuElement);
export { UmbWorkspaceEntityActionMenuElement };
