"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const n=require("../../../../common/assets.js"),t=require("../../../utils/env.js"),o=require("../utils/sendMessage.js"),u=require("../config.js");Math||(i+l+a+s+r)();const l=()=>"./message-input-editor.js",a=()=>"./message-input-at/index.js",i=()=>"./message-input-audio.js",r=()=>"./message-input-quote/index.js",s=()=>"../../common/Icon.js",p=e.defineComponent({__name:"index",props:{placeholder:{default:"this is placeholder"},isMuted:{type:Boolean,default:!0},muteText:{default:""},enableInput:{type:Boolean,default:!0},enableAt:{type:Boolean,default:!0},enableTyping:{type:Boolean,default:!0},replyOrReference:{default:()=>({})},inputToolbarDisplayType:{default:"none"}},emits:["changeToolbarDisplayType"],setup(l,{expose:a,emit:i}){const r=i,s=l,p=e.ref(),d=e.ref(),f=e.ref(),c=e.ref(!1),v=e.ref("editor"),m=u.ChatConfig.getFeatureConfig(),g=e.ref(m.InputVoice);e.ref(m.InputEmoji||m.InputStickers);const y=e.ref(m.InputImage||m.InputVideo||m.InputEvaluation||m.InputQuickReplies);function T(e){v.value=e,"audio"===e&&r("changeToolbarDisplayType","none")}e.onMounted((()=>{e.Jt.watch(e.o.CONV,{currentConversation:I}),e.Jt.watch(e.o.CHAT,{quoteMessage:q})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.CONV,{currentConversation:I}),e.Jt.unwatch(e.o.CHAT,{quoteMessage:q})})),e.watch((()=>s.inputToolbarDisplayType),(e=>{"none"!==e&&T("editor")}));const b=(e,n)=>{o.sendTyping(e,n)},h=e=>{var n;null==(n=null==d?void 0:d.value)||n.toggleAtList(e)},j=()=>{t.isH5&&r("changeToolbarDisplayType","none")},C=e=>{var n,t;(null==(n=null==p?void 0:p.value)?void 0:n.insertAt)&&(null==(t=null==p?void 0:p.value)||t.insertAt(e))},A=()=>{var e,n;(null==(e=null==p?void 0:p.value)?void 0:e.blur)&&(null==(n=null==p?void 0:p.value)||n.blur())};function I(n){var t;f.value=n,c.value=(null==(t=f.value)?void 0:t.type)===e.qt.TYPES.CONV_GROUP}function q(e){(null==e?void 0:e.message)&&"quote"===(null==e?void 0:e.type)&&T("editor")}return a({insertEmoji:e=>{var n,t;(null==(n=null==p?void 0:p.value)?void 0:n.addEmoji)&&(null==(t=null==p?void 0:p.value)||t.addEmoji(e))},reEdit:e=>{var n,t;null==(n=null==p?void 0:p.value)||n.resetEditor(),null==(t=null==p?void 0:p.value)||t.setEditorContent(e)}}),(o,u)=>e.e({a:(e.unref(t.isWeChat)||e.unref(t.isApp))&&e.unref(g)},(e.unref(t.isWeChat)||e.unref(t.isApp))&&e.unref(g)?{b:"audio"===e.unref(v)?1:"",c:e.o$1(T),d:e.p({isEnableAudio:"audio"===e.unref(v)})}:{},{e:e.sr(p,"c73567e1-1",{k:"editor"}),f:"editor"===e.unref(v),g:e.o$1(b),h:e.o$1(h),i:e.o$1(j),j:e.p({placeholder:s.placeholder,isMuted:s.isMuted,muteText:s.muteText,enableInput:s.enableInput,enableAt:s.enableAt,enableTyping:s.enableTyping,isGroup:e.unref(c)}),k:s.enableAt},s.enableAt?{l:e.sr(d,"c73567e1-2",{k:"messageInputAtRef"}),m:e.o$1(C),n:e.o$1(A)}:{},{o:e.unref(y)},e.unref(y)?{p:e.o$1((e=>{r("changeToolbarDisplayType","tools")})),q:e.p({file:e.unref(n.moreIcon),size:"23px",hotAreaSize:"3px"})}:{},{r:e.p({displayType:e.unref(v)}),s:e.n(!e.unref(t.isPC)&&"message-input-h5")})}}),d=e._export_sfc(p,[["__scopeId","data-v-c73567e1"]]);wx.createComponent(d);
