"use strict";var e=Object.defineProperty,o=Object.defineProperties,t=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(o,t,i)=>t in o?e(o,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[t]=i,n=require("../../../../../../common/vendor.js"),d=require("../../../../../../store/index.js"),l=require("../../../../../../common/assets.js");require("../../../../../../store/modules.js"),require("../../../../../../store/modules/timStore.js");const p=n.defineComponent({components:{Face:()=>"./message/face.js",AudioMessage:()=>"./message/audio.js"},props:{text:{type:String,default:()=>""},conversationData:{type:Object,default:()=>""}},setup(e){const l=n.index.$TUIKit.TUIChatServer,p=n.reactive({imType:n.computed$1((()=>d.store.state.timStore.imType)),orderType:n.computed$1((()=>d.store.state.timStore.orderType)),firstSendMessage:!0,inputText:"",extensionArea:!1,sendMessageBtn:!1,displayFlag:"",isAudio:!1,displayServiceEvaluation:!1,displayCommonWords:!1,displayOrderList:!1,conversation:n.computed$1((()=>d.store.state.timStore.conversation))});n.watchEffect((()=>{p.inputText=e.text}));return m=((e,o)=>{for(var t in o||(o={}))s.call(o,t)&&a(e,t,o[t]);if(i)for(var t of i(o))r.call(o,t)&&a(e,t,o[t]);return e})({},n.toRefs(p)),o(m,t({handleExtensions:e=>{p.displayFlag="extension"===p.displayFlag?"":"extension"},handleSendImageMessage:e=>{n.index.chooseImage({sourceType:[e],count:1,success:e=>{n.index.getImageInfo({src:e.tempFilePaths[0],success(o){console.error(o),setTimeout((function(){l.sendImageMessage(e,o)}),500)}})}})},handleSendTextMessage:e=>{p.inputText.trimEnd()&&n.index.$TUIKit.TUIChatServer.sendTextMessage(JSON.parse(JSON.stringify(p.inputText))),p.inputText=" "},handleSendVideoMessage:e=>{n.index.chooseVideo({sourceType:[e],maxDuration:60,camera:"back",success:e=>{e&&setTimeout((function(){l.sendVideoMessage(e)}),500)}})},handleEmoji:()=>{p.displayFlag="emoji"===p.displayFlag?"":"emoji"},handleSend:e=>{p.inputText+=e.name},handleSwitchAudio:()=>{p.isAudio=!p.isAudio},handleCalling:e=>{if("GROUP"===p.conversation.type)return void n.index.showToast({title:"群聊暂不支持",icon:"none"});const{userID:o}=p.conversation.userProfile;void 0!==n.index.$TUICallKit&&null!==n.index.$TUICallKit.value?(console.log(n.index.$TUICallKit),n.index.$TUICallKit.value.call({userID:o,type:e})):(console.error("请集成 TUICallKit 插件哦～，请参考官网文档：https://cloud.tencent.com/document/product/269/83858"),n.index.showToast({title:"请集成 TUICallKit 插件哦 ～ ",icon:"none",duration:3e3}))},handleOrder:e=>{n.index.navigateTo({url:"/pages_order/inquiryOrderDetails?orderId="+d.store.state.timStore.orderId})},handleFollow:e=>{n.index.navigateTo({url:"/pages_user/followDetails?followId="+d.store.state.timStore.followId})},handleStoreOrder:e=>{n.index.navigateTo({url:"/pages_order/storeOrderDetail?orderId="+d.store.state.timStore.orderId})}}));var m}});if(!Array){(n.resolveComponent("AudioMessage")+n.resolveComponent("Face"))()}var m=n._export_sfc(p,[["render",function(e,o,t,i,s,r){return n.e({a:n.o(((...o)=>e.handleSwitchAudio&&e.handleSwitchAudio(...o))),b:l._imports_0$6,c:!e.isAudio},e.isAudio?{}:{d:n.o(((...o)=>e.handleSendTextMessage&&e.handleSendTextMessage(...o))),e:e.inputText,f:n.o((o=>e.inputText=o.detail.value))},{g:n.o(((...o)=>e.handleEmoji&&e.handleEmoji(...o))),h:l._imports_1$2,i:l._imports_2$1,j:n.o(((...o)=>e.handleExtensions&&e.handleExtensions(...o))),k:"emoji"===e.displayFlag},"emoji"===e.displayFlag?{l:n.o(e.handleSend),m:n.o(e.handleSendTextMessage),n:n.p({show:"emoji"===e.displayFlag})}:{},{o:"extension"===e.displayFlag},"extension"===e.displayFlag?n.e({p:l._imports_3,q:n.o((o=>e.handleSendImageMessage("camera"))),r:l._imports_4,s:n.o((o=>e.handleSendImageMessage("album"))),t:l._imports_5,v:n.o((o=>e.handleSendVideoMessage("album"))),w:l._imports_3,x:n.o((o=>e.handleSendVideoMessage("camera"))),y:1==e.imType&&2==e.orderType||2==e.imType},1==e.imType&&2==e.orderType||2==e.imType?{z:l._imports_6,A:n.o((o=>e.handleCalling(1)))}:{},{B:1==e.imType&&2==e.orderType||2==e.imType},1==e.imType&&2==e.orderType||2==e.imType?{C:l._imports_5,D:n.o((o=>e.handleCalling(2)))}:{},{E:1==e.imType},1==e.imType?{F:l._imports_7,G:n.o((o=>e.handleOrder()))}:{},{H:2==e.imType},2==e.imType?{I:l._imports_7,J:n.o((o=>e.handleFollow()))}:{},{K:2==e.imType},2==e.imType?{L:l._imports_7,M:n.o((o=>e.handleStoreOrder()))}:{}):{})}],["__scopeId","data-v-3218d8f7"]]);wx.createComponent(m);
