import{j as e}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0286.js";import{a as t}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0282.js";import{u,A as x}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0285.js";import{a as c}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02831.js";import{o as g}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02865.js";import{a as f,b as h,a3 as b,a4 as j,a5 as v,a6 as N}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0288.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0284.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0283.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02855.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b028.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02821.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02820.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02857.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0287.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02838.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0289.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02810.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02833.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02856.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02858.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02861.js";function X({notificacao:r}){const l=u(s=>s.language),o=c(s=>s.setViews),[a,m]=t.useState("");t.useEffect(()=>{let s=!0;return r.url_img&&x(r.url_img).then(p=>{s&&m(p)}),()=>{s=!1}},[r.url_img]);const i=()=>{r.redirect==="EXTERNAL"?window.open(r.link,"_blank"):(o("modal",r.id),g(r.whatsapp,r.menssage))},n=()=>{const s="h-6 w-6 text-[var(--primaria)]";switch(r.type){case"ALERT":return e.jsx(N,{className:s});case"PROMOTION":return e.jsx(v,{className:s});default:return e.jsx(j,{className:s})}},d=t.useMemo(()=>r.statement.replace(/_(.*?)_/g,'<span class="italic text-gray-800 font-medium">$1</span>').replace(/\*(.*?)\*/g,'<strong class="text-gray-900 font-bold">$1</strong>').replace(/\n/g,"<br>"),[r.statement]);return e.jsxs("div",{className:"w-full max-w-lg flex flex-col max-h-[90vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 px-6 py-5 border-b border-gray-100",children:[e.jsx("div",{className:"p-2.5 rounded-full flex-shrink-0 border",style:{backgroundColor:"color-mix(in srgb, var(--primaria), transparent 90%)",borderColor:"color-mix(in srgb, var(--primaria), transparent 70%)"},children:n()}),e.jsx("div",{className:"flex-1 min-w-0 pr-8",children:e.jsx(f,{className:"text-left text-lg font-semibold text-gray-800 truncate",children:r.title})})]}),e.jsxs("div",{className:"overflow-y-auto custom-scrollbar p-6 space-y-5",children:[a&&e.jsx("div",{className:"relative w-full aspect-video rounded-lg overflow-hidden shadow-sm border border-gray-100",children:e.jsx("img",{src:a,draggable:!1,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-700",alt:"Comunicado"})}),e.jsx(h,{children:e.jsx("div",{className:"text-gray-600 text-sm leading-relaxed text-justify space-y-2",dangerouslySetInnerHTML:{__html:d}})})]}),r.redirect!=="NONE"&&e.jsx("div",{className:"px-6 py-4 flex justify-end bg-gray-50/50",children:e.jsx("div",{className:"w-full sm:w-auto",children:e.jsx(b,{name:r.btnName||l.cliqueAqui,funcao:i})})})]})}export{X as default};
