快捷回复
\n
'),l.onclick=function(){var A=t.decoderState.state,e=A.isEditing,i=A.rejection;if(e||i)return!1;console.log("快捷回复"),t.switchFooter("quickReply"),t.quickReplyEle=new Vi(t.jSPlugin,t.switchFooter,t.videoWidth)},l;case"answer":return l.title="接听",l.id=A,l.domString='
\n
\n
\n
\n
接听
\n
'),l.onclick=function(){var A=t,i=t.decoderState.state,o=i.play,r=i.isEditing,s=i.talk,g=i.sound,c=i.rejection;if(r||c)return!1;console.log("接听"),t.jSPlugin.pluginStatus.loadingClear(),t.bellStatus="onCall",t.switchFooter("onCall"),a[t.bellStatus].btnList.map((function(A,e){A.isrender&&t.renderFooter(A.iconId,A)})),n[t.bellStatus].btnList.map((function(A,e){A.isrender&&t.renderHeader(A.iconId,A)}));var l=document.getElementById("".concat(t.jSPlugin.id,"-header-onBell"));l&&l.parentElement.removeChild(l),1==t.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),t.jSPlugin.setPoster("")),t.removeBellRing(),t.miniRecCloseClick(),o||(t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),t.jSPlugin.play(),t.setDecoderState({play:!o})),s||1!=t.themeData.customConfig.defaultMicro||(t.setDecoderState({talk:!0,mute:!1}),g&&t.jSPlugin.closeSound(),t.jSPlugin.Talk.startTalk()),t.setDecoderState({sound:!1}),0==t.themeData.customConfig.defaultMicro&&(t.muteCommon(e),t.jSPlugin.openSound()),t.maxTalkTime=1e3*t.themeData.customConfig.maxTalkTime*60,setTimeout((function(){s&&(console.log("结束对讲"),A.setDecoderState({talk:!1}),A.jSPlugin.Talk.stopTalk()),o&&(A.jSPlugin.stop(),A.setDecoderState({play:!o})),t.rejectionStatusDispose(),t.remoteUnlockEle&&t.remoteUnlockEle.closeRemoteUnlock(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp")}),t.maxTalkTime)},l;case"remoteUnlock":return l.title="远程开锁",l.id=A,l.domString='
\n
\n
\n
\n
远程开锁
\n
'),l.onclick=function(){var A=t.decoderState.state,e=A.isEditing;A.play;var i=A.rejection;if(e||"onBell"==t.bellStatus||i)return!1;console.log("远程开锁"),t.switchFooter("remoteUnlock"),t.remoteUnlockEle=new Oi(t.jSPlugin,t.switchFooter,t.videoWidth)},l;case"mute":return l.title="静音",l.id=A,l.domString='
\n
\n
\n
\n
静音
\n
'),l.onclick=function(){var A=t.decoderState.state,i=A.talk,n=A.sound;if(A.play,A.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),t.setDecoderState({talk:!1,mute:!0},e.backgroundColor),t.jSPlugin.Talk.stopTalk(),t.jSPlugin.openSound()):(console.log("开始对讲"),t.setDecoderState({talk:!0,mute:!1},e.backgroundColor),n&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),t.jSPlugin.Talk.startTalk())},l;case"hangUp":return l.title="挂断",l.id=A,l.domString='
\n
\n
\n
\n
挂断
\n
'),l.onclick=function(){var A=t,e=t.decoderState.state,i=e.talk,n=e.play;if(e.rejection)return!1;i&&(console.log("结束对讲"),t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk()),n&&(t.jSPlugin.stop(),t.setDecoderState({play:!n})),(n||i)&&(A.miniRecCloseClick(),console.log("挂断"),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp"))},l;default:return l}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var A=this.decoderState.state.play;console.log("应答超时"),A&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.miniRecCloseClick(),this.rejectionStatusDispose(),this.quickReplyEle&&this.quickReplyEle.closeQuickReplyEle(),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var A=this,e=this.themeData.footer,t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")),a=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(t.innerHTML="",n.innerHTML="",t.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),e[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)})),a.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!0,type:2})}},{key:"userNoDevice",value:function(){var A=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var e=this.themeData.footer,t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn"));"onBell"==this.bellStatus?(t.innerHTML="",n.innerHTML="",t.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),e[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!0,type:2})}},{key:"renderHeader",value:function(A,e){var t=this,i=this.matchBtn(A,e);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var n=document.createElement("span");n.innerHTML="".concat(i.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(n)}else{var a=document.createElement("div");a.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),a.style="max-width:50%;position:relative;",a.innerHTML='
\n ').concat(i.domString,"\n "),a.onclick=function(A){if(t.decoderState.state.isEditing)return!1;i.onclick(A)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(a)}}},{key:"renderFooter",value:function(A,e){var t=this,i=this.decoderState.state.mute;if("remoteUnlock"==A&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var n=this.matchBtn(A,e),a=this.videoWidth/4,o=document.createElement("div");if(o.className="theme-icon-item","quickReply"!==n.id&&(o.style="width:".concat(.66*a,"px;padding:0 ").concat(.12*a,"px;box-sizing: content-box;-webkit-tap-highlight-color:transparent;")),o.innerHTML="".concat('
')+'')).concat(n.domString,"
")+"",o.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onclick(A)},n.onmouseenter&&(o.onmouseenter=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseenter(A)}),n.onmouseleave&&(o.onmouseleave=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseleave(A)}),"quickReply"!=A){var r=document.createElement("span");r.className="icon-move left",r.innerHTML='
\n \n '),r.onclick=function(){t.editIcon(n.id,"left","footer")},o.appendChild(r);var s=document.createElement("span");s.className="icon-move right",s.innerHTML='
\n \n '),s.onclick=function(){t.editIcon(n.id,"right","footer")},o.appendChild(s)}if("answer"==A||"rejection"==A||"hangUp"==A);else{var g=document.createElement("span");g.className="icon-move close",g.innerHTML='
\n \n '),g.onclick=function(){t.editIcon(n.id,"delete","footer")},o.appendChild(g)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(o):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(o),"quickReply"===n.id&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).appendChild(o)),this.decoderState.state.isEditing&&"mute"==A&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?this.setDecoderState({mute:!1},e.backgroundColor):this.setDecoderState({mute:!0},e.backgroundColor))}},{key:"switchFooter",value:function(A){var e=this.themeData.footer;switch(A){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex"):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex");break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=e[this.bellStatus].color)}}},{key:"initThemeData",value:function(){var A=this;console.log("-------------initThemeData");var e=this.themeData,t=e.header,i=e.footer,n=this.decoderState.state.isEditing,a=this.videoWidth,o=a/375,r=1.8*a,g=this.jSPlugin.id;if(this.isNeedRenderHeader=Ft(t[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=Ft(i[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="
");else{var c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),c.setAttribute("class","header-controls"),c.innerHTML=""),console.log(this.jSPlugin.height),this.jSPlugin.height;var l=s(s({display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":.1*r+"px","align-items":"center","text-align":"center","font-size":"24ox"},"color","#2c2c2c"),"margin-top","6px");c.style=Wi(l),document.getElementById("".concat(g,"-wrap")).insertBefore(c,document.getElementById(g));var I=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(I)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.jSPlugin.height,this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="".concat(.2*r,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n \n \n \n \n \n '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n \n \n \n \n \n '));else{var C=document.createElement("div");C.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),C.setAttribute("class","ez-iframe-footer-container");var d={position:"relative","margin-top":.2*r+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","font-size":"12px"};C.style=Wi(d),C.innerHTML='\n \n \n \n \n \n '),x(C,document.getElementById(g))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&t[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderHeader(e.iconId,e)})),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i[this.bellStatus].color,i[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)}))),1!=this.themeData.customConfig.bellPoster||n)this.jSPlugin.setPoster("");else{this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var h=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(h),A.jSPlugin.setPoster(A.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),this.checkIsAppleDevice()||!1?window.addEventListener("touchstart",this.autoPlayRing):window.addEventListener("click",this.autoPlayRing));this.inited=!0,this.getCallDeviceInfo()}},{key:"checkIsAppleDevice",value:function(){var A=navigator.userAgent,e=!!A.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),t=A.indexOf("iPad")>-1,i=A.indexOf("iPhone")>-1||A.indexOf("Mac")>-1;return!!(e||t||i)}},{key:"renderThemeData",value:function(){var A=this,e=this.themeData,t=e.header,i=e.footer,n=this.decoderState.state.isEditing;if(this.isNeedRenderHeader&&t&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=t[this.bellStatus].color.replace("-diy",""),t[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.setDecoderState(s({},e.iconId,A.decoderState.state[e.iconId]))}))),this.isNeedRenderFooter&&i)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(e,t){if(e.isrender&&A.setDecoderState(s({},e.iconId,A.decoderState.state[e.iconId])),console.log("-------------activeThemeStatus"),0==t&&!A.themeInited&&A.activeThemeStatus)var i=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(i),1!=A.themeData.customConfig.bellPoster||n?A.jSPlugin.play():A.jSPlugin.pluginStatus.loadingClear(),A.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){A.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===m(this.jSPlugin.url).type,rec:"rec"===m(this.jSPlugin.url).type,type:m(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),A.themeData&&A.themeData.customConfig&&1==A.themeData.customConfig.bellPoster&&!n?A.jSPlugin.pluginStatus.loadingClear():A.jSPlugin.play(),A.themeInited=!0)}),50);var o=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),A.jSPlugin.reSize(A.jSPlugin.params.width,A.jSPlugin.params.height))}),50);n||this.jSPlugin.isWebConsole?1==this.themeData.customConfig.miniWinRec?this.initMiniImageRec():this.miniRecCloseClick():setTimeout((function(){"onBell"==A.bellStatus&&A.jSPlugin.capacity&&1==A.jSPlugin.capacity.support_doorcall_playback&&(console.log("小窗口initMiniRec-------------设备能力集成功"),1==A.themeData.customConfig.miniWinRec&&(console.log("小窗口initMiniRec---------------画中画设置已开启"),(!A.deviceInfoData||A.deviceInfoData&&!A.deviceInfoData.isEncrypt)&&(console.log("小窗口initMiniRec---------------设备未加密"),A.miniRecNum=0,A.initMiniRec())))}),1e3)}},{key:"setThemeData",value:function(A,e){this.themeData=A,"onCall"==e&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(A.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*e)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(A,e,t){console.log("编辑组件",A,e,t);var i=this.themeData;console.log("themeData",this.themeData);var n=this.themeData[t][this.bellStatus].btnList,a=Ft(n,(function(e){return e.iconId===A})),o=n[a];switch(e){case"delete":n[a].isrender=0;break;case"right":for(var r=-1,s=a+1;s
=0;c--)if(n[c].part===n[a].part&&1==n[c].isrender){g=c;break}-1!==g&&(n[a]=n[g],n[g]=o)}console.log("new btnList",n),i[t][this.bellStatus].btnList=n,this.jSPlugin.Theme.changeTheme(i)}},{key:"countTime",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='00:00',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===A){var n=e;document.getElementById(t.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++n,document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML=function(A){var e=parseInt(A),t=0,i=0,n="00",a="00",o="00";e>59&&(t=parseInt(e/60),e=parseInt(e%60),t>59&&(i=parseInt(t/60),t=parseInt(t%60)));return n=parseInt(e)>9?parseInt(e):"0"+parseInt(e),a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),o=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?o+":"+a+":"+n:t>0?a+":"+n:"00:"+n}(n)}),1e3)}else"destroy"===A&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(t.jSPlugin.id+"time-area")&&(document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(t.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(A){console.log("----------editStart1");var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),e&&e.setAttribute("class","footer-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(A){console.log("----------editEnd1");var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(A){var e=this;switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"miniRec":break;default:wi(this.jSPlugin,A,(function(A){0==A.meta.code&&A.data?(e.activeThemeStatus=!0,e.themeData=A.data,A.data.header&&(e.themeData.header=A.data.header,e.themeData.header[e.bellStatus].btnList=e.themeData.header[e.bellStatus].btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),A.data.footer&&(e.themeData.footer=A.data.footer,e.themeData.footer[e.bellStatus].btnList=e.themeData.footer[e.bellStatus].btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),e.jSPlugin.capacity?(e.initThemeData(),e.renderThemeData()):setTimeout((function(){e.initThemeData(),e.renderThemeData()}),300)):(e.activeThemeStatus=!1,e.jSPlugin.pluginStatus.loadingClear(),e.setDecoderState({rejection:!0}),"111021"==A.meta.code?(e.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff",type:1}),e.activeThemeStatusTxt="无效的模板id"):"111023"==A.meta.code?(e.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff",type:1}),e.activeThemeStatusTxt="试用特权已到期"):(e.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff",type:1}),e.activeThemeStatusTxt="模板未激活"),e.themeData=ji,e.initThemeData(),e.renderThemeData())}),(function(){e.renderThemeData()}))}}},{key:"getCallDeviceInfo",value:function(){var A=this;this.videoWidth,Ui({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:m(this.jSPlugin.url).deviceSerial}).then((function(e){e.data&&(A.deviceInfoData=e.data,e.data.isEncrypt&&(console.log("小窗口miniRecCloseClick------------设备已加密"),A.miniRecCloseClick(),setTimeout((function(){A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),1e3)),document.getElementById("header-".concat(A.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(A.bellStatus,"-deviceCategory")).innerText=""+e.data.deviceName))})).catch((function(e){console.log("获取设备信息失败",e),20018!=e.code||A.jSPlugin.isWebConsole||A.userNoDevice()}))}},{key:"setHeaderText",value:function(A){console.log("setHeaderText");var e=this.videoWidth/375||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='').concat(A,'').concat(this.deviceInfoData&&this.deviceInfoData.category||"",""))}}])}(),Xi=function(){return o((function A(e){if(t(this,A),this.jSPlugin=e,this.videoWidth=e.width,this.autoFocus=0,this.autoFocusTimer=null,this.decoderState={state:{isEditing:!1,play:!1,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,mute:!1,rejection:!1,cloudRec:"cloud.rec"===m(e.url).type,rec:"rec"===m(e.url).type,type:m(e.url).type}},console.log("matchEzopenUrl(jSPlugin.url)",m(e.url),this.decoderState.state),this.isMobile=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),void 0!==e.isMobile&&(this.isMobile=e.isMobile),this.themeData={},"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.jSPlugin.themeId)if(this.isMobile?this.call=new Zi(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState):this.call=new Hi(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState),"themeData"===this.jSPlugin.themeId)this.themeData=this.jSPlugin.params.themeData,this.call.initThemeData(),this.call.renderThemeData();else this.call.fetchThemeData(this.jSPlugin.themeId);this.jSPlugin.Talk||(this.jSPlugin.Talk=new Ii(this.jSPlugin)),E("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),E("".concat(this.jSPlugin.staticPath,"/css/theme.css"))}),[{key:"changeTheme",value:function(A){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"onBell";if("string"==typeof A)switch(this.jSPlugin.themeId=A,this.jSPlugin.themeId){case"pcLive":case"mobileCall":case"webCall":this.call.initThemeData(),this.call.renderThemeData();break;default:this.call.fetchThemeData(A)}else"object"===d(A)&&(this.themeData=A,this.call.setThemeData(A,t),this.call.initThemeData(),this.call.renderThemeData(),this.decoderState.state.isEditing&&e&&this.call.editStart());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(A)}},{key:"setDecoderState",value:function(A,e){var t=this,i=this.themeData;i.header,i.footer,Object.keys(A).map((function(i){if("mute"===i)document.getElementById("".concat(t.jSPlugin.id,"-icon-mute"))&&(console.log("mute"),A[i]?(document.getElementById("".concat(t.jSPlugin.id,"-icon-mute")).style.background=e,document.getElementById("".concat(t.jSPlugin.id,"-icon-mute")).style.border=" 1px solid ".concat(e),document.getElementById("icon-mute-path").style.fill="#ffffff"):(document.getElementById("".concat(t.jSPlugin.id,"-icon-mute")).style.background="#ffffff",document.getElementById("".concat(t.jSPlugin.id,"-icon-mute")).style.border="1px solid ".concat(e),document.getElementById("icon-mute-path").style.fill=e));t.decoderState.state=Object.assign(t.decoderState.state,A)}))}},{key:"startAutoFocus",value:function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(A.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*e)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"editIcon",value:function(A,e,t){console.log("编辑组件",A,e,t);var i=this.themeData;console.log("themeData",this.themeData);var n=this.themeData[t].btnList,a=Ft(n,(function(e){return e.iconId===A})),o=n[a];switch(e){case"delete":if("rec"===A){if(-1===Ft(n,(function(A){return"cloudRec"===A.iconId&&1==A.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===A&&-1===Ft(n,(function(A){return"rec"===A.iconId&&1==A.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1;n[a].isrender=0;break;case"right":for(var r=-1,s=a+1;s=0;c--)if(n[c].part===n[a].part&&1==n[c].isrender){g=c;break}-1!==g&&(n[a]=n[g],n[g]=o)}console.log("new btnList",n),i[t].btnList=n,this.changeTheme(i)}},{key:"countTime",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='00:00',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===A){var n=e;document.getElementById(t.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++n,document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML=function(A){var e=parseInt(A),t=0,i=0,n="00",a="00",o="00";e>59&&(t=parseInt(e/60),e=parseInt(e%60),t>59&&(i=parseInt(t/60),t=parseInt(t%60)));return n=parseInt(e)>9?parseInt(e):"0"+parseInt(e),a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),o=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?o+":"+a+":"+n:t>0?a+":"+n:"00:"+n}(n)}),1e3)}else"destroy"===A&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(t.jSPlugin.id+"time-area")&&(document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(t.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));i&&i.setAttribute("class","header-controls themeEditing"),e&&e.setAttribute("class","footer-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})}},{key:"setDisabled",value:function(A){}},{key:"getDeviceInfo",value:function(){var A=this,e=this.videoWidth/1024||1;Ui({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:m(this.jSPlugin.url).deviceSerial}).then((function(t){200==t.code&&t.data&&document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).style.maxWidth="100%",document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).style.overflow="hidden",document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).style.textOverflow="ellipsis",document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).style.whiteSpace="nowrap",document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).innerHTML='有人按门铃').concat(t.data.category,""))})).catch((function(A){console.log("获取设备信息失败",A)}))}}])}(),qi=function(){return o((function A(e){t(this,A),this.jSPlugin=e;var i=window["EZUIKIT_TIMER_INTERVAL_".concat(e.id)];i&&Object.keys(i).length>0&&this.resetTimer(),window["EZUIKIT_TIMER_INTERVAL_".concat(e.id)]={}}),[{key:"createInterval",value:function(A,e,t){window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)][A]=setInterval(e,t)}},{key:"clearTimer",value:function(A){var e=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];e[A]&&(clearInterval(e[A]),delete e[A])}},{key:"resetTimer",value:function(){var A=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];for(var e in A)clearInterval(A[e]),delete A[e]}}])}(),zi=o((function A(e){var i=this;t(this,A),s(this,"initMap",(function(){var A=i,e=i.videoWidth,t=i.videoHeight;if(document.getElementById("".concat(i.jSPlugin.id,"-miniRecbox")))document.getElementById("".concat(i.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-miniRecbox"))),i.initMap();else{var n=document.createElement("div");n.id="".concat(i.jSPlugin.id,"-miniRecbox"),n.style=";position: absolute; bottom:96px;right:".concat(i.jSPlugin.inspectVideoWidth,"px;"),n.innerHTML=''),document.getElementById("".concat(i.jSPlugin.id,"-wrap")).insertBefore(n,document.getElementById("".concat(i.jSPlugin.id,"-ez-iframe-footer-container"))),A.map=A.loadMap("".concat(i.jSPlugin.id,"-mapbox"))}return A.map})),s(this,"loadMap",(function(A){var e=new BMapGL.Map(A);return e.centerAndZoom(new BMapGL.Point(116.297611,40.047363),15),e.enableScrollWheelZoom(!0),e})),s(this,"createCircle",(function(A,e,t,n){var a=new BMapGL.Point(A,e),o=new BMapGL.Marker(a,{title:n});if(i.map.addOverlay(o),0!=t){var r=new BMapGL.Circle(new BMapGL.Point(A,e),t,{strokeColor:"#ff4d4f",strokeWeight:4,strokeOpacity:1,strokeStyle:"dashed",fillOpacity:0});i.map.addOverlay(r)}})),s(this,"createInspectPoints",(function(A){A.map((function(A){i.createCircle(A.longitude,A.latitude,A.radius,A.inspectPointName)}))})),s(this,"createPolygon",(function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#407AFF",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"solid",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"407AFF",r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=[];A.split(";").map((function(A){var e=A.split(",");s.push(new BMapGL.Point(e[0],e[1]))})),i.inspectRange=new BMapGL.Polygon(s,{strokeColor:e,strokeWeight:n,strokeOpacity:a,strokeStyle:t,fillOpacity:r,fillColor:o}),i.map.addOverlay(i.inspectRange)})),s(this,"createTrack",(function(A){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#18C796",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"solid",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,g=arguments.length>8&&void 0!==arguments[8]?arguments[8]:500,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]&&arguments[10],I=[];if(A.map((function(A){var e=!1;i.currentTrack.length>0&&i.currentTrack.map((function(t){t.longitude===A.longitude&&t.latitude===A.latitude&&t.reportTime===A.reportTime&&(e=!0)})),e||(0==I.length&&i.currentTrack.length>0&&I.push(new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude)),I.push(new BMapGL.Point(A.longitude,A.latitude)))})),0!=I.length){var C=new BMapGL.Polyline(I,{strokeColor:t,strokeWeight:a,strokeOpacity:o,strokeStyle:n,fillOpacity:r});if(e?(i.map.addOverlay(C),i.map.centerAndZoom(I[I.length-1],15)):(i.trackAni=new BMapGLLib.TrackAnimation(i.map,C,{overallView:l,tilt:s,duration:g,delay:c}),i.trackAni.start()),i.currentTrack=A,i.currentTrack.length>0&&i.currentTrack.length>0){var d=new BMapGL.Point(i.currentTrack[0].longitude,i.currentTrack[0].latitude);if(i.startPoint=new BMapGL.Marker(d,{icon:new BMapGL.Icon("".concat(i.jSPlugin.staticPath,"/imgs/start.png"),new BMapGL.Size(32,47)),offset:new BMapGL.Size(0,-17)}),i.map.addOverlay(i.startPoint),1==i.currentTrack.length)return;var h=new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude);i.endPoint&&i.map.removeOverlay(i.endPoint),setTimeout((function(){i.endPoint=new BMapGL.Marker(h,{icon:new BMapGL.Icon("".concat(i.jSPlugin.staticPath,"/imgs/end.png"),new BMapGL.Size(30,30))}),i.map.addOverlay(i.endPoint)}),e?0:g)}}})),s(this,"centerToTrack",(function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;i.currentTrack.length>0&&(1==i.currentTrack.length?i.map.centerAndZoom(new BMapGL.Point(i.currentTrack[0].longitude,i.currentTrack[0].latitude),A):i.map.centerAndZoom(new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude),A))})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.toastCustom=new ki(e,!1),this.currentTrack=[],this.startPoint=null,this.endPoint=null,this.trackAni=null,this.inspectRange=null,this.map=this.initMap()})),$i=o((function A(e){var i=this;t(this,A),s(this,"init",(function(){var A=i;if(i.videoWidth,i.videoHeight,document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")))document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box"))&&document.getElementById("".concat(i.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box"))),A.init();else{var e=document.createElement("div");e.id="".concat(i.jSPlugin.id,"-inspect-global-box"),e.style=";position: absolute; left:0; top: 0; width: 100%; height: 100%; z-index: 10000; background: #fff;",e.innerHTML='\n '),document.getElementById("".concat(i.jSPlugin.id,"-wrap")).appendChild(e)}})),s(this,"deviceErrorInfo",(function(A,e){var t=Object.assign({tips:"",refreshBtn:"",refreshShow:!1},A);if(document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box")))document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box"))&&document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box"))),i.deviceErrorInfo(A,e);else{i.videoHeight;var n=document.createElement("div");n.id="".concat(i.jSPlugin.id,"-no-inspect-box"),n.style="width:100%;height:100%; background: #ffffff; display: flex; justify-content: center; align-items: center",n.innerHTML='\n
\n
'.concat(t.tips,'
\n
\n
\n "),document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")).appendChild(n),document.getElementById("".concat(i.jSPlugin.id,"-inspect-device-status-refresh")).addEventListener("click",(function(){e&&e()}))}})),s(this,"globalContainerToggle",(function(A,e){document.getElementById(A)&&(document.getElementById(A).style.display=e?"flex":"none")})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.toastCustom=new ki(e,!1),this.init()})),An=function(){return o((function A(e){t(this,A),this.timer=null;var i={wrapNode:document.body,time:2e3,content:"",type:"info",center:!1,top:8};this.params=c(c({},i),e),this.init()}),[{key:"init",value:function(){var A=this;this.timer=null;var e=this.params,t=e.wrapNode,i=e.content,n=e.time,a=e.type,o=e.center,r=e.top;this.wrapNode=t;var s=document.createElement("div");s.setAttribute("class","ezuikit-message"),o?s.setAttribute("style","top: 50%; transform: translateY(-50%);"):s.setAttribute("style","top: ".concat(r||0,"px;")),this.wrapNode.appendChild(s),this.initMessageContent(a,i,s),0!==n&&(this.timer=setTimeout((function(){A.wrapNode.removeChild(s)}),n||2e3))}},{key:"initMessageContent",value:function(A,e,t){var i=document.createElement("div");i.setAttribute("class","ezuikit-message-notice"),i.innerHTML='\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t').concat("warning"===A?'':"","\n\t\t\t\t\t\t").concat("info"===A?'':"","\n\t\t\t\t\t\t").concat("error"===A?'':"","\n\t\t\t\t\t\t").concat("success"===A?'':"","\n\t\t\t\t\t\n\t\t\t\t\t
").concat(e,"\n\t\t\t\t
\n\t\t\t
\n\t\t\t"),t.appendChild(i)}}])}(),en=function(){return o((function A(e){t(this,A),this.params=c(c({},{id:"",width:"100%",height:"100%",preview:!0,showIcon:!0,src:"",alt:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png"}),e),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var A=this.params,e=A.id,t=A.width,i=A.height,n=A.preview;if(document.getElementById(e)){var a=document.createElement("div");a.setAttribute("class","ezuikit-image"),a.setAttribute("style","width:".concat(t,";height:").concat(i,";")),document.getElementById(e).appendChild(a),this.initImage(a),n&&this.initPreview(a)}}},{key:"previewImg",value:function(){var A=this.params,e=A.src,t=A.alt,i=A.fallback,n=document.createElement("div");n.setAttribute("id",this.id+"-preview"),n.setAttribute("class","ezuikit-image-preview"),n.innerHTML='\n\t\t\t\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t');var a=document.createElement("img");a.setAttribute("class","ezuikit-image-preview-img"),a.setAttribute("alt",t),a.setAttribute("src",e),a.addEventListener("error",(function(){a.setAttribute("src",i)})),document.body.appendChild(n),n.querySelector(".ezuikit-image-preview-img-main").appendChild(a),document.getElementById(this.id+"-ezuikit-image-preview-operations").addEventListener("click",(function(){document.body.removeChild(n)}))}},{key:"initImage",value:function(A){var e=this.params,t=e.src,i=e.alt,n=e.fallback,a=document.createElement("img");a.setAttribute("class","ezuikit-image-img"),a.setAttribute("alt",i),a.setAttribute("src",t),a.addEventListener("error",(function(){a.setAttribute("src",n)})),A.appendChild(a)}},{key:"initPreview",value:function(A){var e=this,t=this.params.showIcon,i=document.createElement("div");i.setAttribute("class","ezuikit-image-mask"),t&&(i.innerHTML='\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t预览\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t'),A.appendChild(i),A.onclick=function(){e.previewImg()}}}])}(),tn=function(){return o((function A(e){t(this,A),this.params=c(c({},{id:"",parentNodeId:"",title:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),e),this.initState=!1,this.init(e)}),[{key:"init",value:function(){var A=this,e=this.params,t=e.id,i=e.content,n=e.placement,a=e.title,o=document.getElementById(t);if(o){var r=document.createElement("div");if(r.setAttribute("id",t+"-popover"),r.setAttribute("class","ezuikit-popover"),r.setAttribute("style","display:none;"),r.innerHTML='\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t'.concat(a?'
'.concat(a,"
"):"",'\n\t\t\t\t\t\t
').concat(i,"
\n\t\t\t\t\t
\n\t\t\t\t"),!document.getElementById(t+"-popover")){var s=document.body;this.params.parentNodeId&&(s=document.getElementById(this.params.parentNodeId)),s.appendChild(r),this.renderPopover(r,o,n)}document.body.addEventListener("click",(function(e){A.addEventListenerFn(e)}))}}},{key:"addEventListenerFn",value:function(A){var e=this.params.id,t=document.getElementById(e),i=document.getElementById(e+"-popover");t&&A.target!==t&&!t.contains(A.target)&&i&&A.target!==i&&!i.contains(A.target)&&this.hidePopover()}},{key:"hidePopover",value:function(){var A=this.params.id,e=document.getElementById(A+"-popover");e&&document.body.removeChild(e)}},{key:"renderPopover",value:function(A,e,t,i,n){A.style.display="block";var a=e.getBoundingClientRect(),o=a.top,r=a.left,s=a.width,g=a.height,c=A.getBoundingClientRect(),l=c.width,I=c.height;i&&(l=i),n&&(I=n);var C=document.body;this.params.parentNodeId&&(C=document.getElementById(this.params.parentNodeId));var d=this.params.arrowPointAtCenter,h=0,B=0,u=A.getElementsByClassName("ezuikit-popover-arrow")[0],E=u.getBoundingClientRect(),f=E.width,Q=E.height;if(d){var x=0,p=0;switch(t){case"top":default:x=l/2,p=I;break;case"bottom":x=l/2,p=0;break;case"left":x=l,p=I/2;break;case"right":x=0,p=I/2;break;case"topLeft":x=(s-f)/2,p=I;break;case"topRight":x=l-(s+f)/2,p=I;break;case"bottomLeft":x=(s-f)/2,p=0;break;case"bottomRight":x=l-(s+f)/2,p=0;break;case"leftTop":x=l,p=(g-Q)/2;break;case"leftBottom":x=l,p=I-(g+Q)/2;break;case"rightTop":x=0,p=(g-10)/2;break;case"rightBottom":x=0,p=I-(g+Q)/2}u.style.left=x+"px",u.style.top=p+"px"}switch(t){case"top":h=-(I+Q),B=(s-l)/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top");break;case"bottom":h=g-Q/2,B=(s-l)/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottom");break;case"left":h=(g-I)/2,B=-(l+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-left");break;case"right":h=(g-I)/2,B=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-right");break;case"topLeft":h=-(I+Q),B=0,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topLeft");break;case"topRight":h=-(I+Q),B=s-l,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topRight");break;case"bottomLeft":h=g-Q/2,B=0,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomLeft");break;case"bottomRight":h=g-Q/2,B=s-l,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomRight");break;case"leftTop":h=0,B=-(l+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftTop");break;case"leftBottom":h=g-I,B=-(l+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftBottom");break;case"rightTop":h=0,B=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightTop");break;case"rightBottom":h=g-I,B=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightBottom");break;default:h=-I,B=(s-l)/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top")}var m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft;A.style.top=o+m+h+"px",A.style.left=r+y+B+"px";var _=A.getBoundingClientRect(),S=C===document.body?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:C.getBoundingClientRect(),D=t;_.leftS.right&&(D=(D=D.replace("Left","Right")).replace("left","right")),_.topS.bottom&&(D=(D=D.replace("Bottom","Top")).replace("bottom","top")),D!==t&&this.renderPopover(A,e,D,l,I)}}])}(),nn=function(){return o((function A(e){t(this,A),this.params=c(c({},{id:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),e),this.PopconfirmDom=null,this.init(e)}),[{key:"init",value:function(){var A=this,e=this.params,t=e.content,i=e.cancelText,n=e.okText,a=e.onCancel,o=e.onConfirm,r=document.createElement("div");r.innerHTML='\n \n
\n\t\t\t\t\t
\n \t\n \n\t\t\t\t\t
'.concat(t,'\n
\n
\n
\n ');var s=document.createElement("button");s.className="ezuikit-btn ezuikit-cancel-btn",s.innerText=i;var g=document.createElement("button");return g.className="ezuikit-btn ezuikit-ok-btn ezuikit-btn-primary",g.innerText=n,r.querySelector(".ezuikit-popover-buttons").appendChild(s),r.querySelector(".ezuikit-popover-buttons").appendChild(g),this.PopconfirmDom=new tn(c(c({},this.params),{},{content:r.innerHTML})),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn").onclick=function(){a?a():A.hide()}),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn").onclick=function(){o?o():A.hide()}),this.PopconfirmDom}},{key:"hide",value:function(){this.PopconfirmDom.hidePopover()}}])}(),an=function(){return o((function A(e){t(this,A),this.params=c(c({},{id:"",width:"100%",height:"100%",preview:!0,poster:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png",src:""}),e),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var A=this.params,e=A.id,t=A.width,i=A.height,n=A.preview;if(document.getElementById(e)){var a=document.createElement("div");a.setAttribute("class","ezuikit-video"),a.setAttribute("style","width:".concat(t,";height:").concat(i,";")),document.getElementById(e).appendChild(a),this.initVideo(a),n&&this.initPreview(a)}}},{key:"previewVideo",value:function(){var A=this.params.src,e=document.createElement("div");e.setAttribute("id",this.id+"-preview"),e.setAttribute("class","ezuikit-image-video"),e.innerHTML='\n\t\t\t\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t'),document.body.appendChild(e),document.getElementById(this.id+"-ezuikit-video-preview-operations").addEventListener("click",(function(){document.body.removeChild(e)}))}},{key:"initVideo",value:function(A){var e=this.params,t=e.poster,i=e.fallback,n=document.createElement("img");n.setAttribute("class","ezuikit-video-img"),n.setAttribute("src",t),n.addEventListener("error",(function(){n.setAttribute("src",i)})),A.appendChild(n)}},{key:"initPreview",value:function(A){var e=this,t=document.createElement("div");t.setAttribute("class","ezuikit-video-mask"),t.innerHTML='\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t',A.appendChild(t),A.onclick=function(){e.previewVideo()}}}])}(),on=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:e,page:0},a="".concat(A.env.domain,"/api/service/devicekit/bodycamera/device/trace");Pi(a,"GET",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},rn=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:m(A.url).deviceSerial,validateCode:m(A.url).validCode,channelNo:m(A.url).channelNo,evidenceFileType:e},a="".concat(A.env.domain,"/api/service/devicekit/common/file/evidence");Pi(a,"POST",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},sn=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,taskId:e},a="".concat(A.env.domain,"/api/service/devicekit/opencloud/task/info");Pi(a,"GET",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})};var gn=function(){return o((function A(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};t(this,A),this.jSPlugin=e,this.currentEventInfo=i,this.inspectInfo=e.Theme.inspect.inspectInfo,this.type=a,this.timer=n,this.startTime=1e3,this.videoRecordingStatus=!0,this.saveSuccessCallback=o,this.init()}),[{key:"init",value:function(){this.renderEventDetail(),this.eventDetailDomEvent()}},{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap show")}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).innerHTML=""}},{key:"validationEventTag",value:function(){return 0==document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).value.length?(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="block",document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).innerHTML="请输入事件标签",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input input-has-error"),!1):(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input"),!0)}},{key:"renderVideo",value:function(A,e,t){var i=this;if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML="",1===A||2===A){if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n \n '),1!==this.type){var n=this.currentEventInfo.evidenceId;this.timer.clearTimer("videoRecordingStatusTimer"),this.timer.createInterval("videoRecordingStatusTimer",(function(){sn(i.jSPlugin,n,(function(A){if(A.meta&&200===A.meta.code){var e=A.data,t=e.taskStatus,n=e.fileUrl,a=e.videoCoverPic||"".concat(i.jSPlugin.staticPath,"/imgs/bg.svg");i.renderVideo(t,a,n)}}))}),1e3)}}else 4===A||5===A||6===A||7===A?(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n \n '),this.timer.clearTimer("videoRecordingStatusTimer")):0!==A&&3!==A||(new an({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview"),poster:e,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),src:t}),this.timer.clearTimer("videoRecordingStatusTimer"))}},{key:"renderEventDetail",value:function(){var A=this,e=this.currentEventInfo,t=e.evidenceFileType,i=e.fileUrl,n=e.taskStatus,a=e.videoCoverPic,o=document.createElement("div");o.setAttribute("class","inspectEventDetail");var r="";if(r=1===t?a||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"):i||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),o.innerHTML='\n \n \n ').concat(0===t?'
'):'
'),'\n
\n
\n
\n
存证人员:
\n
\n ').concat(1===this.type?this.currentEventInfo.depositaryOfficer?"null"===this.currentEventInfo.depositaryOfficer?"-":this.currentEventInfo.depositaryOfficer:"-":this.inspectInfo.inspectPerson?"null"===this.inspectInfo.inspectPerson?"-":this.inspectInfo.inspectPerson:"-",'\n
\n
\n
\n
\n
\n
\n \n '),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).appendChild(o),1===this.type?document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(1===t?this.currentEventInfo.eventBeginTime+" ~ "+this.currentEventInfo.eventEndTime:this.currentEventInfo.eventTime):(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat((new Date).Format("yyyy-MM-dd hh:mm:ss")).concat(1===t?" ~ -":""),1===t&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-time"))&&this.videoRecordingStatus&&(0===this.type&&document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).setAttribute("disabled","disabled"),this.timer.createInterval("videoRecordingTimer",(function(){var e,t,i,n;A.startTime&&(document.getElementById("".concat(A.jSPlugin.id,"-video-recording-time")).innerHTML=(e=A.startTime,t=parseInt(e%864e5/36e5),i=parseInt(e%36e5/6e4),n=parseInt(e%6e4/1e3),(t<10?"0".concat(t):t)+":"+(i<10?"0".concat(i):i)+":"+(n<10?"0".concat(n):n))),A.startTime+=1e3,A.startTime>A.jSPlugin.inspectRecordingDuration&&(document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).click(),A.timer&&A.timer.clearTimer("videoRecordingTimer"))}),1e3))),1===t){var s=this.currentEventInfo&&this.currentEventInfo.fileUrl;this.renderVideo(n,r,s)}else new en({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-picUrl"),src:r,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/fallback.svg"),showIcon:!1});this.show()}},{key:"eventDetailDomEvent",value:function(){var A=this,e=this.currentEventInfo,t=e.evidenceFileType,i=e.evidenceId;document.getElementById("".concat(this.jSPlugin.id,"-event-cancel")).addEventListener("click",(function(e){A.cancelPopover=new nn({id:"".concat(A.jSPlugin.id,"-event-cancel"),content:"确定要取消吗?".concat(1===A.type?"取消后编辑的内容将不会保存。":"取消后对应存证也将删除。"),placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){A.cancelPopover.hide()},onConfirm:function(){1===t&&(A.videoRecordingStatus&&0===A.type&&(A.timer&&A.timer.clearTimer("videoRecordingTimer"),A.startTime=1e3,document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).click()),A.timer.clearTimer("videoRecordingStatusTimer")),A.cancelPopover.hide(),A.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).addEventListener("click",(function(){if(A.validationEventTag()){var e=A.currentEventInfo,t=e.evidenceFileType,i=e.evidenceId,n=A.inspectInfo,a=n.inspectRecordId,o=n.inspectPerson,r=document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML,s={inspectRecordId:a,depositaryOfficer:o,evidenceFileId:i,evidenceFileType:t,eventType:document.getElementById("".concat(A.jSPlugin.id,"-event-tag")).value,eventRemark:document.getElementById("".concat(A.jSPlugin.id,"-event-remark")).value};1===t&&(s.eventBeginTime=r.split("~")[0].trim(),s.eventEndTime=r.split("~")[1].trim(),A.timer.clearTimer("videoRecordingStatusTimer")),0===t&&(s.eventTime=r),1===A.type&&(s.inspectEventId=A.currentEventInfo.inspectEventId,delete s.depositaryOfficer,delete s.eventTime,delete s.eventBeginTime,delete s.eventEndTime,delete s.evidenceFileId,delete s.evidenceFileType,function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:"",inspectEventId:"",eventType:"",eventRemark:""},a=Object.assign(n,e),o="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/event/update");Pi(o,"POST",a,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(A.jSPlugin,s,(function(e){e.meta&&200===e.meta.code?(A.hide(),A.saveSuccessCallback&&A.saveSuccessCallback({eventType:s.eventType,eventRemark:s.eventRemark})):new An({type:"error",content:"保存失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new An({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}))),0===A.type&&function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:"",eventType:"",evidenceFileId:"",eventTime:"",eventBeginTime:"",eventEndTime:"",depositaryOfficer:"",eventRemark:"",evidenceFileType:""},a=Object.assign(n,e),o="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/event");Pi(o,"POST",a,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(A.jSPlugin,s,(function(e){e.meta&&200===e.meta.code?(A.hide(),A.saveSuccessCallback&&A.saveSuccessCallback()):new An({type:"error",content:"保存失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new An({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}))}})),document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-back")).addEventListener("click",(function(){A.backPopover=new nn({id:"".concat(A.jSPlugin.id,"-inspectEventDetail-back"),content:"确定要返回吗?".concat(1===A.type?"返回后编辑的内容将不会保存。":"返回后对应存证也将删除。"),placement:"bottomRight",arrowPointAtCenter:!0,onCancel:function(){A.backPopover.hide()},onConfirm:function(){1===t&&(A.videoRecordingStatus&&0===A.type&&(A.timer&&A.timer.clearTimer("videoRecordingTimer"),A.startTime=1e3,document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).click()),A.timer.clearTimer("videoRecordingStatusTimer")),A.backPopover.hide(),A.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn"))&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn")).addEventListener("click",(function(){document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn ezuikit-btn-loading"),document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,taskId:e},a="".concat(A.env.domain,"/api/v3/open/cloud/video/frame/stop");Pi(a,"POST",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(A.jSPlugin,i,(function(e){document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),e.meta&&200===e.meta.code?sn(A.jSPlugin,i,(function(e){if(e.meta&&200===e.meta.code){var t=e.data,i=t.taskStatus,n=t.fileUrl,a=t.videoCoverPic;A.timer&&A.timer.clearTimer("videoRecordingTimer");var o=a||"".concat(A.jSPlugin.staticPath,"/imgs/bg.svg");A.renderVideo(i,o,n),document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-video-info")).style.display="block",document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-video-timer")).style.display="none";var r=document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML;document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(r.split("~")[0]," ~ ").concat((new Date).Format("yyyy-MM-dd hh:mm:ss")),A.videoRecordingStatus=!1,document.getElementById("".concat(A.jSPlugin.id,"-event-ok")).removeAttribute("disabled")}})):new An({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),new An({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}))})),document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).addEventListener("input",(function(){A.validationEventTag()})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("input",(function(A){var e=A.target.value;A.target.parentNode.setAttribute("data-count","".concat(e.length," / 100"))})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("focus",(function(A){A.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count ezuikit-input-textarea-focus")})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("blur",(function(A){A.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count")}))}}])}(),cn=function(){return o((function A(e,i,n){var a=this;t(this,A),s(this,"hideDelEConfirm",(function(){for(var A=0;A\n 巡检事件
\n \n
\n
\n
\n
\n
\n
\n \n \n
\n
暂无事件
\n
\n \n \n '),document.getElementById("".concat(a.jSPlugin.id,"-wrap")).appendChild(e),a.jSPlugin.Theme.decoderState.state.play?a.enableEvidenceBtn():a.disableEvidenceBtn(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).onclick=function(){a.listLoading||a.startEvidence||(a.startEvidence=!0,a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",rn(a.jSPlugin,0,(function(A){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",A.meta&&200===A.meta.code?new gn(a.jSPlugin,A.data,a.timer,0,(function(){a.initEvent(),new An({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})):new An({type:"error",content:"图片存证失败,".concat(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new An({type:"error",content:"图片存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).onclick=function(){a.listLoading||a.startEvidence||(a.startEvidence=!0,a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",rn(a.jSPlugin,1,(function(A){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",A.meta&&200===A.meta.code?new gn(a.jSPlugin,A.data,a.timer,0,(function(){a.initEvent(),new An({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})):new An({type:"error",content:"视频存证失败,".concat(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new An({type:"error",content:"视频存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-refresh")).onclick=function(){a.listLoading||a.startEvidence||(a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-loading")).style.display="block",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none",A.initEvent())}}})),s(this,"renderList",(function(A){document.getElementById("".concat(a.jSPlugin.id,"-inspect-loading")).style.display="none";var e=A.data||[];if(e.length>0){document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).style.display="block",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none";for(var t=function(){var t=document.createElement("div");t.setAttribute("class","inspect-event-item");var n=e[i];t.setAttribute("id","".concat(a.jSPlugin.id,"-inspect-event-item-").concat(n.inspectEventId)),t.innerHTML="",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap-main")).appendChild(t);var o,r=document.createElement("div");r.setAttribute("class","inspect-event-item-header-wrap"),1==n.evidenceFileType&&(o="".concat(n.eventBeginTime.split(" ")[1],"~").concat(n.eventEndTime.split(" ")[1])),0==n.evidenceFileType&&(o="".concat(n.eventTime.split(" ")[1]));var s="";1===n.evidenceFileType&&(1===n.taskStatus||2===n.taskStatus?s="storage":4===n.taskStatus||5===n.taskStatus||6===n.taskStatus||7===n.taskStatus?s="storage-error":0!==n.taskStatus&&3!==n.taskStatus||(s="storage-success")),r.innerHTML='\n \n '),t.appendChild(r),r.onclick=function(A){"none"===r.querySelector(".inspect-event-item-header-toggle-up").style.display?(r.querySelector(".inspect-event-item-header-toggle-up").style.display="block",r.querySelector(".inspect-event-item-header-toggle-down").style.display="none",t.querySelector(".inspect-event-item-body").style.display="block"):(r.querySelector(".inspect-event-item-header-toggle-up").style.display="none",r.querySelector(".inspect-event-item-header-toggle-down").style.display="block",t.querySelector(".inspect-event-item-body").style.display="none")};var g=document.createElement("div");g.setAttribute("class","inspect-event-item-body"),g.style.display="none";var c=(1===n.evidenceFileType?n.videoCoverPic:n.fileUrl)||"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg");g.innerHTML='\n
\n "),t.appendChild(g),1==n.evidenceFileType&&(1===n.taskStatus||2===n.taskStatus?document.getElementById("".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId)).innerHTML='\n
\n '):4===n.taskStatus?document.getElementById("".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId)).innerHTML='\n
\n '):0!==n.taskStatus&&3!==n.taskStatus||new an({id:"".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId),src:n.fileUrl,poster:c,fallback:"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg")})),0==n.evidenceFileType&&new en({id:"".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId),src:c,fallback:"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg"),showIcon:!1});var l=document.createElement("div");l.setAttribute("class","inspect-event-item-body-info-opr");var I=document.createElement("span");I.setAttribute("class","inspect-event-item-body-info-opr-icon"),I.innerHTML='\n
\n ',l.appendChild(I);var C=document.createElement("span");C.setAttribute("class","inspect-event-item-body-info-opr-icon"),C.id="".concat(a.jSPlugin.id,"-inspect-event-del-").concat(n.inspectEventId),C.innerHTML=' \n
\n ',l.appendChild(C),I.onclick=function(A){a.startEvidence||new gn(a.jSPlugin,n,a.timer,1,(function(A){new An({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40}),n=Object.assign(n,A),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-item-").concat(n.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").innerHTML=n.eventType,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-item-").concat(n.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").setAttribute("title",n.eventType)}))},C.onclick=function(A){a.startEvidence||(a.delE=new nn({id:"".concat(a.jSPlugin.id,"-inspect-event-del-").concat(n.inspectEventId),content:"确定要删除该事件吗?",placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){a.delE.hide()},onConfirm:function(){!function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectEventId:""},a=Object.assign(n,e),o="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/event/delete");Pi(o,"POST",a,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(a.jSPlugin,{inspectEventId:n.inspectEventId},(function(A){A.meta&&200===A.meta.code?(a.delE.hide(),a.initEvent(),setTimeout((function(){new An({type:"success",content:"删除成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),10)):new An({type:"error",content:"删除失败,".concat(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new An({type:"error",content:"删除失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}))}}),a.delEConfirmList.push(a.delE))},t.querySelector(".inspect-event-item-body-info").appendChild(l),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).onscroll=function(e){var t=e.target;a.hideDelEConfirm(),t.scrollTop+t.offsetHeight>=t.scrollHeight-48&&!a.listLoading&&(A.start+1)*A.size