import{I as x}from"./iconify-p99pbjf9.js";import{d as B,g as p,A as m,J as l,B as c,j as o,t as r,am as Q,H as v,_ as M,P as f,r as N,c as a}from"./index-DOFLUERq.js";import{E as D}from"./EmailComposeModal-gr8x42pd.js";import{_ as I}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./common-DEIQtiPI.js";import"./LinkField-CPzmuCgV.js";import"./Jeditor.vue_vue_type_style_index_0_lang-BtAK23jg.js";import"./image-resize-CYL53Ji9.js";const K={class:"toolbar"},z={class:"filters"},H={class:"view-toggle"},V=["title"],L=["title"],P=["disabled"],R=["disabled"],T=["disabled"],$=B({__name:"email_list_toolbar",props:{context:{},entity:{},searchQuery:{},viewMode:{},selectedKeys:{},loading:{type:Boolean},canEdit:{type:Boolean}},emits:["update:searchQuery","update:viewMode","reload","create","delete-selected"],setup(k,{emit:w}){const e=k,n=w,b=N(null),_=a(()=>e.context?.t??r),y=a({get:()=>e.context?.searchQuery??e.searchQuery??"",set:s=>n("update:searchQuery",s)}),i=a({get:()=>e.context?.viewMode??e.viewMode??"3col",set:s=>n("update:viewMode",s)}),g=a(()=>e.context?.selectedKeys??e.selectedKeys??[]),d=a(()=>e.context?.loading??e.loading??!1);function h(){e.context?.reload?e.context.reload():n("reload")}function C(){e.context?.handleDeleteSelected?e.context.handleDeleteSelected():n("delete-selected")}function E(){b.value?.open()}function S(s){h()}return(s,t)=>(p(),m("div",K,[l("div",z,[c(o(Q),{value:y.value,"onUpdate:value":t[0]||(t[0]=u=>y.value=u),placeholder:o(r)("Search"),clearable:"",style:{width:"200px"}},null,8,["value","placeholder"])]),l("div",H,[l("button",{class:v(["toggle-btn",{active:i.value==="2col"}]),onClick:t[1]||(t[1]=u=>i.value="2col"),title:_.value("List")},[c(o(x),{icon:"tabler:layout-list",size:16})],10,V),l("button",{class:v(["toggle-btn",{active:i.value==="3col"}]),onClick:t[2]||(t[2]=u=>i.value="3col"),title:_.value("Preview")},[c(o(x),{icon:"tabler:layout-columns",size:16})],10,L)]),l("button",{class:"refresh-btn",onClick:h,disabled:d.value},[l("i",{class:v(d.value?"fa fa-spinner fa-spin":"fa fa-refresh")},null,2)],8,P),g.value.length===0?(p(),m("button",{key:0,class:"create-btn email-compose-btn",onClick:E,disabled:d.value},[t[3]||(t[3]=l("i",{class:"fa fa-plus"},null,-1)),M(" "+f(o(r)("New Email")),1)],8,R)):(p(),m("button",{key:1,class:"delete-btn",onClick:C,disabled:d.value},[t[4]||(t[4]=l("i",{class:"fa fa-trash"},null,-1)),M(" "+f(o(r)("Delete Selected"))+" ("+f(g.value.length)+") ",1)],8,T)),c(D,{ref_key:"composeRef",ref:b,onSent:S},null,512)]))}}),W=I($,[["__scopeId","data-v-5d16eeb0"]]);export{W as default};
