/* * ezuikit.js v8.1.9 * ezuikit javascript for npm * Copyright (c) 2025-04-17 Ezviz-OpenBiz * Released under the MIT 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";var A=function(){function A(A,e){this.coreX=A,this.coreY=e}return A.prototype.toString=function(){return this.coreX+"-"+this.coreY},A}();function e(A){return A&&"undefined"!=typeof Symbol&&A.constructor===Symbol?"symbol":typeof A}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 t=function(A,e,t,i){var n=document.getElementsByTagName("head")[0].getElementsByTagName("script"),a=!1;if(t)a=t();else for(var r=0;r3){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 I=function(A,t,i,n,a,r){var o=A,s=new XMLHttpRequest;s.onreadystatechange=function(){if(4==s.readyState&&200==s.status)if(function(A){if("string"==typeof A)try{var t=JSON.parse(A);return!("object"!==(void 0===t?"undefined":e(t))||!t)}catch(A){return!1}}(s.responseText)){var A=JSON.parse(s.responseText);a(A)}else a(s.responseText)},s.open(t,o,!0);var g=new FormData;for(var l in i)g.append(l,i[l]);if(n&&"object"===(void 0===n?"undefined":e(n)))for(var l in n)s.setRequestHeader(l,n[l]);s.send(g)},C=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)},h=function(){function A(A,e){var i=this;t("https://open.ys7.com/assets/ezuikit_v3.4/js/hls.js",(function(){window.Hls.isSupported()&&i.initHLS(A,e)}),(function(){return!!window.Hls}))}var e=A.prototype;return e.toString=function(){return"hls "+this.coreX+"-"+this.coreY},e.initHLS=function(A,e){var t=d(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),r=new window.Hls({defaultAudioCodec:"mp4a.40.2"});r.loadSource(e),r.attachMedia(a),r.on(window.Hls.Events.MANIFEST_PARSED,(function(){a.play()})),r.on(window.Hls.Events.ERROR,(function(A,e){if(e.fatal)switch(e.type){case window.Hls.ErrorTypes.NETWORK_ERROR:r.startLoad();break;case window.Hls.ErrorTypes.MEDIA_ERROR:r.recoverMediaError();break;default:r.destroy()}})),this.hls=r,this.video=a,this.hlsUrl=e},e.play=function(){this.hls.startLoad(),this.video.play()},e.stop=function(){this.video.pause(),this.hls.stopLoad()},A}(),u="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 E,f={exports:{}};var Q=(E||(E=1,function(A,e){function t(A,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](A):A instanceof e}function i(A){return A&&"undefined"!=typeof Symbol&&A.constructor===Symbol?"symbol":typeof A}!function(t,n){"object"==i(e)&&"object"==i(A)?A.exports=n():"object"==i(e)?e.flvjs=n():t.flvjs=n()}(globalThis,(function(){return function(){var A={343:function(A){var e=function(){},t=function(A,e,t){this.fn=A,this.context=e,this.once=t||!1},i=function(A,e,i,n,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var r=new t(i,n||A,a),s=o?o+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},n=function(A,t){0==--A._eventsCount?A._events=new e:delete A._events[t]},a=function(){this._events=new e,this._eventsCount=0},r=Object.prototype.hasOwnProperty,o="~";Object.create&&(e.prototype=Object.create(null),(new e).__proto__||(o=!1)),a.prototype.eventNames=function(){var A,e,t=[];if(0===this._eventsCount)return t;for(e in A=this._events)r.call(A,e)&&t.push(o?e.slice(1):e);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(A)):t},a.prototype.listeners=function(A){var e=o?o+A:A,t=this._events[e];if(!t)return[];if(t.fn)return[t.fn];for(var i=0,n=t.length,a=new Array(n);i=A[n]&&e0&&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&&(r=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,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:function(A,e,n){var a=function(A,e,t){var i=A;if(e+t=128){e.push(String.fromCharCode(65535&r)),i+=2;continue}}else if(t[i]<240){if(a(t,i,2)&&(r=(15&t[i])<<12|(63&t[i+1])<<6|63&t[i+2])>=2048&&55296!=(63488&r)){e.push(String.fromCharCode(65535&r)),i+=3;continue}}else if(t[i]<248){var r;if(a(t,i,3)&&(r=(7&t[i])<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3])>65536&&r<1114112){r-=65536,e.push(String.fromCharCode(r>>>10|55296)),e.push(String.fromCharCode(1023&r|56320)),i+=4;continue}}e.push(String.fromCharCode(65533)),++i}return e.join("")},u=n(713),B=(g=new ArrayBuffer(2),new DataView(g).setInt16(0,256,!0),256===new Int16Array(g)[0]),E=function(){function A(){}return A.parseScriptData=function(e,t,i){var n={};try{var a=A.parseValue(e,t,i),r=A.parseValue(e,t+a.size,i-a.size);n[a.data]=r.data}catch(A){d.A.e("AMF",A.toString())}return n},A.parseObject=function(e,t,i){if(i<3)throw new u.j4("Data not enough when parse ScriptDataObject");var n=A.parseString(e,t,i),a=A.parseValue(e,t+n.size,i-n.size),r=a.objectEnd;return{data:{name:n.data,value:a.data},size:n.size+a.size,objectEnd:r}},A.parseVariable=function(e,t,i){return A.parseObject(e,t,i)},A.parseString=function(A,e,t){if(t<2)throw new u.j4("Data not enough when parse String");var i=new DataView(A,e,t).getUint16(0,!B);return{data:i>0?h(new Uint8Array(A,e+2,i)):"",size:2+i}},A.parseLongString=function(A,e,t){if(t<4)throw new u.j4("Data not enough when parse LongString");var i=new DataView(A,e,t).getUint32(0,!B);return{data:i>0?h(new Uint8Array(A,e+4,i)):"",size:4+i}},A.parseDate=function(A,e,t){if(t<10)throw new u.j4("Data size invalid when parse Date");var i=new DataView(A,e,t),n=i.getFloat64(0,!B),a=i.getInt16(8,!B);return{data:new Date(n+=60*a*1e3),size:10}},A.parseValue=function(e,t,i){if(i<1)throw new u.j4("Data not enough when parse Value");var n,a=new DataView(e,t,i),r=1,o=a.getUint8(0),s=!1;try{switch(o){case 0:n=a.getFloat64(1,!B),r+=8;break;case 1:n=!!a.getUint8(1),r+=1;break;case 2:var g=A.parseString(e,t+1,i-1);n=g.data,r+=g.size;break;case 3:n={};var l=0;for(9==(16777215&a.getUint32(i-4,!B))&&(l=3);r32)throw new u.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}(),Q=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 r=A._ebsp2rbsp(e),o=new f(r);o.readByte();var s=o.readByte();o.readByte();var g=o.readByte();o.readUEG();var l=A.getProfileString(s),c=A.getLevelString(g),d=1,I=420,C=8,h=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===(d=o.readUEG())&&o.readBits(1),d<=3&&(I=[0,420,422,444][d]),C=o.readUEG()+8,h=o.readUEG()+8,o.readBits(1),o.readBool()))for(var u=3!==d?8:12,B=0;B0&&N<16?(w=[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&&(w=o.readByte()<<8|o.readByte(),b=o.readByte()<<8|o.readByte())}if(o.readBool()&&o.readBool(),o.readBool()&&(o.readBits(4),o.readBool()&&o.readBits(24)),o.readBool()&&(o.readUEG(),o.readUEG()),o.readBool()){var T=o.readBits(32),M=o.readBits(32);R=o.readBool(),F=(k=M)/(P=2*T)}}var L=1;1===w&&1===b||(L=w/b);var G=0,Y=0;0===d?(G=1,Y=2-y):(G=3===d?1:2,Y=(1===d?2:1)*(2-y));var U=16*(p+1),J=16*(m+1)*(2-y);U-=(_+S)*G,J-=(D+v)*Y;var H=Math.ceil(U*L);return o.destroy(),o=null,{codec_mimetype:i,profile_idc:s,level_idc:g,profile_string:l,level_string:c,chroma_format_idc:d,bit_depth:C,bit_depth_luma:C,bit_depth_chroma:h,ref_frames:x,chroma_format:I,chroma_format_string:A.getChromaFormatString(I),frame_rate:{fixed:R,fps:F,fps_den:P,fps_num:k},sar_ratio:{width:w,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 f(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 f(t);i.readByte(),i.readByte();for(var n=0,a=0,r=0,o=0,s=(i.readBits(4),i.readBits(3)),g=(i.readBool(),i.readBits(2)),l=i.readBool(),c=i.readBits(5),d=i.readByte(),I=i.readByte(),C=i.readByte(),h=i.readByte(),u=i.readByte(),B=i.readByte(),E=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(Y=0;Y>3,a=!!(4&e[i]),r=!!(2&e[i]);e[i],i+=1,a&&(i+=1);var o=Number.POSITIVE_INFINITY;if(r){o=0;for(var s=0;o|=(127&e[i])<<7*s,128&e[i+=1];s++);}1===n&&(t=A.parseSeuqneceHeader(e.subarray(i,i+o))),i+=o}return t},A.parseSeuqneceHeader=function(e){var t=new f(e),i=t.readBits(3),n=(t.readBool(),t.readBool()),a=!0,r=0,o=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),l=t.readBits(32),c=t.readBool();if(c){for(var d=0;0===t.readBits(1);)d+=1;d>=32||t.readBits(d)}r=l,o=g,a=c,t.readBool()&&(t.readBits(5),t.readBits(32),t.readBits(5),t.readBits(5))}for(var I=t.readBool(),C=t.readBits(5),h=0;h<=C;h++){var u=t.readBits(12),B=t.readBits(5),E=B>7?t.readBits(1):0;s.push({operating_point_idc:u,level:B,tier:E}),I&&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 v=!1;n||(t.readBool(),t.readBool(),t.readBool(),t.readBool(),(v=t.readBool())&&(t.readBool(),t.readBool()),(t.readBool()||t.readBits(1))&&(t.readBool()||t.readBits(1)),v&&t.readBits(3)),t.readBool(),t.readBool(),t.readBool();var w=t.readBool(),b=8;b=2===i&&w?t.readBool()?12:10:w?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:r/o,fps_den:o,fps_num:r},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}(),_=function(){function A(A,e){var t;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 C.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=(t=new ArrayBuffer(2),new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[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]),r=(i=e)[5]<<24|i[6]<<16|i[7]<<8|i[8];return r<9?t:{match:!0,consumed:r,dataOffset:r,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 C.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,n;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new u.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var a=0,r=this._littleEndian;if(0===t){if(!(e.byteLength>13))return 0;var o=A.probe(e);a=(null==o?void 0:o.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,t+a!==this._dataOffset&&d.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(s=new DataView(e,a)).getUint32(0,!r)&&d.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),a+=4);ae.byteLength)break;var g=s.getUint8(0),l=16777215&s.getUint32(0,!r);if(a+11+l+4>e.byteLength)break;if(8===g||9===g||18===g){var c=s.getUint8(4),I=s.getUint8(5),C=s.getUint8(6)|I<<8|c<<16|s.getUint8(7)<<24;16777215&s.getUint32(7,!r)&&d.A.w(this.TAG,"Meet tag which has StreamID != 0!");var h=a+11;switch(g){case 8:this._parseAudioData(e,h,l,C);break;case 9:this._parseVideoData(e,h,l,C,t+a);break;case 18:this._parseScriptData(e,h,l)}var B=s.getUint32(11+l,!r);B!==11+l&&d.A.w(this.TAG,"Invalid PrevTagSize ".concat(B)),a+=11+l+4}else d.A.w(this.TAG,"Unsupported tag type ".concat(g,", skipped")),a+=11+l+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(i=this._audioTrack)||void 0===i?void 0:i.length)||(null===(n=this._videoTrack)||void 0===n?void 0:n.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),a},A.prototype._parseScriptData=function(A,e,t){var n,a,r,o=E.parseScriptData(A,e,t);if(o.hasOwnProperty("onMetaData")){if(null==o.onMetaData||"object"!=i(o.onMetaData))return void d.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&d.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=o;var s=null===(n=this._metadata)||void 0===n?void 0:n.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 l=Math.floor(1e3*s.framerate);if(l>0){var c=l/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=c,this._referenceFrameRate.fps_num=l,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=c)}}if("object"==i(null==s?void 0:s.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var I=s.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(I)),s.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=s),d.A.v(this.TAG,"Parsed onMetaData"),(null===(a=this._mediaInfo)||void 0===a?void 0:a.isComplete())&&(null===(r=this._onMediaInfo)||void 0===r||r.call(this,this._mediaInfo))}Object.keys(o).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},o))},A.prototype._parseKeyframesIndex=function(A){for(var e=[],t=[],i=1;i>>4;if(2===u||10===u){var B=0,E=(12&h)>>>2;if(E>=0&&E<=4){B=this._flvSoundRateTable[E];var f=1&h,Q=this._audioMetadata,p=this._audioTrack;if(Q||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(Q=this._audioMetadata={}).type="audio",Q.id=null==p?void 0:p.id,Q.timescale=this._timescale,Q.duration=this._duration,Q.audioSampleRate=B,Q.channelCount=0===f?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==Q?void 0:Q.config){if(m(y.data.config,null==Q?void 0:Q.config))return;d.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var _=y.data;Q.audioSampleRate=null==_?void 0:_.samplingRate,Q.channelCount=null==_?void 0:_.channelCount,Q.codec=null==_?void 0:_.codec,Q.originalCodec=null==_?void 0:_.originalCodec,Q.config=null==_?void 0:_.config,Q.refSampleDuration=1024/Q.audioSampleRate*Q.timescale,d.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(r=this._audioTrack)||void 0===r?void 0:r.length)||(null===(o=this._videoTrack)||void 0===o?void 0:o.length))&&(null===(s=this._onDataAvailable)||void 0===s||s.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(g=this._onTrackMetadata)||void 0===g||g.call(this,"audio",Q),(v=this._mediaInfo).audioCodec=Q.originalCodec||"",v.audioSampleRate=Q.audioSampleRate,v.audioChannelCount=Q.channelCount,v.hasVideo?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',(null==v?void 0:v.isComplete())&&(null===(l=this._onMediaInfo)||void 0===l||l.call(this,v))}else if(1===y.packetType){var S=this._timestampBase+i,D={unit:y.data,length:y.data.byteLength,dts:S,pts:S};p&&(null==p||p.samples.push(D),p.length+=(null===(c=null==y?void 0:y.data)||void 0===c?void 0:c.length)||0)}else d.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(y.packetType))}else if(2===u){if(!Q.codec){var v;if(void 0===(_=this._parseMP3AudioData(A,e+1,t-1,!0)))return;Q.audioSampleRate=_.samplingRate,Q.channelCount=_.channelCount,Q.codec=_.codec,Q.originalCodec=_.originalCodec,Q.refSampleDuration=1152/Q.audioSampleRate*Q.timescale,d.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(I=this._onTrackMetadata)||void 0===I||I.call(this,"audio",Q),(v=this._mediaInfo).audioCodec=Q.codec,v.audioSampleRate=Q.audioSampleRate,v.audioChannelCount=Q.channelCount,v.audioDataRate=_.bitRate,(null==v?void 0:v.hasVideo)?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',v.isComplete()&&(null===(C=this._onMediaInfo)||void 0===C||C.call(this,v))}var w=this._parseMP3AudioData(A,e+1,t-1,!1);if(void 0===w)return;S=this._timestampBase+i;var b={unit:w,length:w.byteLength,dts:S,pts:S};null==p||p.samples.push(b),p&&(p.length+=w.length)}}else null===(a=this._onError)||void 0===a||a.call(this,x.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+E)}else null===(n=this._onError)||void 0===n||n.call(this,x.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+u)}},A.prototype._parseAACAudioData=function(A,e,t){if(!(t<=1)){var i={},n=new Uint8Array(A,e,t);return i.packetType=n[0],0===n[0]?i.data=this._parseAACAudioSpecificConfig(A,e+1,t-1):i.data=n.subarray(1),i}d.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},A.prototype._parseAACAudioSpecificConfig=function(A,e,t){var i,n,a,r,o=new Uint8Array(A,e,t),s=null,g=0,l=null;if(g=a=o[0]>>>3,(r=(7&o[0])<<1|o[1]>>>7)<0||r>=this._mpegSamplingRates.length)null===(i=this._onError)||void 0===i||i.call(this,x.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var c=this._mpegSamplingRates[r],d=(120&o[1])>>>3;if(!(d<0||d>=8)){5===g&&(l=(7&o[1])<<1|o[2]>>>7,o[2]);var I=self.navigator.userAgent.toLowerCase();return I.includes("firefox")?r>=6?(g=5,s=new Array(4),l=r-3):(g=2,s=new Array(2),l=r):I.includes("android")?(g=2,s=new Array(2),l=r):(g=5,l=r,s=new Array(4),r>=6?l=r-3:1===d&&(g=2,s=new Array(2),l=r)),s[0]=g<<3,s[0]|=(15&r)>>>1,s[1]=(15&r)<<7,s[1]|=(15&d)<<3,5===g&&(s[1]|=(15&l)>>>1,s[2]=(1&l)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:c,channelCount:d,codec:"mp4a.40."+g,originalCodec:"mp4a.40."+a}}null===(n=this._onError)||void 0===n||n.call(this,x.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},A.prototype._parseMP3AudioData=function(A,e,t,i){if(!(t<4)){this._littleEndian;var n,a=new Uint8Array(A,e,t);if(i){if(255!==a[0])return;var r=a[1]>>>3&3,o=(6&a[1])>>1,s=(240&a[2])>>>4,g=(12&a[2])>>>2,l=3&~(a[3]>>>6)?2:1,c=0,I=0;switch(r){case 0:c=this._mpegAudioV25SampleRateTable[g];break;case 2:c=this._mpegAudioV20SampleRateTable[g];break;case 3:c=this._mpegAudioV10SampleRateTable[g]}switch(o){case 1:s>>4;if(128&o){var g=15&o,l=String.fromCharCode.apply(String,function(A,e,t){if(2===arguments.length)for(var i,n=0,a=e.length;n0)&&!(i=a.next()).done;)r.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 r}(new Uint8Array(A,e,t).slice(1,5)),!1));"hvc1"===l?this._parseEnhancedHEVCVideoPacket(A,e+5,t-5,i,n,s,g):"av01"===l?this._parseEnhancedAV1VideoPacket(A,e+5,t-5,i,n,s,g):null===(r=this._onError)||void 0===r||r.call(this,x.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(l))}else{var c=15&o;7===c?this._parseAVCVideoPacket(A,e+1,t-1,i,n,s):12===c?this._parseHEVCVideoPacket(A,e+1,t-1,i,n,s):null===(a=this._onError)||void 0===a||a.call(this,x.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(c))}}},A.prototype._parseAVCVideoPacket=function(A,e,t,i,n,a){var r;if(t<4)d.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var o=this._littleEndian,s=new DataView(A,e,t),g=s.getUint8(0),l=(16777215&s.getUint32(0,!o))<<8>>8;0===g?this._parseAVCDecoderConfigurationRecord(A,e+4,t-4):1===g?this._parseAVCVideoData(A,e+4,t-4,i,n,a,l):2===g||null===(r=this._onError)||void 0===r||r.call(this,x.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(g))}},A.prototype._parseHEVCVideoPacket=function(A,e,t,i,n,a){var r;if(t<4)d.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var o=this._littleEndian,s=new DataView(A,e,t),g=s.getUint8(0),l=(16777215&s.getUint32(0,!o))<<8>>8;0===g?this._parseHEVCDecoderConfigurationRecord(A,e+4,t-4):1===g?this._parseHEVCVideoData(A,e+4,t-4,i,n,a,l):2===g||null===(r=this._onError)||void 0===r||r.call(this,x.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(g))}},A.prototype._parseEnhancedHEVCVideoPacket=function(A,e,t,i,n,a,r){var o,s=this._littleEndian,g=new DataView(A,e,t);if(0===r)this._parseHEVCDecoderConfigurationRecord(A,e,t);else if(1===r){var l=(4294967040&g.getUint32(0,!s))>>8;this._parseHEVCVideoData(A,e+3,t-3,i,n,a,l)}else 3===r?this._parseHEVCVideoData(A,e,t,i,n,a,0):2===r||null===(o=this._onError)||void 0===o||o.call(this,x.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(r))},A.prototype._parseEnhancedAV1VideoPacket=function(A,e,t,i,n,a,r){var o,s;this._littleEndian,0===r?this._parseAV1CodecConfigurationRecord(A,e,t):1===r?this._parseAV1VideoData(A,e,t,i,n,a,0):5===r?null===(o=this._onError)||void 0===o||o.call(this,x.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(r)):2===r||null===(s=this._onError)||void 0===s||s.call(this,x.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(r))},A.prototype._parseAVCDecoderConfigurationRecord=function(A,e,t){var i,n,a,r,o,s,g,l,c,I,C;if(t<7)d.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var h=this._videoMetadata,u=this._videoTrack,B=this._littleEndian,E=new DataView(A,e,t);if(h){if(void 0!==h.avcc){var f=new Uint8Array(A,e,t);if(m(f,h.avcc))return;d.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)),(h=this._videoMetadata={}).type="video",h.id=null==u?void 0:u.id,h.timescale=this._timescale,h.duration=this._duration;var p=E.getUint8(0),y=E.getUint8(1);if(E.getUint8(2),E.getUint8(3),1===p&&0!==y)if(this._naluLengthSize=1+(3&E.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var _=31&E.getUint8(5);if(0!==_){_>1&&d.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(_));for(var S=6,D=0;D<_;D++){var v=E.getUint16(S,!B);if(S+=2,0!==v){var w=new Uint8Array(A,e+S,v);S+=v;var b=Q.parseSPS(w);if(0===D){h.codecWidth=b.codec_size.width,h.codecHeight=b.codec_size.height,h.presentWidth=b.present_size.width,h.presentHeight=b.present_size.height,h.profile=b.profile_string,h.level=b.level_string,h.bitDepth=b.bit_depth,h.chromaFormat=b.chroma_format,h.sarRatio=b.sar_ratio,h.frameRate=b.frame_rate,b.frame_rate.fixed&&0!==b.frame_rate.fps_num&&0!==b.frame_rate.fps_den||(h.frameRate=this._referenceFrameRate);var F=null===(r=h.frameRate)||void 0===r?void 0:r.fps_den,R=null===(o=h.frameRate)||void 0===o?void 0:o.fps_num;h.refSampleDuration=h.timescale*(F/R);for(var k=w.subarray(1,4),P="avc1.",N=0;N<3;N++){var T=k[N].toString(16);T.length<2&&(T="0"+T),P+=T}h.codec=P;var M=this._mediaInfo;M.width=h.codecWidth,M.height=h.codecHeight,M.fps=h.frameRate.fps,M.profile=h.profile,M.level=h.level,M.refFrames=b.ref_frames,M.chromaFormat=b.chroma_format_string,M.sarNum=h.sarRatio.width,M.sarDen=h.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===(s=this._onMediaInfo)||void 0===s||s.call(this,M))}}}var L=E.getUint8(S);if(0!==L){for(L>1&&d.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(L)),S++,D=0;D=t){d.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(C,", offset = ").concat(c,", dataSize = ").concat(t));break}var u=s.getUint32(c,!o);if(3===I&&(u>>>=8),u>t-I)return void d.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(C,", NaluSize > DataSize!"));var B=31&s.getUint8(c+I);5===B&&(h=!0);var E=new Uint8Array(A,e+c,I+u),f={type:B,data:E};g.push(f),l+=E.byteLength,c+=I+u}if(g.length){var Q=this._videoTrack,x={units:g,length:l,isKeyframe:h,dts:C,cts:r,pts:C+r};h&&(x.fileposition=n),Q&&(Q.samples.push(x),Q.length+=l)}},A.prototype._parseHEVCVideoData=function(A,e,t,i,n,a,r){for(var o=this._littleEndian,s=new DataView(A,e,t),g=[],l=0,c=0,I=this._naluLengthSize,C=this._timestampBase+i,h=1===a;c=t){d.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(C,", offset = ").concat(c,", dataSize = ").concat(t));break}var u=s.getUint32(c,!o);if(3===I&&(u>>>=8),u>t-I)return void d.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(C,", NaluSize > DataSize!"));var B=31&s.getUint8(c+I);19!==B&&20!==B||(h=!0);var E=new Uint8Array(A,e+c,I+u),f={type:B,data:E};g.push(f),l+=E.byteLength,c+=I+u}if(g.length){var Q=this._videoTrack,x={units:g,length:l,isKeyframe:h,dts:C,cts:r,pts:C+r};h&&(x.fileposition=n),Q&&(null==Q||Q.samples.push(x),Q.length+=l)}},A.prototype._parseAV1VideoData=function(A,e,t,i,n,a,r){this._littleEndian;var o,s=[],g=this._timestampBase+i,l=1===a;if(o=t,s.push({unitType:0,data:new Uint8Array(A,e+0,t)}),s.length){var c=this._videoTrack,d={units:s,length:o,isKeyframe:l,dts:g,cts:r,pts:g+r};l&&(d.fileposition=n),c&&(null==c||c.samples.push(d),c.length+=o)}},A}(),S=_,D=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}(),v=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"}(l||(l={}));var w,b=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={}},F=function(){},R=function(){},k=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"}(w||(w={}));var P,N,T=function(){},M=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)},L=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_&&d.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>=w.kReserved0)&&0===n){var r=A.subarray(t,a);(e=new T).type=i,e.data=r}}return e},A}(),G=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 r=A.byteLength;a[6]=r>>>8,a[7]=255&r;var o=8;a.set(A,8),a[o+=r]=1;var s=e.byteLength;a[o+1]=s>>>8,a[o+2]=255&s,a.set(e,o+3),o+=3+s,n&&(a[o]=252|t.chroma_format_idc,a[o+1]=248|t.bit_depth_luma-8,a[o+2]=248|t.bit_depth_chroma-8,a[o+3]=0,o+=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"}(P||(P={})),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"}(N||(N={}));var Y,U,J=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],H=(Y=function(A,e){return Y=Object.setPrototypeOf||t({__proto__:[]},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])},Y(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}Y(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),K=function(){},V=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return H(e,A),e}(K),O=function(){function A(A){this.TAG="AACADTSParser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&d.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],r=(192&A[t+2])>>>6,o=(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 l=1===a?7:9,c=g-l;t+=l;var d=this.findNextSyncwordOffset(t+c);if(this.current_syncword_offset_=d,(0===i||1===i)&&0===n){var I=A.subarray(t,t+c);(e=new K).audio_object_type=r+1,e.sampling_freq_index=o,e.sampling_frequency=J[o],e.channel_config=s,e.data=I}}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}(),j=function(){function A(A){this.TAG="AACLOASParser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&d.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_,n=(31&e[i+1])<<8|e[i+2];if(i+3+n>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var a=new f(e.subarray(i+3,i+3+n)),r=null;if(a.readBool()){if(null==A){d.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(i+3+n),a.destroy();continue}r=A}else{var o=a.readBool();if(o&&a.readBool()){d.A.e(this.TAG,"audioMuxVersionA is Not Supported"),a.destroy();break}if(o&&this.getLATMValue(a),!a.readBool()){d.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),a.destroy();break}if(0!==a.readBits(6)){d.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),a.destroy();break}if(0!==a.readBits(4)){d.A.e(this.TAG,"more than 2 numProgram Not Supported"),a.destroy();break}if(0!==a.readBits(3)){d.A.e(this.TAG,"more than 2 numLayer Not Supported"),a.destroy();break}var s=o?this.getLATMValue(a):0,g=a.readBits(5);s-=5;var l=a.readBits(4);s-=4;var c=a.readBits(4);s-=4,a.readBits(3),(s-=3)>0&&a.readBits(s);var I=a.readBits(3);if(0!==I){d.A.e(this.TAG,"frameLengthType = ".concat(I,". Only frameLengthType = 0 Supported")),a.destroy();break}a.readByte();var C=a.readBool();if(C)if(o)this.getLATMValue(a);else for(;;){var h=a.readBool();if(a.readByte(),!h)break}a.readBool()&&a.readByte(),(r=new V).audio_object_type=g,r.sampling_freq_index=l,r.sampling_frequency=J[r.sampling_freq_index],r.channel_config=c,r.other_data_present=C}for(var u=0;;){var B=a.readByte();if(u+=B,255!==B)break}for(var E=new Uint8Array(u),Q=0;Q=6?(i=5,e=new Array(4),r=n-3):(i=2,e=new Array(2),r=n):o.includes("android")?(i=2,e=new Array(2),r=n):(i=5,r=n,e=new Array(4),n>=6?r=n-3:1===a&&(i=2,e=new Array(2),r=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&r)>>>1,e[2]=(1&r)<<7,e[2]|=8,e[3]=0),this.config=e,this.sampling_rate=J[n],this.channel_count=a,this.codec_mimetype="mp4a.40."+i.toString(),this.original_codec_mimetype="mp4a.40."+t.toString()},Z=function(){},X=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"}(U||(U={}));var q,z=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})},$=function(A){var e=A.readBool();return A.readBits(6),{auto_return:e,duration:4*A.readBits(31)+A.readBits(2)}},AA=function(A,e){var t=e.readBits(8);return A?{component_tag:t}:{component_tag:t,splice_time:z(e)}},eA=function(A){return{component_tag:A.readBits(8),utc_splice_time:A.readBits(32)}},tA=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 r=A.subarray(t,a);(e=new lA).type=i,e.data=r}}return e},A}(),IA=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|q.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|q.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|q.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}(),CA=function(){},hA=function(){},uA=function(){},BA=[[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]],EA=function(){function A(A){this.TAG="AC3Parser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&d.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],r=2*BA[i][a];if(t+r>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var o=this.findNextSyncwordOffset(t+r);this.current_syncword_offset_=o;var s=A[t+5]>>3,g=7&A[t+5],l=A[t+6]>>5,c=0;1&l&&1!==l&&(c+=2),4&l&&(c+=2),2===l&&(c+=2);var d=(A[t+6]<<8|A[t+7])>>12-c&1,I=[2,1,2,3,3,4,4,5][l]+d;(e=new uA).sampling_frequency=n,e.channel_count=I,e.channel_mode=l,e.bit_stream_identification=s,e.low_frequency_effects_channel_on=d,e.bit_stream_mode=g,e.frame_size_code=a,e.data=A.subarray(t,t+r)}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}(),fA=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"},QA=function(){},xA=function(){function A(A){this.TAG="EAC3Parser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&d.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 f(A.subarray(t+2)),n=(i.readBits(2),i.readBits(3),i.readBits(11)+1<<1),a=i.readBits(2),r=null,o=null;3===a?(r=[24e3,22060,16e3][a=i.readBits(2)],o=3):(r=[48e3,44100,32e3][a],o=i.readBits(2));var s=i.readBits(3),g=i.readBits(1),l=i.readBits(5);if(t+n>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=this.findNextSyncwordOffset(t+n);this.current_syncword_offset_=c;var d=[2,1,2,3,3,4,4,5][s]+g;i.destroy(),(e=new QA).sampling_frequency=r,e.channel_count=d,e.channel_mode=s,e.bit_stream_identification=l,e.low_frequency_effects_channel_on=g,e.frame_size=n,e.num_blks=[1,2,3,6][o],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}(),pA=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"},mA=function(){var A=function(e,i){return A=Object.setPrototypeOf||t({__proto__:[]},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,i)};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)}}(),yA=function(){return yA=Object.assign||function(A){for(var e,t=1,i=arguments.length;t0)&&!(i=a.next()).done;)r.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 r},SA=function(A,e,t){if(2===arguments.length)for(var i,n=0,a=e.length;n=4?(d.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),t-=4):204===i&&d.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 C.A},e.prototype.parseChunks=function(A,e){var t;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new u.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 n=e+i;192===this.ts_packet_size_&&(i+=4);var a=new Uint8Array(A,i,188),r=a[0];if(71!==r){d.A.e(this.TAG,"sync_byte = ".concat(r,", not 0x47"));break}var o=(64&a[1])>>>6,s=(a[1],(31&a[1])<<8|a[2]),g=(48&a[3])>>>4,c=15&a[3],I={},C=4;if(2===g||3===g){var h=a[4];if(5+h===188){i+=188,204===this.ts_packet_size_&&(i+=16);continue}h>0&&(I=this.parseAdaptationField(A,i+4,1+h)),C=5+h}if(1===g||3===g)if(0===s||s===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[s]===l.kSCTE35){var B=188-C;this.handleSectionSlice(A,i+C,B,{pid:s,file_position:n,payload_unit_start_indicator:o,continuity_conunter:c,random_access_indicator:I.random_access_indicator})}else if(void 0!==(null===(t=this.pmt_)||void 0===t?void 0:t.pid_stream_type[s])){B=188-C;var E=this.pmt_.pid_stream_type[s];(s===this.pmt_.common_pids.h264||s===this.pmt_.common_pids.h265||s===this.pmt_.common_pids.adts_aac||s===this.pmt_.common_pids.loas_aac||s===this.pmt_.common_pids.ac3||s===this.pmt_.common_pids.eac3||s===this.pmt_.common_pids.opus||s===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[s]||this.pmt_.timed_id3_pids[s])&&this.handlePESSlice(A,i+C,B,{pid:s,stream_type:E,file_position:n,payload_unit_start_indicator:o,continuity_conunter:c,random_access_indicator:I.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),n=i[0];return n>0?n>183?(d.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(n)),{}):{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 r=n[0];if(void 0!==a&&0!==(null==a?void 0:a.total_length)){var o=new Uint8Array(A,e+1,Math.min(t,r));a.slices.push(o),a.total_length+=o.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):this.clearSlices(a,i)}for(var s=1+r;s=a.expected_length&&this.clearSlices(a,i),s+=o.byteLength}}else void 0!==a&&0!==a.total_length&&(o=new Uint8Array(A,e,Math.min(t,a.expected_length-a.total_length)),a.slices.push(o),a.total_length+=o.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 n=new Uint8Array(A,e,t),a=n[0]<<16|n[1]<<8|n[2],r=(n[3],n[4]<<8|n[5]);if(i.payload_unit_start_indicator){if(1!==a)return void d.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(a));var o=this.pes_slice_queues_[i.pid];o&&(0===o.expected_length||o.expected_length===o.total_length?this.emitPESSlices(o,i):this.clearSlices(o,i)),this.pes_slice_queues_&&(this.pes_slice_queues_[i.pid]=new k,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 s=this.pes_slice_queues_[i.pid];s.slices.push(n),i.payload_unit_start_indicator&&(s.expected_length=0===r?0:r+6),s.total_length+=n.byteLength,s.expected_length>0&&s.expected_length===s.total_length?this.emitPESSlices(s,i):s.expected_length>0&&s.expected_length>>6,r=e[8],o=void 0,s=void 0;2!==a&&3!==a||(o=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,s=3===a?536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2:o);var g=9+r,c=void 0;if(0!==n){if(n<3+r)return void d.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");c=n-3-r}else c=e.byteLength-g;var I=e.subarray(g,g+c);switch(A.stream_type){case l.kMPEG1Audio:case l.kMPEG2Audio:this.parseMP3Payload(I,o);break;case l.kPESPrivateData:this.pmt_.common_pids.opus===A.pid?this.parseOpusPayload(I,o):this.pmt_.common_pids.ac3===A.pid?this.parseAC3Payload(I,o):this.pmt_.common_pids.eac3===A.pid?this.parseEAC3Payload(I,o):this.pmt_.smpte2038_pids[A.pid]?this.parseSMPTE2038MetadataPayload(I,o,s,A.pid,i):this.parsePESPrivateDataPayload(I,o,s,A.pid,i);break;case l.kADTSAAC:this.parseADTSAACPayload(I,o);break;case l.kLOASAAC:this.parseLOASAACPayload(I,o);break;case l.kAC3:this.parseAC3Payload(I,o);break;case l.kEAC3:this.parseEAC3Payload(I,o);break;case l.kID3:this.parseTimedID3MetadataPayload(I,o,s,A.pid,i);break;case l.kH264:this.parseH264Payload(I,o,s,A.file_position,A.random_access_indicator);break;case l.kH265:this.parseH265Payload(I,o,s,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!==l.kPESPrivateData||(g=6,c=void 0,c=0!==n?n:e.byteLength-g,I=e.subarray(g,g+c),this.parsePESPrivateDataPayload(I,void 0,void 0,A.pid,i));else d.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),n=1&A[5],a=A[6],r=(A[7],null);if(1===n&&0===a)(r=new v).version_number=i;else if(null==(r=this.pat_))return;for(var o=t-5-4,s=-1,g=-1,l=8;l<8+o;l+=4){var c=A[l]<<8|A[l+1],I=(31&A[l+2])<<8|A[l+3];0===c?r.network_pid=I:(r.program_pmt_pid[c]=I,-1===s&&(s=c),-1===g&&(g=I))}1===n&&0===a&&(void 0===this.pat_&&d.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(r))),this.pat_=r,this.current_program_=s,this.current_pmt_pid_=g)}else d.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],n=(62&A[5])>>>1,a=1&A[5],r=A[6],o=(A[7],null);if(1===a&&0===r)(o=new b).program_number=i,o.version_number=n,this.program_pmt_map_[i]=o;else if(null==(o=this.program_pmt_map_[i]))return;A[8],A[9];for(var s=(15&A[10])<<8|A[11],g=12+s,c=t-9-s-4,I=g;I0){for(var f=I+5;f1&&(d.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(s,"ms, PES pts: ").concat(o,"ms")),o=s)}}for(var g=new O(A),l=null,c=o,I=0;null!=(l=g.readNextAACFrame());){r=1024/l.sampling_frequency*1e3;var C={codec:"aac",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(C)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(C)):(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(C)),I=c;var h=Math.floor(c),u={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(u),this.audio_track_.length+=l.data.byteLength),c+=r}g.hasIncompleteData()&&(this.aac_last_incomplete_data_=g.getIncompleteData()),I&&(this.aac_last_sample_pts_=I)}},e.prototype.parseLOASAACPayload=function(A,e){var t,i,n;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(A.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(A,this.aac_last_incomplete_data_.byteLength),A=a}var r,o=0;if(void 0!==e&&(o=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,o=this.aac_last_sample_pts_+r;else if(void 0===e)return void d.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 s=this.aac_last_sample_pts_+r;Math.abs(s-o)>1&&(d.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(s,"ms, PES pts: ").concat(o,"ms")),o=s)}}for(var g=new j(A),l=null,c=o,I=0;null!=(l=g.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 C={codec:"aac",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(C)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(C)):(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(C)),I=c;var h=Math.floor(c),u={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(u),this.audio_track_.length+=l.data.byteLength),c+=r}g.hasIncompleteData()&&(this.aac_last_incomplete_data_=g.getIncompleteData()),I&&(this.aac_last_sample_pts_=I)}},e.prototype.parseAC3Payload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var n,a=0;if(void 0!==e&&(a=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_)n=1536/this.audio_metadata_.sampling_frequency*1e3,a=this.aac_last_sample_pts_+n;else if(void 0===e)return void d.A.w(this.TAG,"AC3: Unknown pts");for(var r=new EA(A),o=null,s=a,g=0;null!=(o=r.readNextAC3Frame());){n=1536/o.sampling_frequency*1e3;var l={codec:"ac-3",data:o};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:o.sampling_frequency,bit_stream_identification:o.bit_stream_identification,bit_stream_mode:o.bit_stream_mode,low_frequency_effects_channel_on:o.low_frequency_effects_channel_on,channel_mode:o.channel_mode},this.dispatchAudioInitSegment(l)),g=s;var c=Math.floor(s),I={unit:o.data,length:o.data.byteLength,pts:c,dts:c};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(I),this.audio_track_.length+=o.data.byteLength),s+=n}g&&(this.aac_last_sample_pts_=g)}},e.prototype.parseEAC3Payload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var n,a=0;if(void 0!==e&&(a=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_)n=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,a=this.aac_last_sample_pts_+n;else if(void 0===e)return void d.A.w(this.TAG,"EAC3: Unknown pts");for(var r=new xA(A),o=null,s=a,g=0;null!=(o=r.readNextEAC3Frame());){n=1536/o.sampling_frequency*1e3;var l={codec:"ec-3",data:o};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:o.sampling_frequency,bit_stream_identification:o.bit_stream_identification,low_frequency_effects_channel_on:o.low_frequency_effects_channel_on,num_blks:o.num_blks,channel_mode:o.channel_mode},this.dispatchAudioInitSegment(l)),g=s;var c=Math.floor(s),I={unit:o.data,length:o.data.byteLength,pts:c,dts:c};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(I),this.audio_track_.length+=o.data.byteLength),s+=n}g&&(this.aac_last_sample_pts_=g)}},e.prototype.parseOpusPayload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var n,a=0;if(void 0!==e&&(a=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_)n=20,a=this.aac_last_sample_pts_+n;else if(void 0===e)return void d.A.w(this.TAG,"Opus: Unknown pts");for(var r=a,o=0,s=0;s>>3&3,n=(6&A[1])>>1,a=(A[2],(12&A[2])>>>2),r=3&~(A[3]>>>6)?2:1,o=0,s=34;switch(i){case 0:o=[11025,12e3,8e3,0][a];break;case 2:o=[22050,24e3,16e3,0][a];break;case 3:o=[44100,48e3,32e3,0][a]}switch(n){case 1:s=34;break;case 2:s=33;break;case 3:s=32}var g=new hA;g.object_type=s,g.sample_rate=o,g.channel_count=r,g.data=A;var l={codec:"mp3",data:g};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"mp3",object_type:s,sample_rate:o,channel_count:r},this.dispatchAudioInitSegment(l));var c={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(c),this.audio_track_.length+=A.byteLength)}},e.prototype.detectAudioMetadataChange=function(A){var e,t,i,n;if(A.codec!==(null===(e=this.audio_metadata_)||void 0===e?void 0:e.codec))return d.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((a=A.data).audio_object_type!==this.audio_metadata_.audio_object_type)return d.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(a.audio_object_type)),!0;if(a.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return d.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(a.sampling_freq_index)),!0;if(a.channel_config!==this.audio_metadata_.channel_config)return d.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(a.channel_config)),!0}else if("ac-3"===A.codec&&"ac-3"===this.audio_metadata_.codec){var a;if((a=A.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return d.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(n=this.audio_metadata_)||void 0===n?void 0:n.sampling_frequency," to ").concat(a.sampling_frequency)),!0;if(a.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return d.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(a.bit_stream_identification)),!0;if(a.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return d.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(a.bit_stream_mode)),!0;if(a.channel_mode!==this.audio_metadata_.channel_mode)return d.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(a.channel_mode)),!0;if(a.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return d.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(a.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 d.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 d.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 d.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 d.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 d.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,n,a,r,o={type:"audio"};if(o.id=null===(e=this.audio_track_)||void 0===e?void 0:e.id,o.timescale=1e3,o.duration=this.duration_,"aac"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec)){var s="aac"===A.codec?A.data:null,g=new W(s);o.audioSampleRate=g.sampling_rate,o.channelCount=g.channel_count,o.codec=g.codec_mimetype,o.originalCodec=g.original_codec_mimetype,o.config=g.config,o.refSampleDuration=1024/o.audioSampleRate*o.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,c=new fA(l);o.audioSampleRate=c.sampling_rate,o.channelCount=c.channel_count,o.codec=c.codec_mimetype,o.originalCodec=c.original_codec_mimetype,o.config=c.config,o.refSampleDuration=1536/o.audioSampleRate*o.timescale}else if("ec-3"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec)){var I="ec-3"===A.codec?A.data:null,C=new pA(I);o.audioSampleRate=C.sampling_rate,o.channelCount=C.channel_count,o.codec=C.codec_mimetype,o.originalCodec=C.original_codec_mimetype,o.config=C.config,o.refSampleDuration=256*C.num_blks/o.audioSampleRate*o.timescale}else"opus"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)?(o.audioSampleRate=this.audio_metadata_.sample_rate,o.channelCount=this.audio_metadata_.channel_count,o.channelConfigCode=this.audio_metadata_.channel_config_code,o.codec="opus",o.originalCodec="opus",o.config=void 0,o.refSampleDuration=20):"mp3"===(null===(r=this.audio_metadata_)||void 0===r?void 0:r.codec)&&(o.audioSampleRate=this.audio_metadata_.sample_rate,o.channelCount=this.audio_metadata_.channel_count,o.codec="mp3",o.originalCodec="mp3",o.config=void 0);this.audio_init_segment_dispatched_||d.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(o.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",o),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var h=this.media_info_;h.hasAudio=!0,h.audioCodec=o.originalCodec,h.audioSampleRate=o.audioSampleRate,h.audioChannelCount=o.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 X;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 Z;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var r=Math.floor(e/this.timescale_);a.pts=r}else a.nearest_pts=this.aac_last_sample_pts_;if(void 0!==t){var o=Math.floor(t/this.timescale_);a.dts=o}this.onPESPrivateData&&this.onPESPrivateData(a)},e.prototype.parseTimedID3MetadataPayload=function(A,e,t,i,n){var a=new Z;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var r=Math.floor(e/this.timescale_);a.pts=r}if(void 0!==t){var o=Math.floor(t/this.timescale_);a.dts=o}this.onTimedID3Metadata&&this.onTimedID3Metadata(a)},e.prototype.parseSMPTE2038MetadataPayload=function(A,e,t,i,n){var a=new CA;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var r=Math.floor(e/this.timescale_);a.pts=r}if(a.nearest_pts=this.aac_last_sample_pts_,void 0!==t){var o=Math.floor(t/this.timescale_);a.dts=o}a.ancillaries=function(A){for(var e=new f(A),t=0,i=[];t+=6,0===e.readBits(6);){var n=e.readBool();t+=1;var a=e.readBits(11);t+=11;var r=e.readBits(12);t+=12;var o=255&e.readBits(10);t+=10;var s=255&e.readBits(10);t+=10;var g=255&e.readBits(10);t+=10;for(var l=new Uint8Array(g),c=0;c>>24&255,n[1]=i>>>16&255,n[2]=i>>>8&255,n[3]=255&i,n.set(A,4);var s=8;for(o=0;o>>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 r=new Uint8Array(function(A,e,t){if(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),r=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)r.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 r}(a),!1));return A.box(A.types.dOps,r)},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,r=null!==(i=e.codecHeight)&&void 0!==i?i:108,o=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,r>>>8&255,255&r,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,o,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])),r=A.sdtp(e),o=A.trun(e,r.byteLength+16+16+8+16+8+8);return A.box(A.types.traf,n,a,o,r)},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 o=0;o>>24&255,s>>>16&255,s>>>8&255,255&s,g>>>24&255,g>>>16&255,g>>>8&255,255&g,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.isNonSync,0,0,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*o)}return A.box(A.types.trun,r)},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:wA,STSC:wA,STCO:wA,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}();bA.init();var FA=bA,RA=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}(),kA=n(453),PA=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 kA.Sc("audio"),this._videoSegmentInfoList=new kA.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!I.A.chrome||!(I.A.version&&I.A.version.major<50||I.A.version&&50===I.A.version.major&&((null===(e=I.A.version)||void 0===e?void 0:e.build)||0)<2661)),this._fillSilentAfterSeek=!(!I.A.msedge&&!I.A.msie),this._mp3UseMpegAudio=!I.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 u.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=FA.generateInitSegment(e);else{if("video"!==A)return;this._videoMeta=e,t=FA.generateInitSegment(e)}if(!this._onInitSegment)throw new u.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,n,a,r,o,s;if(null!=this._audioMeta){var g,l,c=A,C=c.samples,h=-1,u=this._audioMeta.refSampleDuration,B="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,E=this._dtsBaseInited&&void 0===this._audioNextDts,f=!1;if(C&&0!==C.length&&(1!==C.length||e)){var Q=0,x=null,p=0;B?(Q=0,p=c.length):(Q=8,p=8+c.length);var m=null;if(C.length>1&&(p-=(m=C.pop()).length),null!=this._audioStashedLastSample){var y=this._audioStashedLastSample;this._audioStashedLastSample=null,C.unshift(y),p+=y.length}null!=m&&(this._audioStashedLastSample=m);var _=C[0].dts-this._dtsBase;if(this._audioNextDts)g=_-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())g=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),g=_-(S.dts+S.duration+D)}else g=0}if(f){var v=_-g,w=this._videoSegmentInfoList.getLastSegmentBefore(_);if(null!=w&&w.beginDts=3*(u||0)&&this._fillAudioTimestampGap&&!I.A.safari){T=!0;var Y,U=Math.floor(g/(u||0));d.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(G," ms, ")+"dtsCorrection: ".concat(Math.round(g)," ms, generate: ").concat(U," frames")),b=Math.floor(G),L=Math.floor(G+(u||0))-b,null==(Y=RA.getSilentFrame(null===(n=this._audioMeta)||void 0===n?void 0:n.originalCodec,this._audioMeta.channelCount))&&(d.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(a=this._audioMeta)||void 0===a?void 0:a.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Y=P),M=[];for(var J=0;J=1?null===(r=R[R.length-1])||void 0===r?void 0:r.duration:Math.floor(u||0),this._audioNextDts=b+L;-1===h&&(h=b),R.push({dts:b,pts:b,cts:0,unit:y.unit,size:null===(o=y.unit)||void 0===o?void 0:o.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(B?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(FA.types.mdat,4)),k=0;k1&&(I-=(C=s.pop()).length),null!=this._videoStashedLastSample){var h=this._videoStashedLastSample;this._videoStashedLastSample=null,s.unshift(h),I+=(null==h?void 0:h.length)||0}null!=C&&(this._videoStashedLastSample=C);var u=s[0].dts-this._dtsBase;if(this._videoNextDts)n=u-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())n=0;else{var B=this._videoSegmentInfoList.getLastSampleBefore(u);if(null!=B){var E=u-(B.originalDts+B.duration);E<=3&&(E=0),n=u-(B.dts+B.duration+E)}else n=0}for(var f=new kA.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 v=new kA.$_(y,S,D,h.dts,!0);v.fileposition=h.fileposition,f.appendSyncPoint(v)}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((d=new Uint8Array(I))[0]=I>>>24&255,d[1]=I>>>16&255,d[2]=I>>>8&255,d[3]=255&I,d.set(FA.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,s=(null===(n=this._demuxer)||void 0===n?void 0:n.parseChunks(A,e))||0;else{var g=null;(g=S.probe(A)).match&&(this._setupFLVDemuxerRemuxer(g),s=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(A,e))||0),g.match||(null==g?void 0:g.needMoreData)||(g=vA.probe(A)).match&&(this._setupTSDemuxerRemuxer(g),s=(null===(r=this._demuxer)||void 0===r?void 0:r.parseChunks(A,e))||0),g.match||(null==g?void 0:g.needMoreData)||(g=null,d.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){o._internalAbort()})),this._emitter.emit(TA.A.DEMUX_ERROR,x.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return s},A.prototype._setupFLVDemuxerRemuxer=function(A){var e;this._demuxer=new S(A,this._config),this._remuxer||(this._remuxer=new PA(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 vA(A,this._config);this._remuxer||(this._remuxer=new PA(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,C.A.prototype));var n=Object.assign({},A);Object.setPrototypeOf(n,C.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(TA.A.METADATA_ARRIVED,A)},A.prototype._onScriptDataArrived=function(A){this._emitter.emit(TA.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(TA.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(TA.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(TA.A.SCTE35_METADATA_ARRIVED,A))},A.prototype._onPESPrivateDataDescriptor=function(A){this._emitter.emit(TA.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(TA.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(TA.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(TA.A.RECOVERED_EARLY_EOF)},A.prototype._onIOException=function(A,e){d.A.e(this.TAG,"IOException: type = ".concat(A,", code = ").concat(e.code,", msg = ").concat(e.msg)),this._emitter.emit(TA.A.IO_ERROR,A,e),this._disableStatisticsReporter()},A.prototype._onDemuxException=function(A,e){d.A.e(this.TAG,"DemuxException: type = ".concat(A,", info = ").concat(e)),this._emitter.emit(TA.A.DEMUX_ERROR,A,e)},A.prototype._onRemuxerInitSegmentArrival=function(A,e){this._emitter.emit(TA.A.INIT_SEGMENT,A,e)},A.prototype._onRemuxerMediaSegmentArrival=function(A,e){if(null==this._pendingSeekTime&&(this._emitter.emit(TA.A.MEDIA_SEGMENT,A,e),null!=this._pendingResolveSeekPoint&&"video"===A)){var t=e.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,I.A.safari&&t.length>0&&t[0].originalDts===i&&(i=t[0].pts),this._emitter.emit(TA.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]:{},r=Object.assign({},a);r.duration=null===(i=this._mediaInfo)||void 0===i?void 0:i.duration,r.segmentCount=null===(n=this._mediaInfo)||void 0===n?void 0:n.segmentCount,delete r.segments,delete r.keyframesIndex,this._emitter.emit(TA.A.MEDIA_INFO,r)},A.prototype._reportStatisticsInfo=function(){var A,e,t,i,n,a,r={};r.url=null===(A=this._ioctl)||void 0===A?void 0:A.currentURL,r.hasRedirect=null===(e=this._ioctl)||void 0===e?void 0:e.hasRedirect,r.hasRedirect&&(r.redirectedURL=null===(t=this._ioctl)||void 0===t?void 0:t.currentRedirectedURL),r.speed=null===(i=this._ioctl)||void 0===i?void 0:i.currentSpeed,r.loaderType=null===(n=this._ioctl)||void 0===n?void 0:n.loaderType,r.currentSegmentIndex=this._currentSegmentIndex,r.totalSegmentCount=null===(a=this._mediaDataSource.segments)||void 0===a?void 0:a.length,this._emitter.emit(TA.A.STATISTICS_INFO,r)},A}()},716:function(A,e,t){t.d(e,{A:function(){return i}});var 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:function(A,e,t){var i=function(A,e){var t={msg:x.A.INIT_SEGMENT,data:{type:A,data:e}};self.postMessage(t,[e.data])},n=function(A,e){var t={msg:x.A.MEDIA_SEGMENT,data:{type:A,data:e}};self.postMessage(t,[e.data])},a=function(){var A={msg:x.A.LOADING_COMPLETE};self.postMessage(A)},r=function(){var A={msg:x.A.RECOVERED_EARLY_EOF};self.postMessage(A)},o=function(A){var e={msg:x.A.MEDIA_INFO,data:A};self.postMessage(e)},s=function(A){var e={msg:x.A.METADATA_ARRIVED,data:A};self.postMessage(e)},g=function(A){var e={msg:x.A.SCRIPTDATA_ARRIVED,data:A};self.postMessage(e)},l=function(A){var e={msg:x.A.TIMED_ID3_METADATA_ARRIVED,data:A};self.postMessage(e)},c=function(A){var e={msg:x.A.SMPTE2038_METADATA_ARRIVED,data:A};self.postMessage(e)},d=function(A){var e={msg:x.A.SCTE35_METADATA_ARRIVED,data:A};self.postMessage(e)},I=function(A){var e={msg:x.A.PES_PRIVATE_DATA_DESCRIPTOR,data:A};self.postMessage(e)},C=function(A){var e={msg:x.A.PES_PRIVATE_DATA_ARRIVED,data:A};self.postMessage(e)},h=function(A){var e={msg:x.A.STATISTICS_INFO,data:A};self.postMessage(e)},u=function(A,e){self.postMessage({msg:x.A.IO_ERROR,data:{type:A,info:e}})},B=function(A,e){self.postMessage({msg:x.A.DEMUX_ERROR,data:{type:A,info:e}})},E=function(A){self.postMessage({msg:x.A.RECOMMEND_SEEKPOINT,data:A})},f=t(641),Q=t(976),x=t(716),p=null,m=function(A,e){self.postMessage({msg:"logcat_callback",data:{type:A,logcat:e}})};self.addEventListener("message",(function(A){switch(A.data.cmd){case"init":(p=new Q.A(A.data.param[0],A.data.param[1])).on(x.A.IO_ERROR,u),p.on(x.A.DEMUX_ERROR,B),p.on(x.A.INIT_SEGMENT,i),p.on(x.A.MEDIA_SEGMENT,n),p.on(x.A.LOADING_COMPLETE,a),p.on(x.A.RECOVERED_EARLY_EOF,r),p.on(x.A.MEDIA_INFO,o),p.on(x.A.METADATA_ARRIVED,s),p.on(x.A.SCRIPTDATA_ARRIVED,g),p.on(x.A.TIMED_ID3_METADATA_ARRIVED,l),p.on(x.A.SMPTE2038_METADATA_ARRIVED,c),p.on(x.A.SCTE35_METADATA_ARRIVED,d),p.on(x.A.PES_PRIVATE_DATA_DESCRIPTOR,I),p.on(x.A.PES_PRIVATE_DATA_ARRIVED,C),p.on(x.A.STATISTICS_INFO,h),p.on(x.A.RECOMMEND_SEEKPOINT,E);break;case"destroy":p&&(p.destroy(),p=null),self.postMessage({msg:"destroyed"});break;case"start":null==p||p.start();break;case"stop":null==p||p.stop();break;case"seek":null==p||p.seek(A.data.param);break;case"pause":null==p||p.pause();break;case"resume":null==p||p.resume();break;case"logging_config":var e=A.data.param;f.A.applyConfig(e),!0===e.enableCallback?f.A.addLogListener(m):f.A.removeLogListener(m)}}))},465:function(A,e,t){t.d(e,{A:function(){return i}});var i={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},133:function(A,e,n){var a=function(){return Object.assign({},I)},r=function(A){return(A+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")},o=function(A){return!isNaN(1*A)},s=function(A,e,t){var i={};i[t]=[];var a=e.toString(),s=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return i;for(var g,l=s[1],c=new RegExp("(\\\\n|\\W)"+r(l)+m,"g");g=c.exec(a);)"dll-reference"!==g[3]&&i[t].push(g[3]);for(c=new RegExp("\\("+r(l)+'\\("(dll-reference\\s('+p+'))"\\)\\)'+m,"g");g=c.exec(a);)A[g[2]]||(i[t].push(g[1]),A[g[2]]=n(g[1]).m),i[g[2]]=i[g[2]]||[],i[g[2]].push(g[4]);for(var d=Object.keys(i),I=0;I0}),!1)},l=function(A,e,t,i){var n=A[i].map((function(A){return'"'+A+'": '+e[i][A].toString()})).join(","),a=x.toString().split("ENTRY_MODULE");return a[0]+"{"+n+"}"+a[1]+'"'+t+'"'+a[2]};n.d(e,{default:function(){return V}});var c={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},d=n(302),I={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},C=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 d.A({},a()),e=A.loaderType;return A.destroy(),"fetch-stream-loader"===e||"xhr-moz-chunked-loader"===e},A.getNetworkLoaderTypeName=function(){var A=new d.A({},a()),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}(),h=C,u=n(288),B=n(413),E=n(502),f=n(620),Q={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"},x=function(){var A=ENTRY_MODULE,e={};function t(i){if(e[i])return e[i].exports;var n=e[i]={exports:{}};return A[i](n,n.exports,t),n.exports}t.m=A,t.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(e,{a:e}),e},t.d=function(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.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=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},t.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};var i=t(ENTRY_MODULE);return i.default||i};x.toString();var p="[\\.|\\-|\\+|\\w|/|@]+",m="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+p+").*?\\)",y=n(641),_=n(976),S=n(716),D=n(825),v=function(){function A(A,e){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new B.A,e.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=function(A,e){e=e||{};var t={main:n.m},i=e.all?{main:Object.keys(t.main)}:function(A,e){for(var t={main:[e]},i={main:[]},n={main:{}};g(t);)for(var a=Object.keys(t),r=0;r0&&(n+=";codecs=".concat(i.codec));var a=!1;if(E.A.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])E.A.v(this.TAG,"Notice: ".concat(i.type," mimeType changed, origin: ").concat(this._mimeTypes[i.type]||"",", target: ").concat(n));else{a=!0;try{var r=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);r.addEventListener("error",this.e.onSourceBufferError),r.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(A){return E.A.e(this.TAG,A.message),void this._emitter.emit(b,{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(),f.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){E.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 r=0;r=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 r=a.buffered,o=!1,s=0;s=((null===(e=this._config)||void 0===e?void 0:e.autoCleanupMaxBackwardDuration)||0)){o=!0;var c=i-((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[n].push({start:g,end:c})}}else l0&&(isNaN(a)||r>a)&&(E.A.v(this.TAG,"Update MediaSource duration from ".concat(a," to ").concat(r)),this._mediaSource.duration=r),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 r=(null===(e=this._sourceBuffers[n])||void 0===e?void 0:e.timestampOffset)||0,o=a.timestampOffset/1e3;Math.abs(r-o)>.1&&(E.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(r," to ").concat(o)),this._sourceBuffers[n]&&(this._sourceBuffers[n].timestampOffset=o)),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(k),this._isBufferFull=!0):(E.A.e(this.TAG,A.message),this._emitter.emit(b,{code:A.code,msg:A.message}))}}},A.prototype._onSourceOpen=function(){var A;if(E.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(F)},A.prototype._onSourceEnded=function(){E.A.v(this.TAG,"MediaSource onSourceEnded")},A.prototype._onSourceClose=function(){E.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(R)},A.prototype._onSourceBufferError=function(A){E.A.e(this.TAG,"SourceBuffer Error: ".concat(A))},A}(),M=T,L=n(465),G={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Y={NETWORK_EXCEPTION:u.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:u.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:u.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:u.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:L.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:L.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:L.A.CODEC_UNSUPPORTED},U=function(){function A(A,e){var t,n,r;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new B.A,this._config=a(),"object"==(void 0===e?"undefined":i(e))&&Object.assign(this._config,e);var o=A.type.toLowerCase();if("mse"!==o&&"mpegts"!==o&&"m2ts"!==o&&"flv"!==o)throw new N.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 s=f.A.chrome&&(f.A.version&&(null===(t=f.A.version)||void 0===t?void 0:t.major)<50||f.A.version&&50===(null===(n=null===f.A||void 0===f.A?void 0:f.A.version)||void 0===n?void 0:n.major)&&((null===(r=null===f.A||void 0===f.A?void 0:f.A.version)||void 0===r?void 0:r.build)||-1)<2661);this._alwaysSeekKeyframe=!!(s||f.A.msedge||f.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return A.prototype.destroy=function(){this._emitter.emit(Q.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===Q.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){t._emitter.emit(Q.MEDIA_INFO,t.mediaInfo)})):A===Q.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){t._emitter.emit(Q.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,r=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 M(this._config),null===(e=this._msectl)||void 0===e||e.on(R,this._onmseUpdateEnd.bind(this)),null===(t=this._msectl)||void 0===t||t.on(k,this._onmseBufferFull.bind(this)),null===(i=this._msectl)||void 0===i||i.on(F,(function(){r._mseSourceOpened=!0,r._hasPendingLoad&&(r._hasPendingLoad=!1,r.load())})),null===(n=this._msectl)||void 0===n||n.on(b,(function(A){r._emitter.emit(Q.ERROR,G.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 N.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new N.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(S.A.INIT_SEGMENT,(function(e,t){var i;null===(i=A._msectl)||void 0===i||i.appendInitSegment(t)})),this._transmuxer.on(S.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 r=null===(n=A._mediaElement)||void 0===n?void 0:n.currentTime;t.info.endDts>=1e3*(r+((null===(a=A._config)||void 0===a?void 0:a.lazyLoadMaxDuration)||0))&&null==A._progressChecker&&(E.A.v(A.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),A._suspendTransmuxer())}})),this._transmuxer.on(S.A.LOADING_COMPLETE,(function(){var e;null===(e=A._msectl)||void 0===e||e.endOfStream(),A._emitter.emit(Q.LOADING_COMPLETE)})),this._transmuxer.on(S.A.RECOVERED_EARLY_EOF,(function(){A._emitter.emit(Q.RECOVERED_EARLY_EOF)})),this._transmuxer.on(S.A.IO_ERROR,(function(e,t){A._emitter.emit(Q.ERROR,G.NETWORK_ERROR,e,t)})),this._transmuxer.on(S.A.DEMUX_ERROR,(function(e,t){A._emitter.emit(Q.ERROR,G.MEDIA_ERROR,e,{code:-1,msg:t})})),this._transmuxer.on(S.A.MEDIA_INFO,(function(e){A._mediaInfo=e,A._emitter.emit(Q.MEDIA_INFO,Object.assign({},e))})),this._transmuxer.on(S.A.METADATA_ARRIVED,(function(e){A._emitter.emit(Q.METADATA_ARRIVED,e)})),this._transmuxer.on(S.A.SCRIPTDATA_ARRIVED,(function(e){A._emitter.emit(Q.SCRIPTDATA_ARRIVED,e)})),this._transmuxer.on(S.A.TIMED_ID3_METADATA_ARRIVED,(function(e){A._emitter.emit(Q.TIMED_ID3_METADATA_ARRIVED,e)})),this._transmuxer.on(S.A.SMPTE2038_METADATA_ARRIVED,(function(e){A._emitter.emit(Q.SMPTE2038_METADATA_ARRIVED,e)})),this._transmuxer.on(S.A.SCTE35_METADATA_ARRIVED,(function(e){A._emitter.emit(Q.SCTE35_METADATA_ARRIVED,e)})),this._transmuxer.on(S.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(e){A._emitter.emit(Q.PES_PRIVATE_DATA_DESCRIPTOR,e)})),this._transmuxer.on(S.A.PES_PRIVATE_DATA_ARRIVED,(function(e){A._emitter.emit(Q.PES_PRIVATE_DATA_ARRIVED,e)})),this._transmuxer.on(S.A.STATISTICS_INFO,(function(e){A._statisticsInfo=A._fillStatisticsInfo(e),A._emitter.emit(Q.STATISTICS_INFO,Object.assign({},A._statisticsInfo))})),this._transmuxer.on(S.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,i,n){return new(i||(i=Promise))((function(e,a){function r(A){try{s(n.next(A))}catch(A){a(A)}}function o(A){try{s(n.throw(A))}catch(A){a(A)}}function s(A){var n;A.done?e(A.value):(n=A.value,t(n,i)?n:new i((function(A){A(n)}))).then(r,o)}s((n=n.apply(A,[])).next())}))}(this,0,void 0,(function(){return function(A,e){var t,i,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(s){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(r=0)),r;)try{if(t=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,i=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!((n=(n=r.trys).length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]0&&!(null===(t=this._mediaElement)||void 0===t?void 0:t.paused)){var r=n.end(n.length-1);if(r>((null===(i=this._config)||void 0===i?void 0:i.liveBufferLatencyMaxLatency)||0)&&r-a>(this._config.liveBufferLatencyMaxLatency||0)){var o=r-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=o}}if(this._config.lazyLoad&&!this._config.isLive){for(var s=0,g=0;g=a+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(E.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},A.prototype._onmseBufferFull=function(){E.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,r=0;r=o&&i=s-(this._config.lazyLoadRecoverDuration||0)&&(a=!0);break}}a&&(window.clearInterval(this._progressChecker),this._progressChecker=null,a&&(E.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 r=a.start(0);if(r<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,i,n){return new(i||(i=Promise))((function(e,a){function r(A){try{s(n.next(A))}catch(A){a(A)}}function o(A){try{s(n.throw(A))}catch(A){a(A)}}function s(A){var n;A.done?e(A.value):(n=A.value,t(n,i)?n:new i((function(A){A(n)}))).then(r,o)}s((n=n.apply(A,[])).next())}))}(this,0,void 0,(function(){return function(A,e){var t,i,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(s){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(r=0)),r;)try{if(t=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,i=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!((n=(n=r.trys).length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=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}(),s=n(288),g=n(620),l=n(713),c=(a=function(A,e){return a=Object.setPrototypeOf||t({__proto__:[]},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)}),d=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 c(e,A),e.isSupported=function(){var A;try{var e=g.A.msedge&&((null===(A=null===g.A||void 0===g.A?void 0:g.A.version)||void 0===A?void 0:A.minor)||0)>=15048&&!g.A.webkit,t=!g.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 n=A.url;this._config.reuseRedirectedURL&&void 0!==A.redirectedURL&&(n=A.redirectedURL);var a=this._seekHandler.getConfig(n,e),r=new self.Headers;if("object"==i(a.headers)){var o=a.headers;for(var g in o)o.hasOwnProperty(g)&&r.append(g,o[g])}var c={method:"GET",headers:r,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==i(this._config.headers))for(var g in this._config.headers)r.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=s.eO.kConnecting,self.fetch(a.url,c).then((function(A){var e,i;if(t._requestAbort)return t._status=s.eO.kIdle,void(null===(e=A.body)||void 0===e||e.cancel());if(A.ok&&A.status>=200&&A.status<=299){if(A.url!==a.url&&t._onURLRedirect){var n=t._seekHandler.removeURLParameters(A.url);t._onURLRedirect(n)}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=s.eO.kError,!t._onError)throw new l.Al("FetchStreamLoader: Http code invalid, "+A.status+" "+A.statusText);t._onError(s.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=s.eO.kError,!t._onError)throw A;t._onError(s.Xv.EXCEPTION,{code:-1,msg:A.message})}}))},e.prototype.abort=function(){var A;if(this._requestAbort=!0,(this._status!==s.eO.kBuffering||!g.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=s.eO.kError,!this._onError)throw new l.Al("MozChunkedLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(s.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}else this._status=s.eO.kBuffering}},e.prototype._onProgress=function(A){var e;if(this._status!==s.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!==s.eO.kError&&(this._status=s.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},e.prototype._onXhrError=function(A){this._status=s.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 n=this._seekHandler.getConfig(t,e);this._currentRequestURL=n.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",n.url,!0),a.responseType="arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onload=this._onLoad.bind(this),a.onerror=this._onXhrError.bind(this),A.withCredentials&&(a.withCredentials=!0),"object"==i(n.headers)){var r=n.headers;for(var o in r)r.hasOwnProperty(o)&&a.setRequestHeader(o,r[o])}if("object"==i(this._config.headers))for(var o in r=this._config.headers)r.hasOwnProperty(o)&&a.setRequestHeader(o,r[o]);a.send()},e.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=s.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=s.eO.kBuffering}else{if(this._status=s.eO.kError,!this._onError)throw new l.Al("RangeLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(s.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}}},e.prototype._onProgress=function(A){if(this._status!==s.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("&"),r=0;r0;o[0]!==this._startName&&o[0]!==this._endName&&(s&&(n+="&"),n+=a[r])}return 0===n.length?t:t+"?"+n},A}(),x=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 o,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===u?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 f(!!this._config.rangeLoadZeroStart);else if("param"===A.seekType){var e=A.seekParamStart||"bstart",t=A.seekParamEnd||"bend";this._seekHandler=new Q(e,t)}else{if("custom"!==A.seekType)throw new l.Qn("Invalid seekType in config: ".concat((null==A?void 0:A.seekType)||""));if("function"!=typeof A.customSeekHandler)throw new l.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=E;else if(d.isSupported())this._loaderClass=d;else if(C.isSupported())this._loaderClass=C;else{if(!u.isSupported())throw new l.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=u}},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 r={from:A,to:-1};this._currentRange={from:r.from,to:-1},null===(a=this._speedSampler)||void 0===a||a.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,r),this._onSeeked&&this._onSeeked()},A.prototype.updateUrl=function(A){if(!A||"string"!=typeof A||0===A.length)throw new l.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 o=this._stashBuffer.slice(0,this._stashUsed);(c=this._dispatchChunks(o,this._stashByteStart))0&&(d=new Uint8Array(o,c),g.set(d,0),this._stashUsed=d.byteLength,this._stashByteStart+=c):(this._stashUsed=0,this._stashByteStart+=c),this._stashUsed+A.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+A.byteLength),g=new Uint8Array(this._stashBuffer,0,this._bufferSize)),g.set(new Uint8Array(A),this._stashUsed),this._stashUsed+=A.byteLength}else(c=this._dispatchChunks(A,e))this._bufferSize&&(this._expandBuffer(s),g=new Uint8Array(this._stashBuffer,0,this._bufferSize)),g.set(new Uint8Array(A,c),0),this._stashUsed+=s,this._stashByteStart=e+c);else if(0===this._stashUsed){var s;(c=this._dispatchChunks(A,e))this._bufferSize&&this._expandBuffer(s),(g=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(A,c),0),this._stashUsed+=s,this._stashByteStart=e+c)}else{var g,c;if(this._stashUsed+A.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+A.byteLength),(g=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(A),this._stashUsed),this._stashUsed+=A.byteLength,(c=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var d=new Uint8Array(this._stashBuffer,c);g.set(d,0)}this._stashUsed-=c,this._stashByteStart+=c}}},A.prototype._flushStashBuffer=function(A){if(this._stashUsed>0){var e=this._stashBuffer.slice(0,this._stashUsed),t=this._dispatchChunks(e,this._stashByteStart),i=e.byteLength-t;if(t0){var n=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(e,t);n.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=t}return 0}r.A.w(this.TAG,"".concat(i," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,i}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(r.A.e(this.TAG,"Loader error, code = ".concat(e.code,", msg = ").concat(e.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,A=s.Xv.UNRECOVERABLE_EARLY_EOF),A){case s.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var i=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1;return void(i1&&(a.version.minor=parseInt(r[1],10)),r.length>2&&(a.version.build=parseInt(r[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 o="msie";n.browser=o,a[o]=!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 l="android";n.browser=l,a[l]=!0}for(var c in a.name=n.browser,a.platform=n.platform,i)Object.prototype.hasOwnProperty.call(i,c)&&delete i[c];Object.assign(i,a)}();var n=i},713:function(A,e,i){i.d(e,{Al:function(){return r},Qn:function(){return s},Xu:function(){return g},j4:function(){return o}});var n,a=(n=function(A,e){return n=Object.setPrototypeOf||t({__proto__:[]},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])},n(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}n(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),r=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 a(e,A),e}(r),s=function(A){function e(e){var t=A.call(this,e)||this;return t.name="InvalidArgumentException",t}return a(e,A),e}(r),g=function(A){function e(e){var t=A.call(this,e)||this;return t.name="NotImplementedException",t}return a(e,A),e}(r)},502:function(A,e,t){t.d(e,{A:function(){return n}});var i=t(413),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.warn)},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},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},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},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},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:function(A,e,t){t.d(e,{A:function(){return a}});var i=t(413),n=t(502),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:function(A,e,t){t.d(e,{A:function(){return i}});var i=t(343)}},e={};function n(t){var i=e[t];if(void 0!==i)return i.exports;var a=e[t]={exports:{}};return A[t](a,a.exports,n),a.exports}return n.m=A,n.d=function(A,e){for(var t in e)n.o(e,t)&&!n.o(A,t)&&Object.defineProperty(A,t,{enumerable:!0,get:e[t]})},n.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},n(446)}()}))}(f,f.exports)),f.exports),x=B(Q);window.flvjs=x;var p,m=function(){function A(A,e){window.flvjs.isSupported()&&this.initFLV(A,e)}var e=A.prototype;return e.toString=function(){return"Flv "+this.coreX+"-"+this.coreY},e.initFLV=function(A,e){var t=d(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 r=document.getElementById(A);r.getAttribute("controls")||r.setAttribute("controls",!0);var o=window.flvjs.createPlayer({type:"flv",url:e,isLive:!0},{enableStashBuffer:!0,stashInitialSize:128,enableWorker:!0});o.attachMediaElement(r),o.load(),o.play(),this.flvUrl=e,this.flv=o,this.video=r,this.video.addEventListener("oncanplaythrough",(function(){}),!1),this.video.addEventListener("onerror",(function(){}),!1)},e.play=function(){this.video.play()},e.stop=function(){this.video.pause(),this.flv.unload()},e.destroy=function(){void 0!==this.flv&&null!==this.flv&&(this.flv.pause(),this.flv.unload(),this.flv.detachMediaElement(),this.flv.destroy(),this.flv=null)},A}();p||(p=1,function(){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,r=!0,o=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return r=A.done,A},e:function(A){o=!0,a=A},f:function(){try{r||null==t.return||t.return()}finally{if(o)throw a}}}}function o(){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(A,e,t){var i=I(A,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(arguments.length<3?A:t):n.value}},o.apply(null,arguments)}function s(A){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},s(A)}function g(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&d(A,e)}function l(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(A){}return(l=function(){return!!A})()}function c(A,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return e(A)}function d(A,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},d(A,e)}function I(A,e){for(;!{}.hasOwnProperty.call(A,e)&&null!==(A=s(A)););return A}function C(A,e,t,i){var n=o(s(A.prototype),e,t);return"function"==typeof n?function(A){return n.apply(t,A)}:n}function h(A,e){if("object"!=typeof A||!A)return A;var t=A[Symbol.toPrimitive];if(void 0!==t){var i=t.call(A,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}function B(A){var e=h(A,"string");return"symbol"==typeof e?e:e+""}function E(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}}function f(A){var e;try{e=new Event("abort")}catch(A){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}return e.reason=A,e}function Q(A){if(void 0===A)if("undefined"==typeof document)(A=new Error("This operation was aborted")).name="AbortError";else try{A=new DOMException("signal is aborted without reason"),Object.defineProperty(A,"name",{value:"AbortError"})}catch(e){(A=new Error("This operation was aborted")).name="AbortError"}return A}!function(A){A.AbortSignal,A.AbortController}("undefined"!=typeof self?self:u);var x=function(){function A(){i(this,A),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return a(A,[{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;i>>0)+"_",n=0;return function A(i){if(this instanceof A)throw new TypeError("Symbol is not a constructor");return new e(t+(i||"")+"_"+n++,i)}})),a("Symbol.iterator",(function(A){if(A)return A;A=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a2?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=3),this.log=this._loggerFactory("log",this._levelNum>=2),this.warn=this._loggerFactory("warn",this._levelNum>=1),this.error=this._loggerFactory("error",this._levelNum>=0),this.setOptions(A)}var e=A.prototype;return e.setOptions=function(A){var e;this._options=Object.assign({},this._options,A),this._levelNum=this._matchLevel(null!=(e=this._options.level)?e:"INFO"),this.info=this._loggerFactory("info",this._levelNum>=3),this.log=this._loggerFactory("log",this._levelNum>=2),this.warn=this._loggerFactory("warn",this._levelNum>=1),this.error=this._loggerFactory("error",this._levelNum>=0)},e._matchLevel=function(A){var e=3;switch(A){case"INFO":e=3;break;case"LOG":e=2;break;case"WARN":e=1;break;case"ERROR":e=0}return e},e._loggerFactory=function(e,t){var i=console[e];if(t&&i){var n,a=this._options.name?"%c["+this._options.name+"]%c %c["+e.toUpperCase()+"]":"%c["+e.toUpperCase()+"]",r=[this._options.name?"background: green;color: #fff":null,this._options.name?"":null,b[e]].filter((function(A){return null!=A}));return(n=i).bind.apply(n,[].concat([console,a],r))}return A.noop},e.getOptions=function(){return this._options},e.getVersion=function(){return"1.0.1"},A}();function R(A){return(A=+A)<10&&(A="0"+A),A+""}F.noop=function(){};var k=["info","log","warn","error"];function P(A){var e=new F(A);return new Proxy(e,{get:function(A,e){if(k.includes(e)){var t;if(null==(t=A._options)?void 0:t.showTime){var i=(a=(n=new Date(Date.now())).getFullYear(),r=n.getMonth()+1,o=n.getDate(),s=n.getHours(),g=n.getMinutes(),l=n.getSeconds(),c=n.getMilliseconds(),a+"/"+R(r)+"/"+R(o)+" "+R(s)+":"+R(g)+":"+R(l)+":"+c);return A[e].bind(console,"["+i+"]")}return A[e].bind(console)}var n,a,r,o,s,g,l,c;return Reflect.get(A,e)}})} /* * * @ezuikit/utils-i18n v1.0.1 * Copyright (c) 2024-3-23 Ezviz-OpenBiz * Released under MIT the License. * */var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function T(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var M,L=Array.isArray,G="object"==typeof N&&N&&N.Object===Object&&N,Y=G,U="object"==typeof self&&self&&self.Object===Object&&self,J=Y||U||Function("return this")(),H=J.Symbol,K=H,V=Object.prototype,O=V.hasOwnProperty,j=V.toString,W=K?K.toStringTag:void 0,Z=Object.prototype.toString,X=function(A){var e=O.call(A,W),t=A[W];try{A[W]=void 0;var i=!0}catch(A){}var n=j.call(A);return i&&(e?A[W]=t:delete A[W]),n},q=H?H.toStringTag:void 0,z=function(A){return null==A?void 0===A?"[object Undefined]":"[object Null]":q&&q in Object(A)?X(A):function(A){return Z.call(A)}(A)},AA=function(A){return null!=A&&"object"==typeof A},eA=z,tA=AA,iA=function(A){return"symbol"==typeof A||tA(A)&&"[object Symbol]"==eA(A)},nA=L,aA=iA,rA=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oA=/^\w*$/,sA=function(A,e){if(nA(A))return!1;var t=typeof A;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=A&&!aA(A))||oA.test(A)||!rA.test(A)||null!=e&&A in Object(e)},gA=function(A){var e=typeof A;return null!=A&&("object"==e||"function"==e)},lA=z,cA=gA,dA=function(A){if(!cA(A))return!1;var e=lA(A);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},IA=J["__core-js_shared__"],CA=(M=/[^.]+$/.exec(IA&&IA.keys&&IA.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",hA=Function.prototype.toString,uA=function(A){if(null!=A){try{return hA.call(A)}catch(A){}try{return A+""}catch(A){}}return""},BA=dA,EA=function(A){return!!CA&&CA in A},fA=gA,QA=uA,xA=/^\[object .+?Constructor\]$/,pA=Function.prototype,mA=Object.prototype,yA=pA.toString,_A=mA.hasOwnProperty,SA=RegExp("^"+yA.call(_A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),DA=function(A,e){var t=function(A,e){return null==A?void 0:A[e]}(A,e);return function(A){return!(!fA(A)||EA(A))&&(BA(A)?SA:xA).test(QA(A))}(t)?t:void 0},vA=DA(Object,"create"),wA=vA,bA=vA,FA=Object.prototype.hasOwnProperty,RA=vA,kA=Object.prototype.hasOwnProperty,PA=vA,NA=function(){this.__data__=wA?wA(null):{},this.size=0},TA=function(A){var e=this.has(A)&&delete this.__data__[A];return this.size-=e?1:0,e},MA=function(A){var e=this.__data__;if(bA){var t=e[A];return"__lodash_hash_undefined__"===t?void 0:t}return FA.call(e,A)?e[A]:void 0};function LA(A){var e=-1,t=null==A?0:A.length;for(this.clear();++e-1},ZA.prototype.set=function(A,e){var t=this.__data__,i=jA(t,A);return i<0?(++this.size,t.push([A,e])):t[i][1]=e,this};var XA=ZA,qA=DA(J,"Map"),zA=GA,$A=XA,Ae=qA,ee=function(A,e){var t=A.__data__;return function(A){var e=typeof A;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==A:null===A}(e)?t["string"==typeof e?"string":"hash"]:t.map},te=ee,ie=ee,ne=ee,ae=ee;function re(A){var e=-1,t=null==A?0:A.length;for(this.clear();++e-1&&A%1==0&&A-1&&A%1==0&&A<=9007199254740991},je=Se,We=He,Ze=L,Xe=Ve,qe=Oe,ze=ve,$e=function(A,e,t){for(var i=-1,n=(e=je(e,A)).length,a=!1;++i0){if(++e>=800)return arguments[0]}else e=0;return A.apply(void 0,arguments)}}($i),tn=Zi,nn=function(A,e,t){return e=Xi(void 0===e?A.length-1:e,0),function(){for(var i=arguments,n=-1,a=Xi(i.length-e,0),r=Array(a);++n1?t[n-1]:void 0,r=n>2?t[2]:void 0;for(a=A.length>3&&"function"==typeof a?(n--,a):void 0,r&&In(t[0],t[1],r)&&(a=n<3?void 0:a,n=1),e=Object(e);++i-1},Dn=Qn,vn=yn,wn=pn,bn=T((function(A){return A&&A.length?function(A,e,t){var i=-1,n=Sn,a=A.length,r=!0,o=[],s=o;if(a>=200){var g=vn(A);if(g)return wn(g);r=!1,n=Dn,s=new _n}else s=o;A:for(;++i{const t=[],i=[];return t.push(e),e||t.push(A.locale),A.enableFallback&&t.push(A.defaultLocale),t.filter(Boolean).map((A=>A.toString())).forEach((function(e){if(i.includes(e)||i.push(e),!A.enableFallback)return;const t=e.split("-");3===t.length&&i.push(`${t[0]}-${t[1]}`),i.push(t[0])})),bn(i)};class Rn{constructor(A){this.i18n=A,this.registry={},this.register("default",Fn)}register(A,e){if("function"!=typeof e){const A=e;e=()=>A}this.registry[A]=e}get(A){let e=this.registry[A]||this.registry[this.i18n.locale]||this.registry.default;return"function"==typeof e&&(e=e(this.i18n,A)),e instanceof Array||(e=[e]),e}}const kn=function(A){let{pluralizer:e,includeZero:t=!0,ordinal:i=!1}=A;return function(A,n){return[t&&0===n?"zero":"",e(n,i)].filter(Boolean)}}({pluralizer:(A,e)=>{const t=String(A).split("."),i=!t[1],n=Number(t[0])==A,a=n&&t[0].slice(-1),r=n&&t[0].slice(-2);return e?1==a&&11!=r?"one":2==a&&12!=r?"two":3==a&&13!=r?"few":"other":1==A&&i?"one":"other"},includeZero:!0});class Pn{constructor(A){this.i18n=A,this.registry={},this.register("default",kn)}register(A,e){this.registry[A]=e}get(A){return this.registry[A]||this.registry[this.i18n.locale]||this.registry.default}}var Nn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Tn=function(A){return Nn.test(A)},Mn="\\ud800-\\udfff",Ln="["+Mn+"]",Gn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Yn="\\ud83c[\\udffb-\\udfff]",Un="[^"+Mn+"]",Jn="(?:\\ud83c[\\udde6-\\uddff]){2}",Hn="[\\ud800-\\udbff][\\udc00-\\udfff]",Kn="(?:"+Gn+"|"+Yn+")?",Vn="[\\ufe0e\\ufe0f]?",On=Vn+Kn+"(?:\\u200d(?:"+[Un,Jn,Hn].join("|")+")"+Vn+Kn+")*",jn="(?:"+[Un+Gn+"?",Gn,Jn,Hn,Ln].join("|")+")",Wn=RegExp(Yn+"(?="+Yn+")|"+jn+On,"g"),Zn=function(A){return A.split("")},Xn=Tn,qn=function(A,e,t){var i=A.length;return t=void 0===t?i:t,!e&&t>=i?A:function(A,e,t){var i=-1,n=A.length;e<0&&(e=-e>n?0:n+e),(t=t>n?n:t)<0&&(t+=n),n=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(n);++i(e[Ya(t)]=A[t],e)),{}):{}}function Ja(A){return null!=A} /* * bignumber.js v9.1.2 * A JavaScript library for arbitrary-precision arithmetic. * https://github.com/MikeMcl/bignumber.js * Copyright (c) 2022 Michael Mclaughlin * MIT Licensed. * * BigNumber.prototype methods | BigNumber methods * | * absoluteValue abs | clone * comparedTo | config set * decimalPlaces dp | DECIMAL_PLACES * dividedBy div | ROUNDING_MODE * dividedToIntegerBy idiv | EXPONENTIAL_AT * exponentiatedBy pow | RANGE * integerValue | CRYPTO * isEqualTo eq | MODULO_MODE * isFinite | POW_PRECISION * isGreaterThan gt | FORMAT * isGreaterThanOrEqualTo gte | ALPHABET * isInteger | isBigNumber * isLessThan lt | maximum max * isLessThanOrEqualTo lte | minimum min * isNaN | random * isNegative | sum * isPositive | * isZero | * minus | * modulo mod | * multipliedBy times | * negated | * plus | * precision sd | * shiftedBy | * squareRoot sqrt | * toExponential | * toFixed | * toFormat | * toFraction | * toJSON | * toNumber | * toPrecision | * toString | * valueOf | * */var Ha=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ka=Math.ceil,Va=Math.floor,Oa="[BigNumber Error] ",ja=Oa+"Number primitive has more than 15 significant digits: ",Wa=1e14,Za=14,Xa=9007199254740991,qa=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],za=1e7,$a=1e9;function Ar(A){var e=0|A;return A>0||A===e?e:e-1}function er(A){for(var e,t,i=1,n=A.length,a=A[0]+"";ig^t?1:-1;for(o=(s=n.length)<(g=a.length)?s:g,r=0;ra[r]^t?1:-1;return s==g?0:s>g^t?1:-1}function ir(A,e,t,i){if(At||A!==Va(A))throw Error(Oa+(i||"Argument")+("number"==typeof A?At?" out of range: ":" not an integer: ":" not a primitive number: ")+String(A))}function nr(A){var e=A.c.length-1;return Ar(A.e/Za)==e&&A.c[e]%2!=0}function ar(A,e){return(A.length>1?A.charAt(0)+"."+A.slice(1):A)+(e<0?"e":"e+")+e}function rr(A,e,t){var i,n;if(e<0){for(n=t+".";++e;n+=t);A=n+A}else if(++e>(i=A.length)){for(n=t,e-=i;--e;n+=t);A+=n}else ef?d.c=d.e=null:A.e=10;s/=10,o++);return void(o>f?d.c=d.e=null:(d.e=o,d.c=[A]))}c=String(A)}else{if(!Ha.test(c=String(A)))return n(d,c,g);d.s=45==c.charCodeAt(0)?(c=c.slice(1),-1):1}(o=c.indexOf("."))>-1&&(c=c.replace(".","")),(s=c.search(/e/i))>0?(o<0&&(o=s),o+=+c.slice(s+1),c=c.substring(0,s)):o<0&&(o=c.length)}else{if(ir(e,2,y.length,"Base"),10==e&&_)return b(d=new S(A),C+d.e+1,h);if(c=String(A),g="number"==typeof A){if(0*A!=0)return n(d,c,g,e);if(d.s=1/A<0?(c=c.slice(1),-1):1,S.DEBUG&&c.replace(/^0\.0*|\./,"").length>15)throw Error(ja+A)}else d.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1;for(t=y.slice(0,e),o=s=0,l=c.length;so){o=l;continue}}else if(!r&&(c==c.toUpperCase()&&(c=c.toLowerCase())||c==c.toLowerCase()&&(c=c.toUpperCase()))){r=!0,s=-1,o=0;continue}return n(d,String(A),g,e)}g=!1,(o=(c=i(c,e,10,d.s)).indexOf("."))>-1?c=c.replace(".",""):o=c.length}for(s=0;48===c.charCodeAt(s);s++);for(l=c.length;48===c.charCodeAt(--l););if(c=c.slice(s,++l)){if(l-=s,g&&S.DEBUG&&l>15&&(A>Xa||A!==Va(A)))throw Error(ja+d.s*A);if((o=o-s-1)>f)d.c=d.e=null;else if(o=B)?ar(s,r):rr(s,r,"0");else if(a=(A=b(new S(A),e,t)).e,o=(s=er(A.c)).length,1==i||2==i&&(e<=a||a<=u)){for(;oo){if(--e>0)for(s+=".";e--;s+="0");}else if((e+=a-o)>0)for(a+1==o&&(s+=".");e--;s+="0");return A.s<0&&n?"-"+s:s}function v(A,e){for(var t,i,n=1,a=new S(A[0]);n=10;n/=10,i++);return(t=i+t*Za-1)>f?A.c=A.e=null:t=10;o/=10,n++);if((a=e-n)<0)a+=Za,r=e,s=c[g=0],l=Va(s/d[n-r-1]%10);else if((g=Ka((a+1)/Za))>=c.length){if(!i)break A;for(;c.length<=g;c.push(0));s=l=0,n=1,r=(a%=Za)-Za+1}else{for(s=o=c[g],n=1;o>=10;o/=10,n++);l=(r=(a%=Za)-Za+n)<0?0:Va(s/d[n-r-1]%10)}if(i=i||e<0||null!=c[g+1]||(r<0?s:s%d[n-r-1]),i=t<4?(l||i)&&(0==t||t==(A.s<0?3:2)):l>5||5==l&&(4==t||i||6==t&&(a>0?r>0?s/d[n-r]:0:c[g-1])%10&1||t==(A.s<0?8:7)),e<1||!c[0])return c.length=0,i?(e-=A.e+1,c[0]=d[(Za-e%Za)%Za],A.e=-e||0):c[0]=A.e=0,A;if(0==a?(c.length=g,o=1,g--):(c.length=g+1,o=d[Za-a],c[g]=r>0?Va(s/d[n-r]%d[r])*o:0),i)for(;;){if(0==g){for(a=1,r=c[0];r>=10;r/=10,a++);for(r=c[0]+=o,o=1;r>=10;r/=10,o++);a!=o&&(A.e++,c[0]==Wa&&(c[0]=1));break}if(c[g]+=o,c[g]!=Wa)break;c[g--]=0,o=1}for(a=c.length;0===c[--a];c.pop());}A.e>f?A.c=A.e=null:A.e=B?ar(e,t):rr(e,t,"0"),A.s<0?"-"+e:e)}return S.clone=A,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(A){var e,t;if(null!=A){if("object"!=typeof A)throw Error(Oa+"Object expected: "+A);if(A.hasOwnProperty(e="DECIMAL_PLACES")&&(ir(t=A[e],0,$a,e),C=t),A.hasOwnProperty(e="ROUNDING_MODE")&&(ir(t=A[e],0,8,e),h=t),A.hasOwnProperty(e="EXPONENTIAL_AT")&&((t=A[e])&&t.pop?(ir(t[0],-$a,0,e),ir(t[1],0,$a,e),u=t[0],B=t[1]):(ir(t,-$a,$a,e),u=-(B=t<0?-t:t))),A.hasOwnProperty(e="RANGE"))if((t=A[e])&&t.pop)ir(t[0],-$a,-1,e),ir(t[1],1,$a,e),E=t[0],f=t[1];else{if(ir(t,-$a,$a,e),!t)throw Error(Oa+e+" cannot be zero: "+t);E=-(f=t<0?-t:t)}if(A.hasOwnProperty(e="CRYPTO")){if((t=A[e])!==!!t)throw Error(Oa+e+" not true or false: "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Q=!t,Error(Oa+"crypto unavailable");Q=t}else Q=t}if(A.hasOwnProperty(e="MODULO_MODE")&&(ir(t=A[e],0,9,e),x=t),A.hasOwnProperty(e="POW_PRECISION")&&(ir(t=A[e],0,$a,e),p=t),A.hasOwnProperty(e="FORMAT")){if("object"!=typeof(t=A[e]))throw Error(Oa+e+" not an object: "+t);m=t}if(A.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(t=A[e])||/^.?$|[+\-.\s]|(.).*\1/.test(t))throw Error(Oa+e+" invalid: "+t);_="0123456789"==t.slice(0,10),y=t}}return{DECIMAL_PLACES:C,ROUNDING_MODE:h,EXPONENTIAL_AT:[u,B],RANGE:[E,f],CRYPTO:Q,MODULO_MODE:x,POW_PRECISION:p,FORMAT:m,ALPHABET:y}},S.isBigNumber=function(A){if(!A||!0!==A._isBigNumber)return!1;if(!S.DEBUG)return!0;var e,t,i=A.c,n=A.e,a=A.s;A:if("[object Array]"=={}.toString.call(i)){if((1===a||-1===a)&&n>=-$a&&n<=$a&&n===Va(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break A}if((e=(n+1)%Za)<1&&(e+=Za),String(i[0]).length==e){for(e=0;e=Wa||t!==Va(t))break A;if(0!==t)return!0}}}else if(null===i&&null===n&&(null===a||1===a||-1===a))return!0;throw Error(Oa+"Invalid BigNumber: "+A)},S.maximum=S.max=function(){return v(arguments,-1)},S.minimum=S.min=function(){return v(arguments,1)},S.random=(a=9007199254740992,r=Math.random()*a&2097151?function(){return Va(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(A){var e,t,i,n,a,o=0,s=[],g=new S(I);if(null==A?A=C:ir(A,0,$a),n=Ka(A/Za),Q)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(n*=2));o>>11))>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),e[o]=t[0],e[o+1]=t[1]):(s.push(a%1e14),o+=2);o=n/2}else{if(!crypto.randomBytes)throw Q=!1,Error(Oa+"crypto unavailable");for(e=crypto.randomBytes(n*=7);o=9e15?crypto.randomBytes(7).copy(e,o):(s.push(a%1e14),o+=7);o=n/7}if(!Q)for(;o=10;a/=10,o++);ot-1&&(null==r[n+1]&&(r[n+1]=0),r[n+1]+=r[n]/t|0,r[n]%=t)}return r.reverse()}return function(i,n,a,r,o){var s,g,l,c,d,I,u,B,E=i.indexOf("."),f=C,Q=h;for(E>=0&&(c=p,p=0,i=i.replace(".",""),I=(B=new S(n)).pow(i.length-E),p=c,B.c=e(rr(er(I.c),I.e,"0"),10,a,A),B.e=B.c.length),l=c=(u=e(i,n,a,o?(s=y,A):(s=A,y))).length;0==u[--c];u.pop());if(!u[0])return s.charAt(0);if(E<0?--l:(I.c=u,I.e=l,I.s=r,u=(I=t(I,B,f,Q,a)).c,d=I.r,l=I.e),E=u[g=l+f+1],c=a/2,d=d||g<0||null!=u[g+1],d=Q<4?(null!=E||d)&&(0==Q||Q==(I.s<0?3:2)):E>c||E==c&&(4==Q||d||6==Q&&1&u[g-1]||Q==(I.s<0?8:7)),g<1||!u[0])i=d?rr(s.charAt(1),-f,s.charAt(0)):s.charAt(0);else{if(u.length=g,d)for(--a;++u[--g]>a;)u[g]=0,g||(++l,u=[1].concat(u));for(c=u.length;!u[--c];);for(E=0,i="";E<=c;i+=s.charAt(u[E++]));i=rr(i,l,s.charAt(0))}return i}}(),t=function(){function A(A,e,t){var i,n,a,r,o=0,s=A.length,g=e%za,l=e/za|0;for(A=A.slice();s--;)o=((n=g*(a=A[s]%za)+(i=l*a+(r=A[s]/za|0)*g)%za*za+o)/t|0)+(i/za|0)+l*r,A[s]=n%t;return o&&(A=[o].concat(A)),A}function e(A,e,t,i){var n,a;if(t!=i)a=t>i?1:-1;else for(n=a=0;ne[n]?1:-1;break}return a}function t(A,e,t,i){for(var n=0;t--;)A[t]-=n,n=A[t]1;A.splice(0,1));}return function(i,n,a,r,o){var s,g,l,c,d,I,C,h,u,B,E,f,Q,x,p,m,y,_=i.s==n.s?1:-1,D=i.c,v=n.c;if(!(D&&D[0]&&v&&v[0]))return new S(i.s&&n.s&&(D?!v||D[0]!=v[0]:v)?D&&0==D[0]||!v?0*_:_/0:NaN);for(u=(h=new S(_)).c=[],_=a+(g=i.e-n.e)+1,o||(o=Wa,g=Ar(i.e/Za)-Ar(n.e/Za),_=_/Za|0),l=0;v[l]==(D[l]||0);l++);if(v[l]>(D[l]||0)&&g--,_<0)u.push(1),c=!0;else{for(x=D.length,m=v.length,l=0,_+=2,(d=Va(o/(v[0]+1)))>1&&(v=A(v,d,o),D=A(D,d,o),m=v.length,x=D.length),Q=m,E=(B=D.slice(0,m)).length;E=o/2&&p++;do{if(d=0,(s=e(v,B,m,E))<0){if(f=B[0],m!=E&&(f=f*o+(B[1]||0)),(d=Va(f/p))>1)for(d>=o&&(d=o-1),C=(I=A(v,d,o)).length,E=B.length;1==e(I,B,C,E);)d--,t(I,m=10;_/=10,l++);b(h,a+(h.e=l+g*Za-1)+1,r,c)}else h.e=g,h.r=+c;return h}}(),o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,g=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,c=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(A,e,t,i){var n,a=t?e:e.replace(c,"");if(l.test(a))A.s=isNaN(a)?null:a<0?-1:1;else{if(!t&&(a=a.replace(o,(function(A,e,t){return n="x"==(t=t.toLowerCase())?16:"b"==t?2:8,i&&i!=n?A:e})),i&&(n=i,a=a.replace(s,"$1").replace(g,"0.$1")),e!=a))return new S(a,n);if(S.DEBUG)throw Error(Oa+"Not a"+(i?" base "+i:"")+" number: "+e);A.s=null}A.c=A.e=null},d.absoluteValue=d.abs=function(){var A=new S(this);return A.s<0&&(A.s=1),A},d.comparedTo=function(A,e){return tr(this,new S(A,e))},d.decimalPlaces=d.dp=function(A,e){var t,i,n,a=this;if(null!=A)return ir(A,0,$a),null==e?e=h:ir(e,0,8),b(new S(a),A+a.e+1,e);if(!(t=a.c))return null;if(i=((n=t.length-1)-Ar(this.e/Za))*Za,n=t[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},d.dividedBy=d.div=function(A,e){return t(this,new S(A,e),C,h)},d.dividedToIntegerBy=d.idiv=function(A,e){return t(this,new S(A,e),0,1)},d.exponentiatedBy=d.pow=function(A,e){var t,i,n,a,r,o,s,g,l=this;if((A=new S(A)).c&&!A.isInteger())throw Error(Oa+"Exponent not an integer: "+F(A));if(null!=e&&(e=new S(e)),r=A.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!A.c||!A.c[0])return g=new S(Math.pow(+F(l),r?A.s*(2-nr(A)):+F(A))),e?g.mod(e):g;if(o=A.s<0,e){if(e.c?!e.c[0]:!e.s)return new S(NaN);(i=!o&&l.isInteger()&&e.isInteger())&&(l=l.mod(e))}else{if(A.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||r&&l.c[1]>=24e7:l.c[0]<8e13||r&&l.c[0]<=9999975e7)))return a=l.s<0&&nr(A)?-0:0,l.e>-1&&(a=1/a),new S(o?1/a:a);p&&(a=Ka(p/Za+2))}for(r?(t=new S(.5),o&&(A.s=1),s=nr(A)):s=(n=Math.abs(+F(A)))%2,g=new S(I);;){if(s){if(!(g=g.times(l)).c)break;a?g.c.length>a&&(g.c.length=a):i&&(g=g.mod(e))}if(n){if(0===(n=Va(n/2)))break;s=n%2}else if(b(A=A.times(t),A.e+1,1),A.e>14)s=nr(A);else{if(0==(n=+F(A)))break;s=n%2}l=l.times(l),a?l.c&&l.c.length>a&&(l.c.length=a):i&&(l=l.mod(e))}return i?g:(o&&(g=I.div(g)),e?g.mod(e):a?b(g,p,h,void 0):g)},d.integerValue=function(A){var e=new S(this);return null==A?A=h:ir(A,0,8),b(e,e.e+1,A)},d.isEqualTo=d.eq=function(A,e){return 0===tr(this,new S(A,e))},d.isFinite=function(){return!!this.c},d.isGreaterThan=d.gt=function(A,e){return tr(this,new S(A,e))>0},d.isGreaterThanOrEqualTo=d.gte=function(A,e){return 1===(e=tr(this,new S(A,e)))||0===e},d.isInteger=function(){return!!this.c&&Ar(this.e/Za)>this.c.length-2},d.isLessThan=d.lt=function(A,e){return tr(this,new S(A,e))<0},d.isLessThanOrEqualTo=d.lte=function(A,e){return-1===(e=tr(this,new S(A,e)))||0===e},d.isNaN=function(){return!this.s},d.isNegative=function(){return this.s<0},d.isPositive=function(){return this.s>0},d.isZero=function(){return!!this.c&&0==this.c[0]},d.minus=function(A,e){var t,i,n,a,r=this,o=r.s;if(e=(A=new S(A,e)).s,!o||!e)return new S(NaN);if(o!=e)return A.s=-e,r.plus(A);var s=r.e/Za,g=A.e/Za,l=r.c,c=A.c;if(!s||!g){if(!l||!c)return l?(A.s=-e,A):new S(c?r:NaN);if(!l[0]||!c[0])return c[0]?(A.s=-e,A):new S(l[0]?r:3==h?-0:0)}if(s=Ar(s),g=Ar(g),l=l.slice(),o=s-g){for((a=o<0)?(o=-o,n=l):(g=s,n=c),n.reverse(),e=o;e--;n.push(0));n.reverse()}else for(i=(a=(o=l.length)<(e=c.length))?o:e,o=e=0;e0)for(;e--;l[t++]=0);for(e=Wa-1;i>o;){if(l[--i]=0;){for(t=0,d=f[n]%u,I=f[n]/u|0,a=n+(r=s);a>n;)t=((g=d*(g=E[--r]%u)+(o=I*g+(l=E[r]/u|0)*d)%u*u+C[a]+t)/h|0)+(o/u|0)+I*l,C[a--]=g%h;C[a]=t}return t?++i:C.splice(0,1),w(A,C,i)},d.negated=function(){var A=new S(this);return A.s=-A.s||null,A},d.plus=function(A,e){var t,i=this,n=i.s;if(e=(A=new S(A,e)).s,!n||!e)return new S(NaN);if(n!=e)return A.s=-e,i.minus(A);var a=i.e/Za,r=A.e/Za,o=i.c,s=A.c;if(!a||!r){if(!o||!s)return new S(n/0);if(!o[0]||!s[0])return s[0]?A:new S(o[0]?i:0*n)}if(a=Ar(a),r=Ar(r),o=o.slice(),n=a-r){for(n>0?(r=a,t=s):(n=-n,t=o),t.reverse();n--;t.push(0));t.reverse()}for((n=o.length)-(e=s.length)<0&&(t=s,s=o,o=t,e=n),n=0;e;)n=(o[--e]=o[e]+s[e]+n)/Wa|0,o[e]=Wa===o[e]?0:o[e]%Wa;return n&&(o=[n].concat(o),++r),w(A,o,r)},d.precision=d.sd=function(A,e){var t,i,n,a=this;if(null!=A&&A!==!!A)return ir(A,1,$a),null==e?e=h:ir(e,0,8),b(new S(a),A,e);if(!(t=a.c))return null;if(i=(n=t.length-1)*Za+1,n=t[n]){for(;n%10==0;n/=10,i--);for(n=t[0];n>=10;n/=10,i++);}return A&&a.e+1>i&&(i=a.e+1),i},d.shiftedBy=function(A){return ir(A,-9007199254740991,Xa),this.times("1e"+A)},d.squareRoot=d.sqrt=function(){var A,e,i,n,a,r=this,o=r.c,s=r.s,g=r.e,l=C+4,c=new S("0.5");if(1!==s||!o||!o[0])return new S(!s||s<0&&(!o||o[0])?NaN:o?r:1/0);if(0==(s=Math.sqrt(+F(r)))||s==1/0?(((e=er(o)).length+g)%2==0&&(e+="0"),s=Math.sqrt(+e),g=Ar((g+1)/2)-(g<0||g%2),i=new S(e=s==1/0?"5e"+g:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+g)):i=new S(s+""),i.c[0])for((s=(g=i.e)+l)<3&&(s=0);;)if(a=i,i=c.times(a.plus(t(r,a,l,1))),er(a.c).slice(0,s)===(e=er(i.c)).slice(0,s)){if(i.e0&&C>0){for(a=C%o||o,l=I.substr(0,a);a0&&(l+=g+I.slice(a)),d&&(l="-"+l)}i=c?l+(t.decimalSeparator||"")+((s=+t.fractionGroupSize)?c.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(t.fractionGroupSeparator||"")):c):l}return(t.prefix||"")+i+(t.suffix||"")},d.toFraction=function(A){var e,i,n,a,r,o,s,g,l,c,d,C,u=this,B=u.c;if(null!=A&&(!(s=new S(A)).isInteger()&&(s.c||1!==s.s)||s.lt(I)))throw Error(Oa+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+F(s));if(!B)return new S(u);for(e=new S(I),l=i=new S(I),n=g=new S(I),C=er(B),r=e.e=C.length-u.e-1,e.c[0]=qa[(o=r%Za)<0?Za+o:o],A=!A||s.comparedTo(e)>0?r>0?e:l:s,o=f,f=1/0,s=new S(C),g.c[0]=0;c=t(s,e,0,1),1!=(a=i.plus(c.times(n))).comparedTo(A);)i=n,n=a,l=g.plus(c.times(a=l)),g=a,e=s.minus(c.times(a=e)),s=a;return a=t(A.minus(i),n,0,1),g=g.plus(a.times(l)),i=i.plus(a.times(n)),g.s=l.s=u.s,d=t(l,n,r*=2,h).minus(u).abs().comparedTo(t(g,i,r,h).minus(u).abs())<1?[l,n]:[g,i],f=o,d},d.toNumber=function(){return+F(this)},d.toPrecision=function(A,e){return null!=A&&ir(A,1,$a),D(this,A,e,2)},d.toString=function(A){var e,t=this,n=t.s,a=t.e;return null===a?n?(e="Infinity",n<0&&(e="-"+e)):e="NaN":(null==A?e=a<=u||a>=B?ar(er(t.c),a):rr(er(t.c),a,"0"):10===A&&_?e=rr(er((t=b(new S(t),C+a+1,h)).c),t.e,"0"):(ir(A,2,y.length,"Base"),e=i(rr(er(t.c),a,"0"),10,A,n,!0)),n<0&&t.c[0]&&(e="-"+e)),e},d.valueOf=d.toJSON=function(){return F(this)},d._isBigNumber=!0,d[Symbol.toStringTag]="BigNumber",d[Symbol.for("nodejs.util.inspect.custom")]=d.valueOf,null!=e&&S.set(e),S}();function gr(A){var e;return null!==(e=or[A])&&void 0!==e?e:or.default}!function(A){A[A.up=sr.ROUND_UP]="up",A[A.down=sr.ROUND_DOWN]="down",A[A.truncate=sr.ROUND_DOWN]="truncate",A[A.halfUp=sr.ROUND_HALF_UP]="halfUp",A[A.default=sr.ROUND_HALF_UP]="default",A[A.halfDown=sr.ROUND_HALF_DOWN]="halfDown",A[A.halfEven=sr.ROUND_HALF_EVEN]="halfEven",A[A.banker=sr.ROUND_HALF_EVEN]="banker",A[A.ceiling=sr.ROUND_CEIL]="ceiling",A[A.ceil=sr.ROUND_CEIL]="ceil",A[A.floor=sr.ROUND_FLOOR]="floor"}(or||(or={}));var lr=Math.floor,cr=/\s/,dr=/^\s+/,Ir=function(A){return A?A.slice(0,function(A){for(var e=A.length;e--&&cr.test(A.charAt(e)););return e}(A)+1).replace(dr,""):A},Cr=gA,hr=iA,ur=/^[-+]0x[0-9a-f]+$/i,Br=/^0b[01]+$/i,Er=/^0o[0-7]+$/i,fr=parseInt,Qr=1/0,xr=function(A){return A?(A=function(A){if("number"==typeof A)return A;if(hr(A))return NaN;if(Cr(A)){var e="function"==typeof A.valueOf?A.valueOf():A;A=Cr(e)?e+"":e}if("string"!=typeof A)return 0===A?A:+A;A=Ir(A);var t=Br.test(A);return t||Er.test(A)?fr(A.slice(2),t?2:8):ur.test(A)?NaN:+A}(A))===Qr||A===-1/0?17976931348623157e292*(A<0?-1:1):A==A?A:0:0===A?A:0},pr=xr,mr=cn,yr=xe,_r=T((function(A,e,t){return e=(t?mr(A,e,t):void 0===e)?1:function(A){var e=pr(A),t=e%1;return e==e?t?e-t:e:0}(e),function(A,e){var t="";if(!A||e<1||e>9007199254740991)return t;do{e%2&&(t+=A),(e=lr(e/2))&&(A+=A)}while(e);return t}(yr(A),e)}));function Sr(A,e){const t=function(A,e){let{precision:t,significant:i}=e;return i&&null!==t&&t>0?t-function(A){return A.isZero()?1:Math.floor(Math.log10(A.abs().toNumber())+1)}(A):t}(A,e);if(null===t)return A.toString();const i=gr(e.roundMode);if(t>=0)return A.toFixed(t,i);const n=Math.pow(10,Math.abs(t));return(A=new sr(A.div(n).toFixed(0,i)).times(n)).toString()}function Dr(A,e){var t,i,n;const a=new sr(A);if(e.raise&&!a.isFinite())throw new Error(`"${A}" is not a valid numeric value`);const r=Sr(a,e),o=new sr(r),s=o.lt(0),g=o.isZero();let[l,c]=r.split(".");const d=[];let I;const C=null!==(t=e.format)&&void 0!==t?t:"%n",h=null!==(i=e.negativeFormat)&&void 0!==i?i:`-${C}`,u=s&&!g?h:C;for(l=l.replace("-","");l.length>0;)d.unshift(l.substr(Math.max(0,l.length-3),3)),l=l.substr(0,l.length-3);return l=d.join(""),I=d.join(e.delimiter),c=e.significant?function(A){let{significand:e,whole:t,precision:i}=A;if("0"===t||null===i)return e;const n=Math.max(0,i-t.length);return(null!=e?e:"").substr(0,n)}({whole:l,significand:c,precision:e.precision}):null!=c?c:_r("0",null!==(n=e.precision)&&void 0!==n?n:0),e.stripInsignificantZeros&&c&&(c=c.replace(/0+$/,"")),a.isNaN()&&(I=A.toString()),c&&a.isFinite()&&(I+=(e.separator||".")+c),function(A,e){let{formattedNumber:t,unit:i}=e;return A.replace("%n",t).replace("%u",i)}(u,{formattedNumber:I,unit:e.unit})}function vr(A,e,t){let i="";return(e instanceof String||"string"==typeof e)&&(i=e),e instanceof Array&&(i=e.join(A.defaultSeparator)),t.scope&&(i=[t.scope,i].join(A.defaultSeparator)),i}function wr(A){var e,t;if(null===A)return"null";const i=typeof A;return"object"!==i?i:(null===(t=null===(e=null==A?void 0:A.constructor)||void 0===e?void 0:e.name)||void 0===t?void 0:t.toLowerCase())||"object"}function br(A,e,t){t=Object.keys(t).reduce(((e,i)=>(e[A.transformKey(i)]=t[i],e)),{});const i=e.match(A.placeholder);if(!i)return e;for(;i.length;){let n;const a=i.shift(),r=a.replace(A.placeholder,"$1");n=Ja(t[r])?t[r].toString().replace(/\$/gm,"_#$#_"):r in t?A.nullPlaceholder(A,a,e,t):A.missingPlaceholder(A,a,e,t);const o=new RegExp(a.replace(/\{/gm,"\\{").replace(/\}/gm,"\\}"));e=e.replace(o,n)}return e.replace(/_#\$#_/g,"$")}function Fr(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i="locale"in(t=Object.assign({},t))?t.locale:A.locale,n=wr(i),a=A.locales.get("string"===n?i:typeof i).slice(),r=vr(A,e,t).split(A.defaultSeparator).map((e=>A.transformKey(e))),o=a.map((e=>r.reduce(((A,e)=>A&&A[e]),A.translations[e])));return o.push(t.defaultValue),o.find((A=>Ja(A)))}var Rr=function(A,e){for(var t=-1,i=e.length,n=A.length;++to))return!1;var g=a.get(A),l=a.get(e);if(g&&l)return g==e&&l==A;var c=-1,d=!0,I=2&t?new Lr:void 0;for(a.set(A,e),a.set(e,A);++ce||a&&r&&s&&!o&&!g||i&&r&&s||!t&&s||!n)return 1;if(!i&&!a&&!g&&A0&&i(s)?t>1?A(s,t-1,i,n,a):Tr(a,s):n||(a[a.length]=s)}return a},ws=function(A,e,t){e=e.length?ps(e,(function(A){return Ds(A)?function(e){return ms(e,1===A.length?A[0]:A)}:A})):[Ss];var i=-1;e=ps(e,_s(ys));var n=function(A,e){var t=-1,i=fs(A)?Array(A.length):[];return Es(A,(function(A,n,a){i[++t]=e(A,n,a)})),i}(A,(function(A,t,n){return{criteria:ps(e,(function(e){return e(A)})),index:++i,value:A}}));return function(A,e){var t=A.length;for(A.sort(e);t--;)A[t]=A[t].value;return A}(n,(function(A,e){return function(A,e,t){for(var i=-1,n=A.criteria,a=e.criteria,r=n.length,o=t.length;++i=o?s:s*("desc"==t[i]?-1:1)}return A.index-e.index}(A,e,t)}))},bs=cn,Fs=T(rn((function(A,e){if(null==A)return[];var t=e.length;return t>1&&bs(A,e[0],e[1])?e=[]:t>2&&bs(e[0],e[1],e[2])&&(e=[e[0]]),ws(A,vs(e,1),[])}))),Rs=gi;const ks={0:"unit",1:"ten",2:"hundred",3:"thousand",6:"million",9:"billion",12:"trillion",15:"quadrillion","-1":"deci","-2":"centi","-3":"mili","-6":"micro","-9":"nano","-12":"pico","-15":"femto"},Ps=T((function(A,e){return function(A,e,t){for(var i=-1,n=A.length,a=e.length,r={};++iparseInt(A,10))));const Ns=["byte","kb","mb","gb","tb","pb","eb"];function Ts(A){if(A instanceof Date)return A;if("number"==typeof A){const e=new Date;return e.setTime(A),e}const e=new String(A).match(/(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2})(?:[.,](\d{1,3}))?)?(Z|\+00:?00)?/);if(e){const A=e.slice(1,8).map((A=>parseInt(A,10)||0));A[1]-=1;const[t,i,n,a,r,o,s]=A;return e[8]?new Date(Date.UTC(t,i,n,a,r,o,s)):new Date(t,i,n,a,r,o,s)}A.match(/([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d+:\d+:\d+) ([+-]\d+) (\d+)/)&&(new Date).setTime(Date.parse([RegExp.$1,RegExp.$2,RegExp.$3,RegExp.$6,RegExp.$4,RegExp.$5].join(" ")));const t=new Date;return t.setTime(Date.parse(A)),t}function Ms(A){let e,t,{i18n:i,count:n,scope:a,options:r,baseScope:o}=A;if(r=Object.assign({},r),e="object"==typeof a&&a?a:Fr(i,a,r),!e)return i.missingTranslation.get(a,r);const s=i.pluralization.get(r.locale)(i,n),g=[];for(;s.length;){const A=s.shift();if(Ja(e[A])){t=e[A];break}g.push(A)}return Ja(t)?(r.count=n,i.interpolate(i,t,r)):i.missingTranslation.get(o.split(i.defaultSeparator).concat([g[0]]),r)}const Ls={meridian:{am:"AM",pm:"PM"},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbrDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],monthNames:[null,"January","February","March","April","May","June","July","August","September","October","November","December"],abbrMonthNames:[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};var Gs=Math.ceil,Ys=Math.max,Us=cn,Js=xr,Hs=T((function(A,e,t){return t&&"number"!=typeof t&&Us(A,e,t)&&(e=t=void 0),A=Js(A),void 0===e?(e=A,A=0):e=Js(e),function(A,e,t){for(var i=-1,n=Ys(Gs((e-A)/(t||1)),0),a=Array(n);n--;)a[++i]=A,A+=t;return a}(A,e,t=void 0===t?At>=A&&t<=e,Vs=function(A,e){e instanceof Array&&(e=e.join(A.defaultSeparator));const t=e.split(A.defaultSeparator).slice(-1)[0];return A.missingTranslationPrefix+t.replace("_"," ").replace(/([a-z])([A-Z])/g,((A,e,t)=>`${e} ${t.toLowerCase()}`))},Os=(A,e,t)=>{const i=vr(A,e,t),n="locale"in t?t.locale:A.locale,a=wr(n);return`[missing "${["string"==a?n:a,i].join(A.defaultSeparator)}" translation]`},js=(A,e,t)=>{const i=vr(A,e,t),n=[A.locale,i].join(A.defaultSeparator);throw new Error(`Missing translation: ${n}`)};class Ws{constructor(A){this.i18n=A,this.registry={},this.register("guess",Vs),this.register("message",Os),this.register("error",js)}register(A,e){this.registry[A]=e}get(A,e){var t;return this.registry[null!==(t=e.missingBehavior)&&void 0!==t?t:this.i18n.missingBehavior](this.i18n,A,e)}}const Zs={defaultLocale:"en",availableLocales:["en"],locale:"en",defaultSeparator:".",placeholder:/(?:\{\{|%\{)(.*?)(?:\}\}?)/gm,enableFallback:!1,missingBehavior:"message",missingTranslationPrefix:"",missingPlaceholder:(A,e)=>`[missing "${e}" value]`,nullPlaceholder:(A,e,t,i)=>A.missingPlaceholder(A,e,t,i),transformKey:A=>A};let Xs=class{constructor(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._locale=Zs.locale,this._defaultLocale=Zs.defaultLocale,this._version=0,this.onChangeHandlers=[],this.translations={},this.availableLocales=[],this.t=this.translate,this.p=this.pluralize,this.l=this.localize,this.distanceOfTimeInWords=this.timeAgoInWords;const{locale:t,enableFallback:i,missingBehavior:n,missingTranslationPrefix:a,missingPlaceholder:r,nullPlaceholder:o,defaultLocale:s,defaultSeparator:g,placeholder:l,transformKey:c}=Object.assign(Object.assign({},Zs),e);this.locale=t,this.defaultLocale=s,this.defaultSeparator=g,this.enableFallback=i,this.locale=t,this.missingBehavior=n,this.missingTranslationPrefix=a,this.missingPlaceholder=r,this.nullPlaceholder=o,this.placeholder=l,this.pluralization=new Pn(this),this.locales=new Rn(this),this.missingTranslation=new Ws(this),this.transformKey=c,this.interpolate=br,this.store(A)}store(A){hn(this.translations,A),this.hasChanged()}get locale(){return this._locale||this.defaultLocale||"en"}set locale(A){if("string"!=typeof A)throw new Error(`Expected newLocale to be a string; got ${wr(A)}`);const e=this._locale!==A;this._locale=A,e&&this.hasChanged()}get defaultLocale(){return this._defaultLocale||"en"}set defaultLocale(A){if("string"!=typeof A)throw new Error(`Expected newLocale to be a string; got ${wr(A)}`);const e=this._defaultLocale!==A;this._defaultLocale=A,e&&this.hasChanged()}translate(A,e){const t=function(A,e,t){let i=[{scope:e}];if(Ja(t.defaults)&&(i=i.concat(t.defaults)),Ja(t.defaultValue)){const n="function"==typeof t.defaultValue?t.defaultValue(A,e,t):t.defaultValue;i.push({message:n}),delete t.defaultValue}return i}(this,A,e=Object.assign({},e));let i;return t.some((A=>(Ja(A.scope)?i=Fr(this,A.scope,e):Ja(A.message)&&(i=A.message),null!=i)))?("string"==typeof i?i=this.interpolate(this,i,e):"object"==typeof i&&i&&Ja(e.count)&&(i=Ms({i18n:this,count:e.count||0,scope:i,options:e,baseScope:vr(this,A,e)})),e&&i instanceof Array&&(i=i.map((A=>"string"==typeof A?br(this,A,e):A))),i):this.missingTranslation.get(A,e)}pluralize(A,e,t){return Ms({i18n:this,count:A,scope:e,options:Object.assign({},t),baseScope:vr(this,e,null!=t?t:{})})}localize(A,e,t){if(t=Object.assign({},t),null==e)return"";switch(A){case"currency":return this.numberToCurrency(e);case"number":return Dr(e,Object.assign({delimiter:",",precision:3,separator:".",significant:!1,stripInsignificantZeros:!1},Fr(this,"number.format")));case"percentage":return this.numberToPercentage(e);default:{let i;return i=A.match(/^(date|time)/)?this.toTime(A,e):e.toString(),br(this,i,t)}}}toTime(A,e){const t=Ts(e),i=Fr(this,A);return t.toString().match(/invalid/i)?t.toString():i?this.strftime(t,i):t.toString()}numberToCurrency(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Dr(A,Object.assign(Object.assign(Object.assign({delimiter:",",format:"%u%n",precision:2,separator:".",significant:!1,stripInsignificantZeros:!1,unit:"$"},Ua(this.get("number.format"))),Ua(this.get("number.currency.format"))),e))}numberToPercentage(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Dr(A,Object.assign(Object.assign(Object.assign({delimiter:"",format:"%n%",precision:3,stripInsignificantZeros:!1,separator:".",significant:!1},Ua(this.get("number.format"))),Ua(this.get("number.percentage.format"))),e))}numberToHumanSize(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(A,e,t){const i=gr(t.roundMode),n=1024,a=new sr(e).abs(),r=a.lt(n);let o;const s=(A=>{const e=Ns.length-1,t=new sr(Math.log(A.toNumber())).div(Math.log(n)).integerValue(sr.ROUND_DOWN).toNumber();return Math.min(e,t)})(a);o=r?a.integerValue():new sr(Sr(a.div(Math.pow(n,s)),{significant:t.significant,precision:t.precision,roundMode:t.roundMode}));const g=A.translate("number.human.storage_units.format",{defaultValue:"%n %u"}),l=A.translate(`number.human.storage_units.units.${r?"byte":Ns[s]}`,{count:a.integerValue().toNumber()});let c=o.toFixed(t.precision,i);return t.stripInsignificantZeros&&(c=c.replace(/(\..*?)0+$/,"$1").replace(/\.$/,"")),g.replace("%n",c).replace("%u",l)}(this,A,Object.assign(Object.assign(Object.assign({delimiter:"",precision:3,significant:!0,stripInsignificantZeros:!0,units:{billion:"Billion",million:"Million",quadrillion:"Quadrillion",thousand:"Thousand",trillion:"Trillion",unit:""}},Ua(this.get("number.human.format"))),Ua(this.get("number.human.storage_units"))),e))}numberToHuman(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(A,e,t){const i={roundMode:t.roundMode,precision:t.precision,significant:t.significant};let n;if("string"===wr(t.units)){const e=t.units;if(n=Fr(A,e),!n)throw new Error(`The scope "${A.locale}${A.defaultSeparator}${vr(A,e,{})}" couldn't be found`)}else n=t.units;let a=Sr(new sr(e),i);const r=((A,e)=>{const t=A.isZero()?0:Math.floor(Math.log10(A.abs().toNumber()));return(A=>Fs(Object.keys(A).map((A=>Ps[A])),(A=>-1*A)))(e).find((A=>t>=A))||0})(new sr(a),n),o=((A,e)=>A[ks[e.toString()]]||"")(n,r);if(a=Sr(new sr(a).div(Math.pow(10,r)),i),t.stripInsignificantZeros){let[A,e]=a.split(".");e=(e||"").replace(/0+$/,""),a=A,e&&(a+=`${t.separator}${e}`)}return t.format.replace("%n",a||"0").replace("%u",o).trim()}(this,A,Object.assign(Object.assign(Object.assign({delimiter:"",separator:".",precision:3,significant:!0,stripInsignificantZeros:!0,format:"%n %u",roundMode:"default",units:{billion:"Billion",million:"Million",quadrillion:"Quadrillion",thousand:"Thousand",trillion:"Trillion",unit:""}},Ua(this.get("number.human.format"))),Ua(this.get("number.human.decimal_units"))),e))}numberToRounded(A,e){return Dr(A,Object.assign({unit:"",precision:3,significant:!1,separator:".",delimiter:"",stripInsignificantZeros:!1},e))}numberToDelimited(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(A,e){const t=new sr(A);if(!t.isFinite())return A.toString();if(!e.delimiterPattern.global)throw new Error(`options.delimiterPattern must be a global regular expression; received ${e.delimiterPattern}`);let[i,n]=t.toString().split(".");return i=i.replace(e.delimiterPattern,(A=>`${A}${e.delimiter}`)),[i,n].filter(Boolean).join(e.separator)}(A,Object.assign({delimiterPattern:/(\d)(?=(\d\d\d)+(?!\d))/g,delimiter:",",separator:"."},e))}withLocale(A,e){return function(A,e,t,i){return new(t||(t=Promise))((function(e,n){function a(A){try{o(i.next(A))}catch(A){n(A)}}function r(A){try{o(i.throw(A))}catch(A){n(A)}}function o(A){var i;A.done?e(A.value):(i=A.value,i instanceof t?i:new t((function(A){A(i)}))).then(a,r)}o((i=i.apply(A,[])).next())}))}(this,0,void 0,(function*(){const t=this.locale;try{this.locale=A,yield e()}finally{this.locale=t}}))}strftime(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{abbrDayNames:i,dayNames:n,abbrMonthNames:a,monthNames:r,meridian:o}=Object.assign(Object.assign({},Ls),t);if(isNaN(A.getTime()))throw new Error("strftime() requires a valid date object, but received an invalid date.");const s=A.getDay(),g=A.getDate(),l=A.getFullYear(),c=A.getMonth()+1,d=A.getHours();let I=d;const C=d>11?"pm":"am",h=A.getSeconds(),u=A.getMinutes(),B=A.getTimezoneOffset(),E=Math.floor(Math.abs(B/60)),f=Math.abs(B)-60*E,Q=(B>0?"-":"+")+(E.toString().length<2?"0"+E:E)+(f.toString().length<2?"0"+f:f);return I>12?I-=12:0===I&&(I=12),(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace("%a",i[s])).replace("%A",n[s])).replace("%b",a[c])).replace("%B",r[c])).replace("%d",g.toString().padStart(2,"0"))).replace("%e",g.toString())).replace("%-d",g.toString())).replace("%H",d.toString().padStart(2,"0"))).replace("%-H",d.toString())).replace("%k",d.toString())).replace("%I",I.toString().padStart(2,"0"))).replace("%-I",I.toString())).replace("%l",I.toString())).replace("%m",c.toString().padStart(2,"0"))).replace("%-m",c.toString())).replace("%M",u.toString().padStart(2,"0"))).replace("%-M",u.toString())).replace("%p",o[C])).replace("%P",o[C].toLowerCase())).replace("%S",h.toString().padStart(2,"0"))).replace("%-S",h.toString())).replace("%w",s.toString())).replace("%y",l.toString().padStart(2,"0").substr(-2))).replace("%-y",l.toString().padStart(2,"0").substr(-2).replace(/^0+/,""))).replace("%Y",l.toString())).replace(/%z/i,Q)}(A,e,Object.assign(Object.assign(Object.assign({},Ua(Fr(this,"date"))),{meridian:{am:Fr(this,"time.am")||"AM",pm:Fr(this,"time.pm")||"PM"}}),t))}update(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!1};if(t.strict&&!tt(this.translations,A))throw new Error(`The path "${A}" is not currently defined`);const i=Pe(this.translations,A),n=wr(i),a=wr(e);if(t.strict&&n!==a)throw new Error(`The current type for "${A}" is "${n}", but you're trying to override it with "${a}"`);let r;r="object"===a?Object.assign(Object.assign({},i),e):e;const o=A.split(this.defaultSeparator),s=o.pop();let g=this.translations;for(const A of o)g[A]||(g[A]={}),g=g[A];g[s]=r,this.hasChanged()}toSentence(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{wordsConnector:t,twoWordsConnector:i,lastWordConnector:n}=Object.assign(Object.assign({wordsConnector:", ",twoWordsConnector:" and ",lastWordConnector:", and "},Ua(Fr(this,"support.array"))),e),a=A.length;switch(a){case 0:return"";case 1:return`${A[0]}`;case 2:return A.join(i);default:return[A.slice(0,a-1).join(t),n,A[a-1]].join("")}}timeAgoInWords(A,e){return function(A,e,t){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=i.scope||"datetime.distance_in_words",a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return A.t(e,{count:t,scope:n})};e=Ts(e),t=Ts(t);let r=e.getTime()/1e3,o=t.getTime()/1e3;r>o&&([e,t,r,o]=[t,e,o,r]);const s=Math.round(o-r),g=Math.round((o-r)/60),l=g/60/24,c=Math.round(g/60),d=Math.round(l),I=Math.round(d/30);if(Ks(0,1,g))return i.includeSeconds?Ks(0,4,s)?a("less_than_x_seconds",5):Ks(5,9,s)?a("less_than_x_seconds",10):Ks(10,19,s)?a("less_than_x_seconds",20):Ks(20,39,s)?a("half_a_minute"):Ks(40,59,s)?a("less_than_x_minutes",1):a("x_minutes",1):0===g?a("less_than_x_minutes",1):a("x_minutes",g);if(Ks(2,44,g))return a("x_minutes",g);if(Ks(45,89,g))return a("about_x_hours",1);if(Ks(90,1439,g))return a("about_x_hours",c);if(Ks(1440,2519,g))return a("x_days",1);if(Ks(2520,43199,g))return a("x_days",d);if(Ks(43200,86399,g))return a("about_x_months",Math.round(g/43200));if(Ks(86400,525599,g))return a("x_months",I);let C=e.getFullYear();e.getMonth()+1>=3&&(C+=1);let h=t.getFullYear();t.getMonth()+1<3&&(h-=1);const u=525600,B=g-1440*(C>h?0:Hs(C,h).filter((A=>1==new Date(A,1,29).getMonth())).length),E=Math.trunc(B/u),f=parseFloat((B/u-E).toPrecision(3));return f<.25?a("about_x_years",E):f<.75?a("over_x_years",E):a("almost_x_years",E+1)}(this,A,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}onChange(A){return this.onChangeHandlers.push(A),()=>{this.onChangeHandlers.splice(this.onChangeHandlers.indexOf(A),1)}}get version(){return this._version}formatNumber(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Dr(A,e=Object.assign(Object.assign({delimiter:",",precision:3,separator:".",unit:"",format:"%u%n",significant:!1,stripInsignificantZeros:!1},Ua(this.get("number.format"))),e))}get(A){return Fr(this,A)}runCallbacks(){this.onChangeHandlers.forEach((A=>A(this)))}hasChanged(){this._version+=1,this.runCallbacks()}};var qs,zs,$s=function(){function A(A,e){this._i18n=new Xs(A,e)}var e=A.prototype;return e.t=function(A,e){return this._i18n.t(A,e)},e.appendTranslations=function(A){var e=this;Object.keys(A).forEach((function(t){e._i18n.translations[t]=Object.assign(e._i18n.translations[t]||{},A[t])}))},e.switchTranslation=function(A){this._i18n.locale=A},e.getCurrentLocale=function(){return this._i18n.locale},e.getCurrentTranslation=function(){return this._i18n.translations[this._i18n.locale]},e.getTranslations=function(){return this._i18n.translations},e.onChange=function(A){var e=this;return this._i18n.onChange((function(){return A(e)}))},e.getVersion=function(){return"1.0.1"},A}();var Ag,eg=function(){if(zs)return qs;zs=1;var A=function(A){return function(A){return!!A&&"object"==typeof A}(A)&&!function(A){var t=Object.prototype.toString.call(A);return"[object RegExp]"===t||"[object Date]"===t||function(A){return A.$$typeof===e}(A)}(A)},e="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function t(A,e){return!1!==e.clone&&e.isMergeableObject(A)?o((t=A,Array.isArray(t)?[]:{}),A,e):A;var t}function i(A,e,i){return A.concat(e).map((function(A){return t(A,i)}))}function n(A){return Object.keys(A).concat(function(A){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(A).filter((function(e){return Object.propertyIsEnumerable.call(A,e)})):[]}(A))}function a(A,e){try{return e in A}catch(A){return!1}}function r(A,e,i){var r={};return i.isMergeableObject(A)&&n(A).forEach((function(e){r[e]=t(A[e],i)})),n(e).forEach((function(n){(function(A,e){return a(A,e)&&!(Object.hasOwnProperty.call(A,e)&&Object.propertyIsEnumerable.call(A,e))})(A,n)||(a(A,n)&&i.isMergeableObject(e[n])?r[n]=function(A,e){if(!e.customMerge)return o;var t=e.customMerge(A);return"function"==typeof t?t:o}(n,i)(A[n],e[n],i):r[n]=t(e[n],i))})),r}function o(e,n,a){(a=a||{}).arrayMerge=a.arrayMerge||i,a.isMergeableObject=a.isMergeableObject||A,a.cloneUnlessOtherwiseSpecified=t;var o=Array.isArray(n);return o===Array.isArray(e)?o?a.arrayMerge(e,n,a):r(e,n,a):t(n,a)}return o.all=function(A,e){if(!Array.isArray(A))throw new Error("first argument should be an array");return A.reduce((function(A,t){return o(A,t,e)}),{})},qs=o}(),tg=B(eg),ig={exports:{}};var ng,ag=(Ag||(Ag=1,function(A){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=A.exports,i=function(){for(var A,t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],i=0,n=t.length,a={};i'),I.innerHTML=C,g.appendChild(I),g.appendChild(l),o.appendChild(g)},e.loadingStop=function(A){var e;null==(e=this.jSPlugin.logger)||e.info(og,"loadingStop()");var t=document.getElementById(A+"-loading-item-0");t&&document.getElementById(A+"-loading-icon")&&t.removeChild(document.getElementById(A+"-loading-icon"))},e.loadingSetText=function(A){var e,t=this;if(null==(e=this.jSPlugin.logger)||e.info(og,"loadingSetText()"),this.loadingClearText(),document.getElementById(this.id+"-loading-item-0")){var i=document.getElementById(this.id+"-loading-item-0"),n=document.getElementById(this.id+"-loading-item-0").childNodes[1];if(n||(i.style.height="100%",(n=document.createElement("div")).innerHTML=A.text,i.appendChild(n)),n.id=this.id+"-loading-item-txt",n.innerHTML=A.text,n.style.fontSize="14px",!this.jSPlugin.isMobile&&this.jSPlugin.isCall){var a=this.jSPlugin.width/1024;n.style.fontSize=28*a+"px",n.style.marginTop="16px"}if(this.jSPlugin.isCall&&1==A.type){var r=document.getElementById(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 ',i.insertBefore(o,r)}if(n.style.color=A.color||"#FFFFFF",n.style.padding="0 6%",n.style.textAlign="center",this.state.text=A.text,A.delayClear)var s=setTimeout((function(){t.loadingClearText(),clearTimeout(s)}),parseInt(A.delayClear))}},e.loadingSetTextWithBtn=function(A){var e,t=this;null==(e=this.jSPlugin.logger)||e.info(og,"loadingSetTextWithBtn()"),this.loadingClear();var i=!!this.jSPlugin.Theme.call&&this.jSPlugin.Theme.call.themeData||null;(i&&(0===i.customConfig.bellPoster||"onCall"===this.jSPlugin.Theme.call.bellStatus)||A.mask)&&document.getElementById(this.id+"-loading-id-0")&&(document.getElementById(this.id+"-loading-id-0").style.background=A.maskStyle||"rgba(0,0,0,0.7)");var n=document.getElementById(this.id+"-loading-item-0");if(n){n.style.height="100%",n.style["pointer-events"]="auto";var a=document.createElement("div");if(a.id=this.id+"-loading-item-txt",a.innerHTML=A.text,a.title=A.text,a.style.color=A.color||"#FFFFFF",A.isMobile){var r=14*(this.jSPlugin.width/375);a.style.fontSize=r+"px"}else{var o=28*(this.jSPlugin.width/1024);a.style.fontSize=o+"px"}if(this.jSPlugin.isInspect&&(a.style="text-align: center; color: white; font-size: 14px; white-space: nowrap;overflow: hidden;text-overflow: ellipsis; width: 70%;"),n.appendChild(a),A.type&&2==A.type){var s=8,g=24;if(A.isMobile){g=24*(this.jSPlugin.width/375)}else{var l=this.jSPlugin.width/1024;s=l<1?16*l:16,g=40*l}var c=document.getElementById(this.id+"-loading-item-txt");(C=document.createElement("div")).style="margin-bottom: "+s+"px;width:"+g+"px;height:"+g+"px;",C.innerHTML='\n \n \n \n \n \n \n \n ',n.insertBefore(C,c)}else{var d=document.createElement("div");if(d.id=this.id+"-loading-item-btn-wrap",d.innerHTML='\n
'+A.btnName+'
\n \n \n \n ',A.isMobile)1==A.type?d.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;":d.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;d.style="color:#648FFC;margin-top:16px;cursor: pointer;font-size:"+24*I+"px;",this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"video"==this.jSPlugin.Theme.inspectMode&&(d.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(n.appendChild(d),A.isMobile&&1==A.type){var C,h=document.getElementById(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 ',n.insertBefore(C,h)}document.getElementById(this.id+"-loading-item-btn-wrap")&&(document.getElementById(this.id+"-loading-item-btn-wrap").onclick=function(){t.jSPlugin.play(),t.loadingClear(),t.loadingStart(t.id),t.loadingSetText({text:"视频加载中"})})}this.state.text=A.text,A.delayClear&&setTimeout((function(){t.loadingClearText()}),parseInt(A.delayClear))}},e.loadingClearText=function(){var A;if(null==(A=this.jSPlugin.logger)||A.info(og,"loadingClearText()"),document.getElementById(this.id+"-loading-item-0")){var e=document.getElementById(this.id+"-loading-item-0").childNodes;e.length>1?e[1].parentNode.removeChild(e[1]):e[0]&&e[0].parentNode.removeChild(e[0])}},e.loadingClear=function(){var A;if(null==(A=this.jSPlugin.logger)||A.info(og,"loadingClearText()"),document.getElementById(this.id+"-loading-item-0")){for(var e=document.getElementById(this.id+"-loading-item-0").childNodes,t=e.length-1;t>=0;t--)e[t].parentNode.removeChild(e[t]);document.getElementById(this.id+"-loading-id-0")&&(document.getElementById(this.id+"-loading-id-0").style.background="none"),document.getElementById(this.id+"-loading-icon")&&document.getElementById(this.id+"-loading-icon").parentNode.removeChild(document.getElementById(this.id+"-loading-icon"))}},e.loadingEnd=function(){var A;null==(A=this.jSPlugin.logger)||A.info(og,"loadingClearText()");var e=document.getElementById(this.id+"-loading-item-0");if(e){e.parentNode.removeChild(e);var t=document.getElementById(this.id+"-loading-id-0");t&&0===t.children.length&&t.parentNode.removeChild(t)}document.getElementById(this.id+"-loading-item-0").style.background="none"},A._instanceStyle=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))},A}(),gg="https://open.ys7.com",lg=256,cg=1536,dg=2304,Ig=[{place:3,name:"鱼眼不矫正",type:0,correctType:0},{place:3,name:"360°全景",type:1,correctType:768},{place:3,name:"4分屏",type:4,correctList:[{correctType:lg,x:.25,y:.25},{correctType:lg,x:.75,y:.25},{correctType:lg,x:.25,y:.75},{correctType:lg,x:.75,y:.75}],correctType:lg},{place:3,name:"柱状",type:5,correctType:cg,viewParam:{x:0,y:0}}],Cg=[{place:1,name:"鱼眼不矫正",type:0,correctType:0},{place:1,name:"360°全景",type:1,correctType:768},{place:1,name:"4分屏",type:2,correctList:[{correctType:lg,x:.25,y:.25},{correctType:lg,x:.75,y:.25},{correctType:lg,x:.25,y:.75},{correctType:lg,x:.75,y:.75}],correctType:lg},{place:1,name:"广角",type:4,correctType:dg}],hg={loggerOptions:{level:"INFO",showTime:!0,name:"ezuikit"},autoplay:!0,env:{domain:gg},host:gg.replace("https://",""),streamInfoCBType:1},ug=[{id:"zh",env:"https://open.ys7.com",logHost:"https://log.ys7.com/statistics.do/opensdk_ezuikit"},{id:"us",env:"https://iusopen.ezvizlife.com",logHost:"https://uslog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"eu",env:"https://ieuopen.ezvizlife.com",logHost:"https://eulog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"sa",env:"https://isaopen.ezvizlife.com",logHost:"https://salog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"sgp",env:"https://isgpopen.ezvizlife.com",logHost:"https://sgplog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"rus",env:"https://irusopen.ezvizlife.com",logHost:"https://ruslog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"india",env:"https://iindiaopen.ezvizlife.com",logHost:"https://indialog.ezvizlife.com/statistics.do/opensdk_ezuikit"}],Bg=[4,2,1,.5],Eg={init:"init",decoderLoad:"decoderLoad",decoderLoaded:"decoderLoaded",firstFrameDisplay:"firstFrameDisplay",streamInfoCB:"streamInfoCB",videoInfo:"videoInfo",audioInfo:"audioInfo",play:"play",stop:"stop",changeVideoLevel:"changeVideoLevel",reSetTheme:"reSetTheme",changePlayUrl:"changePlayUrl",getOSDTime:"getOSDTime",capturePicture:"capturePicture",startSave:"startSave",stopSave:"stopSave",openSound:"openSound",closeSound:"closeSound",enable3DZoom:"enable3DZoom",close3DZoom:"close3DZoom",changeZoomType:"changeZoomType",setPoster:"setPoster",resize:"resize",fast:"fast",slow:"slow",speedChange:"speedChange",seek:"seek",fullscreen:"fullscreen",exitFullscreen:"exitFullscreen",fullscreenChange:"fullscreenChange",destroy:"destroy",getDeviceCapacity:"getDeviceCapacity",pause:"pause",resume:"resume",getVideoLevelList:"getVideoLevelList",getVideoLevel:"getVideoLevel",getPtzStatus:"getPtzStatus",getPlayRate:"getPlayRate",setMirrorFlip:"setMirrorFlip",setFECCorrectType:"setFECCorrectType",setFEC3DViewParam:"setFEC3DViewParam",getFEC3DViewParam:"getFEC3DViewParam",setWaterMarkFont:"setWaterMarkFont",volumeChange:"volumeChange",startTalk:"startTalk",stopTalk:"stopTalk",talkSuccess:"talkSuccess",talkError:"talkError",recTypeChange:"recTypeChange",recTimeChange:"recTimeChange",setLoggerOptions:"setLoggerOptions",setDisplayRegion:"setDisplayRegion",date:{openDatePanel:"openDatePanel",closeDatePanel:"closeDatePanel",recStartTimeChange:"recStartTimeChange"},ptz:{openPtz:"openPtz",closePtz:"closePtz",ptzDirection:"ptzDirection",ptzSpeedChange:"ptzSpeedChange",ptzBtnClick:"ptzBtnClick"},zoom:(ng={startZoom:"startZoom",closeZoom:"closeZoom",onZoomChange:"onZoomChange",openZoom:"openZoom"},ng.closeZoom="closeZoom",ng),timeLine:{timeWidthChange:"timeWidthChange"},http:{getCloudRecordTimes:"getCloudRecordTimes",getLocalRecTimes:"getLocalRecTimes",getCloudRecTimes:"getCloudRecTimes",getDeviceInfo:"getDeviceInfo",getDeviceList:"getDeviceList",setVideoLevel:"setVideoLevel"}},fg="[Ptz]",Qg=function(){function A(e){var t,i=this;if(this.jSPlugin=e,null==(t=this.jSPlugin.logger)||t.log(fg,"init"),this.pluginStatus=new sg(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 '+this.jSPlugin.i18n.t("PTZ_SLOW")+'\n
\n
\n '+this.jSPlugin.i18n.t("PTZ_MID")+'\n
\n
\n '+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(e.id+"-wrap").appendChild(n),document.getElementById(this.jSPlugin.id+"-ez-ptz-container").onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handlePtzTouch(A,"start")},document.getElementById(this.jSPlugin.id+"-ez-ptz-container").onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handlePtzTouch(A,"stop")},document.getElementById(this.jSPlugin.id+"-ez-ptz-container").ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handlePtzTouch(A,"start")},document.getElementById(this.jSPlugin.id+"-ez-ptz-container").ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handlePtzTouch(A,"stop")},document.getElementById(this.jSPlugin.id+"-ez-ptzspeed-container").onmouseup=function(A){var e;A.target.id&&(A.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById(i.jSPlugin.id+"-ptzspeed-slow-dot").classList.add("active"),document.getElementById(i.jSPlugin.id+"-ptzspeed-mid-dot").classList.remove("active"),document.getElementById(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(i.jSPlugin.id+"-ptzspeed-slow-dot").classList.remove("active"),document.getElementById(i.jSPlugin.id+"-ptzspeed-mid-dot").classList.add("active"),document.getElementById(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(i.jSPlugin.id+"-ptzspeed-slow-dot").classList.remove("active"),document.getElementById(i.jSPlugin.id+"-ptzspeed-mid-dot").classList.remove("active"),document.getElementById(i.jSPlugin.id+"-ptzspeed-fast-dot").classList.add("active")),null==(e=i.jSPlugin)||e.eventEmitter.emit(Eg.ptz.ptzSpeedChange,i.jSPlugin.ptzSpeed))},document.getElementById(this.jSPlugin.id+"-ez-ptzspeed-container").ontouchend=function(A){var e,t;A.target.id&&(A.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById(i.jSPlugin.id+"-ptzspeed-slow-dot").classList.add("active"),document.getElementById(i.jSPlugin.id+"-ptzspeed-mid-dot").classList.remove("active"),document.getElementById(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(i.jSPlugin.id+"-ptzspeed-slow-dot").classList.remove("active"),document.getElementById(i.jSPlugin.id+"-ptzspeed-mid-dot").classList.add("active"),document.getElementById(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(i.jSPlugin.id+"-ptzspeed-slow-dot").classList.remove("active"),document.getElementById(i.jSPlugin.id+"-ptzspeed-mid-dot").classList.remove("active"),document.getElementById(i.jSPlugin.id+"-ptzspeed-fast-dot").classList.add("active")),null==(t=i.jSPlugin)||null==(e=t.eventEmitter)||e.emit(Eg.ptz.ptzSpeedChange,i.jSPlugin.ptzSpeed))},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-zoom-add").onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-zoom-add").onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-zoom-sub").onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-zoom-sub").onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-focal-add").onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-focal-add").onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-focal-sub").onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-focal-sub").onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","stop")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-zoom-add").ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-zoom-add").ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-zoom-sub").ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-zoom-sub").ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-focal-add").ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-focal-add").ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-focal-sub").ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById(this.jSPlugin.id+"-ez-ptzbtn-focal-sub").ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","stop")}}var e=A.prototype;return e.destroy=function(){},e.show=function(){document.getElementById(this.jSPlugin.id+"-ez-ptz-item")&&(document.getElementById(this.jSPlugin.id+"-ez-ptz-item").style="display: flex;box-sizing: content-box;"),this.showPtz=!0,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit(Eg.ptz.openPtz,{eventType:"openPtz",code:0,target:this,msg:"开启云台"})},e.hide=function(){document.getElementById(this.jSPlugin.id+"-ez-ptz-item")&&(document.getElementById(this.jSPlugin.id+"-ez-ptz-item").style="display: none"),this.showPtz=!1,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit(Eg.ptz.closePtz,{eventType:"closePtz",code:0,target:this,msg:"关闭云台"})},e._handlePtzTouch=function(A,e){var t,i,n=this,a=document.getElementById(this.jSPlugin.id+"-ez-ptz-container").getBoundingClientRect(),r=a.left+41,o=a.top+41,s=A.x||A.changedTouches[0].clientX,g=A.y||A.changedTouches[0].clientY,l=0,d=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",I=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,C=0;function h(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}var u=/^rotate\(90/.test(document.getElementById(this.jSPlugin.id+"-wrap").style.transform),B=s-r,E=g-o;if(u){var f,Q;switch(h(B,E)){case 1:l=2,C=90;break;case 2:l=4,C=135;break;case 3:l=0,C=180;break;case 4:l=6,C=225;break;case 5:l=3,C=270;break;case 6:l=7,C=315;break;case 7:l=1,C=0;break;case 8:l=5,C=45}null==(Q=this.jSPlugin)||null==(f=Q.logger)||f.log("[Ptz] getAreaId("+B+", "+E+") "+h(B,E)+", isRotate=true")}else{var x,p;switch(h(B,E)){case 1:l=0,C=180;break;case 2:l=6,C=225;break;case 3:l=3,C=270;break;case 4:l=7,C=315;break;case 5:l=1,C=0;break;case 6:l=5,C=45;break;case 7:l=2,C=90;break;case 8:l=4,C=135}null==(p=this.jSPlugin)||null==(x=p.logger)||x.log("[Ptz] getAreaId("+B+", "+E+") "+h(B,E)+", isRotate=false")}null==(i=this.jSPlugin)||null==(t=i.eventEmitter)||t.emit(Eg.ptz.ptzDirection,{areaId:h(B,E),direction:l,backDeg:C,isRotate:u,ptzSpeed:this.jSPlugin.ptzSpeed,type:e}),document.getElementById(this.jSPlugin.id+"-ez-ptz-container").style="background-image:linear-gradient("+C+"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)","stop"===e&&(d=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",I=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById(this.jSPlugin.id+"-ez-ptz-container").style="");var m=new FormData;m.append("deviceSerial",c(this.jSPlugin.url).deviceSerial),m.append("channelNo",c(this.jSPlugin.url).channelNo),m.append("speed",this.jSPlugin.ptzSpeed),m.append("direction",l),m.append("accessToken",I),fetch(d,{method:"POST",body:m}).then((function(A){return A.json()})).then((function(A){if("start"===e&&200!=A.code){var t,i,a;null==(a=n.jSPlugin)||null==(i=a.logger)||i.error("[errors]",(null==(t=n.jSPlugin)?void 0:t.i18n.t("38"+A.code))+"("+A.code+")");var r=n.jSPlugin.i18n.t("38"+A.code)||A.msg;n.pluginStatus.loadingSetText({text:r,color:"red",delayClear:2e3})}60005!=A.code&&60002!=A.code&&60003!=A.code&&60004!=A.code&&60006!=A.code||(document.getElementById(n.jSPlugin.id+"-ez-ptz-container").style="background-image:linear-gradient("+C+"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)")})).catch((function(A){}))},e._handleBtnTouch=function(A,e,t){var i,n,a,r,o=this,s=8;s="zoom"===A?"add"===e?8:9:"add"===e?10:11;var g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",l=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;"stop"===t&&(g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",l=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video),null==(n=this.jSPlugin)||null==(i=n.logger)||i.log(fg,A,e,t),null==(r=this.jSPlugin)||null==(a=r.eventEmitter)||a.emit(Eg.ptz.ptzBtnClick,{btn:A,option:e,type:t});var d=new FormData;d.append("deviceSerial",c(this.jSPlugin.url).deviceSerial),d.append("channelNo",c(this.jSPlugin.url).channelNo),d.append("speed",this.jSPlugin.ptzSpeed),d.append("direction",s),d.append("accessToken",l),fetch(g,{method:"POST",body:d}).then((function(A){return A.json()})).then((function(e){"start"===t&&200!=e.code&&(6e4==e.code||60006==e.code?o.pluginStatus.loadingSetText({text:"zoom"===A?o.jSPlugin.i18n.t("NOT_SUPPORT_DEVICE_ZOOM"):o.jSPlugin.i18n.t("NOT_SUPPORT_FOCUS"),color:"red",delayClear:2e3}):o.pluginStatus.loadingSetText({text:e.msg,color:"red",delayClear:2e3}))})).catch((function(A){}))},A._instanceStyle=function(){if(!A._STYLE){A._STYLE=document.createElement("style"),A._STYLE.id="ezuikit-ptz-style";var e=C();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:"+(e?"60px":"18px")+";\n margin-top: 14px;\n display: "+(e?"block":"flex")+";\n }\n\n .ez-ptzbtn-focal,\n .ez-ptzbtn-zoom{\n width: "+(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: "+(e?"50%":"24px")+";\n height: 20px;\n cursor: pointer;\n text-align: center;\n }\n\n .ez-ptzbtn-zoom{\n margin: "+(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)}},A}(),xg=function(){function A(e,t){this.jSPlugin=e,this.heightPop=t||366,A._instanceStyle(),this.initPopupCustom()}var e=A.prototype;return e.initPopupCustom=function(){document.getElementById(this.jSPlugin.id+"-wrap-popup-custom")?document.getElementById(this.jSPlugin.id+"-wrap-popup-custom").style.display="flex":this.randerPopup()},e.randerPopup=function(){var A=this,e=document.documentElement.clientWidth/375||1,t=document.getElementById(this.jSPlugin.id+"-wrap"),i=document.createElement("div");i.style="display:flex;",i.id=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(this.jSPlugin.id+"-wrap-popup-custom-mask").onclick=function(){A.closePopupCustom()},document.getElementById(this.jSPlugin.id+"-popup-board-close").onclick=function(){A.closePopupCustom()}},e.closePopupCustom=function(A){void 0===A&&(A=function(){}),A();var e=document.getElementById(this.jSPlugin.id+"-wrap"),t=document.getElementById(this.jSPlugin.id+"-wrap-popup-custom");e&&t&&e.removeChild(t)},e.initPopupContent=function(A,e){document.getElementById("popup-board-title-content").innerText=A||"",e&&document.getElementById(this.jSPlugin.id+"-popup-board-content").appendChild(e)},A._instanceStyle=function(){if(!A._STYLE){var e=document.documentElement.clientWidth/375||1;A._STYLE=document.createElement("style"),A._STYLE.innerHTML="@keyframes slideContentUp {0% {bottom: -"+366*e+"px;}\n 25% {bottom: -"+244*e+"px;}\n 50% {bottom: -"+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)}},A}(),pg=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==(n=document.getElementById("time-line-item"))||null==(e=n.parentNode)?void 0:e.scrollTop;a!==i?i=a:(clearInterval(t),A(a))}),100)})).then((function(A){e.rectTopTotime(A),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==(n=document.getElementById("time-line-item"))||null==(e=n.parentNode)?void 0:e.scrollTop;a!==i?i=a:(clearInterval(t),A(a))}),100)})).then((function(A){e.rectTopTotime(A),e.getPlayParam({current:e.state.current})})),A.ontouchend()})),this.matchTimeDot()};pg.prototype.changeScale=function(A){this.setState({timelag:A}),this.matchTimeDot()},pg.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())},pg.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 r=0,o=0;a==n&&(r=70),0==a&&(o=230);var s=this.minuteToTime(a);i.push({id:a,current:s,label:"a"+a,marginTop:r,marginBottom:o,recArr:[]}),a-=t}this.setState({timeArr:i}),this.renderDateLine()},pg.prototype.matchRecTimeDot=function(){var A=this.state;A.start,A.end;var e=A.timelag,t=A.availTimeLine,i=A.timeArr,n=t.length;if(0===n)for(var a=0;as&&i[a].id'})),n+="
'+A.current+"
",i.innerHTML=n,t.appendChild(i)}))},pg.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})},pg.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})},pg.prototype.rectTopTotime=function(A){var e,t,i=this.state.timelag,n=Math.floor(A/60),a=A-60*n;if(0==a)e=this.state.timeArr[n-1].current,t=0;else{var r=this.state.timeArr[n].current,o=this.timeToMinute(r),s=(60-a)*i,g=Math.floor(s/60)+o,l=60*Math.floor(s/60);t=Math.ceil(s-l),e=this.minuteToTime(g)}this.setState({current:e+":"+(t>9?t:"0"+t),scrollTop:A})},pg.prototype.stepScrollTimeLine=function(A){this.setState({current:A}),this.currentOffsetH()},pg.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 mg=pg;var yg=gg,_g=function(){function A(e){return A.instant?A.instant:(yg=e||yg,A.instant=this)}var e=A.prototype;return e.setDomain=function(A){yg=A||yg},e.fetch=function(A,e){return A="string"==typeof A?/^http/.test(A)?A:yg+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)}))}))},A}();function Sg(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),r=A.slice(12,14);return new Date(e+"/"+t+"/"+i+" "+n+":"+a+":"+r)}function Dg(A,e){var t,i,n,a={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},r=Object.keys(a).reduce((function(A,e){return null==a[e]?A:A+="&"+e+"="+encodeURIComponent(a[e])}),"").replace("&",""),o=A.env.domain+"/api/service/cloudrecord/video/info/list?"+r;return null==A||null==(t=A.logger)||t.log("[https request] getCloudRecordTimes()",o),(i=o,n={method:"get",headers:{accessToken:A.accessToken||A.token.deviceToken.global,deviceSerial:e.deviceSerial,localIndex:e.channelNo}},new Promise((function(A,e){fetch(i,n).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(e){var t;return e.data=(e.data||[]).map((function(A){return A.endTime=Sg(A.stopTime).getTime(),A.startTime=Sg(A.startTime).getTime(),A.busType=7,A})),null==A||null==(t=A.eventEmitter)||t.emit(Eg.http.getCloudRecordTimes,e.data),e}))}function vg(A,e){void 0===e&&(e=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),r=A.slice(10,12),o=A.slice(12,14),s=new Date(t,i-1,n,a,r,o);s.setHours(s.getHours()+e),s>new Date&&(s=new Date);var g=s.getFullYear(),l=("0"+(s.getMonth()+1)).slice(-2),c=("0"+s.getDate()).slice(-2),d=("0"+s.getHours()).slice(-2),I=("0"+s.getMinutes()).slice(-2),C=("0"+s.getSeconds()).slice(-2);return new Date(g+"/"+l+"/"+c+" "+d+":"+I+":"+C)}var wg=function(A,e){void 0===e&&(e=0),(e<=-24||e>=24)&&(e=0);var t=60*e*60*1e3,i=A.getTime()+t;return new Date(i)};function bg(){return bg=Object.assign||function(A){for(var e=1;e9?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 Tg=function(){function A(e,t,i){var n;if(null==e||null==(n=e.logger)||n.log("[MobileRec] init"),this.changeRecSpeed=t,this.resetMobileZoomStatus=i,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=c(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(),s("begin",this.jSPlugin.url)){var a=s("begin",this.jSPlugin.url);this.date=a.slice(0,4)+"/"+a.slice(4,6)+"/"+a.slice(6,8),this.begin=this.date+" "+(a.slice(8,10)||"00")+":"+(a.slice(10,12)||"00")+":"+(a.slice(12,14)||"00"),this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(s("end",this.jSPlugin.url)){var r=s("end",this.jSPlugin.url);this.end=this.date+" "+(r.slice(8,10)||"23")+":"+(r.slice(10,12)||"59")+":"+(r.slice(12,14)||"59"),this.initEnd=this.end}this.recInit()}var e=A.prototype;return e.recInit=function(){this.createDom(),this.initTimeLine(),this.fetchDeviceRec(),this.injectJsCss(this.jSPlugin),this.syncTimeLine(),this.bindEvent()},e.injectJsCss=function(A){this.unInjectJsCss();var e=this,i=document.getElementById(A.id+"-wrap");a(A.staticPath+"/rec/datepicker.min.css"),t(A.staticPath+"/rec/jquery.min.js",(function(A){t(A.staticPath+"/rec/datepicker.js",(function(A){t(A.staticPath+"/rec/datepicker."+e.datepickerLang[A.language]+".js",(function(A){var t=i.getElementsByClassName("datepicker-container")[0];!t&&$("#"+A.id+"-datepicker").datepicker&&$("#"+A.id+"-datepicker").datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:e.datepickerLang[A.language],date:new Date(s("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:i}),(t=i.getElementsByClassName("datepicker-container")[0])&&(t.style.display="none",t.style.bottom="-314px",t.style.right="0px"),e.datepickerVisible=!1,$("#"+A.id+"-datepicker").on("pick.datepicker",(function(i){var n={begin:new Date(i.date).Format("yyyyMMddhhmmss")};if(e.begin=i.date,e.end=new Date(i.date).Format("yyyy-MM-dd")+" 23:59:59",i.date>new Date||new Date(i.date).Format("yyyyMMdd")===new Date(document.getElementById(A.id+"-datepicker").getAttribute("data-value")).Format("yyyyMMdd"))i.preventDefault();else{var a=new Date(i.date).Format("yyyy/MM/dd");document.getElementById(A.id+"-datepicker")&&document.getElementById(A.id+"-datepicker").setAttribute("data-value",a),e.date=a,A.eventEmitter.emit(Eg.date.recStartTimeChange,{code:0,data:{time:a}}),A.Theme.decoderState&&A.Theme.decoderState.state&&(A.Theme.decoderState.state.cloudRec?n={begin:new Date(i.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"}:A.Theme.decoderState.state.rec&&(n={begin:new Date(i.date).Format("yyyyMMddhhmmss"),type:"rec"}))}A.changePlayUrl(n,(function(){}),!1).then((function(){setTimeout((function(){var A=document.getElementById("date");A&&(A.value=new Date(i.date).Format("yyyy-MM-dd"))}),0),e.fetchDeviceRec(),e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound(),e.syncTimeLine()})),e.changeRecSpeed(1),e.resetMobileZoomStatus(),t&&(t.style.display="none"),e.datepickerVisible=!1})),$("#"+A.id+"-datepicker").off("click").on("click",(function(i){var n,a;e.datepickerVisible?t&&(t.style.display="none",null==A||null==(n=A.eventEmitter)||n.emit(Eg.date.closeDatePanel)):t&&(t.style.display="inline",null==A||null==(a=A.eventEmitter)||a.emit(Eg.date.openDatePanel));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)},e.createDom=function(){var A=document.createElement("div");A.id="date-switch-container-wrap",A.className="date-switch-container-wrap",A.style="",A.innerHTML='\n
\n
'+this.jSPlugin.i18n.t("RECORD_TIPS")+'
\n
\n \n
\n
\n
\n ',g(A,document.getElementById(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'+this.jSPlugin.i18n.t("RECORDS")+'
\n
\n \n
\n
\n ',g(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 ',g(t,e)},e.initTimeLine=function(){var A,e,t=this;null==(e=this.jSPlugin)||null==(A=e.logger)||A.log("[TimeLine] init"),this.TimeLineOBJ=new mg({id:"time-line-item",getPlayParam:function(A){var e=t,i=A.current,n=new Date(t.date).Format("yyyyMMdd").substr(0,8)+(A.current?i.replace(/:/g,""):A.current.replace(/:/g,""));if("cloud.rec"===t.type||t.jSPlugin.useSeek&&t.jSPlugin.capacity&&"1"==t.jSPlugin.capacity.support_seek_playback){if(!t.isSeeking)if(e.recList.length>0)if(new Date(t.date+" "+A.current).valueOf()>=e.lastDate)t.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}),t.syncTimeLine();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.seek(n.substr(8,6),"235959").then((function(){var A=setInterval((function(){t.jSPlugin.getOSDTime().then((function(i){new Date(1e3*i.data).Format("yyyyMMddhhmmss")>=n&&(t.isSeeking=!1,t.syncTimeLine(),clearInterval(A),t.jSPlugin.pluginStatus.loadingStop(t.jSPlugin.id),t.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),t.jSPlugin.pluginStatus.loadingClear(),t.jSPlugin.Theme.setDisabled(!1),t.jSPlugin.waterMark_JSPlugin&&e.jSPlugin.setWaterMarkFont(e.jSPlugin.waterMark_JSPlugin),e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound())}))}),500)}))})):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,e,t){return e+n})):A+="?begin="+n,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),e.jSPlugin.waterMark_JSPlugin&&e.jSPlugin.setWaterMarkFont(e.jSPlugin.waterMark_JSPlugin)})).catch((function(A){}))}))}else{var a=function(){setTimeout((function(){t.disabled=!1}),t.seekFrequency)},r=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,e,t){return e+n})):i+="?begin="+n,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),e.jSPlugin.waterMark_JSPlugin&&e.jSPlugin.setWaterMarkFont(e.jSPlugin.waterMark_JSPlugin),t.jSPlugin.Theme.decoderState.state.sound&&t.jSPlugin.openSound()})).catch((function(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?(t.seekTimer&&clearTimeout(t.seekTimer),t.seekTimer=setTimeout((function(){r(a)}),t.seekFrequency)):r(a)}},ontouchstart:function(){t.operating=!0,t.unSyncTimeLine()},ontouchmove:function(){0==t.operating&&(t.operating=!0,t.unSyncTimeLine())},ontouchend:function(){t.operating=!1}})},e.unInjectJsCss=function(){Pg.listInstances().length<=1&&(r(this.jSPlugin.staticPath+"/rec/datepicker.min.css"),n(this.jSPlugin.staticPath+"/rec/jquery.min.js"),n(this.jSPlugin.staticPath+"/rec/datepicker.js"),n(this.jSPlugin.staticPath+"/rec/datepicker."+this.datepickerLang[this.jSPlugin.language]+".js"))},e.destroy=function(){var A,e;null==(e=this.jSPlugin)||null==(A=e.logger)||A.log("[MobileRec] destroy"),this.unInjectJsCss()},e.fetchDeviceRec=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],r=Ng(a.endTime),o=Ng(a.startTime);i.push({st:o,et:r})}A.TimeLineOBJ.setDateLine(i)},t=new FormData,i=this;t.append("deviceSerial",c(this.jSPlugin.url).deviceSerial),t.append("channelNo",c(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=s("timeZone",this.jSPlugin.url),a=null,r=null;if(n<=23&&n>=-23&&"cloud.rec"!==this.type){var o=vg(new Date(this.begin).Format("yyyyMMddhhmmss"),+n);a=new Date(o.Format("yyyy/MM/dd")+" 00:00:00").getTime(),r=new Date(o.Format("yyyy/MM/dd")+" 23:59:59").getTime(),t.append("startTime",a),t.append("endTime",r),this.date=o.Format("yyyy/MM/dd")}else a=new Date(this.begin).getTime(),r=new Date(this.end).getTime(),t.append("startTime",a),t.append("endTime",r);if(this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===s("busType",this.jSPlugin.url)){var g={deviceSerial:c(this.jSPlugin.url).deviceSerial,channelNo:c(this.jSPlugin.url).channelNo,startTime:a,endTime:r,spaceId:this.jSPlugin._spaceId};Dg(this.jSPlugin,g).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([])}))},e.syncTimeLine=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!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){}))}),500),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer))},e.unSyncTimeLine=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()}))},e.bindEvent=function(){var A=this;document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(function(e){var t;e.target.checked,A.type=e.target.checked?"rec":"cloud.rec",null==(t=A.jSPlugin)||t.eventEmitter.emit(Eg.recTypeChange,{code:0,data:{type:A.jSPlugin._isCloudRecord&&"cloud.rec"===A.type?"cloudRecord":"rec"===A.type?"local":"cloud"}}),A.jSPlugin.changePlayUrl({type:A.type,begin:new Date(A.date).Format("yyyyMMdd")+"000000"},(function(){A.jSPlugin._isCloudRecord&&A.jSPlugin.Theme.changeTheme("mobileRec")})).then((function(){A.syncTimeLine(),A.changeRecSpeed(1),A.resetMobileZoomStatus(),A.jSPlugin.Theme.decoderState.state.sound&&A.jSPlugin.openSound()}),(function(A){})).catch((function(A){}))}))},A._instanceStyle=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))},A}(),Mg="[Message]",Lg=function(){function A(A,e){var t;this.id=e,this.jSPlugin=A,this.timer=null,this.state={play:!1,loading:!1},null==(t=A.logger)||t.log(Mg,"init")}return A.prototype.default=function(A,e){var t,i,n=this;null==(i=this.jSPlugin)||null==(t=i.logger)||t.log(Mg,"default()");var a="msgId",r=e||document.getElementById(this.id+"-wrap");document.getElementById(this.id+"-"+a)&&r.removeChild(document.getElementById(this.id+"-"+a));var o=document.createElement("div");o.id=this.id+"-"+a,o.style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);text-align: center;padding: 4px 16px;background: #00000080;color: #FFFFFF;font-size: 14px;",o.innerHTML=A,r.appendChild(o),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){var A=document.getElementById(n.id+"-"+a);r&&A&&r.removeChild(A)}),2e3)},A}(),Gg={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:"设置水印"},Yg={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"},Ug="object"==typeof global&&global&&global.Object===Object&&global,Jg="object"==typeof self&&self&&self.Object===Object&&self,Hg=Ug||Jg||Function("return this")(),Kg=Hg.Symbol,Vg=Object.prototype,Og=Vg.hasOwnProperty,jg=Vg.toString,Wg=Kg?Kg.toStringTag:void 0;var Zg=Object.prototype.toString;var Xg=Kg?Kg.toStringTag:void 0;function qg(A){return null==A?void 0===A?"[object Undefined]":"[object Null]":Xg&&Xg in Object(A)?function(A){var e=Og.call(A,Wg),t=A[Wg];try{A[Wg]=void 0;var i=!0}catch(A){}var n=jg.call(A);return i&&(e?A[Wg]=t:delete A[Wg]),n}(A):function(A){return Zg.call(A)}(A)}function zg(A){return null!=A&&"object"==typeof A}function $g(A){return"symbol"==typeof A||zg(A)&&"[object Symbol]"==qg(A)}var Al=Array.isArray,el=Kg?Kg.prototype:void 0,tl=el?el.toString:void 0;function il(A){if("string"==typeof A)return A;if(Al(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 Nl(A){return null!=A&&Pl(A.length)&&!ul(A)}var Tl=Object.prototype;function Ml(A){return zg(A)&&"[object Arguments]"==qg(A)}var Ll=Object.prototype,Gl=Ll.hasOwnProperty,Yl=Ll.propertyIsEnumerable,Ul=Ml(function(){return arguments}())?Ml:function(A){return zg(A)&&Gl.call(A,"callee")&&!Yl.call(A,"callee")};var Jl="object"==typeof exports&&exports&&!exports.nodeType&&exports,Hl=Jl&&"object"==typeof module&&module&&!module.nodeType&&module,Kl=Hl&&Hl.exports===Jl?Hg.Buffer:void 0,Vl=(Kl?Kl.isBuffer:void 0)||function(){return!1},Ol={};Ol["[object Float32Array]"]=Ol["[object Float64Array]"]=Ol["[object Int8Array]"]=Ol["[object Int16Array]"]=Ol["[object Int32Array]"]=Ol["[object Uint8Array]"]=Ol["[object Uint8ClampedArray]"]=Ol["[object Uint16Array]"]=Ol["[object Uint32Array]"]=!0,Ol["[object Arguments]"]=Ol["[object Array]"]=Ol["[object ArrayBuffer]"]=Ol["[object Boolean]"]=Ol["[object DataView]"]=Ol["[object Date]"]=Ol["[object Error]"]=Ol["[object Function]"]=Ol["[object Map]"]=Ol["[object Number]"]=Ol["[object Object]"]=Ol["[object RegExp]"]=Ol["[object Set]"]=Ol["[object String]"]=Ol["[object WeakMap]"]=!1;var jl,Wl="object"==typeof exports&&exports&&!exports.nodeType&&exports,Zl=Wl&&"object"==typeof module&&module&&!module.nodeType&&module,Xl=Zl&&Zl.exports===Wl&&Ug.process,ql=function(){try{var A=Zl&&Zl.require&&Zl.require("util").types;return A||Xl&&Xl.binding&&Xl.binding("util")}catch(A){}}(),zl=ql&&ql.isTypedArray,$l=zl?(jl=zl,function(A){return jl(A)}):function(A){return zg(A)&&Pl(A.length)&&!!Ol[qg(A)]},Ac=Object.prototype.hasOwnProperty;function ec(A,e){var t=Al(A),i=!t&&Ul(A),n=!t&&!i&&Vl(A),a=!t&&!i&&!n&&$l(A),r=t||i||n||a,o=r?function(A,e){for(var t=-1,i=Array(A);++t-1},hc.prototype.set=function(A,e){var t=this.__data__,i=Ic(t,A);return i<0?(++this.size,t.push([A,e])):t[i][1]=e,this};var uc=wl(Hg,"Map");function Bc(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 Ec(A){var e=-1,t=null==A?0:A.length;for(this.clear();++eo))return!1;var g=a.get(A),l=a.get(e);if(g&&l)return g==e&&l==A;var c=-1,d=!0,I=2&t?new Oc:void 0;for(a.set(A,e),a.set(e,A);++c=e||t<0||c&&A-g>=a}function h(){var A=hd();if(C(A))return u(A);o=setTimeout(h,function(A){var t=e-(A-s);return c?Bd(t,a-(A-g)):t}(A))}function u(A){return o=void 0,d&&i?I(A):(i=n=void 0,r)}function B(){var A=hd(),t=C(A);if(i=arguments,n=this,s=A,t){if(void 0===o)return function(A){return g=A,o=setTimeout(h,e),l?I(A):r}(s);if(c)return clearTimeout(o),o=setTimeout(h,e),I(s)}return void 0===o&&(o=setTimeout(h,e)),r}return e=dl(e)||0,ol(t)&&(l=!!t.leading,a=(c="maxWait"in t)?ud(dl(t.maxWait)||0,e):a,d="trailing"in t?!!t.trailing:d),B.cancel=function(){void 0!==o&&clearTimeout(o),g=0,i=s=n=o=void 0},B.flush=function(){return void 0===o?r:u(hd())},B}var fd=Math.max;function Qd(A,e,t){var i=null==A?0:A.length;if(!i)return-1;var n=null==t?0:Cl(t);return n<0&&(n=fd(i+n,0)),function(A,e,t){for(var i=A.length,n=t+-1;++n-1?i[n?A[a]:a]:void 0});var md={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"}]},yd={color:"blue",backgroundColor:"blue",activeColor:"blue",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-footer-0",iconId:"play",part:"left",defaultActive:0,isrender:0,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},_d=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(t.jsPlugin.id+"-canvas");t.drawPen=a.getContext("2d"),t.nowTime=A.nowTime||(new Date).setHours(0,0,0,0),t.timeSection=e.timeSection||[],t.canvasWidth=a.offsetWidth,t.canvasHeight=a.offsetHeight,t.timeLineClickable=A.timeLineClickable,t.onTimeLineClick=A.onTimeLineClick,t.updata(),document.getElementById(t.jsPlugin.id+"-canvas").addEventListener("mousemove",(function(A){t.options.readOnly||t.mousemove(A)})),document.getElementById(t.jsPlugin.id+"-canvas").addEventListener("mouseover",(function(A){t.options.readOnly||t.mouseover(A)})),document.getElementById(t.jsPlugin.id+"-canvas").addEventListener("mouseleave",(function(A){t.options.readOnly||t.mouseleave(A)})),document.getElementById(t.jsPlugin.id+"-canvas").addEventListener("mousedown",(function(A){t.options.readOnly||t.mousedown(A)})),document.getElementById(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(A.id+"-canvas").width=A.width,document.getElementById(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(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){this.options.timeWidth=A,this.updata({timeWidth:A})},this.setTimeLineClickable=function(A){this.timeLineClickable=A},this.mouseUpFn=function(A,e){if(this.isMouseDown)if(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,e(this.nowTime)}else if(this.timeLineClickable){var i=0;switch(this.timeWidth){case 60:i=.1;break;case 1800:i=3;break;case 3600:i=90;break;case 86400:i=120}var n=this.canvasWidth/2,a=A.layerX-n>0?A.layerX-n:n-A.layerX,r=new Date(this.nowTime).getTime()+a*i*1e3;this.onTimeLineClick&&this.onTimeLineClick(r,this.nowTime)}},this.readOnly=function(A){this.options.readOnly=!0,document.getElementById(this.jsPlugin.id+"-canvas").style.cursor="not-allowed"},this.unReadOnly=function(A){this.options.readOnly=!1,document.getElementById(this.jsPlugin.id+"-canvas").style.cursor="pointer"},this.run=function(A){t.isMouseDown||t.updata(A)},this.getTime=function(A){},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(),r=t.getDate(),o=0;switch(A.timeWidth){case 60:var s=parseInt(A.canvasWidth/10);t.setSeconds(t.getSeconds()-parseInt(s/2,10)),r=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}},Sd=function(){function A(){}return A.append=function(e,t,i){!function n(a){if(a>=e.length)t&&t();else{var r=e[a];if(A.LoadedScripts.find((function(A){return A===r})))n(a+1);else{var o=document.querySelector('script[src="'+r+'"]');if(o)o.readyState?o.addEventListener("readystatechange",(function(){"complete"!=o.readyState&&"loaded"!=o.readyState||n(a+1)})):o.addEventListener("load",(function(){n(a+1)}));else{var s=document.createElement("script");s.src=r,s.setAttribute("crossorigin",!0),s.onload=function(){A.LoadedScripts.push(r),n(a+1),s=null},s.onerror=function(){i&&i(e[a]),s=null},document.head.appendChild(s)}}}}(0)},A.remove=function(e){void 0===e&&(e=[]),e.forEach((function(e){var t=document.querySelector('script[src="'+e+'"]');if(t)try{document.head.removeChild(t)}catch(A){}var i=A.LoadedScripts.indexOf(e);i>-1&&A.LoadedScripts.splice(i,1)}))},A.clear=function(){A.remove(A.LoadedScripts)},A}();function Dd(){return Dd=Object.assign||function(A){for(var e=1;e\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';d.innerHTML=I,g(d,o),this.timeLine=new _d(this.jSPlugin),null==(e=this.jSPlugin)||null==(A=e.logger)||A.log("[TimeLine] init");var C=this;this.timeLine.init({id:this.jSPlugin.id+"-canvas",width:r,nowTime:this.nowTime,timeLineClickable:this.jSPlugin.timeLineClickable,onTimeLineClick:this.jSPlugin.onTimeLineClick,onChange:function(A){var e,t;if(null==(t=n.jSPlugin)||null==(e=t.eventEmitter)||e.emit(Eg.seek,{time:new Date(A).Format("yyyyMMddhhmmss")}),"rec"!==c(n.jSPlugin.url).type||new Date(A).Format("yyyy-MM-dd")==C.date){var i=new Date(A).Format("yyyyMMddhhmmss");if(n.jSPlugin.Theme&&n.jSPlugin.Theme.decoderState.state.recordvideo&&(n.jSPlugin.Theme.setDecoderState({recordvideo:!1}),"cloud.rec"===c(n.jSPlugin.url).type&&n.jSPlugin.stopSave()),"cloud.rec"===c(n.jSPlugin.url).type||n.jSPlugin.useSeek&&n.jSPlugin.capacity&&"1"==n.jSPlugin.capacity.support_seek_playback){if(!n.isSeeking)if(C.recList.length>0)if(new Date(A).valueOf()>=C.lastDate)n.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3});else n.jSPlugin.Theme.decoderState.state.play?n.unSyncTimeLine().then((function(){n.isSeeking=!0,n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),n.jSPlugin.pluginStatus.loadingSetText({text:n.jSPlugin.i18n.t("LOADING")}),n.jSPlugin.Theme.setDisabled(!0),n.jSPlugin._tempSeekTime=A,n.jSPlugin.seek(i.substr(8,6),"235959").then((function(){var e=setInterval((function(){n.jSPlugin._destroy?clearInterval(e):n.jSPlugin.getOSDTime().then((function(t){var i=new Date(A).valueOf()/1e3;if(t.data>=i-2){n.isSeeking=!1,n.syncTimeLine(),clearInterval(e),n.jSPlugin.pluginStatus.loadingStop(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),n.jSPlugin.pluginStatus.loadingClear(),n.jSPlugin.Theme.setDisabled(!1),n.jSPlugin._tempSeekTime=null,C.jSPlugin.waterMark_JSPlugin&&C.jSPlugin.setWaterMarkFont(C.jSPlugin.waterMark_JSPlugin);var a,r=n.jSPlugin.Theme.decoderState.state.sound,o=Pg.getInstance(n.jSPlugin.id);if(r&&o.getState().sound&&setTimeout((function(){n.jSPlugin.openSound()}),500),C.jSPlugin.eventEmitter)null==(a=C.jSPlugin.eventEmitter)||a.emit(Eg.recTimeChange,{code:0,data:{time:new Date(A).Format("yyyyMMddhhmmss")}})}}))}),1e3)}))})):n.unSyncTimeLine().then((function(){n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),n.jSPlugin.pluginStatus.loadingSetText({text:n.jSPlugin.i18n.t("LOADING")}),n.jSPlugin.Theme.setDisabled(!0);var e=n.jSPlugin.url;e.indexOf("begin")>-1?e=e.replace(/(begin=)(\d+)/,(function(A,e,t){return e+i})):e+="?begin="+i,n.jSPlugin.play({url:e}).then((function(){var e;(n.syncTimeLine(),n.jSPlugin.pluginStatus.loadingStop(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),n.jSPlugin.pluginStatus.loadingClear(),n.jSPlugin.Theme.setDisabled(!1),C.jSPlugin.waterMark_JSPlugin&&C.jSPlugin.setWaterMarkFont(C.jSPlugin.waterMark_JSPlugin),C.jSPlugin.eventEmitter)&&(null==(e=C.jSPlugin.eventEmitter)||e.emit(Eg.recTimeChange,{code:0,data:{time:new Date(A).Format("yyyyMMddhhmmss")}}))})).catch((function(A){}))}))}else{var a=function(){setTimeout((function(){n.disabled=!1}),n.seekFrequency)},r=function(e){n.disabled=!0,n.unSyncTimeLine().then((function(){n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),n.jSPlugin.pluginStatus.loadingSetText({text:n.jSPlugin.i18n.t("LOADING")}),n.jSPlugin.Theme.setDisabled(!0);var t=n.jSPlugin.url;t.indexOf("begin")>-1?t=t.replace(/(begin=)(\d+)/,(function(A,e,t){return e+i})):t+="?begin="+i,n.jSPlugin.play({url:t,unSaveUrl:!0,showPoster:!0}).then((function(){var t;(e&&e(),n.syncTimeLine(),n.jSPlugin.pluginStatus.loadingStop(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),n.jSPlugin.pluginStatus.loadingClear(),n.jSPlugin.Theme.setDisabled(!1),C.jSPlugin.waterMark_JSPlugin&&C.jSPlugin.setWaterMarkFont(C.jSPlugin.waterMark_JSPlugin),n.jSPlugin.Theme.decoderState.state.sound&&n.jSPlugin.openSound(),C.jSPlugin.eventEmitter)&&(null==(t=C.jSPlugin.eventEmitter)||t.emit(Eg.recTimeChange,{code:0,data:{time:new Date(A).Format("yyyyMMddhhmmss")}}))})).catch((function(A){}))})),n.jSPlugin.Theme&&n.jSPlugin.Theme.decoderState&&n.jSPlugin.Theme.decoderState.state&&n.jSPlugin.Theme.decoderState.state.zoom&&(n.jSPlugin.Theme.setDecoderState({zoom:!1}),n.jSPlugin.Zoom.stopZoom())};n.disabled?(n.seekTimer&&clearTimeout(n.seekTimer),n.seekTimer=setTimeout((function(){r(a)}),n.seekFrequency)):r(a)}}else{var o;C.jSPlugin.eventEmitter&&(null==(o=C.jSPlugin.eventEmitter)||o.emit(Eg.recTimeChange,{code:-1,data:{time:new Date(A).Format("yyyyMMddhhmmss")},msg:"本地SD卡不支持跨天回放"}))}}}).then((function(){n.syncTimeLine()}));var h,u,B=null==(i=document.getElementById(this.jSPlugin.id+"-wrap"))||null==(t=i.classList)?void 0:t.contains("ezuikit-player-wrap-mobile-fullscreen");if(document.getElementById(this.jSPlugin.id+"-canvas-container")&&!this.jSPlugin._isCurrentBrowserFullscreen&&!B){var E=document.getElementById(this.jSPlugin.id+"-canvas-container").clientHeight;this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-E,!0)}h=C.jSPlugin,u=document.getElementById(h.id+"-wrap"),a(h.staticPath+"/rec/datepicker.min.css"),Sd.append([h.staticPath+"/rec/jquery.min.js",h.staticPath+"/rec/datepicker.js",h.staticPath+"/rec/datepicker."+C.datepickerLang[h.language]+".js"],(function(){var A=u.getElementsByClassName("datepicker-container")[0];!A&&$("#"+h.id+"-datepicker").datepicker&&$("#"+h.id+"-datepicker").datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:C.datepickerLang[h.language],date:new Date(s("begin",h.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:u}),(A=u.getElementsByClassName("datepicker-container")[0])&&(A.style.display="none"),C.datepickerVisible=!1,$("#"+h.id+"-datepicker").on("pick.datepicker",(function(e){if(e.date>new Date||new Date(e.date).Format("yyyyMMddhhmmss")===new Date(document.getElementById(h.id+"-datepicker").value).Format("yyyyMMdd"))e.preventDefault();else{var t,i=new Date(e.date).Format("yyyy-MM-dd");document.getElementById(h.id+"-datepicker").value=i,null==(t=C.jSPlugin.eventEmitter)||t.emit(Eg.date.recStartTimeChange,{code:0,data:{time:i.replace(/-/gi,"/")}}),C.renderRec(new Date(e.date).Format("yyyy-MM-dd")),h.Theme.decoderState&&h.Theme.decoderState.state?h.Theme.decoderState.state.cloudRec?h.changePlayUrl({begin:new Date(e.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"},(function(){}),!1).then((function(A){C.jSPlugin.Theme.decoderState.state.sound&&C.jSPlugin.openSound()})):h.Theme.decoderState.state.rec?h.changePlayUrl({begin:new Date(e.date).Format("yyyyMMddhhmmss"),type:"rec"},(function(){}),!1).then((function(A){C.jSPlugin.Theme.decoderState.state.sound&&C.jSPlugin.openSound()})):h.changePlayUrl({begin:new Date(e.date).Format("yyyyMMddhhmmss")},(function(){}),!1).then((function(A){C.jSPlugin.Theme.decoderState.state.sound&&C.jSPlugin.openSound()})):h.changePlayUrl({begin:new Date(e.date).Format("yyyyMMddhhmmss")},(function(){}),!1).then((function(A){C.jSPlugin.Theme.decoderState.state.sound&&C.jSPlugin.openSound()}))}A&&(A.style.display="none"),C.datepickerVisible=!1,h.Theme&&h.Theme.decoderState&&h.Theme.decoderState.state&&h.Theme.decoderState.state.zoom&&(h.Theme.setDecoderState({zoom:!1}),h.Zoom.stopZoom())})),$("#"+h.id+"-datepicker").off("click").on("click",(function(e){var t,i;C.datepickerVisible?A&&(A.style.display="none",null==h||null==(t=h.eventEmitter)||t.emit(Eg.date.closeDatePanel)):A&&(A.style.display="inline",null==h||null==(i=h.eventEmitter)||i.emit(Eg.date.openDatePanel)),C.datepickerVisible=!C.datepickerVisible}))}),(function(){})),document.getElementById(this.jSPlugin.id+"-timeline-scale-add").onclick=function(){n.unSyncTimeLine().then((function(){var A,e;n.currentTimeWidth<3&&(n.timeLine.changeSize(++n.currentTimeWidth),null==(e=n.jSPlugin)||null==(A=e.eventEmitter)||A.emit(Eg.timeLine.timeWidthChange,n.currentTimeWidth));n.syncTimeLine()}))},document.getElementById(this.jSPlugin.id+"-timeline-scale-sub").onclick=function(){n.unSyncTimeLine().then((function(){var A,e;n.currentTimeWidth>0&&(n.timeLine.changeSize(--n.currentTimeWidth),null==(e=n.jSPlugin)||null==(A=e.eventEmitter)||A.emit(Eg.timeLine.timeWidthChange,n.currentTimeWidth));n.syncTimeLine()}))};var f=s("begin",this.jSPlugin.url)||(new Date).Format("yyyyMMdd");f=vg(f,s("timeZone",this.jSPlugin.url)?parseInt(s("timeZone",this.jSPlugin.url)):0),this.renderRec(f.Format("yyyy-MM-dd")),this.observer=new MutationObserver((function(A,e){}));var Q=document.getElementById(""+this.jSPlugin.id);this.observer.observe(Q,{attributes:!0,attributeOldValue:!0,attributeFilter:["style"]})},e.destroy=function(){var A,e;Pg.listInstances().length<=1&&(r(this.jSPlugin.staticPath+"/rec/datepicker.min.css"),Sd.remove([this.jSPlugin.staticPath+"/rec/jquery.min.js",this.jSPlugin.staticPath+"/rec/datepicker.js",this.jSPlugin.staticPath+"/rec/datepicker."+this.datepickerLang[this.jSPlugin.language]+".js"]),null==(e=this.jSPlugin)||null==(A=e.logger)||A.log("[Rec]","destroy"))},e.setDatepickerDate=function(A){var e=document.getElementById(this.jSPlugin.id+"-wrap");if(e){var t=e.getElementsByClassName("datepicker-container")[0];if(t){var i=t;i.parentNode.removeChild(i),document.getElementById(this.jSPlugin.id+"-datepicker").value=A.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"),$("#"+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(this.jSPlugin.id+"-wrap")})}}},e.datepickerHide=function(){var A=document.getElementById(this.jSPlugin.id+"-wrap");if(A){var e=A.getElementsByClassName("datepicker-container")[0];e&&(e.style.display="none")}this.datepickerVisible=!1},e.datepickerShow=function(){var A=document.getElementById(this.jSPlugin.id+"-wrap");A&&(A.getElementsByClassName("datepicker-container")[0].style.display="inline");this.datepickerVisible=!0},e.recAutoSize=function(A){var e=this,t=this,i=parseInt(getComputedStyle(document.getElementById(t.jSPlugin.id)).width,10)-100;document.getElementById(this.jSPlugin.id+"-canvas")&&i!==parseInt(document.getElementById(t.jSPlugin.id+"-canvas").width)&&t.unSyncTimeLine().then((function(){t.timeLine.setWidth({id:""+e.jSPlugin.id,width:i}),t.syncTimeLine(),A&&A()}))},e.syncTimeLine=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);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)},e.unSyncTimeLine=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()}))},e.renderRec=function(A){var e,t,i=this;this.date=A;var n=this,a=new Date(new Date(A).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime();this.jSPlugin.timeZone&&-1===this.jSPlugin.url.indexOf(".cloud")&&(a=new Date(wg(new Date(a),this.jSPlugin.timeZone).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime());var r=new Date(new Date(a).Format("yyyy-MM-dd 23:59:59").replace(/-/g,"/")).getTime();if(this.timeLine.getRecord([],a,r),this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===s("busType",this.jSPlugin.url)){var o={deviceSerial:c(this.jSPlugin.url).deviceSerial,channelNo:c(this.jSPlugin.url).channelNo,startTime:a,endTime:r,spaceId:this.jSPlugin._spaceId};Dg(this.jSPlugin,o).then((function(A){if(A.data&&A.data.length>0){var e=A.data;n.recList=e,n.lastDate=e[e.length-1].endTime,i.timeLine.getRecord(e,a,r)}}))}else{if(-1!==this.jSPlugin.url.indexOf(".cloud")){var g,l,d={accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,recType:1,deviceSerial:c(this.jSPlugin.url).deviceSerial,channelNo:c(this.jSPlugin.url).channelNo,startTime:a,endTime:r,version:"2.0"},C=this.jSPlugin.env.domain+"/api/lapp/video/by/time";return null==(l=this.jSPlugin)||null==(g=l.logger)||g.log("[https request] getCloudRecTimes()",JSON.stringify(d)),void I(C,"POST",d,"",(function(A){if(A.data&&A.data.files&&A.data.files.length>0){var e=A.data.files,t=(new Date).getTime(),o=A.data.isAll;if(n.recList=e,n.lastDate=e[e.length-1].endTime,o){var s,g;i.timeLine.getRecord(e,a,r),null==(g=n.jSPlugin)||null==(s=g.eventEmitter)||s.emit(Eg.http.getCloudRecTimes,e)}else{var l,c;d.startTime=t,I(i.jSPlugin.env.domain+"/api/lapp/video/by/time","POST",d,"",(function(A){A.data&&A.data.files&&A.data.files.length>0&&0==A.data.isAll?(A.data.files&&(e=e.concat(A.data.files),n.recList=e,n.lastDate=e[e.length-1].endTime),t=A.data.nextFileTime>0?A.data.nextFileTime:(new Date).getTime(),recTransaction()):n.timeLine.getRecord(e,a,r)})),null==(c=n.jSPlugin)||null==(l=c.logger)||l.log("[https request] getCloudRecTimes()",JSON.stringify(d))}i.timeLine.run({time:new Date(a)})}else A.data&&A.data.length>0&&(n.recList=A.data,n.lastDate=A.data[A.data.length-1].endTime,n.timeLine.getRecord(A.data,a,r),n.timeLine.run({time:new Date(a)}))}))}var h={accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,recType:"cloud.rec"===c(this.jSPlugin.url).type?1:2,deviceSerial:c(this.jSPlugin.url).deviceSerial,channelNo:c(this.jSPlugin.url).channelNo,startTime:a,endTime:r,version:"2.0",pageSize:200},u=[],B=function(A){if(A.meta&&200==A.meta.code){if(A.data&&Array.isArray(A.data.records)){var e=A.data.records.map((function(A){return A.startTime=1e3*A.startTime,A.endTime=1e3*A.endTime,A}));u=u.concat(e)}if(A.data&&A.data.hasMore){var t,o,s=i.jSPlugin.env.domain+"/api/v3/device/local/video/unify/query?accessToken="+(i.jSPlugin.accessToken||i.jSPlugin.token.deviceToken.video)+"&deviceSerial="+c(i.jSPlugin.url).deviceSerial+"&channelNo="+c(i.jSPlugin.url).channelNo+"&startTime="+A.data.nextFileTime+"&endTime="+r/1e3+"&pageSize=200";null==(o=i.jSPlugin)||null==(t=o.logger)||t.log("[https request] getLocalRecTimes()",s),fetch(s,{method:"GET",headers:Dd({},h,{startTime:A.data.nextFileTime})}).then((function(A){return A.json()})).then((function(A){A&&A.meta&&200==A.meta.code&&B(A)})).catch((function(A){}))}else{var g;u.length>0&&(n.recList=u,n.lastDate=u[u.length-1].endTime,n.timeLine.getRecord(u,a,r)),n.timeLine.run({time:new Date(a)}),null==(g=n.jSPlugin)||g.eventEmitter.emit(Eg.http.getLocalRecTimes,u||[])}}},E=this.jSPlugin.env.domain+"/api/v3/device/local/video/unify/query?accessToken="+(this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video)+"&deviceSerial="+c(this.jSPlugin.url).deviceSerial+"&channelNo="+c(this.jSPlugin.url).channelNo+"&startTime="+a/1e3+"&endTime="+r/1e3+"&pageSize=200";null==(t=this.jSPlugin)||null==(e=t.logger)||e.log("[https request] getLocalRecTimes()",E),fetch(E,{method:"GET",headers:h}).then((function(A){return A.json()})).then((function(A){A&&A.meta&&200==A.meta.code&&B(A)})).catch((function(A){}))}},A}();function wd(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.')}var bd,Fd={exports:{}}; /* The MIT License (MIT) Copyright (c) 2016 Meetecho Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ function Rd(A,e,t,i,n,a,r){try{var o=A[a](r),s=o.value}catch(A){return void t(A)}o.done?e(s):Promise.resolve(s).then(i,n)}function kd(A){return A&&"undefined"!=typeof Symbol&&A.constructor===Symbol?"symbol":typeof A}function Pd(A,e){var t,i,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;r;)try{if(t=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(n=r.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{},e=A.window,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},g=i.log,l=i.detectBrowser(e),c={browserDetails:l,commonShim:s,extractVersion:i.extractVersion,disableLog:i.disableLog,disableWarnings:i.disableWarnings};switch(l.browser){case"chrome":if(!n||!n.shimPeerConnection||!t.shimChrome)return g("Chrome shim is not included in this adapter release."),c;g("adapter.js shimming chrome."),c.browserShim=n,n.shimGetUserMedia(e),n.shimMediaStream(e),n.shimPeerConnection(e),n.shimOnTrack(e),n.shimAddTrackRemoveTrack(e),n.shimGetSendersWithDtmf(e),n.shimGetStats(e),n.shimSenderReceiverGetStats(e),n.fixNegotiationNeeded(e),s.shimRTCIceCandidate(e),s.shimConnectionState(e),s.shimMaxMessageSize(e),s.shimSendThrowTypeError(e),s.removeAllowExtmapMixed(e);break;case"firefox":if(!r||!r.shimPeerConnection||!t.shimFirefox)return g("Firefox shim is not included in this adapter release."),c;g("adapter.js shimming firefox."),c.browserShim=r,r.shimGetUserMedia(e),r.shimPeerConnection(e),r.shimOnTrack(e),r.shimRemoveStream(e),r.shimSenderGetStats(e),r.shimReceiverGetStats(e),r.shimRTCDataChannel(e),r.shimAddTransceiver(e),r.shimCreateOffer(e),r.shimCreateAnswer(e),s.shimRTCIceCandidate(e),s.shimConnectionState(e),s.shimMaxMessageSize(e),s.shimSendThrowTypeError(e);break;case"edge":if(!a||!a.shimPeerConnection||!t.shimEdge)return g("MS edge shim is not included in this adapter release."),c;g("adapter.js shimming edge."),c.browserShim=a,a.shimGetUserMedia(e),a.shimGetDisplayMedia(e),a.shimPeerConnection(e),a.shimReplaceTrack(e),s.shimMaxMessageSize(e),s.shimSendThrowTypeError(e);break;case"safari":if(!o||!t.shimSafari)return g("Safari shim is not included in this adapter release."),c;g("adapter.js shimming safari."),c.browserShim=o,o.shimRTCIceServerUrls(e),o.shimCreateOfferLegacy(e),o.shimCallbacksAPI(e),o.shimLocalStreamsAPI(e),o.shimRemoteStreamsAPI(e),o.shimTrackEventTransceiver(e),o.shimGetUserMedia(e),s.shimRTCIceCandidate(e),s.shimMaxMessageSize(e),s.shimSendThrowTypeError(e),s.removeAllowExtmapMixed(e);break;default:g("Unsupported browser!")}return c};var i=g(A("./utils")),n=g(A("./chrome/chrome_shim")),a=g(A("./edge/edge_shim")),r=g(A("./firefox/firefox_shim")),o=g(A("./safari/safari_shim")),s=g(A("./common_shim"));function g(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(A,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var a="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(A){return void 0===A?"undefined":i(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":void 0===A?"undefined":i(A)},r=A("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return r.shimGetUserMedia}});var o=A("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),n.shimMediaStream=function(A){A.MediaStream=A.MediaStream||A.webkitMediaStream},n.shimOnTrack=function(A){if("object"===(void 0===A?"undefined":a(A))&&A.RTCPeerConnection&&!("ontrack"in A.RTCPeerConnection.prototype)){Object.defineProperty(A.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(A){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=A)},enumerable:!0,configurable:!0});var e=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){var t=this;return this._ontrackpoly||(this._ontrackpoly=function(e){e.stream.addEventListener("addtrack",(function(i){var n=void 0;n=A.RTCPeerConnection.prototype.getReceivers?t.getReceivers().find((function(A){return A.track&&A.track.id===i.track.id})):{track:i.track};var a=new Event("track");a.track=i.track,a.receiver=n,a.transceiver={receiver:n},a.streams=[e.stream],t.dispatchEvent(a)})),e.stream.getTracks().forEach((function(i){var n=void 0;n=A.RTCPeerConnection.prototype.getReceivers?t.getReceivers().find((function(A){return A.track&&A.track.id===i.id})):{track:i};var a=new Event("track");a.track=i,a.receiver=n,a.transceiver={receiver:n},a.streams=[e.stream],t.dispatchEvent(a)}))},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else s.wrapPeerConnectionEvent(A,"track",(function(A){return A.transceiver||Object.defineProperty(A,"transceiver",{value:{receiver:A.receiver}}),A}))},n.shimGetSendersWithDtmf=function(A){if("object"===(void 0===A?"undefined":a(A))&&A.RTCPeerConnection&&!("getSenders"in A.RTCPeerConnection.prototype)&&"createDTMFSender"in A.RTCPeerConnection.prototype){var e=function(A,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=A.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:A}};if(!A.RTCPeerConnection.prototype.getSenders){A.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var t=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,i){var n=t.apply(this,arguments);return n||(n=e(this,A),this._senders.push(n)),n};var i=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){i.apply(this,arguments);var e=this._senders.indexOf(A);-1!==e&&this._senders.splice(e,1)}}var n=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){var t=this;this._senders=this._senders||[],n.apply(this,[A]),A.getTracks().forEach((function(A){t._senders.push(e(t,A))}))};var r=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){var e=this;this._senders=this._senders||[],r.apply(this,[A]),A.getTracks().forEach((function(A){var t=e._senders.find((function(e){return e.track===A}));t&&e._senders.splice(e._senders.indexOf(t),1)}))}}else if("object"===(void 0===A?"undefined":a(A))&&A.RTCPeerConnection&&"getSenders"in A.RTCPeerConnection.prototype&&"createDTMFSender"in A.RTCPeerConnection.prototype&&A.RTCRtpSender&&!("dtmf"in A.RTCRtpSender.prototype)){var o=A.RTCPeerConnection.prototype.getSenders;A.RTCPeerConnection.prototype.getSenders=function(){var A=this,e=o.apply(this,[]);return e.forEach((function(e){return e._pc=A})),e},Object.defineProperty(A.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},n.shimGetStats=function(A){if(A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){var A=this,t=Array.prototype.slice.call(arguments),i=t[0],n=t[1],a=t[2];if(arguments.length>0&&"function"==typeof i)return e.apply(this,arguments);if(0===e.length&&(0===arguments.length||"function"!=typeof i))return e.apply(this,[]);var r=function(A){var e={};return A.result().forEach((function(A){var t={id:A.id,timestamp:A.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[A.type]||A.type};A.names().forEach((function(e){t[e]=A.stat(e)})),e[t.id]=t})),e},o=function(A){return new Map(Object.keys(A).map((function(e){return[e,A[e]]})))};return arguments.length>=2?e.apply(this,[function(A){n(o(r(A)))},i]):new Promise((function(t,i){e.apply(A,[function(A){t(o(r(A)))},i])})).then(n,a)}}},n.shimSenderReceiverGetStats=function(A){if("object"===(void 0===A?"undefined":a(A))&&A.RTCPeerConnection&&A.RTCRtpSender&&A.RTCRtpReceiver){if(!("getStats"in A.RTCRtpSender.prototype)){var e=A.RTCPeerConnection.prototype.getSenders;e&&(A.RTCPeerConnection.prototype.getSenders=function(){var A=this,t=e.apply(this,[]);return t.forEach((function(e){return e._pc=A})),t});var i=A.RTCPeerConnection.prototype.addTrack;i&&(A.RTCPeerConnection.prototype.addTrack=function(){var A=i.apply(this,arguments);return A._pc=this,A}),A.RTCRtpSender.prototype.getStats=function(){var A=this;return this._pc.getStats().then((function(e){return s.filterStats(e,A.track,!0)}))}}if(!("getStats"in A.RTCRtpReceiver.prototype)){var n=A.RTCPeerConnection.prototype.getReceivers;n&&(A.RTCPeerConnection.prototype.getReceivers=function(){var A=this,e=n.apply(this,[]);return e.forEach((function(e){return e._pc=A})),e}),s.wrapPeerConnectionEvent(A,"track",(function(A){return A.receiver._pc=A.srcElement,A})),A.RTCRtpReceiver.prototype.getStats=function(){var A=this;return this._pc.getStats().then((function(e){return s.filterStats(e,A.track,!1)}))}}if("getStats"in A.RTCRtpSender.prototype&&"getStats"in A.RTCRtpReceiver.prototype){var r=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&t(arguments[0],A.MediaStreamTrack)){var e=arguments[0],i=void 0,n=void 0,a=void 0;return this.getSenders().forEach((function(A){A.track===e&&(i?a=!0:i=A)})),this.getReceivers().forEach((function(A){return A.track===e&&(n?a=!0:n=A),A.track===e})),a||i&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return r.apply(this,arguments)}}}},n.shimAddTrackRemoveTrackWithNative=l,n.shimAddTrackRemoveTrack=function(A){if(A.RTCPeerConnection){var e=s.detectBrowser(A);if(A.RTCPeerConnection.prototype.addTrack&&e.version>=65)return l(A);var t=A.RTCPeerConnection.prototype.getLocalStreams;A.RTCPeerConnection.prototype.getLocalStreams=function(){var A=this,e=t.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((function(e){return A._reverseStreams[e.id]}))};var i=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(e){var t=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach((function(A){var e=t.getSenders().find((function(e){return e.track===A}));if(e)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[e.id]){var n=new A.MediaStream(e.getTracks());this._streams[e.id]=n,this._reverseStreams[n.id]=e,e=n}i.apply(this,[e])};var n=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},n.apply(this,[this._streams[A.id]||A]),delete this._reverseStreams[this._streams[A.id]?this._streams[A.id].id:A.id],delete this._streams[A.id]},A.RTCPeerConnection.prototype.addTrack=function(e,t){var i=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((function(A){return A===e})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");var a=this.getSenders().find((function(A){return A.track===e}));if(a)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var r=this._streams[t.id];if(r)r.addTrack(e),Promise.resolve().then((function(){i.dispatchEvent(new Event("negotiationneeded"))}));else{var o=new A.MediaStream([e]);this._streams[t.id]=o,this._reverseStreams[o.id]=t,this.addStream(o)}return this.getSenders().find((function(A){return A.track===e}))},["createOffer","createAnswer"].forEach((function(e){var t=A.RTCPeerConnection.prototype[e],i=g({},e,(function(){var A=this,e=arguments;return arguments.length&&"function"==typeof arguments[0]?t.apply(this,[function(t){var i=o(A,t);e[0].apply(null,[i])},function(A){e[1]&&e[1].apply(null,A)},arguments[2]]):t.apply(this,arguments).then((function(e){return o(A,e)}))}));A.RTCPeerConnection.prototype[e]=i[e]}));var a=A.RTCPeerConnection.prototype.setLocalDescription;A.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(A,e){var t=e.sdp;return Object.keys(A._reverseStreams||[]).forEach((function(e){var i=A._reverseStreams[e],n=A._streams[i.id];t=t.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:e.type,sdp:t})}(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};var r=Object.getOwnPropertyDescriptor(A.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(A.RTCPeerConnection.prototype,"localDescription",{get:function(){var A=r.get.apply(this);return""===A.type?A:o(this,A)}}),A.RTCPeerConnection.prototype.removeTrack=function(A){var e=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!A._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(A._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var t=void 0;Object.keys(this._streams).forEach((function(i){e._streams[i].getTracks().find((function(e){return A.track===e}))&&(t=e._streams[i])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(A.track),this.dispatchEvent(new Event("negotiationneeded")))}}function o(A,e){var t=e.sdp;return Object.keys(A._reverseStreams||[]).forEach((function(e){var i=A._reverseStreams[e],n=A._streams[i.id];t=t.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:e.type,sdp:t})}},n.shimPeerConnection=function(A){var e=s.detectBrowser(A);if(!A.RTCPeerConnection&&A.webkitRTCPeerConnection&&(A.RTCPeerConnection=A.webkitRTCPeerConnection),A.RTCPeerConnection){e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){var t=A.RTCPeerConnection.prototype[e],i=g({},e,(function(){return arguments[0]=new("addIceCandidate"===e?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}));A.RTCPeerConnection.prototype[e]=i[e]}));var t=A.RTCPeerConnection.prototype.addIceCandidate;A.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?e.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}},n.fixNegotiationNeeded=function(A){s.wrapPeerConnectionEvent(A,"negotiationneeded",(function(A){if("stable"===A.target.signalingState)return A}))};var s=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}(A("../utils.js"));function g(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function l(A){A.RTCPeerConnection.prototype.getLocalStreams=function(){var A=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(e){return A._shimmedLocalStreams[e][0]}))};var e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,t){if(!t)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var i=e.apply(this,arguments);return this._shimmedLocalStreams[t.id]?-1===this._shimmedLocalStreams[t.id].indexOf(i)&&this._shimmedLocalStreams[t.id].push(i):this._shimmedLocalStreams[t.id]=[t,i],i};var t=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){var e=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},A.getTracks().forEach((function(A){var t=e.getSenders().find((function(e){return e.track===A}));if(t)throw new DOMException("Track already exists.","InvalidAccessError")}));var i=this.getSenders();t.apply(this,arguments);var n=this.getSenders().filter((function(A){return-1===i.indexOf(A)}));this._shimmedLocalStreams[A.id]=[A].concat(n)};var i=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[A.id],i.apply(this,arguments)};var n=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},A&&Object.keys(this._shimmedLocalStreams).forEach((function(t){var i=e._shimmedLocalStreams[t].indexOf(A);-1!==i&&e._shimmedLocalStreams[t].splice(i,1),1===e._shimmedLocalStreams[t].length&&delete e._shimmedLocalStreams[t]})),n.apply(this,arguments)}}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=function(A,e){A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||A.navigator.mediaDevices&&"function"==typeof e&&(A.navigator.mediaDevices.getDisplayMedia=function(t){return e(t).then((function(e){var i=t.video&&t.video.width,n=t.video&&t.video.height,a=t.video&&t.video.frameRate;return t.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxFrameRate:a||3}},i&&(t.video.mandatory.maxWidth=i),n&&(t.video.mandatory.maxHeight=n),A.navigator.mediaDevices.getUserMedia(t)}))})}},{}],5:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(A){return void 0===A?"undefined":i(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":void 0===A?"undefined":i(A)};t.shimGetUserMedia=function(A){var e=A&&A.navigator;if(e.mediaDevices){var t=a.detectBrowser(A),i=function(A){if("object"!==(void 0===A?"undefined":n(A))||A.mandatory||A.optional)return A;var e={};return Object.keys(A).forEach((function(t){if("require"!==t&&"advanced"!==t&&"mediaSource"!==t){var i="object"===n(A[t])?A[t]:{ideal:A[t]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);var a=function(A,e){return A?A+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==i.ideal){e.optional=e.optional||[];var r={};"number"==typeof i.ideal?(r[a("min",t)]=i.ideal,e.optional.push(r),(r={})[a("max",t)]=i.ideal,e.optional.push(r)):(r[a("",t)]=i.ideal,e.optional.push(r))}void 0!==i.exact&&"number"!=typeof i.exact?(e.mandatory=e.mandatory||{},e.mandatory[a("",t)]=i.exact):["min","max"].forEach((function(A){void 0!==i[A]&&(e.mandatory=e.mandatory||{},e.mandatory[a(A,t)]=i[A])}))}})),A.advanced&&(e.optional=(e.optional||[]).concat(A.advanced)),e},o=function(A,a){if(t.version>=61)return a(A);if((A=JSON.parse(JSON.stringify(A)))&&"object"===n(A.audio)){var o=function(A,e,t){e in A&&!(t in A)&&(A[t]=A[e],delete A[e])};o((A=JSON.parse(JSON.stringify(A))).audio,"autoGainControl","googAutoGainControl"),o(A.audio,"noiseSuppression","googNoiseSuppression"),A.audio=i(A.audio)}if(A&&"object"===n(A.video)){var s=A.video.facingMode;s=s&&("object"===(void 0===s?"undefined":n(s))?s:{ideal:s});var g=t.version<66;if(s&&("user"===s.exact||"environment"===s.exact||"user"===s.ideal||"environment"===s.ideal)&&(!e.mediaDevices.getSupportedConstraints||!e.mediaDevices.getSupportedConstraints().facingMode||g)){delete A.video.facingMode;var l=void 0;if("environment"===s.exact||"environment"===s.ideal?l=["back","rear"]:"user"!==s.exact&&"user"!==s.ideal||(l=["front"]),l)return e.mediaDevices.enumerateDevices().then((function(e){e=e.filter((function(A){return"videoinput"===A.kind}));var t=e.find((function(A){return l.some((function(e){return A.label.toLowerCase().includes(e)}))}));return!t&&e.length&&l.includes("back")&&(t=e[e.length-1]),t&&(A.video.deviceId=s.exact?{exact:t.deviceId}:{ideal:t.deviceId}),A.video=i(A.video),r("chrome: "+JSON.stringify(A)),a(A)}))}A.video=i(A.video)}return r("chrome: "+JSON.stringify(A)),a(A)},s=function(A){return t.version>=64?A:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[A.name]||A.name,message:A.message,constraint:A.constraint||A.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(e.getUserMedia=function(A,t,i){o(A,(function(A){e.webkitGetUserMedia(A,t,(function(A){i&&i(s(A))}))}))}.bind(e),e.mediaDevices.getUserMedia){var g=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(A){return o(A,(function(A){return g(A).then((function(e){if(A.audio&&!e.getAudioTracks().length||A.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((function(A){A.stop()})),new DOMException("","NotFoundError");return e}),(function(A){return Promise.reject(s(A))}))}))}}}};var a=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}(A("../utils.js")),r=a.log},{"../utils.js":15}],6:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(A){return void 0===A?"undefined":i(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":void 0===A?"undefined":i(A)};t.shimRTCIceCandidate=function(A){if(!(!A.RTCIceCandidate||A.RTCIceCandidate&&"foundation"in A.RTCIceCandidate.prototype)){var e=A.RTCIceCandidate;A.RTCIceCandidate=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.candidate&&0===A.candidate.indexOf("a=")&&((A=JSON.parse(JSON.stringify(A))).candidate=A.candidate.substr(2)),A.candidate&&A.candidate.length){var t=new e(A),i=o.default.parseCandidate(A.candidate),a=Object.assign(t,i);return a.toJSON=function(){return{candidate:a.candidate,sdpMid:a.sdpMid,sdpMLineIndex:a.sdpMLineIndex,usernameFragment:a.usernameFragment}},a}return new e(A)},A.RTCIceCandidate.prototype=e.prototype,s.wrapPeerConnectionEvent(A,"icecandidate",(function(e){return e.candidate&&Object.defineProperty(e,"candidate",{value:new A.RTCIceCandidate(e.candidate),writable:"false"}),e}))}},t.shimMaxMessageSize=function(A){if(A.RTCPeerConnection){var e=s.detectBrowser(A);"sctp"in A.RTCPeerConnection.prototype||Object.defineProperty(A.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){var A,i;if(this._sctp=null,"chrome"===e.browser&&e.version>=76&&"plan-b"===this.getConfiguration().sdpSemantics&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0}),function(A){if(!A||!A.sdp)return!1;var e=o.default.splitSections(A.sdp);return e.shift(),e.some((function(A){var e=o.default.parseMLine(A);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")}))}(arguments[0])){var n=function(A){var e=A.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;var t=parseInt(e[1],10);return t!=t?-1:t}(arguments[0]),a=(A=n,i=65536,"firefox"===e.browser&&(i=e.version<57?-1===A?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),i),r=function(A,t){var i=65536;"firefox"===e.browser&&57===e.version&&(i=65535);var n=o.default.matchPrefix(A.sdp,"a=max-message-size:");return n.length>0?i=parseInt(n[0].substr(19),10):"firefox"===e.browser&&-1!==t&&(i=2147483637),i}(arguments[0],n),s=void 0;s=0===a&&0===r?Number.POSITIVE_INFINITY:0===a||0===r?Math.max(a,r):Math.min(a,r);var g={};Object.defineProperty(g,"maxMessageSize",{get:function(){return s}}),this._sctp=g}return t.apply(this,arguments)}}},t.shimSendThrowTypeError=function(A){if(A.RTCPeerConnection&&"createDataChannel"in A.RTCPeerConnection.prototype){var e=A.RTCPeerConnection.prototype.createDataChannel;A.RTCPeerConnection.prototype.createDataChannel=function(){var A=e.apply(this,arguments);return t(A,this),A},s.wrapPeerConnectionEvent(A,"datachannel",(function(A){return t(A.channel,A.target),A}))}function t(A,e){var t=A.send;A.send=function(){var i=arguments[0],n=i.length||i.size||i.byteLength;if("open"===A.readyState&&e.sctp&&n>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return t.apply(A,arguments)}}},t.shimConnectionState=function(A){if(A.RTCPeerConnection&&!("connectionState"in A.RTCPeerConnection.prototype)){var e=A.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(A){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),A&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=A)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(A){var t=e[A];e[A]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(A){var e=A.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;var t=new Event("connectionstatechange",A);e.dispatchEvent(t)}return A},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),t.apply(this,arguments)}}))}},t.removeAllowExtmapMixed=function(A){if(A.RTCPeerConnection){var e=s.detectBrowser(A);if(!("chrome"===e.browser&&e.version>=71)){var t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(A){return A&&A.sdp&&-1!==A.sdp.indexOf("\na=extmap-allow-mixed")&&(A.sdp=A.sdp.split("\n").filter((function(A){return"a=extmap-allow-mixed"!==A.trim()})).join("\n")),t.apply(this,arguments)}}}};var a,r=A("sdp"),o=(a=r)&&a.__esModule?a:{default:a},s=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}(A("./utils"))},{"./utils":15,sdp:17}],7:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=t.shimGetUserMedia=void 0;var i=A("./getusermedia");Object.defineProperty(t,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var n=A("./getdisplaymedia");Object.defineProperty(t,"shimGetDisplayMedia",{enumerable:!0,get:function(){return n.shimGetDisplayMedia}}),t.shimPeerConnection=function(A){var e=r.detectBrowser(A);if(A.RTCIceGatherer&&(A.RTCIceCandidate||(A.RTCIceCandidate=function(A){return A}),A.RTCSessionDescription||(A.RTCSessionDescription=function(A){return A}),e.version<15025)){var t=Object.getOwnPropertyDescriptor(A.MediaStreamTrack.prototype,"enabled");Object.defineProperty(A.MediaStreamTrack.prototype,"enabled",{set:function(A){t.set.call(this,A);var e=new Event("enabled");e.enabled=A,this.dispatchEvent(e)}})}A.RTCRtpSender&&!("dtmf"in A.RTCRtpSender.prototype)&&Object.defineProperty(A.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new A.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),A.RTCDtmfSender&&!A.RTCDTMFSender&&(A.RTCDTMFSender=A.RTCDtmfSender);var i=(0,g.default)(A,e.version);A.RTCPeerConnection=function(A){return A&&A.iceServers&&(A.iceServers=(0,o.filterIceServers)(A.iceServers,e.version),r.log("ICE servers after filtering:",A.iceServers)),new i(A)},A.RTCPeerConnection.prototype=i.prototype},t.shimReplaceTrack=function(A){A.RTCRtpSender&&!("replaceTrack"in A.RTCRtpSender.prototype)&&(A.RTCRtpSender.prototype.replaceTrack=A.RTCRtpSender.prototype.setTrack)};var a,r=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}(A("../utils")),o=A("./filtericeservers"),s=A("rtcpeerconnection-shim"),g=(a=s)&&a.__esModule?a:{default:a}},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.filterIceServers=function(A,e){var t=!1;return(A=JSON.parse(JSON.stringify(A))).filter((function(A){if(A&&(A.urls||A.url)){var e=A.urls||A.url;A.url&&!A.urls&&i.deprecated("RTCIceServer.url","RTCIceServer.urls");var n="string"==typeof e;return n&&(e=[e]),e=e.filter((function(A){if(0===A.indexOf("stun:"))return!1;var e=A.startsWith("turn")&&!A.startsWith("turn:[")&&A.includes("transport=udp");return e&&!t?(t=!0,!0):e&&!t})),delete A.url,A.urls=n?e[0]:e,!!e.length}}))};var i=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}(A("../utils"))},{"../utils":15}],9:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=function(A){"getDisplayMedia"in A.navigator&&A.navigator.mediaDevices&&(A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||(A.navigator.mediaDevices.getDisplayMedia=A.navigator.getDisplayMedia.bind(A.navigator)))}},{}],10:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetUserMedia=function(A){var e=A&&A.navigator,t=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(A){return t(A).catch((function(A){return Promise.reject(function(A){return{name:{PermissionDeniedError:"NotAllowedError"}[A.name]||A.name,message:A.message,constraint:A.constraint,toString:function(){return this.name}}}(A))}))}}},{}],11:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=t.shimGetUserMedia=void 0;var n="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(A){return void 0===A?"undefined":i(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":void 0===A?"undefined":i(A)},a=A("./getusermedia");Object.defineProperty(t,"shimGetUserMedia",{enumerable:!0,get:function(){return a.shimGetUserMedia}});var r=A("./getdisplaymedia");Object.defineProperty(t,"shimGetDisplayMedia",{enumerable:!0,get:function(){return r.shimGetDisplayMedia}}),t.shimOnTrack=function(A){"object"===(void 0===A?"undefined":n(A))&&A.RTCTrackEvent&&"receiver"in A.RTCTrackEvent.prototype&&!("transceiver"in A.RTCTrackEvent.prototype)&&Object.defineProperty(A.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},t.shimPeerConnection=function(A){var e=o.detectBrowser(A);if("object"===(void 0===A?"undefined":n(A))&&(A.RTCPeerConnection||A.mozRTCPeerConnection)){if(!A.RTCPeerConnection&&A.mozRTCPeerConnection&&(A.RTCPeerConnection=A.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){var t,i,n,a=A.RTCPeerConnection.prototype[e],r=(n=function(){return arguments[0]=new("addIceCandidate"===e?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),a.apply(this,arguments)},(i=e)in(t={})?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t);A.RTCPeerConnection.prototype[e]=r[e]})),e.version<68){var t=A.RTCPeerConnection.prototype.addIceCandidate;A.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var i={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},a=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){var A=Array.prototype.slice.call(arguments),t=A[0],n=A[1],r=A[2];return a.apply(this,[t||null]).then((function(A){if(e.version<53&&!n)try{A.forEach((function(A){A.type=i[A.type]||A.type}))}catch(e){if("TypeError"!==e.name)throw e;A.forEach((function(e,t){A.set(t,Object.assign({},e,{type:i[e.type]||e.type}))}))}return A})).then(n,r)}}},t.shimSenderGetStats=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.RTCPeerConnection&&A.RTCRtpSender&&(!A.RTCRtpSender||!("getStats"in A.RTCRtpSender.prototype))){var e=A.RTCPeerConnection.prototype.getSenders;e&&(A.RTCPeerConnection.prototype.getSenders=function(){var A=this,t=e.apply(this,[]);return t.forEach((function(e){return e._pc=A})),t});var t=A.RTCPeerConnection.prototype.addTrack;t&&(A.RTCPeerConnection.prototype.addTrack=function(){var A=t.apply(this,arguments);return A._pc=this,A}),A.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},t.shimReceiverGetStats=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.RTCPeerConnection&&A.RTCRtpSender&&(!A.RTCRtpSender||!("getStats"in A.RTCRtpReceiver.prototype))){var e=A.RTCPeerConnection.prototype.getReceivers;e&&(A.RTCPeerConnection.prototype.getReceivers=function(){var A=this,t=e.apply(this,[]);return t.forEach((function(e){return e._pc=A})),t}),o.wrapPeerConnectionEvent(A,"track",(function(A){return A.receiver._pc=A.srcElement,A})),A.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},t.shimRemoveStream=function(A){A.RTCPeerConnection&&!("removeStream"in A.RTCPeerConnection.prototype)&&(A.RTCPeerConnection.prototype.removeStream=function(A){var e=this;o.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(t){t.track&&A.getTracks().includes(t.track)&&e.removeTrack(t)}))})},t.shimRTCDataChannel=function(A){A.DataChannel&&!A.RTCDataChannel&&(A.RTCDataChannel=A.DataChannel)},t.shimAddTransceiver=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype.addTransceiver;e&&(A.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var A=arguments[1],t=A&&"sendEncodings"in A;t&&A.sendEncodings.forEach((function(A){if("rid"in A&&!/^[a-z0-9]{0,16}$/i.test(A.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in A&&!(parseFloat(A.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in A&&!(parseFloat(A.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var i=e.apply(this,arguments);if(t){var n=i.sender,a=n.getParameters();"encodings"in a||(a.encodings=A.sendEncodings,this.setParametersPromises.push(n.setParameters(a).catch((function(){}))))}return i})}},t.shimCreateOffer=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype.createOffer;A.RTCPeerConnection.prototype.createOffer=function(){var A=this,t=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return e.apply(A,t)})).finally((function(){A.setParametersPromises=[]})):e.apply(this,arguments)}}},t.shimCreateAnswer=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype.createAnswer;A.RTCPeerConnection.prototype.createAnswer=function(){var A=this,t=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return e.apply(A,t)})).finally((function(){A.setParametersPromises=[]})):e.apply(this,arguments)}}};var o=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}(A("../utils"))},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=function(A,e){A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||A.navigator.mediaDevices&&(A.navigator.mediaDevices.getDisplayMedia=function(t){if(!t||!t.video){var i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return!0===t.video?t.video={mediaSource:e}:t.video.mediaSource=e,A.navigator.mediaDevices.getUserMedia(t)})}},{}],13:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(A){return void 0===A?"undefined":i(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":void 0===A?"undefined":i(A)};t.shimGetUserMedia=function(A){var e=a.detectBrowser(A),t=A&&A.navigator,i=A&&A.MediaStreamTrack;if(t.getUserMedia=function(A,e,i){a.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(A).then(e,i)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){var r=function(A,e,t){e in A&&!(t in A)&&(A[t]=A[e],delete A[e])},o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(A){return"object"===(void 0===A?"undefined":n(A))&&"object"===n(A.audio)&&(A=JSON.parse(JSON.stringify(A)),r(A.audio,"autoGainControl","mozAutoGainControl"),r(A.audio,"noiseSuppression","mozNoiseSuppression")),o(A)},i&&i.prototype.getSettings){var s=i.prototype.getSettings;i.prototype.getSettings=function(){var A=s.apply(this,arguments);return r(A,"mozAutoGainControl","autoGainControl"),r(A,"mozNoiseSuppression","noiseSuppression"),A}}if(i&&i.prototype.applyConstraints){var g=i.prototype.applyConstraints;i.prototype.applyConstraints=function(A){return"audio"===this.kind&&"object"===(void 0===A?"undefined":n(A))&&(A=JSON.parse(JSON.stringify(A)),r(A,"autoGainControl","mozAutoGainControl"),r(A,"noiseSuppression","mozNoiseSuppression")),g.apply(this,[A])}}}};var a=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}(A("../utils"))},{"../utils":15}],14:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(A){return void 0===A?"undefined":i(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":void 0===A?"undefined":i(A)};t.shimLocalStreamsAPI=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.RTCPeerConnection){if("getLocalStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in A.RTCPeerConnection.prototype)){var e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addStream=function(A){var t=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(A)||this._localStreams.push(A),A.getAudioTracks().forEach((function(i){return e.call(t,i,A)})),A.getVideoTracks().forEach((function(i){return e.call(t,i,A)}))},A.RTCPeerConnection.prototype.addTrack=function(A){var t=arguments[1];return t&&(this._localStreams?this._localStreams.includes(t)||this._localStreams.push(t):this._localStreams=[t]),e.apply(this,arguments)}}"removeStream"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.removeStream=function(A){var e=this;this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(A);if(-1!==t){this._localStreams.splice(t,1);var i=A.getTracks();this.getSenders().forEach((function(A){i.includes(A.track)&&e.removeTrack(A)}))}})}},t.shimRemoteStreamsAPI=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.RTCPeerConnection&&("getRemoteStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in A.RTCPeerConnection.prototype))){Object.defineProperty(A.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(A){var e=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=A),this.addEventListener("track",this._onaddstreampoly=function(A){A.streams.forEach((function(A){if(e._remoteStreams||(e._remoteStreams=[]),!e._remoteStreams.includes(A)){e._remoteStreams.push(A);var t=new Event("addstream");t.stream=A,e.dispatchEvent(t)}}))})}});var e=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){var A=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(A._remoteStreams||(A._remoteStreams=[]),!(A._remoteStreams.indexOf(e)>=0)){A._remoteStreams.push(e);var t=new Event("addstream");t.stream=e,A.dispatchEvent(t)}}))}),e.apply(A,arguments)}}},t.shimCallbacksAPI=function(A){if("object"===(void 0===A?"undefined":n(A))&&A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype,t=e.createOffer,i=e.createAnswer,a=e.setLocalDescription,r=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(A,e){var i=arguments.length>=2?arguments[2]:arguments[0],n=t.apply(this,[i]);return e?(n.then(A,e),Promise.resolve()):n},e.createAnswer=function(A,e){var t=arguments.length>=2?arguments[2]:arguments[0],n=i.apply(this,[t]);return e?(n.then(A,e),Promise.resolve()):n};var s=function(A,e,t){var i=a.apply(this,[A]);return t?(i.then(e,t),Promise.resolve()):i};e.setLocalDescription=s,s=function(A,e,t){var i=r.apply(this,[A]);return t?(i.then(e,t),Promise.resolve()):i},e.setRemoteDescription=s,s=function(A,e,t){var i=o.apply(this,[A]);return t?(i.then(e,t),Promise.resolve()):i},e.addIceCandidate=s}},t.shimGetUserMedia=function(A){var e=A&&A.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var t=e.mediaDevices,i=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=function(A){return i(r(A))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(A,t,i){e.mediaDevices.getUserMedia(A).then(t,i)}.bind(e))},t.shimConstraints=r,t.shimRTCIceServerUrls=function(A){var e=A.RTCPeerConnection;A.RTCPeerConnection=function(A,t){if(A&&A.iceServers){for(var i=[],n=0;n=t&&parseInt(i[t],10)}function o(A){return"[object Object]"===Object.prototype.toString.call(A)}function s(A,e,t){e&&!t.has(e.id)&&(t.set(e.id,e),Object.keys(e).forEach((function(i){i.endsWith("Id")?s(A,A.get(e[i]),t):i.endsWith("Ids")&&e[i].forEach((function(e){s(A,A.get(e),t)}))})))}},{}],16:[function(A,e,i){var n=A("sdp");function a(A,e,t,i,a){var r=n.writeRtpDescription(A.kind,e);if(r+=n.writeIceParameters(A.iceGatherer.getLocalParameters()),r+=n.writeDtlsParameters(A.dtlsTransport.getLocalParameters(),"offer"===t?"actpass":a||"active"),r+="a=mid:"+A.mid+"\r\n",A.rtpSender&&A.rtpReceiver?r+="a=sendrecv\r\n":A.rtpSender?r+="a=sendonly\r\n":A.rtpReceiver?r+="a=recvonly\r\n":r+="a=inactive\r\n",A.rtpSender){var o=A.rtpSender._initialTrackId||A.rtpSender.track.id;A.rtpSender._initialTrackId=o;var s="msid:"+(i?i.id:"-")+" "+o+"\r\n";r+="a="+s,r+="a=ssrc:"+A.sendEncodingParameters[0].ssrc+" "+s,A.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+A.sendEncodingParameters[0].rtx.ssrc+" "+s,r+="a=ssrc-group:FID "+A.sendEncodingParameters[0].ssrc+" "+A.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return r+="a=ssrc:"+A.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",A.rtpSender&&A.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+A.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),r}function r(A,e){var t={codecs:[],headerExtensions:[],fecMechanisms:[]},i=function(A,e){A=parseInt(A,10);for(var t=0;t=14393&&-1===A.indexOf("?transport=udp"):(t=!0,!0)})),delete A.url,A.urls=n?i[0]:i,!!i.length}}))}(t.iceServers||[],e),this._iceGatherers=[],t.iceCandidatePoolSize)for(var r=t.iceCandidatePoolSize;r>0;r--)this._iceGatherers.push(new A.RTCIceGatherer({iceServers:t.iceServers,gatherPolicy:t.iceTransportPolicy}));else t.iceCandidatePoolSize=0;this._config=t,this.transceivers=[],this._sdpSessionId=n.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(c.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(c.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),c.prototype.onicecandidate=null,c.prototype.onaddstream=null,c.prototype.ontrack=null,c.prototype.onremovestream=null,c.prototype.onsignalingstatechange=null,c.prototype.oniceconnectionstatechange=null,c.prototype.onconnectionstatechange=null,c.prototype.onicegatheringstatechange=null,c.prototype.onnegotiationneeded=null,c.prototype.ondatachannel=null,c.prototype._dispatchEvent=function(A,e){this._isClosed||(this.dispatchEvent(e),"function"==typeof this["on"+A]&&this["on"+A](e))},c.prototype._emitGatheringStateChange=function(){var A=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",A)},c.prototype.getConfiguration=function(){return this._config},c.prototype.getLocalStreams=function(){return this.localStreams},c.prototype.getRemoteStreams=function(){return this.remoteStreams},c.prototype._createTransceiver=function(A,e){var t=this.transceivers.length>0,i={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:A,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&t)i.iceTransport=this.transceivers[0].iceTransport,i.dtlsTransport=this.transceivers[0].dtlsTransport;else{var n=this._createIceAndDtlsTransports();i.iceTransport=n.iceTransport,i.dtlsTransport=n.dtlsTransport}return e||this.transceivers.push(i),i},c.prototype.addTrack=function(e,t){if(this._isClosed)throw g("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var i,n=this.transceivers.find((function(A){return A.track===e}));if(n)throw g("InvalidAccessError","Track already exists.");for(var a=0;a=15025)A.getTracks().forEach((function(e){t.addTrack(e,A)}));else{var i=A.clone();A.getTracks().forEach((function(A,e){var t=i.getTracks()[e];A.addEventListener("enabled",(function(A){t.enabled=A.enabled}))})),i.getTracks().forEach((function(A){t.addTrack(A,i)}))}},c.prototype.removeTrack=function(e){if(this._isClosed)throw g("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!t(e,A.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var i=this.transceivers.find((function(A){return A.rtpSender===e}));if(!i)throw g("InvalidAccessError","Sender was not created by this connection.");var n=i.stream;i.rtpSender.stop(),i.rtpSender=null,i.track=null,i.stream=null;var a=this.transceivers.map((function(A){return A.stream}));-1===a.indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},c.prototype.removeStream=function(A){var e=this;A.getTracks().forEach((function(A){var t=e.getSenders().find((function(e){return e.track===A}));t&&e.removeTrack(t)}))},c.prototype.getSenders=function(){return this.transceivers.filter((function(A){return!!A.rtpSender})).map((function(A){return A.rtpSender}))},c.prototype.getReceivers=function(){return this.transceivers.filter((function(A){return!!A.rtpReceiver})).map((function(A){return A.rtpReceiver}))},c.prototype._createIceGatherer=function(e,t){var i=this;if(t&&e>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var n=new A.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(n,"state",{value:"new",writable:!0}),this.transceivers[e].bufferedCandidateEvents=[],this.transceivers[e].bufferCandidates=function(A){var t=!A.candidate||0===Object.keys(A.candidate).length;n.state=t?"completed":"gathering",null!==i.transceivers[e].bufferedCandidateEvents&&i.transceivers[e].bufferedCandidateEvents.push(A)},n.addEventListener("localcandidate",this.transceivers[e].bufferCandidates),n},c.prototype._gather=function(e,t){var i=this,a=this.transceivers[t].iceGatherer;if(!a.onlocalcandidate){var r=this.transceivers[t].bufferedCandidateEvents;this.transceivers[t].bufferedCandidateEvents=null,a.removeEventListener("localcandidate",this.transceivers[t].bufferCandidates),a.onlocalcandidate=function(A){if(!(i.usingBundle&&t>0)){var r=new Event("icecandidate");r.candidate={sdpMid:e,sdpMLineIndex:t};var o=A.candidate,s=!o||0===Object.keys(o).length;if(s)"new"!==a.state&&"gathering"!==a.state||(a.state="completed");else{"new"===a.state&&(a.state="gathering"),o.component=1,o.ufrag=a.getLocalParameters().usernameFragment;var g=n.writeCandidate(o);r.candidate=Object.assign(r.candidate,n.parseCandidate(g)),r.candidate.candidate=g,r.candidate.toJSON=function(){return{candidate:r.candidate.candidate,sdpMid:r.candidate.sdpMid,sdpMLineIndex:r.candidate.sdpMLineIndex,usernameFragment:r.candidate.usernameFragment}}}var l=n.getMediaSections(i._localDescription.sdp);l[r.candidate.sdpMLineIndex]+=s?"a=end-of-candidates\r\n":"a="+r.candidate.candidate+"\r\n",i._localDescription.sdp=n.getDescription(i._localDescription.sdp)+l.join("");var c=i.transceivers.every((function(A){return A.iceGatherer&&"completed"===A.iceGatherer.state}));"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),s||i._dispatchEvent("icecandidate",r),c&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},A.setTimeout((function(){r.forEach((function(A){a.onlocalcandidate(A)}))}),0)}},c.prototype._createIceAndDtlsTransports=function(){var e=this,t=new A.RTCIceTransport(null);t.onicestatechange=function(){e._updateIceConnectionState(),e._updateConnectionState()};var i=new A.RTCDtlsTransport(t);return i.ondtlsstatechange=function(){e._updateConnectionState()},i.onerror=function(){Object.defineProperty(i,"state",{value:"failed",writable:!0}),e._updateConnectionState()},{iceTransport:t,dtlsTransport:i}},c.prototype._disposeIceAndDtlsTransports=function(A){var e=this.transceivers[A].iceGatherer;e&&(delete e.onlocalcandidate,delete this.transceivers[A].iceGatherer);var t=this.transceivers[A].iceTransport;t&&(delete t.onicestatechange,delete this.transceivers[A].iceTransport);var i=this.transceivers[A].dtlsTransport;i&&(delete i.ondtlsstatechange,delete i.onerror,delete this.transceivers[A].dtlsTransport)},c.prototype._transceive=function(A,t,i){var a=r(A.localCapabilities,A.remoteCapabilities);t&&A.rtpSender&&(a.encodings=A.sendEncodingParameters,a.rtcp={cname:n.localCName,compound:A.rtcpParameters.compound},A.recvEncodingParameters.length&&(a.rtcp.ssrc=A.recvEncodingParameters[0].ssrc),A.rtpSender.send(a)),i&&A.rtpReceiver&&a.codecs.length>0&&("video"===A.kind&&A.recvEncodingParameters&&e<15019&&A.recvEncodingParameters.forEach((function(A){delete A.rtx})),A.recvEncodingParameters.length?a.encodings=A.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:A.rtcpParameters.compound},A.rtcpParameters.cname&&(a.rtcp.cname=A.rtcpParameters.cname),A.sendEncodingParameters.length&&(a.rtcp.ssrc=A.sendEncodingParameters[0].ssrc),A.rtpReceiver.receive(a))},c.prototype.setLocalDescription=function(A){var e,t,i=this;if(-1===["offer","answer"].indexOf(A.type))return Promise.reject(g("TypeError",'Unsupported type "'+A.type+'"'));if(!o("setLocalDescription",A.type,i.signalingState)||i._isClosed)return Promise.reject(g("InvalidStateError","Can not set local "+A.type+" in state "+i.signalingState));if("offer"===A.type)e=n.splitSections(A.sdp),t=e.shift(),e.forEach((function(A,e){var t=n.parseRtpParameters(A);i.transceivers[e].localCapabilities=t})),i.transceivers.forEach((function(A,e){i._gather(A.mid,e)}));else if("answer"===A.type){e=n.splitSections(i._remoteDescription.sdp),t=e.shift();var a=n.matchPrefix(t,"a=ice-lite").length>0;e.forEach((function(A,e){var o=i.transceivers[e],s=o.iceGatherer,g=o.iceTransport,l=o.dtlsTransport,c=o.localCapabilities,d=o.remoteCapabilities;if(!(n.isRejected(A)&&0===n.matchPrefix(A,"a=bundle-only").length||o.rejected)){var I=n.getIceParameters(A,t),C=n.getDtlsParameters(A,t);a&&(C.role="server"),i.usingBundle&&0!==e||(i._gather(o.mid,e),"new"===g.state&&g.start(s,I,a?"controlling":"controlled"),"new"===l.state&&l.start(C));var h=r(c,d);i._transceive(o,h.codecs.length>0,!1)}}))}return i._localDescription={type:A.type,sdp:A.sdp},"offer"===A.type?i._updateSignalingState("have-local-offer"):i._updateSignalingState("stable"),Promise.resolve()},c.prototype.setRemoteDescription=function(t){var a=this;if(-1===["offer","answer"].indexOf(t.type))return Promise.reject(g("TypeError",'Unsupported type "'+t.type+'"'));if(!o("setRemoteDescription",t.type,a.signalingState)||a._isClosed)return Promise.reject(g("InvalidStateError","Can not set remote "+t.type+" in state "+a.signalingState));var c={};a.remoteStreams.forEach((function(A){c[A.id]=A}));var d=[],I=n.splitSections(t.sdp),C=I.shift(),h=n.matchPrefix(C,"a=ice-lite").length>0,u=n.matchPrefix(C,"a=group:BUNDLE ").length>0;a.usingBundle=u;var B=n.matchPrefix(C,"a=ice-options:")[0];return a.canTrickleIceCandidates=!!B&&B.substr(14).split(" ").indexOf("trickle")>=0,I.forEach((function(o,g){var l=n.splitLines(o),I=n.getKind(o),B=n.isRejected(o)&&0===n.matchPrefix(o,"a=bundle-only").length,E=l[0].substr(2).split(" ")[2],f=n.getDirection(o,C),Q=n.parseMsid(o),x=n.getMid(o)||n.generateIdentifier();if(B||"application"===I&&("DTLS/SCTP"===E||"UDP/DTLS/SCTP"===E))a.transceivers[g]={mid:x,kind:I,protocol:E,rejected:!0};else{var p,m,y,_,S,D,v,w,b;!B&&a.transceivers[g]&&a.transceivers[g].rejected&&(a.transceivers[g]=a._createTransceiver(I,!0));var F,R,k=n.parseRtpParameters(o);B||(F=n.getIceParameters(o,C),(R=n.getDtlsParameters(o,C)).role="client"),v=n.parseRtpEncodingParameters(o);var P=n.parseRtcpParameters(o),N=n.matchPrefix(o,"a=end-of-candidates",C).length>0,T=n.matchPrefix(o,"a=candidate:").map((function(A){return n.parseCandidate(A)})).filter((function(A){return 1===A.component}));if(("offer"===t.type||"answer"===t.type)&&!B&&u&&g>0&&a.transceivers[g]&&(a._disposeIceAndDtlsTransports(g),a.transceivers[g].iceGatherer=a.transceivers[0].iceGatherer,a.transceivers[g].iceTransport=a.transceivers[0].iceTransport,a.transceivers[g].dtlsTransport=a.transceivers[0].dtlsTransport,a.transceivers[g].rtpSender&&a.transceivers[g].rtpSender.setTransport(a.transceivers[0].dtlsTransport),a.transceivers[g].rtpReceiver&&a.transceivers[g].rtpReceiver.setTransport(a.transceivers[0].dtlsTransport)),"offer"!==t.type||B){if("answer"===t.type&&!B){m=(p=a.transceivers[g]).iceGatherer,y=p.iceTransport,_=p.dtlsTransport,S=p.rtpReceiver,D=p.sendEncodingParameters,w=p.localCapabilities,a.transceivers[g].recvEncodingParameters=v,a.transceivers[g].remoteCapabilities=k,a.transceivers[g].rtcpParameters=P,T.length&&"new"===y.state&&(!h&&!N||u&&0!==g?T.forEach((function(A){s(p.iceTransport,A)})):y.setRemoteCandidates(T)),u&&0!==g||("new"===y.state&&y.start(m,F,"controlling"),"new"===_.state&&_.start(R));var M=r(p.localCapabilities,p.remoteCapabilities).codecs.filter((function(A){return"rtx"===A.name.toLowerCase()})).length;!M&&p.sendEncodingParameters[0].rtx&&delete p.sendEncodingParameters[0].rtx,a._transceive(p,"sendrecv"===f||"recvonly"===f,"sendrecv"===f||"sendonly"===f),!S||"sendrecv"!==f&&"sendonly"!==f?delete p.rtpReceiver:(b=S.track,Q?(c[Q.stream]||(c[Q.stream]=new A.MediaStream),i(b,c[Q.stream]),d.push([b,S,c[Q.stream]])):(c.default||(c.default=new A.MediaStream),i(b,c.default),d.push([b,S,c.default])))}}else{(p=a.transceivers[g]||a._createTransceiver(I)).mid=x,p.iceGatherer||(p.iceGatherer=a._createIceGatherer(g,u)),T.length&&"new"===p.iceTransport.state&&(!N||u&&0!==g?T.forEach((function(A){s(p.iceTransport,A)})):p.iceTransport.setRemoteCandidates(T)),w=A.RTCRtpReceiver.getCapabilities(I),e<15019&&(w.codecs=w.codecs.filter((function(A){return"rtx"!==A.name}))),D=p.sendEncodingParameters||[{ssrc:1001*(2*g+2)}];var L,G=!1;"sendrecv"===f||"sendonly"===f?(G=!p.rtpReceiver,S=p.rtpReceiver||new A.RTCRtpReceiver(p.dtlsTransport,I),G&&(b=S.track,Q&&"-"===Q.stream||(Q?(c[Q.stream]||(c[Q.stream]=new A.MediaStream,Object.defineProperty(c[Q.stream],"id",{get:function(){return Q.stream}})),Object.defineProperty(b,"id",{get:function(){return Q.track}}),L=c[Q.stream]):(c.default||(c.default=new A.MediaStream),L=c.default)),L&&(i(b,L),p.associatedRemoteMediaStreams.push(L)),d.push([b,S,L]))):p.rtpReceiver&&p.rtpReceiver.track&&(p.associatedRemoteMediaStreams.forEach((function(e){var t=e.getTracks().find((function(A){return A.id===p.rtpReceiver.track.id}));t&&function(e,t){t.removeTrack(e),t.dispatchEvent(new A.MediaStreamTrackEvent("removetrack",{track:e}))}(t,e)})),p.associatedRemoteMediaStreams=[]),p.localCapabilities=w,p.remoteCapabilities=k,p.rtpReceiver=S,p.rtcpParameters=P,p.sendEncodingParameters=D,p.recvEncodingParameters=v,a._transceive(a.transceivers[g],!1,G)}}})),void 0===a._dtlsRole&&(a._dtlsRole="offer"===t.type?"active":"passive"),a._remoteDescription={type:t.type,sdp:t.sdp},"offer"===t.type?a._updateSignalingState("have-remote-offer"):a._updateSignalingState("stable"),Object.keys(c).forEach((function(e){var t=c[e];if(t.getTracks().length){if(-1===a.remoteStreams.indexOf(t)){a.remoteStreams.push(t);var i=new Event("addstream");i.stream=t,A.setTimeout((function(){a._dispatchEvent("addstream",i)}))}d.forEach((function(A){var e=A[0],i=A[1];t.id===A[2].id&&l(a,e,i,[t])}))}})),d.forEach((function(A){A[2]||l(a,A[0],A[1],[])})),A.setTimeout((function(){a&&a.transceivers&&a.transceivers.forEach((function(A){A.iceTransport&&"new"===A.iceTransport.state&&A.iceTransport.getRemoteCandidates().length>0&&A.iceTransport.addRemoteCandidate({})}))}),4e3),Promise.resolve()},c.prototype.close=function(){this.transceivers.forEach((function(A){A.iceTransport&&A.iceTransport.stop(),A.dtlsTransport&&A.dtlsTransport.stop(),A.rtpSender&&A.rtpSender.stop(),A.rtpReceiver&&A.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},c.prototype._updateSignalingState=function(A){this.signalingState=A;var e=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",e)},c.prototype._maybeFireNegotiationNeeded=function(){var e=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,A.setTimeout((function(){if(e.needNegotiation){e.needNegotiation=!1;var A=new Event("negotiationneeded");e._dispatchEvent("negotiationneeded",A)}}),0))},c.prototype._updateIceConnectionState=function(){var A,e={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(A){A.iceTransport&&!A.rejected&&e[A.iceTransport.state]++})),A="new",e.failed>0?A="failed":e.checking>0?A="checking":e.disconnected>0?A="disconnected":e.new>0?A="new":e.connected>0?A="connected":e.completed>0&&(A="completed"),A!==this.iceConnectionState){this.iceConnectionState=A;var t=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",t)}},c.prototype._updateConnectionState=function(){var A,e={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(A){A.iceTransport&&A.dtlsTransport&&!A.rejected&&(e[A.iceTransport.state]++,e[A.dtlsTransport.state]++)})),e.connected+=e.completed,A="new",e.failed>0?A="failed":e.connecting>0?A="connecting":e.disconnected>0?A="disconnected":e.new>0?A="new":e.connected>0&&(A="connected"),A!==this.connectionState){this.connectionState=A;var t=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",t)}},c.prototype.createOffer=function(){var t=this;if(t._isClosed)return Promise.reject(g("InvalidStateError","Can not call createOffer after close"));var i=t.transceivers.filter((function(A){return"audio"===A.kind})).length,r=t.transceivers.filter((function(A){return"video"===A.kind})).length,o=arguments[0];if(o){if(o.mandatory||o.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==o.offerToReceiveAudio&&(i=!0===o.offerToReceiveAudio?1:!1===o.offerToReceiveAudio?0:o.offerToReceiveAudio),void 0!==o.offerToReceiveVideo&&(r=!0===o.offerToReceiveVideo?1:!1===o.offerToReceiveVideo?0:o.offerToReceiveVideo)}for(t.transceivers.forEach((function(A){"audio"===A.kind?--i<0&&(A.wantReceive=!1):"video"===A.kind&&--r<0&&(A.wantReceive=!1)}));i>0||r>0;)i>0&&(t._createTransceiver("audio"),i--),r>0&&(t._createTransceiver("video"),r--);var s=n.writeSessionBoilerplate(t._sdpSessionId,t._sdpSessionVersion++);t.transceivers.forEach((function(i,a){var r=i.track,o=i.kind,s=i.mid||n.generateIdentifier();i.mid=s,i.iceGatherer||(i.iceGatherer=t._createIceGatherer(a,t.usingBundle));var g=A.RTCRtpSender.getCapabilities(o);e<15019&&(g.codecs=g.codecs.filter((function(A){return"rtx"!==A.name}))),g.codecs.forEach((function(A){"H264"===A.name&&void 0===A.parameters["level-asymmetry-allowed"]&&(A.parameters["level-asymmetry-allowed"]="1"),i.remoteCapabilities&&i.remoteCapabilities.codecs&&i.remoteCapabilities.codecs.forEach((function(e){A.name.toLowerCase()===e.name.toLowerCase()&&A.clockRate===e.clockRate&&(A.preferredPayloadType=e.payloadType)}))})),g.headerExtensions.forEach((function(A){(i.remoteCapabilities&&i.remoteCapabilities.headerExtensions||[]).forEach((function(e){A.uri===e.uri&&(A.id=e.id)}))}));var l=i.sendEncodingParameters||[{ssrc:1001*(2*a+1)}];r&&e>=15019&&"video"===o&&!l[0].rtx&&(l[0].rtx={ssrc:l[0].ssrc+1}),i.wantReceive&&(i.rtpReceiver=new A.RTCRtpReceiver(i.dtlsTransport,o)),i.localCapabilities=g,i.sendEncodingParameters=l})),"max-compat"!==t._config.bundlePolicy&&(s+="a=group:BUNDLE "+t.transceivers.map((function(A){return A.mid})).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n",t.transceivers.forEach((function(A,e){s+=a(A,A.localCapabilities,"offer",A.stream,t._dtlsRole),s+="a=rtcp-rsize\r\n",!A.iceGatherer||"new"===t.iceGatheringState||0!==e&&t.usingBundle||(A.iceGatherer.getLocalCandidates().forEach((function(A){A.component=1,s+="a="+n.writeCandidate(A)+"\r\n"})),"completed"===A.iceGatherer.state&&(s+="a=end-of-candidates\r\n"))}));var l=new A.RTCSessionDescription({type:"offer",sdp:s});return Promise.resolve(l)},c.prototype.createAnswer=function(){var t=this;if(t._isClosed)return Promise.reject(g("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==t.signalingState&&"have-local-pranswer"!==t.signalingState)return Promise.reject(g("InvalidStateError","Can not call createAnswer in signalingState "+t.signalingState));var i=n.writeSessionBoilerplate(t._sdpSessionId,t._sdpSessionVersion++);t.usingBundle&&(i+="a=group:BUNDLE "+t.transceivers.map((function(A){return A.mid})).join(" ")+"\r\n"),i+="a=ice-options:trickle\r\n";var o=n.getMediaSections(t._remoteDescription.sdp).length;t.transceivers.forEach((function(A,n){if(!(n+1>o)){if(A.rejected)return"application"===A.kind?"DTLS/SCTP"===A.protocol?i+="m=application 0 DTLS/SCTP 5000\r\n":i+="m=application 0 "+A.protocol+" webrtc-datachannel\r\n":"audio"===A.kind?i+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===A.kind&&(i+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(i+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+A.mid+"\r\n");var s;A.stream&&("audio"===A.kind?s=A.stream.getAudioTracks()[0]:"video"===A.kind&&(s=A.stream.getVideoTracks()[0]),s&&e>=15019&&"video"===A.kind&&!A.sendEncodingParameters[0].rtx&&(A.sendEncodingParameters[0].rtx={ssrc:A.sendEncodingParameters[0].ssrc+1}));var g=r(A.localCapabilities,A.remoteCapabilities),l=g.codecs.filter((function(A){return"rtx"===A.name.toLowerCase()})).length;!l&&A.sendEncodingParameters[0].rtx&&delete A.sendEncodingParameters[0].rtx,i+=a(A,g,"answer",A.stream,t._dtlsRole),A.rtcpParameters&&A.rtcpParameters.reducedSize&&(i+="a=rtcp-rsize\r\n")}}));var s=new A.RTCSessionDescription({type:"answer",sdp:i});return Promise.resolve(s)},c.prototype.addIceCandidate=function(A){var e,t=this;return A&&void 0===A.sdpMLineIndex&&!A.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(i,a){if(!t._remoteDescription)return a(g("InvalidStateError","Can not add ICE candidate without a remote description"));if(A&&""!==A.candidate){var r=A.sdpMLineIndex;if(A.sdpMid)for(var o=0;o0?n.parseCandidate(A.candidate):{};if("tcp"===c.protocol&&(0===c.port||9===c.port))return i();if(c.component&&1!==c.component)return i();if((0===r||r>0&&l.iceTransport!==t.transceivers[0].iceTransport)&&!s(l.iceTransport,c))return a(g("OperationError","Can not add ICE candidate"));var d=A.candidate.trim();0===d.indexOf("a=")&&(d=d.substr(2)),(e=n.getMediaSections(t._remoteDescription.sdp))[r]+="a="+(c.type?d:"end-of-candidates")+"\r\n",t._remoteDescription.sdp=n.getDescription(t._remoteDescription.sdp)+e.join("")}else for(var I=0;I0?e[0].split("/")[1]:"sendrecv",uri:e[1]}},n.writeExtmap=function(A){return"a=extmap:"+(A.id||A.preferredId)+(A.direction&&"sendrecv"!==A.direction?"/"+A.direction:"")+" "+A.uri+"\r\n"},n.parseFmtp=function(A){for(var e,t={},i=A.substr(A.indexOf(" ")+1).split(";"),n=0;n-1?(t.attribute=A.substr(e+1,i-e-1),t.value=A.substr(i+1)):t.attribute=A.substr(e+1),t},n.parseSsrcGroup=function(A){var e=A.substr(13).split(" ");return{semantics:e.shift(),ssrcs:e.map((function(A){return parseInt(A,10)}))}},n.getMid=function(A){var e=n.matchPrefix(A,"a=mid:")[0];if(e)return e.substr(6)},n.parseFingerprint=function(A){var e=A.substr(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1]}},n.getDtlsParameters=function(A,e){return{role:"auto",fingerprints:n.matchPrefix(A+e,"a=fingerprint:").map(n.parseFingerprint)}},n.writeDtlsParameters=function(A,e){var t="a=setup:"+e+"\r\n";return A.fingerprints.forEach((function(A){t+="a=fingerprint:"+A.algorithm+" "+A.value+"\r\n"})),t},n.getIceParameters=function(A,e){var t=n.splitLines(A);return{usernameFragment:(t=t.concat(n.splitLines(e))).filter((function(A){return 0===A.indexOf("a=ice-ufrag:")}))[0].substr(12),password:t.filter((function(A){return 0===A.indexOf("a=ice-pwd:")}))[0].substr(10)}},n.writeIceParameters=function(A){return"a=ice-ufrag:"+A.usernameFragment+"\r\na=ice-pwd:"+A.password+"\r\n"},n.parseRtpParameters=function(A){for(var e={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},t=n.splitLines(A)[0].split(" "),i=3;i0?"9":"0",t+=" UDP/TLS/RTP/SAVPF ",t+=e.codecs.map((function(A){return void 0!==A.preferredPayloadType?A.preferredPayloadType:A.payloadType})).join(" ")+"\r\n",t+="c=IN IP4 0.0.0.0\r\n",t+="a=rtcp:9 IN IP4 0.0.0.0\r\n",e.codecs.forEach((function(A){t+=n.writeRtpMap(A),t+=n.writeFmtp(A),t+=n.writeRtcpFb(A)}));var i=0;return e.codecs.forEach((function(A){A.maxptime>i&&(i=A.maxptime)})),i>0&&(t+="a=maxptime:"+i+"\r\n"),t+="a=rtcp-mux\r\n",e.headerExtensions&&e.headerExtensions.forEach((function(A){t+=n.writeExtmap(A)})),t},n.parseRtpEncodingParameters=function(A){var e,t=[],i=n.parseRtpParameters(A),a=-1!==i.fecMechanisms.indexOf("RED"),r=-1!==i.fecMechanisms.indexOf("ULPFEC"),o=n.matchPrefix(A,"a=ssrc:").map((function(A){return n.parseSsrcMedia(A)})).filter((function(A){return"cname"===A.attribute})),s=o.length>0&&o[0].ssrc,g=n.matchPrefix(A,"a=ssrc-group:FID").map((function(A){return A.substr(17).split(" ").map((function(A){return parseInt(A,10)}))}));g.length>0&&g[0].length>1&&g[0][0]===s&&(e=g[0][1]),i.codecs.forEach((function(A){if("RTX"===A.name.toUpperCase()&&A.parameters.apt){var i={ssrc:s,codecPayloadType:parseInt(A.parameters.apt,10)};s&&e&&(i.rtx={ssrc:e}),t.push(i),a&&((i=JSON.parse(JSON.stringify(i))).fec={ssrc:s,mechanism:r?"red+ulpfec":"red"},t.push(i))}})),0===t.length&&s&&t.push({ssrc:s});var l=n.matchPrefix(A,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substr(5),10)*.95-16e3:void 0,t.forEach((function(A){A.maxBitrate=l}))),t},n.parseRtcpParameters=function(A){var e={},t=n.matchPrefix(A,"a=ssrc:").map((function(A){return n.parseSsrcMedia(A)})).filter((function(A){return"cname"===A.attribute}))[0];t&&(e.cname=t.value,e.ssrc=t.ssrc);var i=n.matchPrefix(A,"a=rtcp-rsize");e.reducedSize=i.length>0,e.compound=0===i.length;var a=n.matchPrefix(A,"a=rtcp-mux");return e.mux=a.length>0,e},n.parseMsid=function(A){var e,t=n.matchPrefix(A,"a=msid:");if(1===t.length)return{stream:(e=t[0].substr(7).split(" "))[0],track:e[1]};var i=n.matchPrefix(A,"a=ssrc:").map((function(A){return n.parseSsrcMedia(A)})).filter((function(A){return"msid"===A.attribute}));return i.length>0?{stream:(e=i[0].value.split(" "))[0],track:e[1]}:void 0},n.parseSctpDescription=function(A){var e,t=n.parseMLine(A),i=n.matchPrefix(A,"a=max-message-size:");i.length>0&&(e=parseInt(i[0].substr(19),10)),isNaN(e)&&(e=65536);var a=n.matchPrefix(A,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substr(12),10),protocol:t.fmt,maxMessageSize:e};if(n.matchPrefix(A,"a=sctpmap:").length>0){var r=n.matchPrefix(A,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(r[0],10),protocol:r[1],maxMessageSize:e}}},n.writeSctpDescription=function(A,e){var t=[];return t="DTLS/SCTP"!==A.protocol?["m="+A.kind+" 9 "+A.protocol+" "+e.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+e.port+"\r\n"]:["m="+A.kind+" 9 "+A.protocol+" "+e.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+e.port+" "+e.protocol+" 65535\r\n"],void 0!==e.maxMessageSize&&t.push("a=max-message-size:"+e.maxMessageSize+"\r\n"),t.join("")},n.generateSessionId=function(){return Math.random().toString().substr(2,21)},n.writeSessionBoilerplate=function(A,e,t){var i=void 0!==e?e:2;return"v=0\r\no="+(t||"thisisadapterortc")+" "+(A||n.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(A,e,t,i){var a=n.writeRtpDescription(A.kind,e);if(a+=n.writeIceParameters(A.iceGatherer.getLocalParameters()),a+=n.writeDtlsParameters(A.dtlsTransport.getLocalParameters(),"offer"===t?"actpass":"active"),a+="a=mid:"+A.mid+"\r\n",A.direction?a+="a="+A.direction+"\r\n":A.rtpSender&&A.rtpReceiver?a+="a=sendrecv\r\n":A.rtpSender?a+="a=sendonly\r\n":A.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",A.rtpSender){var r="msid:"+i.id+" "+A.rtpSender.track.id+"\r\n";a+="a="+r,a+="a=ssrc:"+A.sendEncodingParameters[0].ssrc+" "+r,A.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+A.sendEncodingParameters[0].rtx.ssrc+" "+r,a+="a=ssrc-group:FID "+A.sendEncodingParameters[0].ssrc+" "+A.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+A.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",A.rtpSender&&A.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+A.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),a},n.getDirection=function(A,e){for(var t=n.splitLines(A),i=0;i=26&&A<=e||Td.extension.isInstalled()}return!0};var Nd={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&&window.clearTimeout(e.data.id)}))}};function Td(A){if(void 0===Td.initDone)return A.error("Library not initialized"),{};if(!Td.isWebrtcSupported())return A.error("WebRTC not supported by this browser"),{};if(Td.log("Library initialized: "+Td.initDone),(A=A||{}).success="function"==typeof A.success?A.success:Td.noop,A.error="function"==typeof A.error?A.error:Td.noop,A.destroyed="function"==typeof A.destroyed?A.destroyed:Td.noop,null===A.server||void 0===A.server)return A.error("Invalid server url"),{};var e=!1,t=null,i={},n=null,a=null,r=0,o=A.server;Td.isArray(o)?(Td.log("Multiple servers provided ("+o.length+"), will use the first that works"),o=null,a=A.server,Td.debug(a)):0===o.indexOf("ws")?(e=!0,Td.log("Using WebSockets to contact Janus: "+o)):(e=!1,Td.log("Using REST API to contact Janus: "+o));var s=A.iceServers;null==s&&(s=[{urls:"stun:stun.l.google.com:19302"}]);var g=A.iceTransportPolicy,l=A.bundlePolicy,c=A.ipv6;null==c&&(c=!1);var d=!1;void 0!==A.withCredentials&&null!==A.withCredentials&&(d=!0===A.withCredentials);var I=10;void 0!==A.max_poll_events&&null!==A.max_poll_events&&(I=A.max_poll_events),I<1&&(I=1);var C=null;void 0!==A.token&&null!==A.token&&(C=A.token);var h=null;void 0!==A.apisecret&&null!==A.apisecret&&(h=A.apisecret),this.destroyOnUnload=!0,void 0!==A.destroyOnUnload&&null!==A.destroyOnUnload&&(this.destroyOnUnload=!0===A.destroyOnUnload);var u=25e3;void 0!==A.keepAlivePeriod&&null!==A.keepAlivePeriod&&(u=A.keepAlivePeriod),isNaN(u)&&(u=25e3);var B=6e4;function E(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&&(B=A.longPollTimeout),isNaN(B)&&(B=6e4);var f=!1,Q=null,x={},p=this,m=0,y={};function _(){if(null!=Q)if(Td.debug("Long poll..."),f){var e=o+"/"+Q+"?rid="+(new Date).getTime();null!=I&&(e=e+"&maxev="+I),null!=C&&(e=e+"&token="+encodeURIComponent(C)),null!=h&&(e=e+"&apisecret="+encodeURIComponent(h)),Td.httpAPICall(e,{verb:"GET",withCredentials:d,success:S,timeout:B,error:function(e,t){if(Td.error(e+":",t),++m>3)return f=!1,void A.error("Lost connection to the server (is it down?)");_()}})}else Td.warn("Is the server down? (connected=false)")}function S(A,i){if(m=0,e||null==Q||!0===i||_(),e||!Td.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 Td.warn("Missing sender...");if(null==(l=x[s]))return void Td.debug("This handle is not attached to this session");var n=A.candidate;Td.debug("Got a trickled candidate on session "+Q),Td.debug(n);var a=l.webrtcStuff;a.pc&&a.remoteSdp?(Td.debug("Adding remote candidate:",n),n&&!0!==n.completed?a.pc.addIceCandidate(n):a.pc.addIceCandidate(Td.endOfCandidates)):(Td.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),a.candidates||(a.candidates=[]),a.candidates.push(n),Td.debug(a.candidates))}else{if("webrtcup"===A.rtcgw)return Td.debug("Got a webrtcup event on session "+Q),Td.debug(A),null==(s=A.sender)?void Td.warn("Missing sender..."):null==(l=x[s])?void Td.debug("This handle is not attached to this session"):void l.webrtcState(!0);if("hangup"===A.rtcgw){if(Td.debug("Got a hangup event on session "+Q),Td.debug(A),null==(s=A.sender))return void Td.warn("Missing sender...");if(null==(l=x[s]))return void Td.debug("This handle is not attached to this session");l.webrtcState(!1,A.reason),l.hangup()}else if("detached"===A.rtcgw){if(Td.debug("Got a detached event on session "+Q),Td.debug(A),null==(s=A.sender))return void Td.warn("Missing sender...");if(null==(l=x[s]))return;l.detached=!0,l.ondetached(),l.detach()}else if("media"===A.rtcgw){if(Td.debug("Got a media event on session "+Q),Td.debug(A),null==(s=A.sender))return void Td.warn("Missing sender...");if(null==(l=x[s]))return void Td.debug("This handle is not attached to this session");l.mediaState(A.type,A.receiving)}else if("slowlink"===A.rtcgw){if(Td.debug("Got a slowlink event on session "+Q),Td.debug(A),null==(s=A.sender))return void Td.warn("Missing sender...");if(null==(l=x[s]))return void Td.debug("This handle is not attached to this session");l.slowLink(A.uplink,A.lost)}else{if("error"===A.rtcgw){var r,o;if(Td.error("Ooops: "+A.error.code+" "+A.error.reason),Td.debug(A),null!=(r=A.transaction))null!=(o=y[r])&&o(A),delete y[r];return}if("event"===A.rtcgw){var s;if(Td.debug("Got a plugin event on session "+Q),Td.debug(A),null==(s=A.sender))return void Td.warn("Missing sender...");var g=A.plugindata;if(null==g)return void Td.warn("Missing plugindata...");Td.debug(" -- Event is coming from "+s+" ("+g.plugin+")");var l,c=g.data;if(Td.debug(c),null==(l=x[s]))return void Td.warn("This handle is not attached to this session");var d=A.jsep;null!=d&&(Td.debug("Handling SDP as well..."),Td.debug(d));var I=l.onmessage;null!=I?(Td.debug("Notifying application..."),I(c,d)):Td.debug("No provided notification callback")}else{if("timeout"===A.rtcgw)return Td.error("Timeout on session "+Q),Td.debug(A),void(e&&t.close(3504,"Gateway timeout"));Td.warn("Unknown message/event '"+A.rtcgw+"' on session "+Q),Td.debug(A)}}}else Td.debug("Got a success on session "+Q),Td.debug(A),null!=(r=A.transaction)&&(null!=(o=y[r])&&o(A),delete y[r]);else Td.debug("Got an ack on session "+Q),Td.debug(A),null!=(r=A.transaction)&&(null!=(o=y[r])&&o(A),delete y[r]);else Td.vdebug("Got a keepalive on session "+Q);else for(var C=0;C data channel: "+t),"open"===t){if(a.dataChannel[e].pending&&a.dataChannel[e].pending.length>0){for(var i in Td.log("Sending pending messages on <"+e+">:",a.dataChannel[e].pending.length),a.dataChannel[e].pending){var r=a.dataChannel[e].pending[i];Td.log("Sending string on data channel <"+e+">: "+r),a.dataChannel[e].send(r)}a.dataChannel[e].pending=[]}n.ondataopen(e)}};a.dataChannel[e]=t||a.pc.createDataChannel(e,{ordered:!1}),a.dataChannel[e].onmessage=function(A){Td.log("Received message on data channel:",A);var e=A.target.label;n.ondata(A.data,e)},a.dataChannel[e].onopen=r,a.dataChannel[e].onclose=r,a.dataChannel[e].onerror=function(A){Td.error("Got error on data channel:",A)},a.dataChannel[e].pending=[],i&&a.dataChannel[e].pending.push(i)}else Td.warn("Invalid handle")}function R(A,e){(e=e||{}).success="function"==typeof e.success?e.success:Td.noop,e.error="function"==typeof e.error?e.error:Td.noop;var t=x[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return Td.warn("Invalid handle"),void e.error("Invalid handle");var i=t.webrtcStuff,n=e.text;if(null==n)return Td.warn("Invalid text"),void e.error("Invalid text");var a=e.label?e.label:Td.dataChanDefaultLabel;return i.dataChannel[a]?"open"!==i.dataChannel[a].readyState?(i.dataChannel[a].pending.push(n),void e.success()):(Td.log("Sending string on data channel <"+a+">: "+n),i.dataChannel[a].send(n),void e.success()):(F(A,a,!1,n),void e.success())}function k(A,e){(e=e||{}).success="function"==typeof e.success?e.success:Td.noop,e.error="function"==typeof e.error?e.error:Td.noop;var t=x[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return Td.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 Td.warn("Invalid DTMF configuration (no audio track)"),void e.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=n.dtmf,i.dtmfSender&&(Td.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(A){Td.debug("Sent DTMF tone: "+A.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return Td.warn("Invalid DTMF configuration"),void e.error("Invalid DTMF configuration")}var a=e.dtmf;if(null==a)return Td.warn("Invalid DTMF parameters"),void e.error("Invalid DTMF parameters");var r=a.tones;if(null==r)return Td.warn("Invalid DTMF string"),void e.error("Invalid DTMF string");var o=a.duration;null==o&&(o=500);var s=a.gap;null==s&&(s=50),Td.debug("Sending DTMF string "+r+" (duration "+o+"ms, gap "+s+"ms)"),i.dtmfSender.insertDTMF(r,o,s),e.success()}function P(A,i){(i=i||{}).success="function"==typeof i.success?i.success:Td.noop,i.error="function"==typeof i.error?i.error:Td.noop;var n=!0;void 0!==i.asyncRequest&&null!==i.asyncRequest&&(n=!0===i.asyncRequest);var a=!0;void 0!==i.noRequest&&null!==i.noRequest&&(a=!0===i.noRequest),Td.log("Destroying handle "+A+" (async="+n+")"),K(A);var r=x[A];if(null==r||r.detached)return delete x[A],void i.success();if(a)return delete x[A],void i.success();if(!f)return Td.warn("Is the server down? (connected=false)"),void i.error("Is the server down? (connected=false)");var s={rtcgw:"detach",transaction:Td.randomString(12)};if(null!==r.token&&void 0!==r.token&&(s.token=r.token),null!=h&&(s.apisecret=h),e)return s.session_id=Q,s.handle_id=A,t.send(JSON.stringify(s)),delete x[A],void i.success();Td.httpAPICall(o+"/"+Q+"/"+A,{verb:"POST",async:n,withCredentials:d,body:s,success:function(e){Td.log("Destroyed handle:"),Td.debug(e),"success"!==e.rtcgw&&Td.error("Ooops: "+e.error.code+" "+e.error.reason),delete x[A],i.success()},error:function(e,t){Td.error(e+":",t),delete x[A],i.success()}})}function N(A,e,t,i,n){return T.apply(this,arguments)}function T(){return T=function(A){return function(){var e=this,t=arguments;return new Promise((function(i,n){var a=A.apply(e,t);function r(A){Rd(a,i,n,r,o,"next",A)}function o(A){Rd(a,i,n,r,o,"throw",A)}r(void 0)}))}}((function(A,e,t,i,n){var a,r,o,d,I,C,h,u,B,f,Q,p,m,y,_,S,D,v,w,R,k,P,N,T;return Pd(this,(function(M){switch(M.label){case 0:return null==(a=x[A])||null===a.webrtcStuff||void 0===a.webrtcStuff?(Td.warn("Invalid handle"),i.error("Invalid handle"),[2]):(r=a.webrtcStuff,Td.debug("streamsDone:",n),n&&(Td.debug(" -- Audio tracks:",n.getAudioTracks()),Td.debug(" -- Video tracks:",n.getVideoTracks())),o=!1,r.myStream&&t.update&&!r.streamExternal?[3,1]:(r.myStream=n,o=!0,[3,8]));case 1:if(!((!t.update&&V(t)||t.update&&(t.addAudio||t.replaceAudio))&&n.getAudioTracks()&&n.getAudioTracks().length))return[3,7];if(r.myStream.addTrack(n.getAudioTracks()[0]),!Td.unifiedPlan)return[3,6];if(Td.log((t.replaceAudio?"Replacing":"Adding")+" audio track:",n.getAudioTracks()[0]),d=null,(p=r.pc.getTransceivers())&&p.length>0)for(var L in p)if((m=p[L]).sender&&m.sender.track&&"audio"===m.sender.track.kind||m.receiver&&m.receiver.track&&"audio"===m.receiver.track.kind){d=m;break}I=null,M.label=2;case 2:return M.trys.push([2,4,,5]),[4,i.customizeStream(n)];case 3:return I=M.sent(),[3,5];case 4:return C=M.sent(),i.error(C),[3,5];case 5:return d&&d.sender?d.sender.replaceTrack((null==I||null==(u=I.getAudioTracks)||null==(h=u.call(I))?void 0:h[0])||n.getAudioTracks()[0]):r.pc.addTrack((null==I||null==(f=I.getAudioTracks)||null==(B=f.call(I))?void 0:B[0])||n.getAudioTracks()[0],I||n),[3,7];case 6:Td.log((t.replaceAudio?"Replacing":"Adding")+" audio track:",n.getAudioTracks()[0]),r.pc.addTrack(n.getAudioTracks()[0],n),M.label=7;case 7:if((!t.update&&j(t)||t.update&&(t.addVideo||t.replaceVideo))&&n.getVideoTracks()&&n.getVideoTracks().length)if(r.myStream.addTrack(n.getVideoTracks()[0]),Td.unifiedPlan){if(Td.log((t.replaceVideo?"Replacing":"Adding")+" video track:",n.getVideoTracks()[0]),Q=null,(p=r.pc.getTransceivers())&&p.length>0)for(var L in p)if((m=p[L]).sender&&m.sender.track&&"video"===m.sender.track.kind||m.receiver&&m.receiver.track&&"video"===m.receiver.track.kind){Q=m;break}Q&&Q.sender?Q.sender.replaceTrack(n.getVideoTracks()[0]):r.pc.addTrack(n.getVideoTracks()[0],n)}else Td.log((t.replaceVideo?"Replacing":"Adding")+" video track:",n.getVideoTracks()[0]),r.pc.addTrack(n.getVideoTracks()[0],n);M.label=8;case 8:if(!r.pc){if(y={iceServers:s,iceTransportPolicy:g,bundlePolicy:l},"chrome"===Td.webRTCAdapter.browserDetails.browser&&(y.sdpSemantics=Td.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan"),_={optional:[{DtlsSrtpKeyAgreement:!0}]},!0===c&&_.optional.push({googIPv6:!0}),i.rtcConstraints&&"object"===kd(i.rtcConstraints))for(var L in Td.debug("Adding custom PeerConnection constraints:",i.rtcConstraints),i.rtcConstraints)_.optional.push(i.rtcConstraints[L]);"edge"===Td.webRTCAdapter.browserDetails.browser&&(y.bundlePolicy="max-bundle"),Td.log("Creating PeerConnection"),Td.debug(_),r.pc=new RTCPeerConnection(y,_),Td.debug(r.pc),r.pc.getStats&&(r.volume={},r.bitrate.value="0 kbits/sec"),Td.log("Preparing local SDP and gathering candidates (trickle="+r.trickle+")"),r.pc.oniceconnectionstatechange=function(A){r.pc&&a.iceState(r.pc.iceConnectionState)},r.pc.onicecandidate=function(e){if(null==e.candidate||"edge"===Td.webRTCAdapter.browserDetails.browser&&e.candidate.candidate.indexOf("endOfCandidates")>0)Td.log("End of candidates."),r.iceDone=!0,!0===r.trickle?b(A,{completed:!0}):function(A,e){e=e||{},e.success="function"==typeof e.success?e.success:Td.noop,e.error="function"==typeof e.error?e.error:Td.noop;var t=x[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return void Td.warn("Invalid handle, not sending anything");var i=t.webrtcStuff;if(Td.log("Sending offer/answer SDP..."),null===i.mySdp||void 0===i.mySdp)return void Td.warn("Local SDP instance is invalid, not sending anything...");i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp.trickle=!1);Td.debug(e),i.sdpSent=!0,e.success(i.mySdp)}(A,i);else{var t={candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex};!0===r.trickle&&b(A,t)}},r.pc.ontrack=function(A){Td.log("Handling Remote Track"),Td.debug(A),A.streams&&(r.remoteStream=A.streams[0],a.onremotestream(r.remoteStream),A.track.onended||(Td.log("Adding onended callback to track:",A.track),A.track.onended=function(A){Td.log("Remote track muted/removed:",A),r.remoteStream&&(r.remoteStream.removeTrack(A.target),a.onremotestream(r.remoteStream))},A.track.onmute=A.track.onended,A.track.onunmute=function(A){try{r.remoteStream.addTrack(A.target),a.onremotestream(r.remoteStream)}catch(A){Td.error(A)}}))}}if(!o||null==n)return[3,18];Td.log("Adding local stream"),S=!0===i.simulcast2,D=n.getTracks(),v=0,M.label=9;case 9:if(!(v0)for(var l in g){var c=g[l];c.sender&&c.sender.track&&"audio"===c.sender.track.kind||c.receiver&&c.receiver.track&&"audio"===c.receiver.track.kind?o||(o=c):(c.sender&&c.sender.track&&"video"===c.sender.track.kind||c.receiver&&c.receiver.track&&"video"===c.receiver.track.kind)&&(s||(s=c))}var d=V(e),I=O(e);d||I?d&&I?o&&(o.setDirection?o.setDirection("sendrecv"):o.direction="sendrecv",Td.log("Setting audio transceiver to sendrecv:",o)):d&&!I?o&&(o.setDirection?o.setDirection("sendonly"):o.direction="sendonly",Td.log("Setting audio transceiver to sendonly:",o)):!d&&I&&(o?(o.setDirection?o.setDirection("recvonly"):o.direction="recvonly",Td.log("Setting audio transceiver to recvonly:",o)):(o=n.pc.addTransceiver("audio",{direction:"recvonly"}),Td.log("Adding recvonly audio transceiver:",o))):e.removeAudio&&o&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive",Td.log("Setting audio transceiver to inactive:",o));var C=j(e),h=W(e);C||h?C&&h?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Td.log("Setting video transceiver to sendrecv:",s)):C&&!h?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Td.log("Setting video transceiver to sendonly:",s)):!C&&h&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Td.log("Setting video transceiver to recvonly:",s)):(s=n.pc.addTransceiver("video",{direction:"recvonly"}),Td.log("Adding recvonly video transceiver:",s))):e.removeVideo&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",Td.log("Setting video transceiver to inactive:",s))}else r.offerToReceiveAudio=O(e),r.offerToReceiveVideo=W(e);var u=!0===t.iceRestart;u&&(r.iceRestart=!0);Td.debug(r);var B=j(e);if(B&&a&&"firefox"===Td.webRTCAdapter.browserDetails.browser){Td.log("Enabling Simulcasting for Firefox (RID)");var f=n.pc.getSenders().find((function(A){return"video"==A.track.kind}));if(f){var Q=f.getParameters();Q||(Q={});var p=E(t.simulcastMaxBitrates);Q.encodings=[{rid:"h",active:!0,maxBitrate:p.high},{rid:"m",active:!0,maxBitrate:p.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:p.low,scaleResolutionDownBy:4}],f.setParameters(Q)}}n.pc.createOffer(r).then((function(A){Td.debug(A);var e={type:A.type,sdp:A.sdp};t.customizeSdp(e),A.sdp=e.sdp,Td.log("Setting local description"),B&&a&&("chrome"===Td.webRTCAdapter.browserDetails.browser||"safari"===Td.webRTCAdapter.browserDetails.browser?(Td.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,r=null,o=null,s=null,g=-1,l=0;l-1){g=l;break}}else if(t){var c=e[l].match(/a=ssrc-group:FID (\d+) (\d+)/);if(c)i[0]=c[1],n[0]=c[2],e.splice(l,1),l--;else{if(i[0]){if((C=e[l].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=C[1]),(C=e[l].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=C[1]),(C=e[l].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(o=C[1]),(C=e[l].match("a=ssrc:"+i[0]+" label:(.+)"))&&(s=C[1]),0===e[l].indexOf("a=ssrc:"+n[0])){e.splice(l,1),l--;continue}if(0===e[l].indexOf("a=ssrc:"+i[0])){e.splice(l,1),l--;continue}}0!=e[l].length||(e.splice(l,1),l--)}}}if(i[0]<0){g=-1,t=!1;for(l=0;l-1){g=l;break}}else if(t){if(i[0]<0){var I=e[l].match(/a=ssrc:(\d+)/);if(I){i[0]=I[1],e.splice(l,1),l--;continue}}else{var C;if((C=e[l].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=C[1]),(C=e[l].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=C[1]),(C=e[l].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(o=C[1]),(C=e[l].match("a=ssrc:"+i[0]+" label:(.+)"))&&(s=C[1]),0===e[l].indexOf("a=ssrc:"+n[0])){e.splice(l,1),l--;continue}if(0===e[l].indexOf("a=ssrc:"+i[0])){e.splice(l,1),l--;continue}}0!=e[l].length||(e.splice(l,1),l--)}}}if(i[0]<0)return Td.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(l=0;l0){for(var n=0;n0)for(var l in g){var c=g[l];c.sender&&c.sender.track&&"audio"===c.sender.track.kind||c.receiver&&c.receiver.track&&"audio"===c.receiver.track.kind?o||(o=c):(c.sender&&c.sender.track&&"video"===c.sender.track.kind||c.receiver&&c.receiver.track&&"video"===c.receiver.track.kind)&&(s||(s=c))}var d=V(e),I=O(e);if(d||I){if(d&&I){if(o)try{o.setDirection?o.setDirection("sendrecv"):o.direction="sendrecv",Td.log("Setting audio transceiver to sendrecv:",o)}catch(A){Td.error(A)}}else if(d&&!I)try{o&&(o.setDirection?o.setDirection("sendonly"):o.direction="sendonly",Td.log("Setting audio transceiver to sendonly:",o))}catch(A){Td.error(A)}else if(!d&&I)if(o)try{o.setDirection?o.setDirection("recvonly"):o.direction="recvonly",Td.log("Setting audio transceiver to recvonly:",o)}catch(A){Td.error(A)}else o=n.pc.addTransceiver("audio",{direction:"recvonly"}),Td.log("Adding recvonly audio transceiver:",o)}else if(e.removeAudio&&o)try{o.setDirection?o.setDirection("inactive"):o.direction="inactive",Td.log("Setting audio transceiver to inactive:",o)}catch(A){Td.error(A)}var C=j(e),h=W(e);if(C||h){if(C&&h){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Td.log("Setting video transceiver to sendrecv:",s)}catch(A){Td.error(A)}}else if(C&&!h){if(s)try{s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Td.log("Setting video transceiver to sendonly:",s)}catch(A){Td.error(A)}}else if(!C&&h)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Td.log("Setting video transceiver to recvonly:",s)}catch(A){Td.error(A)}else s=n.pc.addTransceiver("video",{direction:"recvonly"}),Td.log("Adding recvonly video transceiver:",s)}else if(e.removeVideo&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",Td.log("Setting video transceiver to inactive:",s)}catch(A){Td.error(A)}}else r="firefox"==Td.webRTCAdapter.browserDetails.browser||"edge"==Td.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:O(e),offerToReceiveVideo:W(e)}:{mandatory:{OfferToReceiveAudio:O(e),OfferToReceiveVideo:W(e)}};Td.debug(r);var u=j(e);if(u&&a&&"firefox"===Td.webRTCAdapter.browserDetails.browser){Td.log("Enabling Simulcasting for Firefox (RID)");var B=n.pc.getSenders()[1];Td.log(B);var f=B.getParameters();Td.log(f);var Q=E(t.simulcastMaxBitrates);B.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:Q.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:Q.medium},{rid:"low",active:!0,priority:"low",maxBitrate:Q.low}]})}n.pc.createAnswer(r).then((function(A){Td.debug(A);var e={type:A.type,sdp:A.sdp};t.customizeSdp(e),A.sdp=e.sdp,Td.log("Setting local description"),u&&a&&("chrome"===Td.webRTCAdapter.browserDetails.browser?Td.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==Td.webRTCAdapter.browserDetails.browser&&Td.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),n.mySdp=A.sdp,n.pc.setLocalDescription(A).catch(t.error),n.mediaConstraints=r,n.iceDone||n.trickle?t.success(A):Td.log("Waiting for all candidates...")}),t.error)}(A,t,i)}),i.error),[2]}}))})),T.apply(this,arguments)}function M(A,e,t){(t=t||{}).success="function"==typeof t.success?t.success:Td.noop,t.error="function"==typeof t.error?t.error:H,t.customizeStream="function"==typeof t.customizeStream?t.customizeStream:Td.noop;var i=t.jsep;if(e&&i)return Td.error("Provided a JSEP to a createOffer"),void t.error("Provided a JSEP to a createOffer");if(!(e||i&&i.type&&i.sdp))return Td.error("A valid JSEP is required for createAnswer"),void t.error("A valid JSEP is required for createAnswer");t.media=t.media||{audio:!0,video:!0};var n=t.media,a=x[A];if(null==a||null===a.webrtcStuff||void 0===a.webrtcStuff)return Td.warn("Invalid handle"),void t.error("Invalid handle");var r,o=a.webrtcStuff;if(o.trickle=(r=t.trickle,Td.debug("isTrickleEnabled:",r),null==r||!0===r),void 0===o.pc||null===o.pc)n.update=!1,n.keepAudio=!1,n.keepVideo=!1;else if(void 0!==o.pc&&null!==o.pc){if(Td.log("Updating existing media session"),n.update=!0,null!==t.stream&&void 0!==t.stream)t.stream!==o.myStream&&Td.log("Renegotiation involves a new external stream");else{if(n.addAudio){if(n.keepAudio=!1,n.replaceAudio=!1,n.removeAudio=!1,n.audioSend=!0,o.myStream&&o.myStream.getAudioTracks()&&o.myStream.getAudioTracks().length)return Td.error("Can't add audio stream, there already is one"),void t.error("Can't add audio stream, there already is one")}else n.removeAudio?(n.keepAudio=!1,n.replaceAudio=!1,n.addAudio=!1,n.audioSend=!1):n.replaceAudio&&(n.keepAudio=!1,n.addAudio=!1,n.removeAudio=!1,n.audioSend=!0);if(null===o.myStream||void 0===o.myStream?(n.replaceAudio&&(n.keepAudio=!1,n.replaceAudio=!1,n.addAudio=!0,n.audioSend=!0),V(n)&&(n.keepAudio=!1,n.addAudio=!0)):null===o.myStream.getAudioTracks()||void 0===o.myStream.getAudioTracks()||0===o.myStream.getAudioTracks().length?(n.replaceAudio&&(n.keepAudio=!1,n.replaceAudio=!1,n.addAudio=!0,n.audioSend=!0),V(n)&&(n.keepVideo=!1,n.addAudio=!0)):!V(n)||n.removeAudio||n.replaceAudio||(n.keepAudio=!0),n.addVideo){if(n.keepVideo=!1,n.replaceVideo=!1,n.removeVideo=!1,n.videoSend=!0,o.myStream&&o.myStream.getVideoTracks()&&o.myStream.getVideoTracks().length)return Td.error("Can't add video stream, there already is one"),void t.error("Can't add video stream, there already is one")}else n.removeVideo?(n.keepVideo=!1,n.replaceVideo=!1,n.addVideo=!1,n.videoSend=!1):n.replaceVideo&&(n.keepVideo=!1,n.addVideo=!1,n.removeVideo=!1,n.videoSend=!0);null===o.myStream||void 0===o.myStream||null===o.myStream.getVideoTracks()||void 0===o.myStream.getVideoTracks()||0===o.myStream.getVideoTracks().length?(n.replaceVideo&&(n.keepVideo=!1,n.replaceVideo=!1,n.addVideo=!0,n.videoSend=!0),j(n)&&(n.keepVideo=!1,n.addVideo=!0)):!j(n)||n.removeVideo||n.replaceVideo||(n.keepVideo=!0),n.addData&&(n.data=!0)}if(V(n)&&n.keepAudio&&j(n)&&n.keepVideo)return a.consentDialog(!1),void N(A,i,n,t,o.myStream)}if(n.update&&!o.streamExternal){if(n.removeAudio||n.replaceAudio){if(o.myStream&&o.myStream.getAudioTracks()&&o.myStream.getAudioTracks().length){var s=o.myStream.getAudioTracks()[0];Td.log("Removing audio track:",s),o.myStream.removeTrack(s);try{s.stop()}catch(A){}}if(o.pc.getSenders()&&o.pc.getSenders().length){var g=!0;if(n.replaceAudio&&Td.unifiedPlan&&(g=!1),g)for(var l in o.pc.getSenders()){(s=o.pc.getSenders()[l])&&s.track&&"audio"===s.track.kind&&(Td.log("Removing audio sender:",s),o.pc.removeTrack(s))}}}if(n.removeVideo||n.replaceVideo){if(o.myStream&&o.myStream.getVideoTracks()&&o.myStream.getVideoTracks().length){s=o.myStream.getVideoTracks()[0];Td.log("Removing video track:",s),o.myStream.removeTrack(s);try{s.stop()}catch(A){}}if(o.pc.getSenders()&&o.pc.getSenders().length){var c=!0;if(n.replaceVideo&&Td.unifiedPlan&&(c=!1),c)for(var l in o.pc.getSenders()){(s=o.pc.getSenders()[l])&&s.track&&"video"===s.track.kind&&(Td.log("Removing video sender:",s),o.pc.removeTrack(s))}}}}if(null!==t.stream&&void 0!==t.stream){var d=t.stream;if(Td.log("MediaStream provided by the application"),Td.debug(d),n.update&&o.myStream&&o.myStream!==t.stream&&!o.streamExternal){try{var I=o.myStream.getTracks();for(var C in I){var h=I[C];Td.log(h),null!=h&&h.stop()}}catch(A){}o.myStream=null}return o.streamExternal=!0,a.consentDialog(!1),void N(A,i,n,t,d)}if(V(n)||j(n)){if(!Td.isGetUserMediaAvailable())return void t.error("getUserMedia not available");var u={mandatory:{},optional:[]};a.consentDialog(!0);var B=V(n);!0===B&&null!=n&&null!=n&&"object"===kd(n.audio)&&(B=n.audio);var E=j(n);if(!0===E&&null!=n&&null!=n){var f=!0===t.simulcast,Q=!0===t.simulcast2;if(!f&&!Q||i||void 0!==n.video&&!1!==n.video||(n.video="hires"),n.video&&"screen"!=n.video&&"window"!=n.video)if("object"===kd(n.video))E=n.video;else{var p=0,m=0;"lowres"===n.video?(m=240,p=320):"lowres-16:9"===n.video?(m=180,p=320):"hires"===n.video||"hires-16:9"===n.video||"hdres"===n.video?(m=720,p=1280):"fhdres"===n.video?(m=1080,p=1920):"4kres"===n.video?(m=2160,p=3840):"stdres"===n.video?(m=480,p=640):"stdres-16:9"===n.video?(m=360,p=640):(Td.log("Default video setting is stdres 4:3"),m=480,p=640),Td.log("Adding media constraint:",n.video),E={height:{ideal:m},width:{ideal:p}},Td.log("Adding video constraint:",E)}else if("screen"===n.video||"window"===n.video){var y=function(e,r){a.consentDialog(!1),e?t.error(e):N(A,i,n,t,r)},_=function(A,e,t){Td.log("Adding media constraint (screen capture)"),Td.debug(A),navigator.mediaDevices.getUserMedia(A).then((function(A){t?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){A.addTrack(t.getAudioTracks()[0]),e(null,A)})):e(null,A)})).catch((function(A){a.consentDialog(!1),e(A)}))};if(n.screenshareFrameRate||(n.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(e){a.consentDialog(!1),V(n)&&!n.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(a){e.addTrack(a.getAudioTracks()[0]),N(A,i,n,t,e)})):N(A,i,n,t,e)}),(function(A){a.consentDialog(!1),t.error(A)}));if("chrome"===Td.webRTCAdapter.browserDetails.browser){var S=Td.webRTCAdapter.browserDetails.version,D=33;window.navigator.userAgent.match("Linux")&&(D=35),S>=26&&S<=D?(u={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:n.screenshareFrameRate,maxFrameRate:n.screenshareFrameRate,chromeMediaSource:"screen"}},audio:V(n)&&!n.keepAudio},_(u,y)):Td.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,_(u,y,V(n)&&!n.keepAudio)}))}else if("firefox"===Td.webRTCAdapter.browserDetails.browser){if(!(Td.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:V(n)&&!n.keepAudio},_(u,(function(A,e){if(y(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 r=e.some((function(A){return"audioinput"===A.kind})),o=function(A){if(Td.debug("isScreenSendEnabled:",A),null==A)return!1;if("object"!==kd(A.video)||"object"!==kd(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=V(n),g=j(n),l=function(A){return Td.debug("isAudioSendRequired:",A),null!=A&&(!1!==A.audio&&!1!==A.audioSend&&(void 0!==A.failIfNoAudio&&null!==A.failIfNoAudio&&!0===A.failIfNoAudio))}(n),c=function(A){return Td.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||l||c){var I=!!s&&r,C=!!g&&o;if(!I&&!C)return a.consentDialog(!1),t.error("No capture device found"),!1;if(!I&&l)return a.consentDialog(!1),t.error("Audio capture is required, but no capture device found"),!1;if(!C&&c)return a.consentDialog(!1),t.error("Video capture is required, but no capture device found"),!1}var h={audio:!(!r||n.keepAudio)&&B,video:!(!o||n.keepVideo)&&E};Td.debug("getUserMedia constraints",h),h.audio||h.video?navigator.mediaDevices.getUserMedia(h).then((function(e){a.consentDialog(!1),N(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),N(A,i,n,t,d))})).catch((function(A){a.consentDialog(!1),t.error("enumerateDevices error",A)}))}else N(A,i,n,t)}function L(A,e){(e=e||{}).success="function"==typeof e.success?e.success:Td.noop,e.error="function"==typeof e.error?e.error:H;var t=e.jsep,i=x[A];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Td.warn("Invalid handle"),void e.error("Invalid handle");var n=i.webrtcStuff;if(null!=t){if(null===n.pc)return Td.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(Td.log("Remote description accepted!"),n.remoteSdp=t.sdp,n.candidates&&n.candidates.length>0){for(var 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"==Td.webRTCAdapter.browserDetails.browser&&(i/=1e3);var n=Math.round(8*(t.bitrate.bsnow-t.bitrate.bsbefore)/i);"safari"===Td.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:(Td.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function H(A){Td.error("WebRTC error:",A)}function K(A,i){Td.log("Cleaning WebRTC stuff");var n=x[A];if(null!=n){var a=n.webrtcStuff;if(null!=a){if(!0===i){var r={rtcgw:"hangup",transaction:Td.randomString(12)};null!==n.token&&void 0!==n.token&&(r.token=n.token),null!=h&&(r.apisecret=h),Td.debug("Sending hangup request (handle="+A+"):"),Td.debug(r),e?(r.session_id=Q,r.handle_id=A,t.send(JSON.stringify(r))):Td.httpAPICall(o+"/"+Q+"/"+A,{verb:"POST",withCredentials:d,body:r})}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){Td.log("Stopping local stream tracks");var s=a.myStream.getTracks();for(var g in s){var l=s[g];Td.log(l),null!=l&&l.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 V(A){return Td.debug("isAudioSendEnabled:",A),null==A||!1!==A.audio&&(void 0===A.audioSend||null===A.audioSend||!0===A.audioSend)}function O(A){return Td.debug("isAudioRecvEnabled:",A),null==A||!1!==A.audio&&(void 0===A.audioRecv||null===A.audioRecv||!0===A.audioRecv)}function j(A){return Td.debug("isVideoSendEnabled:",A),null==A||!1!==A.video&&(void 0===A.videoSend||null===A.videoSend||!0===A.videoSend)}function W(A){return Td.debug("isVideoRecvEnabled:",A),null==A||!1!==A.video&&(void 0===A.videoRecv||null===A.videoRecv||!0===A.videoRecv)}v(A),this.getServer=function(){return o},this.isConnected=function(){return f},this.reconnect=function(A){(A=A||{}).success="function"==typeof A.success?A.success:Td.noop,A.error="function"==typeof A.error?A.error:Td.noop,A.reconnect=!0,v(A)},this.getSessionId=function(){return Q},this.destroy=function(a){!function(a){a=a||{},a.success="function"==typeof a.success?a.success:Td.noop;var r=!0;void 0!==a.asyncRequest&&null!==a.asyncRequest&&(r=!0===a.asyncRequest);var s=!0;void 0!==a.notifyDestroyed&&null!==a.notifyDestroyed&&(s=!0===a.notifyDestroyed);var g=!1;void 0!==a.cleanupHandles&&null!==a.cleanupHandles&&(g=!0===a.cleanupHandles);if(Td.log("Destroying session "+Q+" (async="+r+")"),!f)return Td.warn("Is the server down? (connected=false)"),void a.success();if(null==Q)return Td.warn("No session to destroy"),a.success(),void(s&&A.destroyed());if(g)for(var l in x)P(l,{noRequest:!0});var c={rtcgw:"destroy",transaction:Td.randomString(12)};null!=C&&(c.token=C);null!=h&&(c.apisecret=h);if(e){c.session_id=Q;var I=function(){for(var A in i)t.removeEventListener(A,i[A]);t.removeEventListener("message",u),t.removeEventListener("error",B),n&&clearTimeout(n),t.close()},u=function(e){var t=JSON.parse(e.data);t.session_id==c.session_id&&t.transaction==c.transaction&&(I(),a.success(),s&&A.destroyed())},B=function(e){I(),a.error("Failed to destroy the server: Is the server down?"),s&&A.destroyed()};return t.addEventListener("message",u),t.addEventListener("error",B),void t.send(JSON.stringify(c))}Td.httpAPICall(o+"/"+Q,{verb:"POST",async:r,withCredentials:d,body:c,success:function(e){Td.log("Destroyed session:"),Td.debug(e),Q=null,f=!1,"success"!==e.rtcgw&&Td.error("Ooops: "+e.error.code+" "+e.error.reason),a.success(),s&&A.destroyed()},error:function(e,t){Td.error(e+":",t),Q=null,f=!1,a.success(),s&&A.destroyed()}})}(a)},this.attach=function(A){!function(A){if(A=A||{},A.success="function"==typeof A.success?A.success:Td.noop,A.error="function"==typeof A.error?A.error:Td.noop,A.consentDialog="function"==typeof A.consentDialog?A.consentDialog:Td.noop,A.iceState="function"==typeof A.iceState?A.iceState:Td.noop,A.mediaState="function"==typeof A.mediaState?A.mediaState:Td.noop,A.webrtcState="function"==typeof A.webrtcState?A.webrtcState:Td.noop,A.slowLink="function"==typeof A.slowLink?A.slowLink:Td.noop,A.onmessage="function"==typeof A.onmessage?A.onmessage:Td.noop,A.onlocalstream="function"==typeof A.onlocalstream?A.onlocalstream:Td.noop,A.onremotestream="function"==typeof A.onremotestream?A.onremotestream:Td.noop,A.ondata="function"==typeof A.ondata?A.ondata:Td.noop,A.ondataopen="function"==typeof A.ondataopen?A.ondataopen:Td.noop,A.oncleanup="function"==typeof A.oncleanup?A.oncleanup:Td.noop,A.ondetached="function"==typeof A.ondetached?A.ondetached:Td.noop,!f)return Td.warn("Is the server down? (connected=false)"),void A.error("Is the server down? (connected=false)");var i=A.plugin;if(null==i)return Td.error("Invalid plugin"),void A.error("Invalid plugin");var n=A.opaqueId,a=A.token?A.token:C,r=Td.randomString(12),s={rtcgw:"attach",plugin:i,opaque_id:n,transaction:r};null!=a&&(s.token=a);null!=h&&(s.apisecret=h);if(e)return y[r]=function(e){if(Td.debug(e),"success"!==e.rtcgw)return Td.error("Ooops: "+e.error.code+" "+e.error.reason),void A.error("Ooops: "+e.error.code+" "+e.error.reason);var t=e.data.id;Td.log("Created handle: "+t);var n={session:p,plugin:i,id:t,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 t},getPlugin:function(){return i},getVolume:function(){return G(t,!0)},getRemoteVolume:function(){return G(t,!0)},getLocalVolume:function(){return G(t,!1)},isAudioMuted:function(){return Y(t,!1)},muteAudio:function(){return U(t,!1,!0)},unmuteAudio:function(){return U(t,!1,!1)},isVideoMuted:function(){return Y(t,!0)},muteVideo:function(){return U(t,!0,!0)},unmuteVideo:function(){return U(t,!0,!1)},getBitrate:function(){return J(t)},send:function(A){w(t,A)},data:function(A){R(t,A)},dtmf:function(A){k(t,A)},consentDialog:A.consentDialog,iceState:A.iceState,mediaState:A.mediaState,webrtcState:A.webrtcState,slowLink:A.slowLink,onmessage:A.onmessage,createOffer:function(A){M(t,!0,A)},createAnswer:function(A){M(t,!1,A)},handleRemoteJsep:function(A){L(t,A)},onlocalstream:A.onlocalstream,onremotestream:A.onremotestream,ondata:A.ondata,ondataopen:A.ondataopen,oncleanup:A.oncleanup,ondetached:A.ondetached,hangup:function(A){K(t,!0===A)},detach:function(A){P(t,A)}};x[t]=n,A.success(n)},s.session_id=Q,void t.send(JSON.stringify(s));Td.httpAPICall(o+"/"+Q,{verb:"POST",withCredentials:d,body:s,success:function(e){if(Td.debug(e),"success"!==e.rtcgw)return Td.error("Ooops: "+e.error.code+" "+e.error.reason),void A.error("Ooops: "+e.error.code+" "+e.error.reason);var t=e.data.id;Td.log("Created handle: "+t);var n={session:p,plugin:i,id:t,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 t},getPlugin:function(){return i},getVolume:function(){return G(t,!0)},getRemoteVolume:function(){return G(t,!0)},getLocalVolume:function(){return G(t,!1)},isAudioMuted:function(){return Y(t,!1)},muteAudio:function(){return U(t,!1,!0)},unmuteAudio:function(){return U(t,!1,!1)},isVideoMuted:function(){return Y(t,!0)},muteVideo:function(){return U(t,!0,!0)},unmuteVideo:function(){return U(t,!0,!1)},getBitrate:function(){return J(t)},send:function(A){w(t,A)},data:function(A){R(t,A)},dtmf:function(A){k(t,A)},consentDialog:A.consentDialog,iceState:A.iceState,mediaState:A.mediaState,webrtcState:A.webrtcState,slowLink:A.slowLink,onmessage:A.onmessage,createOffer:function(A){M(t,!0,A)},createAnswer:function(A){M(t,!1,A)},handleRemoteJsep:function(A){L(t,A)},onlocalstream:A.onlocalstream,onremotestream:A.onremotestream,ondata:A.ondata,ondataopen:A.ondataopen,oncleanup:A.oncleanup,ondetached:A.ondetached,hangup:function(A){K(t,!0===A)},detach:function(A){P(t,A)}};x[t]=n,A.success(n)},error:function(A,e){Td.error(A+":",e)}})}(A)}}Td.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||Nd,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 r=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,r])}return a.then((function(A){return A.ok?kd(i.success)===kd(Td.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){kd(i.error)===kd(Td.noop)&&i.error(A.message||"<< internal error >>",A)})),a}}},Td.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||Nd,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){kd(t.success)===kd(Td.noop)&&t.success(A)},error:function(A,e,i){kd(t.error)===kd(Td.noop)&&t.error(e,i)}}))}}},Td.noop=function(){},Td.dataChanDefaultLabel="JanusDataChannel",Td.endOfCandidates=null,Td.init=function(A){if((A=A||{}).callback="function"==typeof A.callback?A.callback:Td.noop,!0===Td.initDone)A.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),Td.trace=Td.noop,Td.debug=Td.noop,Td.vdebug=Td.noop,Td.log=Td.noop,Td.warn=Td.noop,Td.error=Td.noop,!0===A.debug||"all"===A.debug)Td.trace=console.trace.bind(console)||Td.noop,Td.debug=console.debug.bind(console)||Td.noop,Td.vdebug=console.debug.bind(console)||Td.noop,Td.log=console.log.bind(console)||Td.noop,Td.warn=console.warn.bind(console)||Td.noop,Td.error=console.error.bind(console)||Td.noop;else if(Array.isArray(A.debug))for(var e in A.debug){switch(A.debug[e]){case"trace":Td.trace=console.trace.bind(console)||Td.noop;break;case"debug":Td.debug=console.debug.bind(console)||Td.noop;break;case"vdebug":Td.vdebug=console.debug.bind(console)||Td.noop;break;case"log":Td.log=console.log.bind(console)||Td.noop;break;case"warn":Td.warn=console.warn.bind(console)||Td.noop;break;case"error":Td.error=console.error.bind(console)||Td.noop}}var t=A.dependencies||Td.useDefaultDependencies();Td.isArray=t.isArray,Td.webRTCAdapter=t.webRTCAdapter,Td.httpAPICall=t.httpAPICall,Td.newWebSocket=t.newWebSocket,Td.extension=t.extension,Td.extension.init(),Td.listDevices=function(A,e){A="function"==typeof A?A:Td.noop,null==e&&(e={audio:!0,video:!0}),Td.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(e).then((function(e){navigator.mediaDevices.enumerateDevices().then((function(t){Td.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){Td.error(e),A([])})):(Td.warn("navigator.mediaDevices unavailable"),A([]))},Td.attachMediaStream=function(A,e){"chrome"===Td.webRTCAdapter.browserDetails.browser?Td.webRTCAdapter.browserDetails.version>=52?A.srcObject=e:Td.error("Error attaching stream to element"):A.srcObject=e},Td.reattachMediaStream=function(A,e){"chrome"===Td.webRTCAdapter.browserDetails.browser?Td.webRTCAdapter.browserDetails.version>=52?A.srcObject=e.srcObject:void 0!==A.src?A.src=e.src:Td.error("Error reattaching stream to element"):A.srcObject=e.srcObject};var i=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",n=window["on"+i];if(window.addEventListener(i,(function(A){for(var e in Td.log("Closing window"),Td.sessions)null!==Td.sessions[e]&&void 0!==Td.sessions[e]&&Td.sessions[e].destroyOnUnload&&(Td.log("Destroying session "+e),Td.sessions[e].destroy({asyncRequest:!1,notifyDestroyed:!1}));n&&"function"==typeof n&&n()})),Td.safariVp8=!1,"safari"===Td.webRTCAdapter.browserDetails.browser&&Td.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 a=RTCRtpSender.getCapabilities("video").codecs[e];if(a&&a.mimeType&&"video/vp8"===a.mimeType.toLowerCase()){Td.safariVp8=!0;break}}Td.safariVp8?Td.log("This version of Safari supports VP8"):Td.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){Td.safariVp8=-1!==A.sdp.indexOf("VP8"),Td.safariVp8?Td.log("This version of Safari supports VP8"):Td.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(Td.unifiedPlan=!1,"firefox"===Td.webRTCAdapter.browserDetails.browser&&Td.webRTCAdapter.browserDetails.version>=59)Td.unifiedPlan=!0;else if("chrome"===Td.webRTCAdapter.browserDetails.browser&&Td.webRTCAdapter.browserDetails.version<72)Td.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){var o=new RTCPeerConnection;try{o.addTransceiver("audio"),Td.unifiedPlan=!0}catch(A){}o.close()}else Td.unifiedPlan=!1;Td.initDone=!0,A.callback()}},Td.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},Td.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},Td.randomString=function(A){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",i=0;i-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 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){}))})).catch((function(A){}))},e.stopTalk=function(){var A=this;try{window.stopTalk()}catch(A){var e,t,i,n;null==(t=this.jSPlugin)||null==(e=t.logger)||e.error(Yd,"[errors]","stopTalk error:",A),null==(n=this.jSPlugin)||null==(i=n.eventEmitter)||i.emit(Eg.stopTalk,{eventType:Eg.stopTalk,code:-1,msg:"结束对讲"})}this.gainNode=null,this.volumeChangeInterval&&(clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null),this.jSPlugin.eventEmitter&&setTimeout((function(){var e;null==(e=A.jSPlugin.eventEmitter)||e.emit(Eg.volumeChange,{eventType:Eg.volumeChange,code:0,target:A,data:0,msg:"音量变化"})}),200);var a,r=document.getElementById("myaudio");r&&r.srcObject&&(r.srcObject.getTracks()[0].stop(),null==(a=this.jSPlugin.eventEmitter)||a.emit(Eg.stopTalk,{eventType:Eg.stopTalk,code:0,target:this,msg:"结束对讲"}))},e.changeTalkChannelNo=function(A){window.EZUIKit.opt&&window.EZUIKit.opt.channelNo&&(this.talkChannelNo=A,window.EZUIKit.opt.channelNo=A)},e._customizeStream=function(A){var e=this;return new Promise((function(t,i){var n=new window.AudioContext;e.gainNode=n.createGain();var a,r=n.createMediaStreamSource(A);e.gainNode.gain.value=null!=(a=e.volumeGain)?a:1;var o=n.createMediaStreamDestination();r.connect(e.gainNode),e.gainNode.connect(o),t(o.stream)}))},e.setVolumeGain=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}},e.observeVolumeChange=function(A){var e=this;void 0===A&&(A={});var t=A.interval,i=void 0===t?100:t;this.volumeChangeInterval&&(clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null),this.volumeChangeInterval=setInterval((function(){var A,t,i,n,a;null==(a=window.tts)||null==(n=a.webrtcStuff)||null==(i=n.pc)||null==(t=i.getStats)||null==(A=t.call(i))||A.then((function(A){A.forEach((function(A){var t,i;"media-source"===A.type&&(null==(i=e.jSPlugin)||null==(t=i.eventEmitter)||t.emit("volumeChange",{eventType:"volumeChange",code:0,target:e,data:A.audioLevel,msg:"音量变化"}))}))}))}),i)},e.getMicrophonePermission=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})}))}))},e.getMicrophonesList=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})}))},e.setProfile=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)))},A}(),Jd=function(){function A(e){var t,i,n=this;this.jSPlugin=e,this.pluginStatus=new sg(this,this.jSPlugin.id),null==(i=this.jSPlugin)||null==(t=i.logger)||t.log("[MobilePtz] init"),A._instanceStyle();var a=document.createElement("div");a.className="mobile-ez-ptz-container",a.id="mobile-ez-ptz-container";var r=window.innerHeight;a.style="display:inline-block;width: "+this.jSPlugin.width+"px;text-align:center;height: "+(r-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")||a.appendChild(o);var s=document.createElement("div");s.className="live-ptz-intro",s.id="live-ptz-intro",s.innerHTML=this.jSPlugin.i18n.t("MOBILE_PTZ_TIPS"),document.getElementById("live-ptz-intro")||a.appendChild(s);var l=document.createElement("div");l.id="mobile-ez-ptz-item",l.className="mobile-ez-ptz-wrap",l.innerHTML='\n
\n
\n
\n
\n
\n
\n
\n ',document.getElementById("mobile-ez-ptz-item")||a.appendChild(l),g(a,document.getElementById(this.jSPlugin.id+"-wrap")),document.getElementById("mobile-ez-ptz-item").ontouchstart=function(A){A.preventDefault(),n._handlePtzTouch(A,"start")},document.getElementById("mobile-ez-ptz-item").ontouchend=function(A){A.preventDefault(),n._handlePtzTouch(A,"stop")},document.getElementById("mobile-ez-ptz-item").onmousedown=function(A){A.preventDefault(),n._handlePtzTouch(A,"start")},document.getElementById("mobile-ez-ptz-item").onmouseup=function(A){A.preventDefault(),n._handlePtzTouch(A,"stop")}}var e=A.prototype;return e.show=function(){document.getElementById("mobile-ez-ptz-container").style="display: inline-block"},e.hide=function(){document.getElementById("mobile-ez-ptz-container").style="display: none"},e._handlePtzTouch=function(A,e){var t,i,n=this,a=document.getElementById("mobile-ez-ptz-item").getBoundingClientRect(),r=a.left+130,o=a.top+130,s=(A.x||A.changedTouches[0].clientX)-r,g=(A.y||A.changedTouches[0].clientY)-o,l=0,d=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",I=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;Math.abs(s)>Math.abs(g)?s>0?(l=3,document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("default","active")):(l=2,document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("default","active")):g>0?(l=1,document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("default","active")):(l=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("+(0===l?180:1===l?0:2===l?90:270)+"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)","stop"===e&&(d=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",I=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")),null==(i=this.jSPlugin)||null==(t=i.eventEmitter)||t.emit(Eg.ptz.ptzDirection,{type:e,direction:l,isRotate:!1,ptzSpeed:1});var C=new FormData;C.append("deviceSerial",c(this.jSPlugin.url).deviceSerial),C.append("channelNo",c(this.jSPlugin.url).channelNo),C.append("speed",1),C.append("direction",l),C.append("accessToken",I),fetch(d,{method:"POST",body:C}).then((function(A){return A.json()})).then((function(A){if(200==A.code);else{var e,t;null==(t=n.jSPlugin)||null==(e=t.logger)||e.error("[errors]",n.jSPlugin.i18n.t("38"+A.code)+"("+A.code+")");var i=n.jSPlugin.i18n.t("38"+A.code)||A.msg;n.pluginStatus.loadingSetText({text:i,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("+(0===l?180:1===l?0:2===l?90:270)+"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)")}})).catch((function(A){}))},A._instanceStyle=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))},A}(),Hd={header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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"}]}},Kd={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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}]}}},Vd={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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}]}}},Od={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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}]}}},jd={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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}]}}},Wd={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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}]}}},Zd={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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}]}}},Xd={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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}]}}},qd={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",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}]}}},zd=[{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:Od.data.header,footer:Od.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:jd.data.header,footer:jd.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:Zd.data.header,footer:Zd.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:Wd.data.header,footer:Wd.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:Xd.data.header,footer:Xd.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:Kd.data.header,footer:Kd.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:Vd.data.header,footer:Vd.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:qd.data.header,footer:qd.data.footer}]; /* * ZoomControl v0.0.1 * zoom * Copyright (c) 2025-04-16 Ezviz-OpenBiz * Released under the MIT License. */ const $d={initialZoom:1,defaultCursor:"auto",scrollVelocity:.1,animDuration:.25,defaultPos:[0,0],allowZoom:!0,allowMove:!0,allowPan:!0,onZoomChange:()=>{},onPanChange:(A,e)=>{},maxZoom:8,minZoom:1,zoomStep:.1,allowTouchEvents:!1,allowWheel:!0,ignoredMouseButtons:[],doubleTouchMaxDelay:300,decelerationDuration:750};let AI=class{constructor(A,e){var t=this;this.destroy=()=>{this.removeEventListeners()},this.setTransform=A=>{this.transform=A},this.getTransform=()=>this.transform,this.updateTranslate=()=>{let A=0,e=0;A=this.percentPos[0]<0?this.percentPos[0]<-.5*(this.zoom-1)?-.5*(this.zoom-1):this.percentPos[0]:this.percentPos[0]>.5*(this.zoom-1)?.5*(this.zoom-1):this.percentPos[0],e=this.percentPos[1]<0?this.percentPos[1]<-.5*(this.zoom-1)?-.5*(this.zoom-1):this.percentPos[1]:this.percentPos[1]>.5*(this.zoom-1)?.5*(this.zoom-1):this.percentPos[1],this.percentPos=[A,e]},this.update=()=>{this.container&&(this.updateTranslate(),this.container.style.transition=`transform ease-out ${this.transition}s`,this.container.style.transform=`translate3d(${100*this.percentPos[0]}%, ${100*this.percentPos[1]}%, 0) scale(${this.zoom})`)},this.setAllowZoom=A=>{this.options.allowZoom=A},this.setZoom=(A,e)=>{this.zoom=parseFloat(A.toFixed(this.getPrecision(this.options.zoomStep))),this.update(),this.options.onZoomChange&&this.options.onZoomChange(this.zoom.toFixed(this.getPrecision(this.options.zoomStep)),e)},this.getZoom=()=>this.zoom,this.setPos=A=>{var e,t;const i=null===(e=this.container)||void 0===e?void 0:e.clientWidth,n=null===(t=this.container)||void 0===t?void 0:t.clientHeight;this.percentPos=[A[0]/i,A[1]/n],this.pos=A,this.update(),this.options.onPanChange&&this.options.onPanChange({posX:A[0],posY:A[1]})},this.setTransitionDuration=A=>{this.transition=A,this.update()},this.setCursor=A=>{this.container&&(this.cursor=A)},this.zoomIn=A=>{var e,t;let i=this.pos[0],n=this.pos[1];const a=this.zoom,r=a+A<(null!==(e=this.options.maxZoom)&&void 0!==e?e:8)?a+A:null!==(t=this.options.maxZoom)&&void 0!==t?t:8;r!==a&&(i=i*(r-1)/(a>1?a-1:a),n=n*(r-1)/(a>1?a-1:a)),this.setZoom(r),this.setPos([i,n]),this.setTransitionDuration(this.options.animDuration)},this.zoomOut=A=>{var e,t;let i=this.pos[0],n=this.pos[1];const a=this.zoom,r=a-A>(null!==(e=this.options.minZoom)&&void 0!==e?e:1)?a-A:null!==(t=this.options.minZoom)&&void 0!==t?t:1;r!==a&&(i=i*(r-1)/(a-1),n=n*(r-1)/(a-1)),this.setZoom(r),this.setPos([i,n]),this.setTransitionDuration(this.options.animDuration)},this.zoomToZone=(A,e,t,i)=>{var n,a;if(!this.container)return;let r=this.pos[0],o=this.pos[1];const s=(null===(n=this.container)||void 0===n?void 0:n.parentNode).getBoundingClientRect(),g=this.zoom,l=s.width/t,c=s.height/i,d=Math.min(l,c,null!==(a=this.options.maxZoom)&&void 0!==a?a:8),I=this.container.getBoundingClientRect(),[C,h]=[I.width/g/2,I.height/g/2],[u,B]=[A+t/2,e+i/2];r=(C-u)*d,o=(h-B)*d,this.setZoom(d),this.setPos([r,o]),this.setTransitionDuration(this.options.animDuration)},this.getNewPosition=(A,e,t)=>{const[i,n,a]=[this.zoom,this.pos[0],this.pos[1]];if(1===t||!this)return[0,0];if(t>i){const r=this.container.getBoundingClientRect(),[o,s]=[r.width/2,r.height/2],[g,l]=[A-r.left-window.pageXOffset,e-r.top-window.pageYOffset],[c,d]=[(o-g)/i,(s-l)/i],I=t-i;return[n+c*I,a+d*I]}return[n*(t-1)/(i-1),a*(t-1)/(i-1)]},this.fullZoomInOnPosition=(A,e)=>{var t;const i=null!==(t=this.options.maxZoom)&&void 0!==t?t:8;this.setPos(this.getNewPosition(A,e,i)),this.setZoom(null!=i?i:8),this.setTransitionDuration(this.options.animDuration)},this.getLimitedShift=(A,e,t,i,n)=>{if(A>0){if(i>e)return 0;if(i+A>e)return e-i}else if(A<0){if(nA&&e?"move":A?"ew-resize":e?"ns-resize":"auto",this.move=function(A,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t.container)return;let n,a,r=t.pos[0],o=t.pos[1];const s=t.container.getBoundingClientRect(),g=t.container.parentNode.getBoundingClientRect(),l=t.transform?e:A,c=t.transform?A:e,[d,I,C]=t.transform?[s.height>g.bottom-g.top,c>0&&s.top-g.top<0,c<0&&s.bottom-g.bottom>0]:[s.width>g.right-g.left,l>0&&s.left-g.left<0,l<0&&s.right-g.right>0];n=d||I||C,n&&(t.transform?r+=t.getLimitedShift(c,g.top,g.bottom,s.top,s.bottom):r+=t.getLimitedShift(l,g.left,g.right,s.left,s.right));const[h,u,B]=t.transform?[s.width>g.right-g.left,l>0&&s.right-g.right<0,l<0&&s.left-g.left>0]:[s.height>g.bottom-g.top,c>0&&s.top-g.top<0,c<0&&s.bottom-g.bottom>0];if(a=h||u||B,a)if(t.transform){function f(A,e,t,i,n){if(A>0){if(ne)return 0;if(i+1+A>e)return e-i}return A}o+=f(l,g.left,g.right,s.left,s.right)}else o+=t.getLimitedShift(c,g.top,g.bottom,s.top,s.bottom);const E=t.getCursor(n,a);t.setPos([r,o]),t.setCursor(E),t.setTransitionDuration(i)},this.isDoubleTapping=()=>{var A,e,t,i;const n=(new Date).getTime();return n-(null!==(A=this.lastTouchTime)&&void 0!==A?A:0)<(null!==(e=this.options.doubleTouchMaxDelay)&&void 0!==e?e:300)&&n-(null!==(t=this.lastDoubleTapTime)&&void 0!==t?t:0)>(null!==(i=this.options.doubleTouchMaxDelay)&&void 0!==i?i:750)?(this.lastDoubleTapTime=n,!0):(this.lastTouchTime=n,!1)},this.startDeceleration=(A,e)=>{let t=null;const i=n=>{var a,r,o;null===t&&(t=n);const s=n-t,g=((null!==(a=this.options.decelerationDuration)&&void 0!==a?a:750)-s)/(null!==(r=this.options.decelerationDuration)&&void 0!==r?r:750),[l,c]=[A*g,e*g];s<(null!==(o=this.options.decelerationDuration)&&void 0!==o?o:750)&&Math.max(Math.abs(l),Math.abs(c))>1?(this.move(l,c,0),this.lastRequestAnimationId=requestAnimationFrame(i)):this.lastRequestAnimationId=null};this.lastRequestAnimationId=requestAnimationFrame(i)},this.reset=()=>{this.setZoom(this.options.initialZoom,!0),this.cursor=this.options.defaultCursor,this.setTransitionDuration(this.options.animDuration),this.setPos(this.options.defaultPos)},this.handleDoubleClick=A=>{var e;A.preventDefault(),this.options.allowZoom&&(this.zoom===(null!==(e=this.options.minZoom)&&void 0!==e?e:1)?this.fullZoomInOnPosition(A.pageX,A.pageY):this.reset())},this.addScale=function(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.handleZoomAdd(A)},this.handleZoomAdd=function(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;var e;if(!t.options.allowZoom||!t.options.allowWheel)return;let i=parseFloat((t.zoom+A).toFixed(t.getPrecision(t.options.zoomStep)));i>(null!==(e=t.options.maxZoom)&&void 0!==e?e:8)&&(i=8),t.setZoom(i),t.setPos(t.pos),t.setTransitionDuration(.05)},this.subScale=function(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.handleZoomSub(A)},this.handleZoomSub=function(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;var e,i;if(!t.options.allowZoom||!t.options.allowWheel)return;let n=parseFloat((t.zoom-A).toFixed(t.getPrecision(t.options.zoomStep))),a=t.pos;n<(null!==(e=t.options.minZoom)&&void 0!==e?e:1)?(n=1,a=t.options.defaultPos):n!==t.zoom&&(a=n!==(null!==(i=t.options.minZoom)&&void 0!==i?i:1)?t.getNewPosition(t.pos[0],t.pos[1],n):t.options.defaultPos),t.setZoom(n),t.setPos(a),t.setTransitionDuration(.05)},this.handleMouseWheel=A=>{var e,t;if(A.preventDefault(),!this.options.allowZoom||!this.options.allowWheel)return;const i=A.deltaY<0?this.options.scrollVelocity:0-this.options.scrollVelocity,n=parseFloat(Math.max(Math.min(this.zoom+i,null!==(e=this.options.maxZoom)&&void 0!==e?e:8),null!==(t=this.options.minZoom)&&void 0!==t?t:1).toFixed(this.getPrecision(this.options.zoomStep)));this.setZoom(n),this.setPos(this.pos),this.setTransitionDuration(.05)},this.handleMouseStart=A=>{var e;A.preventDefault(),this.options.allowPan&&!(null===(e=this.options.ignoredMouseButtons)||void 0===e?void 0:e.includes(A.button))&&(this.lastRequestAnimationId&&cancelAnimationFrame(this.lastRequestAnimationId),this.lastCursor=[A.pageX,A.pageY])},this.handleMouseMove=A=>{if(A.preventDefault(),!this.options.allowPan||!this.lastCursor)return;const[e,t]=[A.pageX,A.pageY],i=e-this.lastCursor[0],n=t-this.lastCursor[1];this.move(i,n,0),this.lastCursor=[e,t],this.lastShift=[i,n]},this.handleMouseStop=A=>{A.preventDefault(),this.lastShift&&(this.startDeceleration(this.lastShift[0],this.lastShift[1]),this.lastShift=null),this.lastCursor=null,this.setCursor("auto")},this.getCoordinates=A=>this.transform?[A.pageY,window.innerWidth-A.pageX]:[A.pageX,A.pageY],this.handleTouchStart=A=>{const e=this.isDoubleTapping();this.isMultiTouch=A.touches.length,this.options.allowTouchEvents||A.preventDefault(),this.lastRequestAnimationId&&cancelAnimationFrame(this.lastRequestAnimationId);const[t,i]=this.getCoordinates(A.touches[0]);this.isMultiTouch>1?this.lastTouch=[t,i]:e&&this.options.allowZoom?1===this.zoom?this.fullZoomInOnPosition(t,i):this.reset():this.options.allowPan&&(this.lastTouch=[t,i])},this.handleTouchMove=A=>{var e,t,i,n;if(this.options.allowTouchEvents||A.preventDefault(),this.lastTouch)if(1===this.isMultiTouch){const[e,t]=this.getCoordinates(A.touches[0]);let i=e-this.lastTouch[0],n=t-this.lastTouch[1];this.move(i,n),this.lastShift=[i,n],this.lastTouch=[e,t],this.lastTouchDistance=null}else if(this.isMultiTouch>1){let a=this.zoom;const[r,o]=this.getCoordinates(A.touches[0]),[s,g]=this.getCoordinates(A.touches[1]),l=Math.sqrt(Math.pow(s-r,2)+Math.pow(g-o,2));if(this.lastTouchDistance&&l&&l!==this.lastTouchDistance){this.options.allowZoom&&(a+=(l-this.lastTouchDistance)/100,a>(null!==(e=this.options.maxZoom)&&void 0!==e?e:8)?a=null!==(t=this.options.maxZoom)&&void 0!==t?t:8:a<(null!==(i=this.options.minZoom)&&void 0!==i?i:1)&&(a=null!==(n=this.options.minZoom)&&void 0!==n?n:1));const[A,c]=[(r+s)/2,(o+g)/2],d=this.getNewPosition(A,c,a);this.setZoom(a),this.setPos(d),this.setTransitionDuration(0)}this.lastTouch=[r,o],this.lastTouchDistance=l}},this.handleTouchStop=()=>{this.lastShift&&(this.startDeceleration(this.lastShift[0],this.lastShift[1]),this.lastShift=null),this.lastTouch=null,this.lastTouchDistance=null,this.isMultiTouch=0},this.container=A,this.options=Object.assign({},$d,e||{}),this.pos=[0,0],this.percentPos=[0,0],this.transition=this.options.animDuration,this.zoom=1,this.cursor="auto",this.lastCursor=[0,0],this.lastShift=null,this.lastTouch=null,this.lastTouchDistance=null,this.lastRequestAnimationId=null,this.lastTouchTime=(new Date).getTime(),this.lastDoubleTapTime=(new Date).getTime(),this.transform=!1,this.isMultiTouch=1,this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseStart=this.handleMouseStart.bind(this),this.handleMouseStop=this.handleMouseStop.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchStop=this.handleTouchStop.bind(this),this.getZoom=this.getZoom.bind(this),this.setZoom=this.setZoom.bind(this),this.containerResizeObserver=new ResizeObserver((A=>{for(let e of A)this.pos=[e.contentRect.width*this.percentPos[0],e.contentRect.height*this.percentPos[1]]}))}setUpEventListeners(){const A=this.container,e=window.matchMedia("(pointer: fine)").matches;null==A||A.addEventListener("wheel",this.handleMouseWheel,{passive:!1}),this.containerResizeObserver.observe(A),e?(null==A||A.addEventListener("mousedown",this.handleMouseStart,{passive:!1}),null==A||A.addEventListener("mousemove",this.handleMouseMove,{passive:!1}),null==A||A.addEventListener("mouseup",this.handleMouseStop,{passive:!1}),null==A||A.addEventListener("mouseleave",this.handleMouseStop,{passive:!1})):(null==A||A.addEventListener("touchstart",this.handleTouchStart,{passive:!1}),null==A||A.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),null==A||A.addEventListener("touchend",this.handleTouchStop,{passive:!1}),null==A||A.addEventListener("touchcancel",this.handleTouchStop,{passive:!1}))}removeEventListeners(){const A=this.container,e=window.matchMedia("(pointer: fine)").matches;null==A||A.removeEventListener("wheel",this.handleMouseWheel),this.containerResizeObserver.unobserve(A),e?(null==A||A.removeEventListener("mousedown",this.handleMouseStart),null==A||A.removeEventListener("mousemove",this.handleMouseMove),null==A||A.removeEventListener("mouseup",this.handleMouseStop),null==A||A.removeEventListener("mouseleave",this.handleMouseStop)):(null==A||A.removeEventListener("touchstart",this.handleTouchStart),null==A||A.removeEventListener("touchmove",this.handleTouchMove),null==A||A.removeEventListener("touchend",this.handleTouchStop),null==A||A.removeEventListener("touchcancel",this.handleTouchStop))}getPrecision(){var A=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1).toString();return-1!==A.indexOf(".")?A.split(".")[1].length:1}};const eI={maxZoom:8,minZoom:1,onZoomChange:()=>{}};let tI=class{constructor(A,e){var t=this;this.setTransform=A=>{this.Zoom.setTransform(A)},this.startZoom=()=>{const A=document.getElementById(`${this.options.id}-zoom-container`);A&&(A.style.display="block"),this.Zoom.setAllowZoom(!0),this.Zoom.setUpEventListeners()},this.stopZoom=()=>{const A=document.getElementById(`${this.options.id}-zoom-container`);A&&(A.style.display="none"),this.Zoom.setAllowZoom(!1),this.Zoom.reset(),this.Zoom.removeEventListeners()},this.addScale=function(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.Zoom.handleZoomAdd(A)},this.subScale=function(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.Zoom.handleZoomSub(A)},this.container=A,this.options=Object.assign({},eI,e||{}),this.Zoom=new AI(this.container,Object.assign(Object.assign({},this.options),{allowZoom:!1,onZoomChange:(A,e)=>{this.renderDot(A),this.options.onZoomChange&&this.options.onZoomChange(A,e)}}));const i=document.createElement("div");i.id=`${this.options.id}-zoom-container`;const n=document.getElementById(`${this.options.id}-audioControls`);let a=48;n&&(a=n.offsetHeight);const r=this.options.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;":"";i.style.cssText=`position: absolute;\n display:none;\n left: 12px;\n bottom: ${this.options.isMobile?`${a+6}px`:"102px"};\n ${r}\n `;const o=`\n \n
1.0X
\n
\n \n \n ${this.options.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 ${this.options.i18n.t("ZOOM_SUB")}\n \n \n \n \n \n \n \n \n \n \n
\n \n `;i.innerHTML=o;const s=document.getElementById(`${this.options.id}-audioControls`);if(s){s.parentNode&&s.parentNode.appendChild(i);const A=document.getElementById(`${this.options.id}-addScale`);A&&(A.onclick=()=>{this.addScale()});const e=document.getElementById(`${this.options.id}-subScale`);e&&(e.onclick=()=>{this.subScale()})}this.startZoom=this.startZoom.bind(this),this.stopZoom=this.stopZoom.bind(this),this.addScale=this.addScale.bind(this),this.subScale=this.subScale.bind(this),this.setTransform=this.setTransform.bind(this)}renderDot(A){const e=document.getElementById(`${this.options.id}-scale-value`);e&&(e.innerHTML=`${parseFloat(A).toFixed(1)}X`);const t=document.getElementById(`${this.options.id}-line-dot`);t&&(t.style.height=(parseFloat(A)-1)/7*100+"%");const i=document.getElementById(`${this.options.id}-scale-body-line-dot`);i&&(i.style.bottom=`calc(${(parseFloat(A)-1)/7*100}% - 3px)`)}};var iI=[{videoLevel:1,streamTypeIn:2,type:"compatible"},{videoLevel:2,streamTypeIn:1,type:"compatible"}],nI={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"},aI="8.1.9",rI=function(A,e,t,i){var n=A.env.domain+"/api/service/media/template/getDetail?accessToken="+(A.accessToken||A.token.httpToken.url)+"&id="+e;A.logger.log("[https request] templateDetailApi()",n),fetch(n,{method:"GET"}).then((function(A){return A.json()})).then((function(e){try{var i,n;null==(n=A.logger)||null==(i=n.log)||i.call(n,"[https response] templateDetailApi()",JSON.stringify(e))}catch(A){}var a;(a=e).meta&&t(a)})).catch((function(A){i(A)}))},oI=function(A){var e,t,i=A.env.domain+"/api/service/device/capacity/video/quality?accessToken="+(A.accessToken||A.token.deviceToken.video)+"&deviceSerial="+A.deviceSerial+"&channelNo="+A.channelNo,n=[];return null==(t=A.logger)||null==(e=t.log)||e.call(t,"[https request] getDeviceSupportQuality()",i),fetch(i,{method:"GET",headers:{clientType:"ezuikit",sdkVersion:aI}}).then((function(A){return A.json()})).then((function(e){var t;return(e.meta&&200===e.meta.code&&e.data&&e.data.length>0?e.data:iI).map((function(A){n.push({name:nI[A.videoLevel],level:A.videoLevel,streamTypeIn:A.streamTypeIn,type:A.type})})),null==(t=A.eventEmitter)||t.emit(Eg.getVideoLevelList,n),n})).catch((function(){var e;return iI.map((function(A){n.push({name:nI[A.videoLevel],level:A.videoLevel,streamTypeIn:A.streamTypeIn,type:"compatible"})})),null==(e=A.eventEmitter)||e.emit(Eg.getVideoLevelList,n),n}))},sI=function(A,e){var t,i,n=A.env.domain+"/api/v3/device/setVideoLevel?accessToken="+(A.accessToken||A.token.deviceToken.video)+" ",a=new FormData;return a.append("videoLevel",parseInt(e)),null==(i=A.logger)||null==(t=i.log)||t.call(i,"[https request] setVideoLevel()","videoLevel",e),fetch(n,{method:"POST",headers:{accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:A.deviceSerial,localIndex:A.channelNo},body:a}).then((function(A){return A.json()})).then((function(e){var t,i;return null==A||null==(i=A.eventEmitter)||null==(t=i.emit)||t.call(i,Eg.http.setVideoLevel,e),e}))},gI=function(A,e){var t,i=new FormData;return Object.keys(e).map((function(A){i.append(A,e[A])})),null==(t=A.logger)||t.log("[https request] getStreamAddressList()",JSON.stringify(e)),fetch(A.env.domain+"/api/service/media/stream/server/info?version=2.0&protocol=4",{method:"GET",headers:{deviceSerial:e.deviceSerial,accessToken:e.accessToken,localIndex:e.localIndex}}).then((function(A){return A.json()})).then((function(e){var t;if(e.meta&&200==e.meta.code){var i=JSON.parse(localStorage.getItem("ezuikit_addressList")),n=function(e){var t=A.deviceSerial+"_"+A.channelNo,n=new Date;i[t]=[{domain:e.domain,port:e.port,expire:new Date(n.setHours(n.getHours()+12)).Format("yyyyMMddThhmmssZ")}],Array.isArray(e.backups)&&e.backups.map((function(A){i[t].push({domain:A.domain,port:A.port,expire:new Date(n.setHours(n.getHours()+12)).Format("yyyyMMddThhmmssZ")})})),localStorage.setItem("ezuikit_addressList",JSON.stringify(i))};if(e.data&&Array.isArray(i[A.deviceSerial+"_"+A.channelNo])){var a=Array.isArray(e.data.backups)?[].concat(e.data.backups):[];a.push({domain:e.data.domain,port:e.data.port}),(!function(A,e){if(A.length!==e.length)return!1;for(var t=[].concat(A).sort((function(A,e){return A.domain>e.domain?1:-1})),i=[].concat(e).sort((function(A,e){return A.domain>e.domain?1:-1})),n=0;nA.length)&&(e=A.length);for(var t=0,i=new Array(e);t=A.length?{done:!0}:{done:!1,value:A[i++]}}}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 II=function(A){var e="";return Object.keys(A).map((function(t,i){e+=t+":"+A[t]+(i0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById(this.jSPlugin.id+"-wrap").addEventListener("click",(function(){document.getElementById(A.jSPlugin.id+"-audioControls")&&(document.getElementById(A.jSPlugin.id+"-audioControls").style.opacity=1,document.getElementById(A.jSPlugin.id+"-audioControls").style.pointerEvents="all"),document.getElementById(A.jSPlugin.id+"-headControl")&&(document.getElementById(A.jSPlugin.id+"-headControl").style.opacity=1,document.getElementById(A.jSPlugin.id+"-headControl").style.pointerEvents="all"),A.startAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===c(this.jSPlugin.url).type,rec:"rec"===c(this.jSPlugin.url).type,type:c(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);Qd(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.logger.log("[Zoom]","init"),this.jSPlugin.Zoom=new tI(document.getElementById(this.jSPlugin.id+"-container-0"),cI({},this.jSPlugin,{onZoomChange:function(e,t){e<=8&&e>=1&&A.jSPlugin.eventEmitter.emit(Eg.zoom.onZoomChange,{zoom:e,reset:t}),e>=8&&!t&&A.jSPlugin.Message&&A.jSPlugin.Message.default(A.jSPlugin.i18n.t("ZOOM_ADD_MAX"),document.getElementById(""+A.jSPlugin.id)),e<=1&&!t&&A.jSPlugin.Message&&A.jSPlugin.Message.default(A.jSPlugin.i18n.t("ZOOM_SUB_MIN"),document.getElementById(""+A.jSPlugin.id))}})))},e.setDecoderState=function(A,e){var t=this;void 0===e&&(e=!0);var i=this.themeData,n=i.header,a=i.footer;Object.keys(A).map((function(i,r){var o="#FFFFFF",s="#FFFFFF";switch(-1===n.btnList.findIndex((function(A){return A.iconId===i}))?(o=a.color.replace("-diy",""),s=a.activeColor.replace("-diy","")):(o=n.color.replace("-diy",""),s=a.activeColor.replace("-diy","")),i){case"play":A[i]?document.getElementById(t.jSPlugin.id+"-play")&&(document.getElementById(t.jSPlugin.id+"-play-content").children[0].children[0].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-play-content").children[0].children[1].style="display:none",document.getElementById(t.jSPlugin.id+"-play").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-play-content").childNodes[0].children[0].style.fill=A[i]?s:o):document.getElementById(t.jSPlugin.id+"-play")&&(document.getElementById(t.jSPlugin.id+"-play-content").children[0].children[1].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-play-content").children[0].children[0].style="display:none",document.getElementById(t.jSPlugin.id+"-play").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-play-content").childNodes[0].children[1].style.fill=A[i]?s:o);break;case"sound":document.getElementById(t.jSPlugin.id+"-sound")&&(A[i]?(document.getElementById(t.jSPlugin.id+"-sound-content").children[0].children[1].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-sound-content").children[0].children[0].style="display:none",document.getElementById(t.jSPlugin.id+"-sound").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-sound-content").childNodes[0].children[1].style.fill=A[i]?s:o):(document.getElementById(t.jSPlugin.id+"-sound-content").children[0].children[0].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-sound-content").children[0].children[1].style="display:none",document.getElementById(t.jSPlugin.id+"-sound").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-sound-content").childNodes[0].children[0].style.fill=A[i]?s:o));break;case"recordvideo":document.getElementById(t.jSPlugin.id+"-recordvideo")&&(document.getElementById(t.jSPlugin.id+"-recordvideo").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-recordvideo-content").childNodes[0].style.fill=A[i]?s:o,A[i]?t.countTime("add",0):t.countTime("destroy",0));break;case"talk":document.getElementById(t.jSPlugin.id+"-talk")&&(document.getElementById(t.jSPlugin.id+"-talk").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-talk-content").childNodes[1].style.fill=A[i]?s:o);break;case"zoom":document.getElementById(t.jSPlugin.id+"-zoom")&&(document.getElementById(t.jSPlugin.id+"-zoom").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-zoom-content").childNodes[1].style.fill=A[i]?s:o);break;case"pantile":document.getElementById(t.jSPlugin.id+"-pantile")&&(document.getElementById(t.jSPlugin.id+"-pantile").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-pantile-content").childNodes[0].style.fill=A[i]?s:o);break;case"webExpend":A[i]?(document.getElementById(t.jSPlugin.id+"-webExpend")&&(document.getElementById(t.jSPlugin.id+"-webExpend-content").children[0].children[1].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-webExpend-content").children[0].children[0].style="display:none"),document.getElementById(t.jSPlugin.id+"-expend")&&(document.getElementById(t.jSPlugin.id+"-expend").className="disabled")):(document.getElementById(t.jSPlugin.id+"-webExpend")&&(document.getElementById(t.jSPlugin.id+"-webExpend-content").children[0].children[0].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-webExpend-content").children[0].children[1].style="display:none"),document.getElementById(t.jSPlugin.id+"-expend")&&(document.getElementById(t.jSPlugin.id+"-expend").className="")),document.getElementById(t.jSPlugin.id+"-webExpend")&&(document.getElementById(t.jSPlugin.id+"-webExpend").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-webExpend-content").childNodes[0].childNodes[0].style.fill=A[i]?s:o,document.getElementById(t.jSPlugin.id+"-webExpend-content").childNodes[0].childNodes[1].style.fill=A[i]?s:o);break;case"capturePicture":document.getElementById(t.jSPlugin.id+"-capturePicture")&&(document.getElementById(t.jSPlugin.id+"-capturePicture").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-capturePicture-content").childNodes[0].style.fill=A[i]?s:o);break;case"expend":A[i]?(document.getElementById(t.jSPlugin.id+"-expend")&&(document.getElementById(t.jSPlugin.id+"-expend-content").children[0].children[1].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-expend-content").children[0].children[0].style="display:none"),document.getElementById(t.jSPlugin.id+"-webExpend")&&(document.getElementById(t.jSPlugin.id+"-webExpend").className="disabled")):(document.getElementById(t.jSPlugin.id+"-expend")&&(document.getElementById(t.jSPlugin.id+"-expend-content").children[0].children[0].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-expend-content").children[0].children[1].style="display:none"),document.getElementById(t.jSPlugin.id+"-webExpend")&&(document.getElementById(t.jSPlugin.id+"-webExpend").className="")),document.getElementById(t.jSPlugin.id+"-expend")&&(document.getElementById(t.jSPlugin.id+"-expend").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-expend-content").childNodes[0].childNodes[0].style.fill=A[i]?s:o,document.getElementById(t.jSPlugin.id+"-expend-content").childNodes[0].childNodes[1].style.fill=A[i]?s:o);break;case"hd":break;case"speed":if(document.getElementById(t.jSPlugin.id+"-speed")){var g=document.getElementById(t.jSPlugin.id+"-speed-content").children[1].children[0];"not-allowed"!==g.style.cursor&&(g.style.color=A[i]?s:o,g.style.borderColor=A[i]?s:o)}document.getElementById(t.jSPlugin.id+"-select-mask")&&(t.isMobile&&A[i]?document.getElementById(t.jSPlugin.id+"-select-mask").style.display="block":document.getElementById(t.jSPlugin.id+"-select-mask").style.display="none");break;case"cloudRec":document.getElementById(t.jSPlugin.id+"-cloudRec")&&(document.getElementById(t.jSPlugin.id+"-cloudRec").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-cloudRec-content").children[0].children[0].style.fill=A[i]?s:o),document.getElementById(t.jSPlugin.id+"-rec")&&(document.getElementById(t.jSPlugin.id+"-rec").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-rec-content").children[0].children[0].style.fill=A[i]?o:s);break;case"cloudRecord":var l=document.getElementById(t.jSPlugin.id+"-cloudRecord");l&&(l.className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-cloudRecord-content").children[0].children[0].style.fill=A[i]?s:o),document.getElementById(t.jSPlugin.id+"-rec")&&(document.getElementById(t.jSPlugin.id+"-rec").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-rec-content").children[0].children[0].style.fill=A[i]?o:s);break;case"rec":document.getElementById(t.jSPlugin.id+"-cloudRec")&&(document.getElementById(t.jSPlugin.id+"-cloudRec").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-cloudRec-content").children[0].children[0].style.fill=A[i]?o:s),document.getElementById(t.jSPlugin.id+"-cloudRecord")&&(document.getElementById(t.jSPlugin.id+"-cloudRecord").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-cloudRecord-content").children[0].children[0].style.fill=A[i]?o:s),document.getElementById(t.jSPlugin.id+"-rec")&&(document.getElementById(t.jSPlugin.id+"-rec").className=A[i]?"active":"",document.getElementById(t.jSPlugin.id+"-rec-content").children[0].children[0].style.fill=A[i]?s:o)}e&&(t.decoderState.state=Object.assign(t.decoderState.state,A))}))},e.startAutoFocus=function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById(A.jSPlugin.id+"-audioControls")&&(document.getElementById(A.jSPlugin.id+"-audioControls").style.opacity=0,document.getElementById(A.jSPlugin.id+"-audioControls").style.pointerEvents="none"),document.getElementById(A.jSPlugin.id+"-headControl")&&(document.getElementById(A.jSPlugin.id+"-headControl").style.opacity=0,document.getElementById(A.jSPlugin.id+"-headControl").style.pointerEvents="none")}),1e3*e)},e.stopAutoFocus=function(){document.getElementById(this.jSPlugin.id+"-audioControls")&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.opacity=1,document.getElementById(this.jSPlugin.id+"-audioControls").style.pointerEvents="all"),document.getElementById(this.jSPlugin.id+"-headControl")&&(document.getElementById(this.jSPlugin.id+"-headControl").style.opacity=1,document.getElementById(this.jSPlugin.id+"-headControl").style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer)},e.hideFooter=function(){document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.display="none")},e.showFooter=function(){document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.display="block")},e.toString=function(){return this.coreX+"-"+this.coreY},e.renderFooter=function(A,e){var t=this.matchBtn(A),i=document.createElement("div");i.className="theme-icon-item",i.innerHTML='
'+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(this.jSPlugin.id+"-audioControls").childNodes[0].appendChild(i):document.getElementById(this.jSPlugin.id+"-audioControls").childNodes[1].appendChild(i)},e.renderHeader=function(A,e){var t=this.matchBtn(A),i=document.createElement("div");i.className="theme-icon-item",i.style="max-width:50%;",i.innerHTML=''+t.domString+"",i.onclick=function(A){t.onclick(A)},"left"===e?document.getElementById(this.jSPlugin.id+"-headControl").childNodes[0].appendChild(i):document.getElementById(this.jSPlugin.id+"-headControl").childNodes[1].appendChild(i)},e.countTime=function(A,e){void 0===e&&(e=0);var 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(this.jSPlugin.id+"-ez-iframe-footer-container")&&document.getElementById(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",r="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),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+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"))},e.setDisabled=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(t?this.jSPlugin.id+"-sound-icon":this.jSPlugin.id+"-nosound-icon")&&document.getElementById(t?this.jSPlugin.id+"-sound-icon":this.jSPlugin.id+"-nosound-icon").setAttribute("style",A?"cursor: not-allowed; color: gray; fill: gray;":"cursor: default"),null!=document.getElementById(this.jSPlugin.id+"-recordvideo-icon")&&document.getElementById(this.jSPlugin.id+"-recordvideo-icon").setAttribute("style",n),null!=document.getElementById(this.jSPlugin.id+"-capturePicture-icon")&&document.getElementById(this.jSPlugin.id+"-capturePicture-icon").setAttribute("style",n),null!=document.getElementById(this.jSPlugin.id+"-talk-icon")&&document.getElementById(this.jSPlugin.id+"-talk-icon").setAttribute("style",n),null!=document.getElementById(i?this.jSPlugin.id+"-unexpend-icon":this.jSPlugin.id+"-expend-icon")&&document.getElementById(i?this.jSPlugin.id+"-unexpend-icon":this.jSPlugin.id+"-expend-icon").setAttribute("style",n),document.getElementById(this.jSPlugin.id+"-pantile-icon")&&"none"!=document.getElementById(this.jSPlugin.id+"-pantile-icon").style.display&&document.getElementById(this.jSPlugin.id+"-pantile-icon").setAttribute("style",n);var a=document.getElementsByClassName(this.jSPlugin.id+"-select-quality-btn");if(a.length)for(var r=0;r',a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.rec,n=A.cloudRec,a=A.recordvideo,r=A.pantile,o=A.expend,s=A.talk,g=Pg.getGlobalState(),l=Pg.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.jSPlugin.pause():(e.jSPlugin.stop((function(){}),!0),s&&(e.setDecoderState({talk:!1}),document.getElementById(e.jSPlugin.id+"-volume-column")&&(document.getElementById(e.jSPlugin.id+"-volume-column").style.display="none"),e.jSPlugin.Talk.stopTalk(),g.talk&&Pg.setGlobalState({talk:!1}),l.getState().talk&&l.setState({talk:!1}))),a&&e.setDecoderState({recordvideo:!1})):(i||n?e.jSPlugin.resume().then((function(){e.setDisabled(t),e.setDecoderState({play:!t,expend:o})})):e.jSPlugin.play().then((function(){e.setDisabled(t),e.setDecoderState({play:!t,expend:o})})),e.jSPlugin.use3DZoom&&e.resetMobileZoomStatus()),e.jSPlugin.use3DZoom?(e.setDecoderState({zoom:!1}),e.allowZoom=!1):e.allowZoom=i||n,r&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1})),document.getElementById(e.jSPlugin.id+"-speedSelect")&&(document.getElementById(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(r)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.jSPlugin.downloadRecord):e.jSPlugin.startSave(""+(new Date).getTime()))};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(""+(new Date).getTime(),(function(){}),e.jSPlugin.download)};break;case"talk":if(r)break;a.title=this.jSPlugin.i18n.t("BTN_TALK"),a.id=A,a.domString='
CI?8:5)+"px; position: absolute; left: "+(this.jSPlugin.width>CI?20:13)+"px; top: "+(this.jSPlugin.width>CI?14:9)+'px; border-radius: 50%; overflow:hidden;">
',this.jSPlugin.eventEmitter.on("volumeChange",(function(A){var t=A.data;document.getElementById(e.jSPlugin.id+"-volume-column")&&(document.getElementById(e.jSPlugin.id+"-volume-column").style.height=100*t+"%")})),a.onclick=function(){var A=e.decoderState.state,t=A.talk;A.play&&(t?e.jSPlugin.stopTalk():e.jSPlugin.startTalk())};break;case"zoom":if(r)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;if(e.jSPlugin.use3DZoom){if(!i)return!1;t?e.jSPlugin.close3DZoom():e.jSPlugin.enable3DZoom()}else{if(e.zoomDisable)return!1;t?e._stopZoom():e._startZoom()}e.setDecoderState({zoom:!t})};break;case"pantile":if(r)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!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(!0);document.getElementById(e.jSPlugin.id+"-ez-iframe-footer-container")&&(document.getElementById(e.jSPlugin.id+"-ez-iframe-footer-container").style.marginTop="-32px"),document.getElementById(e.jSPlugin.id+"-select-speed")&&(document.getElementById(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;",i+="position: relative;",A.style.cssText=i}(document.getElementById(e.jSPlugin.id+"-wrap"),e.jSPlugin.width,e.jSPlugin.height),document.getElementById(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.setTransform(!t),document.getElementById(e.jSPlugin.id+"-pantile-icon")&&(document.getElementById(e.jSPlugin.id+"-pantile-icon").style.display="none"),document.getElementById(e.jSPlugin.id+"-hdSelect")&&(document.getElementById(e.jSPlugin.id+"-hdSelect").style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById(e.jSPlugin.id+"-hdSelect").style.bottom="calc(env(safe-area-inset-bottom) + 100px)",document.getElementById(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 a=e._extendHeadeTimeLinrHight(!0);l(document.getElementById(e.jSPlugin.id+"-wrap")),document.getElementById(e.jSPlugin.id+"-wrap").classList.add("ezuikit-player-wrap-mobile-fullscreen");var r=document.documentElement.clientWidth,o=document.documentElement.clientHeight;document.getElementById(""+e.jSPlugin.id)&&(document.getElementById(""+e.jSPlugin.id).style["backface-visibility"]="hidden"),document.getElementById(e.jSPlugin.id+"-select-speed")&&(document.getElementById(e.jSPlugin.id+"-select-speed").style.background="none"),e.jSPlugin.jSPlugin.JS_Resize(o,r-a,!0),e.jSPlugin.fullScreenWidth=o,e.jSPlugin.fullScreenHeight=r-a,e.jSPlugin.Zoom&&e.jSPlugin.Zoom.setTransform(!t),document.getElementById(e.jSPlugin.id+"-pantile-icon")&&(document.getElementById(e.jSPlugin.id+"-pantile-icon").style.display="block"),document.getElementById(e.jSPlugin.id+"-hdSelect")&&(document.getElementById(e.jSPlugin.id+"-hdSelect").style.bottom=0,document.getElementById(e.jSPlugin.id+"-hdSelect").style.height="100%"),e.setDecoderState({expend:!0})}else e.jSPlugin.fullscreen()};break;case"webExpend":if(r)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!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(r)break;var g=this.jSPlugin.id+"-select-quality",c=g+"-item";a.title=this.jSPlugin.i18n.t("BTN_HD"),a.id=A;var d="",I="";return this.jSPlugin.videoLevelList.findIndex((function(A){return A.level==e.jSPlugin.videoLevel}))>-1?this.jSPlugin.videoLevelList.map((function(A){d+='
  • '+e.jSPlugin.i18n.t(nI[A.level])+"
  • ",A.level==e.jSPlugin.videoLevel&&(I+=e._videoLevelIcon(e.jSPlugin.id,g,e.jSPlugin.width,CI,A))})):this.jSPlugin.videoLevelList.map((function(A,t){0===t&&(I+=e._videoLevelIcon(e.jSPlugin.id,g,e.jSPlugin.width,CI,A)),d+='
  • '+e.jSPlugin.i18n.t(nI[A.level])+"
  • "})),d+='
  • '+this.jSPlugin.i18n.t("SPEED_CANCEL")+"
  • ",I+='',a.domString='\n \n '+I+"\n ",a.onclick=function(A){var t=e.decoderState.state,i=t.expend,n=t.recordvideo,a=t.play,r=t.zoom,o=t.pantile,s=t.sound,l=t.talk;if(A.stopPropagation(),a){var c=A.target.id,d=A.target.getAttribute("data-type");if(0===c.indexOf(g)){if(e.jSPlugin.videoLevel+""!==d){if(l){var I=Pg.getGlobalState(),C=Pg.getInstance(e.jSPlugin.id);e.setDecoderState({talk:!1}),document.getElementById(e.jSPlugin.id+"-volume-column")&&(document.getElementById(e.jSPlugin.id+"-volume-column").style.display="none"),e.jSPlugin.Talk.stopTalk(),I.talk&&Pg.setGlobalState({talk:!1}),C.getState().talk&&C.setState({talk:!1})}var h=e.jSPlugin.videoLevelList.find((function(A){return A.level+""===d}));!h||h.streamTypeIn===e.jSPlugin.streamTypeIn&&h.level+""==e.jSPlugin.videoLevel+""||(e.jSPlugin.changeVideoLevel(h).then((function(A){s&&e.jSPlugin.openSound()})),r&&(e._stopZoom(),e.setDecoderState({zoom:!1})))}e.resetMobileZoomStatus(),n&&e.setDecoderState({recordvideo:!1})}e.showHD=!e.showHD,document.getElementById(e.jSPlugin.id+"-hdSelect")&&(document.getElementById(e.jSPlugin.id+"-hdSelect").style.display="none"===document.getElementById(e.jSPlugin.id+"-hdSelect").style.display?"block":"none",e.isMobile&&(document.getElementById(e.jSPlugin.id+"-select-hd-mask").style.display="none"===document.getElementById(e.jSPlugin.id+"-select-hd-mask").style.display?"block":"none"),e.themeData.autoFocus>0&&("none"===document.getElementById(e.jSPlugin.id+"-hdSelect").style.display?e.startAutoFocus():e.stopAutoFocus())),e.isMobile&&i&&e.showHD?document.getElementById(e.jSPlugin.id+"-hdSelect").className="hd speed-select mobile expend":document.getElementById(e.jSPlugin.id+"-hdSelect").className=e.isMobile?"hd speed-select mobile":"speed-select",o&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1}))}},a;case"speed":if(r)break;a.title=this.jSPlugin.i18n.t("BTN_SPEED"),a.id=A,a.domString='\n
    '+(1===this.nextRate?this.jSPlugin.i18n.t("SPEED"):(""+this.nextRate+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(e.jSPlugin.id+"-speedSelect").className=n?"speed speed-select mobile expend":"speed speed-select mobile"),e.isMobile&&(n?(document.getElementById(e.jSPlugin.id+"-speedSelect").style.bottom="constant(safe-area-inset-bottom)",document.getElementById(e.jSPlugin.id+"-speedSelect").style.bottom="env(safe-area-inset-bottom)"):(document.getElementById(e.jSPlugin.id+"-speedSelect").style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById(e.jSPlugin.id+"-speedSelect").style.bottom="calc(env(safe-area-inset-bottom) + 100px)")),e.nextRate=1,A.target.id)switch(A.target.id){case 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 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 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 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===e.jSPlugin.id+"-speed-text"?document.getElementById(e.jSPlugin.id+"-speedSelect").style.display="block":document.getElementById(e.jSPlugin.id+"-speedSelect")&&(document.getElementById(e.jSPlugin.id+"-speedSelect").style.display="none"===document.getElementById(e.jSPlugin.id+"-speedSelect").style.display?"block":"none"),e.setDecoderState({speed:!i}),e.themeData.autoFocus>0&&("none"===document.getElementById(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=""+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=""+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(Eg.recTypeChange,{eventType:"cloud",code:0,data:{type:"cloud"}}),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e._stopZoom(),e.jSPlugin.close3DZoom()),e.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){var A=s("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec(A.slice(0,4)+"-"+A.slice(4,6)+"-"+A.slice(6,8)),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(Eg.recTypeChange,{eventType:"cloudRecord",code:0,data:{type:"cloudRecord"}}),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e._stopZoom(),e.jSPlugin.close3DZoom()),e.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){e.jSPlugin._isCloudRecord&&e.changeTheme("pcRec");var A=s("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec(A.slice(0,4)+"-"+A.slice(4,6)+"-"+A.slice(6,8)),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(Eg.recTypeChange,{eventType:"local",code:0,data:{type:"local"}}),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e._stopZoom(),e.jSPlugin.close3DZoom()),e.jSPlugin.changePlayUrl({type:"rec"},(function(){e.jSPlugin._isCloudRecord&&e.changeTheme("pcRec");var A=s("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec(A.slice(0,4)+"-"+A.slice(4,6)+"-"+A.slice(6,8)),e.Rec&&e.Rec.syncTimeLine()}),!1).then((function(){A&&e.jSPlugin.openSound()}))}}return a},e._videoLevelIcon=function(A,e,t,i,n){return'\n i?48:32)+"px;line-height: "+(t>i?48:30)+'px;text-align: center;">\n '+this.jSPlugin.i18n.t(nI[n.level])+"\n \n "},e._fullScreenChangeEvent=function(){var A=this,e=document.getElementById(this.jSPlugin.id+"-wrap"),t=document.getElementById(""+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._stopZoom(),setTimeout((function(){i._startZoom(),i.jSPlugin.Zoom.currentScale=A,i.jSPlugin.Zoom.doScale(A)}),200)}}))}),100),document.getElementById(i.jSPlugin.id+"-hdSelect")&&(document.getElementById(i.jSPlugin.id+"-hdSelect").style.display="none"),document.getElementById(i.jSPlugin.id+"-speedSelect")&&(document.getElementById(i.jSPlugin.id+"-speedSelect").style.display="none"),i.isMobile&&(document.getElementById(i.jSPlugin.id+"-select-hd-mask")&&(document.getElementById(i.jSPlugin.id+"-select-hd-mask").style.display="none"),document.getElementById(i.jSPlugin.id+"-select-mask")&&(document.getElementById(i.jSPlugin.id+"-select-mask").style.display="none")),i.themeData.autoFocus>0&&i.startAutoFocus(),A.setDecoderState({speed:!1})},rg.isEnabled&&rg.on("change",this._fullscreenchange)},e.changeRecSpeed=function(A){var e,t,i=this,n=function(A){if(!document.getElementById(i.jSPlugin.id+"-speedSelect"))return!1;document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[0].className=document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[0].className.replace("active","default"),document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[1].className=document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[1].className.replace("active","default"),document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[2].className=document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[2].className.replace("active","default"),document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[3].className=document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[3].className.replace("active","default"),document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[A].className=document.getElementById(i.jSPlugin.id+"-speedSelect").childNodes[A].className.replace("default","active")},a="1";switch(A){case 1:n(2),a=this.jSPlugin.i18n.t("SPEED");break;case 2:n(1),a=""+A+this.jSPlugin.i18n.t("SPEED_RATE");break;case 4:n(0),a=""+A+this.jSPlugin.i18n.t("SPEED_RATE");break;case.5:n(3),a=""+A+this.jSPlugin.i18n.t("SPEED_RATE");break;default:n(2),a=""+A+this.jSPlugin.i18n.t("SPEED_RATE")}null==(t=this.jSPlugin)||null==(e=t.eventEmitter)||e.emit(Eg.speedChange,A),document.getElementById(this.jSPlugin.id+"-speed-text")&&(document.getElementById(this.jSPlugin.id+"-speed-text").innerHTML=a)},e.initThemeData=function(){var A=this,e=this.themeData,t=e.header,i=e.footer,n=this.jSPlugin.id;if(this.header=md,this.footer=yd,this.isNeedRenderHeader=Qd(t.btnList,(function(A){return A.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isMobile&&(this.isNeedRenderHeader=Qd(t.btnList,(function(A){return A.isrender>0&&"deviceID"===A.iconId||A.isrender>0&&"deviceName"===A.iconId}))>=0&&"miniRec"!=this.jSPlugin.id),this.isNeedRenderFooter=Qd(i.btnList,(function(A){return A.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isNeedRenderTimeLine=Qd(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(this.jSPlugin.id+"-headControl"))document.getElementById(this.jSPlugin.id+"-headControl").innerHTML="
    ";else{var a=document.createElement("div");a.setAttribute("id",this.jSPlugin.id+"-headControl"),a.setAttribute("class","header-controls"),a.innerHTML="
    ";var r={height:this.jSPlugin.width>CI?"48px":"32px","line-height":this.jSPlugin.width>CI?"48px":"32px",display:"flex","justify-content":"space-between",top:0,left:0,right:0,"z-index":999,"background-color":"rgba(0,0,0,.8)",color:"#FFFFFF",width:"100%",position:"absolute"};a.style=II(r),document.getElementById(n+"-wrap").insertBefore(a,document.getElementById(n))}var o=document.getElementById(n+"-wrap").classList.contains("ezuikit-player-wrap-mobile-fullscreen");!document.getElementById(this.jSPlugin.id+"-headControl")||this.jSPlugin._isCurrentBrowserFullscreen||o||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1),!0)}else document.getElementById(this.jSPlugin.id+"-headControl")&&document.getElementById(this.jSPlugin.id+"-headControl").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-headControl")),!document.getElementById(this.jSPlugin.id+"-headControl")||this.jSPlugin._isCurrentBrowserFullscreen||isMobileFullscreen||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1),!0);if(this.isNeedRenderFooter)if(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container"))document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.marginTop="-"+(this.jSPlugin.width>CI?48:32)+"px",document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").innerHTML='");else{var s=document.createElement("div");s.setAttribute("id",this.jSPlugin.id+"-ez-iframe-footer-container"),s.setAttribute("class","ez-iframe-footer-container");var l={"min-height":this.jSPlugin.width>CI?"48px":"32px","max-height":this.jSPlugin.width>CI?"96px":"80px",position:"relative","margin-top":this.jSPlugin.width>CI?"-48px":"-32px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%"};s.style=II(l),s.innerHTML='",g(s,document.getElementById(n))}else document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container"));if(this.isNeedRenderHeader&&document.getElementById(this.jSPlugin.id+"-headControl")){document.getElementById(this.jSPlugin.id+"-headControl").style.background=t.backgroundColor,document.getElementById(this.jSPlugin.id+"-headControl").style.color=t.color;for(var d,I=dI(t.btnList);!(d=I()).done;){var C=d.value;if(C.isrender)try{this.renderHeader(C.iconId,C.part)}catch(A){}}}if(this.isNeedRenderFooter&&document.getElementById(this.jSPlugin.id+"-audioControls")){document.getElementById(this.jSPlugin.id+"-audioControls").style.background=i.backgroundColor,document.getElementById(this.jSPlugin.id+"-audioControls").style.color=i.color;for(var h,u=dI(i.btnList);!(h=u()).done;){var B=h.value;if(B.isrender)try{this.renderFooter(B.iconId,B.part)}catch(A){}}}if(this.isNeedRenderTimeLine)if(this.isMobile)document.getElementById(this.jSPlugin.id+"-headControl-right")&&(document.getElementById(this.jSPlugin.id+"-headControl-right").style.display="none"),this.Rec?this.Rec.recInit():this.Rec=new Tg(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 vd(this.jSPlugin));var E=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(E)}),50)}if(Qd(this.themeData.footer.btnList,(function(A){return"pantile"===A.iconId&&1===A.isrender}))>=0&&!this.jSPlugin.disabledPTZ&&(this.isMobile&&(this.MobilePtz=new Jd(this.jSPlugin)),this.Ptz=new Qg(this.jSPlugin)),this.themeData.poster){this.jSPlugin.poster=this.themeData.poster;var f=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(f),A.jSPlugin.setPoster(A.themeData.poster))}),50)}this.inited=!0,this.jSPlugin.deviceInfo&&(document.getElementById(this.jSPlugin.id+"-deviceName-content")&&(document.getElementById(this.jSPlugin.id+"-deviceName-content").style.maxWidth="100%",document.getElementById(this.jSPlugin.id+"-deviceName-content").style.overflow="hidden",document.getElementById(this.jSPlugin.id+"-deviceName-content").style.textOverflow="ellipsis",document.getElementById(this.jSPlugin.id+"-deviceName-content").style.whiteSpace="nowrap",document.getElementById(this.jSPlugin.id+"-deviceName-content").innerHTML=this.jSPlugin.deviceInfo.deviceName||""),document.getElementById(this.jSPlugin.id+"-deviceID-content")&&(document.getElementById(this.jSPlugin.id+"-deviceID-content").style.maxWidth="100%",document.getElementById(this.jSPlugin.id+"-deviceID-content").style.overflow="hidden",document.getElementById(this.jSPlugin.id+"-deviceID-content").style.textOverflow="ellipsis",document.getElementById(this.jSPlugin.id+"-deviceID-content").style.whiteSpace="nowrap",document.getElementById(this.jSPlugin.id+"-deviceID-content").innerHTML=c(this.jSPlugin.url).deviceSerial||"")),this.renderThemeData()},e.resetMobileZoomStatus=function(){if(this.isMobile){var A=document.getElementById(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()}},e.webExpend=function(){var A=this.decoderState.state;A.webExpend;var e=A.expend;return!!A.play&&(!e&&void this.jSPlugin.browserFullscreen())},e.expend=function(){var A=this.decoderState.state,e=A.webExpend;return!!A.play&&(!e&&void(this.isMobile?(l(document.getElementById(this.jSPlugin.id+"-wrap")),this.jSPlugin.Zoom&&this.jSPlugin.Zoom.setTransform(!0),document.getElementById(""+this.jSPlugin.id).style["backface-visibility"]="hidden"):this.jSPlugin.fullscreen()))},e._extendHeadeTimeLinrHight=function(A){var e=0,t=document.getElementById(this.jSPlugin.id+"-canvas-container");return t&&!A&&(e=parseInt(window.getComputedStyle(t).height,10)),e},e.disabledFECBtn=function(){var A=[this.jSPlugin.id+"-capturePicture",this.jSPlugin.id+"-capturePicture-content",this.jSPlugin.id+"-capturePicture-icon",this.jSPlugin.id+"-recordvideo",this.jSPlugin.id+"-recordvideo-content",this.jSPlugin.id+"-recordvideo-icon",this.jSPlugin.id+"-zoom",this.jSPlugin.id+"-zoom-content",this.jSPlugin.id+"-zoom-icon"],e=document.getElementById(this.jSPlugin.id+"-wrap");if(this.jSPlugin.use3DZoom?this.jSPlugin.close3DZoom():this._stopZoom(),this.setDecoderState({zoom:!1}),e)for(var t,i=dI(A);!(t=i()).done;){var n=t.value,a=e.querySelector("#"+n);a&&(a.style.display="none")}},e.resumeFECBtn=function(){var A=[this.jSPlugin.id+"-capturePicture",this.jSPlugin.id+"-capturePicture-content",this.jSPlugin.id+"-capturePicture-icon",this.jSPlugin.id+"-recordvideo",this.jSPlugin.id+"-recordvideo-content",this.jSPlugin.id+"-recordvideo-icon",this.jSPlugin.id+"-zoom",this.jSPlugin.id+"-zoom-content",this.jSPlugin.id+"-zoom-icon"],e=document.getElementById(this.jSPlugin.id+"-wrap");if(e)for(var t,i=dI(A);!(t=i()).done;){var n=t.value,a=e.querySelector("#"+n);a&&(a.style.display="")}},e.destroy=function(){var A=document.getElementById(this.jSPlugin.id+"-headControl");this.Rec&&this.Rec.destroy&&this.Rec.destroy(),this.Ptz&&this.Ptz.destroy&&this.Ptz.destroy(),A&&(A.innerHTML="");var e=document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container");this._removeElement(e);var t=document.getElementById(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),rg.isEnabled&&this._fullscreenchange&&rg.off("change",this._fullscreenchange),Pg.listInstances().length<=1&&(r(this.jSPlugin.staticPath+"/speed/speed.css"),r(this.jSPlugin.staticPath+"/css/theme.css"))},e._removeElement=function(A){A&&A.parentNode&&A.parentNode.removeChild(A)},e._stopZoom=function(){var A,e,t,i,n;null==(t=this.jSPlugin)||null==(e=t.Zoom)||null==(A=e.stopZoom)||A.call(e),null==(n=this.jSPlugin)||null==(i=n.eventEmitter)||i.emit(Eg.zoom.closeZoom)},e._startZoom=function(){var A,e,t,i,n;null==(t=this.jSPlugin)||null==(e=t.Zoom)||null==(A=e.startZoom)||A.call(e),null==(n=this.jSPlugin)||null==(i=n.eventEmitter)||i.emit(Eg.zoom.openZoom)},A}();function BI(){return BI=Object.assign||function(A){for(var e=1;e\n \n ':i.innerHTML='
    \n
    \n ',t.insertBefore(i,document.getElementById(this.jSPlugin.id))},e.initToastContent=function(A,e){var t=this;void 0===e&&(e=2e3),this.timer=null,document.getElementById(this.jSPlugin.id+"-wrap-Toast-custom")?(document.getElementById(this.jSPlugin.id+"-wrap-Toast-custom").style.display="flex",document.getElementById(this.jSPlugin.id+"-wrap-Toast-custom-content").innerText=A||"",this.timer=setTimeout((function(){document.getElementById(t.jSPlugin.id+"-wrap")&&document.getElementById(t.jSPlugin.id+"-wrap-Toast-custom")&&document.getElementById(t.jSPlugin.id+"-wrap").removeChild(document.getElementById(t.jSPlugin.id+"-wrap-Toast-custom"))}),e)):(this.randerToast(),this.initToastContent(A))},A}(),QI=function(A,e,t,i,n,a){void 0===e&&(e="GET"),void 0===t&&(t={}),void 0===a&&(a={});var r={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},o="";r=Object.assign(r,a);var s=new Headers;Object.keys(r).map((function(A){s.append(A,r[A])})),r=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]&&(o+="&"+A+"="+encodeURIComponent(e))})),o.length>0&&(o=-1!==["GET","PUT","DELETE"].indexOf(e.toUpperCase())?"?"+o.slice(1):o.slice(1));var g=A+(-1!==["GET","PUT","DELETE"].indexOf(e.toUpperCase())?o:""),l={headers:r,method:e};"POST"===e&&(l.body=o),"POST"===e&&a&&"application/json"===a["Content-Type"]&&(l.body=JSON.stringify(t)),"GET"===e&&(-1===g.indexOf("?")?g+="?_r="+Math.random():g+="&_r="+Math.random()),fetch(g,l).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)}))},xI=function(A,e,t){var i=new FormData;i.append("deviceSerial",c(A.url).deviceSerial),i.append("cmd","open"),fetch(domain+"/api/v3/device/acs/remote/door?accessToken="+(A.accessToken||A.token.deviceToken.globalAll),{method:"POST",body:i}).then((function(A){return A.json()})).then((function(A){e(A)})).catch((function(A){t(A)}))},pI=function(A,e,t){var i={accessToken:A.accessToken||A.token.httpToken.url,pageStart:0,pageSize:4,default:!0,voiceName:"轻应用语音文件"},n=A.env.domain+"/api/lapp/voice/query";QI(n,"POST",i,(function(A){e(A)}),(function(A){t(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},mI=function(A,e,t,i){var n=A.env.domain+"/api/lapp/voice/send",a=new FormData;a.append("deviceSerial",c(A.url).deviceSerial),a.append("accessToken",A.accessToken||A.token.deviceToken.video),a.append("channelNo",c(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){t(A)}(A)})).catch((function(A){i(A)}))},yI=function(){function A(A,e){this.jSPlugin=A,this.videoWidth=A.width,this.switchFooter=e,this.sendLoadingStats=!1,this.toastCustom=new fI(A,!1),this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.initQuickReply()}var e=A.prototype;return e.initQuickReply=function(){document.getElementById("pc-quickReply-back")||this.renderQuickReply(),document.getElementById("pc-quickReply-back-item-0")||this.getQuickReplyList()},e.renderQuickReply=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(this.jSPlugin.id+"-audioControls-quickReply").appendChild(t),document.getElementById("pc-quickReply-back").onclick=function(){A.switchFooter("onBell")}},e.matchQuickReplyBtn=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-"+n,a.style="margin: "+8*e+"px 0 "+8*e+"px "+8*e+"px;cursor: pointer;\n padding: 0 "+20*e+"px;min-height: "+64*e+"px;width:calc(50% - "+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:"+24*e+"px;color: rgba(255,255,255,0.90);",a.innerHTML='
    \n '+i.voiceName+"\n
    ",a.onclick=function(){A.sendLoadingStats||A.sendQuickReply(i,n)},t.appendChild(a)}))},e.setBtnCheckLoading=function(A,e){var t=this.videoWidth/1024||1;if(e>-1){document.getElementById("pc-quickReply-back-item-"+e);var i=document.getElementById("pc-quickReply-back-item-box-"+e),n=document.getElementById("pc-quickReply-name-"+e);if(1==A){var a=document.getElementById("pc-quickReply-icon-loading-"+e);a&&n&&i.removeChild(a)}else if(n){var r=document.createElement("span");r.id="pc-quickReply-icon-loading-"+e,r.style="vertical-align: middle;margin-right:"+16*t+"px;",r.innerHTML='',i.insertBefore(r,n)}}},e.getQuickReplyList=function(){var A=this;this.madeLoadingDom(0);pI(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){A.madeLoadingDom(1)}))},e.madeLoadingDom=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()},e.sendQuickReply=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){t.sendLoadingStats=!1,t.setBtnCheckLoading(1,e),t.toastCustom.initToastContent("快捷回复失败,请重试"),t.switchFooter("onBell")}))},A}(),_I=function(){function A(A,e){this.jSPlugin=A,this.videoWidth=A.width,this.switchFooter=e,this.toastCustom=new fI(A,!1),this.lockStatus=!1,this.initRemoteUnlock()}var e=A.prototype;return e.initRemoteUnlock=function(){document.getElementById("pc-remoteUnlock-back")?this.madeSlideEvent():this.renderRemoteUnlock()},e.renderRemoteUnlock=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(this.jSPlugin.id+"-audioControls-remoteUnlock").appendChild(t),document.getElementById("pc-remoteUnlock-back").onclick=function(){A.goback()},this.renderRemoteUnlockSlide()},e.renderRemoteUnlockSlide=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()},e.getOffsetLeft=function(A){var e=0;do{e+=A.offsetLeft,A=A.parentNode}while(A.parentNode);return e},e.madeSlideEvent=function(){var A=this.videoWidth/1024||1,e=document.getElementById(""+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"),r=document.getElementById("pc-remoteUnlock-slide-ball"),o=this;r.onmousedown=function(e){var s=(e=e||window.event).offsetX;r.style.transition="",n.style.transition="",document.onmouseup=function(){o.lockStatus||(n.style.width="0px",r.style.left=8*A+"px",r.style.transition="left 0.6s linear",n.style.transition="width 0.6s linear"),document.onmouseup=null,document.onmousemove=null},document.onmousemove=function(e){var g=(e=e||window.event).pageX-i.offsetLeft-s-t,l=i.clientWidth-r.clientWidth-8*A;g<=0&&(g=0),g>=l&&(g=l),r.style.left=g+"px",g!=l||o.lockStatus||o.lockStatus||(o.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",r.style.backgroundColor="#ffffff",a.textContent="正在开锁",r.onmousedown=null,document.onmousemove=null,o.sendRemoteUnlockApi())}}},e.resetRemoteUnlockSlide=function(){var A=document.getElementById("pc-remoteUnlock-box"),e=document.getElementById(this.jSPlugin.id+"-audioControls-remoteUnlock");A&&e&&e.removeChild(A)},e.sendRemoteUnlockApi=function(){var A=this;xI(this.jSPlugin,(function(e){e&&200==e.code?A.toastCustom.initToastContent("开锁成功"):A.toastCustom.initToastContent("开锁失败,请重试"),A.goback()}),(function(e){A.toastCustom.initToastContent("开锁失败,请重试"),A.goback()}))},e.goback=function(){this.switchFooter("onCall"),this.resetRemoteUnlockSlide()},A}(),SI={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 DI(A){var e=new _g,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 vI=function(A){var e="";return Object.keys(A).map((function(t,i){e+=t+":"+A[t]+(i\n \n ',document.getElementById(this.jSPlugin.id+"-wrap").appendChild(o)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById(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: "+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(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)}},e.removeBellRing=function(){document.getElementById("bellring")&&document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("bellring-icon"))},e.matchBtn=function(A,e){var t=this,i=this.themeData,n=i.header,a=i.footer,r=this.decoderState.state,o=r.mute,s=r.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 l=this.videoWidth/6;this.videoWidth;var c=this.videoWidth/1024||1;switch(A){case"ringStatus":return g.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,g.id=A,g.domString=''+(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt)+"",g.onclick=function(){},g;case"deviceCategory":return g.title="设备名称",g.id=A,g.domString=''+(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=''+(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;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;t.switchFooter("quickReply"),t.quickReplyEle=new yI(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,r=i.play,o=i.isEditing,s=i.talk,g=i.sound,l=i.rejection;if(o||l)return!1;t.jSPlugin.pluginStatus.loadingClear(),r||(t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),t.jSPlugin.play(),t.setDecoderState({play:!r})),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 c=document.getElementById(t.jSPlugin.id+"-header-onBell");c&&c.parentElement.removeChild(c),1==t.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById(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&&(A.setDecoderState({talk:!1}),A.jSPlugin.Talk.stopTalk()),r&&(A.jSPlugin.stop(),A.setDecoderState({play:!r})),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;t.switchFooter("remoteUnlock"),t.remoteUnlockEle=new _I(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;i?(t.setDecoderState({talk:!1,mute:!0},e.backgroundColor),t.jSPlugin.Talk.stopTalk(),t.jSPlugin.openSound()):(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&&(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)&&(t.removeBellRing(),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp"))},g;default:return g}},e.answerOvertime=function(){this.toastCustom.initToastContent("应答超时"),this.decoderState.state.play&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.rejectionStatusDispose(),this.switchFooter("onBell"),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")},e.rejectionStatusDispose=function(){var A=this,e=this.themeData.footer,t=document.getElementById(this.jSPlugin.id+"-audioControls"),i=document.getElementById(this.jSPlugin.id+"-audioControls-onCall"),n=document.getElementById("header-"+this.bellStatus+"-ringStatus");"onBell"==this.bellStatus?(t.innerHTML="",t.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),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})},e.userNoDevice=function(){var A=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var e=this.themeData.footer,t=document.getElementById(this.jSPlugin.id+"-audioControls"),i=document.getElementById(this.jSPlugin.id+"-audioControls-onCall");"onBell"==this.bellStatus?(t.innerHTML="",t.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),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})},e.renderHeader=function(A,e){var t=this,i=this.videoWidth/1024||1,n=this.matchBtn(A,e);if(document.getElementById(this.jSPlugin.id+"-header-"+this.bellStatus+"-content")){var a=document.createElement("span");a.innerHTML=""+n.domString,document.getElementById(this.jSPlugin.id+"-header-"+this.bellStatus+"-content").appendChild(a)}else{var r=document.createElement("div");r.id=this.jSPlugin.id+"-header-"+this.bellStatus,r.style="max-width:50%;position:relative;",r.innerHTML='\n '+n.domString+"\n ",r.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onclick(A)},document.getElementById(this.jSPlugin.id+"-headControl").childNodes[0].appendChild(r)}},e.renderFooter=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/6,r=document.createElement("div");r.className="theme-icon-item",this.jSPlugin.isWebConsole?r.style="padding:0 "+.1*a+"px;":r.style="padding:0 "+.1*a+"px;cursor: pointer;",r.innerHTML='
    '+n.domString+"
    ",r.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onclick(A)},n.onmouseenter&&(r.onmouseenter=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseenter(A)}),n.onmouseleave&&(r.onmouseleave=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseleave(A)});var o=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")},r.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")},r.appendChild(g),"answer"==A||"rejection"==A||"hangUp"==A);else{var l=document.createElement("span");l.className="icon-move close",l.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ',l.onclick=function(){t.editIcon(n.id,"delete","footer")},r.appendChild(l)}"onCall"==this.bellStatus?document.getElementById(this.jSPlugin.id+"-audioControls-onCall").appendChild(r):document.getElementById(this.jSPlugin.id+"-audioControls").appendChild(r),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))},e.switchFooter=function(A){var e={};switch(this.themeData&&(e=this.themeData.footer),A){case"onBell":document.getElementById(this.jSPlugin.id+"-audioControls-quickReply")&&(document.getElementById(this.jSPlugin.id+"-audioControls-quickReply").style.display="none"),document.getElementById(this.jSPlugin.id+"-audioControls-onCall")?"none"==document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.display&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.display="flex"):document.getElementById(this.jSPlugin.id+"-audioControls").style.display="flex";break;case"onCall":document.getElementById(this.jSPlugin.id+"-audioControls-remoteUnlock").style.display="none",document.getElementById(this.jSPlugin.id+"-audioControls").style.display="none",document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.display="flex",this.themeData&&(document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.color=e[this.bellStatus].color);break;case"quickReply":document.getElementById(this.jSPlugin.id+"-audioControls-quickReply").style.display="flex",document.getElementById(this.jSPlugin.id+"-audioControls").style.display="none";break;case"remoteUnlock":document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.display="none",document.getElementById(this.jSPlugin.id+"-audioControls").style.display="none",document.getElementById(this.jSPlugin.id+"-audioControls-remoteUnlock").style.display="flex"}},e.initThemeData=function(){var A=this,e=this.decoderState.state.isEditing,t=this.themeData,i=t.header,n=t.footer,a=this.jSPlugin.id,r=this.videoWidth/1024;if(this.isNeedRenderHeader=Qd(i[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=Qd(n[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById(this.jSPlugin.id+"-headControl"))document.getElementById(this.jSPlugin.id+"-headControl").innerHTML="
    ";else{var o=document.createElement("div");o.setAttribute("id",this.jSPlugin.id+"-headControl"),o.setAttribute("class","header-controls"),o.innerHTML="
    ";var s=.2*this.jSPlugin.height+"px",l={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%)"};o.style=vI(l),document.getElementById(a+"-wrap").insertBefore(o,document.getElementById(a));var c=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(c)}),50)}else document.getElementById(this.jSPlugin.id+"-headControl")&&document.getElementById(this.jSPlugin.id+"-headControl").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-headControl"));var d=.3*this.jSPlugin.height;if(this.isNeedRenderFooter)if(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container"))document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.marginTop="-"+d+"px","onCall"==this.bellStatus?document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").innerHTML='\n \n \n \n \n ':document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").innerHTML='\n \n \n \n \n ');else{var I=document.createElement("div");I.setAttribute("id",this.jSPlugin.id+"-ez-iframe-footer-container"),I.setAttribute("class","ez-iframe-footer-container");var C={"min-height":d+"px","max-height":d+"px",position:"relative","margin-top":"-"+d+"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*r+"px"};I.style=vI(C),I.innerHTML='\n \n \n \n \n ',g(I,document.getElementById(a))}else document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container"));if(this.isNeedRenderHeader&&document.getElementById(this.jSPlugin.id+"-headControl")&&(document.getElementById(this.jSPlugin.id+"-headControl").style.background=i[this.bellStatus].backgroundColor,document.getElementById(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(this.jSPlugin.id+"-audioControls")&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.background=n[this.bellStatus].backgroundColor,document.getElementById(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 h=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(h),A.jSPlugin.setPoster(A.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),window.addEventListener("click",this.autoPlayRing)),this.inited=!0,this.getCallDeviceInfo()},e.renderThemeData=function(){var A=this,e=this.decoderState.state.isEditing,t=this.themeData,i=t.header,n=t.footer;if(this.isNeedRenderHeader&&i&&(document.getElementById(this.jSPlugin.id+"-headControl").style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById(this.jSPlugin.id+"-headControl").style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(e,t){var i;e.isrender&&A.setDecoderState(((i={})[e.iconId]=A.decoderState.state[e.iconId],i))}))),this.isNeedRenderFooter&&n)document.getElementById(this.jSPlugin.id+"-audioControls").style.background=n[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById(this.jSPlugin.id+"-audioControls").style.color=n[this.bellStatus].color.replace("-diy",""),document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.color=n[this.bellStatus].color.replace("-diy",""),n[this.bellStatus].btnList.map((function(t,i){var n;t.isrender&&A.setDecoderState(((n={})[t.iconId]=A.decoderState.state[t.iconId],n));if(0==i&&!A.themeInited&&A.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),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(this.jSPlugin.id+"-wrap").addEventListener("click",(function(){A.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===c(this.jSPlugin.url).type,rec:"rec"===c(this.jSPlugin.url).type,type:c(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 r=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),A.jSPlugin.reSize(A.jSPlugin.params.width,A.jSPlugin.params.height))}),50)},e.setThemeData=function(A,e){this.themeData=A,"onCall"==e&&(this.bellStatus="onCall")},e.startAutoFocus=function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById(A.jSPlugin.id+"-audioControls")&&(document.getElementById(A.jSPlugin.id+"-audioControls").style.opacity=0,document.getElementById(A.jSPlugin.id+"-audioControls").style.pointerEvents="none")}),1e3*e)},e.stopAutoFocus=function(){document.getElementById(this.jSPlugin.id+"-audioControls")&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.opacity=1,document.getElementById(this.jSPlugin.id+"-audioControls").style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()},e.editIcon=function(A,e,t){var i=this.themeData,n=this.themeData[t][this.bellStatus].btnList,a=Qd(n,(function(e){return e.iconId===A})),r=n[a];switch(e){case"delete":n[a].isrender=0;break;case"right":for(var o=-1,s=a+1;s=0;l--)if(n[l].part===n[a].part&&1==n[l].isrender){g=l;break}-1!==g&&(n[a]=n[g],n[g]=r)}i[t][this.bellStatus].btnList=n,this.jSPlugin.Theme.changeTheme(i)},e.countTime=function(A,e){void 0===e&&(e=0);var 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(this.jSPlugin.id+"-ez-iframe-footer-container")&&document.getElementById(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",r="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),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+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"))},e.editStart=function(A){var e=document.getElementById(this.jSPlugin.id+"-audioControls"),t=document.getElementById(this.jSPlugin.id+"-audioControls-onCall");document.getElementById(this.jSPlugin.id+"-headControl"),e&&e.setAttribute("class","footer-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})},e.editEnd=function(A){var e=document.getElementById(this.jSPlugin.id+"-audioControls"),t=document.getElementById(this.jSPlugin.id+"-headControl"),i=document.getElementById(this.jSPlugin.id+"-audioControls-onCall");t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")},e.fetchThemeData=function(A){var e=this;rI(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=SI,e.initThemeData(),e.renderThemeData())}),(function(){e.renderThemeData()}))},e.getCallDeviceInfo=function(){var A=this;this.videoWidth,DI({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:c(this.jSPlugin.url).deviceSerial}).then((function(e){A.deviceInfoData=e.data,e.data.isEncrypt&&setTimeout((function(){A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),500),document.getElementById("header-"+A.bellStatus+"-deviceCategory")&&(document.getElementById("header-"+A.bellStatus+"-deviceCategory").innerText=""+e.data.deviceName)})).catch((function(e){20018!=e.code||A.jSPlugin.isWebConsole||A.userNoDevice()}))},e.setHeaderText=function(A){var e=this.videoWidth/1024||1;document.getElementById(this.jSPlugin.id+"-deviceCategory-content")&&(document.getElementById(this.jSPlugin.id+"-deviceCategory-content").innerHTML=''+A+''+(this.deviceInfoData&&this.deviceInfoData.deviceName||"")+"")},A}(),bI=function(){function A(A,e,t){this.jSPlugin=A,this.videoWidth=t,this.switchFooter=e,this.toastCustom=new fI(A,!0),this.sendLoadingStats=!1,this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.popupCustom=new xg(A,366),document.getElementById("mobile-quickReply-list")||(this.popupCustom.initPopupContent("快捷回复",this.renderQuickReply()),this.initQuickReply())}var e=A.prototype;return e.initQuickReply=function(){document.getElementById("mobile-quickReply-list-item-0")||this.getQuickReplyList()},e.renderQuickReply=function(){document.documentElement.clientWidth;var A=document.createElement("div");return A.style="width:100%;",A.id="mobile-quickReply-list",A.innerHTML='
    \n \n ',A},e.matchQuickReplyBtn=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-"+n,a.style="margin: "+14*e+"px 0;\n padding: "+12*e+"px "+15*e+"px;min-height: "+50*e+"px;width:100%;\n background: #ffffff;border-radius: "+25*e+"px;display: flex;align-items: center;\n box-sizing: border-box;font-size:"+16*e+"px;color: #2c2c2c;",a.innerHTML='\n \n icon/快捷回复播放\n \n \n \n \n \n '+i.voiceName+"",a.onclick=function(){A.sendLoadingStats||(A.setBtnCheckStatus(n),A.sendQuickReply(i))},t.appendChild(a)}))},e.setBtnCheckStatus=function(A){var e=this,t="";this.quickReplyList.forEach((function(i,n){t=document.getElementById("mobile-quickReply-list-item-"+n),n==A?(t.style.background="#F4F6FC",t.style.color="#648FFC",e.setBtnCheckLoding(0,n)):(t.style.background="#ffffff",t.style.color="#2c2c2c")}))},e.setBtnCheckLoding=function(A,e){var t=this.videoWidth/375||1;if(e>-1){var i=document.getElementById("mobile-quickReply-list-item-"+e),n=document.getElementById("mobile-quickReply-name-"+e),a=document.getElementById("mobile-quickReply-icon-"+e);if(1==A){if(document.getElementById("mobile-quickReply-icon-loading-"+e)&&n){var r=document.createElement("span");r.id="mobile-quickReply-icon-"+e,r.style="height:"+24*t+"px;",r.innerHTML='\n \n icon/快捷回复播放\n \n \n \n \n \n ',i.insertBefore(r,n)}}else if(a&&n){i.removeChild(a);var o=document.createElement("span");o.id="mobile-quickReply-icon-loading-"+e,o.style="height:"+20*t+"px;width: "+24*t+"px;",o.innerHTML='',i.insertBefore(o,n)}}},e.getQuickReplyList=function(){var A=this;this.madeLoadingDom(0);pI(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){A.madeLoadingDom(1)}))},e.madeLoadingDom=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()},e.sendQuickReply=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){e.sendLoadingStats=!1,e.toastCustom.initToastContent("快捷回复失败,请重试"),e.popupCustom.closePopupCustom()}))},e.closeQuickReplyEle=function(){this.popupCustom.closePopupCustom()},A}(),FI=function(){function A(A,e,t){this.jSPlugin=A,this.videoWidth=t,this.switchFooter=e,this.toastCustom=new fI(A,!0),this.lockStatus=!1,this.popupCustom=new xg(A,265),this.popupCustom.initPopupContent("远程开锁",this.renderRemoteUnlock()),this.renderRemoteUnlockSlide()}var e=A.prototype;return e.initRemoteUnlock=function(){document.getElementById("mobile-remoteUnlock-content")?this.madeSlideEvent():this.renderRemoteUnlock()},e.renderRemoteUnlock=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},e.renderRemoteUnlockSlide=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 "+15*A+"px",t.innerHTML='
    \n
    \n
    右滑开锁
    \n
    \n \n icon/箭头向右\n \n \n \n \n \n \n
    \n
    ',e.appendChild(t),this.madeSlideEvent()},e.madeSlideEvent=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(r){var o=(r=r||window.event).touches[0].pageX;n.style.transition="",t.style.transition="",document.ontouchmove=function(r){var s=(r=r||window.event).touches[0].pageX-e.offsetLeft-o,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}}},e.resetRemoteUnlockSlide=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"},e.sendRemoteUnlockApi=function(){var A=this;xI(this.jSPlugin,(function(e){e&&200==e.code?A.toastCustom.initToastContent("开锁成功"):A.toastCustom.initToastContent("开锁失败,请重试"),A.popupCustom.closePopupCustom()}),(function(e){A.toastCustom.initToastContent("开锁失败,请重试"),A.popupCustom.closePopupCustom()}))},e.closeRemoteUnlock=function(){this.popupCustom.closePopupCustom()},A}(),RI={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"}]}}},kI=function(A){var e="";return Object.keys(A).map((function(t,i){e+=t+":"+A[t]+(i\n \n ',document.getElementById(this.jSPlugin.id+"-wrap").appendChild(s)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("bellring-icon"));else{var g=1.8*n,l=6;document.getElementById(this.jSPlugin.id+"-headControl")&&(l=document.getElementById(this.jSPlugin.id+"-headControl").offsetHeight+.1*g+6);var c=l+(this.videoHeight-130*a)/2,d=document.createElement("div");d.id="bellring-icon",d.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: "+c+"px;display: flex;align-items: center;justify-content: center;",d.innerHTML='
    \n
    \n \n icon/响铃\n \n \n \n \n \n
    \n
    ',document.getElementById(this.jSPlugin.id+"-wrap").appendChild(d),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)}},e.removeBellRing=function(){document.getElementById("bellring")&&document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("bellring-icon"))},e.getMiniCallTimeUrl=function(){if(-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=this.recUrl+"?begin="+t+"&end="+i}},e.initMiniRec=function(){var A=this,e=this,t=this.videoWidth,i=t/375,n=1.8*t,a=6;document.getElementById(this.jSPlugin.id+"-headControl")&&(a=document.getElementById(this.jSPlugin.id+"-headControl").offsetHeight+.1*n+6);var r=a+this.videoHeight+10*i;if(document.getElementById("miniRecbox"))document.getElementById("miniRecbox")&&document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("miniRecbox")),document.getElementById("miniClose")&&document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("miniClose")),this.initMiniRec();else{var o=document.createElement("div");o.id="miniRecbox",o.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;top: "+r+"px;right: "+9*i+"px;",o.innerHTML='
    ',document.getElementById(this.jSPlugin.id+"-wrap").appendChild(o),this.getMiniCallTimeUrl();var s={domain:gg};this.miniRecPlayer=new ef({id:"miniRec",width:160*i,height:90*i,template:"miniRec",url:this.recUrl,token:this.jSPlugin.token,handleError:function(t){t&&6701==t.retcode?(A.miniRecNum=A.miniRecNum+1,A.miniRecNum<5?e.miniRecPlayer.changePlayUrl({type:"miniRec"}):e.miniRecCloseClick()):e.miniRecCloseClick()},env:this.jSPlugin.env||s});var g=document.createElement("div");g.id="miniClose",g.style="position: absolute;top: "+(r+8)+"px;right: "+16*i+"px;",g.innerHTML='
    \n \n close\n \n \n \n \n \n \n \n
    ',document.getElementById(this.jSPlugin.id+"-wrap").appendChild(g),document.getElementById("miniClose-btn").onclick=function(){e.miniRecCloseClick()}}},e.initMiniImageRec=function(){var A=this.videoWidth/375,e=6;document.getElementById(this.jSPlugin.id+"-headControl")&&(e=document.getElementById(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: "+t+"px;\n right: "+9*A+"px;\n user-select: none;\n ",i.innerHTML='
    \n \n
    示意小窗位置
    \n
    ',document.getElementById(this.jSPlugin.id+"-wrap").appendChild(i);var n=document.createElement("div");n.id="miniClose",n.style="z-index: 4;position: absolute;top: "+(t+8)+"px;right: "+16*A+"px;",n.innerHTML='
    \n \n close\n \n \n \n \n \n \n \n
    ',document.getElementById(this.jSPlugin.id+"-wrap").appendChild(n),document.getElementById("miniClose-btn").onclick=function(){}}},e.miniRecCloseClick=function(){document.getElementById("miniRecbox")&&"rec"==this.miniRecStatus&&(this.miniRecPlayer&&this.miniRecPlayer.stop(),document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("miniClose")),document.getElementById(this.jSPlugin.id+"-wrap").removeChild(document.getElementById("miniRecbox")))},e.miniRecSwitchClick=function(){var A=this.decoderState.state.isEditing,e=this.videoWidth,t=e/375,i=1.8*e,n=6;document.getElementById(this.jSPlugin.id+"-headControl")&&(n=document.getElementById(this.jSPlugin.id+"-headControl").offsetHeight+.1*i+6);var a=n+this.videoHeight+10*t;if("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 r=this.videoHeight+10*t,o=.2*i-90*t-10*t;document.getElementById(this.jSPlugin.id+"-wrap").style.width=this.videoWidth+"px",document.getElementById(""+this.jSPlugin.id).style.marginTop=r+"px",document.getElementById(""+this.jSPlugin.id).style.marginLeft=e-160*t-9+"px",document.getElementById(""+this.jSPlugin.id).style.overflow="hidden",document.getElementById(""+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(this.jSPlugin.id+"-ez-iframe-footer-container").style.marginTop=o+"px"}else 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(this.jSPlugin.id+"-wrap").style.width=this.videoWidth+NaN,document.getElementById(""+this.jSPlugin.id).style.marginTop="0",document.getElementById(""+this.jSPlugin.id).style.marginLeft="0",document.getElementById(""+this.jSPlugin.id).style.overflow="hidden",document.getElementById(""+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(this.jSPlugin.id+"-ez-iframe-footer-container").style.marginTop=.2*i+"px"},e.matchBtn=function(A,e){var t=this,i=this.themeData,n=i.header,a=i.footer,r=this.decoderState.state,o=r.mute,s=r.rejection;document.documentElement.clientHeight;var g=this.videoWidth/375,l=this.videoWidth/375||1,c={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}))?(c.color=a[this.bellStatus].color,c.backgroundColor=a[this.bellStatus].backgroundColor,c.activeColor=a[this.bellStatus].activeColor):(c.color=n[this.bellStatus].color,c.backgroundColor=n[this.bellStatus].backgroundColor,c.activeColor=n[this.bellStatus].activeColor);var d=this.videoWidth/4;switch(A){case"ringStatus":return c.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,c.id=A,c.domString=''+(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt)+"",c.onclick=function(){},c;case"deviceCategory":return c.title="设备名称",c.id=A,c.domString=''+(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称")+"",c.onclick=function(){},c;case"callStatus":return c.title="通话中",c.id=A,c.domString='通话中',c.onclick=function(){},c;case"deviceCategory":return c.title="设备名称",c.id=A,c.domString=''+(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称")+"",c.onclick=function(){},c;case"rejection":return c.title="拒绝",c.id=A,c.domString='
    \n
    \n \n 拒绝\n \n \n \n \n \n
    \n
    拒绝
    \n
    ',c.onclick=function(){var A=t,e=t.decoderState.state,i=e.play,n=e.isEditing,a=e.rejection;if(n||a)return!1;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")},c;case"quickReply":return c.title="快捷回复",c.id=A,c.domString='
    \n
    \n \n 快捷回复\n \n \n \n \n \n
    \n
    快捷回复
    \n
    ',c.onclick=function(){var A=t.decoderState.state,e=A.isEditing,i=A.rejection;if(e||i)return!1;t.switchFooter("quickReply"),t.quickReplyEle=new bI(t.jSPlugin,t.switchFooter,t.videoWidth)},c;case"answer":return c.title="接听",c.id=A,c.domString='
    \n
    \n \n 接听\n \n \n \n \n \n
    \n
    接听
    \n
    ',c.onclick=function(){var A=t,i=t.decoderState.state,r=i.play,o=i.isEditing,s=i.talk,g=i.sound,l=i.rejection;if(o||l)return!1;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 c=document.getElementById(t.jSPlugin.id+"-header-onBell");c&&c.parentElement.removeChild(c),1==t.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById(t.jSPlugin.id+"-wrap").removeChild(document.getElementById("bellring-icon")),t.jSPlugin.setPoster("")),t.removeBellRing(),t.miniRecCloseClick(),r||(t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),t.jSPlugin.play(),t.setDecoderState({play:!r})),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&&(A.setDecoderState({talk:!1}),A.jSPlugin.Talk.stopTalk()),r&&(A.jSPlugin.stop(),A.setDecoderState({play:!r})),t.rejectionStatusDispose(),t.remoteUnlockEle&&t.remoteUnlockEle.closeRemoteUnlock(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp")}),t.maxTalkTime)},c;case"remoteUnlock":return c.title="远程开锁",c.id=A,c.domString='
    \n
    \n \n 开锁\n \n \n \n \n \n
    \n
    远程开锁
    \n
    ',c.onclick=function(){var A=t.decoderState.state,e=A.isEditing;A.play;var i=A.rejection;if(e||"onBell"==t.bellStatus||i)return!1;t.switchFooter("remoteUnlock"),t.remoteUnlockEle=new FI(t.jSPlugin,t.switchFooter,t.videoWidth)},c;case"mute":return c.title="静音",c.id=A,c.domString='
    \n
    \n \n icon/静音\n \n \n \n \n \n
    \n
    静音
    \n
    ',c.onclick=function(){var A=t.decoderState.state,i=A.talk,n=A.sound;if(A.play,A.rejection)return!1;i?(t.setDecoderState({talk:!1,mute:!0},e.backgroundColor),t.jSPlugin.Talk.stopTalk(),t.jSPlugin.openSound()):(t.setDecoderState({talk:!0,mute:!1},e.backgroundColor),n&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),t.jSPlugin.Talk.startTalk())},c;case"hangUp":return c.title="挂断",c.id=A,c.domString='
    \n
    \n \n 挂断\n \n \n \n \n \n
    \n
    挂断
    \n
    ',c.onclick=function(){var A=t,e=t.decoderState.state,i=e.talk,n=e.play;if(e.rejection)return!1;i&&(t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk()),n&&(t.jSPlugin.stop(),t.setDecoderState({play:!n})),(n||i)&&(A.miniRecCloseClick(),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp"))},c;default:return c}},e.answerOvertime=function(){this.toastCustom.initToastContent("应答超时"),this.decoderState.state.play&&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")},e.rejectionStatusDispose=function(){var A=this,e=this.themeData.footer,t=document.getElementById(this.jSPlugin.id+"-audioControls"),i=document.getElementById(this.jSPlugin.id+"-audioControls-onCall"),n=document.getElementById(this.jSPlugin.id+"-audioControls-quickReplyBtn"),a=document.getElementById("header-"+this.bellStatus+"-ringStatus");"onBell"==this.bellStatus?(t.innerHTML="",n.innerHTML="",t.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),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})},e.userNoDevice=function(){var A=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var e=this.themeData.footer,t=document.getElementById(this.jSPlugin.id+"-audioControls"),i=document.getElementById(this.jSPlugin.id+"-audioControls-onCall"),n=document.getElementById(this.jSPlugin.id+"-audioControls-quickReplyBtn");"onBell"==this.bellStatus?(t.innerHTML="",n.innerHTML="",t.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),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})},e.renderHeader=function(A,e){var t=this,i=this.matchBtn(A,e);if(document.getElementById(this.jSPlugin.id+"-header-"+this.bellStatus+"-content")){var n=document.createElement("span");n.innerHTML=""+i.domString,document.getElementById(this.jSPlugin.id+"-header-"+this.bellStatus+"-content").appendChild(n)}else{var a=document.createElement("div");a.id=this.jSPlugin.id+"-header-"+this.bellStatus,a.style="max-width:50%;position:relative;",a.innerHTML='\n '+i.domString+"\n ",a.onclick=function(A){if(t.decoderState.state.isEditing)return!1;i.onclick(A)},document.getElementById(this.jSPlugin.id+"-headControl").childNodes[0].appendChild(a)}},e.renderFooter=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,r=document.createElement("div");if(r.className="theme-icon-item","quickReply"!==n.id&&(r.style="width:"+.66*a+"px;padding:0 "+.12*a+"px;box-sizing: content-box;-webkit-tap-highlight-color:transparent;"),r.innerHTML='
    '+n.domString+"
    ",r.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onclick(A)},n.onmouseenter&&(r.onmouseenter=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseenter(A)}),n.onmouseleave&&(r.onmouseleave=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseleave(A)}),"quickReply"!=A){var o=document.createElement("span");o.className="icon-move left",o.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ',o.onclick=function(){t.editIcon(n.id,"left","footer")},r.appendChild(o);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")},r.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")},r.appendChild(g)}"onCall"==this.bellStatus?document.getElementById(this.jSPlugin.id+"-audioControls-onCall").appendChild(r):(document.getElementById(this.jSPlugin.id+"-audioControls").appendChild(r),"quickReply"===n.id&&document.getElementById(this.jSPlugin.id+"-audioControls-quickReplyBtn").appendChild(r)),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))},e.switchFooter=function(A){var e=this.themeData.footer;switch(A){case"onBell":document.getElementById(this.jSPlugin.id+"-audioControls-onCall")?"none"==document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.display&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.display="flex",document.getElementById(this.jSPlugin.id+"-audioControls-quickReplyBtn").style.display="flex",document.getElementById(this.jSPlugin.id+"-btn-quickReply").style.display="flex"):(document.getElementById(this.jSPlugin.id+"-audioControls").style.display="flex",document.getElementById(this.jSPlugin.id+"-audioControls-quickReplyBtn").style.display="flex",document.getElementById(this.jSPlugin.id+"-btn-quickReply").style.display="flex");break;case"onCall":document.getElementById(this.jSPlugin.id+"-audioControls").style.display="none",document.getElementById(this.jSPlugin.id+"-btn-quickReply").style.display="none",document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.display="flex",this.themeData&&(document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.color=e[this.bellStatus].color)}},e.initThemeData=function(){var A=this,e=this.themeData,t=e.header,i=e.footer,n=this.decoderState.state.isEditing,a=this.videoWidth,r=a/375,o=1.8*a,s=this.jSPlugin.id;if(this.isNeedRenderHeader=Qd(t[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=Qd(i[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById(this.jSPlugin.id+"-headControl"))document.getElementById(this.jSPlugin.id+"-headControl").innerHTML="
    ";else{var l,c=document.createElement("div");c.setAttribute("id",this.jSPlugin.id+"-headControl"),c.setAttribute("class","header-controls"),c.innerHTML="
    ",this.jSPlugin.height;var d=((l={display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":.1*o+"px","align-items":"center","text-align":"center","font-size":"24ox"}).color="#2c2c2c",l["margin-top"]="6px",l);c.style=kI(d),document.getElementById(s+"-wrap").insertBefore(c,document.getElementById(s));var I=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(I)}),50)}else document.getElementById(this.jSPlugin.id+"-headControl")&&document.getElementById(this.jSPlugin.id+"-headControl").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-headControl"));if(this.jSPlugin.height,this.isNeedRenderFooter)if(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container"))document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.marginTop=.2*o+"px","onCall"==this.bellStatus?document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").innerHTML='\n \n \n \n \n \n ':document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").innerHTML='\n \n \n \n \n \n ');else{var C=document.createElement("div");C.setAttribute("id",this.jSPlugin.id+"-ez-iframe-footer-container"),C.setAttribute("class","ez-iframe-footer-container");var h={position:"relative","margin-top":.2*o+"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=kI(h),C.innerHTML='\n \n \n \n \n \n ',g(C,document.getElementById(s))}else document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container"));if(this.isNeedRenderHeader&&document.getElementById(this.jSPlugin.id+"-headControl")&&t[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderHeader(e.iconId,e)})),this.isNeedRenderFooter&&document.getElementById(this.jSPlugin.id+"-audioControls")&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.background=i[this.bellStatus].backgroundColor,document.getElementById(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 u=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(u),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()},e.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)},e.renderThemeData=function(){var A=this,e=this.themeData,t=e.header,i=e.footer,n=this.decoderState.state.isEditing;if(this.isNeedRenderHeader&&t&&(document.getElementById(this.jSPlugin.id+"-headControl").style.color=t[this.bellStatus].color.replace("-diy",""),t[this.bellStatus].btnList.map((function(e,t){var i;e.isrender&&A.setDecoderState(((i={})[e.iconId]=A.decoderState.state[e.iconId],i))}))),this.isNeedRenderFooter&&i)document.getElementById(this.jSPlugin.id+"-audioControls").style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById(this.jSPlugin.id+"-audioControls").style.color=i[this.bellStatus].color.replace("-diy",""),document.getElementById(this.jSPlugin.id+"-audioControls-onCall").style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(e,t){var i;e.isrender&&A.setDecoderState(((i={})[e.iconId]=A.decoderState.state[e.iconId],i));if(0==t&&!A.themeInited&&A.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),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(this.jSPlugin.id+"-wrap").addEventListener("click",(function(){A.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===c(this.jSPlugin.url).type,rec:"rec"===c(this.jSPlugin.url).type,type:c(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 r=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),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&&1==A.themeData.customConfig.miniWinRec&&(!A.deviceInfoData||A.deviceInfoData&&!A.deviceInfoData.isEncrypt)&&(A.miniRecNum=0,A.initMiniRec())}),1e3)},e.setThemeData=function(A,e){this.themeData=A,"onCall"==e&&(this.bellStatus="onCall")},e.startAutoFocus=function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById(A.jSPlugin.id+"-audioControls")&&(document.getElementById(A.jSPlugin.id+"-audioControls").style.opacity=0,document.getElementById(A.jSPlugin.id+"-audioControls").style.pointerEvents="none")}),1e3*e)},e.stopAutoFocus=function(){document.getElementById(this.jSPlugin.id+"-audioControls")&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.opacity=1,document.getElementById(this.jSPlugin.id+"-audioControls").style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()},e.editIcon=function(A,e,t){var i=this.themeData,n=this.themeData[t][this.bellStatus].btnList,a=Qd(n,(function(e){return e.iconId===A})),r=n[a];switch(e){case"delete":n[a].isrender=0;break;case"right":for(var o=-1,s=a+1;s=0;l--)if(n[l].part===n[a].part&&1==n[l].isrender){g=l;break}-1!==g&&(n[a]=n[g],n[g]=r)}i[t][this.bellStatus].btnList=n,this.jSPlugin.Theme.changeTheme(i)},e.countTime=function(A,e){void 0===e&&(e=0);var 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(this.jSPlugin.id+"-ez-iframe-footer-container")&&document.getElementById(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",r="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),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+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"))},e.editStart=function(A){var e=document.getElementById(this.jSPlugin.id+"-audioControls"),t=document.getElementById(this.jSPlugin.id+"-audioControls-onCall");document.getElementById(this.jSPlugin.id+"-headControl"),e&&e.setAttribute("class","footer-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})},e.editEnd=function(A){var e=document.getElementById(this.jSPlugin.id+"-audioControls"),t=document.getElementById(this.jSPlugin.id+"-headControl"),i=document.getElementById(this.jSPlugin.id+"-audioControls-onCall");t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")},e.fetchThemeData=function(A){var e=this;switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"miniRec":break;default:rI(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=RI,e.initThemeData(),e.renderThemeData())}),(function(){e.renderThemeData()}))}},e.getCallDeviceInfo=function(){var A=this;this.videoWidth,DI({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:c(this.jSPlugin.url).deviceSerial}).then((function(e){e.data&&(A.deviceInfoData=e.data,e.data.isEncrypt&&(A.miniRecCloseClick(),setTimeout((function(){A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),1e3)),document.getElementById("header-"+A.bellStatus+"-deviceCategory")&&(document.getElementById("header-"+A.bellStatus+"-deviceCategory").innerText=""+e.data.deviceName))})).catch((function(e){20018!=e.code||A.jSPlugin.isWebConsole||A.userNoDevice()}))},e.setHeaderText=function(A){var e=this.videoWidth/375||1;document.getElementById(this.jSPlugin.id+"-deviceCategory-content")&&(document.getElementById(this.jSPlugin.id+"-deviceCategory-content").innerHTML=''+A+''+(this.deviceInfoData&&this.deviceInfoData.category||"")+"")},A}();var NI=function(){function A(A){if(this.jSPlugin=A,this.videoWidth=A.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"===c(A.url).type,rec:"rec"===c(A.url).type,type:c(A.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!==A.isMobile&&(this.isMobile=A.isMobile),this.themeData={},"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.jSPlugin.themeId)if(this.isMobile?this.call=new PI(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState):this.call=new wI(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 Ud(this.jSPlugin)),a(this.jSPlugin.staticPath+"/speed/speed.css"),a(this.jSPlugin.staticPath+"/css/theme.css")}var e=A.prototype;return e.changeTheme=function(A,e,t){if(void 0===e&&(e=!0),void 0===t&&(t="onBell"),"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"==(void 0===A?"undefined":(i=A)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)&&(this.themeData=A,this.call.setThemeData(A,t),this.call.initThemeData(),this.call.renderThemeData(),this.decoderState.state.isEditing&&e&&this.call.editStart());var i;this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(A)},e.setDecoderState=function(A,e){var t=this,i=this.themeData;i.header,i.footer,Object.keys(A).map((function(i){if("mute"===i)document.getElementById(t.jSPlugin.id+"-icon-mute")&&(A[i]?(document.getElementById(t.jSPlugin.id+"-icon-mute").style.background=e,document.getElementById(t.jSPlugin.id+"-icon-mute").style.border=" 1px solid "+e,document.getElementById("icon-mute-path").style.fill="#ffffff"):(document.getElementById(t.jSPlugin.id+"-icon-mute").style.background="#ffffff",document.getElementById(t.jSPlugin.id+"-icon-mute").style.border="1px solid "+e,document.getElementById("icon-mute-path").style.fill=e));t.decoderState.state=Object.assign(t.decoderState.state,A)}))},e.startAutoFocus=function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById(A.jSPlugin.id+"-audioControls")&&(document.getElementById(A.jSPlugin.id+"-audioControls").style.opacity=0,document.getElementById(A.jSPlugin.id+"-audioControls").style.pointerEvents="none")}),1e3*e)},e.stopAutoFocus=function(){document.getElementById(this.jSPlugin.id+"-audioControls")&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.opacity=1,document.getElementById(this.jSPlugin.id+"-audioControls").style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()},e.toString=function(){return this.coreX+"-"+this.coreY},e.editIcon=function(A,e,t){var i=this.themeData,n=this.themeData[t].btnList,a=Qd(n,(function(e){return e.iconId===A})),r=n[a];switch(e){case"delete":if("rec"===A){if(-1===Qd(n,(function(A){return"cloudRec"===A.iconId&&1==A.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===A&&-1===Qd(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 o=-1,s=a+1;s=0;l--)if(n[l].part===n[a].part&&1==n[l].isrender){g=l;break}-1!==g&&(n[a]=n[g],n[g]=r)}i[t].btnList=n,this.changeTheme(i)},e.countTime=function(A,e){void 0===e&&(e=0);var 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(this.jSPlugin.id+"-ez-iframe-footer-container")&&document.getElementById(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",r="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),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+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"))},e.editStart=function(A){var e=document.getElementById(this.jSPlugin.id+"-audioControls"),t=document.getElementById(this.jSPlugin.id+"-audioControls-onCall"),i=document.getElementById(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})},e.editEnd=function(A){var e=document.getElementById(this.jSPlugin.id+"-audioControls"),t=document.getElementById(this.jSPlugin.id+"-headControl");t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})},e.setDisabled=function(A){},e.getDeviceInfo=function(){var A=this,e=this.videoWidth/1024||1;DI({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:c(this.jSPlugin.url).deviceSerial}).then((function(t){200==t.code&&t.data&&document.getElementById(A.jSPlugin.id+"-deviceCategory-content")&&(document.getElementById(A.jSPlugin.id+"-deviceCategory-content").style.maxWidth="100%",document.getElementById(A.jSPlugin.id+"-deviceCategory-content").style.overflow="hidden",document.getElementById(A.jSPlugin.id+"-deviceCategory-content").style.textOverflow="ellipsis",document.getElementById(A.jSPlugin.id+"-deviceCategory-content").style.whiteSpace="nowrap",document.getElementById(A.jSPlugin.id+"-deviceCategory-content").innerHTML='有人按门铃'+t.data.category+"")})).catch((function(A){}))},A}(),TI=function(){function A(A){this.jSPlugin=A;var e=window["EZUIKIT_TIMER_INTERVAL_"+A.id];e&&Object.keys(e).length>0&&this.resetTimer(),window["EZUIKIT_TIMER_INTERVAL_"+A.id]={}}var e=A.prototype;return e.createInterval=function(A,e,t){window["EZUIKIT_TIMER_INTERVAL_"+this.jSPlugin.id][A]=setInterval(e,t)},e.clearTimer=function(A){var e=window["EZUIKIT_TIMER_INTERVAL_"+this.jSPlugin.id];e[A]&&(clearInterval(e[A]),delete e[A])},e.resetTimer=function(){var A=window["EZUIKIT_TIMER_INTERVAL_"+this.jSPlugin.id];for(var e in A)clearInterval(A[e]),delete A[e]},A}(),MI=function(A){var e=this;this.initMap=function(){var A=e,t=e.videoWidth,i=e.videoHeight;if(document.getElementById(e.jSPlugin.id+"-miniRecbox"))document.getElementById(e.jSPlugin.id+"-wrap").removeChild(document.getElementById(e.jSPlugin.id+"-miniRecbox")),e.initMap();else{var n=document.createElement("div");n.id=e.jSPlugin.id+"-miniRecbox",n.style=";position: absolute; bottom:96px;right:"+e.jSPlugin.inspectVideoWidth+"px;",n.innerHTML='
    ',document.getElementById(e.jSPlugin.id+"-wrap").insertBefore(n,document.getElementById(e.jSPlugin.id+"-ez-iframe-footer-container")),A.map=A.loadMap(e.jSPlugin.id+"-mapbox")}return A.map},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},this.createCircle=function(A,t,i,n){var a=new BMapGL.Point(A,t),r=new BMapGL.Marker(a,{title:n});if(e.map.addOverlay(r),0!=i){var o=new BMapGL.Circle(new BMapGL.Point(A,t),i,{strokeColor:"#ff4d4f",strokeWeight:4,strokeOpacity:1,strokeStyle:"dashed",fillOpacity:0});e.map.addOverlay(o)}},this.createInspectPoints=function(A){A.map((function(A){e.createCircle(A.longitude,A.latitude,A.radius,A.inspectPointName)}))},this.createPolygon=function(A,t,i,n,a,r,o){void 0===t&&(t="#407AFF"),void 0===i&&(i="solid"),void 0===n&&(n=4),void 0===a&&(a=1),void 0===r&&(r="407AFF"),void 0===o&&(o=0);var s=[];A.split(";").map((function(A){var e=A.split(",");s.push(new BMapGL.Point(e[0],e[1]))})),e.inspectRange=new BMapGL.Polygon(s,{strokeColor:t,strokeWeight:n,strokeOpacity:a,strokeStyle:i,fillOpacity:o,fillColor:r}),e.map.addOverlay(e.inspectRange)},this.createTrack=function(A,t,i,n,a,r,o,s,g,l,c){void 0===t&&(t=!1),void 0===i&&(i="#18C796"),void 0===n&&(n="solid"),void 0===a&&(a=4),void 0===r&&(r=1),void 0===o&&(o=0),void 0===s&&(s=0),void 0===g&&(g=500),void 0===l&&(l=0),void 0===c&&(c=!1);var d=[];if(A.map((function(A){var t=!1;e.currentTrack.length>0&&e.currentTrack.map((function(e){e.longitude===A.longitude&&e.latitude===A.latitude&&e.reportTime===A.reportTime&&(t=!0)})),t||(0==d.length&&e.currentTrack.length>0&&d.push(new BMapGL.Point(e.currentTrack[e.currentTrack.length-1].longitude,e.currentTrack[e.currentTrack.length-1].latitude)),d.push(new BMapGL.Point(A.longitude,A.latitude)))})),0!=d.length){var I=new BMapGL.Polyline(d,{strokeColor:i,strokeWeight:a,strokeOpacity:r,strokeStyle:n,fillOpacity:o});if(t?(e.map.addOverlay(I),e.map.centerAndZoom(d[d.length-1],15)):(e.trackAni=new BMapGLLib.TrackAnimation(e.map,I,{overallView:c,tilt:s,duration:g,delay:l}),e.trackAni.start()),e.currentTrack=A,e.currentTrack.length>0&&e.currentTrack.length>0){var C=new BMapGL.Point(e.currentTrack[0].longitude,e.currentTrack[0].latitude);if(e.startPoint=new BMapGL.Marker(C,{icon:new BMapGL.Icon(e.jSPlugin.staticPath+"/imgs/start.png",new BMapGL.Size(32,47)),offset:new BMapGL.Size(0,-17)}),e.map.addOverlay(e.startPoint),1==e.currentTrack.length)return;var h=new BMapGL.Point(e.currentTrack[e.currentTrack.length-1].longitude,e.currentTrack[e.currentTrack.length-1].latitude);e.endPoint&&e.map.removeOverlay(e.endPoint),setTimeout((function(){e.endPoint=new BMapGL.Marker(h,{icon:new BMapGL.Icon(e.jSPlugin.staticPath+"/imgs/end.png",new BMapGL.Size(30,30))}),e.map.addOverlay(e.endPoint)}),t?0:g)}}},this.centerToTrack=function(A){void 0===A&&(A=15),e.currentTrack.length>0&&(1==e.currentTrack.length?e.map.centerAndZoom(new BMapGL.Point(e.currentTrack[0].longitude,e.currentTrack[0].latitude),A):e.map.centerAndZoom(new BMapGL.Point(e.currentTrack[e.currentTrack.length-1].longitude,e.currentTrack[e.currentTrack.length-1].latitude),A))},this.jSPlugin=A,this.videoWidth=A.width,this.videoHeight=A.height,this.toastCustom=new fI(A,!1),this.currentTrack=[],this.startPoint=null,this.endPoint=null,this.trackAni=null,this.inspectRange=null,this.map=this.initMap()},LI=function(A){var e=this;this.init=function(){var A=e;if(e.videoWidth,e.videoHeight,document.getElementById(e.jSPlugin.id+"-inspect-global-box"))document.getElementById(e.jSPlugin.id+"-inspect-global-box")&&document.getElementById(e.jSPlugin.id+"-wrap").removeChild(document.getElementById(e.jSPlugin.id+"-inspect-global-box")),A.init();else{var t=document.createElement("div");t.id=e.jSPlugin.id+"-inspect-global-box",t.style=";position: absolute; left:0; top: 0; width: 100%; height: 100%; z-index: 10000; background: #fff;",t.innerHTML='
    \n
    \n
    \n
    加载中…
    \n
    \n ',document.getElementById(e.jSPlugin.id+"-wrap").appendChild(t)}},this.deviceErrorInfo=function(A,t){var i=Object.assign({tips:"",refreshBtn:"",refreshShow:!1},A);if(document.getElementById(e.jSPlugin.id+"-no-inspect-box"))document.getElementById(e.jSPlugin.id+"-no-inspect-box")&&document.getElementById(e.jSPlugin.id+"-inspect-global-box").removeChild(document.getElementById(e.jSPlugin.id+"-no-inspect-box")),e.deviceErrorInfo(A,t);else{e.videoHeight;var n=document.createElement("div");n.id=e.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
    '+i.tips+'
    \n \n
    \n ",document.getElementById(e.jSPlugin.id+"-inspect-global-box").appendChild(n),document.getElementById(e.jSPlugin.id+"-inspect-device-status-refresh").addEventListener("click",(function(){t&&t()}))}},this.globalContainerToggle=function(A,e){document.getElementById(A)&&(document.getElementById(A).style.display=e?"flex":"none")},this.jSPlugin=A,this.videoWidth=A.width,this.videoHeight=A.height,this.toastCustom=new fI(A,!1),this.init()};function GI(){return GI=Object.assign||function(A){for(var e=1;e\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t'+("warning"===A?'':"")+"\n\t\t\t\t\t\t"+("info"===A?'':"")+"\n\t\t\t\t\t\t"+("error"===A?'':"")+"\n\t\t\t\t\t\t"+("success"===A?'':"")+"\n\t\t\t\t\t\n\t\t\t\t\t"+e+"\n\t\t\t\t
    \n\t\t\t
    \n\t\t\t",t.appendChild(i)},A}();function UI(){return UI=Object.assign||function(A){for(var e=1;e
    \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)}))},e.initImage=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)},e.initPreview=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()}},A}();function HI(){return HI=Object.assign||function(A){for(var e=1;e\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'+(a?'
    '+a+"
    ":"")+'\n\t\t\t\t\t\t
    '+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(o),this.renderPopover(o,r,n)}document.body.addEventListener("click",(function(e){A.addEventListenerFn(e)}))}},e.addEventListenerFn=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()},e.hidePopover=function(){var A=this.params.id,e=document.getElementById(A+"-popover");e&&document.body.removeChild(e)},e.renderPopover=function(A,e,t,i,n){A.style.display="block";var a=e.getBoundingClientRect(),r=a.top,o=a.left,s=a.width,g=a.height,l=A.getBoundingClientRect(),c=l.width,d=l.height;i&&(c=i),n&&(d=n);var I=document.body;this.params.parentNodeId&&(I=document.getElementById(this.params.parentNodeId));var C=this.params.arrowPointAtCenter,h=0,u=0,B=A.getElementsByClassName("ezuikit-popover-arrow")[0],E=B.getBoundingClientRect(),f=E.width,Q=E.height;if(C){var x=0,p=0;switch(t){case"top":default:x=c/2,p=d;break;case"bottom":x=c/2,p=0;break;case"left":x=c,p=d/2;break;case"right":x=0,p=d/2;break;case"topLeft":x=(s-f)/2,p=d;break;case"topRight":x=c-(s+f)/2,p=d;break;case"bottomLeft":x=(s-f)/2,p=0;break;case"bottomRight":x=c-(s+f)/2,p=0;break;case"leftTop":x=c,p=(g-Q)/2;break;case"leftBottom":x=c,p=d-(g+Q)/2;break;case"rightTop":x=0,p=(g-10)/2;break;case"rightBottom":x=0,p=d-(g+Q)/2}B.style.left=x+"px",B.style.top=p+"px"}switch(t){case"top":h=-(d+Q),u=(s-c)/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top");break;case"bottom":h=g-Q/2,u=(s-c)/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottom");break;case"left":h=(g-d)/2,u=-(c+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-left");break;case"right":h=(g-d)/2,u=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-right");break;case"topLeft":h=-(d+Q),u=0,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topLeft");break;case"topRight":h=-(d+Q),u=s-c,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topRight");break;case"bottomLeft":h=g-Q/2,u=0,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomLeft");break;case"bottomRight":h=g-Q/2,u=s-c,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomRight");break;case"leftTop":h=0,u=-(c+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftTop");break;case"leftBottom":h=g-d,u=-(c+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftBottom");break;case"rightTop":h=0,u=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightTop");break;case"rightBottom":h=g-d,u=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightBottom");break;default:h=-d,u=(s-c)/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=r+m+h+"px",A.style.left=o+y+u+"px";var _=A.getBoundingClientRect(),S=I===document.body?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:I.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,c,d)},A}();function VI(){return VI=Object.assign||function(A){for(var e=1;e\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,o.querySelector(".ezuikit-popover-buttons").appendChild(s),o.querySelector(".ezuikit-popover-buttons").appendChild(g),this.PopconfirmDom=new KI(VI({},this.params,{content:o.innerHTML})),document.getElementById(this.params.id+"-popover").querySelector(".ezuikit-cancel-btn")&&(document.getElementById(this.params.id+"-popover").querySelector(".ezuikit-cancel-btn").onclick=function(){a?a():A.hide()}),document.getElementById(this.params.id+"-popover").querySelector(".ezuikit-ok-btn")&&(document.getElementById(this.params.id+"-popover").querySelector(".ezuikit-ok-btn").onclick=function(){r?r():A.hide()}),this.PopconfirmDom},e.hide=function(){this.PopconfirmDom.hidePopover()},A}();function jI(){return jI=Object.assign||function(A){for(var e=1;e\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)}))},e.initVideo=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)},e.initPreview=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()}},A}(),ZI=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:e,page:0},a=A.env.domain+"/api/service/devicekit/bodycamera/device/trace";QI(a,"GET",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},XI=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:c(A.url).deviceSerial,validateCode:c(A.url).validCode,channelNo:c(A.url).channelNo,evidenceFileType:e},a=A.env.domain+"/api/service/devicekit/common/file/evidence";QI(a,"POST",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},qI=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,taskId:e},a=A.env.domain+"/api/service/devicekit/opencloud/task/info";QI(a,"GET",n,(function(A){t&&t(A)}),(function(A){}),{"Content-Type":"application/x-www-form-urlencoded"})};var zI=function(){function A(A,e,t,i,n){void 0===e&&(e={}),void 0===n&&(n=function(){}),this.jSPlugin=A,this.currentEventInfo=e,this.inspectInfo=A.Theme.inspect.inspectInfo,this.type=i,this.timer=t,this.startTime=1e3,this.videoRecordingStatus=!0,this.saveSuccessCallback=n,this.init()}var e=A.prototype;return e.init=function(){this.renderEventDetail(),this.eventDetailDomEvent()},e.show=function(){document.getElementById(this.jSPlugin.id+"-inspect-event-detail-wrap").setAttribute("class","inspect-event-detail-wrap show")},e.hide=function(){document.getElementById(this.jSPlugin.id+"-inspect-event-detail-wrap").setAttribute("class","inspect-event-detail-wrap"),document.getElementById(this.jSPlugin.id+"-inspect-event-detail-box").innerHTML=""},e.validationEventTag=function(){return 0==document.getElementById(this.jSPlugin.id+"-event-tag").value.length?(document.getElementById(this.jSPlugin.id+"-event-tag-error").style.display="block",document.getElementById(this.jSPlugin.id+"-event-tag-error").innerHTML="请输入事件标签",document.getElementById(this.jSPlugin.id+"-event-tag").setAttribute("class","ezuikit-input input-has-error"),!1):(document.getElementById(this.jSPlugin.id+"-event-tag-error").style.display="none",document.getElementById(this.jSPlugin.id+"-event-tag").setAttribute("class","ezuikit-input"),!0)},e.renderVideo=function(A,e,t){var i=this;if(document.getElementById(this.jSPlugin.id+"-inspectEventDetail-videoPreview").innerHTML="",1===A||2===A){if(document.getElementById(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(){qI(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||i.jSPlugin.staticPath+"/imgs/bg.svg";i.renderVideo(t,a,n)}}))}),1e3)}}else 4===A||5===A||6===A||7===A?(document.getElementById(this.jSPlugin.id+"-inspectEventDetail-videoPreview").innerHTML='\n
    \n
    \n \n
    \n 视频存储失败\n
    \n ',this.timer.clearTimer("videoRecordingStatusTimer")):0!==A&&3!==A||(new WI({id:this.jSPlugin.id+"-inspectEventDetail-videoPreview",poster:e,fallback:this.jSPlugin.staticPath+"/imgs/bg.svg",src:t}),this.timer.clearTimer("videoRecordingStatusTimer"))},e.renderEventDetail=function(){var A=this,e=this.currentEventInfo,t=e.evidenceFileType,i=e.fileUrl,n=e.taskStatus,a=e.videoCoverPic,r=document.createElement("div");r.setAttribute("class","inspectEventDetail");var o="";if(o=1===t?a||this.jSPlugin.staticPath+"/imgs/bg.svg":i||this.jSPlugin.staticPath+"/imgs/bg.svg",r.innerHTML='\n
    \n
    \n \n
    \n
    '+(1===this.type?"编辑":"")+(0===t?"图片存证":"视频存证")+'
    \n
    \n
    \n '+(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(this.jSPlugin.id+"-inspect-event-detail-box").appendChild(r),1===this.type?document.getElementById(this.jSPlugin.id+"-inspectEventDetail-content-info-time").innerHTML=""+(1===t?this.currentEventInfo.eventBeginTime+" ~ "+this.currentEventInfo.eventEndTime:this.currentEventInfo.eventTime):(document.getElementById(this.jSPlugin.id+"-inspectEventDetail-content-info-time").innerHTML=(new Date).Format("yyyy-MM-dd hh:mm:ss")+(1===t?" ~ -":""),1===t&&document.getElementById(this.jSPlugin.id+"-video-recording-time")&&this.videoRecordingStatus&&(0===this.type&&document.getElementById(this.jSPlugin.id+"-event-ok").setAttribute("disabled","disabled"),this.timer.createInterval("videoRecordingTimer",(function(){var e,t,i,n;A.startTime&&(document.getElementById(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"+t:t)+":"+(i<10?"0"+i:i)+":"+(n<10?"0"+n:n))),A.startTime+=1e3,A.startTime>A.jSPlugin.inspectRecordingDuration&&(document.getElementById(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,o,s)}else new JI({id:this.jSPlugin.id+"-inspectEventDetail-picUrl",src:o,fallback:this.jSPlugin.staticPath+"/imgs/fallback.svg",showIcon:!1});this.show()},e.eventDetailDomEvent=function(){var A=this,e=this.currentEventInfo,t=e.evidenceFileType,i=e.evidenceId;document.getElementById(this.jSPlugin.id+"-event-cancel").addEventListener("click",(function(e){A.cancelPopover=new OI({id:A.jSPlugin.id+"-event-cancel",content:"确定要取消吗?"+(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(A.jSPlugin.id+"-video-recording-stop-btn").click()),A.timer.clearTimer("videoRecordingStatusTimer")),A.cancelPopover.hide(),A.hide()}})})),document.getElementById(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,r=n.inspectPerson,o=document.getElementById(A.jSPlugin.id+"-inspectEventDetail-content-info-time").innerHTML,s={inspectRecordId:a,depositaryOfficer:r,evidenceFileId:i,evidenceFileType:t,eventType:document.getElementById(A.jSPlugin.id+"-event-tag").value,eventRemark:document.getElementById(A.jSPlugin.id+"-event-remark").value};1===t&&(s.eventBeginTime=o.split("~")[0].trim(),s.eventEndTime=o.split("~")[1].trim(),A.timer.clearTimer("videoRecordingStatusTimer")),0===t&&(s.eventTime=o),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),r=A.env.domain+"/api/service/devicekit/bodycamera/inspect/event/update";QI(r,"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 YI({type:"error",content:"保存失败,"+(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById(A.jSPlugin.id+"-inspect-event-box"),top:40})}),(function(){new YI({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById(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),r=A.env.domain+"/api/service/devicekit/bodycamera/inspect/event";QI(r,"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 YI({type:"error",content:"保存失败,"+(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById(A.jSPlugin.id+"-inspect-event-box"),top:40})}),(function(){new YI({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById(A.jSPlugin.id+"-inspect-event-box"),top:40})}))}})),document.getElementById(this.jSPlugin.id+"-inspectEventDetail-back").addEventListener("click",(function(){A.backPopover=new OI({id:A.jSPlugin.id+"-inspectEventDetail-back",content:"确定要返回吗?"+(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(A.jSPlugin.id+"-video-recording-stop-btn").click()),A.timer.clearTimer("videoRecordingStatusTimer")),A.backPopover.hide(),A.hide()}})})),document.getElementById(this.jSPlugin.id+"-video-recording-stop-btn")&&document.getElementById(this.jSPlugin.id+"-video-recording-stop-btn").addEventListener("click",(function(){document.getElementById(A.jSPlugin.id+"-video-recording-stop-btn").setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn ezuikit-btn-loading"),document.getElementById(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=A.env.domain+"/api/v3/open/cloud/video/frame/stop";QI(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(A.jSPlugin.id+"-video-recording-stop-btn")&&(document.getElementById(A.jSPlugin.id+"-video-recording-stop-btn").setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById(A.jSPlugin.id+"-video-recording-stop-btn").querySelector(".ezuikit-btn-loading-icon").style.display="none"),e.meta&&200===e.meta.code?qI(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 r=a||A.jSPlugin.staticPath+"/imgs/bg.svg";A.renderVideo(i,r,n),document.getElementById(A.jSPlugin.id+"-inspectEventDetail-content-video-info").style.display="block",document.getElementById(A.jSPlugin.id+"-inspectEventDetail-content-video-timer").style.display="none";var o=document.getElementById(A.jSPlugin.id+"-inspectEventDetail-content-info-time").innerHTML;document.getElementById(A.jSPlugin.id+"-inspectEventDetail-content-info-time").innerHTML=o.split("~")[0]+" ~ "+(new Date).Format("yyyy-MM-dd hh:mm:ss"),A.videoRecordingStatus=!1,document.getElementById(A.jSPlugin.id+"-event-ok").removeAttribute("disabled")}})):new YI({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById(A.jSPlugin.id+"-inspect-event-box"),top:40})}),(function(){document.getElementById(A.jSPlugin.id+"-video-recording-stop-btn")&&(document.getElementById(A.jSPlugin.id+"-video-recording-stop-btn").setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById(A.jSPlugin.id+"-video-recording-stop-btn").querySelector(".ezuikit-btn-loading-icon").style.display="none"),new YI({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById(A.jSPlugin.id+"-inspect-event-box"),top:40})}))})),document.getElementById(this.jSPlugin.id+"-event-tag").addEventListener("input",(function(){A.validationEventTag()})),document.getElementById(this.jSPlugin.id+"-event-remark").addEventListener("input",(function(A){var e=A.target.value;A.target.parentNode.setAttribute("data-count",e.length+" / 100")})),document.getElementById(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(this.jSPlugin.id+"-event-remark").addEventListener("blur",(function(A){A.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count")}))},A}(),$I=function(){function A(A,e,t){var i=this;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(i.jSPlugin.id+"-wrap").appendChild(e),i.jSPlugin.Theme.decoderState.state.play?i.enableEvidenceBtn():i.disableEvidenceBtn(),document.getElementById(i.jSPlugin.id+"-inspect-event-img").onclick=function(){i.listLoading||i.startEvidence||(i.startEvidence=!0,i.hideDelEConfirm(),document.getElementById(i.jSPlugin.id+"-inspect-event-img").setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById(i.jSPlugin.id+"-inspect-event-img").querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",XI(i.jSPlugin,0,(function(A){i.startEvidence=!1,document.getElementById(i.jSPlugin.id+"-inspect-event-img").setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById(i.jSPlugin.id+"-inspect-event-img").querySelector(".ezuikit-btn-loading-icon").style.display="none",A.meta&&200===A.meta.code?new zI(i.jSPlugin,A.data,i.timer,0,(function(){i.initEvent(),new YI({type:"success",content:"保存成功",wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})})):new YI({type:"error",content:"图片存证失败,"+(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})}),(function(){i.startEvidence=!1,document.getElementById(i.jSPlugin.id+"-inspect-event-img").setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById(i.jSPlugin.id+"-inspect-event-img").querySelector(".ezuikit-btn-loading-icon").style.display="none",new YI({type:"error",content:"图片存证失败,请稍后重试!",wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})})))},document.getElementById(i.jSPlugin.id+"-inspect-event-video").onclick=function(){i.listLoading||i.startEvidence||(i.startEvidence=!0,i.hideDelEConfirm(),document.getElementById(i.jSPlugin.id+"-inspect-event-video").setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById(i.jSPlugin.id+"-inspect-event-video").querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",XI(i.jSPlugin,1,(function(A){i.startEvidence=!1,document.getElementById(i.jSPlugin.id+"-inspect-event-video").setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById(i.jSPlugin.id+"-inspect-event-video").querySelector(".ezuikit-btn-loading-icon").style.display="none",A.meta&&200===A.meta.code?new zI(i.jSPlugin,A.data,i.timer,0,(function(){i.initEvent(),new YI({type:"success",content:"保存成功",wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})})):new YI({type:"error",content:"视频存证失败,"+(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})}),(function(){i.startEvidence=!1,document.getElementById(i.jSPlugin.id+"-inspect-event-video").setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById(i.jSPlugin.id+"-inspect-event-video").querySelector(".ezuikit-btn-loading-icon").style.display="none",new YI({type:"error",content:"视频存证失败,请稍后重试!",wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})})))},document.getElementById(i.jSPlugin.id+"-inspect-event-list-refresh").onclick=function(){i.listLoading||i.startEvidence||(i.hideDelEConfirm(),document.getElementById(i.jSPlugin.id+"-inspect-loading").style.display="block",document.getElementById(i.jSPlugin.id+"-inspect-event-list-wrap").style.display="none",document.getElementById(i.jSPlugin.id+"-inspect-event-list-nodata-wrap").style.display="none",A.initEvent())}}},this.renderList=function(A){document.getElementById(i.jSPlugin.id+"-inspect-loading").style.display="none";var e=A.data||[];if(e.length>0){var t=function(t){var n=document.createElement("div");n.setAttribute("class","inspect-event-item");var a=e[t];n.setAttribute("id",i.jSPlugin.id+"-inspect-event-item-"+a.inspectEventId),n.innerHTML="",document.getElementById(i.jSPlugin.id+"-inspect-event-list-wrap-main").appendChild(n);var r=document.createElement("div");r.setAttribute("class","inspect-event-item-header-wrap");var o=void 0;1==a.evidenceFileType&&(o=a.eventBeginTime.split(" ")[1]+"~"+a.eventEndTime.split(" ")[1]),0==a.evidenceFileType&&(o=""+a.eventTime.split(" ")[1]);var s="";1===a.evidenceFileType&&(1===a.taskStatus||2===a.taskStatus?s="storage":4===a.taskStatus||5===a.taskStatus||6===a.taskStatus||7===a.taskStatus?s="storage-error":0!==a.taskStatus&&3!==a.taskStatus||(s="storage-success")),r.innerHTML='\n
    \n
    \n \n \n \n \n \n \n \n \n \n '+(o||"-")+'\n
    \n
    \n \n \n \n \n
    \n
    \n ',n.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",n.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",n.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 l=(1===a.evidenceFileType?a.videoCoverPic:a.fileUrl)||i.jSPlugin.staticPath+"/imgs/bg.svg";g.innerHTML='\n
    \n
    \n
    \n '+a.eventType+"\n
    \n
    \n ",n.appendChild(g),1==a.evidenceFileType&&(1===a.taskStatus||2===a.taskStatus?document.getElementById(i.jSPlugin.id+"-inspect-view-"+a.inspectEventId).innerHTML='\n
    \n
    \n
    \n
    \n 视频正在存储中…\n
    \n ':4===a.taskStatus?document.getElementById(i.jSPlugin.id+"-inspect-view-"+a.inspectEventId).innerHTML='\n
    \n
    \n \n
    \n 视频存储失败\n
    \n ':0!==a.taskStatus&&3!==a.taskStatus||new WI({id:i.jSPlugin.id+"-inspect-view-"+a.inspectEventId,src:a.fileUrl,poster:l,fallback:i.jSPlugin.staticPath+"/imgs/bg.svg"})),0==a.evidenceFileType&&new JI({id:i.jSPlugin.id+"-inspect-view-"+a.inspectEventId,src:l,fallback:i.jSPlugin.staticPath+"/imgs/bg.svg",showIcon:!1});var c=document.createElement("div");c.setAttribute("class","inspect-event-item-body-info-opr");var d=document.createElement("span");d.setAttribute("class","inspect-event-item-body-info-opr-icon"),d.innerHTML='\n \n ',c.appendChild(d);var I=document.createElement("span");I.setAttribute("class","inspect-event-item-body-info-opr-icon"),I.id=i.jSPlugin.id+"-inspect-event-del-"+a.inspectEventId,I.innerHTML=' \n \n ',c.appendChild(I),d.onclick=function(A){i.startEvidence||new zI(i.jSPlugin,a,i.timer,1,(function(A){new YI({type:"success",content:"保存成功",wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40}),a=Object.assign(a,A),document.getElementById(i.jSPlugin.id+"-inspect-event-item-"+a.inspectEventId).querySelector(".inspect-event-item-body-info-tag-label").innerHTML=a.eventType,document.getElementById(i.jSPlugin.id+"-inspect-event-item-"+a.inspectEventId).querySelector(".inspect-event-item-body-info-tag-label").setAttribute("title",a.eventType)}))},I.onclick=function(A){i.startEvidence||(i.delE=new OI({id:i.jSPlugin.id+"-inspect-event-del-"+a.inspectEventId,content:"确定要删除该事件吗?",placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){i.delE.hide()},onConfirm:function(){!function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectEventId:""},a=Object.assign(n,e),r=A.env.domain+"/api/service/devicekit/bodycamera/inspect/event/delete";QI(r,"POST",a,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(i.jSPlugin,{inspectEventId:a.inspectEventId},(function(A){A.meta&&200===A.meta.code?(i.delE.hide(),i.initEvent(),setTimeout((function(){new YI({type:"success",content:"删除成功",wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})}),10)):new YI({type:"error",content:"删除失败,"+(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})}),(function(){new YI({type:"error",content:"删除失败,请稍后重试!",wrapNode:document.getElementById(i.jSPlugin.id+"-inspect-event-box"),top:40})}))}}),i.delEConfirmList.push(i.delE))},n.querySelector(".inspect-event-item-body-info").appendChild(c),document.getElementById(i.jSPlugin.id+"-inspect-event-list-wrap").onscroll=function(e){var t=e.target;i.hideDelEConfirm(),t.scrollTop+t.offsetHeight>=t.scrollHeight-48&&!i.listLoading&&(A.start+1)*A.size\n \n ',t.onclick=function(A){setTimeout((function(){e.inspectMapWin.centerToTrack(18)}),100)},A.getContainer().appendChild(t),t},new A},this.initSwithcBtn=function(){var A=document.createElement("div");A.id=a.jSPlugin.id+"-miniSwitch",A.style="cursor: pointer;position: absolute; bottom: 106px; right: "+(a.jSPlugin.inspectVideoWidth+10)+"px; z-index: 999;",A.innerHTML="
    \n \n 大小窗切换\n \n \n \n \n \n
    ',document.getElementById(a.jSPlugin.id+"-wrap").appendChild(A),document.getElementById(a.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 ol(t)&&(i="leading"in t?!!t.leading:i,n="trailing"in t?!!t.trailing:n),Ed(A,e,{leading:i,maxWait:e,trailing:n})}((function(){return a.miniRecSwitchClick()}),1e3)()}},this.initMiniWinToggleBtn=function(){var A=.3333*a.videoWidth,e=.3333*a.videoHeight,t=document.createElement("div");t.id=a.jSPlugin.id+"-miniToggle",t.style="cursor: pointer;position: absolute; bottom: "+(e/2+96-30)+"px; right: "+(a.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(a.jSPlugin.id+"-wrap").appendChild(t),document.getElementById(a.jSPlugin.id+"-miniToggle").onclick=function(){a.miniWinToggleClick()}},this.init=function(){a.initSwithcBtn(),a.initMiniWinToggleBtn()},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=A,this.inspectMode=e,this.inspectMapWin=t,this.changeInspectMode=i,this.videoWidth=A.width,this.videoHeight=A.height,this.minWinStatus="open",this.decoderState=n,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()}var e=A.prototype;return e.miniWinToggleClick=function(){var A=.3333*this.jSPlugin.width;"open"===this.minWinStatus?(this.setStyleListByIds([{id:"video"===this.inspectMode?this.jSPlugin.id+"-mapbox":""+this.jSPlugin.id,styleList:{width:"0px"}},{id:this.jSPlugin.id+"-miniSwitch",styleList:{display:"none"}},{id:this.jSPlugin.id+"-miniToggle",styleList:{right:this.jSPlugin.inspectVideoWidth+"px"}},{id:this.jSPlugin.id+"-min-win-close-icon",styleList:{display:"none"}},{id:this.jSPlugin.id+"-min-win-open-icon",styleList:{display:"inline-block"}}]),this.minWinStatus="close"):(this.setStyleListByIds([{id:"video"===this.inspectMode?this.jSPlugin.id+"-mapbox":""+this.jSPlugin.id,styleList:{width:A+"px"}},{id:this.jSPlugin.id+"-miniSwitch",styleList:{display:"block"}},{id:this.jSPlugin.id+"-miniToggle",styleList:{right:this.jSPlugin.inspectVideoWidth+A+"px"}},{id:this.jSPlugin.id+"-min-win-close-icon",styleList:{display:"inline-block"}},{id:this.jSPlugin.id+"-min-win-open-icon",styleList:{display:"none"}}]),this.minWinStatus="open")},e.miniRecSwitchClick=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:this.jSPlugin.id+"-mapbox",styleList:{width:this.jSPlugin.width+"px",height:this.jSPlugin.height+"px",marginBottom:"-40px"}},{id:this.jSPlugin.id+"-ez-iframe-footer-container",styleList:{top:this.jSPlugin.height+"px"}},{id:""+this.jSPlugin.id,styleList:{position:"absolute",zIndex:"100",bottom:"96px",right: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(this.jSPlugin.id+"-loading-item-btn-wrap")&&this.setStyleListByIds([{id:this.jSPlugin.id+"-loading-item-btn",styleList:{display:"none"}},{id:this.jSPlugin.id+"-loading-item-btn-svg",styleList:{display:"block"}},{id:this.jSPlugin.id+"-loading-item-btn-wrap",styleList:{border:"none",width:"32px",height:"14px"}}]),setTimeout((function(){A.inspectMapWin.centerToTrack(18)}),100)):(this.setStyleListByIds([{id:this.jSPlugin.id+"-mapbox",styleList:{width:e+"px",height:t+"px",marginBottom:"0"}},{id:this.jSPlugin.id+"-ez-iframe-footer-container",styleList:{top:"0px"}},{id:""+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(this.jSPlugin.id+"-loading-item-btn-wrap")&&this.setStyleListByIds([{id:this.jSPlugin.id+"-loading-item-btn",styleList:{display:"block"}},{id:this.jSPlugin.id+"-loading-item-btn-svg",styleList:{display:"none"}},{id: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:this.jSPlugin.id+"-wrap",styleList:{width:this.jSPlugin.width+this.jSPlugin.inspectVideoWidth+"px",height:this.jSPlugin.height+this.jSPlugin.inspectVideoHeight+"px"}}])},A}(),eC={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:"rgba(0,0,0,0.8)",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"}]}};function tC(A,e,t){return e&&function(A,e){for(var t=0;t2.0X\n
    \n \n \n '+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 '+this.jSPlugin.i18n.t("ZOOM_SUB")+'\n \n \n \n \n \n \n \n \n \n \n
    \n \n ';t.innerHTML=r,document.getElementById(A.id+"-audioControls-left")&&(document.getElementById(A.id+"-audioControls-left").parentNode.appendChild(t),document.getElementById(A.id+"-addScale").onclick=function(){e.addScale()},document.getElementById(A.id+"-subScale").onclick=function(){e.subScale()}),this._event()}var e=A.prototype;return e._event=function(){var A=this,e=setInterval((function(){var t=document.getElementById(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)},e.onMouseDown=function(A){if(1===this.currentScale)return!1;this.moveX=A.clientX,this.moveY=A.clientY},e.onMouseUp=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()},e.onTouchstart=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}},e.onTouchend=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()},e.renderDot=function(){var A=this.currentScale;document.getElementById(this.jSPlugin.id+"-scale-value")&&(document.getElementById(this.jSPlugin.id+"-scale-value").innerHTML=A+".0X"),document.getElementById(this.jSPlugin.id+"-line-dot")&&(document.getElementById(this.jSPlugin.id+"-line-dot").style.height=(A-1)/7*100+"%"),document.getElementById(this.jSPlugin.id+"-scale-body-line-dot")&&(document.getElementById(this.jSPlugin.id+"-scale-body-line-dot").style.bottom="calc("+(A-1)/7*100+"% - 3px)")},e.getTopMostElement=function(A,e,t){var i,n=A?A.getBoundingClientRect():null,a=e?e.getBoundingClientRect():null,r=t?t.getBoundingClientRect():null;if(!n&&!a&&!r)return null;if(!n)return a.top1?1.25:.75),e.right=e.right*n*(n>1?1.25:.75),this.info.width=i.width,this.videoWidth=i.width*(n>1.25?1:.75)*this.dpr}if(i.height!=this.info.height){var a=parseFloat(i.height/this.info.height);e.top=e.top*a*(a>1?1.25:.75),e.bottom=e.bottom*a*(a>1?1.25:.75),this.info.height=i.height,this.videoHeight=i.height*(a>1?1.25:.75)*this.dpr}e.left=e.left+.5*(e.right-e.left-this.videoWidth/t),e.left<=0?e.left=0:e.left>this.videoWidth-this.videoWidth/t&&(e.left=this.videoWidth-this.videoWidth/t),e.right=e.left+this.videoWidth/t,e.top=e.top+.5*(e.bottom-e.top-this.videoHeight/t),e.top<=0?e.top=0:e.top>this.videoHeight-this.videoHeight/t&&(e.top=this.videoHeight-this.videoHeight/t),e.bottom=e.top+this.videoHeight/t,e.left=parseInt(e.left,10),e.right=parseInt(e.right,10),e.top=parseInt(e.top,10),e.bottom=parseInt(e.bottom,10);try{e.left=8?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_ADD_MAX"),document.getElementById(""+this.jSPlugin.id)),!1):(this.currentScale=this.currentScale+A,this.currentScale>8?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MAX"),document.getElementById(""+this.jSPlugin.id)),!1):void this.doScale())},e.subScale=function(A){return void 0===A&&(A=1),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(""+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(""+this.jSPlugin.id)),!1):void this.doScale())},e._JSPlayM4_SetDisplayRegion=function(A,e,t,i,n){this.jSPlugin&&this.jSPlugin.jSPlugin&&this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(A,e,t,i,n,this.isMobileFullScreen)},tC(A,[{key:"isMobileFullScreen",get:function(){return!!(C()&&this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state.expend)}}]),A}(),nC=function(A){var e="";return Object.keys(A).map((function(t,i){e+=t+":"+A[t]+(i\n \n ':""+A+"":null},e.renderBatteryStatus=function(A){return A&&0!=A?'\n
    \n '+A+'%\n
    \n
    \n
    \n \n \n \n
    \n ':null},e.renderInspectTime=function(A){if(!A)return null;var e,t,i,n,a=A.split(" "),r=a[0].split("-"),o=a[1].split(":"),s=new Date(r[0],r[1]-1,r[2],o[0],o[1],o[2]),g=(new Date).getTime()-new Date(s).getTime();return'\n \n '+(e=g,t=parseInt(e%864e5/36e5),i=parseInt(e%36e5/6e4),n=parseInt(e%6e4/1e3),(t<10?"0"+t:t)+":"+(i<10?"0"+i:i)+":"+(n<10?"0"+n:n)+"\n ")},e.matchBtn=function(A,e){var t=this,i=this.themeData,n=i.customConfig,a=i.header,r=i.footer,o=n.inspectInfo,s={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}},g=o.btnList.findIndex((function(e){return e.iconId===A}));switch(-1!==g?(s.color=o.color,s.backgroundColor=o.backgroundColor,s.activeColor=o.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=r.color,s.backgroundColor=r.backgroundColor,s.activeColor=r.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){t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk();var n=Qd(t.themeData.footer.btnList,(function(A){return"sound"===A.iconId&&1===A.isrender&&1===A.defaultActive}))>-1;t.themeData&&n&&t.jSPlugin.openSound()}else 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}},e.renderInspectInfo=function(A,e){var t=this.matchBtn(A,e),i=document.createElement("sapn");i.innerHTML=""+t.domString,"left"===e.part?document.getElementById(this.jSPlugin.id+"-inspectInfoControl-left").appendChild(i):document.getElementById(this.jSPlugin.id+"-inspectInfoControl-right").appendChild(i)},e.renderHeader=function(A,e){var t=this.matchBtn(A,e),i=document.createElement("span");i.className=this.jSPlugin.id+"-header-content",i.style="display: flex; align-items: center; ",i.innerHTML="\n "+t.domString+"\n ","left"===e.part?document.getElementById(this.jSPlugin.id+"-headControl-left").appendChild(i):document.getElementById(this.jSPlugin.id+"-headControl-right").appendChild(i)},e.renderFooter=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 "+.1*n+"px;":a.style="padding:0 "+.1*n+"px;cursor: pointer;",a.innerHTML='
    '+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(this.jSPlugin.id+"-audioControls").appendChild(a)},e.initThemeData=function(){var A=this,e=this.themeData,t=e.customConfig,i=e.header,n=e.footer,a=t.inspectInfo,r=this.jSPlugin.id;if(this.isNeedRenderInspectInfo=Qd(a.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderHeader=Qd(i.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=Qd(n.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderInspectInfo)if(document.getElementById(this.jSPlugin.id+"-inspectInfoControl"))document.getElementById(this.jSPlugin.id+"-inspectInfoControl").innerHTML="
    ";else{var o=document.createElement("div");o.setAttribute("id",this.jSPlugin.id+"-inspectInfoControl"),o.setAttribute("class","inspectInfo-controls"),o.innerHTML="
    ";var s={height:"58px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#000000",width:this.jSPlugin.width+290+"px",position:"relative","align-items":"center",background:"#ffffff","border-bottom":"1px solid #D9D9D9","box-sizing":"border-box"};o.style=nC(s),document.getElementById(r+"-wrap").insertBefore(o,document.getElementById(this.jSPlugin.id));var l=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(l)}),50)}else document.getElementById(this.jSPlugin.id+"-inspectInfoControl")&&document.getElementById(this.jSPlugin.id+"-inspectInfoControl").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-inspectInfoControl"));if(this.isNeedRenderHeader)if(document.getElementById(this.jSPlugin.id+"-headControl"))document.getElementById(this.jSPlugin.id+"-headControl").innerHTML="
    ";else{var c=document.createElement("div");c.setAttribute("id",this.jSPlugin.id+"-headControl"),c.setAttribute("class","header-controls"),c.innerHTML="
    ";var d={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=nC(d),document.getElementById(r+"-wrap").insertBefore(c,document.getElementById(r));var I=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(I)}),50)}else document.getElementById(this.jSPlugin.id+"-headControl")&&document.getElementById(this.jSPlugin.id+"-headControl").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-headControl"));if(this.isNeedRenderFooter)if(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container"))document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.marginTop="-56pxpx");else{var C=document.createElement("div");C.setAttribute("id",this.jSPlugin.id+"-ez-iframe-footer-container"),C.setAttribute("class","ez-iframe-footer-container");var h={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=nC(h),C.innerHTML='\n
    \n
    \n
    \n ",g(C,document.getElementById(r))}else document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container")&&document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").parentElement.removeChild(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container"));this.isNeedRenderInspectInfo&&document.getElementById(this.jSPlugin.id+"-inspectInfoControl")&&(document.getElementById(this.jSPlugin.id+"-inspectInfoControl").style.background=a.backgroundColor,document.getElementById(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(this.jSPlugin.id+"-headControl")&&(document.getElementById(this.jSPlugin.id+"-headControl").style.background=i.backgroundColor,document.getElementById(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(this.jSPlugin.id+"-audioControls")&&(document.getElementById(this.jSPlugin.id+"-audioControls").style.background=n.backgroundColor,document.getElementById(this.jSPlugin.id+"-audioControls").style.color=n.color,n.btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)}))),this.inspectMapWin=new MI(this.jSPlugin),this.inspectSmallWin=new AC(this.jSPlugin,this.inspectMode,this.inspectMapWin,this.changeInspectMode,this.decoderState)},e.renderThemeData=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(this.jSPlugin.id+"-inspectInfoControl").style.background=i.backgroundColor.replace("-diy",""),document.getElementById(this.jSPlugin.id+"-inspectInfoControl").style.color=i.color.replace("-diy",""),i.btnList.map((function(e,t){var i;e.isrender&&A.setDecoderState(((i={})[e.iconId]=A.decoderState.state[e.iconId],i))}))),this.isNeedRenderHeader&&n&&(document.getElementById(this.jSPlugin.id+"-headControl").style.background=n.backgroundColor.replace("-diy",""),document.getElementById(this.jSPlugin.id+"-headControl").style.color=n.color.replace("-diy",""),n.btnList&&n.btnList.map((function(e,t){var i;e.isrender&&A.setDecoderState(((i={})[e.iconId]=A.decoderState.state[e.iconId],i))}))),this.isNeedRenderFooter&&a)document.getElementById(this.jSPlugin.id+"-audioControls").style.background=a.backgroundColor.replace("-diy",""),document.getElementById(this.jSPlugin.id+"-audioControls").style.color=a.color.replace("-diy",""),a.btnList.map((function(t,i){var n;t.isrender&&A.setDecoderState(((n={})[t.iconId]=A.decoderState.state[t.iconId],n));if(0==i&&!A.themeInited&&A.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),1!=A.themeData.customConfig.bellPoster||e?A.jSPlugin.play():A.jSPlugin.pluginStatus.loadingClear(),A.themeInited=!0)}),50)})),this.setDecoderState({cloudRec:"cloud.rec"===c(this.jSPlugin.url).type,rec:"rec"===c(this.jSPlugin.url).type,type:c(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var r=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),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.reSizeVideo(A.videoWidth,A.videoHeight))}),50);this.jSPlugin.Zoom||(this.jSPlugin.Zoom=new iC(this.jSPlugin)),this.getInspectDevInfo(this.jSPlugin,!0,!1)},e.getInspectRecord=function(){var A=this;!function(A,e){var t={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:c(A.url).deviceSerial},i=A.env.domain+"/api/service/devicekit/bodycamera/inspect/detail/latest";QI(i,"GET",t,(function(A){e&&e(A)}),(function(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(A.jSPlugin.id+"-inspectInfo-inspectName")&&t.inspectName&&(document.getElementById(A.jSPlugin.id+"-inspectInfo-inspectName").innerText=""+t.inspectName),document.getElementById(A.jSPlugin.id+"-inspectInfo-inspectBeginTime")&&t.beginTime&&(document.getElementById(A.jSPlugin.id+"-inspectInfo-inspectBeginTime").innerText="巡检开始时间:"+t.beginTime),document.getElementById(A.jSPlugin.id+"-header-inspectTime")&&A.timer.createInterval("InspectTimer",(function(){document.getElementById(A.jSPlugin.id+"-header-inspectTime").innerHTML=A.renderInspectTime(t.beginTime)}),1e3),document.getElementById(A.jSPlugin.id+"-inspectInfo-inspectPerson")&&t.inspectPerson&&(document.getElementById(A.jSPlugin.id+"-inspectInfo-inspectPerson").innerText="本地巡检员:"+t.inspectPerson),A.inspectInfo=t,t.inspectRecordId&&ZI(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&&ZI(A.jSPlugin,t.inspectRecordId,(function(e){200==e.meta.code&&e.data&&A.inspectMapWin.createTrack(e.data,!1)}),(function(){}))}),5e3))}),(function(){})),A.InspectEvent=new $I(A.jSPlugin,t.inspectRecordId,A.timer)}else A.InspectEvent=new $I(A.jSPlugin,null,A.timer)}))},e.getInspectDevInfo=function(A,e,t){var i=this;void 0===e&&(e=!1),void 0===t&&(t=!1);!function(A,e,t){var i={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:c(A.url).deviceSerial},n=A.env.domain+"/api/service/devicekit/bodycamera";QI(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?(t&&!i.decoderState.state.play&&(i.jSPlugin.pluginStatus.loadingStart(i.jSPlugin.id),i.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),i.jSPlugin.play()),i.globalContainer.globalContainerToggle(i.jSPlugin.id+"-inspect-global-box",!1),document.getElementById(i.jSPlugin.id+"-header-deviceName")&&(document.getElementById(i.jSPlugin.id+"-header-deviceName").innerText=n.data.deviceName+"("+n.data.deviceSerial+")",document.getElementById(i.jSPlugin.id+"-header-deviceName").setAttribute("title",n.data.deviceName+"("+n.data.deviceSerial+")")),document.getElementById(i.jSPlugin.id+"-header-signalType")&&(document.getElementById(i.jSPlugin.id+"-header-signalType").innerHTML=i.renderSignalType(n.data.signalType)),document.getElementById(i.jSPlugin.id+"-header-batteryStatus")&&(document.getElementById(i.jSPlugin.id+"-header-batteryStatus").innerHTML=i.renderBatteryStatus(n.data.batteryStatus)),i.timer.createInterval("InspectDevInfoTimer",(function(){i.getInspectDevInfo(A,!1,!1)}),3e5),e&&i.getInspectRecord()):(i.globalContainer.globalContainerToggle(i.jSPlugin.id+"-inspect-loading-box",!1),i.jSPlugin.stop(),i.globalContainer.deviceErrorInfo({tips:"当前设备未在巡检中",refreshBtn:"刷新",refreshShow:!0},(function(){i.globalContainer.globalContainerToggle(i.jSPlugin.id+"-no-inspect-box",!1),i.globalContainer.globalContainerToggle(i.jSPlugin.id+"-inspect-loading-box",!0),i.getInspectDevInfo(A,!0,!0)}))):(i.globalContainer.globalContainerToggle(i.jSPlugin.id+"-inspect-loading-box",!1),i.jSPlugin.stop(),i.globalContainer.deviceErrorInfo({tips:n.meta.message,refreshShow:!1}))}),(function(){i.globalContainer.globalContainerToggle(i.jSPlugin.id+"-inspect-global-box",!1)}))},e.fetchThemeData=function(A){var e=this;rI(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(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(e.jSPlugin.id+"-inspect-loading-box",!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"您的试用特权已到期,需前往轻应用控制台购买后使用。",refreshBtn:"刷新",refreshShow:!1}),void(e.activeThemeStatusTxt="试用特权已到期")):(e.globalContainer.globalContainerToggle(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=eC,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()}))},e.reSizeVideo=function(A,e){if(document.getElementById(""+this.jSPlugin.id).style.width=A+"px",document.getElementById(""+this.jSPlugin.id).style.height=e+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin.JS_Resize(A,e);else{document.getElementById(this.jSPlugin.id+"-player")&&(document.getElementById(this.jSPlugin.id+"-player").width=A,document.getElementById(this.jSPlugin.id+"-player").height=e,document.getElementById(this.jSPlugin.id+"-player").style.width=A+"px",document.getElementById(this.jSPlugin.id+"-player").style.height=e+"px",document.getElementById(this.jSPlugin.id+"-container-0").style.height=e+"px");var t=1;if(document.getElementById(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(this.jSPlugin.id+"canvas0").style.width=A*t+"px",document.getElementById(this.jSPlugin.id+"canvas0").style.height=e*t+"px",document.getElementById(this.jSPlugin.id+"canvas0").width=A*t,document.getElementById(this.jSPlugin.id+"canvas0").height=e*t,document.getElementById(this.jSPlugin.id+"canvas0").parentNode.style.width=A*t+"px",document.getElementById(this.jSPlugin.id+"canvas0").parentNode.style.height=e*t+"px",document.getElementById(this.jSPlugin.id+"canvas_draw0").height=e*t}},e.reSize=function(A,e){var t=.3333*A,i=.3333*e;document.getElementById(this.jSPlugin.id+"-inspectInfoControl")&&(document.getElementById(this.jSPlugin.id+"-inspectInfoControl").style.width=A+this.jSPlugin.inspectVideoWidth+"px"),document.getElementById(this.jSPlugin.id+"-headControl")&&(document.getElementById(this.jSPlugin.id+"-headControl").style.width=A+"px"),document.getElementById(this.jSPlugin.id+"-headControl")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.width=A+"px"),"video"===this.jSPlugin.Theme.inspectMode?(this.reSizeVideo(A,e),document.getElementById(this.jSPlugin.id+"-headControl")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.top=0),document.getElementById(this.jSPlugin.id+"-mapbox").style.width=t+"px",document.getElementById(this.jSPlugin.id+"-mapbox").style.height=i+"px"):(document.getElementById(this.jSPlugin.id+"-headControl")&&(document.getElementById(this.jSPlugin.id+"-ez-iframe-footer-container").style.top=e+"px"),this.reSizeVideo(t,i),document.getElementById(this.jSPlugin.id+"-mapbox").style.width=A+"px",document.getElementById(this.jSPlugin.id+"-mapbox").style.height=e+"px"),document.getElementById(this.jSPlugin.id+"-miniToggle").style.bottom=i/2+96-30+"px",document.getElementById(this.jSPlugin.id+"-miniToggle").style.right=this.jSPlugin.inspectVideoWidth+t+"px"},A}(),gC=function(){function A(A){var e=this;if(this.changeInspectMode=function(A){e.inspectMode=A},this.jSPlugin=A,this.videoWidth=A.width,this.videoHeight=A.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"===c(A.url).type,rec:"rec"===c(A.url).type,type:c(A.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!==A.isMobile&&(this.isMobile=A.isMobile),this.themeData=eC,"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.timer||(this.timer=new TI(A)),this.jSPlugin.themeId)if(this.isMobile||(this.inspect=new sC(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 Ud(this.jSPlugin)),a(this.jSPlugin.staticPath+"/css/theme.css"),a(this.jSPlugin.staticPath+"/css/component.css"),a(this.jSPlugin.staticPath+"/css/inspectTheme.css")}var e=A.prototype;return e.setDecoderState=function(A,e){var t=this,i="#FFFFFF",n="#1890FF";Object.keys(A).map((function(e){switch(e){case"talk":document.getElementById(t.jSPlugin.id+"-talk")&&(document.getElementById(t.jSPlugin.id+"-talk").className=A[e]?"active":"",document.getElementById(t.jSPlugin.id+"-talk-content").childNodes[1].style.fill=A[e]?n:i,document.getElementById(t.jSPlugin.id+"-talk-content").childNodes[2].style.color=A[e]?n:i);break;case"sound":document.getElementById(t.jSPlugin.id+"-sound")&&(A[e]?(document.getElementById(t.jSPlugin.id+"-sound-content").children[0].children[1].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-sound-content").children[0].children[0].style="display:none",document.getElementById(t.jSPlugin.id+"-sound").className=A[e]?"active":"",document.getElementById(t.jSPlugin.id+"-sound-content").childNodes[0].children[1].style.fill=A[e]?n:i,document.getElementById(t.jSPlugin.id+"-sound-label").style.color=A[e]?n:i):(document.getElementById(t.jSPlugin.id+"-sound-content").children[0].children[0].style="display:inline-block",document.getElementById(t.jSPlugin.id+"-sound-content").children[0].children[1].style="display:none",document.getElementById(t.jSPlugin.id+"-sound").className=A[e]?"active":"",document.getElementById(t.jSPlugin.id+"-sound-label").style.color=A[e]?n:i))}t.decoderState.state=Object.assign(t.decoderState.state,A)}))},e.setDisabled=function(A){var e=this.decoderState.state,t=e.sound;e.hd,null!=document.getElementById(t?this.jSPlugin.id+"-sound-icon":this.jSPlugin.id+"-nosound-icon")&&document.getElementById(t?this.jSPlugin.id+"-sound-icon":this.jSPlugin.id+"-nosound-icon").setAttribute("style",A?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById(this.jSPlugin.id+"-sound-label")&&document.getElementById(this.jSPlugin.id+"-sound-label").setAttribute("style",A?"cursor: not-allowed; color: gray":"cursor: default"),null!=document.getElementById(this.jSPlugin.id+"-talk-icon")&&document.getElementById(this.jSPlugin.id+"-talk-icon").setAttribute("style",A?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById(this.jSPlugin.id+"-talk-label")&&document.getElementById(this.jSPlugin.id+"-talk-label").setAttribute("style",A?"cursor: not-allowed; color: gray":"cursor: default")},e.inspectEnding=function(){var A=document.createElement("div");A.id=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(this.jSPlugin.id+"-wrap").appendChild(A),this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom()},A}(),lC=function(){function A(){this.events={}}var e=A.prototype;return e.on=function(A,e){A&&e&&(this.events[A]=this.events[A]||[],this.events[A].push(e))},e.emit=function(A,e){A&&this.events[A]&&this.events[A].forEach((function(A){return A(e)}))},e.off=function(A,e){A&&e&&this.events[A]&&this.events[A].splice(this.events[A].indexOf(e),1)},e.once=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)}))},e.removeAllListener=function(){this.events={}},A}();var cC=(rC||(rC=1,aC=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,r=[];return function(){var s=function(A){return"function"==typeof A?A():A}(e),g=(new Date).getTime(),l=!i||g-i>s;i=g;for(var c=arguments.length,d=Array(c),I=0;I91&&!!window.SharedArrayBuffer}return!1};function uC(A){var e;return"object"!=(void 0===A?"undefined":(e=A)&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)&&(A=new Date(A)),""+A.getFullYear()+(A.getMonth()+1).toString().padStart(2,"0")+A.getDate().toString().padStart(2,"0")+A.getHours().toString().padStart(2,"0")+A.getMinutes().toString().padStart(2,"0")+A.getSeconds().toString().padStart(2,"0")}var BC=function(A){return A&&A.retcode?String(A.retcode):A&&A.code?"1"+String(A.code).padStart(5,"0"):A&&A.errorCode?"39"+String(A.errorCode).padStart(4,"0"):"400001"};function EC(){var A,e={},t=navigator.userAgent.toLowerCase();if((A=t.match(/rv:([\d.]+)\) like gecko/))||(A=t.match(/msie ([\d\.]+)/))?e.ie=A[1]:(A=t.match(/edge\/([\d\.]+)/))?e.edge=A[1]:(A=t.match(/firefox\/([\d\.]+)/))?e.firefox=A[1]:(A=t.match(/(?:opera|opr).([\d\.]+)/))?e.opera=A[1]:(A=t.match(/chrome\/([\d\.]+)/))?e.chrome=A[1]:(A=t.match(/version\/([\d\.]+).*safari/))&&(e.safari=A[1]),e.chrome){var i=e.chrome,n=i.indexOf(".");return Number(i.substring(0,n))}return-1}function fC(A){return EC()>=94}function QC(A){if(EC()>=107){window.VideoDecoder&&VideoDecoder.isConfigSupported({codec:"hvc1.1.6.L123.00",hardwareAcceleration:"prefer-hardware"}).then((function(A){A.supported}))}}function xC(A){return A&&"undefined"!=typeof Symbol&&A.constructor===Symbol?"symbol":typeof A}var pC=[Eg.getOSDTime,Eg.streamInfoCB,Eg.http.getCloudRecordTimes,Eg.http.getLocalRecTimes,Eg.http.getCloudRecTimes];function mC(A,e){void 0===e&&(e=Eg),Object.keys(e).forEach((function(t){var i;"object"!==xC(e[t])?null==(i=A.eventEmitter)||i.on(e[t],(function(i){var n;if(!pC.includes(t))if("object"===(void 0===i?"undefined":xC(i))&&"[object Object]"===Object.prototype.toString.call(i)||Array.isArray(i)){delete i.target;try{var a;null==(a=A.logger)||a.log("[events]",e[t],JSON.stringify(i))}catch(A){}}else null==(n=A.logger)||n.log("[events]",e[t],i)})):mC(A,e[t])}))}var yC,_C={exports:{}},SC=_C.exports;var DC,vC=(yC||(yC=1,function(A){!function(e,t){A.exports=e.document?t(e,!0):function(A){if(!A.document)throw new Error("jQuery requires a window with a document");return t(A)}}("undefined"!=typeof window?window:SC,(function(A,e){var t=[],i=Object.getPrototypeOf,n=t.slice,a=t.flat?function(A){return t.flat.call(A)}:function(A){return t.concat.apply([],A)},r=t.push,o=t.indexOf,s={},g=s.toString,l=s.hasOwnProperty,c=l.toString,d=c.call(Object),I={},C=function(A){return"function"==typeof A&&"number"!=typeof A.nodeType&&"function"!=typeof A.item},h=function(A){return null!=A&&A===A.window},u=A.document,B={type:!0,src:!0,nonce:!0,noModule:!0};function E(A,e,t){var i,n,a=(t=t||u).createElement("script");if(a.text=A,e)for(i in B)(n=e[i]||e.getAttribute&&e.getAttribute(i))&&a.setAttribute(i,n);t.head.appendChild(a).parentNode.removeChild(a)}function f(A){return null==A?A+"":"object"==typeof A||"function"==typeof A?s[g.call(A)]||"object":typeof A}var Q="3.7.1",x=/HTML$/i,p=function(A,e){return new p.fn.init(A,e)};function m(A){var e=!!A&&"length"in A&&A.length,t=f(A);return!C(A)&&!h(A)&&("array"===t||0===e||"number"==typeof e&&e>0&&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+~]|"+v+")"+v+"*"),U=new RegExp(v+"|>"),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)(?:\\("+v+"*(even|odd|(([+-]|)(\\d*)n|)"+v+"*(?:([+-]|)"+v+"*(\\d+)|))"+v+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+v+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+v+"*((?:-\\d)?\\d*)"+v+"*\\)|)(?=[^-]|$)","i")},V=/^(?:input|select|textarea|button)$/i,O=/^h\d$/i,j=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,W=/[+~]/,Z=new RegExp("\\\\[\\da-fA-F]{1,6}"+v+"?|\\\\([^\\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=dA((function(A){return!0===A.disabled&&y(A,"fieldset")}),{dir:"parentNode",next:"legend"});try{u.apply(t=n.call(R.childNodes),R.childNodes),t[R.childNodes.length].nodeType}catch(A){u={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,r,o,s,l,c,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,d)){if(11!==E&&(s=j.exec(A)))if(n=s[1]){if(9===E){if(!(r=e.getElementById(n)))return t;if(r.id===n)return u.call(t,r),t}else if(h&&(r=h.getElementById(n))&&$.contains(e,r)&&r.id===n)return u.call(t,r),t}else{if(s[2])return u.apply(t,e.getElementsByTagName(A)),t;if((n=s[3])&&e.getElementsByClassName)return u.apply(t,e.getElementsByClassName(n)),t}if(!(b[A+" "]||C&&C.test(A))){if(c=A,h=e,1===E&&(U.test(A)||Y.test(A))){for((h=W.test(A)&&oA(e.parentNode)||e)==e&&I.scope||((o=e.getAttribute("id"))?o=p.escapeSelector(o):e.setAttribute("id",o=B)),a=(l=lA(A)).length;a--;)l[a]=(o?"#"+o:":scope")+" "+cA(l[a]);c=l.join(",")}try{return u.apply(t,h.querySelectorAll(c)),t}catch(e){b(A,!0)}finally{o===B&&e.removeAttribute("id")}}}return EA(A.replace(w,"$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[B]=!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 rA(A){return eA((function(e){return e=+e,eA((function(t,i){for(var n,a=A([],t.length,e),r=a.length;r--;)t[n=a[r]]&&(t[n]=!(i[n]=t[n]))}))}))}function oA(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?(c=(g=t).documentElement,d=!p.isXMLDoc(g),h=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&R!=g&&(e=g.defaultView)&&e.top!==e&&e.addEventListener("unload",q),I.getById=tA((function(A){return c.appendChild(A).id=p.expando,!g.getElementsByName||!g.getElementsByName(p.expando).length})),I.disconnectedMatch=tA((function(A){return h.call(A,"*")})),I.scope=tA((function(){return g.querySelectorAll(":scope")})),I.cssHas=tA((function(){try{return g.querySelector(":has(*,:jqfake)"),!1}catch(A){return!0}})),I.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&&d){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&&d){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&&d)return e.getElementsByClassName(A)},C=[],tA((function(A){var e;c.appendChild(A).innerHTML="",A.querySelectorAll("[selected]").length||C.push("\\["+v+"*(?:value|"+P+")"),A.querySelectorAll("[id~="+B+"-]").length||C.push("~="),A.querySelectorAll("a#"+B+"+*").length||C.push(".#.+[+~]"),A.querySelectorAll(":checked").length||C.push(":checked"),(e=g.createElement("input")).setAttribute("type","hidden"),A.appendChild(e).setAttribute("name","D"),c.appendChild(A).disabled=!0,2!==A.querySelectorAll(":disabled").length&&C.push(":enabled",":disabled"),(e=g.createElement("input")).setAttribute("name",""),A.appendChild(e),A.querySelectorAll("[name='']").length||C.push("\\["+v+"*name"+v+"*="+v+"*(?:''|\"\")")})),I.cssHas||C.push(":has"),C=C.length&&new RegExp(C.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)||!I.sortDetached&&e.compareDocumentPosition(A)===t?A===g||A.ownerDocument==R&&$.contains(R,A)?-1:e===g||e.ownerDocument==R&&$.contains(R,e)?1:r?o.call(r,A)-o.call(r,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),d&&!b[e+" "]&&(!C||!C.test(e)))try{var t=h.call(A,e);if(t||I.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&&l.call(i.attrHandle,e.toLowerCase())?t(A,e,!d):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=!I.sortStable,r=!I.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 r=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=lA(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("(^|"+v+")"+A+"("+v+"|$)"))&&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),r="last"!==A.slice(-4),o="of-type"===e;return 1===i&&0===n?function(A){return!!A.parentNode}:function(e,t,s){var g,l,c,d,I,C=a!==r?"nextSibling":"previousSibling",h=e.parentNode,u=o&&e.nodeName.toLowerCase(),f=!s&&!o,Q=!1;if(h){if(a){for(;C;){for(c=e;c=c[C];)if(o?y(c,u):1===c.nodeType)return!1;I=C="only"===A&&!I&&"nextSibling"}return!0}if(I=[r?h.firstChild:h.lastChild],r&&f){for(Q=(d=(g=(l=h[B]||(h[B]={}))[A]||[])[0]===E&&g[1])&&g[2],c=d&&h.childNodes[d];c=++d&&c&&c[C]||(Q=d=0)||I.pop();)if(1===c.nodeType&&++Q&&c===e){l[A]=[E,d,Q];break}}else if(f&&(Q=d=(g=(l=e[B]||(e[B]={}))[A]||[])[0]===E&&g[1]),!1===Q)for(;(c=++d&&c&&c[C]||(Q=d=0)||I.pop())&&(!(o?y(c,u):1===c.nodeType)||!++Q||(f&&((l=c[B]||(c[B]={}))[A]=[E,Q]),c!==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[B]?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),r=a.length;r--;)A[i=o.call(A,a[r])]=!(t[i]=a[r])})):function(A){return n(A,0,t)}):n}},pseudos:{not:eA((function(A){var e=[],t=[],i=BA(A.replace(w,"$1"));return i[B]?eA((function(A,e,t,n){for(var a,r=i(A,null,n,[]),o=A.length;o--;)(a=r[o])&&(A[o]=!(e[o]=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=d?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===c},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:rA((function(){return[0]})),last:rA((function(A,e){return[e-1]})),eq:rA((function(A,e,t){return[t<0?t+e:t]})),even:rA((function(A,e){for(var t=0;te?e:t;--i>=0;)A.push(i);return A})),gt:rA((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 CA(A,e,t,i,n){for(var a,r=[],o=0,s=A.length,g=null!=e;o-1&&(a[l]=!(r[l]=d))}}else I=CA(I===r?I.splice(B,I.length):I),n?n(null,r,I,g):u.apply(r,I)}))}function uA(A){for(var e,t,n,r=A.length,s=i.relative[A[0].type],g=s||i.relative[" "],l=s?1:0,c=dA((function(A){return A===e}),g,!0),d=dA((function(A){return o.call(e,A)>-1}),g,!0),I=[function(A,t,i){var n=!s&&(i||t!=a)||((e=t).nodeType?c(A,t,i):d(A,t,i));return e=null,n}];l1&&IA(I),l>1&&cA(A.slice(0,l-1).concat({value:" "===A[l-2].type?"*":""})).replace(w,"$1"),t,l0,n=A.length>0,r=function(r,o,s,l,c){var I,C,h,B=0,f="0",Q=r&&[],x=[],m=a,y=r||n&&i.find.TAG("*",c),S=E+=null==m?1:Math.random()||.1,D=y.length;for(c&&(a=o==g||o||c);f!==D&&null!=(I=y[f]);f++){if(n&&I){for(C=0,o||I.ownerDocument==g||(sA(I),s=!d);h=A[C++];)if(h(I,o||g,s)){u.call(l,I);break}c&&(E=S)}t&&((I=!h&&I)&&B--,r&&Q.push(I))}if(B+=f,t&&f!==B){for(C=0;h=e[C++];)h(Q,x,o,s);if(r){if(B>0)for(;f--;)Q[f]||x[f]||(x[f]=_.call(l));x=CA(x)}u.apply(l,x),c&&!r&&x.length>0&&B+e.length>1&&p.uniqueSort(l)}return c&&(E=S,a=m),Q};return t?eA(r):r}(r,n)),o.selector=A}return o}function EA(A,e,t,n){var a,r,o,s,g,l="function"==typeof A&&A,c=!n&&lA(A=l.selector||A);if(t=t||[],1===c.length){if((r=c[0]=c[0].slice(0)).length>2&&"ID"===(o=r[0]).type&&9===e.nodeType&&d&&i.relative[r[1].type]){if(!(e=(i.find.ID(o.matches[0].replace(Z,X),e)||[])[0]))return t;l&&(e=e.parentNode),A=A.slice(r.shift().value.length)}for(a=K.needsContext.test(A)?0:r.length;a--&&(o=r[a],!i.relative[s=o.type]);)if((g=i.find[s])&&(n=g(o.matches[0].replace(Z,X),W.test(r[0].type)&&oA(e.parentNode)||e))){if(r.splice(a,1),!(A=n.length&&cA(r)))return u.apply(t,n),t;break}}return(l||BA(A,c))(n,e,!d,t,!e||W.test(A)&&oA(e.parentNode)||e),t}gA.prototype=i.filters=i.pseudos,i.setFilters=new gA,I.sortStable=B.split("").sort(F).join("")===B,sA(),I.sortDetached=tA((function(A){return 1&A.compareDocumentPosition(g.createElement("fieldset"))})),p.find=$,p.expr[":"]=p.expr.pseudos,p.unique=p.uniqueSort,$.compile=BA,$.select=EA,$.setDocument=sA,$.tokenize=lA,$.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 C(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 o.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 G,Y=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,U=p.fn.init=function(A,e,t){var i,n;if(!A)return this;if(t=t||G,"string"==typeof A){if(!(i="<"===A[0]&&">"===A[A.length-1]&&A.length>=3?[null,A,null]:Y.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:u,!0)),M.test(i[1])&&p.isPlainObject(e))for(i in e)C(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(n=u.getElementById(i[2]))&&(this[0]=n,this.length=1),this}return A.nodeType?(this[0]=A,this.length=1,this):C(A)?void 0!==t.ready?t.ready(A):A(p):p.makeArray(A,this)};U.prototype=p.fn,G=p(u);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?o.call(p(A),this[0]):o.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&&C(n=A.promise)?n.call(A).done(e).fail(t):A&&C(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=[],r=[],o=-1,s=function(){for(n=n||A.once,i=e=!0;r.length;o=-1)for(t=r.shift();++o-1;)a.splice(t,1),t<=o&&o--})),this},has:function(A){return A?p.inArray(A,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return n=r=[],a=t="",this},disabled:function(){return!a},lock:function(){return n=r=[],t||e||(a=t=""),this},locked:function(){return!!n},fireWith:function(A,t){return n||(t=[A,(t=t||[]).slice?t.slice():t],r.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=C(A[i[4]])&&A[i[4]];a[i[1]]((function(){var A=n&&n.apply(this,arguments);A&&C(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 r(e,t,i,n){return function(){var o=this,s=arguments,g=function(){var A,g;if(!(e=a&&(i!==j&&(o=void 0,s=[A]),t.rejectWith(o,s))}};e?l():(p.Deferred.getErrorHook?l.error=p.Deferred.getErrorHook():p.Deferred.getStackHook&&(l.error=p.Deferred.getStackHook()),A.setTimeout(l))}}return p.Deferred((function(A){t[0][3].add(r(0,A,C(n)?n:O,A.notifyWith)),t[1][3].add(r(0,A,C(e)?e:O)),t[2][3].add(r(0,A,C(i)?i:j))})).promise()},promise:function(A){return null!=A?p.extend(A,n):n}},a={};return p.each(t,(function(A,e){var r=e[2],o=e[5];n[e[1]]=r.add,o&&r.add((function(){i=o}),t[3-A][2].disable,t[3-A][3].disable,t[0][2].lock,t[0][3].lock),r.add(e[3].fire),a[e[0]]=function(){return a[e[0]+"With"](this===a?void 0:this,arguments),this},a[e[0]+"With"]=r.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),r=p.Deferred(),o=function(A){return function(t){i[A]=this,a[A]=arguments.length>1?n.call(arguments):t,--e||r.resolveWith(i,a)}};if(e<=1&&(W(A,r.done(o(t)).resolve,r.reject,!e),"pending"===r.state()||C(a[t]&&a[t].then)))return r.then();for(;t--;)W(a[t],o(t),r.reject);return r.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(){u.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(u,[p]))}}),p.ready.then=X.then,"complete"===u.readyState||"loading"!==u.readyState&&!u.documentElement.doScroll?A.setTimeout(p.ready):(u.addEventListener("DOMContentLoaded",q),A.addEventListener("load",q));var z=function(A,e,t,i,n,a,r){var o=0,s=A.length,g=null==t;if("object"===f(t))for(o in n=!0,t)z(A,e,o,t[o],!0,a,r);else if(void 0!==i&&(n=!0,C(i)||(r=!0),g&&(r?(e.call(A,i),e=null):(g=e,e=function(A,e,t){return g.call(p(A),t)})),e))for(;o1,null,!0)},removeData:function(A){return this.each((function(){rA.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=u.createDocumentFragment().appendChild(u.createElement("div")),(pA=u.createElement("input")).setAttribute("type","radio"),pA.setAttribute("checked","checked"),pA.setAttribute("name","t"),xA.appendChild(pA),I.checkClone=xA.cloneNode(!0).cloneNode(!0).lastChild.checked,xA.innerHTML="",I.noCloneChecked=!!xA.cloneNode(!0).lastChild.defaultValue,xA.innerHTML="",I.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 vA(A,e){for(var t=0,i=A.length;t",""]);var wA=/<|&#?\w+;/;function bA(A,e,t,i,n){for(var a,r,o,s,g,l,c=e.createDocumentFragment(),d=[],I=0,C=A.length;I-1)n&&n.push(a);else if(g=CA(a),r=DA(c.appendChild(a),"script"),g&&vA(r),t)for(l=0;a=r[l++];)_A.test(a.type||"")&&t.push(a);return c}var FA=/^([^.]*)(?:\.(.+)|)/;function RA(){return!0}function kA(){return!1}function PA(A,e,t,i,n,a){var r,o;if("object"==typeof e){for(o in"string"!=typeof t&&(i=i||t,t=void 0),e)PA(A,o,t,i,e[o],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&&(r=n,n=function(A){return p().off(A),r.apply(this,arguments)},n.guid=r.guid||(r.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,r,o,s,g,l,c,d,I,C,h,u=aA.get(A);if(iA(A))for(t.handler&&(t=(a=t).handler,n=a.selector),n&&p.find.matchesSelector(IA,n),t.guid||(t.guid=p.guid++),(s=u.events)||(s=u.events=Object.create(null)),(r=u.handle)||(r=u.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--;)I=h=(o=FA.exec(e[g])||[])[1],C=(o[2]||"").split(".").sort(),I&&(c=p.event.special[I]||{},I=(n?c.delegateType:c.bindType)||I,c=p.event.special[I]||{},l=p.extend({type:I,origType:h,data:i,handler:t,guid:t.guid,selector:n,needsContext:n&&p.expr.match.needsContext.test(n),namespace:C.join(".")},a),(d=s[I])||((d=s[I]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(A,i,C,r)||A.addEventListener&&A.addEventListener(I,r)),c.add&&(c.add.call(A,l),l.handler.guid||(l.handler.guid=t.guid)),n?d.splice(d.delegateCount++,0,l):d.push(l),p.event.global[I]=!0)},remove:function(A,e,t,i,n){var a,r,o,s,g,l,c,d,I,C,h,u=aA.hasData(A)&&aA.get(A);if(u&&(s=u.events)){for(g=(e=(e||"").match(V)||[""]).length;g--;)if(I=h=(o=FA.exec(e[g])||[])[1],C=(o[2]||"").split(".").sort(),I){for(c=p.event.special[I]||{},d=s[I=(i?c.delegateType:c.bindType)||I]||[],o=o[2]&&new RegExp("(^|\\.)"+C.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=a=d.length;a--;)l=d[a],!n&&h!==l.origType||t&&t.guid!==l.guid||o&&!o.test(l.namespace)||i&&i!==l.selector&&("**"!==i||!l.selector)||(d.splice(a,1),l.selector&&d.delegateCount--,c.remove&&c.remove.call(A,l));r&&!d.length&&(c.teardown&&!1!==c.teardown.call(A,C,u.handle)||p.removeEvent(A,I,u.handle),delete s[I])}else for(I in s)p.event.remove(A,I+e[g],t,i,!0);p.isEmptyObject(s)&&aA.remove(A,"handle events")}},dispatch:function(A){var e,t,i,n,a,r,o=new Array(arguments.length),s=p.event.fix(A),g=(aA.get(this,"events")||Object.create(null))[s.type]||[],l=p.event.special[s.type]||{};for(o[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=[],r={},t=0;t-1:p.find(n,this,null,[g]).length),r[n]&&a.push(i);a.length&&o.push({elem:g,handlers:a})}return g=this,s\s*$/g;function GA(A,e){return y(A,"table")&&y(11!==e.nodeType?e:e.firstChild,"tr")&&p(A).children("tbody")[0]||A}function YA(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,r,o;if(1===e.nodeType){if(aA.hasData(A)&&(o=aA.get(A).events))for(n in aA.remove(e,"handle events"),o)for(t=0,i=o[n].length;t1&&"string"==typeof u&&!I.checkClone&&MA.test(u))return A.each((function(n){var a=A.eq(n);B&&(e[0]=u.call(this,n,a.html())),KA(a,e,t,i)}));if(d&&(r=(n=bA(e,A[0].ownerDocument,!1,A,i)).firstChild,1===n.childNodes.length&&(n=r),r||i)){for(s=(o=p.map(DA(n,"script"),YA)).length;c0&&vA(r,!s&&DA(A,"script")),o},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[rA.expando]&&(t[rA.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||GA(this,A).appendChild(A)}))},prepend:function(){return KA(this,arguments,(function(A){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=GA(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-o-.5))||0),s+g}function se(A,e,t){var i=WA(A),n=(!I.boxSizingReliable()||t)&&"border-box"===p.css(A,"boxSizing",!1,i),a=n,r=qA(A,e,i),o="offset"+e[0].toUpperCase()+e.slice(1);if(OA.test(r)){if(!t)return r;r="auto"}return(!I.boxSizingReliable()&&n||!I.reliableTrDimensions()&&y(A,"tr")||"auto"===r||!parseFloat(r)&&"inline"===p.css(A,"display",!1,i))&&A.getClientRects().length&&(n="border-box"===p.css(A,"boxSizing",!1,i),(a=o in A)&&(r=A[o])),(r=parseFloat(r)||0)+oe(A,e,t||(n?"border":"content"),a,i,r)+"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,r,o=tA(e),s=jA.test(e),g=A.style;if(s||(e=te(o)),r=p.cssHooks[e]||p.cssHooks[o],void 0===t)return r&&"get"in r&&void 0!==(n=r.get(A,!1,i))?n:g[e];"string"==(a=typeof t)&&(n=cA.exec(t))&&n[1]&&(t=BA(A,e,n),a="number"),null!=t&&t==t&&("number"!==a||s||(t+=n&&n[3]||(p.cssNumber[o]?"":"px")),I.clearCloneStyle||""!==t||0!==e.indexOf("background")||(g[e]="inherit"),r&&"set"in r&&void 0===(t=r.set(A,t,i))||(s?g.setProperty(e,t):g[e]=t))}},css:function(A,e,t,i){var n,a,r,o=tA(e);return jA.test(e)||(e=te(o)),(r=p.cssHooks[e]||p.cssHooks[o])&&"get"in r&&(n=r.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),r=!I.scrollboxSize()&&"absolute"===a.position,o=(r||i)&&"border-box"===p.css(A,"boxSizing",!1,a),s=i?oe(A,e,i,o,a):0;return o&&r&&(s-=Math.ceil(A["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(a[e])-oe(A,e,"border",!1,a)-.5)),s&&(n=cA.exec(t))&&"px"!==(n[3]||"px")&&(A.style[e]=t,t=p.css(A,e)),re(0,t,s)}}})),p.cssHooks.marginLeft=zA(I.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+dA[i]+e]=a[i]||a[i-2]||a[0];return n}},"margin"!==A&&(p.cssHooks[A+e].set=re)})),p.fn.extend({css:function(A,e){return z(this,(function(A,e,t){var i,n,a={},r=0;if(Array.isArray(e)){for(i=WA(A),n=e.length;r1)}}),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 le,ce,de=/^(?:toggle|show|hide)$/,Ie=/queueHooks$/;function Ce(){ce&&(!1===u.hidden&&A.requestAnimationFrame?A.requestAnimationFrame(Ce):A.setTimeout(Ce,p.fx.interval),p.fx.tick())}function he(){return A.setTimeout((function(){le=void 0})),le=Date.now()}function ue(A,e){var t,i=0,n={height:A};for(e=e?1:0;i<4;i+=2-e)n["margin"+(t=dA[i])]=n["padding"+t]=A;return e&&(n.opacity=n.width=A),n}function Be(A,e,t){for(var i,n=(Ee.tweeners[e]||[]).concat(Ee.tweeners["*"]),a=0,r=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(!I.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,r=e.toLowerCase();return i||(a=Qe[r],Qe[r]=n,n=null!=t(A,e,i)?r:null,Qe[r]=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"}}),I.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,r;return C(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+" "," ");r=me(t),i!==r&&this.setAttribute("class",r)}})):this:this.attr("class","")},toggleClass:function(A,e){var t,i,n,a,r=typeof A,o="string"===r||Array.isArray(A);return C(A)?this.each((function(t){p(this).toggleClass(A.call(this,t,ye(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(A):this.removeClass(A):(t=_e(A),this.each((function(){if(o)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=C(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,r="select-one"===A.type,o=r?null:[],s=r?a+1:n.length;for(i=a<0?s:r?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}},I.checkOn||(p.valHooks[this].get=function(A){return null===A.getAttribute("value")?"on":A.value})}));var De=A.location,ve={guid:Date.now()},we=/\?/;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,r,o,s,g,c,d,I,B=[i||u],E=l.call(e,"type")?e.type:e,f=l.call(e,"namespace")?e.namespace.split("."):[];if(r=I=o=i=i||u,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]),d=p.event.special[E]||{},n||!d.trigger||!1!==d.trigger.apply(i,t))){if(!n&&!d.noBubble&&!h(i)){for(s=d.delegateType||E,be.test(s+E)||(r=r.parentNode);r;r=r.parentNode)B.push(r),o=r;o===(i.ownerDocument||u)&&B.push(o.defaultView||o.parentWindow||A)}for(a=0;(r=B[a++])&&!e.isPropagationStopped();)I=r,e.type=a>1?s:d.bindType||E,(c=(aA.get(r,"events")||Object.create(null))[e.type]&&aA.get(r,"handle"))&&c.apply(r,t),(c=g&&r[g])&&c.apply&&iA(r)&&(e.result=c.apply(r,t),!1===e.result&&e.preventDefault());return e.type=E,n||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(B.pop(),t)||!iA(i)||g&&C(i[E])&&!h(i)&&((o=i[g])&&(i[g]=null),p.event.triggered=E,e.isPropagationStopped()&&I.addEventListener(E,Fe),i[E](),e.isPropagationStopped()&&I.removeEventListener(E,Fe),p.event.triggered=void 0,o&&(i[g]=o)),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=C(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=/#.*$/,Ge=/([?&])_=[^&]*/,Ye=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,Je=/^\/\//,He={},Ke={},Ve="*/".concat("*"),Oe=u.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(C(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 r(o){var s;return n[o]=!0,p.each(A[o]||[],(function(A,o){var g=o(e,t,i);return"string"!=typeof g||a||n[g]?a?!(s=g):void 0:(e.dataTypes.unshift(g),r(g),!1)})),s}return r(e.dataTypes[0])||!n["*"]&&r("*")}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,r,o,s,g,l,c,d,I=p.ajaxSetup({},t),C=I.context||I,h=I.context&&(C.nodeType||C.jquery)?p(C):p.event,B=p.Deferred(),E=p.Callbacks("once memory"),f=I.statusCode||{},Q={},x={},m="canceled",y={readyState:0,getResponseHeader:function(A){var e;if(g){if(!r)for(r={};e=Ye.exec(a);)r[e[1].toLowerCase()+" "]=(r[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=r[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&&(I.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(B.promise(y),I.url=((e||I.url||De.href)+"").replace(Je,De.protocol+"//"),I.type=t.method||t.type||I.method||I.type,I.dataTypes=(I.dataType||"*").toLowerCase().match(V)||[""],null==I.crossDomain){s=u.createElement("a");try{s.href=I.url,s.href=s.href,I.crossDomain=Oe.protocol+"//"+Oe.host!=s.protocol+"//"+s.host}catch(A){I.crossDomain=!0}}if(I.data&&I.processData&&"string"!=typeof I.data&&(I.data=p.param(I.data,I.traditional)),We(He,I,t,y),g)return y;for(c in(l=p.event&&I.global)&&0==p.active++&&p.event.trigger("ajaxStart"),I.type=I.type.toUpperCase(),I.hasContent=!Ue.test(I.type),n=I.url.replace(Le,""),I.hasContent?I.data&&I.processData&&0===(I.contentType||"").indexOf("application/x-www-form-urlencoded")&&(I.data=I.data.replace(Me,"+")):(d=I.url.slice(n.length),I.data&&(I.processData||"string"==typeof I.data)&&(n+=(we.test(n)?"&":"?")+I.data,delete I.data),!1===I.cache&&(n=n.replace(Ge,"$1"),d=(we.test(n)?"&":"?")+"_="+ve.guid+++d),I.url=n+d),I.ifModified&&(p.lastModified[n]&&y.setRequestHeader("If-Modified-Since",p.lastModified[n]),p.etag[n]&&y.setRequestHeader("If-None-Match",p.etag[n])),(I.data&&I.hasContent&&!1!==I.contentType||t.contentType)&&y.setRequestHeader("Content-Type",I.contentType),y.setRequestHeader("Accept",I.dataTypes[0]&&I.accepts[I.dataTypes[0]]?I.accepts[I.dataTypes[0]]+("*"!==I.dataTypes[0]?", "+Ve+"; q=0.01":""):I.accepts["*"]),I.headers)y.setRequestHeader(c,I.headers[c]);if(I.beforeSend&&(!1===I.beforeSend.call(C,y,I)||g))return y.abort();if(m="abort",E.add(I.complete),y.done(I.success),y.fail(I.error),i=We(Ke,I,t,y)){if(y.readyState=1,l&&h.trigger("ajaxSend",[y,I]),g)return y;I.async&&I.timeout>0&&(o=A.setTimeout((function(){y.abort("timeout")}),I.timeout));try{g=!1,i.send(Q,_)}catch(A){if(g)throw A;_(-1,A)}}else _(-1,"No Transport");function _(e,t,r,s){var c,d,u,Q,x,m=t;g||(g=!0,o&&A.clearTimeout(o),i=void 0,a=s||"",y.readyState=e>0?4:0,c=e>=200&&e<300||304===e,r&&(Q=function(A,e,t){for(var i,n,a,r,o=A.contents,s=A.dataTypes;"*"===s[0];)s.shift(),void 0===i&&(i=A.mimeType||e.getResponseHeader("Content-Type"));if(i)for(n in o)if(o[n]&&o[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}r||(r=n)}a=a||r}if(a)return a!==s[0]&&s.unshift(a),t[a]}(I,y,r)),!c&&p.inArray("script",I.dataTypes)>-1&&p.inArray("json",I.dataTypes)<0&&(I.converters["text script"]=function(){}),Q=function(A,e,t,i){var n,a,r,o,s,g={},l=A.dataTypes.slice();if(l[1])for(r in A.converters)g[r.toLowerCase()]=A.converters[r];for(a=l.shift();a;)if(A.responseFields[a]&&(t[A.responseFields[a]]=e),!s&&i&&A.dataFilter&&(e=A.dataFilter(e,A.dataType)),s=a,a=l.shift())if("*"===a)a=s;else if("*"!==s&&s!==a){if(!(r=g[s+" "+a]||g["* "+a]))for(n in g)if((o=n.split(" "))[1]===a&&(r=g[s+" "+o[0]]||g["* "+o[0]])){!0===r?r=g[n]:!0!==g[n]&&(a=o[0],l.unshift(o[1]));break}if(!0!==r)if(r&&A.throws)e=r(e);else try{e=r(e)}catch(A){return{state:"parsererror",error:r?A:"No conversion from "+s+" to "+a}}}return{state:"success",data:e}}(I,Q,y,c),c?(I.ifModified&&((x=y.getResponseHeader("Last-Modified"))&&(p.lastModified[n]=x),(x=y.getResponseHeader("etag"))&&(p.etag[n]=x)),204===e||"HEAD"===I.type?m="nocontent":304===e?m="notmodified":(m=Q.state,d=Q.data,c=!(u=Q.error))):(u=m,!e&&m||(m="error",e<0&&(e=0))),y.status=e,y.statusText=(t||m)+"",c?B.resolveWith(C,[d,m,y]):B.rejectWith(C,[y,m,u]),y.statusCode(f),f=void 0,l&&h.trigger(c?"ajaxSuccess":"ajaxError",[y,I,c?d:u]),E.fireWith(C,[y,m]),l&&(h.trigger("ajaxComplete",[y,I]),--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 C(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]&&(C(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 C(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=C(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();I.cors=!!qe&&"withCredentials"in qe,I.ajax=qe=!!qe,p.ajaxTransport((function(e){var t,i;if(I.cors||qe&&!e.crossDomain)return{send:function(n,a){var r,o=e.xhr();if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(r in e.xhrFields)o[r]=e.xhrFields[r];for(r in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)o.setRequestHeader(r,n[r]);t=function(A){return function(){t&&(t=i=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===A?o.abort():"error"===A?"number"!=typeof o.status?a(0,"error"):a(o.status,o.statusText):a(Xe[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=t(),i=o.onerror=o.ontimeout=t("error"),void 0!==o.onabort?o.onabort=i:o.onreadystatechange=function(){4===o.readyState&&A.setTimeout((function(){t&&i()}))},t=t("abort");try{o.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("