// #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 { Themeable } from '../../../../Controls/Behaviors/Themeable';
import { DomServiceLocator } from '../../../../Dom/Dom';
import { TextFormattable } from '../../../Behaviors/TextFormattable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { ContentElement } from '../../Primitives/Content/ContentElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { cardTitleElementTemplate } from './CardTitleElementTemplate';
import { cardTitleElementCosmopolitanStyle } from './Themes/CardTitleElement.Cosmopolitan';
import { cardTitleElementJoyStyle } from './Themes/CardTitleElement.Joy';
import { cardTitleElementMemphisStyle } from './Themes/CardTitleElement.Memphis';
// #endregion
/**
 * CardTitle - A component that represents the title section of a card.
 *
 * @description This component is used to display the title of a card, often styled to stand out from other content. It provides a clear heading for the information contained within the card.
 *
 * @name CardTitle
 * @element mosaik-card-title
 * @category UI Components
 *
 * @slot - The default slot for placing the title content.
 *
 * @cssprop {Color} --card-title-background-color - The background-color property for the card title.
 * @cssprop {Color} --card-title-border-color - The border-color property for the card title.
 * @cssprop {String} --card-title-font-family - The font-family property for the card title text.
 * @cssprop {String} --card-title-font-letter-spacing - The letter-spacing property for the card title text.
 * @cssprop {String} --card-title-font-line-height - The line-height property for the card title text.
 * @cssprop {String} --card-title-font-size - The font-size property for the card title text.
 * @cssprop {String} --card-title-font-text-decoration - The text-decoration property for the card title text.
 * @cssprop {String} --card-title-font-text-transform - The text-transform property for the card title text.
 * @cssprop {String} --card-title-font-weight - The font-weight property for the card title text.
 * @cssprop {Color} --card-title-foreground-color - The foreground-color property for the card title.
 * @cssprop {String} --card-title-gap - The title gap CSS custom property.
 * @cssprop {String} --card-title-padding-bottom - The title padding bottom CSS custom property.
 * @cssprop {String} --card-title-padding-left - The title padding left CSS custom property.
 * @cssprop {String} --card-title-padding-right - The title padding right CSS custom property.
 * @cssprop {String} --card-title-padding-top - The title padding top CSS custom property.
 * @cssprop {String} --card-title-shadow - The title shadow CSS custom property.
 * @cssprop {String} --card-title-shadow-blur - The title shadow blur CSS custom property.
 * @cssprop {String} --card-title-shadow-color - The title shadow color CSS custom property.
 * @cssprop {String} --card-title-shadow-offset-x - The title shadow offset x CSS custom property.
 * @cssprop {String} --card-title-shadow-offset-y - The title shadow offset y CSS custom property.
 * @cssprop {String} --card-title-shadow-spread - The title shadow spread CSS custom property.
 * @cssprop {String} --card-title-transition-duration - The title transition duration CSS custom property.
 * @cssprop {String} --card-title-transition-mode - The title transition mode CSS custom property.
 * @cssprop {String} --card-title-transition-property - The title transition property CSS custom property.
 * @cssprop {String} --card-title-translate - The title translate CSS custom property.
 *
 * @dependency mosaik-text - The Text element.
 *
 * @example
 * Using text attribute:
 * ```html
 * <mosaik-card-title text="Product Name"></mosaik-card-title>
 * ```
 *
 * @example
 * Using default slot with text content:
 * ```html
 * <mosaik-card-title>Product Name</mosaik-card-title>
 * ```
 *
 * @public
 */
let CardTitleElement = class CardTitleElement extends Themeable(TextFormattable(ContentElement)) {
    // #region Fields
    _text;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._text = '';
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @override
     * @readonly
    */
    static get is() {
        return 'mosaik-card-title';
    }
    /**
     * Gets or sets the `text` property.
     *
     * @public
     * @attr
     */
    get text() {
        return this._text;
    }
    set text(value) {
        if (this._text !== value) {
            this._text = value;
            this.requestUpdate('text');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     * @override
     */
    onApplyTemplate() {
        super.onApplyTemplate();
        // TODO: create any kind of obsevation here
        const card = DomServiceLocator.current.findShadowDomHost(this, { strict: true });
        if (this._text === '' && card.text !== '') {
            this.text = card.text;
        }
        if (this.formatter === null && card.formatter !== null) {
            this.formatter = card.formatter;
        }
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], CardTitleElement.prototype, "text", null);
CardTitleElement = __decorate([
    Component({
        selector: 'mosaik-card-title',
        template: cardTitleElementTemplate,
        themes: {
            joy: cardTitleElementJoyStyle,
            memphis: cardTitleElementMemphisStyle,
            cosmopolitan: cardTitleElementCosmopolitanStyle
        },
        host: {
            slot: 'header'
        },
        imports: [
            TextElement
        ]
    }),
    __metadata("design:paramtypes", [])
], CardTitleElement);
export { CardTitleElement };
//# sourceMappingURL=CardTitleElement.js.map