import { h, Fragment } from "@stencil/core";
import { guid } from "../../utils";
const featuredIcons = {
    'error': 'hgi-stroke hgi-alert-02',
    'warning': 'hgi-stroke hgi-alert-circle',
    'success': 'hgi-stroke hgi-sharp hgi-checkmark-circle-02',
    'info': 'hgi-stroke hgi-sharp hgi-information-circle',
    'neutral': 'hgi-stroke hgi-sharp hgi-information-circle',
};
export class DgaNotificationToast {
    constructor() {
        this.type = 'neutral'; // Default to "neutral" if not provided
        this.hasHelperText = false; // Default to false if not provided
        this.vPostion = 'top';
        this.hPostion = 'right';
        this.buttonsList = [];
        this.open = true;
    }
    render() {
        return (h("div", { key: '4093dd7ed42ad8cf85857430de0311d10f4e9f79', class: `notification-toast notification-toast--${this.type} dga-vpostion-${this.vPostion} hpostion-${this.hPostion} ${this.open ? "active" : ""}` }, h("div", { key: '9fc4cc9e19e0be24b0b94621a69a1203f2fab61a', class: `notification-toast__header ${this.hasHelperText ? '' : 'dga-flex-center-y'}` }, h("div", { key: 'e26bbd252f0289407b6386468945281f501052ee', class: `notification--${this.type} notification-toast__icon featured-icon featured-icon--circle featured-icon--md` }, h("i", { key: 'eb2665f424578643650a73d11cdf32b6f0d17cea', class: featuredIcons[this.type], style: { fontSize: "18px" } })), h("div", { key: '32ac1de47e3cb49c2fd673bfa80187282d2fc2be', class: "notification-toast__body" }, h("h4", { key: '78bae1fd9868c9ea40d9549379e2b2f30bd356e2', class: "notification-toast__title text-md-semibold" }, this.leadText), this.hasHelperText && this.helperText && h("p", { key: 'e8491e7b4de9818e342f25a553d897eb3c0f4857', class: "notification-toast__content text-sm-regular" }, this.helperText)), this.closeButton && (h("div", { key: 'd14a50b0ed2e5261d7c268ee732198311e876c47', class: "notification-toast__close-btn" }, h("button", { key: '807c713ab8a44eeb7ce44f093d05a510b6e5a8f4', class: "dga-btn dga-btn--close dga-btn--icon dga-btn--md", onClick: e => { var _a; return (_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this, e); } }, h("span", { key: '57a03c2ae943337743bcc4f3a45c05d6b03a7351', class: "dga-btn-icon" }, h("dga-icon-v2", { key: 'c96e9dde970b09c5bf95b9d3863546250fb68f5d', name: "multiplication-sign", variant: "stroke", type: "sharp", size: 20 })))))), this.action && (h(Fragment, { key: '108f2cded73d3a336e75580eb545837aea656fcd' }, h("div", { key: 'feee2ab11ea0df719cad36de498edc4e384f621b', class: "notification-toast__action" }, this.buttonsList.length > 0 &&
            this.buttonsList.map(({ id, onClick, extraClasses, title, customAttribute, label }) => (h("button", Object.assign({ key: id ? id : guid(), id: id ? id : guid(), onClick: e => onClick(e), class: `dga-btn dga-btn--subtle dga-btn--md ${extraClasses}` }, (title && { title: title }), (customAttribute &&
                customAttribute.key && {
                [customAttribute.key]: customAttribute.value ? customAttribute.value : '',
            })), label)))), h("div", { key: '00d5c4d46a6adcb867a7bcc03533f248cecab28a', class: "notification-toast__action-mobile" }, this.buttonsList.length > 0 &&
            this.buttonsList.map(({ id, onClick, extraClasses, title, customAttribute, label }) => (h("button", Object.assign({ key: id ? id : guid(), id: id ? id : guid(), onClick: e => onClick(e), class: `btn btn--secondary btn--lg ${extraClasses}` }, (title && { title: title }), (customAttribute &&
                customAttribute.key && {
                [customAttribute.key]: customAttribute.value ? customAttribute.value : '',
            })), label))))))));
    }
    static get is() { return "dga-notification-toast"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-notification-toast.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-notification-toast.css"]
        };
    }
    static get properties() {
        return {
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'error' | 'warning' | 'success' | 'info' | 'neutral'",
                    "resolved": "\"error\" | \"info\" | \"neutral\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'neutral'"
            },
            "leadText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "lead-text",
                "reflect": false
            },
            "hasHelperText": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "has-helper-text",
                "reflect": false,
                "defaultValue": "false"
            },
            "helperText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "helper-text",
                "reflect": false
            },
            "action": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "action",
                "reflect": false
            },
            "closeButton": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "close-button",
                "reflect": false
            },
            "vPostion": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'top' | 'bottom'",
                    "resolved": "\"bottom\" | \"top\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "v-postion",
                "reflect": false,
                "defaultValue": "'top'"
            },
            "hPostion": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'left' | 'right'",
                    "resolved": "\"left\" | \"right\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "h-postion",
                "reflect": false,
                "defaultValue": "'right'"
            },
            "onClose": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "(event: any) => void",
                    "resolved": "(event: any) => void",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "buttonsList": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "{\n    id?: string;\n    label: string;\n    onClick: (event?: any) => void;\n    extraClasses?: string;\n    title?: string;\n    customAttribute?: CustomAttribute;\n  }[]",
                    "resolved": "{ id?: string; label: string; onClick: (event?: any) => void; extraClasses?: string; title?: string; customAttribute?: CustomAttribute; }[]",
                    "references": {
                        "CustomAttribute": {
                            "location": "import",
                            "path": "../../shared",
                            "id": "src/shared/index.ts::CustomAttribute"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[]"
            },
            "open": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "open",
                "reflect": true,
                "defaultValue": "true"
            }
        };
    }
}
//# sourceMappingURL=dga-notification-toast.js.map
