import{j as e,_ as r,aa as A,T as E,an as T,aE as C,ao as M,z as I,I as b}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec510.js";import{a as t}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec54.js";import{u as L}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec563.js";import{u as P,b as w}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec519.js";import{aw as F,b as k,y as v,o as R,p as O,ax as S,ar as U}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec523.js";import{W as p}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec518.js";import{b as D}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec560.js";import{e as V}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec541.js";const B=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec5138.js")),[]));function W(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(B,{})})}const N=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec5139.js")),[]));function q(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(N,{})})}const H=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec5140.js")),[]));function G({setUserLabels:s,userLabels:m}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(H,{setUserLabels:s,userLabels:m})})}const J=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec5141.js")),[]));function K(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(J,{})})}const Q=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec5142.js")),[]));function X({userId:s}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(Q,{userId:s})})}const Y=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec5143.js")),[]));function Z({userId:s}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(Y,{userId:s})})}function ce(){const{language:s}=P(L(a=>({language:a.language}))),{pinChat:m,isPin:f}=F(L(a=>({pinChat:a.pinChat,isPin:a.isPin}))),g=k(a=>a.getUserAbasTam),x=w(a=>a.isBusiness),o=v(a=>{var n,c;return(c=(n=a.activeChat)==null?void 0:n.id)==null?void 0:c.user}),z=R(a=>a.open),i=O(a=>a.open),h=async()=>{await U("clear_message")!==!0&&(await p.Msg("showClearMsg")?b({type:"Success",message:s.asMensagensApagasForamRecuperadas,position:"top-right"}):b({type:"Error",message:s.nenhumaMensagemApagadaFoiRecuperada,position:"top-right"}))},[l,_]=t.useState(null);return t.useEffect(()=>{x&&(async()=>{try{const n=await p.Labels("getAllLabels"),c=await p.Utils("getContato",o);if(c==="undefined")return;const y=c.labels.map(d=>n.find(u=>u.hexColor&&u.id===d)).filter(Boolean).map(({id:d,name:u,hexColor:j})=>({id:d,name:u,color:j,hexColor:j}));_(y)}catch(n){console.error(s.erroAoBuscarLabels,n)}})()},[o]),[{id:"init_fluxo",name:s.iniciarUmFluxoParaEsteContato,icon:e.jsx(A,{size:20}),function:a=>i(e.jsx(Z,{userId:o}),{placement:"bottom"},a.target,15)},{id:"fixar_chat",name:f()?s.desafixarChat:s.fixarChat,icon:e.jsx(E,{className:f()?"!text-[var(--wds-teal-500)]":"",size:20}),function:()=>m()},{id:"show_clean_messages",name:s.exibirMensagensApagadasRecente,icon:e.jsx(S,{size:20,strokeWidth:"1.8"}),function:()=>h()},{id:"traducao_com_IA",name:s.traducaoComIA,icon:e.jsx(V,{size:20}),function:()=>z(e.jsx(W,{}))},{id:"user_tabs",name:s.userTabs,icon:e.jsx(T,{size:20}),tam:g(o),function:a=>i(e.jsx(q,{}),{placement:"bottom"},a.target,15)},{id:"labels",name:s.tags,icon:l&&l.length>0?e.jsx("div",{className:"flex",children:l.map((a,n)=>e.jsx("span",{style:n!==0?{marginLeft:"-1rem"}:null,children:e.jsx(C,{size:24,style:{color:a.color}})},n))}):e.jsx(M,{size:20}),tam:g(o),function:a=>i(e.jsx(G,{setUserLabels:_,userLabels:l}),{placement:"bottom"},a.target.parentNode.parentNode,15),disabled:!x},{id:"transferir_atendimento",name:s.transferirAtendimento,icon:e.jsx(I,{size:20}),function:a=>i(e.jsx(K,{}),{placement:"bottom"},a.target,15)},{id:"close_atendimento",name:s.fimAtendimento_encerrar,icon:e.jsx(D,{size:20}),function:a=>i(e.jsx(X,{userId:o}),{placement:"bottom"},a.target,15)}]}export{ce as R};
