chunk-3d1a5ed3.afecd624.js 45 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3d1a5ed3"],{"0aea":function(t,e,s){const{MusicBox:i,musicTexts:a}=s("6b7f");class n{constructor(t={}){const{src:e,loop:s,log:i,musicText:a,defaultMusic:n,ended:o}=t;this.id="",this.src=e,this.loop="undefined"===typeof s||s,this.log="undefined"===typeof i||i,this.active=!1,this.isPlaying=!1,this.container=null,this.audioObject=null,this.musicText=a||"",this.defaultMusic=n||"EZIOS_FAMILY",this.musicbox=null,this.ended=o||(()=>{}),this._createAudioId(),this._createAudioObject()}_createAudioId(){const t=parseInt(1e6*Math.random());this.id="easyRing"+t}_createAudioObject(){this.container=document.createElement("div"),this.audioObject=document.createElement("audio"),this.audioObject.id=this.id,this.audioObject.src=this.src,this.audioObject.addEventListener("ended",()=>{this._log(`pause the ring(id=${this.id})`),this.isPlaying=!1,this.ended()}),this.container.append(this.audioObject),this._log("CommonEasyRing mounted")}_openRing(){this._log(`open the ring(id=${this.id})`),this.active=!0,this.audioObject.loop=!1,this.audioObject.pause(),this.musicbox=new i({loop:this.loop,endedCallback:this.loop?()=>{}:()=>{this.isPlaying=!1}})}_stopRing(){this._log(`close the ring(id=${this.id})`),this.active=!1,this.src&&this.audioObject?(this.audioObject.pause(),this.audioObject.currentTime=0):this.musicbox&&this.musicbox.stopMusic()}_play(){this._log(`play the ring(id=${this.id})`),!this.audioObject.loop&&this.loop&&(this.audioObject.loop=!0),this.active&&!this.isPlaying&&(this.isPlaying=!0,this.src?(this.audioObject.currentTime=0,this.audioObject.play()):this.musicText?this.musicbox.playMusic(this.musicText):a[this.defaultMusic]?this.musicbox.playMusic(a[this.defaultMusic]):this._log(`💔invalid type of defaultMusicText in ths ring(id=${this.id}).`))}_pause(){this._log(`pause the ring(id=${this.id})`),this.isPlaying=!1,this.src&&this.audioObject?(this.audioObject.pause(),this.audioObject.currentTime=0):this.musicbox&&this.musicbox.stopMusic()}_log(t){t&&this.log&&console.log("🌟【EASY-RING LOG】:"+t)}open(){this._openRing()}close(){this._stopRing()}ring(){this._play()}stop(){this._pause()}}t.exports=n},"0e73":function(t,e,s){},1332:function(t,e,s){},"171c":function(t,e,s){"use strict";s("1332")},"1a8f":function(t,e,s){"use strict";s("1bc6")},"1bc6":function(t,e,s){},2222:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"window-contain"},[e("div",{staticClass:"window"},[e("header",{staticClass:"window-header"},[e("the-window-header",{attrs:{isStatus:t.isStatus,open:t.open},on:{handleNotice:t.handlenotice}})],1),e("section",{staticClass:"window-content"},[e("aside",{staticClass:"window-aside--left"},[e("the-window-aside-left",{ref:"user",attrs:{current:t.sessionID},on:{change:t.changeSession}})],1),e("main",{staticClass:"window-main"},[e("the-window-main",{ref:"chat",attrs:{"to-id":t.sessionID,"from-id":t.userInfo.id}})],1),e("aside",{staticClass:"window-aside--right"},[e("the-window-aside-right",{attrs:{"to-id":t.sessionID}})],1)])]),e("easy-ring",{ref:"ring",attrs:{log:"",open:t.open,ring:t.ring,loop:!1,src:t.notice},on:{"update:ring":function(e){t.ring=e}}}),e("el-dialog",{attrs:{width:"20%",visible:t.showDialog,"show-close":!1}},[t._v(" 是否允许开启音效 "),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.showDialog=!1}}},[t._v("拒 绝")]),e("el-button",{attrs:{type:"primary"},on:{click:t.handlevisible}},[t._v("同 意")])],1)])],1)},a=[],n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"window__header"},[e("div",{staticClass:"window-title"},[t._v("客服工作台")]),e("div",{staticClass:"window-widget"},[e("div",{staticClass:"widget-item m-r-20"},[e("div",{staticClass:"notice"},[t.open?e("img",{staticClass:"image",attrs:{src:s("5108"),title:"开启声音"},on:{click:t.handleclick}}):e("img",{staticClass:"image",attrs:{src:s("6702"),title:"关闭声音"},on:{click:t.handleclick}})]),e("span",{staticClass:"m-r-6"},[t._v(t._s(t.userInfo.nickname))]),e("el-popover",{staticClass:"line-status",attrs:{placement:"right",title:"",width:"60",trigger:"manual","popper-class":"on-line"},model:{value:t.isTC,callback:function(e){t.isTC=e},expression:"isTC"}},[e("div",{},[e("div",{staticClass:"flex text-center",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.onLine(!0)}}},[e("span",{staticClass:"m-r-10",staticStyle:{display:"block",content:"' '","border-radius":"50%",height:"10px",width:"10px","background-color":"#00c24c"}}),t._v(" 在线 ")]),e("div",{staticClass:"flex text-center",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.offLine(!1)}}},[e("span",{staticClass:"m-r-10",staticStyle:{display:"block",content:"' '","border-radius":"50%",height:"10px",width:"10px","background-color":"#c5c5c5"}}),t._v(" 离线 ")])]),e("div",{staticStyle:{position:"relative"},attrs:{slot:"reference"},on:{click:function(e){t.isTC=!t.isTC}},slot:"reference"},[e("el-avatar",{attrs:{icon:"el-icon-user",src:t.userInfo.avatar}}),0==t.status?e("div",{staticStyle:{position:"absolute",top:"30px",left:"30px",height:"10px",width:"10px","border-radius":"50%","background-color":"#c5c5c5"}}):e("div",{staticStyle:{position:"absolute",top:"30px",left:"30px",height:"10px",width:"10px","border-radius":"50%","background-color":"#00c24c"}})],1)])],1),e("el-popconfirm",{attrs:{title:"确定退出吗?"},on:{confirm:t.handleLogout}},[e("div",{staticClass:"widget-item",attrs:{slot:"reference"},slot:"reference"},[e("i",{staticClass:"el-icon-right"}),e("span",{staticClass:"m-l-6"},[t._v("退出")])])])],1)])},o=[],r=(s("14d9"),s("2f62")),l={name:"TheWindowHeader",inject:["closeChatServe","reChatServe","reload"],props:{isStatus:Boolean,open:{type:Boolean,default:!1}},emits:["handleNotice"],data(){return{status:!1,isTC:!1,notice:!1}},watch:{isStatus(t){this.status=t}},computed:{...Object(r["c"])(["userInfo"])},methods:{handleclick(){this.$emit("handleNotice")},...Object(r["b"])(["logout"]),handleLogout(){const t={};0!=this.userInfo.shop_id&&(t.type=1),this.logout().then(e=>{this.$router.push({path:"/login",query:t})})},onLine(t){!this.status&&t&&(console.log("reChatServe"),this.reChatServe()),this.status=t,this.isTC=!1},offLine(t){this.status&&this.closeChatServe(),this.status=t,this.isTC=!1,console.log(t)}}},c=l,u=(s("70e6"),s("2877")),d=Object(u["a"])(c,n,o,!1,null,"90f56d30",null),h=d.exports,p=function(){var t=this,e=t._self._c;return e("div",{staticClass:"window__main"},[e("overlay-scrollbars",{ref:"scrollbar",staticClass:"history-contain",attrs:{options:{scrollbars:{autoHide:"scroll"},overflowBehavior:{x:"hidden"},callbacks:{onScroll:t.handlerMoreHistory}}}},[t.toId?e("morebar",{attrs:{status:t.pagination.status},on:{onmore:t.getHistoryMore}}):t._e(),t._l(t.historyList,(function(s,i){return e("div",{key:s.id,attrs:{id:s.id}},[t.timeFormat(s,i)?e("div",{staticClass:"text-center muted p-t-10"},[t._v(" "+t._s(t.timeFormat(s,i))+" ")]):t._e(),"user"===s.from_type?e("div",{staticClass:"message-contain message--his"},[e("chat-message",{attrs:{avatar:t.imageURL+s.from_avatar}},[e("chat-content",{attrs:{slot:"his",type:s.msg_type,content:s.msg,imageURL:t.imageURL},slot:"his"})],1)],1):e("div",{staticClass:"message-contain message--my"},[e("chat-message",{attrs:{avatar:t.imageURL+s.from_avatar}},[e("chat-content",{attrs:{slot:"my",type:s.msg_type,content:s.msg,imageURL:t.imageURL},slot:"my"})],1)],1)])})),t.toId?t._e():[e("el-empty",{staticStyle:{height:"100%"},attrs:{description:"请选择聊天用户"}})]],2),e("div",{staticClass:"editor-contain"},[e("div",{staticClass:"editor__widget"},[e("el-popover",{attrs:{placement:"top",title:"",width:"240",trigger:"click",disabled:!t.toId}},[e("div",{staticClass:"flex flex-wrap",staticStyle:{gap:"4px"}},t._l(t.emoji,(function(s,i){return e("span",{key:i,class:`em ${s} `,staticStyle:{"font-size":"20px"},on:{click:function(e){return t.sendEmoji(s)}}})})),0),e("el-tooltip",{staticClass:"item",attrs:{slot:"reference",effect:"dark",content:"表情",placement:"bottom"},slot:"reference"},[e("div",{staticClass:"flex",staticStyle:{"margin-top":"-2px"}},[e("img",{staticStyle:{height:"20px",width:"20px",cursor:"pointer"},attrs:{src:s("b073")}})])])],1),e("el-tooltip",{staticClass:"item",attrs:{slot:"reference",effect:"dark",content:"图片",placement:"bottom"},slot:"reference"},[e("el-upload",{attrs:{action:t.uploadURL,accept:".jpg, .jpeg, .png, .JPG, .JPEG",headers:{token:t.$store.getters.token,version:t.version},"show-file-list":!1,"before-upload":t.beforeImageUpload,"on-success":t.sendMessageImage,disabled:!t.toId}},[e("i",{staticClass:"widget-item el-icon-picture-outline-round"})])],1),e("el-tooltip",{staticClass:"item",attrs:{slot:"reference",effect:"dark",content:"快捷回复",placement:"bottom"},slot:"reference"},[e("i",{staticClass:"widget-item el-icon-chat-line-round m-b-4",on:{click:t.isShowReply}})]),e("el-popover",{attrs:{placement:"top",title:"",width:"120",trigger:"manual",disabled:!t.toId},model:{value:t.showKefu,callback:function(e){t.showKefu=e},expression:"showKefu"}},[e("div",[e("el-scrollbar",{staticClass:"ls-scrollbar",staticStyle:{height:"120px"}},[t.kefuLists.length?e("div",{staticClass:"kefu-list"},t._l(t.kefuLists,(function(s,i){return e("div",{key:i,staticClass:"kefu-item flex m-b-10",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.transfer(s)}}},[e("img",{staticStyle:{width:"20px",height:"20px","border-radius":"50%"},attrs:{src:s.avatar,alt:""}}),e("div",{staticClass:"line-1 m-l-8 xs"},[t._v(t._s(s.nickname))])])})),0):e("div",{staticClass:"muted xs"},[t._v("暂无可转接客服")])])],1),e("el-tooltip",{staticClass:"item",attrs:{slot:"reference",effect:"dark",content:"转线",placement:"bottom"},slot:"reference"},[e("i",{staticClass:"widget-item el-icon-refresh",on:{click:function(e){t.showKefu=!t.showKefu}}})])],1)],1),e("el-input",{staticClass:"editor__textarea",attrs:{type:"textarea",placeholder:"请输入内容"},nativeOn:{keydown:[function(e){return t.handleKeydown.apply(null,arguments)},function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;e.preventDefault()}],keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSendMessage.apply(null,arguments)}},model:{value:t.editorContent,callback:function(e){t.editorContent=e},expression:"editorContent"}}),e("div",{staticClass:"editor__action"},[e("el-button",{attrs:{type:"primary",size:"small",disabled:!t.editorContent||!t.toId,loading:!1},on:{click:t.onSendMessage}},[t._v("发送")])],1)],1),e("quick-reply",{on:{select:t.selectReply},model:{value:t.showReply,callback:function(e){t.showReply=e},expression:"showReply"}})],1)},m=[],g=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chat-message"},[t.$slots["my"]?e("div",{staticClass:"message-contain message-contain--my"},[t._t("my")],2):t._e(),e("el-avatar",{staticClass:"message-avatar",attrs:{size:40,src:t.avatar}}),t.$slots["his"]?e("div",{staticClass:"message-contain message-contain--his"},[t._t("his")],2):t._e()],1)},f=[],v={name:"ChatMessage",props:{avatar:{type:String,default:""}}},y=v,b=(s("b36b"),Object(u["a"])(y,g,f,!1,null,"83579a84",null)),_=b.exports,C=function(){var t=this,e=t._self._c;return e("div",{staticClass:"quick-reply"},[e("el-dialog",{attrs:{title:"快捷回复",visible:t.visible,width:"800px",top:"30vh"},on:{"update:visible":function(e){t.visible=e}}},[e("el-input",{attrs:{size:"small",placeholder:"请输入快捷标题关键字搜索","prefix-icon":"el-icon-search"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getLists.apply(null,arguments)}},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}}),e("overlay-scrollbars",{staticClass:"scrollbars-contain",attrs:{options:{scrollbars:{autoHide:"scroll"},overflowBehavior:{x:"hidden"},callbacks:{onScroll:t.handleScroll}}}},[t.replyLists.length?e("div",{staticClass:"reply-lists"},t._l(t.replyLists,(function(s,i){return e("div",{key:i,staticClass:"reply-item",on:{click:function(e){return e.stopPropagation(),t.handleSelect(s)}}},[e("div",{staticClass:"reply-item__title weight-500"},[t._v(" "+t._s(s.title)+" ")]),e("div",{staticClass:"reply-item__content muted m-t-5"},[t._v(" "+t._s(s.content)+" ")])])})),0):e("el-empty",{attrs:{"image-size":100}})],1),1*t.pagination.total?e("el-pagination",{staticStyle:{"text-align":"center"},attrs:{layout:"prev, pager, next",total:t.pagination.total,"current-page":t.pagination.page},on:{"update:currentPage":function(e){return t.$set(t.pagination,"page",e)},"update:current-page":function(e){return t.$set(t.pagination,"page",e)},"current-change":function(e){return t.getLists()}}}):t._e()],1)],1)},w=[],x=s("b562"),S={name:"QuickReply",props:{value:{type:Boolean,default:!1}},data(){return{replyLists:[],keyword:"",pagination:{size:15,page:1,total:0}}},computed:{visible:{get(){return this.value},set(t){this.$emit("input",t)}}},watch:{visible(t){t&&this.getLists()}},created(){},methods:{handleScroll(){},getLists(){let{size:t,page:e,total:s}=this.pagination;Object(x["f"])({title:this.keyword,page_no:e,page_size:t}).then(t=>{this.replyLists=t.lists})},handleSelect(t){this.$emit("select",t.content),this.visible=!1}}},k=S,O=(s("1a8f"),Object(u["a"])(k,C,w,!1,null,"984e2d38",null)),M=O.exports,T=s("08f3"),L=function(){var t=this,e=t._self._c;return e("div",{staticClass:"morebar"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.LoadMap["NORMAL"]===t.status,expression:"LoadMap['NORMAL'] === status"}],on:{click:function(e){return t.$emit("onmore")}}},[t._t("normal",(function(){return[e("i",{staticClass:"status--normal"},[t._v("_加载更多_")])]}))],2),e("div",{directives:[{name:"show",rawName:"v-show",value:t.LoadMap["LOAD"]===t.status,expression:"LoadMap['LOAD'] === status"}],on:{click:function(e){return t.$emit("onload")}}},[t._t("load",(function(){return[e("i",{staticClass:"el-icon-loading status--load"})]}))],2),e("div",{directives:[{name:"show",rawName:"v-show",value:t.LoadMap["EMPTY"]===t.status,expression:"LoadMap['EMPTY'] === status"}],on:{click:function(e){return t.$emit("onempty")}}},[t._t("empty",(function(){return[e("i",{staticClass:"status--empty"},[t._v("没有更多了~")])]}))],2),e("div",{directives:[{name:"show",rawName:"v-show",value:t.LoadMap["ERROR"]===t.status,expression:"LoadMap['ERROR'] === status"}],on:{click:function(e){return t.$emit("onerror")}}},[t._t("error",(function(){return[e("i",{staticClass:"status--error"},[t._v("发生了一点错误,请重新加载!")])]}))],2)])},I=[],R={name:"Morebar",props:{status:{type:[String,Number],require:!0,validator:t=>{let e=!1;return Object.keys(T["a"]).forEach(s=>{T["a"][s]===t&&(e=!0)}),e}}},data(){return{LoadMap:Object.freeze({...T["a"]})}}},A=R,E=(s("322d"),Object(u["a"])(A,L,I,!1,null,"82d53720",null)),j=E.exports,U=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chat-content"},[t.MsgMap["TEXT"]===t.type?[e("div",{staticClass:"chat-text",domProps:{innerHTML:t._s(t.$options.filters.textToHtml(t.content))}})]:t.MsgMap["IMAGE"]===t.type?[e("el-image",{staticStyle:{width:"16em"},attrs:{src:t.imageURL+t.content}})]:t.MsgMap["GOODS"]===t.type?[e("div",{staticClass:"flex goods-message"},[e("div",{staticClass:"goods-image m-r-10"},[e("el-image",{staticStyle:{width:"80px",height:"80px"},attrs:{src:t.imageURL+t.goods.image}})],1),e("div",{},[e("div",{staticClass:"goods-name nr line-2"},[t._v(" "+t._s(t.goods.name)+" ")]),e("div",{staticClass:"goods-price m-t-10 xs"},[t._v("¥"+t._s(t.goods.min_price))])])])]:t._e()],2)},N=[],D={name:"ChatContent",props:{type:{type:[String,Number],require:!0},content:{type:[String,Number],require:!0},imageURL:{type:String}},data(){return{MsgMap:Object.freeze({...T["b"]})}},filters:{textToHtml(t){return console.log(t),t.replace(/\[em-([a-z_]+)\]/g,'<span class="em em-$1"></span>')}},computed:{goods(){return JSON.parse(this.content)}}},z=D,$=(s("80f0"),Object(u["a"])(z,U,N,!1,null,"71895323",null)),Y=$.exports,P=s("db49"),H=["em-smile","em-laughing","em-blush","em-smiley","em-relaxed","em-smirk","em-heart_eyes","em-kissing_heart","em-kissing_closed_eyes","em-flushed","em-relieved","em-satisfied","em-grin","em-wink","em-stuck_out_tongue_winking_eye","em-stuck_out_tongue_closed_eyes","em-grinning","em-kissing","em-kissing_smiling_eyes","em-stuck_out_tongue","em-sleeping","em-worried","em-frowning","em-anguished","em-open_mouth","em-grimacing","em-confused","em-hushed","em-expressionless","em-unamused","em-sweat_smile","em-sweat","em-disappointed_relieved","em-weary","em-pensive","em-disappointed","em-confounded","em-fearful","em-cold_sweat","em-persevere","em-cry","em-sob","em-joy","em-astonished","em-scream","em-tired_face","em-angry","em-rage","em-triumph","em-sleepy","em-yum","em-mask","em-dizzy_face","em-sunglasses","em-imp","em-smiling_imp","em-neutral_face","em-no_mouth","em-innocent","em-alien","em-heart","em-broken_heart","em-hankey","em-thumbsup","em-thumbsdown","em-ok_hand","em-facepunch","em-fist","em-v","em-point_up","em-point_down","em-point_left","em-point_right","em-pray"],V=s("ca00");const B=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],K=(t,e="yyyy-mm-dd")=>{t||(t=Number(new Date)),10==t.toString().length&&(t*=1e3);let s,i=new Date(t),a={"y+":i.getFullYear().toString(),"m+":(i.getMonth()+1).toString(),"d+":i.getDate().toString(),"h+":i.getHours().toString(),"M+":i.getMinutes().toString(),"s+":i.getSeconds().toString()};for(let n in a)s=new RegExp("("+n+")").exec(e),s&&(e=e.replace(s[1],1==s[1].length?a[n]:a[n].padStart(s[1].length,"0")));return e},W=t=>{10==t.toString().length&&(t*=1e3);let e=new Date(t),s=K(t,"yyyy年mm月dd日 hh:MM");return q(e)?s=K(t,"hh:MM"):Q(e)?s=B[e.getDay()]+K(t," hh:MM"):Z(e)&&(s=K(t,"mm月dd日 hh:MM")),s},Z=t=>{const e=new Date;return t.getYear()==e.getYear()},G=t=>{const e=new Date;return Z(t)&&t.getMonth()==e.getMonth()},q=t=>{const e=new Date;return G(t)&&t.getDate()==e.getDate()},Q=t=>{const e=new Date;return!!G(t)&&(e.getDay()-t.getDay()>0&&e.getDate()-t.getDate()<7||void 0)};var F={name:"TheWindowMain",components:{ChatMessage:_,QuickReply:M,Morebar:j,ChatContent:Y},props:{toId:{type:[String,Number],default:""},fromId:{type:[String,Number],default:""}},inject:["sendMessage","send"],data(){return{editorContent:"",historyList:[],showReply:!1,pagination:{size:15,page:1,status:T["a"]["NORMAL"],total:0,more:!0},scrollbar:null,uploadURL:P["a"].baseURL+"/kefuapi/file/image",version:P["a"].version,kefuLists:[],showKefu:!1,showEmoji:!1,emoji:[],handlerMoreHistory:null}},watch:{toId:{handler(t){this.changeSession(t)},immediate:!0},showKefu(t){t&&this.getKefuLists()}},computed:{timeFormat(){return(t,e)=>{let s=W(t.create_time_stamp);return e&&t.create_time_stamp-this.historyList[e-1].create_time_stamp<300&&!t.show_time&&(s=""),s}},imageURL(){return this.$store.getters.baseUrl}},created(){this.$on("message",this.receiveMessage),this.emoji=H,this.handlerMoreHistory=Object(V["a"])(300,this.loadHistoryMore)},mounted(){this.scrollbar=this.$refs["scrollbar"].osInstance()},methods:{async loadHistoryMore(t){const{scrollTop:e}=t.target;if(e<20){let t=this.historyList[0]?this.historyList[0].id:"";const e=document.getElementById(t);this.pagination.page++,this.historyList[0]&&(this.historyList[0].show_time=!0),await this.getChatHistory(this.toId),this.scrollbar.scroll(e)}console.log("scrollTop",e)},isShowReply(){this.toId&&(this.showReply=!0)},sendEmoji(t){this.ring=!0,this.editorContent+=`[${t}]`,console.log(t)},handleKeydown(t){t.shiftKey&&13==t.keyCode&&(this.editorContent+="\r\n")},onSendMessage(t){if(t.shiftKey)return;if(!this.toId)return this.$message.error("请选择聊天用户");this.sendMessage({msg:this.editorContent,msg_type:T["b"]["TEXT"],to_id:this.toId}),this.editorContent="";const{max:e,position:s}=this.scrollbar.scroll();e.y-s.y<=50&&this.scrollbar.scroll("100%")},sendMessageImage({code:t,data:e,msg:s}){if(1!==t)return this.$message.error(s);this.sendMessage({msg:e.url,msg_type:T["b"]["IMAGE"],to_id:this.toId})},receiveMessage(t){console.log(t,1111),t.to_id!=this.toId&&t.from_id!=this.toId||this.historyList.push(t);const{max:e,position:s}=this.scrollbar.scroll();e.y-s.y<=50&&this.$nextTick(()=>{this.scrollbar.scroll("100%")})},getChatHistory(t){if(t)return new Promise((e,s)=>{const{size:i,page:a,status:n}=this.pagination;console.log(n),n!=T["a"]["EMPTY"]&&(this.pagination.status=T["a"]["LOAD"],Object(x["a"])({user_id:t,page_no:a,page_size:i}).then(t=>{this.historyList=[...t.lists,...this.historyList],this.pagination.total=t.count,this.pagination.status=t.lists.length<i?T["a"]["EMPTY"]:T["a"]["NORMAL"],e(t)}).catch(t=>{this.pagination.status=T["a"]["ERROR"],s(t)}))})},async getHistoryMore(){const t=document.getElementById(this.historyList[0].id);this.historyList[0].show_time=!0,this.pagination.page++,await this.getChatHistory(this.toId),this.scrollbar.scroll(t)},selectReply(t){this.editorContent=t},async changeSession(t){this.pagination.size=15,this.pagination.page=1,this.pagination.total=0,this.pagination.more=!0,this.pagination.status=T["a"]["NORMAL"],this.historyList=[],t&&await this.getChatHistory(t),this.$nextTick(()=>{this.scrollbar.scroll("100%"),console.log(this.scrollbar.scroll())})},beforeImageUpload(t){const e=t.size/1024/1024<2;return e||this.$message.error("上传图片大小不能超过 2MB!"),e},getKefuLists(){Object(x["g"])().then(t=>{this.kefuLists=t})},transfer(t){this.send("transfer",{user_id:this.toId,kefu_id:t.id}),this.showKefu=!1}}},X=F,J=(s("171c"),Object(u["a"])(X,p,m,!1,null,"73b4da7d",null)),tt=J.exports,et=function(){var t=this,e=t._self._c;return e("el-tabs",{staticClass:"window__aside-left",attrs:{stretch:!0},model:{value:t.tabsActiveIndex,callback:function(e){t.tabsActiveIndex=e},expression:"tabsActiveIndex"}},[e("div",{staticClass:"chat-search"},[e("el-input",{attrs:{size:"small",placeholder:"请输入用户昵称搜索",clearable:!0},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSearch.apply(null,arguments)}},model:{value:t.searchValue,callback:function(e){t.searchValue=e},expression:"searchValue"}})],1),e("el-tab-pane",{staticClass:"chat-user__list",attrs:{label:"用户列表",name:t.TabsMap["USER_LIST"]}},[e("el-scrollbar",{staticClass:"ls-scrollbar scrollbar-wrapper"},[e("loading-more",{on:{load:t.getUserList},model:{value:t.pagination.status,callback:function(e){t.$set(t.pagination,"status",e)},expression:"pagination.status"}},t._l(t.SessionList["user"],(function(s,i){return e("chat-user-item",{key:s.id,attrs:{"is-read":s.is_read,name:s.nickname,avatar:s.avatar,message:s.msg,active:t.current===s.user_id,time:s.update_time,online:s.online,"msg-type":s.msg_type},nativeOn:{click:function(e){return t.changeCurrent(s,i)}}})})),1)],1)],1),e("el-tab-pane",{attrs:{label:"",name:t.TabsMap["GROUP_CHAT"],disabled:""}})],1)},st=[],it=function(){var t=this,e=t._self._c;return e("div",{class:["chat-user-item",{"chat-user-item--active":t.active}]},[e("div",{staticClass:"chat__avatar",class:{"chat__avatar--online":t.online}},[e("el-badge",{attrs:{"is-dot":"",hidden:Boolean(t.isRead)}},[e("el-avatar",{attrs:{size:38,src:t.imageURL+t.avatar}})],1)],1),e("div",{staticClass:"chat__msg"},[e("div",{staticClass:"chat__msg-info"},[e("div",{staticClass:"user-name nr normal line-1"},[t._v(t._s(t.name))]),e("div",{staticClass:"msg-time xs muted m-l-5"},[t._v(t._s(t.getTime))])]),e("div",{staticClass:"chat__msg-content xs"},[e("div",{staticClass:"msg-content muted line-1 flex-1",domProps:{innerHTML:t._s(t.getMessage)}})])])])},at=[],nt={name:"ChatUserItem",props:{avatar:{type:String,default:""},name:{type:String,default:""},message:{type:String,default:""},time:{type:[String,Number],default:""},badge:{type:Number,default:0},active:{type:Boolean,default:!0},online:{type:Number},isRead:{type:[Boolean,Number]},msgType:{type:Number}},computed:{getTime(){return this.time?W(new Date(this.time).getTime()):""},getMessage(){switch(this.msgType){case 1:return this.message.replace(/\[em-([a-z_]+)\]/g,'<span class="em em-$1"></span>');case 2:return"图片";case 3:return"商品"}},imageURL(){return this.$store.getters.baseUrl}}},ot=nt,rt=(s("dc04"),Object(u["a"])(ot,it,at,!1,null,"685346f4",null)),lt=rt.exports,ct=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:t.load,expression:"load"}],staticClass:"loading-more",attrs:{"infinite-scroll-distance":"50","infinite-scroll-disabled":t.disabled}},[t._t("default"),e("morebar",{attrs:{status:t.status}})],2)},ut=[],dt={props:{value:{type:[String,Number]}},components:{Morebar:j},data(){return{}},computed:{disabled(){return this.status==T["a"]["LOAD"]||this.status==T["a"]["EMPTY"]},status:{get(){return this.value},set(t){this.$emit("input",t)}}},methods:{load(){this.status=T["a"]["LOAD"],this.$emit("load")}}},ht=dt,pt=Object(u["a"])(ht,ct,ut,!1,null,"f5dab428",null),mt=pt.exports,gt={name:"TheWindowAsideLeft",components:{ChatUserItem:lt,LoadingMore:mt},props:{current:{type:[String,Number],require:!0}},inject:["send"],data(){return{searchValue:"",tabsActiveIndex:"",TabsMap:Object.freeze({USER_LIST:"1",GROUP_CHAT:"2"}),pagination:{size:15,page:1,status:T["a"]["NORMAL"]},SessionList:{user:[],group:[]}}},created(){this.tabsActiveIndex=this.TabsMap["USER_LIST"],this.$on("useronline",this.useronlineEvent),this.$on("transfer",this.transferEvenr),this.$on("message",this.messageEvenr)},methods:{getUserList(){return new Promise((t,e)=>{const{size:s,page:i,status:a}=this.pagination;a!=T["a"]["EMPTY"]&&Object(x["b"])({page_no:i,page_size:s,nickname:this.searchValue.trim()}).then(e=>{e&&(this.pagination.page++,e.lists.forEach(t=>{let e=this.SessionList.user.findIndex(e=>e.user_id==t.user_id);-1==e&&this.SessionList.user.push(t)}),this.pagination.status=T["a"]["NORMAL"],this.$nextTick(()=>{!e.lists.length<s&&(this.pagination.status=T["a"]["EMPTY"])}),t(e))}).catch(t=>{this.pagination.status=T["a"]["NORMAL"],e(t)}).finally(()=>{})})},handleSearch(){this.pagination.page=1,this.pagination.status=T["a"]["LOAD"],this.SessionList.user=[],this.getUserList()},transferEvenr(t){if("get_success"==t.status)return this.setUser(t.user),void this.$notify.success({title:"转接通知",message:"您有新的用户"});this.SessionList.user=this.SessionList.user.filter(t=>t.user_id!=this.current),this.$emit("change",""),this.$message.success({message:"转接成功"})},useronlineEvent(t){t.online&&this.$notify.success({title:"上线通知",message:`用户(${t.nickname})上线`}),this.setUser(t)},messageEvenr(t){let e=this.SessionList.user.findIndex(e=>"user"==t.from_type?t.from_id==e.user_id:"kefu"==t.from_type?t.to_id==e.user_id:void 0);if(-1!=e&&(this.$set(this.SessionList.user[e],"msg_type",t.msg_type),this.$set(this.SessionList.user[e],"msg",t.msg),this.$set(this.SessionList.user[e],"update_time",t.update_time)),"user"==t.from_type){if(t.from_id==this.current)return void this.send("read",{user_id:this.current});this.$set(this.SessionList.user[e],"is_read",0)}},changeCurrent(t,e){this.$emit("change",t.user_id),t.is_read||(this.send("read",{user_id:t.user_id}),this.$set(this.SessionList.user[e],"is_read",1))},setUser(t){let e=this.SessionList.user.findIndex(e=>t.user_id==e.user_id);-1!=e?this.$set(this.SessionList.user[e],"online",t.online):this.SessionList.user.unshift(t)}}},ft=gt,vt=(s("60c8"),Object(u["a"])(ft,et,st,!1,null,"445556f9",null)),yt=vt.exports,bt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"window__aside-right"},[e("el-tabs",{attrs:{stretch:!0},model:{value:t.tabsActiveIndex,callback:function(e){t.tabsActiveIndex=e},expression:"tabsActiveIndex"}},[e("el-tab-pane",{attrs:{label:"用户资料",name:t.TabsMap["USER"]}},[e("div",{staticClass:"tab-content"},[t.userInfo.id?e("div",{staticClass:"user-info"},[e("div",{staticClass:"info-header flex"},[e("img",{staticClass:"avatar m-r-10",attrs:{src:t.userInfo.avatar}}),e("div",{staticClass:"name line-2"},[t._v(t._s(t.userInfo.nickname))])]),e("div",{staticClass:"info-item"},[e("span",{staticClass:"label"},[t._v("用户编号:")]),e("span",[t._v(t._s(t.userInfo.sn))])]),e("div",{staticClass:"info-item"},[e("span",{staticClass:"label"},[t._v("用户等级:")]),e("span",[t._v(t._s(t.userInfo.level_name))])]),e("div",{staticClass:"info-item"},[e("span",{staticClass:"label"},[t._v("手机号码:")]),e("span",[t._v(t._s(t.userInfo.mobile))])]),e("div",{staticClass:"info-item"},[e("span",{staticClass:"label"},[t._v("累计消费:")]),e("span",[t._v(t._s(t.userInfo.total_order_amount))])]),e("div",{staticClass:"info-item"},[e("span",{staticClass:"label"},[t._v("生日:")]),e("span",[t._v(t._s(t.userInfo.birthday))])]),e("div",{staticClass:"info-item"},[e("span",{staticClass:"label"},[t._v("注册来源:")]),e("span",[t._v(t._s(t.userInfo.register_source))])]),e("div",{staticClass:"info-item"},[e("span",{staticClass:"label"},[t._v("注册时间:")]),e("span",[t._v(t._s(t.userInfo.create_time))])])]):e("el-empty",{attrs:{"image-size":100}})],1)]),e("el-tab-pane",{attrs:{label:"订单信息",name:t.TabsMap["ORDER"]}},[e("el-scrollbar",{staticClass:"ls-scrollbar",staticStyle:{height:"670px"}},[t.toId?e("loading-more",{on:{load:t.getUserOrder},model:{value:t.status,callback:function(e){t.status=e},expression:"status"}},[e("div",{staticClass:"tab-content"},[e("div",{staticClass:"order-info"},[e("el-input",{attrs:{size:"small",placeholder:"请输入订单号搜索"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.refresh.apply(null,arguments)}},model:{value:t.orderSn,callback:function(e){t.orderSn=e},expression:"orderSn"}}),t.orderLists.length?e("div",{staticClass:"order-list"},t._l(t.orderLists,(function(s,i){return e("div",{key:i,staticClass:"order-item"},[t._l(s.order_goods,(function(s,i){return e("div",{key:i,staticClass:"order-goods flex col-top"},[e("div",{staticClass:"flex-none"},[e("el-image",{staticStyle:{width:"68px",height:"68px"},attrs:{src:s.goods_image}})],1),e("div",{staticClass:"flex-1 m-l-8",staticStyle:{"min-width":"0"}},[e("div",{staticClass:"goods-name line-1"},[t._v(t._s(s.goods_name))]),e("div",{staticClass:"muted m-t-5"},[t._v(t._s(s.spec_value_str))]),e("div",{staticClass:"price flex row-between m-t-5"},[e("div",{staticClass:"nr"},[t._v(" ¥"+t._s(s.goods_price)+" ")]),e("div",{staticClass:"muted"},[t._v("x"+t._s(s.goods_num))])])])])})),e("div",{staticClass:"order-con"},[e("div",{staticClass:"m-t-15"},[e("span",{staticClass:"muted"},[t._v("订单类型:")]),e("span",[t._v(" "+t._s(s.order_type_desc)+" ")])]),e("div",{staticClass:"m-t-15"},[e("span",{staticClass:"muted"},[t._v("订单编号:")]),e("span",[t._v(t._s(s.sn))])]),e("div",{staticClass:"m-t-15"},[e("span",{staticClass:"muted"},[t._v("订单状态:")]),e("span",{staticClass:"order-status",class:{"wait-pay":0==s.order_status}},[t._v(" "+t._s(s.order_status_desc)+" ")])]),e("div",{staticClass:"m-t-15"},[e("span",{staticClass:"muted"},[t._v("订单金额:")]),e("span",[t._v(" "+t._s(s.order_amount)+" ")])]),e("div",{staticClass:"m-t-15"},[e("span",{staticClass:"muted"},[t._v("下单时间:")]),e("span",[t._v(" "+t._s(s.create_time)+" ")])])])],2)})),0):t._e()],1)])]):e("el-empty",{attrs:{"image-size":100}})],1)],1)],1)],1)},_t=[],Ct={name:"TheWindowAsideRight",components:{LoadingMore:mt},props:{toId:{type:[Number,String]}},inject:["send"],data(){return{tabsActiveIndex:"",TabsMap:Object.freeze({USER:"1",ORDER:"2"}),orderSn:"",userInfo:{},orderLists:[],showKefu:!1,KefuLists:[],page:1,size:15,status:T["a"]["NORMAL"]}},watch:{toId(t){this.page=1,this.status=T["a"]["LOAD"],this.orderLists=[],this.orderSn="",t?(this.getUserInfo(),this.getUserOrder()):this.userInfo={}}},methods:{refresh(){this.page=1,this.status=T["a"]["LOAD"],this.orderLists=[],this.getUserOrder()},getUserInfo(){Object(x["h"])({user_id:this.toId}).then(t=>{this.userInfo=t})},getUserOrder(){this.status!=T["a"]["EMPTY"]&&Object(x["i"])({page_size:this.size,page_no:this.page,user_id:this.toId,sn:this.orderSn}).then(t=>{this.page++,this.orderLists.push(...t.lists),this.status=T["a"]["NORMAL"],this.$nextTick(()=>{t.lists.length<this.size&&(this.status=T["a"]["EMPTY"])})})}},created(){this.tabsActiveIndex=this.TabsMap["USER"]}},wt=Ct,xt=(s("b524"),Object(u["a"])(wt,bt,_t,!1,null,"68839200",null)),St=xt.exports;class kt{constructor({ws:t,params:e,...s}){this.ws=t+"?"+Object(V["b"])(e),this.serve=null,this.event=s,this.reconnectLock=!0,this.reconnectTimeout=null,this.reconnectNums=0,this.timeout=1e4,this.clientTimeout=null,this.serverTimeout=null,this.init()}init(){this.ws&&(this.serve=new WebSocket(this.ws),this.serve.onopen=this.onOpen.bind(this),this.serve.onerror=this.onError.bind(this),this.serve.onmessage=this.onMessage.bind(this),this.serve.onclose=this.onClose.bind(this))}onOpen(){console.log("Open"),this.start(),this.event.open&&this.event.open()}onError(t){console.log("Error"),this.event.error&&this.event.error(t)}onMessage(t){console.log("Message"),this.reset(),this.event.message&&this.event.message(t)}onClose(){console.log("Close"),this.reconnect(),this.event.close&&this.event.close()}send(t){this.serve.send(JSON.stringify(t))}reset(){this.reconnectNums=0,this.start()}reconnect(){this.reconnectLock&&(console.log(this.reconnectNums),this.reconnectNums>=5||(this.reconnectNums++,this.reconnectLock=!1,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=setTimeout(()=>{this.init(),this.reconnectLock=!0},4e3)))}start(){clearTimeout(this.clientTimeout),clearTimeout(this.serverTimeout),this.clientTimeout=setTimeout(()=>{this.send({event:"ping"}),this.serverTimeout=setTimeout(()=>{this.serve.close()},this.timeout)},this.timeout)}close(){this.reconnectLock=!1,clearTimeout(this.clientTimeout),clearTimeout(this.serverTimeout),this.serve.close&&this.serve.close()}}var Ot=kt,Mt=s("6680"),Tt={name:"Window",components:{TheWindowHeader:h,TheWindowAsideLeft:yt,TheWindowAsideRight:St,TheWindowMain:tt,EasyRing:Mt["EasyRingVueComponent"]},data(){return{sessionID:"",isStatus:!1,open:!1,ring:!1,notice:s("42e9"),showDialog:!1}},computed:{...Object(r["c"])(["token","userInfo","wsUrl"])},provide(){return{sendMessage:this.sendMessage,send:this.send,closeChatServe:this.closeChatServe,reChatServe:this.reChatServe}},async created(){await this.getUserInfo(),await this.initChatServe()},beforeDestroy(){this.closeChatServe()},methods:{handlenotice(){console.log(111),this.open=!this.open},handlevisible(){this.open=!0,this.showDialog=!1},openComponent(){},...Object(r["b"])(["getUserInfo"]),sendMessage(t){this.send(T["c"]["CHAT"],{to_type:"user",...t})},send(t,e){this.socketServe.send({event:t,data:e})},closeChatServe(){this.socketServe.close()},reChatServe(){this.socketServe.init()},initChatServe(){return new Promise((t,e)=>{const s=this;this.socketServe=new Ot({ws:this.wsUrl,params:{token:this.token,type:"kefu",terminal:T["d"]},open(){s.isStatus=!0,t()},message({data:t}){const{event:e,data:i}=JSON.parse(t)||{};switch(console.log("e",e,i),e){case T["c"]["CHAT"]:"user"==i.from_type&&(s.ring=!0),s.$refs["chat"].$emit("message",i),s.$refs["user"].$emit("message",i);break;case T["c"]["ERROR"]:s.$message.error(i.msg);break;case T["c"]["NOTICE"]:s.$message.info(i.msg);break;case T["c"]["PING"]:console.log("===============心跳============");break;case T["c"]["USER_ONLINE"]:s.$refs["user"].$emit("useronline",i);break;case T["c"]["TRANSFER"]:s.$refs["user"].$emit("transfer",i);break}},error(t){e()},close(){s.isStatus=!1}})})},changeSession(t){console.log(t),this.sessionID=t}},mounted(){this.showDialog=!0}},Lt=Tt,It=(s("c23d"),Object(u["a"])(Lt,i,a,!1,null,"57d7bb0b",null));e["default"]=It.exports},"322d":function(t,e,s){"use strict";s("9df9")},"42e9":function(t,e,s){t.exports=s.p+"media/notice.7cb9a9a5.mp3"},"4dae":function(t,e,s){},5108:function(t,e,s){t.exports=s.p+"img/noticeon.4d4ed2f8.png"},5303:function(t,e,s){const{MusicBox:i,musicTexts:a}=s("6b7f");let n;try{const t=s("2b0e");n=t.h}catch(l){console.log("🌟【EASY-RING LOG】:require h() fail.(If you are not using Vue3, please ignore this message.)")}const o=()=>{const t=parseInt(1e6*Math.random());return"easyRing"+t},r={props:{ring:{type:Boolean,default:!1},src:{type:String,default:""},open:{type:Boolean,default:!1},loop:{type:Boolean,default:!0},log:{type:Boolean,default:!0},musicText:{type:String,default:""},defaultMusic:{type:String,default:"EZIOS_FAMILY"}},data:()=>({id:o(),active:!1,audioObject:null,musicbox:null}),watch:{ring(t){t?this.play():this.pause()},open(t){t?this.openRing():this.stopRing()}},methods:{openRing(){this._log(`open the ring(id=${this.id})`),this.active=!0,this.audioObject.loop=!1,this.audioObject.pause(),this.musicbox=new i({loop:this.$props.loop,endedCallback:this.$props.loop?()=>{}:()=>{this.endHandle()}}),this.$emit("update:ring",!1)},stopRing(){this._log(`close the ring(id=${this.id})`),this.active=!1,this.src&&this.audioObject?(this.audioObject.pause(),this.audioObject.currentTime=0):this.musicbox&&this.musicbox.stopMusic(),this.$emit("update:ring",!1)},play(){this._log(`play the ring(id=${this.id})`),!this.audioObject.loop&&this.$props.loop&&(this.audioObject.loop=!0),this.active&&(this.$props.src?(this.audioObject.currentTime=0,this.audioObject.play()):this.$props.musicText?this.musicbox.playMusic(this.$props.musicText):a[this.$props.defaultMusic]?this.musicbox.playMusic(a[this.$props.defaultMusic]):this._log(`💔invalid type of defaultMusicText in ths ring(id=${this.state.id}).`))},pause(){this.$props.src?(this._log(`pause the ring(id=${this.id})`),this.audioObject.pause()):this.musicbox.stopMusic(),this.$emit("update:ring",!1)},_log(t){t&&this.$props.log&&console.log("🌟【EASY-RING LOG】:"+t)},endHandle(){this._log("end"),this.$props.loop||(this.$emit("update:ring",!1),this.$emit("ended"))}},mounted(){this._log("EasyRingVueComponent mounted"),this.audioObject=document.getElementById(this.id),this.audioObject.addEventListener("ended",()=>{this.endHandle()})},beforeUnmount(){this.stopRing(),this._log("EasyRingVueComponent unmounted")},beforeDestroy(){this.stopRing(),this._log("EasyRingVueComponent unmounted")},render(t){const e=n||t;return e("div",{class:"easy-ring-container"},[e("audio",{attrs:{id:this.id,src:this.src},id:this.id,src:this.src,class:"easy-ring"})])}};t.exports=r},6092:function(t,e,s){},"60c8":function(t,e,s){"use strict";s("a610")},6680:function(t,e,s){const i=s("0aea"),a=s("5303"),n=s("ff69");t.exports={CommonEasyRing:i,EasyRingVueComponent:a,EasyRingReactComponent:n}},6702:function(t,e,s){t.exports=s.p+"img/noticeoff.f56c056e.png"},"6b7f":function(t,e){class s{constructor(t){let e={loop:!1,musicText:"",autoplay:!1,type:"sine",duration:2,endedCallback:function(){}};this.opts=Object.assign(e,t),this.timer=0,this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.arrFrequency=[262,294,330,349,392,440,494,523,587,659,698,784,880,988,1047,1175,1319,1397,1568,1760,1967],this.arrNotes=[".1",".2",".3",".4",".5",".6",".7","1","2","3","4","5","6","7","1.","2.","3.","4.","5.","6.","7."]}createMusic(t){let e=this.arrNotes.indexOf(t);-1!==e&&this.createSound(this.arrFrequency[e])}createSound(t){let e=this.audioCtx.createOscillator(),s=this.audioCtx.createGain();e.connect(s),s.connect(this.audioCtx.destination),e.type=this.opts.type,e.frequency.value=t,s.gain.setValueAtTime(0,this.audioCtx.currentTime),s.gain.linearRampToValueAtTime(1,this.audioCtx.currentTime+.01),e.start(this.audioCtx.currentTime),s.gain.exponentialRampToValueAtTime(.001,this.audioCtx.currentTime+this.opts.duration),e.stop(this.audioCtx.currentTime+this.opts.duration)}pressBtn(t){this.createSound(this.arrFrequency[t])}playMusic(t,e=2){let s=0,i=t.split(" "),a=setInterval(()=>{try{let t=this.arrNotes.indexOf(i[s]);"-"!==i[s]&&"0"!==i[s]&&this.pressBtn(t),s++,s>=i.length&&(this.opts.loop?s=0:(this.opts.endedCallback(),clearInterval(a)))}catch(t){console.error(t),clearInterval(a)}},1e3/e);return this.timer=a,a}stopMusic(){clearInterval(this.timer)}}const i={TWO_TIGERS:"1 2 3 1 - 1 2 3 1 - 3 4 5 - 3 4 5 - - 5 6 5 4 3 - 1 - 5 6 5 4 3 - 1 - 2 - .5 - 1 - - 2 - .5 - 1 - - - -",LITTLE_STAR:"1 1 5 5 6 6 5 - 4 4 3 3 2 2 1 - 5 5 4 4 3 3 2 - 5 5 4 4 3 3 2 - 1 1 5 5 6 6 5 - 4 4 3 3 2 2 1 - - - -",EZIOS_FAMILY:".6 - 1 - 2 - 3 - .6 - 1 - 2 - 1 - .6 - 1 - 2 - 3 - .6 - 1 - 2 - 1 - .6 - 1 - 2 - 3 - 6 - 7 - 1. - 2. - 3. - - - - - -",CASTLE_IN_THE_SKY:".6 .7 1 - - .7 1 - 3 - .7 - - - - .3 .3 .6 - - .5 .6 - 1 - .5 - - - - .3 .3 .4 - - .3 .4 - 1 - .3 - - - - 1 1 1 .7 - - .4 .4 - .7 - .7 - - - - -"};t.exports={MusicBox:s,musicTexts:i}},"70e6":function(t,e,s){"use strict";s("dfe8")},"80f0":function(t,e,s){"use strict";s("efb6")},"962f":function(t,e,s){},"9df9":function(t,e,s){},a610:function(t,e,s){},b073:function(t,e){t.exports="data:image/png;base64,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"},b36b:function(t,e,s){"use strict";s("0e73")},b524:function(t,e,s){"use strict";s("962f")},c23d:function(t,e,s){"use strict";s("6092")},dc04:function(t,e,s){"use strict";s("4dae")},dfe8:function(t,e,s){},efb6:function(t,e,s){},ff69:function(t,e,s){const{MusicBox:i,musicTexts:a}=s("6b7f");let n,o,r,l;try{n=s(!function(){var t=new Error("Cannot find module 'react'");throw t.code="MODULE_NOT_FOUND",t}()),o=n.createElement,r=n.useState,l=n.useEffect,useRef=n.useRef}catch(u){console.log("🌟【EASY-RING LOG】:require React fail.(If you are not using React, please ignore this message.)")}const c=t=>{const e=()=>"easyRing"+parseInt(1e6*Math.random()),s=useRef(e()),[n,c]=r(!1),[u,d]=r(null),h=useRef(null),p=()=>{v(`open the ring(id=${s.current})`),c(!0),u.loop=!1,u.pause(),t.setRing(!1)},m=()=>{v(`close the ring(id=${s.current})`),c(!1),t.src&&u?(u.pause(),u.currentTime=0,t.setRing(!1)):h.current&&h.current.stopMusic()},g=()=>{!u.loop&&t.loop&&(u.loop=!0),n&&(v(`play the ring(id=${s.current})`),t.src?(u.currentTime=0,u.play()):t.musicText?h.current.playMusic(t.musicText):a[t.defaultMusic]?h.current.playMusic(a[t.defaultMusic]):v(`💔invalid type of defaultMusicText in ths ring(id=${s.current}).`))},f=()=>{v(`pause the ring(id=${s.current})`),t.src?u.pause():h.current.stopMusic(),t.setRing(!1)},v=e=>{e&&t.log&&console.log("🌟【EASY-RING LOG】:"+e)},y=()=>{t.ended(),t.loop||t.setRing(!1)};return l(()=>(u||(v("EasyRingReactComponent(function) mounted"),d(document.getElementById(s.current)),h.current=new i({loop:t.loop,endedCallback:t.loop?()=>{}:()=>{y()}})),m),[]),l(()=>{u&&(!n&&t.open&&p(),t.open||m())},[t.open]),l(()=>{u&&(t.ring?g():f())},[t.ring]),o("div",{className:"easy-ring-container"},[o("audio",{id:s.current,src:t.src,className:"easy-ring",onEnded:()=>{y()},key:s.current})])};c.defaultProps={open:!1,ring:!1,src:"",loop:!0,log:!0,musicText:"",defaultMusic:"EZIOS_FAMILY",setRing:()=>{},ended:()=>{}},t.exports=c}}]);
  2. //# sourceMappingURL=chunk-3d1a5ed3.afecd624.js.map