import { Host, h } from "@stencil/core";
import { link } from "pn-design-assets/pn-assets/icons.js";
export class PnChatMessage {
    constructor() {
        this.category = undefined;
        this.customerSegment = undefined;
        this.agentName = undefined;
    }
    robotIcon = '<?xml version="1.0" encoding="UTF-8"?> <svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 20 20"> <!-- Generator: Adobe Illustrator 29.5.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 141)  --> <defs> <style> .st0 { fill: none; } .st1 { fill: #8eddf9; } .st2 { fill: #f3f2f2; } .st3 { fill: #0d234b; } .st4 { fill: #f06365; } .st5 { clip-path: url(#clippath); } .st6 { fill: #005d92; } </style> <clipPath id="clippath"> <rect class="st0" width="20" height="20"/> </clipPath> </defs> <g class="st5"> <g> <path class="st2" d="M10,20c5.5,0,10-4.5,10-10S15.5,0,10,0,0,4.5,0,10s4.5,10,10,10Z"/> <path class="st3" d="M10.5,4h-.5v2.8h.5v-2.8Z"/> <path class="st3" d="M10.2,4.3c.5,0,1-.4,1-1s-.4-1-1-1-1,.4-1,1,.4,1,1,1Z"/> <path class="st3" d="M9,5h2.4c1,0,1.8.8,1.8,1.8h-6c0-1,.8-1.8,1.8-1.8Z"/> <path class="st4" d="M17,10.3v-.8c0-1.9-1.5-3.5-3.5-3.5h-7.1c-1.9,0-3.5,1.6-3.5,3.5v.8h14.1Z"/> <path d="M13.9,16.1l-3.7.4v-.4s3.6-.4,3.6-.4c.8,0,1.6-.4,2.1-1s.7-2.9.7-3.7h.4c0,.9-.2,3.3-.8,3.9-.6.7-1.4,1.1-2.3,1.2Z"/> <path class="st4" d="M16.3,12.1v-3.6h.2c1,0,1.8.8,1.8,1.8s-.8,1.8-1.8,1.8h-.2Z"/> <path class="st4" d="M3.7,8.5v3.6h-.2c-1,0-1.8-.8-1.8-1.8s.8-1.8,1.8-1.8h.2Z"/> <path class="st3" d="M13.1,6.6h-6.2c-1.8,0-3.3,1.5-3.3,3.3v2.1c0,1.8,1.5,3.3,3.3,3.3h6.2c1.8,0,3.3-1.5,3.3-3.3v-2.1c0-1.8-1.5-3.3-3.3-3.3Z"/> <path class="st6" d="M12.8,7.8h-5.6c-1.4,0-2.5,1.1-2.5,2.5v1.4c0,1.4,1.1,2.4,2.5,2.4h5.6c1.4,0,2.4-1.1,2.4-2.4v-1.4c0-1.4-1.1-2.5-2.4-2.5Z"/> <path class="st1" d="M12.3,11.9c.5,0,1-.4,1-1s-.4-1-1-1-1,.4-1,1,.4,1,1,1Z"/> <path class="st1" d="M7.7,11.9c.5,0,1-.4,1-1s-.4-1-1-1-1,.4-1,1,.4,1,1,1Z"/> <path d="M11,15.8h-1.5c-.3,0-.5.2-.5.5h0c0,.3.2.5.5.5h1.5c.3,0,.5-.2.5-.5h0c0-.3-.2-.5-.5-.5Z"/> </g> </g> </svg>';
    blue700 = 'blue700';
    getIcon() {
        let icon = null;
        switch (this.category) {
            case 'Bot':
                return this.robotIcon;
            case 'Agent':
                return this.agentName;
            case 'Link':
                return link;
        }
        return icon;
    }
    getMessageClass() {
        switch (this.category) {
            case 'ButtonResponse':
                return 'buttonresponse';
            case 'User':
                return 'user';
            case 'System':
                return 'system-message';
            default:
                return undefined;
        }
    }
    render() {
        const segmentClass = this.customerSegment?.toLowerCase() || '';
        const categoryClass = this.category?.toLowerCase() || '';
        return (h(Host, { key: '0374df82558acb6e79d3d07c0f2c298d2ce92870', class: this.getMessageClass() }, h("div", { key: '4c1757209df47ef338df4d85cf0f05394910e42a', class: `message-container ${categoryClass}` }, this.getIcon() && (h("span", { key: 'eca69f752de209c2a3265f12b6b90f1754e792c7', class: "category" }, h("pn-icon", { key: 'dd21b543ffc4f4a13c67376b913086b9ac3bbbe4', icon: this.getIcon(), color: this.blue700, "aria-hidden": "true", role: "presentation" }))), h("span", { key: '832adb5cfe7cd28ca5b3cf514d679d03df5795ac', class: `message ${segmentClass}` }, h("slot", { key: '9f73842238b2b8ca041ba9c643cbf6df2d60599b' })))));
    }
    static get is() { return "pn-chat-message"; }
    static get originalStyleUrls() {
        return {
            "$": ["pn-chat-message.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["pn-chat-message.css"]
        };
    }
    static get properties() {
        return {
            "category": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "MessageCategory",
                    "resolved": "\"Agent\" | \"Bot\" | \"Button\" | \"ButtonResponse\" | \"Card\" | \"Link\" | \"System\" | \"User\"",
                    "references": {
                        "MessageCategory": {
                            "location": "import",
                            "path": "../types",
                            "id": "src/components/widgets/pn-chat/types.ts::MessageCategory"
                        }
                    }
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "category",
                "reflect": false
            },
            "customerSegment": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "CustomerSegment",
                    "resolved": "string",
                    "references": {
                        "CustomerSegment": {
                            "location": "import",
                            "path": "../types",
                            "id": "src/components/widgets/pn-chat/types.ts::CustomerSegment"
                        }
                    }
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "customer-segment",
                "reflect": false
            },
            "agentName": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "agent-name",
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=pn-chat-message.js.map
