import {
    r as l,
    j as s
} from "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a71.js";
import {
    u as n
} from "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7120.js";
import {
    r as p
} from "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7124.js";
import {
    V as x,
    X as o,
    Y as u,
    Z as g,
    Q as d,
    $ as h
} from "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7111.js";
import {
    a as c
} from "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7159.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a718.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7119.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a717.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a719.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a716.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a714.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a713.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a712.js";
import "./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7110.js";

function C({
    notificacao: e
}) {
    const a = n(t => t.language),
        m = p(t => t.setNotificacoes_ModalVisible),
        [r, i] = l.useState("");
    return l.useEffect(() => {
        (async () => {
            if (e.url_img && e.url_img.length !== 0) {
                const t = await x(e.url_img);
                i(t)
            }
            e.external_url && e.external_url.length !== 0 && (m(e.id), chrome.runtime.sendMessage({
                message: "promotional",
                path: e.external_url
            }))
        })()
    }, []), s.jsxs("div", {
        className: "min-w-[450px] max-w-[600px] max-h-[99vh] overflow-y-auto text-center grid gap-4 py-1",
        children: [s.jsxs("div", {
            className: "flex justify-start",
            children: [s.jsxs("div", {
                children: [e.type === "INFO" && s.jsx(o, {
                    className: "h-8 w-8 text-blue-500"
                }), e.type === "ALERT" && s.jsx(u, {
                    className: "h-8 w-8 text-red-500"
                }), e.type === "PROMOTION" && s.jsx(g, {
                    className: "h-8 w-8 text-yellow-500"
                })]
            }), s.jsx("div", {
                className: "m-auto max-w-[540px] w-full",
                children: s.jsx(d, {
                    className: "px-4",
                    children: e.title
                })
            })]
        }), r.length !== 0 && s.jsx("img", {
            className: "h-[256px] w-[588px]",
            draggable: !1,
            src: r,
            alt: "promotional_picture"
        }), s.jsx(h, {
            children: s.jsx("p", {
                className: "text-justify pr-3",
                dangerouslySetInnerHTML: {
                    __html: e.statement.replace(/\_(.*?)\_/g, '<strong class="italic">$1</strong>').replace(/\*(.*?)\*/g, "<strong>$1</strong>").replace(/\n/g, "<br>")
                }
            })
        }), e.link && s.jsx("div", {
            children: s.jsxs("a", {
                className: "link flex gap-1 items-center text-[var(--primaria)]",
                href: e.link,
                target: "_blank",
                children: [s.jsx(c, {
                    strokeWidth: 3,
                    className: "h-5 w-5 text-[var(--primaria)] pulse"
                }), e.btnName.length !== 0 ? e.btnName : a.cliqueAqui]
            })
        })]
    })
}
export {
    C as
    default
};