import{j as r,A as d,m as f}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f775.js";import{r as s}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77.js";import{a as u}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7722.js";import{u as x}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f774.js";import{o as g}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7767.js";import{u as b}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7747.js";import{I as i,A as y,X as h,j as N,T as v}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f776.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f778.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7723.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f773.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f772.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f777.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f779.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7710.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7720.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7746.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7748.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7711.js";function q(){const l=x(e=>e.language),{inbox:o,setViews:n}=u(b(e=>({inbox:e.inbox.active,setViews:e.setViews})));if(!o)return null;const t=s.useMemo(()=>{let e="var(--primaria)",a=i;switch(o.type){case"ALERT":e="var(--primaria)",a=v;break;case"PROMOTION":e="var(--secundaria)",a=N;break;default:e="var(--primaria)",a=i;break}return{Icon:a,color:e,style:{backgroundColor:`color-mix(in srgb, ${e}, transparent 90%)`,borderColor:`color-mix(in srgb, ${e}, transparent 80%)`,color:`color-mix(in srgb, ${e}, black 40%)`},buttonStyle:{backgroundColor:e,color:"#ffffff",borderColor:e}}},[o.type]),c=s.useMemo(()=>o.statement.replace(/_(.*?)_/g,'<span class="italic font-medium opacity-90">$1</span>').replace(/\*(.*?)\*/g,'<strong class="font-bold opacity-100">$1</strong>').replace(/\n/g,"<br>"),[o.statement]),m=()=>{o.redirect==="EXTERNAL"?window.open(o.link,"_blank"):g(o.whatsapp,o.menssage)},p=e=>{e.stopPropagation(),n("inbox",o.id)};return r.jsx("div",{className:"bg-gray-200 dark:bg-neutral-800 w-full py-2 px-3",children:r.jsx(d,{mode:"wait",children:r.jsx(f.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3,type:"spring",stiffness:200},className:"relative w-full border flex flex-col overflow-hidden",children:r.jsxs("div",{className:"flex p-3 gap-3 items-start",children:[r.jsx("div",{className:"flex-shrink-0 pt-0.5",children:r.jsx(t.Icon,{size:20,style:{color:t.color},className:"animate-pulse"})}),r.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-w-0",children:[r.jsx("div",{className:"text-sm leading-snug",dangerouslySetInnerHTML:{__html:c}}),o.redirect!=="NONE"&&r.jsxs("button",{onClick:m,className:"self-start text-xs font-semibold px-3 py-1.5 rounded-md border flex items-center gap-1 mt-1 cursor-pointer transition-all hover:scale-105 active:scale-95",style:t.buttonStyle,children:[o.btnName||l.cliqueAqui,r.jsx(y,{size:12})]})]}),r.jsx("button",{onClick:p,className:"flex-shrink-0 -mt-1 -mr-1 p-1.5 opacity-50 hover:opacity-100 transition-opacity cursor-pointer",style:{color:t.color},children:r.jsx(h,{size:16})})]})},o.id)})})}export{q as default};
