// #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 { Sizeable } from '../../../Behaviors/Sizeable';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { emojiElementTemplate } from './EmojiElementTemplate';
import { emojiElementJoyStyle } from './Themes/EmojiElement.Joy';
import { emojiElementRetroStyle } from './Themes/EmojiElement.Retro';
import { emojiElementCosmopolitanStyle } from './Themes/EmojiElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
// #endregion
/**
 * The `{@link EmojiElement}` element.
 *
 * @public
 */
let EmojiElement = class EmojiElement extends Themeable(Sizeable(CustomElement)) {
    // #region Fields
    _unicode;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._unicode = '';
    }
    // #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-emoji';
    }
    /**
     * Gets or sets the `unicode` property.
     *
     * @public
     */
    get unicode() {
        return this._unicode;
    }
    set unicode(value) {
        if (this._unicode !== value) {
            this._unicode = value;
            this.requestUpdate('unicode');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @public
     */
    toEmoji() {
        return this.transform(this.unicode);
    }
    /**
     * Transforms the specified unicode value to emoji.
     *
     * @protected
     */
    transform(value) {
        return value === undefined || value === null || value === ''
            ? ''
            : String.fromCodePoint(parseInt(value, 16));
    }
};
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], EmojiElement.prototype, "unicode", null);
EmojiElement = __decorate([
    Component({
        selector: 'mosaik-emoji',
        template: emojiElementTemplate,
        themes: {
            joy: emojiElementJoyStyle,
            retro: emojiElementRetroStyle,
            cosmopolitan: emojiElementCosmopolitanStyle
        },
        host: {
            role: 'text'
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], EmojiElement);
export { EmojiElement };
//# sourceMappingURL=EmojiElement.js.map