import { p as proxyCustomElement, H, e as createEvent, w as writeTask, h, c as Host } from './p-ae373651.js';
import { e as defaultIconPack, i as useLanguage } from './p-5b3a7f00.js';
import { r as reverse, h as handleFilesDataTransfer, d as replyBlockPattern, e as extractReplyBlock, s as stripOutReplyBlock, M as MAX_TEXT_LENGTH } from './p-0db812c2.js';
import { a as gracefulStorage } from './p-a83ccdbd.js';
import { S as SyncWithStore } from './p-070aa695.js';
import { d as defineCustomElement$7 } from './p-a3bf84d7.js';
import { d as defineCustomElement$6 } from './p-85587a5c.js';
import { d as defineCustomElement$5 } from './p-0e5b6daf.js';
import { d as defineCustomElement$4 } from './p-3e0452c4.js';
import { d as defineCustomElement$3 } from './p-e6245534.js';
import { d as defineCustomElement$2 } from './p-bece0226.js';

const rtkChatComposerUiCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n    var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.chat-input{position:relative;margin:var(--rtk-space-2, 8px);z-index:10;box-sizing:border-box;display:flex;flex-direction:column;border-radius:var(--rtk-border-radius-md, 8px);border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}textarea{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));box-sizing:border-box;padding:var(--rtk-space-3, 12px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}textarea::-moz-placeholder{color:rgb(var(--rtk-colors-text-1000, 255 255 255))}textarea::placeholder{color:rgb(var(--rtk-colors-text-1000, 255 255 255))}textarea{border-top-left-radius:var(--rtk-border-radius-md, 8px);border-top-right-radius:var(--rtk-border-radius-md, 8px);font-family:var(--rtk-font-family, sans-serif);outline:2px solid transparent;outline-offset:2px;resize:none;overflow-y:auto;border-width:var(--rtk-border-width-none, 0);border-style:none;min-height:60px;font-size:16px}.chat-buttons{border-bottom-right-radius:var(--rtk-border-radius-md, 8px);border-bottom-left-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));display:flex;height:var(--rtk-space-8, 32px);align-items:center;justify-content:space-between;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}.chat-buttons .left rtk-button{margin-right:var(--rtk-space-1, 4px)}.chat-buttons .left rtk-button rtk-icon{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}.chat-buttons .right{z-index:10}.chat-buttons .right .edit-buttons{display:flex;gap:var(--rtk-space-2, 8px)}.chat-buttons>div{display:flex;align-items:center}rtk-emoji-picker{z-index:0;position:absolute;bottom:var(--rtk-space-32, 128px);border-top:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));animation:0.3s slide-up ease}@keyframes slide-up{from{transform:translateY(100%)}to{transform:translateY(0%)}}.member-list{margin:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-1, 4px);max-height:var(--rtk-space-28, 112px);min-width:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);padding:var(--rtk-space-0, 0px);position:absolute;bottom:var(--rtk-space-28, 112px);list-style-type:none;overflow-y:auto;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));border-radius:var(--rtk-border-radius-sm, 4px);--tw-border-spacing-x:var(--rtk-space-2, 8px);--tw-border-spacing-y:var(--rtk-space-2, 8px);border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);border-style:solid;border-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.5)}.member-list .member{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);padding:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-4, 16px);cursor:pointer}.member-list .member rtk-avatar{flex-shrink:0;height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);font-size:14px;color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.member-list .member span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.member-list .member:hover,.member-list .member.selected{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-700, 2 70 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.suggested-replies{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-3, 12px);display:flex;flex-wrap:nowrap;gap:var(--rtk-space-2, 8px);list-style-type:none;overflow-x:auto}.suggested-replies rtk-tooltip{flex-shrink:0}.suggested-replies li{padding:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-md, 8px);background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.75);color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));cursor:pointer}.suggested-replies li:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity))}.preview-overlay{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));border-radius:var(--rtk-border-radius-md, 8px)}.file-preview{position:absolute;top:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);max-width:-moz-fit-content;max-width:fit-content;max-height:var(--rtk-space-20, 80px)}.file-preview:hover rtk-tooltip{display:block}.file-preview rtk-tooltip{position:absolute;top:calc(var(--rtk-space-1, 4px) * -1);left:calc(var(--rtk-space-1, 4px) * -1);display:none;margin-left:calc(var(--rtk-space-1, 4px) * -1);margin-top:calc(var(--rtk-space-1, 4px) * -1)}.file-preview rtk-button{display:flex;height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));border:1px solid rgb(var(--rtk-colors-text-1000, 255 255 255))}.file-preview rtk-icon{height:var(--rtk-space-3, 12px);width:var(--rtk-space-3, 12px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.preview-image{height:var(--rtk-space-16, 64px);width:var(--rtk-space-16, 64px);-o-object-fit:cover;object-fit:cover;max-height:100%;max-width:100%;overflow:clip;border-radius:var(--rtk-border-radius-md, 8px)}.preview-file{padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--rtk-border-radius-md, 8px);max-width:200px}@keyframes scroll-text{0%{transform:translateX(0%)}70%{transform:translateX(-100%)}80%{transform:translateX(0%)}100%{transform:translateX(0%)}}";
const RtkChatComposerUiStyle0 = rtkChatComposerUiCss;

var __decorate = (undefined && undefined.__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;
};
const MENTION_CHAR = '@';
const RtkChatComposerUi$1 = /*@__PURE__*/ proxyCustomElement(class RtkChatComposerUi extends H {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        this.onNewMessage = createEvent(this, "rtkNewMessage", 7);
        this.onEditMessage = createEvent(this, "rtkEditMessage", 7);
        this.onEditCancelled = createEvent(this, "rtkEditCancelled", 7);
        /** Whether user can send text messages */
        this.canSendTextMessage = false;
        /** Whether user can send file messages */
        this.canSendFiles = false;
        /** Icon pack */
        this.iconPack = defaultIconPack;
        /** Language */
        this.t = useLanguage();
        /** Whether to show emoji picker */
        this.disableEmojiPicker = false;
        /** prefill the composer */
        this.prefill = {};
        /** list of members that can be mentioned */
        this.members = [];
        this.emojiPickerActive = false;
        this.mentionQuery = '';
        this.focusedMemberIndex = 0;
        this.filePreview = null;
        this.fileReader = new FileReader();
        this.fileToUpload = null;
        this.handleKeyDown = (e) => {
            if (e.key === MENTION_CHAR && [undefined, ' '].includes(this.$textArea.value.at(-1))) {
                // [undefined, ' '] checks if mention is start of text or start of new word
                this.mentionQuery = MENTION_CHAR;
            }
            if (e.key === 'ArrowDown') {
                this.focusedMemberIndex = Math.min(this.focusedMemberIndex + 1, this.getFilteredMembers().length - 1);
            }
            if (e.key === 'ArrowUp') {
                this.focusedMemberIndex = Math.max(0, this.focusedMemberIndex - 1);
            }
            if (e.key === 'Escape' || (e.key === 'Backspace' && this.mentionQuery === MENTION_CHAR)) {
                this.mentionQuery = '';
            }
            if (['Enter', 'Tab', ' '].includes(e.key) && this.mentionQuery !== '') {
                const member = this.getFilteredMembers()[this.focusedMemberIndex];
                this.onMemberSelect(member);
                e.preventDefault();
                return;
            }
            // slack like typing experience
            if (e.key === 'Enter' && e.shiftKey) {
                const height = this.$textArea.clientHeight;
                if (height < 200) {
                    this.$textArea.style.height = this.$textArea.clientHeight + 20 + 'px';
                }
            }
            else if (e.key === 'Enter') {
                e.preventDefault();
                if (this.prefill.editMessage) {
                    this.handleEditMessage();
                }
                else {
                    this.handleSendMessage();
                }
            }
            else if (e.key === 'Backspace') {
                if (this.$textArea.value.endsWith('\n')) {
                    this.$textArea.style.height = this.$textArea.clientHeight - 20 + 'px';
                }
                else if (this.$textArea.value === '') {
                    this.$textArea.style.height = 'auto';
                }
            }
        };
        this.handleKeyUp = (_e) => {
            if (this.mentionQuery !== '') {
                const reversed = reverse(this.$textArea.value.trim());
                const query = reversed.substring(0, reversed.indexOf(MENTION_CHAR));
                this.mentionQuery = `${MENTION_CHAR}${reverse(query)}`;
            }
        };
        this.onPaste = (e) => {
            const data = e.clipboardData || e.originalEvent.clipboardData;
            writeTask(() => {
                if (data && data.items && data.items.length > 0) {
                    handleFilesDataTransfer(data.items, this.generateFilePreview);
                    this.$textArea.value = '';
                }
            });
        };
        this.generateFilePreview = (type, file) => {
            this.fileToUpload = { type, image: file, file };
            if (type === 'image') {
                this.fileReader.readAsDataURL(file);
            }
            else if (type === 'file') {
                this.filePreview = file.name;
            }
        };
        this.sendFile = () => {
            if (!this.canSendFiles) {
                return;
            }
            if (this.fileToUpload.type === 'image') {
                this.onNewMessage.emit({
                    type: 'image',
                    file: this.fileToUpload.image,
                    image: this.fileToUpload.image,
                });
            }
            else {
                this.onNewMessage.emit({ type: 'file', file: this.fileToUpload.file });
            }
            this.cleanUpFileUpload();
        };
        this.handleSendMessage = () => {
            if (!this.canSendTextMessage) {
                return;
            }
            if (this.fileToUpload !== null) {
                this.sendFile();
                return;
            }
            const message = this.$textArea.value.trim();
            if (message.length > 0) {
                if (this.prefill.replyMessage) {
                    this.onNewMessage.emit({
                        type: 'text',
                        message,
                        replyTo: this.prefill.replyMessage,
                    });
                }
                else {
                    this.onNewMessage.emit({ type: 'text', message });
                }
                this.cleanup();
            }
        };
        this.cleanup = () => {
            this.mentionQuery = '';
            this.focusedMemberIndex = 0;
            this.$textArea.value = '';
            this.$textArea.style.height = 'auto';
            gracefulStorage.setItem(this.storageKey, '');
        };
        this.handleEditMessage = () => {
            var _a;
            let editedMessage = this.$textArea.value.trim();
            if (((_a = this.prefill.editMessage) === null || _a === void 0 ? void 0 : _a.message) &&
                replyBlockPattern.test(this.prefill.editMessage.message)) {
                // add back the reply block which we stripped out for editing
                const replyBlock = extractReplyBlock(this.prefill.editMessage.message);
                editedMessage = `${replyBlock}\n\n${editedMessage}`;
            }
            this.onEditMessage.emit({
                id: this.prefill.editMessage.id,
                message: editedMessage,
            });
            this.cleanup();
        };
        this.handleEditCancel = () => {
            this.onEditCancelled.emit();
            this.cleanup();
        };
        this.initializeTextField = (el) => {
            this.$textArea = el;
            const message = gracefulStorage.getItem(this.storageKey) || '';
            this.$textArea.value = message;
        };
        this.onMemberSelect = (member) => {
            const reversedQuery = reverse(this.mentionQuery);
            const reversed = reverse(this.$textArea.value.trim()).replace(reversedQuery, '');
            this.$textArea.value = reverse(reversed) + `${MENTION_CHAR}${member.name} `;
            this.mentionQuery = '';
            this.focusedMemberIndex = 0;
            writeTask(() => this.$textArea.focus());
        };
        this.getFilteredMembers = () => {
            const query = this.mentionQuery.replace(MENTION_CHAR, '');
            return this.members.filter((member) => member.name.toLowerCase().includes(query.toLowerCase()));
        };
        this.cleanUpFileUpload = () => {
            this.filePreview = null;
            this.fileToUpload = null;
        };
        this.renderSuggestedReplies = () => {
            if (!this.prefill.suggestedReplies)
                return;
            if (this.prefill.suggestedReplies.length === 0)
                return;
            return (h("ul", { class: "suggested-replies scrollbar" }, this.prefill.suggestedReplies.map((reply) => (h("rtk-tooltip", { label: this.t('chat.click_to_send') }, h("li", { onClick: () => this.onNewMessage.emit({ type: 'text', message: reply }) }, reply))))));
        };
        this.renderMenu = () => {
            if (this.mentionQuery.length === 0)
                return;
            const filteredMembers = this.getFilteredMembers();
            if (filteredMembers.length === 0)
                return;
            return (h("ul", { class: "member-list scrollbar" }, filteredMembers.map((member, index) => (h("li", { class: { member: true, selected: index === this.focusedMemberIndex }, onClick: () => this.onMemberSelect(member), ref: ($li) => {
                    if (index === this.focusedMemberIndex) {
                        writeTask(() => {
                            if ($li)
                                $li.scrollIntoView({ behavior: 'smooth', block: 'end', inline: 'nearest' });
                        });
                    }
                } }, h("rtk-avatar", { participant: {
                    name: member.name,
                    picture: member.picture,
                }, size: "sm" }), h("span", null, member.name))))));
        };
    }
    connectedCallback() {
        this.fileReader.onload = (e) => {
            if (typeof e.target.result === 'string') {
                this.filePreview = e.target.result;
            }
        };
        // this.fileReader.onloadstart = () => {};
        // this.fileReader.onloadend = () => {};
    }
    componentDidRender() {
        if (this.prefill.editMessage || this.prefill.replyMessage) {
            writeTask(() => this.$textArea.focus());
        }
    }
    get storageKey() {
        return 'rtk-text-message';
    }
    uploadFile(type) {
        const input = document.createElement('input');
        input.type = 'file';
        if (type === 'image') {
            input.accept = 'image/*';
        }
        input.onchange = (e) => {
            const { validity, files: [file], } = e.target;
            if (validity.valid) {
                this.generateFilePreview(type, file);
            }
        };
        input.click();
    }
    renderFilePreview() {
        if (typeof this.filePreview !== 'string')
            return;
        return (h("div", { class: "preview-overlay" }, h("div", { class: "file-preview" }, h("rtk-tooltip", { label: this.t('chat.cancel_upload') }, h("rtk-button", { variant: "secondary", kind: "icon", onClick: this.cleanUpFileUpload }, h("rtk-icon", { icon: this.iconPack.dismiss }))), this.fileToUpload.type === 'image' ? (h("img", { class: "preview-image", src: this.filePreview })) : (h("div", { class: "preview-file" }, h("span", null, this.filePreview))))));
    }
    render() {
        var _a;
        let defaultValue = '';
        if ((_a = this.prefill.editMessage) === null || _a === void 0 ? void 0 : _a.message) {
            defaultValue = stripOutReplyBlock(this.prefill.editMessage.message);
        }
        return (h(Host, { key: 'c1bbf529244184de2062ddb50b40a918fe6b89f0' }, this.canSendTextMessage && this.emojiPickerActive && (h("rtk-emoji-picker", { key: '62c92f177bdf7ff725a345efd948fbd07e58efda', part: "emoji-picker", onPickerClose: () => {
                this.emojiPickerActive = false;
            }, onRtkEmojiClicked: (e) => {
                this.$textArea.value += e.detail;
                this.$textArea.focus();
            }, t: this.t })), this.renderSuggestedReplies(), h("slot", { key: '02f70148bdae1f9e3b9fc60d088c59f85af68880', name: "chat-addon" }), h("slot", { key: '0ac47b719d6c39807076f86bcd0fe4fb9b75fcd5', name: "quote-block" }), h("div", { key: 'e88db8097f1615f62235c41262700c0c11bc0453', class: "chat-input", part: "chat-input" }, this.renderMenu(), this.canSendTextMessage && (h("textarea", { key: 'f1aa0c834b37e25a7e3093d10b6ad4531d58c0e8', class: "scrollbar", part: "textarea", ref: this.initializeTextField, autoFocus: true, placeholder: this.fileToUpload ? '' : this.t('chat.message_placeholder'), value: defaultValue, onPaste: this.onPaste, maxLength: MAX_TEXT_LENGTH, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onInput: (e) => {
                gracefulStorage.setItem(this.storageKey, e.target.value);
            }, disabled: !!this.filePreview })), h("div", { key: '724a8e40a0384c4f11efca4d7abf081b110a7c9f', class: "chat-buttons", part: "chat-buttons" }, h("div", { key: '028b74f93d7b8ba1964460ea80ed4c63d56e5146', class: "left", part: "chat-buttons-left" }, !this.prefill.editMessage &&
            this.canSendFiles && [
            h("rtk-tooltip", { key: 'e4b0edc4f6a0f8f8b91ec4925dbd661c3e3b1a32', label: this.t('chat.send_file') }, h("rtk-button", { key: '53f030c9720362995342eb1959da07136c44724b', variant: "ghost", kind: "icon", onClick: () => this.uploadFile('file'), title: this.t('chat.send_file') }, h("rtk-icon", { key: '51bf45a1074886452e1c7d6ca80d8b5f9e7a61ba', icon: this.iconPack.attach }))),
            h("rtk-tooltip", { key: 'd20a53b034f312ced9d7f5441da7574100cbb6e7', label: this.t('chat.send_img') }, h("rtk-button", { key: '822413ff8636a33d2d70c7d10412a0ff5d043d86', variant: "ghost", kind: "icon", onClick: () => this.uploadFile('image'), title: this.t('chat.send_img') }, h("rtk-icon", { key: 'af60e5ec42253e7780af31bc5f2fb9ad00ad6245', icon: this.iconPack.image }))),
        ], !this.prefill.editMessage && this.canSendTextMessage && !this.disableEmojiPicker && (h("rtk-tooltip", { key: '665bb180737c220297a9394f582ddd8d57135ed4', label: this.t('chat.send_emoji') }, h("rtk-button", { key: '6550bd345555644e89a501df5838452206ea9c55', variant: "ghost", kind: "icon", class: { active: this.emojiPickerActive }, title: this.t('chat.send_emoji'), onClick: () => {
                this.emojiPickerActive = !this.emojiPickerActive;
            } }, h("rtk-icon", { key: '4ee0c02bf3efc309a58db7be0f51545d6d346a9c', icon: this.iconPack.emoji_multiple }))))), !!this.filePreview && this.renderFilePreview(), this.canSendTextMessage && (h("div", { key: 'a7d3f27cbe43f591363d1ffd8858f30d457e6629', class: "right", part: "chat-buttons-right" }, !this.prefill.editMessage && (h("rtk-tooltip", { key: '57fc69e04c29b54cfb8510914659f0b94c3944eb', variant: "primary", label: this.t('chat.send_msg'), delay: 2000 }, h("rtk-button", { key: '949e480cc2a243265f1268aff6396cd9bda20b03', kind: "icon", onClick: () => this.handleSendMessage(), title: this.t('chat.send_msg') }, h("rtk-icon", { key: '8fe5bc5391bef475805c86ab3fec94690bd71dfd', icon: this.iconPack.send })))), this.prefill.editMessage && (h("div", { key: '3e87dae17dcac9be10a20fe15252756d496bf924', class: "edit-buttons" }, h("rtk-tooltip", { key: '201e7b44dc8a40cfc94bb299448a1e89c972ea92', variant: "secondary", label: this.t('cancel'), delay: 2000 }, h("rtk-button", { key: '64d5dc9e41bc87a654c760c709b7b7d378f28141', kind: "icon", variant: "secondary", onClick: () => this.handleEditCancel(), title: this.t('cancel') }, h("rtk-icon", { key: '7e75e511da878e45f88b75c2f23a855a8c191b9b', icon: this.iconPack.dismiss }))), h("rtk-tooltip", { key: 'df6284b88ac9651d5cb1c736b92fb929ee5795a1', variant: "primary", label: this.t('chat.update_msg'), delay: 2000 }, h("rtk-button", { key: 'c6b375320d193ccbf6658aa040302453ae361f91', kind: "icon", onClick: () => this.handleEditMessage(), title: this.t('chat.send_msg') }, h("rtk-icon", { key: 'f047153809bc154526364f2e9a903449f83f51a9', icon: this.iconPack.checkmark })))))))))));
    }
    static get style() { return RtkChatComposerUiStyle0; }
}, [1, "rtk-chat-composer-ui", {
        "canSendTextMessage": [4, "can-send-text-message"],
        "canSendFiles": [4, "can-send-files"],
        "size": [513],
        "iconPack": [16],
        "t": [16],
        "disableEmojiPicker": [4, "disable-emoji-picker"],
        "prefill": [16],
        "members": [16],
        "emojiPickerActive": [32],
        "mentionQuery": [32],
        "focusedMemberIndex": [32],
        "filePreview": [32]
    }]);
__decorate([
    SyncWithStore()
], RtkChatComposerUi$1.prototype, "iconPack", void 0);
__decorate([
    SyncWithStore()
], RtkChatComposerUi$1.prototype, "t", void 0);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["rtk-chat-composer-ui", "rtk-avatar", "rtk-button", "rtk-emoji-picker", "rtk-icon", "rtk-spinner", "rtk-tooltip"];
    components.forEach(tagName => { switch (tagName) {
        case "rtk-chat-composer-ui":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, RtkChatComposerUi$1);
            }
            break;
        case "rtk-avatar":
            if (!customElements.get(tagName)) {
                defineCustomElement$7();
            }
            break;
        case "rtk-button":
            if (!customElements.get(tagName)) {
                defineCustomElement$6();
            }
            break;
        case "rtk-emoji-picker":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "rtk-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "rtk-spinner":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "rtk-tooltip":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}
defineCustomElement$1();

const RtkChatComposerUi = RtkChatComposerUi$1;
const defineCustomElement = defineCustomElement$1;

export { RtkChatComposerUi, defineCustomElement };
