import{_ as x}from"./Paginate-DtQjslkz.js";import{_ as v}from"./NoDataFound-su6Kbmdk.js";import{s as $}from"./sharedComposable-VJJUONp6.js";import{_ as C}from"./UserLayout-DG2qUs8x.js";import{_ as j}from"./NotificationRing-CraudT8E.js";import{r as d,c as n,o as a,a as i,b as s,i as B,t,F as p,g as N,j as h,u as g,w as T}from"./app-B4kV47qU.js";import"./toastComposable-CvcyPmJb.js";import"./Modal-ChMy0A7y.js";import"./modalStore-BgORG3Nn.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ToastrContainer-Cfx6wOd2.js";import"./AssetModal-vtiWQmiY.js";import"./IntersectionObserver-DbdokySM.js";import"./assetStore-cDK0Afhq.js";import"./echoServiceComposable-n1MnmRL6.js";const y={class:"table-responsive w-full"},D={class:"table"},E={class:"!text-right"},I={class:"!text-right"},L={key:0,class:"tbody"},V={key:0,class:"badge badge-success capitalize"},z={key:1,class:"badge badge-info capitalize"},F={key:2,class:"badge badge-primary"},H=["href"],M={key:1},P={class:"!text-right"},S={key:0,class:"badge badge-success"},A={key:1,class:"badge badge-warning"},K={class:"flex justify-end"},O={class:"dropdown","data-placement":"bottom-start"},q={class:"dropdown-toggle"},G={class:"dropdown-content w-56"},J={class:"dropdown-list"},Q={class:"dropdown-list-item"},U={class:"dropdown-list-item"},W=["onClick"],ps=Object.assign({layout:C},{__name:"Index",props:["autoReplies"],setup(l){const{deleteRow:b,textExcerpt:u}=$();return(o,X)=>{const f=d("PageHeader"),r=d("Icon"),k=d("Link");return a(),n(p,null,[i(f),i(j,{module:"whatsapp-web"}),s("div",y,[s("table",D,[s("thead",null,[s("tr",null,[s("th",null,t(o.trans("Device Name")),1),s("th",null,t(o.trans("Keywords")),1),s("th",null,t(o.trans("Message Type")),1),s("th",null,t(o.trans("Message Template")),1),s("th",E,t(o.trans("Status")),1),s("th",I,t(o.trans("Action")),1)])]),l.autoReplies.data.length?(a(),n("tbody",L,[(a(!0),n(p,null,N(l.autoReplies.data,(e,w)=>{var c,_,m;return a(),n("tr",{key:w},[s("td",null,t((c=e.platform)==null?void 0:c.name),1),s("td",null,t(e.keywords.join(", ")),1),s("td",null,[e.message_type=="text"?(a(),n("span",V,t(e.message_type),1)):e.message_type=="template"?(a(),n("span",z,t(e.message_type),1)):(a(),n("span",F,t(e.message_type),1))]),s("td",null,[e.message_type=="template"?(a(),n("a",{key:0,class:"flex items-center gap-1 font-bold text-blue-600 hover:underline",target:"_blank",href:`/user/whatsapp-web/templates/${(_=e==null?void 0:e.template)==null?void 0:_.id}`},[h(t((m=e==null?void 0:e.template)==null?void 0:m.name)+" ",1),i(r,{icon:"bx:link-external"})],8,H)):(a(),n("span",M,t(g(u)(e.message_template,50)),1))]),s("td",P,[e.status=="active"?(a(),n("span",S,t(e.status),1)):(a(),n("span",A,t(e.status),1))]),s("td",null,[s("div",K,[s("div",O,[s("div",q,[i(r,{class:"h-5 text-3xl text-slate-400",icon:"bx:dots-vertical-rounded"})]),s("div",G,[s("ul",J,[s("li",Q,[i(k,{class:"dropdown-link",href:o.route("user.whatsapp-web.auto-replies.edit",e.id)},{default:T(()=>[i(r,{icon:"bx:bxs-edit-alt"}),s("span",null,t(o.trans("Edit")),1)]),_:2},1032,["href"])]),s("li",U,[s("button",{class:"dropdown-link delete-confirm",onClick:Y=>g(b)(o.route("user.whatsapp-web.auto-replies.destroy",e.id))},[i(r,{icon:"bx:trash"}),h(" "+t(o.trans("Delete")),1)],8,W)])])])])])])])}),128))])):(a(),B(v,{key:1,forTable:!0}))]),i(x,{links:l.autoReplies.links},null,8,["links"])])],64)}}});export{ps as default};
