import{n as c,q as d}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf23.js";import{u}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf19.js";import{I as r,j as a,_ as g}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf10.js";import{d as E}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf154.js";import{V as f}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf18.js";import{a as i}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf4.js";async function b(t){const{user:s}=c.getState(),{label:n}=d.getState(),e=u.getState().language;if(t.length===0)return r({type:"Error",message:e.nenhumCtsSelecionado,position:"top-right"});const p=s.estado?t:t.slice(0,5);s.estado||r({type:"Info",message:e.limite_de_5,position:"top-right"});const l={contacts:p.filter(o=>!o.id.includes("@lid")).map(o=>({id:o.id.replace("@c.us","").replace("@g.us",""),name:o.name})),labelName:n.name};try{const o=await fetch(`${f.backend_utils}api/XLSX/envioEmMassa`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!o.ok)throw new Error("Erro ao enviar dados para o servidor");const m=await o.json();E(m.XLSXbase64,`${n.name}_EnvioEmMassa.xlsx`)}catch(o){console.error("Erro ao enviar dados para o servidor:",o),r({type:"Error",message:e.erroEnvio,position:"top-right"})}}const h=i.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf200.js")),[]));function j({list:t}){return a.jsx(i.Suspense,{fallback:a.jsx(a.Fragment,{}),children:a.jsx(h,{list:t})})}export{b as E,j as I};
