import{j as e}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d15.js";import{ag as E,af as b,n as z,m as Q,z as w,aW as M}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d123.js";import{u as N,a as S}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d189.js";import{u as D,r as I}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d14.js";import{A as O}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1179.js";import{E as L}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1157.js";import{ai as T,ao as $,ad as c,C as q}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d17.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1.js";import{a as B}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1109.js";import{o as V}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d134.js";import{Q as W}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d16.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d13.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d19.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d110.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d12.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d18.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d120.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d133.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1191.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1192.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d112.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d111.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1121.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1125.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1105.js";import"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d146.js";const F="flex gap-1 cursor-pointer items-center h-9 py-2 rounded-lg hover:bg-[var(--dropdown-background-hover)] px-2";function ge({card:t}){const{deleteQuickReply:p,duplicateQuickReply:d}=E(),{edit:m,deleteActions:l,getAction:a,addActions:u}=b(),{setActiveCreateOrEdit:x}=N(),{setQuickReplyAll:f}=S(),{language:s}=D(),{close:o}=z(),{open:n}=Q(),R=w(i=>i.activeChat),{setAcao:g}=M(),y=!!document.querySelector('[data-id="eem-old"], [data-id="eem-new"]'),j=()=>{o();let i="respostaRapida";t.type==="script"?i="script":m(t.id),f(t),x({type:"edit",model:i})},A=()=>{o(),q({icon:e.jsx(c,{type:t.type,style:"w-6 h-6 text-[var(--primaria)]"}),confirmText:s.confirm,content:`${s.deleteQuickReplay} ${t.titulo}?`,submit:()=>{l(t.id),p(t.id)}})},h=i=>{o();const r=I();d(i,r);const k=a(i);u({acao:k,id:r})},v=()=>{o(),g(a(t.id)),n(e.jsx(L,{card:t}))},C=[{id:5,name:"Duplicar Resposta rapida",action:()=>h(t.id),icon:e.jsx(W,{size:18})},{id:1,name:s.editar,action:()=>j(),icon:e.jsx(T,{size:18})},{id:2,name:s.createAgendamento,action:()=>{o(),n(e.jsx(O,{create:!0,tipo:"agendamento",userId:R.id.user,name:"",resID:t.id}))},icon:e.jsx($,{size:18})},{id:3,name:s.editAndSend,action:()=>v(),icon:e.jsx(V,{size:20}),disabled:y},{id:4,name:s.Deletar,action:()=>A(),icon:e.jsx(B,{size:18})}];return e.jsxs("div",{className:"px-2 min-w-60",children:[e.jsxs("div",{className:"flex gap-2 items-center mb-2",children:[e.jsx("div",{children:e.jsx(c,{type:t.type,style:"w-5 h-5 text-[var(--icon)]"})}),e.jsx("div",{className:"truncate max-w-40 font-bold text-lg first-letter:uppercase",children:t.titulo})]}),e.jsx("hr",{}),e.jsx("div",{className:"flex flex-col gap-1 mt-[2px]",children:C.map(i=>!i.disabled&&(t.type!=="script"||t.type==="script"&&i.id!==3)&&e.jsxs("div",{className:F,onClick:i.action,children:[e.jsx("span",{className:"text-[var(--icon)]",children:i.icon}),e.jsx("span",{children:i.name})]},i.id))})]})}export{ge as default};
