import { h } from "@stencil/core";
import { configStore } from "../../store/store";
export class QuickMessageTextContentComponent {
    content;
    maxLength = 2000;
    placeholder = 'พิมพ์ข้อความที่นี่';
    contentChange;
    handleInput = (event) => {
        const target = event.target;
        if (!this.content) {
            return;
        }
        this.contentChange.emit({ ...this.content, text: target.value });
    };
    render() {
        const content = this.content;
        const text = content ? content.text : '';
        const theme = configStore.get('theme');
        return (h("div", { key: 'acb5b1a31d6f65502c7cc3b2fa78b74f9e1c1a3d', class: "flex justify-end", "data-theme": theme }, h("div", { key: '156b2dcc2ff51d29f2eb5b820de25f9cb388bc71', class: "relative w-full max-w-md" }, h("textarea", { key: '762a8aa2eb73428b32e7d795db6279bf6fb23c70', value: text, onInput: this.handleInput, placeholder: this.placeholder, class: "w-full p-4 pr-16 pb-8 border-[1.5px] border-primary rounded-xl focus:outline-none ring-primary text-sm bg-background", maxLength: this.maxLength, rows: 3 }), h("div", { key: '896f69ad39213a0e143475586283fecf994051e8', class: "absolute bottom-3 right-4 text-sm text-theme-gray" }, text.length, "/", this.maxLength))));
    }
    static get is() { return "quick-message-text-content"; }
    static get properties() {
        return {
            "content": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "QuickMessageTemplateContent",
                    "resolved": "{ id: string; type: QuickMessageTemplateContentType; text?: string; buttons: QuickMessageTemplateButton[]; file_url?: string; file?: FileMessage; menu_list: QuickMessageTemplateMenuListItem[]; sequence?: number; }",
                    "references": {
                        "QuickMessageTemplateContent": {
                            "location": "import",
                            "path": "../../store/type",
                            "id": "src/store/type.ts::QuickMessageTemplateContent",
                            "referenceLocation": "QuickMessageTemplateContent"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "maxLength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "max-length",
                "defaultValue": "2000"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "placeholder",
                "defaultValue": "'\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48'"
            }
        };
    }
    static get events() {
        return [{
                "method": "contentChange",
                "name": "contentChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "QuickMessageTemplateContent",
                    "resolved": "{ id: string; type: QuickMessageTemplateContentType; text?: string; buttons: QuickMessageTemplateButton[]; file_url?: string; file?: FileMessage; menu_list: QuickMessageTemplateMenuListItem[]; sequence?: number; }",
                    "references": {
                        "QuickMessageTemplateContent": {
                            "location": "import",
                            "path": "../../store/type",
                            "id": "src/store/type.ts::QuickMessageTemplateContent",
                            "referenceLocation": "QuickMessageTemplateContent"
                        }
                    }
                }
            }];
    }
}
