From ba8eb55215c1bc1e17229fc9fad77f39210e23ca Mon Sep 17 00:00:00 2001 From: ShineShao Date: Tue, 17 Dec 2024 19:20:14 +0800 Subject: [PATCH] demo: update v8.1.2 --- demos/nginx-demo/html/ezuikit.js | 16 +++--- .../html/ezuikit_static/css/theme.css | 49 ++++++++++++++----- .../html/ezuikit_static/speed/speed.css | 29 +++++------ .../html/ezuikit_static/talk/janus.js | 4 +- .../html/ezuikit_static/talk/tts-v4.js | 2 +- 5 files changed, 62 insertions(+), 38 deletions(-) diff --git a/demos/nginx-demo/html/ezuikit.js b/demos/nginx-demo/html/ezuikit.js index 190a600..2c05440 100644 --- a/demos/nginx-demo/html/ezuikit.js +++ b/demos/nginx-demo/html/ezuikit.js @@ -1,11 +1,11 @@ /* * -* ezuikit.js v8.1.2-alpha.1 -* Copyright (c) 2024-11-19 Ezviz-OpenBiz +* ezuikit.js v8.1.2 +* Copyright (c) 2024-12-16 Ezviz-OpenBiz * Released under ISC the License. * */ -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A="undefined"!=typeof globalThis?globalThis:A||self).EZUIKit=e()}(this,(function(){"use strict";function A(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,i=Array(e);t=A.length?{done:!0}:{done:!1,value:A[i++]}},e:function(A){throw A},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,r=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return o=A.done,A},e:function(A){r=!0,a=A},f:function(){try{o||null==t.return||t.return()}finally{if(r)throw a}}}}function s(A,e,t){return(e=C(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function g(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable}))),t.push.apply(t,i)}return t}function c(A){for(var e=1;e=0;--a){var o=this.tryEntries[a],r=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),g=i.call(o,"finallyLoc");if(s&&g){if(this.prev=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),b(t),u}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var i=t.completion;if("throw"===i.type){var n=i.arg;b(t)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:R(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=A),u}},e}function I(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(A){var e=function(A,e){if("object"!=typeof A||!A)return A;var t=A[Symbol.toPrimitive];if(void 0!==t){var i=t.call(A,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(A)}(A,"string");return"symbol"==typeof e?e:e+""}function d(A){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},d(A)}function h(e,t){if(e){if("string"==typeof e)return A(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?A(e,t):void 0}}var B=function(){return o((function A(e,i){t(this,A),this.coreX=e,this.coreY=i}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}}])}();Date.prototype.Format=function(A){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var t in/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+t+")").test(A)&&(A=A.replace(RegExp.$1,1==RegExp.$1.length?e[t]:("00"+e[t]).substr((""+e[t]).length)));return A};var u=function(A,e,t,i){var n=document.getElementsByTagName("head")[0].getElementsByTagName("script"),a=!1;if(t)a=t();else for(var o=0;o3){var t=e[1],i=e[2],n="1"===e[3],a="live";return A.indexOf("rec=local")>-1?a="rec":A.indexOf("rec=cloud")>-1&&(a="cloud.rec"),{deviceSerial:t,channelNo:i,hd:n,type:a}}return{}};var _=function(A,e,t,i,n,a){var o=A,r=new XMLHttpRequest;r.onreadystatechange=function(){if(4==r.readyState&&200==r.status)if(function(A){if("string"==typeof A)try{var e=JSON.parse(A);return!("object"!==d(e)||!e)}catch(A){return!1}console.log("It is not a string!")}(r.responseText)){var A=JSON.parse(r.responseText);n(A)}else n(r.responseText)},r.open(e,o,!0);var s=new FormData;for(var g in t)s.append(g,t[g]);if(i&&"object"===d(i))for(var g in i)r.setRequestHeader(g,i[g]);r.send(s)},S=function(){return!!window&&navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i)},D=function(){return o((function A(e,i){var n=this;t(this,A),u("https://open.ys7.com/assets/ezuikit_v3.4/js/hls.js",(function(){console.log("加载hls.min.js成功",window.Hls),console.log("isSupportHls",window.Hls.isSupported()),window.Hls.isSupported()&&n.initHLS(e,i)}),(function(){return!!window.Hls}))}),[{key:"toString",value:function(){return"hls ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initHLS",value:function(A,e){var t=y(e),i=t.deviceSerial,n=t.channelNo;t.hd,window.ezuikitMonitor.report({protocol:"hls",url:e,serial:i,no:n,action:1});var a=document.getElementById(A),o=new window.Hls({defaultAudioCodec:"mp4a.40.2"});o.loadSource(e),o.attachMedia(a),o.on(window.Hls.Events.MANIFEST_PARSED,(function(){a.play()})),o.on(window.Hls.Events.ERROR,(function(A,e){if(e.fatal)switch(e.type){case window.Hls.ErrorTypes.NETWORK_ERROR:console.log("fatal network error encountered, try to recover"),o.startLoad();break;case window.Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),o.recoverMediaError();break;default:o.destroy()}})),this.hls=o,this.video=a,this.hlsUrl=e}},{key:"play",value:function(){console.log("执行hls播放",this.video),this.hls.startLoad(),this.video.play()}},{key:"stop",value:function(){this.video.pause(),this.hls.stopLoad()}}])}(),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function b(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var F={exports:{}};!function(A){!function(e,t){A.exports=t()}(globalThis,(()=>(()=>{var A={343:A=>{var e=Object.prototype.hasOwnProperty,t="~";function i(){}function n(A,e,t){this.fn=A,this.context=e,this.once=t||!1}function a(A,e,i,a,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var r=new n(i,a||A,o),s=t?t+e:e;return A._events[s]?A._events[s].fn?A._events[s]=[A._events[s],r]:A._events[s].push(r):(A._events[s]=r,A._eventsCount++),A}function o(A,e){0==--A._eventsCount?A._events=new i:delete A._events[e]}function r(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(t=!1)),r.prototype.eventNames=function(){var A,i,n=[];if(0===this._eventsCount)return n;for(i in A=this._events)e.call(A,i)&&n.push(t?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(A)):n},r.prototype.listeners=function(A){var e=t?t+A:A,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,a=i.length,o=new Array(a);n{t.d(e,{A:()=>i});const i=function(){function A(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return A.prototype.isComplete=function(){return!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&this.audioChannelCount,!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&this.sarDen,null!=this.mimeType},A.prototype.isSeekable=function(){return this.hasKeyframesIndex},A.prototype.getNearestKeyframe=function(A){if(null==this.keyframesIndex)return null;var e=this.keyframesIndex,t=this._search(e.times,A);return{index:t,milliseconds:e.times[t],fileposition:e.filepositions[t]}},A.prototype._search=function(A,e){var t=0,i=A.length-1,n=0,a=0,o=i;for(e=A[n]&&e{t.d(e,{$_:()=>i,EX:()=>a,EZ:()=>n,Sc:()=>o});var i=function(A,e,t,i,n){this.dts=A,this.pts=e,this.duration=t,this.originalDts=i,this.isSyncPoint=n,this.fileposition=null},n=function(){function A(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return A.prototype.appendSyncPoint=function(A){A.isSyncPoint=!0,this.syncPoints.push(A)},A}(),a=function(){function A(){this._list=[]}return A.prototype.clear=function(){this._list=[]},A.prototype.appendArray=function(A){var e=this._list;0!==A.length&&(e.length>0&&A[0].originalDts=e[n].dts&&A((null===(e=t[n].lastSample)||void 0===e?void 0:e.originalDts)||0)&&A=((null===(t=null===(e=i[a])||void 0===e?void 0:e.lastSample)||void 0===t?void 0:t.originalDts)||0)&&(a===i.length-1||a0&&(o=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=o,this._list.splice(o,0,n)},A.prototype.getLastSegmentBefore=function(A){var e=this._searchNearestSegmentBefore(A);return e>=0?this._list[e]:null},A.prototype.getLastSampleBefore=function(A){var e=this.getLastSegmentBefore(A);return null!=e?e.lastSample:null},A.prototype.getLastSyncPointBefore=function(A){for(var e=this._searchNearestSegmentBefore(A),t=this._list[e].syncPoints;0===t.length&&e>0;)e--,t=this._list[e].syncPoints;return t.length>0?t[t.length-1]:null},A}()},976:(A,e,t)=>{t.d(e,{A:()=>NA});var i=t(413),n=t(502),a=t(620),o=t(825);function r(A,e,t){var i=A;if(e+t=128){e.push(String.fromCharCode(65535&a)),i+=2;continue}}else if(t[i]<240){if(r(t,i,2)&&(a=(15&t[i])<<12|(63&t[i+1])<<6|63&t[i+2])>=2048&&55296!=(63488&a)){e.push(String.fromCharCode(65535&a)),i+=3;continue}}else if(t[i]<248){var a;if(r(t,i,3)&&(a=(7&t[i])<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3])>65536&&a<1114112){a-=65536,e.push(String.fromCharCode(a>>>10|55296)),e.push(String.fromCharCode(1023&a|56320)),i+=4;continue}}e.push(String.fromCharCode(65533)),++i}return e.join("")};var g,c=t(713),l=(g=new ArrayBuffer(2),new DataView(g).setInt16(0,256,!0),256===new Int16Array(g)[0]);const I=function(){function A(){}return A.parseScriptData=function(e,t,i){var a={};try{var o=A.parseValue(e,t,i),r=A.parseValue(e,t+o.size,i-o.size);a[o.data]=r.data}catch(A){n.A.e("AMF",A.toString())}return a},A.parseObject=function(e,t,i){if(i<3)throw new c.j4("Data not enough when parse ScriptDataObject");var n=A.parseString(e,t,i),a=A.parseValue(e,t+n.size,i-n.size),o=a.objectEnd;return{data:{name:n.data,value:a.data},size:n.size+a.size,objectEnd:o}},A.parseVariable=function(e,t,i){return A.parseObject(e,t,i)},A.parseString=function(A,e,t){if(t<2)throw new c.j4("Data not enough when parse String");var i=new DataView(A,e,t).getUint16(0,!l);return{data:i>0?s(new Uint8Array(A,e+2,i)):"",size:2+i}},A.parseLongString=function(A,e,t){if(t<4)throw new c.j4("Data not enough when parse LongString");var i=new DataView(A,e,t).getUint32(0,!l);return{data:i>0?s(new Uint8Array(A,e+4,i)):"",size:4+i}},A.parseDate=function(A,e,t){if(t<10)throw new c.j4("Data size invalid when parse Date");var i=new DataView(A,e,t),n=i.getFloat64(0,!l),a=i.getInt16(8,!l);return{data:new Date(n+=60*a*1e3),size:10}},A.parseValue=function(e,t,i){if(i<1)throw new c.j4("Data not enough when parse Value");var a,o=new DataView(e,t,i),r=1,s=o.getUint8(0),g=!1;try{switch(s){case 0:a=o.getFloat64(1,!l),r+=8;break;case 1:a=!!o.getUint8(1),r+=1;break;case 2:var I=A.parseString(e,t+1,i-1);a=I.data,r+=I.size;break;case 3:a={};var C=0;for(9==(16777215&o.getUint32(i-4,!l))&&(C=3);r32)throw new c.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(A<=this._current_word_bits_left){var e=this._current_word>>>32-A;return this._current_word<<=A,this._current_word_bits_left-=A,e}var t=this._current_word_bits_left?this._current_word:0;t>>>=32-this._current_word_bits_left;var i=A-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(i,this._current_word_bits_left),a=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,t<>>A)return this._current_word<<=A,this._current_word_bits_left-=A,A;return this._fillCurrentWord(),A+this._skipLeadingZero()},A.prototype.readUEG=function(){var A=this._skipLeadingZero();return this.readBits(A+1)-1},A.prototype.readSEG=function(){var A=this.readUEG();return 1&A?A+1>>>1:-1*(A>>>1)},A}(),d=function(){function A(){}return A._ebsp2rbsp=function(A){for(var e=A,t=e.byteLength,i=new Uint8Array(t),n=0,a=0;a=2&&3===e[a]&&0===e[a-1]&&0===e[a-2]||(i[n]=e[a],n++);return new Uint8Array(i.buffer,0,n)},A.parseSPS=function(e){for(var t=e.subarray(1,4),i="avc1.",n=0;n<3;n++){var a=t[n].toString(16);a.length<2&&(a="0"+a),i+=a}var o=A._ebsp2rbsp(e),r=new C(o);r.readByte();var s=r.readByte();r.readByte();var g=r.readByte();r.readUEG();var c=A.getProfileString(s),l=A.getLevelString(g),I=1,d=420,h=8,B=8;if((100===s||110===s||122===s||244===s||44===s||83===s||86===s||118===s||128===s||138===s||144===s)&&(3===(I=r.readUEG())&&r.readBits(1),I<=3&&(d=[0,420,422,444][I]),h=r.readUEG()+8,B=r.readUEG()+8,r.readBits(1),r.readBool()))for(var u=3!==I?8:12,E=0;E0&&N<16?(v=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][N-1],b=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][N-1]):255===N&&(v=r.readByte()<<8|r.readByte(),b=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var T=r.readBits(32),M=r.readBits(32);R=r.readBool(),F=(k=M)/(P=2*T)}}var L=1;1===v&&1===b||(L=v/b);var Y=0,G=0;0===I?(Y=1,G=2-y):(Y=3===I?1:2,G=(1===I?2:1)*(2-y));var U=16*(p+1),J=16*(m+1)*(2-y);U-=(_+S)*Y,J-=(D+w)*G;var H=Math.ceil(U*L);return r.destroy(),r=null,{codec_mimetype:i,profile_idc:s,level_idc:g,profile_string:c,level_string:l,chroma_format_idc:I,bit_depth:h,bit_depth_luma:h,bit_depth_chroma:B,ref_frames:x,chroma_format:d,chroma_format_string:A.getChromaFormatString(d),frame_rate:{fixed:R,fps:F,fps_den:P,fps_num:k},sar_ratio:{width:v,height:b},codec_size:{width:U,height:J},present_size:{width:H,height:J}}},A._skipScalingList=function(A,e){for(var t=8,i=8,n=0;n=2&&3===e[a]&&0===e[a-1]&&0===e[a-2]||(i[n]=e[a],n++);return new Uint8Array(i.buffer,0,n)},A.parseVPS=function(e){var t=A._ebsp2rbsp(e),i=new C(t);return i.readByte(),i.readByte(),i.readBits(4),i.readBits(2),i.readBits(6),{num_temporal_layers:i.readBits(3)+1,temporal_id_nested:i.readBool()}},A.parseSPS=function(e){var t=A._ebsp2rbsp(e),i=new C(t);i.readByte(),i.readByte();for(var n=0,a=0,o=0,r=0,s=(i.readBits(4),i.readBits(3)),g=(i.readBool(),i.readBits(2)),c=i.readBool(),l=i.readBits(5),I=i.readByte(),d=i.readByte(),h=i.readByte(),B=i.readByte(),u=i.readByte(),E=i.readByte(),f=i.readByte(),Q=i.readByte(),x=i.readByte(),p=i.readByte(),m=i.readByte(),y=[],_=[],S=0;S0)for(S=s;S<8;S++)i.readBits(2);for(S=0;S1&&i.readSEG(),S=0;S0&&z<=16?(j=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][z-1],W=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][z-1]):255===z&&(j=i.readBits(16),W=i.readBits(16))}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(3),i.readBool(),i.readBool()&&(i.readByte(),i.readByte(),i.readByte())),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool(),i.readBool(),i.readBool(),i.readBool()&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(X=i.readBits(32),q=i.readBits(32),i.readBool()&&i.readUEG(),i.readBool())){var $,AA,eA=!1;for($=i.readBool(),AA=i.readBool(),($||AA)&&((eA=i.readBool())&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),eA&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5)),S=0;S<=s;S++){var tA=i.readBool();Z=tA;var iA=!1,nA=1;tA||(iA=i.readBool());var aA=!1;if(iA?i.readSEG():aA=i.readBool(),aA||(nA=i.readUEG()+1),$)for(G=0;G>3,a=!!(4&e[i]),o=!!(2&e[i]);e[i],i+=1,a&&(i+=1);var r=Number.POSITIVE_INFINITY;if(o){r=0;for(var s=0;r|=(127&e[i])<<7*s,128&e[i+=1];s++);}1===n&&(t=A.parseSeuqneceHeader(e.subarray(i,i+r))),i+=r}return t},A.parseSeuqneceHeader=function(e){var t=new C(e),i=t.readBits(3),n=(t.readBool(),t.readBool()),a=!0,o=0,r=0,s=[];if(n)s.push({operating_point_idc:0,level:t.readBits(5),tier:0});else{if(t.readBool()){var g=t.readBits(32),c=t.readBits(32),l=t.readBool();if(l){for(var I=0;0===t.readBits(1);)I+=1;I>=32||t.readBits(I)}o=c,r=g,a=l,t.readBool()&&(t.readBits(5),t.readBits(32),t.readBits(5),t.readBits(5))}for(var d=t.readBool(),h=t.readBits(5),B=0;B<=h;B++){var u=t.readBits(12),E=t.readBits(5),f=E>7?t.readBits(1):0;s.push({operating_point_idc:u,level:E,tier:f}),d&&t.readBool()&&t.readBits(4)}}var Q=s[0],x=Q.level,p=Q.tier,m=t.readBits(4),y=t.readBits(4),_=t.readBits(m+1)+1,S=t.readBits(y+1)+1,D=!1;n||(D=t.readBool()),D&&(t.readBits(4),t.readBits(4)),t.readBool(),t.readBool(),t.readBool();var w=!1;n||(t.readBool(),t.readBool(),t.readBool(),t.readBool(),(w=t.readBool())&&(t.readBool(),t.readBool()),(t.readBool()||t.readBits(1))&&(t.readBool()||t.readBits(1)),w&&t.readBits(3)),t.readBool(),t.readBool(),t.readBool();var v=t.readBool(),b=8;b=2===i&&v?t.readBool()?12:10:v?10:8;var F=!1;1!==i&&(F=t.readBool()),t.readBool()&&(t.readBits(8),t.readBits(8),t.readBits(8));var R=1,k=1;return F?(t.readBits(1),R=1,k=1):(t.readBits(1),0===i?(R=1,k=1):1===i?(R=0,k=0):12===b?t.readBits(1)&&t.readBits(1):(R=1,k=0),R&&k&&t.readBits(2),t.readBits(1)),t.readBool(),t.destroy(),t=null,{codec_mimetype:"av01.".concat(i,".").concat(A.getLevelString(x,p),".").concat(b.toString(10).padStart(2,"0")),level:x,tier:p,level_string:A.getLevelString(x,p),profile_idc:i,profile_string:"".concat(i),bit_depth:b,ref_frames:1,chroma_format:A.getChromaFormat(F,R,k),chroma_format_string:A.getChromaFormatString(F,R,k),frame_rate:{fixed:a,fps:o/r,fps_den:r,fps_num:o},sar_ratio:{width:1,height:1},codec_size:{width:_,height:S},present_size:{width:1*_,height:S}}},A.getLevelString=function(A,e){return"".concat(A.toString(10).padStart(2,"0")).concat(0===e?"M":"H")},A.getChromaFormat=function(A,e,t){return A?0:0===e&&0===t?3:1===e&&0===t?2:1===e&&1===t?1:Number.NaN},A.getChromaFormatString=function(A,e,t){return A?"4:0:0":0===e&&0===t?"4:4:4":1===e&&0===t?"4:2:2":1===e&&1===t?"4:2:0":"Unknown"},A}();var p=function(){function A(A,e){this.TAG="FLVDemuxer",this._config=e,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=A.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=A.hasAudioTrack,this._hasVideo=A.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new o.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var A=new ArrayBuffer(2);return new DataView(A).setInt16(0,256,!0),256===new Int16Array(A)[0]}()}return A.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},A.probe=function(A){var e=new Uint8Array(A);if(e.byteLength<9)return{needMoreData:!0};var t={match:!1};if(70!==e[0]||76!==e[1]||86!==e[2]||1!==e[3])return t;var i,n=(4&e[4])>>>2!=0,a=!!(1&e[4]),o=(i=e)[5]<<24|i[6]<<16|i[7]<<8|i[8];return o<9?t:{match:!0,consumed:o,dataOffset:o,hasAudioTrack:n,hasVideoTrack:a}},A.prototype.bindDataSource=function(A){return A.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(A.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(A){this._onTrackMetadata=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(A){this._onMediaInfo=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(A){this._onMetaDataArrived=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(A){this._onScriptDataArrived=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(A){this._onDataAvailable=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(A){this._timestampBase=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedDuration",{get:function(){return this._duration},set:function(A){this._durationOverrided=!0,this._duration=A,this._mediaInfo&&(this._mediaInfo.duration=A)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedHasAudio",{set:function(A){this._hasAudioFlagOverrided=!0,this._hasAudio=A,this._mediaInfo&&(this._mediaInfo.hasAudio=A)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedHasVideo",{set:function(A){this._hasVideoFlagOverrided=!0,this._hasVideo=A,this._mediaInfo&&(this._mediaInfo.hasVideo=A)},enumerable:!1,configurable:!0}),A.prototype.resetMediaInfo=function(){this._mediaInfo=new o.A},A.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},A.prototype.parseChunks=function(e,t){var i,a;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new c.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var o=0,r=this._littleEndian;if(0===t){if(!(e.byteLength>13))return 0;var s=A.probe(e);o=(null==s?void 0:s.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,t+o!==this._dataOffset&&n.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(g=new DataView(e,o)).getUint32(0,!r)&&n.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),o+=4);oe.byteLength)break;var l=g.getUint8(0),I=16777215&g.getUint32(0,!r);if(o+11+I+4>e.byteLength)break;if(8===l||9===l||18===l){var C=g.getUint8(4),d=g.getUint8(5),h=g.getUint8(6)|d<<8|C<<16|g.getUint8(7)<<24;16777215&g.getUint32(7,!r)&&n.A.w(this.TAG,"Meet tag which has StreamID != 0!");var B=o+11;switch(l){case 8:this._parseAudioData(e,B,I,h);break;case 9:this._parseVideoData(e,B,I,h,t+o);break;case 18:this._parseScriptData(e,B,I)}var u=g.getUint32(11+I,!r);u!==11+I&&n.A.w(this.TAG,"Invalid PrevTagSize ".concat(u)),o+=11+I+4}else n.A.w(this.TAG,"Unsupported tag type ".concat(l,", skipped")),o+=11+I+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(i=this._audioTrack)||void 0===i?void 0:i.length)||(null===(a=this._videoTrack)||void 0===a?void 0:a.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),o},A.prototype._parseScriptData=function(A,e,t){var i,a,o,r=I.parseScriptData(A,e,t);if(r.hasOwnProperty("onMetaData")){if(null==r.onMetaData||"object"!=typeof r.onMetaData)return void n.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&n.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=r;var s=null===(i=this._metadata)||void 0===i?void 0:i.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},s)),"boolean"==typeof(null==s?void 0:s.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=s.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==s?void 0:s.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=s.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==s?void 0:s.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=s.audiodatarate),"number"==typeof(null==s?void 0:s.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=s.videodatarate),"number"==typeof(null==s?void 0:s.width)&&this._mediaInfo&&(this._mediaInfo.width=s.width),"number"==typeof(null==s?void 0:s.height)&&this._mediaInfo&&(this._mediaInfo.height=s.height),"number"==typeof(null==s?void 0:s.duration)){if(!this._durationOverrided){var g=Math.floor(s.duration*this._timescale);this._duration=g,this._mediaInfo&&(this._mediaInfo.duration=g)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==s?void 0:s.framerate)){var c=Math.floor(1e3*s.framerate);if(c>0){var l=c/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=l,this._referenceFrameRate.fps_num=c,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=l)}}if("object"==typeof(null==s?void 0:s.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var C=s.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(C)),s.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=s),n.A.v(this.TAG,"Parsed onMetaData"),(null===(a=this._mediaInfo)||void 0===a?void 0:a.isComplete())&&(null===(o=this._onMediaInfo)||void 0===o||o.call(this,this._mediaInfo))}Object.keys(r).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},r))},A.prototype._parseKeyframesIndex=function(A){for(var e=[],t=[],i=1;i>>4;if(2===u||10===u){var E=0,f=(12&B)>>>2;if(f>=0&&f<=4){E=this._flvSoundRateTable[f];var x=1&B,p=this._audioMetadata,m=this._audioTrack;if(p||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(p=this._audioMetadata={}).type="audio",p.id=null==m?void 0:m.id,p.timescale=this._timescale,p.duration=this._duration,p.audioSampleRate=E,p.channelCount=0===x?1:2),10===u){var y=this._parseAACAudioData(A,e+1,t-1);if(void 0===y)return;if(0===(null==y?void 0:y.packetType)){if(null==p?void 0:p.config){if(Q(y.data.config,null==p?void 0:p.config))return;n.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var _=y.data;p.audioSampleRate=null==_?void 0:_.samplingRate,p.channelCount=null==_?void 0:_.channelCount,p.codec=null==_?void 0:_.codec,p.originalCodec=null==_?void 0:_.originalCodec,p.config=null==_?void 0:_.config,p.refSampleDuration=1024/p.audioSampleRate*p.timescale,n.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(r=this._audioTrack)||void 0===r?void 0:r.length)||(null===(s=this._videoTrack)||void 0===s?void 0:s.length))&&(null===(g=this._onDataAvailable)||void 0===g||g.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"audio",p),(w=this._mediaInfo).audioCodec=p.originalCodec||"",w.audioSampleRate=p.audioSampleRate,w.audioChannelCount=p.channelCount,w.hasVideo?null!=w.videoCodec&&(w.mimeType='video/x-flv; codecs="'+w.videoCodec+","+w.audioCodec+'"'):w.mimeType='video/x-flv; codecs="'+w.audioCodec+'"',(null==w?void 0:w.isComplete())&&(null===(l=this._onMediaInfo)||void 0===l||l.call(this,w))}else if(1===y.packetType){var S=this._timestampBase+i,D={unit:y.data,length:y.data.byteLength,dts:S,pts:S};m&&(null==m||m.samples.push(D),m.length+=(null===(I=null==y?void 0:y.data)||void 0===I?void 0:I.length)||0)}else n.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(y.packetType))}else if(2===u){if(!p.codec){var w;if(void 0===(_=this._parseMP3AudioData(A,e+1,t-1,!0)))return;p.audioSampleRate=_.samplingRate,p.channelCount=_.channelCount,p.codec=_.codec,p.originalCodec=_.originalCodec,p.refSampleDuration=1152/p.audioSampleRate*p.timescale,n.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(C=this._onTrackMetadata)||void 0===C||C.call(this,"audio",p),(w=this._mediaInfo).audioCodec=p.codec,w.audioSampleRate=p.audioSampleRate,w.audioChannelCount=p.channelCount,w.audioDataRate=_.bitRate,(null==w?void 0:w.hasVideo)?null!=w.videoCodec&&(w.mimeType='video/x-flv; codecs="'+w.videoCodec+","+w.audioCodec+'"'):w.mimeType='video/x-flv; codecs="'+w.audioCodec+'"',w.isComplete()&&(null===(d=this._onMediaInfo)||void 0===d||d.call(this,w))}var v=this._parseMP3AudioData(A,e+1,t-1,!1);if(void 0===v)return;S=this._timestampBase+i;var b={unit:v,length:v.byteLength,dts:S,pts:S};null==m||m.samples.push(b),m&&(m.length+=v.length)}}else null===(o=this._onError)||void 0===o||o.call(this,h.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+f)}else null===(a=this._onError)||void 0===a||a.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+u)}},A.prototype._parseAACAudioData=function(A,e,t){if(!(t<=1)){var i={},a=new Uint8Array(A,e,t);return i.packetType=a[0],0===a[0]?i.data=this._parseAACAudioSpecificConfig(A,e+1,t-1):i.data=a.subarray(1),i}n.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},A.prototype._parseAACAudioSpecificConfig=function(A,e,t){var i,n,a,o,r=new Uint8Array(A,e,t),s=null,g=0,c=null;if(g=a=r[0]>>>3,(o=(7&r[0])<<1|r[1]>>>7)<0||o>=this._mpegSamplingRates.length)null===(i=this._onError)||void 0===i||i.call(this,h.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var l=this._mpegSamplingRates[o],I=(120&r[1])>>>3;if(!(I<0||I>=8)){5===g&&(c=(7&r[1])<<1|r[2]>>>7,r[2]);var C=self.navigator.userAgent.toLowerCase();return C.includes("firefox")?o>=6?(g=5,s=new Array(4),c=o-3):(g=2,s=new Array(2),c=o):C.includes("android")?(g=2,s=new Array(2),c=o):(g=5,c=o,s=new Array(4),o>=6?c=o-3:1===I&&(g=2,s=new Array(2),c=o)),s[0]=g<<3,s[0]|=(15&o)>>>1,s[1]=(15&o)<<7,s[1]|=(15&I)<<3,5===g&&(s[1]|=(15&c)>>>1,s[2]=(1&c)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:l,channelCount:I,codec:"mp4a.40."+g,originalCodec:"mp4a.40."+a}}null===(n=this._onError)||void 0===n||n.call(this,h.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},A.prototype._parseMP3AudioData=function(A,e,t,i){if(!(t<4)){this._littleEndian;var a,o=new Uint8Array(A,e,t);if(i){if(255!==o[0])return;var r=o[1]>>>3&3,s=(6&o[1])>>1,g=(240&o[2])>>>4,c=(12&o[2])>>>2,l=3&~(o[3]>>>6)?2:1,I=0,C=0;switch(r){case 0:I=this._mpegAudioV25SampleRateTable[c];break;case 2:I=this._mpegAudioV20SampleRateTable[c];break;case 3:I=this._mpegAudioV10SampleRateTable[c]}switch(s){case 1:g>>4;if(128&s){var c=15&s,l=String.fromCharCode.apply(String,function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n0)&&!(i=a.next()).done;)o.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return o}(new Uint8Array(A,e,t).slice(1,5)),!1));"hvc1"===l?this._parseEnhancedHEVCVideoPacket(A,e+5,t-5,i,a,g,c):"av01"===l?this._parseEnhancedAV1VideoPacket(A,e+5,t-5,i,a,g,c):null===(r=this._onError)||void 0===r||r.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(l))}else{var I=15&s;7===I?this._parseAVCVideoPacket(A,e+1,t-1,i,a,g):12===I?this._parseHEVCVideoPacket(A,e+1,t-1,i,a,g):null===(o=this._onError)||void 0===o||o.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(I))}}},A.prototype._parseAVCVideoPacket=function(A,e,t,i,a,o){var r;if(t<4)n.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,g=new DataView(A,e,t),c=g.getUint8(0),l=(16777215&g.getUint32(0,!s))<<8>>8;0===c?this._parseAVCDecoderConfigurationRecord(A,e+4,t-4):1===c?this._parseAVCVideoData(A,e+4,t-4,i,a,o,l):2===c||null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},A.prototype._parseHEVCVideoPacket=function(A,e,t,i,a,o){var r;if(t<4)n.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var s=this._littleEndian,g=new DataView(A,e,t),c=g.getUint8(0),l=(16777215&g.getUint32(0,!s))<<8>>8;0===c?this._parseHEVCDecoderConfigurationRecord(A,e+4,t-4):1===c?this._parseHEVCVideoData(A,e+4,t-4,i,a,o,l):2===c||null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},A.prototype._parseEnhancedHEVCVideoPacket=function(A,e,t,i,n,a,o){var r,s=this._littleEndian,g=new DataView(A,e,t);if(0===o)this._parseHEVCDecoderConfigurationRecord(A,e,t);else if(1===o){var c=(4294967040&g.getUint32(0,!s))>>8;this._parseHEVCVideoData(A,e+3,t-3,i,n,a,c)}else 3===o?this._parseHEVCVideoData(A,e,t,i,n,a,0):2===o||null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))},A.prototype._parseEnhancedAV1VideoPacket=function(A,e,t,i,n,a,o){var r,s;this._littleEndian,0===o?this._parseAV1CodecConfigurationRecord(A,e,t):1===o?this._parseAV1VideoData(A,e,t,i,n,a,0):5===o?null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(o)):2===o||null===(s=this._onError)||void 0===s||s.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))},A.prototype._parseAVCDecoderConfigurationRecord=function(A,e,t){var i,a,o,r,s,g,c,l,I,C,B;if(t<7)n.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var u=this._videoMetadata,E=this._videoTrack,f=this._littleEndian,x=new DataView(A,e,t);if(u){if(void 0!==u.avcc){var p=new Uint8Array(A,e,t);if(Q(p,u.avcc))return;n.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(u=this._videoMetadata={}).type="video",u.id=null==E?void 0:E.id,u.timescale=this._timescale,u.duration=this._duration;var m=x.getUint8(0),y=x.getUint8(1);if(x.getUint8(2),x.getUint8(3),1===m&&0!==y)if(this._naluLengthSize=1+(3&x.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var _=31&x.getUint8(5);if(0!==_){_>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(_));for(var S=6,D=0;D<_;D++){var w=x.getUint16(S,!f);if(S+=2,0!==w){var v=new Uint8Array(A,e+S,w);S+=w;var b=d.parseSPS(v);if(0===D){u.codecWidth=b.codec_size.width,u.codecHeight=b.codec_size.height,u.presentWidth=b.present_size.width,u.presentHeight=b.present_size.height,u.profile=b.profile_string,u.level=b.level_string,u.bitDepth=b.bit_depth,u.chromaFormat=b.chroma_format,u.sarRatio=b.sar_ratio,u.frameRate=b.frame_rate,b.frame_rate.fixed&&0!==b.frame_rate.fps_num&&0!==b.frame_rate.fps_den||(u.frameRate=this._referenceFrameRate);var F=null===(r=u.frameRate)||void 0===r?void 0:r.fps_den,R=null===(s=u.frameRate)||void 0===s?void 0:s.fps_num;u.refSampleDuration=u.timescale*(F/R);for(var k=v.subarray(1,4),P="avc1.",N=0;N<3;N++){var T=k[N].toString(16);T.length<2&&(T="0"+T),P+=T}u.codec=P;var M=this._mediaInfo;M.width=u.codecWidth,M.height=u.codecHeight,M.fps=u.frameRate.fps,M.profile=u.profile,M.level=u.level,M.refFrames=b.ref_frames,M.chromaFormat=b.chroma_format_string,M.sarNum=u.sarRatio.width,M.sarDen=u.sarRatio.height,M.videoCodec=P,M.hasAudio?null!=M.audioCodec&&(M.mimeType='video/x-flv; codecs="'+M.videoCodec+","+M.audioCodec+'"'):M.mimeType='video/x-flv; codecs="'+M.videoCodec+'"',M.isComplete()&&(null===(g=this._onMediaInfo)||void 0===g||g.call(this,M))}}}var L=x.getUint8(S);if(0!==L){for(L>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(L)),S++,D=0;D=t){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(d,", offset = ").concat(I,", dataSize = ").concat(t));break}var B=g.getUint32(I,!s);if(3===C&&(B>>>=8),B>t-C)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(d,", NaluSize > DataSize!"));var u=31&g.getUint8(I+C);5===u&&(h=!0);var E=new Uint8Array(A,e+I,C+B),f={type:u,data:E};c.push(f),l+=E.byteLength,I+=C+B}if(c.length){var Q=this._videoTrack,x={units:c,length:l,isKeyframe:h,dts:d,cts:r,pts:d+r};h&&(x.fileposition=a),Q&&(Q.samples.push(x),Q.length+=l)}},A.prototype._parseHEVCVideoData=function(A,e,t,i,a,o,r){for(var s=this._littleEndian,g=new DataView(A,e,t),c=[],l=0,I=0,C=this._naluLengthSize,d=this._timestampBase+i,h=1===o;I=t){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(d,", offset = ").concat(I,", dataSize = ").concat(t));break}var B=g.getUint32(I,!s);if(3===C&&(B>>>=8),B>t-C)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(d,", NaluSize > DataSize!"));var u=31&g.getUint8(I+C);19!==u&&20!==u||(h=!0);var E=new Uint8Array(A,e+I,C+B),f={type:u,data:E};c.push(f),l+=E.byteLength,I+=C+B}if(c.length){var Q=this._videoTrack,x={units:c,length:l,isKeyframe:h,dts:d,cts:r,pts:d+r};h&&(x.fileposition=a),Q&&(null==Q||Q.samples.push(x),Q.length+=l)}},A.prototype._parseAV1VideoData=function(A,e,t,i,n,a,o){this._littleEndian;var r,s=[],g=this._timestampBase+i,c=1===a;if(r=t,s.push({unitType:0,data:new Uint8Array(A,e+0,t)}),s.length){var l=this._videoTrack,I={units:s,length:r,isKeyframe:c,dts:g,cts:o,pts:g+o};c&&(I.fileposition=n),l&&(null==l||l.samples.push(I),l.length+=r)}},A}();const m=p,y=function(){function A(){}return A.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},A}();var _,S=function(){this.program_pmt_pid={}};!function(A){A[A.kMPEG1Audio=3]="kMPEG1Audio",A[A.kMPEG2Audio=4]="kMPEG2Audio",A[A.kPESPrivateData=6]="kPESPrivateData",A[A.kADTSAAC=15]="kADTSAAC",A[A.kLOASAAC=17]="kLOASAAC",A[A.kAC3=129]="kAC3",A[A.kEAC3=135]="kEAC3",A[A.kID3=21]="kID3",A[A.kSCTE35=134]="kSCTE35",A[A.kH264=27]="kH264",A[A.kH265=36]="kH265"}(_||(_={}));var D,w=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},v=function(){},b=function(){},F=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0,this.random_access_indicator=0};!function(A){A[A.kUnspecified=0]="kUnspecified",A[A.kSliceNonIDR=1]="kSliceNonIDR",A[A.kSliceDPA=2]="kSliceDPA",A[A.kSliceDPB=3]="kSliceDPB",A[A.kSliceDPC=4]="kSliceDPC",A[A.kSliceIDR=5]="kSliceIDR",A[A.kSliceSEI=6]="kSliceSEI",A[A.kSliceSPS=7]="kSliceSPS",A[A.kSlicePPS=8]="kSlicePPS",A[A.kSliceAUD=9]="kSliceAUD",A[A.kEndOfSequence=10]="kEndOfSequence",A[A.kEndOfStream=11]="kEndOfStream",A[A.kFiller=12]="kFiller",A[A.kSPSExt=13]="kSPSExt",A[A.kReserved0=14]="kReserved0"}(D||(D={}));var R,k,P=function(){},N=function(A){var e=A.data.byteLength;this.type=A.type,this.data=new Uint8Array(4+e),new DataView(this.data.buffer).setUint32(0,e),this.data.set(A.data,4)},T=function(){function A(A){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=A,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return A.prototype.findNextStartCodeOffset=function(A){for(var e=A,t=this.data_;;){if(e+3>=t.byteLength)return this.eof_flag_=!0,t.byteLength;var i=t[e+0]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],n=t[e+0]<<16|t[e+1]<<8|t[e+2];if(1===i||1===n)return e;e++}},A.prototype.readNextNaluPayload=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_startcode_offset_,i=31&A[t+=1==(A[t]<<24|A[t+1]<<16|A[t+2]<<8|A[t+3])?4:3],n=(128&A[t])>>>7,a=this.findNextStartCodeOffset(t);if(this.current_startcode_offset_=a,!(i>=D.kReserved0)&&0===n){var o=A.subarray(t,a);(e=new P).type=i,e.data=o}}return e},A}(),M=function(){function A(A,e,t){var i=8+A.byteLength+1+2+e.byteLength,n=!1;66!==A[3]&&77!==A[3]&&88!==A[3]&&(n=!0,i+=4);var a=this.data=new Uint8Array(i);a[0]=1,a[1]=A[1],a[2]=A[2],a[3]=A[3],a[4]=255,a[5]=225;var o=A.byteLength;a[6]=o>>>8,a[7]=255&o;var r=8;a.set(A,8),a[r+=o]=1;var s=e.byteLength;a[r+1]=s>>>8,a[r+2]=255&s,a.set(e,r+3),r+=3+s,n&&(a[r]=252|t.chroma_format_idc,a[r+1]=248|t.bit_depth_luma-8,a[r+2]=248|t.bit_depth_chroma-8,a[r+3]=0,r+=4)}return A.prototype.getData=function(){return this.data},A}();!function(A){A[A.kNull=0]="kNull",A[A.kAACMain=1]="kAACMain",A[A.kAAC_LC=2]="kAAC_LC",A[A.kAAC_SSR=3]="kAAC_SSR",A[A.kAAC_LTP=4]="kAAC_LTP",A[A.kAAC_SBR=5]="kAAC_SBR",A[A.kAAC_Scalable=6]="kAAC_Scalable",A[A.kLayer1=32]="kLayer1",A[A.kLayer2=33]="kLayer2",A[A.kLayer3=34]="kLayer3"}(R||(R={})),function(A){A[A.k96000Hz=0]="k96000Hz",A[A.k88200Hz=1]="k88200Hz",A[A.k64000Hz=2]="k64000Hz",A[A.k48000Hz=3]="k48000Hz",A[A.k44100Hz=4]="k44100Hz",A[A.k32000Hz=5]="k32000Hz",A[A.k24000Hz=6]="k24000Hz",A[A.k22050Hz=7]="k22050Hz",A[A.k16000Hz=8]="k16000Hz",A[A.k12000Hz=9]="k12000Hz",A[A.k11025Hz=10]="k11025Hz",A[A.k8000Hz=11]="k8000Hz",A[A.k7350Hz=12]="k7350Hz"}(k||(k={}));var L,Y,G=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],U=(L=function(A,e){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},L(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}L(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),J=function(){},H=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return U(e,A),e}(J),K=function(){function A(A){this.TAG="AACADTSParser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(4095==(t[e+0]<<8|t[e+1])>>>4)return e;e++}},A.prototype.readNextAACFrame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=(8&A[t+1])>>>3,n=(6&A[t+1])>>>1,a=1&A[t+1],o=(192&A[t+2])>>>6,r=(60&A[t+2])>>>2,s=(1&A[t+2])<<2|(192&A[t+3])>>>6,g=(3&A[t+3])<<11|A[t+4]<<3|(224&A[t+5])>>>5;if(A[t+6],t+g>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=1===a?7:9,l=g-c;t+=c;var I=this.findNextSyncwordOffset(t+l);if(this.current_syncword_offset_=I,(0===i||1===i)&&0===n){var C=A.subarray(t,t+l);(e=new J).audio_object_type=o+1,e.sampling_freq_index=r,e.sampling_frequency=G[r],e.channel_config=s,e.data=C}}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),V=function(){function A(A){this.TAG="AACLOASParser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+1>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(695==(t[e+0]<<3|t[e+1]>>>5))return e;e++}},A.prototype.getLATMValue=function(A){for(var e=A.readBits(2),t=0,i=0;i<=e;i++)t<<=8,t|=A.readByte();return t},A.prototype.readNextAACFrame=function(A){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,a=(31&e[i+1])<<8|e[i+2];if(i+3+a>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var o=new C(e.subarray(i+3,i+3+a)),r=null;if(o.readBool()){if(null==A){n.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(i+3+a),o.destroy();continue}r=A}else{var s=o.readBool();if(s&&o.readBool()){n.A.e(this.TAG,"audioMuxVersionA is Not Supported"),o.destroy();break}if(s&&this.getLATMValue(o),!o.readBool()){n.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),o.destroy();break}if(0!==o.readBits(6)){n.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),o.destroy();break}if(0!==o.readBits(4)){n.A.e(this.TAG,"more than 2 numProgram Not Supported"),o.destroy();break}if(0!==o.readBits(3)){n.A.e(this.TAG,"more than 2 numLayer Not Supported"),o.destroy();break}var g=s?this.getLATMValue(o):0,c=o.readBits(5);g-=5;var l=o.readBits(4);g-=4;var I=o.readBits(4);g-=4,o.readBits(3),(g-=3)>0&&o.readBits(g);var d=o.readBits(3);if(0!==d){n.A.e(this.TAG,"frameLengthType = ".concat(d,". Only frameLengthType = 0 Supported")),o.destroy();break}o.readByte();var h=o.readBool();if(h)if(s)this.getLATMValue(o);else{for(var B=0;;){B<<=8;var u=o.readBool();if(B+=o.readByte(),!u)break}console.log(B)}o.readBool()&&o.readByte(),(r=new H).audio_object_type=c,r.sampling_freq_index=l,r.sampling_frequency=G[r.sampling_freq_index],r.channel_config=I,r.other_data_present=h}for(var E=0;;){var f=o.readByte();if(E+=f,255!==f)break}for(var Q=new Uint8Array(E),x=0;x=6?(i=5,e=new Array(4),o=n-3):(i=2,e=new Array(2),o=n):r.includes("android")?(i=2,e=new Array(2),o=n):(i=5,o=n,e=new Array(4),n>=6?o=n-3:1===a&&(i=2,e=new Array(2),o=n)),e[0]=i<<3,e[0]|=(15&n)>>>1,e[1]=(15&n)<<7,e[1]|=(15&a)<<3,5===i&&(e[1]|=(15&o)>>>1,e[2]=(1&o)<<7,e[2]|=8,e[3]=0),this.config=e,this.sampling_rate=G[n],this.channel_count=a,this.codec_mimetype="mp4a.40."+i.toString(),this.original_codec_mimetype="mp4a.40."+t.toString()},j=function(){},W=function(){};!function(A){A[A.kSpliceNull=0]="kSpliceNull",A[A.kSpliceSchedule=4]="kSpliceSchedule",A[A.kSpliceInsert=5]="kSpliceInsert",A[A.kTimeSignal=6]="kTimeSignal",A[A.kBandwidthReservation=7]="kBandwidthReservation",A[A.kPrivateCommand=255]="kPrivateCommand"}(Y||(Y={}));var Z,X=function(A){var e=A.readBool();return e?(A.readBits(6),{time_specified_flag:e,pts_time:4*A.readBits(31)+A.readBits(2)}):(A.readBits(7),{time_specified_flag:e})},q=function(A){var e=A.readBool();return A.readBits(6),{auto_return:e,duration:4*A.readBits(31)+A.readBits(2)}},z=function(A,e){var t=e.readBits(8);return A?{component_tag:t}:{component_tag:t,splice_time:X(e)}},$=function(A){return{component_tag:A.readBits(8),utc_splice_time:A.readBits(32)}},AA=function(A){var e=A.readBits(32),t=A.readBool();A.readBits(7);var i={splice_event_id:e,splice_event_cancel_indicator:t};if(t)return i;if(i.out_of_network_indicator=A.readBool(),i.program_splice_flag=A.readBool(),i.duration_flag=A.readBool(),A.readBits(5),i.program_splice_flag)i.utc_splice_time=A.readBits(32);else{i.component_count=A.readBits(8),i.components=[];for(var n=0;n=t.byteLength)return this.eof_flag_=!0,t.byteLength;var i=t[e+0]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],n=t[e+0]<<16|t[e+1]<<8|t[e+2];if(1===i||1===n)return e;e++}},A.prototype.readNextNaluPayload=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_startcode_offset_,i=A[t+=1==(A[t]<<24|A[t+1]<<16|A[t+2]<<8|A[t+3])?4:3]>>1&63,n=(128&A[t])>>>7,a=this.findNextStartCodeOffset(t);if(this.current_startcode_offset_=a,0===n){var o=A.subarray(t,a);(e=new sA).type=i,e.data=o}}return e},A}(),lA=function(){function A(A,e,t,i){var n=23+(5+A.byteLength)+(5+e.byteLength)+(5+t.byteLength),a=this.data=new Uint8Array(n);a[0]=1,a[1]=(3&i.general_profile_space)<<6|(i.general_tier_flag?1:0)<<5|31&i.general_profile_idc,a[2]=i.general_profile_compatibility_flags_1,a[3]=i.general_profile_compatibility_flags_2,a[4]=i.general_profile_compatibility_flags_3,a[5]=i.general_profile_compatibility_flags_4,a[6]=i.general_constraint_indicator_flags_1,a[7]=i.general_constraint_indicator_flags_2,a[8]=i.general_constraint_indicator_flags_3,a[9]=i.general_constraint_indicator_flags_4,a[10]=i.general_constraint_indicator_flags_5,a[11]=i.general_constraint_indicator_flags_6,a[12]=i.general_level_idc,a[13]=240|(3840&i.min_spatial_segmentation_idc)>>8,a[14]=255&i.min_spatial_segmentation_idc,a[15]=252|3&i.parallelismType,a[16]=252|3&i.chroma_format_idc,a[17]=248|7&i.bit_depth_luma_minus8,a[18]=248|7&i.bit_depth_chroma_minus8,a[19]=0,a[20]=0,a[21]=(3&i.constant_frame_rate)<<6|(7&i.num_temporal_layers)<<3|(i.temporal_id_nested?1:0)<<2|3,a[22]=3,a[23]=128|Z.kSliceVPS,a[24]=0,a[25]=1,a[26]=(65280&A.byteLength)>>8,a[27]=255&A.byteLength,a.set(A,28),a[23+(5+A.byteLength)+0]=128|Z.kSliceSPS,a[23+(5+A.byteLength)+1]=0,a[23+(5+A.byteLength)+2]=1,a[23+(5+A.byteLength)+3]=(65280&e.byteLength)>>8,a[23+(5+A.byteLength)+4]=255&e.byteLength,a.set(e,23+(5+A.byteLength)+5),a[23+(5+A.byteLength+5+e.byteLength)+0]=128|Z.kSlicePPS,a[23+(5+A.byteLength+5+e.byteLength)+1]=0,a[23+(5+A.byteLength+5+e.byteLength)+2]=1,a[23+(5+A.byteLength+5+e.byteLength)+3]=(65280&t.byteLength)>>8,a[23+(5+A.byteLength+5+e.byteLength)+4]=255&t.byteLength,a.set(t,23+(5+A.byteLength+5+e.byteLength)+5)}return A.prototype.getData=function(){return this.data},A}(),IA=function(){},CA=function(){},dA=function(){},hA=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],BA=function(){function A(A){this.TAG="AC3Parser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(2935==(t[e+0]<<8|t[e+1]))return e;e++}},A.prototype.readNextAC3Frame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=A[t+4]>>6,n=[48e3,44200,33e3][i],a=63&A[t+4],o=2*hA[i][a];if(t+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var r=this.findNextSyncwordOffset(t+o);this.current_syncword_offset_=r;var s=A[t+5]>>3,g=7&A[t+5],c=A[t+6]>>5,l=0;1&c&&1!==c&&(l+=2),4&c&&(l+=2),2===c&&(l+=2);var I=(A[t+6]<<8|A[t+7])>>12-l&1,C=[2,1,2,3,3,4,4,5][c]+I;(e=new dA).sampling_frequency=n,e.channel_count=C,e.channel_mode=c,e.bit_stream_identification=s,e.low_frequency_effects_channel_on=I,e.bit_stream_mode=g,e.frame_size_code=a,e.data=A.subarray(t,t+o)}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),uA=function(A){var e;e=[A.sampling_rate_code<<6|A.bit_stream_identification<<1|A.bit_stream_mode>>2,(3&A.bit_stream_mode)<<6|A.channel_mode<<3|A.low_frequency_effects_channel_on<<2|A.frame_size_code>>4,A.frame_size_code<<4&224],this.config=e,this.sampling_rate=A.sampling_frequency,this.bit_stream_identification=A.bit_stream_identification,this.bit_stream_mode=A.bit_stream_mode,this.low_frequency_effects_channel_on=A.low_frequency_effects_channel_on,this.channel_count=A.channel_count,this.channel_mode=A.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},EA=function(){},fA=function(){function A(A){this.TAG="EAC3Parser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(2935==(t[e+0]<<8|t[e+1]))return e;e++}},A.prototype.readNextEAC3Frame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=new C(A.subarray(t+2)),n=(i.readBits(2),i.readBits(3),i.readBits(11)+1<<1),a=i.readBits(2),o=null,r=null;3===a?(o=[24e3,22060,16e3][a=i.readBits(2)],r=3):(o=[48e3,44100,32e3][a],r=i.readBits(2));var s=i.readBits(3),g=i.readBits(1),c=i.readBits(5);if(t+n>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var l=this.findNextSyncwordOffset(t+n);this.current_syncword_offset_=l;var I=[2,1,2,3,3,4,4,5][s]+g;i.destroy(),(e=new EA).sampling_frequency=o,e.channel_count=I,e.channel_mode=s,e.bit_stream_identification=c,e.low_frequency_effects_channel_on=g,e.frame_size=n,e.num_blks=[1,2,3,6][r],e.data=A.subarray(t,t+n)}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),QA=function(A){var e,t=Math.floor(A.frame_size*A.sampling_frequency/(16*A.num_blks));e=[255&t,248&t,A.sampling_rate_code<<6|A.bit_stream_identification<<1,A.channel_mode<<1|A.low_frequency_effects_channel_on,0],this.config=e,this.sampling_rate=A.sampling_frequency,this.bit_stream_identification=A.bit_stream_identification,this.num_blks=A.num_blks,this.low_frequency_effects_channel_on=A.low_frequency_effects_channel_on,this.channel_count=A.channel_count,this.channel_mode=A.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},xA=function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},A(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}}(),pA=function(){return pA=Object.assign||function(A){for(var e,t=1,i=arguments.length;t0)&&!(i=a.next()).done;)o.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return o},yA=function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n=4?(n.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),t-=4):204===i&&n.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:i,sync_offset:t})},e.prototype.bindDataSource=function(A){return A.onDataArrival=this.parseChunks.bind(this),this},e.prototype.resetMediaInfo=function(){this.media_info_=new o.A},e.prototype.parseChunks=function(A,e){var t;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new c.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0;for(this.first_parse_&&(this.first_parse_=!1,i=this.sync_offset_);i+this.ts_packet_size_<=A.byteLength;){var a=e+i;192===this.ts_packet_size_&&(i+=4);var o=new Uint8Array(A,i,188),r=o[0];if(71!==r){n.A.e(this.TAG,"sync_byte = ".concat(r,", not 0x47"));break}var s=(64&o[1])>>>6,g=(o[1],(31&o[1])<<8|o[2]),l=(48&o[3])>>>4,I=15&o[3],C={},d=4;if(2===l||3===l){var h=o[4];if(5+h===188){i+=188,204===this.ts_packet_size_&&(i+=16);continue}h>0&&(C=this.parseAdaptationField(A,i+4,1+h)),d=5+h}if(1===l||3===l)if(0===g||g===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[g]===_.kSCTE35){var B=188-d;this.handleSectionSlice(A,i+d,B,{pid:g,file_position:a,payload_unit_start_indicator:s,continuity_conunter:I,random_access_indicator:C.random_access_indicator})}else if(void 0!==(null===(t=this.pmt_)||void 0===t?void 0:t.pid_stream_type[g])){B=188-d;var u=this.pmt_.pid_stream_type[g];(g===this.pmt_.common_pids.h264||g===this.pmt_.common_pids.h265||g===this.pmt_.common_pids.adts_aac||g===this.pmt_.common_pids.loas_aac||g===this.pmt_.common_pids.ac3||g===this.pmt_.common_pids.eac3||g===this.pmt_.common_pids.opus||g===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[g]||this.pmt_.timed_id3_pids[g])&&this.handlePESSlice(A,i+d,B,{pid:g,stream_type:u,file_position:a,payload_unit_start_indicator:s,continuity_conunter:I,random_access_indicator:C.random_access_indicator})}i+=188,204===this.ts_packet_size_&&(i+=16)}return this.dispatchAudioVideoMediaSegment(),i},e.prototype.parseAdaptationField=function(A,e,t){var i=new Uint8Array(A,e,t),a=i[0];return a>0?a>183?(n.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(a)),{}):{discontinuity_indicator:(128&i[1])>>>7,random_access_indicator:(64&i[1])>>>6,elementary_stream_priority_indicator:(32&i[1])>>>5}:{}},e.prototype.handleSectionSlice=function(A,e,t,i){var n=new Uint8Array(A,e,t),a=this.section_slice_queues_?this.section_slice_queues_[i.pid]:{};if(i.payload_unit_start_indicator){var o=n[0];if(void 0!==a&&0!==(null==a?void 0:a.total_length)){var r=new Uint8Array(A,e+1,Math.min(t,o));a.slices.push(r),a.total_length+=r.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):this.clearSlices(a,i)}for(var s=1+o;s=a.expected_length&&this.clearSlices(a,i),s+=r.byteLength}}else void 0!==a&&0!==a.total_length&&(r=new Uint8Array(A,e,Math.min(t,a.expected_length-a.total_length)),a.slices.push(r),a.total_length+=r.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):a.total_length>=a.expected_length&&this.clearSlices(a,i))},e.prototype.handlePESSlice=function(A,e,t,i){var a=new Uint8Array(A,e,t),o=a[0]<<16|a[1]<<8|a[2],r=(a[3],a[4]<<8|a[5]);if(i.payload_unit_start_indicator){if(1!==o)return void n.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(o));var s=this.pes_slice_queues_[i.pid];s&&(0===s.expected_length||s.expected_length===s.total_length?this.emitPESSlices(s,i):this.clearSlices(s,i)),this.pes_slice_queues_&&(this.pes_slice_queues_[i.pid]=new F,this.pes_slice_queues_[i.pid].file_position=i.file_position,this.pes_slice_queues_[i.pid].random_access_indicator=i.random_access_indicator)}if(void 0!==this.pes_slice_queues_[i.pid]){var g=this.pes_slice_queues_[i.pid];g.slices.push(a),i.payload_unit_start_indicator&&(g.expected_length=0===r?0:r+6),g.total_length+=a.byteLength,g.expected_length>0&&g.expected_length===g.total_length?this.emitPESSlices(g,i):g.expected_length>0&&g.expected_length>>6,r=e[8],s=void 0,g=void 0;2!==o&&3!==o||(s=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,g=3===o?536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2:s);var c=9+r,l=void 0;if(0!==a){if(a<3+r)return void n.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");l=a-3-r}else l=e.byteLength-c;var I=e.subarray(c,c+l);switch(A.stream_type){case _.kMPEG1Audio:case _.kMPEG2Audio:this.parseMP3Payload(I,s);break;case _.kPESPrivateData:this.pmt_.common_pids.opus===A.pid?this.parseOpusPayload(I,s):this.pmt_.common_pids.ac3===A.pid?this.parseAC3Payload(I,s):this.pmt_.common_pids.eac3===A.pid?this.parseEAC3Payload(I,s):this.pmt_.smpte2038_pids[A.pid]?this.parseSMPTE2038MetadataPayload(I,s,g,A.pid,i):this.parsePESPrivateDataPayload(I,s,g,A.pid,i);break;case _.kADTSAAC:this.parseADTSAACPayload(I,s);break;case _.kLOASAAC:this.parseLOASAACPayload(I,s);break;case _.kAC3:this.parseAC3Payload(I,s);break;case _.kEAC3:this.parseEAC3Payload(I,s);break;case _.kID3:this.parseTimedID3MetadataPayload(I,s,g,A.pid,i);break;case _.kH264:this.parseH264Payload(I,s,g,A.file_position,A.random_access_indicator);break;case _.kH265:this.parseH265Payload(I,s,g,A.file_position,A.random_access_indicator)}}else 188!==i&&191!==i&&240!==i&&241!==i&&255!==i&&242!==i&&248!==i||A.stream_type!==_.kPESPrivateData||(c=6,l=void 0,l=0!==a?a:e.byteLength-c,I=e.subarray(c,c+l),this.parsePESPrivateDataPayload(I,void 0,void 0,A.pid,i));else n.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(t))},e.prototype.parsePAT=function(A){var e=A[0];if(0===e){var t=(15&A[1])<<8|A[2],i=(A[3],A[4],(62&A[5])>>>1),a=1&A[5],o=A[6],r=(A[7],null);if(1===a&&0===o)(r=new S).version_number=i;else if(null==(r=this.pat_))return;for(var s=t-5-4,g=-1,c=-1,l=8;l<8+s;l+=4){var I=A[l]<<8|A[l+1],C=(31&A[l+2])<<8|A[l+3];0===I?r.network_pid=C:(r.program_pmt_pid[I]=C,-1===g&&(g=I),-1===c&&(c=C))}1===a&&0===o&&(void 0===this.pat_&&n.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(r))),this.pat_=r,this.current_program_=g,this.current_pmt_pid_=c)}else n.A.e(this.TAG,"parsePAT: table_id ".concat(e," is not corresponded to PAT!"))},e.prototype.parsePMT=function(A){var e=A[0];if(2===e){var t=(15&A[1])<<8|A[2],i=A[3]<<8|A[4],a=(62&A[5])>>>1,o=1&A[5],r=A[6],s=(A[7],null);if(1===o&&0===r)(s=new w).program_number=i,s.version_number=a,this.program_pmt_map_[i]=s;else if(null==(s=this.program_pmt_map_[i]))return;A[8],A[9];for(var g=(15&A[10])<<8|A[11],c=12+g,l=t-9-g-4,I=c;I0){for(var E=I+5;E1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(g,"ms, PES pts: ").concat(s,"ms")),s=g)}}for(var c=new K(A),l=null,I=s,C=0;null!=(l=c.readNextAACFrame());){r=1024/l.sampling_frequency*1e3;var d={codec:"aac",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(d)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(d)):(this.audio_metadata_={codec:"aac",audio_object_type:l.audio_object_type,sampling_freq_index:l.sampling_freq_index,sampling_frequency:l.sampling_frequency,channel_config:l.channel_config},this.dispatchAudioInitSegment(d)),C=I;var h=Math.floor(I),B={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(a=this.audio_track_)||void 0===a||a.samples.push(B),this.audio_track_.length+=l.data.byteLength),I+=r}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),C&&(this.aac_last_sample_pts_=C)}},e.prototype.parseLOASAACPayload=function(A,e){var t,i,a;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var o=new Uint8Array(A.byteLength+this.aac_last_incomplete_data_.byteLength);o.set(this.aac_last_incomplete_data_,0),o.set(A,this.aac_last_incomplete_data_.byteLength),A=o}var r,s=0;if(void 0!==e&&(s=e/this.timescale_),"aac"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec)){if(void 0===e&&void 0!==this.aac_last_sample_pts_)r=1024/this.audio_metadata_.sampling_frequency*1e3,s=this.aac_last_sample_pts_+r;else if(void 0===e)return void n.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){r=1024/this.audio_metadata_.sampling_frequency*1e3;var g=this.aac_last_sample_pts_+r;Math.abs(g-s)>1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(g,"ms, PES pts: ").concat(s,"ms")),s=g)}}for(var c=new V(A),l=null,I=s,C=0;null!=(l=c.readNextAACFrame(null!==(i=this.loas_previous_frame)&&void 0!==i?i:void 0));){this.loas_previous_frame=l,r=1024/l.sampling_frequency*1e3;var d={codec:"aac",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(d)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(d)):(this.audio_metadata_={codec:"aac",audio_object_type:l.audio_object_type,sampling_freq_index:l.sampling_freq_index,sampling_frequency:l.sampling_frequency,channel_config:l.channel_config},this.dispatchAudioInitSegment(d)),C=I;var h=Math.floor(I),B={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(a=this.audio_track_)||void 0===a||a.samples.push(B),this.audio_track_.length+=l.data.byteLength),I+=r}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),C&&(this.aac_last_sample_pts_=C)}},e.prototype.parseAC3Payload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,o=0;if(void 0!==e&&(o=e/this.timescale_),"ac-3"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=1536/this.audio_metadata_.sampling_frequency*1e3,o=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"AC3: Unknown pts");for(var r=new BA(A),s=null,g=o,c=0;null!=(s=r.readNextAC3Frame());){a=1536/s.sampling_frequency*1e3;var l={codec:"ac-3",data:s};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,bit_stream_mode:s.bit_stream_mode,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(l)),c=g;var I=Math.floor(g),C={unit:s.data,length:s.data.byteLength,pts:I,dts:I};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(C),this.audio_track_.length+=s.data.byteLength),g+=a}c&&(this.aac_last_sample_pts_=c)}},e.prototype.parseEAC3Payload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,o=0;if(void 0!==e&&(o=e/this.timescale_),"ec-3"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,o=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"EAC3: Unknown pts");for(var r=new fA(A),s=null,g=o,c=0;null!=(s=r.readNextEAC3Frame());){a=1536/s.sampling_frequency*1e3;var l={codec:"ec-3",data:s};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,num_blks:s.num_blks,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(l)),c=g;var I=Math.floor(g),C={unit:s.data,length:s.data.byteLength,pts:I,dts:I};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(C),this.audio_track_.length+=s.data.byteLength),g+=a}c&&(this.aac_last_sample_pts_=c)}},e.prototype.parseOpusPayload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,o=0;if(void 0!==e&&(o=e/this.timescale_),"opus"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=20,o=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"Opus: Unknown pts");for(var r=o,s=0,g=0;g>>3&3,n=(6&A[1])>>1,a=(A[2],(12&A[2])>>>2),o=3&~(A[3]>>>6)?2:1,r=0,s=34;switch(i){case 0:r=[11025,12e3,8e3,0][a];break;case 2:r=[22050,24e3,16e3,0][a];break;case 3:r=[44100,48e3,32e3,0][a]}switch(n){case 1:s=34;break;case 2:s=33;break;case 3:s=32}var g=new CA;g.object_type=s,g.sample_rate=r,g.channel_count=o,g.data=A;var c={codec:"mp3",data:g};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"mp3",object_type:s,sample_rate:r,channel_count:o},this.dispatchAudioInitSegment(c));var l={unit:A,length:A.byteLength,pts:e/this.timescale_,dts:e/this.timescale_};this.audio_track_&&(null===(t=this.audio_track_)||void 0===t||t.samples.push(l),this.audio_track_.length+=A.byteLength)}},e.prototype.detectAudioMetadataChange=function(A){var e,t,i,a;if(A.codec!==(null===(e=this.audio_metadata_)||void 0===e?void 0:e.codec))return n.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec," to ").concat(A.codec)),!0;if("aac"===A.codec&&"aac"===this.audio_metadata_.codec){if((o=A.data).audio_object_type!==this.audio_metadata_.audio_object_type)return n.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(o.audio_object_type)),!0;if(o.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return n.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(o.sampling_freq_index)),!0;if(o.channel_config!==this.audio_metadata_.channel_config)return n.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(i=this.audio_metadata_)||void 0===i?void 0:i.channel_config," to ").concat(o.channel_config)),!0}else if("ac-3"===A.codec&&"ac-3"===this.audio_metadata_.codec){var o;if((o=A.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return n.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(a=this.audio_metadata_)||void 0===a?void 0:a.sampling_frequency," to ").concat(o.sampling_frequency)),!0;if(o.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return n.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(o.bit_stream_identification)),!0;if(o.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return n.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(o.bit_stream_mode)),!0;if(o.channel_mode!==this.audio_metadata_.channel_mode)return n.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(o.channel_mode)),!0;if(o.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return n.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(o.low_frequency_effects_channel_on)),!0}else if("opus"===A.codec&&"opus"===this.audio_metadata_.codec){if((r=A.meta).sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(r.sample_rate)),!0;if(r.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(r.channel_count)),!0}else if("mp3"===A.codec&&"mp3"===this.audio_metadata_.codec){var r;if((r=A.data).object_type!==this.audio_metadata_.object_type)return n.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(r.object_type)),!0;if(r.sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(r.sample_rate)),!0;if(r.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(r.channel_count)),!0}return!1},e.prototype.dispatchAudioInitSegment=function(A){var e,t,i,a,o,r,s={type:"audio"};if(s.id=null===(e=this.audio_track_)||void 0===e?void 0:e.id,s.timescale=1e3,s.duration=this.duration_,"aac"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec)){var g="aac"===A.codec?A.data:null,c=new O(g);s.audioSampleRate=c.sampling_rate,s.channelCount=c.channel_count,s.codec=c.codec_mimetype,s.originalCodec=c.original_codec_mimetype,s.config=c.config,s.refSampleDuration=1024/s.audioSampleRate*s.timescale}else if("ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var l="ac-3"===A.codec?A.data:null,I=new uA(l);s.audioSampleRate=I.sampling_rate,s.channelCount=I.channel_count,s.codec=I.codec_mimetype,s.originalCodec=I.original_codec_mimetype,s.config=I.config,s.refSampleDuration=1536/s.audioSampleRate*s.timescale}else if("ec-3"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)){var C="ec-3"===A.codec?A.data:null,d=new QA(C);s.audioSampleRate=d.sampling_rate,s.channelCount=d.channel_count,s.codec=d.codec_mimetype,s.originalCodec=d.original_codec_mimetype,s.config=d.config,s.refSampleDuration=256*d.num_blks/s.audioSampleRate*s.timescale}else"opus"===(null===(o=this.audio_metadata_)||void 0===o?void 0:o.codec)?(s.audioSampleRate=this.audio_metadata_.sample_rate,s.channelCount=this.audio_metadata_.channel_count,s.channelConfigCode=this.audio_metadata_.channel_config_code,s.codec="opus",s.originalCodec="opus",s.config=void 0,s.refSampleDuration=20):"mp3"===(null===(r=this.audio_metadata_)||void 0===r?void 0:r.codec)&&(s.audioSampleRate=this.audio_metadata_.sample_rate,s.channelCount=this.audio_metadata_.channel_count,s.codec="mp3",s.originalCodec="mp3",s.config=void 0);this.audio_init_segment_dispatched_||n.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(s.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",s),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var h=this.media_info_;h.hasAudio=!0,h.audioCodec=s.originalCodec,h.audioSampleRate=s.audioSampleRate,h.audioChannelCount=s.channelCount,h.hasVideo&&h.videoCodec?h.mimeType='video/mp2t; codecs="'.concat(h.videoCodec,",").concat(h.audioCodec,'"'):h.mimeType='video/mp2t; codecs="'.concat(h.audioCodec,'"'),h.isComplete()&&this.onMediaInfo&&this.onMediaInfo(h)},e.prototype.dispatchPESPrivateDataDescriptor=function(A,e,t){var i=new W;i.pid=A,i.stream_type=e,i.descriptor=t,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(i)},e.prototype.parsePESPrivateDataPayload=function(A,e,t,i,n){var a=new j;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var o=Math.floor(e/this.timescale_);a.pts=o}else a.nearest_pts=this.aac_last_sample_pts_;if(void 0!==t){var r=Math.floor(t/this.timescale_);a.dts=r}this.onPESPrivateData&&this.onPESPrivateData(a)},e.prototype.parseTimedID3MetadataPayload=function(A,e,t,i,n){var a=new j;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var o=Math.floor(e/this.timescale_);a.pts=o}if(void 0!==t){var r=Math.floor(t/this.timescale_);a.dts=r}this.onTimedID3Metadata&&this.onTimedID3Metadata(a)},e.prototype.parseSMPTE2038MetadataPayload=function(A,e,t,i,n){var a=new IA;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var o=Math.floor(e/this.timescale_);a.pts=o}if(a.nearest_pts=this.aac_last_sample_pts_,void 0!==t){var r=Math.floor(t/this.timescale_);a.dts=r}a.ancillaries=function(A){for(var e=new C(A),t=0,i=[];t+=6,0===e.readBits(6);){var n=e.readBool();t+=1;var a=e.readBits(11);t+=11;var o=e.readBits(12);t+=12;var r=255&e.readBits(10);t+=10;var s=255&e.readBits(10);t+=10;var g=255&e.readBits(10);t+=10;for(var c=new Uint8Array(g),l=0;l>>24&255,n[1]=i>>>16&255,n[2]=i>>>8&255,n[3]=255&i,n.set(A,4);var s=8;for(r=0;r>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},A.trak=function(e){return A.box(A.types.trak,A.tkhd(e),A.mdia(e))},A.tkhd=function(e){var t=e.id,i=e.duration,n=e.presentWidth,a=e.presentHeight;return A.box(A.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>>8&255,255&n,0,0,a>>>8&255,255&a,0,0]))},A.mdia=function(e){return A.box(A.types.mdia,A.mdhd(e),A.hdlr(e),A.minf(e))},A.mdhd=function(e){var t=e.timescale,i=e.duration;return A.box(A.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))},A.hdlr=function(e){var t;return t="audio"===e.type?A.constants.HDLR_AUDIO:A.constants.HDLR_VIDEO,A.box(A.types.hdlr,t)},A.minf=function(e){var t;return t="audio"===e.type?A.box(A.types.smhd,A.constants.SMHD):A.box(A.types.vmhd,A.constants.VMHD),A.box(A.types.minf,t,A.dinf(),A.stbl(e))},A.dinf=function(){return A.box(A.types.dinf,A.box(A.types.dref,A.constants.DREF))},A.stbl=function(e){return A.box(A.types.stbl,A.stsd(e),A.box(A.types.stts,A.constants.STTS),A.box(A.types.stsc,A.constants.STSC),A.box(A.types.stsz,A.constants.STSZ),A.box(A.types.stco,A.constants.STCO))},A.stsd=function(e){return"audio"===e.type?"mp3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.mp3(e)):"ac-3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.ac3(e)):"ec-3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.ec3(e)):"opus"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.Opus(e)):A.box(A.types.stsd,A.constants.STSD_PREFIX,A.mp4a(e)):"video"===e.type&&e.codec.startsWith("hvc1")?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.hvc1(e)):"video"===e.type&&e.codec.startsWith("av01")?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.av01(e)):A.box(A.types.stsd,A.constants.STSD_PREFIX,A.avc1(e))},A.mp3=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types[".mp3"],n)},A.mp4a=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types.mp4a,n,A.esds(e))},A.ac3=function(e){var t,i=e.channelCount,n=e.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return A.box(A.types["ac-3"],a,A.box(A.types.dac3,new Uint8Array(null!==(t=e.config)&&void 0!==t?t:[])))},A.ec3=function(e){var t,i=e.channelCount,n=e.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return A.box(A.types["ec-3"],a,A.box(A.types.dec3,new Uint8Array(null!==(t=e.config)&&void 0!==t?t:[])))},A.esds=function(e){var t,i=null!==(t=e.config)&&void 0!==t?t:[],n=i.length,a=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(i).concat([6,1,2]));return A.box(A.types.esds,a)},A.Opus=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types.Opus,n,A.dOps(e))},A.dOps=function(e){var t=e.channelCount,i=e.channelConfigCode,n=e.audioSampleRate,a=[];switch(i){case 1:case 2:a=[0];break;case 0:a=[255,1,1,0,1];break;case 128:a=[255,2,0,0,1];break;case 3:a=[1,2,1,0,2,1];break;case 4:a=[1,2,2,0,1,2,3];break;case 5:a=[1,3,2,0,4,1,2,3];break;case 6:a=[1,4,2,0,4,1,2,3,5];break;case 7:a=[1,4,2,0,4,1,2,3,5,6];break;case 8:a=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:a=[1,1,2,0,1];break;case 131:a=[1,1,3,0,1,2];break;case 132:a=[1,1,4,0,1,2,3];break;case 133:a=[1,1,5,0,1,2,3,4];break;case 134:a=[1,1,6,0,1,2,3,4,5];break;case 135:a=[1,1,7,0,1,2,3,4,5,6];break;case 136:a=[1,1,8,0,1,2,3,4,5,6,7]}var o=new Uint8Array(function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n>>24&255,n>>>17&255,n>>>8&255,n>>>0&255,0,0],function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var i,n,a=t.call(A),o=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return o}(a),!1));return A.box(A.types.dOps,o)},A.avc1=function(e){var t=e.avcc,i=e.codecWidth,n=e.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.avc1,a,A.box(A.types.avcC,t))},A.hvc1=function(e){var t=e.hvcc,i=e.codecWidth,n=e.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.hvc1,a,A.box(A.types.hvcC,t))},A.av01=function(e){var t,i,n=e.av1c,a=null!==(t=e.codecWidth)&&void 0!==t?t:192,o=null!==(i=e.codecHeight)&&void 0!==i?i:108,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>>8&255,255&a,o>>>8&255,255&o,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.av01,r,A.box(A.types.av1C,n))},A.mvex=function(e){return A.box(A.types.mvex,A.trex(e))},A.trex=function(e){var t=e.id,i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return A.box(A.types.trex,i)},A.moof=function(e,t){return A.box(A.types.moof,A.mfhd(e.sequenceNumber),A.traf(e,t))},A.mfhd=function(e){var t=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return A.box(A.types.mfhd,t)},A.traf=function(e,t){var i=e.id,n=A.box(A.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=A.box(A.types.tfdt,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),o=A.sdtp(e),r=A.trun(e,o.byteLength+16+16+8+16+8+8);return A.box(A.types.traf,n,a,r,o)},A.sdtp=function(e){for(var t=e.samples||[],i=t.length,n=new Uint8Array(4+i),a=0;a>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0);for(var r=0;r>>24&255,s>>>16&255,s>>>8&255,255&s,g>>>24&255,g>>>16&255,g>>>8&255,255&g,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*r)}return A.box(A.types.trun,o)},A.mdat=function(e){return A.box(A.types.mdat,e)},A.constants={FTYP:new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),STSD_PREFIX:new Uint8Array([0,0,0,0,0,0,0,1]),STTS:DA,STSC:DA,STCO:DA,STSZ:new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),HDLR_VIDEO:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),HDLR_AUDIO:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),DREF:new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),SMHD:new Uint8Array([0,0,0,0,0,0,0,0]),VMHD:new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},A}();wA.init();const vA=wA,bA=function(){function A(){}return A.getSilentFrame=function(A,e){if("mp4a.40.2"===A){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},A}();var FA=t(453);const RA=function(){function A(A){var e;this.TAG="MP4Remuxer",this._fillSilentAfterSeek=!1,this._config=A,this._isLive=!!A.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new FA.Sc("audio"),this._videoSegmentInfoList=new FA.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!a.A.chrome||!(a.A.version&&a.A.version.major<50||a.A.version&&50===a.A.version.major&&((null===(e=a.A.version)||void 0===e?void 0:e.build)||0)<2661)),this._fillSilentAfterSeek=!(!a.A.msedge&&!a.A.msie),this._mp3UseMpegAudio=!a.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return A.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},A.prototype.bindDataSource=function(A){var e;return A.onDataAvailable=null===(e=this.remux)||void 0===e?void 0:e.bind(this),A.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(A.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(A){this._onInitSegment=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(A){this._onMediaSegment=A},enumerable:!1,configurable:!0}),A.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},A.prototype.seek=function(A){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},A.prototype.remux=function(A,e){if(!this._onMediaSegment)throw new c.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(A,e),e&&this._remuxVideo(e),A&&this._remuxAudio(A)},A.prototype._onTrackMetadataReceived=function(A,e){var t=null,i="mp4",n=e.codec;if("audio"===A)this._audioMeta=e,"mp3"===e.codec&&this._mp3UseMpegAudio?(i="mpeg",n="",t=new Uint8Array):t=vA.generateInitSegment(e);else{if("video"!==A)return;this._videoMeta=e,t=vA.generateInitSegment(e)}if(!this._onInitSegment)throw new c.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(A,{type:A,data:t.buffer,codec:n,container:"".concat(A,"/").concat(i),mediaDuration:e.duration})},A.prototype._calculateDtsBase=function(A,e){var t,i;this._dtsBaseInited||((null===(t=null==A?void 0:A.samples)||void 0===t?void 0:t.length)&&(this._audioDtsBase=A.samples[0].dts),(null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._videoDtsBase=e.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},A.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},A.prototype.flushStashedSamples=function(){var A=this._videoStashedLastSample,e=this._audioStashedLastSample,t={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=A&&(t.samples.push(A),t.length=null==A?void 0:A.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=null==e?void 0:e.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(t,!0),this._remuxAudio(i,!0)},A.prototype._remuxAudio=function(A,e){var t,i,o,r,s,g,c;if(null!=this._audioMeta){var l,I,C=A,d=C.samples,h=-1,B=this._audioMeta.refSampleDuration,u="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,E=this._dtsBaseInited&&void 0===this._audioNextDts,f=!1;if(d&&0!==d.length&&(1!==d.length||e)){var Q=0,x=null,p=0;u?(Q=0,p=C.length):(Q=8,p=8+C.length);var m=null;if(d.length>1&&(p-=(m=d.pop()).length),null!=this._audioStashedLastSample){var y=this._audioStashedLastSample;this._audioStashedLastSample=null,d.unshift(y),p+=y.length}null!=m&&(this._audioStashedLastSample=m);var _=d[0].dts-this._dtsBase;if(this._audioNextDts)l=_-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())l=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(f=!0);else{var S=this._audioSegmentInfoList.getLastSampleBefore(_);if(null!=S){var D=_-(S.originalDts+S.duration);D<=3&&(D=0),l=_-(S.dts+S.duration+D)}else l=0}if(f){var w=_-l,v=this._videoSegmentInfoList.getLastSegmentBefore(_);if(null!=v&&v.beginDts=3*(B||0)&&this._fillAudioTimestampGap&&!a.A.safari){T=!0;var G,U=Math.floor(l/(B||0));n.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(N," ms, curRefDts: ").concat(Y," ms, ")+"dtsCorrection: ".concat(Math.round(l)," ms, generate: ").concat(U," frames")),b=Math.floor(Y),L=Math.floor(Y+(B||0))-b,null==(G=bA.getSilentFrame(null===(o=this._audioMeta)||void 0===o?void 0:o.originalCodec,this._audioMeta.channelCount))&&(n.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(r=this._audioMeta)||void 0===r?void 0:r.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),G=P),M=[];for(var J=0;J=1?null===(s=R[R.length-1])||void 0===s?void 0:s.duration:Math.floor(B||0),this._audioNextDts=b+L;-1===h&&(h=b),R.push({dts:b,pts:b,cts:0,unit:y.unit,size:null===(g=y.unit)||void 0===g?void 0:g.byteLength,duration:L,originalDts:N,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),T&&R.push.apply(R,M)}}if(0===R.length)return C.samples=[],void(C.length=0);for(u?x=new Uint8Array(p):((x=new Uint8Array(p))[0]=p>>>24&255,x[1]=p>>>16&255,x[2]=p>>>8&255,x[3]=255&p,x.set(vA.types.mdat,4)),k=0;k1&&(C-=(d=s.pop()).length),null!=this._videoStashedLastSample){var h=this._videoStashedLastSample;this._videoStashedLastSample=null,s.unshift(h),C+=(null==h?void 0:h.length)||0}null!=d&&(this._videoStashedLastSample=d);var B=s[0].dts-this._dtsBase;if(this._videoNextDts)n=B-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())n=0;else{var u=this._videoSegmentInfoList.getLastSampleBefore(B);if(null!=u){var E=B-(u.originalDts+u.duration);E<=3&&(E=0),n=B-(u.dts+u.duration+E)}else n=0}for(var f=new FA.EZ,Q=[],x=0;x=1?Q[Q.length-1].duration:Math.floor((null===(t=this._videoMeta)||void 0===t?void 0:t.refSampleDuration)||0),m){var w=new FA.$_(y,S,D,h.dts,!0);w.fileposition=h.fileposition,f.appendSyncPoint(w)}Q.push({dts:y,pts:S,cts:_,units:h.units,size:h.length,isKeyframe:m,duration:D,originalDts:p,flags:{isLeading:0,dependsOn:m?2:1,isDependedOn:m?1:0,hasRedundancy:0,isNonSync:m?0:1}})}for((I=new Uint8Array(C))[0]=C>>>24&255,I[1]=C>>>16&255,I[2]=C>>>8&255,I[3]=255&C,I.set(vA.types.mdat,4),x=0;x0)null===(t=this._demuxer)||void 0===t||t.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(i=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===i?void 0:i.timestampBase:0,g=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(A,e))||0;else{var c=null;(c=m.probe(A)).match&&(this._setupFLVDemuxerRemuxer(c),g=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(A,e))||0),c.match||(null==c?void 0:c.needMoreData)||(c=SA.probe(A)).match&&(this._setupTSDemuxerRemuxer(c),g=(null===(r=this._demuxer)||void 0===r?void 0:r.parseChunks(A,e))||0),c.match||(null==c?void 0:c.needMoreData)||(c=null,n.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){s._internalAbort()})),this._emitter.emit(PA.A.DEMUX_ERROR,h.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return g},A.prototype._setupFLVDemuxerRemuxer=function(A){var e;this._demuxer=new m(A,this._config),this._remuxer||(this._remuxer=new RA(this._config));var t=this._mediaDataSource;void 0===t.duration||isNaN(t.duration)||(this._demuxer.overridedDuration=t.duration),"boolean"==typeof t.hasAudio&&(this._demuxer.overridedHasAudio=t.hasAudio),"boolean"==typeof t.hasVideo&&(this._demuxer.overridedHasVideo=t.hasVideo),t.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(e=null==t?void 0:t.segments[this._currentSegmentIndex])||void 0===e?void 0:e.timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this))},A.prototype._setupTSDemuxerRemuxer=function(A){var e=this._demuxer=new SA(A,this._config);this._remuxer||(this._remuxer=new RA(this._config)),e.onError=this._onDemuxException.bind(this),e.onMediaInfo=this._onMediaInfo.bind(this),e.onMetaDataArrived=this._onMetaDataArrived.bind(this),e.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),e.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),e.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),e.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),e.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},A.prototype._onMediaInfo=function(A){var e,t,i=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},A),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(t=null===(e=this._mediaDataSource)||void 0===e?void 0:e.segments)||void 0===t?void 0:t.length)||0,Object.setPrototypeOf(this._mediaInfo,o.A.prototype));var n=Object.assign({},A);Object.setPrototypeOf(n,o.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=n),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var A=i._pendingSeekTime;i._pendingSeekTime=null,i.seek(A)}))},A.prototype._onMetaDataArrived=function(A){this._emitter.emit(PA.A.METADATA_ARRIVED,A)},A.prototype._onScriptDataArrived=function(A){this._emitter.emit(PA.A.SCRIPTDATA_ARRIVED,A)},A.prototype._onTimedID3Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.dts&&(A.dts-=t),this._emitter.emit(PA.A.TIMED_ID3_METADATA_ARRIVED,A))},A.prototype._onSMPTE2038Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.dts&&(A.dts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),this._emitter.emit(PA.A.SMPTE2038_METADATA_ARRIVED,A))},A.prototype._onSCTE35Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),this._emitter.emit(PA.A.SCTE35_METADATA_ARRIVED,A))},A.prototype._onPESPrivateDataDescriptor=function(A){this._emitter.emit(PA.A.PES_PRIVATE_DATA_DESCRIPTOR,A)},A.prototype._onPESPrivateData=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),void 0!==A.dts&&(A.dts-=t),this._emitter.emit(PA.A.PES_PRIVATE_DATA_ARRIVED,A))},A.prototype._onIOSeeked=function(){var A;null===(A=this._remuxer)||void 0===A||A.insertDiscontinuity()},A.prototype._onIOComplete=function(A){var e,t,i=A+1;i<((null===(t=null===(e=this._mediaDataSource)||void 0===e?void 0:e.segments)||void 0===t?void 0:t.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(i)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(PA.A.LOADING_COMPLETE),this._disableStatisticsReporter())},A.prototype._onIORedirect=function(A){var e,t=null===(e=this._ioctl)||void 0===e?void 0:e.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[t].redirectedURL=A)},A.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(PA.A.RECOVERED_EARLY_EOF)},A.prototype._onIOException=function(A,e){n.A.e(this.TAG,"IOException: type = ".concat(A,", code = ").concat(e.code,", msg = ").concat(e.msg)),this._emitter.emit(PA.A.IO_ERROR,A,e),this._disableStatisticsReporter()},A.prototype._onDemuxException=function(A,e){n.A.e(this.TAG,"DemuxException: type = ".concat(A,", info = ").concat(e)),this._emitter.emit(PA.A.DEMUX_ERROR,A,e)},A.prototype._onRemuxerInitSegmentArrival=function(A,e){this._emitter.emit(PA.A.INIT_SEGMENT,A,e)},A.prototype._onRemuxerMediaSegmentArrival=function(A,e){if(null==this._pendingSeekTime&&(this._emitter.emit(PA.A.MEDIA_SEGMENT,A,e),null!=this._pendingResolveSeekPoint&&"video"===A)){var t=e.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,a.A.safari&&t.length>0&&t[0].originalDts===i&&(i=t[0].pts),this._emitter.emit(PA.A.RECOMMEND_SEEKPOINT,i)}},A.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},A.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},A.prototype._reportSegmentMediaInfo=function(A){var e,t,i,n,a=(null===(e=this._mediaInfo)||void 0===e?void 0:e.segments)?null===(t=this._mediaInfo)||void 0===t?void 0:t.segments[A]:{},o=Object.assign({},a);o.duration=null===(i=this._mediaInfo)||void 0===i?void 0:i.duration,o.segmentCount=null===(n=this._mediaInfo)||void 0===n?void 0:n.segmentCount,delete o.segments,delete o.keyframesIndex,this._emitter.emit(PA.A.MEDIA_INFO,o)},A.prototype._reportStatisticsInfo=function(){var A,e,t,i,n,a,o={};o.url=null===(A=this._ioctl)||void 0===A?void 0:A.currentURL,o.hasRedirect=null===(e=this._ioctl)||void 0===e?void 0:e.hasRedirect,o.hasRedirect&&(o.redirectedURL=null===(t=this._ioctl)||void 0===t?void 0:t.currentRedirectedURL),o.speed=null===(i=this._ioctl)||void 0===i?void 0:i.currentSpeed,o.loaderType=null===(n=this._ioctl)||void 0===n?void 0:n.loaderType,o.currentSegmentIndex=this._currentSegmentIndex,o.totalSegmentCount=null===(a=this._mediaDataSource.segments)||void 0===a?void 0:a.length,this._emitter.emit(PA.A.STATISTICS_INFO,o)},A}()},716:(A,e,t)=>{t.d(e,{A:()=>i});const i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},291:(A,e,t)=>{var i=t(641),n=t(976),a=t(716),o=null,r=function(A,e){self.postMessage({msg:"logcat_callback",data:{type:A,logcat:e}})};function s(A,e){var t={msg:a.A.INIT_SEGMENT,data:{type:A,data:e}};self.postMessage(t,[e.data])}function g(A,e){var t={msg:a.A.MEDIA_SEGMENT,data:{type:A,data:e}};self.postMessage(t,[e.data])}function c(){var A={msg:a.A.LOADING_COMPLETE};self.postMessage(A)}function l(){var A={msg:a.A.RECOVERED_EARLY_EOF};self.postMessage(A)}function I(A){var e={msg:a.A.MEDIA_INFO,data:A};self.postMessage(e)}function C(A){var e={msg:a.A.METADATA_ARRIVED,data:A};self.postMessage(e)}function d(A){var e={msg:a.A.SCRIPTDATA_ARRIVED,data:A};self.postMessage(e)}function h(A){var e={msg:a.A.TIMED_ID3_METADATA_ARRIVED,data:A};self.postMessage(e)}function B(A){var e={msg:a.A.SMPTE2038_METADATA_ARRIVED,data:A};self.postMessage(e)}function u(A){var e={msg:a.A.SCTE35_METADATA_ARRIVED,data:A};self.postMessage(e)}function E(A){var e={msg:a.A.PES_PRIVATE_DATA_DESCRIPTOR,data:A};self.postMessage(e)}function f(A){var e={msg:a.A.PES_PRIVATE_DATA_ARRIVED,data:A};self.postMessage(e)}function Q(A){var e={msg:a.A.STATISTICS_INFO,data:A};self.postMessage(e)}function x(A,e){self.postMessage({msg:a.A.IO_ERROR,data:{type:A,info:e}})}function p(A,e){self.postMessage({msg:a.A.DEMUX_ERROR,data:{type:A,info:e}})}function m(A){self.postMessage({msg:a.A.RECOMMEND_SEEKPOINT,data:A})}self.addEventListener("message",(function(A){switch(A.data.cmd){case"init":(o=new n.A(A.data.param[0],A.data.param[1])).on(a.A.IO_ERROR,x),o.on(a.A.DEMUX_ERROR,p),o.on(a.A.INIT_SEGMENT,s),o.on(a.A.MEDIA_SEGMENT,g),o.on(a.A.LOADING_COMPLETE,c),o.on(a.A.RECOVERED_EARLY_EOF,l),o.on(a.A.MEDIA_INFO,I),o.on(a.A.METADATA_ARRIVED,C),o.on(a.A.SCRIPTDATA_ARRIVED,d),o.on(a.A.TIMED_ID3_METADATA_ARRIVED,h),o.on(a.A.SMPTE2038_METADATA_ARRIVED,B),o.on(a.A.SCTE35_METADATA_ARRIVED,u),o.on(a.A.PES_PRIVATE_DATA_DESCRIPTOR,E),o.on(a.A.PES_PRIVATE_DATA_ARRIVED,f),o.on(a.A.STATISTICS_INFO,Q),o.on(a.A.RECOMMEND_SEEKPOINT,m);break;case"destroy":o&&(o.destroy(),o=null),self.postMessage({msg:"destroyed"});break;case"start":null==o||o.start();break;case"stop":null==o||o.stop();break;case"seek":null==o||o.seek(A.data.param);break;case"pause":null==o||o.pause();break;case"resume":null==o||o.resume();break;case"logging_config":var e=A.data.param;i.A.applyConfig(e),!0===e.enableCallback?i.A.addLogListener(r):i.A.removeLogListener(r)}}))},465:(A,e,t)=>{t.d(e,{A:()=>i});const i={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},133:(A,e,t)=>{t.d(e,{default:()=>K});var i={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},n=t(302),a={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function o(){return Object.assign({},a)}var r=function(){function A(){}return A.supportMSEH264Playback=function(){var A;return null===(A=window.MediaSource)||void 0===A?void 0:A.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},A.supportMSEH265Playback=function(){var A;return null===(A=window.MediaSource)||void 0===A?void 0:A.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},A.supportNetworkStreamIO=function(){var A=new n.A({},o()),e=A.loaderType;return A.destroy(),"fetch-stream-loader"===e||"xhr-moz-chunked-loader"===e},A.getNetworkLoaderTypeName=function(){var A=new n.A({},o()),e=A.loaderType;return A.destroy(),e},A.supportNativeMediaPlayback=function(e){void 0===A.videoElement&&(A.videoElement=window.document.createElement("video"));var t=A.videoElement.canPlayType(e);return"probably"===t||"maybe"===t},A.getFeatureList=function(){var e={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return e.msePlayback=A.supportMSEH264Playback(),e.networkStreamIO=A.supportNetworkStreamIO(),e.networkLoaderName=A.getNetworkLoaderTypeName()||"",e.mseLivePlayback=e.msePlayback&&e.networkStreamIO,e.mseH265Playback=A.supportMSEH265Playback(),e.nativeMP4H264Playback=A.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),e.nativeMP4H265Playback=A.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),e.nativeWebmVP8Playback=A.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),e.nativeWebmVP9Playback=A.supportNativeMediaPlayback('video/webm; codecs="vp9"'),e},A}();const s=r;var g=t(288),c=t(413),l=t(502),I=t(620);const C={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",DESTROYING:"destroying"},d=function(){const A=ENTRY_MODULE,e={};function t(i){if(e[i])return e[i].exports;const n=e[i]={exports:{}};return A[i](n,n.exports,t),n.exports}t.m=A,t.n=A=>{const e=A&&A.__esModule?()=>A.default:()=>A;return t.d(e,{a:e}),e},t.d=(A,e)=>{for(const i in e)t.o(e,i)&&!t.o(A,i)&&Object.defineProperty(A,i,{enumerable:!0,get:e[i]})},t.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(A){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};const i=t(ENTRY_MODULE);return i.default||i};d.toString();const h="[\\.|\\-|\\+|\\w|/|@]+",B="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+h+").*?\\)";function u(A){return(A+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function E(A){return!isNaN(1*A)}function f(A,e,i){const n={};n[i]=[];const a=e.toString(),o=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!o)return n;const r=o[1];let s,g=new RegExp("(\\\\n|\\W)"+u(r)+B,"g");for(;s=g.exec(a);)"dll-reference"!==s[3]&&n[i].push(s[3]);for(g=new RegExp("\\("+u(r)+'\\("(dll-reference\\s('+h+'))"\\)\\)'+B,"g");s=g.exec(a);)A[s[2]]||(n[i].push(s[1]),A[s[2]]=t(s[1]).m),n[s[2]]=n[s[2]]||[],n[s[2]].push(s[4]);const c=Object.keys(n);for(let A=0;Ae||A[t].length>0),!1)}function x(A,e,t,i){const n=A[i].map((A=>`"${A}": ${e[i][A].toString()}`)).join(","),a=d.toString().split("ENTRY_MODULE");return`${a[0]}{${n}}${a[1]}"${t}"${a[2]}`}function p(A,e){e=e||{};const i={main:t.m},n=e.all?{main:Object.keys(i.main)}:function(A,e){const t={main:[e]},i={main:[]},n={main:{}};for(;Q(t);){const e=Object.keys(t);for(let a=0;a"main"!==A)).forEach((A=>{let e=0;for(;n[A][e];)e++;n[A].push(e),i[A][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a+=`var ${A} = (${x(n,i,e,modules)})();\n`})),a+=`(${x(n,i,A,"main")})();`;const o=new window.Blob([a],{type:"text/javascript"});if(e.bare)return o;const r=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(o),s=new window.Worker(r);return s.objectURL=r,s}var m=t(641),y=t(976),_=t(716),S=t(825),D=function(){function A(A,e){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new c.A,e.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=p(291),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[A,e]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},m.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:m.A.getConfig()})}catch(t){l.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new y.A(A,e)}else this._controller=new y.A(A,e);if(this._controller){var t=this._controller;null==t||t.on(_.A.IO_ERROR,this._onIOError.bind(this)),null==t||t.on(_.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==t||t.on(_.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==t||t.on(_.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==t||t.on(_.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==t||t.on(_.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==t||t.on(_.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==t||t.on(_.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==t||t.on(_.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==t||t.on(_.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==t||t.on(_.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==t||t.on(_.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==t||t.on(_.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==t||t.on(_.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==t||t.on(_.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==t||t.on(_.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return A.prototype.destroy=function(){var A;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),m.A.removeListener(this.e.onLoggingConfigChanged),this.e=null):(null===(A=this._controller)||void 0===A||A.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.hasWorker=function(){return null!=this._worker},A.prototype.open=function(){var A;this._worker?this._worker.postMessage({cmd:"start"}):null===(A=this._controller)||void 0===A||A.start()},A.prototype.close=function(){var A;this._worker?this._worker.postMessage({cmd:"stop"}):null===(A=this._controller)||void 0===A||A.stop()},A.prototype.seek=function(A){var e;this._worker?this._worker.postMessage({cmd:"seek",param:A}):null===(e=this._controller)||void 0===e||e.seek(A)},A.prototype.pause=function(){var A;this._worker?this._worker.postMessage({cmd:"pause"}):null===(A=this._controller)||void 0===A||A.pause()},A.prototype.resume=function(){var A;this._worker?this._worker.postMessage({cmd:"resume"}):null===(A=this._controller)||void 0===A||A.resume()},A.prototype._onInitSegment=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.INIT_SEGMENT,A,e)}))},A.prototype._onMediaSegment=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.MEDIA_SEGMENT,A,e)}))},A.prototype._onLoadingComplete=function(){var A=this;Promise.resolve().then((function(){A._emitter.emit(_.A.LOADING_COMPLETE)}))},A.prototype._onRecoveredEarlyEof=function(){var A=this;Promise.resolve().then((function(){A._emitter.emit(_.A.RECOVERED_EARLY_EOF)}))},A.prototype._onMediaInfo=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.MEDIA_INFO,A)}))},A.prototype._onMetaDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.METADATA_ARRIVED,A)}))},A.prototype._onScriptDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SCRIPTDATA_ARRIVED,A)}))},A.prototype._onTimedID3MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.TIMED_ID3_METADATA_ARRIVED,A)}))},A.prototype._onSMPTE2038MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SMPTE2038_METADATA_ARRIVED,A)}))},A.prototype._onSCTE35MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SCTE35_METADATA_ARRIVED,A)}))},A.prototype._onPESPrivateDataDescriptor=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.PES_PRIVATE_DATA_DESCRIPTOR,A)}))},A.prototype._onPESPrivateDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.PES_PRIVATE_DATA_ARRIVED,A)}))},A.prototype._onStatisticsInfo=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.STATISTICS_INFO,A)}))},A.prototype._onIOError=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.IO_ERROR,A,e)}))},A.prototype._onDemuxError=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.DEMUX_ERROR,A,e)}))},A.prototype._onRecommendSeekpoint=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.RECOMMEND_SEEKPOINT,A)}))},A.prototype._onLoggingConfigChanged=function(A){this._worker&&this._worker.postMessage({cmd:"logging_config",param:A})},A.prototype._onWorkerMessage=function(A){var e=A.data,t=null==e?void 0:e.data;if("destroyed"===e.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(e.msg){case _.A.INIT_SEGMENT:case _.A.MEDIA_SEGMENT:this._emitter.emit(e.msg,t.type,t.data);break;case _.A.LOADING_COMPLETE:case _.A.RECOVERED_EARLY_EOF:this._emitter.emit(e.msg);break;case _.A.MEDIA_INFO:Object.setPrototypeOf(t,S.A.prototype),this._emitter.emit(e.msg,t);break;case _.A.METADATA_ARRIVED:case _.A.SCRIPTDATA_ARRIVED:case _.A.TIMED_ID3_METADATA_ARRIVED:case _.A.SMPTE2038_METADATA_ARRIVED:case _.A.SCTE35_METADATA_ARRIVED:case _.A.PES_PRIVATE_DATA_DESCRIPTOR:case _.A.PES_PRIVATE_DATA_ARRIVED:case _.A.STATISTICS_INFO:this._emitter.emit(e.msg,t);break;case _.A.IO_ERROR:case _.A.DEMUX_ERROR:this._emitter.emit(e.msg,t.type,t.info);break;case _.A.RECOMMEND_SEEKPOINT:this._emitter.emit(e.msg,t);break;case"logcat_callback":l.A.emitter.emit("log",t.type,t.logcat)}},A}();const w=D,v="error",b="source_open",F="update_end",R="buffer_full";var k=t(453),P=t(713),N=function(){function A(A){this.TAG="MSEController",this._config=A,this._emitter=new c.A,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new k.EX}return A.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.attachMediaElement=function(A){if(this._mediaSource)throw new P.j4("MediaSource has been attached to an HTMLMediaElement!");var e=this._mediaSource=new window.MediaSource;e.addEventListener("sourceopen",this.e.onSourceOpen),e.addEventListener("sourceended",this.e.onSourceEnded),e.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=A,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),A.src=this._mediaSourceObjectURL},A.prototype.detachMediaElement=function(){if(this._mediaSource){var A=this._mediaSource;for(var e in this._sourceBuffers){var t=this._pendingSegments[e];t.splice(0,t.length),this._pendingSegments[e]=null,this._pendingRemoveRanges[e]=null,this._lastInitSegments[e]=null;var i=this._sourceBuffers[e];if(i){if("closed"!==A.readyState){try{A.removeSourceBuffer(i)}catch(A){l.A.e(this.TAG,A.message)}null==i||i.removeEventListener("error",this.e.onSourceBufferError),null==i||i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[e]=null,this._sourceBuffers[e]=null}}if("open"===A.readyState)try{A.endOfStream()}catch(A){l.A.e(this.TAG,A.message)}A.removeEventListener("sourceopen",this.e.onSourceOpen),A.removeEventListener("sourceended",this.e.onSourceEnded),A.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},A.prototype.appendInitSegment=function(A,e){var t;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(A),void this._pendingSegments[A.type].push(A);var i=A,n="".concat(i.container);i.codec&&i.codec.length>0&&(n+=";codecs=".concat(i.codec));var a=!1;if(l.A.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])l.A.v(this.TAG,"Notice: ".concat(i.type," mimeType changed, origin: ").concat(this._mimeTypes[i.type]||"",", target: ").concat(n));else{a=!0;try{var o=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);o.addEventListener("error",this.e.onSourceBufferError),o.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(A){return l.A.e(this.TAG,A.message),void this._emitter.emit(v,{code:A.code,msg:A.message})}}this._mimeTypes[i.type]=n}e||this._pendingSegments[i.type].push(i),a||this._sourceBuffers[i.type]&&!(null===(t=this._sourceBuffers[i.type])||void 0===t?void 0:t.updating)&&this._doAppendSegments(),I.A.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())},A.prototype.appendMediaSegment=function(A){var e=A;this._pendingSegments[e.type].push(e),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var t=this._sourceBuffers[e.type];!t||t.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},A.prototype.seek=function(A){var e,t;for(var i in this._sourceBuffers)if(this._sourceBuffers[i]){var n=this._sourceBuffers[i];if("open"===(null===(e=this._mediaSource)||void 0===e?void 0:e.readyState))try{null==n||n.abort()}catch(A){l.A.e(this.TAG,A.message)}this._idrList.clear();var a=this._pendingSegments[i];if(a.splice(0,a.length),"closed"!==(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState)){if(n){for(var o=0;o=1&&t-a.start(0)>=((null===(e=this._config)||void 0===e?void 0:e.autoCleanupMaxBackwardDuration)||0))return!0}}return!1},A.prototype._doCleanupSourceBuffer=function(){var A,e,t,i=null===(A=this._mediaElement)||void 0===A?void 0:A.currentTime;for(var n in this._sourceBuffers){var a=this._sourceBuffers[n];if(a){for(var o=a.buffered,r=!1,s=0;s=((null===(e=this._config)||void 0===e?void 0:e.autoCleanupMaxBackwardDuration)||0)){r=!0;var l=i-((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[n].push({start:g,end:l})}}else c0&&(isNaN(a)||o>a)&&(l.A.v(this.TAG,"Update MediaSource duration from ".concat(a," to ").concat(o)),this._mediaSource.duration=o),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},A.prototype._doRemoveRanges=function(){var A;for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!(null===(A=this._sourceBuffers[e])||void 0===A?void 0:A.updating))for(var t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];i.length&&!(null==t?void 0:t.updating);){var n=i.shift();null==t||t.remove(n.start,n.end)}},A.prototype._doAppendSegments=function(){var A,e,t,i=this._pendingSegments;for(var n in i)if(this._sourceBuffers[n]&&!(null===(A=this._sourceBuffers[n])||void 0===A?void 0:A.updating)&&i[n].length>0){var a=i[n].shift();if(null==a?void 0:a.timestampOffset){var o=(null===(e=this._sourceBuffers[n])||void 0===e?void 0:e.timestampOffset)||0,r=a.timestampOffset/1e3;Math.abs(o-r)>.1&&(l.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(o," to ").concat(r)),this._sourceBuffers[n]&&(this._sourceBuffers[n].timestampOffset=r)),delete a.timestampOffset}if(!a.data||0===a.data.byteLength)continue;try{null===(t=this._sourceBuffers[n])||void 0===t||t.appendBuffer(a.data),this._isBufferFull=!1,"video"===n&&a.hasOwnProperty("info")&&this._idrList.appendArray(a.info.syncPoints)}catch(A){this._pendingSegments[n].unshift(a),22===A.code?(this._isBufferFull||this._emitter.emit(R),this._isBufferFull=!0):(l.A.e(this.TAG,A.message),this._emitter.emit(v,{code:A.code,msg:A.message}))}}},A.prototype._onSourceOpen=function(){var A;if(l.A.v(this.TAG,"MediaSource onSourceOpen"),null===(A=this._mediaSource)||void 0===A||A.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(b)},A.prototype._onSourceEnded=function(){l.A.v(this.TAG,"MediaSource onSourceEnded")},A.prototype._onSourceClose=function(){l.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},A.prototype._hasPendingSegments=function(){var A=this._pendingSegments;return A.video.length>0||A.audio.length>0},A.prototype._hasPendingRemoveRanges=function(){var A=this._pendingRemoveRanges;return A.video.length>0||A.audio.length>0},A.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(F)},A.prototype._onSourceBufferError=function(A){l.A.e(this.TAG,"SourceBuffer Error: ".concat(A))},A}();const T=N;var M=t(465),L={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Y={NETWORK_EXCEPTION:g.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:g.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:g.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:g.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:M.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:M.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:M.A.CODEC_UNSUPPORTED},G=function(){function A(A,e){var t,i,n;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new c.A,this._config=o(),"object"==typeof e&&Object.assign(this._config,e);var a=A.type.toLowerCase();if("mse"!==a&&"mpegts"!==a&&"m2ts"!==a&&"flv"!==a)throw new P.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");A.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=A,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var r=I.A.chrome&&(I.A.version&&(null===(t=I.A.version)||void 0===t?void 0:t.major)<50||I.A.version&&50===(null===(i=null===I.A||void 0===I.A?void 0:I.A.version)||void 0===i?void 0:i.major)&&((null===(n=null===I.A||void 0===I.A?void 0:I.A.version)||void 0===n?void 0:n.build)||-1)<2661);this._alwaysSeekKeyframe=!!(r||I.A.msedge||I.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return A.prototype.destroy=function(){this._emitter.emit(C.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){var t=this;A===C.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){t._emitter.emit(C.MEDIA_INFO,t.mediaInfo)})):A===C.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){t._emitter.emit(C.STATISTICS_INFO,t.statisticsInfo)})),this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.attachMediaElement=function(A){var e,t,i,n,a,o=this;if(this._mediaElement=A,A.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),A.addEventListener("seeking",this.e.onvSeeking),A.addEventListener("canplay",this.e.onvCanPlay),A.addEventListener("stalled",this.e.onvStalled),A.addEventListener("progress",this.e.onvProgress),this._msectl=new T(this._config),null===(e=this._msectl)||void 0===e||e.on(F,this._onmseUpdateEnd.bind(this)),null===(t=this._msectl)||void 0===t||t.on(R,this._onmseBufferFull.bind(this)),null===(i=this._msectl)||void 0===i||i.on(b,(function(){o._mseSourceOpened=!0,o._hasPendingLoad&&(o._hasPendingLoad=!1,o.load())})),null===(n=this._msectl)||void 0===n||n.on(v,(function(A){o._emitter.emit(C.ERROR,L.MEDIA_ERROR,Y.MEDIA_MSE_ERROR,A)})),null===(a=this._msectl)||void 0===a||a.attachMediaElement(A),null!=this._pendingSeekTime)try{A.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(A){}},A.prototype.detachMediaElement=function(){var A;this._mediaElement&&(null===(A=this._msectl)||void 0===A||A.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},A.prototype.load=function(){var A=this;if(!this._mediaElement)throw new P.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new P.j4("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(!this._config.deferLoadAfterSourceOpen||this._mseSourceOpened?(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new w(this._mediaDataSource,this._config),this._transmuxer.on(_.A.INIT_SEGMENT,(function(e,t){var i;null===(i=A._msectl)||void 0===i||i.appendInitSegment(t)})),this._transmuxer.on(_.A.MEDIA_SEGMENT,(function(e,t){var i,n,a;if(null===(i=A._msectl)||void 0===i||i.appendMediaSegment(t),A._config.lazyLoad&&!A._config.isLive){var o=null===(n=A._mediaElement)||void 0===n?void 0:n.currentTime;t.info.endDts>=1e3*(o+((null===(a=A._config)||void 0===a?void 0:a.lazyLoadMaxDuration)||0))&&null==A._progressChecker&&(l.A.v(A.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),A._suspendTransmuxer())}})),this._transmuxer.on(_.A.LOADING_COMPLETE,(function(){var e;null===(e=A._msectl)||void 0===e||e.endOfStream(),A._emitter.emit(C.LOADING_COMPLETE)})),this._transmuxer.on(_.A.RECOVERED_EARLY_EOF,(function(){A._emitter.emit(C.RECOVERED_EARLY_EOF)})),this._transmuxer.on(_.A.IO_ERROR,(function(e,t){A._emitter.emit(C.ERROR,L.NETWORK_ERROR,e,t)})),this._transmuxer.on(_.A.DEMUX_ERROR,(function(e,t){A._emitter.emit(C.ERROR,L.MEDIA_ERROR,e,{code:-1,msg:t})})),this._transmuxer.on(_.A.MEDIA_INFO,(function(e){A._mediaInfo=e,A._emitter.emit(C.MEDIA_INFO,Object.assign({},e))})),this._transmuxer.on(_.A.METADATA_ARRIVED,(function(e){A._emitter.emit(C.METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SCRIPTDATA_ARRIVED,(function(e){A._emitter.emit(C.SCRIPTDATA_ARRIVED,e)})),this._transmuxer.on(_.A.TIMED_ID3_METADATA_ARRIVED,(function(e){A._emitter.emit(C.TIMED_ID3_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SMPTE2038_METADATA_ARRIVED,(function(e){A._emitter.emit(C.SMPTE2038_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SCTE35_METADATA_ARRIVED,(function(e){A._emitter.emit(C.SCTE35_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(e){A._emitter.emit(C.PES_PRIVATE_DATA_DESCRIPTOR,e)})),this._transmuxer.on(_.A.PES_PRIVATE_DATA_ARRIVED,(function(e){A._emitter.emit(C.PES_PRIVATE_DATA_ARRIVED,e)})),this._transmuxer.on(_.A.STATISTICS_INFO,(function(e){A._statisticsInfo=A._fillStatisticsInfo(e),A._emitter.emit(C.STATISTICS_INFO,Object.assign({},A._statisticsInfo))})),this._transmuxer.on(_.A.RECOMMEND_SEEKPOINT,(function(e){A._mediaElement&&!A._config.accurateSeek&&(A._requestSetTime=!0,A._mediaElement.currentTime=e/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)},A.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},A.prototype.play=function(){var A;return function(A,e,t,i){return new(t||(t=Promise))((function(n,a){function o(A){try{s(i.next(A))}catch(A){a(A)}}function r(A){try{s(i.throw(A))}catch(A){a(A)}}function s(A){var e;A.done?n(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(o,r)}s((i=i.apply(A,e||[])).next())}))}(this,void 0,void 0,(function(){return function(A,e){var t,i,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(s){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(o=0)),o;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]0&&!(null===(t=this._mediaElement)||void 0===t?void 0:t.paused)){var o=n.end(n.length-1);if(o>((null===(i=this._config)||void 0===i?void 0:i.liveBufferLatencyMaxLatency)||0)&&o-a>(this._config.liveBufferLatencyMaxLatency||0)){var r=o-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=r}}if(this._config.lazyLoad&&!this._config.isLive){for(var s=0,g=0;g=a+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(l.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},A.prototype._onmseBufferFull=function(){l.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},A.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},A.prototype._checkProgressAndResume=function(){for(var A,e,t,i=(null===(A=this._mediaElement)||void 0===A?void 0:A.currentTime)||0,n=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,a=!1,o=0;o=r&&i=s-(this._config.lazyLoadRecoverDuration||0)&&(a=!0);break}}a&&(window.clearInterval(this._progressChecker),this._progressChecker=null,a&&(l.A.v(this.TAG,"Continue loading from paused position"),null===(t=this._transmuxer)||void 0===t||t.resume()))},A.prototype._isTimepointBuffered=function(A){for(var e,t=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,i=0;i=n&&A0){var g=(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered).start(0);(g<1&&A0&&e.currentTime0){var o=a.start(0);if(o<1&&n0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},A.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},A.prototype.play=function(){var A;return function(A,e,t,i){return new(t||(t=Promise))((function(n,a){function o(A){try{s(i.next(A))}catch(A){a(A)}}function r(A){try{s(i.throw(A))}catch(A){a(A)}}function s(A){var e;A.done?n(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(o,r)}s((i=i.apply(A,e||[])).next())}))}(this,void 0,void 0,(function(){return function(A,e){var t,i,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(s){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(o=0)),o;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]{A.exports=t(133).default},302:(A,e,t)=>{t.d(e,{A:()=>f});var i=t(502);const n=function(){function A(){var A;this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,(null===(A=self.performance)||void 0===A?void 0:A.now)?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return A.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},A.prototype.addBytes=function(A){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=A,this._totalBytes+=A):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=A,this._totalBytes+=A):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=A,this._totalBytes+=A,this._lastCheckpoint=this._now())},Object.defineProperty(A.prototype,"currentKBps",{get:function(){this.addBytes(0);var A=(this._now()-this._lastCheckpoint)/1e3;return 0===A&&(A=1),this._intervalBytes/A/1024},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"averageKBps",{get:function(){var A=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/A/1024},enumerable:!1,configurable:!0}),A}();var a,o=t(288),r=t(620),s=t(713),g=(a=function(A,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},a(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}a(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)});const c=function(A){function e(e,t){var i=A.call(this,"fetch-stream-loader")||this;return i.TAG="FetchStreamLoader",i._seekHandler=e,i._config=t,i._needStash=!0,i._requestAbort=!1,i._abortController=null,i._contentLength=null,i._receivedLength=0,i}return g(e,A),e.isSupported=function(){var A;try{var e=r.A.msedge&&((null===(A=null===r.A||void 0===r.A?void 0:r.A.version)||void 0===A?void 0:A.minor)||0)>=15048&&!r.A.webkit,t=!r.A.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(A){return!1}},e.prototype.destroy=function(){this.isWorking()&&this.abort(),A.prototype.destroy.call(this)},e.prototype.open=function(A,e){var t=this;this._dataSource=A,this._range=e;var i=A.url;this._config.reuseRedirectedURL&&void 0!==A.redirectedURL&&(i=A.redirectedURL);var n=this._seekHandler.getConfig(i,e),a=new self.Headers;if("object"==typeof n.headers){var r=n.headers;for(var g in r)r.hasOwnProperty(g)&&a.append(g,r[g])}var c={method:"GET",headers:a,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var g in this._config.headers)a.append(g,this._config.headers[g]);A.cors||(c.mode="same-origin"),A.withCredentials&&(c.credentials="include"),(null==A?void 0:A.referrerPolicy)&&(c.referrerPolicy=A.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(c.signal=this._abortController.signal)),this._status=o.eO.kConnecting,self.fetch(n.url,c).then((function(A){var e,i;if(t._requestAbort)return t._status=o.eO.kIdle,void(null===(e=A.body)||void 0===e||e.cancel());if(A.ok&&A.status>=200&&A.status<=299){if(A.url!==n.url&&t._onURLRedirect){var a=t._seekHandler.removeURLParameters(A.url);t._onURLRedirect(a)}var r=A.headers.get("Content-Length");return null!=r&&(t._contentLength=parseInt(r),0!==t._contentLength&&t._onContentLengthKnown&&t._onContentLengthKnown(t._contentLength)),t._pump.call(t,null===(i=A.body)||void 0===i?void 0:i.getReader())}if(t._status=o.eO.kError,!t._onError)throw new s.Al("FetchStreamLoader: Http code invalid, "+A.status+" "+A.statusText);t._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:A.status,msg:A.statusText})})).catch((function(A){var e;if(!(null===(e=t._abortController)||void 0===e?void 0:e.signal.aborted)){if(t._status=o.eO.kError,!t._onError)throw A;t._onError(o.Xv.EXCEPTION,{code:-1,msg:A.message})}}))},e.prototype.abort=function(){var A;if(this._requestAbort=!0,(this._status!==o.eO.kBuffering||!r.A.chrome)&&this._abortController)try{null===(A=this._abortController)||void 0===A||A.abort()}catch(A){}},e.prototype._pump=function(A){var e=this;return A.read().then((function(t){var i,n,a,r;if(t.done)if(null!==e._contentLength&&e._receivedLength299)){if(this._status=o.eO.kError,!this._onError)throw new s.Al("MozChunkedLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}else this._status=o.eO.kBuffering}},e.prototype._onProgress=function(A){var e;if(this._status!==o.eO.kError){null===this._contentLength&&null!==A.total&&0!==A.total&&(this._contentLength=A.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=A.target.response,i=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}},e.prototype._onLoadEnd=function(A){this._requestAbort?this._requestAbort=!1:this._status!==o.eO.kError&&(this._status=o.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},e.prototype._onXhrError=function(A){this._status=o.eO.kError;var e=0,t=null;if(this._contentLength&&A.loaded=this._contentLength&&(n=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._contentLength-1),this._currentRequestRange={from:i,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)},e.prototype._internalOpen=function(A,e){this._lastTimeLoaded=0;var t=A.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?t=this._currentRedirectedURL:null!=A.redirectedURL&&(t=A.redirectedURL));var i=this._seekHandler.getConfig(t,e);this._currentRequestURL=i.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",i.url,!0),n.responseType="arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onload=this._onLoad.bind(this),n.onerror=this._onXhrError.bind(this),A.withCredentials&&(n.withCredentials=!0),"object"==typeof i.headers){var a=i.headers;for(var o in a)a.hasOwnProperty(o)&&n.setRequestHeader(o,a[o])}if("object"==typeof this._config.headers)for(var o in a=this._config.headers)a.hasOwnProperty(o)&&n.setRequestHeader(o,a[o]);n.send()},e.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=o.eO.kComplete},e.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},e.prototype._onReadyStateChange=function(A){var e=A.target;if(2===e.readyState){if(null!=e.responseURL){var t=this._seekHandler.removeURLParameters(e.responseURL);e.responseURL!==this._currentRequestURL&&t!==this._currentRedirectedURL&&(this._currentRedirectedURL=t,this._onURLRedirect&&this._onURLRedirect(t))}if(e.status>=200&&e.status<=299){if(this._waitForTotalLength)return;this._status=o.eO.kBuffering}else{if(this._status=o.eO.kError,!this._onError)throw new s.Al("RangeLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}}},e.prototype._onProgress=function(A){if(this._status!==o.eO.kError){if(null===this._contentLength){var e=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,e=!0;var t=A.total;this._internalAbort(),null!=t&&0!==t&&(this._totalLength=t)}if(-1===this._range.to?this._contentLength=(this._totalLength||0)-this._range.from:this._contentLength=this._range.to-this._range.from+1,e)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=A.loaded-this._lastTimeLoaded;this._lastTimeLoaded=A.loaded,this._speedSampler.addBytes(i)}},e.prototype._normalizeSpeed=function(A){var e=this._chunkSizeKBList,t=e.length-1,i=0,n=0,a=t;if(A=e[i]&&A=3&&(e=this._speedSampler.currentKBps)),0!==e){var t=this._normalizeSpeed(e);this._currentSpeedNormalized!==t&&(this._currentSpeedNormalized=t,this._currentChunkSizeKB=t)}var i=A.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0)for(var a=e.split("&"),o=0;o0;r[0]!==this._startName&&r[0]!==this._endName&&(s&&(n+="&"),n+=a[o])}return 0===n.length?t:t+"?"+n},A}(),f=function(){function A(A,e,t){this.TAG="IOController",this._config=e,this._extraData=t,this._stashInitialSize=65536,void 0!==e.stashInitialSize&&e.stashInitialSize>0&&(this._stashInitialSize=e.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,e.enableStashBuffer||(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=A,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(A.url||""),this._refTotalLength=A.filesize?A.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new n,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return A.prototype.destroy=function(){var A,e,t;(null===(A=this._loader)||void 0===A?void 0:A.isWorking())&&(null===(e=this._loader)||void 0===e||e.abort()),null===(t=this._loader)||void 0===t||t.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},A.prototype.isWorking=function(){var A;return(null===(A=this._loader)||void 0===A?void 0:A.isWorking())&&!this._paused},A.prototype.isPaused=function(){return this._paused},Object.defineProperty(A.prototype,"status",{get:function(){var A;return null===(A=this._loader)||void 0===A?void 0:A.status},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"extraData",{get:function(){return this._extraData},set:function(A){this._extraData=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(A){this._onDataArrival=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(A){this._onSeeked=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onComplete",{get:function(){return this._onComplete},set:function(A){this._onComplete=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(A){this._onRedirect=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(A){this._onRecoveredEarlyEof=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentURL",{get:function(){var A;return null===(A=this._dataSource)||void 0===A?void 0:A.url},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"hasRedirect",{get:function(){var A;return null!=this._redirectedURL||void 0!==(null===(A=this._dataSource)||void 0===A?void 0:A.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentRedirectedURL",{get:function(){var A;return this._redirectedURL||(null===(A=this._dataSource)||void 0===A?void 0:A.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentSpeed",{get:function(){var A,e;return this._loaderClass===d?null===(A=this._loader)||void 0===A?void 0:A.currentSpeed:null===(e=this._speedSampler)||void 0===e?void 0:e.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"loaderType",{get:function(){var A;return null===(A=this._loader)||void 0===A?void 0:A.type},enumerable:!1,configurable:!0}),A.prototype._selectSeekHandler=function(){var A=this._config;if("range"===A.seekType)this._seekHandler=new u(!!this._config.rangeLoadZeroStart);else if("param"===A.seekType){var e=A.seekParamStart||"bstart",t=A.seekParamEnd||"bend";this._seekHandler=new E(e,t)}else{if("custom"!==A.seekType)throw new s.Qn("Invalid seekType in config: ".concat((null==A?void 0:A.seekType)||""));if("function"!=typeof A.customSeekHandler)throw new s.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new A.customSeekHandler}},A.prototype._selectLoader=function(){var A;if(null!=this._config.customLoader)this._loaderClass=(null===(A=this._config)||void 0===A?void 0:A.customLoader)||null;else if(this._isWebSocketURL)this._loaderClass=B;else if(c.isSupported())this._loaderClass=c;else if(I.isSupported())this._loaderClass=I;else{if(!d.isSupported())throw new s.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=d}},A.prototype._createLoader=function(){var A;this._loaderClass&&(this._loader=new this._loaderClass(this._seekHandler,this._config),(null===(A=this._loader)||void 0===A?void 0:A.needStashBuffer)||(this._enableStash=!1),this._loader&&(this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)))},A.prototype.open=function(A){var e,t;this._currentRange={from:0,to:-1},A&&(this._currentRange.from=A),null===(e=this._speedSampler)||void 0===e||e.reset(),A||(this._fullRequestFlag=!0),null===(t=this._loader)||void 0===t||t.open(this._dataSource,Object.assign({},this._currentRange))},A.prototype.abort=function(){var A;null===(A=this._loader)||void 0===A||A.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},A.prototype.pause=function(){var A,e;this.isWorking()&&(null===(A=this._loader)||void 0===A||A.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange&&(this._currentRange.to=this._stashByteStart-1)):this._resumeFrom=((null===(e=this._currentRange)||void 0===e?void 0:e.to)||0)+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},A.prototype.resume=function(){if(this._paused){this._paused=!1;var A=this._resumeFrom;this._resumeFrom=0,this._internalSeek(A,!0)}},A.prototype.seek=function(A){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(A,!0)},A.prototype._internalSeek=function(A,e){var t,i,n,a;(null===(t=this._loader)||void 0===t?void 0:t.isWorking())&&(null===(i=this._loader)||void 0===i||i.abort()),this._flushStashBuffer(e),null===(n=this._loader)||void 0===n||n.destroy(),this._loader=null;var o={from:A,to:-1};this._currentRange={from:o.from,to:-1},null===(a=this._speedSampler)||void 0===a||a.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,o),this._onSeeked&&this._onSeeked()},A.prototype.updateUrl=function(A){if(!A||"string"!=typeof A||0===A.length)throw new s.Qn("Url must be a non-empty string!");this._dataSource.url=A},A.prototype._expandBuffer=function(A){for(var e=this._stashSize;e+10485760){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(t,0,e).set(i,0)}this._stashBuffer=t,this._bufferSize=e}},A.prototype._normalizeSpeed=function(A){var e=this._speedNormalizeList,t=e.length-1,i=0,n=0,a=t;if(A=e[i]&&A=512&&A<=1024?Math.floor(1.5*A):2*A)>8192&&(e=8192);var t=1024*e+1048576;this._bufferSize0){var r=this._stashBuffer.slice(0,this._stashUsed);(l=this._dispatchChunks(r,this._stashByteStart))0&&(I=new Uint8Array(r,l),c.set(I,0),this._stashUsed=I.byteLength,this._stashByteStart+=l):(this._stashUsed=0,this._stashByteStart+=l),this._stashUsed+A.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+A.byteLength),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(A),this._stashUsed),this._stashUsed+=A.byteLength}else(l=this._dispatchChunks(A,e))this._bufferSize&&(this._expandBuffer(g),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(A,l),0),this._stashUsed+=g,this._stashByteStart=e+l);else if(0===this._stashUsed){var g;(l=this._dispatchChunks(A,e))this._bufferSize&&this._expandBuffer(g),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(A,l),0),this._stashUsed+=g,this._stashByteStart=e+l)}else{var c,l;if(this._stashUsed+A.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+A.byteLength),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(A),this._stashUsed),this._stashUsed+=A.byteLength,(l=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var I=new Uint8Array(this._stashBuffer,l);c.set(I,0)}this._stashUsed-=l,this._stashByteStart+=l}}},A.prototype._flushStashBuffer=function(A){if(this._stashUsed>0){var e=this._stashBuffer.slice(0,this._stashUsed),t=this._dispatchChunks(e,this._stashByteStart),n=e.byteLength-t;if(t0){var a=new Uint8Array(this._stashBuffer,0,this._bufferSize),o=new Uint8Array(e,t);a.set(o,0),this._stashUsed=o.byteLength,this._stashByteStart+=t}return 0}i.A.w(this.TAG,"".concat(n," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,n}return 0},A.prototype._onLoaderComplete=function(A,e){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},A.prototype._onLoaderError=function(A,e){var t;switch(i.A.e(this.TAG,"Loader error, code = ".concat(e.code,", msg = ").concat(e.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,A=o.Xv.UNRECOVERABLE_EARLY_EOF),A){case o.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1;return void(n{t.d(e,{HC:()=>o,Xv:()=>a,eO:()=>n});var i=t(713),n={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},a={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},o=function(){function A(A){this._type=A||"undefined",this._status=n.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return A.prototype.destroy=function(){this._status=n.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},A.prototype.isWorking=function(){return this._status===n.kConnecting||this._status===n.kBuffering},Object.defineProperty(A.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(A){this._onContentLengthKnown=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(A){this._onURLRedirect=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(A){this._onDataArrival=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onComplete",{get:function(){return this._onComplete},set:function(A){this._onComplete=A},enumerable:!1,configurable:!0}),A.prototype.open=function(A,e){throw new i.Xu("Unimplemented abstract function!")},A.prototype.abort=function(){throw new i.Xu("Unimplemented abstract function!")},A}()},620:(A,e,t)=>{t.d(e,{A:()=>n});var i={};!function(){var A=self.navigator.userAgent.toLowerCase(),e=/(edge)\/([\w.]+)/.exec(A)||/(opr)[\/]([\w.]+)/.exec(A)||/(chrome)[ \/]([\w.]+)/.exec(A)||/(iemobile)[\/]([\w.]+)/.exec(A)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(A)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(A)||/(webkit)[ \/]([\w.]+)/.exec(A)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(A)||/(msie) ([\w.]+)/.exec(A)||A.includes("trident")&&/(rv)(?::| )([\w.]+)/.exec(A)||!A.includes("compatible")&&/(firefox)[ \/]([\w.]+)/.exec(A)||[],t=/(ipad)/.exec(A)||/(ipod)/.exec(A)||/(windows phone)/.exec(A)||/(iphone)/.exec(A)||/(kindle)/.exec(A)||/(android)/.exec(A)||/(windows)/.exec(A)||/(mac)/.exec(A)||/(linux)/.exec(A)||/(cros)/.exec(A)||[],n={browser:e[5]||e[3]||e[1]||"",version:e[2]||e[4]||"0",majorVersion:e[4]||e[2]||"0",platform:t[0]||""},a={};if(n.browser){a[n.browser]=!0;var o=n.majorVersion.split(".");a.version={major:parseInt(n.majorVersion,10),string:n.version},o.length>1&&(a.version.minor=parseInt(o[1],10)),o.length>2&&(a.version.build=parseInt(o[2],10))}if(n.platform&&(a[n.platform]=!0),(a.chrome||a.opr||a.safari)&&(a.webkit=!0),a.rv||a.iemobile){a.rv&&delete a.rv;var r="msie";n.browser=r,a[r]=!0}if(a.edge){delete a.edge;var s="msedge";n.browser=s,a[s]=!0}if(a.opr){var g="opera";n.browser=g,a[g]=!0}if(a.safari&&a.android){var c="android";n.browser=c,a[c]=!0}for(var l in a.name=n.browser,a.platform=n.platform,i)Object.prototype.hasOwnProperty.call(i,l)&&delete i[l];Object.assign(i,a)}();const n=i},713:(A,e,t)=>{t.d(e,{Al:()=>a,Qn:()=>r,Xu:()=>s,j4:()=>o});var i,n=(i=function(A,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},i(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}i(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),a=function(){function A(A){this.name="RuntimeException",this._message=A}return Object.defineProperty(A.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),A.prototype.toString=function(){return this.name+": "+this.message},A}(),o=function(A){function e(e){var t=A.call(this,e)||this;return t.name="IllegalStateException",t}return n(e,A),e}(a),r=function(A){function e(e){var t=A.call(this,e)||this;return t.name="InvalidArgumentException",t}return n(e,A),e}(a),s=function(A){function e(e){var t=A.call(this,e)||this;return t.name="NotImplementedException",t}return n(e,A),e}(a)},502:(A,e,t)=>{t.d(e,{A:()=>n});var i=t(413);const n=function(){function A(){}return A.e=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","error",n)),A.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},A.i=function(e,t){e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var i="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&A.emitter.emit("log","info",i),A.ENABLE_INFO&&(console.info?console.info(i):console.log(i))},A.w=function(e,t){e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var i="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&A.emitter.emit("log","warn",i),A.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))},A.d=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","debug",n)),A.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},A.v=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","verbose",n)),A.ENABLE_VERBOSE&&console.log(n)},A.FORCE_GLOBAL_TAG=!1,A.GLOBAL_TAG="ezuikit-flv",A.ENABLE_CALLBACK=!1,A.emitter=new i.A,A.ENABLE_ERROR=!0,A.ENABLE_INFO=!0,A.ENABLE_WARN=!0,A.ENABLE_DEBUG=!0,A.ENABLE_VERBOSE=!0,A}()},641:(A,e,t)=>{t.d(e,{A:()=>a});var i=t(413),n=t(502);const a=function(){function A(){}return Object.defineProperty(A,"forceGlobalTag",{get:function(){return n.A.FORCE_GLOBAL_TAG},set:function(e){n.A.FORCE_GLOBAL_TAG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"globalTag",{get:function(){return n.A.GLOBAL_TAG},set:function(e){n.A.GLOBAL_TAG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableAll",{get:function(){return n.A.ENABLE_VERBOSE&&n.A.ENABLE_DEBUG&&n.A.ENABLE_INFO&&n.A.ENABLE_WARN&&n.A.ENABLE_ERROR},set:function(e){n.A.ENABLE_VERBOSE=e,n.A.ENABLE_DEBUG=e,n.A.ENABLE_INFO=e,n.A.ENABLE_WARN=e,n.A.ENABLE_ERROR=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableDebug",{get:function(){return n.A.ENABLE_DEBUG},set:function(e){n.A.ENABLE_DEBUG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableVerbose",{get:function(){return n.A.ENABLE_VERBOSE},set:function(e){n.A.ENABLE_VERBOSE=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableInfo",{get:function(){return n.A.ENABLE_INFO},set:function(e){n.A.ENABLE_INFO=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableWarn",{get:function(){return n.A.ENABLE_WARN},set:function(e){n.A.ENABLE_WARN=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableError",{get:function(){return n.A.ENABLE_ERROR},set:function(e){n.A.ENABLE_ERROR=e,A._notifyChange()},enumerable:!1,configurable:!0}),A.getConfig=function(){return{globalTag:n.A.GLOBAL_TAG,forceGlobalTag:n.A.FORCE_GLOBAL_TAG,enableVerbose:n.A.ENABLE_VERBOSE,enableDebug:n.A.ENABLE_DEBUG,enableInfo:n.A.ENABLE_INFO,enableWarn:n.A.ENABLE_WARN,enableError:n.A.ENABLE_ERROR,enableCallback:n.A.ENABLE_CALLBACK}},A.applyConfig=function(A){n.A.GLOBAL_TAG=A.globalTag,n.A.FORCE_GLOBAL_TAG=A.forceGlobalTag,n.A.ENABLE_VERBOSE=A.enableVerbose,n.A.ENABLE_DEBUG=A.enableDebug,n.A.ENABLE_INFO=A.enableInfo,n.A.ENABLE_WARN=A.enableWarn,n.A.ENABLE_ERROR=A.enableError,n.A.ENABLE_CALLBACK=!!A.enableCallback},A._notifyChange=function(){var e=A.emitter;if(e.listenerCount("change")>0){var t=A.getConfig();e.emit("change",t)}},A.registerListener=function(e){A.emitter.addListener("change",e)},A.removeListener=function(e){A.emitter.removeListener("change",e)},A.addLogListener=function(e){n.A.emitter.addListener("log",e),n.A.emitter.listenerCount("log")>0&&(n.A.ENABLE_CALLBACK=!0,A._notifyChange())},A.removeLogListener=function(e){n.A.emitter.removeListener("log",e),0===n.A.emitter.listenerCount("log")&&(n.A.ENABLE_CALLBACK=!1,A._notifyChange())},A.emitter=new i.A,A}()},413:(A,e,t)=>{t.d(e,{A:()=>i});const i=t(343)}},e={};function t(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return A[i](a,a.exports,t),a.exports}return t.m=A,t.d=(A,e)=>{for(var i in e)t.o(e,i)&&!t.o(A,i)&&Object.defineProperty(A,i,{enumerable:!0,get:e[i]})},t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t(446)})()))}(F);var R=b(F.exports);window.flvjs=R;var k=function(){return o((function A(e,i){t(this,A),console.log("isSupportFlv",window.flvjs.isSupported()),window.flvjs.isSupported()&&this.initFLV(e,i)}),[{key:"toString",value:function(){return"Flv ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initFLV",value:function(A,e){var t=y(e),i=t.deviceSerial,n=t.channelNo;t.hd;var a=t.type;window.ezuikitMonitor.report({protocol:"flv",url:e,serial:i,no:n,action:1,logInfo:{type:a}});var o=document.getElementById(A);o.getAttribute("controls")||o.setAttribute("controls",!0);var r=window.flvjs.createPlayer({type:"flv",url:e,isLive:!0},{enableStashBuffer:!0,stashInitialSize:128,enableWorker:!0});r.attachMediaElement(o),r.load(),r.play(),this.flvUrl=e,this.flv=r,this.video=o,this.video.addEventListener("oncanplaythrough",(function(){console.log("oncanplaythrough")}),!1),this.video.addEventListener("onerror",(function(){console.log("onerror")}),!1)}},{key:"play",value:function(){console.log("执行flv播放",this.video),this.video.play()}},{key:"stop",value:function(){this.video.pause(),this.flv.unload()}},{key:"destroy",value:function(){void 0!==this.flv&&null!==this.flv&&(this.flv.pause(),this.flv.unload(),this.flv.detachMediaElement(),this.flv.destroy(),this.flv=null)}}])}();!function(){function A(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function e(A,e){for(var t=0;tA.length)&&(e=A.length);for(var t=0,i=new Array(e);t=A.length?{done:!0}:{done:!1,value:A[i++]}},e:function(A){throw A},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,r=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return o=A.done,A},e:function(A){r=!0,a=A},f:function(){try{o||null==t.return||t.return()}finally{if(r)throw a}}}}var h=function(){function e(){A(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return t(e,[{key:"addEventListener",value:function(A,e,t){A in this.listeners||(this.listeners[A]=[]),this.listeners[A].push({callback:e,options:t})}},{key:"removeEventListener",value:function(A,e){if(A in this.listeners)for(var t=this.listeners[A],i=0,n=t.length;i2?a[1]:"sd"),"rec"===e.type&&n[2]&&(e.recType=n[2].includes(".cloud.")?"cloud":""),e.searchParams=function(A){var e=A.split("?")[1],t={};if(e)for(var i=e.split("&"),n=0;n{if("undefined"==typeof document)return!1;const A=L[0],e={};for(const t of L){const i=t?.[1];if(i in document){for(const[i,n]of t.entries())e[A[i]]=n;return e}}return!1})(),G={change:Y.fullscreenchange,error:Y.fullscreenerror};let U={request:(A=document.documentElement,e)=>new Promise(((t,i)=>{const n=()=>{U.off("change",n),t()};U.on("change",n);const a=A[Y.requestFullscreen](e);a instanceof Promise&&a.then(n).catch(i)})),exit:()=>new Promise(((A,e)=>{if(!U.isFullscreen)return void A();const t=()=>{U.off("change",t),A()};U.on("change",t);const i=document[Y.exitFullscreen]();i instanceof Promise&&i.then(t).catch(e)})),toggle:(A,e)=>U.isFullscreen?U.exit():U.request(A,e),onchange(A){U.on("change",A)},onerror(A){U.on("error",A)},on(A,e){const t=G[A];t&&document.addEventListener(t,e,!1)},off(A,e){const t=G[A];t&&document.removeEventListener(t,e,!1)},raw:Y};Object.defineProperties(U,{isFullscreen:{get:()=>Boolean(document[Y.fullscreenElement])},element:{enumerable:!0,get:()=>document[Y.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[Y.fullscreenEnabled])}}),Y||(U={isEnabled:!1});var J=U,H=function(){function A(e,i){t(this,A),this.id=i,this.jSPlugin=e,this.state={play:!1,loading:!1,text:""},this.loadingSetText=this.loadingSetText,A._instanceStyle()}return o(A,[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"setPlayStatus",value:function(A){this.state=Object.assign(this.state,A)}},{key:"loadingStart",value:function(A){var e=A,t=document.getElementById(e),i=t.offsetWidth,n=t.offsetHeight,a=t.offsetLeft;this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"map"==this.jSPlugin.Theme.inspectMode&&(a=0),document.getElementById("".concat(A,"-loading-id-0"))&&document.getElementById("".concat(A,"-loading-id-0")).parentNode.removeChild(document.getElementById("".concat(A,"-loading-id-0")));var o=document.createElement("div");o.setAttribute("id","".concat(A,"-loading-id-0"));var r="position:absolute;outline:none;pointer-events:none;";r+="width: 100%;background-size: cover; background-repeat:no-repeat;",r+="height: 100%;",r+="top:0;",r+="left:"+a+"px;",o.setAttribute("style",r),o.style.height=n,o.setAttribute("class","loading-container"),t.style.position="relative",this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"map"==this.jSPlugin.Theme.inspectMode&&(t.style.position="absolute"),t.appendChild(o);var s=document.createElement("div"),g=document.createElement("div");s.setAttribute("class","loading-item"),s.setAttribute("id","".concat(A,"-loading-item-0"));r="display:inline-flex;pointer-events:none;flex-direction:column;justify-content:center;align-items: center;width:100%;height:"+n+"px;outline:none;vertical-align: top;position:absolute;";function c(A,e,t,i){return{top:parseInt(i/t,10)*(A/t),left:i%t*(e/t)}}r+="left:"+c(n,i,1,0).left+"px;",r+="top:"+c(n,i,1,0).top+"px;",s.setAttribute("style",r);var l=1,I=document.createElement("div");g.innerHTML="",g.style.color="#fff",I.setAttribute("class","loading"),I.setAttribute("id","".concat(A,"-loading-icon"));var C='';!this.jSPlugin.isMobile&&this.jSPlugin.isCall&&(l=this.jSPlugin.width/1024,C='')),I.innerHTML=C,s.appendChild(I),s.appendChild(g),o.appendChild(s)}},{key:"loadingStop",value:function(A){var e=document.getElementById("".concat(A,"-loading-item-0"));e&&document.getElementById("".concat(A,"-loading-icon"))&&e.removeChild(document.getElementById("".concat(A,"-loading-icon")))}},{key:"loadingSetText",value:function(A){var e=this;if(this.loadingClearText(),document.getElementById("".concat(this.id,"-loading-item-0"))){var t=document.getElementById("".concat(this.id,"-loading-item-0")),i=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes[1];if(i||(t.style.height="100%",(i=document.createElement("div")).innerHTML=A.text,t.appendChild(i)),i.id="".concat(this.id,"-loading-item-txt"),i.innerHTML=A.text,i.style.fontSize="14px",!this.jSPlugin.isMobile&&this.jSPlugin.isCall){var n=this.jSPlugin.width/1024;i.style.fontSize="".concat(28*n,"px"),i.style.marginTop="16px"}if(this.jSPlugin.isCall&&1==A.type){var a=document.getElementById("".concat(this.id,"-loading-item-txt")),o=document.createElement("div");o.style="margin-bottom: 8px;width:24px;height:24px;",o.innerHTML='\n \n \n \n \n \n \n \n ',t.insertBefore(o,a)}if(i.style.color=A.color||"#FFFFFF",i.style.padding="0 6%",i.style.textAlign="center",this.state.text=A.text,A.delayClear)var r=setTimeout((function(){e.loadingClearText(),clearTimeout(r)}),parseInt(A.delayClear))}}},{key:"loadingSetTextWithBtn",value:function(A){var e=this;this.loadingClear(),console.log(this.jSPlugin);var t=!!this.jSPlugin.Theme.call&&this.jSPlugin.Theme.call.themeData||null;(t&&(0===t.customConfig.bellPoster||"onCall"===this.jSPlugin.Theme.call.bellStatus)||A.mask)&&document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background=A.maskStyle||"rgba(0,0,0,0.7)");var i=document.getElementById("".concat(this.id,"-loading-item-0"));if(i){i.style.height="100%",i.style["pointer-events"]="auto";var n=document.createElement("div");if(n.id="".concat(this.id,"-loading-item-txt"),n.innerHTML=A.text,n.title=A.text,n.style.color=A.color||"#FFFFFF",A.isMobile){var a=14*(this.jSPlugin.width/375);n.style.fontSize=a+"px"}else{var o=28*(this.jSPlugin.width/1024);n.style.fontSize=o+"px"}if(this.jSPlugin.isInspect&&(n.style="text-align: center; color: white; font-size: 14px; white-space: nowrap;overflow: hidden;text-overflow: ellipsis; width: 70%;"),i.appendChild(n),A.type&&2==A.type){var r=8,s=24;if(A.isMobile){s=24*(this.jSPlugin.width/375)}else{var g=this.jSPlugin.width/1024;r=g<1?16*g:16,s=40*g}var c=document.getElementById("".concat(this.id,"-loading-item-txt"));(C=document.createElement("div")).style="margin-bottom: ".concat(r,"px;width:").concat(s,"px;height:").concat(s,"px;"),C.innerHTML='\n \n \n \n \n \n \n \n '),i.insertBefore(C,c)}else{var l=document.createElement("div");if(l.id="".concat(this.id,"-loading-item-btn-wrap"),l.innerHTML='\n
').concat(A.btnName,'
\n \n \n \n '),A.isMobile)1==A.type?l.style="color:white;width:100px;height:30px;border-radius: 10px;background: rgba(255,255,255,0.25);text-align:center;line-height:30px;margin-top:9px;font-size:14px;-webkit-tap-highlight-color: transparent;":l.style="border: 1px solid rgba(204,204,204,1);color:white;width:80px;height:24px;border-radius: 12px;background: rgba(255,255,255,0.1);text-align:center;line-height:24px;margin-top:20px;font-size:12px;-webkit-tap-highlight-color: transparent;";else{var I=this.jSPlugin.width/1024;l.style="color:#648FFC;margin-top:16px;cursor: pointer;font-size:".concat(24*I,"px;"),this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"video"==this.jSPlugin.Theme.inspectMode&&(l.style="border: 1px solid rgba(255,255,255,1);color:white; cursor: pointer;text-align: center;width:80px;height:32px;border-radius:2px; text-align:center;line-height:32px;margin-top:16px;font-size:14px;-webkit-tap-highlight-color: transparent;")}if(i.appendChild(l),A.isMobile&&1==A.type){var C,d=document.getElementById("".concat(this.id,"-loading-item-txt"));(C=document.createElement("div")).style="margin-bottom: 8px;width:24px;height:24px;",C.innerHTML='\n \n \n \n \n \n \n \n ',i.insertBefore(C,d)}document.getElementById("".concat(this.id,"-loading-item-btn-wrap"))&&(document.getElementById("".concat(this.id,"-loading-item-btn-wrap")).onclick=function(){e.jSPlugin.play(),e.loadingClear(),e.loadingStart(e.id),e.loadingSetText({text:"视频加载中"})})}this.state.text=A.text,A.delayClear&&setTimeout((function(){e.loadingClearText()}),parseInt(A.delayClear))}}},{key:"loadingClearText",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){var A=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes;A.length>1?A[1].parentNode.removeChild(A[1]):A[0]&&A[0].parentNode.removeChild(A[0])}}},{key:"loadingClear",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){for(var A=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes,e=A.length-1;e>=0;e--)A[e].parentNode.removeChild(A[e]);document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background="none"),document.getElementById("".concat(this.id,"-loading-icon"))&&document.getElementById("".concat(this.id,"-loading-icon")).parentNode.removeChild(document.getElementById("".concat(this.id,"-loading-icon")))}}},{key:"loadingEnd",value:function(){var A=document.getElementById("".concat(this.id,"-loading-item-0"));if(A){A.parentNode.removeChild(A);var e=document.getElementById("".concat(this.id,"-loading-id-0"));e&&0===e.children.length&&e.parentNode.removeChild(e)}document.getElementById("".concat(this.id,"-loading-item-0")).style.background="none"}}],[{key:"_instanceStyle",value:function(){A._STYLE||(A._STYLE=document.createElement("style"),A._STYLE.innerHTML="@keyframes antRotate {to {transform: rotate(400deg);transform-origin:50% 50%;}} .loading {display: inline-block;z-index: 1000;-webkit-animation: antRotate 1s infinite linear;animation: antRotate 1s infinite linear;}",document.getElementsByTagName("head")[0].appendChild(A._STYLE))}}])}();s(H,"_STYLE",void 0);var K=function(){return o((function A(e,i){t(this,A),this.id=i,this.jSPlugin=e,this.timer=null,this.state={play:!1,loading:!1}}),[{key:"default",value:function(A,e){var t=this,i="msgId",n=e||document.getElementById("".concat(this.id,"-wrap"));document.getElementById("".concat(this.id,"-").concat(i))&&n.removeChild(document.getElementById("".concat(this.id,"-").concat(i)));var a=document.createElement("div");a.id="".concat(this.id,"-").concat(i),a.style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);text-align: center;padding: 4px 16px;background: #00000080;color: #FFFFFF;font-size: 14px;",a.innerHTML=A,n.appendChild(a),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){var A=document.getElementById("".concat(t.id,"-").concat(i));n&&A&&n.removeChild(A)}),2e3)}}])}(),V={391001:"取流地址或端口非法",395e3:"服务内部异常,请稍后重试",395400:"预览取流参数异常",395402:"设备当前时段无录像,请选择其他时间段",395403:"服务异常,请重试或联系客服",395404:"设备不在线,请优化网络后重启设备再试",395405:"设备侧网络问题,请检查优化网络后重启设备再试",395406:"token过期,请重试",395407:"客户端的URL格式错误",395409:"预览开启隐私保护",395410:"服务异常,请重试或联系客服",395411:"无权查看当前设备",395412:"服务异常,请重试或联系客服",395413:"服务异常,请重试或联系客服",395415:"设备通道错误",395416:"当前观看路数达到设备最大限制,请重启设备或联系设备售后处理",395451:"设备不支持该码流类型,请检查设备通道支持情况或联系硬件售后",395452:"设备侧网络较差,请检查优化网络后重启设备再试",395454:"设备侧网络较差,请检查优化网络后重启设备再试",395455:"设备通道异常,请检查通道配置后重试",395456:"设备通道异常,请检查通道配置后重试",395457:"服务异常,请重试或联系客服",395458:"服务异常,请重试或联系客服",395459:"服务异常,请重试或联系客服",395460:"服务异常,请重试或联系客服",395492:"服务异常,请重试或联系客服",395500:"服务异常,请重试或联系客服",395501:"服务异常,请重试或联系客服",395503:"服务异常,请重试或联系客服",395504:"服务异常,请重试或联系客服",395505:"服务异常,请重试或联系客服",395506:"暂不支持该设备直接取流,请连接NVR后重试或联系客服",395507:"设备4G无限流量套餐仅支持萤石云视频APP使用,请联系APP客服更换套餐",395530:"服务异常,请重试或联系客服",395544:"视频源不存在,请检查设备配置",395545:"服务异常,请重试或联系客服",395546:"同时观看人数达到账号最大限制,请联系客服",395547:"同时观看人数达到账号最大限制,请联系客服",395556:"服务异常,请重试或联系客服",395557:"设备取流失败,请联系硬件售后",395558:"查找录像开始时间错误",395560:"服务异常,请重试或联系客服",395561:"服务异常,请重试或联系客服",395562:"服务异常,请重试或联系客服",395563:"服务异常,请重试或联系客服",395564:"服务异常,请重试或联系客服",395566:"服务异常,请重试或联系客服",395567:"服务异常,请重试或联系客服",395568:"服务异常,请重试或联系客服",395569:"服务异常,请重试或联系客服",395600:"服务异常,请重试或联系客服",395601:"服务异常,请重试或联系客服",395602:"服务异常,请重试或联系客服",395610:"服务异常,请重试或联系客服",395620:"服务异常,请重试或联系客服",395701:"服务异常,请重试或联系客服",395702:"服务异常,请重试或联系客服",395703:"服务异常,请重试或联系客服",396001:"服务异常,请重试或联系客服",396099:"服务异常,请重试或联系客服",396101:"服务异常,请重试或联系客服",396102:"服务异常,请重试或联系客服",396103:"服务异常,请重试或联系客服",396104:"服务异常,请重试或联系客服",396105:"设备异常,请重试或联系客服",396106:"设备通道异常,请检查通道配置后重试",396107:"设备异常,请重试或联系客服",396108:"服务异常,请重试或联系客服",396109:"服务异常,请重试或联系客服",396110:"设备异常,请重试或联系客服",396501:"设备异常,请重试或联系客服",396502:"设备异常,请重试或联系客服",396503:"设备异常,请重试或联系客服",396504:"设备异常,请重试或联系客服",396505:"设备异常,请重试或联系客服",396506:"设备异常,请重试或联系客服",396508:"设备异常,请重试或联系客服",396509:"设备异常,请重试或联系客服",396510:"设备异常,请重试或联系客服",396511:"设备异常,请重试或联系客服",396512:"设备异常,请重试或联系客服",396513:"设备异常,请重试或联系客服",396514:"设备异常,请重试或联系客服",396515:"设备异常,请重试或联系客服",396516:"设备异常,请重试或联系客服",396517:"设备异常,请重试或联系客服",396518:"设备异常,请重试或联系客服",396519:"设备网络异常,请检查优化网络后重启设备再试",396520:"设备网络异常,请检查优化网络后重启设备再试",396700:"服务异常,请重试或联系客服",396701:"回放结束",397001:"服务异常,请重试或联系客服",397002:"服务异常,请重试或联系客服",397003:"服务异常,请重试或联系客服",397004:"服务异常,请重试或联系客服",397005:"设备取流连接断开,请检查网络后重试",397006:"服务异常,请重试或联系客服",397007:"服务异常,请重试或联系客服",399e3:"服务异常,请重试或联系客服",399001:"客户端网络超时",399002:"服务异常,请重试或联系客服",399016:"token失效,请更新并重试",399048:"同时观看人数达到账号最大限制,请联系客服",399049:"免费版并发数达到上限,请升级企业版使用多并发能力",3810001:"操作失败",3810002:"账号异常,操作失败",3810005:"账号异常,操作失败",3820002:"设备不存在,请检查设备连接情况",3820006:"操作失败,请检查设备网络情况",3820007:"操作失败,请检查设备网络情况",3820008:"操作过于频繁,稍后再试",3820014:"操作失败",3820032:"通道不存在请检查设备连接情况",3849999:"操作失败,请重试",386e4:"操作失败,设备不支持该操作",3860001:"操作失败,用户无权限",3860002:"设备已旋转到上限位",3860003:"设备已旋转到下限位",3860004:"设备已旋转到左限位",3860005:"设备已旋转到右限位",3860006:"操作失败,请重试",3860009:"设备正在操作中",3860020:"操作失败",BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍后",TIMEFORMAT_ERROR:"时间格式有误,请确认",USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功",GET_PLAYURL_FAILED:"获取播放地址失败",VIDEO_LOADING:"视频加载中",DISCONNECT:"连接断开,请重试",DEVICE_ENCRYPTED:"设备已加密",NO_RECORD:"未找到录像片段",PLAY_FAILED:"播放失败,请检查设备及客户端网络",PLAY_SUCCESS:"播放成功",STOP_SUCCESS:"停止成功",CHANGE_PLAYURL_SUCCESS:"切换播放地址成功",CHANGE_PLAYURL_FAILED:"切换播放地址失败",GET_OSD_TIME:"获取OSD时间",GET_OSD_TIME_FAILED:"获取OSD时间失败",SET_POSTER:"设置播放器封面",RESIZE:"调整播放器尺寸",SPEED:"倍速",SPEED_RATE:"倍",SPEED_CANCEL:"取消",GET_SPEED:"获取当前播放速率",MAX_SPEED_LIMIT:"播放速度最大为4倍速度",MIN_SPEED_LIMIT:"播放速度最小为1倍速度",SEEK_CANNOT_CROSS_DAYS:"seek时间不能跨日期",SEEK_TIMEFORMAT_ERROR:"seek时间格式错误",PAUSE:"暂停",PAUSE_FAILED:"暂停失败",RESUME:"恢复播放",RESUME_FAILED:"恢复播放失败",CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"该设备在当天没有云录制的录像",CHANGE_VIDEO_LEVEL:"切换清晰度",CHANGE_VIDEO_LEVEL_FAIL:"切换清晰度失败",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度",VIDEO_LEVEL_NOT_SUPPORT:"当前设备不支持该清晰度",VIDEO_LEVEL_FLUENT:"流畅",VIDEO_LEVEL_SATNDARD:"标清",VIDEO_LEVEL_HEIGH:"高清",VIDEO_LEVEL_SPUER:"超清",VIDEO_LEVEL_EXTREME:"极清",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"重置主题",BTN_PLAY:"播放/结束播放",BTN_SOUND:"声音",BTN_RECORDVIDEO:"录屏",BTN_CAPTURE:"截图",BTN_TALK:"对讲",BTN_ZOOM:"电子放大",BTN_3D_ZOOM:"3D定位",BTN_PTZ:"云台控制",BTN_EXPEND:"全局全屏",BTN_WEBEXPEND:"网页全屏",BTN_HD:"画面清晰度",BTN_SPEED:"回放倍速",BTN_CLOUDREC:"云存储回放",BTN_CLOUDRECORD:"云录制",BTN_REC:"本地存储",DEVICE_NAME:"设备名称",DEVICE_ID:"设备序列号",CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败",START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败",RECORD_TIPS:"今日录像",RECORDS:"个录像",OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音",SOUND_OPENED:"当前已经有画面正在播放声音",ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"已经放大到最大倍数8.0X",ZOOM_SUB_MIN:"已经缩小到最小倍数1.0X",ZOOM_LIMIT_MAX:"超出最大倍率8.0X",ZOOM_LIMIT_MIN:"超出最小倍率1.0X","3D_ZOOM":"3D定位","3D_ZOOM_DISABLE":"未启用3D定位功能","3D_ZOOM_FAILED":"3D定位失败,请重试",START_3D_ZOOM:"开启3D定位",CLOSE_3D_ZOOM:"关闭3D定位",DEVICE_NOT_SUPPORT_3D_ZOOM:"当前设备不支持3D定位功能","3D_ZOOM_ACTIVED":"3D定位已处于开启状态","3D_ZOOM_NOT_ACTIVED":"未启用3D定位功能","3D_ZOOM_CLOSED":"3D定位已处于关闭状态",CHANGE_ZOOM_TYPE:"改变缩放模式",FULLSCREEN:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏",DESTROY:"销毁",GET_CAPACITY:"获取设备能力级",GET_CAPACITY_FAILED:"获取设备能力级失败",GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距",NOT_SUPPORT_DEVICE_ZOOM:"当前设备不支持物理缩放",NOT_SUPPORT_FOCUS:"当前设备不支持变焦",MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误",CHANGE_FEC_TYPE:"切换鱼眼矫正类型",DEVICE_NOT_SUPPORT:"设备不支持鱼眼模式",TYPE_NOT_SUPPORT:"鱼眼矫正类型暂时不支持",FEC_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正",NO_CANVAS_ID:"鱼眼矫正类型需要分屏,但是没有传正确的分屏的canvas id",SET_FEC_PARAMS:"设置3D矫正视角参数",GET_FEC_PARAMS:"获取3D矫正视角参数",SET_FEC_PARAMS_FAILED:"该矫正类型不能设置3D矫正视角参数",GET_FEC_PARAMS_FAILED:"该矫正类型不能获取3D矫正视角参数",GET_FEC_PARAMS_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正获取3D矫正视角参数",SET_WATERMARK:"设置水印"},O={391001:"Illegal streaming address or port",395e3:"Internal service exception, please try again later",395400:"Preview streaming parameter exception",395402:"Device has no recording in the current time period, please select another time period",395403:"Service exception, please try again or contact customer service",395404:"The device is not online, Please optimize the network and restart the device to try again",395405:"Device side network is poor, please check and optimize the network and restart the device to try again",395406:"Token expired, please try again",395407:"Client URL format error",395409:"Service exception, please try again or contact customer service",395410:"Service exception, please try again or contact customer service",395411:"No permission to view the current device",395412:"Service exception, please try again or contact customer service",395413:"Service exception, please try again or contact customer service",395415:"Device channel error",395416:"The current number of viewing channels has reached the maximum limit of the device. Please restart the device or contact the device after-sales service",395451:"The device does not support this bitstream type. Please check the device channel support or contact the hardware after-sales service",395452:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395454:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395455:"The device channel is abnormal. Please check the channel configuration and try again",395456:"The device channel is abnormal. Please check the channel configuration and try again",395457:"Service exception, please try again or contact customer service",395458:"Service exception, please try again or contact customer service",395459:"Service exception, please try again or contact customer service",395460:"Service exception, please try again or contact customer service",395492:"Service exception, please try again or contact customer service",395500:"Service exception, please try again or contact customer service",395501:"Service exception, please try again or contact customer service",395503:"Service exception, please try again or contact customer service",395504:"Service exception, please try again or contact customer service",395505:"Service exception, please try again or contact customer service",395506:"Direct streaming of this device is not supported at present, please try again or contact customer service after connecting to NVR",395507:"Device 4G unlimited traffic package only supports EZVIZ Cloud Video APP, please contact APP customer service to change the package",395530:"Service exception, please try again or contact customer service",395544:"Video source does not exist, please check device configuration",395545:"Service exception, please try again or contact customer service",395546:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395547:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395556:"Service exception, please try again or contact customer service",395557:"Device streaming failed, please contact hardware after-sales",395558:"Error in finding the start time of recording",395560:"Service exception, please try again or contact customer service",395561:"Service exception, please try again or contact customer service",395562:"Service exception, please try again or contact customer service",395563:"Service exception, please try again or contact customer service",395564:"Service exception, please try again or contact customer service",395566:"Service exception, please try again or contact customer service",395567:"Service exception, please try again or contact customer service",395568:"Service exception, please try again or contact customer service",395569:"Service exception, please try again or contact customer service",395600:"Service exception, please try again or contact customer service",395601:"Service exception, please try again or contact customer service",395602:"Service exception, please try again or contact customer service",395610:"Service exception, please try again or contact customer service",395620:"Service exception, please try again or contact customer service",395701:"Service exception, please try again or contact customer service",395702:"Service exception, please try again or contact customer service",395703:"Service exception, please try again or contact customer service",396001:"Service exception, please try again or contact customer service",396099:"Service exception, please try again or contact customer service",396101:"Service exception, please try again or contact customer service",396102:"Service exception, please try again or contact customer service",396103:"Service exception, please try again or contact customer service",396104:"Service exception, please try again or contact customer service",396105:"Device abnormality, please try again or contact customer service",396106:"Device channel abnormality, please check the channel configuration and try again",396107:"Device abnormality, please try again or contact customer service",396108:"Service exception, please try again or contact customer service",396109:"Service exception, please try again or contact customer service",396110:"Device abnormality, please try again or contact customer service",396501:"Device abnormality, please try again or contact customer service",396502:"Device abnormality, please try again or contact customer service",396503:"Device abnormality, please try again or contact customer service",396504:"Device abnormality, please try again or contact customer service",396505:"Device abnormality, please try again or contact customer service",396506:"Device abnormality, please try again or contact customer service",396508:"Device abnormality, please try again or contact customer service",396509:"Device abnormality, please try again or contact customer service",396510:"Device abnormality, please try again or contact customer service",396511:"Device abnormality, please try again or contact customer service",396512:"Device abnormality, please try again or contact customer service",396513:"Device abnormality, please try again or contact customer service",396514:"Device abnormality, please try again or contact customer service",396515:"Device abnormality, please try again or contact customer service",396516:"Device abnormality, please try again or contact customer service",396517:"Device abnormality, please try again or contact customer service",396518:"Device abnormality, please try again or contact customer service",396519:"Device network abnormality, please check and optimize the network and restart the device to try again",396520:"Device network abnormality, please check and optimize the network and restart the device to try again",396700:"Service exception, please try again or contact customer service",396701:"Playback ends",397001:"Service exception, please try again or contact customer service",397002:"Service exception, please try again or contact customer service",397003:"Service exception, please try again or contact customer service",397004:"Service exception, please try again or contact customer service",397005:"Device streaming connection is disconnected, please check the network and try again",397006:"Service exception, please try again or contact customer service",397007:"Service exception, please try again or contact customer service",399e3:"Service exception, please try again or contact customer service",399001:"Client network timeout",399002:"Service exception, please try again or contact customer service",399016:"Token invalid, please update and retry",399048:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399049:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",3810001:"Operation failed",3810002:"Account exception, operation failed",3810005:"Account exception, operation failed",3820002:"Device does not exist, please check the device connection status",3820006:"Operation failed, please check the network condition of the device",3820007:"Operation failed, please check the network condition of the device",3820008:"The operation is too frequent, please try again later",3820014:"Operation failed",3820032:"The channel does not exist. Please check the device connection status",3849999:"Operation failed, please try again",386e4:"Operation failed, the device does not support this operation",3860001:"Operation failed, user does not have permission",3860002:"The device has been rotated to the upper limit position",3860003:"The device has been rotated to the lower limit position",3860004:"The device has rotated to the left limit position",3860005:"The device has been rotated to the right limit position",3860006:"Operation failed, please try again",3860009:"The device is currently in operation",3860020:"Operation failed",BTN_RETRY:"Retry",BTN_RELOAD:"Reload",LOADING:"Loading, please wait",TIMEFORMAT_ERROR:"The time format is wrong, please confirm",USE_MULTITHREADING_WARING:"Your current browser can enable the multi-threaded feature of Google Labs to get a better playback experience and avoid browser freezes and crashes. For details, see:",OPEN_INSTRUCTIONS:"Enablement instructions",INIT_FINSHED:"Initialize the player completed",INIT_SUCCESS:"Initialize the player successfully",GET_PLAYURL_FAILED:"Failed to obtain the playback address",VIDEO_LOADING:"Video loading",DISCONNECT:"Connection disconnected, please try again",DEVICE_ENCRYPTED:"Device encrypted",NO_RECORD:"No video clips found",PLAY_FAILED:"Play failed, please check the device and client network",PLAY_SUCCESS:"Play successfully",STOP_SUCCESS:"Stop successfully",CHANGE_PLAYURL_SUCCESS:"Switch the playback address successfully",CHANGE_PLAYURL_FAILED:"Switch the playback address failed",GET_OSD_TIME:"Get OSD time",GET_OSD_TIME_FAILED:"Failed to get OSD time",SET_POSTER:"Set the player cover",RESIZE:"Adjust the player size",SPEED:"speeds",SPEED_RATE:"X",SPEED_CANCEL:"Cancel",GET_SPEED:"Get the current playback rate",MAX_SPEED_LIMIT:"The maximum playback speed is 4 times the speed",MIN_SPEED_LIMIT:"The minimum playback speed is 1 times the speed",SEEK_CANNOT_CROSS_DAYS:"The seek time cannot cross dates",SEEK_TIMEFORMAT_ERROR:"The seek time format is wrong",PAUSE:"Pause",PAUSE_FAILED:"Pause failed",RESUME:"Resume playback",RESUME_FAILED:"Resume playback failed",CALL_END:"Call ended",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"The device has no cloud recorded video on that day",CHANGE_VIDEO_LEVEL:"Switch definition",CHANGE_VIDEO_LEVEL_FAIL:"Switch definition failed",GET_VIDEO_LEVEL_LIST:"Get the definition list supported by the device",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"Please enter the correct definition",VIDEO_LEVEL_NOT_SUPPORT:"The current device does not support this definition",VIDEO_LEVEL_FLUENT:"Fluent",VIDEO_LEVEL_SATNDARD:"Standard",VIDEO_LEVEL_HEIGH:"heigh",VIDEO_LEVEL_SPUER:"Super",VIDEO_LEVEL_EXTREME:"Extreme",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"Reset theme",BTN_PLAY:"Play/end playback",BTN_SOUND:"Sound",BTN_RECORDVIDEO:"Screen recording",BTN_CAPTURE:"Screenshot",BTN_TALK:"Intercom",BTN_ZOOM:"Electronic zoom",BTN_3D_ZOOM:"3D positioning",BTN_PTZ:"PTZ control",BTN_EXPEND:"Global full screen",BTN_WEBEXPEND:"Web page full screen",BTN_HD:"Image definition",BTN_SPEED:"Playback speed",BTN_CLOUDREC:"Cloud storage playback",BTN_CLOUDRECORD:"Cloud recording",BTN_REC:"Local storage",DEVICE_NAME:"Device name",DEVICE_ID:"Device serial number",CAPTURE_SUCCESS:"Screenshot successful",CAPTURE_FAILED:"Screenshot failed",START_RECORD_SUCCESS:"Start recording successful",START_RECORD_FAILED:"Screenshot failed",STOP_RECORD_SUCCESS:"Stop recording successful",STOP_RECORD_FAILED:"Stop recording failed",RECORD_TIPS:"Today's recording",RECORDS:" in total",OPEN_SOUND:"Turn on sound",CLOSE_SOUND:"Turn off sound",SOUND_OPENED:"There is already a picture playing sound at the moment",ZOOM:"Electronic zoom",START_ZOOM:"Turn on electronic zoom",CLOSE_ZOOM:"Turn off electronic zoom",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"It has been enlarged to a maximum magnification of 8.0X",ZOOM_SUB_MIN:"It has been reduced to the minimum multiple of 1.0X",ZOOM_LIMIT_MAX:"Exceeding maximum magnification of 8.0X",ZOOM_LIMIT_MIN:"Exceeding the minimum magnification of 1.0X","3D_ZOOM":"3D positioning","3D_ZOOM_DISABLE":"3D positioning function not enabled","3D_ZOOM_FAILED":"3D positioning failed, please try again",START_3D_ZOOM:"Turn on 3D positioning",CLOSE_3D_ZOOM:"Turn off 3D positioning",DEVICE_NOT_SUPPORT_3D_ZOOM:"Current device does not support 3D positioning function","3D_ZOOM_ACTIVED":"3D positioning is already enabled","3D_ZOOM_NOT_ACTIVED":"3D positioning function is not enabled","3D_ZOOM_CLOSED":"3D positioning is already disabled",CHANGE_ZOOM_TYPE:"Change zoom mode",FULLSCREEN:"Global full screen",FULLSCREEN_EXIT:"Exit global full screen",GET_WEB_FULLSCREEN_STATUS:"Get browser web page full screen status",WEB_FULLSCREEN:"Turn on web page full screen",WEB_FULLSCREEN_EXIT:"Exit full screen webpage",DESTROY:"Destroy",GET_CAPACITY:"Get device capability level",GET_CAPACITY_FAILED:"Get device capability level failed",GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length",NOT_SUPPORT_DEVICE_ZOOM:"Device does not support physical zoom",NOT_SUPPORT_FOCUS:"Device does not support adjusting the focal length",MIRROR:"Mirror flip",MIRROR_TYPE_ERROR:"Flip parameter type error",CHANGE_FEC_TYPE:"Switch fisheye correction type",DEVICE_NOT_SUPPORT:"Device does not support fisheye mode",TYPE_NOT_SUPPORT:"Fisheye correction type is not supported temporarily",FEC_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction",NO_CANVAS_ID:"Fisheye correction type requires split screen, but the correct split screen canvas id is not passed",SET_FEC_PARAMS:"Set 3D correction perspective parameters",GET_FEC_PARAMS:"Get 3D correction perspective parameters",SET_FEC_PARAMS_FAILED:"This correction type cannot set 3D correction perspective parameters",GET_FEC_PARAMS_FAILED:"This correction type cannot get 3D correction perspective parameters",GET_FEC_PARAMS_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction Get 3D correction perspective parameters",SET_WATERMARK:"Set watermark"},j="object"==typeof global&&global&&global.Object===Object&&global,W="object"==typeof self&&self&&self.Object===Object&&self,Z=j||W||Function("return this")(),X=Z.Symbol,q=Object.prototype,z=q.hasOwnProperty,AA=q.toString,eA=X?X.toStringTag:void 0;var tA=Object.prototype.toString;var iA=X?X.toStringTag:void 0;function nA(A){return null==A?void 0===A?"[object Undefined]":"[object Null]":iA&&iA in Object(A)?function(A){var e=z.call(A,eA),t=A[eA];try{A[eA]=void 0;var i=!0}catch(A){}var n=AA.call(A);return i&&(e?A[eA]=t:delete A[eA]),n}(A):function(A){return tA.call(A)}(A)}function aA(A){return null!=A&&"object"==typeof A}function oA(A){return"symbol"==typeof A||aA(A)&&"[object Symbol]"==nA(A)}var rA=Array.isArray,sA=X?X.prototype:void 0,gA=sA?sA.toString:void 0;function cA(A){if("string"==typeof A)return A;if(rA(A))return function(A,e){for(var t=-1,i=null==A?0:A.length,n=Array(i);++t-1&&A%1==0&&A-1&&A%1==0&&A<=9007199254740991}function JA(A){return null!=A&&UA(A.length)&&!mA(A)}var HA=Object.prototype;function KA(A){return aA(A)&&"[object Arguments]"==nA(A)}var VA=Object.prototype,OA=VA.hasOwnProperty,jA=VA.propertyIsEnumerable,WA=KA(function(){return arguments}())?KA:function(A){return aA(A)&&OA.call(A,"callee")&&!jA.call(A,"callee")},ZA=WA;var XA="object"==typeof exports&&exports&&!exports.nodeType&&exports,qA=XA&&"object"==typeof module&&module&&!module.nodeType&&module,zA=qA&&qA.exports===XA?Z.Buffer:void 0,$A=(zA?zA.isBuffer:void 0)||function(){return!1},Ae={};Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Arguments]"]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object Boolean]"]=Ae["[object DataView]"]=Ae["[object Date]"]=Ae["[object Error]"]=Ae["[object Function]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae["[object Object]"]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object WeakMap]"]=!1;var ee,te="object"==typeof exports&&exports&&!exports.nodeType&&exports,ie=te&&"object"==typeof module&&module&&!module.nodeType&&module,ne=ie&&ie.exports===te&&j.process,ae=function(){try{var A=ie&&ie.require&&ie.require("util").types;return A||ne&&ne.binding&&ne.binding("util")}catch(A){}}(),oe=ae&&ae.isTypedArray,re=oe?(ee=oe,function(A){return ee(A)}):function(A){return aA(A)&&UA(A.length)&&!!Ae[nA(A)]},se=Object.prototype.hasOwnProperty;function ge(A,e){var t=rA(A),i=!t&&ZA(A),n=!t&&!i&&$A(A),a=!t&&!i&&!n&&re(A),o=t||i||n||a,r=o?function(A,e){for(var t=-1,i=Array(A);++t-1},ye.prototype.set=function(A,e){var t=this.__data__,i=pe(t,A);return i<0?(++this.size,t.push([A,e])):t[i][1]=e,this};var _e=TA(Z,"Map");function Se(A,e){var t,i,n=A.__data__;return("string"==(i=typeof(t=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==t:null===t)?n["string"==typeof e?"string":"hash"]:n.map}function De(A){var e=-1,t=null==A?0:A.length;for(this.clear();++er))return!1;var g=a.get(A),c=a.get(e);if(g&&c)return g==e&&c==A;var l=-1,I=!0,C=2&t?new it:void 0;for(a.set(A,e),a.set(e,A);++l=e||t<0||l&&A-g>=a}function h(){var A=St();if(d(A))return B(A);r=setTimeout(h,function(A){var t=e-(A-s);return l?wt(t,a-(A-g)):t}(A))}function B(A){return r=void 0,I&&i?C(A):(i=n=void 0,o)}function u(){var A=St(),t=d(A);if(i=arguments,n=this,s=A,t){if(void 0===r)return function(A){return g=A,r=setTimeout(h,e),c?C(A):o}(s);if(l)return clearTimeout(r),r=setTimeout(h,e),C(s)}return void 0===r&&(r=setTimeout(h,e)),o}return e=fA(e)||0,dA(t)&&(c=!!t.leading,a=(l="maxWait"in t)?Dt(fA(t.maxWait)||0,e):a,I="trailing"in t?!!t.trailing:I),u.cancel=function(){void 0!==r&&clearTimeout(r),g=0,i=s=n=r=void 0},u.flush=function(){return void 0===r?o:B(St())},u}var bt=Math.max;function Ft(A,e,t){var i=null==A?0:A.length;if(!i)return-1;var n=null==t?0:xA(t);return n<0&&(n=bt(i+n,0)),function(A,e,t,i){for(var n=A.length,a=t+(i?1:-1);i?a--:++a-1?i[n?A[a]:a]:void 0});var Pt={color:"red",backgroundColor:"red",activeColor:"red",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-header-0",iconId:"deviceID",part:"left",defaultActive:1,isrender:1,themeId:"934f270c08b14e928bf0c2ae8e1a937d"},{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-header-1",iconId:"deviceName",part:"left",defaultActive:1,isrender:1,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},Nt={color:"blue",backgroundColor:"blue",activeColor:"blue",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-footer-0",iconId:"play",part:"left",defaultActive:0,isrender:0,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},Tt=function(A){this.jsPlugin=A;var e={id:A.id,isMouseDown:!1,isOver:!1,mousePosition:null,oldTime:null,nowTime:A.nowTime||null,moved:null,hoverTime:"2018-12-07 12:00:00",hoverLeft:0,timeTipShow:!1,randomNum:123,timeWidthTbls:[60,1800,3600,86400],timeUnits:["范围: 1分钟; 单位: 秒","范围: 30分钟; 单位: 分钟","范围: 1小时; 单位: 分钟","范围: 1天; 单位: 小时","范围: 3天; 单位: 小时"],drawPen:null,timeSection:[],canvasWidth:null,canvasHeight:null,timeTips:null},t=this;Object.keys(e).forEach((function(A){t[A]=e[A]})),this.options={width:this.canvasWidth,height:48,time:(new Date).getTime(),timeSection:[],timeWidth:0},this.subTime=function(A){return A<10?"0"+A:A},this.tranTime=function(A){var e=A;if(A){var t=new Date(A);e=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate()+" "+this.subTime(t.getHours())+":"+this.subTime(t.getMinutes())+":"+this.subTime(t.getSeconds())}return e},this.init=function(A){var e=this.options;return new Promise((function(i,n){A.width&&document.getElementById(A.id).setAttribute("width",parseInt(A.width,10)+"px"),t.randomNum=(Math.random()+"").split(".").join(""),t.timeWidthTblIndex=e.timeWidth;var a=document.getElementById("".concat(t.jsPlugin.id,"-canvas"));t.drawPen=a.getContext("2d"),t.nowTime=A.nowTime,t.timeSection=e.timeSection||[],t.canvasWidth=a.offsetWidth,t.canvasHeight=a.offsetHeight,t.updata(),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mousemove",(function(A){t.options.readOnly||t.mousemove(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseover",(function(A){t.options.readOnly||t.mouseover(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseleave",(function(A){t.options.readOnly||t.mouseleave(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mousedown",(function(A){t.options.readOnly||t.mousedown(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseup",(function(e){if(!t.options.readOnly){var i=A.onChange;t.mouseUpFn(e,i)}})),i()}))},this.setWidth=function(A){A.width&&(document.getElementById(A.id).width=A.width,document.getElementById("".concat(A.id,"-canvas")).width=A.width,document.getElementById("".concat(A.id,"-canvas-container")).width=A.width,t.canvasWidth=A.width,t.updata({time:t.nowTime||new Date}))},this.mousemove=function(A){if(this.isMouseDown&&this.isOver){var e=this.mousePosition-A.pageX;if(0===e)return;var t=0;switch(this.timeWidth){case 60:t=.1;break;case 1800:t=3;break;case 3600:t=90;break;case 86400:t=120}var i=new Date(this.oldTime).getTime()+e*t*1e3;this.updata({time:i}),this.moved=!0}else{var n=parseInt(document.getElementById("".concat(this.jsPlugin.id,"-canvas-container")).offsetLeft,10);this.mousePosition=A.pageX-n,this.updata()}},this.mousedown=function(A){this.isMouseDown=!0,this.mousePosition=A.pageX,this.oldTime=this.nowTime},this.mouseover=function(A){this.isOver=!0},this.mouseleave=function(A){this.isOver=!1,this.isMouseDown=!1,this.updata()},this.changeSize=function(A){console.log("changeSize",A),this.options.timeWidth=A,this.updata({timeWidth:A})},this.mouseUpFn=function(A,e){if(this.isMouseDown&&(this.isMouseDown=!1,this.moved)){this.moved=!1;var t=new Date(this.nowTime).getFullYear()+"/"+(new Date(this.nowTime).getMonth()+1)+"/"+new Date(this.nowTime).getDate()+" "+this.subTime(new Date(this.nowTime).getHours())+":"+this.subTime(new Date(this.nowTime).getMinutes())+":"+this.subTime(new Date(this.nowTime).getSeconds());this.nowTime=new Date(t),this.updata({time:this.nowTime}),this.oldTime=this.nowTime,console.log("nowTime",new Date(this.nowTime),t),e(this.nowTime)}},this.readOnly=function(A){console.log("更改为只读"),this.options.readOnly=!0,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="not-allowed"},this.unReadOnly=function(A){console.log("更改为只读"),this.options.readOnly=!1,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="pointer"},this.run=function(A){t.isMouseDown||t.updata(A)},this.getTime=function(A){console.log("this",this),console.log("当前时间",new Date(this.nowTime))},this.updata=function(A){A=A||{},t.nowTime=A.time||t.nowTime,t.timeSection=A.timeSection||t.timeSection,t.timeWidthTblIndex=A.timeWidth||t.timeWidthTblIndex,t.timeWidth=t.timeWidthTbls[A.timeWidth||t.timeWidthTblIndex],t.timeUnit=t.timeUnits[A.timeWidth||t.timeWidthTblIndex],0===A.timeWidth&&(t.timeWidthTblIndex=0,t.timeWidth=t.timeWidthTbls[0],t.timeUnit=t.timeUnits[0]),t.drawPen.fillStyle="#000000",t.drawPen.fillRect(0,0,t.canvasWidth,t.canvasHeight),t.drawScale(),t.drawRecord(),t.drawOtherMsg()},this.drawSolidLine=function(A,e,t,i,n,a){this.drawPen.save(),this.drawPen.strokeStyle=a,this.drawPen.lineWidth=n,this.drawPen.beginPath(),this.drawPen.moveTo(A,e),this.drawPen.lineTo(t,i),this.drawPen.stroke(),this.drawPen.restore()},this.drawString=function(A,e,t,i,n){this.drawPen.font="12px serif",this.drawPen.fillStyle="#ffffff",this.drawPen.textAlign=i||"left",this.drawPen.fillText(A,e,t+10)},this.drawScale=function(){var A=this,e="rgba(255,255,255)",t=new Date(A.nowTime),i=t.getSeconds(),n=t.getMinutes(),a=t.getHours(),o=t.getDate(),r=0;switch(A.timeWidth){case 60:var s=parseInt(A.canvasWidth/10);t.setSeconds(t.getSeconds()-parseInt(s/2,10)),o=t.getDate(),a=t.getHours(),n=t.getMinutes(),i=t.getSeconds();for(var g=0;ge.canvasWidth&&(i=e.canvasWidth),i<=0&&(i=0),i}},this.drawOtherMsg=function(){this.drawSolidLine(this.canvasWidth/2,0,this.canvasWidth/2,this.canvasHeight,2,"#1890FF"),this.drawPen.shadowBlur=0,this.isOver&&!this.isMouseDown?(this.mouseTime=this.mousePosition/this.canvasWidth*this.timeWidth*1e3+this.nowTime-this.timeWidth/2*1e3,this.mouseString=this.tranTime(this.mouseTime),this.hoverTime=this.mouseString,this.hoverLeft=this.mousePosition-60,this.timeTipShow=!0):this.timeTipShow=!1}},Mt="https://open.ys7.com",Lt=256,Yt=1536,Gt=2304,Ut=[{place:3,name:"鱼眼不矫正",type:0,correctType:0},{place:3,name:"360°全景",type:1,correctType:768},{place:3,name:"4分屏",type:4,correctList:[{correctType:Lt,x:.25,y:.25},{correctType:Lt,x:.75,y:.25},{correctType:Lt,x:.25,y:.75},{correctType:Lt,x:.75,y:.75}],correctType:Lt},{place:3,name:"柱状",type:5,correctType:Yt,viewParam:{x:0,y:0}}],Jt=[{place:1,name:"鱼眼不矫正",type:0,correctType:0},{place:1,name:"360°全景",type:1,correctType:768},{place:1,name:"4分屏",type:2,correctList:[{correctType:Lt,x:.25,y:.25},{correctType:Lt,x:.75,y:.25},{correctType:Lt,x:.25,y:.75},{correctType:Lt,x:.75,y:.75}],correctType:Lt},{place:1,name:"广角",type:4,correctType:Gt}];var Ht=Mt,Kt=function(){return o((function A(e){return t(this,A),A.instant?A.instant:(Ht=e||Ht,A.instant=this)}),[{key:"setDomain",value:function(A){Ht=A||Ht}},{key:"fetch",value:function(A){function e(e,t){return A.apply(this,arguments)}return e.toString=function(){return A.toString()},e}((function(A,e){return A="string"==typeof A?/^http/.test(A)?A:Ht+A:A,new Promise((function(t,i){fetch(A,e).then((function(A){try{return A.json()}catch(A){i({code:-1,msg:"data json parse error"})}})).then((function(A){200==+A.code||A.meta&&200===A.meta.code?t(A):i(A)})).catch((function(A){i(A)}))}))}))}])}();function Vt(A){var e=A.slice(0,4),t=A.slice(4,6),i=A.slice(6,8),n=A.slice(8,10),a=A.slice(10,12),o=A.slice(12,14);return new Date("".concat(e,"/").concat(t,"/").concat(i," ").concat(n,":").concat(a,":").concat(o))}function Ot(A,e){var t,i,n={startTime:e.startTime?new Date(e.startTime).Format("yyyy-MM-dd hh:mm:ss"):void 0,endTime:e.startTime?new Date(e.endTime).Format("yyyy-MM-dd hh:mm:ss"):void 0,spaceId:e.spaceId},a=Object.keys(n).reduce((function(A,e){return null==n[e]?A:A+="&".concat(e,"=").concat(encodeURIComponent(n[e]))}),"").replace("&",""),o=A.env.domain+"/api/service/cloudrecord/video/info/list?".concat(a);return(t=o,i={method:"get",headers:{accessToken:A.accessToken||A.token.deviceToken.global,deviceSerial:e.deviceSerial,localIndex:e.channelNo}},new Promise((function(A,e){fetch(t,i).then((function(A){return A.json()})).then((function(t){200==+t.code||t.meta&&200===t.meta.code?A(t):e(t)})).catch((function(A){e(A)}))}))).then((function(A){return A.data=(A.data||[]).map((function(A){return A.endTime=Vt(A.stopTime).getTime(),A.startTime=Vt(A.startTime).getTime(),A.busType=7,A})),A}))}function jt(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(e<=-24||e>=24)&&(e=0);var t=A.slice(0,4),i=A.slice(4,6),n=A.slice(6,8),a=A.slice(8,10),o=A.slice(10,12),r=A.slice(12,14),s=new Date(t,i-1,n,a,o,r);s.setHours(s.getHours()+e),s>new Date&&(s=new Date);var g=s.getFullYear(),c=("0"+(s.getMonth()+1)).slice(-2),l=("0"+s.getDate()).slice(-2),I=("0"+s.getHours()).slice(-2),C=("0"+s.getMinutes()).slice(-2),d=("0"+s.getSeconds()).slice(-2);return new Date("".concat(g,"/").concat(c,"/").concat(l," ").concat(I,":").concat(C,":").concat(d))}s(Kt,"instant",void 0);var Wt=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(e<=-24||e>=24)&&(e=0);var t=60*e*60*1e3,i=A.getTime()+t;return new Date(i)},Zt=function(){return o((function A(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{rejection:!1,play:!1,pantile:!1,recordvideo:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1};t(this,A),this.id=e,this.state=i}),[{key:"getState",value:function(){return this.state}},{key:"setState",value:function(A){this.state=c(c({},this.state),A)}}])}(),Xt=function(){return o((function A(){var e=this;t(this,A),s(this,"createInstance",(function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.instances.has(A)&&(console.warn("Instance with id ".concat(A," already exists.")),e.removeInstance(A));var i=new Zt(A,t);e.instances.set(A,i)})),s(this,"getInstance",(function(A){return e.instances.has(A)?e.instances.get(A):(console.warn("Instance with id ".concat(A," does not exist.")),null)})),s(this,"removeInstance",(function(A){if(!e.instances.has(A))return console.warn("Instance with id ".concat(A," does not exist.")),null;e.instances.delete(A)})),s(this,"listInstances",(function(){return Array.from(e.instances.values())})),this.instances=new Map,this.globalState={talk:!1,expend:!1,webExpend:!1,sound:!1}}),[{key:"getGlobalState",value:function(){return this.globalState}},{key:"setGlobalState",value:function(A){this.globalState=c(c({},this.globalState),A)}}])}(),qt=new Xt,zt=function(){return o((function A(e){if(t(this,A),this.jSPlugin=e,!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0,this.date=new Date,this.datepickerVisible=!1,this.seekTimer=null,this.disabled=!1,this.isSeeking=!1,this.seekFrequency=2e3,this.recList=[],this.lastDate=null,this.nowTime=null,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),this.datepickerLang={zh:"zh-CN",en:"en-US"},this.recInit()}),[{key:"recInit",value:function(){var A,e,t=this;if(!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0;var i=parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).width,10)-100,n=document.createElement("div");n.style="display:inline-block;height:48px;",n.id=this.jSPlugin.id+"-canvas-container",n.className="ezuikit-time-line-control";var a=document.createElement("canvas");a.id=this.jSPlugin.id+"-canvas",a.className="time-line-body",a.height="48",a.width=i,a.style="display:inline-block;",a.innerHTML="该浏览器不支持canvas",n.appendChild(a),x(n,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")));var o=document.createElement("div");o.className="timeline-controls",o.style="display:flex;width:100px;height:48px;text-align:center;line-height: 48px;vertical-align: top;background: #000000;";var r='\n
\n \n \n add\n \n \n \n \n \n \n \n \n \n \n \n \n \n reduce\n \n \n \n \n \n \n \n \n
\n\n\n');o.innerHTML=r,x(o,n),this.timeLine=new Tt(this.jSPlugin);var s=this;this.timeLine.init({id:this.jSPlugin.id+"-canvas",width:i,nowTime:this.nowTime,onChange:function(A){console.log("time",A,new Date(A).Format("yyyyMMddhhmmss"));var e=new Date(A).Format("yyyyMMddhhmmss");if(console.log("----------------this.jSPlugin.url",t.jSPlugin.url),t.jSPlugin.Theme&&t.jSPlugin.Theme.decoderState.state.recordvideo&&(t.jSPlugin.Theme.setDecoderState({recordvideo:!1}),"cloud.rec"===m(t.jSPlugin.url).type&&t.jSPlugin.stopSave()),"cloud.rec"===m(t.jSPlugin.url).type||t.jSPlugin.useSeek&&t.jSPlugin.capacity&&"1"==t.jSPlugin.capacity.support_seek_playback){if(!t.isSeeking)if(s.recList.length>0)if(new Date(A).valueOf()>=s.lastDate)t.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3});else t.jSPlugin.Theme.decoderState.state.play?t.unSyncTimeLine().then((function(){t.isSeeking=!0,t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),t.jSPlugin.pluginStatus.loadingSetText({text:t.jSPlugin.i18n.t("LOADING")}),t.jSPlugin.Theme.setDisabled(!0),t.jSPlugin._tempSeekTime=A,t.jSPlugin.seek(e.substr(8,6),"235959").then((function(){var e=setInterval((function(){t.jSPlugin._destroy?clearInterval(e):t.jSPlugin.getOSDTime().then((function(i){var n=new Date(A).valueOf()/1e3;if(console.log("seek时间同步:",new Date(1e3*i.data).Format("hh:mm:ss"),new Date(1e3*n).Format("hh:mm:ss"),i.data>=n),i.data>=n-2){t.isSeeking=!1,t.syncTimeLine(),clearInterval(e),t.jSPlugin.pluginStatus.loadingStop(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),t.jSPlugin.pluginStatus.loadingClear(),t.jSPlugin.Theme.setDisabled(!1),t.jSPlugin._tempSeekTime=null,s.jSPlugin.waterMark_JSPlugin&&s.jSPlugin.setWaterMarkFont(s.jSPlugin.waterMark_JSPlugin);var a=t.jSPlugin.Theme.decoderState.state.sound,o=qt.getInstance(t.jSPlugin.id);a&&o.getState().sound&&setTimeout((function(){t.jSPlugin.openSound()}),500)}}))}),1e3)}))})):t.unSyncTimeLine().then((function(){t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),t.jSPlugin.pluginStatus.loadingSetText({text:t.jSPlugin.i18n.t("LOADING")}),t.jSPlugin.Theme.setDisabled(!0);var A=t.jSPlugin.url;A.indexOf("begin")>-1?A=A.replace(/(begin=)(\d+)/,(function(A,t,i){return t+e})):A+="?begin=".concat(e),t.jSPlugin.play({url:A}).then((function(){t.syncTimeLine(),t.jSPlugin.pluginStatus.loadingStop(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),t.jSPlugin.pluginStatus.loadingClear(),t.jSPlugin.Theme.setDisabled(!1),s.jSPlugin.waterMark_JSPlugin&&s.jSPlugin.setWaterMarkFont(s.jSPlugin.waterMark_JSPlugin)})).catch((function(A){console.log("时间轴拖动失败:",A)}))}))}else{var i=function(){setTimeout((function(){t.disabled=!1}),t.seekFrequency)},n=function(A){t.disabled=!0,t.unSyncTimeLine().then((function(){t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),t.jSPlugin.pluginStatus.loadingSetText({text:t.jSPlugin.i18n.t("LOADING")}),t.jSPlugin.Theme.setDisabled(!0);var i=t.jSPlugin.url;i.indexOf("begin")>-1?i=i.replace(/(begin=)(\d+)/,(function(A,t,i){return t+e})):i+="?begin=".concat(e),t.jSPlugin.play({url:i,unSaveUrl:!0,showPoster:!0}).then((function(){A&&A(),t.syncTimeLine(),t.jSPlugin.pluginStatus.loadingStop(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),t.jSPlugin.pluginStatus.loadingClear(),t.jSPlugin.Theme.setDisabled(!1),s.jSPlugin.waterMark_JSPlugin&&s.jSPlugin.setWaterMarkFont(s.jSPlugin.waterMark_JSPlugin),t.jSPlugin.Theme.decoderState.state.sound&&t.jSPlugin.openSound()})).catch((function(A){console.log("时间轴拖动失败:",A)}))})),t.jSPlugin.Theme&&t.jSPlugin.Theme.decoderState&&t.jSPlugin.Theme.decoderState.state&&t.jSPlugin.Theme.decoderState.state.zoom&&(t.jSPlugin.Theme.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom())};t.disabled?(console.log("操作频繁,等待2秒后执行"),t.seekTimer&&clearTimeout(t.seekTimer),t.seekTimer=setTimeout((function(){n(i)}),t.seekFrequency)):n(i)}}}).then((function(){t.syncTimeLine()}));var g,c,l=null===(A=document.getElementById("".concat(this.jSPlugin.id,"-wrap")))||void 0===A||null===(e=A.classList)||void 0===e?void 0:e.contains("ezuikit-player-wrap-mobile-fullscreen");if(document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"))&&!this.jSPlugin._isCurrentBrowserFullscreen&&!l){var I=document.getElementById("".concat(this.jSPlugin.id,"-headControl"))?document.getElementById("".concat(this.jSPlugin.id,"-headControl")).clientHeight:0,C=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container")).clientHeight;this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-I-C,!0)}g=s.jSPlugin,c=document.getElementById("".concat(g.id,"-wrap")),E("".concat(g.staticPath,"/rec/datepicker.min.css")),u("".concat(g.staticPath,"/rec/jquery.min.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.").concat(s.datepickerLang[A.language],".js"),(function(A){var e=c.getElementsByClassName("datepicker-container")[0];!e&&$("#".concat(A.id,"-datepicker")).datepicker&&$("#".concat(A.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:s.datepickerLang[A.language],date:new Date(Q("begin",A.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:c}),(e=c.getElementsByClassName("datepicker-container")[0])&&(e.style.display="none"),s.datepickerVisible=!1,$("#".concat(A.id,"-datepicker")).on("pick.datepicker",(function(t){if(console.log("重新选择日期",t.date,new Date(t.date).Format("yyyyMMddhhmmss"),new Date(document.getElementById("".concat(A.id,"-datepicker")).value).Format("yyyyMMdd")),t.date>new Date||new Date(t.date).Format("yyyyMMddhhmmss")===new Date(document.getElementById("".concat(A.id,"-datepicker")).value).Format("yyyyMMdd"))t.preventDefault();else{var i=new Date(t.date).Format("yyyy-MM-dd");document.getElementById("".concat(A.id,"-datepicker")).value=i,A.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:i}}),s.renderRec(t.date),A.Theme.decoderState&&A.Theme.decoderState.state?A.Theme.decoderState.state.cloudRec?A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"},(function(){}),!1).then((function(A){s.jSPlugin.Theme.decoderState.state.sound&&s.jSPlugin.openSound()})):A.Theme.decoderState.state.rec?A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"rec"},(function(){}),!1).then((function(A){s.jSPlugin.Theme.decoderState.state.sound&&s.jSPlugin.openSound()})):A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss")},(function(){}),!1).then((function(A){s.jSPlugin.Theme.decoderState.state.sound&&s.jSPlugin.openSound()})):A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss")},(function(){}),!1).then((function(A){s.jSPlugin.Theme.decoderState.state.sound&&s.jSPlugin.openSound()}))}e&&(e.style.display="none"),s.datepickerVisible=!1,A.Theme&&A.Theme.decoderState&&A.Theme.decoderState.state&&A.Theme.decoderState.state.zoom&&(A.Theme.setDecoderState({zoom:!1}),A.Zoom.stopZoom())})),$("#".concat(A.id,"-datepicker")).off("click").on("click",(function(A){console.log("点击日期"),s.datepickerVisible?e&&(e.style.display="none"):e&&(e.style.display="inline"),s.datepickerVisible=!s.datepickerVisible}))}),(function(){}),A)}),(function(){}),A)}),(function(){}),g),document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-add")).onclick=function(){t.unSyncTimeLine().then((function(){t.currentTimeWidth<3&&t.timeLine.changeSize(++t.currentTimeWidth),t.syncTimeLine()}))},document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-sub")).onclick=function(){t.unSyncTimeLine().then((function(){t.currentTimeWidth>0&&t.timeLine.changeSize(--t.currentTimeWidth),t.syncTimeLine()}))};var d=Q("begin",this.jSPlugin.url)||(new Date).Format("yyyyMMdd");d=jt(d,Q("timeZone",this.jSPlugin.url)?parseInt(Q("timeZone",this.jSPlugin.url)):0),this.renderRec(d.Format("yyyy-MM-dd")),this.observer=new MutationObserver((function(A,e){}));var h=document.getElementById("".concat(this.jSPlugin.id));this.observer.observe(h,{attributes:!0,attributeOldValue:!0,attributeFilter:["style"]})}},{key:"setDatepickerDate",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(e){var t=e.getElementsByClassName("datepicker-container")[0];if(t){var i=t;i.parentNode.removeChild(i),document.getElementById("".concat(this.jSPlugin.id,"-datepicker")).value=A.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"),$("#".concat(this.jSPlugin.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:"zh-CN",defaultDate:A,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:document.getElementById("".concat(this.jSPlugin.id,"-wrap"))})}}}},{key:"datepickerHide",value:function(){var A=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));A&&(A.getElementsByClassName("datepicker-container")[0].style.display="none");this.datepickerVisible=!1}},{key:"datepickerShow",value:function(){var A=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));A&&(A.getElementsByClassName("datepicker-container")[0].style.display="inline");this.datepickerVisible=!0}},{key:"recAutoSize",value:function(A){var e=this,t=this,i=parseInt(getComputedStyle(document.getElementById(t.jSPlugin.id)).width,10)-100;document.getElementById("".concat(this.jSPlugin.id,"-canvas"))&&i!==parseInt(document.getElementById("".concat(t.jSPlugin.id,"-canvas")).width)&&t.unSyncTimeLine().then((function(){t.timeLine.setWidth({id:"".concat(e.jSPlugin.id),width:i}),t.syncTimeLine(),A&&A()}))}},{key:"syncTimeLine",value:function(){var A=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((function(A){clearInterval(A)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];var e=this;this.jSPlugin.recTimer=setInterval((function(){e.jSPlugin.getOSDTime().then((function(t){var i=t.data;if(-1===i)console.log("获取播放时间错误");else if(i>0){var n=new Date(i>1e12?i:1e3*i);A.nowTime=n,e.timeLine.run({time:n})}})).catch((function(A){var t=e.jSPlugin.Theme.decoderState.state.pauseDate;e.timeLine.run({time:e.timeLine.nowTime||t})}))}),1e3),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer)}},{key:"unSyncTimeLine",value:function(){var A=this;return new Promise((function(e,t){A.jSPlugin.recTimer&&(clearInterval(A.jSPlugin.recTimer),A.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[A.jSPlugin.id])&&(window.recTimer[A.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[A.jSPlugin.id]=[]):window.recTimer={},e()}))}},{key:"renderRec",value:function(A){var e=this;this.date=A;var t=this,i=new Date(new Date(A).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime();this.jSPlugin.timeZone&&-1===this.jSPlugin.url.indexOf(".cloud")&&(i=new Date(Wt(new Date(i),this.jSPlugin.timeZone).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime());var n=new Date(new Date(i).Format("yyyy-MM-dd 23:59:59").replace(/-/g,"/")).getTime();if(this.timeLine.getRecord([],i,n),this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===Q("busType",this.jSPlugin.url)){var a={deviceSerial:m(this.jSPlugin.url).deviceSerial,channelNo:m(this.jSPlugin.url).channelNo,startTime:i,endTime:n,spaceId:this.jSPlugin._spaceId};Ot(this.jSPlugin,a).then((function(A){if(A.data&&A.data.length>0){var a=A.data;t.recList=a,t.lastDate=a[a.length-1].endTime,e.timeLine.getRecord(a,i,n)}}))}else{var o={accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,recType:"cloud.rec"===m(this.jSPlugin.url).type?1:2,deviceSerial:m(this.jSPlugin.url).deviceSerial,channelNo:m(this.jSPlugin.url).channelNo,startTime:i,endTime:n,version:"2.0"},r=this.jSPlugin.env.domain+"/api/lapp/video/by/time";_(r,"POST",o,"",(function(A){if(A.data&&A.data.files&&A.data.files.length>0){var a=A.data.files,r=(new Date).getTime(),s=A.data.isAll;if(t.recList=a,t.lastDate=a[a.length-1].endTime,s)e.timeLine.getRecord(a,i,n);else{var g=function(){o.startTime=r,_(this.jSPlugin.env.domain+"/api/lapp/video/by/time","POST",o,"",(function(A){A.data&&A.data.files&&A.data.files.length>0&&0==A.data.isAll?(A.data.files&&(a=a.concat(A.data.files),t.recList=a,t.lastDate=a[a.length-1].endTime),r=A.data.nextFileTime>0?A.data.nextFileTime:(new Date).getTime(),g()):t.timeLine.getRecord(a,i,n)}))};g()}e.timeLine.run({time:new Date(i)})}else A.data&&A.data.length>0&&(t.recList=A.data,t.lastDate=A.data[A.data.length-1].endTime,t.timeLine.getRecord(A.data,i,n),t.timeLine.run({time:new Date(i)}))}))}}}])}(),$t=function(A){this.state={id:A.id,start:"00:00:00",end:"24:00:00",current:0,timelag:30,timeArr:[],availTimeLine:[],scrollTop:0,index:0,date:"",noTimeLineTxt:"",disabled:!1};var e=this;this.setState=function(A){Object.keys(A).forEach((function(t){e.state[t]=A[t],"scrollTop"===t&&document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.scrollTo(0,A[t]),"current"===t&&document.getElementById("time-line-current")&&(document.getElementById("time-line-current").innerHTML=A[t])}))},this.setDisabled=function(A){this.setState({disabled:A}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.style.overflowY=A?"hidden":"scroll")},this.timeToSecond=function(A){var e=A.split(":"),t=Number(e[0]),i=Number(e[1]),n=Number(e[2]);return 60*t*60+60*i+(n||0)},this.minuteToTime=function(A){var e=Math.floor(A/60),t=A%60;return(e>9?e:"0"+e)+":"+(t>9?t:"0"+t)},this.timeToMinute=function(A){var e=A.split(":");return 60*Number(e[0])+Number(e[1])},this.getPlayParam=A.getPlayParam,this.checkIsAppleDevice=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)},this.checkIsHarmonyOS=function(){return navigator.userAgent.indexOf("ohos")>-1},this.checkIsHarmonyOS()?(document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchstart",(function(){if(e.state.disabled)return!1;A.ontouchstart()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchmove",(function(){if(e.state.disabled)return!1;A.ontouchmove()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchend",(function(){if(e.state.disabled)return!1;var t;new Promise((function(A,e){var i=-1;t=setInterval((function(){var e,n,a=null===(e=document.getElementById("time-line-item"))||void 0===e||null===(n=e.parentNode)||void 0===n?void 0:n.scrollTop;a!==i?(console.log("scolling",a,i),i=a):(console.log("scoll stop",a,i),clearInterval(t),A(a))}),100)})).then((function(A){console.log("scollPromise: then",A,e),e.rectTopTotime(A),console.log("页面滚动实际高度",A,e.state),e.getPlayParam({current:e.state.current})})),A.ontouchend()}),!1)):(document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchstart=function(){if(e.state.disabled)return!1;A.ontouchstart()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchmove=function(){if(e.state.disabled)return!1;A.ontouchmove()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchend=function(){if(e.state.disabled)return!1;var t;new Promise((function(A,e){var i=-1;t=setInterval((function(){var e,n,a=null===(e=document.getElementById("time-line-item"))||void 0===e||null===(n=e.parentNode)||void 0===n?void 0:n.scrollTop;a!==i?(console.log("scolling",a,i),i=a):(console.log("scoll stop",a,i),clearInterval(t),A(a))}),100)})).then((function(A){console.log("scollPromise: then",A,e),e.rectTopTotime(A),console.log("页面滚动实际高度",A,e.state),e.getPlayParam({current:e.state.current})})),A.ontouchend()})),this.matchTimeDot()};$t.prototype.changeScale=function(A){this.setState({timelag:A}),this.matchTimeDot()},$t.prototype.setDateLine=function(A,e){A.length>0?(void 0===e&&(e=A.length-1),this.setState({availTimeLine:A,start:A[e].st,end:A[e].et,current:A[e].st}),this.matchRecTimeDot(),this.primaryOffsetH()):(this.setState({availTimeLine:[]}),this.matchRecTimeDot())},$t.prototype.matchTimeDot=function(){var A=this.state;A.start;var e=A.end,t=A.timelag;A.availTimeLine;for(var i=[],n=this.timeToMinute(e),a=n=Math.floor(n/t)*t;a>=0;){var o=0,r=0;a==n&&(o=70),0==a&&(r=230);var s=this.minuteToTime(a);i.push({id:a,current:s,label:"a"+a,marginTop:o,marginBottom:r,recArr:[]}),a-=t}this.setState({timeArr:i}),this.renderDateLine()},$t.prototype.matchRecTimeDot=function(){var A=this.state,e=A.start,t=A.end,i=A.timelag,n=A.availTimeLine,a=A.timeArr;console.log("start",e,"end",t);var o=n.length;if(0===o)for(var r=0;rc&&a[r].id')})),n+="
').concat(A.current,"
"),i.innerHTML=n,t.appendChild(i)}))},$t.prototype.primaryOffsetH=function(){var A=this.state,e=A.start,t=A.timelag,i=A.timeArr[0].current,n=this.timeToSecond(i)-this.timeToSecond(e),a=Math.ceil(n/t)+60;this.setState({scrollTop:a}),console.log("起始偏移量",a)},$t.prototype.currentOffsetH=function(){var A=this.state,e=A.current,t=A.timelag,i=A.timeArr[0].current,n=this.timeToSecond(i)-this.timeToSecond(e),a=Math.ceil(n/t)+60;this.setState({scrollTop:a})},$t.prototype.rectTopTotime=function(A){var e,t,i=this.state.timelag,n=Math.floor(A/60),a=A-60*n;if(console.log("index:",n,"offsetH:",a),0==a)e=this.state.timeArr[n-1].current,t=0;else{var o=this.state.timeArr[n].current,r=this.timeToMinute(o),s=(60-a)*i,g=Math.floor(s/60)+r,c=60*Math.floor(s/60);t=Math.ceil(s-c),e=this.minuteToTime(g)}this.setState({current:e+":"+(t>9?t:"0"+t),scrollTop:A})},$t.prototype.stepScrollTimeLine=function(A){this.setState({current:A}),this.currentOffsetH()},$t.prototype.secondCountDown=function(A){var e=this.state.current.split(":"),t=60*Number(e[0])*60+60*Number(e[1])+Number(e[2])+1,i=Math.floor(t/3600),n=Math.floor((t-3600*i)/60),a=t-3600*i-60*n;this.setState({current:(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)+":"+(a>9?a:"0"+a)})};var Ai=$t;function ei(A){var e=new Date(A),t=e.getHours(),i=e.getMinutes(),n=e.getSeconds();return(t>9?t:"0"+t)+":"+(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)}Date.prototype.Format=function(A){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var t in/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+t+")").test(A)&&(A=A.replace(RegExp.$1,1==RegExp.$1.length?e[t]:("00"+e[t]).substr((""+e[t]).length)));return A};var ti=function(){function A(e,i,n){var a=this;if(t(this,A),this.changeRecSpeed=i,this.resetMobileZoomStatus=n,this.isMobile=!0,this.jSPlugin=e,this.date=(new Date).Format("yyyy-MM-dd"),this.begin=((new Date).Format("yyyy-MM-dd")+" 00:00:00").replace(/-/g,"/"),this.end=((new Date).Format("yyyy-MM-dd")+" 23:59:59").replace(/-/g,"/"),this.initBegin=null,this.initEnd=null,this.type=m(this.jSPlugin.url).type,this.operating=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.recList=[],this.isSeeking=!1,this.datepickerLang={zh:"zh-CN",en:"en-US"},this.datepickerVisible=!1,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),A._instanceStyle(),Q("begin",this.jSPlugin.url)){var o=Q("begin",this.jSPlugin.url);this.date=o.slice(0,4)+"/"+o.slice(4,6)+"/"+o.slice(6,8),this.begin=this.date+" ".concat(o.slice(8,10)||"00",":").concat(o.slice(10,12)||"00",":").concat(o.slice(12,14)||"00"),this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(Q("end",this.jSPlugin.url)){var r=Q("end",this.jSPlugin.url);this.end=this.date+" ".concat(r.slice(8,10)||"23",":").concat(r.slice(10,12)||"59",":").concat(r.slice(12,14)||"59"),this.initEnd=this.end}var s=document.createElement("div");s.id="date-switch-container-wrap",s.className="date-switch-container-wrap",s.style="",s.innerHTML='\n
\n
'.concat(this.jSPlugin.i18n.t("RECORD_TIPS"),'
\n
\n \n
\n
\n
\n '),x(s,document.getElementById("".concat(this.jSPlugin.id,"-wrap")));var g=document.createElement("div");g.id="rec-type-container-wrap",g.className="rec-type-container-wrap",g.style="",g.innerHTML='\n
\n
0'.concat(this.jSPlugin.i18n.t("RECORDS"),'
\n
\n \n
\n
\n '),x(g,s);var c=document.createElement("div");c.id="mobile-rec-wrap",c.className="mobileRec-wrap",c.style="",c.innerHTML='\n
\n
\n
00:00:00
\n
\n
\n
\n
\n
\n
\n ',x(c,g);this.TimeLineOBJ=new Ai({id:"time-line-item",getPlayParam:function(A){var e=a;console.log("子组件传值到父组件",A,A.current,a.date);var t=A.current,i=new Date(a.date).Format("yyyyMMdd").substr(0,8)+(A.current?t.replace(/:/g,""):A.current.replace(/:/g,""));if("cloud.rec"===a.type||a.jSPlugin.useSeek&&a.jSPlugin.capacity&&"1"==a.jSPlugin.capacity.support_seek_playback)a.isSeeking||e.recList.length>0&&(new Date("".concat(a.date," ").concat(A.current)).valueOf()>=e.lastDate?(a.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}),a.syncTimeLine()):a.unSyncTimeLine().then((function(){a.isSeeking=!0,a.jSPlugin.pluginStatus.loadingStart(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),a.jSPlugin.pluginStatus.loadingSetText({text:a.jSPlugin.i18n.t("LOADING")}),a.jSPlugin.Theme.setDisabled(!0),a.jSPlugin.seek(i.substr(8,6),"235959").then((function(){var A=setInterval((function(){a.jSPlugin.getOSDTime().then((function(t){console.log("seek时间同步:",new Date(1e3*t.data).Format("yyyyMMddhhmmss"),i,new Date(1e3*t.data).Format("yyyyMMddhhmmss")>=i),new Date(1e3*t.data).Format("yyyyMMddhhmmss")>=i&&(a.isSeeking=!1,a.syncTimeLine(),clearInterval(A),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),a.jSPlugin.waterMark_JSPlugin&&e.jSPlugin.setWaterMarkFont(e.jSPlugin.waterMark_JSPlugin),e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound())}))}),1e3)}))})));else{var n=function(){setTimeout((function(){a.disabled=!1}),a.seekFrequency)},o=a.jSPlugin.Theme.decoderState.state.play,r=function(A){a.disabled=!0,a.jSPlugin.pluginStatus.loadingStart(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),a.jSPlugin.pluginStatus.loadingSetText({text:a.jSPlugin.i18n.t("LOADING")}),a.jSPlugin.Theme.setDisabled(!0),o?a.unSyncTimeLine().then((function(){a.jSPlugin.pause(i).then((function(){console.log("暂停成功"),a.jSPlugin.resume(i).then((function(t){console.log("恢复成功"),a.syncTimeLine(),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),a.jSPlugin.waterMark_JSPlugin&&e.jSPlugin.setWaterMarkFont(e.jSPlugin.waterMark_JSPlugin),e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound(),A&&A()}))})).catch((function(){console.log("暂停失败"),a.jSPlugin.resume(i).then((function(e){console.log("恢复成功"),a.syncTimeLine(),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),A&&A()}))}))})):a.unSyncTimeLine().then((function(){a.jSPlugin.resume(i).then((function(e){console.log("恢复成功"),a.syncTimeLine(),A&&A()}))}))};a.disabled?(console.log("操作频繁,等待2秒后执行"),a.seekTimer&&clearTimeout(a.seekTimer),a.seekTimer=setTimeout((function(){r(n)}),a.seekFrequency)):r(n)}},ontouchstart:function(){a.operating=!0,a.unSyncTimeLine()},ontouchmove:function(){0==a.operating&&(a.operating=!0,a.unSyncTimeLine())},ontouchend:function(){a.operating=!1}}),this.fetchDeviceRec(),document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(function(A){var e=A.target.checked?2:1;a.type=A.target.checked?"rec":"cloud.rec",console.log("recType",e),a.jSPlugin.changePlayUrl({type:a.type,begin:"".concat(new Date(a.date).Format("yyyyMMdd"),"000000")}).then((function(){console.log("切换类型成功"),a.syncTimeLine(),a.changeRecSpeed(1),a.resetMobileZoomStatus(),a.jSPlugin.Theme.decoderState.state.sound&&a.jSPlugin.openSound()}),(function(A){console.log("err",A)})).catch((function(A){console.log(A)}))})),this.syncTimeLine();var l=this;!function(A){var e=document.getElementById("".concat(A.id,"-wrap"));E("".concat(A.staticPath,"/rec/datepicker.min.css")),u("".concat(A.staticPath,"/rec/jquery.min.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.").concat(l.datepickerLang[A.language],".js"),(function(A){var t=e.getElementsByClassName("datepicker-container")[0];!t&&$("#".concat(A.id,"-datepicker")).datepicker&&$("#".concat(A.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:l.datepickerLang[A.language],date:new Date(Q("begin",A.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:e}),(t=e.getElementsByClassName("datepicker-container")[0])&&(t.style.display="none",t.style.bottom="-314px",t.style.right="0px"),l.datepickerVisible=!1,$("#".concat(A.id,"-datepicker")).on("pick.datepicker",(function(e){var i={begin:new Date(e.date).Format("yyyyMMddhhmmss")};if(l.begin=e.date,e.date>new Date||new Date(e.date).Format("yyyyMMdd")===new Date(document.getElementById("".concat(A.id,"-datepicker")).getAttribute("data-value")).Format("yyyyMMdd"))e.preventDefault();else{var n=new Date(e.date).Format("yyyy/MM/dd");document.getElementById("".concat(A.id,"-datepicker"))&&document.getElementById("".concat(A.id,"-datepicker")).setAttribute("data-value",n),l.date=n,A.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:n}}),A.Theme.decoderState&&A.Theme.decoderState.state&&(A.Theme.decoderState.state.cloudRec?i={begin:new Date(e.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"}:A.Theme.decoderState.state.rec&&(i={begin:new Date(e.date).Format("yyyyMMddhhmmss"),type:"rec"}))}A.changePlayUrl(i,(function(){}),!1).then((function(){setTimeout((function(){var A=document.getElementById("date");A&&(A.value=new Date(e.date).Format("yyyy-MM-dd"))}),0),l.fetchDeviceRec(),l.jSPlugin.Theme.decoderState.state.sound&&l.jSPlugin.openSound(),l.syncTimeLine()})),l.changeRecSpeed(1),l.resetMobileZoomStatus(),t&&(t.style.display="none"),l.datepickerVisible=!1})),$("#".concat(A.id,"-datepicker")).off("click").on("click",(function(A){l.datepickerVisible?t&&(t.style.display="none"):t&&(t.style.display="inline"),l.datepickerVisible=!l.datepickerVisible})),document.getElementById("date-picker")&&document.getElementById("date-picker").addEventListener("focus",(function(A){A.target.blur()}))}),(function(){}),A)}),(function(){}),A)}),(function(){}),A)}(this.jSPlugin)}return o(A,[{key:"fetchDeviceRec",value:function(){var A=this,e=function(e){var t=e.length;document.getElementById("recCount").innerHTML=t;for(var i=[],n=t-1;n>=0;n--){var a=e[n],o=ei(a.endTime),r=ei(a.startTime);i.push({st:r,et:o})}A.TimeLineOBJ.setDateLine(i)},t=new FormData,i=this;t.append("deviceSerial",m(this.jSPlugin.url).deviceSerial),t.append("channelNo",m(this.jSPlugin.url).channelNo),t.append("accessToken",this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video),t.append("recType","cloud.rec"===this.type?1:2);var n=Q("timeZone",this.jSPlugin.url);if(n<=23&&n>=-23&&"cloud.rec"!==this.type){var a=jt(new Date(this.begin).Format("yyyyMMddhhmmss"),+n);t.append("startTime",new Date(a.Format("yyyy/MM/dd")+" 00:00:00").getTime()),t.append("endTime",new Date(a.Format("yyyy/MM/dd")+" 23:59:59").getTime()),this.date=a.Format("yyyy/MM/dd")}else t.append("startTime",new Date(this.begin).getTime()),t.append("endTime",new Date(this.end).getTime());fetch(this.jSPlugin.env.domain+"/api/lapp/video/by/time",{method:"POST",body:t}).then((function(A){return A.json()})).then((function(A){if(200==A.code&&A.data){var t;t=A.data,i.recList=t,i.lastDate=t[t.length-1].endTime,e(t)}else e([])}))}},{key:"syncTimeLine",value:function(){var A=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((function(A){clearInterval(A)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];var e=this;this.TimeLineOBJ&&(this.jSPlugin.recTimer=setInterval((function(){if(A.operating)return console.log("操作中"),!1;A.jSPlugin.getOSDTime().then((function(A){A.data>0&&e.TimeLineOBJ.stepScrollTimeLine(function(A){var e=new Date(A),t=e.getHours(),i=e.getMinutes(),n=e.getSeconds();return(t>9?t:"0"+t)+":"+(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)}(1e3*A.data))})).catch((function(A){console.log("err:-----",A),console.log("未找到当前获取播放时间,等待中...")}))}),1e3),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer))}},{key:"unSyncTimeLine",value:function(){var A=this;return new Promise((function(e,t){A.jSPlugin.recTimer&&(clearInterval(A.jSPlugin.recTimer),A.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[A.jSPlugin.id])&&(window.recTimer[A.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[A.jSPlugin.id]=[]):window.recTimer={},e()}))}}],[{key:"_instanceStyle",value:function(){A._STYLE||(A._STYLE=document.createElement("style"),A._STYLE.innerHTML='\n body{\n padding: 0;\n margin: 0;\n }\n .time-line-container {\n text-align: left;\n height: 300px;\n /* outline: 1px solid red; */\n /* background: gray; */\n position: relative;\n /* padding-top: 60px; */\n margin-top: 20px;\n }\n\n .time-line-container .time-line-item-container {\n display: inline-block;\n /* height: 400px; */\n width: 30%;\n /* background: indianred; */\n overflow-y: scroll;\n overflow-x: hidden;\n /* padding-top: 60px; */\n height: 300px;\n box-sizing: border-box;\n white-space: nowrap;\n position: relative;\n }\n\n .time-line-container .time-line-item-container::-webkit-scrollbar {\n width: 0px;\n /*滚动条宽度*/\n height: 0px;\n /*滚动条高度*/\n }\n\n .time-line-item .time-item {\n position: relative;\n box-sizing: border-box;\n height: 60px;\n font-size: 12px;\n color: rgb(150, 150, 150);\n border-right: 6px solid;\n border-right-color: #ddd;\n }\n\n .time-line-item .time-item .scale {\n width: 6px;\n height: 9px;\n border-bottom: 1px solid #ccc;\n float: right;\n clear: both;\n }\n\n .time-line-item .time-item .item-unavail {\n width: 6px;\n position: absolute;\n left: 100%;\n background-color: #ddd;\n }\n\n .time-line-container .current-time {\n position: absolute;\n left: 0;\n top: 40px;\n height: 29px;\n /* line-height: 58px; */\n border-bottom: 1px solid #648FFC;\n width: 60%;\n margin-left: 26%;\n }\n\n .time-line-container .current-time .current-time-bg {\n position: relative;\n top: 15px;\n width: 100px;\n height: 29px;\n line-height: 29px;\n left: -70px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .time-line-container .current-time .current-time-bg::before {\n content: \'\';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n background: #648FFC;\n top: 11px;\n position: absolute;\n right: 30px;\n }\n\n .date-switch-container {\n height: 40px;\n position: relative;\n text-align: center;\n margin: 20px 10px;\n }\n\n .date-switch-container .current-date {\n line-height: 40px;\n height: 22px;\n font-size: 16px;\n color: #2C2C2C;\n text-align: center;\n font-weight: bold;\n }\n\n .date-container {\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .rec-type-container {\n display: flex;\n justify-content: space-between;\n }\n\n .rec-type-container .rec-type-text {\n padding: 0 15px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .rec-type-container .rec-type-switch {\n padding: 0 20px;\n }\n\n .date-container input {\n position: absolute;\n opacity: 0;\n display: inline-block;\n width: 40px;\n height: 40px;\n z-index: 10;\n left: 0;\n }\n\n .date-container label {\n position: absolute;\n left: 0;\n top: 0;\n /* display: none; */\n z-index: 0;\n }\n\n .date-icon {\n display: inline-block;\n width: 40px;\n height: 40px;\n background: url(\'https://resource.eziot.com/group2/M00/00/6A/CtwQF2F6VieAQrU9AAABP-_Nsqo949.png\') no-repeat 100% 100%;\n }\n .select-container {\n padding: 10px;\n display: flex;\n justify-content: space-between;\n }\n\n .advice {\n height: 24px;\n width: 70px;\n display: flex;\n justify-content: space-between;\n line-height: 24px;\n background: #F8F8F8;\n border-radius: 8px;\n }\n\n .advice span {\n width: 40px;\n display: inline-block;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n\n }\n\n input[type="checkbox"]:checked+.advice span:last-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child svg {\n fill: #648FFC !important;\n }\n\n input[type="checkbox"]:checked+.advice span:last-child svg {\n fill: #648FFC !important;\n }',document.getElementsByTagName("head")[0].appendChild(A._STYLE))}}])}();s(ti,"_STYLE",void 0);var ii=function(){function A(e){var i=this;if(t(this,A),this.jSPlugin=e,this.pluginStatus=new H(this,this.jSPlugin.id),this.showPtz=!1,document.getElementById(this.jSPlugin.id+"-ez-ptz-item"))return!1;var n=document.createElement("div");n.id=this.jSPlugin.id+"-ez-ptz-item",n.className="ez-ptz-wrap",n.style="display:none;",A._instanceStyle(),n.innerHTML='\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_SLOW"),'\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_MID"),'\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_FAST"),'\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n '),document.getElementById("".concat(e.id,"-wrap")).appendChild(n),document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),console.log("点击开始"),i._handlePtzTouch(A,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸结束"),i._handlePtzTouch(A,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸开始"),i._handlePtzTouch(A,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸结束",A),i._handlePtzTouch(A,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).onmouseup=function(A){A.target.id&&(A.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.add("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),A.target.id.indexOf("mid")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.add("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),A.target.id.indexOf("fast")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).ontouchend=function(A){A.target.id&&(A.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.add("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),A.target.id.indexOf("mid")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.add("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),A.target.id.indexOf("fast")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","stop")}}return o(A,[{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item")).style="display: flex;box-sizing: content-box;"),this.showPtz=!0,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("openPtz",{eventType:"openPtz",code:0,target:this,msg:"开启云台"})}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item")).style="display: none"),this.showPtz=!1,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("closePtz",{eventType:"closePtz",code:0,target:this,msg:"关闭云台"})}},{key:"_handlePtzTouch",value:function(A,e){var t=this,i=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).getBoundingClientRect(),n=i.left+41,a=i.top+41,o=A.x||A.changedTouches[0].clientX,r=A.y||A.changedTouches[0].clientY,s=0,g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,l=0;function I(A,e){var t=Math.atan2(e,A);t<0&&(t+=2*Math.PI);var i=t*(180/Math.PI)-225-12.5;return i<0&&(i+=360),Math.floor(i/45)+1}if(/^rotate\(90/.test(document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.transform))switch(I(o-n,r-a)){case 1:s=2,l=90;break;case 2:s=4,l=135;break;case 3:s=0,l=180;break;case 4:s=6,l=225;break;case 5:s=3,l=270;break;case 6:s=7,l=315;break;case 7:s=1,l=0;break;case 8:s=5,l=45}else switch(I(o-n,r-a)){case 1:s=0,l=180;break;case 2:s=6,l=225;break;case 3:s=3,l=270;break;case 4:s=7,l=315;break;case 5:s=1,l=0;break;case 6:s=5,l=45;break;case 7:s=2,l=90;break;case 8:s=4,l=135}document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(l,"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)"),"stop"===e&&(g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="");var C=new FormData;C.append("deviceSerial",m(this.jSPlugin.url).deviceSerial),C.append("channelNo",m(this.jSPlugin.url).channelNo),C.append("speed",this.jSPlugin.ptzSpeed),C.append("direction",s),C.append("accessToken",c),fetch(g,{method:"POST",body:C}).then((function(A){return A.json()})).then((function(A){if("start"===e&&200!=A.code){console.log(A.code,t.jSPlugin.i18n.t("38"+A.code));var i=t.jSPlugin.i18n.t("38"+A.code)||A.msg;t.pluginStatus.loadingSetText({text:i,color:"red",delayClear:2e3})}60005!=A.code&&60002!=A.code&&60003!=A.code&&60004!=A.code&&60006!=A.code||(document.getElementById("".concat(t.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(l,"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"))})).catch((function(A){console.log("云台调用异常",A)}))}},{key:"_handleBtnTouch",value:function(A,e,t){var i=this,n=8;n="zoom"===A?"add"===e?8:9:"add"===e?10:11;var a=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",o=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;"stop"===t&&(a=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",o=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video);var r=new FormData;r.append("deviceSerial",m(this.jSPlugin.url).deviceSerial),r.append("channelNo",m(this.jSPlugin.url).channelNo),r.append("speed",this.jSPlugin.ptzSpeed),r.append("direction",n),r.append("accessToken",o),fetch(a,{method:"POST",body:r}).then((function(A){return A.json()})).then((function(e){"start"===t&&200!=e.code&&(6e4==e.code||60006==e.code?i.pluginStatus.loadingSetText({text:"zoom"===A?i.jSPlugin.i18n.t("NOT_SUPPORT_DEVICE_ZOOM"):i.jSPlugin.i18n.t("NOT_SUPPORT_FOCUS"),color:"red",delayClear:2e3}):i.pluginStatus.loadingSetText({text:e.msg,color:"red",delayClear:2e3}))})).catch((function(A){}))}}],[{key:"_instanceStyle",value:function(){if(!A._STYLE){A._STYLE=document.createElement("style");var e=S();A._STYLE.innerHTML="\n .ez-ptz-container {\n position: relative;\n width: 80px;\n height: 80px;\n background: rgba(255, 255, 255, 0.70);\n box-shadow: 0px 0px 33px 4px rgb(0 0 0 / 15%);\n border: 1px solid rgba(255, 255, 255, 0.70);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n user-select: none;\n }\n .ez-ptz-container .ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n top: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.top.active {\n border-bottom-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n bottom: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom.active {\n border-top-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-left: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n right: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.right.active {\n border-left-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-right: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n left: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-main.center {\n width: 23px;\n height: 23px;\n background: #407AFF;\n border-radius: 100%;\n top: calc(50% - 12.4px);\n left: calc(50% - 12.4px);\n position: absolute;\n }\n\n .ez-ptz-wrap {\n position: absolute;\n right: 0px;\n top: 0;\n width: 85px;\n height: 100%;\n padding: 0 20px;\n flex-direction: column;\n justify-content: center;\n background: rgba(0,0,0,0.9);\n box-sizing: content-box !important;\n }\n\n .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }\n\n .ez-ptzspeed-progress-line{\n height: 1px;\n background: #ffffff;\n margin: 16px 0 8px;\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-line-dot{\n width: 5px;\n height: 5px;\n border: 2px solid #ffffff;\n border-radius: 50%;\n background: #ffffff;\n margin: -3px 0;\n cursor: pointer;\n }\n\n .ez-ptzspeed-progress-line-dot.active{\n border-color: #407AFF;\n }\n \n .ez-ptzspeed-progress-points{\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-points-slow{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-mid{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-fast{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzbtn-container{\n width: 100%;\n height:".concat(e?"60px":"18px",";\n margin-top: 14px;\n display: ").concat(e?"block":"flex",";\n }\n\n .ez-ptzbtn-focal,\n .ez-ptzbtn-zoom{\n width: ").concat(e?"100%":"50%",";\n height: 20px;\n display: flex;\n border: 1px solid rgba(255,255,255,0.5);\n border-radius: 10px;\n padding-bottom: 0px;\n box-sizing: content-box;\n }\n\n .ez-ptzbtn-zoom-add,\n .ez-ptzbtn-zoom-sub,\n .ez-ptzbtn-focal-add,\n .ez-ptzbtn-focal-sub{\n width: ").concat(e?"50%":"24px",";\n height: 20px;\n cursor: pointer;\n text-align: center;\n }\n\n .ez-ptzbtn-zoom{\n margin: ").concat(e?"0 0 8px":"0 4px 0 0",";\n }\n\n .ez-ptzbtn-zoom-add{\n border-right: 1px solid rgba(255,255,255,0.5);\n }\n\n .ez-ptzbtn-focal-add{\n border-right: 1px solid rgba(255,255,255,0.5);\n }\n "),document.getElementsByTagName("head")[0].appendChild(A._STYLE)}}}])}();function ni(A){throw new Error('Could not dynamically require "'+A+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}s(ii,"_STYLE",void 0);!function(A){A.exports=function(){function A(e,t,i){function n(o,r){if(!t[o]){if(!e[o]){if(!r&&ni)return ni(o);if(a)return a(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var g=t[o]={exports:{}};e[o][0].call(g.exports,(function(A){return n(e[o][1][A]||A)}),g,g.exports,A,e,t,i)}return t[o].exports}for(var a=ni,o=0;oA.length)&&(e=A.length);for(var t=0,i=Array(e);t=A.length?{done:!0}:{done:!1,value:A[i++]}},e:function(A){throw A},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,r=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return o=A.done,A},e:function(A){r=!0,a=A},f:function(){try{o||null==t.return||t.return()}finally{if(r)throw a}}}}function s(A,e,t){return(e=C(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function g(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable}))),t.push.apply(t,i)}return t}function c(A){for(var e=1;e=0;--a){var o=this.tryEntries[a],r=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),g=i.call(o,"finallyLoc");if(s&&g){if(this.prev=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),b(t),u}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var i=t.completion;if("throw"===i.type){var n=i.arg;b(t)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:R(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=A),u}},e}function I(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(A){var e=function(A,e){if("object"!=typeof A||!A)return A;var t=A[Symbol.toPrimitive];if(void 0!==t){var i=t.call(A,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(A)}(A,"string");return"symbol"==typeof e?e:e+""}function d(A){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},d(A)}function h(e,t){if(e){if("string"==typeof e)return A(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?A(e,t):void 0}}var B=function(){return o((function A(e,i){t(this,A),this.coreX=e,this.coreY=i}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}}])}();Date.prototype.Format=function(A){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var t in/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+t+")").test(A)&&(A=A.replace(RegExp.$1,1==RegExp.$1.length?e[t]:("00"+e[t]).substr((""+e[t]).length)));return A};var u=function(A,e,t,i){var n=document.getElementsByTagName("head")[0].getElementsByTagName("script"),a=!1;if(t)a=t();else for(var o=0;o3){var t=e[1],i=e[2],n="1"===e[3],a="live";return A.indexOf("rec=local")>-1?a="rec":A.indexOf("rec=cloud")>-1&&(a="cloud.rec"),{deviceSerial:t,channelNo:i,hd:n,type:a}}return{}};var D=function(A,e,t,i,n,a){var o=A,r=new XMLHttpRequest;r.onreadystatechange=function(){if(4==r.readyState&&200==r.status)if(function(A){if("string"==typeof A)try{var e=JSON.parse(A);return!("object"!==d(e)||!e)}catch(A){return!1}console.log("It is not a string!")}(r.responseText)){var A=JSON.parse(r.responseText);n(A)}else n(r.responseText)},r.open(e,o,!0);var s=new FormData;for(var g in t)s.append(g,t[g]);if(i&&"object"===d(i))for(var g in i)r.setRequestHeader(g,i[g]);r.send(s)},w=function(){return!!window&&navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i)},b=function(){return o((function A(e,i){var n=this;t(this,A),u("https://open.ys7.com/assets/ezuikit_v3.4/js/hls.js",(function(){console.log("加载hls.min.js成功",window.Hls),console.log("isSupportHls",window.Hls.isSupported()),window.Hls.isSupported()&&n.initHLS(e,i)}),(function(){return!!window.Hls}))}),[{key:"toString",value:function(){return"hls ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initHLS",value:function(A,e){var t=S(e),i=t.deviceSerial,n=t.channelNo;t.hd,window.ezuikitMonitor.report({protocol:"hls",url:e,serial:i,no:n,action:1});var a=document.getElementById(A),o=new window.Hls({defaultAudioCodec:"mp4a.40.2"});o.loadSource(e),o.attachMedia(a),o.on(window.Hls.Events.MANIFEST_PARSED,(function(){a.play()})),o.on(window.Hls.Events.ERROR,(function(A,e){if(e.fatal)switch(e.type){case window.Hls.ErrorTypes.NETWORK_ERROR:console.log("fatal network error encountered, try to recover"),o.startLoad();break;case window.Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),o.recoverMediaError();break;default:o.destroy()}})),this.hls=o,this.video=a,this.hlsUrl=e}},{key:"play",value:function(){console.log("执行hls播放",this.video),this.hls.startLoad(),this.video.play()}},{key:"stop",value:function(){this.video.pause(),this.hls.stopLoad()}}])}(),F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function R(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var k={exports:{}};!function(A){!function(e,t){A.exports=t()}(globalThis,(()=>(()=>{var A={343:A=>{var e=Object.prototype.hasOwnProperty,t="~";function i(){}function n(A,e,t){this.fn=A,this.context=e,this.once=t||!1}function a(A,e,i,a,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var r=new n(i,a||A,o),s=t?t+e:e;return A._events[s]?A._events[s].fn?A._events[s]=[A._events[s],r]:A._events[s].push(r):(A._events[s]=r,A._eventsCount++),A}function o(A,e){0==--A._eventsCount?A._events=new i:delete A._events[e]}function r(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(t=!1)),r.prototype.eventNames=function(){var A,i,n=[];if(0===this._eventsCount)return n;for(i in A=this._events)e.call(A,i)&&n.push(t?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(A)):n},r.prototype.listeners=function(A){var e=t?t+A:A,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,a=i.length,o=new Array(a);n{t.d(e,{A:()=>i});const i=function(){function A(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return A.prototype.isComplete=function(){return!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&this.audioChannelCount,!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&this.sarDen,null!=this.mimeType},A.prototype.isSeekable=function(){return this.hasKeyframesIndex},A.prototype.getNearestKeyframe=function(A){if(null==this.keyframesIndex)return null;var e=this.keyframesIndex,t=this._search(e.times,A);return{index:t,milliseconds:e.times[t],fileposition:e.filepositions[t]}},A.prototype._search=function(A,e){var t=0,i=A.length-1,n=0,a=0,o=i;for(e=A[n]&&e{t.d(e,{$_:()=>i,EX:()=>a,EZ:()=>n,Sc:()=>o});var i=function(A,e,t,i,n){this.dts=A,this.pts=e,this.duration=t,this.originalDts=i,this.isSyncPoint=n,this.fileposition=null},n=function(){function A(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return A.prototype.appendSyncPoint=function(A){A.isSyncPoint=!0,this.syncPoints.push(A)},A}(),a=function(){function A(){this._list=[]}return A.prototype.clear=function(){this._list=[]},A.prototype.appendArray=function(A){var e=this._list;0!==A.length&&(e.length>0&&A[0].originalDts=e[n].dts&&A((null===(e=t[n].lastSample)||void 0===e?void 0:e.originalDts)||0)&&A=((null===(t=null===(e=i[a])||void 0===e?void 0:e.lastSample)||void 0===t?void 0:t.originalDts)||0)&&(a===i.length-1||a0&&(o=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=o,this._list.splice(o,0,n)},A.prototype.getLastSegmentBefore=function(A){var e=this._searchNearestSegmentBefore(A);return e>=0?this._list[e]:null},A.prototype.getLastSampleBefore=function(A){var e=this.getLastSegmentBefore(A);return null!=e?e.lastSample:null},A.prototype.getLastSyncPointBefore=function(A){for(var e=this._searchNearestSegmentBefore(A),t=this._list[e].syncPoints;0===t.length&&e>0;)e--,t=this._list[e].syncPoints;return t.length>0?t[t.length-1]:null},A}()},976:(A,e,t)=>{t.d(e,{A:()=>NA});var i=t(413),n=t(502),a=t(620),o=t(825);function r(A,e,t){var i=A;if(e+t=128){e.push(String.fromCharCode(65535&a)),i+=2;continue}}else if(t[i]<240){if(r(t,i,2)&&(a=(15&t[i])<<12|(63&t[i+1])<<6|63&t[i+2])>=2048&&55296!=(63488&a)){e.push(String.fromCharCode(65535&a)),i+=3;continue}}else if(t[i]<248){var a;if(r(t,i,3)&&(a=(7&t[i])<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3])>65536&&a<1114112){a-=65536,e.push(String.fromCharCode(a>>>10|55296)),e.push(String.fromCharCode(1023&a|56320)),i+=4;continue}}e.push(String.fromCharCode(65533)),++i}return e.join("")};var g,c=t(713),l=(g=new ArrayBuffer(2),new DataView(g).setInt16(0,256,!0),256===new Int16Array(g)[0]);const I=function(){function A(){}return A.parseScriptData=function(e,t,i){var a={};try{var o=A.parseValue(e,t,i),r=A.parseValue(e,t+o.size,i-o.size);a[o.data]=r.data}catch(A){n.A.e("AMF",A.toString())}return a},A.parseObject=function(e,t,i){if(i<3)throw new c.j4("Data not enough when parse ScriptDataObject");var n=A.parseString(e,t,i),a=A.parseValue(e,t+n.size,i-n.size),o=a.objectEnd;return{data:{name:n.data,value:a.data},size:n.size+a.size,objectEnd:o}},A.parseVariable=function(e,t,i){return A.parseObject(e,t,i)},A.parseString=function(A,e,t){if(t<2)throw new c.j4("Data not enough when parse String");var i=new DataView(A,e,t).getUint16(0,!l);return{data:i>0?s(new Uint8Array(A,e+2,i)):"",size:2+i}},A.parseLongString=function(A,e,t){if(t<4)throw new c.j4("Data not enough when parse LongString");var i=new DataView(A,e,t).getUint32(0,!l);return{data:i>0?s(new Uint8Array(A,e+4,i)):"",size:4+i}},A.parseDate=function(A,e,t){if(t<10)throw new c.j4("Data size invalid when parse Date");var i=new DataView(A,e,t),n=i.getFloat64(0,!l),a=i.getInt16(8,!l);return{data:new Date(n+=60*a*1e3),size:10}},A.parseValue=function(e,t,i){if(i<1)throw new c.j4("Data not enough when parse Value");var a,o=new DataView(e,t,i),r=1,s=o.getUint8(0),g=!1;try{switch(s){case 0:a=o.getFloat64(1,!l),r+=8;break;case 1:a=!!o.getUint8(1),r+=1;break;case 2:var I=A.parseString(e,t+1,i-1);a=I.data,r+=I.size;break;case 3:a={};var C=0;for(9==(16777215&o.getUint32(i-4,!l))&&(C=3);r32)throw new c.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(A<=this._current_word_bits_left){var e=this._current_word>>>32-A;return this._current_word<<=A,this._current_word_bits_left-=A,e}var t=this._current_word_bits_left?this._current_word:0;t>>>=32-this._current_word_bits_left;var i=A-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(i,this._current_word_bits_left),a=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,t<>>A)return this._current_word<<=A,this._current_word_bits_left-=A,A;return this._fillCurrentWord(),A+this._skipLeadingZero()},A.prototype.readUEG=function(){var A=this._skipLeadingZero();return this.readBits(A+1)-1},A.prototype.readSEG=function(){var A=this.readUEG();return 1&A?A+1>>>1:-1*(A>>>1)},A}(),d=function(){function A(){}return A._ebsp2rbsp=function(A){for(var e=A,t=e.byteLength,i=new Uint8Array(t),n=0,a=0;a=2&&3===e[a]&&0===e[a-1]&&0===e[a-2]||(i[n]=e[a],n++);return new Uint8Array(i.buffer,0,n)},A.parseSPS=function(e){for(var t=e.subarray(1,4),i="avc1.",n=0;n<3;n++){var a=t[n].toString(16);a.length<2&&(a="0"+a),i+=a}var o=A._ebsp2rbsp(e),r=new C(o);r.readByte();var s=r.readByte();r.readByte();var g=r.readByte();r.readUEG();var c=A.getProfileString(s),l=A.getLevelString(g),I=1,d=420,h=8,B=8;if((100===s||110===s||122===s||244===s||44===s||83===s||86===s||118===s||128===s||138===s||144===s)&&(3===(I=r.readUEG())&&r.readBits(1),I<=3&&(d=[0,420,422,444][I]),h=r.readUEG()+8,B=r.readUEG()+8,r.readBits(1),r.readBool()))for(var u=3!==I?8:12,E=0;E0&&N<16?(v=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][N-1],b=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][N-1]):255===N&&(v=r.readByte()<<8|r.readByte(),b=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var T=r.readBits(32),M=r.readBits(32);R=r.readBool(),F=(k=M)/(P=2*T)}}var L=1;1===v&&1===b||(L=v/b);var Y=0,G=0;0===I?(Y=1,G=2-y):(Y=3===I?1:2,G=(1===I?2:1)*(2-y));var U=16*(p+1),J=16*(m+1)*(2-y);U-=(_+S)*Y,J-=(D+w)*G;var H=Math.ceil(U*L);return r.destroy(),r=null,{codec_mimetype:i,profile_idc:s,level_idc:g,profile_string:c,level_string:l,chroma_format_idc:I,bit_depth:h,bit_depth_luma:h,bit_depth_chroma:B,ref_frames:x,chroma_format:d,chroma_format_string:A.getChromaFormatString(d),frame_rate:{fixed:R,fps:F,fps_den:P,fps_num:k},sar_ratio:{width:v,height:b},codec_size:{width:U,height:J},present_size:{width:H,height:J}}},A._skipScalingList=function(A,e){for(var t=8,i=8,n=0;n=2&&3===e[a]&&0===e[a-1]&&0===e[a-2]||(i[n]=e[a],n++);return new Uint8Array(i.buffer,0,n)},A.parseVPS=function(e){var t=A._ebsp2rbsp(e),i=new C(t);return i.readByte(),i.readByte(),i.readBits(4),i.readBits(2),i.readBits(6),{num_temporal_layers:i.readBits(3)+1,temporal_id_nested:i.readBool()}},A.parseSPS=function(e){var t=A._ebsp2rbsp(e),i=new C(t);i.readByte(),i.readByte();for(var n=0,a=0,o=0,r=0,s=(i.readBits(4),i.readBits(3)),g=(i.readBool(),i.readBits(2)),c=i.readBool(),l=i.readBits(5),I=i.readByte(),d=i.readByte(),h=i.readByte(),B=i.readByte(),u=i.readByte(),E=i.readByte(),f=i.readByte(),Q=i.readByte(),x=i.readByte(),p=i.readByte(),m=i.readByte(),y=[],_=[],S=0;S0)for(S=s;S<8;S++)i.readBits(2);for(S=0;S1&&i.readSEG(),S=0;S0&&z<=16?(j=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][z-1],W=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][z-1]):255===z&&(j=i.readBits(16),W=i.readBits(16))}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(3),i.readBool(),i.readBool()&&(i.readByte(),i.readByte(),i.readByte())),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool(),i.readBool(),i.readBool(),i.readBool()&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(X=i.readBits(32),q=i.readBits(32),i.readBool()&&i.readUEG(),i.readBool())){var $,AA,eA=!1;for($=i.readBool(),AA=i.readBool(),($||AA)&&((eA=i.readBool())&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),eA&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5)),S=0;S<=s;S++){var tA=i.readBool();Z=tA;var iA=!1,nA=1;tA||(iA=i.readBool());var aA=!1;if(iA?i.readSEG():aA=i.readBool(),aA||(nA=i.readUEG()+1),$)for(G=0;G>3,a=!!(4&e[i]),o=!!(2&e[i]);e[i],i+=1,a&&(i+=1);var r=Number.POSITIVE_INFINITY;if(o){r=0;for(var s=0;r|=(127&e[i])<<7*s,128&e[i+=1];s++);}1===n&&(t=A.parseSeuqneceHeader(e.subarray(i,i+r))),i+=r}return t},A.parseSeuqneceHeader=function(e){var t=new C(e),i=t.readBits(3),n=(t.readBool(),t.readBool()),a=!0,o=0,r=0,s=[];if(n)s.push({operating_point_idc:0,level:t.readBits(5),tier:0});else{if(t.readBool()){var g=t.readBits(32),c=t.readBits(32),l=t.readBool();if(l){for(var I=0;0===t.readBits(1);)I+=1;I>=32||t.readBits(I)}o=c,r=g,a=l,t.readBool()&&(t.readBits(5),t.readBits(32),t.readBits(5),t.readBits(5))}for(var d=t.readBool(),h=t.readBits(5),B=0;B<=h;B++){var u=t.readBits(12),E=t.readBits(5),f=E>7?t.readBits(1):0;s.push({operating_point_idc:u,level:E,tier:f}),d&&t.readBool()&&t.readBits(4)}}var Q=s[0],x=Q.level,p=Q.tier,m=t.readBits(4),y=t.readBits(4),_=t.readBits(m+1)+1,S=t.readBits(y+1)+1,D=!1;n||(D=t.readBool()),D&&(t.readBits(4),t.readBits(4)),t.readBool(),t.readBool(),t.readBool();var w=!1;n||(t.readBool(),t.readBool(),t.readBool(),t.readBool(),(w=t.readBool())&&(t.readBool(),t.readBool()),(t.readBool()||t.readBits(1))&&(t.readBool()||t.readBits(1)),w&&t.readBits(3)),t.readBool(),t.readBool(),t.readBool();var v=t.readBool(),b=8;b=2===i&&v?t.readBool()?12:10:v?10:8;var F=!1;1!==i&&(F=t.readBool()),t.readBool()&&(t.readBits(8),t.readBits(8),t.readBits(8));var R=1,k=1;return F?(t.readBits(1),R=1,k=1):(t.readBits(1),0===i?(R=1,k=1):1===i?(R=0,k=0):12===b?t.readBits(1)&&t.readBits(1):(R=1,k=0),R&&k&&t.readBits(2),t.readBits(1)),t.readBool(),t.destroy(),t=null,{codec_mimetype:"av01.".concat(i,".").concat(A.getLevelString(x,p),".").concat(b.toString(10).padStart(2,"0")),level:x,tier:p,level_string:A.getLevelString(x,p),profile_idc:i,profile_string:"".concat(i),bit_depth:b,ref_frames:1,chroma_format:A.getChromaFormat(F,R,k),chroma_format_string:A.getChromaFormatString(F,R,k),frame_rate:{fixed:a,fps:o/r,fps_den:r,fps_num:o},sar_ratio:{width:1,height:1},codec_size:{width:_,height:S},present_size:{width:1*_,height:S}}},A.getLevelString=function(A,e){return"".concat(A.toString(10).padStart(2,"0")).concat(0===e?"M":"H")},A.getChromaFormat=function(A,e,t){return A?0:0===e&&0===t?3:1===e&&0===t?2:1===e&&1===t?1:Number.NaN},A.getChromaFormatString=function(A,e,t){return A?"4:0:0":0===e&&0===t?"4:4:4":1===e&&0===t?"4:2:2":1===e&&1===t?"4:2:0":"Unknown"},A}();var p=function(){function A(A,e){this.TAG="FLVDemuxer",this._config=e,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=A.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=A.hasAudioTrack,this._hasVideo=A.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new o.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var A=new ArrayBuffer(2);return new DataView(A).setInt16(0,256,!0),256===new Int16Array(A)[0]}()}return A.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},A.probe=function(A){var e=new Uint8Array(A);if(e.byteLength<9)return{needMoreData:!0};var t={match:!1};if(70!==e[0]||76!==e[1]||86!==e[2]||1!==e[3])return t;var i,n=(4&e[4])>>>2!=0,a=!!(1&e[4]),o=(i=e)[5]<<24|i[6]<<16|i[7]<<8|i[8];return o<9?t:{match:!0,consumed:o,dataOffset:o,hasAudioTrack:n,hasVideoTrack:a}},A.prototype.bindDataSource=function(A){return A.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(A.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(A){this._onTrackMetadata=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(A){this._onMediaInfo=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(A){this._onMetaDataArrived=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(A){this._onScriptDataArrived=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(A){this._onDataAvailable=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(A){this._timestampBase=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedDuration",{get:function(){return this._duration},set:function(A){this._durationOverrided=!0,this._duration=A,this._mediaInfo&&(this._mediaInfo.duration=A)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedHasAudio",{set:function(A){this._hasAudioFlagOverrided=!0,this._hasAudio=A,this._mediaInfo&&(this._mediaInfo.hasAudio=A)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedHasVideo",{set:function(A){this._hasVideoFlagOverrided=!0,this._hasVideo=A,this._mediaInfo&&(this._mediaInfo.hasVideo=A)},enumerable:!1,configurable:!0}),A.prototype.resetMediaInfo=function(){this._mediaInfo=new o.A},A.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},A.prototype.parseChunks=function(e,t){var i,a;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new c.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var o=0,r=this._littleEndian;if(0===t){if(!(e.byteLength>13))return 0;var s=A.probe(e);o=(null==s?void 0:s.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,t+o!==this._dataOffset&&n.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(g=new DataView(e,o)).getUint32(0,!r)&&n.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),o+=4);oe.byteLength)break;var l=g.getUint8(0),I=16777215&g.getUint32(0,!r);if(o+11+I+4>e.byteLength)break;if(8===l||9===l||18===l){var C=g.getUint8(4),d=g.getUint8(5),h=g.getUint8(6)|d<<8|C<<16|g.getUint8(7)<<24;16777215&g.getUint32(7,!r)&&n.A.w(this.TAG,"Meet tag which has StreamID != 0!");var B=o+11;switch(l){case 8:this._parseAudioData(e,B,I,h);break;case 9:this._parseVideoData(e,B,I,h,t+o);break;case 18:this._parseScriptData(e,B,I)}var u=g.getUint32(11+I,!r);u!==11+I&&n.A.w(this.TAG,"Invalid PrevTagSize ".concat(u)),o+=11+I+4}else n.A.w(this.TAG,"Unsupported tag type ".concat(l,", skipped")),o+=11+I+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(i=this._audioTrack)||void 0===i?void 0:i.length)||(null===(a=this._videoTrack)||void 0===a?void 0:a.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),o},A.prototype._parseScriptData=function(A,e,t){var i,a,o,r=I.parseScriptData(A,e,t);if(r.hasOwnProperty("onMetaData")){if(null==r.onMetaData||"object"!=typeof r.onMetaData)return void n.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&n.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=r;var s=null===(i=this._metadata)||void 0===i?void 0:i.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},s)),"boolean"==typeof(null==s?void 0:s.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=s.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==s?void 0:s.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=s.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==s?void 0:s.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=s.audiodatarate),"number"==typeof(null==s?void 0:s.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=s.videodatarate),"number"==typeof(null==s?void 0:s.width)&&this._mediaInfo&&(this._mediaInfo.width=s.width),"number"==typeof(null==s?void 0:s.height)&&this._mediaInfo&&(this._mediaInfo.height=s.height),"number"==typeof(null==s?void 0:s.duration)){if(!this._durationOverrided){var g=Math.floor(s.duration*this._timescale);this._duration=g,this._mediaInfo&&(this._mediaInfo.duration=g)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==s?void 0:s.framerate)){var c=Math.floor(1e3*s.framerate);if(c>0){var l=c/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=l,this._referenceFrameRate.fps_num=c,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=l)}}if("object"==typeof(null==s?void 0:s.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var C=s.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(C)),s.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=s),n.A.v(this.TAG,"Parsed onMetaData"),(null===(a=this._mediaInfo)||void 0===a?void 0:a.isComplete())&&(null===(o=this._onMediaInfo)||void 0===o||o.call(this,this._mediaInfo))}Object.keys(r).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},r))},A.prototype._parseKeyframesIndex=function(A){for(var e=[],t=[],i=1;i>>4;if(2===u||10===u){var E=0,f=(12&B)>>>2;if(f>=0&&f<=4){E=this._flvSoundRateTable[f];var x=1&B,p=this._audioMetadata,m=this._audioTrack;if(p||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(p=this._audioMetadata={}).type="audio",p.id=null==m?void 0:m.id,p.timescale=this._timescale,p.duration=this._duration,p.audioSampleRate=E,p.channelCount=0===x?1:2),10===u){var y=this._parseAACAudioData(A,e+1,t-1);if(void 0===y)return;if(0===(null==y?void 0:y.packetType)){if(null==p?void 0:p.config){if(Q(y.data.config,null==p?void 0:p.config))return;n.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var _=y.data;p.audioSampleRate=null==_?void 0:_.samplingRate,p.channelCount=null==_?void 0:_.channelCount,p.codec=null==_?void 0:_.codec,p.originalCodec=null==_?void 0:_.originalCodec,p.config=null==_?void 0:_.config,p.refSampleDuration=1024/p.audioSampleRate*p.timescale,n.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(r=this._audioTrack)||void 0===r?void 0:r.length)||(null===(s=this._videoTrack)||void 0===s?void 0:s.length))&&(null===(g=this._onDataAvailable)||void 0===g||g.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"audio",p),(w=this._mediaInfo).audioCodec=p.originalCodec||"",w.audioSampleRate=p.audioSampleRate,w.audioChannelCount=p.channelCount,w.hasVideo?null!=w.videoCodec&&(w.mimeType='video/x-flv; codecs="'+w.videoCodec+","+w.audioCodec+'"'):w.mimeType='video/x-flv; codecs="'+w.audioCodec+'"',(null==w?void 0:w.isComplete())&&(null===(l=this._onMediaInfo)||void 0===l||l.call(this,w))}else if(1===y.packetType){var S=this._timestampBase+i,D={unit:y.data,length:y.data.byteLength,dts:S,pts:S};m&&(null==m||m.samples.push(D),m.length+=(null===(I=null==y?void 0:y.data)||void 0===I?void 0:I.length)||0)}else n.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(y.packetType))}else if(2===u){if(!p.codec){var w;if(void 0===(_=this._parseMP3AudioData(A,e+1,t-1,!0)))return;p.audioSampleRate=_.samplingRate,p.channelCount=_.channelCount,p.codec=_.codec,p.originalCodec=_.originalCodec,p.refSampleDuration=1152/p.audioSampleRate*p.timescale,n.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(C=this._onTrackMetadata)||void 0===C||C.call(this,"audio",p),(w=this._mediaInfo).audioCodec=p.codec,w.audioSampleRate=p.audioSampleRate,w.audioChannelCount=p.channelCount,w.audioDataRate=_.bitRate,(null==w?void 0:w.hasVideo)?null!=w.videoCodec&&(w.mimeType='video/x-flv; codecs="'+w.videoCodec+","+w.audioCodec+'"'):w.mimeType='video/x-flv; codecs="'+w.audioCodec+'"',w.isComplete()&&(null===(d=this._onMediaInfo)||void 0===d||d.call(this,w))}var v=this._parseMP3AudioData(A,e+1,t-1,!1);if(void 0===v)return;S=this._timestampBase+i;var b={unit:v,length:v.byteLength,dts:S,pts:S};null==m||m.samples.push(b),m&&(m.length+=v.length)}}else null===(o=this._onError)||void 0===o||o.call(this,h.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+f)}else null===(a=this._onError)||void 0===a||a.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+u)}},A.prototype._parseAACAudioData=function(A,e,t){if(!(t<=1)){var i={},a=new Uint8Array(A,e,t);return i.packetType=a[0],0===a[0]?i.data=this._parseAACAudioSpecificConfig(A,e+1,t-1):i.data=a.subarray(1),i}n.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},A.prototype._parseAACAudioSpecificConfig=function(A,e,t){var i,n,a,o,r=new Uint8Array(A,e,t),s=null,g=0,c=null;if(g=a=r[0]>>>3,(o=(7&r[0])<<1|r[1]>>>7)<0||o>=this._mpegSamplingRates.length)null===(i=this._onError)||void 0===i||i.call(this,h.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var l=this._mpegSamplingRates[o],I=(120&r[1])>>>3;if(!(I<0||I>=8)){5===g&&(c=(7&r[1])<<1|r[2]>>>7,r[2]);var C=self.navigator.userAgent.toLowerCase();return C.includes("firefox")?o>=6?(g=5,s=new Array(4),c=o-3):(g=2,s=new Array(2),c=o):C.includes("android")?(g=2,s=new Array(2),c=o):(g=5,c=o,s=new Array(4),o>=6?c=o-3:1===I&&(g=2,s=new Array(2),c=o)),s[0]=g<<3,s[0]|=(15&o)>>>1,s[1]=(15&o)<<7,s[1]|=(15&I)<<3,5===g&&(s[1]|=(15&c)>>>1,s[2]=(1&c)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:l,channelCount:I,codec:"mp4a.40."+g,originalCodec:"mp4a.40."+a}}null===(n=this._onError)||void 0===n||n.call(this,h.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},A.prototype._parseMP3AudioData=function(A,e,t,i){if(!(t<4)){this._littleEndian;var a,o=new Uint8Array(A,e,t);if(i){if(255!==o[0])return;var r=o[1]>>>3&3,s=(6&o[1])>>1,g=(240&o[2])>>>4,c=(12&o[2])>>>2,l=3&~(o[3]>>>6)?2:1,I=0,C=0;switch(r){case 0:I=this._mpegAudioV25SampleRateTable[c];break;case 2:I=this._mpegAudioV20SampleRateTable[c];break;case 3:I=this._mpegAudioV10SampleRateTable[c]}switch(s){case 1:g>>4;if(128&s){var c=15&s,l=String.fromCharCode.apply(String,function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n0)&&!(i=a.next()).done;)o.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return o}(new Uint8Array(A,e,t).slice(1,5)),!1));"hvc1"===l?this._parseEnhancedHEVCVideoPacket(A,e+5,t-5,i,a,g,c):"av01"===l?this._parseEnhancedAV1VideoPacket(A,e+5,t-5,i,a,g,c):null===(r=this._onError)||void 0===r||r.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(l))}else{var I=15&s;7===I?this._parseAVCVideoPacket(A,e+1,t-1,i,a,g):12===I?this._parseHEVCVideoPacket(A,e+1,t-1,i,a,g):null===(o=this._onError)||void 0===o||o.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(I))}}},A.prototype._parseAVCVideoPacket=function(A,e,t,i,a,o){var r;if(t<4)n.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,g=new DataView(A,e,t),c=g.getUint8(0),l=(16777215&g.getUint32(0,!s))<<8>>8;0===c?this._parseAVCDecoderConfigurationRecord(A,e+4,t-4):1===c?this._parseAVCVideoData(A,e+4,t-4,i,a,o,l):2===c||null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},A.prototype._parseHEVCVideoPacket=function(A,e,t,i,a,o){var r;if(t<4)n.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var s=this._littleEndian,g=new DataView(A,e,t),c=g.getUint8(0),l=(16777215&g.getUint32(0,!s))<<8>>8;0===c?this._parseHEVCDecoderConfigurationRecord(A,e+4,t-4):1===c?this._parseHEVCVideoData(A,e+4,t-4,i,a,o,l):2===c||null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},A.prototype._parseEnhancedHEVCVideoPacket=function(A,e,t,i,n,a,o){var r,s=this._littleEndian,g=new DataView(A,e,t);if(0===o)this._parseHEVCDecoderConfigurationRecord(A,e,t);else if(1===o){var c=(4294967040&g.getUint32(0,!s))>>8;this._parseHEVCVideoData(A,e+3,t-3,i,n,a,c)}else 3===o?this._parseHEVCVideoData(A,e,t,i,n,a,0):2===o||null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))},A.prototype._parseEnhancedAV1VideoPacket=function(A,e,t,i,n,a,o){var r,s;this._littleEndian,0===o?this._parseAV1CodecConfigurationRecord(A,e,t):1===o?this._parseAV1VideoData(A,e,t,i,n,a,0):5===o?null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(o)):2===o||null===(s=this._onError)||void 0===s||s.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))},A.prototype._parseAVCDecoderConfigurationRecord=function(A,e,t){var i,a,o,r,s,g,c,l,I,C,B;if(t<7)n.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var u=this._videoMetadata,E=this._videoTrack,f=this._littleEndian,x=new DataView(A,e,t);if(u){if(void 0!==u.avcc){var p=new Uint8Array(A,e,t);if(Q(p,u.avcc))return;n.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(u=this._videoMetadata={}).type="video",u.id=null==E?void 0:E.id,u.timescale=this._timescale,u.duration=this._duration;var m=x.getUint8(0),y=x.getUint8(1);if(x.getUint8(2),x.getUint8(3),1===m&&0!==y)if(this._naluLengthSize=1+(3&x.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var _=31&x.getUint8(5);if(0!==_){_>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(_));for(var S=6,D=0;D<_;D++){var w=x.getUint16(S,!f);if(S+=2,0!==w){var v=new Uint8Array(A,e+S,w);S+=w;var b=d.parseSPS(v);if(0===D){u.codecWidth=b.codec_size.width,u.codecHeight=b.codec_size.height,u.presentWidth=b.present_size.width,u.presentHeight=b.present_size.height,u.profile=b.profile_string,u.level=b.level_string,u.bitDepth=b.bit_depth,u.chromaFormat=b.chroma_format,u.sarRatio=b.sar_ratio,u.frameRate=b.frame_rate,b.frame_rate.fixed&&0!==b.frame_rate.fps_num&&0!==b.frame_rate.fps_den||(u.frameRate=this._referenceFrameRate);var F=null===(r=u.frameRate)||void 0===r?void 0:r.fps_den,R=null===(s=u.frameRate)||void 0===s?void 0:s.fps_num;u.refSampleDuration=u.timescale*(F/R);for(var k=v.subarray(1,4),P="avc1.",N=0;N<3;N++){var T=k[N].toString(16);T.length<2&&(T="0"+T),P+=T}u.codec=P;var M=this._mediaInfo;M.width=u.codecWidth,M.height=u.codecHeight,M.fps=u.frameRate.fps,M.profile=u.profile,M.level=u.level,M.refFrames=b.ref_frames,M.chromaFormat=b.chroma_format_string,M.sarNum=u.sarRatio.width,M.sarDen=u.sarRatio.height,M.videoCodec=P,M.hasAudio?null!=M.audioCodec&&(M.mimeType='video/x-flv; codecs="'+M.videoCodec+","+M.audioCodec+'"'):M.mimeType='video/x-flv; codecs="'+M.videoCodec+'"',M.isComplete()&&(null===(g=this._onMediaInfo)||void 0===g||g.call(this,M))}}}var L=x.getUint8(S);if(0!==L){for(L>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(L)),S++,D=0;D=t){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(d,", offset = ").concat(I,", dataSize = ").concat(t));break}var B=g.getUint32(I,!s);if(3===C&&(B>>>=8),B>t-C)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(d,", NaluSize > DataSize!"));var u=31&g.getUint8(I+C);5===u&&(h=!0);var E=new Uint8Array(A,e+I,C+B),f={type:u,data:E};c.push(f),l+=E.byteLength,I+=C+B}if(c.length){var Q=this._videoTrack,x={units:c,length:l,isKeyframe:h,dts:d,cts:r,pts:d+r};h&&(x.fileposition=a),Q&&(Q.samples.push(x),Q.length+=l)}},A.prototype._parseHEVCVideoData=function(A,e,t,i,a,o,r){for(var s=this._littleEndian,g=new DataView(A,e,t),c=[],l=0,I=0,C=this._naluLengthSize,d=this._timestampBase+i,h=1===o;I=t){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(d,", offset = ").concat(I,", dataSize = ").concat(t));break}var B=g.getUint32(I,!s);if(3===C&&(B>>>=8),B>t-C)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(d,", NaluSize > DataSize!"));var u=31&g.getUint8(I+C);19!==u&&20!==u||(h=!0);var E=new Uint8Array(A,e+I,C+B),f={type:u,data:E};c.push(f),l+=E.byteLength,I+=C+B}if(c.length){var Q=this._videoTrack,x={units:c,length:l,isKeyframe:h,dts:d,cts:r,pts:d+r};h&&(x.fileposition=a),Q&&(null==Q||Q.samples.push(x),Q.length+=l)}},A.prototype._parseAV1VideoData=function(A,e,t,i,n,a,o){this._littleEndian;var r,s=[],g=this._timestampBase+i,c=1===a;if(r=t,s.push({unitType:0,data:new Uint8Array(A,e+0,t)}),s.length){var l=this._videoTrack,I={units:s,length:r,isKeyframe:c,dts:g,cts:o,pts:g+o};c&&(I.fileposition=n),l&&(null==l||l.samples.push(I),l.length+=r)}},A}();const m=p,y=function(){function A(){}return A.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},A}();var _,S=function(){this.program_pmt_pid={}};!function(A){A[A.kMPEG1Audio=3]="kMPEG1Audio",A[A.kMPEG2Audio=4]="kMPEG2Audio",A[A.kPESPrivateData=6]="kPESPrivateData",A[A.kADTSAAC=15]="kADTSAAC",A[A.kLOASAAC=17]="kLOASAAC",A[A.kAC3=129]="kAC3",A[A.kEAC3=135]="kEAC3",A[A.kID3=21]="kID3",A[A.kSCTE35=134]="kSCTE35",A[A.kH264=27]="kH264",A[A.kH265=36]="kH265"}(_||(_={}));var D,w=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},v=function(){},b=function(){},F=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0,this.random_access_indicator=0};!function(A){A[A.kUnspecified=0]="kUnspecified",A[A.kSliceNonIDR=1]="kSliceNonIDR",A[A.kSliceDPA=2]="kSliceDPA",A[A.kSliceDPB=3]="kSliceDPB",A[A.kSliceDPC=4]="kSliceDPC",A[A.kSliceIDR=5]="kSliceIDR",A[A.kSliceSEI=6]="kSliceSEI",A[A.kSliceSPS=7]="kSliceSPS",A[A.kSlicePPS=8]="kSlicePPS",A[A.kSliceAUD=9]="kSliceAUD",A[A.kEndOfSequence=10]="kEndOfSequence",A[A.kEndOfStream=11]="kEndOfStream",A[A.kFiller=12]="kFiller",A[A.kSPSExt=13]="kSPSExt",A[A.kReserved0=14]="kReserved0"}(D||(D={}));var R,k,P=function(){},N=function(A){var e=A.data.byteLength;this.type=A.type,this.data=new Uint8Array(4+e),new DataView(this.data.buffer).setUint32(0,e),this.data.set(A.data,4)},T=function(){function A(A){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=A,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return A.prototype.findNextStartCodeOffset=function(A){for(var e=A,t=this.data_;;){if(e+3>=t.byteLength)return this.eof_flag_=!0,t.byteLength;var i=t[e+0]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],n=t[e+0]<<16|t[e+1]<<8|t[e+2];if(1===i||1===n)return e;e++}},A.prototype.readNextNaluPayload=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_startcode_offset_,i=31&A[t+=1==(A[t]<<24|A[t+1]<<16|A[t+2]<<8|A[t+3])?4:3],n=(128&A[t])>>>7,a=this.findNextStartCodeOffset(t);if(this.current_startcode_offset_=a,!(i>=D.kReserved0)&&0===n){var o=A.subarray(t,a);(e=new P).type=i,e.data=o}}return e},A}(),M=function(){function A(A,e,t){var i=8+A.byteLength+1+2+e.byteLength,n=!1;66!==A[3]&&77!==A[3]&&88!==A[3]&&(n=!0,i+=4);var a=this.data=new Uint8Array(i);a[0]=1,a[1]=A[1],a[2]=A[2],a[3]=A[3],a[4]=255,a[5]=225;var o=A.byteLength;a[6]=o>>>8,a[7]=255&o;var r=8;a.set(A,8),a[r+=o]=1;var s=e.byteLength;a[r+1]=s>>>8,a[r+2]=255&s,a.set(e,r+3),r+=3+s,n&&(a[r]=252|t.chroma_format_idc,a[r+1]=248|t.bit_depth_luma-8,a[r+2]=248|t.bit_depth_chroma-8,a[r+3]=0,r+=4)}return A.prototype.getData=function(){return this.data},A}();!function(A){A[A.kNull=0]="kNull",A[A.kAACMain=1]="kAACMain",A[A.kAAC_LC=2]="kAAC_LC",A[A.kAAC_SSR=3]="kAAC_SSR",A[A.kAAC_LTP=4]="kAAC_LTP",A[A.kAAC_SBR=5]="kAAC_SBR",A[A.kAAC_Scalable=6]="kAAC_Scalable",A[A.kLayer1=32]="kLayer1",A[A.kLayer2=33]="kLayer2",A[A.kLayer3=34]="kLayer3"}(R||(R={})),function(A){A[A.k96000Hz=0]="k96000Hz",A[A.k88200Hz=1]="k88200Hz",A[A.k64000Hz=2]="k64000Hz",A[A.k48000Hz=3]="k48000Hz",A[A.k44100Hz=4]="k44100Hz",A[A.k32000Hz=5]="k32000Hz",A[A.k24000Hz=6]="k24000Hz",A[A.k22050Hz=7]="k22050Hz",A[A.k16000Hz=8]="k16000Hz",A[A.k12000Hz=9]="k12000Hz",A[A.k11025Hz=10]="k11025Hz",A[A.k8000Hz=11]="k8000Hz",A[A.k7350Hz=12]="k7350Hz"}(k||(k={}));var L,Y,G=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],U=(L=function(A,e){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},L(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}L(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),J=function(){},H=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return U(e,A),e}(J),K=function(){function A(A){this.TAG="AACADTSParser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(4095==(t[e+0]<<8|t[e+1])>>>4)return e;e++}},A.prototype.readNextAACFrame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=(8&A[t+1])>>>3,n=(6&A[t+1])>>>1,a=1&A[t+1],o=(192&A[t+2])>>>6,r=(60&A[t+2])>>>2,s=(1&A[t+2])<<2|(192&A[t+3])>>>6,g=(3&A[t+3])<<11|A[t+4]<<3|(224&A[t+5])>>>5;if(A[t+6],t+g>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=1===a?7:9,l=g-c;t+=c;var I=this.findNextSyncwordOffset(t+l);if(this.current_syncword_offset_=I,(0===i||1===i)&&0===n){var C=A.subarray(t,t+l);(e=new J).audio_object_type=o+1,e.sampling_freq_index=r,e.sampling_frequency=G[r],e.channel_config=s,e.data=C}}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),V=function(){function A(A){this.TAG="AACLOASParser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+1>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(695==(t[e+0]<<3|t[e+1]>>>5))return e;e++}},A.prototype.getLATMValue=function(A){for(var e=A.readBits(2),t=0,i=0;i<=e;i++)t<<=8,t|=A.readByte();return t},A.prototype.readNextAACFrame=function(A){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,a=(31&e[i+1])<<8|e[i+2];if(i+3+a>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var o=new C(e.subarray(i+3,i+3+a)),r=null;if(o.readBool()){if(null==A){n.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(i+3+a),o.destroy();continue}r=A}else{var s=o.readBool();if(s&&o.readBool()){n.A.e(this.TAG,"audioMuxVersionA is Not Supported"),o.destroy();break}if(s&&this.getLATMValue(o),!o.readBool()){n.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),o.destroy();break}if(0!==o.readBits(6)){n.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),o.destroy();break}if(0!==o.readBits(4)){n.A.e(this.TAG,"more than 2 numProgram Not Supported"),o.destroy();break}if(0!==o.readBits(3)){n.A.e(this.TAG,"more than 2 numLayer Not Supported"),o.destroy();break}var g=s?this.getLATMValue(o):0,c=o.readBits(5);g-=5;var l=o.readBits(4);g-=4;var I=o.readBits(4);g-=4,o.readBits(3),(g-=3)>0&&o.readBits(g);var d=o.readBits(3);if(0!==d){n.A.e(this.TAG,"frameLengthType = ".concat(d,". Only frameLengthType = 0 Supported")),o.destroy();break}o.readByte();var h=o.readBool();if(h)if(s)this.getLATMValue(o);else{for(var B=0;;){B<<=8;var u=o.readBool();if(B+=o.readByte(),!u)break}console.log(B)}o.readBool()&&o.readByte(),(r=new H).audio_object_type=c,r.sampling_freq_index=l,r.sampling_frequency=G[r.sampling_freq_index],r.channel_config=I,r.other_data_present=h}for(var E=0;;){var f=o.readByte();if(E+=f,255!==f)break}for(var Q=new Uint8Array(E),x=0;x=6?(i=5,e=new Array(4),o=n-3):(i=2,e=new Array(2),o=n):r.includes("android")?(i=2,e=new Array(2),o=n):(i=5,o=n,e=new Array(4),n>=6?o=n-3:1===a&&(i=2,e=new Array(2),o=n)),e[0]=i<<3,e[0]|=(15&n)>>>1,e[1]=(15&n)<<7,e[1]|=(15&a)<<3,5===i&&(e[1]|=(15&o)>>>1,e[2]=(1&o)<<7,e[2]|=8,e[3]=0),this.config=e,this.sampling_rate=G[n],this.channel_count=a,this.codec_mimetype="mp4a.40."+i.toString(),this.original_codec_mimetype="mp4a.40."+t.toString()},j=function(){},W=function(){};!function(A){A[A.kSpliceNull=0]="kSpliceNull",A[A.kSpliceSchedule=4]="kSpliceSchedule",A[A.kSpliceInsert=5]="kSpliceInsert",A[A.kTimeSignal=6]="kTimeSignal",A[A.kBandwidthReservation=7]="kBandwidthReservation",A[A.kPrivateCommand=255]="kPrivateCommand"}(Y||(Y={}));var Z,X=function(A){var e=A.readBool();return e?(A.readBits(6),{time_specified_flag:e,pts_time:4*A.readBits(31)+A.readBits(2)}):(A.readBits(7),{time_specified_flag:e})},q=function(A){var e=A.readBool();return A.readBits(6),{auto_return:e,duration:4*A.readBits(31)+A.readBits(2)}},z=function(A,e){var t=e.readBits(8);return A?{component_tag:t}:{component_tag:t,splice_time:X(e)}},$=function(A){return{component_tag:A.readBits(8),utc_splice_time:A.readBits(32)}},AA=function(A){var e=A.readBits(32),t=A.readBool();A.readBits(7);var i={splice_event_id:e,splice_event_cancel_indicator:t};if(t)return i;if(i.out_of_network_indicator=A.readBool(),i.program_splice_flag=A.readBool(),i.duration_flag=A.readBool(),A.readBits(5),i.program_splice_flag)i.utc_splice_time=A.readBits(32);else{i.component_count=A.readBits(8),i.components=[];for(var n=0;n=t.byteLength)return this.eof_flag_=!0,t.byteLength;var i=t[e+0]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],n=t[e+0]<<16|t[e+1]<<8|t[e+2];if(1===i||1===n)return e;e++}},A.prototype.readNextNaluPayload=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_startcode_offset_,i=A[t+=1==(A[t]<<24|A[t+1]<<16|A[t+2]<<8|A[t+3])?4:3]>>1&63,n=(128&A[t])>>>7,a=this.findNextStartCodeOffset(t);if(this.current_startcode_offset_=a,0===n){var o=A.subarray(t,a);(e=new sA).type=i,e.data=o}}return e},A}(),lA=function(){function A(A,e,t,i){var n=23+(5+A.byteLength)+(5+e.byteLength)+(5+t.byteLength),a=this.data=new Uint8Array(n);a[0]=1,a[1]=(3&i.general_profile_space)<<6|(i.general_tier_flag?1:0)<<5|31&i.general_profile_idc,a[2]=i.general_profile_compatibility_flags_1,a[3]=i.general_profile_compatibility_flags_2,a[4]=i.general_profile_compatibility_flags_3,a[5]=i.general_profile_compatibility_flags_4,a[6]=i.general_constraint_indicator_flags_1,a[7]=i.general_constraint_indicator_flags_2,a[8]=i.general_constraint_indicator_flags_3,a[9]=i.general_constraint_indicator_flags_4,a[10]=i.general_constraint_indicator_flags_5,a[11]=i.general_constraint_indicator_flags_6,a[12]=i.general_level_idc,a[13]=240|(3840&i.min_spatial_segmentation_idc)>>8,a[14]=255&i.min_spatial_segmentation_idc,a[15]=252|3&i.parallelismType,a[16]=252|3&i.chroma_format_idc,a[17]=248|7&i.bit_depth_luma_minus8,a[18]=248|7&i.bit_depth_chroma_minus8,a[19]=0,a[20]=0,a[21]=(3&i.constant_frame_rate)<<6|(7&i.num_temporal_layers)<<3|(i.temporal_id_nested?1:0)<<2|3,a[22]=3,a[23]=128|Z.kSliceVPS,a[24]=0,a[25]=1,a[26]=(65280&A.byteLength)>>8,a[27]=255&A.byteLength,a.set(A,28),a[23+(5+A.byteLength)+0]=128|Z.kSliceSPS,a[23+(5+A.byteLength)+1]=0,a[23+(5+A.byteLength)+2]=1,a[23+(5+A.byteLength)+3]=(65280&e.byteLength)>>8,a[23+(5+A.byteLength)+4]=255&e.byteLength,a.set(e,23+(5+A.byteLength)+5),a[23+(5+A.byteLength+5+e.byteLength)+0]=128|Z.kSlicePPS,a[23+(5+A.byteLength+5+e.byteLength)+1]=0,a[23+(5+A.byteLength+5+e.byteLength)+2]=1,a[23+(5+A.byteLength+5+e.byteLength)+3]=(65280&t.byteLength)>>8,a[23+(5+A.byteLength+5+e.byteLength)+4]=255&t.byteLength,a.set(t,23+(5+A.byteLength+5+e.byteLength)+5)}return A.prototype.getData=function(){return this.data},A}(),IA=function(){},CA=function(){},dA=function(){},hA=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],BA=function(){function A(A){this.TAG="AC3Parser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(2935==(t[e+0]<<8|t[e+1]))return e;e++}},A.prototype.readNextAC3Frame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=A[t+4]>>6,n=[48e3,44200,33e3][i],a=63&A[t+4],o=2*hA[i][a];if(t+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var r=this.findNextSyncwordOffset(t+o);this.current_syncword_offset_=r;var s=A[t+5]>>3,g=7&A[t+5],c=A[t+6]>>5,l=0;1&c&&1!==c&&(l+=2),4&c&&(l+=2),2===c&&(l+=2);var I=(A[t+6]<<8|A[t+7])>>12-l&1,C=[2,1,2,3,3,4,4,5][c]+I;(e=new dA).sampling_frequency=n,e.channel_count=C,e.channel_mode=c,e.bit_stream_identification=s,e.low_frequency_effects_channel_on=I,e.bit_stream_mode=g,e.frame_size_code=a,e.data=A.subarray(t,t+o)}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),uA=function(A){var e;e=[A.sampling_rate_code<<6|A.bit_stream_identification<<1|A.bit_stream_mode>>2,(3&A.bit_stream_mode)<<6|A.channel_mode<<3|A.low_frequency_effects_channel_on<<2|A.frame_size_code>>4,A.frame_size_code<<4&224],this.config=e,this.sampling_rate=A.sampling_frequency,this.bit_stream_identification=A.bit_stream_identification,this.bit_stream_mode=A.bit_stream_mode,this.low_frequency_effects_channel_on=A.low_frequency_effects_channel_on,this.channel_count=A.channel_count,this.channel_mode=A.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},EA=function(){},fA=function(){function A(A){this.TAG="EAC3Parser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(2935==(t[e+0]<<8|t[e+1]))return e;e++}},A.prototype.readNextEAC3Frame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=new C(A.subarray(t+2)),n=(i.readBits(2),i.readBits(3),i.readBits(11)+1<<1),a=i.readBits(2),o=null,r=null;3===a?(o=[24e3,22060,16e3][a=i.readBits(2)],r=3):(o=[48e3,44100,32e3][a],r=i.readBits(2));var s=i.readBits(3),g=i.readBits(1),c=i.readBits(5);if(t+n>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var l=this.findNextSyncwordOffset(t+n);this.current_syncword_offset_=l;var I=[2,1,2,3,3,4,4,5][s]+g;i.destroy(),(e=new EA).sampling_frequency=o,e.channel_count=I,e.channel_mode=s,e.bit_stream_identification=c,e.low_frequency_effects_channel_on=g,e.frame_size=n,e.num_blks=[1,2,3,6][r],e.data=A.subarray(t,t+n)}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),QA=function(A){var e,t=Math.floor(A.frame_size*A.sampling_frequency/(16*A.num_blks));e=[255&t,248&t,A.sampling_rate_code<<6|A.bit_stream_identification<<1,A.channel_mode<<1|A.low_frequency_effects_channel_on,0],this.config=e,this.sampling_rate=A.sampling_frequency,this.bit_stream_identification=A.bit_stream_identification,this.num_blks=A.num_blks,this.low_frequency_effects_channel_on=A.low_frequency_effects_channel_on,this.channel_count=A.channel_count,this.channel_mode=A.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},xA=function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},A(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}}(),pA=function(){return pA=Object.assign||function(A){for(var e,t=1,i=arguments.length;t0)&&!(i=a.next()).done;)o.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return o},yA=function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n=4?(n.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),t-=4):204===i&&n.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:i,sync_offset:t})},e.prototype.bindDataSource=function(A){return A.onDataArrival=this.parseChunks.bind(this),this},e.prototype.resetMediaInfo=function(){this.media_info_=new o.A},e.prototype.parseChunks=function(A,e){var t;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new c.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0;for(this.first_parse_&&(this.first_parse_=!1,i=this.sync_offset_);i+this.ts_packet_size_<=A.byteLength;){var a=e+i;192===this.ts_packet_size_&&(i+=4);var o=new Uint8Array(A,i,188),r=o[0];if(71!==r){n.A.e(this.TAG,"sync_byte = ".concat(r,", not 0x47"));break}var s=(64&o[1])>>>6,g=(o[1],(31&o[1])<<8|o[2]),l=(48&o[3])>>>4,I=15&o[3],C={},d=4;if(2===l||3===l){var h=o[4];if(5+h===188){i+=188,204===this.ts_packet_size_&&(i+=16);continue}h>0&&(C=this.parseAdaptationField(A,i+4,1+h)),d=5+h}if(1===l||3===l)if(0===g||g===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[g]===_.kSCTE35){var B=188-d;this.handleSectionSlice(A,i+d,B,{pid:g,file_position:a,payload_unit_start_indicator:s,continuity_conunter:I,random_access_indicator:C.random_access_indicator})}else if(void 0!==(null===(t=this.pmt_)||void 0===t?void 0:t.pid_stream_type[g])){B=188-d;var u=this.pmt_.pid_stream_type[g];(g===this.pmt_.common_pids.h264||g===this.pmt_.common_pids.h265||g===this.pmt_.common_pids.adts_aac||g===this.pmt_.common_pids.loas_aac||g===this.pmt_.common_pids.ac3||g===this.pmt_.common_pids.eac3||g===this.pmt_.common_pids.opus||g===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[g]||this.pmt_.timed_id3_pids[g])&&this.handlePESSlice(A,i+d,B,{pid:g,stream_type:u,file_position:a,payload_unit_start_indicator:s,continuity_conunter:I,random_access_indicator:C.random_access_indicator})}i+=188,204===this.ts_packet_size_&&(i+=16)}return this.dispatchAudioVideoMediaSegment(),i},e.prototype.parseAdaptationField=function(A,e,t){var i=new Uint8Array(A,e,t),a=i[0];return a>0?a>183?(n.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(a)),{}):{discontinuity_indicator:(128&i[1])>>>7,random_access_indicator:(64&i[1])>>>6,elementary_stream_priority_indicator:(32&i[1])>>>5}:{}},e.prototype.handleSectionSlice=function(A,e,t,i){var n=new Uint8Array(A,e,t),a=this.section_slice_queues_?this.section_slice_queues_[i.pid]:{};if(i.payload_unit_start_indicator){var o=n[0];if(void 0!==a&&0!==(null==a?void 0:a.total_length)){var r=new Uint8Array(A,e+1,Math.min(t,o));a.slices.push(r),a.total_length+=r.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):this.clearSlices(a,i)}for(var s=1+o;s=a.expected_length&&this.clearSlices(a,i),s+=r.byteLength}}else void 0!==a&&0!==a.total_length&&(r=new Uint8Array(A,e,Math.min(t,a.expected_length-a.total_length)),a.slices.push(r),a.total_length+=r.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):a.total_length>=a.expected_length&&this.clearSlices(a,i))},e.prototype.handlePESSlice=function(A,e,t,i){var a=new Uint8Array(A,e,t),o=a[0]<<16|a[1]<<8|a[2],r=(a[3],a[4]<<8|a[5]);if(i.payload_unit_start_indicator){if(1!==o)return void n.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(o));var s=this.pes_slice_queues_[i.pid];s&&(0===s.expected_length||s.expected_length===s.total_length?this.emitPESSlices(s,i):this.clearSlices(s,i)),this.pes_slice_queues_&&(this.pes_slice_queues_[i.pid]=new F,this.pes_slice_queues_[i.pid].file_position=i.file_position,this.pes_slice_queues_[i.pid].random_access_indicator=i.random_access_indicator)}if(void 0!==this.pes_slice_queues_[i.pid]){var g=this.pes_slice_queues_[i.pid];g.slices.push(a),i.payload_unit_start_indicator&&(g.expected_length=0===r?0:r+6),g.total_length+=a.byteLength,g.expected_length>0&&g.expected_length===g.total_length?this.emitPESSlices(g,i):g.expected_length>0&&g.expected_length>>6,r=e[8],s=void 0,g=void 0;2!==o&&3!==o||(s=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,g=3===o?536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2:s);var c=9+r,l=void 0;if(0!==a){if(a<3+r)return void n.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");l=a-3-r}else l=e.byteLength-c;var I=e.subarray(c,c+l);switch(A.stream_type){case _.kMPEG1Audio:case _.kMPEG2Audio:this.parseMP3Payload(I,s);break;case _.kPESPrivateData:this.pmt_.common_pids.opus===A.pid?this.parseOpusPayload(I,s):this.pmt_.common_pids.ac3===A.pid?this.parseAC3Payload(I,s):this.pmt_.common_pids.eac3===A.pid?this.parseEAC3Payload(I,s):this.pmt_.smpte2038_pids[A.pid]?this.parseSMPTE2038MetadataPayload(I,s,g,A.pid,i):this.parsePESPrivateDataPayload(I,s,g,A.pid,i);break;case _.kADTSAAC:this.parseADTSAACPayload(I,s);break;case _.kLOASAAC:this.parseLOASAACPayload(I,s);break;case _.kAC3:this.parseAC3Payload(I,s);break;case _.kEAC3:this.parseEAC3Payload(I,s);break;case _.kID3:this.parseTimedID3MetadataPayload(I,s,g,A.pid,i);break;case _.kH264:this.parseH264Payload(I,s,g,A.file_position,A.random_access_indicator);break;case _.kH265:this.parseH265Payload(I,s,g,A.file_position,A.random_access_indicator)}}else 188!==i&&191!==i&&240!==i&&241!==i&&255!==i&&242!==i&&248!==i||A.stream_type!==_.kPESPrivateData||(c=6,l=void 0,l=0!==a?a:e.byteLength-c,I=e.subarray(c,c+l),this.parsePESPrivateDataPayload(I,void 0,void 0,A.pid,i));else n.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(t))},e.prototype.parsePAT=function(A){var e=A[0];if(0===e){var t=(15&A[1])<<8|A[2],i=(A[3],A[4],(62&A[5])>>>1),a=1&A[5],o=A[6],r=(A[7],null);if(1===a&&0===o)(r=new S).version_number=i;else if(null==(r=this.pat_))return;for(var s=t-5-4,g=-1,c=-1,l=8;l<8+s;l+=4){var I=A[l]<<8|A[l+1],C=(31&A[l+2])<<8|A[l+3];0===I?r.network_pid=C:(r.program_pmt_pid[I]=C,-1===g&&(g=I),-1===c&&(c=C))}1===a&&0===o&&(void 0===this.pat_&&n.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(r))),this.pat_=r,this.current_program_=g,this.current_pmt_pid_=c)}else n.A.e(this.TAG,"parsePAT: table_id ".concat(e," is not corresponded to PAT!"))},e.prototype.parsePMT=function(A){var e=A[0];if(2===e){var t=(15&A[1])<<8|A[2],i=A[3]<<8|A[4],a=(62&A[5])>>>1,o=1&A[5],r=A[6],s=(A[7],null);if(1===o&&0===r)(s=new w).program_number=i,s.version_number=a,this.program_pmt_map_[i]=s;else if(null==(s=this.program_pmt_map_[i]))return;A[8],A[9];for(var g=(15&A[10])<<8|A[11],c=12+g,l=t-9-g-4,I=c;I0){for(var E=I+5;E1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(g,"ms, PES pts: ").concat(s,"ms")),s=g)}}for(var c=new K(A),l=null,I=s,C=0;null!=(l=c.readNextAACFrame());){r=1024/l.sampling_frequency*1e3;var d={codec:"aac",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(d)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(d)):(this.audio_metadata_={codec:"aac",audio_object_type:l.audio_object_type,sampling_freq_index:l.sampling_freq_index,sampling_frequency:l.sampling_frequency,channel_config:l.channel_config},this.dispatchAudioInitSegment(d)),C=I;var h=Math.floor(I),B={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(a=this.audio_track_)||void 0===a||a.samples.push(B),this.audio_track_.length+=l.data.byteLength),I+=r}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),C&&(this.aac_last_sample_pts_=C)}},e.prototype.parseLOASAACPayload=function(A,e){var t,i,a;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var o=new Uint8Array(A.byteLength+this.aac_last_incomplete_data_.byteLength);o.set(this.aac_last_incomplete_data_,0),o.set(A,this.aac_last_incomplete_data_.byteLength),A=o}var r,s=0;if(void 0!==e&&(s=e/this.timescale_),"aac"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec)){if(void 0===e&&void 0!==this.aac_last_sample_pts_)r=1024/this.audio_metadata_.sampling_frequency*1e3,s=this.aac_last_sample_pts_+r;else if(void 0===e)return void n.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){r=1024/this.audio_metadata_.sampling_frequency*1e3;var g=this.aac_last_sample_pts_+r;Math.abs(g-s)>1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(g,"ms, PES pts: ").concat(s,"ms")),s=g)}}for(var c=new V(A),l=null,I=s,C=0;null!=(l=c.readNextAACFrame(null!==(i=this.loas_previous_frame)&&void 0!==i?i:void 0));){this.loas_previous_frame=l,r=1024/l.sampling_frequency*1e3;var d={codec:"aac",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(d)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(d)):(this.audio_metadata_={codec:"aac",audio_object_type:l.audio_object_type,sampling_freq_index:l.sampling_freq_index,sampling_frequency:l.sampling_frequency,channel_config:l.channel_config},this.dispatchAudioInitSegment(d)),C=I;var h=Math.floor(I),B={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(a=this.audio_track_)||void 0===a||a.samples.push(B),this.audio_track_.length+=l.data.byteLength),I+=r}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),C&&(this.aac_last_sample_pts_=C)}},e.prototype.parseAC3Payload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,o=0;if(void 0!==e&&(o=e/this.timescale_),"ac-3"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=1536/this.audio_metadata_.sampling_frequency*1e3,o=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"AC3: Unknown pts");for(var r=new BA(A),s=null,g=o,c=0;null!=(s=r.readNextAC3Frame());){a=1536/s.sampling_frequency*1e3;var l={codec:"ac-3",data:s};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,bit_stream_mode:s.bit_stream_mode,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(l)),c=g;var I=Math.floor(g),C={unit:s.data,length:s.data.byteLength,pts:I,dts:I};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(C),this.audio_track_.length+=s.data.byteLength),g+=a}c&&(this.aac_last_sample_pts_=c)}},e.prototype.parseEAC3Payload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,o=0;if(void 0!==e&&(o=e/this.timescale_),"ec-3"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,o=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"EAC3: Unknown pts");for(var r=new fA(A),s=null,g=o,c=0;null!=(s=r.readNextEAC3Frame());){a=1536/s.sampling_frequency*1e3;var l={codec:"ec-3",data:s};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,num_blks:s.num_blks,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(l)),c=g;var I=Math.floor(g),C={unit:s.data,length:s.data.byteLength,pts:I,dts:I};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(C),this.audio_track_.length+=s.data.byteLength),g+=a}c&&(this.aac_last_sample_pts_=c)}},e.prototype.parseOpusPayload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,o=0;if(void 0!==e&&(o=e/this.timescale_),"opus"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=20,o=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"Opus: Unknown pts");for(var r=o,s=0,g=0;g>>3&3,n=(6&A[1])>>1,a=(A[2],(12&A[2])>>>2),o=3&~(A[3]>>>6)?2:1,r=0,s=34;switch(i){case 0:r=[11025,12e3,8e3,0][a];break;case 2:r=[22050,24e3,16e3,0][a];break;case 3:r=[44100,48e3,32e3,0][a]}switch(n){case 1:s=34;break;case 2:s=33;break;case 3:s=32}var g=new CA;g.object_type=s,g.sample_rate=r,g.channel_count=o,g.data=A;var c={codec:"mp3",data:g};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"mp3",object_type:s,sample_rate:r,channel_count:o},this.dispatchAudioInitSegment(c));var l={unit:A,length:A.byteLength,pts:e/this.timescale_,dts:e/this.timescale_};this.audio_track_&&(null===(t=this.audio_track_)||void 0===t||t.samples.push(l),this.audio_track_.length+=A.byteLength)}},e.prototype.detectAudioMetadataChange=function(A){var e,t,i,a;if(A.codec!==(null===(e=this.audio_metadata_)||void 0===e?void 0:e.codec))return n.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec," to ").concat(A.codec)),!0;if("aac"===A.codec&&"aac"===this.audio_metadata_.codec){if((o=A.data).audio_object_type!==this.audio_metadata_.audio_object_type)return n.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(o.audio_object_type)),!0;if(o.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return n.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(o.sampling_freq_index)),!0;if(o.channel_config!==this.audio_metadata_.channel_config)return n.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(i=this.audio_metadata_)||void 0===i?void 0:i.channel_config," to ").concat(o.channel_config)),!0}else if("ac-3"===A.codec&&"ac-3"===this.audio_metadata_.codec){var o;if((o=A.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return n.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(a=this.audio_metadata_)||void 0===a?void 0:a.sampling_frequency," to ").concat(o.sampling_frequency)),!0;if(o.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return n.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(o.bit_stream_identification)),!0;if(o.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return n.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(o.bit_stream_mode)),!0;if(o.channel_mode!==this.audio_metadata_.channel_mode)return n.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(o.channel_mode)),!0;if(o.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return n.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(o.low_frequency_effects_channel_on)),!0}else if("opus"===A.codec&&"opus"===this.audio_metadata_.codec){if((r=A.meta).sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(r.sample_rate)),!0;if(r.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(r.channel_count)),!0}else if("mp3"===A.codec&&"mp3"===this.audio_metadata_.codec){var r;if((r=A.data).object_type!==this.audio_metadata_.object_type)return n.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(r.object_type)),!0;if(r.sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(r.sample_rate)),!0;if(r.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(r.channel_count)),!0}return!1},e.prototype.dispatchAudioInitSegment=function(A){var e,t,i,a,o,r,s={type:"audio"};if(s.id=null===(e=this.audio_track_)||void 0===e?void 0:e.id,s.timescale=1e3,s.duration=this.duration_,"aac"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec)){var g="aac"===A.codec?A.data:null,c=new O(g);s.audioSampleRate=c.sampling_rate,s.channelCount=c.channel_count,s.codec=c.codec_mimetype,s.originalCodec=c.original_codec_mimetype,s.config=c.config,s.refSampleDuration=1024/s.audioSampleRate*s.timescale}else if("ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var l="ac-3"===A.codec?A.data:null,I=new uA(l);s.audioSampleRate=I.sampling_rate,s.channelCount=I.channel_count,s.codec=I.codec_mimetype,s.originalCodec=I.original_codec_mimetype,s.config=I.config,s.refSampleDuration=1536/s.audioSampleRate*s.timescale}else if("ec-3"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)){var C="ec-3"===A.codec?A.data:null,d=new QA(C);s.audioSampleRate=d.sampling_rate,s.channelCount=d.channel_count,s.codec=d.codec_mimetype,s.originalCodec=d.original_codec_mimetype,s.config=d.config,s.refSampleDuration=256*d.num_blks/s.audioSampleRate*s.timescale}else"opus"===(null===(o=this.audio_metadata_)||void 0===o?void 0:o.codec)?(s.audioSampleRate=this.audio_metadata_.sample_rate,s.channelCount=this.audio_metadata_.channel_count,s.channelConfigCode=this.audio_metadata_.channel_config_code,s.codec="opus",s.originalCodec="opus",s.config=void 0,s.refSampleDuration=20):"mp3"===(null===(r=this.audio_metadata_)||void 0===r?void 0:r.codec)&&(s.audioSampleRate=this.audio_metadata_.sample_rate,s.channelCount=this.audio_metadata_.channel_count,s.codec="mp3",s.originalCodec="mp3",s.config=void 0);this.audio_init_segment_dispatched_||n.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(s.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",s),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var h=this.media_info_;h.hasAudio=!0,h.audioCodec=s.originalCodec,h.audioSampleRate=s.audioSampleRate,h.audioChannelCount=s.channelCount,h.hasVideo&&h.videoCodec?h.mimeType='video/mp2t; codecs="'.concat(h.videoCodec,",").concat(h.audioCodec,'"'):h.mimeType='video/mp2t; codecs="'.concat(h.audioCodec,'"'),h.isComplete()&&this.onMediaInfo&&this.onMediaInfo(h)},e.prototype.dispatchPESPrivateDataDescriptor=function(A,e,t){var i=new W;i.pid=A,i.stream_type=e,i.descriptor=t,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(i)},e.prototype.parsePESPrivateDataPayload=function(A,e,t,i,n){var a=new j;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var o=Math.floor(e/this.timescale_);a.pts=o}else a.nearest_pts=this.aac_last_sample_pts_;if(void 0!==t){var r=Math.floor(t/this.timescale_);a.dts=r}this.onPESPrivateData&&this.onPESPrivateData(a)},e.prototype.parseTimedID3MetadataPayload=function(A,e,t,i,n){var a=new j;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var o=Math.floor(e/this.timescale_);a.pts=o}if(void 0!==t){var r=Math.floor(t/this.timescale_);a.dts=r}this.onTimedID3Metadata&&this.onTimedID3Metadata(a)},e.prototype.parseSMPTE2038MetadataPayload=function(A,e,t,i,n){var a=new IA;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var o=Math.floor(e/this.timescale_);a.pts=o}if(a.nearest_pts=this.aac_last_sample_pts_,void 0!==t){var r=Math.floor(t/this.timescale_);a.dts=r}a.ancillaries=function(A){for(var e=new C(A),t=0,i=[];t+=6,0===e.readBits(6);){var n=e.readBool();t+=1;var a=e.readBits(11);t+=11;var o=e.readBits(12);t+=12;var r=255&e.readBits(10);t+=10;var s=255&e.readBits(10);t+=10;var g=255&e.readBits(10);t+=10;for(var c=new Uint8Array(g),l=0;l>>24&255,n[1]=i>>>16&255,n[2]=i>>>8&255,n[3]=255&i,n.set(A,4);var s=8;for(r=0;r>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},A.trak=function(e){return A.box(A.types.trak,A.tkhd(e),A.mdia(e))},A.tkhd=function(e){var t=e.id,i=e.duration,n=e.presentWidth,a=e.presentHeight;return A.box(A.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>>8&255,255&n,0,0,a>>>8&255,255&a,0,0]))},A.mdia=function(e){return A.box(A.types.mdia,A.mdhd(e),A.hdlr(e),A.minf(e))},A.mdhd=function(e){var t=e.timescale,i=e.duration;return A.box(A.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))},A.hdlr=function(e){var t;return t="audio"===e.type?A.constants.HDLR_AUDIO:A.constants.HDLR_VIDEO,A.box(A.types.hdlr,t)},A.minf=function(e){var t;return t="audio"===e.type?A.box(A.types.smhd,A.constants.SMHD):A.box(A.types.vmhd,A.constants.VMHD),A.box(A.types.minf,t,A.dinf(),A.stbl(e))},A.dinf=function(){return A.box(A.types.dinf,A.box(A.types.dref,A.constants.DREF))},A.stbl=function(e){return A.box(A.types.stbl,A.stsd(e),A.box(A.types.stts,A.constants.STTS),A.box(A.types.stsc,A.constants.STSC),A.box(A.types.stsz,A.constants.STSZ),A.box(A.types.stco,A.constants.STCO))},A.stsd=function(e){return"audio"===e.type?"mp3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.mp3(e)):"ac-3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.ac3(e)):"ec-3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.ec3(e)):"opus"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.Opus(e)):A.box(A.types.stsd,A.constants.STSD_PREFIX,A.mp4a(e)):"video"===e.type&&e.codec.startsWith("hvc1")?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.hvc1(e)):"video"===e.type&&e.codec.startsWith("av01")?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.av01(e)):A.box(A.types.stsd,A.constants.STSD_PREFIX,A.avc1(e))},A.mp3=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types[".mp3"],n)},A.mp4a=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types.mp4a,n,A.esds(e))},A.ac3=function(e){var t,i=e.channelCount,n=e.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return A.box(A.types["ac-3"],a,A.box(A.types.dac3,new Uint8Array(null!==(t=e.config)&&void 0!==t?t:[])))},A.ec3=function(e){var t,i=e.channelCount,n=e.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return A.box(A.types["ec-3"],a,A.box(A.types.dec3,new Uint8Array(null!==(t=e.config)&&void 0!==t?t:[])))},A.esds=function(e){var t,i=null!==(t=e.config)&&void 0!==t?t:[],n=i.length,a=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(i).concat([6,1,2]));return A.box(A.types.esds,a)},A.Opus=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types.Opus,n,A.dOps(e))},A.dOps=function(e){var t=e.channelCount,i=e.channelConfigCode,n=e.audioSampleRate,a=[];switch(i){case 1:case 2:a=[0];break;case 0:a=[255,1,1,0,1];break;case 128:a=[255,2,0,0,1];break;case 3:a=[1,2,1,0,2,1];break;case 4:a=[1,2,2,0,1,2,3];break;case 5:a=[1,3,2,0,4,1,2,3];break;case 6:a=[1,4,2,0,4,1,2,3,5];break;case 7:a=[1,4,2,0,4,1,2,3,5,6];break;case 8:a=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:a=[1,1,2,0,1];break;case 131:a=[1,1,3,0,1,2];break;case 132:a=[1,1,4,0,1,2,3];break;case 133:a=[1,1,5,0,1,2,3,4];break;case 134:a=[1,1,6,0,1,2,3,4,5];break;case 135:a=[1,1,7,0,1,2,3,4,5,6];break;case 136:a=[1,1,8,0,1,2,3,4,5,6,7]}var o=new Uint8Array(function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n>>24&255,n>>>17&255,n>>>8&255,n>>>0&255,0,0],function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var i,n,a=t.call(A),o=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return o}(a),!1));return A.box(A.types.dOps,o)},A.avc1=function(e){var t=e.avcc,i=e.codecWidth,n=e.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.avc1,a,A.box(A.types.avcC,t))},A.hvc1=function(e){var t=e.hvcc,i=e.codecWidth,n=e.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.hvc1,a,A.box(A.types.hvcC,t))},A.av01=function(e){var t,i,n=e.av1c,a=null!==(t=e.codecWidth)&&void 0!==t?t:192,o=null!==(i=e.codecHeight)&&void 0!==i?i:108,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>>8&255,255&a,o>>>8&255,255&o,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.av01,r,A.box(A.types.av1C,n))},A.mvex=function(e){return A.box(A.types.mvex,A.trex(e))},A.trex=function(e){var t=e.id,i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return A.box(A.types.trex,i)},A.moof=function(e,t){return A.box(A.types.moof,A.mfhd(e.sequenceNumber),A.traf(e,t))},A.mfhd=function(e){var t=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return A.box(A.types.mfhd,t)},A.traf=function(e,t){var i=e.id,n=A.box(A.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=A.box(A.types.tfdt,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),o=A.sdtp(e),r=A.trun(e,o.byteLength+16+16+8+16+8+8);return A.box(A.types.traf,n,a,r,o)},A.sdtp=function(e){for(var t=e.samples||[],i=t.length,n=new Uint8Array(4+i),a=0;a>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0);for(var r=0;r>>24&255,s>>>16&255,s>>>8&255,255&s,g>>>24&255,g>>>16&255,g>>>8&255,255&g,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*r)}return A.box(A.types.trun,o)},A.mdat=function(e){return A.box(A.types.mdat,e)},A.constants={FTYP:new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),STSD_PREFIX:new Uint8Array([0,0,0,0,0,0,0,1]),STTS:DA,STSC:DA,STCO:DA,STSZ:new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),HDLR_VIDEO:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),HDLR_AUDIO:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),DREF:new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),SMHD:new Uint8Array([0,0,0,0,0,0,0,0]),VMHD:new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},A}();wA.init();const vA=wA,bA=function(){function A(){}return A.getSilentFrame=function(A,e){if("mp4a.40.2"===A){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},A}();var FA=t(453);const RA=function(){function A(A){var e;this.TAG="MP4Remuxer",this._fillSilentAfterSeek=!1,this._config=A,this._isLive=!!A.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new FA.Sc("audio"),this._videoSegmentInfoList=new FA.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!a.A.chrome||!(a.A.version&&a.A.version.major<50||a.A.version&&50===a.A.version.major&&((null===(e=a.A.version)||void 0===e?void 0:e.build)||0)<2661)),this._fillSilentAfterSeek=!(!a.A.msedge&&!a.A.msie),this._mp3UseMpegAudio=!a.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return A.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},A.prototype.bindDataSource=function(A){var e;return A.onDataAvailable=null===(e=this.remux)||void 0===e?void 0:e.bind(this),A.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(A.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(A){this._onInitSegment=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(A){this._onMediaSegment=A},enumerable:!1,configurable:!0}),A.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},A.prototype.seek=function(A){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},A.prototype.remux=function(A,e){if(!this._onMediaSegment)throw new c.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(A,e),e&&this._remuxVideo(e),A&&this._remuxAudio(A)},A.prototype._onTrackMetadataReceived=function(A,e){var t=null,i="mp4",n=e.codec;if("audio"===A)this._audioMeta=e,"mp3"===e.codec&&this._mp3UseMpegAudio?(i="mpeg",n="",t=new Uint8Array):t=vA.generateInitSegment(e);else{if("video"!==A)return;this._videoMeta=e,t=vA.generateInitSegment(e)}if(!this._onInitSegment)throw new c.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(A,{type:A,data:t.buffer,codec:n,container:"".concat(A,"/").concat(i),mediaDuration:e.duration})},A.prototype._calculateDtsBase=function(A,e){var t,i;this._dtsBaseInited||((null===(t=null==A?void 0:A.samples)||void 0===t?void 0:t.length)&&(this._audioDtsBase=A.samples[0].dts),(null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._videoDtsBase=e.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},A.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},A.prototype.flushStashedSamples=function(){var A=this._videoStashedLastSample,e=this._audioStashedLastSample,t={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=A&&(t.samples.push(A),t.length=null==A?void 0:A.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=null==e?void 0:e.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(t,!0),this._remuxAudio(i,!0)},A.prototype._remuxAudio=function(A,e){var t,i,o,r,s,g,c;if(null!=this._audioMeta){var l,I,C=A,d=C.samples,h=-1,B=this._audioMeta.refSampleDuration,u="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,E=this._dtsBaseInited&&void 0===this._audioNextDts,f=!1;if(d&&0!==d.length&&(1!==d.length||e)){var Q=0,x=null,p=0;u?(Q=0,p=C.length):(Q=8,p=8+C.length);var m=null;if(d.length>1&&(p-=(m=d.pop()).length),null!=this._audioStashedLastSample){var y=this._audioStashedLastSample;this._audioStashedLastSample=null,d.unshift(y),p+=y.length}null!=m&&(this._audioStashedLastSample=m);var _=d[0].dts-this._dtsBase;if(this._audioNextDts)l=_-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())l=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(f=!0);else{var S=this._audioSegmentInfoList.getLastSampleBefore(_);if(null!=S){var D=_-(S.originalDts+S.duration);D<=3&&(D=0),l=_-(S.dts+S.duration+D)}else l=0}if(f){var w=_-l,v=this._videoSegmentInfoList.getLastSegmentBefore(_);if(null!=v&&v.beginDts=3*(B||0)&&this._fillAudioTimestampGap&&!a.A.safari){T=!0;var G,U=Math.floor(l/(B||0));n.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(N," ms, curRefDts: ").concat(Y," ms, ")+"dtsCorrection: ".concat(Math.round(l)," ms, generate: ").concat(U," frames")),b=Math.floor(Y),L=Math.floor(Y+(B||0))-b,null==(G=bA.getSilentFrame(null===(o=this._audioMeta)||void 0===o?void 0:o.originalCodec,this._audioMeta.channelCount))&&(n.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(r=this._audioMeta)||void 0===r?void 0:r.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),G=P),M=[];for(var J=0;J=1?null===(s=R[R.length-1])||void 0===s?void 0:s.duration:Math.floor(B||0),this._audioNextDts=b+L;-1===h&&(h=b),R.push({dts:b,pts:b,cts:0,unit:y.unit,size:null===(g=y.unit)||void 0===g?void 0:g.byteLength,duration:L,originalDts:N,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),T&&R.push.apply(R,M)}}if(0===R.length)return C.samples=[],void(C.length=0);for(u?x=new Uint8Array(p):((x=new Uint8Array(p))[0]=p>>>24&255,x[1]=p>>>16&255,x[2]=p>>>8&255,x[3]=255&p,x.set(vA.types.mdat,4)),k=0;k1&&(C-=(d=s.pop()).length),null!=this._videoStashedLastSample){var h=this._videoStashedLastSample;this._videoStashedLastSample=null,s.unshift(h),C+=(null==h?void 0:h.length)||0}null!=d&&(this._videoStashedLastSample=d);var B=s[0].dts-this._dtsBase;if(this._videoNextDts)n=B-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())n=0;else{var u=this._videoSegmentInfoList.getLastSampleBefore(B);if(null!=u){var E=B-(u.originalDts+u.duration);E<=3&&(E=0),n=B-(u.dts+u.duration+E)}else n=0}for(var f=new FA.EZ,Q=[],x=0;x=1?Q[Q.length-1].duration:Math.floor((null===(t=this._videoMeta)||void 0===t?void 0:t.refSampleDuration)||0),m){var w=new FA.$_(y,S,D,h.dts,!0);w.fileposition=h.fileposition,f.appendSyncPoint(w)}Q.push({dts:y,pts:S,cts:_,units:h.units,size:h.length,isKeyframe:m,duration:D,originalDts:p,flags:{isLeading:0,dependsOn:m?2:1,isDependedOn:m?1:0,hasRedundancy:0,isNonSync:m?0:1}})}for((I=new Uint8Array(C))[0]=C>>>24&255,I[1]=C>>>16&255,I[2]=C>>>8&255,I[3]=255&C,I.set(vA.types.mdat,4),x=0;x0)null===(t=this._demuxer)||void 0===t||t.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(i=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===i?void 0:i.timestampBase:0,g=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(A,e))||0;else{var c=null;(c=m.probe(A)).match&&(this._setupFLVDemuxerRemuxer(c),g=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(A,e))||0),c.match||(null==c?void 0:c.needMoreData)||(c=SA.probe(A)).match&&(this._setupTSDemuxerRemuxer(c),g=(null===(r=this._demuxer)||void 0===r?void 0:r.parseChunks(A,e))||0),c.match||(null==c?void 0:c.needMoreData)||(c=null,n.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){s._internalAbort()})),this._emitter.emit(PA.A.DEMUX_ERROR,h.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return g},A.prototype._setupFLVDemuxerRemuxer=function(A){var e;this._demuxer=new m(A,this._config),this._remuxer||(this._remuxer=new RA(this._config));var t=this._mediaDataSource;void 0===t.duration||isNaN(t.duration)||(this._demuxer.overridedDuration=t.duration),"boolean"==typeof t.hasAudio&&(this._demuxer.overridedHasAudio=t.hasAudio),"boolean"==typeof t.hasVideo&&(this._demuxer.overridedHasVideo=t.hasVideo),t.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(e=null==t?void 0:t.segments[this._currentSegmentIndex])||void 0===e?void 0:e.timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this))},A.prototype._setupTSDemuxerRemuxer=function(A){var e=this._demuxer=new SA(A,this._config);this._remuxer||(this._remuxer=new RA(this._config)),e.onError=this._onDemuxException.bind(this),e.onMediaInfo=this._onMediaInfo.bind(this),e.onMetaDataArrived=this._onMetaDataArrived.bind(this),e.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),e.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),e.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),e.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),e.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},A.prototype._onMediaInfo=function(A){var e,t,i=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},A),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(t=null===(e=this._mediaDataSource)||void 0===e?void 0:e.segments)||void 0===t?void 0:t.length)||0,Object.setPrototypeOf(this._mediaInfo,o.A.prototype));var n=Object.assign({},A);Object.setPrototypeOf(n,o.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=n),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var A=i._pendingSeekTime;i._pendingSeekTime=null,i.seek(A)}))},A.prototype._onMetaDataArrived=function(A){this._emitter.emit(PA.A.METADATA_ARRIVED,A)},A.prototype._onScriptDataArrived=function(A){this._emitter.emit(PA.A.SCRIPTDATA_ARRIVED,A)},A.prototype._onTimedID3Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.dts&&(A.dts-=t),this._emitter.emit(PA.A.TIMED_ID3_METADATA_ARRIVED,A))},A.prototype._onSMPTE2038Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.dts&&(A.dts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),this._emitter.emit(PA.A.SMPTE2038_METADATA_ARRIVED,A))},A.prototype._onSCTE35Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),this._emitter.emit(PA.A.SCTE35_METADATA_ARRIVED,A))},A.prototype._onPESPrivateDataDescriptor=function(A){this._emitter.emit(PA.A.PES_PRIVATE_DATA_DESCRIPTOR,A)},A.prototype._onPESPrivateData=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),void 0!==A.dts&&(A.dts-=t),this._emitter.emit(PA.A.PES_PRIVATE_DATA_ARRIVED,A))},A.prototype._onIOSeeked=function(){var A;null===(A=this._remuxer)||void 0===A||A.insertDiscontinuity()},A.prototype._onIOComplete=function(A){var e,t,i=A+1;i<((null===(t=null===(e=this._mediaDataSource)||void 0===e?void 0:e.segments)||void 0===t?void 0:t.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(i)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(PA.A.LOADING_COMPLETE),this._disableStatisticsReporter())},A.prototype._onIORedirect=function(A){var e,t=null===(e=this._ioctl)||void 0===e?void 0:e.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[t].redirectedURL=A)},A.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(PA.A.RECOVERED_EARLY_EOF)},A.prototype._onIOException=function(A,e){n.A.e(this.TAG,"IOException: type = ".concat(A,", code = ").concat(e.code,", msg = ").concat(e.msg)),this._emitter.emit(PA.A.IO_ERROR,A,e),this._disableStatisticsReporter()},A.prototype._onDemuxException=function(A,e){n.A.e(this.TAG,"DemuxException: type = ".concat(A,", info = ").concat(e)),this._emitter.emit(PA.A.DEMUX_ERROR,A,e)},A.prototype._onRemuxerInitSegmentArrival=function(A,e){this._emitter.emit(PA.A.INIT_SEGMENT,A,e)},A.prototype._onRemuxerMediaSegmentArrival=function(A,e){if(null==this._pendingSeekTime&&(this._emitter.emit(PA.A.MEDIA_SEGMENT,A,e),null!=this._pendingResolveSeekPoint&&"video"===A)){var t=e.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,a.A.safari&&t.length>0&&t[0].originalDts===i&&(i=t[0].pts),this._emitter.emit(PA.A.RECOMMEND_SEEKPOINT,i)}},A.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},A.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},A.prototype._reportSegmentMediaInfo=function(A){var e,t,i,n,a=(null===(e=this._mediaInfo)||void 0===e?void 0:e.segments)?null===(t=this._mediaInfo)||void 0===t?void 0:t.segments[A]:{},o=Object.assign({},a);o.duration=null===(i=this._mediaInfo)||void 0===i?void 0:i.duration,o.segmentCount=null===(n=this._mediaInfo)||void 0===n?void 0:n.segmentCount,delete o.segments,delete o.keyframesIndex,this._emitter.emit(PA.A.MEDIA_INFO,o)},A.prototype._reportStatisticsInfo=function(){var A,e,t,i,n,a,o={};o.url=null===(A=this._ioctl)||void 0===A?void 0:A.currentURL,o.hasRedirect=null===(e=this._ioctl)||void 0===e?void 0:e.hasRedirect,o.hasRedirect&&(o.redirectedURL=null===(t=this._ioctl)||void 0===t?void 0:t.currentRedirectedURL),o.speed=null===(i=this._ioctl)||void 0===i?void 0:i.currentSpeed,o.loaderType=null===(n=this._ioctl)||void 0===n?void 0:n.loaderType,o.currentSegmentIndex=this._currentSegmentIndex,o.totalSegmentCount=null===(a=this._mediaDataSource.segments)||void 0===a?void 0:a.length,this._emitter.emit(PA.A.STATISTICS_INFO,o)},A}()},716:(A,e,t)=>{t.d(e,{A:()=>i});const i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},291:(A,e,t)=>{var i=t(641),n=t(976),a=t(716),o=null,r=function(A,e){self.postMessage({msg:"logcat_callback",data:{type:A,logcat:e}})};function s(A,e){var t={msg:a.A.INIT_SEGMENT,data:{type:A,data:e}};self.postMessage(t,[e.data])}function g(A,e){var t={msg:a.A.MEDIA_SEGMENT,data:{type:A,data:e}};self.postMessage(t,[e.data])}function c(){var A={msg:a.A.LOADING_COMPLETE};self.postMessage(A)}function l(){var A={msg:a.A.RECOVERED_EARLY_EOF};self.postMessage(A)}function I(A){var e={msg:a.A.MEDIA_INFO,data:A};self.postMessage(e)}function C(A){var e={msg:a.A.METADATA_ARRIVED,data:A};self.postMessage(e)}function d(A){var e={msg:a.A.SCRIPTDATA_ARRIVED,data:A};self.postMessage(e)}function h(A){var e={msg:a.A.TIMED_ID3_METADATA_ARRIVED,data:A};self.postMessage(e)}function B(A){var e={msg:a.A.SMPTE2038_METADATA_ARRIVED,data:A};self.postMessage(e)}function u(A){var e={msg:a.A.SCTE35_METADATA_ARRIVED,data:A};self.postMessage(e)}function E(A){var e={msg:a.A.PES_PRIVATE_DATA_DESCRIPTOR,data:A};self.postMessage(e)}function f(A){var e={msg:a.A.PES_PRIVATE_DATA_ARRIVED,data:A};self.postMessage(e)}function Q(A){var e={msg:a.A.STATISTICS_INFO,data:A};self.postMessage(e)}function x(A,e){self.postMessage({msg:a.A.IO_ERROR,data:{type:A,info:e}})}function p(A,e){self.postMessage({msg:a.A.DEMUX_ERROR,data:{type:A,info:e}})}function m(A){self.postMessage({msg:a.A.RECOMMEND_SEEKPOINT,data:A})}self.addEventListener("message",(function(A){switch(A.data.cmd){case"init":(o=new n.A(A.data.param[0],A.data.param[1])).on(a.A.IO_ERROR,x),o.on(a.A.DEMUX_ERROR,p),o.on(a.A.INIT_SEGMENT,s),o.on(a.A.MEDIA_SEGMENT,g),o.on(a.A.LOADING_COMPLETE,c),o.on(a.A.RECOVERED_EARLY_EOF,l),o.on(a.A.MEDIA_INFO,I),o.on(a.A.METADATA_ARRIVED,C),o.on(a.A.SCRIPTDATA_ARRIVED,d),o.on(a.A.TIMED_ID3_METADATA_ARRIVED,h),o.on(a.A.SMPTE2038_METADATA_ARRIVED,B),o.on(a.A.SCTE35_METADATA_ARRIVED,u),o.on(a.A.PES_PRIVATE_DATA_DESCRIPTOR,E),o.on(a.A.PES_PRIVATE_DATA_ARRIVED,f),o.on(a.A.STATISTICS_INFO,Q),o.on(a.A.RECOMMEND_SEEKPOINT,m);break;case"destroy":o&&(o.destroy(),o=null),self.postMessage({msg:"destroyed"});break;case"start":null==o||o.start();break;case"stop":null==o||o.stop();break;case"seek":null==o||o.seek(A.data.param);break;case"pause":null==o||o.pause();break;case"resume":null==o||o.resume();break;case"logging_config":var e=A.data.param;i.A.applyConfig(e),!0===e.enableCallback?i.A.addLogListener(r):i.A.removeLogListener(r)}}))},465:(A,e,t)=>{t.d(e,{A:()=>i});const i={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},133:(A,e,t)=>{t.d(e,{default:()=>K});var i={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},n=t(302),a={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function o(){return Object.assign({},a)}var r=function(){function A(){}return A.supportMSEH264Playback=function(){var A;return null===(A=window.MediaSource)||void 0===A?void 0:A.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},A.supportMSEH265Playback=function(){var A;return null===(A=window.MediaSource)||void 0===A?void 0:A.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},A.supportNetworkStreamIO=function(){var A=new n.A({},o()),e=A.loaderType;return A.destroy(),"fetch-stream-loader"===e||"xhr-moz-chunked-loader"===e},A.getNetworkLoaderTypeName=function(){var A=new n.A({},o()),e=A.loaderType;return A.destroy(),e},A.supportNativeMediaPlayback=function(e){void 0===A.videoElement&&(A.videoElement=window.document.createElement("video"));var t=A.videoElement.canPlayType(e);return"probably"===t||"maybe"===t},A.getFeatureList=function(){var e={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return e.msePlayback=A.supportMSEH264Playback(),e.networkStreamIO=A.supportNetworkStreamIO(),e.networkLoaderName=A.getNetworkLoaderTypeName()||"",e.mseLivePlayback=e.msePlayback&&e.networkStreamIO,e.mseH265Playback=A.supportMSEH265Playback(),e.nativeMP4H264Playback=A.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),e.nativeMP4H265Playback=A.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),e.nativeWebmVP8Playback=A.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),e.nativeWebmVP9Playback=A.supportNativeMediaPlayback('video/webm; codecs="vp9"'),e},A}();const s=r;var g=t(288),c=t(413),l=t(502),I=t(620);const C={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",DESTROYING:"destroying"},d=function(){const A=ENTRY_MODULE,e={};function t(i){if(e[i])return e[i].exports;const n=e[i]={exports:{}};return A[i](n,n.exports,t),n.exports}t.m=A,t.n=A=>{const e=A&&A.__esModule?()=>A.default:()=>A;return t.d(e,{a:e}),e},t.d=(A,e)=>{for(const i in e)t.o(e,i)&&!t.o(A,i)&&Object.defineProperty(A,i,{enumerable:!0,get:e[i]})},t.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(A){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};const i=t(ENTRY_MODULE);return i.default||i};d.toString();const h="[\\.|\\-|\\+|\\w|/|@]+",B="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+h+").*?\\)";function u(A){return(A+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function E(A){return!isNaN(1*A)}function f(A,e,i){const n={};n[i]=[];const a=e.toString(),o=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!o)return n;const r=o[1];let s,g=new RegExp("(\\\\n|\\W)"+u(r)+B,"g");for(;s=g.exec(a);)"dll-reference"!==s[3]&&n[i].push(s[3]);for(g=new RegExp("\\("+u(r)+'\\("(dll-reference\\s('+h+'))"\\)\\)'+B,"g");s=g.exec(a);)A[s[2]]||(n[i].push(s[1]),A[s[2]]=t(s[1]).m),n[s[2]]=n[s[2]]||[],n[s[2]].push(s[4]);const c=Object.keys(n);for(let A=0;Ae||A[t].length>0),!1)}function x(A,e,t,i){const n=A[i].map((A=>`"${A}": ${e[i][A].toString()}`)).join(","),a=d.toString().split("ENTRY_MODULE");return`${a[0]}{${n}}${a[1]}"${t}"${a[2]}`}function p(A,e){e=e||{};const i={main:t.m},n=e.all?{main:Object.keys(i.main)}:function(A,e){const t={main:[e]},i={main:[]},n={main:{}};for(;Q(t);){const e=Object.keys(t);for(let a=0;a"main"!==A)).forEach((A=>{let e=0;for(;n[A][e];)e++;n[A].push(e),i[A][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a+=`var ${A} = (${x(n,i,e,modules)})();\n`})),a+=`(${x(n,i,A,"main")})();`;const o=new window.Blob([a],{type:"text/javascript"});if(e.bare)return o;const r=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(o),s=new window.Worker(r);return s.objectURL=r,s}var m=t(641),y=t(976),_=t(716),S=t(825),D=function(){function A(A,e){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new c.A,e.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=p(291),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[A,e]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},m.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:m.A.getConfig()})}catch(t){l.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new y.A(A,e)}else this._controller=new y.A(A,e);if(this._controller){var t=this._controller;null==t||t.on(_.A.IO_ERROR,this._onIOError.bind(this)),null==t||t.on(_.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==t||t.on(_.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==t||t.on(_.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==t||t.on(_.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==t||t.on(_.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==t||t.on(_.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==t||t.on(_.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==t||t.on(_.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==t||t.on(_.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==t||t.on(_.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==t||t.on(_.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==t||t.on(_.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==t||t.on(_.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==t||t.on(_.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==t||t.on(_.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return A.prototype.destroy=function(){var A;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),m.A.removeListener(this.e.onLoggingConfigChanged),this.e=null):(null===(A=this._controller)||void 0===A||A.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.hasWorker=function(){return null!=this._worker},A.prototype.open=function(){var A;this._worker?this._worker.postMessage({cmd:"start"}):null===(A=this._controller)||void 0===A||A.start()},A.prototype.close=function(){var A;this._worker?this._worker.postMessage({cmd:"stop"}):null===(A=this._controller)||void 0===A||A.stop()},A.prototype.seek=function(A){var e;this._worker?this._worker.postMessage({cmd:"seek",param:A}):null===(e=this._controller)||void 0===e||e.seek(A)},A.prototype.pause=function(){var A;this._worker?this._worker.postMessage({cmd:"pause"}):null===(A=this._controller)||void 0===A||A.pause()},A.prototype.resume=function(){var A;this._worker?this._worker.postMessage({cmd:"resume"}):null===(A=this._controller)||void 0===A||A.resume()},A.prototype._onInitSegment=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.INIT_SEGMENT,A,e)}))},A.prototype._onMediaSegment=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.MEDIA_SEGMENT,A,e)}))},A.prototype._onLoadingComplete=function(){var A=this;Promise.resolve().then((function(){A._emitter.emit(_.A.LOADING_COMPLETE)}))},A.prototype._onRecoveredEarlyEof=function(){var A=this;Promise.resolve().then((function(){A._emitter.emit(_.A.RECOVERED_EARLY_EOF)}))},A.prototype._onMediaInfo=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.MEDIA_INFO,A)}))},A.prototype._onMetaDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.METADATA_ARRIVED,A)}))},A.prototype._onScriptDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SCRIPTDATA_ARRIVED,A)}))},A.prototype._onTimedID3MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.TIMED_ID3_METADATA_ARRIVED,A)}))},A.prototype._onSMPTE2038MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SMPTE2038_METADATA_ARRIVED,A)}))},A.prototype._onSCTE35MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SCTE35_METADATA_ARRIVED,A)}))},A.prototype._onPESPrivateDataDescriptor=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.PES_PRIVATE_DATA_DESCRIPTOR,A)}))},A.prototype._onPESPrivateDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.PES_PRIVATE_DATA_ARRIVED,A)}))},A.prototype._onStatisticsInfo=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.STATISTICS_INFO,A)}))},A.prototype._onIOError=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.IO_ERROR,A,e)}))},A.prototype._onDemuxError=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.DEMUX_ERROR,A,e)}))},A.prototype._onRecommendSeekpoint=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.RECOMMEND_SEEKPOINT,A)}))},A.prototype._onLoggingConfigChanged=function(A){this._worker&&this._worker.postMessage({cmd:"logging_config",param:A})},A.prototype._onWorkerMessage=function(A){var e=A.data,t=null==e?void 0:e.data;if("destroyed"===e.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(e.msg){case _.A.INIT_SEGMENT:case _.A.MEDIA_SEGMENT:this._emitter.emit(e.msg,t.type,t.data);break;case _.A.LOADING_COMPLETE:case _.A.RECOVERED_EARLY_EOF:this._emitter.emit(e.msg);break;case _.A.MEDIA_INFO:Object.setPrototypeOf(t,S.A.prototype),this._emitter.emit(e.msg,t);break;case _.A.METADATA_ARRIVED:case _.A.SCRIPTDATA_ARRIVED:case _.A.TIMED_ID3_METADATA_ARRIVED:case _.A.SMPTE2038_METADATA_ARRIVED:case _.A.SCTE35_METADATA_ARRIVED:case _.A.PES_PRIVATE_DATA_DESCRIPTOR:case _.A.PES_PRIVATE_DATA_ARRIVED:case _.A.STATISTICS_INFO:this._emitter.emit(e.msg,t);break;case _.A.IO_ERROR:case _.A.DEMUX_ERROR:this._emitter.emit(e.msg,t.type,t.info);break;case _.A.RECOMMEND_SEEKPOINT:this._emitter.emit(e.msg,t);break;case"logcat_callback":l.A.emitter.emit("log",t.type,t.logcat)}},A}();const w=D,v="error",b="source_open",F="update_end",R="buffer_full";var k=t(453),P=t(713),N=function(){function A(A){this.TAG="MSEController",this._config=A,this._emitter=new c.A,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new k.EX}return A.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.attachMediaElement=function(A){if(this._mediaSource)throw new P.j4("MediaSource has been attached to an HTMLMediaElement!");var e=this._mediaSource=new window.MediaSource;e.addEventListener("sourceopen",this.e.onSourceOpen),e.addEventListener("sourceended",this.e.onSourceEnded),e.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=A,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),A.src=this._mediaSourceObjectURL},A.prototype.detachMediaElement=function(){if(this._mediaSource){var A=this._mediaSource;for(var e in this._sourceBuffers){var t=this._pendingSegments[e];t.splice(0,t.length),this._pendingSegments[e]=null,this._pendingRemoveRanges[e]=null,this._lastInitSegments[e]=null;var i=this._sourceBuffers[e];if(i){if("closed"!==A.readyState){try{A.removeSourceBuffer(i)}catch(A){l.A.e(this.TAG,A.message)}null==i||i.removeEventListener("error",this.e.onSourceBufferError),null==i||i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[e]=null,this._sourceBuffers[e]=null}}if("open"===A.readyState)try{A.endOfStream()}catch(A){l.A.e(this.TAG,A.message)}A.removeEventListener("sourceopen",this.e.onSourceOpen),A.removeEventListener("sourceended",this.e.onSourceEnded),A.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},A.prototype.appendInitSegment=function(A,e){var t;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(A),void this._pendingSegments[A.type].push(A);var i=A,n="".concat(i.container);i.codec&&i.codec.length>0&&(n+=";codecs=".concat(i.codec));var a=!1;if(l.A.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])l.A.v(this.TAG,"Notice: ".concat(i.type," mimeType changed, origin: ").concat(this._mimeTypes[i.type]||"",", target: ").concat(n));else{a=!0;try{var o=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);o.addEventListener("error",this.e.onSourceBufferError),o.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(A){return l.A.e(this.TAG,A.message),void this._emitter.emit(v,{code:A.code,msg:A.message})}}this._mimeTypes[i.type]=n}e||this._pendingSegments[i.type].push(i),a||this._sourceBuffers[i.type]&&!(null===(t=this._sourceBuffers[i.type])||void 0===t?void 0:t.updating)&&this._doAppendSegments(),I.A.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())},A.prototype.appendMediaSegment=function(A){var e=A;this._pendingSegments[e.type].push(e),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var t=this._sourceBuffers[e.type];!t||t.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},A.prototype.seek=function(A){var e,t;for(var i in this._sourceBuffers)if(this._sourceBuffers[i]){var n=this._sourceBuffers[i];if("open"===(null===(e=this._mediaSource)||void 0===e?void 0:e.readyState))try{null==n||n.abort()}catch(A){l.A.e(this.TAG,A.message)}this._idrList.clear();var a=this._pendingSegments[i];if(a.splice(0,a.length),"closed"!==(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState)){if(n){for(var o=0;o=1&&t-a.start(0)>=((null===(e=this._config)||void 0===e?void 0:e.autoCleanupMaxBackwardDuration)||0))return!0}}return!1},A.prototype._doCleanupSourceBuffer=function(){var A,e,t,i=null===(A=this._mediaElement)||void 0===A?void 0:A.currentTime;for(var n in this._sourceBuffers){var a=this._sourceBuffers[n];if(a){for(var o=a.buffered,r=!1,s=0;s=((null===(e=this._config)||void 0===e?void 0:e.autoCleanupMaxBackwardDuration)||0)){r=!0;var l=i-((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[n].push({start:g,end:l})}}else c0&&(isNaN(a)||o>a)&&(l.A.v(this.TAG,"Update MediaSource duration from ".concat(a," to ").concat(o)),this._mediaSource.duration=o),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},A.prototype._doRemoveRanges=function(){var A;for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!(null===(A=this._sourceBuffers[e])||void 0===A?void 0:A.updating))for(var t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];i.length&&!(null==t?void 0:t.updating);){var n=i.shift();null==t||t.remove(n.start,n.end)}},A.prototype._doAppendSegments=function(){var A,e,t,i=this._pendingSegments;for(var n in i)if(this._sourceBuffers[n]&&!(null===(A=this._sourceBuffers[n])||void 0===A?void 0:A.updating)&&i[n].length>0){var a=i[n].shift();if(null==a?void 0:a.timestampOffset){var o=(null===(e=this._sourceBuffers[n])||void 0===e?void 0:e.timestampOffset)||0,r=a.timestampOffset/1e3;Math.abs(o-r)>.1&&(l.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(o," to ").concat(r)),this._sourceBuffers[n]&&(this._sourceBuffers[n].timestampOffset=r)),delete a.timestampOffset}if(!a.data||0===a.data.byteLength)continue;try{null===(t=this._sourceBuffers[n])||void 0===t||t.appendBuffer(a.data),this._isBufferFull=!1,"video"===n&&a.hasOwnProperty("info")&&this._idrList.appendArray(a.info.syncPoints)}catch(A){this._pendingSegments[n].unshift(a),22===A.code?(this._isBufferFull||this._emitter.emit(R),this._isBufferFull=!0):(l.A.e(this.TAG,A.message),this._emitter.emit(v,{code:A.code,msg:A.message}))}}},A.prototype._onSourceOpen=function(){var A;if(l.A.v(this.TAG,"MediaSource onSourceOpen"),null===(A=this._mediaSource)||void 0===A||A.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(b)},A.prototype._onSourceEnded=function(){l.A.v(this.TAG,"MediaSource onSourceEnded")},A.prototype._onSourceClose=function(){l.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},A.prototype._hasPendingSegments=function(){var A=this._pendingSegments;return A.video.length>0||A.audio.length>0},A.prototype._hasPendingRemoveRanges=function(){var A=this._pendingRemoveRanges;return A.video.length>0||A.audio.length>0},A.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(F)},A.prototype._onSourceBufferError=function(A){l.A.e(this.TAG,"SourceBuffer Error: ".concat(A))},A}();const T=N;var M=t(465),L={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Y={NETWORK_EXCEPTION:g.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:g.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:g.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:g.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:M.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:M.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:M.A.CODEC_UNSUPPORTED},G=function(){function A(A,e){var t,i,n;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new c.A,this._config=o(),"object"==typeof e&&Object.assign(this._config,e);var a=A.type.toLowerCase();if("mse"!==a&&"mpegts"!==a&&"m2ts"!==a&&"flv"!==a)throw new P.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");A.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=A,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var r=I.A.chrome&&(I.A.version&&(null===(t=I.A.version)||void 0===t?void 0:t.major)<50||I.A.version&&50===(null===(i=null===I.A||void 0===I.A?void 0:I.A.version)||void 0===i?void 0:i.major)&&((null===(n=null===I.A||void 0===I.A?void 0:I.A.version)||void 0===n?void 0:n.build)||-1)<2661);this._alwaysSeekKeyframe=!!(r||I.A.msedge||I.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return A.prototype.destroy=function(){this._emitter.emit(C.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){var t=this;A===C.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){t._emitter.emit(C.MEDIA_INFO,t.mediaInfo)})):A===C.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){t._emitter.emit(C.STATISTICS_INFO,t.statisticsInfo)})),this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.attachMediaElement=function(A){var e,t,i,n,a,o=this;if(this._mediaElement=A,A.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),A.addEventListener("seeking",this.e.onvSeeking),A.addEventListener("canplay",this.e.onvCanPlay),A.addEventListener("stalled",this.e.onvStalled),A.addEventListener("progress",this.e.onvProgress),this._msectl=new T(this._config),null===(e=this._msectl)||void 0===e||e.on(F,this._onmseUpdateEnd.bind(this)),null===(t=this._msectl)||void 0===t||t.on(R,this._onmseBufferFull.bind(this)),null===(i=this._msectl)||void 0===i||i.on(b,(function(){o._mseSourceOpened=!0,o._hasPendingLoad&&(o._hasPendingLoad=!1,o.load())})),null===(n=this._msectl)||void 0===n||n.on(v,(function(A){o._emitter.emit(C.ERROR,L.MEDIA_ERROR,Y.MEDIA_MSE_ERROR,A)})),null===(a=this._msectl)||void 0===a||a.attachMediaElement(A),null!=this._pendingSeekTime)try{A.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(A){}},A.prototype.detachMediaElement=function(){var A;this._mediaElement&&(null===(A=this._msectl)||void 0===A||A.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},A.prototype.load=function(){var A=this;if(!this._mediaElement)throw new P.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new P.j4("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(!this._config.deferLoadAfterSourceOpen||this._mseSourceOpened?(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new w(this._mediaDataSource,this._config),this._transmuxer.on(_.A.INIT_SEGMENT,(function(e,t){var i;null===(i=A._msectl)||void 0===i||i.appendInitSegment(t)})),this._transmuxer.on(_.A.MEDIA_SEGMENT,(function(e,t){var i,n,a;if(null===(i=A._msectl)||void 0===i||i.appendMediaSegment(t),A._config.lazyLoad&&!A._config.isLive){var o=null===(n=A._mediaElement)||void 0===n?void 0:n.currentTime;t.info.endDts>=1e3*(o+((null===(a=A._config)||void 0===a?void 0:a.lazyLoadMaxDuration)||0))&&null==A._progressChecker&&(l.A.v(A.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),A._suspendTransmuxer())}})),this._transmuxer.on(_.A.LOADING_COMPLETE,(function(){var e;null===(e=A._msectl)||void 0===e||e.endOfStream(),A._emitter.emit(C.LOADING_COMPLETE)})),this._transmuxer.on(_.A.RECOVERED_EARLY_EOF,(function(){A._emitter.emit(C.RECOVERED_EARLY_EOF)})),this._transmuxer.on(_.A.IO_ERROR,(function(e,t){A._emitter.emit(C.ERROR,L.NETWORK_ERROR,e,t)})),this._transmuxer.on(_.A.DEMUX_ERROR,(function(e,t){A._emitter.emit(C.ERROR,L.MEDIA_ERROR,e,{code:-1,msg:t})})),this._transmuxer.on(_.A.MEDIA_INFO,(function(e){A._mediaInfo=e,A._emitter.emit(C.MEDIA_INFO,Object.assign({},e))})),this._transmuxer.on(_.A.METADATA_ARRIVED,(function(e){A._emitter.emit(C.METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SCRIPTDATA_ARRIVED,(function(e){A._emitter.emit(C.SCRIPTDATA_ARRIVED,e)})),this._transmuxer.on(_.A.TIMED_ID3_METADATA_ARRIVED,(function(e){A._emitter.emit(C.TIMED_ID3_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SMPTE2038_METADATA_ARRIVED,(function(e){A._emitter.emit(C.SMPTE2038_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SCTE35_METADATA_ARRIVED,(function(e){A._emitter.emit(C.SCTE35_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(e){A._emitter.emit(C.PES_PRIVATE_DATA_DESCRIPTOR,e)})),this._transmuxer.on(_.A.PES_PRIVATE_DATA_ARRIVED,(function(e){A._emitter.emit(C.PES_PRIVATE_DATA_ARRIVED,e)})),this._transmuxer.on(_.A.STATISTICS_INFO,(function(e){A._statisticsInfo=A._fillStatisticsInfo(e),A._emitter.emit(C.STATISTICS_INFO,Object.assign({},A._statisticsInfo))})),this._transmuxer.on(_.A.RECOMMEND_SEEKPOINT,(function(e){A._mediaElement&&!A._config.accurateSeek&&(A._requestSetTime=!0,A._mediaElement.currentTime=e/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)},A.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},A.prototype.play=function(){var A;return function(A,e,t,i){return new(t||(t=Promise))((function(n,a){function o(A){try{s(i.next(A))}catch(A){a(A)}}function r(A){try{s(i.throw(A))}catch(A){a(A)}}function s(A){var e;A.done?n(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(o,r)}s((i=i.apply(A,e||[])).next())}))}(this,void 0,void 0,(function(){return function(A,e){var t,i,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(s){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(o=0)),o;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]0&&!(null===(t=this._mediaElement)||void 0===t?void 0:t.paused)){var o=n.end(n.length-1);if(o>((null===(i=this._config)||void 0===i?void 0:i.liveBufferLatencyMaxLatency)||0)&&o-a>(this._config.liveBufferLatencyMaxLatency||0)){var r=o-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=r}}if(this._config.lazyLoad&&!this._config.isLive){for(var s=0,g=0;g=a+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(l.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},A.prototype._onmseBufferFull=function(){l.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},A.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},A.prototype._checkProgressAndResume=function(){for(var A,e,t,i=(null===(A=this._mediaElement)||void 0===A?void 0:A.currentTime)||0,n=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,a=!1,o=0;o=r&&i=s-(this._config.lazyLoadRecoverDuration||0)&&(a=!0);break}}a&&(window.clearInterval(this._progressChecker),this._progressChecker=null,a&&(l.A.v(this.TAG,"Continue loading from paused position"),null===(t=this._transmuxer)||void 0===t||t.resume()))},A.prototype._isTimepointBuffered=function(A){for(var e,t=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,i=0;i=n&&A0){var g=(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered).start(0);(g<1&&A0&&e.currentTime0){var o=a.start(0);if(o<1&&n0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},A.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},A.prototype.play=function(){var A;return function(A,e,t,i){return new(t||(t=Promise))((function(n,a){function o(A){try{s(i.next(A))}catch(A){a(A)}}function r(A){try{s(i.throw(A))}catch(A){a(A)}}function s(A){var e;A.done?n(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(o,r)}s((i=i.apply(A,e||[])).next())}))}(this,void 0,void 0,(function(){return function(A,e){var t,i,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(s){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(o=0)),o;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]{A.exports=t(133).default},302:(A,e,t)=>{t.d(e,{A:()=>f});var i=t(502);const n=function(){function A(){var A;this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,(null===(A=self.performance)||void 0===A?void 0:A.now)?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return A.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},A.prototype.addBytes=function(A){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=A,this._totalBytes+=A):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=A,this._totalBytes+=A):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=A,this._totalBytes+=A,this._lastCheckpoint=this._now())},Object.defineProperty(A.prototype,"currentKBps",{get:function(){this.addBytes(0);var A=(this._now()-this._lastCheckpoint)/1e3;return 0===A&&(A=1),this._intervalBytes/A/1024},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"averageKBps",{get:function(){var A=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/A/1024},enumerable:!1,configurable:!0}),A}();var a,o=t(288),r=t(620),s=t(713),g=(a=function(A,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},a(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}a(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)});const c=function(A){function e(e,t){var i=A.call(this,"fetch-stream-loader")||this;return i.TAG="FetchStreamLoader",i._seekHandler=e,i._config=t,i._needStash=!0,i._requestAbort=!1,i._abortController=null,i._contentLength=null,i._receivedLength=0,i}return g(e,A),e.isSupported=function(){var A;try{var e=r.A.msedge&&((null===(A=null===r.A||void 0===r.A?void 0:r.A.version)||void 0===A?void 0:A.minor)||0)>=15048&&!r.A.webkit,t=!r.A.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(A){return!1}},e.prototype.destroy=function(){this.isWorking()&&this.abort(),A.prototype.destroy.call(this)},e.prototype.open=function(A,e){var t=this;this._dataSource=A,this._range=e;var i=A.url;this._config.reuseRedirectedURL&&void 0!==A.redirectedURL&&(i=A.redirectedURL);var n=this._seekHandler.getConfig(i,e),a=new self.Headers;if("object"==typeof n.headers){var r=n.headers;for(var g in r)r.hasOwnProperty(g)&&a.append(g,r[g])}var c={method:"GET",headers:a,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var g in this._config.headers)a.append(g,this._config.headers[g]);A.cors||(c.mode="same-origin"),A.withCredentials&&(c.credentials="include"),(null==A?void 0:A.referrerPolicy)&&(c.referrerPolicy=A.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(c.signal=this._abortController.signal)),this._status=o.eO.kConnecting,self.fetch(n.url,c).then((function(A){var e,i;if(t._requestAbort)return t._status=o.eO.kIdle,void(null===(e=A.body)||void 0===e||e.cancel());if(A.ok&&A.status>=200&&A.status<=299){if(A.url!==n.url&&t._onURLRedirect){var a=t._seekHandler.removeURLParameters(A.url);t._onURLRedirect(a)}var r=A.headers.get("Content-Length");return null!=r&&(t._contentLength=parseInt(r),0!==t._contentLength&&t._onContentLengthKnown&&t._onContentLengthKnown(t._contentLength)),t._pump.call(t,null===(i=A.body)||void 0===i?void 0:i.getReader())}if(t._status=o.eO.kError,!t._onError)throw new s.Al("FetchStreamLoader: Http code invalid, "+A.status+" "+A.statusText);t._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:A.status,msg:A.statusText})})).catch((function(A){var e;if(!(null===(e=t._abortController)||void 0===e?void 0:e.signal.aborted)){if(t._status=o.eO.kError,!t._onError)throw A;t._onError(o.Xv.EXCEPTION,{code:-1,msg:A.message})}}))},e.prototype.abort=function(){var A;if(this._requestAbort=!0,(this._status!==o.eO.kBuffering||!r.A.chrome)&&this._abortController)try{null===(A=this._abortController)||void 0===A||A.abort()}catch(A){}},e.prototype._pump=function(A){var e=this;return A.read().then((function(t){var i,n,a,r;if(t.done)if(null!==e._contentLength&&e._receivedLength299)){if(this._status=o.eO.kError,!this._onError)throw new s.Al("MozChunkedLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}else this._status=o.eO.kBuffering}},e.prototype._onProgress=function(A){var e;if(this._status!==o.eO.kError){null===this._contentLength&&null!==A.total&&0!==A.total&&(this._contentLength=A.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=A.target.response,i=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}},e.prototype._onLoadEnd=function(A){this._requestAbort?this._requestAbort=!1:this._status!==o.eO.kError&&(this._status=o.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},e.prototype._onXhrError=function(A){this._status=o.eO.kError;var e=0,t=null;if(this._contentLength&&A.loaded=this._contentLength&&(n=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._contentLength-1),this._currentRequestRange={from:i,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)},e.prototype._internalOpen=function(A,e){this._lastTimeLoaded=0;var t=A.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?t=this._currentRedirectedURL:null!=A.redirectedURL&&(t=A.redirectedURL));var i=this._seekHandler.getConfig(t,e);this._currentRequestURL=i.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",i.url,!0),n.responseType="arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onload=this._onLoad.bind(this),n.onerror=this._onXhrError.bind(this),A.withCredentials&&(n.withCredentials=!0),"object"==typeof i.headers){var a=i.headers;for(var o in a)a.hasOwnProperty(o)&&n.setRequestHeader(o,a[o])}if("object"==typeof this._config.headers)for(var o in a=this._config.headers)a.hasOwnProperty(o)&&n.setRequestHeader(o,a[o]);n.send()},e.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=o.eO.kComplete},e.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},e.prototype._onReadyStateChange=function(A){var e=A.target;if(2===e.readyState){if(null!=e.responseURL){var t=this._seekHandler.removeURLParameters(e.responseURL);e.responseURL!==this._currentRequestURL&&t!==this._currentRedirectedURL&&(this._currentRedirectedURL=t,this._onURLRedirect&&this._onURLRedirect(t))}if(e.status>=200&&e.status<=299){if(this._waitForTotalLength)return;this._status=o.eO.kBuffering}else{if(this._status=o.eO.kError,!this._onError)throw new s.Al("RangeLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}}},e.prototype._onProgress=function(A){if(this._status!==o.eO.kError){if(null===this._contentLength){var e=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,e=!0;var t=A.total;this._internalAbort(),null!=t&&0!==t&&(this._totalLength=t)}if(-1===this._range.to?this._contentLength=(this._totalLength||0)-this._range.from:this._contentLength=this._range.to-this._range.from+1,e)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=A.loaded-this._lastTimeLoaded;this._lastTimeLoaded=A.loaded,this._speedSampler.addBytes(i)}},e.prototype._normalizeSpeed=function(A){var e=this._chunkSizeKBList,t=e.length-1,i=0,n=0,a=t;if(A=e[i]&&A=3&&(e=this._speedSampler.currentKBps)),0!==e){var t=this._normalizeSpeed(e);this._currentSpeedNormalized!==t&&(this._currentSpeedNormalized=t,this._currentChunkSizeKB=t)}var i=A.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0)for(var a=e.split("&"),o=0;o0;r[0]!==this._startName&&r[0]!==this._endName&&(s&&(n+="&"),n+=a[o])}return 0===n.length?t:t+"?"+n},A}(),f=function(){function A(A,e,t){this.TAG="IOController",this._config=e,this._extraData=t,this._stashInitialSize=65536,void 0!==e.stashInitialSize&&e.stashInitialSize>0&&(this._stashInitialSize=e.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,e.enableStashBuffer||(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=A,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(A.url||""),this._refTotalLength=A.filesize?A.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new n,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return A.prototype.destroy=function(){var A,e,t;(null===(A=this._loader)||void 0===A?void 0:A.isWorking())&&(null===(e=this._loader)||void 0===e||e.abort()),null===(t=this._loader)||void 0===t||t.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},A.prototype.isWorking=function(){var A;return(null===(A=this._loader)||void 0===A?void 0:A.isWorking())&&!this._paused},A.prototype.isPaused=function(){return this._paused},Object.defineProperty(A.prototype,"status",{get:function(){var A;return null===(A=this._loader)||void 0===A?void 0:A.status},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"extraData",{get:function(){return this._extraData},set:function(A){this._extraData=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(A){this._onDataArrival=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(A){this._onSeeked=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onComplete",{get:function(){return this._onComplete},set:function(A){this._onComplete=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(A){this._onRedirect=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(A){this._onRecoveredEarlyEof=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentURL",{get:function(){var A;return null===(A=this._dataSource)||void 0===A?void 0:A.url},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"hasRedirect",{get:function(){var A;return null!=this._redirectedURL||void 0!==(null===(A=this._dataSource)||void 0===A?void 0:A.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentRedirectedURL",{get:function(){var A;return this._redirectedURL||(null===(A=this._dataSource)||void 0===A?void 0:A.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentSpeed",{get:function(){var A,e;return this._loaderClass===d?null===(A=this._loader)||void 0===A?void 0:A.currentSpeed:null===(e=this._speedSampler)||void 0===e?void 0:e.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"loaderType",{get:function(){var A;return null===(A=this._loader)||void 0===A?void 0:A.type},enumerable:!1,configurable:!0}),A.prototype._selectSeekHandler=function(){var A=this._config;if("range"===A.seekType)this._seekHandler=new u(!!this._config.rangeLoadZeroStart);else if("param"===A.seekType){var e=A.seekParamStart||"bstart",t=A.seekParamEnd||"bend";this._seekHandler=new E(e,t)}else{if("custom"!==A.seekType)throw new s.Qn("Invalid seekType in config: ".concat((null==A?void 0:A.seekType)||""));if("function"!=typeof A.customSeekHandler)throw new s.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new A.customSeekHandler}},A.prototype._selectLoader=function(){var A;if(null!=this._config.customLoader)this._loaderClass=(null===(A=this._config)||void 0===A?void 0:A.customLoader)||null;else if(this._isWebSocketURL)this._loaderClass=B;else if(c.isSupported())this._loaderClass=c;else if(I.isSupported())this._loaderClass=I;else{if(!d.isSupported())throw new s.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=d}},A.prototype._createLoader=function(){var A;this._loaderClass&&(this._loader=new this._loaderClass(this._seekHandler,this._config),(null===(A=this._loader)||void 0===A?void 0:A.needStashBuffer)||(this._enableStash=!1),this._loader&&(this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)))},A.prototype.open=function(A){var e,t;this._currentRange={from:0,to:-1},A&&(this._currentRange.from=A),null===(e=this._speedSampler)||void 0===e||e.reset(),A||(this._fullRequestFlag=!0),null===(t=this._loader)||void 0===t||t.open(this._dataSource,Object.assign({},this._currentRange))},A.prototype.abort=function(){var A;null===(A=this._loader)||void 0===A||A.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},A.prototype.pause=function(){var A,e;this.isWorking()&&(null===(A=this._loader)||void 0===A||A.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange&&(this._currentRange.to=this._stashByteStart-1)):this._resumeFrom=((null===(e=this._currentRange)||void 0===e?void 0:e.to)||0)+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},A.prototype.resume=function(){if(this._paused){this._paused=!1;var A=this._resumeFrom;this._resumeFrom=0,this._internalSeek(A,!0)}},A.prototype.seek=function(A){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(A,!0)},A.prototype._internalSeek=function(A,e){var t,i,n,a;(null===(t=this._loader)||void 0===t?void 0:t.isWorking())&&(null===(i=this._loader)||void 0===i||i.abort()),this._flushStashBuffer(e),null===(n=this._loader)||void 0===n||n.destroy(),this._loader=null;var o={from:A,to:-1};this._currentRange={from:o.from,to:-1},null===(a=this._speedSampler)||void 0===a||a.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,o),this._onSeeked&&this._onSeeked()},A.prototype.updateUrl=function(A){if(!A||"string"!=typeof A||0===A.length)throw new s.Qn("Url must be a non-empty string!");this._dataSource.url=A},A.prototype._expandBuffer=function(A){for(var e=this._stashSize;e+10485760){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(t,0,e).set(i,0)}this._stashBuffer=t,this._bufferSize=e}},A.prototype._normalizeSpeed=function(A){var e=this._speedNormalizeList,t=e.length-1,i=0,n=0,a=t;if(A=e[i]&&A=512&&A<=1024?Math.floor(1.5*A):2*A)>8192&&(e=8192);var t=1024*e+1048576;this._bufferSize0){var r=this._stashBuffer.slice(0,this._stashUsed);(l=this._dispatchChunks(r,this._stashByteStart))0&&(I=new Uint8Array(r,l),c.set(I,0),this._stashUsed=I.byteLength,this._stashByteStart+=l):(this._stashUsed=0,this._stashByteStart+=l),this._stashUsed+A.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+A.byteLength),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(A),this._stashUsed),this._stashUsed+=A.byteLength}else(l=this._dispatchChunks(A,e))this._bufferSize&&(this._expandBuffer(g),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(A,l),0),this._stashUsed+=g,this._stashByteStart=e+l);else if(0===this._stashUsed){var g;(l=this._dispatchChunks(A,e))this._bufferSize&&this._expandBuffer(g),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(A,l),0),this._stashUsed+=g,this._stashByteStart=e+l)}else{var c,l;if(this._stashUsed+A.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+A.byteLength),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(A),this._stashUsed),this._stashUsed+=A.byteLength,(l=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var I=new Uint8Array(this._stashBuffer,l);c.set(I,0)}this._stashUsed-=l,this._stashByteStart+=l}}},A.prototype._flushStashBuffer=function(A){if(this._stashUsed>0){var e=this._stashBuffer.slice(0,this._stashUsed),t=this._dispatchChunks(e,this._stashByteStart),n=e.byteLength-t;if(t0){var a=new Uint8Array(this._stashBuffer,0,this._bufferSize),o=new Uint8Array(e,t);a.set(o,0),this._stashUsed=o.byteLength,this._stashByteStart+=t}return 0}i.A.w(this.TAG,"".concat(n," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,n}return 0},A.prototype._onLoaderComplete=function(A,e){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},A.prototype._onLoaderError=function(A,e){var t;switch(i.A.e(this.TAG,"Loader error, code = ".concat(e.code,", msg = ").concat(e.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,A=o.Xv.UNRECOVERABLE_EARLY_EOF),A){case o.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1;return void(n{t.d(e,{HC:()=>o,Xv:()=>a,eO:()=>n});var i=t(713),n={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},a={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},o=function(){function A(A){this._type=A||"undefined",this._status=n.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return A.prototype.destroy=function(){this._status=n.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},A.prototype.isWorking=function(){return this._status===n.kConnecting||this._status===n.kBuffering},Object.defineProperty(A.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(A){this._onContentLengthKnown=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(A){this._onURLRedirect=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(A){this._onDataArrival=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onComplete",{get:function(){return this._onComplete},set:function(A){this._onComplete=A},enumerable:!1,configurable:!0}),A.prototype.open=function(A,e){throw new i.Xu("Unimplemented abstract function!")},A.prototype.abort=function(){throw new i.Xu("Unimplemented abstract function!")},A}()},620:(A,e,t)=>{t.d(e,{A:()=>n});var i={};!function(){var A=self.navigator.userAgent.toLowerCase(),e=/(edge)\/([\w.]+)/.exec(A)||/(opr)[\/]([\w.]+)/.exec(A)||/(chrome)[ \/]([\w.]+)/.exec(A)||/(iemobile)[\/]([\w.]+)/.exec(A)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(A)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(A)||/(webkit)[ \/]([\w.]+)/.exec(A)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(A)||/(msie) ([\w.]+)/.exec(A)||A.includes("trident")&&/(rv)(?::| )([\w.]+)/.exec(A)||!A.includes("compatible")&&/(firefox)[ \/]([\w.]+)/.exec(A)||[],t=/(ipad)/.exec(A)||/(ipod)/.exec(A)||/(windows phone)/.exec(A)||/(iphone)/.exec(A)||/(kindle)/.exec(A)||/(android)/.exec(A)||/(windows)/.exec(A)||/(mac)/.exec(A)||/(linux)/.exec(A)||/(cros)/.exec(A)||[],n={browser:e[5]||e[3]||e[1]||"",version:e[2]||e[4]||"0",majorVersion:e[4]||e[2]||"0",platform:t[0]||""},a={};if(n.browser){a[n.browser]=!0;var o=n.majorVersion.split(".");a.version={major:parseInt(n.majorVersion,10),string:n.version},o.length>1&&(a.version.minor=parseInt(o[1],10)),o.length>2&&(a.version.build=parseInt(o[2],10))}if(n.platform&&(a[n.platform]=!0),(a.chrome||a.opr||a.safari)&&(a.webkit=!0),a.rv||a.iemobile){a.rv&&delete a.rv;var r="msie";n.browser=r,a[r]=!0}if(a.edge){delete a.edge;var s="msedge";n.browser=s,a[s]=!0}if(a.opr){var g="opera";n.browser=g,a[g]=!0}if(a.safari&&a.android){var c="android";n.browser=c,a[c]=!0}for(var l in a.name=n.browser,a.platform=n.platform,i)Object.prototype.hasOwnProperty.call(i,l)&&delete i[l];Object.assign(i,a)}();const n=i},713:(A,e,t)=>{t.d(e,{Al:()=>a,Qn:()=>r,Xu:()=>s,j4:()=>o});var i,n=(i=function(A,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},i(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}i(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),a=function(){function A(A){this.name="RuntimeException",this._message=A}return Object.defineProperty(A.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),A.prototype.toString=function(){return this.name+": "+this.message},A}(),o=function(A){function e(e){var t=A.call(this,e)||this;return t.name="IllegalStateException",t}return n(e,A),e}(a),r=function(A){function e(e){var t=A.call(this,e)||this;return t.name="InvalidArgumentException",t}return n(e,A),e}(a),s=function(A){function e(e){var t=A.call(this,e)||this;return t.name="NotImplementedException",t}return n(e,A),e}(a)},502:(A,e,t)=>{t.d(e,{A:()=>n});var i=t(413);const n=function(){function A(){}return A.e=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","error",n)),A.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},A.i=function(e,t){e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var i="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&A.emitter.emit("log","info",i),A.ENABLE_INFO&&(console.info?console.info(i):console.log(i))},A.w=function(e,t){e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var i="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&A.emitter.emit("log","warn",i),A.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))},A.d=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","debug",n)),A.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},A.v=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","verbose",n)),A.ENABLE_VERBOSE&&console.log(n)},A.FORCE_GLOBAL_TAG=!1,A.GLOBAL_TAG="ezuikit-flv",A.ENABLE_CALLBACK=!1,A.emitter=new i.A,A.ENABLE_ERROR=!0,A.ENABLE_INFO=!0,A.ENABLE_WARN=!0,A.ENABLE_DEBUG=!0,A.ENABLE_VERBOSE=!0,A}()},641:(A,e,t)=>{t.d(e,{A:()=>a});var i=t(413),n=t(502);const a=function(){function A(){}return Object.defineProperty(A,"forceGlobalTag",{get:function(){return n.A.FORCE_GLOBAL_TAG},set:function(e){n.A.FORCE_GLOBAL_TAG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"globalTag",{get:function(){return n.A.GLOBAL_TAG},set:function(e){n.A.GLOBAL_TAG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableAll",{get:function(){return n.A.ENABLE_VERBOSE&&n.A.ENABLE_DEBUG&&n.A.ENABLE_INFO&&n.A.ENABLE_WARN&&n.A.ENABLE_ERROR},set:function(e){n.A.ENABLE_VERBOSE=e,n.A.ENABLE_DEBUG=e,n.A.ENABLE_INFO=e,n.A.ENABLE_WARN=e,n.A.ENABLE_ERROR=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableDebug",{get:function(){return n.A.ENABLE_DEBUG},set:function(e){n.A.ENABLE_DEBUG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableVerbose",{get:function(){return n.A.ENABLE_VERBOSE},set:function(e){n.A.ENABLE_VERBOSE=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableInfo",{get:function(){return n.A.ENABLE_INFO},set:function(e){n.A.ENABLE_INFO=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableWarn",{get:function(){return n.A.ENABLE_WARN},set:function(e){n.A.ENABLE_WARN=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableError",{get:function(){return n.A.ENABLE_ERROR},set:function(e){n.A.ENABLE_ERROR=e,A._notifyChange()},enumerable:!1,configurable:!0}),A.getConfig=function(){return{globalTag:n.A.GLOBAL_TAG,forceGlobalTag:n.A.FORCE_GLOBAL_TAG,enableVerbose:n.A.ENABLE_VERBOSE,enableDebug:n.A.ENABLE_DEBUG,enableInfo:n.A.ENABLE_INFO,enableWarn:n.A.ENABLE_WARN,enableError:n.A.ENABLE_ERROR,enableCallback:n.A.ENABLE_CALLBACK}},A.applyConfig=function(A){n.A.GLOBAL_TAG=A.globalTag,n.A.FORCE_GLOBAL_TAG=A.forceGlobalTag,n.A.ENABLE_VERBOSE=A.enableVerbose,n.A.ENABLE_DEBUG=A.enableDebug,n.A.ENABLE_INFO=A.enableInfo,n.A.ENABLE_WARN=A.enableWarn,n.A.ENABLE_ERROR=A.enableError,n.A.ENABLE_CALLBACK=!!A.enableCallback},A._notifyChange=function(){var e=A.emitter;if(e.listenerCount("change")>0){var t=A.getConfig();e.emit("change",t)}},A.registerListener=function(e){A.emitter.addListener("change",e)},A.removeListener=function(e){A.emitter.removeListener("change",e)},A.addLogListener=function(e){n.A.emitter.addListener("log",e),n.A.emitter.listenerCount("log")>0&&(n.A.ENABLE_CALLBACK=!0,A._notifyChange())},A.removeLogListener=function(e){n.A.emitter.removeListener("log",e),0===n.A.emitter.listenerCount("log")&&(n.A.ENABLE_CALLBACK=!1,A._notifyChange())},A.emitter=new i.A,A}()},413:(A,e,t)=>{t.d(e,{A:()=>i});const i=t(343)}},e={};function t(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return A[i](a,a.exports,t),a.exports}return t.m=A,t.d=(A,e)=>{for(var i in e)t.o(e,i)&&!t.o(A,i)&&Object.defineProperty(A,i,{enumerable:!0,get:e[i]})},t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t(446)})()))}(k);var P=R(k.exports);window.flvjs=P;var N=function(){return o((function A(e,i){t(this,A),console.log("isSupportFlv",window.flvjs.isSupported()),window.flvjs.isSupported()&&this.initFLV(e,i)}),[{key:"toString",value:function(){return"Flv ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initFLV",value:function(A,e){var t=S(e),i=t.deviceSerial,n=t.channelNo;t.hd;var a=t.type;window.ezuikitMonitor.report({protocol:"flv",url:e,serial:i,no:n,action:1,logInfo:{type:a}});var o=document.getElementById(A);o.getAttribute("controls")||o.setAttribute("controls",!0);var r=window.flvjs.createPlayer({type:"flv",url:e,isLive:!0},{enableStashBuffer:!0,stashInitialSize:128,enableWorker:!0});r.attachMediaElement(o),r.load(),r.play(),this.flvUrl=e,this.flv=r,this.video=o,this.video.addEventListener("oncanplaythrough",(function(){console.log("oncanplaythrough")}),!1),this.video.addEventListener("onerror",(function(){console.log("onerror")}),!1)}},{key:"play",value:function(){console.log("执行flv播放",this.video),this.video.play()}},{key:"stop",value:function(){this.video.pause(),this.flv.unload()}},{key:"destroy",value:function(){void 0!==this.flv&&null!==this.flv&&(this.flv.pause(),this.flv.unload(),this.flv.detachMediaElement(),this.flv.destroy(),this.flv=null)}}])}();!function(){function A(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function e(A,e){for(var t=0;tA.length)&&(e=A.length);for(var t=0,i=new Array(e);t=A.length?{done:!0}:{done:!1,value:A[i++]}},e:function(A){throw A},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,r=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return o=A.done,A},e:function(A){r=!0,a=A},f:function(){try{o||null==t.return||t.return()}finally{if(r)throw a}}}}var h=function(){function e(){A(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return t(e,[{key:"addEventListener",value:function(A,e,t){A in this.listeners||(this.listeners[A]=[]),this.listeners[A].push({callback:e,options:t})}},{key:"removeEventListener",value:function(A,e){if(A in this.listeners)for(var t=this.listeners[A],i=0,n=t.length;i2?a[1]:"sd"),"rec"===e.type&&n[2]&&(e.recType=n[2].includes(".cloud.")?"cloud":""),e.searchParams=function(A){var e=A.split("?")[1],t={};if(e)for(var i=e.split("&"),n=0;n')),I.innerHTML=C,s.appendChild(I),s.appendChild(g),o.appendChild(s)}},{key:"loadingStop",value:function(A){var e=document.getElementById("".concat(A,"-loading-item-0"));e&&document.getElementById("".concat(A,"-loading-icon"))&&e.removeChild(document.getElementById("".concat(A,"-loading-icon")))}},{key:"loadingSetText",value:function(A){var e=this;if(this.loadingClearText(),document.getElementById("".concat(this.id,"-loading-item-0"))){var t=document.getElementById("".concat(this.id,"-loading-item-0")),i=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes[1];if(i||(t.style.height="100%",(i=document.createElement("div")).innerHTML=A.text,t.appendChild(i)),i.id="".concat(this.id,"-loading-item-txt"),i.innerHTML=A.text,i.style.fontSize="14px",!this.jSPlugin.isMobile&&this.jSPlugin.isCall){var n=this.jSPlugin.width/1024;i.style.fontSize="".concat(28*n,"px"),i.style.marginTop="16px"}if(this.jSPlugin.isCall&&1==A.type){var a=document.getElementById("".concat(this.id,"-loading-item-txt")),o=document.createElement("div");o.style="margin-bottom: 8px;width:24px;height:24px;",o.innerHTML='\n \n \n \n \n \n \n \n ',t.insertBefore(o,a)}if(i.style.color=A.color||"#FFFFFF",i.style.padding="0 6%",i.style.textAlign="center",this.state.text=A.text,A.delayClear)var r=setTimeout((function(){e.loadingClearText(),clearTimeout(r)}),parseInt(A.delayClear))}}},{key:"loadingSetTextWithBtn",value:function(A){var e=this;this.loadingClear(),console.log(this.jSPlugin);var t=!!this.jSPlugin.Theme.call&&this.jSPlugin.Theme.call.themeData||null;(t&&(0===t.customConfig.bellPoster||"onCall"===this.jSPlugin.Theme.call.bellStatus)||A.mask)&&document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background=A.maskStyle||"rgba(0,0,0,0.7)");var i=document.getElementById("".concat(this.id,"-loading-item-0"));if(i){i.style.height="100%",i.style["pointer-events"]="auto";var n=document.createElement("div");if(n.id="".concat(this.id,"-loading-item-txt"),n.innerHTML=A.text,n.title=A.text,n.style.color=A.color||"#FFFFFF",A.isMobile){var a=14*(this.jSPlugin.width/375);n.style.fontSize=a+"px"}else{var o=28*(this.jSPlugin.width/1024);n.style.fontSize=o+"px"}if(this.jSPlugin.isInspect&&(n.style="text-align: center; color: white; font-size: 14px; white-space: nowrap;overflow: hidden;text-overflow: ellipsis; width: 70%;"),i.appendChild(n),A.type&&2==A.type){var r=8,s=24;if(A.isMobile){s=24*(this.jSPlugin.width/375)}else{var g=this.jSPlugin.width/1024;r=g<1?16*g:16,s=40*g}var c=document.getElementById("".concat(this.id,"-loading-item-txt"));(C=document.createElement("div")).style="margin-bottom: ".concat(r,"px;width:").concat(s,"px;height:").concat(s,"px;"),C.innerHTML='\n \n \n \n \n \n \n \n '),i.insertBefore(C,c)}else{var l=document.createElement("div");if(l.id="".concat(this.id,"-loading-item-btn-wrap"),l.innerHTML='\n
').concat(A.btnName,'
\n \n \n \n '),A.isMobile)1==A.type?l.style="color:white;width:100px;height:30px;border-radius: 10px;background: rgba(255,255,255,0.25);text-align:center;line-height:30px;margin-top:9px;font-size:14px;-webkit-tap-highlight-color: transparent;":l.style="border: 1px solid rgba(204,204,204,1);color:white;width:80px;height:24px;border-radius: 12px;background: rgba(255,255,255,0.1);text-align:center;line-height:24px;margin-top:20px;font-size:12px;-webkit-tap-highlight-color: transparent;";else{var I=this.jSPlugin.width/1024;l.style="color:#648FFC;margin-top:16px;cursor: pointer;font-size:".concat(24*I,"px;"),this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"video"==this.jSPlugin.Theme.inspectMode&&(l.style="border: 1px solid rgba(255,255,255,1);color:white; cursor: pointer;text-align: center;width:80px;height:32px;border-radius:2px; text-align:center;line-height:32px;margin-top:16px;font-size:14px;-webkit-tap-highlight-color: transparent;")}if(i.appendChild(l),A.isMobile&&1==A.type){var C,d=document.getElementById("".concat(this.id,"-loading-item-txt"));(C=document.createElement("div")).style="margin-bottom: 8px;width:24px;height:24px;",C.innerHTML='\n \n \n \n \n \n \n \n ',i.insertBefore(C,d)}document.getElementById("".concat(this.id,"-loading-item-btn-wrap"))&&(document.getElementById("".concat(this.id,"-loading-item-btn-wrap")).onclick=function(){e.jSPlugin.play(),e.loadingClear(),e.loadingStart(e.id),e.loadingSetText({text:"视频加载中"})})}this.state.text=A.text,A.delayClear&&setTimeout((function(){e.loadingClearText()}),parseInt(A.delayClear))}}},{key:"loadingClearText",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){var A=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes;A.length>1?A[1].parentNode.removeChild(A[1]):A[0]&&A[0].parentNode.removeChild(A[0])}}},{key:"loadingClear",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){for(var A=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes,e=A.length-1;e>=0;e--)A[e].parentNode.removeChild(A[e]);document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background="none"),document.getElementById("".concat(this.id,"-loading-icon"))&&document.getElementById("".concat(this.id,"-loading-icon")).parentNode.removeChild(document.getElementById("".concat(this.id,"-loading-icon")))}}},{key:"loadingEnd",value:function(){var A=document.getElementById("".concat(this.id,"-loading-item-0"));if(A){A.parentNode.removeChild(A);var e=document.getElementById("".concat(this.id,"-loading-id-0"));e&&0===e.children.length&&e.parentNode.removeChild(e)}document.getElementById("".concat(this.id,"-loading-item-0")).style.background="none"}}],[{key:"_instanceStyle",value:function(){A._STYLE||(A._STYLE=document.createElement("style"),A._STYLE.id="ezuikit-status-style",A._STYLE.innerHTML="@keyframes antRotate {to {transform: rotate(400deg);transform-origin:50% 50%;}} .loading {display: inline-block;z-index: 1000;-webkit-animation: antRotate 1s infinite linear;animation: antRotate 1s infinite linear;}",document.getElementsByTagName("head")[0].appendChild(A._STYLE))}}])}();s(J,"_STYLE",void 0);var H=function(){return o((function A(e,i){t(this,A),this.id=i,this.jSPlugin=e,this.timer=null,this.state={play:!1,loading:!1}}),[{key:"default",value:function(A,e){var t=this,i="msgId",n=e||document.getElementById("".concat(this.id,"-wrap"));document.getElementById("".concat(this.id,"-").concat(i))&&n.removeChild(document.getElementById("".concat(this.id,"-").concat(i)));var a=document.createElement("div");a.id="".concat(this.id,"-").concat(i),a.style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);text-align: center;padding: 4px 16px;background: #00000080;color: #FFFFFF;font-size: 14px;",a.innerHTML=A,n.appendChild(a),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){var A=document.getElementById("".concat(t.id,"-").concat(i));n&&A&&n.removeChild(A)}),2e3)}}])}(),K={391001:"取流地址或端口非法",395e3:"服务内部异常,请稍后重试",395400:"预览取流参数异常",395402:"设备当前时段无录像,请选择其他时间段",395403:"服务异常,请重试或联系客服",395404:"设备不在线,请优化网络后重启设备再试",395405:"设备侧网络问题,请检查优化网络后重启设备再试",395406:"token过期,请重试",395407:"客户端的URL格式错误",395409:"预览开启隐私保护",395410:"服务异常,请重试或联系客服",395411:"无权查看当前设备",395412:"服务异常,请重试或联系客服",395413:"服务异常,请重试或联系客服",395415:"设备通道错误",395416:"当前观看路数达到设备最大限制,请重启设备或联系设备售后处理",395451:"设备不支持该码流类型,请检查设备通道支持情况或联系硬件售后",395452:"设备侧网络较差,请检查优化网络后重启设备再试",395454:"设备侧网络较差,请检查优化网络后重启设备再试",395455:"设备通道异常,请检查通道配置后重试",395456:"设备通道异常,请检查通道配置后重试",395457:"服务异常,请重试或联系客服",395458:"服务异常,请重试或联系客服",395459:"服务异常,请重试或联系客服",395460:"服务异常,请重试或联系客服",395492:"服务异常,请重试或联系客服",395500:"服务异常,请重试或联系客服",395501:"服务异常,请重试或联系客服",395503:"服务异常,请重试或联系客服",395504:"服务异常,请重试或联系客服",395505:"服务异常,请重试或联系客服",395506:"暂不支持该设备直接取流,请连接NVR后重试或联系客服",395507:"设备4G无限流量套餐仅支持萤石云视频APP使用,请联系APP客服更换套餐",395530:"服务异常,请重试或联系客服",395544:"视频源不存在,请检查设备配置",395545:"服务异常,请重试或联系客服",395546:"同时观看人数达到账号最大限制,请联系客服",395547:"同时观看人数达到账号最大限制,请联系客服",395556:"服务异常,请重试或联系客服",395557:"设备取流失败,请联系硬件售后",395558:"查找录像开始时间错误",395560:"服务异常,请重试或联系客服",395561:"服务异常,请重试或联系客服",395562:"服务异常,请重试或联系客服",395563:"服务异常,请重试或联系客服",395564:"服务异常,请重试或联系客服",395566:"服务异常,请重试或联系客服",395567:"服务异常,请重试或联系客服",395568:"服务异常,请重试或联系客服",395569:"服务异常,请重试或联系客服",395600:"服务异常,请重试或联系客服",395601:"服务异常,请重试或联系客服",395602:"服务异常,请重试或联系客服",395610:"服务异常,请重试或联系客服",395620:"服务异常,请重试或联系客服",395701:"服务异常,请重试或联系客服",395702:"服务异常,请重试或联系客服",395703:"服务异常,请重试或联系客服",396001:"服务异常,请重试或联系客服",396099:"服务异常,请重试或联系客服",396101:"服务异常,请重试或联系客服",396102:"服务异常,请重试或联系客服",396103:"服务异常,请重试或联系客服",396104:"服务异常,请重试或联系客服",396105:"设备异常,请重试或联系客服",396106:"设备通道异常,请检查通道配置后重试",396107:"设备异常,请重试或联系客服",396108:"服务异常,请重试或联系客服",396109:"服务异常,请重试或联系客服",396110:"设备异常,请重试或联系客服",396501:"设备异常,请重试或联系客服",396502:"设备异常,请重试或联系客服",396503:"设备异常,请重试或联系客服",396504:"设备异常,请重试或联系客服",396505:"设备异常,请重试或联系客服",396506:"设备异常,请重试或联系客服",396508:"设备异常,请重试或联系客服",396509:"设备异常,请重试或联系客服",396510:"设备异常,请重试或联系客服",396511:"设备异常,请重试或联系客服",396512:"设备异常,请重试或联系客服",396513:"设备异常,请重试或联系客服",396514:"设备异常,请重试或联系客服",396515:"设备异常,请重试或联系客服",396516:"设备异常,请重试或联系客服",396517:"设备异常,请重试或联系客服",396518:"设备异常,请重试或联系客服",396519:"设备网络异常,请检查优化网络后重启设备再试",396520:"设备网络异常,请检查优化网络后重启设备再试",396700:"服务异常,请重试或联系客服",396701:"回放结束",397001:"服务异常,请重试或联系客服",397002:"服务异常,请重试或联系客服",397003:"服务异常,请重试或联系客服",397004:"服务异常,请重试或联系客服",397005:"设备取流连接断开,请检查网络后重试",397006:"服务异常,请重试或联系客服",397007:"服务异常,请重试或联系客服",399e3:"服务异常,请重试或联系客服",399001:"客户端网络超时",399002:"服务异常,请重试或联系客服",399016:"token失效,请更新并重试",399048:"同时观看人数达到账号最大限制,请联系客服",399049:"免费版并发数达到上限,请升级企业版使用多并发能力",3810001:"操作失败",3810002:"账号异常,操作失败",3810005:"账号异常,操作失败",3820002:"设备不存在,请检查设备连接情况",3820006:"操作失败,请检查设备网络情况",3820007:"操作失败,请检查设备网络情况",3820008:"操作过于频繁,稍后再试",3820014:"操作失败",3820032:"通道不存在请检查设备连接情况",3849999:"操作失败,请重试",386e4:"操作失败,设备不支持该操作",3860001:"操作失败,用户无权限",3860002:"设备已旋转到上限位",3860003:"设备已旋转到下限位",3860004:"设备已旋转到左限位",3860005:"设备已旋转到右限位",3860006:"操作失败,请重试",3860009:"设备正在操作中",3860020:"操作失败",BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍后",TIMEFORMAT_ERROR:"时间格式有误,请确认",USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功",GET_PLAYURL_FAILED:"获取播放地址失败",VIDEO_LOADING:"视频加载中",DISCONNECT:"连接断开,请重试",DEVICE_ENCRYPTED:"设备已加密",NO_RECORD:"未找到录像片段",PLAY_FAILED:"播放失败,请检查设备及客户端网络",PLAY_SUCCESS:"播放成功",STOP_SUCCESS:"停止成功",CHANGE_PLAYURL_SUCCESS:"切换播放地址成功",CHANGE_PLAYURL_FAILED:"切换播放地址失败",GET_OSD_TIME:"获取OSD时间",GET_OSD_TIME_FAILED:"获取OSD时间失败",SET_POSTER:"设置播放器封面",RESIZE:"调整播放器尺寸",SPEED:"倍速",SPEED_RATE:"倍",SPEED_CANCEL:"取消",GET_SPEED:"获取当前播放速率",MAX_SPEED_LIMIT:"播放速度最大为4倍速度",MIN_SPEED_LIMIT:"播放速度最小为1倍速度",SEEK_CANNOT_CROSS_DAYS:"seek时间不能跨日期",SEEK_TIMEFORMAT_ERROR:"seek时间格式错误",PAUSE:"暂停",PAUSE_FAILED:"暂停失败",RESUME:"恢复播放",RESUME_FAILED:"恢复播放失败",CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"该设备在当天没有云录制的录像",CHANGE_VIDEO_LEVEL:"切换清晰度",CHANGE_VIDEO_LEVEL_FAIL:"切换清晰度失败",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度",VIDEO_LEVEL_NOT_SUPPORT:"当前设备不支持该清晰度",VIDEO_LEVEL_FLUENT:"流畅",VIDEO_LEVEL_SATNDARD:"标清",VIDEO_LEVEL_HEIGH:"高清",VIDEO_LEVEL_SPUER:"超清",VIDEO_LEVEL_EXTREME:"极清",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"重置主题",BTN_PLAY:"播放/结束播放",BTN_SOUND:"声音",BTN_RECORDVIDEO:"录屏",BTN_CAPTURE:"截图",BTN_TALK:"对讲",BTN_ZOOM:"电子放大",BTN_3D_ZOOM:"3D定位",BTN_PTZ:"云台控制",BTN_EXPEND:"全局全屏",BTN_WEBEXPEND:"网页全屏",BTN_HD:"画面清晰度",BTN_SPEED:"回放倍速",BTN_CLOUDREC:"云存储回放",BTN_CLOUDRECORD:"云录制",BTN_REC:"本地存储",DEVICE_NAME:"设备名称",DEVICE_ID:"设备序列号",CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败",START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败",RECORD_TIPS:"今日录像",RECORDS:"个录像",OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音",SOUND_OPENED:"当前已经有画面正在播放声音",ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"已经放大到最大倍数8.0X",ZOOM_SUB_MIN:"已经缩小到最小倍数1.0X",ZOOM_LIMIT_MAX:"超出最大倍率8.0X",ZOOM_LIMIT_MIN:"超出最小倍率1.0X","3D_ZOOM":"3D定位","3D_ZOOM_DISABLE":"未启用3D定位功能","3D_ZOOM_FAILED":"3D定位失败,请重试",START_3D_ZOOM:"开启3D定位",CLOSE_3D_ZOOM:"关闭3D定位",DEVICE_NOT_SUPPORT_3D_ZOOM:"当前设备不支持3D定位功能","3D_ZOOM_ACTIVED":"3D定位已处于开启状态","3D_ZOOM_NOT_ACTIVED":"未启用3D定位功能","3D_ZOOM_CLOSED":"3D定位已处于关闭状态",CHANGE_ZOOM_TYPE:"改变缩放模式",FULLSCREEN:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏",DESTROY:"销毁",GET_CAPACITY:"获取设备能力级",GET_CAPACITY_FAILED:"获取设备能力级失败",GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距",NOT_SUPPORT_DEVICE_ZOOM:"当前设备不支持物理缩放",NOT_SUPPORT_FOCUS:"当前设备不支持变焦",MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误",CHANGE_FEC_TYPE:"切换鱼眼矫正类型",DEVICE_NOT_SUPPORT:"设备不支持鱼眼模式",TYPE_NOT_SUPPORT:"鱼眼矫正类型暂时不支持",FEC_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正",NO_CANVAS_ID:"鱼眼矫正类型需要分屏,但是没有传正确的分屏的canvas id",SET_FEC_PARAMS:"设置3D矫正视角参数",GET_FEC_PARAMS:"获取3D矫正视角参数",SET_FEC_PARAMS_FAILED:"该矫正类型不能设置3D矫正视角参数",GET_FEC_PARAMS_FAILED:"该矫正类型不能获取3D矫正视角参数",GET_FEC_PARAMS_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正获取3D矫正视角参数",SET_WATERMARK:"设置水印"},V={391001:"Illegal streaming address or port",395e3:"Internal service exception, please try again later",395400:"Preview streaming parameter exception",395402:"Device has no recording in the current time period, please select another time period",395403:"Service exception, please try again or contact customer service",395404:"The device is not online, Please optimize the network and restart the device to try again",395405:"Device side network is poor, please check and optimize the network and restart the device to try again",395406:"Token expired, please try again",395407:"Client URL format error",395409:"Service exception, please try again or contact customer service",395410:"Service exception, please try again or contact customer service",395411:"No permission to view the current device",395412:"Service exception, please try again or contact customer service",395413:"Service exception, please try again or contact customer service",395415:"Device channel error",395416:"The current number of viewing channels has reached the maximum limit of the device. Please restart the device or contact the device after-sales service",395451:"The device does not support this bitstream type. Please check the device channel support or contact the hardware after-sales service",395452:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395454:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395455:"The device channel is abnormal. Please check the channel configuration and try again",395456:"The device channel is abnormal. Please check the channel configuration and try again",395457:"Service exception, please try again or contact customer service",395458:"Service exception, please try again or contact customer service",395459:"Service exception, please try again or contact customer service",395460:"Service exception, please try again or contact customer service",395492:"Service exception, please try again or contact customer service",395500:"Service exception, please try again or contact customer service",395501:"Service exception, please try again or contact customer service",395503:"Service exception, please try again or contact customer service",395504:"Service exception, please try again or contact customer service",395505:"Service exception, please try again or contact customer service",395506:"Direct streaming of this device is not supported at present, please try again or contact customer service after connecting to NVR",395507:"Device 4G unlimited traffic package only supports EZVIZ Cloud Video APP, please contact APP customer service to change the package",395530:"Service exception, please try again or contact customer service",395544:"Video source does not exist, please check device configuration",395545:"Service exception, please try again or contact customer service",395546:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395547:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395556:"Service exception, please try again or contact customer service",395557:"Device streaming failed, please contact hardware after-sales",395558:"Error in finding the start time of recording",395560:"Service exception, please try again or contact customer service",395561:"Service exception, please try again or contact customer service",395562:"Service exception, please try again or contact customer service",395563:"Service exception, please try again or contact customer service",395564:"Service exception, please try again or contact customer service",395566:"Service exception, please try again or contact customer service",395567:"Service exception, please try again or contact customer service",395568:"Service exception, please try again or contact customer service",395569:"Service exception, please try again or contact customer service",395600:"Service exception, please try again or contact customer service",395601:"Service exception, please try again or contact customer service",395602:"Service exception, please try again or contact customer service",395610:"Service exception, please try again or contact customer service",395620:"Service exception, please try again or contact customer service",395701:"Service exception, please try again or contact customer service",395702:"Service exception, please try again or contact customer service",395703:"Service exception, please try again or contact customer service",396001:"Service exception, please try again or contact customer service",396099:"Service exception, please try again or contact customer service",396101:"Service exception, please try again or contact customer service",396102:"Service exception, please try again or contact customer service",396103:"Service exception, please try again or contact customer service",396104:"Service exception, please try again or contact customer service",396105:"Device abnormality, please try again or contact customer service",396106:"Device channel abnormality, please check the channel configuration and try again",396107:"Device abnormality, please try again or contact customer service",396108:"Service exception, please try again or contact customer service",396109:"Service exception, please try again or contact customer service",396110:"Device abnormality, please try again or contact customer service",396501:"Device abnormality, please try again or contact customer service",396502:"Device abnormality, please try again or contact customer service",396503:"Device abnormality, please try again or contact customer service",396504:"Device abnormality, please try again or contact customer service",396505:"Device abnormality, please try again or contact customer service",396506:"Device abnormality, please try again or contact customer service",396508:"Device abnormality, please try again or contact customer service",396509:"Device abnormality, please try again or contact customer service",396510:"Device abnormality, please try again or contact customer service",396511:"Device abnormality, please try again or contact customer service",396512:"Device abnormality, please try again or contact customer service",396513:"Device abnormality, please try again or contact customer service",396514:"Device abnormality, please try again or contact customer service",396515:"Device abnormality, please try again or contact customer service",396516:"Device abnormality, please try again or contact customer service",396517:"Device abnormality, please try again or contact customer service",396518:"Device abnormality, please try again or contact customer service",396519:"Device network abnormality, please check and optimize the network and restart the device to try again",396520:"Device network abnormality, please check and optimize the network and restart the device to try again",396700:"Service exception, please try again or contact customer service",396701:"Playback ends",397001:"Service exception, please try again or contact customer service",397002:"Service exception, please try again or contact customer service",397003:"Service exception, please try again or contact customer service",397004:"Service exception, please try again or contact customer service",397005:"Device streaming connection is disconnected, please check the network and try again",397006:"Service exception, please try again or contact customer service",397007:"Service exception, please try again or contact customer service",399e3:"Service exception, please try again or contact customer service",399001:"Client network timeout",399002:"Service exception, please try again or contact customer service",399016:"Token invalid, please update and retry",399048:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399049:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",3810001:"Operation failed",3810002:"Account exception, operation failed",3810005:"Account exception, operation failed",3820002:"Device does not exist, please check the device connection status",3820006:"Operation failed, please check the network condition of the device",3820007:"Operation failed, please check the network condition of the device",3820008:"The operation is too frequent, please try again later",3820014:"Operation failed",3820032:"The channel does not exist. Please check the device connection status",3849999:"Operation failed, please try again",386e4:"Operation failed, the device does not support this operation",3860001:"Operation failed, user does not have permission",3860002:"The device has been rotated to the upper limit position",3860003:"The device has been rotated to the lower limit position",3860004:"The device has rotated to the left limit position",3860005:"The device has been rotated to the right limit position",3860006:"Operation failed, please try again",3860009:"The device is currently in operation",3860020:"Operation failed",BTN_RETRY:"Retry",BTN_RELOAD:"Reload",LOADING:"Loading, please wait",TIMEFORMAT_ERROR:"The time format is wrong, please confirm",USE_MULTITHREADING_WARING:"Your current browser can enable the multi-threaded feature of Google Labs to get a better playback experience and avoid browser freezes and crashes. For details, see:",OPEN_INSTRUCTIONS:"Enablement instructions",INIT_FINSHED:"Initialize the player completed",INIT_SUCCESS:"Initialize the player successfully",GET_PLAYURL_FAILED:"Failed to obtain the playback address",VIDEO_LOADING:"Video loading",DISCONNECT:"Connection disconnected, please try again",DEVICE_ENCRYPTED:"Device encrypted",NO_RECORD:"No video clips found",PLAY_FAILED:"Play failed, please check the device and client network",PLAY_SUCCESS:"Play successfully",STOP_SUCCESS:"Stop successfully",CHANGE_PLAYURL_SUCCESS:"Switch the playback address successfully",CHANGE_PLAYURL_FAILED:"Switch the playback address failed",GET_OSD_TIME:"Get OSD time",GET_OSD_TIME_FAILED:"Failed to get OSD time",SET_POSTER:"Set the player cover",RESIZE:"Adjust the player size",SPEED:"speeds",SPEED_RATE:"X",SPEED_CANCEL:"Cancel",GET_SPEED:"Get the current playback rate",MAX_SPEED_LIMIT:"The maximum playback speed is 4 times the speed",MIN_SPEED_LIMIT:"The minimum playback speed is 1 times the speed",SEEK_CANNOT_CROSS_DAYS:"The seek time cannot cross dates",SEEK_TIMEFORMAT_ERROR:"The seek time format is wrong",PAUSE:"Pause",PAUSE_FAILED:"Pause failed",RESUME:"Resume playback",RESUME_FAILED:"Resume playback failed",CALL_END:"Call ended",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"The device has no cloud recorded video on that day",CHANGE_VIDEO_LEVEL:"Switch definition",CHANGE_VIDEO_LEVEL_FAIL:"Switch definition failed",GET_VIDEO_LEVEL_LIST:"Get the definition list supported by the device",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"Please enter the correct definition",VIDEO_LEVEL_NOT_SUPPORT:"The current device does not support this definition",VIDEO_LEVEL_FLUENT:"Fluent",VIDEO_LEVEL_SATNDARD:"Standard",VIDEO_LEVEL_HEIGH:"heigh",VIDEO_LEVEL_SPUER:"Super",VIDEO_LEVEL_EXTREME:"Extreme",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"Reset theme",BTN_PLAY:"Play/end playback",BTN_SOUND:"Sound",BTN_RECORDVIDEO:"Screen recording",BTN_CAPTURE:"Screenshot",BTN_TALK:"Intercom",BTN_ZOOM:"Electronic zoom",BTN_3D_ZOOM:"3D positioning",BTN_PTZ:"PTZ control",BTN_EXPEND:"Global full screen",BTN_WEBEXPEND:"Web page full screen",BTN_HD:"Image definition",BTN_SPEED:"Playback speed",BTN_CLOUDREC:"Cloud storage playback",BTN_CLOUDRECORD:"Cloud recording",BTN_REC:"Local storage",DEVICE_NAME:"Device name",DEVICE_ID:"Device serial number",CAPTURE_SUCCESS:"Screenshot successful",CAPTURE_FAILED:"Screenshot failed",START_RECORD_SUCCESS:"Start recording successful",START_RECORD_FAILED:"Screenshot failed",STOP_RECORD_SUCCESS:"Stop recording successful",STOP_RECORD_FAILED:"Stop recording failed",RECORD_TIPS:"Today's recording",RECORDS:" in total",OPEN_SOUND:"Turn on sound",CLOSE_SOUND:"Turn off sound",SOUND_OPENED:"There is already a picture playing sound at the moment",ZOOM:"Electronic zoom",START_ZOOM:"Turn on electronic zoom",CLOSE_ZOOM:"Turn off electronic zoom",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"It has been enlarged to a maximum magnification of 8.0X",ZOOM_SUB_MIN:"It has been reduced to the minimum multiple of 1.0X",ZOOM_LIMIT_MAX:"Exceeding maximum magnification of 8.0X",ZOOM_LIMIT_MIN:"Exceeding the minimum magnification of 1.0X","3D_ZOOM":"3D positioning","3D_ZOOM_DISABLE":"3D positioning function not enabled","3D_ZOOM_FAILED":"3D positioning failed, please try again",START_3D_ZOOM:"Turn on 3D positioning",CLOSE_3D_ZOOM:"Turn off 3D positioning",DEVICE_NOT_SUPPORT_3D_ZOOM:"Current device does not support 3D positioning function","3D_ZOOM_ACTIVED":"3D positioning is already enabled","3D_ZOOM_NOT_ACTIVED":"3D positioning function is not enabled","3D_ZOOM_CLOSED":"3D positioning is already disabled",CHANGE_ZOOM_TYPE:"Change zoom mode",FULLSCREEN:"Global full screen",FULLSCREEN_EXIT:"Exit global full screen",GET_WEB_FULLSCREEN_STATUS:"Get browser web page full screen status",WEB_FULLSCREEN:"Turn on web page full screen",WEB_FULLSCREEN_EXIT:"Exit full screen webpage",DESTROY:"Destroy",GET_CAPACITY:"Get device capability level",GET_CAPACITY_FAILED:"Get device capability level failed",GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length",NOT_SUPPORT_DEVICE_ZOOM:"Device does not support physical zoom",NOT_SUPPORT_FOCUS:"Device does not support adjusting the focal length",MIRROR:"Mirror flip",MIRROR_TYPE_ERROR:"Flip parameter type error",CHANGE_FEC_TYPE:"Switch fisheye correction type",DEVICE_NOT_SUPPORT:"Device does not support fisheye mode",TYPE_NOT_SUPPORT:"Fisheye correction type is not supported temporarily",FEC_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction",NO_CANVAS_ID:"Fisheye correction type requires split screen, but the correct split screen canvas id is not passed",SET_FEC_PARAMS:"Set 3D correction perspective parameters",GET_FEC_PARAMS:"Get 3D correction perspective parameters",SET_FEC_PARAMS_FAILED:"This correction type cannot set 3D correction perspective parameters",GET_FEC_PARAMS_FAILED:"This correction type cannot get 3D correction perspective parameters",GET_FEC_PARAMS_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction Get 3D correction perspective parameters",SET_WATERMARK:"Set watermark"},O="object"==typeof global&&global&&global.Object===Object&&global,j="object"==typeof self&&self&&self.Object===Object&&self,W=O||j||Function("return this")(),Z=W.Symbol,X=Object.prototype,q=X.hasOwnProperty,z=X.toString,AA=Z?Z.toStringTag:void 0;var eA=Object.prototype.toString;var tA=Z?Z.toStringTag:void 0;function iA(A){return null==A?void 0===A?"[object Undefined]":"[object Null]":tA&&tA in Object(A)?function(A){var e=q.call(A,AA),t=A[AA];try{A[AA]=void 0;var i=!0}catch(A){}var n=z.call(A);return i&&(e?A[AA]=t:delete A[AA]),n}(A):function(A){return eA.call(A)}(A)}function nA(A){return null!=A&&"object"==typeof A}function aA(A){return"symbol"==typeof A||nA(A)&&"[object Symbol]"==iA(A)}var oA=Array.isArray,rA=Z?Z.prototype:void 0,sA=rA?rA.toString:void 0;function gA(A){if("string"==typeof A)return A;if(oA(A))return function(A,e){for(var t=-1,i=null==A?0:A.length,n=Array(i);++t-1&&A%1==0&&A-1&&A%1==0&&A<=9007199254740991}function UA(A){return null!=A&&GA(A.length)&&!pA(A)}var JA=Object.prototype;function HA(A){return nA(A)&&"[object Arguments]"==iA(A)}var KA=Object.prototype,VA=KA.hasOwnProperty,OA=KA.propertyIsEnumerable,jA=HA(function(){return arguments}())?HA:function(A){return nA(A)&&VA.call(A,"callee")&&!OA.call(A,"callee")},WA=jA;var ZA="object"==typeof exports&&exports&&!exports.nodeType&&exports,XA=ZA&&"object"==typeof module&&module&&!module.nodeType&&module,qA=XA&&XA.exports===ZA?W.Buffer:void 0,zA=(qA?qA.isBuffer:void 0)||function(){return!1},$A={};$A["[object Float32Array]"]=$A["[object Float64Array]"]=$A["[object Int8Array]"]=$A["[object Int16Array]"]=$A["[object Int32Array]"]=$A["[object Uint8Array]"]=$A["[object Uint8ClampedArray]"]=$A["[object Uint16Array]"]=$A["[object Uint32Array]"]=!0,$A["[object Arguments]"]=$A["[object Array]"]=$A["[object ArrayBuffer]"]=$A["[object Boolean]"]=$A["[object DataView]"]=$A["[object Date]"]=$A["[object Error]"]=$A["[object Function]"]=$A["[object Map]"]=$A["[object Number]"]=$A["[object Object]"]=$A["[object RegExp]"]=$A["[object Set]"]=$A["[object String]"]=$A["[object WeakMap]"]=!1;var Ae,ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,te=ee&&"object"==typeof module&&module&&!module.nodeType&&module,ie=te&&te.exports===ee&&O.process,ne=function(){try{var A=te&&te.require&&te.require("util").types;return A||ie&&ie.binding&&ie.binding("util")}catch(A){}}(),ae=ne&&ne.isTypedArray,oe=ae?(Ae=ae,function(A){return Ae(A)}):function(A){return nA(A)&&GA(A.length)&&!!$A[iA(A)]},re=Object.prototype.hasOwnProperty;function se(A,e){var t=oA(A),i=!t&&WA(A),n=!t&&!i&&zA(A),a=!t&&!i&&!n&&oe(A),o=t||i||n||a,r=o?function(A,e){for(var t=-1,i=Array(A);++t-1},me.prototype.set=function(A,e){var t=this.__data__,i=xe(t,A);return i<0?(++this.size,t.push([A,e])):t[i][1]=e,this};var ye=NA(W,"Map");function _e(A,e){var t,i,n=A.__data__;return("string"==(i=typeof(t=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==t:null===t)?n["string"==typeof e?"string":"hash"]:n.map}function Se(A){var e=-1,t=null==A?0:A.length;for(this.clear();++er))return!1;var g=a.get(A),c=a.get(e);if(g&&c)return g==e&&c==A;var l=-1,I=!0,C=2&t?new tt:void 0;for(a.set(A,e),a.set(e,A);++l=e||t<0||l&&A-g>=a}function h(){var A=_t();if(d(A))return B(A);r=setTimeout(h,function(A){var t=e-(A-s);return l?Dt(t,a-(A-g)):t}(A))}function B(A){return r=void 0,I&&i?C(A):(i=n=void 0,o)}function u(){var A=_t(),t=d(A);if(i=arguments,n=this,s=A,t){if(void 0===r)return function(A){return g=A,r=setTimeout(h,e),c?C(A):o}(s);if(l)return clearTimeout(r),r=setTimeout(h,e),C(s)}return void 0===r&&(r=setTimeout(h,e)),o}return e=EA(e)||0,CA(t)&&(c=!!t.leading,a=(l="maxWait"in t)?St(EA(t.maxWait)||0,e):a,I="trailing"in t?!!t.trailing:I),u.cancel=function(){void 0!==r&&clearTimeout(r),g=0,i=s=n=r=void 0},u.flush=function(){return void 0===r?o:B(_t())},u}var vt=Math.max;function bt(A,e,t){var i=null==A?0:A.length;if(!i)return-1;var n=null==t?0:QA(t);return n<0&&(n=vt(i+n,0)),function(A,e,t,i){for(var n=A.length,a=t+(i?1:-1);i?a--:++a-1?i[n?A[a]:a]:void 0});var kt={color:"red",backgroundColor:"red",activeColor:"red",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-header-0",iconId:"deviceID",part:"left",defaultActive:1,isrender:1,themeId:"934f270c08b14e928bf0c2ae8e1a937d"},{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-header-1",iconId:"deviceName",part:"left",defaultActive:1,isrender:1,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},Pt={color:"blue",backgroundColor:"blue",activeColor:"blue",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-footer-0",iconId:"play",part:"left",defaultActive:0,isrender:0,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},Nt=function(A){this.jsPlugin=A;var e={id:A.id,isMouseDown:!1,isOver:!1,mousePosition:null,oldTime:null,nowTime:A.nowTime||null,moved:null,hoverTime:"2018-12-07 12:00:00",hoverLeft:0,timeTipShow:!1,randomNum:123,timeWidthTbls:[60,1800,3600,86400],timeUnits:["范围: 1分钟; 单位: 秒","范围: 30分钟; 单位: 分钟","范围: 1小时; 单位: 分钟","范围: 1天; 单位: 小时","范围: 3天; 单位: 小时"],drawPen:null,timeSection:[],canvasWidth:null,canvasHeight:null,timeTips:null},t=this;Object.keys(e).forEach((function(A){t[A]=e[A]})),this.options={width:this.canvasWidth,height:48,time:(new Date).getTime(),timeSection:[],timeWidth:0},this.subTime=function(A){return A<10?"0"+A:A},this.tranTime=function(A){var e=A;if(A){var t=new Date(A);e=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate()+" "+this.subTime(t.getHours())+":"+this.subTime(t.getMinutes())+":"+this.subTime(t.getSeconds())}return e},this.init=function(A){var e=this.options;return new Promise((function(i,n){A.width&&document.getElementById(A.id).setAttribute("width",parseInt(A.width,10)+"px"),t.randomNum=(Math.random()+"").split(".").join(""),t.timeWidthTblIndex=e.timeWidth;var a=document.getElementById("".concat(t.jsPlugin.id,"-canvas"));t.drawPen=a.getContext("2d"),t.nowTime=A.nowTime,t.timeSection=e.timeSection||[],t.canvasWidth=a.offsetWidth,t.canvasHeight=a.offsetHeight,t.updata(),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mousemove",(function(A){t.options.readOnly||t.mousemove(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseover",(function(A){t.options.readOnly||t.mouseover(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseleave",(function(A){t.options.readOnly||t.mouseleave(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mousedown",(function(A){t.options.readOnly||t.mousedown(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseup",(function(e){if(!t.options.readOnly){var i=A.onChange;t.mouseUpFn(e,i)}})),i()}))},this.setWidth=function(A){A.width&&(document.getElementById(A.id).width=A.width,document.getElementById("".concat(A.id,"-canvas")).width=A.width,document.getElementById("".concat(A.id,"-canvas-container")).width=A.width,t.canvasWidth=A.width,t.updata({time:t.nowTime||new Date}))},this.mousemove=function(A){if(this.isMouseDown&&this.isOver){var e=this.mousePosition-A.pageX;if(0===e)return;var t=0;switch(this.timeWidth){case 60:t=.1;break;case 1800:t=3;break;case 3600:t=90;break;case 86400:t=120}var i=new Date(this.oldTime).getTime()+e*t*1e3;this.updata({time:i}),this.moved=!0}else{var n=parseInt(document.getElementById("".concat(this.jsPlugin.id,"-canvas-container")).offsetLeft,10);this.mousePosition=A.pageX-n,this.updata()}},this.mousedown=function(A){this.isMouseDown=!0,this.mousePosition=A.pageX,this.oldTime=this.nowTime},this.mouseover=function(A){this.isOver=!0},this.mouseleave=function(A){this.isOver=!1,this.isMouseDown=!1,this.updata()},this.changeSize=function(A){console.log("changeSize",A),this.options.timeWidth=A,this.updata({timeWidth:A})},this.mouseUpFn=function(A,e){if(this.isMouseDown&&(this.isMouseDown=!1,this.moved)){this.moved=!1;var t=new Date(this.nowTime).getFullYear()+"/"+(new Date(this.nowTime).getMonth()+1)+"/"+new Date(this.nowTime).getDate()+" "+this.subTime(new Date(this.nowTime).getHours())+":"+this.subTime(new Date(this.nowTime).getMinutes())+":"+this.subTime(new Date(this.nowTime).getSeconds());this.nowTime=new Date(t),this.updata({time:this.nowTime}),this.oldTime=this.nowTime,console.log("nowTime",new Date(this.nowTime),t),e(this.nowTime)}},this.readOnly=function(A){console.log("更改为只读"),this.options.readOnly=!0,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="not-allowed"},this.unReadOnly=function(A){console.log("更改为只读"),this.options.readOnly=!1,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="pointer"},this.run=function(A){t.isMouseDown||t.updata(A)},this.getTime=function(A){console.log("this",this),console.log("当前时间",new Date(this.nowTime))},this.updata=function(A){A=A||{},t.nowTime=A.time||t.nowTime,t.timeSection=A.timeSection||t.timeSection,t.timeWidthTblIndex=A.timeWidth||t.timeWidthTblIndex,t.timeWidth=t.timeWidthTbls[A.timeWidth||t.timeWidthTblIndex],t.timeUnit=t.timeUnits[A.timeWidth||t.timeWidthTblIndex],0===A.timeWidth&&(t.timeWidthTblIndex=0,t.timeWidth=t.timeWidthTbls[0],t.timeUnit=t.timeUnits[0]),t.drawPen.fillStyle="#000000",t.drawPen.fillRect(0,0,t.canvasWidth,t.canvasHeight),t.drawScale(),t.drawRecord(),t.drawOtherMsg()},this.drawSolidLine=function(A,e,t,i,n,a){this.drawPen.save(),this.drawPen.strokeStyle=a,this.drawPen.lineWidth=n,this.drawPen.beginPath(),this.drawPen.moveTo(A,e),this.drawPen.lineTo(t,i),this.drawPen.stroke(),this.drawPen.restore()},this.drawString=function(A,e,t,i,n){this.drawPen.font="12px serif",this.drawPen.fillStyle="#ffffff",this.drawPen.textAlign=i||"left",this.drawPen.fillText(A,e,t+10)},this.drawScale=function(){var A=this,e="rgba(255,255,255)",t=new Date(A.nowTime),i=t.getSeconds(),n=t.getMinutes(),a=t.getHours(),o=t.getDate(),r=0;switch(A.timeWidth){case 60:var s=parseInt(A.canvasWidth/10);t.setSeconds(t.getSeconds()-parseInt(s/2,10)),o=t.getDate(),a=t.getHours(),n=t.getMinutes(),i=t.getSeconds();for(var g=0;ge.canvasWidth&&(i=e.canvasWidth),i<=0&&(i=0),i}},this.drawOtherMsg=function(){this.drawSolidLine(this.canvasWidth/2,0,this.canvasWidth/2,this.canvasHeight,2,"#1890FF"),this.drawPen.shadowBlur=0,this.isOver&&!this.isMouseDown?(this.mouseTime=this.mousePosition/this.canvasWidth*this.timeWidth*1e3+this.nowTime-this.timeWidth/2*1e3,this.mouseString=this.tranTime(this.mouseTime),this.hoverTime=this.mouseString,this.hoverLeft=this.mousePosition-60,this.timeTipShow=!0):this.timeTipShow=!1}},Tt="https://open.ys7.com",Mt=256,Lt=1536,Yt=2304,Gt=[{place:3,name:"鱼眼不矫正",type:0,correctType:0},{place:3,name:"360°全景",type:1,correctType:768},{place:3,name:"4分屏",type:4,correctList:[{correctType:Mt,x:.25,y:.25},{correctType:Mt,x:.75,y:.25},{correctType:Mt,x:.25,y:.75},{correctType:Mt,x:.75,y:.75}],correctType:Mt},{place:3,name:"柱状",type:5,correctType:Lt,viewParam:{x:0,y:0}}],Ut=[{place:1,name:"鱼眼不矫正",type:0,correctType:0},{place:1,name:"360°全景",type:1,correctType:768},{place:1,name:"4分屏",type:2,correctList:[{correctType:Mt,x:.25,y:.25},{correctType:Mt,x:.75,y:.25},{correctType:Mt,x:.25,y:.75},{correctType:Mt,x:.75,y:.75}],correctType:Mt},{place:1,name:"广角",type:4,correctType:Yt}];var Jt=Tt,Ht=function(){return o((function A(e){return t(this,A),A.instant?A.instant:(Jt=e||Jt,A.instant=this)}),[{key:"setDomain",value:function(A){Jt=A||Jt}},{key:"fetch",value:function(A){function e(e,t){return A.apply(this,arguments)}return e.toString=function(){return A.toString()},e}((function(A,e){return A="string"==typeof A?/^http/.test(A)?A:Jt+A:A,new Promise((function(t,i){fetch(A,e).then((function(A){try{return A.json()}catch(A){i({code:-1,msg:"data json parse error"})}})).then((function(A){200==+A.code||A.meta&&200===A.meta.code?t(A):i(A)})).catch((function(A){i(A)}))}))}))}])}();function Kt(A){var e=A.slice(0,4),t=A.slice(4,6),i=A.slice(6,8),n=A.slice(8,10),a=A.slice(10,12),o=A.slice(12,14);return new Date("".concat(e,"/").concat(t,"/").concat(i," ").concat(n,":").concat(a,":").concat(o))}function Vt(A,e){var t,i,n={startTime:e.startTime?new Date(e.startTime).Format("yyyy-MM-dd hh:mm:ss"):void 0,endTime:e.startTime?new Date(e.endTime).Format("yyyy-MM-dd hh:mm:ss"):void 0,spaceId:e.spaceId},a=Object.keys(n).reduce((function(A,e){return null==n[e]?A:A+="&".concat(e,"=").concat(encodeURIComponent(n[e]))}),"").replace("&",""),o=A.env.domain+"/api/service/cloudrecord/video/info/list?".concat(a);return(t=o,i={method:"get",headers:{accessToken:A.accessToken||A.token.deviceToken.global,deviceSerial:e.deviceSerial,localIndex:e.channelNo}},new Promise((function(A,e){fetch(t,i).then((function(A){return A.json()})).then((function(t){200==+t.code||t.meta&&200===t.meta.code?A(t):e(t)})).catch((function(A){e(A)}))}))).then((function(A){return A.data=(A.data||[]).map((function(A){return A.endTime=Kt(A.stopTime).getTime(),A.startTime=Kt(A.startTime).getTime(),A.busType=7,A})),A}))}function Ot(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(e<=-24||e>=24)&&(e=0);var t=A.slice(0,4),i=A.slice(4,6),n=A.slice(6,8),a=A.slice(8,10),o=A.slice(10,12),r=A.slice(12,14),s=new Date(t,i-1,n,a,o,r);s.setHours(s.getHours()+e),s>new Date&&(s=new Date);var g=s.getFullYear(),c=("0"+(s.getMonth()+1)).slice(-2),l=("0"+s.getDate()).slice(-2),I=("0"+s.getHours()).slice(-2),C=("0"+s.getMinutes()).slice(-2),d=("0"+s.getSeconds()).slice(-2);return new Date("".concat(g,"/").concat(c,"/").concat(l," ").concat(I,":").concat(C,":").concat(d))}s(Ht,"instant",void 0);var jt=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(e<=-24||e>=24)&&(e=0);var t=60*e*60*1e3,i=A.getTime()+t;return new Date(i)},Wt=function(){return o((function A(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{rejection:!1,play:!1,pantile:!1,recordvideo:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1};t(this,A),this.id=e,this.state=i}),[{key:"getState",value:function(){return this.state}},{key:"setState",value:function(A){this.state=c(c({},this.state),A)}}])}(),Zt=function(){return o((function A(){var e=this;t(this,A),s(this,"createInstance",(function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.instances.has(A)&&(console.warn("Instance with id ".concat(A," already exists.")),e.removeInstance(A));var i=new Wt(A,t);e.instances.set(A,i)})),s(this,"getInstance",(function(A){return e.instances.has(A)?e.instances.get(A):(console.warn("Instance with id ".concat(A," does not exist.")),null)})),s(this,"removeInstance",(function(A){if(!e.instances.has(A))return console.warn("Instance with id ".concat(A," does not exist.")),null;e.instances.delete(A)})),s(this,"listInstances",(function(){return Array.from(e.instances.values())})),this.instances=new Map,this.globalState={talk:!1,expend:!1,webExpend:!1,sound:!1}}),[{key:"getGlobalState",value:function(){return this.globalState}},{key:"setGlobalState",value:function(A){this.globalState=c(c({},this.globalState),A)}}])}(),Xt=new Zt,qt=function(){return o((function A(e){if(t(this,A),this.jSPlugin=e,!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0,this.date=new Date,this.datepickerVisible=!1,this.seekTimer=null,this.disabled=!1,this.isSeeking=!1,this.seekFrequency=2e3,this.recList=[],this.lastDate=null,this.nowTime=null,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),this.datepickerLang={zh:"zh-CN",en:"en-US"},this.recInit()}),[{key:"recInit",value:function(){var A,e,t=this;if(!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0;var i=parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).width,10)-100,n=document.createElement("div");n.style="display:inline-block;height:48px;",n.id=this.jSPlugin.id+"-canvas-container",n.className="ezuikit-time-line-control";var a=document.createElement("canvas");a.id=this.jSPlugin.id+"-canvas",a.className="time-line-body",a.height="48",a.width=i,a.style="display:inline-block;",a.innerHTML="该浏览器不支持canvas",n.appendChild(a),m(n,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")));var o=document.createElement("div");o.className="timeline-controls",o.style="display:flex;width:100px;height:48px;text-align:center;line-height: 48px;vertical-align: top;background: #000000;";var r='\n
\n \n \n add\n \n \n \n \n \n \n \n \n \n \n \n \n \n reduce\n \n \n \n \n \n \n \n \n
\n\n\n');o.innerHTML=r,m(o,n),this.timeLine=new Nt(this.jSPlugin);var s=this;this.timeLine.init({id:this.jSPlugin.id+"-canvas",width:i,nowTime:this.nowTime,onChange:function(A){console.log("time",A,new Date(A).Format("yyyyMMddhhmmss"));var e=new Date(A).Format("yyyyMMddhhmmss");if(console.log("----------------this.jSPlugin.url",t.jSPlugin.url),t.jSPlugin.Theme&&t.jSPlugin.Theme.decoderState.state.recordvideo&&(t.jSPlugin.Theme.setDecoderState({recordvideo:!1}),"cloud.rec"===_(t.jSPlugin.url).type&&t.jSPlugin.stopSave()),"cloud.rec"===_(t.jSPlugin.url).type||t.jSPlugin.useSeek&&t.jSPlugin.capacity&&"1"==t.jSPlugin.capacity.support_seek_playback){if(!t.isSeeking)if(s.recList.length>0)if(new Date(A).valueOf()>=s.lastDate)t.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3});else t.jSPlugin.Theme.decoderState.state.play?t.unSyncTimeLine().then((function(){t.isSeeking=!0,t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),t.jSPlugin.pluginStatus.loadingSetText({text:t.jSPlugin.i18n.t("LOADING")}),t.jSPlugin.Theme.setDisabled(!0),t.jSPlugin._tempSeekTime=A,t.jSPlugin.seek(e.substr(8,6),"235959").then((function(){var e=setInterval((function(){t.jSPlugin._destroy?clearInterval(e):t.jSPlugin.getOSDTime().then((function(i){var n=new Date(A).valueOf()/1e3;if(console.log("seek时间同步:",new Date(1e3*i.data).Format("hh:mm:ss"),new Date(1e3*n).Format("hh:mm:ss"),i.data>=n),i.data>=n-2){t.isSeeking=!1,t.syncTimeLine(),clearInterval(e),t.jSPlugin.pluginStatus.loadingStop(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),t.jSPlugin.pluginStatus.loadingClear(),t.jSPlugin.Theme.setDisabled(!1),t.jSPlugin._tempSeekTime=null,s.jSPlugin.waterMark_JSPlugin&&s.jSPlugin.setWaterMarkFont(s.jSPlugin.waterMark_JSPlugin);var a=t.jSPlugin.Theme.decoderState.state.sound,o=Xt.getInstance(t.jSPlugin.id);a&&o.getState().sound&&setTimeout((function(){t.jSPlugin.openSound()}),500)}}))}),1e3)}))})):t.unSyncTimeLine().then((function(){t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),t.jSPlugin.pluginStatus.loadingSetText({text:t.jSPlugin.i18n.t("LOADING")}),t.jSPlugin.Theme.setDisabled(!0);var A=t.jSPlugin.url;A.indexOf("begin")>-1?A=A.replace(/(begin=)(\d+)/,(function(A,t,i){return t+e})):A+="?begin=".concat(e),t.jSPlugin.play({url:A}).then((function(){t.syncTimeLine(),t.jSPlugin.pluginStatus.loadingStop(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),t.jSPlugin.pluginStatus.loadingClear(),t.jSPlugin.Theme.setDisabled(!1),s.jSPlugin.waterMark_JSPlugin&&s.jSPlugin.setWaterMarkFont(s.jSPlugin.waterMark_JSPlugin)})).catch((function(A){console.log("时间轴拖动失败:",A)}))}))}else{var i=function(){setTimeout((function(){t.disabled=!1}),t.seekFrequency)},n=function(A){t.disabled=!0,t.unSyncTimeLine().then((function(){t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),t.jSPlugin.pluginStatus.loadingSetText({text:t.jSPlugin.i18n.t("LOADING")}),t.jSPlugin.Theme.setDisabled(!0);var i=t.jSPlugin.url;i.indexOf("begin")>-1?i=i.replace(/(begin=)(\d+)/,(function(A,t,i){return t+e})):i+="?begin=".concat(e),t.jSPlugin.play({url:i,unSaveUrl:!0,showPoster:!0}).then((function(){A&&A(),t.syncTimeLine(),t.jSPlugin.pluginStatus.loadingStop(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),t.jSPlugin.pluginStatus.loadingClear(),t.jSPlugin.Theme.setDisabled(!1),s.jSPlugin.waterMark_JSPlugin&&s.jSPlugin.setWaterMarkFont(s.jSPlugin.waterMark_JSPlugin),t.jSPlugin.Theme.decoderState.state.sound&&t.jSPlugin.openSound()})).catch((function(A){console.log("时间轴拖动失败:",A)}))})),t.jSPlugin.Theme&&t.jSPlugin.Theme.decoderState&&t.jSPlugin.Theme.decoderState.state&&t.jSPlugin.Theme.decoderState.state.zoom&&(t.jSPlugin.Theme.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom())};t.disabled?(console.log("操作频繁,等待2秒后执行"),t.seekTimer&&clearTimeout(t.seekTimer),t.seekTimer=setTimeout((function(){n(i)}),t.seekFrequency)):n(i)}}}).then((function(){t.syncTimeLine()}));var g,c,l=null===(A=document.getElementById("".concat(this.jSPlugin.id,"-wrap")))||void 0===A||null===(e=A.classList)||void 0===e?void 0:e.contains("ezuikit-player-wrap-mobile-fullscreen");if(document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"))&&!this.jSPlugin._isCurrentBrowserFullscreen&&!l){var I=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container")).clientHeight;this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-I,!0)}g=s.jSPlugin,c=document.getElementById("".concat(g.id,"-wrap")),f("".concat(g.staticPath,"/rec/datepicker.min.css")),u("".concat(g.staticPath,"/rec/jquery.min.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.").concat(s.datepickerLang[A.language],".js"),(function(A){var e=c.getElementsByClassName("datepicker-container")[0];!e&&$("#".concat(A.id,"-datepicker")).datepicker&&$("#".concat(A.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:s.datepickerLang[A.language],date:new Date(p("begin",A.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:c}),(e=c.getElementsByClassName("datepicker-container")[0])&&(e.style.display="none"),s.datepickerVisible=!1,$("#".concat(A.id,"-datepicker")).on("pick.datepicker",(function(t){if(console.log("重新选择日期",t.date,new Date(t.date).Format("yyyyMMddhhmmss"),new Date(document.getElementById("".concat(A.id,"-datepicker")).value).Format("yyyyMMdd")),t.date>new Date||new Date(t.date).Format("yyyyMMddhhmmss")===new Date(document.getElementById("".concat(A.id,"-datepicker")).value).Format("yyyyMMdd"))t.preventDefault();else{var i=new Date(t.date).Format("yyyy-MM-dd");document.getElementById("".concat(A.id,"-datepicker")).value=i,A.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:i}}),s.renderRec(t.date),A.Theme.decoderState&&A.Theme.decoderState.state?A.Theme.decoderState.state.cloudRec?A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"},(function(){}),!1).then((function(A){s.jSPlugin.Theme.decoderState.state.sound&&s.jSPlugin.openSound()})):A.Theme.decoderState.state.rec?A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"rec"},(function(){}),!1).then((function(A){s.jSPlugin.Theme.decoderState.state.sound&&s.jSPlugin.openSound()})):A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss")},(function(){}),!1).then((function(A){s.jSPlugin.Theme.decoderState.state.sound&&s.jSPlugin.openSound()})):A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss")},(function(){}),!1).then((function(A){s.jSPlugin.Theme.decoderState.state.sound&&s.jSPlugin.openSound()}))}e&&(e.style.display="none"),s.datepickerVisible=!1,A.Theme&&A.Theme.decoderState&&A.Theme.decoderState.state&&A.Theme.decoderState.state.zoom&&(A.Theme.setDecoderState({zoom:!1}),A.Zoom.stopZoom())})),$("#".concat(A.id,"-datepicker")).off("click").on("click",(function(A){console.log("点击日期"),s.datepickerVisible?e&&(e.style.display="none"):e&&(e.style.display="inline"),s.datepickerVisible=!s.datepickerVisible}))}),(function(){}),A)}),(function(){}),A)}),(function(){}),g),document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-add")).onclick=function(){t.unSyncTimeLine().then((function(){t.currentTimeWidth<3&&t.timeLine.changeSize(++t.currentTimeWidth),t.syncTimeLine()}))},document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-sub")).onclick=function(){t.unSyncTimeLine().then((function(){t.currentTimeWidth>0&&t.timeLine.changeSize(--t.currentTimeWidth),t.syncTimeLine()}))};var C=p("begin",this.jSPlugin.url)||(new Date).Format("yyyyMMdd");C=Ot(C,p("timeZone",this.jSPlugin.url)?parseInt(p("timeZone",this.jSPlugin.url)):0),this.renderRec(C.Format("yyyy-MM-dd")),this.observer=new MutationObserver((function(A,e){}));var d=document.getElementById("".concat(this.jSPlugin.id));this.observer.observe(d,{attributes:!0,attributeOldValue:!0,attributeFilter:["style"]})}},{key:"destroy",value:function(){Q("".concat(this.jSPlugin.staticPath,"/rec/datepicker.min.css")),E("".concat(this.jSPlugin.staticPath,"/rec/jquery.min.js")),E("".concat(this.jSPlugin.staticPath,"/rec/datepicker.js")),E("".concat(this.jSPlugin.staticPath,"/rec/datepicker.").concat(this.datepickerLang[this.jSPlugin.language],".js"))}},{key:"setDatepickerDate",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(e){var t=e.getElementsByClassName("datepicker-container")[0];if(t){var i=t;i.parentNode.removeChild(i),document.getElementById("".concat(this.jSPlugin.id,"-datepicker")).value=A.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"),$("#".concat(this.jSPlugin.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:"zh-CN",defaultDate:A,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:document.getElementById("".concat(this.jSPlugin.id,"-wrap"))})}}}},{key:"datepickerHide",value:function(){var A=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));A&&(A.getElementsByClassName("datepicker-container")[0].style.display="none");this.datepickerVisible=!1}},{key:"datepickerShow",value:function(){var A=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));A&&(A.getElementsByClassName("datepicker-container")[0].style.display="inline");this.datepickerVisible=!0}},{key:"recAutoSize",value:function(A){var e=this,t=this,i=parseInt(getComputedStyle(document.getElementById(t.jSPlugin.id)).width,10)-100;document.getElementById("".concat(this.jSPlugin.id,"-canvas"))&&i!==parseInt(document.getElementById("".concat(t.jSPlugin.id,"-canvas")).width)&&t.unSyncTimeLine().then((function(){t.timeLine.setWidth({id:"".concat(e.jSPlugin.id),width:i}),t.syncTimeLine(),A&&A()}))}},{key:"syncTimeLine",value:function(){var A=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((function(A){clearInterval(A)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];var e=this;this.jSPlugin.recTimer=setInterval((function(){e.jSPlugin.getOSDTime().then((function(t){var i=t.data;if(-1===i)console.log("获取播放时间错误");else if(i>0){var n=new Date(i>1e12?i:1e3*i);A.nowTime=n,e.timeLine.run({time:n})}})).catch((function(A){var t=e.jSPlugin.Theme.decoderState.state.pauseDate;e.timeLine.run({time:e.timeLine.nowTime||t})}))}),1e3),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer)}},{key:"unSyncTimeLine",value:function(){var A=this;return new Promise((function(e,t){A.jSPlugin.recTimer&&(clearInterval(A.jSPlugin.recTimer),A.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[A.jSPlugin.id])&&(window.recTimer[A.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[A.jSPlugin.id]=[]):window.recTimer={},e()}))}},{key:"renderRec",value:function(A){var e=this;this.date=A;var t=this,i=new Date(new Date(A).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime();this.jSPlugin.timeZone&&-1===this.jSPlugin.url.indexOf(".cloud")&&(i=new Date(jt(new Date(i),this.jSPlugin.timeZone).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime());var n=new Date(new Date(i).Format("yyyy-MM-dd 23:59:59").replace(/-/g,"/")).getTime();if(this.timeLine.getRecord([],i,n),this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===p("busType",this.jSPlugin.url)){var a={deviceSerial:_(this.jSPlugin.url).deviceSerial,channelNo:_(this.jSPlugin.url).channelNo,startTime:i,endTime:n,spaceId:this.jSPlugin._spaceId};Vt(this.jSPlugin,a).then((function(A){if(A.data&&A.data.length>0){var a=A.data;t.recList=a,t.lastDate=a[a.length-1].endTime,e.timeLine.getRecord(a,i,n)}}))}else{var o={accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,recType:"cloud.rec"===_(this.jSPlugin.url).type?1:2,deviceSerial:_(this.jSPlugin.url).deviceSerial,channelNo:_(this.jSPlugin.url).channelNo,startTime:i,endTime:n,version:"2.0"},r=this.jSPlugin.env.domain+"/api/lapp/video/by/time";D(r,"POST",o,"",(function(A){if(A.data&&A.data.files&&A.data.files.length>0){var a=A.data.files,r=(new Date).getTime(),s=A.data.isAll;if(t.recList=a,t.lastDate=a[a.length-1].endTime,s)e.timeLine.getRecord(a,i,n);else{var g=function(){o.startTime=r,D(this.jSPlugin.env.domain+"/api/lapp/video/by/time","POST",o,"",(function(A){A.data&&A.data.files&&A.data.files.length>0&&0==A.data.isAll?(A.data.files&&(a=a.concat(A.data.files),t.recList=a,t.lastDate=a[a.length-1].endTime),r=A.data.nextFileTime>0?A.data.nextFileTime:(new Date).getTime(),g()):t.timeLine.getRecord(a,i,n)}))};g()}e.timeLine.run({time:new Date(i)})}else A.data&&A.data.length>0&&(t.recList=A.data,t.lastDate=A.data[A.data.length-1].endTime,t.timeLine.getRecord(A.data,i,n),t.timeLine.run({time:new Date(i)}))}))}}}])}(),zt=function(A){this.state={id:A.id,start:"00:00:00",end:"24:00:00",current:0,timelag:30,timeArr:[],availTimeLine:[],scrollTop:0,index:0,date:"",noTimeLineTxt:"",disabled:!1};var e=this;this.setState=function(A){Object.keys(A).forEach((function(t){e.state[t]=A[t],"scrollTop"===t&&document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.scrollTo(0,A[t]),"current"===t&&document.getElementById("time-line-current")&&(document.getElementById("time-line-current").innerHTML=A[t])}))},this.setDisabled=function(A){this.setState({disabled:A}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.style.overflowY=A?"hidden":"scroll")},this.timeToSecond=function(A){var e=A.split(":"),t=Number(e[0]),i=Number(e[1]),n=Number(e[2]);return 60*t*60+60*i+(n||0)},this.minuteToTime=function(A){var e=Math.floor(A/60),t=A%60;return(e>9?e:"0"+e)+":"+(t>9?t:"0"+t)},this.timeToMinute=function(A){var e=A.split(":");return 60*Number(e[0])+Number(e[1])},this.getPlayParam=A.getPlayParam,this.checkIsAppleDevice=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)},this.checkIsHarmonyOS=function(){return navigator.userAgent.indexOf("ohos")>-1},this.checkIsHarmonyOS()?(document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchstart",(function(){if(e.state.disabled)return!1;A.ontouchstart()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchmove",(function(){if(e.state.disabled)return!1;A.ontouchmove()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchend",(function(){if(e.state.disabled)return!1;var t;new Promise((function(A,e){var i=-1;t=setInterval((function(){var e,n,a=null===(e=document.getElementById("time-line-item"))||void 0===e||null===(n=e.parentNode)||void 0===n?void 0:n.scrollTop;a!==i?(console.log("scolling",a,i),i=a):(console.log("scoll stop",a,i),clearInterval(t),A(a))}),100)})).then((function(A){console.log("scollPromise: then",A,e),e.rectTopTotime(A),console.log("页面滚动实际高度",A,e.state),e.getPlayParam({current:e.state.current})})),A.ontouchend()}),!1)):(document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchstart=function(){if(e.state.disabled)return!1;A.ontouchstart()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchmove=function(){if(e.state.disabled)return!1;A.ontouchmove()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchend=function(){if(e.state.disabled)return!1;var t;new Promise((function(A,e){var i=-1;t=setInterval((function(){var e,n,a=null===(e=document.getElementById("time-line-item"))||void 0===e||null===(n=e.parentNode)||void 0===n?void 0:n.scrollTop;a!==i?(console.log("scolling",a,i),i=a):(console.log("scoll stop",a,i),clearInterval(t),A(a))}),100)})).then((function(A){console.log("scollPromise: then",A,e),e.rectTopTotime(A),console.log("页面滚动实际高度",A,e.state),e.getPlayParam({current:e.state.current})})),A.ontouchend()})),this.matchTimeDot()};zt.prototype.changeScale=function(A){this.setState({timelag:A}),this.matchTimeDot()},zt.prototype.setDateLine=function(A,e){A.length>0?(void 0===e&&(e=A.length-1),this.setState({availTimeLine:A,start:A[e].st,end:A[e].et,current:A[e].st}),this.matchRecTimeDot(),this.primaryOffsetH()):(this.setState({availTimeLine:[]}),this.matchRecTimeDot())},zt.prototype.matchTimeDot=function(){var A=this.state;A.start;var e=A.end,t=A.timelag;A.availTimeLine;for(var i=[],n=this.timeToMinute(e),a=n=Math.floor(n/t)*t;a>=0;){var o=0,r=0;a==n&&(o=70),0==a&&(r=230);var s=this.minuteToTime(a);i.push({id:a,current:s,label:"a"+a,marginTop:o,marginBottom:r,recArr:[]}),a-=t}this.setState({timeArr:i}),this.renderDateLine()},zt.prototype.matchRecTimeDot=function(){var A=this.state,e=A.start,t=A.end,i=A.timelag,n=A.availTimeLine,a=A.timeArr;console.log("start",e,"end",t);var o=n.length;if(0===o)for(var r=0;rc&&a[r].id')})),n+="
').concat(A.current,"
"),i.innerHTML=n,t.appendChild(i)}))},zt.prototype.primaryOffsetH=function(){var A=this.state,e=A.start,t=A.timelag,i=A.timeArr[0].current,n=this.timeToSecond(i)-this.timeToSecond(e),a=Math.ceil(n/t)+60;this.setState({scrollTop:a}),console.log("起始偏移量",a)},zt.prototype.currentOffsetH=function(){var A=this.state,e=A.current,t=A.timelag,i=A.timeArr[0].current,n=this.timeToSecond(i)-this.timeToSecond(e),a=Math.ceil(n/t)+60;this.setState({scrollTop:a})},zt.prototype.rectTopTotime=function(A){var e,t,i=this.state.timelag,n=Math.floor(A/60),a=A-60*n;if(console.log("index:",n,"offsetH:",a),0==a)e=this.state.timeArr[n-1].current,t=0;else{var o=this.state.timeArr[n].current,r=this.timeToMinute(o),s=(60-a)*i,g=Math.floor(s/60)+r,c=60*Math.floor(s/60);t=Math.ceil(s-c),e=this.minuteToTime(g)}this.setState({current:e+":"+(t>9?t:"0"+t),scrollTop:A})},zt.prototype.stepScrollTimeLine=function(A){this.setState({current:A}),this.currentOffsetH()},zt.prototype.secondCountDown=function(A){var e=this.state.current.split(":"),t=60*Number(e[0])*60+60*Number(e[1])+Number(e[2])+1,i=Math.floor(t/3600),n=Math.floor((t-3600*i)/60),a=t-3600*i-60*n;this.setState({current:(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)+":"+(a>9?a:"0"+a)})};var $t=zt;function Ai(A){var e=new Date(A),t=e.getHours(),i=e.getMinutes(),n=e.getSeconds();return(t>9?t:"0"+t)+":"+(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)}Date.prototype.Format=function(A){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var t in/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+t+")").test(A)&&(A=A.replace(RegExp.$1,1==RegExp.$1.length?e[t]:("00"+e[t]).substr((""+e[t]).length)));return A};var ei=function(){function A(e,i,n){if(t(this,A),this.changeRecSpeed=i,this.resetMobileZoomStatus=n,this.isMobile=!0,this.jSPlugin=e,this.date=(new Date).Format("yyyy-MM-dd"),this.begin=((new Date).Format("yyyy-MM-dd")+" 00:00:00").replace(/-/g,"/"),this.end=((new Date).Format("yyyy-MM-dd")+" 23:59:59").replace(/-/g,"/"),this.initBegin=null,this.initEnd=null,this.type=_(this.jSPlugin.url).type,this.operating=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.recList=[],this.isSeeking=!1,this.datepickerLang={zh:"zh-CN",en:"en-US"},this.datepickerVisible=!1,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),A._instanceStyle(),p("begin",this.jSPlugin.url)){var a=p("begin",this.jSPlugin.url);this.date=a.slice(0,4)+"/"+a.slice(4,6)+"/"+a.slice(6,8),this.begin=this.date+" ".concat(a.slice(8,10)||"00",":").concat(a.slice(10,12)||"00",":").concat(a.slice(12,14)||"00"),this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(p("end",this.jSPlugin.url)){var o=p("end",this.jSPlugin.url);this.end=this.date+" ".concat(o.slice(8,10)||"23",":").concat(o.slice(10,12)||"59",":").concat(o.slice(12,14)||"59"),this.initEnd=this.end}this.recInit()}return o(A,[{key:"recInit",value:function(){this.createDom(),this.initTimeLine(),this.fetchDeviceRec(),this.injectJsCss(this.jSPlugin),this.syncTimeLine(),this.bindEvent()}},{key:"injectJsCss",value:function(A){this.unInjectJsCss();var e=this,t=document.getElementById("".concat(A.id,"-wrap"));f("".concat(A.staticPath,"/rec/datepicker.min.css")),u("".concat(A.staticPath,"/rec/jquery.min.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.").concat(e.datepickerLang[A.language],".js"),(function(A){var i=t.getElementsByClassName("datepicker-container")[0];!i&&$("#".concat(A.id,"-datepicker")).datepicker&&$("#".concat(A.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:e.datepickerLang[A.language],date:new Date(p("begin",A.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:t}),(i=t.getElementsByClassName("datepicker-container")[0])&&(i.style.display="none",i.style.bottom="-314px",i.style.right="0px"),e.datepickerVisible=!1,$("#".concat(A.id,"-datepicker")).on("pick.datepicker",(function(t){var n={begin:new Date(t.date).Format("yyyyMMddhhmmss")};if(e.begin=t.date,e.end=new Date(t.date).Format("yyyy-MM-dd")+" 23:59:59",t.date>new Date||new Date(t.date).Format("yyyyMMdd")===new Date(document.getElementById("".concat(A.id,"-datepicker")).getAttribute("data-value")).Format("yyyyMMdd"))t.preventDefault();else{var a=new Date(t.date).Format("yyyy/MM/dd");document.getElementById("".concat(A.id,"-datepicker"))&&document.getElementById("".concat(A.id,"-datepicker")).setAttribute("data-value",a),e.date=a,A.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:a}}),A.Theme.decoderState&&A.Theme.decoderState.state&&(A.Theme.decoderState.state.cloudRec?n={begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"}:A.Theme.decoderState.state.rec&&(n={begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"rec"}))}A.changePlayUrl(n,(function(){}),!1).then((function(){setTimeout((function(){var A=document.getElementById("date");A&&(A.value=new Date(t.date).Format("yyyy-MM-dd"))}),0),e.fetchDeviceRec(),e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound(),e.syncTimeLine()})),e.changeRecSpeed(1),e.resetMobileZoomStatus(),i&&(i.style.display="none"),e.datepickerVisible=!1})),$("#".concat(A.id,"-datepicker")).off("click").on("click",(function(A){e.datepickerVisible?i&&(i.style.display="none"):i&&(i.style.display="inline"),e.datepickerVisible=!e.datepickerVisible})),document.getElementById("date-picker")&&document.getElementById("date-picker").addEventListener("focus",(function(A){A.target.blur()}))}),(function(){}),A)}),(function(){}),A)}),(function(){}),A)}},{key:"createDom",value:function(){var A=document.createElement("div");A.id="date-switch-container-wrap",A.className="date-switch-container-wrap",A.style="",A.innerHTML='\n
\n
'.concat(this.jSPlugin.i18n.t("RECORD_TIPS"),'
\n
\n \n
\n
\n
\n '),m(A,document.getElementById("".concat(this.jSPlugin.id,"-wrap")));var e=document.createElement("div");e.id="rec-type-container-wrap",e.className="rec-type-container-wrap",e.style="",e.innerHTML='\n
\n
0'.concat(this.jSPlugin.i18n.t("RECORDS"),'
\n
\n \n
\n
\n '),m(e,A);var t=document.createElement("div");t.id="mobile-rec-wrap",t.className="mobileRec-wrap",t.style="",t.innerHTML='\n
\n
\n
00:00:00
\n
\n
\n
\n
\n
\n
\n ',m(t,e)}},{key:"initTimeLine",value:function(){var A=this;this.TimeLineOBJ=new $t({id:"time-line-item",getPlayParam:function(e){var t=A;console.log("子组件传值到父组件",e,e.current,A.date);var i=e.current,n=new Date(A.date).Format("yyyyMMdd").substr(0,8)+(e.current?i.replace(/:/g,""):e.current.replace(/:/g,""));if("cloud.rec"===A.type||A.jSPlugin.useSeek&&A.jSPlugin.capacity&&"1"==A.jSPlugin.capacity.support_seek_playback){if(!A.isSeeking)if(t.recList.length>0)if(new Date("".concat(A.date," ").concat(e.current)).valueOf()>=t.lastDate)A.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}),A.syncTimeLine();else A.jSPlugin.Theme.decoderState.state.play?A.unSyncTimeLine().then((function(){A.isSeeking=!0,A.jSPlugin.pluginStatus.loadingStart(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),A.jSPlugin.pluginStatus.loadingSetText({text:A.jSPlugin.i18n.t("LOADING")}),A.jSPlugin.Theme.setDisabled(!0),A.jSPlugin.seek(n.substr(8,6),"235959").then((function(){var e=setInterval((function(){A.jSPlugin.getOSDTime().then((function(i){console.log("seek时间同步:",new Date(1e3*i.data).Format("yyyyMMddhhmmss"),n,new Date(1e3*i.data).Format("yyyyMMddhhmmss")>=n),new Date(1e3*i.data).Format("yyyyMMddhhmmss")>=n&&(A.isSeeking=!1,A.syncTimeLine(),clearInterval(e),A.jSPlugin.pluginStatus.loadingStop(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.Theme.setDisabled(!1),A.jSPlugin.waterMark_JSPlugin&&t.jSPlugin.setWaterMarkFont(t.jSPlugin.waterMark_JSPlugin),t.jSPlugin.Theme.decoderState.state.sound&&t.jSPlugin.openSound())}))}),500)}))})):A.unSyncTimeLine().then((function(){A.jSPlugin.pluginStatus.loadingStart(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),A.jSPlugin.pluginStatus.loadingSetText({text:A.jSPlugin.i18n.t("LOADING")}),A.jSPlugin.Theme.setDisabled(!0);var e=A.jSPlugin.url;e.indexOf("begin")>-1?e=e.replace(/(begin=)(\d+)/,(function(A,e,t){return e+n})):e+="?begin=".concat(n),A.jSPlugin.play({url:e}).then((function(){A.syncTimeLine(),A.jSPlugin.pluginStatus.loadingStop(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.Theme.setDisabled(!1),t.jSPlugin.waterMark_JSPlugin&&t.jSPlugin.setWaterMarkFont(t.jSPlugin.waterMark_JSPlugin)})).catch((function(A){console.log("时间轴拖动失败:",A)}))}))}else{var a=function(){setTimeout((function(){A.disabled=!1}),A.seekFrequency)},o=A.jSPlugin.Theme.decoderState.state.play,r=function(e){A.disabled=!0,A.jSPlugin.pluginStatus.loadingStart(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),A.jSPlugin.pluginStatus.loadingSetText({text:A.jSPlugin.i18n.t("LOADING")}),A.jSPlugin.Theme.setDisabled(!0),o?A.unSyncTimeLine().then((function(){A.jSPlugin.pause(n).then((function(){console.log("暂停成功"),A.jSPlugin.resume(n).then((function(i){console.log("恢复成功"),A.syncTimeLine(),A.jSPlugin.pluginStatus.loadingStop(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.Theme.setDisabled(!1),A.jSPlugin.waterMark_JSPlugin&&t.jSPlugin.setWaterMarkFont(t.jSPlugin.waterMark_JSPlugin),t.jSPlugin.Theme.decoderState.state.sound&&t.jSPlugin.openSound(),e&&e()}))})).catch((function(){console.log("暂停失败"),A.jSPlugin.resume(n).then((function(t){console.log("恢复成功"),A.syncTimeLine(),A.jSPlugin.pluginStatus.loadingStop(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.Theme.setDisabled(!1),e&&e()}))}))})):A.unSyncTimeLine().then((function(){A.jSPlugin.resume(n).then((function(t){console.log("恢复成功"),A.syncTimeLine(),e&&e()}))}))};A.disabled?(console.log("操作频繁,等待2秒后执行"),A.seekTimer&&clearTimeout(A.seekTimer),A.seekTimer=setTimeout((function(){r(a)}),A.seekFrequency)):r(a)}},ontouchstart:function(){A.operating=!0,A.unSyncTimeLine()},ontouchmove:function(){0==A.operating&&(A.operating=!0,A.unSyncTimeLine())},ontouchend:function(){A.operating=!1}})}},{key:"unInjectJsCss",value:function(){Q("".concat(this.jSPlugin.staticPath,"/rec/datepicker.min.css")),E("".concat(this.jSPlugin.staticPath,"/rec/jquery.min.js")),E("".concat(this.jSPlugin.staticPath,"/rec/datepicker.js")),E("".concat(this.jSPlugin.staticPath,"/rec/datepicker.").concat(this.datepickerLang[this.jSPlugin.language],".js"))}},{key:"destroy",value:function(){this.unInjectJsCss();var e=document.getElementsByTagName("head")[0].getElementsByTagName("style");if(e)for(var t=0;t=0;n--){var a=e[n],o=Ai(a.endTime),r=Ai(a.startTime);i.push({st:r,et:o})}A.TimeLineOBJ.setDateLine(i)},t=new FormData,i=this;t.append("deviceSerial",_(this.jSPlugin.url).deviceSerial),t.append("channelNo",_(this.jSPlugin.url).channelNo),t.append("accessToken",this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video),t.append("recType","cloud.rec"===this.type?1:2);var n=p("timeZone",this.jSPlugin.url),a=null,o=null;if(n<=23&&n>=-23&&"cloud.rec"!==this.type){var r=Ot(new Date(this.begin).Format("yyyyMMddhhmmss"),+n);a=new Date(r.Format("yyyy/MM/dd")+" 00:00:00").getTime(),o=new Date(r.Format("yyyy/MM/dd")+" 23:59:59").getTime(),t.append("startTime",a),t.append("endTime",o),this.date=r.Format("yyyy/MM/dd")}else a=new Date(this.begin).getTime(),o=new Date(this.end).getTime(),t.append("startTime",a),t.append("endTime",o);if(this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===p("busType",this.jSPlugin.url)){var s={deviceSerial:_(this.jSPlugin.url).deviceSerial,channelNo:_(this.jSPlugin.url).channelNo,startTime:a,endTime:o,spaceId:this.jSPlugin._spaceId};Vt(this.jSPlugin,s).then((function(A){if(A.data&&A.data.length>0){var t=A.data;i.recList=t,i.lastDate=t[t.length-1].endTime,e(t)}}))}else fetch(this.jSPlugin.env.domain+"/api/lapp/video/by/time",{method:"POST",body:t}).then((function(A){return A.json()})).then((function(A){if(200==A.code&&A.data){var t;t=A.data,i.recList=t,i.lastDate=t[t.length-1].endTime,e(t)}else e([])}))}},{key:"syncTimeLine",value:function(){var A=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((function(A){clearInterval(A)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];var e=this;this.TimeLineOBJ&&(this.jSPlugin.recTimer=setInterval((function(){if(A.operating)return console.log("操作中"),!1;A.jSPlugin.getOSDTime().then((function(A){A.data>0&&e.TimeLineOBJ.stepScrollTimeLine(function(A){var e=new Date(A),t=e.getHours(),i=e.getMinutes(),n=e.getSeconds();return(t>9?t:"0"+t)+":"+(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)}(1e3*A.data))})).catch((function(A){console.log("err:-----",A),console.log("未找到当前获取播放时间,等待中...")}))}),500),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer))}},{key:"unSyncTimeLine",value:function(){var A=this;return new Promise((function(e,t){A.jSPlugin.recTimer&&(clearInterval(A.jSPlugin.recTimer),A.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[A.jSPlugin.id])&&(window.recTimer[A.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[A.jSPlugin.id]=[]):window.recTimer={},e()}))}},{key:"bindEvent",value:function(){var A=this;document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(function(e){var t=e.target.checked?2:1;A.type=e.target.checked?"rec":"cloud.rec",console.log("recType",t),console.log("this.date",A),A.jSPlugin.changePlayUrl({type:A.type,begin:"".concat(new Date(A.date).Format("yyyyMMdd"),"000000")},(function(){A.jSPlugin._isCloudRecord&&A.jSPlugin.Theme.changeTheme("mobileRec")})).then((function(){console.log("切换类型成功"),A.syncTimeLine(),A.changeRecSpeed(1),A.resetMobileZoomStatus(),A.jSPlugin.Theme.decoderState.state.sound&&A.jSPlugin.openSound()}),(function(A){console.log("err",A)})).catch((function(A){console.log(A)}))}))}}],[{key:"_instanceStyle",value:function(){A._STYLE||(A._STYLE=document.createElement("style"),A._STYLE.id="ezuikit-mobile-rec-style",A._STYLE.innerHTML='\n body{\n padding: 0;\n margin: 0;\n }\n .time-line-container {\n text-align: left;\n height: 300px;\n /* outline: 1px solid red; */\n /* background: gray; */\n position: relative;\n /* padding-top: 60px; */\n margin-top: 20px;\n }\n\n .time-line-container .time-line-item-container {\n display: inline-block;\n /* height: 400px; */\n width: 30%;\n /* background: indianred; */\n overflow-y: scroll;\n overflow-x: hidden;\n /* padding-top: 60px; */\n height: 300px;\n box-sizing: border-box;\n white-space: nowrap;\n position: relative;\n }\n\n .time-line-container .time-line-item-container::-webkit-scrollbar {\n width: 0px;\n /*滚动条宽度*/\n height: 0px;\n /*滚动条高度*/\n }\n\n .time-line-item .time-item {\n position: relative;\n box-sizing: border-box;\n height: 60px;\n font-size: 12px;\n color: rgb(150, 150, 150);\n border-right: 6px solid;\n border-right-color: #ddd;\n }\n\n .time-line-item .time-item .scale {\n width: 6px;\n height: 9px;\n border-bottom: 1px solid #ccc;\n float: right;\n clear: both;\n }\n\n .time-line-item .time-item .item-unavail {\n width: 6px;\n position: absolute;\n left: 100%;\n background-color: #ddd;\n }\n\n .time-line-container .current-time {\n position: absolute;\n left: 0;\n top: 40px;\n height: 29px;\n /* line-height: 58px; */\n border-bottom: 1px solid #648FFC;\n width: 60%;\n margin-left: 26%;\n }\n\n .time-line-container .current-time .current-time-bg {\n position: relative;\n top: 15px;\n width: 100px;\n height: 29px;\n line-height: 29px;\n left: -70px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .time-line-container .current-time .current-time-bg::before {\n content: \'\';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n background: #648FFC;\n top: 11px;\n position: absolute;\n right: 30px;\n }\n\n .date-switch-container {\n height: 40px;\n position: relative;\n text-align: center;\n margin: 20px 10px;\n }\n\n .date-switch-container .current-date {\n line-height: 40px;\n height: 22px;\n font-size: 16px;\n color: #2C2C2C;\n text-align: center;\n font-weight: bold;\n }\n\n .date-container {\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .rec-type-container {\n display: flex;\n justify-content: space-between;\n }\n\n .rec-type-container .rec-type-text {\n padding: 0 15px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .rec-type-container .rec-type-switch {\n padding: 0 20px;\n }\n\n .date-container input {\n position: absolute;\n opacity: 0;\n display: inline-block;\n width: 40px;\n height: 40px;\n z-index: 10;\n left: 0;\n }\n\n .date-container label {\n position: absolute;\n left: 0;\n top: 0;\n /* display: none; */\n z-index: 0;\n }\n\n .date-icon {\n display: inline-block;\n width: 40px;\n height: 40px;\n background: url(\'https://resource.eziot.com/group2/M00/00/6A/CtwQF2F6VieAQrU9AAABP-_Nsqo949.png\') no-repeat 100% 100%;\n }\n .select-container {\n padding: 10px;\n display: flex;\n justify-content: space-between;\n }\n\n .advice {\n height: 24px;\n width: 70px;\n display: flex;\n justify-content: space-between;\n line-height: 24px;\n background: #F8F8F8;\n border-radius: 8px;\n }\n\n .advice span {\n width: 40px;\n display: inline-block;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n\n }\n\n input[type="checkbox"]:checked+.advice span:last-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child svg {\n fill: #648FFC !important;\n }\n\n input[type="checkbox"]:checked+.advice span:last-child svg {\n fill: #648FFC !important;\n }',document.getElementsByTagName("head")[0].appendChild(A._STYLE))}}])}();s(ei,"_STYLE",void 0);var ti=function(){function A(e){var i=this;if(t(this,A),this.jSPlugin=e,this.pluginStatus=new J(this,this.jSPlugin.id),this.showPtz=!1,document.getElementById(this.jSPlugin.id+"-ez-ptz-item"))return!1;var n=document.createElement("div");n.id=this.jSPlugin.id+"-ez-ptz-item",n.className="ez-ptz-wrap",n.style="display:none;",A._instanceStyle(),n.innerHTML='\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_SLOW"),'\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_MID"),'\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_FAST"),'\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n '),document.getElementById("".concat(e.id,"-wrap")).appendChild(n),document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),console.log("点击开始"),i._handlePtzTouch(A,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸结束"),i._handlePtzTouch(A,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸开始"),i._handlePtzTouch(A,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸结束",A),i._handlePtzTouch(A,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).onmouseup=function(A){A.target.id&&(A.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.add("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),A.target.id.indexOf("mid")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.add("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),A.target.id.indexOf("fast")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).ontouchend=function(A){A.target.id&&(A.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.add("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),A.target.id.indexOf("mid")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.add("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),A.target.id.indexOf("fast")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(i.jSPlugin.id,"-ptzspeed-fast-dot")).classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","stop")}}return o(A,[{key:"destroy",value:function(){var e=document.getElementsByTagName("head")[0].getElementsByTagName("style");if(e)for(var t=0;t=26&&A<=e||oi.extension.isInstalled()}return!0};var ai={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(A){var e=window.setTimeout((function(){var e=new Error("NavigatorUserMediaError");return e.name='The required Chrome extension is not installed: click here to install it. (NOTE: this will need you to refresh the page)',A(e)}),1e3);this.cache[e]=A,window.postMessage({type:"janusGetScreen",id:e},"*")},init:function(){var A={};this.cache=A,window.addEventListener("message",(function(e){if(e.origin==window.location.origin)if("janusGotScreen"==e.data.type&&A[e.data.id]){var t=A[e.data.id];if(delete A[e.data.id],""===e.data.sourceId){var i=new Error("NavigatorUserMediaError");i.name="You cancelled the request for permission, giving up...",t(i)}else t(null,e.data.sourceId)}else"janusGetScreenPending"==e.data.type&&(console.log("clearing ",e.data.id),window.clearTimeout(e.data.id))}))}};function oi(A){if(void 0===oi.initDone)return A.error("Library not initialized"),{};if(!oi.isWebrtcSupported())return A.error("WebRTC not supported by this browser"),{};if(oi.log("Library initialized: "+oi.initDone),(A=A||{}).success="function"==typeof A.success?A.success:oi.noop,A.error="function"==typeof A.error?A.error:oi.noop,A.destroyed="function"==typeof A.destroyed?A.destroyed:oi.noop,null===A.server||void 0===A.server)return A.error("Invalid server url"),{};var t=!1,i=null,n={},a=null,o=null,r=0,s=A.server;oi.isArray(s)?(oi.log("Multiple servers provided ("+s.length+"), will use the first that works"),s=null,o=A.server,oi.debug(o)):0===s.indexOf("ws")?(t=!0,oi.log("Using WebSockets to contact Janus: "+s)):(t=!1,oi.log("Using REST API to contact Janus: "+s));var g=A.iceServers;null==g&&(g=[{urls:"stun:stun.l.google.com:19302"}]);var c=A.iceTransportPolicy,I=A.bundlePolicy,C=A.ipv6;null==C&&(C=!1);var h=!1;void 0!==A.withCredentials&&null!==A.withCredentials&&(h=!0===A.withCredentials);var B=10;void 0!==A.max_poll_events&&null!==A.max_poll_events&&(B=A.max_poll_events),B<1&&(B=1);var u=null;void 0!==A.token&&null!==A.token&&(u=A.token);var E=null;void 0!==A.apisecret&&null!==A.apisecret&&(E=A.apisecret),this.destroyOnUnload=!0,void 0!==A.destroyOnUnload&&null!==A.destroyOnUnload&&(this.destroyOnUnload=!0===A.destroyOnUnload);var f=25e3;void 0!==A.keepAlivePeriod&&null!==A.keepAlivePeriod&&(f=A.keepAlivePeriod),isNaN(f)&&(f=25e3);var Q=6e4;function x(A){var e={high:9e5,medium:3e5,low:1e5};return null!=A&&(A.high&&(e.high=A.high),A.medium&&(e.medium=A.medium),A.low&&(e.low=A.low)),e}void 0!==A.longPollTimeout&&null!==A.longPollTimeout&&(Q=A.longPollTimeout),isNaN(Q)&&(Q=6e4);var p=!1,m=null,y={},_=this,S=0,D={};function w(){if(null!=m)if(oi.debug("Long poll..."),p){var e=s+"/"+m+"?rid="+(new Date).getTime();null!=B&&(e=e+"&maxev="+B),null!=u&&(e=e+"&token="+encodeURIComponent(u)),null!=E&&(e=e+"&apisecret="+encodeURIComponent(E)),oi.httpAPICall(e,{verb:"GET",withCredentials:h,success:v,timeout:Q,error:function(e,t){if(oi.error(e+":",t),++S>3)return p=!1,void A.error("Lost connection to the server (is it down?)");w()}})}else oi.warn("Is the server down? (connected=false)")}function v(A,e){if(S=0,t||null==m||!0===e||w(),t||!oi.isArray(A))if("keepalive"!==A.rtcgw)if("ack"!==A.rtcgw)if("success"!==A.rtcgw)if("trickle"===A.rtcgw){if(null==(s=A.sender))return void oi.warn("Missing sender...");if(null==(c=y[s]))return void oi.debug("This handle is not attached to this session");var n=A.candidate;oi.debug("Got a trickled candidate on session "+m),oi.debug(n);var a=c.webrtcStuff;a.pc&&a.remoteSdp?(oi.debug("Adding remote candidate:",n),n&&!0!==n.completed?a.pc.addIceCandidate(n):a.pc.addIceCandidate(oi.endOfCandidates)):(oi.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),a.candidates||(a.candidates=[]),a.candidates.push(n),oi.debug(a.candidates))}else{if("webrtcup"===A.rtcgw)return oi.debug("Got a webrtcup event on session "+m),oi.debug(A),null==(s=A.sender)?void oi.warn("Missing sender..."):null==(c=y[s])?void oi.debug("This handle is not attached to this session"):void c.webrtcState(!0);if("hangup"===A.rtcgw){if(oi.debug("Got a hangup event on session "+m),oi.debug(A),null==(s=A.sender))return void oi.warn("Missing sender...");if(null==(c=y[s]))return void oi.debug("This handle is not attached to this session");c.webrtcState(!1,A.reason),c.hangup()}else if("detached"===A.rtcgw){if(oi.debug("Got a detached event on session "+m),oi.debug(A),null==(s=A.sender))return void oi.warn("Missing sender...");if(null==(c=y[s]))return;c.detached=!0,c.ondetached(),c.detach()}else if("media"===A.rtcgw){if(oi.debug("Got a media event on session "+m),oi.debug(A),null==(s=A.sender))return void oi.warn("Missing sender...");if(null==(c=y[s]))return void oi.debug("This handle is not attached to this session");c.mediaState(A.type,A.receiving)}else if("slowlink"===A.rtcgw){if(oi.debug("Got a slowlink event on session "+m),oi.debug(A),null==(s=A.sender))return void oi.warn("Missing sender...");if(null==(c=y[s]))return void oi.debug("This handle is not attached to this session");c.slowLink(A.uplink,A.lost)}else{if("error"===A.rtcgw){var o,r;if(oi.error("Ooops: "+A.error.code+" "+A.error.reason),oi.debug(A),null!=(o=A.transaction))null!=(r=D[o])&&r(A),delete D[o];return}if("event"===A.rtcgw){var s;if(oi.debug("Got a plugin event on session "+m),oi.debug(A),null==(s=A.sender))return void oi.warn("Missing sender...");var g=A.plugindata;if(null==g)return void oi.warn("Missing plugindata...");oi.debug(" -- Event is coming from "+s+" ("+g.plugin+")");var c,l=g.data;if(oi.debug(l),null==(c=y[s]))return void oi.warn("This handle is not attached to this session");var I=A.jsep;null!=I&&(oi.debug("Handling SDP as well..."),oi.debug(I));var C=c.onmessage;null!=C?(oi.debug("Notifying application..."),C(l,I)):oi.debug("No provided notification callback")}else{if("timeout"===A.rtcgw)return oi.error("Timeout on session "+m),oi.debug(A),void(t&&i.close(3504,"Gateway timeout"));oi.warn("Unknown message/event '"+A.rtcgw+"' on session "+m),oi.debug(A)}}}else oi.debug("Got a success on session "+m),oi.debug(A),null!=(o=A.transaction)&&(null!=(r=D[o])&&r(A),delete D[o]);else oi.debug("Got an ack on session "+m),oi.debug(A),null!=(o=A.transaction)&&(null!=(r=D[o])&&r(A),delete D[o]);else oi.vdebug("Got a keepalive on session "+m);else for(var d=0;d data channel: "+t),"open"===t){if(a.dataChannel[e].pending&&a.dataChannel[e].pending.length>0){for(var i in oi.log("Sending pending messages on <"+e+">:",a.dataChannel[e].pending.length),a.dataChannel[e].pending){var o=a.dataChannel[e].pending[i];oi.log("Sending string on data channel <"+e+">: "+o),a.dataChannel[e].send(o)}a.dataChannel[e].pending=[]}n.ondataopen(e)}};a.dataChannel[e]=t||a.pc.createDataChannel(e,{ordered:!1}),a.dataChannel[e].onmessage=function(A){oi.log("Received message on data channel:",A);var e=A.target.label;n.ondata(A.data,e)},a.dataChannel[e].onopen=o,a.dataChannel[e].onclose=o,a.dataChannel[e].onerror=function(A){oi.error("Got error on data channel:",A)},a.dataChannel[e].pending=[],i&&a.dataChannel[e].pending.push(i)}else oi.warn("Invalid handle")}function N(A,e){(e=e||{}).success="function"==typeof e.success?e.success:oi.noop,e.error="function"==typeof e.error?e.error:oi.noop;var t=y[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return oi.warn("Invalid handle"),void e.error("Invalid handle");var i=t.webrtcStuff,n=e.text;if(null==n)return oi.warn("Invalid text"),void e.error("Invalid text");var a=e.label?e.label:oi.dataChanDefaultLabel;return i.dataChannel[a]?"open"!==i.dataChannel[a].readyState?(i.dataChannel[a].pending.push(n),void e.success()):(oi.log("Sending string on data channel <"+a+">: "+n),i.dataChannel[a].send(n),void e.success()):(P(A,a,!1,n),void e.success())}function T(A,e){(e=e||{}).success="function"==typeof e.success?e.success:oi.noop,e.error="function"==typeof e.error?e.error:oi.noop;var t=y[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return oi.warn("Invalid handle"),void e.error("Invalid handle");var i=t.webrtcStuff;if(null===i.dtmfSender||void 0===i.dtmfSender){if(void 0!==i.pc&&null!==i.pc){var n=i.pc.getSenders().find((function(A){return A.track&&"audio"===A.track.kind}));if(!n)return oi.warn("Invalid DTMF configuration (no audio track)"),void e.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=n.dtmf,i.dtmfSender&&(oi.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(A){oi.debug("Sent DTMF tone: "+A.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return oi.warn("Invalid DTMF configuration"),void e.error("Invalid DTMF configuration")}var a=e.dtmf;if(null==a)return oi.warn("Invalid DTMF parameters"),void e.error("Invalid DTMF parameters");var o=a.tones;if(null==o)return oi.warn("Invalid DTMF string"),void e.error("Invalid DTMF string");var r=a.duration;null==r&&(r=500);var s=a.gap;null==s&&(s=50),oi.debug("Sending DTMF string "+o+" (duration "+r+"ms, gap "+s+"ms)"),i.dtmfSender.insertDTMF(o,r,s),e.success()}function M(A,e){(e=e||{}).success="function"==typeof e.success?e.success:oi.noop,e.error="function"==typeof e.error?e.error:oi.noop;var n=!0;void 0!==e.asyncRequest&&null!==e.asyncRequest&&(n=!0===e.asyncRequest);var a=!0;void 0!==e.noRequest&&null!==e.noRequest&&(a=!0===e.noRequest),oi.log("Destroying handle "+A+" (async="+n+")"),X(A);var o=y[A];if(null==o||o.detached)return delete y[A],void e.success();if(a)return delete y[A],void e.success();if(!p)return oi.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var r={rtcgw:"detach",transaction:oi.randomString(12)};if(null!==o.token&&void 0!==o.token&&(r.token=o.token),null!=E&&(r.apisecret=E),t)return r.session_id=m,r.handle_id=A,i.send(JSON.stringify(r)),delete y[A],void e.success();oi.httpAPICall(s+"/"+m+"/"+A,{verb:"POST",async:n,withCredentials:h,body:r,success:function(t){oi.log("Destroyed handle:"),oi.debug(t),"success"!==t.rtcgw&&oi.error("Ooops: "+t.error.code+" "+t.error.reason),delete y[A],e.success()},error:function(t,i){oi.error(t+":",i),delete y[A],e.success()}})}function L(A,e,t,i,n){return Y.apply(this,arguments)}function Y(){return Y=function(A){return function(){var t=this,i=arguments;return new Promise((function(n,a){var o=A.apply(t,i);function r(A){e(o,n,a,r,s,"next",A)}function s(A){e(o,n,a,r,s,"throw",A)}r(void 0)}))}}(l().mark((function A(e,t,i,n,a){var o,r,s,h,B,u,E,f,Q,p,m,_,S,D,w,v,b,F,R,N,T,M,L,Y,G,U,V;return l().wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(null!=(o=y[e])&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){A.next=5;break}return oi.warn("Invalid handle"),n.error("Invalid handle"),A.abrupt("return");case 5:if(r=o.webrtcStuff,oi.debug("streamsDone:",a),a&&(oi.debug(" -- Audio tracks:",a.getAudioTracks()),oi.debug(" -- Video tracks:",a.getVideoTracks())),s=!1,r.myStream&&i.update&&!r.streamExternal){A.next=14;break}r.myStream=a,s=!0,A.next=66;break;case 14:if(!((!i.update&&q(i)||i.update&&(i.addAudio||i.replaceAudio))&&a.getAudioTracks()&&a.getAudioTracks().length)){A.next=45;break}if(r.myStream.addTrack(a.getAudioTracks()[0]),!oi.unifiedPlan){A.next=43;break}if(oi.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),h=null,!((B=r.pc.getTransceivers())&&B.length>0)){A.next=30;break}A.t0=l().keys(B);case 22:if((A.t1=A.t0()).done){A.next=30;break}if(u=A.t1.value,!((E=B[u]).sender&&E.sender.track&&"audio"===E.sender.track.kind||E.receiver&&E.receiver.track&&"audio"===E.receiver.track.kind)){A.next=28;break}return h=E,A.abrupt("break",30);case 28:A.next=22;break;case 30:return f=null,A.prev=31,A.next=34,n.customizeStream(a);case 34:f=A.sent,A.next=40;break;case 37:A.prev=37,A.t2=A.catch(31),n.error(A.t2);case 40:h&&h.sender?h.sender.replaceTrack((null===(Q=f)||void 0===Q||null===(p=Q.getAudioTracks)||void 0===p||null===(m=p.call(Q))||void 0===m?void 0:m[0])||a.getAudioTracks()[0]):r.pc.addTrack((null===(_=f)||void 0===_||null===(S=_.getAudioTracks)||void 0===S||null===(D=S.call(_))||void 0===D?void 0:D[0])||a.getAudioTracks()[0],f||a),A.next=45;break;case 43:oi.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),r.pc.addTrack(a.getAudioTracks()[0],a);case 45:if(!((!i.update&&$(i)||i.update&&(i.addVideo||i.replaceVideo))&&a.getVideoTracks()&&a.getVideoTracks().length)){A.next=66;break}if(r.myStream.addTrack(a.getVideoTracks()[0]),!oi.unifiedPlan){A.next=64;break}if(oi.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),w=null,!((B=r.pc.getTransceivers())&&B.length>0)){A.next=61;break}A.t3=l().keys(B);case 53:if((A.t4=A.t3()).done){A.next=61;break}if(u=A.t4.value,!((E=B[u]).sender&&E.sender.track&&"video"===E.sender.track.kind||E.receiver&&E.receiver.track&&"video"===E.receiver.track.kind)){A.next=59;break}return w=E,A.abrupt("break",61);case 59:A.next=53;break;case 61:w&&w.sender?w.sender.replaceTrack(a.getVideoTracks()[0]):r.pc.addTrack(a.getVideoTracks()[0],a),A.next=66;break;case 64:oi.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),r.pc.addTrack(a.getVideoTracks()[0],a);case 66:if(!r.pc){if(v={iceServers:g,iceTransportPolicy:c,bundlePolicy:I},"chrome"===oi.webRTCAdapter.browserDetails.browser&&(v.sdpSemantics=oi.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan"),b={optional:[{DtlsSrtpKeyAgreement:!0}]},!0===C&&b.optional.push({googIPv6:!0}),n.rtcConstraints&&"object"===d(n.rtcConstraints))for(u in oi.debug("Adding custom PeerConnection constraints:",n.rtcConstraints),n.rtcConstraints)b.optional.push(n.rtcConstraints[u]);"edge"===oi.webRTCAdapter.browserDetails.browser&&(v.bundlePolicy="max-bundle"),oi.log("Creating PeerConnection"),oi.debug(b),r.pc=new RTCPeerConnection(v,b),oi.debug(r.pc),r.pc.getStats&&(r.volume={},r.bitrate.value="0 kbits/sec"),oi.log("Preparing local SDP and gathering candidates (trickle="+r.trickle+")"),r.pc.oniceconnectionstatechange=function(A){r.pc&&o.iceState(r.pc.iceConnectionState)},r.pc.onicecandidate=function(A){if(null==A.candidate||"edge"===oi.webRTCAdapter.browserDetails.browser&&A.candidate.candidate.indexOf("endOfCandidates")>0)oi.log("End of candidates."),r.iceDone=!0,!0===r.trickle?k(e,{completed:!0}):K(e,n);else{var t={candidate:A.candidate.candidate,sdpMid:A.candidate.sdpMid,sdpMLineIndex:A.candidate.sdpMLineIndex};!0===r.trickle&&k(e,t)}},r.pc.ontrack=function(A){oi.log("Handling Remote Track"),oi.debug(A),A.streams&&(r.remoteStream=A.streams[0],o.onremotestream(r.remoteStream),A.track.onended||(oi.log("Adding onended callback to track:",A.track),A.track.onended=function(A){oi.log("Remote track muted/removed:",A),r.remoteStream&&(r.remoteStream.removeTrack(A.target),o.onremotestream(r.remoteStream))},A.track.onmute=A.track.onended,A.track.onunmute=function(A){oi.log("Remote track flowing again:",A);try{r.remoteStream.addTrack(A.target),o.onremotestream(r.remoteStream)}catch(A){oi.error(A)}}))}}if(!s||null==a){A.next=97;break}oi.log("Adding local stream"),F=!0===n.simulcast2,R=a.getTracks(),N=0;case 72:if(!(N0){for(var A=0;A=26&&D<=w?(u={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:n.screenshareFrameRate,maxFrameRate:n.screenshareFrameRate,chromeMediaSource:"screen"}},audio:q(n)&&!n.keepAudio},S(u,_)):oi.extension.getScreen((function(A,e){if(A)return a.consentDialog(!1),t.error(A);(u={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:n.screenshareFrameRate,maxFrameRate:n.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=e,S(u,_,q(n)&&!n.keepAudio)}))}else if("firefox"===oi.webRTCAdapter.browserDetails.browser){if(!(oi.webRTCAdapter.browserDetails.version>=33)){var v=new Error("NavigatorUserMediaError");return v.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",a.consentDialog(!1),void t.error(v)}u={video:{mozMediaSource:n.video,mediaSource:n.video},audio:q(n)&&!n.keepAudio},S(u,(function(A,e){if(_(A,e),!A)var t=e.currentTime,i=window.setInterval((function(){e||window.clearInterval(i),e.currentTime==t&&(window.clearInterval(i),e.onended&&e.onended()),t=e.currentTime}),500)}))}return}}null!=n&&"screen"===n.video||navigator.mediaDevices.enumerateDevices().then((function(e){var o=e.some((function(A){return"audioinput"===A.kind})),r=function(A){if(oi.debug("isScreenSendEnabled:",A),null==A)return!1;if("object"!==d(A.video)||"object"!==d(A.video.mandatory))return!1;var e=A.video.mandatory;if(e.chromeMediaSource)return"desktop"===e.chromeMediaSource||"screen"===e.chromeMediaSource;if(e.mozMediaSource)return"window"===e.mozMediaSource||"screen"===e.mozMediaSource;if(e.mediaSource)return"window"===e.mediaSource||"screen"===e.mediaSource;return!1}(n)||e.some((function(A){return"videoinput"===A.kind})),s=q(n),g=$(n),c=function(A){return oi.debug("isAudioSendRequired:",A),null!=A&&(!1!==A.audio&&!1!==A.audioSend&&(void 0!==A.failIfNoAudio&&null!==A.failIfNoAudio&&!0===A.failIfNoAudio))}(n),l=function(A){return oi.debug("isVideoSendRequired:",A),null!=A&&(!1!==A.video&&!1!==A.videoSend&&(void 0!==A.failIfNoVideo&&null!==A.failIfNoVideo&&!0===A.failIfNoVideo))}(n);if(s||g||c||l){var C=!!s&&o,h=!!g&&r;if(!C&&!h)return a.consentDialog(!1),t.error("No capture device found"),!1;if(!C&&c)return a.consentDialog(!1),t.error("Audio capture is required, but no capture device found"),!1;if(!h&&l)return a.consentDialog(!1),t.error("Video capture is required, but no capture device found"),!1}var B={audio:!(!o||n.keepAudio)&&E,video:!(!r||n.keepVideo)&&f};oi.debug("getUserMedia constraints",B),B.audio||B.video?navigator.mediaDevices.getUserMedia(B).then((function(e){a.consentDialog(!1),L(A,i,n,t,e)})).catch((function(A){a.consentDialog(!1),t.error({code:A.code,name:A.name,message:A.message})})):(a.consentDialog(!1),L(A,i,n,t,I))})).catch((function(A){a.consentDialog(!1),t.error("enumerateDevices error",A)}))}else L(A,i,n,t)}function U(A,e){(e=e||{}).success="function"==typeof e.success?e.success:oi.noop,e.error="function"==typeof e.error?e.error:Z;var t=e.jsep,i=y[A];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return oi.warn("Invalid handle"),void e.error("Invalid handle");var n=i.webrtcStuff;if(null!=t){if(null===n.pc)return oi.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void e.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");n.pc.setRemoteDescription(t).then((function(){if(oi.log("Remote description accepted!"),n.remoteSdp=t.sdp,n.candidates&&n.candidates.length>0){for(var A=0;A0)for(var c in g){var l=g[c];l.sender&&l.sender.track&&"audio"===l.sender.track.kind||l.receiver&&l.receiver.track&&"audio"===l.receiver.track.kind?r||(r=l):(l.sender&&l.sender.track&&"video"===l.sender.track.kind||l.receiver&&l.receiver.track&&"video"===l.receiver.track.kind)&&(s||(s=l))}var I=q(e),C=z(e);I||C?I&&C?r&&(r.setDirection?r.setDirection("sendrecv"):r.direction="sendrecv",oi.log("Setting audio transceiver to sendrecv:",r)):I&&!C?r&&(r.setDirection?r.setDirection("sendonly"):r.direction="sendonly",oi.log("Setting audio transceiver to sendonly:",r)):!I&&C&&(r?(r.setDirection?r.setDirection("recvonly"):r.direction="recvonly",oi.log("Setting audio transceiver to recvonly:",r)):(r=n.pc.addTransceiver("audio",{direction:"recvonly"}),oi.log("Adding recvonly audio transceiver:",r))):e.removeAudio&&r&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive",oi.log("Setting audio transceiver to inactive:",r));var d=$(e),h=AA(e);d||h?d&&h?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",oi.log("Setting video transceiver to sendrecv:",s)):d&&!h?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",oi.log("Setting video transceiver to sendonly:",s)):!d&&h&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",oi.log("Setting video transceiver to recvonly:",s)):(s=n.pc.addTransceiver("video",{direction:"recvonly"}),oi.log("Adding recvonly video transceiver:",s))):e.removeVideo&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",oi.log("Setting video transceiver to inactive:",s))}else o.offerToReceiveAudio=z(e),o.offerToReceiveVideo=AA(e);!0===t.iceRestart&&(o.iceRestart=!0),oi.debug(o);var B=$(e);if(B&&a&&"firefox"===oi.webRTCAdapter.browserDetails.browser){oi.log("Enabling Simulcasting for Firefox (RID)");var u=n.pc.getSenders().find((function(A){return"video"==A.track.kind}));if(u){var E=u.getParameters();E||(E={});var f=x(t.simulcastMaxBitrates);E.encodings=[{rid:"h",active:!0,maxBitrate:f.high},{rid:"m",active:!0,maxBitrate:f.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:f.low,scaleResolutionDownBy:4}],u.setParameters(E)}}n.pc.createOffer(o).then((function(A){oi.debug(A);var e={type:A.type,sdp:A.sdp};t.customizeSdp(e),A.sdp=e.sdp,oi.log("Setting local description"),B&&a&&("chrome"===oi.webRTCAdapter.browserDetails.browser||"safari"===oi.webRTCAdapter.browserDetails.browser?(oi.log("Enabling Simulcasting for Chrome (SDP munging)"),A.sdp=function(A){for(var e=A.split("\r\n"),t=!1,i=[-1],n=[-1],a=null,o=null,r=null,s=null,g=-1,c=0;c-1){g=c;break}}else if(t){var l=e[c].match(/a=ssrc-group:FID (\d+) (\d+)/);if(l)i[0]=l[1],n[0]=l[2],e.splice(c,1),c--;else{if(i[0]){if((d=e[c].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=d[1]),(d=e[c].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(o=d[1]),(d=e[c].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(r=d[1]),(d=e[c].match("a=ssrc:"+i[0]+" label:(.+)"))&&(s=d[1]),0===e[c].indexOf("a=ssrc:"+n[0])){e.splice(c,1),c--;continue}if(0===e[c].indexOf("a=ssrc:"+i[0])){e.splice(c,1),c--;continue}}0!=e[c].length||(e.splice(c,1),c--)}}}if(i[0]<0){g=-1,t=!1;for(c=0;c-1){g=c;break}}else if(t){if(i[0]<0){var C=e[c].match(/a=ssrc:(\d+)/);if(C){i[0]=C[1],e.splice(c,1),c--;continue}}else{var d;if((d=e[c].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=d[1]),(d=e[c].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(o=d[1]),(d=e[c].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(r=d[1]),(d=e[c].match("a=ssrc:"+i[0]+" label:(.+)"))&&(s=d[1]),0===e[c].indexOf("a=ssrc:"+n[0])){e.splice(c,1),c--;continue}if(0===e[c].indexOf("a=ssrc:"+i[0])){e.splice(c,1),c--;continue}}0!=e[c].length||(e.splice(c,1),c--)}}}if(i[0]<0)return oi.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),A;g<0&&(g=e.length);i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),n[1]=Math.floor(4294967295*Math.random()),n[2]=Math.floor(4294967295*Math.random());for(c=0;c0)for(var c in g){var l=g[c];l.sender&&l.sender.track&&"audio"===l.sender.track.kind||l.receiver&&l.receiver.track&&"audio"===l.receiver.track.kind?r||(r=l):(l.sender&&l.sender.track&&"video"===l.sender.track.kind||l.receiver&&l.receiver.track&&"video"===l.receiver.track.kind)&&(s||(s=l))}var I=q(e),C=z(e);if(I||C){if(I&&C){if(r)try{r.setDirection?r.setDirection("sendrecv"):r.direction="sendrecv",oi.log("Setting audio transceiver to sendrecv:",r)}catch(A){oi.error(A)}}else if(I&&!C)try{r&&(r.setDirection?r.setDirection("sendonly"):r.direction="sendonly",oi.log("Setting audio transceiver to sendonly:",r))}catch(A){oi.error(A)}else if(!I&&C)if(r)try{r.setDirection?r.setDirection("recvonly"):r.direction="recvonly",oi.log("Setting audio transceiver to recvonly:",r)}catch(A){oi.error(A)}else r=n.pc.addTransceiver("audio",{direction:"recvonly"}),oi.log("Adding recvonly audio transceiver:",r)}else if(e.removeAudio&&r)try{r.setDirection?r.setDirection("inactive"):r.direction="inactive",oi.log("Setting audio transceiver to inactive:",r)}catch(A){oi.error(A)}var d=$(e),h=AA(e);if(d||h){if(d&&h){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",oi.log("Setting video transceiver to sendrecv:",s)}catch(A){oi.error(A)}}else if(d&&!h){if(s)try{s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",oi.log("Setting video transceiver to sendonly:",s)}catch(A){oi.error(A)}}else if(!d&&h)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",oi.log("Setting video transceiver to recvonly:",s)}catch(A){oi.error(A)}else s=n.pc.addTransceiver("video",{direction:"recvonly"}),oi.log("Adding recvonly video transceiver:",s)}else if(e.removeVideo&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",oi.log("Setting video transceiver to inactive:",s)}catch(A){oi.error(A)}}else o="firefox"==oi.webRTCAdapter.browserDetails.browser||"edge"==oi.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:z(e),offerToReceiveVideo:AA(e)}:{mandatory:{OfferToReceiveAudio:z(e),OfferToReceiveVideo:AA(e)}};oi.debug(o);var B=$(e);if(B&&a&&"firefox"===oi.webRTCAdapter.browserDetails.browser){oi.log("Enabling Simulcasting for Firefox (RID)");var u=n.pc.getSenders()[1];oi.log(u);var E=u.getParameters();oi.log(E);var f=x(t.simulcastMaxBitrates);u.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:f.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:f.medium},{rid:"low",active:!0,priority:"low",maxBitrate:f.low}]})}n.pc.createAnswer(o).then((function(A){oi.debug(A);var e={type:A.type,sdp:A.sdp};t.customizeSdp(e),A.sdp=e.sdp,oi.log("Setting local description"),B&&a&&("chrome"===oi.webRTCAdapter.browserDetails.browser?oi.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==oi.webRTCAdapter.browserDetails.browser&&oi.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),n.mySdp=A.sdp,n.pc.setLocalDescription(A).catch(t.error),n.mediaConstraints=o,n.iceDone||n.trickle?t.success(A):oi.log("Waiting for all candidates...")}),t.error)}function K(A,e){(e=e||{}).success="function"==typeof e.success?e.success:oi.noop,e.error="function"==typeof e.error?e.error:oi.noop;var t=y[A];if(null!=t&&null!==t.webrtcStuff&&void 0!==t.webrtcStuff){var i=t.webrtcStuff;oi.log("Sending offer/answer SDP..."),null!==i.mySdp&&void 0!==i.mySdp?(i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp.trickle=!1),oi.debug(e),i.sdpSent=!0,e.success(i.mySdp)):oi.warn("Local SDP instance is invalid, not sending anything...")}else oi.warn("Invalid handle, not sending anything")}function V(A,e){var t=y[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return oi.warn("Invalid handle"),0;var i=e?"remote":"local",n=t.webrtcStuff;return n.volume[i]||(n.volume[i]={value:0}),n.pc.getStats&&"chrome"===oi.webRTCAdapter.browserDetails.browser?!e||null!==n.remoteStream&&void 0!==n.remoteStream?e||null!==n.myStream&&void 0!==n.myStream?null===n.volume[i].timer||void 0===n.volume[i].timer?(oi.log("Starting "+i+" volume monitor"),n.volume[i].timer=setInterval((function(){n.pc.getStats((function(A){for(var t=A.result(),a=0;a-1)&&"inbound-rtp"===A.type&&A.id.indexOf("rtcp")<0?e=!0:"ssrc"!=A.type||!A.bytesReceived||"VP8"!==A.googCodecName&&""!==A.googCodecName||(e=!0),e)if(t.bitrate.bsnow=A.bytesReceived,t.bitrate.tsnow=A.timestamp,null===t.bitrate.bsbefore||null===t.bitrate.tsbefore)t.bitrate.bsbefore=t.bitrate.bsnow,t.bitrate.tsbefore=t.bitrate.tsnow;else{var i=t.bitrate.tsnow-t.bitrate.tsbefore;"safari"==oi.webRTCAdapter.browserDetails.browser&&(i/=1e3);var n=Math.round(8*(t.bitrate.bsnow-t.bitrate.bsbefore)/i);"safari"===oi.webRTCAdapter.browserDetails.browser&&(n=parseInt(n/1e3)),t.bitrate.value=n+" kbits/sec",t.bitrate.bsbefore=t.bitrate.bsnow,t.bitrate.tsbefore=t.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):t.bitrate.value:(oi.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function Z(A){oi.error("WebRTC error:",A)}function X(A,e){oi.log("Cleaning WebRTC stuff");var n=y[A];if(null!=n){var a=n.webrtcStuff;if(null!=a){if(!0===e){var o={rtcgw:"hangup",transaction:oi.randomString(12)};null!==n.token&&void 0!==n.token&&(o.token=n.token),null!=E&&(o.apisecret=E),oi.debug("Sending hangup request (handle="+A+"):"),oi.debug(o),t?(o.session_id=m,o.handle_id=A,i.send(JSON.stringify(o))):oi.httpAPICall(s+"/"+m+"/"+A,{verb:"POST",withCredentials:h,body:o})}a.remoteStream=null,a.volume&&(a.volume.local&&a.volume.local.timer&&clearInterval(a.volume.local.timer),a.volume.remote&&a.volume.remote.timer&&clearInterval(a.volume.remote.timer)),a.volume={},a.bitrate.timer&&clearInterval(a.bitrate.timer),a.bitrate.timer=null,a.bitrate.bsnow=null,a.bitrate.bsbefore=null,a.bitrate.tsnow=null,a.bitrate.tsbefore=null,a.bitrate.value=null;try{if(!a.streamExternal&&null!==a.myStream&&void 0!==a.myStream){oi.log("Stopping local stream tracks");var r=a.myStream.getTracks();for(var g in r){var c=r[g];oi.log(c),null!=c&&c.stop()}}}catch(A){}a.streamExternal=!1,a.myStream=null;try{a.pc.close()}catch(A){}a.pc=null,a.candidates=null,a.mySdp=null,a.remoteSdp=null,a.iceDone=!1,a.dataChannel={},a.dtmfSender=null}n.oncleanup()}}function q(A){return oi.debug("isAudioSendEnabled:",A),null==A||!1!==A.audio&&(void 0===A.audioSend||null===A.audioSend||!0===A.audioSend)}function z(A){return oi.debug("isAudioRecvEnabled:",A),null==A||!1!==A.audio&&(void 0===A.audioRecv||null===A.audioRecv||!0===A.audioRecv)}function $(A){return oi.debug("isVideoSendEnabled:",A),null==A||!1!==A.video&&(void 0===A.videoSend||null===A.videoSend||!0===A.videoSend)}function AA(A){return oi.debug("isVideoRecvEnabled:",A),null==A||!1!==A.video&&(void 0===A.videoRecv||null===A.videoRecv||!0===A.videoRecv)}function eA(A){return oi.debug("isDataEnabled:",A),"edge"==oi.webRTCAdapter.browserDetails.browser?(oi.warn("Edge doesn't support data channels yet"),!1):null!=A&&!0===A.data}F(A),this.getServer=function(){return s},this.isConnected=function(){return p},this.reconnect=function(A){(A=A||{}).success="function"==typeof A.success?A.success:oi.noop,A.error="function"==typeof A.error?A.error:oi.noop,A.reconnect=!0,F(A)},this.getSessionId=function(){return m},this.destroy=function(e){!function(e){e=e||{},e.success="function"==typeof e.success?e.success:oi.noop;var o=!0;void 0!==e.asyncRequest&&null!==e.asyncRequest&&(o=!0===e.asyncRequest);var r=!0;void 0!==e.notifyDestroyed&&null!==e.notifyDestroyed&&(r=!0===e.notifyDestroyed);var g=!1;void 0!==e.cleanupHandles&&null!==e.cleanupHandles&&(g=!0===e.cleanupHandles);if(oi.log("Destroying session "+m+" (async="+o+")"),!p)return oi.warn("Is the server down? (connected=false)"),void e.success();if(null==m)return oi.warn("No session to destroy"),e.success(),void(r&&A.destroyed());if(g)for(var c in y)M(c,{noRequest:!0});var l={rtcgw:"destroy",transaction:oi.randomString(12)};null!=u&&(l.token=u);null!=E&&(l.apisecret=E);if(t){l.session_id=m;var I=function(){for(var A in n)i.removeEventListener(A,n[A]);i.removeEventListener("message",C),i.removeEventListener("error",d),a&&clearTimeout(a),i.close()},C=function(t){var i=JSON.parse(t.data);i.session_id==l.session_id&&i.transaction==l.transaction&&(I(),e.success(),r&&A.destroyed())},d=function(t){I(),e.error("Failed to destroy the server: Is the server down?"),r&&A.destroyed()};return i.addEventListener("message",C),i.addEventListener("error",d),void i.send(JSON.stringify(l))}oi.httpAPICall(s+"/"+m,{verb:"POST",async:o,withCredentials:h,body:l,success:function(t){oi.log("Destroyed session:"),oi.debug(t),m=null,p=!1,"success"!==t.rtcgw&&oi.error("Ooops: "+t.error.code+" "+t.error.reason),e.success(),r&&A.destroyed()},error:function(t,i){oi.error(t+":",i),m=null,p=!1,e.success(),r&&A.destroyed()}})}(e)},this.attach=function(A){!function(A){if(A=A||{},A.success="function"==typeof A.success?A.success:oi.noop,A.error="function"==typeof A.error?A.error:oi.noop,A.consentDialog="function"==typeof A.consentDialog?A.consentDialog:oi.noop,A.iceState="function"==typeof A.iceState?A.iceState:oi.noop,A.mediaState="function"==typeof A.mediaState?A.mediaState:oi.noop,A.webrtcState="function"==typeof A.webrtcState?A.webrtcState:oi.noop,A.slowLink="function"==typeof A.slowLink?A.slowLink:oi.noop,A.onmessage="function"==typeof A.onmessage?A.onmessage:oi.noop,A.onlocalstream="function"==typeof A.onlocalstream?A.onlocalstream:oi.noop,A.onremotestream="function"==typeof A.onremotestream?A.onremotestream:oi.noop,A.ondata="function"==typeof A.ondata?A.ondata:oi.noop,A.ondataopen="function"==typeof A.ondataopen?A.ondataopen:oi.noop,A.oncleanup="function"==typeof A.oncleanup?A.oncleanup:oi.noop,A.ondetached="function"==typeof A.ondetached?A.ondetached:oi.noop,!p)return oi.warn("Is the server down? (connected=false)"),void A.error("Is the server down? (connected=false)");var e=A.plugin;if(null==e)return oi.error("Invalid plugin"),void A.error("Invalid plugin");var n=A.opaqueId,a=A.token?A.token:u,o=oi.randomString(12),r={rtcgw:"attach",plugin:e,opaque_id:n,transaction:o};null!=a&&(r.token=a);null!=E&&(r.apisecret=E);if(t)return D[o]=function(t){if(oi.debug(t),"success"!==t.rtcgw)return oi.error("Ooops: "+t.error.code+" "+t.error.reason),void A.error("Ooops: "+t.error.code+" "+t.error.reason);var i=t.data.id;oi.log("Created handle: "+i);var n={session:_,plugin:e,id:i,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return e},getVolume:function(){return V(i,!0)},getRemoteVolume:function(){return V(i,!0)},getLocalVolume:function(){return V(i,!1)},isAudioMuted:function(){return O(i,!1)},muteAudio:function(){return j(i,!1,!0)},unmuteAudio:function(){return j(i,!1,!1)},isVideoMuted:function(){return O(i,!0)},muteVideo:function(){return j(i,!0,!0)},unmuteVideo:function(){return j(i,!0,!1)},getBitrate:function(){return W(i)},send:function(A){R(i,A)},data:function(A){N(i,A)},dtmf:function(A){T(i,A)},consentDialog:A.consentDialog,iceState:A.iceState,mediaState:A.mediaState,webrtcState:A.webrtcState,slowLink:A.slowLink,onmessage:A.onmessage,createOffer:function(A){G(i,!0,A)},createAnswer:function(A){G(i,!1,A)},handleRemoteJsep:function(A){U(i,A)},onlocalstream:A.onlocalstream,onremotestream:A.onremotestream,ondata:A.ondata,ondataopen:A.ondataopen,oncleanup:A.oncleanup,ondetached:A.ondetached,hangup:function(A){X(i,!0===A)},detach:function(A){M(i,A)}};y[i]=n,A.success(n)},r.session_id=m,void i.send(JSON.stringify(r));oi.httpAPICall(s+"/"+m,{verb:"POST",withCredentials:h,body:r,success:function(t){if(oi.debug(t),"success"!==t.rtcgw)return oi.error("Ooops: "+t.error.code+" "+t.error.reason),void A.error("Ooops: "+t.error.code+" "+t.error.reason);var i=t.data.id;oi.log("Created handle: "+i);var n={session:_,plugin:e,id:i,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return e},getVolume:function(){return V(i,!0)},getRemoteVolume:function(){return V(i,!0)},getLocalVolume:function(){return V(i,!1)},isAudioMuted:function(){return O(i,!1)},muteAudio:function(){return j(i,!1,!0)},unmuteAudio:function(){return j(i,!1,!1)},isVideoMuted:function(){return O(i,!0)},muteVideo:function(){return j(i,!0,!0)},unmuteVideo:function(){return j(i,!0,!1)},getBitrate:function(){return W(i)},send:function(A){R(i,A)},data:function(A){N(i,A)},dtmf:function(A){T(i,A)},consentDialog:A.consentDialog,iceState:A.iceState,mediaState:A.mediaState,webrtcState:A.webrtcState,slowLink:A.slowLink,onmessage:A.onmessage,createOffer:function(A){G(i,!0,A)},createAnswer:function(A){G(i,!1,A)},handleRemoteJsep:function(A){U(i,A)},onlocalstream:A.onlocalstream,onremotestream:A.onremotestream,ondata:A.ondata,ondataopen:A.ondataopen,oncleanup:A.oncleanup,ondetached:A.ondetached,hangup:function(A){X(i,!0===A)},detach:function(A){M(i,A)}};y[i]=n,A.success(n)},error:function(A,e){oi.error(A+":",e)}})}(A)}}oi.useDefaultDependencies=function(A){var e=A&&A.fetch||fetch,t=A&&A.Promise||Promise,i=A&&A.WebSocket||WebSocket;return{newWebSocket:function(A,e){return new i(A,e)},extension:A&&A.extension||ai,isArray:function(A){return Array.isArray(A)},webRTCAdapter:A&&A.adapter||window.adapter,httpAPICall:function(A,i){var n={method:i.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===i.verb&&(n.headers["Content-Type"]="application/json"),void 0!==i.withCredentials&&(n.credentials=!0===i.withCredentials?"include":i.withCredentials?i.withCredentials:"omit"),void 0!==i.body&&(n.body=JSON.stringify(i.body));var a=e(A,n).catch((function(A){return t.reject({message:"Probably a network error, is the server down?",error:A})}));if(void 0!==i.timeout){var o=new t((function(A,e){var t=setTimeout((function(){return clearTimeout(t),e({message:"Request timed out",timeout:i.timeout})}),i.timeout)}));a=t.race([a,o])}return a.then((function(A){return A.ok?d(i.success)===d(oi.noop)?A.json().then((function(A){i.success(A)})).catch((function(e){return t.reject({message:"Failed to parse response body",error:e,response:A})})):void 0:t.reject({message:"API call failed",response:A})})).catch((function(A){d(i.error)===d(oi.noop)&&i.error(A.message||"<< internal error >>",A)})),a}}},oi.useOldDependencies=function(A){var e=A&&A.jQuery||jQuery,t=A&&A.WebSocket||WebSocket;return{newWebSocket:function(A,e){return new t(A,e)},isArray:function(A){return e.isArray(A)},extension:A&&A.extension||ai,webRTCAdapter:A&&A.adapter||adapter,httpAPICall:function(A,t){var i=void 0!==t.body?{contentType:"application/json",data:JSON.stringify(t.body)}:{},n=void 0!==t.withCredentials?{xhrFields:{withCredentials:t.withCredentials}}:{};return e.ajax(e.extend(i,n,{url:A,type:t.verb,cache:!1,dataType:"json",async:t.async,timeout:t.timeout,success:function(A){d(t.success)===d(oi.noop)&&t.success(A)},error:function(A,e,i){d(t.error)===d(oi.noop)&&t.error(e,i)}}))}}},oi.noop=function(){},oi.dataChanDefaultLabel="JanusDataChannel",oi.endOfCandidates=null,oi.init=function(A){if((A=A||{}).callback="function"==typeof A.callback?A.callback:oi.noop,!0===oi.initDone)A.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),oi.trace=oi.noop,oi.debug=oi.noop,oi.vdebug=oi.noop,oi.log=oi.noop,oi.warn=oi.noop,oi.error=oi.noop,!0===A.debug||"all"===A.debug)oi.trace=console.trace.bind(console),oi.debug=console.debug.bind(console),oi.vdebug=console.debug.bind(console),oi.log=console.log.bind(console),oi.warn=console.warn.bind(console),oi.error=console.error.bind(console);else if(Array.isArray(A.debug))for(var e in A.debug){var t=A.debug[e];switch(t){case"trace":oi.trace=console.trace.bind(console);break;case"debug":oi.debug=console.debug.bind(console);break;case"vdebug":oi.vdebug=console.debug.bind(console);break;case"log":oi.log=console.log.bind(console);break;case"warn":oi.warn=console.warn.bind(console);break;case"error":oi.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+t+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')")}}var i=A.dependencies||oi.useDefaultDependencies();oi.isArray=i.isArray,oi.webRTCAdapter=i.webRTCAdapter,oi.httpAPICall=i.httpAPICall,oi.newWebSocket=i.newWebSocket,oi.extension=i.extension,oi.extension.init(),oi.listDevices=function(A,e){A="function"==typeof A?A:oi.noop,null==e&&(e={audio:!0,video:!0}),oi.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(e).then((function(e){navigator.mediaDevices.enumerateDevices().then((function(t){oi.debug(t),A(t);try{var i=e.getTracks();for(var n in i){var a=i[n];null!=a&&a.stop()}}catch(A){}}))})).catch((function(e){oi.error(e),A([])})):(oi.warn("navigator.mediaDevices unavailable"),A([]))},oi.attachMediaStream=function(A,e){"chrome"===oi.webRTCAdapter.browserDetails.browser?oi.webRTCAdapter.browserDetails.version>=52?A.srcObject=e:oi.error("Error attaching stream to element"):A.srcObject=e},oi.reattachMediaStream=function(A,e){"chrome"===oi.webRTCAdapter.browserDetails.browser?oi.webRTCAdapter.browserDetails.version>=52?A.srcObject=e.srcObject:void 0!==A.src?A.src=e.src:oi.error("Error reattaching stream to element"):A.srcObject=e.srcObject};var n=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+n];if(window.addEventListener(n,(function(A){for(var e in oi.log("Closing window"),oi.sessions)null!==oi.sessions[e]&&void 0!==oi.sessions[e]&&oi.sessions[e].destroyOnUnload&&(oi.log("Destroying session "+e),oi.sessions[e].destroy({asyncRequest:!1,notifyDestroyed:!1}));a&&"function"==typeof a&&a()})),oi.safariVp8=!1,"safari"===oi.webRTCAdapter.browserDetails.browser&&oi.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var e in RTCRtpSender.getCapabilities("video").codecs){var o=RTCRtpSender.getCapabilities("video").codecs[e];if(o&&o.mimeType&&"video/vp8"===o.mimeType.toLowerCase()){oi.safariVp8=!0;break}}oi.safariVp8?oi.log("This version of Safari supports VP8"):oi.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{var r=new RTCPeerConnection({},{});r.createOffer({offerToReceiveVideo:!0}).then((function(A){oi.safariVp8=-1!==A.sdp.indexOf("VP8"),oi.safariVp8?oi.log("This version of Safari supports VP8"):oi.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),r.close(),r=null}))}if(oi.unifiedPlan=!1,"firefox"===oi.webRTCAdapter.browserDetails.browser&&oi.webRTCAdapter.browserDetails.version>=59)oi.unifiedPlan=!0;else if("chrome"===oi.webRTCAdapter.browserDetails.browser&&oi.webRTCAdapter.browserDetails.version<72)oi.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){var s=new RTCPeerConnection;try{s.addTransceiver("audio"),oi.unifiedPlan=!0}catch(A){}s.close()}else oi.unifiedPlan=!1;oi.initDone=!0,A.callback()}},oi.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},oi.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},oi.randomString=function(A){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=A.customizeStream,t=void 0===e?null:e,i=A.audio,n=void 0===i||i;ri.isWebrtcSupported()?si=new ri({server:window.EZUIKit.opt.rtcUrl,success:function(){si.attach({plugin:"rtcgw.plugin.tts",opaqueId:ci,success:function(A){gi=window.tts=A,ri.log("Plugin attached! ("+gi.getPlugin()+", id="+gi.getId()+")");var e=window.EZUIKit.opt.talkLink;console.log("ttsUlr",e);var i={request:"start",url:e,codec:"opus",dir:"sendrecv",audio_debug:1,url_version:"1"};"gb28181"===window.EZUIKit.opt.talkType&&(i.devProto="gb28181"),ri.debug("Trying a createOffer too (audio/video sendrecv)"),gi.createOffer({media:{audio:n||!0,video:!1,data:!1},simulcast:!1,simulcast2:!1,customizeStream:t,success:function(A){ri.debug("Got SDP!"),ri.debug(A),gi.send({message:i,jsep:A}),void 0!==window.EZUIKit.handleTalkSuccess&&window.EZUIKit.handleTalkSuccess()},error:function(A){ri.error("WebRTC error:",A),void 0!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(A)}})},error:function(A){console.error(" -- Error attaching plugin...",A),bootbox.alert("Error attaching plugin... "+A),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(A)},consentDialog:function(A){ri.debug("Consent dialog should be "+(A?"on":"off")+" now")},iceState:function(A){ri.log("ICE state changed to "+A)},mediaState:function(A,e){ri.log("Janus "+(e?"started":"stopped")+" receiving our "+A)},webrtcState:function(A){ri.log("Janus says our WebRTC PeerConnection is "+(A?"up":"down")+" now")},slowLink:function(A,e){ri.warn("Janus reports problems "+(A?"sending":"receiving")+" packets on this PeerConnection ("+e+" lost packets)")},onmessage:function(A,e){ri.debug(" ::: Got a message :::"),ri.debug(A),null!=e&&(ri.debug("Handling SDP as well..."),ri.debug(e),gi.handleRemoteJsep({jsep:e}));var t=A.result;if(null!=t){if("done"===t)return bootbox.alert("The TTS Test is over"),null!=li&&li.stop(),void(li=null);"msg"===t&&void 0!==window.EZUIKit.handleTalkMessage&&window.EZUIKit.handleTalkMessage(A),"slow_link"===t.status&&toastr.warning("Janus apparently missed many packets we sent, maybe we should reduce the bitrate","Packet loss?",{timeOut:2e3})}},onlocalstream:function(A){ri.debug(" ::: Got a local stream :::"),ri.debug(A),ri.attachMediaStream(document.getElementById("myaudio"),A),"completed"!==gi.webrtcStuff.pc.iceConnectionState&&"connected"!==gi.webrtcStuff.pc.iceConnectionState&&(null==li?document.getElementById("audioright"):li.spin());var e=A.getAudioTracks();null==e||e.length},onremotestream:function(A){ri.debug(" ::: Got a remote stream :::"),ri.debug(A),ri.attachMediaStream(document.getElementById("peeraudio"),A);var e=A.getAudioTracks();null==e||0===e.length||document.getElementById("peeraudio").play()},ondataopen:function(A){ri.log("The DataChannel is available!")},ondata:function(A){ri.debug("We got data from the DataChannel! "+A)},oncleanup:function(){ri.log(" ::: Got a cleanup notification :::"),null!=li&&li.stop(),li=null}})},error:function(A){ri.error(A),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(A)},destroyed:function(){}}):bootbox.alert("No WebRTC support... ")}}});var Ii=function(){return o((function A(e){var i=this;t(this,A),this.jSPlugin=e,this.pluginStatus=new H(this,this.jSPlugin.params.id),this.talkChannelNo=e.talkChannelNo,this.gainNode=null,this.volumeGain=null,this.volumeChangeInterval=null,this.microphoneId=null;var n=document.createElement("div");n.id="audioleft";var a=document.createElement("div");a.id="audioright",a.style="display:none;";var o=document.createElement("audio");o.id="myaudio",o.muted=!0,o.setAttribute("autoplay",!0),o.setAttribute("controls",!0),n.appendChild(o),n.style="display:none;";var r=document.createElement("audio");r.id="peeraudio",r.setAttribute("autoplay",!0),r.setAttribute("controls",!0),a.appendChild(r),window.EZUIKit.handleTalkError=function(A){console.log("talk err",A),void 0!==i.jSPlugin.handleTalkError&&i.jSPlugin.handleTalkError(A)},window.EZUIKit.handleTalkSuccess=function(A){console.log("talk success",A),void 0!==i.jSPlugin.handleTalkSuccess&&i.jSPlugin.handleTalkSuccess(A)},window.EZUIKit.opt={rtcUrl:"",talkLink:"",ttsUrl:"",stream:"",deviceSerial:m(this.jSPlugin.url).deviceSerial,channelNo:m(this.jSPlugin.url).channelNo},document.body.appendChild(n),document.body.appendChild(a)}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"startTalk",value:function(A){var e=this,t=this;new Promise((function(A,t){e.jSPlugin.capacity&&e.jSPlugin.capacity.support_switch_talkmode&&"1"==e.jSPlugin.capacity.support_switch_talkmode?fetch(e.jSPlugin.env.domain+"/api/service/device/talkMode"+"?deviceSerial=".concat(m(e.jSPlugin.url).deviceSerial),{method:"GET",headers:{accessToken:e.jSPlugin.accessToken||e.jSPlugin.token.deviceToken.global}}).then((function(A){return A.json()})).then((function(t){t.meta&&200==t.meta.code?t.data&&t.data.valueInfo&&0==t.data.valueInfo.mode?fetch(e.jSPlugin.env.domain+"/api/v3/device/talkMode"+"?deviceSerial=".concat(m(e.jSPlugin.url).deviceSerial,"&channelNo=").concat(m(e.jSPlugin.url).channelNo,"&mode=1"),{method:"PUT",headers:{accessToken:e.jSPlugin.accessToken||e.jSPlugin.token.deviceToken.video}}).then((function(A){return A.json()})).then((function(e){e.meta&&200==e.meta.code?A():A({code:-1,msg:"对讲模式切换失败",res:e})})).catch((function(e){A({code:-1,msg:"对讲模式切换失败",res:e})})):A():A({code:-1,msg:"获取当前对讲模式失败",res:t})})).catch((function(e){A({code:-1,msg:"获取当前对讲模式失败",res:e})})):A({code:-1,msg:"当前设备不支持对讲模式切换"})})).then((function(i){if(e.jSPlugin.capacity&&e.jSPlugin.capacity.support_talk&&(!e.jSPlugin.capacity||"3"!==e.jSPlugin.capacity.support_talk&&"1"!==e.jSPlugin.capacity.support_talk))return"function"==typeof e.jSPlugin.params.handleError&&(e.pluginStatus.loadingSetText({text:"设备不支持对讲",color:"red",delayClear:2e3}),e.jSPlugin.params.handleError({msg:"设备不支持对讲",retcode:-1e3,id:e.jSPlugin.params.id,type:"handleError"})),console.log("设备不支持对讲"),!1;var n=new FormData;if(n.append("accessToken",e.jSPlugin.accessToken||e.jSPlugin.token.deviceToken.video),n.append("deviceSerial",m(e.jSPlugin.url).deviceSerial),n.append("channelNo",e.jSPlugin.channelNo||"0"),e.jSPlugin.params.extraParams&&e.jSPlugin.params.extraParams.talkParams&&"object"===d(e.jSPlugin.params.extraParams.talkParams))for(var a in e.jSPlugin.params.extraParams.talkParams)data.append(a,e.jSPlugin.params.extraParams.talkParams[a]);fetch(e.jSPlugin.env.domain+"/api/lapp/live/talk/url",{method:"POST",body:n}).then((function(A){return A.json()})).then((function(i){if(200==i.code){var n=i.data;if(n){var a=n.rtcUrl;if(-1===a.indexOf("ws")&&(a=a.replace("https","wss").replace("rtcgw","rtcgw-ws")),window.EZUIKit.opt.rtcUrl=a,window.EZUIKit.opt.ttsUrl="tts://"+n.ttsUrl,e.jSPlugin.params.extraParams&&e.jSPlugin.params.extraParams.ttsParams)if("string"==typeof e.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+e.jSPlugin.params.extraParams.ttsParams;else if("object"===d(e.jSPlugin.params.extraParams.ttsParams))for(var o in e.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+o+"="+e.jSPlugin.params.extraParams.ttsParams[o];window.EZUIKit.opt.deviceSerial=m(e.jSPlugin.url).deviceSerial,window.EZUIKit.opt.channelNo=e.talkChannelNo||"0";var r="talk?dev="+window.EZUIKit.opt.deviceSerial+"&chann="+window.EZUIKit.opt.channelNo+"&encodetype=2";window.EZUIKit.opt.talkLink=window.EZUIKit.opt.ttsUrl.split("?")[0]+"/"+r,n.ttsUrl.indexOf("gb28181")>-1&&(window.EZUIKit.opt.talkType="gb28181"),A&&A(n.ttsUrl.indexOf("gb28181")>-1||-1!==window.EZUIKit.opt.deviceSerial.indexOf(":")),window.EZUIKit.opt.stream=e.jSPlugin.accessToken?n.stream:e.jSPlugin.token.streamToken.talk,window.startTalk({customizeStream:t._customizeStream.bind(t),audio:!e.microphoneId||{deviceId:e.microphoneId}}),e.observeVolumeChange(),e.jSPlugin.eventEmitter&&e.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:e,msg:"开启对讲"})}}else console.log(i.code,e.jSPlugin.i18n.t("38"+i.code)),e.pluginStatus.loadingSetText({text:i.msg||e.jSPlugin.i18n.t("38"+i.code),color:"red",delayClear:2e3}),e.jSPlugin.eventEmitter&&e.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:-1,target:e,msg:i.msg||e.jSPlugin.i18n.t("38"+i.code)}),"function"==typeof e.jSPlugin.params.handleError&&e.jSPlugin.params.handleError({msg:i.msg||e.jSPlugin.i18n.t("38"+i.code),retcode:i.code,id:e.jSPlugin.params.id,type:"handleError"})})).catch((function(A){console.log("err",A)}))})).catch((function(A){console.log("对讲开启失败:",A)}))}},{key:"stopTalk",value:function(){var A=this;window.stopTalk(),this.gainNode=null,clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null,this.jSPlugin.eventEmitter&&(setTimeout((function(){A.jSPlugin.eventEmitter.emit("volumeChange",{eventType:"volumeChange",code:0,target:A,data:0,msg:"音量变化"})}),200),this.jSPlugin.eventEmitter.emit("stopTalk",{eventType:"stopTalk",code:0,target:this,msg:"结束对讲"})),document.getElementById("myaudio")&&document.getElementById("myaudio").srcObject&&document.getElementById("myaudio").srcObject.getTracks()[0].stop()}},{key:"changeTalkChannelNo",value:function(A){window.EZUIKit.opt&&window.EZUIKit.opt.channelNo&&(this.talkChannelNo=A,window.EZUIKit.opt.channelNo=A)}},{key:"_customizeStream",value:function(A){var e=this;return new Promise((function(t,i){var n,a=new window.AudioContext;e.gainNode=a.createGain(),console.log("thisa",e);var o=a.createMediaStreamSource(A);e.gainNode.gain.value=null!==(n=e.volumeGain)&&void 0!==n?n:1;var r=a.createMediaStreamDestination();o.connect(e.gainNode),e.gainNode.connect(r),t(r.stream)}))}},{key:"setVolumeGain",value:function(A){var e=["",null].includes(A)?1:Number(A);return"number"==typeof e&&e>=0?(this.volumeGain=Math.min(e,10),this.gainNode&&(this.gainNode.gain.value=this.volumeGain),{code:0,msg:"成功",res:null}):{code:-1,msg:"参数格式有误",res:null}}},{key:"observeVolumeChange",value:function(){var A=this,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).interval,t=void 0===e?100:e;this.volumeChangeInterval&&(clearInterval(volumeChangeInterval),volumeChangeInterval=null),this.volumeChangeInterval=setInterval((function(){var e,t,i,n,a;null===(e=window.tts)||void 0===e||null===(t=e.webrtcStuff)||void 0===t||null===(i=t.pc)||void 0===i||null===(n=i.getStats)||void 0===n||null===(a=n.call(i))||void 0===a||a.then((function(e){e.forEach((function(e){var t,i;"media-source"===e.type&&(null===(t=A.jSPlugin)||void 0===t||null===(i=t.eventEmitter)||void 0===i||i.emit("volumeChange",{eventType:"volumeChange",code:0,target:A,data:e.audioLevel,msg:"音量变化"}))}))}))}),t)}},{key:"getMicrophonePermission",value:function(){return new Promise((function(A,e){navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){e.getTracks().forEach((function(A){A.stop()})),A({code:0,msg:"成功",res:null})})).catch((function(e){A({code:-1,msg:"获取麦克风权限失败",res:e})}))}))}},{key:"getMicrophonesList",value:function(){return new Promise((function(A,e){navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(e){var t=[];e.map((function(A){"audioinput"==A.kind&&t.push(A)})),A({code:0,msg:"成功",res:t})})):A({code:-1,msg:"未查询到相关设备",res:null})}))}},{key:"setProfile",value:function(A){var e=this,t=A.microphoneId;t!==this.microphoneId&&(this.microphoneId=t,this.gainNode&&(window.stopTalk(),setTimeout((function(){window.startTalk({customizeStream:e._customizeStream.bind(e),audio:!e.microphoneId||{deviceId:e.microphoneId}})}),200)))}}])}(),Ci=function(){function A(e){var i=this;t(this,A),this.jSPlugin=e,this.pluginStatus=new H(this,this.jSPlugin.id),A._instanceStyle();var n=document.createElement("div");n.className="mobile-ez-ptz-container",n.id="mobile-ez-ptz-container";var a=window.innerHeight;n.style="display:inline-block;width: ".concat(this.jSPlugin.width,"px;text-align:center;height: ").concat(a-this.jSPlugin.height-5,"px");var o=document.createElement("div");o.className="live-ptz-title",o.id="live-ptz-title",o.innerHTML=this.jSPlugin.i18n.t("BTN_PTZ"),document.getElementById("live-ptz-title")||n.appendChild(o);var r=document.createElement("div");r.className="live-ptz-intro",r.id="live-ptz-intro",r.innerHTML=this.jSPlugin.i18n.t("MOBILE_PTZ_TIPS"),document.getElementById("live-ptz-intro")||n.appendChild(r);var s=document.createElement("div");s.id="mobile-ez-ptz-item",s.className="mobile-ez-ptz-wrap",s.innerHTML='\n
\n
\n
\n
\n
\n
\n
\n ',document.getElementById("mobile-ez-ptz-item")||n.appendChild(s),x(n,document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.getElementById("mobile-ez-ptz-item").ontouchstart=function(A){A.preventDefault(),console.log("触摸开始"),i._handlePtzTouch(A,"start")},document.getElementById("mobile-ez-ptz-item").ontouchend=function(A){A.preventDefault(),console.log("触摸结束",A),i._handlePtzTouch(A,"stop")},document.getElementById("mobile-ez-ptz-item").onmousedown=function(A){A.preventDefault(),console.log("触摸开始"),i._handlePtzTouch(A,"start")},document.getElementById("mobile-ez-ptz-item").onmouseup=function(A){A.preventDefault(),console.log("触摸结束",A),i._handlePtzTouch(A,"stop")}}return o(A,[{key:"show",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: inline-block"}},{key:"hide",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: none"}},{key:"_handlePtzTouch",value:function(A,e){var t=this,i=document.getElementById("mobile-ez-ptz-item").getBoundingClientRect(),n=i.left+130,a=i.top+130,o=(A.x||A.changedTouches[0].clientX)-n,r=(A.y||A.changedTouches[0].clientY)-a,s=0,g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;Math.abs(o)>Math.abs(r)?o>0?(s=3,document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("default","active")):(s=2,document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("default","active")):r>0?(s=1,document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("default","active")):(s=0,document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("default","active")),document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===s?180:1===s?0:2===s?90:270,"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)"),"stop"===e&&(g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById("mobile-ez-ptz-item").style="",document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("active","default"));var l=new FormData;l.append("deviceSerial",m(this.jSPlugin.url).deviceSerial),l.append("channelNo",m(this.jSPlugin.url).channelNo),l.append("speed",1),l.append("direction",s),l.append("accessToken",c),fetch(g,{method:"POST",body:l}).then((function(A){return A.json()})).then((function(A){if(200==A.code);else{console.log(A.code,t.jSPlugin.i18n.t("38"+A.code));var e=t.jSPlugin.i18n.t("38"+A.code)||A.msg;t.pluginStatus.loadingSetText({text:e,color:"red",delayClear:2e3}),60005!=A.code&&60002!=A.code&&60003!=A.code&&60004!=A.code||(document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===s?180:1===s?0:2===s?90:270,"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"))}})).catch((function(A){console.log("云台调用异常",A)}))}}],[{key:"_instanceStyle",value:function(){A._STYLE||(A._STYLE=document.createElement("style"),A._STYLE.innerHTML="\n body{\n padding: 0;\n margin: 0;\n }\n #mobile-ez-ptz-container {\n display: inline-block;\n width: 375px;\n text-align: center;\n }\n .live-ptz-title{\n height: 25px;\n font-size: 18px;\n color: #2c2c2c;\n text-align: center;\n font-weight: 700;\n margin: 24px 0 12px;\n }\n .live-ptz-intro {\n margin-bottom: 24px;\n color: #aaaaaa;\n }\n .mobile-ez-ptz-wrap {\n background-image: linear-gradient(180deg, #f6f8ff 0%, #ededed6b 50%)\n }\n #mobile-ez-ptz-container .mobile-ez-ptz-container {\n position: relative;\n width: 260px;\n height: 260px;\n background: rgba(255, 255, 255, 0.80);\n border: 1px solid rgba(255, 255, 255, 0.80);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n margin: auto;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n top: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top.active {\n border-bottom-color: #1890FF;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n bottom: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom.active {\n border-top-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-left: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n right: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right.active {\n border-left-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n left: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left.active {\n border-right-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .ez-ptz-main.center {\n width: 52px;\n height: 52px;\n background: #FFFFFF;\n border: 2px solid #eee;\n border-radius: 100%;\n top: calc(50% - 26px);\n left: calc(50% - 26px);\n position: absolute;\n /* box-shadow: 0px -39px 40px 6px #1890ff; */\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-wrap {\n display: inline-block;\n padding: 24px 24px;\n border-radius: 100%;\n overflow: hidden;\n }\n\n #mobile-ez-ptz-container .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }",document.getElementsByTagName("head")[0].appendChild(A._STYLE))}}])}();s(Ci,"_STYLE",void 0);var di={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]},footer:{color:"#FFFFFF",backgroundColor:"rgb(0 0 0 / 0%)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-0",iconId:"play",part:"left",defaultActive:1,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-1",iconId:"capturePicture",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-2",iconId:"sound",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-3",iconId:"pantile",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-4",iconId:"recordvideo",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-5",iconId:"talk",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-6",iconId:"hd",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-7",iconId:"webExpend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-8",iconId:"expend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]}},hi={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Bi={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},ui={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Ei={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},fi={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},Qi={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},xi={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},pi={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},mi=[{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcLive",themeIntro:"PC直播全量版",themeName:"PC直播全量版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:ui.data.header,footer:ui.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"security",themeIntro:"PC直播安防版",themeName:"PC直播安防版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Ei.data.header,footer:Ei.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"voice",themeIntro:"PC直播语音版",themeName:"PC直播语音版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Qi.data.header,footer:Qi.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"simple",themeIntro:"PC直播极简版",themeName:"PC直播极简版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"",header:fi.data.header,footer:fi.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcRec",themeIntro:"PC回放全量版",themeName:"PC回放全量版",themeType:"webRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:xi.data.header,footer:xi.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileLive",themeIntro:"Mobile直播全量版",themeName:"Mobile直播全量版",themeType:"mobileLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:hi.data.header,footer:hi.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Bi.data.header,footer:Bi.data.footer},{autoFocus:0,createTime:"2021-06-14T08:04:37.000Z",themeId:"miniRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"",header:pi.data.header,footer:pi.data.footer}],yi=function(){return o((function A(e){var i=this;t(this,A),this.jSPlugin=e,this.enableZoom=!1,this.videoWidth=1920,this.videoHeight=1080,this.currentScale=1,this.currentPosition={left:0,top:0,right:1920,bottom:1080},this.info={},this.clientRect=document.getElementById(e.id).getBoundingClientRect(),this.DOM=document.getElementById(e.id);var n=document.createElement("div");n.id="".concat(e.id,"-zoom-container");var a=document.getElementById("".concat(e.id,"-audioControls")),o=48;a&&(o=a.offsetHeight);var r=e.isMobile?"\n -webkit-transform: scale(0.8);\n -moz-transform: scale(0.8);\n -ms-transform: scale(0.8);\n transform: scale(0.8);\n transform-origin: left bottom;":"";n.style="position: absolute;\n display:none;\n left: 12px;\n bottom: ".concat(e.isMobile?"".concat(o+6,"px"):"80px",";\n ").concat(r,"\n ");var s='\n \n
2.0X
\n
\n \n \n ').concat(this.jSPlugin.i18n.t("ZOOM_ADD"),'\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n \n \n ').concat(this.jSPlugin.i18n.t("ZOOM_SUB"),'\n \n \n \n \n \n \n \n \n \n \n
\n \n ');n.innerHTML=s,document.getElementById("".concat(e.id,"-audioControls-left"))&&(document.getElementById("".concat(e.id,"-audioControls-left")).parentNode.appendChild(n),document.getElementById("".concat(e.id,"-addScale")).onclick=function(){i.addScale()},document.getElementById("".concat(e.id,"-subScale")).onclick=function(){i.subScale()}),this._event()}),[{key:"_event",value:function(){var A=this,e=setInterval((function(){var t=document.getElementById("".concat(A.jSPlugin.id,"-container-0"));clearInterval(e),A.jSPlugin.isMobile?t&&(t.addEventListener("touchstart",(function(e){return A.onTouchstart(e)})),t.addEventListener("touchend",(function(e){return A.onTouchend(e)}))):t&&(t.addEventListener("mousedown",(function(e){return A.onMouseDown(e)})),t.addEventListener("mouseup",(function(e){return A.onMouseUp(e)})))}),100)}},{key:"onMouseDown",value:function(A){if(1===this.currentScale)return!1;this.moveX=A.clientX,this.moveY=A.clientY}},{key:"onMouseUp",value:function(A){var e=this.currentPosition;if(1===this.currentScale)return!1;e.left=e.left-(A.clientX-this.moveX),e.top=e.top-(A.clientY-this.moveY),this.doScale()}},{key:"onTouchstart",value:function(A){if(1===this.currentScale)return!1;if(this.jSPlugin.use3DZoom||1===this.currentScale)return!1;if(!this.jSPlugin.beforeMobileZoomVerify())return!1;if(!this.inited){var e=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=e.width,this.videoHeight=e.height,this.currentPosition.left=0,this.currentPosition.top=0,this.isMobileFullScreen?(this.currentPosition.right=e.height,this.currentPosition.bottom=e.width):(this.currentPosition.right=e.width,this.currentPosition.bottom=e.height),this.inited=!0}var t=A.touches[0];if(t){var i={clientX:0,clientY:0};i.clientX=t.clientX,i.clientY=t.clientY,this.point1=i}}},{key:"onTouchend",value:function(A){var e=this,t=this.currentPosition;if(1===this.currentScale)return!1;var i=A.changedTouches[0];this.isMobileFullScreen?(t.left=t.left-(i.clientY-e.point1.clientY),t.top=t.top+(i.clientX-e.point1.clientX)):(t.left=t.left-(i.clientX-e.point1.clientX),t.top=t.top-(i.clientY-e.point1.clientY)),e.doScale()}},{key:"renderDot",value:function(){var A=this.currentScale;document.getElementById("".concat(this.jSPlugin.id,"-scale-value"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-value")).innerHTML="".concat(A,".0X")),document.getElementById("".concat(this.jSPlugin.id,"-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-line-dot")).style.height="".concat((A-1)/7*100,"%")),document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot")).style.bottom="calc(".concat((A-1)/7*100,"% - 3px)"))}},{key:"getTopMostElement",value:function(A,e,t){var i=A?A.getBoundingClientRect():null,n=e?e.getBoundingClientRect():null,a=t?t.getBoundingClientRect():null;if(!i&&!n&&!a)return null;if(!i)return n.top1?1.25:.75),A.right=A.right*i*(i>1?1.25:.75),this.info.width=t.width,this.videoWidth=t.width*(i>1.25?1:.75)*this.dpr}if(t.height!=this.info.height){var n=parseFloat(t.height/this.info.height);A.top=A.top*n*(n>1?1.25:.75),A.bottom=A.bottom*n*(n>1?1.25:.75),this.info.height=t.height,this.videoHeight=t.height*(n>1?1.25:.75)*this.dpr}A.left=A.left+.5*(A.right-A.left-this.videoWidth/e),A.left<=0?A.left=0:A.left>this.videoWidth-this.videoWidth/e&&(A.left=this.videoWidth-this.videoWidth/e),A.right=A.left+this.videoWidth/e,A.top=A.top+.5*(A.bottom-A.top-this.videoHeight/e),A.top<=0?A.top=0:A.top>this.videoHeight-this.videoHeight/e&&(A.top=this.videoHeight-this.videoHeight/e),A.bottom=A.top+this.videoHeight/e,A.left=parseInt(A.left,10),A.right=parseInt(A.right,10),A.top=parseInt(A.top,10),A.bottom=parseInt(A.bottom,10);try{A.left0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomAdd",{eventType:"zoomAdd",code:1,target:this,msg:"执行放大"}),this.currentScale>=8?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_ADD_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale+A,this.currentScale>8?(console.log("超出最大倍率"),this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"subScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomSub",{eventType:"zoomSub",code:1,target:this,msg:"执行缩小"}),this.currentScale<=1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_SUB_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale-A,this.currentScale<1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"_JSPlayM4_SetDisplayRegion",value:function(A,e,t,i,n){this.jSPlugin&&this.jSPlugin.jSPlugin&&(console.log("%c计算后,","color: red;",this.videoWidth,this.videoHeight,A,e,t,i,this.currentScale),this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(A,e,t,i,n,this.isMobileFullScreen))}},{key:"isMobileFullScreen",get:function(){return!!(S()&&this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state.expend)}}])}(),_i=[{videoLevel:1,streamTypeIn:2},{videoLevel:2,streamTypeIn:1}],Si={0:"VIDEO_LEVEL_FLUENT",1:"VIDEO_LEVEL_SATNDARD",2:"VIDEO_LEVEL_HEIGH",3:"VIDEO_LEVEL_SPUER",4:"VIDEO_LEVEL_EXTREME",5:"VIDEO_LEVEL_3K",6:"VIDEO_LEVEL_4k"},Di="8.1.1",wi=function(A,e,t,i){var n="".concat(A.env.domain,"/api/service/media/template/getDetail?accessToken=").concat(A.accessToken||A.token.httpToken.url,"&id=").concat(e);fetch(n,{method:"GET"}).then((function(A){return A.json()})).then((function(A){var e;(e=A).meta&&t(e)})).catch((function(A){var e;e=A,console.log(e),i(e)}))},vi=function(A){var e="";return Object.keys(A).map((function(t,i){e+="".concat(t,":").concat(A[t]).concat(i0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){document.getElementById("".concat(A.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),A.startAutoFocus()}))),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)var n=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&A.jSPlugin.autoplay&&(clearInterval(n),A.themeInited=!0)}),50);Ft(this.themeData.footer.btnList,(function(A){return"zoom"===A.iconId&&A.isrender>0}))>=0&&(this.isMobile&&!this.jSPlugin.use3DZoom&&(this.jSPlugin.beforeMobileZoomVerify=function(){return!!A.decoderState.state.play}),this.jSPlugin.Zoom=new yi(this.jSPlugin))}},{key:"setDecoderState",value:function(A){var e=this,t=this.themeData,i=t.header,n=t.footer;Object.keys(A).map((function(t,a){var o="#FFFFFF",r="#FFFFFF";switch(-1===i.btnList.findIndex((function(A){return A.iconId===t}))?(o=n.color.replace("-diy",""),r=n.activeColor.replace("-diy","")):(o=i.color.replace("-diy",""),r=n.activeColor.replace("-diy","")),t){case"play":A[t]?document.getElementById("".concat(e.jSPlugin.id,"-play"))&&(document.getElementById("".concat(e.jSPlugin.id,"-play-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-play-content")).children[0].children[1].style="display:none",document.getElementById("".concat(e.jSPlugin.id,"-play")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-play-content")).childNodes[0].children[0].style.fill=A[t]?r:o):document.getElementById("".concat(e.jSPlugin.id,"-play"))&&(document.getElementById("".concat(e.jSPlugin.id,"-play-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-play-content")).children[0].children[0].style="display:none",document.getElementById("".concat(e.jSPlugin.id,"-play")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-play-content")).childNodes[0].children[1].style.fill=A[t]?r:o);break;case"sound":document.getElementById("".concat(e.jSPlugin.id,"-sound"))&&(A[t]?(document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(e.jSPlugin.id,"-sound")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=A[t]?r:o):(document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(e.jSPlugin.id,"-sound")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).childNodes[0].children[0].style.fill=A[t]?r:o));break;case"recordvideo":document.getElementById("".concat(e.jSPlugin.id,"-recordvideo"))&&(document.getElementById("".concat(e.jSPlugin.id,"-recordvideo")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-recordvideo-content")).childNodes[0].style.fill=A[t]?r:o,A[t]?e.countTime("add",0):e.countTime("destroy",0));break;case"talk":document.getElementById("".concat(e.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(e.jSPlugin.id,"-talk")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=A[t]?r:o);break;case"zoom":document.getElementById("".concat(e.jSPlugin.id,"-zoom"))&&(document.getElementById("".concat(e.jSPlugin.id,"-zoom")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-zoom-content")).childNodes[1].style.fill=A[t]?r:o);break;case"pantile":document.getElementById("".concat(e.jSPlugin.id,"-pantile"))&&(document.getElementById("".concat(e.jSPlugin.id,"-pantile")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-pantile-content")).childNodes[0].style.fill=A[t]?r:o);break;case"webExpend":A[t]?(document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend")).className="disabled")):(document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend")).className="")),document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[0].style.fill=A[t]?r:o,document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[1].style.fill=A[t]?r:o);break;case"capturePicture":document.getElementById("".concat(e.jSPlugin.id,"-capturePicture"))&&(document.getElementById("".concat(e.jSPlugin.id,"-capturePicture")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-capturePicture-content")).childNodes[0].style.fill=A[t]?r:o);break;case"expend":A[t]?(document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend")).className="disabled")):(document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend")).className="")),document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[0].style.fill=A[t]?r:o,document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[1].style.fill=A[t]?r:o);break;case"hd":break;case"speed":if(document.getElementById("".concat(e.jSPlugin.id,"-speed"))){var s=document.getElementById("".concat(e.jSPlugin.id,"-speed-content")).children[1].children[0];"not-allowed"!==s.style.cursor&&(s.style.color=A[t]?r:o,s.style.borderColor=A[t]?r:o)}document.getElementById("".concat(e.jSPlugin.id,"-select-mask"))&&(e.isMobile&&A[t]?document.getElementById("".concat(e.jSPlugin.id,"-select-mask")).style.display="block":document.getElementById("".concat(e.jSPlugin.id,"-select-mask")).style.display="none");break;case"cloudRec":document.getElementById("".concat(e.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-cloudRec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=A[t]?r:o),document.getElementById("".concat(e.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-rec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=A[t]?o:r);break;case"cloudRecord":var g=document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord"));g&&(g.className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=A[t]?r:o),document.getElementById("".concat(e.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-rec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=A[t]?o:r);break;case"rec":document.getElementById("".concat(e.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-cloudRec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=A[t]?o:r),document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord"))&&(document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=A[t]?o:r),document.getElementById("".concat(e.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-rec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=A[t]?r:o)}e.decoderState.state=Object.assign(e.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)}},{key:"hideFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="none")}},{key:"showFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="block")}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"renderFooter",value:function(A,e){var t=this.matchBtn(A),i=document.createElement("div");i.className="theme-icon-item",i.innerHTML="".concat('')+'
')).concat(t.domString,"
")+"
",i.onclick=function(A){t.onclick(A)},t.onmouseenter&&(i.onmouseenter=function(A){t.onmouseenter(A)}),t.onmouseleave&&(i.onmouseleave=function(A){t.onmouseleave(A)}),"left"===e?document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[0].appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[1].appendChild(i)}},{key:"renderHeader",value:function(A,e){var t=this.matchBtn(A),i=document.createElement("div");i.className="theme-icon-item",i.style="max-width:50%;",i.innerHTML="".concat('')+'')).concat(t.domString,"")+"",i.onclick=function(A){t.onclick(A)},"left"===e?document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[1].appendChild(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:"setDisabled",value:function(A){var e=this.decoderState.state,t=e.sound,i=e.expend,n=A?"cursor: not-allowed; color: gray; fill: gray; ":"cursor: default";null!=document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon")).setAttribute("style",A?"cursor: not-allowed; color: gray; fill: gray;":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon")).setAttribute("style",n),null!=document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon")).setAttribute("style",n),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",n),null!=document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon"))&&document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon")).setAttribute("style",n),this.allowZoom||null!=document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon")).setAttribute("style",n),document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon"))&&"none"!=document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).style.display&&document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).setAttribute("style",n);var a=document.getElementsByClassName("".concat(this.jSPlugin.id,"-select-quality-btn"));if(a.length)for(var o=0;o'+'')+'')+'',a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.rec,n=A.cloudRec,a=A.recordvideo,o=A.pantile,r=A.expend,s=A.zoom,g=A.talk,c=A.sound,l=qt.getGlobalState(),I=qt.getInstance(e.jSPlugin.id);window.recTimer&&Array.isArray(window.recTimer[e.jSPlugin.id])&&(window.recTimer[e.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[e.jSPlugin.id]=[]),t?(i||n?(e.Rec&&e.Rec.unSyncTimeLine(),e.jSPlugin.pause().then((function(){e.setDecoderState({play:!t}),e.setDisabled(t)}))):(e.jSPlugin.stop((function(){}),!0).then((function(){e.setDecoderState({play:!t}),e.setDisabled(t)})),s&&(e.setDecoderState({zoom:!1}),e.jSPlugin.Zoom.stopZoom(),e.jSPlugin.close3DZoom()),g&&(e.setDecoderState({talk:!1}),document.getElementById("".concat(e.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(e.jSPlugin.id,"-volume-column")).style.display="none"),e.jSPlugin.Talk.stopTalk(),l.talk&&qt.setGlobalState({talk:!1}),I.getState().talk&&I.setState({talk:!1}))),a&&e.setDecoderState({recordvideo:!1}),c&&(e.jSPlugin.closeSound(),e.setDecoderState({sound:!1}),I.setState({sound:!0}))):(i||n?(e.Rec&&e.Rec.syncTimeLine(),e.jSPlugin.resume().then((function(){e.setDisabled(t),e.setDecoderState({play:!t,expend:r})}))):e.jSPlugin.play().then((function(){e.setDisabled(t),e.setDecoderState({play:!t,expend:r})})),e.jSPlugin.use3DZoom&&e.resetMobileZoomStatus()),e.jSPlugin.use3DZoom?(e.setDecoderState({zoom:!1}),e.allowZoom=!1):e.allowZoom=i||n,o&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1})),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display="none"),e.setDecoderState({speed:!1})};break;case"sound":a.title=this.jSPlugin.i18n.t("BTN_SOUND"),a.id=A,a.domString=''+'')+'\n \n \n \n \n ')+"",a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.sound,n=A.talk,a=A.pantile;t&&!n&&(i?(e.jSPlugin.closeSound(),e.setDecoderState({sound:!1})):e.jSPlugin.openSound(),a&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1})))};break;case"recordvideo":if(o)break;a.title=this.jSPlugin.i18n.t("BTN_RECORDVIDEO"),a.id=A,a.domString='')+'',a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.recordvideo;t&&(i?(e.jSPlugin.stopSave(),e.setDecoderState({recordvideo:!1})):(e.jSPlugin.startSave("".concat((new Date).getTime())),e.setDecoderState({recordvideo:!0})))};break;case"capturePicture":a.title=this.jSPlugin.i18n.t("BTN_CAPTURE"),a.id=A,a.domString='')+'',a.onclick=function(){e.decoderState.state.play?e.jSPlugin.capturePicture("".concat((new Date).getTime()),(function(){}),e.jSPlugin.download):console.log("视频未播放,无法截图")};break;case"talk":if(o)break;a.title=this.jSPlugin.i18n.t("BTN_TALK"),a.id=A,a.domString='
bi?8:5,"px; position: absolute; left: ").concat(this.jSPlugin.width>bi?20:13,"px; top: ").concat(this.jSPlugin.width>bi?14:9,'px; border-radius: 50%; overflow:hidden;">')+'')+"
"+'')+'',this.jSPlugin.eventEmitter.on("volumeChange",(function(A){var t=A.data;document.getElementById("".concat(e.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(e.jSPlugin.id,"-volume-column")).style.height="".concat(100*t,"%"))})),a.onclick=function(){var A=e.decoderState.state,t=A.talk,i=A.sound,n=A.play,a=qt.getGlobalState(),o=qt.getInstance(e.jSPlugin.id);if(n)if(t){e.setDecoderState({talk:!1}),document.getElementById("".concat(e.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(e.jSPlugin.id,"-volume-column")).style.display="none"),e.jSPlugin.Talk.stopTalk();var r=Ft(e.themeData.footer.btnList,(function(A){return"sound"===A.iconId&&1===A.isrender&&1===A.defaultActive}))>-1;e.themeData&&r&&e.jSPlugin.openSound(),a.talk&&qt.setGlobalState({talk:!1}),o.getState().talk&&o.setState({talk:!1})}else{if(a.talk)return console.warn("当前已经有设备正在对讲"),void(e.jSPlugin.eventEmitter&&e.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:430005,target:e,msg:"当前已经有设备正在对讲"}));e.setDecoderState({talk:!0}),document.getElementById("".concat(e.jSPlugin.id,"-volume-column")).style.display="block",e.jSPlugin.Talk.startTalk((function(A){i&&!A&&(e.jSPlugin.closeSound(),e.setDecoderState({sound:!1})),qt.setGlobalState({talk:!0}),o.setState({talk:!0})}))}};break;case"zoom":if(o)break;a.title=this.jSPlugin.use3DZoom?this.jSPlugin.i18n.t("BTN_3D_ZOOM"):this.jSPlugin.i18n.t("BTN_ZOOM"),a.id=A,a.domString="
"+'\n \n \n \n \n '),a.onclick=function(){var A=e.decoderState.state,t=A.zoom,i=A.play,n=A.rec,a=A.cloudRec;if(e.jSPlugin.use3DZoom){if(!i)return!1;t?e.jSPlugin.close3DZoom():e.jSPlugin.enable3DZoom()}else{if(e.zoomDisable||!n&&!a&&!i)return!1;t?e.jSPlugin.Zoom.stopZoom():e.jSPlugin.Zoom.startZoom()}e.setDecoderState({zoom:!t})};break;case"pantile":if(o)break;a.title=this.jSPlugin.i18n.t("BTN_PTZ"),a.id=A,a.domString='')+'',a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.pantile,n=A.expend;if(t)if(i)e.Ptz.hide(),e.setDecoderState({pantile:!1});else{if(e.isMobile&&!n)return console.log("移动端,非全屏状态不展示云台"),!1;e.Ptz.show(),e.setDecoderState({pantile:!0})}};break;case"expend":a.title=this.jSPlugin.i18n.t("BTN_EXPEND"),a.id=A,a.domString='')+''+'\n '),a.onclick=function(){var A=e.decoderState.state,t=A.expend,i=A.pantile;if(A.play)if(t)if(e.isMobile){var n=e._extendHeadeTimeLinrHight(!1,!0),a=document.getElementById("".concat(e.jSPlugin.id,"-headControl"));document.getElementById("".concat(e.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(e.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-32px"),a&&(a.style.position="relative"),document.getElementById("".concat(e.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(e.jSPlugin.id,"-select-speed")).style.background="#ffffff"),function(A,e,t){var i="";i+="width:"+e+"px;",i+="height:"+t+"px;",i+="-webkit-transform: none; transform: none;",i+="-webkit-transform-origin: 0 0;",i+="transform-origin: 0 0;",A.style.cssText=i}(document.getElementById("".concat(e.jSPlugin.id,"-wrap")),e.jSPlugin.width,e.jSPlugin.height),console.log("[mobile cancelMobileFullScreen]"),document.getElementById("".concat(e.jSPlugin.id,"-wrap")).classList.remove("ezuikit-player-wrap-mobile-fullscreen"),e.jSPlugin.jSPlugin.JS_Resize(e.jSPlugin.width,e.jSPlugin.height-n),i&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1})),e.jSPlugin.fullScreenWidth=e.jSPlugin.width,e.jSPlugin.fullScreenHeight=e.jSPlugin.height,e.jSPlugin.Zoom&&e.jSPlugin.Zoom.handleFullscreen&&e.jSPlugin.Zoom.handleFullscreen(!t,e.jSPlugin.width,e.jSPlugin.height),document.getElementById("".concat(e.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(e.jSPlugin.id,"-pantile-icon")).style.display="none"),document.getElementById("".concat(e.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.height=45*e.jSPlugin.videoLevelList.length+"px"),e.setDecoderState({expend:!1})}else e.jSPlugin.exitFullscreen();else if(e.isMobile){var o=e._extendHeadeTimeLinrHight(!1,!0);p(document.getElementById("".concat(e.jSPlugin.id,"-wrap"))),document.getElementById("".concat(e.jSPlugin.id,"-wrap")).classList.add("ezuikit-player-wrap-mobile-fullscreen"),console.log("[mobile requestMobileFullScreen]");var r=document.documentElement.clientWidth,s=document.documentElement.clientHeight;document.getElementById("".concat(e.jSPlugin.id))&&(document.getElementById("".concat(e.jSPlugin.id)).style["backface-visibility"]="hidden"),document.getElementById("".concat(e.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(e.jSPlugin.id,"-select-speed")).style.background="none"),e.jSPlugin.jSPlugin.JS_Resize(s,r-o,!0),e.jSPlugin.fullScreenWidth=s,e.jSPlugin.fullScreenHeight=r-o,e.jSPlugin.Zoom&&e.jSPlugin.Zoom.handleFullscreen&&e.jSPlugin.Zoom.handleFullscreen(!t,s,r-o),document.getElementById("".concat(e.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(e.jSPlugin.id,"-pantile-icon")).style.display="block"),document.getElementById("".concat(e.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.bottom=0,document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.height="100%"),e.setDecoderState({expend:!0})}else e.jSPlugin.fullscreen()};break;case"webExpend":if(o)break;a.title=this.jSPlugin.i18n.t("BTN_WEBEXPEND"),a.id=A,a.domString='')+''+'",a.onclick=function(){var A=e.decoderState.state,t=A.webExpend;if(A.expend)return console.log("正在全局全屏"),!1;window.recTimer&&Array.isArray(window.recTimer[e.jSPlugin.id])&&(window.recTimer[e.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[e.jSPlugin.id]=[]),t?e.jSPlugin.exitBrowserFullscreen():e.jSPlugin.browserFullscreen(),e.jSPlugin.Theme.Rec&&setTimeout((function(){e.jSPlugin.Theme.Rec.recAutoSize()}),100)};break;case"hd":if(o)break;var r="".concat(this.jSPlugin.id,"-select-quality"),s="".concat(r,"-item");a.title=this.jSPlugin.i18n.t("BTN_HD"),a.id=A;var g="",c="";return this.jSPlugin.videoLevelList.findIndex((function(A){return A.level==e.jSPlugin.videoLevel}))>-1?this.jSPlugin.videoLevelList.map((function(A){g+='
  • ').concat(e.jSPlugin.i18n.t(Si[A.level]),"
  • "),A.level==e.jSPlugin.videoLevel&&(c+=e._videoLevelIcon(e.jSPlugin.id,r,e.jSPlugin.width,bi,A))})):this.jSPlugin.videoLevelList.map((function(A,t){0===t&&(c+=e._videoLevelIcon(e.jSPlugin.id,r,e.jSPlugin.width,bi,A)),g+='
  • ').concat(e.jSPlugin.i18n.t(Si[A.level]),"
  • ")})),g+='
  • ').concat(this.jSPlugin.i18n.t("SPEED_CANCEL"),"
  • "),c+=''),a.domString='\n \n ').concat(c,"\n "),a.onclick=function(A){var t=e.decoderState.state,i=t.expend,n=t.recordvideo,a=t.play,o=t.zoom,s=t.pantile,g=t.sound,c=t.talk;if(A.stopPropagation(),a){var l=A.target.id,I=A.target.getAttribute("data-type");if(0===l.indexOf(r)){if(e.jSPlugin.videoLevel+""!==I){if(c){var C=qt.getGlobalState(),d=qt.getInstance(e.jSPlugin.id);e.setDecoderState({talk:!1}),document.getElementById("".concat(e.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(e.jSPlugin.id,"-volume-column")).style.display="none"),e.jSPlugin.Talk.stopTalk(),C.talk&&qt.setGlobalState({talk:!1}),d.getState().talk&&d.setState({talk:!1})}var h=e.jSPlugin.videoLevelList.find((function(A){return A.level+""===I}));!h||h.streamTypeIn===e.jSPlugin.streamTypeIn&&h.level+""==e.jSPlugin.videoLevel+""||(e.jSPlugin.changeVideoLevel(h).then((function(A){g&&e.jSPlugin.openSound()})),o&&(e.jSPlugin.Zoom.stopZoom(),e.setDecoderState({zoom:!1})))}e.resetMobileZoomStatus(),n&&e.setDecoderState({recordvideo:!1})}e.showHD=!e.showHD,document.getElementById("".concat(e.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.display="none"===document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.display?"block":"none",e.isMobile&&(document.getElementById("".concat(e.jSPlugin.id,"-select-hd-mask")).style.display="none"===document.getElementById("".concat(e.jSPlugin.id,"-select-hd-mask")).style.display?"block":"none"),e.themeData.autoFocus>0&&("none"===document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.display?e.startAutoFocus():e.stopAutoFocus())),e.isMobile&&i&&e.showHD?document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).className="hd speed-select mobile expend":document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).className=e.isMobile?"hd speed-select mobile":"speed-select",s&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1}))}},a;case"speed":if(o)break;a.title=this.jSPlugin.i18n.t("BTN_SPEED"),a.id=A,a.domString='"+'\n
    ').concat(1===this.nextRate?this.jSPlugin.i18n.t("SPEED"):"".concat(this.nextRate).concat(this.jSPlugin.i18n.t("SPEED_RATE")).replace("3","0.5"),"
    \n ")+'')+"
    ",a.onclick=function(A){var t=e.decoderState.state,i=t.speed,n=t.expend,a=t.play;if(A.stopPropagation(),!a)return!1;if(!i&&e.isMobile&&(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).className=n?"speed speed-select mobile expend":"speed speed-select mobile"),e.isMobile&&(n?(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.bottom="constant(safe-area-inset-bottom)",document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.bottom="env(safe-area-inset-bottom)"):(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)")),e.nextRate=1,A.target.id)switch(A.target.id){case"".concat(e.jSPlugin.id,"-select-speed1"):e.nextRate=1,e.jSPlugin.jSPlugin.JS_Speed(e.nextRate),e.changeRecSpeed(1),e.jSPlugin.speed=1,e.setDecoderState({speed:!i});break;case"".concat(e.jSPlugin.id,"-select-speed2"):e.nextRate=2,e.jSPlugin.jSPlugin.JS_Speed(e.nextRate),e.changeRecSpeed(2),e.jSPlugin.speed=2,e.setDecoderState({speed:!i});break;case"".concat(e.jSPlugin.id,"-select-speed4"):e.nextRate=4,e.jSPlugin.jSPlugin.JS_Speed(e.nextRate),e.changeRecSpeed(4),e.jSPlugin.speed=4,e.setDecoderState({speed:!i});break;case"".concat(e.jSPlugin.id,"-select-speed05"):e.nextRate=3,e.jSPlugin.jSPlugin.JS_Speed(e.nextRate),e.changeRecSpeed(.5),e.jSPlugin.speed=.5,e.setDecoderState({speed:!i});break;default:e.isMobile?e.setDecoderState({speed:!i}):e.setDecoderState({speed:!0})}e.isMobile&&A.target.id==="".concat(e.jSPlugin.id,"-speed-text")?document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display="block":document.getElementById("".concat(e.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display="none"===document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display?"block":"none"),e.setDecoderState({speed:!i}),e.themeData.autoFocus>0&&("none"===document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display?e.startAutoFocus():e.stopAutoFocus())};break;case"deviceName":a.title=this.jSPlugin.i18n.t("DEVICE_NAME"),a.id=A,a.domString="".concat(this.jSPlugin.i18n.t("DEVICE_NAME"),""),a.onclick=function(){};break;case"deviceID":a.title=this.jSPlugin.i18n.t("DEVICE_ID"),a.id=A,a.domString="".concat(this.jSPlugin.i18n.t("DEVICE_ID"),""),a.onclick=function(){};break;case"cloudRec":if(this.jSPlugin._isCloudRecord)break;a.title=this.jSPlugin.i18n.t("BTN_CLOUDREC"),a.id=A,a.domString='\n \n \n\t\n\t\n\t\n \n \n '),a.onclick=function(){var A=e.decoderState.state.sound;e.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),e.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloud"}}),e.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){var A=Q("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec("".concat(A.slice(0,4),"-").concat(A.slice(4,6),"-").concat(A.slice(6,8))),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e.jSPlugin.Zoom.stopZoom(),e.jSPlugin.close3DZoom()),e.Rec&&e.Rec.syncTimeLine()}),!1).then((function(){A&&e.jSPlugin.openSound()}))};break;case"cloudRecord":if(!this.jSPlugin._isCloudRecord)break;a.title=this.jSPlugin.i18n.t("BTN_CLOUDRECORD"),a.id=A,a.domString=' \n\n\n\t\n\t\n\t\n\t'),a.onclick=function(){var A=e.decoderState.state.sound;e.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),e.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloudRecord"}}),e.jSPlugin.url.replace(/rec\??|cloud.rec\??/,"cloud.rec?busType=7"),e.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){e.jSPlugin._isCloudRecord&&e.changeTheme("pcRec");var A=Q("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec("".concat(A.slice(0,4),"-").concat(A.slice(4,6),"-").concat(A.slice(6,8))),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e.jSPlugin.Zoom.stopZoom(),e.jSPlugin.close3DZoom()),e.Rec&&e.Rec.syncTimeLine()}),!1).then((function(){A&&e.jSPlugin.openSound()}))};break;case"rec":a.title=this.jSPlugin.i18n.t("BTN_REC"),a.id=A,a.domString='\n \n \n \n\n\n\n \n \n '),a.onclick=function(){var A=e.decoderState.state.sound;e.setDecoderState({type:"rec",cloudRec:!1,rec:!0}),e.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"local"}}),e.jSPlugin.changePlayUrl({type:"rec"},(function(){e.jSPlugin._isCloudRecord&&e.changeTheme("pcRec");var A=Q("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec("".concat(A.slice(0,4),"-").concat(A.slice(4,6),"-").concat(A.slice(6,8))),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e.jSPlugin.Zoom.stopZoom(),e.jSPlugin.close3DZoom()),e.Rec&&e.Rec.syncTimeLine()}),!1).then((function(){A&&e.jSPlugin.openSound()}))}}return a}},{key:"_videoLevelIcon",value:function(A,e,t,i,n){return'\n i?48:32,"px;line-height: ").concat(t>i?48:30,'px;text-align: center;">\n ').concat(this.jSPlugin.i18n.t(Si[n.level]),"\n \n ")}},{key:"_fullScreenChangeEvent",value:function(){var A=this,e=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),t=document.getElementById("".concat(this.jSPlugin.id)),i=this;this._fullscreenchange=function(n){var a=i.decoderState.state.zoom;n.target===t?A.jSPlugin.isCurrentFullscreen?i.setDecoderState({expend:!0,webExpend:!1}):(i.setDecoderState({expend:!1,webExpend:!1}),a&&i.jSPlugin.use3DZoom&&i.jSPlugin.enable3DZoom()):n.target===e&&(A.jSPlugin.isCurrentBrowserFullscreen?i.setDecoderState({webExpend:!0}):i.setDecoderState({webExpend:!1})),i.Rec&&window.randomNum==i.jSPlugin.randomNum&&setTimeout((function(){i.Rec.recAutoSize((function(){if(i.jSPlugin.Zoom.currentScale>1){var A=i.jSPlugin.Zoom.currentScale;i.jSPlugin.Zoom.stopZoom(),setTimeout((function(){i.jSPlugin.Zoom.startZoom(),i.jSPlugin.Zoom.currentScale=A,i.jSPlugin.Zoom.doScale(A)}),200)}}))}),100),document.getElementById("".concat(i.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(i.jSPlugin.id,"-hdSelect")).style.display="none"),document.getElementById("".concat(i.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(i.jSPlugin.id,"-speedSelect")).style.display="none"),i.isMobile&&(document.getElementById("".concat(i.jSPlugin.id,"-select-hd-mask"))&&(document.getElementById("".concat(i.jSPlugin.id,"-select-hd-mask")).style.display="none"),document.getElementById("".concat(i.jSPlugin.id,"-select-mask"))&&(document.getElementById("".concat(i.jSPlugin.id,"-select-mask")).style.display="none")),i.themeData.autoFocus>0&&i.startAutoFocus(),A.setDecoderState({speed:!1})},J.isEnabled&&J.on("change",this._fullscreenchange)}},{key:"changeRecSpeed",value:function(A){var e=this,t=function(A){if(!document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")))return!1;document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[0].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[0].className.replace("active","default"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[1].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[1].className.replace("active","default"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[2].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[2].className.replace("active","default"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[3].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[3].className.replace("active","default"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[A].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[A].className.replace("default","active")},i="1";switch(A){case 1:t(2),i=this.jSPlugin.i18n.t("SPEED");break;case 2:t(1),i="".concat(A).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case 4:t(0),i="".concat(A).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case.5:t(3),i="".concat(A).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;default:t(2),i="".concat(A).concat(this.jSPlugin.i18n.t("SPEED_RATE"))}document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&(document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).innerHTML=i)}},{key:"initThemeData",value:function(){var A=this,e=this.themeData,t=e.header,i=e.footer,n=this.jSPlugin.id;if(this.header=Pt,this.footer=Nt,this.isNeedRenderHeader=Ft(t.btnList,(function(A){return A.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isMobile&&(this.isNeedRenderHeader=Ft(t.btnList,(function(A){return A.isrender>0&&"deviceID"===A.iconId||A.isrender>0&&"deviceName"===A.iconId}))>=0&&"miniRec"!=this.jSPlugin.id),this.isNeedRenderFooter=Ft(i.btnList,(function(A){return A.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isNeedRenderTimeLine=Ft(t.btnList,(function(A){return"cloudRec"===A.iconId&&1===A.isrender||"rec"===A.iconId&&1===A.isrender}))>=0&&!this.jSPlugin.disabledTimeLine&&"miniRec"!=this.jSPlugin.id,["date-switch-container-wrap","rec-type-container-wrap","mobile-rec-wrap","mobile-ez-ptz-container"].forEach((function(A,e){document.getElementById(A)&&document.getElementById(A).parentElement.removeChild(document.getElementById(A))})),this.isNeedRenderHeader){if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="
    ");else{var a=document.createElement("div");a.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),a.setAttribute("class","header-controls"),a.innerHTML="
    ");var o={height:this.jSPlugin.width>bi?"48px":"32px","line-height":this.jSPlugin.width>bi?"48px":"32px",display:"flex","justify-content":"space-between",top:0,"z-index":1,background:"#000000",color:"#FFFFFF",width:"100%"};a.style=vi(o),document.getElementById("".concat(n,"-wrap")).insertBefore(a,document.getElementById(n))}var s=document.getElementById("".concat(n,"-wrap")).classList.contains("ezuikit-player-wrap-mobile-fullscreen");!document.getElementById("".concat(this.jSPlugin.id,"-headControl"))||this.jSPlugin._isCurrentBrowserFullscreen||s||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1,!1),!0)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))),!document.getElementById("".concat(this.jSPlugin.id,"-headControl"))||this.jSPlugin._isCurrentBrowserFullscreen||isMobileFullscreen||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1,!1),!0);if(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(this.jSPlugin.width>bi?48:32,"px"),document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='"));else{var g=document.createElement("div");g.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),g.setAttribute("class","ez-iframe-footer-container");var c={"min-height":this.jSPlugin.width>bi?"48px":"32px","max-height":this.jSPlugin.width>bi?"96px":"80px",position:"relative","margin-top":this.jSPlugin.width>bi?"-48px":"-32px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%"};g.style=vi(c),g.innerHTML='"),x(g,document.getElementById(n))}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"))){document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=t.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=t.color;var l,I=r(t.btnList);try{for(I.s();!(l=I.n()).done;){var C=l.value;if(C.isrender)try{this.renderHeader(C.iconId,C.part)}catch(A){}}}catch(A){I.e(A)}finally{I.f()}}if(this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))){document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i.color;var d,h=r(i.btnList);try{for(h.s();!(d=h.n()).done;){var B=d.value;if(B.isrender)try{this.renderFooter(B.iconId,B.part)}catch(A){}}}catch(A){h.e(A)}finally{h.f()}}if(this.isNeedRenderTimeLine)if(this.isMobile)document.getElementById("".concat(this.jSPlugin.id,"-headControl-right"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).style.display="none"),this.Rec=new ti(this.jSPlugin,this.changeRecSpeed,this.resetMobileZoomStatus);else{this.Rec?this.Rec.recInit():(this.jSPlugin.decoderState=this.decoderState,this.jSPlugin.setDecoderState=this.setDecoderState,this.Rec=new zt(this.jSPlugin));var u=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(u)}),50)}if(Ft(this.themeData.footer.btnList,(function(A){return"pantile"===A.iconId&&1===A.isrender}))>=0&&!this.jSPlugin.disabledPTZ&&(this.isMobile&&(this.MobilePtz=new Ci(this.jSPlugin)),this.Ptz=new ii(this.jSPlugin)),this.themeData.poster){this.jSPlugin.poster=this.themeData.poster;var E=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(E),A.jSPlugin.setPoster(A.themeData.poster))}),50)}this.inited=!0,this.jSPlugin.deviceInfo&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).innerHTML=this.jSPlugin.deviceInfo.deviceName||""),document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).innerHTML=m(this.jSPlugin.url).deviceSerial||"")),this.renderThemeData()}},{key:"resetMobileZoomStatus",value:function(){if(this.isMobile){var A=document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"));A&&A.style&&"none"!=A.style.display&&(A.style.display="none"),this.jSPlugin.jSPlugin.Zoom&&this.jSPlugin.jSPlugin.Zoom.resetZoom()}}},{key:"webExpend",value:function(){var A=this.decoderState.state;A.webExpend;var e=A.expend;return!!A.play&&(e?(console.log("正在全局全屏"),!1):void this.jSPlugin.browserFullscreen())}},{key:"expend",value:function(){var A=this.decoderState.state,e=A.webExpend;return!!A.play&&(e?(console.log("正在网站全屏"),!1):void(this.isMobile?(p(document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.documentElement.clientWidth,document.documentElement.clientHeight,document.getElementById("".concat(this.jSPlugin.id)).style["backface-visibility"]="hidden"):this.jSPlugin.fullscreen()))}},{key:"_extendHeadeTimeLinrHight",value:function(A,e){var t=0,i=0,n=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));n&&!A&&(t=parseInt(getComputedStyle(n).height,10));var a=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"));return a&&!e&&(i=parseInt(window.getComputedStyle(a).height,10)),t+i}},{key:"disabledFECBtn",value:function(){var A=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(this.jSPlugin.use3DZoom?this.jSPlugin.close3DZoom():this.jSPlugin.Zoom.stopZoom(),this.setDecoderState({zoom:!1}),e){var t,i=r(A);try{for(i.s();!(t=i.n()).done;){var n=t.value,a=e.querySelector("#".concat(n));a&&(a.style.display="none")}}catch(A){i.e(A)}finally{i.f()}}}},{key:"resumeFECBtn",value:function(){var A=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(e){var t,i=r(A);try{for(i.s();!(t=i.n()).done;){var n=t.value,a=e.querySelector("#".concat(n));a&&(a.style.display="")}}catch(A){i.e(A)}finally{i.f()}}}},{key:"destroy",value:function(){var A=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));A&&(A.innerHTML="");var e=document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"));this._removeElement(e);var t=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"));this._removeElement(t);var i=document.getElementById("mobile-ez-ptz-container");this._removeElement(i);var n=document.getElementById("date-switch-container-wrap");this._removeElement(n);var a=document.getElementById("rec-type-container-wrap");this._removeElement(a);var o=document.getElementById("mobile-rec-wrap");this._removeElement(o),J.isEnabled&&this._fullscreenchange&&J.off("change",this._fullscreenchange)}},{key:"_removeElement",value:function(A){A&&A.parentNode&&A.parentNode.removeChild(A)}}])}(),Ri=function(){return o((function A(e){t(this,A),this.url=e.url||"",this.method=e.method||"POST",this.headers=e.headers||{},this.body=e.body||{},this.onBeforeUpload=e.onBeforeUpload||function(){},this.onUploadProgress=e.onUploadProgress||function(){},this.onUploadComplete=e.onUploadComplete||function(){},this.controller=new AbortController}),[{key:"upload",value:function(){var A=this;this.onBeforeUpload(this.body);var e={method:this.method,headers:this.headers,signal:this.controller.signal,body:this.body};fetch(this.url,e).then((function(A){return A.json()})).then((function(e){A.onUploadComplete({body:A.body,response:e})})).catch((function(A){"AbortError"===A.name?console.log("上传被取消"):console.error("Error:",A)})),e.body&&"FormData"==e.body.constructor.name&&"signal"in e&&e.signal.addEventListener("progress",(function(e){e.lengthComputable&&A.onUploadProgress(c(c({},A.body),{},{progress:e.loaded/e.total}))}))}},{key:"cancel",value:function(){this.controller.abort()}}])}(),ki=function(){return o((function A(e,i){t(this,A),this.jSPlugin=e,this.isMobile=i,this.timer=null,this.initToastCustom()}),[{key:"initToastCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="none":this.randerToast()}},{key:"randerToast",value:function(){var A=this.jSPlugin.width,e=1;e=this.isMobile?A/375||1:A/1024||1;var t=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.createElement("div");i.style="display:none;position:absolute;top:0;width: 100%;align-items: center;justify-content: center;",i.id="".concat(this.jSPlugin.id,"-wrap-Toast-custom"),this.isMobile?i.innerHTML='
    \n
    \n '):i.innerHTML='
    \n
    \n '),t.insertBefore(i,document.getElementById(this.jSPlugin.id))}},{key:"initToastContent",value:function(A){var e=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;console.log("content----------------",A),this.timer=null,document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?(document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom-content")).innerText=A||"",this.timer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-wrap"))&&document.getElementById("".concat(e.jSPlugin.id,"-wrap-Toast-custom"))&&document.getElementById("".concat(e.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(e.jSPlugin.id,"-wrap-Toast-custom")))}),t)):(this.randerToast(),this.initToastContent(A))}}])}(),Pi=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},r="";o=Object.assign(o,a);var s=new Headers;Object.keys(o).map((function(A){s.append(A,o[A])})),o=s,Object.keys(Object.assign({},t)).forEach((function(A){var e=t[A];"string"==typeof t[A]&&(e=t[A].replace("%","%25")),void 0!==t[A]&&(r+="&".concat(A,"=").concat(encodeURIComponent(e)))})),r.length>0&&(r=-1!==["GET","PUT","DELETE"].indexOf(e.toUpperCase())?"?".concat(r.slice(1)):r.slice(1));var g=A+(-1!==["GET","PUT","DELETE"].indexOf(e.toUpperCase())?r:""),c={headers:o,method:e};"POST"===e&&(c.body=r),"POST"===e&&a&&"application/json"===a["Content-Type"]&&(c.body=JSON.stringify(t)),"GET"===e&&(-1===g.indexOf("?")?g+="?_r=".concat(Math.random()):g+="&_r=".concat(Math.random())),fetch(g,c).then((function(A){var e=A.headers.get("content-type");return e&&-1!==e.indexOf("application/json")?A.json():A.text()})).then((function(A){i&&i(A)})).catch((function(A){n&&n(A)}))},Ni=function(A,e,t){var i=new FormData;i.append("deviceSerial",m(A.url).deviceSerial),i.append("cmd","open"),fetch("".concat(domain,"/api/v3/device/acs/remote/door?accessToken=").concat(A.accessToken||A.token.deviceToken.globalAll),{method:"POST",body:i}).then((function(A){return A.json()})).then((function(A){console.log("get theme data",A),e(A)})).catch((function(A){t(A)}))},Ti=function(A,e,t){var i={accessToken:A.accessToken||A.token.httpToken.url,pageStart:0,pageSize:4,default:!0,voiceName:"轻应用语音文件"},n="".concat(A.env.domain,"/api/lapp/voice/query");Pi(n,"POST",i,(function(A){console.log(A),e(A)}),(function(A){console.log(A),t(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},Mi=function(A,e,t,i){var n="".concat(A.env.domain,"/api/lapp/voice/send"),a=new FormData;a.append("deviceSerial",m(A.url).deviceSerial),a.append("accessToken",A.accessToken||A.token.deviceToken.video),a.append("channelNo",m(A.url).channelNo||1),a.append("fileUrl",e),fetch(n,{method:"POST",body:a}).then((function(A){return A.json()})).then((function(A){!function(A){console.log(A),t(A)}(A)})).catch((function(A){var e;e=A,console.log(e),i(e)}))},Li=function(){return o((function A(e,i){t(this,A),this.jSPlugin=e,this.videoWidth=e.width,this.switchFooter=i,this.sendLoadingStats=!1,this.toastCustom=new ki(e,!1),this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.initQuickReply()}),[{key:"initQuickReply",value:function(){document.getElementById("pc-quickReply-back")||this.renderQuickReply(),document.getElementById("pc-quickReply-back-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){var A=this,e=this.videoWidth/1024||1,t=document.createElement("div");t.style="width:100%;",t.innerHTML='
    \n
    \n
    \n \n 返回\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n 返回\n
    \n
    \n \n \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).appendChild(t),document.getElementById("pc-quickReply-back").onclick=function(){A.switchFooter("onBell")}}},{key:"matchQuickReplyBtn",value:function(){var A=this,e=this.videoWidth/1024||1,t=document.getElementById("pc-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,n){var a=document.createElement("div");a.id="pc-quickReply-back-item-".concat(n),a.style="margin: ".concat(8*e,"px 0 ").concat(8*e,"px ").concat(8*e,"px;cursor: pointer;\n padding: 0 ").concat(20*e,"px;min-height: ").concat(64*e,"px;width:calc(50% - ").concat(16*e,"px);\n display: inline-block;background: rgba(0,0,0,0.70);border-radius: 8px;text-align: center;\n box-sizing: border-box;font-size:").concat(24*e,"px;color: rgba(255,255,255,0.90);"),a.innerHTML='
    \n ').concat(i.voiceName,"\n
    "),a.onclick=function(){A.sendLoadingStats||(console.log("item:"+i),A.sendQuickReply(i,n))},t.appendChild(a)}))}},{key:"setBtnCheckLoading",value:function(A,e){var t=this.videoWidth/1024||1;if(e>-1){document.getElementById("pc-quickReply-back-item-".concat(e));var i=document.getElementById("pc-quickReply-back-item-box-".concat(e)),n=document.getElementById("pc-quickReply-name-".concat(e));if(1==A){var a=document.getElementById("pc-quickReply-icon-loading-".concat(e));a&&n&&i.removeChild(a)}else if(n){var o=document.createElement("span");o.id="pc-quickReply-icon-loading-".concat(e),o.style="vertical-align: middle;margin-right:".concat(16*t,"px;"),o.innerHTML=''),i.insertBefore(o,n)}}}},{key:"getQuickReplyList",value:function(){var A=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);Ti(this.jSPlugin,(function(e){if(e&&200==e.code){var t=e.data||[],i=[];e.data.forEach((function(A,e){i=A.voiceName.split("_"),t[e].voiceName=i[1]})),A.quickReplyList=t,setTimeout((function(){A.madeLoadingDom(2)}),500)}else A.madeLoadingDom(1)}),(function(e){console.log(e),A.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(A){var e=this,t=this.videoWidth/1024||1;if(0==A){if(document.getElementById("pc-quickReply-content").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-loading").style.display="block",!document.getElementById("pc-quickReply-loading-box")){var i=document.createElement("div");i.id="pc-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",i.innerHTML='
    \n \n
    \n
    加载中…
    '),document.getElementById("pc-quickReply-loading").appendChild(i)}}else if(1==A){if(document.getElementById("pc-quickReply-content").style.display="none",document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="block",!document.getElementById("pc-quickReply-loaderror-box")){var n=document.createElement("div");n.id="pc-quickReply-loaderror-box",n.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",n.innerHTML='
    快速回复加载失败
    \n
    重新加载
    '),document.getElementById("pc-quickReply-loaderror").appendChild(n),document.getElementById("pc-quickReply-loaderror-reload").onclick=function(){e.getQuickReplyList()}}}else document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(A,e){var t=this;this.sendLoadingStats=!0,this.setBtnCheckLoading(0,e);Mi(this.jSPlugin,A.fileUrl,(function(A){t.sendLoadingStats=!1,t.setBtnCheckLoading(1,e),A&&200==A.code?t.toastCustom.initToastContent("快捷回复成功"):t.toastCustom.initToastContent("快捷回复失败,请重试"),t.switchFooter("onBell")}),(function(A){console.log(A),t.sendLoadingStats=!1,t.setBtnCheckLoading(1,e),t.toastCustom.initToastContent("快捷回复失败,请重试"),t.switchFooter("onBell")}))}}])}(),Yi=function(){return o((function A(e,i){t(this,A),this.jSPlugin=e,this.videoWidth=e.width,this.switchFooter=i,this.toastCustom=new ki(e,!1),this.lockStatus=!1,this.initRemoteUnlock()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("pc-remoteUnlock-back")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var A=this,e=this.videoWidth/1024||1,t=document.createElement("div");t.style="width:100%;",t.id="pc-remoteUnlock-box",t.innerHTML='
    \n
    \n
    \n \n 返回\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n 返回\n
    \n
    \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).appendChild(t),document.getElementById("pc-remoteUnlock-back").onclick=function(){A.goback()},this.renderRemoteUnlockSlide()}},{key:"renderRemoteUnlockSlide",value:function(){var A=this.videoWidth/1024||1,e=document.getElementById("pc-remoteUnlock-content"),t=document.createElement("div");t.id="pc-remoteUnlock-content-slide",t.style="width: 100%;display: flex;justify-content: center;cursor: pointer;",t.innerHTML='
    \n
    \n
    右滑开锁
    \n
    \n \n \n \n \n \n \n \n \n \n
    \n
    '),e.appendChild(t),this.madeSlideEvent()}},{key:"getOffsetLeft",value:function(A){var e=0;do{e+=A.offsetLeft,A=A.parentNode}while(A.parentNode);return e}},{key:"madeSlideEvent",value:function(){var A=this.videoWidth/1024||1,e=document.getElementById("".concat(this.jSPlugin.id)),t=this.getOffsetLeft(e),i=document.getElementById("pc-remoteUnlock-slide-box"),n=document.getElementById("pc-remoteUnlock-slide-bgColor"),a=document.getElementById("pc-remoteUnlock-slide-tips"),o=document.getElementById("pc-remoteUnlock-slide-ball"),r=this;o.onmousedown=function(e){var s=(e=e||window.event).offsetX;o.style.transition="",n.style.transition="",document.onmouseup=function(){console.log("--------------onmouseup"),r.lockStatus||(n.style.width="0px",o.style.left=8*A+"px",o.style.transition="left 0.6s linear",n.style.transition="width 0.6s linear"),document.onmouseup=null,document.onmousemove=null},document.onmousemove=function(e){e=e||window.event;console.log("videoDom",t);var g=e.pageX-i.offsetLeft-s-t,c=i.clientWidth-o.clientWidth-8*A;g<=0&&(g=0),g>=c&&(g=c),o.style.left=g+"px",g!=c||r.lockStatus||r.lockStatus||(r.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",n.style.width=i.clientWidth+"px",n.style.backgroundColor="#598FFF",i.style.border="0",o.style.backgroundColor="#ffffff",a.textContent="正在开锁",o.onmousedown=null,document.onmousemove=null,r.sendRemoteUnlockApi())}}}},{key:"resetRemoteUnlockSlide",value:function(){var A=document.getElementById("pc-remoteUnlock-box"),e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock"));A&&e&&e.removeChild(A)}},{key:"sendRemoteUnlockApi",value:function(){var A=this;console.log("下发远程开锁");Ni(this.jSPlugin,(function(e){e&&200==e.code?A.toastCustom.initToastContent("开锁成功"):A.toastCustom.initToastContent("开锁失败,请重试"),A.goback()}),(function(e){console.log(e),A.toastCustom.initToastContent("开锁失败,请重试"),A.goback()}))}},{key:"goback",value:function(){this.switchFooter("onCall"),this.resetRemoteUnlockSlide()}}])}(),Gi={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#ffffff",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}};function Ui(A){var e=new Kt,t=new FormData;for(var i in A)t.append(i,A[i]);return e.fetch("/api/lapp/device/info",{method:"POST",body:t})}var Ji=function(A){var e="";return Object.keys(A).map((function(t,i){e+="".concat(t,":").concat(A[t]).concat(i1&&void 0!==arguments[1])||arguments[1],t=o.themeData,i=t.header,n=t.footer,a=null;if("onCall"==A){console.log("接听"),o.bellStatus="onCall",o.switchFooter("onCall"),n[o.bellStatus].btnList.map((function(A,e){A.isrender&&o.renderFooter(A.iconId,A),"mute"==A.iconId&&(a=A)})),i[o.bellStatus].btnList.map((function(A,e){A.isrender&&o.renderHeader(A.iconId,A)}));var r=document.getElementById("".concat(o.jSPlugin.id,"-header-onBell"));r&&r.parentElement.removeChild(r),1==o.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(o.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==o.themeData.customConfig.defaultMicro&&a?o.muteCommon(a):o.setDecoderState({mute:!1},a.backgroundColor),o.removeBellRing()}else console.log("响铃"),o.bellStatus="onBell",o.jSPlugin.Theme.changeTheme(o.themeData,e)})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.themeData=i,this.setDecoderState=n,this.decoderState=a,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.toastCustom=new ki(e,!1)}),[{key:"initBellRing",value:function(){var A=this,e=this.decoderState.state,t=e.play,i=e.isEditing;e.rejection;var n=this.videoWidth/1024;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var a=document.getElementById("bellring"),o=document.getElementById("bellring-audio");if(!a&&!o){if(this.jSPlugin.isNeedBellRing){var r=document.createElement("div");r.id="bellring",r.innerHTML='
    \n \n
    ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(r)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var s=(this.videoHeight-180*n)/2,g=document.createElement("div");g.id="bellring-icon",g.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(s,"px;display: flex;align-items: center;justify-content: center;"),g.innerHTML='
    \n
    \n \n icon/响铃\n \n \n \n \n \n
    \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(g),t&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var e=A.decoderState.state,t=e.isEditing,i=e.rejection;"onBell"!=A.bellStatus||i||(A.removeBellRing(),t||A.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"matchBtn",value:function(A,e){var t=this,i=this.themeData,n=i.header,a=i.footer,o=this.decoderState.state,r=o.mute,s=o.rejection,g={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===n[this.bellStatus].btnList.findIndex((function(e){return e.iconId===A}))?(g.color=a[this.bellStatus].color,g.backgroundColor=a[this.bellStatus].backgroundColor,g.activeColor=a[this.bellStatus].activeColor):(g.color=n[this.bellStatus].color,g.backgroundColor=n[this.bellStatus].backgroundColor,g.activeColor=n[this.bellStatus].activeColor);var c=this.videoWidth/6;this.videoWidth;var l=this.videoWidth/1024||1;switch(A){case"ringStatus":return g.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,g.id=A,g.domString='').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,""),g.onclick=function(){},g;case"deviceCategory":return g.title="设备名称",g.id=A,g.domString='').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称",""),g.onclick=function(){},g;case"callStatus":return g.title="通话中",g.id=A,g.domString='通话中'),g.onclick=function(){},g;case"deviceCategory":return g.title="设备名称",g.id=A,g.domString='').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称",""),g.onclick=function(){},g;case"rejection":return g.title="拒绝",g.id=A,g.domString='
    \n
    \n \n 拒绝\n \n \n \n \n \n
    \n
    拒绝
    \n
    '),g.onclick=function(){var A=t.decoderState.state,e=A.play,i=A.isEditing,n=A.rejection;if(i||n)return!1;console.log("拒绝"),e&&t.jSPlugin.stop(),t.removeBellRing(),t.setDecoderState({play:!1,rejection:!0}),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("rejection")},g;case"quickReply":return g.title="快捷回复",g.id=A,g.domString='
    \n
    \n \n 快捷回复\n \n \n \n \n \n
    \n
    快捷回复
    \n
    '),g.onclick=function(){if(t.decoderState.state.rejection)return!1;console.log("快捷回复"),t.switchFooter("quickReply"),t.quickReplyEle=new Li(t.jSPlugin,t.switchFooter)},g;case"answer":return g.title="接听",g.id=A,g.domString='
    \n
    \n \n 接听\n \n \n \n \n \n
    \n
    接听
    \n
    '),g.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(),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}),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("")),0==t.themeData.customConfig.defaultMicro&&(t.muteCommon(e),t.jSPlugin.openSound()),t.removeBellRing(),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.goback(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp")}),t.maxTalkTime)},g;case"remoteUnlock":return g.title="远程开锁",g.id=A,g.domString='
    \n
    \n \n 开锁\n \n \n \n \n \n
    \n
    远程开锁
    \n
    '),g.onclick=function(){var A=t.decoderState.state,e=A.isEditing,i=A.rejection;if(e||"onBell"==t.bellStatus||i)return!1;console.log("远程开锁"),t.switchFooter("remoteUnlock"),t.remoteUnlockEle=new Yi(t.jSPlugin,t.switchFooter)},g;case"mute":return g.title="静音",g.id=A,g.domString='
    \n
    \n \n 静音\n \n \n \n \n \n
    \n
    静音
    \n
    '),g.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())},g;case"hangUp":return g.title="挂断",g.id=A,g.domString='
    \n
    \n \n 挂断\n \n \n \n \n \n
    \n
    挂断
    \n
    '),g.onclick=function(){var A=t.decoderState.state,e=A.talk,i=A.play,n=A.sound;if(A.rejection)return!1;e&&(console.log("结束对讲"),t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk()),i&&(t.jSPlugin.stop(),t.setDecoderState({play:!i})),n&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),(i||e)&&(console.log("挂断"),t.removeBellRing(),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp"))},g;default:return g}}},{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.rejectionStatusDispose(),this.switchFooter("onBell"),"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("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(t.innerHTML="",t.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),e[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)})),n.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!1,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"));"onBell"==this.bellStatus?(t.innerHTML="",t.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),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:!1,type:2})}},{key:"renderHeader",value:function(A,e){var t=this,i=this.videoWidth/1024||1,n=this.matchBtn(A,e);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var a=document.createElement("span");a.innerHTML="".concat(n.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(a)}else{var o=document.createElement("div");o.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),o.style="max-width:50%;position:relative;",o.innerHTML='\n ').concat(n.domString,"\n "),o.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onclick(A)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(o)}}},{key:"renderFooter",value:function(A,e){var t=this,i=this.decoderState.state.mute;if(console.log("-------------renderFooter"),"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/6,o=document.createElement("div");o.className="theme-icon-item",this.jSPlugin.isWebConsole?o.style="padding:0 ".concat(.1*a,"px;"):o.style="padding:0 ".concat(.1*a,"px;cursor: pointer;"),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)});var r=this.videoWidth/597,s=document.createElement("span");s.className="icon-move left",s.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),s.onclick=function(){t.editIcon(n.id,"left","footer")},o.appendChild(s);var g=document.createElement("span");if(g.className="icon-move right",g.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),g.onclick=function(){t.editIcon(n.id,"right","footer")},o.appendChild(g),"answer"==A||"rejection"==A||"hangUp"==A);else{var c=document.createElement("span");c.className="icon-move close",c.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),c.onclick=function(){t.editIcon(n.id,"delete","footer")},o.appendChild(c)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(o):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).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={};switch(this.themeData&&(e=this.themeData.footer),A){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="none"),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")).style.display="flex";break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).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);break;case"quickReply":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none";break;case"remoteUnlock":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="flex"}}},{key:"initThemeData",value:function(){var A=this;console.log("-------------initThemeData");var e=this.decoderState.state.isEditing,t=this.themeData,i=t.header,n=t.footer,a=this.jSPlugin.id,o=this.videoWidth/1024;if(this.isNeedRenderHeader=Ft(i[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=Ft(n[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 r=document.createElement("div");r.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),r.setAttribute("class","header-controls"),r.innerHTML="
    "),console.log(this.jSPlugin.height);var s=.2*this.jSPlugin.height+"px",g={height:s,display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":"-"+s,"align-items":"center",background:"transparent linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)"};r.style=Ji(g),document.getElementById("".concat(a,"-wrap")).insertBefore(r,document.getElementById(a));var c=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(c)}),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")));var l=.3*this.jSPlugin.height;if(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(l,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n \n \n \n \n '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n \n \n \n \n '));else{var I=document.createElement("div");I.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),I.setAttribute("class","ez-iframe-footer-container");var C={"min-height":l+"px","max-height":l+"px",position:"relative","margin-top":"-"+l+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","background-image":"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.60) 100%)","font-size":24*o+"px"};I.style=Ji(C),I.innerHTML='\n \n \n \n \n '),x(I,document.getElementById(a))}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"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color,i[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=n[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n[this.bellStatus].color,n[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)}))),1==this.themeData.customConfig.bellPoster&&!e){this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var d=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(d),A.jSPlugin.setPoster(A.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),window.addEventListener("click",this.autoPlayRing)),this.inited=!0,this.getCallDeviceInfo()}},{key:"renderThemeData",value:function(){var A=this,e=this.decoderState.state.isEditing,t=this.themeData,i=t.header,n=t.footer;if(this.isNeedRenderHeader&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.setDecoderState(s({},e.iconId,A.decoderState.state[e.iconId]))}))),this.isNeedRenderFooter&&n)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=n[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=n[this.bellStatus].color.replace("-diy",""),n[this.bellStatus].btnList.map((function(t,i){if(t.isrender&&A.setDecoderState(s({},t.iconId,A.decoderState.state[t.iconId])),0==i&&!A.themeInited&&A.activeThemeStatus)var n=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(n),1!=A.themeData.customConfig.bellPoster||e?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&&!e?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)}},{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("----------editStart2");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("----------editEnd2");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;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"}),e.activeThemeStatusTxt="无效的模板id"):"111023"==A.meta.code?(e.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff"}),e.activeThemeStatusTxt="试用特权已到期"):(e.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff"}),e.activeThemeStatusTxt="模板未激活"),e.themeData=Gi,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){console.log("---------getCallDeviceInfo"),A.deviceInfoData=e.data,e.data.isEncrypt&&setTimeout((function(){A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),500),document.getElementById("header-".concat(A.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(A.bellStatus,"-deviceCategory")).innerText=""+e.data.deviceName)})).catch((function(e){20018!=e.code||A.jSPlugin.isWebConsole||A.userNoDevice(),console.log("获取设备信息失败",e)}))}},{key:"setHeaderText",value:function(A){var e=this.videoWidth/1024||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.deviceName||"",""))}}])}(),Ki=function(){function A(e,i){t(this,A),this.jSPlugin=e,this.heightPop=i||366,A._instanceStyle(),this.initPopupCustom()}return o(A,[{key:"initPopupCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom")).style.display="flex":this.randerPopup()}},{key:"randerPopup",value:function(){var A=this,e=document.documentElement.clientWidth/375||1,t=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.createElement("div");i.style="display:flex;",i.id="".concat(this.jSPlugin.id,"-wrap-popup-custom"),i.innerHTML='
    \n
    \n
    \n
    \n
    \n \n icon/close\n \n \n \n \n \n \n \n
    \n \n
    \n
    \n
    \n '),t.appendChild(i),document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom-mask")).onclick=function(){A.closePopupCustom()},document.getElementById("".concat(this.jSPlugin.id,"-popup-board-close")).onclick=function(){A.closePopupCustom()}}},{key:"closePopupCustom",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){})();var A=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),e=document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom"));A&&e&&A.removeChild(e)}},{key:"initPopupContent",value:function(A,e){document.getElementById("popup-board-title-content").innerText=A||"",e&&document.getElementById("".concat(this.jSPlugin.id,"-popup-board-content")).appendChild(e)}}],[{key:"_instanceStyle",value:function(){if(!A._STYLE){var e=document.documentElement.clientWidth/375||1;A._STYLE=document.createElement("style"),A._STYLE.innerHTML="@keyframes slideContentUp {0% {bottom: -".concat(366*e,"px;}\n 25% {bottom: -").concat(244*e,"px;}\n 50% {bottom: -").concat(122*e,"px;}\n 100% {bottom:0;}} .open-popup{animation:slideContentUp 0.3s 1 linear; -webkit-animation: slideContentUp 0.3s 1 linear;}"),document.getElementsByTagName("head")[0].appendChild(A._STYLE)}}}])}();s(Ki,"_STYLE",void 0);var Vi=function(){return o((function A(e,i,n){t(this,A),this.jSPlugin=e,this.videoWidth=n,this.switchFooter=i,this.toastCustom=new ki(e,!0),this.sendLoadingStats=!1,this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.popupCustom=new Ki(e,366),document.getElementById("mobile-quickReply-list")||(this.popupCustom.initPopupContent("快捷回复",this.renderQuickReply()),this.initQuickReply())}),[{key:"initQuickReply",value:function(){document.getElementById("mobile-quickReply-list-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){document.documentElement.clientWidth;var A=document.createElement("div");return A.style="width:100%;",A.id="mobile-quickReply-list",A.innerHTML='
    \n \n ',A}},{key:"matchQuickReplyBtn",value:function(){var A=this,e=this.videoWidth/375||1,t=document.getElementById("mobile-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,n){var a=document.createElement("div");a.id="mobile-quickReply-list-item-".concat(n),a.style="margin: ".concat(14*e,"px 0;\n padding: ").concat(12*e,"px ").concat(15*e,"px;min-height: ").concat(50*e,"px;width:100%;\n background: #ffffff;border-radius: ").concat(25*e,"px;display: flex;align-items: center;\n box-sizing: border-box;font-size:").concat(16*e,"px;color: #2c2c2c;"),a.innerHTML='\n \n icon/快捷回复播放\n \n \n \n \n \n ').concat(i.voiceName,""),a.onclick=function(){console.log("item:"+i),A.sendLoadingStats||(A.setBtnCheckStatus(n),A.sendQuickReply(i))},t.appendChild(a)}))}},{key:"setBtnCheckStatus",value:function(A){var e=this,t="";this.quickReplyList.forEach((function(i,n){t=document.getElementById("mobile-quickReply-list-item-".concat(n)),n==A?(t.style.background="#F4F6FC",t.style.color="#648FFC",e.setBtnCheckLoding(0,n)):(t.style.background="#ffffff",t.style.color="#2c2c2c")}))}},{key:"setBtnCheckLoding",value:function(A,e){console.log(e);var t=this.videoWidth/375||1;if(e>-1){var i=document.getElementById("mobile-quickReply-list-item-".concat(e)),n=document.getElementById("mobile-quickReply-name-".concat(e)),a=document.getElementById("mobile-quickReply-icon-".concat(e));if(1==A){if(document.getElementById("mobile-quickReply-icon-loading-".concat(e))&&n){var o=document.createElement("span");o.id="mobile-quickReply-icon-".concat(e),o.style="height:".concat(24*t,"px;"),o.innerHTML='\n \n icon/快捷回复播放\n \n \n \n \n \n '),i.insertBefore(o,n)}}else if(a&&n){i.removeChild(a);var r=document.createElement("span");r.id="mobile-quickReply-icon-loading-".concat(e),r.style="height:".concat(20*t,"px;width: ").concat(24*t,"px;"),r.innerHTML=''),i.insertBefore(r,n)}}}},{key:"getQuickReplyList",value:function(){var A=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);Ti(this.jSPlugin,(function(e){if(e&&200==e.code){var t=e.data||[],i=[];e.data.forEach((function(A,e){i=A.voiceName.split("_"),t[e].voiceName=i[1]})),A.quickReplyList=t,setTimeout((function(){A.madeLoadingDom(2)}),500)}else A.madeLoadingDom(1)}),(function(e){console.log(e),A.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(A){var e=this,t=this.videoWidth/375||1;if(0==A){if(document.getElementById("mobile-quickReply-content").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-loading").style.display="block",!document.getElementById("mobile-quickReply-loading-box")){var i=document.createElement("div");i.id="mobile-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: row;",i.innerHTML='
    \n \n
    \n
    正在加载,请稍候
    '),document.getElementById("mobile-quickReply-loading").appendChild(i)}}else if(1==A){if(document.getElementById("mobile-quickReply-content").style.display="none",document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="block",!document.getElementById("mobile-quickReply-loaderror-box")){var n=document.createElement("div");n.id="mobile-quickReply-loaderror-box",n.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",n.innerHTML='
    \n \n
    \n
    \n 加载失败 \n 点击重试\n
    '),document.getElementById("mobile-quickReply-loaderror").appendChild(n),document.getElementById("mobile-quickReply-loaderror-reload").onclick=function(){e.getQuickReplyList()}}}else document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(A){var e=this;this.sendLoadingStats=!0;Mi(this.jSPlugin,A.fileUrl,(function(A){e.sendLoadingStats=!1,A&&200==A.code?e.toastCustom.initToastContent("快捷回复成功"):e.toastCustom.initToastContent("快捷回复失败,请重试"),e.popupCustom.closePopupCustom()}),(function(A){console.log(A),e.sendLoadingStats=!1,e.toastCustom.initToastContent("快捷回复失败,请重试"),e.popupCustom.closePopupCustom()}))}},{key:"closeQuickReplyEle",value:function(){this.popupCustom.closePopupCustom()}}])}(),Oi=function(){return o((function A(e,i,n){t(this,A),this.jSPlugin=e,this.videoWidth=n,this.switchFooter=i,this.toastCustom=new ki(e,!0),this.lockStatus=!1,this.popupCustom=new Ki(e,265),this.popupCustom.initPopupContent("远程开锁",this.renderRemoteUnlock()),this.renderRemoteUnlockSlide()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("mobile-remoteUnlock-content")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var A=this.videoWidth/1024||1,e=document.createElement("div");return e.style="width:100%;",e.id="mobile-remoteUnlock-box",e.innerHTML='
    \n
    \n
    '),e}},{key:"renderRemoteUnlockSlide",value:function(){var A=this.videoWidth/375||1,e=document.getElementById("mobile-remoteUnlock-content"),t=document.createElement("div");t.id="mobile-remoteUnlock-content-slide",t.style="width: 100%;display: flex;justify-content: center;padding: 0 ".concat(15*A,"px"),t.innerHTML='
    \n
    \n
    右滑开锁
    \n
    \n \n icon/箭头向右\n \n \n \n \n \n \n
    \n
    '),e.appendChild(t),this.madeSlideEvent()}},{key:"madeSlideEvent",value:function(){var A=this.videoWidth/375||1,e=document.getElementById("mobile-remoteUnlock-slide-box"),t=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),n=document.getElementById("mobile-remoteUnlock-slide-ball"),a=this;n.ontouchstart=function(o){console.log("ontouchstart");var r=(o=o||window.event).touches[0].pageX;n.style.transition="",t.style.transition="",document.ontouchmove=function(o){var s=(o=o||window.event).touches[0].pageX-e.offsetLeft-r,g=e.clientWidth-n.clientWidth-8*A;s<=0&&(s=0),s>=g&&(s=g),n.style.left=s+"px",s!=g||a.lockStatus||(a.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",t.style.width=e.clientWidth+"px",t.style.backgroundColor="#598FFF",e.style.border="0",n.style.backgroundColor="#ffffff",i.textContent="正在开锁",i.style.color="#ffffff",n.ontouchstart=null,a.sendRemoteUnlockApi())},document.ontouchend=function(){a.lockStatus||(t.style.width="0px",n.style.left=8*A+"px",n.style.transition="left 0.6s linear",t.style.transition="width 0.6s linear"),document.ontouchend=null,document.ontouchmove=null}}}},{key:"resetRemoteUnlockSlide",value:function(){var A=this.videoWidth/1024||1;this.lockStatus=!1;var e=document.getElementById("mobile-remoteUnlock-slide-box"),t=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),n=document.getElementById("mobile-remoteUnlock-slide-ball");t.style.width="0px",n.style.left=8*A+"px",i.textContent="右滑开锁",i.style.color="#666666",document.getElementById("slide-ball-start").style.display="inline",document.getElementById("slide-ball-end").style.display="none",t.style.backgroundColor="#FFFFFF",e.style.border="1px solid rgba(255,255,255,1)",n.style.backgroundColor="#598FFF"}},{key:"sendRemoteUnlockApi",value:function(){var A=this;console.log("下发远程开锁");Ni(this.jSPlugin,(function(e){e&&200==e.code?A.toastCustom.initToastContent("开锁成功"):A.toastCustom.initToastContent("开锁失败,请重试"),A.popupCustom.closePopupCustom()}),(function(e){console.log(e),A.toastCustom.initToastContent("开锁失败,请重试"),A.popupCustom.closePopupCustom()}))}},{key:"closeRemoteUnlock",value:function(){this.popupCustom.closePopupCustom()}}])}(),ji={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000080",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}},Wi=function(A){var e="";return Object.keys(A).map((function(t,i){e+="".concat(t,":").concat(A[t]).concat(i1&&void 0!==arguments[1])||arguments[1],t=o.themeData,i=t.header,n=t.footer,a=null;if("onCall"==A){console.log("接听"),o.bellStatus="onCall",o.switchFooter("onCall"),n[o.bellStatus].btnList.map((function(A,e){A.isrender&&o.renderFooter(A.iconId,A),"mute"==A.iconId&&(a=A)})),i[o.bellStatus].btnList.map((function(A,e){A.isrender&&o.renderHeader(A.iconId,A)}));var r=document.getElementById("".concat(o.jSPlugin.id,"-header-onBell"));r&&r.parentElement.removeChild(r),1==o.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(o.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==o.themeData.customConfig.defaultMicro&&a?o.muteCommon(a):o.setDecoderState({mute:!1},a.backgroundColor),o.removeBellRing(),o.miniRecCloseClick()}else console.log("响铃"),o.bellStatus="onBell",o.jSPlugin.Theme.changeTheme(o.themeData,e)})),s(this,"muteCommon",(function(A){var e=o.decoderState.state,t=e.talk,i=e.sound;t?(console.log("结束对讲"),o.setDecoderState({talk:!1,mute:!0},A.backgroundColor),o.jSPlugin.Talk.stopTalk(),i||o.jSPlugin.openSound()):(o.setDecoderState({talk:!1,mute:!0},A.backgroundColor),i||o.jSPlugin.openSound())})),s(this,"autoPlayRing",(function(){console.log("autoPlayRing");var A=document.getElementById("bellring-audio");A&&(A.muted=!1,A.src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3",A.paused&&A.play()),o.checkIsAppleDevice()||!1?window.removeEventListener("touchstart",o.autoPlayRing):window.removeEventListener("click",o.autoPlayRing)})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.themeData=i,this.setDecoderState=n,this.decoderState=a,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.miniRecStatus="rec",this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.miniRecNum=0,this.toastCustom=new ki(e,!0)}),[{key:"initBellRing",value:function(){var A=this,e=this.decoderState.state,t=e.play,i=e.isEditing,n=this.videoWidth,a=n/375;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var o=document.getElementById("bellring"),r=document.getElementById("bellring-audio");if(!o&&!r){if(this.jSPlugin.isNeedBellRing){var s=document.createElement("div");s.id="bellring",s.innerHTML='
    \n \n
    ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var g=1.8*n,c=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(c=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*g+6);var l=c+(this.videoHeight-130*a)/2,I=document.createElement("div");I.id="bellring-icon",I.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(l,"px;display: flex;align-items: center;justify-content: center;"),I.innerHTML='
    \n
    \n \n icon/响铃\n \n \n \n \n \n
    \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(I),t&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var e=A.decoderState.state,t=e.isEditing,i=e.rejection;"onBell"!=A.bellStatus||i||(A.removeBellRing(),t||A.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"getMiniCallTimeUrl",value:function(){if(console.log("--------------getMiniCallTimeUrl"),-1!==this.jSPlugin.url.indexOf("hd.live")?this.recUrl=this.jSPlugin.url.replace("hd.live","rec"):this.recUrl=this.jSPlugin.url.replace("live","rec"),this.jSPlugin.callTime){var A=parseInt(this.jSPlugin.callTime),e=A+5e3,t=new Date(A-1e4).Format("yyyyMMddhhmmss"),i=new Date(e).Format("yyyyMMddhhmmss");this.recUrl="".concat(this.recUrl,"?begin=").concat(t,"&end=").concat(i),console.log("recurl="+this.recUrl)}}},{key:"initMiniRec",value:function(){var A=this,e=this,t=this.videoWidth,i=t/375,n=1.8*t,a=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(a=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*n+6);var o=a+this.videoHeight+10*i;if(console.log(a),document.getElementById("miniRecbox"))document.getElementById("miniRecbox")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")),document.getElementById("miniClose")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),this.initMiniRec();else{var r=document.createElement("div");r.id="miniRecbox",r.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;top: ".concat(o,"px;right: ").concat(9*i,"px;"),r.innerHTML='
    ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(r),this.getMiniCallTimeUrl();var s={domain:Mt};this.miniRecPlayer=new lE({id:"miniRec",width:160*i,height:90*i,template:"miniRec",url:this.recUrl,token:this.jSPlugin.token,handleError:function(t){console.log("小窗口handleError------------",t),t&&6701==t.retcode?(A.miniRecNum=A.miniRecNum+1,console.log("小窗口miniRecNum-----------------",A.miniRecNum),A.miniRecNum<5?e.miniRecPlayer.changePlayUrl({type:"miniRec"}):(console.log("小窗口------------------已播放5次,关闭小窗口"),e.miniRecCloseClick())):(console.log("小窗口------------------播放失败,关闭小窗口"),e.miniRecCloseClick())},env:this.jSPlugin.env||s});var g=document.createElement("div");g.id="miniClose",g.style="position: absolute;top: ".concat(o+8,"px;right: ").concat(16*i,"px;"),g.innerHTML='
    \n \n close\n \n \n \n \n \n \n \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(g),document.getElementById("miniClose-btn").onclick=function(){e.miniRecCloseClick()}}}},{key:"initMiniImageRec",value:function(){console.log("initMiniImageRec");var A=this.videoWidth/375,e=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(e=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+26);var t=e+this.videoHeight+10*A;if(document.getElementById("miniRecbox"))document.getElementById("miniRecbox").style.top=t+"px",document.getElementById("miniClose").style.top=t+8+"px";else{var i=document.createElement("div");i.id="miniRecbox",i.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;\n top: ".concat(t,"px;\n right: ").concat(9*A,"px;\n user-select: none;\n "),i.innerHTML='
    \n \n
    示意小窗位置
    \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(i);var n=document.createElement("div");n.id="miniClose",n.style="z-index: 4;position: absolute;top: ".concat(t+8,"px;right: ").concat(16*A,"px;"),n.innerHTML='
    \n \n close\n \n \n \n \n \n \n \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(n),document.getElementById("miniClose-btn").onclick=function(){}}}},{key:"miniRecCloseClick",value:function(){document.getElementById("miniRecbox")&&(console.log("---------------------miniRecCloseClick"),"rec"==this.miniRecStatus&&(this.miniRecPlayer&&this.miniRecPlayer.stop(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox"))))}},{key:"miniRecSwitchClick",value:function(){console.log("---------------小窗口切换");var A=this.decoderState.state.isEditing,e=this.videoWidth,t=e/375,i=1.8*e,n=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(n=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*i+6),console.log("headerHeight-------",n);var a=n+this.videoHeight+10*t;if(console.log("videoTop-------",a),"rec"==this.miniRecStatus){this.miniRecStatus="live",A?(document.getElementById("miniRec-embed").style.width=this.jSPlugin.width+"px",document.getElementById("miniRec-embed").style.height=this.jSPlugin.height+"px",document.getElementById("miniRec").style.width=this.jSPlugin.width+"px",document.getElementById("miniRec").style.height=this.jSPlugin.height+"px"):this.miniRecPlayer.reSize(this.jSPlugin.width,this.jSPlugin.height),this.jSPlugin.reSize(160*t,90*t);var o=this.videoHeight+10*t,r=.2*i-90*t-10*t;document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginTop=o+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft=e-160*t-9+"px",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="8px",document.getElementById("miniRecbox").style.top=n+"px",document.getElementById("miniRecbox").style.left="0",document.getElementById("miniRecbox").style.right="0",document.getElementById("miniRecbox").style.borderRadius="0px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=r+"px"}else console.log(this.jSPlugin.width),this.miniRecStatus="rec",A?(document.getElementById("miniRec-embed").style.width=160*t+"px",document.getElementById("miniRec-embed").style.height=90*t+"px",document.getElementById("miniRec").style.width=160*t+"px",document.getElementById("miniRec").style.height=90*t+"px"):this.miniRecPlayer.reSize(160*t,90*t),this.jSPlugin.reSize(this.videoWidth,this.videoHeight),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+NaN,document.getElementById("".concat(this.jSPlugin.id)).style.marginTop="0",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft="0",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="0px",document.getElementById("miniRecbox").style.top=a+"px",document.getElementById("miniRecbox").style.right="9px",document.getElementById("miniRecbox").style.left="auto",document.getElementById("miniRecbox").style.borderRadius="8px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=.2*i+"px"}},{key:"matchBtn",value:function(A,e){var t=this,i=this.themeData,n=i.header,a=i.footer,o=this.decoderState.state,r=o.mute,s=o.rejection;document.documentElement.clientHeight;var g=this.videoWidth/375,c=this.videoWidth/375||1,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===n[this.bellStatus].btnList.findIndex((function(e){return e.iconId===A}))?(l.color=a[this.bellStatus].color,l.backgroundColor=a[this.bellStatus].backgroundColor,l.activeColor=a[this.bellStatus].activeColor):(l.color=n[this.bellStatus].color,l.backgroundColor=n[this.bellStatus].backgroundColor,l.activeColor=n[this.bellStatus].activeColor);var I=this.videoWidth/4;switch(A){case"ringStatus":return l.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,l.id=A,l.domString='').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,""),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=A,l.domString='').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称",""),l.onclick=function(){},l;case"callStatus":return l.title="通话中",l.id=A,l.domString='通话中'),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=A,l.domString='').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称",""),l.onclick=function(){},l;case"rejection":return l.title="拒绝",l.id=A,l.domString='
    \n
    \n \n 拒绝\n \n \n \n \n \n
    \n
    拒绝
    \n
    '),l.onclick=function(){var A=t,e=t.decoderState.state,i=e.play,n=e.isEditing,a=e.rejection;if(n||a)return!1;console.log("拒绝"),i&&t.jSPlugin.stop(),t.removeBellRing(),t.setDecoderState({play:!1,rejection:!0}),A.miniRecCloseClick(),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("rejection")},l;case"quickReply":return l.title="快捷回复",l.id=A,l.domString='
    \n
    \n \n 快捷回复\n \n \n \n \n \n
    \n
    快捷回复
    \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 \n \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 \n \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 icon/静音\n \n \n \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 \n \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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \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
    \n
    \n
    加载中…
    \n
    \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 \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\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\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\t\n\t\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
    \n
    \n
    \n 视频正在存储中…\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
    \n \n
    \n 视频存储失败\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 \n
    \n
    ').concat(1===this.type?"编辑":"").concat(0===t?"图片存证":"视频存证",'
    \n
    \n
    \n ').concat(0===t?'
    \n

    图片已取证,请填写存证信息:

    \n
    \n
    '):'
    \n \n
    \n \n
    00:00:00
    \n
    \n \n
    \n
    \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
    \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
    \n \n \n \n \n \n \n \n \n \n ').concat(o||"-",'\n
    \n
    \n \n \n \n \n
    \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
    \n
    \n ').concat(n.eventType,"\n
    \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
    \n
    \n
    \n 视频正在存储中…\n
    \n '):4===n.taskStatus?document.getElementById("".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId)).innerHTML='\n
    \n
    \n \n
    \n 视频存储失败\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.size0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,i=this;i.listLoading=!0,0===e?i.initRender(e):document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="flex";var n=function(e){new An({type:"error",content:e.meta&&e.meta.message||"列表获取失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40}),i.renderList({})};i.inspectRecordId?function(A,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,n=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,o={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:e,pageStart:t,pageSize:i},r="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/event/page");Pi(r,"GET",o,(function(A){n&&n(A)}),(function(A){a&&a(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(i.jSPlugin,i.inspectRecordId,e,t,(function(e){i.listLoading=!1,document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",e.meta&&200===e.meta.code?i.renderList(e.data||{}):n(e)}),(function(e){i.listLoading=!1,document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",n(e)})):(i.listLoading=!1,document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",i.renderList({}))}},{key:"disableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).setAttribute("disabled","disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).setAttribute("disabled","disabled")}},{key:"enableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).removeAttribute("disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).removeAttribute("disabled")}}])}(),ln=function(){return o((function A(e,i,n,a,o){var r=this;t(this,A),s(this,"createLocationControl",(function(){var A=r;function e(){this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT,this.defaultOffset=new BMapGL.Size(40,105)}return e.prototype=new BMapGL.Control,e.prototype.initialize=function(e){var t=document.createElement("div");return t.style.cssText="width: 26px;height: 26px;display: flex;align-items: center;justify-content: center; box-shadow: 1px 2px 1px rgb(0 0 0 / 15%); background: #fff; cursor: pointer;",t.id="".concat(A.jSPlugin.id,"-location-btn"),t.innerHTML='\n \n ',t.onclick=function(e){setTimeout((function(){A.inspectMapWin.centerToTrack(18)}),100)},e.getContainer().appendChild(t),t},new e})),s(this,"initSwithcBtn",(function(){var A=document.createElement("div");A.id="".concat(r.jSPlugin.id,"-miniSwitch"),A.style="cursor: pointer;position: absolute; bottom: 106px; right: ".concat(r.jSPlugin.inspectVideoWidth+10,"px; z-index: 999;"),A.innerHTML="
    \n \n 大小窗切换\n \n \n \n \n \n
    '),document.getElementById("".concat(r.jSPlugin.id,"-wrap")).appendChild(A),document.getElementById("".concat(r.jSPlugin.id,"-miniSwitch-btn")).onclick=function(){!function(A,e,t){var i=!0,n=!0;if("function"!=typeof A)throw new TypeError("Expected a function");return dA(t)&&(i="leading"in t?!!t.leading:i,n="trailing"in t?!!t.trailing:n),vt(A,e,{leading:i,maxWait:e,trailing:n})}((function(){return r.miniRecSwitchClick()}),1e3)()}})),s(this,"initMiniWinToggleBtn",(function(){var A=.3333*r.videoWidth,e=.3333*r.videoHeight,t=document.createElement("div");t.id="".concat(r.jSPlugin.id,"-miniToggle"),t.style="cursor: pointer;position: absolute; bottom: ".concat(e/2+96-30,"px; right: ").concat(r.jSPlugin.inspectVideoWidth+A,"px; z-index: 999; height:60px; box-sizing: border-box; padding-top: 20px; text-align: center; width:20px; overflow: hidden; background: #000000; border-radius: 2px 0px 0px 2px; opacity: 0.7;"),t.innerHTML="
    \n \n \n \n \n
    '),document.getElementById("".concat(r.jSPlugin.id,"-wrap")).appendChild(t),document.getElementById("".concat(r.jSPlugin.id,"-miniToggle")).onclick=function(){r.miniWinToggleClick()}})),s(this,"init",(function(){r.initSwithcBtn(),r.initMiniWinToggleBtn()})),s(this,"setStyleListByIds",(function(A){A.map((function(A){var e=document.getElementById(A.id);e&&Object.keys(A.styleList).map((function(t){e.style[t]=A.styleList[t]}))}))})),this.jSPlugin=e,this.inspectMode=i,this.inspectMapWin=n,this.changeInspectMode=a,this.videoWidth=e.width,this.videoHeight=e.height,this.minWinStatus="open",this.decoderState=o,this.ZoomControl=new BMapGL.ZoomControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(40,50)}),this.LocationControl=this.createLocationControl(),this.NavigationControl3D=new BMapGL.NavigationControl3D({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(28,105)}),this.init()}),[{key:"miniWinToggleClick",value:function(){var A=.3333*this.jSPlugin.width;"open"===this.minWinStatus?(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:"0px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"inline-block"}}]),this.minWinStatus="close"):(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:A+"px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth+A,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"inline-block"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"none"}}]),this.minWinStatus="open")}},{key:"miniRecSwitchClick",value:function(){var A=this,e=.3333*this.jSPlugin.width,t=.3333*this.jSPlugin.height;"video"===this.inspectMode?(this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom(),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:this.jSPlugin.width+"px",height:this.jSPlugin.height+"px",marginBottom:"-40px"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:this.jSPlugin.height+"px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"absolute",zIndex:"100",bottom:"96px",right:"".concat(this.jSPlugin.inspectVideoWidth,"px"),overflow:"hidden"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(e,t),this.inspectMode="map",this.changeInspectMode("map"),this.inspectMapWin.map.addControl(this.NavigationControl3D),this.inspectMapWin.map.addControl(this.LocationControl),this.inspectMapWin.map.addControl(this.ZoomControl),this.inspectMapWin.map.addOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"none",width:"32px",height:"14px"}}]),setTimeout((function(){A.inspectMapWin.centerToTrack(18)}),100)):(this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:e+"px",height:t+"px",marginBottom:"0"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:"0px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"relative",zIndex:"0",bottom:"0",right:"0"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(this.jSPlugin.width,this.jSPlugin.height),this.inspectMode="video",this.changeInspectMode("video"),this.inspectMapWin.map.removeControl(this.ZoomControl),this.inspectMapWin.map.removeControl(this.NavigationControl3D),this.inspectMapWin.map.removeControl(this.LocationControl),this.inspectMapWin.map.removeOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"1px solid rgb(255, 255, 255)",width:"80px",height:"32px",color:"#fff","text-align":"center","line-height":"32px","font-size":"14px"}}]),setTimeout((function(){A.inspectMapWin.centerToTrack()}),100),this.jSPlugin.Zoom&&this.decoderState.state.play&&this.jSPlugin.Zoom.startZoom()),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-wrap"),styleList:{width:this.jSPlugin.width+this.jSPlugin.inspectVideoWidth+"px",height:this.jSPlugin.height+this.jSPlugin.inspectVideoHeight+"px"}}])}}])}(),In={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0,inspectInfo:{color:"#000000",backgroundColor:"#ffffff",activeColor:"#1890FF",btnList:[{btnKey:"inspectName",iconId:"inspectName",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectBeginTime",iconId:"inspectBeginTime",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectPerson",iconId:"inspectPerson",part:"right",defaultActive:0,isrender:1,color:"#262626"}]}},header:{color:"#2c2c2c",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"deviceName",iconId:"deviceName",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"inspectTime",iconId:"inspectTime",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"signalType",iconId:"signalType",part:"right",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"batteryStatus",iconId:"batteryStatus",part:"right",defaultActive:0,isrender:1,color:"#ffffff"}]},footer:{color:"#ffffff",backgroundColor:"#000000",activeColor:"blue",btnList:[{btnKey:"talk",iconId:"talk",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"},{btnKey:"sound",iconId:"sound",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"}]}},Cn=function(A){var e="";return Object.keys(A).map((function(t,i){e+="".concat(t,":").concat(A[t]).concat(i\n \n ':"".concat(A,""):null}},{key:"renderBatteryStatus",value:function(A){return A&&0!=A?'\n
    \n ').concat(A,'%\n
    \n
    \n
    \n \n \n \n
    \n '):null}},{key:"renderInspectTime",value:function(A){if(!A)return null;var e,t,i,n,a=A.split(" "),o=a[0].split("-"),r=a[1].split(":"),s=new Date(o[0],o[1]-1,o[2],r[0],r[1],r[2]),g=(new Date).getTime()-new Date(s).getTime();return'\n \n '.concat((e=g,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)),"\n ")}},{key:"matchBtn",value:function(A,e){var t=this,i=this.themeData,n=i.customConfig,a=i.header,o=i.footer,r=n.inspectInfo,s={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}},g=r.btnList.findIndex((function(e){return e.iconId===A}));switch(-1!==g?(s.color=r.color,s.backgroundColor=r.backgroundColor,s.activeColor=r.activeColor):-1!==(g=a.btnList.findIndex((function(e){return e.iconId===A})))?(s.color=a.color,s.backgroundColor=a.backgroundColor,s.activeColor=a.activeColor):(s.color=o.color,s.backgroundColor=o.backgroundColor,s.activeColor=o.activeColor),A){case"inspectName":return s.title="巡检名称",s.id=A,s.domString='巡检名称'),s.onclick=function(){},s;case"inspectBeginTime":return s.title="巡检开始时间",s.id=A,s.domString='巡检开始时间:-'),s.onclick=function(){},s;case"inspectPerson":return s.title="本地巡检员",s.id=A,s.domString='本地巡检员:-'),s.onclick=function(){},s;case"deviceName":return s.title="设备名称",s.id=A,s.domString='设备名称'),s.onclick=function(){},s;case"inspectTime":return s.title="巡检时长",s.id=A,s.domString='巡检时长:-'),s.onclick=function(){},s;case"signalType":return s.title="信号类型",s.id=A,s.domString=''),s.onclick=function(){},s;case"batteryStatus":return s.title="设备电量",s.id=A,s.domString=''),s.onclick=function(){},s;case"talk":return s.title="对讲",s.id=A,s.domString="
    "+'')+''+'对讲'),s.onclick=function(){var A=t.decoderState.state,e=A.talk,i=A.sound;if(A.play)if(e){console.log("结束对讲"),t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk();var n=Ft(t.themeData.footer.btnList,(function(A){return"sound"===A.iconId&&1===A.isrender&&1===A.defaultActive}))>-1;t.themeData&&n&&t.jSPlugin.openSound()}else console.log("开始对讲"),t.setDecoderState({talk:!0}),t.jSPlugin.Talk.startTalk((function(A){i&&!A&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1}))}))},s;case"sound":return s.title="音量",s.id=A,s.domString=''+'')+'\n \n \n \n \n ')+'音量'),s.onclick=function(){var A=t.decoderState.state,e=A.play,i=A.sound,n=A.talk;e&&!n&&(i?(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})):t.jSPlugin.openSound())},s;default:return s}}},{key:"renderInspectInfo",value:function(A,e){var t=this.matchBtn(A,e),i=document.createElement("sapn");i.innerHTML="".concat(t.domString),"left"===e.part?document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-right")).appendChild(i)}},{key:"renderHeader",value:function(A,e){var t=this.matchBtn(A,e),i=document.createElement("span");i.className="".concat(this.jSPlugin.id,"-header-content"),i.style="display: flex; align-items: center; ",i.innerHTML="\n ".concat(t.domString,"\n "),"left"===e.part?document.getElementById("".concat(this.jSPlugin.id,"-headControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).appendChild(i)}},{key:"renderFooter",value:function(A,e){var t=this,i=this.matchBtn(A,e),n=this.videoWidth/6,a=document.createElement("div");a.className="theme-icon-item",this.jSPlugin.isWebConsole?a.style="padding:0 ".concat(.1*n,"px;"):a.style="padding:0 ".concat(.1*n,"px;cursor: pointer;"),a.innerHTML="".concat('')+'
    ')).concat(i.domString,"
    ")+"
    ",a.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;i.onclick(A)},i.onmouseenter&&(a.onmouseenter=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;i.onmouseenter(A)}),i.onmouseleave&&(a.onmouseleave=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;i.onmouseleave(A)}),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(a)}},{key:"initThemeData",value:function(){var A=this,e=this.themeData,t=e.customConfig,i=e.header,n=e.footer,a=t.inspectInfo,o=this.jSPlugin.id;if(this.isNeedRenderInspectInfo=Ft(a.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderHeader=Ft(i.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=Ft(n.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderInspectInfo)if(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")))document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).innerHTML="
    ");else{var r=document.createElement("div");r.setAttribute("id","".concat(this.jSPlugin.id,"-inspectInfoControl")),r.setAttribute("class","inspectInfo-controls"),r.innerHTML="
    ");var s={height:"58px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#000000",width:"".concat(this.jSPlugin.width+290,"px"),position:"relative","align-items":"center",background:"#ffffff","border-bottom":"1px solid #D9D9D9","box-sizing":"border-box"};r.style=Cn(s),document.getElementById("".concat(o,"-wrap")).insertBefore(r,document.getElementById(this.jSPlugin.id));var g=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(g)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")));if(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="
    ");var l={height:"56px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:this.jSPlugin.width+"px",padding:"0 16px","box-sizing":"border-box",position:"relative","align-items":"center",background:"#000000"};c.style=Cn(l),document.getElementById("".concat(o,"-wrap")).insertBefore(c,document.getElementById(o));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.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("56px","px"));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",display:"flex",height:"56px","flex-wrap":"wrap","justify-content":"center","z-index":999,top:0,color:"#FFFFFF",width:this.jSPlugin.width+"px","align-items":"center","background-color":"#000000","font-size":"14px"};C.style=Cn(d),C.innerHTML='\n
    \n
    \n
    \n "),x(C,document.getElementById(o))}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")));this.isNeedRenderInspectInfo&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=a.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=a.color,a.btnList.map((function(e,t){e.isrender&&A.renderInspectInfo(e.iconId,e)}))),this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i.color,i.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=n.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n.color,n.btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)}))),this.inspectMapWin=new zi(this.jSPlugin),this.inspectSmallWin=new ln(this.jSPlugin,this.inspectMode,this.inspectMapWin,this.changeInspectMode,this.decoderState)}},{key:"renderThemeData",value:function(){var A=this,e=this.decoderState.state.isEditing,t=this.themeData,i=t.inspectInfo,n=t.header,a=t.footer;if(this.isNeedRenderInspectInfo&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=i.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=i.color.replace("-diy",""),i.btnList.map((function(e,t){e.isrender&&A.setDecoderState(s({},e.iconId,A.decoderState.state[e.iconId]))}))),this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color.replace("-diy",""),n.btnList&&n.btnList.map((function(e,t){e.isrender&&A.setDecoderState(s({},e.iconId,A.decoderState.state[e.iconId]))}))),this.isNeedRenderFooter&&a)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a.color.replace("-diy",""),a.btnList.map((function(t,i){if(t.isrender&&A.setDecoderState(s({},t.iconId,A.decoderState.state[t.iconId])),0==i&&!A.themeInited&&A.activeThemeStatus)var n=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(n),1!=A.themeData.customConfig.bellPoster||e?A.jSPlugin.play():A.jSPlugin.pluginStatus.loadingClear(),A.themeInited=!0)}),50)})),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 o=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),A.themeData&&A.themeData.customConfig&&1==A.themeData.customConfig.bellPoster&&!e?A.jSPlugin.pluginStatus.loadingClear():A.jSPlugin.play(),A.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),A.reSizeVideo(A.videoWidth,A.videoHeight))}),50);this.jSPlugin.Zoom||(this.jSPlugin.Zoom=new yi(this.jSPlugin)),this.getInspectDevInfo(this.jSPlugin,!0,!1)}},{key:"getInspectRecord",value:function(){var A=this;!function(A,e,t){var i={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:m(A.url).deviceSerial},n="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/detail/latest");Pi(n,"GET",i,(function(A){e&&e(A)}),(function(A){t&&t(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(this.jSPlugin,(function(e){if(200==e.meta.code&&e.data){var t=e.data;t.inspectRange&&A.inspectMapWin.createPolygon(t.inspectRange,"#407AFF","dashed",4,1,"#407AFF",.08),t.inspectPoints&&t.inspectPoints.length>0&&A.inspectMapWin.createInspectPoints(t.inspectPoints),"video"===A.inspectMode&&A.inspectMapWin.map.removeOverlay(A.inspectMapWin.inspectRange),document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectName"))&&t.inspectName&&(document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectName")).innerText=""+t.inspectName),document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectBeginTime"))&&t.beginTime&&(document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectBeginTime")).innerText="巡检开始时间:"+t.beginTime),document.getElementById("".concat(A.jSPlugin.id,"-header-inspectTime"))&&A.timer.createInterval("InspectTimer",(function(){document.getElementById("".concat(A.jSPlugin.id,"-header-inspectTime")).innerHTML=A.renderInspectTime(t.beginTime)}),1e3),document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectPerson"))&&t.inspectPerson&&(document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectPerson")).innerText="本地巡检员:"+t.inspectPerson),A.inspectInfo=t,t.inspectRecordId&&on(A.jSPlugin,t.inspectRecordId,(function(e){200==e.meta.code&&e.data&&(A.inspectMapWin.createTrack(e.data,!0),A.timer.createInterval("TraceTimer",(function(){t.inspectRecordId&&on(A.jSPlugin,t.inspectRecordId,(function(e){200==e.meta.code&&e.data&&A.inspectMapWin.createTrack(e.data,!1)}),(function(){}))}),5e3))}),(function(){})),A.InspectEvent=new cn(A.jSPlugin,t.inspectRecordId,A.timer)}else A.InspectEvent=new cn(A.jSPlugin,null,A.timer)}),(function(A){}))}},{key:"getInspectDevInfo",value:function(A){var e=this,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!function(A,e,t){var i={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:m(A.url).deviceSerial},n="".concat(A.env.domain,"/api/service/devicekit/bodycamera");Pi(n,"GET",i,(function(A){e&&e(A)}),(function(A){t&&t(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(A,(function(n){n.meta&&200==n.meta.code&&n.data?1===n.data.status?(i&&!e.decoderState.state.play&&(e.jSPlugin.pluginStatus.loadingStart(e.jSPlugin.id),e.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),e.jSPlugin.play()),e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-global-box"),!1),document.getElementById("".concat(e.jSPlugin.id,"-header-deviceName"))&&(document.getElementById("".concat(e.jSPlugin.id,"-header-deviceName")).innerText="".concat(n.data.deviceName,"(").concat(n.data.deviceSerial,")"),document.getElementById("".concat(e.jSPlugin.id,"-header-deviceName")).setAttribute("title","".concat(n.data.deviceName,"(").concat(n.data.deviceSerial,")"))),document.getElementById("".concat(e.jSPlugin.id,"-header-signalType"))&&(document.getElementById("".concat(e.jSPlugin.id,"-header-signalType")).innerHTML=e.renderSignalType(n.data.signalType)),document.getElementById("".concat(e.jSPlugin.id,"-header-batteryStatus"))&&(document.getElementById("".concat(e.jSPlugin.id,"-header-batteryStatus")).innerHTML=e.renderBatteryStatus(n.data.batteryStatus)),e.timer.createInterval("InspectDevInfoTimer",(function(){e.getInspectDevInfo(A,!1,!1)}),3e5),t&&e.getInspectRecord()):(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"当前设备未在巡检中",refreshBtn:"刷新",refreshShow:!0},(function(){e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-no-inspect-box"),!1),e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!0),e.getInspectDevInfo(A,!0,!0)}))):(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:n.meta.message,refreshShow:!1}))}),(function(){e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-global-box"),!1)}))}},{key:"fetchThemeData",value:function(A){var e=this;wi(this.jSPlugin,A,(function(A){if(0!==A.meta.code||!A.data)return e.activeThemeStatus=!1,e.jSPlugin.pluginStatus.loadingClear(),"111021"==A.meta.code?(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"无效的模板id",refreshBtn:"刷新",refreshShow:!1}),void(e.activeThemeStatusTxt="无效的模板id")):"111023"==A.meta.code?(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"您的试用特权已到期,需前往轻应用控制台购买后使用。",refreshBtn:"刷新",refreshShow:!1}),void(e.activeThemeStatusTxt="试用特权已到期")):(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"模板未激活,请先在开放平台轻应用控制台购买模板",refreshBtn:"刷新",refreshShow:!1}),void(e.activeThemeStatusTxt="模板未激活"));e.activeThemeStatus=!0,e.themeData=A.data,e.jSPlugin.capacity?(e.initThemeData(),e.renderThemeData()):setTimeout((function(){e.initThemeData(),e.renderThemeData()}),300)}),(function(){e.themeData=In,e.themeData.header&&(e.themeData.header.btnList=e.themeData.header.btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),e.themeData.footer&&(e.themeData.footer.btnList=e.themeData.footer.btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),e.initThemeData(),e.renderThemeData()}))}},{key:"reSizeVideo",value:function(A,e){if(document.getElementById("".concat(this.jSPlugin.id)).style.width=A+"px",document.getElementById("".concat(this.jSPlugin.id)).style.height=e+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin.JS_Resize(A,e);else{document.getElementById("".concat(this.jSPlugin.id,"-player"))&&(document.getElementById("".concat(this.jSPlugin.id,"-player")).width=A,document.getElementById("".concat(this.jSPlugin.id,"-player")).height=e,document.getElementById("".concat(this.jSPlugin.id,"-player")).style.width=A+"px",document.getElementById("".concat(this.jSPlugin.id,"-player")).style.height=e+"px",document.getElementById("".concat(this.jSPlugin.id,"-container-0")).style.height=e+"px");var t=1;if(document.getElementById("".concat(this.jSPlugin.id,"canvas0")))navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)&&(t=2),document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.width=A*t+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.height=e*t+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).width=A*t,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).height=e*t,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.width=A*t+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.height=e*t+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).height=e*t}}},{key:"reSize",value:function(A,e){var t=.3333*A,i=.3333*e;document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.width=A+this.jSPlugin.inspectVideoWidth+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.width=A+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.width=A+"px"),"video"===this.jSPlugin.Theme.inspectMode?(this.reSizeVideo(A,e),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=0),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=t+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=i+"px"):(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=e+"px"),this.reSizeVideo(t,i),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=A+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=e+"px"),document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.bottom=i/2+96-30+"px",document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.right=this.jSPlugin.inspectVideoWidth+t+"px"}}])}(),Bn=function(){return o((function A(e){var i=this;if(t(this,A),s(this,"changeInspectMode",(function(A){i.inspectMode=A})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.inspectMode="video",this.autoFocus=0,this.decoderState={state:{isEditing:!1,play:!1,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,mute:!1,cloudRec:"cloud.rec"===m(e.url).type,rec:"rec"===m(e.url).type,type:m(e.url).type}},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=In,"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.timer||(this.timer=new qi(e)),this.jSPlugin.themeId)if(this.isMobile||(this.inspect=new hn(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState,this.inspectMode,this.changeInspectMode,this.timer)),"themeData"===this.jSPlugin.themeId)this.themeData=this.jSPlugin.params.themeData,this.inspect.initThemeData(),this.inspect.renderThemeData();else this.inspect.fetchThemeData(this.jSPlugin.themeId);this.jSPlugin.Talk||(this.jSPlugin.Talk=new Ii(this.jSPlugin)),E("".concat(this.jSPlugin.staticPath,"/css/theme.css")),E("".concat(this.jSPlugin.staticPath,"/css/component.css")),E("".concat(this.jSPlugin.staticPath,"/css/inspectTheme.css"))}),[{key:"setDecoderState",value:function(A,e){var t=this,i="#FFFFFF",n="#1890FF";Object.keys(A).map((function(e){switch(e){case"talk":document.getElementById("".concat(t.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(t.jSPlugin.id,"-talk")).className=A[e]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=A[e]?n:i,document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[2].style.color=A[e]?n:i);break;case"sound":document.getElementById("".concat(t.jSPlugin.id,"-sound"))&&(A[e]?(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=A[e]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=A[e]?n:i,document.getElementById("".concat(t.jSPlugin.id,"-sound-label")).style.color=A[e]?n:i):(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=A[e]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-label")).style.color=A[e]?n:i))}t.decoderState.state=Object.assign(t.decoderState.state,A)}))}},{key:"setDisabled",value:function(A){var e=this.decoderState.state,t=e.sound;e.hd,null!=document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon")).setAttribute("style",A?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-sound-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-sound-label")).setAttribute("style",A?"cursor: not-allowed; color: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",A?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-label")).setAttribute("style",A?"cursor: not-allowed; color: gray":"cursor: default")}},{key:"inspectEnding",value:function(){var A=document.createElement("div");A.id="".concat(this.jSPlugin.id,"-inspect-ending-box"),A.style="width:100%; position: absolute; z-index: 10000; top:58px; bottom:0; left:0; background: #ffffff;",A.innerHTML='
    \n
    \n
    \n \n
    \n
    巡检已结束
    \n
    \n
    \n ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(A),this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom()}}])}(),un=function(){return o((function A(){t(this,A),this.events={}}),[{key:"on",value:function(A,e){A&&e&&(this.events[A]=this.events[A]||[],this.events[A].push(e))}},{key:"emit",value:function(A,e){A&&this.events[A]&&this.events[A].forEach((function(A){return A(e)}))}},{key:"off",value:function(A,e){A&&e&&this.events[A]&&this.events[A].splice(this.events[A].indexOf(e),1)}},{key:"once",value:function(A,e){var t=this;this.on(A,(function i(){var n=Array.prototype.slice.call(arguments);e.apply(null,n),t.off(A,i)}))}},{key:"removeAllListener",value:function(){this.events={}}}])}(),En=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=void 0,n=void 0,a=void 0,o=[];return function(){var s=function(A){return"function"==typeof A?A():A}(e),g=(new Date).getTime(),c=!i||g-i>s;i=g;for(var l=arguments.length,I=Array(l),C=0;C>>0)+"_",n=0;return function A(t){if(this instanceof A)throw new TypeError("Symbol is not a constructor");return new e(i+(t||"")+"_"+n++,t)}})),a("Symbol.iterator",(function(A){if(A)return A;A=Symbol("Symbol.iterator");for(var i="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a0&&e-1 in A)}function y(A,e){return A.nodeName&&A.nodeName.toLowerCase()===e.toLowerCase()}p.fn=p.prototype={jquery:Q,constructor:p,length:0,toArray:function(){return n.call(this)},get:function(A){return null==A?n.call(this):A<0?this[A+this.length]:this[A]},pushStack:function(A){var e=p.merge(this.constructor(),A);return e.prevObject=this,e},each:function(A){return p.each(this,A)},map:function(A){return this.pushStack(p.map(this,(function(e,t){return A.call(e,t,e)})))},slice:function(){return this.pushStack(n.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(p.grep(this,(function(A,e){return(e+1)%2})))},odd:function(){return this.pushStack(p.grep(this,(function(A,e){return e%2})))},eq:function(A){var e=this.length,t=+A+(A<0?e:0);return this.pushStack(t>=0&&t+~]|"+w+")"+w+"*"),U=new RegExp(w+"|>"),J=new RegExp(M),H=new RegExp("^"+N+"$"),K={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N+"|[*])"),ATTR:new RegExp("^"+T),PSEUDO:new RegExp("^"+M),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+w+"*(even|odd|(([+-]|)(\\d*)n|)"+w+"*(?:([+-]|)"+w+"*(\\d+)|))"+w+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+w+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+w+"*((?:-\\d)?\\d*)"+w+"*\\)|)(?=[^-]|$)","i")},V=/^(?:input|select|textarea|button)$/i,O=/^h\d$/i,j=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,W=/[+~]/,Z=new RegExp("\\\\[\\da-fA-F]{1,6}"+w+"?|\\\\([^\\r\\n\\f])","g"),X=function(A,e){var t="0x"+A.slice(1)-65536;return e||(t<0?String.fromCharCode(t+65536):String.fromCharCode(t>>10|55296,1023&t|56320))},q=function(){sA()},z=IA((function(A){return!0===A.disabled&&y(A,"fieldset")}),{dir:"parentNode",next:"legend"});try{B.apply(t=n.call(R.childNodes),R.childNodes),t[R.childNodes.length].nodeType}catch(A){B={apply:function(A,e){k.apply(A,n.call(e))},call:function(A){k.apply(A,n.call(arguments,1))}}}function $(A,e,t,i){var n,a,o,r,s,c,l,h=e&&e.ownerDocument,E=e?e.nodeType:9;if(t=t||[],"string"!=typeof A||!A||1!==E&&9!==E&&11!==E)return t;if(!i&&(sA(e),e=e||g,I)){if(11!==E&&(s=j.exec(A)))if(n=s[1]){if(9===E){if(!(o=e.getElementById(n)))return t;if(o.id===n)return B.call(t,o),t}else if(h&&(o=h.getElementById(n))&&$.contains(e,o)&&o.id===n)return B.call(t,o),t}else{if(s[2])return B.apply(t,e.getElementsByTagName(A)),t;if((n=s[3])&&e.getElementsByClassName)return B.apply(t,e.getElementsByClassName(n)),t}if(!(b[A+" "]||d&&d.test(A))){if(l=A,h=e,1===E&&(U.test(A)||G.test(A))){for((h=W.test(A)&&rA(e.parentNode)||e)==e&&C.scope||((r=e.getAttribute("id"))?r=p.escapeSelector(r):e.setAttribute("id",r=u)),a=(c=cA(A)).length;a--;)c[a]=(r?"#"+r:":scope")+" "+lA(c[a]);l=c.join(",")}try{return B.apply(t,h.querySelectorAll(l)),t}catch(e){b(A,!0)}finally{r===u&&e.removeAttribute("id")}}}return EA(A.replace(v,"$1"),e,t,i)}function AA(){var A=[];return function e(t,n){return A.push(t+" ")>i.cacheLength&&delete e[A.shift()],e[t+" "]=n}}function eA(A){return A[u]=!0,A}function tA(A){var e=g.createElement("fieldset");try{return!!A(e)}catch(A){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function iA(A){return function(e){return y(e,"input")&&e.type===A}}function nA(A){return function(e){return(y(e,"input")||y(e,"button"))&&e.type===A}}function aA(A){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===A:e.disabled===A:e.isDisabled===A||e.isDisabled!==!A&&z(e)===A:e.disabled===A:"label"in e&&e.disabled===A}}function oA(A){return eA((function(e){return e=+e,eA((function(t,i){for(var n,a=A([],t.length,e),o=a.length;o--;)t[n=a[o]]&&(t[n]=!(i[n]=t[n]))}))}))}function rA(A){return A&&void 0!==A.getElementsByTagName&&A}function sA(A){var e,t=A?A.ownerDocument||A:R;return t!=g&&9===t.nodeType&&t.documentElement?(l=(g=t).documentElement,I=!p.isXMLDoc(g),h=l.matches||l.webkitMatchesSelector||l.msMatchesSelector,l.msMatchesSelector&&R!=g&&(e=g.defaultView)&&e.top!==e&&e.addEventListener("unload",q),C.getById=tA((function(A){return l.appendChild(A).id=p.expando,!g.getElementsByName||!g.getElementsByName(p.expando).length})),C.disconnectedMatch=tA((function(A){return h.call(A,"*")})),C.scope=tA((function(){return g.querySelectorAll(":scope")})),C.cssHas=tA((function(){try{return g.querySelector(":has(*,:jqfake)"),!1}catch(A){return!0}})),C.getById?(i.filter.ID=function(A){var e=A.replace(Z,X);return function(A){return A.getAttribute("id")===e}},i.find.ID=function(A,e){if(void 0!==e.getElementById&&I){var t=e.getElementById(A);return t?[t]:[]}}):(i.filter.ID=function(A){var e=A.replace(Z,X);return function(A){var t=void 0!==A.getAttributeNode&&A.getAttributeNode("id");return t&&t.value===e}},i.find.ID=function(A,e){if(void 0!==e.getElementById&&I){var t,i,n,a=e.getElementById(A);if(a){if((t=a.getAttributeNode("id"))&&t.value===A)return[a];for(n=e.getElementsByName(A),i=0;a=n[i++];)if((t=a.getAttributeNode("id"))&&t.value===A)return[a]}return[]}}),i.find.TAG=function(A,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(A):e.querySelectorAll(A)},i.find.CLASS=function(A,e){if(void 0!==e.getElementsByClassName&&I)return e.getElementsByClassName(A)},d=[],tA((function(A){var e;l.appendChild(A).innerHTML="",A.querySelectorAll("[selected]").length||d.push("\\["+w+"*(?:value|"+P+")"),A.querySelectorAll("[id~="+u+"-]").length||d.push("~="),A.querySelectorAll("a#"+u+"+*").length||d.push(".#.+[+~]"),A.querySelectorAll(":checked").length||d.push(":checked"),(e=g.createElement("input")).setAttribute("type","hidden"),A.appendChild(e).setAttribute("name","D"),l.appendChild(A).disabled=!0,2!==A.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=g.createElement("input")).setAttribute("name",""),A.appendChild(e),A.querySelectorAll("[name='']").length||d.push("\\["+w+"*name"+w+"*="+w+"*(?:''|\"\")")})),C.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),F=function(A,e){if(A===e)return s=!0,0;var t=!A.compareDocumentPosition-!e.compareDocumentPosition;return t||(1&(t=(A.ownerDocument||A)==(e.ownerDocument||e)?A.compareDocumentPosition(e):1)||!C.sortDetached&&e.compareDocumentPosition(A)===t?A===g||A.ownerDocument==R&&$.contains(R,A)?-1:e===g||e.ownerDocument==R&&$.contains(R,e)?1:o?r.call(o,A)-r.call(o,e):0:4&t?-1:1)},g):g}for(e in $.matches=function(A,e){return $(A,null,null,e)},$.matchesSelector=function(A,e){if(sA(A),I&&!b[e+" "]&&(!d||!d.test(e)))try{var t=h.call(A,e);if(t||C.disconnectedMatch||A.document&&11!==A.document.nodeType)return t}catch(A){b(e,!0)}return $(e,g,null,[A]).length>0},$.contains=function(A,e){return(A.ownerDocument||A)!=g&&sA(A),p.contains(A,e)},$.attr=function(A,e){(A.ownerDocument||A)!=g&&sA(A);var t=i.attrHandle[e.toLowerCase()],n=t&&c.call(i.attrHandle,e.toLowerCase())?t(A,e,!I):void 0;return void 0!==n?n:A.getAttribute(e)},$.error=function(A){throw new Error("Syntax error, unrecognized expression: "+A)},p.uniqueSort=function(A){var e,t=[],i=0,a=0;if(s=!C.sortStable,o=!C.sortStable&&n.call(A,0),S.call(A,F),s){for(;e=A[a++];)e===A[a]&&(i=t.push(a));for(;i--;)D.call(A,t[i],1)}return o=null,A},p.fn.uniqueSort=function(){return this.pushStack(p.uniqueSort(n.apply(this)))},i=p.expr={cacheLength:50,createPseudo:eA,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(A){return A[1]=A[1].replace(Z,X),A[3]=(A[3]||A[4]||A[5]||"").replace(Z,X),"~="===A[2]&&(A[3]=" "+A[3]+" "),A.slice(0,4)},CHILD:function(A){return A[1]=A[1].toLowerCase(),"nth"===A[1].slice(0,3)?(A[3]||$.error(A[0]),A[4]=+(A[4]?A[5]+(A[6]||1):2*("even"===A[3]||"odd"===A[3])),A[5]=+(A[7]+A[8]||"odd"===A[3])):A[3]&&$.error(A[0]),A},PSEUDO:function(A){var e,t=!A[6]&&A[2];return K.CHILD.test(A[0])?null:(A[3]?A[2]=A[4]||A[5]||"":t&&J.test(t)&&(e=cA(t,!0))&&(e=t.indexOf(")",t.length-e)-t.length)&&(A[0]=A[0].slice(0,e),A[2]=t.slice(0,e)),A.slice(0,3))}},filter:{TAG:function(A){var e=A.replace(Z,X).toLowerCase();return"*"===A?function(){return!0}:function(A){return y(A,e)}},CLASS:function(A){var e=Q[A+" "];return e||(e=new RegExp("(^|"+w+")"+A+"("+w+"|$)"))&&Q(A,(function(A){return e.test("string"==typeof A.className&&A.className||void 0!==A.getAttribute&&A.getAttribute("class")||"")}))},ATTR:function(A,e,t){return function(i){var n=$.attr(i,A);return null==n?"!="===e:!e||(n+="","="===e?n===t:"!="===e?n!==t:"^="===e?t&&0===n.indexOf(t):"*="===e?t&&n.indexOf(t)>-1:"$="===e?t&&n.slice(-t.length)===t:"~="===e?(" "+n.replace(L," ")+" ").indexOf(t)>-1:"|="===e&&(n===t||n.slice(0,t.length+1)===t+"-"))}},CHILD:function(A,e,t,i,n){var a="nth"!==A.slice(0,3),o="last"!==A.slice(-4),r="of-type"===e;return 1===i&&0===n?function(A){return!!A.parentNode}:function(e,t,s){var g,c,l,I,C,d=a!==o?"nextSibling":"previousSibling",h=e.parentNode,B=r&&e.nodeName.toLowerCase(),f=!s&&!r,Q=!1;if(h){if(a){for(;d;){for(l=e;l=l[d];)if(r?y(l,B):1===l.nodeType)return!1;C=d="only"===A&&!C&&"nextSibling"}return!0}if(C=[o?h.firstChild:h.lastChild],o&&f){for(Q=(I=(g=(c=h[u]||(h[u]={}))[A]||[])[0]===E&&g[1])&&g[2],l=I&&h.childNodes[I];l=++I&&l&&l[d]||(Q=I=0)||C.pop();)if(1===l.nodeType&&++Q&&l===e){c[A]=[E,I,Q];break}}else if(f&&(Q=I=(g=(c=e[u]||(e[u]={}))[A]||[])[0]===E&&g[1]),!1===Q)for(;(l=++I&&l&&l[d]||(Q=I=0)||C.pop())&&(!(r?y(l,B):1===l.nodeType)||!++Q||(f&&((c=l[u]||(l[u]={}))[A]=[E,Q]),l!==e)););return(Q-=n)===i||Q%i==0&&Q/i>=0}}},PSEUDO:function(A,e){var t,n=i.pseudos[A]||i.setFilters[A.toLowerCase()]||$.error("unsupported pseudo: "+A);return n[u]?n(e):n.length>1?(t=[A,A,"",e],i.setFilters.hasOwnProperty(A.toLowerCase())?eA((function(A,t){for(var i,a=n(A,e),o=a.length;o--;)A[i=r.call(A,a[o])]=!(t[i]=a[o])})):function(A){return n(A,0,t)}):n}},pseudos:{not:eA((function(A){var e=[],t=[],i=uA(A.replace(v,"$1"));return i[u]?eA((function(A,e,t,n){for(var a,o=i(A,null,n,[]),r=A.length;r--;)(a=o[r])&&(A[r]=!(e[r]=a))})):function(A,n,a){return e[0]=A,i(e,null,a,t),e[0]=null,!t.pop()}})),has:eA((function(A){return function(e){return $(A,e).length>0}})),contains:eA((function(A){return A=A.replace(Z,X),function(e){return(e.textContent||p.text(e)).indexOf(A)>-1}})),lang:eA((function(A){return H.test(A||"")||$.error("unsupported lang: "+A),A=A.replace(Z,X).toLowerCase(),function(e){var t;do{if(t=I?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===A||0===t.indexOf(A+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var t=A.location&&A.location.hash;return t&&t.slice(1)===e.id},root:function(A){return A===l},focus:function(A){return A===function(){try{return g.activeElement}catch(A){}}()&&g.hasFocus()&&!!(A.type||A.href||~A.tabIndex)},enabled:aA(!1),disabled:aA(!0),checked:function(A){return y(A,"input")&&!!A.checked||y(A,"option")&&!!A.selected},selected:function(A){return A.parentNode&&A.parentNode.selectedIndex,!0===A.selected},empty:function(A){for(A=A.firstChild;A;A=A.nextSibling)if(A.nodeType<6)return!1;return!0},parent:function(A){return!i.pseudos.empty(A)},header:function(A){return O.test(A.nodeName)},input:function(A){return V.test(A.nodeName)},button:function(A){return y(A,"input")&&"button"===A.type||y(A,"button")},text:function(A){var e;return y(A,"input")&&"text"===A.type&&(null==(e=A.getAttribute("type"))||"text"===e.toLowerCase())},first:oA((function(){return[0]})),last:oA((function(A,e){return[e-1]})),eq:oA((function(A,e,t){return[t<0?t+e:t]})),even:oA((function(A,e){for(var t=0;te?e:t;--i>=0;)A.push(i);return A})),gt:oA((function(A,e,t){for(var i=t<0?t+e:t;++i1?function(e,t,i){for(var n=A.length;n--;)if(!A[n](e,t,i))return!1;return!0}:A[0]}function dA(A,e,t,i,n){for(var a,o=[],r=0,s=A.length,g=null!=e;r-1&&(a[c]=!(o[c]=I))}}else C=dA(C===o?C.splice(u,C.length):C),n?n(null,o,C,g):B.apply(o,C)}))}function BA(A){for(var e,t,n,o=A.length,s=i.relative[A[0].type],g=s||i.relative[" "],c=s?1:0,l=IA((function(A){return A===e}),g,!0),I=IA((function(A){return r.call(e,A)>-1}),g,!0),C=[function(A,t,i){var n=!s&&(i||t!=a)||((e=t).nodeType?l(A,t,i):I(A,t,i));return e=null,n}];c1&&CA(C),c>1&&lA(A.slice(0,c-1).concat({value:" "===A[c-2].type?"*":""})).replace(v,"$1"),t,c0,n=A.length>0,o=function(o,r,s,c,l){var C,d,h,u=0,f="0",Q=o&&[],x=[],m=a,y=o||n&&i.find.TAG("*",l),S=E+=null==m?1:Math.random()||.1,D=y.length;for(l&&(a=r==g||r||l);f!==D&&null!=(C=y[f]);f++){if(n&&C){for(d=0,r||C.ownerDocument==g||(sA(C),s=!I);h=A[d++];)if(h(C,r||g,s)){B.call(c,C);break}l&&(E=S)}t&&((C=!h&&C)&&u--,o&&Q.push(C))}if(u+=f,t&&f!==u){for(d=0;h=e[d++];)h(Q,x,r,s);if(o){if(u>0)for(;f--;)Q[f]||x[f]||(x[f]=_.call(c));x=dA(x)}B.apply(c,x),l&&!o&&x.length>0&&u+e.length>1&&p.uniqueSort(c)}return l&&(E=S,a=m),Q};return t?eA(o):o}(o,n)),r.selector=A}return r}function EA(A,e,t,n){var a,o,r,s,g,c="function"==typeof A&&A,l=!n&&cA(A=c.selector||A);if(t=t||[],1===l.length){if((o=l[0]=l[0].slice(0)).length>2&&"ID"===(r=o[0]).type&&9===e.nodeType&&I&&i.relative[o[1].type]){if(!(e=(i.find.ID(r.matches[0].replace(Z,X),e)||[])[0]))return t;c&&(e=e.parentNode),A=A.slice(o.shift().value.length)}for(a=K.needsContext.test(A)?0:o.length;a--&&(r=o[a],!i.relative[s=r.type]);)if((g=i.find[s])&&(n=g(r.matches[0].replace(Z,X),W.test(o[0].type)&&rA(e.parentNode)||e))){if(o.splice(a,1),!(A=n.length&&lA(o)))return B.apply(t,n),t;break}}return(c||uA(A,l))(n,e,!I,t,!e||W.test(A)&&rA(e.parentNode)||e),t}gA.prototype=i.filters=i.pseudos,i.setFilters=new gA,C.sortStable=u.split("").sort(F).join("")===u,sA(),C.sortDetached=tA((function(A){return 1&A.compareDocumentPosition(g.createElement("fieldset"))})),p.find=$,p.expr[":"]=p.expr.pseudos,p.unique=p.uniqueSort,$.compile=uA,$.select=EA,$.setDocument=sA,$.tokenize=cA,$.escape=p.escapeSelector,$.getText=p.text,$.isXML=p.isXMLDoc,$.selectors=p.expr,$.support=p.support,$.uniqueSort=p.uniqueSort}();var P=function(A,e,t){for(var i=[],n=void 0!==t;(A=A[e])&&9!==A.nodeType;)if(1===A.nodeType){if(n&&p(A).is(t))break;i.push(A)}return i},N=function(A,e){for(var t=[];A;A=A.nextSibling)1===A.nodeType&&A!==e&&t.push(A);return t},T=p.expr.match.needsContext,M=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(A,e,t){return d(e)?p.grep(A,(function(A,i){return!!e.call(A,i,A)!==t})):e.nodeType?p.grep(A,(function(A){return A===e!==t})):"string"!=typeof e?p.grep(A,(function(A){return r.call(e,A)>-1!==t})):p.filter(e,A,t)}p.filter=function(A,e,t){var i=e[0];return t&&(A=":not("+A+")"),1===e.length&&1===i.nodeType?p.find.matchesSelector(i,A)?[i]:[]:p.find.matches(A,p.grep(e,(function(A){return 1===A.nodeType})))},p.fn.extend({find:function(A){var e,t,i=this.length,n=this;if("string"!=typeof A)return this.pushStack(p(A).filter((function(){for(e=0;e1?p.uniqueSort(t):t},filter:function(A){return this.pushStack(L(this,A||[],!1))},not:function(A){return this.pushStack(L(this,A||[],!0))},is:function(A){return!!L(this,"string"==typeof A&&T.test(A)?p(A):A||[],!1).length}});var Y,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,U=p.fn.init=function(A,e,t){var i,n;if(!A)return this;if(t=t||Y,"string"==typeof A){if(!(i="<"===A[0]&&">"===A[A.length-1]&&A.length>=3?[null,A,null]:G.exec(A))||!i[1]&&e)return!e||e.jquery?(e||t).find(A):this.constructor(e).find(A);if(i[1]){if(e=e instanceof p?e[0]:e,p.merge(this,p.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:B,!0)),M.test(i[1])&&p.isPlainObject(e))for(i in e)d(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(n=B.getElementById(i[2]))&&(this[0]=n,this.length=1),this}return A.nodeType?(this[0]=A,this.length=1,this):d(A)?void 0!==t.ready?t.ready(A):A(p):p.makeArray(A,this)};U.prototype=p.fn,Y=p(B);var J=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function K(A,e){for(;(A=A[e])&&1!==A.nodeType;);return A}p.fn.extend({has:function(A){var e=p(A,this),t=e.length;return this.filter((function(){for(var A=0;A-1:1===t.nodeType&&p.find.matchesSelector(t,A))){a.push(t);break}return this.pushStack(a.length>1?p.uniqueSort(a):a)},index:function(A){return A?"string"==typeof A?r.call(p(A),this[0]):r.call(this,A.jquery?A[0]:A):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(A,e){return this.pushStack(p.uniqueSort(p.merge(this.get(),p(A,e))))},addBack:function(A){return this.add(null==A?this.prevObject:this.prevObject.filter(A))}}),p.each({parent:function(A){var e=A.parentNode;return e&&11!==e.nodeType?e:null},parents:function(A){return P(A,"parentNode")},parentsUntil:function(A,e,t){return P(A,"parentNode",t)},next:function(A){return K(A,"nextSibling")},prev:function(A){return K(A,"previousSibling")},nextAll:function(A){return P(A,"nextSibling")},prevAll:function(A){return P(A,"previousSibling")},nextUntil:function(A,e,t){return P(A,"nextSibling",t)},prevUntil:function(A,e,t){return P(A,"previousSibling",t)},siblings:function(A){return N((A.parentNode||{}).firstChild,A)},children:function(A){return N(A.firstChild)},contents:function(A){return null!=A.contentDocument&&i(A.contentDocument)?A.contentDocument:(y(A,"template")&&(A=A.content||A),p.merge([],A.childNodes))}},(function(A,e){p.fn[A]=function(t,i){var n=p.map(this,e,t);return"Until"!==A.slice(-5)&&(i=t),i&&"string"==typeof i&&(n=p.filter(i,n)),this.length>1&&(H[A]||p.uniqueSort(n),J.test(A)&&n.reverse()),this.pushStack(n)}}));var V=/[^\x20\t\r\n\f]+/g;function O(A){return A}function j(A){throw A}function W(A,e,t,i){var n;try{A&&d(n=A.promise)?n.call(A).done(e).fail(t):A&&d(n=A.then)?n.call(A,e,t):e.apply(void 0,[A].slice(i))}catch(A){t.apply(void 0,[A])}}p.Callbacks=function(A){A="string"==typeof A?function(A){var e={};return p.each(A.match(V)||[],(function(A,t){e[t]=!0})),e}(A):p.extend({},A);var e,t,i,n,a=[],o=[],r=-1,s=function(){for(n=n||A.once,i=e=!0;o.length;r=-1)for(t=o.shift();++r-1;)a.splice(t,1),t<=r&&r--})),this},has:function(A){return A?p.inArray(A,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return n=o=[],a=t="",this},disabled:function(){return!a},lock:function(){return n=o=[],t||e||(a=t=""),this},locked:function(){return!!n},fireWith:function(A,t){return n||(t=[A,(t=t||[]).slice?t.slice():t],o.push(t),e||s()),this},fire:function(){return g.fireWith(this,arguments),this},fired:function(){return!!i}};return g},p.extend({Deferred:function(e){var t=[["notify","progress",p.Callbacks("memory"),p.Callbacks("memory"),2],["resolve","done",p.Callbacks("once memory"),p.Callbacks("once memory"),0,"resolved"],["reject","fail",p.Callbacks("once memory"),p.Callbacks("once memory"),1,"rejected"]],i="pending",n={state:function(){return i},always:function(){return a.done(arguments).fail(arguments),this},catch:function(A){return n.then(null,A)},pipe:function(){var A=arguments;return p.Deferred((function(e){p.each(t,(function(t,i){var n=d(A[i[4]])&&A[i[4]];a[i[1]]((function(){var A=n&&n.apply(this,arguments);A&&d(A.promise)?A.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,n?[A]:arguments)}))})),A=null})).promise()},then:function(e,i,n){var a=0;function o(e,t,i,n){return function(){var r=this,s=arguments,g=function(){var A,g;if(!(e=a&&(i!==j&&(r=void 0,s=[A]),t.rejectWith(r,s))}};e?c():(p.Deferred.getErrorHook?c.error=p.Deferred.getErrorHook():p.Deferred.getStackHook&&(c.error=p.Deferred.getStackHook()),A.setTimeout(c))}}return p.Deferred((function(A){t[0][3].add(o(0,A,d(n)?n:O,A.notifyWith)),t[1][3].add(o(0,A,d(e)?e:O)),t[2][3].add(o(0,A,d(i)?i:j))})).promise()},promise:function(A){return null!=A?p.extend(A,n):n}},a={};return p.each(t,(function(A,e){var o=e[2],r=e[5];n[e[1]]=o.add,r&&o.add((function(){i=r}),t[3-A][2].disable,t[3-A][3].disable,t[0][2].lock,t[0][3].lock),o.add(e[3].fire),a[e[0]]=function(){return a[e[0]+"With"](this===a?void 0:this,arguments),this},a[e[0]+"With"]=o.fireWith})),n.promise(a),e&&e.call(a,a),a},when:function(A){var e=arguments.length,t=e,i=Array(t),a=n.call(arguments),o=p.Deferred(),r=function(A){return function(t){i[A]=this,a[A]=arguments.length>1?n.call(arguments):t,--e||o.resolveWith(i,a)}};if(e<=1&&(W(A,o.done(r(t)).resolve,o.reject,!e),"pending"===o.state()||d(a[t]&&a[t].then)))return o.then();for(;t--;)W(a[t],r(t),o.reject);return o.promise()}});var Z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;p.Deferred.exceptionHook=function(e,t){A.console&&A.console.warn&&e&&Z.test(e.name)&&A.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},p.readyException=function(e){A.setTimeout((function(){throw e}))};var X=p.Deferred();function q(){B.removeEventListener("DOMContentLoaded",q),A.removeEventListener("load",q),p.ready()}p.fn.ready=function(A){return X.then(A).catch((function(A){p.readyException(A)})),this},p.extend({isReady:!1,readyWait:1,ready:function(A){(!0===A?--p.readyWait:p.isReady)||(p.isReady=!0,!0!==A&&--p.readyWait>0||X.resolveWith(B,[p]))}}),p.ready.then=X.then,"complete"===B.readyState||"loading"!==B.readyState&&!B.documentElement.doScroll?A.setTimeout(p.ready):(B.addEventListener("DOMContentLoaded",q),A.addEventListener("load",q));var z=function(A,e,t,i,n,a,o){var r=0,s=A.length,g=null==t;if("object"===f(t))for(r in n=!0,t)z(A,e,r,t[r],!0,a,o);else if(void 0!==i&&(n=!0,d(i)||(o=!0),g&&(o?(e.call(A,i),e=null):(g=e,e=function(A,e,t){return g.call(p(A),t)})),e))for(;r1,null,!0)},removeData:function(A){return this.each((function(){oA.remove(this,A)}))}}),p.extend({queue:function(A,e,t){var i;if(A)return e=(e||"fx")+"queue",i=aA.get(A,e),t&&(!i||Array.isArray(t)?i=aA.access(A,e,p.makeArray(t)):i.push(t)),i||[]},dequeue:function(A,e){e=e||"fx";var t=p.queue(A,e),i=t.length,n=t.shift(),a=p._queueHooks(A,e);"inprogress"===n&&(n=t.shift(),i--),n&&("fx"===e&&t.unshift("inprogress"),delete a.stop,n.call(A,(function(){p.dequeue(A,e)}),a)),!i&&a&&a.empty.fire()},_queueHooks:function(A,e){var t=e+"queueHooks";return aA.get(A,t)||aA.access(A,t,{empty:p.Callbacks("once memory").add((function(){aA.remove(A,[e+"queue",t])}))})}}),p.fn.extend({queue:function(A,e){var t=2;return"string"!=typeof A&&(e=A,A="fx",t--),arguments.length\x20\t\r\n\f]*)/i,_A=/^$|^module$|\/(?:java|ecma)script/i;xA=B.createDocumentFragment().appendChild(B.createElement("div")),(pA=B.createElement("input")).setAttribute("type","radio"),pA.setAttribute("checked","checked"),pA.setAttribute("name","t"),xA.appendChild(pA),C.checkClone=xA.cloneNode(!0).cloneNode(!0).lastChild.checked,xA.innerHTML="",C.noCloneChecked=!!xA.cloneNode(!0).lastChild.defaultValue,xA.innerHTML="",C.option=!!xA.lastChild;var SA={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function DA(A,e){var t;return t=void 0!==A.getElementsByTagName?A.getElementsByTagName(e||"*"):void 0!==A.querySelectorAll?A.querySelectorAll(e||"*"):[],void 0===e||e&&y(A,e)?p.merge([A],t):t}function wA(A,e){for(var t=0,i=A.length;t",""]);var vA=/<|&#?\w+;/;function bA(A,e,t,i,n){for(var a,o,r,s,g,c,l=e.createDocumentFragment(),I=[],C=0,d=A.length;C-1)n&&n.push(a);else if(g=dA(a),o=DA(l.appendChild(a),"script"),g&&wA(o),t)for(c=0;a=o[c++];)_A.test(a.type||"")&&t.push(a);return l}var FA=/^([^.]*)(?:\.(.+)|)/;function RA(){return!0}function kA(){return!1}function PA(A,e,t,i,n,a){var o,r;if("object"==typeof e){for(r in"string"!=typeof t&&(i=i||t,t=void 0),e)PA(A,r,t,i,e[r],a);return A}if(null==i&&null==n?(n=t,i=t=void 0):null==n&&("string"==typeof t?(n=i,i=void 0):(n=i,i=t,t=void 0)),!1===n)n=kA;else if(!n)return A;return 1===a&&(o=n,n=function(A){return p().off(A),o.apply(this,arguments)},n.guid=o.guid||(o.guid=p.guid++)),A.each((function(){p.event.add(this,e,n,i,t)}))}function NA(A,e,t){t?(aA.set(A,e,!1),p.event.add(A,e,{namespace:!1,handler:function(A){var t,i=aA.get(this,e);if(1&A.isTrigger&&this[e]){if(i)(p.event.special[e]||{}).delegateType&&A.stopPropagation();else if(i=n.call(arguments),aA.set(this,e,i),this[e](),t=aA.get(this,e),aA.set(this,e,!1),i!==t)return A.stopImmediatePropagation(),A.preventDefault(),t}else i&&(aA.set(this,e,p.event.trigger(i[0],i.slice(1),this)),A.stopPropagation(),A.isImmediatePropagationStopped=RA)}})):void 0===aA.get(A,e)&&p.event.add(A,e,RA)}p.event={global:{},add:function(A,e,t,i,n){var a,o,r,s,g,c,l,I,C,d,h,B=aA.get(A);if(iA(A))for(t.handler&&(t=(a=t).handler,n=a.selector),n&&p.find.matchesSelector(CA,n),t.guid||(t.guid=p.guid++),(s=B.events)||(s=B.events=Object.create(null)),(o=B.handle)||(o=B.handle=function(e){return void 0!==p&&p.event.triggered!==e.type?p.event.dispatch.apply(A,arguments):void 0}),g=(e=(e||"").match(V)||[""]).length;g--;)C=h=(r=FA.exec(e[g])||[])[1],d=(r[2]||"").split(".").sort(),C&&(l=p.event.special[C]||{},C=(n?l.delegateType:l.bindType)||C,l=p.event.special[C]||{},c=p.extend({type:C,origType:h,data:i,handler:t,guid:t.guid,selector:n,needsContext:n&&p.expr.match.needsContext.test(n),namespace:d.join(".")},a),(I=s[C])||((I=s[C]=[]).delegateCount=0,l.setup&&!1!==l.setup.call(A,i,d,o)||A.addEventListener&&A.addEventListener(C,o)),l.add&&(l.add.call(A,c),c.handler.guid||(c.handler.guid=t.guid)),n?I.splice(I.delegateCount++,0,c):I.push(c),p.event.global[C]=!0)},remove:function(A,e,t,i,n){var a,o,r,s,g,c,l,I,C,d,h,B=aA.hasData(A)&&aA.get(A);if(B&&(s=B.events)){for(g=(e=(e||"").match(V)||[""]).length;g--;)if(C=h=(r=FA.exec(e[g])||[])[1],d=(r[2]||"").split(".").sort(),C){for(l=p.event.special[C]||{},I=s[C=(i?l.delegateType:l.bindType)||C]||[],r=r[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=I.length;a--;)c=I[a],!n&&h!==c.origType||t&&t.guid!==c.guid||r&&!r.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(I.splice(a,1),c.selector&&I.delegateCount--,l.remove&&l.remove.call(A,c));o&&!I.length&&(l.teardown&&!1!==l.teardown.call(A,d,B.handle)||p.removeEvent(A,C,B.handle),delete s[C])}else for(C in s)p.event.remove(A,C+e[g],t,i,!0);p.isEmptyObject(s)&&aA.remove(A,"handle events")}},dispatch:function(A){var e,t,i,n,a,o,r=new Array(arguments.length),s=p.event.fix(A),g=(aA.get(this,"events")||Object.create(null))[s.type]||[],c=p.event.special[s.type]||{};for(r[0]=s,e=1;e=1))for(;g!==this;g=g.parentNode||this)if(1===g.nodeType&&("click"!==A.type||!0!==g.disabled)){for(a=[],o={},t=0;t-1:p.find(n,this,null,[g]).length),o[n]&&a.push(i);a.length&&r.push({elem:g,handlers:a})}return g=this,s\s*$/g;function YA(A,e){return y(A,"table")&&y(11!==e.nodeType?e:e.firstChild,"tr")&&p(A).children("tbody")[0]||A}function GA(A){return A.type=(null!==A.getAttribute("type"))+"/"+A.type,A}function UA(A){return"true/"===(A.type||"").slice(0,5)?A.type=A.type.slice(5):A.removeAttribute("type"),A}function JA(A,e){var t,i,n,a,o,r;if(1===e.nodeType){if(aA.hasData(A)&&(r=aA.get(A).events))for(n in aA.remove(e,"handle events"),r)for(t=0,i=r[n].length;t1&&"string"==typeof B&&!C.checkClone&&MA.test(B))return A.each((function(n){var a=A.eq(n);u&&(e[0]=B.call(this,n,a.html())),KA(a,e,t,i)}));if(I&&(o=(n=bA(e,A[0].ownerDocument,!1,A,i)).firstChild,1===n.childNodes.length&&(n=o),o||i)){for(s=(r=p.map(DA(n,"script"),GA)).length;l0&&wA(o,!s&&DA(A,"script")),r},cleanData:function(A){for(var e,t,i,n=p.event.special,a=0;void 0!==(t=A[a]);a++)if(iA(t)){if(e=t[aA.expando]){if(e.events)for(i in e.events)n[i]?p.event.remove(t,i):p.removeEvent(t,i,e.handle);t[aA.expando]=void 0}t[oA.expando]&&(t[oA.expando]=void 0)}}}),p.fn.extend({detach:function(A){return VA(this,A,!0)},remove:function(A){return VA(this,A)},text:function(A){return z(this,(function(A){return void 0===A?p.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=A)}))}),null,A,arguments.length)},append:function(){return KA(this,arguments,(function(A){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||YA(this,A).appendChild(A)}))},prepend:function(){return KA(this,arguments,(function(A){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=YA(this,A);e.insertBefore(A,e.firstChild)}}))},before:function(){return KA(this,arguments,(function(A){this.parentNode&&this.parentNode.insertBefore(A,this)}))},after:function(){return KA(this,arguments,(function(A){this.parentNode&&this.parentNode.insertBefore(A,this.nextSibling)}))},empty:function(){for(var A,e=0;null!=(A=this[e]);e++)1===A.nodeType&&(p.cleanData(DA(A,!1)),A.textContent="");return this},clone:function(A,e){return A=null!=A&&A,e=null==e?A:e,this.map((function(){return p.clone(this,A,e)}))},html:function(A){return z(this,(function(A){var e=this[0]||{},t=0,i=this.length;if(void 0===A&&1===e.nodeType)return e.innerHTML;if("string"==typeof A&&!TA.test(A)&&!SA[(yA.exec(A)||["",""])[1].toLowerCase()]){A=p.htmlPrefilter(A);try{for(;t=0&&(s+=Math.max(0,Math.ceil(A["offset"+e[0].toUpperCase()+e.slice(1)]-a-s-r-.5))||0),s+g}function se(A,e,t){var i=WA(A),n=(!C.boxSizingReliable()||t)&&"border-box"===p.css(A,"boxSizing",!1,i),a=n,o=qA(A,e,i),r="offset"+e[0].toUpperCase()+e.slice(1);if(OA.test(o)){if(!t)return o;o="auto"}return(!C.boxSizingReliable()&&n||!C.reliableTrDimensions()&&y(A,"tr")||"auto"===o||!parseFloat(o)&&"inline"===p.css(A,"display",!1,i))&&A.getClientRects().length&&(n="border-box"===p.css(A,"boxSizing",!1,i),(a=r in A)&&(o=A[r])),(o=parseFloat(o)||0)+re(A,e,t||(n?"border":"content"),a,i,o)+"px"}function ge(A,e,t,i,n){return new ge.prototype.init(A,e,t,i,n)}p.extend({cssHooks:{opacity:{get:function(A,e){if(e){var t=qA(A,"opacity");return""===t?"1":t}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(A,e,t,i){if(A&&3!==A.nodeType&&8!==A.nodeType&&A.style){var n,a,o,r=tA(e),s=jA.test(e),g=A.style;if(s||(e=te(r)),o=p.cssHooks[e]||p.cssHooks[r],void 0===t)return o&&"get"in o&&void 0!==(n=o.get(A,!1,i))?n:g[e];"string"===(a=typeof t)&&(n=lA.exec(t))&&n[1]&&(t=uA(A,e,n),a="number"),null!=t&&t==t&&("number"!==a||s||(t+=n&&n[3]||(p.cssNumber[r]?"":"px")),C.clearCloneStyle||""!==t||0!==e.indexOf("background")||(g[e]="inherit"),o&&"set"in o&&void 0===(t=o.set(A,t,i))||(s?g.setProperty(e,t):g[e]=t))}},css:function(A,e,t,i){var n,a,o,r=tA(e);return jA.test(e)||(e=te(r)),(o=p.cssHooks[e]||p.cssHooks[r])&&"get"in o&&(n=o.get(A,!0,t)),void 0===n&&(n=qA(A,e,i)),"normal"===n&&e in ae&&(n=ae[e]),""===t||t?(a=parseFloat(n),!0===t||isFinite(a)?a||0:n):n}}),p.each(["height","width"],(function(A,e){p.cssHooks[e]={get:function(A,t,i){if(t)return!ie.test(p.css(A,"display"))||A.getClientRects().length&&A.getBoundingClientRect().width?se(A,e,i):ZA(A,ne,(function(){return se(A,e,i)}))},set:function(A,t,i){var n,a=WA(A),o=!C.scrollboxSize()&&"absolute"===a.position,r=(o||i)&&"border-box"===p.css(A,"boxSizing",!1,a),s=i?re(A,e,i,r,a):0;return r&&o&&(s-=Math.ceil(A["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(a[e])-re(A,e,"border",!1,a)-.5)),s&&(n=lA.exec(t))&&"px"!==(n[3]||"px")&&(A.style[e]=t,t=p.css(A,e)),oe(0,t,s)}}})),p.cssHooks.marginLeft=zA(C.reliableMarginLeft,(function(A,e){if(e)return(parseFloat(qA(A,"marginLeft"))||A.getBoundingClientRect().left-ZA(A,{marginLeft:0},(function(){return A.getBoundingClientRect().left})))+"px"})),p.each({margin:"",padding:"",border:"Width"},(function(A,e){p.cssHooks[A+e]={expand:function(t){for(var i=0,n={},a="string"==typeof t?t.split(" "):[t];i<4;i++)n[A+IA[i]+e]=a[i]||a[i-2]||a[0];return n}},"margin"!==A&&(p.cssHooks[A+e].set=oe)})),p.fn.extend({css:function(A,e){return z(this,(function(A,e,t){var i,n,a={},o=0;if(Array.isArray(e)){for(i=WA(A),n=e.length;o1)}}),p.Tween=ge,ge.prototype={constructor:ge,init:function(A,e,t,i,n,a){this.elem=A,this.prop=t,this.easing=n||p.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=a||(p.cssNumber[t]?"":"px")},cur:function(){var A=ge.propHooks[this.prop];return A&&A.get?A.get(this):ge.propHooks._default.get(this)},run:function(A){var e,t=ge.propHooks[this.prop];return this.options.duration?this.pos=e=p.easing[this.easing](A,this.options.duration*A,0,1,this.options.duration):this.pos=e=A,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),t&&t.set?t.set(this):ge.propHooks._default.set(this),this}},ge.prototype.init.prototype=ge.prototype,ge.propHooks={_default:{get:function(A){var e;return 1!==A.elem.nodeType||null!=A.elem[A.prop]&&null==A.elem.style[A.prop]?A.elem[A.prop]:(e=p.css(A.elem,A.prop,""))&&"auto"!==e?e:0},set:function(A){p.fx.step[A.prop]?p.fx.step[A.prop](A):1!==A.elem.nodeType||!p.cssHooks[A.prop]&&null==A.elem.style[te(A.prop)]?A.elem[A.prop]=A.now:p.style(A.elem,A.prop,A.now+A.unit)}}},ge.propHooks.scrollTop=ge.propHooks.scrollLeft={set:function(A){A.elem.nodeType&&A.elem.parentNode&&(A.elem[A.prop]=A.now)}},p.easing={linear:function(A){return A},swing:function(A){return.5-Math.cos(A*Math.PI)/2},_default:"swing"},p.fx=ge.prototype.init,p.fx.step={};var ce,le,Ie=/^(?:toggle|show|hide)$/,Ce=/queueHooks$/;function de(){le&&(!1===B.hidden&&A.requestAnimationFrame?A.requestAnimationFrame(de):A.setTimeout(de,p.fx.interval),p.fx.tick())}function he(){return A.setTimeout((function(){ce=void 0})),ce=Date.now()}function Be(A,e){var t,i=0,n={height:A};for(e=e?1:0;i<4;i+=2-e)n["margin"+(t=IA[i])]=n["padding"+t]=A;return e&&(n.opacity=n.width=A),n}function ue(A,e,t){for(var i,n=(Ee.tweeners[e]||[]).concat(Ee.tweeners["*"]),a=0,o=n.length;a1)},removeAttr:function(A){return this.each((function(){p.removeAttr(this,A)}))}}),p.extend({attr:function(A,e,t){var i,n,a=A.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===A.getAttribute?p.prop(A,e,t):(1===a&&p.isXMLDoc(A)||(n=p.attrHooks[e.toLowerCase()]||(p.expr.match.bool.test(e)?fe:void 0)),void 0!==t?null===t?void p.removeAttr(A,e):n&&"set"in n&&void 0!==(i=n.set(A,t,e))?i:(A.setAttribute(e,t+""),t):n&&"get"in n&&null!==(i=n.get(A,e))?i:null==(i=p.find.attr(A,e))?void 0:i)},attrHooks:{type:{set:function(A,e){if(!C.radioValue&&"radio"===e&&y(A,"input")){var t=A.value;return A.setAttribute("type",e),t&&(A.value=t),e}}}},removeAttr:function(A,e){var t,i=0,n=e&&e.match(V);if(n&&1===A.nodeType)for(;t=n[i++];)A.removeAttribute(t)}}),fe={set:function(A,e,t){return!1===e?p.removeAttr(A,t):A.setAttribute(t,t),t}},p.each(p.expr.match.bool.source.match(/\w+/g),(function(A,e){var t=Qe[e]||p.find.attr;Qe[e]=function(A,e,i){var n,a,o=e.toLowerCase();return i||(a=Qe[o],Qe[o]=n,n=null!=t(A,e,i)?o:null,Qe[o]=a),n}}));var xe=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;function me(A){return(A.match(V)||[]).join(" ")}function ye(A){return A.getAttribute&&A.getAttribute("class")||""}function _e(A){return Array.isArray(A)?A:"string"==typeof A&&A.match(V)||[]}p.fn.extend({prop:function(A,e){return z(this,p.prop,A,e,arguments.length>1)},removeProp:function(A){return this.each((function(){delete this[p.propFix[A]||A]}))}}),p.extend({prop:function(A,e,t){var i,n,a=A.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&p.isXMLDoc(A)||(e=p.propFix[e]||e,n=p.propHooks[e]),void 0!==t?n&&"set"in n&&void 0!==(i=n.set(A,t,e))?i:A[e]=t:n&&"get"in n&&null!==(i=n.get(A,e))?i:A[e]},propHooks:{tabIndex:{get:function(A){var e=p.find.attr(A,"tabindex");return e?parseInt(e,10):xe.test(A.nodeName)||pe.test(A.nodeName)&&A.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),C.optSelected||(p.propHooks.selected={get:function(A){var e=A.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(A){var e=A.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),p.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){p.propFix[this.toLowerCase()]=this})),p.fn.extend({addClass:function(A){var e,t,i,n,a,o;return d(A)?this.each((function(e){p(this).addClass(A.call(this,e,ye(this)))})):(e=_e(A)).length?this.each((function(){if(i=ye(this),t=1===this.nodeType&&" "+me(i)+" "){for(a=0;a-1;)t=t.replace(" "+n+" "," ");o=me(t),i!==o&&this.setAttribute("class",o)}})):this:this.attr("class","")},toggleClass:function(A,e){var t,i,n,a,o=typeof A,r="string"===o||Array.isArray(A);return d(A)?this.each((function(t){p(this).toggleClass(A.call(this,t,ye(this),e),e)})):"boolean"==typeof e&&r?e?this.addClass(A):this.removeClass(A):(t=_e(A),this.each((function(){if(r)for(a=p(this),n=0;n-1)return!0;return!1}});var Se=/\r/g;p.fn.extend({val:function(A){var e,t,i,n=this[0];return arguments.length?(i=d(A),this.each((function(t){var n;1===this.nodeType&&(null==(n=i?A.call(this,t,p(this).val()):A)?n="":"number"==typeof n?n+="":Array.isArray(n)&&(n=p.map(n,(function(A){return null==A?"":A+""}))),(e=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,n,"value")||(this.value=n))}))):n?(e=p.valHooks[n.type]||p.valHooks[n.nodeName.toLowerCase()])&&"get"in e&&void 0!==(t=e.get(n,"value"))?t:"string"==typeof(t=n.value)?t.replace(Se,""):null==t?"":t:void 0}}),p.extend({valHooks:{option:{get:function(A){var e=p.find.attr(A,"value");return null!=e?e:me(p.text(A))}},select:{get:function(A){var e,t,i,n=A.options,a=A.selectedIndex,o="select-one"===A.type,r=o?null:[],s=o?a+1:n.length;for(i=a<0?s:o?a:0;i-1)&&(t=!0);return t||(A.selectedIndex=-1),a}}}}),p.each(["radio","checkbox"],(function(){p.valHooks[this]={set:function(A,e){if(Array.isArray(e))return A.checked=p.inArray(p(A).val(),e)>-1}},C.checkOn||(p.valHooks[this].get=function(A){return null===A.getAttribute("value")?"on":A.value})}));var De=A.location,we={guid:Date.now()},ve=/\?/;p.parseXML=function(e){var t,i;if(!e||"string"!=typeof e)return null;try{t=(new A.DOMParser).parseFromString(e,"text/xml")}catch(A){}return i=t&&t.getElementsByTagName("parsererror")[0],t&&!i||p.error("Invalid XML: "+(i?p.map(i.childNodes,(function(A){return A.textContent})).join("\n"):e)),t};var be=/^(?:focusinfocus|focusoutblur)$/,Fe=function(A){A.stopPropagation()};p.extend(p.event,{trigger:function(e,t,i,n){var a,o,r,s,g,l,I,C,u=[i||B],E=c.call(e,"type")?e.type:e,f=c.call(e,"namespace")?e.namespace.split("."):[];if(o=C=r=i=i||B,3!==i.nodeType&&8!==i.nodeType&&!be.test(E+p.event.triggered)&&(E.indexOf(".")>-1&&(f=E.split("."),E=f.shift(),f.sort()),g=E.indexOf(":")<0&&"on"+E,(e=e[p.expando]?e:new p.Event(E,"object"==typeof e&&e)).isTrigger=n?2:3,e.namespace=f.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),t=null==t?[e]:p.makeArray(t,[e]),I=p.event.special[E]||{},n||!I.trigger||!1!==I.trigger.apply(i,t))){if(!n&&!I.noBubble&&!h(i)){for(s=I.delegateType||E,be.test(s+E)||(o=o.parentNode);o;o=o.parentNode)u.push(o),r=o;r===(i.ownerDocument||B)&&u.push(r.defaultView||r.parentWindow||A)}for(a=0;(o=u[a++])&&!e.isPropagationStopped();)C=o,e.type=a>1?s:I.bindType||E,(l=(aA.get(o,"events")||Object.create(null))[e.type]&&aA.get(o,"handle"))&&l.apply(o,t),(l=g&&o[g])&&l.apply&&iA(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=E,n||e.isDefaultPrevented()||I._default&&!1!==I._default.apply(u.pop(),t)||!iA(i)||g&&d(i[E])&&!h(i)&&((r=i[g])&&(i[g]=null),p.event.triggered=E,e.isPropagationStopped()&&C.addEventListener(E,Fe),i[E](),e.isPropagationStopped()&&C.removeEventListener(E,Fe),p.event.triggered=void 0,r&&(i[g]=r)),e.result}},simulate:function(A,e,t){var i=p.extend(new p.Event,t,{type:A,isSimulated:!0});p.event.trigger(i,null,e)}}),p.fn.extend({trigger:function(A,e){return this.each((function(){p.event.trigger(A,e,this)}))},triggerHandler:function(A,e){var t=this[0];if(t)return p.event.trigger(A,e,t,!0)}});var Re=/\[\]$/,ke=/\r?\n/g,Pe=/^(?:submit|button|image|reset|file)$/i,Ne=/^(?:input|select|textarea|keygen)/i;function Te(A,e,t,i){var n;if(Array.isArray(e))p.each(e,(function(e,n){t||Re.test(A)?i(A,n):Te(A+"["+("object"==typeof n&&null!=n?e:"")+"]",n,t,i)}));else if(t||"object"!==f(e))i(A,e);else for(n in e)Te(A+"["+n+"]",e[n],t,i)}p.param=function(A,e){var t,i=[],n=function(A,e){var t=d(e)?e():e;i[i.length]=encodeURIComponent(A)+"="+encodeURIComponent(null==t?"":t)};if(null==A)return"";if(Array.isArray(A)||A.jquery&&!p.isPlainObject(A))p.each(A,(function(){n(this.name,this.value)}));else for(t in A)Te(t,A[t],e,n);return i.join("&")},p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var A=p.prop(this,"elements");return A?p.makeArray(A):this})).filter((function(){var A=this.type;return this.name&&!p(this).is(":disabled")&&Ne.test(this.nodeName)&&!Pe.test(A)&&(this.checked||!mA.test(A))})).map((function(A,e){var t=p(this).val();return null==t?null:Array.isArray(t)?p.map(t,(function(A){return{name:e.name,value:A.replace(ke,"\r\n")}})):{name:e.name,value:t.replace(ke,"\r\n")}})).get()}});var Me=/%20/g,Le=/#.*$/,Ye=/([?&])_=[^&]*/,Ge=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,Je=/^\/\//,He={},Ke={},Ve="*/".concat("*"),Oe=B.createElement("a");function je(A){return function(e,t){"string"!=typeof e&&(t=e,e="*");var i,n=0,a=e.toLowerCase().match(V)||[];if(d(t))for(;i=a[n++];)"+"===i[0]?(i=i.slice(1)||"*",(A[i]=A[i]||[]).unshift(t)):(A[i]=A[i]||[]).push(t)}}function We(A,e,t,i){var n={},a=A===Ke;function o(r){var s;return n[r]=!0,p.each(A[r]||[],(function(A,r){var g=r(e,t,i);return"string"!=typeof g||a||n[g]?a?!(s=g):void 0:(e.dataTypes.unshift(g),o(g),!1)})),s}return o(e.dataTypes[0])||!n["*"]&&o("*")}function Ze(A,e){var t,i,n=p.ajaxSettings.flatOptions||{};for(t in e)void 0!==e[t]&&((n[t]?A:i||(i={}))[t]=e[t]);return i&&p.extend(!0,A,i),A}Oe.href=De.href,p.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:De.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(De.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":p.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(A,e){return e?Ze(Ze(A,p.ajaxSettings),e):Ze(p.ajaxSettings,A)},ajaxPrefilter:je(He),ajaxTransport:je(Ke),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,n,a,o,r,s,g,c,l,I,C=p.ajaxSetup({},t),d=C.context||C,h=C.context&&(d.nodeType||d.jquery)?p(d):p.event,u=p.Deferred(),E=p.Callbacks("once memory"),f=C.statusCode||{},Q={},x={},m="canceled",y={readyState:0,getResponseHeader:function(A){var e;if(g){if(!o)for(o={};e=Ge.exec(a);)o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=o[A.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return g?a:null},setRequestHeader:function(A,e){return null==g&&(A=x[A.toLowerCase()]=x[A.toLowerCase()]||A,Q[A]=e),this},overrideMimeType:function(A){return null==g&&(C.mimeType=A),this},statusCode:function(A){var e;if(A)if(g)y.always(A[y.status]);else for(e in A)f[e]=[f[e],A[e]];return this},abort:function(A){var e=A||m;return i&&i.abort(e),_(0,e),this}};if(u.promise(y),C.url=((e||C.url||De.href)+"").replace(Je,De.protocol+"//"),C.type=t.method||t.type||C.method||C.type,C.dataTypes=(C.dataType||"*").toLowerCase().match(V)||[""],null==C.crossDomain){s=B.createElement("a");try{s.href=C.url,s.href=s.href,C.crossDomain=Oe.protocol+"//"+Oe.host!=s.protocol+"//"+s.host}catch(A){C.crossDomain=!0}}if(C.data&&C.processData&&"string"!=typeof C.data&&(C.data=p.param(C.data,C.traditional)),We(He,C,t,y),g)return y;for(l in(c=p.event&&C.global)&&0==p.active++&&p.event.trigger("ajaxStart"),C.type=C.type.toUpperCase(),C.hasContent=!Ue.test(C.type),n=C.url.replace(Le,""),C.hasContent?C.data&&C.processData&&0===(C.contentType||"").indexOf("application/x-www-form-urlencoded")&&(C.data=C.data.replace(Me,"+")):(I=C.url.slice(n.length),C.data&&(C.processData||"string"==typeof C.data)&&(n+=(ve.test(n)?"&":"?")+C.data,delete C.data),!1===C.cache&&(n=n.replace(Ye,"$1"),I=(ve.test(n)?"&":"?")+"_="+we.guid+++I),C.url=n+I),C.ifModified&&(p.lastModified[n]&&y.setRequestHeader("If-Modified-Since",p.lastModified[n]),p.etag[n]&&y.setRequestHeader("If-None-Match",p.etag[n])),(C.data&&C.hasContent&&!1!==C.contentType||t.contentType)&&y.setRequestHeader("Content-Type",C.contentType),y.setRequestHeader("Accept",C.dataTypes[0]&&C.accepts[C.dataTypes[0]]?C.accepts[C.dataTypes[0]]+("*"!==C.dataTypes[0]?", "+Ve+"; q=0.01":""):C.accepts["*"]),C.headers)y.setRequestHeader(l,C.headers[l]);if(C.beforeSend&&(!1===C.beforeSend.call(d,y,C)||g))return y.abort();if(m="abort",E.add(C.complete),y.done(C.success),y.fail(C.error),i=We(Ke,C,t,y)){if(y.readyState=1,c&&h.trigger("ajaxSend",[y,C]),g)return y;C.async&&C.timeout>0&&(r=A.setTimeout((function(){y.abort("timeout")}),C.timeout));try{g=!1,i.send(Q,_)}catch(A){if(g)throw A;_(-1,A)}}else _(-1,"No Transport");function _(e,t,o,s){var l,I,B,Q,x,m=t;g||(g=!0,r&&A.clearTimeout(r),i=void 0,a=s||"",y.readyState=e>0?4:0,l=e>=200&&e<300||304===e,o&&(Q=function(A,e,t){for(var i,n,a,o,r=A.contents,s=A.dataTypes;"*"===s[0];)s.shift(),void 0===i&&(i=A.mimeType||e.getResponseHeader("Content-Type"));if(i)for(n in r)if(r[n]&&r[n].test(i)){s.unshift(n);break}if(s[0]in t)a=s[0];else{for(n in t){if(!s[0]||A.converters[n+" "+s[0]]){a=n;break}o||(o=n)}a=a||o}if(a)return a!==s[0]&&s.unshift(a),t[a]}(C,y,o)),!l&&p.inArray("script",C.dataTypes)>-1&&p.inArray("json",C.dataTypes)<0&&(C.converters["text script"]=function(){}),Q=function(A,e,t,i){var n,a,o,r,s,g={},c=A.dataTypes.slice();if(c[1])for(o in A.converters)g[o.toLowerCase()]=A.converters[o];for(a=c.shift();a;)if(A.responseFields[a]&&(t[A.responseFields[a]]=e),!s&&i&&A.dataFilter&&(e=A.dataFilter(e,A.dataType)),s=a,a=c.shift())if("*"===a)a=s;else if("*"!==s&&s!==a){if(!(o=g[s+" "+a]||g["* "+a]))for(n in g)if((r=n.split(" "))[1]===a&&(o=g[s+" "+r[0]]||g["* "+r[0]])){!0===o?o=g[n]:!0!==g[n]&&(a=r[0],c.unshift(r[1]));break}if(!0!==o)if(o&&A.throws)e=o(e);else try{e=o(e)}catch(A){return{state:"parsererror",error:o?A:"No conversion from "+s+" to "+a}}}return{state:"success",data:e}}(C,Q,y,l),l?(C.ifModified&&((x=y.getResponseHeader("Last-Modified"))&&(p.lastModified[n]=x),(x=y.getResponseHeader("etag"))&&(p.etag[n]=x)),204===e||"HEAD"===C.type?m="nocontent":304===e?m="notmodified":(m=Q.state,I=Q.data,l=!(B=Q.error))):(B=m,!e&&m||(m="error",e<0&&(e=0))),y.status=e,y.statusText=(t||m)+"",l?u.resolveWith(d,[I,m,y]):u.rejectWith(d,[y,m,B]),y.statusCode(f),f=void 0,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[y,C,l?I:B]),E.fireWith(d,[y,m]),c&&(h.trigger("ajaxComplete",[y,C]),--p.active||p.event.trigger("ajaxStop")))}return y},getJSON:function(A,e,t){return p.get(A,e,t,"json")},getScript:function(A,e){return p.get(A,void 0,e,"script")}}),p.each(["get","post"],(function(A,e){p[e]=function(A,t,i,n){return d(t)&&(n=n||i,i=t,t=void 0),p.ajax(p.extend({url:A,type:e,dataType:n,data:t,success:i},p.isPlainObject(A)&&A))}})),p.ajaxPrefilter((function(A){var e;for(e in A.headers)"content-type"===e.toLowerCase()&&(A.contentType=A.headers[e]||"")})),p._evalUrl=function(A,e,t){return p.ajax({url:A,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(A){p.globalEval(A,e,t)}})},p.fn.extend({wrapAll:function(A){var e;return this[0]&&(d(A)&&(A=A.call(this[0])),e=p(A,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var A=this;A.firstElementChild;)A=A.firstElementChild;return A})).append(this)),this},wrapInner:function(A){return d(A)?this.each((function(e){p(this).wrapInner(A.call(this,e))})):this.each((function(){var e=p(this),t=e.contents();t.length?t.wrapAll(A):e.append(A)}))},wrap:function(A){var e=d(A);return this.each((function(t){p(this).wrapAll(e?A.call(this,t):A)}))},unwrap:function(A){return this.parent(A).not("body").each((function(){p(this).replaceWith(this.childNodes)})),this}}),p.expr.pseudos.hidden=function(A){return!p.expr.pseudos.visible(A)},p.expr.pseudos.visible=function(A){return!!(A.offsetWidth||A.offsetHeight||A.getClientRects().length)},p.ajaxSettings.xhr=function(){try{return new A.XMLHttpRequest}catch(A){}};var Xe={0:200,1223:204},qe=p.ajaxSettings.xhr();C.cors=!!qe&&"withCredentials"in qe,C.ajax=qe=!!qe,p.ajaxTransport((function(e){var t,i;if(C.cors||qe&&!e.crossDomain)return{send:function(n,a){var o,r=e.xhr();if(r.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)r[o]=e.xhrFields[o];for(o in e.mimeType&&r.overrideMimeType&&r.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)r.setRequestHeader(o,n[o]);t=function(A){return function(){t&&(t=i=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===A?r.abort():"error"===A?"number"!=typeof r.status?a(0,"error"):a(r.status,r.statusText):a(Xe[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=t(),i=r.onerror=r.ontimeout=t("error"),void 0!==r.onabort?r.onabort=i:r.onreadystatechange=function(){4===r.readyState&&A.setTimeout((function(){t&&i()}))},t=t("abort");try{r.send(e.hasContent&&e.data||null)}catch(A){if(t)throw A}},abort:function(){t&&t()}}})),p.ajaxPrefilter((function(A){A.crossDomain&&(A.contents.script=!1)})),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(A){return p.globalEval(A),A}}}),p.ajaxPrefilter("script",(function(A){void 0===A.cache&&(A.cache=!1),A.crossDomain&&(A.type="GET")})),p.ajaxTransport("script",(function(A){var e,t;if(A.crossDomain||A.scriptAttrs)return{send:function(i,n){e=p("