import{j as e,a2 as o,P as m,r as c}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080910.js";import{aO as d,aP as x}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080923.js";import{u as p}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080919.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080918.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508098.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508094.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b2250809.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508095.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508097.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508096.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508092.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508093.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508099.js";const P=({userId:i})=>{const s=d(a=>a.workflows),r=p(a=>a.language),n=a=>{try{const l={id:{id:c(),fromMe:!1,remote:m(i).toString()},type:"chat",body:"Mensagem de teste",t:Math.floor(Date.now()/1e3),isNewMsg:!0};x({msg:l,manualActivation:{workflow:a}})}catch(t){console.error("Erro ao iniciar o fluxo:",t)}};return e.jsx("div",{className:"flex flex-col gap-2 p-4 max-h-[calc(60vh-4rem)] overflow-y-auto min-w-[200px]",children:s.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx(o,{size:25,className:"text-4xl text-gray-400"}),e.jsx("p",{className:"text-md text-center",children:r.nenhumFluxoCadastrado}),e.jsx("button",{onClick:()=>chrome.runtime.sendMessage({message:"FLOW"}),className:"px-4 py-2 bg-[var(--primaria)] text-[var(--letra)] rounded-lg transition-transform duration-200 ease-in hover:scale-[1.02]",children:r.abrirPainelDeFluxos})]}):e.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:r.iniciarFluxo}),e.jsx("p",{className:"text-sm",children:r.escolhaUmFluxoParaIniciar})]}),s.map(a=>e.jsxs("div",{className:`p-2 border border-solid border-[var(--conversation-header-border)] 
              rounded-lg hover:scale-[1.02] transition-transform duration-200 ease-in-out flex items-center justify-between`,children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx(o,{className:"text-xl text-[var(--primaria)]"}),e.jsx("span",{className:"font-medium truncate",style:{maxWidth:"75%"},children:a.name})]}),e.jsx("button",{onClick:()=>n(a),className:"px-3 py-1 bg-[var(--primaria)] text-[var(--letra)] rounded hover:opacity-90 transition-opacity",children:r.iniciar})]},a.id))]})})};export{P as default};
