import { faTimes } from "@fortawesome/free-solid-svg-icons";
import { h } from "@stencil/core";
import { DataTestIdsEnum } from "../../../../../../../constants/dataTestIds.enum";
import { getIconHtmlFromIconDefinition } from "../../../../../../../utils/icons/getIconHtmlFromIconDefinition";
export class CustomToast {
    handleDeleteToast() {
        this.deleteToast.emit();
    }
    render() {
        return (h("div", { key: '5590bc6775c7e36cef4f4e60cc28e13a4e0fe967', class: "toast-wrapper", "data-testid": DataTestIdsEnum.transactionToastContent }, h("button", { key: 'bd8e423edb879cc86184ea418515c65a8df162ae', onClick: this.handleDeleteToast.bind(this), type: "button", class: "icon-close", innerHTML: getIconHtmlFromIconDefinition(faTimes) }), h("div", { key: '2b2e299c55fc3ab9579f19949b8c7697767c823c', class: "toast-body", ref: container => this.initializeToast(container) })));
    }
    initializeToast(container) {
        if (!container || container.hasChildNodes()) {
            return;
        }
        const customElement = this.toast.instantiateToastElement();
        if (!customElement) {
            return;
        }
        container.appendChild(customElement);
    }
    static get is() { return "mvx-custom-toast"; }
    static get originalStyleUrls() {
        return {
            "$": ["custom-toast.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["custom-toast.css"]
        };
    }
    static get properties() {
        return {
            "toast": {
                "type": "unknown",
                "attribute": "toast",
                "mutable": false,
                "complexType": {
                    "original": "IComponentToast",
                    "resolved": "IComponentToast",
                    "references": {
                        "IComponentToast": {
                            "location": "import",
                            "path": "components/functional/toasts-list/components/transaction-toast/transaction-toast.type",
                            "id": "src/components/functional/toasts-list/components/transaction-toast/transaction-toast.type.ts::IComponentToast"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            }
        };
    }
    static get events() {
        return [{
                "method": "deleteToast",
                "name": "deleteToast",
                "bubbles": false,
                "cancelable": true,
                "composed": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=custom-toast.js.map
