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_DOCUMENT_BLUEPRINT_WORKSPACE_ALIAS, UMB_DOCUMENT_BLUEPRINT_WORKSPACE_CONTEXT } from './constants.js';
import { UmbTextStyles } from '../../../core/style/index.js';
import { css, html, nothing, customElement, state, repeat } from '../../../../external/lit/index.js';
import { UmbLitElement } from '../../../core/lit-element/index.js';
let UmbDocumentBlueprintWorkspaceSplitViewElement = class UmbDocumentBlueprintWorkspaceSplitViewElement extends UmbLitElement {
    constructor() {
        super();
        // TODO: Refactor: use a split view workspace context token:
        this.consumeContext(UMB_DOCUMENT_BLUEPRINT_WORKSPACE_CONTEXT, (context) => {
            this._workspaceContext = context;
            this._observeActiveVariantInfo();
        });
    }
    _observeActiveVariantInfo() {
        if (!this._workspaceContext)
            return;
        this.observe(this._workspaceContext.splitView.activeVariantsInfo, (variants) => {
            this._variants = variants;
        }, '_observeActiveVariantsInfo');
    }
    render() {
        return this._variants
            ? html `<div id="splitViews">
						${repeat(this._variants, (view) => view.index + '_' + (view.culture ?? '') + '_' + (view.segment ?? '') + '_' + this._variants.length, (view) => html `
								<umb-workspace-split-view
									.splitViewIndex=${view.index}
									.displayNavigation=${view.index === this._variants.length - 1}></umb-workspace-split-view>
							`)}
					</div>

					<umb-workspace-footer alias=${UMB_DOCUMENT_BLUEPRINT_WORKSPACE_ALIAS}></umb-workspace-footer>`
            : nothing;
    }
    static { this.styles = [
        UmbTextStyles,
        css `
			:host {
				width: 100%;
				height: 100%;

				display: flex;
				flex: 1;
				flex-direction: column;
			}

			#splitViews {
				display: flex;
				width: 100%;
				height: calc(100% - var(--umb-footer-layout-height));
			}

			#breadcrumbs {
				margin: 0 var(--uui-size-layout-1);
			}
		`,
    ]; }
};
__decorate([
    state()
], UmbDocumentBlueprintWorkspaceSplitViewElement.prototype, "_variants", void 0);
UmbDocumentBlueprintWorkspaceSplitViewElement = __decorate([
    customElement('umb-document-blueprint-workspace-split-view')
], UmbDocumentBlueprintWorkspaceSplitViewElement);
export { UmbDocumentBlueprintWorkspaceSplitViewElement };
export default UmbDocumentBlueprintWorkspaceSplitViewElement;
