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_PROPERTY_TYPE_WORKSPACE_CONTEXT } from './property-type-workspace.context-token.js';
import { UmbTextStyles } from '../../../core/style/index.js';
import { customElement, css, html, state } from '../../../../external/lit/index.js';
import { UmbLitElement } from '../../../core/lit-element/index.js';
let UmbPropertyTypeWorkspaceEditorElement = class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement {
    #workspaceContext;
    constructor() {
        super();
        this.consumeContext(UMB_PROPERTY_TYPE_WORKSPACE_CONTEXT, (context) => {
            this.#workspaceContext = context;
            this.observe(context?.isNew, (isNew) => {
                this._isNew = isNew;
            });
            this.observe(context?.name, (name) => {
                this._name = name;
            });
            this.#workspaceContext?.createPropertyDatasetContext(this);
        });
    }
    render() {
        return this._isNew !== undefined
            ? html `
					<umb-workspace-editor
						headline=${this.localize.term(this._isNew ? 'contentTypeEditor_addProperty' : 'contentTypeEditor_editProperty', [this._name])}>
					</umb-workspace-editor>
				`
            : '';
    }
    static { this.styles = [
        UmbTextStyles,
        css `
			:host {
				display: block;
				width: 100%;
				height: 100%;
			}
		`,
    ]; }
};
__decorate([
    state()
], UmbPropertyTypeWorkspaceEditorElement.prototype, "_isNew", void 0);
__decorate([
    state()
], UmbPropertyTypeWorkspaceEditorElement.prototype, "_name", void 0);
UmbPropertyTypeWorkspaceEditorElement = __decorate([
    customElement('umb-property-type-workspace-editor')
], UmbPropertyTypeWorkspaceEditorElement);
export { UmbPropertyTypeWorkspaceEditorElement };
export default UmbPropertyTypeWorkspaceEditorElement;
