// #region Imports
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;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Emit } from '../../../../Events/Decorators/EmitDecorator';
import { HTMLElementEventEmitter } from '@breadstone/mosaik-elements';
import { Slottable } from '../../../Behaviors/Slottable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { contentElementTemplate } from './ContentElementTemplate';
import { contentElementJoyStyle } from './Themes/ContentElement.Joy';
import { contentElementRetroStyle } from './Themes/ContentElement.Retro';
import { contentElementCosmopolitanStyle } from './Themes/ContentElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
// #endregion
/**
 * The `{@link ContentElement}` element.
 *
 * @slot - The default content slot.
 *
 * @fires contentChanged - Fired when the content changes.
 *
 * @public
 */
let ContentElement = class ContentElement extends Themeable(Slottable(CustomElement)) {
    // #region Fields
    _contentChanged;
    _hasContent;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._hasContent = false;
        this._contentChanged = new HTMLElementEventEmitter(this, 'contentChanged');
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-content';
    }
    /**
     * Gets or sets the `hasContent` property.
     *
     * @public
     * @readonly
     * @attr
     */
    get hasContent() {
        return this._hasContent;
    }
    set hasContent(value) {
        if (this._hasContent !== value) {
            this._hasContent = value;
            this.requestUpdate('hasContent');
        }
    }
    /**
     * Called when <ACTION>.
     * Provides reference to `{@link IEventDetail}` as event detail.
     *
     * @public
     * @readonly
     * @eventProperty
     */
    get contentChanged() {
        return this._contentChanged;
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    onSlotChanges() {
        this.hasContent = this.hasSlotContent('');
    }
    /**
     * Emits the {@link contentChanged} event.
     *
     * @protected
     */
    onContentChanged(args) {
        this._contentChanged.emit(args);
    }
};
__decorate([
    Attribute({ type: Boolean, useDefault: true }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ContentElement.prototype, "hasContent", null);
__decorate([
    Emit({ eventName: 'contentChanged' }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [])
], ContentElement.prototype, "contentChanged", null);
ContentElement = __decorate([
    Component({
        selector: 'mosaik-content',
        template: contentElementTemplate,
        themes: {
            joy: contentElementJoyStyle,
            retro: contentElementRetroStyle,
            cosmopolitan: contentElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], ContentElement);
export { ContentElement };
//# sourceMappingURL=ContentElement.js.map