import { __decorate } from "tslib";
import { LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
let NileRteMentionsItem = class NileRteMentionsItem extends LitElement {
    constructor() {
        super(...arguments);
        this.mentionsCharacter = '';
        this.mentionsColor = '';
        this.mentionsPrefix = '';
        this.mentionsSuffix = '';
        this.mentionsData = [];
    }
    createRenderRoot() { return this; }
};
__decorate([
    property({ attribute: 'mentionscharacter', reflect: true })
], NileRteMentionsItem.prototype, "mentionsCharacter", void 0);
__decorate([
    property({ attribute: 'mentionscolor', reflect: true })
], NileRteMentionsItem.prototype, "mentionsColor", void 0);
__decorate([
    property({ attribute: 'mentionsprefix', reflect: true })
], NileRteMentionsItem.prototype, "mentionsPrefix", void 0);
__decorate([
    property({ attribute: 'mentionssuffix', reflect: true })
], NileRteMentionsItem.prototype, "mentionsSuffix", void 0);
__decorate([
    property({
        attribute: 'mentionsdata',
        reflect: true,
        converter: {
            fromAttribute: (value) => {
                if (!value)
                    return [];
                try {
                    const parsed = JSON.parse(value);
                    return Array.isArray(parsed)
                        ? parsed.filter(i => i && typeof i.key === 'string' && typeof i.label === 'string')
                        : [];
                }
                catch {
                    return [];
                }
            },
            toAttribute: (v) => JSON.stringify(v ?? []),
        }
    })
], NileRteMentionsItem.prototype, "mentionsData", void 0);
NileRteMentionsItem = __decorate([
    customElement('nile-rte-mentions-item')
], NileRteMentionsItem);
export { NileRteMentionsItem };
//# sourceMappingURL=nile-rte-mentions-item.js.map