import{k as m,l as g,i as _,o as l,w as f,b as t,a as i,e as v,c,t as p,F as b,g as h,u as r,v as k}from"./app-B4kV47qU.js";import x from"./TemplatePreview-BCVClSSu.js";import{_ as M}from"./Modal-ChMy0A7y.js";import{_ as w}from"./SpinnerBtn-B3fjBeDL.js";import{u as S}from"./chatStore-CTtmOQOw.js";import{u as T}from"./modalStore-BgORG3Nn.js";import"./toastComposable-CvcyPmJb.js";import"./echoServiceComposable-n1MnmRL6.js";const y={class:"flex w-full flex-col items-center gap-y-6"},B={class:"whatsapp-chat-body relative mt-3 h-[33rem] w-80 rounded-xl border-2 border-dark-400 bg-cover outline outline-4 outline-dark-500 dark:border-dark-800 dark:outline-dark-950"},C={class:"absolute bottom-3 left-4 w-10/12 rounded-lg bg-white p-1 px-2 dark:bg-dark-700 xl:w-8/12"},V={class:"flex w-full items-center gap-2 rounded-lg"},$={value:""},D=["value"],q={__name:"TemplateMessageModal",setup(F){T();const e=S(),s=m(""),d=g(()=>e.chatTemplates.find(o=>o.id==s.value)??{}),u=()=>{e.inputMessage.type="template",e.inputMessage.template=d.value,e.submitMessage()};return(o,n)=>(l(),_(M,{"header-state":!0,"header-title":"Send Template",state:"TemplateMessageModal",modalSize:"w-xxl"},{default:f(()=>[t("div",y,[t("div",B,[t("div",C,[i(x,{template:d.value},null,8,["template"])])]),t("div",V,[v(t("select",{"onUpdate:modelValue":n[0]||(n[0]=a=>s.value=a),class:"select"},[t("option",$,p(o.trans("Choose Template")),1),(l(!0),c(b,null,h(r(e).getActiveModuleTemplates,a=>(l(),c("option",{key:a.id,value:a.id},p(a.name),9,D))),128))],512),[[k,s.value]]),i(w,{onClick:u,type:"button",disabled:!s.value,processing:r(e).loading.sendingMessage,"btn-text":r(e).loading.sendingMessage?"Sending...":"Send",icon:"bx:send"},null,8,["disabled","processing","btn-text"])])])]),_:1}))}};export{q as default};
