地质所 沉降监测网建设项目
suerwei
2024-05-22 fc15aa768cdb6c48ee8b21a5f43570c2f955a9ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).EZUIKit=t()}(this,(function(){"use strict";function e(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,n(a.key),a)}}function s(e,t,i){return t&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,i){return(t=n(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function c(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return u(e,t);var i=Object.prototype.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)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function h(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=d(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}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 r,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw r}}}}var f=function(){function e(t,i){r(this,e),this.coreX=t,this.coreY=i}return s(e,[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}}]),e}();Date.prototype.Format=function(e){var t={"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 i in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[i]:("00"+t[i]).substr((""+t[i]).length)));return e};var x=function(e,t,i,n){var a=document.getElementsByTagName("head")[0].getElementsByTagName("script"),r=!1;if(i)r=i();else for(var o=0;o<a.length;o++)a[o].getAttribute("src")==e&&(r=!0,a[o].readyState?a[o].onreadystatechange=function(){"complete"!=a[o].readyState&&"loaded"!=a[o].readyState||(a[o].onreadystatechange=null,t(n))}:a[o].onload=function(){t(n)});if(r)setTimeout((function(){t(n)}),15);else{var s=document.createElement("script");s.setAttribute("src",e),s.setAttribute("crossorigin",!0),s.onload=function(){return t(n)},document.getElementsByTagName("head")[0].appendChild(s)}},p=function(e,t){for(var i=document.getElementsByTagName("head")[0].getElementsByTagName("link"),n=!1,a=0;a<i.length;a++)i[a].getAttribute("href")==e&&(n=!0);if(!n){var r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,r.onload=t,document.getElementsByTagName("head")[0].appendChild(r)}},m=function(e){return!!e&&("object"===a(e)||"function"==typeof e)&&"function"==typeof e.then},_=function(e,t){var i=new RegExp("(\\?|#|&)"+e+"=(.*?)(#|&|$)"),n=(t||window.location.href).match(i);return decodeURIComponent(n?n[2]:"")},g=function(e,t){var i=t.parentNode;i.lastChild==t?i.appendChild(e):i.insertBefore(e,t.nextSibling)},y=function(e){var t=document.documentElement.clientWidth,i="";i+="width:"+document.documentElement.clientHeight+"px;",i+="height:"+t+"px;",i+="-webkit-transform: rotate(90.001deg); transform: rotate(90.001deg);",i+="-webkit-transform-origin: "+t/2+"px "+t/2+"px;",i+="transform-origin: "+t/2+"px "+t/2+"px;",i+="position: fixed;top: 0;left: 0;z-index:10",e.style.cssText=i},S=function(e){return function(e){if(console.log("requestFullScreen",document.getElementById(e)),-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome"))e.webkitRequestFullScreen();else{var t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;if(t)t.call(e);else if(void 0!==window.ActiveXObject){var i=new window.ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}}}(e),new Promise((function(e,t){var i=setInterval((function(){if(document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen)return clearInterval(i),e(!0)}),100),n=setTimeout((function(){document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen||t(!1),clearTimeout(n)}),2e3)}))},b=function(e){return document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen&&document.mozCancelFullScreen(),new Promise((function(e,t){var i=setInterval((function(){if(!(document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen))return clearInterval(i),e(!0)}),50),n=setTimeout((function(){(document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen)&&t(!1),clearTimeout(n)}),2e3)}))},P=function(e){return{deviceSerial:e.split("/")[3],channelNo:e.split("/")[4].split(".")[0],validCode:2===e.split("/")[2].split("@").length?e.split("/")[2].split("@")[0]:"",hd:-1!==e.indexOf(".hd"),type:-1!==e.indexOf(".cloud.rec")?"cloud.rec":"rec"}},E=function(e){var t=e.match(/\/([A-Za-z\d]{9})\_(\d)\_(\d)/);if(t.length>3){var i=t[1],n=t[2],a="1"===t[3],r="live";return e.indexOf("rec=local")>-1?r="rec":e.indexOf("rec=cloud")>-1&&(r="cloud.rec"),{deviceSerial:i,channelNo:n,hd:a,type:r}}return{}};var C=function(e,t,i,n,r,o){var s=e,l=new XMLHttpRequest;l.onreadystatechange=function(){if(4==l.readyState&&200==l.status)if(function(e){if("string"==typeof e)try{var t=JSON.parse(e);return!("object"!==a(t)||!t)}catch(e){return!1}console.log("It is not a string!")}(l.responseText)){var e=JSON.parse(l.responseText);r(e)}else r(l.responseText)},l.open(t,s,!0);var c=new FormData;for(var d in i)c.append(d,i[d]);if(n&&"object"===a(n))for(var d in n)l.setRequestHeader(d,n[d]);l.send(c)},T=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)},R=function(){function e(t,i){var n=this;r(this,e),x("https://open.ys7.com/assets/ezuikit_v3.4/js/hls.js",(function(){console.log("加载hls.min.js成功",window.Hls),console.log("isSupportHls",window.Hls.isSupported()),window.Hls.isSupported()&&n.initHLS(t,i)}),(function(){return!!window.Hls}))}return s(e,[{key:"toString",value:function(){return"hls ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initHLS",value:function(e,t){var i=E(t),n=i.deviceSerial,a=i.channelNo;i.hd,window.ezuikitMonitor.report({protocol:"hls",url:t,serial:n,no:a,action:1});var r=document.getElementById(e),o=new window.Hls({defaultAudioCodec:"mp4a.40.2"});o.loadSource(t),o.attachMedia(r),o.on(window.Hls.Events.MANIFEST_PARSED,(function(){r.play()})),o.on(window.Hls.Events.ERROR,(function(e,t){if(t.fatal)switch(t.type){case window.Hls.ErrorTypes.NETWORK_ERROR:console.log("fatal network error encountered, try to recover"),o.startLoad();break;case window.Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),o.recoverMediaError();break;default:o.destroy()}})),this.hls=o,this.video=r,this.hlsUrl=t}},{key:"play",value:function(){console.log("执行hls播放",this.video),this.hls.startLoad(),this.video.play()}},{key:"stop",value:function(){this.video.pause(),this.hls.stopLoad()}}]),e}(),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function I(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(e,t){!function(t,i){e.exports=i()}(self,(()=>(()=>{var e={99:e=>{var t,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function r(){r.init.call(this)}e.exports=r,e.exports.once=function(e,t){return new Promise((function(i,n){function a(i){e.removeListener(t,r),n(i)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",a),i([].slice.call(arguments))}p(e,t,r,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&p(e,"error",t,{once:!0})}(e,a)}))},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function c(e,t,i,n){var a,r,o,c;if(s(i),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),r=e._events),o=r[t]),void 0===o)o=r[t]=i,++e._eventsCount;else if("function"==typeof o?o=r[t]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(a=l(e))>0&&o.length>a&&!o.warned){o.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=o.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},a=d.bind(n);return a.listener=i,n.wrapFn=a,a}function h(e,t,i){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?i?[a.listener||a]:[a]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(a):x(a,a.length)}function f(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function x(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function p(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function a(r){n.once&&e.removeEventListener(t,a),i(r)}))}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return l(this)},r.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var a="error"===e,r=this._events;if(void 0!==r)a=a&&void 0===r.error;else if(!a)return!1;if(a){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=r[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,d=x(l,c);for(i=0;i<c;++i)n(d[i],this,t)}return!0},r.prototype.addListener=function(e,t){return c(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return c(this,e,t,!0)},r.prototype.once=function(e,t){return s(t),this.on(e,u(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,u(this,e,t)),this},r.prototype.removeListener=function(e,t){var i,n,a,r,o;if(s(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(a=-1,r=i.length-1;r>=0;r--)if(i[r]===t||i[r].listener===t){o=i[r].listener,a=r;break}if(a<0)return this;0===a?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,a),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var a,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(a=r[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},r.prototype.listeners=function(e){return h(this,e,!0)},r.prototype.rawListeners=function(e){return h(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},r.prototype.listenerCount=f,r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},994:(e,t,i)=>{i.d(t,{Z:()=>n});const n=class{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){const e=!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&e&&t}isSeekable(){return this.hasKeyframesIndex}getNearestKeyframe(e){if(null==this.keyframesIndex)return null;const t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}}_search(e,t){let i=0;const n=e.length-1;let a=0,r=0,o=n;for(t<e[0]&&(i=0,r=o+1);r<=o;){if(a=r+Math.floor((o-r)/2),a===n||t>=e[a]&&t<e[a+1]){i=a;break}e[a]<t?r=a+1:o=a-1}return i}}},68:(e,t,i)=>{i.d(t,{J1:()=>o,Vn:()=>r,Wk:()=>n,Yy:()=>a});class n{constructor(e,t,i,n,a){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=a,this.fileposition=null}}class a{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}class r{constructor(){this._list=[]}clear(){this._list=[]}appendArray(e){const t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))}getLastSyncPointBeforeDts(e){if(0===this._list.length)return null;const t=this._list;let i=0;const n=t.length-1;let a=0,r=0,o=n;for(e<t[0].dts&&(i=0,r=o+1);r<=o;){if(a=r+Math.floor((o-r)/2),a===n||e>=t[a].dts&&e<t[a+1].dts){i=a;break}t[a].dts<e?r=a+1:o=a-1}return this._list[i]}}class o{constructor(e){this._type=e,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return 0===this._list.length}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(e){var t;const i=this._list;if(0===i.length)return-2;const n=i.length-1;let a=0,r=0,o=n,s=0;if(e<i[0].originalBeginDts)return s=-1,s;for(;r<=o;){if(a=r+Math.floor((o-r)/2),a===n||e>((null===(t=i[a].lastSample)||void 0===t?void 0:t.originalDts)||0)&&e<i[a+1].originalBeginDts){s=a;break}i[a].originalBeginDts<e?r=a+1:o=a-1}return s}_searchNearestSegmentAfter(e){return this._searchNearestSegmentBefore(e)+1}append(e){var t,i;const n=this._list,a=e,r=this._lastAppendLocation;let o=0;-1!==r&&r<n.length&&a.originalBeginDts>=((null===(i=null===(t=n[r])||void 0===t?void 0:t.lastSample)||void 0===i?void 0:i.originalDts)||0)&&(r===n.length-1||r<n.length-1&&a.originalBeginDts<n[r+1].originalBeginDts)?o=r+1:n.length>0&&(o=this._searchNearestSegmentBefore(a.originalBeginDts)+1),this._lastAppendLocation=o,this._list.splice(o,0,a)}getLastSegmentBefore(e){const t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}getLastSampleBefore(e){const t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}getLastSyncPointBefore(e){let t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;for(;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null}}},943:(e,t,i)=>{i.d(t,{Z:()=>ke});var n=i(99),a=i(645),r=i(479),o=i(994);function s(e,t,i){const n=e;if(t+i<n.length){for(;i--;)if(128!=(192&n[++t]))return!1;return!0}return!1}const l=function(e){const t=[],i=e;let n=0;const a=e.length;for(;n<a;)if(i[n]<128)t.push(String.fromCharCode(i[n])),++n;else{if(i[n]<192);else if(i[n]<224){if(s(i,n,1)){const e=(31&i[n])<<6|63&i[n+1];if(e>=128){t.push(String.fromCharCode(65535&e)),n+=2;continue}}}else if(i[n]<240){if(s(i,n,2)){const e=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2];if(e>=2048&&55296!=(63488&e)){t.push(String.fromCharCode(65535&e)),n+=3;continue}}}else if(i[n]<248&&s(i,n,3)){let e=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3];if(e>65536&&e<1114112){e-=65536,t.push(String.fromCharCode(e>>>10|55296)),t.push(String.fromCharCode(1023&e|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")};var c=i(411);const d=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}();class u{static parseScriptData(e,t,i){const n={};try{const a=u.parseValue(e,t,i),r=u.parseValue(e,t+a.size,i-a.size);n[a.data]=r.data}catch(e){a.Z.e("AMF",e.toString())}return n}static parseObject(e,t,i){if(i<3)throw new c.rT("Data not enough when parse ScriptDataObject");const n=u.parseString(e,t,i),a=u.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}}static parseVariable(e,t,i){return u.parseObject(e,t,i)}static parseString(e,t,i){if(i<2)throw new c.rT("Data not enough when parse String");const n=new DataView(e,t,i).getUint16(0,!d);let a;return a=n>0?l(new Uint8Array(e,t+2,n)):"",{data:a,size:2+n}}static parseLongString(e,t,i){if(i<4)throw new c.rT("Data not enough when parse LongString");const n=new DataView(e,t,i).getUint32(0,!d);let a;return a=n>0?l(new Uint8Array(e,t+4,n)):"",{data:a,size:4+n}}static parseDate(e,t,i){if(i<10)throw new c.rT("Data size invalid when parse Date");const n=new DataView(e,t,i);let a=n.getFloat64(0,!d);return a+=60*n.getInt16(8,!d)*1e3,{data:new Date(a),size:10}}static parseValue(e,t,i){if(i<1)throw new c.rT("Data not enough when parse Value");const n=new DataView(e,t,i);let r=1;const o=n.getUint8(0);let s,l=!1;try{switch(o){case 0:s=n.getFloat64(1,!d),r+=8;break;case 1:s=!!n.getUint8(1),r+=1;break;case 2:{const n=u.parseString(e,t+1,i-1);s=n.data,r+=n.size;break}case 3:{s={};let a=0;for(9==(16777215&n.getUint32(i-4,!d))&&(a=3);r<i-4;){const n=u.parseObject(e,t+r,i-r-a);if(n.objectEnd)break;s[n.data.name]=n.data.value,r+=n.size}r<=i-3&&9==(16777215&n.getUint32(r-1,!d))&&(r+=3);break}case 8:{s={},r+=4;let a=0;for(9==(16777215&n.getUint32(i-4,!d))&&(a=3);r<i-8;){const n=u.parseVariable(e,t+r,i-r-a);if(n.objectEnd)break;s[n.data.name]=n.data.value,r+=n.size}r<=i-3&&9==(16777215&n.getUint32(r-1,!d))&&(r+=3);break}case 9:s=void 0,r=1,l=!0;break;case 10:{s=[];const a=n.getUint32(1,!d);r+=4;for(let n=0;n<a;n++){const n=u.parseValue(e,t+r,i-r);s.push(n.data),r+=n.size}break}case 11:{const n=u.parseDate(e,t+1,i-1);s=n.data,r+=n.size;break}case 12:{const n=u.parseString(e,t+1,i-1);s=n.data,r+=n.size;break}default:r=i,a.Z.w("AMF","Unsupported AMF value type "+o.toString())}}catch(e){a.Z.e("AMF",e.toString())}return{data:s,size:r,objectEnd:l}}}const h=u,f=class{constructor(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){var e;const t=this._total_bytes-this._buffer_index;if(t<=0)throw new c.rT("ExpGolomb: _fillCurrentWord() but no bytes available");const i=Math.min(4,t),n=new Uint8Array(4);n.set(null===(e=this._buffer)||void 0===e?void 0:e.subarray(this._buffer_index,this._buffer_index+i)),this._current_word=new DataView(n.buffer).getUint32(0,!1),this._buffer_index+=i,this._current_word_bits_left=8*i}readBits(e){if(e>32)throw new c.OC("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){const t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}let t=this._current_word_bits_left?this._current_word:0;t>>>=32-this._current_word_bits_left;const i=e-this._current_word_bits_left;this._fillCurrentWord();const 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=t<<n|a,t}readBool(){return 1===this.readBits(1)}readByte(){return this.readBits(8)}_skipLeadingZero(){let e;for(e=0;e<this._current_word_bits_left;e++)if(0!=(this._current_word&2147483648>>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}readUEG(){const e=this._skipLeadingZero();return this.readBits(e+1)-1}readSEG(){const e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}};class x{static _ebsp2rbsp(e){const t=e,i=t.byteLength,n=new Uint8Array(i);let a=0;for(let e=0;e<i;e++)e>=2&&3===t[e]&&0===t[e-1]&&0===t[e-2]||(n[a]=t[e],a++);return new Uint8Array(n.buffer,0,a)}static parseSPS(e){const t=e.subarray(1,4);let i="avc1.";for(let e=0;e<3;e++){let n=t[e].toString(16);n.length<2&&(n="0"+n),i+=n}const n=x._ebsp2rbsp(e);let a=new f(n);a.readByte();const r=a.readByte();a.readByte();const o=a.readByte();a.readUEG();const s=x.getProfileString(r),l=x.getLevelString(o);let c=1,d=420;let u=8,h=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(c=a.readUEG(),3===c&&a.readBits(1),c<=3&&(d=[0,420,422,444][c]),u=a.readUEG()+8,h=a.readUEG()+8,a.readBits(1),a.readBool())){const e=3!==c?8:12;for(let t=0;t<e;t++)a.readBool()&&(t<6?x._skipScalingList(a,16):x._skipScalingList(a,64))}a.readUEG();const p=a.readUEG();if(0===p)a.readUEG();else if(1===p){a.readBits(1),a.readSEG(),a.readSEG();const e=a.readUEG();for(let t=0;t<e;t++)a.readSEG()}const m=a.readUEG();a.readBits(1);const _=a.readUEG(),g=a.readUEG(),v=a.readBits(1);0===v&&a.readBits(1),a.readBits(1);let y=0,S=0,b=0,P=0;a.readBool()&&(y=a.readUEG(),S=a.readUEG(),b=a.readUEG(),P=a.readUEG());let E=1,C=1,T=0,R=!0,w=0,I=0;if(a.readBool()){if(a.readBool()){const e=a.readByte();e>0&&e<16?(E=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][e-1],C=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][e-1]):255===e&&(E=a.readByte()<<8|a.readByte(),C=a.readByte()<<8|a.readByte())}if(a.readBool()&&a.readBool(),a.readBool()&&(a.readBits(4),a.readBool()&&a.readBits(24)),a.readBool()&&(a.readUEG(),a.readUEG()),a.readBool()){const e=a.readBits(32),t=a.readBits(32);R=a.readBool(),w=t,I=2*e,T=w/I}}let D=1;1===E&&1===C||(D=E/C);let k=0,F=0;0===c?(k=1,F=2-v):(k=3===c?1:2,F=(1===c?2:1)*(2-v));let A=16*(_+1),M=16*(g+1)*(2-v);A-=(y+S)*k,M-=(b+P)*F;const L=Math.ceil(A*D);return a.destroy(),a=null,{codec_mimetype:i,profile_idc:r,level_idc:o,profile_string:s,level_string:l,chroma_format_idc:c,bit_depth:u,bit_depth_luma:u,bit_depth_chroma:h,ref_frames:m,chroma_format:d,chroma_format_string:x.getChromaFormatString(d),frame_rate:{fixed:R,fps:T,fps_den:I,fps_num:w},sar_ratio:{width:E,height:C},codec_size:{width:A,height:M},present_size:{width:L,height:M}}}static _skipScalingList(e,t){let i=8,n=8,a=0;for(let r=0;r<t;r++)0!==n&&(a=e.readSEG(),n=(i+a+256)%256),i=0===n?i:n}static getProfileString(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(e){return(e/10).toFixed(1)}static getChromaFormatString(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}const p=x;var m=i(898);class _{static _ebsp2rbsp(e){const t=e,i=t.byteLength,n=new Uint8Array(i);let a=0;for(let e=0;e<i;e++)e>=2&&3===t[e]&&0===t[e-1]&&0===t[e-2]||(n[a]=t[e],a++);return new Uint8Array(n.buffer,0,a)}static parseVPS(e){const t=_._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()}}static parseSPS(e){const t=_._ebsp2rbsp(e);let i=new f(t);i.readByte(),i.readByte();let n=0,a=0,r=0,o=0;i.readBits(4);const s=i.readBits(3),l=(i.readBool(),i.readBits(2)),c=i.readBool(),d=i.readBits(5),u=i.readByte(),h=i.readByte(),x=i.readByte(),p=i.readByte(),m=i.readByte(),g=i.readByte(),v=i.readByte(),y=i.readByte(),S=i.readByte(),b=i.readByte(),P=i.readByte(),E=[],C=[];for(let e=0;e<s;e++)E.push(i.readBool()),C.push(i.readBool());if(s>0)for(let e=s;e<8;e++)i.readBits(2);for(let e=0;e<s;e++)E[e]&&(i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte()),C[e]&&i.readByte();i.readUEG();const T=i.readUEG();3===T&&i.readBits(1);const R=i.readUEG(),w=i.readUEG();i.readBool()&&(n+=i.readUEG(),a+=i.readUEG(),r+=i.readUEG(),o+=i.readUEG());const I=i.readUEG(),D=i.readUEG(),k=i.readUEG();for(let e=i.readBool()?0:s;e<=s;e++)i.readUEG(),i.readUEG(),i.readUEG();if(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readBool()&&i.readBool())for(let e=0;e<4;e++)for(let t=0;t<(3===e?2:6);t++)if(i.readBool()){const t=Math.min(64,1<<4+(e<<1));e>1&&i.readSEG();for(let e=0;e<t;e++)i.readSEG()}else i.readUEG();i.readBool(),i.readBool(),i.readBool()&&(i.readByte(),i.readUEG(),i.readUEG(),i.readBool());const F=i.readUEG();let A=0;for(let e=0;e<F;e++){let t=!1;if(0!==e&&(t=i.readBool()),t){e===F&&i.readUEG(),i.readBool(),i.readUEG();let t=0;for(let e=0;e<=A;e++){const e=i.readBool();let n=!1;e||(n=i.readBool()),(e||n)&&t++}A=t}else{const e=i.readUEG(),t=i.readUEG();A=e+t;for(let t=0;t<e;t++)i.readUEG(),i.readBool();for(let e=0;e<t;e++)i.readUEG(),i.readBool()}}if(i.readBool()){const e=i.readUEG();for(let t=0;t<e;t++){for(let e=0;e<k+4;e++)i.readBits(1);i.readBits(1)}}let M=!1,L=0,B=1,O=1,j=!1,N=1,U=1;if(i.readBool(),i.readBool(),i.readBool()){if(i.readBool()){const e=i.readByte();e>0&&e<=16?(B=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][e-1],O=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][e-1]):255===e&&(B=i.readBits(16),O=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(),M=i.readBool(),M&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(N=i.readBits(32),U=i.readBits(32),i.readBool()&&i.readUEG(),i.readBool())){let e=!1,t=!1,n=!1;e=i.readBool(),t=i.readBool(),(e||t)&&(n=i.readBool(),n&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),n&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5));for(let a=0;a<=s;a++){const a=i.readBool();j=a;let r=!1,o=1;a||(r=i.readBool());let s=!1;if(r?i.readSEG():s=i.readBool(),s||(o=i.readUEG()+1),e)for(let e=0;e<o;e++)i.readUEG(),i.readUEG(),n&&(i.readUEG(),i.readUEG());if(t)for(let e=0;e<o;e++)i.readUEG(),i.readUEG(),n&&(i.readUEG(),i.readUEG())}}i.readBool()&&(i.readBool(),i.readBool(),i.readBool(),L=i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG())}i.readBool();const z=`hvc1.${d}.1.L${P}.B0`,H=R-(n+a)*(1===T||2===T?2:1),V=w-(r+o)*(1===T?2:1);let Z=1;return 1!==B&&1!==O&&(Z=B/O),i.destroy(),i=null,{codec_mimetype:z,level_string:_.getLevelString(P),profile_idc:d,bit_depth:I+8,ref_frames:1,chroma_format:T,chroma_format_string:_.getChromaFormatString(T),general_level_idc:P,general_profile_space:l,general_tier_flag:c,general_profile_idc:d,general_profile_compatibility_flags_1:u,general_profile_compatibility_flags_2:h,general_profile_compatibility_flags_3:x,general_profile_compatibility_flags_4:p,general_constraint_indicator_flags_1:m,general_constraint_indicator_flags_2:g,general_constraint_indicator_flags_3:v,general_constraint_indicator_flags_4:y,general_constraint_indicator_flags_5:S,general_constraint_indicator_flags_6:b,min_spatial_segmentation_idc:L,constant_frame_rate:0,chroma_format_idc:T,bit_depth_luma_minus8:I,bit_depth_chroma_minus8:D,frame_rate:{fixed:j,fps:U/N,fps_den:N,fps_num:U},sar_ratio:{width:B,height:O},codec_size:{width:H,height:V},present_size:{width:H*Z,height:V}}}static parsePPS(e){const t=_._ebsp2rbsp(e),i=new f(t);i.readByte(),i.readByte(),i.readUEG(),i.readUEG(),i.readBool(),i.readBool(),i.readBits(3),i.readBool(),i.readBool(),i.readUEG(),i.readUEG(),i.readSEG(),i.readBool(),i.readBool(),i.readBool()&&i.readUEG(),i.readSEG(),i.readSEG(),i.readBool(),i.readBool(),i.readBool(),i.readBool();const n=i.readBool(),a=i.readBool();let r=1;return a&&n?r=0:a?r=3:n&&(r=2),{parallelismType:r}}static getChromaFormatString(e){switch(e){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}}static getProfileString(e){switch(e){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}}static getLevelString(e){return(e/30).toFixed(1)}}const g=_;function v(e){return e.byteOffset%2==0&&e.byteLength%2==0}function y(e){return e.byteOffset%4==0&&e.byteLength%4==0}function S(e,t){for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const b=function(e,t){return e.byteLength===t.byteLength&&(y(e)&&y(t)?function(e,t){return S(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))}(e,t):v(e)&&v(t)?function(e,t){return S(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))}(e,t):function(e,t){return S(e,t)}(e,t))};class P{static parseOBUs(e){let t=null;for(let i=0;i<e.byteLength;){e[i];const n=(120&e[i])>>3,a=0!=(4&e[i]),r=0!=(2&e[i]);e[i],i+=1,a&&(i+=1);let o=Number.POSITIVE_INFINITY;if(r){o=0;for(let t=0;o|=(127&e[i])<<7*t,i+=1,0!=(128&e[i]);t++);}1===n&&(t=P.parseSeuqneceHeader(e.subarray(i,i+o))),i+=o}return t}static parseSeuqneceHeader(e){let t=new f(e);const i=t.readBits(3),n=(t.readBool(),t.readBool());let a=!0,r=0,o=0;const s=[];if(n)s.push({operating_point_idc:0,level:t.readBits(5),tier:0});else{if(t.readBool()){const e=t.readBits(32),i=t.readBits(32),n=t.readBool();if(n){let e=0;for(;0===t.readBits(1);)e+=1;e>=32||t.readBits(e)}o=e,r=i,a=n,t.readBool()&&(t.readBits(5),t.readBits(32),t.readBits(5),t.readBits(5))}const e=t.readBool(),i=t.readBits(5);for(let n=0;n<=i;n++){const i=t.readBits(12),n=t.readBits(5),a=n>7?t.readBits(1):0;s.push({operating_point_idc:i,level:n,tier:a}),e&&t.readBool()&&t.readBits(4)}}const{level:l,tier:c}=s[0],d=t.readBits(4),u=t.readBits(4),h=t.readBits(d+1)+1,x=t.readBits(u+1)+1;let p=!1;n||(p=t.readBool()),p&&(t.readBits(4),t.readBits(4)),t.readBool(),t.readBool(),t.readBool();let m=!1,_=2;n||(t.readBool(),t.readBool(),t.readBool(),t.readBool(),m=t.readBool(),m&&(t.readBool(),t.readBool()),_=t.readBool()?2:t.readBits(1),_&&(t.readBool()||t.readBits(1)),m&&t.readBits(3)),t.readBool(),t.readBool(),t.readBool();const g=t.readBool();let v=8;v=2===i&&g?t.readBool()?12:10:g?10:8;let y=!1;1!==i&&(y=t.readBool()),t.readBool()&&(t.readBits(8),t.readBits(8),t.readBits(8));let S=1,b=1;return y?(t.readBits(1),S=1,b=1):(t.readBits(1),0===i?(S=1,b=1):1===i?(S=0,b=0):12===v?t.readBits(1)&&t.readBits(1):(S=1,b=0),S&&b&&t.readBits(2),t.readBits(1)),t.readBool(),t.destroy(),t=null,{codec_mimetype:`av01.${i}.${P.getLevelString(l,c)}.${v.toString(10).padStart(2,"0")}`,level:l,tier:c,level_string:P.getLevelString(l,c),profile_idc:i,profile_string:`${i}`,bit_depth:v,ref_frames:1,chroma_format:P.getChromaFormat(y,S,b),chroma_format_string:P.getChromaFormatString(y,S,b),frame_rate:{fixed:a,fps:r/o,fps_den:o,fps_num:r},sar_ratio:{width:1,height:1},codec_size:{width:h,height:x},present_size:{width:1*h,height:x}}}static getLevelString(e,t){return`${e.toString(10).padStart(2,"0")}${0===t?"M":"H"}`}static getChromaFormat(e,t,i){return e?0:0===t&&0===i?3:1===t&&0===i?2:1===t&&1===i?1:Number.NaN}static getChromaFormatString(e,t,i){return e?"4:0:0":0===t&&0===i?"4:4:4":1===t&&0===i?"4:2:2":1===t&&1===i?"4:2:0":"Unknown"}}const E=P;class C{constructor(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new o.Z,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}destroy(){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}static probe(e){const t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};const i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;const n=(4&t[4])>>>2!=0,a=0!=(1&t[4]),r=(o=t)[5]<<24|o[6]<<16|o[7]<<8|o[8];var o;return r<9?i:{match:!0,consumed:r,dataOffset:r,hasAudioTrack:n,hasVideoTrack:a}}bindDataSource(e){return e.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(e){this._onTrackMetadata=e}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(e){this._onMediaInfo=e}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(e){this._onMetaDataArrived=e}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(e){this._onScriptDataArrived=e}get onError(){return this._onError}set onError(e){this._onError=e}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(e){this._onDataAvailable=e}get timestampBase(){return this._timestampBase}set timestampBase(e){this._timestampBase=e}get overridedDuration(){return this._duration}set overridedDuration(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo&&(this._mediaInfo.duration=e)}set overridedHasAudio(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo&&(this._mediaInfo.hasAudio=e)}set overridedHasVideo(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo&&(this._mediaInfo.hasVideo=e)}resetMediaInfo(){this._mediaInfo=new o.Z}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched}parseChunks(e,t){var i,n;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new c.rT("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let r=0;const o=this._littleEndian;if(0===t){if(!(e.byteLength>13))return 0;{const t=C.probe(e);r=(null==t?void 0:t.dataOffset)||0}}for(this._firstParse&&(this._firstParse=!1,t+r!==this._dataOffset&&a.Z.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==new DataView(e,r).getUint32(0,!o)&&a.Z.w(this.TAG,"PrevTagSize0 !== 0 !!!"),r+=4);r<e.byteLength;){this._dispatch=!0;const i=new DataView(e,r);if(r+11+4>e.byteLength)break;const n=i.getUint8(0),s=16777215&i.getUint32(0,!o);if(r+11+s+4>e.byteLength)break;if(8!==n&&9!==n&&18!==n){a.Z.w(this.TAG,`Unsupported tag type ${n}, skipped`),r+=11+s+4;continue}const l=i.getUint8(4),c=i.getUint8(5),d=i.getUint8(6)|c<<8|l<<16|i.getUint8(7)<<24;0!=(16777215&i.getUint32(7,!o))&&a.Z.w(this.TAG,"Meet tag which has StreamID != 0!");const u=r+11;switch(n){case 8:this._parseAudioData(e,u,s,d);break;case 9:this._parseVideoData(e,u,s,d,t+r);break;case 18:this._parseScriptData(e,u,s)}const h=i.getUint32(11+s,!o);h!==11+s&&a.Z.w(this.TAG,`Invalid PrevTagSize ${h}`),r+=11+s+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),r}_parseScriptData(e,t,i){var n,r,o;const s=h.parseScriptData(e,t,i);if(s.hasOwnProperty("onMetaData")){if(null==s.onMetaData||"object"!=typeof s.onMetaData)return void a.Z.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&a.Z.w(this.TAG,"Found another onMetaData tag!"),this._metadata=s;const e=null===(n=this._metadata)||void 0===n?void 0:n.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},e)),"boolean"==typeof(null==e?void 0:e.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=e.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==e?void 0:e.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=e.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==e?void 0:e.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=e.audiodatarate),"number"==typeof(null==e?void 0:e.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=e.videodatarate),"number"==typeof(null==e?void 0:e.width)&&this._mediaInfo&&(this._mediaInfo.width=e.width),"number"==typeof(null==e?void 0:e.height)&&this._mediaInfo&&(this._mediaInfo.height=e.height),"number"==typeof(null==e?void 0:e.duration)){if(!this._durationOverrided){const t=Math.floor(e.duration*this._timescale);this._duration=t,this._mediaInfo&&(this._mediaInfo.duration=t)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==e?void 0:e.framerate)){const t=Math.floor(1e3*e.framerate);if(t>0){const e=t/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=e,this._referenceFrameRate.fps_num=t,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=e)}}if("object"==typeof(null==e?void 0:e.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);const t=e.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(t)),e.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=e),a.Z.v(this.TAG,"Parsed onMetaData"),(null===(r=this._mediaInfo)||void 0===r?void 0:r.isComplete())&&(null===(o=this._onMediaInfo)||void 0===o||o.call(this,this._mediaInfo))}Object.keys(s).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},s))}_parseKeyframesIndex(e){const t=[],i=[];for(let n=1;n<e.times.length;n++){const a=this._timestampBase+Math.floor(1e3*e.times[n]);t.push(a),i.push(e.filepositions[n])}return{times:t,filepositions:i}}_parseAudioData(e,t,i,n){var r,o,s,l,c,d,u,h,f,x;if(i<=1)return void a.Z.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");if(this._hasAudioFlagOverrided&&!1===this._hasAudio)return;this._littleEndian;const p=new DataView(e,t,i).getUint8(0),_=p>>>4;if(2!==_&&10!==_)return void(null===(r=this._onError)||void 0===r||r.call(this,m.Z.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+_));let g=0;const v=(12&p)>>>2;if(!(v>=0&&v<=4))return void(null===(o=this._onError)||void 0===o||o.call(this,m.Z.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+v));g=this._flvSoundRateTable[v];const y=1&p;let S=this._audioMetadata;const P=this._audioTrack;if(S||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),S=this._audioMetadata={},S.type="audio",S.id=null==P?void 0:P.id,S.timescale=this._timescale,S.duration=this._duration,S.audioSampleRate=g,S.channelCount=0===y?1:2),10===_){const r=this._parseAACAudioData(e,t+1,i-1);if(void 0===r)return;if(0===(null==r?void 0:r.packetType)){if(null==S?void 0:S.config){if(b(r.data.config,null==S?void 0:S.config))return;a.Z.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}const e=r.data;S.audioSampleRate=null==e?void 0:e.samplingRate,S.channelCount=null==e?void 0:e.channelCount,S.codec=null==e?void 0:e.codec,S.originalCodec=null==e?void 0:e.originalCodec,S.config=null==e?void 0:e.config,S.refSampleDuration=1024/S.audioSampleRate*S.timescale,a.Z.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(c=this._onDataAvailable)||void 0===c||c.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"audio",S);const t=this._mediaInfo;t.audioCodec=S.originalCodec||"",t.audioSampleRate=S.audioSampleRate,t.audioChannelCount=S.channelCount,t.hasVideo?null!=t.videoCodec&&(t.mimeType='video/x-flv; codecs="'+t.videoCodec+","+t.audioCodec+'"'):t.mimeType='video/x-flv; codecs="'+t.audioCodec+'"',(null==t?void 0:t.isComplete())&&(null===(u=this._onMediaInfo)||void 0===u||u.call(this,t))}else if(1===r.packetType){const e=this._timestampBase+n,t={unit:r.data,length:r.data.byteLength,dts:e,pts:e};P&&(null==P||P.samples.push(t),P.length+=(null===(h=null==r?void 0:r.data)||void 0===h?void 0:h.length)||0)}else a.Z.e(this.TAG,`Flv: Unsupported AAC data type ${r.packetType}`)}else if(2===_){if(!S.codec){const n=this._parseMP3AudioData(e,t+1,i-1,!0);if(void 0===n)return;S.audioSampleRate=n.samplingRate,S.channelCount=n.channelCount,S.codec=n.codec,S.originalCodec=n.originalCodec,S.refSampleDuration=1152/S.audioSampleRate*S.timescale,a.Z.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(f=this._onTrackMetadata)||void 0===f||f.call(this,"audio",S);const r=this._mediaInfo;r.audioCodec=S.codec,r.audioSampleRate=S.audioSampleRate,r.audioChannelCount=S.channelCount,r.audioDataRate=n.bitRate,(null==r?void 0:r.hasVideo)?null!=r.videoCodec&&(r.mimeType='video/x-flv; codecs="'+r.videoCodec+","+r.audioCodec+'"'):r.mimeType='video/x-flv; codecs="'+r.audioCodec+'"',r.isComplete()&&(null===(x=this._onMediaInfo)||void 0===x||x.call(this,r))}const r=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0===r)return;const o=this._timestampBase+n,s={unit:r,length:r.byteLength,dts:o,pts:o};null==P||P.samples.push(s),P&&(P.length+=r.length)}}_parseAACAudioData(e,t,i){if(i<=1)return void a.Z.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");const n={},r=new Uint8Array(e,t,i);return n.packetType=r[0],0===r[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=r.subarray(1),n}_parseAACAudioSpecificConfig(e,t,i){var n,a;const r=new Uint8Array(e,t,i);let o=null,s=0,l=0,c=0,d=null;if(s=l=r[0]>>>3,c=(7&r[0])<<1|r[1]>>>7,c<0||c>=this._mpegSamplingRates.length)return void(null===(n=this._onError)||void 0===n||n.call(this,m.Z.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!"));const u=this._mpegSamplingRates[c],h=(120&r[1])>>>3;if(h<0||h>=8)return void(null===(a=this._onError)||void 0===a||a.call(this,m.Z.FORMAT_ERROR,"Flv: AAC invalid channel configuration"));5===s&&(d=(7&r[1])<<1|r[2]>>>7,r[2]);const f=self.navigator.userAgent.toLowerCase();return f.includes("firefox")?c>=6?(s=5,o=new Array(4),d=c-3):(s=2,o=new Array(2),d=c):f.includes("android")?(s=2,o=new Array(2),d=c):(s=5,d=c,o=new Array(4),c>=6?d=c-3:1===h&&(s=2,o=new Array(2),d=c)),o[0]=s<<3,o[0]|=(15&c)>>>1,o[1]=(15&c)<<7,o[1]|=(15&h)<<3,5===s&&(o[1]|=(15&d)>>>1,o[2]=(1&d)<<7,o[2]|=8,o[3]=0),{config:o,samplingRate:u,channelCount:h,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+l}}_parseMP3AudioData(e,t,i,n){if(i<4)return void a.Z.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");this._littleEndian;const r=new Uint8Array(e,t,i);let o;if(n){if(255!==r[0])return;const e=r[1]>>>3&3,t=(6&r[1])>>1,i=(240&r[2])>>>4,n=(12&r[2])>>>2,a=3!=(r[3]>>>6&3)?2:1;let s=0,l=0;const c="mp3";switch(e){case 0:s=this._mpegAudioV25SampleRateTable[n];break;case 2:s=this._mpegAudioV20SampleRateTable[n];break;case 3:s=this._mpegAudioV10SampleRateTable[n]}switch(t){case 1:i<this._mpegAudioL3BitRateTable.length&&(l=this._mpegAudioL3BitRateTable[i]);break;case 2:i<this._mpegAudioL2BitRateTable.length&&(l=this._mpegAudioL2BitRateTable[i]);break;case 3:i<this._mpegAudioL1BitRateTable.length&&(l=this._mpegAudioL1BitRateTable[i])}o={bitRate:l,samplingRate:s,channelCount:a,codec:c,originalCodec:c}}else o=r;return o}_parseVideoData(e,t,i,n,r){var o,s;if(i<=1)return void a.Z.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");if(this._hasVideoFlagOverrided&&!1===this._hasVideo)return;const l=new Uint8Array(e,t,i)[0],c=(112&l)>>>4;if(0!=(128&l)){const a=15&l,o=String.fromCharCode(...new Uint8Array(e,t,i).slice(1,5));"hvc1"===o?this._parseEnhancedHEVCVideoPacket(e,t+5,i-5,n,r,c,a):"av01"===o?this._parseEnhancedAV1VideoPacket(e,t+5,i-5,n,r,c,a):null===(s=this._onError)||void 0===s||s.call(this,m.Z.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${o}`)}else{const a=15&l;7===a?this._parseAVCVideoPacket(e,t+1,i-1,n,r,c):12===a?this._parseHEVCVideoPacket(e,t+1,i-1,n,r,c):null===(o=this._onError)||void 0===o||o.call(this,m.Z.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${a}`)}}_parseAVCVideoPacket(e,t,i,n,r,o){var s;if(i<4)return void a.Z.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");const l=this._littleEndian,c=new DataView(e,t,i),d=c.getUint8(0),u=(16777215&c.getUint32(0,!l))<<8>>8;0===d?this._parseAVCDecoderConfigurationRecord(e,t+4,i-4):1===d?this._parseAVCVideoData(e,t+4,i-4,n,r,o,u):2===d||null===(s=this._onError)||void 0===s||s.call(this,m.Z.FORMAT_ERROR,`Flv: Invalid video packet type ${d}`)}_parseHEVCVideoPacket(e,t,i,n,r,o){var s;if(i<4)return void a.Z.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");const l=this._littleEndian,c=new DataView(e,t,i),d=c.getUint8(0),u=(16777215&c.getUint32(0,!l))<<8>>8;0===d?this._parseHEVCDecoderConfigurationRecord(e,t+4,i-4):1===d?this._parseHEVCVideoData(e,t+4,i-4,n,r,o,u):2===d||null===(s=this._onError)||void 0===s||s.call(this,m.Z.FORMAT_ERROR,`Flv: Invalid video packet type ${d}`)}_parseEnhancedHEVCVideoPacket(e,t,i,n,a,r,o){var s;const l=this._littleEndian,c=new DataView(e,t,i);if(0===o)this._parseHEVCDecoderConfigurationRecord(e,t,i);else if(1===o){const o=(4294967040&c.getUint32(0,!l))>>8;this._parseHEVCVideoData(e,t+3,i-3,n,a,r,o)}else 3===o?this._parseHEVCVideoData(e,t,i,n,a,r,0):2===o||null===(s=this._onError)||void 0===s||s.call(this,m.Z.FORMAT_ERROR,`Flv: Invalid video packet type ${o}`)}_parseEnhancedAV1VideoPacket(e,t,i,n,a,r,o){var s,l;this._littleEndian,0===o?this._parseAV1CodecConfigurationRecord(e,t,i):1===o?this._parseAV1VideoData(e,t,i,n,a,r,0):5===o?null===(s=this._onError)||void 0===s||s.call(this,m.Z.FORMAT_ERROR,`Flv: Not Suported MP2T AV1 video packet type ${o}`):2===o||null===(l=this._onError)||void 0===l||l.call(this,m.Z.FORMAT_ERROR,`Flv: Invalid video packet type ${o}`)}_parseAVCDecoderConfigurationRecord(e,t,i){var n,r,o,s,l,c,d,u,h,f,x;if(i<7)return void a.Z.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");let _=this._videoMetadata;const g=this._videoTrack,v=this._littleEndian,y=new DataView(e,t,i);if(_){if(void 0!==_.avcc){const n=new Uint8Array(e,t,i);if(b(n,_.avcc))return;a.Z.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)),_=this._videoMetadata={},_.type="video",_.id=null==g?void 0:g.id,_.timescale=this._timescale,_.duration=this._duration;const S=y.getUint8(0),P=y.getUint8(1);if(y.getUint8(2),y.getUint8(3),1!==S||0===P)return void(null===(n=this._onError)||void 0===n||n.call(this,m.Z.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord"));if(this._naluLengthSize=1+(3&y.getUint8(4)),3!==this._naluLengthSize&&4!==this._naluLengthSize)return void(null===(r=this._onError)||void 0===r||r.call(this,m.Z.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1)));const E=31&y.getUint8(5);if(0===E)return void(null===(o=this._onError)||void 0===o||o.call(this,m.Z.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS"));E>1&&a.Z.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${E}`);let C=6;for(let i=0;i<E;i++){const n=y.getUint16(C,!v);if(C+=2,0===n)continue;const a=new Uint8Array(e,t+C,n);C+=n;const r=p.parseSPS(a);if(0!==i)continue;_.codecWidth=r.codec_size.width,_.codecHeight=r.codec_size.height,_.presentWidth=r.present_size.width,_.presentHeight=r.present_size.height,_.profile=r.profile_string,_.level=r.level_string,_.bitDepth=r.bit_depth,_.chromaFormat=r.chroma_format,_.sarRatio=r.sar_ratio,_.frameRate=r.frame_rate,r.frame_rate.fixed&&0!==r.frame_rate.fps_num&&0!==r.frame_rate.fps_den||(_.frameRate=this._referenceFrameRate);const o=null===(s=_.frameRate)||void 0===s?void 0:s.fps_den,d=null===(l=_.frameRate)||void 0===l?void 0:l.fps_num;_.refSampleDuration=_.timescale*(o/d);const u=a.subarray(1,4);let h="avc1.";for(let e=0;e<3;e++){let t=u[e].toString(16);t.length<2&&(t="0"+t),h+=t}_.codec=h;const f=this._mediaInfo;f.width=_.codecWidth,f.height=_.codecHeight,f.fps=_.frameRate.fps,f.profile=_.profile,f.level=_.level,f.refFrames=r.ref_frames,f.chromaFormat=r.chroma_format_string,f.sarNum=_.sarRatio.width,f.sarDen=_.sarRatio.height,f.videoCodec=h,f.hasAudio?null!=f.audioCodec&&(f.mimeType='video/x-flv; codecs="'+f.videoCodec+","+f.audioCodec+'"'):f.mimeType='video/x-flv; codecs="'+f.videoCodec+'"',f.isComplete()&&(null===(c=this._onMediaInfo)||void 0===c||c.call(this,f))}const T=y.getUint8(C);if(0!==T){T>1&&a.Z.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${T}`),C++;for(let e=0;e<T;e++){const e=y.getUint16(C,!v);C+=2,0!==e&&(C+=e)}_.avcc=new Uint8Array(i),_.avcc.set(new Uint8Array(e,t,i),0),a.Z.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(u=this._audioTrack)||void 0===u?void 0:u.length)||(null===(h=this._videoTrack)||void 0===h?void 0:h.length))&&(null===(f=this._onDataAvailable)||void 0===f||f.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(x=this._onTrackMetadata)||void 0===x||x.call(this,"video",_)}else null===(d=this._onError)||void 0===d||d.call(this,m.Z.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}_parseHEVCDecoderConfigurationRecord(e,t,i){var n,r,o,s,l,c,d;if(i<22)return void a.Z.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");let u=this._videoMetadata;const h=this._videoTrack,f=this._littleEndian,x=new DataView(e,t,i);if(u){if(void 0!==u.hvcc){const n=new Uint8Array(e,t,i);if(b(n,u.hvcc))return;a.Z.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),u=this._videoMetadata={},u.type="video",u.id=null==h?void 0:h.id,u.timescale=this._timescale,u.duration=this._duration;const p=x.getUint8(0),_=31&x.getUint8(1);if(1!==p||0===_)return void(null===(n=this._onError)||void 0===n||n.call(this,m.Z.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord"));if(this._naluLengthSize=1+(3&x.getUint8(21)),3!==this._naluLengthSize&&4!==this._naluLengthSize)return void(null===(r=this._onError)||void 0===r||r.call(this,m.Z.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1)));const v=x.getUint8(22);for(let i=0,n=23;i<v;i++){const i=63&x.getUint8(n+0),a=x.getUint16(n+1,!f);n+=3;for(let r=0;r<a;r++){const a=x.getUint16(n+0,!f);if(0===r)if(33===i){n+=2;const i=new Uint8Array(e,t+n,a),r=g.parseSPS(i);u.codecWidth=r.codec_size.width,u.codecHeight=r.codec_size.height,u.presentWidth=r.present_size.width,u.presentHeight=r.present_size.height,u.profile=null==r?void 0:r.profile_string,u.level=r.level_string,u.bitDepth=r.bit_depth,u.chromaFormat=r.chroma_format,u.sarRatio=r.sar_ratio,u.frameRate=r.frame_rate,r.frame_rate.fixed&&0!==r.frame_rate.fps_num&&0!==r.frame_rate.fps_den||(u.frameRate=this._referenceFrameRate);const s=u.frameRate.fps_den,l=u.frameRate.fps_num;u.refSampleDuration=u.timescale*(s/l),u.codec=r.codec_mimetype;const c=this._mediaInfo;c.width=u.codecWidth,c.height=u.codecHeight,c.fps=u.frameRate.fps,c.profile=u.profile,c.level=u.level,c.refFrames=r.ref_frames,c.chromaFormat=r.chroma_format_string,c.sarNum=u.sarRatio.width,c.sarDen=u.sarRatio.height,c.videoCodec=r.codec_mimetype,c.hasAudio?null!=c.audioCodec&&(c.mimeType='video/x-flv; codecs="'+c.videoCodec+","+c.audioCodec+'"'):c.mimeType='video/x-flv; codecs="'+c.videoCodec+'"',c.isComplete()&&(null===(o=this._onMediaInfo)||void 0===o||o.call(this,c)),n+=a}else n+=2+a;else n+=2+a}}u.hvcc=new Uint8Array(i),u.hvcc.set(new Uint8Array(e,t,i),0),a.Z.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(c=this._onDataAvailable)||void 0===c||c.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"video",u)}_parseAV1CodecConfigurationRecord(e,t,i){var n,r,o,s,l,c,d,u,h,f,x;if(i<4)return void a.Z.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");let p=this._videoMetadata;const _=this._videoTrack,g=(this._littleEndian,new DataView(e,t,i));p?void 0!==p.av1c&&a.Z.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),p=this._videoMetadata={},p.type="video",p.id=null==_?void 0:_.id,p.timescale=this._timescale,p.duration=this._duration);const v=127&g.getUint8(0);if(g.getUint8(1),g.getUint8(1),g.getUint8(2),1!==v)return void(null===(n=this._onError)||void 0===n||n.call(this,m.Z.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord"));const y=E.parseOBUs(new Uint8Array(e,t+4,i-4));if(null==y)return void(null===(r=this._onError)||void 0===r||r.call(this,m.Z.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord"));p.codecWidth=null===(o=null==y?void 0:y.codec_size)||void 0===o?void 0:o.width,p.codecHeight=null===(s=null==y?void 0:y.codec_size)||void 0===s?void 0:s.height,p.presentWidth=null===(l=null==y?void 0:y.present_size)||void 0===l?void 0:l.width,p.presentHeight=null===(c=null==y?void 0:y.present_size)||void 0===c?void 0:c.height,p.profile=y.profile_string,p.level=y.level_string,p.bitDepth=y.bit_depth,p.chromaFormat=y.chroma_format,p.sarRatio=y.sar_ratio,p.frameRate=y.frame_rate,y.frame_rate.fixed&&0!==y.frame_rate.fps_num&&0!==y.frame_rate.fps_den||(p.frameRate=this._referenceFrameRate);const S=p.frameRate.fps_den,b=p.frameRate.fps_num;p.refSampleDuration=p.timescale*(S/b),p.codec=y.codec_mimetype;const P=this._mediaInfo;P.width=p.codecWidth,P.height=p.codecHeight,P.fps=p.frameRate.fps,P.profile=p.profile,P.level=p.level,P.refFrames=y.ref_frames,P.chromaFormat=y.chroma_format_string,P.sarNum=p.sarRatio.width,P.sarDen=p.sarRatio.height,P.videoCodec=y.codec_mimetype,P.hasAudio?null!=P.audioCodec&&(P.mimeType='video/x-flv; codecs="'+P.videoCodec+","+P.audioCodec+'"'):P.mimeType='video/x-flv; codecs="'+P.videoCodec+'"',P.isComplete()&&(null===(d=this._onMediaInfo)||void 0===d||d.call(this,P)),p.av1c=new Uint8Array(i),p.av1c.set(new Uint8Array(e,t,i),0),a.Z.v(this.TAG,"Parsed AV1CodecConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(u=this._audioTrack)||void 0===u?void 0:u.length)||(null===(h=this._videoTrack)||void 0===h?void 0:h.length))&&(null===(f=this._onDataAvailable)||void 0===f||f.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(x=this._onTrackMetadata)||void 0===x||x.call(this,"video",p)}_parseAVCVideoData(e,t,i,n,r,o,s){const l=this._littleEndian,c=new DataView(e,t,i),d=[];let u=0,h=0;const f=this._naluLengthSize,x=this._timestampBase+n;let p=1===o;for(;h<i;){if(h+4>=i){a.Z.w(this.TAG,`Malformed Nalu near timestamp ${x}, offset = ${h}, dataSize = ${i}`);break}let n=c.getUint32(h,!l);if(3===f&&(n>>>=8),n>i-f)return void a.Z.w(this.TAG,`Malformed Nalus near timestamp ${x}, NaluSize > DataSize!`);const r=31&c.getUint8(h+f);5===r&&(p=!0);const o=new Uint8Array(e,t+h,f+n),s={type:r,data:o};d.push(s),u+=o.byteLength,h+=f+n}if(d.length){const e=this._videoTrack,t={units:d,length:u,isKeyframe:p,dts:x,cts:s,pts:x+s};p&&(t.fileposition=r),e&&(e.samples.push(t),e.length+=u)}}_parseHEVCVideoData(e,t,i,n,r,o,s){const l=this._littleEndian,c=new DataView(e,t,i),d=[];let u=0,h=0;const f=this._naluLengthSize,x=this._timestampBase+n;let p=1===o;for(;h<i;){if(h+4>=i){a.Z.w(this.TAG,`Malformed Nalu near timestamp ${x}, offset = ${h}, dataSize = ${i}`);break}let n=c.getUint32(h,!l);if(3===f&&(n>>>=8),n>i-f)return void a.Z.w(this.TAG,`Malformed Nalus near timestamp ${x}, NaluSize > DataSize!`);const r=31&c.getUint8(h+f);19!==r&&20!==r||(p=!0);const o=new Uint8Array(e,t+h,f+n),s={type:r,data:o};d.push(s),u+=o.byteLength,h+=f+n}if(d.length){const e=this._videoTrack,t={units:d,length:u,isKeyframe:p,dts:x,cts:s,pts:x+s};p&&(t.fileposition=r),e&&(null==e||e.samples.push(t),e.length+=u)}}_parseAV1VideoData(e,t,i,n,a,r,o){this._littleEndian;const s=[];let l=0;const c=this._timestampBase+n,d=1===r;if(l=i,s.push({unitType:0,data:new Uint8Array(e,t+0,i)}),s.length){const e=this._videoTrack,t={units:s,length:l,isKeyframe:d,dts:c,cts:o,pts:c+o};d&&(t.fileposition=a),e&&(null==e||e.samples.push(t),e.length+=l)}}}const T=C;class R{constructor(){}destroy(){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}}class w{constructor(){this.program_pmt_pid={}}}var I,D,k,F;!function(e){e[e.kMPEG1Audio=3]="kMPEG1Audio",e[e.kMPEG2Audio=4]="kMPEG2Audio",e[e.kPESPrivateData=6]="kPESPrivateData",e[e.kADTSAAC=15]="kADTSAAC",e[e.kLOASAAC=17]="kLOASAAC",e[e.kAC3=129]="kAC3",e[e.kEAC3=135]="kEAC3",e[e.kID3=21]="kID3",e[e.kSCTE35=134]="kSCTE35",e[e.kH264=27]="kH264",e[e.kH265=36]="kH265"}(I||(I={}));class A{constructor(){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={}}}class M{}class L{}class B{constructor(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0,this.random_access_indicator=0}}!function(e){e[e.kUnspecified=0]="kUnspecified",e[e.kSliceNonIDR=1]="kSliceNonIDR",e[e.kSliceDPA=2]="kSliceDPA",e[e.kSliceDPB=3]="kSliceDPB",e[e.kSliceDPC=4]="kSliceDPC",e[e.kSliceIDR=5]="kSliceIDR",e[e.kSliceSEI=6]="kSliceSEI",e[e.kSliceSPS=7]="kSliceSPS",e[e.kSlicePPS=8]="kSlicePPS",e[e.kSliceAUD=9]="kSliceAUD",e[e.kEndOfSequence=10]="kEndOfSequence",e[e.kEndOfStream=11]="kEndOfStream",e[e.kFiller=12]="kFiller",e[e.kSPSExt=13]="kSPSExt",e[e.kReserved0=14]="kReserved0"}(D||(D={}));class O{}class j{constructor(e){const t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)}}class N{constructor(e){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&a.Z.e(this.TAG,"Could not find H264 startcode until payload end!")}findNextStartCodeOffset(e){let t=e;const i=this.data_;for(;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;const e=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],n=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===e||1===n)return t;t++}}readNextNaluPayload(){const e=this.data_;let t=null;for(;null==t&&!this.eof_flag_;){let i=this.current_startcode_offset_;i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3;const n=31&e[i],a=(128&e[i])>>>7,r=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=r,n>=D.kReserved0)continue;if(0!==a)continue;const o=e.subarray(i,r);t=new O,t.type=n,t.data=o}return t}}class U{constructor(e,t,i){let n=8+e.byteLength+1+2+t.byteLength,a=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(a=!0,n+=4);const r=this.data=new Uint8Array(n);r[0]=1,r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=255,r[5]=225;const o=e.byteLength;r[6]=o>>>8,r[7]=255&o;let s=8;r.set(e,8),s+=o,r[s]=1;const l=t.byteLength;r[s+1]=l>>>8,r[s+2]=255&l,r.set(t,s+3),s+=3+l,a&&(r[s]=252|i.chroma_format_idc,r[s+1]=248|i.bit_depth_luma-8,r[s+2]=248|i.bit_depth_chroma-8,r[s+3]=0,s+=4)}getData(){return this.data}}!function(e){e[e.kNull=0]="kNull",e[e.kAACMain=1]="kAACMain",e[e.kAAC_LC=2]="kAAC_LC",e[e.kAAC_SSR=3]="kAAC_SSR",e[e.kAAC_LTP=4]="kAAC_LTP",e[e.kAAC_SBR=5]="kAAC_SBR",e[e.kAAC_Scalable=6]="kAAC_Scalable",e[e.kLayer1=32]="kLayer1",e[e.kLayer2=33]="kLayer2",e[e.kLayer3=34]="kLayer3"}(k||(k={})),function(e){e[e.k96000Hz=0]="k96000Hz",e[e.k88200Hz=1]="k88200Hz",e[e.k64000Hz=2]="k64000Hz",e[e.k48000Hz=3]="k48000Hz",e[e.k44100Hz=4]="k44100Hz",e[e.k32000Hz=5]="k32000Hz",e[e.k24000Hz=6]="k24000Hz",e[e.k22050Hz=7]="k22050Hz",e[e.k16000Hz=8]="k16000Hz",e[e.k12000Hz=9]="k12000Hz",e[e.k11025Hz=10]="k11025Hz",e[e.k8000Hz=11]="k8000Hz",e[e.k7350Hz=12]="k7350Hz"}(F||(F={}));const z=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];class H{}class V extends H{}class Z{constructor(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&a.Z.e(this.TAG,"Could not found ADTS syncword until payload end")}findNextSyncwordOffset(e){let t=e;const i=this.data_;for(;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(4095==(i[t+0]<<8|i[t+1])>>>4)return t;t++}}readNextAACFrame(){const e=this.data_;let t=null;for(;null==t&&!this.eof_flag_;){let i=this.current_syncword_offset_;const n=(8&e[i+1])>>>3,a=(6&e[i+1])>>>1,r=1&e[i+1],o=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,l=(1&e[i+2])<<2|(192&e[i+3])>>>6,c=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+c>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}const d=1===r?7:9,u=c-d;i+=d;const h=this.findNextSyncwordOffset(i+u);if(this.current_syncword_offset_=h,0!==n&&1!==n||0!==a)continue;const f=e.subarray(i,i+u);t=new H,t.audio_object_type=o+1,t.sampling_freq_index=s,t.sampling_frequency=z[s],t.channel_config=l,t.data=f}return t}hasIncompleteData(){return this.has_last_incomplete_data}getIncompleteData(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null}}class W{constructor(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&a.Z.e(this.TAG,"Could not found LOAS syncword until payload end")}findNextSyncwordOffset(e){let t=e;const i=this.data_;for(;;){if(t+1>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(695==(i[t+0]<<3|i[t+1]>>>5))return t;t++}}getLATMValue(e){const t=e.readBits(2);let i=0;for(let n=0;n<=t;n++)i<<=8,i|=e.readByte();return i}readNextAACFrame(e){const t=this.data_;let i=null;for(;null==i&&!this.eof_flag_;){const n=this.current_syncword_offset_,r=(31&t[n+1])<<8|t[n+2];if(n+3+r>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}const o=new f(t.subarray(n+3,n+3+r));let s=null;if(o.readBool()){if(null==e){a.Z.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+r),o.destroy();continue}s=e}else{const e=o.readBool();if(e&&o.readBool()){a.Z.e(this.TAG,"audioMuxVersionA is Not Supported"),o.destroy();break}if(e&&this.getLATMValue(o),!o.readBool()){a.Z.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),o.destroy();break}if(0!==o.readBits(6)){a.Z.e(this.TAG,"more than 2 numSubFrames Not Supported"),o.destroy();break}if(0!==o.readBits(4)){a.Z.e(this.TAG,"more than 2 numProgram Not Supported"),o.destroy();break}if(0!==o.readBits(3)){a.Z.e(this.TAG,"more than 2 numLayer Not Supported"),o.destroy();break}let t=e?this.getLATMValue(o):0;const i=o.readBits(5);t-=5;const n=o.readBits(4);t-=4;const r=o.readBits(4);t-=4,o.readBits(3),t-=3,t>0&&o.readBits(t);const l=o.readBits(3);if(0!==l){a.Z.e(this.TAG,`frameLengthType = ${l}. Only frameLengthType = 0 Supported`),o.destroy();break}o.readByte();const c=o.readBool();if(c)if(e)this.getLATMValue(o);else{let e=0;for(;;){e<<=8;const t=o.readBool();if(e+=o.readByte(),!t)break}console.log(e)}o.readBool()&&o.readByte(),s=new V,s.audio_object_type=i,s.sampling_freq_index=n,s.sampling_frequency=z[s.sampling_freq_index],s.channel_config=r,s.other_data_present=c}let l=0;for(;;){const e=o.readByte();if(l+=e,255!==e)break}const c=new Uint8Array(l);for(let e=0;e<l;e++)c[e]=o.readByte();i=new V,i.audio_object_type=s.audio_object_type,i.sampling_freq_index=s.sampling_freq_index,i.sampling_frequency=z[s.sampling_freq_index],i.channel_config=s.channel_config,i.other_data_present=s.other_data_present,i.data=c,this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+r)}return i}hasIncompleteData(){return this.has_last_incomplete_data}getIncompleteData(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null}}class G{constructor(e){let t=[];const i=e.audio_object_type;let n=e.audio_object_type;const a=e.sampling_freq_index,r=e.channel_config;let o=0;const s=navigator.userAgent.toLowerCase();s.includes("firefox")?a>=6?(n=5,t=new Array(4),o=a-3):(n=2,t=new Array(2),o=a):s.includes("android")?(n=2,t=new Array(2),o=a):(n=5,o=a,t=new Array(4),a>=6?o=a-3:1===r&&(n=2,t=new Array(2),o=a)),t[0]=n<<3,t[0]|=(15&a)>>>1,t[1]=(15&a)<<7,t[1]|=(15&r)<<3,5===n&&(t[1]|=(15&o)>>>1,t[2]=(1&o)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=z[a],this.channel_count=r,this.codec_mimetype="mp4a.40."+n.toString(),this.original_codec_mimetype="mp4a.40."+i.toString()}}class Y{}class X{}var J;!function(e){e[e.kSpliceNull=0]="kSpliceNull",e[e.kSpliceSchedule=4]="kSpliceSchedule",e[e.kSpliceInsert=5]="kSpliceInsert",e[e.kTimeSignal=6]="kTimeSignal",e[e.kBandwidthReservation=7]="kBandwidthReservation",e[e.kPrivateCommand=255]="kPrivateCommand"}(J||(J={}));const q=e=>{const t=e.readBool();return t?(e.readBits(6),{time_specified_flag:t,pts_time:4*e.readBits(31)+e.readBits(2)}):(e.readBits(7),{time_specified_flag:t})},K=e=>{const t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},$=(e,t)=>{const i=t.readBits(8);return e?{component_tag:i}:{component_tag:i,splice_time:q(t)}},Q=e=>({component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}),ee=e=>{const t=e.readBits(32),i=e.readBool();e.readBits(7);const n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),e.readBits(5),n.program_splice_flag)n.utc_splice_time=e.readBits(32);else{n.component_count=e.readBits(8),n.components=[];for(let t=0;t<n.component_count;t++)n.components.push(Q(e))}return n.duration_flag&&(n.break_duration=K(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n},te=(e,t,i,n)=>({descriptor_tag:e,descriptor_length:t,identifier:i,provider_avail_id:n.readBits(32)}),ie=(e,t,i,n)=>{const a=n.readBits(8),r=n.readBits(3);n.readBits(5);let o="";for(let e=0;e<r;e++)o+=String.fromCharCode(n.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:i,preroll:a,dtmf_count:r,DTMF_char:o}},ne=e=>{const t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},ae=(e,t,i,n)=>{const a=n.readBits(32),r=n.readBool();n.readBits(7);const o={descriptor_tag:e,descriptor_length:t,identifier:i,segmentation_event_id:a,segmentation_event_cancel_indicator:r};if(r)return o;if(o.program_segmentation_flag=n.readBool(),o.segmentation_duration_flag=n.readBool(),o.delivery_not_restricted_flag=n.readBool(),o.delivery_not_restricted_flag?n.readBits(5):(o.web_delivery_allowed_flag=n.readBool(),o.no_regional_blackout_flag=n.readBool(),o.archive_allowed_flag=n.readBool(),o.device_restrictions=n.readBits(2)),!o.program_segmentation_flag){o.component_count=n.readBits(8),o.components=[];for(let e=0;e<o.component_count;e++)o.components.push(ne(n))}o.segmentation_duration_flag&&(o.segmentation_duration=n.readBits(40)),o.segmentation_upid_type=n.readBits(8),o.segmentation_upid_length=n.readBits(8);{const e=new Uint8Array(o.segmentation_upid_length);for(let t=0;t<o.segmentation_upid_length;t++)e[t]=n.readBits(8);o.segmentation_upid=e.buffer}return o.segmentation_type_id=n.readBits(8),o.segment_num=n.readBits(8),o.segments_expected=n.readBits(8),52!==o.segmentation_type_id&&54!==o.segmentation_type_id&&56!==o.segmentation_type_id&&58!==o.segmentation_type_id||(o.sub_segment_num=n.readBits(8),o.sub_segments_expected=n.readBits(8)),o},re=(e,t,i,n)=>({descriptor_tag:e,descriptor_length:t,identifier:i,TAI_seconds:n.readBits(48),TAI_ns:n.readBits(32),UTC_offset:n.readBits(16)}),oe=e=>({component_tag:e.readBits(8),ISO_code:String.fromCharCode(e.readBits(8),e.readBits(8),e.readBits(8)),Bit_Stream_Mode:e.readBits(3),Num_Channels:e.readBits(4),Full_Srvc_Audio:e.readBool()}),se=(e,t,i,n)=>{const a=n.readBits(4),r=[];for(let e=0;e<a;e++)r.push(oe(n));return{descriptor_tag:e,descriptor_length:t,identifier:i,audio_count:a,components:r}};var le;!function(e){e[e.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",e[e.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",e[e.kSliceCRA_NUT=21]="kSliceCRA_NUT",e[e.kSliceVPS=32]="kSliceVPS",e[e.kSliceSPS=33]="kSliceSPS",e[e.kSlicePPS=34]="kSlicePPS",e[e.kSliceAUD=35]="kSliceAUD"}(le||(le={}));class ce{}class de{constructor(e){const t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)}}class ue{constructor(e){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&a.Z.e(this.TAG,"Could not find H265 startcode until payload end!")}findNextStartCodeOffset(e){let t=e;const i=this.data_;for(;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;const e=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],n=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===e||1===n)return t;t++}}readNextNaluPayload(){const e=this.data_;let t=null;for(;null==t&&!this.eof_flag_;){let i=this.current_startcode_offset_;i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3;const n=e[i]>>1&63,a=(128&e[i])>>>7,r=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=r,0!==a)continue;const o=e.subarray(i,r);t=new ce,t.type=n,t.data=o}return t}}class he{constructor(e,t,i,n){const a=23+(5+e.byteLength)+(5+t.byteLength)+(5+i.byteLength),r=this.data=new Uint8Array(a);r[0]=1,r[1]=(3&n.general_profile_space)<<6|(n.general_tier_flag?1:0)<<5|31&n.general_profile_idc,r[2]=n.general_profile_compatibility_flags_1,r[3]=n.general_profile_compatibility_flags_2,r[4]=n.general_profile_compatibility_flags_3,r[5]=n.general_profile_compatibility_flags_4,r[6]=n.general_constraint_indicator_flags_1,r[7]=n.general_constraint_indicator_flags_2,r[8]=n.general_constraint_indicator_flags_3,r[9]=n.general_constraint_indicator_flags_4,r[10]=n.general_constraint_indicator_flags_5,r[11]=n.general_constraint_indicator_flags_6,r[12]=n.general_level_idc,r[13]=240|(3840&n.min_spatial_segmentation_idc)>>8,r[14]=255&n.min_spatial_segmentation_idc,r[15]=252|3&n.parallelismType,r[16]=252|3&n.chroma_format_idc,r[17]=248|7&n.bit_depth_luma_minus8,r[18]=248|7&n.bit_depth_chroma_minus8,r[19]=0,r[20]=0,r[21]=(3&n.constant_frame_rate)<<6|(7&n.num_temporal_layers)<<3|(n.temporal_id_nested?1:0)<<2|3,r[22]=3,r[23]=128|le.kSliceVPS,r[24]=0,r[25]=1,r[26]=(65280&e.byteLength)>>8,r[27]=(255&e.byteLength)>>0,r.set(e,28),r[23+(5+e.byteLength)+0]=128|le.kSliceSPS,r[23+(5+e.byteLength)+1]=0,r[23+(5+e.byteLength)+2]=1,r[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,r[23+(5+e.byteLength)+4]=(255&t.byteLength)>>0,r.set(t,23+(5+e.byteLength)+5),r[23+(5+e.byteLength+5+t.byteLength)+0]=128|le.kSlicePPS,r[23+(5+e.byteLength+5+t.byteLength)+1]=0,r[23+(5+e.byteLength+5+t.byteLength)+2]=1,r[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&i.byteLength)>>8,r[23+(5+e.byteLength+5+t.byteLength)+4]=(255&i.byteLength)>>0,r.set(i,23+(5+e.byteLength+5+t.byteLength)+5)}getData(){return this.data}}class fe{}class xe{}class pe{}const me=[[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]];class _e{constructor(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&a.Z.e(this.TAG,"Could not found AC3 syncword until payload end")}findNextSyncwordOffset(e){let t=e;const i=this.data_;for(;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]<<0))return t;t++}}readNextAC3Frame(){const e=this.data_;let t=null;for(;null==t&&!this.eof_flag_;){const i=this.current_syncword_offset_,n=e[i+4]>>6,a=[48e3,44200,33e3][n],r=63&e[i+4],o=2*me[n][r];if(i+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}const s=this.findNextSyncwordOffset(i+o);this.current_syncword_offset_=s;const l=e[i+5]>>3,c=7&e[i+5],d=e[i+6]>>5;let u=0;0!=(1&d)&&1!==d&&(u+=2),0!=(4&d)&&(u+=2),2===d&&(u+=2);const h=(e[i+6]<<8|e[i+7]<<0)>>12-u&1,f=[2,1,2,3,3,4,4,5][d]+h;t=new pe,t.sampling_frequency=a,t.channel_count=f,t.channel_mode=d,t.bit_stream_identification=l,t.low_frequency_effects_channel_on=h,t.bit_stream_mode=c,t.frame_size_code=r,t.data=e.subarray(i,i+o)}return t}hasIncompleteData(){return this.has_last_incomplete_data}getIncompleteData(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null}}class ge{constructor(e){let t=[];t=[e.sampling_rate_code<<6|e.bit_stream_identification<<1|e.bit_stream_mode>>2,(3&e.bit_stream_mode)<<6|e.channel_mode<<3|e.low_frequency_effects_channel_on<<2|e.frame_size_code>>4,e.frame_size_code<<4&224],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.bit_stream_mode=e.bit_stream_mode,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"}}class ve{}class ye{constructor(e){this.TAG="EAC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&a.Z.e(this.TAG,"Could not found AC3 syncword until payload end")}findNextSyncwordOffset(e){let t=e;const i=this.data_;for(;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]<<0))return t;t++}}readNextEAC3Frame(){const e=this.data_;let t=null;for(;null==t&&!this.eof_flag_;){const i=this.current_syncword_offset_,n=new f(e.subarray(i+2)),a=(n.readBits(2),n.readBits(3),n.readBits(11)+1<<1);let r=n.readBits(2),o=null,s=null;3===r?(r=n.readBits(2),o=[24e3,22060,16e3][r],s=3):(o=[48e3,44100,32e3][r],s=n.readBits(2));const l=n.readBits(3),c=n.readBits(1),d=n.readBits(5);if(i+a>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}const u=this.findNextSyncwordOffset(i+a);this.current_syncword_offset_=u;const h=[2,1,2,3,3,4,4,5][l]+c;n.destroy(),t=new ve,t.sampling_frequency=o,t.channel_count=h,t.channel_mode=l,t.bit_stream_identification=d,t.low_frequency_effects_channel_on=c,t.frame_size=a,t.num_blks=[1,2,3,6][s],t.data=e.subarray(i,i+a)}return t}hasIncompleteData(){return this.has_last_incomplete_data}getIncompleteData(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null}}class Se{constructor(e){let t=[];const i=Math.floor(e.frame_size*e.sampling_frequency/(16*e.num_blks));t=[255&i,248&i,e.sampling_rate_code<<6|e.bit_stream_identification<<1|0,0|e.channel_mode<<1|e.low_frequency_effects_channel_on<<0,0],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.num_blks=e.num_blks,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"}}const be=class extends R{constructor(e,t){super(),this.TAG="TSDemuxer",this.first_parse_=!0,this.media_info_=new o.Z,this.timescale_=90,this.duration_=0,this.current_pmt_pid_=-1,this.program_pmt_map_={},this.pes_slice_queues_={},this.section_slice_queues_={},this.video_metadata_={vps:void 0,sps:void 0,pps:void 0,details:void 0},this.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},this.aac_last_sample_pts_=void 0,this.aac_last_incomplete_data_=null,this.has_video_=!1,this.has_audio_=!1,this.video_init_segment_dispatched_=!1,this.audio_init_segment_dispatched_=!1,this.video_metadata_changed_=!1,this.audio_metadata_changed_=!1,this.loas_previous_frame=null,this.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this.ts_packet_size_=e.ts_packet_size,this.sync_offset_=e.sync_offset,this.config_=t}destroy(){this.media_info_=null,this.pes_slice_queues_=null,this.section_slice_queues_=null,this.video_metadata_=null,this.audio_metadata_=null,this.aac_last_incomplete_data_=null,this.video_track_=null,this.audio_track_=null,super.destroy()}static probe(e){const t=new Uint8Array(e);let i=-1,n=188;if(t.byteLength<=3*n)return{needMoreData:!0};for(;-1===i;){const e=Math.min(1e3,t.byteLength-3*n);for(let a=0;a<e;){if(71===t[a]&&71===t[a+n]&&71===t[a+2*n]){i=a;break}a++}if(-1===i)if(188===n)n=192;else{if(192!==n)break;n=204}}return-1===i?{match:!1}:(192===n&&i>=4?(a.Z.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),i-=4):204===n&&a.Z.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:n,sync_offset:i})}bindDataSource(e){return e.onDataArrival=this.parseChunks.bind(this),this}resetMediaInfo(){this.media_info_=new o.Z}parseChunks(e,t){var i;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new c.rT("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let n=0;for(this.first_parse_&&(this.first_parse_=!1,n=this.sync_offset_);n+this.ts_packet_size_<=e.byteLength;){const r=t+n;192===this.ts_packet_size_&&(n+=4);const o=new Uint8Array(e,n,188),s=o[0];if(71!==s){a.Z.e(this.TAG,`sync_byte = ${s}, not 0x47`);break}const l=(64&o[1])>>>6,c=(o[1],(31&o[1])<<8|o[2]),d=(48&o[3])>>>4,u=15&o[3];let h={},f=4;if(2===d||3===d){const t=o[4];if(5+t===188){n+=188,204===this.ts_packet_size_&&(n+=16);continue}t>0&&(h=this.parseAdaptationField(e,n+4,1+t)),f=5+t}if(1===d||3===d)if(0===c||c===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[c]===I.kSCTE35){const t=188-f;this.handleSectionSlice(e,n+f,t,{pid:c,file_position:r,payload_unit_start_indicator:l,continuity_conunter:u,random_access_indicator:h.random_access_indicator})}else if(void 0!==(null===(i=this.pmt_)||void 0===i?void 0:i.pid_stream_type[c])){const t=188-f,i=this.pmt_.pid_stream_type[c];(c===this.pmt_.common_pids.h264||c===this.pmt_.common_pids.h265||c===this.pmt_.common_pids.adts_aac||c===this.pmt_.common_pids.loas_aac||c===this.pmt_.common_pids.ac3||c===this.pmt_.common_pids.eac3||c===this.pmt_.common_pids.opus||c===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[c]||this.pmt_.timed_id3_pids[c])&&this.handlePESSlice(e,n+f,t,{pid:c,stream_type:i,file_position:r,payload_unit_start_indicator:l,continuity_conunter:u,random_access_indicator:h.random_access_indicator})}n+=188,204===this.ts_packet_size_&&(n+=16)}return this.dispatchAudioVideoMediaSegment(),n}parseAdaptationField(e,t,i){const n=new Uint8Array(e,t,i),r=n[0];return r>0?r>183?(a.Z.w(this.TAG,`Illegal adaptation_field_length: ${r}`),{}):{discontinuity_indicator:(128&n[1])>>>7,random_access_indicator:(64&n[1])>>>6,elementary_stream_priority_indicator:(32&n[1])>>>5}:{}}handleSectionSlice(e,t,i,n){const a=new Uint8Array(e,t,i);let r=this.section_slice_queues_?this.section_slice_queues_[n.pid]:{};if(n.payload_unit_start_indicator){const o=a[0];if(void 0!==r&&0!==(null==r?void 0:r.total_length)){const a=new Uint8Array(e,t+1,Math.min(i,o));r.slices.push(a),r.total_length+=a.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):this.clearSlices(r,n)}for(let s=1+o;s<a.byteLength&&255!==a[s+0];){const o=(15&a[s+1])<<8|a[s+2];this.section_slice_queues_&&(this.section_slice_queues_[n.pid]=new B,r=this.section_slice_queues_[n.pid]),r.expected_length=o+3,r.file_position=n.file_position,r.random_access_indicator=n.random_access_indicator;const l=new Uint8Array(e,t+s,Math.min(i-s,r.expected_length-r.total_length));r.slices.push(l),r.total_length+=l.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):r.total_length>=r.expected_length&&this.clearSlices(r,n),s+=l.byteLength}}else if(void 0!==r&&0!==r.total_length){const a=new Uint8Array(e,t,Math.min(i,r.expected_length-r.total_length));r.slices.push(a),r.total_length+=a.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):r.total_length>=r.expected_length&&this.clearSlices(r,n)}}handlePESSlice(e,t,i,n){const r=new Uint8Array(e,t,i),o=r[0]<<16|r[1]<<8|r[2],s=(r[3],r[4]<<8|r[5]);if(n.payload_unit_start_indicator){if(1!==o)return void a.Z.e(this.TAG,`handlePESSlice: packet_start_code_prefix should be 1 but with value ${o}`);const e=this.pes_slice_queues_[n.pid];e&&(0===e.expected_length||e.expected_length===e.total_length?this.emitPESSlices(e,n):this.clearSlices(e,n)),this.pes_slice_queues_&&(this.pes_slice_queues_[n.pid]=new B,this.pes_slice_queues_[n.pid].file_position=n.file_position,this.pes_slice_queues_[n.pid].random_access_indicator=n.random_access_indicator)}if(void 0===this.pes_slice_queues_[n.pid])return;const l=this.pes_slice_queues_[n.pid];l.slices.push(r),n.payload_unit_start_indicator&&(l.expected_length=0===s?0:s+6),l.total_length+=r.byteLength,l.expected_length>0&&l.expected_length===l.total_length?this.emitPESSlices(l,n):l.expected_length>0&&l.expected_length<l.total_length&&this.clearSlices(l,n)}emitSectionSlices(e,t){const i=new Uint8Array(e.total_length);for(let t=0,n=0;t<e.slices.length;t++){const a=e.slices[t];i.set(a,n),n+=a.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;const n=new L;n.pid=t.pid,n.data=i,n.file_position=e.file_position,n.random_access_indicator=e.random_access_indicator,this.parseSection(n)}emitPESSlices(e,t){const i=new Uint8Array(e.total_length);for(let t=0,n=0;t<e.slices.length;t++){const a=e.slices[t];i.set(a,n),n+=a.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;const n=new M;n.pid=t.pid,n.data=i,n.stream_type=t.stream_type,n.file_position=e.file_position,n.random_access_indicator=e.random_access_indicator,this.parsePES(n)}clearSlices(e,t){e.slices=[],e.expected_length=-1,e.total_length=0}parseSection(e){var t;const i=e.data,n=e.pid;0===n?this.parsePAT(i):n===this.current_pmt_pid_?this.parsePMT(i):(null===(t=this.pmt_)||void 0===t?void 0:t.scte_35_pids[n])&&this.parseSCTE35(i)}parsePES(e){const t=e.data,i=t[0]<<16|t[1]<<8|t[2],n=t[3],r=t[4]<<8|t[5];if(1===i){if(188!==n&&190!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n){t[6];const i=(192&t[7])>>>6,o=t[8];let s,l;2!==i&&3!==i||(s=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,l=3===i?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:s);const c=9+o;let d;if(0!==r){if(r<3+o)return void a.Z.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");d=r-3-o}else d=t.byteLength-c;const u=t.subarray(c,c+d);switch(e.stream_type){case I.kMPEG1Audio:case I.kMPEG2Audio:this.parseMP3Payload(u,s);break;case I.kPESPrivateData:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(u,s):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(u,s):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(u,s):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(u,s,l,e.pid,n):this.parsePESPrivateDataPayload(u,s,l,e.pid,n);break;case I.kADTSAAC:this.parseADTSAACPayload(u,s);break;case I.kLOASAAC:this.parseLOASAACPayload(u,s);break;case I.kAC3:this.parseAC3Payload(u,s);break;case I.kEAC3:this.parseEAC3Payload(u,s);break;case I.kID3:this.parseTimedID3MetadataPayload(u,s,l,e.pid,n);break;case I.kH264:this.parseH264Payload(u,s,l,e.file_position,e.random_access_indicator);break;case I.kH265:this.parseH265Payload(u,s,l,e.file_position,e.random_access_indicator)}}else if((188===n||191===n||240===n||241===n||255===n||242===n||248===n)&&e.stream_type===I.kPESPrivateData){const i=6;let a;a=0!==r?r:t.byteLength-i;const o=t.subarray(i,i+a);this.parsePESPrivateDataPayload(o,void 0,void 0,e.pid,n)}}else a.Z.e(this.TAG,`parsePES: packet_start_code_prefix should be 1 but with value ${i}`)}parsePAT(e){const t=e[0];if(0!==t)return void a.Z.e(this.TAG,`parsePAT: table_id ${t} is not corresponded to PAT!`);const i=(15&e[1])<<8|e[2],n=(e[3],e[4],(62&e[5])>>>1),r=1&e[5],o=e[6];e[7];let s=null;if(1===r&&0===o)s=new w,s.version_number=n;else if(s=this.pat_,null==s)return;const l=i-5-4;let c=-1,d=-1;for(let t=8;t<8+l;t+=4){const i=e[t]<<8|e[t+1],n=(31&e[t+2])<<8|e[t+3];0===i?s.network_pid=n:(s.program_pmt_pid[i]=n,-1===c&&(c=i),-1===d&&(d=n))}1===r&&0===o&&(void 0===this.pat_&&a.Z.v(this.TAG,`Parsed first PAT: ${JSON.stringify(s)}`),this.pat_=s,this.current_program_=c,this.current_pmt_pid_=d)}parsePMT(e){const t=e[0];if(2!==t)return void a.Z.e(this.TAG,`parsePMT: table_id ${t} is not corresponded to PMT!`);const i=(15&e[1])<<8|e[2],n=e[3]<<8|e[4],r=(62&e[5])>>>1,o=1&e[5],s=e[6];e[7];let l=null;if(1===o&&0===s)l=new A,l.program_number=n,l.version_number=r,this.program_pmt_map_[n]=l;else if(l=this.program_pmt_map_[n],null==l)return;e[8],e[9];const c=(15&e[10])<<8|e[11],d=12+c,u=i-9-c-4;for(let t=d;t<d+u;){const i=e[t],n=(31&e[t+1])<<8|e[t+2],r=(15&e[t+3])<<8|e[t+4];l.pid_stream_type[n]=i;const o=l.common_pids.h264||l.common_pids.h265,s=l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.eac3||l.common_pids.opus||l.common_pids.mp3;if(i!==I.kH264||o)if(i!==I.kH265||o)if(i!==I.kADTSAAC||s)if(i!==I.kLOASAAC||s)if(i!==I.kAC3||s)if(i!==I.kEAC3||s)if(i!==I.kMPEG1Audio&&i!==I.kMPEG2Audio||s)if(i===I.kPESPrivateData){if(l.pes_private_data_pids[n]=!0,r>0){for(let i=t+5;i<t+5+r;){const t=e[i+0],r=e[i+1];if(5===t){const t=String.fromCharCode(...Array.from(e.subarray(i+2,i+2+r)));"VANC"===t?l.smpte2038_pids[n]=!0:"Opus"===t&&(l.common_pids.opus=n)}else if(127===t&&n===l.common_pids.opus){let t=null;if(128===e[i+2]&&(t=e[i+3]),null==t){a.Z.e(this.TAG,"Not Supported Opus channel count.");continue}const n={codec:"opus",channel_count:0==(15&t)?2:15&t,channel_config_code:t,sample_rate:48e3},r={codec:"opus",meta:n};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(r)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(r)):(this.audio_metadata_=n,this.dispatchAudioInitSegment(r))}i+=2+r}const o=e.subarray(t+5,t+5+r);this.dispatchPESPrivateDataDescriptor(n,i,o)}}else i===I.kID3?l.timed_id3_pids[n]=!0:i===I.kSCTE35&&(l.scte_35_pids[n]=!0);else l.common_pids.mp3=n;else l.common_pids.eac3=n;else l.common_pids.ac3=n;else l.common_pids.loas_aac=n;else l.common_pids.adts_aac=n;else l.common_pids.h265=n;else l.common_pids.h264=n;t+=5+r}n===this.current_program_&&(void 0===this.pmt_&&a.Z.v(this.TAG,`Parsed first PMT: ${JSON.stringify(l)}`),this.pmt_=l,(l.common_pids.h264||l.common_pids.h265)&&(this.has_video_=!0),(l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.opus||l.common_pids.mp3)&&(this.has_audio_=!0))}parseSCTE35(e){const t=(e=>{var t,i,n,a,r,o;const s=new f(e),l=s.readBits(8),c=s.readBool(),d=s.readBool();s.readBits(2);const u=s.readBits(12),h=s.readBits(8),x=s.readBool(),p=s.readBits(6),m=4*s.readBits(31)+s.readBits(2),_=s.readBits(8),g=s.readBits(12),v=s.readBits(12),y=s.readBits(8);let S=null;y===J.kSpliceNull?S={}:y===J.kSpliceSchedule?S=(e=>{const t=e.readBits(8),i=[];for(let n=0;n<t;n++)i.push(ee(e));return{splice_count:t,events:i}})(s):y===J.kSpliceInsert?S=(e=>{const t=e.readBits(32),i=e.readBool();e.readBits(7);const n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),n.splice_immediate_flag=e.readBool(),e.readBits(4),n.program_splice_flag&&!n.splice_immediate_flag&&(n.splice_time=q(e)),!n.program_splice_flag){n.component_count=e.readBits(8),n.components=[];for(let t=0;t<n.component_count;t++)n.components.push($(n.splice_immediate_flag,e))}return n.duration_flag&&(n.break_duration=K(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n})(s):y===J.kTimeSignal?S=(e=>({splice_time:q(e)}))(s):y===J.kBandwidthReservation?S={}:y===J.kPrivateCommand?S=((e,t)=>{const i=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),n=new Uint8Array(e-4);for(let i=0;i<e-4;i++)n[i]=t.readBits(8);return{identifier:i,private_data:n.buffer}})(v,s):s.readBits(8*v);const b=[],P=s.readBits(16);for(let e=0;e<P;){const t=s.readBits(8),i=s.readBits(8),n=String.fromCharCode(s.readBits(8),s.readBits(8),s.readBits(8),s.readBits(8));0===t?b.push(te(t,i,n,s)):1===t?b.push(ie(t,i,n,s)):2===t?b.push(ae(t,i,n,s)):3===t?b.push(re(t,i,n,s)):4===t?b.push(se(t,i,n,s)):s.readBits(8*(i-4)),e+=2+i}const E={table_id:l,section_syntax_indicator:c,private_indicator:d,section_length:u,protocol_version:h,encrypted_packet:x,encryption_algorithm:p,pts_adjustment:m,cw_index:_,tier:g,splice_command_length:v,splice_command_type:y,splice_command:S,descriptor_loop_length:P,splice_descriptors:b,E_CRC32:x?s.readBits(32):void 0,CRC32:s.readBits(32)};if(y===J.kSpliceInsert){const s=S;if(s.splice_event_cancel_indicator)return{splice_command_type:y,detail:E,data:e};if(s.program_splice_flag&&!s.splice_immediate_flag){const r=s.duration_flag?null===(t=null==s?void 0:s.break_duration)||void 0===t?void 0:t.auto_return:void 0,o=s.duration_flag?((null===(i=null==s?void 0:s.break_duration)||void 0===i?void 0:i.duration)||0)/90:void 0;return(null===(n=s.splice_time)||void 0===n?void 0:n.time_specified_flag)?{splice_command_type:y,pts:(m+((null===(a=null==s?void 0:s.splice_time)||void 0===a?void 0:a.pts_time)||0))%Math.pow(2,33),auto_return:r,duraiton:o,detail:E,data:e}:{splice_command_type:y,auto_return:r,duraiton:o,detail:E,data:e}}return{splice_command_type:y,auto_return:s.duration_flag?null===(r=s.break_duration)||void 0===r?void 0:r.auto_return:void 0,duraiton:s.duration_flag?((null===(o=s.break_duration)||void 0===o?void 0:o.duration)||0)/90:void 0,detail:E,data:e}}if(y===J.kTimeSignal){const t=S;return t.splice_time.time_specified_flag?{splice_command_type:y,pts:(m+(t.splice_time.pts_time||0))%Math.pow(2,33),detail:E,data:e}:{splice_command_type:y,detail:E,data:e}}return{splice_command_type:y,detail:E,data:e}})(e);if(void 0!==t.pts){const e=Math.floor(t.pts/this.timescale_);t.pts=e}else t.nearest_pts=this.aac_last_sample_pts_;this.onSCTE35Metadata&&this.onSCTE35Metadata(t)}parseH264Payload(e,t,i,n,r){var o,s;const l=new N(e);let c=null;const d=[];let u=0,h=!1;for(;null!=(c=l.readNextNaluPayload());){const e=new j(c);if(e.type===D.kSliceSPS){const t=p.parseSPS(c.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(e,t)&&(a.Z.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:e,pps:void 0,details:t}):this.video_metadata_&&(this.video_metadata_.sps=e,this.video_metadata_.details=t)}else e.type===D.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_&&(this.video_metadata_.pps=e),(null===(o=this.video_metadata_)||void 0===o?void 0:o.sps)&&(null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):(e.type===D.kSliceIDR||e.type===D.kSliceNonIDR&&1===r)&&(h=!0);this.video_init_segment_dispatched_&&(d.push(e),u+=e.data.byteLength)}const f=Math.floor(t/this.timescale_),x=Math.floor(i/this.timescale_);if(d.length){const e=this.video_track_,t={units:d,length:u,isKeyframe:h,dts:x,pts:f,cts:f-x,file_position:n};e&&(e.samples.push(t),e.length+=u)}}parseH265Payload(e,t,i,n,r){var o,s,l,c,d,u,h;const f=new ue(e);let x=null;const p=[];let m=0,_=!1;for(;null!=(x=f.readNextNaluPayload());){const e=new de(x);if(e.type===le.kSliceVPS){if(!this.video_init_segment_dispatched_){const t=g.parseVPS(x.data);this.video_metadata_&&(this.video_metadata_.vps=e,this.video_metadata_.details=Object.assign(Object.assign({},null===(o=this.video_metadata_)||void 0===o?void 0:o.details),t))}}else if(e.type===le.kSliceSPS){const t=g.parseSPS(x.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(e,t)&&(a.Z.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:e,pps:void 0,details:t}):this.video_metadata_&&(this.video_metadata_.sps=e,this.video_metadata_.details=Object.assign(Object.assign({},null===(s=this.video_metadata_)||void 0===s?void 0:s.details),t))}else if(e.type===le.kSlicePPS){if(!this.video_init_segment_dispatched_||this.video_metadata_changed_){const t=g.parsePPS(x.data);this.video_metadata_&&(this.video_metadata_.pps=e,this.video_metadata_.details=Object.assign(Object.assign({},null===(l=this.video_metadata_)||void 0===l?void 0:l.details),t)),(null===(c=this.video_metadata_)||void 0===c?void 0:c.vps)&&(null===(d=this.video_metadata_)||void 0===d?void 0:d.sps)&&(null===(u=this.video_metadata_)||void 0===u?void 0:u.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())}}else e.type!==le.kSliceIDR_W_RADL&&e.type!==le.kSliceIDR_N_LP&&e.type!==le.kSliceCRA_NUT||(_=!0);this.video_init_segment_dispatched_&&(p.push(e),m+=e.data.byteLength)}const v=Math.floor(t/this.timescale_),y=Math.floor(i/this.timescale_);if(p.length){const e=this.video_track_,t={units:p,length:m,isKeyframe:_,dts:y,pts:v,cts:v-y,file_position:n};e&&(null===(h=e.samples)||void 0===h||h.push(t),e.length+=m)}}detectVideoMetadataChange(e,t){var i,n,r,o,s,l,c,d,u,h;if(t.codec_mimetype!==(null===(n=null===(i=this.video_metadata_)||void 0===i?void 0:i.details)||void 0===n?void 0:n.codec_mimetype))return a.Z.v(this.TAG,`Video: Codec mimeType changed from ${null===(r=this.video_metadata_)||void 0===r?void 0:r.details.codec_mimetype} to ${null==t?void 0:t.codec_mimetype}`),!0;if(t.codec_size.width!==(null===(s=null===(o=this.video_metadata_)||void 0===o?void 0:o.details)||void 0===s?void 0:s.codec_size.width)||t.codec_size.height!==(null===(c=null===(l=this.video_metadata_)||void 0===l?void 0:l.details)||void 0===c?void 0:c.codec_size.height)){const e=null===(d=this.video_metadata_)||void 0===d?void 0:d.details.codec_size,i=t.codec_size;return a.Z.v(this.TAG,`Video: Coded Resolution changed from ${e.width}x${e.height} to ${i.width}x${i.height}`),!0}return t.present_size.width!==(null===(u=this.video_metadata_)||void 0===u?void 0:u.details.present_size.width)&&(a.Z.v(this.TAG,`Video: Present resolution width changed from ${null===(h=this.video_metadata_)||void 0===h?void 0:h.details.present_size.width} to ${null==t?void 0:t.present_size.width}`),!0)}isInitSegmentDispatched(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_}dispatchVideoInitSegment(){var e,t,i,n,r,o,s,l,c,d,u,h;const f=null===(e=this.video_metadata_)||void 0===e?void 0:e.details,x={type:"video"};x.id=null===(t=this.video_track_)||void 0===t?void 0:t.id,x.timescale=1e3,x.duration=this.duration_,x.codecWidth=f.codec_size.width,x.codecHeight=f.codec_size.height,x.presentWidth=f.present_size.width,x.presentHeight=f.present_size.height,x.profile=f.profile_string,x.level=f.level_string,x.bitDepth=f.bit_depth,x.chromaFormat=f.chroma_format,x.sarRatio=f.sar_ratio,x.frameRate=f.frame_rate;const p=x.frameRate.fps_den,m=x.frameRate.fps_num;if(x.refSampleDuration=p/m*1e3,x.codec=f.codec_mimetype,null===(i=this.video_metadata_)||void 0===i?void 0:i.vps){const e=null===(n=this.video_metadata_)||void 0===n?void 0:n.vps.data.subarray(4),t=null===(o=null===(r=this.video_metadata_)||void 0===r?void 0:r.sps)||void 0===o?void 0:o.data.subarray(4),i=null===(l=null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)||void 0===l?void 0:l.data.subarray(4),c=new he(e,t,i,f);x.hvcc=c.getData(),this.video_init_segment_dispatched_||a.Z.v(this.TAG,`Generated first HEVCDecoderConfigurationRecord for mimeType: ${x.codec}`)}else{const e=null===(d=null===(c=this.video_metadata_)||void 0===c?void 0:c.sps)||void 0===d?void 0:d.data.subarray(4),t=null===(h=null===(u=this.video_metadata_)||void 0===u?void 0:u.pps)||void 0===h?void 0:h.data.subarray(4),i=new U(e,t,f);x.avcc=i.getData(),this.video_init_segment_dispatched_||a.Z.v(this.TAG,`Generated first AVCDecoderConfigurationRecord for mimeType: ${x.codec}`)}this.onTrackMetadata&&this.onTrackMetadata("video",x),this.video_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;const _=this.media_info_;_.hasVideo=!0,_.width=x.codecWidth,_.height=x.codecHeight,_.fps=x.frameRate.fps,_.profile=x.profile,_.level=x.level,_.refFrames=f.ref_frames,_.chromaFormat=f.chroma_format_string,_.sarNum=x.sarRatio.width,_.sarDen=x.sarRatio.height,_.videoCodec=x.codec,_.hasAudio&&_.audioCodec?_.mimeType=`video/mp2t; codecs="${_.videoCodec},${_.audioCodec}"`:_.mimeType=`video/mp2t; codecs="${_.videoCodec}"`,_.isComplete()&&this.onMediaInfo&&this.onMediaInfo(_)}dispatchVideoMediaSegment(){var e;this.isInitSegmentDispatched()&&(null===(e=this.video_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(null,this.video_track_)}dispatchAudioMediaSegment(){var e;this.isInitSegmentDispatched()&&(null===(e=this.audio_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,null)}dispatchAudioVideoMediaSegment(){var e,t;this.isInitSegmentDispatched()&&((null===(e=this.audio_track_)||void 0===e?void 0:e.length)||(null===(t=this.video_track_)||void 0===t?void 0:t.length))&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,this.video_track_)}parseADTSAACPayload(e,t){var i,n,r;if(this.has_video_&&!this.video_init_segment_dispatched_)return;if(this.aac_last_incomplete_data_){const t=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);t.set(this.aac_last_incomplete_data_,0),t.set(e,this.aac_last_incomplete_data_.byteLength),e=t}let o,s=0;if(void 0!==t&&(s=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=1024/(null===(n=this.audio_metadata_)||void 0===n?void 0:n.sampling_frequency)*1e3,s=this.aac_last_sample_pts_+o;else if(void 0===t)return void a.Z.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){o=1024/this.audio_metadata_.sampling_frequency*1e3;const e=this.aac_last_sample_pts_+o;Math.abs(e-s)>1&&(a.Z.w(this.TAG,`AAC: Detected pts overlapped, expected: ${e}ms, PES pts: ${s}ms`),s=e)}}const l=new Z(e);let c=null,d=s,u=0;for(;null!=(c=l.readNextAACFrame());){o=1024/c.sampling_frequency*1e3;const e={codec:"aac",data:c};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(e)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(e)):(this.audio_metadata_={codec:"aac",audio_object_type:c.audio_object_type,sampling_freq_index:c.sampling_freq_index,sampling_frequency:c.sampling_frequency,channel_config:c.channel_config},this.dispatchAudioInitSegment(e)),u=d;const t=Math.floor(d),i={unit:c.data,length:c.data.byteLength,pts:t,dts:t};this.audio_track_&&(null===(r=this.audio_track_)||void 0===r||r.samples.push(i),this.audio_track_.length+=c.data.byteLength),d+=o}l.hasIncompleteData()&&(this.aac_last_incomplete_data_=l.getIncompleteData()),u&&(this.aac_last_sample_pts_=u)}parseLOASAACPayload(e,t){var i,n,r;if(this.has_video_&&!this.video_init_segment_dispatched_)return;if(this.aac_last_incomplete_data_){const t=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);t.set(this.aac_last_incomplete_data_,0),t.set(e,this.aac_last_incomplete_data_.byteLength),e=t}let o,s=0;if(void 0!==t&&(s=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=1024/this.audio_metadata_.sampling_frequency*1e3,s=this.aac_last_sample_pts_+o;else if(void 0===t)return void a.Z.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){o=1024/this.audio_metadata_.sampling_frequency*1e3;const e=this.aac_last_sample_pts_+o;Math.abs(e-s)>1&&(a.Z.w(this.TAG,`AAC: Detected pts overlapped, expected: ${e}ms, PES pts: ${s}ms`),s=e)}}const l=new W(e);let c=null,d=s,u=0;for(;null!=(c=l.readNextAACFrame(null!==(n=this.loas_previous_frame)&&void 0!==n?n:void 0));){this.loas_previous_frame=c,o=1024/c.sampling_frequency*1e3;const e={codec:"aac",data:c};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(e)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(e)):(this.audio_metadata_={codec:"aac",audio_object_type:c.audio_object_type,sampling_freq_index:c.sampling_freq_index,sampling_frequency:c.sampling_frequency,channel_config:c.channel_config},this.dispatchAudioInitSegment(e)),u=d;const t=Math.floor(d),i={unit:c.data,length:c.data.byteLength,pts:t,dts:t};this.audio_track_&&(null===(r=this.audio_track_)||void 0===r||r.samples.push(i),this.audio_track_.length+=c.data.byteLength),d+=o}l.hasIncompleteData()&&(this.aac_last_incomplete_data_=l.getIncompleteData()),u&&(this.aac_last_sample_pts_=u)}parseAC3Payload(e,t){var i,n;if(this.has_video_&&!this.video_init_segment_dispatched_)return;let r,o=0;if(void 0!==t&&(o=t/this.timescale_),"ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)r=1536/this.audio_metadata_.sampling_frequency*1e3,o=this.aac_last_sample_pts_+r;else if(void 0===t)return void a.Z.w(this.TAG,"AC3: Unknown pts");const s=new _e(e);let l=null,c=o,d=0;for(;null!=(l=s.readNextAC3Frame());){r=1536/l.sampling_frequency*1e3;const e={codec:"ac-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(e)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(e)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,bit_stream_mode:l.bit_stream_mode,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(e)),d=c;const t=Math.floor(c),i={unit:l.data,length:l.data.byteLength,pts:t,dts:t};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(i),this.audio_track_.length+=l.data.byteLength),c+=r}d&&(this.aac_last_sample_pts_=d)}parseEAC3Payload(e,t){var i,n;if(this.has_video_&&!this.video_init_segment_dispatched_)return;let r,o=0;if(void 0!==t&&(o=t/this.timescale_),"ec-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)r=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,o=this.aac_last_sample_pts_+r;else if(void 0===t)return void a.Z.w(this.TAG,"EAC3: Unknown pts");const s=new ye(e);let l=null,c=o,d=0;for(;null!=(l=s.readNextEAC3Frame());){r=1536/l.sampling_frequency*1e3;const e={codec:"ec-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(e)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(e)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,num_blks:l.num_blks,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(e)),d=c;const t=Math.floor(c),i={unit:l.data,length:l.data.byteLength,pts:t,dts:t};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(i),this.audio_track_.length+=l.data.byteLength),c+=r}d&&(this.aac_last_sample_pts_=d)}parseOpusPayload(e,t){var i,n;if(this.has_video_&&!this.video_init_segment_dispatched_)return;let r,o=0;if(void 0!==t&&(o=t/this.timescale_),"opus"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)r=20,o=this.aac_last_sample_pts_+r;else if(void 0===t)return void a.Z.w(this.TAG,"Opus: Unknown pts");let s=o,l=0;for(let t=0;t<e.length;){r=20;const i=0!=(16&e[t+1]),a=0!=(8&e[t+1]);let o=t+2,c=0;for(;255===e[o];)c+=255,o+=1;c+=e[o],o+=1,o+=i?2:0,o+=a?2:0,l=s;const d=Math.floor(s),u=e.slice(o,o+c),h={unit:u,length:u.byteLength,pts:d,dts:d};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(h),this.audio_track_.length+=u.byteLength),s+=r,t=o+c}l&&(this.aac_last_sample_pts_=l)}parseMP3Payload(e,t){var i;if(this.has_video_&&!this.video_init_segment_dispatched_)return;const n=[44100,48e3,32e3,0],a=[22050,24e3,16e3,0],r=[11025,12e3,8e3,0],o=e[1]>>>3&3,s=(6&e[1])>>1;e[2];const l=(12&e[2])>>>2,c=3!=(e[3]>>>6&3)?2:1;let d=0,u=34;switch(o){case 0:d=r[l];break;case 2:d=a[l];break;case 3:d=n[l]}switch(s){case 1:u=34;break;case 2:u=33;break;case 3:u=32}const h=new xe;h.object_type=u,h.sample_rate=d,h.channel_count=c,h.data=e;const f={codec:"mp3",data:h};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(f)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(f)):(this.audio_metadata_={codec:"mp3",object_type:u,sample_rate:d,channel_count:c},this.dispatchAudioInitSegment(f));const x={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(x),this.audio_track_.length+=e.byteLength)}detectAudioMetadataChange(e){var t,i,n,r;if(e.codec!==(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))return a.Z.v(this.TAG,`Audio: Audio Codecs changed from ${null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec} to ${e.codec}`),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){const t=e.data;if(t.audio_object_type!==this.audio_metadata_.audio_object_type)return a.Z.v(this.TAG,`AAC: AudioObjectType changed from ${this.audio_metadata_.audio_object_type} to ${t.audio_object_type}`),!0;if(t.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return a.Z.v(this.TAG,`AAC: SamplingFrequencyIndex changed from ${this.audio_metadata_.sampling_freq_index} to ${t.sampling_freq_index}`),!0;if(t.channel_config!==this.audio_metadata_.channel_config)return a.Z.v(this.TAG,`AAC: Channel configuration changed from ${null===(n=this.audio_metadata_)||void 0===n?void 0:n.channel_config} to ${t.channel_config}`),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){const t=e.data;if(t.sampling_frequency!==this.audio_metadata_.sampling_frequency)return a.Z.v(this.TAG,`AC3: Sampling Frequency changed from ${null===(r=this.audio_metadata_)||void 0===r?void 0:r.sampling_frequency} to ${t.sampling_frequency}`),!0;if(t.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return a.Z.v(this.TAG,`AC3: Bit Stream Identification changed from ${this.audio_metadata_.bit_stream_identification} to ${t.bit_stream_identification}`),!0;if(t.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return a.Z.v(this.TAG,`AC3: BitStream Mode changed from ${this.audio_metadata_.bit_stream_mode} to ${t.bit_stream_mode}`),!0;if(t.channel_mode!==this.audio_metadata_.channel_mode)return a.Z.v(this.TAG,`AC3: Channel Mode changed from ${this.audio_metadata_.channel_mode} to ${t.channel_mode}`),!0;if(t.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return a.Z.v(this.TAG,`AC3: Low Frequency Effects Channel On changed from ${this.audio_metadata_.low_frequency_effects_channel_on} to ${t.low_frequency_effects_channel_on}`),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){const t=e.meta;if(t.sample_rate!==this.audio_metadata_.sample_rate)return a.Z.v(this.TAG,`Opus: SamplingFrequencyIndex changed from ${this.audio_metadata_.sample_rate} to ${t.sample_rate}`),!0;if(t.channel_count!==this.audio_metadata_.channel_count)return a.Z.v(this.TAG,`Opus: Channel count changed from ${this.audio_metadata_.channel_count} to ${t.channel_count}`),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){const t=e.data;if(t.object_type!==this.audio_metadata_.object_type)return a.Z.v(this.TAG,`MP3: AudioObjectType changed from ${this.audio_metadata_.object_type} to ${t.object_type}`),!0;if(t.sample_rate!==this.audio_metadata_.sample_rate)return a.Z.v(this.TAG,`MP3: SamplingFrequencyIndex changed from ${this.audio_metadata_.sample_rate} to ${t.sample_rate}`),!0;if(t.channel_count!==this.audio_metadata_.channel_count)return a.Z.v(this.TAG,`MP3: Channel count changed from ${this.audio_metadata_.channel_count} to ${t.channel_count}`),!0}return!1}dispatchAudioInitSegment(e){var t,i,n,r,o,s;const l={type:"audio"};if(l.id=null===(t=this.audio_track_)||void 0===t?void 0:t.id,l.timescale=1e3,l.duration=this.duration_,"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){const t="aac"===e.codec?e.data:null,i=new G(t);l.audioSampleRate=i.sampling_rate,l.channelCount=i.channel_count,l.codec=i.codec_mimetype,l.originalCodec=i.original_codec_mimetype,l.config=i.config,l.refSampleDuration=1024/l.audioSampleRate*l.timescale}else if("ac-3"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec)){const t="ac-3"===e.codec?e.data:null,i=new ge(t);l.audioSampleRate=i.sampling_rate,l.channelCount=i.channel_count,l.codec=i.codec_mimetype,l.originalCodec=i.original_codec_mimetype,l.config=i.config,l.refSampleDuration=1536/l.audioSampleRate*l.timescale}else if("ec-3"===(null===(r=this.audio_metadata_)||void 0===r?void 0:r.codec)){const t="ec-3"===e.codec?e.data:null,i=new Se(t);l.audioSampleRate=i.sampling_rate,l.channelCount=i.channel_count,l.codec=i.codec_mimetype,l.originalCodec=i.original_codec_mimetype,l.config=i.config,l.refSampleDuration=256*i.num_blks/l.audioSampleRate*l.timescale}else"opus"===(null===(o=this.audio_metadata_)||void 0===o?void 0:o.codec)?(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.channelConfigCode=this.audio_metadata_.channel_config_code,l.codec="opus",l.originalCodec="opus",l.config=void 0,l.refSampleDuration=20):"mp3"===(null===(s=this.audio_metadata_)||void 0===s?void 0:s.codec)&&(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.codec="mp3",l.originalCodec="mp3",l.config=void 0);this.audio_init_segment_dispatched_||a.Z.v(this.TAG,`Generated first AudioSpecificConfig for mimeType: ${l.codec}`),this.onTrackMetadata&&this.onTrackMetadata("audio",l),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;const c=this.media_info_;c.hasAudio=!0,c.audioCodec=l.originalCodec,c.audioSampleRate=l.audioSampleRate,c.audioChannelCount=l.channelCount,c.hasVideo&&c.videoCodec?c.mimeType=`video/mp2t; codecs="${c.videoCodec},${c.audioCodec}"`:c.mimeType=`video/mp2t; codecs="${c.audioCodec}"`,c.isComplete()&&this.onMediaInfo&&this.onMediaInfo(c)}dispatchPESPrivateDataDescriptor(e,t,i){const n=new X;n.pid=e,n.stream_type=t,n.descriptor=i,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(n)}parsePESPrivateDataPayload(e,t,i,n,a){const r=new Y;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,void 0!==t){const e=Math.floor(t/this.timescale_);r.pts=e}else r.nearest_pts=this.aac_last_sample_pts_;if(void 0!==i){const e=Math.floor(i/this.timescale_);r.dts=e}this.onPESPrivateData&&this.onPESPrivateData(r)}parseTimedID3MetadataPayload(e,t,i,n,a){const r=new Y;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,void 0!==t){const e=Math.floor(t/this.timescale_);r.pts=e}if(void 0!==i){const e=Math.floor(i/this.timescale_);r.dts=e}this.onTimedID3Metadata&&this.onTimedID3Metadata(r)}parseSMPTE2038MetadataPayload(e,t,i,n,a){const r=new fe;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,void 0!==t){const e=Math.floor(t/this.timescale_);r.pts=e}if(r.nearest_pts=this.aac_last_sample_pts_,void 0!==i){const e=Math.floor(i/this.timescale_);r.dts=e}r.ancillaries=(e=>{let t=new f(e),i=0;const n=[];for(;i+=6,0===t.readBits(6);){const e=t.readBool();i+=1;const a=t.readBits(11);i+=11;const r=t.readBits(12);i+=12;const o=255&t.readBits(10);i+=10;const s=255&t.readBits(10);i+=10;const l=255&t.readBits(10);i+=10;const c=new Uint8Array(l);for(let e=0;e<l;e++){const n=255&t.readBits(10);i+=10,c[e]=n}t.readBits(10),i+=10;let d="User Defined";const u={};65===o?7===s&&(d="SCTE-104"):95===o?220===s?d="ARIB STD-B37 (1SEG)":221===s?d="ARIB STD-B37 (ANALOG)":222===s?d="ARIB STD-B37 (SD)":223===s&&(d="ARIB STD-B37 (HD)"):97===o&&(1===s?d="EIA-708":2===s&&(d="EIA-608")),n.push({yc_indicator:e,line_number:a,horizontal_offset:r,did:o,sdid:s,user_data:c,description:d,information:u}),t.readBits(8-(i-Math.floor(i/8))%8),i+=(8-(i-Math.floor(i/8)))%8}return t.destroy(),t=null,n})(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(r)}},Pe=new Uint8Array([0,0,0,0,0,0,0,0]);class Ee{static init(){Ee.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[],Opus:[],dOps:[],"ac-3":[],dac3:[],"ec-3":[],dec3:[]};for(const e in Ee.types)Ee.types.hasOwnProperty(e)&&(Ee.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)])}static box(e,...t){let i=8,n=null;const a=Array.prototype.slice.call(arguments,1),r=a.length;for(let e=0;e<r;e++)i+=a[e].byteLength;n=new Uint8Array(i),n[0]=i>>>24&255,n[1]=i>>>16&255,n[2]=i>>>8&255,n[3]=255&i,n.set(e,4);let o=8;for(let e=0;e<r;e++)n.set(a[e],o),o+=a[e].byteLength;return n}static generateInitSegment(e){const t=Ee.box(Ee.types.ftyp,Ee.constants.FTYP),i=Ee.moov(e),n=new Uint8Array(t.byteLength+i.byteLength);return n.set(t,0),n.set(i,t.byteLength),n}static moov(e){const t=Ee.mvhd(e.timescale,e.duration),i=Ee.trak(e),n=Ee.mvex(e);return Ee.box(Ee.types.moov,t,i,n)}static mvhd(e,t){return Ee.box(Ee.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,e>>>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]))}static trak(e){return Ee.box(Ee.types.trak,Ee.tkhd(e),Ee.mdia(e))}static tkhd(e){const t=e.id,i=e.duration,n=e.presentWidth,a=e.presentHeight;return Ee.box(Ee.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]))}static mdia(e){return Ee.box(Ee.types.mdia,Ee.mdhd(e),Ee.hdlr(e),Ee.minf(e))}static mdhd(e){const t=e.timescale,i=e.duration;return Ee.box(Ee.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]))}static hdlr(e){let t=null;return t="audio"===e.type?Ee.constants.HDLR_AUDIO:Ee.constants.HDLR_VIDEO,Ee.box(Ee.types.hdlr,t)}static minf(e){let t=null;return t="audio"===e.type?Ee.box(Ee.types.smhd,Ee.constants.SMHD):Ee.box(Ee.types.vmhd,Ee.constants.VMHD),Ee.box(Ee.types.minf,t,Ee.dinf(),Ee.stbl(e))}static dinf(){return Ee.box(Ee.types.dinf,Ee.box(Ee.types.dref,Ee.constants.DREF))}static stbl(e){return Ee.box(Ee.types.stbl,Ee.stsd(e),Ee.box(Ee.types.stts,Ee.constants.STTS),Ee.box(Ee.types.stsc,Ee.constants.STSC),Ee.box(Ee.types.stsz,Ee.constants.STSZ),Ee.box(Ee.types.stco,Ee.constants.STCO))}static stsd(e){return"audio"===e.type?"mp3"===e.codec?Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.mp3(e)):"ac-3"===e.codec?Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.ac3(e)):"ec-3"===e.codec?Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.ec3(e)):"opus"===e.codec?Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.Opus(e)):Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.mp4a(e)):"video"===e.type&&e.codec.startsWith("hvc1")?Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.hvc1(e)):"video"===e.type&&e.codec.startsWith("av01")?Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.av01(e)):Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.avc1(e))}static mp3(e){const 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 Ee.box(Ee.types[".mp3"],n)}static mp4a(e){const 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 Ee.box(Ee.types.mp4a,n,Ee.esds(e))}static ac3(e){var t;const 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 Ee.box(Ee.types["ac-3"],a,Ee.box(Ee.types.dac3,new Uint8Array(null!==(t=e.config)&&void 0!==t?t:[])))}static ec3(e){var t;const 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 Ee.box(Ee.types["ec-3"],a,Ee.box(Ee.types.dec3,new Uint8Array(null!==(t=e.config)&&void 0!==t?t:[])))}static esds(e){var t;const 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 Ee.box(Ee.types.esds,a)}static Opus(e){const 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 Ee.box(Ee.types.Opus,n,Ee.dOps(e))}static dOps(e){const t=e.channelCount,i=e.channelConfigCode,n=e.audioSampleRate;let 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]}const r=new Uint8Array([0,t,0,0,n>>>24&255,n>>>17&255,n>>>8&255,n>>>0&255,0,0,...a]);return Ee.box(Ee.types.dOps,r)}static avc1(e){const 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 Ee.box(Ee.types.avc1,a,Ee.box(Ee.types.avcC,t))}static hvc1(e){const 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 Ee.box(Ee.types.hvc1,a,Ee.box(Ee.types.hvcC,t))}static av01(e){var t,i;const 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 Ee.box(Ee.types.av01,o,Ee.box(Ee.types.av1C,n))}static mvex(e){return Ee.box(Ee.types.mvex,Ee.trex(e))}static trex(e){const 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 Ee.box(Ee.types.trex,i)}static moof(e,t){return Ee.box(Ee.types.moof,Ee.mfhd(e.sequenceNumber),Ee.traf(e,t))}static mfhd(e){const t=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return Ee.box(Ee.types.mfhd,t)}static traf(e,t){const i=e.id,n=Ee.box(Ee.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=Ee.box(Ee.types.tfdt,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),r=Ee.sdtp(e),o=Ee.trun(e,r.byteLength+16+16+8+16+8+8);return Ee.box(Ee.types.traf,n,a,o,r)}static sdtp(e){const t=e.samples||[],i=t.length,n=new Uint8Array(4+i);for(let e=0;e<i;e++){const i=t[e].flags;n[e+4]=i.isLeading<<6|i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy}return Ee.box(Ee.types.sdtp,n)}static trun(e,t){const i=e.samples||[],n=i.length,a=12+16*n,r=new Uint8Array(a);t+=8+a,r.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0);for(let e=0;e<n;e++){const t=i[e].duration,n=i[e].size,a=i[e].flags,o=i[e].cts;r.set([t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.isNonSync,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o],12+16*e)}return Ee.box(Ee.types.trun,r)}static mdat(e){return Ee.box(Ee.types.mdat,e)}}Ee.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:Pe,STSC:Pe,STCO:Pe,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])},Ee.init();const Ce=Ee,Te=class{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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===t)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===t)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===t)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===t)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}};var Re=i(68);const we=class{constructor(e){var t;this.TAG="MP4Remuxer",this._fillSilentAfterSeek=!1,this._config=e,this._isLive=!!e.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 Re.J1("audio"),this._videoSegmentInfoList=new Re.J1("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!r.Z.chrome||!(r.Z.version&&r.Z.version.major<50||r.Z.version&&50===r.Z.version.major&&((null===(t=r.Z.version)||void 0===t?void 0:t.build)||0)<2661)),this._fillSilentAfterSeek=!(!r.Z.msedge&&!r.Z.msie),this._mp3UseMpegAudio=!r.Z.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){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}bindDataSource(e){var t;return e.onDataAvailable=null===(t=this.remux)||void 0===t?void 0:t.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(e){this._onInitSegment=e}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(e){this._onMediaSegment=e}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(e,t){if(!this._onMediaSegment)throw new c.rT("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)}_onTrackMetadataReceived(e,t){let i=null,n="mp4",a=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",a="",i=new Uint8Array):i=Ce.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=Ce.generateInitSegment(t)}if(!this._onInitSegment)throw new c.rT("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:a,container:`${e}/${n}`,mediaDuration:t.duration})}_calculateDtsBase(e,t){var i,n;this._dtsBaseInited||((null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._audioDtsBase=e.samples[0].dts),(null===(n=null==t?void 0:t.samples)||void 0===n?void 0:n.length)&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}getTimestampBase(){if(this._dtsBaseInited)return this._dtsBase}flushStashedSamples(){const e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=null==e?void 0:e.length);const n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=null==t?void 0:t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)}_remuxAudio(e,t){var i,n,o,s,l,c,d;if(null==this._audioMeta)return;const u=e,h=u.samples;let f,x=-1,p=-1;const m=this._audioMeta.refSampleDuration,_="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,g=this._dtsBaseInited&&void 0===this._audioNextDts;let v=!1;if(!h||0===h.length)return;if(1===h.length&&!t)return;let y=0,S=null,b=0;_?(y=0,b=u.length):(y=8,b=8+u.length);let P=null;if(h.length>1&&(P=h.pop(),b-=P.length),null!=this._audioStashedLastSample){const e=this._audioStashedLastSample;this._audioStashedLastSample=null,h.unshift(e),b+=e.length}null!=P&&(this._audioStashedLastSample=P);const E=h[0].dts-this._dtsBase;if(this._audioNextDts)f=E-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())f=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(v=!0);else{const e=this._audioSegmentInfoList.getLastSampleBefore(E);if(null!=e){let t=E-(e.originalDts+e.duration);t<=3&&(t=0),f=E-(e.dts+e.duration+t)}else f=0}if(v){const e=E-f,t=this._videoSegmentInfoList.getLastSegmentBefore(E);if(null!=t&&t.beginDts<e){const r=Te.getSilentFrame(null===(i=this._audioMeta)||void 0===i?void 0:i.originalCodec,null===(n=this._audioMeta)||void 0===n?void 0:n.channelCount);if(r){const i=t.beginDts,n=e-t.beginDts;a.Z.v(this.TAG,`InsertPrefixSilentAudio: dts: ${i}, duration: ${n}`),h.unshift({unit:r,dts:i,pts:i}),b+=r.byteLength}}else v=!1}const C=[];for(let e=0;e<h.length;e++){const t=h[e],i=t.unit,n=t.dts-this._dtsBase;let d=n,u=!1,p=null,_=0;if(!(n<-.001)){if("mp3"!==this._audioMeta.codec){let e=n;const t=3;if(this._audioNextDts&&(e=this._audioNextDts),f=n-e,f<=-t*(m||0)){a.Z.w(this.TAG,`Dropping 1 audio frame (originalDts: ${n} ms ,curRefDts: ${e} ms)  due to dtsCorrection: ${f} ms overlap.`);continue}if(f>=t*(m||0)&&this._fillAudioTimestampGap&&!r.Z.safari){u=!0;const t=Math.floor(f/(m||0));a.Z.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: ${n} ms, curRefDts: ${e} ms, dtsCorrection: ${Math.round(f)} ms, generate: ${t} frames`),d=Math.floor(e),_=Math.floor(e+(m||0))-d;let r=Te.getSilentFrame(null===(o=this._audioMeta)||void 0===o?void 0:o.originalCodec,this._audioMeta.channelCount);null==r&&(a.Z.w(this.TAG,`Unable to generate silent frame for ${null===(s=this._audioMeta)||void 0===s?void 0:s.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),r=i),p=[];for(let i=0;i<t;i++){e+=m||0;const t=Math.floor(e),i=Math.floor(e+(m||0))-t,a={dts:t,pts:t,cts:0,unit:r,size:r.byteLength,duration:i,originalDts:n,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};p.push(a),b+=a.size}this._audioNextDts=e+(m||0)}else d=Math.floor(e),_=Math.floor(e+(m||0))-d,this._audioNextDts=e+(m||0)}else d=n-f,_=e!==h.length-1?h[e+1].dts-this._dtsBase-f-d:null!=P?P.dts-this._dtsBase-f-d:C.length>=1?null===(l=C[C.length-1])||void 0===l?void 0:l.duration:Math.floor(m||0),this._audioNextDts=d+_;-1===x&&(x=d),C.push({dts:d,pts:d,cts:0,unit:t.unit,size:null===(c=t.unit)||void 0===c?void 0:c.byteLength,duration:_,originalDts:n,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),u&&C.push.apply(C,p)}}if(0===C.length)return u.samples=[],void(u.length=0);_?S=new Uint8Array(b):(S=new Uint8Array(b),S[0]=b>>>24&255,S[1]=b>>>16&255,S[2]=b>>>8&255,S[3]=255&b,S.set(Ce.types.mdat,4));for(let e=0;e<C.length;e++){const t=C[e].unit;S.set(t,y),y+=t.byteLength||0}const T=C[C.length-1];p=T.dts+T.duration;const R=new Re.Yy;R.beginDts=x,R.endDts=p,R.beginPts=x,R.endPts=p,R.originalBeginDts=C[0].originalDts,R.originalEndDts=T.originalDts+T.duration,R.firstSample=new Re.Wk(C[0].dts,C[0].pts,C[0].duration,C[0].originalDts,!1),R.lastSample=new Re.Wk(T.dts,T.pts,T.duration,T.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(R),u.samples=C,u.sequenceNumber++;let w=null;w=_?new Uint8Array:Ce.moof(u,x),u.samples=[],u.length=0;const I={type:"audio",data:this._mergeBoxes(w,S).buffer,sampleCount:C.length,info:R};_&&g&&I&&(I.timestampOffset=x),null===(d=this._onMediaSegment)||void 0===d||d.call(this,"audio",I)}_remuxVideo(e,t){var i,n;if(null==this._videoMeta)return;const a=e,r=a.samples;let o,s=-1,l=-1,c=-1,d=-1;if(!r||0===r.length)return;if(1===r.length&&!t)return;let u=8,h=null,f=8+e.length,x=null;if(r.length>1&&(x=r.pop(),f-=x.length),null!=this._videoStashedLastSample){const e=this._videoStashedLastSample;this._videoStashedLastSample=null,r.unshift(e),f+=(null==e?void 0:e.length)||0}null!=x&&(this._videoStashedLastSample=x);const p=r[0].dts-this._dtsBase;if(this._videoNextDts)o=p-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())o=0;else{const e=this._videoSegmentInfoList.getLastSampleBefore(p);if(null!=e){let t=p-(e.originalDts+e.duration);t<=3&&(t=0),o=p-(e.dts+e.duration+t)}else o=0}const m=new Re.Yy,_=[];for(let e=0;e<r.length;e++){const t=r[e],n=t.dts-this._dtsBase,a=t.isKeyframe,l=n-o,d=t.cts,u=l+d;-1===s&&(s=l,c=u);let h=0;if(h=e!==r.length-1?r[e+1].dts-this._dtsBase-o-l:null!=x?x.dts-this._dtsBase-o-l:_.length>=1?_[_.length-1].duration:Math.floor((null===(i=this._videoMeta)||void 0===i?void 0:i.refSampleDuration)||0),a){const e=new Re.Wk(l,u,h,t.dts,!0);e.fileposition=t.fileposition,m.appendSyncPoint(e)}_.push({dts:l,pts:u,cts:d,units:t.units,size:t.length,isKeyframe:a,duration:h,originalDts:n,flags:{isLeading:0,dependsOn:a?2:1,isDependedOn:a?1:0,hasRedundancy:0,isNonSync:a?0:1}})}h=new Uint8Array(f),h[0]=f>>>24&255,h[1]=f>>>16&255,h[2]=f>>>8&255,h[3]=255&f,h.set(Ce.types.mdat,4);for(let e=0;e<_.length;e++){const t=_[e].units;for(;null==t?void 0:t.length;){const e=t.shift(),i=null==e?void 0:e.data;h.set(i,u),u+=i.byteLength}}const g=_[_.length-1];if(l=g.dts+g.duration,d=g.pts+g.duration,this._videoNextDts=l,m.beginDts=s,m.endDts=l,m.beginPts=c,m.endPts=d,m.originalBeginDts=_[0].originalDts,m.originalEndDts=g.originalDts+g.duration,m.firstSample=new Re.Wk(_[0].dts,_[0].pts,_[0].duration,_[0].originalDts,!!_[0].isKeyframe),m.lastSample=new Re.Wk(g.dts,g.pts,g.duration,g.originalDts,!!g.isKeyframe),this._isLive||this._videoSegmentInfoList.append(m),a.samples=_,a.sequenceNumber++,this._forceFirstIDR){const e=_[0].flags;e.dependsOn=2,e.isNonSync=0}const v=Ce.moof(a,s);a.samples=[],a.length=0,null===(n=this._onMediaSegment)||void 0===n||n.call(this,"video",{type:"video",data:this._mergeBoxes(v,h).buffer,sampleCount:_.length,info:m})}_mergeBoxes(e,t){const i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i}};var Ie=i(575),De=i(473);const ke=class{constructor(e,t){var i;this.TAG="TransmuxingController",this._emitter=new n.EventEmitter,this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;let a=0;null===(i=this._mediaDataSource.segments)||void 0===i||i.forEach((i=>{i.timestampBase=a,a+=i.duration,i.cors=e.cors,i.withCredentials=e.withCredentials,t.referrerPolicy&&(i.referrerPolicy=t.referrerPolicy)})),isNaN(a)||this._mediaDataSource.duration===a||(this._mediaDataSource.duration=a),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){var e,t,i;this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(null===(e=this._ioctl)||void 0===e||e.destroy(),this._ioctl=null),this._demuxer&&(null===(t=this._demuxer)||void 0===t||t.destroy(),this._demuxer=null),this._remuxer&&(null===(i=this._remuxer)||void 0===i||i.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(e,t){var i,n,a;if(this._currentSegmentIndex=e,null===(i=this._mediaDataSource)||void 0===i?void 0:i.segments){const i=null===(n=this._mediaDataSource)||void 0===n?void 0:n.segments[e],r=this._ioctl=new Ie.Z(i,this._config,e);r.onError=this._onIOException.bind(this),r.onSeeked=this._onIOSeeked.bind(this),r.onComplete=this._onIOComplete.bind(this),r.onRedirect=this._onIORedirect.bind(this),r.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?null===(a=this._demuxer)||void 0===a||a.bindDataSource(this._ioctl):r.onDataArrival=this._onInitChunkArrival.bind(this),r.open(t)}}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isWorking())&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isPaused())&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(e){var t,i,n,a,r,o,s,l,c,d,u,h,f,x;if(null==this._mediaInfo||!(null===(t=this._mediaInfo)||void 0===t?void 0:t.isSeekable()))return;const p=this._searchSegmentIndexContains(e);if(p===this._currentSegmentIndex){const t=(null===(i=this._mediaInfo)||void 0===i?void 0:i.segments)?null===(n=this._mediaInfo)||void 0===n?void 0:n.segments[p]:{};if(void 0===t)this._pendingSeekTime=e;else{const i=null==t?void 0:t.getNearestKeyframe(e);null===(a=this._remuxer)||void 0===a||a.seek(null==i?void 0:i.milliseconds),null===(r=this._ioctl)||void 0===r||r.seek(null==i?void 0:i.fileposition),this._pendingResolveSeekPoint=null==i?void 0:i.milliseconds}}else{const t=(null===(o=this._mediaInfo)||void 0===o?void 0:o.segments)?null===(s=this._mediaInfo)||void 0===s?void 0:s.segments[p]:{};if(void 0===t)this._pendingSeekTime=e,this._internalAbort(),null===(l=this._remuxer)||void 0===l||l.seek(),null===(c=this._remuxer)||void 0===c||c.insertDiscontinuity(),this._loadSegment(p);else{const i=t.getNearestKeyframe(e);this._internalAbort(),null===(d=this._remuxer)||void 0===d||d.seek(e),null===(u=this._remuxer)||void 0===u||u.insertDiscontinuity(),this._demuxer&&(null===(h=this._demuxer)||void 0===h||h.resetMediaInfo(),this._demuxer.timestampBase=(null===(f=this._mediaDataSource)||void 0===f?void 0:f.segments)?null===(x=this._mediaDataSource)||void 0===x?void 0:x.segments[p].timestampBase:0),this._loadSegment(p,null==i?void 0:i.fileposition),this._pendingResolveSeekPoint=null==i?void 0:i.milliseconds,this._reportSegmentMediaInfo(p)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(e){var t;const i=this._mediaDataSource.segments;let n=((null==i?void 0:i.length)||0)-1;if(0===((null==i?void 0:i.length)||0))return n;for(let a=0;a<((null==i?void 0:i.length)||0);a++)if(i&&e<((null===(t=i[a])||void 0===t?void 0:t.timestampBase)||0)){n=a-1;break}return n}_onInitChunkArrival(e,t){var i,n,r,o,s;let l=0;if(t>0)null===(i=this._demuxer)||void 0===i||i.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(n=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===n?void 0:n.timestampBase:0,l=(null===(r=this._demuxer)||void 0===r?void 0:r.parseChunks(e,t))||0;else{let i=null;i=T.probe(e),i.match&&(this._setupFLVDemuxerRemuxer(i),l=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(e,t))||0),i.match||(null==i?void 0:i.needMoreData)||(i=be.probe(e),i.match&&(this._setupTSDemuxerRemuxer(i),l=(null===(s=this._demuxer)||void 0===s?void 0:s.parseChunks(e,t))||0)),i.match||(null==i?void 0:i.needMoreData)||(i=null,a.Z.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((()=>{this._internalAbort()})),this._emitter.emit(De.Z.DEMUX_ERROR,m.Z.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return l}_setupFLVDemuxerRemuxer(e){var t;this._demuxer=new T(e,this._config),this._remuxer||(this._remuxer=new we(this._config));const i=this._mediaDataSource;void 0===i.duration||isNaN(i.duration)||(this._demuxer.overridedDuration=i.duration),"boolean"==typeof i.hasAudio&&(this._demuxer.overridedHasAudio=i.hasAudio),"boolean"==typeof i.hasVideo&&(this._demuxer.overridedHasVideo=i.hasVideo),i.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(t=null==i?void 0:i.segments[this._currentSegmentIndex])||void 0===t?void 0:t.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))}_setupTSDemuxerRemuxer(e){const t=this._demuxer=new be(e,this._config);this._remuxer||(this._remuxer=new we(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.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)}_onMediaInfo(e){var t,i;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0,Object.setPrototypeOf(this._mediaInfo,o.Z.prototype));const n=Object.assign({},e);Object.setPrototypeOf(n,o.Z.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=n),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((()=>{const e=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(e)}))}_onMetaDataArrived(e){this._emitter.emit(De.Z.METADATA_ARRIVED,e)}_onScriptDataArrived(e){this._emitter.emit(De.Z.SCRIPTDATA_ARRIVED,e)}_onTimedID3Metadata(e){var t;const i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.Z.TIMED_ID3_METADATA_ARRIVED,e))}_onSMPTE2038Metadata(e){var t;const i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.Z.SMPTE2038_METADATA_ARRIVED,e))}_onSCTE35Metadata(e){var t;const i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.Z.SCTE35_METADATA_ARRIVED,e))}_onPESPrivateDataDescriptor(e){this._emitter.emit(De.Z.PES_PRIVATE_DATA_DESCRIPTOR,e)}_onPESPrivateData(e){var t;const i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.Z.PES_PRIVATE_DATA_ARRIVED,e))}_onIOSeeked(){var e;null===(e=this._remuxer)||void 0===e||e.insertDiscontinuity()}_onIOComplete(e){var t,i;const n=e+1;n<((null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(n)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(De.Z.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(e){var t;const i=null===(t=this._ioctl)||void 0===t?void 0:t.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[i].redirectedURL=e)}_onIORecoveredEarlyEof(){this._emitter.emit(De.Z.RECOVERED_EARLY_EOF)}_onIOException(e,t){a.Z.e(this.TAG,`IOException: type = ${e}, code = ${t.code}, msg = ${t.msg}`),this._emitter.emit(De.Z.IO_ERROR,e,t),this._disableStatisticsReporter()}_onDemuxException(e,t){a.Z.e(this.TAG,`DemuxException: type = ${e}, info = ${t}`),this._emitter.emit(De.Z.DEMUX_ERROR,e,t)}_onRemuxerInitSegmentArrival(e,t){this._emitter.emit(De.Z.INIT_SEGMENT,e,t)}_onRemuxerMediaSegmentArrival(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(De.Z.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){const e=t.info.syncPoints;let i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,r.Z.safari&&e.length>0&&e[0].originalDts===i&&(i=e[0].pts),this._emitter.emit(De.Z.RECOMMEND_SEEKPOINT,i)}}_enableStatisticsReporter(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(e){var t,i,n,a;const r=(null===(t=this._mediaInfo)||void 0===t?void 0:t.segments)?null===(i=this._mediaInfo)||void 0===i?void 0:i.segments[e]:{},o=Object.assign({},r);o.duration=null===(n=this._mediaInfo)||void 0===n?void 0:n.duration,o.segmentCount=null===(a=this._mediaInfo)||void 0===a?void 0:a.segmentCount,delete o.segments,delete o.keyframesIndex,this._emitter.emit(De.Z.MEDIA_INFO,o)}_reportStatisticsInfo(){var e,t,i,n,a,r;const o={};o.url=null===(e=this._ioctl)||void 0===e?void 0:e.currentURL,o.hasRedirect=null===(t=this._ioctl)||void 0===t?void 0:t.hasRedirect,o.hasRedirect&&(o.redirectedURL=null===(i=this._ioctl)||void 0===i?void 0:i.currentRedirectedURL),o.speed=null===(n=this._ioctl)||void 0===n?void 0:n.currentSpeed,o.loaderType=null===(a=this._ioctl)||void 0===a?void 0:a.loaderType,o.currentSegmentIndex=this._currentSegmentIndex,o.totalSegmentCount=null===(r=this._mediaDataSource.segments)||void 0===r?void 0:r.length,this._emitter.emit(De.Z.STATISTICS_INFO,o)}}},473:(e,t,i)=>{i.d(t,{Z:()=>n});const n={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"}},638:(e,t,i)=>{var n=i(278),a=i(943),r=i(473);let o=null;const s=function(e,t){self.postMessage({msg:"logcat_callback",data:{type:e,logcat:t}})};function l(e,t){const i={msg:r.Z.INIT_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function c(e,t){const i={msg:r.Z.MEDIA_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function d(){const e={msg:r.Z.LOADING_COMPLETE};self.postMessage(e)}function u(){const e={msg:r.Z.RECOVERED_EARLY_EOF};self.postMessage(e)}function h(e){const t={msg:r.Z.MEDIA_INFO,data:e};self.postMessage(t)}function f(e){const t={msg:r.Z.METADATA_ARRIVED,data:e};self.postMessage(t)}function x(e){const t={msg:r.Z.SCRIPTDATA_ARRIVED,data:e};self.postMessage(t)}function p(e){const t={msg:r.Z.TIMED_ID3_METADATA_ARRIVED,data:e};self.postMessage(t)}function m(e){const t={msg:r.Z.SMPTE2038_METADATA_ARRIVED,data:e};self.postMessage(t)}function _(e){const t={msg:r.Z.SCTE35_METADATA_ARRIVED,data:e};self.postMessage(t)}function g(e){const t={msg:r.Z.PES_PRIVATE_DATA_DESCRIPTOR,data:e};self.postMessage(t)}function v(e){const t={msg:r.Z.PES_PRIVATE_DATA_ARRIVED,data:e};self.postMessage(t)}function y(e){const t={msg:r.Z.STATISTICS_INFO,data:e};self.postMessage(t)}function S(e,t){self.postMessage({msg:r.Z.IO_ERROR,data:{type:e,info:t}})}function b(e,t){self.postMessage({msg:r.Z.DEMUX_ERROR,data:{type:e,info:t}})}function P(e){self.postMessage({msg:r.Z.RECOMMEND_SEEKPOINT,data:e})}self.addEventListener("message",(function(e){switch(e.data.cmd){case"init":o=new a.Z(e.data.param[0],e.data.param[1]),o.on(r.Z.IO_ERROR,S),o.on(r.Z.DEMUX_ERROR,b),o.on(r.Z.INIT_SEGMENT,l),o.on(r.Z.MEDIA_SEGMENT,c),o.on(r.Z.LOADING_COMPLETE,d),o.on(r.Z.RECOVERED_EARLY_EOF,u),o.on(r.Z.MEDIA_INFO,h),o.on(r.Z.METADATA_ARRIVED,f),o.on(r.Z.SCRIPTDATA_ARRIVED,x),o.on(r.Z.TIMED_ID3_METADATA_ARRIVED,p),o.on(r.Z.SMPTE2038_METADATA_ARRIVED,m),o.on(r.Z.SCTE35_METADATA_ARRIVED,_),o.on(r.Z.PES_PRIVATE_DATA_DESCRIPTOR,g),o.on(r.Z.PES_PRIVATE_DATA_ARRIVED,v),o.on(r.Z.STATISTICS_INFO,y),o.on(r.Z.RECOMMEND_SEEKPOINT,P);break;case"destroy":o&&(o.destroy(),o=null),self.postMessage({msg:"destroyed"});break;case"start":null==o||o.start();break;case"stop":null==o||o.stop();break;case"seek":null==o||o.seek(e.data.param);break;case"pause":null==o||o.pause();break;case"resume":null==o||o.resume();break;case"logging_config":{const t=e.data.param;n.Z.applyConfig(t),!0===t.enableCallback?n.Z.addLogListener(s):n.Z.removeLogListener(s);break}}}))},898:(e,t,i)=>{i.d(t,{Z:()=>n});const n={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},578:(e,t,i)=>{i.d(t,{default:()=>U});var n=i(575);const a={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function r(){return Object.assign({},a)}class o{static supportMSEH264Playback(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportMSEH265Playback(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')}static supportNetworkStreamIO(){const e=new n.Z({},r()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"===t||"xhr-moz-chunked-loader"===t}static getNetworkLoaderTypeName(){const e=new n.Z({},r()),t=e.loaderType;return e.destroy(),t}static supportNativeMediaPlayback(e){void 0===o.videoElement&&(o.videoElement=window.document.createElement("video"));const t=o.videoElement.canPlayType(e);return"probably"===t||"maybe"===t}static getFeatureList(){const e={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return e.msePlayback=o.supportMSEH264Playback(),e.networkStreamIO=o.supportNetworkStreamIO(),e.networkLoaderName=o.getNetworkLoaderTypeName()||"",e.mseLivePlayback=e.msePlayback&&e.networkStreamIO,e.mseH265Playback=o.supportMSEH265Playback(),e.nativeMP4H264Playback=o.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),e.nativeMP4H265Playback=o.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),e.nativeWebmVP8Playback=o.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),e.nativeWebmVP9Playback=o.supportNativeMediaPlayback('video/webm; codecs="vp9"'),e}}const s=o;var l=i(108),c=i(99),d=i(645),u=i(479);const h={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"},f=function(){const e=ENTRY_MODULE,t={};function i(n){if(t[n])return t[n].exports;const a=t[n]={exports:{}};return e[n](a,a.exports,i),a.exports}i.m=e,i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(const n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(e){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};const n=i(ENTRY_MODULE);return n.default||n};f.toString();const x="[\\.|\\-|\\+|\\w|/|@]+",p="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+x+").*?\\)";function m(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function _(e,t,n){const a={};a[n]=[];const r=t.toString(),o=r.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||r.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!o)return a;const s=o[1];let l,c=new RegExp("(\\\\n|\\W)"+m(s)+p,"g");for(;l=c.exec(r);)"dll-reference"!==l[3]&&a[n].push(l[3]);for(c=new RegExp("\\("+m(s)+'\\("(dll-reference\\s('+x+'))"\\)\\)'+p,"g");l=c.exec(r);)e[l[2]]||(a[n].push(l[1]),e[l[2]]=i(l[1]).m),a[l[2]]=a[l[2]]||[],a[l[2]].push(l[4]);const d=Object.keys(a);for(let e=0;e<d.length;e++)for(let t=0;t<a[d[e]].length;t++)u=a[d[e]][t],isNaN(1*u)||(a[d[e]][t]=1*a[d[e]][t]);var u;return a}function g(e){return Object.keys(e).reduce(((t,i)=>t||e[i].length>0),!1)}function v(e,t,i,n){const a=e[n].map((e=>`"${e}": ${t[n][e].toString()}`)).join(","),r=f.toString().split("ENTRY_MODULE");return`${r[0]}{${a}}${r[1]}"${i}"${r[2]}`}var y=i(278),S=i(943),b=i(473),P=i(994);const E=class{constructor(e,t){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new c.EventEmitter,t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=function(e,t){t=t||{};const n={main:i.m},a=t.all?{main:Object.keys(n.main)}:function(e,t){const i={main:[t]},n={main:[]},a={main:{}};for(;g(i);){const t=Object.keys(i);for(let r=0;r<t.length;r++){const o=t[r],s=i[o].pop();if(a[o]=a[o]||{},a[o][s]||!e[o][s])continue;a[o][s]=!0,n[o]=n[o]||[],n[o].push(s);const l=_(e,e[o][s],o),c=Object.keys(l);for(let e=0;e<c.length;e++)i[c[e]]=i[c[e]]||[],i[c[e]]=i[c[e]].concat(l[c[e]])}}return n}(n,e);let r="";Object.keys(a).filter((e=>"main"!==e)).forEach((e=>{let t=0;for(;a[e][t];)t++;a[e].push(t),n[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",r+=`var ${e} = (${v(a,n,t,modules)})();\n`})),r+=`(${v(a,n,e,"main")})();`;const o=new window.Blob([r],{type:"text/javascript"});if(t.bare)return o;const s=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(o),l=new window.Worker(s);return l.objectURL=s,l}(638),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},y.Z.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:y.Z.getConfig()})}catch(i){d.Z.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new S.Z(e,t)}else this._controller=new S.Z(e,t);if(this._controller){const e=this._controller;null==e||e.on(b.Z.IO_ERROR,this._onIOError.bind(this)),null==e||e.on(b.Z.DEMUX_ERROR,this._onDemuxError.bind(this)),null==e||e.on(b.Z.INIT_SEGMENT,this._onInitSegment.bind(this)),null==e||e.on(b.Z.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==e||e.on(b.Z.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==e||e.on(b.Z.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==e||e.on(b.Z.MEDIA_INFO,this._onMediaInfo.bind(this)),null==e||e.on(b.Z.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==e||e.on(b.Z.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==e||e.on(b.Z.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==e||e.on(b.Z.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==e||e.on(b.Z.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==e||e.on(b.Z.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==e||e.on(b.Z.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==e||e.on(b.Z.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==e||e.on(b.Z.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){var e;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),y.Z.removeListener(this.e.onLoggingConfigChanged),this.e=null):(null===(e=this._controller)||void 0===e||e.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}hasWorker(){return null!=this._worker}open(){var e;this._worker?this._worker.postMessage({cmd:"start"}):null===(e=this._controller)||void 0===e||e.start()}close(){var e;this._worker?this._worker.postMessage({cmd:"stop"}):null===(e=this._controller)||void 0===e||e.stop()}seek(e){var t;this._worker?this._worker.postMessage({cmd:"seek",param:e}):null===(t=this._controller)||void 0===t||t.seek(e)}pause(){var e;this._worker?this._worker.postMessage({cmd:"pause"}):null===(e=this._controller)||void 0===e||e.pause()}resume(){var e;this._worker?this._worker.postMessage({cmd:"resume"}):null===(e=this._controller)||void 0===e||e.resume()}_onInitSegment(e,t){Promise.resolve().then((()=>{this._emitter.emit(b.Z.INIT_SEGMENT,e,t)}))}_onMediaSegment(e,t){Promise.resolve().then((()=>{this._emitter.emit(b.Z.MEDIA_SEGMENT,e,t)}))}_onLoadingComplete(){Promise.resolve().then((()=>{this._emitter.emit(b.Z.LOADING_COMPLETE)}))}_onRecoveredEarlyEof(){Promise.resolve().then((()=>{this._emitter.emit(b.Z.RECOVERED_EARLY_EOF)}))}_onMediaInfo(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.MEDIA_INFO,e)}))}_onMetaDataArrived(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.METADATA_ARRIVED,e)}))}_onScriptDataArrived(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.SCRIPTDATA_ARRIVED,e)}))}_onTimedID3MetadataArrived(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.TIMED_ID3_METADATA_ARRIVED,e)}))}_onSMPTE2038MetadataArrived(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.SMPTE2038_METADATA_ARRIVED,e)}))}_onSCTE35MetadataArrived(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.SCTE35_METADATA_ARRIVED,e)}))}_onPESPrivateDataDescriptor(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.PES_PRIVATE_DATA_DESCRIPTOR,e)}))}_onPESPrivateDataArrived(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.PES_PRIVATE_DATA_ARRIVED,e)}))}_onStatisticsInfo(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.STATISTICS_INFO,e)}))}_onIOError(e,t){Promise.resolve().then((()=>{this._emitter.emit(b.Z.IO_ERROR,e,t)}))}_onDemuxError(e,t){Promise.resolve().then((()=>{this._emitter.emit(b.Z.DEMUX_ERROR,e,t)}))}_onRecommendSeekpoint(e){Promise.resolve().then((()=>{this._emitter.emit(b.Z.RECOMMEND_SEEKPOINT,e)}))}_onLoggingConfigChanged(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}_onWorkerMessage(e){const t=e.data,i=null==t?void 0:t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case b.Z.INIT_SEGMENT:case b.Z.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case b.Z.LOADING_COMPLETE:case b.Z.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case b.Z.MEDIA_INFO:Object.setPrototypeOf(i,P.Z.prototype),this._emitter.emit(t.msg,i);break;case b.Z.METADATA_ARRIVED:case b.Z.SCRIPTDATA_ARRIVED:case b.Z.TIMED_ID3_METADATA_ARRIVED:case b.Z.SMPTE2038_METADATA_ARRIVED:case b.Z.SCTE35_METADATA_ARRIVED:case b.Z.PES_PRIVATE_DATA_DESCRIPTOR:case b.Z.PES_PRIVATE_DATA_ARRIVED:case b.Z.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case b.Z.IO_ERROR:case b.Z.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case b.Z.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":d.Z.emitter.emit("log",i.type,i.logcat)}}},C="error",T="source_open",R="update_end",w="buffer_full";var I=i(68),D=i(411);const k=class{constructor(e){this.TAG="MSEController",this._config=e,this._emitter=new c.EventEmitter,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new I.Vn}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaSource)throw new D.rT("MediaSource has been attached to an HTMLMediaElement!");const t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){const e=this._mediaSource;for(const t in this._sourceBuffers){const i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;const n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){d.Z.e(this.TAG,e.message)}null==n||n.removeEventListener("error",this.e.onSourceBufferError),null==n||n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){d.Z.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(e,t){var i;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);const n=e;let a=`${n.container}`;n.codec&&n.codec.length>0&&(a+=`;codecs=${n.codec}`);let r=!1;if(d.Z.v(this.TAG,"Received Initialization Segment, mimeType: "+a),this._lastInitSegments[n.type]=n,a!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])d.Z.v(this.TAG,`Notice: ${n.type} mimeType changed, origin: ${this._mimeTypes[n.type]||""}, target: ${a}`);else{r=!0;try{const e=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(a);e.addEventListener("error",this.e.onSourceBufferError),e.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return d.Z.e(this.TAG,e.message),void this._emitter.emit(C,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=a}t||this._pendingSegments[n.type].push(n),r||this._sourceBuffers[n.type]&&!(null===(i=this._sourceBuffers[n.type])||void 0===i?void 0:i.updating)&&this._doAppendSegments(),u.Z.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(e){const t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();const i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}seek(e){var t,i;for(const n in this._sourceBuffers){if(!this._sourceBuffers[n])continue;const a=this._sourceBuffers[n];if("open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState))try{null==a||a.abort()}catch(e){d.Z.e(this.TAG,e.message)}this._idrList.clear();const r=this._pendingSegments[n];if(r.splice(0,r.length),"closed"!==(null===(i=this._mediaSource)||void 0===i?void 0:i.readyState)){if(a){for(let e=0;e<a.buffered.length;e++){const t=a.buffered.start(e),i=a.buffered.end(e);this._pendingRemoveRanges[n].push({start:t,end:i})}(null==a?void 0:a.updating)||this._doRemoveRanges()}if(u.Z.safari){const e=this._lastInitSegments[n];e&&(this._pendingSegments[n].push(e),(null==a?void 0:a.updating)||this._doAppendSegments())}}}}endOfStream(){var e,t;const i=this._mediaSource,n=this._sourceBuffers;i&&"open"===i.readyState?(null===(e=n.video)||void 0===e?void 0:e.updating)||(null===(t=n.audio)||void 0===t?void 0:t.updating)?this._hasPendingEos=!0:(this._hasPendingEos=!1,i.endOfStream()):i&&"closed"===i.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)}getNearestKeyframe(e){return this._idrList.getLastSyncPointBeforeDts(e)}_needCleanupSourceBuffer(){var e,t;if(!this._config.autoCleanupSourceBuffer)return!1;const i=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(const e in this._sourceBuffers){const n=this._sourceBuffers[e];if(n){const e=n.buffered;if(e.length>=1&&i-e.start(0)>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0))return!0}}return!1}_doCleanupSourceBuffer(){var e,t,i;const n=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(const e in this._sourceBuffers){const a=this._sourceBuffers[e];if(a){const r=a.buffered;let o=!1;for(let a=0;a<r.length;a++){const s=r.start(a),l=r.end(a);if(s<=n&&n<l+3){if(n-s>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0)){o=!0;const t=n-((null===(i=this._config)||void 0===i?void 0:i.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[e].push({start:s,end:t})}}else l<n&&(o=!0,this._pendingRemoveRanges[e].push({start:s,end:l}))}o&&!a.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){var e,t,i,n;const a=this._sourceBuffers;if(0===(null===(e=this._mediaElement)||void 0===e?void 0:e.readyState)||"open"!==(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState))return;if((null===(i=a.video)||void 0===i?void 0:i.updating)||(null===(n=a.audio)||void 0===n?void 0:n.updating))return;const r=this._mediaSource.duration,o=this._pendingMediaDuration;o>0&&(isNaN(r)||o>r)&&(d.Z.v(this.TAG,`Update MediaSource duration from ${r} to ${o}`),this._mediaSource.duration=o),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){var e;for(const t in this._pendingRemoveRanges){if(!this._sourceBuffers[t]||(null===(e=this._sourceBuffers[t])||void 0===e?void 0:e.updating))continue;const i=this._sourceBuffers[t],n=this._pendingRemoveRanges[t];for(;n.length&&!(null==i?void 0:i.updating);){const e=n.shift();null==i||i.remove(e.start,e.end)}}}_doAppendSegments(){var e,t,i;const n=this._pendingSegments;for(const a in n)if(this._sourceBuffers[a]&&!(null===(e=this._sourceBuffers[a])||void 0===e?void 0:e.updating)&&n[a].length>0){const e=n[a].shift();if(null==e?void 0:e.timestampOffset){const i=(null===(t=this._sourceBuffers[a])||void 0===t?void 0:t.timestampOffset)||0,n=e.timestampOffset/1e3;Math.abs(i-n)>.1&&(d.Z.v(this.TAG,`Update MPEG audio timestampOffset from ${i} to ${n}`),this._sourceBuffers[a]&&(this._sourceBuffers[a].timestampOffset=n)),delete e.timestampOffset}if(!e.data||0===e.data.byteLength)continue;try{null===(i=this._sourceBuffers[a])||void 0===i||i.appendBuffer(e.data),this._isBufferFull=!1,"video"===a&&e.hasOwnProperty("info")&&this._idrList.appendArray(e.info.syncPoints)}catch(t){this._pendingSegments[a].unshift(e),22===t.code?(this._isBufferFull||this._emitter.emit(w),this._isBufferFull=!0):(d.Z.e(this.TAG,t.message),this._emitter.emit(C,{code:t.code,msg:t.message}))}}}_onSourceOpen(){var e;if(d.Z.v(this.TAG,"MediaSource onSourceOpen"),null===(e=this._mediaSource)||void 0===e||e.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){const e=this._pendingSourceBufferInit;for(;e.length;){const t=e.shift();this.appendInitSegment(t,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(T)}_onSourceEnded(){d.Z.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){d.Z.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))}_hasPendingSegments(){const e=this._pendingSegments;return e.video.length>0||e.audio.length>0}_hasPendingRemoveRanges(){const e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(R)}_onSourceBufferError(e){d.Z.e(this.TAG,`SourceBuffer Error: ${e}`)}};var F=i(898);const A={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},M={NETWORK_EXCEPTION:l.nm.EXCEPTION,NETWORK_STATUS_CODE_INVALID:l.nm.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:l.nm.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:l.nm.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:F.Z.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:F.Z.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:F.Z.CODEC_UNSUPPORTED};const L=class{constructor(e,t){var i,n,a;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new c.EventEmitter,this._config=r(),"object"==typeof t&&Object.assign(this._config,t);const o=e.type.toLowerCase();if("mse"!==o&&"mpegts"!==o&&"m2ts"!==o&&"flv"!==o)throw new D.OC("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");e.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=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;const s=u.Z.chrome&&(u.Z.version&&(null===(i=u.Z.version)||void 0===i?void 0:i.major)<50||u.Z.version&&50===(null===(n=null===u.Z||void 0===u.Z?void 0:u.Z.version)||void 0===n?void 0:n.major)&&((null===(a=null===u.Z||void 0===u.Z?void 0:u.Z.version)||void 0===a?void 0:a.build)||-1)<2661);this._alwaysSeekKeyframe=!!(s||u.Z.msedge||u.Z.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){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}on(e,t){e===h.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((()=>{this._emitter.emit(h.MEDIA_INFO,this.mediaInfo)})):e===h.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((()=>{this._emitter.emit(h.STATISTICS_INFO,this.statisticsInfo)})),this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){var t,i,n,a,r;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new k(this._config),null===(t=this._msectl)||void 0===t||t.on(R,this._onmseUpdateEnd.bind(this)),null===(i=this._msectl)||void 0===i||i.on(w,this._onmseBufferFull.bind(this)),null===(n=this._msectl)||void 0===n||n.on(T,(()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())})),null===(a=this._msectl)||void 0===a||a.on(C,(e=>{this._emitter.emit(h.ERROR,A.MEDIA_ERROR,M.MEDIA_MSE_ERROR,e)})),null===(r=this._msectl)||void 0===r||r.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}detachMediaElement(){var e;this._mediaElement&&(null===(e=this._msectl)||void 0===e||e.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)}load(){if(!this._mediaElement)throw new D.rT("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new D.rT("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 E(this._mediaDataSource,this._config),this._transmuxer.on(b.Z.INIT_SEGMENT,((e,t)=>{var i;null===(i=this._msectl)||void 0===i||i.appendInitSegment(t)})),this._transmuxer.on(b.Z.MEDIA_SEGMENT,((e,t)=>{var i,n,a;if(null===(i=this._msectl)||void 0===i||i.appendMediaSegment(t),this._config.lazyLoad&&!this._config.isLive){const e=null===(n=this._mediaElement)||void 0===n?void 0:n.currentTime;t.info.endDts>=1e3*(e+((null===(a=this._config)||void 0===a?void 0:a.lazyLoadMaxDuration)||0))&&null==this._progressChecker&&(d.Z.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}})),this._transmuxer.on(b.Z.LOADING_COMPLETE,(()=>{var e;null===(e=this._msectl)||void 0===e||e.endOfStream(),this._emitter.emit(h.LOADING_COMPLETE)})),this._transmuxer.on(b.Z.RECOVERED_EARLY_EOF,(()=>{this._emitter.emit(h.RECOVERED_EARLY_EOF)})),this._transmuxer.on(b.Z.IO_ERROR,((e,t)=>{this._emitter.emit(h.ERROR,A.NETWORK_ERROR,e,t)})),this._transmuxer.on(b.Z.DEMUX_ERROR,((e,t)=>{this._emitter.emit(h.ERROR,A.MEDIA_ERROR,e,{code:-1,msg:t})})),this._transmuxer.on(b.Z.MEDIA_INFO,(e=>{this._mediaInfo=e,this._emitter.emit(h.MEDIA_INFO,Object.assign({},e))})),this._transmuxer.on(b.Z.METADATA_ARRIVED,(e=>{this._emitter.emit(h.METADATA_ARRIVED,e)})),this._transmuxer.on(b.Z.SCRIPTDATA_ARRIVED,(e=>{this._emitter.emit(h.SCRIPTDATA_ARRIVED,e)})),this._transmuxer.on(b.Z.TIMED_ID3_METADATA_ARRIVED,(e=>{this._emitter.emit(h.TIMED_ID3_METADATA_ARRIVED,e)})),this._transmuxer.on(b.Z.SMPTE2038_METADATA_ARRIVED,(e=>{this._emitter.emit(h.SMPTE2038_METADATA_ARRIVED,e)})),this._transmuxer.on(b.Z.SCTE35_METADATA_ARRIVED,(e=>{this._emitter.emit(h.SCTE35_METADATA_ARRIVED,e)})),this._transmuxer.on(b.Z.PES_PRIVATE_DATA_DESCRIPTOR,(e=>{this._emitter.emit(h.PES_PRIVATE_DATA_DESCRIPTOR,e)})),this._transmuxer.on(b.Z.PES_PRIVATE_DATA_ARRIVED,(e=>{this._emitter.emit(h.PES_PRIVATE_DATA_ARRIVED,e)})),this._transmuxer.on(b.Z.STATISTICS_INFO,(e=>{this._statisticsInfo=this._fillStatisticsInfo(e),this._emitter.emit(h.STATISTICS_INFO,Object.assign({},this._statisticsInfo))})),this._transmuxer.on(b.Z.RECOMMEND_SEEKPOINT,(e=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){var e;return function(e,t,i,n){return new(i||(i=Promise))((function(a,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){return yield null===(e=this._mediaElement)||void 0===e?void 0:e.play()}))}pause(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()}get type(){return this._type}get buffered(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered}get duration(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration}get volume(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume}set volume(e){this._mediaElement&&(this._mediaElement.volume=e)}get muted(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted}set muted(e){this._mediaElement&&(this._mediaElement.muted=e)}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;let t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){const e=this._mediaElement.getVideoPlaybackQuality();i=e.totalVideoFrames,n=e.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e}_onmseUpdateEnd(){var e,t,i,n;const a=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,r=(null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime)||0;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&(null==a?void 0:a.length)>0&&!(null===(i=this._mediaElement)||void 0===i?void 0:i.paused)){const e=a.end(a.length-1);if(e>((null===(n=this._config)||void 0===n?void 0:n.liveBufferLatencyMaxLatency)||0)&&e-r>(this._config.liveBufferLatencyMaxLatency||0)){const t=e-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=t}}if(!this._config.lazyLoad||this._config.isLive)return;let o=0;for(let e=0;e<a.length;e++){const t=a.start(e),i=a.end(e);if(t<=r&&r<i){o=i;break}}o>=r+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(d.Z.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){d.Z.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){var e,t,i;const n=(null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime)||0,a=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered;let r=!1;for(let e=0;e<a.length;e++){const t=a.start(e),i=a.end(e);if(n>=t&&n<i){n>=i-(this._config.lazyLoadRecoverDuration||0)&&(r=!0);break}}r&&(window.clearInterval(this._progressChecker),this._progressChecker=null,r&&(d.Z.v(this.TAG,"Continue loading from paused position"),null===(i=this._transmuxer)||void 0===i||i.resume()))}_isTimepointBuffered(e){var t;const i=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered;for(let t=0;t<i.length;t++){const n=i.start(t),a=i.end(t);if(e>=n&&e<a)return!0}return!1}_internalSeek(e){var t,i,n,a,r;const o=this._isTimepointBuffered(e);let s=!1,l=0;if(e<1&&(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered).length>0){const t=(null===(i=this._mediaElement)||void 0===i?void 0:i.buffered).start(0);(t<1&&e<t||u.Z.safari)&&(s=!0,l=u.Z.safari?.1:t)}if(s)this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=l);else if(o){if(this._alwaysSeekKeyframe){const t=null===(n=this._msectl)||void 0===n?void 0:n.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=null!=t?t.dts/1e3:e)}else this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e);null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),null===(a=this._msectl)||void 0===a||a.seek(e),null===(r=this._transmuxer)||void 0===r||r.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e))}_checkAndApplyUnbufferedSeekpoint(){var e,t,i,n;if(this._seekpointRecord)if(((null===(e=this._seekpointRecord)||void 0===e?void 0:e.recordTime)||0)<=this._now()-100){const e=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(e)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(e),null===(n=this._transmuxer)||void 0===n||n.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e)))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(e){const t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){const e=t.buffered;e.length>0&&t.currentTime<e.start(0)&&(d.Z.w(this.TAG,`Playback seems stuck at ${t.currentTime}, seek to ${e.start(0)}`),this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress)))}else this._mediaElement&&this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null)}_onvSeeking(e){var t,i,n;const a=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime,r=null===(i=this._mediaElement)||void 0===i?void 0:i.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(a<1&&r.length>0){const e=r.start(0);if(e<1&&a<e||u.Z.safari)return this._requestSetTime=!0,void(this._mediaElement&&(this._mediaElement.currentTime=u.Z.safari?.1:e))}if(this._isTimepointBuffered(a)){if(this._alwaysSeekKeyframe){const e=null===(n=this._msectl)||void 0===n?void 0:n.getNearestKeyframe(Math.floor(1e3*a));null!=e&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e.dts/1e3))}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:a,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}}_onvCanPlay(e){var t;this._receivedCanPlay=!0,null===(t=this._mediaElement)||void 0===t||t.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(e){this._checkAndResumeStuckPlayback(!0)}_onvProgress(e){this._checkAndResumeStuckPlayback()}};const B=class{constructor(e,t){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new c.EventEmitter,this._config=r(),"object"==typeof t&&Object.assign(this._config,t);const i=e.type.toLowerCase();if("mse"===i||"mpegts"===i||"m2ts"===i||"flv"===i)throw new D.OC("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new D.OC(`NativePlayer(${e.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}destroy(){var e;this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,null===(e=this._emitter)||void 0===e||e.removeAllListeners(),this._emitter=null}on(e,t){e===h.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((()=>{this._emitter.emit(h.MEDIA_INFO,this.mediaInfo)})):e===h.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((()=>{this._emitter.emit(h.STATISTICS_INFO,this.statisticsInfo)})),this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){var e;if(!this._mediaElement)throw new D.rT("HTMLMediaElement must be attached before load()!");this._mediaElement.src=(null===(e=this._mediaDataSource)||void 0===e?void 0:e.url)||"",this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){var e;return function(e,t,i,n){return new(i||(i=Promise))((function(a,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){return yield null===(e=this._mediaElement)||void 0===e?void 0:e.play()}))}pause(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()}get type(){return this._type}get buffered(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered}get duration(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration}get volume(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume}set volume(e){this._mediaElement&&(this._mediaElement.volume=e)}get muted(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted}set muted(e){this._mediaElement&&(this._mediaElement.muted=e)}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}get mediaInfo(){const e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e}get statisticsInfo(){const e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;let t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){const e=this._mediaElement.getVideoPlaybackQuality();i=e.totalVideoFrames,n=e.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e}_onvLoadedMetadata(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null),this._emitter.emit(h.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(h.STATISTICS_INFO,this.statisticsInfo)}},O={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},j=["h264","h265"],N={createPlayer:function(e,t){(null==e?void 0:e.url)&&(e.url=(e=>{const t=e.split("?"),i=new URLSearchParams(t[1]);return i.delete("vc"),i.set("vc",j.reduce(((e,t)=>e+(O[t]||0)),0).toString()),t[0]+"?"+i.toString()})(e.url));const i=e;if(null==i||"object"!=typeof i)throw new D.OC("MediaDataSource must be an javascript object!");if(!Object.prototype.hasOwnProperty.call(i,"type"))throw new D.OC("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"mse":case"mpegts":case"m2ts":case"flv":return new L(i,t);default:return new B(i,t)}},isSupported:function(){return s.supportMSEH264Playback()},getFeatureList:function(){return s.getFeatureList()},BaseLoader:l.fp,LoaderStatus:l.GM,LoaderErrors:l.nm,version:"",Events:h,ErrorTypes:A,ErrorDetails:M,MSEPlayer:L,NativePlayer:B,LoggingControl:y.Z};Object.defineProperty(N,"version",{enumerable:!0,get:function(){return"2.0.0"}});const U=N},607:(e,t,i)=>{e.exports=i(578).default},575:(e,t,i)=>{i.d(t,{Z:()=>g});var n=i(645);const a=class{constructor(){var e;this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,(null===(e=self.performance)||void 0===e?void 0:e.now)?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let e=(this._now()-this._lastCheckpoint)/1e3;return 0===e&&(e=1),this._intervalBytes/e/1024}get lastSecondKBps(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){const e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}};var r=i(108),o=i(479),s=i(411);class l extends r.fp{static isSupported(){var e;try{const t=o.Z.msedge&&((null===(e=null===o.Z||void 0===o.Z?void 0:o.Z.version)||void 0===e?void 0:e.minor)||0)>=15048&&!o.Z.webkit,i=!o.Z.msedge||t;return self.fetch&&self.ReadableStream&&i}catch(e){return!1}}constructor(e,t){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=e,this._config=t,this._needStash=!0,this._requestAbort=!1,this._abortController=null,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(e,t){this._dataSource=e,this._range=t;let i=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(i=e.redirectedURL);const n=this._seekHandler.getConfig(i,t),a=new self.Headers;if("object"==typeof n.headers){const e=n.headers;for(const t in e)e.hasOwnProperty(t)&&a.append(t,e[t])}const o={method:"GET",headers:a,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(const e in this._config.headers)a.append(e,this._config.headers[e]);e.cors||(o.mode="same-origin"),e.withCredentials&&(o.credentials="include"),(null==e?void 0:e.referrerPolicy)&&(o.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(o.signal=this._abortController.signal)),this._status=r.GM.kConnecting,self.fetch(n.url,o).then((e=>{var t,i;if(this._requestAbort)return this._status=r.GM.kIdle,void(null===(t=e.body)||void 0===t||t.cancel());if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==n.url&&this._onURLRedirect){const t=this._seekHandler.removeURLParameters(e.url);this._onURLRedirect(t)}const t=e.headers.get("Content-Length");return null!=t&&(this._contentLength=parseInt(t),0!==this._contentLength&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,null===(i=e.body)||void 0===i?void 0:i.getReader())}if(this._status=r.GM.kError,!this._onError)throw new s.OZ("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(r.nm.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((e=>{var t;if(!(null===(t=this._abortController)||void 0===t?void 0:t.signal.aborted)){if(this._status=r.GM.kError,!this._onError)throw e;this._onError(r.nm.EXCEPTION,{code:-1,msg:e.message})}}))}abort(){var e;if(this._requestAbort=!0,(this._status!==r.GM.kBuffering||!o.Z.chrome)&&this._abortController)try{null===(e=this._abortController)||void 0===e||e.abort()}catch(e){}}_pump(e){return e.read().then((t=>{var i,n,a,o;if(t.done)if(null!==this._contentLength&&this._receivedLength<this._contentLength){this._status=r.GM.kError;const e=r.nm.EARLY_EOF,t={code:-1,msg:"Fetch stream meet Early-EOF"};if(!this._onError)throw new s.OZ(t.msg);this._onError(e,t)}else this._status=r.GM.kComplete,this._onComplete&&this._onComplete((null===(i=this._range)||void 0===i?void 0:i.from)||0,((null===(n=this._range)||void 0===n?void 0:n.from)||0)+this._receivedLength-1);else{if(null===(a=this._abortController)||void 0===a?void 0:a.signal.aborted)return void(this._status=r.GM.kComplete);if(this._requestAbort)return this._status=r.GM.kComplete,e.cancel();this._status=r.GM.kBuffering;const i=t.value.buffer,n=((null===(o=this._range)||void 0===o?void 0:o.from)||0)+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength),this._pump(e)}})).catch((e=>{var t,i;if(null===(i=null===(t=this._abortController)||void 0===t?void 0:t.signal)||void 0===i?void 0:i.aborted)return void(this._status=r.GM.kComplete);if(11===e.code&&o.Z.msedge)return;this._status=r.GM.kError;let n=0,a=null;if(19!==e.code&&"network error"!==e.message||!(null===this._contentLength||null!==this._contentLength&&this._receivedLength<this._contentLength)?(n=r.nm.EXCEPTION,a={code:e.code,msg:e.message}):(n=r.nm.EARLY_EOF,a={code:e.code,msg:"Fetch stream meet Early-EOF"}),!this._onError)throw new s.OZ(a.msg);this._onError(n,a)}))}}const c=l;class d extends r.fp{static isSupported(){try{const e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return n.Z.w("MozChunkedLoader",e.message),!1}}constructor(e,t){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=e,this._config=t,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(e,t){this._dataSource=e,this._range=t;let i=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(i=e.redirectedURL);const n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;const a=this._xhr=new XMLHttpRequest;if(a.open("GET",n.url,!0),a.responseType="moz-chunked-arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onloadend=this._onLoadEnd.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"==typeof n.headers){const e=n.headers;for(const t in e)e.hasOwnProperty(t)&&a.setRequestHeader(t,e[t])}if("object"==typeof this._config.headers){const e=this._config.headers;for(const t in e)e.hasOwnProperty(t)&&a.setRequestHeader(t,e[t])}this._status=r.GM.kConnecting,a.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=r.GM.kComplete}_onReadyStateChange(e){const t=e.target;if(2===t.readyState){if(void 0!==t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){const e=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(e)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=r.GM.kError,!this._onError)throw new s.OZ("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(r.nm.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=r.GM.kBuffering}}_onProgress(e){var t;if(this._status===r.GM.kError)return;null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));const i=e.target.response,n=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength)}_onLoadEnd(e){this._requestAbort?this._requestAbort=!1:this._status!==r.GM.kError&&(this._status=r.GM.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(e){this._status=r.GM.kError;let t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=r.nm.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=r.nm.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new s.OZ(i.msg);this._onError(t,i)}}const u=d;class h extends r.fp{static isSupported(){try{const e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return n.Z.w("RangeLoader",e.message),!1}}constructor(e,t){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=e,this._config=t,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new a,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(e,t){this._dataSource=e,this._range=t,this._status=r.GM.kConnecting;let i=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))}_openSubRange(){var e,t;const i=1024*this._currentChunkSizeKB,n=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength;let a=n+i;null!=this._contentLength&&a-this._range.from>=this._contentLength&&(a=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._contentLength-1),this._currentRequestRange={from:n,to:a},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(e,t){this._lastTimeLoaded=0;let i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));const n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;const 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),e.withCredentials&&(a.withCredentials=!0),"object"==typeof n.headers){const e=n.headers;for(const t in e)e.hasOwnProperty(t)&&a.setRequestHeader(t,e[t])}if("object"==typeof this._config.headers){const e=this._config.headers;for(const t in e)e.hasOwnProperty(t)&&a.setRequestHeader(t,e[t])}a.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=r.GM.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(e){const t=e.target;if(2===t.readyState){if(null!=t.responseURL){const e=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&e!==this._currentRedirectedURL&&(this._currentRedirectedURL=e,this._onURLRedirect&&this._onURLRedirect(e))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=r.GM.kBuffering}else{if(this._status=r.GM.kError,!this._onError)throw new s.OZ("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(r.nm.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}_onProgress(e){if(this._status===r.GM.kError)return;if(null===this._contentLength){let t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;const i=e.total;this._internalAbort(),null!=i&&0!==i&&(this._totalLength=i)}if(-1===this._range.to?this._contentLength=(this._totalLength||0)-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}const t=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(t)}_normalizeSpeed(e){const t=this._chunkSizeKBList,i=t.length-1;let n=0,a=0,r=i;if(e<t[0])return t[0];for(;a<=r;){if(n=a+Math.floor((r-a)/2),n===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?a=n+1:r=n-1}}_onLoad(e){if(this._status===r.GM.kError)return;if(this._waitForTotalLength)return void(this._waitForTotalLength=!1);this._lastTimeLoaded=0;let t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){const e=this._normalizeSpeed(t);this._currentSpeedNormalized!==e&&(this._currentSpeedNormalized=e,this._currentChunkSizeKB=e)}const i=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;let a=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():a=!0,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength),a&&(this._status=r.GM.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(e){this._status=r.GM.kError;let t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=r.nm.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=r.nm.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new s.OZ(i.msg);this._onError(t,i)}}const f=h;class x extends r.fp{static isSupported(){try{return void 0!==self.WebSocket}catch(e){return!1}}constructor(e,t){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(e){try{const t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=r.GM.kConnecting}catch(e){this._status=r.GM.kError;const t={code:e.code,msg:e.message};if(!this._onError)throw new s.OZ(t.msg);this._onError(r.nm.EXCEPTION,t)}}abort(){const e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=r.GM.kComplete}_onWebSocketOpen(e){this._status=r.GM.kBuffering}_onWebSocketClose(e){this._requestAbort?this._requestAbort=!1:(this._status=r.GM.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1))}_onWebSocketMessage(e){if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){const t=new FileReader;t.onload=()=>{this._dispatchArrayBuffer(null==t?void 0:t.result)},t.readAsArrayBuffer(e.data)}else{this._status=r.GM.kError;const t={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new s.OZ(t.msg);this._onError(r.nm.EXCEPTION,t)}}_dispatchArrayBuffer(e){const t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}_onWebSocketError(e){this._status=r.GM.kError;const t={code:e.code,msg:e.message};if(!this._onError)throw new s.OZ(t.msg);this._onError(r.nm.EXCEPTION,t)}}const p=x,m=class{constructor(e){this._zeroStart=e||!1}getConfig(e,t){const i={};if(0!==t.from||-1!==t.to){let e;e=-1!==t.to?`bytes=${t.from.toString()}-${t.to.toString()}`:`bytes=${t.from.toString()}-`,i.Range=e}else this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}}removeURLParameters(e){return e}},_=class{constructor(e,t){this._startName=e,this._endName=t}getConfig(e,t){let i=e;if(0!==t.from||-1!==t.to){let e=!0;i.includes("?")||(i+="?",e=!1),e&&(i+="&"),i+=`${this._startName}=${t.from.toString()}`,-1!==t.to&&(i+=`&${this._endName}=${t.to.toString()}`)}return{url:i,headers:{}}}removeURLParameters(e){const t=e.split("?")[0];let i;const n=e.indexOf("?");-1!==n&&(i=e.substring(n+1));let a="";if(void 0!==i&&i.length>0){const e=i.split("&");for(let t=0;t<e.length;t++){const i=e[t].split("="),n=t>0;i[0]!==this._startName&&i[0]!==this._endName&&(n&&(a+="&"),a+=e[t])}}return 0===a.length?t:t+"?"+a}},g=class{constructor(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=65536,void 0!==t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,t.enableStashBuffer||(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url||""),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new a,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()}destroy(){var e,t,i;(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&(null===(t=this._loader)||void 0===t||t.abort()),null===(i=this._loader)||void 0===i||i.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}isWorking(){var e;return(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&!this._paused}isPaused(){return this._paused}get status(){var e;return null===(e=this._loader)||void 0===e?void 0:e.status}get extraData(){return this._extraData}set extraData(e){this._extraData=e}get onDataArrival(){return this._onDataArrival}set onDataArrival(e){this._onDataArrival=e}get onSeeked(){return this._onSeeked}set onSeeked(e){this._onSeeked=e}get onError(){return this._onError}set onError(e){this._onError=e}get onComplete(){return this._onComplete}set onComplete(e){this._onComplete=e}get onRedirect(){return this._onRedirect}set onRedirect(e){this._onRedirect=e}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(e){this._onRecoveredEarlyEof=e}get currentURL(){var e;return null===(e=this._dataSource)||void 0===e?void 0:e.url}get hasRedirect(){var e;return null!=this._redirectedURL||void 0!==(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)}get currentRedirectedURL(){var e;return this._redirectedURL||(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)}get currentSpeed(){var e,t;return this._loaderClass===f?null===(e=this._loader)||void 0===e?void 0:e.currentSpeed:null===(t=this._speedSampler)||void 0===t?void 0:t.lastSecondKBps}get loaderType(){var e;return null===(e=this._loader)||void 0===e?void 0:e.type}_selectSeekHandler(){const e=this._config;if("range"===e.seekType)this._seekHandler=new m(!!this._config.rangeLoadZeroStart);else if("param"===e.seekType){const t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new _(t,i)}else{if("custom"!==e.seekType)throw new s.OC(`Invalid seekType in config: ${(null==e?void 0:e.seekType)||""}`);if("function"!=typeof e.customSeekHandler)throw new s.OC("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}_selectLoader(){var e;if(null!=this._config.customLoader)this._loaderClass=(null===(e=this._config)||void 0===e?void 0:e.customLoader)||null;else if(this._isWebSocketURL)this._loaderClass=p;else if(c.isSupported())this._loaderClass=c;else if(u.isSupported())this._loaderClass=u;else{if(!f.isSupported())throw new s.OZ("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=f}}_createLoader(){var e;this._loaderClass&&(this._loader=new this._loaderClass(this._seekHandler,this._config),(null===(e=this._loader)||void 0===e?void 0:e.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)))}open(e){var t,i;this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),null===(t=this._speedSampler)||void 0===t||t.reset(),e||(this._fullRequestFlag=!0),null===(i=this._loader)||void 0===i||i.open(this._dataSource,Object.assign({},this._currentRange))}abort(){var e;null===(e=this._loader)||void 0===e||e.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){var e,t;this.isWorking()&&(null===(e=this._loader)||void 0===e||e.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange&&(this._currentRange.to=this._stashByteStart-1)):this._resumeFrom=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;const e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}seek(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}_internalSeek(e,t){var i,n,a,r;(null===(i=this._loader)||void 0===i?void 0:i.isWorking())&&(null===(n=this._loader)||void 0===n||n.abort()),this._flushStashBuffer(t),null===(a=this._loader)||void 0===a||a.destroy(),this._loader=null;const o={from:e,to:-1};this._currentRange={from:o.from,to:-1},null===(r=this._speedSampler)||void 0===r||r.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,o),this._onSeeked&&this._onSeeked()}updateUrl(e){if(!e||"string"!=typeof e||0===e.length)throw new s.OC("Url must be a non-empty string!");this._dataSource.url=e}_expandBuffer(e){let t=this._stashSize;for(;t+1048576<e;)t*=2;if(t+=1048576,t===this._bufferSize)return;const i=new ArrayBuffer(t);if(this._stashUsed>0){const e=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(e,0)}this._stashBuffer=i,this._bufferSize=t}_normalizeSpeed(e){const t=this._speedNormalizeList,i=t.length-1;let n=0,a=0,r=i;if(e<t[0])return t[0];for(;a<=r;){if(n=a+Math.floor((r-a)/2),n===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?a=n+1:r=n-1}}_adjustStashSize(e){let t=0;t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e,t>8192&&(t=8192);const i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t}_dispatchChunks(e,t){return this._currentRange&&(this._currentRange.to=t+e.byteLength-1),this._onDataArrival?this._onDataArrival(e,t):0}_onURLRedirect(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)}_onContentLengthKnown(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)}_onLoaderChunkArrival(e,t,i){var n,a;if(!this._onDataArrival)throw new s.rT("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),null===(n=this._speedSampler)||void 0===n||n.addBytes(e.byteLength);const r=null===(a=this._speedSampler)||void 0===a?void 0:a.lastSecondKBps;if(0!==r){const e=this._normalizeSpeed(r);this._speedNormalized!==e&&(this._speedNormalized=e,this._adjustStashSize(e))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;else{let i=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){const t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart);if(n<t.byteLength){if(n>0){const e=new Uint8Array(t,n);i.set(e,0),this._stashUsed=e.byteLength,this._stashByteStart+=n}}else this._stashUsed=0,this._stashByteStart+=n;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),i=new Uint8Array(this._stashBuffer,0,this._bufferSize)),i.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{const n=this._dispatchChunks(e,t);if(n<e.byteLength){const a=e.byteLength-n;a>this._bufferSize&&(this._expandBuffer(a),i=new Uint8Array(this._stashBuffer,0,this._bufferSize)),i.set(new Uint8Array(e,n),0),this._stashUsed+=a,this._stashByteStart=t+n}}}else if(0===this._stashUsed){const i=this._dispatchChunks(e,t);if(i<e.byteLength){const n=e.byteLength-i;n>this._bufferSize&&this._expandBuffer(n),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(e,i),0),this._stashUsed+=n,this._stashByteStart=t+i}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);const t=new Uint8Array(this._stashBuffer,0,this._bufferSize);t.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;const i=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(i<this._stashUsed&&i>0){const e=new Uint8Array(this._stashBuffer,i);t.set(e,0)}this._stashUsed-=i,this._stashByteStart+=i}}_flushStashBuffer(e){if(this._stashUsed>0){const t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),a=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){const e=new Uint8Array(this._stashBuffer,0,this._bufferSize),n=new Uint8Array(t,i);e.set(n,0),this._stashUsed=n.byteLength,this._stashByteStart+=i}return 0}n.Z.w(this.TAG,`${a} bytes unconsumed data remain when flush buffer, dropped`)}return this._stashUsed=0,this._stashByteStart=0,a}return 0}_onLoaderComplete(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(e,t){var i;switch(n.Z.e(this.TAG,`Loader error, code = ${t.code}, msg = ${t.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=r.nm.UNRECOVERABLE_EARLY_EOF),e){case r.nm.EARLY_EOF:if(!this._config.isLive&&this._totalLength){const e=((null===(i=this._currentRange)||void 0===i?void 0:i.to)||0)+1;return void(e<this._totalLength&&(n.Z.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(e,!1)))}e=r.nm.UNRECOVERABLE_EARLY_EOF;case r.nm.UNRECOVERABLE_EARLY_EOF:case r.nm.CONNECTING_TIMEOUT:case r.nm.HTTP_STATUS_CODE_INVALID:case r.nm.EXCEPTION:}if(!this._onError)throw new s.OZ("IOException: "+t.msg);this._onError(e,t)}}},108:(e,t,i)=>{i.d(t,{GM:()=>a,fp:()=>o,nm:()=>r});var n=i(411);const a={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},r={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class o{constructor(e){this._type=e||"undefined",this._status=a.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=a.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===a.kConnecting||this._status===a.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(e){this._onContentLengthKnown=e}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(e){this._onURLRedirect=e}get onDataArrival(){return this._onDataArrival}set onDataArrival(e){this._onDataArrival=e}get onError(){return this._onError}set onError(e){this._onError=e}get onComplete(){return this._onComplete}set onComplete(e){this._onComplete=e}open(e,t){throw new n.do("Unimplemented abstract function!")}abort(){throw new n.do("Unimplemented abstract function!")}}},479:(e,t,i)=>{i.d(t,{Z:()=>a});const n={};!function(){const e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.includes("trident")&&/(rv)(?::| )([\w.]+)/.exec(e)||!e.includes("compatible")&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],a={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},r={};if(a.browser){r[a.browser]=!0;const e=a.majorVersion.split(".");r.version={major:parseInt(a.majorVersion,10),string:a.version},e.length>1&&(r.version.minor=parseInt(e[1],10)),e.length>2&&(r.version.build=parseInt(e[2],10))}if(a.platform&&(r[a.platform]=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){r.rv&&delete r.rv;const e="msie";a.browser=e,r[e]=!0}if(r.edge){delete r.edge;const e="msedge";a.browser=e,r[e]=!0}if(r.opr){const e="opera";a.browser=e,r[e]=!0}if(r.safari&&r.android){const e="android";a.browser=e,r[e]=!0}r.name=a.browser,r.platform=a.platform;for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e];Object.assign(n,r)}();const a=n},411:(e,t,i)=>{i.d(t,{OC:()=>r,OZ:()=>n,do:()=>o,rT:()=>a});class n{constructor(e){this.name="RuntimeException",this._message=e}get message(){return this._message}toString(){return this.name+": "+this.message}}class a extends n{constructor(e){super(e),this.name="IllegalStateException"}}class r extends n{constructor(e){super(e),this.name="InvalidArgumentException"}}class o extends n{constructor(e){super(e),this.name="NotImplementedException"}}},645:(e,t,i)=>{i.d(t,{Z:()=>r});var n=i(99);class a{static e(e,t){var i;e&&!a.FORCE_GLOBAL_TAG||(e=a.GLOBAL_TAG);const n=`[${e}] > ${t}`;a.ENABLE_CALLBACK&&(null===(i=a.emitter)||void 0===i||i.emit("log","error",n)),a.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))}static i(e,t){e&&!a.FORCE_GLOBAL_TAG||(e=a.GLOBAL_TAG);const i=`[${e}] > ${t}`;a.ENABLE_CALLBACK&&a.emitter.emit("log","info",i),a.ENABLE_INFO&&(console.info?console.info(i):console.log(i))}static w(e,t){e&&!a.FORCE_GLOBAL_TAG||(e=a.GLOBAL_TAG);const i=`[${e}] > ${t}`;a.ENABLE_CALLBACK&&a.emitter.emit("log","warn",i),a.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))}static d(e,t){var i;e&&!a.FORCE_GLOBAL_TAG||(e=a.GLOBAL_TAG);const n=`[${e}] > ${t}`;a.ENABLE_CALLBACK&&(null===(i=a.emitter)||void 0===i||i.emit("log","debug",n)),a.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))}static v(e,t){var i;e&&!a.FORCE_GLOBAL_TAG||(e=a.GLOBAL_TAG);const n=`[${e}] > ${t}`;a.ENABLE_CALLBACK&&(null===(i=a.emitter)||void 0===i||i.emit("log","verbose",n)),a.ENABLE_VERBOSE&&console.log(n)}}a.FORCE_GLOBAL_TAG=!1,a.GLOBAL_TAG="mpegts.js",a.ENABLE_CALLBACK=!1,a.emitter=new n.EventEmitter,a.ENABLE_ERROR=!0,a.ENABLE_INFO=!0,a.ENABLE_WARN=!0,a.ENABLE_DEBUG=!0,a.ENABLE_VERBOSE=!0;const r=a},278:(e,t,i)=>{i.d(t,{Z:()=>o});var n=i(99),a=i(645);class r{static get forceGlobalTag(){return a.Z.FORCE_GLOBAL_TAG}static set forceGlobalTag(e){a.Z.FORCE_GLOBAL_TAG=e,r._notifyChange()}static get globalTag(){return a.Z.GLOBAL_TAG}static set globalTag(e){a.Z.GLOBAL_TAG=e,r._notifyChange()}static get enableAll(){return a.Z.ENABLE_VERBOSE&&a.Z.ENABLE_DEBUG&&a.Z.ENABLE_INFO&&a.Z.ENABLE_WARN&&a.Z.ENABLE_ERROR}static set enableAll(e){a.Z.ENABLE_VERBOSE=e,a.Z.ENABLE_DEBUG=e,a.Z.ENABLE_INFO=e,a.Z.ENABLE_WARN=e,a.Z.ENABLE_ERROR=e,r._notifyChange()}static get enableDebug(){return a.Z.ENABLE_DEBUG}static set enableDebug(e){a.Z.ENABLE_DEBUG=e,r._notifyChange()}static get enableVerbose(){return a.Z.ENABLE_VERBOSE}static set enableVerbose(e){a.Z.ENABLE_VERBOSE=e,r._notifyChange()}static get enableInfo(){return a.Z.ENABLE_INFO}static set enableInfo(e){a.Z.ENABLE_INFO=e,r._notifyChange()}static get enableWarn(){return a.Z.ENABLE_WARN}static set enableWarn(e){a.Z.ENABLE_WARN=e,r._notifyChange()}static get enableError(){return a.Z.ENABLE_ERROR}static set enableError(e){a.Z.ENABLE_ERROR=e,r._notifyChange()}static getConfig(){return{globalTag:a.Z.GLOBAL_TAG,forceGlobalTag:a.Z.FORCE_GLOBAL_TAG,enableVerbose:a.Z.ENABLE_VERBOSE,enableDebug:a.Z.ENABLE_DEBUG,enableInfo:a.Z.ENABLE_INFO,enableWarn:a.Z.ENABLE_WARN,enableError:a.Z.ENABLE_ERROR,enableCallback:a.Z.ENABLE_CALLBACK}}static applyConfig(e){a.Z.GLOBAL_TAG=e.globalTag,a.Z.FORCE_GLOBAL_TAG=e.forceGlobalTag,a.Z.ENABLE_VERBOSE=e.enableVerbose,a.Z.ENABLE_DEBUG=e.enableDebug,a.Z.ENABLE_INFO=e.enableInfo,a.Z.ENABLE_WARN=e.enableWarn,a.Z.ENABLE_ERROR=e.enableError,a.Z.ENABLE_CALLBACK=!!e.enableCallback}static _notifyChange(){const e=r.emitter;if(e.listenerCount("change")>0){const t=r.getConfig();e.emit("change",t)}}static registerListener(e){r.emitter.addListener("change",e)}static removeListener(e){r.emitter.removeListener("change",e)}static addLogListener(e){a.Z.emitter.addListener("log",e),a.Z.emitter.listenerCount("log")>0&&(a.Z.ENABLE_CALLBACK=!0,r._notifyChange())}static removeLogListener(e){a.Z.emitter.removeListener("log",e),0===a.Z.emitter.listenerCount("log")&&(a.Z.ENABLE_CALLBACK=!1,r._notifyChange())}}r.emitter=new n.EventEmitter;const o=r}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}return i.m=e,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i(607)})()))}({exports:{}});!function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,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 s(e)}function c(e){var t=o();return function(){var i,n=a(e);if(t){var r=a(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return l(this,i)}}function d(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=d(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:i):a.value}},u.apply(this,arguments)}var h=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return i(t,[{key:"addEventListener",value:function(e,t,i){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:i})}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var i=this.listeners[e],n=0,a=i.length;n<a;n++)if(i[n].callback===t)return void i.splice(n,1)}},{key:"dispatchEvent",value:function(e){if(e.type in this.listeners){for(var t=this.listeners[e.type].slice(),i=0,n=t.length;i<n;i++){var a=t[i];try{a.callback.call(this,e)}catch(e){Promise.resolve().then((function(){throw e}))}a.options&&a.options.once&&this.removeEventListener(e.type,a.callback)}return!e.defaultPrevented}}}]),t}(),f=function(t){n(o,t);var r=c(o);function o(){var t;return e(this,o),(t=r.call(this)).listeners||h.call(s(t)),Object.defineProperty(s(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(s(t),"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(s(t),"reason",{value:void 0,writable:!0,configurable:!0}),t}return i(o,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),u(a(o.prototype),"dispatchEvent",this).call(this,e)}}]),o}(h),x=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new f,writable:!0,configurable:!0})}return i(t,[{key:"abort",value:function(e){var t;try{t=new Event("abort")}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}var i=e;if(void 0===i)if("undefined"==typeof document)(i=new Error("This operation was aborted")).name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch(e){(i=new Error("This operation was aborted")).name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();function p(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function m(e){"function"==typeof e&&(e={fetch:e});var t=e,i=t.fetch,n=t.Request,a=void 0===n?i.Request:n,r=t.AbortController,o=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=void 0!==o&&o;if(!p({fetch:i,Request:a,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:i,Request:l};var l=a;(l&&!l.prototype.hasOwnProperty("signal")||s)&&(l=function(e,t){var i;t&&t.signal&&(i=t.signal,delete t.signal);var n=new a(e,t);return i&&Object.defineProperty(n,"signal",{writable:!1,enumerable:!1,configurable:!0,value:i}),n},l.prototype=a.prototype);var c=i;return{fetch:function(e,t){var i=l&&l.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(i){var n;try{n=new DOMException("Aborted","AbortError")}catch(e){(n=new Error("Aborted")).name="AbortError"}if(i.aborted)return Promise.reject(n);var a=new Promise((function(e,t){i.addEventListener("abort",(function(){return t(n)}),{once:!0})}));return t&&t.signal&&delete t.signal,Promise.race([a,c(e,t)])}return c(e,t)},Request:l}}"undefined"!=typeof Symbol&&Symbol.toStringTag&&(x.prototype[Symbol.toStringTag]="AbortController",f.prototype[Symbol.toStringTag]="AbortSignal"),function(e){if(p(e))if(e.fetch){var t=m(e),i=t.fetch,n=t.Request;e.fetch=i,e.Request=n,Object.defineProperty(e,"AbortController",{writable:!0,enumerable:!1,configurable:!0,value:x}),Object.defineProperty(e,"AbortSignal",{writable:!0,enumerable:!1,configurable:!0,value:f})}else console.warn("fetch() is not available, cannot install abortcontroller-polyfill")}("undefined"!=typeof self?self:w)}();var D={exports:{}};!function(e,t){(function(){var i,n="Expected a function",a="__lodash_hash_undefined__",r="__lodash_placeholder__",o=16,s=32,l=64,c=128,d=256,u=1/0,h=9007199254740991,f=NaN,x=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",s],["partialRight",l],["rearg",d]],m="[object Arguments]",_="[object Array]",g="[object Boolean]",v="[object Date]",y="[object Error]",S="[object Function]",b="[object GeneratorFunction]",P="[object Map]",E="[object Number]",C="[object Object]",T="[object Promise]",R="[object RegExp]",I="[object Set]",D="[object String]",k="[object Symbol]",F="[object WeakMap]",A="[object ArrayBuffer]",M="[object DataView]",L="[object Float32Array]",B="[object Float64Array]",O="[object Int8Array]",j="[object Int16Array]",N="[object Int32Array]",U="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",V="[object Uint32Array]",Z=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,J=RegExp(Y.source),q=RegExp(X.source),K=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(ne.source),re=/^\s+/,oe=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,xe=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,_e=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,be=/['\n\r\u2028\u2029\\]/g,Pe="\\ud800-\\udfff",Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Re="A-Z\\xc0-\\xd6\\xd8-\\xde",we="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",De="['’]",ke="["+Pe+"]",Fe="["+Ie+"]",Ae="["+Ee+"]",Me="\\d+",Le="["+Ce+"]",Be="["+Te+"]",Oe="[^"+Pe+Ie+Me+Ce+Te+Re+"]",je="\\ud83c[\\udffb-\\udfff]",Ne="[^"+Pe+"]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Re+"]",Ve="\\u200d",Ze="(?:"+Be+"|"+Oe+")",We="(?:"+He+"|"+Oe+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",Ye="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xe="(?:"+Ae+"|"+je+")"+"?",Je="["+we+"]?",qe=Je+Xe+("(?:"+Ve+"(?:"+[Ne,Ue,ze].join("|")+")"+Je+Xe+")*"),Ke="(?:"+[Le,Ue,ze].join("|")+")"+qe,$e="(?:"+[Ne+Ae+"?",Ae,Ue,ze,ke].join("|")+")",Qe=RegExp(De,"g"),et=RegExp(Ae,"g"),tt=RegExp(je+"(?="+je+")|"+$e+qe,"g"),it=RegExp([He+"?"+Be+"+"+Ge+"(?="+[Fe,He,"$"].join("|")+")",We+"+"+Ye+"(?="+[Fe,He+Ze,"$"].join("|")+")",He+"?"+Ze+"+"+Ge,He+"+"+Ye,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Me,Ke].join("|"),"g"),nt=RegExp("["+Ve+Pe+Ee+we+"]"),at=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,st={};st[L]=st[B]=st[O]=st[j]=st[N]=st[U]=st[z]=st[H]=st[V]=!0,st[m]=st[_]=st[A]=st[g]=st[M]=st[v]=st[y]=st[S]=st[P]=st[E]=st[C]=st[R]=st[I]=st[D]=st[F]=!1;var lt={};lt[m]=lt[_]=lt[A]=lt[M]=lt[g]=lt[v]=lt[L]=lt[B]=lt[O]=lt[j]=lt[N]=lt[P]=lt[E]=lt[C]=lt[R]=lt[I]=lt[D]=lt[k]=lt[U]=lt[z]=lt[H]=lt[V]=!0,lt[y]=lt[S]=lt[F]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dt=parseFloat,ut=parseInt,ht="object"==typeof w&&w&&w.Object===Object&&w,ft="object"==typeof self&&self&&self.Object===Object&&self,xt=ht||ft||Function("return this")(),pt=t&&!t.nodeType&&t,mt=pt&&e&&!e.nodeType&&e,_t=mt&&mt.exports===pt,gt=_t&&ht.process,vt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),yt=vt&&vt.isArrayBuffer,St=vt&&vt.isDate,bt=vt&&vt.isMap,Pt=vt&&vt.isRegExp,Et=vt&&vt.isSet,Ct=vt&&vt.isTypedArray;function Tt(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function Rt(e,t,i,n){for(var a=-1,r=null==e?0:e.length;++a<r;){var o=e[a];t(n,o,i(o),e)}return n}function wt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););return e}function It(e,t){for(var i=null==e?0:e.length;i--&&!1!==t(e[i],i,e););return e}function Dt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(!t(e[i],i,e))return!1;return!0}function kt(e,t){for(var i=-1,n=null==e?0:e.length,a=0,r=[];++i<n;){var o=e[i];t(o,i,e)&&(r[a++]=o)}return r}function Ft(e,t){return!!(null==e?0:e.length)&&Ht(e,t,0)>-1}function At(e,t,i){for(var n=-1,a=null==e?0:e.length;++n<a;)if(i(t,e[n]))return!0;return!1}function Mt(e,t){for(var i=-1,n=null==e?0:e.length,a=Array(n);++i<n;)a[i]=t(e[i],i,e);return a}function Lt(e,t){for(var i=-1,n=t.length,a=e.length;++i<n;)e[a+i]=t[i];return e}function Bt(e,t,i,n){var a=-1,r=null==e?0:e.length;for(n&&r&&(i=e[++a]);++a<r;)i=t(i,e[a],a,e);return i}function Ot(e,t,i,n){var a=null==e?0:e.length;for(n&&a&&(i=e[--a]);a--;)i=t(i,e[a],a,e);return i}function jt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}var Nt=Gt("length");function Ut(e,t,i){var n;return i(e,(function(e,i,a){if(t(e,i,a))return n=i,!1})),n}function zt(e,t,i,n){for(var a=e.length,r=i+(n?1:-1);n?r--:++r<a;)if(t(e[r],r,e))return r;return-1}function Ht(e,t,i){return t==t?function(e,t,i){var n=i-1,a=e.length;for(;++n<a;)if(e[n]===t)return n;return-1}(e,t,i):zt(e,Zt,i)}function Vt(e,t,i,n){for(var a=i-1,r=e.length;++a<r;)if(n(e[a],t))return a;return-1}function Zt(e){return e!=e}function Wt(e,t){var i=null==e?0:e.length;return i?Jt(e,t)/i:f}function Gt(e){return function(t){return null==t?i:t[e]}}function Yt(e){return function(t){return null==e?i:e[t]}}function Xt(e,t,i,n,a){return a(e,(function(e,a,r){i=n?(n=!1,e):t(i,e,a,r)})),i}function Jt(e,t){for(var n,a=-1,r=e.length;++a<r;){var o=t(e[a]);o!==i&&(n=n===i?o:n+o)}return n}function qt(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}function Kt(e){return e?e.slice(0,xi(e)+1).replace(re,""):e}function $t(e){return function(t){return e(t)}}function Qt(e,t){return Mt(t,(function(t){return e[t]}))}function ei(e,t){return e.has(t)}function ti(e,t){for(var i=-1,n=e.length;++i<n&&Ht(t,e[i],0)>-1;);return i}function ii(e,t){for(var i=e.length;i--&&Ht(t,e[i],0)>-1;);return i}var ni=Yt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ai=Yt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ri(e){return"\\"+ct[e]}function oi(e){return nt.test(e)}function si(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function li(e,t){return function(i){return e(t(i))}}function ci(e,t){for(var i=-1,n=e.length,a=0,o=[];++i<n;){var s=e[i];s!==t&&s!==r||(e[i]=r,o[a++]=i)}return o}function di(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}function ui(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=[e,e]})),i}function hi(e){return oi(e)?function(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):Nt(e)}function fi(e){return oi(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.split("")}(e)}function xi(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var pi=Yt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var mi=function e(t){var w,oe=(t=null==t?xt:mi.defaults(xt.Object(),t,mi.pick(xt,rt))).Array,Pe=t.Date,Ee=t.Error,Ce=t.Function,Te=t.Math,Re=t.Object,we=t.RegExp,Ie=t.String,De=t.TypeError,ke=oe.prototype,Fe=Ce.prototype,Ae=Re.prototype,Me=t["__core-js_shared__"],Le=Fe.toString,Be=Ae.hasOwnProperty,Oe=0,je=(w=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Ne=Ae.toString,Ue=Le.call(Re),ze=xt._,He=we("^"+Le.call(Be).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=_t?t.Buffer:i,Ze=t.Symbol,We=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:i,Ye=li(Re.getPrototypeOf,Re),Xe=Re.create,Je=Ae.propertyIsEnumerable,qe=ke.splice,Ke=Ze?Ze.isConcatSpreadable:i,$e=Ze?Ze.iterator:i,tt=Ze?Ze.toStringTag:i,nt=function(){try{var e=hr(Re,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==xt.clearTimeout&&t.clearTimeout,ht=Pe&&Pe.now!==xt.Date.now&&Pe.now,ft=t.setTimeout!==xt.setTimeout&&t.setTimeout,pt=Te.ceil,mt=Te.floor,gt=Re.getOwnPropertySymbols,vt=Ve?Ve.isBuffer:i,Nt=t.isFinite,Yt=ke.join,_i=li(Re.keys,Re),gi=Te.max,vi=Te.min,yi=Pe.now,Si=t.parseInt,bi=Te.random,Pi=ke.reverse,Ei=hr(t,"DataView"),Ci=hr(t,"Map"),Ti=hr(t,"Promise"),Ri=hr(t,"Set"),wi=hr(t,"WeakMap"),Ii=hr(Re,"create"),Di=wi&&new wi,ki={},Fi=jr(Ei),Ai=jr(Ci),Mi=jr(Ti),Li=jr(Ri),Bi=jr(wi),Oi=Ze?Ze.prototype:i,ji=Oi?Oi.valueOf:i,Ni=Oi?Oi.toString:i;function Ui(e){if(is(e)&&!Wo(e)&&!(e instanceof Zi)){if(e instanceof Vi)return e;if(Be.call(e,"__wrapped__"))return Nr(e)}return new Vi(e)}var zi=function(){function e(){}return function(t){if(!ts(t))return{};if(Xe)return Xe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Hi(){}function Vi(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Zi(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=x,this.__views__=[]}function Wi(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Gi(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Yi(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Xi(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Yi;++t<i;)this.add(e[t])}function Ji(e){var t=this.__data__=new Gi(e);this.size=t.size}function qi(e,t){var i=Wo(e),n=!i&&Zo(e),a=!i&&!n&&Jo(e),r=!i&&!n&&!a&&ds(e),o=i||n||a||r,s=o?qt(e.length,Ie):[],l=s.length;for(var c in e)!t&&!Be.call(e,c)||o&&("length"==c||a&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vr(c,l))||s.push(c);return s}function Ki(e){var t=e.length;return t?e[Jn(0,t-1)]:i}function $i(e,t){return Lr(Da(e),ln(t,0,e.length))}function Qi(e){return Lr(Da(e))}function en(e,t,n){(n!==i&&!zo(e[t],n)||n===i&&!(t in e))&&on(e,t,n)}function tn(e,t,n){var a=e[t];Be.call(e,t)&&zo(a,n)&&(n!==i||t in e)||on(e,t,n)}function nn(e,t){for(var i=e.length;i--;)if(zo(e[i][0],t))return i;return-1}function an(e,t,i,n){return fn(e,(function(e,a,r){t(n,e,i(e),r)})),n}function rn(e,t){return e&&ka(t,Fs(t),e)}function on(e,t,i){"__proto__"==t&&nt?nt(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function sn(e,t){for(var n=-1,a=t.length,r=oe(a),o=null==e;++n<a;)r[n]=o?i:Rs(e,t[n]);return r}function ln(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function cn(e,t,n,a,r,o){var s,l=1&t,c=2&t,d=4&t;if(n&&(s=r?n(e,a,r,o):n(e)),s!==i)return s;if(!ts(e))return e;var u=Wo(e);if(u){if(s=function(e){var t=e.length,i=new e.constructor(t);t&&"string"==typeof e[0]&&Be.call(e,"index")&&(i.index=e.index,i.input=e.input);return i}(e),!l)return Da(e,s)}else{var h=pr(e),f=h==S||h==b;if(Jo(e))return Ea(e,l);if(h==C||h==m||f&&!r){if(s=c||f?{}:_r(e),!l)return c?function(e,t){return ka(e,xr(e),t)}(e,function(e,t){return e&&ka(t,As(t),e)}(s,e)):function(e,t){return ka(e,fr(e),t)}(e,rn(s,e))}else{if(!lt[h])return r?e:{};s=function(e,t,i){var n=e.constructor;switch(t){case A:return Ca(e);case g:case v:return new n(+e);case M:return function(e,t){var i=t?Ca(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case L:case B:case O:case j:case N:case U:case z:case H:case V:return Ta(e,i);case P:return new n;case E:case D:return new n(e);case R:return function(e){var t=new e.constructor(e.source,xe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new n;case k:return a=e,ji?Re(ji.call(a)):{}}var a}(e,h,l)}}o||(o=new Ji);var x=o.get(e);if(x)return x;o.set(e,s),ss(e)?e.forEach((function(i){s.add(cn(i,t,n,i,e,o))})):ns(e)&&e.forEach((function(i,a){s.set(a,cn(i,t,n,a,e,o))}));var p=u?i:(d?c?rr:ar:c?As:Fs)(e);return wt(p||e,(function(i,a){p&&(i=e[a=i]),tn(s,a,cn(i,t,n,a,e,o))})),s}function dn(e,t,n){var a=n.length;if(null==e)return!a;for(e=Re(e);a--;){var r=n[a],o=t[r],s=e[r];if(s===i&&!(r in e)||!o(s))return!1}return!0}function un(e,t,a){if("function"!=typeof e)throw new De(n);return kr((function(){e.apply(i,a)}),t)}function hn(e,t,i,n){var a=-1,r=Ft,o=!0,s=e.length,l=[],c=t.length;if(!s)return l;i&&(t=Mt(t,$t(i))),n?(r=At,o=!1):t.length>=200&&(r=ei,o=!1,t=new Xi(t));e:for(;++a<s;){var d=e[a],u=null==i?d:i(d);if(d=n||0!==d?d:0,o&&u==u){for(var h=c;h--;)if(t[h]===u)continue e;l.push(d)}else r(t,u,n)||l.push(d)}return l}Ui.templateSettings={escape:K,evaluate:$,interpolate:Q,variable:"",imports:{_:Ui}},Ui.prototype=Hi.prototype,Ui.prototype.constructor=Ui,Vi.prototype=zi(Hi.prototype),Vi.prototype.constructor=Vi,Zi.prototype=zi(Hi.prototype),Zi.prototype.constructor=Zi,Wi.prototype.clear=function(){this.__data__=Ii?Ii(null):{},this.size=0},Wi.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wi.prototype.get=function(e){var t=this.__data__;if(Ii){var n=t[e];return n===a?i:n}return Be.call(t,e)?t[e]:i},Wi.prototype.has=function(e){var t=this.__data__;return Ii?t[e]!==i:Be.call(t,e)},Wi.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ii&&t===i?a:t,this},Gi.prototype.clear=function(){this.__data__=[],this.size=0},Gi.prototype.delete=function(e){var t=this.__data__,i=nn(t,e);return!(i<0)&&(i==t.length-1?t.pop():qe.call(t,i,1),--this.size,!0)},Gi.prototype.get=function(e){var t=this.__data__,n=nn(t,e);return n<0?i:t[n][1]},Gi.prototype.has=function(e){return nn(this.__data__,e)>-1},Gi.prototype.set=function(e,t){var i=this.__data__,n=nn(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this},Yi.prototype.clear=function(){this.size=0,this.__data__={hash:new Wi,map:new(Ci||Gi),string:new Wi}},Yi.prototype.delete=function(e){var t=dr(this,e).delete(e);return this.size-=t?1:0,t},Yi.prototype.get=function(e){return dr(this,e).get(e)},Yi.prototype.has=function(e){return dr(this,e).has(e)},Yi.prototype.set=function(e,t){var i=dr(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},Xi.prototype.add=Xi.prototype.push=function(e){return this.__data__.set(e,a),this},Xi.prototype.has=function(e){return this.__data__.has(e)},Ji.prototype.clear=function(){this.__data__=new Gi,this.size=0},Ji.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Ji.prototype.get=function(e){return this.__data__.get(e)},Ji.prototype.has=function(e){return this.__data__.has(e)},Ji.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Gi){var n=i.__data__;if(!Ci||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new Yi(n)}return i.set(e,t),this.size=i.size,this};var fn=Ma(Sn),xn=Ma(bn,!0);function pn(e,t){var i=!0;return fn(e,(function(e,n,a){return i=!!t(e,n,a)})),i}function mn(e,t,n){for(var a=-1,r=e.length;++a<r;){var o=e[a],s=t(o);if(null!=s&&(l===i?s==s&&!cs(s):n(s,l)))var l=s,c=o}return c}function _n(e,t){var i=[];return fn(e,(function(e,n,a){t(e,n,a)&&i.push(e)})),i}function gn(e,t,i,n,a){var r=-1,o=e.length;for(i||(i=gr),a||(a=[]);++r<o;){var s=e[r];t>0&&i(s)?t>1?gn(s,t-1,i,n,a):Lt(a,s):n||(a[a.length]=s)}return a}var vn=La(),yn=La(!0);function Sn(e,t){return e&&vn(e,t,Fs)}function bn(e,t){return e&&yn(e,t,Fs)}function Pn(e,t){return kt(t,(function(t){return $o(e[t])}))}function En(e,t){for(var n=0,a=(t=ya(t,e)).length;null!=e&&n<a;)e=e[Or(t[n++])];return n&&n==a?e:i}function Cn(e,t,i){var n=t(e);return Wo(e)?n:Lt(n,i(e))}function Tn(e){return null==e?e===i?"[object Undefined]":"[object Null]":tt&&tt in Re(e)?function(e){var t=Be.call(e,tt),n=e[tt];try{e[tt]=i;var a=!0}catch(e){}var r=Ne.call(e);a&&(t?e[tt]=n:delete e[tt]);return r}(e):function(e){return Ne.call(e)}(e)}function Rn(e,t){return e>t}function wn(e,t){return null!=e&&Be.call(e,t)}function In(e,t){return null!=e&&t in Re(e)}function Dn(e,t,n){for(var a=n?At:Ft,r=e[0].length,o=e.length,s=o,l=oe(o),c=1/0,d=[];s--;){var u=e[s];s&&t&&(u=Mt(u,$t(t))),c=vi(u.length,c),l[s]=!n&&(t||r>=120&&u.length>=120)?new Xi(s&&u):i}u=e[0];var h=-1,f=l[0];e:for(;++h<r&&d.length<c;){var x=u[h],p=t?t(x):x;if(x=n||0!==x?x:0,!(f?ei(f,p):a(d,p,n))){for(s=o;--s;){var m=l[s];if(!(m?ei(m,p):a(e[s],p,n)))continue e}f&&f.push(p),d.push(x)}}return d}function kn(e,t,n){var a=null==(e=wr(e,t=ya(t,e)))?e:e[Or(qr(t))];return null==a?i:Tt(a,e,n)}function Fn(e){return is(e)&&Tn(e)==m}function An(e,t,n,a,r){return e===t||(null==e||null==t||!is(e)&&!is(t)?e!=e&&t!=t:function(e,t,n,a,r,o){var s=Wo(e),l=Wo(t),c=s?_:pr(e),d=l?_:pr(t),u=(c=c==m?C:c)==C,h=(d=d==m?C:d)==C,f=c==d;if(f&&Jo(e)){if(!Jo(t))return!1;s=!0,u=!1}if(f&&!u)return o||(o=new Ji),s||ds(e)?ir(e,t,n,a,r,o):function(e,t,i,n,a,r,o){switch(i){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!r(new We(e),new We(t)));case g:case v:case E:return zo(+e,+t);case y:return e.name==t.name&&e.message==t.message;case R:case D:return e==t+"";case P:var s=si;case I:var l=1&n;if(s||(s=di),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;n|=2,o.set(e,t);var d=ir(s(e),s(t),n,a,r,o);return o.delete(e),d;case k:if(ji)return ji.call(e)==ji.call(t)}return!1}(e,t,c,n,a,r,o);if(!(1&n)){var x=u&&Be.call(e,"__wrapped__"),p=h&&Be.call(t,"__wrapped__");if(x||p){var S=x?e.value():e,b=p?t.value():t;return o||(o=new Ji),r(S,b,n,a,o)}}if(!f)return!1;return o||(o=new Ji),function(e,t,n,a,r,o){var s=1&n,l=ar(e),c=l.length,d=ar(t),u=d.length;if(c!=u&&!s)return!1;var h=c;for(;h--;){var f=l[h];if(!(s?f in t:Be.call(t,f)))return!1}var x=o.get(e),p=o.get(t);if(x&&p)return x==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);var _=s;for(;++h<c;){var g=e[f=l[h]],v=t[f];if(a)var y=s?a(v,g,f,t,e,o):a(g,v,f,e,t,o);if(!(y===i?g===v||r(g,v,n,a,o):y)){m=!1;break}_||(_="constructor"==f)}if(m&&!_){var S=e.constructor,b=t.constructor;S==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof S&&S instanceof S&&"function"==typeof b&&b instanceof b||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,a,r,o)}(e,t,n,a,An,r))}function Mn(e,t,n,a){var r=n.length,o=r,s=!a;if(null==e)return!o;for(e=Re(e);r--;){var l=n[r];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++r<o;){var c=(l=n[r])[0],d=e[c],u=l[1];if(s&&l[2]){if(d===i&&!(c in e))return!1}else{var h=new Ji;if(a)var f=a(d,u,c,e,t,h);if(!(f===i?An(u,d,3,a,h):f))return!1}}return!0}function Ln(e){return!(!ts(e)||(t=e,je&&je in t))&&($o(e)?He:_e).test(jr(e));var t}function Bn(e){return"function"==typeof e?e:null==e?al:"object"==typeof e?Wo(e)?Hn(e[0],e[1]):zn(e):fl(e)}function On(e){if(!Er(e))return _i(e);var t=[];for(var i in Re(e))Be.call(e,i)&&"constructor"!=i&&t.push(i);return t}function jn(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var i in Re(e))t.push(i);return t}(e);var t=Er(e),i=[];for(var n in e)("constructor"!=n||!t&&Be.call(e,n))&&i.push(n);return i}function Nn(e,t){return e<t}function Un(e,t){var i=-1,n=Yo(e)?oe(e.length):[];return fn(e,(function(e,a,r){n[++i]=t(e,a,r)})),n}function zn(e){var t=ur(e);return 1==t.length&&t[0][2]?Tr(t[0][0],t[0][1]):function(i){return i===e||Mn(i,e,t)}}function Hn(e,t){return Sr(e)&&Cr(t)?Tr(Or(e),t):function(n){var a=Rs(n,e);return a===i&&a===t?ws(n,e):An(t,a,3)}}function Vn(e,t,n,a,r){e!==t&&vn(t,(function(o,s){if(r||(r=new Ji),ts(o))!function(e,t,n,a,r,o,s){var l=Ir(e,n),c=Ir(t,n),d=s.get(c);if(d)return void en(e,n,d);var u=o?o(l,c,n+"",e,t,s):i,h=u===i;if(h){var f=Wo(c),x=!f&&Jo(c),p=!f&&!x&&ds(c);u=c,f||x||p?Wo(l)?u=l:Xo(l)?u=Da(l):x?(h=!1,u=Ea(c,!0)):p?(h=!1,u=Ta(c,!0)):u=[]:rs(c)||Zo(c)?(u=l,Zo(l)?u=gs(l):ts(l)&&!$o(l)||(u=_r(c))):h=!1}h&&(s.set(c,u),r(u,c,a,o,s),s.delete(c));en(e,n,u)}(e,t,s,n,Vn,a,r);else{var l=a?a(Ir(e,s),o,s+"",e,t,r):i;l===i&&(l=o),en(e,s,l)}}),As)}function Zn(e,t){var n=e.length;if(n)return vr(t+=t<0?n:0,n)?e[t]:i}function Wn(e,t,i){t=t.length?Mt(t,(function(e){return Wo(e)?function(t){return En(t,1===e.length?e[0]:e)}:e})):[al];var n=-1;t=Mt(t,$t(cr()));var a=Un(e,(function(e,i,a){var r=Mt(t,(function(t){return t(e)}));return{criteria:r,index:++n,value:e}}));return function(e,t){var i=e.length;for(e.sort(t);i--;)e[i]=e[i].value;return e}(a,(function(e,t){return function(e,t,i){var n=-1,a=e.criteria,r=t.criteria,o=a.length,s=i.length;for(;++n<o;){var l=Ra(a[n],r[n]);if(l)return n>=s?l:l*("desc"==i[n]?-1:1)}return e.index-t.index}(e,t,i)}))}function Gn(e,t,i){for(var n=-1,a=t.length,r={};++n<a;){var o=t[n],s=En(e,o);i(s,o)&&ea(r,ya(o,e),s)}return r}function Yn(e,t,i,n){var a=n?Vt:Ht,r=-1,o=t.length,s=e;for(e===t&&(t=Da(t)),i&&(s=Mt(e,$t(i)));++r<o;)for(var l=0,c=t[r],d=i?i(c):c;(l=a(s,d,l,n))>-1;)s!==e&&qe.call(s,l,1),qe.call(e,l,1);return e}function Xn(e,t){for(var i=e?t.length:0,n=i-1;i--;){var a=t[i];if(i==n||a!==r){var r=a;vr(a)?qe.call(e,a,1):ha(e,a)}}return e}function Jn(e,t){return e+mt(bi()*(t-e+1))}function qn(e,t){var i="";if(!e||t<1||t>h)return i;do{t%2&&(i+=e),(t=mt(t/2))&&(e+=e)}while(t);return i}function Kn(e,t){return Fr(Rr(e,t,al),e+"")}function $n(e){return Ki(zs(e))}function Qn(e,t){var i=zs(e);return Lr(i,ln(t,0,i.length))}function ea(e,t,n,a){if(!ts(e))return e;for(var r=-1,o=(t=ya(t,e)).length,s=o-1,l=e;null!=l&&++r<o;){var c=Or(t[r]),d=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(r!=s){var u=l[c];(d=a?a(u,c,l):i)===i&&(d=ts(u)?u:vr(t[r+1])?[]:{})}tn(l,c,d),l=l[c]}return e}var ta=Di?function(e,t){return Di.set(e,t),e}:al,ia=nt?function(e,t){return nt(e,"toString",{configurable:!0,enumerable:!1,value:tl(t),writable:!0})}:al;function na(e){return Lr(zs(e))}function aa(e,t,i){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(i=i>a?a:i)<0&&(i+=a),a=t>i?0:i-t>>>0,t>>>=0;for(var r=oe(a);++n<a;)r[n]=e[n+t];return r}function ra(e,t){var i;return fn(e,(function(e,n,a){return!(i=t(e,n,a))})),!!i}function oa(e,t,i){var n=0,a=null==e?n:e.length;if("number"==typeof t&&t==t&&a<=2147483647){for(;n<a;){var r=n+a>>>1,o=e[r];null!==o&&!cs(o)&&(i?o<=t:o<t)?n=r+1:a=r}return a}return sa(e,t,al,i)}function sa(e,t,n,a){var r=0,o=null==e?0:e.length;if(0===o)return 0;for(var s=(t=n(t))!=t,l=null===t,c=cs(t),d=t===i;r<o;){var u=mt((r+o)/2),h=n(e[u]),f=h!==i,x=null===h,p=h==h,m=cs(h);if(s)var _=a||p;else _=d?p&&(a||f):l?p&&f&&(a||!x):c?p&&f&&!x&&(a||!m):!x&&!m&&(a?h<=t:h<t);_?r=u+1:o=u}return vi(o,4294967294)}function la(e,t){for(var i=-1,n=e.length,a=0,r=[];++i<n;){var o=e[i],s=t?t(o):o;if(!i||!zo(s,l)){var l=s;r[a++]=0===o?0:o}}return r}function ca(e){return"number"==typeof e?e:cs(e)?f:+e}function da(e){if("string"==typeof e)return e;if(Wo(e))return Mt(e,da)+"";if(cs(e))return Ni?Ni.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ua(e,t,i){var n=-1,a=Ft,r=e.length,o=!0,s=[],l=s;if(i)o=!1,a=At;else if(r>=200){var c=t?null:qa(e);if(c)return di(c);o=!1,a=ei,l=new Xi}else l=t?[]:s;e:for(;++n<r;){var d=e[n],u=t?t(d):d;if(d=i||0!==d?d:0,o&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),s.push(d)}else a(l,u,i)||(l!==s&&l.push(u),s.push(d))}return s}function ha(e,t){return null==(e=wr(e,t=ya(t,e)))||delete e[Or(qr(t))]}function fa(e,t,i,n){return ea(e,t,i(En(e,t)),n)}function xa(e,t,i,n){for(var a=e.length,r=n?a:-1;(n?r--:++r<a)&&t(e[r],r,e););return i?aa(e,n?0:r,n?r+1:a):aa(e,n?r+1:0,n?a:r)}function pa(e,t){var i=e;return i instanceof Zi&&(i=i.value()),Bt(t,(function(e,t){return t.func.apply(t.thisArg,Lt([e],t.args))}),i)}function ma(e,t,i){var n=e.length;if(n<2)return n?ua(e[0]):[];for(var a=-1,r=oe(n);++a<n;)for(var o=e[a],s=-1;++s<n;)s!=a&&(r[a]=hn(r[a]||o,e[s],t,i));return ua(gn(r,1),t,i)}function _a(e,t,n){for(var a=-1,r=e.length,o=t.length,s={};++a<r;){var l=a<o?t[a]:i;n(s,e[a],l)}return s}function ga(e){return Xo(e)?e:[]}function va(e){return"function"==typeof e?e:al}function ya(e,t){return Wo(e)?e:Sr(e,t)?[e]:Br(vs(e))}var Sa=Kn;function ba(e,t,n){var a=e.length;return n=n===i?a:n,!t&&n>=a?e:aa(e,t,n)}var Pa=ct||function(e){return xt.clearTimeout(e)};function Ea(e,t){if(t)return e.slice();var i=e.length,n=Ge?Ge(i):new e.constructor(i);return e.copy(n),n}function Ca(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Ta(e,t){var i=t?Ca(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function Ra(e,t){if(e!==t){var n=e!==i,a=null===e,r=e==e,o=cs(e),s=t!==i,l=null===t,c=t==t,d=cs(t);if(!l&&!d&&!o&&e>t||o&&s&&c&&!l&&!d||a&&s&&c||!n&&c||!r)return 1;if(!a&&!o&&!d&&e<t||d&&n&&r&&!a&&!o||l&&n&&r||!s&&r||!c)return-1}return 0}function wa(e,t,i,n){for(var a=-1,r=e.length,o=i.length,s=-1,l=t.length,c=gi(r-o,0),d=oe(l+c),u=!n;++s<l;)d[s]=t[s];for(;++a<o;)(u||a<r)&&(d[i[a]]=e[a]);for(;c--;)d[s++]=e[a++];return d}function Ia(e,t,i,n){for(var a=-1,r=e.length,o=-1,s=i.length,l=-1,c=t.length,d=gi(r-s,0),u=oe(d+c),h=!n;++a<d;)u[a]=e[a];for(var f=a;++l<c;)u[f+l]=t[l];for(;++o<s;)(h||a<r)&&(u[f+i[o]]=e[a++]);return u}function Da(e,t){var i=-1,n=e.length;for(t||(t=oe(n));++i<n;)t[i]=e[i];return t}function ka(e,t,n,a){var r=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var l=t[o],c=a?a(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),r?on(n,l,c):tn(n,l,c)}return n}function Fa(e,t){return function(i,n){var a=Wo(i)?Rt:an,r=t?t():{};return a(i,e,cr(n,2),r)}}function Aa(e){return Kn((function(t,n){var a=-1,r=n.length,o=r>1?n[r-1]:i,s=r>2?n[2]:i;for(o=e.length>3&&"function"==typeof o?(r--,o):i,s&&yr(n[0],n[1],s)&&(o=r<3?i:o,r=1),t=Re(t);++a<r;){var l=n[a];l&&e(t,l,a,o)}return t}))}function Ma(e,t){return function(i,n){if(null==i)return i;if(!Yo(i))return e(i,n);for(var a=i.length,r=t?a:-1,o=Re(i);(t?r--:++r<a)&&!1!==n(o[r],r,o););return i}}function La(e){return function(t,i,n){for(var a=-1,r=Re(t),o=n(t),s=o.length;s--;){var l=o[e?s:++a];if(!1===i(r[l],l,r))break}return t}}function Ba(e){return function(t){var n=oi(t=vs(t))?fi(t):i,a=n?n[0]:t.charAt(0),r=n?ba(n,1).join(""):t.slice(1);return a[e]()+r}}function Oa(e){return function(t){return Bt($s(Zs(t).replace(Qe,"")),e,"")}}function ja(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var i=zi(e.prototype),n=e.apply(i,t);return ts(n)?n:i}}function Na(e){return function(t,n,a){var r=Re(t);if(!Yo(t)){var o=cr(n,3);t=Fs(t),n=function(e){return o(r[e],e,r)}}var s=e(t,n,a);return s>-1?r[o?t[s]:s]:i}}function Ua(e){return nr((function(t){var a=t.length,r=a,o=Vi.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new De(n);if(o&&!l&&"wrapper"==sr(s))var l=new Vi([],!0)}for(r=l?r:a;++r<a;){var c=sr(s=t[r]),d="wrapper"==c?or(s):i;l=d&&br(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[sr(d[0])].apply(l,d[3]):1==s.length&&br(s)?l[c]():l.thru(s)}return function(){var e=arguments,i=e[0];if(l&&1==e.length&&Wo(i))return l.plant(i).value();for(var n=0,r=a?t[n].apply(this,e):i;++n<a;)r=t[n].call(this,r);return r}}))}function za(e,t,n,a,r,o,s,l,d,u){var h=t&c,f=1&t,x=2&t,p=24&t,m=512&t,_=x?i:ja(e);return function c(){for(var g=arguments.length,v=oe(g),y=g;y--;)v[y]=arguments[y];if(p)var S=lr(c),b=function(e,t){for(var i=e.length,n=0;i--;)e[i]===t&&++n;return n}(v,S);if(a&&(v=wa(v,a,r,p)),o&&(v=Ia(v,o,s,p)),g-=b,p&&g<u){var P=ci(v,S);return Xa(e,t,za,c.placeholder,n,v,P,l,d,u-g)}var E=f?n:this,C=x?E[e]:e;return g=v.length,l?v=function(e,t){var n=e.length,a=vi(t.length,n),r=Da(e);for(;a--;){var o=t[a];e[a]=vr(o,n)?r[o]:i}return e}(v,l):m&&g>1&&v.reverse(),h&&d<g&&(v.length=d),this&&this!==xt&&this instanceof c&&(C=_||ja(C)),C.apply(E,v)}}function Ha(e,t){return function(i,n){return function(e,t,i,n){return Sn(e,(function(e,a,r){t(n,i(e),a,r)})),n}(i,e,t(n),{})}}function Va(e,t){return function(n,a){var r;if(n===i&&a===i)return t;if(n!==i&&(r=n),a!==i){if(r===i)return a;"string"==typeof n||"string"==typeof a?(n=da(n),a=da(a)):(n=ca(n),a=ca(a)),r=e(n,a)}return r}}function Za(e){return nr((function(t){return t=Mt(t,$t(cr())),Kn((function(i){var n=this;return e(t,(function(e){return Tt(e,n,i)}))}))}))}function Wa(e,t){var n=(t=t===i?" ":da(t)).length;if(n<2)return n?qn(t,e):t;var a=qn(t,pt(e/hi(t)));return oi(t)?ba(fi(a),0,e).join(""):a.slice(0,e)}function Ga(e){return function(t,n,a){return a&&"number"!=typeof a&&yr(t,n,a)&&(n=a=i),t=xs(t),n===i?(n=t,t=0):n=xs(n),function(e,t,i,n){for(var a=-1,r=gi(pt((t-e)/(i||1)),0),o=oe(r);r--;)o[n?r:++a]=e,e+=i;return o}(t,n,a=a===i?t<n?1:-1:xs(a),e)}}function Ya(e){return function(t,i){return"string"==typeof t&&"string"==typeof i||(t=_s(t),i=_s(i)),e(t,i)}}function Xa(e,t,n,a,r,o,c,d,u,h){var f=8&t;t|=f?s:l,4&(t&=~(f?l:s))||(t&=-4);var x=[e,t,r,f?o:i,f?c:i,f?i:o,f?i:c,d,u,h],p=n.apply(i,x);return br(e)&&Dr(p,x),p.placeholder=a,Ar(p,e,t)}function Ja(e){var t=Te[e];return function(e,i){if(e=_s(e),(i=null==i?0:vi(ps(i),292))&&Nt(e)){var n=(vs(e)+"e").split("e");return+((n=(vs(t(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return t(e)}}var qa=Ri&&1/di(new Ri([,-0]))[1]==u?function(e){return new Ri(e)}:cl;function Ka(e){return function(t){var i=pr(t);return i==P?si(t):i==I?ui(t):function(e,t){return Mt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function $a(e,t,a,u,h,f,x,p){var m=2&t;if(!m&&"function"!=typeof e)throw new De(n);var _=u?u.length:0;if(_||(t&=-97,u=h=i),x=x===i?x:gi(ps(x),0),p=p===i?p:ps(p),_-=h?h.length:0,t&l){var g=u,v=h;u=h=i}var y=m?i:or(e),S=[e,t,a,u,h,g,v,f,x,p];if(y&&function(e,t){var i=e[1],n=t[1],a=i|n,o=a<131,s=n==c&&8==i||n==c&&i==d&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==i;if(!o&&!s)return e;1&n&&(e[2]=t[2],a|=1&i?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?wa(u,l,t[4]):l,e[4]=u?ci(e[3],r):t[4]}(l=t[5])&&(u=e[5],e[5]=u?Ia(u,l,t[6]):l,e[6]=u?ci(e[5],r):t[6]);(l=t[7])&&(e[7]=l);n&c&&(e[8]=null==e[8]?t[8]:vi(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=a}(S,y),e=S[0],t=S[1],a=S[2],u=S[3],h=S[4],!(p=S[9]=S[9]===i?m?0:e.length:gi(S[9]-_,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||t==o?function(e,t,n){var a=ja(e);return function r(){for(var o=arguments.length,s=oe(o),l=o,c=lr(r);l--;)s[l]=arguments[l];var d=o<3&&s[0]!==c&&s[o-1]!==c?[]:ci(s,c);return(o-=d.length)<n?Xa(e,t,za,r.placeholder,i,s,d,i,i,n-o):Tt(this&&this!==xt&&this instanceof r?a:e,this,s)}}(e,t,p):t!=s&&33!=t||h.length?za.apply(i,S):function(e,t,i,n){var a=1&t,r=ja(e);return function t(){for(var o=-1,s=arguments.length,l=-1,c=n.length,d=oe(c+s),u=this&&this!==xt&&this instanceof t?r:e;++l<c;)d[l]=n[l];for(;s--;)d[l++]=arguments[++o];return Tt(u,a?i:this,d)}}(e,t,a,u);else var b=function(e,t,i){var n=1&t,a=ja(e);return function t(){return(this&&this!==xt&&this instanceof t?a:e).apply(n?i:this,arguments)}}(e,t,a);return Ar((y?ta:Dr)(b,S),e,t)}function Qa(e,t,n,a){return e===i||zo(e,Ae[n])&&!Be.call(a,n)?t:e}function er(e,t,n,a,r,o){return ts(e)&&ts(t)&&(o.set(t,e),Vn(e,t,i,er,o),o.delete(t)),e}function tr(e){return rs(e)?i:e}function ir(e,t,n,a,r,o){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var d=o.get(e),u=o.get(t);if(d&&u)return d==t&&u==e;var h=-1,f=!0,x=2&n?new Xi:i;for(o.set(e,t),o.set(t,e);++h<l;){var p=e[h],m=t[h];if(a)var _=s?a(m,p,h,t,e,o):a(p,m,h,e,t,o);if(_!==i){if(_)continue;f=!1;break}if(x){if(!jt(t,(function(e,t){if(!ei(x,t)&&(p===e||r(p,e,n,a,o)))return x.push(t)}))){f=!1;break}}else if(p!==m&&!r(p,m,n,a,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function nr(e){return Fr(Rr(e,i,Wr),e+"")}function ar(e){return Cn(e,Fs,fr)}function rr(e){return Cn(e,As,xr)}var or=Di?function(e){return Di.get(e)}:cl;function sr(e){for(var t=e.name+"",i=ki[t],n=Be.call(ki,t)?i.length:0;n--;){var a=i[n],r=a.func;if(null==r||r==e)return a.name}return t}function lr(e){return(Be.call(Ui,"placeholder")?Ui:e).placeholder}function cr(){var e=Ui.iteratee||rl;return e=e===rl?Bn:e,arguments.length?e(arguments[0],arguments[1]):e}function dr(e,t){var i,n,a=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?a["string"==typeof t?"string":"hash"]:a.map}function ur(e){for(var t=Fs(e),i=t.length;i--;){var n=t[i],a=e[n];t[i]=[n,a,Cr(a)]}return t}function hr(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Ln(n)?n:i}var fr=gt?function(e){return null==e?[]:(e=Re(e),kt(gt(e),(function(t){return Je.call(e,t)})))}:ml,xr=gt?function(e){for(var t=[];e;)Lt(t,fr(e)),e=Ye(e);return t}:ml,pr=Tn;function mr(e,t,i){for(var n=-1,a=(t=ya(t,e)).length,r=!1;++n<a;){var o=Or(t[n]);if(!(r=null!=e&&i(e,o)))break;e=e[o]}return r||++n!=a?r:!!(a=null==e?0:e.length)&&es(a)&&vr(o,a)&&(Wo(e)||Zo(e))}function _r(e){return"function"!=typeof e.constructor||Er(e)?{}:zi(Ye(e))}function gr(e){return Wo(e)||Zo(e)||!!(Ke&&e&&e[Ke])}function vr(e,t){var i=typeof e;return!!(t=null==t?h:t)&&("number"==i||"symbol"!=i&&ve.test(e))&&e>-1&&e%1==0&&e<t}function yr(e,t,i){if(!ts(i))return!1;var n=typeof t;return!!("number"==n?Yo(i)&&vr(t,i.length):"string"==n&&t in i)&&zo(i[t],e)}function Sr(e,t){if(Wo(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!cs(e))||(te.test(e)||!ee.test(e)||null!=t&&e in Re(t))}function br(e){var t=sr(e),i=Ui[t];if("function"!=typeof i||!(t in Zi.prototype))return!1;if(e===i)return!0;var n=or(i);return!!n&&e===n[0]}(Ei&&pr(new Ei(new ArrayBuffer(1)))!=M||Ci&&pr(new Ci)!=P||Ti&&pr(Ti.resolve())!=T||Ri&&pr(new Ri)!=I||wi&&pr(new wi)!=F)&&(pr=function(e){var t=Tn(e),n=t==C?e.constructor:i,a=n?jr(n):"";if(a)switch(a){case Fi:return M;case Ai:return P;case Mi:return T;case Li:return I;case Bi:return F}return t});var Pr=Me?$o:_l;function Er(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function Cr(e){return e==e&&!ts(e)}function Tr(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==i||e in Re(n)))}}function Rr(e,t,n){return t=gi(t===i?e.length-1:t,0),function(){for(var i=arguments,a=-1,r=gi(i.length-t,0),o=oe(r);++a<r;)o[a]=i[t+a];a=-1;for(var s=oe(t+1);++a<t;)s[a]=i[a];return s[t]=n(o),Tt(e,this,s)}}function wr(e,t){return t.length<2?e:En(e,aa(t,0,-1))}function Ir(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Dr=Mr(ta),kr=ft||function(e,t){return xt.setTimeout(e,t)},Fr=Mr(ia);function Ar(e,t,i){var n=t+"";return Fr(e,function(e,t){var i=t.length;if(!i)return e;var n=i-1;return t[n]=(i>1?"& ":"")+t[n],t=t.join(i>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return wt(p,(function(i){var n="_."+i[0];t&i[1]&&!Ft(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(n),i)))}function Mr(e){var t=0,n=0;return function(){var a=yi(),r=16-(a-n);if(n=a,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Lr(e,t){var n=-1,a=e.length,r=a-1;for(t=t===i?a:t;++n<t;){var o=Jn(n,r),s=e[o];e[o]=e[n],e[n]=s}return e.length=t,e}var Br=function(e){var t=Lo(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ie,(function(e,i,n,a){t.push(n?a.replace(he,"$1"):i||e)})),t}));function Or(e){if("string"==typeof e||cs(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jr(e){if(null!=e){try{return Le.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Nr(e){if(e instanceof Zi)return e.clone();var t=new Vi(e.__wrapped__,e.__chain__);return t.__actions__=Da(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ur=Kn((function(e,t){return Xo(e)?hn(e,gn(t,1,Xo,!0)):[]})),zr=Kn((function(e,t){var n=qr(t);return Xo(n)&&(n=i),Xo(e)?hn(e,gn(t,1,Xo,!0),cr(n,2)):[]})),Hr=Kn((function(e,t){var n=qr(t);return Xo(n)&&(n=i),Xo(e)?hn(e,gn(t,1,Xo,!0),i,n):[]}));function Vr(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var a=null==i?0:ps(i);return a<0&&(a=gi(n+a,0)),zt(e,cr(t,3),a)}function Zr(e,t,n){var a=null==e?0:e.length;if(!a)return-1;var r=a-1;return n!==i&&(r=ps(n),r=n<0?gi(a+r,0):vi(r,a-1)),zt(e,cr(t,3),r,!0)}function Wr(e){return(null==e?0:e.length)?gn(e,1):[]}function Gr(e){return e&&e.length?e[0]:i}var Yr=Kn((function(e){var t=Mt(e,ga);return t.length&&t[0]===e[0]?Dn(t):[]})),Xr=Kn((function(e){var t=qr(e),n=Mt(e,ga);return t===qr(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Dn(n,cr(t,2)):[]})),Jr=Kn((function(e){var t=qr(e),n=Mt(e,ga);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Dn(n,i,t):[]}));function qr(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Kr=Kn($r);function $r(e,t){return e&&e.length&&t&&t.length?Yn(e,t):e}var Qr=nr((function(e,t){var i=null==e?0:e.length,n=sn(e,t);return Xn(e,Mt(t,(function(e){return vr(e,i)?+e:e})).sort(Ra)),n}));function eo(e){return null==e?e:Pi.call(e)}var to=Kn((function(e){return ua(gn(e,1,Xo,!0))})),io=Kn((function(e){var t=qr(e);return Xo(t)&&(t=i),ua(gn(e,1,Xo,!0),cr(t,2))})),no=Kn((function(e){var t=qr(e);return t="function"==typeof t?t:i,ua(gn(e,1,Xo,!0),i,t)}));function ao(e){if(!e||!e.length)return[];var t=0;return e=kt(e,(function(e){if(Xo(e))return t=gi(e.length,t),!0})),qt(t,(function(t){return Mt(e,Gt(t))}))}function ro(e,t){if(!e||!e.length)return[];var n=ao(e);return null==t?n:Mt(n,(function(e){return Tt(t,i,e)}))}var oo=Kn((function(e,t){return Xo(e)?hn(e,t):[]})),so=Kn((function(e){return ma(kt(e,Xo))})),lo=Kn((function(e){var t=qr(e);return Xo(t)&&(t=i),ma(kt(e,Xo),cr(t,2))})),co=Kn((function(e){var t=qr(e);return t="function"==typeof t?t:i,ma(kt(e,Xo),i,t)})),uo=Kn(ao);var ho=Kn((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,ro(e,n)}));function fo(e){var t=Ui(e);return t.__chain__=!0,t}function xo(e,t){return t(e)}var po=nr((function(e){var t=e.length,n=t?e[0]:0,a=this.__wrapped__,r=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&a instanceof Zi&&vr(n)?((a=a.slice(n,+n+(t?1:0))).__actions__.push({func:xo,args:[r],thisArg:i}),new Vi(a,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(r)}));var mo=Fa((function(e,t,i){Be.call(e,i)?++e[i]:on(e,i,1)}));var _o=Na(Vr),go=Na(Zr);function vo(e,t){return(Wo(e)?wt:fn)(e,cr(t,3))}function yo(e,t){return(Wo(e)?It:xn)(e,cr(t,3))}var So=Fa((function(e,t,i){Be.call(e,i)?e[i].push(t):on(e,i,[t])}));var bo=Kn((function(e,t,i){var n=-1,a="function"==typeof t,r=Yo(e)?oe(e.length):[];return fn(e,(function(e){r[++n]=a?Tt(t,e,i):kn(e,t,i)})),r})),Po=Fa((function(e,t,i){on(e,i,t)}));function Eo(e,t){return(Wo(e)?Mt:Un)(e,cr(t,3))}var Co=Fa((function(e,t,i){e[i?0:1].push(t)}),(function(){return[[],[]]}));var To=Kn((function(e,t){if(null==e)return[];var i=t.length;return i>1&&yr(e,t[0],t[1])?t=[]:i>2&&yr(t[0],t[1],t[2])&&(t=[t[0]]),Wn(e,gn(t,1),[])})),Ro=ht||function(){return xt.Date.now()};function wo(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,$a(e,c,i,i,i,i,t)}function Io(e,t){var a;if("function"!=typeof t)throw new De(n);return e=ps(e),function(){return--e>0&&(a=t.apply(this,arguments)),e<=1&&(t=i),a}}var Do=Kn((function(e,t,i){var n=1;if(i.length){var a=ci(i,lr(Do));n|=s}return $a(e,n,t,i,a)})),ko=Kn((function(e,t,i){var n=3;if(i.length){var a=ci(i,lr(ko));n|=s}return $a(t,n,e,i,a)}));function Fo(e,t,a){var r,o,s,l,c,d,u=0,h=!1,f=!1,x=!0;if("function"!=typeof e)throw new De(n);function p(t){var n=r,a=o;return r=o=i,u=t,l=e.apply(a,n)}function m(e){var n=e-d;return d===i||n>=t||n<0||f&&e-u>=s}function _(){var e=Ro();if(m(e))return g(e);c=kr(_,function(e){var i=t-(e-d);return f?vi(i,s-(e-u)):i}(e))}function g(e){return c=i,x&&r?p(e):(r=o=i,l)}function v(){var e=Ro(),n=m(e);if(r=arguments,o=this,d=e,n){if(c===i)return function(e){return u=e,c=kr(_,t),h?p(e):l}(d);if(f)return Pa(c),c=kr(_,t),p(d)}return c===i&&(c=kr(_,t)),l}return t=_s(t)||0,ts(a)&&(h=!!a.leading,s=(f="maxWait"in a)?gi(_s(a.maxWait)||0,t):s,x="trailing"in a?!!a.trailing:x),v.cancel=function(){c!==i&&Pa(c),u=0,r=d=o=c=i},v.flush=function(){return c===i?l:g(Ro())},v}var Ao=Kn((function(e,t){return un(e,1,t)})),Mo=Kn((function(e,t,i){return un(e,_s(t)||0,i)}));function Lo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new De(n);var i=function(){var n=arguments,a=t?t.apply(this,n):n[0],r=i.cache;if(r.has(a))return r.get(a);var o=e.apply(this,n);return i.cache=r.set(a,o)||r,o};return i.cache=new(Lo.Cache||Yi),i}function Bo(e){if("function"!=typeof e)throw new De(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Lo.Cache=Yi;var Oo=Sa((function(e,t){var i=(t=1==t.length&&Wo(t[0])?Mt(t[0],$t(cr())):Mt(gn(t,1),$t(cr()))).length;return Kn((function(n){for(var a=-1,r=vi(n.length,i);++a<r;)n[a]=t[a].call(this,n[a]);return Tt(e,this,n)}))})),jo=Kn((function(e,t){var n=ci(t,lr(jo));return $a(e,s,i,t,n)})),No=Kn((function(e,t){var n=ci(t,lr(No));return $a(e,l,i,t,n)})),Uo=nr((function(e,t){return $a(e,d,i,i,i,t)}));function zo(e,t){return e===t||e!=e&&t!=t}var Ho=Ya(Rn),Vo=Ya((function(e,t){return e>=t})),Zo=Fn(function(){return arguments}())?Fn:function(e){return is(e)&&Be.call(e,"callee")&&!Je.call(e,"callee")},Wo=oe.isArray,Go=yt?$t(yt):function(e){return is(e)&&Tn(e)==A};function Yo(e){return null!=e&&es(e.length)&&!$o(e)}function Xo(e){return is(e)&&Yo(e)}var Jo=vt||_l,qo=St?$t(St):function(e){return is(e)&&Tn(e)==v};function Ko(e){if(!is(e))return!1;var t=Tn(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function $o(e){if(!ts(e))return!1;var t=Tn(e);return t==S||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qo(e){return"number"==typeof e&&e==ps(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var ns=bt?$t(bt):function(e){return is(e)&&pr(e)==P};function as(e){return"number"==typeof e||is(e)&&Tn(e)==E}function rs(e){if(!is(e)||Tn(e)!=C)return!1;var t=Ye(e);if(null===t)return!0;var i=Be.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Le.call(i)==Ue}var os=Pt?$t(Pt):function(e){return is(e)&&Tn(e)==R};var ss=Et?$t(Et):function(e){return is(e)&&pr(e)==I};function ls(e){return"string"==typeof e||!Wo(e)&&is(e)&&Tn(e)==D}function cs(e){return"symbol"==typeof e||is(e)&&Tn(e)==k}var ds=Ct?$t(Ct):function(e){return is(e)&&es(e.length)&&!!st[Tn(e)]};var us=Ya(Nn),hs=Ya((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Yo(e))return ls(e)?fi(e):Da(e);if($e&&e[$e])return function(e){for(var t,i=[];!(t=e.next()).done;)i.push(t.value);return i}(e[$e]());var t=pr(e);return(t==P?si:t==I?di:zs)(e)}function xs(e){return e?(e=_s(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ps(e){var t=xs(e),i=t%1;return t==t?i?t-i:t:0}function ms(e){return e?ln(ps(e),0,x):0}function _s(e){if("number"==typeof e)return e;if(cs(e))return f;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var i=me.test(e);return i||ge.test(e)?ut(e.slice(2),i?2:8):pe.test(e)?f:+e}function gs(e){return ka(e,As(e))}function vs(e){return null==e?"":da(e)}var ys=Aa((function(e,t){if(Er(t)||Yo(t))ka(t,Fs(t),e);else for(var i in t)Be.call(t,i)&&tn(e,i,t[i])})),Ss=Aa((function(e,t){ka(t,As(t),e)})),bs=Aa((function(e,t,i,n){ka(t,As(t),e,n)})),Ps=Aa((function(e,t,i,n){ka(t,Fs(t),e,n)})),Es=nr(sn);var Cs=Kn((function(e,t){e=Re(e);var n=-1,a=t.length,r=a>2?t[2]:i;for(r&&yr(t[0],t[1],r)&&(a=1);++n<a;)for(var o=t[n],s=As(o),l=-1,c=s.length;++l<c;){var d=s[l],u=e[d];(u===i||zo(u,Ae[d])&&!Be.call(e,d))&&(e[d]=o[d])}return e})),Ts=Kn((function(e){return e.push(i,er),Tt(Ls,i,e)}));function Rs(e,t,n){var a=null==e?i:En(e,t);return a===i?n:a}function ws(e,t){return null!=e&&mr(e,t,In)}var Is=Ha((function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=i}),tl(al)),Ds=Ha((function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),Be.call(e,t)?e[t].push(i):e[t]=[i]}),cr),ks=Kn(kn);function Fs(e){return Yo(e)?qi(e):On(e)}function As(e){return Yo(e)?qi(e,!0):jn(e)}var Ms=Aa((function(e,t,i){Vn(e,t,i)})),Ls=Aa((function(e,t,i,n){Vn(e,t,i,n)})),Bs=nr((function(e,t){var i={};if(null==e)return i;var n=!1;t=Mt(t,(function(t){return t=ya(t,e),n||(n=t.length>1),t})),ka(e,rr(e),i),n&&(i=cn(i,7,tr));for(var a=t.length;a--;)ha(i,t[a]);return i}));var Os=nr((function(e,t){return null==e?{}:function(e,t){return Gn(e,t,(function(t,i){return ws(e,i)}))}(e,t)}));function js(e,t){if(null==e)return{};var i=Mt(rr(e),(function(e){return[e]}));return t=cr(t),Gn(e,i,(function(e,i){return t(e,i[0])}))}var Ns=Ka(Fs),Us=Ka(As);function zs(e){return null==e?[]:Qt(e,Fs(e))}var Hs=Oa((function(e,t,i){return t=t.toLowerCase(),e+(i?Vs(t):t)}));function Vs(e){return Ks(vs(e).toLowerCase())}function Zs(e){return(e=vs(e))&&e.replace(ye,ni).replace(et,"")}var Ws=Oa((function(e,t,i){return e+(i?"-":"")+t.toLowerCase()})),Gs=Oa((function(e,t,i){return e+(i?" ":"")+t.toLowerCase()})),Ys=Ba("toLowerCase");var Xs=Oa((function(e,t,i){return e+(i?"_":"")+t.toLowerCase()}));var Js=Oa((function(e,t,i){return e+(i?" ":"")+Ks(t)}));var qs=Oa((function(e,t,i){return e+(i?" ":"")+t.toUpperCase()})),Ks=Ba("toUpperCase");function $s(e,t,n){return e=vs(e),(t=n?i:t)===i?function(e){return at.test(e)}(e)?function(e){return e.match(it)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var Qs=Kn((function(e,t){try{return Tt(e,i,t)}catch(e){return Ko(e)?e:new Ee(e)}})),el=nr((function(e,t){return wt(t,(function(t){t=Or(t),on(e,t,Do(e[t],e))})),e}));function tl(e){return function(){return e}}var il=Ua(),nl=Ua(!0);function al(e){return e}function rl(e){return Bn("function"==typeof e?e:cn(e,1))}var ol=Kn((function(e,t){return function(i){return kn(i,e,t)}})),sl=Kn((function(e,t){return function(i){return kn(e,i,t)}}));function ll(e,t,i){var n=Fs(t),a=Pn(t,n);null!=i||ts(t)&&(a.length||!n.length)||(i=t,t=e,e=this,a=Pn(t,Fs(t)));var r=!(ts(i)&&"chain"in i&&!i.chain),o=$o(e);return wt(a,(function(i){var n=t[i];e[i]=n,o&&(e.prototype[i]=function(){var t=this.__chain__;if(r||t){var i=e(this.__wrapped__);return(i.__actions__=Da(this.__actions__)).push({func:n,args:arguments,thisArg:e}),i.__chain__=t,i}return n.apply(e,Lt([this.value()],arguments))})})),e}function cl(){}var dl=Za(Mt),ul=Za(Dt),hl=Za(jt);function fl(e){return Sr(e)?Gt(Or(e)):function(e){return function(t){return En(t,e)}}(e)}var xl=Ga(),pl=Ga(!0);function ml(){return[]}function _l(){return!1}var gl=Va((function(e,t){return e+t}),0),vl=Ja("ceil"),yl=Va((function(e,t){return e/t}),1),Sl=Ja("floor");var bl,Pl=Va((function(e,t){return e*t}),1),El=Ja("round"),Cl=Va((function(e,t){return e-t}),0);return Ui.after=function(e,t){if("function"!=typeof t)throw new De(n);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},Ui.ary=wo,Ui.assign=ys,Ui.assignIn=Ss,Ui.assignInWith=bs,Ui.assignWith=Ps,Ui.at=Es,Ui.before=Io,Ui.bind=Do,Ui.bindAll=el,Ui.bindKey=ko,Ui.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wo(e)?e:[e]},Ui.chain=fo,Ui.chunk=function(e,t,n){t=(n?yr(e,t,n):t===i)?1:gi(ps(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var r=0,o=0,s=oe(pt(a/t));r<a;)s[o++]=aa(e,r,r+=t);return s},Ui.compact=function(e){for(var t=-1,i=null==e?0:e.length,n=0,a=[];++t<i;){var r=e[t];r&&(a[n++]=r)}return a},Ui.concat=function(){var e=arguments.length;if(!e)return[];for(var t=oe(e-1),i=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Lt(Wo(i)?Da(i):[i],gn(t,1))},Ui.cond=function(e){var t=null==e?0:e.length,i=cr();return e=t?Mt(e,(function(e){if("function"!=typeof e[1])throw new De(n);return[i(e[0]),e[1]]})):[],Kn((function(i){for(var n=-1;++n<t;){var a=e[n];if(Tt(a[0],this,i))return Tt(a[1],this,i)}}))},Ui.conforms=function(e){return function(e){var t=Fs(e);return function(i){return dn(i,e,t)}}(cn(e,1))},Ui.constant=tl,Ui.countBy=mo,Ui.create=function(e,t){var i=zi(e);return null==t?i:rn(i,t)},Ui.curry=function e(t,n,a){var r=$a(t,8,i,i,i,i,i,n=a?i:n);return r.placeholder=e.placeholder,r},Ui.curryRight=function e(t,n,a){var r=$a(t,o,i,i,i,i,i,n=a?i:n);return r.placeholder=e.placeholder,r},Ui.debounce=Fo,Ui.defaults=Cs,Ui.defaultsDeep=Ts,Ui.defer=Ao,Ui.delay=Mo,Ui.difference=Ur,Ui.differenceBy=zr,Ui.differenceWith=Hr,Ui.drop=function(e,t,n){var a=null==e?0:e.length;return a?aa(e,(t=n||t===i?1:ps(t))<0?0:t,a):[]},Ui.dropRight=function(e,t,n){var a=null==e?0:e.length;return a?aa(e,0,(t=a-(t=n||t===i?1:ps(t)))<0?0:t):[]},Ui.dropRightWhile=function(e,t){return e&&e.length?xa(e,cr(t,3),!0,!0):[]},Ui.dropWhile=function(e,t){return e&&e.length?xa(e,cr(t,3),!0):[]},Ui.fill=function(e,t,n,a){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&yr(e,t,n)&&(n=0,a=r),function(e,t,n,a){var r=e.length;for((n=ps(n))<0&&(n=-n>r?0:r+n),(a=a===i||a>r?r:ps(a))<0&&(a+=r),a=n>a?0:ms(a);n<a;)e[n++]=t;return e}(e,t,n,a)):[]},Ui.filter=function(e,t){return(Wo(e)?kt:_n)(e,cr(t,3))},Ui.flatMap=function(e,t){return gn(Eo(e,t),1)},Ui.flatMapDeep=function(e,t){return gn(Eo(e,t),u)},Ui.flatMapDepth=function(e,t,n){return n=n===i?1:ps(n),gn(Eo(e,t),n)},Ui.flatten=Wr,Ui.flattenDeep=function(e){return(null==e?0:e.length)?gn(e,u):[]},Ui.flattenDepth=function(e,t){return(null==e?0:e.length)?gn(e,t=t===i?1:ps(t)):[]},Ui.flip=function(e){return $a(e,512)},Ui.flow=il,Ui.flowRight=nl,Ui.fromPairs=function(e){for(var t=-1,i=null==e?0:e.length,n={};++t<i;){var a=e[t];n[a[0]]=a[1]}return n},Ui.functions=function(e){return null==e?[]:Pn(e,Fs(e))},Ui.functionsIn=function(e){return null==e?[]:Pn(e,As(e))},Ui.groupBy=So,Ui.initial=function(e){return(null==e?0:e.length)?aa(e,0,-1):[]},Ui.intersection=Yr,Ui.intersectionBy=Xr,Ui.intersectionWith=Jr,Ui.invert=Is,Ui.invertBy=Ds,Ui.invokeMap=bo,Ui.iteratee=rl,Ui.keyBy=Po,Ui.keys=Fs,Ui.keysIn=As,Ui.map=Eo,Ui.mapKeys=function(e,t){var i={};return t=cr(t,3),Sn(e,(function(e,n,a){on(i,t(e,n,a),e)})),i},Ui.mapValues=function(e,t){var i={};return t=cr(t,3),Sn(e,(function(e,n,a){on(i,n,t(e,n,a))})),i},Ui.matches=function(e){return zn(cn(e,1))},Ui.matchesProperty=function(e,t){return Hn(e,cn(t,1))},Ui.memoize=Lo,Ui.merge=Ms,Ui.mergeWith=Ls,Ui.method=ol,Ui.methodOf=sl,Ui.mixin=ll,Ui.negate=Bo,Ui.nthArg=function(e){return e=ps(e),Kn((function(t){return Zn(t,e)}))},Ui.omit=Bs,Ui.omitBy=function(e,t){return js(e,Bo(cr(t)))},Ui.once=function(e){return Io(2,e)},Ui.orderBy=function(e,t,n,a){return null==e?[]:(Wo(t)||(t=null==t?[]:[t]),Wo(n=a?i:n)||(n=null==n?[]:[n]),Wn(e,t,n))},Ui.over=dl,Ui.overArgs=Oo,Ui.overEvery=ul,Ui.overSome=hl,Ui.partial=jo,Ui.partialRight=No,Ui.partition=Co,Ui.pick=Os,Ui.pickBy=js,Ui.property=fl,Ui.propertyOf=function(e){return function(t){return null==e?i:En(e,t)}},Ui.pull=Kr,Ui.pullAll=$r,Ui.pullAllBy=function(e,t,i){return e&&e.length&&t&&t.length?Yn(e,t,cr(i,2)):e},Ui.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Yn(e,t,i,n):e},Ui.pullAt=Qr,Ui.range=xl,Ui.rangeRight=pl,Ui.rearg=Uo,Ui.reject=function(e,t){return(Wo(e)?kt:_n)(e,Bo(cr(t,3)))},Ui.remove=function(e,t){var i=[];if(!e||!e.length)return i;var n=-1,a=[],r=e.length;for(t=cr(t,3);++n<r;){var o=e[n];t(o,n,e)&&(i.push(o),a.push(n))}return Xn(e,a),i},Ui.rest=function(e,t){if("function"!=typeof e)throw new De(n);return Kn(e,t=t===i?t:ps(t))},Ui.reverse=eo,Ui.sampleSize=function(e,t,n){return t=(n?yr(e,t,n):t===i)?1:ps(t),(Wo(e)?$i:Qn)(e,t)},Ui.set=function(e,t,i){return null==e?e:ea(e,t,i)},Ui.setWith=function(e,t,n,a){return a="function"==typeof a?a:i,null==e?e:ea(e,t,n,a)},Ui.shuffle=function(e){return(Wo(e)?Qi:na)(e)},Ui.slice=function(e,t,n){var a=null==e?0:e.length;return a?(n&&"number"!=typeof n&&yr(e,t,n)?(t=0,n=a):(t=null==t?0:ps(t),n=n===i?a:ps(n)),aa(e,t,n)):[]},Ui.sortBy=To,Ui.sortedUniq=function(e){return e&&e.length?la(e):[]},Ui.sortedUniqBy=function(e,t){return e&&e.length?la(e,cr(t,2)):[]},Ui.split=function(e,t,n){return n&&"number"!=typeof n&&yr(e,t,n)&&(t=n=i),(n=n===i?x:n>>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!os(t))&&!(t=da(t))&&oi(e)?ba(fi(e),0,n):e.split(t,n):[]},Ui.spread=function(e,t){if("function"!=typeof e)throw new De(n);return t=null==t?0:gi(ps(t),0),Kn((function(i){var n=i[t],a=ba(i,0,t);return n&&Lt(a,n),Tt(e,this,a)}))},Ui.tail=function(e){var t=null==e?0:e.length;return t?aa(e,1,t):[]},Ui.take=function(e,t,n){return e&&e.length?aa(e,0,(t=n||t===i?1:ps(t))<0?0:t):[]},Ui.takeRight=function(e,t,n){var a=null==e?0:e.length;return a?aa(e,(t=a-(t=n||t===i?1:ps(t)))<0?0:t,a):[]},Ui.takeRightWhile=function(e,t){return e&&e.length?xa(e,cr(t,3),!1,!0):[]},Ui.takeWhile=function(e,t){return e&&e.length?xa(e,cr(t,3)):[]},Ui.tap=function(e,t){return t(e),e},Ui.throttle=function(e,t,i){var a=!0,r=!0;if("function"!=typeof e)throw new De(n);return ts(i)&&(a="leading"in i?!!i.leading:a,r="trailing"in i?!!i.trailing:r),Fo(e,t,{leading:a,maxWait:t,trailing:r})},Ui.thru=xo,Ui.toArray=fs,Ui.toPairs=Ns,Ui.toPairsIn=Us,Ui.toPath=function(e){return Wo(e)?Mt(e,Or):cs(e)?[e]:Da(Br(vs(e)))},Ui.toPlainObject=gs,Ui.transform=function(e,t,i){var n=Wo(e),a=n||Jo(e)||ds(e);if(t=cr(t,4),null==i){var r=e&&e.constructor;i=a?n?new r:[]:ts(e)&&$o(r)?zi(Ye(e)):{}}return(a?wt:Sn)(e,(function(e,n,a){return t(i,e,n,a)})),i},Ui.unary=function(e){return wo(e,1)},Ui.union=to,Ui.unionBy=io,Ui.unionWith=no,Ui.uniq=function(e){return e&&e.length?ua(e):[]},Ui.uniqBy=function(e,t){return e&&e.length?ua(e,cr(t,2)):[]},Ui.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ua(e,i,t):[]},Ui.unset=function(e,t){return null==e||ha(e,t)},Ui.unzip=ao,Ui.unzipWith=ro,Ui.update=function(e,t,i){return null==e?e:fa(e,t,va(i))},Ui.updateWith=function(e,t,n,a){return a="function"==typeof a?a:i,null==e?e:fa(e,t,va(n),a)},Ui.values=zs,Ui.valuesIn=function(e){return null==e?[]:Qt(e,As(e))},Ui.without=oo,Ui.words=$s,Ui.wrap=function(e,t){return jo(va(t),e)},Ui.xor=so,Ui.xorBy=lo,Ui.xorWith=co,Ui.zip=uo,Ui.zipObject=function(e,t){return _a(e||[],t||[],tn)},Ui.zipObjectDeep=function(e,t){return _a(e||[],t||[],ea)},Ui.zipWith=ho,Ui.entries=Ns,Ui.entriesIn=Us,Ui.extend=Ss,Ui.extendWith=bs,ll(Ui,Ui),Ui.add=gl,Ui.attempt=Qs,Ui.camelCase=Hs,Ui.capitalize=Vs,Ui.ceil=vl,Ui.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=_s(n))==n?n:0),t!==i&&(t=(t=_s(t))==t?t:0),ln(_s(e),t,n)},Ui.clone=function(e){return cn(e,4)},Ui.cloneDeep=function(e){return cn(e,5)},Ui.cloneDeepWith=function(e,t){return cn(e,5,t="function"==typeof t?t:i)},Ui.cloneWith=function(e,t){return cn(e,4,t="function"==typeof t?t:i)},Ui.conformsTo=function(e,t){return null==t||dn(e,t,Fs(t))},Ui.deburr=Zs,Ui.defaultTo=function(e,t){return null==e||e!=e?t:e},Ui.divide=yl,Ui.endsWith=function(e,t,n){e=vs(e),t=da(t);var a=e.length,r=n=n===i?a:ln(ps(n),0,a);return(n-=t.length)>=0&&e.slice(n,r)==t},Ui.eq=zo,Ui.escape=function(e){return(e=vs(e))&&q.test(e)?e.replace(X,ai):e},Ui.escapeRegExp=function(e){return(e=vs(e))&&ae.test(e)?e.replace(ne,"\\$&"):e},Ui.every=function(e,t,n){var a=Wo(e)?Dt:pn;return n&&yr(e,t,n)&&(t=i),a(e,cr(t,3))},Ui.find=_o,Ui.findIndex=Vr,Ui.findKey=function(e,t){return Ut(e,cr(t,3),Sn)},Ui.findLast=go,Ui.findLastIndex=Zr,Ui.findLastKey=function(e,t){return Ut(e,cr(t,3),bn)},Ui.floor=Sl,Ui.forEach=vo,Ui.forEachRight=yo,Ui.forIn=function(e,t){return null==e?e:vn(e,cr(t,3),As)},Ui.forInRight=function(e,t){return null==e?e:yn(e,cr(t,3),As)},Ui.forOwn=function(e,t){return e&&Sn(e,cr(t,3))},Ui.forOwnRight=function(e,t){return e&&bn(e,cr(t,3))},Ui.get=Rs,Ui.gt=Ho,Ui.gte=Vo,Ui.has=function(e,t){return null!=e&&mr(e,t,wn)},Ui.hasIn=ws,Ui.head=Gr,Ui.identity=al,Ui.includes=function(e,t,i,n){e=Yo(e)?e:zs(e),i=i&&!n?ps(i):0;var a=e.length;return i<0&&(i=gi(a+i,0)),ls(e)?i<=a&&e.indexOf(t,i)>-1:!!a&&Ht(e,t,i)>-1},Ui.indexOf=function(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var a=null==i?0:ps(i);return a<0&&(a=gi(n+a,0)),Ht(e,t,a)},Ui.inRange=function(e,t,n){return t=xs(t),n===i?(n=t,t=0):n=xs(n),function(e,t,i){return e>=vi(t,i)&&e<gi(t,i)}(e=_s(e),t,n)},Ui.invoke=ks,Ui.isArguments=Zo,Ui.isArray=Wo,Ui.isArrayBuffer=Go,Ui.isArrayLike=Yo,Ui.isArrayLikeObject=Xo,Ui.isBoolean=function(e){return!0===e||!1===e||is(e)&&Tn(e)==g},Ui.isBuffer=Jo,Ui.isDate=qo,Ui.isElement=function(e){return is(e)&&1===e.nodeType&&!rs(e)},Ui.isEmpty=function(e){if(null==e)return!0;if(Yo(e)&&(Wo(e)||"string"==typeof e||"function"==typeof e.splice||Jo(e)||ds(e)||Zo(e)))return!e.length;var t=pr(e);if(t==P||t==I)return!e.size;if(Er(e))return!On(e).length;for(var i in e)if(Be.call(e,i))return!1;return!0},Ui.isEqual=function(e,t){return An(e,t)},Ui.isEqualWith=function(e,t,n){var a=(n="function"==typeof n?n:i)?n(e,t):i;return a===i?An(e,t,i,n):!!a},Ui.isError=Ko,Ui.isFinite=function(e){return"number"==typeof e&&Nt(e)},Ui.isFunction=$o,Ui.isInteger=Qo,Ui.isLength=es,Ui.isMap=ns,Ui.isMatch=function(e,t){return e===t||Mn(e,t,ur(t))},Ui.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Mn(e,t,ur(t),n)},Ui.isNaN=function(e){return as(e)&&e!=+e},Ui.isNative=function(e){if(Pr(e))throw new Ee("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ln(e)},Ui.isNil=function(e){return null==e},Ui.isNull=function(e){return null===e},Ui.isNumber=as,Ui.isObject=ts,Ui.isObjectLike=is,Ui.isPlainObject=rs,Ui.isRegExp=os,Ui.isSafeInteger=function(e){return Qo(e)&&e>=-9007199254740991&&e<=h},Ui.isSet=ss,Ui.isString=ls,Ui.isSymbol=cs,Ui.isTypedArray=ds,Ui.isUndefined=function(e){return e===i},Ui.isWeakMap=function(e){return is(e)&&pr(e)==F},Ui.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==Tn(e)},Ui.join=function(e,t){return null==e?"":Yt.call(e,t)},Ui.kebabCase=Ws,Ui.last=qr,Ui.lastIndexOf=function(e,t,n){var a=null==e?0:e.length;if(!a)return-1;var r=a;return n!==i&&(r=(r=ps(n))<0?gi(a+r,0):vi(r,a-1)),t==t?function(e,t,i){for(var n=i+1;n--;)if(e[n]===t)return n;return n}(e,t,r):zt(e,Zt,r,!0)},Ui.lowerCase=Gs,Ui.lowerFirst=Ys,Ui.lt=us,Ui.lte=hs,Ui.max=function(e){return e&&e.length?mn(e,al,Rn):i},Ui.maxBy=function(e,t){return e&&e.length?mn(e,cr(t,2),Rn):i},Ui.mean=function(e){return Wt(e,al)},Ui.meanBy=function(e,t){return Wt(e,cr(t,2))},Ui.min=function(e){return e&&e.length?mn(e,al,Nn):i},Ui.minBy=function(e,t){return e&&e.length?mn(e,cr(t,2),Nn):i},Ui.stubArray=ml,Ui.stubFalse=_l,Ui.stubObject=function(){return{}},Ui.stubString=function(){return""},Ui.stubTrue=function(){return!0},Ui.multiply=Pl,Ui.nth=function(e,t){return e&&e.length?Zn(e,ps(t)):i},Ui.noConflict=function(){return xt._===this&&(xt._=ze),this},Ui.noop=cl,Ui.now=Ro,Ui.pad=function(e,t,i){e=vs(e);var n=(t=ps(t))?hi(e):0;if(!t||n>=t)return e;var a=(t-n)/2;return Wa(mt(a),i)+e+Wa(pt(a),i)},Ui.padEnd=function(e,t,i){e=vs(e);var n=(t=ps(t))?hi(e):0;return t&&n<t?e+Wa(t-n,i):e},Ui.padStart=function(e,t,i){e=vs(e);var n=(t=ps(t))?hi(e):0;return t&&n<t?Wa(t-n,i)+e:e},Ui.parseInt=function(e,t,i){return i||null==t?t=0:t&&(t=+t),Si(vs(e).replace(re,""),t||0)},Ui.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yr(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=xs(e),t===i?(t=e,e=0):t=xs(t)),e>t){var a=e;e=t,t=a}if(n||e%1||t%1){var r=bi();return vi(e+r*(t-e+dt("1e-"+((r+"").length-1))),t)}return Jn(e,t)},Ui.reduce=function(e,t,i){var n=Wo(e)?Bt:Xt,a=arguments.length<3;return n(e,cr(t,4),i,a,fn)},Ui.reduceRight=function(e,t,i){var n=Wo(e)?Ot:Xt,a=arguments.length<3;return n(e,cr(t,4),i,a,xn)},Ui.repeat=function(e,t,n){return t=(n?yr(e,t,n):t===i)?1:ps(t),qn(vs(e),t)},Ui.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ui.result=function(e,t,n){var a=-1,r=(t=ya(t,e)).length;for(r||(r=1,e=i);++a<r;){var o=null==e?i:e[Or(t[a])];o===i&&(a=r,o=n),e=$o(o)?o.call(e):o}return e},Ui.round=El,Ui.runInContext=e,Ui.sample=function(e){return(Wo(e)?Ki:$n)(e)},Ui.size=function(e){if(null==e)return 0;if(Yo(e))return ls(e)?hi(e):e.length;var t=pr(e);return t==P||t==I?e.size:On(e).length},Ui.snakeCase=Xs,Ui.some=function(e,t,n){var a=Wo(e)?jt:ra;return n&&yr(e,t,n)&&(t=i),a(e,cr(t,3))},Ui.sortedIndex=function(e,t){return oa(e,t)},Ui.sortedIndexBy=function(e,t,i){return sa(e,t,cr(i,2))},Ui.sortedIndexOf=function(e,t){var i=null==e?0:e.length;if(i){var n=oa(e,t);if(n<i&&zo(e[n],t))return n}return-1},Ui.sortedLastIndex=function(e,t){return oa(e,t,!0)},Ui.sortedLastIndexBy=function(e,t,i){return sa(e,t,cr(i,2),!0)},Ui.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var i=oa(e,t,!0)-1;if(zo(e[i],t))return i}return-1},Ui.startCase=Js,Ui.startsWith=function(e,t,i){return e=vs(e),i=null==i?0:ln(ps(i),0,e.length),t=da(t),e.slice(i,i+t.length)==t},Ui.subtract=Cl,Ui.sum=function(e){return e&&e.length?Jt(e,al):0},Ui.sumBy=function(e,t){return e&&e.length?Jt(e,cr(t,2)):0},Ui.template=function(e,t,n){var a=Ui.templateSettings;n&&yr(e,t,n)&&(t=i),e=vs(e),t=bs({},t,a,Qa);var r,o,s=bs({},t.imports,a.imports,Qa),l=Fs(s),c=Qt(s,l),d=0,u=t.interpolate||Se,h="__p += '",f=we((t.escape||Se).source+"|"+u.source+"|"+(u===Q?fe:Se).source+"|"+(t.evaluate||Se).source+"|$","g"),x="//# sourceURL="+(Be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(f,(function(t,i,n,a,s,l){return n||(n=a),h+=e.slice(d,l).replace(be,ri),i&&(r=!0,h+="' +\n__e("+i+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=l+t.length,t})),h+="';\n";var p=Be.call(t,"variable")&&t.variable;if(p){if(ue.test(p))throw new Ee("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(Z,""):h).replace(W,"$1").replace(G,"$1;"),h="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Qs((function(){return Ce(l,x+"return "+h).apply(i,c)}));if(m.source=h,Ko(m))throw m;return m},Ui.times=function(e,t){if((e=ps(e))<1||e>h)return[];var i=x,n=vi(e,x);t=cr(t),e-=x;for(var a=qt(n,t);++i<e;)t(i);return a},Ui.toFinite=xs,Ui.toInteger=ps,Ui.toLength=ms,Ui.toLower=function(e){return vs(e).toLowerCase()},Ui.toNumber=_s,Ui.toSafeInteger=function(e){return e?ln(ps(e),-9007199254740991,h):0===e?e:0},Ui.toString=vs,Ui.toUpper=function(e){return vs(e).toUpperCase()},Ui.trim=function(e,t,n){if((e=vs(e))&&(n||t===i))return Kt(e);if(!e||!(t=da(t)))return e;var a=fi(e),r=fi(t);return ba(a,ti(a,r),ii(a,r)+1).join("")},Ui.trimEnd=function(e,t,n){if((e=vs(e))&&(n||t===i))return e.slice(0,xi(e)+1);if(!e||!(t=da(t)))return e;var a=fi(e);return ba(a,0,ii(a,fi(t))+1).join("")},Ui.trimStart=function(e,t,n){if((e=vs(e))&&(n||t===i))return e.replace(re,"");if(!e||!(t=da(t)))return e;var a=fi(e);return ba(a,ti(a,fi(t))).join("")},Ui.truncate=function(e,t){var n=30,a="...";if(ts(t)){var r="separator"in t?t.separator:r;n="length"in t?ps(t.length):n,a="omission"in t?da(t.omission):a}var o=(e=vs(e)).length;if(oi(e)){var s=fi(e);o=s.length}if(n>=o)return e;var l=n-hi(a);if(l<1)return a;var c=s?ba(s,0,l).join(""):e.slice(0,l);if(r===i)return c+a;if(s&&(l+=c.length-l),os(r)){if(e.slice(l).search(r)){var d,u=c;for(r.global||(r=we(r.source,vs(xe.exec(r))+"g")),r.lastIndex=0;d=r.exec(u);)var h=d.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(da(r),l)!=l){var f=c.lastIndexOf(r);f>-1&&(c=c.slice(0,f))}return c+a},Ui.unescape=function(e){return(e=vs(e))&&J.test(e)?e.replace(Y,pi):e},Ui.uniqueId=function(e){var t=++Oe;return vs(e)+t},Ui.upperCase=qs,Ui.upperFirst=Ks,Ui.each=vo,Ui.eachRight=yo,Ui.first=Gr,ll(Ui,(bl={},Sn(Ui,(function(e,t){Be.call(Ui.prototype,t)||(bl[t]=e)})),bl),{chain:!1}),Ui.VERSION="4.17.21",wt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Ui[e].placeholder=Ui})),wt(["drop","take"],(function(e,t){Zi.prototype[e]=function(n){n=n===i?1:gi(ps(n),0);var a=this.__filtered__&&!t?new Zi(this):this.clone();return a.__filtered__?a.__takeCount__=vi(n,a.__takeCount__):a.__views__.push({size:vi(n,x),type:e+(a.__dir__<0?"Right":"")}),a},Zi.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),wt(["filter","map","takeWhile"],(function(e,t){var i=t+1,n=1==i||3==i;Zi.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:cr(e,3),type:i}),t.__filtered__=t.__filtered__||n,t}})),wt(["head","last"],(function(e,t){var i="take"+(t?"Right":"");Zi.prototype[e]=function(){return this[i](1).value()[0]}})),wt(["initial","tail"],(function(e,t){var i="drop"+(t?"":"Right");Zi.prototype[e]=function(){return this.__filtered__?new Zi(this):this[i](1)}})),Zi.prototype.compact=function(){return this.filter(al)},Zi.prototype.find=function(e){return this.filter(e).head()},Zi.prototype.findLast=function(e){return this.reverse().find(e)},Zi.prototype.invokeMap=Kn((function(e,t){return"function"==typeof e?new Zi(this):this.map((function(i){return kn(i,e,t)}))})),Zi.prototype.reject=function(e){return this.filter(Bo(cr(e)))},Zi.prototype.slice=function(e,t){e=ps(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Zi(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=ps(t))<0?n.dropRight(-t):n.take(t-e)),n)},Zi.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Zi.prototype.toArray=function(){return this.take(x)},Sn(Zi.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),r=Ui[a?"take"+("last"==t?"Right":""):t],o=a||/^find/.test(t);r&&(Ui.prototype[t]=function(){var t=this.__wrapped__,s=a?[1]:arguments,l=t instanceof Zi,c=s[0],d=l||Wo(t),u=function(e){var t=r.apply(Ui,Lt([e],s));return a&&h?t[0]:t};d&&n&&"function"==typeof c&&1!=c.length&&(l=d=!1);var h=this.__chain__,f=!!this.__actions__.length,x=o&&!h,p=l&&!f;if(!o&&d){t=p?t:new Zi(this);var m=e.apply(t,s);return m.__actions__.push({func:xo,args:[u],thisArg:i}),new Vi(m,h)}return x&&p?e.apply(this,s):(m=this.thru(u),x?a?m.value()[0]:m.value():m)})})),wt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ke[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Ui.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var a=this.value();return t.apply(Wo(a)?a:[],e)}return this[i]((function(i){return t.apply(Wo(i)?i:[],e)}))}})),Sn(Zi.prototype,(function(e,t){var i=Ui[t];if(i){var n=i.name+"";Be.call(ki,n)||(ki[n]=[]),ki[n].push({name:t,func:i})}})),ki[za(i,2).name]=[{name:"wrapper",func:i}],Zi.prototype.clone=function(){var e=new Zi(this.__wrapped__);return e.__actions__=Da(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Da(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Da(this.__views__),e},Zi.prototype.reverse=function(){if(this.__filtered__){var e=new Zi(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Zi.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,i=Wo(e),n=t<0,a=i?e.length:0,r=function(e,t,i){var n=-1,a=i.length;for(;++n<a;){var r=i[n],o=r.size;switch(r.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=vi(t,e+o);break;case"takeRight":e=gi(e,t-o)}}return{start:e,end:t}}(0,a,this.__views__),o=r.start,s=r.end,l=s-o,c=n?s:o-1,d=this.__iteratees__,u=d.length,h=0,f=vi(l,this.__takeCount__);if(!i||!n&&a==l&&f==l)return pa(e,this.__actions__);var x=[];e:for(;l--&&h<f;){for(var p=-1,m=e[c+=t];++p<u;){var _=d[p],g=_.iteratee,v=_.type,y=g(m);if(2==v)m=y;else if(!y){if(1==v)continue e;break e}}x[h++]=m}return x},Ui.prototype.at=po,Ui.prototype.chain=function(){return fo(this)},Ui.prototype.commit=function(){return new Vi(this.value(),this.__chain__)},Ui.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Ui.prototype.plant=function(e){for(var t,n=this;n instanceof Hi;){var a=Nr(n);a.__index__=0,a.__values__=i,t?r.__wrapped__=a:t=a;var r=a;n=n.__wrapped__}return r.__wrapped__=e,t},Ui.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Zi){var t=e;return this.__actions__.length&&(t=new Zi(this)),(t=t.reverse()).__actions__.push({func:xo,args:[eo],thisArg:i}),new Vi(t,this.__chain__)}return this.thru(eo)},Ui.prototype.toJSON=Ui.prototype.valueOf=Ui.prototype.value=function(){return pa(this.__wrapped__,this.__actions__)},Ui.prototype.first=Ui.prototype.head,$e&&(Ui.prototype[$e]=function(){return this}),Ui}();mt?((mt.exports=mi)._=mi,pt._=mi):xt._=mi}).call(w)}(D,D.exports);var k=I(D.exports),F=function(){function e(t,i){r(this,e),this.id=i,this.jSPlugin=t,this.state={play:!1,loading:!1,text:""},this.loadingSetText=this.loadingSetText}return s(e,[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"setPlayStatus",value:function(e){this.state=Object.assign(this.state,e)}},{key:"loadingStart",value:function(e){var t=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(t),t.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;}";var i=e,n=document.getElementById(i),a=n.offsetWidth,r=n.offsetHeight,o=n.offsetLeft;this.jSPlugin.isInspect&&"map"==this.jSPlugin.Theme.inspectMode&&(o=0),document.getElementById("".concat(e,"-loading-id-0"))&&document.getElementById("".concat(e,"-loading-id-0")).parentNode.removeChild(document.getElementById("".concat(e,"-loading-id-0"))),console.log("loading-id-0---------------");var s=document.createElement("div");s.setAttribute("id","".concat(e,"-loading-id-0"));var l="position:absolute;outline:none;pointer-events:none;";console.log("this.jSPlugin",this.jSPlugin),l+="width: 100%;background-size: cover; background-repeat:no-repeat;",l+="height: 100%;",l+="top:0;",l+="left:"+o+"px;",s.setAttribute("style",l),s.style.height=r,s.setAttribute("class","loading-container"),n.style.position="relative",this.jSPlugin.isInspect&&"map"==this.jSPlugin.Theme.inspectMode&&(n.style.position="absolute"),n.appendChild(s);var c=document.createElement("div"),d=document.createElement("div");c.setAttribute("class","loading-item"),c.setAttribute("id","".concat(e,"-loading-item-0"));l="display:inline-flex;pointer-events:none;flex-direction:column;justify-content:center;align-items: center;width:100%;height:"+r+"px;outline:none;vertical-align: top;position:absolute;";function u(e,t,i,n){return{top:parseInt(n/i,10)*(e/i),left:n%i*(t/i)}}l+="left:"+u(r,a,1,0).left+"px;",l+="top:"+u(r,a,1,0).top+"px;",c.setAttribute("style",l);var h=1,f=document.createElement("div");d.innerHTML="",d.style.color="#fff",f.setAttribute("class","loading"),f.setAttribute("id","loading-icon");var x='<svg t="1567069979438" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399" width="24" height="24"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#ffffff" p-id="2400"></path></svg>';!this.jSPlugin.isMobile&&this.jSPlugin.isCall&&(h=this.jSPlugin.width/1024,x='<svg t="1567069979438" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399" width="'.concat(40*h,'" height="').concat(40*h,'"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#ffffff" p-id="2400"></path></svg>')),f.innerHTML=x,c.appendChild(f),c.appendChild(d),s.appendChild(c)}},{key:"loadingStop",value:function(e){var t=document.getElementById("".concat(e,"-loading-item-0"));t&&document.getElementById("loading-icon")&&t.removeChild(document.getElementById("loading-icon"))}},{key:"loadingSetText",value:function(e){var t=this;if(this.loadingClearText(),document.getElementById("".concat(this.id,"-loading-item-0"))){var i=document.getElementById("".concat(this.id,"-loading-item-0")),n=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes[1];if(n||(i.style.height="100%",(n=document.createElement("div")).innerHTML=e.text,i.appendChild(n)),n.id="".concat(this.id,"-loading-item-txt"),n.innerHTML=e.text,n.style.fontSize="14px",!this.jSPlugin.isMobile&&this.jSPlugin.isCall){var a=this.jSPlugin.width/1024;n.style.fontSize="".concat(28*a,"px"),n.style.marginTop="16px"}if(this.jSPlugin.isCall&&1==e.type){var r=document.getElementById("".concat(this.id,"-loading-item-txt")),o=document.createElement("div");o.style="margin-bottom: 8px;width:24px;height:24px;",o.innerHTML='<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n            <title></title>\n            <g id="gantan" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                <g id="Group">\n                    <polygon id="Path" points="0 0 24.0000001 0 24.0000001 24.0000001 0 24.0000001"></polygon>\n                    <path d="M12,2.25000001 C17.2781739,2.25000001 21.5934661,6.44926243 21.746085,11.7237735 L21.746085,11.7237735 L21.75,12 C21.75,17.2781739 17.5507376,21.5934661 12.2762266,21.746085 L12.2762266,21.746085 L12,21.75 C6.72182614,21.75 2.40653397,17.5507376 2.25391507,12.2762266 L2.25391507,12.2762266 L2.25000001,12 C2.25000001,6.72182617 6.44926245,2.40653397 11.7237735,2.25391507 L11.7237735,2.25391507 Z M12,3.75000001 L11.7563186,3.75352261 C7.3032926,3.88243816 3.74992165,7.53391173 3.74992165,11.9891583 L3.74992165,11.9891583 L3.75352261,12.2436814 C3.88243816,16.6967075 7.5339117,20.2500784 11.9891583,20.2500784 L11.9891583,20.2500784 L12.2436814,20.2464774 C16.6967075,20.1175619 20.2500784,16.4660884 20.2500784,12.0108417 L20.2500784,12.0108417 L20.2464774,11.7563186 C20.1175619,7.30329258 16.4660883,3.75000001 12,3.75000001 L12,3.75000001 Z M11.999,15.2500001 L12.1156933,15.25672 C12.6133664,15.3144204 12.999993,15.7366564 12.999993,16.2500001 C12.999993,16.8022157 12.5522116,17.2500001 11.999993,17.2500001 C11.4477844,17.2500001 10.999993,16.8022116 11.0000197,16.2554347 C10.9962666,15.7375014 11.3873731,15.3105316 11.8897485,15.2559043 L11.999,15.2500001 Z M12,6.75000003 C12.3796958,6.75000003 12.693491,7.03215391 12.7431534,7.39822947 L12.75,7.50000003 L12.75,12.5 C12.75,12.9142136 12.4142136,13.25 12,13.25 C11.6203043,13.25 11.3065091,12.9678461 11.2568467,12.6017706 L11.25,12.5 L11.25,7.50000003 C11.25,7.08578647 11.5857865,6.75000003 12,6.75000003 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                </g>\n            </g>\n        </svg>',i.insertBefore(o,r)}if(n.style.color=e.color||"#FFFFFF",this.state.text=e.text,e.delayClear)var s=setTimeout((function(){t.loadingClearText(),clearTimeout(s)}),parseInt(e.delayClear))}}},{key:"loadingSetTextWithBtn",value:function(e){var t=this;this.loadingClear(),console.log(this.jSPlugin);var i=!!this.jSPlugin.Theme.call&&this.jSPlugin.Theme.call.themeData||null;(i&&(0===i.customConfig.bellPoster||"onCall"===this.jSPlugin.Theme.call.bellStatus)||e.mask)&&document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background=e.maskStyle||"rgba(0,0,0,0.7)");var n=document.getElementById("".concat(this.id,"-loading-item-0"));if(n){n.style.height="100%",n.style["pointer-events"]="auto";var a=document.createElement("div");if(a.id="".concat(this.id,"-loading-item-txt"),a.innerHTML=e.text,a.title=e.text,a.style.color=e.color||"#FFFFFF",e.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),e.type&&2==e.type){var s=8,l=24;if(e.isMobile){l=24*(this.jSPlugin.width/375)}else{var c=this.jSPlugin.width/1024;s=c<1?16*c:16,l=40*c}var d=document.getElementById("".concat(this.id,"-loading-item-txt"));(f=document.createElement("div")).style="margin-bottom: ".concat(s,"px;width:").concat(l,"px;height:").concat(l,"px;"),f.innerHTML='<svg width="'.concat(l,'px" height="').concat(l,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n            <title></title>\n            <g id="gantan" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                <g id="Group">\n                    <polygon id="Path" points="0 0 24.0000001 0 24.0000001 24.0000001 0 24.0000001"></polygon>\n                    <path d="M12,2.25000001 C17.2781739,2.25000001 21.5934661,6.44926243 21.746085,11.7237735 L21.746085,11.7237735 L21.75,12 C21.75,17.2781739 17.5507376,21.5934661 12.2762266,21.746085 L12.2762266,21.746085 L12,21.75 C6.72182614,21.75 2.40653397,17.5507376 2.25391507,12.2762266 L2.25391507,12.2762266 L2.25000001,12 C2.25000001,6.72182617 6.44926245,2.40653397 11.7237735,2.25391507 L11.7237735,2.25391507 Z M12,3.75000001 L11.7563186,3.75352261 C7.3032926,3.88243816 3.74992165,7.53391173 3.74992165,11.9891583 L3.74992165,11.9891583 L3.75352261,12.2436814 C3.88243816,16.6967075 7.5339117,20.2500784 11.9891583,20.2500784 L11.9891583,20.2500784 L12.2436814,20.2464774 C16.6967075,20.1175619 20.2500784,16.4660884 20.2500784,12.0108417 L20.2500784,12.0108417 L20.2464774,11.7563186 C20.1175619,7.30329258 16.4660883,3.75000001 12,3.75000001 L12,3.75000001 Z M11.999,15.2500001 L12.1156933,15.25672 C12.6133664,15.3144204 12.999993,15.7366564 12.999993,16.2500001 C12.999993,16.8022157 12.5522116,17.2500001 11.999993,17.2500001 C11.4477844,17.2500001 10.999993,16.8022116 11.0000197,16.2554347 C10.9962666,15.7375014 11.3873731,15.3105316 11.8897485,15.2559043 L11.999,15.2500001 Z M12,6.75000003 C12.3796958,6.75000003 12.693491,7.03215391 12.7431534,7.39822947 L12.75,7.50000003 L12.75,12.5 C12.75,12.9142136 12.4142136,13.25 12,13.25 C11.6203043,13.25 11.3065091,12.9678461 11.2568467,12.6017706 L11.25,12.5 L11.25,7.50000003 C11.25,7.08578647 11.5857865,6.75000003 12,6.75000003 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                </g>\n            </g>\n        </svg>'),n.insertBefore(f,d)}else{var u=document.createElement("div");if(u.id="".concat(this.id,"-loading-item-btn-wrap"),u.innerHTML='\n          <div id="'.concat(this.id,'-loading-item-btn" style="display: ').concat(this.jSPlugin.isInspect&&"map"==this.jSPlugin.Theme.inspectMode?"none":"block",' ">').concat(e.btnName,'</div>\n          <svg id="').concat(this.id,'-loading-item-btn-svg" style="display: ').concat(this.jSPlugin.isInspect&&"map"==this.jSPlugin.Theme.inspectMode?"block":"none",' ; margin: 0 auto" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="13" height="13" xmlns:xlink="http://www.w3.org/1999/xlink">\n            <path fill="#fff" d="M960 416V192l-73.056 73.056a447.712 447.712 0 0 0-373.6-201.088C265.92 63.968 65.312 264.544 65.312 512S265.92 960.032 513.344 960.032a448.064 448.064 0 0 0 415.232-279.488 38.368 38.368 0 1 0-71.136-28.896 371.36 371.36 0 0 1-344.096 231.584C308.32 883.232 142.112 717.024 142.112 512S308.32 140.768 513.344 140.768c132.448 0 251.936 70.08 318.016 179.84L736 416h224z"></path>\n          </svg>\n        '),e.isMobile)1==e.type?u.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;":u.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 h=this.jSPlugin.width/1024;u.style="color:#648FFC;margin-top:16px;cursor: pointer;font-size:".concat(24*h,"px;"),this.jSPlugin.isInspect&&"video"==this.jSPlugin.Theme.inspectMode&&(u.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(u),e.isMobile&&1==e.type){var f,x=document.getElementById("".concat(this.id,"-loading-item-txt"));(f=document.createElement("div")).style="margin-bottom: 8px;width:24px;height:24px;",f.innerHTML='<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n              <title></title>\n              <g id="gantan" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                  <g id="Group">\n                      <polygon id="Path" points="0 0 24.0000001 0 24.0000001 24.0000001 0 24.0000001"></polygon>\n                      <path d="M12,2.25000001 C17.2781739,2.25000001 21.5934661,6.44926243 21.746085,11.7237735 L21.746085,11.7237735 L21.75,12 C21.75,17.2781739 17.5507376,21.5934661 12.2762266,21.746085 L12.2762266,21.746085 L12,21.75 C6.72182614,21.75 2.40653397,17.5507376 2.25391507,12.2762266 L2.25391507,12.2762266 L2.25000001,12 C2.25000001,6.72182617 6.44926245,2.40653397 11.7237735,2.25391507 L11.7237735,2.25391507 Z M12,3.75000001 L11.7563186,3.75352261 C7.3032926,3.88243816 3.74992165,7.53391173 3.74992165,11.9891583 L3.74992165,11.9891583 L3.75352261,12.2436814 C3.88243816,16.6967075 7.5339117,20.2500784 11.9891583,20.2500784 L11.9891583,20.2500784 L12.2436814,20.2464774 C16.6967075,20.1175619 20.2500784,16.4660884 20.2500784,12.0108417 L20.2500784,12.0108417 L20.2464774,11.7563186 C20.1175619,7.30329258 16.4660883,3.75000001 12,3.75000001 L12,3.75000001 Z M11.999,15.2500001 L12.1156933,15.25672 C12.6133664,15.3144204 12.999993,15.7366564 12.999993,16.2500001 C12.999993,16.8022157 12.5522116,17.2500001 11.999993,17.2500001 C11.4477844,17.2500001 10.999993,16.8022116 11.0000197,16.2554347 C10.9962666,15.7375014 11.3873731,15.3105316 11.8897485,15.2559043 L11.999,15.2500001 Z M12,6.75000003 C12.3796958,6.75000003 12.693491,7.03215391 12.7431534,7.39822947 L12.75,7.50000003 L12.75,12.5 C12.75,12.9142136 12.4142136,13.25 12,13.25 C11.6203043,13.25 11.3065091,12.9678461 11.2568467,12.6017706 L11.25,12.5 L11.25,7.50000003 C11.25,7.08578647 11.5857865,6.75000003 12,6.75000003 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                  </g>\n              </g>\n          </svg>',n.insertBefore(f,x)}document.getElementById("".concat(this.id,"-loading-item-btn-wrap"))&&(document.getElementById("".concat(this.id,"-loading-item-btn-wrap")).onclick=function(){t.jSPlugin.play(),t.loadingClear(),t.loadingStart(t.id),t.loadingSetText({text:"视频加载中"})})}this.state.text=e.text,e.delayClear&&setTimeout((function(){t.loadingClearText()}),parseInt(e.delayClear))}}},{key:"loadingClearText",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){var e=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes;e.length>1?e[1].parentNode.removeChild(e[1]):e[0]&&e[0].parentNode.removeChild(e[0])}}},{key:"loadingClear",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){for(var e=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes,t=e.length-1;t>=0;t--)e[t].parentNode.removeChild(e[t]);document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background="none"),document.getElementById("loading-icon")&&document.getElementById("loading-icon").parentNode.removeChild(document.getElementById("loading-icon"))}}},{key:"loadingEnd",value:function(){var e=document.getElementById("".concat(this.id,"-loading-item-0"));if(e){e.parentNode.removeChild(e);var t=document.getElementById("".concat(this.id,"-loading-id-0"));t&&0===t.children.length&&t.parentNode.removeChild(t)}document.getElementById("".concat(this.id,"-loading-item-0")).style.background="none"}}]),e}(),A=function(){function e(t,i){r(this,e),this.id=i,this.jSPlugin=t,this.timer=null,this.state={play:!1,loading:!1}}return s(e,[{key:"default",value:function(e,t){var i=this,n="msgId",a=t||document.getElementById("".concat(this.id,"-wrap"));document.getElementById("".concat(this.id,"-").concat(n))&&a.removeChild(document.getElementById("".concat(this.id,"-").concat(n)));var r=document.createElement("div");r.id="".concat(this.id,"-").concat(n),r.style="position: absolute;top: 50%;left:calc(50% - ".concat(14*e.length/2,"px);padding: 4px 16px;background: #00000080;color: #FFFFFF;font-size: 14px"),r.innerHTML=e,a.appendChild(r),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){var e=document.getElementById("".concat(i.id,"-").concat(n));a&&e&&a.removeChild(e)}),2e3)}}]),e}(),M={stream:{1001:"vtm地址或端口非法",1002:"vtm生成文件描述符失败",1003:"vtm设置文件描述符非阻塞失败",1004:"vtm设置文件描述符阻塞失败",1005:"vtm解析服务器ip失败",1006:"vtm描述符select失败",1007:"vtm文件描述符不在可读中",1008:"vtm网络发生错误getsockopt",1009:"vtm描述符select超时",1101:"proxy地址或端口非法",1102:"proxy生成文件描述符失败",1103:"proxy设置文件描述符非阻塞失败",1104:"proxy设置文件描述符阻塞失败",1105:"proxy解析服务器ip失败",1106:"proxy描述符select失败",1107:"proxy文件描述符不在可读中",1108:"proxy网络发生错误getsockopt",1109:"proxy描述符select超时",1201:"vtdu地址或端口非法",1202:"vtdu生成文件描述符失败",1203:"vtdu设置文件描述符非阻塞失败",1204:"vtdu设置文件描述符阻塞失败",1205:"vtdu解析服务器ip失败",1206:"vtdu描述符select失败",1207:"vtdu文件描述符不在可读中",1208:"vtdu网络发生错误getsockopt",1209:"vtdu描述符select超时",5e3:"cas回复信令,发现内存已经释放(和设备之间异常断开)",5400:"私有化协议vtm检测私有化协议中码流类型小于0或者设备序列号为空等非法参数场景返回(app不重试取流)",5402:"回放找不到录像文件",5403:"操作码或信令密钥与设备不匹配",5404:"设备不在线",5405:"流媒体向设备发送或接受信令超时/cas响应超时",5406:"token失效",5407:"客户端的URL格式错误",5409:"预览开启隐私保护",5410:"设备达到最大连接数",5411:"token无权限",5412:"session不存在",5413:"验证token异常",5415:"设备通道错",5416:"设备资源受限",5451:"设备不支持的码流类型",5452:"设备链接流媒体服务器失败",5454:"流媒体中关于设备取流会话不存在",5455:"设备通道未关联",5456:"设备通道关联设备不在线",5457:"客户端不支持端到端加密",5458:"设备不支持当前并发ECDH密",5459:"VTDU 处理ECDH 加密失败",5460:"流媒体中关于设备取流会话不存在",5492:"设备不支持的命令",5500:"服务器处理失败",5501:"流媒体vtdu达到最大负载,请扩容",5503:"vtm返回分配vtdu失败",5504:"流媒体vtdu达到最大负载",5505:"vtm ecdh解密失败",5506:"vtm 返回IPC不支持取流",5530:"机房故障不可用",5544:"设备返回无视频源",5545:"视频分享时间已经结束",5546:"vtdu返回达到取流并发路数限制",5547:"vtdu返回开放平台用户并发限制",5556:"ticket校验失败",5557:"回放服务器等待流头超时",5558:"查找录像开始时间错误",5560:"群组分享取流二次验证失败",5561:"分享群组用户被锁住",5562:"群组分享用户权限变更",5563:"认证服务连接失败",5564:"认证超时",5566:"不在分享时间内预览",5567:"分享通道被锁定",5568:"未找到认证类型",5569:"认证返回的参数异常",5600:"分享设备不在分享时间内",5601:"群组分享用户没权限",5602:"群组分享权限变更",5610:"接收流头失败",5620:"心跳超时",5701:"cas信令返回格式错误",5702:"SPGW请求Cas、Status透传超时",5703:"SPGW请求http不通",6001:"客户端参数出错",6099:"客户端默认错误",6101:"不支持的命令",6102:"设备流头发送失败",6103:"cas/设备返回错误1",6104:"cas/设备返回错误-1",6105:"设备返回错误码3",6106:"设备返回错误码4",6107:"设备返回错误码5",6108:"cas信令回应重复",6109:"视频广场取消分享",6110:"设备信令默认错误",6501:"设备数据链路和实际链路不匹配",6502:"设备数据链路重复建立连接",6503:"设备数据链路端口不匹配",6504:"缓存设备数据链路失败(内存块不足)",6505:"设备发送确认头消息重复",6506:"设备数据先于确定头部到达",6508:"设备数据头部长度非法",6509:"索引找不到设备数据管理块",6510:"设备数据链路vtdu内存块协议状态不匹配",6511:"设备数据头部没有streamkey错误",6512:"设备数据头部非法",6513:"设备数据长度过小",6514:"设备老协议推流头部没有streamkey错误",6515:"设备老协议推流数据非法",6516:"设备老协议索引找不到内存管理块",6517:"设备老协议推流数据非法",6518:"设备数据包过大",6519:"设备推流链路网络不稳定",6520:"设备推流链路网络不稳定",6700:"异常数据",6701:"回放结束",7001:"与相应服务连接失败",7002:"与相应服务连接失败",7003:"与相应服务连接失败",7004:"与相应服务连接失败",7005:"VTDU连接失败,或VTDU侧断开连接",7006:"vtm断开连接",7007:"客户端发送缓冲区满(上行带宽太小)",9e3:"无效包,包过大",9001:"地址不合法",9002:"缺少端口",9048:"免费版并发数达到上限,请升级企业版使用多并发能力","0001":"通用错误返回","0002":"入参为空指针","0003":"入参值无效","0004":"信令消息解析非法","0005":"内存资源不足","0006":"协议格式不对或者消息体长度超过STREAM_MAX_MSGBODY_LEN","0007":"设备序列号长度不合法","0008":"取流url长度不合法","0009":"解析vtm返回vtdu地址不合法","0010":"解析vtm返回级联vtdu地址不合法","0011":"解析vtm返回会话标识长度不合法","0012":"vtdu返回流头长度不合法","0013":"vtdu会话长度非法","0014":"回调函数未注册","0015":"vtdu成功响应未携带会话标识","0016":"vtdu成功响应未携带流头","0017":"无数据流,尚未使用","0018":"信令消息体PB解析失败","0019":"信令消息体PB封装失败","0020":"申请系统内存资源失败","0021":"vtdu地址尚未获取到","0022":"客户端尚未支持","0023":"获取系统socket资源失败","0024":"上层填充的StreamSsnId不匹配","0025":"链接服务器失败","0026":"客户端请求未收到服务端应答","0027":"链路断开","0028":"没有取流链接","0029":"流成功停止","0030":"客户端防串流校验失败","0031":"应用层tcp粘包处理缓冲区满","0032":"无效状态迁移","0033":"无效客户端状态","0034":"向vtm取流流媒体信息请求超时","0035":"向代理取流请求超时","0036":"向代理保活取流请求超时","0037":"向vtdu取流请求超时","0038":"向vtdu保活取流请求超时"},server:{ptz:{start:{200:"",10001:"操作失败",10002:"账号异常,操作失败",10005:"账号异常,操作失败",20002:"设备不存在,请检查设备连接情况",20006:"操作失败,请检查设备网络情况",20007:"操作失败,请检查设备在线情况",20008:"操作过于频繁,稍后再试",20014:"操作失败",20032:"通道不存在请检查设备连接情况",49999:"操作失败,请重试",6e4:"操作失败,设备不支持该操作",60001:"操作失败,用户无权限",60002:"设备已旋转到上限位",60003:"设备已旋转到下限位",60004:"设备已旋转到左限位",60005:"设备已旋转到右限位",60006:"操作失败,请重试",60009:"设备正在操作中",60020:"操作失败"},stop:{200:"",10001:"操作失败",10002:"账号异常,操作失败",10005:"账号异常,操作失败",20002:"设备不存在,请检查设备连接情况",20006:"操作失败,请检查设备网络情况",20007:"操作失败,请检查设备在线情况",20008:"操作过于频繁,稍后再试",20014:"操作失败",20032:"通道不存在请检查设备连接情况",49999:"操作失败,请重试",6e4:"操作失败,设备不支持该操作",60001:"操作失败,用户无权限",60006:"操作失败,请重试",60009:"设备正在操作中",60020:"操作失败"}},talk:{200:"",10001:"播放失败",10002:"账号异常,操作失败",10031:"账号异常,操作失败",20002:"设备不存在请检查设备连接情况",60059:"播放失败"},time:{200:"",10001:"播放失败",10002:"账号异常,播放失败",10004:"账号异常,播放失败",10005:"账号异常,播放失败",10011:"播放失败",10013:"账号异常,播放失败",10030:"播放失败",20002:"设备不存在请检查设备连接情况",20014:"播放失败",20032:"设备不存在请检查设备连接情况",49999:"播放失败请重试",60024:"播放失败请重试"}},client:{default:{BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍后",TIMEFORMAT_ERROR:"时间格式有误,请确认"},init:{USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功"},play:{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:"倍速播放",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:{CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn"},cloudRecord:{NO_CLOUD_RECORD:"该设备在当天没有云录制的录像"},videoLevel:{CHANGE_VIDEO_LEVEL:"切换清晰度",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度"},theme:{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:{CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败"},record:{START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败"},sound:{OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音"},zoom:{ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大","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:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏"},destroy:{DESTROY:"销毁"},capacity:{GET_CAPACITY:"获取设备能力级",GET_CAPACITY_FAILED:"获取设备能力级失败"},ptz:{GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台"},mirror:{MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误"},FEC:{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矫正视角参数"},watermark:{SET_WATERMARK:"设置水印"}}},L={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"}]},B={color:"blue",backgroundColor:"blue",activeColor:"blue",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-footer-0",iconId:"play",part:"left",defaultActive:0,isrender:0,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},O=function e(t){this.jsPlugin=t;var i={isMouseDown:!1,isOver:!1,mousePosition:null,oldTime:null,nowTime:t.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},n=this;Object.keys(i).forEach((function(e){n[e]=i[e]})),this.options={width:this.canvasWidth,height:48,time:(new Date).getTime(),timeSection:[],timeWidth:0},e.prototype.subTime=function(e){return e<10?"0"+e:e},e.prototype.tranTime=function(e){var t=e;if(e){var i=new Date(e);t=i.getFullYear()+"/"+(i.getMonth()+1)+"/"+i.getDate()+" "+this.subTime(i.getHours())+":"+this.subTime(i.getMinutes())+":"+this.subTime(i.getSeconds())}return t},e.prototype.init=function(e){var t=this.options;return new Promise((function(i,a){e.width&&document.getElementById(e.id).setAttribute("width",parseInt(e.width,10)+"px"),n.randomNum=(Math.random()+"").split(".").join(""),n.timeWidthTblIndex=t.timeWidth;var r=document.getElementById("".concat(n.jsPlugin.id,"-canvas"));n.drawPen=r.getContext("2d"),n.nowTime=e.nowTime,n.timeSection=t.timeSection||[],n.canvasWidth=r.offsetWidth,n.canvasHeight=r.offsetHeight,n.updata(),document.getElementById("".concat(n.jsPlugin.id,"-canvas")).addEventListener("mousemove",(function(e){n.options.readOnly||n.mousemove(e)})),document.getElementById("".concat(n.jsPlugin.id,"-canvas")).addEventListener("mouseover",(function(e){n.options.readOnly||n.mouseover(e)})),document.getElementById("".concat(n.jsPlugin.id,"-canvas")).addEventListener("mouseleave",(function(e){n.options.readOnly||n.mouseleave(e)})),document.getElementById("".concat(n.jsPlugin.id,"-canvas")).addEventListener("mousedown",(function(e){n.options.readOnly||n.mousedown(e)})),document.getElementById("".concat(n.jsPlugin.id,"-canvas")).addEventListener("mouseup",(function(t){if(!n.options.readOnly){var i=e.onChange;n.mouseUpFn(t,i)}})),i()}))},e.prototype.setWidth=function(e){e.width&&(document.getElementById(e.id).width=e.width,document.getElementById("".concat(e.id,"-canvas")).width=e.width,document.getElementById("".concat(e.id,"-canvas-container")).width=e.width,n.canvasWidth=e.width,n.updata({time:n.nowTime||new Date}))},e.prototype.mousemove=function(e){if(this.isMouseDown&&this.isOver){var t=this.mousePosition-e.pageX;if(0===t)return;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=new Date(this.oldTime).getTime()+t*i*1e3;this.updata({time:n}),this.moved=!0}else{var a=parseInt(document.getElementById("".concat(this.jsPlugin.id,"-canvas-container")).offsetLeft,10);this.mousePosition=e.pageX-a,this.updata()}},e.prototype.mousedown=function(e){this.isMouseDown=!0,this.mousePosition=e.pageX,this.oldTime=this.nowTime},e.prototype.mouseover=function(e){this.isOver=!0},e.prototype.mouseleave=function(e){this.isOver=!1,this.isMouseDown=!1,this.updata()},e.prototype.changeSize=function(e){console.log("changeSize",e),this.options.timeWidth=e,this.updata({timeWidth:e})},e.prototype.mouseUpFn=function(e,t){if(this.isMouseDown&&(this.isMouseDown=!1,this.moved)){this.moved=!1;var i=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(i),this.updata({time:this.nowTime}),this.oldTime=this.nowTime,console.log("nowTime",new Date(this.nowTime),i),t(this.nowTime)}},e.prototype.readOnly=function(e){console.log("更改为只读"),this.options.readOnly=!0,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="not-allowed"},e.prototype.unReadOnly=function(e){console.log("更改为只读"),this.options.readOnly=!1,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="pointer"},e.prototype.run=function(e){n.isMouseDown||n.updata(e)},e.prototype.getTime=function(e){console.log("this",this),console.log("当前时间",new Date(this.nowTime))},e.prototype.updata=function(e){e=e||{},n.nowTime=e.time||n.nowTime,n.timeSection=e.timeSection||n.timeSection,n.timeWidthTblIndex=e.timeWidth||n.timeWidthTblIndex,n.timeWidth=n.timeWidthTbls[e.timeWidth||n.timeWidthTblIndex],n.timeUnit=n.timeUnits[e.timeWidth||n.timeWidthTblIndex],0===e.timeWidth&&(n.timeWidthTblIndex=0,n.timeWidth=n.timeWidthTbls[0],n.timeUnit=n.timeUnits[0]),n.drawPen.fillStyle="#000000",n.drawPen.fillRect(0,0,n.canvasWidth,n.canvasHeight),n.drawScale(),n.drawRecord(),n.drawOtherMsg()},e.prototype.drawSolidLine=function(e,t,i,n,a,r){this.drawPen.save(),this.drawPen.strokeStyle=r,this.drawPen.lineWidth=a,this.drawPen.beginPath(),this.drawPen.moveTo(e,t),this.drawPen.lineTo(i,n),this.drawPen.stroke(),this.drawPen.restore()},e.prototype.drawString=function(e,t,i,n,a){this.drawPen.font="12px serif",this.drawPen.fillStyle="#ffffff",this.drawPen.textAlign=n||"left",this.drawPen.fillText(e,t,i+10)},e.prototype.drawScale=function(){var e=this,t="rgba(255,255,255)",i=new Date(e.nowTime),n=i.getSeconds(),a=i.getMinutes(),r=i.getHours(),o=i.getDate(),s=0;switch(e.timeWidth){case 60:var l=parseInt(e.canvasWidth/10);i.setSeconds(i.getSeconds()-parseInt(l/2,10)),o=i.getDate(),r=i.getHours(),a=i.getMinutes(),n=i.getSeconds();for(var c=0;c<l;c++){if(s=n+c,i.setSeconds(s),s%10==0){e.drawSolidLine(c*e.canvasWidth/l,8,c*e.canvasWidth/l,e.canvasHeight/5+8,1,t);var d=this.subTime(i.getHours())+":"+this.subTime(i.getMinutes())+":"+this.subTime(i.getSeconds());e.drawString(d,c*e.canvasWidth/l,e.canvasHeight/5*2.5,"center","rgba(255,255,255,0.3)")}else e.drawSolidLine(c*e.canvasWidth/l,8,c*e.canvasWidth/l,e.canvasHeight/5*.5+8,1,t);i.setDate(o),i.setHours(r),i.setMinutes(a)}break;case 1800:var u=new Date(e.nowTime),h=3600*u.getHours()+60*u.getMinutes()+u.getSeconds(),f=parseInt(h/60),x={position:parseInt(e.canvasWidth/2),time:0,hideString:!0},p=Math.ceil(e.canvasWidth/40)+f,m=[];m.push(x);for(var _=0;_<p;_++)m.push({position:x.position+20*_-parseInt(h/3),time:x.time+60*_}),m.unshift({position:x.position-20*_-parseInt(h/3),time:x.time-60*_});for(var g=0;g<m.length;g++)if(e.drawSolidLine(m[g].position,8,m[g].position,e.canvasHeight/5*(m[g].time%100==0?1:.5)+8,1,t),m[g].time%100==0&&!m[g].hideString){var v=new Date(1e3*m[g].time),y=v.getUTCHours()<10?"0".concat(v.getUTCHours()):v.getUTCHours(),S=v.getUTCMinutes()<10?"0".concat(v.getUTCMinutes()):v.getUTCMinutes();v.getUTCSeconds()<10?"0".concat(v.getUTCSeconds()):v.getUTCSeconds();var b="".concat(y,":").concat(S);e.drawString(b,m[g].position,e.canvasHeight/5*2,"center","rgba(255,255,255,0.3)")}break;case 3600:var P=new Date(e.nowTime),E=3600*P.getHours()+60*P.getMinutes()+P.getSeconds(),C=parseInt(E/1800),T={position:parseInt(e.canvasWidth/2),time:0,hideString:!0},R=Math.ceil(e.canvasWidth/40)+C,w=[];w.push(T);for(var I=0;I<R;I++)w.push({position:T.position+20*I-parseInt(E/90),time:T.time+1800*I}),w.unshift({position:T.position-20*I-parseInt(E/90),time:T.time-1800*I});for(var D=0;D<w.length;D++)if(e.drawSolidLine(w[D].position,8,w[D].position,e.canvasHeight/5*(w[D].time%9e3==0?1:.5)+8,1,t),w[D].time%9e3==0&&!w[D].hideString){var k=new Date(1e3*w[D].time),F=k.getUTCHours()<10?"0".concat(k.getUTCHours()):k.getUTCHours(),A=k.getUTCMinutes()<10?"0".concat(k.getUTCMinutes()):k.getUTCMinutes();k.getUTCSeconds()<10?"0".concat(k.getUTCSeconds()):k.getUTCSeconds();var M="".concat(F,":").concat(A);e.drawString(M,w[D].position,e.canvasHeight/5*2,"center","rgba(255,255,255,0.3)")}break;case 86400:var L=new Date(e.nowTime),B=3600*L.getHours()+60*L.getMinutes()+L.getSeconds(),O=parseInt(B/3600),j={position:parseFloat(e.canvasWidth/2),time:0,hideString:!0},N=Math.ceil(e.canvasWidth/60)+O,U=[];U.push(j);for(var z=0;z<N;z++)U.push({position:j.position+30*z-B/120,time:j.time+3600*z}),U.unshift({position:j.position-30*z-B/120,time:j.time-3600*z});for(var H=0;H<U.length;H++)if(e.drawSolidLine(U[H].position,8,U[H].position,e.canvasHeight/5*(U[H].time%7200==0?1:.5)+8,1,t),U[H].time%7200==0&&!U[H].hideString){var V=new Date(1e3*U[H].time),Z=V.getUTCHours()<10?"0".concat(V.getUTCHours()):V.getUTCHours(),W=V.getUTCMinutes()<10?"0".concat(V.getUTCMinutes()):V.getUTCMinutes();V.getUTCSeconds()<10?"0".concat(V.getUTCSeconds()):V.getUTCSeconds();var G="".concat(Z,":").concat(W);e.drawString(G,U[H].position,e.canvasHeight/5*2,"center","rgba(255,255,255,0.3)")}}},e.prototype.getRecord=function(e,t,i){this.timeSection=e,this.drawRecord()},e.prototype.drawRecord=function(){for(var e=this.timeSection||[],t=this,i=t.drawPen,n=0;n<e.length;n++){var a=o(e[n].startTime),r=o(e[n].endTime);i.fillStyle="#1890ff80",i.fillRect(a,0,r-a,48)}function o(e){var i=10;switch(t.timeWidth){case 60:i=10;break;case 1800:i=20/60;break;case 3600:i=20/30/60;break;case 86400:i=.5/60}var n=t.canvasWidth/2+(e-t.nowTime)/1e3*i;return n>t.canvasWidth&&(n=t.canvasWidth),n<=0&&(n=0),n}},e.prototype.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}},j="https://open.ys7.com",N=256,U=1536,z=2304,H=[{place:3,name:"鱼眼不矫正",type:0,correctType:0},{place:3,name:"360°全景",type:1,correctType:768},{place:3,name:"4分屏",type:4,correctList:[{correctType:N,x:.25,y:.25},{correctType:N,x:.75,y:.25},{correctType:N,x:.25,y:.75},{correctType:N,x:.75,y:.75}],correctType:N},{place:3,name:"柱状",type:5,correctType:U,viewParam:{x:0,y:0}}],V=[{place:1,name:"鱼眼不矫正",type:0,correctType:0},{place:1,name:"360°全景",type:1,correctType:768},{place:1,name:"4分屏",type:2,correctList:[{correctType:N,x:.25,y:.25},{correctType:N,x:.75,y:.25},{correctType:N,x:.25,y:.75},{correctType:N,x:.75,y:.75}],correctType:N},{place:1,name:"广角",type:4,correctType:z}];var Z=j,W=function(){function e(t){return r(this,e),e.instant?e.instant:(Z=t||Z,e.instant=this)}return s(e,[{key:"setDomain",value:function(e){Z=e||Z}},{key:"fetch",value:function(e){function t(t,i){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){return e="string"==typeof e?/^http/.test(e)?e:Z+e:e,new Promise((function(i,n){fetch(e,t).then((function(e){try{return e.json()}catch(e){n({code:-1,msg:"data json parse error"})}})).then((function(e){200==+e.code||e.meta&&200===e.meta.code?i(e):n(e)})).catch((function(e){n(e)}))}))}))}]),e}();function G(e){var t=e.slice(0,4),i=e.slice(4,6),n=e.slice(6,8),a=e.slice(8,10),r=e.slice(10,12),o=e.slice(12,14);return new Date("".concat(t,"/").concat(i,"/").concat(n," ").concat(a,":").concat(r,":").concat(o))}function Y(e,t){var i,n,a={startTime:t.startTime?new Date(t.startTime).Format("yyyy-MM-dd hh:mm:ss"):void 0,endTime:t.startTime?new Date(t.endTime).Format("yyyy-MM-dd hh:mm:ss"):void 0,spaceId:t.spaceId},r=Object.keys(a).reduce((function(e,t){return null==a[t]?e:e+="&".concat(t,"=").concat(encodeURIComponent(a[t]))}),"").replace("&",""),o=e.env.domain+"/api/service/cloudrecord/video/info/list?".concat(r);return(i=o,n={method:"get",headers:{accessToken:t.accessToken,deviceSerial:t.deviceSerial,localIndex:t.channelNo}},new Promise((function(e,t){fetch(i,n).then((function(e){return e.json()})).then((function(i){200==+i.code||i.meta&&200===i.meta.code?e(i):t(i)})).catch((function(e){t(e)}))}))).then((function(e){return e.data=(e.data||[]).map((function(e){return e.endTime=G(e.stopTime).getTime(),e.startTime=G(e.startTime).getTime(),e.busType=7,e})),e}))}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(t<=-24||t>=24)&&(t=0);var i=e.slice(0,4),n=e.slice(4,6),a=e.slice(6,8),r=e.slice(8,10),o=e.slice(10,12),s=e.slice(12,14),l=new Date(Date.UTC(i,n-1,a,r,o,s));l.setHours(l.getHours()+t),l>new Date&&(l=new Date);var c=l.getUTCFullYear(),d=("0"+(l.getUTCMonth()+1)).slice(-2),u=("0"+l.getUTCDate()).slice(-2),h=("0"+l.getUTCHours()).slice(-2),f=("0"+l.getUTCMinutes()).slice(-2),x=("0"+l.getUTCSeconds()).slice(-2);return new Date("".concat(c,"/").concat(d,"/").concat(u," ").concat(h,":").concat(f,":").concat(x))}l(W,"instant",void 0);var J=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(t<=-24||t>=24)&&(t=0);var i=60*t*60*1e3,n=e.getTime()+i;return new Date(n)},q=function(){function e(t){if(r(this,e),this.jSPlugin=t,!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0,this.date=new Date,this.datepickerVisible=!1,this.seekTimer=null,this.disabled=!1,this.isSeeking=!1,this.seekFrequency=2e3,this.recList=[],this.lastDate=null,this.nowTime=null,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),this.recInit()}return s(e,[{key:"recInit",value:function(){var e=this;if(!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0;var t=parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).width,10)-100,i=document.createElement("div");i.style="display:inline-block;height:48px;",i.id=this.jSPlugin.id+"-canvas-container";var n=document.createElement("canvas");n.id=this.jSPlugin.id+"-canvas",n.className="time-line-body",n.height="48",n.width=t,n.style="display:inline-block;",n.innerHTML="该浏览器不支持canvas",i.appendChild(n),g(i,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")));var a=document.createElement("div");a.className="timeline-controls",a.style="display:flex;width:100px;height:48px;text-align:center;line-height: 48px;vertical-align: top;background: #000000;";var r='\n<div class="timeline-controls-scale" style="display: inline-flex;flex-direction: column;justify-content: center;vertical-align: top;padding: 0 20px;">\n  <span style="vertical-Align: middle;line-height: 14px;height: 18px; width: 18px;cursor:pointer;" id="'.concat(this.jSPlugin.id,'-timeline-scale-add">\n    <svg fill="#2C2C2C" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20"\n      viewBox="0 0 20 20">\n      <title>add</title>\n      <g>\n        <polygon points="0.1,0.5 15,0.5 15,15.4 0.1,15.4 \t" />\n      </g>\n      <g>\n        <path\n          fill="#FFFFFF";\n          d="M7.6,12.4c-0.3,0-0.5-0.2-0.5-0.5v-8c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v8C8.1,12.2,7.9,12.4,7.6,12.4z" />\n      </g>\n      <g>\n        <path\n          fill="#FFFFFF";\n          d="M11.6,8.4h-8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h8c0.3,0,0.5,0.2,0.5,0.5S11.8,8.4,11.6,8.4z" />\n      </g>\n    </svg>\n  </span>\n  <span style="vertical-Align: middle;line-height: 14px;height: 18px; width: 18px;cursor:pointer;" id="').concat(this.jSPlugin.id,'-timeline-scale-sub">\n    <svg fill="#2C2C2C" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20"\n      viewBox="0 0 20 20">\n      <title>reduce</title>\n      <g>\n        <polygon class="st0" points="1,0.8 15.2,0.8 15.2,15 1,15 \t" />\n      </g>\n      <g>\n        <path class="st1"\n          fill="#FFFFFF";\n          d="M12.1,8.4h-8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h8c0.3,0,0.5,0.2,0.5,0.5S12.4,8.4,12.1,8.4z" />\n      </g>\n    </svg>\n  </span>\n</div>\n<label for="').concat(this.jSPlugin.id,'-datepicker">\n  <div class="timeline-controls-date">\n    <span>\n      <svg fill="#2C2C2C" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20"\n        viewBox="0 0 20 20">\n        <title>ifttt</title>\n        <g id="Rectangle">\n          <rect x="0.6" y="0.9" class="st0" width="20" height="20" />\n        </g>\n        <g id="Stroke-1">\n          <path fill="#FFFFFF"; class="st1"\n            d="M14,7.2c-0.3,0-0.5-0.2-0.5-0.5V3.4c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v3.3C14.5,7,14.2,7.2,14,7.2z" />\n        </g>\n        <g id="Stroke-3">\n          <path fill="#FFFFFF"; class="st1"\n            d="M7.3,7.2C7,7.2,6.8,7,6.8,6.7V3.4c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v3.3C7.8,7,7.6,7.2,7.3,7.2z" />\n        </g>\n        <g id="Stroke-5">\n          <path fill="#FFFFFF"; class="st1"\n            d="M18.1,9.7h-15c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h15c0.3,0,0.5,0.2,0.5,0.5S18.4,9.7,18.1,9.7z" />\n        </g>\n        <g id="Stroke-7">\n          <path fill="#FFFFFF"; class="st1" d="M16.5,19.7H4.8c-1.2,0-2.2-1-2.2-2.2V6.7c0-1.2,1-2.2,2.2-2.2h11.7c1.2,0,2.2,1,2.2,2.2v10.8\nC18.6,18.8,17.7,19.7,16.5,19.7z M4.8,5.6c-0.6,0-1.2,0.5-1.2,1.2v10.8c0,0.6,0.5,1.2,1.2,1.2h11.7c0.6,0,1.2-0.5,1.2-1.2V6.7\nc0-0.6-0.5-1.2-1.2-1.2H4.8z" />\n        </g>\n        <g id="Stroke-9">\n          <path fill="#FFFFFF"; class="st1" d="M10.6,13.3c-0.4,0-0.7-0.3-0.7-0.7c0-0.2,0.1-0.4,0.2-0.5s0.3-0.2,0.5-0.2h0h0c0.4,0,0.7,0.3,0.7,0.7\nS11,13.3,10.6,13.3z" />\n        </g>\n        <g id="Stroke-11">\n          <path fill="#FFFFFF"; class="st1" d="M14.8,13.3c-0.4,0-0.7-0.3-0.7-0.7c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.3-0.2,0.5-0.2c0.4,0,0.7,0.3,0.7,0.7\nS15.2,13.3,14.8,13.3z M14.8,12.3c-0.2,0-0.3,0.1-0.3,0.3c0,0.2,0.3,0.4,0.5,0.2c0.1-0.1,0.1-0.1,0.1-0.2\nC15.1,12.4,15,12.3,14.8,12.3z" />\n        </g>\n        <g id="Stroke-13">\n          <path fill="#FFFFFF"; class="st1" d="M6.5,16.6c-0.4,0-0.7-0.3-0.7-0.7c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.3-0.2,0.5-0.2h0h0c0.4,0,0.7,0.3,0.7,0.7\nC7.2,16.3,6.9,16.6,6.5,16.6z" />\n        </g>\n        <g id="Stroke-15">\n          <path fill="#FFFFFF"; class="st1" d="M10.6,16.6c-0.4,0-0.7-0.3-0.7-0.7c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.3-0.2,0.5-0.2h0h0c0.4,0,0.7,0.3,0.7,0.7\nC11.4,16.3,11,16.6,10.6,16.6z" />\n        </g>\n      </svg>\n    </span>\n  </div>\n</label>\n<input autocomplete="off" data-toggle="').concat(this.jSPlugin.id,'-datepicker" id="').concat(this.jSPlugin.id,'-datepicker" name="').concat(this.jSPlugin.id,'-datepicker" style="opacity:0;width:24px;margin-left:-24px;cursor:pointer;" />\n');a.innerHTML=r,g(a,i),this.timeLine=new O(this.jSPlugin);var o=this;this.timeLine.init({id:this.jSPlugin.id+"-canvas",width:t,nowTime:this.nowTime,onChange:function(t){console.log("time",t,new Date(t).Format("yyyyMMddhhmmss"));var i=new Date(t).Format("yyyyMMddhhmmss");if(console.log("----------------this.jSPlugin.url",e.jSPlugin.url),e.jSPlugin.Theme&&e.jSPlugin.Theme.decoderState.state.recordvideo&&(e.jSPlugin.Theme.setDecoderState({recordvideo:!1}),"cloud.rec"===P(e.jSPlugin.url).type&&e.jSPlugin.stopSave()),"cloud.rec"===P(e.jSPlugin.url).type||e.jSPlugin.useSeek&&e.jSPlugin.capacity&&"1"==e.jSPlugin.capacity.support_seek_playback)e.isSeeking||o.recList.length>0&&(new Date(t).valueOf()>=o.lastDate?e.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}):e.unSyncTimeLine().then((function(){e.isSeeking=!0,e.jSPlugin.pluginStatus.loadingStart(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),e.jSPlugin.pluginStatus.loadingSetText({text:"加载中,请稍后"}),e.jSPlugin.Theme.setDisabled(!0),e.jSPlugin._tempSeekTime=t,e.jSPlugin.seek(i.substr(8,6),"235959").then((function(){var i=setInterval((function(){e.jSPlugin._destroy?clearInterval(i):e.jSPlugin.getOSDTime().then((function(n){var a=new Date(t).valueOf()/1e3;if(console.log("seek时间同步:",new Date(1e3*n.data).Format("hh:mm:ss"),new Date(1e3*a).Format("hh:mm:ss"),n.data>=a),n.data>=a-2){if(e.isSeeking=!1,e.syncTimeLine(),clearInterval(i),e.jSPlugin.pluginStatus.loadingStop(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.Theme.setDisabled(!1),e.jSPlugin._tempSeekTime=null,e.jSPlugin.Theme)e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound();o.jSPlugin.waterMark_JSPlugin&&o.jSPlugin.setWaterMarkFont(o.jSPlugin.waterMark_JSPlugin)}}))}),1e3)}))})));else{var n=function(){setTimeout((function(){e.disabled=!1}),e.seekFrequency)},a=e.jSPlugin.Theme.decoderState.state.play,r=function(t){e.disabled=!0,a?e.unSyncTimeLine().then((function(){e.jSPlugin.pluginStatus.loadingStart(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),e.jSPlugin.pluginStatus.loadingSetText({text:"加载中,请稍后"}),e.jSPlugin.Theme.setDisabled(!0),e.jSPlugin.pause(i).then((function(){console.log("暂停成功"),e.jSPlugin.resume(i).then((function(i){console.log("恢复成功:",i),e.jSPlugin.Theme&&e.jSPlugin.Theme.setDecoderState({play:!0}),e.jSPlugin.Theme&&e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound(),t&&t(),e.syncTimeLine(),e.jSPlugin.pluginStatus.loadingStop(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.Theme.setDisabled(!1),o.jSPlugin.waterMark_JSPlugin&&o.jSPlugin.setWaterMarkFont(o.jSPlugin.waterMark_JSPlugin)})).catch((function(e){console.log("恢复失败",e)}))})).catch((function(){console.log("暂停失败"),e.jSPlugin.resume(i).then((function(i){console.log("恢复成功"),e.jSPlugin.Theme&&e.jSPlugin.Theme.setDecoderState({play:!0}),t&&t(),e.syncTimeLine(),e.jSPlugin.pluginStatus.loadingStop(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.Theme.setDisabled(!1),o.jSPlugin.waterMark_JSPlugin&&o.jSPlugin.setWaterMarkFont(o.jSPlugin.waterMark_JSPlugin)})).catch((function(e){console.log("恢复失败",e)}))}))})):e.unSyncTimeLine().then((function(){e.jSPlugin.pluginStatus.loadingStart(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),e.jSPlugin.pluginStatus.loadingSetText({text:"加载中,请稍后"}),e.jSPlugin.Theme.setDisabled(!0),e.jSPlugin.pause(i).then((function(){console.log("暂停成功"),e.jSPlugin.resume(i).then((function(i){e.jSPlugin.Theme&&e.jSPlugin.Theme.setDecoderState({play:!0}),e.jSPlugin.Theme&&e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound(),t&&t(),e.syncTimeLine(),e.jSPlugin.pluginStatus.loadingStop(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.Theme.setDisabled(!1)})).catch((function(e){console.log("恢复失败",e)}))})).catch((function(){console.log("暂停失败"),e.jSPlugin.resume(i).then((function(i){e.jSPlugin.Theme&&e.jSPlugin.Theme.setDecoderState({play:!0}),t&&t(),e.syncTimeLine(),e.jSPlugin.pluginStatus.loadingStop(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.Theme.setDisabled(!1)})).catch((function(e){console.log("恢复失败",e)}))}))})),e.jSPlugin.Theme&&e.jSPlugin.Theme.decoderState&&e.jSPlugin.Theme.decoderState.state&&e.jSPlugin.Theme.decoderState.state.zoom&&(e.jSPlugin.Theme.setDecoderState({zoom:!1}),e.jSPlugin.Zoom.stopZoom())};e.disabled?(console.log("操作频繁,等待2秒后执行"),e.seekTimer&&clearTimeout(e.seekTimer),e.seekTimer=setTimeout((function(){r(n)}),e.seekFrequency)):r(n)}}}).then((function(){e.syncTimeLine(),console.log(e.timeLine)}));var s,l,c=this;s=c.jSPlugin,l=document.getElementById("".concat(s.id,"-wrap")),p("".concat(s.staticPath,"/rec/datepicker.min.css")),x("".concat(s.staticPath,"/rec/jquery.min.js"),(function(e){x("".concat(e.staticPath,"/rec/datepicker.js"),(function(e){x("".concat(e.staticPath,"/rec/datepicker.zh-CN.js"),(function(e){var t=l.getElementsByClassName("datepicker-container")[0];!t&&$("#".concat(e.id,"-datepicker")).datepicker&&$("#".concat(e.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:"zh-CN",date:new Date(_("begin",e.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:l}),(t=l.getElementsByClassName("datepicker-container")[0])&&(t.style.display="none"),c.datepickerVisible=!1,$("#".concat(e.id,"-datepicker")).on("pick.datepicker",(function(i){if(console.log("重新选择日期",i.date,new Date(i.date).Format("yyyyMMddhhmmss"),new Date(document.getElementById("".concat(e.id,"-datepicker")).value).Format("yyyyMMdd")),i.date>new Date||new Date(i.date).Format("yyyyMMddhhmmss")===new Date(document.getElementById("".concat(e.id,"-datepicker")).value).Format("yyyyMMdd"))i.preventDefault();else{var n=new Date(i.date).Format("yyyy-MM-dd");document.getElementById("".concat(e.id,"-datepicker")).value=n,e.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:n}}),c.renderRec(i.date),e.Theme.decoderState&&e.Theme.decoderState.state?e.Theme.decoderState.state.cloudRec?e.changePlayUrl({begin:new Date(i.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"},(function(){}),!1):e.Theme.decoderState.state.rec?e.changePlayUrl({begin:new Date(i.date).Format("yyyyMMddhhmmss"),type:"rec"},(function(){}),!1):e.changePlayUrl({begin:new Date(i.date).Format("yyyyMMddhhmmss")},(function(){}),!1):e.changePlayUrl({begin:new Date(i.date).Format("yyyyMMddhhmmss")},(function(){}),!1)}t&&(t.style.display="none"),c.datepickerVisible=!1,e.Theme&&e.Theme.decoderState&&e.Theme.decoderState.state&&e.Theme.decoderState.state.zoom&&(e.Theme.setDecoderState({zoom:!1}),e.Zoom.stopZoom())})),$("#".concat(e.id,"-datepicker")).off("click").on("click",(function(e){console.log("点击日期"),c.datepickerVisible?t&&(t.style.display="none"):t&&(t.style.display="inline"),c.datepickerVisible=!c.datepickerVisible}))}),(function(){}),e)}),(function(){}),e)}),(function(){}),s),document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-add")).onclick=function(){e.unSyncTimeLine().then((function(){e.currentTimeWidth<3&&e.timeLine.changeSize(++e.currentTimeWidth),e.syncTimeLine()}))},document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-sub")).onclick=function(){e.unSyncTimeLine().then((function(){e.currentTimeWidth>0&&e.timeLine.changeSize(--e.currentTimeWidth),e.syncTimeLine()}))};var d=_("begin",this.jSPlugin.url)||(new Date).Format("yyyyMMdd");d=X(d,_("timeZone",this.jSPlugin.url)?parseInt(_("timeZone",this.jSPlugin.url)):0),this.renderRec(d.Format("yyyy-MM-dd")),this.observer=new MutationObserver((function(e,t){}));var u=document.getElementById("".concat(this.jSPlugin.id));this.observer.observe(u,{attributes:!0,attributeOldValue:!0,attributeFilter:["style"]})}},{key:"setDatepickerDate",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(t){var i=t.getElementsByClassName("datepicker-container")[0];if(i){var n=i;n.parentNode.removeChild(n),document.getElementById("".concat(this.jSPlugin.id,"-datepicker")).value=e.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"),$("#".concat(this.jSPlugin.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:"zh-CN",defaultDate:e,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:document.getElementById("".concat(this.jSPlugin.id,"-wrap"))})}}}},{key:"datepickerHide",value:function(){var e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));e&&(e.getElementsByClassName("datepicker-container")[0].style.display="none");this.datepickerVisible=!1}},{key:"datepickerShow",value:function(){var e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));e&&(e.getElementsByClassName("datepicker-container")[0].style.display="inline");this.datepickerVisible=!0}},{key:"recAutoSize",value:function(e){var t=this,i=this,n=parseInt(getComputedStyle(document.getElementById(i.jSPlugin.id)).width,10)-100;document.getElementById("".concat(this.jSPlugin.id,"-canvas"))&&n!==parseInt(document.getElementById("".concat(i.jSPlugin.id,"-canvas")).width)&&i.unSyncTimeLine().then((function(){i.timeLine.setWidth({id:"".concat(t.jSPlugin.id),width:n}),i.syncTimeLine(),e&&e()}))}},{key:"syncTimeLine",value:function(){var e=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),Array.isArray(window.recTimer)&&window.recTimer.map((function(e){clearInterval(e)})),window.recTimer=[];var t=this;this.jSPlugin.recTimer=setInterval((function(){t.jSPlugin.getOSDTime().then((function(i){var n=i.data;if(-1===n)console.log("获取播放时间错误");else if(n>0){var a=new Date(n>1e12?n:1e3*n);e.nowTime=a,t.timeLine.run({time:a})}})).catch((function(e){var i=t.jSPlugin.Theme.decoderState.state.pauseDate;t.timeLine.run({time:t.timeLine.nowTime||i})}))}),1e3),window.recTimer.push(this.jSPlugin.recTimer)}},{key:"unSyncTimeLine",value:function(){var e=this;return new Promise((function(t,i){e.jSPlugin.recTimer&&(clearInterval(e.jSPlugin.recTimer),e.jSPlugin.recTimer=null),Array.isArray(window.recTimer)&&(window.recTimer.map((function(e){clearInterval(e)})),window.recTimer=[]),t()}))}},{key:"renderRec",value:function(e){var t=this;this.date=e;var i=this,n=new Date(new Date(e).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime();console.log("%c---------------renderRec-----------------------","font-size: 20px; color:red;",this.jSPlugin.timeZone),this.jSPlugin.timeZone&&-1===this.jSPlugin.url.indexOf(".cloud")&&(n=new Date(J(new Date(n),this.jSPlugin.timeZone).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime());var a=new Date(new Date(n).Format("yyyy-MM-dd 23:59:59").replace(/-/g,"/")).getTime();if(this.timeLine.getRecord([],n,a),this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===_("busType",this.jSPlugin.url)){var r={accessToken:this.jSPlugin.accessToken,deviceSerial:P(this.jSPlugin.url).deviceSerial,channelNo:P(this.jSPlugin.url).channelNo,startTime:n,endTime:a,spaceId:this.jSPlugin._spaceId};Y(this.jSPlugin,r).then((function(e){if(e.data&&e.data.length>0){var r=e.data;i.recList=r,i.lastDate=r[r.length-1].endTime,t.timeLine.getRecord(r,n,a)}}))}else{var o={accessToken:this.jSPlugin.accessToken,recType:"cloud.rec"===P(this.jSPlugin.url).type?1:2,deviceSerial:P(this.jSPlugin.url).deviceSerial,channelNo:P(this.jSPlugin.url).channelNo,startTime:n,endTime:a,version:"2.0"},s=this.jSPlugin.env.domain+"/api/lapp/video/by/time";C(s,"POST",o,"",(function(e){if(e.data&&e.data.files&&e.data.files.length>0){var r=e.data.files,s=(new Date).getTime(),l=e.data.isAll;if(i.recList=r,i.lastDate=r[r.length-1].endTime,l)t.timeLine.getRecord(r,n,a);else{!function e(){o.startTime=s,C(this.jSPlugin.env.domain+"/api/lapp/video/by/time","POST",o,"",(function(t){t.data&&t.data.files&&t.data.files.length>0?0==t.data.isAll?(t.data.files&&(r=r.concat(t.data.files),i.recList=r,i.lastDate=r[r.length-1].endTime),s=t.data.nextFileTime>0?t.data.nextFileTime:(new Date).getTime(),e()):(console.log("云存储执行渲染片段"),i.timeLine.getRecord(r,n,a)):i.timeLine.getRecord(r,n,a)}))}()}t.timeLine.run({time:new Date(n)})}else e.data&&e.data.length>0&&(console.log("获取本地录像片段成功",e),i.recList=e.data,i.lastDate=e.data[e.data.length-1].endTime,i.timeLine.getRecord(e.data,n,a),i.timeLine.run({time:new Date(n)}))}))}}}]),e}(),K=function(e){console.log("执行TimeLine - params",e),this.state={id:e.id,start:"00:00:00",end:"24:00:00",current:0,timelag:30,timeArr:[],availTimeLine:[],scrollTop:0,index:0,date:"",noTimeLineTxt:"",disabled:!1};var t=this;this.setState=function(e){Object.keys(e).forEach((function(i){t.state[i]=e[i],"scrollTop"===i&&document.getElementById("time-line-item").parentNode.scrollTo(0,e[i]),"current"===i&&(document.getElementById("time-line-current").innerHTML=e[i])}))},this.setDisabled=function(e){this.setState({disabled:e}),document.getElementById("time-line-item").parentNode.style.overflowY=e?"hidden":"scroll"},this.timeToSecond=function(e){var t=e.split(":"),i=Number(t[0]),n=Number(t[1]),a=Number(t[2]);return 60*i*60+60*n+(a||0)},this.minuteToTime=function(e){var t=Math.floor(e/60),i=e%60;return(t>9?t:"0"+t)+":"+(i>9?i:"0"+i)},this.timeToMinute=function(e){var t=e.split(":");return 60*Number(t[0])+Number(t[1])},this.getPlayParam=e.getPlayParam,this.checkIsAppleDevice=function(){var e=navigator.userAgent,t=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),i=e.indexOf("iPad")>-1,n=e.indexOf("iPhone")>-1||e.indexOf("Mac")>-1;return!!(t||i||n)},this.checkIsHarmonyOS=function(){return navigator.userAgent.indexOf("ohos")>-1},this.checkIsHarmonyOS()?(document.getElementById("time-line-item").parentNode.addEventListener("touchstart",(function(){if(t.state.disabled)return!1;e.ontouchstart()}),!1),document.getElementById("time-line-item").parentNode.addEventListener("touchmove",(function(){if(t.state.disabled)return!1;e.ontouchmove()}),!1),document.getElementById("time-line-item").parentNode.addEventListener("touchend",(function(){if(t.state.disabled)return!1;var i;new Promise((function(e,t){var n=-1;i=setInterval((function(){var t=document.getElementById("time-line-item").parentNode.scrollTop;t!==n?(console.log("scolling",t,n),n=t):(console.log("scoll stop",t,n),clearInterval(i),e(t))}),100)})).then((function(e){console.log("scollPromise: then",e,t),t.rectTopTotime(e),console.log("页面滚动实际高度",e,t.state),t.getPlayParam({current:t.state.current})})),e.ontouchend()}),!1)):(document.getElementById("time-line-item").parentNode.ontouchstart=function(){if(t.state.disabled)return!1;e.ontouchstart()},document.getElementById("time-line-item").parentNode.ontouchmove=function(){if(t.state.disabled)return!1;e.ontouchmove()},document.getElementById("time-line-item").parentNode.ontouchend=function(){if(t.state.disabled)return!1;var i;new Promise((function(e,t){var n=-1;i=setInterval((function(){var t=document.getElementById("time-line-item").parentNode.scrollTop;t!==n?(console.log("scolling",t,n),n=t):(console.log("scoll stop",t,n),clearInterval(i),e(t))}),100)})).then((function(e){console.log("scollPromise: then",e,t),t.rectTopTotime(e),console.log("页面滚动实际高度",e,t.state),t.getPlayParam({current:t.state.current})})),e.ontouchend()}),this.matchTimeDot()};K.prototype.changeScale=function(e){this.setState({timelag:e}),this.matchTimeDot()},K.prototype.setDateLine=function(e,t){e.length>0?(void 0===t&&(t=e.length-1),this.setState({availTimeLine:e,start:e[t].st,end:e[t].et,current:e[t].st}),console.log("this.state",this.state),this.matchRecTimeDot(),this.primaryOffsetH()):(this.setState({availTimeLine:[]}),console.log("this.state",this.state),this.matchRecTimeDot())},K.prototype.matchTimeDot=function(){var e=this.state,t=e.start,i=e.end,n=e.timelag;e.availTimeLine,console.log("start",t,"end",i);for(var a=[],r=this.timeToMinute(i),o=r=Math.floor(r/n)*n;o>=0;){var s=0,l=0;o==r&&(s=70),0==o&&(l=230);var c=this.minuteToTime(o);a.push({id:o,current:c,label:"a"+o,marginTop:s,marginBottom:l,recArr:[]}),o-=n}this.setState({timeArr:a}),this.renderDateLine()},K.prototype.matchRecTimeDot=function(){var e=this.state,t=e.start,i=e.end,n=e.timelag,a=e.availTimeLine,r=e.timeArr;console.log("start",t,"end",i);var o=[],s=a.length;if(0===s)for(var l=0;l<r.length;l++)r[l].recArr=[];else{for(var c=0;c<r.length;c++)r[c].recArr=[];for(var d=0;d<s;d++){var u,h,f,x,p=a[d],m=this.timeToSecond(p.st),_=this.timeToSecond(p.et);f=(m-60*(u=Math.floor(m/(60*n))*n))/n,x=(_-60*(h=Math.floor(_/(60*n))*n))/n,o[d]={st:u,et:h,stAvailPercent:f,etAvailPercent:x};for(l=0;l<r.length;l++)if(r[l].id==u&&r[l].id==h){var g=x-f,v=60-x;r[l].recArr.push({height:g,top:v})}else r[l].id==u?r[l].recArr.push({height:60-f,top:0}):r[l].id==h?r[l].recArr.push({height:x,top:60-x}):r[l].id>u&&r[l].id<h&&r[l].recArr.push({height:60,top:0})}}console.log("availArr: ",o),this.setState({timeArr:r}),console.log("timeArr:",this.state),this.renderDateLine()},K.prototype.renderDateLine=function(){var e=this.state,t=e.id,i=e.timeArr;console.log("id,timeArr",t,i);var n=document.getElementById("time-line-item");n.innerHTML="",i.forEach((function(e,t){var i=document.createElement("div");i.setAttribute("class","time-item"),i.style="margin-top: ".concat(e.marginTop,"px; margin-bottom: ").concat(e.marginBottom,"px; border-right-color: ").concat(e.borderColor,";"),document.createElement("div").setAttribute("class","scale");var a='<div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale" style="width:10px"></div>';e.recArr.forEach((function(e,t){a+='<div class="item-unavail" style="height: '.concat(e.height,"px;background-color:#A8B9ED; top: ").concat(e.top,'px"></div>')})),a+="<div id=".concat(e.label,' style="position: relative; top: 51px; left: 40%"> ').concat(e.current,"</div>"),i.innerHTML=a,n.appendChild(i)}))},K.prototype.primaryOffsetH=function(){var e=this.state,t=e.start,i=e.timelag,n=e.timeArr[0].current,a=this.timeToSecond(n)-this.timeToSecond(t),r=Math.ceil(a/i)+60;this.setState({scrollTop:r}),console.log("起始偏移量",r)},K.prototype.currentOffsetH=function(){var e=this.state,t=e.current,i=e.timelag,n=e.timeArr[0].current,a=this.timeToSecond(n)-this.timeToSecond(t),r=Math.ceil(a/i)+60;this.setState({scrollTop:r})},K.prototype.rectTopTotime=function(e){var t,i,n=this.state.timelag,a=Math.floor(e/60),r=e-60*a;if(console.log("index:",a,"offsetH:",r),0==r)t=this.state.timeArr[a-1].current,i=0;else{var o=this.state.timeArr[a].current,s=this.timeToMinute(o),l=(60-r)*n,c=Math.floor(l/60)+s,d=60*Math.floor(l/60);i=Math.ceil(l-d),t=this.minuteToTime(c)}this.setState({current:t+":"+(i>9?i:"0"+i),scrollTop:e})},K.prototype.stepScrollTimeLine=function(e){this.setState({current:e}),this.currentOffsetH()},K.prototype.secondCountDown=function(e){var t=this.state.current.split(":"),i=60*Number(t[0])*60+60*Number(t[1])+Number(t[2])+1,n=Math.floor(i/3600),a=Math.floor((i-3600*n)/60),r=i-3600*n-60*a;this.setState({current:(n>9?n:"0"+n)+":"+(a>9?a:"0"+a)+":"+(r>9?r:"0"+r)})};var Q=K;function ee(e){var t=new Date(e),i=t.getHours(),n=t.getMinutes(),a=t.getSeconds();return(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)+":"+(a>9?a:"0"+a)}Date.prototype.Format=function(e){var t={"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 i in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[i]:("00"+t[i]).substr((""+t[i]).length)));return e};var te=function(){function e(t,i,n){var a=this;r(this,e),this.changeRecSpeed=i,this.resetMobileZoomStatus=n,this.isMobile=!0,this.jSPlugin=t,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=P(this.jSPlugin.url).type,this.operating=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.recList=[],this.isSeeking=!1,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency);var o=document.createElement("style");if(o.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(o),_("begin",this.jSPlugin.url)){var s=_("begin",this.jSPlugin.url);this.date=s.slice(0,4)+"/"+s.slice(4,6)+"/"+s.slice(6,8),this.begin=this.date+" ".concat(s.slice(8,10)||"00",":").concat(s.slice(10,12)||"00",":").concat(s.slice(12,14)||"00"),this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(_("end",this.jSPlugin.url)){var l=_("end",this.jSPlugin.url);this.end=this.date+" ".concat(l.slice(8,10)||"23",":").concat(l.slice(10,12)||"59",":").concat(l.slice(12,14)||"59"),this.initEnd=this.end}var c=document.createElement("div");c.id="date-switch-container-wrap",c.className="date-switch-container-wrap",c.style="",c.innerHTML='\n      <div class="date-switch-container">\n      <div class="current-date" id="current-date">今日录像</div>\n      <div class="date-container">\n        <label for="date">\n          <div class="date-icon"></div>\n        </label>\n        <input type="date" name="date" id="date" value="'.concat(this.date.replace(/\//g,"-")||(new Date).Format("yyyy-MM-dd"),'" />\n      </div>\n    </div>\n        '),g(c,document.getElementById("".concat(this.jSPlugin.id,"-wrap")));var d=document.createElement("div");d.id="rec-type-container-wrap",d.className="rec-type-container-wrap",d.style="",d.innerHTML='\n    <div class="rec-type-container">\n    <div class="rec-type-text">共<span id="recCount">0</span>个录像</div>\n    <div class="rec-type-switch">\n      <label>\n        <input type="checkbox" name="type" id="cloudType" value="1" hidden />\n        <label for="cloudType" class="advice">\n          <span>\n          <svg fill="#CCCCCC" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="2 0 20 20">\n            <path class="st0" d="M12.6,5c-2.3,0.1-4.3,1.4-5.3,3.3L7.2,8.6c-2.4,0.5-4.1,2.5-4.1,4.9c0,2.8,2.4,5,5.2,5h9.9\n            c2.4,0,4.3-1.9,4.3-4.2l0-0.2c-0.1-2-1.6-3.5-3.5-3.9l-0.1,0l0-0.2c-0.4-2.8-3-5-6.1-5L12.6,5z"/>\n          </svg>\n        </span>\n        <span>\n          <svg fill="#CCCCCC" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="2 0 20 20">\n            <path id="形状结合" class="st0" d="M14.3,4c0.6,0,1.2,0.2,1.7,0.7l0,0L18.3,7C18.7,7.4,19,8,19,8.6l0,0v9c0,1.3-1.1,2.3-2.4,2.3\n\tl0,0H8.4C7.1,20,6,19,6,17.7l0,0V6.3C6,5,7.1,4,8.4,4l0,0H14.3z M9.7,7.2C9.3,7.2,8.9,7.6,8.9,8l0,0v2.5l0,0.1\n\tc0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C10.4,7.5,10,7.2,9.7,7.2z M12.2,7.2c-0.4,0-0.8,0.3-0.8,0.8l0,0v2.5\n\tl0,0.1c0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C12.9,7.5,12.5,7.2,12.2,7.2z M14.7,7.2c-0.4,0-0.8,0.3-0.8,0.8l0,0\n\tv2.5l0,0.1c0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C15.4,7.5,15,7.2,14.7,7.2z"/>\n          </svg>\n        </span>\n        </label>\n      </label>\n    </div>\n  </div>\n        ',g(d,c);var u=document.createElement("div");u.id="mobile-rec-wrap",u.className="mobileRec-wrap",u.style="",u.innerHTML='\n    <div class="time-line-container">\n    <div class="current-time">\n      <div class="current-time-bg" id="time-line-current">00:00:00</div>\n    </div>\n    <div class="time-line-item-container">\n      <div class="time-line-item" id="time-line-item">\n      </div>\n    </div>\n    </div>\n      ',g(u,d);this.TimeLineOBJ=new Q({id:"time-line-item",getPlayParam:function(e){var t=a;console.log("子组件传值到父组件",e,e.current,a.date);var i=e.current,n=new Date(a.date).Format("yyyyMMdd").substr(0,8)+(e.current?i.replace(/:/g,""):e.current.replace(/:/g,""));if("cloud.rec"===a.type||a.jSPlugin.useSeek&&a.jSPlugin.capacity&&"1"==a.jSPlugin.capacity.support_seek_playback)a.isSeeking||t.recList.length>0&&(new Date("".concat(a.date," ").concat(e.current)).valueOf()>=t.lastDate?(a.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}),a.syncTimeLine()):a.unSyncTimeLine().then((function(){a.isSeeking=!0,a.jSPlugin.pluginStatus.loadingStart(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),a.jSPlugin.pluginStatus.loadingSetText({text:"加载中,请稍后"}),a.jSPlugin.Theme.setDisabled(!0),a.jSPlugin.seek(n.substr(8,6),"235959").then((function(){var e=setInterval((function(){a.jSPlugin.getOSDTime().then((function(i){console.log("seek时间同步:",new Date(1e3*i.data).Format("yyyyMMddhhmmss"),n,new Date(1e3*i.data).Format("yyyyMMddhhmmss")>=n),new Date(1e3*i.data).Format("yyyyMMddhhmmss")>=n&&(a.isSeeking=!1,a.syncTimeLine(),clearInterval(e),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),a.jSPlugin.waterMark_JSPlugin&&t.jSPlugin.setWaterMarkFont(t.jSPlugin.waterMark_JSPlugin))}))}),1e3)}))})));else{var r=function(){setTimeout((function(){a.disabled=!1}),a.seekFrequency)},o=a.jSPlugin.Theme.decoderState.state.play,s=function(e){a.disabled=!0,a.jSPlugin.pluginStatus.loadingStart(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),a.jSPlugin.pluginStatus.loadingSetText({text:"加载中,请稍后"}),a.jSPlugin.Theme.setDisabled(!0),o?a.unSyncTimeLine().then((function(){a.jSPlugin.pause(n).then((function(){console.log("暂停成功"),a.jSPlugin.resume(n).then((function(i){console.log("恢复成功"),a.syncTimeLine(),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),a.jSPlugin.waterMark_JSPlugin&&t.jSPlugin.setWaterMarkFont(t.jSPlugin.waterMark_JSPlugin),e&&e()}))})).catch((function(){console.log("暂停失败"),a.jSPlugin.resume(n).then((function(t){console.log("恢复成功"),a.syncTimeLine(),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),e&&e()}))}))})):a.unSyncTimeLine().then((function(){a.jSPlugin.resume(n).then((function(t){console.log("恢复成功"),a.syncTimeLine(),e&&e()}))}))};a.disabled?(console.log("操作频繁,等待2秒后执行"),a.seekTimer&&clearTimeout(a.seekTimer),a.seekTimer=setTimeout((function(){s(r)}),a.seekFrequency)):s(r)}},ontouchstart:function(){a.operating=!0,a.unSyncTimeLine()},ontouchmove:function(){0==a.operating&&(a.operating=!0,a.unSyncTimeLine())},ontouchend:function(){a.operating=!1}}),this.fetchDeviceRec(),document.getElementById("date").addEventListener("change",(function(e){console.log("日期变化",e.target.value);var t=e.target.value,i=parseInt(new Date(t).Format("yyyy/MM/dd").replace(/\//g,"")),n=new Date;i>parseInt(n.Format("yyyy/MM/dd").replace(/\//g,""))?document.getElementById("date").value=new Date(a.date.replace(/\//g,"-")||n.Format("yyyy-MM-dd")).Format("yyyy-MM-dd"):(a.date=new Date(t).Format("yyyy/MM/dd"),a.begin=a.date+" 00:00:00",a.end=a.date+" 23:59:59",a.jSPlugin.changePlayUrl({type:a.type,begin:"".concat(new Date(a.date).Format("yyyyMMdd"),"000000")}).then((function(e){setTimeout((function(){var e=document.getElementById("date");e&&(e.value=t)}),0)})),a.changeRecSpeed(1),a.resetMobileZoomStatus())})),document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(function(e){var t=e.target.checked?2:1;a.type=e.target.checked?"rec":"cloud.rec",console.log("recType",t),a.jSPlugin.changePlayUrl({type:a.type,begin:"".concat(new Date(a.date).Format("yyyyMMdd"),"000000")}).then((function(){console.log("切换类型成功"),a.syncTimeLine(),a.changeRecSpeed(1),a.resetMobileZoomStatus()}),(function(e){console.log("err",e)})).catch((function(e){console.log(e)}))})),this.syncTimeLine()}return s(e,[{key:"fetchDeviceRec",value:function(){var e=this,t=function(t){var i=t.length;document.getElementById("recCount").innerHTML=i;for(var n=[],a=i-1;a>=0;a--){var r=t[a],o=ee(r.endTime),s=ee(r.startTime);n.push({st:s,et:o})}e.TimeLineOBJ.setDateLine(n)},i=new FormData,n=this;i.append("deviceSerial",P(this.jSPlugin.url).deviceSerial),i.append("channelNo",P(this.jSPlugin.url).channelNo),i.append("accessToken",this.jSPlugin.accessToken),i.append("recType","cloud.rec"===this.type?1:2);var a=_("timeZone",this.jSPlugin.url);if(a<=23&&a>=-23&&"cloud.rec"!==this.type){var r=X(new Date(this.begin).Format("yyyyMMddhhmmss"),+a);i.append("startTime",new Date(r.Format("yyyy/MM/dd")+" 00:00:00").getTime()),i.append("endTime",new Date(r.Format("yyyy/MM/dd")+" 23:59:59").getTime()),this.date=r.Format("yyyy/MM/dd")}else i.append("startTime",new Date(this.begin).getTime()),i.append("endTime",new Date(this.end).getTime());fetch(this.jSPlugin.env.domain+"/api/lapp/video/by/time",{method:"POST",body:i}).then((function(e){return e.json()})).then((function(e){if(200==e.code&&e.data){var i;i=e.data,n.recList=i,n.lastDate=i[i.length-1].endTime,t(i)}else t([])}))}},{key:"syncTimeLine",value:function(){var e=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),Array.isArray(window.recTimer)&&window.recTimer.map((function(e){clearInterval(e)})),window.recTimer=[];var t=this;this.jSPlugin.recTimer=setInterval((function(){if(e.operating)return console.log("操作中"),!1;e.jSPlugin.getOSDTime().then((function(e){e.data>0&&t.TimeLineOBJ.stepScrollTimeLine(function(e){var t=new Date(e),i=t.getHours(),n=t.getMinutes(),a=t.getSeconds();return(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)+":"+(a>9?a:"0"+a)}(1e3*e.data))})).catch((function(e){console.log("err:-----",e),console.log("未找到当前获取播放时间,等待中...")}))}),1e3),window.recTimer.push(this.jSPlugin.recTimer)}},{key:"unSyncTimeLine",value:function(){var e=this;return new Promise((function(t,i){e.jSPlugin.recTimer&&(clearInterval(e.jSPlugin.recTimer),e.jSPlugin.recTimer=null),Array.isArray(window.recTimer)&&(window.recTimer.map((function(e){clearInterval(e)})),window.recTimer=[]),t()}))}}]),e}(),ie=function(){function e(t){var i=this;if(r(this,e),this.jSPlugin=t,this.pluginStatus=new F(this,this.jSPlugin.id),this.showPtz=!1,console.log("云台初始化"),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;";var a=document.createElement("style");a.innerHTML="\n    .ez-ptz-container {\n      position: relative;\n      width: 80px;\n      height: 80px;\n      background: rgba(255, 255, 255, 0.70);\n      box-shadow: 0px 0px 33px 4px rgb(0 0 0 / 15%);\n      border: 1px solid rgba(255, 255, 255, 0.70);\n      border-radius: 100%;\n      cursor: pointer;\n      overflow: hidden;\n      user-select: none;\n    }\n    .ez-ptz-container .ez-ptz-icon.top {\n      width: 0;\n      height: 0;\n      border-left: 4px solid transparent;\n      border-right: 4px solid transparent;\n      border-bottom: 8px solid #999999;\n      position: absolute;\n      display: inline-block;\n      left: calc(50% - 4px);\n      top: 2px;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.top.active {\n      border-bottom-color: #407AFF;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.bottom {\n      width: 0;\n      height: 0;\n      border-left: 4px solid transparent;\n      border-right: 4px solid transparent;\n      border-top: 8px solid #999999;\n      position: absolute;\n      display: inline-block;\n      left: calc(50% - 4px);\n      bottom: 2px;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.bottom.active {\n      border-top-color: #407AFF;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.right {\n      width: 0;\n      height: 0;\n      border-top: 4px solid transparent;\n      border-bottom: 4px solid transparent;\n      border-left: 8px solid #999999;\n      position: absolute;\n      display: inline-block;\n      top: calc(50% - 4px);\n      right: 2px;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.right.active {\n      border-left-color: #407AFF;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.left {\n      width: 0;\n      height: 0;\n      border-top: 4px solid transparent;\n      border-bottom: 4px solid transparent;\n      border-right: 8px solid #999999;\n      position: absolute;\n      display: inline-block;\n      top: calc(50% - 4px);\n      left: 2px;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.left.active {\n      border-right-color: #407AFF;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.top-left {\n      width: 4px;\n      height: 4px;\n      border-radius: 50%;\n      position: absolute;\n      display: inline-block;\n      top: calc(25% - 4px);\n      left: 16px;\n      background: #999999;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.top-left.active {\n      border-right-color: #407AFF;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.left-bottom {\n      width: 4px;\n      height: 4px;\n      border-radius: 50%;\n      position: absolute;\n      display: inline-block;\n      bottom: calc(25% - 4px);\n      left: 16px;\n      background: #999999;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.left-bottom.active {\n      border-right-color: #407AFF;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.bottom-right {\n      width: 4px;\n      height: 4px;\n      border-radius: 50%;\n      position: absolute;\n      display: inline-block;\n      bottom: calc(25% - 4px);\n      right: 16px;\n      background: #999999;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.bottom-right.active {\n      border-right-color: #407AFF;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.right-top {\n      width: 4px;\n      height: 4px;\n      border-radius: 50%;\n      position: absolute;\n      display: inline-block;\n      top: calc(25% - 4px);\n      right: 16px;\n      background: #999999;\n    }\n\n    .ez-ptz-container .ez-ptz-icon.right-top.active {\n      border-right-color: #407AFF;\n    }\n\n    .ez-ptz-container .ez-ptz-main.center {\n      width: 23px;\n      height: 23px;\n      background: #407AFF;\n      border-radius: 100%;\n      top: calc(50% - 12.4px);\n      left: calc(50% - 12.4px);\n      position: absolute;\n    }\n\n    .ez-ptz-wrap {\n      position: absolute;\n      right: 0px;\n      top: 0;\n      width: 85px;\n      height: 100%;\n      padding: 0 20px;\n      flex-direction: column;\n      justify-content: center;\n      background: rgba(0,0,0,0.9);\n      box-sizing: content-box !important;\n    }\n\n    .ez-ptz-close {\n      position: absolute;\n      color: #FFFFFF;\n      top: 0;\n      right: 0px;\n    }\n\n    .ez-ptzspeed-progress-line{\n      height: 1px;\n      background: #ffffff;\n      margin: 16px 0 8px;\n      display: flex;\n      justify-content: space-between;\n    }\n\n    .ez-ptzspeed-progress-line-dot{\n      width: 5px;\n      height: 5px;\n      border: 2px solid #ffffff;\n      border-radius: 50%;\n      background: #ffffff;\n      margin: -3px 0;\n      cursor: pointer;\n    }\n\n    .ez-ptzspeed-progress-line-dot.active{\n      border-color: #407AFF;\n    }\n    \n    .ez-ptzspeed-progress-points{\n      display: flex;\n      justify-content: space-between;\n    }\n\n    .ez-ptzspeed-progress-points-slow{\n      cursor: pointer;\n      color: #ffffff;\n    }\n\n    .ez-ptzspeed-progress-points-mid{\n      cursor: pointer;\n      color: #ffffff;\n    }\n\n    .ez-ptzspeed-progress-points-fast{\n      cursor: pointer;\n      color: #ffffff;\n    }\n\n    .ez-ptzbtn-container{\n      width: 100%;\n      height:".concat(t.isMobile?"60px":"18px",";\n      margin-top: 14px;\n      display: ").concat(t.isMobile?"block":"flex",";\n    }\n\n    .ez-ptzbtn-focal,\n    .ez-ptzbtn-zoom{\n      width: ").concat(t.isMobile?"100%":"50%",";\n      height: 20px;\n      display: flex;\n      border: 1px solid rgba(255,255,255,0.5);\n      border-radius: 10px;\n      padding-bottom: 0px;\n      box-sizing: content-box;\n    }\n\n    .ez-ptzbtn-zoom-add,\n    .ez-ptzbtn-zoom-sub,\n    .ez-ptzbtn-focal-add,\n    .ez-ptzbtn-focal-sub{\n      width: ").concat(t.isMobile?"50%":"24px",";\n      height: 20px;\n      cursor: pointer;\n      text-align: center;\n    }\n\n    .ez-ptzbtn-zoom{\n      margin: ").concat(t.isMobile?"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),n.innerHTML='\n      <div class="ez-ptz-container" id="'.concat(this.jSPlugin.id,'-ez-ptz-container" style="position: relative;width: 80px;height: 80px;background: rgba(255, 255, 255, 0.80);box-shadow: 0px 0px 33px 4px rgba(0, 0, 0, 0.15);border: 1px solid rgba(255, 255, 255, 0.80);border-radius: 100%;cursor: pointer;overflow: hidden;user-select: none;">\n        <div class="ez-ptz-main center"></div>\n        <div class="ez-ptz-icon top"></div>\n        <div class="ez-ptz-icon top-left"></div>\n        <div class="ez-ptz-icon left"></div>\n        <div class="ez-ptz-icon left-bottom"></div>\n        <div class="ez-ptz-icon bottom"></div>\n        <div class="ez-ptz-icon bottom-right"></div>\n        <div class="ez-ptz-icon right"></div>\n        <div class="ez-ptz-icon right-top"></div>\n      </div>\n      <div class="ez-ptzspeed-container" id="').concat(this.jSPlugin.id,'-ez-ptzspeed-container" style="user-select: none;">\n        <div class="ez-ptzspeed-progress" title="调整云台转动速度">\n          <div class="ez-ptzspeed-progress-line">\n            <div class="ez-ptzspeed-progress-line-dot" id="ptzspeed-slow-dot"></div>\n            <div class="ez-ptzspeed-progress-line-dot active" id="ptzspeed-mid-dot"></div>\n            <div class="ez-ptzspeed-progress-line-dot" id="ptzspeed-fast-dot"></div>\n          </div>\n          <div class="ez-ptzspeed-progress-points">\n            <div class="ez-ptzspeed-progress-points-slow" id="ptzspeed-slow">\n              慢\n            </div>\n            <div class="ez-ptzspeed-progress-points-mid" id="ptzspeed-mid">\n              中\n            </div>\n            <div class="ez-ptzspeed-progress-points-fast" id="ptzspeed-fast">\n              快\n            </div>\n          </div>\n        </div>\n      </div>\n      <div class="ez-ptzbtn-container">\n        <div class="ez-ptzbtn-zoom" title="控制设备放大/缩小画面" style="user-select: none;">\n          <div class="ez-ptzbtn-zoom-add" id="').concat(this.jSPlugin.id,'-ez-ptzbtn-zoom-add" style="user-select: none;">\n            <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705043060101" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8152" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" p-id="8153" fill="#ffffff"></path><path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" p-id="8154" fill="#ffffff"></path><path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" p-id="8155" fill="#ffffff"></path></svg>\n          </div>\n          <div class="ez-ptzbtn-zoom-sub" id="').concat(this.jSPlugin.id,'-ez-ptzbtn-zoom-sub" style="user-select: none;">\n            <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705043081103" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8395" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" p-id="8396" fill="#ffffff"></path><path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" p-id="8397" fill="#ffffff"></path></svg>\n          </div>\n        </div>\n        <div class="ez-ptzbtn-focal" title="调整设备焦距" style="user-select: none;">\n          <div class="ez-ptzbtn-focal-add" id="').concat(this.jSPlugin.id,'-ez-ptzbtn-focal-add" style="user-select: none;">\n          <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705048602135" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5018" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" p-id="5019" fill="#ffffff"></path><path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" p-id="5020" fill="#ffffff"></path></svg>\n          </div>\n          <div class="ez-ptzbtn-focal-sub" id="').concat(this.jSPlugin.id,'-ez-ptzbtn-focal-sub" style="user-select: none;">\n          <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705048615893" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5352" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" p-id="5353" fill="#ffffff"></path><path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" p-id="5354" fill="#ffffff"></path></svg>\n          </div>\n        </div>\n      </div>\n      '),document.getElementById("".concat(t.id,"-wrap")).appendChild(n),document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),console.log("点击开始"),i._handlePtzTouch(e,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),console.log("触摸结束"),i._handlePtzTouch(e,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),console.log("触摸开始"),i._handlePtzTouch(e,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),console.log("触摸结束",e),i._handlePtzTouch(e,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).onmouseup=function(e){e.target.id&&(e.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("ptzspeed-slow-dot").classList.add("active"),document.getElementById("ptzspeed-mid-dot").classList.remove("active"),document.getElementById("ptzspeed-fast-dot").classList.remove("active")),e.target.id.indexOf("mid")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("ptzspeed-slow-dot").classList.remove("active"),document.getElementById("ptzspeed-mid-dot").classList.add("active"),document.getElementById("ptzspeed-fast-dot").classList.remove("active")),e.target.id.indexOf("fast")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("ptzspeed-slow-dot").classList.remove("active"),document.getElementById("ptzspeed-mid-dot").classList.remove("active"),document.getElementById("ptzspeed-fast-dot").classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).ontouchend=function(e){e.target.id&&(e.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("ptzspeed-slow-dot").classList.add("active"),document.getElementById("ptzspeed-mid-dot").classList.remove("active"),document.getElementById("ptzspeed-fast-dot").classList.remove("active")),e.target.id.indexOf("mid")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("ptzspeed-slow-dot").classList.remove("active"),document.getElementById("ptzspeed-mid-dot").classList.add("active"),document.getElementById("ptzspeed-fast-dot").classList.remove("active")),e.target.id.indexOf("fast")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("ptzspeed-slow-dot").classList.remove("active"),document.getElementById("ptzspeed-mid-dot").classList.remove("active"),document.getElementById("ptzspeed-fast-dot").classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("focal","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),i._handleBtnTouch("focal","sub","stop")}}return s(e,[{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item")).style="display: flex;box-sizing: content-box;"),this.showPtz=!0,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("openPtz",{eventType:"openPtz",code:0,target:this,msg:"开启云台"})}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item")).style="display: none"),this.showPtz=!1,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("closePtz",{eventType:"closePtz",code:0,target:this,msg:"关闭云台"})}},{key:"_handlePtzTouch",value:function(e,t){var i=this,n=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).getBoundingClientRect(),a=n.left+41,r=n.top+41,o=e.x||e.changedTouches[0].clientX,s=e.y||e.changedTouches[0].clientY,l=0,c=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",d=0;function u(e,t){var i=Math.atan2(t,e);i<0&&(i+=2*Math.PI);var n=i*(180/Math.PI)-225-12.5;return n<0&&(n+=360),Math.floor(n/45)+1}if(/^rotate\(90/.test(document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.transform))switch(u(o-a,s-r)){case 1:l=2,d=90;break;case 2:l=4,d=135;break;case 3:l=0,d=180;break;case 4:l=6,d=225;break;case 5:l=3,d=270;break;case 6:l=7,d=315;break;case 7:l=1,d=0;break;case 8:l=5,d=45}else switch(u(o-a,s-r)){case 1:l=0,d=180;break;case 2:l=6,d=225;break;case 3:l=3,d=270;break;case 4:l=7,d=315;break;case 5:l=1,d=0;break;case 6:l=5,d=45;break;case 7:l=2,d=90;break;case 8:l=4,d=135}document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(d,"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)"),"stop"===t&&(c=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="");var h=new FormData;h.append("deviceSerial",P(this.jSPlugin.url).deviceSerial),h.append("channelNo",P(this.jSPlugin.url).channelNo),h.append("speed",this.jSPlugin.ptzSpeed),h.append("direction",l),h.append("accessToken",this.jSPlugin.accessToken),fetch(c,{method:"POST",body:h}).then((function(e){return e.json()})).then((function(e){if("start"===t&&200!=e.code){console.log(e.code,i.jSPlugin.i18n.t("server.ptz."+t+"."+e.code));var n=i.jSPlugin.i18n.t("server.ptz."+t+"."+e.code)||e.msg;i.pluginStatus.loadingSetText({text:n,color:"red",delayClear:2e3})}60005!=e.code&&60002!=e.code&&60003!=e.code&&60004!=e.code&&60006!=e.code||(document.getElementById("".concat(i.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(d,"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"))})).catch((function(e){console.log("云台调用异常",e)}))}},{key:"_handleBtnTouch",value:function(e,t,i){var n=this,a=8;a="zoom"===e?"add"===t?8:9:"add"===t?10:11;var r=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start";"stop"===i&&(r=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop");var o=new FormData;o.append("deviceSerial",P(this.jSPlugin.url).deviceSerial),o.append("channelNo",P(this.jSPlugin.url).channelNo),o.append("speed",this.jSPlugin.ptzSpeed),o.append("direction",a),o.append("accessToken",this.jSPlugin.accessToken),fetch(r,{method:"POST",body:o}).then((function(e){return e.json()})).then((function(t){"start"===i&&200!=t.code&&(6e4==t.code||60006==t.code?n.pluginStatus.loadingSetText({text:"zoom"===e?"当前设备不支持物理缩放":"当前设备不支持变焦",color:"red",delayClear:2e3}):n.pluginStatus.loadingSetText({text:t.msg,color:"red",delayClear:2e3}))})).catch((function(e){}))}}]),e}();function ne(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}!function(e,t){e.exports=function(){function e(t,i,n){function a(o,s){if(!i[o]){if(!t[o]){if(!s&&ne)return ne(o);if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[o]={exports:{}};t[o][0].call(c.exports,(function(e){return a(t[o][1][e]||e)}),c,c.exports,e,t,i,n)}return i[o].exports}for(var r=ne,o=0;o<n.length;o++)a(n[o]);return a}return e}()({1:[function(e,t,i){var n=(0,e("./adapter_factory.js").adapterFactory)({window:window});window.adapter=n,t.exports=n},{"./adapter_factory.js":2}],2:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0}),i.adapterFactory=d;var n=c(e("./utils")),a=c(e("./chrome/chrome_shim")),r=c(e("./edge/edge_shim")),o=c(e("./firefox/firefox_shim")),s=c(e("./safari/safari_shim")),l=c(e("./common_shim"));function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function d(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).window,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},i=n.log,c=n.detectBrowser(e),d={browserDetails:c,commonShim:l,extractVersion:n.extractVersion,disableLog:n.disableLog,disableWarnings:n.disableWarnings};switch(c.browser){case"chrome":if(!a||!a.shimPeerConnection||!t.shimChrome)return i("Chrome shim is not included in this adapter release."),d;i("adapter.js shimming chrome."),d.browserShim=a,a.shimGetUserMedia(e),a.shimMediaStream(e),a.shimPeerConnection(e),a.shimOnTrack(e),a.shimAddTrackRemoveTrack(e),a.shimGetSendersWithDtmf(e),a.shimGetStats(e),a.shimSenderReceiverGetStats(e),a.fixNegotiationNeeded(e),l.shimRTCIceCandidate(e),l.shimConnectionState(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e),l.removeAllowExtmapMixed(e);break;case"firefox":if(!o||!o.shimPeerConnection||!t.shimFirefox)return i("Firefox shim is not included in this adapter release."),d;i("adapter.js shimming firefox."),d.browserShim=o,o.shimGetUserMedia(e),o.shimPeerConnection(e),o.shimOnTrack(e),o.shimRemoveStream(e),o.shimSenderGetStats(e),o.shimReceiverGetStats(e),o.shimRTCDataChannel(e),o.shimAddTransceiver(e),o.shimCreateOffer(e),o.shimCreateAnswer(e),l.shimRTCIceCandidate(e),l.shimConnectionState(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e);break;case"edge":if(!r||!r.shimPeerConnection||!t.shimEdge)return i("MS edge shim is not included in this adapter release."),d;i("adapter.js shimming edge."),d.browserShim=r,r.shimGetUserMedia(e),r.shimGetDisplayMedia(e),r.shimPeerConnection(e),r.shimReplaceTrack(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e);break;case"safari":if(!s||!t.shimSafari)return i("Safari shim is not included in this adapter release."),d;i("adapter.js shimming safari."),d.browserShim=s,s.shimRTCIceServerUrls(e),s.shimCreateOfferLegacy(e),s.shimCallbacksAPI(e),s.shimLocalStreamsAPI(e),s.shimRemoteStreamsAPI(e),s.shimTrackEventTransceiver(e),s.shimGetUserMedia(e),l.shimRTCIceCandidate(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e),l.removeAllowExtmapMixed(e);break;default:i("Unsupported browser!")}return d}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=i.shimGetUserMedia=void 0;var n="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)},r=e("./getusermedia");Object.defineProperty(i,"shimGetUserMedia",{enumerable:!0,get:function(){return r.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(i,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),i.shimMediaStream=d,i.shimOnTrack=u,i.shimGetSendersWithDtmf=h,i.shimGetStats=f,i.shimSenderReceiverGetStats=x,i.shimAddTrackRemoveTrackWithNative=p,i.shimAddTrackRemoveTrack=m,i.shimPeerConnection=_,i.fixNegotiationNeeded=g;var s=l(e("../utils.js"));function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function c(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function u(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var i=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(n){var a=void 0;a=e.RTCPeerConnection.prototype.getReceivers?i.getReceivers().find((function(e){return e.track&&e.track.id===n.track.id})):{track:n.track};var r=new Event("track");r.track=n.track,r.receiver=a,r.transceiver={receiver:a},r.streams=[t.stream],i.dispatchEvent(r)})),t.stream.getTracks().forEach((function(n){var a=void 0;a=e.RTCPeerConnection.prototype.getReceivers?i.getReceivers().find((function(e){return e.track&&e.track.id===n.id})):{track:n};var r=new Event("track");r.track=n,r.receiver=a,r.transceiver={receiver:a},r.streams=[t.stream],i.dispatchEvent(r)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else s.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))}function h(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var i=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){var a=i.apply(this,arguments);return a||(a=t(this,e),this._senders.push(a)),a};var a=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){a.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var i=this;this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((function(e){i._senders.push(t(i,e))}))};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach((function(e){var i=t._senders.find((function(t){return t.track===e}));i&&t._senders.splice(t._senders.indexOf(i),1)}))}}else if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var s=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=s.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.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}})}}function f(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,i=Array.prototype.slice.call(arguments),n=i[0],a=i[1],r=i[2];if(arguments.length>0&&"function"==typeof n)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof n))return t.apply(this,[]);var o=function(e){var t={};return e.result().forEach((function(e){var i={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){i[t]=e.stat(t)})),t[i.id]=i})),t},s=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};if(arguments.length>=2){var l=function(e){a(s(o(e)))};return t.apply(this,[l,n])}return new Promise((function(i,n){t.apply(e,[function(e){i(s(o(e)))},n])})).then(a,r)}}}function x(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,i=t.apply(this,[]);return i.forEach((function(t){return t._pc=e})),i});var i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return s.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var a=e.RTCPeerConnection.prototype.getReceivers;a&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=a.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),s.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return s.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],i=void 0,n=void 0,a=void 0;return this.getSenders().forEach((function(e){e.track===t&&(i?a=!0:i=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(n?a=!0:n=e),e.track===t})),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)}}}}function p(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){if(!i)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var n=t.apply(this,arguments);return this._shimmedLocalStreams[i.id]?-1===this._shimmedLocalStreams[i.id].indexOf(n)&&this._shimmedLocalStreams[i.id].push(n):this._shimmedLocalStreams[i.id]=[i,n],n};var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){var i=t.getSenders().find((function(t){return t.track===e}));if(i)throw new DOMException("Track already exists.","InvalidAccessError")}));var n=this.getSenders();i.apply(this,arguments);var a=this.getSenders().filter((function(e){return-1===n.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(a)};var n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};var a=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(i){var n=t._shimmedLocalStreams[i].indexOf(e);-1!==n&&t._shimmedLocalStreams[i].splice(n,1),1===t._shimmedLocalStreams[i].length&&delete t._shimmedLocalStreams[i]})),a.apply(this,arguments)}}function m(e){if(e.RTCPeerConnection){var t=s.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return p(e);var i=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=i.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var i=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){var t=i.getSenders().find((function(t){return t.track===e}));if(t)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var a=new e.MediaStream(t.getTracks());this._streams[t.id]=a,this._reverseStreams[a.id]=t,t=a}n.apply(this,[t])};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},a.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,i){var n=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var a=[].slice.call(arguments,1);if(1!==a.length||!a[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");var r=this.getSenders().find((function(e){return e.track===t}));if(r)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var o=this._streams[i.id];if(o)o.addTrack(t),Promise.resolve().then((function(){n.dispatchEvent(new Event("negotiationneeded"))}));else{var s=new e.MediaStream([t]);this._streams[i.id]=s,this._reverseStreams[s.id]=i,this.addStream(s)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var i=e.RTCPeerConnection.prototype[t],n=c({},t,(function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?i.apply(this,[function(i){var n=l(e,i);t[0].apply(null,[n])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):i.apply(this,arguments).then((function(t){return l(e,t)}))}));e.RTCPeerConnection.prototype[t]=n[t]}));var r=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=d(this,arguments[0]),r.apply(this,arguments)):r.apply(this,arguments)};var o=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=o.get.apply(this);return""===e.type?e:l(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var i=void 0;Object.keys(this._streams).forEach((function(n){t._streams[n].getTracks().find((function(t){return e.track===t}))&&(i=t._streams[n])})),i&&(1===i.getTracks().length?this.removeStream(this._reverseStreams[i.id]):i.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function l(e,t){var i=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var n=e._reverseStreams[t],a=e._streams[n.id];i=i.replace(new RegExp(a.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:i})}function d(e,t){var i=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var n=e._reverseStreams[t],a=e._streams[n.id];i=i.replace(new RegExp(n.id,"g"),a.id)})),new RTCSessionDescription({type:t.type,sdp:i})}}function _(e){var t=s.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var i=e.RTCPeerConnection.prototype[t],n=c({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=n[t]}));var i=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}function g(e){s.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){if("stable"===e.target.signalingState)return e}))}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,i){function n(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(i){return t(i).then((function(t){var n=i.video&&i.video.width,a=i.video&&i.video.height,r=i.video&&i.video.frameRate;return i.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:r||3}},n&&(i.video.mandatory.maxWidth=n),a&&(i.video.mandatory.maxHeight=a),e.navigator.mediaDevices.getUserMedia(i)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=n},{}],5:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)};i.shimGetUserMedia=l;var r=o(e("../utils.js"));function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}var s=r.log;function l(e){var t=e&&e.navigator;if(t.mediaDevices){var i=r.detectBrowser(e),a=function(e){if("object"!==(void 0===e?"undefined":n(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(i){if("require"!==i&&"advanced"!==i&&"mediaSource"!==i){var a="object"===n(e[i])?e[i]:{ideal:e[i]};void 0!==a.exact&&"number"==typeof a.exact&&(a.min=a.max=a.exact);var r=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==a.ideal){t.optional=t.optional||[];var o={};"number"==typeof a.ideal?(o[r("min",i)]=a.ideal,t.optional.push(o),(o={})[r("max",i)]=a.ideal,t.optional.push(o)):(o[r("",i)]=a.ideal,t.optional.push(o))}void 0!==a.exact&&"number"!=typeof a.exact?(t.mandatory=t.mandatory||{},t.mandatory[r("",i)]=a.exact):["min","max"].forEach((function(e){void 0!==a[e]&&(t.mandatory=t.mandatory||{},t.mandatory[r(e,i)]=a[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},o=function(e,r){if(i.version>=61)return r(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===n(e.audio)){var o=function(e,t,i){t in e&&!(i in e)&&(e[i]=e[t],delete e[t])};o((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),o(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=a(e.audio)}if(e&&"object"===n(e.video)){var l=e.video.facingMode;l=l&&("object"===(void 0===l?"undefined":n(l))?l:{ideal:l});var c=i.version<66;if(l&&("user"===l.exact||"environment"===l.exact||"user"===l.ideal||"environment"===l.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||c)){delete e.video.facingMode;var d=void 0;if("environment"===l.exact||"environment"===l.ideal?d=["back","rear"]:"user"!==l.exact&&"user"!==l.ideal||(d=["front"]),d)return t.mediaDevices.enumerateDevices().then((function(t){t=t.filter((function(e){return"videoinput"===e.kind}));var i=t.find((function(e){return d.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!i&&t.length&&d.includes("back")&&(i=t[t.length-1]),i&&(e.video.deviceId=l.exact?{exact:i.deviceId}:{ideal:i.deviceId}),e.video=a(e.video),s("chrome: "+JSON.stringify(e)),r(e)}))}e.video=a(e.video)}return s("chrome: "+JSON.stringify(e)),r(e)},l=function(e){return i.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},c=function(e,i,n){o(e,(function(e){t.webkitGetUserMedia(e,i,(function(e){n&&n(l(e))}))}))};if(t.getUserMedia=c.bind(t),t.mediaDevices.getUserMedia){var d=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return o(e,(function(e){return d(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(l(e))}))}))}}}}},{"../utils.js":15}],6:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)};i.shimRTCIceCandidate=c,i.shimMaxMessageSize=d,i.shimSendThrowTypeError=u,i.shimConnectionState=h,i.removeAllowExtmapMixed=f;var r=l(e("sdp")),o=s(e("./utils"));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function l(e){return e&&e.__esModule?e:{default:e}}function c(e){if(!(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var i=new t(e),a=r.default.parseCandidate(e.candidate),o=Object.assign(i,a);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,o.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}}function d(e){if(e.RTCPeerConnection){var t=o.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var i=function(e){if(!e||!e.sdp)return!1;var t=r.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=r.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},n=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var i=parseInt(t[1],10);return i!=i?-1:i},a=function(e){var i=65536;return"firefox"===t.browser&&(i=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),i},s=function(e,i){var n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);var a=r.default.matchPrefix(e.sdp,"a=max-message-size:");return a.length>0?n=parseInt(a[0].substr(19),10):"firefox"===t.browser&&-1!==i&&(n=2147483637),n},l=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.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}),i(arguments[0])){var e=n(arguments[0]),r=a(e),o=s(arguments[0],e),c=void 0;c=0===r&&0===o?Number.POSITIVE_INFINITY:0===r||0===o?Math.max(r,o):Math.min(r,o);var d={};Object.defineProperty(d,"maxMessageSize",{get:function(){return c}}),this._sctp=d}return l.apply(this,arguments)}}}function u(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return i(e,this),e},o.wrapPeerConnectionEvent(e,"datachannel",(function(e){return i(e.channel,e.target),e}))}function i(e,t){var i=e.send;e.send=function(){var n=arguments[0],a=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&a>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return i.apply(e,arguments)}}}function h(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var i=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var i=new Event("connectionstatechange",e);t.dispatchEvent(i)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),i.apply(this,arguments)}}))}}function f(e){if(e.RTCPeerConnection){var t=o.detectBrowser(e);if(!("chrome"===t.browser&&t.version>=71)){var i=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n")),i.apply(this,arguments)}}}}},{"./utils":15,sdp:17}],7:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=i.shimGetUserMedia=void 0;var n=e("./getusermedia");Object.defineProperty(i,"shimGetUserMedia",{enumerable:!0,get:function(){return n.shimGetUserMedia}});var a=e("./getdisplaymedia");Object.defineProperty(i,"shimGetDisplayMedia",{enumerable:!0,get:function(){return a.shimGetDisplayMedia}}),i.shimPeerConnection=d,i.shimReplaceTrack=u;var r=c(e("../utils")),o=e("./filtericeservers"),s=l(e("rtcpeerconnection-shim"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function d(e){var t=r.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var i=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){i.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var n=(0,s.default)(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,o.filterIceServers)(e.iceServers,t.version),r.log("ICE servers after filtering:",e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype}function u(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0}),i.filterIceServers=r;var n=a(e("../utils"));function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function r(e,t){var i=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&n.deprecated("RTCIceServer.url","RTCIceServer.urls");var a="string"==typeof t;return a&&(t=[t]),t=t.filter((function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!i?(i=!0,!0):t&&!i})),delete e.url,e.urls=a?t[0]:t,!!t.length}}))}},{"../utils":15}],9:[function(e,t,i){function n(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=n},{}],10:[function(e,t,i){function n(e){var t=e&&e.navigator,i=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch((function(e){return Promise.reject(i(e))}))}}Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetUserMedia=n},{}],11:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=i.shimGetUserMedia=void 0;var n="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)},r=e("./getusermedia");Object.defineProperty(i,"shimGetUserMedia",{enumerable:!0,get:function(){return r.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(i,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),i.shimOnTrack=d,i.shimPeerConnection=u,i.shimSenderGetStats=h,i.shimReceiverGetStats=f,i.shimRemoveStream=x,i.shimRTCDataChannel=p,i.shimAddTransceiver=m,i.shimCreateOffer=_,i.shimCreateAnswer=g;var s=l(e("../utils"));function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function c(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(e){"object"===(void 0===e?"undefined":n(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function u(e){var t=s.detectBrowser(e);if("object"===(void 0===e?"undefined":n(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var i=e.RTCPeerConnection.prototype[t],n=c({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=n[t]})),t.version<68){var i=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var a={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),i=e[0],n=e[1],o=e[2];return r.apply(this,[i||null]).then((function(e){if(t.version<53&&!n)try{e.forEach((function(e){e.type=a[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,i){e.set(i,Object.assign({},t,{type:a[t.type]||t.type}))}))}return e})).then(n,o)}}}function h(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,i=t.apply(this,[]);return i.forEach((function(t){return t._pc=e})),i});var i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}}function f(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,i=t.apply(this,[]);return i.forEach((function(t){return t._pc=e})),i}),s.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function x(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;s.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(i){i.track&&e.getTracks().includes(i.track)&&t.removeTrack(i)}))})}function p(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function m(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],i=e&&"sendEncodings"in e;i&&e.sendEncodings.forEach((function(e){if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var n=t.apply(this,arguments);if(i){var a=n.sender,r=a.getParameters();"encodings"in r||(r.encodings=e.sendEncodings,this.setParametersPromises.push(a.setParameters(r).catch((function(){}))))}return n})}}function _(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=this,i=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,i)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}}function g(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=this,i=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,i)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}}},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(e,t,i){function n(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(i){if(!i||!i.video){var n=new DOMException("getDisplayMedia without video constraints is undefined");return n.name="NotFoundError",n.code=8,Promise.reject(n)}return!0===i.video?i.video={mediaSource:t}:i.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(i)})}Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=n},{}],13:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)};i.shimGetUserMedia=s;var r=o(e("../utils"));function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function s(e){var t=r.detectBrowser(e),i=e&&e.navigator,a=e&&e.MediaStreamTrack;if(i.getUserMedia=function(e,t,n){r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),i.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in i.mediaDevices.getSupportedConstraints())){var o=function(e,t,i){t in e&&!(i in e)&&(e[i]=e[t],delete e[t])},s=i.mediaDevices.getUserMedia.bind(i.mediaDevices);if(i.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":n(e))&&"object"===n(e.audio)&&(e=JSON.parse(JSON.stringify(e)),o(e.audio,"autoGainControl","mozAutoGainControl"),o(e.audio,"noiseSuppression","mozNoiseSuppression")),s(e)},a&&a.prototype.getSettings){var l=a.prototype.getSettings;a.prototype.getSettings=function(){var e=l.apply(this,arguments);return o(e,"mozAutoGainControl","autoGainControl"),o(e,"mozNoiseSuppression","noiseSuppression"),e}}if(a&&a.prototype.applyConstraints){var c=a.prototype.applyConstraints;a.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":n(e))&&(e=JSON.parse(JSON.stringify(e)),o(e,"autoGainControl","mozAutoGainControl"),o(e,"noiseSuppression","mozNoiseSuppression")),c.apply(this,[e])}}}}},{"../utils":15}],14:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)};i.shimLocalStreamsAPI=s,i.shimRemoteStreamsAPI=l,i.shimCallbacksAPI=c,i.shimGetUserMedia=d,i.shimConstraints=u,i.shimRTCIceServerUrls=h,i.shimTrackEventTransceiver=f,i.shimCreateOfferLegacy=x;var r=o(e("../utils"));function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function s(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var i=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(n){return t.call(i,n,e)})),e.getVideoTracks().forEach((function(n){return t.call(i,n,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){var i=arguments[1];return i&&(this._localStreams?this._localStreams.includes(i)||this._localStreams.push(i):this._localStreams=[i]),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var i=this._localStreams.indexOf(e);if(-1!==i){this._localStreams.splice(i,1);var n=e.getTracks();this.getSenders().forEach((function(e){n.includes(e.track)&&t.removeTrack(e)}))}})}}function l(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var i=new Event("addstream");i.stream=e,t.dispatchEvent(i)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var i=new Event("addstream");i.stream=t,e.dispatchEvent(i)}}))}),t.apply(e,arguments)}}}function c(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,i=t.createOffer,a=t.createAnswer,r=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],a=i.apply(this,[n]);return t?(a.then(e,t),Promise.resolve()):a},t.createAnswer=function(e,t){var i=arguments.length>=2?arguments[2]:arguments[0],n=a.apply(this,[i]);return t?(n.then(e,t),Promise.resolve()):n};var l=function(e,t,i){var n=r.apply(this,[e]);return i?(n.then(t,i),Promise.resolve()):n};t.setLocalDescription=l,l=function(e,t,i){var n=o.apply(this,[e]);return i?(n.then(t,i),Promise.resolve()):n},t.setRemoteDescription=l,l=function(e,t,i){var n=s.apply(this,[e]);return i?(n.then(t,i),Promise.resolve()):n},t.addIceCandidate=l}}function d(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var i=t.mediaDevices,n=i.getUserMedia.bind(i);t.mediaDevices.getUserMedia=function(e){return n(u(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,i,n){t.mediaDevices.getUserMedia(e).then(i,n)}.bind(t))}function u(e){return e&&void 0!==e.video?Object.assign({},e,{video:r.compactObject(e.video)}):e}function h(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,i){if(e&&e.iceServers){for(var n=[],a=0;a<e.iceServers.length;a++){var o=e.iceServers[a];!o.hasOwnProperty("urls")&&o.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),(o=JSON.parse(JSON.stringify(o))).urls=o.url,delete o.url,n.push(o)):n.push(e.iceServers[a])}e.iceServers=n}return new t(e,i)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})}function f(e){"object"===(void 0===e?"undefined":n(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function x(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var i=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&i?"sendrecv"===i.direction?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":"recvonly"===i.direction&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):!0!==e.offerToReceiveAudio||i||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var n=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}}},{"../utils":15}],15:[function(e,t,i){Object.defineProperty(i,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)};function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}i.extractVersion=l,i.wrapPeerConnectionEvent=c,i.disableLog=d,i.disableWarnings=u,i.log=h,i.deprecated=f,i.detectBrowser=x,i.compactObject=m,i.walkStats=_,i.filterStats=g;var o=!0,s=!0;function l(e,t,i){var n=e.match(t);return n&&n.length>=i&&parseInt(n[i],10)}function c(e,t,i){if(e.RTCPeerConnection){var n=e.RTCPeerConnection.prototype,a=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return a.apply(this,arguments);var r=function(e){var t=i(e);t&&n(t)};return this._eventMap=this._eventMap||{},this._eventMap[n]=r,a.apply(this,[e,r])};var r=n.removeEventListener;n.removeEventListener=function(e,i){if(e!==t||!this._eventMap||!this._eventMap[i])return r.apply(this,arguments);var n=this._eventMap[i];return delete this._eventMap[i],r.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}}function d(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":n(e))+". Please use a boolean."):(o=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function u(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":n(e))+". Please use a boolean."):(s=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function h(){if("object"===("undefined"==typeof window?"undefined":n(window))){if(o)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function f(e,t){s&&console.warn(e+" is deprecated, please use "+t+" instead.")}function x(e){var t=e.navigator,i={browser:null,version:null};if(void 0===e||!e.navigator)return i.browser="Not a browser.",i;if(t.mozGetUserMedia)i.browser="firefox",i.version=l(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)i.browser="chrome",i.version=l(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))i.browser="edge",i.version=l(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return i.browser="Not a supported browser.",i;i.browser="safari",i.version=l(t.userAgent,/AppleWebKit\/(\d+)\./,1),i.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return i}function p(e){return"[object Object]"===Object.prototype.toString.call(e)}function m(e){return p(e)?Object.keys(e).reduce((function(t,i){var n=p(e[i]),a=n?m(e[i]):e[i],o=n&&!Object.keys(a).length;return void 0===a||o?t:Object.assign(t,r({},i,a))}),{}):e}function _(e,t,i){t&&!i.has(t.id)&&(i.set(t.id,t),Object.keys(t).forEach((function(n){n.endsWith("Id")?_(e,e.get(t[n]),i):n.endsWith("Ids")&&t[n].forEach((function(t){_(e,e.get(t),i)}))})))}function g(e,t,i){var n=i?"outbound-rtp":"inbound-rtp",a=new Map;if(null===t)return a;var r=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&r.push(e)})),r.forEach((function(t){e.forEach((function(i){i.type===n&&i.trackId===t.id&&_(e,i,a)}))})),a}},{}],16:[function(e,t,i){var n=e("sdp");function a(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}function r(e,t,i,a,r){var o=n.writeRtpDescription(e.kind,t);if(o+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===i?"actpass":r||"active"),o+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var l="msid:"+(a?a.id:"-")+" "+s+"\r\n";o+="a="+l,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+l,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+l,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),o}function o(e,t){var i=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var a="string"==typeof n;return a&&(n=[n]),n=n.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||i?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(i=!0,!0)})),delete e.url,e.urls=a?n[0]:n,!!n.length}}))}function s(e,t){var i={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var i=0;i<t.length;i++)if(t[i].payloadType===e||t[i].preferredPayloadType===e)return t[i]},a=function(e,t,i,a){var r=n(e.parameters.apt,i),o=n(t.parameters.apt,a);return r&&o&&r.name.toLowerCase()===o.name.toLowerCase()};return e.codecs.forEach((function(n){for(var r=0;r<t.codecs.length;r++){var o=t.codecs[r];if(n.name.toLowerCase()===o.name.toLowerCase()&&n.clockRate===o.clockRate){if("rtx"===n.name.toLowerCase()&&n.parameters&&o.parameters.apt&&!a(n,o,e.codecs,t.codecs))continue;(o=JSON.parse(JSON.stringify(o))).numChannels=Math.min(n.numChannels,o.numChannels),i.codecs.push(o),o.rtcpFeedback=o.rtcpFeedback.filter((function(e){for(var t=0;t<n.rtcpFeedback.length;t++)if(n.rtcpFeedback[t].type===e.type&&n.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var n=0;n<t.headerExtensions.length;n++){var a=t.headerExtensions[n];if(e.uri===a.uri){i.headerExtensions.push(a);break}}})),i}function l(e,t,i){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(i)}function c(e,t){var i=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return i||e.addRemoteCandidate(t),!i}function d(e,t){var i=new Error(t);return i.name=e,i.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],i}t.exports=function(e,t){function i(t,i){i.addTrack(t),i.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function u(t,i){i.removeTrack(t),i.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}function h(t,i,n,a){var r=new Event("track");r.track=i,r.receiver=n,r.transceiver={receiver:n},r.streams=a,e.setTimeout((function(){t._dispatchEvent("track",r)}))}var f=function(i){var a=this,r=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){a[e]=r[e].bind(r)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",i=JSON.parse(JSON.stringify(i||{})),this.usingBundle="max-bundle"===i.bundlePolicy,"negotiate"===i.rtcpMuxPolicy)throw d("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(i.rtcpMuxPolicy||(i.rtcpMuxPolicy="require"),i.iceTransportPolicy){case"all":case"relay":break;default:i.iceTransportPolicy="all"}switch(i.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:i.bundlePolicy="balanced"}if(i.iceServers=o(i.iceServers||[],t),this._iceGatherers=[],i.iceCandidatePoolSize)for(var s=i.iceCandidatePoolSize;s>0;s--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:i.iceServers,gatherPolicy:i.iceTransportPolicy}));else i.iceCandidatePoolSize=0;this._config=i,this.transceivers=[],this._sdpSessionId=n.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(f.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(f.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),f.prototype.onicecandidate=null,f.prototype.onaddstream=null,f.prototype.ontrack=null,f.prototype.onremovestream=null,f.prototype.onsignalingstatechange=null,f.prototype.oniceconnectionstatechange=null,f.prototype.onconnectionstatechange=null,f.prototype.onicegatheringstatechange=null,f.prototype.onnegotiationneeded=null,f.prototype.ondatachannel=null,f.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},f.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},f.prototype.getConfiguration=function(){return this._config},f.prototype.getLocalStreams=function(){return this.localStreams},f.prototype.getRemoteStreams=function(){return this.remoteStreams},f.prototype._createTransceiver=function(e,t){var i=this.transceivers.length>0,n={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&i)n.iceTransport=this.transceivers[0].iceTransport,n.dtlsTransport=this.transceivers[0].dtlsTransport;else{var a=this._createIceAndDtlsTransports();n.iceTransport=a.iceTransport,n.dtlsTransport=a.dtlsTransport}return t||this.transceivers.push(n),n},f.prototype.addTrack=function(t,i){if(this._isClosed)throw d("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var n,a=this.transceivers.find((function(e){return e.track===t}));if(a)throw d("InvalidAccessError","Track already exists.");for(var r=0;r<this.transceivers.length;r++)this.transceivers[r].track||this.transceivers[r].kind!==t.kind||(n=this.transceivers[r]);return n||(n=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(i)&&this.localStreams.push(i),n.track=t,n.stream=i,n.rtpSender=new e.RTCRtpSender(t,n.dtlsTransport),n.rtpSender},f.prototype.addStream=function(e){var i=this;if(t>=15025)e.getTracks().forEach((function(t){i.addTrack(t,e)}));else{var n=e.clone();e.getTracks().forEach((function(e,t){var i=n.getTracks()[t];e.addEventListener("enabled",(function(e){i.enabled=e.enabled}))})),n.getTracks().forEach((function(e){i.addTrack(e,n)}))}},f.prototype.removeTrack=function(t){if(this._isClosed)throw d("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var i=this.transceivers.find((function(e){return e.rtpSender===t}));if(!i)throw d("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(e){return e.stream}));-1===a.indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},f.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var i=t.getSenders().find((function(t){return t.track===e}));i&&t.removeTrack(i)}))},f.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},f.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},f.prototype._createIceGatherer=function(t,i){var n=this;if(i&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var a=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(a,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var i=!e.candidate||0===Object.keys(e.candidate).length;a.state=i?"completed":"gathering",null!==n.transceivers[t].bufferedCandidateEvents&&n.transceivers[t].bufferedCandidateEvents.push(e)},a.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),a},f.prototype._gather=function(t,i){var a=this,r=this.transceivers[i].iceGatherer;if(!r.onlocalcandidate){var o=this.transceivers[i].bufferedCandidateEvents;this.transceivers[i].bufferedCandidateEvents=null,r.removeEventListener("localcandidate",this.transceivers[i].bufferCandidates),r.onlocalcandidate=function(e){if(!(a.usingBundle&&i>0)){var o=new Event("icecandidate");o.candidate={sdpMid:t,sdpMLineIndex:i};var s=e.candidate,l=!s||0===Object.keys(s).length;if(l)"new"!==r.state&&"gathering"!==r.state||(r.state="completed");else{"new"===r.state&&(r.state="gathering"),s.component=1,s.ufrag=r.getLocalParameters().usernameFragment;var c=n.writeCandidate(s);o.candidate=Object.assign(o.candidate,n.parseCandidate(c)),o.candidate.candidate=c,o.candidate.toJSON=function(){return{candidate:o.candidate.candidate,sdpMid:o.candidate.sdpMid,sdpMLineIndex:o.candidate.sdpMLineIndex,usernameFragment:o.candidate.usernameFragment}}}var d=n.getMediaSections(a._localDescription.sdp);d[o.candidate.sdpMLineIndex]+=l?"a=end-of-candidates\r\n":"a="+o.candidate.candidate+"\r\n",a._localDescription.sdp=n.getDescription(a._localDescription.sdp)+d.join("");var u=a.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==a.iceGatheringState&&(a.iceGatheringState="gathering",a._emitGatheringStateChange()),l||a._dispatchEvent("icecandidate",o),u&&(a._dispatchEvent("icecandidate",new Event("icecandidate")),a.iceGatheringState="complete",a._emitGatheringStateChange())}},e.setTimeout((function(){o.forEach((function(e){r.onlocalcandidate(e)}))}),0)}},f.prototype._createIceAndDtlsTransports=function(){var t=this,i=new e.RTCIceTransport(null);i.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var n=new e.RTCDtlsTransport(i);return n.ondtlsstatechange=function(){t._updateConnectionState()},n.onerror=function(){Object.defineProperty(n,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:i,dtlsTransport:n}},f.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var i=this.transceivers[e].iceTransport;i&&(delete i.onicestatechange,delete this.transceivers[e].iceTransport);var n=this.transceivers[e].dtlsTransport;n&&(delete n.ondtlsstatechange,delete n.onerror,delete this.transceivers[e].dtlsTransport)},f.prototype._transceive=function(e,i,a){var r=s(e.localCapabilities,e.remoteCapabilities);i&&e.rtpSender&&(r.encodings=e.sendEncodingParameters,r.rtcp={cname:n.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(r.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(r)),a&&e.rtpReceiver&&r.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?r.encodings=e.recvEncodingParameters:r.encodings=[{}],r.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(r.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(r.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(r))},f.prototype.setLocalDescription=function(e){var t,i,a=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(d("TypeError",'Unsupported type "'+e.type+'"'));if(!l("setLocalDescription",e.type,a.signalingState)||a._isClosed)return Promise.reject(d("InvalidStateError","Can not set local "+e.type+" in state "+a.signalingState));if("offer"===e.type)t=n.splitSections(e.sdp),i=t.shift(),t.forEach((function(e,t){var i=n.parseRtpParameters(e);a.transceivers[t].localCapabilities=i})),a.transceivers.forEach((function(e,t){a._gather(e.mid,t)}));else if("answer"===e.type){t=n.splitSections(a._remoteDescription.sdp),i=t.shift();var r=n.matchPrefix(i,"a=ice-lite").length>0;t.forEach((function(e,t){var o=a.transceivers[t],l=o.iceGatherer,c=o.iceTransport,d=o.dtlsTransport,u=o.localCapabilities,h=o.remoteCapabilities;if(!(n.isRejected(e)&&0===n.matchPrefix(e,"a=bundle-only").length||o.rejected)){var f=n.getIceParameters(e,i),x=n.getDtlsParameters(e,i);r&&(x.role="server"),a.usingBundle&&0!==t||(a._gather(o.mid,t),"new"===c.state&&c.start(l,f,r?"controlling":"controlled"),"new"===d.state&&d.start(x));var p=s(u,h);a._transceive(o,p.codecs.length>0,!1)}}))}return a._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?a._updateSignalingState("have-local-offer"):a._updateSignalingState("stable"),Promise.resolve()},f.prototype.setRemoteDescription=function(a){var r=this;if(-1===["offer","answer"].indexOf(a.type))return Promise.reject(d("TypeError",'Unsupported type "'+a.type+'"'));if(!l("setRemoteDescription",a.type,r.signalingState)||r._isClosed)return Promise.reject(d("InvalidStateError","Can not set remote "+a.type+" in state "+r.signalingState));var o={};r.remoteStreams.forEach((function(e){o[e.id]=e}));var f=[],x=n.splitSections(a.sdp),p=x.shift(),m=n.matchPrefix(p,"a=ice-lite").length>0,_=n.matchPrefix(p,"a=group:BUNDLE ").length>0;r.usingBundle=_;var g=n.matchPrefix(p,"a=ice-options:")[0];return r.canTrickleIceCandidates=!!g&&g.substr(14).split(" ").indexOf("trickle")>=0,x.forEach((function(l,d){var h=n.splitLines(l),x=n.getKind(l),g=n.isRejected(l)&&0===n.matchPrefix(l,"a=bundle-only").length,v=h[0].substr(2).split(" ")[2],y=n.getDirection(l,p),S=n.parseMsid(l),b=n.getMid(l)||n.generateIdentifier();if(g||"application"===x&&("DTLS/SCTP"===v||"UDP/DTLS/SCTP"===v))r.transceivers[d]={mid:b,kind:x,protocol:v,rejected:!0};else{var P,E,C,T,R,w,I,D,k;!g&&r.transceivers[d]&&r.transceivers[d].rejected&&(r.transceivers[d]=r._createTransceiver(x,!0));var F,A,M=n.parseRtpParameters(l);g||(F=n.getIceParameters(l,p),(A=n.getDtlsParameters(l,p)).role="client"),I=n.parseRtpEncodingParameters(l);var L=n.parseRtcpParameters(l),B=n.matchPrefix(l,"a=end-of-candidates",p).length>0,O=n.matchPrefix(l,"a=candidate:").map((function(e){return n.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===a.type||"answer"===a.type)&&!g&&_&&d>0&&r.transceivers[d]&&(r._disposeIceAndDtlsTransports(d),r.transceivers[d].iceGatherer=r.transceivers[0].iceGatherer,r.transceivers[d].iceTransport=r.transceivers[0].iceTransport,r.transceivers[d].dtlsTransport=r.transceivers[0].dtlsTransport,r.transceivers[d].rtpSender&&r.transceivers[d].rtpSender.setTransport(r.transceivers[0].dtlsTransport),r.transceivers[d].rtpReceiver&&r.transceivers[d].rtpReceiver.setTransport(r.transceivers[0].dtlsTransport)),"offer"!==a.type||g){if("answer"===a.type&&!g){E=(P=r.transceivers[d]).iceGatherer,C=P.iceTransport,T=P.dtlsTransport,R=P.rtpReceiver,w=P.sendEncodingParameters,D=P.localCapabilities,r.transceivers[d].recvEncodingParameters=I,r.transceivers[d].remoteCapabilities=M,r.transceivers[d].rtcpParameters=L,O.length&&"new"===C.state&&(!m&&!B||_&&0!==d?O.forEach((function(e){c(P.iceTransport,e)})):C.setRemoteCandidates(O)),_&&0!==d||("new"===C.state&&C.start(E,F,"controlling"),"new"===T.state&&T.start(A));var j=s(P.localCapabilities,P.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length;!j&&P.sendEncodingParameters[0].rtx&&delete P.sendEncodingParameters[0].rtx,r._transceive(P,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!R||"sendrecv"!==y&&"sendonly"!==y?delete P.rtpReceiver:(k=R.track,S?(o[S.stream]||(o[S.stream]=new e.MediaStream),i(k,o[S.stream]),f.push([k,R,o[S.stream]])):(o.default||(o.default=new e.MediaStream),i(k,o.default),f.push([k,R,o.default])))}}else{(P=r.transceivers[d]||r._createTransceiver(x)).mid=b,P.iceGatherer||(P.iceGatherer=r._createIceGatherer(d,_)),O.length&&"new"===P.iceTransport.state&&(!B||_&&0!==d?O.forEach((function(e){c(P.iceTransport,e)})):P.iceTransport.setRemoteCandidates(O)),D=e.RTCRtpReceiver.getCapabilities(x),t<15019&&(D.codecs=D.codecs.filter((function(e){return"rtx"!==e.name}))),w=P.sendEncodingParameters||[{ssrc:1001*(2*d+2)}];var N,U=!1;"sendrecv"===y||"sendonly"===y?(U=!P.rtpReceiver,R=P.rtpReceiver||new e.RTCRtpReceiver(P.dtlsTransport,x),U&&(k=R.track,S&&"-"===S.stream||(S?(o[S.stream]||(o[S.stream]=new e.MediaStream,Object.defineProperty(o[S.stream],"id",{get:function(){return S.stream}})),Object.defineProperty(k,"id",{get:function(){return S.track}}),N=o[S.stream]):(o.default||(o.default=new e.MediaStream),N=o.default)),N&&(i(k,N),P.associatedRemoteMediaStreams.push(N)),f.push([k,R,N]))):P.rtpReceiver&&P.rtpReceiver.track&&(P.associatedRemoteMediaStreams.forEach((function(e){var t=e.getTracks().find((function(e){return e.id===P.rtpReceiver.track.id}));t&&u(t,e)})),P.associatedRemoteMediaStreams=[]),P.localCapabilities=D,P.remoteCapabilities=M,P.rtpReceiver=R,P.rtcpParameters=L,P.sendEncodingParameters=w,P.recvEncodingParameters=I,r._transceive(r.transceivers[d],!1,U)}}})),void 0===r._dtlsRole&&(r._dtlsRole="offer"===a.type?"active":"passive"),r._remoteDescription={type:a.type,sdp:a.sdp},"offer"===a.type?r._updateSignalingState("have-remote-offer"):r._updateSignalingState("stable"),Object.keys(o).forEach((function(t){var i=o[t];if(i.getTracks().length){if(-1===r.remoteStreams.indexOf(i)){r.remoteStreams.push(i);var n=new Event("addstream");n.stream=i,e.setTimeout((function(){r._dispatchEvent("addstream",n)}))}f.forEach((function(e){var t=e[0],n=e[1];i.id===e[2].id&&h(r,t,n,[i])}))}})),f.forEach((function(e){e[2]||h(r,e[0],e[1],[])})),e.setTimeout((function(){r&&r.transceivers&&r.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},f.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},f.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},f.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},f.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var i=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",i)}},f.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var i=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",i)}},f.prototype.createOffer=function(){var i=this;if(i._isClosed)return Promise.reject(d("InvalidStateError","Can not call createOffer after close"));var a=i.transceivers.filter((function(e){return"audio"===e.kind})).length,o=i.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(a=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(o=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(i.transceivers.forEach((function(e){"audio"===e.kind?--a<0&&(e.wantReceive=!1):"video"===e.kind&&--o<0&&(e.wantReceive=!1)}));a>0||o>0;)a>0&&(i._createTransceiver("audio"),a--),o>0&&(i._createTransceiver("video"),o--);var l=n.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.transceivers.forEach((function(a,r){var o=a.track,s=a.kind,l=a.mid||n.generateIdentifier();a.mid=l,a.iceGatherer||(a.iceGatherer=i._createIceGatherer(r,i.usingBundle));var c=e.RTCRtpSender.getCapabilities(s);t<15019&&(c.codecs=c.codecs.filter((function(e){return"rtx"!==e.name}))),c.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),a.remoteCapabilities&&a.remoteCapabilities.codecs&&a.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),c.headerExtensions.forEach((function(e){(a.remoteCapabilities&&a.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var d=a.sendEncodingParameters||[{ssrc:1001*(2*r+1)}];o&&t>=15019&&"video"===s&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),a.wantReceive&&(a.rtpReceiver=new e.RTCRtpReceiver(a.dtlsTransport,s)),a.localCapabilities=c,a.sendEncodingParameters=d})),"max-compat"!==i._config.bundlePolicy&&(l+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),l+="a=ice-options:trickle\r\n",i.transceivers.forEach((function(e,t){l+=r(e,e.localCapabilities,"offer",e.stream,i._dtlsRole),l+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===i.iceGatheringState||0!==t&&i.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,l+="a="+n.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(l+="a=end-of-candidates\r\n"))}));var c=new e.RTCSessionDescription({type:"offer",sdp:l});return Promise.resolve(c)},f.prototype.createAnswer=function(){var i=this;if(i._isClosed)return Promise.reject(d("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==i.signalingState&&"have-local-pranswer"!==i.signalingState)return Promise.reject(d("InvalidStateError","Can not call createAnswer in signalingState "+i.signalingState));var a=n.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.usingBundle&&(a+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var o=n.getMediaSections(i._remoteDescription.sdp).length;i.transceivers.forEach((function(e,n){if(!(n+1>o)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var l;e.stream&&("audio"===e.kind?l=e.stream.getAudioTracks()[0]:"video"===e.kind&&(l=e.stream.getVideoTracks()[0]),l&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var c=s(e.localCapabilities,e.remoteCapabilities),d=c.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length;!d&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=r(e,c,"answer",e.stream,i._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var l=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(l)},f.prototype.addIceCandidate=function(e){var t,i=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(a,r){if(!i._remoteDescription)return r(d("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var o=e.sdpMLineIndex;if(e.sdpMid)for(var s=0;s<i.transceivers.length;s++)if(i.transceivers[s].mid===e.sdpMid){o=s;break}var l=i.transceivers[o];if(!l)return r(d("OperationError","Can not add ICE candidate"));if(l.rejected)return a();var u=Object.keys(e.candidate).length>0?n.parseCandidate(e.candidate):{};if("tcp"===u.protocol&&(0===u.port||9===u.port))return a();if(u.component&&1!==u.component)return a();if((0===o||o>0&&l.iceTransport!==i.transceivers[0].iceTransport)&&!c(l.iceTransport,u))return r(d("OperationError","Can not add ICE candidate"));var h=e.candidate.trim();0===h.indexOf("a=")&&(h=h.substr(2)),(t=n.getMediaSections(i._remoteDescription.sdp))[o]+="a="+(u.type?h:"end-of-candidates")+"\r\n",i._remoteDescription.sdp=n.getDescription(i._remoteDescription.sdp)+t.join("")}else for(var f=0;f<i.transceivers.length&&(i.transceivers[f].rejected||(i.transceivers[f].iceTransport.addRemoteCandidate({}),(t=n.getMediaSections(i._remoteDescription.sdp))[f]+="a=end-of-candidates\r\n",i._remoteDescription.sdp=n.getDescription(i._remoteDescription.sdp)+t.join(""),!i.usingBundle));f++);a()}))},f.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var i=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?i=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(i=e.rtpReceiver)})),!i)throw d("InvalidAccessError","Invalid selector.");return i.getStats()}var n=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&n.push(e[t].getStats())}))})),Promise.all(n).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var i=e[t];if(i&&i.prototype&&i.prototype.getStats){var n=i.prototype.getStats;i.prototype.getStats=function(){return n.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(i){e[i].type=a(e[i]),t.set(i,e[i])})),t}))}}}));var x=["createOffer","createAnswer"];return x.forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(x=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),f}},{sdp:17}],17:[function(e,t,i){var n={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},n.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},n.getDescription=function(e){var t=n.splitSections(e);return t&&t[0]},n.getMediaSections=function(e){var t=n.splitSections(e);return t.shift(),t},n.matchPrefix=function(e,t){return n.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},n.parseCandidate=function(e){for(var t,i={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},n=8;n<t.length;n+=2)switch(t[n]){case"raddr":i.relatedAddress=t[n+1];break;case"rport":i.relatedPort=parseInt(t[n+1],10);break;case"tcptype":i.tcpType=t[n+1];break;case"ufrag":i.ufrag=t[n+1],i.usernameFragment=t[n+1];break;default:i[t[n]]=t[n+1]}return i},n.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},n.parseIceOptions=function(e){return e.substr(14).split(" ")},n.parseRtpMap=function(e){var t=e.substr(9).split(" "),i={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),i.name=t[0],i.clockRate=parseInt(t[1],10),i.channels=3===t.length?parseInt(t[2],10):1,i.numChannels=i.channels,i},n.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var i=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==i?"/"+i:"")+"\r\n"},n.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},n.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},n.parseFmtp=function(e){for(var t,i={},n=e.substr(e.indexOf(" ")+1).split(";"),a=0;a<n.length;a++)i[(t=n[a].trim().split("="))[0].trim()]=t[1];return i},n.writeFmtp=function(e){var t="",i=e.payloadType;if(void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var n=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+i+" "+n.join(";")+"\r\n"}return t},n.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},n.writeRtcpFb=function(e){var t="",i=e.payloadType;return void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+i+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},n.parseSsrcMedia=function(e){var t=e.indexOf(" "),i={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(i.attribute=e.substr(t+1,n-t-1),i.value=e.substr(n+1)):i.attribute=e.substr(t+1),i},n.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},n.getMid=function(e){var t=n.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},n.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},n.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:n.matchPrefix(e+t,"a=fingerprint:").map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,t){var i="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){i+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),i},n.getIceParameters=function(e,t){var i=n.splitLines(e);return{usernameFragment:(i=i.concat(n.splitLines(t))).filter((function(e){return 0===e.indexOf("a=ice-ufrag:")}))[0].substr(12),password:i.filter((function(e){return 0===e.indexOf("a=ice-pwd:")}))[0].substr(10)}},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=n.splitLines(e)[0].split(" "),a=3;a<i.length;a++){var r=i[a],o=n.matchPrefix(e,"a=rtpmap:"+r+" ")[0];if(o){var s=n.parseRtpMap(o),l=n.matchPrefix(e,"a=fmtp:"+r+" ");switch(s.parameters=l.length?n.parseFmtp(l[0]):{},s.rtcpFeedback=n.matchPrefix(e,"a=rtcp-fb:"+r+" ").map(n.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return n.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(n.parseExtmap(e))})),t},n.writeRtpDescription=function(e,t){var i="";i+="m="+e+" ",i+=t.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){i+=n.writeRtpMap(e),i+=n.writeFmtp(e),i+=n.writeRtcpFb(e)}));var a=0;return t.codecs.forEach((function(e){e.maxptime>a&&(a=e.maxptime)})),a>0&&(i+="a=maxptime:"+a+"\r\n"),i+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){i+=n.writeExtmap(e)})),i},n.parseRtpEncodingParameters=function(e){var t,i=[],a=n.parseRtpParameters(e),r=-1!==a.fecMechanisms.indexOf("RED"),o=-1!==a.fecMechanisms.indexOf("ULPFEC"),s=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),l=s.length>0&&s[0].ssrc,c=n.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));c.length>0&&c[0].length>1&&c[0][0]===l&&(t=c[0][1]),a.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:l,codecPayloadType:parseInt(e.parameters.apt,10)};l&&t&&(n.rtx={ssrc:t}),i.push(n),r&&((n=JSON.parse(JSON.stringify(n))).fec={ssrc:l,mechanism:o?"red+ulpfec":"red"},i.push(n))}})),0===i.length&&l&&i.push({ssrc:l});var d=n.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,i.forEach((function(e){e.maxBitrate=d}))),i},n.parseRtcpParameters=function(e){var t={},i=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];i&&(t.cname=i.value,t.ssrc=i.ssrc);var a=n.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=a.length>0,t.compound=0===a.length;var r=n.matchPrefix(e,"a=rtcp-mux");return t.mux=r.length>0,t},n.parseMsid=function(e){var t,i=n.matchPrefix(e,"a=msid:");if(1===i.length)return{stream:(t=i[0].substr(7).split(" "))[0],track:t[1]};var a=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return a.length>0?{stream:(t=a[0].value.split(" "))[0],track:t[1]}:void 0},n.parseSctpDescription=function(e){var t,i=n.parseMLine(e),a=n.matchPrefix(e,"a=max-message-size:");a.length>0&&(t=parseInt(a[0].substr(19),10)),isNaN(t)&&(t=65536);var r=n.matchPrefix(e,"a=sctp-port:");if(r.length>0)return{port:parseInt(r[0].substr(12),10),protocol:i.fmt,maxMessageSize:t};if(n.matchPrefix(e,"a=sctpmap:").length>0){var o=n.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(o[0],10),protocol:o[1],maxMessageSize:t}}},n.writeSctpDescription=function(e,t){var i=[];return i="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&i.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),i.join("")},n.generateSessionId=function(){return Math.random().toString().substr(2,21)},n.writeSessionBoilerplate=function(e,t,i){var a=void 0!==t?t:2;return"v=0\r\no="+(i||"thisisadapterortc")+" "+(e||n.generateSessionId())+" "+a+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,t,i,a){var r=n.writeRtpDescription(e.kind,t);if(r+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),r+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===i?"actpass":"active"),r+="a=mid:"+e.mid+"\r\n",e.direction?r+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?r+="a=sendrecv\r\n":e.rtpSender?r+="a=sendonly\r\n":e.rtpReceiver?r+="a=recvonly\r\n":r+="a=inactive\r\n",e.rtpSender){var o="msid:"+a.id+" "+e.rtpSender.track.id+"\r\n";r+="a="+o,r+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+o,e.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+o,r+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return r+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),r},n.getDirection=function(e,t){for(var i=n.splitLines(e),a=0;a<i.length;a++)switch(i[a]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[a].substr(2)}return t?n.getDirection(t):"sendrecv"},n.getKind=function(e){return n.splitLines(e)[0].split(" ")[0].substr(2)},n.isRejected=function(e){return"0"===e.split(" ",2)[1]},n.parseMLine=function(e){var t=n.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},n.parseOLine=function(e){var t=n.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},n.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=n.splitLines(e),i=0;i<t.length;i++)if(t[i].length<2||"="!==t[i].charAt(1))return!1;return!0},"object"===a(t)&&(t.exports=n)},{}]},{},[1])(1)}({exports:{}}),re.sessions={},re.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){var e=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),t=33;return window.navigator.userAgent.match("Linux")&&(t=35),e>=26&&e<=t||re.extension.isInstalled()}return!0};var ae={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(e){var t=window.setTimeout((function(){var t=new Error("NavigatorUserMediaError");return t.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',e(t)}),1e3);this.cache[t]=e,window.postMessage({type:"janusGetScreen",id:t},"*")},init:function(){var e={};this.cache=e,window.addEventListener("message",(function(t){if(t.origin==window.location.origin)if("janusGotScreen"==t.data.type&&e[t.data.id]){var i=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var n=new Error("NavigatorUserMediaError");n.name="You cancelled the request for permission, giving up...",i(n)}else i(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&(console.log("clearing ",t.data.id),window.clearTimeout(t.data.id))}))}};function re(e){if(void 0===re.initDone)return e.error("Library not initialized"),{};if(!re.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(re.log("Library initialized: "+re.initDone),(e=e||{}).success="function"==typeof e.success?e.success:re.noop,e.error="function"==typeof e.error?e.error:re.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:re.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var t=!1,i=null,n={},r=null,o=null,s=0,l=e.server;re.isArray(l)?(re.log("Multiple servers provided ("+l.length+"), will use the first that works"),l=null,o=e.server,re.debug(o)):0===l.indexOf("ws")?(t=!0,re.log("Using WebSockets to contact Janus: "+l)):(t=!1,re.log("Using REST API to contact Janus: "+l));var c=e.iceServers;null==c&&(c=[{urls:"stun:stun.l.google.com:19302"}]);var d=e.iceTransportPolicy,u=e.bundlePolicy,h=e.ipv6;null==h&&(h=!1);var f=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(f=!0===e.withCredentials);var x=10;void 0!==e.max_poll_events&&null!==e.max_poll_events&&(x=e.max_poll_events),x<1&&(x=1);var p=null;void 0!==e.token&&null!==e.token&&(p=e.token);var m=null;void 0!==e.apisecret&&null!==e.apisecret&&(m=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var _=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(_=e.keepAlivePeriod),isNaN(_)&&(_=25e3);var g=6e4;function v(e){var t={high:9e5,medium:3e5,low:1e5};return null!=e&&(e.high&&(t.high=e.high),e.medium&&(t.medium=e.medium),e.low&&(t.low=e.low)),t}void 0!==e.longPollTimeout&&null!==e.longPollTimeout&&(g=e.longPollTimeout),isNaN(g)&&(g=6e4);var y=!1,S=null,b={},P=this,E=0,C={};function T(){if(null!=S)if(re.debug("Long poll..."),y){var t=l+"/"+S+"?rid="+(new Date).getTime();null!=x&&(t=t+"&maxev="+x),null!=p&&(t=t+"&token="+encodeURIComponent(p)),null!=m&&(t=t+"&apisecret="+encodeURIComponent(m)),re.httpAPICall(t,{verb:"GET",withCredentials:f,success:R,timeout:g,error:function(t,i){if(re.error(t+":",i),++E>3)return y=!1,void e.error("Lost connection to the server (is it down?)");T()}})}else re.warn("Is the server down? (connected=false)")}function R(e,n){if(E=0,t||null==S||!0===n||T(),t||!re.isArray(e))if("keepalive"!==e.rtcgw)if("ack"!==e.rtcgw)if("success"!==e.rtcgw)if("trickle"===e.rtcgw){if(null==(l=e.sender))return void re.warn("Missing sender...");if(null==(d=b[l]))return void re.debug("This handle is not attached to this session");var a=e.candidate;re.debug("Got a trickled candidate on session "+S),re.debug(a);var r=d.webrtcStuff;r.pc&&r.remoteSdp?(re.debug("Adding remote candidate:",a),a&&!0!==a.completed?r.pc.addIceCandidate(a):r.pc.addIceCandidate(re.endOfCandidates)):(re.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),r.candidates||(r.candidates=[]),r.candidates.push(a),re.debug(r.candidates))}else{if("webrtcup"===e.rtcgw)return re.debug("Got a webrtcup event on session "+S),re.debug(e),null==(l=e.sender)?void re.warn("Missing sender..."):null==(d=b[l])?void re.debug("This handle is not attached to this session"):void d.webrtcState(!0);if("hangup"===e.rtcgw){if(re.debug("Got a hangup event on session "+S),re.debug(e),null==(l=e.sender))return void re.warn("Missing sender...");if(null==(d=b[l]))return void re.debug("This handle is not attached to this session");d.webrtcState(!1,e.reason),d.hangup()}else if("detached"===e.rtcgw){if(re.debug("Got a detached event on session "+S),re.debug(e),null==(l=e.sender))return void re.warn("Missing sender...");if(null==(d=b[l]))return;d.detached=!0,d.ondetached(),d.detach()}else if("media"===e.rtcgw){if(re.debug("Got a media event on session "+S),re.debug(e),null==(l=e.sender))return void re.warn("Missing sender...");if(null==(d=b[l]))return void re.debug("This handle is not attached to this session");d.mediaState(e.type,e.receiving)}else if("slowlink"===e.rtcgw){if(re.debug("Got a slowlink event on session "+S),re.debug(e),null==(l=e.sender))return void re.warn("Missing sender...");if(null==(d=b[l]))return void re.debug("This handle is not attached to this session");d.slowLink(e.uplink,e.lost)}else{if("error"===e.rtcgw){var o,s;if(re.error("Ooops: "+e.error.code+" "+e.error.reason),re.debug(e),null!=(o=e.transaction))null!=(s=C[o])&&s(e),delete C[o];return}if("event"===e.rtcgw){var l;if(re.debug("Got a plugin event on session "+S),re.debug(e),null==(l=e.sender))return void re.warn("Missing sender...");var c=e.plugindata;if(null==c)return void re.warn("Missing plugindata...");re.debug("  -- Event is coming from "+l+" ("+c.plugin+")");var d,u=c.data;if(re.debug(u),null==(d=b[l]))return void re.warn("This handle is not attached to this session");var h=e.jsep;null!=h&&(re.debug("Handling SDP as well..."),re.debug(h));var f=d.onmessage;null!=f?(re.debug("Notifying application..."),f(u,h)):re.debug("No provided notification callback")}else{if("timeout"===e.rtcgw)return re.error("Timeout on session "+S),re.debug(e),void(t&&i.close(3504,"Gateway timeout"));re.warn("Unknown message/event  '"+e.rtcgw+"' on session "+S),re.debug(e)}}}else re.debug("Got a success on session "+S),re.debug(e),null!=(o=e.transaction)&&(null!=(s=C[o])&&s(e),delete C[o]);else re.debug("Got an ack on session "+S),re.debug(e),null!=(o=e.transaction)&&(null!=(s=C[o])&&s(e),delete C[o]);else re.vdebug("Got a keepalive on session "+S);else for(var x=0;x<e.length;x++)R(e[x],!0)}function w(){if(null!==l&&t&&y){r=setTimeout(w,_);var e={rtcgw:"keepalive",session_id:S,transaction:re.randomString(12)};null!=p&&(e.token=p),null!=m&&(e.apisecret=m),i.send(JSON.stringify(e))}}function I(a){var c=re.randomString(12),d={rtcgw:"create",transaction:c,token:window.EZUIKit.opt.stream,device:window.EZUIKit.opt.deviceSerial,channel:window.EZUIKit.opt.channelNo};if(a.reconnect&&(y=!1,d.rtcgw="claim",d.session_id=S,i&&(i.onopen=null,i.onerror=null,i.onclose=null,r&&(clearTimeout(r),r=null))),null!=p&&(d.token=p),null!=m&&(d.apisecret=m),null===l&&re.isArray(o)&&(0===(l=o[s]).indexOf("ws")?(t=!0,re.log("Server #"+(s+1)+": trying WebSockets to contact Janus ("+l+")")):(t=!1,re.log("Server #"+(s+1)+": trying REST API to contact Janus ("+l+")"))),t)for(var u in i=re.newWebSocket(l,"rtcgw-protocol"),n={error:function(){if(re.error("Error connecting to the Janus WebSockets server... "+l),re.isArray(o)&&!a.reconnect)return++s==o.length?void a.error("Error connecting to any of the provided Janus servers: Is the server down?"):(l=null,void setTimeout((function(){I(a)}),200));a.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){C[c]=function(e){if(re.debug(e),"success"!==e.rtcgw)return re.error("Ooops: "+e.error.code+" "+e.error.reason),void a.error(e.error.reason);r=setTimeout(w,_),y=!0,S=e.session_id?e.session_id:e.data.id,a.reconnect?re.log("Claimed session: "+S):re.log("Created session: "+S),re.sessions[S]=P,a.success()},i.send(JSON.stringify(d))},message:function(e){R(JSON.parse(e.data))},close:function(){null!==l&&y&&(y=!1,e.error("Lost connection to the server (is it down?)"))}})i.addEventListener(u,n[u]);else re.httpAPICall(l,{verb:"POST",withCredentials:f,body:d,success:function(e){if(re.debug(e),"success"!==e.rtcgw)return re.error("Ooops: "+e.error.code+" "+e.error.reason),void a.error(e.error.reason);y=!0,S=e.session_id?e.session_id:e.data.id,a.reconnect?re.log("Claimed session: "+S):re.log("Created session: "+S),re.sessions[S]=P,T(),a.success()},error:function(e,t){if(re.error(e+":",t),re.isArray(o)&&!a.reconnect)return++s==o.length?void a.error("Error connecting to any of the provided Janus servers: Is the server down?"):(l=null,void setTimeout((function(){I(a)}),200));""===t?a.error(e+": Is the server down?"):a.error(e+": "+t)}})}function D(e,n){if((n=n||{}).success="function"==typeof n.success?n.success:re.noop,n.error="function"==typeof n.error?n.error:re.noop,!y)return re.warn("Is the server down? (connected=false)"),void n.error("Is the server down? (connected=false)");var a=b[e];if(null==a||null===a.webrtcStuff||void 0===a.webrtcStuff)return re.warn("Invalid handle"),void n.error("Invalid handle");var r=n.message,o=n.jsep,s=re.randomString(12),c={rtcgw:"message",body:r,transaction:s};if(null!==a.token&&void 0!==a.token&&(c.token=a.token),null!=m&&(c.apisecret=m),null!=o&&(c.jsep=o),re.debug("Sending message to plugin (handle="+e+"):"),re.debug(c),t)return c.session_id=S,c.handle_id=e,C[s]=function(e){if(re.debug("Message sent!"),re.debug(e),"success"===e.rtcgw){var t=e.plugindata;if(null==t)return re.warn("Request succeeded, but missing plugindata..."),void n.success();re.log("Synchronous transaction successful ("+t.plugin+")");var i=t.data;return re.debug(i),void n.success(i)}"ack"===e.rtcgw?n.success():void 0!==e.error&&null!==e.error?(re.error("Ooops: "+e.error.code+" "+e.error.reason),n.error(e.error.code+" "+e.error.reason)):(re.error("Unknown error"),n.error("Unknown error"))},void i.send(JSON.stringify(c));re.httpAPICall(l+"/"+S+"/"+e,{verb:"POST",withCredentials:f,body:c,success:function(e){if(re.debug("Message sent!"),re.debug(e),"success"===e.rtcgw){var t=e.plugindata;if(null==t)return re.warn("Request succeeded, but missing plugindata..."),void n.success();re.log("Synchronous transaction successful ("+t.plugin+")");var i=t.data;return re.debug(i),void n.success(i)}"ack"===e.rtcgw?n.success():void 0!==e.error&&null!==e.error?(re.error("Ooops: "+e.error.code+" "+e.error.reason),n.error(e.error.code+" "+e.error.reason)):(re.error("Unknown error"),n.error("Unknown error"))},error:function(e,t){re.error(e+":",t),n.error(e+": "+t)}})}function k(e,n){if(y){var a=b[e];if(null!=a&&null!==a.webrtcStuff&&void 0!==a.webrtcStuff){var r={rtcgw:"trickle",candidate:n,transaction:re.randomString(12)};if(null!==a.token&&void 0!==a.token&&(r.token=a.token),null!=m&&(r.apisecret=m),re.vdebug("Sending trickle candidate (handle="+e+"):"),re.vdebug(r),t)return r.session_id=S,r.handle_id=e,void i.send(JSON.stringify(r));re.httpAPICall(l+"/"+S+"/"+e,{verb:"POST",withCredentials:f,body:r,success:function(e){re.vdebug("Candidate sent!"),re.vdebug(e),"ack"===e.rtcgw||re.error("Ooops: "+e.error.code+" "+e.error.reason)},error:function(e,t){re.error(e+":",t)}})}else re.warn("Invalid handle")}else re.warn("Is the server down? (connected=false)")}function F(e,t,i,n){var a=b[e];if(null!=a&&null!==a.webrtcStuff&&void 0!==a.webrtcStuff){var r=a.webrtcStuff,o=function(e){re.log("Received state change on data channel:",e);var t=e.target.label,i=r.dataChannel[t]?r.dataChannel[t].readyState:"null";if(re.log("State change on <"+t+"> data channel: "+i),"open"===i){if(r.dataChannel[t].pending&&r.dataChannel[t].pending.length>0){for(var n in re.log("Sending pending messages on <"+t+">:",r.dataChannel[t].pending.length),r.dataChannel[t].pending){var o=r.dataChannel[t].pending[n];re.log("Sending string on data channel <"+t+">: "+o),r.dataChannel[t].send(o)}r.dataChannel[t].pending=[]}a.ondataopen(t)}};r.dataChannel[t]=i||r.pc.createDataChannel(t,{ordered:!1}),r.dataChannel[t].onmessage=function(e){re.log("Received message on data channel:",e);var t=e.target.label;a.ondata(e.data,t)},r.dataChannel[t].onopen=o,r.dataChannel[t].onclose=o,r.dataChannel[t].onerror=function(e){re.error("Got error on data channel:",e)},r.dataChannel[t].pending=[],n&&r.dataChannel[t].pending.push(n)}else re.warn("Invalid handle")}function A(e,t){(t=t||{}).success="function"==typeof t.success?t.success:re.noop,t.error="function"==typeof t.error?t.error:re.noop;var i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return re.warn("Invalid handle"),void t.error("Invalid handle");var n=i.webrtcStuff,a=t.text;if(null==a)return re.warn("Invalid text"),void t.error("Invalid text");var r=t.label?t.label:re.dataChanDefaultLabel;return n.dataChannel[r]?"open"!==n.dataChannel[r].readyState?(n.dataChannel[r].pending.push(a),void t.success()):(re.log("Sending string on data channel <"+r+">: "+a),n.dataChannel[r].send(a),void t.success()):(F(e,r,!1,a),void t.success())}function M(e,t){(t=t||{}).success="function"==typeof t.success?t.success:re.noop,t.error="function"==typeof t.error?t.error:re.noop;var i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return re.warn("Invalid handle"),void t.error("Invalid handle");var n=i.webrtcStuff;if(null===n.dtmfSender||void 0===n.dtmfSender){if(void 0!==n.pc&&null!==n.pc){var a=n.pc.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(!a)return re.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");n.dtmfSender=a.dtmf,n.dtmfSender&&(re.log("Created DTMF Sender"),n.dtmfSender.ontonechange=function(e){re.debug("Sent DTMF tone: "+e.tone)})}if(null===n.dtmfSender||void 0===n.dtmfSender)return re.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var r=t.dtmf;if(null==r)return re.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var o=r.tones;if(null==o)return re.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var s=r.duration;null==s&&(s=500);var l=r.gap;null==l&&(l=50),re.debug("Sending DTMF string "+o+" (duration "+s+"ms, gap "+l+"ms)"),n.dtmfSender.insertDTMF(o,s,l),t.success()}function L(e,n){(n=n||{}).success="function"==typeof n.success?n.success:re.noop,n.error="function"==typeof n.error?n.error:re.noop;var a=!0;void 0!==n.asyncRequest&&null!==n.asyncRequest&&(a=!0===n.asyncRequest);var r=!0;void 0!==n.noRequest&&null!==n.noRequest&&(r=!0===n.noRequest),re.log("Destroying handle "+e+" (async="+a+")"),Z(e);var o=b[e];if(null==o||o.detached)return delete b[e],void n.success();if(r)return delete b[e],void n.success();if(!y)return re.warn("Is the server down? (connected=false)"),void n.error("Is the server down? (connected=false)");var s={rtcgw:"detach",transaction:re.randomString(12)};if(null!==o.token&&void 0!==o.token&&(s.token=o.token),null!=m&&(s.apisecret=m),t)return s.session_id=S,s.handle_id=e,i.send(JSON.stringify(s)),delete b[e],void n.success();re.httpAPICall(l+"/"+S+"/"+e,{verb:"POST",async:a,withCredentials:f,body:s,success:function(t){re.log("Destroyed handle:"),re.debug(t),"success"!==t.rtcgw&&re.error("Ooops: "+t.error.code+" "+t.error.reason),delete b[e],n.success()},error:function(t,i){re.error(t+":",i),delete b[e],n.success()}})}function B(e,t,i,n,r){var o=b[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return re.warn("Invalid handle"),void n.error("Invalid handle");var s=o.webrtcStuff;re.debug("streamsDone:",r),r&&(re.debug("  -- Audio tracks:",r.getAudioTracks()),re.debug("  -- Video tracks:",r.getVideoTracks()));var l=!1;if(s.myStream&&i.update&&!s.streamExternal){if((!i.update&&W(i)||i.update&&(i.addAudio||i.replaceAudio))&&r.getAudioTracks()&&r.getAudioTracks().length)if(s.myStream.addTrack(r.getAudioTracks()[0]),re.unifiedPlan){re.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",r.getAudioTracks()[0]);var f=null;if((p=s.pc.getTransceivers())&&p.length>0)for(var x in p){if((_=p[x]).sender&&_.sender.track&&"audio"===_.sender.track.kind||_.receiver&&_.receiver.track&&"audio"===_.receiver.track.kind){f=_;break}}f&&f.sender?f.sender.replaceTrack(r.getAudioTracks()[0]):s.pc.addTrack(r.getAudioTracks()[0],r)}else re.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",r.getAudioTracks()[0]),s.pc.addTrack(r.getAudioTracks()[0],r);if((!i.update&&Y(i)||i.update&&(i.addVideo||i.replaceVideo))&&r.getVideoTracks()&&r.getVideoTracks().length)if(s.myStream.addTrack(r.getVideoTracks()[0]),re.unifiedPlan){re.log((i.replaceVideo?"Replacing":"Adding")+" video track:",r.getVideoTracks()[0]);var p,m=null;if((p=s.pc.getTransceivers())&&p.length>0)for(var x in p){var _;if((_=p[x]).sender&&_.sender.track&&"video"===_.sender.track.kind||_.receiver&&_.receiver.track&&"video"===_.receiver.track.kind){m=_;break}}m&&m.sender?m.sender.replaceTrack(r.getVideoTracks()[0]):s.pc.addTrack(r.getVideoTracks()[0],r)}else re.log((i.replaceVideo?"Replacing":"Adding")+" video track:",r.getVideoTracks()[0]),s.pc.addTrack(r.getVideoTracks()[0],r)}else s.myStream=r,l=!0;if(!s.pc){var g={iceServers:c,iceTransportPolicy:d,bundlePolicy:u};"chrome"===re.webRTCAdapter.browserDetails.browser&&(g.sdpSemantics=re.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan");var y={optional:[{DtlsSrtpKeyAgreement:!0}]};if(!0===h&&y.optional.push({googIPv6:!0}),n.rtcConstraints&&"object"===a(n.rtcConstraints))for(var x in re.debug("Adding custom PeerConnection constraints:",n.rtcConstraints),n.rtcConstraints)y.optional.push(n.rtcConstraints[x]);"edge"===re.webRTCAdapter.browserDetails.browser&&(g.bundlePolicy="max-bundle"),re.log("Creating PeerConnection"),re.debug(y),s.pc=new RTCPeerConnection(g,y),re.debug(s.pc),s.pc.getStats&&(s.volume={},s.bitrate.value="0 kbits/sec"),re.log("Preparing local SDP and gathering candidates (trickle="+s.trickle+")"),s.pc.oniceconnectionstatechange=function(e){s.pc&&o.iceState(s.pc.iceConnectionState)},s.pc.onicecandidate=function(t){if(null==t.candidate||"edge"===re.webRTCAdapter.browserDetails.browser&&t.candidate.candidate.indexOf("endOfCandidates")>0)re.log("End of candidates."),s.iceDone=!0,!0===s.trickle?k(e,{completed:!0}):function(e,t){t=t||{},t.success="function"==typeof t.success?t.success:re.noop,t.error="function"==typeof t.error?t.error:re.noop;var i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return void re.warn("Invalid handle, not sending anything");var n=i.webrtcStuff;if(re.log("Sending offer/answer SDP..."),null===n.mySdp||void 0===n.mySdp)return void re.warn("Local SDP instance is invalid, not sending anything...");n.mySdp={type:n.pc.localDescription.type,sdp:n.pc.localDescription.sdp},!1===n.trickle&&(n.mySdp.trickle=!1);re.debug(t),n.sdpSent=!0,t.success(n.mySdp)}(e,n);else{var i={candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex};!0===s.trickle&&k(e,i)}},s.pc.ontrack=function(e){re.log("Handling Remote Track"),re.debug(e),e.streams&&(s.remoteStream=e.streams[0],o.onremotestream(s.remoteStream),e.track.onended||(re.log("Adding onended callback to track:",e.track),e.track.onended=function(e){re.log("Remote track muted/removed:",e),s.remoteStream&&(s.remoteStream.removeTrack(e.target),o.onremotestream(s.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){re.log("Remote track flowing again:",e);try{s.remoteStream.addTrack(e.target),o.onremotestream(s.remoteStream)}catch(e){re.error(e)}}))}}if(l&&null!=r){re.log("Adding local stream");var S=!0===n.simulcast2;r.getTracks().forEach((function(e){if(re.log("Adding local track:",e),S)if("audio"===e.kind)s.pc.addTrack(e,r);else{re.log("Enabling rid-based simulcasting:",e);var t=v(n.simulcastMaxBitrates);s.pc.addTransceiver(e,{direction:"sendrecv",streams:[r],sendEncodings:[{rid:"h",active:!0,maxBitrate:t.high},{rid:"m",active:!0,maxBitrate:t.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:t.low,scaleResolutionDownBy:4}]})}else s.pc.addTrack(e,r)}))}(function(e){if(re.debug("isDataEnabled:",e),"edge"==re.webRTCAdapter.browserDetails.browser)return re.warn("Edge doesn't support data channels yet"),!1;return null!=e&&!0===e.data})(i)&&!s.dataChannel[re.dataChanDefaultLabel]&&(re.log("Creating data channel"),F(e,re.dataChanDefaultLabel,!1),s.pc.ondatachannel=function(t){re.log("Data channel created by Janus:",t),F(e,t.channel.label,t.channel)}),s.myStream&&o.onlocalstream(s.myStream),null==t?function(e,t,i){i=i||{},i.success="function"==typeof i.success?i.success:re.noop,i.error="function"==typeof i.error?i.error:re.noop,i.customizeSdp="function"==typeof i.customizeSdp?i.customizeSdp:re.noop;var n=b[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return re.warn("Invalid handle"),void i.error("Invalid handle");var a=n.webrtcStuff,r=!0===i.simulcast;r?re.log("Creating offer (iceDone="+a.iceDone+", simulcast="+r+")"):re.log("Creating offer (iceDone="+a.iceDone+")");var o={};if(re.unifiedPlan){var s=null,l=null,c=a.pc.getTransceivers();if(c&&c.length>0)for(var d in c){var u=c[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(l||(l=u))}var h=W(t),f=G(t);h||f?h&&f?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",re.log("Setting audio transceiver to sendrecv:",s)):h&&!f?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",re.log("Setting audio transceiver to sendonly:",s)):!h&&f&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",re.log("Setting audio transceiver to recvonly:",s)):(s=a.pc.addTransceiver("audio",{direction:"recvonly"}),re.log("Adding recvonly audio transceiver:",s))):t.removeAudio&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",re.log("Setting audio transceiver to inactive:",s));var x=Y(t),p=X(t);x||p?x&&p?l&&(l.setDirection?l.setDirection("sendrecv"):l.direction="sendrecv",re.log("Setting video transceiver to sendrecv:",l)):x&&!p?l&&(l.setDirection?l.setDirection("sendonly"):l.direction="sendonly",re.log("Setting video transceiver to sendonly:",l)):!x&&p&&(l?(l.setDirection?l.setDirection("recvonly"):l.direction="recvonly",re.log("Setting video transceiver to recvonly:",l)):(l=a.pc.addTransceiver("video",{direction:"recvonly"}),re.log("Adding recvonly video transceiver:",l))):t.removeVideo&&l&&(l.setDirection?l.setDirection("inactive"):l.direction="inactive",re.log("Setting video transceiver to inactive:",l))}else o.offerToReceiveAudio=G(t),o.offerToReceiveVideo=X(t);var m=!0===i.iceRestart;m&&(o.iceRestart=!0);re.debug(o);var _=Y(t);if(_&&r&&"firefox"===re.webRTCAdapter.browserDetails.browser){re.log("Enabling Simulcasting for Firefox (RID)");var g=a.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(g){var y=g.getParameters();y||(y={});var S=v(i.simulcastMaxBitrates);y.encodings=[{rid:"h",active:!0,maxBitrate:S.high},{rid:"m",active:!0,maxBitrate:S.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:S.low,scaleResolutionDownBy:4}],g.setParameters(y)}}a.pc.createOffer(o).then((function(e){re.debug(e);var t={type:e.type,sdp:e.sdp};i.customizeSdp(t),e.sdp=t.sdp,re.log("Setting local description"),_&&r&&("chrome"===re.webRTCAdapter.browserDetails.browser||"safari"===re.webRTCAdapter.browserDetails.browser?(re.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=function(e){for(var t=e.split("\r\n"),i=!1,n=[-1],a=[-1],r=null,o=null,s=null,l=null,c=-1,d=0;d<t.length;d++){if(h=t[d].match(/m=(\w+) */)){if("video"===h[1]){if(!(n[0]<0)){c=d;break}i=!0}else if(n[0]>-1){c=d;break}}else if(i){var u=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(u)n[0]=u[1],a[0]=u[2],t.splice(d,1),d--;else{if(n[0]){if((x=t[d].match("a=ssrc:"+n[0]+" cname:(.+)"))&&(r=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" msid:(.+)"))&&(o=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" mslabel:(.+)"))&&(s=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" label:(.+)"))&&(l=x[1]),0===t[d].indexOf("a=ssrc:"+a[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+n[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(n[0]<0){c=-1,i=!1;for(d=0;d<t.length;d++){var h;if(h=t[d].match(/m=(\w+) */)){if("video"===h[1]){if(!(n[0]<0)){c=d;break}i=!0}else if(n[0]>-1){c=d;break}}else if(i){if(n[0]<0){var f=t[d].match(/a=ssrc:(\d+)/);if(f){n[0]=f[1],t.splice(d,1),d--;continue}}else{var x;if((x=t[d].match("a=ssrc:"+n[0]+" cname:(.+)"))&&(r=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" msid:(.+)"))&&(o=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" mslabel:(.+)"))&&(s=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" label:(.+)"))&&(l=x[1]),0===t[d].indexOf("a=ssrc:"+a[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+n[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(n[0]<0)return re.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;c<0&&(c=t.length);n[1]=Math.floor(4294967295*Math.random()),n[2]=Math.floor(4294967295*Math.random()),a[1]=Math.floor(4294967295*Math.random()),a[2]=Math.floor(4294967295*Math.random());for(d=0;d<n.length;d++)r&&(t.splice(c,0,"a=ssrc:"+n[d]+" cname:"+r),c++),o&&(t.splice(c,0,"a=ssrc:"+n[d]+" msid:"+o),c++),s&&(t.splice(c,0,"a=ssrc:"+n[d]+" mslabel:"+s),c++),l&&(t.splice(c,0,"a=ssrc:"+n[d]+" label:"+l),c++),r&&(t.splice(c,0,"a=ssrc:"+a[d]+" cname:"+r),c++),o&&(t.splice(c,0,"a=ssrc:"+a[d]+" msid:"+o),c++),s&&(t.splice(c,0,"a=ssrc:"+a[d]+" mslabel:"+s),c++),l&&(t.splice(c,0,"a=ssrc:"+a[d]+" label:"+l),c++);t.splice(c,0,"a=ssrc-group:FID "+n[2]+" "+a[2]),t.splice(c,0,"a=ssrc-group:FID "+n[1]+" "+a[1]),t.splice(c,0,"a=ssrc-group:FID "+n[0]+" "+a[0]),t.splice(c,0,"a=ssrc-group:SIM "+n[0]+" "+n[1]+" "+n[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n");return e}(e.sdp)):"firefox"!==re.webRTCAdapter.browserDetails.browser&&re.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),a.mySdp=e.sdp,a.pc.setLocalDescription(e).catch(i.error),a.mediaConstraints=o,a.iceDone||a.trickle?(re.log("Offer ready"),re.debug(i),i.success(e)):re.log("Waiting for all candidates...")}),i.error)}(e,i,n):s.pc.setRemoteDescription(t).then((function(){if(re.log("Remote description accepted!"),s.remoteSdp=t.sdp,s.candidates&&s.candidates.length>0){for(var a=0;a<s.candidates.length;a++){var r=s.candidates[a];re.debug("Adding remote candidate:",r),r&&!0!==r.completed?s.pc.addIceCandidate(r):s.pc.addIceCandidate(re.endOfCandidates)}s.candidates=[]}!function(e,t,i){i=i||{},i.success="function"==typeof i.success?i.success:re.noop,i.error="function"==typeof i.error?i.error:re.noop,i.customizeSdp="function"==typeof i.customizeSdp?i.customizeSdp:re.noop;var n=b[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return re.warn("Invalid handle"),void i.error("Invalid handle");var a=n.webrtcStuff,r=!0===i.simulcast;r?re.log("Creating answer (iceDone="+a.iceDone+", simulcast="+r+")"):re.log("Creating answer (iceDone="+a.iceDone+")");var o=null;if(re.unifiedPlan){o={};var s=null,l=null,c=a.pc.getTransceivers();if(c&&c.length>0)for(var d in c){var u=c[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(l||(l=u))}var h=W(t),f=G(t);if(h||f){if(h&&f){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",re.log("Setting audio transceiver to sendrecv:",s)}catch(e){re.error(e)}}else if(h&&!f)try{s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",re.log("Setting audio transceiver to sendonly:",s))}catch(e){re.error(e)}else if(!h&&f)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",re.log("Setting audio transceiver to recvonly:",s)}catch(e){re.error(e)}else s=a.pc.addTransceiver("audio",{direction:"recvonly"}),re.log("Adding recvonly audio transceiver:",s)}else if(t.removeAudio&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",re.log("Setting audio transceiver to inactive:",s)}catch(e){re.error(e)}var x=Y(t),p=X(t);if(x||p){if(x&&p){if(l)try{l.setDirection?l.setDirection("sendrecv"):l.direction="sendrecv",re.log("Setting video transceiver to sendrecv:",l)}catch(e){re.error(e)}}else if(x&&!p){if(l)try{l.setDirection?l.setDirection("sendonly"):l.direction="sendonly",re.log("Setting video transceiver to sendonly:",l)}catch(e){re.error(e)}}else if(!x&&p)if(l)try{l.setDirection?l.setDirection("recvonly"):l.direction="recvonly",re.log("Setting video transceiver to recvonly:",l)}catch(e){re.error(e)}else l=a.pc.addTransceiver("video",{direction:"recvonly"}),re.log("Adding recvonly video transceiver:",l)}else if(t.removeVideo&&l)try{l.setDirection?l.setDirection("inactive"):l.direction="inactive",re.log("Setting video transceiver to inactive:",l)}catch(e){re.error(e)}}else o="firefox"==re.webRTCAdapter.browserDetails.browser||"edge"==re.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:G(t),offerToReceiveVideo:X(t)}:{mandatory:{OfferToReceiveAudio:G(t),OfferToReceiveVideo:X(t)}};re.debug(o);var m=Y(t);if(m&&r&&"firefox"===re.webRTCAdapter.browserDetails.browser){re.log("Enabling Simulcasting for Firefox (RID)");var _=a.pc.getSenders()[1];re.log(_);var g=_.getParameters();re.log(g);var y=v(i.simulcastMaxBitrates);_.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:y.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:y.medium},{rid:"low",active:!0,priority:"low",maxBitrate:y.low}]})}a.pc.createAnswer(o).then((function(e){re.debug(e);var t={type:e.type,sdp:e.sdp};i.customizeSdp(t),e.sdp=t.sdp,re.log("Setting local description"),m&&r&&("chrome"===re.webRTCAdapter.browserDetails.browser?re.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==re.webRTCAdapter.browserDetails.browser&&re.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),a.mySdp=e.sdp,a.pc.setLocalDescription(e).catch(i.error),a.mediaConstraints=o,a.iceDone||a.trickle?i.success(e):re.log("Waiting for all candidates...")}),i.error)}(e,i,n)}),n.error)}function O(e,t,i){(i=i||{}).success="function"==typeof i.success?i.success:re.noop,i.error="function"==typeof i.error?i.error:V;var n=i.jsep;if(t&&n)return re.error("Provided a JSEP to a createOffer"),void i.error("Provided a JSEP to a createOffer");if(!(t||n&&n.type&&n.sdp))return re.error("A valid JSEP is required for createAnswer"),void i.error("A valid JSEP is required for createAnswer");i.media=i.media||{audio:!0,video:!0};var r=i.media,o=b[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return re.warn("Invalid handle"),void i.error("Invalid handle");var s,l=o.webrtcStuff;if(l.trickle=(s=i.trickle,re.debug("isTrickleEnabled:",s),null==s||!0===s),void 0===l.pc||null===l.pc)r.update=!1,r.keepAudio=!1,r.keepVideo=!1;else if(void 0!==l.pc&&null!==l.pc){if(re.log("Updating existing media session"),r.update=!0,null!==i.stream&&void 0!==i.stream)i.stream!==l.myStream&&re.log("Renegotiation involves a new external stream");else{if(r.addAudio){if(r.keepAudio=!1,r.replaceAudio=!1,r.removeAudio=!1,r.audioSend=!0,l.myStream&&l.myStream.getAudioTracks()&&l.myStream.getAudioTracks().length)return re.error("Can't add audio stream, there already is one"),void i.error("Can't add audio stream, there already is one")}else r.removeAudio?(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!1,r.audioSend=!1):r.replaceAudio&&(r.keepAudio=!1,r.addAudio=!1,r.removeAudio=!1,r.audioSend=!0);if(null===l.myStream||void 0===l.myStream?(r.replaceAudio&&(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!0,r.audioSend=!0),W(r)&&(r.keepAudio=!1,r.addAudio=!0)):null===l.myStream.getAudioTracks()||void 0===l.myStream.getAudioTracks()||0===l.myStream.getAudioTracks().length?(r.replaceAudio&&(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!0,r.audioSend=!0),W(r)&&(r.keepVideo=!1,r.addAudio=!0)):!W(r)||r.removeAudio||r.replaceAudio||(r.keepAudio=!0),r.addVideo){if(r.keepVideo=!1,r.replaceVideo=!1,r.removeVideo=!1,r.videoSend=!0,l.myStream&&l.myStream.getVideoTracks()&&l.myStream.getVideoTracks().length)return re.error("Can't add video stream, there already is one"),void i.error("Can't add video stream, there already is one")}else r.removeVideo?(r.keepVideo=!1,r.replaceVideo=!1,r.addVideo=!1,r.videoSend=!1):r.replaceVideo&&(r.keepVideo=!1,r.addVideo=!1,r.removeVideo=!1,r.videoSend=!0);null===l.myStream||void 0===l.myStream||null===l.myStream.getVideoTracks()||void 0===l.myStream.getVideoTracks()||0===l.myStream.getVideoTracks().length?(r.replaceVideo&&(r.keepVideo=!1,r.replaceVideo=!1,r.addVideo=!0,r.videoSend=!0),Y(r)&&(r.keepVideo=!1,r.addVideo=!0)):!Y(r)||r.removeVideo||r.replaceVideo||(r.keepVideo=!0),r.addData&&(r.data=!0)}if(W(r)&&r.keepAudio&&Y(r)&&r.keepVideo)return o.consentDialog(!1),void B(e,n,r,i,l.myStream)}if(r.update&&!l.streamExternal){if(r.removeAudio||r.replaceAudio){if(l.myStream&&l.myStream.getAudioTracks()&&l.myStream.getAudioTracks().length){var c=l.myStream.getAudioTracks()[0];re.log("Removing audio track:",c),l.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(l.pc.getSenders()&&l.pc.getSenders().length){var d=!0;if(r.replaceAudio&&re.unifiedPlan&&(d=!1),d)for(var u in l.pc.getSenders()){(c=l.pc.getSenders()[u])&&c.track&&"audio"===c.track.kind&&(re.log("Removing audio sender:",c),l.pc.removeTrack(c))}}}if(r.removeVideo||r.replaceVideo){if(l.myStream&&l.myStream.getVideoTracks()&&l.myStream.getVideoTracks().length){c=l.myStream.getVideoTracks()[0];re.log("Removing video track:",c),l.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(l.pc.getSenders()&&l.pc.getSenders().length){var h=!0;if(r.replaceVideo&&re.unifiedPlan&&(h=!1),h)for(var u in l.pc.getSenders()){(c=l.pc.getSenders()[u])&&c.track&&"video"===c.track.kind&&(re.log("Removing video sender:",c),l.pc.removeTrack(c))}}}}if(null!==i.stream&&void 0!==i.stream){var f=i.stream;if(re.log("MediaStream provided by the application"),re.debug(f),r.update&&l.myStream&&l.myStream!==i.stream&&!l.streamExternal){try{var x=l.myStream.getTracks();for(var p in x){var m=x[p];re.log(m),null!=m&&m.stop()}}catch(e){}l.myStream=null}return l.streamExternal=!0,o.consentDialog(!1),void B(e,n,r,i,f)}if(W(r)||Y(r)){if(!re.isGetUserMediaAvailable())return void i.error("getUserMedia not available");var _={mandatory:{},optional:[]};o.consentDialog(!0);var g=W(r);!0===g&&null!=r&&null!=r&&"object"===a(r.audio)&&(g=r.audio);var v=Y(r);if(!0===v&&null!=r&&null!=r){var y=!0===i.simulcast,S=!0===i.simulcast2;if(!y&&!S||n||void 0!==r.video&&!1!==r.video||(r.video="hires"),r.video&&"screen"!=r.video&&"window"!=r.video)if("object"===a(r.video))v=r.video;else{var P=0,E=0;"lowres"===r.video?(E=240,P=320):"lowres-16:9"===r.video?(E=180,P=320):"hires"===r.video||"hires-16:9"===r.video||"hdres"===r.video?(E=720,P=1280):"fhdres"===r.video?(E=1080,P=1920):"4kres"===r.video?(E=2160,P=3840):"stdres"===r.video?(E=480,P=640):"stdres-16:9"===r.video?(E=360,P=640):(re.log("Default video setting is stdres 4:3"),E=480,P=640),re.log("Adding media constraint:",r.video),v={height:{ideal:E},width:{ideal:P}},re.log("Adding video constraint:",v)}else if("screen"===r.video||"window"===r.video){var C=function(t,a){o.consentDialog(!1),t?i.error(t):B(e,n,r,i,a)},T=function(e,t,i){re.log("Adding media constraint (screen capture)"),re.debug(e),navigator.mediaDevices.getUserMedia(e).then((function(e){i?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(i){e.addTrack(i.getAudioTracks()[0]),t(null,e)})):t(null,e)})).catch((function(e){o.consentDialog(!1),t(e)}))};if(r.screenshareFrameRate||(r.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){o.consentDialog(!1),W(r)&&!r.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(a){t.addTrack(a.getAudioTracks()[0]),B(e,n,r,i,t)})):B(e,n,r,i,t)}),(function(e){o.consentDialog(!1),i.error(e)}));if("chrome"===re.webRTCAdapter.browserDetails.browser){var R=re.webRTCAdapter.browserDetails.version,w=33;window.navigator.userAgent.match("Linux")&&(w=35),R>=26&&R<=w?(_={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:r.screenshareFrameRate,maxFrameRate:r.screenshareFrameRate,chromeMediaSource:"screen"}},audio:W(r)&&!r.keepAudio},T(_,C)):re.extension.getScreen((function(e,t){if(e)return o.consentDialog(!1),i.error(e);(_={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:r.screenshareFrameRate,maxFrameRate:r.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=t,T(_,C,W(r)&&!r.keepAudio)}))}else if("firefox"===re.webRTCAdapter.browserDetails.browser){if(!(re.webRTCAdapter.browserDetails.version>=33)){var I=new Error("NavigatorUserMediaError");return I.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",o.consentDialog(!1),void i.error(I)}_={video:{mozMediaSource:r.video,mediaSource:r.video},audio:W(r)&&!r.keepAudio},T(_,(function(e,t){if(C(e,t),!e)var i=t.currentTime,n=window.setInterval((function(){t||window.clearInterval(n),t.currentTime==i&&(window.clearInterval(n),t.onended&&t.onended()),i=t.currentTime}),500)}))}return}}null!=r&&"screen"===r.video||navigator.mediaDevices.enumerateDevices().then((function(t){var s=t.some((function(e){return"audioinput"===e.kind})),l=function(e){if(re.debug("isScreenSendEnabled:",e),null==e)return!1;if("object"!==a(e.video)||"object"!==a(e.video.mandatory))return!1;var t=e.video.mandatory;if(t.chromeMediaSource)return"desktop"===t.chromeMediaSource||"screen"===t.chromeMediaSource;if(t.mozMediaSource)return"window"===t.mozMediaSource||"screen"===t.mozMediaSource;if(t.mediaSource)return"window"===t.mediaSource||"screen"===t.mediaSource;return!1}(r)||t.some((function(e){return"videoinput"===e.kind})),c=W(r),d=Y(r),u=function(e){return re.debug("isAudioSendRequired:",e),null!=e&&(!1!==e.audio&&!1!==e.audioSend&&(void 0!==e.failIfNoAudio&&null!==e.failIfNoAudio&&!0===e.failIfNoAudio))}(r),h=function(e){return re.debug("isVideoSendRequired:",e),null!=e&&(!1!==e.video&&!1!==e.videoSend&&(void 0!==e.failIfNoVideo&&null!==e.failIfNoVideo&&!0===e.failIfNoVideo))}(r);if(c||d||u||h){var x=!!c&&s,p=!!d&&l;if(!x&&!p)return o.consentDialog(!1),i.error("No capture device found"),!1;if(!x&&u)return o.consentDialog(!1),i.error("Audio capture is required, but no capture device found"),!1;if(!p&&h)return o.consentDialog(!1),i.error("Video capture is required, but no capture device found"),!1}var m={audio:!(!s||r.keepAudio)&&g,video:!(!l||r.keepVideo)&&v};re.debug("getUserMedia constraints",m),m.audio||m.video?navigator.mediaDevices.getUserMedia(m).then((function(t){o.consentDialog(!1),B(e,n,r,i,t)})).catch((function(e){o.consentDialog(!1),i.error({code:e.code,name:e.name,message:e.message})})):(o.consentDialog(!1),B(e,n,r,i,f))})).catch((function(e){o.consentDialog(!1),i.error("enumerateDevices error",e)}))}else B(e,n,r,i)}function j(e,t){(t=t||{}).success="function"==typeof t.success?t.success:re.noop,t.error="function"==typeof t.error?t.error:V;var i=t.jsep,n=b[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return re.warn("Invalid handle"),void t.error("Invalid handle");var a=n.webrtcStuff;if(null!=i){if(null===a.pc)return re.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void t.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");a.pc.setRemoteDescription(i).then((function(){if(re.log("Remote description accepted!"),a.remoteSdp=i.sdp,a.candidates&&a.candidates.length>0){for(var e=0;e<a.candidates.length;e++){var n=a.candidates[e];re.debug("Adding remote candidate:",n),n&&!0!==n.completed?a.pc.addIceCandidate(n):a.pc.addIceCandidate(re.endOfCandidates)}a.candidates=[]}t.success()}),t.error)}else t.error("Invalid JSEP")}function N(e,t){var i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return re.warn("Invalid handle"),0;var n=t?"remote":"local",a=i.webrtcStuff;return a.volume[n]||(a.volume[n]={value:0}),a.pc.getStats&&"chrome"===re.webRTCAdapter.browserDetails.browser?!t||null!==a.remoteStream&&void 0!==a.remoteStream?t||null!==a.myStream&&void 0!==a.myStream?null===a.volume[n].timer||void 0===a.volume[n].timer?(re.log("Starting "+n+" volume monitor"),a.volume[n].timer=setInterval((function(){a.pc.getStats((function(e){for(var i=e.result(),r=0;r<i.length;r++){var o=i[r];"ssrc"==o.type&&(t&&o.stat("audioOutputLevel")?a.volume[n].value=parseInt(o.stat("audioOutputLevel")):!t&&o.stat("audioInputLevel")&&(a.volume[n].value=parseInt(o.stat("audioInputLevel"))))}}))}),200),0):a.volume[n].value:(re.warn("Local stream unavailable"),0):(re.warn("Remote stream unavailable"),0):(re.warn("Getting the "+n+" volume unsupported by browser"),0)}function U(e,t){var i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return re.warn("Invalid handle"),!0;var n=i.webrtcStuff;return null===n.pc||void 0===n.pc?(re.warn("Invalid PeerConnection"),!0):void 0===n.myStream||null===n.myStream?(re.warn("Invalid local MediaStream"),!0):t?null===n.myStream.getVideoTracks()||void 0===n.myStream.getVideoTracks()||0===n.myStream.getVideoTracks().length?(re.warn("No video track"),!0):!n.myStream.getVideoTracks()[0].enabled:null===n.myStream.getAudioTracks()||void 0===n.myStream.getAudioTracks()||0===n.myStream.getAudioTracks().length?(re.warn("No audio track"),!0):!n.myStream.getAudioTracks()[0].enabled}function z(e,t,i){var n=b[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return re.warn("Invalid handle"),!1;var a=n.webrtcStuff;return null===a.pc||void 0===a.pc?(re.warn("Invalid PeerConnection"),!1):void 0===a.myStream||null===a.myStream?(re.warn("Invalid local MediaStream"),!1):t?null===a.myStream.getVideoTracks()||void 0===a.myStream.getVideoTracks()||0===a.myStream.getVideoTracks().length?(re.warn("No video track"),!1):(a.myStream.getVideoTracks()[0].enabled=!i,!0):null===a.myStream.getAudioTracks()||void 0===a.myStream.getAudioTracks()||0===a.myStream.getAudioTracks().length?(re.warn("No audio track"),!1):(a.myStream.getAudioTracks()[0].enabled=!i,!0)}function H(e){var t=b[e];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return re.warn("Invalid handle"),"Invalid handle";var i=t.webrtcStuff;return null===i.pc||void 0===i.pc?"Invalid PeerConnection":i.pc.getStats?null===i.bitrate.timer||void 0===i.bitrate.timer?(re.log("Starting bitrate timer (via getStats)"),i.bitrate.timer=setInterval((function(){i.pc.getStats().then((function(e){e.forEach((function(e){if(e){var t=!1;if(("video"===e.mediaType||e.id.toLowerCase().indexOf("video")>-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?t=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(t=!0),t)if(i.bitrate.bsnow=e.bytesReceived,i.bitrate.tsnow=e.timestamp,null===i.bitrate.bsbefore||null===i.bitrate.tsbefore)i.bitrate.bsbefore=i.bitrate.bsnow,i.bitrate.tsbefore=i.bitrate.tsnow;else{var n=i.bitrate.tsnow-i.bitrate.tsbefore;"safari"==re.webRTCAdapter.browserDetails.browser&&(n/=1e3);var a=Math.round(8*(i.bitrate.bsnow-i.bitrate.bsbefore)/n);"safari"===re.webRTCAdapter.browserDetails.browser&&(a=parseInt(a/1e3)),i.bitrate.value=a+" kbits/sec",i.bitrate.bsbefore=i.bitrate.bsnow,i.bitrate.tsbefore=i.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):i.bitrate.value:(re.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function V(e){re.error("WebRTC error:",e)}function Z(e,n){re.log("Cleaning WebRTC stuff");var a=b[e];if(null!=a){var r=a.webrtcStuff;if(null!=r){if(!0===n){var o={rtcgw:"hangup",transaction:re.randomString(12)};null!==a.token&&void 0!==a.token&&(o.token=a.token),null!=m&&(o.apisecret=m),re.debug("Sending hangup request (handle="+e+"):"),re.debug(o),t?(o.session_id=S,o.handle_id=e,i.send(JSON.stringify(o))):re.httpAPICall(l+"/"+S+"/"+e,{verb:"POST",withCredentials:f,body:o})}r.remoteStream=null,r.volume&&(r.volume.local&&r.volume.local.timer&&clearInterval(r.volume.local.timer),r.volume.remote&&r.volume.remote.timer&&clearInterval(r.volume.remote.timer)),r.volume={},r.bitrate.timer&&clearInterval(r.bitrate.timer),r.bitrate.timer=null,r.bitrate.bsnow=null,r.bitrate.bsbefore=null,r.bitrate.tsnow=null,r.bitrate.tsbefore=null,r.bitrate.value=null;try{if(!r.streamExternal&&null!==r.myStream&&void 0!==r.myStream){re.log("Stopping local stream tracks");var s=r.myStream.getTracks();for(var c in s){var d=s[c];re.log(d),null!=d&&d.stop()}}}catch(e){}r.streamExternal=!1,r.myStream=null;try{r.pc.close()}catch(e){}r.pc=null,r.candidates=null,r.mySdp=null,r.remoteSdp=null,r.iceDone=!1,r.dataChannel={},r.dtmfSender=null}a.oncleanup()}}function W(e){return re.debug("isAudioSendEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioSend||null===e.audioSend||!0===e.audioSend)}function G(e){return re.debug("isAudioRecvEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioRecv||null===e.audioRecv||!0===e.audioRecv)}function Y(e){return re.debug("isVideoSendEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoSend||null===e.videoSend||!0===e.videoSend)}function X(e){return re.debug("isVideoRecvEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoRecv||null===e.videoRecv||!0===e.videoRecv)}I(e),this.getServer=function(){return l},this.isConnected=function(){return y},this.reconnect=function(e){(e=e||{}).success="function"==typeof e.success?e.success:re.noop,e.error="function"==typeof e.error?e.error:re.noop,e.reconnect=!0,I(e)},this.getSessionId=function(){return S},this.destroy=function(a){!function(a){a=a||{},a.success="function"==typeof a.success?a.success:re.noop;var o=!0;void 0!==a.asyncRequest&&null!==a.asyncRequest&&(o=!0===a.asyncRequest);var s=!0;void 0!==a.notifyDestroyed&&null!==a.notifyDestroyed&&(s=!0===a.notifyDestroyed);var c=!1;void 0!==a.cleanupHandles&&null!==a.cleanupHandles&&(c=!0===a.cleanupHandles);if(re.log("Destroying session "+S+" (async="+o+")"),!y)return re.warn("Is the server down? (connected=false)"),void a.success();if(null==S)return re.warn("No session to destroy"),a.success(),void(s&&e.destroyed());if(c)for(var d in b)L(d,{noRequest:!0});var u={rtcgw:"destroy",transaction:re.randomString(12)};null!=p&&(u.token=p);null!=m&&(u.apisecret=m);if(t){u.session_id=S;var h=function(){for(var e in n)i.removeEventListener(e,n[e]);i.removeEventListener("message",x),i.removeEventListener("error",_),r&&clearTimeout(r),i.close()},x=function(t){var i=JSON.parse(t.data);i.session_id==u.session_id&&i.transaction==u.transaction&&(h(),a.success(),s&&e.destroyed())},_=function(t){h(),a.error("Failed to destroy the server: Is the server down?"),s&&e.destroyed()};return i.addEventListener("message",x),i.addEventListener("error",_),void i.send(JSON.stringify(u))}re.httpAPICall(l+"/"+S,{verb:"POST",async:o,withCredentials:f,body:u,success:function(t){re.log("Destroyed session:"),re.debug(t),S=null,y=!1,"success"!==t.rtcgw&&re.error("Ooops: "+t.error.code+" "+t.error.reason),a.success(),s&&e.destroyed()},error:function(t,i){re.error(t+":",i),S=null,y=!1,a.success(),s&&e.destroyed()}})}(a)},this.attach=function(e){!function(e){if(e=e||{},e.success="function"==typeof e.success?e.success:re.noop,e.error="function"==typeof e.error?e.error:re.noop,e.consentDialog="function"==typeof e.consentDialog?e.consentDialog:re.noop,e.iceState="function"==typeof e.iceState?e.iceState:re.noop,e.mediaState="function"==typeof e.mediaState?e.mediaState:re.noop,e.webrtcState="function"==typeof e.webrtcState?e.webrtcState:re.noop,e.slowLink="function"==typeof e.slowLink?e.slowLink:re.noop,e.onmessage="function"==typeof e.onmessage?e.onmessage:re.noop,e.onlocalstream="function"==typeof e.onlocalstream?e.onlocalstream:re.noop,e.onremotestream="function"==typeof e.onremotestream?e.onremotestream:re.noop,e.ondata="function"==typeof e.ondata?e.ondata:re.noop,e.ondataopen="function"==typeof e.ondataopen?e.ondataopen:re.noop,e.oncleanup="function"==typeof e.oncleanup?e.oncleanup:re.noop,e.ondetached="function"==typeof e.ondetached?e.ondetached:re.noop,!y)return re.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var n=e.plugin;if(null==n)return re.error("Invalid plugin"),void e.error("Invalid plugin");var a=e.opaqueId,r=e.token?e.token:p,o=re.randomString(12),s={rtcgw:"attach",plugin:n,opaque_id:a,transaction:o};null!=r&&(s.token=r);null!=m&&(s.apisecret=m);if(t)return C[o]=function(t){if(re.debug(t),"success"!==t.rtcgw)return re.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error("Ooops: "+t.error.code+" "+t.error.reason);var i=t.data.id;re.log("Created handle: "+i);var a={session:P,plugin:n,id:i,token:r,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return n},getVolume:function(){return N(i,!0)},getRemoteVolume:function(){return N(i,!0)},getLocalVolume:function(){return N(i,!1)},isAudioMuted:function(){return U(i,!1)},muteAudio:function(){return z(i,!1,!0)},unmuteAudio:function(){return z(i,!1,!1)},isVideoMuted:function(){return U(i,!0)},muteVideo:function(){return z(i,!0,!0)},unmuteVideo:function(){return z(i,!0,!1)},getBitrate:function(){return H(i)},send:function(e){D(i,e)},data:function(e){A(i,e)},dtmf:function(e){M(i,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){O(i,!0,e)},createAnswer:function(e){O(i,!1,e)},handleRemoteJsep:function(e){j(i,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Z(i,!0===e)},detach:function(e){L(i,e)}};b[i]=a,e.success(a)},s.session_id=S,void i.send(JSON.stringify(s));re.httpAPICall(l+"/"+S,{verb:"POST",withCredentials:f,body:s,success:function(t){if(re.debug(t),"success"!==t.rtcgw)return re.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error("Ooops: "+t.error.code+" "+t.error.reason);var i=t.data.id;re.log("Created handle: "+i);var a={session:P,plugin:n,id:i,token:r,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return n},getVolume:function(){return N(i,!0)},getRemoteVolume:function(){return N(i,!0)},getLocalVolume:function(){return N(i,!1)},isAudioMuted:function(){return U(i,!1)},muteAudio:function(){return z(i,!1,!0)},unmuteAudio:function(){return z(i,!1,!1)},isVideoMuted:function(){return U(i,!0)},muteVideo:function(){return z(i,!0,!0)},unmuteVideo:function(){return z(i,!0,!1)},getBitrate:function(){return H(i)},send:function(e){D(i,e)},data:function(e){A(i,e)},dtmf:function(e){M(i,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){O(i,!0,e)},createAnswer:function(e){O(i,!1,e)},handleRemoteJsep:function(e){j(i,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Z(i,!0===e)},detach:function(e){L(i,e)}};b[i]=a,e.success(a)},error:function(e,t){re.error(e+":",t)}})}(e)}}re.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,i=e&&e.Promise||Promise,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},extension:e&&e.extension||ae,isArray:function(e){return Array.isArray(e)},webRTCAdapter:e&&e.adapter||window.adapter,httpAPICall:function(e,n){var r={method:n.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===n.verb&&(r.headers["Content-Type"]="application/json"),void 0!==n.withCredentials&&(r.credentials=!0===n.withCredentials?"include":n.withCredentials?n.withCredentials:"omit"),void 0!==n.body&&(r.body=JSON.stringify(n.body));var o=t(e,r).catch((function(e){return i.reject({message:"Probably a network error, is the server down?",error:e})}));if(void 0!==n.timeout){var s=new i((function(e,t){var i=setTimeout((function(){return clearTimeout(i),t({message:"Request timed out",timeout:n.timeout})}),n.timeout)}));o=i.race([o,s])}return o.then((function(e){return e.ok?a(n.success)===a(re.noop)?e.json().then((function(e){n.success(e)})).catch((function(t){return i.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:i.reject({message:"API call failed",response:e})})).catch((function(e){a(n.error)===a(re.noop)&&n.error(e.message||"<< internal error >>",e)})),o}}},re.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,i=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new i(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||ae,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,i){var n=void 0!==i.body?{contentType:"application/json",data:JSON.stringify(i.body)}:{},r=void 0!==i.withCredentials?{xhrFields:{withCredentials:i.withCredentials}}:{};return t.ajax(t.extend(n,r,{url:e,type:i.verb,cache:!1,dataType:"json",async:i.async,timeout:i.timeout,success:function(e){a(i.success)===a(re.noop)&&i.success(e)},error:function(e,t,n){a(i.error)===a(re.noop)&&i.error(t,n)}}))}}},re.noop=function(){},re.dataChanDefaultLabel="JanusDataChannel",re.endOfCandidates=null,re.init=function(e){if((e=e||{}).callback="function"==typeof e.callback?e.callback:re.noop,!0===re.initDone)e.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),re.trace=re.noop,re.debug=re.noop,re.vdebug=re.noop,re.log=re.noop,re.warn=re.noop,re.error=re.noop,!0===e.debug||"all"===e.debug)re.trace=console.trace.bind(console),re.debug=console.debug.bind(console),re.vdebug=console.debug.bind(console),re.log=console.log.bind(console),re.warn=console.warn.bind(console),re.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var i=e.debug[t];switch(i){case"trace":re.trace=console.trace.bind(console);break;case"debug":re.debug=console.debug.bind(console);break;case"vdebug":re.vdebug=console.debug.bind(console);break;case"log":re.log=console.log.bind(console);break;case"warn":re.warn=console.warn.bind(console);break;case"error":re.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+i+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')")}}re.log("Initializing library");var n=e.dependencies||re.useDefaultDependencies();re.isArray=n.isArray,re.webRTCAdapter=n.webRTCAdapter,re.httpAPICall=n.httpAPICall,re.newWebSocket=n.newWebSocket,re.extension=n.extension,re.extension.init(),re.listDevices=function(e,t){e="function"==typeof e?e:re.noop,null==t&&(t={audio:!0,video:!0}),re.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(i){re.debug(i),e(i);try{var n=t.getTracks();for(var a in n){var r=n[a];null!=r&&r.stop()}}catch(e){}}))})).catch((function(t){re.error(t),e([])})):(re.warn("navigator.mediaDevices unavailable"),e([]))},re.attachMediaStream=function(e,t){"chrome"===re.webRTCAdapter.browserDetails.browser?re.webRTCAdapter.browserDetails.version>=52?e.srcObject=t:re.error("Error attaching stream to element"):e.srcObject=t},re.reattachMediaStream=function(e,t){"chrome"===re.webRTCAdapter.browserDetails.browser?re.webRTCAdapter.browserDetails.version>=52?e.srcObject=t.srcObject:void 0!==e.src?e.src=t.src:re.error("Error reattaching stream to element"):e.srcObject=t.srcObject};var a=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",r=window["on"+a];if(window.addEventListener(a,(function(e){for(var t in re.log("Closing window"),re.sessions)null!==re.sessions[t]&&void 0!==re.sessions[t]&&re.sessions[t].destroyOnUnload&&(re.log("Destroying session "+t),re.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));r&&"function"==typeof r&&r()})),re.safariVp8=!1,"safari"===re.webRTCAdapter.browserDetails.browser&&re.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var t in RTCRtpSender.getCapabilities("video").codecs){var o=RTCRtpSender.getCapabilities("video").codecs[t];if(o&&o.mimeType&&"video/vp8"===o.mimeType.toLowerCase()){re.safariVp8=!0;break}}re.safariVp8?re.log("This version of Safari supports VP8"):re.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 s=new RTCPeerConnection({},{});s.createOffer({offerToReceiveVideo:!0}).then((function(e){re.safariVp8=-1!==e.sdp.indexOf("VP8"),re.safariVp8?re.log("This version of Safari supports VP8"):re.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"),s.close(),s=null}))}if(re.unifiedPlan=!1,"firefox"===re.webRTCAdapter.browserDetails.browser&&re.webRTCAdapter.browserDetails.version>=59)re.unifiedPlan=!0;else if("chrome"===re.webRTCAdapter.browserDetails.browser&&re.webRTCAdapter.browserDetails.version<72)re.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){var l=new RTCPeerConnection;try{l.addTransceiver("audio"),re.unifiedPlan=!0}catch(e){}l.close()}else re.unifiedPlan=!1;re.initDone=!0,e.callback()}},re.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},re.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},re.randomString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i="",n=0;n<e;n++){var a=Math.floor(62*Math.random());i+=t.substring(a,a+1)}return i},window.Janus_Talk=re;var oe=window.Janus_Talk,se=null,le=null,ce="tts-"+Janus_Talk.randomString(12),de=null;oe.init({debug:"all",callback:function(){window.stopTalk=function(){se.destroy()},window.startTalk=function(){oe.isWebrtcSupported()?se=new oe({server:window.EZUIKit.opt.rtcUrl,success:function(){se.attach({plugin:"rtcgw.plugin.tts",opaqueId:ce,success:function(e){le=e,oe.log("Plugin attached! ("+le.getPlugin()+", id="+le.getId()+")");var t=window.EZUIKit.opt.talkLink;console.log("ttsUlr",t);var i={request:"start",url:t,codec:"opus",dir:"sendrecv",audio_debug:1,url_version:"1"};"gb28181"===window.EZUIKit.opt.talkType&&(i.devProto="gb28181"),oe.debug("Trying a createOffer too (audio/video sendrecv)"),le.createOffer({media:{audio:!0,video:!1,data:!1},simulcast:!1,simulcast2:!1,success:function(e){oe.debug("Got SDP!"),oe.debug(e),le.send({message:i,jsep:e}),void 0!==window.EZUIKit.handleTalkSuccess&&window.EZUIKit.handleTalkSuccess()},error:function(e){oe.error("WebRTC error:",e),void 0!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)}})},error:function(e){console.error("  -- Error attaching plugin...",e),bootbox.alert("Error attaching plugin... "+e),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)},consentDialog:function(e){oe.debug("Consent dialog should be "+(e?"on":"off")+" now")},iceState:function(e){oe.log("ICE state changed to "+e)},mediaState:function(e,t){oe.log("Janus "+(t?"started":"stopped")+" receiving our "+e)},webrtcState:function(e){oe.log("Janus says our WebRTC PeerConnection is "+(e?"up":"down")+" now")},slowLink:function(e,t){oe.warn("Janus reports problems "+(e?"sending":"receiving")+" packets on this PeerConnection ("+t+" lost packets)")},onmessage:function(e,t){oe.debug(" ::: Got a message :::"),oe.debug(e),null!=t&&(oe.debug("Handling SDP as well..."),oe.debug(t),le.handleRemoteJsep({jsep:t}));var i=e.result;if(null!=i){if("done"===i)return bootbox.alert("The TTS Test is over"),null!=de&&de.stop(),void(de=null);"msg"===i&&void 0!==window.EZUIKit.handleTalkMessage&&window.EZUIKit.handleTalkMessage(e),"slow_link"===i.status&&toastr.warning("Janus apparently missed many packets we sent, maybe we should reduce the bitrate","Packet loss?",{timeOut:2e3})}},onlocalstream:function(e){oe.debug(" ::: Got a local stream :::"),oe.debug(e),oe.attachMediaStream(document.getElementById("myaudio"),e),"completed"!==le.webrtcStuff.pc.iceConnectionState&&"connected"!==le.webrtcStuff.pc.iceConnectionState&&(null==de?document.getElementById("audioright"):de.spin());var t=e.getAudioTracks();null==t||t.length},onremotestream:function(e){oe.debug(" ::: Got a remote stream :::"),oe.debug(e),oe.attachMediaStream(document.getElementById("peeraudio"),e);var t=e.getAudioTracks();null==t||0===t.length||document.getElementById("peeraudio").play()},ondataopen:function(e){oe.log("The DataChannel is available!")},ondata:function(e){oe.debug("We got data from the DataChannel! "+e)},oncleanup:function(){oe.log(" ::: Got a cleanup notification :::"),null!=de&&de.stop(),de=null}})},error:function(e){oe.error(e),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)},destroyed:function(){}}):bootbox.alert("No WebRTC support... ")}}}),window.janus=se,window.tts=le;var ue=function(){function e(t){var i=this;r(this,e),this.jSPlugin=t,this.pluginStatus=new F(this,this.jSPlugin.params.id),this.talkChannelNo=t.talkChannelNo;var n=document.createElement("div");n.id="audioleft";var a=document.createElement("div");a.id="audioright",a.style="display:none;";var o=document.createElement("audio");o.id="myaudio",o.muted=!0,o.setAttribute("autoplay",!0),o.setAttribute("controls",!0),n.appendChild(o),n.style="display:none;";var s=document.createElement("audio");s.id="peeraudio",s.setAttribute("autoplay",!0),s.setAttribute("controls",!0),a.appendChild(s),window.EZUIKit.handleTalkError=function(e){console.log("talk err",e),void 0!==i.jSPlugin.handleTalkError&&i.jSPlugin.handleTalkError(e)},window.EZUIKit.handleTalkSuccess=function(e){console.log("talk success",e),void 0!==i.jSPlugin.handleTalkSuccess&&i.jSPlugin.handleTalkSuccess(e)},window.EZUIKit.opt={rtcUrl:"",talkLink:"",ttsUrl:"",stream:"",deviceSerial:P(this.jSPlugin.url).deviceSerial,channelNo:P(this.jSPlugin.url).channelNo},document.body.appendChild(n),document.body.appendChild(a)}return s(e,[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"startTalk",value:function(e){var t=this;new Promise((function(e,i){t.jSPlugin.capacity&&t.jSPlugin.capacity.support_switch_talkmode&&"1"==t.jSPlugin.capacity.support_switch_talkmode?fetch(t.jSPlugin.env.domain+"/api/service/device/talkMode"+"?deviceSerial=".concat(P(t.jSPlugin.url).deviceSerial),{method:"GET",headers:{accessToken:t.jSPlugin.accessToken}}).then((function(e){return e.json()})).then((function(i){i.meta&&200==i.meta.code?i.data&&i.data.valueInfo&&0==i.data.valueInfo.mode?fetch(t.jSPlugin.env.domain+"/api/v3/device/talkMode"+"?deviceSerial=".concat(P(t.jSPlugin.url).deviceSerial,"&channelNo=").concat(P(t.jSPlugin.url).channelNo,"&mode=1"),{method:"PUT",headers:{accessToken:t.jSPlugin.accessToken}}).then((function(e){return e.json()})).then((function(t){t.meta&&200==t.meta.code?e():e({code:-1,msg:"对讲模式切换失败",res:t})})).catch((function(t){e({code:-1,msg:"对讲模式切换失败",res:t})})):e():e({code:-1,msg:"获取当前对讲模式失败",res:i})})).catch((function(t){e({code:-1,msg:"获取当前对讲模式失败",res:t})})):e({code:-1,msg:"当前设备不支持对讲模式切换"})})).then((function(i){if(t.jSPlugin.capacity&&t.jSPlugin.capacity.support_talk&&(!t.jSPlugin.capacity||"3"!==t.jSPlugin.capacity.support_talk&&"1"!==t.jSPlugin.capacity.support_talk))return"function"==typeof t.jSPlugin.params.handleError&&(t.pluginStatus.loadingSetText({text:"设备不支持对讲",color:"red",delayClear:2e3}),t.jSPlugin.params.handleError({msg:"设备不支持对讲",retcode:-1e3,id:t.jSPlugin.params.id,type:"handleError"})),console.log("设备不支持对讲"),!1;var n=new FormData;if(n.append("accessToken",t.jSPlugin.accessToken),n.append("deviceSerial",P(t.jSPlugin.url).deviceSerial),n.append("channelNo",t.talkChannelNo||"0"),t.jSPlugin.params.extraParams&&t.jSPlugin.params.extraParams.talkParams&&"object"===a(t.jSPlugin.params.extraParams.talkParams))for(var r in t.jSPlugin.params.extraParams.talkParams)data.append(r,t.jSPlugin.params.extraParams.talkParams[r]);fetch(t.jSPlugin.env.domain+"/api/lapp/live/talk/url",{method:"POST",body:n}).then((function(e){return e.json()})).then((function(i){if(200==i.code){var n=i.data;if(n){var r=n.rtcUrl;if(-1===r.indexOf("ws")&&(r=r.replace("https","wss").replace("rtcgw","rtcgw-ws")),window.EZUIKit.opt.rtcUrl=r,window.EZUIKit.opt.ttsUrl="tts://"+n.ttsUrl,t.jSPlugin.params.extraParams&&t.jSPlugin.params.extraParams.ttsParams)if("string"==typeof t.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+t.jSPlugin.params.extraParams.ttsParams;else if("object"===a(t.jSPlugin.params.extraParams.ttsParams))for(var o in t.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+o+"="+t.jSPlugin.params.extraParams.ttsParams[o];n.ttsUrl.indexOf("gb28181")>-1&&n.ttsUrl.indexOf("8664")>-1&&(window.EZUIKit.opt.ttsUrl=window.EZUIKit.opt.ttsUrl.replace("8664","8665")),window.EZUIKit.opt.deviceSerial=P(t.jSPlugin.url).deviceSerial,window.EZUIKit.opt.channelNo=t.talkChannelNo||"0";var s="talk?dev="+window.EZUIKit.opt.deviceSerial+"&chann="+window.EZUIKit.opt.channelNo+"&encodetype=2";window.EZUIKit.opt.talkLink=window.EZUIKit.opt.ttsUrl.split("?")[0]+"/"+s,n.ttsUrl.indexOf("gb28181")>-1&&(window.EZUIKit.opt.talkType="gb28181"),e&&e(n.ttsUrl.indexOf("gb28181")>-1||-1!==window.EZUIKit.opt.deviceSerial.indexOf(":")),window.EZUIKit.opt.stream=n.stream,window.startTalk(),t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:t,msg:"开启对讲"})}}else console.log(i.code,t.jSPlugin.i18n.t("server.talk."+i.code)),t.pluginStatus.loadingSetText({text:t.jSPlugin.i18n.t("server.talk."+i.code)||i.msg,color:"red",delayClear:2e3}),t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:-1,target:t,msg:t.jSPlugin.i18n.t("server.talk."+i.code)||i.msg}),"function"==typeof t.jSPlugin.params.handleError&&t.jSPlugin.params.handleError({msg:i.msg,retcode:i.code,id:t.jSPlugin.params.id,type:"handleError"})})).catch((function(e){console.log("err",e)}))})).catch((function(e){console.log("对讲开启失败:",e)}))}},{key:"stopTalk",value:function(){window.stopTalk(),this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopTalk",{eventType:"stopTalk",code:0,target:this,msg:"结束对讲"}),document.getElementById("myaudio")&&document.getElementById("myaudio").srcObject&&document.getElementById("myaudio").srcObject.getTracks()[0].stop()}},{key:"changeTalkChannelNo",value:function(e){window.EZUIKit.opt&&window.EZUIKit.opt.channelNo&&(this.talkChannelNo=e,window.EZUIKit.opt.channelNo=e)}}]),e}(),he=function(){function e(t){var i=this;r(this,e),this.jSPlugin=t,this.pluginStatus=new F(this,this.jSPlugin.id);var n=document.createElement("style");n.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(n);var a=document.createElement("div");a.className="mobile-ez-ptz-container",a.id="mobile-ez-ptz-container",a.style="display:inline-block;width: ".concat(this.jSPlugin.width,"px;text-align:center;");var o=document.createElement("div");o.className="live-ptz-title",o.id="live-ptz-title",o.innerHTML="云台控制",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="请通过操控云台来调整摄像机视角",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    <div class="mobile-ez-ptz-container" id="mobile-ez-ptz-container">\n      <div class="ez-ptz-main center"></div>\n      <div class="mobile-ez-ptz-icon top default"></div>\n      <div class="mobile-ez-ptz-icon left default"></div>\n      <div class="mobile-ez-ptz-icon bottom default"></div>\n      <div class="mobile-ez-ptz-icon right default"></div>\n    </div>\n      ',document.getElementById("mobile-ez-ptz-item")||a.appendChild(l),g(a,document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.getElementById("mobile-ez-ptz-item").ontouchstart=function(e){e.preventDefault(),console.log("触摸开始"),i._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").ontouchend=function(e){e.preventDefault(),console.log("触摸结束",e),i._handlePtzTouch(e,"stop")},document.getElementById("mobile-ez-ptz-item").onmousedown=function(e){e.preventDefault(),console.log("触摸开始"),i._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").onmouseup=function(e){e.preventDefault(),console.log("触摸结束",e),i._handlePtzTouch(e,"stop")}}return s(e,[{key:"show",value:function(){document.getElementById("mobile-ez-ptz-item").style="display: inline-block"}},{key:"hide",value:function(){document.getElementById("mobile-ez-ptz-item").style="display: none"}},{key:"_handlePtzTouch",value:function(e,t){var i=this,n=document.getElementById("mobile-ez-ptz-item").getBoundingClientRect(),a=n.left+130,r=n.top+130,o=(e.x||e.changedTouches[0].clientX)-a,s=(e.y||e.changedTouches[0].clientY)-r,l=0,c=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start";Math.abs(o)>Math.abs(s)?o>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")):s>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(".concat(0===l?180:1===l?0:2===l?90:270,"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)"),"stop"===t&&(c=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",document.getElementById("mobile-ez-ptz-item").style="",document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("active","default"));var d=new FormData;d.append("deviceSerial",P(this.jSPlugin.url).deviceSerial),d.append("channelNo",P(this.jSPlugin.url).channelNo),d.append("speed",1),d.append("direction",l),d.append("accessToken",this.jSPlugin.accessToken),fetch(c,{method:"POST",body:d}).then((function(e){return e.json()})).then((function(e){if(200==e.code);else{console.log(e.code,i.jSPlugin.i18n.t("server.ptz."+t+"."+e.code));var n=i.jSPlugin.i18n.t("server.ptz."+t+"."+e.code)||e.msg;i.pluginStatus.loadingSetText({text:n,color:"red",delayClear:2e3}),60005!=e.code&&60002!=e.code&&60003!=e.code&&60004!=e.code||(document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===l?180:1===l?0:2===l?90:270,"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"))}})).catch((function(e){console.log("云台调用异常",e)}))}}]),e}(),fe={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]},footer:{color:"#FFFFFF",backgroundColor:"rgb(0 0 0 / 0%)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-0",iconId:"play",part:"left",defaultActive:1,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-1",iconId:"capturePicture",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-2",iconId:"sound",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-3",iconId:"pantile",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-4",iconId:"recordvideo",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-5",iconId:"talk",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-6",iconId:"hd",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-7",iconId:"webExpend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-8",iconId:"expend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]}},xe={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},pe={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},me={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},_e={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},ge={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},ve={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},ye={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Se={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},be=[{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:me.data.header,footer:me.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:_e.data.header,footer:_e.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:ve.data.header,footer:ve.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:ge.data.header,footer:ge.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:ye.data.header,footer:ye.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:xe.data.header,footer:xe.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:pe.data.header,footer:pe.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:Se.data.header,footer:Se.data.footer}],Pe=function(){function e(t){var i=this;r(this,e),this.jSPlugin=t,this.enableZoom=!1,this.videoWidth=1920,this.videoHeight=1080,this.currentScale=1,this.currentPosition={x:0,y:0,xPercent:.1,yPercent:.1,xCurrentVideo:0,yCurrentVideo:0,left:0,top:0,right:1920,bottom:1080},this.clientRect=document.getElementById(t.id).getBoundingClientRect(),this.DOM=document.getElementById(t.id);var n=document.createElement("div");n.id="".concat(t.id,"-zoom-container");var a=document.getElementById("".concat(t.id,"-audioControls")),o=48;a&&(o=a.offsetHeight);var s=t.isMobile?"\n    -webkit-transform: scale(0.8);\n    -moz-transform: scale(0.8);\n    -ms-transform: scale(0.8);\n    transform: scale(0.8);\n    transform-origin: left bottom;":"";n.style="position: absolute;\n    display:none;\n    left: 12px;\n    bottom: ".concat(t.isMobile?"".concat(o+6,"px"):"80px",";\n    ").concat(s,"\n    ");var l='\n    <div\n    style="display: inline-flex;justify-content: space-between;flex-direction: column;width: 36px;height: 160px;background:rgba(0,0,0,0.60);border-radius: 2px;align-items: center;">\n    <div id="'.concat(this.jSPlugin.id,'-scale-value" style="font-size: 12px;color:#FFFFFF;margin:10px 0;">2.0X</div>\n    <div style="width: 20px;height: 20px;margin-bottom:4px;" id="').concat(this.jSPlugin.id,'-addScale">\n      <?xml version="1.0" encoding="utf-8"?>\n      <svg version="1.1" fill="#FFFFFF" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n         viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">\n      <title>放大</title>\n      <g id="矩形">\n        <rect class="st0" width="20" height="20" fill="none"/>\n      </g>\n      <g id="形状结合">\n        <path class="st1" d="M10,3.8c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2S3.8,13.5,3.8,10S6.5,3.8,10,3.8z M10,5c-2.8,0-5,2.2-5,5\n          s2.2,5,5,5s5-2.2,5-5S12.8,5,10,5z"/>\n      </g>\n      <g id="路径-4">\n        <path class="st2" d="M12.5,10.7h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S12.8,10.7,12.5,10.7z"/>\n      </g>\n      <g id="路径-4备份">\n        <path class="st2" d="M10,13.2c-0.3,0-0.6-0.3-0.6-0.6v-5c0-0.3,0.3-0.6,0.6-0.6s0.6,0.3,0.6,0.6v5C10.6,12.9,10.3,13.2,10,13.2z"/>\n      </g>\n      </svg>\n    </div>\n    <div style="\n    position: relative;\n    width: 2px;\n    height: 64px;\n    border-radius: 2px;\n    background: rgba(255,255,255,0.75);\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: flex-end;">\n    <div class="scale-body-line-dot" id="').concat(this.jSPlugin.id,'-scale-body-line-dot" style="width: 6px;\n      height: 6px;\n      background: #FFFFFF;\n      border-radius: 100%;\n      position: absolute;\n      border: 1px solid #407AFF;"></div>\n      <div id="').concat(this.jSPlugin.id,'-line-dot" style="width: 2px;\n      height: 0%;\n      border-radius: 2px;\n      background: #407AFF;\n      bottom: 0;"></div>\n    </div>\n    <div style="width: 20px;height: 20px;margin: 4px 0 10px;" id="').concat(this.jSPlugin.id,'-subScale">\n      <?xml version="1.0" encoding="utf-8"?>\n      <svg fill="#FFFFFF" version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n        viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">\n        <title>缩小</title>\n        <g id="矩形">\n          <rect class="st0" width="20" height="20" fill="none"/>\n        </g>\n        <g id="形状结合">\n          <path class="st1" d="M10,3.8c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2S3.8,13.5,3.8,10S6.5,3.8,10,3.8z M10,5c-2.8,0-5,2.2-5,5\n            s2.2,5,5,5s5-2.2,5-5S12.8,5,10,5z"/>\n        </g>\n        <g id="路径-4">\n          <path class="st2" d="M12.5,10.7h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S12.8,10.7,12.5,10.7z"/>\n        </g>\n      </svg>\n    </div>\n  </div>\n    ');if(n.innerHTML=l,document.getElementById("".concat(t.id,"-audioControls-left"))&&(document.getElementById("".concat(t.id,"-audioControls-left")).parentNode.appendChild(n),document.getElementById("".concat(t.id,"-addScale")).onclick=function(){i.addScale()},document.getElementById("".concat(t.id,"-subScale")).onclick=function(){i.subScale()}),t.jSPlugin)try{var c=t.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=c.width||t.width,this.videoHeight=c.height||t.height,this.currentPosition.right=c.width,this.currentPosition.bottom=c.height,t.jSPlugin.bEZoom=!0}catch(e){}this._event()}return s(e,[{key:"_event",value:function(){var e=this,t=setInterval((function(){var i=document.getElementById("".concat(e.jSPlugin.id,"-container-0"));clearInterval(t),e.jSPlugin.isMobile?i&&(i.addEventListener("touchstart",(function(t){return e.onTouchstart(t)})),i.addEventListener("touchend",(function(t){return e.onTouchend(t)}))):i&&(i.addEventListener("mousedown",(function(t){return e.onMouseDown(t)})),i.addEventListener("mouseup",(function(t){return e.onMouseUp(t)})))}),100)}},{key:"onMouseDown",value:function(e){if(1===this.currentScale)return!1;this.moveX=e.clientX,this.moveY=e.clientY}},{key:"onMouseUp",value:function(e){var t=this.currentPosition;if(1===this.currentScale)return!1;t.left=t.left-(e.clientX-this.moveX),t.top=t.top-(e.clientY-this.moveY),this.doScale()}},{key:"onTouchstart",value:function(e){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 t=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=t.width,this.videoHeight=t.height,this.currentPosition.left=0,this.currentPosition.top=0,this.isMobileFullScreen?(this.currentPosition.right=t.height,this.currentPosition.bottom=t.width):(this.currentPosition.right=t.width,this.currentPosition.bottom=t.height),this.inited=!0}var i=e.touches[0];if(i){var n={clientX:0,clientY:0};n.clientX=i.clientX,n.clientY=i.clientY,this.point1=n}}},{key:"onTouchend",value:function(e){var t=this,i=this.currentPosition;if(1===this.currentScale)return!1;var n=e.changedTouches[0];this.isMobileFullScreen?(i.left=i.left-(n.clientY-t.point1.clientY),i.top=i.top+(n.clientX-t.point1.clientX)):(i.left=i.left-(n.clientX-t.point1.clientX),i.top=i.top-(n.clientY-t.point1.clientY)),t.doScale()}},{key:"renderDot",value:function(){var e=this.currentScale;document.getElementById("".concat(this.jSPlugin.id,"-scale-value"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-value")).innerHTML="".concat(e,".0X")),document.getElementById("".concat(this.jSPlugin.id,"-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-line-dot")).style.height="".concat((e-1)/7*100,"%")),document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot")).style.bottom="calc(".concat((e-1)/7*100,"% - 3px)"))}},{key:"getTopMostElement",value:function(e,t,i){var n=e?e.getBoundingClientRect():null,a=t?t.getBoundingClientRect():null,r=i?i.getBoundingClientRect():null;if(!n&&!a&&!r)return null;if(!n)return a.top<r.top?t:i;if(!a)return n.top<r.top?e:i;if(!r)return n.top<a.top?e:t;var o=[n.top,a.top,r.top],s=Math.max.apply(Math,o);return n.top===s?e:a.top===s?t:i}},{key:"handleFullscreen",value:function(e,t,i){this.clientRect={width:t,height:i}}},{key:"startZoom",value:function(){this._resetZoom(),document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="block");try{this.jSPlugin.jSPlugin.bEZoom=!0,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("startZoom",{eventType:"startZoom",code:0,target:this,msg:"开启电子放大"})}catch(e){console.log(e),this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("startZoom",{eventType:"startZoom",code:-1,target:this,msg:e||"开启电子放大失败"})}this.renderDot(),this.enableZoom=!0}},{key:"stopZoom",value:function(){this._resetZoom();try{this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopZoom",{eventType:"stopZoom",code:0,target:this,msg:"关闭电子放大"})}catch(e){this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopZoom",{eventType:"stopZoom",code:-1,target:this,msg:e||"关闭电子放大失败"})}document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="none")}},{key:"_resetZoom",value:function(){this.currentScale=1;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.currentPosition.right=e.width,this.currentPosition.bottom=e.height,this._JSPlayM4_SetDisplayRegion(0,this.videoWidth,0,this.videoHeight,!1),this.renderDot(),this.enableZoom=!1}},{key:"doScale",value:function(){var e=this.currentPosition,t=this.currentScale;e.left=e.left+e.xPercent*(e.right-e.left)-this.videoWidth/t*.5,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+e.yPercent*(e.bottom-e.top)-this.videoHeight/t*.5,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<e.right&&e.top<e.bottom&&e.bottom<=this.videoHeight&&e.right<=this.videoWidth&&this._JSPlayM4_SetDisplayRegion(e.left,e.right,e.top,e.bottom,1!=t,this.isMobileFullScreen)}catch(e){console.log(e)}this.renderDot()}},{key:"addScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomAdd",{eventType:"zoomAdd",code:1,target:this,msg:"执行放大"});var t=this.currentScale,i=this.currentPosition;return t>=8?(console.log("达到最大倍率了"),this.jSPlugin.Message&&this.jSPlugin.Message.default("已经放大到最大倍数8.0X",document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale+e,this.currentScale>8?(console.log("超出最大倍率"),this.jSPlugin.Message&&this.jSPlugin.Message.default("超出最大倍率8.0X",document.getElementById("".concat(this.jSPlugin.id))),!1):(i.xPercent=.5,i.yPercent=.5,void this.doScale()))}},{key:"subScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomSub",{eventType:"zoomSub",code:1,target:this,msg:"执行缩小"});var t=this.currentScale,i=this.currentPosition;return t<=1?(console.log("达到最小倍率了"),this.jSPlugin.Message&&this.jSPlugin.Message.default("已经缩小到最小倍数1.0X",document.getElementById("".concat(this.jSPlugin.id))),!1):t<=1?(console.log("达到最小倍率了"),!1):(this.currentScale=this.currentScale-e,this.currentScale<1?(console.log("超出最小倍率"),this.jSPlugin.Message&&this.jSPlugin.Message.default("超出最小倍率1.0X",document.getElementById("".concat(this.jSPlugin.id))),!1):(i.xPercent=.5,i.yPercent=.5,void this.doScale()))}},{key:"_JSPlayM4_SetDisplayRegion",value:function(e,t,i,n,a){this.jSPlugin&&this.jSPlugin.jSPlugin&&this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(e,t,i,n,a,this.isMobileFullScreen)}},{key:"isMobileFullScreen",get:function(){return!!(T()&&this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state.expend)}}]),e}(),Ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},s="";o=Object.assign(o,r);var l=new Headers;Object.keys(o).map((function(e){l.append(e,o[e])})),o=l,Object.keys(Object.assign({},i)).forEach((function(e){var t=i[e];"string"==typeof i[e]&&(t=i[e].replace("%","%25")),void 0!==i[e]&&(s+="&".concat(e,"=").concat(encodeURIComponent(t)))})),s.length>0&&(s=-1!==["GET","PUT","DELETE"].indexOf(t.toUpperCase())?"?".concat(s.slice(1)):s.slice(1));var c=e+(-1!==["GET","PUT","DELETE"].indexOf(t.toUpperCase())?s:""),d={headers:o,method:t};"POST"===t&&(d.body=s),"POST"===t&&r&&"application/json"===r["Content-Type"]&&(d.body=JSON.stringify(i)),"GET"===t&&(-1===c.indexOf("?")?c+="?_r=".concat(Math.random()):c+="&_r=".concat(Math.random())),fetch(c,d).then((function(e){var t=e.headers.get("content-type");return t&&-1!==t.indexOf("application/json")?e.json():e.text()})).then((function(e){n&&n(e)})).catch((function(e){a&&a(e)}))},Ce=function(e,t,i,n,a,r){return'\n<svg  id="'.concat(e,'-hdSelect-icon" class="theme-icon-item-icon ').concat(t,"-btn\" data-type='hd' style=\"display: ").concat(["hd","0"].includes(r.level)?"flex":"none",'"  fill="').concat(i,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(n>a?48:32,'" height="').concat(n>a?48:32,'" viewBox="-6 -6 32 32">\n    <path d="M17.4,16.5H3.1c-0.8,0-1.4-0.6-1.4-1.4V5.4c0-0.9,0.7-1.6,1.6-1.6h14.1c0.8,0,1.4,0.6,1.4,1.4v9.8 C18.8,15.9,18.2,16.5,17.4,16.5z M3.3,5C3.1,5,2.9,5.2,2.9,5.4v9.7c0,0.2,0.1,0.3,0.3,0.3h14.3c0.2,0,0.3-0.1,0.3-0.3V5.3 c0-0.2-0.1-0.3-0.3-0.3H3.3z" />\n    <path d="M13.3,13.6h-1.6c-0.4,0-0.7-0.3-0.7-0.7V7.4c0-0.4,0.3-0.7,0.7-0.7h1.6c1.2,0,2.2,1,2.2,2.2v2.4 C15.6,12.6,14.6,13.6,13.3,13.6z M12.2,12.5h1.1c0.6,0,1.1-0.5,1.1-1.1V9c0-0.6-0.5-1.1-1.1-1.1h-1.1V12.5z" />\n    <path d="M5.5,13.6c-0.3,0-0.6-0.2-0.6-0.6V7.3C5,7,5.2,6.8,5.5,6.8S6.1,7,6.1,7.3v5.7C6.1,13.4,5.8,13.6,5.5,13.6z" />\n    <path d="M9.2,13.6c-0.3,0-0.6-0.2-0.6-0.6V7.3c0-0.3,0.2-0.6,0.6-0.6S9.8,7,9.8,7.3v5.7C9.8,13.4,9.5,13.6,9.2,13.6z" />\n    <rect x="5.6" y="9.6" width="3.6" height="1.1" />\n</svg>\n')},Te=function(e,t,i,n,a,r){return'\n<svg id="'.concat(e,'-sdSelect-icon" class="theme-icon-item-icon ').concat(t,"-btn\" data-type='sd' style=\"display: ").concat(["sd","1"].includes(r.level)?"flex":"none",'"  fill="').concat(i,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(n>a?48:32,'" height="').concat(n>a?48:32,'" viewBox="-6 -8 40 44">\n    <path d="M24.1,23.8h-20c-1.1,0-1.9-0.9-1.9-1.9V8.4c0-1.2,1-2.2,2.1-2.2h19.7c1.1,0,1.9,0.9,1.9,1.9v13.8\n        C26,23,25.1,23.8,24.1,23.8z M4.3,7.7C4,7.7,3.7,8,3.7,8.4v13.5c0,0.2,0.2,0.4,0.4,0.4h20c0.2,0,0.4-0.2,0.4-0.4V8.2\n        c0-0.2-0.2-0.4-0.4-0.4H4.3z"/>\n    <path d="M18.4,19.8h-2.2c-0.5,0-0.9-0.4-0.9-0.9v-7.8c0-0.5,0.4-0.9,0.9-0.9h2.2c1.7,0,3.1,1.4,3.1,3.1v3.3\n    C21.5,18.4,20.1,19.8,18.4,19.8z M16.7,18.3h1.6c0.9,0,1.6-0.7,1.6-1.6v-3.3c0-0.9-0.7-1.6-1.6-1.6h-1.6V18.3z"/>\n    <path d="M10.5,19.8c1.2,0,2.1-0.3,2.7-0.9c0.6-0.6,0.9-1.3,0.9-2.1c0-0.8-0.3-1.4-0.9-1.8c-0.4-0.2-1.1-0.5-2.2-0.8\n        l0,0l-1-0.2c-0.4-0.1-0.8-0.2-1-0.4c-0.4-0.2-0.6-0.5-0.6-0.9c0-0.4,0.1-0.6,0.4-0.9s0.7-0.3,1.3-0.3c0.8,0,1.4,0.2,1.8,0.6\n        c0.2,0.3,0.3,0.6,0.4,0.9l0,0h1.4c0-0.6-0.2-1.1-0.5-1.6c-0.6-0.8-1.6-1.2-2.9-1.2c-1,0-1.8,0.3-2.4,0.8c-0.6,0.5-0.9,1.2-0.9,2\n        c0,0.7,0.3,1.3,1,1.7c0.4,0.2,0.9,0.4,1.7,0.6l0,0l1.2,0.3c0.6,0.2,1.1,0.3,1.3,0.4c0.3,0.2,0.5,0.5,0.5,0.9c0,0.5-0.2,0.9-0.6,1.1\n        s-0.9,0.4-1.5,0.4c-0.9,0-1.6-0.2-2-0.7c-0.2-0.3-0.3-0.6-0.4-1.1l0,0H6.8c0,0.9,0.3,1.6,0.9,2.2C8.2,19.5,9.2,19.8,10.5,19.8z"/>\n    <defs>\n    <filter id="Adobe_OpacityMaskFilter" filterUnits="userSpaceOnUse" x="15.2" y="10.3" width="6.2" height="9.5">\n        <feColorMatrix  type="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 1 0"/>\n    </filter>\n    </defs>\n    <mask maskUnits="userSpaceOnUse" x="15.2" y="10.3" width="6.2" height="9.5" id="mask-2_2_">\n    <g class="st2">\n        <path id="path-1_2_" class="st3" d="M24.1,23.1h-20c-0.6,0-1.2-0.5-1.2-1.2V8.2C2.9,7.5,3.5,7,4.1,7h19.7c0.8,0,1.4,0.6,1.4,1.4\n        v13.5C25.2,22.6,24.7,23.1,24.1,23.1z"/>\n    </g>\n    </mask>\n    <defs>\n    <filter id="Adobe_OpacityMaskFilter_1_" filterUnits="userSpaceOnUse" x="6.8" y="10.3" width="7.3" height="9.5">\n        <feColorMatrix  type="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 1 0"/>\n    </filter>\n    </defs>\n    <mask maskUnits="userSpaceOnUse" x="6.8" y="10.3" width="7.3" height="9.5" id="mask-2_3_">\n    <g class="st5">\n        <path id="path-1_3_" class="st3" d="M24.1,23.1h-20c-0.6,0-1.2-0.5-1.2-1.2V8.2C2.9,7.5,3.5,7,4.1,7h19.7c0.8,0,1.4,0.6,1.4,1.4\n        v13.5C25.2,22.6,24.7,23.1,24.1,23.1z"/>\n    </g>\n    </mask>\n</svg>\n')},Re=[{name:"高清",level:"0",streamType:1,icon:Ce},{name:"标清",level:"1",streamType:1,icon:Te}],we=[{name:"高清",level:"hd",streamType:1,icon:Ce},{name:"标清",level:"sd",streamType:2,icon:Te}],Ie=function(e,t,i,n){var a="".concat(e.env.domain,"/api/service/media/template/getDetail?accessToken=").concat(e.accessToken,"&id=").concat(t);fetch(a,{method:"GET"}).then((function(e){return e.json()})).then((function(e){var t;console.log("get theme data",e),t=e,console.log(t),t.meta&&i(t)})).catch((function(e){var t;t=e,console.log(t),n(t)}))};function De(e){var t=new W,i=new FormData;for(var n in e)i.append(n,e[n]);return t.fetch("/api/lapp/device/info",{method:"POST",body:i})}var ke=function(e){var t="";return Object.keys(e).map((function(i,n){t+="".concat(i,":").concat(e[i]).concat(n<Object.keys(e).length-1?";":"")})),t},Fe=500,Ae=function(){function e(t){var i=this;if(r(this,e),this.jSPlugin=t,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.recordTimer=null,this.nextRate=1,this.showHD=!1,this.themeInited=!1,this.decoderState={state:{isEditing:!1,play:!1,pauseDate:null,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,zoom:!1,pantile:!1,hd:{},hdList:[],speed:!1,expend:!1,webExpend:!1,cloudRec:"cloud.rec"===P(t.url).type,rec:"rec"===P(t.url).type,type:P(t.url).type}},this.allowZoom=!this.jSPlugin.use3DZoom,this.zoomDisable=!1,this.pluginStatus=new F(this,this.jSPlugin.params.id),this.inited=!1,this.isMobile=T(),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.pauseTime=null,this.themeData=fe,this.deviceQ,this.jSPlugin.themeId)switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"security":case"voice":case"simple":case"miniRec":var n=k.find(be,(function(e){return e.themeId===i.jSPlugin.themeId}));n&&(this.themeData=n),this.initThemeData();break;case"themeData":this.themeData=this.jSPlugin.params.themeData,this.initThemeData();break;default:this.fetchThemeData(this.jSPlugin.themeId)}this.jSPlugin.Talk||(this.jSPlugin.Talk=new ue(this.jSPlugin)),p("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),p("".concat(this.jSPlugin.staticPath,"/css/theme.css")),this._warpFullScreen()}return s(e,[{key:"fetchThemeData",value:function(e){var t=this;Ie(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data&&(t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header.btnList=t.themeData.header.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer.btnList=t.themeData.footer.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}},{key:"changeTheme",value:function(e){var t=this;if("string"==typeof e)switch(this.jSPlugin.themeId=e,this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"security":case"voice":case"simple":case"miniRec":var i=k.find(be,(function(e){return e.themeId===t.jSPlugin.themeId}));i&&(this.themeData=i),this.initThemeData();break;default:this.fetchThemeData(e)}else"object"===a(e)&&(this.themeData=e,this.initThemeData(),this.decoderState.state.isEditing&&this.editStart());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(e)}},{key:"renderThemeData",value:function(){var e=this,t=this.themeData,i=t.header,n=t.footer;if(this.isNeedRenderHeader&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i.color.replace("-diy",""),i.btnList.map((function(t,i){t.isrender&&e.setDecoderState(l({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&n)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=n.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n.color.replace("-diy",""),this.jSPlugin.params.extraBtn&&(n.btnList=[].concat(c(n.btnList),c(this.jSPlugin.params.extraBtn))),n.btnList.map((function(t,i){if(t.isrender&&e.setDecoderState(l({},t.iconId,e.decoderState.state[t.iconId])),"play"===t.iconId&&t.defaultActive&&!e.themeInited)var n=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(n),e.jSPlugin.play(),e.themeInited=!0)}),50)})),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),e.startAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===P(this.jSPlugin.url).type,rec:"rec"===P(this.jSPlugin.url).type,type:P(this.jSPlugin.url).type});else if(!this.themeInited)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),e.jSPlugin.play(),e.themeInited=!0)}),50);k.findIndex(this.themeData.footer.btnList,(function(e){return"zoom"===e.iconId&&e.isrender>0}))>=0&&(this.isMobile&&!this.jSPlugin.use3DZoom&&(this.jSPlugin.beforeMobileZoomVerify=function(){return!!e.decoderState.state.play}),this.jSPlugin.Zoom=new Pe(this.jSPlugin)),setTimeout((function(){document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen||e.jSPlugin.jSPlugin.JS_Resize(e.jSPlugin.width,e.jSPlugin.height-e._extendHeadeTimeLinrHight(!1,!1))}),50)}},{key:"setDecoderState",value:function(e){var t=this,i=this.themeData,n=i.header,a=i.footer;Object.keys(e).map((function(i,r){var o="#FFFFFF",s="#FFFFFF";switch(-1===n.btnList.findIndex((function(e){return e.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":e[i]?document.getElementById("".concat(t.jSPlugin.id,"-play"))&&(document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-play")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[0].style.fill=e[i]?s:o):document.getElementById("".concat(t.jSPlugin.id,"-play"))&&(document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-play")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[1].style.fill=e[i]?s:o);break;case"sound":document.getElementById("".concat(t.jSPlugin.id,"-sound"))&&(e[i]?(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[i]?s:o):(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[0].style.fill=e[i]?s:o));break;case"recordvideo":document.getElementById("".concat(t.jSPlugin.id,"-recordvideo"))&&(document.getElementById("".concat(t.jSPlugin.id,"-recordvideo")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-recordvideo-content")).childNodes[0].style.fill=e[i]?s:o,e[i]?t.countTime("add",0):t.countTime("destroy",0));break;case"talk":document.getElementById("".concat(t.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(t.jSPlugin.id,"-talk")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[i]?s:o);break;case"zoom":document.getElementById("".concat(t.jSPlugin.id,"-zoom"))&&(document.getElementById("".concat(t.jSPlugin.id,"-zoom")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-zoom-content")).childNodes[1].style.fill=e[i]?s:o);break;case"pantile":document.getElementById("".concat(t.jSPlugin.id,"-pantile"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-pantile-content")).childNodes[0].style.fill=e[i]?s:o);break;case"webExpend":e[i]?(document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className="disabled")):(document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className="")),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[0].style.fill=e[i]?s:o,document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[1].style.fill=e[i]?s:o);break;case"capturePicture":document.getElementById("".concat(t.jSPlugin.id,"-capturePicture"))&&(document.getElementById("".concat(t.jSPlugin.id,"-capturePicture")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-capturePicture-content")).childNodes[0].style.fill=e[i]?s:o);break;case"expend":e[i]?(document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className="disabled")):(document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className="")),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[0].style.fill=e[i]?s:o,document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[1].style.fill=e[i]?s:o);break;case"hd":break;case"speed":if(document.getElementById("".concat(t.jSPlugin.id,"-speed"))){var l=document.getElementById("".concat(t.jSPlugin.id,"-speed-content")).children[1].children[0];"not-allowed"!==l.style.cursor&&(l.style.color=e[i]?s:o,l.style.borderColor=e[i]?s:o)}document.getElementById("".concat(t.jSPlugin.id,"-select-mask"))&&(t.isMobile&&e[i]?document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="block":document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="none");break;case"cloudRec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[i]?s:o),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[i]?o:s);break;case"cloudRecord":var c=document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord"));c&&(c.className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=e[i]?s:o),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[i]?o:s);break;case"rec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[i]?o:s),document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=e[i]?o:s),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[i]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[i]?s:o)}t.decoderState.state=Object.assign(t.decoderState.state,e)}))}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer)}},{key:"hideFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="none")}},{key:"showFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="block")}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"renderFooter",value:function(e,t){var i=this,n=this.matchBtn(e),a=document.createElement("div");a.className="theme-icon-item",a.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-content" title="').concat(n.title,'" style="height:').concat(this.jSPlugin.width>Fe?48:32,'px;display: flex;align-items: center;position:relative;">')).concat(n.domString,"</div>")+"</span>",a.onclick=function(e){if(i.decoderState.state.isEditing)return!1;n.onclick(e)},n.onmouseenter&&(a.onmouseenter=function(e){if(i.decoderState.state.isEditing)return!1;n.onmouseenter(e)}),n.onmouseleave&&(a.onmouseleave=function(e){if(i.decoderState.state.isEditing)return!1;n.onmouseleave(e)});var r=document.createElement("span");r.className="icon-move left",r.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-left" title="左移" style="position: absolute;top: calc(50% - 10px);left: -4px;"><svg fill="#ffffff" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="24" viewBox="0 0 10 15" style="background:#00000080;"><path d="M7.4,10V5.3c0-0.3-0.3-0.6-0.6-0.6c-0.1,0-0.3,0.1-0.4,0.2L3.7,7.4c-0.2,0.2-0.3,0.6,0,0.8 c0,0,0,0,0.1,0.1l2.7,2.2c0.2,0.2,0.6,0.2,0.8-0.1C7.3,10.3,7.4,10.2,7.4,10z"></path></svg></span>'),r.onclick=function(){i.editIcon(n.id,"left","footer")},a.appendChild(r);var o=document.createElement("span");o.className="icon-move right",o.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-right" class="ezuikit-theme-icon" title="右移" style="position: absolute;top: calc(50% - 10px);left: calc(100% - 8px);"><svg fill="#ffffff" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="24" viewBox="0 0 10 15" style="background:#00000080"><path d="M3.4,5.2v4.7c0,0.3,0.3,0.6,0.6,0.6c0.1,0,0.3-0.1,0.4-0.2l2.7-2.5c0.2-0.2,0.3-0.6,0-0.8 c0,0,0,0-0.1-0.1L4.4,4.8C4.1,4.6,3.8,4.6,3.6,4.9C3.5,5,3.4,5.1,3.4,5.2z"></path></svg></span>'),o.onclick=function(){i.editIcon(n.id,"right","footer")},a.appendChild(o);var s=document.createElement("span");s.className="icon-move close",s.innerHTML='<span id="'.concat(n.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: -10px;right: -10px;">')+'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 15 15"><circle style="fill-rule:evenodd;clip-rule:evenodd;fill-opacity:0.8011;" cx="7.5" cy="7.6" r="7" /><rect x="3.9" y="3.5" class="st1" style="fill:none;" width="8.1" height="8.1" /><line style="fill:none;stroke:#ffffff;stroke-width:0.5833;stroke-linecap:round;" x1="4.9" y1="5" x2="10" y2="10.1" /><line style="fill:none;stroke:#ffffff;stroke-width:0.5833;stroke-linecap:round;" x1="4.9" y1="10.1" x2="10" y2="5" /></svg></span>',s.onclick=function(){i.editIcon(n.id,"delete","footer")},a.appendChild(s),"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[0].appendChild(a):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[1].appendChild(a)}},{key:"editIcon",value:function(e,t,i){console.log("编辑组件",e,t,i);var n=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[i].btnList,r=k.findIndex(a,(function(t){return t.iconId===e})),o=a[r];switch(t){case"delete":if("rec"===e){if(-1===k.findIndex(a,(function(e){return"cloudRec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===e&&-1===k.findIndex(a,(function(e){return"rec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1;a[r].isrender=0;break;case"right":for(var s=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){s=l;break}-1!==s&&(a[r]=a[s],a[s]=o);break;case"left":for(var c=-1,d=r-1;d>=0;d--)if(a[d].part===a[r].part&&1==a[d].isrender){c=d;break}-1!==c&&(a[r]=a[c],a[c]=o)}n[i].btnList=a,this.changeTheme(n)}},{key:"renderHeader",value:function(e,t){var i=this,n=this.matchBtn(e),a=document.createElement("div");a.className="theme-icon-item",a.style="max-width:50%;",a.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'" style="position:relative;";>')+'<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-content" title="').concat(n.title,'" style="display:inline-block;height:').concat(this.width>Fe?48:32,'px;">')).concat(n.domString,"</span>")+'<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-remove" title="移除" style="position: absolute;top: -6px;left: 38px;display: none;">')+'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 15 15"><circle style="fill-rule:evenodd;clip-rule:evenodd;fill-opacity:0.8011;" cx="7.5" cy="7.6" r="7" /><rect x="3.9" y="3.5" class="st1" style="fill:none;" width="8.1" height="8.1" /><line style="fill:none;stroke:#ffffff;stroke-width:0.5833;stroke-linecap:round;" x1="4.9" y1="5" x2="10" y2="10.1" /><line style="fill:none;stroke:#ffffff;stroke-width:0.5833;stroke-linecap:round;" x1="4.9" y1="10.1" x2="10" y2="5" /></svg></span></span>',a.onclick=function(e){if(i.decoderState.state.isEditing)return!1;n.onclick(e)};var r=document.createElement("span");r.className="icon-move close",r.innerHTML='<span id="'.concat(n.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: -6px;right: -6px;">')+'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 15 15"><circle style="fill-rule:evenodd;clip-rule:evenodd;fill-opacity:0.8011;" cx="7.5" cy="7.6" r="7" /><rect x="3.9" y="3.5" class="st1" style="fill:none;" width="8.1" height="8.1" /><line style="fill:none;stroke:#ffffff;stroke-width:0.5833;stroke-linecap:round;" x1="4.9" y1="5" x2="10" y2="10.1" /><line style="fill:none;stroke:#ffffff;stroke-width:0.5833;stroke-linecap:round;" x1="4.9" y1="10.1" x2="10" y2="5" /></svg></span>',r.onclick=function(){i.editIcon(n.id,"delete","header")},a.appendChild(r),"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(a):document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[1].appendChild(a)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var n=document.createElement("div");n.id=this.jSPlugin.id+"time-area",n.className="time-area",n.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(n)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var a=t;document.getElementById(i.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++a,document.getElementById(i.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),i=0,n=0,a="00",r="00",o="00";t>59&&(i=parseInt(t/60),t=parseInt(t%60),i>59&&(n=parseInt(i/60),i=parseInt(i%60)));return a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),o=parseInt(n)>9?parseInt(n):"0"+parseInt(n),n>0?o+":"+r+":"+a:i>0?r+":"+a:"00:"+a}(a)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(i.jSPlugin.id+"time-area")&&(document.getElementById(i.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(i.jSPlugin.id+"time-area").style.display="none"))}},{key:"setDisabled",value:function(e){var t=this.decoderState.state.sound,i=e?"cursor: not-allowed; color: gray; fill: gray; ":"cursor: default";null!=document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon")).setAttribute("style",e?"cursor: not-allowed; color: gray; fill: gray;":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon")).setAttribute("style",i),null!=document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon")).setAttribute("style",i),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",i),this.allowZoom||null!=document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon")).setAttribute("style",i),document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon"))&&"none"!=document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).style.display&&document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).setAttribute("style",i);var n=document.getElementsByClassName("".concat(this.jSPlugin.id,"-select-quality-btn"));if(n.length)for(var a=0;a<n.length;a++)e?(n[a].style.cursor="not-allowed",n[a].style.color="gray",n[a].style.fill="gray"):(n[a].style.cursor="default",n[a].style.fill="",n[a].style.color="");null!=document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).setAttribute("style",document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).getAttribute("style")+";"+(e?"cursor: not-allowed; color: gray; border-color: gray;":"cursor: default; color: #ffffff;border-color: #ffffff;")),this.zoomDisable=this.jSPlugin.use3DZoom&&e}},{key:"matchBtn",value:function(e){var t=this,i=this.themeData,n=i.header,r=i.footer,o={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===n.btnList.findIndex((function(t){return t.iconId===e}))?(o.color=r.color,o.backgroundColor=r.backgroundColor,o.activeColor=r.activeColor):(o.color=n.color,o.backgroundColor=n.backgroundColor,o.activeColor=n.activeColor);var s,l,d,u,h,f=this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf("cloud.rec");switch(e){case"play":o.title=this.jSPlugin.i18n.t("client.theme.BTN_PLAY"),o.id=e,o.domString='<div style="height: 100%">'+'<svg id="'.concat(this.jSPlugin.id+"-play-icon",'" class="theme-icon-item-icon" style="display:none" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'"  fill="').concat(o.color,'" viewBox="-6 -6 32 32">\n            <path id="Stroke-1" class="st1" d="M10.5,1.7c-4.9,0-8.8,4-8.8,8.8s4,8.8,8.8,8.8s8.8-4,8.8-8.8S15.4,1.7,10.5,1.7z M10.5,2.7\n              c4.3,0,7.8,3.5,7.8,7.8s-3.5,7.8-7.8,7.8s-7.8-3.5-7.8-7.8S6.2,2.7,10.5,2.7z"/>\n            <path class="st2" d="M8.7,8C9,8,9.3,8.3,9.3,8.6v3.8C9.3,12.7,9,13,8.7,13C8.3,13,8,12.7,8,12.4V8.6C8,8.3,8.3,8,8.7,8z"/>\n            <path id="Rectangle-Copy-10" class="st2" d="M12.8,8c0.3,0,0.6,0.3,0.6,0.6v3.8c0,0.3-0.3,0.6-0.6,0.6c-0.3,0-0.6-0.3-0.6-0.6V8.6\n              C12.2,8.3,12.5,8,12.8,8z"/>\n          </svg>')+'<svg id="'.concat(this.jSPlugin.id+"-stop-icon",'" class="theme-icon-item-icon" fill="').concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M13,9.8L10.1,8C9.9,7.9,9.7,7.9,9.5,7.9c-0.6,0-1,0.4-1,1v3.7c0,0.2,0.1,0.4,0.2,0.5c0.3,0.5,0.9,0.6,1.4,0.3 l2.9-1.8c0.1-0.1,0.2-0.2,0.3-0.3C13.6,10.7,13.4,10.1,13,9.8z" /><path d="M10.5,1.9c-4.9,0-8.8,4-8.8,8.8c0,4.9,4,8.8,8.8,8.8s8.8-4,8.8-8.8C19.4,5.8,15.4,1.9,10.5,1.9z M10.5,18.5 c-4.3,0-7.8-3.5-7.8-7.8s3.5-7.8,7.8-7.8c4.3,0,7.8,3.5,7.8,7.8S14.9,18.5,10.5,18.5z" /></svg></div>',o.onclick=function(){var e=t.decoderState.state,i=e.play,n=e.isEditing,a=e.rec,r=e.cloudRec,o=e.recordvideo,s=e.pantile;if(n)return!1;Array.isArray(window.recTimer)&&window.recTimer.map((function(e){clearInterval(e)})),i?(a||r?(t.Rec&&t.Rec.unSyncTimeLine(),t.jSPlugin.pause().then((function(){t.setDecoderState({play:!i}),t.setDisabled(i)}))):(t.jSPlugin.stop().then((function(){t.setDecoderState({play:!i}),t.setDisabled(i)})),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),o&&t.setDecoderState({recordvideo:!1})):(a||r?(t.Rec&&t.Rec.syncTimeLine(),t.jSPlugin.resume().then((function(){t.setDecoderState({play:!i}),t.setDisabled(i)}))):t.jSPlugin.play().then((function(){t.setDecoderState({play:!i}),t.setDisabled(i)})),t.jSPlugin.use3DZoom&&t.resetMobileZoomStatus()),t.jSPlugin.use3DZoom?(t.setDecoderState({zoom:!1}),t.allowZoom=!1):t.allowZoom=a||r,s&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none"),t.setDecoderState({speed:!1})};break;case"sound":o.title=this.jSPlugin.i18n.t("client.theme.BTN_SOUND"),o.id=e,o.domString='<span style="height: 100%">'+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-nosound-icon" style="display:none" fill="').concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">\n            <path d="M8.5,4.2c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8C5,13.2,5,12.9,5.1,12.7 c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3L9.2,5L5.9,7.8 C5.6,7.9,5.3,7.9,5.1,7.7C5,7.5,5,7.3,5.1,7.1L5.2,7L8.5,4.2z"/>\n            <path d="M5.5,6.9C5.8,6.9,6,7.1,6,7.4c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2C3.4,7.9,3.3,8,3.2,8.2l0,0.1v4 c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,12.5,6,12.7,6,13c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4 c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n            <path d="M17.4,7.9c0.2-0.2,0.5-0.2,0.7,0c0.2,0.2,0.2,0.4,0.1,0.6l-0.1,0.1l-3.8,3.8c-0.2,0.2-0.5,0.2-0.7,0 c-0.2-0.2-0.2-0.4-0.1-0.6l0.1-0.1L17.4,7.9z"/>\n            <path d="M13.7,7.9c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.8,3.8c0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1-0.1 l-3.7-3.8C13.5,8.4,13.5,8.1,13.7,7.9z"/>\n            </svg>')+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-sound-icon" style="display:inline-block" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" fill="').concat(o.color,'" viewBox="-6 -6 32 32">\n              <path d="M13.2,7.1c0.1-0.2,0.5-0.3,0.7-0.2c1.1,0.7,1.9,2.2,1.9,3.7c0,1.6-0.7,3-1.9,3.7\n                c-0.2,0.1-0.5,0.1-0.7-0.2c-0.1-0.2-0.1-0.5,0.2-0.7c0.8-0.5,1.4-1.6,1.4-2.9c0-1.3-0.6-2.4-1.4-2.9C13.1,7.6,13,7.3,13.2,7.1z"/>\n              <path d="M15.7,4.5c0.2-0.2,0.5-0.2,0.7-0.1C18,5.8,19,8.2,19,10.7c0,2.5-1,4.8-2.7,6.3\n                c-0.2,0.2-0.5,0.2-0.7-0.1c-0.2-0.2-0.2-0.5,0.1-0.7c1.4-1.2,2.3-3.3,2.3-5.5c0-2.2-0.9-4.3-2.3-5.5C15.5,5,15.5,4.7,15.7,4.5z"/>\n              <path id="Stroke-5" class="st1" d="M8.5,4.7c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8\n                C5,13.7,5,13.4,5.1,13.2c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3l-0.1,0\n                L5.9,8.3C5.6,8.4,5.3,8.4,5.1,8.2C5,8,5,7.7,5.1,7.6l0.1-0.1L8.5,4.7z"/>\n              <path  d="M5.5,7.4C5.8,7.4,6,7.6,6,7.9c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.2,0-0.3,0.1-0.3,0.3l0,0.1v4\n                c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,13,6,13.2,6,13.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4\n                c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n            </svg>')+"</span>",o.onclick=function(){var e=t.decoderState.state,i=e.play,n=e.sound,a=e.talk,r=e.pantile;i&&!a&&(n?(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})):(t.jSPlugin.openSound(),t.setDecoderState({sound:!0})),r&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})))};break;case"recordvideo":if(f)break;o.title=this.jSPlugin.i18n.t("client.theme.BTN_RECORDVIDEO"),o.id=e,o.domString='<svg id="'.concat(this.jSPlugin.id,'-recordvideo-icon" class="theme-icon-item-icon" fill="').concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M11.6,5.3H4.7c-1.4,0-2.5,1.1-2.5,2.5v5.9c0,1.4,1.1,2.5,2.5,2.5h6.9c1.4,0,2.5-1.1,2.5-2.5V7.7 C14.1,6.4,13,5.3,11.6,5.3z M4.7,6.3h6.9c0.8,0,1.5,0.7,1.5,1.5v5.9c0,0.8-0.7,1.5-1.5,1.5H4.7c-0.8,0-1.5-0.7-1.5-1.5V7.7 C3.3,6.9,3.9,6.3,4.7,6.3z" /><path d="M16.6,6.7c0.9-0.8,2.3-0.1,2.4,1l0,0.1v5.7c0,1.2-1.3,1.9-2.3,1.2l-0.1-0.1L13.3,12 c-0.2-0.2-0.2-0.5-0.1-0.7c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.7c0.3,0.2,0.7,0.1,0.8-0.3l0-0.1V7.8c0-0.4-0.4-0.6-0.7-0.4 l-0.1,0l-3.3,2.7c-0.2,0.2-0.5,0.1-0.7-0.1c-0.2-0.2-0.1-0.5,0-0.6l0.1-0.1L16.6,6.7z" /></svg>',o.onclick=function(){var e=t.decoderState.state,i=e.play,n=e.recordvideo;i&&(n?(t.jSPlugin.stopSave(),t.setDecoderState({recordvideo:!1})):(t.jSPlugin.startSave("".concat((new Date).getTime())),t.setDecoderState({recordvideo:!0})))};break;case"capturePicture":if(f)break;o.title=this.jSPlugin.i18n.t("client.theme.BTN_CAPTURE"),o.id=e,o.domString='<svg id="'.concat(this.jSPlugin.id,'-capturePicture-icon" class="theme-icon-item-icon" fill="').concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.8,7.7c-2,0-3.7,1.6-3.7,3.7S8.7,15,10.8,15c2,0,3.7-1.6,3.7-3.7S12.8,7.7,10.8,7.7z M10.8,8.7c1.5,0,2.7,1.2,2.7,2.7S12.2,14,10.8,14c-1.5,0-2.7-1.2-2.7-2.7S9.3,8.7,10.8,8.7z" /><path d="M8.6,3.7l-0.1,0C8,3.7,7.7,4,7.5,4.3l-1,1.7l-1.3,0C4,6.1,3.1,7,3.1,8.2v7.1 c0,1.2,0.9,2.1,2.1,2.1h11.1c1.2,0,2.1-0.9,2.1-2.1V8.2l0-0.1c-0.1-1.1-1-1.9-2.1-1.9l-1.3,0l-1.1-1.8c-0.2-0.4-0.7-0.6-1.1-0.6H8.6 z M8.6,4.7h4.2c0.1,0,0.2,0.1,0.3,0.1l1.2,2c0.1,0.2,0.3,0.2,0.4,0.2h1.6c0.6,0,1.1,0.5,1.1,1.1v7.1c0,0.6-0.5,1.1-1.1,1.1H5.1 c-0.6,0-1.1-0.5-1.1-1.1V8.2c0-0.6,0.5-1.1,1.1-1.1h1.6c0.2,0,0.3-0.1,0.4-0.2l1.2-2C8.4,4.7,8.5,4.7,8.6,4.7z" /></svg>',o.onclick=function(){t.decoderState.state.play?t.jSPlugin.capturePicture("".concat((new Date).getTime()),!0):console.log("视频未播放,无法截图")};break;case"talk":if(f)break;o.title=this.jSPlugin.i18n.t("client.theme.BTN_TALK"),o.id=e,o.domString="<div></div>"+'<svg id="'.concat(this.jSPlugin.id,'-talk-icon" class="theme-icon-item-icon" fill="').concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.1,2.7C8.5,2.7,7.2,4,7.2,5.6v5.2c0,1.6,1.3,2.9,2.9,2.9l0.2,0c1.5-0.1,2.7-1.4,2.7-2.9V5.6\tC13,4,11.7,2.7,10.1,2.7z M10.1,3.7c1.1,0,1.9,0.9,1.9,1.9v5.2c0,1-0.8,1.8-1.8,1.9l-0.1,0c-1,0-1.9-0.9-1.9-1.9V5.6 C8.2,4.5,9,3.7,10.1,3.7z" /><path d="M15.1,8.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,3-2.5,5.5-5.5,5.5c-3,0-5.4-2.3-5.5-5.3l0-0.2V9 c0-0.3,0.2-0.5,0.5-0.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,2.5,2,4.5,4.5,4.5c2.4,0,4.4-1.9,4.5-4.3l0-0.2V9 C14.6,8.7,14.8,8.5,15.1,8.5z" /><path d="M13.5,17.7c0.3,0,0.5,0.2,0.5,0.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-7c-0.3,0-0.5-0.2-0.5-0.5 c0-0.2,0.2-0.4,0.4-0.5l0.1,0H13.5z" /><path d="M10.1,15.2c0.2,0,0.4,0.2,0.5,0.4l0,0.1v2.5c0,0.3-0.2,0.5-0.5,0.5c-0.2,0-0.4-0.2-0.5-0.4l0-0.1 v-2.5C9.6,15.4,9.8,15.2,10.1,15.2z" /></svg>',o.onclick=function(){var e=t.decoderState.state,i=e.talk,n=e.sound;if(e.play)if(i){console.log("结束对讲"),t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk();var a=k.findIndex(t.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;t.themeData&&a&&(t.jSPlugin.openSound(),t.setDecoderState({sound:!0}))}else console.log("开始对讲"),t.setDecoderState({talk:!0}),t.jSPlugin.Talk.startTalk((function(e){n&&!e&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1}))}))};break;case"zoom":if(f)break;o.title=this.jSPlugin.use3DZoom?this.jSPlugin.i18n.t("client.theme.BTN_3D_ZOOM"):this.jSPlugin.i18n.t("client.theme.BTN_ZOOM"),o.id=e,o.domString="<div></div>"+'<svg id="'.concat(this.jSPlugin.id,'-zoom-icon" class="theme-icon-item-icon" fill="').concat(o.color,'" version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n          width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="5 -6 5 32" style="enable-background:new 0 0 20 20.1;" xml:space="preserve">\n              <path class="st1" d="M8.8,2.6c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2s-6.2-2.8-6.2-6.2S5.3,2.6,8.8,2.6z M8.8,3.9\n                c-2.8,0-5,2.2-5,5s2.2,5,5,5s5-2.2,5-5S11.5,3.9,8.8,3.9z M12.7,12.7l3.9,3.9"/>\n              <path class="st2" d="M11.2,9.5h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S11.6,9.5,11.2,9.5z"/>\n              <path class="st2" d="M8.7,12c-0.3,0-0.6-0.3-0.6-0.6v-5c0-0.3,0.3-0.6,0.6-0.6s0.6,0.3,0.6,0.6v5C9.3,11.8,9.1,12,8.7,12z"/>\n              <path class="st2" d="M16.9,17.6c-0.1,0-0.3-0.1-0.4-0.2l-3.9-3.9c-0.2-0.2-0.2-0.6,0-0.8s0.6-0.2,0.8,0l3.9,3.9\n                c0.2,0.2,0.2,0.6,0,0.8C17.2,17.5,17,17.6,16.9,17.6z"/>\n          </svg>'),o.onclick=function(){var e=t.decoderState.state,i=e.zoom,n=e.play,a=e.rec,r=e.cloudRec;if(t.jSPlugin.use3DZoom){if(!n)return!1;i?t.jSPlugin.close3DZoom():t.jSPlugin.enable3DZoom()}else{if(t.zoomDisable||!a&&!r&&!n)return!1;i?(console.log("结束电子放大"),t.jSPlugin.Zoom.stopZoom()):(console.log("开始电子放大"),t.jSPlugin.Zoom.startZoom())}t.setDecoderState({zoom:!i})};break;case"pantile":if(f)break;o.title=this.jSPlugin.i18n.t("client.theme.BTN_PTZ"),o.id=e,o.domString='<svg id="'.concat(this.jSPlugin.id,'-pantile-icon" style="').concat(this.isMobile?this.decoderState.state.expend?"display:block;":"display:none;":"display:block;",'" class="theme-icon-item-icon" fill="').concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.2,7.8c1.6,0,2.9,1.3,2.9,2.9s-1.3,2.9-2.9,2.9s-2.9-1.3-2.9-2.9S8.5,7.8,10.2,7.8z M10.2,8.8c-1.1,0-1.9,0.9-1.9,1.9s0.9,1.9,1.9,1.9s1.9-0.9,1.9-1.9S11.2,8.8,10.2,8.8z" /><path d="M8.8,3.5c0.7-0.6,1.8-0.6,2.5-0.1l0.1,0.1l1.4,1.1c0.2,0.2,0.3,0.5,0.1,0.7 c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1,0l-1.4-1.1C10.5,3.9,10,3.9,9.6,4.2L9.4,4.3L8,5.4C7.8,5.5,7.5,5.5,7.3,5.3c-0.2-0.2-0.1-0.5,0-0.6 l0.1-0.1L8.8,3.5z" /><path d="M2.5,12.3c-0.6-0.7-0.6-1.8-0.1-2.5l0.1-0.1l1.1-1.4c0.2-0.2,0.5-0.3,0.7-0.1 c0.2,0.2,0.2,0.4,0.1,0.6l0,0.1l-1.1,1.4C3,10.6,3,11.1,3.2,11.5l0.1,0.1L4.4,13c0.2,0.2,0.1,0.5-0.1,0.7c-0.2,0.2-0.5,0.1-0.6,0 l-0.1-0.1L2.5,12.3z" /><path d="M17.7,12.3c0.6-0.7,0.6-1.8,0.1-2.5l-0.1-0.1l-1.1-1.4c-0.2-0.2-0.5-0.3-0.7-0.1 c-0.2,0.2-0.2,0.4-0.1,0.6l0,0.1l1.1,1.4c0.3,0.4,0.3,0.9,0.1,1.3l-0.1,0.1L15.8,13c-0.2,0.2-0.1,0.5,0.1,0.7c0.2,0.2,0.5,0.1,0.6,0 l0.1-0.1L17.7,12.3z" /><path d="M8.8,18.2c0.7,0.6,1.8,0.6,2.5,0.1l0.1-0.1l1.4-1.1c0.2-0.2,0.3-0.5,0.1-0.7 c-0.2-0.2-0.4-0.2-0.6-0.1l-0.1,0l-1.4,1.1c-0.4,0.3-0.9,0.3-1.3,0.1l-0.1-0.1L8,16.3c-0.2-0.2-0.5-0.1-0.7,0.1 c-0.2,0.2-0.1,0.5,0,0.6l0.1,0.1L8.8,18.2z" /></svg>',o.onclick=function(){var e=t.decoderState.state,i=e.play,n=e.pantile,a=e.expend;if(i)if(n)console.log("隐藏云台"),t.Ptz.hide(),t.setDecoderState({pantile:!1});else{if(t.isMobile&&!a)return console.log("移动端,非全屏状态不展示云台"),!1;console.log("显示云台"),t.Ptz.show(),t.setDecoderState({pantile:!0})}};break;case"expend":o.title=this.jSPlugin.i18n.t("client.theme.BTN_EXPEND"),o.id=e,o.domString='<span><svg id="'.concat(this.jSPlugin.id,'-expend-icon" class="theme-icon-item-icon" fill="').concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M3.4,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-1.2,1-2.3,2.2-2.3h1.8c0.3,0,0.5,0.2,0.5,0.5S7.2,4.1,6.9,4.1H5.2 c-0.7,0-1.2,0.6-1.2,1.3v1.8C3.9,7.4,3.7,7.6,3.4,7.6z" /><path d="M6.9,18.1H5.2c-1.2,0-2.2-1-2.2-2.2v-1.8c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8c0,0.7,0.6,1.2,1.2,1.2 h1.8c0.3,0,0.5,0.2,0.5,0.5S7.2,18.1,6.9,18.1z" /><path d="M15.7,18.1h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8c0.7,0,1.2-0.6,1.2-1.2v-1.8 c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8C17.9,17.1,16.9,18.1,15.7,18.1z" /><path d="M17.4,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-0.7-0.6-1.3-1.2-1.3h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8 c1.2,0,2.2,1,2.2,2.3v1.8C17.9,7.4,17.7,7.6,17.4,7.6z" /></svg>'+'<svg class="theme-icon-item-icon" style="display:none" width="'.concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" fill="').concat(o.color,'" viewBox="-6 -6 32 32">\n            <path class="st1" d="M5.7,8.1H3.9c-0.3,0-0.6-0.2-0.6-0.6S3.6,7,3.9,7h1.9c0.7,0,1.3-0.6,1.3-1.3V3.8c0-0.3,0.2-0.6,0.6-0.6\n              s0.6,0.2,0.6,0.6v1.9C8.2,7,7.1,8.1,5.7,8.1z"/>\n            <path class="st1" d="M7.6,17.7c-0.3,0-0.6-0.2-0.6-0.6v-1.9c0-0.7-0.6-1.3-1.3-1.3H3.9c-0.3,0-0.6-0.2-0.6-0.6s0.2-0.6,0.6-0.6h1.9\n              c1.3,0,2.4,1.1,2.4,2.4v1.9C8.2,17.5,7.9,17.7,7.6,17.7z"/>\n            <path class="st1" d="M13.4,17.7c-0.3,0-0.6-0.2-0.6-0.6v-1.9c0-1.3,1.1-2.4,2.4-2.4h1.9c0.3,0,0.6,0.2,0.6,0.6S17.5,14,17.2,14\n              h-1.9c-0.7,0-1.3,0.6-1.3,1.3v1.9C14,17.5,13.8,17.7,13.4,17.7z"/>\n            <path class="st1" d="M17.2,8.1h-1.9c-1.3,0-2.4-1.1-2.4-2.4V3.8c0-0.3,0.2-0.6,0.6-0.6S14,3.5,14,3.8v1.9C14,6.4,14.6,7,15.3,7h1.9\n              c0.3,0,0.6,0.2,0.6,0.6S17.5,8.1,17.2,8.1z"/>\n          </svg>\n          </span>'),o.onclick=function(){var e=t.decoderState.state;e.webExpend;var i=e.expend;e.zoom;var n=e.pantile;if(i)if(t.isMobile){var a=t._extendHeadeTimeLinrHight(!1,!0),r=document.getElementById("".concat(t.jSPlugin.id,"-headControl"));document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-32px"),r&&(r.style.position="relative"),function(e,t,i){var n="";n+="width:"+t+"px;",n+="height:"+i+"px;",n+="-webkit-transform: none; transform: none;",n+="-webkit-transform-origin: 0 0;",n+="transform-origin: 0 0;",e.style.cssText=n}(document.getElementById("".concat(t.jSPlugin.id,"-wrap")),t.jSPlugin.width,t.jSPlugin.height),t.jSPlugin.jSPlugin.JS_Resize(t.jSPlugin.width,t.jSPlugin.height-a),n&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})),t.jSPlugin.fullScreenWidth=t.jSPlugin.width,t.jSPlugin.fullScreenHeight=t.jSPlugin.height,t.jSPlugin.Zoom.currentScale,t.jSPlugin.Zoom&&t.jSPlugin.Zoom.handleFullscreen&&t.jSPlugin.Zoom.handleFullscreen(!i,t.jSPlugin.width,t.jSPlugin.height),document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon")).style.display="none")}else b();else if(console.log("执行全局全屏"),t.isMobile){var o=t._extendHeadeTimeLinrHight(!1,!0);y(document.getElementById("".concat(t.jSPlugin.id,"-wrap")));var s=document.documentElement.clientWidth,l=document.documentElement.clientHeight;document.getElementById("".concat(t.jSPlugin.id)).style["backface-visibility"]="hidden",t.jSPlugin.jSPlugin.JS_Resize(l,s-o,!0),t.jSPlugin.fullScreenWidth=l,t.jSPlugin.fullScreenHeight=s-o,t.jSPlugin.Zoom.currentScale,t.jSPlugin.Zoom&&t.jSPlugin.Zoom.handleFullscreen&&t.jSPlugin.Zoom.handleFullscreen(!i,l,s-o),document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon")).style.display="block")}else{s=window.screen.width,l=window.screen.height;S(document.getElementById("".concat(t.jSPlugin.id))).then((function(e){t.jSPlugin.jSPlugin.JS_Resize(s,l),t.jSPlugin.fullScreenWidth=s,t.jSPlugin.fullScreenHeight=l})).catch((function(e){console.log(e)})),t.jSPlugin.close3DZoom(),t.setDecoderState({speed:!1})}t.setDecoderState({expend:!i})};break;case"webExpend":if(f)break;o.title=this.jSPlugin.i18n.t("client.theme.BTN_WEBEXPEND"),o.id=e,o.domString='<span><svg id="'.concat(this.jSPlugin.id,'-webExpend-icon" class="theme-icon-item-icon" fill="').concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M3.1,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-1.2,1-2.3,2.2-2.3h1.8c0.3,0,0.5,0.2,0.5,0.5S6.8,4.1,6.6,4.1H4.8 c-0.7,0-1.2,0.6-1.2,1.3v1.8C3.6,7.4,3.3,7.6,3.1,7.6z" /><path d="M15.3,18.1h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8c0.7,0,1.2-0.6,1.2-1.2v-1.8 c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8C17.6,17.1,16.6,18.1,15.3,18.1z" /><circle class="st2" cx="10.2" cy="10.4" r="1.1"/></svg>'+'<svg class="theme-icon-item-icon" fill="'.concat(o.color,'" style="display:none;" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-6 -6 32 32">\n          <path class="st1" d="M5.4,8.1H3.5C3.2,8.1,3,7.9,3,7.6s0.2-0.5,0.5-0.5h1.9c0.8,0,1.4-0.6,1.4-1.4V3.8c0-0.3,0.2-0.5,0.5-0.5\n            s0.5,0.2,0.5,0.5v1.9C7.7,7,6.7,8.1,5.4,8.1z"/>\n          <path class="st1" d="M13.1,17.7c-0.3,0-0.5-0.2-0.5-0.5v-1.9c0-1.3,1.1-2.4,2.4-2.4h1.9c0.3,0,0.5,0.2,0.5,0.5s-0.2,0.5-0.5,0.5H15\n            c-0.8,0-1.4,0.6-1.4,1.4v1.9C13.6,17.4,13.4,17.7,13.1,17.7z"/>\n            <circle class="st2" cx="10.2" cy="10.4" r="1.1"/>\n          ')+"</svg></span>",o.onclick=function(){var e=t.decoderState.state,i=e.webExpend,n=e.expend;if(e.zoom,n)return console.log("正在全局全屏"),!1;if(Array.isArray(window.recTimer)&&window.recTimer.map((function(e){clearInterval(e)})),i)console.log("取消网页全屏"),b();else{var a=window.screen.width,r=window.screen.height;console.log("执行网页全屏"),S(document.getElementById("".concat(t.jSPlugin.id,"-wrap"))).then((function(){t.jSPlugin.jSPlugin.JS_Resize(a,r-t._extendHeadeTimeLinrHight(!1,!1))}))}t.jSPlugin.Theme.Rec&&setTimeout((function(){t.jSPlugin.Theme.Rec.recAutoSize((function(){t.jSPlugin.Zoom.currentScale>1&&t.jSPlugin.Zoom.currentScale}))}),100),t.setDecoderState({webExpend:!i})};break;case"hd":if(f)break;var x="".concat(this.jSPlugin.id,"-select-quality"),p="".concat(x,"-item");return o.title=this.jSPlugin.i18n.t("client.theme.BTN_HD"),o.id=e,o.domString='<ul id="'.concat(this.jSPlugin.id,'-hdSelect" class="hd speed-select ').concat(this.isMobile?"mobile":"",'" style="display:none;bottom: calc(constant(safe-area-inset-bottom) + ').concat(this.isMobile?"80px":"50px",") !important;bottom: calc(env(safe-area-inset-bottom) + ").concat(this.isMobile?"80px":"50px",') !important;">\n          \x3c!-- 由接口返回生成 --\x3e  \n        </ul><span id="').concat(this.jSPlugin.id,'-hdSelect-icon-warp">\n           \x3c!-- 由接口返回生成 --\x3e\n          </span>'),o.onclick=function(e){var i=t.decoderState.state,n=i.hd,a=i.expend,r=i.recordvideo,o=i.play,s=i.hdList,l=i.zoom,c=i.pantile;if(e.stopPropagation(),o){var d=e.target.id,u=e.target.getAttribute("data-type");if(0===d.indexOf(x)){if(n.type+""!==u){var h=s.find((function(e){return e.level+""===u}));if(h&&(h.streamType!==n.streamType||h.level+""!=n.level+"")){t.jSPlugin.changeVideoLevel(h),t.setDecoderState({hd:h}),l&&t.jSPlugin.Zoom.stopZoom();var f=document.getElementById("".concat(t.jSPlugin.id,"-hdSelect-icon")),p=document.getElementById("".concat(t.jSPlugin.id,"-sdSelect-icon"));f&&(f.style.display=["hd","0"].includes(h.level)?"block":"none"),p&&(p.style.display=["sd","1"].includes(h.level)?"block":"none")}}t.resetMobileZoomStatus(),r&&t.setDecoderState({recordvideo:!1})}t.showHD=!t.showHD,document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display?"block":"none",t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display?"block":"none"),t.themeData.autoFocus>0&&("none"===document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display?t.startAutoFocus():t.stopAutoFocus())),t.isMobile&&a&&t.showHD?document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).className="hd speed-select mobile expend":document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).className=t.isMobile?"hd speed-select mobile":"speed-select",t.isMobile&&(a?(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="env(safe-area-inset-bottom)",document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="constant(safe-area-inset-bottom)"):(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 80px)",document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 80px)")),c&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1}))}},(s=this.jSPlugin.env.domain,l=this.jSPlugin.accessToken,d=this.jSPlugin.deviceSerial,u=this.jSPlugin.channelNo,h="".concat(s,"/api/service/device/capacity/video/quality?accessToken=").concat(l,"&deviceSerial=").concat(d,"&channelNo=").concat(u),fetch(h,{method:"GET"}).then((function(e){return e.json()})).then((function(e){return e.meta&&200===e.meta.code&&e.data&&e.data.length>0&&e.data.find((function(e){return 2===e.streamTypeIn}))?we:Re})).catch((function(){return Re}))).then((function(e){var i=e;t.setDecoderState({hdList:i});var n=t.jSPlugin.url.indexOf("hd.live")>-1?i[0]:i[1];t.setDecoderState({hd:n});var r=document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")),s=document.getElementById("".concat(t.jSPlugin.id,"-hdSelect-icon-warp"));r&&(r.innerHTML="\n            ".concat(c(i).reverse().map((function(e){if(e.name&&null!=e.level)return'<li class="selectOption default '.concat(p,'" style="height: 45px;text-align: center;line-height: 45px;list-style: none;cursor: pointer;" name="option" data-type="').concat(e.level,'" id="').concat(x,"_").concat(e.level,'">').concat(e.name,"</li>")})).join(""),'\n            <li class="selectOption cancel" style="').concat(t.isMobile?"":"display:none;",'" name="option" id="').concat(t.jSPlugin.id,'-select-speed">取消</li>\n          ')),s&&("object"===a(t.decoderState.state.hd)&&"function"==typeof t.decoderState.state.hd.icon?s.innerHTML="\n              ".concat(i.map((function(e){if(e.name&&"function"==typeof e.icon)return e.icon(t.jSPlugin.id,x,o.color,t.jSPlugin.width,Fe,t.decoderState.state.hd)})).join(""),'\n              <span class=\'speed-select-mask\' style="display:none" id="').concat(t.jSPlugin.id,'-select-hd-mask"></span>\n            '):"object"===a(t.decoderState.state.hd)&&"string"==typeof t.decoderState.state.hd.name&&$(s).prepend('<div class="theme-icon-item-icon '.concat(x,'-btn" data-type="').concat(t.decoderState.state.hd.level,'" style="width: ').concat(t.jSPlugin.width>Fe?48:32,'px">').concat(t.decoderState.state.hd.name,"</div>")))})),o;case"speed":if(f)break;o.title=this.jSPlugin.i18n.t("client.theme.BTN_SPEED"),o.id=e,o.domString='<ul id="'.concat(this.jSPlugin.id,'-speedSelect" class="speed speed-select ').concat(this.isMobile?"mobile":"",'" style="display:none;bottom: calc(constant(safe-area-inset-bottom) + ').concat(this.isMobile?"80px":"50px",") !important;bottom: calc(env(safe-area-inset-bottom) + ").concat(this.isMobile?"80px":"50px",') !important;">')+'<li class="selectOption default" style="height: 45px;text-align: center;line-height: 45px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="'.concat(this.jSPlugin.id,'-select-speed4">4倍</li>')+'<li class="selectOption default" style="height: 45px;text-align: center;line-height: 45px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="'.concat(this.jSPlugin.id,'-select-speed2">2倍</li>')+'<li class="selectOption active" style="height: 45px;text-align: center;line-height: 45px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="'.concat(this.jSPlugin.id,'-select-speed1">1倍(正常播放)</li>')+'<li class="selectOption default" style="height: 45px;text-align: center;line-height: 45px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="'.concat(this.jSPlugin.id,'-select-speed05">0.5倍</li>')+'<li class="selectOption cancel" style="'.concat(this.isMobile?"":"display:none;",'" name="option" id="').concat(this.jSPlugin.id,'-select-speed">取消</li>')+"</ul>"+'<span>\n          <div style="font-size: 12px;\n          vertical-align: bottom;\n          display: inline-flex;\n          padding: 0px 7px;\n          width: 48px;\n          line-height: 24px;\n          justify-content: center;\n          border: 1px solid '.concat(o.color,';\n          text-align: center;border-radius: 12.5px;"\n          id="').concat(this.jSPlugin.id,'-speed-text"\n          >').concat(1===this.nextRate?"倍速":"".concat(this.nextRate,"倍").replace("3","0.5"),"</div>\n                ")+'<span class=\'speed-select-mask\' style="display:none" id="'.concat(this.jSPlugin.id,'-select-mask"></span>')+"</span>",o.onclick=function(e){var i=t.decoderState.state,n=i.speed,a=i.expend,r=i.play;if(e.stopPropagation(),!r)return!1;if(!n&&t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).className=a?"speed speed-select mobile expend":"speed speed-select mobile"),t.isMobile&&(a?(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="constant(safe-area-inset-bottom)",document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="env(safe-area-inset-bottom)"):(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 80px)",document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 80px)")),t.nextRate=1,e.target.id)switch(e.target.id){case"".concat(t.jSPlugin.id,"-select-speed1"):console.log("倍速1"),t.nextRate=1,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(1),t.jSPlugin.speed=1,t.setDecoderState({speed:!n});break;case"".concat(t.jSPlugin.id,"-select-speed2"):console.log("倍速2"),t.nextRate=2,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(2),t.jSPlugin.speed=2,t.setDecoderState({speed:!n});break;case"".concat(t.jSPlugin.id,"-select-speed4"):console.log("倍速4"),t.nextRate=4,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(4),t.jSPlugin.speed=4,t.setDecoderState({speed:!n});break;case"".concat(t.jSPlugin.id,"-select-speed05"):console.log("倍速05"),t.nextRate=3,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(.5),t.jSPlugin.speed=.5,t.setDecoderState({speed:!n});break;default:t.isMobile?t.setDecoderState({speed:!n}):t.setDecoderState({speed:!0})}t.isMobile&&e.target.id==="".concat(t.jSPlugin.id,"-speed-text")?document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="block":document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display?"block":"none"),t.setDecoderState({speed:!n}),t.themeData.autoFocus>0&&("none"===document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display?t.startAutoFocus():t.stopAutoFocus())};break;case"deviceName":o.title=this.jSPlugin.i18n.t("client.theme.DEVICE_NAME"),o.id=e,o.domString="<span>".concat(this.jSPlugin.i18n.t("client.theme.DEVICE_NAME"),"</span>"),o.onclick=function(){};break;case"deviceID":o.title=this.jSPlugin.i18n.t("client.theme.BTN_SPEED"),o.id=e,o.domString="<span>".concat(this.jSPlugin.i18n.t("client.theme.BTN_SPEED"),"</span>"),o.onclick=function(){};break;case"cloudRec":if(this.jSPlugin._isCloudRecord)break;o.title=this.jSPlugin.i18n.t("client.theme.BTN_CLOUDREC"),o.id=e,o.domString='\n        <span>\n          <svg class="theme-icon-item-icon" fill="'.concat(o.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg"  width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="-10 0 40 15">\n\t<path d="M9.5,13.1c-0.3,0-0.5-0.2-0.5-0.5V8.8c0-0.3,0.2-0.5,0.5-0.5S10,8.5,10,8.8v3.8C10,12.8,9.8,13.1,9.5,13.1z"/>\n\t<path d="M7.6,10.6c-0.1,0-0.3-0.1-0.4-0.2C7,10.2,7,9.9,7.3,9.7l1.9-1.7c0.2-0.2,0.5-0.2,0.7,0l1.8,1.7\n\t\tc0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.5,0.2-0.7,0L9.5,9.1l-1.6,1.4C7.8,10.6,7.7,10.6,7.6,10.6z"/>\n\t<path d="M13.2,15.7H5.6c-2.1-0.1-3.8-1.8-3.8-3.9c0-1.8,1.3-3.4,3-3.8c0.4-2.2,2.3-3.9,4.6-3.9c2.3,0,4.2,1.7,4.6,3.8\n\t\tc1.8,0.4,3.1,1.9,3.1,3.8C17.1,13.9,15.4,15.7,13.2,15.7z M5.6,14.7h7.6c1.6,0,2.9-1.3,2.9-2.9c0-1.5-1.1-2.7-2.6-2.9l-0.4,0l0-0.4\n\t\tc-0.2-1.9-1.7-3.3-3.6-3.3C7.5,5.1,6,6.6,5.8,8.5l0,0.4l-0.4,0c-1.4,0.2-2.5,1.4-2.5,2.9C2.8,13.3,4.1,14.6,5.6,14.7z"/>\n          </svg>\n        </span>\n        '),o.onclick=function(){console.log("点击云回放"),t.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloud"}}),t.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){var e=_("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom())}),!1)};break;case"cloudRecord":if(!this.jSPlugin._isCloudRecord)break;o.title=this.jSPlugin.i18n.t("client.theme.BTN_CLOUDRECORD"),o.id=e,o.domString='<span style="font-size: 24px; width: 48px; display: inline-block; text-align: center;line-height: 56px;"> \n<svg class="theme-icon-item-icon" fill="'.concat(o.color,'" version="1.1" height="1em"  viewBox="0 0 48 49">\n<g transform="translate(3.000000, 10.000000)">\n\t<g><path d="M38.1,24.2c-0.8,0-1.6-0.2-2.3-0.6L31,20.9l1.5-2.6l4.8,2.7c0.3,0.1,0.5,0.2,0.8,0.2c1,0,1.8-0.8,1.8-1.8V9.6\n\t\t\tc0-0.3-0.1-0.5-0.2-0.8c-0.2-0.4-0.6-0.8-1-0.9c-0.4-0.2-0.9-0.1-1.3,0.1l-5,2.4l-1.3-2.7l5-2.4c1.1-0.5,2.4-0.6,3.6-0.2\n\t\t\tc1.2,0.4,2.2,1.3,2.7,2.5c0.3,0.6,0.4,1.3,0.4,2v9.8C42.8,22,40.7,24.2,38.1,24.2z"/>\n\t</g>\n\t<g><path d="M27.7,30H4.9c-3.5,0-6.4-2.9-6.4-6.4V5.4C-1.5,1.9,1.4-1,4.9-1h22.8c3.5,0,6.4,2.9,6.4,6.4v18.1\n\t\t\tC34.1,27.1,31.2,30,27.7,30z M4.9,2C3,2,1.5,3.5,1.5,5.4v18.1C1.5,25.5,3,27,4.9,27h22.8c1.9,0,3.4-1.5,3.4-3.4V5.4\n\t\t\tc0-1.9-1.5-3.4-3.4-3.4H4.9z"/>\n\t</g><g><path d="M12.1,7.1c0.9,0,1.6,0.7,1.6,1.5c0,0.8-0.6,1.4-1.4,1.5l-0.2,0H8.9c-0.9,0-1.6-0.7-1.6-1.5\n\t\t\tc0-0.8,0.6-1.4,1.4-1.5l0.2,0H12.1z"/></g></g></svg></span>'),o.onclick=function(){console.log("点击云录制"),t.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloudRecord"}}),t.jSPlugin.url.replace(/rec\??|cloud.rec\??/,"cloud.rec?busType=7"),t.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){t.jSPlugin._isCloudRecord&&t.changeTheme("pcRec");var e=_("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom())}),!1)};break;case"rec":o.title=this.jSPlugin.i18n.t("client.theme.BTN_CLOUDRECORD"),o.id=e,o.domString='\n        <span>\n        <svg class="theme-icon-item-icon" fill='.concat(o.color,' version="1.1" xmlns="http://www.w3.org/2000/svg"  width="').concat(this.jSPlugin.width>Fe?48:32,'" height="').concat(this.jSPlugin.width>Fe?48:32,'" viewBox="0 0 40 15">\n          <path d="M13,16.3H5.5c-1.1,0-2-0.9-2-2V3.8c0-1.1,0.9-2,2-2h5.4c0.5,0,1,0.2,1.4,0.6l2.1,2.1C14.8,4.8,15,5.3,15,5.9\n  v8.4C15,15.4,14.1,16.3,13,16.3z M5.5,2.8c-0.6,0-1,0.4-1,1v10.5c0,0.6,0.4,1,1,1H13c0.6,0,1-0.4,1-1V5.9c0-0.3-0.1-0.5-0.3-0.7\n  L11.6,3c-0.2-0.2-0.4-0.3-0.7-0.3H5.5z"/>\n<path d="M6.3,7.3C6,7.3,5.8,7,5.8,6.8V4.5C5.8,4.2,6,4,6.3,4s0.5,0.2,0.5,0.5v2.2C6.8,7,6.6,7.3,6.3,7.3z"/>\n<path d="M8.5,7.3C8.3,7.3,8,7,8,6.8V4.5C8,4.2,8.3,4,8.5,4S9,4.2,9,4.5v2.2C9,7,8.8,7.3,8.5,7.3z"/>\n<path d="M10.8,7.3c-0.3,0-0.5-0.2-0.5-0.5V4.5c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v2.2C11.3,7,11.1,7.3,10.8,7.3z"\n  />\n        </svg>\n      </span>\n        '),o.onclick=function(){console.log("点击本地回放"),t.setDecoderState({type:"rec",cloudRec:!1,rec:!0}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"local"}}),t.jSPlugin.changePlayUrl({type:"rec"},(function(){console.log("---------本地回放"),t.jSPlugin._isCloudRecord&&t.changeTheme("pcRec");var e=_("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom())}),!1)}}return o}},{key:"_warpFullScreen",value:function(){var e=this,t=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=this,n=function(){var t=i.decoderState.state,n=t.webExpend,a=t.expend,r=t.zoom;document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?n?e.jSPlugin.eventEmitter&&e.jSPlugin.eventEmitter.emit("fullScreen",{eventType:"fullScreen",code:0,target:e,msg:"web 全屏"}):a&&(i.setDecoderState({expend:!1}),r&&i.jSPlugin.use3DZoom&&i.jSPlugin.enable3DZoom(),e.jSPlugin.eventEmitter&&e.jSPlugin.eventEmitter.emit("fullScreen",{eventType:"fullScreen",code:0,target:e,msg:"全局全屏"})):(i.jSPlugin.jSPlugin.JS_Resize(i.jSPlugin.width,i.jSPlugin.height-e._extendHeadeTimeLinrHight(!1,!1)),e.jSPlugin.eventEmitter&&e.jSPlugin.eventEmitter.emit("cancelFullScreen",{eventType:"cancelFullScreen",code:0,target:e,msg:"退出全局全屏"})),e.setDecoderState({speed:!1})};["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"].forEach((function(e){t.removeEventListener(e,n),t.addEventListener(e,n)}))}},{key:"changeRecSpeed",value:function(e){var t=this,i=function(e){if(console.log("setLiActive",e),!document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")))return!1;document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[0].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[0].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[1].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[1].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[2].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[2].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[3].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[3].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[e].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[e].className.replace("default","active")},n="1";switch(e){case 1:i(2),n="倍速";break;case 2:i(1),n="".concat(e,"倍");break;case 4:i(0),n="".concat(e,"倍");break;case.5:i(3),n="".concat(e,"倍");break;default:i(2),n="".concat(e,"倍")}document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&(document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).innerHTML=n)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,i=t.header,n=t.footer,a=this.jSPlugin.id;if(this.header=L,this.footer=B,this.isNeedRenderHeader=k.findIndex(i.btnList,(function(e){return e.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isMobile&&(this.isNeedRenderHeader=k.findIndex(i.btnList,(function(e){return e.isrender>0&&"deviceID"===e.iconId||e.isrender>0&&"deviceName"===e.iconId}))>=0&&"miniRec"!=this.jSPlugin.id),this.isNeedRenderFooter=k.findIndex(n.btnList,(function(e){return e.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,console.log("miniRec:"+this.jSPlugin.themeId),this.isNeedRenderTimeLine=k.findIndex(i.btnList,(function(e){return"cloudRec"===e.iconId&&1===e.isrender||"rec"===e.iconId&&1===e.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(e,t){document.getElementById(e)&&document.getElementById(e).parentElement.removeChild(document.getElementById(e))})),this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width: calc(100% - 100px);'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var r=document.createElement("div");r.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),r.setAttribute("class","header-controls"),r.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:calc(100% - 100px);overflow:hidden;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex;'></div>");var o={height:this.jSPlugin.width>Fe?"48px":"32px","line-height":this.jSPlugin.width>Fe?"48px":"32px",display:"flex","justify-content":"space-between",top:0,"z-index":1,background:"#000000",color:"#FFFFFF",width:"100%"};r.style=ke(o),document.getElementById("".concat(a,"-wrap")).insertBefore(r,document.getElementById(a));var s=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(s)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(this.jSPlugin.width>Fe?48:32,"px"),document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='<div id="'.concat(this.jSPlugin.id,'-audioControls"  class="footer-controls" style=\'display:flex;justify-content: space-between;height: ').concat(this.jSPlugin.width>Fe?48:32,"px;width:100%;'><div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div></div>"));else{var l=document.createElement("div");l.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),l.setAttribute("class","ez-iframe-footer-container");var c={"min-height":this.jSPlugin.width>Fe?"48px":"32px","max-height":this.jSPlugin.width>Fe?"96px":"80px",position:"relative","margin-top":this.jSPlugin.width>Fe?"-48px":"-32px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%"};l.style=ke(c),l.innerHTML='<div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;height:').concat(this.jSPlugin.width>Fe?48:32,"px;justify-content: space-between;width:100%;z-index:999;position: relative;'><div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div></div>"),g(l,document.getElementById(a))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))){document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i.color;var d,u=h(i.btnList);try{for(u.s();!(d=u.n()).done;){var f=d.value;if(f.isrender)try{this.renderHeader(f.iconId,f.part)}catch(e){}}}catch(e){u.e(e)}finally{u.f()}}if(this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))){document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=n.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n.color;var x,p=h(n.btnList);try{for(p.s();!(x=p.n()).done;){var m=x.value;if(m.isrender)try{this.renderFooter(m.iconId,m.part)}catch(e){}}}catch(e){p.e(e)}finally{p.f()}}if(console.log("this.isNeedRenderTimeLine:"+this.isNeedRenderTimeLine),this.isNeedRenderTimeLine)if(this.isMobile)document.getElementById("".concat(this.jSPlugin.id,"-headControl-right"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).style.display="none"),this.Rec=new te(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 q(this.jSPlugin));var _=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(_)}),50)}k.findIndex(this.themeData.footer.btnList,(function(e){return"pantile"===e.iconId&&1===e.isrender}))>=0&&!this.jSPlugin.disabledPTZ&&(this.isMobile&&(this.MobilePtz=new he(this.jSPlugin)),this.Ptz=new ie(this.jSPlugin));var v=function(){var t=e,i=t.decoderState.state,n=i.expend,a=i.zoom,r=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;t.Rec&&window.randomNum==t.jSPlugin.randomNum&&setTimeout((function(){t.Rec.recAutoSize((function(){if(t.jSPlugin.Zoom.currentScale>1){var e=t.jSPlugin.Zoom.currentScale;t.jSPlugin.Zoom.stopZoom(),setTimeout((function(){t.jSPlugin.Zoom.startZoom(),t.jSPlugin.Zoom.currentScale=e,t.jSPlugin.Zoom.doScale(e)}),200)}}))}),100),r||(n&&a&&t.jSPlugin.use3DZoom&&t.jSPlugin.enable3DZoom(),t.setDecoderState({webExpend:!1,expend:!1})),document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display="none"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none"),t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask"))&&(document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display="none"),document.getElementById("".concat(t.jSPlugin.id,"-select-mask"))&&(document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="none")),t.themeData.autoFocus>0&&t.startAutoFocus()};if(["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"].forEach((function(e,t){window.onFullscreenChange&&document.removeEventListener(e,window.onFullscreenChange),document.addEventListener(e,v),window.onFullscreenChange=v})),this.themeData.poster){this.jSPlugin.poster=this.themeData.poster;var y=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(y),e.jSPlugin.setPoster(e.themeData.poster))}),50)}this.inited=!0,this.getDeviceInfo(),this.renderThemeData()}},{key:"resetMobileZoomStatus",value:function(){if(this.isMobile){var e=document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"));e&&e.style&&"none"!=e.style.display&&(console.log("结束电子放大"),e.style.display="none"),this.jSPlugin.jSPlugin.Zoom&&this.jSPlugin.jSPlugin.Zoom.resetZoom()}}},{key:"getDeviceInfo",value:function(e){var t=this;De({accessToken:this.jSPlugin.accessToken,deviceSerial:P(this.jSPlugin.url).deviceSerial}).then((function(i){i.data&&(e&&e(i),document.getElementById("".concat(t.jSPlugin.id,"-deviceName-content"))&&(document.getElementById("".concat(t.jSPlugin.id,"-deviceName-content")).style.maxWidth="100%",document.getElementById("".concat(t.jSPlugin.id,"-deviceName-content")).style.overflow="hidden",document.getElementById("".concat(t.jSPlugin.id,"-deviceName-content")).style.textOverflow="ellipsis",document.getElementById("".concat(t.jSPlugin.id,"-deviceName-content")).style.whiteSpace="nowrap",document.getElementById("".concat(t.jSPlugin.id,"-deviceName-content")).innerHTML=i.data.deviceName),document.getElementById("".concat(t.jSPlugin.id,"-deviceID-content"))&&(document.getElementById("".concat(t.jSPlugin.id,"-deviceID-content")).style.maxWidth="100%",document.getElementById("".concat(t.jSPlugin.id,"-deviceID-content")).style.overflow="hidden",document.getElementById("".concat(t.jSPlugin.id,"-deviceID-content")).style.textOverflow="ellipsis",document.getElementById("".concat(t.jSPlugin.id,"-deviceID-content")).style.whiteSpace="nowrap",document.getElementById("".concat(t.jSPlugin.id,"-deviceID-content")).innerHTML=P(t.jSPlugin.url).deviceSerial))})).catch((function(e){console.log("获取设备信息失败",e)}))}},{key:"editStart",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));i&&i.setAttribute("class","header-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));i&&i.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})}},{key:"webExpend",value:function(){var e=this,t=this.decoderState.state;t.webExpend;var i=t.expend;return!!t.play&&(i?(console.log("正在全局全屏"),!1):(console.log("执行网页全屏"),void S(document.getElementById("".concat(this.jSPlugin.id,"-wrap"))).then((function(t){e.jSPlugin.jSPlugin.JS_Resize(window.screen.width,window.screen.height-e._extendHeadeTimeLinrHight(!1,!1))})).catch((function(e){console.log(e)}))))}},{key:"expend",value:function(){var e=this,t=this.decoderState.state,i=t.webExpend;if(!t.play)return!1;if(i)return console.log("正在网站全屏"),!1;if(console.log("执行全局全屏"),this.isMobile){y(document.getElementById("".concat(this.jSPlugin.id,"-wrap")));var n=document.documentElement.clientWidth,a=document.documentElement.clientHeight;document.getElementById("".concat(this.jSPlugin.id)).style["backface-visibility"]="hidden",this.jSPlugin.jSPlugin.JS_Resize(a,n-this._extendHeadeTimeLinrHight(!1,!0))}else{S(document.getElementById("".concat(this.jSPlugin.id))).then((function(t){e.jSPlugin.jSPlugin.JS_Resize(window.screen.width,window.screen.height)})).catch((function(e){console.log(e)}))}}},{key:"_extendHeadeTimeLinrHight",value:function(e,t){var i=0,n=0,a=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));a&&!e&&(i=parseInt(getComputedStyle(a).height,10));var r=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"));return r&&!t&&(n=parseInt(window.getComputedStyle(r).height,10)),i+n}},{key:"disabledFECBtn",value:function(){var e=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],t=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(this.jSPlugin.use3DZoom?this.jSPlugin.close3DZoom():this.jSPlugin.Zoom.stopZoom(),this.setDecoderState({zoom:!1}),t){var i,n=h(e);try{for(n.s();!(i=n.n()).done;){var a=i.value,r=t.querySelector("#".concat(a));r&&(r.style.display="none")}}catch(e){n.e(e)}finally{n.f()}}}},{key:"resumeFECBtn",value:function(){var e=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],t=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(t){var i,n=h(e);try{for(n.s();!(i=n.n()).done;){var a=i.value,r=t.querySelector("#".concat(a));r&&(r.style.display="")}}catch(e){n.e(e)}finally{n.f()}}}},{key:"destroy",value:function(){var e=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));e&&(e.innerHTML="");var t=document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"));this._removeElement(t);var i=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"));this._removeElement(i);var n=document.getElementById("mobile-ez-ptz-container");this._removeElement(n);var a=document.getElementById("date-switch-container-wrap");this._removeElement(a);var r=document.getElementById("rec-type-container-wrap");this._removeElement(r);var o=document.getElementById("mobile-rec-wrap");this._removeElement(o)}},{key:"_removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}}]),e}(),Me=function(){function e(t,i){r(this,e),this.jSPlugin=t,this.isMobile=i,this.timer=null,this.initToastCustom()}return s(e,[{key:"initToastCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="none":this.randerToast()}},{key:"randerToast",value:function(){var e=this.jSPlugin.width,t=1;t=this.isMobile?e/375||1:e/1024||1;var i=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),n=document.createElement("div");n.style="display:none;position:absolute;top:0;width: 100%;align-items: center;justify-content: center;",n.id="".concat(this.jSPlugin.id,"-wrap-Toast-custom"),this.isMobile?n.innerHTML='<div id="'.concat(this.jSPlugin.id,'-wrap-Toast-custom-content" \n            style="padding: ').concat(12*t,"px ").concat(20*t,"px;font-size: ").concat(16*t,"px;line-height:").concat(16*t,"px;border-radius: ").concat(8*t,"px;margin-top: ").concat(667*t*.53,'px;\n            background-color: rgba(0,0,0,0.8);color:rgba(255,255,255,0.90);box-sizing: border-box;z-index: 999;">\n            </div>\n            '):n.innerHTML='<div id="'.concat(this.jSPlugin.id,'-wrap-Toast-custom-content" \n            style="padding: ').concat(20*t,"px ").concat(32*t,"px;font-size: ").concat(24*t,"px;line-height:").concat(24*t,"px;border-radius: ").concat(12*t,"px;margin-top: ").concat(36*t,'px;\n            background-color: rgba(0,0,0,0.7);color:rgba(255,255,255,0.90);box-sizing: border-box;z-index: 999;">\n            </div>\n            '),i.insertBefore(n,document.getElementById(this.jSPlugin.id))}},{key:"initToastContent",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;console.log("content----------------",e),this.timer=null,document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?(document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom-content")).innerText=e||"",this.timer=setTimeout((function(){document.getElementById("".concat(t.jSPlugin.id,"-wrap"))&&document.getElementById("".concat(t.jSPlugin.id,"-wrap-Toast-custom"))&&document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(t.jSPlugin.id,"-wrap-Toast-custom")))}),i)):(this.randerToast(),this.initToastContent(e))}}]),e}(),Le=function(e,t,i){var n=new FormData;n.append("deviceSerial",P(e.url).deviceSerial),n.append("cmd","open"),e.accessToken;var a="".concat(e.env.domain,"/api/v3/device/acs/remote/door?accessToken=").concat(e.accessToken);fetch(a,{method:"POST",body:n}).then((function(e){return e.json()})).then((function(e){console.log("get theme data",e),function(e){console.log(e),t(e)}(e)})).catch((function(e){var t;t=e,console.log(t),i(t)}))},Be=function(e,t,i){var n={accessToken:e.accessToken,pageStart:0,pageSize:4,default:!0,voiceName:"轻应用语音文件"},a="".concat(e.env.domain,"/api/lapp/voice/query");Ee(a,"POST",n,(function(e){console.log(e),t(e)}),(function(e){console.log(e),i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},Oe=function(e,t,i,n){var a="".concat(e.env.domain,"/api/lapp/voice/send"),r=new FormData;r.append("deviceSerial",P(e.url).deviceSerial),r.append("accessToken",e.accessToken),r.append("channelNo",P(e.url).channelNo||1),r.append("fileUrl",t),fetch(a,{method:"POST",body:r}).then((function(e){return e.json()})).then((function(e){!function(e){console.log(e),i(e)}(e)})).catch((function(e){var t;t=e,console.log(t),n(t)}))},je=function(){function e(t,i){r(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.switchFooter=i,this.sendLoadingStats=!1,this.toastCustom=new Me(t,!1),this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.initQuickReply()}return s(e,[{key:"initQuickReply",value:function(){document.getElementById("pc-quickReply-back")||this.renderQuickReply(),document.getElementById("pc-quickReply-back-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){var e=this,t=this.videoWidth/1024||1,i=document.createElement("div");i.style="width:100%;",i.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n        <div id="pc-quickReply-back" style="display: flex;align-items: center;margin: 0 '.concat(8*t,"px 0 ").concat(16*t,'px;cursor: pointer;">\n            <div style="height: ').concat(32*t,'px;">\n                <svg width="').concat(32*t,'px" height="').concat(32*t,'px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                    <title>返回</title>\n                    <defs>\n                        <filter id="filter-1">\n                            <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 1.000000 0"></feColorMatrix>\n                        </filter>\n                    </defs>\n                    <g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                        <g id="快速回复loading" transform="translate(-16.000000, -497.000000)">\n                            <g id="返回" transform="translate(0.000000, 425.000000)" filter="url(#filter-1)">\n                                <g transform="translate(16.000000, 72.000000)">\n                                    <rect id="Rectangle" x="0" y="0" width="32" height="32"></rect>\n                                    <path d="M12.5,7.5 C13.2988404,7.5 13.9518304,8.12445998 13.9974537,8.91186361 L14,9 L14,21.5 L26.5,21.5 C27.2988404,21.5 27.9518304,22.12446 27.9974537,22.9118636 L28,23 C28,23.7988404 27.37554,24.4518304 26.5881364,24.4974537 L26.5,24.5 L12.5,24.5 C11.7011596,24.5 11.0481696,23.87554 11.0025463,23.0881364 L11,23 L11,9 C11,8.17157288 11.6715729,7.5 12.5,7.5 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" transform="translate(19.500000, 16.000000) rotate(45.000000) translate(-19.500000, -16.000000) "></path>\n                                </g>\n                            </g>\n                        </g>\n                    </g>\n                </svg>\n            </div>\n            <span style="font-size: ').concat(24*t,'px;">返回</span>\n        </div>\n        <div id="pc-quickReply-content" style="display: block;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n        <div id="pc-quickReply-loading" style="display: none;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n        <div id="pc-quickReply-loaderror" style="display: none;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n    </div>'),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).appendChild(i),document.getElementById("pc-quickReply-back").onclick=function(){e.switchFooter("onBell")}}},{key:"matchQuickReplyBtn",value:function(){var e=this,t=this.videoWidth/1024||1,i=document.getElementById("pc-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(n,a){var r=document.createElement("div");r.id="pc-quickReply-back-item-".concat(a),r.style="margin: ".concat(8*t,"px 0 ").concat(8*t,"px ").concat(8*t,"px;cursor: pointer;\n            padding: 0 ").concat(20*t,"px;min-height: ").concat(64*t,"px;width:calc(50% - ").concat(16*t,"px);\n            display: inline-block;background: rgba(0,0,0,0.70);border-radius: 8px;text-align: center;\n            box-sizing: border-box;font-size:").concat(24*t,"px;color: rgba(255,255,255,0.90);"),r.innerHTML='<div id="pc-quickReply-back-item-box-'.concat(a,'">\n            <span id="pc-quickReply-name-').concat(a,'" style="line-height: ').concat(64*t,'px;">').concat(n.voiceName,"</span>\n            </div>"),r.onclick=function(){e.sendLoadingStats||(console.log("item:"+n),e.sendQuickReply(n,a))},i.appendChild(r)}))}},{key:"setBtnCheckLoading",value:function(e,t){var i=this.videoWidth/1024||1;if(t>-1){document.getElementById("pc-quickReply-back-item-".concat(t));var n=document.getElementById("pc-quickReply-back-item-box-".concat(t)),a=document.getElementById("pc-quickReply-name-".concat(t));if(1==e){var r=document.getElementById("pc-quickReply-icon-loading-".concat(t));r&&a&&n.removeChild(r)}else if(a){var o=document.createElement("span");o.id="pc-quickReply-icon-loading-".concat(t),o.style="vertical-align: middle;margin-right:".concat(16*i,"px;"),o.innerHTML='<svg width="'.concat(30*i,'" height="').concat(30*i,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#ffffff" p-id="2400"></path></svg>'),n.insertBefore(o,a)}}}},{key:"getQuickReplyList",value:function(){var e=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);Be(this.jSPlugin,(function(t){if(t&&200==t.code){var i=t.data||[],n=[];t.data.forEach((function(e,t){n=e.voiceName.split("_"),i[t].voiceName=n[1]})),e.quickReplyList=i,setTimeout((function(){e.madeLoadingDom(2)}),500)}else e.madeLoadingDom(1)}),(function(t){console.log(t),e.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(e){var t=this,i=this.videoWidth/1024||1;if(0==e){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 n=document.createElement("div");n.id="pc-quickReply-loading-box",n.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",n.innerHTML='<div class="" style="heigth:'.concat(40*i,'px">\n                <svg width="').concat(40*i,'" height="').concat(40*i,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#ffffff" p-id="2400"></path></svg>\n            </div>\n            <div style="font-size: ').concat(28*i,"px;margin-top:").concat(10*i,"px;line-height:").concat(36*i,'px;">加载中…</div>'),document.getElementById("pc-quickReply-loading").appendChild(n)}}else if(1==e){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 a=document.createElement("div");a.id="pc-quickReply-loaderror-box",a.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",a.innerHTML='<div style="font-size: '.concat(28*i,'px;color: rgba(255,255,255,0.90);">快速回复加载失败</div>\n            <div id="pc-quickReply-loaderror-reload" style="font-size: ').concat(24*i,"px;margin-top:").concat(16*i,'px;color: rgba(100,143,252,0.90);cursor: pointer;">重新加载</div>'),document.getElementById("pc-quickReply-loaderror").appendChild(a),document.getElementById("pc-quickReply-loaderror-reload").onclick=function(){t.getQuickReplyList()}}}else document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(e,t){var i=this;this.sendLoadingStats=!0,this.setBtnCheckLoading(0,t);Oe(this.jSPlugin,e.fileUrl,(function(e){i.sendLoadingStats=!1,i.setBtnCheckLoading(1,t),e&&200==e.code?i.toastCustom.initToastContent("快捷回复成功"):i.toastCustom.initToastContent("快捷回复失败,请重试"),i.switchFooter("onBell")}),(function(e){console.log(e),i.sendLoadingStats=!1,i.setBtnCheckLoading(1,t),i.toastCustom.initToastContent("快捷回复失败,请重试"),i.switchFooter("onBell")}))}}]),e}(),Ne=function(){function e(t,i){r(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.switchFooter=i,this.toastCustom=new Me(t,!1),this.lockStatus=!1,this.initRemoteUnlock()}return s(e,[{key:"initRemoteUnlock",value:function(){document.getElementById("pc-remoteUnlock-back")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var e=this,t=this.videoWidth/1024||1,i=document.createElement("div");i.style="width:100%;",i.id="pc-remoteUnlock-box",i.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n        <div id="pc-remoteUnlock-back" style="display: flex;align-items: center;margin: 0 '.concat(8*t,"px 0 ").concat(16*t,'px;cursor: pointer;">\n            <div style="height: ').concat(32*t,'px;">\n                <svg width="').concat(32*t,'px" height="').concat(32*t,'px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                    <title>返回</title>\n                    <defs>\n                        <filter id="filter-1">\n                            <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 1.000000 0"></feColorMatrix>\n                        </filter>\n                    </defs>\n                    <g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                        <g id="快速回复loading" transform="translate(-16.000000, -497.000000)">\n                            <g id="返回" transform="translate(0.000000, 425.000000)" filter="url(#filter-1)">\n                                <g transform="translate(16.000000, 72.000000)">\n                                    <rect id="Rectangle" x="0" y="0" width="32" height="32"></rect>\n                                    <path d="M12.5,7.5 C13.2988404,7.5 13.9518304,8.12445998 13.9974537,8.91186361 L14,9 L14,21.5 L26.5,21.5 C27.2988404,21.5 27.9518304,22.12446 27.9974537,22.9118636 L28,23 C28,23.7988404 27.37554,24.4518304 26.5881364,24.4974537 L26.5,24.5 L12.5,24.5 C11.7011596,24.5 11.0481696,23.87554 11.0025463,23.0881364 L11,23 L11,9 C11,8.17157288 11.6715729,7.5 12.5,7.5 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" transform="translate(19.500000, 16.000000) rotate(45.000000) translate(-19.500000, -16.000000) "></path>\n                                </g>\n                            </g>\n                        </g>\n                    </g>\n                </svg>\n            </div>\n            <span style="font-size: ').concat(24*t,'px;user-select: none;">返回</span>\n        </div>\n        <div id="pc-remoteUnlock-content" style="display: block;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n    </div>'),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).appendChild(i),document.getElementById("pc-remoteUnlock-back").onclick=function(){e.goback()},this.renderRemoteUnlockSlide()}},{key:"renderRemoteUnlockSlide",value:function(){var e=this.videoWidth/1024||1,t=document.getElementById("pc-remoteUnlock-content"),i=document.createElement("div");i.id="pc-remoteUnlock-content-slide",i.style="width: 100%;display: flex;justify-content: center;cursor: pointer;",i.innerHTML='<div id="pc-remoteUnlock-slide-box" style="width: '.concat(400*e,"px;line-height: ").concat(80*e,"px;height: ").concat(80*e,"px;border: 1px solid rgba(255,255,255,1);border-radius: ").concat(40*e,'px;position: relative;text-align: center;">\n        <div id="pc-remoteUnlock-slide-bgColor" style="border-radius: ').concat(40*e,"px;width: ").concat(64*e,"px;height: ").concat(80*e,'px;position: absolute;left: 0;top: 0;"></div>\n        <div id="pc-remoteUnlock-slide-tips" style="height: ').concat(80*e,"px;line-height: ").concat(80*e,"px;font-size: ").concat(24*e,"px;border-radius: ").concat(40*e,'px;position: absolute;text-align: center;user-select: none;color: rgba(255,255,255,0.90);width: 100%;">右滑开锁</div>\n        <div id="pc-remoteUnlock-slide-ball" style="top: ').concat(8*e,"px;left: ").concat(8*e,"px;width: ").concat(64*e,"px;height: ").concat(64*e,'px;background: #598FFF;position: absolute;text-align: center;border-radius:50%;display: flex;align-items: center;justify-content: center;">\n            <svg id="slide-ball-start" style="display: inline;" width="').concat(36*e,'px" height="').concat(36*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                <title></title>\n                <g id="icon/箭头向右" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                    <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="24" height="24"></rect>\n                    <path d="M14.2841136,6.3689007 L19.9432338,12.0287579 L14.2863796,17.6856122 L12.8580239,16.2572565 L16.114,12.9999007 L4.00000001,13 L4.00000001,11 L16.058,10.9999007 L12.8557579,7.79725638 L14.2841136,6.3689007 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                </g>\n            </svg>\n            <svg id="slide-ball-end"  style="display: none;" width="').concat(36*e,'" height="').concat(36*e,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#598FFF" p-id="2400"></path></svg>\n            \n        </div>\n    </div>'),t.appendChild(i),this.madeSlideEvent()}},{key:"getOffsetLeft",value:function(e){var t=0;do{t+=e.offsetLeft,e=e.parentNode}while(e.parentNode);return t}},{key:"madeSlideEvent",value:function(){var e=this.videoWidth/1024||1,t=document.getElementById("".concat(this.jSPlugin.id)),i=this.getOffsetLeft(t),n=document.getElementById("pc-remoteUnlock-slide-box"),a=document.getElementById("pc-remoteUnlock-slide-bgColor"),r=document.getElementById("pc-remoteUnlock-slide-tips"),o=document.getElementById("pc-remoteUnlock-slide-ball"),s=this;o.onmousedown=function(t){var l=(t=t||window.event).offsetX;o.style.transition="",a.style.transition="",document.onmouseup=function(){console.log("--------------onmouseup"),s.lockStatus||(a.style.width="0px",o.style.left=8*e+"px",o.style.transition="left 0.6s linear",a.style.transition="width 0.6s linear"),document.onmouseup=null,document.onmousemove=null},document.onmousemove=function(t){t=t||window.event;console.log("videoDom",i);var c=t.pageX-n.offsetLeft-l-i,d=n.clientWidth-o.clientWidth-8*e;c<=0&&(c=0),c>=d&&(c=d),o.style.left=c+"px",c!=d||s.lockStatus||s.lockStatus||(s.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",a.style.width=n.clientWidth+"px",a.style.backgroundColor="#598FFF",n.style.border="0",o.style.backgroundColor="#ffffff",r.textContent="正在开锁",o.onmousedown=null,document.onmousemove=null,s.sendRemoteUnlockApi())}}}},{key:"resetRemoteUnlockSlide",value:function(){var e=document.getElementById("pc-remoteUnlock-box"),t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock"));e&&t&&t.removeChild(e)}},{key:"sendRemoteUnlockApi",value:function(){var e=this;console.log("下发远程开锁");Le(this.jSPlugin,(function(t){t&&200==t.code?e.toastCustom.initToastContent("开锁成功"):e.toastCustom.initToastContent("开锁失败,请重试"),e.goback()}),(function(t){console.log(t),e.toastCustom.initToastContent("开锁失败,请重试"),e.goback()}))}},{key:"goback",value:function(){this.switchFooter("onCall"),this.resetRemoteUnlockSlide()}}]),e}(),Ue={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"}]}}},ze=function(e){var t="";return Object.keys(e).map((function(i,n){t+="".concat(i,":").concat(e[i]).concat(n<Object.keys(e).length-1?";":"")})),t},He=function(){function e(t,i,n,a){var o=this;r(this,e),l(this,"autoPlayRing",(function(){console.log("autoPlayRing");var e=document.getElementById("bellring-audio");e&&(e.muted=!1,e.src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3",e.paused&&e.play()),window.removeEventListener("click",o.autoPlayRing)})),l(this,"muteCommon",(function(e){var t=o.decoderState.state,i=t.talk,n=t.sound;i?(console.log("结束对讲"),o.setDecoderState({talk:!1,mute:!0},e.backgroundColor),o.jSPlugin.Talk.stopTalk(),n||o.jSPlugin.openSound(),o.setDecoderState({sound:!0})):(o.setDecoderState({talk:!1,mute:!0},e.backgroundColor),n||o.jSPlugin.openSound(),o.setDecoderState({sound:!0}))})),l(this,"switchCallStatus",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=o.themeData,n=i.header,a=i.footer,r=null;if("onCall"==e){console.log("接听"),o.bellStatus="onCall",o.switchFooter("onCall"),a[o.bellStatus].btnList.map((function(e,t){e.isrender&&o.renderFooter(e.iconId,e),"mute"==e.iconId&&(r=e)})),n[o.bellStatus].btnList.map((function(e,t){e.isrender&&o.renderHeader(e.iconId,e)}));var s=document.getElementById("".concat(o.jSPlugin.id,"-header-onBell"));s&&s.parentElement.removeChild(s),1==o.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(o.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==o.themeData.customConfig.defaultMicro&&r?o.muteCommon(r):o.setDecoderState({mute:!1},r.backgroundColor),o.removeBellRing()}else console.log("响铃"),o.bellStatus="onBell",o.jSPlugin.Theme.changeTheme(o.themeData,t)})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=i,this.setDecoderState=n,this.decoderState=a,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.toastCustom=new Me(t,!1)}return s(e,[{key:"initBellRing",value:function(){var e=this,t=this.decoderState.state,i=t.play,n=t.isEditing;t.rejection;var a=this.videoWidth/1024;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var r=document.getElementById("bellring"),o=document.getElementById("bellring-audio");if(!r&&!o){if(this.jSPlugin.isNeedBellRing){var s=document.createElement("div");s.id="bellring",s.innerHTML='<div>\n          <audio id="bellring-audio" loop autoplay>\n            <source src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3" type="audio/mpeg">\n          </audio>\n          </div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s)}if(1!=this.themeData.customConfig.bellPoster||n)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var l=(this.videoHeight-180*a)/2,c=document.createElement("div");c.id="bellring-icon",c.style="position: absolute;pointer-events: none;background: none;width: 100%;\n          position: absolute;top: ".concat(l,"px;display: flex;align-items: center;justify-content: center;"),c.innerHTML='<div style="width: '.concat(180*a,"px;height: ").concat(180*a,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.2);border-radius: 50%;">\n            <div style="width: ').concat(100*a,"px;height: ").concat(100*a,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.3);border-radius: 50%;">\n              <svg width="').concat(40*a,'px" height="').concat(40*a,'px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                  <title>icon/响铃</title>\n                  <g id="icon/响铃" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                      <polygon id="Path" points="0 0 40.0000002 0 40.0000002 40.0000002 0 40.0000002"></polygon>\n                      <path d="M20.0000001,4.25000002 C22.0363461,4.25000002 23.698175,5.84879552 23.8000507,7.8591997 L23.8050001,8.05500003 L23.805316,8.99953253 C27.1874196,9.97041766 29.6921839,13.0354462 29.80936,16.723731 L29.80936,16.723731 L29.8133335,16.9800001 L29.8133335,21.6416668 C29.8133335,22.3259481 30.0858837,22.9835569 30.5703302,23.4680033 L30.5703302,23.4680033 L31.6386635,24.5363367 C32.338953,25.2366262 32.760721,26.1675592 32.8273086,27.1785295 L32.8273086,27.1785295 L32.8350001,27.4233334 C32.8350001,29.577547 31.0892137,31.3233335 28.9350001,31.3233335 L28.9350001,31.3233335 L24.5666667,31.323 L24.5650266,31.3951531 C24.4527075,33.8194458 22.4520933,35.7500001 20.0000001,35.7500001 C17.5482065,35.7500001 15.5473098,33.8197367 15.4349743,31.3967059 L15.4326667,31.323 L11.0666667,31.3233335 C9.06159524,31.3233335 7.39851917,29.8069287 7.18810198,27.8229374 L7.17194359,27.6230185 L7.1666667,27.4233334 C7.1666667,26.3411154 7.59733134,25.3020086 8.36300328,24.5363367 L8.36300328,24.5363367 L9.43133662,23.4680033 C9.91578309,22.9835569 10.1883334,22.3259481 10.1883334,21.6416668 L10.1883334,21.6416668 L10.1883334,16.9800001 C10.1883334,13.1909619 12.7263704,9.99530436 16.1948593,8.99965364 L16.1950001,8.05500003 C16.1950001,5.95360729 17.8979654,4.25000002 20.0000001,4.25000002 Z M23.0656667,31.323 L16.9336667,31.323 L16.9352114,31.3619281 C17.0285826,32.9723844 18.3649772,34.2500001 20.0000001,34.2500001 C21.6352227,34.2500001 22.9714318,32.9721919 23.0647896,31.3604131 L23.0656667,31.323 Z M21.5116668,10.1783334 L18.4900001,10.1783334 C14.7336124,10.1783334 11.6883334,13.2231481 11.6883334,16.9800001 L11.6883334,16.9800001 L11.6883334,21.6416668 C11.6883334,22.7238848 11.2576687,23.7629916 10.4919968,24.5286635 L10.4919968,24.5286635 L9.42366346,25.5969969 C8.93921698,26.0814433 8.6666667,26.7390521 8.66637526,27.402427 L8.66637526,27.402427 L8.67048222,27.560237 C8.74130967,28.8268108 9.79171396,29.8233335 11.0666667,29.8233335 L11.0666667,29.8233335 L23.7906939,29.8222289 C23.8004164,29.8218553 23.8101862,29.8216668 23.8200001,29.8216668 L23.8486667,29.823 L28.9350001,29.8233335 C30.2055455,29.8233335 31.2450456,28.8367727 31.329826,27.609522 L31.3354106,27.4481422 L31.3293607,27.2529336 C31.2880301,26.6292837 31.0210852,26.0400787 30.5780034,25.5969969 L30.5780034,25.5969969 L29.50967,24.5286635 C28.7439981,23.7629916 28.3133335,22.7238848 28.3133335,21.6416668 L28.3133335,21.6416668 L28.3134279,16.9919039 L28.3098332,16.759466 C28.1934023,13.0970787 25.1864454,10.1783334 21.5116668,10.1783334 L21.5116668,10.1783334 Z M20.0000001,5.75000002 C18.7795808,5.75000002 17.7813801,6.69770708 17.7003155,7.89717688 L17.6950001,8.05500003 L17.6952875,8.7158769 C17.9568453,8.69103758 18.2219393,8.67833337 18.4900001,8.67833337 L18.4900001,8.67833337 L21.5116668,8.67833337 C21.7792577,8.67833337 22.0439466,8.69101238 22.3051575,8.71580951 L22.3050001,8.05500003 C22.3050001,6.7819079 21.273481,5.75000002 20.0000001,5.75000002 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                  </g>\n              </svg>\n            </div>\n          </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(c),i&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var t=e.decoderState.state,i=t.isEditing,n=t.rejection;"onBell"!=e.bellStatus||n||(e.removeBellRing(),i||e.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"matchBtn",value:function(e,t){var i=this,n=this.themeData,a=n.header,r=n.footer,o=this.decoderState.state,s=o.mute,l=o.rejection,c={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===a[this.bellStatus].btnList.findIndex((function(t){return t.iconId===e}))?(c.color=r[this.bellStatus].color,c.backgroundColor=r[this.bellStatus].backgroundColor,c.activeColor=r[this.bellStatus].activeColor):(c.color=a[this.bellStatus].color,c.backgroundColor=a[this.bellStatus].backgroundColor,c.activeColor=a[this.bellStatus].activeColor);var d=this.videoWidth/6;this.videoWidth;var u=this.videoWidth/1024||1;switch(e){case"ringStatus":return c.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,c.id=e,c.domString='<span id="header-onBell-ringStatus" style="color:'.concat(t.color||"#FFFFFF",";font-size: ").concat(32*u,'px;display: block;text-align: left;font-weight: 500;" >').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,"</span>"),c.onclick=function(){},c;case"deviceCategory":return c.title="设备名称",c.id=e,c.domString='<span id="header-onBell-deviceCategory" \n          style="\n          color:'.concat(t.color||"#FFFFFF",";\n          font-size: ").concat(24*u,"px;\n          padding-top: ").concat(16*u,'px;\n          display: block;\n          max-width: 100%;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          white-space: nowrap;\n          text-align: left;\n          ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),c.onclick=function(){},c;case"callStatus":return c.title="通话中",c.id=e,c.domString='<span id="header-onCall-ringStatus" style="color:'.concat(t.color||"#FFFFFF",";font-size: ").concat(32*u,'px;display: block;text-align: left;" >通话中</span>'),c.onclick=function(){},c;case"deviceCategory":return c.title="设备名称",c.id=e,c.domString='<span id="header-onCall-deviceCategory"\n           style="color:'.concat(t.color||"#FFFFFF",";\n           font-size: ").concat(24*u,"px;\n           padding-top: ").concat(16*u,'px;\n           display: block;\n           max-width: 100%;\n           overflow: hidden;\n           text-overflow: ellipsis;\n           white-space: nowrap;\n           text-align: left;\n           ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),c.onclick=function(){},c;case"rejection":return c.title="拒绝",c.id=e,c.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width:').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>拒绝</title>\n                        <g id="icon/拒绝" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*d,'px;user-select: none;">拒绝</div>\n            </div>'),c.onclick=function(){var e=i.decoderState.state,t=e.play,n=e.isEditing,a=e.rejection;if(n||a)return!1;console.log("拒绝"),t&&i.jSPlugin.stop(),i.removeBellRing(),i.setDecoderState({play:!1,rejection:!0}),i.rejectionStatusDispose(),"function"==typeof i.jSPlugin.hangUpCallback&&i.jSPlugin.hangUpCallback("rejection")},c;case"quickReply":return c.title="快捷回复",c.id=e,c.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>快捷回复</title>\n                        <g id="icon/web快捷回复" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M17.4723401,6.00464509 C24.1317208,5.8200623 29.613145,11.1601938 29.613145,17.806299 C29.613145,19.5506656 29.2343807,21.2437888 28.5133012,22.7904909 L28.638,22.51 L29.9802796,28.9334997 C30.0980856,29.4978889 29.6719785,30.0050773 29.131395,30.0271186 L29.0218792,30.0249315 L28.9025577,30.0074816 L22.488349,28.6446207 L22.3501503,28.7067675 C21.0679643,29.242563 19.6940914,29.5480927 18.2793303,29.6038407 L18.2793303,29.6038407 L17.8062986,29.6131454 C11.1610025,29.6131454 5.820073,24.1313212 6.00464384,17.4723718 C6.17540866,11.3038211 11.3038207,6.17540904 17.4723401,6.00464509 Z M17.8062986,16.2974446 C16.9707372,16.2974446 16.2926003,16.9755814 16.2926003,17.8111428 C16.2926003,18.6467043 16.9707372,19.3248411 17.8062986,19.3248411 C18.64186,19.3248411 19.3199969,18.6467043 19.3199969,17.8111428 C19.3199969,16.9755814 18.64186,16.2974446 17.8062986,16.2974446 Z M12.9624642,16.2974446 C12.1269027,16.2974446 11.4487659,16.9755814 11.4487659,17.8111428 C11.4487659,18.6467043 12.1269027,19.3248411 12.9624642,19.3248411 C13.7980256,19.3248411 14.4761624,18.6467043 14.4761624,17.8111428 C14.4761624,16.9755814 13.7980256,16.2974446 12.9624642,16.2974446 Z M22.650133,16.2974446 C21.8145716,16.2974446 21.1364348,16.9755814 21.1364348,17.8111428 C21.1364348,18.6467043 21.8145716,19.3248411 22.650133,19.3248411 C23.4856945,19.3248411 24.1638313,18.6467043 24.1638313,17.8111428 C24.1638313,16.9755814 23.4856945,16.2974446 22.650133,16.2974446 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*d,'px;user-select: none;">快捷回复</div>\n            </div>'),c.onclick=function(){if(i.decoderState.state.rejection)return!1;console.log("快捷回复"),i.switchFooter("quickReply"),i.quickReplyEle=new je(i.jSPlugin,i.switchFooter)},c;case"answer":return c.title="接听",c.id=e,c.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>接听</title>\n                        <g id="icon/接听" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M15.7728281,19.6822968 C13.2528132,17.165123 10.8435994,14.2473605 11.9999084,13.0938925 C13.6505608,11.4432401 15.0881341,10.4261428 12.1646895,6.78675259 C9.23840386,3.14452132 7.28659974,5.94011849 5.68708632,7.53963191 C3.84324225,9.38631703 5.59049048,16.2645088 12.3891328,23.0659922 C19.1877751,29.8646345 26.0688079,31.6147238 27.9154931,29.7680386 C29.5150065,28.1685252 32.3106036,26.2195622 28.6712134,23.2932765 C25.0318232,20.3669909 24.0147259,21.8045642 22.3640735,23.4580576 C21.2077645,24.6086845 18.2928431,22.1994707 15.7728281,19.6822968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.727936, 17.728157) rotate(-360.000000) translate(-17.727936, -17.728157) "></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*d,'px;user-select: none;">接听</div>\n            </div>'),c.onclick=function(){var e=i.decoderState.state,n=e.play,o=e.isEditing,s=e.talk,l=e.sound,c=e.rejection;if(o||c)return!1;console.log("接听"),i.jSPlugin.pluginStatus.loadingClear(),n||(i.jSPlugin.pluginStatus.loadingStart(i.jSPlugin.id),i.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),i.jSPlugin.play(),i.setDecoderState({play:!n})),s||1!=i.themeData.customConfig.defaultMicro||(i.setDecoderState({talk:!0,mute:!1}),l&&i.jSPlugin.closeSound(),i.jSPlugin.Talk.startTalk()),i.setDecoderState({sound:!1}),i.bellStatus="onCall",i.switchFooter("onCall"),r[i.bellStatus].btnList.map((function(e,t){e.isrender&&i.renderFooter(e.iconId,e)})),a[i.bellStatus].btnList.map((function(e,t){e.isrender&&i.renderHeader(e.iconId,e)}));var d=document.getElementById("".concat(i.jSPlugin.id,"-header-onBell"));d&&d.parentElement.removeChild(d),1==i.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(i.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),i.jSPlugin.setPoster("")),0==i.themeData.customConfig.defaultMicro&&(i.muteCommon(t),i.jSPlugin.openSound(),i.setDecoderState({sound:!0})),i.removeBellRing(),i.maxTalkTime=1e3*i.themeData.customConfig.maxTalkTime*60;var u=i;setTimeout((function(){s&&(console.log("结束对讲"),u.setDecoderState({talk:!1}),u.jSPlugin.Talk.stopTalk()),n&&(u.jSPlugin.stop(),u.setDecoderState({play:!n})),i.rejectionStatusDispose(),i.remoteUnlockEle&&i.remoteUnlockEle.goback(),"function"==typeof i.jSPlugin.hangUpCallback&&i.jSPlugin.hangUpCallback("hangUp")}),i.maxTalkTime)},c;case"remoteUnlock":return c.title="远程开锁",c.id=e,c.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>开锁</title>\n                        <g id="icon/开锁" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M18,4 C21.3137085,4 24,6.6862915 24,10 L24,10 L24,19.787 L29.5,19.7875 C30.0522847,19.7875 30.5,20.2352153 30.5,20.7875 C30.5,21.3397847 30.0522847,21.7875 29.5,21.7875 L24,21.787 L24,26 C24,29.2383969 21.4344251,31.8775718 18.2249383,31.9958615 L18,32 C14.6862915,32 12,29.3137085 12,26 L12,26 L12,10 C12,6.6862915 14.6862915,4 18,4 Z M18,6 C15.790861,6 14,7.790861 14,10 L14,10 L14,26 C14,28.209139 15.790861,30 18,30 C20.209139,30 22,28.209139 22,26 L22,26 L22,21.787 L18.5,21.7875 C17.9477153,21.7875 17.5,21.3397847 17.5,20.7875 C17.5,20.2352153 17.9477153,19.7875 18.5,19.7875 L22,19.787 L22,10 C22,7.85780461 20.3160315,6.10892112 18.1996403,6.00489531 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*d,'px;user-select: none;">远程开锁</div>\n            </div>'),c.onclick=function(){var e=i.decoderState.state,t=e.isEditing,n=e.rejection;if(t||"onBell"==i.bellStatus||n)return!1;console.log("远程开锁"),i.switchFooter("remoteUnlock"),i.remoteUnlockEle=new Ne(i.jSPlugin,i.switchFooter)},c;case"mute":return c.title="静音",c.id=e,c.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n                <div id="').concat(this.jSPlugin.id,'-icon-mute" style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;border: 1px solid ").concat(l?"#CCCCCC":t.backgroundColor,";background: ").concat(l&&s?"#cccccc":"#ffffff",';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>静音</title>\n                        <g id="icon/静音" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path id="icon-mute-path" d="M29.2988305,7.56559704 C29.8540627,8.1086468 29.8980234,8.97727504 29.4240597,9.57172938 L29.3223594,9.6867869 L22.585,16.574 L22.5859243,26.0592702 C22.5859243,26.9500521 21.8638029,27.6721735 20.973021,27.6721735 C20.6007147,27.6721735 20.2398727,27.5433734 19.9517149,27.3076254 L15.583,23.733 L10.4341733,28.9987008 C9.85492024,29.5909486 8.9052312,29.6014828 8.31298346,29.0222298 C7.75775121,28.47918 7.71379057,27.6105518 8.18775419,27.0160974 L8.28945454,26.9010399 L27.1776406,7.58912597 C27.7568937,6.99687823 28.7065827,6.98634397 29.2988305,7.56559704 Z M22.2503608,7.16816759 C22.4679282,7.45036017 22.5859243,7.79665625 22.5859243,8.15298221 L22.585,9.899 L10.778,21.971 L9.47580645,21.9713498 C7.69424274,21.9713498 6.25,20.5271071 6.25,18.7455434 L6.25,15.65293 C6.25,13.8713663 7.69424274,12.4271235 9.47580645,12.4271235 L12.787,12.427 L19.9882064,6.87564241 C20.6936617,6.33174431 21.7064627,6.46271229 22.2503608,7.16816759 Z" id="形状结合" fill="').concat(s?"#ffffff":l?"#cccccc":t.backgroundColor,'"></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*d,'px;user-select: none;">静音</div>\n            </div>'),c.onclick=function(){var e=i.decoderState.state,n=e.talk,a=e.sound;if(e.play,e.rejection)return!1;console.log("静音"),n?(console.log("结束对讲"),i.setDecoderState({talk:!1,mute:!0},t.backgroundColor),i.jSPlugin.Talk.stopTalk(),i.jSPlugin.openSound(),i.setDecoderState({sound:!0})):(console.log("开始对讲"),i.setDecoderState({talk:!0,mute:!1},t.backgroundColor),a&&(i.jSPlugin.closeSound(),i.setDecoderState({sound:!1})),i.jSPlugin.Talk.startTalk())},c;case"hangUp":return c.title="挂断",c.id=e,c.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width:').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>挂断</title>\n                        <g id="icon/挂断" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*d,'px;">挂断</div>\n            </div>'),c.onclick=function(){var e=i.decoderState.state,t=e.talk,n=e.play,a=e.sound;if(e.rejection)return!1;t&&(console.log("结束对讲"),i.setDecoderState({talk:!1}),i.jSPlugin.Talk.stopTalk()),n&&(i.jSPlugin.stop(),i.setDecoderState({play:!n})),a&&(i.jSPlugin.closeSound(),i.setDecoderState({sound:!1})),(n||t)&&(console.log("挂断"),i.removeBellRing(),i.rejectionStatusDispose(),"function"==typeof i.jSPlugin.hangUpCallback&&i.jSPlugin.hangUpCallback("hangUp"))},c;default:return c}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var e=this.decoderState.state.play;console.log("应答超时"),e&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.rejectionStatusDispose(),this.switchFooter("onBell"),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var e=this,t=this.themeData.footer,i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),a=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(i.innerHTML="",i.style.color="#ffffff"):(n.innerHTML="",n.style.color="#ffffff"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.renderFooter(t.iconId,t)})),a.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!1,type:2})}},{key:"userNoDevice",value:function(){var e=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var t=this.themeData.footer,i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));"onBell"==this.bellStatus?(i.innerHTML="",i.style.color="#ffffff"):(n.innerHTML="",n.style.color="#ffffff"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.renderFooter(t.iconId,t)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!1,type:2})}},{key:"renderHeader",value:function(e,t){var i=this,n=this.videoWidth/1024||1,a=this.matchBtn(e,t);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var r=document.createElement("span");r.innerHTML="".concat(a.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(r)}else{var o=document.createElement("div");o.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),o.style="max-width:50%;position:relative;",o.innerHTML='<span id="'.concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,'-content" style="display:inline-block;height:auto;padding-top: ').concat(32*n,'px;";>\n        ').concat(a.domString,"\n      </span>"),o.onclick=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;a.onclick(e)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(o)}}},{key:"renderFooter",value:function(e,t){var i=this,n=this.decoderState.state.mute;if(console.log("-------------renderFooter"),"remoteUnlock"==e&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var a=this.matchBtn(e,t),r=this.videoWidth/6,o=document.createElement("div");o.className="theme-icon-item",this.jSPlugin.isWebConsole?o.style="padding:0 ".concat(.1*r,"px;"):o.style="padding:0 ".concat(.1*r,"px;cursor: pointer;"),o.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(a.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(a.id,'-content" title="').concat(a.title,'" style="display: flex;align-items: center;position:relative;">')).concat(a.domString,"</div>")+"</span>",o.onclick=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;a.onclick(e)},a.onmouseenter&&(o.onmouseenter=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;a.onmouseenter(e)}),a.onmouseleave&&(o.onmouseleave=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;a.onmouseleave(e)});var s=this.videoWidth/597,l=document.createElement("span");l.className="icon-move left",l.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(a.id,'-left" title="左移" style="display: inline-block;border-radius: 2px;overflow: hidden;position: absolute;top: calc(50% - ').concat(35*s,"px); width: ").concat(10*s,"px; height: ").concat(40*s,'px;cursor: pointer;">\n        <svg width="100%" height="100%" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n              <title></title>\n              <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                  <g id="H5呼叫模板" transform="translate(-614.000000, -5024.000000)">\n                      <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n                          <g id="编组-9" transform="translate(23.000000, 522.000000)">\n                              <g id="编组" transform="translate(170.000000, 0.000000)">\n                                  <g id="箭头左" transform="translate(0.000000, 18.000000)">\n                                      <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n                                      <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(1.000000, 15.000000)" fill="#FFFFFF">\n                                          <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n                                      </g>\n                                  </g>\n                              </g>\n                          </g>\n                      </g>\n                  </g>\n              </g>\n          </svg>\n        </span>'),l.onclick=function(){i.editIcon(a.id,"left","footer")},o.appendChild(l);var c=document.createElement("span");if(c.className="icon-move right",c.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(a.id,'-right" class="ezuikit-theme-icon" title="右移" style="display: inline-block;border-radius: 2px;overflow: hidden;position: absolute;top: calc(50% - ').concat(35*s,"px);left: ").concat(20*s+.5*r,"px; width: ").concat(10*s,"px; height: ").concat(40*s,'px;cursor: pointer;">\n        <svg width="100%" height="100%" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n              <title></title>\n              <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                  <g id="H5呼叫模板" transform="translate(-684.000000, -5024.000000)">\n                      <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n                          <g id="编组-9" transform="translate(23.000000, 522.000000)">\n                              <g id="编组" transform="translate(170.000000, 0.000000)">\n                                  <g id="箭头右" transform="translate(70.000000, 18.000000)">\n                                      <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n                                      <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(5.500000, 20.000000) scale(-1, 1) translate(-5.500000, -20.000000) translate(2.000000, 15.000000)" fill="#FFFFFF">\n                                          <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n                                      </g>\n                                  </g>\n                              </g>\n                          </g>\n                      </g>\n                  </g>\n              </g>\n          </svg>\n        </span>'),c.onclick=function(){i.editIcon(a.id,"right","footer")},o.appendChild(c),"answer"==e||"rejection"==e||"hangUp"==e);else{var d=document.createElement("span");d.className="icon-move close",d.innerHTML='<span id="'.concat(a.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: ').concat(-15*s-1,"px;left: ").concat(20*s+.5*r-4.5*s,'px;cursor: pointer;">\n            <svg width="').concat(18*s,'" height="').concat(18*s,'" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                  <title></title>\n                  <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                      <g id="H5呼叫模板" transform="translate(-680.000000, -5006.000000)">\n                          <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n                              <g id="编组-9" transform="translate(23.000000, 522.000000)">\n                                  <g id="编组" transform="translate(170.000000, 0.000000)">\n                                      <g id="关闭1" transform="translate(66.000000, 0.000000)">\n                                          <rect id="矩形" fill-rule="nonzero" x="0" y="0" width="18" height="18"></rect>\n                                          <path d="M9,1.125 C4.65117188,1.125 1.125,4.65117188 1.125,9 C1.125,13.3488281 4.65117188,16.875 9,16.875 C13.3488281,16.875 16.875,13.3488281 16.875,9 C16.875,4.65117188 13.3488281,1.125 9,1.125 Z M11.9074219,11.9917969 L10.7472656,11.9865234 L9,9.90351562 L7.25449219,11.9847656 L6.09257813,11.9900391 C6.01523438,11.9900391 5.95195313,11.9285156 5.95195313,11.8494141 C5.95195313,11.8160156 5.96425781,11.784375 5.98535156,11.7580078 L8.27226563,9.03339844 L5.98535156,6.31054687 C5.96425781,6.28417969 5.95195313,6.25253906 5.95195313,6.21914062 C5.95195313,6.14179687 6.01523438,6.07851562 6.09257813,6.07851562 L7.25449219,6.08378906 L9,8.16679687 L10.7455078,6.08554688 L11.9056641,6.08027344 C11.9830078,6.08027344 12.0462891,6.14179687 12.0462891,6.22089844 C12.0462891,6.25429687 12.0339844,6.2859375 12.0128906,6.31230469 L9.72949219,9.03515625 L12.0146484,11.7597656 C12.0357422,11.7861328 12.0480469,11.8177734 12.0480469,11.8511719 C12.0480469,11.9285156 11.9847656,11.9917969 11.9074219,11.9917969 Z" id="形状" fill="#595959"></path>\n                                      </g>\n                                  </g>\n                              </g>\n                          </g>\n                      </g>\n                  </g>\n              </svg>\n          </span>'),d.onclick=function(){i.editIcon(a.id,"delete","footer")},o.appendChild(d)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(o):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(o),this.decoderState.state.isEditing&&"mute"==e&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||n?this.setDecoderState({mute:!1},t.backgroundColor):this.setDecoderState({mute:!0},t.backgroundColor))}},{key:"switchFooter",value:function(e){var t={};switch(this.themeData&&(t=this.themeData.footer),e){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="none"),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex"):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex";break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=t[this.bellStatus].color);break;case"quickReply":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none";break;case"remoteUnlock":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="flex"}}},{key:"initThemeData",value:function(){var e=this;console.log("-------------initThemeData");var t=this.decoderState.state.isEditing,i=this.themeData,n=i.header,a=i.footer,r=this.jSPlugin.id,o=this.videoWidth/1024;if(this.isNeedRenderHeader=k.findIndex(n[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=k.findIndex(a[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width: calc(100% - 100px);padding-left: 3%;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var s=document.createElement("div");s.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),s.setAttribute("class","header-controls"),s.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:calc(100% - 100px);overflow:hidden;padding-left: 3%;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex;'></div>"),console.log(this.jSPlugin.height);var l=.2*this.jSPlugin.height+"px",c={height:l,display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":"-"+l,"align-items":"center",background:"transparent linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)"};s.style=ze(c),document.getElementById("".concat(r,"-wrap")).insertBefore(s,document.getElementById(r));var d=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(d)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));var u=.3*this.jSPlugin.height;if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(u,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n              <div id="'.concat(this.jSPlugin.id,'-audioControls"  class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n              '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n              <div id="'.concat(this.jSPlugin.id,'-audioControls"  class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n              '));else{var h=document.createElement("div");h.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),h.setAttribute("class","ez-iframe-footer-container");var f={"min-height":u+"px","max-height":u+"px",position:"relative","margin-top":"-"+u+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","background-image":"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.60) 100%)","font-size":24*o+"px"};h.style=ze(f),h.innerHTML='\n            <div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n            <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n            <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n            <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n            '),g(h,document.getElementById(r))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n[this.bellStatus].color,n[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.renderHeader(t.iconId,t)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a[this.bellStatus].color,a[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.renderFooter(t.iconId,t)}))),1==this.themeData.customConfig.bellPoster&&!t){this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var x=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(x),e.jSPlugin.setPoster(e.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),window.addEventListener("click",this.autoPlayRing)),this.inited=!0,this.getCallDeviceInfo()}},{key:"renderThemeData",value:function(){var e=this,t=this.decoderState.state.isEditing,i=this.themeData,n=i.header,a=i.footer;if(this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n[this.bellStatus].color.replace("-diy",""),n[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.setDecoderState(l({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&a)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=a[this.bellStatus].color.replace("-diy",""),a[this.bellStatus].btnList.map((function(i,n){if(i.isrender&&e.setDecoderState(l({},i.iconId,e.decoderState.state[i.iconId])),0==n&&!e.themeInited&&e.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),1!=e.themeData.customConfig.bellPoster||t?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){e.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===P(this.jSPlugin.url).type,rec:"rec"===P(this.jSPlugin.url).type,type:P(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!t?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),e.jSPlugin.reSize(e.jSPlugin.params.width,e.jSPlugin.params.height))}),50)}},{key:"setThemeData",value:function(e,t){this.themeData=e,"onCall"==t&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(e,t,i){console.log("编辑组件",e,t,i);var n=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[i][this.bellStatus].btnList,r=k.findIndex(a,(function(t){return t.iconId===e})),o=a[r];switch(t){case"delete":a[r].isrender=0;break;case"right":for(var s=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){s=l;break}-1!==s&&(a[r]=a[s],a[s]=o);break;case"left":for(var c=-1,d=r-1;d>=0;d--)if(a[d].part===a[r].part&&1==a[d].isrender){c=d;break}-1!==c&&(a[r]=a[c],a[c]=o)}console.log("new btnList",a),n[i][this.bellStatus].btnList=a,this.jSPlugin.Theme.changeTheme(n)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var n=document.createElement("div");n.id=this.jSPlugin.id+"time-area",n.className="time-area",n.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(n)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var a=t;document.getElementById(i.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++a,document.getElementById(i.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),i=0,n=0,a="00",r="00",o="00";t>59&&(i=parseInt(t/60),t=parseInt(t%60),i>59&&(n=parseInt(i/60),i=parseInt(i%60)));return a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),o=parseInt(n)>9?parseInt(n):"0"+parseInt(n),n>0?o+":"+r+":"+a:i>0?r+":"+a:"00:"+a}(a)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(i.jSPlugin.id+"time-area")&&(document.getElementById(i.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(i.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){console.log("----------editStart2");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),t&&t.setAttribute("class","footer-controls themeEditing"),i&&i.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){console.log("----------editEnd2");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));i&&i.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),n&&n.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(e){var t=this;Ie(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data?(t.activeThemeStatus=!0,t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header[t.bellStatus].btnList=t.themeData.header[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer[t.bellStatus].btnList=t.themeData.footer[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)):(t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),t.setDecoderState({rejection:!0}),"111021"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff"}),t.activeThemeStatusTxt="无效的模板id"):"111023"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff"}),t.activeThemeStatusTxt="试用特权已到期"):(t.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff"}),t.activeThemeStatusTxt="模板未激活"),t.themeData=Ue,t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}},{key:"getCallDeviceInfo",value:function(){var e=this;this.videoWidth,De({accessToken:this.jSPlugin.accessToken,deviceSerial:P(this.jSPlugin.url).deviceSerial}).then((function(t){console.log("---------getCallDeviceInfo"),e.deviceInfoData=t.data,t.data.isEncrypt&&setTimeout((function(){e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),500),document.getElementById("header-".concat(e.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(e.bellStatus,"-deviceCategory")).innerText=""+t.data.deviceName)})).catch((function(t){20018!=t.code||e.jSPlugin.isWebConsole||e.userNoDevice(),console.log("获取设备信息失败",t)}))}},{key:"setHeaderText",value:function(e){var t=this.videoWidth/1024||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(32*t,'px;display: block">').concat(e,'</span><span style="font-size: ').concat(24*t,"px;padding-top: ").concat(16*t,'px;display: block;">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"","</span>"))}}]),e}(),Ve=function(){function e(t,i){r(this,e),this.jSPlugin=t,this.heightPop=i||366,this.initPopupCustom()}return s(e,[{key:"initPopupCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom")).style.display="flex":this.randerPopup()}},{key:"randerPopup",value:function(){var e=this,t=document.documentElement.clientWidth/375||1,i=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(i),i.innerHTML="@keyframes slideContentUp {0%   {bottom: -".concat(366*t,"px;}\n        25%  {bottom: -").concat(244*t,"px;}\n        50%  {bottom: -").concat(122*t,"px;}\n        100% {bottom:0;}} .open-popup{animation:slideContentUp 0.3s 1 linear; -webkit-animation: slideContentUp 0.3s 1 linear;}");var n=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),a=document.createElement("div");a.style="display:flex;",a.id="".concat(this.jSPlugin.id,"-wrap-popup-custom"),a.innerHTML='<div id="'.concat(this.jSPlugin.id,'-wrap-popup-custom-mask" style="height:100%;width:100%;position:fixed;top:0;left:0;z-index:9998;background-color: rgba(0,0,0,0.75);overflow:hidden;">\n        </div>\n        <div id="').concat(this.jSPlugin.id,'-wrap-popup-board" class="open-popup" style="bottom:0;height: ').concat(this.heightPop*t,'px;position:fixed;left: 0; width: 100%;background-color:#ffffff;z-index: 9999;border-radius: 16px 16px 0px 0px;">\n            <div style="margin-top: ').concat(20*t,"px;padding: 0 ").concat(15*t,'px;width: 100%;display:flex;flex-direction: row;align-items: center;">\n                <div id="').concat(this.jSPlugin.id,'-popup-board-close">\n                    <svg width="').concat(24*t,'px" height="').concat(24*t,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>icon/close</title>\n                        <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <g id="common/Close/Dark">\n                                <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n                                <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n                            </g>\n                        </g>\n                    </svg>\n                </div>\n                <div id="popup-board-title-content" style="width: ').concat(180*t,"px;font-size: ").concat(18*t,"px;margin-left: ").concat(59*t,'px;font-family: PingFangSC-Medium;color: #2C2C2C;font-weight: 500;text-align: center;"></div>\n            </div>\n            <div id="').concat(this.jSPlugin.id,'-popup-board-content" style="width:100%;padding: 0 ').concat(15*t,"px;height: ").concat((this.heightPop-48)*t,'px;box-sizing: border-box;display: flex;align-items: center;justify-content: center;flex-direction: column;"></div>\n        </div>\n        '),n.appendChild(a),document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom-mask")).onclick=function(){e.closePopupCustom()},document.getElementById("".concat(this.jSPlugin.id,"-popup-board-close")).onclick=function(){e.closePopupCustom()}}},{key:"closePopupCustom",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){})();var e=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),t=document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom"));e&&t&&e.removeChild(t)}},{key:"initPopupContent",value:function(e,t){document.getElementById("popup-board-title-content").innerText=e||"",t&&document.getElementById("".concat(this.jSPlugin.id,"-popup-board-content")).appendChild(t)}}]),e}(),Ze=function(){function e(t,i,n){r(this,e),this.jSPlugin=t,this.videoWidth=n,this.switchFooter=i,this.toastCustom=new Me(t,!0),this.sendLoadingStats=!1,this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.popupCustom=new Ve(t,366),document.getElementById("mobile-quickReply-list")||(this.popupCustom.initPopupContent("快捷回复",this.renderQuickReply()),this.initQuickReply())}return s(e,[{key:"initQuickReply",value:function(){document.getElementById("mobile-quickReply-list-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){document.documentElement.clientWidth;var e=document.createElement("div");return e.style="width:100%;",e.id="mobile-quickReply-list",e.innerHTML='<div id="mobile-quickReply-content" style="display: block;width:100%;margin-bottom: 36px;"></div>\n    <div id="mobile-quickReply-loading" style="display: none;width:100%;"></div>\n    <div id="mobile-quickReply-loaderror" style="display: none;width:100%;"></div>',e}},{key:"matchQuickReplyBtn",value:function(){var e=this,t=this.videoWidth/375||1,i=document.getElementById("mobile-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(n,a){var r=document.createElement("div");r.id="mobile-quickReply-list-item-".concat(a),r.style="margin: ".concat(14*t,"px 0;\n            padding: ").concat(12*t,"px ").concat(15*t,"px;min-height: ").concat(50*t,"px;width:100%;\n            background: #ffffff;border-radius: ").concat(25*t,"px;display: flex;align-items: center;\n            box-sizing: border-box;font-size:").concat(16*t,"px;color: #2c2c2c;"),r.innerHTML='\n            <svg id="mobile-quickReply-icon-'.concat(a,'" width="').concat(24*t,'px" height="').concat(24*t,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                    <title>icon/快捷回复播放</title>\n                    <g id="icon/快捷回复播放" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                        <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n                        <path d="M18.9877488,4.36609064 C21.024173,6.11256041 22.2495,8.93566941 22.2495,12.0024 C22.2495,15.066006 21.0272636,17.8857191 18.9943957,19.6331539 C18.6802816,19.9031635 18.2067557,19.8674098 17.9367461,19.5532957 C17.6667365,19.2391816 17.7024902,18.7656557 18.0166043,18.4956461 C19.708691,17.0411437 20.7495,14.6399857 20.7495,12.0024 C20.7495,9.36223947 19.7060688,6.95821183 18.0112512,5.50470936 C17.6968304,5.23505702 17.6605383,4.76157212 17.9301906,4.44715124 C18.199843,4.13273036 18.6733279,4.09643829 18.9877488,4.36609064 Z M12.2442357,5.87579772 L12.2496,6.0179 L12.2496,17.9819 C12.2496,19.4241617 10.6173522,20.2281184 9.48072691,19.4058312 L9.36879527,19.318145 L5.5996,16.1243865 L3.4996,16.1249 C2.581479,16.1249 1.8284129,15.4182283 1.75540159,14.518493 L1.7496,14.3749 L1.7496,9.6249 C1.7496,8.70699712 2.45696726,7.95373471 3.35611134,7.88070323 L3.4996,7.8749 L5.5996,7.8743865 L9.36863059,4.68279453 C10.4692948,3.74976994 12.1377395,4.4768074 12.2442357,5.87579772 Z M10.3952894,5.79039368 L10.338321,5.82721597 L6.35932099,9.19721597 C6.33078024,9.2209397 6.30781291,9.23786997 6.28390041,9.25347262 L6.35932099,9.19721597 C6.32908972,9.22282023 6.29742069,9.24561685 6.26463127,9.26563212 C6.24087088,9.28012218 6.21634729,9.29327785 6.19105714,9.30506452 C6.18413632,9.30829747 6.1773583,9.31133066 6.1705483,9.31425704 C6.10964585,9.34044144 6.04445985,9.35881628 5.97637056,9.36805338 C5.95756973,9.37054904 5.94148484,9.37214804 5.92538001,9.37322799 L5.8746,9.3749 L3.4996,9.3749 C3.38149734,9.3749 3.28218291,9.45734262 3.25621762,9.56766695 L3.2496,9.6249 L3.2496,14.3749 C3.2496,14.4934644 3.33170357,14.592449 3.44222164,14.6183106 L3.4996,14.6249 L5.8746,14.6249 L5.92192315,14.6263483 C5.93923255,14.627429 5.95652113,14.629109 5.97375563,14.6313909 L5.8746,14.6249 C5.9789469,14.6249 6.0783167,14.6462095 6.168595,14.6847142 C6.18010037,14.6895946 6.19235048,14.695194 6.2044823,14.7011451 C6.22547728,14.7114805 6.24528995,14.7223727 6.26453263,14.7341072 C6.266314,14.735195 6.26795143,14.7362034 6.26958602,14.7372187 L6.28086895,14.7443598 C6.30587317,14.7605037 6.32985559,14.7780945 6.3526978,14.7970136 L6.35940473,14.802655 L10.3380567,18.1733603 C10.4825575,18.2956302 10.695338,18.2179271 10.7408386,18.0492187 L10.7496,17.9819 L10.7496,6.0179 C10.7496,5.82820058 10.5532313,5.71607381 10.3952894,5.79039368 Z M15.9361636,7.38657032 C17.3580982,8.28109203 18.2498,10.0509458 18.2498,12.0044 C18.2498,13.9607796 17.3563865,15.7307985 15.9326223,16.6154437 C15.5807928,16.8340503 15.1183629,16.7260519 14.8997563,16.3742223 C14.6811497,16.0223928 14.7891481,15.5599629 15.1409777,15.3413563 C16.1036696,14.7431949 16.7498,13.4630899 16.7498,12.0044 C16.7498,10.5466827 16.103548,9.26399865 15.1374364,8.65622968 C14.7868297,8.43566726 14.6814079,7.97264316 14.9019703,7.62203641 C15.1225327,7.27142966 15.5855568,7.1660079 15.9361636,7.38657032 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n                    </g>\n                </svg>\n            <span id="mobile-quickReply-name-').concat(a,'" style="padding-left: 5px;">').concat(n.voiceName,"</span>"),r.onclick=function(){console.log("item:"+n),e.sendLoadingStats||(e.setBtnCheckStatus(a),e.sendQuickReply(n))},i.appendChild(r)}))}},{key:"setBtnCheckStatus",value:function(e){var t=this,i="";this.quickReplyList.forEach((function(n,a){i=document.getElementById("mobile-quickReply-list-item-".concat(a)),a==e?(i.style.background="#F4F6FC",i.style.color="#648FFC",t.setBtnCheckLoding(0,a)):(i.style.background="#ffffff",i.style.color="#2c2c2c")}))}},{key:"setBtnCheckLoding",value:function(e,t){console.log(t);var i=this.videoWidth/375||1;if(t>-1){var n=document.getElementById("mobile-quickReply-list-item-".concat(t)),a=document.getElementById("mobile-quickReply-name-".concat(t)),r=document.getElementById("mobile-quickReply-icon-".concat(t));if(1==e){if(document.getElementById("mobile-quickReply-icon-loading-".concat(t))&&a){var o=document.createElement("span");o.id="mobile-quickReply-icon-".concat(t),o.style="height:".concat(24*i,"px;"),o.innerHTML='\n                <svg width="'.concat(24*i,'px" height="').concat(24*i,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                    <title>icon/快捷回复播放</title>\n                    <g id="icon/快捷回复播放" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                        <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n                        <path d="M18.9877488,4.36609064 C21.024173,6.11256041 22.2495,8.93566941 22.2495,12.0024 C22.2495,15.066006 21.0272636,17.8857191 18.9943957,19.6331539 C18.6802816,19.9031635 18.2067557,19.8674098 17.9367461,19.5532957 C17.6667365,19.2391816 17.7024902,18.7656557 18.0166043,18.4956461 C19.708691,17.0411437 20.7495,14.6399857 20.7495,12.0024 C20.7495,9.36223947 19.7060688,6.95821183 18.0112512,5.50470936 C17.6968304,5.23505702 17.6605383,4.76157212 17.9301906,4.44715124 C18.199843,4.13273036 18.6733279,4.09643829 18.9877488,4.36609064 Z M12.2442357,5.87579772 L12.2496,6.0179 L12.2496,17.9819 C12.2496,19.4241617 10.6173522,20.2281184 9.48072691,19.4058312 L9.36879527,19.318145 L5.5996,16.1243865 L3.4996,16.1249 C2.581479,16.1249 1.8284129,15.4182283 1.75540159,14.518493 L1.7496,14.3749 L1.7496,9.6249 C1.7496,8.70699712 2.45696726,7.95373471 3.35611134,7.88070323 L3.4996,7.8749 L5.5996,7.8743865 L9.36863059,4.68279453 C10.4692948,3.74976994 12.1377395,4.4768074 12.2442357,5.87579772 Z M10.3952894,5.79039368 L10.338321,5.82721597 L6.35932099,9.19721597 C6.33078024,9.2209397 6.30781291,9.23786997 6.28390041,9.25347262 L6.35932099,9.19721597 C6.32908972,9.22282023 6.29742069,9.24561685 6.26463127,9.26563212 C6.24087088,9.28012218 6.21634729,9.29327785 6.19105714,9.30506452 C6.18413632,9.30829747 6.1773583,9.31133066 6.1705483,9.31425704 C6.10964585,9.34044144 6.04445985,9.35881628 5.97637056,9.36805338 C5.95756973,9.37054904 5.94148484,9.37214804 5.92538001,9.37322799 L5.8746,9.3749 L3.4996,9.3749 C3.38149734,9.3749 3.28218291,9.45734262 3.25621762,9.56766695 L3.2496,9.6249 L3.2496,14.3749 C3.2496,14.4934644 3.33170357,14.592449 3.44222164,14.6183106 L3.4996,14.6249 L5.8746,14.6249 L5.92192315,14.6263483 C5.93923255,14.627429 5.95652113,14.629109 5.97375563,14.6313909 L5.8746,14.6249 C5.9789469,14.6249 6.0783167,14.6462095 6.168595,14.6847142 C6.18010037,14.6895946 6.19235048,14.695194 6.2044823,14.7011451 C6.22547728,14.7114805 6.24528995,14.7223727 6.26453263,14.7341072 C6.266314,14.735195 6.26795143,14.7362034 6.26958602,14.7372187 L6.28086895,14.7443598 C6.30587317,14.7605037 6.32985559,14.7780945 6.3526978,14.7970136 L6.35940473,14.802655 L10.3380567,18.1733603 C10.4825575,18.2956302 10.695338,18.2179271 10.7408386,18.0492187 L10.7496,17.9819 L10.7496,6.0179 C10.7496,5.82820058 10.5532313,5.71607381 10.3952894,5.79039368 Z M15.9361636,7.38657032 C17.3580982,8.28109203 18.2498,10.0509458 18.2498,12.0044 C18.2498,13.9607796 17.3563865,15.7307985 15.9326223,16.6154437 C15.5807928,16.8340503 15.1183629,16.7260519 14.8997563,16.3742223 C14.6811497,16.0223928 14.7891481,15.5599629 15.1409777,15.3413563 C16.1036696,14.7431949 16.7498,13.4630899 16.7498,12.0044 C16.7498,10.5466827 16.103548,9.26399865 15.1374364,8.65622968 C14.7868297,8.43566726 14.6814079,7.97264316 14.9019703,7.62203641 C15.1225327,7.27142966 15.5855568,7.1660079 15.9361636,7.38657032 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n                    </g>\n                </svg>\n                '),n.insertBefore(o,a)}}else if(r&&a){n.removeChild(r);var s=document.createElement("span");s.id="mobile-quickReply-icon-loading-".concat(t),s.style="height:".concat(20*i,"px;width: ").concat(24*i,"px;"),s.innerHTML='<svg width="'.concat(20*i,'" height="').concat(20*i,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#666666" p-id="2400"></path></svg>'),n.insertBefore(s,a)}}}},{key:"getQuickReplyList",value:function(){var e=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);Be(this.jSPlugin,(function(t){if(t&&200==t.code){var i=t.data||[],n=[];t.data.forEach((function(e,t){n=e.voiceName.split("_"),i[t].voiceName=n[1]})),e.quickReplyList=i,setTimeout((function(){e.madeLoadingDom(2)}),500)}else e.madeLoadingDom(1)}),(function(t){console.log(t),e.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(e){var t=this,i=this.videoWidth/375||1;if(0==e){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 n=document.createElement("div");n.id="mobile-quickReply-loading-box",n.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: row;",n.innerHTML='<div class="" style="heigth:'.concat(20*i,'px">\n                <svg width="').concat(20*i,'" height="').concat(20*i,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#666666" p-id="2400"></path></svg>   \n            </div>\n            <div style="font-size: ').concat(16*i,"px;margin-left:",10,'px;color:#666666;">正在加载,请稍候</div>'),document.getElementById("mobile-quickReply-loading").appendChild(n)}}else if(1==e){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 a=document.createElement("div");a.id="mobile-quickReply-loaderror-box",a.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",a.innerHTML='<div style="">\n                <img style="width:'.concat(186*i,"px;height:").concat(120*i,'px;" src="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPZ34KAAStrAAA0pZ5cGTw167.png" />\n            </div>\n            <div style="font-size: ').concat(16*i,'px;color: #666666;">\n                <span>加载失败 </span>\n                <span id="mobile-quickReply-loaderror-reload" \n                style="color: #648FFC;-webkit-tap-highlight-color: transparent;">点击重试</span>\n            </div>'),document.getElementById("mobile-quickReply-loaderror").appendChild(a),document.getElementById("mobile-quickReply-loaderror-reload").onclick=function(){t.getQuickReplyList()}}}else document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(e){var t=this;this.sendLoadingStats=!0;Oe(this.jSPlugin,e.fileUrl,(function(e){t.sendLoadingStats=!1,e&&200==e.code?t.toastCustom.initToastContent("快捷回复成功"):t.toastCustom.initToastContent("快捷回复失败,请重试"),t.popupCustom.closePopupCustom()}),(function(e){console.log(e),t.sendLoadingStats=!1,t.toastCustom.initToastContent("快捷回复失败,请重试"),t.popupCustom.closePopupCustom()}))}},{key:"closeQuickReplyEle",value:function(){this.popupCustom.closePopupCustom()}}]),e}(),We=function(){function e(t,i,n){r(this,e),this.jSPlugin=t,this.videoWidth=n,this.switchFooter=i,this.toastCustom=new Me(t,!0),this.lockStatus=!1,this.popupCustom=new Ve(t,265),this.popupCustom.initPopupContent("远程开锁",this.renderRemoteUnlock()),this.renderRemoteUnlockSlide()}return s(e,[{key:"initRemoteUnlock",value:function(){document.getElementById("mobile-remoteUnlock-content")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var e=this.videoWidth/1024||1,t=document.createElement("div");return t.style="width:100%;",t.id="mobile-remoteUnlock-box",t.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n        <div id="mobile-remoteUnlock-content" style="display: block;width:calc(100% - '.concat(160*e,"px);margin: 0 ").concat(24*e,'px;"></div>\n    </div>'),t}},{key:"renderRemoteUnlockSlide",value:function(){var e=this.videoWidth/375||1,t=document.getElementById("mobile-remoteUnlock-content"),i=document.createElement("div");i.id="mobile-remoteUnlock-content-slide",i.style="width: 100%;display: flex;justify-content: center;padding: 0 ".concat(15*e,"px"),i.innerHTML='<div id="mobile-remoteUnlock-slide-box" style="width: 100%;line-height: '.concat(60*e,"px;height: ").concat(60*e,"px;border: 1px solid rgba(100,143,252,1);border-radius: ").concat(30*e,'px;position: relative;text-align: center;">\n        <div id="mobile-remoteUnlock-slide-bgColor" style="border-radius: ').concat(30*e,"px;width: ").concat(44*e,"px;height: ").concat(60*e,'px;position: absolute;left: 0;top: 0;"></div>\n        <div id="mobile-remoteUnlock-slide-tips" style="height: ').concat(60*e,"px;line-height: ").concat(60*e,"px;font-size: ").concat(14*e,"px;border-radius: ").concat(30*e,'px;position: absolute;text-align: center;user-select: none;color: #666666;width: 100%;">右滑开锁</div>\n        <div id="mobile-remoteUnlock-slide-ball" style="top: ').concat(8*e,"px;left: ").concat(8*e,"px;width: ").concat(44*e,"px;height: ").concat(44*e,'px;background: #598FFF;position: absolute;text-align: center;border-radius:50%;display:flex;align-items: center;justify-content: center;">\n            <svg id="slide-ball-start" style="display: inline;" width="').concat(24*e,'px" height="').concat(24*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                <title>icon/箭头向右</title>\n                <g id="icon/箭头向右" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                    <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="24" height="24"></rect>\n                    <path d="M14.2841136,6.3689007 L19.9432338,12.0287579 L14.2863796,17.6856122 L12.8580239,16.2572565 L16.114,12.9999007 L4.00000001,13 L4.00000001,11 L16.058,10.9999007 L12.8557579,7.79725638 L14.2841136,6.3689007 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                </g>\n            </svg>\n            <svg id="slide-ball-end" style="display: none;" width="').concat(20*e,'" height="').concat(20*e,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#648ffc" p-id="2400"></path></svg>\n        </div>\n    </div>'),t.appendChild(i),this.madeSlideEvent()}},{key:"madeSlideEvent",value:function(){var e=this.videoWidth/375||1,t=document.getElementById("mobile-remoteUnlock-slide-box"),i=document.getElementById("mobile-remoteUnlock-slide-bgColor"),n=document.getElementById("mobile-remoteUnlock-slide-tips"),a=document.getElementById("mobile-remoteUnlock-slide-ball"),r=this;a.ontouchstart=function(o){console.log("ontouchstart");var s=(o=o||window.event).touches[0].pageX;a.style.transition="",i.style.transition="",document.ontouchmove=function(o){var l=(o=o||window.event).touches[0].pageX-t.offsetLeft-s,c=t.clientWidth-a.clientWidth-8*e;l<=0&&(l=0),l>=c&&(l=c),a.style.left=l+"px",l!=c||r.lockStatus||(r.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",i.style.width=t.clientWidth+"px",i.style.backgroundColor="#598FFF",t.style.border="0",a.style.backgroundColor="#ffffff",n.textContent="正在开锁",n.style.color="#ffffff",a.ontouchstart=null,r.sendRemoteUnlockApi())},document.ontouchend=function(){r.lockStatus||(i.style.width="0px",a.style.left=8*e+"px",a.style.transition="left 0.6s linear",i.style.transition="width 0.6s linear"),document.ontouchend=null,document.ontouchmove=null}}}},{key:"resetRemoteUnlockSlide",value:function(){var e=this.videoWidth/1024||1;this.lockStatus=!1;var t=document.getElementById("mobile-remoteUnlock-slide-box"),i=document.getElementById("mobile-remoteUnlock-slide-bgColor"),n=document.getElementById("mobile-remoteUnlock-slide-tips"),a=document.getElementById("mobile-remoteUnlock-slide-ball");i.style.width="0px",a.style.left=8*e+"px",n.textContent="右滑开锁",n.style.color="#666666",document.getElementById("slide-ball-start").style.display="inline",document.getElementById("slide-ball-end").style.display="none",i.style.backgroundColor="#FFFFFF",t.style.border="1px solid rgba(255,255,255,1)",a.style.backgroundColor="#598FFF"}},{key:"sendRemoteUnlockApi",value:function(){var e=this;console.log("下发远程开锁");Le(this.jSPlugin,(function(t){t&&200==t.code?e.toastCustom.initToastContent("开锁成功"):e.toastCustom.initToastContent("开锁失败,请重试"),e.popupCustom.closePopupCustom()}),(function(t){console.log(t),e.toastCustom.initToastContent("开锁失败,请重试"),e.popupCustom.closePopupCustom()}))}},{key:"closeRemoteUnlock",value:function(){this.popupCustom.closePopupCustom()}}]),e}(),Ge={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"}]}}},Ye=function(e){var t="";return Object.keys(e).map((function(i,n){t+="".concat(i,":").concat(e[i]).concat(n<Object.keys(e).length-1?";":"")})),t},Xe=function(){function e(t,i,n,a){var o=this;r(this,e),l(this,"switchCallStatus",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=o.themeData,n=i.header,a=i.footer,r=null;if("onCall"==e){console.log("接听"),o.bellStatus="onCall",o.switchFooter("onCall"),a[o.bellStatus].btnList.map((function(e,t){e.isrender&&o.renderFooter(e.iconId,e),"mute"==e.iconId&&(r=e)})),n[o.bellStatus].btnList.map((function(e,t){e.isrender&&o.renderHeader(e.iconId,e)}));var s=document.getElementById("".concat(o.jSPlugin.id,"-header-onBell"));s&&s.parentElement.removeChild(s),1==o.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(o.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==o.themeData.customConfig.defaultMicro&&r?o.muteCommon(r):o.setDecoderState({mute:!1},r.backgroundColor),o.removeBellRing(),o.miniRecCloseClick()}else console.log("响铃"),o.bellStatus="onBell",o.jSPlugin.Theme.changeTheme(o.themeData,t)})),l(this,"muteCommon",(function(e){var t=o.decoderState.state,i=t.talk,n=t.sound;i?(console.log("结束对讲"),o.setDecoderState({talk:!1,mute:!0},e.backgroundColor),o.jSPlugin.Talk.stopTalk(),n||o.jSPlugin.openSound(),o.setDecoderState({sound:!0})):(o.setDecoderState({talk:!1,mute:!0},e.backgroundColor),n||o.jSPlugin.openSound(),o.setDecoderState({sound:!0}))})),l(this,"autoPlayRing",(function(){console.log("autoPlayRing");var e=document.getElementById("bellring-audio");e&&(e.muted=!1,e.src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3",e.paused&&e.play()),o.checkIsAppleDevice()||!1?window.removeEventListener("touchstart",o.autoPlayRing):window.removeEventListener("click",o.autoPlayRing)})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=i,this.setDecoderState=n,this.decoderState=a,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.miniRecStatus="rec",this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.miniRecNum=0,this.toastCustom=new Me(t,!0)}return s(e,[{key:"initBellRing",value:function(){var e=this,t=this.decoderState.state,i=t.play,n=t.isEditing,a=this.videoWidth,r=a/375;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var o=document.getElementById("bellring"),s=document.getElementById("bellring-audio");if(!o&&!s){if(this.jSPlugin.isNeedBellRing){var l=document.createElement("div");l.id="bellring",l.innerHTML='<div>\n          <audio id="bellring-audio" loop autoplay>\n            <source src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3" type="audio/mpeg">\n          </audio>\n          </div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(l)}if(1!=this.themeData.customConfig.bellPoster||n)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var c=1.8*a,d=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(d=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*c+6);var u=d+(this.videoHeight-130*r)/2,h=document.createElement("div");h.id="bellring-icon",h.style="position: absolute;pointer-events: none;background: none;width: 100%;\n          position: absolute;top: ".concat(u,"px;display: flex;align-items: center;justify-content: center;"),h.innerHTML='<div style="width: '.concat(130*r,"px;height: ").concat(130*r,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.2);border-radius: 50%;">\n            <div style="width: ').concat(80*r,"px;height: ").concat(80*r,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.3);border-radius: 50%;">\n              <svg width="').concat(40*r,'px" height="').concat(40*r,'px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                  <title>icon/响铃</title>\n                  <g id="icon/响铃" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                      <polygon id="Path" points="0 0 40.0000002 0 40.0000002 40.0000002 0 40.0000002"></polygon>\n                      <path d="M20.0000001,4.25000002 C22.0363461,4.25000002 23.698175,5.84879552 23.8000507,7.8591997 L23.8050001,8.05500003 L23.805316,8.99953253 C27.1874196,9.97041766 29.6921839,13.0354462 29.80936,16.723731 L29.80936,16.723731 L29.8133335,16.9800001 L29.8133335,21.6416668 C29.8133335,22.3259481 30.0858837,22.9835569 30.5703302,23.4680033 L30.5703302,23.4680033 L31.6386635,24.5363367 C32.338953,25.2366262 32.760721,26.1675592 32.8273086,27.1785295 L32.8273086,27.1785295 L32.8350001,27.4233334 C32.8350001,29.577547 31.0892137,31.3233335 28.9350001,31.3233335 L28.9350001,31.3233335 L24.5666667,31.323 L24.5650266,31.3951531 C24.4527075,33.8194458 22.4520933,35.7500001 20.0000001,35.7500001 C17.5482065,35.7500001 15.5473098,33.8197367 15.4349743,31.3967059 L15.4326667,31.323 L11.0666667,31.3233335 C9.06159524,31.3233335 7.39851917,29.8069287 7.18810198,27.8229374 L7.17194359,27.6230185 L7.1666667,27.4233334 C7.1666667,26.3411154 7.59733134,25.3020086 8.36300328,24.5363367 L8.36300328,24.5363367 L9.43133662,23.4680033 C9.91578309,22.9835569 10.1883334,22.3259481 10.1883334,21.6416668 L10.1883334,21.6416668 L10.1883334,16.9800001 C10.1883334,13.1909619 12.7263704,9.99530436 16.1948593,8.99965364 L16.1950001,8.05500003 C16.1950001,5.95360729 17.8979654,4.25000002 20.0000001,4.25000002 Z M23.0656667,31.323 L16.9336667,31.323 L16.9352114,31.3619281 C17.0285826,32.9723844 18.3649772,34.2500001 20.0000001,34.2500001 C21.6352227,34.2500001 22.9714318,32.9721919 23.0647896,31.3604131 L23.0656667,31.323 Z M21.5116668,10.1783334 L18.4900001,10.1783334 C14.7336124,10.1783334 11.6883334,13.2231481 11.6883334,16.9800001 L11.6883334,16.9800001 L11.6883334,21.6416668 C11.6883334,22.7238848 11.2576687,23.7629916 10.4919968,24.5286635 L10.4919968,24.5286635 L9.42366346,25.5969969 C8.93921698,26.0814433 8.6666667,26.7390521 8.66637526,27.402427 L8.66637526,27.402427 L8.67048222,27.560237 C8.74130967,28.8268108 9.79171396,29.8233335 11.0666667,29.8233335 L11.0666667,29.8233335 L23.7906939,29.8222289 C23.8004164,29.8218553 23.8101862,29.8216668 23.8200001,29.8216668 L23.8486667,29.823 L28.9350001,29.8233335 C30.2055455,29.8233335 31.2450456,28.8367727 31.329826,27.609522 L31.3354106,27.4481422 L31.3293607,27.2529336 C31.2880301,26.6292837 31.0210852,26.0400787 30.5780034,25.5969969 L30.5780034,25.5969969 L29.50967,24.5286635 C28.7439981,23.7629916 28.3133335,22.7238848 28.3133335,21.6416668 L28.3133335,21.6416668 L28.3134279,16.9919039 L28.3098332,16.759466 C28.1934023,13.0970787 25.1864454,10.1783334 21.5116668,10.1783334 L21.5116668,10.1783334 Z M20.0000001,5.75000002 C18.7795808,5.75000002 17.7813801,6.69770708 17.7003155,7.89717688 L17.6950001,8.05500003 L17.6952875,8.7158769 C17.9568453,8.69103758 18.2219393,8.67833337 18.4900001,8.67833337 L18.4900001,8.67833337 L21.5116668,8.67833337 C21.7792577,8.67833337 22.0439466,8.69101238 22.3051575,8.71580951 L22.3050001,8.05500003 C22.3050001,6.7819079 21.273481,5.75000002 20.0000001,5.75000002 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                  </g>\n              </svg>\n            </div>\n          </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(h),i&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var t=e.decoderState.state,i=t.isEditing,n=t.rejection;"onBell"!=e.bellStatus||n||(e.removeBellRing(),i||e.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"getMiniCallTimeUrl",value:function(){if(console.log("--------------getMiniCallTimeUrl"),-1!==this.jSPlugin.url.indexOf("hd.live")?this.recUrl=this.jSPlugin.url.replace("hd.live","rec"):this.recUrl=this.jSPlugin.url.replace("live","rec"),this.jSPlugin.callTime){var e=parseInt(this.jSPlugin.callTime),t=e+5e3,i=new Date(e-1e4).Format("yyyyMMddhhmmss"),n=new Date(t).Format("yyyyMMddhhmmss");this.recUrl="".concat(this.recUrl,"?begin=").concat(i,"&end=").concat(n),console.log("recurl="+this.recUrl)}}},{key:"initMiniRec",value:function(){var e=this,t=this,i=this.videoWidth,n=i/375,a=1.8*i,r=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(r=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*a+6);var o=r+this.videoHeight+10*n;if(console.log(r),document.getElementById("miniRecbox"))document.getElementById("miniRecbox")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")),document.getElementById("miniClose")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),this.initMiniRec();else{var s=document.createElement("div");s.id="miniRecbox",s.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;top: ".concat(o,"px;right: ").concat(9*n,"px;"),s.innerHTML='<div id="miniRec"></div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s),this.getMiniCallTimeUrl();var l={domain:j};this.miniRecPlayer=new Mh({id:"miniRec",width:160*n,height:90*n,template:"miniRec",url:this.recUrl,accessToken:this.jSPlugin.accessToken,handleError:function(i){console.log("小窗口handleError------------",i),i&&6701==i.retcode?(e.miniRecNum=e.miniRecNum+1,console.log("小窗口miniRecNum-----------------",e.miniRecNum),e.miniRecNum<5?t.miniRecPlayer.changePlayUrl({type:"miniRec"}):(console.log("小窗口------------------已播放5次,关闭小窗口"),t.miniRecCloseClick())):(console.log("小窗口------------------播放失败,关闭小窗口"),t.miniRecCloseClick())},env:this.jSPlugin.env||l});var c=document.createElement("div");c.id="miniClose",c.style="position: absolute;top: ".concat(o+8,"px;right: ").concat(16*n,"px;"),c.innerHTML='<div id="miniClose-btn" style="width: '.concat(24*n,"px;height: ").concat(24*n,'px;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: rgba(0,0,0,0.1);">\n          <svg width="').concat(24*n,'px" height="').concat(24*n,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n              <title>close</title>\n              <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                  <g id="common/Close/Dark">\n                      <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n                      <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#fff" fill-rule="nonzero"></path>\n                  </g>\n              </g>\n          </svg>\n        </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(c),document.getElementById("miniClose-btn").onclick=function(){t.miniRecCloseClick()}}}},{key:"initMiniImageRec",value:function(){console.log("initMiniImageRec");var e=this.videoWidth/375,t=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(t=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+26);var i=t+this.videoHeight+10*e;if(document.getElementById("miniRecbox"))document.getElementById("miniRecbox").style.top=i+"px",document.getElementById("miniClose").style.top=i+8+"px";else{var n=document.createElement("div");n.id="miniRecbox",n.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;\n        top: ".concat(i,"px;\n        right: ").concat(9*e,"px;\n        user-select: none;\n        "),n.innerHTML='<div id="miniRec" style="width: '.concat(160*e,"px;height: ").concat(90*e,'px;display: flex;align-items: center;justify-content: center;">\n          <embed id="miniRec-embed" style="z-index: 3;position: absolute;width: ').concat(160*e,"px;height: ").concat(90*e,'px;" type="image/svg+xml" src="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg" />\n          <div style="color: #FFFFFF;font-size: 12px;z-index: 4;">示意小窗位置</div>\n        </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(n);var a=document.createElement("div");a.id="miniClose",a.style="z-index: 4;position: absolute;top: ".concat(i+8,"px;right: ").concat(16*e,"px;"),a.innerHTML='<div id="miniClose-btn" style="width: '.concat(24*e,"px;height: ").concat(24*e,'px;display: flex;align-items: center;justify-content: center;border-radius: 50%;">\n          <svg width="').concat(24*e,'px" height="').concat(24*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n              <title>close</title>\n              <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                  <g id="common/Close/Dark">\n                      <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n                      <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#fff" fill-rule="nonzero"></path>\n                  </g>\n              </g>\n          </svg>\n        </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(a),document.getElementById("miniClose-btn").onclick=function(){}}}},{key:"miniRecCloseClick",value:function(){document.getElementById("miniRecbox")&&(console.log("---------------------miniRecCloseClick"),"rec"==this.miniRecStatus&&(this.miniRecPlayer&&this.miniRecPlayer.stop(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox"))))}},{key:"miniRecSwitchClick",value:function(){console.log("---------------小窗口切换");var e=this.decoderState.state.isEditing,t=this.videoWidth,i=t/375,n=1.8*t,a=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(a=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*n+6),console.log("headerHeight-------",a);var r=a+this.videoHeight+10*i;if(console.log("videoTop-------",r),"rec"==this.miniRecStatus){this.miniRecStatus="live",e?(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*i,90*i);var o=this.videoHeight+10*i,s=.2*n-90*i-10*i;document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginTop=o+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft=t-160*i-9+"px",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="8px",document.getElementById("miniRecbox").style.top=a+"px",document.getElementById("miniRecbox").style.left="0",document.getElementById("miniRecbox").style.right="0",document.getElementById("miniRecbox").style.borderRadius="0px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=s+"px"}else console.log(this.jSPlugin.width),this.miniRecStatus="rec",e?(document.getElementById("miniRec-embed").style.width=160*i+"px",document.getElementById("miniRec-embed").style.height=90*i+"px",document.getElementById("miniRec").style.width=160*i+"px",document.getElementById("miniRec").style.height=90*i+"px"):this.miniRecPlayer.reSize(160*i,90*i),this.jSPlugin.reSize(this.videoWidth,this.videoHeight),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+NaN,document.getElementById("".concat(this.jSPlugin.id)).style.marginTop="0",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft="0",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="0px",document.getElementById("miniRecbox").style.top=r+"px",document.getElementById("miniRecbox").style.right="9px",document.getElementById("miniRecbox").style.left="auto",document.getElementById("miniRecbox").style.borderRadius="8px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=.2*n+"px"}},{key:"matchBtn",value:function(e,t){var i=this,n=this.themeData,a=n.header,r=n.footer,o=this.decoderState.state,s=o.mute,l=o.rejection;document.documentElement.clientHeight;var c=this.videoWidth/375,d=this.videoWidth/375||1,u={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===a[this.bellStatus].btnList.findIndex((function(t){return t.iconId===e}))?(u.color=r[this.bellStatus].color,u.backgroundColor=r[this.bellStatus].backgroundColor,u.activeColor=r[this.bellStatus].activeColor):(u.color=a[this.bellStatus].color,u.backgroundColor=a[this.bellStatus].backgroundColor,u.activeColor=a[this.bellStatus].activeColor);var h=this.videoWidth/4;switch(e){case"ringStatus":return u.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,u.id=e,u.domString='<span id="header-onBell-ringStatus" style="color:'.concat(t.color||"#2C2C2C",";font-size: ").concat(24*d,'px;display: block;font-weight: 600;" >').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,"</span>"),u.onclick=function(){},u;case"deviceCategory":return u.title="设备名称",u.id=e,u.domString='<span id="header-onBell-deviceCategory" \n          style="color:'.concat(t.color||"#2C2C2C",";\n          font-size: ").concat(14*d,"px;\n          padding-top: ").concat(5*d,'px;\n          display: block;\n          max-width: 100%;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          white-space: nowrap;\n          ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),u.onclick=function(){},u;case"callStatus":return u.title="通话中",u.id=e,u.domString='<span id="header-onCall-ringStatus" style="color:'.concat(t.color||"#2C2C2C",";font-size: ").concat(24*d,'px;display: block;font-weight: 600;" >通话中</span>'),u.onclick=function(){},u;case"deviceCategory":return u.title="设备名称",u.id=e,u.domString='<span id="header-onCall-deviceCategory" \n          style="color:'.concat(t.color||"#2C2C2C",";\n          font-size: ").concat(14*d,"px;\n          padding-top: ").concat(5*d,'px;\n          display: block;\n          max-width: 100%;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          white-space: nowrap;\n          ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),u.onclick=function(){},u;case"rejection":return u.title="拒绝",u.id=e,u.domString='<div style="width: '.concat(.66*h,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width:').concat(.66*h,"px;height: ").concat(.66*h,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.4*h,'px" height="').concat(.4*h,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>拒绝</title>\n                        <g id="icon/拒绝" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*h,'px;user-select: none;">拒绝</div>\n            </div>'),u.onclick=function(){var e=i,t=i.decoderState.state,n=t.play,a=t.isEditing,r=t.rejection;if(a||r)return!1;console.log("拒绝"),n&&i.jSPlugin.stop(),i.removeBellRing(),i.setDecoderState({play:!1,rejection:!0}),e.miniRecCloseClick(),i.rejectionStatusDispose(),"function"==typeof i.jSPlugin.hangUpCallback&&i.jSPlugin.hangUpCallback("rejection")},u;case"quickReply":return u.title="快捷回复",u.id=e,u.domString='<div id="'.concat(this.jSPlugin.id,'-btn-quickReply" style="width: ').concat(126*c,"px;height: ").concat(40*c,"px;color:").concat(l?"rgba(44,44,44,0.5)":u.color,';background: #F8F8F8;border-radius: 20px;display: flex;flex-direction: row;align-items: center;justify-content: center;-webkit-tap-highlight-color:transparent;">\n                <div>\n                  <svg width="').concat(24*c,'px" height="').concat(24*c,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                      <title>快捷回复</title>\n                      <g id="icon/H5快捷回复" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                          <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n                          <path d="M10.7238197,2.25008794 C16.2230834,2.09766093 20.7496,6.50749909 20.7496,11.9958 C20.7496,13.4362841 20.4368194,14.8344518 19.8413577,16.1117061 L19.9440524,15.8792521 L21.0527769,21.184554 C21.1496277,21.6485507 20.8013031,22.0657304 20.3577211,22.0873894 L20.2613374,22.0858497 L20.1628027,22.0714397 L14.866,20.946 L14.7518767,20.9973203 C13.6930577,21.439776 12.5585243,21.69208 11.3902258,21.7381162 L11.3902258,21.7381162 L10.9996,21.7458 C5.51196728,21.7458 1.10147008,17.2189531 1.25388722,11.7200456 C1.39490345,6.62610538 5.62990538,2.39110345 10.7238197,2.25008794 Z M11.0183931,3.74628651 L10.7653544,3.74951278 C6.46729462,3.86849655 2.87229655,7.46349462 2.75331206,11.7615803 C2.62431432,16.4155628 6.35610614,20.2458 10.9996,20.2458 C12.2165433,20.2458 13.3936843,19.9831552 14.4692454,19.4827855 C14.6166569,19.4142071 14.7823612,19.395387 14.9413973,19.4291603 L14.9413973,19.4291603 L19.349,20.365 L18.4274231,15.948046 C18.4026128,15.8291836 18.4071487,15.7066932 18.4398273,15.5909727 L18.4398273,15.5909727 L18.4818423,15.4778939 C18.9851908,14.3982208 19.2496,13.216279 19.2496,11.9958 C19.2496,7.35166383 15.4197191,3.62050444 10.7653544,3.74951278 Z M10.9996,10.7498 C11.6896,10.7498 12.2496,11.3098 12.2496,11.9998 C12.2496,12.6898 11.6896,13.2498 10.9996,13.2498 C10.3096,13.2498 9.7496,12.6898 9.7496,11.9998 C9.7496,11.3098 10.3096,10.7498 10.9996,10.7498 Z M6.9996,10.7498 C7.6896,10.7498 8.2496,11.3098 8.2496,11.9998 C8.2496,12.6898 7.6896,13.2498 6.9996,13.2498 C6.3096,13.2498 5.7496,12.6898 5.7496,11.9998 C5.7496,11.3098 6.3096,10.7498 6.9996,10.7498 Z M14.9996,10.7498 C15.6896,10.7498 16.2496,11.3098 16.2496,11.9998 C16.2496,12.6898 15.6896,13.2498 14.9996,13.2498 C14.3096,13.2498 13.7496,12.6898 13.7496,11.9998 C13.7496,11.3098 14.3096,10.7498 14.9996,10.7498 Z" id="形状结合" fill="').concat(l?"rgba(44,44,44,0.5)":"#2c2c2c",'" fill-rule="nonzero"></path>\n                      </g>\n                  </svg>\n                </div>\n                <div style="margin-left: 5px;user-select: none;font-size:14px">快捷回复<div>\n            </div>'),u.onclick=function(){var e=i.decoderState.state,t=e.isEditing,n=e.rejection;if(t||n)return!1;console.log("快捷回复"),i.switchFooter("quickReply"),i.quickReplyEle=new Ze(i.jSPlugin,i.switchFooter,i.videoWidth)},u;case"answer":return u.title="接听",u.id=e,u.domString='<div style="width: '.concat(.66*h,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width: ').concat(.66*h,"px;height: ").concat(.66*h,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.4*h,'px" height="').concat(.4*h,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>接听</title>\n                        <g id="icon/接听" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M15.7728281,19.6822968 C13.2528132,17.165123 10.8435994,14.2473605 11.9999084,13.0938925 C13.6505608,11.4432401 15.0881341,10.4261428 12.1646895,6.78675259 C9.23840386,3.14452132 7.28659974,5.94011849 5.68708632,7.53963191 C3.84324225,9.38631703 5.59049048,16.2645088 12.3891328,23.0659922 C19.1877751,29.8646345 26.0688079,31.6147238 27.9154931,29.7680386 C29.5150065,28.1685252 32.3106036,26.2195622 28.6712134,23.2932765 C25.0318232,20.3669909 24.0147259,21.8045642 22.3640735,23.4580576 C21.2077645,24.6086845 18.2928431,22.1994707 15.7728281,19.6822968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.727936, 17.728157) rotate(-360.000000) translate(-17.727936, -17.728157) "></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*h,'px;user-select: none;">接听</div>\n            </div>'),u.onclick=function(){var e=i.decoderState.state,n=e.play,o=e.isEditing,s=e.talk,l=e.sound,c=e.rejection;if(o||c)return!1;console.log("接听"),i.jSPlugin.pluginStatus.loadingClear(),i.bellStatus="onCall",i.switchFooter("onCall"),r[i.bellStatus].btnList.map((function(e,t){e.isrender&&i.renderFooter(e.iconId,e)})),a[i.bellStatus].btnList.map((function(e,t){e.isrender&&i.renderHeader(e.iconId,e)}));var d=document.getElementById("".concat(i.jSPlugin.id,"-header-onBell"));d&&d.parentElement.removeChild(d),1==i.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(i.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),i.jSPlugin.setPoster("")),i.removeBellRing(),i.miniRecCloseClick(),n||(i.jSPlugin.pluginStatus.loadingStart(i.jSPlugin.id),i.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),i.jSPlugin.play(),i.setDecoderState({play:!n})),s||1!=i.themeData.customConfig.defaultMicro||(i.setDecoderState({talk:!0,mute:!1}),l&&i.jSPlugin.closeSound(),i.jSPlugin.Talk.startTalk()),i.setDecoderState({sound:!1}),0==i.themeData.customConfig.defaultMicro&&(i.muteCommon(t),i.jSPlugin.openSound(),i.setDecoderState({sound:!0})),i.maxTalkTime=1e3*i.themeData.customConfig.maxTalkTime*60;var u=i;setTimeout((function(){s&&(console.log("结束对讲"),u.setDecoderState({talk:!1}),u.jSPlugin.Talk.stopTalk()),n&&(u.jSPlugin.stop(),u.setDecoderState({play:!n})),i.rejectionStatusDispose(),i.remoteUnlockEle&&i.remoteUnlockEle.closeRemoteUnlock(),"function"==typeof i.jSPlugin.hangUpCallback&&i.jSPlugin.hangUpCallback("hangUp")}),i.maxTalkTime)},u;case"remoteUnlock":return u.title="远程开锁",u.id=e,u.domString='<div style="width: '.concat(.66*h,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width: ').concat(.66*h,"px;height: ").concat(.66*h,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.4*h,'px" height="').concat(.4*h,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>开锁</title>\n                        <g id="icon/开锁" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M18,4 C21.3137085,4 24,6.6862915 24,10 L24,10 L24,19.787 L29.5,19.7875 C30.0522847,19.7875 30.5,20.2352153 30.5,20.7875 C30.5,21.3397847 30.0522847,21.7875 29.5,21.7875 L24,21.787 L24,26 C24,29.2383969 21.4344251,31.8775718 18.2249383,31.9958615 L18,32 C14.6862915,32 12,29.3137085 12,26 L12,26 L12,10 C12,6.6862915 14.6862915,4 18,4 Z M18,6 C15.790861,6 14,7.790861 14,10 L14,10 L14,26 C14,28.209139 15.790861,30 18,30 C20.209139,30 22,28.209139 22,26 L22,26 L22,21.787 L18.5,21.7875 C17.9477153,21.7875 17.5,21.3397847 17.5,20.7875 C17.5,20.2352153 17.9477153,19.7875 18.5,19.7875 L22,19.787 L22,10 C22,7.85780461 20.3160315,6.10892112 18.1996403,6.00489531 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*h,'px;user-select: none;">远程开锁</div>\n            </div>'),u.onclick=function(){var e=i.decoderState.state,t=e.isEditing;e.play;var n=e.rejection;if(t||"onBell"==i.bellStatus||n)return!1;console.log("远程开锁"),i.switchFooter("remoteUnlock"),i.remoteUnlockEle=new We(i.jSPlugin,i.switchFooter,i.videoWidth)},u;case"mute":return u.title="静音",u.id=e,u.domString='<div style="width: '.concat(.66*h,'px;display: flex;flex-direction: column;align-items: center;">\n                <div id="').concat(this.jSPlugin.id,'-icon-mute" style="width: ').concat(.66*h,"px;height: ").concat(.66*h,"px;border-radius: 50%;border: 1px solid ").concat(l?"#cccccc":t.backgroundColor,";background: ").concat(l&&s?"#cccccc":"#ffffff",';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.4*h,'px" height="').concat(.4*h,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>icon/静音</title>\n                        <g id="icon/静音" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path id="icon-mute-path" d="M29.2988305,7.56559704 C29.8540627,8.1086468 29.8980234,8.97727504 29.4240597,9.57172938 L29.3223594,9.6867869 L22.585,16.574 L22.5859243,26.0592702 C22.5859243,26.9500521 21.8638029,27.6721735 20.973021,27.6721735 C20.6007147,27.6721735 20.2398727,27.5433734 19.9517149,27.3076254 L15.583,23.733 L10.4341733,28.9987008 C9.85492024,29.5909486 8.9052312,29.6014828 8.31298346,29.0222298 C7.75775121,28.47918 7.71379057,27.6105518 8.18775419,27.0160974 L8.28945454,26.9010399 L27.1776406,7.58912597 C27.7568937,6.99687823 28.7065827,6.98634397 29.2988305,7.56559704 Z M22.2503608,7.16816759 C22.4679282,7.45036017 22.5859243,7.79665625 22.5859243,8.15298221 L22.585,9.899 L10.778,21.971 L9.47580645,21.9713498 C7.69424274,21.9713498 6.25,20.5271071 6.25,18.7455434 L6.25,15.65293 C6.25,13.8713663 7.69424274,12.4271235 9.47580645,12.4271235 L12.787,12.427 L19.9882064,6.87564241 C20.6936617,6.33174431 21.7064627,6.46271229 22.2503608,7.16816759 Z" id="形状结合" fill="').concat(s?"#ffffff":l?"#cccccc":t.backgroundColor,'"></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*h,'px;user-select: none;">静音</div>\n            </div>'),u.onclick=function(){var e=i.decoderState.state,n=e.talk,a=e.sound;if(e.play,e.rejection)return!1;console.log("静音"),n?(console.log("结束对讲"),i.setDecoderState({talk:!1,mute:!0},t.backgroundColor),i.jSPlugin.Talk.stopTalk(),i.jSPlugin.openSound(),i.setDecoderState({sound:!0})):(console.log("开始对讲"),i.setDecoderState({talk:!0,mute:!1},t.backgroundColor),a&&(i.jSPlugin.closeSound(),i.setDecoderState({sound:!1})),i.jSPlugin.Talk.startTalk())},u;case"hangUp":return u.title="挂断",u.id=e,u.domString='<div style="width: '.concat(.66*h,'px;display: flex;flex-direction: column;align-items: center;">\n                <div style="width:').concat(.66*h,"px;height: ").concat(.66*h,"px;border-radius: 50%;background: ").concat(l?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n                    <svg width="').concat(.4*h,'px" height="').concat(.4*h,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                        <title>挂断</title>\n                        <g id="icon/挂断" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                            <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n                            <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n                        </g>\n                    </svg>\n                </div>\n                <div style="margin-top: ').concat(.1*h,'px;user-select: none;">挂断</div>\n            </div>'),u.onclick=function(){var e=i,t=i.decoderState.state,n=t.talk,a=t.play;if(t.rejection)return!1;n&&(console.log("结束对讲"),i.setDecoderState({talk:!1}),i.jSPlugin.Talk.stopTalk()),a&&(i.jSPlugin.stop(),i.setDecoderState({play:!a})),(a||n)&&(e.miniRecCloseClick(),console.log("挂断"),i.rejectionStatusDispose(),"function"==typeof i.jSPlugin.hangUpCallback&&i.jSPlugin.hangUpCallback("hangUp"))},u;default:return u}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var e=this.decoderState.state.play;console.log("应答超时"),e&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.miniRecCloseClick(),this.rejectionStatusDispose(),this.quickReplyEle&&this.quickReplyEle.closeQuickReplyEle(),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var e=this,t=this.themeData.footer,i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),a=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")),r=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(i.innerHTML="",a.innerHTML="",i.style.color="#2C2C2C"):(n.innerHTML="",n.style.color="#2C2C2C"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.renderFooter(t.iconId,t)})),r.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!0,type:2})}},{key:"userNoDevice",value:function(){var e=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var t=this.themeData.footer,i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),a=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn"));"onBell"==this.bellStatus?(i.innerHTML="",a.innerHTML="",i.style.color="#2C2C2C"):(n.innerHTML="",n.style.color="#2C2C2C"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.renderFooter(t.iconId,t)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!0,type:2})}},{key:"renderHeader",value:function(e,t){var i=this,n=this.matchBtn(e,t);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var a=document.createElement("span");a.innerHTML="".concat(n.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(a)}else{var r=document.createElement("div");r.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),r.style="max-width:50%;position:relative;",r.innerHTML='<span id="'.concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,'-content" style="display:inline-block;height:auto;";>\n            ').concat(n.domString,"\n          </span>"),r.onclick=function(e){if(i.decoderState.state.isEditing)return!1;n.onclick(e)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(r)}}},{key:"renderFooter",value:function(e,t){var i=this,n=this.decoderState.state.mute;if("remoteUnlock"==e&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var a=this.matchBtn(e,t),r=this.videoWidth/4,o=document.createElement("div");if(o.className="theme-icon-item","quickReply"!==a.id&&(o.style="width:".concat(.66*r,"px;padding:0 ").concat(.12*r,"px;box-sizing: content-box;-webkit-tap-highlight-color:transparent;")),o.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(a.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(a.id,'-content" title="').concat(a.title,'" style="display: flex;align-items: center;position:relative;">')).concat(a.domString,"</div>")+"</span>",o.onclick=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;a.onclick(e)},a.onmouseenter&&(o.onmouseenter=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;a.onmouseenter(e)}),a.onmouseleave&&(o.onmouseleave=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;a.onmouseleave(e)}),"quickReply"!=e){var s=document.createElement("span");s.className="icon-move left",s.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(a.id,'-left" title="左移" style="height: 40px;position: absolute;top: calc(50% - 33px);left: 1px;display: inline-block;border-radius: 2px;overflow: hidden;cursor: pointer;">\n          <svg width="10px" height="40px" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n              <title></title>\n              <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                  <g id="H5呼叫模板" transform="translate(-614.000000, -5024.000000)">\n                      <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n                          <g id="编组-9" transform="translate(23.000000, 522.000000)">\n                              <g id="编组" transform="translate(170.000000, 0.000000)">\n                                  <g id="箭头左" transform="translate(0.000000, 18.000000)">\n                                      <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n                                      <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(1.000000, 15.000000)" fill="#FFFFFF">\n                                          <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n                                      </g>\n                                  </g>\n                              </g>\n                          </g>\n                      </g>\n                  </g>\n              </g>\n          </svg>\n          </span>'),s.onclick=function(){i.editIcon(a.id,"left","footer")},o.appendChild(s);var l=document.createElement("span");l.className="icon-move right",l.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(a.id,'-right" class="ezuikit-theme-icon" title="右移" style="height: 40px;position: absolute;top: calc(50% - 33px);left: calc(100% - 11px);display: inline-block;border-radius: 2px;overflow: hidden;cursor: pointer;">\n          <svg width="10px" height="40px" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n              <title></title>\n              <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                  <g id="H5呼叫模板" transform="translate(-684.000000, -5024.000000)">\n                      <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n                          <g id="编组-9" transform="translate(23.000000, 522.000000)">\n                              <g id="编组" transform="translate(170.000000, 0.000000)">\n                                  <g id="箭头右" transform="translate(70.000000, 18.000000)">\n                                      <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n                                      <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(5.500000, 20.000000) scale(-1, 1) translate(-5.500000, -20.000000) translate(2.000000, 15.000000)" fill="#FFFFFF">\n                                          <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n                                      </g>\n                                  </g>\n                              </g>\n                          </g>\n                      </g>\n                  </g>\n              </g>\n          </svg>\n          </span>'),l.onclick=function(){i.editIcon(a.id,"right","footer")},o.appendChild(l)}if("answer"==e||"rejection"==e||"hangUp"==e);else{var c=document.createElement("span");c.className="icon-move close",c.innerHTML='<span id="'.concat(a.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: -6px;right: -2px;cursor: pointer;">\n            <svg width="16px" height="16px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n                <title></title>\n                <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n                    <g id="H5呼叫模板" transform="translate(-680.000000, -5006.000000)">\n                        <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n                            <g id="编组-9" transform="translate(23.000000, 522.000000)">\n                                <g id="编组" transform="translate(170.000000, 0.000000)">\n                                    <g id="关闭1" transform="translate(66.000000, 0.000000)">\n                                        <rect id="矩形" fill-rule="nonzero" x="0" y="0" width="18" height="18"></rect>\n                                        <path d="M9,1.125 C4.65117188,1.125 1.125,4.65117188 1.125,9 C1.125,13.3488281 4.65117188,16.875 9,16.875 C13.3488281,16.875 16.875,13.3488281 16.875,9 C16.875,4.65117188 13.3488281,1.125 9,1.125 Z M11.9074219,11.9917969 L10.7472656,11.9865234 L9,9.90351562 L7.25449219,11.9847656 L6.09257813,11.9900391 C6.01523438,11.9900391 5.95195313,11.9285156 5.95195313,11.8494141 C5.95195313,11.8160156 5.96425781,11.784375 5.98535156,11.7580078 L8.27226563,9.03339844 L5.98535156,6.31054687 C5.96425781,6.28417969 5.95195313,6.25253906 5.95195313,6.21914062 C5.95195313,6.14179687 6.01523438,6.07851562 6.09257813,6.07851562 L7.25449219,6.08378906 L9,8.16679687 L10.7455078,6.08554688 L11.9056641,6.08027344 C11.9830078,6.08027344 12.0462891,6.14179687 12.0462891,6.22089844 C12.0462891,6.25429687 12.0339844,6.2859375 12.0128906,6.31230469 L9.72949219,9.03515625 L12.0146484,11.7597656 C12.0357422,11.7861328 12.0480469,11.8177734 12.0480469,11.8511719 C12.0480469,11.9285156 11.9847656,11.9917969 11.9074219,11.9917969 Z" id="形状" fill="#595959"></path>\n                                    </g>\n                                </g>\n                            </g>\n                        </g>\n                    </g>\n                </g>\n            </svg>\n          </span>'),c.onclick=function(){i.editIcon(a.id,"delete","footer")},o.appendChild(c)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(o):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(o),"quickReply"===a.id&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).appendChild(o)),this.decoderState.state.isEditing&&"mute"==e&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||n?this.setDecoderState({mute:!1},t.backgroundColor):this.setDecoderState({mute:!0},t.backgroundColor))}},{key:"switchFooter",value:function(e){var t=this.themeData.footer;switch(e){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex"):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex");break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=t[this.bellStatus].color)}}},{key:"initThemeData",value:function(){var e=this;console.log("-------------initThemeData");var t=this.themeData,i=t.header,n=t.footer,a=this.decoderState.state.isEditing,r=this.videoWidth,o=r/375,s=1.8*r,c=this.jSPlugin.id;if(this.isNeedRenderHeader=k.findIndex(i[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=k.findIndex(n[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width:100%;overflow:hidden;justify-content: center;'></div>");else{var d=document.createElement("div");d.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),d.setAttribute("class","header-controls"),d.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:100%;overflow:hidden;justify-content: center;'></div>"),console.log(this.jSPlugin.height),this.jSPlugin.height;var u=l(l({display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":.1*s+"px","align-items":"center","text-align":"center","font-size":"24ox"},"color","#2c2c2c"),"margin-top","6px");d.style=Ye(u),document.getElementById("".concat(c,"-wrap")).insertBefore(d,document.getElementById(c));var h=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(h)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.jSPlugin.height,this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="".concat(.2*s,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n              <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*o,"px;margin-bottom: ").concat(40*o,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n              <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n              '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n              <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*o,"px;margin-bottom: ").concat(40*o,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n              <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n              <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n              '));else{var f=document.createElement("div");f.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),f.setAttribute("class","ez-iframe-footer-container");var x={position:"relative","margin-top":.2*s+"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"};f.style=Ye(x),f.innerHTML='\n            <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*o,"px;margin-bottom: ").concat(40*o,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n            <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n            <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n            <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n            <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n            '),g(f,document.getElementById(c))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&i[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.renderHeader(t.iconId,t)})),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=n[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n[this.bellStatus].color,n[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.renderFooter(t.iconId,t)}))),1!=this.themeData.customConfig.bellPoster||a)this.jSPlugin.setPoster("");else{this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var p=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(p),e.jSPlugin.setPoster(e.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),this.checkIsAppleDevice()||!1?window.addEventListener("touchstart",this.autoPlayRing):window.addEventListener("click",this.autoPlayRing));this.inited=!0,this.getCallDeviceInfo()}},{key:"checkIsAppleDevice",value:function(){var e=navigator.userAgent,t=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),i=e.indexOf("iPad")>-1,n=e.indexOf("iPhone")>-1||e.indexOf("Mac")>-1;return!!(t||i||n)}},{key:"renderThemeData",value:function(){var e=this,t=this.themeData,i=t.header,n=t.footer,a=this.decoderState.state.isEditing;if(this.isNeedRenderHeader&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(t,i){t.isrender&&e.setDecoderState(l({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&n)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=n[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=n[this.bellStatus].color.replace("-diy",""),n[this.bellStatus].btnList.map((function(t,i){if(t.isrender&&e.setDecoderState(l({},t.iconId,e.decoderState.state[t.iconId])),console.log("-------------activeThemeStatus"),0==i&&!e.themeInited&&e.activeThemeStatus)var n=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(n),1!=e.themeData.customConfig.bellPoster||a?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){e.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===P(this.jSPlugin.url).type,rec:"rec"===P(this.jSPlugin.url).type,type:P(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!a?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),e.jSPlugin.reSize(e.jSPlugin.params.width,e.jSPlugin.params.height))}),50);a||this.jSPlugin.isWebConsole?1==this.themeData.customConfig.miniWinRec?this.initMiniImageRec():this.miniRecCloseClick():setTimeout((function(){"onBell"==e.bellStatus&&e.jSPlugin.capacity&&1==e.jSPlugin.capacity.support_doorcall_playback&&(console.log("小窗口initMiniRec-------------设备能力集成功"),1==e.themeData.customConfig.miniWinRec&&(console.log("小窗口initMiniRec---------------画中画设置已开启"),(!e.deviceInfoData||e.deviceInfoData&&!e.deviceInfoData.isEncrypt)&&(console.log("小窗口initMiniRec---------------设备未加密"),e.miniRecNum=0,e.initMiniRec())))}),1e3)}},{key:"setThemeData",value:function(e,t){this.themeData=e,"onCall"==t&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(e,t,i){console.log("编辑组件",e,t,i);var n=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[i][this.bellStatus].btnList,r=k.findIndex(a,(function(t){return t.iconId===e})),o=a[r];switch(t){case"delete":a[r].isrender=0;break;case"right":for(var s=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){s=l;break}-1!==s&&(a[r]=a[s],a[s]=o);break;case"left":for(var c=-1,d=r-1;d>=0;d--)if(a[d].part===a[r].part&&1==a[d].isrender){c=d;break}-1!==c&&(a[r]=a[c],a[c]=o)}console.log("new btnList",a),n[i][this.bellStatus].btnList=a,this.jSPlugin.Theme.changeTheme(n)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var n=document.createElement("div");n.id=this.jSPlugin.id+"time-area",n.className="time-area",n.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(n)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var a=t;document.getElementById(i.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++a,document.getElementById(i.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),i=0,n=0,a="00",r="00",o="00";t>59&&(i=parseInt(t/60),t=parseInt(t%60),i>59&&(n=parseInt(i/60),i=parseInt(i%60)));return a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),o=parseInt(n)>9?parseInt(n):"0"+parseInt(n),n>0?o+":"+r+":"+a:i>0?r+":"+a:"00:"+a}(a)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(i.jSPlugin.id+"time-area")&&(document.getElementById(i.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(i.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){console.log("----------editStart1");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),t&&t.setAttribute("class","footer-controls themeEditing"),i&&i.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){console.log("----------editEnd1");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));i&&i.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),n&&n.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(e){var t=this;switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"miniRec":break;default:Ie(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data?(t.activeThemeStatus=!0,t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header[t.bellStatus].btnList=t.themeData.header[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer[t.bellStatus].btnList=t.themeData.footer[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)):(t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),t.setDecoderState({rejection:!0}),"111021"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff",type:1}),t.activeThemeStatusTxt="无效的模板id"):"111023"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff",type:1}),t.activeThemeStatusTxt="试用特权已到期"):(t.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff",type:1}),t.activeThemeStatusTxt="模板未激活"),t.themeData=Ge,t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}}},{key:"getCallDeviceInfo",value:function(){var e=this;this.videoWidth,De({accessToken:this.jSPlugin.accessToken,deviceSerial:P(this.jSPlugin.url).deviceSerial}).then((function(t){t.data&&(e.deviceInfoData=t.data,t.data.isEncrypt&&(console.log("小窗口miniRecCloseClick------------设备已加密"),e.miniRecCloseClick(),setTimeout((function(){e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),1e3)),document.getElementById("header-".concat(e.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(e.bellStatus,"-deviceCategory")).innerText=""+t.data.deviceName))})).catch((function(t){console.log("获取设备信息失败",t),20018!=t.code||e.jSPlugin.isWebConsole||e.userNoDevice()}))}},{key:"setHeaderText",value:function(e){console.log("setHeaderText");var t=this.videoWidth/375||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(24*t,'px;display: block">').concat(e,'</span><span style="font-size: ').concat(14*t,"px;padding-top: ").concat(5*t,'px;display: block;">').concat(this.deviceInfoData&&this.deviceInfoData.category||"","</span>"))}}]),e}(),Je=function(){function e(t){if(r(this,e),this.jSPlugin=t,this.videoWidth=t.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"===P(t.url).type,rec:"rec"===P(t.url).type,type:P(t.url).type}},console.log("matchEzopenUrl(jSPlugin.url)",P(t.url),this.decoderState.state),this.isMobile=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.themeData={},"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.jSPlugin.themeId)if(this.isMobile?this.call=new Xe(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState):this.call=new He(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 ue(this.jSPlugin)),p("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),p("".concat(this.jSPlugin.staticPath,"/css/theme.css"))}return s(e,[{key:"changeTheme",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"onBell";if("string"==typeof e)switch(this.jSPlugin.themeId=e,this.jSPlugin.themeId){case"pcLive":case"mobileCall":case"webCall":this.call.initThemeData(),this.call.renderThemeData();break;default:this.call.fetchThemeData(e)}else"object"===a(e)&&(this.themeData=e,this.call.setThemeData(e,i),this.call.initThemeData(),this.call.renderThemeData(),this.decoderState.state.isEditing&&t&&this.call.editStart());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(e)}},{key:"setDecoderState",value:function(e,t){var i=this,n=this.themeData;n.header,n.footer,Object.keys(e).map((function(n){if("mute"===n)document.getElementById("".concat(i.jSPlugin.id,"-icon-mute"))&&(console.log("mute"),e[n]?(document.getElementById("".concat(i.jSPlugin.id,"-icon-mute")).style.background=t,document.getElementById("".concat(i.jSPlugin.id,"-icon-mute")).style.border=" 1px solid ".concat(t),document.getElementById("icon-mute-path").style.fill="#ffffff"):(document.getElementById("".concat(i.jSPlugin.id,"-icon-mute")).style.background="#ffffff",document.getElementById("".concat(i.jSPlugin.id,"-icon-mute")).style.border="1px solid ".concat(t),document.getElementById("icon-mute-path").style.fill=t));i.decoderState.state=Object.assign(i.decoderState.state,e)}))}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"editIcon",value:function(e,t,i){console.log("编辑组件",e,t,i);var n=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[i].btnList,r=k.findIndex(a,(function(t){return t.iconId===e})),o=a[r];switch(t){case"delete":if("rec"===e){if(-1===k.findIndex(a,(function(e){return"cloudRec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===e&&-1===k.findIndex(a,(function(e){return"rec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1;a[r].isrender=0;break;case"right":for(var s=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){s=l;break}-1!==s&&(a[r]=a[s],a[s]=o);break;case"left":for(var c=-1,d=r-1;d>=0;d--)if(a[d].part===a[r].part&&1==a[d].isrender){c=d;break}-1!==c&&(a[r]=a[c],a[c]=o)}console.log("new btnList",a),n[i].btnList=a,this.changeTheme(n)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var n=document.createElement("div");n.id=this.jSPlugin.id+"time-area",n.className="time-area",n.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(n)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var a=t;document.getElementById(i.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++a,document.getElementById(i.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),i=0,n=0,a="00",r="00",o="00";t>59&&(i=parseInt(t/60),t=parseInt(t%60),i>59&&(n=parseInt(i/60),i=parseInt(i%60)));return a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),o=parseInt(n)>9?parseInt(n):"0"+parseInt(n),n>0?o+":"+r+":"+a:i>0?r+":"+a:"00:"+a}(a)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(i.jSPlugin.id+"time-area")&&(document.getElementById(i.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(i.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));n&&n.setAttribute("class","header-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),i&&i.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));i&&i.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})}},{key:"setDisabled",value:function(e){}},{key:"getDeviceInfo",value:function(){var e=this,t=this.videoWidth/1024||1;De({accessToken:this.jSPlugin.accessToken,deviceSerial:P(this.jSPlugin.url).deviceSerial}).then((function(i){200==i.code&&i.data&&document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.maxWidth="100%",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.overflow="hidden",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.textOverflow="ellipsis",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.whiteSpace="nowrap",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(32*t,'px;display: block">有人按门铃</span><span style="font-size: ').concat(24*t,"px;padding-top: ").concat(16*t,'px;display: block;">').concat(i.data.category,"</span>"))})).catch((function(e){console.log("获取设备信息失败",e)}))}}]),e}(),qe=function(){function e(t){r(this,e),this.jSPlugin=t;var i=window["EZUIKIT_TIMER_INTERVAL_".concat(t.id)];i&&Object.keys(i).length>0&&this.resetTimer(),window["EZUIKIT_TIMER_INTERVAL_".concat(t.id)]={}}return s(e,[{key:"createInterval",value:function(e,t,i){window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)][e]=setInterval(t,i)}},{key:"clearTimer",value:function(e){var t=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];t[e]&&(clearInterval(t[e]),delete t[e])}},{key:"resetTimer",value:function(){var e=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];for(var t in e)clearInterval(e[t]),delete e[t]}}]),e}(),Ke=s((function e(t){var i=this;r(this,e),l(this,"initMap",(function(){var e=i,t=i.videoWidth,n=i.videoHeight;if(document.getElementById("".concat(i.jSPlugin.id,"-miniRecbox")))document.getElementById("".concat(i.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-miniRecbox"))),i.initMap();else{var a=document.createElement("div");a.id="".concat(i.jSPlugin.id,"-miniRecbox"),a.style=";position: absolute; bottom:96px;right:".concat(i.jSPlugin.inspectVideoWidth,"px;"),a.innerHTML='<div  id="'.concat(i.jSPlugin.id,'-mapbox" style="\n        width: ').concat(.3333*t,"px;\n        height: ").concat(.3333*n,'px;\n      "></div>'),document.getElementById("".concat(i.jSPlugin.id,"-wrap")).insertBefore(a,document.getElementById("".concat(i.jSPlugin.id,"-ez-iframe-footer-container"))),e.map=e.loadMap("".concat(i.jSPlugin.id,"-mapbox"))}return e.map})),l(this,"loadMap",(function(e){var t=new BMapGL.Map(e);return t.centerAndZoom(new BMapGL.Point(116.297611,40.047363),15),t.enableScrollWheelZoom(!0),t})),l(this,"createCircle",(function(e,t,n,a){var r=new BMapGL.Point(e,t),o=new BMapGL.Marker(r,{title:a});if(i.map.addOverlay(o),0!=n){var s=new BMapGL.Circle(new BMapGL.Point(e,t),n,{strokeColor:"#ff4d4f",strokeWeight:4,strokeOpacity:1,strokeStyle:"dashed",fillOpacity:0});i.map.addOverlay(s)}})),l(this,"createInspectPoints",(function(e){e.map((function(e){i.createCircle(e.longitude,e.latitude,e.radius,e.inspectPointName)}))})),l(this,"createPolygon",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#407AFF",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"solid",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"407AFF",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=[];e.split(";").map((function(e){var t=e.split(",");l.push(new BMapGL.Point(t[0],t[1]))})),i.inspectRange=new BMapGL.Polygon(l,{strokeColor:t,strokeWeight:a,strokeOpacity:r,strokeStyle:n,fillOpacity:s,fillColor:o}),i.map.addOverlay(i.inspectRange)})),l(this,"createTrack",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#18C796",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"solid",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:500,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,u=arguments.length>10&&void 0!==arguments[10]&&arguments[10],h=[];if(e.map((function(e){var t=!1;i.currentTrack.length>0&&i.currentTrack.map((function(i){i.longitude===e.longitude&&i.latitude===e.latitude&&i.reportTime===e.reportTime&&(t=!0)})),t||(0==h.length&&i.currentTrack.length>0&&h.push(new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude)),h.push(new BMapGL.Point(e.longitude,e.latitude)))})),0!=h.length){var f=new BMapGL.Polyline(h,{strokeColor:n,strokeWeight:r,strokeOpacity:o,strokeStyle:a,fillOpacity:s});if(t?(i.map.addOverlay(f),i.map.centerAndZoom(h[h.length-1],15)):(i.trackAni=new BMapGLLib.TrackAnimation(i.map,f,{overallView:u,tilt:l,duration:c,delay:d}),i.trackAni.start()),i.currentTrack=e,i.currentTrack.length>0&&i.currentTrack.length>0){var x=new BMapGL.Point(i.currentTrack[0].longitude,i.currentTrack[0].latitude);if(i.startPoint=new BMapGL.Marker(x,{icon:new BMapGL.Icon("".concat(i.jSPlugin.staticPath,"/imgs/start.png"),new BMapGL.Size(32,47)),offset:new BMapGL.Size(0,-17)}),i.map.addOverlay(i.startPoint),1==i.currentTrack.length)return;var p=new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude);i.endPoint&&i.map.removeOverlay(i.endPoint),setTimeout((function(){i.endPoint=new BMapGL.Marker(p,{icon:new BMapGL.Icon("".concat(i.jSPlugin.staticPath,"/imgs/end.png"),new BMapGL.Size(30,30))}),i.map.addOverlay(i.endPoint)}),t?0:c)}}})),l(this,"centerToTrack",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;i.currentTrack.length>0&&(1==i.currentTrack.length?i.map.centerAndZoom(new BMapGL.Point(i.currentTrack[0].longitude,i.currentTrack[0].latitude),e):i.map.centerAndZoom(new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude),e))})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.toastCustom=new Me(t,!1),this.currentTrack=[],this.startPoint=null,this.endPoint=null,this.trackAni=null,this.inspectRange=null,this.map=this.initMap()})),$e=s((function e(t){var i=this;r(this,e),l(this,"init",(function(){var e=i;if(i.videoWidth,i.videoHeight,document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")))document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box"))&&document.getElementById("".concat(i.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box"))),e.init();else{var t=document.createElement("div");t.id="".concat(i.jSPlugin.id,"-inspect-global-box"),t.style=";position: absolute; left:0; top: 0; width: 100%; height: 100%; z-index: 10000; background: #fff;",t.innerHTML='<div id="'.concat(i.jSPlugin.id,'-inspect-loading-box" style="\n        overflow: auto;\n        box-sizing: border-box;\n        font-size: 14px;\n        color: #595959;\n        line-height: 24px;\n        font-weight: bold;\n        width: 100%;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        height: 100%;\n      ">\n      <div>\n      <div style="text-align:center;"><div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div></div>\n      <div style="color: #595959; font-size:14px; font-weight: 400; text-align: center;">加载中…</div>\n      </div></div>\n      '),document.getElementById("".concat(i.jSPlugin.id,"-wrap")).appendChild(t)}})),l(this,"deviceErrorInfo",(function(e,t){var n=Object.assign({tips:"",refreshBtn:"",refreshShow:!1},e);if(document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box")))document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box"))&&document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box"))),i.deviceErrorInfo(e,t);else{i.videoHeight;var a=document.createElement("div");a.id="".concat(i.jSPlugin.id,"-no-inspect-box"),a.style="width:100%;height:100%; background: #ffffff; display: flex; justify-content: center; align-items: center",a.innerHTML='<div style="\n        overflow: auto;\n        box-sizing: border-box;\n        font-size: 14px;\n        color: #595959;\n        text-align: center;\n      ">\n      <div style="text-align:center; height: 21px;">\n      <svg t="1689074472491" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7172" xmlns:xlink="http://www.w3.org/1999/xlink" width="21" height="21"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z" fill="#FF4D4F" p-id="7173"></path></svg>\n      </div>\n      <div style="color: #595959; font-size:14px; margin: 5px 0 16px;font-weight: 400; text-align: center;">'.concat(n.tips,'</div>\n      <button id="').concat(i.jSPlugin.id,'-inspect-device-status-refresh" style="display: ').concat(n.refreshShow?"block":"none",';  width: 80px; margin: 0 auto;" type="button" class="ezuikit-btn ezuikit-btn-primary"><span>').concat(n.refreshBtn,"</span></button>\n      </div>\n      "),document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")).appendChild(a),document.getElementById("".concat(i.jSPlugin.id,"-inspect-device-status-refresh")).addEventListener("click",(function(){t&&t()}))}})),l(this,"globalContainerToggle",(function(e,t){document.getElementById(e)&&(document.getElementById(e).style.display=t?"flex":"none")})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.toastCustom=new Me(t,!1),this.init()})),Qe=function(){function e(i){r(this,e),this.timer=null;var n={wrapNode:document.body,time:2e3,content:"",type:"info",center:!1,top:8};this.params=t(t({},n),i),this.init()}return s(e,[{key:"init",value:function(){var e=this;this.timer=null;var t=this.params,i=t.wrapNode,n=t.content,a=t.time,r=t.type,o=t.center,s=t.top;this.wrapNode=i;var l=document.createElement("div");l.setAttribute("class","ezuikit-message"),o?l.setAttribute("style","top: 50%; transform: translateY(-50%);"):l.setAttribute("style","top: ".concat(s||0,"px;")),this.wrapNode.appendChild(l),this.initMessageContent(r,n,l),0!==a&&(this.timer=setTimeout((function(){e.wrapNode.removeChild(l)}),a||2e3))}},{key:"initMessageContent",value:function(e,t,i){var n=document.createElement("div");n.setAttribute("class","ezuikit-message-notice"),n.innerHTML='\n\t\t\t<div class="ezuikit-message-notice-content">\n\t\t\t\t<div class="ezuikit-message-custom-content ezuikit-message-'.concat(e,'">\n\t\t\t\t\t<span role="img" aria-label="check-circle" class="ezdicon ezdicon-check-circle">\n\t\t\t\t\t\t').concat("warning"===e?'<svg fill="currentColor" t="1691567271942" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z"></path></svg>':"","\n\t\t\t\t\t\t").concat("info"===e?'<svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>':"","\n\t\t\t\t\t\t").concat("error"===e?'<svg fill="currentColor" t="1691567308585" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m165.376 618.24l-65.92-0.32L512 563.392l-99.328 118.4-66.048 0.32a7.936 7.936 0 0 1-8-8c0-1.92 0.64-3.712 1.92-5.184L470.528 513.92 340.48 359.04a8 8 0 0 1 6.08-13.184l66.112 0.256L512 464.576l99.328-118.4 65.92-0.256c4.48 0 8.064 3.456 8.064 8a8.32 8.32 0 0 1-1.92 5.12l-129.92 154.944 130.048 155.008a8 8 0 0 1-6.08 13.184z"></path></svg>':"","\n\t\t\t\t\t\t").concat("success"===e?'<svg fill="currentColor" viewBox="64 64 896 896" focusable="false" data-icon="check-circle" width="1em" height="1em" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"></path></svg>':"","\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>").concat(t,"</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t"),i.appendChild(n)}}]),e}(),et=function(){function e(i){r(this,e);this.params=t(t({},{id:"",width:"100%",height:"100%",preview:!0,showIcon:!0,src:"",alt:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png"}),i),this.id=Math.random().toString(36).substr(2),this.init()}return s(e,[{key:"init",value:function(){var e=this.params,t=e.id,i=e.width,n=e.height,a=e.preview;if(document.getElementById(t)){var r=document.createElement("div");r.setAttribute("class","ezuikit-image"),r.setAttribute("style","width:".concat(i,";height:").concat(n,";")),document.getElementById(t).appendChild(r),this.initImage(r),a&&this.initPreview(r)}}},{key:"previewImg",value:function(){var e=this.params,t=e.src,i=e.alt,n=e.fallback,a=document.createElement("div");a.setAttribute("id",this.id+"-preview"),a.setAttribute("class","ezuikit-image-preview"),a.innerHTML='\n\t\t\t<div class="ezuikit-image-preview-mask"></div>\n\t\t\t<div class="ezuikit-image-preview-img-wrapper">\n\t\t\t\t<div class="ezuikit-image-preview-operations" id="'.concat(this.id,'-ezuikit-image-preview-operations">\n\t\t\t\t\t<div class="ezuikit-image-preview-operations-operation">\n\t\t\t\t\t\t<span role="img" aria-label="close" class="anticon anticon-close ezuikit-image-preview-operations-icon">\n\t\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ezuikit-image-preview-wrap">\n\t\t\t\t\t<div class="ezuikit-image-preview-img-main"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t');var r=document.createElement("img");r.setAttribute("class","ezuikit-image-preview-img"),r.setAttribute("alt",i),r.setAttribute("src",t),r.addEventListener("error",(function(){r.setAttribute("src",n)})),document.body.appendChild(a),a.querySelector(".ezuikit-image-preview-img-main").appendChild(r),document.getElementById(this.id+"-ezuikit-image-preview-operations").addEventListener("click",(function(){document.body.removeChild(a)}))}},{key:"initImage",value:function(e){var t=this.params,i=t.src,n=t.alt,a=t.fallback,r=document.createElement("img");r.setAttribute("class","ezuikit-image-img"),r.setAttribute("alt",n),r.setAttribute("src",i),r.addEventListener("error",(function(){r.setAttribute("src",a)})),e.appendChild(r)}},{key:"initPreview",value:function(e){var t=this,i=this.params.showIcon,n=document.createElement("div");n.setAttribute("class","ezuikit-image-mask"),i&&(n.innerHTML='\n\t\t\t\t<div class="ezuikit-image-mask-info">\n\t\t\t\t\t<span class="ezuikit-image-anticon-eye">\n\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="eye" width="1em" height="1em"  aria-hidden="true"><path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"></path></svg>\n\t\t\t\t\t\t预览\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t'),e.appendChild(n),e.onclick=function(){t.previewImg()}}}]),e}(),tt=function(){function e(i){r(this,e);this.params=t(t({},{id:"",parentNodeId:"",title:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),i),this.initState=!1,this.init(i)}return s(e,[{key:"init",value:function(){var e=this,t=this.params,i=t.id,n=t.content,a=t.placement,r=t.title,o=document.getElementById(i);if(o){var s=document.createElement("div");if(s.setAttribute("id",i+"-popover"),s.setAttribute("class","ezuikit-popover"),s.setAttribute("style","display:none;"),s.innerHTML='\n\t\t\t\t\t<div class="ezuikit-popover-arrow">\n\t\t\t\t\t\t<span class="ezuikit-popover-arrow-content"></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ezuikit-popover-inner">\n\t\t\t\t\t\t'.concat(r?'<div class="ezuikit-popover-title">'.concat(r,"</div>"):"",'\n\t\t\t\t\t\t<div class="ezuikit-popover-inner-content">').concat(n,"</div>\n\t\t\t\t\t</div>\n\t\t\t\t"),!document.getElementById(i+"-popover")){var l=document.body;this.params.parentNodeId&&(l=document.getElementById(this.params.parentNodeId)),l.appendChild(s),this.renderPopover(s,o,a)}document.body.addEventListener("click",(function(t){e.addEventListenerFn(t)}))}}},{key:"addEventListenerFn",value:function(e){var t=this.params.id,i=document.getElementById(t),n=document.getElementById(t+"-popover");i&&e.target!==i&&!i.contains(e.target)&&n&&e.target!==n&&!n.contains(e.target)&&this.hidePopover()}},{key:"hidePopover",value:function(){var e=this.params.id,t=document.getElementById(e+"-popover");t&&document.body.removeChild(t)}},{key:"renderPopover",value:function(e,t,i,n,a){e.style.display="block";var r=t.getBoundingClientRect(),o=r.top,s=r.left,l=r.width,c=r.height,d=e.getBoundingClientRect(),u=d.width,h=d.height;n&&(u=n),a&&(h=a);var f=document.body;this.params.parentNodeId&&(f=document.getElementById(this.params.parentNodeId));var x=this.params.arrowPointAtCenter,p=0,m=0,_=e.getElementsByClassName("ezuikit-popover-arrow")[0],g=_.getBoundingClientRect(),v=g.width,y=g.height;if(x){var S=0,b=0;switch(i){case"top":default:S=u/2,b=h;break;case"bottom":S=u/2,b=0;break;case"left":S=u,b=h/2;break;case"right":S=0,b=h/2;break;case"topLeft":S=(l-v)/2,b=h;break;case"topRight":S=u-(l+v)/2,b=h;break;case"bottomLeft":S=(l-v)/2,b=0;break;case"bottomRight":S=u-(l+v)/2,b=0;break;case"leftTop":S=u,b=(c-y)/2;break;case"leftBottom":S=u,b=h-(c+y)/2;break;case"rightTop":S=0,b=(c-10)/2;break;case"rightBottom":S=0,b=h-(c+y)/2}_.style.left=S+"px",_.style.top=b+"px"}switch(i){case"top":p=-(h+y),m=(l-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top");break;case"bottom":p=c-y/2,m=(l-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottom");break;case"left":p=(c-h)/2,m=-(u+v/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-left");break;case"right":p=(c-h)/2,m=l-v/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-right");break;case"topLeft":p=-(h+y),m=0,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topLeft");break;case"topRight":p=-(h+y),m=l-u,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topRight");break;case"bottomLeft":p=c-y/2,m=0,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomLeft");break;case"bottomRight":p=c-y/2,m=l-u,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomRight");break;case"leftTop":p=0,m=-(u+v/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftTop");break;case"leftBottom":p=c-h,m=-(u+v/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftBottom");break;case"rightTop":p=0,m=l-v/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightTop");break;case"rightBottom":p=c-h,m=l-v/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightBottom");break;default:p=-h,m=(l-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top")}var P=document.documentElement.scrollTop||document.body.scrollTop,E=document.documentElement.scrollLeft||document.body.scrollLeft;e.style.top=o+P+p+"px",e.style.left=s+E+m+"px";var C=e.getBoundingClientRect(),T=f===document.body?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:f.getBoundingClientRect(),R=i;C.left<T.left&&(R=(R=R.replace("Right","Left")).replace("right","left")),C.right>T.right&&(R=(R=R.replace("Left","Right")).replace("left","right")),C.top<T.top&&(R=(R=R.replace("Top","Bottom")).replace("top","bottom")),C.bottom>T.bottom&&(R=(R=R.replace("Bottom","Top")).replace("bottom","top")),R!==i&&this.renderPopover(e,t,R,u,h)}}]),e}(),it=function(){function e(i){r(this,e);this.params=t(t({},{id:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),i),this.PopconfirmDom=null,this.init(i)}return s(e,[{key:"init",value:function(){var e=this,i=this.params,n=i.content,a=i.cancelText,r=i.okText,o=i.onCancel,s=i.onConfirm,l=document.createElement("div");l.innerHTML='\n      <div class="ezuikit-confirm">\n        <div class="ezuikit-confirm-content">\n\t\t\t\t\t<span class="ezuikit-confirm-icon">\n          \t<svg fill="currentColor" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z"></path></svg>\n          </span>\n\t\t\t\t\t<span class="ezuikit-confirm-content-label">'.concat(n,'</span>\n        </div>\n        <div class="ezuikit-popover-buttons"></div>\n      </div>\n      ');var c=document.createElement("button");c.className="ezuikit-btn ezuikit-cancel-btn",c.innerText=a;var d=document.createElement("button");return d.className="ezuikit-btn ezuikit-ok-btn ezuikit-btn-primary",d.innerText=r,l.querySelector(".ezuikit-popover-buttons").appendChild(c),l.querySelector(".ezuikit-popover-buttons").appendChild(d),this.PopconfirmDom=new tt(t(t({},this.params),{},{content:l.innerHTML})),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn").onclick=function(){o?o():e.hide()}),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn").onclick=function(){s?s():e.hide()}),this.PopconfirmDom}},{key:"hide",value:function(){this.PopconfirmDom.hidePopover()}}]),e}(),nt=function(){function e(i){r(this,e);this.params=t(t({},{id:"",width:"100%",height:"100%",preview:!0,poster:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png",src:""}),i),this.id=Math.random().toString(36).substr(2),this.init()}return s(e,[{key:"init",value:function(){var e=this.params,t=e.id,i=e.width,n=e.height,a=e.preview;if(document.getElementById(t)){var r=document.createElement("div");r.setAttribute("class","ezuikit-video"),r.setAttribute("style","width:".concat(i,";height:").concat(n,";")),document.getElementById(t).appendChild(r),this.initVideo(r),a&&this.initPreview(r)}}},{key:"previewVideo",value:function(){var e=this.params.src,t=document.createElement("div");t.setAttribute("id",this.id+"-preview"),t.setAttribute("class","ezuikit-image-video"),t.innerHTML='\n\t\t\t<div class="ezuikit-video-preview-mask"></div>\n\t\t\t<div class="ezuikit-video-preview-img-wrapper">\n\t\t\t\t<div class="ezuikit-video-preview-operations" id="'.concat(this.id,'-ezuikit-video-preview-operations">\n\t\t\t\t\t<div class="ezuikit-video-preview-operations-operation">\n\t\t\t\t\t\t<span role="img" aria-label="close" class="anticon anticon-close ezuikit-video-preview-operations-icon">\n\t\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ezuikit-video-preview-wrap">\n\t\t\t\t\t<div class="ezuikit-video-preview-img-wrapper">\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclass="ezuikit-video-preview-img custom-controls"\n\t\t\t\t\t\t\tsrc="').concat(e,'"\n\t\t\t\t\t\t\tautoplay \n\t\t\t\t\t\t\tcontrols \n\t\t\t\t\t\t\tcontrolslist="nodownload noremoteplayback noplaybackrate"\n\t\t\t\t\t\t\tdisablePictureInPicture\n\t\t\t\t\t\t\tdisableRemotePlayback\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t'),document.body.appendChild(t),document.getElementById(this.id+"-ezuikit-video-preview-operations").addEventListener("click",(function(){document.body.removeChild(t)}))}},{key:"initVideo",value:function(e){var t=this.params,i=t.poster,n=t.fallback,a=document.createElement("img");a.setAttribute("class","ezuikit-video-img"),a.setAttribute("src",i),a.addEventListener("error",(function(){a.setAttribute("src",n)})),e.appendChild(a)}},{key:"initPreview",value:function(e){var t=this,i=document.createElement("div");i.setAttribute("class","ezuikit-video-mask"),i.innerHTML='\n\t\t\t<div class="ezuikit-video-mask-info">\n\t\t\t\t<span class="ezuikit-video-anticon-eye">\n\t\t\t\t\t<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 28 28" style="enable-background:new 0 0 28 28;" xml:space="preserve">\n\t\t\t\t\t<circle cx="14" cy="14" r="14" style="opacity:0.7;fill-rule:evenodd;clip-rule:evenodd;enable-background:new;"/>\n\t\t\t\t\t<path style="fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;" d="M18.3,15.2l-5.3,3.3c-0.7,0.4-1.6,0.2-2.1-0.5c-0.1-0.2-0.2-0.5-0.2-0.8v-6.6\n\t\t\t\t\t\tc0-0.8,0.7-1.5,1.5-1.5c0.3,0,0.6,0.1,0.8,0.2l5.3,3.3c0.7,0.4,0.9,1.4,0.5,2.1C18.6,14.9,18.4,15,18.3,15.2z"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t',e.appendChild(i),e.onclick=function(){t.previewVideo()}}}]),e}(),at=function(e,t,i,n){var a={accessToken:e.accessToken,inspectRecordId:t,page:0},r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/device/trace");Ee(r,"GET",a,(function(e){i&&i(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},rt=function(e,t,i,n){var a={accessToken:e.accessToken,deviceSerial:P(e.url).deviceSerial,validateCode:P(e.url).validCode,channelNo:P(e.url).channelNo,evidenceFileType:t},r="".concat(e.env.domain,"/api/service/devicekit/common/file/evidence");Ee(r,"POST",a,(function(e){i&&i(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},ot=function(e,t,i,n){var a={accessToken:e.accessToken,taskId:t},r="".concat(e.env.domain,"/api/service/devicekit/opencloud/task/info");Ee(r,"GET",a,(function(e){i&&i(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})};var st=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};r(this,e),this.jSPlugin=t,this.currentEventInfo=i,this.inspectInfo=t.Theme.inspect.inspectInfo,this.type=a,this.timer=n,this.startTime=1e3,this.videoRecordingStatus=!0,this.saveSuccessCallback=o,this.init()}return s(e,[{key:"init",value:function(){this.renderEventDetail(),this.eventDetailDomEvent()}},{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap show")}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).innerHTML=""}},{key:"validationEventTag",value:function(){return 0==document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).value.length?(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="block",document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).innerHTML="请输入事件标签",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input input-has-error"),!1):(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input"),!0)}},{key:"renderVideo",value:function(e,t,i){var n=this;if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML="",1===e||2===e){if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n      <div class="video-stroage-exceptional-status-tips-wrap" style="background:url('.concat(this.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n        <div class="video-stroage-exceptional-status-icon">\n        <div type="default" class="ezuikit-spin ezuikit-spin-sm ezuikit-spin-spinning ezuikit-spin-dot-white"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n        </div>\n        <span class="video-stroage-exceptional-status-tips">视频正在存储中…</span>\n      </div>\n     '),1!==this.type){var a=this.currentEventInfo.evidenceId;this.timer.clearTimer("videoRecordingStatusTimer"),this.timer.createInterval("videoRecordingStatusTimer",(function(){ot(n.jSPlugin,a,(function(e){if(e.meta&&200===e.meta.code){var t=e.data,i=t.taskStatus,a=t.fileUrl,r=t.videoCoverPic||"".concat(n.jSPlugin.staticPath,"/imgs/bg.svg");n.renderVideo(i,r,a)}}))}),1e3)}}else 4===e||5===e||6===e||7===e?(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n        <div class="video-stroage-exceptional-status-tips-wrap video-stroage-exceptional-status-tips-error" style="background:url('.concat(this.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n          <div class="video-stroage-exceptional-status-icon">\n            <svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>\n          </div>\n          <span class="video-stroage-exceptional-status-tips">视频存储失败</span>\n        </div>\n       '),this.timer.clearTimer("videoRecordingStatusTimer")):0!==e&&3!==e||(new nt({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview"),poster:t,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),src:i}),this.timer.clearTimer("videoRecordingStatusTimer"))}},{key:"renderEventDetail",value:function(){var e=this,t=this.currentEventInfo,i=t.evidenceFileType,n=t.fileUrl,a=t.taskStatus,r=t.videoCoverPic,o=document.createElement("div");o.setAttribute("class","inspectEventDetail");var s="";if(s=1===i?r||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"):n||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),o.innerHTML='\n      <div class="inspectEventDetail-header">\n        <div class="inspectEventDetail-back" id="'.concat(this.jSPlugin.id,'-inspectEventDetail-back">\n          <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M605.888 137.344a6.4 6.4 0 0 1 1.472 4.032l0.64 70.784a6.4 6.4 0 0 1-2.368 5.056L281.6 480H876.8v64H279.744l325.376 264a6.4 6.4 0 0 1 2.368 4.928l0.128 69.632a6.4 6.4 0 0 1-10.432 4.992l-422.016-342.4a42.24 42.24 0 0 1-7.04-57.344l3.264-3.904 3.776-3.456 421.76-344a6.4 6.4 0 0 1 8.96 0.896z"></path></svg>\n        </div>\n        <div class="inspectEventDetail-type">').concat(1===this.type?"编辑":"").concat(0===i?"图片存证":"视频存证",'</div>\n      </div>\n      <div class="inspectEventDetail-content" style="\n        height: ').concat(document.getElementById("".concat(this.jSPlugin.id,"-wrap")).clientHeight-58-158,'px;\n        overflow: auto;\n      ">\n        ').concat(0===i?'<div class="inspectEventDetail-content-img-box">\n            <p class="inspectEventDetail-content-img-tips" style="display: '.concat(1==this.type?"none":"blcok",';">图片已取证,请填写存证信息:</p>\n            <div class="inspectEventDetail-content-img-detail" id="').concat(this.jSPlugin.id,'-inspectEventDetail-picUrl"></div>\n          </div>'):'<div class="inspectEventDetail-content-video-box">\n            <div\n              id="'.concat(this.jSPlugin.id,'-inspectEventDetail-content-video-timer"\n              class="inspectEventDetail-content-video-timer"\n              style="display: ').concat(1==this.type?"none":"flex",';"\n            >\n              <div class="video-recording-time-wrap">\n                <svg fill="currentColor" width="10" height="10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 10" style="enable-background:new 0 0 10 10;" xml:space="preserve"><circle class="st0" cx="5" cy="5" r="3"/><path class="st1" d="M5,10c-2.8,0-5-2.2-5-5c0-2.8,2.2-5,5-5s5,2.2,5,5C10,7.8,7.8,10,5,10z M5,0.5c-2.5,0-4.5,2-4.5,4.5c0,2.5,2,4.5,4.5,4.5s4.5-2,4.5-4.5C9.5,2.5,7.5,0.5,5,0.5z"/></svg>\n                <div id="').concat(this.jSPlugin.id,'-video-recording-time" class="video-recording-time">00:00:00</div>\n              </div>\n              <button id="').concat(this.jSPlugin.id,'-video-recording-stop-btn" class="inspectEventDetail-stop-btn ezuikit-btn">\n              <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n              停止录制\n              </button>\n            </div>\n            <div id="').concat(this.jSPlugin.id,'-inspectEventDetail-content-video-info" class="inspectEventDetail-content-video-info" style="display: ').concat(1==this.type?"block":"none",';">\n              <p class="inspectEventDetail-content-video-tips" style="display: ').concat(1==this.type?"none":"blcok",';">视频已取证:</p>\n              <div class="inspectEventDetail-content-video-detail" id="').concat(this.jSPlugin.id,'-inspectEventDetail-videoPreview"></div>\n            </div>\n          </div>'),'\n        <div class="inspectEventDetail-content-info">\n          <div class="inspectEventDetail-content-info-item">\n            <div class="inspectEventDetail-content-info-item-title">事件时间:</div>\n            <div id="').concat(this.jSPlugin.id,'-inspectEventDetail-content-info-time" class="inspectEventDetail-content-info-item-value"></div>\n          </div>\n          <div class="inspectEventDetail-content-info-item">\n            <div class="inspectEventDetail-content-info-item-title">存证人员:</div>\n            <div class="inspectEventDetail-content-info-item-value">\n              ').concat(1===this.type?this.currentEventInfo.depositaryOfficer?"null"===this.currentEventInfo.depositaryOfficer?"-":this.currentEventInfo.depositaryOfficer:"-":this.inspectInfo.inspectPerson?"null"===this.inspectInfo.inspectPerson?"-":this.inspectInfo.inspectPerson:"-",'\n            </div>\n          </div>\n          <div class="inspectEventDetail-content-info-item">\n            <div class="inspectEventDetail-content-info-item-title inspectEventDetail-content-info-item-title-required">事件标签:</div>\n            <div class="ezuikit-form-item-control-input">\n              <div class="ezuikit-form-item-control-input-content">\n                <input\n                  id="').concat(this.jSPlugin.id,'-event-tag"\n                  maxlength="32"\n                  type="text"\n                  autocomplete="off"\n                  id="control-ref_note"\n                  class="ezuikit-input"\n                  placeholder="请输入事件标签"\n                  value="').concat(1===this.type&&this.currentEventInfo.eventType||"",'"\n                />\n              </div>\n              <div class="ezuikit-form-item-explain ezuikit-form-item-explain-connected">\n                <div id="').concat(this.jSPlugin.id,'-event-tag-error" class="ezuikit-form-item-explain-error" style="display: none">请输入事件标签</div>\n              </div>\n            </div>\n          </div>\n          <div class="inspectEventDetail-content-info-item">\n            <div class="inspectEventDetail-content-info-item-title">事件备注:</div>\n            <div class="ezuikit-input-textarea ezuikit-input-textarea-show-count" data-count="').concat(1===this.type&&this.currentEventInfo.eventRemark?this.currentEventInfo.eventRemark.length:0,' / 100">\n              <textarea\n              id="').concat(this.jSPlugin.id,'-event-remark"\n              maxlength="100"\n              class="ezuikit-input"\n              maxlength="100"\n              placeholder="请输入事件备注"\n              autocomplete="off"\n              >').concat(1===this.type&&this.currentEventInfo.eventRemark||"",'</textarea>\n            </div>\n          </div>\n        </div>\n      </div>\n      <div class="inspectEventDetail-footer">\n        <button id="').concat(this.jSPlugin.id,'-event-cancel" class="inspectEventDetail-footer-btn ezuikit-btn">取消</button>\n        <button id="').concat(this.jSPlugin.id,'-event-ok" class="inspectEventDetail-footer-btn ezuikit-btn ezuikit-btn-primary">保存</button>\n      </div>\n    '),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).appendChild(o),1===this.type?document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(1===i?this.currentEventInfo.eventBeginTime+" ~ "+this.currentEventInfo.eventEndTime:this.currentEventInfo.eventTime):(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat((new Date).Format("yyyy-MM-dd hh:mm:ss")).concat(1===i?" ~ -":""),1===i&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-time"))&&this.videoRecordingStatus&&(0===this.type&&document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).setAttribute("disabled","disabled"),this.timer.createInterval("videoRecordingTimer",(function(){var t,i,n,a;e.startTime&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-time")).innerHTML=(t=e.startTime,i=parseInt(t%864e5/36e5),n=parseInt(t%36e5/6e4),a=parseInt(t%6e4/1e3),(i<10?"0".concat(i):i)+":"+(n<10?"0".concat(n):n)+":"+(a<10?"0".concat(a):a))),e.startTime+=1e3,e.startTime>e.jSPlugin.inspectRecordingDuration&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click(),e.timer&&e.timer.clearTimer("videoRecordingTimer"))}),1e3))),1===i){var l=this.currentEventInfo&&this.currentEventInfo.fileUrl;this.renderVideo(a,s,l)}else new et({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-picUrl"),src:s,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/fallback.svg"),showIcon:!1});this.show()}},{key:"eventDetailDomEvent",value:function(){var e=this,t=this.currentEventInfo,i=t.evidenceFileType,n=t.evidenceId;document.getElementById("".concat(this.jSPlugin.id,"-event-cancel")).addEventListener("click",(function(t){e.cancelPopover=new it({id:"".concat(e.jSPlugin.id,"-event-cancel"),content:"确定要取消吗?".concat(1===e.type?"取消后编辑的内容将不会保存。":"取消后对应存证也将删除。"),placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){e.cancelPopover.hide()},onConfirm:function(){1===i&&(e.videoRecordingStatus&&0===e.type&&(e.timer&&e.timer.clearTimer("videoRecordingTimer"),e.startTime=1e3,document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click()),e.timer.clearTimer("videoRecordingStatusTimer")),e.cancelPopover.hide(),e.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).addEventListener("click",(function(){if(e.validationEventTag()){var t=e.currentEventInfo,i=t.evidenceFileType,n=t.evidenceId,a=e.inspectInfo,r=a.inspectRecordId,o=a.inspectPerson,s=document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML,l={inspectRecordId:r,depositaryOfficer:o,evidenceFileId:n,evidenceFileType:i,eventType:document.getElementById("".concat(e.jSPlugin.id,"-event-tag")).value,eventRemark:document.getElementById("".concat(e.jSPlugin.id,"-event-remark")).value};1===i&&(l.eventBeginTime=s.split("~")[0].trim(),l.eventEndTime=s.split("~")[1].trim(),e.timer.clearTimer("videoRecordingStatusTimer")),0===i&&(l.eventTime=s),1===e.type&&(l.inspectEventId=e.currentEventInfo.inspectEventId,delete l.depositaryOfficer,delete l.eventTime,delete l.eventBeginTime,delete l.eventEndTime,delete l.evidenceFileId,delete l.evidenceFileType,function(e,t,i,n){var a={accessToken:e.accessToken,inspectRecordId:"",inspectEventId:"",eventType:"",eventRemark:""},r=Object.assign(a,t),o="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/update");Ee(o,"POST",r,(function(e){i&&i(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,l,(function(t){t.meta&&200===t.meta.code?(e.hide(),e.saveSuccessCallback&&e.saveSuccessCallback({eventType:l.eventType,eventRemark:l.eventRemark})):new Qe({type:"error",content:"保存失败,".concat(t.meta&&t.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new Qe({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))),0===e.type&&function(e,t,i,n){var a={accessToken:e.accessToken,inspectRecordId:"",eventType:"",evidenceFileId:"",eventTime:"",eventBeginTime:"",eventEndTime:"",depositaryOfficer:"",eventRemark:"",evidenceFileType:""},r=Object.assign(a,t),o="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event");Ee(o,"POST",r,(function(e){i&&i(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,l,(function(t){t.meta&&200===t.meta.code?(e.hide(),e.saveSuccessCallback&&e.saveSuccessCallback()):new Qe({type:"error",content:"保存失败,".concat(t.meta&&t.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new Qe({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))}})),document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-back")).addEventListener("click",(function(){e.backPopover=new it({id:"".concat(e.jSPlugin.id,"-inspectEventDetail-back"),content:"确定要返回吗?".concat(1===e.type?"返回后编辑的内容将不会保存。":"返回后对应存证也将删除。"),placement:"bottomRight",arrowPointAtCenter:!0,onCancel:function(){e.backPopover.hide()},onConfirm:function(){1===i&&(e.videoRecordingStatus&&0===e.type&&(e.timer&&e.timer.clearTimer("videoRecordingTimer"),e.startTime=1e3,document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click()),e.timer.clearTimer("videoRecordingStatusTimer")),e.backPopover.hide(),e.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn"))&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn")).addEventListener("click",(function(){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn ezuikit-btn-loading"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",function(e,t,i,n){var a={accessToken:e.accessToken,taskId:t},r="".concat(e.env.domain,"/api/v3/open/cloud/video/frame/stop");Ee(r,"POST",a,(function(e){i&&i(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,n,(function(t){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),t.meta&&200===t.meta.code?ot(e.jSPlugin,n,(function(t){if(t.meta&&200===t.meta.code){var i=t.data,n=i.taskStatus,a=i.fileUrl,r=i.videoCoverPic;e.timer&&e.timer.clearTimer("videoRecordingTimer");var o=r||"".concat(e.jSPlugin.staticPath,"/imgs/bg.svg");e.renderVideo(n,o,a),document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-video-info")).style.display="block",document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-video-timer")).style.display="none";var s=document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML;document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(s.split("~")[0]," ~ ").concat((new Date).Format("yyyy-MM-dd hh:mm:ss")),e.videoRecordingStatus=!1,document.getElementById("".concat(e.jSPlugin.id,"-event-ok")).removeAttribute("disabled")}})):new Qe({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),new Qe({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))})),document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).addEventListener("input",(function(){e.validationEventTag()})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("input",(function(e){var t=e.target.value;e.target.parentNode.setAttribute("data-count","".concat(t.length," / 100"))})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("focus",(function(e){e.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count ezuikit-input-textarea-focus")})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("blur",(function(e){e.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count")}))}}]),e}(),lt=function(){function e(t,i,n){var a=this;r(this,e),l(this,"hideDelEConfirm",(function(){for(var e=0;e<a.delEConfirmList.length;e++)a.delEConfirmList[e].hide()})),l(this,"initRender",(function(){var e=a;if(document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")))document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box"))&&document.getElementById("".concat(a.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box"))),e.initRender();else{var t=document.createElement("div");t.id="".concat(a.jSPlugin.id,"-inspect-event-box"),t.setAttribute("class","inspect-event-box");var i=0;document.getElementById("".concat(a.jSPlugin.id,"-inspectInfoControl"))&&(i=document.getElementById("".concat(a.jSPlugin.id,"-inspectInfoControl")).clientHeight),t.style="background: #fff;position: absolute;right: 0;bottom: 0; top:".concat(i,"px;"),t.innerHTML='\n      <div id="'.concat(a.jSPlugin.id,'-inspect-event-list-box" style="\n        width: 290px;\n        height: 100%;\n        overflow: hidden;\n        padding: 0;\n        box-sizing: border-box;\n      ">\n        <h1 style="\n          font-size: 16px;\n          color: #262626;\n          line-height: 24px;\n          font-weight: bold;\n          margin: 16px 16px 0;\n        ">巡检事件</h1>\n        <div id="').concat(a.jSPlugin.id,'-inspect-event-btn-wrap" style="\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 16px 16px;\n        ">\n          <div>\n            <button\n              id="').concat(a.jSPlugin.id,'-inspect-event-img"\n              style="min-width: 88px; margin: 0 auto;"\n              type="button"\n              class="ezuikit-btn ezuikit-btn-primary"\n            >\n            <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n            图片存证\n            </button>\n            <button\n              id="').concat(a.jSPlugin.id,'-inspect-event-video"\n              style="min-width: 88px; margin: 0 auto;"\n              type="button"\n              class="ezuikit-btn ezuikit-btn-primary"\n            >\n            <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n            视频存证</button>\n          </div>\n          <div id="').concat(a.jSPlugin.id,'-inspect-event-list-refresh" style="\n            width: 17px;\n            height: 32px;\n            cursor: pointer;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n          ">\n            <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="13" height="13" xmlns:xlink="http://www.w3.org/1999/xlink">\n              <path fill="currentColor" d="M960 416V192l-73.056 73.056a447.712 447.712 0 0 0-373.6-201.088C265.92 63.968 65.312 264.544 65.312 512S265.92 960.032 513.344 960.032a448.064 448.064 0 0 0 415.232-279.488 38.368 38.368 0 1 0-71.136-28.896 371.36 371.36 0 0 1-344.096 231.584C308.32 883.232 142.112 717.024 142.112 512S308.32 140.768 513.344 140.768c132.448 0 251.936 70.08 318.016 179.84L736 416h224z"></path>\n            </svg>\n          </div>\n        </div>\n        <div\n          id="').concat(a.jSPlugin.id,'-inspect-loading"\n          class="inspect-loading"\n          style="\n            height: calc(100% - 104px);\n            position: absolute; bottom: 0; right: 0;background: #fff; bottom: 0; right: 0; z-index: 99; width: 100%; align-items: center; justify-content: center;\n            display: ').concat(a.listLoading?"flex":"none",'\n          ">\n          <div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n        </div>\n        <div id="').concat(a.jSPlugin.id,'-inspect-event-list-nodata-wrap" style="\n          display: none;\n          height: calc(100% - 104px);\n          text-align: center;overflow: auto;\n        "> \n          <img style="width: 85px;height: 85px; margin: 120px auto 0;" src="').concat(a.jSPlugin.staticPath,'/imgs/empty.png" />\n          <p style="font-size: 14px;color: #595959;text-align: center;line-height: 22px;margin: 0;">暂无事件</p>\n        </div>\n        <div class="inspect-event-list-wrap" id="').concat(a.jSPlugin.id,'-inspect-event-list-wrap"\n          style="display: none; height: calc(100% - 104px); overflow-x: hidden; overflow-y: auto; padding-top: 4px; box-sizing: border-box; ">\n          <div id="').concat(a.jSPlugin.id,'-inspect-event-list-wrap-main"></div>\n          <div id="').concat(a.jSPlugin.id,'-inspect-event-list-more-loading" style="display: none;align-items: center;justify-content: center;" class="inspect-event-list-more-loading">\n            <div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n          </div>\n        </div>\n      </div>\n      <div id="').concat(a.jSPlugin.id,'-inspect-event-detail-wrap" class="inspect-event-detail-wrap" style="\n        height: 100%;\n      ">\n        <h1 style="\n          font-size: 16px;\n          color: #262626;\n          line-height: 24px;\n          font-weight: bold;\n          margin: 16px 16px 0;\n        ">巡检事件</h1>\n        <div id="').concat(a.jSPlugin.id,'-inspect-event-detail-box"></div>\n      </div>\n      '),document.getElementById("".concat(a.jSPlugin.id,"-wrap")).appendChild(t),a.jSPlugin.Theme.decoderState.state.play?a.enableEvidenceBtn():a.disableEvidenceBtn(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).onclick=function(){a.listLoading||a.startEvidence||(a.startEvidence=!0,a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",rt(a.jSPlugin,0,(function(e){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",e.meta&&200===e.meta.code?new st(a.jSPlugin,e.data,a.timer,0,(function(){a.initEvent(),new Qe({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})):new Qe({type:"error",content:"图片存证失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new Qe({type:"error",content:"图片存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).onclick=function(){a.listLoading||a.startEvidence||(a.startEvidence=!0,a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",rt(a.jSPlugin,1,(function(e){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",e.meta&&200===e.meta.code?new st(a.jSPlugin,e.data,a.timer,0,(function(){a.initEvent(),new Qe({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})):new Qe({type:"error",content:"视频存证失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new Qe({type:"error",content:"视频存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-refresh")).onclick=function(){a.listLoading||a.startEvidence||(a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-loading")).style.display="block",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none",e.initEvent())}}})),l(this,"renderList",(function(e){document.getElementById("".concat(a.jSPlugin.id,"-inspect-loading")).style.display="none";var t=e.data||[];if(t.length>0){document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).style.display="block",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none";for(var i=function(){var i=document.createElement("div");i.setAttribute("class","inspect-event-item");var r=t[n];i.setAttribute("id","".concat(a.jSPlugin.id,"-inspect-event-item-").concat(r.inspectEventId)),i.innerHTML="",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap-main")).appendChild(i);var o,s=document.createElement("div");s.setAttribute("class","inspect-event-item-header-wrap"),1==r.evidenceFileType&&(o="".concat(r.eventBeginTime.split(" ")[1],"~").concat(r.eventEndTime.split(" ")[1])),0==r.evidenceFileType&&(o="".concat(r.eventTime.split(" ")[1]));var l="";1===r.evidenceFileType&&(1===r.taskStatus||2===r.taskStatus?l="storage":4===r.taskStatus||5===r.taskStatus||6===r.taskStatus||7===r.taskStatus?l="storage-error":0!==r.taskStatus&&3!==r.taskStatus||(l="storage-success")),s.innerHTML='\n        <div class="inspect-event-item-header '.concat(l,'">\n        <div class="inspect-event-item-header-left">\n          <span class="inspect-event-item-status-wrap">\n            <span class="inspect-event-item-status"></span>\n          </span>\n          <svg fill="currentColor" style="display: ').concat(1===r.evidenceFileType?"block":"none",'" width="16" height="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t          viewBox="0 0 14 12" style="enable-background:new 0 0 14 12;" xml:space="preserve">\n            <path d="M1,12c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1h12c0.6,0,1,0.4,1,1v10c0,0.6-0.4,1-1,1H1z M1,11h1.6l0-3.5H1V11z\n            M10.5,1h-7v10h7V1z M13,7.5h-1.6l0,3.5H13V7.5z M6.1,4.2l2.3,1.2c0.4,0.2,0.4,0.6,0,0.8L8.1,6.3l-2,1c-0.2,0.1-0.4,0-0.4-0.2V4.4\n            C5.7,4.2,5.9,4.1,6.1,4.2z M13,6.6V4.9h-1.6v1.8H13z M1,6.6h1.6V4.9H1V6.6z M13,4V1h-1.6l0,3H13z M2.6,1H1v3h1.6L2.6,1z"/>\n          </svg>\n          <svg fill="currentColor" style="display: ').concat(1===r.evidenceFileType?"none":"block",'" width="16" height="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n            viewBox="0 0 14 12" style="enable-background:new 0 0 14 12;" xml:space="preserve">\n            <path class="st0" d="M13,0c0.6,0,1,0.4,1,1v10c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1H13z M10.4,6.2L5.6,9.8L3.8,8\n            L1,10v1h12V9L10.4,6.2z M13,1H1v7.8l2.9-2.1l1.8,1.8l4.9-3.6L13,7.5V1z M5.5,2C6.3,2,7,2.7,7,3.5S6.3,5,5.5,5S4,4.3,4,3.5\n            S4.7,2,5.5,2z M5.5,3C5.2,3,5,3.2,5,3.5S5.2,4,5.5,4S6,3.8,6,3.5S5.8,3,5.5,3z"/>\n          </svg>\n          <span class="inspect-event-item-time">').concat(o||"-",'</span>\n        </div>\n        <div class="inspect-event-item-header-right">\n          <span class="inspect-event-item-header-toggle">\n          <svg fill="currentColor" class="inspect-event-item-header-toggle-up" style="display: none;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M218.496 645.312l46.464 44.032 247.616-261.568 246.4 261.504 46.528-43.904-292.8-310.72z"></path></svg>  \n          <svg fill="currentColor" class="inspect-event-item-header-toggle-down"  viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M218.496 378.688l46.464-44.032 247.616 261.568 246.4-261.504 46.528 43.904-292.8 310.72z"></path></svg>\n          </span>\n        </div>\n        </div>\n        '),i.appendChild(s),s.onclick=function(e){"none"===s.querySelector(".inspect-event-item-header-toggle-up").style.display?(s.querySelector(".inspect-event-item-header-toggle-up").style.display="block",s.querySelector(".inspect-event-item-header-toggle-down").style.display="none",i.querySelector(".inspect-event-item-body").style.display="block"):(s.querySelector(".inspect-event-item-header-toggle-up").style.display="none",s.querySelector(".inspect-event-item-header-toggle-down").style.display="block",i.querySelector(".inspect-event-item-body").style.display="none")};var c=document.createElement("div");c.setAttribute("class","inspect-event-item-body"),c.style.display="none";var d=(1===r.evidenceFileType?r.videoCoverPic:r.fileUrl)||"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg");c.innerHTML='\n        <div class="inspect-event-item-img" id="'.concat(a.jSPlugin.id,"-inspect-view-").concat(r.inspectEventId,'"></div>\n        <div class="inspect-event-item-body-info">\n          <div class="inspect-event-item-body-info-tag">\n            <span class="inspect-event-item-body-info-tag-label" title="').concat(r.eventType,'">').concat(r.eventType,"</span>\n          </div>\n        </div>\n        "),i.appendChild(c),1==r.evidenceFileType&&(1===r.taskStatus||2===r.taskStatus?document.getElementById("".concat(a.jSPlugin.id,"-inspect-view-").concat(r.inspectEventId)).innerHTML='\n              <div class="video-stroage-exceptional-status-tips-wrap" style="background:url('.concat(a.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n                <div class="video-stroage-exceptional-status-icon">\n                <div type="default" class="ezuikit-spin ezuikit-spin-sm ezuikit-spin-spinning ezuikit-spin-dot-white"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n                </div>\n                <span class="video-stroage-exceptional-status-tips">视频正在存储中…</span>\n              </div>\n            '):4===r.taskStatus?document.getElementById("".concat(a.jSPlugin.id,"-inspect-view-").concat(r.inspectEventId)).innerHTML='\n            <div class="video-stroage-exceptional-status-tips-wrap video-stroage-exceptional-status-tips-error" style="background:url('.concat(a.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n              <div class="video-stroage-exceptional-status-icon">\n                <svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>\n              </div>\n              <span class="video-stroage-exceptional-status-tips">视频存储失败</span>\n            </div>\n            '):0!==r.taskStatus&&3!==r.taskStatus||new nt({id:"".concat(a.jSPlugin.id,"-inspect-view-").concat(r.inspectEventId),src:r.fileUrl,poster:d,fallback:"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg")})),0==r.evidenceFileType&&new et({id:"".concat(a.jSPlugin.id,"-inspect-view-").concat(r.inspectEventId),src:d,fallback:"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg"),showIcon:!1});var u=document.createElement("div");u.setAttribute("class","inspect-event-item-body-info-opr");var h=document.createElement("span");h.setAttribute("class","inspect-event-item-body-info-opr-icon"),h.innerHTML='\n          <svg fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M612.992 121.984a64 64 0 0 1 90.496 0l153.92 153.92a64 64 0 0 1 0 90.496l-435.2 435.2a96 96 0 0 1-23.04 17.024l525.312-0.128v64H175.808v-2.304a64 64 0 0 1-66.496-77.632l43.776-199.296a96 96 0 0 1 25.92-47.296zM523.072 302.4l-298.88 298.88a32 32 0 0 0-8.576 15.744l-43.776 199.296 190.848-51.712a32 32 0 0 0 14.272-8.256l300.032-300.032-153.92-153.92z m135.168-135.168L568.32 257.088l153.92 153.984 89.92-89.92-153.92-153.92z"></path></svg>\n        ',u.appendChild(h);var f=document.createElement("span");f.setAttribute("class","inspect-event-item-body-info-opr-icon"),f.id="".concat(a.jSPlugin.id,"-inspect-event-del-").concat(r.inspectEventId),f.innerHTML=' \n          <svg fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M128 320V256h767.872v64H832v512a64 64 0 0 1-64 64H256a64 64 0 0 1-64-64V320H128z m640 0H256v512h512V320zM464 432v256h-64v-256h64z m160 0v256h-64v-256h64zM704 128v64H320V128h384z"></path></svg>\n        ',u.appendChild(f),h.onclick=function(e){a.startEvidence||new st(a.jSPlugin,r,a.timer,1,(function(e){new Qe({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40}),r=Object.assign(r,e),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-item-").concat(r.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").innerHTML=r.eventType,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-item-").concat(r.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").setAttribute("title",r.eventType)}))},f.onclick=function(e){a.startEvidence||(a.delE=new it({id:"".concat(a.jSPlugin.id,"-inspect-event-del-").concat(r.inspectEventId),content:"确定要删除该事件吗?",placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){a.delE.hide()},onConfirm:function(){!function(e,t,i,n){var a={accessToken:e.accessToken,inspectEventId:""},r=Object.assign(a,t),o="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/delete");Ee(o,"POST",r,(function(e){i&&i(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(a.jSPlugin,{inspectEventId:r.inspectEventId},(function(e){e.meta&&200===e.meta.code?(a.delE.hide(),a.initEvent(),setTimeout((function(){new Qe({type:"success",content:"删除成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),10)):new Qe({type:"error",content:"删除失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new Qe({type:"error",content:"删除失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}))}}),a.delEConfirmList.push(a.delE))},i.querySelector(".inspect-event-item-body-info").appendChild(u),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).onscroll=function(t){var i=t.target;a.hideDelEConfirm(),i.scrollTop+i.offsetHeight>=i.scrollHeight-48&&!a.listLoading&&(e.start+1)*e.size<e.total&&a.initEvent(e.start+1)}},n=0;n<t.length;n++)i()}else document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="block"})),this.jSPlugin=t,this.videoWidth=t.width,this.inspectRecordId=i,this.timer=n,this.listLoading=!1,this.startEvidence=!1,this.delEConfirmList=[],this.videoHeight=document.getElementById("".concat(t.id,"-wrap")).clientHeight-document.getElementById("".concat(t.id,"-inspectInfoControl")).clientHeight||t.height,this.initEvent()}return s(e,[{key:"initEvent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=this;n.listLoading=!0,0===t?n.initRender(t):document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="flex";var a=function(t){new Qe({type:"error",content:t.meta&&t.meta.message||"列表获取失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40}),n.renderList({})};!function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,a=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0,o={accessToken:e.accessToken,inspectRecordId:t,pageStart:i,pageSize:n},s="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/page");Ee(s,"GET",o,(function(e){a&&a(e)}),(function(e){r&&r(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(n.jSPlugin,n.inspectRecordId,t,i,(function(t){n.listLoading=!1,document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",t.meta&&200===t.meta.code?n.renderList(t.data||{}):a(t)}),(function(t){n.listLoading=!1,document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",a(t)}))}},{key:"disableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).setAttribute("disabled","disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).setAttribute("disabled","disabled")}},{key:"enableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).removeAttribute("disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).removeAttribute("disabled")}}]),e}(),ct=function(){function e(t,i,n,a,o){var s=this;r(this,e),l(this,"createLocationControl",(function(){var e=s;function t(){this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT,this.defaultOffset=new BMapGL.Size(40,105)}return t.prototype=new BMapGL.Control,t.prototype.initialize=function(t){var i=document.createElement("div");return i.style.cssText="width: 26px;height: 26px;display: flex;align-items: center;justify-content: center; box-shadow: 1px 2px 1px rgb(0 0 0 / 15%); background: #fff; cursor: pointer;",i.id="".concat(e.jSPlugin.id,"-location-btn"),i.innerHTML='<svg fill="#3385ff" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink">\n        <path d="M510.976716 128.626761c-211.205756 0-382.401119 171.195363-382.401119 382.401119s171.195363 382.401119 382.401119 382.401119S893.377836 722.131308 893.377836 510.925552 722.182472 128.626761 510.976716 128.626761zM736.508444 736.45728c-29.265914 29.265914-63.443589 52.289797-101.407415 68.355351-29.265914 12.381733-59.964425 20.158689-91.481563 23.433197L543.619466 704.019187l-63.443589 0 0 124.431298c-32.233437-3.069851-63.443589-10.949136-93.323474-23.535525-37.963825-16.065554-72.039173-39.089437-101.407415-68.355351-29.265914-29.265914-52.289797-63.443589-68.355351-101.407415-12.381733-29.265914-20.158689-59.964425-23.433197-91.481563l126.273209 0 0-63.443589L193.554112 480.227041c3.069851-32.233437 10.949136-63.443589 23.535525-93.323474 16.065554-37.963825 39.089437-72.039173 68.355351-101.407415 29.265914-29.265914 63.443589-52.289797 101.407415-68.355351 29.879884-12.58639 61.090037-20.465674 93.323474-23.535525l0 125.863895 63.443589 0L543.619466 193.707605c31.517138 3.172179 62.215649 11.051464 91.481563 23.433197 37.963825 16.065554 72.039173 39.089437 101.407415 68.355351 29.265914 29.265914 52.289797 63.443589 68.355351 101.407415 12.58639 29.879884 20.465674 61.090037 23.535525 93.323474L703.251724 480.227041l0 63.443589 125.045268 0c-3.172179 31.517138-11.051464 62.215649-23.433197 91.481563C788.798241 673.01369 765.876686 707.089038 736.508444 736.45728z" p-id="1506"></path><path d="M516.093135 415.248526c-56.280604 0-100.793445 43.489557-100.793445 99.770161s44.512841 101.816728 100.793445 101.816728S616.886579 571.29929 616.886579 515.018687 572.373738 415.248526 516.093135 415.248526z" p-id="1507"></path>\n      </svg>',i.onclick=function(t){setTimeout((function(){e.inspectMapWin.centerToTrack(18)}),100)},t.getContainer().appendChild(i),i},new t})),l(this,"initSwithcBtn",(function(){var e=document.createElement("div");e.id="".concat(s.jSPlugin.id,"-miniSwitch"),e.style="cursor: pointer;position: absolute; bottom: 106px; right: ".concat(s.jSPlugin.inspectVideoWidth+10,"px; z-index: 999;"),e.innerHTML="<div id='".concat(s.jSPlugin.id,'-miniSwitch-btn\' style="width: 32px;height: 32px;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: rgba(0,0,0,0.70);">\n      <svg width="20px" height="20px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n          <title>大小窗切换</title>\n          <g id="icon/大小窗切换" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n              <rect id="矩形" x="0" y="0" width="24" height="24"></rect>\n              <path d="M16,3.25 C17.5187831,3.25 18.75,4.48121694 18.75,6 L18.75,6 L18.75,6.644 L19.095177,6.64456257 C20.6299163,6.64456257 21.9388658,7.64624846 22.0337198,8.99291851 L22.0392202,9.14979714 L22.0392202,17.639328 C22.0392202,19.0115638 20.7871129,20.0640733 19.2712041,20.1401546 L19.095177,20.1445626 L8.48326347,20.1445626 C6.94852423,20.1445626 5.63957467,19.1428767 5.54472071,17.7962066 L5.53922025,17.639328 L5.539,16.75 L5,16.75 C3.53746816,16.75 2.34159572,15.6082954 2.25501879,14.1675223 L2.25,14 L2.25,6 C2.25,4.48121694 3.48121694,3.25 5,3.25 L5,3.25 Z M18.75,14 C18.75,15.5187831 17.5187831,16.75 16,16.75 L16,16.75 L7.039,16.75 L7.03922025,17.639328 C7.03922025,18.1209822 7.57916546,18.5830417 8.33031492,18.6389177 L8.48326347,18.6445626 L19.095177,18.6445626 C19.873026,18.6445626 20.4615868,18.2126064 20.5321184,17.735283 L20.5392202,17.639328 L20.5392202,9.14979714 C20.5392202,8.66814298 19.999275,8.20608342 19.2481256,8.15020744 L19.095177,8.14456257 L18.75,8.144 Z M16,4.75 L5,4.75 C4.30964406,4.75 3.75,5.30964406 3.75,6 L3.75,6 L3.75,14 C3.75,14.6903559 4.30964406,15.25 5,15.25 L5,15.25 L16,15.25 C16.6903559,15.25 17.25,14.6903559 17.25,14 L17.25,14 L17.25,8.144 L17.2422027,8.14456257 L17.2422027,6.64456257 L17.25,6.644 L17.25,6 C17.25,5.35279131 16.7581253,4.8204661 16.1278052,4.75645361 L16,4.75 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n          </g>\n      </svg>\n    </div>'),document.getElementById("".concat(s.jSPlugin.id,"-wrap")).appendChild(e),document.getElementById("".concat(s.jSPlugin.id,"-miniSwitch-btn")).onclick=function(){k.throttle((function(){return s.miniRecSwitchClick()}),1e3)()}})),l(this,"initMiniWinToggleBtn",(function(){var e=.3333*s.videoWidth,t=.3333*s.videoHeight,i=document.createElement("div");i.id="".concat(s.jSPlugin.id,"-miniToggle"),i.style="cursor: pointer;position: absolute; bottom: ".concat(t/2+96-30,"px; right: ").concat(s.jSPlugin.inspectVideoWidth+e,"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;"),i.innerHTML="<div id='".concat(s.jSPlugin.id,"-miniToggle-btn'>\n    <svg id=\"").concat(s.jSPlugin.id,'-min-win-close-icon" style="display: inline-block" width="20px" height="20px" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10867" xmlns:xlink="http://www.w3.org/1999/xlink">\n        <path d="M378.688 217.856l-44.032 46.464 261.568 247.616-261.504 246.4 43.904 46.528 310.72-292.8z" fill="#ffffff" p-id="10868"></path>\n      </svg>\n    <svg id="').concat(s.jSPlugin.id,'-min-win-open-icon" style="display: none" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10671" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20">\n        <path d="M645.312 217.856l44.032 46.464-261.568 247.616 261.504 246.4-43.904 46.528-310.72-292.8z" fill="#ffffff" p-id="10672"></path>\n      </svg>\n    </div>'),document.getElementById("".concat(s.jSPlugin.id,"-wrap")).appendChild(i),document.getElementById("".concat(s.jSPlugin.id,"-miniToggle")).onclick=function(){s.miniWinToggleClick()}})),l(this,"init",(function(){s.initSwithcBtn(),s.initMiniWinToggleBtn()})),l(this,"setStyleListByIds",(function(e){e.map((function(e){var t=document.getElementById(e.id);t&&Object.keys(e.styleList).map((function(i){t.style[i]=e.styleList[i]}))}))})),this.jSPlugin=t,this.inspectMode=i,this.inspectMapWin=n,this.changeInspectMode=a,this.videoWidth=t.width,this.videoHeight=t.height,this.minWinStatus="open",this.decoderState=o,this.ZoomControl=new BMapGL.ZoomControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(40,50)}),this.LocationControl=this.createLocationControl(),this.NavigationControl3D=new BMapGL.NavigationControl3D({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(28,105)}),this.init()}return s(e,[{key:"miniWinToggleClick",value:function(){var e=.3333*this.jSPlugin.width;"open"===this.minWinStatus?(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:"0px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"inline-block"}}]),this.minWinStatus="close"):(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:e+"px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth+e,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"inline-block"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"none"}}]),this.minWinStatus="open")}},{key:"miniRecSwitchClick",value:function(){var e=this,t=.3333*this.jSPlugin.width,i=.3333*this.jSPlugin.height;"video"===this.inspectMode?(this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom(),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:this.jSPlugin.width+"px",height:this.jSPlugin.height+"px",marginBottom:"-40px"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:this.jSPlugin.height+"px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"absolute",zIndex:"100",bottom:"96px",right:"".concat(this.jSPlugin.inspectVideoWidth,"px"),overflow:"hidden"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(t,i),this.inspectMode="map",this.changeInspectMode("map"),this.inspectMapWin.map.addControl(this.NavigationControl3D),this.inspectMapWin.map.addControl(this.LocationControl),this.inspectMapWin.map.addControl(this.ZoomControl),this.inspectMapWin.map.addOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"none",width:"32px",height:"14px"}}]),setTimeout((function(){e.inspectMapWin.centerToTrack(18)}),100)):(this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:t+"px",height:i+"px",marginBottom:"0"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:"0px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"relative",zIndex:"0",bottom:"0",right:"0"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(this.jSPlugin.width,this.jSPlugin.height),this.inspectMode="video",this.changeInspectMode("video"),this.inspectMapWin.map.removeControl(this.ZoomControl),this.inspectMapWin.map.removeControl(this.NavigationControl3D),this.inspectMapWin.map.removeControl(this.LocationControl),this.inspectMapWin.map.removeOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"1px solid rgb(255, 255, 255)",width:"80px",height:"32px",color:"#fff","text-align":"center","line-height":"32px","font-size":"14px"}}]),setTimeout((function(){e.inspectMapWin.centerToTrack()}),100),this.jSPlugin.Zoom&&this.decoderState.state.play&&this.jSPlugin.Zoom.startZoom()),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-wrap"),styleList:{width:this.jSPlugin.width+this.jSPlugin.inspectVideoWidth+"px",height:this.jSPlugin.height+this.jSPlugin.inspectVideoHeight+"px"}}])}}]),e}(),dt={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0,inspectInfo:{color:"#000000",backgroundColor:"#ffffff",activeColor:"#1890FF",btnList:[{btnKey:"inspectName",iconId:"inspectName",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectBeginTime",iconId:"inspectBeginTime",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectPerson",iconId:"inspectPerson",part:"right",defaultActive:0,isrender:1,color:"#262626"}]}},header:{color:"#2c2c2c",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"deviceName",iconId:"deviceName",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"inspectTime",iconId:"inspectTime",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"signalType",iconId:"signalType",part:"right",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"batteryStatus",iconId:"batteryStatus",part:"right",defaultActive:0,isrender:1,color:"#ffffff"}]},footer:{color:"#ffffff",backgroundColor:"#000000",activeColor:"blue",btnList:[{btnKey:"talk",iconId:"talk",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"},{btnKey:"sound",iconId:"sound",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"}]}},ut=function(e){var t="";return Object.keys(e).map((function(i,n){t+="".concat(i,":").concat(e[i]).concat(n<Object.keys(e).length-1?";":"")})),t};var ht=500,ft=function(){function e(t,i,n,a,o,s,l){r(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=i,this.setDecoderState=n,this.decoderState=a,this.isNeedRenderInspectInfo=!1,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.inspectMode=o,this.changeInspectMode=s,this.themeInited=!1,this.inspectRecordId=null,this.inspectInfo={},this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.globalContainer=new $e(this.jSPlugin),this.toastCustom=new Me(t,!1),this.InspectEvent=null,this.timer=l}return s(e,[{key:"renderSignalType",value:function(e){return e?"WIFI"===e.toUpperCase()?'<span><svg t="1688983236732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink">\n        <path d="M0 352.832l93.12 98.752c231.296-245.44 606.464-245.44 837.76 0L1024 352.832C741.44 53.056 283.008 53.056 0 352.832z m372.352 395.008L512 896l139.648-148.16c-76.8-81.92-202.048-81.92-279.296 0zM186.24 550.4l93.12 98.752c128.448-136.32 336.96-136.32 465.408 0L837.824 550.4c-179.648-190.592-471.488-190.592-651.648 0z" fill="#ffffff" p-id="1530"></path>\n      </svg></span>':"<span>".concat(e,"</span>"):null}},{key:"renderBatteryStatus",value:function(e){return e&&0!=e?'\n    <div style="\n      display: flex;\n      align-items: center;\n      position: relative;\n    ">\n      <span style="\n        margin-right: 3px; \n        color: '.concat(e<=20?"#FF4D4F":"#FFFFFF",'\n      ">').concat(e,'%</span>\n      <div style="\n        position: absolute;\n        right: 6px;\n        height: 8px;\n        width: 15px;\n      ">\n        <div style="\n          width: ').concat(e,"%;\n          height: 100%;\n          background: ").concat(e<=20?"#FF4D4F":"#FFFFFF",'\n          "></div>\n      </div>\n      <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="32" xmlns:xlink="http://www.w3.org/1999/xlink">\n        <path fill="').concat(e<=20?"#FF4D4F":"#FFFFFF",'"  d="M128 213.333333l640 0q52.992 0 90.496 37.504t37.504 90.496q52.992 0 90.496 37.504t37.504 90.496l0 85.333333q0 52.992-37.504 90.496t-90.496 37.504q0 52.992-37.504 90.496t-90.496 37.504l-640 0q-52.992 0-90.496-37.504t-37.504-90.496l0-341.333333q0-52.992 37.504-90.496t90.496-37.504zM768 298.666667l-640 0q-17.664 0-30.165333 12.501333t-12.501333 30.165333l0 341.333333q0 17.664 12.501333 30.165333t30.165333 12.501333l640 0q17.664 0 30.165333-12.501333t12.501333-30.165333l0-341.333333q0-17.664-12.501333-30.165333t-30.165333-12.501333zM896 426.666667l0 170.666667q17.664 0 30.165333-12.501333t12.501333-30.165333l0-85.333333q0-17.664-12.501333-30.165333t-30.165333-12.501333z"></path>\n      </svg>\n    </div>\n    '):null}},{key:"renderInspectTime",value:function(e){if(!e)return null;var t,i,n,a,r=e.split(" "),o=r[0].split("-"),s=r[1].split(":"),l=new Date(o[0],o[1]-1,o[2],s[0],s[1],s[2]),c=(new Date).getTime()-new Date(l).getTime();return'\n    <span style="\n      display: inline-block;\n      width:8px;\n      height:8px;\n      border-radius: 100%;\n      background: #FF4D4F;\n      margin-right: 4px;\n    "></span>\n    '.concat((t=c,i=parseInt(t%864e5/36e5),n=parseInt(t%36e5/6e4),a=parseInt(t%6e4/1e3),(i<10?"0".concat(i):i)+":"+(n<10?"0".concat(n):n)+":"+(a<10?"0".concat(a):a)),"\n    ")}},{key:"matchBtn",value:function(e,t){var i=this,n=this.themeData,a=n.customConfig,r=n.header,o=n.footer,s=a.inspectInfo,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}},c=s.btnList.findIndex((function(t){return t.iconId===e}));switch(-1!==c?(l.color=s.color,l.backgroundColor=s.backgroundColor,l.activeColor=s.activeColor):-1!==(c=r.btnList.findIndex((function(t){return t.iconId===e})))?(l.color=r.color,l.backgroundColor=r.backgroundColor,l.activeColor=r.activeColor):(l.color=o.color,l.backgroundColor=o.backgroundColor,l.activeColor=o.activeColor),e){case"inspectName":return l.title="巡检名称",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectName" \n        style="\n        color:').concat(t.color||"#262626",';\n        font-size: 18px;\n        text-align: left;\n        font-weight: bold;\n        padding: 0 16px;\n        ">巡检名称</span>'),l.onclick=function(){},l;case"inspectBeginTime":return l.title="巡检开始时间",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectBeginTime" \n        style="\n        color:').concat(t.color||"#FFFFFF",';\n        font-size: 14px;\n        text-align: left;\n        padding-left: 16px;\n        border-left: 1px solid #d9d9d9;\n        line-height: 16px;\n        margin-top: 1px;\n        ">巡检开始时间:-</span>'),l.onclick=function(){},l;case"inspectPerson":return l.title="本地巡检员",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectPerson" \n        style="\n        color:').concat(t.color||"#FFFFFF",';\n        font-size: 14px;\n        display: block;\n        max-width: 100%;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n        text-align: left;\n        padding-right: 16px;\n        ">本地巡检员:-</span>'),l.onclick=function(){},l;case"deviceName":return l.title="设备名称",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-deviceName" \n        style="\n        color:').concat(t.color||"#FFFFFF",";\n        font-size: 16px;\n        display: block;\n        max-width: ").concat(.33*this.jSPlugin.width,'px;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n        text-align: left;\n        ">设备名称</span>'),l.onclick=function(){},l;case"inspectTime":return l.title="巡检时长",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-inspectTime-wrap" \n        style="\n        color:').concat(t.color||"#FFFFFF",';\n        font-size: 14px;\n        display: flex;\n        max-width: 100%;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n        text-align: left;\n        margin-left: 32px;\n        ">巡检时长:<span id="').concat(this.jSPlugin.id,'-header-inspectTime" style="display: flex; align-items: center;">-</span></span>'),l.onclick=function(){},l;case"signalType":return l.title="信号类型",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-signalType" \n        style="\n        color:').concat(t.color||"#FFFFFF",';\n        font-size: 14px;\n        display: block;\n        max-width: 100%;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n        text-align: left;\n        "></span>'),l.onclick=function(){},l;case"batteryStatus":return l.title="设备电量",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-batteryStatus" \n        style="\n        color:').concat(t.color||"#FFFFFF",';\n        font-size: 14px;\n        display: flex;\n        max-width: 100%;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n        text-align: left;\n        margin-left: 12px;\n        align-items: center;\n        "></span>'),l.onclick=function(){},l;case"talk":return l.title="对讲",l.id=e,l.domString="<div></div>"+'<svg id="'.concat(this.jSPlugin.id,'-talk-icon" class="theme-icon-item-icon" fill="').concat(l.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>ht?48:32,'" height="').concat(this.jSPlugin.width>ht?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.1,2.7C8.5,2.7,7.2,4,7.2,5.6v5.2c0,1.6,1.3,2.9,2.9,2.9l0.2,0c1.5-0.1,2.7-1.4,2.7-2.9V5.6\tC13,4,11.7,2.7,10.1,2.7z M10.1,3.7c1.1,0,1.9,0.9,1.9,1.9v5.2c0,1-0.8,1.8-1.8,1.9l-0.1,0c-1,0-1.9-0.9-1.9-1.9V5.6 C8.2,4.5,9,3.7,10.1,3.7z" /><path d="M15.1,8.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,3-2.5,5.5-5.5,5.5c-3,0-5.4-2.3-5.5-5.3l0-0.2V9 c0-0.3,0.2-0.5,0.5-0.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,2.5,2,4.5,4.5,4.5c2.4,0,4.4-1.9,4.5-4.3l0-0.2V9 C14.6,8.7,14.8,8.5,15.1,8.5z" /><path d="M13.5,17.7c0.3,0,0.5,0.2,0.5,0.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-7c-0.3,0-0.5-0.2-0.5-0.5 c0-0.2,0.2-0.4,0.4-0.5l0.1,0H13.5z" /><path d="M10.1,15.2c0.2,0,0.4,0.2,0.5,0.4l0,0.1v2.5c0,0.3-0.2,0.5-0.5,0.5c-0.2,0-0.4-0.2-0.5-0.4l0-0.1 v-2.5C9.6,15.4,9.8,15.2,10.1,15.2z" />'+'</svg><span id="'.concat(this.jSPlugin.id,'-talk-label" style="margin-left: -3px">对讲</span>'),l.onclick=function(){var e=i.decoderState.state,t=e.talk,n=e.sound;if(e.play)if(t){console.log("结束对讲"),i.setDecoderState({talk:!1}),i.jSPlugin.Talk.stopTalk();var a=k.findIndex(i.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;i.themeData&&a&&(i.jSPlugin.openSound(),i.setDecoderState({sound:!0}))}else console.log("开始对讲"),i.setDecoderState({talk:!0}),i.jSPlugin.Talk.startTalk((function(e){n&&!e&&(i.jSPlugin.closeSound(),i.setDecoderState({sound:!1}))}))},l;case"sound":return l.title="音量",l.id=e,l.domString='<span style="height: 100%">'+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-nosound-icon" style="display:none" fill="').concat(l.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>ht?48:32,'" height="').concat(this.jSPlugin.width>ht?48:32,'" viewBox="-6 -7 32 31">\n          <path d="M8.5,4.2c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8C5,13.2,5,12.9,5.1,12.7 c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3L9.2,5L5.9,7.8 C5.6,7.9,5.3,7.9,5.1,7.7C5,7.5,5,7.3,5.1,7.1L5.2,7L8.5,4.2z"/>\n          <path d="M5.5,6.9C5.8,6.9,6,7.1,6,7.4c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2C3.4,7.9,3.3,8,3.2,8.2l0,0.1v4 c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,12.5,6,12.7,6,13c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4 c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n          <path d="M17.4,7.9c0.2-0.2,0.5-0.2,0.7,0c0.2,0.2,0.2,0.4,0.1,0.6l-0.1,0.1l-3.8,3.8c-0.2,0.2-0.5,0.2-0.7,0 c-0.2-0.2-0.2-0.4-0.1-0.6l0.1-0.1L17.4,7.9z"/>\n          <path d="M13.7,7.9c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.8,3.8c0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1-0.1 l-3.7-3.8C13.5,8.4,13.5,8.1,13.7,7.9z"/>\n          </svg>')+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-sound-icon" style="display:inline-block" width="').concat(this.jSPlugin.width>ht?48:32,'" height="').concat(this.jSPlugin.width>ht?48:32,'" fill="').concat(l.color,'" viewBox="-6 -7 32 32">\n            <path d="M13.2,7.1c0.1-0.2,0.5-0.3,0.7-0.2c1.1,0.7,1.9,2.2,1.9,3.7c0,1.6-0.7,3-1.9,3.7\n              c-0.2,0.1-0.5,0.1-0.7-0.2c-0.1-0.2-0.1-0.5,0.2-0.7c0.8-0.5,1.4-1.6,1.4-2.9c0-1.3-0.6-2.4-1.4-2.9C13.1,7.6,13,7.3,13.2,7.1z"/>\n            <path d="M15.7,4.5c0.2-0.2,0.5-0.2,0.7-0.1C18,5.8,19,8.2,19,10.7c0,2.5-1,4.8-2.7,6.3\n              c-0.2,0.2-0.5,0.2-0.7-0.1c-0.2-0.2-0.2-0.5,0.1-0.7c1.4-1.2,2.3-3.3,2.3-5.5c0-2.2-0.9-4.3-2.3-5.5C15.5,5,15.5,4.7,15.7,4.5z"/>\n            <path id="Stroke-5" class="st1" d="M8.5,4.7c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8\n              C5,13.7,5,13.4,5.1,13.2c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3l-0.1,0\n              L5.9,8.3C5.6,8.4,5.3,8.4,5.1,8.2C5,8,5,7.7,5.1,7.6l0.1-0.1L8.5,4.7z"/>\n            <path  d="M5.5,7.4C5.8,7.4,6,7.6,6,7.9c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.2,0-0.3,0.1-0.3,0.3l0,0.1v4\n              c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,13,6,13.2,6,13.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4\n              c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n          </svg>')+'</span><span id="'.concat(this.jSPlugin.id,'-sound-label" style="margin-left: -3px; color: ').concat(l.color,'">音量</span>'),l.onclick=function(){var e=i.decoderState.state,t=e.play,n=e.sound,a=e.talk;t&&!a&&(n?(i.jSPlugin.closeSound(),i.setDecoderState({sound:!1})):(i.jSPlugin.openSound(),i.setDecoderState({sound:!0})))},l;default:return l}}},{key:"renderInspectInfo",value:function(e,t){var i=this.matchBtn(e,t),n=document.createElement("sapn");n.innerHTML="".concat(i.domString),"left"===t.part?document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-left")).appendChild(n):document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-right")).appendChild(n)}},{key:"renderHeader",value:function(e,t){var i=this.matchBtn(e,t),n=document.createElement("span");n.className="".concat(this.jSPlugin.id,"-header-content"),n.style="display: flex; align-items: center; ",n.innerHTML="\n      ".concat(i.domString,"\n    "),"left"===t.part?document.getElementById("".concat(this.jSPlugin.id,"-headControl-left")).appendChild(n):document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).appendChild(n)}},{key:"renderFooter",value:function(e,t){var i=this,n=this.matchBtn(e,t),a=this.videoWidth/6,r=document.createElement("div");r.className="theme-icon-item",this.jSPlugin.isWebConsole?r.style="padding:0 ".concat(.1*a,"px;"):r.style="padding:0 ".concat(.1*a,"px;cursor: pointer;"),r.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-content" title="').concat(n.title,'" style="display: flex;align-items: center;position:relative;">')).concat(n.domString,"</div>")+"</span>",r.onclick=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;n.onclick(e)},n.onmouseenter&&(r.onmouseenter=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;n.onmouseenter(e)}),n.onmouseleave&&(r.onmouseleave=function(e){if(i.decoderState.state.isEditing||!i.activeThemeStatus)return!1;n.onmouseleave(e)}),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,i=t.customConfig,n=t.header,a=t.footer,r=i.inspectInfo,o=this.jSPlugin.id;if(this.isNeedRenderInspectInfo=k.findIndex(r.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader=k.findIndex(n.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=k.findIndex(a.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderInspectInfo)if(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")))document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-inspectInfoControl-left' style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-inspectInfoControl-right' style='display:flex'></div>");else{var s=document.createElement("div");s.setAttribute("id","".concat(this.jSPlugin.id,"-inspectInfoControl")),s.setAttribute("class","inspectInfo-controls"),s.innerHTML="<div id='".concat(this.jSPlugin.id,"-inspectInfoControl-left' class=\"inspectInfo-controls-left\" style='display:flex;overflow:hidden;'></div><div id='").concat(this.jSPlugin.id,"-inspectInfoControl-right' class=\"inspectInfo-controls-right\" style='display:flex;'></div>");var l={height:"58px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#000000",width:"".concat(this.jSPlugin.width+290,"px"),position:"relative","align-items":"center",background:"#ffffff","border-bottom":"1px solid #D9D9D9","box-sizing":"border-box"};s.style=ut(l),document.getElementById("".concat(o,"-wrap")).insertBefore(s,document.getElementById(this.jSPlugin.id));var c=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(c)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")));if(this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var d=document.createElement("div");d.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),d.setAttribute("class","header-controls"),d.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex; max-width: 70%; align-items: center; overflow: hidder;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex; align-items: center;'></div>");var u={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"};d.style=ut(u),document.getElementById("".concat(o,"-wrap")).insertBefore(d,document.getElementById(o));var h=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(h)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat("56px","px"));else{var f=document.createElement("div");f.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),f.setAttribute("class","ez-iframe-footer-container");var x={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"};f.style=ut(x),f.innerHTML='\n          <div id="'.concat(this.jSPlugin.id,"-audioControls\" class=\"footer-controls\" style='display:flex;justify-content: center;padding: 0 4%;width:100%;z-index:999;position: relative;'>\n            <div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex;margin-lefacti'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div>\n          </div>\n          "),g(f,document.getElementById(o))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));this.isNeedRenderInspectInfo&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=r.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=r.color,r.btnList.map((function(t,i){t.isrender&&e.renderInspectInfo(t.iconId,t)}))),this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color,n.btnList.map((function(t,i){t.isrender&&e.renderHeader(t.iconId,t)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a.color,a.btnList.map((function(t,i){t.isrender&&e.renderFooter(t.iconId,t)}))),this.inspectMapWin=new Ke(this.jSPlugin),this.inspectSmallWin=new ct(this.jSPlugin,this.inspectMode,this.inspectMapWin,this.changeInspectMode,this.decoderState)}},{key:"renderThemeData",value:function(){var e=this,t=this.decoderState.state.isEditing,i=this.themeData,n=i.inspectInfo,a=i.header,r=i.footer;if(this.isNeedRenderInspectInfo&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=n.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=n.color.replace("-diy",""),n.btnList.map((function(t,i){t.isrender&&e.setDecoderState(l({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderHeader&&a&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=a.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=a.color.replace("-diy",""),a.btnList&&a.btnList.map((function(t,i){t.isrender&&e.setDecoderState(l({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&r)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=r.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=r.color.replace("-diy",""),r.btnList.map((function(i,n){if(i.isrender&&e.setDecoderState(l({},i.iconId,e.decoderState.state[i.iconId])),0==n&&!e.themeInited&&e.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),1!=e.themeData.customConfig.bellPoster||t?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),this.setDecoderState({cloudRec:"cloud.rec"===P(this.jSPlugin.url).type,rec:"rec"===P(this.jSPlugin.url).type,type:P(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!t?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var s=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(s),e.reSizeVideo(e.videoWidth,e.videoHeight))}),50);this.jSPlugin.Zoom||(this.jSPlugin.Zoom=new Pe(this.jSPlugin)),this.getInspectDevInfo(this.jSPlugin,!0,!1)}},{key:"getInspectRecord",value:function(){var e=this;!function(e,t,i){var n={accessToken:e.accessToken,deviceSerial:P(e.url).deviceSerial},a="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/detail/latest");Ee(a,"GET",n,(function(e){t&&t(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(this.jSPlugin,(function(t){if(200==t.meta.code&&t.data){var i=t.data;i.inspectRange&&e.inspectMapWin.createPolygon(i.inspectRange,"#407AFF","dashed",4,1,"#407AFF",.08),i.inspectPoints&&i.inspectPoints.length>0&&e.inspectMapWin.createInspectPoints(i.inspectPoints),"video"===e.inspectMode&&e.inspectMapWin.map.removeOverlay(e.inspectMapWin.inspectRange),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectName"))&&i.inspectName&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectName")).innerText=""+i.inspectName),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectBeginTime"))&&i.beginTime&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectBeginTime")).innerText="巡检开始时间:"+i.beginTime),document.getElementById("".concat(e.jSPlugin.id,"-header-inspectTime"))&&e.timer.createInterval("InspectTimer",(function(){document.getElementById("".concat(e.jSPlugin.id,"-header-inspectTime")).innerHTML=e.renderInspectTime(i.beginTime)}),1e3),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectPerson"))&&i.inspectPerson&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectPerson")).innerText="本地巡检员:"+i.inspectPerson),e.inspectInfo=i,i.inspectRecordId&&at(e.jSPlugin,i.inspectRecordId,(function(t){200==t.meta.code&&t.data&&(e.inspectMapWin.createTrack(t.data,!0),e.timer.createInterval("TraceTimer",(function(){i.inspectRecordId&&at(e.jSPlugin,i.inspectRecordId,(function(t){200==t.meta.code&&t.data&&e.inspectMapWin.createTrack(t.data,!1)}),(function(){}))}),5e3))}),(function(){})),e.InspectEvent=new lt(e.jSPlugin,i.inspectRecordId,e.timer)}}),(function(e){}))}},{key:"getInspectDevInfo",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!function(e,t,i){var n={accessToken:e.accessToken,deviceSerial:P(e.url).deviceSerial},a="".concat(e.env.domain,"/api/service/devicekit/bodycamera");Ee(a,"GET",n,(function(e){t&&t(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e,(function(a){a.meta&&200==a.meta.code&&a.data?1===a.data.status?(n&&!t.decoderState.state.play&&(t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),t.jSPlugin.play()),t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-global-box"),!1),document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName")).innerText="".concat(a.data.deviceName,"(").concat(a.data.deviceSerial,")"),document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName")).setAttribute("title","".concat(a.data.deviceName,"(").concat(a.data.deviceSerial,")"))),document.getElementById("".concat(t.jSPlugin.id,"-header-signalType"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-signalType")).innerHTML=t.renderSignalType(a.data.signalType)),document.getElementById("".concat(t.jSPlugin.id,"-header-batteryStatus"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-batteryStatus")).innerHTML=t.renderBatteryStatus(a.data.batteryStatus)),t.timer.createInterval("InspectDevInfoTimer",(function(){t.getInspectDevInfo(e,!1,!1)}),3e5),i&&t.getInspectRecord()):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"当前设备未在巡检中",refreshBtn:"刷新",refreshShow:!0},(function(){t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-no-inspect-box"),!1),t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!0),t.getInspectDevInfo(e,!0,!0)}))):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:a.meta.message,refreshShow:!1}))}),(function(){t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-global-box"),!1)}))}},{key:"fetchThemeData",value:function(e){var t=this;Ie(this.jSPlugin,e,(function(e){if(0!==e.meta.code||!e.data)return t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),"111021"==e.meta.code?(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"无效的模板id",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="无效的模板id")):"111023"==e.meta.code?(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"您的试用特权已到期,需前往轻应用控制台购买后使用。",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="试用特权已到期")):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"模板未激活,请先在开放平台轻应用控制台购买模板",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="模板未激活"));t.activeThemeStatus=!0,t.themeData=e.data,t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)}),(function(){t.themeData=dt,t.themeData.header&&(t.themeData.header.btnList=t.themeData.header.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.themeData.footer&&(t.themeData.footer.btnList=t.themeData.footer.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.initThemeData(),t.renderThemeData()}))}},{key:"reSizeVideo",value:function(e,t){if(document.getElementById("".concat(this.jSPlugin.id)).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id)).style.height=t+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin.JS_Resize(e,t);else{document.getElementById("".concat(this.jSPlugin.id,"-player"))&&(document.getElementById("".concat(this.jSPlugin.id,"-player")).width=e,document.getElementById("".concat(this.jSPlugin.id,"-player")).height=t,document.getElementById("".concat(this.jSPlugin.id,"-player")).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id,"-player")).style.height=t+"px",document.getElementById("".concat(this.jSPlugin.id,"-container-0")).style.height=t+"px");var i=1;if(document.getElementById("".concat(this.jSPlugin.id,"canvas0")))navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)&&(i=2),document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.width=e*i+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.height=t*i+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).width=e*i,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).height=t*i,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.width=e*i+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.height=t*i+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).height=t*i}}},{key:"reSize",value:function(e,t){var i=.3333*e,n=.3333*t;document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.width=e+this.jSPlugin.inspectVideoWidth+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.width=e+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.width=e+"px"),"video"===this.jSPlugin.Theme.inspectMode?(this.reSizeVideo(e,t),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=0),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=i+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=n+"px"):(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=t+"px"),this.reSizeVideo(i,n),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=t+"px"),document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.bottom=n/2+96-30+"px",document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.right=this.jSPlugin.inspectVideoWidth+i+"px"}}]),e}(),xt=function(){function e(t){var i=this;if(r(this,e),l(this,"changeInspectMode",(function(e){i.inspectMode=e})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.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,rejection:!1,cloudRec:"cloud.rec"===P(t.url).type,rec:"rec"===P(t.url).type,type:P(t.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!==t.isMobile&&(this.isMobile=t.isMobile),this.themeData=dt,"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.timer||(this.timer=new qe(t)),this.jSPlugin.themeId)if(this.isMobile||(this.inspect=new ft(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 ue(this.jSPlugin)),p("".concat(this.jSPlugin.staticPath,"/css/theme.css")),p("".concat(this.jSPlugin.staticPath,"/css/component.css")),p("".concat(this.jSPlugin.staticPath,"/css/inspectTheme.css"))}return s(e,[{key:"setDecoderState",value:function(e,t){var i=this,n="#FFFFFF",a="#1890FF";Object.keys(e).map((function(t){switch(t){case"talk":document.getElementById("".concat(i.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(i.jSPlugin.id,"-talk")).className=e[t]?"active":"",document.getElementById("".concat(i.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[t]?a:n,document.getElementById("".concat(i.jSPlugin.id,"-talk-content")).childNodes[2].style.color=e[t]?a:n);break;case"sound":document.getElementById("".concat(i.jSPlugin.id,"-sound"))&&(e[t]?(document.getElementById("".concat(i.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(i.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(i.jSPlugin.id,"-sound")).className=e[t]?"active":"",document.getElementById("".concat(i.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[t]?a:n,document.getElementById("".concat(i.jSPlugin.id,"-sound-label")).style.color=e[t]?a:n):(document.getElementById("".concat(i.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(i.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(i.jSPlugin.id,"-sound")).className=e[t]?"active":"",document.getElementById("".concat(i.jSPlugin.id,"-sound-label")).style.color=e[t]?a:n))}i.decoderState.state=Object.assign(i.decoderState.state,e)}))}},{key:"setDisabled",value:function(e){var t=this.decoderState.state,i=t.sound;t.hd,null!=document.getElementById("".concat(this.jSPlugin.id,i?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,i?"-sound-icon":"-nosound-icon")).setAttribute("style",e?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-sound-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-sound-label")).setAttribute("style",e?"cursor: not-allowed; color: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",e?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-label")).setAttribute("style",e?"cursor: not-allowed; color: gray":"cursor: default")}},{key:"inspectEnding",value:function(){var e=document.createElement("div");e.id="".concat(this.jSPlugin.id,"-inspect-ending-box"),e.style="width:100%; position: absolute; z-index: 10000;  top:58px; bottom:0; left:0; background: #ffffff;",e.innerHTML='<div style="\n      overflow: auto;\n      box-sizing: border-box;\n      font-size: 14px;\n      color: #595959;\n      text-align: center;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      height: 100%;\n    ">\n      <div>\n        <div style="text-align:center; height: 21px;">\n          <svg t="1689074472491" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7172" xmlns:xlink="http://www.w3.org/1999/xlink" width="21" height="21"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z" fill="#FF4D4F" p-id="7173"></path></svg>\n        </div>\n        <div style="color: #595959; font-size:14px; margin: 5px 0 16px;font-weight: 400; text-align: center;">巡检已结束</div>\n      </div>\n    </div>\n    ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(e),this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom()}}]),e}(),pt=function(){function e(){r(this,e),this.events={}}return s(e,[{key:"on",value:function(e,t){e&&t&&(this.events[e]=this.events[e]||[],this.events[e].push(t))}},{key:"emit",value:function(e,t){e&&this.events[e]&&this.events[e].forEach((function(e){return e(t)}))}},{key:"off",value:function(e,t){e&&t&&this.events[e]&&this.events[e].splice(this.events[e].indexOf(t),1)}},{key:"once",value:function(e,t){var i=this;this.on(e,(function n(){var a=Array.prototype.slice.call(arguments);t.apply(null,a),i.off(e,n)}))}},{key:"removeAllListener",value:function(){this.events={}}}]),e}();!function(e,t){"object"===("undefined"==typeof module?"undefined":a(module))&&"object"===a(module.exports)?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("EZUIPlayer requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:void 0,(function(e,t){function i(e,t){for(var i=document.getElementsByTagName("head")[0].getElementsByTagName("script"),n=!1,a=0;a<i.length;a++)i[a].getAttribute("src")==e&&(n=!0,t());if(!n){var r=document.createElement("script");r.setAttribute("src",e),r.onload=t,document.getElementsByTagName("head")[0].appendChild(r)}}function n(e,t,i,n,a,r){var o=e,s=new XMLHttpRequest;s.onreadystatechange=function(){if(4==s.readyState&&200==s.status){var e=JSON.parse(s.responseText);a(e)}},s.open(t,o,!0);var l=new FormData;for(var c in i)l.append(c,i[c]);s.send(l)}var r={EZUIKitPlayer:void 0,EZUIKitTalk:void 0,opt:{apiDomain:"https://open.ys7.com/api/lapp/live/talk/url",filePath:"https://open.ys7.com/assets/ezuikit_v2.6.4",accessToken:"",url:"",deviceSerial:"",channelNo:"",id:"",talkLink:"",rtcUrl:"",ttsUrl:"",stream:"",isReliesReady:!1,template:"simple",plugin:[],audio:1,autoplay:1,videoLoading:!1},state:l(l(l(l({countTimer:void 0,recodeTime:0,recodeTimer:void 0},"recodeTime",0),"fetchDefaultList",!1),"page",0),"pageSize",5),handleTalkSuccess:function(){},handleTalkError:function(){}},o="https://open.ys7.com",s=o,c=function(t){var l=this;this.opt={id:t.id,apiDomain:o+"/api/lapp/live/talk/url",filePath:s+"/assets/ezuikit_v2.6.4",decoderVersion:"",accessToken:"",url:"",deviceSerial:"",channelNo:"",talkLink:"",rtcUrl:"",ttsUrl:"",stream:"",isReliesReady:!1,template:"simple",plugin:[],audio:1,autoplay:1,fullScreenStatus:0,bSupporDoubleClickFull:!0,videoLoading:!1},this.params=t,t.id&&(this.opt.id=t.id),t.accessToken&&(this.opt.accessToken=t.accessToken),void 0!==t.audio&&(this.opt.audio=t.audio),void 0!==t.decoderVersion&&(this.opt.decoderVersion=t.decoderVersion),void 0!==t.env&&(void 0!==t.env.domain&&(o=t.env.domain,this.opt.apiDomain=o+"/api/lapp/live/talk/url"),void 0!==t.env.filePathDomain&&(s=t.env.filePathDomain,this.opt.filePathDomain=t.env.filePathDomain)),t.url&&(this.opt.url=t.url,this.opt.deviceSerial=t.url.split("/")[3],this.opt.channelNo=t.url.split("/")[4].split(".")[0]),void 0!==t.template&&(this.opt.template=t.template),t.plugin&&(this.opt.plugin=t.plugin),void 0!==t.autoplay&&(this.opt.autoplay=t.autoplay?1:0),void 0!==t.bSupporDoubleClickFull&&(this.opt.bSupporDoubleClickFull=t.bSupporDoubleClickFull),void 0!==t.handleTalkSuccess&&(e.EZUIKit.handleTalkSuccess=t.handleTalkSuccess),void 0!==t.handleTalkError&&(e.EZUIKit.handleTalkError=t.handleTalkError);var c=this.opt.id,d=document.getElementById(c);d.style.fontSize=0,d.style.overflowY="auto",d.style.position="relative";var u=document.createElement("iframe");u.src=function(){switch(l.opt.template){case"simple":var e=o+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+l.opt.url.replace("?","&")+"&autoplay="+l.opt.autoplay+"&audio="+l.opt.audio+"&accessToken="+t.accessToken+"&templete=0&id="+c+"&decoderVersion="+l.opt.decoderVersion;return void 0!==t.controls&&t.controls&&(console.log("typeof",a(t.controls)),"play,voice,hd,fullScreen",t.controls.length>0&&(e+="&controls="+t.controls.join(","))),t.websocketParams&&(e+="&websocketParams="+JSON.stringify(t.websocketParams)),e;case"standard":return o+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+l.opt.url.replace("?","&")+"&autoplay="+l.opt.autoplay+"&audio="+l.opt.audio+"&accessToken="+t.accessToken+"&templete=1&id="+c+"&decoderVersion="+l.opt.decoderVersion;case"security":return o+"/ezopen/h5/iframe_se?bSupporDoubleClickFull=0&url="+l.opt.url.replace("?","&")+"&autoplay="+l.opt.autoplay+"&audio="+l.opt.audio+"&accessToken="+t.accessToken+"&templete=0&id="+c+"&decoderVersion="+l.opt.decoderVersion;case"theme":return e=o+"/jssdk/theme.html?url=".concat(t.url,"&accessToken=").concat(t.accessToken,"&id=").concat(c,"&isMobile=").concat(t.isMobile),void 0!==t.isMobile&&(e+="&isMobile="+t.isMobile),void 0!==t.autoplay&&(e+="&autoplay="+t.autoplay),void 0!==t.domain&&"https://test12open.ys7.com"==t.domain&&(e+="&env=test12"),void 0!==t.env&&void 0!==t.env.domain&&"https://test12open.ys7.com"==t.env.domain&&(e+="&env=test12"),void 0!==t.header&&(e+="&header="+t.header),e;default:return o+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+l.opt.url.replace("?","&")+"&autoplay="+l.opt.autoplay+"&audio="+l.opt.audio+"&accessToken="+t.accessToken+"&templete=0&id="+c+"&decoderVersion="+l.opt.decoderVersion}}();var h=document.getElementById(c).offsetHeight,f=document.getElementById(c).offsetWidth;t.height&&(h=parseInt(t.height),/\%$/.test(t.height)&&(f=document.getElementById(c).offsetWidth*(parseInt(t.height)/100))),t.width&&(f=parseInt(t.width),/\%$/.test(t.width)&&(f=document.getElementById(c).offsetWidth*(parseInt(t.width)/100))),u.width=f,u.height=h,u.id="EZUIKitPlayer-"+c,u.setAttribute("allowfullscreen",!0),u.setAttribute("allow","autoplay"),u.setAttribute("frameborder",0),d.appendChild(u);var x=l.opt.filePath+"/js/jquery.js";i(x,(function(){i("https://open.ys7.com/assets/layer/layer.js",(function(){if(_().headerContainer){var a=document.createElement("div");a.setAttribute("class","panel-top");var s=document.createElement("div");if(s.setAttribute("class","contros"),a.appendChild(s),d.insertBefore(a,u),_().capturePictureModule){var c=document.createElement("span");c.innerHTML='<span title="截图"><svg id="capturePicture" title="截图" t="1578882764585" class="icon" viewBox="0 0 1024 1024" version="1.1"  xmlns="http://www.w3.org/2000/svg" p-id="5958" width="24" height="24">  <path    d="M887.296 315.904h-153.6c-51.2 0-68.096-102.4-119.296-102.4H392.704c-34.304 0-51.2 102.4-102.4 102.4h-153.6c-29.696 0-51.2 21.504-51.2 51.2v439.296c0 25.6 21.504 47.104 51.2 47.104h751.104c29.696 0 51.2-21.504 51.2-51.2v-435.2c-0.512-30.208-21.504-51.2-51.712-51.2zM512 768c-115.2 0-204.8-89.6-204.8-200.704s89.6-200.704 204.8-200.704 204.8 89.6 204.8 200.704-93.696 200.704-204.8 200.704z m247.296-354.304c-12.8 0-25.6-12.8-25.6-25.6s12.8-25.6 25.6-25.6 25.6 12.8 25.6 25.6c0 17.408-12.8 25.6-25.6 25.6zM256 264.704c0-8.704-8.704-16.896-16.896-16.896h-51.2c-8.704 0-16.896 8.704-16.896 16.896V281.6H256v-16.896z m256 148.992c-85.504 0-153.6 68.096-153.6 153.6s68.096 153.6 153.6 153.6 153.6-68.096 153.6-153.6-68.096-153.6-153.6-153.6z"    fill="#ffffff" p-id="5959"></path></svg></span>',c.onclick=function(){l.capturePicture()},s.appendChild(c)}if(console.log("matchHeaderOpt().saveModule",_().saveModule),_().saveModule){var h=document.createElement("span");h.innerHTML='<span title="开始录像">  <svg id="startSave" t="1578882716693" class="icon" viewBox="0 0 1024 1024" version="1.1"    xmlns="http://www.w3.org/2000/svg" p-id="3782" width="24" height="24">    <path      d="M915.2 729.6l-128-76.8c-25.6-12.8-44.8-32-44.8-51.2V435.2c0-25.6 19.2-38.4 44.8-51.2l128-76.8c25.6-12.8 44.8 0 44.8 19.2V704c0 32-19.2 38.4-44.8 25.6z m-332.8 89.6H96c-51.2 0-89.6-38.4-89.6-89.6V332.8c0-51.2 38.4-89.6 89.6-89.6h486.4c51.2 0 89.6 38.4 89.6 89.6v396.8c0 51.2-38.4 89.6-89.6 89.6zM192 364.8c-32 6.4-57.6 32-64 64-12.8 57.6 38.4 115.2 96 102.4 32-6.4 57.6-32 64-70.4 12.8-57.6-38.4-108.8-96-96z m0 0"      p-id="3783" fill="#ffffff"></path>  </svg></span>',h.onclick=function(){l.startSave(),document.getElementById("startSave").setAttribute("class","icon hide"),document.getElementById("stopSave").setAttribute("class","icon")},s.appendChild(h);var f=document.createElement("span");f.innerHTML='<span title="结束录像"> <svg id="stopSave" t="1578882716693" class="icon hide" viewBox="0 0 1024 1024" version="1.1"   xmlns="http://www.w3.org/2000/svg" p-id="3782" width="24" height="24">   <path     d="M915.2 729.6l-128-76.8c-25.6-12.8-44.8-32-44.8-51.2V435.2c0-25.6 19.2-38.4 44.8-51.2l128-76.8c25.6-12.8 44.8 0 44.8 19.2V704c0 32-19.2 38.4-44.8 25.6z m-332.8 89.6H96c-51.2 0-89.6-38.4-89.6-89.6V332.8c0-51.2 38.4-89.6 89.6-89.6h486.4c51.2 0 89.6 38.4 89.6 89.6v396.8c0 51.2-38.4 89.6-89.6 89.6zM192 364.8c-32 6.4-57.6 32-64 64-12.8 57.6 38.4 115.2 96 102.4 32-6.4 57.6-32 64-70.4 12.8-57.6-38.4-108.8-96-96z m0 0"     p-id="3783" fill="red"></path> </svg> </span>',f.onclick=function(){l.stopSave(),document.getElementById("stopSave").setAttribute("class","icon hide"),document.getElementById("startSave").setAttribute("class","icon")},s.appendChild(f)}if(_().zoomModule){var x=document.createElement("span");x.innerHTML='<span title="开启电子放大">  <svg id="enableZoom" t="1578882639834" class="icon" viewBox="0 0 1000 1000" version="1.1"    xmlns="http://www.w3.org/2000/svg" p-id="2227" width="24" height="24">    <path      d="M830.6119 441.1089c0-193.7756-157.0939-350.8641-350.8775-350.8641S128.8559 247.3333 128.8559 441.1089 285.9508 791.972 479.7344 791.972 830.6119 634.8845 830.6119 441.1089zM483.2821 710.4863c-146.7975 0-265.8187-118.9953-265.8187-265.8088S336.4847 178.8697 483.2821 178.8697s265.8197 118.9953 265.8197 265.8078S630.0796 710.4863 483.2821 710.4863zM770.6031 653.5739l-72.6417 75.9485 141.6917 160.1814 82.0737-90.0739L770.6031 653.5739zM527.5849 267.4727h-88.60655762279428v132.90489048425167H306.0690340253259v88.60292721534799h132.90933675248866v132.9038911617923h88.60655762279428V488.9794719180395h132.90933675248866v-88.60292721534799H527.5849284006089V267.4726535408993z"      p-id="2228" fill="#ffffff"></path>  </svg></span>',x.onclick=function(){l.enableZoom(),document.getElementById("enableZoom").setAttribute("class","icon hide"),document.getElementById("closeZoom").setAttribute("class","icon")},s.appendChild(x);var p=document.createElement("span");p.innerHTML='<span title="关闭电子放大">  <svg id="closeZoom" t="1578882639834" class="icon hide" viewBox="0 0 1000 1000" version="1.1"    xmlns="http://www.w3.org/2000/svg" p-id="2227" width="24" height="24">    <path      d="M830.6119 441.1089c0-193.7756-157.0939-350.8641-350.8775-350.8641S128.8559 247.3333 128.8559 441.1089 285.9508 791.972 479.7344 791.972 830.6119 634.8845 830.6119 441.1089zM483.2821 710.4863c-146.7975 0-265.8187-118.9953-265.8187-265.8088S336.4847 178.8697 483.2821 178.8697s265.8197 118.9953 265.8197 265.8078S630.0796 710.4863 483.2821 710.4863zM770.6031 653.5739l-72.6417 75.9485 141.6917 160.1814 82.0737-90.0739L770.6031 653.5739zM527.5849 267.4727h-88.60655762279428v132.90489048425167H306.0690340253259v88.60292721534799h132.90933675248866v132.9038911617923h88.60655762279428V488.9794719180395h132.90933675248866v-88.60292721534799H527.5849284006089V267.4726535408993z"      p-id="2228" fill="red"></path>  </svg></span>',p.onclick=function(){l.closeZoom(),document.getElementById("closeZoom").setAttribute("class","icon hide"),document.getElementById("enableZoom").setAttribute("class","icon")},s.appendChild(p)}}function m(){var e={footerContainer:!1,talkModule:!1,broadcastModule:!1,hdModule:!1,fullScreenModule:!1};switch(l.opt.template){case"simple":case"standard":var i;if(t.footer&&t.footer instanceof Array)e={footerContainer:!0,talkModule:-1!==(i=t.footer).indexOf("talk"),broadcastModule:-1!==i.indexOf("broadcast"),hdModule:-1!==i.indexOf("hd"),fullScreenModule:-1!==i.indexOf("fullScreen")};break;case"security":break;case"voice":e={footerContainer:!0,talkModule:!0,broadcastModule:!0,hdModule:!0,fullScreenModule:!0}}return e}function _(){var e={headerContainer:!1,capturePictureModule:!1,saveModule:!1,zoomModule:!1};switch(l.opt.template){case"simple":if(t.header&&t.header instanceof Array){var i=t.header;e={headerContainer:!0,capturePictureModule:-1!==i.indexOf("capturePicture"),saveModule:-1!==i.indexOf("save"),zoomModule:-1!==i.indexOf("zoom")}}break;case"standard":case"security":break;case"voice":e={headerContainer:!0,capturePictureModule:!0,saveModule:!0,zoomModule:!0}}return e}if(m().footerContainer||-1!==l.opt.plugin.indexOf("talk")){var g=l.opt.filePath+"/npm/css/recoder.css",v=l.opt.filePath+"/npm/js/recoder.js",y=l.opt.filePath+"/recorder.js";if(function(e,t){for(var i=document.getElementsByTagName("head")[0].getElementsByTagName("link"),n=!1,a=0;a<i.length;a++)i[a].getAttribute("href")==e&&(n=!0,t());if(!n){var r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,r.onload=t,document.getElementsByTagName("head")[0].appendChild(r)}}(g,(function(){})),i(v,(function(){i(y,(function(){}))})),-1!==l.opt.plugin.indexOf("talk")||m().talkModule){n(l.opt.apiDomain,"POST",{accessToken:l.opt.accessToken,deviceSerial:l.opt.deviceSerial,channelNo:l.opt.channelNo},0,(function(t){if(console.log("data",t),200==t.code){var n=t.data;if(n){var a=n.rtcUrl;-1===a.indexOf("ws")&&(a=a.replace("https","wss").replace("rtcgw","rtcgw-ws")),l.opt.rtcUrl=a,l.opt.ttsUrl="tts://"+n.ttsUrl;var o="talk://"+l.opt.deviceSerial+":0:"+l.opt.channelNo+":cas.ys7.com:6500";if(l.opt.talkLink=l.opt.ttsUrl+"/"+o,l.opt.stream=n.stream,console.log("_this.opt",l.opt),!l.opt.isReliesReady){var s=l.opt.filePath+"/npm/js/adapeter.js",c=l.opt.filePath+"/npm/js/janus.js",d=l.opt.filePath+"/npm/js/tts.js";console.log("加载jquery.js"),i(s,(function(){console.log("加载adapeter.js"),i(c,(function(){console.log("加载janus.js"),i(d,(function(){console.log("加载tts.js"),l.opt.isReliesReady=!0}))}))}))}if(!document.getElementById("audioleft")){var u=document.createElement("div");u.style.display="none",u.id="audioleft",document.body.appendChild(u)}if(!document.getElementById("audioright")){var h=document.createElement("div");h.style.display="none",h.id="audioright",document.body.appendChild(h)}}}r.opt=l.opt,e.EZUIKit&&(e.EZUIKit.opt=l.opt)}))}if(m().footerContainer){var S=function(e,t){if(clearInterval(r.state.countTimer),"add"===e){var i=t;r.state.countTimer=setInterval((function(){++i,document.getElementById("time-area").innerHTML=n(i)}),1e3)}else if("sub"===e){i=t;r.state.countTimer=setInterval((function(){i>0?(i--,document.getElementById("time-area").innerHTML=n(i)):(clearInterval(r.state.countTimer),r.state.countTimer=void 0,console.log("倒计时结束,开启声音"))}),1e3)}else"destory"===e&&(clearInterval(r.state.countTimer),r.state.countTimer=void 0,document.getElementById("time-area").innerHTML="00:00");function n(e){var t,i,n,a=parseInt(e),r=0,o=0;return a>59&&(r=parseInt(a/60),a=parseInt(a%60),r>59&&(o=parseInt(r/60),r=parseInt(r%60))),t=parseInt(a)>9?parseInt(a):"0"+parseInt(a),i=parseInt(r)>9?parseInt(r):"0"+parseInt(r),n=parseInt(o)>9?parseInt(o):"0"+parseInt(o),o>0?n+":"+i+":"+t:r>0?i+":"+t:"00:"+t}},b=document.createElement("div");if(b.setAttribute("class","audio-controls"),d.appendChild(b),m().hdModule||m().fullScreenModule){var P=document.createElement("div");if(P.setAttribute("class","contros"),b.appendChild(P),m().hdModule){var E=document.createElement("span");E.setAttribute("id","video-hd"),E.innerHTML=-1===l.opt.url.indexOf(".hd")?"标清":"高清",E.onclick=function(){if(l.opt.videoLoading)return layer.msg("视频加载中,请稍后"),!1;var e=l.stop();l.opt.videoLoading=!0,e.then((function(e){l.opt.videoLoading=!1,-1===l.opt.url.indexOf(".hd")?(l.opt.url=l.opt.url.replace(".live",".hd.live"),E.innerHTML=-1===l.opt.url.indexOf(".hd")?"标清":"高清"):(l.opt.url=l.opt.url.replace(".hd.live",".live"),E.innerHTML=-1===l.opt.url.indexOf(".hd")?"标清":"高清"),l.play(l.opt.url)})).catch((function(e){console.log("error",e)}))},P.appendChild(E)}if(m().fullScreenModule){var C=document.createElement("span");C.setAttribute("class","hide"),C.setAttribute("id","ezuikit-open-sound"),C.setAttribute("title","打开声音"),C.setAttribute("style","vertical-align: top;"),C.innerHTML='<svg t="1590476263239" class="icon" viewBox="0 0 1178 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2273" width="16" height="16"><path d="M665.6 51.2 665.6 51.2c-10.24-30.72-40.96-51.2-71.68-51.2-5.12 0-15.36 0-20.48 5.12l0 0L358.4 153.6 51.2 209.92l0 0C20.48 220.16 0 250.88 0 281.6 0 286.72 0 291.84 0 307.2l0 0 0 409.6 0 0c0 15.36 0 20.48 0 25.6 0 30.72 20.48 61.44 51.2 71.68l0 0L358.4 870.4l97.28 71.68 107.52 76.8 0 0c5.12 5.12 15.36 5.12 25.6 5.12 40.96 0 76.8-35.84 76.8-76.8 0-10.24 0-10.24 0-25.6l0 0L665.6 51.2zM563.2 870.4l-153.6-102.4-307.2-51.2L102.4 307.2l307.2-51.2 153.6-102.4L563.2 870.4z" p-id="2274" fill="#FF0000"></path><path d="M1049.6 537.6l112.64-112.64c20.48-20.48 20.48-56.32 0-76.8-20.48-20.48-56.32-20.48-76.8 0L972.8 460.8l-112.64-112.64c0 0 0 0 0 0-20.48-20.48-56.32-20.48-76.8 0 0 0 0 0 0 0-20.48 20.48-20.48 56.32 0 76.8l112.64 112.64-112.64 112.64c-20.48 20.48-20.48 56.32 0 76.8 20.48 20.48 56.32 20.48 76.8 0L972.8 614.4l112.64 112.64c20.48 20.48 56.32 20.48 76.8 0s20.48-56.32 0-76.8L1049.6 537.6z" p-id="2275" fill="#FF0000"></path></svg>',C.onclick=function(){l.openSound(0),C.setAttribute("class","hide"),T.setAttribute("class","")};var T=document.createElement("span");C.setAttribute("id","ezuikit-close-sound"),T.setAttribute("class","hide"),T.setAttribute("title","关闭声音"),T.setAttribute("style","vertical-align: top;"),T.innerHTML='<svg t="1590414410633" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20545" width="16" height="16"><path d="M840.533333 98.133333c-17.066667-17.066667-42.666667-17.066667-59.733333 0-17.066667 17.066667-17.066667 42.666667 0 59.733334C883.2 256 938.666667 392.533333 938.666667 533.333333c0 140.8-55.466667 277.333333-157.866667 375.466667-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 21.333333 12.8 29.866667 12.8 8.533333 0 21.333333-4.266667 29.866666-12.8 115.2-110.933333 183.466667-268.8 183.466667-435.2 0-166.4-68.266667-324.266667-183.466667-435.2zM571.733333 12.8c-17.066667-8.533333-34.133333-4.266667-46.933333 8.533333L281.6 256H42.666667c-25.6 0-42.666667 17.066667-42.666667 42.666667v426.666666c0 25.6 17.066667 42.666667 42.666667 42.666667h238.933333l243.2 234.666667c8.533333 8.533333 17.066667 12.8 29.866667 12.8 4.266667 0 12.8 0 17.066666-4.266667 17.066667-8.533333 25.6-21.333333 25.6-38.4V51.2c0-17.066667-8.533333-34.133333-25.6-38.4zM512 870.4l-183.466667-179.2c-8.533333-4.266667-17.066667-8.533333-29.866666-8.533333H85.333333V341.333333h213.333334c12.8 0 21.333333-4.266667 29.866666-12.8L512 153.6v716.8z" p-id="20546" fill="#ffffff"></path><path d="M759.466667 349.866667c-12.8-21.333333-38.4-25.6-59.733334-8.533334-21.333333 12.8-25.6 38.4-8.533333 59.733334 21.333333 29.866667 34.133333 76.8 34.133333 123.733333 0 46.933333-12.8 93.866667-34.133333 123.733333-12.8 21.333333-8.533333 46.933333 8.533333 59.733334 8.533333 4.266667 17.066667 8.533333 25.6 8.533333 12.8 0 25.6-4.266667 34.133334-17.066667 34.133333-46.933333 51.2-106.666667 51.2-174.933333 0-68.266667-17.066667-128-51.2-174.933333z" p-id="20547" fill="#ffffff"></path></svg>',T.onclick=function(){l.closeSound(0),C.setAttribute("class",""),T.setAttribute("class","hide")},P.appendChild(C),P.appendChild(T)}if(1==l.opt.audio?T.setAttribute("class",""):(C.setAttribute("class",""),l.closeSound(0)),m().fullScreenModule){var R=document.createElement("span");R.setAttribute("title","全屏"),R.setAttribute("style","vertical-align: top;"),R.innerHTML='<svg id="fullScreen" t="1578020167938" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5035" width="16" height="16"> <path d="M348.373333 625.706667l-128 128-64 64v-128a33.28 33.28 0 0 0-35.413333-35.413334A33.493333 33.493333 0 0 0 85.333333 689.706667v213.333333A33.706667 33.706667 0 0 0 120.96 938.666667h213.333333a35.626667 35.626667 0 0 0 0-71.04h-128l64-64 128-128a35.2 35.2 0 0 0-49.92-49.92zM206.293333 156.373333h128a33.28 33.28 0 0 0 35.413334-35.413333A33.493333 33.493333 0 0 0 334.293333 85.333333H113.706667c-7.04 0-14.08 7.04-21.333334 14.293334a26.026667 26.026667 0 0 0-7.04 21.333333v213.333333a33.493333 33.493333 0 0 0 35.626667 35.413334 33.28 33.28 0 0 0 35.413333-35.413334v-128l192 192a35.2 35.2 0 0 0 49.92-49.92zM903.04 85.333333h-213.333333a33.493333 33.493333 0 0 0-35.413334 35.626667 33.28 33.28 0 0 0 35.413334 35.413333h128l-64 64-128 128a35.2 35.2 0 0 0 49.92 49.92l128-128 64-64v128a35.626667 35.626667 0 0 0 71.04 0v-213.333333A33.706667 33.706667 0 0 0 903.04 85.333333zM903.04 654.293333a33.28 33.28 0 0 0-35.413333 35.413334v128l-64-64-128-128a35.2 35.2 0 0 0-49.92 49.92l128 128 64 64h-128a35.626667 35.626667 0 0 0 0 71.04h213.333333A33.706667 33.706667 0 0 0 938.666667 903.04v-213.333333a33.493333 33.493333 0 0 0-35.626667-35.413334z" p-id="5036" fill="#ffffff"></path></svg>',R.onclick=function(){l.fullScreen()},P.appendChild(R)}}if(m().talkModule){var w=document.createElement("div"),I=document.createElement("div");w.setAttribute("class","ptp-talk off"),w.innerHTML='<span title="对讲"><svg t="1581930496966" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"  p-id="1641" width="16" height="16">  <path    d="M715.648 647.872c-30.208-22.336-61.568 39.36-100.992 77.44-39.36 38.08-34.112 31.488-123.392-17.088S311.488 540.224 280 491.648C248.448 443.072 265.472 424.704 265.472 424.704s78.72-62.976 97.152-81.344c18.368-18.368 13.12-30.208 13.12-30.208l-128.64-190.144c-23.616-5.184-64.32 5.12-128.576 57.6C54.208 233.088 30.592 353.856 151.296 575.68c120.768 221.824 347.84 330.752 485.568 374.08 137.856 43.328 228.416-61.696 249.408-103.68 21.056-41.984 13.12-85.312 13.12-85.312S745.856 670.208 715.648 647.872z"    p-id="1642" fill="#ffffff"></path>  <path    d="M715.328 64C580.992 64 472.192 172.864 472.192 307.2s108.8 243.2 243.136 243.2 243.2-108.864 243.2-243.2S849.6 64 715.328 64zM715.328 461.056c-84.992 0-153.856-68.864-153.856-153.856s68.864-153.856 153.856-153.856 153.856 68.928 153.856 153.856S800.32 461.056 715.328 461.056z"    p-id="1643" fill="#ffffff"></path>  <path    d="M777.472 277.376c-18.176 0-32.96-14.784-32.96-33.024 0-8.448 3.136-16.064 8.32-21.888-11.52-5.12-24.128-8-37.568-8-51.2 0-92.672 41.472-92.672 92.736s41.472 92.736 92.672 92.736S808.064 358.4 808.064 307.2c0-13.696-3.072-26.688-8.384-38.4C793.728 274.112 786.048 277.376 777.472 277.376zM715.328 340.928c-18.624 0-33.664-15.104-33.664-33.728 0-18.624 15.04-33.728 33.664-33.728 18.688 0 33.728 15.104 33.728 33.728C749.056 325.824 734.016 340.928 715.328 340.928z"    p-id="1644" fill="#ffffff"></path> </svg> </span> <span>开启对讲</span>',w.onclick=function(){if(console.log("EZUIKit.state.countTimer",r.state.countTimer),r.state.countTimer)return e.layer.msg("语音设备正忙,请稍后重试"),!1;S("add",0),console.log("开始对讲,关闭声音"),l.closeSound(0),console.log(l.opt),l.startTalk(),this.setAttribute("class","ptp-talk off hide"),I.setAttribute("class","ptp-talk on")},I.setAttribute("class","ptp-talk on hide"),I.innerHTML='<span title="对讲"> <svg t="1581930496966" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"    p-id="1641" width="16" height="16">    <path      d="M715.648 647.872c-30.208-22.336-61.568 39.36-100.992 77.44-39.36 38.08-34.112 31.488-123.392-17.088S311.488 540.224 280 491.648C248.448 443.072 265.472 424.704 265.472 424.704s78.72-62.976 97.152-81.344c18.368-18.368 13.12-30.208 13.12-30.208l-128.64-190.144c-23.616-5.184-64.32 5.12-128.576 57.6C54.208 233.088 30.592 353.856 151.296 575.68c120.768 221.824 347.84 330.752 485.568 374.08 137.856 43.328 228.416-61.696 249.408-103.68 21.056-41.984 13.12-85.312 13.12-85.312S745.856 670.208 715.648 647.872z"      p-id="1642" fill="#ff0000"></path>    <path      d="M715.328 64C580.992 64 472.192 172.864 472.192 307.2s108.8 243.2 243.136 243.2 243.2-108.864 243.2-243.2S849.6 64 715.328 64zM715.328 461.056c-84.992 0-153.856-68.864-153.856-153.856s68.864-153.856 153.856-153.856 153.856 68.928 153.856 153.856S800.32 461.056 715.328 461.056z"      p-id="1643" fill="#ff0000"></path>    <path      d="M777.472 277.376c-18.176 0-32.96-14.784-32.96-33.024 0-8.448 3.136-16.064 8.32-21.888-11.52-5.12-24.128-8-37.568-8-51.2 0-92.672 41.472-92.672 92.736s41.472 92.736 92.672 92.736S808.064 358.4 808.064 307.2c0-13.696-3.072-26.688-8.384-38.4C793.728 274.112 786.048 277.376 777.472 277.376zM715.328 340.928c-18.624 0-33.664-15.104-33.664-33.728 0-18.624 15.04-33.728 33.664-33.728 18.688 0 33.728 15.104 33.728 33.728C749.056 325.824 734.016 340.928 715.328 340.928z"      p-id="1644" fill="#ff0000"></path>  </svg> </span><span>关闭对讲</span>',I.onclick=function(){console.log(l.opt),l.stopTalk(),S("destory",0),l.openSound(0),this.setAttribute("class","ptp-talk on hide"),w.setAttribute("class","ptp-talk off")},b.appendChild(w),b.appendChild(I)}if(m().broadcastModule){var D=function e(t){n(o+"/api/lapp/voice/query","POST",{accessToken:l.opt.accessToken,pageStart:t,pageSize:r.state.pageSize,default:r.state.fetchDefaultList?"true":"false"},0,(function(i){console.log("data",i),200==i.code&&(k(i.data,5),r.state.page=i.page.page,0!=t||0!=i.data.length||r.state.fetchDefaultList||(r.state.fetchDefaultList=!0,e(0)))}))},k=function(e){if(console.log("renderVoliceList",e),e&&e.length>0){for(var t=0;t<e.length;t++){var i=document.createElement("li");i.innerHTML="<li class='voice-item' id='voice-item-"+t+"' data-time="+(e[t].duration||20)+" data-url="+e[t].fileUrl+">"+(e[t].voiceName.length>10?e[t].voiceName.substr(0,10)+"...":e[t].voiceName)+"</li>",document.getElementsByClassName("voice-list-ul")[0].append(i),i.onclick=function(e){console.log("点击元素",e.target,e.target.dataset.url);var t=e.target.dataset.url,i=e.target.dataset.time;F(t,i)}}e.length===r.state.pageSize?document.getElementById("voice-list-end").innerHTML="向下滚动加载更多":document.getElementById("voice-list-end").innerHTML="没有更多数据了"}},F=function(t,i){console.log("播放语音",t,i),n(o+"/api/lapp/voice/send","POST",{accessToken:l.opt.accessToken,deviceSerial:l.opt.deviceSerial,channelNo:l.opt.channelNo,fileUrl:t},0,(function(t){console.log("data.data",t.data),200==t.code?S("sub",parseInt(i)):"10001"==t.code?e.layer.msg("未找到当前语音"):e.layer.msg(t.msg||"发送失败,请稍后再试")}))},A=document.createElement("div"),M=document.createElement("div");A.setAttribute("class","broadcast off"),M.setAttribute("class","broadcast on hide"),A.innerHTML=' <span title="语音播报">  <svg t="1583561695846" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"    p-id="1126" width="16" height="16">    <path      d="M513.82044445 964.38044445c-8.192 0-15.47377778-2.73066667-21.84533334-8.192 0 0-46.42133333-41.87022222-99.21422222-86.47111112-89.20177778-73.728-117.41866667-88.29155555-123.79022222-90.112H35.04355555c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666666V271.70133333c0-14.56355555 11.83288889-27.30666667 26.39644444-27.30666666H246.21511111c7.28177778-2.73066667 37.31911111-15.47377778 137.44355556-91.02222222 58.25422222-43.69066667 111.04711111-86.47111111 111.04711111-86.47111112 5.46133333-4.55111111 12.74311111-7.28177778 20.02488889-7.28177778 4.55111111 0 10.01244445 0.91022222 14.56355555 3.6408889 10.92266667 5.46133333 18.20444445 17.29422222 18.20444445 30.03733333v837.40444444c0 12.74311111-7.28177778 25.48622222-19.11466667 30.94755556-5.46133333 1.82044445-10.01244445 2.73066667-14.56355555 2.73066667zM270.79111111 724.992c19.11466667 0 48.24177778 8.192 167.48088889 106.496 16.384 13.65333333 33.67822222 28.21688889 51.88266667 43.69066667l5.46133333 4.55111111V139.71911111l-5.46133333 3.64088889c-22.75555555 17.29422222-44.60088889 34.58844445-65.536 50.06222222C293.54666667 291.72622222 264.41955555 299.008 245.30488889 299.008H82.37511111c-20.02488889 0-21.84533333 12.74311111-21.84533333 26.39644445V694.04444445c0 23.66577778 6.37155555 30.03733333 28.21688889 30.03733333h180.224l1.82044444 0.91022222z m520.64711111 162.01955555c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666666 0-11.83288889 8.192-20.02488889 16.384-24.576 112.86755555-67.35644445 182.04444445-191.14666667 182.04444444-324.03911111 0-132.89244445-70.08711111-256.68266667-182.04444444-324.03911111-10.01244445-5.46133333-15.47377778-14.56355555-15.47377778-24.576 0-14.56355555 11.83288889-27.30666667 26.39644445-27.30666667 5.46133333 0 10.01244445 1.82044445 16.384 5.46133333 128.34133333 76.45866667 207.53066667 218.45333333 207.53066666 369.55022222 0 152.00711111-80.09955555 293.09155555-208.44088889 369.55022223-6.37155555 5.46133333-10.92266667 7.28177778-16.384 7.28177777z m-90.112-152.91733333c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666667 0-10.01244445 4.55111111-18.20444445 12.74311111-23.66577777 61.89511111-34.58844445 100.12444445-100.12444445 100.12444444-171.12177778 0-70.08711111-37.31911111-134.71288889-96.48355555-170.21155555-8.192-4.55111111-12.74311111-13.65333333-12.74311111-23.66577778 0-14.56355555 11.83288889-27.30666667 26.39644444-27.30666667 4.55111111 0 11.83288889 2.73066667 15.47377778 4.55111111 74.63822222 44.60088889 121.96977778 127.43111111 121.96977778 215.72266667 0 90.112-48.24177778 173.85244445-125.61066667 218.45333333-1.82044445 0-9.10222222 4.55111111-15.47377778 4.55111111z"      fill="#ffffff" p-id="1127"></path>  </svg></span><span>语音播报</span>',A.onclick=function(){this.setAttribute("class","broadcast off hide"),M.setAttribute("class","broadcast on")},M.innerHTML='<div class="pop-hover">  <div class="pop-hover-content">    <div class="vioce-list" id="voice-list">      <ul class="voice-list-ul">      </ul>      <div id="voice-list-end"></div>    </div>    <div id="voice-custom" style="text-align: center;">自定义语音</div>  </div></div><span title="语音播报">  <svg t="1583561695846" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"    p-id="1126" width="16" height="16">    <path      d="M513.82044445 964.38044445c-8.192 0-15.47377778-2.73066667-21.84533334-8.192 0 0-46.42133333-41.87022222-99.21422222-86.47111112-89.20177778-73.728-117.41866667-88.29155555-123.79022222-90.112H35.04355555c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666666V271.70133333c0-14.56355555 11.83288889-27.30666667 26.39644444-27.30666666H246.21511111c7.28177778-2.73066667 37.31911111-15.47377778 137.44355556-91.02222222 58.25422222-43.69066667 111.04711111-86.47111111 111.04711111-86.47111112 5.46133333-4.55111111 12.74311111-7.28177778 20.02488889-7.28177778 4.55111111 0 10.01244445 0.91022222 14.56355555 3.6408889 10.92266667 5.46133333 18.20444445 17.29422222 18.20444445 30.03733333v837.40444444c0 12.74311111-7.28177778 25.48622222-19.11466667 30.94755556-5.46133333 1.82044445-10.01244445 2.73066667-14.56355555 2.73066667zM270.79111111 724.992c19.11466667 0 48.24177778 8.192 167.48088889 106.496 16.384 13.65333333 33.67822222 28.21688889 51.88266667 43.69066667l5.46133333 4.55111111V139.71911111l-5.46133333 3.64088889c-22.75555555 17.29422222-44.60088889 34.58844445-65.536 50.06222222C293.54666667 291.72622222 264.41955555 299.008 245.30488889 299.008H82.37511111c-20.02488889 0-21.84533333 12.74311111-21.84533333 26.39644445V694.04444445c0 23.66577778 6.37155555 30.03733333 28.21688889 30.03733333h180.224l1.82044444 0.91022222z m520.64711111 162.01955555c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666666 0-11.83288889 8.192-20.02488889 16.384-24.576 112.86755555-67.35644445 182.04444445-191.14666667 182.04444444-324.03911111 0-132.89244445-70.08711111-256.68266667-182.04444444-324.03911111-10.01244445-5.46133333-15.47377778-14.56355555-15.47377778-24.576 0-14.56355555 11.83288889-27.30666667 26.39644445-27.30666667 5.46133333 0 10.01244445 1.82044445 16.384 5.46133333 128.34133333 76.45866667 207.53066667 218.45333333 207.53066666 369.55022222 0 152.00711111-80.09955555 293.09155555-208.44088889 369.55022223-6.37155555 5.46133333-10.92266667 7.28177778-16.384 7.28177777z m-90.112-152.91733333c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666667 0-10.01244445 4.55111111-18.20444445 12.74311111-23.66577777 61.89511111-34.58844445 100.12444445-100.12444445 100.12444444-171.12177778 0-70.08711111-37.31911111-134.71288889-96.48355555-170.21155555-8.192-4.55111111-12.74311111-13.65333333-12.74311111-23.66577778 0-14.56355555 11.83288889-27.30666667 26.39644444-27.30666667 4.55111111 0 11.83288889 2.73066667 15.47377778 4.55111111 74.63822222 44.60088889 121.96977778 127.43111111 121.96977778 215.72266667 0 90.112-48.24177778 173.85244445-125.61066667 218.45333333-1.82044445 0-9.10222222 4.55111111-15.47377778 4.55111111z"      fill="#ff0000" p-id="1127"></path>  </svg></span><span>语音播报</span>',M.onclick=function(){this.setAttribute("class","broadcast on hide"),A.setAttribute("class","broadcast off")},b.appendChild(A),b.appendChild(M),document.getElementById("voice-custom").onclick=function(){console.log("显示自定义语音"),L.setAttribute("class","speak off")},D(0);var L=document.createElement("div"),B=document.createElement("div");L.setAttribute("class","speak off hide"),B.setAttribute("class","speak on hide"),L.setAttribute("id","startSpeak"),B.setAttribute("id","stopSpeak"),L.innerHTML='<span title="按住说话">  <svg t="1581994757678" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"    p-id="1639" width="16" height="16">    <path      d="M757.059829 393.846154v-52.512821h262.564103v52.512821H757.059829z m-420.102564 481.367521v96.273504h175.042735a8.752137 8.752137 0 0 1 8.752137 8.752137v35.008547a8.752137 8.752137 0 0 1-8.752137 8.752137H109.401709a8.752137 8.752137 0 0 1-8.752136-8.752137v-35.008547a8.752137 8.752137 0 0 1 8.752136-8.752137h175.042735v-96.273504C129.767932 875.213675 4.376068 749.821812 4.376068 595.145299V463.863248a26.25641 26.25641 0 1 1 52.512821 0v113.777778c0 140.174222 113.637744 253.811966 253.811966 253.811965s253.811966-113.637744 253.811966-253.811965V463.863248a26.25641 26.25641 0 1 1 52.51282 0v131.282051c0 154.676513-125.391863 280.068376-280.068376 280.068376z m-26.25641-96.273504c-111.178393 0-201.299145-90.120752-201.299146-201.299145V201.299145C109.401709 90.120752 199.522462 0 310.700855 0s201.299145 90.120752 201.299145 201.299145v376.341881c0 111.178393-90.120752 201.299145-201.299145 201.299145z m691.418803-280.068376H757.059829v-52.512821h245.059829v52.512821z m-17.504273 105.025641H757.059829v-52.512821h227.555556v52.512821z m-17.504274 105.025641H757.059829v-52.512821h210.051282v52.512821z m-8.752137 105.025641H757.059829v-52.512821h201.299145v52.512821z m-17.504273 105.025641H757.059829v-52.512821h183.794872v52.512821z m-26.25641 105.025641H757.059829v-52.512821h157.538462v52.512821z"      p-id="1640" fill="#ffffff"></path>  </svg></span><span>按住说话</span>',B.innerHTML='<span title="按住说话"><svg t="1581994757678" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"  p-id="1639" width="16" height="16">  <path    d="M757.059829 393.846154v-52.512821h262.564103v52.512821H757.059829z m-420.102564 481.367521v96.273504h175.042735a8.752137 8.752137 0 0 1 8.752137 8.752137v35.008547a8.752137 8.752137 0 0 1-8.752137 8.752137H109.401709a8.752137 8.752137 0 0 1-8.752136-8.752137v-35.008547a8.752137 8.752137 0 0 1 8.752136-8.752137h175.042735v-96.273504C129.767932 875.213675 4.376068 749.821812 4.376068 595.145299V463.863248a26.25641 26.25641 0 1 1 52.512821 0v113.777778c0 140.174222 113.637744 253.811966 253.811966 253.811965s253.811966-113.637744 253.811966-253.811965V463.863248a26.25641 26.25641 0 1 1 52.51282 0v131.282051c0 154.676513-125.391863 280.068376-280.068376 280.068376z m-26.25641-96.273504c-111.178393 0-201.299145-90.120752-201.299146-201.299145V201.299145C109.401709 90.120752 199.522462 0 310.700855 0s201.299145 90.120752 201.299145 201.299145v376.341881c0 111.178393-90.120752 201.299145-201.299145 201.299145z m691.418803-280.068376H757.059829v-52.512821h245.059829v52.512821z m-17.504273 105.025641H757.059829v-52.512821h227.555556v52.512821z m-17.504274 105.025641H757.059829v-52.512821h210.051282v52.512821z m-8.752137 105.025641H757.059829v-52.512821h201.299145v52.512821z m-17.504273 105.025641H757.059829v-52.512821h183.794872v52.512821z m-26.25641 105.025641H757.059829v-52.512821h157.538462v52.512821z"    p-id="1640" fill="#ff0000"></path></svg></span><span>松开发送</span>',b.appendChild(L),b.appendChild(B),document.getElementById("voice-list").onscroll=function(e){var t=this.scrollHeight;console.log("sum",t,this.scrollTop,document.getElementById("voice-list").clientHeight),t<=this.scrollTop+this.clientHeight&&(console.log("拖动到底,执行加载",r.state.page),D(++r.state.page))};var O,j=document.createElement("div");j.setAttribute("class","time-area"),j.setAttribute("id","time-area"),j.innerHTML="00:00",b.appendChild(j),document.getElementById("startSpeak").onmousedown=function(){if(r.state.countTimer)return e.layer.msg("语音设备正忙,请稍后重试"),!1;var t;function i(i){var n=t.createMediaStreamSource(i);O=new e.Recorder(n)}console.log("按住说话"),L.setAttribute("class","speak off hide"),B.setAttribute("class","speak on"),function(){console.log("run init");try{e.AudioContext=e.AudioContext||e.webkitAudioContext,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia,e.URL=e.URL||e.webkitURL,t=new AudioContext,console.log("Audio context set up."),console.log("navigator.getUserMedia "+(navigator.getUserMedia?"available.":"not present!"))}catch(t){console.log("err",t),e.layer.msg("No web audio support in this browser!")}navigator.getUserMedia({audio:!0},i,(function(e){console.log("No live audio input: "+e)}))}(),S("add",0),setTimeout((function(){r.state.recodeTime=0,O&&O.record()}),1e3),r.state.recodeTimer&&clearInterval(r.state.recodeTimer),r.state.recodeTimer=setInterval((function(){r.state.recodeTime>=59?(l.stopTalk(),S("destory",0),this.setAttribute("class","ptp-talk on hide"),w.setAttribute("class","ptp-talk off"),e.layer.msg("不超过1分钟")):r.state.recodeTime=r.state.recodeTime+1}),1e3)},document.getElementById("stopSpeak").onmouseup=function(){console.log("松开发送"),B.setAttribute("class","speak on hide"),function(){if(S("destory",0),r.state.recodeTime<1)return e.layer.msg("说话时间过短"),clearInterval(r.state.recodeTimer),!1;clearInterval(r.state.recodeTimer),function(){try{O&&O.stop(),O&&O.exportWAV((function(t){if(console.log("wav_file",t),t.size<1e3)return e.layer.msg("录音失败,请重试"),r.state.recodeTime=0,!1;S("sub",r.state.recodeTime+2);var i=new FormData;function a(t){console.log("data.data",t.data),200==t.code?S("sub",r.state.recodeTime+2):"10001"==t.code?e.layer.msg("未找到当前语音"):e.layer.msg(t.msg||"发送失败,请稍后再试")}i.append("voiceFile",t),i.append("accessToken",l.opt.accessToken),i.append("deviceSerial",l.opt.deviceSerial),i.append("channelNo",l.opt.channelNo),n(o+"/api/lapp/voice/sendonce","POST",{voiceFile:t,accessToken:l.opt.accessToken,deviceSerial:l.opt.deviceSerial,channelNo:l.opt.channelNo},0,a)})),O&&O.clear()}catch(e){console.log(e)}}()}()}}}}}))}));l=this;function p(e){l.opt.fullScreenStatus=e?1:0,t.fullScreenChangeCallBack&&t.fullScreenChangeCallBack({data:e,id:l.opt.id})}e.addEventListener("message",(function(i){i.origin;var n=l.opt.id;if(i.data.type)switch(i.data.type){case"openSound":n==i.data.id&&t.openSoundCallBack&&t.openSoundCallBack(i.data);break;case"closeSound":n==i.data.id&&t.closeSoundCallBack&&t.closeSoundCallBack(i.data);break;case"capturePicture":n==i.data.id&&t.capturePictureCallBack&&t.capturePictureCallBack(i.data);break;case"startSave":n==i.data.id&&t.startSaveCallBack&&t.startSaveCallBack(i.data);break;case"stopSave":n==i.data.id&&t.stopSaveCallBack&&t.stopSaveCallBack(i.data);break;case"fullScreen":n==i.data.id&&t.fullScreenCallBack&&t.fullScreenCallBack(i.data);break;case"getOSDTime":n==i.data.id&&t.getOSDTimeCallBack&&t.getOSDTimeCallBack(i.data);break;case"handleSuccess":n==i.data.id&&t.handleSuccess&&t.handleSuccess(i.data);break;case"handleError":n==i.data.id&&t.handleError&&t.handleError(i.data);break;case"dblclick":n==i.data.id&&l.opt.bSupporDoubleClickFull&&(0===l.opt.fullScreenStatus?l.fullScreen():l.cancelFullScreen());break;case"startTalk":l.startTalk(),l.closeSound();break;case"stopTalk":l.stopTalk(),l.openSound();break;case"clickEventHandle":console.log("event.data",i.data),t.clickEventHandle&&t.clickEventHandle(i.data);break;case"removeEventHandle":t.removeEventHandle&&t.removeEventHandle(i.data);break;case"esc":t.clickEventHandle&&t.clickEventHandle(i.data);break;case"iframeFullScreen":if(n==i.data.id){!function(t){var i=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;if(i)i.call(t);else if(void 0!==e.ActiveXObject){var n=new ActiveXObject("WScript.Shell");null!==n&&n.SendKeys("{F11}")}}(document.getElementById("EZUIKitPlayer-"+i.data.id))}}})),void 0!==document.fullScreen?document.addEventListener("fullscreenchange",(function(){p(document.fullscreen||!1)})):void 0!==document.webkitIsFullScreen?document.addEventListener("webkitfullscreenchange",(function(){p(document.webkitIsFullScreen||!1)})):void 0!==document.mozFullScreen&&document.addEventListener("mozfullscreenchange",(function(){p(document.mozFullScreen||!1)}))};return c.prototype.play=function(t){var i="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(i).contentWindow;"object"===a(t)&&t.url&&(this.opt.url=t.url),"object"===a(t)&&t.accessToken&&(this.opt.accessToken=t.accessToken),"string"==typeof t&&(this.opt.url=t),n.postMessage({action:"play",accessToken:this.opt.accessToken,url:this.opt.url},o+"/ezopen/h5/iframe");var r=this;return this.opt.videoLoading=!0,new Promise((function(t,i){e.addEventListener("message",(function(e){r.opt.id==e.data.id&&"handleSuccess"===e.data.type&&(setTimeout((function(){r.opt.videoLoading=!1}),1e3),t(e.data))}))}))},c.prototype.stop=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("stop",o+"/ezopen/h5/iframe");var i=this;return new Promise((function(t,n){e.addEventListener("message",(function(e){i.opt.id==e.data.id&&"stop"===e.data.type&&t(e.data)}))}))},c.prototype.openSound=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("openSound",o+"/ezopen/h5/iframe");var i=this;return new Promise((function(t,n){e.addEventListener("message",(function(e){i.opt.id==e.data.id&&"openSound"===e.data.type&&t(e.data)}))}))},c.prototype.closeSound=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("closeSound",o+"/ezopen/h5/iframe");var i=this;return new Promise((function(t,n){e.addEventListener("message",(function(e){i.opt.id==e.data.id&&"closeSound"===e.data.type&&t(e.data)}))}))},c.prototype.startSave=function(t){var i="EZUIKitPlayer-"+this.opt.id;document.getElementById(i).contentWindow.postMessage({action:"startSave",fileName:t||"default"},o+"/ezopen/h5/iframe");var n=this;return new Promise((function(t,i){e.addEventListener("message",(function(e){n.opt.id==e.data.id&&"startSave"===e.data.type&&t(e.data)}))}))},c.prototype.stopSave=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("stopSave",o+"/ezopen/h5/iframe");var i=this;return new Promise((function(t,n){e.addEventListener("message",(function(e){i.opt.id==e.data.id&&"stopSave"===e.data.type&&t(e.data)}))}))},c.prototype.fullScreen=function(){if(1===this.opt.fullScreenStatus)return!1;var t="EZUIKitPlayer-"+this.opt.id,i=document.getElementById(t).contentWindow;if(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)){var n=document.documentElement.clientWidth,a=document.documentElement.clientHeight,r=(document.body,"");r+="width:"+a+"px;",r+="height:"+n+"px;",r+="-webkit-transform: rotate(90deg); transform: rotate(90deg);",r+="-webkit-transform-origin: "+n/2+"px "+n/2+"px;",r+="transform-origin: "+n/2+"px "+n/2+"px;",r+="position: fixed;top: 0;left: 0;z-index:10",document.getElementById(t).style.cssText=r,setTimeout((function(){i.postMessage("autoResize",o+"/ezopen/h5/iframe")}),500)}else{!function(t){var i=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;if(i)i.call(t);else if(void 0!==e.ActiveXObject){var n=new ActiveXObject("WScript.Shell");null!==n&&n.SendKeys("{F11}")}}(document.getElementById(t))}this.params.fullScreenCallBack&&this.params.fullScreenCallBack(this.opt.id),this.opt.fullScreenStatus=1},c.prototype.cancelFullScreen=function(){if(0===this.opt.fullScreenStatus)return!1;var e="EZUIKitPlayer-"+this.opt.id,t=document.getElementById(e).contentWindow;if(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)){var i=document.getElementById(e).width,n=document.getElementById(e).height,a=(document.body,"");a+="width:"+i+"px;",a+="height:"+n+"px;",a+="-webkit-transform: none; transform: none;",a+="-webkit-transform-origin: 0 0;",a+="transform-origin: 0 0;",document.getElementById(e).style.cssText=a,setTimeout((function(){t.postMessage("autoResize",o+"/ezopen/h5/iframe")}),500);var r=e+"cancel-full-screen",s=document.getElementById(r);s&&document.body.removeChild(s)}else document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen&&document.mozCancelFullScreen();this.params.cancelFullScreenCallBack&&this.params.cancelFullScreenCallBack(this.opt.id),this.opt.fullScreenStatus=0},c.prototype.capturePicture=function(t,i){var n="EZUIKitPlayer-"+this.opt.id;document.getElementById(n).contentWindow.postMessage({action:"capturePicture",fileName:t||"default",isUndownload:i},o+"/ezopen/h5/iframe");var a=this;return new Promise((function(t,i){e.addEventListener("message",(function(e){a.opt.id==e.data.id&&"capturePicture"===e.data.type&&t(e.data)}))}))},c.prototype.enableZoom=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("enableZoom",o+"/ezopen/h5/iframe")},c.prototype.closeZoom=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("closeZoom",o+"/ezopen/h5/iframe")},c.prototype.getOSDTime=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("getOSDTime",o+"/ezopen/h5/iframe");var i=this;return new Promise((function(t,n){e.addEventListener("message",(function(e){i.opt.id==e.data.id&&"getOSDTime"===e.data.type&&t(e.data)}))}))},c.prototype.autoResize=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("autoResize",o+"/ezopen/h5/iframe")},c.prototype.reSize=function(e,t){var i="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(i).contentWindow,a=document.getElementById(this.opt.id);a.style.width=e+"px",a.style.height=t+"px",document.getElementById(this.opt.id).style.width=e+"px",document.getElementById(this.opt.id).style.height=t+"px";var r=document.getElementById(i);r.setAttribute("width",e),r.setAttribute("height",t),r.style.width=e+"px",r.style.height=t+"px",setTimeout((function(){n.postMessage({action:"autoResize"},o+"/ezopen/h5/iframe")}),500)},c.prototype.startTalk=function(){console.log("执行开始对讲"),console.log(this.opt);var t=this;r.opt=this.opt,e.EZUIKit&&(e.EZUIKit.opt=this.opt);n(t.opt.apiDomain,"POST",{accessToken:t.opt.accessToken,deviceSerial:t.opt.deviceSerial,channelNo:t.opt.channelNo},0,(function(i){if(200==i.code){var n=i.data;if(n){var a=n.rtcUrl;-1===a.indexOf("ws")&&(a=a.replace("https","wss").replace("rtcgw","rtcgw-ws")),t.opt.rtcUrl=a,t.opt.ttsUrl="tts://"+n.ttsUrl;var r="talk://"+t.opt.deviceSerial+":0:"+t.opt.channelNo+":cas.ys7.com:6500";t.opt.talkLink=t.opt.ttsUrl+"/"+r,t.opt.stream=n.stream,e.startTalk()}}}))},c.prototype.stopTalk=function(){console.log("执行结束对讲"),e.stopTalk()},c.prototype.edit=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("edit",o+"/ezopen/h5/iframe")},c.prototype.btnReRender=function(e){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage({action:"btnReRender",data:e},o+"/ezopen/h5/iframe")},c.prototype.changePlayUrl=function(e){e.deviceSerial&&(this.opt.deviceSerial=e.deviceSerial),e.channelNo&&(this.opt.channelNo=e.channelNo),e.accessToken&&(this.opt.accessToken=e.accessToken);var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage({action:"changePlayUrl",data:e},o+"/ezopen/h5/iframe")},c.prototype.fetchThemeData=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage({action:"fetchThemeData"},o+"/ezopen/h5/iframe")},c.prototype.setThemeData=function(e,t,i){var n="EZUIKitPlayer-"+this.opt.id;document.getElementById(n).contentWindow.postMessage({action:"setThemeData",data:{accessToken:e,header:t,footer:i}},o+"/ezopen/h5/iframe")},r.EZUIKitPlayer=c,e.EZUIKitV3=r,r}));var mt=EZUIKitV3,_t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=void 0,a=void 0,r=void 0,o=[];return function(){var l=function(e){return"function"==typeof e?e():e}(t),c=(new Date).getTime(),d=!n||c-n>l;n=c;for(var u=arguments.length,h=Array(u),f=0;f<u;f++)h[f]=arguments[f];if(d&&i.leading)return i.accumulate?Promise.resolve(e.call(this,[h])).then((function(e){return e[0]})):Promise.resolve(e.call.apply(e,[this].concat(h)));if(a?clearTimeout(r):a=function(){var e={};return e.promise=new Promise((function(t,i){e.resolve=t,e.reject=i})),e}(),o.push(h),r=setTimeout(s.bind(this),l),i.accumulate){var x=o.length-1;return a.promise.then((function(e){return e[x]}))}return a.promise};function s(){var t=a;clearTimeout(r),Promise.resolve(i.accumulate?e.call(this,o):e.apply(this,o[o.length-1])).then(t.resolve,t.reject),o=[],a=null}};var gt=I(_t);function vt(e){document.getElementById("".concat(e,"-player"))&&document.getElementById("".concat(e,"-container-0")).removeChild(document.getElementById("".concat(e,"-player")))}
/*! formdata-polyfill. MIT License. Jimmy W?rting <https://jimmy.warting.se/opensource> */
!function(){var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var i="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,i){return e==Array.prototype||e==Object.prototype||(e[t]=i.value),e};var n,a=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof w&&w];for(var t=0;t<e.length;++t){var i=e[t];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")}(this);function r(e,t){if(t)e:{var n=a;e=e.split(".");for(var r=0;r<e.length-1;r++){var o=e[r];if(!(o in n))break e;n=n[o]}(t=t(r=n[e=e[e.length-1]]))!=r&&null!=t&&i(n,e,{configurable:!0,writable:!0,value:t})}}function o(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function s(e){var i="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return i?i.call(e):{next:t(e)}}if(r("Symbol",(function(e){function t(e,t){this.A=e,i(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.A};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",a=0;return function e(i){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(i||"")+"_"+a++,i)}})),r("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),r=0;r<n.length;r++){var s=a[n[r]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&i(s.prototype,e,{configurable:!0,writable:!0,value:function(){return o(t(this))}})}return e})),"function"==typeof Object.setPrototypeOf)n=Object.setPrototypeOf;else{var l;e:{var c={};try{c.__proto__={a:!0},l=c.a;break e}catch(e){}l=!1}n=l?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var d=n;function u(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function h(e){if(e.m)throw new TypeError("Generator is already running");e.m=!0}function f(e,t){return e.h=3,{value:t}}function x(e){this.g=new u,this.G=e}function p(e,t,i,n){try{var a=t.call(e.g.j,i);if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");if(!a.done)return e.g.m=!1,a;var r=a.value}catch(t){return e.g.j=null,e.g.s(t),m(e)}return e.g.j=null,n.call(e.g,r),m(e)}function m(e){for(;e.g.h;)try{var t=e.G(e.g);if(t)return e.g.m=!1,{value:t.value,done:!1}}catch(t){e.g.v=void 0,e.g.s(t)}if(e.g.m=!1,e.g.l){if(t=e.g.l,e.g.l=null,t.F)throw t.D;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function _(e){this.next=function(t){return e.o(t)},this.throw=function(t){return e.s(t)},this.return=function(t){return function(e,t){h(e.g);var i=e.g.j;return i?p(e,"return"in i?i.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),m(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function g(e,t){return t=new _(new x(t)),d&&e.prototype&&d(t,e.prototype),t}if(u.prototype.o=function(e){this.v=e},u.prototype.s=function(e){this.l={D:e,F:!0},this.h=this.C||this.u},u.prototype.return=function(e){this.l={return:e},this.h=this.u},x.prototype.o=function(e){return h(this.g),this.g.j?p(this,this.g.j.next,e,this.g.o):(this.g.o(e),m(this))},x.prototype.s=function(e){return h(this.g),this.g.j?p(this,this.g.j.throw,e,this.g.o):(this.g.s(e),m(this))},r("Array.prototype.entries",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var i=0,n=!1,a={next:function(){if(!n&&i<e.length){var a=i++;return{value:t(a,e[a]),done:!1}}return n=!0,{done:!0,value:void 0}}};return a[Symbol.iterator]=function(){return a},a}(this,(function(e,t){return[e,t]}))}})),"undefined"!=typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var v=function(e,t){for(var i=0;i<e.length;i++)t(e[i])},y=function(e){return e.replace(/\r?\n|\r/g,"\r\n")},S=function(e,t,i){return t instanceof Blob?(i=void 0!==i?String(i+""):"string"==typeof t.name?t.name:"blob",t.name===i&&"[object Blob]"!==Object.prototype.toString.call(t)||(t=new File([t],i)),[String(e),t]):[String(e),String(t)]},b=function(e,t){if(e.length<t)throw new TypeError(t+" argument required, but only "+e.length+" present.")},P="object"==typeof globalThis?globalThis:"object"==typeof window?window:"object"==typeof self?self:this,E=P.FormData,C=P.XMLHttpRequest&&P.XMLHttpRequest.prototype.send,T=P.Request&&P.fetch,R=P.navigator&&P.navigator.sendBeacon,I=P.Element&&P.Element.prototype,D=P.Symbol&&Symbol.toStringTag;D&&(Blob.prototype[D]||(Blob.prototype[D]="Blob"),"File"in P&&!File.prototype[D]&&(File.prototype[D]="File"));try{new File([],"")}catch(e){P.File=function(e,t,i){return e=new Blob(e,i||{}),Object.defineProperties(e,{name:{value:t},lastModified:{value:+(i&&void 0!==i.lastModified?new Date(i.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),D&&Object.defineProperty(e,D,{value:"File"}),e}}var k=function(e){return e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},F=function(e){this.i=[];var t=this;e&&v(e.elements,(function(e){if(e.name&&!e.disabled&&"submit"!==e.type&&"button"!==e.type&&!e.matches("form fieldset[disabled] *"))if("file"===e.type){var i=e.files&&e.files.length?e.files:[new File([],"",{type:"application/octet-stream"})];v(i,(function(i){t.append(e.name,i)}))}else"select-multiple"===e.type||"select-one"===e.type?v(e.options,(function(i){!i.disabled&&i.selected&&t.append(e.name,i.value)})):"checkbox"===e.type||"radio"===e.type?e.checked&&t.append(e.name,e.value):(i="textarea"===e.type?y(e.value):e.value,t.append(e.name,i))}))};if((e=F.prototype).append=function(e,t,i){b(arguments,2),this.i.push(S(e,t,i))},e.delete=function(e){b(arguments,1);var t=[];e=String(e),v(this.i,(function(i){i[0]!==e&&t.push(i)})),this.i=t},e.entries=function e(){var t,i=this;return g(e,(function(e){if(1==e.h&&(t=0),3!=e.h)return t<i.i.length?e=f(e,i.i[t]):(e.h=0,e=void 0),e;t++,e.h=2}))},e.forEach=function(e,t){b(arguments,1);for(var i=s(this),n=i.next();!n.done;n=i.next()){var a=s(n.value);n=a.next().value,a=a.next().value,e.call(t,a,n,this)}},e.get=function(e){b(arguments,1);var t=this.i;e=String(e);for(var i=0;i<t.length;i++)if(t[i][0]===e)return t[i][1];return null},e.getAll=function(e){b(arguments,1);var t=[];return e=String(e),v(this.i,(function(i){i[0]===e&&t.push(i[1])})),t},e.has=function(e){b(arguments,1),e=String(e);for(var t=0;t<this.i.length;t++)if(this.i[t][0]===e)return!0;return!1},e.keys=function e(){var t,i,n,a,r=this;return g(e,(function(e){if(1==e.h&&(t=s(r),i=t.next()),3!=e.h)return i.done?void(e.h=0):(n=i.value,a=s(n),f(e,a.next().value));i=t.next(),e.h=2}))},e.set=function(e,t,i){b(arguments,2),e=String(e);var n=[],a=S(e,t,i),r=!0;v(this.i,(function(t){t[0]===e?r&&(r=!n.push(a)):n.push(t)})),r&&n.push(a),this.i=n},e.values=function e(){var t,i,n,a,r=this;return g(e,(function(e){if(1==e.h&&(t=s(r),i=t.next()),3!=e.h)return i.done?void(e.h=0):(n=i.value,(a=s(n)).next(),f(e,a.next().value));i=t.next(),e.h=2}))},F.prototype._asNative=function(){for(var e=new E,t=s(this),i=t.next();!i.done;i=t.next()){var n=s(i.value);i=n.next().value,n=n.next().value,e.append(i,n)}return e},F.prototype._blob=function(){var e="----formdata-polyfill-"+Math.random(),t=[],i="--"+e+'\r\nContent-Disposition: form-data; name="';return this.forEach((function(e,n){return"string"==typeof e?t.push(i+k(y(n))+'"\r\n\r\n'+y(e)+"\r\n"):t.push(i+k(y(n))+'"; filename="'+k(e.name)+'"\r\nContent-Type: '+(e.type||"application/octet-stream")+"\r\n\r\n",e,"\r\n")})),t.push("--"+e+"--"),new Blob(t,{type:"multipart/form-data; boundary="+e})},F.prototype[Symbol.iterator]=function(){return this.entries()},F.prototype.toString=function(){return"[object FormData]"},I&&!I.matches&&(I.matches=I.matchesSelector||I.mozMatchesSelector||I.msMatchesSelector||I.oMatchesSelector||I.webkitMatchesSelector||function(e){for(var t=(e=(this.document||this.ownerDocument).querySelectorAll(e)).length;0<=--t&&e.item(t)!==this;);return-1<t}),D&&(F.prototype[D]="FormData"),C){var A=P.XMLHttpRequest.prototype.setRequestHeader;P.XMLHttpRequest.prototype.setRequestHeader=function(e,t){A.call(this,e,t),"content-type"===e.toLowerCase()&&(this.B=!0)},P.XMLHttpRequest.prototype.send=function(e){e instanceof F?(e=e._blob(),this.B||this.setRequestHeader("Content-Type",e.type),C.call(this,e)):C.call(this,e)}}T&&(P.fetch=function(e,t){return t&&t.body&&t.body instanceof F&&(t.body=t.body._blob()),T.call(this,e,t)}),R&&(P.navigator.sendBeacon=function(e,t){return t instanceof F&&(t=t._asNative()),R.call(this,e,t)}),P.FormData=F}}();var yt=["attribute vec4 vertexPos;","attribute vec2 texturePos;","varying vec2 textureCoord;","void main()","{","gl_Position = vertexPos;","textureCoord = texturePos;","}"].join("\n"),St=["precision highp float;","varying highp vec2 textureCoord;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","const mat4 YUV2RGB = mat4","(","1.1643828125, 0, 1.59602734375, -.87078515625,","1.1643828125, -.39176171875, -.81296875, .52959375,","1.1643828125, 2.017234375, 0, -1.081390625,","0, 0, 0, 1",");","void main(void) {","highp float y = texture2D(ySampler,  textureCoord).r;","highp float u = texture2D(uSampler,  textureCoord).r;","highp float v = texture2D(vSampler,  textureCoord).r;","gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;","}"].join("\n");window.SuperRender=function(){function e(e){this.canvasElement=document.getElementById(e),this.initContextGL(),this.contextGL&&(this.YUVProgram=this.initProgram(yt,St),this.initBuffers(),this.initTextures())}return e.prototype.initContextGL=function(){var e=this.canvasElement,t=null;try{t=e.getContext("webgl")||e.getContext("experimental-webgl")}catch(e){t=null}t&&"function"==typeof t.getParameter||(t=null),this.contextGL=t},e.prototype.initProgram=function(e,t){var i=this.contextGL,n=i.createShader(i.VERTEX_SHADER);i.shaderSource(n,e),i.compileShader(n),i.getShaderParameter(n,i.COMPILE_STATUS);var a=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(a,t),i.compileShader(a),i.getShaderParameter(a,i.COMPILE_STATUS);var r=i.createProgram();return i.attachShader(r,n),i.attachShader(r,a),i.linkProgram(r),i.getProgramParameter(r,i.LINK_STATUS),i.deleteShader(n),i.deleteShader(a),r},e.prototype.initBuffers=function(){var e=this.contextGL,t=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null);var i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),this.vertexPosBuffer=t,this.texturePosBuffer=i},e.prototype.initTexture=function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t},e.prototype.initTextures=function(){var e=this.contextGL,t=this.YUVProgram;e.useProgram(t);var i=this.initTexture(),n=e.getUniformLocation(t,"ySampler");e.uniform1i(n,0),this.yTextureRef=i;var a=this.initTexture(),r=e.getUniformLocation(t,"uSampler");e.uniform1i(r,1),this.uTextureRef=a;var o=this.initTexture(),s=e.getUniformLocation(t,"vSampler");e.uniform1i(s,2),this.vTextureRef=o,e.useProgram(null)},e.prototype.SR_DisplayFrameData=function(e,t,i,n,a){if(!(e<=0||t<=0)){var r=this.contextGL;if(null==i)return r.clearColor(0,0,0,0),void r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT);var o=this.canvasElement;this.nWindowWidth=o.width,this.nWindowHeight=o.height;var s=this.nWindowWidth,l=this.nWindowHeight;r.clearColor(.8,.8,1,1),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT),r.viewport(0,0,s,l),this.updateFrameData(e,t,i,n,a);var c=this.YUVProgram;r.useProgram(c);var d=this.vertexPosBuffer;r.bindBuffer(r.ARRAY_BUFFER,d);var u=r.getAttribLocation(c,"vertexPos");r.enableVertexAttribArray(u),r.vertexAttribPointer(u,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,null);var h=this.texturePosBuffer;r.bindBuffer(r.ARRAY_BUFFER,h);var f=r.getAttribLocation(c,"texturePos");r.enableVertexAttribArray(f),r.vertexAttribPointer(f,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,null),r.drawArrays(r.TRIANGLE_STRIP,0,4),r.disableVertexAttribArray(u),r.disableVertexAttribArray(f),r.useProgram(null)}},e.prototype.updateFrameData=function(e,t,i,n,a){var r=this.contextGL,o=this.yTextureRef,s=this.uTextureRef,l=this.vTextureRef,c=i;if(e==n&&t==a){var d=e*t,u=c.subarray(0,d);r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,e,t,0,r.LUMINANCE,r.UNSIGNED_BYTE,u);var h=e/2*t/2,f=c.subarray(e*t,e*t+h);r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,l),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,e/2,t/2,0,r.LUMINANCE,r.UNSIGNED_BYTE,f);var x=h,p=c.subarray(e*t+e*t/4,e*t+e*t/4+x);r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,s),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,e/2,t/2,0,r.LUMINANCE,r.UNSIGNED_BYTE,p)}else{d=n*a,u=new Uint8Array(d);for(var m=0;m<a;m++)for(var _=c.subarray(m*e,m*e+n),g=0;g<n;g++)u[m*n+g]=_[g];for(r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,n,a,0,r.LUMINANCE,r.UNSIGNED_BYTE,u),u=null,_=null,h=n/2*a/2,f=new Uint8Array(h),m=0;m<a/2;m++){var v=c.subarray(e*t+m*e/2,e*t+m*e/2+n/2);for(g=0;g<n/2;g++)f[m*n/2+g]=v[g]}for(r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,l),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,n/2,a/2,0,r.LUMINANCE,r.UNSIGNED_BYTE,f),f=null,v=null,x=h,p=new Uint8Array(x),m=0;m<a/2;m++){var y=c.subarray(e*t*5/4+m*e/2,e*t*5/4+m*e/2+n/2);for(g=0;g<n/2;g++)p[m*n/2+g]=y[g]}r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,s),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,n/2,a/2,0,r.LUMINANCE,r.UNSIGNED_BYTE,p),p=null,y=null}},e.prototype.SR_SetDisplayRect=function(e){var t=this.contextGL,i=this.nWindowWidth,n=this.nWindowHeight,a=null;if(e&&i>0&&n>0){var r=e.left/i,o=e.top/n,s=e.right/i,l=e.bottom/n;a=new Float32Array([s,o,r,o,s,l,r,l])}else a=new Float32Array([1,0,0,0,1,1,0,1]);var c=this.texturePosBuffer;t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferSubData(t.ARRAY_BUFFER,0,a),t.bindBuffer(t.ARRAY_BUFFER,null)},e.prototype.SR_Destroy=function(){var e=this.contextGL,t=this.YUVProgram;e.deleteProgram(t);var i=this.vertexPosBuffer,n=this.texturePosBuffer;e.deleteBuffer(i),e.deleteBuffer(n);var a=this.yTextureRef,r=this.uTextureRef,o=this.vTextureRef;e.deleteTexture(a),e.deleteTexture(r),e.deleteTexture(o)},e}();var bt=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();var Pt,Et=(Pt=void 0,function(e){return e&&(Pt=e),Pt});!function(){function e(){if(function(e,t){if(i=e,!(null!=(n=t)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](i):i instanceof n))throw new TypeError("Cannot call a class as a function");var i,n}(this,e),Et())return Et();if(void 0!==e.unique)return e.unique;e.unique=this,this.oAudioContext=null,this.currentVolume=80,this.bSetVolume=!1,this.gainNode=null,this.iWndNum=-1,this.mVolumes=new Map;var t=window.AudioContext||window.webkitAudioContext;this.oAudioContext=new t,this.writeString=function(e,t,i){for(var n=0;n<i.length;n++)e.setUint8(t+n,i.charCodeAt(n))},this.setBufferToDataview=function(e,t,i){for(var n=0;n<i.length;n++,t++)e.setUint8(t,i[n])},Et(this)}bt(e,[{key:"Play",value:function(e,t,i){var n=new ArrayBuffer(44+t),a=new DataView(n),r=i.samplesPerSec,o=i.channels,s=i.bitsPerSample;this.writeString(a,0,"RIFF"),a.setUint32(4,32+2*t,!0),this.writeString(a,8,"WAVE"),this.writeString(a,12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,o,!0),a.setUint32(24,r,!0),a.setUint32(28,2*r,!0),a.setUint16(32,o*s/8,!0),a.setUint16(34,s,!0),this.writeString(a,36,"data"),a.setUint32(40,t,!0),this.setBufferToDataview(a,44,e);var l=this;return this.oAudioContext.decodeAudioData(a.buffer,(function(e){var t=l.oAudioContext.createBufferSource();if(null==t)return-1;t.buffer=e,t.start(0),(null==l.gainNode||l.bSetVolume)&&(l.gainNode=l.oAudioContext.createGain(),l.bSetVolume=!1),l.gainNode.gain.value=l.currentVolume/100,l.gainNode.connect(l.oAudioContext.destination),t.connect(l.gainNode)}),(function(e){return-1})),0}},{key:"Stop",value:function(){return null!=this.gainNode&&(this.gainNode.disconnect(),this.gainNode=null),!0}},{key:"SetVolume",value:function(e){return this.bSetVolume=!0,this.currentVolume=e,this.mVolumes.set(this.iWndNum,this.currentVolume),!0}},{key:"SetWndNum",value:function(e){this.iWndNum=e;var t=this.mVolumes.get(e);return null==t&&(t=80),this.currentVolume=t,!0}},{key:"GetVolume",value:function(){var e=this.mVolumes.get(this.iWndNum);return null==e&&(e=80),e}}]),window.AudioRenderer=e}();var Ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==w?w:"undefined"!=typeof self?self:{};function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rt={exports:{}};
/*!
   * jQuery JavaScript Library v3.3.1
   * https://jquery.com/
   *
   * Includes Sizzle.js
   * https://sizzlejs.com/
   *
   * Copyright JS Foundation and other contributors
   * Released under the MIT license
   * https://jquery.org/license
   *
   * Date: 2018-01-20T17:24Z
   */!function(e){!function(t,i){e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return i(e)}}("undefined"!=typeof window?window:Ct,(function(e,t){var i=[],n=e.document,a=Object.getPrototypeOf,r=i.slice,o=i.concat,s=i.push,l=i.indexOf,c={},d=c.toString,u=c.hasOwnProperty,h=u.toString,f=h.call(Object),x={},p=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},m=function(e){return null!=e&&e===e.window},_={type:!0,src:!0,noModule:!0};function g(e,t,i){var a,r=(t=t||n).createElement("script");if(r.text=e,i)for(a in _)i[a]&&(r[a]=i[a]);t.head.appendChild(r).parentNode.removeChild(r)}function v(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[d.call(e)]||"object":typeof e}var y="3.3.1",S=function(e,t){return new S.fn.init(e,t)},b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function P(e){var t=!!e&&"length"in e&&e.length,i=v(e);return!p(e)&&!m(e)&&("array"===i||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:y,constructor:S,length:0,toArray:function(){return r.call(this)},get:function(e){return null==e?r.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,(function(t,i){return e.call(t,i,t)})))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(i>=0&&i<t?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:i.sort,splice:i.splice},S.extend=S.fn.extend=function(){var e,t,i,n,a,r,o=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[s]||{},s++),"object"==typeof o||p(o)||(o={}),s===l&&(o=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)i=o[t],o!==(n=e[t])&&(c&&n&&(S.isPlainObject(n)||(a=Array.isArray(n)))?(a?(a=!1,r=i&&Array.isArray(i)?i:[]):r=i&&S.isPlainObject(i)?i:{},o[t]=S.extend(c,r,n)):void 0!==n&&(o[t]=n));return o},S.extend({expando:"jQuery"+(y+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,i;return!(!e||"[object Object]"!==d.call(e)||(t=a(e))&&("function"!=typeof(i=u.call(t,"constructor")&&t.constructor)||h.call(i)!==f))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){g(e)},each:function(e,t){var i,n=0;if(P(e))for(i=e.length;n<i&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(!1===t.call(e[n],n,e[n]))break;return e},trim:function(e){return null==e?"":(e+"").replace(b,"")},makeArray:function(e,t){var i=t||[];return null!=e&&(P(Object(e))?S.merge(i,"string"==typeof e?[e]:e):s.call(i,e)),i},inArray:function(e,t,i){return null==t?-1:l.call(t,e,i)},merge:function(e,t){for(var i=+t.length,n=0,a=e.length;n<i;n++)e[a++]=t[n];return e.length=a,e},grep:function(e,t,i){for(var n=[],a=0,r=e.length,o=!i;a<r;a++)!t(e[a],a)!==o&&n.push(e[a]);return n},map:function(e,t,i){var n,a,r=0,s=[];if(P(e))for(n=e.length;r<n;r++)null!=(a=t(e[r],r,i))&&s.push(a);else for(r in e)null!=(a=t(e[r],r,i))&&s.push(a);return o.apply([],s)},guid:1,support:x}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=i[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){c["[object "+t+"]"]=t.toLowerCase()}));var E=
/*!
       * Sizzle CSS Selector Engine v2.3.3
       * https://sizzlejs.com/
       *
       * Copyright jQuery Foundation and other contributors
       * Released under the MIT license
       * http://jquery.org/license
       *
       * Date: 2016-08-08
       */
function(e){var t,i,n,a,r,o,s,l,c,d,u,h,f,x,p,m,_,g,v,y="sizzle"+1*new Date,S=e.document,b=0,P=0,E=oe(),C=oe(),T=oe(),R=function(e,t){return e===t&&(u=!0),0},w={}.hasOwnProperty,I=[],D=I.pop,k=I.push,F=I.push,A=I.slice,M=function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",O="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",j="\\["+B+"*("+O+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+B+"*\\]",N=":("+O+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",U=new RegExp(B+"+","g"),z=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),H=new RegExp("^"+B+"*,"+B+"*"),V=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),Z=new RegExp("="+B+"*([^\\]'\"]*?)"+B+"*\\]","g"),W=new RegExp(N),G=new RegExp("^"+O+"$"),Y={ID:new RegExp("^#("+O+")"),CLASS:new RegExp("^\\.("+O+")"),TAG:new RegExp("^("+O+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,Q=new RegExp("\\\\([\\da-f]{1,6}"+B+"?|("+B+")|.)","ig"),ee=function(e,t,i){var n="0x"+t-65536;return n!=n||i?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ne=function(){h()},ae=ge((function(e){return!0===e.disabled&&("form"in e||"label"in e)}),{dir:"parentNode",next:"legend"});try{F.apply(I=A.call(S.childNodes),S.childNodes),I[S.childNodes.length].nodeType}catch(e){F={apply:I.length?function(e,t){k.apply(e,A.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}function re(e,t,n,a){var r,s,c,d,u,x,_,g=t&&t.ownerDocument,b=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return n;if(!a&&((t?t.ownerDocument||t:S)!==f&&h(t),t=t||f,p)){if(11!==b&&(u=K.exec(e)))if(r=u[1]){if(9===b){if(!(c=t.getElementById(r)))return n;if(c.id===r)return n.push(c),n}else if(g&&(c=g.getElementById(r))&&v(t,c)&&c.id===r)return n.push(c),n}else{if(u[2])return F.apply(n,t.getElementsByTagName(e)),n;if((r=u[3])&&i.getElementsByClassName&&t.getElementsByClassName)return F.apply(n,t.getElementsByClassName(r)),n}if(i.qsa&&!T[e+" "]&&(!m||!m.test(e))){if(1!==b)g=t,_=e;else if("object"!==t.nodeName.toLowerCase()){for((d=t.getAttribute("id"))?d=d.replace(te,ie):t.setAttribute("id",d=y),s=(x=o(e)).length;s--;)x[s]="#"+d+" "+_e(x[s]);_=x.join(","),g=$.test(e)&&pe(t.parentNode)||t}if(_)try{return F.apply(n,g.querySelectorAll(_)),n}catch(e){}finally{d===y&&t.removeAttribute("id")}}}return l(e.replace(z,"$1"),t,n,a)}function oe(){var e=[];return function t(i,a){return e.push(i+" ")>n.cacheLength&&delete t[e.shift()],t[i+" "]=a}}function se(e){return e[y]=!0,e}function le(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e,t){for(var i=e.split("|"),a=i.length;a--;)n.attrHandle[i[a]]=t}function de(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function ue(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function xe(e){return se((function(t){return t=+t,se((function(i,n){for(var a,r=e([],i.length,t),o=r.length;o--;)i[a=r[o]]&&(i[a]=!(n[a]=i[a]))}))}))}function pe(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in i=re.support={},r=re.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},h=re.setDocument=function(e){var t,a,o=e?e.ownerDocument||e:S;return o!==f&&9===o.nodeType&&o.documentElement?(x=(f=o).documentElement,p=!r(f),S!==f&&(a=f.defaultView)&&a.top!==a&&(a.addEventListener?a.addEventListener("unload",ne,!1):a.attachEvent&&a.attachEvent("onunload",ne)),i.attributes=le((function(e){return e.className="i",!e.getAttribute("className")})),i.getElementsByTagName=le((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),i.getElementsByClassName=q.test(f.getElementsByClassName),i.getById=le((function(e){return x.appendChild(e).id=y,!f.getElementsByName||!f.getElementsByName(y).length})),i.getById?(n.filter.ID=function(e){var t=e.replace(Q,ee);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&p){var i=t.getElementById(e);return i?[i]:[]}}):(n.filter.ID=function(e){var t=e.replace(Q,ee);return function(e){var i=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&p){var i,n,a,r=t.getElementById(e);if(r){if((i=r.getAttributeNode("id"))&&i.value===e)return[r];for(a=t.getElementsByName(e),n=0;r=a[n++];)if((i=r.getAttributeNode("id"))&&i.value===e)return[r]}return[]}}),n.find.TAG=i.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):i.qsa?t.querySelectorAll(e):void 0}:function(e,t){var i,n=[],a=0,r=t.getElementsByTagName(e);if("*"===e){for(;i=r[a++];)1===i.nodeType&&n.push(i);return n}return r},n.find.CLASS=i.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&p)return t.getElementsByClassName(e)},_=[],m=[],(i.qsa=q.test(f.querySelectorAll))&&(le((function(e){x.appendChild(e).innerHTML="<a id='"+y+"'></a><select id='"+y+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+B+"*(?:value|"+L+")"),e.querySelectorAll("[id~="+y+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+y+"+*").length||m.push(".#.+[+~]")})),le((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),x.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")}))),(i.matchesSelector=q.test(g=x.matches||x.webkitMatchesSelector||x.mozMatchesSelector||x.oMatchesSelector||x.msMatchesSelector))&&le((function(e){i.disconnectedMatch=g.call(e,"*"),g.call(e,"[s!='']:x"),_.push("!=",N)})),m=m.length&&new RegExp(m.join("|")),_=_.length&&new RegExp(_.join("|")),t=q.test(x.compareDocumentPosition),v=t||q.test(x.contains)?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},R=t?function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!i.sortDetached&&t.compareDocumentPosition(e)===n?e===f||e.ownerDocument===S&&v(S,e)?-1:t===f||t.ownerDocument===S&&v(S,t)?1:d?M(d,e)-M(d,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var i,n=0,a=e.parentNode,r=t.parentNode,o=[e],s=[t];if(!a||!r)return e===f?-1:t===f?1:a?-1:r?1:d?M(d,e)-M(d,t):0;if(a===r)return de(e,t);for(i=e;i=i.parentNode;)o.unshift(i);for(i=t;i=i.parentNode;)s.unshift(i);for(;o[n]===s[n];)n++;return n?de(o[n],s[n]):o[n]===S?-1:s[n]===S?1:0},f):f},re.matches=function(e,t){return re(e,null,null,t)},re.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&h(e),t=t.replace(Z,"='$1']"),i.matchesSelector&&p&&!T[t+" "]&&(!_||!_.test(t))&&(!m||!m.test(t)))try{var n=g.call(e,t);if(n||i.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return re(t,f,null,[e]).length>0},re.contains=function(e,t){return(e.ownerDocument||e)!==f&&h(e),v(e,t)},re.attr=function(e,t){(e.ownerDocument||e)!==f&&h(e);var a=n.attrHandle[t.toLowerCase()],r=a&&w.call(n.attrHandle,t.toLowerCase())?a(e,t,!p):void 0;return void 0!==r?r:i.attributes||!p?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},re.escape=function(e){return(e+"").replace(te,ie)},re.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},re.uniqueSort=function(e){var t,n=[],a=0,r=0;if(u=!i.detectDuplicates,d=!i.sortStable&&e.slice(0),e.sort(R),u){for(;t=e[r++];)t===e[r]&&(a=n.push(r));for(;a--;)e.splice(n[a],1)}return d=null,e},a=re.getText=function(e){var t,i="",n=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=a(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[n++];)i+=a(t);return i},n=re.selectors={cacheLength:50,createPseudo:se,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Q,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Q,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||re.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&re.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&W.test(i)&&(t=o(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Q,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&E(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,i){return function(n){var a=re.attr(n,e);return null==a?"!="===t:!t||(a+="","="===t?a===i:"!="===t?a!==i:"^="===t?i&&0===a.indexOf(i):"*="===t?i&&a.indexOf(i)>-1:"$="===t?i&&a.slice(-i.length)===i:"~="===t?(" "+a.replace(U," ")+" ").indexOf(i)>-1:"|="===t&&(a===i||a.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,i,n,a){var r="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===a?function(e){return!!e.parentNode}:function(t,i,l){var c,d,u,h,f,x,p=r!==o?"nextSibling":"previousSibling",m=t.parentNode,_=s&&t.nodeName.toLowerCase(),g=!l&&!s,v=!1;if(m){if(r){for(;p;){for(h=t;h=h[p];)if(s?h.nodeName.toLowerCase()===_:1===h.nodeType)return!1;x=p="only"===e&&!x&&"nextSibling"}return!0}if(x=[o?m.firstChild:m.lastChild],o&&g){for(v=(f=(c=(d=(u=(h=m)[y]||(h[y]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]||[])[0]===b&&c[1])&&c[2],h=f&&m.childNodes[f];h=++f&&h&&h[p]||(v=f=0)||x.pop();)if(1===h.nodeType&&++v&&h===t){d[e]=[b,f,v];break}}else if(g&&(v=f=(c=(d=(u=(h=t)[y]||(h[y]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]||[])[0]===b&&c[1]),!1===v)for(;(h=++f&&h&&h[p]||(v=f=0)||x.pop())&&((s?h.nodeName.toLowerCase()!==_:1!==h.nodeType)||!++v||(g&&((d=(u=h[y]||(h[y]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]=[b,v]),h!==t)););return(v-=a)===n||v%n==0&&v/n>=0}}},PSEUDO:function(e,t){var i,a=n.pseudos[e]||n.setFilters[e.toLowerCase()]||re.error("unsupported pseudo: "+e);return a[y]?a(t):a.length>1?(i=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,i){for(var n,r=a(e,t),o=r.length;o--;)e[n=M(e,r[o])]=!(i[n]=r[o])})):function(e){return a(e,0,i)}):a}},pseudos:{not:se((function(e){var t=[],i=[],n=s(e.replace(z,"$1"));return n[y]?se((function(e,t,i,a){for(var r,o=n(e,null,a,[]),s=e.length;s--;)(r=o[s])&&(e[s]=!(t[s]=r))})):function(e,a,r){return t[0]=e,n(t,null,r,i),t[0]=null,!i.pop()}})),has:se((function(e){return function(t){return re(e,t).length>0}})),contains:se((function(e){return e=e.replace(Q,ee),function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}})),lang:se((function(e){return G.test(e||"")||re.error("unsupported lang: "+e),e=e.replace(Q,ee).toLowerCase(),function(t){var i;do{if(i=p?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===x},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!n.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:xe((function(){return[0]})),last:xe((function(e,t){return[t-1]})),eq:xe((function(e,t,i){return[i<0?i+t:i]})),even:xe((function(e,t){for(var i=0;i<t;i+=2)e.push(i);return e})),odd:xe((function(e,t){for(var i=1;i<t;i+=2)e.push(i);return e})),lt:xe((function(e,t,i){for(var n=i<0?i+t:i;--n>=0;)e.push(n);return e})),gt:xe((function(e,t,i){for(var n=i<0?i+t:i;++n<t;)e.push(n);return e}))}},n.pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[t]=ue(t);for(t in{submit:!0,reset:!0})n.pseudos[t]=he(t);function me(){}function _e(e){for(var t=0,i=e.length,n="";t<i;t++)n+=e[t].value;return n}function ge(e,t,i){var n=t.dir,a=t.next,r=a||n,o=i&&"parentNode"===r,s=P++;return t.first?function(t,i,a){for(;t=t[n];)if(1===t.nodeType||o)return e(t,i,a);return!1}:function(t,i,l){var c,d,u,h=[b,s];if(l){for(;t=t[n];)if((1===t.nodeType||o)&&e(t,i,l))return!0}else for(;t=t[n];)if(1===t.nodeType||o)if(d=(u=t[y]||(t[y]={}))[t.uniqueID]||(u[t.uniqueID]={}),a&&a===t.nodeName.toLowerCase())t=t[n]||t;else{if((c=d[r])&&c[0]===b&&c[1]===s)return h[2]=c[2];if(d[r]=h,h[2]=e(t,i,l))return!0}return!1}}function ve(e){return e.length>1?function(t,i,n){for(var a=e.length;a--;)if(!e[a](t,i,n))return!1;return!0}:e[0]}function ye(e,t,i,n,a){for(var r,o=[],s=0,l=e.length,c=null!=t;s<l;s++)(r=e[s])&&(i&&!i(r,n,a)||(o.push(r),c&&t.push(s)));return o}function Se(e,t,i,n,a,r){return n&&!n[y]&&(n=Se(n)),a&&!a[y]&&(a=Se(a,r)),se((function(r,o,s,l){var c,d,u,h=[],f=[],x=o.length,p=r||function(e,t,i){for(var n=0,a=t.length;n<a;n++)re(e,t[n],i);return i}(t||"*",s.nodeType?[s]:s,[]),m=!e||!r&&t?p:ye(p,h,e,s,l),_=i?a||(r?e:x||n)?[]:o:m;if(i&&i(m,_,s,l),n)for(c=ye(_,f),n(c,[],s,l),d=c.length;d--;)(u=c[d])&&(_[f[d]]=!(m[f[d]]=u));if(r){if(a||e){if(a){for(c=[],d=_.length;d--;)(u=_[d])&&c.push(m[d]=u);a(null,_=[],c,l)}for(d=_.length;d--;)(u=_[d])&&(c=a?M(r,u):h[d])>-1&&(r[c]=!(o[c]=u))}}else _=ye(_===o?_.splice(x,_.length):_),a?a(null,o,_,l):F.apply(o,_)}))}function be(e){for(var t,i,a,r=e.length,o=n.relative[e[0].type],s=o||n.relative[" "],l=o?1:0,d=ge((function(e){return e===t}),s,!0),u=ge((function(e){return M(t,e)>-1}),s,!0),h=[function(e,i,n){var a=!o&&(n||i!==c)||((t=i).nodeType?d(e,i,n):u(e,i,n));return t=null,a}];l<r;l++)if(i=n.relative[e[l].type])h=[ge(ve(h),i)];else{if((i=n.filter[e[l].type].apply(null,e[l].matches))[y]){for(a=++l;a<r&&!n.relative[e[a].type];a++);return Se(l>1&&ve(h),l>1&&_e(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),i,l<a&&be(e.slice(l,a)),a<r&&be(e=e.slice(a)),a<r&&_e(e))}h.push(i)}return ve(h)}return me.prototype=n.filters=n.pseudos,n.setFilters=new me,o=re.tokenize=function(e,t){var i,a,r,o,s,l,c,d=C[e+" "];if(d)return t?0:d.slice(0);for(s=e,l=[],c=n.preFilter;s;){for(o in i&&!(a=H.exec(s))||(a&&(s=s.slice(a[0].length)||s),l.push(r=[])),i=!1,(a=V.exec(s))&&(i=a.shift(),r.push({value:i,type:a[0].replace(z," ")}),s=s.slice(i.length)),n.filter)!(a=Y[o].exec(s))||c[o]&&!(a=c[o](a))||(i=a.shift(),r.push({value:i,type:o,matches:a}),s=s.slice(i.length));if(!i)break}return t?s.length:s?re.error(e):C(e,l).slice(0)},s=re.compile=function(e,t){var i,a=[],r=[],s=T[e+" "];if(!s){for(t||(t=o(e)),i=t.length;i--;)(s=be(t[i]))[y]?a.push(s):r.push(s);s=T(e,function(e,t){var i=t.length>0,a=e.length>0,r=function(r,o,s,l,d){var u,x,m,_=0,g="0",v=r&&[],y=[],S=c,P=r||a&&n.find.TAG("*",d),E=b+=null==S?1:Math.random()||.1,C=P.length;for(d&&(c=o===f||o||d);g!==C&&null!=(u=P[g]);g++){if(a&&u){for(x=0,o||u.ownerDocument===f||(h(u),s=!p);m=e[x++];)if(m(u,o||f,s)){l.push(u);break}d&&(b=E)}i&&((u=!m&&u)&&_--,r&&v.push(u))}if(_+=g,i&&g!==_){for(x=0;m=t[x++];)m(v,y,o,s);if(r){if(_>0)for(;g--;)v[g]||y[g]||(y[g]=D.call(l));y=ye(y)}F.apply(l,y),d&&!r&&y.length>0&&_+t.length>1&&re.uniqueSort(l)}return d&&(b=E,c=S),v};return i?se(r):r}(r,a)),s.selector=e}return s},l=re.select=function(e,t,i,a){var r,l,c,d,u,h="function"==typeof e&&e,f=!a&&o(e=h.selector||e);if(i=i||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&p&&n.relative[l[1].type]){if(!(t=(n.find.ID(c.matches[0].replace(Q,ee),t)||[])[0]))return i;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(r=Y.needsContext.test(e)?0:l.length;r--&&(c=l[r],!n.relative[d=c.type]);)if((u=n.find[d])&&(a=u(c.matches[0].replace(Q,ee),$.test(l[0].type)&&pe(t.parentNode)||t))){if(l.splice(r,1),!(e=a.length&&_e(l)))return F.apply(i,a),i;break}}return(h||s(e,f))(a,t,!p,i,!t||$.test(e)&&pe(t.parentNode)||t),i},i.sortStable=y.split("").sort(R).join("")===y,i.detectDuplicates=!!u,h(),i.sortDetached=le((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),le((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||ce("type|href|height|width",(function(e,t,i){if(!i)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),i.attributes&&le((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||ce("value",(function(e,t,i){if(!i&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),le((function(e){return null==e.getAttribute("disabled")}))||ce(L,(function(e,t,i){var n;if(!i)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null})),re}(e);S.find=E,S.expr=E.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=E.uniqueSort,S.text=E.getText,S.isXMLDoc=E.isXML,S.contains=E.contains,S.escapeSelector=E.escape;var C=function(e,t,i){for(var n=[],a=void 0!==i;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(a&&S(e).is(i))break;n.push(e)}return n},T=function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i},R=S.expr.match.needsContext;function w(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var I=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,i){return p(t)?S.grep(e,(function(e,n){return!!t.call(e,n,e)!==i})):t.nodeType?S.grep(e,(function(e){return e===t!==i})):"string"!=typeof t?S.grep(e,(function(e){return l.call(t,e)>-1!==i})):S.filter(t,e,i)}S.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?S.find.matchesSelector(n,e)?[n]:[]:S.find.matches(e,S.grep(t,(function(e){return 1===e.nodeType})))},S.fn.extend({find:function(e){var t,i,n=this.length,a=this;if("string"!=typeof e)return this.pushStack(S(e).filter((function(){for(t=0;t<n;t++)if(S.contains(a[t],this))return!0})));for(i=this.pushStack([]),t=0;t<n;t++)S.find(e,a[t],i);return n>1?S.uniqueSort(i):i},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&R.test(e)?S(e):e||[],!1).length}});var k,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,i){var a,r;if(!e)return this;if(i=i||k,"string"==typeof e){if(!(a="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:F.exec(e))||!a[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(a[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(a[1],t&&t.nodeType?t.ownerDocument||t:n,!0)),I.test(a[1])&&S.isPlainObject(t))for(a in t)p(this[a])?this[a](t[a]):this.attr(a,t[a]);return this}return(r=n.getElementById(a[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==i.ready?i.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,k=S(n);var A=/^(?:parents|prev(?:Until|All))/,M={children:!0,contents:!0,next:!0,prev:!0};function L(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),i=t.length;return this.filter((function(){for(var e=0;e<i;e++)if(S.contains(this,t[e]))return!0}))},closest:function(e,t){var i,n=0,a=this.length,r=[],o="string"!=typeof e&&S(e);if(!R.test(e))for(;n<a;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(o?o.index(i)>-1:1===i.nodeType&&S.find.matchesSelector(i,e))){r.push(i);break}return this.pushStack(r.length>1?S.uniqueSort(r):r)},index:function(e){return e?"string"==typeof e?l.call(S(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return C(e,"parentNode")},parentsUntil:function(e,t,i){return C(e,"parentNode",i)},next:function(e){return L(e,"nextSibling")},prev:function(e){return L(e,"previousSibling")},nextAll:function(e){return C(e,"nextSibling")},prevAll:function(e){return C(e,"previousSibling")},nextUntil:function(e,t,i){return C(e,"nextSibling",i)},prevUntil:function(e,t,i){return C(e,"previousSibling",i)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return w(e,"iframe")?e.contentDocument:(w(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},(function(e,t){S.fn[e]=function(i,n){var a=S.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(a=S.filter(n,a)),this.length>1&&(M[e]||S.uniqueSort(a),A.test(e)&&a.reverse()),this.pushStack(a)}}));var B=/[^\x20\t\r\n\f]+/g;function O(e){return e}function j(e){throw e}function N(e,t,i,n){var a;try{e&&p(a=e.promise)?a.call(e).done(t).fail(i):e&&p(a=e.then)?a.call(e,t,i):t.apply(void 0,[e].slice(n))}catch(e){i.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(B)||[],(function(e,i){t[i]=!0})),t}(e):S.extend({},e);var t,i,n,a,r=[],o=[],s=-1,l=function(){for(a=a||e.once,n=t=!0;o.length;s=-1)for(i=o.shift();++s<r.length;)!1===r[s].apply(i[0],i[1])&&e.stopOnFalse&&(s=r.length,i=!1);e.memory||(i=!1),t=!1,a&&(r=i?[]:"")},c={add:function(){return r&&(i&&!t&&(s=r.length-1,o.push(i)),function t(i){S.each(i,(function(i,n){p(n)?e.unique&&c.has(n)||r.push(n):n&&n.length&&"string"!==v(n)&&t(n)}))}(arguments),i&&!t&&l()),this},remove:function(){return S.each(arguments,(function(e,t){for(var i;(i=S.inArray(t,r,i))>-1;)r.splice(i,1),i<=s&&s--})),this},has:function(e){return e?S.inArray(e,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return a=o=[],r=i="",this},disabled:function(){return!r},lock:function(){return a=o=[],i||t||(r=i=""),this},locked:function(){return!!a},fireWith:function(e,i){return a||(i=[e,(i=i||[]).slice?i.slice():i],o.push(i),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},S.extend({Deferred:function(t){var i=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",a={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},catch:function(e){return a.then(null,e)},pipe:function(){var e=arguments;return S.Deferred((function(t){S.each(i,(function(i,n){var a=p(e[n[4]])&&e[n[4]];r[n[1]]((function(){var e=a&&a.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[n[0]+"With"](this,a?[e]:arguments)}))})),e=null})).promise()},then:function(t,n,a){var r=0;function o(t,i,n,a){return function(){var s=this,l=arguments,c=function(){var e,c;if(!(t<r)){if((e=n.apply(s,l))===i.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(c)?a?c.call(e,o(r,i,O,a),o(r,i,j,a)):(r++,c.call(e,o(r,i,O,a),o(r,i,j,a),o(r,i,O,i.notifyWith))):(n!==O&&(s=void 0,l=[e]),(a||i.resolveWith)(s,l))}},d=a?c:function(){try{c()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,d.stackTrace),t+1>=r&&(n!==j&&(s=void 0,l=[e]),i.rejectWith(s,l))}};t?d():(S.Deferred.getStackHook&&(d.stackTrace=S.Deferred.getStackHook()),e.setTimeout(d))}}return S.Deferred((function(e){i[0][3].add(o(0,e,p(a)?a:O,e.notifyWith)),i[1][3].add(o(0,e,p(t)?t:O)),i[2][3].add(o(0,e,p(n)?n:j))})).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},r={};return S.each(i,(function(e,t){var o=t[2],s=t[5];a[t[1]]=o.add,s&&o.add((function(){n=s}),i[3-e][2].disable,i[3-e][3].disable,i[0][2].lock,i[0][3].lock),o.add(t[3].fire),r[t[0]]=function(){return r[t[0]+"With"](this===r?void 0:this,arguments),this},r[t[0]+"With"]=o.fireWith})),a.promise(r),t&&t.call(r,r),r},when:function(e){var t=arguments.length,i=t,n=Array(i),a=r.call(arguments),o=S.Deferred(),s=function(e){return function(i){n[e]=this,a[e]=arguments.length>1?r.call(arguments):i,--t||o.resolveWith(n,a)}};if(t<=1&&(N(e,o.done(s(i)).resolve,o.reject,!t),"pending"===o.state()||p(a[i]&&a[i].then)))return o.then();for(;i--;)N(a[i],s(i),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,i){e.console&&e.console.warn&&t&&U.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,i)},S.readyException=function(t){e.setTimeout((function(){throw t}))};var z=S.Deferred();function H(){n.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),S.ready()}S.fn.ready=function(e){return z.then(e).catch((function(e){S.readyException(e)})),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||z.resolveWith(n,[S]))}}),S.ready.then=z.then,"complete"===n.readyState||"loading"!==n.readyState&&!n.documentElement.doScroll?e.setTimeout(S.ready):(n.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var V=function(e,t,i,n,a,r,o){var s=0,l=e.length,c=null==i;if("object"===v(i))for(s in a=!0,i)V(e,t,s,i[s],!0,r,o);else if(void 0!==n&&(a=!0,p(n)||(o=!0),c&&(o?(t.call(e,n),t=null):(c=t,t=function(e,t,i){return c.call(S(e),i)})),t))for(;s<l;s++)t(e[s],i,o?n:n.call(e[s],s,t(e[s],i)));return a?e:c?t.call(e):l?t(e[0],i):r},Z=/^-ms-/,W=/-([a-z])/g;function G(e,t){return t.toUpperCase()}function Y(e){return e.replace(Z,"ms-").replace(W,G)}var X=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function J(){this.expando=S.expando+J.uid++}J.uid=1,J.prototype={cache:function(e){var t=e[this.expando];return t||(t={},X(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,i){var n,a=this.cache(e);if("string"==typeof t)a[Y(t)]=i;else for(n in t)a[Y(n)]=t[n];return a},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][Y(t)]},access:function(e,t,i){return void 0===t||t&&"string"==typeof t&&void 0===i?this.get(e,t):(this.set(e,t,i),void 0!==i?i:t)},remove:function(e,t){var i,n=e[this.expando];if(void 0!==n){if(void 0!==t){i=(t=Array.isArray(t)?t.map(Y):(t=Y(t))in n?[t]:t.match(B)||[]).length;for(;i--;)delete n[t[i]]}(void 0===t||S.isEmptyObject(n))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var q=new J,K=new J,$=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function ee(e,t,i){var n;if(void 0===i&&1===e.nodeType)if(n="data-"+t.replace(Q,"-$&").toLowerCase(),"string"==typeof(i=e.getAttribute(n))){try{i=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:$.test(e)?JSON.parse(e):e)}(i)}catch(e){}K.set(e,t,i)}else i=void 0;return i}S.extend({hasData:function(e){return K.hasData(e)||q.hasData(e)},data:function(e,t,i){return K.access(e,t,i)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,i){return q.access(e,t,i)},_removeData:function(e,t){q.remove(e,t)}}),S.fn.extend({data:function(e,t){var i,n,a,r=this[0],o=r&&r.attributes;if(void 0===e){if(this.length&&(a=K.get(r),1===r.nodeType&&!q.get(r,"hasDataAttrs"))){for(i=o.length;i--;)o[i]&&0===(n=o[i].name).indexOf("data-")&&(n=Y(n.slice(5)),ee(r,n,a[n]));q.set(r,"hasDataAttrs",!0)}return a}return"object"==typeof e?this.each((function(){K.set(this,e)})):V(this,(function(t){var i;if(r&&void 0===t)return void 0!==(i=K.get(r,e))||void 0!==(i=ee(r,e))?i:void 0;this.each((function(){K.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){K.remove(this,e)}))}}),S.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=q.get(e,t),i&&(!n||Array.isArray(i)?n=q.access(e,t,S.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=S.queue(e,t),n=i.length,a=i.shift(),r=S._queueHooks(e,t);"inprogress"===a&&(a=i.shift(),n--),a&&("fx"===t&&i.unshift("inprogress"),delete r.stop,a.call(e,(function(){S.dequeue(e,t)}),r)),!n&&r&&r.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return q.get(e,i)||q.access(e,i,{empty:S.Callbacks("once memory").add((function(){q.remove(e,[t+"queue",i])}))})}}),S.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length<i?S.queue(this[0],e):void 0===t?this:this.each((function(){var i=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==i[0]&&S.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){S.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var i,n=1,a=S.Deferred(),r=this,o=this.length,s=function(){--n||a.resolveWith(r,[r])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(i=q.get(r[o],e+"queueHooks"))&&i.empty&&(n++,i.empty.add(s));return s(),a.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&S.contains(e.ownerDocument,e)&&"none"===S.css(e,"display")},re=function(e,t,i,n){var a,r,o={};for(r in t)o[r]=e.style[r],e.style[r]=t[r];for(r in a=i.apply(e,n||[]),t)e.style[r]=o[r];return a};function oe(e,t,i,n){var a,r,o=20,s=n?function(){return n.cur()}:function(){return S.css(e,t,"")},l=s(),c=i&&i[3]||(S.cssNumber[t]?"":"px"),d=(S.cssNumber[t]||"px"!==c&&+l)&&ie.exec(S.css(e,t));if(d&&d[3]!==c){for(l/=2,c=c||d[3],d=+l||1;o--;)S.style(e,t,d+c),(1-r)*(1-(r=s()/l||.5))<=0&&(o=0),d/=r;d*=2,S.style(e,t,d+c),i=i||[]}return i&&(d=+d||+l||0,a=i[1]?d+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=d,n.end=a)),a}var se={};function le(e){var t,i=e.ownerDocument,n=e.nodeName,a=se[n];return a||(t=i.body.appendChild(i.createElement(n)),a=S.css(t,"display"),t.parentNode.removeChild(t),"none"===a&&(a="block"),se[n]=a,a)}function ce(e,t){for(var i,n,a=[],r=0,o=e.length;r<o;r++)(n=e[r]).style&&(i=n.style.display,t?("none"===i&&(a[r]=q.get(n,"display")||null,a[r]||(n.style.display="")),""===n.style.display&&ae(n)&&(a[r]=le(n))):"none"!==i&&(a[r]="none",q.set(n,"display",i)));for(r=0;r<o;r++)null!=a[r]&&(e[r].style.display=a[r]);return e}S.fn.extend({show:function(){return ce(this,!0)},hide:function(){return ce(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ae(this)?S(this).show():S(this).hide()}))}});var de=/^(?:checkbox|radio)$/i,ue=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,fe={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function xe(e,t){var i;return i=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&w(e,t)?S.merge([e],i):i}function pe(e,t){for(var i=0,n=e.length;i<n;i++)q.set(e[i],"globalEval",!t||q.get(t[i],"globalEval"))}fe.optgroup=fe.option,fe.tbody=fe.tfoot=fe.colgroup=fe.caption=fe.thead,fe.th=fe.td;var me,_e,ge=/<|&#?\w+;/;function ve(e,t,i,n,a){for(var r,o,s,l,c,d,u=t.createDocumentFragment(),h=[],f=0,x=e.length;f<x;f++)if((r=e[f])||0===r)if("object"===v(r))S.merge(h,r.nodeType?[r]:r);else if(ge.test(r)){for(o=o||u.appendChild(t.createElement("div")),s=(ue.exec(r)||["",""])[1].toLowerCase(),l=fe[s]||fe._default,o.innerHTML=l[1]+S.htmlPrefilter(r)+l[2],d=l[0];d--;)o=o.lastChild;S.merge(h,o.childNodes),(o=u.firstChild).textContent=""}else h.push(t.createTextNode(r));for(u.textContent="",f=0;r=h[f++];)if(n&&S.inArray(r,n)>-1)a&&a.push(r);else if(c=S.contains(r.ownerDocument,r),o=xe(u.appendChild(r),"script"),c&&pe(o),i)for(d=0;r=o[d++];)he.test(r.type||"")&&i.push(r);return u}me=n.createDocumentFragment().appendChild(n.createElement("div")),(_e=n.createElement("input")).setAttribute("type","radio"),_e.setAttribute("checked","checked"),_e.setAttribute("name","t"),me.appendChild(_e),x.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="<textarea>x</textarea>",x.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var ye=n.documentElement,Se=/^key/,be=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Pe=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function Ce(){return!1}function Te(){try{return n.activeElement}catch(e){}}function Re(e,t,i,n,a,r){var o,s;if("object"==typeof t){for(s in"string"!=typeof i&&(n=n||i,i=void 0),t)Re(e,s,i,n,t[s],r);return e}if(null==n&&null==a?(a=i,n=i=void 0):null==a&&("string"==typeof i?(a=n,n=void 0):(a=n,n=i,i=void 0)),!1===a)a=Ce;else if(!a)return e;return 1===r&&(o=a,a=function(e){return S().off(e),o.apply(this,arguments)},a.guid=o.guid||(o.guid=S.guid++)),e.each((function(){S.event.add(this,t,a,n,i)}))}S.event={global:{},add:function(e,t,i,n,a){var r,o,s,l,c,d,u,h,f,x,p,m=q.get(e);if(m)for(i.handler&&(i=(r=i).handler,a=r.selector),a&&S.find.matchesSelector(ye,a),i.guid||(i.guid=S.guid++),(l=m.events)||(l=m.events={}),(o=m.handle)||(o=m.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(B)||[""]).length;c--;)f=p=(s=Pe.exec(t[c])||[])[1],x=(s[2]||"").split(".").sort(),f&&(u=S.event.special[f]||{},f=(a?u.delegateType:u.bindType)||f,u=S.event.special[f]||{},d=S.extend({type:f,origType:p,data:n,handler:i,guid:i.guid,selector:a,needsContext:a&&S.expr.match.needsContext.test(a),namespace:x.join(".")},r),(h=l[f])||((h=l[f]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,n,x,o)||e.addEventListener&&e.addEventListener(f,o)),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=i.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),S.event.global[f]=!0)},remove:function(e,t,i,n,a){var r,o,s,l,c,d,u,h,f,x,p,m=q.hasData(e)&&q.get(e);if(m&&(l=m.events)){for(c=(t=(t||"").match(B)||[""]).length;c--;)if(f=p=(s=Pe.exec(t[c])||[])[1],x=(s[2]||"").split(".").sort(),f){for(u=S.event.special[f]||{},h=l[f=(n?u.delegateType:u.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=r=h.length;r--;)d=h[r],!a&&p!==d.origType||i&&i.guid!==d.guid||s&&!s.test(d.namespace)||n&&n!==d.selector&&("**"!==n||!d.selector)||(h.splice(r,1),d.selector&&h.delegateCount--,u.remove&&u.remove.call(e,d));o&&!h.length&&(u.teardown&&!1!==u.teardown.call(e,x,m.handle)||S.removeEvent(e,f,m.handle),delete l[f])}else for(f in l)S.event.remove(e,f+t[c],i,n,!0);S.isEmptyObject(l)&&q.remove(e,"handle events")}},dispatch:function(e){var t,i,n,a,r,o,s=S.event.fix(e),l=new Array(arguments.length),c=(q.get(this,"events")||{})[s.type]||[],d=S.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!d.preDispatch||!1!==d.preDispatch.call(this,s)){for(o=S.event.handlers.call(this,s,c),t=0;(a=o[t++])&&!s.isPropagationStopped();)for(s.currentTarget=a.elem,i=0;(r=a.handlers[i++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(r.namespace)||(s.handleObj=r,s.data=r.data,void 0!==(n=((S.event.special[r.origType]||{}).handle||r.handler).apply(a.elem,l))&&!1===(s.result=n)&&(s.preventDefault(),s.stopPropagation()));return d.postDispatch&&d.postDispatch.call(this,s),s.result}},handlers:function(e,t){var i,n,a,r,o,s=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(r=[],o={},i=0;i<l;i++)void 0===o[a=(n=t[i]).selector+" "]&&(o[a]=n.needsContext?S(a,this).index(c)>-1:S.find(a,this,null,[c]).length),o[a]&&r.push(n);r.length&&s.push({elem:c,handlers:r})}return c=this,l<t.length&&s.push({elem:c,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:p(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Te()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Te()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&w(this,"input"))return this.click(),!1},_default:function(e){return w(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:Ce,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ce,isPropagationStopped:Ce,isImmediatePropagationStopped:Ce,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Se.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&be.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=e.relatedTarget,a=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=a.origType,i=a.handler.apply(this,arguments),e.type=t),i}}})),S.fn.extend({on:function(e,t,i,n){return Re(this,e,t,i,n)},one:function(e,t,i,n){return Re(this,e,t,i,n,1)},off:function(e,t,i){var n,a;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,S(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(a in e)this.off(a,t,e[a]);return this}return!1!==t&&"function"!=typeof t||(i=t,t=void 0),!1===i&&(i=Ce),this.each((function(){S.event.remove(this,e,i,t)}))}});var we=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ie=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,ke=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Fe(e,t){return w(e,"table")&&w(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ae(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Me(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var i,n,a,r,o,s,l,c;if(1===t.nodeType){if(q.hasData(e)&&(r=q.access(e),o=q.set(t,r),c=r.events))for(a in delete o.handle,o.events={},c)for(i=0,n=c[a].length;i<n;i++)S.event.add(t,a,c[a][i]);K.hasData(e)&&(s=K.access(e),l=S.extend({},s),K.set(t,l))}}function Be(e,t){var i=t.nodeName.toLowerCase();"input"===i&&de.test(e.type)?t.checked=e.checked:"input"!==i&&"textarea"!==i||(t.defaultValue=e.defaultValue)}function Oe(e,t,i,n){t=o.apply([],t);var a,r,s,l,c,d,u=0,h=e.length,f=h-1,m=t[0],_=p(m);if(_||h>1&&"string"==typeof m&&!x.checkClone&&De.test(m))return e.each((function(a){var r=e.eq(a);_&&(t[0]=m.call(this,a,r.html())),Oe(r,t,i,n)}));if(h&&(r=(a=ve(t,e[0].ownerDocument,!1,e,n)).firstChild,1===a.childNodes.length&&(a=r),r||n)){for(l=(s=S.map(xe(a,"script"),Ae)).length;u<h;u++)c=a,u!==f&&(c=S.clone(c,!0,!0),l&&S.merge(s,xe(c,"script"))),i.call(e[u],c,u);if(l)for(d=s[s.length-1].ownerDocument,S.map(s,Me),u=0;u<l;u++)c=s[u],he.test(c.type||"")&&!q.access(c,"globalEval")&&S.contains(d,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?S._evalUrl&&S._evalUrl(c.src):g(c.textContent.replace(ke,""),d,c))}return e}function je(e,t,i){for(var n,a=t?S.filter(t,e):e,r=0;null!=(n=a[r]);r++)i||1!==n.nodeType||S.cleanData(xe(n)),n.parentNode&&(i&&S.contains(n.ownerDocument,n)&&pe(xe(n,"script")),n.parentNode.removeChild(n));return e}S.extend({htmlPrefilter:function(e){return e.replace(we,"<$1></$2>")},clone:function(e,t,i){var n,a,r,o,s=e.cloneNode(!0),l=S.contains(e.ownerDocument,e);if(!(x.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(o=xe(s),n=0,a=(r=xe(e)).length;n<a;n++)Be(r[n],o[n]);if(t)if(i)for(r=r||xe(e),o=o||xe(s),n=0,a=r.length;n<a;n++)Le(r[n],o[n]);else Le(e,s);return(o=xe(s,"script")).length>0&&pe(o,!l&&xe(e,"script")),s},cleanData:function(e){for(var t,i,n,a=S.event.special,r=0;void 0!==(i=e[r]);r++)if(X(i)){if(t=i[q.expando]){if(t.events)for(n in t.events)a[n]?S.event.remove(i,n):S.removeEvent(i,n,t.handle);i[q.expando]=void 0}i[K.expando]&&(i[K.expando]=void 0)}}}),S.fn.extend({detach:function(e){return je(this,e,!0)},remove:function(e){return je(this,e)},text:function(e){return V(this,(function(e){return void 0===e?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Oe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Fe(this,e).appendChild(e)}))},prepend:function(){return Oe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Fe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Oe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Oe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(xe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return S.clone(this,e,t)}))},html:function(e){return V(this,(function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ie.test(e)&&!fe[(ue.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;i<n;i++)1===(t=this[i]||{}).nodeType&&(S.cleanData(xe(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Oe(this,arguments,(function(t){var i=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(xe(this)),i&&i.replaceChild(t,this))}),e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){S.fn[e]=function(e){for(var i,n=[],a=S(e),r=a.length-1,o=0;o<=r;o++)i=o===r?this:this.clone(!0),S(a[o])[t](i),s.apply(n,i.get());return this.pushStack(n)}}));var Ne=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),Ue=function(t){var i=t.ownerDocument.defaultView;return i&&i.opener||(i=e),i.getComputedStyle(t)},ze=new RegExp(ne.join("|"),"i");function He(e,t,i){var n,a,r,o,s=e.style;return(i=i||Ue(e))&&(""!==(o=i.getPropertyValue(t)||i[t])||S.contains(e.ownerDocument,e)||(o=S.style(e,t)),!x.pixelBoxStyles()&&Ne.test(o)&&ze.test(t)&&(n=s.width,a=s.minWidth,r=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=i.width,s.width=n,s.minWidth=a,s.maxWidth=r)),void 0!==o?o+"":o}function Ve(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(d){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",d.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ye.appendChild(c).appendChild(d);var t=e.getComputedStyle(d);a="1%"!==t.top,l=12===i(t.marginLeft),d.style.right="60%",s=36===i(t.right),r=36===i(t.width),d.style.position="absolute",o=36===d.offsetWidth||"absolute",ye.removeChild(c),d=null}}function i(e){return Math.round(parseFloat(e))}var a,r,o,s,l,c=n.createElement("div"),d=n.createElement("div");d.style&&(d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",x.clearCloneStyle="content-box"===d.style.backgroundClip,S.extend(x,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),a},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o}}))}();var Ze=/^(none|table(?!-c[ea]).+)/,We=/^--/,Ge={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"},Xe=["Webkit","Moz","ms"],Je=n.createElement("div").style;function qe(e){var t=S.cssProps[e];return t||(t=S.cssProps[e]=function(e){if(e in Je)return e;for(var t=e[0].toUpperCase()+e.slice(1),i=Xe.length;i--;)if((e=Xe[i]+t)in Je)return e}(e)||e),t}function Ke(e,t,i){var n=ie.exec(t);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):t}function $e(e,t,i,n,a,r){var o="width"===t?1:0,s=0,l=0;if(i===(n?"border":"content"))return 0;for(;o<4;o+=2)"margin"===i&&(l+=S.css(e,i+ne[o],!0,a)),n?("content"===i&&(l-=S.css(e,"padding"+ne[o],!0,a)),"margin"!==i&&(l-=S.css(e,"border"+ne[o]+"Width",!0,a))):(l+=S.css(e,"padding"+ne[o],!0,a),"padding"!==i?l+=S.css(e,"border"+ne[o]+"Width",!0,a):s+=S.css(e,"border"+ne[o]+"Width",!0,a));return!n&&r>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-r-l-s-.5))),l}function Qe(e,t,i){var n=Ue(e),a=He(e,t,n),r="border-box"===S.css(e,"boxSizing",!1,n),o=r;if(Ne.test(a)){if(!i)return a;a="auto"}return o=o&&(x.boxSizingReliable()||a===e.style[t]),("auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,n))&&(a=e["offset"+t[0].toUpperCase()+t.slice(1)],o=!0),(a=parseFloat(a)||0)+$e(e,t,i||(r?"border":"content"),o,n,a)+"px"}function et(e,t,i,n,a){return new et.prototype.init(e,t,i,n,a)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=He(e,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var a,r,o,s=Y(t),l=We.test(t),c=e.style;if(l||(t=qe(s)),o=S.cssHooks[t]||S.cssHooks[s],void 0===i)return o&&"get"in o&&void 0!==(a=o.get(e,!1,n))?a:c[t];"string"==(r=typeof i)&&(a=ie.exec(i))&&a[1]&&(i=oe(e,t,a),r="number"),null!=i&&i==i&&("number"===r&&(i+=a&&a[3]||(S.cssNumber[s]?"":"px")),x.clearCloneStyle||""!==i||0!==t.indexOf("background")||(c[t]="inherit"),o&&"set"in o&&void 0===(i=o.set(e,i,n))||(l?c.setProperty(t,i):c[t]=i))}},css:function(e,t,i,n){var a,r,o,s=Y(t);return We.test(t)||(t=qe(s)),(o=S.cssHooks[t]||S.cssHooks[s])&&"get"in o&&(a=o.get(e,!0,i)),void 0===a&&(a=He(e,t,n)),"normal"===a&&t in Ye&&(a=Ye[t]),""===i||i?(r=parseFloat(a),!0===i||isFinite(r)?r||0:a):a}}),S.each(["height","width"],(function(e,t){S.cssHooks[t]={get:function(e,i,n){if(i)return!Ze.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Qe(e,t,n):re(e,Ge,(function(){return Qe(e,t,n)}))},set:function(e,i,n){var a,r=Ue(e),o="border-box"===S.css(e,"boxSizing",!1,r),s=n&&$e(e,t,n,o,r);return o&&x.scrollboxSize()===r.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(r[t])-$e(e,t,"border",!1,r)-.5)),s&&(a=ie.exec(i))&&"px"!==(a[3]||"px")&&(e.style[t]=i,i=S.css(e,t)),Ke(0,i,s)}}})),S.cssHooks.marginLeft=Ve(x.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-re(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(e,t){S.cssHooks[e+t]={expand:function(i){for(var n=0,a={},r="string"==typeof i?i.split(" "):[i];n<4;n++)a[e+ne[n]+t]=r[n]||r[n-2]||r[0];return a}},"margin"!==e&&(S.cssHooks[e+t].set=Ke)})),S.fn.extend({css:function(e,t){return V(this,(function(e,t,i){var n,a,r={},o=0;if(Array.isArray(t)){for(n=Ue(e),a=t.length;o<a;o++)r[t[o]]=S.css(e,t[o],!1,n);return r}return void 0!==i?S.style(e,t,i):S.css(e,t)}),e,t,arguments.length>1)}}),S.Tween=et,et.prototype={constructor:et,init:function(e,t,i,n,a,r){this.elem=e,this.prop=i,this.easing=a||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=r||(S.cssNumber[i]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,i=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):et.propHooks._default.set(this),this}},et.prototype.init.prototype=et.prototype,et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[S.cssProps[e.prop]]&&!S.cssHooks[e.prop]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}},et.propHooks.scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,it,nt=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function rt(){it&&(!1===n.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(rt):e.setTimeout(rt,S.fx.interval),S.fx.tick())}function ot(){return e.setTimeout((function(){tt=void 0})),tt=Date.now()}function st(e,t){var i,n=0,a={height:e};for(t=t?1:0;n<4;n+=2-t)a["margin"+(i=ne[n])]=a["padding"+i]=e;return t&&(a.opacity=a.width=e),a}function lt(e,t,i){for(var n,a=(ct.tweeners[t]||[]).concat(ct.tweeners["*"]),r=0,o=a.length;r<o;r++)if(n=a[r].call(i,t,e))return n}function ct(e,t,i){var n,a,r=0,o=ct.prefilters.length,s=S.Deferred().always((function(){delete l.elem})),l=function(){if(a)return!1;for(var t=tt||ot(),i=Math.max(0,c.startTime+c.duration-t),n=1-(i/c.duration||0),r=0,o=c.tweens.length;r<o;r++)c.tweens[r].run(n);return s.notifyWith(e,[c,n,i]),n<1&&o?i:(o||s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},i),originalProperties:t,originalOptions:i,startTime:tt||ot(),duration:i.duration,tweens:[],createTween:function(t,i){var n=S.Tween(e,c.opts,t,i,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(n),n},stop:function(t){var i=0,n=t?c.tweens.length:0;if(a)return this;for(a=!0;i<n;i++)c.tweens[i].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),d=c.props;for(function(e,t){var i,n,a,r,o;for(i in e)if(a=t[n=Y(i)],r=e[i],Array.isArray(r)&&(a=r[1],r=e[i]=r[0]),i!==n&&(e[n]=r,delete e[i]),(o=S.cssHooks[n])&&"expand"in o)for(i in r=o.expand(r),delete e[n],r)i in e||(e[i]=r[i],t[i]=a);else t[n]=a}(d,c.opts.specialEasing);r<o;r++)if(n=ct.prefilters[r].call(c,e,d,c.opts))return p(n.stop)&&(S._queueHooks(c.elem,c.opts.queue).stop=n.stop.bind(n)),n;return S.map(d,lt,c),p(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),S.fx.timer(S.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}S.Animation=S.extend(ct,{tweeners:{"*":[function(e,t){var i=this.createTween(e,t);return oe(i.elem,e,ie.exec(t),i),i}]},tweener:function(e,t){p(e)?(t=e,e=["*"]):e=e.match(B);for(var i,n=0,a=e.length;n<a;n++)i=e[n],ct.tweeners[i]=ct.tweeners[i]||[],ct.tweeners[i].unshift(t)},prefilters:[function(e,t,i){var n,a,r,o,s,l,c,d,u="width"in t||"height"in t,h=this,f={},x=e.style,p=e.nodeType&&ae(e),m=q.get(e,"fxshow");for(n in i.queue||(null==(o=S._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,s=o.empty.fire,o.empty.fire=function(){o.unqueued||s()}),o.unqueued++,h.always((function(){h.always((function(){o.unqueued--,S.queue(e,"fx").length||o.empty.fire()}))}))),t)if(a=t[n],nt.test(a)){if(delete t[n],r=r||"toggle"===a,a===(p?"hide":"show")){if("show"!==a||!m||void 0===m[n])continue;p=!0}f[n]=m&&m[n]||S.style(e,n)}if((l=!S.isEmptyObject(t))||!S.isEmptyObject(f))for(n in u&&1===e.nodeType&&(i.overflow=[x.overflow,x.overflowX,x.overflowY],null==(c=m&&m.display)&&(c=q.get(e,"display")),"none"===(d=S.css(e,"display"))&&(c?d=c:(ce([e],!0),c=e.style.display||c,d=S.css(e,"display"),ce([e]))),("inline"===d||"inline-block"===d&&null!=c)&&"none"===S.css(e,"float")&&(l||(h.done((function(){x.display=c})),null==c&&(d=x.display,c="none"===d?"":d)),x.display="inline-block")),i.overflow&&(x.overflow="hidden",h.always((function(){x.overflow=i.overflow[0],x.overflowX=i.overflow[1],x.overflowY=i.overflow[2]}))),l=!1,f)l||(m?"hidden"in m&&(p=m.hidden):m=q.access(e,"fxshow",{display:c}),r&&(m.hidden=!p),p&&ce([e],!0),h.done((function(){for(n in p||ce([e]),q.remove(e,"fxshow"),f)S.style(e,n,f[n])}))),l=lt(p?m[n]:0,n,h),n in m||(m[n]=l.start,p&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?ct.prefilters.unshift(e):ct.prefilters.push(e)}}),S.speed=function(e,t,i){var n=e&&"object"==typeof e?S.extend({},e):{complete:i||!i&&t||p(e)&&e,duration:e,easing:i&&t||t&&!p(t)&&t};return S.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in S.fx.speeds?n.duration=S.fx.speeds[n.duration]:n.duration=S.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){p(n.old)&&n.old.call(this),n.queue&&S.dequeue(this,n.queue)},n},S.fn.extend({fadeTo:function(e,t,i,n){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var a=S.isEmptyObject(e),r=S.speed(t,i,n),o=function(){var t=ct(this,S.extend({},e),r);(a||q.get(this,"finish"))&&t.stop(!0)};return o.finish=o,a||!1===r.queue?this.each(o):this.queue(r.queue,o)},stop:function(e,t,i){var n=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each((function(){var t=!0,a=null!=e&&e+"queueHooks",r=S.timers,o=q.get(this);if(a)o[a]&&o[a].stop&&n(o[a]);else for(a in o)o[a]&&o[a].stop&&at.test(a)&&n(o[a]);for(a=r.length;a--;)r[a].elem!==this||null!=e&&r[a].queue!==e||(r[a].anim.stop(i),t=!1,r.splice(a,1));!t&&i||S.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,i=q.get(this),n=i[e+"queue"],a=i[e+"queueHooks"],r=S.timers,o=n?n.length:0;for(i.finish=!0,S.queue(this,e,[]),a&&a.stop&&a.stop.call(this,!0),t=r.length;t--;)r[t].elem===this&&r[t].queue===e&&(r[t].anim.stop(!0),r.splice(t,1));for(t=0;t<o;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish}))}}),S.each(["toggle","show","hide"],(function(e,t){var i=S.fn[t];S.fn[t]=function(e,n,a){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(t,!0),e,n,a)}})),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){S.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}})),S.timers=[],S.fx.tick=function(){var e,t=0,i=S.timers;for(tt=Date.now();t<i.length;t++)(e=i[t])()||i[t]!==e||i.splice(t--,1);i.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){it||(it=!0,rt())},S.fx.stop=function(){it=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,i){return t=S.fx&&S.fx.speeds[t]||t,i=i||"fx",this.queue(i,(function(i,n){var a=e.setTimeout(i,t);n.stop=function(){e.clearTimeout(a)}}))},function(){var e=n.createElement("input"),t=n.createElement("select").appendChild(n.createElement("option"));e.type="checkbox",x.checkOn=""!==e.value,x.optSelected=t.selected,(e=n.createElement("input")).value="t",e.type="radio",x.radioValue="t"===e.value}();var dt,ut=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return V(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){S.removeAttr(this,e)}))}}),S.extend({attr:function(e,t,i){var n,a,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===e.getAttribute?S.prop(e,t,i):(1===r&&S.isXMLDoc(e)||(a=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?dt:void 0)),void 0!==i?null===i?void S.removeAttr(e,t):a&&"set"in a&&void 0!==(n=a.set(e,i,t))?n:(e.setAttribute(t,i+""),i):a&&"get"in a&&null!==(n=a.get(e,t))?n:null==(n=S.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!x.radioValue&&"radio"===t&&w(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},removeAttr:function(e,t){var i,n=0,a=t&&t.match(B);if(a&&1===e.nodeType)for(;i=a[n++];)e.removeAttribute(i)}}),dt={set:function(e,t,i){return!1===t?S.removeAttr(e,i):e.setAttribute(i,i),i}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(e,t){var i=ut[t]||S.find.attr;ut[t]=function(e,t,n){var a,r,o=t.toLowerCase();return n||(r=ut[o],ut[o]=a,a=null!=i(e,t,n)?o:null,ut[o]=r),a}}));var ht=/^(?:input|select|textarea|button)$/i,ft=/^(?:a|area)$/i;function xt(e){return(e.match(B)||[]).join(" ")}function pt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(B)||[]}S.fn.extend({prop:function(e,t){return V(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[S.propFix[e]||e]}))}}),S.extend({prop:function(e,t,i){var n,a,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&S.isXMLDoc(e)||(t=S.propFix[t]||t,a=S.propHooks[t]),void 0!==i?a&&"set"in a&&void 0!==(n=a.set(e,i,t))?n:e[t]=i:a&&"get"in a&&null!==(n=a.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||ft.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),x.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(e){var t,i,n,a,r,o,s,l=0;if(p(e))return this.each((function(t){S(this).addClass(e.call(this,t,pt(this)))}));if((t=mt(e)).length)for(;i=this[l++];)if(a=pt(i),n=1===i.nodeType&&" "+xt(a)+" "){for(o=0;r=t[o++];)n.indexOf(" "+r+" ")<0&&(n+=r+" ");a!==(s=xt(n))&&i.setAttribute("class",s)}return this},removeClass:function(e){var t,i,n,a,r,o,s,l=0;if(p(e))return this.each((function(t){S(this).removeClass(e.call(this,t,pt(this)))}));if(!arguments.length)return this.attr("class","");if((t=mt(e)).length)for(;i=this[l++];)if(a=pt(i),n=1===i.nodeType&&" "+xt(a)+" "){for(o=0;r=t[o++];)for(;n.indexOf(" "+r+" ")>-1;)n=n.replace(" "+r+" "," ");a!==(s=xt(n))&&i.setAttribute("class",s)}return this},toggleClass:function(e,t){var i=typeof e,n="string"===i||Array.isArray(e);return"boolean"==typeof t&&n?t?this.addClass(e):this.removeClass(e):p(e)?this.each((function(i){S(this).toggleClass(e.call(this,i,pt(this),t),t)})):this.each((function(){var t,a,r,o;if(n)for(a=0,r=S(this),o=mt(e);t=o[a++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else void 0!==e&&"boolean"!==i||((t=pt(this))&&q.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":q.get(this,"__className__")||""))}))},hasClass:function(e){var t,i,n=0;for(t=" "+e+" ";i=this[n++];)if(1===i.nodeType&&(" "+xt(pt(i))+" ").indexOf(t)>-1)return!0;return!1}});var _t=/\r/g;S.fn.extend({val:function(e){var t,i,n,a=this[0];return arguments.length?(n=p(e),this.each((function(i){var a;1===this.nodeType&&(null==(a=n?e.call(this,i,S(this).val()):e)?a="":"number"==typeof a?a+="":Array.isArray(a)&&(a=S.map(a,(function(e){return null==e?"":e+""}))),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,a,"value")||(this.value=a))}))):a?(t=S.valHooks[a.type]||S.valHooks[a.nodeName.toLowerCase()])&&"get"in t&&void 0!==(i=t.get(a,"value"))?i:"string"==typeof(i=a.value)?i.replace(_t,""):null==i?"":i:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:xt(S.text(e))}},select:{get:function(e){var t,i,n,a=e.options,r=e.selectedIndex,o="select-one"===e.type,s=o?null:[],l=o?r+1:a.length;for(n=r<0?l:o?r:0;n<l;n++)if(((i=a[n]).selected||n===r)&&!i.disabled&&(!i.parentNode.disabled||!w(i.parentNode,"optgroup"))){if(t=S(i).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var i,n,a=e.options,r=S.makeArray(t),o=a.length;o--;)((n=a[o]).selected=S.inArray(S.valHooks.option.get(n),r)>-1)&&(i=!0);return i||(e.selectedIndex=-1),r}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},x.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),x.focusin="onfocusin"in e;var gt=/^(?:focusinfocus|focusoutblur)$/,vt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,i,a,r){var o,s,l,c,d,h,f,x,_=[a||n],g=u.call(t,"type")?t.type:t,v=u.call(t,"namespace")?t.namespace.split("."):[];if(s=x=l=a=a||n,3!==a.nodeType&&8!==a.nodeType&&!gt.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),d=g.indexOf(":")<0&&"on"+g,(t=t[S.expando]?t:new S.Event(g,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=a),i=null==i?[t]:S.makeArray(i,[t]),f=S.event.special[g]||{},r||!f.trigger||!1!==f.trigger.apply(a,i))){if(!r&&!f.noBubble&&!m(a)){for(c=f.delegateType||g,gt.test(c+g)||(s=s.parentNode);s;s=s.parentNode)_.push(s),l=s;l===(a.ownerDocument||n)&&_.push(l.defaultView||l.parentWindow||e)}for(o=0;(s=_[o++])&&!t.isPropagationStopped();)x=s,t.type=o>1?c:f.bindType||g,(h=(q.get(s,"events")||{})[t.type]&&q.get(s,"handle"))&&h.apply(s,i),(h=d&&s[d])&&h.apply&&X(s)&&(t.result=h.apply(s,i),!1===t.result&&t.preventDefault());return t.type=g,r||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(_.pop(),i)||!X(a)||d&&p(a[g])&&!m(a)&&((l=a[d])&&(a[d]=null),S.event.triggered=g,t.isPropagationStopped()&&x.addEventListener(g,vt),a[g](),t.isPropagationStopped()&&x.removeEventListener(g,vt),S.event.triggered=void 0,l&&(a[d]=l)),t.result}},simulate:function(e,t,i){var n=S.extend(new S.Event,i,{type:e,isSimulated:!0});S.event.trigger(n,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each((function(){S.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var i=this[0];if(i)return S.event.trigger(e,t,i,!0)}}),x.focusin||S.each({focus:"focusin",blur:"focusout"},(function(e,t){var i=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var n=this.ownerDocument||this,a=q.access(n,t);a||n.addEventListener(e,i,!0),q.access(n,t,(a||0)+1)},teardown:function(){var n=this.ownerDocument||this,a=q.access(n,t)-1;a?q.access(n,t,a):(n.removeEventListener(e,i,!0),q.remove(n,t))}}}));var yt=e.location,St=Date.now(),bt=/\?/;S.parseXML=function(t){var i;if(!t||"string"!=typeof t)return null;try{i=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){i=void 0}return i&&!i.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+t),i};var Pt=/\[\]$/,Et=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,Tt=/^(?:input|select|textarea|keygen)/i;function Rt(e,t,i,n){var a;if(Array.isArray(t))S.each(t,(function(t,a){i||Pt.test(e)?n(e,a):Rt(e+"["+("object"==typeof a&&null!=a?t:"")+"]",a,i,n)}));else if(i||"object"!==v(t))n(e,t);else for(a in t)Rt(e+"["+a+"]",t[a],i,n)}S.param=function(e,t){var i,n=[],a=function(e,t){var i=p(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==i?"":i)};if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,(function(){a(this.name,this.value)}));else for(i in e)Rt(i,e[i],t,a);return n.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Tt.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!de.test(e))})).map((function(e,t){var i=S(this).val();return null==i?null:Array.isArray(i)?S.map(i,(function(e){return{name:t.name,value:e.replace(Et,"\r\n")}})):{name:t.name,value:i.replace(Et,"\r\n")}})).get()}});var wt=/%20/g,It=/#.*$/,Dt=/([?&])_=[^&]*/,kt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,At=/^\/\//,Mt={},Lt={},Bt="*/".concat("*"),Ot=n.createElement("a");function jt(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,a=0,r=t.toLowerCase().match(B)||[];if(p(i))for(;n=r[a++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function Nt(e,t,i,n){var a={},r=e===Lt;function o(s){var l;return a[s]=!0,S.each(e[s]||[],(function(e,s){var c=s(t,i,n);return"string"!=typeof c||r||a[c]?r?!(l=c):void 0:(t.dataTypes.unshift(c),o(c),!1)})),l}return o(t.dataTypes[0])||!a["*"]&&o("*")}function Ut(e,t){var i,n,a=S.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((a[i]?e:n||(n={}))[i]=t[i]);return n&&S.extend(!0,e,n),e}Ot.href=yt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(yt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Bt,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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,S.ajaxSettings),t):Ut(S.ajaxSettings,e)},ajaxPrefilter:jt(Mt),ajaxTransport:jt(Lt),ajax:function(t,i){"object"==typeof t&&(i=t,t=void 0),i=i||{};var a,r,o,s,l,c,d,u,h,f,x=S.ajaxSetup({},i),p=x.context||x,m=x.context&&(p.nodeType||p.jquery)?S(p):S.event,_=S.Deferred(),g=S.Callbacks("once memory"),v=x.statusCode||{},y={},b={},P="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(d){if(!s)for(s={};t=kt.exec(o);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return d?o:null},setRequestHeader:function(e,t){return null==d&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,y[e]=t),this},overrideMimeType:function(e){return null==d&&(x.mimeType=e),this},statusCode:function(e){var t;if(e)if(d)E.always(e[E.status]);else for(t in e)v[t]=[v[t],e[t]];return this},abort:function(e){var t=e||P;return a&&a.abort(t),C(0,t),this}};if(_.promise(E),x.url=((t||x.url||yt.href)+"").replace(At,yt.protocol+"//"),x.type=i.method||i.type||x.method||x.type,x.dataTypes=(x.dataType||"*").toLowerCase().match(B)||[""],null==x.crossDomain){c=n.createElement("a");try{c.href=x.url,c.href=c.href,x.crossDomain=Ot.protocol+"//"+Ot.host!=c.protocol+"//"+c.host}catch(e){x.crossDomain=!0}}if(x.data&&x.processData&&"string"!=typeof x.data&&(x.data=S.param(x.data,x.traditional)),Nt(Mt,x,i,E),d)return E;for(h in(u=S.event&&x.global)&&0==S.active++&&S.event.trigger("ajaxStart"),x.type=x.type.toUpperCase(),x.hasContent=!Ft.test(x.type),r=x.url.replace(It,""),x.hasContent?x.data&&x.processData&&0===(x.contentType||"").indexOf("application/x-www-form-urlencoded")&&(x.data=x.data.replace(wt,"+")):(f=x.url.slice(r.length),x.data&&(x.processData||"string"==typeof x.data)&&(r+=(bt.test(r)?"&":"?")+x.data,delete x.data),!1===x.cache&&(r=r.replace(Dt,"$1"),f=(bt.test(r)?"&":"?")+"_="+St+++f),x.url=r+f),x.ifModified&&(S.lastModified[r]&&E.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&E.setRequestHeader("If-None-Match",S.etag[r])),(x.data&&x.hasContent&&!1!==x.contentType||i.contentType)&&E.setRequestHeader("Content-Type",x.contentType),E.setRequestHeader("Accept",x.dataTypes[0]&&x.accepts[x.dataTypes[0]]?x.accepts[x.dataTypes[0]]+("*"!==x.dataTypes[0]?", "+Bt+"; q=0.01":""):x.accepts["*"]),x.headers)E.setRequestHeader(h,x.headers[h]);if(x.beforeSend&&(!1===x.beforeSend.call(p,E,x)||d))return E.abort();if(P="abort",g.add(x.complete),E.done(x.success),E.fail(x.error),a=Nt(Lt,x,i,E)){if(E.readyState=1,u&&m.trigger("ajaxSend",[E,x]),d)return E;x.async&&x.timeout>0&&(l=e.setTimeout((function(){E.abort("timeout")}),x.timeout));try{d=!1,a.send(y,C)}catch(e){if(d)throw e;C(-1,e)}}else C(-1,"No Transport");function C(t,i,n,s){var c,h,f,y,b,P=i;d||(d=!0,l&&e.clearTimeout(l),a=void 0,o=s||"",E.readyState=t>0?4:0,c=t>=200&&t<300||304===t,n&&(y=function(e,t,i){for(var n,a,r,o,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(a in s)if(s[a]&&s[a].test(n)){l.unshift(a);break}if(l[0]in i)r=l[0];else{for(a in i){if(!l[0]||e.converters[a+" "+l[0]]){r=a;break}o||(o=a)}r=r||o}if(r)return r!==l[0]&&l.unshift(r),i[r]}(x,E,n)),y=function(e,t,i,n){var a,r,o,s,l,c={},d=e.dataTypes.slice();if(d[1])for(o in e.converters)c[o.toLowerCase()]=e.converters[o];for(r=d.shift();r;)if(e.responseFields[r]&&(i[e.responseFields[r]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=r,r=d.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(o=c[l+" "+r]||c["* "+r]))for(a in c)if((s=a.split(" "))[1]===r&&(o=c[l+" "+s[0]]||c["* "+s[0]])){!0===o?o=c[a]:!0!==c[a]&&(r=s[0],d.unshift(s[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+r}}}return{state:"success",data:t}}(x,y,E,c),c?(x.ifModified&&((b=E.getResponseHeader("Last-Modified"))&&(S.lastModified[r]=b),(b=E.getResponseHeader("etag"))&&(S.etag[r]=b)),204===t||"HEAD"===x.type?P="nocontent":304===t?P="notmodified":(P=y.state,h=y.data,c=!(f=y.error))):(f=P,!t&&P||(P="error",t<0&&(t=0))),E.status=t,E.statusText=(i||P)+"",c?_.resolveWith(p,[h,P,E]):_.rejectWith(p,[E,P,f]),E.statusCode(v),v=void 0,u&&m.trigger(c?"ajaxSuccess":"ajaxError",[E,x,c?h:f]),g.fireWith(p,[E,P]),u&&(m.trigger("ajaxComplete",[E,x]),--S.active||S.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,i){return S.get(e,t,i,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],(function(e,t){S[t]=function(e,i,n,a){return p(i)&&(a=a||n,n=i,i=void 0),S.ajax(S.extend({url:e,type:t,dataType:a,data:i,success:n},S.isPlainObject(e)&&e))}})),S._evalUrl=function(e){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(p(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return p(e)?this.each((function(t){S(this).wrapInner(e.call(this,t))})):this.each((function(){var t=S(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)}))},wrap:function(e){var t=p(e);return this.each((function(i){S(this).wrapAll(t?e.call(this,i):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var zt={0:200,1223:204},Ht=S.ajaxSettings.xhr();x.cors=!!Ht&&"withCredentials"in Ht,x.ajax=Ht=!!Ht,S.ajaxTransport((function(t){var i,n;if(x.cors||Ht&&!t.crossDomain)return{send:function(a,r){var o,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)s[o]=t.xhrFields[o];for(o in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||a["X-Requested-With"]||(a["X-Requested-With"]="XMLHttpRequest"),a)s.setRequestHeader(o,a[o]);i=function(e){return function(){i&&(i=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?r(0,"error"):r(s.status,s.statusText):r(zt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=i(),n=s.onerror=s.ontimeout=i("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){i&&n()}))},i=i("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(i)throw e}},abort:function(){i&&i()}}})),S.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),S.ajaxTransport("script",(function(e){var t,i;if(e.crossDomain)return{send:function(a,r){t=S("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",i=function(e){t.remove(),i=null,e&&r("error"===e.type?404:200,e.type)}),n.head.appendChild(t[0])},abort:function(){i&&i()}}}));var Vt,Zt=[],Wt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Zt.pop()||S.expando+"_"+St++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",(function(t,i,n){var a,r,o,s=!1!==t.jsonp&&(Wt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return a=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Wt,"$1"+a):!1!==t.jsonp&&(t.url+=(bt.test(t.url)?"&":"?")+t.jsonp+"="+a),t.converters["script json"]=function(){return o||S.error(a+" was not called"),o[0]},t.dataTypes[0]="json",r=e[a],e[a]=function(){o=arguments},n.always((function(){void 0===r?S(e).removeProp(a):e[a]=r,t[a]&&(t.jsonpCallback=i.jsonpCallback,Zt.push(a)),o&&p(r)&&r(o[0]),o=r=void 0})),"script"})),x.createHTMLDocument=((Vt=n.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),S.parseHTML=function(e,t,i){return"string"!=typeof e?[]:("boolean"==typeof t&&(i=t,t=!1),t||(x.createHTMLDocument?((a=(t=n.implementation.createHTMLDocument("")).createElement("base")).href=n.location.href,t.head.appendChild(a)):t=n),o=!i&&[],(r=I.exec(e))?[t.createElement(r[1])]:(r=ve([e],t,o),o&&o.length&&S(o).remove(),S.merge([],r.childNodes)));var a,r,o},S.fn.load=function(e,t,i){var n,a,r,o=this,s=e.indexOf(" ");return s>-1&&(n=xt(e.slice(s)),e=e.slice(0,s)),p(t)?(i=t,t=void 0):t&&"object"==typeof t&&(a="POST"),o.length>0&&S.ajax({url:e,type:a||"GET",dataType:"html",data:t}).done((function(e){r=arguments,o.html(n?S("<div>").append(S.parseHTML(e)).find(n):e)})).always(i&&function(e,t){o.each((function(){i.apply(this,r||[e.responseText,t,e])}))}),this},S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){S.fn[t]=function(e){return this.on(t,e)}})),S.expr.pseudos.animated=function(e){return S.grep(S.timers,(function(t){return e===t.elem})).length},S.offset={setOffset:function(e,t,i){var n,a,r,o,s,l,c=S.css(e,"position"),d=S(e),u={};"static"===c&&(e.style.position="relative"),s=d.offset(),r=S.css(e,"top"),l=S.css(e,"left"),("absolute"===c||"fixed"===c)&&(r+l).indexOf("auto")>-1?(o=(n=d.position()).top,a=n.left):(o=parseFloat(r)||0,a=parseFloat(l)||0),p(t)&&(t=t.call(e,i,S.extend({},s))),null!=t.top&&(u.top=t.top-s.top+o),null!=t.left&&(u.left=t.left-s.left+a),"using"in t?t.using.call(e,u):d.css(u)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){S.offset.setOffset(this,e,t)}));var t,i,n=this[0];return n?n.getClientRects().length?(t=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:t.top+i.pageYOffset,left:t.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,i,n=this[0],a={top:0,left:0};if("fixed"===S.css(n,"position"))t=n.getBoundingClientRect();else{for(t=this.offset(),i=n.ownerDocument,e=n.offsetParent||i.documentElement;e&&(e===i.body||e===i.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==n&&1===e.nodeType&&((a=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),a.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-a.top-S.css(n,"marginTop",!0),left:t.left-a.left-S.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||ye}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var i="pageYOffset"===t;S.fn[e]=function(n){return V(this,(function(e,n,a){var r;if(m(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===a)return r?r[t]:e[n];r?r.scrollTo(i?r.pageXOffset:a,i?a:r.pageYOffset):e[n]=a}),e,n,arguments.length)}})),S.each(["top","left"],(function(e,t){S.cssHooks[t]=Ve(x.pixelPosition,(function(e,i){if(i)return i=He(e,t),Ne.test(i)?S(e).position()[t]+"px":i}))})),S.each({Height:"height",Width:"width"},(function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},(function(i,n){S.fn[n]=function(a,r){var o=arguments.length&&(i||"boolean"!=typeof a),s=i||(!0===a||!0===r?"margin":"border");return V(this,(function(t,i,a){var r;return m(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(r=t.documentElement,Math.max(t.body["scroll"+e],r["scroll"+e],t.body["offset"+e],r["offset"+e],r["client"+e])):void 0===a?S.css(t,i,s):S.style(t,i,a,s)}),t,o?a:void 0,o)}}))})),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){S.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}})),S.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.fn.extend({bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)}}),S.proxy=function(e,t){var i,n,a;if("string"==typeof t&&(i=e[t],t=e,e=i),p(e))return n=r.call(arguments,2),a=function(){return e.apply(t||this,n.concat(r.call(arguments)))},a.guid=e.guid=e.guid||S.guid++,a},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=w,S.isFunction=p,S.isWindow=m,S.camelCase=Y,S.type=v,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))};var Gt=e.jQuery,Yt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=Yt),t&&e.jQuery===S&&(e.jQuery=Gt),S},t||(e.jQuery=e.$=S),S}))}(Rt);var wt=Tt(Rt.exports);function It(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Dt(e,t)}function Dt(e,t){return Dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Dt(e,t)}var kt=null,Ft=Symbol("CANVAS"),At=Symbol("CONTEXT"),Mt=Symbol("SHAPES"),Lt=Symbol("DRAWSTATUS"),Bt=Symbol("SHAPETYPE"),Ot=Symbol("MAXSHAPENUMSUPPORT"),jt=Symbol("SHAPESTYLE"),Nt=Symbol("POLYGONDRAWING"),Ut=Symbol("CURRENTSHAPEINFO"),zt=Symbol("DRAWSHAPEMULTIONETIME"),Ht=Symbol("EVENTCALLBACK");function Vt(){kt[At].clearRect(0,0,kt.m_iCanvasWidth,kt.m_iCanvasHeight);for(var e=0,t=kt[Mt].length;e<t;e++)kt[Mt][e].draw()}function Zt(e){kt[Mt].length<kt[Ot]&&kt[Mt].push(e)}function Wt(){var e=!1,t={},i=0,n=0,a=0,r=0,o=0,s=0,l="draw",c=null;function d(){for(var e=-1,t=0,i=kt[Mt].length;t<i;t++)if(kt[Mt][t].m_bChoosed){e=t;break}return e}kt[Ft][0].oncontextmenu=function(){return!1},kt[Ft][0].onselectstart=function(){return!1},kt[Ft].unbind(),kt[Ft].bind("mousedown",(function(t){if(2===t.button)kt[Nt]&&c&&c.m_aPoint.length>=c.m_iMinClosed&&(c.m_bClosed=!0,kt[Nt]=!1,c.setPointInfo(c.m_aPoint),Zt(c),Vt(),e=!1,kt[zt]||(kt[Lt]=!1),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,c.m_szType,"onDrawEnd",c.m_szId));else if(0===t.button){if(e){if(Math.abs(t.offsetX-i)>2&&Math.abs(t.offsetY-n)>2&&(Zt(c),kt[zt]||(kt[Lt]=!1)),kt[Ht]){var a,r={startPos:[],endPos:[]};r.startPos=[i,n],r.endPos=[t.offsetX,t.offsetY],null==(a=kt[Ht])||a.call(kt,r),kt.clearAllShape()}return c=null,void(e=!1)}if(i=t.offsetX,n=t.offsetY,l="draw",!kt[Nt]){var o=d();if(-1!==o&&kt[Mt][o].inArc(t.offsetX,t.offsetY,5)&&(l="stretch"),"stretch"!==l)for(var s=0,u=kt[Mt].length;s<u;s++)kt[Mt][s].inShape(t.offsetX,t.offsetY)&&2!==kt[Mt][s].m_iEditType?(kt[Mt][s].m_bChoosed=!0,kt[Mt][s].getMouseDownPoints(t.offsetX,t.offsetY),l="drag",null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,kt[Mt][s].m_szType,"onChoose",kt[Mt][s].m_szId)):kt[Mt][s].m_bChoosed=!1;kt[Ft][0].style.cursor="drag"===l?"move":"default","draw"===l&&1===kt[Mt].length&&1===kt[Mt][0].m_iRedrawMode&&(kt.deleteRepeatPolyonById(kt[Mt][0].m_szId),kt[Lt]=!0),kt[Lt]&&!kt[zt]&&(l="draw")}if("draw"===l&&kt[Lt]){if(kt[Ot]<=kt[Mt].length&&"Grid"!==kt[Bt]&&"Point"!==kt[Bt])return;"Rect"===kt[Bt]?(c=new Yt).m_szTips=kt[Ut].szTips||"":"Grid"===kt[Bt]?0===kt[Mt].length&&Zt(c=new Jt):"Polygon"===kt[Bt]?(kt[Nt]||(kt[Nt]=!0,(c=new Kt).m_szId=kt[Ut].szId||"",c.m_szTips=kt[Ut].szTips||"",c.m_iMinClosed=kt[Ut].iMinClosed||3,c.m_iMaxPointNum=kt[Ut].iMaxPointNum||11,c.m_iPolygonType=kt[Ut].iPolygonType,c.m_szDrawColor=kt[Ut].szDrawColor,c.m_szFillColor=kt[Ut].szFillColor,c.m_iTranslucent=kt[Ut].iTranslucent,c.m_iRedrawMode=kt[Ut].iRedrawMode),1===c.m_iPolygonType&&(c.addPoint(i,n),c.m_aPoint.length===c.m_iMaxPointNum&&(c.m_bClosed=!0,kt[Nt]=!1,Zt(c),Vt(),e=!1,kt[zt]||(kt[Lt]=!1),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,c.m_szType,"onDrawEnd",c.m_szId)))):"Point"===kt[Bt]&&(kt.clearShapeByType("Point"),(c=new $t).m_szId=kt[Ut].szId||"",c.m_szDrawColor=kt[Ut].szDrawColor,c.setPointInfo([[i,n]]),Zt(c),Vt())}e=!0}})),kt[Ft].bind("mouseenter",(function(a){t={isIn:!0,offsetX:a.offsetX,offsetY:a.offsetY},kt[Lt]&&e&&("Rect"===kt[Bt]?c.move([[i,n],[a.offsetX,a.offsetY]]):"Grid"===kt[Bt]&&kt[Mt][0].move(i,n,a.offsetX,a.offsetY))})),kt[Ft].bind("mouseleave",(function(e){t={isIn:!1,offsetX:e.offsetX,offsetY:e.offsetY}})),kt[Ft].bind("mousemove",(function(a){if(kt[Nt])kt[Lt]&&e&&("Polygon"===kt[Bt]&&0===c.m_iPolygonType&&(c.m_bClosed=!0),Vt(),c.move(a.offsetX,a.offsetY,i,n));else{var r=d();r>-1?e&&("drag"===l?(kt[Mt][r].drag(a.offsetX,a.offsetY),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,kt[Mt][r].m_szType,"onDrag",kt[Mt][r].m_szId)):"stretch"===l&&(kt[Mt][r].stretch(a.offsetX,a.offsetY),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,kt[Mt][r].m_szType,"onStretch",kt[Mt][r].m_szId))):kt[Lt]&&e&&t.isIn&&("Rect"===kt[Bt]?c.move([[i,n],[a.offsetX,a.offsetY]]):"Grid"===kt[Bt]&&kt[Mt][0].move(i,n,a.offsetX,a.offsetY))}})),kt[Ft].bind("mouseup",(function(t){if(kt[Ft][0].style.cursor="default",null!=c&&"draw"===l)if("Rect"===kt[Bt]){if(Math.abs(t.offsetX-i)>2&&Math.abs(t.offsetY-n)>2&&(Zt(c),kt[zt]||(kt[Lt]=!1)),kt[Ht]){var a,r={startPos:[],endPos:[]};r.startPos=[i,n],r.endPos=[t.offsetX,t.offsetY],null==(a=kt[Ht])||a.call(kt,r),kt.clearAllShape()}c=null}else"Polygon"===kt[Bt]&&0===c.m_iPolygonType&&kt[Nt]&&Math.abs(t.offsetX-i)>2&&Math.abs(t.offsetY-n)>2&&(Zt(c),kt[Nt]=!1,kt[zt]||(kt[Lt]=!1),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,c.m_szType,"onDrawEnd",c.m_szId));e=!!kt[Nt],kt[Nt]||Vt()})),kt[Ft].bind("dblclick",(function(){kt[Lt]&&"Grid"===kt[Bt]&&(kt[Mt][0].m_szGridMap="fffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffc",Vt())})),kt[Ft].bind("touchstart",(function(t){var i,n=t.target.getBoundingClientRect();if(null==(i=t.touches)?void 0:i[0]){if(a=parseInt(t.touches[0].clientX-n.x)>0?parseInt(t.touches[0].clientX-n.x):0,r=parseInt(t.touches[0].clientY-n.y)>0?parseInt(t.touches[0].clientY-n.y):0,l="draw",kt[Lt]){if(kt[Ot]<=kt[Mt].length&&"Grid"!==kt[Bt]&&"Point"!==kt[Bt])return;"Rect"===kt[Bt]?(c=new Yt).m_szTips=kt[Ut].szTips||"":"Grid"===kt[Bt]?0===kt[Mt].length&&Zt(c=new Jt):"Polygon"===kt[Bt]?(kt[Nt]||(kt[Nt]=!0,(c=new Kt).m_szId=kt[Ut].szId||"",c.m_szTips=kt[Ut].szTips||"",c.m_iMinClosed=kt[Ut].iMinClosed||3,c.m_iMaxPointNum=kt[Ut].iMaxPointNum||11,c.m_iPolygonType=kt[Ut].iPolygonType,c.m_szDrawColor=kt[Ut].szDrawColor,c.m_szFillColor=kt[Ut].szFillColor,c.m_iTranslucent=kt[Ut].iTranslucent,c.m_iRedrawMode=kt[Ut].iRedrawMode),1===c.m_iPolygonType&&(c.addPoint(a,r),c.m_aPoint.length===c.m_iMaxPointNum&&(c.m_bClosed=!0,kt[Nt]=!1,Zt(c),Vt(),e=!1,kt[zt]||(kt[Lt]=!1),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,c.m_szType,"onDrawEnd",c.m_szId)))):"Point"===kt[Bt]&&(kt.clearShapeByType("Point"),(c=new $t).m_szId=kt[Ut].szId||"",c.m_szDrawColor=kt[Ut].szDrawColor,c.setPointInfo([[a,r]]),Zt(c),Vt())}e=!0}})),kt[Ft].bind("touchmove",(function(t){var i,n=t.target.getBoundingClientRect();if(null==(i=t.touches)?void 0:i[0])if(o=parseInt(t.touches[0].clientX-n.x)>0?parseInt(t.touches[0].clientX-n.x):0,s=parseInt(t.touches[0].clientY-n.y)>0?parseInt(t.touches[0].clientY-n.y):0,kt[Nt])kt[Lt]&&e&&("Polygon"===kt[Bt]&&0===c.m_iPolygonType&&(c.m_bClosed=!0),Vt(),c.move(t.touches[0].offsetX,t.touches[0].offsetY,a,r));else{var u=d();u>-1?e&&("drag"===l?(kt[Mt][u].drag(o,s),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,kt[Mt][u].m_szType,"onDrag",kt[Mt][u].m_szId)):"stretch"===l&&(kt[Mt][u].stretch(o,s),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,kt[Mt][u].m_szType,"onStretch",kt[Mt][u].m_szId))):kt[Lt]&&e&&("Rect"===kt[Bt]?c.move([[2*a,2*r],[2*o,2*s]]):"Grid"===kt[Bt]&&kt[Mt][0].move(a,r,o,s))}})),kt[Ft].bind("touchend",(function(t){if(a!=o||r!=s){if(kt[Ft][0].style.cursor="default",null!=c&&"draw"===l)if("Rect"===kt[Bt]){if(Math.abs(o-a)>2&&Math.abs(s-r)>2&&(Zt(c),kt[zt]||(kt[Lt]=!1)),kt[Ht]&&Math.abs(o-a)>15&&Math.abs(s-r)>15){var i,n={startPos:[],endPos:[]};n.startPos=[a,r],n.endPos=[o,s],null==(i=kt[Ht])||i.call(kt,n)}kt.clearAllShape(),c=null}else"Polygon"===kt[Bt]&&0===c.m_iPolygonType&&kt[Nt]&&Math.abs(o-a)>2&&Math.abs(s-r)>2&&(Zt(c),kt[Nt]=!1,kt[zt]||(kt[Lt]=!1),null==window.onDrawShapeEvent||window.onDrawShapeEvent.call(window,c.m_szType,"onDrawEnd",c.m_szId));e=!!kt[Nt],kt[Nt]||Vt()}}))}var Gt=function(){function e(){this.m_szId="",this.m_aPoint=[],this.m_bChoosed=!1,this.m_szDrawColor=kt[jt].szDrawColor,this.m_szFillColor=kt[jt].szFillColor,this.m_iTranslucent=kt[jt].iTranslucent,this.m_iIndexChoosePoint=-1,this.m_iDriftStartX=0,this.m_iDriftStartY=0,this.m_oEdgePoints={top:{x:0,y:0},left:{x:0,y:0},right:{x:0,y:0},bottom:{x:0,y:0}},this.m_szTips="",this.m_iEditType=0,this.m_iMinClosed=3,this.m_iMaxPointNum=11,this.m_bClosed=!1,this.m_iRedrawMode=0}var t=e.prototype;return t.draw=function(){},t.drag=function(e,t){if(2!==this.m_iEditType){var i=this.m_aPoint.length,n=0;for(n=0;n<i;n++)if(this.m_aPoint[n][0]+e-this.m_iDriftStartX>kt.m_iCanvasWidth||this.m_aPoint[n][1]+t-this.m_iDriftStartY>kt.m_iCanvasHeight||this.m_aPoint[n][0]+e-this.m_iDriftStartX<0||this.m_aPoint[n][1]+t-this.m_iDriftStartY<0)return this.m_iDriftStartX=e,void(this.m_iDriftStartY=t);for(n=0;n<i;n++)this.m_aPoint[n][0]=this.m_aPoint[n][0]+e-this.m_iDriftStartX,this.m_aPoint[n][1]=this.m_aPoint[n][1]+t-this.m_iDriftStartY;this.m_iDriftStartX=e,this.m_iDriftStartY=t,this.setPointInfo(this.m_aPoint),Vt()}},t.stretch=function(e,t){0===this.m_iEditType&&(-1!==this.m_iIndexChoosePoint&&(this.m_aPoint[this.m_iIndexChoosePoint][0]=e,this.m_aPoint[this.m_iIndexChoosePoint][1]=t),this.setPointInfo(this.m_aPoint),Vt())},t.inShape=function(e,t){for(var i=!1,n=this.m_aPoint.length,a=0,r=n-1;a<n;r=a++)this.m_aPoint[a][1]>t!=this.m_aPoint[r][1]>t&&e<(this.m_aPoint[r][0]-this.m_aPoint[a][0])*(t-this.m_aPoint[a][1])/(this.m_aPoint[r][1]-this.m_aPoint[a][1])+this.m_aPoint[a][0]&&(i=!i);return i},t.inArc=function(e,t,i){for(var n=!1,a=0,r=this.m_aPoint.length;a<r;a++)if(Math.sqrt((e-this.m_aPoint[a][0])*(e-this.m_aPoint[a][0])+(t-this.m_aPoint[a][1])*(t-this.m_aPoint[a][1]))<i){n=!0,this.m_iIndexChoosePoint=a;break}return n},t.getMouseDownPoints=function(e,t){this.m_iDriftStartX=e,this.m_iDriftStartY=t},t.getPointInfo=function(){return this.m_aPoint},t.setPointInfo=function(e){null!=e&&e.length>0&&(this.m_aPoint=e,this.setEdgePoints(e))},t.addPoint=function(e,t){this.m_aPoint.length<this.m_iMaxPointNum&&this.m_aPoint.push([e,t]),this.m_aPoint.length===this.m_iMaxPointNum&&this.setPointInfo(this.m_aPoint)},t.setEdgePoints=function(e){for(var t=0,i=e.length;t<i;t++)0===t?(this.m_oEdgePoints.top.x=e[t][0],this.m_oEdgePoints.top.y=e[t][1],this.m_oEdgePoints.left.x=e[t][0],this.m_oEdgePoints.left.y=e[t][1],this.m_oEdgePoints.right.x=e[t][0],this.m_oEdgePoints.right.y=e[t][1],this.m_oEdgePoints.bottom.x=e[t][0],this.m_oEdgePoints.bottom.y=e[t][1]):(e[t][1]<this.m_oEdgePoints.top.y&&(this.m_oEdgePoints.top.x=e[t][0],this.m_oEdgePoints.top.y=e[t][1]),e[t][0]>this.m_oEdgePoints.right.x&&(this.m_oEdgePoints.right.x=e[t][0],this.m_oEdgePoints.right.y=e[t][1]),e[t][1]>this.m_oEdgePoints.bottom.y&&(this.m_oEdgePoints.bottom.x=e[t][0],this.m_oEdgePoints.bottom.y=e[t][1]),e[t][0]<this.m_oEdgePoints.left.x&&(this.m_oEdgePoints.left.x=e[t][0],this.m_oEdgePoints.left.y=e[t][1]))},e}(),Yt=function(e){function t(){var t;return(t=e.call(this)||this).m_szType="Rect",t}It(t,e);var i=t.prototype;return i.setPointInfo=function(e){if(null!=e){for(var t=e[0][0],i=e[0][1],n=e[0][0],a=e[0][1],r=0,o=e.length;r<o;r++)t>e[r][0]&&(t=e[r][0]),i>e[r][1]&&(i=e[r][1]),n<e[r][0]&&(n=e[r][0]),a<e[r][1]&&(a=e[r][1]);this.m_aPoint=[[t,i],[n,i],[n,a],[t,a]]}},i.draw=function(){kt[At].fillStyle=this.m_szFillColor,kt[At].strokeStyle=this.m_szDrawColor;var e=this.m_aPoint[0][0],t=this.m_aPoint[0][1],i=this.m_aPoint[2][0]-e,n=this.m_aPoint[2][1]-t;if(kt[At].globalAlpha=this.m_iTranslucent,kt[At].fillRect(e,t,i,n),kt[At].globalAlpha=1,kt[At].fillText(this.m_szTips,(e+this.m_aPoint[2][0])/2,(t+this.m_aPoint[2][1])/2),this.m_bChoosed){var a=Math.round(i/2),r=Math.round(n/2);if(0===this.m_iEditType)for(var o=[e,e+a,e+i,e,e+i,e,e+a,e+i],s=[t,t,t,t+r,t+r,t+n,t+n,t+n],l=0;l<8;l++)kt[At].beginPath(),kt[At].arc(o[l],s[l],3,0,360,!1),kt[At].fillStyle=this.m_szDrawColor,kt[At].closePath(),kt[At].fill()}kt[At].strokeRect(e,t,i,n)},i.stretch=function(e,t){0===this.m_iEditType&&(0===this.m_iIndexChoosePoint?e<this.m_aPoint[2][0]&&t<this.m_aPoint[2][1]&&(this.m_aPoint[0][0]=e,this.m_aPoint[0][1]=t,this.m_aPoint[3][0]=e,this.m_aPoint[1][1]=t):1===this.m_iIndexChoosePoint?t<this.m_aPoint[2][1]&&(this.m_aPoint[0][1]=t,this.m_aPoint[1][1]=t):2===this.m_iIndexChoosePoint?e>this.m_aPoint[3][0]&&t<this.m_aPoint[3][1]&&(this.m_aPoint[1][0]=e,this.m_aPoint[1][1]=t,this.m_aPoint[2][0]=e,this.m_aPoint[0][1]=t):3===this.m_iIndexChoosePoint?e<this.m_aPoint[2][0]&&(this.m_aPoint[0][0]=e,this.m_aPoint[3][0]=e):4===this.m_iIndexChoosePoint?e>this.m_aPoint[0][0]&&(this.m_aPoint[1][0]=e,this.m_aPoint[2][0]=e):5===this.m_iIndexChoosePoint?e<this.m_aPoint[1][0]&&t>this.m_aPoint[1][1]&&(this.m_aPoint[3][0]=e,this.m_aPoint[3][1]=t,this.m_aPoint[0][0]=e,this.m_aPoint[2][1]=t):6===this.m_iIndexChoosePoint?t>this.m_aPoint[1][1]&&(this.m_aPoint[2][1]=t,this.m_aPoint[3][1]=t):7===this.m_iIndexChoosePoint&&e>this.m_aPoint[0][0]&&t>this.m_aPoint[0][1]&&(this.m_aPoint[2][0]=e,this.m_aPoint[2][1]=t,this.m_aPoint[1][0]=e,this.m_aPoint[3][1]=t),Vt())},i.move=function(e){Vt(),this.m_bChoosed=!0;var t=e[0][0],i=e[0][1],n=e[1][0],a=e[1][1];this.setPointInfo([[t,i],[n,i],[n,a],[t,a]]),this.draw()},i.inArc=function(e,t,i){for(var n=this.m_aPoint[0][0],a=this.m_aPoint[0][1],r=this.m_aPoint[2][0]-n,o=this.m_aPoint[2][1]-a,s=Math.round(r/2),l=Math.round(o/2),c=[n,n+s,n+r,n,n+r,n,n+s,n+r],d=[a,a,a,a+l,a+l,a+o,a+o,a+o],u=0;u<8;u++)if(Math.sqrt((e-c[u])*(e-c[u])+(t-d[u])*(t-d[u]))<i)return this.m_iIndexChoosePoint=u,!0;return!1},t}(Gt),Xt=function(e){function t(t,i){var n;return(n=e.call(this)||this).m_szType="RectOSD",n.m_szOSDType="overlay-date",n.m_szText=t||"",n.m_szEnabled=i||"",n.m_szDateStyle="",n.m_szClockType="",n.m_szDisplayWeek="",n.m_szId="",n.m_szAlignment="0",n}It(t,e);var i=t.prototype;return i.draw=function(){if("true"===this.m_szEnabled){var e=this.m_aPoint[0][0],t=this.m_aPoint[0][1],i=this.m_aPoint[2][0]-e,n=this.m_aPoint[2][1]-t;kt[At].beginPath(),kt[At].strokeStyle=this.m_szDrawColor,kt[At].globalAlpha=1,kt[At].rect(e,t,i,n),kt[At].font="15px serif",kt[At].strokeText(this.m_szText,e,t+15),kt[At].stroke()}},i.drag=function(e,t){var i=this.m_aPoint.length,n=0;if("0"===this.m_szAlignment){for(n=0;n<i;n++)if(this.m_aPoint[n][1]+t-this.m_iDriftStartY>kt.m_iCanvasHeight||this.m_aPoint[n][0]+e-this.m_iDriftStartX<0||this.m_aPoint[n][1]+t-this.m_iDriftStartY<0)return this.m_iDriftStartX=e,void(this.m_iDriftStartY=t);for(n=0;n<i;n++)this.m_aPoint[n][0]=this.m_aPoint[n][0]+e-this.m_iDriftStartX,this.m_aPoint[n][1]=this.m_aPoint[n][1]+t-this.m_iDriftStartY}else if("1"===this.m_szAlignment||"2"===this.m_szAlignment){for(n=0;n<i;n++)if(this.m_aPoint[n][1]+t-this.m_iDriftStartY>kt.m_iCanvasHeight||this.m_aPoint[n][1]+t-this.m_iDriftStartY<0)return this.m_iDriftStartX=e,void(this.m_iDriftStartY=t);for(n=0;n<i;n++)this.m_aPoint[n][1]=this.m_aPoint[n][1]+t-this.m_iDriftStartY}this.m_iDriftStartX=e,this.m_iDriftStartY=t,this.setEdgePoints(this.m_aPoint),Vt()},i.stretch=function(){},t}(Gt),Jt=function(e){function t(){var t;return(t=e.call(this)||this).m_szType="Grid",t.m_iGridColNum=22,t.m_iGridRowNum=18,t.m_szGridMap="",t.m_aAddGridMap=[],t}It(t,e);var i=t.prototype;return i.draw=function(){for(var e=kt.m_iCanvasWidth/this.m_iGridColNum,t=kt.m_iCanvasHeight/this.m_iGridRowNum,i="",n=0;n<this.m_iGridRowNum;n++){for(var a=this.m_szGridMap.substring(6*n,6*n+6),r=parseInt("f"+a,16).toString(2).split("").slice(4),o="",s=0;s<this.m_iGridColNum;s++){var l="";"1"===r[s]?(kt[At].strokeStyle=this.m_szDrawColor,kt[At].globalAlpha=1,kt[At].strokeRect(e*s,t*n,e,t),l="1"):l="0",this.m_aAddGridMap.length&&1===this.m_aAddGridMap[n][s]&&(kt[At].strokeStyle=this.m_szDrawColor,kt[At].strokeRect(e*s,t*n,e,t),l="1"),o+=l}i+=parseInt("1111"+o+"00",2).toString(16).substring(1)}this.m_szGridMap=i},i.move=function(e,t,i,n){var a,r,o=kt.m_iCanvasWidth/this.m_iGridColNum,s=kt.m_iCanvasHeight/this.m_iGridRowNum,l=Math.floor(e/o),c=Math.floor(t/s),d=Math.floor(Math.abs(i-e)/o),u=Math.floor(Math.abs(n-t)/s);a=i-e>0?1:-1,r=n-t>0?1:-1;for(var h=[],f=0;f<this.m_iGridRowNum;f++){h[f]=[];for(var x=0;x<this.m_iGridColNum;x++)h[f][x]=1===a?1===r?f>=c&&f<=c+u&&x>=l&&x<=l+d?1:0:f<=c&&f>=c-u&&x>=l&&x<=l+d?1:0:1===r?f>=c&&f<=c+u&&x<=l&&x>=l-d?1:0:f<=c&&f>=c-u&&x<=l&&x>=l-d?1:0}this.m_aAddGridMap=h,this.draw()},t}(Gt),qt=function(e){function t(){var t;return(t=e.call(this)||this).m_szType="Line",t.m_iLineType=0,t.m_iDirection=0,t.m_iArrowType=0,t.m_aCrossArrowPoint=[],t}It(t,e);var i=t.prototype;return i.draw=function(){0===this.m_iLineType?this.drawNormalLine():1===this.m_iLineType?this.drawArrowLine():3===this.m_iLineType?this.drawCrossLine():4===this.m_iLineType&&this.drawLineCount()},i.drawNormalLine=function(){if(kt[At].globalAlpha=1,this.m_aPoint.length>0){kt[At].beginPath(),kt[At].strokeStyle=this.m_szDrawColor,kt[At].lineWidth=2,kt[At].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]);for(var e=1,t=this.m_aPoint.length;e<t;e++)kt[At].lineTo(this.m_aPoint[e][0],this.m_aPoint[e][1]);if(kt[At].stroke(),this.m_bChoosed)for(var i=0,n=this.m_aPoint.length;i<n;i++)kt[At].beginPath(),kt[At].fillStyle=this.m_szDrawColor,kt[At].arc(this.m_aPoint[i][0],this.m_aPoint[i][1],3,0,2*Math.PI,!0),kt[At].closePath(),kt[At].fill();""!==this.m_szTips&&(kt[At].strokeStyle=this.m_szDrawColor,kt[At].fillText(this.m_szTips,this.m_aPoint[0][0]+10,this.m_aPoint[0][1]+4))}},i.drawArrowLine=function(e,t,i,n,a,r,o,s){r=void 0!==r?r:30,o=void 0!==o?o:10,s=void 0!==s?s:1;var l=180*Math.atan2(i-a,t-n)/Math.PI,c=(l+r)*Math.PI/180,d=(l-r)*Math.PI/180,u=o*Math.cos(c),h=o*Math.sin(c),f=o*Math.cos(d),x=o*Math.sin(d);kt[At].save(),kt[At].beginPath();var p=t-u,m=i-h;kt[At].moveTo(p,m),kt[At].lineTo(t,i),p=t-f,m=i-x,kt[At].lineTo(p,m),kt[At].moveTo(t,i),kt[At].lineTo(n,a),1===e&&(p=n+u,m=a+h,kt[At].moveTo(p,m),kt[At].lineTo(n,a),p=n+f,m=a+x,kt[At].lineTo(p,m)),kt[At].strokeStyle=this.m_szDrawColor,kt[At].lineWidth=s,kt[At].stroke(),kt[At].restore()},i.drawCrossLine=function(){this.drawNormalLine();var e=(this.m_aPoint[0][0]+this.m_aPoint[1][0])/2,t=(this.m_aPoint[0][1]+this.m_aPoint[1][1])/2,i=180*Math.atan2(t-this.m_aPoint[0][1],e-this.m_aPoint[0][0])/Math.PI,n=(i+90)*Math.PI/180,a=(i-90)*Math.PI/180,r=25*Math.cos(n),o=25*Math.sin(n),s=25*Math.cos(a),l=25*Math.sin(a),c=0,d=0;c=e-r,d=t-o;var u=0,h=0;0===this.m_iDirection?(u=-10,h=-15):1===this.m_iDirection?(u=10,h=10):(u=10,h=-15),0!==this.m_iDirection&&this.drawArrowLine(0,c,d,e,t),kt[At].strokeStyle=this.m_szDrawColor,kt[At].font="8px",kt[At].strokeText("A",c+u,d+4),c=e-s,d=t-l,1!==this.m_iDirection&&this.drawArrowLine(0,c,d,e,t),kt[At].strokeStyle=this.m_szDrawColor,kt[At].font="8px",kt[At].strokeText("B",c+h,d+4)},i.drawLineCount=function(){this.drawNormalLine();var e=(this.m_aPoint[0][0]+this.m_aPoint[1][0])/2,t=(this.m_aPoint[0][1]+this.m_aPoint[1][1])/2,i=180*Math.atan2(t-this.m_aPoint[0][1],e-this.m_aPoint[0][0])/Math.PI,n=(i+90)*Math.PI/180,a=(i-90)*Math.PI/180,r=25*Math.cos(n),o=25*Math.sin(n),s=25*Math.cos(a),l=25*Math.sin(a),c=0,d=0;c=e-r,d=t-o,1===this.m_iArrowType?(c=e-s,d=t-l,this.drawArrowLine(0,c,d,e,t)):0===this.m_iArrowType&&this.drawArrowLine(0,c,d,e,t),this.m_aCrossArrowPoint=[[e,t],[c,d]]},i.inShape=function(e,t){for(var i=!1,n=0,a=this.m_aPoint.length-1;n<a;n++){var r=Math.sqrt((this.m_aPoint[n+1][0]-this.m_aPoint[n][0])*(this.m_aPoint[n+1][0]-this.m_aPoint[n][0])+(this.m_aPoint[n+1][1]-this.m_aPoint[n][1])*(this.m_aPoint[n+1][1]-this.m_aPoint[n][1]));Math.sqrt((e-this.m_aPoint[n][0])*(e-this.m_aPoint[n][0])+(t-this.m_aPoint[n][1])*(t-this.m_aPoint[n][1]))+Math.sqrt((e-this.m_aPoint[n+1][0])*(e-this.m_aPoint[n+1][0])+(t-this.m_aPoint[n+1][1])*(t-this.m_aPoint[n+1][1]))-r<1&&(i=!0)}return i},t}(Gt),Kt=function(e){function t(){var t;return(t=e.call(this)||this).m_szType="Polygon",t.m_iPolygonType=1,t}It(t,e);var i=t.prototype;return i.setPointInfo=function(e){if(null!=e){if(0===this.m_iPolygonType){for(var t=e[0][0],i=e[0][1],n=e[0][0],a=e[0][1],r=0,o=e.length;r<o;r++)t>e[r][0]&&(t=e[r][0]),i>e[r][1]&&(i=e[r][1]),n<e[r][0]&&(n=e[r][0]),a<e[r][1]&&(a=e[r][1]);this.m_aPoint=[[t,i],[n,i],[n,a],[t,a]]}else this.m_iPolygonType,this.m_aPoint=e;this.setEdgePoints(e)}},i.draw=function(){if(this.m_aPoint.length>0){kt[At].fillStyle=this.m_szFillColor,kt[At].strokeStyle=this.m_szDrawColor,kt[At].globalAlpha=1;var e=0,t=0;if(this.m_bChoosed)for(e=0,t=this.m_aPoint.length;e<t;e++)kt[At].beginPath(),kt[At].arc(this.m_aPoint[e][0],this.m_aPoint[e][1],3,0,360,!1),kt[At].fillStyle=this.m_szDrawColor,kt[At].closePath(),kt[At].fill();for(kt[At].beginPath(),kt[At].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]),e=0,t=this.m_aPoint.length;e<t;e++)0!==e&&kt[At].lineTo(this.m_aPoint[e][0],this.m_aPoint[e][1]);kt[At].stroke(),this.m_bClosed&&(kt[At].fillText(this.m_szTips,(this.m_oEdgePoints.left.x+this.m_oEdgePoints.right.x)/2,(this.m_oEdgePoints.top.y+this.m_oEdgePoints.bottom.y)/2),kt[At].closePath(),kt[At].stroke(),kt[At].globalAlpha=this.m_iTranslucent,kt[At].fill())}},i.move=function(e,t,i,n){if(1===this.m_iPolygonType){if(this.m_aPoint.length<this.m_iMaxPointNum&&this.m_aPoint.length>0){kt[At].fillStyle=this.m_szFillColor,kt[At].strokeStyle=this.m_szDrawColor,kt[At].globalAlpha=1;var a=0,r=0;for(a=0,r=this.m_aPoint.length;a<r;a++)kt[At].beginPath(),kt[At].arc(this.m_aPoint[a][0],this.m_aPoint[a][1],3,0,360,!1),kt[At].fillStyle=this.m_szDrawColor,kt[At].closePath(),kt[At].fill();for(kt[At].beginPath(),kt[At].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]),a=0,r=this.m_aPoint.length;a<r;a++)0!==a&&kt[At].lineTo(this.m_aPoint[a][0],this.m_aPoint[a][1]);kt[At].lineTo(e,t),kt[At].closePath(),kt[At].stroke()}}else if(0===this.m_iPolygonType){this.m_bChoosed=!0;var o=i,s=n,l=e,c=t;this.setPointInfo([[o,s],[l,s],[l,c],[o,c]]),this.draw()}},i.stretch=function(e,t){0===this.m_iEditType&&(1===this.m_iPolygonType?-1!==this.m_iIndexChoosePoint&&(this.m_aPoint[this.m_iIndexChoosePoint][0]=e,this.m_aPoint[this.m_iIndexChoosePoint][1]=t):0===this.m_iIndexChoosePoint?e<this.m_aPoint[2][0]&&t<this.m_aPoint[2][1]&&(this.m_aPoint[0][0]=e,this.m_aPoint[0][1]=t,this.m_aPoint[3][0]=e,this.m_aPoint[1][1]=t):1===this.m_iIndexChoosePoint?e>this.m_aPoint[3][0]&&t<this.m_aPoint[3][1]&&(this.m_aPoint[1][0]=e,this.m_aPoint[1][1]=t,this.m_aPoint[2][0]=e,this.m_aPoint[0][1]=t):2===this.m_iIndexChoosePoint?e>this.m_aPoint[0][0]&&t>this.m_aPoint[0][1]&&(this.m_aPoint[2][0]=e,this.m_aPoint[2][1]=t,this.m_aPoint[1][0]=e,this.m_aPoint[3][1]=t):3===this.m_iIndexChoosePoint&&e<this.m_aPoint[1][0]&&t>this.m_aPoint[1][1]&&(this.m_aPoint[3][0]=e,this.m_aPoint[3][1]=t,this.m_aPoint[0][0]=e,this.m_aPoint[2][1]=t),this.setPointInfo(this.m_aPoint),Vt())},t}(Gt),$t=function(e){function t(){var t;return(t=e.call(this)||this).m_szType="Point",t.m_szId="",t}It(t,e);var i=t.prototype;return i.draw=function(){kt[At].beginPath(),kt[At].fillStyle=this.m_szDrawColor,kt[At].globalAlpha=1,kt[At].arc(this.m_aPoint[0][0],this.m_aPoint[0][1],10,0,2*Math.PI,!0),kt[At].closePath(),kt[At].fill()},i.drag=function(){},i.stretch=function(){},t}(Gt),Qt=function(){function e(e){kt=this,this[Ft]=wt("#"+e),this[At]=this[Ft][0].getContext("2d"),this[Mt]=[],this[Lt]=!1,this[Bt]="Rect",this[Ot]=10,this[zt]=!0,this[Ut]={},this[Ht]=null,this[jt]={szDrawColor:"#ff0000",szFillColor:"#343434",iTranslucent:.7},this[Nt]=!1,this.m_iCanvasWidth=this[Ft].width(),this.m_iCanvasHeight=this[Ft].height(),this.m_iHorizontalResolution=0,this.m_iVerticalResolution=0,this.m_szDisplayMode="",this.m_szVideoFormat="",Wt(),this[Mt].length=0}var t=e.prototype;return t.setDrawMutiShapeOneTime=function(e){this[zt]=e},t.setMaxShapeSupport=function(e){this[Ot]=e},t.getMaxShapeSupport=function(){return this[Ot]},t.setDrawStatus=function(e,t){this[Lt]=e,t&&e&&(this[Ht]=t),e||(this[Ht]=null)},t.setShapeType=function(e){this[Bt]=e,Vt()},t.setCurrentShapeInfo=function(e){this[Ut]=e||{szId:"",szTips:"",iMinClosed:3,iMaxPointNum:11,iPolygonType:1,iRedrawMode:0}},t.getShapeType=function(){return this[Bt]},t.getAllShapesInfo=function(){for(var e=[],t=0,i=this[Mt].length;t<i;t++)"Grid"===this[Mt][t].m_szType?e.push({szType:this[Mt][t].m_szType,szGridMap:this[Mt][t].m_szGridMap,iGridColNum:this[Mt][t].m_iGridColNum,iGridRowNum:this[Mt][t].m_iGridRowNum}):"RectOSD"===this[Mt][t].m_szType?e.push({szType:this[Mt][t].m_szType,szText:this[Mt][t].m_szText,szEnabled:this[Mt][t].m_szEnabled,szOSDType:this[Mt][t].m_szOSDType,iPositionX:this[Mt][t].m_aPoint[0][0],iPositionY:this[Mt][t].m_aPoint[0][1],szDateStyle:this[Mt][t].m_szDateStyle,szClockType:this[Mt][t].m_szClockType,szDisplayWeek:this[Mt][t].m_szDisplayWeek,szId:this[Mt][t].m_szId,szAlignment:this[Mt][t].m_szAlignment}):e.push({szType:this[Mt][t].m_szType,aPoint:this[Mt][t].m_aPoint,szId:this[Mt][t].m_szId,bChoosed:this[Mt][t].m_bChoosed});return e},t.deleteRepeatPolyonById=function(e){var t=this.getAllShapesInfo(),i=t.length;if(i>0)for(var n=0;n<i;n++)"Polygon"===t[n].szType&&t[n].szId===e&&this.deleteShape(n)},t.getShapesInfoByType=function(e){for(var t=[],i=0,n=this[Mt].length;i<n;i++)this[Mt][i].m_szType===e&&("Grid"===this[Mt][i].m_szType?t.push({szType:this[Mt][i].m_szType,szGridMap:this[Mt][i].m_szGridMap,iGridColNum:this[Mt][i].m_iGridColNum,iGridRowNum:this[Mt][i].m_iGridRowNum}):"RectOSD"===this[Mt][i].m_szType?t.push({szType:this[Mt][i].m_szType,szText:this[Mt][i].m_szText,szEnabled:this[Mt][i].m_szEnabled,szOSDType:this[Mt][i].m_szOSDType,iPositionX:this[Mt][i].m_aPoint[0][0],iPositionY:this[Mt][i].m_aPoint[0][1],szDateStyle:this[Mt][i].m_szDateStyle,szClockType:this[Mt][i].m_szClockType,szDisplayWeek:this[Mt][i].m_szDisplayWeek,szId:this[Mt][i].m_szId,szAlignment:this[Mt][i].m_szAlignment}):"Polygon"===e?t.push({szType:this[Mt][i].m_szType,szId:this[Mt][i].m_szId,iPolygonType:this[Mt][i].m_iPolygonType,iMinClosed:this[Mt][i].m_iMinClosed,iMaxPointNum:this[Mt][i].m_iMaxPointNum,iEditType:this[Mt][i].m_iEditType,aPoint:this[Mt][i].m_aPoint,bClosed:this[Mt][i].m_bClosed,szTips:this[Mt][i].m_szTips,szDrawColor:this[Mt][i].m_szDrawColor,szFillColor:this[Mt][i].m_szFillColor,iTranslucent:this[Mt][i].m_iTranslucent}):"Line"===e?t.push({szType:this[Mt][i].m_szType,szId:this[Mt][i].m_szId,aPoint:this[Mt][i].m_aPoint,szTips:this[Mt][i].m_szTips,iLineType:this[Mt][i].m_iLineType,iDirection:this[Mt][i].m_iDirection,iArrowType:this[Mt][i].m_iArrowType,szDrawColor:this[Mt][i].m_szDrawColor,aCrossArrowPoint:this[Mt][i].m_aCrossArrowPoint}):"Rect"===e?t.push({szType:this[Mt][i].m_szType,iEditType:this[Mt][i].m_iEditType,aPoint:this[Mt][i].m_aPoint,szTips:this[Mt][i].m_szTips,szDrawColor:this[Mt][i].m_szDrawColor,szFillColor:this[Mt][i].m_szFillColor,iTranslucent:this[Mt][i].m_iTranslucent}):t.push({szType:this[Mt][i].m_szType,aPoint:this[Mt][i].m_aPoint}));return t},t.setShapesInfoByType=function(e,t){t||(t=[]);var i=null;if("Rect"===e||"Polygon"===e||"Line"===e||"Point"===e)for(var n=0,a=t.length;n<a;n++)"Rect"===e?((i=new Yt).m_iEditType=t[n].iEditType,i.m_szTips=t[n].szTips||"",i.m_szDrawColor=t[n].szDrawColor,i.m_szFillColor=t[n].szFillColor,i.m_iTranslucent=t[n].iTranslucent,i.m_iRedrawMode=t[n].iRedrawMode):"Polygon"===e?(i=new Kt,0===t[n].iPolygonType?i.m_bClosed=!0:i.m_bClosed=t[n].bClosed,i.m_szTips=t[n].szTips||"",i.m_szId=t[n].szId||"",i.m_iPolygonType=t[n].iPolygonType,i.m_iMinClosed=t[n].iMinClosed||3,i.m_iMaxPointNum=t[n].iMaxPointNum||11,i.m_iEditType=t[n].iEditType,i.m_szDrawColor=t[n].szDrawColor,i.m_szFillColor=t[n].szFillColor,i.m_iTranslucent=t[n].iTranslucent,i.m_iRedrawMode=t[n].iRedrawMode):"Line"===e?((i=new qt).m_iLineType=t[n].iLineType,i.m_szTips=t[n].szTips||"",i.m_szId=t[n].szId,i.m_iDirection=t[n].iDirection,i.m_iArrowType=t[n].iArrowType,i.m_szDrawColor=t[n].szDrawColor,i.setPointInfo(t[n].aPoint)):"Point"===e&&((i=new $t).m_szId=t[n].szId,i.m_szDrawColor=t[n].szDrawColor,i.setPointInfo(t[n].aPoint)),i.setPointInfo(t[n].aPoint),0===n&&(i.m_bChoosed=!0),Zt(i);else"Grid"===e&&((i=new Jt).m_szGridMap=t[0].szGridMap||"",i.m_iGridColNum=t[0].iGridColNum||22,i.m_iGridRowNum=t[0].iGridRowNum||18,Zt(i));Vt()},t.addOSDShape=function(e,t,i,n,a){i||n||(i=0,n=0),a||(a={});var r=new Xt(e,t),o=10*e.replace(/[^x00-xff]/g,"rr").length;r.m_szOSDType=a.szOSDType||"",r.m_szDateStyle=a.szDateStyle||"",r.m_szClockType=a.szClockType||"",r.m_szDisplayWeek=a.szDisplayWeek||"",r.m_szId=a.szId||"",r.m_szAlignment=""+a.szAlignment||"0","0"===r.m_szAlignment?r.m_aPoint=[[i,n],[o+i,n],[o+i,n+20],[i,n+20]]:"1"===r.m_szAlignment?r.m_aPoint=[[0,n],[o,n],[o,n+20],[0,n+20]]:"2"===r.m_szAlignment?r.m_aPoint=[[this.m_iCanvasWidth-o,n],[this.m_iCanvasWidth,n],[this.m_iCanvasWidth,n+20],[this.m_iCanvasWidth-o,n+20]]:r.m_aPoint=[[i,n],[o+i,n],[o+i,n+20],[i,n+20]],Zt(r),Vt()},t.selectShapeById=function(e,t){for(var i=0,n=kt[Mt].length;i<n;i++)e===kt[Mt][i].m_szType&&(t===kt[Mt][i].m_szId?kt[Mt][i].m_bChoosed=!0:kt[Mt][i].m_bChoosed=!1);Vt()},t.setCanvasSize=function(e,t){e>0&&t>0&&(this.m_iCanvasWidth=e,this.m_iCanvasHeight=t,Vt())},t.setDrawStyle=function(e,t,i){this[jt]={szDrawColor:e,szFillColor:t,iTranslucent:i}},t.clearAllShape=function(){this[Mt].length=0,kt[Nt]=!1,Vt()},t.clearShapeByType=function(e){for(var t=this[Mt].length;t>0;t--)this[Mt][t-1].m_szType===e&&("Grid"===e?(this[Mt][t-1].m_szGridMap="",this[Mt][t-1].m_aAddGridMap=[]):this[Mt].splice(t-1,1));"Polygon"===e&&(kt[Nt]=!1),Vt()},t.deleteShape=function(e){this[Mt].length>e&&this[Mt].splice(e,1),Vt()},t.updateCanvas=function(e){this[Ft]=wt("#"+e),this[At]=this[Ft][0].getContext("2d"),this.m_iCanvasWidth=this[Ft].width(),this.m_iCanvasHeight=this[Ft].height(),Wt()},t.resizeCanvas=function(){this.m_iCanvasWidth=this[Ft].width(),this.m_iCanvasHeight=this[Ft].height()},t.canvasRedraw=function(){Vt()},e}(),ei={info:"",log:"background: #4096ff; color: #FFF;",warn:"background: yellow; color: #FFF;",error:"background: red; color: #FFF;"},ti=function(){function e(e){void 0===e&&(e={}),this._options={level:"INFO",showTime:!1},this._levelNum=3,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),this.setOptions(e)}var t=e.prototype;return t.setOptions=function(e){var t;this._options=Object.assign({},this._options,e),this._levelNum=this._matchLevel(null!=(t=this._options.level)?t:"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)},t._matchLevel=function(e){var t=3;switch(e){case"INFO":t=3;break;case"LOG":t=2;break;case"WARN":t=1;break;case"ERROR":t=0}return t},t._loggerFactory=function(t,i){var n=console[t];if(i&&n){var a,r=this._options.name?"%c["+this._options.name+"]%c %c["+t.toUpperCase()+"]":"%c["+t.toUpperCase()+"]",o=[this._options.name?"background: green;color: #fff":null,this._options.name?"":null,ei[t]].filter((function(e){return null!=e}));return(a=n).bind.apply(a,[].concat([console,r],o))}return e.noop},t.getOptions=function(){return this._options},t.getVersion=function(){return"1.0.0-alpha.3"},e}();function ii(e){return(e=+e)<10&&(e="0"+e),e+""}ti.noop=function(){};var ni=["info","log","warn","error"],ai="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==w?w:"undefined"!=typeof self?self:{};function ri(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oi,si=Array.isArray,li="object"==typeof ai&&ai&&ai.Object===Object&&ai,ci=li,di="object"==typeof self&&self&&self.Object===Object&&self,ui=ci||di||Function("return this")(),hi=ui.Symbol,fi=hi,xi=Object.prototype,pi=xi.hasOwnProperty,mi=xi.toString,_i=fi?fi.toStringTag:void 0,gi=Object.prototype.toString,vi=hi?hi.toStringTag:void 0,yi=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":vi&&vi in Object(e)?function(e){var t=pi.call(e,_i),i=e[_i];try{e[_i]=void 0;var n=!0}catch(e){}var a=mi.call(e);return n&&(t?e[_i]=i:delete e[_i]),a}(e):function(e){return gi.call(e)}(e)},Si=function(e){return null!=e&&"object"==typeof e},bi=yi,Pi=Si,Ei=function(e){return"symbol"==typeof e||Pi(e)&&"[object Symbol]"==bi(e)},Ci=si,Ti=Ei,Ri=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wi=/^\w*$/,Ii=function(e,t){if(Ci(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Ti(e))||wi.test(e)||!Ri.test(e)||null!=t&&e in Object(t)},Di=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ki=ri(Di),Fi=yi,Ai=Di,Mi=function(e){if(!Ai(e))return!1;var t=Fi(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Li=ui["__core-js_shared__"],Bi=(oi=/[^.]+$/.exec(Li&&Li.keys&&Li.keys.IE_PROTO||""))?"Symbol(src)_1."+oi:"",Oi=Function.prototype.toString,ji=function(e){if(null!=e){try{return Oi.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ni=Mi,Ui=Di,zi=ji,Hi=/^\[object .+?Constructor\]$/,Vi=Function.prototype,Zi=Object.prototype,Wi=Vi.toString,Gi=Zi.hasOwnProperty,Yi=RegExp("^"+Wi.call(Gi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xi=function(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ui(e)||function(e){return!!Bi&&Bi in e}(e))&&(Ni(e)?Yi:Hi).test(zi(e))}(i)?i:void 0},Ji=Xi(Object,"create"),qi=Ji,Ki=Ji,$i=Object.prototype.hasOwnProperty,Qi=Ji,en=Object.prototype.hasOwnProperty,tn=Ji;function nn(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}nn.prototype.clear=function(){this.__data__=qi?qi(null):{},this.size=0},nn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},nn.prototype.get=function(e){var t=this.__data__;if(Ki){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return $i.call(t,e)?t[e]:void 0},nn.prototype.has=function(e){var t=this.__data__;return Qi?void 0!==t[e]:en.call(t,e)},nn.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=tn&&void 0===t?"__lodash_hash_undefined__":t,this};var an=nn,rn=function(e,t){return e===t||e!=e&&t!=t},on=rn,sn=function(e,t){for(var i=e.length;i--;)if(on(e[i][0],t))return i;return-1},ln=sn,cn=Array.prototype.splice,dn=sn,un=sn,hn=sn;function fn(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}fn.prototype.clear=function(){this.__data__=[],this.size=0},fn.prototype.delete=function(e){var t=this.__data__,i=ln(t,e);return!(i<0||(i==t.length-1?t.pop():cn.call(t,i,1),--this.size,0))},fn.prototype.get=function(e){var t=this.__data__,i=dn(t,e);return i<0?void 0:t[i][1]},fn.prototype.has=function(e){return un(this.__data__,e)>-1},fn.prototype.set=function(e,t){var i=this.__data__,n=hn(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var xn=fn,pn=Xi(ui,"Map"),mn=an,_n=xn,gn=pn,vn=function(e,t){var i=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?i["string"==typeof t?"string":"hash"]:i.map},yn=vn,Sn=vn,bn=vn,Pn=vn;function En(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}En.prototype.clear=function(){this.size=0,this.__data__={hash:new mn,map:new(gn||_n),string:new mn}},En.prototype.delete=function(e){var t=yn(this,e).delete(e);return this.size-=t?1:0,t},En.prototype.get=function(e){return Sn(this,e).get(e)},En.prototype.has=function(e){return bn(this,e).has(e)},En.prototype.set=function(e,t){var i=Pn(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};var Cn=En,Tn=Cn;function Rn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,a=t?t.apply(this,n):n[0],r=i.cache;if(r.has(a))return r.get(a);var o=e.apply(this,n);return i.cache=r.set(a,o)||r,o};return i.cache=new(Rn.Cache||Tn),i}Rn.Cache=Tn;var wn=Rn,In=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dn=/\\(\\)?/g,kn=function(e){var t=wn((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(In,(function(e,i,n,a){t.push(n?a.replace(Dn,"$1"):i||e)})),t}),(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}(),Fn=function(e,t){for(var i=-1,n=null==e?0:e.length,a=Array(n);++i<n;)a[i]=t(e[i],i,e);return a},An=Fn,Mn=si,Ln=Ei,Bn=hi?hi.prototype:void 0,On=Bn?Bn.toString:void 0,jn=function e(t){if("string"==typeof t)return t;if(Mn(t))return An(t,e)+"";if(Ln(t))return On?On.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i},Nn=function(e){return null==e?"":jn(e)},Un=si,zn=Ii,Hn=kn,Vn=Nn,Zn=function(e,t){return Un(e)?e:zn(e,t)?[e]:Hn(Vn(e))},Wn=Ei,Gn=function(e){if("string"==typeof e||Wn(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Yn=Zn,Xn=Gn,Jn=function(e,t){for(var i=0,n=(t=Yn(t,e)).length;null!=e&&i<n;)e=e[Xn(t[i++])];return i&&i==n?e:void 0},qn=Jn,Kn=function(e,t,i){var n=null==e?void 0:qn(e,t);return void 0===n?i:n},$n=ri(Kn),Qn=Object.prototype.hasOwnProperty,ea=yi,ta=Si,ia=function(e){return ta(e)&&"[object Arguments]"==ea(e)},na=Si,aa=Object.prototype,ra=aa.hasOwnProperty,oa=aa.propertyIsEnumerable,sa=ia(function(){return arguments}())?ia:function(e){return na(e)&&ra.call(e,"callee")&&!oa.call(e,"callee")},la=/^(?:0|[1-9]\d*)$/,ca=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&la.test(e))&&e>-1&&e%1==0&&e<t},da=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ua=Zn,ha=sa,fa=si,xa=ca,pa=da,ma=Gn,_a=function(e,t,i){for(var n=-1,a=(t=ua(t,e)).length,r=!1;++n<a;){var o=ma(t[n]);if(!(r=null!=e&&i(e,o)))break;e=e[o]}return r||++n!=a?r:!!(a=null==e?0:e.length)&&pa(a)&&xa(o,a)&&(fa(e)||ha(e))},ga=function(e,t){return null!=e&&Qn.call(e,t)},va=_a,ya=ri((function(e,t){return null!=e&&va(e,t,ga)})),Sa=Xi,ba=function(){try{var e=Sa(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Pa=ba,Ea=rn,Ca=Object.prototype.hasOwnProperty,Ta=function(e,t,i){var n=e[t];Ca.call(e,t)&&Ea(n,i)&&(void 0!==i||t in e)||function(e,t,i){"__proto__"==t&&Pa?Pa(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}(e,t,i)},Ra=Ta,wa=Zn,Ia=ca,Da=Di,ka=Gn,Fa=function(e,t,i,n){if(!Da(e))return e;for(var a=-1,r=(t=wa(t,e)).length,o=r-1,s=e;null!=s&&++a<r;){var l=ka(t[a]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(a!=o){var d=s[l];void 0===(c=n?n(d,l,s):void 0)&&(c=Da(d)?d:Ia(t[a+1])?[]:{})}Ra(s,l,c),s=s[l]}return e},Aa=Fa,Ma=ri((function(e,t,i){return null==e?e:Aa(e,t,i)})),La=Fa,Ba=ri((function(e,t,i,n){return n="function"==typeof n?n:void 0,null==e?e:La(e,t,i,n)})),Oa=Cn;function ja(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Oa;++t<i;)this.add(e[t])}ja.prototype.add=ja.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ja.prototype.has=function(e){return this.__data__.has(e)};var Na=ja,Ua=function(e){return e!=e},za=function(e,t){return e.has(t)},Ha=Xi(ui,"Set"),Va=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i},Za=Ha,Wa=Za&&1/Va(new Za([,-0]))[1]==1/0?function(e){return new Za(e)}:function(){},Ga=Na,Ya=function(e,t){return!(null==e||!e.length)&&function(e,t,i){return t==t?function(e,t,i){for(var n=-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}(e,t):function(e,t,i,n){for(var a=e.length,r=-1;++r<a;)if(t(e[r],r,e))return r;return-1}(e,Ua)}(e,t)>-1},Xa=function(e,t,i){for(var n=-1,a=null==e?0:e.length;++n<a;)if(i(t,e[n]))return!0;return!1},Ja=za,qa=Wa,Ka=Va,$a=ri((function(e){return e&&e.length?function(e,t,i){var n=-1,a=Ya,r=e.length,o=!0,s=[],l=s;if(i)o=!1,a=Xa;else if(r>=200){var c=t?null:qa(e);if(c)return Ka(c);o=!1,a=Ja,l=new Ga}else l=t?[]:s;e:for(;++n<r;){var d=e[n],u=t?t(d):d;if(d=i||0!==d?d:0,o&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),s.push(d)}else a(l,u,i)||(l!==s&&l.push(u),s.push(d))}return s}(e):[]}));const Qa=(e,t)=>{const i=[],n=[];return i.push(t),t||i.push(e.locale),e.enableFallback&&i.push(e.defaultLocale),i.filter(Boolean).map((e=>e.toString())).forEach((function(t){if(n.includes(t)||n.push(t),!e.enableFallback)return;const i=t.split("-");3===i.length&&n.push(`${i[0]}-${i[1]}`),n.push(i[0])})),$a(n)};class er{constructor(e){this.i18n=e,this.registry={},this.register("default",Qa)}register(e,t){if("function"!=typeof t){const e=t;t=()=>e}this.registry[e]=t}get(e){let t=this.registry[e]||this.registry[this.i18n.locale]||this.registry.default;return"function"==typeof t&&(t=t(this.i18n,e)),t instanceof Array||(t=[t]),t}}const tr=function({pluralizer:e,includeZero:t=!0,ordinal:i=!1}){return function(n,a){return[t&&0===a?"zero":"",e(a,i)].filter(Boolean)}}({pluralizer:(e,t)=>{const i=String(e).split("."),n=!i[1],a=Number(i[0])==e,r=a&&i[0].slice(-1),o=a&&i[0].slice(-2);return t?1==r&&11!=o?"one":2==r&&12!=o?"two":3==r&&13!=o?"few":"other":1==e&&n?"one":"other"},includeZero:!0});class ir{constructor(e){this.i18n=e,this.registry={},this.register("default",tr)}register(e,t){this.registry[e]=t}get(e){return this.registry[e]||this.registry[this.i18n.locale]||this.registry.default}}var nr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),ar=function(e){return nr.test(e)},rr="\\ud800-\\udfff",or="["+rr+"]",sr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",lr="\\ud83c[\\udffb-\\udfff]",cr="[^"+rr+"]",dr="(?:\\ud83c[\\udde6-\\uddff]){2}",ur="[\\ud800-\\udbff][\\udc00-\\udfff]",hr="(?:"+sr+"|"+lr+")?",fr="[\\ufe0e\\ufe0f]?",xr=fr+hr+"(?:\\u200d(?:"+[cr,dr,ur].join("|")+")"+fr+hr+")*",pr="(?:"+[cr+sr+"?",sr,dr,ur,or].join("|")+")",mr=RegExp(lr+"(?="+lr+")|"+pr+xr,"g"),_r=ar,gr=ar,vr=Nn,yr=Nn,Sr=function(e){e=vr(e);var t=gr(e)?function(e){return _r(e)?function(e){return e.match(mr)||[]}(e):function(e){return e.split("")}(e)}(e):void 0,i=t?t[0]:e.charAt(0),n=t?function(e,t,i){var n=e.length;return i=void 0===i?n:i,!t&&i>=n?e:function(e,t,i){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(i=i>a?a:i)<0&&(i+=a),a=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(a);++n<a;)r[n]=e[n+t];return r}(e,t,i)}(t,1).join(""):e.slice(1);return i.toUpperCase()+n},br=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Pr=Nn,Er=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Cr=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),Tr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Rr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,wr="\\ud800-\\udfff",Ir="\\u2700-\\u27bf",Dr="a-z\\xdf-\\xf6\\xf8-\\xff",kr="A-Z\\xc0-\\xd6\\xd8-\\xde",Fr="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ar="["+Fr+"]",Mr="\\d+",Lr="["+Ir+"]",Br="["+Dr+"]",Or="[^"+wr+Fr+Mr+Ir+Dr+kr+"]",jr="(?:\\ud83c[\\udde6-\\uddff]){2}",Nr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ur="["+kr+"]",zr="(?:"+Br+"|"+Or+")",Hr="(?:"+Ur+"|"+Or+")",Vr="(?:['’](?:d|ll|m|re|s|t|ve))?",Zr="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wr="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Gr="[\\ufe0e\\ufe0f]?",Yr=Gr+Wr+"(?:\\u200d(?:"+["[^"+wr+"]",jr,Nr].join("|")+")"+Gr+Wr+")*",Xr="(?:"+[Lr,jr,Nr].join("|")+")"+Yr,Jr=RegExp([Ur+"?"+Br+"+"+Vr+"(?="+[Ar,Ur,"$"].join("|")+")",Hr+"+"+Zr+"(?="+[Ar,Ur+zr,"$"].join("|")+")",Ur+"?"+zr+"+"+Vr,Ur+"+"+Zr,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Mr,Xr].join("|"),"g"),qr=Nn,Kr=function(e,t,i){return e=qr(e),void 0===(t=i?void 0:t)?function(e){return Rr.test(e)}(e)?function(e){return e.match(Jr)||[]}(e):function(e){return e.match(Tr)||[]}(e):e.match(t)||[]},$r=RegExp("['’]","g"),Qr=ri(function(e){return function(t){return function(e,t,i,n){var a=-1,r=null==e?0:e.length;for(n&&r&&(i=e[++a]);++a<r;)i=t(i,e[a],a,e);return i}(Kr(function(e){return(e=Pr(e))&&e.replace(Er,br).replace(Cr,"")}(t).replace($r,"")),e,"")}}((function(e,t,i){return t=t.toLowerCase(),e+(i?function(e){return Sr(yr(e).toLowerCase())}(t):t)})));function eo(e){return e?Object.keys(e).reduce(((t,i)=>(t[Qr(i)]=e[i],t)),{}):{}}function to(e){return null!=e}var io=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,no=Math.ceil,ao=Math.floor,ro="[BigNumber Error] ",oo=ro+"Number primitive has more than 15 significant digits: ",so=1e14,lo=14,co=9007199254740991,uo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ho=1e7,fo=1e9;function xo(e){var t=0|e;return e>0||e===t?t:t-1}function po(e){for(var t,i,n=1,a=e.length,r=e[0]+"";n<a;){for(t=e[n++]+"",i=lo-t.length;i--;t="0"+t);r+=t}for(a=r.length;48===r.charCodeAt(--a););return r.slice(0,a+1||1)}function mo(e,t){var i,n,a=e.c,r=t.c,o=e.s,s=t.s,l=e.e,c=t.e;if(!o||!s)return null;if(i=a&&!a[0],n=r&&!r[0],i||n)return i?n?0:-s:o;if(o!=s)return o;if(i=o<0,n=l==c,!a||!r)return n?0:!a^i?1:-1;if(!n)return l>c^i?1:-1;for(s=(l=a.length)<(c=r.length)?l:c,o=0;o<s;o++)if(a[o]!=r[o])return a[o]>r[o]^i?1:-1;return l==c?0:l>c^i?1:-1}function _o(e,t,i,n){if(e<t||e>i||e!==ao(e))throw Error(ro+(n||"Argument")+("number"==typeof e?e<t||e>i?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function go(e){var t=e.c.length-1;return xo(e.e/lo)==t&&e.c[t]%2!=0}function vo(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function yo(e,t,i){var n,a;if(t<0){for(a=i+".";++t;a+=i);e=a+e}else if(++t>(n=e.length)){for(a=i,t-=n;--t;a+=i);e+=a}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var So,bo=function e(t){var i,n,a,r,o,s,l,c,d,u,h=T.prototype={constructor:T,toString:null,valueOf:null},f=new T(1),x=20,p=4,m=-7,_=21,g=-1e7,v=1e7,y=!1,S=1,b=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",C=!0;function T(e,t){var i,r,o,s,l,c,d,u,h=this;if(!(h instanceof T))return new T(e,t);if(null==t){if(e&&!0===e._isBigNumber)return h.s=e.s,void(!e.c||e.e>v?h.c=h.e=null:e.e<g?h.c=[h.e=0]:(h.e=e.e,h.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,l=e;l>=10;l/=10,s++);return void(s>v?h.c=h.e=null:(h.e=s,h.c=[e]))}u=String(e)}else{if(!io.test(u=String(e)))return a(h,u,c);h.s=45==u.charCodeAt(0)?(u=u.slice(1),-1):1}(s=u.indexOf("."))>-1&&(u=u.replace(".","")),(l=u.search(/e/i))>0?(s<0&&(s=l),s+=+u.slice(l+1),u=u.substring(0,l)):s<0&&(s=u.length)}else{if(_o(t,2,E.length,"Base"),10==t&&C)return D(h=new T(e),x+h.e+1,p);if(u=String(e),c="number"==typeof e){if(0*e!=0)return a(h,u,c,t);if(h.s=1/e<0?(u=u.slice(1),-1):1,T.DEBUG&&u.replace(/^0\.0*|\./,"").length>15)throw Error(oo+e)}else h.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1;for(i=E.slice(0,t),s=l=0,d=u.length;l<d;l++)if(i.indexOf(r=u.charAt(l))<0){if("."==r){if(l>s){s=d;continue}}else if(!o&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){o=!0,l=-1,s=0;continue}return a(h,String(e),c,t)}c=!1,(s=(u=n(u,t,10,h.s)).indexOf("."))>-1?u=u.replace(".",""):s=u.length}for(l=0;48===u.charCodeAt(l);l++);for(d=u.length;48===u.charCodeAt(--d););if(u=u.slice(l,++d)){if(d-=l,c&&T.DEBUG&&d>15&&(e>co||e!==ao(e)))throw Error(oo+h.s*e);if((s=s-l-1)>v)h.c=h.e=null;else if(s<g)h.c=[h.e=0];else{if(h.e=s,h.c=[],l=(s+1)%lo,s<0&&(l+=lo),l<d){for(l&&h.c.push(+u.slice(0,l)),d-=lo;l<d;)h.c.push(+u.slice(l,l+=lo));l=lo-(u=u.slice(l)).length}else l-=d;for(;l--;u+="0");h.c.push(+u)}}else h.c=[h.e=0]}function R(e,t,i,n){var a,r,o,s,l;if(null==i?i=p:_o(i,0,8),!e.c)return e.toString();if(a=e.c[0],o=e.e,null==t)l=po(e.c),l=1==n||2==n&&(o<=m||o>=_)?vo(l,o):yo(l,o,"0");else if(r=(e=D(new T(e),t,i)).e,s=(l=po(e.c)).length,1==n||2==n&&(t<=r||r<=m)){for(;s<t;l+="0",s++);l=vo(l,r)}else if(t-=o,l=yo(l,r,"0"),r+1>s){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=r-s)>0)for(r+1==s&&(l+=".");t--;l+="0");return e.s<0&&a?"-"+l:l}function w(e,t){for(var i,n,a=1,r=new T(e[0]);a<e.length;a++)(!(n=new T(e[a])).s||(i=mo(r,n))===t||0===i&&r.s===t)&&(r=n);return r}function I(e,t,i){for(var n=1,a=t.length;!t[--a];t.pop());for(a=t[0];a>=10;a/=10,n++);return(i=n+i*lo-1)>v?e.c=e.e=null:i<g?e.c=[e.e=0]:(e.e=i,e.c=t),e}function D(e,t,i,n){var a,r,o,s,l,c,d,u=e.c,h=uo;if(u){e:{for(a=1,s=u[0];s>=10;s/=10,a++);if((r=t-a)<0)r+=lo,o=t,l=u[c=0],d=ao(l/h[a-o-1]%10);else if((c=no((r+1)/lo))>=u.length){if(!n)break e;for(;u.length<=c;u.push(0));l=d=0,a=1,o=(r%=lo)-lo+1}else{for(l=s=u[c],a=1;s>=10;s/=10,a++);d=(o=(r%=lo)-lo+a)<0?0:ao(l/h[a-o-1]%10)}if(n=n||t<0||null!=u[c+1]||(o<0?l:l%h[a-o-1]),n=i<4?(d||n)&&(0==i||i==(e.s<0?3:2)):d>5||5==d&&(4==i||n||6==i&&(r>0?o>0?l/h[a-o]:0:u[c-1])%10&1||i==(e.s<0?8:7)),t<1||!u[0])return u.length=0,n?(t-=e.e+1,u[0]=h[(lo-t%lo)%lo],e.e=-t||0):u[0]=e.e=0,e;if(0==r?(u.length=c,s=1,c--):(u.length=c+1,s=h[lo-r],u[c]=o>0?ao(l/h[a-o]%h[o])*s:0),n)for(;;){if(0==c){for(r=1,o=u[0];o>=10;o/=10,r++);for(o=u[0]+=s,s=1;o>=10;o/=10,s++);r!=s&&(e.e++,u[0]==so&&(u[0]=1));break}if(u[c]+=s,u[c]!=so)break;u[c--]=0,s=1}for(r=u.length;0===u[--r];u.pop());}e.e>v?e.c=e.e=null:e.e<g&&(e.c=[e.e=0])}return e}function k(e){var t,i=e.e;return null===i?e.toString():(t=po(e.c),t=i<=m||i>=_?vo(t,i):yo(t,i,"0"),e.s<0?"-"+t:t)}return T.clone=e,T.ROUND_UP=0,T.ROUND_DOWN=1,T.ROUND_CEIL=2,T.ROUND_FLOOR=3,T.ROUND_HALF_UP=4,T.ROUND_HALF_DOWN=5,T.ROUND_HALF_EVEN=6,T.ROUND_HALF_CEIL=7,T.ROUND_HALF_FLOOR=8,T.EUCLID=9,T.config=T.set=function(e){var t,i;if(null!=e){if("object"!=typeof e)throw Error(ro+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_o(i=e[t],0,fo,t),x=i),e.hasOwnProperty(t="ROUNDING_MODE")&&(_o(i=e[t],0,8,t),p=i),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((i=e[t])&&i.pop?(_o(i[0],-fo,0,t),_o(i[1],0,fo,t),m=i[0],_=i[1]):(_o(i,-fo,fo,t),m=-(_=i<0?-i:i))),e.hasOwnProperty(t="RANGE"))if((i=e[t])&&i.pop)_o(i[0],-fo,-1,t),_o(i[1],1,fo,t),g=i[0],v=i[1];else{if(_o(i,-fo,fo,t),!i)throw Error(ro+t+" cannot be zero: "+i);g=-(v=i<0?-i:i)}if(e.hasOwnProperty(t="CRYPTO")){if((i=e[t])!==!!i)throw Error(ro+t+" not true or false: "+i);if(i){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw y=!i,Error(ro+"crypto unavailable");y=i}else y=i}if(e.hasOwnProperty(t="MODULO_MODE")&&(_o(i=e[t],0,9,t),S=i),e.hasOwnProperty(t="POW_PRECISION")&&(_o(i=e[t],0,fo,t),b=i),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(i=e[t]))throw Error(ro+t+" not an object: "+i);P=i}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(i=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(i))throw Error(ro+t+" invalid: "+i);C="0123456789"==i.slice(0,10),E=i}}return{DECIMAL_PLACES:x,ROUNDING_MODE:p,EXPONENTIAL_AT:[m,_],RANGE:[g,v],CRYPTO:y,MODULO_MODE:S,POW_PRECISION:b,FORMAT:P,ALPHABET:E}},T.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!T.DEBUG)return!0;var t,i,n=e.c,a=e.e,r=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===r||-1===r)&&a>=-fo&&a<=fo&&a===ao(a)){if(0===n[0]){if(0===a&&1===n.length)return!0;break e}if((t=(a+1)%lo)<1&&(t+=lo),String(n[0]).length==t){for(t=0;t<n.length;t++)if((i=n[t])<0||i>=so||i!==ao(i))break e;if(0!==i)return!0}}}else if(null===n&&null===a&&(null===r||1===r||-1===r))return!0;throw Error(ro+"Invalid BigNumber: "+e)},T.maximum=T.max=function(){return w(arguments,-1)},T.minimum=T.min=function(){return w(arguments,1)},T.random=(r=9007199254740992,o=Math.random()*r&2097151?function(){return ao(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,i,n,a,r,s=0,l=[],c=new T(f);if(null==e?e=x:_o(e,0,fo),a=no(e/lo),y)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));s<a;)(r=131072*t[s]+(t[s+1]>>>11))>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),t[s]=i[0],t[s+1]=i[1]):(l.push(r%1e14),s+=2);s=a/2}else{if(!crypto.randomBytes)throw y=!1,Error(ro+"crypto unavailable");for(t=crypto.randomBytes(a*=7);s<a;)(r=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(l.push(r%1e14),s+=7);s=a/7}if(!y)for(;s<a;)(r=o())<9e15&&(l[s++]=r%1e14);for(a=l[--s],e%=lo,a&&e&&(r=uo[lo-e],l[s]=ao(a/r)*r);0===l[s];l.pop(),s--);if(s<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=lo);for(s=1,r=l[0];r>=10;r/=10,s++);s<lo&&(n-=lo-s)}return c.e=n,c.c=l,c}),T.sum=function(){for(var e=1,t=arguments,i=new T(t[0]);e<t.length;)i=i.plus(t[e++]);return i},n=function(){var e="0123456789";function t(e,t,i,n){for(var a,r,o=[0],s=0,l=e.length;s<l;){for(r=o.length;r--;o[r]*=t);for(o[0]+=n.indexOf(e.charAt(s++)),a=0;a<o.length;a++)o[a]>i-1&&(null==o[a+1]&&(o[a+1]=0),o[a+1]+=o[a]/i|0,o[a]%=i)}return o.reverse()}return function(n,a,r,o,s){var l,c,d,u,h,f,m,_,g=n.indexOf("."),v=x,y=p;for(g>=0&&(u=b,b=0,n=n.replace(".",""),f=(_=new T(a)).pow(n.length-g),b=u,_.c=t(yo(po(f.c),f.e,"0"),10,r,e),_.e=_.c.length),d=u=(m=t(n,a,r,s?(l=E,e):(l=e,E))).length;0==m[--u];m.pop());if(!m[0])return l.charAt(0);if(g<0?--d:(f.c=m,f.e=d,f.s=o,m=(f=i(f,_,v,y,r)).c,h=f.r,d=f.e),g=m[c=d+v+1],u=r/2,h=h||c<0||null!=m[c+1],h=y<4?(null!=g||h)&&(0==y||y==(f.s<0?3:2)):g>u||g==u&&(4==y||h||6==y&&1&m[c-1]||y==(f.s<0?8:7)),c<1||!m[0])n=h?yo(l.charAt(1),-v,l.charAt(0)):l.charAt(0);else{if(m.length=c,h)for(--r;++m[--c]>r;)m[c]=0,c||(++d,m=[1].concat(m));for(u=m.length;!m[--u];);for(g=0,n="";g<=u;n+=l.charAt(m[g++]));n=yo(n,d,l.charAt(0))}return n}}(),i=function(){function e(e,t,i){var n,a,r,o,s=0,l=e.length,c=t%ho,d=t/ho|0;for(e=e.slice();l--;)s=((a=c*(r=e[l]%ho)+(n=d*r+(o=e[l]/ho|0)*c)%ho*ho+s)/i|0)+(n/ho|0)+d*o,e[l]=a%i;return s&&(e=[s].concat(e)),e}function t(e,t,i,n){var a,r;if(i!=n)r=i>n?1:-1;else for(a=r=0;a<i;a++)if(e[a]!=t[a]){r=e[a]>t[a]?1:-1;break}return r}function i(e,t,i,n){for(var a=0;i--;)e[i]-=a,a=e[i]<t[i]?1:0,e[i]=a*n+e[i]-t[i];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,a,r,o,s){var l,c,d,u,h,f,x,p,m,_,g,v,y,S,b,P,E,C=n.s==a.s?1:-1,R=n.c,w=a.c;if(!(R&&R[0]&&w&&w[0]))return new T(n.s&&a.s&&(R?!w||R[0]!=w[0]:w)?R&&0==R[0]||!w?0*C:C/0:NaN);for(m=(p=new T(C)).c=[],C=r+(c=n.e-a.e)+1,s||(s=so,c=xo(n.e/lo)-xo(a.e/lo),C=C/lo|0),d=0;w[d]==(R[d]||0);d++);if(w[d]>(R[d]||0)&&c--,C<0)m.push(1),u=!0;else{for(S=R.length,P=w.length,d=0,C+=2,(h=ao(s/(w[0]+1)))>1&&(w=e(w,h,s),R=e(R,h,s),P=w.length,S=R.length),y=P,g=(_=R.slice(0,P)).length;g<P;_[g++]=0);E=w.slice(),E=[0].concat(E),b=w[0],w[1]>=s/2&&b++;do{if(h=0,(l=t(w,_,P,g))<0){if(v=_[0],P!=g&&(v=v*s+(_[1]||0)),(h=ao(v/b))>1)for(h>=s&&(h=s-1),x=(f=e(w,h,s)).length,g=_.length;1==t(f,_,x,g);)h--,i(f,P<x?E:w,x,s),x=f.length,l=1;else 0==h&&(l=h=1),x=(f=w.slice()).length;if(x<g&&(f=[0].concat(f)),i(_,f,g,s),g=_.length,-1==l)for(;t(w,_,P,g)<1;)h++,i(_,P<g?E:w,g,s),g=_.length}else 0===l&&(h++,_=[0]);m[d++]=h,_[0]?_[g++]=R[y]||0:(_=[R[y]],g=1)}while((y++<S||null!=_[0])&&C--);u=null!=_[0],m[0]||m.splice(0,1)}if(s==so){for(d=1,C=m[0];C>=10;C/=10,d++);D(p,r+(p.e=d+c*lo-1)+1,o,u)}else p.e=c,p.r=+u;return p}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,c=/^\.([^.]+)$/,d=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g,a=function(e,t,i,n){var a,r=i?t:t.replace(u,"");if(d.test(r))e.s=isNaN(r)?null:r<0?-1:1;else{if(!i&&(r=r.replace(s,(function(e,t,i){return a="x"==(i=i.toLowerCase())?16:"b"==i?2:8,n&&n!=a?e:t})),n&&(a=n,r=r.replace(l,"$1").replace(c,"0.$1")),t!=r))return new T(r,a);if(T.DEBUG)throw Error(ro+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},h.absoluteValue=h.abs=function(){var e=new T(this);return e.s<0&&(e.s=1),e},h.comparedTo=function(e,t){return mo(this,new T(e,t))},h.decimalPlaces=h.dp=function(e,t){var i,n,a,r=this;if(null!=e)return _o(e,0,fo),null==t?t=p:_o(t,0,8),D(new T(r),e+r.e+1,t);if(!(i=r.c))return null;if(n=((a=i.length-1)-xo(this.e/lo))*lo,a=i[a])for(;a%10==0;a/=10,n--);return n<0&&(n=0),n},h.dividedBy=h.div=function(e,t){return i(this,new T(e,t),x,p)},h.dividedToIntegerBy=h.idiv=function(e,t){return i(this,new T(e,t),0,1)},h.exponentiatedBy=h.pow=function(e,t){var i,n,a,r,o,s,l,c,d=this;if((e=new T(e)).c&&!e.isInteger())throw Error(ro+"Exponent not an integer: "+k(e));if(null!=t&&(t=new T(t)),o=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return c=new T(Math.pow(+k(d),o?e.s*(2-go(e)):+k(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new T(NaN);(n=!s&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||o&&d.c[1]>=24e7:d.c[0]<8e13||o&&d.c[0]<=9999975e7)))return r=d.s<0&&go(e)?-0:0,d.e>-1&&(r=1/r),new T(s?1/r:r);b&&(r=no(b/lo+2))}for(o?(i=new T(.5),s&&(e.s=1),l=go(e)):l=(a=Math.abs(+k(e)))%2,c=new T(f);;){if(l){if(!(c=c.times(d)).c)break;r?c.c.length>r&&(c.c.length=r):n&&(c=c.mod(t))}if(a){if(0===(a=ao(a/2)))break;l=a%2}else if(D(e=e.times(i),e.e+1,1),e.e>14)l=go(e);else{if(0==(a=+k(e)))break;l=a%2}d=d.times(d),r?d.c&&d.c.length>r&&(d.c.length=r):n&&(d=d.mod(t))}return n?c:(s&&(c=f.div(c)),t?c.mod(t):r?D(c,b,p,void 0):c)},h.integerValue=function(e){var t=new T(this);return null==e?e=p:_o(e,0,8),D(t,t.e+1,e)},h.isEqualTo=h.eq=function(e,t){return 0===mo(this,new T(e,t))},h.isFinite=function(){return!!this.c},h.isGreaterThan=h.gt=function(e,t){return mo(this,new T(e,t))>0},h.isGreaterThanOrEqualTo=h.gte=function(e,t){return 1===(t=mo(this,new T(e,t)))||0===t},h.isInteger=function(){return!!this.c&&xo(this.e/lo)>this.c.length-2},h.isLessThan=h.lt=function(e,t){return mo(this,new T(e,t))<0},h.isLessThanOrEqualTo=h.lte=function(e,t){return-1===(t=mo(this,new T(e,t)))||0===t},h.isNaN=function(){return!this.s},h.isNegative=function(){return this.s<0},h.isPositive=function(){return this.s>0},h.isZero=function(){return!!this.c&&0==this.c[0]},h.minus=function(e,t){var i,n,a,r,o=this,s=o.s;if(t=(e=new T(e,t)).s,!s||!t)return new T(NaN);if(s!=t)return e.s=-t,o.plus(e);var l=o.e/lo,c=e.e/lo,d=o.c,u=e.c;if(!l||!c){if(!d||!u)return d?(e.s=-t,e):new T(u?o:NaN);if(!d[0]||!u[0])return u[0]?(e.s=-t,e):new T(d[0]?o:3==p?-0:0)}if(l=xo(l),c=xo(c),d=d.slice(),s=l-c){for((r=s<0)?(s=-s,a=d):(c=l,a=u),a.reverse(),t=s;t--;a.push(0));a.reverse()}else for(n=(r=(s=d.length)<(t=u.length))?s:t,s=t=0;t<n;t++)if(d[t]!=u[t]){r=d[t]<u[t];break}if(r&&(a=d,d=u,u=a,e.s=-e.s),(t=(n=u.length)-(i=d.length))>0)for(;t--;d[i++]=0);for(t=so-1;n>s;){if(d[--n]<u[n]){for(i=n;i&&!d[--i];d[i]=t);--d[i],d[n]+=so}d[n]-=u[n]}for(;0==d[0];d.splice(0,1),--c);return d[0]?I(e,d,c):(e.s=3==p?-1:1,e.c=[e.e=0],e)},h.modulo=h.mod=function(e,t){var n,a,r=this;return e=new T(e,t),!r.c||!e.s||e.c&&!e.c[0]?new T(NaN):!e.c||r.c&&!r.c[0]?new T(r):(9==S?(a=e.s,e.s=1,n=i(r,e,0,3),e.s=a,n.s*=a):n=i(r,e,0,S),(e=r.minus(n.times(e))).c[0]||1!=S||(e.s=r.s),e)},h.multipliedBy=h.times=function(e,t){var i,n,a,r,o,s,l,c,d,u,h,f,x,p,m,_=this,g=_.c,v=(e=new T(e,t)).c;if(!(g&&v&&g[0]&&v[0]))return!_.s||!e.s||g&&!g[0]&&!v||v&&!v[0]&&!g?e.c=e.e=e.s=null:(e.s*=_.s,g&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=xo(_.e/lo)+xo(e.e/lo),e.s*=_.s,(l=g.length)<(u=v.length)&&(x=g,g=v,v=x,a=l,l=u,u=a),a=l+u,x=[];a--;x.push(0));for(p=so,m=ho,a=u;--a>=0;){for(i=0,h=v[a]%m,f=v[a]/m|0,r=a+(o=l);r>a;)i=((c=h*(c=g[--o]%m)+(s=f*c+(d=g[o]/m|0)*h)%m*m+x[r]+i)/p|0)+(s/m|0)+f*d,x[r--]=c%p;x[r]=i}return i?++n:x.splice(0,1),I(e,x,n)},h.negated=function(){var e=new T(this);return e.s=-e.s||null,e},h.plus=function(e,t){var i,n=this,a=n.s;if(t=(e=new T(e,t)).s,!a||!t)return new T(NaN);if(a!=t)return e.s=-t,n.minus(e);var r=n.e/lo,o=e.e/lo,s=n.c,l=e.c;if(!r||!o){if(!s||!l)return new T(a/0);if(!s[0]||!l[0])return l[0]?e:new T(s[0]?n:0*a)}if(r=xo(r),o=xo(o),s=s.slice(),a=r-o){for(a>0?(o=r,i=l):(a=-a,i=s),i.reverse();a--;i.push(0));i.reverse()}for((a=s.length)-(t=l.length)<0&&(i=l,l=s,s=i,t=a),a=0;t;)a=(s[--t]=s[t]+l[t]+a)/so|0,s[t]=so===s[t]?0:s[t]%so;return a&&(s=[a].concat(s),++o),I(e,s,o)},h.precision=h.sd=function(e,t){var i,n,a,r=this;if(null!=e&&e!==!!e)return _o(e,1,fo),null==t?t=p:_o(t,0,8),D(new T(r),e,t);if(!(i=r.c))return null;if(n=(a=i.length-1)*lo+1,a=i[a]){for(;a%10==0;a/=10,n--);for(a=i[0];a>=10;a/=10,n++);}return e&&r.e+1>n&&(n=r.e+1),n},h.shiftedBy=function(e){return _o(e,-9007199254740991,co),this.times("1e"+e)},h.squareRoot=h.sqrt=function(){var e,t,n,a,r,o=this,s=o.c,l=o.s,c=o.e,d=x+4,u=new T("0.5");if(1!==l||!s||!s[0])return new T(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(l=Math.sqrt(+k(o)))||l==1/0?(((t=po(s)).length+c)%2==0&&(t+="0"),l=Math.sqrt(+t),c=xo((c+1)/2)-(c<0||c%2),n=new T(t=l==1/0?"5e"+c:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new T(l+""),n.c[0])for((l=(c=n.e)+d)<3&&(l=0);;)if(r=n,n=u.times(r.plus(i(o,r,d,1))),po(r.c).slice(0,l)===(t=po(n.c)).slice(0,l)){if(n.e<c&&--l,"9999"!=(t=t.slice(l-3,l+1))&&(a||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(D(n,n.e+x+2,1),e=!n.times(n).eq(o));break}if(!a&&(D(r,r.e+x+2,0),r.times(r).eq(o))){n=r;break}d+=4,l+=4,a=1}return D(n,n.e+x+1,p,e)},h.toExponential=function(e,t){return null!=e&&(_o(e,0,fo),e++),R(this,e,t,1)},h.toFixed=function(e,t){return null!=e&&(_o(e,0,fo),e=e+this.e+1),R(this,e,t)},h.toFormat=function(e,t,i){var n,a=this;if(null==i)null!=e&&t&&"object"==typeof t?(i=t,t=null):e&&"object"==typeof e?(i=e,e=t=null):i=P;else if("object"!=typeof i)throw Error(ro+"Argument not an object: "+i);if(n=a.toFixed(e,t),a.c){var r,o=n.split("."),s=+i.groupSize,l=+i.secondaryGroupSize,c=i.groupSeparator||"",d=o[0],u=o[1],h=a.s<0,f=h?d.slice(1):d,x=f.length;if(l&&(r=s,s=l,l=r,x-=r),s>0&&x>0){for(r=x%s||s,d=f.substr(0,r);r<x;r+=s)d+=c+f.substr(r,s);l>0&&(d+=c+f.slice(r)),h&&(d="-"+d)}n=u?d+(i.decimalSeparator||"")+((l=+i.fractionGroupSize)?u.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):u):d}return(i.prefix||"")+n+(i.suffix||"")},h.toFraction=function(e){var t,n,a,r,o,s,l,c,d,u,h,x,m=this,_=m.c;if(null!=e&&(!(l=new T(e)).isInteger()&&(l.c||1!==l.s)||l.lt(f)))throw Error(ro+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+k(l));if(!_)return new T(m);for(t=new T(f),d=n=new T(f),a=c=new T(f),x=po(_),o=t.e=x.length-m.e-1,t.c[0]=uo[(s=o%lo)<0?lo+s:s],e=!e||l.comparedTo(t)>0?o>0?t:d:l,s=v,v=1/0,l=new T(x),c.c[0]=0;u=i(l,t,0,1),1!=(r=n.plus(u.times(a))).comparedTo(e);)n=a,a=r,d=c.plus(u.times(r=d)),c=r,t=l.minus(u.times(r=t)),l=r;return r=i(e.minus(n),a,0,1),c=c.plus(r.times(d)),n=n.plus(r.times(a)),c.s=d.s=m.s,h=i(d,a,o*=2,p).minus(m).abs().comparedTo(i(c,n,o,p).minus(m).abs())<1?[d,a]:[c,n],v=s,h},h.toNumber=function(){return+k(this)},h.toPrecision=function(e,t){return null!=e&&_o(e,1,fo),R(this,e,t,2)},h.toString=function(e){var t,i=this,a=i.s,r=i.e;return null===r?a?(t="Infinity",a<0&&(t="-"+t)):t="NaN":(null==e?t=r<=m||r>=_?vo(po(i.c),r):yo(po(i.c),r,"0"):10===e&&C?t=yo(po((i=D(new T(i),x+r+1,p)).c),i.e,"0"):(_o(e,2,E.length,"Base"),t=n(yo(po(i.c),r,"0"),10,e,a,!0)),a<0&&i.c[0]&&(t="-"+t)),t},h.valueOf=h.toJSON=function(){return k(this)},h._isBigNumber=!0,h[Symbol.toStringTag]="BigNumber",h[Symbol.for("nodejs.util.inspect.custom")]=h.valueOf,null!=t&&T.set(t),T}();function Po(e){var t;return null!==(t=So[e])&&void 0!==t?t:So.default}!function(e){e[e.up=bo.ROUND_UP]="up",e[e.down=bo.ROUND_DOWN]="down",e[e.truncate=bo.ROUND_DOWN]="truncate",e[e.halfUp=bo.ROUND_HALF_UP]="halfUp",e[e.default=bo.ROUND_HALF_UP]="default",e[e.halfDown=bo.ROUND_HALF_DOWN]="halfDown",e[e.halfEven=bo.ROUND_HALF_EVEN]="halfEven",e[e.banker=bo.ROUND_HALF_EVEN]="banker",e[e.ceiling=bo.ROUND_CEIL]="ceiling",e[e.ceil=bo.ROUND_CEIL]="ceil",e[e.floor=bo.ROUND_FLOOR]="floor"}(So||(So={}));var Eo=Math.floor,Co=Mi,To=da,Ro=function(e){return null!=e&&To(e.length)&&!Co(e)},wo=rn,Io=Ro,Do=ca,ko=Di,Fo=function(e,t,i){if(!ko(i))return!1;var n=typeof t;return!!("number"==n?Io(i)&&Do(t,i.length):"string"==n&&t in i)&&wo(i[t],e)},Ao=/\s/,Mo=/^\s+/,Lo=Di,Bo=Ei,Oo=/^[-+]0x[0-9a-f]+$/i,jo=/^0b[01]+$/i,No=/^0o[0-7]+$/i,Uo=parseInt,zo=function(e){return e?1/0===(e=function(e){if("number"==typeof e)return e;if(Bo(e))return NaN;if(Lo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Lo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Ao.test(e.charAt(t)););return t}(e)+1).replace(Mo,""):e}(e);var i=jo.test(e);return i||No.test(e)?Uo(e.slice(2),i?2:8):Oo.test(e)?NaN:+e}(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Ho=zo,Vo=Fo,Zo=Nn,Wo=ri((function(e,t,i){return t=(i?Vo(e,t,i):void 0===t)?1:function(e){var t=Ho(e),i=t%1;return t==t?i?t-i:t:0}(t),function(e,t){var i="";if(!e||t<1||t>9007199254740991)return i;do{t%2&&(i+=e),(t=Eo(t/2))&&(e+=e)}while(t);return i}(Zo(e),t)}));function Go(e,t){const i=function(e,{precision:t,significant:i}){return i&&null!==t&&t>0?t-function(e){return e.isZero()?1:Math.floor(Math.log10(e.abs().toNumber())+1)}(e):t}(e,t);if(null===i)return e.toString();const n=Po(t.roundMode);if(i>=0)return e.toFixed(i,n);const a=Math.pow(10,Math.abs(i));return(e=new bo(e.div(a).toFixed(0,n)).times(a)).toString()}function Yo(e,t){var i,n,a;const r=new bo(e);if(t.raise&&!r.isFinite())throw new Error(`"${e}" is not a valid numeric value`);const o=Go(r,t),s=new bo(o),l=s.lt(0),c=s.isZero();let[d,u]=o.split(".");const h=[];let f;const x=null!==(i=t.format)&&void 0!==i?i:"%n",p=null!==(n=t.negativeFormat)&&void 0!==n?n:`-${x}`,m=l&&!c?p:x;for(d=d.replace("-","");d.length>0;)h.unshift(d.substr(Math.max(0,d.length-3),3)),d=d.substr(0,d.length-3);return d=h.join(""),f=h.join(t.delimiter),u=t.significant?function({significand:e,whole:t,precision:i}){if("0"===t||null===i)return e;const n=Math.max(0,i-t.length);return(null!=e?e:"").substr(0,n)}({whole:d,significand:u,precision:t.precision}):null!=u?u:Wo("0",null!==(a=t.precision)&&void 0!==a?a:0),t.stripInsignificantZeros&&u&&(u=u.replace(/0+$/,"")),r.isNaN()&&(f=e.toString()),u&&r.isFinite()&&(f+=(t.separator||".")+u),function(e,{formattedNumber:t,unit:i}){return e.replace("%n",t).replace("%u",i)}(m,{formattedNumber:f,unit:t.unit})}function Xo(e,t,i){let n="";return(t instanceof String||"string"==typeof t)&&(n=t),t instanceof Array&&(n=t.join(e.defaultSeparator)),i.scope&&(n=[i.scope,n].join(e.defaultSeparator)),n}function Jo(e){var t,i;if(null===e)return"null";const n=typeof e;return"object"!==n?n:(null===(i=null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)||void 0===i?void 0:i.toLowerCase())||"object"}function qo(e,t,i){i=Object.keys(i).reduce(((t,n)=>(t[e.transformKey(n)]=i[n],t)),{});const n=t.match(e.placeholder);if(!n)return t;for(;n.length;){let a;const r=n.shift(),o=r.replace(e.placeholder,"$1");a=to(i[o])?i[o].toString().replace(/\$/gm,"_#$#_"):o in i?e.nullPlaceholder(e,r,t,i):e.missingPlaceholder(e,r,t,i);const s=new RegExp(r.replace(/\{/gm,"\\{").replace(/\}/gm,"\\}"));t=t.replace(s,a)}return t.replace(/_#\$#_/g,"$")}function Ko(e,t,i={}){const n="locale"in(i=Object.assign({},i))?i.locale:e.locale,a=Jo(n),r=e.locales.get("string"===a?n:typeof n).slice();t=Xo(e,t,i).split(e.defaultSeparator).map((t=>e.transformKey(t))).join(".");const o=r.map((i=>$n(e.translations,[i,t].join("."))));return o.push(i.defaultValue),o.find((e=>to(e)))}var $o=function(e,t){for(var i=-1,n=t.length,a=e.length;++i<n;)e[a+i]=t[i];return e},Qo=sa,es=si,ts=hi?hi.isConcatSpreadable:void 0,is=$o,ns=function(e){return es(e)||Qo(e)||!!(ts&&e&&e[ts])},as=function e(t,i,n,a,r){var o=-1,s=t.length;for(n||(n=ns),r||(r=[]);++o<s;){var l=t[o];i>0&&n(l)?i>1?e(l,i-1,n,a,r):is(r,l):a||(r[r.length]=l)}return r},rs=xn,os=xn,ss=pn,ls=Cn,cs=xn;function ds(e){var t=this.__data__=new cs(e);this.size=t.size}ds.prototype.clear=function(){this.__data__=new rs,this.size=0},ds.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},ds.prototype.get=function(e){return this.__data__.get(e)},ds.prototype.has=function(e){return this.__data__.has(e)},ds.prototype.set=function(e,t){var i=this.__data__;if(i instanceof os){var n=i.__data__;if(!ss||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new ls(n)}return i.set(e,t),this.size=i.size,this};var us=ds,hs=Na,fs=function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1},xs=za,ps=function(e,t,i,n,a,r){var o=1&i,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var c=r.get(e),d=r.get(t);if(c&&d)return c==t&&d==e;var u=-1,h=!0,f=2&i?new hs:void 0;for(r.set(e,t),r.set(t,e);++u<s;){var x=e[u],p=t[u];if(n)var m=o?n(p,x,u,t,e,r):n(x,p,u,e,t,r);if(void 0!==m){if(m)continue;h=!1;break}if(f){if(!fs(t,(function(e,t){if(!xs(f,t)&&(x===e||a(x,e,i,n,r)))return f.push(t)}))){h=!1;break}}else if(x!==p&&!a(x,p,i,n,r)){h=!1;break}}return r.delete(e),r.delete(t),h},ms=ui.Uint8Array,_s=rn,gs=ps,vs=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i},ys=Va,Ss=hi?hi.prototype:void 0,bs=Ss?Ss.valueOf:void 0,Ps=$o,Es=si,Cs=Object.prototype.propertyIsEnumerable,Ts=Object.getOwnPropertySymbols,Rs=Ts?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var i=-1,n=null==e?0:e.length,a=0,r=[];++i<n;){var o=e[i];t(o)&&(r[a++]=o)}return r}(Ts(e),(function(t){return Cs.call(e,t)})))}:function(){return[]},ws={exports:{}},Is=function(){return!1};!function(e,t){var i=ui,n=Is,a=t&&!t.nodeType&&t,r=a&&e&&!e.nodeType&&e,o=r&&r.exports===a?i.Buffer:void 0,s=(o?o.isBuffer:void 0)||n;e.exports=s}(ws,ws.exports);var Ds=ws.exports,ks=yi,Fs=da,As=Si,Ms={};Ms["[object Float32Array]"]=Ms["[object Float64Array]"]=Ms["[object Int8Array]"]=Ms["[object Int16Array]"]=Ms["[object Int32Array]"]=Ms["[object Uint8Array]"]=Ms["[object Uint8ClampedArray]"]=Ms["[object Uint16Array]"]=Ms["[object Uint32Array]"]=!0,Ms["[object Arguments]"]=Ms["[object Array]"]=Ms["[object ArrayBuffer]"]=Ms["[object Boolean]"]=Ms["[object DataView]"]=Ms["[object Date]"]=Ms["[object Error]"]=Ms["[object Function]"]=Ms["[object Map]"]=Ms["[object Number]"]=Ms["[object Object]"]=Ms["[object RegExp]"]=Ms["[object Set]"]=Ms["[object String]"]=Ms["[object WeakMap]"]=!1;var Ls=function(e){return function(t){return e(t)}},Bs={exports:{}};!function(e,t){var i=li,n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,r=a&&a.exports===n&&i.process,o=function(){try{return a&&a.require&&a.require("util").types||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=o}(Bs,Bs.exports);var Os=Bs.exports,js=Ls,Ns=Os&&Os.isTypedArray,Us=Ns?js(Ns):function(e){return As(e)&&Fs(e.length)&&!!Ms[ks(e)]},zs=sa,Hs=si,Vs=Ds,Zs=ca,Ws=Us,Gs=Object.prototype.hasOwnProperty,Ys=Object.prototype,Xs=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),Js=Xs,qs=Object.prototype.hasOwnProperty,Ks=function(e,t){var i=Hs(e),n=!i&&zs(e),a=!i&&!n&&Vs(e),r=!i&&!n&&!a&&Ws(e),o=i||n||a||r,s=o?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],l=s.length;for(var c in e)!t&&!Gs.call(e,c)||o&&("length"==c||a&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Zs(c,l))||s.push(c);return s},$s=Ro,Qs=function(e){return $s(e)?Ks(e):function(e){if(!function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ys)}(e))return Js(e);var t=[];for(var i in Object(e))qs.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)},el=Rs,tl=Qs,il=function(e){return function(e,t,i){var n=t(e);return Es(e)?n:Ps(n,i(e))}(e,tl,el)},nl=Object.prototype.hasOwnProperty,al=Xi(ui,"DataView"),rl=pn,ol=Xi(ui,"Promise"),sl=Ha,ll=Xi(ui,"WeakMap"),cl=yi,dl=ji,ul="[object Map]",hl="[object Promise]",fl="[object Set]",xl="[object WeakMap]",pl="[object DataView]",ml=dl(al),_l=dl(rl),gl=dl(ol),vl=dl(sl),yl=dl(ll),Sl=cl;(al&&Sl(new al(new ArrayBuffer(1)))!=pl||rl&&Sl(new rl)!=ul||ol&&Sl(ol.resolve())!=hl||sl&&Sl(new sl)!=fl||ll&&Sl(new ll)!=xl)&&(Sl=function(e){var t=cl(e),i="[object Object]"==t?e.constructor:void 0,n=i?dl(i):"";if(n)switch(n){case ml:return pl;case _l:return ul;case gl:return hl;case vl:return fl;case yl:return xl}return t});var bl=us,Pl=ps,El=Sl,Cl=si,Tl=Ds,Rl=Us,wl="[object Arguments]",Il="[object Array]",Dl="[object Object]",kl=Object.prototype.hasOwnProperty,Fl=Si,Al=function e(t,i,n,a,r){return t===i||(null==t||null==i||!Fl(t)&&!Fl(i)?t!=t&&i!=i:function(e,t,i,n,a,r){var o=Cl(e),s=Cl(t),l=o?Il:El(e),c=s?Il:El(t),d=(l=l==wl?Dl:l)==Dl,u=(c=c==wl?Dl:c)==Dl,h=l==c;if(h&&Tl(e)){if(!Tl(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new bl),o||Rl(e)?Pl(e,t,i,n,a,r):function(e,t,i,n,a,r,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new ms(e),new ms(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return _s(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=vs;case"[object Set]":var l=1&n;if(s||(s=ys),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;n|=2,o.set(e,t);var d=gs(s(e),s(t),n,a,r,o);return o.delete(e),d;case"[object Symbol]":if(bs)return bs.call(e)==bs.call(t)}return!1}(e,t,l,i,n,a,r);if(!(1&i)){var f=d&&kl.call(e,"__wrapped__"),x=u&&kl.call(t,"__wrapped__");if(f||x){var p=f?e.value():e,m=x?t.value():t;return r||(r=new bl),a(p,m,i,n,r)}}return!!h&&(r||(r=new bl),function(e,t,i,n,a,r){var o=1&i,s=il(e),l=s.length;if(l!=il(t).length&&!o)return!1;for(var c=l;c--;){var d=s[c];if(!(o?d in t:nl.call(t,d)))return!1}var u=r.get(e),h=r.get(t);if(u&&h)return u==t&&h==e;var f=!0;r.set(e,t),r.set(t,e);for(var x=o;++c<l;){var p=e[d=s[c]],m=t[d];if(n)var _=o?n(m,p,d,t,e,r):n(p,m,d,e,t,r);if(!(void 0===_?p===m||a(p,m,i,n,r):_)){f=!1;break}x||(x="constructor"==d)}if(f&&!x){var g=e.constructor,v=t.constructor;g==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof v&&v instanceof v||(f=!1)}return r.delete(e),r.delete(t),f}(e,t,i,n,a,r))}(t,i,n,a,e,r))},Ml=us,Ll=Al,Bl=Di,Ol=function(e){return e==e&&!Bl(e)},jl=Ol,Nl=Qs,Ul=function(e,t){return function(i){return null!=i&&i[e]===t&&(void 0!==t||e in Object(i))}},zl=Ul,Hl=function(e,t){return null!=e&&t in Object(e)},Vl=_a,Zl=Al,Wl=Kn,Gl=Ii,Yl=Ol,Xl=Ul,Jl=Gn,ql=function(e){return e},Kl=Jn,$l=Ii,Ql=Gn,ec=ql,tc=si,ic=Qs,nc=Ro,ac=function(e,t){if(null==e)return e;if(!nc(e))return function(e,t){return e&&function(e,t,i){for(var n=-1,a=Object(e),r=i(e),o=r.length;o--;){var s=r[++n];if(!1===t(a[s],s,a))break}return e}(e,t,ic)}(e,t);for(var i=e.length,n=-1,a=Object(e);++n<i&&!1!==t(a[n],n,a););return e},rc=Ro,oc=Ei,sc=function(e,t){if(e!==t){var i=void 0!==e,n=null===e,a=e==e,r=oc(e),o=void 0!==t,s=null===t,l=t==t,c=oc(t);if(!s&&!c&&!r&&e>t||r&&o&&l&&!s&&!c||n&&o&&l||!i&&l||!a)return 1;if(!n&&!r&&!c&&e<t||c&&i&&a&&!n&&!r||s&&i&&a||!o&&a||!l)return-1}return 0},lc=Fn,cc=Jn,dc=function(e){return"function"==typeof e?e:null==e?ec:"object"==typeof e?tc(e)?function(e,t){return Gl(e)&&Yl(t)?Xl(Jl(e),t):function(i){var n=Wl(i,e);return void 0===n&&n===t?function(e,t){return null!=e&&Vl(e,t,Hl)}(i,e):Zl(t,n,3)}}(e[0],e[1]):function(e){var t=function(e){for(var t=Nl(e),i=t.length;i--;){var n=t[i],a=e[n];t[i]=[n,a,jl(a)]}return t}(e);return 1==t.length&&t[0][2]?zl(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var a=i.length,r=a;if(null==e)return!r;for(e=Object(e);a--;){var o=i[a];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++a<r;){var s=(o=i[a])[0],l=e[s],c=o[1];if(o[2]){if(void 0===l&&!(s in e))return!1}else{var d,u=new Ml;if(!(void 0===d?Ll(c,l,3,n,u):d))return!1}}return!0}(i,0,t)}}(e):function(e){return $l(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Ql(e)):function(e){return function(t){return Kl(t,e)}}(e)}(e)},uc=Ls,hc=ql,fc=si,xc=Math.max,pc=function(e){return function(){return e}},mc=ba,_c=mc?function(e,t){return mc(e,"toString",{configurable:!0,enumerable:!1,value:pc(t),writable:!0})}:ql,gc=Date.now,vc=function(e){var t=0,i=0;return function(){var n=gc(),a=16-(n-i);if(i=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(_c),yc=ql,Sc=vc,bc=as,Pc=Fo,Ec=ri(function(e,t){return Sc(function(e,t,i){return t=xc(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,r=xc(n.length-t,0),o=Array(r);++a<r;)o[a]=n[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=n[a];return s[t]=i(o),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,s)}}(e,void 0,yc),e+"")}((function(e,t){if(null==e)return[];var i=t.length;return i>1&&Pc(e,t[0],t[1])?t=[]:i>2&&Pc(t[0],t[1],t[2])&&(t=[t[0]]),function(e,t,i){t=t.length?lc(t,(function(e){return fc(e)?function(t){return cc(t,1===e.length?e[0]:e)}:e})):[hc];var n=-1;t=lc(t,uc(dc));var a=function(e,t){var i=-1,n=rc(e)?Array(e.length):[];return ac(e,(function(e,a,r){n[++i]=t(e,a,r)})),n}(e,(function(e,i,a){return{criteria:lc(t,(function(t){return t(e)})),index:++n,value:e}}));return function(e,t){var i=e.length;for(e.sort(t);i--;)e[i]=e[i].value;return e}(a,(function(e,t){return function(e,t,i){for(var n=-1,a=e.criteria,r=t.criteria,o=a.length,s=i.length;++n<o;){var l=sc(a[n],r[n]);if(l)return n>=s?l:l*("desc"==i[n]?-1:1)}return e.index-t.index}(e,t,i)}))}(e,bc(t,1),[])}))),Cc=Ta;const Tc={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"},Rc=ri((function(e,t){return function(e,t,i){for(var n=-1,a=e.length,r=t.length,o={};++n<a;){var s=n<r?t[n]:void 0;i(o,e[n],s)}return o}(e||[],t||[],Cc)}))(Object.values(Tc),Object.keys(Tc).map((e=>parseInt(e,10)))),wc=["byte","kb","mb","gb","tb","pb","eb"];function Ic(e){if(e instanceof Date)return e;if("number"==typeof e){const t=new Date;return t.setTime(e),t}const t=new String(e).match(/(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2})(?:[.,](\d{1,3}))?)?(Z|\+00:?00)?/);if(t){const e=t.slice(1,8).map((e=>parseInt(e,10)||0));e[1]-=1;const[i,n,a,r,o,s,l]=e;return t[8]?new Date(Date.UTC(i,n,a,r,o,s,l)):new Date(i,n,a,r,o,s,l)}e.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 i=new Date;return i.setTime(Date.parse(e)),i}function Dc({i18n:e,count:t,scope:i,options:n,baseScope:a}){let r,o;if(n=Object.assign({},n),r="object"==typeof i&&i?i:Ko(e,i,n),!r)return e.missingTranslation.get(i,n);const s=e.pluralization.get(n.locale)(e,t),l=[];for(;s.length;){const e=s.shift();if(to(r[e])){o=r[e];break}l.push(e)}return to(o)?(n.count=t,e.interpolate(e,o,n)):e.missingTranslation.get(a.split(e.defaultSeparator).concat([l[0]]),n)}var kc=as,Fc=ri((function(e){return null!=e&&e.length?kc(e,1/0):[]}));class Ac{constructor(e){this.target=e}call(){const e=Fc(Object.keys(this.target).map((e=>this.compute(this.target[e],e))));return e.sort(),e}compute(e,t){return!Array.isArray(e)&&ki(e)?Object.keys(e).map((i=>this.compute(e[i],`${t}.${i}`))):t}}const Mc={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 Lc=Math.ceil,Bc=Math.max,Oc=Fo,jc=zo,Nc=ri((function(e,t,i){return i&&"number"!=typeof i&&Oc(e,t,i)&&(t=i=void 0),e=jc(e),void 0===t?(t=e,e=0):t=jc(t),function(e,t,i,n){for(var a=-1,r=Bc(Lc((t-e)/(i||1)),0),o=Array(r);r--;)o[++a]=e,e+=i;return o}(e,t,i=void 0===i?e<t?1:-1:jc(i))}));const Uc=(e,t,i)=>i>=e&&i<=t,zc=function(e,t){t instanceof Array&&(t=t.join(e.defaultSeparator));const i=t.split(e.defaultSeparator).slice(-1)[0];return e.missingTranslationPrefix+i.replace("_"," ").replace(/([a-z])([A-Z])/g,((e,t,i)=>`${t} ${i.toLowerCase()}`))},Hc=(e,t,i)=>{const n=Xo(e,t,i),a="locale"in i?i.locale:e.locale,r=Jo(a);return`[missing "${["string"==r?a:r,n].join(e.defaultSeparator)}" translation]`},Vc=(e,t,i)=>{const n=Xo(e,t,i),a=[e.locale,n].join(e.defaultSeparator);throw new Error(`Missing translation: ${a}`)};class Zc{constructor(e){this.i18n=e,this.registry={},this.register("guess",zc),this.register("message",Hc),this.register("error",Vc)}register(e,t){this.registry[e]=t}get(e,t){var i;return this.registry[null!==(i=t.missingBehavior)&&void 0!==i?i:this.i18n.missingBehavior](this.i18n,e,t)}}const Wc={defaultLocale:"en",availableLocales:["en"],locale:"en",defaultSeparator:".",placeholder:/(?:\{\{|%\{)(.*?)(?:\}\}?)/gm,enableFallback:!1,missingBehavior:"message",missingTranslationPrefix:"",missingPlaceholder:(e,t)=>`[missing "${t}" value]`,nullPlaceholder:(e,t,i,n)=>e.missingPlaceholder(e,t,i,n),transformKey:e=>e};let Gc=class{constructor(e={},t={}){this._locale=Wc.locale,this._defaultLocale=Wc.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:i,enableFallback:n,missingBehavior:a,missingTranslationPrefix:r,missingPlaceholder:o,nullPlaceholder:s,defaultLocale:l,defaultSeparator:c,placeholder:d,transformKey:u}=Object.assign(Object.assign({},Wc),t);this.locale=i,this.defaultLocale=l,this.defaultSeparator=c,this.enableFallback=n,this.locale=i,this.missingBehavior=a,this.missingTranslationPrefix=r,this.missingPlaceholder=o,this.nullPlaceholder=s,this.placeholder=d,this.pluralization=new ir(this),this.locales=new er(this),this.missingTranslation=new Zc(this),this.transformKey=u,this.interpolate=qo,this.store(e)}store(e){new Ac(e).call().forEach((t=>Ba(this.translations,t,$n(e,t),Object))),this.hasChanged()}get locale(){return this._locale||this.defaultLocale||"en"}set locale(e){if("string"!=typeof e)throw new Error(`Expected newLocale to be a string; got ${Jo(e)}`);const t=this._locale!==e;this._locale=e,t&&this.hasChanged()}get defaultLocale(){return this._defaultLocale||"en"}set defaultLocale(e){if("string"!=typeof e)throw new Error(`Expected newLocale to be a string; got ${Jo(e)}`);const t=this._defaultLocale!==e;this._defaultLocale=e,t&&this.hasChanged()}translate(e,t){const i=function(e,t,i){let n=[{scope:t}];if(to(i.defaults)&&(n=n.concat(i.defaults)),to(i.defaultValue)){const a="function"==typeof i.defaultValue?i.defaultValue(e,t,i):i.defaultValue;n.push({message:a}),delete i.defaultValue}return n}(this,e,t=Object.assign({},t));let n;return i.some((e=>(to(e.scope)?n=Ko(this,e.scope,t):to(e.message)&&(n=e.message),null!=n)))?("string"==typeof n?n=this.interpolate(this,n,t):"object"==typeof n&&n&&to(t.count)&&(n=Dc({i18n:this,count:t.count||0,scope:n,options:t,baseScope:Xo(this,e,t)})),t&&n instanceof Array&&(n=n.map((e=>"string"==typeof e?qo(this,e,t):e))),n):this.missingTranslation.get(e,t)}pluralize(e,t,i){return Dc({i18n:this,count:e,scope:t,options:Object.assign({},i),baseScope:Xo(this,t,null!=i?i:{})})}localize(e,t,i){if(i=Object.assign({},i),null==t)return"";switch(e){case"currency":return this.numberToCurrency(t);case"number":return Yo(t,Object.assign({delimiter:",",precision:3,separator:".",significant:!1,stripInsignificantZeros:!1},Ko(this,"number.format")));case"percentage":return this.numberToPercentage(t);default:{let n;return n=e.match(/^(date|time)/)?this.toTime(e,t):t.toString(),qo(this,n,i)}}}toTime(e,t){const i=Ic(t),n=Ko(this,e);return i.toString().match(/invalid/i)?i.toString():n?this.strftime(i,n):i.toString()}numberToCurrency(e,t={}){return Yo(e,Object.assign(Object.assign(Object.assign({delimiter:",",format:"%u%n",precision:2,separator:".",significant:!1,stripInsignificantZeros:!1,unit:"$"},eo(this.get("number.format"))),eo(this.get("number.currency.format"))),t))}numberToPercentage(e,t={}){return Yo(e,Object.assign(Object.assign(Object.assign({delimiter:"",format:"%n%",precision:3,stripInsignificantZeros:!1,separator:".",significant:!1},eo(this.get("number.format"))),eo(this.get("number.percentage.format"))),t))}numberToHumanSize(e,t={}){return function(e,t,i){const n=Po(i.roundMode),a=1024,r=new bo(t).abs(),o=r.lt(a);let s;const l=((e,t)=>{const i=wc.length-1,n=new bo(Math.log(e.toNumber())).div(Math.log(a)).integerValue(bo.ROUND_DOWN).toNumber();return Math.min(i,n)})(r);s=o?r.integerValue():new bo(Go(r.div(Math.pow(a,l)),{significant:i.significant,precision:i.precision,roundMode:i.roundMode}));const c=e.translate("number.human.storage_units.format",{defaultValue:"%n %u"}),d=e.translate(`number.human.storage_units.units.${o?"byte":wc[l]}`,{count:r.integerValue().toNumber()});let u=s.toFixed(i.precision,n);return i.stripInsignificantZeros&&(u=u.replace(/(\..*?)0+$/,"$1").replace(/\.$/,"")),c.replace("%n",u).replace("%u",d)}(this,e,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:""}},eo(this.get("number.human.format"))),eo(this.get("number.human.storage_units"))),t))}numberToHuman(e,t={}){return function(e,t,i){const n={roundMode:i.roundMode,precision:i.precision,significant:i.significant};let a;if("string"===Jo(i.units)){const t=i.units;if(a=Ko(e,t),!a)throw new Error(`The scope "${e.locale}${e.defaultSeparator}${Xo(e,t,{})}" couldn't be found`)}else a=i.units;let r=Go(new bo(t),n);const o=((e,t)=>{const i=e.isZero()?0:Math.floor(Math.log10(e.abs().toNumber()));return(e=>Ec(Object.keys(e).map((e=>Rc[e])),(e=>-1*e)))(t).find((e=>i>=e))||0})(new bo(r),a),s=((e,t)=>e[Tc[t.toString()]]||"")(a,o);if(r=Go(new bo(r).div(Math.pow(10,o)),n),i.stripInsignificantZeros){let[e,t]=r.split(".");t=(t||"").replace(/0+$/,""),r=e,t&&(r+=`${i.separator}${t}`)}return i.format.replace("%n",r||"0").replace("%u",s).trim()}(this,e,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:""}},eo(this.get("number.human.format"))),eo(this.get("number.human.decimal_units"))),t))}numberToRounded(e,t){return Yo(e,Object.assign({unit:"",precision:3,significant:!1,separator:".",delimiter:"",stripInsignificantZeros:!1},t))}numberToDelimited(e,t={}){return function(e,t){const i=new bo(e);if(!i.isFinite())return e.toString();if(!t.delimiterPattern.global)throw new Error(`options.delimiterPattern must be a global regular expression; received ${t.delimiterPattern}`);let[n,a]=i.toString().split(".");return n=n.replace(t.delimiterPattern,(e=>`${e}${t.delimiter}`)),[n,a].filter(Boolean).join(t.separator)}(e,Object.assign({delimiterPattern:/(\d)(?=(\d\d\d)+(?!\d))/g,delimiter:",",separator:"."},t))}withLocale(e,t){return function(e,t,i,n){return new(i||(i=Promise))((function(t,a){function r(e){try{s(n.next(e))}catch(e){a(e)}}function o(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,o)}s((n=n.apply(e,[])).next())}))}(this,0,void 0,(function*(){const i=this.locale;try{this.locale=e,yield t()}finally{this.locale=i}}))}strftime(e,t,i={}){return function(e,t,i={}){const{abbrDayNames:n,dayNames:a,abbrMonthNames:r,monthNames:o,meridian:s}=Object.assign(Object.assign({},Mc),i);if(isNaN(e.getTime()))throw new Error("strftime() requires a valid date object, but received an invalid date.");const l=e.getDay(),c=e.getDate(),d=e.getFullYear(),u=e.getMonth()+1,h=e.getHours();let f=h;const x=h>11?"pm":"am",p=e.getSeconds(),m=e.getMinutes(),_=e.getTimezoneOffset(),g=Math.floor(Math.abs(_/60)),v=Math.abs(_)-60*g,y=(_>0?"-":"+")+(g.toString().length<2?"0"+g:g)+(v.toString().length<2?"0"+v:v);return f>12?f-=12:0===f&&(f=12),(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%a",n[l])).replace("%A",a[l])).replace("%b",r[u])).replace("%B",o[u])).replace("%d",c.toString().padStart(2,"0"))).replace("%e",c.toString())).replace("%-d",c.toString())).replace("%H",h.toString().padStart(2,"0"))).replace("%-H",h.toString())).replace("%k",h.toString())).replace("%I",f.toString().padStart(2,"0"))).replace("%-I",f.toString())).replace("%l",f.toString())).replace("%m",u.toString().padStart(2,"0"))).replace("%-m",u.toString())).replace("%M",m.toString().padStart(2,"0"))).replace("%-M",m.toString())).replace("%p",s[x])).replace("%P",s[x].toLowerCase())).replace("%S",p.toString().padStart(2,"0"))).replace("%-S",p.toString())).replace("%w",l.toString())).replace("%y",d.toString().padStart(2,"0").substr(-2))).replace("%-y",d.toString().padStart(2,"0").substr(-2).replace(/^0+/,""))).replace("%Y",d.toString())).replace(/%z/i,y)}(e,t,Object.assign(Object.assign(Object.assign({},eo(Ko(this,"date"))),{meridian:{am:Ko(this,"time.am")||"AM",pm:Ko(this,"time.pm")||"PM"}}),i))}update(e,t,i={strict:!1}){if(i.strict&&!ya(this.translations,e))throw new Error(`The path "${e}" is not currently defined`);const n=$n(this.translations,e),a=Jo(n),r=Jo(t);if(i.strict&&a!==r)throw new Error(`The current type for "${e}" is "${a}", but you're trying to override it with "${r}"`);let o;o="object"===r?Object.assign(Object.assign({},n),t):t,Ma(this.translations,e,o),this.hasChanged()}toSentence(e,t={}){const{wordsConnector:i,twoWordsConnector:n,lastWordConnector:a}=Object.assign(Object.assign({wordsConnector:", ",twoWordsConnector:" and ",lastWordConnector:", and "},eo(Ko(this,"support.array"))),t),r=e.length;switch(r){case 0:return"";case 1:return`${e[0]}`;case 2:return e.join(n);default:return[e.slice(0,r-1).join(i),a,e[r-1]].join("")}}timeAgoInWords(e,t,i={}){return function(e,t,i,n={}){const a=n.scope||"datetime.distance_in_words",r=(t,i=0)=>e.t(t,{count:i,scope:a});t=Ic(t),i=Ic(i);let o=t.getTime()/1e3,s=i.getTime()/1e3;o>s&&([t,i,o,s]=[i,t,s,o]);const l=Math.round(s-o),c=Math.round((s-o)/60),d=c/60/24,u=Math.round(c/60),h=Math.round(d),f=Math.round(h/30);if(Uc(0,1,c))return n.includeSeconds?Uc(0,4,l)?r("less_than_x_seconds",5):Uc(5,9,l)?r("less_than_x_seconds",10):Uc(10,19,l)?r("less_than_x_seconds",20):Uc(20,39,l)?r("half_a_minute"):Uc(40,59,l)?r("less_than_x_minutes",1):r("x_minutes",1):0===c?r("less_than_x_minutes",1):r("x_minutes",c);if(Uc(2,44,c))return r("x_minutes",c);if(Uc(45,89,c))return r("about_x_hours",1);if(Uc(90,1439,c))return r("about_x_hours",u);if(Uc(1440,2519,c))return r("x_days",1);if(Uc(2520,43199,c))return r("x_days",h);if(Uc(43200,86399,c))return r("about_x_months",Math.round(c/43200));if(Uc(86400,525599,c))return r("x_months",f);let x=t.getFullYear();t.getMonth()+1>=3&&(x+=1);let p=i.getFullYear();i.getMonth()+1<3&&(p-=1);const m=525600,_=c-1440*(x>p?0:Nc(x,p).filter((e=>1==new Date(e,1,29).getMonth())).length),g=Math.trunc(_/m),v=parseFloat((_/m-g).toPrecision(3));return v<.25?r("about_x_years",g):v<.75?r("over_x_years",g):r("almost_x_years",g+1)}(this,e,t,i)}onChange(e){return this.onChangeHandlers.push(e),()=>{this.onChangeHandlers.splice(this.onChangeHandlers.indexOf(e),1)}}get version(){return this._version}formatNumber(e,t){return Yo(e,t)}get(e){return Ko(this,e)}runCallbacks(){this.onChangeHandlers.forEach((e=>e(this)))}hasChanged(){this._version+=1,this.runCallbacks()}};var Yc=function(){function e(e,t){this._i18n=new Gc(e,t)}var t=e.prototype;return t.t=function(e,t){return this._i18n.t(e,t)},t.appendTranslations=function(e){var t=this;Object.keys(e).forEach((function(i){t._i18n.translations[i]=Object.assign(t._i18n.translations[i]||{},e[i])}))},t.switchTranslation=function(e){this._i18n.locale=e},t.getCurrentLocale=function(){return this._i18n.locale},t.getCurrentTranslation=function(){return this._i18n.translations[this._i18n.locale]},t.getTranslations=function(){return this._i18n.translations},t.onChange=function(e){var t=this;return this._i18n.onChange((function(){return e(t)}))},t.getVersion=function(){return"1.0.0-alpha.0"},e}();function Xc(e){var t,i;return!!((null!=e?e:null==(i=window)||null==(t=i.navigator)?void 0:t.userAgent)||"").match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)}var Jc="https://open.ys7.com";function qc(e,t){return new Promise((function(i,n){fetch(e,t).then((function(e){return e.json()})).then((function(e){200==+e.code?i(e):n(e)})).catch((function(e){n(e)}))}))}function Kc(e,t){return Object.entries(e).reduce((function(e,i){var n=i[0],a=i[1];return t.includes(n)&&(e[n]=a),e}),{})}var $c=function(){function e(e){if(!e)throw new Error("options is required");var t,i;this._options=e,i=null!=(t=null==e?void 0:e.domain)?t:"",/^http[s]?:\/\//.test(i)||(this._options.domain=Jc)}var t=e.prototype;return t.getDeviceCapacity=function(e){return e||(e=Kc(this._options,["accessToken","deviceSerial"])),function(e,t){if(e&&"[object FormData]"!==Object.prototype.toString.call(e)){var i=new FormData;Object.entries(e).forEach((function(e){var t=e[0],n=e[1];i.append(t,n)})),e=i}return qc((null!=t?t:Jc)+"/api/lapp/device/capacity",{method:"POST",body:e})}(e,this._options.domain)},t.getRealPlayUrl=function(e){return function(e,t){if(e&&"[object FormData]"!==Object.prototype.toString.call(e)){var i,n,a=new FormData;a.append("isFlv","false"),a.append("userAgent",null==(n=window)||null==(i=n.navigator)?void 0:i.userAgent),a.append("isHttp","false"),Object.entries(e).forEach((function(e){var t=e[0],i=e[1];a.append(t,i)})),e=a}return qc((null!=t?t:Jc)+"/api/lapp/live/url/ezopen",{method:"POST",body:e})}(e=Object.assign({},Kc(this._options,["accessToken"]),e),this._options.domain).then((function(e){var t,i,n="",a="",r="";return(null==e||null==(t=e.ext)?void 0:t.token)?(a+=e.data,r=e.ext.token,n=e.data):(null==(i=e.data)?void 0:i.token)&&(a+=e.data.url,r=e.data.token,n=e.data.url),{playUrl:n,stream:r,realUrl:a=a.includes("live")?a+"&ssn="+r+"&auth=1&biz=4&cln=100":a+"&ssn="+r+"&auth=1&cln=100"}}))},t.getVideoByTime=function(e){return function(e,t){if(e&&"[object FormData]"!==Object.prototype.toString.call(e)){var i=new FormData;i.append("recType","1"),i.append("version","2.0"),Object.entries(e).forEach((function(e){var t=e[0],n=e[1];i.append(t,n)})),e=i}return qc((null!=t?t:Jc)+"/api/lapp/video/by/time",{method:"POST",body:e})}(e=Object.assign({},Kc(this._options,["accessToken","deviceSerial"]),e),this._options.domain)},t.getVideoByID=function(e){return function(e,t){if(e&&"[object FormData]"!==Object.prototype.toString.call(e)){var i=new FormData;Object.entries(e).forEach((function(e){var t=e[0],n=e[1];i.append(t,n)})),e=i}return qc((null!=t?t:Jc)+"/api/lapp/video/by/id",{method:"POST",body:e})}(e,this._options.domain)},e}(),Qc={title:"title",name:"name {{name}}"},ed={title:"标题",name:"姓名 {{name}}"};function td(e){return/^ezopen:\/\//.test(e)}var id={autoPlay:!0,width:600,height:400,decoderType:"auto",logger:{level:"INFO",name:"EZOPEN",showTime:!0}};function nd(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function ad(e,t,i,n,a,r,o){try{var s=e[r](o),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function rd(e){return function(){var t=this,i=arguments;return new Promise((function(n,a){var r=e.apply(t,i);function o(e){ad(r,n,a,o,s,"next",e)}function s(e){ad(r,n,a,o,s,"throw",e)}o(void 0)}))}}function od(e,t){var i,n,a,r,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(a=2&r[0]?n.return:r[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,r[1])).done)return a;switch(n=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){o.label=r[1];break}if(6===r[0]&&o.label<a[1]){o.label=a[1],a=r;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(r);break}a[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}var sd=function(){function e(e){this.plugins=new Map,this.context=e}var t=e.prototype;return t.usePlugins=function(e){var t=this;return rd((function(){var i,n,a;return od(this,(function(r){switch(r.label){case 0:i=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return nd(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?nd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[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.")}(e),r.label=1;case 1:return(n=i()).done?[3,4]:(a=n.value,[4,t.use(a)]);case 2:r.sent(),r.label=3;case 3:return[3,1];case 4:return[2]}}))}))()},t.use=function(e){var t=this;return rd((function(){var i;return od(this,(function(n){switch(n.label){case 0:return e.name?("function"==typeof(null==e?void 0:e.init)&&(null==e||e.init()),i=!0,(null==e?void 0:e.beforeExec)?[4,e.beforeExec(t.context)]:[3,2]):[3,3];case 1:i=n.sent(),n.label=2;case 2:return i&&e.exec(t.context),"function"==typeof(null==e?void 0:e.afterExec)&&(null==e||e.afterExec(t.context)),t.plugins.set(e.name.toLowerCase(),e),[3,4];case 3:n.label=4;case 4:return[2]}}))}))()},t.destroyByName=function(e){var t=this.plugins.get(e.toLowerCase());t&&"function"==typeof(null==t?void 0:t.destroy)&&t.destroy(),this.plugins.delete(e)},t.destroy=function(){var e=this;(this.plugins||[]).forEach((function(t,i){e.destroyByName(i)})),this.plugins=null},e}();function ld(e,t,i){return{code:null!=t?t:0,data:e,msg:i}}function cd(e,t,i,n){return{data:e,msg:t,source:i,target:n}}var dd={play:"play",pause:"pause",rateChange:"ratechange",volumeChange:"volumechange",destroy:"destroy",snapshot:"snapshot",fullScreen:"fullscreen",exitScreen:"exitScreen",resize:"resize",seek:"seek"},ud="StreamClient.openStream",hd="StreamClient.startPlay",fd="StreamClient.stopAll",xd="StreamClient.seek",pd="EVENT_CALLBACK",md={pluginErrorHandler:"pluginErrorHandler",getStreamHeaderCallback:"getStreamHeaderCallback",getVideoStreamCallback:"getVideoStreamCallback",appearFirstFrameCallback:"appearFirstFrameCallback",averageStreamSuccessCallback:"averageStreamSuccessCallback",setRunTimeInfoCallBack:"setRunTimeInfoCallBack",openStreamCallback:"openStreamCallback"},_d="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),gd=new Uint8Array(16);function vd(){if(!_d)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _d(gd)}for(var yd=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Sd=[],bd=0;bd<256;++bd)Sd.push((bd+256).toString(16).substr(1));function Pd(e,t,i){var n=(e=e||{}).random||(e.rng||vd)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var a=0;a<16;++a)t[i+a]=n[a];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(Sd[e[t+0]]+Sd[e[t+1]]+Sd[e[t+2]]+Sd[e[t+3]]+"-"+Sd[e[t+4]]+Sd[e[t+5]]+"-"+Sd[e[t+6]]+Sd[e[t+7]]+"-"+Sd[e[t+8]]+Sd[e[t+9]]+"-"+Sd[e[t+10]]+Sd[e[t+11]]+Sd[e[t+12]]+Sd[e[t+13]]+Sd[e[t+14]]+Sd[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&yd.test(e)}(i))throw TypeError("Stringified UUID is invalid");return i}(n)}var Ed=function(){function e(){}var t=e.prototype;return t.createClientObject=function(e,t,i,n){return{socket:e,id:t,iCurChannel:i,iCurStream:n,resolve:null,reject:null}},t.zeroPlayCmd=function(e,t){return new Uint8Array([0,0,0,44,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e+1,0,0,0,t,0,0,4,0])},t.playCmd=function(e,t){return new Uint8Array([0,0,0,44,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e,0,0,0,t,0,0,4,0])},t.playbackCmd=function(e,t,i,n){var a=e.split("T")[0],r=e.split("T")[1],o="0"+parseInt(a.substring(0,4),10).toString(16),s=parseInt(a.substring(4,6),10),l=parseInt(a.substring(6),10),c=parseInt(r.substring(0,2),10),d=parseInt(r.substring(2,4),10),u=parseInt(r.substring(4,6),10),h=t.split("T")[0],f=t.split("T")[1],x="0"+parseInt(h.substring(0,4),10).toString(16),p=parseInt(h.substring(4,6),10),m=parseInt(f.substring(0,2),10),_=parseInt(f.substring(2,4),10),g=parseInt(f.substring(4,6),10),v=[0,0,0,96,0,0,0,0,0,0,0,0,0,3,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i,0,0,parseInt(o.substring(0,2),16),parseInt(o.substring(2,4),16),0,0,0,s,0,0,0,l,0,0,0,c,0,0,0,d,0,0,0,u,0,0,parseInt(x.substring(0,2),16),parseInt(x.substring(2,4),16),0,0,0,p,0,0,0,l,0,0,0,m,0,0,0,_,0,0,0,g,0,0,0,0,0,0,0,0,n,0,0,0];return new Uint8Array(v)},t.playRateCmd=function(e){for(var t=(parseInt(e,10)>>>0).toString(16).toLocaleUpperCase().toString(16),i=t.length;i<8;i++)t="0"+t;for(var n=[0,0,0,0],a=0,r=t.length;a<r;a+=2)n[Math.floor(a/2)]=parseInt(t.substring(a,a+2),16);var o=[0,0,0,36,0,0,0,0,0,0,0,0,0,3,1,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,n[0],n[1],n[2],n[3]];return new Uint8Array(o)},t.pauseCmd=function(){return new Uint8Array([0,0,0,32,0,0,0,0,0,0,0,0,0,3,1,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])},t.resumeCmd=function(){return new Uint8Array([0,0,0,32,0,0,0,0,0,0,0,0,0,3,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])},e}(),Cd=function(){function e(){}var t=e.prototype;return t.createClientObject=function(e,t,i){return{socket:e,id:t,playURL:i,resolve:null,reject:null}},t.getMediaFromSdp=function(e){for(var t=e.indexOf("MEDIAINFO=")+10,i=e.slice(t,t+80),n=[],a=0,r=i.length/2;a<r;a++)n[a]=parseInt(i.slice(2*a,2*a+2),16);return new Uint8Array(n)},t.playCmd=function(e){var t={sequence:0,cmd:"realplay",url:e};return JSON.stringify(t)},t.playbackCmd=function(e,t,i){var n={sequence:0,cmd:"playback",url:i,startTime:e,endTime:t};return JSON.stringify(n)},t.playRateCmd=function(e){var t={sequence:0,cmd:"changespeed",speed:e};return JSON.stringify(t)},t.pauseCmd=function(){return JSON.stringify({sequence:0,cmd:"pause"})},t.resumeCmd=function(){return JSON.stringify({sequence:0,cmd:"resume"})},t.getError=function(e){var t=3001;return e&&(6===parseInt(e.statusCode,10)&&"streamLimit"===e.subStatusCode?t=3002:4===parseInt(e.statusCode,10)&&"badAuthorization"===e.subStatusCode&&(t=3003)),{iErrorNum:t,oError:e}},e}();function Td(e,t,i){null!=e&&("number"==typeof e?this.fromNumber(e,t,i):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function Rd(){return new Td(null)}Td.prototype.am=function(e,t,i,n,a,r){var o=16383&t;for(t>>=14;--r>=0;){var s=16383&this[e],l=this[e++]>>14,c=t*s+l*o;a=((s=o*s+((16383&c)<<14)+i[n]+a)>>28)+(c>>14)+t*l,i[n++]=268435455&s}return a},Td.prototype.DB=28,Td.prototype.DM=268435455,Td.prototype.DV=1<<28,Td.prototype.FV=Math.pow(2,52),Td.prototype.F1=24,Td.prototype.F2=4;var wd,Id,Dd=[];for(wd="0".charCodeAt(0),Id=0;Id<=9;++Id)Dd[wd++]=Id;for(wd="a".charCodeAt(0),Id=10;Id<36;++Id)Dd[wd++]=Id;for(wd="A".charCodeAt(0),Id=10;Id<36;++Id)Dd[wd++]=Id;function kd(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Fd(e,t){var i=Dd[e.charCodeAt(t)];return null==i?-1:i}function Ad(e){var t=Rd();return t.fromInt(e),t}function Md(e){var t,i=1;return 0!=(t=e>>>16)&&(e=t,i+=16),0!=(t=e>>8)&&(e=t,i+=8),0!=(t=e>>4)&&(e=t,i+=4),0!=(t=e>>2)&&(e=t,i+=2),e>>1!=0&&(i+=1),i}function Ld(e){this.m=e}function Bd(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Od(e,t){return e&t}function jd(e,t){return e|t}function Nd(e,t){return e^t}function Ud(e,t){return e&~t}function zd(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function Hd(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function Vd(){}function Zd(e){return e}function Wd(e){this.r2=Rd(),this.q3=Rd(),Td.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}Ld.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},Ld.prototype.revert=function(e){return e},Ld.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},Ld.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},Ld.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Bd.prototype.convert=function(e){var t=Rd();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(Td.ZERO)>0&&this.m.subTo(t,t),t},Bd.prototype.revert=function(e){var t=Rd();return e.copyTo(t),this.reduce(t),t},Bd.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var i,n=(i=32767&e[t])*this.mpl+((i*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},Bd.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},Bd.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Td.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},Td.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0},Td.prototype.fromString=function(e,t){var i;if(16==t)i=4;else if(8==t)i=3;else if(256==t)i=8;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return void this.fromRadix(e,t);i=2}this.s=this.t=0;for(var n=e.length,a=!1,r=0;--n>=0;){var o=8==i?255&e[n]:Fd(e,n);o<0?"-"==e.charAt(n)&&(a=!0):(a=!1,0==r?this[this.t++]=o:r+i>this.DB?(this[this.t-1]|=(o&(1<<this.DB-r)-1)<<r,this[this.t++]=o>>this.DB-r):this[this.t-1]|=o<<r,(r+=i)>=this.DB&&(r-=this.DB))}8==i&&0!=(128&e[0])&&(this.s=-1,r>0&&(this[this.t-1]|=(1<<this.DB-r)-1<<r)),this.clamp(),a&&Td.ZERO.subTo(this,this)},Td.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},Td.prototype.dlShiftTo=function(e,t){var i;for(i=this.t-1;i>=0;--i)t[i+e]=this[i];for(i=e-1;i>=0;--i)t[i]=0;t.t=this.t+e,t.s=this.s},Td.prototype.drShiftTo=function(e,t){for(var i=e;i<this.t;++i)t[i-e]=this[i];t.t=Math.max(this.t-e,0),t.s=this.s},Td.prototype.lShiftTo=function(e,t){var i,n=e%this.DB,a=this.DB-n,r=(1<<a)-1,o=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(i=this.t-1;i>=0;--i)t[i+o+1]=this[i]>>a|s,s=(this[i]&r)<<n;for(i=o-1;i>=0;--i)t[i]=0;t[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},Td.prototype.rShiftTo=function(e,t){t.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)t.t=0;else{var n=e%this.DB,a=this.DB-n,r=(1<<n)-1;t[0]=this[i]>>n;for(var o=i+1;o<this.t;++o)t[o-i-1]|=(this[o]&r)<<a,t[o-i]=this[o]>>n;n>0&&(t[this.t-i-1]|=(this.s&r)<<a),t.t=this.t-i,t.clamp()}},Td.prototype.subTo=function(e,t){for(var i=0,n=0,a=Math.min(e.t,this.t);i<a;)n+=this[i]-e[i],t[i++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;i<this.t;)n+=this[i],t[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<e.t;)n-=e[i],t[i++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[i++]=this.DV+n:n>0&&(t[i++]=n),t.t=i,t.clamp()},Td.prototype.multiplyTo=function(e,t){var i=this.abs(),n=e.abs(),a=i.t;for(t.t=a+n.t;--a>=0;)t[a]=0;for(a=0;a<n.t;++a)t[a+i.t]=i.am(0,n[a],t,a,0,i.t);t.s=0,t.clamp(),this.s!=e.s&&Td.ZERO.subTo(t,t)},Td.prototype.squareTo=function(e){for(var t=this.abs(),i=e.t=2*t.t;--i>=0;)e[i]=0;for(i=0;i<t.t-1;++i){var n=t.am(i,t[i],e,2*i,0,1);(e[i+t.t]+=t.am(i+1,2*t[i],e,2*i+1,n,t.t-i-1))>=t.DV&&(e[i+t.t]-=t.DV,e[i+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(i,t[i],e,2*i,0,1)),e.s=0,e.clamp()},Td.prototype.divRemTo=function(e,t,i){var n=e.abs();if(!(n.t<=0)){var a=this.abs();if(a.t<n.t)null!=t&&t.fromInt(0),null!=i&&this.copyTo(i);else{null==i&&(i=Rd());var r=Rd(),o=this.s,s=(e=e.s,this.DB-Md(n[n.t-1]));if(s>0?(n.lShiftTo(s,r),a.lShiftTo(s,i)):(n.copyTo(r),a.copyTo(i)),0!=(a=r[(n=r.t)-1])){var l=a*(1<<this.F1)+(n>1?r[n-2]>>this.F2:0),c=this.FV/l,d=(l=(1<<this.F1)/l,1<<this.F2),u=i.t,h=u-n,f=null==t?Rd():t;for(r.dlShiftTo(h,f),i.compareTo(f)>=0&&(i[i.t++]=1,i.subTo(f,i)),Td.ONE.dlShiftTo(n,f),f.subTo(r,r);r.t<n;)r[r.t++]=0;for(;--h>=0;){var x=i[--u]==a?this.DM:Math.floor(i[u]*c+(i[u-1]+d)*l);if((i[u]+=r.am(0,x,i,h,0,n))<x)for(r.dlShiftTo(h,f),i.subTo(f,i);i[u]<--x;)i.subTo(f,i)}null!=t&&(i.drShiftTo(n,t),o!=e&&Td.ZERO.subTo(t,t)),i.t=n,i.clamp(),s>0&&i.rShiftTo(s,i),o<0&&Td.ZERO.subTo(i,i)}}}},Td.prototype.invDigit=function(){if(this.t<1)return 0;var e,t=this[0];return 0==(1&t)?0:(e=(e=(e=(e=(e=3&t)*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},Td.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},Td.prototype.exp=function(e,t){if(e>4294967295||e<1)return Td.ONE;var i=Rd(),n=Rd(),a=t.convert(this),r=Md(e)-1;for(a.copyTo(i);--r>=0;)if(t.sqrTo(i,n),(e&1<<r)>0)t.mulTo(n,a,i);else{var o=i;i=n,n=o}return t.revert(i)},Td.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);if(16==e)e=4;else if(8==e)e=3;else if(2==e)e=1;else if(32==e)e=5;else if(64==e)e=6;else{if(4!=e)return this.toRadix(e);e=2}var t,i=(1<<e)-1,n=!1,a="",r=this.t,o=this.DB-r*this.DB%e;if(r-- >0)for(o<this.DB&&(t=this[r]>>o)>0&&(n=!0,a=kd(t));r>=0;)o<e?(t=(this[r]&(1<<o)-1)<<e-o,t|=this[--r]>>(o+=this.DB-e)):(t=this[r]>>(o-=e)&i,o<=0&&(o+=this.DB,--r)),t>0&&(n=!0),n&&(a+=kd(t));return n?a:"0"},Td.prototype.negate=function(){var e=Rd();return Td.ZERO.subTo(this,e),e},Td.prototype.abs=function(){return this.s<0?this.negate():this},Td.prototype.compareTo=function(e){if(0!=(t=this.s-e.s))return t;var t,i=this.t;if(0!=(t=i-e.t))return t;for(;--i>=0;)if(0!=(t=this[i]-e[i]))return t;return 0},Td.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Md(this[this.t-1]^this.s&this.DM)},Td.prototype.mod=function(e){var t=Rd();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Td.ZERO)>0&&e.subTo(t,t),t},Td.prototype.modPowInt=function(e,t){var i;return i=e<256||t.isEven()?new Ld(t):new Bd(t),this.exp(e,i)},Td.ZERO=Ad(0),Td.ONE=Ad(1),Vd.prototype.convert=Zd,Vd.prototype.revert=Zd,Vd.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i)},Vd.prototype.sqrTo=function(e,t){e.squareTo(t)},Wd.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Rd();return e.copyTo(t),this.reduce(t),t},Wd.prototype.revert=function(e){return e},Wd.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},Wd.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},Wd.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var Gd=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Yd=67108864/Gd[Gd.length-1];function Xd(){}function Jd(){this.j=this.i=0,this.S=[]}Td.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},Td.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),i=Ad(t=Math.pow(e,t)),n=Rd(),a=Rd(),r="";for(this.divRemTo(i,n,a);n.signum()>0;)r=(t+a.intValue()).toString(e).substr(1)+r,n.divRemTo(i,n,a);return a.intValue().toString(e)+r},Td.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var i=this.chunkSize(t),n=Math.pow(t,i),a=!1,r=0,o=0,s=0;s<e.length;++s){var l=Fd(e,s);l<0?"-"==e.charAt(s)&&0==this.signum()&&(a=!0):(o=t*o+l,++r>=i&&(this.dMultiply(n),this.dAddOffset(o,0),o=r=0))}r>0&&(this.dMultiply(Math.pow(t,r)),this.dAddOffset(o,0)),a&&Td.ZERO.subTo(this,this)},Td.prototype.fromNumber=function(e,t,i){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(Td.ONE.shiftLeft(e-1),jd,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Td.ONE.shiftLeft(e-1),this);else{var n=7&e;(i=[]).length=1+(e>>3),t.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}},Td.prototype.bitwiseTo=function(e,t,i){var n,a,r=Math.min(e.t,this.t);for(n=0;n<r;++n)i[n]=t(this[n],e[n]);if(e.t<this.t){for(a=e.s&this.DM,n=r;n<this.t;++n)i[n]=t(this[n],a);i.t=this.t}else{for(a=this.s&this.DM,n=r;n<e.t;++n)i[n]=t(a,e[n]);i.t=e.t}i.s=t(this.s,e.s),i.clamp()},Td.prototype.changeBit=function(e,t){var i=Td.ONE.shiftLeft(e);return this.bitwiseTo(i,t,i),i},Td.prototype.addTo=function(e,t){for(var i=0,n=0,a=Math.min(e.t,this.t);i<a;)n+=this[i]+e[i],t[i++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;i<this.t;)n+=this[i],t[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<e.t;)n+=e[i],t[i++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[i++]=n:n<-1&&(t[i++]=this.DV+n),t.t=i,t.clamp()},Td.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},Td.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},Td.prototype.multiplyLowerTo=function(e,t,i){var n,a=Math.min(this.t+e.t,t);for(i.s=0,i.t=a;a>0;)i[--a]=0;for(n=i.t-this.t;a<n;++a)i[a+this.t]=this.am(0,e[a],i,a,0,this.t);for(n=Math.min(e.t,t);a<n;++a)this.am(0,e[a],i,a,0,t-a);i.clamp()},Td.prototype.multiplyUpperTo=function(e,t,i){--t;var n=i.t=this.t+e.t-t;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)i[this.t+n-t]=this.am(t-n,e[n],i,0,0,this.t+n-t);i.clamp(),i.drShiftTo(1,i)},Td.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,i=this.s<0?e-1:0;if(this.t>0)if(0==t)i=this[0]%e;else for(var n=this.t-1;n>=0;--n)i=(t*i+this[n])%e;return i},Td.prototype.millerRabin=function(e){var t=this.subtract(Td.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var n=t.shiftRight(i);(e=e+1>>1)>Gd.length&&(e=Gd.length);for(var a=Rd(),r=0;r<e;++r){a.fromInt(Gd[Math.floor(Math.random()*Gd.length)]);var o=a.modPow(n,this);if(0!=o.compareTo(Td.ONE)&&0!=o.compareTo(t)){for(var s=1;s++<i&&0!=o.compareTo(t);)if(0==(o=o.modPowInt(2,this)).compareTo(Td.ONE))return!1;if(0!=o.compareTo(t))return!1}}return!0},Td.prototype.clone=function(){var e=Rd();return this.copyTo(e),e},Td.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},Td.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},Td.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},Td.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},Td.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var i,n=this.DB-e*this.DB%8,a=0;if(e-- >0)for(n<this.DB&&(i=this[e]>>n)!=(this.s&this.DM)>>n&&(t[a++]=i|this.s<<this.DB-n);e>=0;)n<8?(i=(this[e]&(1<<n)-1)<<8-n,i|=this[--e]>>(n+=this.DB-8)):(i=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&i)&&(i|=-256),0==a&&(128&this.s)!=(128&i)&&++a,(a>0||i!=this.s)&&(t[a++]=i);return t},Td.prototype.equals=function(e){return 0==this.compareTo(e)},Td.prototype.min=function(e){return this.compareTo(e)<0?this:e},Td.prototype.max=function(e){return this.compareTo(e)>0?this:e},Td.prototype.and=function(e){var t=Rd();return this.bitwiseTo(e,Od,t),t},Td.prototype.or=function(e){var t=Rd();return this.bitwiseTo(e,jd,t),t},Td.prototype.xor=function(e){var t=Rd();return this.bitwiseTo(e,Nd,t),t},Td.prototype.andNot=function(e){var t=Rd();return this.bitwiseTo(e,Ud,t),t},Td.prototype.not=function(){for(var e=Rd(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},Td.prototype.shiftLeft=function(e){var t=Rd();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},Td.prototype.shiftRight=function(e){var t=Rd();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},Td.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+zd(this[e]);return this.s<0?this.t*this.DB:-1},Td.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,i=0;i<this.t;++i)e+=Hd(this[i]^t);return e},Td.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},Td.prototype.setBit=function(e){return this.changeBit(e,jd)},Td.prototype.clearBit=function(e){return this.changeBit(e,Ud)},Td.prototype.flipBit=function(e){return this.changeBit(e,Nd)},Td.prototype.add=function(e){var t=Rd();return this.addTo(e,t),t},Td.prototype.subtract=function(e){var t=Rd();return this.subTo(e,t),t},Td.prototype.multiply=function(e){var t=Rd();return this.multiplyTo(e,t),t},Td.prototype.divide=function(e){var t=Rd();return this.divRemTo(e,t,null),t},Td.prototype.remainder=function(e){var t=Rd();return this.divRemTo(e,null,t),t},Td.prototype.divideAndRemainder=function(e){var t=Rd(),i=Rd();return this.divRemTo(e,t,i),[t,i]},Td.prototype.modPow=function(e,t){var i,n,a=e.bitLength(),r=Ad(1);if(a<=0)return r;i=a<18?1:a<48?3:a<144?4:a<768?5:6,n=a<8?new Ld(t):t.isEven()?new Wd(t):new Bd(t);var o=[],s=3,l=i-1,c=(1<<i)-1;if(o[1]=n.convert(this),i>1)for(a=Rd(),n.sqrTo(o[1],a);s<=c;)o[s]=Rd(),n.mulTo(a,o[s-2],o[s]),s+=2;var d,u=e.t-1,h=!0,f=Rd();for(a=Md(e[u])-1;u>=0;){for(a>=l?d=e[u]>>a-l&c:(d=(e[u]&(1<<a+1)-1)<<l-a,u>0&&(d|=e[u-1]>>this.DB+a-l)),s=i;0==(1&d);)d>>=1,--s;if((a-=s)<0&&(a+=this.DB,--u),h)o[d].copyTo(r),h=!1;else{for(;s>1;)n.sqrTo(r,f),n.sqrTo(f,r),s-=2;s>0?n.sqrTo(r,f):(s=r,r=f,f=s),n.mulTo(f,o[d],r)}for(;u>=0&&0==(e[u]&1<<a);)n.sqrTo(r,f),s=r,r=f,f=s,--a<0&&(a=this.DB-1,--u)}return n.revert(r)},Td.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return Td.ZERO;for(var i=e.clone(),n=this.clone(),a=Ad(1),r=Ad(0),o=Ad(0),s=Ad(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),t?(a.isEven()&&r.isEven()||(a.addTo(this,a),r.subTo(e,r)),a.rShiftTo(1,a)):r.isEven()||r.subTo(e,r),r.rShiftTo(1,r);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);i.compareTo(n)>=0?(i.subTo(n,i),t&&a.subTo(o,a),r.subTo(s,r)):(n.subTo(i,n),t&&o.subTo(a,o),s.subTo(r,s))}return 0!=n.compareTo(Td.ONE)?Td.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},Td.prototype.pow=function(e){return this.exp(e,new Vd)},Td.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone();if(e=e.s<0?e.negate():e.clone(),t.compareTo(e)<0){var i=t;t=e,e=i}i=t.getLowestSetBit();var n=e.getLowestSetBit();if(n<0)return t;for(i<n&&(n=i),n>0&&(t.rShiftTo(n,t),e.rShiftTo(n,e));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e));return n>0&&e.lShiftTo(n,e),e},Td.prototype.isProbablePrime=function(e){var t,i=this.abs();if(1==i.t&&i[0]<=Gd[Gd.length-1]){for(t=0;t<Gd.length;++t)if(i[0]==Gd[t])return!0;return!1}if(i.isEven())return!1;for(t=1;t<Gd.length;){for(var n=Gd[t],a=t+1;a<Gd.length&&n<Yd;)n*=Gd[a++];for(n=i.modInt(n);t<a;)if(n%Gd[t++]==0)return!1}return i.millerRabin(e)},Td.prototype.square=function(){var e=Rd();return this.squareTo(e),e},function(e,t,i,n,a,r,o){function s(e){var t,n,a=this,r=e.length,o=0,s=a.i=a.j=a.m=0;for(a.S=[],a.c=[],r||(e=[r++]);o<i;)a.S[o]=o++;for(o=0;o<i;o++)s=s+(t=a.S[o])+e[o%r]&255,n=a.S[s],a.S[o]=n,a.S[s]=t;a.g=function(e){var t=a.S,n=a.i+1&255,r=t[n],o=a.j+r&255,s=t[o];t[n]=s,t[o]=r;for(var l=t[r+s&255];--e;)s=t[o=o+(r=t[n=n+1&255])&255],t[n]=s,t[o]=r,l=l*i+t[r+s&255];return a.i=n,a.j=o,l},a.g(i)}function l(e,t,i,n,a){var r;if(i=[],a=void 0===e?"undefined":(r=e)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r,t&&"object"==a)for(n in e)if(n.indexOf("S")<5)try{i.push(l(e[n],t-1))}catch(e){}return i.length?i:e+("string"!=a?"\0":"")}function c(e,t,i,n){for(e+="",n=i=0;n<e.length;n++){var a=t,r=255&n,o=(i^=19*t[255&n])+e.charCodeAt(n);a[r]=255&o}for(n in e="",t)e+=String.fromCharCode(t[n]);return e}t.seedrandom=function(n,d){var u,h=[];return n=c(l(d?[n,e]:arguments.length?n:[(new Date).getTime(),e,window],3),h),c((u=new s(h)).S,e),t.random=function(){for(var e=u.g(6),t=o,n=0;e<a;)e=(e+n)*i,t*=i,n=u.g(1);for(;e>=r;)e/=2,t/=2,n>>>=1;return(e+n)/t},n},o=t.pow(i,6),a=t.pow(2,a),r=2*a,c(t.random(),e)}([],Math,256,0,52),Xd.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random())},Jd.prototype.init=function(e){var t,i,n;for(t=0;t<256;++t)this.S[t]=t;for(t=i=0;t<256;++t)i=i+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[i],this.S[i]=n;this.j=this.i=0},Jd.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var qd,Kd,$d,Qd=256;function eu(){!function(e){Kd[$d++]^=255&e,Kd[$d++]^=e>>8&255,Kd[$d++]^=e>>16&255,Kd[$d++]^=e>>24&255,$d>=Qd&&($d-=Qd)}((new Date).getTime())}if(null==Kd){var tu;for(Kd=[],$d=0;$d<Qd;)tu=Math.floor(65536*Math.random()),Kd[$d++]=tu>>>8,Kd[$d++]=255&tu;$d=0,eu()}function iu(){if(null==qd){for(eu(),(qd=new Jd).init(Kd),$d=0;$d<Kd.length;++$d)Kd[$d]=0;$d=0}return qd.next()}function nu(){}nu.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=iu()};var au=function(e){return function(e){function t(e,t){var i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function i(e,t){return e>>>t|e<<32-t}return e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):(n>127&&n<2048?t+=String.fromCharCode(n>>6|192):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128)),t+=String.fromCharCode(63&n|128))}return t}(e),function(e){for(var t="",i=0;i<4*e.length;i++)t+="0123456789abcdef".charAt(e[i>>2]>>8*(3-i%4)+4&15)+"0123456789abcdef".charAt(e[i>>2]>>8*(3-i%4)&15);return t}(function(e,n){var a,r,o,s,l,c,d,u,h,f,x,p,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],_=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],g=Array(64);for(e[n>>5]|=128<<24-n%32,e[15+(n+64>>9<<4)]=n,h=0;h<e.length;h+=16){for(a=_[0],r=_[1],o=_[2],s=_[3],l=_[4],c=_[5],d=_[6],u=_[7],f=0;f<64;f++)g[f]=f<16?e[f+h]:t(t(t(i(g[f-2],17)^i(g[f-2],19)^g[f-2]>>>10,g[f-7]),i(g[f-15],7)^i(g[f-15],18)^g[f-15]>>>3),g[f-16]),x=t(t(t(t(u,i(l,6)^i(l,11)^i(l,25)),l&c^~l&d),m[f]),g[f]),p=t(i(a,2)^i(a,13)^i(a,22),a&r^a&o^r&o),u=d,d=c,c=l,l=t(s,x),s=o,o=r,r=a,a=t(x,p);_[0]=t(a,_[0]),_[1]=t(r,_[1]),_[2]=t(o,_[2]),_[3]=t(s,_[3]),_[4]=t(l,_[4]),_[5]=t(c,_[5]),_[6]=t(d,_[6]),_[7]=t(u,_[7])}return _}(function(e){for(var t=[],i=0;i<8*e.length;i+=8)t[i>>5]|=(255&e.charCodeAt(i/8))<<24-i%32;return t}(e),8*e.length))}(e)};function ru(e,t){return new Td(e,t)}function ou(){this.n=null,this.e=0,this.coeff=this.dmq1=this.dmp1=this.q=this.p=this.d=null}ou.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},ou.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ru(e,16),this.e=parseInt(t,16)):alert("Invalid RSA public key")},ou.prototype.encrypt=function(e){return e=function(e,t){if(t<e.length+11)throw"Message too long for RSA (n="+t+", l="+e.length+")";for(var i=[],n=e.length-1;n>=0&&t>0;){var a=e.charCodeAt(n--);a<128?i[--t]=a:a>127&&a<2048?(i[--t]=63&a|128,i[--t]=a>>6|192):(i[--t]=63&a|128,i[--t]=a>>6&63|128,i[--t]=a>>12|224)}for(i[--t]=0,n=new nu,a=[];t>2;){for(a[0]=0;0==a[0];)n.nextBytes(a);i[--t]=a[0]}return i[--t]=2,i[--t]=0,new Td(i)}(e,this.n.bitLength()+7>>3),null==e||null==(e=this.doPublic(e))?null:0==(1&(e=e.toString(16)).length)?e:"0"+e},ou.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);var t=e.mod(this.p).modPow(this.dmp1,this.p);for(e=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;)t=t.add(this.p);return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)},ou.prototype.setPrivate=function(e,t,i){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ru(e,16),this.e=parseInt(t,16),this.d=ru(i,16)):alert("Invalid RSA private key")},ou.prototype.setPrivateEx=function(e,t,i,n,a,r,o,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=ru(e,16),this.e=parseInt(t,16),this.d=ru(i,16),this.p=ru(n,16),this.q=ru(a,16),this.dmp1=ru(r,16),this.dmq1=ru(o,16),this.coeff=ru(s,16)):alert("Invalid RSA private key")},ou.prototype.generate=function(e,t){var i=new Xd,n=e>>1;this.e=parseInt(t,16);for(var a=new Td(t,16);;){for(;this.p=new Td(e-n,1,i),0!=this.p.subtract(Td.ONE).gcd(a).compareTo(Td.ONE)||!this.p.isProbablePrime(10););for(;this.q=new Td(n,1,i),0!=this.q.subtract(Td.ONE).gcd(a).compareTo(Td.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var r=this.p;this.p=this.q,this.q=r}r=this.p.subtract(Td.ONE);var o=this.q.subtract(Td.ONE),s=r.multiply(o);if(0==s.gcd(a).compareTo(Td.ONE)){this.n=this.p.multiply(this.q),this.d=a.modInverse(s),this.dmp1=this.d.mod(r),this.dmq1=this.d.mod(o),this.coeff=this.q.modInverse(this.p);break}}},ou.prototype.decrypt=function(e){return null==(e=this.doPrivate(ru(e,16)))?null:function(e,t){for(var i=e.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length-n!=t-1||2!=i[n])return null;for(++n;0!=i[n];)if(++n>=i.length)return null;for(var a="";++n<i.length;){var r=255&i[n];r<128?a+=String.fromCharCode(r):r>191&&r<224?(a+=String.fromCharCode((31&r)<<6|63&i[n+1]),++n):(a+=String.fromCharCode((15&r)<<12|(63&i[n+1])<<6|63&i[n+2]),n+=2)}return a}(e,this.n.bitLength()+7>>3)};var su=[];su.sha1="3021300906052b0e03021a05000414",su.sha256="3031300d060960864801650304020105000420";var lu=[];function cu(e,t,i){t/=4,e=(0,lu[i])(e),i="00"+su[i]+e,e="",t=t-4-i.length;for(var n=0;n<t;n+=2)e+="ff";return sPaddedMessageHex="0001"+e+i}function du(e){for(var t in su){var i=su[t],n=i.length;if(e.substring(0,n)==i)return[t,e.substring(n)]}return[]}lu.sha1=function(e){return function(e){function t(e,t){return e<<t|e>>>32-t}function i(e){var t,i="";for(t=7;t>=0;t--)i+=(e>>>4*t&15).toString(16);return i}var n,a,r,o,s,l,c,d=Array(80),u=1732584193,h=4023233417,f=2562383102,x=271733878,p=3285377520;e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):(n>127&&n<2048?t+=String.fromCharCode(n>>6|192):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128)),t+=String.fromCharCode(63&n|128))}return t}(e),r=e.length;var m=[];for(n=0;n<r-3;n+=4)a=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),m.push(a);switch(r%4){case 0:n=2147483648;break;case 1:n=e.charCodeAt(r-1)<<24|8388608;break;case 2:n=e.charCodeAt(r-2)<<24|e.charCodeAt(r-1)<<16|32768;break;case 3:n=e.charCodeAt(r-3)<<24|e.charCodeAt(r-2)<<16|e.charCodeAt(r-1)<<8|128}for(m.push(n);m.length%16!=14;)m.push(0);for(m.push(r>>>29),m.push(r<<3&4294967295),e=0;e<m.length;e+=16){for(n=0;n<16;n++)d[n]=m[e+n];for(n=16;n<=79;n++)d[n]=t(d[n-3]^d[n-8]^d[n-14]^d[n-16],1);for(a=u,r=h,o=f,s=x,l=p,n=0;n<=19;n++)c=t(a,5)+(r&o|~r&s)+l+d[n]+1518500249&4294967295,l=s,s=o,o=t(r,30),r=a,a=c;for(n=20;n<=39;n++)c=t(a,5)+(r^o^s)+l+d[n]+1859775393&4294967295,l=s,s=o,o=t(r,30),r=a,a=c;for(n=40;n<=59;n++)c=t(a,5)+(r&o|r&s|o&s)+l+d[n]+2400959708&4294967295,l=s,s=o,o=t(r,30),r=a,a=c;for(n=60;n<=79;n++)c=t(a,5)+(r^o^s)+l+d[n]+3395469782&4294967295,l=s,s=o,o=t(r,30),r=a,a=c;u=u+a&4294967295,h=h+r&4294967295,f=f+o&4294967295,x=x+s&4294967295,p=p+l&4294967295}return(c=i(u)+i(h)+i(f)+i(x)+i(p)).toLowerCase()}(e)},lu.sha256=au,ou.prototype.signString=function(e,t){var i=cu(e,this.n.bitLength(),t);return this.doPrivate(ru(i,16)).toString(16)},ou.prototype.signStringWithSHA1=function(e){return e=cu(e,this.n.bitLength(),"sha1"),this.doPrivate(ru(e,16)).toString(16)},ou.prototype.signStringWithSHA256=function(e){return e=cu(e,this.n.bitLength(),"sha256"),this.doPrivate(ru(e,16)).toString(16)},ou.prototype.verifyString=function(e,t){t=t.replace(/[ \n]+/g,"");var i=this.doPublic(ru(t,16)).toString(16).replace(/^1f+00/,""),n=du(i);return 0!=n.length&&(i=n[1])==(0,lu[n[0]])(e)},ou.prototype.verifyHexSignatureForMessage=function(e,t){return function(e,t,i,n){return 0!=(i=du(t=function(e,t,i){return function(e,t,i){var n=new ou;return n.setPublic(t,i),n.doPublic(e)}(e,t,i).toString(16).replace(/^1f+00/,"")}(t,i,n))).length&&(t=i[1])==(0,lu[i[0]])(e)}(t,ru(e,16),this.n.toString(16),this.e.toString(16))};var uu=function(){var e={Sbox:[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],ShiftRowTab:[0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11],Init:function(){e.Sbox_Inv=Array(256);for(var t=0;t<256;t++)e.Sbox_Inv[e.Sbox[t]]=t;for(e.ShiftRowTab_Inv=Array(16),t=0;t<16;t++)e.ShiftRowTab_Inv[e.ShiftRowTab[t]]=t;for(e.xtime=Array(256),t=0;t<128;t++)e.xtime[t]=t<<1,e.xtime[128+t]=t<<1^27},Done:function(){delete e.Sbox_Inv,delete e.ShiftRowTab_Inv,delete e.xtime},ExpandKey:function(t){var i,n=t.length,a=1;switch(n){case 16:i=176;break;case 24:i=208;break;case 32:i=240;break;default:alert("my.ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!")}for(var r=n;r<i;r+=4){var o=t.slice(r-4,r);r%n==0?(o=[e.Sbox[o[1]]^a,e.Sbox[o[2]],e.Sbox[o[3]],e.Sbox[o[0]]],(a<<=1)>=256&&(a^=283)):n>24&&r%n==16&&(o=[e.Sbox[o[0]],e.Sbox[o[1]],e.Sbox[o[2]],e.Sbox[o[3]]]);for(var s=0;s<4;s++)t[r+s]=t[r+s-n]^o[s]}},Encrypt:function(t,i){var n=i.length;e.AddRoundKey(t,i.slice(0,16));for(var a=16;a<n-16;a+=16)e.SubBytes(t,e.Sbox),e.ShiftRows(t,e.ShiftRowTab),e.MixColumns(t),e.AddRoundKey(t,i.slice(a,a+16));e.SubBytes(t,e.Sbox),e.ShiftRows(t,e.ShiftRowTab),e.AddRoundKey(t,i.slice(a,n))},Decrypt:function(t,i){var n=i.length;for(e.AddRoundKey(t,i.slice(n-16,n)),e.ShiftRows(t,e.ShiftRowTab_Inv),e.SubBytes(t,e.Sbox_Inv),n-=32;n>=16;n-=16)e.AddRoundKey(t,i.slice(n,n+16)),e.MixColumns_Inv(t),e.ShiftRows(t,e.ShiftRowTab_Inv),e.SubBytes(t,e.Sbox_Inv);e.AddRoundKey(t,i.slice(0,16))},SubBytes:function(e,t){for(var i=0;i<16;i++)e[i]=t[e[i]]},AddRoundKey:function(e,t){for(var i=0;i<16;i++)e[i]^=t[i]},ShiftRows:function(e,t){for(var i=[].concat(e),n=0;n<16;n++)e[n]=i[t[n]]},MixColumns:function(t){for(var i=0;i<16;i+=4){var n=t[i+0],a=t[i+1],r=t[i+2],o=t[i+3],s=n^a^r^o;t[i+0]^=s^e.xtime[n^a],t[i+1]^=s^e.xtime[a^r],t[i+2]^=s^e.xtime[r^o],t[i+3]^=s^e.xtime[o^n]}},MixColumns_Inv:function(t){for(var i=0;i<16;i+=4){var n=t[i+0],a=t[i+1],r=t[i+2],o=t[i+3],s=n^a^r^o,l=e.xtime[s],c=e.xtime[e.xtime[l^n^r]]^s;s^=e.xtime[e.xtime[l^a^o]],t[i+0]^=c^e.xtime[n^a],t[i+1]^=s^e.xtime[a^r],t[i+2]^=c^e.xtime[r^o],t[i+3]^=s^e.xtime[o^n]}}};return e}(),hu=function(){var e={};return uu.Init(),e.b256to64=function(e){var t,i,n,a="",r=0,o=e.length;for(n=0;n<o;n++)i=e.charCodeAt(n),0==r?(a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>2&63),t=(3&i)<<4):1==r?(a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t|i>>4&15),t=(15&i)<<2):2==r&&(a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t|i>>6&3),a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(63&i)),3==(r+=1)&&(r=0);return r>0&&(a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t),a+="="),1==r&&(a+="="),a},e.b64to256=function(e){var t,i,n="",a=0,r=0,o=e.length;for(i=0;i<o;i++)(t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(i)))>=0&&(a&&(n+=String.fromCharCode(r|t>>6-a&255)),r=t<<(a=a+2&7)&255);return n},e.b16to64=function(e){var t,i,n="";for(e.length%2==1&&(e="0"+e),t=0;t+3<=e.length;t+=3)i=parseInt(e.substring(t,t+3),16),n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(63&i);for(t+1==e.length?(i=parseInt(e.substring(t,t+1),16),n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i<<2)):t+2==e.length&&(i=parseInt(e.substring(t,t+2),16),n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((3&i)<<4));(3&n.length)>0;)n+="=";return n},e.b64to16=function(e){var t,i,n="",a=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t)v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t)),v<0||(0==a?(n+=kd(v>>2),i=3&v,a=1):1==a?(n+=kd(i<<2|v>>4),i=15&v,a=2):2==a?(n+=kd(i),n+=kd(v>>2),i=3&v,a=3):(n+=kd(i<<2|v>>4),n+=kd(15&v),a=0));return 1==a&&(n+=kd(i<<2)),n},e.string2bytes=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e.charCodeAt(i));return t},e.bytes2string=function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},e.blockXOR=function(e,t){for(var i=Array(16),n=0;n<16;n++)i[n]=e[n]^t[n];return i},e.blockIV=function(){var e=new nu,t=Array(16);return e.nextBytes(t),t},e.pad16=function(e){var t=e.slice(0),n=(16-e.length%16)%16;for(i=e.length;i<e.length+n;i++)t.push(0);return t},e.depad=function(e){for(e=e.slice(0);0==e[e.length-1];)e=e.slice(0,e.length-1);return e},e.encryptAESCBC=function(t,i){var n=i.slice(0);uu.ExpandKey(n);for(var a=e.string2bytes(t),r=(a=e.pad16(a),e.blockIV()),o=0;o<a.length/16;o++){var s=a.slice(16*o,16*o+16),l=r.slice(16*o,16*o+16);s=e.blockXOR(l,s),uu.Encrypt(s,n),r=r.concat(s)}return n=e.bytes2string(r),e.b256to64(n)},e.decryptAESCBC=function(t,i){var n=i.slice(0);uu.ExpandKey(n),t=e.b64to256(t);for(var a=e.string2bytes(t),r=[],o=1;o<a.length/16;o++){var s=a.slice(16*o,16*o+16),l=a.slice(16*(o-1),16*(o-1)+16);uu.Decrypt(s,n),s=e.blockXOR(l,s),r=r.concat(s)}return r=e.depad(r),e.bytes2string(r)},e.wrap60=function(e){for(var t="",i=0;i<e.length;i++)i%60==0&&0!=i&&(t+="\n"),t+=e[i];return t},e.generateAESKey=function(){var e=Array(16);return(new nu).nextBytes(e),e},e.generateRSAKey=function(e,t){Math.seedrandom(au(e));var i=new ou;return i.generate(t,"10001"),i},e.publicKeyString=function(e){return pubkey=e.n.toString(16)},e.publicKeyID=function(e){return function(e){function t(e,t){var i,n,a,r,o;return a=2147483648&e,r=2147483648&t,o=(1073741823&e)+(1073741823&t),(i=1073741824&e)&(n=1073741824&t)?2147483648^o^a^r:i|n?1073741824&o?3221225472^o^a^r:1073741824^o^a^r:o^a^r}function i(e,i,n,a,r,o,s){return e=t(e,t(t(i&n|~i&a,r),s)),t(e<<o|e>>>32-o,i)}function n(e,i,n,a,r,o,s){return e=t(e,t(t(i&a|n&~a,r),s)),t(e<<o|e>>>32-o,i)}function a(e,i,n,a,r,o,s){return e=t(e,t(t(i^n^a,r),s)),t(e<<o|e>>>32-o,i)}function r(e,i,n,a,r,o,s){return e=t(e,t(t(n^(i|~a),r),s)),t(e<<o|e>>>32-o,i)}function o(e){var t,i="",n="";for(t=0;t<=3;t++)i+=(n="0"+(n=e>>>8*t&255).toString(16)).substr(n.length-2,2);return i}var s,l,c,d,u,h,f,x,p=function(e){for(var t,i=e.length,n=16*(((t=i+8)-t%64)/64+1),a=Array(n-1),r=0,o=0;o<i;)r=o%4*8,a[t=(o-o%4)/4]|=e.charCodeAt(o)<<r,o++;return a[(o-o%4)/4]|=128<<o%4*8,a[n-2]=i<<3,a[n-1]=i>>>29,a}(e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):(n>127&&n<2048?t+=String.fromCharCode(n>>6|192):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128)),t+=String.fromCharCode(63&n|128))}return t}(e));for(u=1732584193,h=4023233417,f=2562383102,x=271733878,e=0;e<p.length;e+=16)s=u,l=h,c=f,d=x,u=i(u,h,f,x,p[e+0],7,3614090360),x=i(x,u,h,f,p[e+1],12,3905402710),f=i(f,x,u,h,p[e+2],17,606105819),h=i(h,f,x,u,p[e+3],22,3250441966),u=i(u,h,f,x,p[e+4],7,4118548399),x=i(x,u,h,f,p[e+5],12,1200080426),f=i(f,x,u,h,p[e+6],17,2821735955),h=i(h,f,x,u,p[e+7],22,4249261313),u=i(u,h,f,x,p[e+8],7,1770035416),x=i(x,u,h,f,p[e+9],12,2336552879),f=i(f,x,u,h,p[e+10],17,4294925233),h=i(h,f,x,u,p[e+11],22,2304563134),u=i(u,h,f,x,p[e+12],7,1804603682),x=i(x,u,h,f,p[e+13],12,4254626195),f=i(f,x,u,h,p[e+14],17,2792965006),u=n(u,h=i(h,f,x,u,p[e+15],22,1236535329),f,x,p[e+1],5,4129170786),x=n(x,u,h,f,p[e+6],9,3225465664),f=n(f,x,u,h,p[e+11],14,643717713),h=n(h,f,x,u,p[e+0],20,3921069994),u=n(u,h,f,x,p[e+5],5,3593408605),x=n(x,u,h,f,p[e+10],9,38016083),f=n(f,x,u,h,p[e+15],14,3634488961),h=n(h,f,x,u,p[e+4],20,3889429448),u=n(u,h,f,x,p[e+9],5,568446438),x=n(x,u,h,f,p[e+14],9,3275163606),f=n(f,x,u,h,p[e+3],14,4107603335),h=n(h,f,x,u,p[e+8],20,1163531501),u=n(u,h,f,x,p[e+13],5,2850285829),x=n(x,u,h,f,p[e+2],9,4243563512),f=n(f,x,u,h,p[e+7],14,1735328473),u=a(u,h=n(h,f,x,u,p[e+12],20,2368359562),f,x,p[e+5],4,4294588738),x=a(x,u,h,f,p[e+8],11,2272392833),f=a(f,x,u,h,p[e+11],16,1839030562),h=a(h,f,x,u,p[e+14],23,4259657740),u=a(u,h,f,x,p[e+1],4,2763975236),x=a(x,u,h,f,p[e+4],11,1272893353),f=a(f,x,u,h,p[e+7],16,4139469664),h=a(h,f,x,u,p[e+10],23,3200236656),u=a(u,h,f,x,p[e+13],4,681279174),x=a(x,u,h,f,p[e+0],11,3936430074),f=a(f,x,u,h,p[e+3],16,3572445317),h=a(h,f,x,u,p[e+6],23,76029189),u=a(u,h,f,x,p[e+9],4,3654602809),x=a(x,u,h,f,p[e+12],11,3873151461),f=a(f,x,u,h,p[e+15],16,530742520),u=r(u,h=a(h,f,x,u,p[e+2],23,3299628645),f,x,p[e+0],6,4096336452),x=r(x,u,h,f,p[e+7],10,1126891415),f=r(f,x,u,h,p[e+14],15,2878612391),h=r(h,f,x,u,p[e+5],21,4237533241),u=r(u,h,f,x,p[e+12],6,1700485571),x=r(x,u,h,f,p[e+3],10,2399980690),f=r(f,x,u,h,p[e+10],15,4293915773),h=r(h,f,x,u,p[e+1],21,2240044497),u=r(u,h,f,x,p[e+8],6,1873313359),x=r(x,u,h,f,p[e+15],10,4264355552),f=r(f,x,u,h,p[e+6],15,2734768916),h=r(h,f,x,u,p[e+13],21,1309151649),u=r(u,h,f,x,p[e+4],6,4149444226),x=r(x,u,h,f,p[e+11],10,3174756917),f=r(f,x,u,h,p[e+2],15,718787259),h=r(h,f,x,u,p[e+9],21,3951481745),u=t(u,s),h=t(h,l),f=t(f,c),x=t(x,d);return(o(u)+o(h)+o(f)+o(x)).toLowerCase()}(e)},e.publicKeyFromString=function(e){e=e.split("|")[0];var t=new ou;return t.setPublic(e,"10001"),t},e.encrypt=function(t,i,n){var a="";try{a+=e.publicKeyFromString(i).encrypt(t)+"?"}catch(e){return{status:"Invalid public key"}}return{status:"success",cipher:a}},e.decrypt=function(e,t){var i=e.split("?");return{status:"success",plaintext:t.decrypt(i[0]),signature:"unsigned"}},e}(),fu=fu||function(e,t){var i={},n=i.lib={},a=function(){},r=n.Base={extend:function(e){a.prototype=this;var t=new a;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=n.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes;if(e=e.sigBytes,this.clamp(),n%4)for(var a=0;a<e;a++)t[n+a>>>2]|=(i[a>>>2]>>>24-a%4*8&255)<<24-(n+a)%4*8;else if(65535<i.length)for(a=0;a<e;a+=4)t[n+a>>>2]=i[a>>>2];else t.push.apply(t,i);return this.sigBytes+=e,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var i=[],n=0;n<t;n+=4)i.push(4294967296*e.random()|0);return new o.init(i,t)}}),s=i.enc={},l=s.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var i=[],n=0;n<e;n++){var a=t[n>>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(i,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var i=[],n=0;n<e;n++)i.push(String.fromCharCode(t[n>>>2]>>>24-n%4*8&255));return i.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(i,t)}},d=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},u=n.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i=this._data,n=i.words,a=i.sigBytes,r=this.blockSize,s=a/(4*r);if(t=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*r,a=e.min(4*t,a),t){for(var l=0;l<t;l+=r)this._doProcessBlock(n,l);l=n.splice(0,t),i.sigBytes-=a}return new o.init(l,a)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=u.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){u.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new h.HMAC.init(e,i).finalize(t)}}});var h=i.algo={};return i}(Math);!function(){var e=fu,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp(),e=[];for(var a=0;a<i;a+=3)for(var r=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,o=0;4>o&&a+.75*o<i;o++)e.push(n.charAt(r>>>6*(3-o)&63));if(t=n.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var i=e.length,n=this._map;(a=n.charAt(64))&&-1!=(a=e.indexOf(a))&&(i=a);for(var a=[],r=0,o=0;o<i;o++)if(o%4){var s=n.indexOf(e.charAt(o-1))<<o%4*2,l=n.indexOf(e.charAt(o))>>>6-o%4*2;a[r>>>2]|=(s|l)<<24-r%4*8,r++}return t.create(a,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,i,n,a,r,o){return((e=e+(t&i|~t&n)+a+o)<<r|e>>>32-r)+t}function i(e,t,i,n,a,r,o){return((e=e+(t&n|i&~n)+a+o)<<r|e>>>32-r)+t}function n(e,t,i,n,a,r,o){return((e=e+(t^i^n)+a+o)<<r|e>>>32-r)+t}function a(e,t,i,n,a,r,o){return((e=e+(i^(t|~n))+a+o)<<r|e>>>32-r)+t}for(var r=fu,o=(l=r.lib).WordArray,s=l.Hasher,l=r.algo,c=[],d=0;64>d;d++)c[d]=4294967296*e.abs(e.sin(d+1))|0;l=l.MD5=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,r){for(var o=0;16>o;o++){var s=e[l=r+o];e[l]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}o=this._hash.words;var l=e[r+0],d=(s=e[r+1],e[r+2]),u=e[r+3],h=e[r+4],f=e[r+5],x=e[r+6],p=e[r+7],m=e[r+8],_=e[r+9],g=e[r+10],v=e[r+11],y=e[r+12],S=e[r+13],b=e[r+14],P=e[r+15],E=t(E=o[0],R=o[1],T=o[2],C=o[3],l,7,c[0]),C=t(C,E,R,T,s,12,c[1]),T=t(T,C,E,R,d,17,c[2]),R=t(R,T,C,E,u,22,c[3]);E=t(E,R,T,C,h,7,c[4]),C=t(C,E,R,T,f,12,c[5]),T=t(T,C,E,R,x,17,c[6]),R=t(R,T,C,E,p,22,c[7]),E=t(E,R,T,C,m,7,c[8]),C=t(C,E,R,T,_,12,c[9]),T=t(T,C,E,R,g,17,c[10]),R=t(R,T,C,E,v,22,c[11]),E=t(E,R,T,C,y,7,c[12]),C=t(C,E,R,T,S,12,c[13]),T=t(T,C,E,R,b,17,c[14]),E=i(E,R=t(R,T,C,E,P,22,c[15]),T,C,s,5,c[16]),C=i(C,E,R,T,x,9,c[17]),T=i(T,C,E,R,v,14,c[18]),R=i(R,T,C,E,l,20,c[19]),E=i(E,R,T,C,f,5,c[20]),C=i(C,E,R,T,g,9,c[21]),T=i(T,C,E,R,P,14,c[22]),R=i(R,T,C,E,h,20,c[23]),E=i(E,R,T,C,_,5,c[24]),C=i(C,E,R,T,b,9,c[25]),T=i(T,C,E,R,u,14,c[26]),R=i(R,T,C,E,m,20,c[27]),E=i(E,R,T,C,S,5,c[28]),C=i(C,E,R,T,d,9,c[29]),T=i(T,C,E,R,p,14,c[30]),E=n(E,R=i(R,T,C,E,y,20,c[31]),T,C,f,4,c[32]),C=n(C,E,R,T,m,11,c[33]),T=n(T,C,E,R,v,16,c[34]),R=n(R,T,C,E,b,23,c[35]),E=n(E,R,T,C,s,4,c[36]),C=n(C,E,R,T,h,11,c[37]),T=n(T,C,E,R,p,16,c[38]),R=n(R,T,C,E,g,23,c[39]),E=n(E,R,T,C,S,4,c[40]),C=n(C,E,R,T,l,11,c[41]),T=n(T,C,E,R,u,16,c[42]),R=n(R,T,C,E,x,23,c[43]),E=n(E,R,T,C,_,4,c[44]),C=n(C,E,R,T,y,11,c[45]),T=n(T,C,E,R,P,16,c[46]),E=a(E,R=n(R,T,C,E,d,23,c[47]),T,C,l,6,c[48]),C=a(C,E,R,T,p,10,c[49]),T=a(T,C,E,R,b,15,c[50]),R=a(R,T,C,E,f,21,c[51]),E=a(E,R,T,C,y,6,c[52]),C=a(C,E,R,T,u,10,c[53]),T=a(T,C,E,R,g,15,c[54]),R=a(R,T,C,E,s,21,c[55]),E=a(E,R,T,C,m,6,c[56]),C=a(C,E,R,T,P,10,c[57]),T=a(T,C,E,R,x,15,c[58]),R=a(R,T,C,E,S,21,c[59]),E=a(E,R,T,C,h,6,c[60]),C=a(C,E,R,T,v,10,c[61]),T=a(T,C,E,R,d,15,c[62]),R=a(R,T,C,E,_,21,c[63]),o[0]=o[0]+E|0,o[1]=o[1]+R|0,o[2]=o[2]+T|0,o[3]=o[3]+C|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,a=8*t.sigBytes;i[a>>>5]|=128<<24-a%32;var r=e.floor(n/4294967296);for(i[15+(a+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),i[14+(a+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(i.length+1),this._process(),i=(t=this._hash).words,n=0;4>n;n++)a=i[n],i[n]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8);return t},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),r.MD5=s._createHelper(l),r.HmacMD5=s._createHmacHelper(l)}(Math),function(){var e,t=fu,i=(e=t.lib).Base,n=e.WordArray,a=(e=t.algo).EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:e.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i=(s=this.cfg).hasher.create(),a=n.create(),r=a.words,o=s.keySize,s=s.iterations;r.length<o;){l&&i.update(l);var l=i.update(e).finalize(t);i.reset();for(var c=1;c<s;c++)l=i.finalize(l),i.reset();a.concat(l)}return a.sigBytes=4*o,a}});t.EvpKDF=function(e,t,i){return a.create(i).compute(e,t)}}(),fu.lib.Cipher||function(e){var t=(f=fu).lib,i=t.Base,n=t.WordArray,a=t.BufferedBlockAlgorithm,r=f.enc.Base64,o=f.algo.EvpKDF,s=t.Cipher=a.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this.cfg=this.cfg.extend(i),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,i,n){return("string"==typeof i?x:h).encrypt(e,t,i,n)},decrypt:function(t,i,n){return("string"==typeof i?x:h).decrypt(e,t,i,n)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=f.mode={},c=function(e,t,i){var n=this._iv;n?this._iv=void 0:n=this._prevBlock;for(var a=0;a<i;a++)e[t+a]^=n[a]},d=(t.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();d.Encryptor=d.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;c.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),d.Decryptor=d.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,a=e.slice(t,t+n);i.decryptBlock(e,t),c.call(this,e,t,n),this._prevBlock=a}}),l=l.CBC=d,d=(f.pad={}).Pkcs7={pad:function(e,t){for(var i,a=(i=(i=4*t)-e.sigBytes%i)<<24|i<<16|i<<8|i,r=[],o=0;o<i;o+=4)r.push(a);i=n.create(r,i),e.concat(i)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:l,padding:d}),reset:function(){s.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=t.createEncryptor;else i=t.createDecryptor,this._minBufferSize=1;this._mode=i.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var u=t.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),h=(l=(f.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(r)},parse:function(e){var t=(e=r.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var i=n.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return u.create({ciphertext:e,salt:i})}},t.SerializableCipher=i.extend({cfg:i.extend({format:l}),encrypt:function(e,t,i,n){n=this.cfg.extend(n);var a=e.createEncryptor(i,n);return t=a.finalize(t),a=a.cfg,u.create({ciphertext:t,key:i,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(i,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),f=(f.kdf={}).OpenSSL={execute:function(e,t,i,a){return a||(a=n.random(8)),e=o.create({keySize:t+i}).compute(e,a),i=n.create(e.words.slice(t),4*i),e.sigBytes=4*t,u.create({key:e,iv:i,salt:a})}},x=t.PasswordBasedCipher=h.extend({cfg:h.cfg.extend({kdf:f}),encrypt:function(e,t,i,n){return i=(n=this.cfg.extend(n)).kdf.execute(i,e.keySize,e.ivSize),n.iv=i.iv,(e=h.encrypt.call(this,e,t,i.key,n)).mixIn(i),e},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),i=n.kdf.execute(i,e.keySize,e.ivSize,t.salt),n.iv=i.iv,h.decrypt.call(this,e,t,i.key,n)}})}(),function(){for(var e=fu,t=e.lib.BlockCipher,i=e.algo,n=[],a=[],r=[],o=[],s=[],l=[],c=[],d=[],u=[],h=[],f=[],x=0;256>x;x++)f[x]=128>x?x<<1:x<<1^283;var p=0,m=0;for(x=0;256>x;x++){var _=(_=m^m<<1^m<<2^m<<3^m<<4)>>>8^255&_^99;n[p]=_,a[_]=p;var g=f[p],v=f[g],y=f[v],S=257*f[_]^16843008*_;r[p]=S<<24|S>>>8,o[p]=S<<16|S>>>16,s[p]=S<<8|S>>>24,l[p]=S,S=16843009*y^65537*v^257*g^16843008*p,c[_]=S<<24|S>>>8,d[_]=S<<16|S>>>16,u[_]=S<<8|S>>>24,h[_]=S,p?(p=g^f[f[f[y^g]]],m^=f[f[m]]):p=m=1}var b=[0,1,2,4,8,16,32,64,128,27,54];i=i.AES=t.extend({_doReset:function(){for(var e=(i=this._key).words,t=i.sigBytes/4,i=4*((this._nRounds=t+6)+1),a=this._keySchedule=[],r=0;r<i;r++)if(r<t)a[r]=e[r];else{var o=a[r-1];r%t?6<t&&4==r%t&&(o=n[o>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o]):(o=n[(o=o<<8|o>>>24)>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o],o^=b[r/t|0]<<24),a[r]=a[r-t]^o}for(e=this._invKeySchedule=[],t=0;t<i;t++)r=i-t,o=t%4?a[r]:a[r-4],e[t]=4>t||4>=r?o:c[n[o>>>24]]^d[n[o>>>16&255]]^u[n[o>>>8&255]]^h[n[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,r,o,s,l,n)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,c,d,u,h,a),i=e[t+1],e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,n,a,r,o,s){for(var l=this._nRounds,c=e[t]^i[0],d=e[t+1]^i[1],u=e[t+2]^i[2],h=e[t+3]^i[3],f=4,x=1;x<l;x++){var p=n[c>>>24]^a[d>>>16&255]^r[u>>>8&255]^o[255&h]^i[f++],m=n[d>>>24]^a[u>>>16&255]^r[h>>>8&255]^o[255&c]^i[f++],_=n[u>>>24]^a[h>>>16&255]^r[c>>>8&255]^o[255&d]^i[f++];h=n[h>>>24]^a[c>>>16&255]^r[d>>>8&255]^o[255&u]^i[f++],c=p,d=m,u=_}p=(s[c>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&h])^i[f++],m=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[h>>>8&255]<<8|s[255&c])^i[f++],_=(s[u>>>24]<<24|s[h>>>16&255]<<16|s[c>>>8&255]<<8|s[255&d])^i[f++],h=(s[h>>>24]<<24|s[c>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^i[f++],e[t]=p,e[t+1]=m,e[t+2]=_,e[t+3]=h},keySize:8}),e.AES=t._createHelper(i)}();var xu=function(){function e(){}var t=e.prototype;return t.createClientObject=function(e,t,i,n,a){var r=fu.AES.encrypt((new Date).getTime().toString(),fu.enc.Hex.parse("1234567891234567123456789123456712345678912345671234567891234567"),{mode:fu.mode.CBC,iv:fu.enc.Hex.parse("12345678912345671234567891234567"),padding:fu.pad.Pkcs7}).ciphertext.toString();r.length<64&&(r+=r);var o=fu.AES.encrypt((new Date).getTime().toString(),fu.enc.Hex.parse("12345678912345671234567891234567"),{mode:fu.mode.CBC,iv:fu.enc.Hex.parse("12345678912345671234567891234567"),padding:fu.pad.Pkcs7}).ciphertext.toString();return{socket:e,id:t,PKD:i,rand:n,playURL:a.playURL||"",auth:a.auth||"",token:a.token||"",key:r,iv:o,resolve:null,reject:null}},t.playCmd=function(e){var t={sequence:0,cmd:"realplay",url:e.playURL,key:hu.encrypt(e.iv+":"+e.key,e.PKD).cipher.split("?")[0],authorization:fu.AES.encrypt(e.rand+":"+e.auth,fu.enc.Hex.parse(e.key),{mode:fu.mode.CBC,iv:fu.enc.Hex.parse(e.iv),padding:fu.pad.Pkcs7}).ciphertext.toString(),token:fu.AES.encrypt(e.token,fu.enc.Hex.parse(e.key),{mode:fu.mode.CBC,iv:fu.enc.Hex.parse(e.iv),padding:fu.pad.Pkcs7}).ciphertext.toString()};return JSON.stringify(t)},t.playbackCmd=function(e,t,i){var n={sequence:0,cmd:"playback",url:e.playURL,key:hu.encrypt(e.iv+":"+e.key,e.PKD).cipher.split("?")[0],authorization:fu.AES.encrypt(e.rand+":"+e.auth,fu.enc.Hex.parse(e.key),{mode:fu.mode.CBC,iv:fu.enc.Hex.parse(e.iv),padding:fu.pad.Pkcs7}).ciphertext.toString(),token:fu.AES.encrypt(e.token,fu.enc.Hex.parse(e.key),{mode:fu.mode.CBC,iv:fu.enc.Hex.parse(e.iv),padding:fu.pad.Pkcs7}).ciphertext.toString(),startTime:t,endTime:i};return JSON.stringify(n)},t.seekCmd=function(e,t){var i={sequence:0,cmd:"seek",startTime:e,endTime:t};return JSON.stringify(i)},e}(),pu=function(){function e(){}var t=e.prototype;return t.createClientObject=function(e,t,i,n){return{socket:e,id:t,playURL:i,deviceSerial:n.deviceSerial||"",verificationCode:n.verificationCode||"",resolve:null,reject:null}},t.playCmd=function(e){var t={sequence:0,cmd:"realplay",deviceSerial:e.deviceSerial,verificationCode:e.verificationCode,url:e.playURL};return JSON.stringify(t)},t.playbackCmd=function(e,t,i){var n={sequence:0,cmd:"playback",deviceSerial:e.deviceSerial,verificationCode:e.verificationCode,url:e.playURL,startTime:t,endTime:i};return JSON.stringify(n)},e}(),mu=Symbol("WEBSOCKET"),_u=Symbol("GETINDEX"),gu=Symbol("PROTOCOLVERSION"),vu=Symbol("CIPHERSUITES"),yu=new Ed,Su=new Cd,bu=new xu,Pu=new pu,Eu=function(){function e(){this[gu]="0.1",this[vu]=0,this[mu]=[],this.ERRORS={},this[_u]=function(e){for(var t=-1,i=0,n=this[mu].length;i<n;i++)if(this[mu][i].id===e){t=i;break}return t}}var t=e.prototype;return t.openStream=function(e,t,i,n){var a=!1;e.indexOf("[")>-1&&(a=!0);var r=this,o=e.split("://"),s=o[0],l="",c=7681,d=1,u=0,h=!1;if(a)l=o[1].split("]:")[0]+"]",c=Math.floor(o[1].split("]:")[1].split("/")[0]),d=Math.floor(o[1].split("]:")[1].split("/")[1]/100),u=Math.floor(o[1].split("]:")[1].split("/")[1]%100)-1;else{l=o[1].split(":")[0],c=Math.floor(o[1].split(":")[1].split("/")[0]),d=Math.floor(o[1].split(":")[1].split("/")[1]/100),u=Math.floor(o[1].split(":")[1].split("/")[1]%100)-1;var f=o[1].split(":")[1].split("/")[2];""!==f&&"webSocketVideoCtrlProxy"===f&&(h=!0)}0===d&&(u=0);var x="&sessionID=";(t=t||{}).token&&!t.playURL&&(x="&token=");var p=t.sessionID||t.session||(t.playURL?"":t.token)||"",m=new window.WebSocket(s+"://"+l+":"+c+(t.mode?"/"+t.mode:"")+(h?"/webSocketVideoCtrlProxy":"")+"?version="+r[gu]+"&cipherSuites="+r[vu]+x+p+(t.proxy?"&proxy="+t.proxy:""));m.binaryType="arraybuffer";var _=Pd(),g=-1,v=new Promise((function(e,a){m.onopen=function(){t.playURL||t.sessionID||t.deviceSerial||t.token||(r[mu].push(yu.createClientObject(m,_,d,u)),e(_))},m.onmessage=function(n){if("string"==typeof n.data){var o=JSON.parse(n.data),s=r[_u](_);if(o&&o.version&&o.cipherSuite){if(r[gu]=o.version,r[vu]=parseInt(o.cipherSuite,10),o&&o.PKD&&o.rand)r[mu].push(bu.createClientObject(m,_,o.PKD,o.rand,t));else{var h="live://"+l+":"+c+"/"+d+"/"+u;-1===r[vu]?r[mu].push(Pu.createClientObject(m,_,h,t)):r[mu].push(Su.createClientObject(m,_,h))}return void e(_)}if(o&&o.sdp){var f=Su.getMediaFromSdp(o.sdp);i({bHead:!0,buf:f})}if(o&&o.cmd&&"end"===o.cmd&&i({type:"exception",cmd:o.cmd}),o&&o.statusString&&("ok"===o.statusString.toLowerCase()&&r[mu][s].resolve&&r[mu][s].resolve(o),"ok"!==o.statusString.toLowerCase())){var x=Su.getError(o);s>-1?r[mu][s].reject&&r[mu][s].reject(x):a(x)}o&&o.errorCode&&i(o)}else{var p={},v=new Uint8Array(n.data);if(g++,64===v.byteLength||40===v.byteLength){for(var y=-1,S=v.byteLength,b=0;b<S;b++)if(73===v[b]&&77===v[b+1]&&75===v[b+2]&&72===v[b+3]){y=b;break}p=-1!==y?{bHead:!0,buf:v.slice(y,y+40)}:{bHead:!1,buf:v},i(p)}else g>0&&i(p={bHead:!1,buf:v});v=null,p=null,n=null}},m.onclose=function(){for(var e=0,t=r[mu].length;e<t;e++)if(r[mu][e].id===_){r[mu][e].resolve(),r[mu].splice(e,1),setTimeout((function(){n()}),200);break}a()}}));return v},t.startPlay=function(e,t,i){var n=this,a=this[_u](e);return t&&i&&"0.1"===n[gu]&&(t=t.replace(/-/g,"").replace(/:/g,""),i=i.replace(/-/g,"").replace(/:/g,"")),new Promise((function(e,r){if(a>-1){n[mu][a].resolve=e,n[mu][a].reject=r;var o=null;t&&i?"0.1"!==n[gu]?0===n[vu]?o=bu.playbackCmd(n[mu][a],t,i):1===n[vu]?o=Su.playbackCmd(t,i,n[mu][a].playURL):-1===n[vu]&&(o=Pu.playbackCmd(n[mu][a],t,i)):o=yu.playbackCmd(t,i,n[mu][a].iCurChannel,n[mu][a].iCurStream):0===n[mu][a].iCurChannel&&"0.1"===n[gu]?o=yu.zeroPlayCmd(n[mu][a].iCurChannel,n[mu][a].iCurStream):"0.1"!==n[gu]?0===n[vu]?o=bu.playCmd(n[mu][a]):1===n[vu]?o=Su.playCmd(n[mu][a].playURL):-1===n[vu]&&(o=Pu.playCmd(n[mu][a])):o=yu.playCmd(n[mu][a].iCurChannel,n[mu][a].iCurStream),n[mu][a].socket.send(o),"0.1"===n[gu]&&e()}else"0.1"===n[gu]&&r()}))},t.singleFrame=function(){},t.setPlayRate=function(e,t){var i=this;return new Promise((function(n,a){for(var r=0,o=i[mu].length;r<o;r++)if(i[mu][r].id===e){if("0.1"===i[gu]){var s=yu.playRateCmd(t);i[mu][r].socket.send(s),n();break}i[mu][r].resolve=n,i[mu][r].reject=a;var l=Su.playRateCmd(t);i[mu][r].socket.send(l)}}))},t.seek=function(e,t,i){var n=this;return new Promise((function(a,r){for(var o=0,s=n[mu].length;o<s;o++)if(n[mu][o].id===e){n[mu][o].resolve=a,n[mu][o].reject=r;var l=bu.seekCmd(t,i);n[mu][o].socket.send(l)}}))},t.pause=function(e){var t=this;return new Promise((function(i,n){for(var a=0,r=t[mu].length;a<r;a++)if(t[mu][a].id===e){if("0.1"===t[gu]){var o=yu.pauseCmd();t[mu][a].socket.send(o),i();break}t[mu][a].resolve=i,t[mu][a].reject=n;var s=Su.pauseCmd();t[mu][a].socket.send(s)}}))},t.transmission=function(e,t){var i=this;return new Promise((function(n,a){for(var r=0,o=i[mu].length;r<o;r++)i[mu][r].id===e&&(i[mu][r].resolve=n,i[mu][r].reject=a,i[mu][r].socket.send(t))}))},t.resume=function(e){var t=this;return new Promise((function(i,n){for(var a=0,r=t[mu].length;a<r;a++)if(t[mu][a].id===e){if("0.1"===t[gu]){var o=yu.resumeCmd();t[mu][a].socket.send(o),i();break}t[mu][a].resolve=i,t[mu][a].reject=n;var s=Su.resumeCmd();t[mu][a].socket.send(s)}}))},t.stop=function(e){var t=this;return new Promise((function(i,n){if(e){for(var a=-1,r=0,o=t[mu].length;r<o;r++)if(t[mu][r].id===e){a=r,t[mu][r].resolve=i,t[mu][r].socket.close(1e3,"CLOSE");break}-1===a&&n()}else n()}))},t.stopAll=function(){var e=this;return new Promise((function(t,i){for(var n=0,a=e[mu].length;n<a;n++)e[mu][n].socket.close(1e3,"CLOSE");t()}))},e}(),Cu=function(){function e(e){this._streamUUID=null,this._player=e,this._streamClient=new Eu}var t=e.prototype;return t.openStream=function(e,t,i,n){var a=this;return this._streamClient.openStream(e,t,i,n).then((function(i){return a._streamUUID=i,a._player.logger.log("["+ud+"] url: ",e,"oParams: ",t),a._player.event.emit(""+ud,cd(i)),i}))},t.startPlay=function(e){var t=this;return e=null!=e?e:this._streamUUID,this._streamClient.startPlay(e).then((function(){t._player.logger.log("["+hd+"] StreamUUID: ",e),t._player.event.emit(""+hd,cd(e))}))},t.setPlayRate=function(e,t){var i=this;return t=null!=t?t:this._streamUUID,this._streamClient.setPlayRate(t,e).then((function(){i._player.logger.log("[StreamClient.setPlayRate] StreamUUID: ",t," rate: ",e),i._player.event.emit(""+hd,cd({id:t,rate:e}))}))},t.seek=function(e,t,i){var n=this;return i=null!=i?i:this._streamUUID,this._streamClient.seek(i,e,t).then((function(){n._player.logger.log("["+xd+"] StreamUUID: ",i," startTime: ",e," stopTime:",t),n._player.event.emit(""+xd,cd({id:i,startTime:e,stopTime:t}))}))},t.stopAll=function(){var e=this;return this._streamClient.stopAll().then((function(){e._player.logger.log("["+fd+"]"),e._player.event.emit(fd,cd(void 0))}))},t.destroy=function(){var e=this;this.stopAll().then((function(){e._streamUUID=null,e._streamClient=null}))},e}();function Tu(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Ru(){return Ru=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Ru.apply(this,arguments)}var wu=768,Iu={port:0,start:{x:0,y:0},total:{x:0,y:0},diff:{x:0,y:0},startPTZPosition:{x:0,y:0},lastCorrdsY:0,param2d:{upDateType:4,fValue:0,fPTZParam:{fPTZPositionX:0,fPTZPositionY:0},fPTZZoom:0}},Du=function(){function e(e){this._canvasFECSubPort=new Map,this._correctType=null,this._player=e,this.init()}var t=e.prototype;return t._supportFEC=function(){return this._player._decoderStatus.bSupHardOrSoft},t.init=function(){var e=this;this._player.logger.log("FECSplitIds.init"),this._player.event.on("JSPlayM4_Play_Before",(function(){e._player.logger.log("JSPlayM4_Play_Before event: _FECSplitIds =  ",e._FECSplitIds),e._FECSplitIds&&e._supportFEC()&&e._player.wasmplayer.JSPlayM4_FEC_SetCanvasID(e._FECSplitIds)})),this._player.event.on("JSPlayM4_Play_After",(function(){e._player.logger.log("JSPlayM4_Play_After event: _FECSplitIds =  ",e._FECSplitIds),e._FECSplitIds&&e._supportFEC()&&e._canvasFECSubPort.set(e._player._playerWindow.canvasId,Ru({},Iu))})),this._player.event.on("PlayM4_openStream",(function(){e._FECSplitIds&&e._supportFEC()&&e._player.wasmplayer.JSPlayM4_SetDecodeEngine(0)})),this._player.event.on("JSPlayM4_Stop",(function(){e._colseFECAllSubWnd()})),this._player.event.on(dd.destroy,(function(){e._colseFECAllSubWnd()})),this._player.logger.log("FECCorrect init")},t.setFECCorrectType=function(e,t){var i=this;return this._supportFEC()?(this._FECSplitIds=t,this._correctType=e,new Promise((function(n,a){var r=i._createSplitCanvas(e,t),o=r.find((function(e){return-1===e.code}));i._player.event.emit("FECCorrect.setFECCorrectType",cd({type:e,ids:t})),o||0===r.length?a(r):n(r)}))):Promise.reject()},t.setFEC2DParam=function(e,t){if(this._supportFEC())return this._player.event.emit("FECCorrect.setFEC2DParam",cd({port:e,param2d:t})),this._player.wasmplayer.JSPlayM4_FEC_SetParam(e,t)},t.setFEC3DViewParam=function(e){if(!this._supportFEC())return Promise.reject(!1);var t=this._player.wasmplayer;if(this._FECSplitIds&&this._canvasFECSubPort&&this._correctType){var i=t.JSPlayM4_FEC_SetViewParam(e.port,e.upDateType,e.fValue);return this._player.event.emit("FECCorrect.setFEC2DParam",cd({param:e})),1===i?Promise.resolve(!0):Promise.reject(!1)}return Promise.reject(void 0)},t.get3DViewParam=function(e){var t=this;if(!this._supportFEC())return Promise.reject(!1);var i=this._player.wasmplayer;return new Promise((function(n,a){return t._FECSplitIds&&t._canvasFECSubPort&&t._correctType&&1!==i.JSPlayM4_FEC_GetViewParam(e.port,e.upDateType,(function(i){t._player.event.emit("FECCorrect.get3DViewParam",cd({param:e})),n(i)}))?a(!1):a(void 0)}))},t.getFECSubPortMap=function(){var e=this._canvasFECSubPort;return this._player.event.emit("FECCorrect.getFECSubPortMap",cd(e)),e},t._createSplitCanvas=function(e,t){var i=this._player._playerWindow.canvasId,n=(t=i+t?","+this._FECSplitIds:"")?t.split(","):[],a=this._player.wasmplayer,r=[],o=this;if(e.correctList&&e.correctList.length>0){for(var s=0;s<e.correctList.length;s++)if(0!==s||!e.correctList[s].hidden)if(0!==s){var l=document.getElementById(n[s]);if(!n[s]||!l||"CANVAS"!==l.nodeName)return this._player.logger.error("Canvas element is null"),[];var c=a.JSPlayM4_FEC_GetPort(e.place,e.correctList[s].correctType),d=a.JSPlayM4_FEC_Enable(c),u=a.JSPlayM4_FEC_SetWnd(c,n[s]),h={upDateType:this._matchUpDateType(e.correctList[s].correctType),fValue:0,fPTZParam:{fPTZPositionX:e.correctList[s].x||0,fPTZPositionY:e.correctList[s].y||0},fPTZZoom:1e-5};this.setFEC2DParam(c,h),0===d||0===u?r.push({code:-1,msg:"失败",port:c,id:n[s]}):(r.push({code:0,msg:"成功",port:c,id:n[s]}),this._canvasFECSubPort.set(n[s],Ru({},Iu,{port:c,param2d:h,startPTZPosition:{x:h.fPTZParam.fPTZPositionX,y:h.fPTZParam.fPTZPositionY}})),l.setAttribute("data-port",c),this._spliceCanvasMouseEvents(n[s],e.correctList[s]))}else f(e.correctList[0])}else f(e);function f(t){var n={upDateType:o._matchUpDateType(t.correctType),fValue:0,fPTZParam:{fPTZPositionX:t.x||0,fPTZPositionY:t.y||0},fPTZZoom:1e-5},s=o._canvasFECSubPort.get(i).port;if(void 0===s)return r;1===a.JSPlayM4_FEC_ResetCorrectType(s,e.place,t.correctType)?(r.push({code:0,msg:"成功",port:s,id:i}),t.correctType<=wu?o.setFEC2DParam(s,n):t.viewParam&&setTimeout((function(){"number"==typeof t.viewParam.x&&"number"==typeof t.viewParam.y&&(a.JSPlayM4_FEC_SetViewParam(s,2,t.viewParam.x),a.JSPlayM4_FEC_SetViewParam(s,1,t.viewParam.y)),"number"==typeof t.viewParam.zoom&&a.JSPlayM4_FEC_SetViewParam(s,3,t.viewParam.zoom)}),200),o._canvasFECSubPort.set(i,Ru({},Iu,{port:s,param2d:n,startPTZPosition:{x:n.fPTZParam.fPTZPositionX,y:n.fPTZParam.fPTZPositionY}})),o._spliceCanvasMouseEvents(i,t)):r.push({code:-1,msg:"失败",port:s,id:i})}return r},t._matchUpDateType=function(e){switch(e){case wu:return 4;case 256:return 8}return 2},t._spliceCanvasMouseEvents=function(e,t){if(void 0!==e){var i=document.getElementById(e);if(null!==i){var n=this._player.wasmplayer,a=i.getAttribute("id"),r=this._canvasFECSubPort.get(a);if(void 0!==r.port){var o=i.width,s=i.height,l=function(e){};i.addEventListener("mousedown",(function(e){r.start.x=e.pageX,r.start.y=e.pageY,r.lastCorrdsY=e.pageY,l=function(e){!function(e){var i=[e.clientX,e.clientY];r.diff.y=i[1]-r.start.y;var a=(r.total.y+r.diff.y)/s*2*Math.PI,l=(i[1]-r.lastCorrdsY)/(2*s),c=Math.atan2(r.startPTZPosition.y-.5,r.startPTZPosition.x-.5),d=r.startPTZPosition.x+l*Math.cos(c),u=r.startPTZPosition.y+l*Math.sin(c);r.diff.x=i[0]-r.start.x;var h=(r.total.x+r.diff.x)/o*2*Math.PI,f=Math.sqrt(Math.pow(d-.5,2)+Math.pow(u-.5,2)),x=-h,p=.5+f*Math.cos(x),m=.5+f*Math.sin(x);if(t.correctType<=wu){switch(t.correctType){case wu:case 512:r.param2d.upDateType=4;break;case 256:if(r.param2d.upDateType=8,Math.sqrt(Math.pow(p-.5,2)+Math.pow(m-.5,2))>.4)return}r.param2d.fValue=h,r.param2d.fPTZParam.fPTZPositionX=p,r.param2d.fPTZParam.fPTZPositionY=m,n.JSPlayM4_FEC_SetParam(r.port,r.param2d)}else 1536===t.correctType&&(n.JSPlayM4_FEC_SetViewParam(r.port,2,h),n.JSPlayM4_FEC_SetViewParam(r.port,1,a))}(e)},i.addEventListener("mousemove",l)}));var c=function(){null!==l&&(i.removeEventListener("mousemove",l),l=null,r.total.x+=r.diff.x,r.total.y+=r.diff.y)};i.addEventListener("mouseup",c),i.addEventListener("mouseleave",c),i.addEventListener("mouseout",c)}}}},t._colseFECAllSubWnd=function(){if(this._FECSplitIds&&this._canvasFECSubPort&&this._supportFEC())for(var e,t=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Tu(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Tu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[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.")}(this._FECSplitIds.split(","));!(e=t()).done;){var i=e.value;if(i){var n=this._canvasFECSubPort.get(i);if(void 0===n||void 0===n.port)continue;this._canvasFECSubPort.delete(i);var a=this._player.wasmplayer;a.JSPlayM4_FEC_Disable(n.port,!0),a.JSPlayM4_FEC_DelPort(n.port)}}},e}();const ku=[["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"]],Fu=(()=>{if("undefined"==typeof document)return!1;const e=ku[0],t={};for(const i of ku){const n=i?.[1];if(n in document){for(const[n,a]of i.entries())t[e[n]]=a;return t}}return!1})(),Au={change:Fu.fullscreenchange,error:Fu.fullscreenerror};let Mu={request:(e=document.documentElement,t)=>new Promise(((i,n)=>{const a=()=>{Mu.off("change",a),i()};Mu.on("change",a);const r=e[Fu.requestFullscreen](t);r instanceof Promise&&r.then(a).catch(n)})),exit:()=>new Promise(((e,t)=>{if(!Mu.isFullscreen)return void e();const i=()=>{Mu.off("change",i),e()};Mu.on("change",i);const n=document[Fu.exitFullscreen]();n instanceof Promise&&n.then(i).catch(t)})),toggle:(e,t)=>Mu.isFullscreen?Mu.exit():Mu.request(e,t),onchange(e){Mu.on("change",e)},onerror(e){Mu.on("error",e)},on(e,t){const i=Au[e];i&&document.addEventListener(i,t,!1)},off(e,t){const i=Au[e];i&&document.removeEventListener(i,t,!1)},raw:Fu};Object.defineProperties(Mu,{isFullscreen:{get:()=>Boolean(document[Fu.fullscreenElement])},element:{enumerable:!0,get:()=>document[Fu.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[Fu.fullscreenEnabled])}}),Fu||(Mu={isEnabled:!1});var Lu=Mu;function Bu(){return!!(document.fullscreen||document.mozFullScreen||document.webkitIsFullScreen||document.webkitFullScreen||document.msFullScreen)}var Ou=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"],ju=function(){function e(e,t){this._fullscreenchangeEvent=null,this.player=e,this.target=null!=t?t:e.$container,this._fullscreenChange()}var t=e.prototype;return t.fullScreen=function(e,t){var i=this;return this.target?Lu.request(this.target).then((function(){e&&t&&i.player.resize(e,t)})):Promise.reject()},t.exitScreen=function(){return Bu()?Lu.exit():Promise.resolve()},t.destroy=function(){var e=this;Ou.forEach((function(t){e.target&&e._fullscreenchangeEvent&&e.target.removeEventListener(t,e._fullscreenchangeEvent)}))},t._fullscreenChange=function(){var e=this,t=this;this._fullscreenchangeEvent=function(){Bu()?t.player.event.emit("fullScreen"):t.player.event.emit("exitScreen")},Ou.forEach((function(t){e.target&&e.target.addEventListener(t,e._fullscreenchangeEvent)})),this.player&&this.player.event.on(dd.destroy,(function(){e.destroy()}))},e}();function Nu(e,t){if(e.pluginManager||(e.pluginManager=new sd(e)),(null==t?void 0:t.staticPath)?/^http[s]?:\/\//.test(t.staticPath)||(t.staticPath=location.origin+t.staticPath):t.staticPath=location.origin,e._options=Object.assign({},id,e._options,t),!e._options.id)throw new Error("id is required");var i=Bu();if("string"!=typeof e._options.id)throw new Error("id is required and only support string");e.$container=document.getElementById(e._options.id),e._options.fullScreenEle||(e._options.fullScreenEle=e.$container);var n,a,r=i?window.screen.width:e._options.width,o=i?window.screen.height:e._options.height;e.$container.style.cssText+="display:inline-block;width:"+r+"px;height:"+o+"px;background:#000000;background-size:100% 100%;vertical-align:top;",e._oStreamClient||(e._oStreamClient=new Cu(e)),e.logger||(e.logger=function(e){var t=new ti(e);return new Proxy(t,{get:function(e,t){if(ni.includes(t)){var i;if(null==(i=e._options)?void 0:i.showTime){var n=(r=(a=new Date(Date.now())).getFullYear(),o=a.getMonth()+1,s=a.getDate(),l=a.getHours(),c=a.getMinutes(),d=a.getSeconds(),u=a.getMilliseconds(),r+"/"+ii(o)+"/"+ii(s)+" "+ii(l)+":"+ii(c)+":"+ii(d)+":"+u);return e[t].bind(console,"["+n+"]")}return e[t].bind(console)}var a,r,o,s,l,c,d,u;return Reflect.get(e,t)}})}(e._options.logger)),e.i18n||(e.i18n=new Yc({en:Qc,zh:ed})),e.fECCorrect||(e.fECCorrect=new Du(e)),e._options.accessToken&&td(e._options.url)&&(e.urlInfo=function(e){var t={};if(/^ezopen:\/\//.test(e)){if(e.includes("@")){var i=e.indexOf("@"),n=e.indexOf("//");t.validateCode=e.substring(n+2,i),e=e.replace(t.validateCode+"@","")}t.protocol=e.split("//")[0],t.search=e.split("?")[1]?"?"+e.split("?")[1]:"",t.hostname=e.split("/")[2],t.origin=t.protocol+"//"+t.hostname,t.pathname=e.split("?")[0].replace(t.origin,""),t.href=e;var a=t.pathname.split("/"),r=a[2].split(".");return t.deviceSerial=a[1],t.channelNo=r[0],t.type=r[r.length-1],"live"===t.type&&(t.definition=r.length>2?r[1]:"sd"),"rec"===t.type&&(t.recType=r.length>2?r[1]:""),t.searchParams=function(e){var t=e.split("?")[1],i={};if(t)for(var n=t.split("&"),a=0;a<n.length;a++){var r=n[a].split("=");i[r[0]]=decodeURIComponent(r[1])}return i}(e),t}return{}}(e._options.url),e.service=new $c({deviceSerial:e.urlInfo.deviceSerial,accessToken:e._options.accessToken,domain:null==(a=e._options)||null==(n=a.env)?void 0:n.domain}),function(e){e.service.getDeviceCapacity().then((function(t){200==+t.code?e.deviceCapacity=t.data:e.logger.error("getDeviceCapacity error: ",t)})).catch((function(t){e.logger.error("getDeviceCapacity error: ",t)}))}(e))}var Uu="ezui-player";function zu(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Hu={borderSelect:"#FFCC00",border:"none",background:"#000000"},Vu=function(){function e(e,t,i,n){void 0===n&&(n={}),this.id=e,this.canvasId=e+"-player",this.width=t,this.height=i,this.style=Object.assign({},Hu,n),this.$playerWnd=document.createElement("div")}var t=e.prototype;return t.render=function(){var e;this.$playerWnd&&(this.$playerWnd.innerHTML="");var t=""+Uu,i=this.width,n=this.height,a=this.width-i,r=this.height-n;this.$playerWnd.classList.add(this.id+"parent-wnd",t+"-wrapper"),this.$playerWnd.style.overflow="hidden",this.$playerWnd.style.width="100%",this.$playerWnd.style.height="100%",this.$playerWnd.style.position="relative";for(var o="",s=0;s<1;s++){var l=a+(s%1==0?i:0),c=r+(s+1>=Math.pow(1,2)?n:0);o+='<div id="'+this.id+"-container-"+s+'" class="'+t+"-container "+t+"-container-"+s+'" style="float:left; background-color: '+this.style.background+"; position: relative; width:"+l+"px; height: "+c+'px;">\n                  <canvas id="'+this.id+"canvas_draw"+s+'" class="'+this.id+"draw-window "+t+'-canvas-draw" style="position:absolute; top:0; left:0;" wid="'+s+'" width="'+this.width+"\" height='"+this.height+"'></canvas>              \n                  <canvas id=\""+this.canvasId+'" class="'+this.id+"play-window "+t+'-canvas" wid="'+s+'" width="'+l+'" height="'+c+'"></canvas>\n                </div>'}this.$playerWnd.innerHTML=o,null==(e=document.getElementById(this.id))||e.appendChild(this.$playerWnd)},t.destroy=function(){var e=document.getElementById(this.id);e&&e.removeChild(this.$playerWnd),this.$playerWnd=null,this.width=0,this.height=0},t.resize=function(e,t){if(this.$playerWnd){this.width=e,this.height=t;for(var i,n=document.getElementById(this.id+"-container-0"),a=document.getElementById(this.id+"canvas_draw0"),r=document.getElementById(this.canvasId),o=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return zu(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?zu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[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.")}([this.$playerWnd,n,r,a]);!(i=o()).done;){var s=i.value;s&&(s.style.width=e+"px",s.style.height=t+"px")}}},t.reRenderCanvas=function(e){var t,i=document.getElementById(this.canvasId),n=null==(t=this.$playerWnd)?void 0:t.children[0];if(i){if(!e)return;null==n||n.removeChild(i)}var a=document.createElement("canvas");a.id=this.canvasId,n&&n.appendChild(a),a.width=this.width,a.height=this.height},e}(),Zu={exports:{}};!function(e,t){function n(e,t,i,n,a,r,o){try{var s=e[r](o),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function a(e){return function(){var t=this,i=arguments;return new Promise((function(a,r){var o=e.apply(t,i);function s(e){n(o,a,r,s,l,"next",e)}function l(e){n(o,a,r,s,l,"throw",e)}s(void 0)}))}}function r(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}Zu.exports=function(){var e={477:function(e){e.exports=function(e,t,i,n){var a=self||window;try{try{var r;try{r=new a.Blob([e])}catch(t){(r=new(a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder)).append(e),r=r.getBlob()}var o=a.URL||a.webkitURL,s=o.createObjectURL(r),l=new a[t](s,i);return o.revokeObjectURL(s),l}catch(n){return new a[t]("data:application/javascript,".concat(encodeURIComponent(e)),i)}}catch(e){if(!n)throw Error("Inline worker is not supported");return new a[t](n,i)}}},61:function(e,t,i){var n=i(698).default;function a(){e.exports=a=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},i=Object.prototype,o=i.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",d=s.toStringTag||"@@toStringTag";function u(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,i){return e[t]=i}}function h(e,t,i,n){var a,o,s,l,c=t&&r(t.prototype,p)?t:p,d=Object.create(c.prototype),u=new R(n||[]);return d._invoke=(a=e,o=i,s=u,l="suspendedStart",function(e,t){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===e)throw t;return{value:void 0,done:!0}}for(s.method=e,s.arg=t;;){var i=s.delegate;if(i){var n=E(i,s);if(n){if(n===x)continue;return n}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===l)throw l="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);l="executing";var r=f(a,o,s);if("normal"===r.type){if(l=s.done?"completed":"suspendedYield",r.arg===x)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(l="completed",s.method="throw",s.arg=r.arg)}}),d}function f(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var x={};function p(){}function m(){}function _(){}var g={};u(g,l,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(w([])));y&&y!==i&&o.call(y,l)&&(g=y);var S=_.prototype=p.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function i(a,r,s,l){var c=f(e[a],e,r);if("throw"!==c.type){var d=c.arg,u=d.value;return u&&"object"==n(u)&&o.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(u).then((function(e){d.value=e,s(d)}),(function(e){return i("throw",e,s,l)}))}l(c.arg)}var a;this._invoke=function(e,n){function r(){return new t((function(t,a){i(e,n,t,a)}))}return a=a?a.then(r,r):r()}}function E(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return x;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return x}var n=f(i,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,x;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,x):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,x)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function w(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,n=function t(){for(;++i<e.length;)if(o.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:I}}function I(){return{value:void 0,done:!0}}return m.prototype=_,u(S,"constructor",_),u(_,"constructor",m),m.displayName=u(_,d,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,d,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},b(P.prototype),u(P.prototype,c,(function(){return this})),t.AsyncIterator=P,t.async=function(e,i,n,a,r){void 0===r&&(r=Promise);var o=new P(h(e,i,n,a),r);return t.isGeneratorFunction(i)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(S),u(S,d,"Generator"),u(S,l,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var n=t.pop();if(n in e)return i.value=n,i.done=!1,i}return i.done=!0,i}},t.values=w,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,n){return r.type="throw",r.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n],r=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var r=a?a.completion:{};return r.type=e,r.arg=t,a?(this.method="next",this.next=a.finallyLoc,x):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),x},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),T(i),x}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var a=n.arg;T(i)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:w(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),x}},t}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},698:function(e){function t(i){return e.exports=t="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:function(e,t,i){var n=i(61)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function n(i){var a=t[i];if(void 0!==a)return a.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return function(){var e=function(e,t){if(!r(e,t))throw new TypeError("Cannot call a class as a function")},t=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}},o=function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},l=function(e,t,i,n,a,r,o){try{var s=e[r](o),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,a)},c=function(){return j()("((()=>{'use strict';function _0x54580d(_0x2b6bad,_0x2d533c){if(!(_0x2b6bad instanceof _0x2d533c))throw new TypeError('Cannot\\x20call\\x20a\\x20class\\x20as\\x20a\\x20function');}function _0xae16d8(_0x51512e,_0x306019){for(var _0x585d8=0x0;_0x585d8<_0x306019['length'];_0x585d8++){var _0x34aa33=_0x306019[_0x585d8];_0x34aa33['enumerable']=_0x34aa33['enumerable']||!0x1,_0x34aa33['configurable']=!0x0,'value'in _0x34aa33&&(_0x34aa33['writable']=!0x0),Object['defineProperty'](_0x51512e,_0x34aa33['key'],_0x34aa33);}}function _0x4fd085(_0xfb685a,_0x3f4464,_0xc28cb1){return _0x3f4464&&_0xae16d8(_0xfb685a['prototype'],_0x3f4464),_0xc28cb1&&_0xae16d8(_0xfb685a,_0xc28cb1),Object['defineProperty'](_0xfb685a,'prototype',{'writable':!0x1}),_0xfb685a;}var _0x599b74=0x501,_0x4b57a2=0x502,_0xa88cb3=0x505,_0x1ee0b0=0x507,_0x31d5c8=0x508,_0x13beae=0x509,_0x41c932=0x512,_0x633153=0x516,_0x2aea6b=0x1,_0x240c92=0x2,_0x1e68ea=0x3,_0x4fbb93=0x0,_0x54a990=0x100,_0x2cb8a2=0x200,_0x4e5968=0x300,_0x30e952=0x400,_0x1837a3=0x500,_0x20b7ae=0x600,_0x443c47=0x700,_0x30ecd9=0x800,_0x39b0d3=0x900,_0x2a01ec=0xa00,_0x16ee77=0x1,_0x3ff4c5=0x2,_0x353221=0x4,_0x2b1528=0x8,_0x1f2582=0x10,_0x160732=0x20,_0x285caf=(function(){function _0x3a5d6f(_0x464baf,_0x1e0a98,_0x5183ee){_0x54580d(this,_0x3a5d6f),this['width']=0x0,this['height']=0x0,this['decoderObj']=null,this['FirstFrame']=!0x0,this['ready_frames']=[],this['underflow']=!0x0,this['sab']=_0x464baf,this['frameRate']=0x1e,this['needSetPreSoft']=!0x1,this['decoderCurStatus']=0x2,this['decoderOutSuccess']=!0x1,this['decoderObjNeedReset']=!0x1,this['oVideoRenderHandle']=_0x1e0a98,this['output']=this['output']['bind'](this),this['reportError']=this['reportError']['bind'](this),this['player']=null,null!=_0x5183ee&&(this['player']=_0x5183ee),this['curFrame']=null;}return _0x4fd085(_0x3a5d6f,[{'key':'initDecoder','value':function(){if(null==this['decoderObj']){var _0x2d79fc={'output':this['output'],'error':this['reportError']};this['decoderObj']=new VideoDecoder(_0x2d79fc);}this['underflow']&&(this['underflow']=!0x1,setTimeout(this['oVideoRenderHandle']['RenderFrame'](),0x0),this['oVideoRenderHandle']['displayRunning']=!0x0),this['decoderCurStatus']=0x2,this['FirstFrame']=!0x0;}},{'key':'inputData','value':function(_0x14a132,_0x2702c6){null!=this['decoderObj']&&('configured'==this['decoderObj']['state']||this['FirstFrame'])&&this['decodeProcess'](_0x14a132,_0x2702c6),_0x2702c6['nStreamEnd']&&this['SetStreamEnd']();}},{'key':'concatenate','value':function(_0x5e99ee){for(var _0x1d99af=0x0,_0x224806=arguments['length'],_0x2c0fc3=new Array(_0x224806>0x1?_0x224806-0x1:0x0),_0xe5bc19=0x1;_0xe5bc19<_0x224806;_0xe5bc19++)_0x2c0fc3[_0xe5bc19-0x1]=arguments[_0xe5bc19];for(var _0x2e36e3=0x0,_0x4839aa=_0x2c0fc3;_0x2e36e3<_0x4839aa['length'];_0x2e36e3++){var _0x5b5797=_0x4839aa[_0x2e36e3];_0x1d99af+=_0x5b5797['length'];}for(var _0xd7b863=new _0x5e99ee(_0x1d99af),_0x34342b=0x0,_0x467991=0x0,_0x454adf=_0x2c0fc3;_0x467991<_0x454adf['length'];_0x467991++){var _0x1d9c81=_0x454adf[_0x467991];_0xd7b863['set'](_0x1d9c81,_0x34342b),_0x34342b+=_0x1d9c81['length'];}return _0xd7b863;}},{'key':'processData','value':function(_0x3e77b2){for(var _0x24d282=null,_0x199354=null,_0x7aab92=null,_0x3c4951=!0x1,_0x2f2bac=!0x1,_0x4e9e0c=0x0,_0x7feff9=0x0;_0x7feff9<_0x3e77b2['length']-0x4;_0x7feff9++){if(0x0!=_0x3e77b2[_0x7feff9]||0x0!=_0x3e77b2[_0x7feff9+0x1]||0x0!=_0x3e77b2[_0x7feff9+0x2]||0x1!=_0x3e77b2[_0x7feff9+0x3]||0x67!=_0x3e77b2[_0x7feff9+0x4]&&0x27!=_0x3e77b2[_0x7feff9+0x4]||(0x0!=_0x7feff9?(_0x2f2bac=!0x0,_0x24d282=_0x3e77b2['slice'](_0x7feff9),_0x4e9e0c=_0x7feff9):_0x24d282=_0x3e77b2),0x0==_0x3e77b2[_0x7feff9]&&0x0==_0x3e77b2[_0x7feff9+0x1]&&0x0==_0x3e77b2[_0x7feff9+0x2]&&0x1==_0x3e77b2[_0x7feff9+0x3]&&(0x9==_0x3e77b2[_0x7feff9+0x4]||0x6==_0x3e77b2[_0x7feff9+0x4])){if(null==_0x24d282)continue;null==_0x199354&&(_0x199354=_0x3e77b2['slice'](_0x4e9e0c,_0x7feff9),_0x3c4951=!0x0);}if(0x0==_0x3e77b2[_0x7feff9]&&0x0==_0x3e77b2[_0x7feff9+0x1]&&0x0==_0x3e77b2[_0x7feff9+0x2]&&0x1==_0x3e77b2[_0x7feff9+0x3]&&(0x65==_0x3e77b2[_0x7feff9+0x4]||0x25==_0x3e77b2[_0x7feff9+0x4])){_0x3c4951&&(_0x7aab92=_0x3e77b2['slice'](_0x7feff9));break;}}return _0x3c4951?this['concatenate'](Uint8Array,_0x199354,_0x7aab92):_0x2f2bac?_0x24d282:_0x3e77b2;}},{'key':'processData1','value':function(_0x16bcc1){return 0x0!=_0x16bcc1[0x0]||0x0!=_0x16bcc1[0x1]||0x0!=_0x16bcc1[0x2]||0x1!=_0x16bcc1[0x3]||0x9!=_0x16bcc1[0x4]&&0x6!=_0x16bcc1[0x4]?_0x16bcc1:_0x16bcc1['slice'](0x5);}},{'key':'formatVideoDecoderConfigure','value':function(_0x54ce8e,_0x196d31,_0x5a1ba3,_0x50f43f){var _0x1ffc78='';if(0x5==_0x196d31)_0x1ffc78='hvc1.1.6.L123.00',console['log']('265\\x20hard\\x20decoder');else{if(0x100==_0x196d31){for(var _0x1ccde6=0x0;_0x1ccde6<_0x54ce8e['length'];_0x1ccde6++)if(0x67===_0x54ce8e[_0x1ccde6]||0x27===_0x54ce8e[_0x1ccde6]){var _0x3cd7eb=_0x54ce8e['subarray'](_0x1ccde6+0x1,_0x1ccde6+0x4);_0x1ffc78='avc1.';for(var _0x34c212=0x0;_0x34c212<0x3;_0x34c212++){var _0x1ce113=_0x3cd7eb[_0x34c212]['toString'](0x10);_0x1ce113['length']<0x2&&(_0x1ce113='0'+_0x1ce113),_0x1ffc78+=_0x1ce113;}break;}console['log']('264\\x20hard\\x20decoder');}else console['log']('Support\\x20Error:\\x20hard\\x20decoder\\x20only\\x20support\\x20264\\x20and\\x20265\\x20!!!');}var _0x34eea1={'codec':_0x1ffc78,'hardwareAcceleration':'prefer-hardware','optimizeForLatency':0x1};return 0x5!=_0x196d31&&this['needSetPreSoft']&&(_0x34eea1['hardwareAcceleration']='prefer-software'),_0x34eea1;}},{'key':'decodeProcess','value':function(_0x39207c,_0x2e1195){var _0x4f64b2=this;this['frameRate']!=_0x2e1195['frameRate']&&(this['frameRate']=_0x2e1195['frameRate']),this['width']!=_0x2e1195['width']&&(this['width']=_0x2e1195['width']),this['height']!=_0x2e1195['height']&&(this['height']=_0x2e1195['height']),_0x2e1195['needSetPreSoft']&&(this['needSetPreSoft']=_0x2e1195['needSetPreSoft']);var _0x1e93e7=_0x39207c;if(0x4!=this['decoderCurStatus']&&null!=this['decoderObj']){if('configured'==this['decoderObj']['state']){var _0x38e22c=new EncodedVideoChunk({'data':_0x1e93e7,'timestamp':_0x2e1195['timeStamp'],'type':_0x2e1195['isKeyFrame']?'key':'delta'});this['decoderObj']['decode'](_0x38e22c),_0x1e93e7=null,_0x39207c=null,_0x38e22c=null,_0x2e1195['frameType'];}else{if(_0x2e1195['isKeyFrame']&&'unconfigured'==this['decoderObj']['state']){var _0x158e69=this['formatVideoDecoderConfigure'](_0x39207c,_0x2e1195['codecType'],_0x2e1195['width'],_0x2e1195['height']);if(''==_0x158e69['codec'])return-0x1;VideoDecoder['isConfigSupported'](_0x158e69)['then'](function(_0x5e7fa4){if(_0x5e7fa4['supported']){_0x4f64b2['decoderObj']['configure'](_0x158e69),_0x1e93e7=_0x4f64b2['processData'](_0x39207c),_0x4f64b2['FirstFrame']=!0x1;var _0x3f5221=new EncodedVideoChunk({'data':_0x1e93e7,'timestamp':_0x2e1195['timeStamp'],'type':_0x2e1195['isKeyFrame']?'key':'delta'});_0x4f64b2['decoderObj']['decode'](_0x3f5221),_0x158e69=null,_0x1e93e7=null,_0x39207c=null;}else console['log']('%c4>HardDecoder\\x20ConfigSupported\\x20error,switch\\x20hard\\x20to\\x20soft','color:\\x20red'),_0x4f64b2['oVideoRenderHandle']['HardDecodeError']();})['catch'](function(){console['log']('VideoDecoder.js\\x20isConfigSupported\\x20error\\x20switch\\x20hard\\x20to\\x20soft\\x20'),_0x4f64b2['oVideoRenderHandle']['HardDecodeError']();});}}}}},{'key':'output','value':function(_0x206cf6){if('configured'==this['decoderObj']['state'])_0x206cf6['format'],_0x206cf6['codedWidth'],_0x206cf6['codedHeight'],_0x206cf6['displayWidth'],_0x206cf6['displayHeight'],_0x206cf6['duration'],_0x206cf6['timestamp'],(this['ready_frames']['push'](_0x206cf6),this['decoderOutSuccess']||(this['decoderOutSuccess']=!0x0),this['decoderObj']['decodeQueueSize']<=0x1&&(this['player']?this['player']['JSPlayM4_GetRawData']():postMessage({'function':'GetRawData'})));else _0x206cf6['close']();}},{'key':'output2','value':function(_0x4be35d){var _0x3a3570=this;_0x4be35d['timestamp'],createImageBitmap(_0x4be35d)['then'](function(_0x3adf18){_0x4be35d['close'](),_0x3a3570['ready_frames']['push'](_0x3adf18);});}},{'key':'reportError','value':function(_0x16c406){this['decoderOutSuccess']?this['decoderObjNeedReset']=!0x0:(this['oVideoRenderHandle']['HardDecodeError'](),console['log']('%cswitch\\x20hardVideoDecoder\\x20to\\x20softVideoDecoder','color:\\x20red'));}},{'key':'destroyDecoder','value':function(){var _0x450263=this;return new Promise(function(_0x200299,_0x1c35a9){_0x450263['clearDecoderObjBuffer']()['then'](function(){null!=_0x450263['decoderObj']&&('closed'!=_0x450263['decoderObj']['state']&&_0x450263['decoderObj']['close'](),console['log']('>>>JS\\x2001\\x20destroy\\x20decoderObj'),_0x450263['decoderObj']=null),_0x450263['decoderCurStatus']=0x4,_0x450263['decoderOutSuccess']=!0x1,_0x450263['FirstFrame']=!0x0,_0x450263['underflow']=!0x0,_0x450263['needSetPreSoft']=!0x1,_0x450263['decoderObjNeedReset']=!0x1,_0x200299();},function(){_0x1c35a9();});});}},{'key':'resetDecoder','value':function(){var _0x1c7703=this;return new Promise(function(_0x240094,_0x2effac){_0x1c7703['destroyDecoder']()['then'](function(){_0x1c7703['initDecoder'](),console['log']('%c\\x20reset\\x20hard\\x20decoder','color:red'),_0x240094();},function(){_0x2effac();});});}},{'key':'clearDecoderObjBuffer','value':function(){var _0x27b4db=this;return new Promise(function(_0xdf8f82,_0x28479a){for(var _0x5d26a1=_0x27b4db['ready_frames']['length'],_0x2e9d24=0x0;_0x2e9d24<_0x5d26a1;_0x2e9d24++){_0x27b4db['ready_frames']['shift']()['close']();}_0x27b4db['ready_frames']['splice'](0x0,_0x27b4db['ready_frames']['length']),null!=_0x27b4db['decoderObj']&&'configured'==_0x27b4db['decoderObj']['state']&&_0x27b4db['decoderObj']['reset'](),_0xdf8f82();});}},{'key':'SetStreamEnd','value':function(){return 0x0==this['decoderObj']['decodeQueueSize']&&0x0==this['ready_frames']['length']&&(this['decoderObj']['flush'](),console['log']('flush')),0x1;}},{'key':'GetFrame','value':function(){var _0x5f11c6=this;return new Promise(function(_0x2ac610,_0x3d6f62){if(null!=_0x5f11c6['curFrame']){var _0x4417cc=_0x5f11c6['ready_frames']['shift']();_0x4417cc['close'](),_0x4417cc=null,_0x5f11c6['curFrame']=null;}0x0!=_0x5f11c6['ready_frames']['length']?(_0x5f11c6['curFrame']=_0x5f11c6['ready_frames'][0x0],_0x2ac610(_0x5f11c6['curFrame'])):(_0x5f11c6['curFrame']=null,_0x2ac610(null));});}},{'key':'GetFrameBufferLength','value':function(){return this['ready_frames']['length'];}},{'key':'GetImageYUV','value':function(){var _0x58efa4=this;return new Promise(function(_0x80d209,_0x5c516d){var _0x32f011=null;if(null!=_0x58efa4['curFrame']?_0x32f011=_0x58efa4['curFrame']:0x0!=_0x58efa4['ready_frames']['length']&&(_0x32f011=_0x58efa4['ready_frames'][0x0]),null!=_0x32f011){var _0x586862=_0x32f011['displayWidth'],_0x9b681b=_0x32f011['displayHeight'],_0x3f3636=_0x586862*_0x9b681b*0x3/0x2,_0x331745=new Uint8Array(_0x3f3636),_0x37d16e=_0x32f011['format'];_0x32f011['copyTo'](_0x331745)['then'](function(){console['log']('2\\x20yuvLength:'+_0x3f3636+',displayWidth:'+_0x586862),_0x80d209({'yuvFrameBuffer':_0x331745,'yuvLength':_0x3f3636,'displayWidth':_0x586862,'displayHeight':_0x9b681b,'yuvType':_0x37d16e});});}else _0x80d209({'yuvFrameBuffer':-0x1,'yuvLength':-0x1,'displayWidth':-0x1,'displayHeight':-0x1,'yuvType':-0x1});});}}]),_0x3a5d6f;}()),_0xa87ede=0x1,_0x86aef9=0x80000001,_0x3d12cf=0x80000003,_0x520965=0x80000004,_0x31ddcf=0x80000005,_0x13126c=0x8000000a,_0x4d26c0=0x8000000d,_0x4fea1b=0x8000000e,_0xe9e464=0x1,_0x206403=0x2,_0x186ff9={'SR_DE_NULL':0x0,'SR_DE_FISH_ORIGINAL':0x1,'SR_DE_FISH_PTZ_CEILING':0x2,'SR_DE_FISH_PTZ_FLOOR':0x3,'SR_DE_FISH_PTZ_WALL':0x4,'SR_DE_FISH_PANORAMA_CEILING_360':0x5,'SR_DE_FISH_PANORAMA_CEILING_180':0x6,'SR_DE_FISH_PANORAMA_FLOOR_360':0x7,'SR_DE_FISH_PANORAMA_FLOOR_180':0x8,'SR_DE_FISH_PANORAMA_WALL':0x9,'SR_DE_FISH_SEMISPHERE':0xa,'SR_DE_EAGLEEYE_SEMISPHERE':0xb,'SR_DE_EAGLEEYE_PLANE':0xc,'SR_DE_FISH_CYLINDER_CEILING':0xd,'SR_DE_FISH_CYLINDER_FLOOR':0xe,'SR_DE_FISH_CYLINDER_SPLIT_CEILING':0xf,'SR_DE_FISH_CYLINDER_SPLIT_FLOOR':0x10,'SR_DE_FISH_PLANET':0x11,'SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL':0x12,'SR_DE_FISH_ARCSPHERE_VERTICAL_WALL':0x13,'SR_DE_FISH_ANIMATION_SWITCH_CEILING':0x14,'SR_DE_FISH_ANIMATION_SWITCH_FLOOR':0x15,'SR_DE_PANORAMA_SPHERE':0x16,'SR_DE_PANORAMA_PLANET':0x17},_0x343a24=0x0,_0x58bd8b=0x1,_0x532920=0x2,_0x264b64=0x3,_0x2818bf=0x4,_0x3b8155=0x5,_0x3840be=0x6,_0xa01ff6=0x100,_0x392c27=0x1,_0x5ca12e=0x2,_0x378a81=0x3,_0x3be196=0x4,_0x569e7f=0x0,_0x150ab7=0x1,_0x495db0=0x2,_0x394973=0x1,_0x42f4b3=0x2,_0x339c63=0x3,_0x444649=0x0,_0x4f7368=0x1,_0x11cf81=0x1,_0x57ef5a=0x2,_0x46c7b3=0x1,_0x2d33eb=0x2,_0x199c31=0x3,_0x414976=0x4,_0xe529b7=0x5,_0x1f462c='\\x0aattribute\\x20vec3\\x20xy;\\x0aattribute\\x20vec2\\x20uv;\\x0auniform\\x20int\\x20bCapture;\\x20\\x0a\\x0avarying\\x20highp\\x20vec2\\x20v_uv;\\x0a\\x0avoid\\x20main(void)\\x20{\\x0a\\x20\\x20if(bCapture\\x20==\\x201)\\x0a\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20gl_Position\\x20=\\x20vec4(xy.x,\\x20-xy.y,\\x20xy.z,\\x201.0);\\x0a\\x20\\x20}\\x0a\\x20\\x20else\\x0a\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20gl_Position\\x20=\\x20vec4(xy,\\x201.0);\\x0a\\x20\\x20}\\x0a\\x20\\x20v_uv\\x20=\\x20uv;\\x0a}\\x0a',_0x48a033='\\x0a\\x20\\x20\\x20\\x20attribute\\x20vec3\\x20position;\\x0a\\x20\\x20\\x20\\x20attribute\\x20vec4\\x20\\x20\\x20color;\\x0a\\x20\\x20\\x20\\x20varying\\x20\\x20\\x20float\\x20\\x20pp;\\x0a\\x20\\x20\\x20\\x20varying\\x20\\x20\\x20vec4\\x20\\x20colorOut;\\x0a\\x20\\x20\\x20\\x20uniform\\x20int\\x20bCapture;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(bCapture\\x20==\\x201)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position\\x20=\\x20vec4(position.x,\\x20-position.y,\\x200.0,\\x201.0);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20else\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position\\x20=\\x20vec4(position.x,\\x20position.y,\\x200.0,\\x201.0);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20pp\\x20=\\x20position.z;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20colorOut\\x20=\\x20color;\\x0a\\x20\\x20\\x20\\x20}\\x0a',_0x283927='\\x0a\\x20\\x20\\x20\\x20varying\\x20\\x20mediump\\x20float\\x20pp;\\x0a\\x20\\x20\\x20\\x20varying\\x20\\x20lowp\\x20vec4\\x20\\x20colorOut;\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20colorOut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20mediump\\x20float\\x20fx\\x20=\\x20abs(pp);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if\\x20(fx\\x20>\\x200.2)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor.a\\x20=\\x20colorOut.a*(1.25\\x20-\\x201.25*fx);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x20\\x0a\\x20\\x20\\x20\\x20}\\x20\\x0a',_0x2a3c39='\\x0a\\x20\\x20\\x20\\x20attribute\\x20vec4\\x20position;\\x20\\x0a\\x20\\x20\\x20\\x20attribute\\x20vec4\\x20texCoord;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20\\x20\\x20mat4\\x20\\x20\\x20matRotate;\\x20\\x0a\\x20\\x20\\x20\\x20varying\\x20vec4\\x20pp;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20int\\x20bCapture;\\x0a\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x20\\x0a\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position\\x20=\\x20position;\\x20//*\\x20matRotate;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(bCapture\\x20==\\x201)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position.y\\x20=\\x20\\x20-position.y;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20pp\\x20=\\x20texCoord;\\x20\\x0a\\x20\\x20\\x20\\x20}\\x20\\x0a',_0x350ff5='\\x0a\\x20\\x20\\x20\\x20precision\\x20mediump\\x20float;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x0a\\x20\\x20\\x20\\x20varying\\x20lowp\\x20vec4\\x20pp;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fAlpha;\\x0a\\x20\\x20\\x20\\x20void\\x20main(void)\\x20\\x0a\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20texture2D(texture,\\x20pp.st);\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor.a\\x20*=\\x20fAlpha;\\x20\\x0a\\x20\\x20\\x20\\x20}\\x20\\x0a',_0x379995=0x20,_0x4b88be=0x400,_0x466865=0.05,_0x4a23c6=0.000001,_0x530a52=3.1415926,_0x49aaae=0.02,_0x26dab3=0x3e8,_0x13b181=0.78539815,_0x40743d=0x28,_0x3cf544=-0x1,_0x44d661=_0x530a52/0x12,_0x5affea=_0x530a52/0x3,_0x438d57=_0x530a52/0x6,_0x2506c4=_0x530a52/0x9,_0x2fd873=0.000001,_0x1d1f9f='undefined'!=typeof Float32Array?Float32Array:Array;Math['random'],Math['PI'],Math['hypot']||(Math['hypot']=function(){for(var _0x1528a6=0x0,_0xb5940b=arguments['length'];_0xb5940b--;)_0x1528a6+=arguments[_0xb5940b]*arguments[_0xb5940b];return Math['sqrt'](_0x1528a6);});function _0x5d7ee2(){var _0x2c8471=new _0x1d1f9f(0x10);return _0x1d1f9f!=Float32Array&&(_0x2c8471[0x1]=0x0,_0x2c8471[0x2]=0x0,_0x2c8471[0x3]=0x0,_0x2c8471[0x4]=0x0,_0x2c8471[0x6]=0x0,_0x2c8471[0x7]=0x0,_0x2c8471[0x8]=0x0,_0x2c8471[0x9]=0x0,_0x2c8471[0xb]=0x0,_0x2c8471[0xc]=0x0,_0x2c8471[0xd]=0x0,_0x2c8471[0xe]=0x0),_0x2c8471[0x0]=0x1,_0x2c8471[0x5]=0x1,_0x2c8471[0xa]=0x1,_0x2c8471[0xf]=0x1,_0x2c8471;}function _0x5ec25a(_0x3bc3fc,_0x205ca0,_0x1e9eea){var _0x331936=_0x205ca0[0x0],_0x40c3da=_0x205ca0[0x1],_0x37c4cb=_0x205ca0[0x2],_0xa889b6=_0x205ca0[0x3],_0x4c0dbb=_0x205ca0[0x4],_0x52301a=_0x205ca0[0x5],_0x17f559=_0x205ca0[0x6],_0x2c8144=_0x205ca0[0x7],_0x48eb8a=_0x205ca0[0x8],_0x4d2bbd=_0x205ca0[0x9],_0x5a4141=_0x205ca0[0xa],_0x480471=_0x205ca0[0xb],_0x2d955c=_0x205ca0[0xc],_0x5b4064=_0x205ca0[0xd],_0x2f8b5f=_0x205ca0[0xe],_0x227864=_0x205ca0[0xf],_0x5af42b=_0x1e9eea[0x0],_0x2f83a3=_0x1e9eea[0x1],_0x50ee36=_0x1e9eea[0x2],_0xf7a7ad=_0x1e9eea[0x3];return _0x3bc3fc[0x0]=_0x5af42b*_0x331936+_0x2f83a3*_0x4c0dbb+_0x50ee36*_0x48eb8a+_0xf7a7ad*_0x2d955c,_0x3bc3fc[0x1]=_0x5af42b*_0x40c3da+_0x2f83a3*_0x52301a+_0x50ee36*_0x4d2bbd+_0xf7a7ad*_0x5b4064,_0x3bc3fc[0x2]=_0x5af42b*_0x37c4cb+_0x2f83a3*_0x17f559+_0x50ee36*_0x5a4141+_0xf7a7ad*_0x2f8b5f,_0x3bc3fc[0x3]=_0x5af42b*_0xa889b6+_0x2f83a3*_0x2c8144+_0x50ee36*_0x480471+_0xf7a7ad*_0x227864,_0x5af42b=_0x1e9eea[0x4],_0x2f83a3=_0x1e9eea[0x5],_0x50ee36=_0x1e9eea[0x6],_0xf7a7ad=_0x1e9eea[0x7],_0x3bc3fc[0x4]=_0x5af42b*_0x331936+_0x2f83a3*_0x4c0dbb+_0x50ee36*_0x48eb8a+_0xf7a7ad*_0x2d955c,_0x3bc3fc[0x5]=_0x5af42b*_0x40c3da+_0x2f83a3*_0x52301a+_0x50ee36*_0x4d2bbd+_0xf7a7ad*_0x5b4064,_0x3bc3fc[0x6]=_0x5af42b*_0x37c4cb+_0x2f83a3*_0x17f559+_0x50ee36*_0x5a4141+_0xf7a7ad*_0x2f8b5f,_0x3bc3fc[0x7]=_0x5af42b*_0xa889b6+_0x2f83a3*_0x2c8144+_0x50ee36*_0x480471+_0xf7a7ad*_0x227864,_0x5af42b=_0x1e9eea[0x8],_0x2f83a3=_0x1e9eea[0x9],_0x50ee36=_0x1e9eea[0xa],_0xf7a7ad=_0x1e9eea[0xb],_0x3bc3fc[0x8]=_0x5af42b*_0x331936+_0x2f83a3*_0x4c0dbb+_0x50ee36*_0x48eb8a+_0xf7a7ad*_0x2d955c,_0x3bc3fc[0x9]=_0x5af42b*_0x40c3da+_0x2f83a3*_0x52301a+_0x50ee36*_0x4d2bbd+_0xf7a7ad*_0x5b4064,_0x3bc3fc[0xa]=_0x5af42b*_0x37c4cb+_0x2f83a3*_0x17f559+_0x50ee36*_0x5a4141+_0xf7a7ad*_0x2f8b5f,_0x3bc3fc[0xb]=_0x5af42b*_0xa889b6+_0x2f83a3*_0x2c8144+_0x50ee36*_0x480471+_0xf7a7ad*_0x227864,_0x5af42b=_0x1e9eea[0xc],_0x2f83a3=_0x1e9eea[0xd],_0x50ee36=_0x1e9eea[0xe],_0xf7a7ad=_0x1e9eea[0xf],_0x3bc3fc[0xc]=_0x5af42b*_0x331936+_0x2f83a3*_0x4c0dbb+_0x50ee36*_0x48eb8a+_0xf7a7ad*_0x2d955c,_0x3bc3fc[0xd]=_0x5af42b*_0x40c3da+_0x2f83a3*_0x52301a+_0x50ee36*_0x4d2bbd+_0xf7a7ad*_0x5b4064,_0x3bc3fc[0xe]=_0x5af42b*_0x37c4cb+_0x2f83a3*_0x17f559+_0x50ee36*_0x5a4141+_0xf7a7ad*_0x2f8b5f,_0x3bc3fc[0xf]=_0x5af42b*_0xa889b6+_0x2f83a3*_0x2c8144+_0x50ee36*_0x480471+_0xf7a7ad*_0x227864,_0x3bc3fc;}function _0x3405d1(_0xe0081f,_0x1b674b,_0x4ce0fb,_0x151c92){var _0xa104c9,_0x46ae43,_0x26d557,_0x237e66,_0x40ab05,_0x5fd26e,_0x5ae90f,_0x4f396b,_0x5b9f89,_0x1d5853,_0x5beaee,_0xc07032,_0x391691,_0xb7a629,_0x5861cc,_0x3b1ef3,_0x7394b2,_0x2b731b,_0x41f62d,_0x3cc106,_0x3890ac,_0x29cdd9,_0x496a78,_0x197fb4,_0x12c2f9=_0x151c92[0x0],_0x16ab04=_0x151c92[0x1],_0x1fb873=_0x151c92[0x2],_0x4b6fb0=Math['hypot'](_0x12c2f9,_0x16ab04,_0x1fb873);return _0x4b6fb0<_0x2fd873?null:(_0x12c2f9*=_0x4b6fb0=0x1/_0x4b6fb0,_0x16ab04*=_0x4b6fb0,_0x1fb873*=_0x4b6fb0,_0xa104c9=Math['sin'](_0x4ce0fb),_0x26d557=0x1-(_0x46ae43=Math['cos'](_0x4ce0fb)),_0x237e66=_0x1b674b[0x0],_0x40ab05=_0x1b674b[0x1],_0x5fd26e=_0x1b674b[0x2],_0x5ae90f=_0x1b674b[0x3],_0x4f396b=_0x1b674b[0x4],_0x5b9f89=_0x1b674b[0x5],_0x1d5853=_0x1b674b[0x6],_0x5beaee=_0x1b674b[0x7],_0xc07032=_0x1b674b[0x8],_0x391691=_0x1b674b[0x9],_0xb7a629=_0x1b674b[0xa],_0x5861cc=_0x1b674b[0xb],_0x3b1ef3=_0x12c2f9*_0x12c2f9*_0x26d557+_0x46ae43,_0x7394b2=_0x16ab04*_0x12c2f9*_0x26d557+_0x1fb873*_0xa104c9,_0x2b731b=_0x1fb873*_0x12c2f9*_0x26d557-_0x16ab04*_0xa104c9,_0x41f62d=_0x12c2f9*_0x16ab04*_0x26d557-_0x1fb873*_0xa104c9,_0x3cc106=_0x16ab04*_0x16ab04*_0x26d557+_0x46ae43,_0x3890ac=_0x1fb873*_0x16ab04*_0x26d557+_0x12c2f9*_0xa104c9,_0x29cdd9=_0x12c2f9*_0x1fb873*_0x26d557+_0x16ab04*_0xa104c9,_0x496a78=_0x16ab04*_0x1fb873*_0x26d557-_0x12c2f9*_0xa104c9,_0x197fb4=_0x1fb873*_0x1fb873*_0x26d557+_0x46ae43,_0xe0081f[0x0]=_0x237e66*_0x3b1ef3+_0x4f396b*_0x7394b2+_0xc07032*_0x2b731b,_0xe0081f[0x1]=_0x40ab05*_0x3b1ef3+_0x5b9f89*_0x7394b2+_0x391691*_0x2b731b,_0xe0081f[0x2]=_0x5fd26e*_0x3b1ef3+_0x1d5853*_0x7394b2+_0xb7a629*_0x2b731b,_0xe0081f[0x3]=_0x5ae90f*_0x3b1ef3+_0x5beaee*_0x7394b2+_0x5861cc*_0x2b731b,_0xe0081f[0x4]=_0x237e66*_0x41f62d+_0x4f396b*_0x3cc106+_0xc07032*_0x3890ac,_0xe0081f[0x5]=_0x40ab05*_0x41f62d+_0x5b9f89*_0x3cc106+_0x391691*_0x3890ac,_0xe0081f[0x6]=_0x5fd26e*_0x41f62d+_0x1d5853*_0x3cc106+_0xb7a629*_0x3890ac,_0xe0081f[0x7]=_0x5ae90f*_0x41f62d+_0x5beaee*_0x3cc106+_0x5861cc*_0x3890ac,_0xe0081f[0x8]=_0x237e66*_0x29cdd9+_0x4f396b*_0x496a78+_0xc07032*_0x197fb4,_0xe0081f[0x9]=_0x40ab05*_0x29cdd9+_0x5b9f89*_0x496a78+_0x391691*_0x197fb4,_0xe0081f[0xa]=_0x5fd26e*_0x29cdd9+_0x1d5853*_0x496a78+_0xb7a629*_0x197fb4,_0xe0081f[0xb]=_0x5ae90f*_0x29cdd9+_0x5beaee*_0x496a78+_0x5861cc*_0x197fb4,_0x1b674b!==_0xe0081f&&(_0xe0081f[0xc]=_0x1b674b[0xc],_0xe0081f[0xd]=_0x1b674b[0xd],_0xe0081f[0xe]=_0x1b674b[0xe],_0xe0081f[0xf]=_0x1b674b[0xf]),_0xe0081f);}var _0x4ceff8=function(_0x302553,_0xab7b4e,_0x299e09,_0x38ab7f,_0x237322){var _0x3eec8b=0x1/Math['tan'](_0xab7b4e/0x2);if(_0x302553[0x0]=_0x3eec8b/_0x299e09,_0x302553[0x1]=0x0,_0x302553[0x2]=0x0,_0x302553[0x3]=0x0,_0x302553[0x4]=0x0,_0x302553[0x5]=_0x3eec8b,_0x302553[0x6]=0x0,_0x302553[0x7]=0x0,_0x302553[0x8]=0x0,_0x302553[0x9]=0x0,_0x302553[0xb]=-0x1,_0x302553[0xc]=0x0,_0x302553[0xd]=0x0,_0x302553[0xf]=0x0,null!=_0x237322&&_0x237322!==0x1/0x0){var _0x2642b3=0x1/(_0x38ab7f-_0x237322);_0x302553[0xa]=(_0x237322+_0x38ab7f)*_0x2642b3,_0x302553[0xe]=0x2*_0x237322*_0x38ab7f*_0x2642b3;}else _0x302553[0xa]=-0x1,_0x302553[0xe]=-0x2*_0x38ab7f;return _0x302553;},_0x504680=function(_0x23342e,_0x5bb1cc,_0x473ea1,_0x29c6e7,_0x5528a9,_0x3833eb,_0x35e8e6){var _0x445103=0x1/(_0x5bb1cc-_0x473ea1),_0x1b3a48=0x1/(_0x29c6e7-_0x5528a9),_0x19b6f6=0x1/(_0x3833eb-_0x35e8e6);return _0x23342e[0x0]=-0x2*_0x445103,_0x23342e[0x1]=0x0,_0x23342e[0x2]=0x0,_0x23342e[0x3]=0x0,_0x23342e[0x4]=0x0,_0x23342e[0x5]=-0x2*_0x1b3a48,_0x23342e[0x6]=0x0,_0x23342e[0x7]=0x0,_0x23342e[0x8]=0x0,_0x23342e[0x9]=0x0,_0x23342e[0xa]=0x2*_0x19b6f6,_0x23342e[0xb]=0x0,_0x23342e[0xc]=(_0x5bb1cc+_0x473ea1)*_0x445103,_0x23342e[0xd]=(_0x5528a9+_0x29c6e7)*_0x1b3a48,_0x23342e[0xe]=(_0x35e8e6+_0x3833eb)*_0x19b6f6,_0x23342e[0xf]=0x1,_0x23342e;};function _0x4d7c69(){var _0x295eb7=new _0x1d1f9f(0x3);return _0x1d1f9f!=Float32Array&&(_0x295eb7[0x0]=0x0,_0x295eb7[0x1]=0x0,_0x295eb7[0x2]=0x0),_0x295eb7;}function _0x21a3b9(_0x558408,_0x34df78,_0x527718){var _0x15b0f4=new _0x1d1f9f(0x3);return _0x15b0f4[0x0]=_0x558408,_0x15b0f4[0x1]=_0x34df78,_0x15b0f4[0x2]=_0x527718,_0x15b0f4;}function _0x1a3314(_0x378744,_0xbd9ba4){return _0x378744[0x0]*_0xbd9ba4[0x0]+_0x378744[0x1]*_0xbd9ba4[0x1]+_0x378744[0x2]*_0xbd9ba4[0x2];}function _0x3d4060(_0x17fee6,_0x4a9566,_0x713dfe){var _0x3fee8d=_0x4a9566[0x0],_0x8cebec=_0x4a9566[0x1],_0x28e065=_0x4a9566[0x2],_0x38339=_0x713dfe[0x0],_0x22f745=_0x713dfe[0x1],_0x5a41a6=_0x713dfe[0x2];return _0x17fee6[0x0]=_0x8cebec*_0x5a41a6-_0x28e065*_0x22f745,_0x17fee6[0x1]=_0x28e065*_0x38339-_0x3fee8d*_0x5a41a6,_0x17fee6[0x2]=_0x3fee8d*_0x22f745-_0x8cebec*_0x38339,_0x17fee6;}var _0x3e3a1f,_0x395623=function(_0x388fd0){var _0x5b9529=_0x388fd0[0x0],_0xd338a0=_0x388fd0[0x1],_0x2aad30=_0x388fd0[0x2];return Math['hypot'](_0x5b9529,_0xd338a0,_0x2aad30);};_0x3e3a1f=_0x4d7c69(),!(function(){var _0x582aae,_0x79f026=(_0x582aae=new _0x1d1f9f(0x4),_0x1d1f9f!=Float32Array&&(_0x582aae[0x0]=0x0,_0x582aae[0x1]=0x0,_0x582aae[0x2]=0x0,_0x582aae[0x3]=0x0),_0x582aae);}());function _0x5b294c(){var _0x2c9a14=new _0x1d1f9f(0x4);return _0x1d1f9f!=Float32Array&&(_0x2c9a14[0x0]=0x0,_0x2c9a14[0x1]=0x0,_0x2c9a14[0x2]=0x0),_0x2c9a14[0x3]=0x1,_0x2c9a14;}function _0x600e23(_0x1ab4b1,_0x205eec,_0x3e3ad5,_0x5d3c36){var _0x13db1a,_0x48838a,_0x37104f,_0x20dc1e,_0x32d1b7,_0x11e631=_0x205eec[0x0],_0x41b90d=_0x205eec[0x1],_0x1ba7cf=_0x205eec[0x2],_0x4f337e=_0x205eec[0x3],_0x55bad6=_0x3e3ad5[0x0],_0x5b458b=_0x3e3ad5[0x1],_0x28612f=_0x3e3ad5[0x2],_0x1a2451=_0x3e3ad5[0x3];return(_0x48838a=_0x11e631*_0x55bad6+_0x41b90d*_0x5b458b+_0x1ba7cf*_0x28612f+_0x4f337e*_0x1a2451)<0x0&&(_0x48838a=-_0x48838a,_0x55bad6=-_0x55bad6,_0x5b458b=-_0x5b458b,_0x28612f=-_0x28612f,_0x1a2451=-_0x1a2451),0x1-_0x48838a>_0x2fd873?(_0x13db1a=Math['acos'](_0x48838a),_0x37104f=Math['sin'](_0x13db1a),_0x20dc1e=Math['sin']((0x1-_0x5d3c36)*_0x13db1a)/_0x37104f,_0x32d1b7=Math['sin'](_0x5d3c36*_0x13db1a)/_0x37104f):(_0x20dc1e=0x1-_0x5d3c36,_0x32d1b7=_0x5d3c36),_0x1ab4b1[0x0]=_0x20dc1e*_0x11e631+_0x32d1b7*_0x55bad6,_0x1ab4b1[0x1]=_0x20dc1e*_0x41b90d+_0x32d1b7*_0x5b458b,_0x1ab4b1[0x2]=_0x20dc1e*_0x1ba7cf+_0x32d1b7*_0x28612f,_0x1ab4b1[0x3]=_0x20dc1e*_0x4f337e+_0x32d1b7*_0x1a2451,_0x1ab4b1;}var _0xb87275=function(_0x3b20b1,_0x83271c){var _0x26a808=_0x83271c[0x0],_0x4ed1e4=_0x83271c[0x1],_0x3e9207=_0x83271c[0x2],_0x423be1=_0x83271c[0x3],_0x48404d=_0x26a808*_0x26a808+_0x4ed1e4*_0x4ed1e4+_0x3e9207*_0x3e9207+_0x423be1*_0x423be1;return _0x48404d>0x0&&(_0x48404d=0x1/Math['sqrt'](_0x48404d)),_0x3b20b1[0x0]=_0x26a808*_0x48404d,_0x3b20b1[0x1]=_0x4ed1e4*_0x48404d,_0x3b20b1[0x2]=_0x3e9207*_0x48404d,_0x3b20b1[0x3]=_0x423be1*_0x48404d,_0x3b20b1;},_0x45cf39,_0x4265e3,_0x42ab8a,_0x37c073,_0x27f373,_0x464119,_0x1db24d;_0x45cf39=_0x4d7c69(),_0x4265e3=_0x21a3b9(0x1,0x0,0x0),_0x42ab8a=_0x21a3b9(0x0,0x1,0x0),_0x37c073=_0x5b294c(),_0x27f373=_0x5b294c(),_0x464119=new _0x1d1f9f(0x9),_0x1d1f9f!=Float32Array&&(_0x464119[0x1]=0x0,_0x464119[0x2]=0x0,_0x464119[0x3]=0x0,_0x464119[0x5]=0x0,_0x464119[0x6]=0x0,_0x464119[0x7]=0x0),_0x464119[0x0]=0x1,_0x464119[0x4]=0x1,_0x464119[0x8]=0x1,_0x1db24d=_0x464119,!(function(){var _0x5e96d8=(function(){var _0x1f208b=new _0x1d1f9f(0x2);return _0x1d1f9f!=Float32Array&&(_0x1f208b[0x0]=0x0,_0x1f208b[0x1]=0x0),_0x1f208b;}());}());var _0x2e6310,_0x3b657c=(function(){function _0x5ee987(){_0x54580d(this,_0x5ee987),this['fFov']=0.785,this['fAspect']=0x1,this['fNear']=0.02,this['fFar']=0x3e8,this['fTheta']=0x0,this['fAlpha']=0x0,this['fBeta']=0x0,this['fScale']=0x1,this['bOrtho']=!0x1,this['matView']=_0x5d7ee2(),this['matProj']=_0x5d7ee2(),this['vecEye']=_0x21a3b9(0x0,0x0,0x0),this['vecCenter']=_0x21a3b9(0x0,0x0,0x64),this['vecUp']=_0x21a3b9(0x0,0x1,0x0);}return _0x4fd085(_0x5ee987,[{'key':'SetYaw','value':function(_0x1b1db8){this['fTheta']=_0x1b1db8;}},{'key':'GetYaw','value':function(){return this['fTheta'];}},{'key':'SetPitch','value':function(_0x23bed8){this['fAlpha']=_0x23bed8;}},{'key':'GetPitch','value':function(){return this['fAlpha'];}},{'key':'SetRoll','value':function(_0x483c88){this['fBeta']=_0x483c88;}},{'key':'GetRoll','value':function(){return this['fBeta'];}},{'key':'SetScale','value':function(_0x49b3da){this['fScale']=_0x49b3da;}},{'key':'GetScale','value':function(){return this['fScale'];}},{'key':'SetFov','value':function(_0x51f792){this['fFov']=_0x51f792;}},{'key':'SetAspect','value':function(_0x5abf13){this['fAspect']=_0x5abf13;}},{'key':'SetNear','value':function(_0x54349a){this['fNear']=_0x54349a;}},{'key':'SetFar','value':function(_0x1e3429){this['fFar']=_0x1e3429;}},{'key':'SetOrtho','value':function(_0x5f483d){this['bOrtho']=_0x5f483d;}},{'key':'UpdateCamera','value':function(_0x1bda20,_0x2990c0){if(!(_0x1bda20<=0x0||_0x2990c0<=0x0)){if(0x1==this['bOrtho'])_0x504680(this['matProj'],0x0,_0x1bda20,_0x2990c0,0x0,this['fNear'],this['fFar']);else{var _0x2fa5f4=this['fFov']/_0x530a52*0xb4;_0x4ceff8(this['matProj'],_0x2fa5f4,_0x1bda20/_0x2990c0,this['fNear'],this['fFar']);}this['vecEye']=_0x21a3b9(0x0,0x0,this['fScale']),this['vecCenter']=_0x21a3b9(0x0,0x0,0x0),this['vecUp']=_0x21a3b9(0x0,0x1,0x0);var _0x5b2a20=_0x21a3b9(0x1,0x0,0x0),_0x2cf9bf=_0x21a3b9(0x0,0x1,0x0),_0x4e957e=_0x21a3b9(0x0,0x0,0x1),_0x48156e=_0x5d7ee2();!function(_0x25ec01,_0x40b862,_0x56ef8c,_0x12ba71){var _0x50ab75,_0x19e466,_0x34f9a4,_0x215482,_0x31dc54,_0x21c876,_0x5e5bc4,_0x5c7e59,_0x573ea3,_0x47e710,_0x5bc565=_0x40b862[0x0],_0x398682=_0x40b862[0x1],_0x2390fd=_0x40b862[0x2],_0x2dc34a=_0x12ba71[0x0],_0x3d1e14=_0x12ba71[0x1],_0x21f20c=_0x12ba71[0x2],_0x9b62d=_0x56ef8c[0x0],_0x420fd0=_0x56ef8c[0x1],_0x3cc1aa=_0x56ef8c[0x2];Math['abs'](_0x5bc565-_0x9b62d)<_0x2fd873&&Math['abs'](_0x398682-_0x420fd0)<_0x2fd873&&Math['abs'](_0x2390fd-_0x3cc1aa)<_0x2fd873?function(_0x26b1cc){_0x26b1cc[0x0]=0x1,_0x26b1cc[0x1]=0x0,_0x26b1cc[0x2]=0x0,_0x26b1cc[0x3]=0x0,_0x26b1cc[0x4]=0x0,_0x26b1cc[0x5]=0x1,_0x26b1cc[0x6]=0x0,_0x26b1cc[0x7]=0x0,_0x26b1cc[0x8]=0x0,_0x26b1cc[0x9]=0x0,_0x26b1cc[0xa]=0x1,_0x26b1cc[0xb]=0x0,_0x26b1cc[0xc]=0x0,_0x26b1cc[0xd]=0x0,_0x26b1cc[0xe]=0x0,_0x26b1cc[0xf]=0x1;}(_0x25ec01):(_0x5e5bc4=_0x5bc565-_0x9b62d,_0x5c7e59=_0x398682-_0x420fd0,_0x573ea3=_0x2390fd-_0x3cc1aa,_0x50ab75=_0x3d1e14*(_0x573ea3*=_0x47e710=0x1/Math['hypot'](_0x5e5bc4,_0x5c7e59,_0x573ea3))-_0x21f20c*(_0x5c7e59*=_0x47e710),_0x19e466=_0x21f20c*(_0x5e5bc4*=_0x47e710)-_0x2dc34a*_0x573ea3,_0x34f9a4=_0x2dc34a*_0x5c7e59-_0x3d1e14*_0x5e5bc4,(_0x47e710=Math['hypot'](_0x50ab75,_0x19e466,_0x34f9a4))?(_0x50ab75*=_0x47e710=0x1/_0x47e710,_0x19e466*=_0x47e710,_0x34f9a4*=_0x47e710):(_0x50ab75=0x0,_0x19e466=0x0,_0x34f9a4=0x0),_0x215482=_0x5c7e59*_0x34f9a4-_0x573ea3*_0x19e466,_0x31dc54=_0x573ea3*_0x50ab75-_0x5e5bc4*_0x34f9a4,_0x21c876=_0x5e5bc4*_0x19e466-_0x5c7e59*_0x50ab75,(_0x47e710=Math['hypot'](_0x215482,_0x31dc54,_0x21c876))?(_0x215482*=_0x47e710=0x1/_0x47e710,_0x31dc54*=_0x47e710,_0x21c876*=_0x47e710):(_0x215482=0x0,_0x31dc54=0x0,_0x21c876=0x0),_0x25ec01[0x0]=_0x50ab75,_0x25ec01[0x1]=_0x215482,_0x25ec01[0x2]=_0x5e5bc4,_0x25ec01[0x3]=0x0,_0x25ec01[0x4]=_0x19e466,_0x25ec01[0x5]=_0x31dc54,_0x25ec01[0x6]=_0x5c7e59,_0x25ec01[0x7]=0x0,_0x25ec01[0x8]=_0x34f9a4,_0x25ec01[0x9]=_0x21c876,_0x25ec01[0xa]=_0x573ea3,_0x25ec01[0xb]=0x0,_0x25ec01[0xc]=-(_0x50ab75*_0x5bc565+_0x19e466*_0x398682+_0x34f9a4*_0x2390fd),_0x25ec01[0xd]=-(_0x215482*_0x5bc565+_0x31dc54*_0x398682+_0x21c876*_0x2390fd),_0x25ec01[0xe]=-(_0x5e5bc4*_0x5bc565+_0x5c7e59*_0x398682+_0x573ea3*_0x2390fd),_0x25ec01[0xf]=0x1);}(_0x48156e,this['vecEye'],this['vecCenter'],this['vecUp']);var _0x14046d=_0x5d7ee2(),_0x18395f=_0x5d7ee2(),_0x549d74=_0x5d7ee2(),_0x15744a=_0x5d7ee2();_0x3405d1(_0x18395f,_0x14046d,-this['fAlpha'],_0x5b2a20),_0x3405d1(_0x549d74,_0x18395f,-this['fTheta'],_0x2cf9bf),_0x3405d1(_0x15744a,_0x549d74,-this['fBeta'],_0x4e957e),_0x5ec25a(this['matView'],_0x48156e,_0x15744a);}}},{'key':'GetView','value':function(){return this['matView'];}},{'key':'GetProj','value':function(){return this['matProj'];}}]),_0x5ee987;}()),_0x453e55=(function(){function _0x2425ba(){_0x54580d(this,_0x2425ba),this['canvas']=null,this['ctx']=null,this['videoShaderProgram']=0x0,this['vertexPosBuffer']=0x0,this['texturePosBuffer']=0x0,this['pFrameData']=null,this['frameDisplayWidth']=0x0,this['frameDisplayHeight']=0x0,this['onlySupportedWebGL1']=!0x1,this['bAntialias']=!0x1,this['bRecreateTex']=!0x0,this['nSurfaceTexture']=[],this['nMaxPointNum']=0x0,this['pLinePosVertices']=null,this['pLineClrVertices']=null,this['glLinePosBuffer']=0x0,this['glLineClrBuffer']=0x0,this['nLineTriangleNum']=0x0,this['nLineShaderProgram']=0x0,this['pFillBlockPosVertices']=null,this['pFillBlockClrVertices']=null,this['nMaxFillBlockTriNum']=0x0,this['glBlockPosBuffer']=0x0,this['glBlockClrBuffer']=0x0,this['nBlockShaderProgram']=0x0,this['nDrawFontWidth']=0x0,this['nDrawFontHeight']=0x0,this['nFontColorTexture']=0x0,this['pFontColorBuffer']=0x0,this['nFontShaderProgram']=0x0,this['nFontBGNum']=0x0,this['pstFontBGLines']=[],this['nImageShaderProgram']=0x0,this['pImagePosVertices']=null,this['pImageClrVertices']=null,this['glImagePosBuffer']=0x0,this['glImageClrBuffer']=0x0,this['nImageColorTexture']=null,this['nDrawImageWidth']=0x0,this['nDrawImageHeight']=0x0,this['nImageColorTextures']=[],this['pFishParamManager']=null,this['enDisplayEffect']=_0x186ff9['SR_DE_NULL'],this['nFECPort']=_0x3cf544,this['bIsCapturing']=!0x1,this['pSemiSpherePos']=null,this['pSemiSphereTex']=null,this['nSemiSpherePosNum']=0x0,this['nSemiSpherePosSize']=0x0,this['nSemiSphereTexSize']=0x0,this['pCylinderPos']=null,this['pCylinderTex']=null,this['nCylinderPosNum']=0x0,this['nCylinderPosSize']=0x0,this['nCylinderTexSize']=0x0,this['fCylinderHeight']=0x0,this['fCylinderRadius']=0x0,this['pArcSpherePos']=null,this['pArcSphereTex']=null,this['nArcSpherePosNum']=0x0,this['nArcSpherePosSize']=0x0,this['nArcSphereTexSize']=0x0,this['fImageWidth']=0x1,this['fImageHeight']=0x1,this['fTexCenterX']=0.5,this['fTexCenterY']=0.5,this['fTexRadius']=0.5,this['b3DPort']=!0x1,this['pCamera']=null,this['fRotateX']=0x0,this['fRotateY']=0x0,this['fScale']=0x0,this['fRotateLimitX']=0x0,this['fRotateLimitY']=0x0,this['pfuncCBIn']=null,this['pfuncCBOut']=null,this['pUserIn']=null,this['pUserOut']=null,this['bCullBack']=!0x1,this['fSrcUseLeft']=0x0,this['fSrcUseRight']=0x1,this['fSrcUseTop']=0x0,this['fSrcUseBottom']=0x1,this['fDstUseLeft']=0x0,this['fDstUseRight']=0x1,this['fDstUseTop']=0x0,this['fDstUseBottom']=0x1,this['enPixelFormat']=_0x343a24,this['nTextureNum']=0x0,this['textCanvas']=null,this['textCanvasCtx']=null,this['nCaptureWidth']=0x0,this['nCaptureHeight']=0x0,this['nCaptureRTTex']=0x0,this['nCaptureFBO']=0x0,this['nCaptureFBOWidth']=0x0,this['nCaptureFBOHeight']=0x0,this['nCaptureDepthbuffer']=0x0,this['bCaptureResInit']=!0x1,this['fBrightness']=0x0,this['fHue']=0x0,this['fSaturation']=0x0,this['fContrast']=0x0,this['fSharpness']=0x0,this['nPostProc']=0x0;}return _0x4fd085(_0x2425ba,[{'key':'CompileProgram','value':function(_0x298713,_0xb12ba2){var _0x593a9b=this['ctx'];if(null==_0x593a9b||null==_0x298713||null==_0xb12ba2)return-0x1;var _0x240e10=_0x593a9b['createShader'](_0x593a9b['VERTEX_SHADER']);if(_0x593a9b['shaderSource'](_0x240e10,_0x298713),_0x593a9b['compileShader'](_0x240e10),!_0x593a9b['getShaderParameter'](_0x240e10,_0x593a9b['COMPILE_STATUS']))return console['log']('Vertex\\x20shader\\x20failed\\x20to\\x20compile:\\x20'+_0x593a9b['getShaderInfoLog'](_0x240e10)),-0x1;var _0x4a47df=_0x593a9b['createShader'](_0x593a9b['FRAGMENT_SHADER']);if(_0x593a9b['shaderSource'](_0x4a47df,_0xb12ba2),_0x593a9b['compileShader'](_0x4a47df),!_0x593a9b['getShaderParameter'](_0x4a47df,_0x593a9b['COMPILE_STATUS']))return console['log']('Fragment\\x20shader\\x20failed\\x20to\\x20compile:\\x20'+_0x593a9b['getShaderInfoLog'](_0x4a47df)),-0x1;var _0x213125=_0x593a9b['createProgram']();return _0x593a9b['attachShader'](_0x213125,_0x240e10),_0x593a9b['attachShader'](_0x213125,_0x4a47df),_0x593a9b['linkProgram'](_0x213125),_0x593a9b['getProgramParameter'](_0x213125,_0x593a9b['LINK_STATUS'])?(_0x593a9b['deleteShader'](_0x240e10),_0x593a9b['deleteShader'](_0x4a47df),_0x213125):(console['log']('Program\\x20failed\\x20to\\x20compile:\\x20'+_0x593a9b['getProgramInfoLog'](_0x213125)),-0x1);}},{'key':'SR_Init','value':function(_0x446426,_0x117296){if(null==_0x446426)return _0x31ddcf;if(this['canvas']=_0x446426,this['ctx']=this['canvas']['getContext']('webgl2'),this['ctx']||(this['ctx']=this['canvas']['getContext']('webgl')||this['canvas']['getContext']('experimental-webgl'),this['onlySupportedWebGL1']=!0x0,console['log']('only\\x20support\\x20webgl1')),!this['ctx'])return console['log']('your\\x20browser\\x20does\\x20not\\x20support\\x20WebGL'),_0x4fea1b;if(_0x117296==_0x532920||_0x117296==_0x3840be)return _0x86aef9;switch(_0x117296){case _0x58bd8b:case _0x264b64:this['nTextureNum']=0x3;break;case _0x532920:case _0x3840be:this['nTextureNum']=0x2;break;case _0xa01ff6:this['nTextureNum']=0x1;break;default:return _0x86aef9;}return this['enPixelFormat']=_0x117296,_0xa87ede;}},{'key':'SR_Draw','value':function(_0x1eea6a,_0x54c230,_0x533ad6,_0x39828b,_0x130cba){if(null==this['ctx'])return _0x520965;var _0x196b60=this['nTextureNum'];if(null==_0x1eea6a||_0x54c230<=0x0||_0x533ad6<=0x0)return _0x31ddcf;if(0x0==this['videoShaderProgram']||0x0==this['vertexPosBuffer']||0x0==this['texturePosBuffer'])return _0x520965;var _0x570392=_0xa87ede;if(_0xa01ff6==this['enPixelFormat'])this['frameDisplayWidth']=_0x54c230,this['frameDisplayHeight']=_0x533ad6;else{if(_0x570392=this['_ResizeFrameData'](_0x1eea6a,_0x54c230,_0x533ad6,_0x39828b),_0xa87ede!=_0x570392)return _0x570392;}if(this['ctx']['useProgram'](this['videoShaderProgram']),0x1==this['bRecreateTex']){if(this['enPixelFormat']==_0xa01ff6){if(0x0!=this['nSurfaceTexture'][0x0]){var _0x307c8c=this['nSurfaceTexture'][0x0];this['ctx']['deleteTexture'](_0x307c8c),this['nSurfaceTexture'][0x0]=0x0;}var _0xfa0c54=this['ctx']['createTexture']();if(_0xfa0c54<=0x0)return _0x4d26c0;this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],_0xfa0c54),0x1==this['bAntialias']?this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR_MIPMAP_NEAREST']):this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']),this['nSurfaceTexture'][0x0]=_0xfa0c54;}else{if(this['enPixelFormat']==_0x58bd8b||this['enPixelFormat']==_0x264b64)for(var _0x3d8d4b=0x0;_0x3d8d4b<_0x196b60;_0x3d8d4b++){if(0x0!=this['nSurfaceTexture'][_0x3d8d4b]){var _0xe89fbf=this['nSurfaceTexture'][_0x3d8d4b];this['ctx']['deleteTexture'](_0xe89fbf),this['nSurfaceTexture'][_0x3d8d4b]=0x0;}var _0x44ac7b=this['ctx']['createTexture']();if(_0x44ac7b<=0x0)return _0x4d26c0;if(this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],_0x44ac7b),0x1==this['bAntialias']?this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR_MIPMAP_NEAREST']):this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']),0x0==_0x3d8d4b){var _0xef5d37=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'Ytexture');this['ctx']['uniform1i'](_0xef5d37,0x0);}else{if(0x1==_0x3d8d4b){var _0x5d982f=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'Utexture');this['ctx']['uniform1i'](_0x5d982f,0x1);}else{if(0x2==_0x3d8d4b){var _0x3ed5dc=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'Vtexture');this['ctx']['uniform1i'](_0x3ed5dc,0x2);}}}this['nSurfaceTexture'][_0x3d8d4b]=_0x44ac7b,this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],null);}}this['bRecreateTex']=!0x1;}this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['vertexPosBuffer']);var _0x1b8d0c=this['ctx']['getAttribLocation'](this['videoShaderProgram'],'xy');if(_0x1b8d0c<0x0)return _0x4d26c0;this['ctx']['vertexAttribPointer'](_0x1b8d0c,0x3,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['enableVertexAttribArray'](_0x1b8d0c),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['texturePosBuffer']);var _0x16bf1a=this['ctx']['getAttribLocation'](this['videoShaderProgram'],'uv');if(_0x16bf1a<0x0)return _0x4d26c0;this['ctx']['vertexAttribPointer'](_0x16bf1a,0x2,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['enableVertexAttribArray'](_0x16bf1a),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null);var _0x2a1b79=this['enDisplayEffect'],_0x5377d3=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'bCapture');if(_0x5377d3<=0x0)return _0x4d26c0;this['ctx']['uniform1i'](_0x5377d3,0x0);var _0x24e3f9=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'nPostProc');switch(this['ctx']['uniform1i'](_0x24e3f9,this['nPostProc']),0x1==this['nPostProc']&&(_0x570392=this['_SetImagePostProcess']()),_0x2a1b79){case _0x186ff9['SR_DE_NULL']:break;case _0x186ff9['SR_DE_FISH_ORIGINAL']:case _0x186ff9['SR_DE_FISH_PTZ_CEILING']:case _0x186ff9['SR_DE_FISH_PTZ_FLOOR']:case _0x186ff9['SR_DE_FISH_PTZ_WALL']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']:case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']:case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:if(null==this['pFishParamManager'])return _0x520965;var _0x2bdc46={};if(_0x570392=this['pFishParamManager']['GetRenderParam'](this['nFECPort'],_0x2bdc46),_0xa87ede!=_0x570392)return _0x570392;if(_0x186ff9['SR_DE_FISH_ORIGINAL']==_0x2a1b79){var _0x5156fb=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'bBlack');if(_0x5156fb<=0x0)return _0x4d26c0;this['ctx']['uniform1i'](_0x5156fb,_0x2bdc46['bBlack']);var _0x314d35=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'bCut');if(_0x314d35<=0x0)return _0x4d26c0;this['ctx']['uniform1i'](_0x314d35,_0x2bdc46['bCut']);}if(_0x186ff9['SR_DE_FISH_PTZ_CEILING']==_0x2a1b79||_0x186ff9['SR_DE_FISH_PTZ_FLOOR']==_0x2a1b79||_0x186ff9['SR_DE_FISH_PTZ_WALL']==_0x2a1b79){var _0x124160=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fHAngleCos');if(_0x124160<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x124160,_0x2bdc46['fCosH']);var _0x306b85=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fHAngleSin');if(_0x306b85<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x306b85,_0x2bdc46['fSinH']);var _0x1bc35c=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fVAngleCos');if(_0x1bc35c<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x1bc35c,_0x2bdc46['fCosV']);var _0x4c60dc=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fVAngleSin');if(_0x4c60dc<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x4c60dc,_0x2bdc46['fSinV']);var _0x136f7b=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fZoom');if(_0x136f7b<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x136f7b,_0x2bdc46['fZoom']);}if(_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']==_0x2a1b79||_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']==_0x2a1b79||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']==_0x2a1b79||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']==_0x2a1b79){var _0x517882=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fAngle');if(_0x517882<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x517882,_0x2bdc46['fAngle']);}var _0x3d42d7=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fRX1');if(_0x3d42d7<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x3d42d7,_0x2bdc46['fRXLeft']);var _0x5b37ec=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fRX2');if(_0x5b37ec<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x5b37ec,_0x2bdc46['fRXRight']);var _0x407ff2=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fRY1');if(_0x407ff2<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x407ff2,_0x2bdc46['fRYTop']);var _0x1c8e20=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fRY2');if(_0x1c8e20<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x1c8e20,_0x2bdc46['fRYBottom']);break;case _0x186ff9['SR_DE_FISH_SEMISPHERE']:this['pCamera']['SetScale'](this['fScale']),this['pCamera']['SetPitch'](3.14-this['fRotateX']),this['pCamera']['SetYaw'](-this['fRotateY']),this['pCamera']['UpdateCamera'](this['canvas']['width'],this['canvas']['height']);var _0x489295=this['pCamera']['GetView'](),_0xac09cc=this['pCamera']['GetProj'](),_0x5a6fea=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'matView');if(_0x5a6fea<=0x0)return _0x4d26c0;this['ctx']['uniformMatrix4fv'](_0x5a6fea,!0x1,_0x489295);var _0x37770e=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'matProj');if(_0x37770e<=0x0)return _0x4d26c0;this['ctx']['uniformMatrix4fv'](_0x37770e,!0x1,_0xac09cc);break;case _0x186ff9['SR_DE_FISH_CYLINDER_CEILING']:case _0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']:this['pCamera']['SetScale'](this['fScale']),this['pCamera']['SetPitch'](-this['fRotateX']),this['pCamera']['SetYaw'](-this['fRotateY']),this['pCamera']['UpdateCamera'](this['canvas']['width'],this['canvas']['height']);var _0x4082e3=this['pCamera']['GetView'](),_0x24ca6f=this['pCamera']['GetProj'](),_0x3b3b00=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'matView');if(_0x3b3b00<=0x0)return _0x4d26c0;this['ctx']['uniformMatrix4fv'](_0x3b3b00,!0x1,_0x4082e3);var _0x87ffb2=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'matProj');if(_0x87ffb2<=0x0)return _0x4d26c0;this['ctx']['uniformMatrix4fv'](_0x87ffb2,!0x1,_0x24ca6f);break;default:return _0x86aef9;}if(this['canvas']['width']<=0x0||this['canvas']['height']<=0x0)return _0x4fea1b;if(null!=_0x130cba&&(_0x570392=this['SR_SetDisplayRect'](_0x130cba['fx'],_0x130cba['fy'],_0x130cba['width'],_0x130cba['height'],_0x206403))!=_0xa87ede)return _0x570392;if(null!=_0x130cba?this['ctx']['viewport'](this['canvas']['width']*this['fDstUseLeft'],this['canvas']['height']*this['fDstUseTop'],this['canvas']['width']*this['fDstUseRight'],this['canvas']['height']*this['fDstUseBottom']):(this['ctx']['viewport'](0x0,0x0,this['canvas']['width'],this['canvas']['height']),this['ctx']['clearColor'](0x0,0x0,0x0,0x1),this['ctx']['clear'](this['ctx']['COLOR_BUFFER_BIT']|this['ctx']['DEPTH_BUFFER_BIT'])),this['b3DPort']&&(this['ctx']['enable'](this['ctx']['DEPTH_TEST']),this['ctx']['depthFunc'](this['ctx']['LESS']),this['ctx']['depthMask'](!0x0),0x1==this['bCullBack']?this['ctx']['enable'](this['ctx']['CULL_FACE']):this['ctx']['disable'](this['ctx']['CULL_FACE'])),this['enPixelFormat']==_0xa01ff6)this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x0]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['RGBA'],_0x54c230,_0x533ad6,0x0,this['ctx']['RGBA'],this['ctx']['UNSIGNED_BYTE'],_0x1eea6a),0x1==this['bAntialias']&&this['ctx']['generateMipmap'](this['ctx']['TEXTURE_2D']);else{if(this['enPixelFormat']==_0x58bd8b){var _0x166fc9=this['pFrameData']['subarray'](0x0,_0x54c230*_0x533ad6);this['ctx']['activeTexture'](this['ctx']['TEXTURE0']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x0]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],_0x54c230,_0x533ad6,0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x166fc9);var _0x3b1a83=this['pFrameData']['subarray'](_0x54c230*_0x533ad6+_0x54c230/0x2*_0x533ad6/0x2,_0x54c230*_0x533ad6+_0x54c230/0x2*_0x533ad6/0x2+_0x54c230/0x2*_0x533ad6/0x2);this['ctx']['activeTexture'](this['ctx']['TEXTURE1']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x1]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],_0x54c230/0x2,_0x533ad6/0x2,0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x3b1a83);var _0x402c77=this['pFrameData']['subarray'](_0x54c230*_0x533ad6,_0x54c230*_0x533ad6+_0x54c230/0x2*_0x533ad6/0x2);this['ctx']['activeTexture'](this['ctx']['TEXTURE2']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x2]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],_0x54c230/0x2,_0x533ad6/0x2,0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x402c77),0x1==this['bAntialias']&&this['ctx']['generateMipmap'](this['ctx']['TEXTURE_2D']),_0x166fc9=null,_0x3b1a83=null,_0x402c77=null;}else this['enPixelFormat']==_0x264b64&&(_0x166fc9=this['pFrameData']['subarray'](0x0,_0x54c230*_0x533ad6),(this['ctx']['activeTexture'](this['ctx']['TEXTURE0']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x0]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],_0x54c230,_0x533ad6,0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x166fc9)),_0x3b1a83=this['pFrameData']['subarray'](_0x54c230*_0x533ad6,_0x54c230*_0x533ad6+_0x54c230/0x2*_0x533ad6/0x2),(this['ctx']['activeTexture'](this['ctx']['TEXTURE1']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x1]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],_0x54c230/0x2,_0x533ad6/0x2,0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x3b1a83)),_0x402c77=this['pFrameData']['subarray'](_0x54c230*_0x533ad6+_0x54c230/0x2*_0x533ad6/0x2,_0x54c230*_0x533ad6+_0x54c230/0x2*_0x533ad6/0x2+_0x54c230/0x2*_0x533ad6/0x2),(this['ctx']['activeTexture'](this['ctx']['TEXTURE2']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x2]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],_0x54c230/0x2,_0x533ad6/0x2,0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x402c77),0x1==this['bAntialias']&&this['ctx']['generateMipmap'](this['ctx']['TEXTURE_2D']),_0x166fc9=null,_0x3b1a83=null,_0x402c77=null));}if(this['onlySupportedWebGL1']||this['ctx']['clearBufferfi'](this['ctx']['DEPTH_STENCIL'],0x0,0x1,0x0),0x0==this['b3DPort'])this['ctx']['drawArrays'](this['ctx']['TRIANGLE_FAN'],0x0,0x4);else{if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_SEMISPHERE']){if(this['nSemiSpherePosNum']<=0x0)return _0x520965;this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,this['nSemiSpherePosNum']);}else{if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_CYLINDER_CEILING']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']){if(this['nCylinderPosNum']<=0x0)return _0x520965;this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,this['nCylinderPosNum']);}else{if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']){if(this['nArcSpherePosNum']<=0x0)return _0x520965;this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,this['nArcSpherePosNum']);}}}}if(this['ctx']['useProgram'](null),null!=this['pFishParamManager']){var _0x2c1465=this['pFishParamManager']['GetWndPort']();_0x2c1465!=_0x3cf544&&_0x2c1465==this['nFECPort']&&this['DrawPTZLines']();}return null!=this['pfuncCBIn']&&this['pfuncCBIn'](this['pUserIn']),null!=this['pfuncCBOut']&&this['pfuncCBOut'](this['pUserOut']),_0xa87ede;}},{'key':'DrawPTZLines','value':function(){if(null==this['pFishParamManager'])return _0x520965;var _0xfb6bfe=this['pFishParamManager']['GetPTZDisplayMode']();if(_0xfb6bfe==_0x495db0||_0xfb6bfe==_0x150ab7){for(var _0x33b298=0x0,_0x4499b9={'fR':0x0,'fG':0x0,'fB':0x0,'fA':0x0},_0x594c33=_0xa87ede,_0x4b01f7=0x0;_0x4b01f7<_0x379995;++_0x4b01f7)if(0x0!=this['pFishParamManager']['IsPortAllocated'](_0x4b01f7)&&(_0x33b298=0x2,_0x594c33=this['pFishParamManager']['GetPTZColor'](_0x4b01f7,_0x4499b9),_0xa87ede==_0x594c33)){0x1==this['pFishParamManager']['IsPTZSelected'](_0x4b01f7)&&(_0x33b298+=0x1);var _0x23fea9=this['pFishParamManager']['GetWndPort']();if(_0x4b01f7!=_0x23fea9&&_0x495db0==_0xfb6bfe){if(_0x186ff9['SR_DE_FISH_ORIGINAL']==this['pFishParamManager']['GetDisplayEffect'](_0x23fea9)){var _0x327590={};if(_0x594c33=this['pFishParamManager']['GetPTZPoints'](_0x4b01f7,_0x327590,_0x495db0),_0xa87ede!=_0x594c33)continue;if(null!=_0x327590['pstPoints']&&0x0!=_0x327590['nPointNum']&&(_0x594c33=this['SR_DrawLines'](_0x327590['pstPoints'],_0x327590['nPointNum'],!0x0,_0x4499b9,_0x33b298,!0x1),_0xa87ede!=_0x594c33))continue;}else{var _0x19796d;if((_0x19796d=this['pFishParamManager']['GetPTZFragmentNum'](_0x4b01f7))<=0x0)continue;for(var _0x3eeec2=0x0;_0x3eeec2<_0x19796d;_0x3eeec2++){var _0x4ab5d3={};this['pFishParamManager']['GetPTZFragmentPoints'](_0x4b01f7,_0x4ab5d3,_0x3eeec2),null!=_0x4ab5d3['pstPoints']&&0x0!=_0x4ab5d3['nPointNum']&&this['SR_DrawLines'](_0x4ab5d3['pstPoints'],_0x4ab5d3['nPointNum'],!0x1,_0x4499b9,_0x33b298,!0x1);}}}else{if(_0x4b01f7!=_0x23fea9&&_0x150ab7==_0xfb6bfe){var _0x50bab0={};if(_0x594c33=this['pFishParamManager']['GetPTZPoints'](_0x4b01f7,_0x50bab0,_0x150ab7),_0xa87ede!=_0x594c33)continue;if(null!=_0x50bab0['pstPoints']&&0x0!=_0x50bab0['nPointNum']&&(_0x594c33=this['SR_DrawLines'](_0x50bab0['pstPoints'],_0x50bab0['nPointNum'],!0x0,_0x4499b9,_0x33b298,!0x1),_0xa87ede!=_0x594c33))continue;}}}}return _0xa87ede;}},{'key':'DrawFillBlock','value':function(_0x5db47d,_0x17ee38,_0x3a5c7f){if(null==this['ctx'])return _0x520965;if(null==_0x5db47d||_0x17ee38<0x1||_0x3a5c7f<0x2)return _0x31ddcf;for(var _0x3175a2=0x0,_0xb41871=0x0;_0xb41871<_0x17ee38;++_0xb41871){if(null==_0x5db47d[_0xb41871]['pstPoints']||_0x5db47d[_0xb41871]['nPointNum']<0x3||!0x0!==_0x5db47d[_0xb41871]['bLoop']||null==_0x5db47d[_0xb41871]['pstColor'])return _0x31ddcf;_0x3175a2+=_0x5db47d[_0xb41871]['nPointNum'];}if(_0x3175a2!==_0x3a5c7f)return _0x31ddcf;var _0x55a3ec=_0x3a5c7f-0x2*_0x17ee38;if(_0x55a3ec>this['nMaxFillBlockTriNum']&&(this['pFillBlockPosVertices']=null,this['pFillBlockClrVertices']=null,this['nMaxFillBlockTriNum']=_0x55a3ec),0x0==this['glBlockPosBuffer']&&(this['glBlockPosBuffer']=this['ctx']['createBuffer'](),0x0==this['glBlockPosBuffer']))return _0x4d26c0;if(0x0==this['glBlockClrBuffer']&&(this['glBlockClrBuffer']=this['ctx']['createBuffer'](),0x0==this['glBlockClrBuffer']))return _0x4d26c0;if(null==this['pFillBlockPosVertices']){var _0x5a946e=this['nMaxFillBlockTriNum'];if(this['pFillBlockPosVertices']=new Float32Array(0x3*_0x5a946e*0x3),null==this['pFillBlockPosVertices'])return _0x3d12cf;}if(this['pFillBlockPosVertices']['fill'](0x0),null==this['pFillBlockClrVertices']){var _0x11b260=this['nMaxFillBlockTriNum'];if(this['pFillBlockClrVertices']=new Float32Array(0x4*_0x11b260*0x3),null==this['pFillBlockClrVertices'])return _0x3d12cf;}this['pFillBlockClrVertices']['fill'](0x0);for(var _0x5c54b8=0x0,_0x419f68=0x0,_0x513399=0x0,_0xa7cd13=null,_0x2758c4=null,_0x490836={},_0x5f517a={},_0xabaeff={},_0x5b4ff3=0x0;_0x5b4ff3<_0x17ee38;++_0x5b4ff3){_0x513399=_0x5db47d[_0x5b4ff3]['nPointNum'],_0xa7cd13=_0x5db47d[_0x5b4ff3]['pstPoints'],_0x2758c4=_0x5db47d[_0x5b4ff3]['pstColor'],_0x490836['fX']=(_0xa7cd13[0x0]['fX']-this['fSrcUseLeft'])/(this['fSrcUseRight']-this['fSrcUseLeft']),_0x490836['fX']=this['fDstUseLeft']+_0x490836['fX']*(this['fDstUseRight']-this['fDstUseLeft']),_0x490836['fX']=0x2*_0x490836['fX']-0x1,_0x490836['fY']=(_0xa7cd13[0x0]['fY']-this['fSrcUseTop'])/(this['fSrcUseBottom']-this['fSrcUseTop']),_0x490836['fY']=this['fDstUseTop']+_0x490836['fY']*(this['fDstUseBottom']-this['fDstUseTop']),_0x490836['fY']=0x1-0x2*_0x490836['fY'];for(var _0x5c8d08=0x1;_0x5c8d08<_0x513399-0x1;_0x5c8d08++)_0x5f517a['fX']=(_0xa7cd13[_0x5c8d08]['fX']-this['fSrcUseLeft'])/(this['fSrcUseRight']-this['fSrcUseLeft']),_0x5f517a['fX']=this['fDstUseLeft']+_0x5f517a['fX']*(this['fDstUseRight']-this['fDstUseLeft']),_0x5f517a['fX']=0x2*_0x5f517a['fX']-0x1,_0x5f517a['fY']=(_0xa7cd13[_0x5c8d08]['fY']-this['fSrcUseTop'])/(this['fSrcUseBottom']-this['fSrcUseTop']),_0x5f517a['fY']=this['fDstUseTop']+_0x5f517a['fY']*(this['fDstUseBottom']-this['fDstUseTop']),_0x5f517a['fY']=0x1-0x2*_0x5f517a['fY'],_0xabaeff['fX']=(_0xa7cd13[_0x5c8d08+0x1]['fX']-this['fSrcUseLeft'])/(this['fSrcUseRight']-this['fSrcUseLeft']),_0xabaeff['fX']=this['fDstUseLeft']+_0xabaeff['fX']*(this['fDstUseRight']-this['fDstUseLeft']),_0xabaeff['fX']=0x2*_0xabaeff['fX']-0x1,_0xabaeff['fY']=(_0xa7cd13[_0x5c8d08+0x1]['fY']-this['fSrcUseTop'])/(this['fSrcUseBottom']-this['fSrcUseTop']),_0xabaeff['fY']=this['fDstUseTop']+_0xabaeff['fY']*(this['fDstUseBottom']-this['fDstUseTop']),_0xabaeff['fY']=0x1-0x2*_0xabaeff['fY'],this['pFillBlockPosVertices'][_0x5c54b8++]=_0x490836['fX'],this['pFillBlockPosVertices'][_0x5c54b8++]=_0x490836['fY'],this['pFillBlockPosVertices'][_0x5c54b8++]=0x0,this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fR'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fG'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fB'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fA'],this['pFillBlockPosVertices'][_0x5c54b8++]=_0x5f517a['fX'],this['pFillBlockPosVertices'][_0x5c54b8++]=_0x5f517a['fY'],this['pFillBlockPosVertices'][_0x5c54b8++]=0x0,this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fR'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fG'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fB'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fA'],this['pFillBlockPosVertices'][_0x5c54b8++]=_0xabaeff['fX'],this['pFillBlockPosVertices'][_0x5c54b8++]=_0xabaeff['fY'],this['pFillBlockPosVertices'][_0x5c54b8++]=0x0,this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fR'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fG'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fB'],this['pFillBlockClrVertices'][_0x419f68++]=_0x2758c4['fA'];}if(0x0==this['nBlockShaderProgram']&&(this['nBlockShaderProgram']=this['CompileProgram'](_0x48a033,_0x283927),this['nBlockShaderProgram']<=0x0))return _0x4d26c0;this['ctx']['enable'](this['ctx']['BLEND']),this['ctx']['blendFunc'](this['ctx']['SRC_ALPHA'],this['ctx']['ONE_MINUS_SRC_ALPHA']),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['glBlockPosBuffer']),this['ctx']['bufferData'](this['ctx']['ARRAY_BUFFER'],this['pFillBlockPosVertices'],this['ctx']['STATIC_DRAW']),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['glBlockClrBuffer']),this['ctx']['bufferData'](this['ctx']['ARRAY_BUFFER'],this['pFillBlockClrVertices'],this['ctx']['STATIC_DRAW']),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),this['ctx']['useProgram'](this['nBlockShaderProgram']);var _0x55229f=this['ctx']['getUniformLocation'](this['nLineShaderProgram'],'bCapture');if(_0x55229f<=0x0)return _0x4d26c0;0x1==this['bIsCapturing']?this['ctx']['uniform1i'](_0x55229f,0x1):this['ctx']['uniform1i'](_0x55229f,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['glBlockPosBuffer']);var _0x5d25b6=this['ctx']['getAttribLocation'](this['nBlockShaderProgram'],'position');this['ctx']['enableVertexAttribArray'](_0x5d25b6),this['ctx']['vertexAttribPointer'](_0x5d25b6,0x3,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['glBlockClrBuffer']);var _0x59f897=this['ctx']['getAttribLocation'](this['nBlockShaderProgram'],'color');return this['ctx']['enableVertexAttribArray'](_0x59f897),this['ctx']['vertexAttribPointer'](_0x59f897,0x4,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,0x3*_0x55a3ec),this['ctx']['useProgram'](null),this['ctx']['disable'](this['ctx']['BLEND']),_0xa87ede;}},{'key':'ComputeLinePoint','value':function(_0x511066,_0x1d3b6f){if(null==_0x511066||_0x1d3b6f<0x1)return _0x31ddcf;if(null==this['pLinePosVertices']||null==this['pLineClrVertices'])return _0x520965;var _0xea88ad=0x0,_0x574a97=0x0;0x1==this['bIsCapturing']?(_0xea88ad=(this['fDstUseRight']-this['fDstUseLeft'])*this['nCaptureWidth'],_0x574a97=(this['fDstUseBottom']-this['fDstUseTop'])*this['nCaptureHeight']):(_0xea88ad=(this['fDstUseRight']-this['fDstUseLeft'])*this['canvas']['width'],_0x574a97=(this['fDstUseBottom']-this['fDstUseTop'])*this['canvas']['height']);for(var _0x347d33=0x0,_0x2b608b=0x0,_0x47870b=0x0,_0x278ab8=0x0,_0x28d930=0x0,_0x4592f5=0x0,_0x3b9b4c=0x0,_0xd4ce8f=0x0,_0xdb8723=0x0,_0xd5d75a=0x0,_0x3cc192=0x0,_0x59d8e0=0x0;_0x59d8e0<_0x1d3b6f;++_0x59d8e0){var _0x3e11c9=[];if(!((_0x3cc192=_0x511066[_0x59d8e0]['nPointNum'])<=0x0)){for(var _0x247d88=0x0;_0x247d88<_0x3cc192;++_0x247d88){var _0x3d4d29={};_0x3d4d29['fX']=(_0x511066[_0x59d8e0]['pstPoints'][_0x247d88]['fX']-this['fSrcUseLeft'])/(this['fSrcUseRight']-this['fSrcUseLeft']),_0x3d4d29['fX']=this['fDstUseLeft']+_0x3d4d29['fX']*(this['fDstUseRight']-this['fDstUseLeft']),_0x3d4d29['fX']=0x2*_0x3d4d29['fX']-0x1,_0x3d4d29['fY']=(_0x511066[_0x59d8e0]['pstPoints'][_0x247d88]['fY']-this['fSrcUseTop'])/(this['fSrcUseBottom']-this['fSrcUseTop']),_0x3d4d29['fY']=this['fDstUseTop']+_0x3d4d29['fY']*(this['fDstUseBottom']-this['fDstUseTop']),_0x3d4d29['fY']=0x1-0x2*_0x3d4d29['fY'],_0x3e11c9['push'](_0x3d4d29);}if(this['canvas']['width']<=0x0||this['canvas']['height']<=0x0)return _0x4fea1b;if(_0x4592f5=3.5*_0x511066[_0x59d8e0]['nLineWidth']/_0xea88ad,_0x3b9b4c=3.5*_0x511066[_0x59d8e0]['nLineWidth']/_0x574a97,_0x4592f5<=0x0||_0x3b9b4c<=0x0)return _0x31ddcf;var _0x419dfa=_0x511066[_0x59d8e0]['pstColor'];if(null==_0x419dfa||null==_0x419dfa)return _0x31ddcf;for(var _0x2ae122=0x0;_0x2ae122<_0x3cc192-0x1;++_0x2ae122)_0x2b608b=_0x3e11c9[_0x2ae122+0x1]['fX']-_0x3e11c9[_0x2ae122]['fX'],_0x47870b=_0x3e11c9[_0x2ae122+0x1]['fY']-_0x3e11c9[_0x2ae122]['fY'],_0x347d33=Math['sqrt'](_0x2b608b*_0x2b608b+_0x47870b*_0x47870b),Math['abs'](_0x347d33-0x0)<0.000001||(_0x278ab8=-_0x4592f5*_0x47870b/_0x347d33/0x2,_0x28d930=_0x3b9b4c*_0x2b608b/_0x347d33/0x2,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122]['fX']+_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122]['fY']+_0x28d930,this['pLinePosVertices'][_0xdb8723++]=-0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122+0x1]['fX']-_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122+0x1]['fY']-_0x28d930,this['pLinePosVertices'][_0xdb8723++]=0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122]['fX']-_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122]['fY']-_0x28d930,this['pLinePosVertices'][_0xdb8723++]=0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122]['fX']+_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122]['fY']+_0x28d930,this['pLinePosVertices'][_0xdb8723++]=-0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122+0x1]['fX']+_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122+0x1]['fY']+_0x28d930,this['pLinePosVertices'][_0xdb8723++]=-0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122+0x1]['fX']-_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x2ae122+0x1]['fY']-_0x28d930,this['pLinePosVertices'][_0xdb8723++]=0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],_0xd4ce8f+=0x2);0x1==_0x511066[_0x59d8e0]['bLoop']&&0x2<_0x3cc192&&(_0x2b608b=_0x3e11c9[_0x3cc192-0x1]['fX']-_0x3e11c9[0x0]['fX'],_0x47870b=_0x3e11c9[_0x3cc192-0x1]['fY']-_0x3e11c9[0x0]['fY'],_0x347d33=Math['sqrt'](_0x2b608b*_0x2b608b+_0x47870b*_0x47870b),Math['abs'](_0x347d33-0x0)>0.000001&&(_0x278ab8=-_0x4592f5*_0x47870b/_0x347d33/0x2,_0x28d930=_0x3b9b4c*_0x2b608b/_0x347d33/0x2,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[0x0]['fX']+_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[0x0]['fY']+_0x28d930,this['pLinePosVertices'][_0xdb8723++]=-0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x3cc192-0x1]['fX']-_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x3cc192-0x1]['fY']-_0x28d930,this['pLinePosVertices'][_0xdb8723++]=0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[0x0]['fX']-_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[0x0]['fY']-_0x28d930,this['pLinePosVertices'][_0xdb8723++]=0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[0x0]['fX']+_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[0x0]['fY']+_0x28d930,this['pLinePosVertices'][_0xdb8723++]=-0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x3cc192-0x1]['fX']+_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x3cc192-0x1]['fY']+_0x28d930,this['pLinePosVertices'][_0xdb8723++]=-0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x3cc192-0x1]['fX']-_0x278ab8,this['pLinePosVertices'][_0xdb8723++]=_0x3e11c9[_0x3cc192-0x1]['fY']-_0x28d930,this['pLinePosVertices'][_0xdb8723++]=0x1,this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fR'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fG'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fB'],this['pLineClrVertices'][_0xd5d75a++]=_0x419dfa['fA'],_0xd4ce8f+=0x2));}}return 0x0==_0xd4ce8f?_0x31ddcf:(this['nLineTriangleNum']=_0xd4ce8f,_0xa87ede);}},{'key':'SR_DrawLines','value':function(_0xc257fa,_0x5e3a45,_0x5782f2,_0x385965,_0x4f81fe,_0x20842c){var _0x34f8e7=[],_0x36c991={};return _0x36c991['pstPoints']=_0xc257fa,_0x36c991['nPointNum']=_0x5e3a45,_0x36c991['bLoop']=_0x5782f2,_0x36c991['pstColor']=_0x385965,_0x36c991['nLineWidth']=_0x4f81fe,_0x34f8e7['push'](_0x36c991),this['SR_DrawLinesEx'](_0x34f8e7,0x1,_0x5e3a45,_0x20842c);}},{'key':'SR_DrawLinesEx','value':function(_0x5a7518,_0x168ef4,_0x387f93,_0x2a560f){if(null==this['ctx'])return _0x520965;if(null==_0x5a7518||_0x168ef4<0x1||_0x387f93<0x2)return _0x31ddcf;if(0x0==this['nLineShaderProgram']){var _0x2c6b24=this['CompileProgram'](_0x48a033,_0x283927);if(_0x2c6b24<=0x0)return _0x4d26c0;this['nLineShaderProgram']=_0x2c6b24;}if(0x1==_0x2a560f)return this['DrawFillBlock'](_0x5a7518,_0x168ef4,_0x387f93);for(var _0x3b9fda=0x0,_0x20df99=0x0;_0x20df99<_0x168ef4;++_0x20df99){if(null==_0x5a7518[_0x20df99]['pstPoints']||_0x5a7518[_0x20df99]['nPointNum']<=0x1||_0x5a7518[_0x20df99]['nPointNum']>=0x400||_0x5a7518[_0x20df99]['nLineWidth']<=0x0||null==_0x5a7518[_0x20df99]['pstColor'])return _0x31ddcf;_0x3b9fda+=_0x5a7518[_0x20df99]['nPointNum'];}if(_0x3b9fda!=_0x387f93)return _0x31ddcf;if((_0x3b9fda+=_0x168ef4)>this['nMaxPointNum']&&(this['nMaxPointNum']=_0x3b9fda,this['pLinePosVertices']=null,this['pLineClrVertices']=null),null==this['pLinePosVertices']&&(this['pLinePosVertices']=new Float32Array(0x6*this['nMaxPointNum']*0x3),null==this['pLinePosVertices']))return _0x3d12cf;if(this['pLinePosVertices']['fill'](0x0),null==this['pLineClrVertices']&&(this['pLineClrVertices']=new Float32Array(0x6*this['nMaxPointNum']*0x4),null==this['pLineClrVertices']))return _0x3d12cf;if(this['pLineClrVertices']['fill'](0x0),0x0==this['glLinePosBuffer']&&(this['glLinePosBuffer']=this['ctx']['createBuffer'](),0x0==this['glLinePosBuffer']))return _0x4d26c0;if(0x0==this['glLineClrBuffer']&&(this['glLineClrBuffer']=this['ctx']['createBuffer'](),0x0==this['glLineClrBuffer']))return _0x4d26c0;var _0x2729ac=this['ComputeLinePoint'](_0x5a7518,_0x168ef4);if(_0xa87ede!=_0x2729ac)return _0x2729ac;this['ctx']['enable'](this['ctx']['BLEND']),this['ctx']['blendFunc'](this['ctx']['SRC_ALPHA'],this['ctx']['ONE_MINUS_SRC_ALPHA']);var _0x539ebb=this['nLineShaderProgram'];this['ctx']['useProgram'](_0x539ebb);var _0x45c49a=this['ctx']['getUniformLocation'](this['nLineShaderProgram'],'bCapture');if(_0x45c49a<=0x0)return _0x4d26c0;0x1==this['bIsCapturing']?this['ctx']['uniform1i'](_0x45c49a,0x1):this['ctx']['uniform1i'](_0x45c49a,0x0);var _0x3da9fb=this['glLinePosBuffer'],_0x53c565=this['glLineClrBuffer'],_0x5a1957=this['nLineTriangleNum'],_0x3ce2a8=this['pLinePosVertices'],_0x20734b=this['pLineClrVertices'];this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],_0x3da9fb),this['ctx']['bufferData'](this['ctx']['ARRAY_BUFFER'],_0x3ce2a8,this['ctx']['STATIC_DRAW']);var _0x5a578b=this['ctx']['getAttribLocation'](_0x539ebb,'position');this['ctx']['enableVertexAttribArray'](_0x5a578b),this['ctx']['vertexAttribPointer'](_0x5a578b,0x3,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],_0x53c565),this['ctx']['bufferData'](this['ctx']['ARRAY_BUFFER'],_0x20734b,this['ctx']['STATIC_DRAW']);var _0x3afb19=this['ctx']['getAttribLocation'](_0x539ebb,'color');return this['ctx']['enableVertexAttribArray'](_0x3afb19),this['ctx']['vertexAttribPointer'](_0x3afb19,0x4,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),0x1==this['bIsCapturing']?this['ctx']['viewport'](0x0,0x0,this['nCaptureWidth'],this['nCaptureHeight']):this['ctx']['viewport'](0x0,0x0,this['canvas']['width'],this['canvas']['height']),this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,0x3*_0x5a1957),this['ctx']['useProgram'](null),this['ctx']['disable'](this['ctx']['BLEND']),_0xa87ede;}},{'key':'SR_DrawFont','value':function(_0x6eab1a,_0x4143dd,_0x2bbea7,_0x2279ac,_0x152461,_0x2b681e,_0xbd83ec,_0x33f12d,_0x5f236b,_0xf708b7,_0x233741){if(null==_0x6eab1a||null==_0x4143dd||null==_0x2bbea7||_0x2279ac<=0x1||_0x152461<=0x1)return _0x31ddcf;if(0x1==_0x2b681e&&null==_0xbd83ec)return _0x31ddcf;var _0x3b9af0=[],_0x35b6ae={};return _0x35b6ae['bBackground']=_0x2b681e,_0x35b6ae['nFontWidth']=_0x2279ac,_0x35b6ae['nFontHeight']=_0x152461,_0x35b6ae['pstBGColor']=_0xbd83ec,_0x35b6ae['pstFontColor']=_0x2bbea7,_0x35b6ae['pString']=_0x6eab1a,_0x35b6ae['pstStartPos']=_0x4143dd,_0x35b6ae['fRotateAngle']=_0x33f12d,_0x35b6ae['pFontFamily']=_0x5f236b,_0x35b6ae['textAlign']=_0xf708b7,_0x35b6ae['textBaseline']=_0x233741,_0x3b9af0['push'](_0x35b6ae),this['SR_DrawFontEx'](_0x3b9af0,0x1);}},{'key':'SR_DrawFontEx','value':function(_0x1ac011,_0x304601){if(null==this['ctx'])return _0x520965;if(0x0>_0x304601||null==_0x1ac011)return _0x31ddcf;var _0x1a5d2f,_0x3f4f85,_0x5cc926=0x0,_0x1efaee=0x0;if(0x1==this['bIsCapturing']){if(0x0==this['nCaptureWidth']||0x0==this['nCaptureHeight'])return _0x520965;_0x5cc926=Math['round']((this['fDstUseRight']-this['fDstUseLeft'])*this['nCaptureWidth']),_0x1efaee=Math['round']((this['fDstUseBottom']-this['fDstUseTop'])*this['nCaptureHeight']);}else _0x5cc926=Math['round']((this['fDstUseRight']-this['fDstUseLeft'])*this['canvas']['width']),_0x1efaee=Math['round']((this['fDstUseBottom']-this['fDstUseTop'])*this['canvas']['height']);if(_0x5cc926=_0x5cc926+0x4-_0x5cc926%0x4,_0x1efaee=_0x1efaee+0x4-_0x1efaee%0x4,this['nDrawFontWidth']==_0x5cc926&&this['nDrawFontHeight']==_0x1efaee||(this['pFontColorBuffer']=null,this['nFontColorTexture']=0x0,this['nDrawFontWidth']=_0x5cc926,this['nDrawFontHeight']=_0x1efaee,null!=this['textCanvas']&&(this['textCanvas']['remove'](),this['textCanvas']=null,this['textCanvasCtx']=null)),0x0==this['nFontColorTexture']){if(this['nFontColorTexture']=this['ctx']['createTexture'](),0x0==this['nFontColorTexture'])return _0x4d26c0;this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nFontColorTexture']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']);}if(null==this['textCanvas']){if(this['textCanvas']=document['createElement']('canvas'),null==this['textCanvas'])return _0x13126c;if(this['textCanvasCtx']=this['textCanvas']['getContext']('2d'),null==this['textCanvasCtx'])return _0x13126c;this['textCanvasCtx']['canvas']['width']=this['nDrawFontWidth'],this['textCanvasCtx']['canvas']['height']=this['nDrawFontHeight'];}this['textCanvasCtx']['clearRect'](0x0,0x0,this['nDrawFontWidth'],this['nDrawFontHeight']);for(var _0x29913c=0x0;_0x29913c<_0x304601;++_0x29913c){var _0x597442=_0x1ac011[_0x29913c]['nFontWidth'],_0x51713c=_0x1ac011[_0x29913c]['nFontHeight'];0x1==this['bIsCapturing']&&(_0x597442=Math['round'](0.7*this['nCaptureWidth']/this['canvas']['width']*_0x597442),_0x51713c=Math['round'](0.7*this['nCaptureHeight']/this['canvas']['height']*_0x51713c));var _0x20deee=_0x597442<_0x51713c?_0x597442:_0x51713c;this['textCanvasCtx']['font']=_0x20deee['toString']()+'px\\x20'+_0x1ac011[_0x29913c]['pFontFamily'],null==_0x1ac011[_0x29913c]['textAlign']||null==_0x1ac011[_0x29913c]['textAlign']?this['textCanvasCtx']['textAlign']='left':this['textCanvasCtx']['textAlign']=_0x1ac011[_0x29913c]['textAlign'],null==_0x1ac011[_0x29913c]['textBaseline']||null==_0x1ac011[_0x29913c]['textBaseline']?this['textCanvasCtx']['textBaseline']='top':this['textCanvasCtx']['textBaseline']=_0x1ac011[_0x29913c]['textBaseline'];var _0x5823b0=parseInt(0xff*_0x1ac011[_0x29913c]['pstFontColor']['fR']),_0x6ef32b=parseInt(0xff*_0x1ac011[_0x29913c]['pstFontColor']['fG']),_0x398c18=parseInt(0xff*_0x1ac011[_0x29913c]['pstFontColor']['fB']),_0x2437c7=_0x5823b0<0x10?'0'+_0x5823b0['toString'](0x10):_0x5823b0['toString'](0x10),_0x5becf5=_0x6ef32b<0x10?'0'+_0x6ef32b['toString'](0x10):_0x6ef32b['toString'](0x10),_0x1ea421=_0x398c18<0x10?'0'+_0x398c18['toString'](0x10):_0x398c18['toString'](0x10);this['textCanvasCtx']['fillStyle']='#'+_0x2437c7+_0x5becf5+_0x1ea421,this['textCanvasCtx']['globalAlpha']=_0x1ac011[_0x29913c]['pstFontColor']['fA'];var _0x4eff32=_0x1ac011[_0x29913c]['pstStartPos']['fX']*this['nDrawFontWidth'],_0x11c46b=_0x1ac011[_0x29913c]['pstStartPos']['fY']*this['nDrawFontHeight'];this['textCanvasCtx']['save'](),this['textCanvasCtx']['translate'](_0x4eff32,_0x11c46b),this['textCanvasCtx']['rotate'](_0x1ac011[_0x29913c]['fRotateAngle']*Math['PI']/0xb4),this['textCanvasCtx']['fillText'](_0x1ac011[_0x29913c]['pString'],0x0,0x0),this['textCanvasCtx']['restore']();}if(this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nFontColorTexture']),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['RGBA'],this['ctx']['RGBA'],this['ctx']['UNSIGNED_BYTE'],this['textCanvasCtx']['canvas']),0x0==this['nFontShaderProgram']&&(this['nFontShaderProgram']=this['CompileProgram']('\\x0a\\x20\\x20\\x20\\x20attribute\\x20vec4\\x20\\x20position;\\x0a\\x20\\x20\\x20\\x20attribute\\x20vec4\\x20\\x20texCoord;\\x0a\\x20\\x20\\x20\\x20varying\\x20vec4\\x20\\x20pp;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20int\\x20bCapture;\\x0a\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x0a\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position.x\\x20\\x20=\\x20position.x;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position.y\\x20\\x20=\\x20position.y;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(bCapture\\x20==\\x201)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position.y\\x20=\\x20-position.y;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position.z\\x20\\x20=\\x200.1;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position.w\\x20\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20pp\\x20=\\x20texCoord;\\x20\\x0a\\x20\\x20\\x20\\x20}\\x0a','\\x0a\\x20\\x20\\x20\\x20varying\\x20lowp\\x20vec4\\x20pp;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x0a\\x0a\\x20\\x20\\x20\\x20void\\x20main(void)\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20texture2D(texture,\\x20pp.st);\\x0a\\x20\\x20\\x20\\x20}\\x0a'),this['nFontShaderProgram']<=0x0))return _0x4d26c0;0x1==this['bIsCapturing']?(_0x1a5d2f=this['nCaptureWidth']+0x4-this['nCaptureWidth']%0x4,_0x3f4f85=this['nCaptureHeight']+0x4-this['nCaptureHeight']%0x4):(_0x1a5d2f=this['canvas']['width']+0x4-this['canvas']['width']%0x4,_0x3f4f85=this['canvas']['height']+0x4-this['canvas']['height']%0x4),this['ctx']['viewport'](0x0,0x0,_0x1a5d2f,_0x3f4f85),this['ctx']['enable'](this['ctx']['BLEND']),this['ctx']['blendFunc'](this['ctx']['SRC_ALPHA'],this['ctx']['ONE_MINUS_SRC_ALPHA']),this['ctx']['useProgram'](this['nFontShaderProgram']);var _0x2103fe=this['ctx']['getUniformLocation'](this['nFontShaderProgram'],'bCapture');if(_0x2103fe<=0x0)return _0x4d26c0;0x1==this['bIsCapturing']?this['ctx']['uniform1i'](_0x2103fe,0x1):this['ctx']['uniform1i'](_0x2103fe,0x0),this['ctx']['activeTexture'](this['ctx']['TEXTURE0']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nFontColorTexture']);var _0x352925=this['ctx']['getUniformLocation'](this['nFontShaderProgram'],'texture');this['ctx']['uniform1i'](_0x352925,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['vertexPosBuffer']);var _0x2cf17b=this['ctx']['getAttribLocation'](this['nFontShaderProgram'],'position');this['ctx']['enableVertexAttribArray'](_0x2cf17b),this['ctx']['vertexAttribPointer'](_0x2cf17b,0x3,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['texturePosBuffer']);var _0x58c4a5=this['ctx']['getAttribLocation'](this['nFontShaderProgram'],'texCoord');return this['ctx']['enableVertexAttribArray'](_0x58c4a5),this['ctx']['vertexAttribPointer'](_0x58c4a5,0x2,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),this['ctx']['drawArrays'](this['ctx']['TRIANGLE_FAN'],0x0,0x4),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],null),this['ctx']['useProgram'](null),this['ctx']['disable'](this['ctx']['BLEND']),_0xa87ede;}},{'key':'SR_DrawImage','value':function(_0x1c393e,_0x3cb83a,_0x19a57a,_0x2b70fe,_0x384884,_0x562e06){if(null==this['ctx'])return _0x520965;if(null==_0x1c393e||_0x3cb83a<=0x0||_0x19a57a<=0x0||null==_0x2b70fe||_0x562e06<0x0||_0x562e06>0x1)return _0x31ddcf;if(this['nDrawImageWidth']=_0x3cb83a,this['nDrawImageHeight']=_0x19a57a,0x0==this['glImagePosBuffer']&&(this['glImagePosBuffer']=this['ctx']['createBuffer'](),0x0==this['glImagePosBuffer']))return _0x4d26c0;if(0x0==this['glImageClrBuffer']&&(this['glImageClrBuffer']=this['ctx']['createBuffer'](),0x0==this['glImageClrBuffer']))return _0x4d26c0;if(null==this['pImageClrVertices']){if(this['pImageClrVertices']=new Float32Array(0xc),null==this['pImageClrVertices'])return _0x3d12cf;this['pImageClrVertices'][0x0]=0x0,this['pImageClrVertices'][0x1]=0x0,this['pImageClrVertices'][0x2]=0x0,this['pImageClrVertices'][0x3]=0x1,this['pImageClrVertices'][0x4]=0x1,this['pImageClrVertices'][0x5]=0x0,this['pImageClrVertices'][0x6]=0x1,this['pImageClrVertices'][0x7]=0x0,this['pImageClrVertices'][0x8]=0x0,this['pImageClrVertices'][0x9]=0x1,this['pImageClrVertices'][0xa]=0x1,this['pImageClrVertices'][0xb]=0x1;}var _0x24a466={},_0x254ae9={};if(_0x24a466['fLeft']=(_0x2b70fe['fLeft']-this['fSrcUseLeft'])/(this['fSrcUseRight']-this['fSrcUseLeft']),_0x24a466['fRight']=(_0x2b70fe['fRight']-this['fSrcUseLeft'])/(this['fSrcUseRight']-this['fSrcUseLeft']),_0x24a466['fTop']=(_0x2b70fe['fTop']-this['fSrcUseTop'])/(this['fSrcUseBottom']-this['fSrcUseTop']),_0x24a466['fBottom']=(_0x2b70fe['fBottom']-this['fSrcUseTop'])/(this['fSrcUseBottom']-this['fSrcUseTop']),_0x254ae9['fLeft']=this['fDstUseLeft']+_0x24a466['fLeft']*(this['fDstUseRight']-this['fDstUseLeft']),_0x254ae9['fRight']=this['fDstUseLeft']+_0x24a466['fRight']*(this['fDstUseRight']-this['fDstUseLeft']),_0x254ae9['fTop']=this['fDstUseTop']+_0x24a466['fTop']*(this['fDstUseBottom']-this['fDstUseTop']),_0x254ae9['fBottom']=this['fDstUseTop']+_0x24a466['fBottom']*(this['fDstUseBottom']-this['fDstUseTop']),null==this['pImagePosVertices']&&(this['pImagePosVertices']=new Float32Array(0xc),null==this['pImagePosVertices']))return _0x3d12cf;switch(this['pImagePosVertices']['fill'](0x0),this['pImagePosVertices'][0x0]=0x2*_0x254ae9['fLeft']-0x1,this['pImagePosVertices'][0x1]=0x1-0x2*_0x254ae9['fTop'],this['pImagePosVertices'][0x2]=0x2*_0x254ae9['fLeft']-0x1,this['pImagePosVertices'][0x3]=0x1-0x2*_0x254ae9['fBottom'],this['pImagePosVertices'][0x4]=0x2*_0x254ae9['fRight']-0x1,this['pImagePosVertices'][0x5]=0x1-0x2*_0x254ae9['fTop'],this['pImagePosVertices'][0x6]=0x2*_0x254ae9['fRight']-0x1,this['pImagePosVertices'][0x7]=0x1-0x2*_0x254ae9['fTop'],this['pImagePosVertices'][0x8]=0x2*_0x254ae9['fLeft']-0x1,this['pImagePosVertices'][0x9]=0x1-0x2*_0x254ae9['fBottom'],this['pImagePosVertices'][0xa]=0x2*_0x254ae9['fRight']-0x1,this['pImagePosVertices'][0xb]=0x1-0x2*_0x254ae9['fBottom'],0x1==this['bIsCapturing']?this['ctx']['viewport'](0x0,0x0,this['nCaptureWidth'],this['nCaptureHeight']):this['ctx']['viewport'](0x0,0x0,this['canvas']['width'],this['canvas']['height']),this['ctx']['enable'](this['ctx']['BLEND']),this['ctx']['blendFunc'](this['ctx']['SRC_ALPHA'],this['ctx']['ONE_MINUS_SRC_ALPHA']),_0x384884){case _0x3b8155:if(null==this['nImageColorTexture']){if(this['nImageColorTexture']=this['ctx']['createTexture'](),0x0==this['nImageColorTexture'])return _0x4d26c0;this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTexture']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']);}if(this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTexture']),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['RGBA'],this['nDrawImageWidth'],this['nDrawImageHeight'],0x0,this['ctx']['RGBA'],this['ctx']['UNSIGNED_BYTE'],_0x1c393e),0x0==this['nImageShaderProgram']){var _0x39f044=this['CompileProgram'](_0x2a3c39,_0x350ff5);if(_0x39f044<=0x0)return _0x4d26c0;this['nImageShaderProgram']=_0x39f044;}break;case _0x2818bf:if(null==this['nImageColorTexture']){if(this['nImageColorTexture']=this['ctx']['createTexture'](),0x0==this['nImageColorTexture'])return _0x4d26c0;this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTexture']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']);}if(this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTexture']),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['RGB'],this['nDrawImageWidth'],this['nDrawImageHeight'],0x0,this['ctx']['RGB'],this['ctx']['UNSIGNED_SHORT_5_6_5'],_0x1c393e),0x0==this['nImageShaderProgram']){var _0x42c057=this['CompileProgram'](_0x2a3c39,'\\x0a\\x20\\x20\\x20\\x20precision\\x20mediump\\x20float;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x20\\x0a\\x20\\x20\\x20\\x20varying\\x20lowp\\x20vec4\\x20pp;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fAlpha;\\x0a\\x20\\x20\\x20\\x20void\\x20main(void)\\x20\\x0a\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20texture2D(texture,\\x20pp.st);\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor.a\\x20*=\\x20fAlpha;\\x20\\x0a\\x20\\x20\\x20\\x20}\\x20\\x0a');if(_0x42c057<=0x0)return _0x4d26c0;this['nImageShaderProgram']=_0x42c057;}break;case _0x58bd8b:for(var _0x22b758=0x0;_0x22b758<0x3;_0x22b758++){if(this['nImageColorTextures'][_0x22b758]=this['ctx']['createTexture'](),0x0==this['nImageColorTextures'][_0x22b758])return _0x4d26c0;this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTextures'][_0x22b758]),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']);}if(this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTextures'][0x0]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],this['nDrawImageWidth'],this['nDrawImageHeight'],0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x1c393e),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTextures'][0x1]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],this['nDrawImageWidth']/0x2,this['nDrawImageHeight']/0x2,0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x1c393e+this['nDrawImageWidth']*this['nDrawImageHeight']*0x5/0x4),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTextures'][0x2]),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['LUMINANCE'],this['nDrawImageWidth']/0x2,this['nDrawImageHeight']/0x2,0x0,this['ctx']['LUMINANCE'],this['ctx']['UNSIGNED_BYTE'],_0x1c393e+this['nDrawImageWidth']*this['nDrawImageHeight']),0x0==this['nImageShaderProgram']){var _0x826ac7=this['CompileProgram'](_0x2a3c39,'\\x0a\\x20\\x20\\x20\\x20precision\\x20mediump\\x20float;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20Ytexture;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20Utexture;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20Vtexture;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fAlpha;\\x0a\\x20\\x20\\x20\\x20varying\\x20lowp\\x20vec4\\x20pp;\\x0a\\x0a\\x20\\x20\\x20\\x20void\\x20main(void)\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20r,\\x20g,\\x20b,\\x20y,\\x20u,\\x20v;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20y\\x20=\\x20texture2D(Ytexture,\\x20pp.st).r;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20u\\x20=\\x20texture2D(Utexture,\\x20pp.st).r;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20v\\x20=\\x20texture2D(Vtexture,\\x20pp.st).r;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20y\\x20=\\x201.1643\\x20*\\x20(y\\x20-\\x200.0625);\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20u\\x20=\\x20u\\x20-\\x200.5;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20v\\x20=\\x20v\\x20-\\x200.5;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x20y\\x20+\\x201.5958\\x20*\\x20v;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x20y\\x20-\\x200.39173\\x20*\\x20u\\x20-\\x200.81290\\x20*\\x20v;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x20y\\x20+\\x202.017\\x20*\\x20u;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r,\\x20g,\\x20b,\\x20fAlpha);\\x20\\x0a\\x20\\x20\\x20\\x20}\\x0a');if(_0x826ac7<=0x0)return _0x4d26c0;this['nImageShaderProgram']=_0x826ac7;}break;case _0xa01ff6:if(null==this['nImageColorTexture']){if(this['nImageColorTexture']=this['ctx']['createTexture'](),0x0==this['nImageColorTexture'])return _0x4d26c0;this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTexture']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']);}this['ctx']['useProgram'](this['videoShaderProgram']),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['vertexPosBuffer']);var _0x23716d=this['ctx']['getAttribLocation'](this['videoShaderProgram'],'xy');if(_0x23716d<0x0)return _0x4d26c0;this['ctx']['vertexAttribPointer'](_0x23716d,0x3,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['enableVertexAttribArray'](_0x23716d),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['texturePosBuffer']);var _0x47a4a9=this['ctx']['getAttribLocation'](this['videoShaderProgram'],'uv');if(_0x47a4a9<0x0)return _0x4d26c0;if(this['ctx']['vertexAttribPointer'](_0x47a4a9,0x2,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['enableVertexAttribArray'](_0x47a4a9),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),this['ctx']['useProgram'](null),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTexture']),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['RGBA'],this['nDrawImageWidth'],this['nDrawImageHeight'],0x0,this['ctx']['RGBA'],this['ctx']['UNSIGNED_BYTE'],_0x1c393e),0x0==this['nImageShaderProgram']){var _0x1889b9=this['CompileProgram'](_0x2a3c39,_0x350ff5);if(_0x1889b9<=0x0)return _0x4d26c0;this['nImageShaderProgram']=_0x1889b9;}break;default:return _0x86aef9;}var _0x39944f=this['nImageShaderProgram'];this['ctx']['useProgram'](_0x39944f);var _0x35df32=this['ctx']['getUniformLocation'](this['nImageShaderProgram'],'bCapture');if(_0x35df32<=0x0)return _0x4d26c0;0x1==this['bIsCapturing']?this['ctx']['uniform1i'](_0x35df32,0x1):this['ctx']['uniform1i'](_0x35df32,0x0),this['ctx']['activeTexture'](this['ctx']['TEXTURE0']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nImageColorTexture']);var _0x370d63=this['ctx']['getUniformLocation'](this['nImageShaderProgram'],'texture');this['ctx']['uniform1i'](_0x370d63,0x0),_0x370d63=this['ctx']['getUniformLocation'](this['nImageShaderProgram'],'fAlpha'),this['ctx']['uniform1f'](_0x370d63,_0x562e06),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['glImagePosBuffer']),this['ctx']['bufferData'](this['ctx']['ARRAY_BUFFER'],this['pImagePosVertices'],this['ctx']['STATIC_DRAW']);var _0x3daade=this['ctx']['getAttribLocation'](this['nImageShaderProgram'],'position');this['ctx']['enableVertexAttribArray'](_0x3daade),this['ctx']['vertexAttribPointer'](_0x3daade,0x2,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['glImageClrBuffer']),this['ctx']['bufferData'](this['ctx']['ARRAY_BUFFER'],this['pImageClrVertices'],this['ctx']['STATIC_DRAW']);var _0x44ee1a=this['ctx']['getAttribLocation'](this['nImageShaderProgram'],'texCoord');return this['ctx']['enableVertexAttribArray'](_0x44ee1a),this['ctx']['vertexAttribPointer'](_0x44ee1a,0x2,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,0x6),this['ctx']['useProgram'](null),this['ctx']['disable'](this['ctx']['BLEND']),_0xa87ede;}},{'key':'SR_AddSubPort','value':function(_0x1c4dff){var _0x29f273,_0x1303a3,_0x30143d=_0x3cf544;if(null==this['ctx'])return _0x30143d;if(null!=this['pFishParamManager']?_0x30143d=this['pFishParamManager']['GetFECPort'](_0x1c4dff):_0x1c4dff==_0x186ff9['SR_DE_NULL']&&(_0x30143d=0x0),_0x30143d==_0x3cf544)return _0x3cf544;switch(this['nFECPort']=_0x30143d,_0x1c4dff){case _0x186ff9['SR_DE_NULL']:_0x29f273=_0x1f462c,this['enPixelFormat']==_0xa01ff6?_0x1303a3='\\x0aprecision\\x20mediump\\x20float;\\x0avarying\\x20highp\\x20vec2\\x20v_uv;\\x0auniform\\x20sampler2D\\x20texture;\\x0auniform\\x20float\\x20fWndWidth;\\x0auniform\\x20float\\x20fWndHeight;\\x0auniform\\x20float\\x20fBrightness;\\x0auniform\\x20float\\x20fHue;\\x0auniform\\x20float\\x20fSaturation;\\x0auniform\\x20float\\x20fContrast;\\x0auniform\\x20float\\x20fSharpness;\\x0auniform\\x20int\\x20nPostProc;\\x0avec3\\x20rgb2hsv(vec3\\x20c)\\x20\\x0a{\\x20\\x0a\\x20\\x20\\x20\\x20vec4\\x20K\\x20=\\x20vec4(0.0,\\x20-1.0\\x20/\\x203.0,\\x202.0\\x20/\\x203.0,\\x20-1.0);\\x20\\x0a\\x20\\x20\\x20\\x20vec4\\x20p\\x20=\\x20c.g\\x20<\\x20c.b\\x20?\\x20vec4(c.bg,\\x20K.wz)\\x20:\\x20vec4(c.gb,\\x20K.xy);\\x20\\x0a\\x20\\x20\\x20\\x20vec4\\x20q\\x20=\\x20c.r\\x20<\\x20p.x\\x20?\\x20vec4(p.xyw,\\x20c.r)\\x20:\\x20vec4(c.r,\\x20p.yzx);\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20d\\x20=\\x20q.x\\x20-\\x20min(q.w,\\x20q.y);\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20e\\x20=\\x201.0e-10;\\x20\\x0a\\x20\\x20\\x20\\x20return\\x20vec3(abs(q.z\\x20+\\x20(q.w\\x20-\\x20q.y)\\x20/\\x20(6.0\\x20*\\x20d\\x20+\\x20e)),\\x20d\\x20/\\x20(q.x\\x20+\\x20e),\\x20q.x);\\x20\\x0a}\\x20\\x0avec3\\x20hsv2rgb(vec3\\x20c)\\x20\\x0a{\\x20\\x0a\\x20\\x20\\x20\\x20vec4\\x20K\\x20=\\x20vec4(1.0,\\x202.0\\x20/\\x203.0,\\x201.0\\x20/\\x203.0,\\x203.0);\\x20\\x0a\\x20\\x20\\x20\\x20vec3\\x20p\\x20=\\x20abs(fract(c.xxx\\x20+\\x20K.xyz)\\x20*\\x206.0\\x20-\\x20K.www);\\x20\\x0a\\x20\\x20\\x20\\x20return\\x20c.z\\x20*\\x20mix(K.xxx,\\x20clamp(p\\x20-\\x20K.xxx,\\x200.0,\\x201.0),\\x20c.y);\\x20\\x0a}\\x20\\x0avec3\\x20sharpen()\\x20\\x0a{\\x20\\x0a\\x20\\x20\\x20\\x20vec3\\x20sharpenColor;\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20offWidth\\x20=\\x201.0\\x20/\\x20fWndWidth;\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20offHeight\\x20=\\x201.0\\x20/\\x20fWndHeight;\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20tempSharpness\\x20=\\x20fSharpness\\x20*\\x20100.0;\\x20\\x0a\\x20\\x20\\x20\\x20vec2\\x20uv\\x20\\x20\\x20\\x20\\x20=\\x20v_uv;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20\\x20=\\x20(1.0\\x20+\\x204.0\\x20*\\x20tempSharpness)\\x20*\\x20texture2D(texture,\\x20uv).rgb;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20uv\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20=\\x20v_uv\\x20+\\x20vec2(offWidth,\\x200);\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20-=\\x20tempSharpness\\x20*\\x20texture2D(texture,\\x20uv).rgb;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20uv\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20=\\x20v_uv\\x20+\\x20vec2(-offWidth,\\x200);\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20-=\\x20tempSharpness\\x20*\\x20texture2D(texture,\\x20uv).rgb;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20uv\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20=\\x20v_uv\\x20+\\x20vec2(0,\\x20offHeight);\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20-=\\x20tempSharpness\\x20*\\x20texture2D(texture,\\x20uv).rgb;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20uv\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20=\\x20v_uv\\x20+\\x20vec2(0,\\x20-offHeight);\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20-=\\x20tempSharpness\\x20*\\x20texture2D(texture,\\x20uv).rgb;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20return\\x20sharpenColor;\\x20\\x0a}\\x20\\x0avoid\\x20main(void)\\x20\\x0a{\\x0a\\x20\\x20\\x20\\x20if(1\\x20==\\x20nPostProc)\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec3\\x20fragRGB\\x20=\\x20sharpen();\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20//sharpen\\x20锐度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec3\\x20fragHSV\\x20=\\x20rgb2hsv(fragRGB);\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragHSV.x\\x20=\\x20fragHSV.x\\x20+\\x20fHue;\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20//hue\\x20色度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragHSV.y\\x20=\\x20fragHSV.y\\x20*\\x20(fSaturation\\x20+\\x201.0);\\x20\\x20\\x20\\x20//saturation\\x20饱和度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragRGB\\x20=\\x20hsv2rgb(fragHSV);\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if\\x20(fBrightness\\x20>\\x200.0)\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20//brightness\\x20亮度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragRGB\\x20=\\x20fragRGB\\x20+\\x20(1.0\\x20-\\x20fragRGB)\\x20*\\x20fBrightness;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20else\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragRGB\\x20=\\x20fragRGB\\x20+\\x20fragRGB\\x20*\\x20fBrightness;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tempContrast\\x20=\\x20fContrast\\x20>\\x200.0\\x20?\\x20fContrast\\x20*\\x2010.0\\x20:\\x20fContrast;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragRGB\\x20=\\x20((fragRGB\\x20-\\x200.5)\\x20*\\x20max(tempContrast\\x20+\\x201.0,\\x200.0))\\x20+\\x200.5;\\x20\\x20\\x20\\x20\\x20\\x20//contrast\\x20对比度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(fragRGB,\\x201.0);\\x20\\x0a\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20else\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20texture2D(texture,\\x20v_uv);\\x0a\\x20\\x20\\x20\\x20}\\x0a}\\x0a':this['enPixelFormat']!=_0x58bd8b&&this['enPixelFormat']!=_0x264b64||(_0x1303a3='\\x0aprecision\\x20mediump\\x20float;\\x0avarying\\x20highp\\x20vec2\\x20v_uv;\\x0auniform\\x20sampler2D\\x20Ytexture;\\x0auniform\\x20sampler2D\\x20Utexture;\\x0auniform\\x20sampler2D\\x20Vtexture;\\x0auniform\\x20float\\x20fWndWidth;\\x0auniform\\x20float\\x20fWndHeight;\\x0auniform\\x20float\\x20fBrightness;\\x0auniform\\x20float\\x20fHue;\\x0auniform\\x20float\\x20fSaturation;\\x0auniform\\x20float\\x20fContrast;\\x0auniform\\x20float\\x20fSharpness;\\x0auniform\\x20int\\x20nPostProc;\\x0avec3\\x20rgb;\\x0avec3\\x20yuv2rgb(float\\x20y,\\x20float\\x20u,\\x20float\\x20v)\\x0a{\\x0a\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x20\\x0a\\x20\\x20\\x20\\x20y\\x20=\\x201.1643\\x20*\\x20(y\\x20-\\x200.0625);\\x20\\x0a\\x20\\x20\\x20\\x20u\\x20=\\x20u\\x20-\\x200.5;\\x20\\x0a\\x20\\x20\\x20\\x20v\\x20=\\x20v\\x20-\\x200.5;\\x20\\x0a\\x20\\x20\\x20\\x20r\\x20=\\x20y\\x20+\\x201.5958\\x20*\\x20v;\\x20\\x0a\\x20\\x20\\x20\\x20g\\x20=\\x20y\\x20-\\x200.39173\\x20*\\x20u\\x20-\\x200.81290\\x20*\\x20v;\\x20\\x0a\\x20\\x20\\x20\\x20b\\x20=\\x20y\\x20+\\x202.017\\x20*\\x20u;\\x20\\x0a\\x20\\x20\\x20\\x20return\\x20vec3(r,\\x20g,\\x20b);\\x0a}\\x0avec3\\x20rgb2hsv(vec3\\x20c)\\x20\\x0a{\\x20\\x0a\\x20\\x20\\x20\\x20vec4\\x20K\\x20=\\x20vec4(0.0,\\x20-1.0\\x20/\\x203.0,\\x202.0\\x20/\\x203.0,\\x20-1.0);\\x20\\x0a\\x20\\x20\\x20\\x20vec4\\x20p\\x20=\\x20c.g\\x20<\\x20c.b\\x20?\\x20vec4(c.bg,\\x20K.wz)\\x20:\\x20vec4(c.gb,\\x20K.xy);\\x20\\x0a\\x20\\x20\\x20\\x20vec4\\x20q\\x20=\\x20c.r\\x20<\\x20p.x\\x20?\\x20vec4(p.xyw,\\x20c.r)\\x20:\\x20vec4(c.r,\\x20p.yzx);\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20float\\x20d\\x20=\\x20q.x\\x20-\\x20min(q.w,\\x20q.y);\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20e\\x20=\\x201.0e-10;\\x20\\x0a\\x20\\x20\\x20\\x20return\\x20vec3(abs(q.z\\x20+\\x20(q.w\\x20-\\x20q.y)\\x20/\\x20(6.0\\x20*\\x20d\\x20+\\x20e)),\\x20d\\x20/\\x20(q.x\\x20+\\x20e),\\x20q.x);\\x20\\x0a}\\x20\\x0a\\x0avec3\\x20hsv2rgb(vec3\\x20c)\\x20\\x0a{\\x20\\x0a\\x20\\x20\\x20\\x20vec4\\x20K\\x20=\\x20vec4(1.0,\\x202.0\\x20/\\x203.0,\\x201.0\\x20/\\x203.0,\\x203.0);\\x20\\x0a\\x20\\x20\\x20\\x20vec3\\x20p\\x20=\\x20abs(fract(c.xxx\\x20+\\x20K.xyz)\\x20*\\x206.0\\x20-\\x20K.www);\\x20\\x0a\\x20\\x20\\x20\\x20return\\x20c.z\\x20*\\x20mix(K.xxx,\\x20clamp(p\\x20-\\x20K.xxx,\\x200.0,\\x201.0),\\x20c.y);\\x20\\x0a}\\x20\\x0a\\x0avec3\\x20sharpen(vec3\\x20c)\\x20\\x0a{\\x20\\x0a\\x20\\x20\\x20\\x20vec3\\x20sharpenColor;\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20sharpenColorY;\\x0a\\x20\\x20\\x20\\x20float\\x20sharpenColorU;\\x0a\\x20\\x20\\x20\\x20float\\x20sharpenColorV;\\x0a\\x20\\x20\\x20\\x20float\\x20offWidth\\x20\\x20=\\x201.0\\x20/\\x20fWndWidth;\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20offHeight\\x20=\\x201.0\\x20/\\x20fWndHeight;\\x20\\x0a\\x20\\x20\\x20\\x20float\\x20tempSharpness\\x20=\\x20fSharpness\\x20*\\x20100.0;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20=\\x20(1.0\\x20+\\x204.0\\x20*\\x20tempSharpness)\\x20*\\x20c;\\x0a\\x0a\\x20\\x20\\x20\\x20vec2\\x20uv\\x20\\x20\\x20\\x20\\x20\\x20\\x20=\\x20v_uv\\x20+\\x20vec2(offWidth,\\x200);\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorY\\x20=\\x20texture2D(Ytexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorU\\x20=\\x20texture2D(Utexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorV\\x20=\\x20texture2D(Vtexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20-=\\x20tempSharpness\\x20*\\x20\\x20yuv2rgb(sharpenColorY,\\x20sharpenColorU,\\x20sharpenColorV);\\x0a\\x0a\\x20\\x20\\x20\\x20uv\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20=\\x20v_uv\\x20+\\x20vec2(-offWidth,\\x200);\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorY\\x20=\\x20texture2D(Ytexture,\\x20uv).r;\\x0a\\x20\\x20\\x20\\x20sharpenColorU\\x20=\\x20texture2D(Utexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorV\\x20=\\x20texture2D(Vtexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20-=\\x20tempSharpness\\x20*\\x20\\x20yuv2rgb(sharpenColorY,\\x20sharpenColorU,\\x20sharpenColorV);\\x0a\\x0a\\x20\\x20\\x20\\x20uv\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20=\\x20v_uv\\x20+\\x20vec2(0,\\x20offHeight);\\x0a\\x20\\x20\\x20\\x20sharpenColorY\\x20=\\x20texture2D(Ytexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorU\\x20=\\x20texture2D(Utexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorV\\x20=\\x20texture2D(Vtexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20-=\\x20tempSharpness\\x20*\\x20yuv2rgb(sharpenColorY,\\x20sharpenColorU,\\x20sharpenColorV);\\x0a\\x0a\\x20\\x20\\x20\\x20uv\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20=\\x20v_uv\\x20+\\x20vec2(0,\\x20-offHeight);\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorY\\x20=\\x20texture2D(Ytexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorU\\x20=\\x20texture2D(Utexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColorV\\x20=\\x20texture2D(Vtexture,\\x20uv).r;\\x20\\x0a\\x20\\x20\\x20\\x20sharpenColor\\x20-=\\x20tempSharpness\\x20*\\x20\\x20yuv2rgb(sharpenColorY,\\x20sharpenColorU,\\x20sharpenColorV);\\x0a\\x0a\\x20\\x20\\x20\\x20return\\x20sharpenColor;\\x20\\x0a}\\x20\\x0avoid\\x20main(void)\\x0a{\\x0a\\x20\\x20\\x20\\x20float\\x20y,\\x20u,\\x20v;\\x0a\\x20\\x20\\x20\\x20y\\x20=\\x20texture2D(Ytexture,\\x20v_uv).r;\\x0a\\x20\\x20\\x20\\x20u\\x20=\\x20texture2D(Utexture,\\x20v_uv).r;\\x0a\\x20\\x20\\x20\\x20v\\x20=\\x20texture2D(Vtexture,\\x20v_uv).r;\\x0a\\x20\\x20\\x20\\x20rgb\\x20=\\x20yuv2rgb(y,\\x20u,\\x20v);\\x0a\\x20\\x20\\x20\\x20if(1\\x20==\\x20nPostProc)\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec3\\x20fragRGB\\x20=\\x20sharpen(rgb);\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20//sharpen\\x20锐度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec3\\x20fragHSV\\x20=\\x20rgb2hsv(fragRGB);\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragHSV.x\\x20=\\x20fragHSV.x\\x20+\\x20fHue;\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20//hue\\x20色度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragHSV.y\\x20=\\x20fragHSV.y\\x20*\\x20(fSaturation\\x20+\\x201.0);\\x20\\x20\\x20\\x20//saturation\\x20饱和度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragRGB\\x20=\\x20hsv2rgb(fragHSV);\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if\\x20(fBrightness\\x20>\\x200.0)\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20//brightness\\x20亮度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragRGB\\x20=\\x20fragRGB\\x20+\\x20(1.0\\x20-\\x20fragRGB)\\x20*\\x20fBrightness;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20else\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragRGB\\x20=\\x20fragRGB\\x20+\\x20fragRGB\\x20*\\x20fBrightness;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tempContrast\\x20=\\x20fContrast\\x20>\\x200.0\\x20?\\x20fContrast\\x20*\\x2010.0\\x20:\\x20fContrast;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fragRGB\\x20=\\x20((fragRGB\\x20-\\x200.5)\\x20*\\x20max(tempContrast\\x20+\\x201.0,\\x200.0))\\x20+\\x200.5;\\x20\\x20\\x20\\x20\\x20\\x20//contrast\\x20对比度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(fragRGB,\\x201.0);\\x20\\x0a\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20else\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(rgb,\\x201.0);\\x0a\\x20\\x20\\x20\\x20}\\x0a}\\x0a'),this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_ORIGINAL']:_0x29f273=_0x1f462c,_0x1303a3='\\x0aprecision\\x20mediump\\x20float;\\x0avarying\\x20vec2\\x20v_uv;\\x0auniform\\x20sampler2D\\x20texture;\\x0auniform\\x20float\\x20fRX1;\\x0auniform\\x20float\\x20fRX2;\\x0auniform\\x20float\\x20fRY1;\\x0auniform\\x20float\\x20fRY2;\\x0auniform\\x20int\\x20bBlack;\\x20\\x0auniform\\x20int\\x20bCut;\\x0a\\x0avoid\\x20main()\\x0a{\\x20\\x0a\\x09float\\x20r,g,b;\\x0a\\x09vec4\\x20origin;\\x0a\\x0a\\x09float\\x20\\x20w;\\x0a\\x09float\\x20\\x20h;\\x0a\\x09float\\x20\\x20fCenterX;\\x0a\\x09float\\x20\\x20fCenterY;\\x0a\\x09float\\x20\\x20fRadius;\\x0a\\x09w\\x20=\\x201.0;\\x0a\\x09h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x09fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20///<圆心实际坐标\\x0a\\x09fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x09fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x20///<半径实际长度\\x0a\\x09float\\x20\\x20leftCut\\x20=\\x200.0;\\x0a\\x09float\\x20\\x20rightCut\\x20=\\x201.0;\\x0a\\x09float\\x20\\x20topCut\\x20=\\x200.0;\\x0a\\x09float\\x20\\x20bottomCut\\x20=\\x201.0;\\x0a\\x09if(bCut\\x20==\\x201)\\x0a\\x09{\\x0a\\x09\\x09if(fRX1\\x20>\\x200.0)\\x0a\\x09\\x09{\\x0a\\x09\\x09\\x09leftCut\\x20=\\x20fRX1;\\x0a\\x09\\x09}\\x0a\\x09\\x09if(fRX2\\x20<\\x201.0)\\x0a\\x09\\x09{\\x0a\\x09\\x09\\x09rightCut\\x20=\\x20fRX2;\\x0a\\x09\\x09}\\x0a\\x09\\x09if(fRY1\\x20>\\x200.0)\\x0a\\x09\\x09{\\x0a\\x09\\x09\\x09topCut\\x20=\\x20fRY1;\\x0a\\x09\\x09}\\x0a\\x09\\x09if(fRY2\\x20<\\x201.0)\\x0a\\x09\\x09{\\x0a\\x09\\x09\\x09bottomCut\\x20=\\x20fRY2;\\x0a\\x09\\x09}\\x0a\\x09}\\x0a\\x09origin.s\\x20=\\x20v_uv.s\\x20*\\x20(rightCut-leftCut)\\x20+\\x20leftCut;\\x0a\\x09origin.t\\x20=\\x20v_uv.t\\x20*\\x20(bottomCut-topCut)\\x20+\\x20topCut;\\x0a\\x0a\\x09r\\x20=\\x20texture2D(texture,\\x20origin.st).r;\\x20\\x0a\\x09g\\x20=\\x20texture2D(texture,\\x20origin.st).g;\\x20\\x0a\\x09b\\x20=\\x20texture2D(texture,\\x20origin.st).b;\\x20\\x0a\\x0a\\x09if(bBlack\\x20==\\x201)\\x0a\\x09{\\x0a\\x09\\x09float\\x20tmpX,\\x20tmpY;\\x0a\\x09\\x09tmpX\\x20=\\x20origin.s\\x20*\\x20w;\\x20\\x0a\\x09\\x09tmpY\\x20=\\x20origin.t\\x20*\\x20h;\\x20\\x0a\\x09\\x09float\\x20d2\\x20=\\x20(tmpX-fCenterX)*(tmpX-fCenterX)\\x20+\\x20(tmpY-fCenterY)*(tmpY-fCenterY);\\x0a\\x09\\x09if(d2\\x20>\\x20fRadius*fRadius)\\x0a\\x09\\x09{\\x0a\\x09\\x09\\x09r\\x20=\\x200.0;\\x20\\x0a\\x09\\x09\\x09g\\x20=\\x200.0;\\x20\\x0a\\x09\\x09\\x09b\\x20=\\x200.0;\\x20\\x0a\\x09\\x09}\\x0a\\x09}\\x0a\\x0a\\x09gl_FragColor\\x20=\\x20vec4(r\\x20,g\\x20,b\\x20,\\x201.0);\\x0a}\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_PTZ_CEILING']:_0x29f273=_0x1f462c,_0x1303a3='\\x0aprecision\\x20mediump\\x20float;\\x0avarying\\x20vec2\\x20v_uv;\\x0auniform\\x20sampler2D\\x20texture;\\x0auniform\\x20float\\x20fHAngleCos;\\x0auniform\\x20float\\x20fHAngleSin;\\x0auniform\\x20float\\x20fVAngleCos;\\x0auniform\\x20float\\x20fVAngleSin;\\x0auniform\\x20float\\x20fZoom;\\x0a\\x0auniform\\x20float\\x20fRX1;\\x20\\x0auniform\\x20float\\x20fRX2;\\x20\\x0auniform\\x20float\\x20fRY1;\\x20\\x0auniform\\x20float\\x20fRY2;\\x20\\x0a\\x0avoid\\x20main()\\x0a{\\x0a\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x20\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20vec4\\x20origin1;\\x0a\\x20\\x20\\x20\\x20vec4\\x20origin2;\\x0a\\x20\\x20\\x20\\x20vec4\\x20result;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20z1;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20z2;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20dnew;\\x0a\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20w;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20h;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fCenterX;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fCenterY;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20w\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x20\\x20\\x20\\x20fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x20\\x20\\x20\\x20fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20origin1.s\\x20=\\x20v_uv.s\\x20-\\x200.5;\\x0a\\x20\\x20\\x20\\x20origin1.t\\x20=\\x200.5\\x20-\\x20v_uv.t;\\x0a\\x20\\x20\\x20\\x20z1\\x20=\\x20fZoom\\x20;\\x0a\\x0a\\x20\\x20\\x20\\x20origin2.s\\x20=\\x20origin1.s\\x20;\\x0a\\x20\\x20\\x20\\x20origin2.t\\x20=\\x20(origin1.t*fVAngleCos\\x20+\\x20z1*fVAngleSin);\\x0a\\x20\\x20\\x20\\x20z2\\x20=\\x20z1*fVAngleCos\\x20-\\x20origin1.t*fVAngleSin;\\x0a\\x0a\\x20\\x20\\x20\\x20dnew\\x20=\\x20sqrt(origin2.s*origin2.s\\x20+\\x20origin2.t*origin2.t)\\x20;\\x0a\\x20\\x20\\x20\\x20float\\x20d\\x20=\\x20sqrt(origin2.s*origin2.s\\x20+\\x20origin2.t*origin2.t\\x20+\\x20z2*z2);\\x0a\\x20\\x20\\x20\\x20float\\x20theta\\x20=\\x20asin(dnew/d);\\x0a\\x20\\x20\\x20\\x20float\\x20tmp\\x20=\\x20theta\\x20/\\x201.5707963\\x20*\\x200.5;\\x0a\\x20\\x20\\x20\\x20origin2.s\\x20=\\x20tmp*origin2.s\\x20/\\x20dnew\\x20;\\x0a\\x20\\x20\\x20\\x20origin2.t\\x20=\\x20tmp*origin2.t\\x20/\\x20dnew\\x20;\\x0a\\x0a\\x20\\x20\\x20\\x20result.s\\x20=\\x20((origin2.s*fHAngleCos\\x20-\\x20origin2.t*fHAngleSin)*fRadius*2.0+fCenterX)/w;\\x0a\\x20\\x20\\x20\\x20result.t\\x20=\\x20(-(origin2.s*fHAngleSin\\x20+\\x20origin2.t*fHAngleCos)*fRadius*2.0+fCenterY)/h;\\x0a\\x0a\\x20\\x20\\x20\\x20r\\x20=\\x20texture2D(texture,\\x20result.st).r;\\x20\\x0a\\x20\\x20\\x20\\x20g\\x20=\\x20texture2D(texture,\\x20result.st).g;\\x20\\x0a\\x20\\x20\\x20\\x20b\\x20=\\x20texture2D(texture,\\x20result.st).b;\\x20\\x0a\\x20\\x20\\x20\\x20if(result.s\\x20>\\x201.0\\x20||\\x20result.t\\x20>\\x201.0\\x20||\\x20result.s\\x20<\\x200.0\\x20||\\x20result.t\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r\\x20,g\\x20,b\\x20,\\x201.0);\\x0a}\\x20\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_PTZ_FLOOR']:_0x29f273=_0x1f462c,_0x1303a3='\\x0aprecision\\x20mediump\\x20float;\\x0avarying\\x20vec2\\x20v_uv;\\x0auniform\\x20sampler2D\\x20texture;\\x20\\x20\\x0auniform\\x20float\\x20fHAngleCos;\\x20\\x20\\x0auniform\\x20float\\x20fHAngleSin;\\x20\\x0auniform\\x20float\\x20fVAngleCos;\\x20\\x20\\x0auniform\\x20float\\x20fVAngleSin;\\x20\\x20\\x0auniform\\x20float\\x20fZoom;\\x0a\\x0auniform\\x20float\\x20fRX1;\\x20\\x0auniform\\x20float\\x20fRX2;\\x20\\x0auniform\\x20float\\x20fRY1;\\x20\\x0auniform\\x20float\\x20fRY2;\\x20\\x0a\\x0avoid\\x20main()\\x0a{\\x0a\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x0a\\x0a\\x20\\x20\\x20\\x20vec4\\x20origin1;\\x0a\\x20\\x20\\x20\\x20vec4\\x20origin2;\\x0a\\x20\\x20\\x20\\x20vec4\\x20result;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20z1;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20z2;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20dnew;\\x0a\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20w;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20h;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fCenterX;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fCenterY;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20w\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x20\\x20\\x20\\x20fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x20///<Բ��ʵ������\\x0a\\x20\\x20\\x20\\x20fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x20\\x20\\x20\\x20fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x20///<�뾶ʵ�ʳ���\\x0a\\x20\\x20\\x20\\x20origin1.s\\x20=\\x20v_uv.s\\x20-\\x200.5;\\x0a\\x20\\x20\\x20\\x20origin1.t\\x20=\\x20v_uv.t\\x20-\\x200.5;\\x0a\\x20\\x20\\x20\\x20z1\\x20=\\x20fZoom\\x20;\\x0a\\x0a\\x20\\x20\\x20\\x20origin2.s\\x20=\\x20origin1.s\\x20;\\x0a\\x20\\x20\\x20\\x20origin2.t\\x20=\\x20(origin1.t*fVAngleCos\\x20+\\x20z1*fVAngleSin);\\x0a\\x20\\x20\\x20\\x20z2\\x20=\\x20z1*fVAngleCos\\x20-\\x20origin1.t*fVAngleSin;\\x0a\\x0a\\x20\\x20\\x20\\x20dnew\\x20=\\x20sqrt(origin2.s*origin2.s\\x20+\\x20origin2.t*origin2.t)\\x20;\\x0a\\x20\\x20\\x20\\x20float\\x20d\\x20=\\x20sqrt(origin2.s*origin2.s\\x20+\\x20origin2.t*origin2.t\\x20+\\x20z2*z2);\\x0a\\x20\\x20\\x20\\x20float\\x20theta\\x20=\\x20asin(dnew/d);\\x0a\\x20\\x20\\x20\\x20float\\x20tmp\\x20=\\x20theta\\x20/\\x201.5707963\\x20*\\x200.5;\\x0a\\x20\\x20\\x20\\x20origin2.s\\x20=\\x20tmp*origin2.s\\x20/\\x20dnew\\x20;\\x0a\\x20\\x20\\x20\\x20origin2.t\\x20=\\x20tmp*origin2.t\\x20/\\x20dnew\\x20;\\x0a\\x0a\\x20\\x20\\x20\\x20result.s\\x20=\\x20((origin2.s*fHAngleCos\\x20-\\x20origin2.t*fHAngleSin)*fRadius*2.0+fCenterX)/w;\\x0a\\x20\\x20\\x20\\x20result.t\\x20=\\x20((origin2.s*fHAngleSin\\x20+\\x20origin2.t*fHAngleCos)*fRadius*2.0+fCenterY)/h;\\x0a\\x0a\\x20\\x20\\x20\\x20r\\x20=\\x20texture2D(texture,\\x20result.st).r;\\x20\\x0a\\x20\\x20\\x20\\x20g\\x20=\\x20texture2D(texture,\\x20result.st).g;\\x20\\x0a\\x20\\x20\\x20\\x20b\\x20=\\x20texture2D(texture,\\x20result.st).b;\\x20\\x0a\\x20\\x20\\x20\\x20if(result.s\\x20>\\x201.0\\x20||\\x20result.t\\x20>\\x201.0\\x20||\\x20result.s\\x20<\\x200.0\\x20||\\x20result.t\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r\\x20,g\\x20,b\\x20,\\x201.0);\\x0a}\\x20\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_PTZ_WALL']:_0x29f273=_0x1f462c,_0x1303a3='\\x0aprecision\\x20mediump\\x20float;\\x0avarying\\x20vec2\\x20v_uv;\\x0auniform\\x20sampler2D\\x20texture;\\x0auniform\\x20float\\x20fHAngleCos;\\x0auniform\\x20float\\x20fHAngleSin;\\x20\\x20\\x0auniform\\x20float\\x20fVAngleCos;\\x20\\x20\\x0auniform\\x20float\\x20fVAngleSin;\\x20\\x20\\x0auniform\\x20float\\x20fZoom;\\x0a\\x0auniform\\x20float\\x20fRX1;\\x20\\x0auniform\\x20float\\x20fRX2;\\x20\\x0auniform\\x20float\\x20fRY1;\\x20\\x0auniform\\x20float\\x20fRY2;\\x20\\x0a\\x0avoid\\x20main()\\x0a{\\x0a\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x20\\x20\\x0a\\x0a\\x20\\x20\\x20\\x20vec4\\x20origin1;\\x0a\\x20\\x20\\x20\\x20vec4\\x20origin2;\\x0a\\x20\\x20\\x20\\x20vec4\\x20origin3;\\x0a\\x20\\x20\\x20\\x20vec4\\x20result;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20z1;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20z2;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20z3;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20dnew;\\x0a\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20w;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20h;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fCenterX;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fCenterY;\\x0a\\x20\\x20\\x20\\x20float\\x20\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20w\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x20\\x20\\x20\\x20fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20///<Բ��ʵ������\\x0a\\x20\\x20\\x20\\x20fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x20\\x20\\x20\\x20fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20///<�뾶ʵ�ʳ���\\x0a\\x0a\\x20\\x20\\x20\\x20origin1.s\\x20=\\x20v_uv.s\\x20-\\x200.5;\\x0a\\x20\\x20\\x20\\x20origin1.t\\x20=\\x20v_uv.t\\x20-\\x200.5;\\x0a\\x20\\x20\\x20\\x20z1\\x20=\\x20fZoom\\x20;\\x0a\\x0a\\x20\\x20\\x20\\x20origin2.s\\x20=\\x20origin1.s\\x20;\\x0a\\x20\\x20\\x20\\x20origin2.t\\x20=\\x20(origin1.t*fVAngleCos\\x20+\\x20z1*fVAngleSin);\\x0a\\x20\\x20\\x20\\x20z2\\x20=\\x20z1*fVAngleCos\\x20-\\x20origin1.t*fVAngleSin;\\x0a\\x0a\\x20\\x20\\x20\\x20origin3.s\\x20=\\x20origin2.s*fHAngleCos\\x20+\\x20z2*fHAngleSin\\x20;\\x0a\\x20\\x20\\x20\\x20origin3.t\\x20=\\x20origin2.y;\\x0a\\x20\\x20\\x20\\x20z3\\x20=\\x20z2*fHAngleCos\\x20-\\x20origin2.x*fHAngleSin;\\x0a\\x0a\\x20\\x20\\x20\\x20dnew\\x20=\\x20sqrt(origin3.s*origin3.s\\x20+\\x20origin3.t*origin3.t)\\x20;\\x0a\\x20\\x20\\x20\\x20float\\x20d\\x20=\\x20sqrt(origin3.s*origin3.s\\x20+\\x20origin3.t*origin3.t\\x20+\\x20z3*z3);\\x0a\\x20\\x20\\x20\\x20float\\x20theta\\x20=\\x20asin(dnew/d);\\x0a\\x20\\x20\\x20\\x20float\\x20tmp\\x20=\\x20theta\\x20/\\x201.5707963\\x20*\\x200.5;\\x0a\\x20\\x20\\x20\\x20result.s\\x20=\\x20(tmp*origin3.s\\x20/\\x20dnew\\x20*\\x20fRadius\\x20*\\x202.0\\x20+\\x20fCenterX)/w;\\x0a\\x20\\x20\\x20\\x20result.t\\x20=\\x20(tmp*origin3.t\\x20/\\x20dnew\\x20*\\x20fRadius\\x20*\\x202.0\\x20+\\x20fCenterY)/h;\\x0a\\x0a\\x20\\x20\\x20\\x20r\\x20=\\x20texture2D(texture,\\x20result.st).r;\\x20\\x0a\\x20\\x20\\x20\\x20g\\x20=\\x20texture2D(texture,\\x20result.st).g;\\x20\\x0a\\x20\\x20\\x20\\x20b\\x20=\\x20texture2D(texture,\\x20result.st).b;\\x20\\x0a\\x20\\x20\\x20\\x20if(result.s\\x20>\\x201.0\\x20||\\x20result.t\\x20>\\x201.0\\x20||\\x20result.s\\x20<\\x200.0\\x20||\\x20result.t\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r\\x20,g\\x20,b\\x20,\\x201.0);\\x0a}\\x20\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:_0x29f273=_0x1f462c,_0x1303a3='\\x0a\\x20\\x20\\x20\\x20precision\\x20highp\\x20float;\\x0a\\x20\\x20\\x20\\x20varying\\x20vec2\\x20v_uv;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fAngle;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX1;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX2;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY1;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY2;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x20\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20origin;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20result;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20thetabase;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20d;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterX;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterY;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20w\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20///<圆心实际坐标\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20///<半径实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20fMax\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0\\x20||\\x20fRY2\\x20>\\x201.0\\x20||\\x20fRX1\\x20<\\x200.0\\x20||\\x20fRY1\\x20<\\x200.0)\\x20///<如果不是一个完整的圆\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRX1\\x20*\\x20w;\\x20///<左边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRX2\\x20-\\x201.0)\\x20*\\x20w;\\x20///<右边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRY1\\x20*\\x20h;\\x20///<上边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRY2\\x20-\\x201.0)\\x20*\\x20h;\\x20///<下边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20topCut\\x20=\\x20fMax\\x20/\\x20fRadius;\\x20\\x20///<如果不是一个完整的圆,最终矫正图需要切掉上面无图像部分,否则无需切\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20bottomCut\\x20=\\x200.8;\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20///<为矫正效果,最终矫正图固定切掉下面一部分\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.s\\x20=\\x20v_uv.s;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.t\\x20=\\x20(bottomCut\\x20-\\x20topCut)\\x20*\\x20v_uv.t\\x20+\\x20topCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20thetabase\\x20=\\x206.2831853\\x20*\\x20origin.s\\x20+\\x20fAngle;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20d\\x20=\\x20fRadius\\x20*\\x20(1.0\\x20-\\x20origin.t);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.s\\x20=\\x20(fCenterX\\x20-\\x20d*sin(thetabase))\\x20/\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.t\\x20=\\x20(fCenterY\\x20+\\x20d*cos(thetabase))\\x20/\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x20texture2D(texture,\\x20result.st).r;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x20texture2D(texture,\\x20result.st).g;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x20texture2D(texture,\\x20result.st).b;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(result.s\\x20>\\x201.0\\x20||\\x20result.t\\x20>\\x201.0\\x20||\\x20result.s\\x20<\\x200.0\\x20||\\x20result.t\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r,\\x20g,\\x20b,\\x201.0);\\x0a\\x20\\x20\\x20\\x20}\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']:_0x29f273=_0x1f462c,_0x1303a3='\\x0a\\x20\\x20\\x20\\x20precision\\x20highp\\x20float;\\x0a\\x20\\x20\\x20\\x20varying\\x20vec2\\x20v_uv;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fAngle;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX1;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX2;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY1;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY2;\\x20\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20origin;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20result;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20thetabase;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20d;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20newpp;\\x20\\x20///<180矫正pp纹理坐标的点对应360矫正newpp纹理坐标对应的点\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if\\x20(v_uv.t\\x20\\x20<=\\x200.5)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20newpp.s\\x20=\\x20\\x20v_uv.s\\x20/\\x202.0\\x20+\\x200.5;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20newpp.t\\x20=\\x20\\x20v_uv.t\\x20*\\x202.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20else\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20newpp.s\\x20=\\x20\\x20v_uv.s\\x20/\\x202.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20newpp.t\\x20=\\x20\\x20(v_uv.t\\x20-\\x200.5)\\x20*\\x202.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterX;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterY;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20w\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x20///<圆心实际坐标\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x20///<半径实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20fMax\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0\\x20||\\x20fRY2\\x20>\\x201.0\\x20||\\x20fRX1\\x20<\\x200.0\\x20||\\x20fRY1\\x20<\\x200.0)\\x20///<如果不是一个完整的圆\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRX1\\x20*\\x20w;\\x20///<左边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRX2\\x20-\\x201.0)\\x20*\\x20w;\\x20///<右边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRY1\\x20*\\x20h;\\x20///<上边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRY2\\x20-\\x201.0)\\x20*\\x20h;\\x20///<下边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20topCut\\x20=\\x20fMax\\x20/\\x20fRadius;\\x20\\x20\\x20///<如果不是一个完整的圆,最终矫正图需要切掉上面无图像部分,否则无需切\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20bottomCut\\x20=\\x200.8;\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20///<为矫正效果,最终矫正图固定切掉下面一部分\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.s\\x20=\\x20newpp.s;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.t\\x20=\\x20(bottomCut\\x20-\\x20topCut)\\x20*\\x20newpp.t\\x20+\\x20topCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20thetabase\\x20=\\x206.2831853\\x20*\\x20origin.s\\x20+\\x20fAngle;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20d\\x20=\\x20fRadius\\x20*\\x20(1.0\\x20-\\x20origin.t);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.s\\x20=\\x20(fCenterX\\x20-\\x20d*sin(thetabase))\\x20/\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.t\\x20=\\x20(fCenterY\\x20+\\x20d*cos(thetabase))\\x20/\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x20texture2D(texture,\\x20result.st).r;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x20texture2D(texture,\\x20result.st).g;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x20texture2D(texture,\\x20result.st).b;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(result.s\\x20>\\x201.0\\x20||\\x20result.t\\x20>\\x201.0\\x20||\\x20result.s\\x20<\\x200.0\\x20||\\x20result.t\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r\\x20,g\\x20,b\\x20,\\x201.0);\\x0a\\x20\\x20\\x20\\x20}\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:_0x29f273=_0x1f462c,_0x1303a3='\\x0a\\x20\\x20\\x20\\x20precision\\x20highp\\x20float;\\x0a\\x20\\x20\\x20\\x20varying\\x20vec2\\x20v_uv;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fAngle;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX1;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX2;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY1;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY2;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20origin;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20result;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20thetabase;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20d;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterX;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterY;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20w\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20///<圆心实际坐标\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20///<半径实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20fMax\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0\\x20||\\x20fRY2\\x20>\\x201.0\\x20||\\x20fRX1\\x20<\\x200.0\\x20||\\x20fRY1\\x20<\\x200.0)\\x20///<如果不是一个完整的圆\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRX1\\x20*\\x20w;\\x20///<左边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRX2\\x20-\\x201.0)\\x20*\\x20w;\\x20///<右边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRY1\\x20*\\x20h;\\x20///<上边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRY2\\x20-\\x201.0)\\x20*\\x20h;\\x20///<下边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20topCut\\x20=\\x20fMax\\x20/\\x20fRadius;\\x20\\x20\\x20///<如果不是一个完整的圆,最终矫正图需要切掉上面无图像部分,否则无需切\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20bottomCut\\x20=\\x200.8;\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20///<为矫正效果,最终矫正图固定切掉下面一部分\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.s\\x20=\\x201.0\\x20-\\x20v_uv.s;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.t\\x20=\\x20(bottomCut\\x20-\\x20topCut)\\x20*\\x20(1.0\\x20-\\x20v_uv.t)\\x20+\\x20topCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20thetabase\\x20=\\x206.2831853\\x20*\\x20origin.s\\x20+\\x20fAngle;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20d\\x20=\\x20fRadius\\x20*\\x20(1.0\\x20-\\x20origin.t);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.s\\x20=\\x20(fCenterX\\x20-\\x20d*sin(thetabase))\\x20/\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.t\\x20=\\x20(fCenterY\\x20+\\x20d*cos(thetabase))\\x20/\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x20texture2D(texture,\\x20result.st).r;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x20texture2D(texture,\\x20result.st).g;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x20texture2D(texture,\\x20result.st).b;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(result.s\\x20>\\x201.0\\x20||\\x20result.t\\x20>\\x201.0\\x20||\\x20result.s\\x20<\\x200.0\\x20||\\x20result.t\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r\\x20,g\\x20,b\\x20,\\x201.0);\\x0a\\x20\\x20\\x20\\x20}\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']:_0x29f273=_0x1f462c,_0x1303a3='\\x0a\\x20\\x20\\x20\\x20precision\\x20highp\\x20float;\\x0a\\x20\\x20\\x20\\x20varying\\x20vec2\\x20v_uv;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fAngle;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX1;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX2;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY1;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY2;\\x0a\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20origin;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20result;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20thetabase;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20d;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20newpp;\\x20\\x20///<180矫正pp纹理坐标的点对应360矫正newpp纹理坐标对应的点\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if\\x20(v_uv.t\\x20\\x20<=\\x200.5)\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20newpp.s\\x20=\\x20\\x20v_uv.s\\x20/\\x202.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20newpp.t\\x20=\\x20\\x20v_uv.t\\x20*\\x202.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20else\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20newpp.s\\x20=\\x20\\x20v_uv.s\\x20/\\x202.0\\x20+\\x200.5;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20newpp.t\\x20=\\x20\\x20(v_uv.t\\x20-\\x200.5)\\x20*\\x202.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterX;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterY;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20w\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20///<圆心实际坐标\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x20///<半径实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20fMax\\x20=\\x200.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0\\x20||\\x20fRY2\\x20>\\x201.0\\x20||\\x20fRX1\\x20<\\x200.0\\x20||\\x20fRY1\\x20<\\x200.0)\\x20///<如果不是一个完整的圆\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRX1\\x20*\\x20w;\\x20///<左边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRX2\\x20-\\x201.0)\\x20*\\x20w;\\x20///<右边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRY1\\x20*\\x20h;\\x20///<上边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRY2\\x20-\\x201.0)\\x20*\\x20h;\\x20///<下边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20fMax)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fMax\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20topCut\\x20=\\x20fMax\\x20/\\x20fRadius;\\x20\\x20\\x20///<如果不是一个完整的圆,最终矫正图需要切掉上面无图像部分,否则无需切\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20bottomCut\\x20=\\x200.8;\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20///<为矫正效果,最终矫正图固定切掉下面一部分\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.s\\x20=\\x201.0\\x20-\\x20newpp.s;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.t\\x20=\\x20(bottomCut\\x20-\\x20topCut)\\x20*\\x20(1.0\\x20-\\x20newpp.t)\\x20+\\x20topCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20thetabase\\x20=\\x206.2831853\\x20*\\x20origin.s\\x20+\\x20fAngle;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20d\\x20=\\x20fRadius\\x20*\\x20(1.0\\x20-\\x20origin.t);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.s\\x20=\\x20(fCenterX\\x20-\\x20d*sin(thetabase))\\x20/\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.t\\x20=\\x20(fCenterY\\x20+\\x20d*cos(thetabase))\\x20/\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x20texture2D(texture,\\x20result.st).r;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x20texture2D(texture,\\x20result.st).g;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x20texture2D(texture,\\x20result.st).b;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(result.s\\x20>\\x201.0\\x20||\\x20result.t\\x20>\\x201.0\\x20||\\x20result.s\\x20<\\x200.0\\x20||\\x20result.t\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r\\x20,g\\x20,b\\x20,\\x201.0);\\x0a\\x20\\x20\\x20\\x20}\\x20\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:_0x29f273=_0x1f462c,_0x1303a3='\\x0a\\x20\\x20\\x20\\x20precision\\x20highp\\x20float;\\x0a\\x20\\x20\\x20\\x20varying\\x20vec2\\x20v_uv;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX1;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRX2;\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY1;\\x20\\x0a\\x20\\x20\\x20\\x20uniform\\x20float\\x20fRY2;\\x20\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20void\\x20main()\\x0a\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20r,g,b;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20origin;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20vec4\\x20result;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20d;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterX;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fCenterY;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20w\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20h\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x20(fRY2\\x20-\\x20fRY1);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterX\\x20=\\x20(fRX1\\x20+\\x20fRX2)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x20///<圆心实际坐标\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fCenterY\\x20=\\x20(fRY1\\x20+\\x20fRY2)\\x20/\\x202.0\\x20*\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20fRadius\\x20=\\x20(fRX2\\x20-\\x20fRX1)\\x20/\\x202.0\\x20*\\x20w;\\x20\\x20\\x20\\x20\\x20///<半径实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20defaultTopCut\\x20=\\x200.1;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20defaultBottomCut\\x20=\\x200.9;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20leftCut\\x20=\\x200.0;\\x20\\x20\\x20\\x20///<当图像中圆不完整时需要切掉无图像部分,即使图像完整,为了效果,也要切掉上下固定的一部分\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20rightCut\\x20=\\x201.0;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20topCut\\x20=\\x20defaultTopCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20\\x20bottomCut\\x20=\\x20defaultBottomCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRX1\\x20*\\x20w;\\x20///<左边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20tmp\\x20/\\x20(2.0*fRadius);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20leftCut\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRX2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRX2\\x20-\\x201.0)\\x20*\\x20w;\\x20///<右边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20tmp\\x20/\\x20(2.0*fRadius);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20rightCut\\x20=\\x201.0\\x20-\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY1\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20-fRY1\\x20*\\x20h;\\x20///<上边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20tmp\\x20/\\x20(2.0*fRadius);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x20defaultTopCut)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20topCut\\x20=\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20else\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20topCut\\x20=\\x20defaultTopCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(fRY2\\x20>\\x201.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20(fRY2\\x20-\\x201.0)\\x20*\\x20h;\\x20///<下边超出图像部分最大实际长度\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20tmp\\x20=\\x20tmp\\x20/\\x20(2.0*fRadius);\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(tmp\\x20>\\x201.0\\x20-\\x20defaultBottomCut)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20bottomCut\\x20=\\x201.0\\x20-\\x20tmp;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20else\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20bottomCut\\x20=\\x20defaultBottomCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.s\\x20=\\x20v_uv.s\\x20*\\x20(rightCut-leftCut)\\x20+\\x20leftCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20origin.t\\x20=\\x20v_uv.t\\x20*\\x20(bottomCut-topCut)\\x20+\\x20topCut;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmpx\\x20=\\x20origin.s\\x20*\\x202.0\\x20*\\x20fRadius\\x20+\\x20fCenterX\\x20-\\x20fRadius;\\x20///<纹理坐标转化为原图上的实际坐标\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20float\\x20tmpy\\x20=\\x20origin.t\\x20*\\x202.0\\x20*\\x20fRadius\\x20+\\x20fCenterY\\x20-\\x20fRadius;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20d\\x20=\\x20sqrt(fRadius*fRadius\\x20-\\x20(tmpy-fCenterY)*(tmpy-fCenterY));\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.s\\x20=\\x20((tmpx-fCenterX)\\x20*\\x20d\\x20/\\x20fRadius\\x20+\\x20fCenterX)\\x20/\\x20w;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20result.t\\x20=\\x20tmpy\\x20/\\x20h;\\x0a\\x20\\x20\\x20\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x20texture2D(texture,\\x20result.st).r;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x20texture2D(texture,\\x20result.st).g;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x20texture2D(texture,\\x20result.st).b;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(result.s\\x20>\\x201.0\\x20||\\x20result.t\\x20>\\x201.0\\x20||\\x20result.s\\x20<\\x200.0\\x20||\\x20result.t\\x20<\\x200.0)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20r\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20g\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20b\\x20=\\x200.0;\\x20\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20vec4(r\\x20,g\\x20,b\\x20,\\x201.0);\\x0a\\x20\\x20\\x20\\x20}\\x0a',this['b3DPort']=!0x1;break;case _0x186ff9['SR_DE_FISH_SEMISPHERE']:case _0x186ff9['SR_DE_FISH_CYLINDER_CEILING']:case _0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']:_0x1c4dff==_0x186ff9['SR_DE_FISH_SEMISPHERE']&&(this['bCullBack']=!0x0),_0x29f273='\\x0a\\x20\\x20\\x20\\x20attribute\\x20vec4\\x20xy;\\x0a\\x20\\x20\\x20\\x20attribute\\x20vec2\\x20uv;\\x0a\\x20\\x20\\x20\\x20varying\\x20highp\\x20vec2\\x20v_uv;\\x0a\\x20\\x20\\x20\\x20uniform\\x20int\\x20bCapture;\\x0a\\x0a\\x20\\x20\\x20\\x20uniform\\x20mat4\\x20matProj;\\x0a\\x20\\x20\\x20\\x20uniform\\x20mat4\\x20matView;\\x0a\\x20\\x20\\x20\\x20void\\x20main(void)\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_Position\\x20=\\x20matProj\\x20*\\x20matView\\x20*\\x20xy;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20v_uv\\x20=\\x20uv;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20if(bCapture\\x20==\\x201)\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20v_uv.y\\x20=\\x201.0\\x20-\\x20uv.y;\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20}\\x0a\\x20\\x20\\x20\\x20}\\x0a',_0x1303a3='\\x0a\\x20\\x20\\x20\\x20varying\\x20highp\\x20vec2\\x20v_uv;\\x0a\\x20\\x20\\x20\\x20uniform\\x20sampler2D\\x20texture;\\x0a\\x20\\x20\\x20\\x20void\\x20main(void)\\x20{\\x0a\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20gl_FragColor\\x20=\\x20texture2D(texture,\\x20v_uv);\\x0a\\x20\\x20\\x20\\x20}\\x0a',this['b3DPort']=!0x0;break;default:return _0x86aef9;}var _0x4822c4=this['CompileProgram'](_0x29f273,_0x1303a3);if(_0x4822c4<=0x0)return _0x4d26c0;this['videoShaderProgram']=_0x4822c4;var _0x2e497f=null,_0x2f9f99=null,_0x2e0613=_0xa87ede;if(0x0==this['b3DPort'])_0x2e497f=new Float32Array([-0x1,-0x1,0x0,-0x1,0x1,0x0,0x1,0x1,0x0,0x1,-0x1,0x0]),_0x2f9f99=new Float32Array([0x0,0x1,0x0,0x0,0x1,0x0,0x1,0x1]);else{var _0x21dd60={},_0x8748d5=!0x1;if(null==this['pFishParamManager'])return _0x520965;for(var _0x3c7177=0x0;_0x3c7177<_0x379995;++_0x3c7177)if(_0x3c7177!=_0x30143d&&_0xa87ede==this['pFishParamManager']['GetRenderParam'](_0x3c7177,_0x21dd60)){_0x8748d5=!0x0;break;}var _0x15cab7=0x0,_0x19ebf4=0x1,_0x2e5f56=0x0,_0x4e7ce6=0x1;if(0x1==_0x8748d5&&(_0x15cab7=_0x21dd60['fRXLeft'],_0x19ebf4=_0x21dd60['fRXRight'],_0x2e5f56=_0x21dd60['fRYTop'],_0x4e7ce6=_0x21dd60['fRYBottom']),_0x1c4dff==_0x186ff9['SR_DE_FISH_SEMISPHERE'])_0x2e0613=this['_CreateSemiSphere'](_0x15cab7,_0x19ebf4,_0x2e5f56,_0x4e7ce6),_0x2e497f=this['pSemiSpherePos'],_0x2f9f99=this['pSemiSphereTex'];else{if(_0x1c4dff==_0x186ff9['SR_DE_FISH_CYLINDER_CEILING']||_0x1c4dff==_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR'])_0x2e0613=this['_CreateCylinder'](_0x1c4dff,_0x15cab7,_0x19ebf4,_0x2e5f56,_0x4e7ce6,0x2,0x2),_0x2e497f=this['pCylinderPos'],_0x2f9f99=this['pCylinderTex'];else{if(_0x1c4dff!=_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']&&_0x1c4dff!=_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL'])return _0x86aef9;0x0==_0x8748d5?_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']==_0x1c4dff?(_0x15cab7=0.05,_0x19ebf4=0.95,_0x2e5f56=-0.3,_0x4e7ce6=1.3):_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']==_0x1c4dff&&(_0x15cab7=-0.16,_0x19ebf4=1.16,_0x2e5f56=0.005,_0x4e7ce6=0.995):_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']==_0x1c4dff?(_0x21dd60['fRYTop']>0x0||_0x21dd60['fRYBottom']<0x1)&&(_0x15cab7=0.05,_0x19ebf4=0.95,_0x2e5f56=-0.3,_0x4e7ce6=1.3):_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']==_0x1c4dff&&(_0x21dd60['fRXLeft']>0x0||_0x21dd60['fRXRight']<0x1)&&(_0x15cab7=-0.16,_0x19ebf4=1.16,_0x2e5f56=0.005,_0x4e7ce6=0.995),_0x2e0613=this['_CreateArcSphere'](_0x1c4dff,_0x15cab7,_0x19ebf4,_0x2e5f56,_0x4e7ce6),_0x2e497f=this['pArcSpherePos'],_0x2f9f99=this['pArcSphereTex'];}}if(_0x2e0613!=_0xa87ede)return _0x2e0613;var _0x20506b={};if((_0x2e0613=this['pFishParamManager']['GetFishParam'](this['nFECPort'],_0x20506b))!=_0xa87ede)return _0x2e0613;if(_0x20506b['nFishParamType']=_0x392c27,_0x20506b['fRXLeft']=_0x15cab7,_0x20506b['fRXRight']=_0x19ebf4,_0x20506b['fRYTop']=_0x2e5f56,_0x20506b['fRYBottom']=_0x4e7ce6,this['pFishParamManager']['SetFishParam'](this['nFECPort'],_0x20506b),_0x2e0613!=_0xa87ede)return _0x2e0613;}if(null==_0x2e497f||null==_0x2f9f99)return _0x86aef9;var _0xc42bb=this['ctx']['createBuffer']();this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],_0xc42bb),this['ctx']['bufferData'](this['ctx']['ARRAY_BUFFER'],_0x2e497f,this['ctx']['STATIC_DRAW']),this['vertexPosBuffer']=_0xc42bb;var _0x116e2e=this['ctx']['createBuffer']();return this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],_0x116e2e),this['ctx']['bufferData'](this['ctx']['ARRAY_BUFFER'],_0x2f9f99,this['ctx']['STATIC_DRAW']),this['texturePosBuffer']=_0x116e2e,this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),0x0==this['b3DPort']&&(_0x2e497f=null,_0x2f9f99=null),_0x2e0613=this['InitCamera'](_0x1c4dff),_0xa87ede!=_0x2e0613?_0x2e0613:(this['enDisplayEffect']=_0x1c4dff,this['nFECPort']);}},{'key':'SR_DelSubPort','value':function(_0x431502){return null==this['ctx']?_0x520965:(null!=this['pFishParamManager']&&this['nFECPort']==_0x431502&&this['pFishParamManager']['FreeFECPort'](this['nFECPort']),this['enDisplayEffect']=_0x186ff9['SR_DE_NULL'],0x0!=this['videoShaderProgram']&&null!=this['ctx']&&(this['ctx']['deleteProgram'](this['videoShaderProgram']),this['videoShaderProgram']=0x0),0x0!=this['vertexPosBuffer']&&null!=this['ctx']&&(this['ctx']['deleteBuffer'](this['vertexPosBuffer']),this['vertexPosBuffer']=0x0),0x0!=this['texturePosBuffer']&&null!=this['ctx']&&(this['ctx']['deleteBuffer'](this['texturePosBuffer']),this['texturePosBuffer']=0x0),this['nMaxPointNum']=0x0,this['pLinePosVertices']=null,this['pLineClrVertices']=null,0x0!=this['glLinePosBuffer']&&null!=this['ctx']&&(this['ctx']['deleteBuffer'](this['glLinePosBuffer']),this['glLinePosBuffer']=0x0),0x0!=this['glLineTexBuffer']&&null!=this['ctx']&&(this['ctx']['deleteBuffer'](this['glLineTexBuffer']),this['glLineTexBuffer']=0x0),this['nLineTriangleNum']=0x0,0x0!=this['nLineShaderProgram']&&null!=this['ctx']&&(this['ctx']['deleteProgram'](this['nLineShaderProgram']),this['nLineShaderProgram']=0x0),this['pFillBlockPosVertices']=null,this['pFillBlockClrVertices']=null,this['nMaxFillBlockTriNum']=0x0,0x0!=this['glBlockPosBuffer']&&null!=this['ctx']&&(this['ctx']['deleteBuffer'](this['glBlockPosBuffer']),this['glBlockPosBuffer']=0x0),0x0!=this['glBlockClrBuffer']&&null!=this['ctx']&&(this['ctx']['deleteBuffer'](this['glBlockClrBuffer']),this['glBlockClrBuffer']=0x0),0x0!=this['nBlockShaderProgram']&&null!=this['ctx']&&(this['ctx']['deleteProgram'](this['nBlockShaderProgram']),this['nBlockShaderProgram']=0x0),this['nDrawFontWidth']=0x0,this['nDrawFontHeight']=0x0,0x0!=this['nFontColorTexture']&&null!=this['ctx']&&(this['ctx']['deleteTexture'](this['nFontColorTexture']),this['nFontColorTexture']=0x0),this['pFontColorBuffer']=0x0,0x0!=this['nFontShaderProgram']&&null!=this['ctx']&&(this['ctx']['deleteProgram'](this['nFontShaderProgram']),this['nFontShaderProgram']=0x0),0x0!=this['nCaptureRTTex']&&(this['ctx']['deleteTexture'](this['nCaptureRTTex']),this['nCaptureRTTex']=0x0),0x0!=this['nCaptureFBO']&&(this['ctx']['deleteFramebuffer'](this['nCaptureFBO']),this['nCaptureFBO']=0x0),0x0!=this['nCaptureDepthbuffer']&&(this['ctx']['deleteRenderbuffer'](this['nCaptureDepthbuffer']),this['nCaptureDepthbuffer']=0x0),this['bCaptureResInit']=!0x1,this['pSemiSpherePos']=null,this['pSemiSphereTex']=null,this['nSemiSpherePosNum']=0x0,this['nSemiSpherePosSize']=0x0,this['nSemiSphereTexSize']=0x0,this['pCylinderPos']=null,this['pCylinderTex']=null,this['nCylinderPosNum']=0x0,this['nCylinderPosSize']=0x0,this['nCylinderTexSize']=0x0,this['fCylinderHeight']=0x0,this['fCylinderRadius']=0x0,this['pArcSpherePos']=null,this['pArcSphereTex']=null,this['nArcSpherePosNum']=0x0,this['nArcSpherePosSize']=0x0,this['nArcSphereTexSize']=0x0,this['b3DPort']=!0x1,this['pCamera']=null,this['fRotateX']=0x0,this['fRotateY']=0x0,this['fScale']=0x0,this['pfuncCBIn']=null,this['pfuncCBOut']=null,this['pUserIn']=null,this['pUserOut']=null,this['ctx']['disable'](this['ctx']['CULL_FACE']),this['ctx']['disable'](this['ctx']['DEPTH_TEST']),_0xa87ede);}},{'key':'SR_GetFishParam','value':function(_0x5ba2c1){return null==_0x5ba2c1?_0x31ddcf:null==this['pFishParamManager']?_0x520965:this['pFishParamManager']['GetFishParam'](this['nFECPort'],_0x5ba2c1);}},{'key':'SR_SetFishParam','value':function(_0x231728){return null==_0x231728?_0x31ddcf:null==this['pFishParamManager']?_0x520965:this['pFishParamManager']['SetFishParam'](this['nFECPort'],_0x231728);}},{'key':'SR_SetDisplayRect','value':function(_0x55eb5a,_0x1c555c,_0x1e932c,_0x799fda,_0x1b6d8f){if(null==this['ctx'])return _0x520965;var _0x41f710=_0x55eb5a,_0x5590bb=_0x1c555c,_0x536b65=_0x55eb5a+_0x1e932c,_0x1e96da=_0x1c555c+_0x799fda,_0x5d50c7=null,_0x135ea7=null;switch(_0x1b6d8f){case _0xe9e464:if(this['frameDisplayWidth']>0x0&&this['frameDisplayHeight']>0x0){if(this['fSrcUseLeft']=_0x41f710/this['frameDisplayWidth'],this['fSrcUseLeft']<0x0?this['fSrcUseLeft']=0x0:this['fSrcUseLeft']>0x1&&(this['fSrcUseLeft']=0x1),this['fSrcUseTop']=_0x5590bb/this['frameDisplayHeight'],this['fSrcUseTop']<0x0?this['fSrcUseTop']=0x0:this['fSrcUseTop']>0x1&&(this['fSrcUseTop']=0x1),this['fSrcUseRight']=_0x536b65/this['frameDisplayWidth'],this['fSrcUseRight']<0x0?this['fSrcUseRight']=0x0:this['fSrcUseRight']>0x1&&(this['fSrcUseRight']=0x1),this['fSrcUseBottom']=_0x1e96da/this['frameDisplayHeight'],this['fSrcUseBottom']<0x0?this['fSrcUseBottom']=0x0:this['fSrcUseBottom']>0x1&&(this['fSrcUseBottom']=0x1),this['fSrcUseLeft']>=this['fSrcUseRight']||this['fSrcUseTop']>=this['fSrcUseBottom'])return _0x31ddcf;_0x5d50c7=new Float32Array([this['fSrcUseLeft'],this['fSrcUseBottom'],this['fSrcUseLeft'],this['fSrcUseTop'],this['fSrcUseRight'],this['fSrcUseTop'],this['fSrcUseRight'],this['fSrcUseBottom']]);}else _0x5d50c7=new Float32Array([0x0,0x1,0x0,0x0,0x1,0x0,0x1,0x1]);this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['texturePosBuffer']),this['ctx']['bufferSubData'](this['ctx']['ARRAY_BUFFER'],0x0,_0x5d50c7),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),_0x5d50c7=null;break;case _0x206403:if(this['frameDisplayWidth']>0x0&&this['frameDisplayHeight']>0x0){if(this['fDstUseLeft']=_0x41f710/this['frameDisplayWidth'],this['fDstUseLeft']<0x0?this['fDstUseLeft']=0x0:this['fDstUseLeft']>0x1&&(this['fDstUseLeft']=0x1),this['fDstUseTop']=_0x5590bb/this['frameDisplayHeight'],this['fDstUseTop']<0x0?this['fDstUseTop']=0x0:this['fDstUseTop']>0x1&&(this['fDstUseTop']=0x1),this['fDstUseRight']=_0x536b65/this['frameDisplayWidth'],this['fDstUseRight']<0x0?this['fDstUseRight']=0x0:this['fDstUseRight']>0x1&&(this['fDstUseRight']=0x1),this['fDstUseBottom']=_0x1e96da/this['frameDisplayHeight'],this['fDstUseBottom']<0x0?this['fDstUseBottom']=0x0:this['fDstUseBottom']>0x1&&(this['fDstUseBottom']=0x1),this['fDstUseLeft']>=this['fDstUseRight']||this['fDstUseTop']>=this['fDstUseBottom'])return _0x31ddcf;(_0x135ea7=new Float32Array(0xc))[0x0]=0x2*this['fDstUseLeft']-0x1,_0x135ea7[0x1]=0x1-0x2*this['fDstUseBottom'],_0x135ea7[0x2]=0x0,_0x135ea7[0x3]=0x2*this['fDstUseLeft']-0x1,_0x135ea7[0x4]=0x1-0x2*this['fDstUseTop'],_0x135ea7[0x5]=0x0,_0x135ea7[0x6]=0x2*this['fDstUseRight']-0x1,_0x135ea7[0x7]=0x1-0x2*this['fDstUseTop'],_0x135ea7[0x8]=0x0,_0x135ea7[0x9]=0x2*this['fDstUseRight']-0x1,_0x135ea7[0xa]=0x1-0x2*this['fDstUseBottom'],_0x135ea7[0xb]=0x0,this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['vertexPosBuffer']),this['ctx']['bufferSubData'](this['ctx']['ARRAY_BUFFER'],0x0,_0x135ea7),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null),_0x135ea7=null;}break;default:return _0x86aef9;}return _0xa87ede;}},{'key':'SR_Destroy','value':function(){if(null==this['ctx'])return _0x520965;this['frameDisplayWidth']=0x0,this['frameDisplayHeight']=0x0,this['pFrameData']=null;for(var _0x45dbcd=0x0;_0x45dbcd<this['nTextureNum'];_0x45dbcd++)0x0!=this['nSurfaceTexture'][_0x45dbcd]&&null!=this['ctx']&&(this['ctx']['deleteTexture'](this['nSurfaceTexture'][_0x45dbcd]),this['nSurfaceTexture'][_0x45dbcd]=0x0);return this['SR_DelSubPort'](this['nFECPort']),this['ctx']['getExtension']('WEBGL_lose_context')['loseContext'](),this['ctx']=null,this['onlySupportedWebGL1']=!0x1,this['bAntialias']=!0x1,this['bRecreateTex']=!0x0,this['pFishParamManager']=null,_0xa87ede;}},{'key':'SR_SetCanvasSize','value':function(_0x270c96,_0x520a5b){return this['canvas']['width']=_0x270c96,this['canvas']['height']=_0x520a5b,_0xa87ede;}},{'key':'SR_GetCanvasSize','value':function(){return console['log']('canvas\\x20width:'+this['canvas']['width']+',height:'+this['canvas']['height']),_0xa87ede;}},{'key':'SR_SetAntialias','value':function(_0x3f93ac){return 0x1==this['onlySupportedWebGL1']?_0x86aef9:(this['bAntialias']!=_0x3f93ac&&(this['bRecreateTex']=!0x0,this['bAntialias']=_0x3f93ac),_0xa87ede);}},{'key':'SR_SetPTZDisplayMode','value':function(_0x56d449){return null==this['pFishParamManager']?_0x520965:this['pFishParamManager']['SetPTZDisplayMode'](_0x56d449);}},{'key':'SR_SetFishParamManager','value':function(_0x52f915){return null!=this['pFishParamManager']?_0x86aef9:(this['pFishParamManager']=_0x52f915,_0xa87ede);}},{'key':'_CreateSemiSphere','value':function(_0x13c3d3,_0x3c0eef,_0xfcb7c8,_0x4b4979){if(null!=this['pSemiSpherePos']||null!=this['pSemiSphereTex'])return _0x520965;this['pSemiSpherePos']=new Float32Array(0xa8c0),this['pSemiSphereTex']=new Float32Array(0x7080);for(var _0x306be6=(_0x3c0eef-_0x13c3d3)/(_0x4b4979-_0xfcb7c8),_0x115894=(_0x3c0eef-_0x13c3d3)/0x2*0x1,_0x18964f=6.2831852/0x3c,_0x399e01=0.0392699075,_0x29408f=0x0,_0xa1b95a=0x0,_0x190a15=0x0,_0x2823ad=0x0;_0x2823ad<0x3c;++_0x2823ad)for(var _0x305025=0x0;_0x305025<0x28;++_0x305025){var _0x55b496=_0x2823ad*_0x18964f;0x0==_0x2823ad&&(_0x29408f=_0x55b496);var _0x163c07=0x3b==_0x2823ad?_0x29408f:(_0x2823ad+0x1)*_0x18964f,_0x38fa2b=-_0x305025*_0x399e01,_0x33daa7=-(_0x305025+0x1)*_0x399e01,_0x461f11=void 0x0,_0x4105f8=void 0x0;this['pSemiSpherePos'][_0xa1b95a]=-0x1*Math['cos'](_0x38fa2b)*Math['cos'](_0x55b496),this['pSemiSpherePos'][_0xa1b95a+0x1]=0x1*Math['sin'](_0x38fa2b),this['pSemiSpherePos'][_0xa1b95a+0x2]=-0x1*Math['cos'](_0x38fa2b)*Math['sin'](_0x55b496),_0x4105f8=0.5-0.5*(0x1+_0x38fa2b/1.5707963)*Math['sin'](_0x55b496),_0x461f11=0.5-0.5*(0x1+_0x38fa2b/1.5707963)*Math['cos'](_0x55b496),this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x461f11*_0x115894+0x1*_0x13c3d3)/0x1,this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x4105f8*_0x115894+_0xfcb7c8*_0x306be6)/_0x306be6,_0xa1b95a+=0x3,this['pSemiSpherePos'][_0xa1b95a]=-0x1*Math['cos'](_0x33daa7)*Math['cos'](_0x55b496),this['pSemiSpherePos'][_0xa1b95a+0x1]=0x1*Math['sin'](_0x33daa7),this['pSemiSpherePos'][_0xa1b95a+0x2]=-0x1*Math['cos'](_0x33daa7)*Math['sin'](_0x55b496),_0x4105f8=0.5-0.5*(0x1+_0x33daa7/1.5707963)*Math['sin'](_0x55b496),_0x461f11=0.5-0.5*(0x1+_0x33daa7/1.5707963)*Math['cos'](_0x55b496),this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x461f11*_0x115894+0x1*_0x13c3d3)/0x1,this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x4105f8*_0x115894+_0xfcb7c8*_0x306be6)/_0x306be6,_0xa1b95a+=0x3,this['pSemiSpherePos'][_0xa1b95a]=-0x1*Math['cos'](_0x38fa2b)*Math['cos'](_0x163c07),this['pSemiSpherePos'][_0xa1b95a+0x1]=0x1*Math['sin'](_0x38fa2b),this['pSemiSpherePos'][_0xa1b95a+0x2]=-0x1*Math['cos'](_0x38fa2b)*Math['sin'](_0x163c07),_0x4105f8=0.5-0.5*(0x1+_0x38fa2b/1.5707963)*Math['sin'](_0x163c07),_0x461f11=0.5-0.5*(0x1+_0x38fa2b/1.5707963)*Math['cos'](_0x163c07),this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x461f11*_0x115894+0x1*_0x13c3d3)/0x1,this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x4105f8*_0x115894+_0xfcb7c8*_0x306be6)/_0x306be6,_0xa1b95a+=0x3,this['pSemiSpherePos'][_0xa1b95a]=-0x1*Math['cos'](_0x38fa2b)*Math['cos'](_0x163c07),this['pSemiSpherePos'][_0xa1b95a+0x1]=0x1*Math['sin'](_0x38fa2b),this['pSemiSpherePos'][_0xa1b95a+0x2]=-0x1*Math['cos'](_0x38fa2b)*Math['sin'](_0x163c07),_0x4105f8=0.5-0.5*(0x1+_0x38fa2b/1.5707963)*Math['sin'](_0x163c07),_0x461f11=0.5-0.5*(0x1+_0x38fa2b/1.5707963)*Math['cos'](_0x163c07),this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x461f11*_0x115894+0x1*_0x13c3d3)/0x1,this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x4105f8*_0x115894+_0xfcb7c8*_0x306be6)/_0x306be6,_0xa1b95a+=0x3,this['pSemiSpherePos'][_0xa1b95a]=-0x1*Math['cos'](_0x33daa7)*Math['cos'](_0x55b496),this['pSemiSpherePos'][_0xa1b95a+0x1]=0x1*Math['sin'](_0x33daa7),this['pSemiSpherePos'][_0xa1b95a+0x2]=-0x1*Math['cos'](_0x33daa7)*Math['sin'](_0x55b496),_0x4105f8=0.5-0.5*(0x1+_0x33daa7/1.5707963)*Math['sin'](_0x55b496),_0x461f11=0.5-0.5*(0x1+_0x33daa7/1.5707963)*Math['cos'](_0x55b496),this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x461f11*_0x115894+0x1*_0x13c3d3)/0x1,this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x4105f8*_0x115894+_0xfcb7c8*_0x306be6)/_0x306be6,_0xa1b95a+=0x3,this['pSemiSpherePos'][_0xa1b95a]=-0x1*Math['cos'](_0x33daa7)*Math['cos'](_0x163c07),this['pSemiSpherePos'][_0xa1b95a+0x1]=0x1*Math['sin'](_0x33daa7),this['pSemiSpherePos'][_0xa1b95a+0x2]=-0x1*Math['cos'](_0x33daa7)*Math['sin'](_0x163c07),_0x4105f8=0.5-0.5*(0x1+_0x33daa7/1.5707963)*Math['sin'](_0x163c07),_0x461f11=0.5-0.5*(0x1+_0x33daa7/1.5707963)*Math['cos'](_0x163c07),this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x461f11*_0x115894+0x1*_0x13c3d3)/0x1,this['pSemiSphereTex'][_0x190a15++]=(0x2*_0x4105f8*_0x115894+_0xfcb7c8*_0x306be6)/_0x306be6,_0xa1b95a+=0x3;}return this['nSemiSpherePosNum']=_0xa1b95a/0x3,this['nSemiSpherePosSize']=0x3,this['nSemiSphereTexSize']=0x2,_0xa87ede;}},{'key':'_CreateCylinder','value':function(_0x44cf2d,_0x21ffe7,_0x381786,_0x4528b6,_0x2f5aa3,_0x739606,_0x3b790c){if(null!=this['pCylinderPos']||null!=this['pCylinderTex'])return _0x520965;if(Math['abs'](_0x739606-0x0)<_0x4a23c6)this['fCylinderHeight']=0x2;else{if(_0x739606<0.5||_0x739606>0x6)return _0x31ddcf;this['fCylinderHeight']=_0x739606;}if(Math['abs'](_0x3b790c-0x0)<_0x4a23c6)this['fCylinderRadius']=_0x44cf2d==_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']||_0x44cf2d==_0x186ff9['SR_DE_FISH_CYLINDER_CEILING']?0x2:0x1;else{if(_0x3b790c<0.5||_0x3b790c>0x4)return _0x31ddcf;this['fCylinderRadius']=_0x3b790c;}if(this['pCylinderPos']=new Float32Array(0xa8c0),this['pCylinderTex']=new Float32Array(0x7080),null==this['pCylinderPos']||null==this['pCylinderTex'])return this['pCylinderPos']=null,this['pCylinderTex']=null,_0x3d12cf;for(var _0xcbf3c9=(_0x381786-_0x21ffe7)/(_0x2f5aa3-_0x4528b6),_0x48eb5f=(_0x381786-_0x21ffe7)/0x2*0x1,_0x5485a5=6.2831852/0x3c,_0x26550d=this['fCylinderHeight']/_0x40743d,_0xc19360=0x0,_0xcec4ef=0x0,_0x48d549=0x0;_0x48d549<0x3c;++_0x48d549)for(var _0x481b39=0x0;_0x481b39<_0x40743d;++_0x481b39){var _0x4f2b3f=_0x48d549*_0x5485a5,_0x788b55=(_0x48d549+0x1)*_0x5485a5,_0x23966a=void 0x0,_0xda562b=void 0x0;this['pCylinderPos'][_0xc19360]=-this['fCylinderRadius']*Math['sin'](_0x4f2b3f),this['pCylinderPos'][_0xc19360+0x1]=this['fCylinderHeight']/0x2-_0x481b39*_0x26550d,this['pCylinderPos'][_0xc19360+0x2]=-this['fCylinderRadius']*Math['cos'](_0x4f2b3f),_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']==_0x44cf2d||_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']==_0x44cf2d?(_0x23966a=0.5+(0.1+0.01*_0x481b39)*Math['sin'](_0x4f2b3f),_0xda562b=0.5+(0.1+0.01*_0x481b39)*Math['cos'](_0x4f2b3f)):(_0x23966a=0.5-(0.5-0.01*_0x481b39)*Math['sin'](_0x4f2b3f),_0xda562b=0.5+(0.5-0.01*_0x481b39)*Math['cos'](_0x4f2b3f)),this['pCylinderTex'][_0xcec4ef++]=(0x2*_0x23966a*_0x48eb5f+0x1*_0x21ffe7)/0x1,this['pCylinderTex'][_0xcec4ef++]=(0x2*_0xda562b*_0x48eb5f+_0x4528b6*_0xcbf3c9)/_0xcbf3c9,_0xc19360+=0x3,this['pCylinderPos'][_0xc19360]=-this['fCylinderRadius']*Math['sin'](_0x4f2b3f),this['pCylinderPos'][_0xc19360+0x1]=this['fCylinderHeight']/0x2-(_0x481b39+0x1)*_0x26550d,this['pCylinderPos'][_0xc19360+0x2]=-this['fCylinderRadius']*Math['cos'](_0x4f2b3f),_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']==_0x44cf2d||_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']==_0x44cf2d?(_0x23966a=0.5+(0.1+0.01*(_0x481b39+0x1))*Math['sin'](_0x4f2b3f),_0xda562b=0.5+(0.1+0.01*(_0x481b39+0x1))*Math['cos'](_0x4f2b3f)):(_0x23966a=0.5-(0.5-0.01*(_0x481b39+0x1))*Math['sin'](_0x4f2b3f),_0xda562b=0.5+(0.5-0.01*(_0x481b39+0x1))*Math['cos'](_0x4f2b3f)),this['pCylinderTex'][_0xcec4ef++]=(0x2*_0x23966a*_0x48eb5f+0x1*_0x21ffe7)/0x1,this['pCylinderTex'][_0xcec4ef++]=(0x2*_0xda562b*_0x48eb5f+_0x4528b6*_0xcbf3c9)/_0xcbf3c9,_0xc19360+=0x3,this['pCylinderPos'][_0xc19360]=-this['fCylinderRadius']*Math['sin'](_0x788b55),this['pCylinderPos'][_0xc19360+0x1]=this['fCylinderHeight']/0x2-_0x481b39*_0x26550d,this['pCylinderPos'][_0xc19360+0x2]=-this['fCylinderRadius']*Math['cos'](_0x788b55),_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']==_0x44cf2d||_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']==_0x44cf2d?(_0x23966a=0.5+(0.1+0.01*_0x481b39)*Math['sin'](_0x788b55),_0xda562b=0.5+(0.1+0.01*_0x481b39)*Math['cos'](_0x788b55)):(_0x23966a=0.5-(0.5-0.01*_0x481b39)*Math['sin'](_0x788b55),_0xda562b=0.5+(0.5-0.01*_0x481b39)*Math['cos'](_0x788b55)),this['pCylinderTex'][_0xcec4ef++]=(0x2*_0x23966a*_0x48eb5f+0x1*_0x21ffe7)/0x1,this['pCylinderTex'][_0xcec4ef++]=(0x2*_0xda562b*_0x48eb5f+_0x4528b6*_0xcbf3c9)/_0xcbf3c9,_0xc19360+=0x3,this['pCylinderPos'][_0xc19360]=-this['fCylinderRadius']*Math['sin'](_0x788b55),this['pCylinderPos'][_0xc19360+0x1]=this['fCylinderHeight']/0x2-_0x481b39*_0x26550d,this['pCylinderPos'][_0xc19360+0x2]=-this['fCylinderRadius']*Math['cos'](_0x788b55),_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']==_0x44cf2d||_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']==_0x44cf2d?(_0x23966a=0.5+(0.1+0.01*_0x481b39)*Math['sin'](_0x788b55),_0xda562b=0.5+(0.1+0.01*_0x481b39)*Math['cos'](_0x788b55)):(_0x23966a=0.5-(0.5-0.01*_0x481b39)*Math['sin'](_0x788b55),_0xda562b=0.5+(0.5-0.01*_0x481b39)*Math['cos'](_0x788b55)),this['pCylinderTex'][_0xcec4ef++]=(0x2*_0x23966a*_0x48eb5f+0x1*_0x21ffe7)/0x1,this['pCylinderTex'][_0xcec4ef++]=(0x2*_0xda562b*_0x48eb5f+_0x4528b6*_0xcbf3c9)/_0xcbf3c9,_0xc19360+=0x3,this['pCylinderPos'][_0xc19360]=-this['fCylinderRadius']*Math['sin'](_0x4f2b3f),this['pCylinderPos'][_0xc19360+0x1]=this['fCylinderHeight']/0x2-(_0x481b39+0x1)*_0x26550d,this['pCylinderPos'][_0xc19360+0x2]=-this['fCylinderRadius']*Math['cos'](_0x4f2b3f),_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']==_0x44cf2d||_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']==_0x44cf2d?(_0x23966a=0.5+(0.1+0.01*(_0x481b39+0x1))*Math['sin'](_0x4f2b3f),_0xda562b=0.5+(0.1+0.01*(_0x481b39+0x1))*Math['cos'](_0x4f2b3f)):(_0x23966a=0.5-(0.5-0.01*(_0x481b39+0x1))*Math['sin'](_0x4f2b3f),_0xda562b=0.5+(0.5-0.01*(_0x481b39+0x1))*Math['cos'](_0x4f2b3f)),this['pCylinderTex'][_0xcec4ef++]=(0x2*_0x23966a*_0x48eb5f+0x1*_0x21ffe7)/0x1,this['pCylinderTex'][_0xcec4ef++]=(0x2*_0xda562b*_0x48eb5f+_0x4528b6*_0xcbf3c9)/_0xcbf3c9,_0xc19360+=0x3,this['pCylinderPos'][_0xc19360]=-this['fCylinderRadius']*Math['sin'](_0x788b55),this['pCylinderPos'][_0xc19360+0x1]=this['fCylinderHeight']/0x2-(_0x481b39+0x1)*_0x26550d,this['pCylinderPos'][_0xc19360+0x2]=-this['fCylinderRadius']*Math['cos'](_0x788b55),_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']==_0x44cf2d||_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']==_0x44cf2d?(_0x23966a=0.5+(0.1+0.01*(_0x481b39+0x1))*Math['sin'](_0x788b55),_0xda562b=0.5+(0.1+0.01*(_0x481b39+0x1))*Math['cos'](_0x788b55)):(_0x23966a=0.5-(0.5-0.01*(_0x481b39+0x1))*Math['sin'](_0x788b55),_0xda562b=0.5+(0.5-0.01*(_0x481b39+0x1))*Math['cos'](_0x788b55)),this['pCylinderTex'][_0xcec4ef++]=(0x2*_0x23966a*_0x48eb5f+0x1*_0x21ffe7)/0x1,this['pCylinderTex'][_0xcec4ef++]=(0x2*_0xda562b*_0x48eb5f+_0x4528b6*_0xcbf3c9)/_0xcbf3c9,_0xc19360+=0x3;}return this['nCylinderPosNum']=_0xc19360/0x3,this['nCylinderPosSize']=0x3,this['nCylinderTexSize']=0x2,_0xa87ede;}},{'key':'_CreateArcSphere','value':function(_0x17b8f4,_0x5a4278,_0x5e025d,_0x4a61b7,_0x3a8181){if(null!=this['pArcSpherePos']||null!=this['pArcSphereTex'])return _0x520965;if(_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']){if(_0x4a61b7>0x0||_0x3a8181<0x1)return SR_ERR_PARAM;}else{if(_0x17b8f4!=_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL'])return _0x86aef9;if(_0x5a4278>0x0||_0x5e025d<0x1)return SR_ERR_PARAM;}this['fImageWidth']=0x1,this['fImageHeight']=(_0x5e025d-_0x5a4278)/(_0x3a8181-_0x4a61b7),this['fTexCenterX']=(_0x5a4278+_0x5e025d)/0x2*this['fImageWidth'],this['fTexCenterY']=(_0x4a61b7+_0x3a8181)/0x2*this['fImageHeight'],this['fTexRadius']=(_0x5e025d-_0x5a4278)/0x2*this['fImageWidth'];var _0x32c935=0x19;if(null==this['pArcSphereTex']&&(this['pArcSphereTex']=new Float32Array(0x3960),null==this['pArcSphereTex']))return _0x3d12cf;if(null==this['pArcSpherePos']&&(this['pArcSpherePos']=new Float32Array(0x5610),null==this['pArcSpherePos']))return _0x3d12cf;var _0x9aa956=new Float32Array(0x40);if(null==_0x9aa956)return _0x3d12cf;var _0x16db8c=_0xa87ede;if(_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?_0x16db8c=this['_ComputeLatitudeHorizontal'](_0x9aa956,_0x32c935,0x28,0x1):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&(_0x16db8c=this['_ComputeLatitudeVertical'](_0x9aa956,_0x32c935,0x28,0x1)),_0xa87ede!=_0x16db8c)return this['pArcSpherePos']=null,this['pArcSphereTex']=null,_0x16db8c;this['fFirstLatitude']=_0x9aa956[0xc],this['fLastLatitude']=_0x9aa956[0x33];var _0x57502c=0x0,_0x5595c4=0x0,_0x5f4e16=new Float32Array(0x5);if(null==_0x5f4e16)return this['pArcSpherePos']=null,this['pArcSphereTex']=null,_0x3d12cf;for(var _0x2de16a=_0x530a52/0x18,_0x4431c2=-0xc;_0x4431c2<0xc;++_0x4431c2)for(var _0x27ba1b=_0x4431c2<0x0?-_0x4431c2:_0x4431c2,_0x2ade6b=_0x4431c2<0x0?_0x27ba1b:_0x27ba1b+0x1,_0x495f79=_0x4431c2<0x0?0x40-0x2*(_0x27ba1b-0x1)-0x2:0x40-0x2*_0x27ba1b-0x2,_0x123bfe=0x0;_0x123bfe<_0x495f79;++_0x123bfe,++_0x2ade6b)_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?this['_ComputeVertexAndTexturePosHorizontal'](0x1,1.5707963-_0x2de16a*_0x4431c2,_0x9aa956[_0x2ade6b],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&this['_ComputeVertexAndTexturePosVertical'](0x1,1.5707963-_0x2de16a*_0x4431c2,_0x9aa956[_0x2ade6b],_0x5f4e16),this['pArcSpherePos'][_0x57502c]=_0x5f4e16[0x0],this['pArcSpherePos'][_0x57502c+0x1]=_0x5f4e16[0x1],this['pArcSpherePos'][_0x57502c+0x2]=_0x5f4e16[0x2],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x3],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x4],_0x57502c+=0x3,_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?this['_ComputeVertexAndTexturePosHorizontal'](0x1,1.5707963-_0x2de16a*(_0x4431c2+0x1),_0x9aa956[_0x2ade6b],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&this['_ComputeVertexAndTexturePosVertical'](0x1,1.5707963-_0x2de16a*(_0x4431c2+0x1),_0x9aa956[_0x2ade6b],_0x5f4e16),this['pArcSpherePos'][_0x57502c]=_0x5f4e16[0x0],this['pArcSpherePos'][_0x57502c+0x1]=_0x5f4e16[0x1],this['pArcSpherePos'][_0x57502c+0x2]=_0x5f4e16[0x2],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x3],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x4],_0x57502c+=0x3,_0x4431c2>=0x0&&0x0==_0x123bfe?_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?this['_ComputeVertexAndTexturePosHorizontal'](0x1,1.5707963-_0x2de16a*_0x4431c2,_0x9aa956[_0x2ade6b-0x1],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&this['_ComputeVertexAndTexturePosVertical'](0x1,1.5707963-_0x2de16a*_0x4431c2,_0x9aa956[_0x2ade6b-0x1],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?this['_ComputeVertexAndTexturePosHorizontal'](0x1,1.5707963-_0x2de16a*(_0x4431c2+0x1),_0x9aa956[_0x2ade6b-0x1],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&this['_ComputeVertexAndTexturePosVertical'](0x1,1.5707963-_0x2de16a*(_0x4431c2+0x1),_0x9aa956[_0x2ade6b-0x1],_0x5f4e16),this['pArcSpherePos'][_0x57502c]=_0x5f4e16[0x0],this['pArcSpherePos'][_0x57502c+0x1]=_0x5f4e16[0x1],this['pArcSpherePos'][_0x57502c+0x2]=_0x5f4e16[0x2],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x3],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x4],_0x57502c+=0x3,_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?this['_ComputeVertexAndTexturePosHorizontal'](0x1,1.5707963-_0x2de16a*(_0x4431c2+0x1),_0x9aa956[_0x2ade6b],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&this['_ComputeVertexAndTexturePosVertical'](0x1,1.5707963-_0x2de16a*(_0x4431c2+0x1),_0x9aa956[_0x2ade6b],_0x5f4e16),this['pArcSpherePos'][_0x57502c]=_0x5f4e16[0x0],this['pArcSpherePos'][_0x57502c+0x1]=_0x5f4e16[0x1],this['pArcSpherePos'][_0x57502c+0x2]=_0x5f4e16[0x2],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x3],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x4],_0x57502c+=0x3,_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?this['_ComputeVertexAndTexturePosHorizontal'](0x1,1.5707963-_0x2de16a*_0x4431c2,_0x9aa956[_0x2ade6b],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&this['_ComputeVertexAndTexturePosVertical'](0x1,1.5707963-_0x2de16a*_0x4431c2,_0x9aa956[_0x2ade6b],_0x5f4e16),this['pArcSpherePos'][_0x57502c]=_0x5f4e16[0x0],this['pArcSpherePos'][_0x57502c+0x1]=_0x5f4e16[0x1],this['pArcSpherePos'][_0x57502c+0x2]=_0x5f4e16[0x2],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x3],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x4],_0x57502c+=0x3,_0x4431c2<0x0&&_0x123bfe==_0x495f79-0x1?_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?this['_ComputeVertexAndTexturePosHorizontal'](0x1,1.5707963-_0x2de16a*(_0x4431c2+0x1),_0x9aa956[_0x2ade6b+0x1],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&this['_ComputeVertexAndTexturePosVertical'](0x1,1.5707963-_0x2de16a*(_0x4431c2+0x1),_0x9aa956[_0x2ade6b+0x1],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?this['_ComputeVertexAndTexturePosHorizontal'](0x1,1.5707963-_0x2de16a*_0x4431c2,_0x9aa956[_0x2ade6b+0x1],_0x5f4e16):_0x17b8f4==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']&&this['_ComputeVertexAndTexturePosVertical'](0x1,1.5707963-_0x2de16a*_0x4431c2,_0x9aa956[_0x2ade6b+0x1],_0x5f4e16),this['pArcSpherePos'][_0x57502c]=_0x5f4e16[0x0],this['pArcSpherePos'][_0x57502c+0x1]=_0x5f4e16[0x1],this['pArcSpherePos'][_0x57502c+0x2]=_0x5f4e16[0x2],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x3],this['pArcSphereTex'][_0x5595c4++]=_0x5f4e16[0x4],_0x57502c+=0x3;return this['nArcSpherePosNum']=_0x57502c/0x3,this['nArcSpherePosSize']=0x3,this['nArcSphereTexSize']=0x2,_0x9aa956=null,_0x5f4e16=null,_0xa87ede;}},{'key':'_ComputeIntersectionOfPlaneAndLongtitude','value':function(_0x45fd53,_0x47d03e,_0x217c54){if(null==_0x45fd53)return _0x31ddcf;var _0x2976b1,_0x4374a3=_0x45fd53[0x1]*_0x217c54,_0x1eff9b=_0x45fd53[0x2]*_0x217c54*Math['sin'](_0x47d03e),_0x68ac01=-_0x45fd53[0x3],_0x257e8f=0x0,_0x4a835b=0x0;if(_0x45fd53[0x1]>0x0){var _0x375aae=_0x4374a3*_0x4374a3*_0x68ac01*_0x68ac01-(_0x4374a3*_0x4374a3+_0x1eff9b*_0x1eff9b)*(_0x68ac01*_0x68ac01-_0x1eff9b*_0x1eff9b);_0x257e8f=(-_0x4374a3*_0x68ac01-Math['sqrt'](_0x375aae))/(_0x4374a3*_0x4374a3+_0x1eff9b*_0x1eff9b),_0x375aae=_0x1eff9b*_0x1eff9b*_0x68ac01*_0x68ac01-(_0x4374a3*_0x4374a3+_0x1eff9b*_0x1eff9b)*(_0x68ac01*_0x68ac01-_0x4374a3*_0x4374a3),_0x4a835b=(-_0x1eff9b*_0x68ac01+Math['sqrt'](_0x375aae))/(_0x4374a3*_0x4374a3+_0x1eff9b*_0x1eff9b);}if(_0x45fd53[0x1]<0x0){var _0x4908e2=_0x4374a3*_0x4374a3*_0x68ac01*_0x68ac01-(_0x4374a3*_0x4374a3+_0x1eff9b*_0x1eff9b)*(_0x68ac01*_0x68ac01-_0x1eff9b*_0x1eff9b);_0x257e8f=(-_0x4374a3*_0x68ac01+Math['sqrt'](_0x4908e2))/(_0x4374a3*_0x4374a3+_0x1eff9b*_0x1eff9b),_0x4908e2=_0x1eff9b*_0x1eff9b*_0x68ac01*_0x68ac01-(_0x4374a3*_0x4374a3+_0x1eff9b*_0x1eff9b)*(_0x68ac01*_0x68ac01-_0x4374a3*_0x4374a3),_0x4a835b=(-_0x1eff9b*_0x68ac01+Math['sqrt'](_0x4908e2))/(_0x4374a3*_0x4374a3+_0x1eff9b*_0x1eff9b);}return _0x217c54*Math['cos'](_0x47d03e)*_0x4a835b,_0x2976b1=-_0x217c54*_0x257e8f,-_0x217c54*Math['sin'](_0x47d03e)*_0x4a835b,Math['asin'](_0x2976b1/_0x217c54);}},{'key':'_ComputeLatitudeHorizontal','value':function(_0x1d9035,_0x4201d9,_0x55cdcb,_0x17ff34){if(null==_0x1d9035)return _0x31ddcf;var _0x28b004=0x0,_0x96e209=(this['fTexCenterY'],_0x530a52/(_0x4201d9-0x1)),_0x563232=_0x530a52*this['fTexCenterY']/(0x2*this['fTexRadius']),_0x295ce4=Math['asin'](this['fTexCenterY']/this['fTexRadius']),_0x1c880c=Math['atan'](Math['cos'](_0x563232)/(Math['sin'](_0x563232)-Math['sin'](_0x295ce4))),_0x456365=new Float32Array(0x4);_0x456365[0x0]=0x0,_0x456365[0x1]=Math['sin'](_0x1c880c),_0x456365[0x2]=Math['cos'](_0x1c880c),_0x456365[0x3]=-_0x17ff34*Math['sin'](_0x1c880c)*Math['sin'](_0x295ce4),_0x1d9035[_0x28b004++]=_0x563232;for(var _0x27acbc=0x1;_0x27acbc<=(_0x4201d9-0x3)/0x2;++_0x27acbc){var _0x3d819d=this['_ComputeIntersectionOfPlaneAndLongtitude'](_0x456365,1.5707963-_0x96e209*_0x27acbc,_0x17ff34);_0x1d9035[_0x28b004++]=_0x3d819d;}for(var _0x416567=-Math['asin']((this['fImageHeight']-this['fTexCenterY'])/this['fTexRadius']),_0xfbeb74=_0x295ce4,_0x757933=(_0xfbeb74-_0x416567)/(_0x55cdcb-0x1),_0x2194fe=0x0;_0x2194fe<_0x55cdcb;++_0x2194fe)_0x1d9035[_0x28b004++]=_0xfbeb74-_0x2194fe*_0x757933;var _0x9de884=_0x416567,_0x950ea=_0x530a52*(this['fTexCenterY']-this['fImageHeight'])/(0x2*this['fTexRadius']);_0x1c880c=Math['atan'](Math['cos'](_0x950ea)/(Math['sin'](_0x9de884)-Math['sin'](_0x950ea)));var _0x5db530=new Float32Array(0x4);_0x5db530[0x0]=0x0,_0x5db530[0x1]=-Math['sin'](_0x1c880c),_0x5db530[0x2]=Math['cos'](_0x1c880c),_0x5db530[0x3]=_0x17ff34*Math['sin'](_0x1c880c)*Math['sin'](_0x9de884);for(var _0x4faffc=0x1;_0x4faffc<=(_0x4201d9-0x3)/0x2;++_0x4faffc){var _0x4d8954=this['_ComputeIntersectionOfPlaneAndLongtitude'](_0x5db530,_0x96e209*_0x4faffc,_0x17ff34);_0x1d9035[_0x28b004++]=_0x4d8954;}return _0x1d9035[_0x28b004++]=_0x950ea,_0x456365=null,_0x5db530=null,_0xa87ede;}},{'key':'_ComputeVertexAndTexturePosHorizontal','value':function(_0x237ede,_0x4d0778,_0x13a528,_0x4db42c){if(null==_0x4db42c)return _0x31ddcf;_0x4db42c[0x2]=-_0x237ede*Math['cos'](_0x13a528)*Math['sin'](_0x4d0778),_0x4db42c[0x0]=_0x237ede*Math['cos'](_0x13a528)*Math['cos'](_0x4d0778),_0x4db42c[0x1]=_0x237ede*Math['sin'](_0x13a528);var _0x202bd0,_0x2a92e7=-Math['asin'](-_0x4db42c[0x2]/_0x237ede)/_0x530a52;_0x202bd0=_0x13a528>=0x0?Math['acos'](_0x4db42c[0x0]/Math['sqrt'](_0x4db42c[0x0]*_0x4db42c[0x0]+_0x4db42c[0x1]*_0x4db42c[0x1])):6.2831852-Math['acos'](_0x4db42c[0x0]/Math['sqrt'](_0x4db42c[0x0]*_0x4db42c[0x0]+_0x4db42c[0x1]*_0x4db42c[0x1]));var _0x41db05=this['fTexCenterX']-this['fTexRadius'],_0x53c029=this['fTexRadius']-this['fTexCenterY'];return _0x4db42c[0x3]=(Math['cos'](_0x202bd0)*this['fTexRadius']*(0x1+0x2*_0x2a92e7)+this['fTexRadius']+_0x41db05)/this['fImageWidth'],_0x4db42c[0x4]=(Math['sin'](_0x202bd0)*this['fTexRadius']*(-0x1-0x2*_0x2a92e7)+this['fTexRadius']-_0x53c029)/this['fImageHeight'],_0xa87ede;}},{'key':'_ComputeLatitudeVertical','value':function(_0x34484c,_0xb0c36,_0x2a9bf2,_0x46e820){if(null==_0x34484c)return SR_ERR_PARAM;var _0x59bfbe=0x0,_0x328331=_0x530a52/(_0xb0c36-0x1),_0x44937f=_0x530a52*this['fTexCenterX']/(0x2*this['fTexRadius']),_0x5ed7ac=Math['asin'](this['fTexCenterX']/this['fTexRadius']),_0x5524c3=Math['atan'](Math['cos'](_0x44937f)/(Math['sin'](_0x44937f)-Math['sin'](_0x5ed7ac))),_0x1969e8=new Float32Array(0x4);_0x1969e8[0x0]=0x0,_0x1969e8[0x1]=Math['sin'](_0x5524c3),_0x1969e8[0x2]=Math['cos'](_0x5524c3),_0x1969e8[0x3]=-_0x46e820*Math['sin'](_0x5524c3)*Math['sin'](_0x5ed7ac),_0x34484c[_0x59bfbe++]=_0x44937f;for(var _0x20ee3e=0x1;_0x20ee3e<=(_0xb0c36-0x3)/0x2;++_0x20ee3e){var _0x2386b2=this['_ComputeIntersectionOfPlaneAndLongtitude'](_0x1969e8,1.5707963-_0x328331*_0x20ee3e,_0x46e820);_0x34484c[_0x59bfbe++]=_0x2386b2;}for(var _0x2c3055=-Math['asin']((this['fImageWidth']-this['fTexCenterX'])/this['fTexRadius']),_0x40c0b8=_0x5ed7ac,_0x39678a=(_0x40c0b8-_0x2c3055)/(_0x2a9bf2-0x1),_0x44e4ac=0x0;_0x44e4ac<_0x2a9bf2;++_0x44e4ac)_0x34484c[_0x59bfbe++]=_0x40c0b8-_0x44e4ac*_0x39678a;var _0x49fb50=_0x2c3055,_0x654a8=_0x530a52*(this['fTexCenterX']-this['fImageWidth'])/(0x2*this['fTexRadius']);_0x5524c3=Math['atan'](Math['cos'](_0x654a8)/(Math['sin'](_0x49fb50)-Math['sin'](_0x654a8)));var _0xae5f17=new Float32Array(0x4);_0xae5f17[0x0]=0x0,_0xae5f17[0x1]=-Math['sin'](_0x5524c3),_0xae5f17[0x2]=Math['cos'](_0x5524c3),_0xae5f17[0x3]=_0x46e820*Math['sin'](_0x5524c3)*Math['sin'](_0x49fb50);for(var _0x2349b8=0x1;_0x2349b8<=(_0xb0c36-0x3)/0x2;++_0x2349b8){var _0x3b0f29=this['_ComputeIntersectionOfPlaneAndLongtitude'](_0xae5f17,_0x328331*_0x2349b8,_0x46e820);_0x34484c[_0x59bfbe++]=_0x3b0f29;}return _0x34484c[_0x59bfbe++]=_0x654a8,_0x1969e8=null,_0xae5f17=null,_0xa87ede;}},{'key':'_ComputeVertexAndTexturePosVertical','value':function(_0x534f39,_0x159869,_0xc2a7c8,_0x17e0da){if(null==_0x17e0da)return SR_ERR_PARAM;_0x17e0da[0x2]=-_0x534f39*Math['cos'](_0xc2a7c8)*Math['sin'](_0x159869),_0x17e0da[0x1]=_0x534f39*Math['cos'](_0xc2a7c8)*Math['cos'](_0x159869),_0x17e0da[0x0]=-_0x534f39*Math['sin'](_0xc2a7c8);var _0xa5e24d,_0x10e2f0=-Math['asin'](-_0x17e0da[0x2]/_0x534f39)/_0x530a52;_0xa5e24d=_0x159869<=1.5707963?Math['acos'](_0x17e0da[0x0]/Math['sqrt'](_0x17e0da[0x0]*_0x17e0da[0x0]+_0x17e0da[0x1]*_0x17e0da[0x1])):6.2831852-Math['acos'](_0x17e0da[0x0]/Math['sqrt'](_0x17e0da[0x0]*_0x17e0da[0x0]+_0x17e0da[0x1]*_0x17e0da[0x1]));var _0x4f865f=this['fTexCenterX']-this['fTexRadius'],_0x10dbcb=this['fTexRadius']-this['fTexCenterY'];return _0x17e0da[0x3]=(Math['cos'](_0xa5e24d)*this['fTexRadius']*(0x1+0x2*_0x10e2f0)+this['fTexRadius']+_0x4f865f)/this['fImageWidth'],_0x17e0da[0x4]=(Math['sin'](_0xa5e24d)*this['fTexRadius']*(-0x1-0x2*_0x10e2f0)+this['fTexRadius']-_0x10dbcb)/this['fImageHeight'],_0xa87ede;}},{'key':'InitCamera','value':function(_0xcc10d5){if(null!=this['pCamera'])return SR_ERR_CALL_ORDER;switch(_0xcc10d5){case _0x186ff9['SR_DE_NULL']:case _0x186ff9['SR_DE_FISH_ORIGINAL']:case _0x186ff9['SR_DE_FISH_PTZ_CEILING']:case _0x186ff9['SR_DE_FISH_PTZ_FLOOR']:case _0x186ff9['SR_DE_FISH_PTZ_WALL']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']:case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']:case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:return _0xa87ede;case _0x186ff9['SR_DE_FISH_SEMISPHERE']:if(this['pCamera']=new _0x3b657c(),null==this['pCamera'])return _0x3d12cf;this['pCamera']['SetFov'](_0x13b181),this['pCamera']['SetNear'](_0x49aaae),this['pCamera']['SetFar'](_0x26dab3),this['fRotateX']=1.57,this['pCamera']['SetPitch'](3.14-this['fRotateX']),this['fScale']=0x3,this['pCamera']['SetScale'](this['fScale']);break;case _0x186ff9['SR_DE_FISH_CYLINDER_CEILING']:case _0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']:if(this['pCamera']=new _0x3b657c(),null==this['pCamera'])return _0x3d12cf;this['pCamera']['SetFov'](_0x13b181),this['pCamera']['SetNear'](_0x49aaae),this['pCamera']['SetFar'](_0x26dab3),this['fRotateX']=0.785,this['pCamera']['SetPitch'](-this['fRotateX']),this['fScale']=0x6,this['pCamera']['SetScale'](this['fScale']);break;case _0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_CEILING']:case _0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']:if(this['pCamera']=new _0x3b657c(),null==this['pCamera'])return _0x3d12cf;this['pCamera']['SetOrtho'](!0x0),this['pCamera']['SetNear'](_0x49aaae),this['pCamera']['SetFar'](_0x26dab3),this['fScale']=0x3,this['pCamera']['SetScale'](this['fScale']);break;case _0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']:if(this['pCamera']=new _0x3b657c(),null==this['pCamera'])return _0x3d12cf;this['pCamera']['SetFov'](_0x13b181),this['pCamera']['SetNear'](_0x49aaae),this['pCamera']['SetFar'](_0x26dab3),this['fScale']=0x2,this['pCamera']['SetScale'](this['fScale']),_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']==_0xcc10d5?(this['fRotateLimitX']=_0x44d661,this['fRotateLimitY']=_0x5affea):(this['fRotateLimitX']=_0x438d57,this['fRotateLimitY']=_0x2506c4);break;default:return _0x86aef9;}return _0xa87ede;}},{'key':'SR_SetViewParam','value':function(_0x46d073,_0x6189a7){if(!this['b3DPort'])return _0x86aef9;switch(_0x46d073){case _0x394973:if((this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL'])&&(_0x6189a7>this['fRotateLimitX']||_0x6189a7<-this['fRotateLimitX']))return _0x31ddcf;this['fRotateX']=_0x6189a7;break;case _0x42f4b3:if((this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL'])&&(_0x6189a7>this['fRotateLimitY']||_0x6189a7<-this['fRotateLimitY']))return _0x31ddcf;this['fRotateY']=_0x6189a7;break;case _0x339c63:if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_SEMISPHERE']){if(_0x6189a7<-0.8||_0x6189a7>0x384)return _0x31ddcf;}else{if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_CYLINDER_CEILING']){if(_0x6189a7<0x0||_0x6189a7>0x384)return _0x31ddcf;}else{if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']){if(_0x6189a7<-0.3||_0x6189a7>0x5)return _0x31ddcf;this['_ComputeRotateLimits']();}}}this['fScale']=_0x6189a7;break;default:return _0x86aef9;}return _0xa87ede;}},{'key':'SR_GetViewParam','value':function(_0x52c4fa,_0x205d9b){if(!this['b3DPort'])return _0x520965;var _0x50830b=0x0;switch(_0x52c4fa){case _0x394973:_0x50830b=this['fRotateX'];break;case _0x42f4b3:_0x50830b=this['fRotateY'];break;case _0x339c63:_0x50830b=this['fScale'];break;default:return _0x86aef9;}return _0x205d9b['fValue']=_0x50830b,_0xa87ede;}},{'key':'SR_SetCallBack','value':function(_0x5da1bd,_0x2bbf0b,_0x3e50e3){switch(_0x3e50e3){case _0x444649:this['pfuncCBIn']=_0x5da1bd,this['pUserIn']=_0x2bbf0b;break;case _0x4f7368:this['pfuncCBOut']=_0x5da1bd,this['pUserOut']=_0x2bbf0b;break;default:return _0x86aef9;}return _0xa87ede;}},{'key':'SR_SetRenderState','value':function(_0x2206d5,_0x3e7889){switch(_0x2206d5){case _0x11cf81:if(this['b3DPort'])return _0x86aef9;break;case _0x57ef5a:if(!this['b3DPort'])return _0x86aef9;Math['abs'](_0x3e7889-0x0)<_0x4a23c6?this['bCullBack']=!0x1:this['bCullBack']=!0x0;break;default:return _0x86aef9;}return _0xa87ede;}},{'key':'SR_SetPTZColor','value':function(_0x22a340,_0x2d7345){return null==this['pFishParamManager']?_0x520965:this['pFishParamManager']['SetPTZColor'](_0x22a340,_0x2d7345);}},{'key':'SR_GetPTZColor','value':function(_0xaeb36f,_0x463679){return null==this['pFishParamManager']?_0x520965:this['pFishParamManager']['GetPTZColor'](_0xaeb36f,_0x463679);}},{'key':'SR_SetPTZPort','value':function(_0x5c99b6){return null==this['pFishParamManager']?_0x520965:this['pFishParamManager']['SetPTZPort'](_0x5c99b6);}},{'key':'SR_GetPTZPort','value':function(_0x1d4d34,_0x29e620,_0x25da3e){return null==this['pFishParamManager']?_0x520965:null==_0x25da3e?_0x31ddcf:this['pFishParamManager']['GetPTZPort'](_0x1d4d34,_0x29e620,_0x25da3e);}},{'key':'SR_GetCaptureSize','value':function(_0x3d6a1f){if(null==_0x3d6a1f)return _0x31ddcf;if(null==this['ctx'])return _0x520965;if(null==_0x3d6a1f['nWidth']||null==_0x3d6a1f['nWidth']||null==_0x3d6a1f['nHeight']||null==_0x3d6a1f['nHeight'])return _0x31ddcf;var _0x3077f0=0x0,_0x2f261a=0x0;if(0x0==_0x3d6a1f['nWidth']&&0x0==_0x3d6a1f['nHeight'])switch(this['enDisplayEffect']){case _0x186ff9['SR_DE_FISH_PTZ_WALL']:case _0x186ff9['SR_DE_FISH_PTZ_CEILING']:case _0x186ff9['SR_DE_FISH_PTZ_FLOOR']:_0x3077f0=Math['round'](0x5*this['frameDisplayHeight']/0x8),_0x2f261a=Math['round'](0x3*_0x3077f0/0x4);break;case _0x186ff9['SR_DE_NULL']:_0x3077f0=Math['round']((this['fSrcUseRight']-this['fSrcUseLeft'])*this['frameDisplayWidth']),_0x2f261a=Math['round']((this['fSrcUseBottom']-this['fSrcUseTop'])*this['frameDisplayHeight']);break;case _0x186ff9['SR_DE_FISH_ORIGINAL']:case _0x186ff9['SR_DE_FISH_SEMISPHERE']:case _0x186ff9['SR_DE_FISH_CYLINDER_CEILING']:case _0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']:_0x3077f0=Math['round'](this['frameDisplayWidth']),_0x2f261a=Math['round'](this['frameDisplayHeight']);break;case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:this['frameDisplayHeight']>=0x800?(_0x3077f0=0x1800,_0x2f261a=0x360):this['frameDisplayHeight']>=0x600&&0x800>this['frameDisplayHeight']?(_0x3077f0=0x1000,_0x2f261a=0x240):(_0x3077f0=Math['round'](3.14*this['frameDisplayHeight']/1.6),_0x2f261a=Math['round'](0x9*this['frameDisplayWidth']/0x10),_0x3077f0=Math['round'](0x2*_0x3077f0),_0x2f261a=Math['round'](_0x2f261a/0x2));break;case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']:this['frameDisplayHeight']>=0xc00?(_0x3077f0=0x1000,_0x2f261a=0x900):this['frameDisplayHeight']>=0x800&&0xc00>this['frameDisplayHeight']?(_0x3077f0=0xc00,_0x2f261a=0x6c0):this['frameDisplayHeight']>=0x600&&0x800>this['frameDisplayHeight']?(_0x3077f0=0x800,_0x2f261a=0x480):(_0x3077f0=Math['round'](3.14*this['frameDisplayHeight']/1.6),_0x2f261a=Math['round'](0x9*_0x3077f0/0x10));break;case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:_0x3077f0=Math['round'](this['frameDisplayHeight']),_0x2f261a=Math['round'](0x9*_0x3077f0/0x10);break;default:return _0x31ddcf;}else _0x3077f0=Math['round'](_0x3d6a1f['nWidth']),_0x2f261a=Math['round'](_0x3d6a1f['nHeight']);return _0x3077f0<0x10||_0x2f261a<0x10?_0x31ddcf:(this['nCaptureWidth']=0x4*Math['round'](_0x3077f0/0x4),this['nCaptureHeight']=Math['round'](_0x2f261a),_0x3d6a1f['nWidth']=this['nCaptureWidth'],_0x3d6a1f['nHeight']=this['nCaptureHeight'],_0x3d6a1f['nBufferLen']=this['nCaptureWidth']*this['nCaptureHeight']*0x4,_0xa87ede);}},{'key':'SR_CaptureScreen','value':function(_0x182ed1){var _0x2c8855=_0xa87ede;if(_0x2c8855=this['_BeginCapture'](),_0xa87ede!=_0x2c8855)return _0x2c8855;if(0x0==this['videoShaderProgram']||0x0==this['vertexPosBuffer']||0x0==this['texturePosBuffer'])return _0x520965;this['ctx']['useProgram'](this['videoShaderProgram']),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['vertexPosBuffer']);var _0x517ee9=this['ctx']['getAttribLocation'](this['videoShaderProgram'],'xy');if(_0x517ee9<0x0)return _0x4d26c0;this['ctx']['vertexAttribPointer'](_0x517ee9,0x3,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['enableVertexAttribArray'](_0x517ee9),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],this['texturePosBuffer']);var _0x14700d=this['ctx']['getAttribLocation'](this['videoShaderProgram'],'uv');if(_0x14700d<0x0)return _0x4d26c0;this['ctx']['vertexAttribPointer'](_0x14700d,0x2,this['ctx']['FLOAT'],!0x1,0x0,0x0),this['ctx']['enableVertexAttribArray'](_0x14700d),this['ctx']['bindBuffer'](this['ctx']['ARRAY_BUFFER'],null);var _0x51a1ec=this['enDisplayEffect'],_0x34fe9c=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'bCapture');if(_0x34fe9c<=0x0)return _0x4d26c0;switch(this['ctx']['uniform1i'](_0x34fe9c,0x1),_0x51a1ec){case _0x186ff9['SR_DE_NULL']:break;case _0x186ff9['SR_DE_FISH_ORIGINAL']:case _0x186ff9['SR_DE_FISH_PTZ_CEILING']:case _0x186ff9['SR_DE_FISH_PTZ_FLOOR']:case _0x186ff9['SR_DE_FISH_PTZ_WALL']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']:case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']:case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:if(null==this['pFishParamManager'])return _0x520965;var _0x1fd457={};if(_0x2c8855=this['pFishParamManager']['GetRenderParam'](this['nFECPort'],_0x1fd457),_0xa87ede!=_0x2c8855)return _0x2c8855;if(_0x186ff9['SR_DE_FISH_ORIGINAL']==_0x51a1ec){var _0x5ed42b=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'bBlack');if(_0x5ed42b<=0x0)return _0x4d26c0;this['ctx']['uniform1i'](_0x5ed42b,_0x1fd457['bBlack']);var _0x22c412=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'bCut');if(_0x22c412<=0x0)return _0x4d26c0;this['ctx']['uniform1i'](_0x22c412,_0x1fd457['bCut']);}if(_0x186ff9['SR_DE_FISH_PTZ_CEILING']==_0x51a1ec||_0x186ff9['SR_DE_FISH_PTZ_FLOOR']==_0x51a1ec||_0x186ff9['SR_DE_FISH_PTZ_WALL']==_0x51a1ec){var _0x1be46e=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fHAngleCos');if(_0x1be46e<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x1be46e,_0x1fd457['fCosH']);var _0x4cee7f=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fHAngleSin');if(_0x4cee7f<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x4cee7f,_0x1fd457['fSinH']);var _0x34ae1c=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fVAngleCos');if(_0x34ae1c<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x34ae1c,_0x1fd457['fCosV']);var _0x300454=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fVAngleSin');if(_0x300454<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x300454,_0x1fd457['fSinV']);var _0x2862f4=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fZoom');if(_0x2862f4<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x2862f4,_0x1fd457['fZoom']);}if(_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']==_0x51a1ec||_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']==_0x51a1ec||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']==_0x51a1ec||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']==_0x51a1ec){var _0x11460a=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fAngle');if(_0x11460a<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x11460a,_0x1fd457['fAngle']);}var _0x25ff1c=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fRX1');if(_0x25ff1c<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x25ff1c,_0x1fd457['fRXLeft']);var _0x558e2c=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fRX2');if(_0x558e2c<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x558e2c,_0x1fd457['fRXRight']);var _0x1f7592=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fRY1');if(_0x1f7592<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x1f7592,_0x1fd457['fRYTop']);var _0x4966fe=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fRY2');if(_0x4966fe<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x4966fe,_0x1fd457['fRYBottom']);break;case _0x186ff9['SR_DE_FISH_SEMISPHERE']:this['pCamera']['SetScale'](this['fScale']),this['pCamera']['SetPitch'](3.14-this['fRotateX']),this['pCamera']['SetYaw'](-this['fRotateY']),this['pCamera']['UpdateCamera'](this['canvas']['width'],this['canvas']['height']);var _0x5e2a11=this['pCamera']['GetView'](),_0xf45b1a=this['pCamera']['GetProj'](),_0x3aaee2=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'matView');if(_0x3aaee2<=0x0)return _0x4d26c0;this['ctx']['uniformMatrix4fv'](_0x3aaee2,!0x1,_0x5e2a11);var _0x51d4ee=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'matProj');if(_0x51d4ee<=0x0)return _0x4d26c0;this['ctx']['uniformMatrix4fv'](_0x51d4ee,!0x1,_0xf45b1a);break;case _0x186ff9['SR_DE_FISH_CYLINDER_CEILING']:case _0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']:this['pCamera']['SetScale'](this['fScale']),this['pCamera']['SetPitch'](-this['fRotateX']),this['pCamera']['SetYaw'](-this['fRotateY']),this['pCamera']['UpdateCamera'](this['canvas']['width'],this['canvas']['height']);var _0x4ad072=this['pCamera']['GetView'](),_0x3a7e99=this['pCamera']['GetProj'](),_0x8e98a2=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'matView');if(_0x8e98a2<=0x0)return _0x4d26c0;this['ctx']['uniformMatrix4fv'](_0x8e98a2,!0x1,_0x4ad072);var _0x5b3983=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'matProj');if(_0x5b3983<=0x0)return _0x4d26c0;this['ctx']['uniformMatrix4fv'](_0x5b3983,!0x1,_0x3a7e99);break;default:return _0x86aef9;}if(this['nCaptureWidth']<=0x0||this['nCaptureHeight']<=0x0)return _0x4fea1b;if(this['ctx']['viewport'](0x0,0x0,this['nCaptureWidth'],this['nCaptureHeight']),this['ctx']['clearColor'](0x0,0x0,0x0,0x1),this['ctx']['clear'](this['ctx']['COLOR_BUFFER_BIT']|this['ctx']['DEPTH_BUFFER_BIT']),this['b3DPort']&&(this['ctx']['enable'](this['ctx']['DEPTH_TEST']),this['ctx']['depthFunc'](this['ctx']['LESS']),this['ctx']['depthMask'](!0x0),0x1==this['bCullBack']?this['ctx']['enable'](this['ctx']['CULL_FACE']):this['ctx']['disable'](this['ctx']['CULL_FACE'])),this['enPixelFormat']==_0xa01ff6?this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x0]):(this['enPixelFormat']==_0x58bd8b||this['enPixelFormat']==_0x264b64)&&(this['ctx']['activeTexture'](this['ctx']['TEXTURE0']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x0]),this['ctx']['activeTexture'](this['ctx']['TEXTURE1']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x1]),this['ctx']['activeTexture'](this['ctx']['TEXTURE2']),this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nSurfaceTexture'][0x2])),this['onlySupportedWebGL1']||this['ctx']['clearBufferfi'](this['ctx']['DEPTH_STENCIL'],0x0,0x1,0x0),0x0==this['b3DPort'])this['ctx']['drawArrays'](this['ctx']['TRIANGLE_FAN'],0x0,0x4);else{if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_SEMISPHERE']){if(this['nSemiSpherePosNum']<=0x0)return _0x520965;this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,this['nSemiSpherePosNum']);}else{if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_CYLINDER_CEILING']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']){if(this['nCylinderPosNum']<=0x0)return _0x520965;this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,this['nCylinderPosNum']);}else{if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']){if(this['nArcSpherePosNum']<=0x0)return _0x520965;this['ctx']['drawArrays'](this['ctx']['TRIANGLES'],0x0,this['nArcSpherePosNum']);}}}}return this['ctx']['useProgram'](null),null!=this['pfuncCBIn']&&this['pfuncCBIn'](this['pUserIn']),null!=this['pfuncCBOut']&&this['pfuncCBOut'](this['pUserOut']),_0x2c8855=this['_EndCapture'](_0x182ed1),_0xa87ede!=_0x2c8855?_0x2c8855:_0xa87ede;}},{'key':'SR_SetImagePostProcess','value':function(_0x2048cc,_0x1ac4fe){if(null==this['ctx'])return _0x520965;if(_0xe529b7==_0x2048cc||_0x2d33eb==_0x2048cc){if(0x0-_0x1ac4fe>_0x4a23c6||_0x1ac4fe-0x1>_0x4a23c6)return _0x31ddcf;}else{if((_0x46c7b3==_0x2048cc||_0x199c31==_0x2048cc||_0x414976==_0x2048cc)&&(-0x1-_0x1ac4fe>_0x4a23c6||_0x1ac4fe-0x1>_0x4a23c6))return _0x31ddcf;}switch(_0x2048cc){case _0x46c7b3:this['fBrightness']=_0x1ac4fe;break;case _0x2d33eb:this['fHue']=_0x1ac4fe;break;case _0x199c31:this['fSaturation']=_0x1ac4fe;break;case _0x414976:this['fContrast']=_0x1ac4fe;break;case _0xe529b7:this['fSharpness']=_0x1ac4fe;break;default:return _0x86aef9;}return Math['abs'](this['fBrightness']-0x0)<_0x4a23c6&&Math['abs'](this['fHue']-0x0)<_0x4a23c6&&Math['abs'](this['fSaturation']-0x0)<_0x4a23c6&&Math['abs'](this['fContrast']-0x0)<_0x4a23c6&&Math['abs'](this['fSharpness']-0x0)<_0x4a23c6?this['nPostProc']=0x0:this['nPostProc']=0x1,_0xa87ede;}},{'key':'_BeginCapture','value':function(){var _0x594b67=_0xa87ede;return 0x0==this['bCaptureResInit']&&(_0x594b67=this['_InitRenderTarget'](this['nCaptureWidth'],this['nCaptureHeight'],!0x1,!0x0),_0xa87ede!=_0x594b67)?_0x594b67:(_0x594b67=this['_Resize'](this['nCaptureWidth'],this['nCaptureHeight'],!0x1,!0x0),_0xa87ede!=_0x594b67?_0x594b67:(this['ctx']['bindFramebuffer'](this['ctx']['FRAMEBUFFER'],this['nCaptureFBO']),this['bIsCapturing']=!0x0,_0xa87ede));}},{'key':'_InitRenderTarget','value':function(_0x5a333c,_0x43881f,_0x249770,_0x2948c0){if(0x0!=this['nCaptureRTTex']||0x0!=this['nCaptureFBO'])return _0x520965;if(_0x5a333c<=0x0||_0x43881f<=0x0)return _0x31ddcf;if(this['nCaptureRTTex']=this['ctx']['createTexture'](),this['nCaptureRTTex']<=0x0)return _0x4d26c0;if(this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nCaptureRTTex']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['RGBA'],_0x5a333c,_0x43881f,0x0,this['ctx']['RGBA'],this['ctx']['UNSIGNED_BYTE'],null),0x0==this['nCaptureFBO']&&(this['nCaptureFBO']=this['ctx']['createFramebuffer'](),this['nCaptureFBO']<=0x0))return _0x4d26c0;if(this['ctx']['bindFramebuffer'](this['ctx']['FRAMEBUFFER'],this['nCaptureFBO']),this['ctx']['framebufferTexture2D'](this['ctx']['FRAMEBUFFER'],this['ctx']['COLOR_ATTACHMENT0'],this['ctx']['TEXTURE_2D'],this['nCaptureRTTex'],0x0),0x1==_0x2948c0&&0x0==this['nCaptureDepthbuffer']){if(this['nCaptureDepthbuffer']=this['ctx']['createRenderbuffer'](),this['nCaptureDepthbuffer']<=0x0)return _0x4d26c0;this['ctx']['bindRenderbuffer'](this['ctx']['RENDERBUFFER'],this['nCaptureDepthbuffer']),this['ctx']['renderbufferStorage'](this['ctx']['RENDERBUFFER'],this['ctx']['DEPTH_COMPONENT16'],_0x5a333c,_0x43881f),this['ctx']['framebufferRenderbuffer'](this['ctx']['FRAMEBUFFER'],this['ctx']['DEPTH_ATTACHMENT'],this['ctx']['RENDERBUFFER'],this['nCaptureDepthbuffer']);}return this['ctx']['bindFramebuffer'](this['ctx']['FRAMEBUFFER'],null),this['nCaptureFBOWidth']=_0x5a333c,this['nCaptureFBOHeight']=_0x43881f,this['bCaptureResInit']=!0x0,_0xa87ede;}},{'key':'_Resize','value':function(_0xcfe8c4,_0x52f7d1,_0x42dc08,_0x357e6b){if(this['nCaptureFBOWidth']!=_0xcfe8c4||this['nCaptureFBOHeight']!=_0x52f7d1){if(this['nCaptureFBOWidth']=_0xcfe8c4,this['nCaptureFBOHeight']=_0x52f7d1,0x0!=this['nCaptureRTTex']&&(this['ctx']['deleteTexture'](this['nCaptureRTTex']),this['nCaptureRTTex']=0x0),0x0!=this['nCaptureDepthbuffer']&&(this['ctx']['deleteRenderbuffer'](this['nCaptureDepthbuffer']),this['nCaptureDepthbuffer']=0x0),0x0==this['nCaptureRTTex']&&(this['nCaptureRTTex']=this['ctx']['createTexture'](),this['nCaptureRTTex']<=0x0))return _0x4d26c0;if(this['ctx']['bindTexture'](this['ctx']['TEXTURE_2D'],this['nCaptureRTTex']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MAG_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_MIN_FILTER'],this['ctx']['LINEAR']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_S'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texParameteri'](this['ctx']['TEXTURE_2D'],this['ctx']['TEXTURE_WRAP_T'],this['ctx']['CLAMP_TO_EDGE']),this['ctx']['texImage2D'](this['ctx']['TEXTURE_2D'],0x0,this['ctx']['RGBA'],this['nCaptureFBOWidth'],this['nCaptureFBOHeight'],0x0,this['ctx']['RGBA'],this['ctx']['UNSIGNED_BYTE'],null),this['ctx']['bindFramebuffer'](this['ctx']['FRAMEBUFFER'],this['nCaptureFBO']),this['ctx']['framebufferTexture2D'](this['ctx']['FRAMEBUFFER'],this['ctx']['COLOR_ATTACHMENT0'],this['ctx']['TEXTURE_2D'],this['nCaptureRTTex'],0x0),0x1==_0x357e6b&&0x0==this['nCaptureDepthbuffer']){if(this['nCaptureDepthbuffer']=this['ctx']['createRenderbuffer'](),this['nCaptureDepthbuffer']<=0x0)return _0x4d26c0;this['ctx']['bindRenderbuffer'](this['ctx']['RENDERBUFFER'],this['nCaptureDepthbuffer']),this['ctx']['renderbufferStorage'](this['ctx']['RENDERBUFFER'],this['ctx']['DEPTH_COMPONENT16'],_0xcfe8c4,_0x52f7d1),this['ctx']['framebufferRenderbuffer'](this['ctx']['FRAMEBUFFER'],this['ctx']['DEPTH_ATTACHMENT'],this['ctx']['RENDERBUFFER'],this['nCaptureDepthbuffer']);}this['ctx']['bindFramebuffer'](this['ctx']['FRAMEBUFFER'],null);}return _0xa87ede;}},{'key':'_EndCapture','value':function(_0x4c1472){return null==this['ctx']?_0x520965:null==_0x4c1472['pBuffer']||null==_0x4c1472['pBuffer']?_0x31ddcf:(this['ctx']['readPixels'](0x0,0x0,this['nCaptureWidth'],this['nCaptureHeight'],this['ctx']['RGBA'],this['ctx']['UNSIGNED_BYTE'],_0x4c1472['pBuffer']),this['ctx']['bindFramebuffer'](this['ctx']['FRAMEBUFFER'],null),this['bIsCapturing']=!0x1,_0xa87ede);}},{'key':'_ResizeFrameData','value':function(_0x5bdf2c,_0xb05249,_0x32fafb,_0x14166a){if(0x0==_0xb05249%0x8&&null==_0x14166a)return this['frameDisplayWidth']=Math['round'](_0xb05249),this['frameDisplayHeight']=Math['round'](_0x32fafb),this['pFrameData']=_0x5bdf2c,_0xa87ede;if(null!=_0x14166a&&0x0==_0x14166a['nCropBottom']&&0x0==_0x14166a['nCropLeft']&&0x0==_0x14166a['nCropRight']&&0x0==_0x14166a['nCropTop']&&0x0==_0xb05249%0x8)return this['frameDisplayWidth']=Math['round'](_0xb05249),this['frameDisplayHeight']=Math['round'](_0x32fafb),this['pFrameData']=_0x5bdf2c,_0xa87ede;if((null==this['pFrameData']||this['frameDisplayWidth']!=_0xb05249/0x8*0x8||this['frameDisplayHeight']!=_0x32fafb)&&(this['frameDisplayWidth']=0x8*Math['round'](_0xb05249/0x8),this['frameDisplayHeight']=Math['round'](_0x32fafb),this['pFrameData']=null,this['pFrameData']=new Uint8Array(this['frameDisplayWidth']*this['frameDisplayHeight']*0x3/0x2),null==this['pFrameData']))return _0x3d12cf;var _0x28d502=0x0,_0x14e706=0x0,_0x5dba3f=Math['round'](_0x14166a['nCodeWidth']),_0x529996=Math['round'](_0x14166a['nCodeHeight']),_0x51b8fc=0x0;if(_0x58bd8b==this['enPixelFormat']||_0x264b64==this['enPixelFormat']){var _0x267b16,_0x2b423f,_0x3428fd;null!=_0x14166a?(_0x28d502=Math['round'](_0x14166a['nCropLeft']),_0x14e706=Math['round'](_0x14166a['nCropTop']),_0x267b16=_0x5bdf2c['subarray'](_0x28d502*_0x5dba3f+_0x14e706,_0x5dba3f*_0x529996),_0x2b423f=_0x5bdf2c['subarray'](_0x5dba3f*_0x529996+_0x14e706*_0x5dba3f/0x4+_0x28d502/0x2,_0x5dba3f*_0x529996*0x5/0x4),_0x3428fd=_0x5bdf2c['subarray'](_0x5dba3f*_0x529996*0x5/0x4+_0x14e706*_0x5dba3f/0x4+_0x28d502/0x2,_0x5dba3f*_0x529996*0x3/0x2),_0x51b8fc=_0x5dba3f):(_0x267b16=_0x5bdf2c['subarray'](0x0,_0xb05249*_0x32fafb),_0x2b423f=_0x5bdf2c['subarray'](_0xb05249*_0x32fafb,_0xb05249*_0x32fafb*0x5/0x4),_0x3428fd=_0x5bdf2c['subarray'](_0xb05249*_0x32fafb*0x5/0x4,_0xb05249*_0x32fafb*0x3/0x2),_0x51b8fc=this['frameDisplayWidth']);for(var _0x13336c=null,_0x4b9afa=0x0;_0x4b9afa<this['frameDisplayHeight'];++_0x4b9afa){var _0x3781f7=Math['round'](_0x4b9afa*_0x51b8fc),_0x327116=Math['round'](_0x4b9afa*_0x51b8fc+this['frameDisplayWidth']);_0x13336c=_0x267b16['slice'](_0x3781f7,_0x327116);var _0x141fa6=Math['round'](_0x4b9afa*this['frameDisplayWidth']);this['pFrameData']['set'](_0x13336c,_0x141fa6);}for(var _0x477bdd=0x0;_0x477bdd<this['frameDisplayHeight']/0x2;++_0x477bdd){var _0x50edd6=Math['round'](_0x477bdd*_0x51b8fc/0x2),_0x503319=Math['round'](_0x477bdd*_0x51b8fc/0x2+this['frameDisplayWidth']/0x2);_0x13336c=_0x2b423f['slice'](_0x50edd6,_0x503319);var _0x22f9fb=Math['round'](this['frameDisplayWidth']*this['frameDisplayHeight']+_0x477bdd*this['frameDisplayWidth']/0x2);this['pFrameData']['set'](_0x13336c,_0x22f9fb);}for(var _0xb58ce5=0x0;_0xb58ce5<this['frameDisplayHeight']/0x2;++_0xb58ce5){var _0x47cd2f=Math['round'](_0xb58ce5*_0x51b8fc/0x2),_0x1244ce=Math['round'](_0xb58ce5*_0x51b8fc/0x2+this['frameDisplayWidth']/0x2);_0x13336c=_0x3428fd['slice'](_0x47cd2f,_0x1244ce);var _0x25a663=Math['round'](this['frameDisplayWidth']*this['frameDisplayHeight']*0x5/0x4+_0xb58ce5*this['frameDisplayWidth']/0x2);this['pFrameData']['set'](_0x13336c,_0x25a663);}_0x267b16=null,_0x2b423f=null,_0x3428fd=null,_0x13336c=null;}else{if(_0x532920==this['enPixelFormat']){var _0x372b86,_0x4951e3,_0x174e12;null!=_0x14166a?(_0x28d502=Math['round'](_0x14166a['nCropLeft']),_0x14e706=Math['round'](_0x14166a['nCropTop']),_0x372b86=_0x5bdf2c['subarray'](_0x14e706*_0x5dba3f+_0x28d502,_0x5dba3f*_0x529996),_0x4951e3=_0x5bdf2c['subarray'](_0x5dba3f*_0x529996+_0x14e706*_0x5dba3f/0x4+_0x28d502/0x2,_0x5dba3f*_0x529996*0x3/0x2),_0x51b8fc=Math['round'](_0x14166a['nCodeWidth'])):(_0x372b86=_0x5bdf2c['subarray'](0x0,_0x5dba3f*_0x529996),_0x4951e3=_0x5bdf2c['subarray'](_0x5dba3f*_0x529996,_0x5dba3f*_0x529996*0x3/0x2),_0x51b8fc=this['frameDisplayWidth']);for(var _0x2c9864=0x0;_0x2c9864<this['frameDisplayHeight'];++_0x2c9864){var _0x337f86=Math['round'](_0x2c9864*_0x51b8fc),_0x50a9ce=Math['round'](_0x2c9864*_0x51b8fc+this['frameDisplayWidth']);_0x174e12=_0x372b86['slice'](_0x337f86,_0x50a9ce);var _0x638927=Math['round'](_0x2c9864*this['frameDisplayWidth']);this['pFrameData']['set'](_0x174e12,_0x638927);}for(var _0x29fc18=0x0;_0x29fc18<this['frameDisplayHeight']/0x2;++_0x29fc18){var _0x214b42=Math['round'](_0x29fc18*_0x51b8fc),_0x3b1a87=Math['round'](_0x29fc18*_0x51b8fc+this['frameDisplayWidth']);_0x174e12=_0x4951e3['slice'](_0x214b42,_0x3b1a87);var _0x2c17e5=Math['round'](this['frameDisplayWidth']*this['frameDisplayHeight']+_0x29fc18*this['frameDisplayWidth']);this['pFrameData']['set'](_0x174e12,_0x2c17e5);}_0x372b86=null,_0x4951e3=null,_0x174e12=null;}}return _0xa87ede;}},{'key':'_SetImagePostProcess','value':function(){var _0x30cf7b=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fBrightness');if(_0x30cf7b<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x30cf7b,this['fBrightness']);var _0x5553d2=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fHue');if(_0x5553d2<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x5553d2,this['fHue']);var _0x42c592=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fSaturation');if(_0x42c592<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x42c592,this['fSaturation']);var _0x3629e8=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fContrast');if(_0x3629e8<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x3629e8,this['fContrast']);var _0x1c53e9=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fSharpness');if(_0x1c53e9<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x1c53e9,this['fSharpness']);var _0x5733f8=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fWndWidth');if(_0x5733f8<=0x0)return _0x4d26c0;this['ctx']['uniform1f'](_0x5733f8,this['frameDisplayWidth']);var _0x2dad49=this['ctx']['getUniformLocation'](this['videoShaderProgram'],'fWndHeight');return _0x2dad49<=0x0?_0x4d26c0:(this['ctx']['uniform1f'](_0x2dad49,this['frameDisplayHeight']),_0xa87ede);}},{'key':'_ComputeRotateLimits','value':function(){if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']||this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']){var _0x31467d,_0x35837a;if(this['enDisplayEffect']==_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']?(_0x31467d=_0x44d661,_0x35837a=_0x5affea):(_0x31467d=_0x438d57,_0x35837a=_0x2506c4),0x0==this['canvas']['width']||0x0==this['canvas']['height'])this['fRotateLimitX']=_0x31467d,this['fRotateLimitY']=_0x35837a;else{var _0x4a5e79=Math['tan'](2.748893525);if(Math['abs'](_0x4a5e79*this['fScale'])<0x1){var _0x50f721=_0x4a5e79*_0x4a5e79+0x1,_0x185702=-0x2*_0x4a5e79*_0x4a5e79*this['fScale'],_0x571130=_0x4a5e79*_0x4a5e79*this['fScale']*this['fScale']-0x1,_0x3fa40c=(-_0x185702-Math['sqrt'](_0x185702*_0x185702-0x4*_0x50f721*_0x571130))/(0x2*_0x50f721),_0x429003=_0x4a5e79*(_0x3fa40c-this['fScale']);this['fRotateLimitX']=Math['acos'](_0x429003/Math['sqrt'](_0x3fa40c*_0x3fa40c+_0x429003*_0x429003)),this['fRotateLimitX']<_0x31467d&&(this['fRotateLimitX']=_0x31467d);}else this['fRotateLimitX']=_0x31467d;var _0x536723=Math['atan'](this['canvas']['width']/this['canvas']['height']*Math['tan'](_0x13b181/0x2));if(_0x4a5e79=Math['tan'](_0x530a52-_0x536723),Math['abs'](_0x4a5e79*this['fScale'])<0x1){var _0x3a1ac0=_0x4a5e79*_0x4a5e79+0x1,_0x2c4813=-0x2*_0x4a5e79*_0x4a5e79*this['fScale'],_0x2b2259=_0x4a5e79*_0x4a5e79*this['fScale']*this['fScale']-0x1,_0x1484df=(-_0x2c4813-Math['sqrt'](_0x2c4813*_0x2c4813-0x4*_0x3a1ac0*_0x2b2259))/(0x2*_0x3a1ac0),_0x2c89d0=_0x4a5e79*(_0x1484df-this['fScale']);this['fRotateLimitY']=Math['acos'](_0x2c89d0/Math['sqrt'](_0x1484df*_0x1484df+_0x2c89d0*_0x2c89d0)),this['fRotateLimitY']<_0x35837a&&(this['fRotateLimitY']=_0x35837a);}else this['fRotateLimitY']=_0x35837a;}this['fRotateX']>this['fRotateLimitX']&&(this['fRotateX']=this['fRotateLimitX']),this['fRotateX']<-this['fRotateLimitX']&&(this['fRotateX']=-this['fRotateLimitX']),this['fRotateY']>this['fRotateLimitY']&&(this['fRotateY']=this['fRotateLimitX']),this['fRotateY']<-this['fRotateLimitX']&&(this['fRotateY']=-this['fRotateLimitX']);}return _0xa87ede;}}]),_0x2425ba;}()),_0x47e209=(function(){function _0x142b4f(){_0x54580d(this,_0x142b4f),this['canvas']=null,this['ctx']=null,this['regionSx']=0x0,this['regionSy']=0x0,this['regionSw']=0x0,this['regionSh']=0x0,this['needRect']=!0x1,this['bAntialias']=!0x1,this['bRecreateAntia']=!0x1,this['pfuncCBIn']=null,this['pUserIn']=null,this['pfuncCBOut']=null,this['pUserOut']=null;}return _0x4fd085(_0x142b4f,[{'key':'SR_Init','value':function(_0x5ecf9e){this['canvas']=_0x5ecf9e,this['ctx']=this['canvas']['getContext']('2d'),this['ctx']||console['log']('your\\x20browser\\x20does\\x20not\\x20support\\x202d\\x20render');}},{'key':'SR_Draw','value':function(_0x2b71ee){return this['needRect']?this['ctx']['drawImage'](_0x2b71ee,this['regionSx'],this['regionSy'],this['regionSw'],this['regionSh'],0x0,0x0,this['canvas']['width'],this['canvas']['height']):this['ctx']['drawImage'](_0x2b71ee,0x0,0x0,_0x2b71ee['displayWidth'],_0x2b71ee['displayHeight'],0x0,0x0,this['canvas']['width'],this['canvas']['height']),null!=this['pfuncCBIn']&&this['pfuncCBIn'](this['pUserIn']),0x1;}},{'key':'GetCanvasData','value':function(_0x25230b){console['log']('%c\\x20start\\x20time:'+new Date()['getMinutes']()+':'+new Date()['getSeconds']()+'.'+new Date()['getMilliseconds'](),'color:\\x20blue');var _0x574217=this['ctx']['getImageData'](0x0,0x0,this['canvas']['width'],this['canvas']['height']);console['log']('%c\\x202\\x20time:'+new Date()['getMinutes']()+':'+new Date()['getSeconds']()+'.'+new Date()['getMilliseconds'](),'color:\\x20blue');var _0x2d10bb='jpeg',_0x5a684e='image/jpeg',_0x6b5089=document['createElement']('canvas'),_0x5315a3=_0x6b5089['getContext']('2d');_0x6b5089['width']=this['canvas']['width'],_0x6b5089['height']=this['canvas']['height'],_0x5315a3['putImageData'](_0x574217,0x0,0x0);var _0x24024d=_0x6b5089['toDataURL'](),_0x26efe5=document['createElement']('a');_0x26efe5['download']=new Date()['getTime']()+'.'+_0x2d10bb,_0x26efe5['href']=_0x24024d,_0x26efe5['dataset']['downloadurl']=[_0x5a684e,_0x26efe5['download'],_0x26efe5['href']]['join'](':'),document['body']['appendChild'](_0x26efe5),_0x26efe5['click'](),document['body']['removeChild'](_0x26efe5),console['log']('%c\\x20end\\x20time:'+new Date()['getMinutes']()+':'+new Date()['getSeconds']()+'.'+new Date()['getMilliseconds'](),'color:\\x20blue');}},{'key':'SR_DelSubPort','value':function(_0x57fda8){return 0x0;}},{'key':'SR_AddSubPort','value':function(_0x36c54a){return 0x0;}},{'key':'SR_SetDisplayRect','value':function(_0x115279,_0xd4deec,_0x5a44bc,_0x341c14){this['regionSx']=_0x115279,this['regionSy']=_0xd4deec,this['regionSw']=_0x5a44bc,this['regionSh']=_0x341c14,this['needRect']=!0x0;}},{'key':'SR_Destroy','value':function(){this['canvas']=null,this['ctx']=null,this['regionSx']=0x0,this['regionSy']=0x0,this['regionSw']=0x0,this['regionSh']=0x0,this['needRect']=!0x1;}},{'key':'SR_SetCanvasSize','value':function(_0x585c32,_0x3f5351){this['canvas']['width']=_0x585c32,this['canvas']['height']=_0x3f5351;}},{'key':'SR_GetCanvasSize','value':function(){console['log']('canvas\\x20width:'+this['canvas']['width']+',height:'+this['canvas']['height']);}},{'key':'SR_SetAntialias','value':function(_0x41dd55){return _0x41dd55!=this['bAntialias']?(this['bAntialias']=_0x41dd55,this['bRecreateAntia']=!0x0):this['bRecreateAntia']=!0x1,this['bRecreateAntia']&&(this['bAntialias']?(this['canvas']['width']=0x5*this['canvas']['width'],this['canvas']['height']=0x5*this['canvas']['height'],this['canvas']['style']['transform']='scale(0.2)',this['canvas']['style']['transformOrigin']='0\\x200'):(this['canvas']['width']=this['canvas']['width']/0x5,this['canvas']['height']=this['canvas']['height']/0x5,this['canvas']['style']['transform']='scale(1)',this['canvas']['style']['transformOrigin']='0\\x200')),0x1;}},{'key':'SR_SetCallBack','value':function(_0x4d1e6d,_0x1f07ee,_0x3d33ea){switch(_0x3d33ea){case _0x444649:this['pfuncCBIn']=_0x4d1e6d,this['pUserIn']=_0x1f07ee;break;case _0x4f7368:this['pfuncCBOut']=_0x4d1e6d,this['pUserOut']=_0x1f07ee;break;default:return 0x0;}return 0x1;}},{'key':'SR_DrawFont','value':function(_0x2963cc,_0x4b046e,_0x516b83,_0x38303f,_0x31842a,_0x353830,_0x1a9008,_0x36e714,_0x39a389){var _0x27d4e5=[],_0x15ef3d={};return _0x15ef3d['bBackground']=_0x353830,_0x15ef3d['nFontWidth']=_0x38303f,_0x15ef3d['nFontHeight']=_0x31842a,_0x15ef3d['pstBGColor']=_0x1a9008,_0x15ef3d['pstFontColor']=_0x516b83,_0x15ef3d['pString']=_0x2963cc,_0x15ef3d['pstStartPos']=_0x4b046e,_0x15ef3d['fRotateAngle']=_0x36e714,_0x15ef3d['pFontFamily']=_0x39a389,_0x27d4e5['push'](_0x15ef3d),this['SR_DrawFontEx'](_0x27d4e5,0x1),0x1;}},{'key':'SR_DrawFontEx','value':function(_0x57d469,_0x12c5ae){for(var _0x2b5ed6=0x0;_0x2b5ed6<_0x12c5ae;_0x2b5ed6++){this['ctx']['textBaseline']='top';var _0x350f8f=_0x57d469[_0x2b5ed6]['nFontWidth'],_0x46fd6d=_0x57d469[_0x2b5ed6]['nFontHeight'],_0x2d8f2f=(_0x350f8f=Math['round'](_0x350f8f))<(_0x46fd6d=Math['round'](_0x46fd6d))?_0x350f8f:_0x46fd6d;this['ctx']['font']=_0x2d8f2f['toString']()+'px\\x20'+_0x57d469[_0x2b5ed6]['pFontFamily'];var _0x3e589a=parseInt(0xff*_0x57d469[_0x2b5ed6]['pstFontColor']['fR']),_0x4fd711=parseInt(0xff*_0x57d469[_0x2b5ed6]['pstFontColor']['fG']),_0x4755ae=parseInt(0xff*_0x57d469[_0x2b5ed6]['pstFontColor']['fB']),_0x43ec1f=_0x3e589a<0x10?'0'+_0x3e589a['toString'](0x10):_0x3e589a['toString'](0x10),_0x25bbfd=_0x4fd711<0x10?'0'+_0x4fd711['toString'](0x10):_0x4fd711['toString'](0x10),_0x1dead4=_0x4755ae<0x10?'0'+_0x4755ae['toString'](0x10):_0x4755ae['toString'](0x10);this['ctx']['fillStyle']='#'+_0x43ec1f+_0x25bbfd+_0x1dead4,this['ctx']['globalAlpha']=_0x57d469[_0x2b5ed6]['pstFontColor']['fA'],this['ctx']['fillText'](_0x57d469[_0x2b5ed6]['pString'],_0x57d469[_0x2b5ed6]['pstStartPos']['fX']*this['canvas']['width'],_0x57d469[_0x2b5ed6]['pstStartPos']['fY']*this['canvas']['height']);}return 0x1;}},{'key':'SR_DrawImage','value':function(_0x5e1584,_0x4fe178,_0x4811b5,_0xa8f872,_0x15dd02,_0x226fc5){return 0x1;}},{'key':'SR_DrawLinesEx','value':function(_0x564439,_0x1a98fd,_0x33d077,_0xaa2fdd){return 0x1;}}]),_0x142b4f;}()),_0x30cc90=(function(){function _0x132b86(){_0x54580d(this,_0x132b86),this['bPortAllocated']=[],this['pRenderParam']=[],this['pFishParam']=[],this['stPTZColor']=[],this['pPTZSetColor']=null,this['nBasePTZPointNum']=[],this['nOriPTZPointNum']=[],this['nPanoPTZPointNum']=[],this['nPTZFragmentNum']=[],this['pBasePTZPoints']=[],this['pPanoPTZPoints']=[],this['pRectPoints']=[],this['nPTZRectNum']=[],this['nPTZDisplayMode']=_0x569e7f,this['fRX1']=0x0,this['fRX2']=0x1,this['fRY1']=0x0,this['fRY2']=0x1,this['bBlack']=!0x1,this['pOriPTZPoints']=[],this['nWndPort']=_0x3cf544,this['nPlaceType']=0x0,this['nPTZFragmentNode']=[],this['bPTZSelected']=[],this['nPTZDisplayMode']=_0x495db0;for(var _0x26ae66=0x0;_0x26ae66<_0x379995;++_0x26ae66){this['bPortAllocated'][_0x26ae66]=!0x1,this['bPTZSelected'][_0x26ae66]=!0x1,this['pRenderParam'][_0x26ae66]=null,this['pFishParam'][_0x26ae66]=null,this['stPTZColor'][_0x26ae66]={},this['stPTZColor'][_0x26ae66]['fR']=0x0,this['stPTZColor'][_0x26ae66]['fG']=0x0,this['stPTZColor'][_0x26ae66]['fB']=0x0,this['stPTZColor'][_0x26ae66]['fA']=0x0,this['nBasePTZPointNum'][_0x26ae66]=0x0,this['nOriPTZPointNum'][_0x26ae66]=0x0,this['nPanoPTZPointNum'][_0x26ae66]=0x0,this['nPTZRectNum'][_0x26ae66]=0x0,this['pPanoPTZPoints'][_0x26ae66]=[],this['pRectPoints'][_0x26ae66]=[],this['pBasePTZPoints'][_0x26ae66]=[],this['pOriPTZPoints'][_0x26ae66]=[];for(var _0x4e780f=0x0;_0x4e780f<0x4;++_0x4e780f)this['pRectPoints'][_0x26ae66][_0x4e780f]={},this['pRectPoints'][_0x26ae66][_0x4e780f]['fX']=0x0,this['pRectPoints'][_0x26ae66][_0x4e780f]['fY']=0x0;for(var _0x1fa045=0x0;_0x1fa045<_0x4b88be;++_0x1fa045)this['pBasePTZPoints'][_0x26ae66][_0x1fa045]={},this['pBasePTZPoints'][_0x26ae66][_0x1fa045]['fX']=0x0,this['pBasePTZPoints'][_0x26ae66][_0x1fa045]['fY']=0x0,this['pOriPTZPoints'][_0x26ae66][_0x1fa045]={},this['pOriPTZPoints'][_0x26ae66][_0x1fa045]['fX']=0x0,this['pOriPTZPoints'][_0x26ae66][_0x1fa045]['fY']=0x0,this['pPanoPTZPoints'][_0x26ae66][_0x1fa045]={},this['pPanoPTZPoints'][_0x26ae66][_0x1fa045]['fX']=0x0,this['pPanoPTZPoints'][_0x26ae66][_0x1fa045]['fY']=0x0;this['nPTZFragmentNum'][_0x26ae66]=0x0,this['nPTZFragmentNode'][_0x26ae66]=[];for(var _0x5716c7=0x0;_0x5716c7<0x64;++_0x5716c7)this['nPTZFragmentNode'][_0x26ae66][_0x5716c7]=0x0;}this['InitColorList']();}return _0x4fd085(_0x132b86,[{'key':'GetFECPort','value':function(_0x422de9){for(var _0xeda2cb=_0x3cf544,_0x5a74b9=0x0;_0x5a74b9<_0x379995;++_0x5a74b9)if(0x0==this['bPortAllocated'][_0x5a74b9]){_0xeda2cb=_0x5a74b9;break;}if(_0xeda2cb==_0x3cf544)return _0xeda2cb;if(_0x422de9==_0x186ff9['SR_DE_NULL'])return _0xeda2cb;var _0xb974d1=this['JudgeDisplayEffect'](_0x422de9);if(_0xa87ede!=_0xb974d1)return this['FreeFECPort'](_0xeda2cb),_0xeda2cb=_0x3cf544;if(_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']==_0x422de9||_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']==_0x422de9||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']==_0x422de9||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']==_0x422de9||_0x186ff9['SR_DE_FISH_PANORAMA_WALL']==_0x422de9||_0x186ff9['SR_DE_FISH_ORIGINAL']==_0x422de9){if(_0x3cf544!=this['nWndPort'])return this['FreeFECPort'](_0xeda2cb),_0xeda2cb=_0x3cf544;this['nWndPort']=_0xeda2cb;}if(!(_0x186ff9['SR_DE_FISH_PTZ_CEILING']!=_0x422de9&&_0x186ff9['SR_DE_FISH_PTZ_FLOOR']!=_0x422de9&&_0x186ff9['SR_DE_FISH_PTZ_WALL']!=_0x422de9||_0x3cf544==this['nWndPort']||null==this['pRenderParam'][this['nWndPort']]||_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']!=this['pRenderParam'][this['nWndPort']]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']!=this['pRenderParam'][this['nWndPort']]['nDisplayEffect']))return this['FreeFECPort'](_0xeda2cb),_0xeda2cb=_0x3cf544;if(_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']==_0x422de9||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']==_0x422de9){for(var _0x183f86=0x0;_0x183f86<_0x379995;++_0x183f86)if(null!=this['pRenderParam'][_0x183f86]&&(_0x186ff9['SR_DE_FISH_PTZ_CEILING']==this['pRenderParam'][_0x183f86]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_FLOOR']==this['pRenderParam'][_0x183f86]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_WALL']==this['pRenderParam'][_0x183f86]['nDisplayEffect']))return this['FreeFECPort'](_0xeda2cb),_0xeda2cb=_0x3cf544;}if(_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']==_0x422de9){for(var _0xde2840=0x0;_0xde2840<_0x379995;++_0xde2840)if(null!=this['pRenderParam'][_0xde2840]&&_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']==this['pRenderParam'][_0xde2840]['nDisplayEffect'])return this['FreeFECPort'](_0xeda2cb),_0xeda2cb=_0x3cf544;}if(_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']==_0x422de9){for(var _0x2ddcba=0x0;_0x2ddcba<_0x379995;++_0x2ddcba)if(null!=this['pRenderParam'][_0x2ddcba]&&_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']==this['pRenderParam'][_0x2ddcba]['nDisplayEffect'])return this['FreeFECPort'](_0xeda2cb),_0xeda2cb=_0x3cf544;}return this['pRenderParam'][_0xeda2cb]={},this['pRenderParam'][_0xeda2cb]['fCosH']=0x1,this['pRenderParam'][_0xeda2cb]['fSinH']=0x0,this['pRenderParam'][_0xeda2cb]['fCosV']=0x1,this['pRenderParam'][_0xeda2cb]['fSinV']=0x0,this['pRenderParam'][_0xeda2cb]['fAngle']=0x0,this['pRenderParam'][_0xeda2cb]['fRX1']=this['fRX1'],this['pRenderParam'][_0xeda2cb]['fRX2']=this['fRX2'],this['pRenderParam'][_0xeda2cb]['fRY1']=this['fRY1'],this['pRenderParam'][_0xeda2cb]['fRY2']=this['fRY2'],this['pRenderParam'][_0xeda2cb]['bBlack']=this['bBlack'],this['pRenderParam'][_0xeda2cb]['fZoom']=0.035+0.8,this['pRenderParam'][_0xeda2cb]['nDisplayEffect']=_0x422de9,this['pRenderParam'][_0xeda2cb]['bBlack']=!0x1,this['pRenderParam'][_0xeda2cb]['bCut']=!0x1,this['pFishParam'][_0xeda2cb]={},this['pFishParam'][_0xeda2cb]['nFishParamType']=0x0,this['pFishParam'][_0xeda2cb]['bCut']=!0x1,this['pFishParam'][_0xeda2cb]['fAngle']=this['pRenderParam'][_0xeda2cb]['fAngle'],this['pFishParam'][_0xeda2cb]['fPTZX']=0.5,this['pFishParam'][_0xeda2cb]['fPTZY']=0.5,this['pFishParam'][_0xeda2cb]['fRXLeft']=this['pRenderParam'][_0xeda2cb]['fRX1'],this['pFishParam'][_0xeda2cb]['fRXRight']=this['pRenderParam'][_0xeda2cb]['fRX2'],this['pFishParam'][_0xeda2cb]['fRYTop']=this['pRenderParam'][_0xeda2cb]['fRY1'],this['pFishParam'][_0xeda2cb]['fRYBottom']=this['pRenderParam'][_0xeda2cb]['fRY2'],this['pFishParam'][_0xeda2cb]['bBlack']=this['pRenderParam'][_0xeda2cb]['bBlack'],this['pFishParam'][_0xeda2cb]['fZoom']=(this['pRenderParam'][_0xeda2cb]['fZoom']-0.8)/0x7,this['bPortAllocated'][_0xeda2cb]=!0x0,_0xeda2cb;}},{'key':'FreeFECPort','value':function(_0x450324){if(_0x450324<0x0||_0x450324>=_0x379995)return _0x31ddcf;this['nWndPort']==_0x450324&&(this['nWndPort']=_0x3cf544),null!=this['pRenderParam'][_0x450324]&&(this['pRenderParam'][_0x450324]['fCosH']=0x1,this['pRenderParam'][_0x450324]['fSinH']=0x0,this['pRenderParam'][_0x450324]['fCosV']=0x1,this['pRenderParam'][_0x450324]['fSinV']=0x0,this['pRenderParam'][_0x450324]['fAngle']=0x0,this['pRenderParam'][_0x450324]['fZoom']=0x0,this['pRenderParam'][_0x450324]['fRX1']=0x0,this['pRenderParam'][_0x450324]['fRX2']=0x1,this['pRenderParam'][_0x450324]['fRY1']=0x0,this['pRenderParam'][_0x450324]['fRY2']=0x1,this['pRenderParam'][_0x450324]['nDisplayEffect']=0x0,this['pRenderParam'][_0x450324]['bBlack']=!0x1,this['pRenderParam'][_0x450324]['bCut']=!0x1),null!=this['pFishParam'][_0x450324]&&(this['pFishParam'][_0x450324]['nFishParamType']=0x0,this['pFishParam'][_0x450324]['fRXLeft']=0x0,this['pFishParam'][_0x450324]['fRXRight']=0x1,this['pFishParam'][_0x450324]['fRYTop']=0x0,this['pFishParam'][_0x450324]['fRYBottom']=0x1,this['pFishParam'][_0x450324]['bBlack']=!0x1,this['pFishParam'][_0x450324]['bCut']=!0x1,this['pFishParam'][_0x450324]['fAngle']=0x0,this['pFishParam'][_0x450324]['fZoom']=0x0,this['pFishParam'][_0x450324]['fPTZX']=0.5,this['pFishParam'][_0x450324]['fPTZY']=0.5),this['nBasePTZPointNum'][_0x450324]=0x0,this['nOriPTZPointNum'][_0x450324]=0x0,this['nPanoPTZPointNum'][_0x450324]=0x0,this['nPTZRectNum'][_0x450324]=0x0;for(var _0x5851aa=0x0;_0x5851aa<0x4;++_0x5851aa)this['pRectPoints'][_0x450324][_0x5851aa]['fX']=0x0,this['pRectPoints'][_0x450324][_0x5851aa]['fY']=0x0;for(var _0x509c4c=0x0;_0x509c4c<_0x4b88be;++_0x509c4c)this['pBasePTZPoints'][_0x450324][_0x509c4c]['fX']=0x0,this['pBasePTZPoints'][_0x450324][_0x509c4c]['fY']=0x0,this['pOriPTZPoints'][_0x450324][_0x509c4c]['fX']=0x0,this['pOriPTZPoints'][_0x450324][_0x509c4c]['fY']=0x0,this['pPanoPTZPoints'][_0x450324][_0x509c4c]['fX']=0x0,this['pPanoPTZPoints'][_0x450324][_0x509c4c]['fY']=0x0;if(null!=this['pPTZSetColor']&&(this['pPTZSetColor'][_0x450324]['fA']=0x0,this['pPTZSetColor'][_0x450324]['fR']=0x0,this['pPTZSetColor'][_0x450324]['fG']=0x0,this['pPTZSetColor'][_0x450324]['fB']=0x0),this['bPTZSelected'][_0x450324]=!0x1,0x0!=this['nPlaceType']){var _0x46235e=!0x1;if(null!=this['pRenderParam'][i]){for(var _0x61e3ec=0x0;_0x61e3ec<_0x379995;++_0x61e3ec)if(null!=this['pRenderParam'][_0x61e3ec]&&(_0x186ff9['SR_DE_FISH_PTZ_CEILING']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_FLOOR']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_WALL']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PANORAMA_WALL']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_CYLINDER_CEILING']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_CEILING']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']==this['pRenderParam'][_0x61e3ec]['nDisplayEffect'])){_0x46235e=!0x0;break;}}_0x46235e||(this['nPlaceType']=0x0);}for(var _0x308bbb=!0x1,_0x30bc0d=0x0;_0x30bc0d<_0x379995;++_0x30bc0d)if(null!=this['pRenderParam'][_0x30bc0d]){_0x308bbb=!0x0;break;}_0x308bbb||(this['fRX1']=0x0,this['fRX2']=0x1,this['fRY1']=0x0,this['fRY2']=0x1,this['bBlack']=!0x1),this['nPTZFragmentNum'][_0x450324]=0x0;for(var _0x59d008=0x0;_0x59d008<0x64;++_0x59d008)this['nPTZFragmentNode'][_0x450324][_0x59d008]=0x0;return this['bPortAllocated'][_0x450324]=!0x1,_0xa87ede;}},{'key':'DeInit','value':function(){for(var _0x2a6913=0x0;_0x2a6913<_0x379995;++_0x2a6913){for(var _0x5c283e=0x0;_0x5c283e<0x4;++_0x5c283e)this['pRectPoints'][_0x2a6913][_0x5c283e]=null;for(var _0x164210=0x0;_0x164210<_0x4b88be;++_0x164210)this['pBasePTZPoints'][_0x2a6913][_0x164210]=null,this['pOriPTZPoints'][_0x2a6913][_0x164210]=null,this['pPanoPTZPoints'][_0x2a6913][_0x164210]=null;this['nPTZFragmentNum'][_0x2a6913]=0x0,this['nPTZFragmentNode'][_0x2a6913]=null,this['bPortAllocated'][_0x2a6913]=!0x1,this['bPTZSelected'][_0x2a6913]=!0x1,this['pRenderParam'][_0x2a6913]=null,this['pFishParam'][_0x2a6913]=null,this['stPTZColor'][_0x2a6913]=null,this['nBasePTZPointNum'][_0x2a6913]=0x0,this['nOriPTZPointNum'][_0x2a6913]=0x0,this['nPanoPTZPointNum'][_0x2a6913]=0x0,this['nPTZRectNum'][_0x2a6913]=0x0,this['pPanoPTZPoints'][_0x2a6913]=null,this['pRectPoints'][_0x2a6913]=null,this['pBasePTZPoints'][_0x2a6913]=null,this['pOriPTZPoints'][_0x2a6913]=null;}return this['bPortAllocated']=null,this['pRenderParam']=null,this['pFishParam']=null,this['stPTZColor']=null,this['pPTZSetColor']=null,this['nBasePTZPointNum']=null,this['nOriPTZPointNum']=null,this['nPanoPTZPointNum']=null,this['nPTZFragmentNum']=null,this['pBasePTZPoints']=null,this['pPanoPTZPoints']=null,this['pRectPoints']=null,this['nPTZRectNum']=null,this['nPTZDisplayMode']=_0x569e7f,this['fRX1']=0x0,this['fRX2']=0x1,this['fRY1']=0x0,this['fRY2']=0x1,this['bBlack']=!0x1,this['pOriPTZPoints']=null,this['pBasePTZPoints']=null,this['nWndPort']=_0x3cf544,this['nPlaceType']=0x0,this['nPTZFragmentNode']=null,this['bPTZSelected']=null,this['nPTZDisplayMode']=_0x495db0,_0xa87ede;}},{'key':'InitColorList','value':function(){this['stPTZColor'][0x0]['fR']=0.5,this['stPTZColor'][0x0]['fG']=0.5,this['stPTZColor'][0x0]['fB']=0x0,this['stPTZColor'][0x0]['fA']=0x1,this['stPTZColor'][0x1]['fR']=0x1,this['stPTZColor'][0x1]['fG']=0x0,this['stPTZColor'][0x1]['fB']=0x0,this['stPTZColor'][0x1]['fA']=0x1,this['stPTZColor'][0x2]['fR']=0x0,this['stPTZColor'][0x2]['fG']=0x1,this['stPTZColor'][0x2]['fB']=0x0,this['stPTZColor'][0x2]['fA']=0x1,this['stPTZColor'][0x3]['fR']=0x0,this['stPTZColor'][0x3]['fG']=0x0,this['stPTZColor'][0x3]['fB']=0x1,this['stPTZColor'][0x3]['fA']=0x1,this['stPTZColor'][0x4]['fR']=0x1,this['stPTZColor'][0x4]['fG']=0x1,this['stPTZColor'][0x4]['fB']=0x0,this['stPTZColor'][0x4]['fA']=0x1,this['stPTZColor'][0x5]['fR']=0.5,this['stPTZColor'][0x5]['fG']=0x0,this['stPTZColor'][0x5]['fB']=0x1,this['stPTZColor'][0x5]['fA']=0x1,this['stPTZColor'][0x6]['fR']=0x0,this['stPTZColor'][0x6]['fG']=0x1,this['stPTZColor'][0x6]['fB']=0x1,this['stPTZColor'][0x6]['fA']=0x1,this['stPTZColor'][0x7]['fR']=0x1,this['stPTZColor'][0x7]['fG']=0.5,this['stPTZColor'][0x7]['fB']=0x0,this['stPTZColor'][0x7]['fA']=0x1,this['stPTZColor'][0x8]['fR']=0x0,this['stPTZColor'][0x8]['fG']=0.5,this['stPTZColor'][0x8]['fB']=0.5,this['stPTZColor'][0x8]['fA']=0x1;for(var _0x4a606d=0x9;_0x4a606d<_0x379995;_0x4a606d++)this['stPTZColor'][_0x4a606d]['fR']=0x1*_0x4a606d/_0x379995,this['stPTZColor'][_0x4a606d]['fG']=0x1*_0x4a606d/_0x379995,this['stPTZColor'][_0x4a606d]['fB']=0x1*_0x4a606d/_0x379995,this['stPTZColor'][_0x4a606d]['fA']=0x1;return _0xa87ede;}},{'key':'GetRangePoints','value':function(_0x25d84b){if(_0x25d84b<0x0||_0x25d84b>=_0x379995)return _0x31ddcf;if(null==this['pRenderParam'][_0x25d84b])return _0x520965;var _0x547759=0x0,_0x13094f=0x0;switch(this['nOriPTZPointNum'][_0x25d84b]=0x0,this['nBasePTZPointNum'][_0x25d84b]=0x0,this['pRenderParam'][_0x25d84b]['nDisplayEffect']){case _0x186ff9['SR_DE_FISH_PTZ_CEILING']:for(_0x13094f=0x0;_0x13094f<0x1;_0x13094f+=0.01)this['GetFishPTZCeiling'](_0x547759,_0x13094f,_0x25d84b);for(_0x13094f=0.9995,_0x547759=0x0;_0x547759<0x1;_0x547759+=0.02)this['GetFishPTZCeiling'](_0x547759,_0x13094f,_0x25d84b);for(_0x547759=0.999,_0x13094f=0.9995;_0x13094f>=0x0;_0x13094f-=0.01)this['GetFishPTZCeiling'](_0x547759,_0x13094f,_0x25d84b);for(_0x13094f=0x0,_0x547759=0.999;_0x547759>=0x0;_0x547759-=0.02)this['GetFishPTZCeiling'](_0x547759,_0x13094f,_0x25d84b);break;case _0x186ff9['SR_DE_FISH_PTZ_FLOOR']:for(_0x13094f=0x0;_0x13094f<0x1;_0x13094f+=0.01)this['GetFishPTZFloor'](_0x547759,_0x13094f,_0x25d84b);for(_0x13094f=0.9995,_0x547759=0x0;_0x547759<0x1;_0x547759+=0.02)this['GetFishPTZFloor'](_0x547759,_0x13094f,_0x25d84b);for(_0x547759=0.999,_0x13094f=0.9995;_0x13094f>=0x0;_0x13094f-=0.01)this['GetFishPTZFloor'](_0x547759,_0x13094f,_0x25d84b);for(_0x13094f=0x0,_0x547759=0.999;_0x547759>=0x0;_0x547759-=0.02)this['GetFishPTZFloor'](_0x547759,_0x13094f,_0x25d84b);break;case _0x186ff9['SR_DE_FISH_PTZ_WALL']:for(_0x13094f=0x0;_0x13094f<0x1;_0x13094f+=0.01)this['GetFishPTZWALL'](_0x547759,_0x13094f,_0x25d84b);for(_0x13094f=0.9995,_0x547759=0x0;_0x547759<0x1;_0x547759+=0.02)this['GetFishPTZWALL'](_0x547759,_0x13094f,_0x25d84b);for(_0x547759=0.999,_0x13094f=0.9995;_0x13094f>=0x0;_0x13094f-=0.01)this['GetFishPTZWALL'](_0x547759,_0x13094f,_0x25d84b);for(_0x13094f=0x0,_0x547759=0.999;_0x547759>=0x0;_0x547759-=0.02)this['GetFishPTZWALL'](_0x547759,_0x13094f,_0x25d84b);break;default:return _0x86aef9;}return _0xa87ede;}},{'key':'TransformPTZRangePoints','value':function(_0x2f3cac){if(_0x3cf544==this['nWndPort'])return _0x520965;if(null==this['pBasePTZPoints'][_0x2f3cac]||null==this['pRenderParam'][this['nWndPort']])return _0x520965;this['nPanoPTZPointNum'][_0x2f3cac]=0x0;var _0x3c706a=_0xa87ede,_0x2be664=this['nWndPort'];switch(this['pRenderParam'][_0x2be664]['nDisplayEffect']){case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:if(_0x3c706a=this['GetPanoPTZWall'](_0x2f3cac),_0xa87ede!=_0x3c706a)return _0x3c706a;break;case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:if(_0x3c706a=this['GetPanoPTZFloor'](_0x2f3cac),_0xa87ede!=_0x3c706a)return _0x3c706a;break;case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:if(_0x3c706a=this['GetPanoPTZCeiling'](_0x2f3cac),_0xa87ede!=_0x3c706a)return _0x3c706a;}return this['CalcPTZFragmentPoints'](_0x2f3cac),_0xa87ede;}},{'key':'GetRectPoints','value':function(_0x5e6c1c){if(_0x5e6c1c<0x0||_0x5e6c1c>=_0x379995)return _0x31ddcf;if(this['nWndPort']==_0x3cf544)return _0x520965;if(null==this['pRenderParam'][this['nWndPort']]||null==this['pFishParam'][_0x5e6c1c])return _0x520965;var _0x1f9178=this['pRenderParam'][this['nWndPort']]['nDisplayEffect'],_0x392ce2=_0xa87ede,_0x399f52={'fX':0x0,'fY':0x0};switch(_0x1f9178){case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:if(_0x392ce2=this['GetPointFish2PanoWall'](_0x399f52,this['pFishParam'][_0x5e6c1c]['fPTZX'],this['pFishParam'][_0x5e6c1c]['fPTZY']),_0xa87ede!=_0x392ce2)return _0x392ce2;break;case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:if(_0x392ce2=this['GetPointFish2PanoFloor'](_0x399f52,this['pFishParam'][_0x5e6c1c]['fPTZX'],this['pFishParam'][_0x5e6c1c]['fPTZY']),_0xa87ede!=_0x392ce2)return _0x86aef9==_0x392ce2&&(this['pRectPoints'][_0x5e6c1c]=null),_0x392ce2;break;case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:if(_0x392ce2=this['GetPointFish2PanoCeiling'](_0x399f52,this['pFishParam'][_0x5e6c1c]['fPTZX'],this['pFishParam'][_0x5e6c1c]['fPTZY']),_0xa87ede!=_0x392ce2)return _0x86aef9==_0x392ce2&&(this['pRectPoints'][_0x5e6c1c]=null),_0x392ce2;break;case _0x186ff9['SR_DE_FISH_ORIGINAL']:_0x399f52['fX']=this['pFishParam'][_0x5e6c1c]['fPTZX'],_0x399f52['fY']=this['pFishParam'][_0x5e6c1c]['fPTZY'];}if(null==this['pRectPoints'][_0x5e6c1c]){this['pRectPoints'][_0x5e6c1c]=[];for(var _0x1698af=0x0;_0x1698af<0x4;++_0x1698af)this['pRectPoints'][_0x5e6c1c][_0x1698af]={},this['pRectPoints'][_0x5e6c1c][_0x1698af]['fX']=0x0,this['pRectPoints'][_0x5e6c1c][_0x1698af]['fY']=0x0;}return this['pRectPoints'][_0x5e6c1c][0x0]['fX']=_0x399f52['fX']-_0x466865,this['pRectPoints'][_0x5e6c1c][0x0]['fY']=_0x399f52['fY']-_0x466865,this['pRectPoints'][_0x5e6c1c][0x1]['fX']=_0x399f52['fX']+_0x466865,this['pRectPoints'][_0x5e6c1c][0x1]['fY']=_0x399f52['fY']-_0x466865,this['pRectPoints'][_0x5e6c1c][0x2]['fX']=_0x399f52['fX']+_0x466865,this['pRectPoints'][_0x5e6c1c][0x2]['fY']=_0x399f52['fY']+_0x466865,this['pRectPoints'][_0x5e6c1c][0x3]['fX']=_0x399f52['fX']-_0x466865,this['pRectPoints'][_0x5e6c1c][0x3]['fY']=_0x399f52['fY']+_0x466865,this['nPTZRectNum'][_0x5e6c1c]=0x4,_0xa87ede;}},{'key':'GetFishPTZCeiling','value':function(_0x517b14,_0x2ce55a,_0x2434b6){var _0xf3955c,_0x3a92e4,_0x1cd7f2,_0x198938,_0x2f97b3,_0x108ac4,_0x49eb1e,_0x36d97d={'fX':0x0,'fY':0x0},_0x22b255={'fX':0x0,'fY':0x0},_0x5daa5e={'fX':0x0,'fY':0x0},_0x4af31d={};_0x198938=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x2f97b3=(this['fRX1']+this['fRX2'])/0x2*0x1,_0x108ac4=(this['fRY1']+this['fRY2'])/0x2*_0x198938,_0x49eb1e=(this['fRX2']-this['fRX1'])/0x2*0x1,_0x36d97d['fX']=_0x2ce55a-0.5,_0x36d97d['fY']=0.5-_0x517b14,_0xf3955c=this['pRenderParam'][_0x2434b6]['fZoom'],_0x22b255['fX']=_0x36d97d['fX'],_0x22b255['fY']=_0x36d97d['fY']*this['pRenderParam'][_0x2434b6]['fCosV']+_0xf3955c*this['pRenderParam'][_0x2434b6]['fSinV'],_0x3a92e4=_0xf3955c*this['pRenderParam'][_0x2434b6]['fCosV']-_0x36d97d['fY']*this['pRenderParam'][_0x2434b6]['fSinV'],_0x1cd7f2=Math['sqrt'](_0x22b255['fX']*_0x22b255['fX']+_0x22b255['fY']*_0x22b255['fY']);var _0x1ce234=Math['sqrt'](_0x22b255['fX']*_0x22b255['fX']+_0x22b255['fY']*_0x22b255['fY']+_0x3a92e4*_0x3a92e4),_0x1e49ba=Math['asin'](_0x1cd7f2/_0x1ce234)/1.5707963*0.5;_0x22b255['fX']=_0x1e49ba*_0x22b255['fX']/_0x1cd7f2,_0x22b255['fY']=_0x1e49ba*_0x22b255['fY']/_0x1cd7f2,_0x5daa5e['fX']=_0x22b255['fX']*this['pRenderParam'][_0x2434b6]['fCosH']-_0x22b255['fY']*this['pRenderParam'][_0x2434b6]['fSinH'],_0x5daa5e['fY']=_0x22b255['fX']*this['pRenderParam'][_0x2434b6]['fSinH']+_0x22b255['fY']*this['pRenderParam'][_0x2434b6]['fCosH'],_0x4af31d['fX']=0x2*_0x5daa5e['fX']*_0x49eb1e+_0x2f97b3,_0x4af31d['fY']=0x2*-_0x5daa5e['fY']*_0x49eb1e+_0x108ac4;var _0x2433b8=this['nBasePTZPointNum'][_0x2434b6];this['pBasePTZPoints'][_0x2434b6][_0x2433b8]['fX']=_0x5daa5e['fX']+0.5,this['pBasePTZPoints'][_0x2434b6][_0x2433b8]['fY']=0.5-_0x5daa5e['fY'],this['nBasePTZPointNum'][_0x2434b6]=this['nBasePTZPointNum'][_0x2434b6]+0x1;var _0x308ac9=this['fRX1']<=0x0?0x0:0x1*this['fRX1'],_0x4efb75=this['fRY1']<=0x0?0x0:this['fRY1']*_0x198938,_0x17a5c7=this['fRX2']>=0x1?0x1-_0x308ac9:0x1*this['fRX2']-_0x308ac9,_0x5f1e62=this['fRY2']>=0x1?_0x198938-_0x4efb75:this['fRY2']*_0x198938-_0x4efb75;if(_0x4af31d['fX']=(_0x4af31d['fX']-_0x308ac9)/_0x17a5c7,_0x4af31d['fY']=(_0x4af31d['fY']-_0x4efb75)/_0x5f1e62,_0x4af31d['fX']<=0x1&&_0x4af31d['fY']<=0x1&&_0x4af31d['fX']>=0x0&&_0x4af31d['fY']>=0x0){var _0x37b5f2=this['nOriPTZPointNum'][_0x2434b6];this['pOriPTZPoints'][_0x2434b6][_0x37b5f2]['fX']=_0x4af31d['fX'],this['pOriPTZPoints'][_0x2434b6][_0x37b5f2]['fY']=_0x4af31d['fY'],this['nOriPTZPointNum'][_0x2434b6]=this['nOriPTZPointNum'][_0x2434b6]+0x1;}return _0xa87ede;}},{'key':'GetFishPTZFloor','value':function(_0x5d64c8,_0x230377,_0x20b682){var _0x2402ff,_0x2bb293,_0x51bf0f,_0x1f4a36,_0x11cb3a,_0x7fb709,_0x1491eb,_0x598378={'fX':0x0,'fY':0x0},_0x737f5e={'fX':0x0,'fY':0x0},_0x185f6e={'fX':0x0,'fY':0x0},_0x243ac0={};_0x1f4a36=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x11cb3a=(this['fRX1']+this['fRX2'])/0x2*0x1,_0x7fb709=(this['fRY1']+this['fRY2'])/0x2*_0x1f4a36,_0x1491eb=(this['fRX2']-this['fRX1'])/0x2*0x1,_0x598378['fX']=_0x5d64c8-0.5,_0x598378['fY']=_0x230377-0.5,_0x2402ff=this['pRenderParam'][_0x20b682]['fZoom'],_0x737f5e['fX']=_0x598378['fX'],_0x737f5e['fY']=_0x598378['fY']*this['pRenderParam'][_0x20b682]['fCosV']+_0x2402ff*this['pRenderParam'][_0x20b682]['fSinV'],_0x2bb293=_0x2402ff*this['pRenderParam'][_0x20b682]['fCosV']-_0x598378['fY']*this['pRenderParam'][_0x20b682]['fSinV'],_0x51bf0f=Math['sqrt'](_0x737f5e['fX']*_0x737f5e['fX']+_0x737f5e['fY']*_0x737f5e['fY']);var _0x441996=Math['sqrt'](_0x737f5e['fX']*_0x737f5e['fX']+_0x737f5e['fY']*_0x737f5e['fY']+_0x2bb293*_0x2bb293),_0x3be58c=Math['asin'](_0x51bf0f/_0x441996)/1.5707963*0.5;_0x737f5e['fX']=_0x3be58c*_0x737f5e['fX']/_0x51bf0f,_0x737f5e['fY']=_0x3be58c*_0x737f5e['fY']/_0x51bf0f,_0x185f6e['fX']=_0x737f5e['fX']*this['pRenderParam'][_0x20b682]['fCosH']-_0x737f5e['fY']*this['pRenderParam'][_0x20b682]['fSinH'],_0x185f6e['fY']=_0x737f5e['fX']*this['pRenderParam'][_0x20b682]['fSinH']+_0x737f5e['fY']*this['pRenderParam'][_0x20b682]['fCosH'],_0x243ac0['fX']=0x2*_0x185f6e['fX']*_0x1491eb+_0x11cb3a,_0x243ac0['fY']=0x2*_0x185f6e['fY']*_0x1491eb+_0x7fb709;var _0x15bcf5=this['nBasePTZPointNum'][_0x20b682];this['pBasePTZPoints'][_0x20b682][_0x15bcf5]['fX']=_0x185f6e['fX']+0.5,this['pBasePTZPoints'][_0x20b682][_0x15bcf5]['fY']=_0x185f6e['fY']+0.5,this['nBasePTZPointNum'][_0x20b682]=this['nBasePTZPointNum'][_0x20b682]+0x1;var _0x1e561a=this['fRX1']<=0x0?0x0:0x1*this['fRX1'],_0x19a04e=this['fRY1']<=0x0?0x0:this['fRY1']*_0x1f4a36,_0x470745=this['fRX2']>=0x1?0x1-_0x1e561a:0x1*this['fRX2']-_0x1e561a,_0x3ffe59=this['fRY2']>=0x1?_0x1f4a36-_0x19a04e:this['fRY2']*_0x1f4a36-_0x19a04e;if(_0x243ac0['fX']=(_0x243ac0['fX']-_0x1e561a)/_0x470745,_0x243ac0['fY']=(_0x243ac0['fY']-_0x19a04e)/_0x3ffe59,_0x243ac0['fX']<=0x1&&_0x243ac0['fY']<=0x1&&_0x243ac0['fX']>=0x0&&_0x243ac0['fY']>=0x0){var _0xf69c5b=this['nOriPTZPointNum'][_0x20b682];this['pOriPTZPoints'][_0x20b682][_0xf69c5b]['fX']=_0x243ac0['fX'],this['pOriPTZPoints'][_0x20b682][_0xf69c5b]['fY']=_0x243ac0['fY'],this['nOriPTZPointNum'][_0x20b682]=this['nOriPTZPointNum'][_0x20b682]+0x1;}return _0xa87ede;}},{'key':'GetFishPTZWALL','value':function(_0x38c74c,_0x5d9e53,_0x98f087){var _0x596ea3,_0x51bf3e,_0x5780c4,_0x3e49f7,_0x30dad9,_0x10ea85,_0x27a63e,_0x51e487,_0x31152b={'fX':0x0,'fY':0x0},_0x4df952={'fX':0x0,'fY':0x0},_0x5e7e33={'fX':0x0,'fY':0x0},_0x44bf25={};_0x30dad9=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x10ea85=(this['fRX1']+this['fRX2'])/0x2*0x1,_0x27a63e=(this['fRY1']+this['fRY2'])/0x2*_0x30dad9,_0x51e487=(this['fRX2']-this['fRX1'])/0x2*0x1,_0x31152b['fX']=_0x5d9e53-0.5,_0x31152b['fY']=_0x38c74c-0.5,_0x596ea3=this['pRenderParam'][_0x98f087]['fZoom'],_0x4df952['fX']=_0x31152b['fX'],_0x4df952['fY']=_0x31152b['fY']*this['pRenderParam'][_0x98f087]['fCosV']+_0x596ea3*this['pRenderParam'][_0x98f087]['fSinV'],_0x51bf3e=_0x596ea3*this['pRenderParam'][_0x98f087]['fCosV']-_0x31152b['fY']*this['pRenderParam'][_0x98f087]['fSinV'],_0x5e7e33['fX']=_0x4df952['fX']*this['pRenderParam'][_0x98f087]['fCosH']+_0x51bf3e*this['pRenderParam'][_0x98f087]['fSinH'],_0x5e7e33['fY']=_0x4df952['fY'],_0x5780c4=_0x51bf3e*this['pRenderParam'][_0x98f087]['fCosH']-_0x4df952['fX']*this['pRenderParam'][_0x98f087]['fSinH'],_0x3e49f7=Math['sqrt'](_0x5e7e33['fX']*_0x5e7e33['fX']+_0x5e7e33['fY']*_0x5e7e33['fY']);var _0x9e123=Math['sqrt'](_0x5e7e33['fX']*_0x5e7e33['fX']+_0x5e7e33['fY']*_0x5e7e33['fY']+_0x5780c4*_0x5780c4),_0x14461f=Math['asin'](_0x3e49f7/_0x9e123)/1.5707963*0.5;_0x44bf25['fX']=_0x14461f*_0x5e7e33['fX']/_0x3e49f7*_0x51e487*0x2+_0x10ea85,_0x44bf25['fY']=_0x14461f*_0x5e7e33['fY']/_0x3e49f7*_0x51e487*0x2+_0x27a63e;var _0x18649b=this['nBasePTZPointNum'][_0x98f087];this['pBasePTZPoints'][_0x98f087][_0x18649b]['fX']=_0x14461f*_0x5e7e33['fX']/_0x3e49f7+0.5,this['pBasePTZPoints'][_0x98f087][_0x18649b]['fY']=_0x14461f*_0x5e7e33['fY']/_0x3e49f7+0.5,this['nBasePTZPointNum'][_0x98f087]=this['nBasePTZPointNum'][_0x98f087]+0x1;var _0x240ce4=this['fRX1']<=0x0?0x0:0x1*this['fRX1'],_0x5017ea=this['fRY1']<=0x0?0x0:this['fRY1']*_0x30dad9,_0x22234a=this['fRX2']>=0x1?0x1-_0x240ce4:0x1*this['fRX2']-_0x240ce4,_0x1a56a0=this['fRY2']>=0x1?_0x30dad9-_0x5017ea:this['fRY2']*_0x30dad9-_0x5017ea;if(_0x44bf25['fX']=(_0x44bf25['fX']-_0x240ce4)/_0x22234a,_0x44bf25['fY']=(_0x44bf25['fY']-_0x5017ea)/_0x1a56a0,_0x44bf25['fX']<=0x1&&_0x44bf25['fY']<=0x1&&_0x44bf25['fX']>=0x0&&_0x44bf25['fY']>=0x0){var _0x19cc2f=this['nOriPTZPointNum'][_0x98f087];this['pOriPTZPoints'][_0x98f087][_0x19cc2f]['fX']=_0x44bf25['fX'],this['pOriPTZPoints'][_0x98f087][_0x19cc2f]['fY']=_0x44bf25['fY'],this['nOriPTZPointNum'][_0x98f087]=this['nOriPTZPointNum'][_0x98f087]+0x1;}return _0xa87ede;}},{'key':'GetPanoPTZCeiling','value':function(_0x263f7b){if(null==this['pRenderParam'][_0x263f7b]||null==this['pRenderParam'][this['nWndPort']])return _0x520965;if(null==this['pBasePTZPoints'][_0x263f7b])return _0x520965;var _0x22ec24,_0x2ebe10,_0x186506=this['nBasePTZPointNum'][_0x263f7b];_0x22ec24=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x2ebe10=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0x22da37,_0x18297c=0x0;(this['fRX2']>0x1||this['fRY2']>0x1||this['fRY1']<0x0||this['fRX1']<0x0)&&(this['fRX1']<0x0&&(_0x22da37=0x1*-this['fRX1'])>_0x18297c&&(_0x18297c=_0x22da37),this['fRX2']>0x1&&(_0x22da37=0x1*(this['fRX2']-0x1))>_0x18297c&&(_0x18297c=_0x22da37),this['fRY1']<0x0&&(_0x22da37=-this['fRY1']*_0x22ec24)>_0x18297c&&(_0x18297c=_0x22da37),this['fRY2']>0x1&&(_0x22da37=(this['fRY2']-0x1)*_0x22ec24)>_0x18297c&&(_0x18297c=_0x22da37));for(var _0xf6789b,_0x579bb=_0x18297c/_0x2ebe10,_0x1304b7={'fX':0x0,'fY':0x0},_0x16843f={'fX':0x0,'fY':0x0},_0x581f36=0x0;_0x581f36<_0x186506;++_0x581f36)if(_0x16843f['fX']=this['pBasePTZPoints'][_0x263f7b][_0x581f36]['fX'],_0x16843f['fY']=this['pBasePTZPoints'][_0x263f7b][_0x581f36]['fY'],!(Math['abs'](_0x16843f['fX']-0.5)<_0x4a23c6&&Math['abs'](_0x16843f['fY']-0.5)<_0x4a23c6)){var _0x27e377={'fX':0x0,'fY':0x0},_0x542b58={'fX':0x0,'fY':0x0};_0x27e377['fX']=_0x16843f['fX']-0.5,_0x27e377['fY']=_0x16843f['fY']-0.5,_0x542b58['fX']=-0.5*Math['sin'](this['pRenderParam'][this['nWndPort']]['fAngle']),_0x542b58['fY']=0.5*Math['cos'](this['pRenderParam'][this['nWndPort']]['fAngle']);var _0x30de9a=Math['sqrt'](_0x27e377['fX']*_0x27e377['fX']+_0x27e377['fY']*_0x27e377['fY']),_0x3fb02f=Math['sqrt'](_0x542b58['fX']*_0x542b58['fX']+_0x542b58['fY']*_0x542b58['fY']);if(_0xf6789b=Math['acos']((_0x27e377['fX']*_0x542b58['fX']+_0x27e377['fY']*_0x542b58['fY'])/(_0x30de9a*_0x3fb02f)),_0x27e377['fX']*_0x542b58['fY']-_0x27e377['fY']*_0x542b58['fX']>0x0&&(_0xf6789b=6.2831852-_0xf6789b),_0x1304b7['fX']=_0xf6789b/6.2831853,_0x1304b7['fY']=(0x2*(0.5-_0x30de9a)-_0x579bb)/(0.8-_0x579bb),_0x1304b7['fY']>=0x0&&_0x1304b7['fX']>=0x0&&_0x1304b7['fY']<=0x1&&_0x1304b7['fX']<=0x1){var _0x2a305c=this['nPanoPTZPointNum'][_0x263f7b];this['pPanoPTZPoints'][_0x263f7b][_0x2a305c]['fX']=_0x1304b7['fX'],this['pPanoPTZPoints'][_0x263f7b][_0x2a305c]['fY']=_0x1304b7['fY'],this['nPanoPTZPointNum'][_0x263f7b]=this['nPanoPTZPointNum'][_0x263f7b]+0x1;}}return _0xa87ede;}},{'key':'GetPanoPTZFloor','value':function(_0x5d0fc0){if(null==this['pRenderParam'][_0x5d0fc0]||null==this['pRenderParam'][this['nWndPort']])return _0x520965;if(null==this['pBasePTZPoints'][_0x5d0fc0])return _0x520965;var _0x100b2a,_0x18120b,_0x19ec44=this['nBasePTZPointNum'][_0x5d0fc0];_0x100b2a=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x18120b=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0x543faf,_0x261275=0x0;(this['fRX2']>0x1||this['fRY2']>0x1||this['fRY1']<0x0||this['fRX1']<0x0)&&(this['fRX1']<0x0&&(_0x543faf=0x1*-this['fRX1'])>_0x261275&&(_0x261275=_0x543faf),this['fRX2']>0x1&&(_0x543faf=0x1*(this['fRX2']-0x1))>_0x261275&&(_0x261275=_0x543faf),this['fRY1']<0x0&&(_0x543faf=-this['fRY1']*_0x100b2a)>_0x261275&&(_0x261275=_0x543faf),this['fRY2']>0x1&&(_0x543faf=(this['fRY2']-0x1)*_0x100b2a)>_0x261275&&(_0x261275=_0x543faf));for(var _0x2f2b37,_0x27bd4a=_0x261275/_0x18120b,_0x2a79e7={'fX':0x0,'fY':0x0},_0x10ed1b={'fX':0x0,'fY':0x0},_0x54ae89=0x0;_0x54ae89<_0x19ec44;++_0x54ae89)if(_0x10ed1b['fX']=this['pBasePTZPoints'][_0x5d0fc0][_0x54ae89]['fX'],_0x10ed1b['fY']=this['pBasePTZPoints'][_0x5d0fc0][_0x54ae89]['fY'],!(Math['abs'](_0x10ed1b['fX']-0.5)<_0x4a23c6&&Math['abs'](_0x10ed1b['fY']-0.5)<_0x4a23c6)){var _0x2ecec4={'fX':0x0,'fY':0x0},_0x2f6c97={'fX':0x0,'fY':0x0};_0x2ecec4['fX']=_0x10ed1b['fX']-0.5,_0x2ecec4['fY']=_0x10ed1b['fY']-0.5,_0x2f6c97['fX']=-0.5*Math['sin'](this['pRenderParam'][this['nWndPort']]['fAngle']),_0x2f6c97['fY']=0.5*Math['cos'](this['pRenderParam'][this['nWndPort']]['fAngle']);var _0x4e4dea=Math['sqrt'](_0x2ecec4['fX']*_0x2ecec4['fX']+_0x2ecec4['fY']*_0x2ecec4['fY']),_0x186af7=Math['sqrt'](_0x2f6c97['fX']*_0x2f6c97['fX']+_0x2f6c97['fY']*_0x2f6c97['fY']);if(_0x2f2b37=Math['acos']((_0x2ecec4['fX']*_0x2f6c97['fX']+_0x2ecec4['fY']*_0x2f6c97['fY'])/(_0x4e4dea*_0x186af7)),_0x2ecec4['fX']*_0x2f6c97['fY']-_0x2ecec4['fY']*_0x2f6c97['fX']>0x0&&(_0x2f2b37=6.2831852-_0x2f2b37),_0x2a79e7['fX']=0x1-_0x2f2b37/6.2831853,_0x2a79e7['fY']=0x1-(0x2*(0.5-_0x4e4dea)-_0x27bd4a)/(0.8-_0x27bd4a),_0x2a79e7['fY']>=0x0&&_0x2a79e7['fX']>=0x0&&_0x2a79e7['fY']<=0x1&&_0x2a79e7['fX']<=0x1){var _0x16ff25=this['nPanoPTZPointNum'][_0x5d0fc0];this['pPanoPTZPoints'][_0x5d0fc0][_0x16ff25]['fX']=_0x2a79e7['fX'],this['pPanoPTZPoints'][_0x5d0fc0][_0x16ff25]['fY']=_0x2a79e7['fY'],this['nPanoPTZPointNum'][_0x5d0fc0]=this['nPanoPTZPointNum'][_0x5d0fc0]+0x1;}}return _0xa87ede;}},{'key':'GetPanoPTZWall','value':function(_0x42a7bd){if(null==this['pRenderParam'][_0x42a7bd]||null==this['pRenderParam'][this['nWndPort']])return _0x520965;if(null==this['pBasePTZPoints'][_0x42a7bd])return _0x520965;var _0x564e3d,_0x3e602d,_0x423c9f=this['nBasePTZPointNum'][_0x42a7bd];_0x564e3d=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x3e602d=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0x56aaa5,_0x1f4537,_0x54b6be,_0xb5f14d,_0x49fdb6,_0x2fb7bb=0x0,_0xf39383=0x1,_0x5125ea=0.1,_0x2b07de=0.9;this['fRX1']<0x0&&(_0x56aaa5=0x1*-this['fRX1'],_0x2fb7bb=_0x56aaa5/=0x2*_0x3e602d),this['fRX2']>0x1&&(_0x1f4537=0x1*(this['fRX2']-0x1),_0xf39383=0x1-(_0x1f4537/=0x2*_0x3e602d)),this['fRY1']<0x0&&(_0x54b6be=-this['fRY1']*_0x564e3d,_0x5125ea=(_0x54b6be/=0x2*_0x3e602d)>0.1?_0x54b6be:0.1),this['fRY2']>0x1&&(_0xb5f14d=(this['fRY2']-0x1)*_0x564e3d,_0x2b07de=(_0xb5f14d/=0x2*_0x3e602d)>0x1-0.9?0x1-_0xb5f14d:0.9);for(var _0x51c7d7={'fX':0x0,'fY':0x0},_0x15cbb7={'fX':0x0,'fY':0x0},_0x211521=0x0;_0x211521<_0x423c9f;++_0x211521){_0x15cbb7['fX']=this['pBasePTZPoints'][_0x42a7bd][_0x211521]['fX'],_0x15cbb7['fY']=this['pBasePTZPoints'][_0x42a7bd][_0x211521]['fY'];var _0x8074a7=0x2*_0x15cbb7['fX']*_0x3e602d,_0x445fec=0x2*_0x15cbb7['fY']*_0x3e602d;if(_0x49fdb6=Math['sqrt'](_0x3e602d*_0x3e602d-(_0x445fec-_0x3e602d)*(_0x445fec-_0x3e602d)),!(Math['abs'](_0x49fdb6)<_0x4a23c6)&&(_0x15cbb7['fX']=_0x3e602d*(_0x8074a7-_0x3e602d)/_0x49fdb6+_0x3e602d,_0x15cbb7['fY']=_0x445fec,_0x51c7d7['fX']=(_0x15cbb7['fX']-0x2*_0x2fb7bb*_0x3e602d)/(0x2*(_0xf39383-_0x2fb7bb)*_0x3e602d),_0x51c7d7['fY']=(_0x15cbb7['fY']-0x2*_0x5125ea*_0x3e602d)/(0x2*(_0x2b07de-_0x5125ea)*_0x3e602d),_0x51c7d7['fY']>=0x0&&_0x51c7d7['fX']>=0x0&&_0x51c7d7['fY']<=0x1&&_0x51c7d7['fX']<=0x1)){var _0x4f41e4=this['nPanoPTZPointNum'][_0x42a7bd];this['pPanoPTZPoints'][_0x42a7bd][_0x4f41e4]['fX']=_0x51c7d7['fX'],this['pPanoPTZPoints'][_0x42a7bd][_0x4f41e4]['fY']=_0x51c7d7['fY'],this['nPanoPTZPointNum'][_0x42a7bd]=this['nPanoPTZPointNum'][_0x42a7bd]+0x1;}}return _0xa87ede;}},{'key':'GetPointPano2FishCeiling','value':function(_0x2f3dd8,_0x7b3d9e,_0x3c003f){if(null==_0x2f3dd8||null==this['pRenderParam'][this['nWndPort']])return _0x520965;var _0x1ca50d,_0x4730c9;_0x1ca50d=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x4730c9=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0x1f6f27,_0x49d370=0x0,_0x4968e2=0x1,_0x30c450=0x0,_0x4aba84=0x1,_0xfcab6e=0x0;(this['fRX2']>0x1||this['fRY2']>0x1||this['fRX1']<0x0||this['fRY1']<0x0)&&(this['fRX1']<0x0&&((_0x1f6f27=0x1*-this['fRX1'])>_0xfcab6e&&(_0xfcab6e=_0x1f6f27),_0x49d370=_0x1f6f27/=0x2*_0x4730c9),this['fRX2']>0x1&&((_0x1f6f27=0x1*(this['fRX2']-0x1))>_0xfcab6e&&(_0xfcab6e=_0x1f6f27),_0x4968e2=0x1-(_0x1f6f27/=0x2*_0x4730c9)),this['fRY1']<0x0&&((_0x1f6f27=-this['fRY1']*_0x1ca50d)>_0xfcab6e&&(_0xfcab6e=_0x1f6f27),_0x30c450=_0x1f6f27/=0x2*_0x4730c9),this['fRY2']>0x1&&((_0x1f6f27=(this['fRY2']-0x1)*_0x1ca50d)>_0xfcab6e&&(_0xfcab6e=_0x1f6f27),_0x4aba84=0x1-(_0x1f6f27/=0x2*_0x4730c9)));var _0x236287,_0x1b3214,_0x39bc45=_0xfcab6e/_0x4730c9,_0x59c55c={},_0x1adaf={};return _0x59c55c['fX']=_0x7b3d9e,_0x59c55c['fY']=(0.8-_0x39bc45)*_0x3c003f+_0x39bc45,_0x236287=6.2831853*_0x59c55c['fX']+this['pRenderParam'][this['nWndPort']]['fAngle'],_0x1b3214=0.5*(0x1-_0x59c55c['fY']),_0x1adaf['fX']=0.5-_0x1b3214*Math['sin'](_0x236287),_0x1adaf['fY']=0.5+_0x1b3214*Math['cos'](_0x236287),_0x1adaf['fX']=(_0x1adaf['fX']-_0x49d370)/(_0x4968e2-_0x49d370),_0x1adaf['fY']=(_0x1adaf['fY']-_0x30c450)/(_0x4aba84-_0x30c450),_0x2f3dd8['fX']=_0x1adaf['fX'],_0x2f3dd8['fY']=_0x1adaf['fY'],_0xa87ede;}},{'key':'GetPointPano2FishFloor','value':function(_0x307474,_0xee954,_0x3a3359){if(null==this['pRenderParam'][this['nWndPort']])return _0x520965;if(null==_0x307474)return _0x31ddcf;var _0x311c35,_0x29e646;_0x311c35=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x29e646=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0x42c110,_0x530bbd=0x0,_0x45eecf=0x1,_0x12cd4a=0x0,_0x405165=0x1,_0x5a35b9=0x0;(this['fRX2']>0x1||this['fRY2']>0x1||this['fRX1']<0x0||this['fRY1']<0x0)&&(this['fRX1']<0x0&&((_0x42c110=0x1*-this['fRX1'])>_0x5a35b9&&(_0x5a35b9=_0x42c110),_0x530bbd=_0x42c110/=0x2*_0x29e646),this['fRX2']>0x1&&((_0x42c110=0x1*(this['fRX2']-0x1))>_0x5a35b9&&(_0x5a35b9=_0x42c110),_0x45eecf=0x1-(_0x42c110/=0x2*_0x29e646)),this['fRY1']<0x0&&((_0x42c110=-this['fRY1']*_0x311c35)>_0x5a35b9&&(_0x5a35b9=_0x42c110),_0x12cd4a=_0x42c110/=0x2*_0x29e646),this['fRY2']>0x1&&((_0x42c110=(this['fRY2']-0x1)*_0x311c35)>_0x5a35b9&&(_0x5a35b9=_0x42c110),_0x405165=0x1-(_0x42c110/=0x2*_0x29e646)));var _0x1ce7ff,_0x30ab48,_0x21a80b=_0x5a35b9/_0x29e646,_0x38a985={},_0x3a7f13={};return _0x38a985['fX']=0x1-_0xee954,_0x38a985['fY']=(0.8-_0x21a80b)*(0x1-_0x3a3359)+_0x21a80b,_0x1ce7ff=6.2831853*_0x38a985['fX']+this['pRenderParam'][this['nWndPort']]['fAngle'],_0x30ab48=0.5*(0x1-_0x38a985['fY']),_0x3a7f13['fX']=0.5-_0x30ab48*Math['sin'](_0x1ce7ff),_0x3a7f13['fY']=0.5+_0x30ab48*Math['cos'](_0x1ce7ff),_0x3a7f13['fX']=(_0x3a7f13['fX']-_0x530bbd)/(_0x45eecf-_0x530bbd),_0x3a7f13['fY']=(_0x3a7f13['fY']-_0x12cd4a)/(_0x405165-_0x12cd4a),_0x307474['fX']=_0x3a7f13['fX'],_0x307474['fY']=_0x3a7f13['fY'],_0xa87ede;}},{'key':'GetPointPano2FishWall','value':function(_0x48426c,_0x191ed4,_0x4abadc){if(null==this['pRenderParam'][this['nWndPort']])return _0x520965;if(null==_0x48426c)return _0x31ddcf;var _0xb24078,_0x4bdf86;_0xb24078=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x4bdf86=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0x42a26f,_0x12f390,_0x4672e7,_0x31bf4b,_0x215ccf=0x0,_0x42b094=0x1,_0x6ef8c2=0.1,_0x31cf8e=0.9,_0xb08d5e=0x0,_0x33e210=0x1,_0x34cc54=0x0,_0x490ecc=0x1;this['fRX1']<0x0&&(_0x42a26f=0x1*-this['fRX1'],_0x215ccf=_0x42a26f/=0x2*_0x4bdf86,_0xb08d5e=_0x42a26f),this['fRX2']>0x1&&(_0x12f390=0x1*(this['fRX2']-0x1),_0x42b094=0x1-(_0x12f390/=0x2*_0x4bdf86),_0x33e210=0x1-_0x12f390),this['fRY1']<0x0&&(_0x4672e7=-this['fRY1']*_0xb24078,_0x6ef8c2=(_0x4672e7/=0x2*_0x4bdf86)>0.1?_0x4672e7:0.1,_0x34cc54=_0x4672e7),this['fRY2']>0x1&&(_0x31bf4b=(this['fRY2']-0x1)*_0xb24078,_0x31cf8e=(_0x31bf4b/=0x2*_0x4bdf86)>0x1-0.9?0x1-_0x31bf4b:0.9,_0x490ecc=0x1-_0x31bf4b);var _0x41527b={},_0xcbadff={};_0x41527b['fX']=_0x191ed4*(_0x42b094-_0x215ccf)+_0x215ccf,_0x41527b['fY']=_0x4abadc*(_0x31cf8e-_0x6ef8c2)+_0x6ef8c2;var _0x4dc2a0=Math['sqrt'](0.25-(_0x41527b['fY']-0.5)*(_0x41527b['fY']-0.5));return _0xcbadff['fX']=(_0x41527b['fX']-0.5)*_0x4dc2a0/0.5+0.5,_0xcbadff['fY']=_0x41527b['fY'],_0xcbadff['fX']=(_0xcbadff['fX']-_0xb08d5e)/(_0x33e210-_0xb08d5e),_0xcbadff['fY']=(_0xcbadff['fY']-_0x34cc54)/(_0x490ecc-_0x34cc54),_0x48426c['fX']=_0xcbadff['fX'],_0x48426c['fY']=_0xcbadff['fY'],_0xa87ede;}},{'key':'UpdatePTZPosition','value':function(_0x2da374,_0x47dd34,_0x416e91){if(null==this['pRenderParam'][_0x2da374])return _0x520965;var _0x3368ab={'fHAngleSin':0x0,'fHAngleCos':0x0,'fVAngleSin':0x0,'fVAngleCos':0x0},_0x22c4dc=_0xa87ede;if(_0x186ff9['SR_DE_FISH_PTZ_FLOOR']==this['pRenderParam'][_0x2da374]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_CEILING']==this['pRenderParam'][_0x2da374]['nDisplayEffect']){if((_0x22c4dc=this['ComputeAngleVertical'](_0x47dd34,_0x416e91,_0x3368ab,this['pRenderParam'][_0x2da374]['nDisplayEffect']))!=_0xa87ede)return _0x22c4dc;}else{if(_0x186ff9['SR_DE_FISH_PTZ_WALL']!=this['pRenderParam'][_0x2da374]['nDisplayEffect'])return _0x86aef9;if((_0x22c4dc=this['ComputeAngleHorizontal'](_0x47dd34,_0x416e91,_0x3368ab))!=_0xa87ede)return _0x22c4dc;}return 0x0==this['IsInImage'](this['fRX1'],this['fRX2'],this['fRY1'],this['fRY2'],_0x3368ab,this['pRenderParam'][_0x2da374]['fZoom'],this['pRenderParam'][_0x2da374]['nDisplayEffect'])?_0x31ddcf:(this['pRenderParam'][_0x2da374]['fCosH']=_0x3368ab['fHAngleCos'],this['pRenderParam'][_0x2da374]['fSinH']=_0x3368ab['fHAngleSin'],this['pRenderParam'][_0x2da374]['fCosV']=_0x3368ab['fVAngleCos'],this['pRenderParam'][_0x2da374]['fSinV']=_0x3368ab['fVAngleSin'],_0xa87ede);}},{'key':'JudgeDisplayEffect','value':function(_0x1c7058){var _0x4ea6e2=0x0;switch(_0x4ea6e2){case 0x0:return _0x4ea6e2=this['GetPlaceType'](_0x1c7058),0x4==this['nPlaceType']&&(this['nPlaceType']=0x0),_0xa87ede;case 0x3:return(_0x4ea6e2=this['GetPlaceType'](_0x1c7058))==this['nPlaceType']||0x4==this['nPlaceType']?_0xa87ede:_0x86aef9;case 0x2:case 0x1:return(_0x4ea6e2=this['GetPlaceType'](_0x1c7058))==this['nPlaceType']||0x4==_0x4ea6e2?_0xa87ede:_0x86aef9;default:return _0x86aef9;}return _0x86aef9;}},{'key':'GetPlaceType','value':function(_0x28fcf9){switch(_0x28fcf9){case _0x186ff9['SR_DE_FISH_PTZ_CEILING']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']:case _0x186ff9['SR_DE_FISH_CYLINDER_CEILING']:case _0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_CEILING']:return 0x3;case _0x186ff9['SR_DE_FISH_PTZ_FLOOR']:case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:case _0x186ff9['SR_DE_FISH_PANARAMA_FLOOR_180']:case _0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']:case _0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']:return 0x2;case _0x186ff9['SR_DE_FISH_PTZ_WALL']:case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']:case _0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']:return 0x1;case _0x186ff9['SR_DE_FISH_SEMISPHERE']:case _0x186ff9['SR_DE_FISH_ORIGINAL']:case _0x186ff9['SR_DE_FISH_PLANET']:case _0x186ff9['SR_DE_FISH_SPHERE']:case _0x186ff9['SR_DE_FISH_PLANET']:return 0x4;default:return 0x0;}return 0x0;}},{'key':'SetFishParam','value':function(_0x1f35b5,_0x43d6c5){if(_0x1f35b5<0x0||_0x1f35b5>=_0x379995)return _0x31ddcf;if(null==_0x43d6c5)return _0x31ddcf;if(null==this['pRenderParam'][_0x1f35b5])return _0x520965;var _0x144707=_0xa87ede;switch(_0x43d6c5['nFishParamType']){case _0x392c27:if((_0x144707=this['UpdateCircyeParam'](_0x43d6c5['fRXLeft'],_0x43d6c5['fRXRight'],_0x43d6c5['fRYTop'],_0x43d6c5['fRYBottom']))!=_0xa87ede)return _0x144707;this['pRenderParam'][_0x1f35b5]['bCut']=_0x43d6c5['bCut'],this['bBlack']=_0x43d6c5['bBlack'];break;case _0x5ca12e:if(_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect'])return _0x86aef9;if((_0x144707=this['UpdateWideScanAngle'](_0x1f35b5,_0x43d6c5['fAngle']))!=_0xa87ede)return _0x144707;this['pFishParam'][_0x1f35b5]['fAngle']=_0x43d6c5['fAngle'];break;case _0x378a81:if(_0x186ff9['SR_DE_FISH_PTZ_WALL']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PTZ_CEILING']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PTZ_FLOOR']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect'])return _0x86aef9;if((_0x144707=this['UpdateRangeParam'](_0x1f35b5,_0x43d6c5['fZoom']))!=_0xa87ede)return _0x144707;this['pFishParam'][_0x1f35b5]['fZoom']=_0x43d6c5['fZoom'];break;case _0x3be196:if(_0x186ff9['SR_DE_FISH_PTZ_WALL']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PTZ_CEILING']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PTZ_FLOOR']!=this['pRenderParam'][_0x1f35b5]['nDisplayEffect'])return _0x86aef9;if((_0x144707=this['UpdatePTZPosition'](_0x1f35b5,_0x43d6c5['fPTZX'],_0x43d6c5['fPTZY'],this['pRenderParam'][_0x1f35b5]['fZoom'],!0x0))!=_0xa87ede)return _0x144707;this['pFishParam'][_0x1f35b5]['fPTZX']=_0x43d6c5['fPTZX'],this['pFishParam'][_0x1f35b5]['fPTZY']=_0x43d6c5['fPTZY'];break;default:return _0x86aef9;}return _0x144707=this['ComputePTZPoints']();}},{'key':'GetFishParam','value':function(_0x2cc8ea,_0x26ceb1){return _0x2cc8ea<0x0||_0x2cc8ea>=_0x379995||null==_0x26ceb1||null==this['pFishParam'][_0x2cc8ea]?_0x31ddcf:(_0x26ceb1['fRXLeft']=this['fRX1'],_0x26ceb1['fRXRight']=this['fRX2'],_0x26ceb1['fRYTop']=this['fRY1'],_0x26ceb1['fRYBottom']=this['fRY2'],_0x26ceb1['bBlack']=this['bBlack'],_0x26ceb1['bCut']=this['pRenderParam'][_0x2cc8ea]['bCut'],_0x26ceb1['nFishParamType']=this['pFishParam'][_0x2cc8ea]['nFishParamType'],_0x26ceb1['fAngle']=this['pFishParam'][_0x2cc8ea]['fAngle'],_0x26ceb1['fZoom']=this['pFishParam'][_0x2cc8ea]['fZoom'],_0x26ceb1['fPTZX']=this['pFishParam'][_0x2cc8ea]['fPTZX'],_0x26ceb1['fPTZY']=this['pFishParam'][_0x2cc8ea]['fPTZY'],_0xa87ede);}},{'key':'GetRenderParam','value':function(_0x357f40,_0x215a6a){return _0x357f40<0x0||_0x357f40>=_0x379995||null==_0x215a6a||null==this['pRenderParam'][_0x357f40]?_0x31ddcf:(_0x215a6a['fRXLeft']=this['fRX1'],_0x215a6a['fRXRight']=this['fRX2'],_0x215a6a['fRYTop']=this['fRY1'],_0x215a6a['fRYBottom']=this['fRY2'],_0x215a6a['bBlack']=this['bBlack'],_0x215a6a['fCosH']=this['pRenderParam'][_0x357f40]['fCosH'],_0x215a6a['fSinH']=this['pRenderParam'][_0x357f40]['fSinH'],_0x215a6a['fCosV']=this['pRenderParam'][_0x357f40]['fCosV'],_0x215a6a['fSinV']=this['pRenderParam'][_0x357f40]['fSinV'],_0x215a6a['fAngle']=this['pRenderParam'][_0x357f40]['fAngle'],_0x215a6a['fZoom']=this['pRenderParam'][_0x357f40]['fZoom'],_0x215a6a['nDisplayEffect']=this['pRenderParam'][_0x357f40]['nDisplayEffect'],_0x215a6a['bCut']=this['pRenderParam'][_0x357f40]['bCut'],_0xa87ede);}},{'key':'UpdateCircyeParam','value':function(_0x3c2410,_0x304e26,_0x834a20,_0x344cab){if(_0x3c2410<=-0.5||_0x3c2410>=0.4||_0x304e26<=0.6||_0x304e26>=1.5||_0x834a20<=-0.5||_0x834a20>=0.4||_0x344cab<=0.6||_0x344cab>=1.5||_0x3c2410+_0x304e26<=0.8||_0x3c2410+_0x304e26>=1.2||_0x834a20+_0x344cab<=0.8||_0x834a20+_0x344cab>=1.2)return _0x31ddcf;if(_0x3c2410<0x0||_0x304e26>0x1||_0x834a20<0x0||_0x344cab>0x1){for(var _0x49ed0d=0x0;_0x49ed0d<_0x379995;++_0x49ed0d)if(null!=this['pRenderParam'][_0x49ed0d]&&(_0x186ff9['SR_DE_FISH_PTZ_CEILING']==this['pRenderParam'][_0x49ed0d]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_FLOOR']==this['pRenderParam'][_0x49ed0d]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_WALL']==this['pRenderParam'][_0x49ed0d]['nDisplayEffect'])){var _0xd74afc={};if(_0xd74afc['fHAngleCos']=this['pRenderParam'][_0x49ed0d]['fCosH'],_0xd74afc['fHAngleSin']=this['pRenderParam'][_0x49ed0d]['fSinH'],_0xd74afc['fVAngleCos']=this['pRenderParam'][_0x49ed0d]['fCosV'],_0xd74afc['fVAngleSin']=this['pRenderParam'][_0x49ed0d]['fSinV'],0x0==this['IsInImage'](_0x3c2410,_0x304e26,_0x834a20,_0x344cab,_0xd74afc,this['pRenderParam'][_0x49ed0d]['fZoom'],this['pRenderParam'][_0x49ed0d]['nDisplayEffect']))return _0x31ddcf;}}return this['fRX1']=_0x3c2410,this['fRX2']=_0x304e26,this['fRY1']=_0x834a20,this['fRY2']=_0x344cab,_0xa87ede;}},{'key':'UpdateWideScanAngle','value':function(_0x1a368e,_0x3c704b){return null==this['pRenderParam'][_0x1a368e]?_0x520965:(_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']==this['pRenderParam'][_0x1a368e]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']==this['pRenderParam'][_0x1a368e]['nDisplayEffect']?this['pRenderParam'][_0x1a368e]['fAngle']=_0x3c704b:_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']!=this['pRenderParam'][_0x1a368e]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']!=this['pRenderParam'][_0x1a368e]['nDisplayEffect']||(this['pRenderParam'][_0x1a368e]['fAngle']=-_0x3c704b),_0xa87ede);}},{'key':'ComputeAngleVertical','value':function(_0x44631d,_0x3f14f5,_0xa133ad,_0x428ea9){var _0x5db699=_0x44631d,_0x3501fe=_0x3f14f5,_0xd2137a=Math['sqrt']((_0x3501fe-0.5)*(_0x3501fe-0.5)+(_0x5db699-0.5)*(_0x5db699-0.5));if(_0xd2137a>0.5)return _0x31ddcf;if(_0xd2137a<0.001)return _0xa133ad['fVAngleCos']=0x1,_0xa133ad['fVAngleSin']=0x0,_0xa133ad['fHAngleCos']=0x1,_0xa133ad['fHAngleSin']=0x0,_0xa87ede;if(_0x428ea9==_0x186ff9['SR_DE_FISH_PTZ_CEILING']){_0xa133ad['fHAngleCos']=(0.5-_0x3501fe)/_0xd2137a,_0xa133ad['fHAngleSin']=(0.5-_0x5db699)/_0xd2137a;var _0x4cbe61=_0xd2137a*_0x530a52;_0xa133ad['fVAngleCos']=Math['cos'](_0x4cbe61),_0xa133ad['fVAngleSin']=Math['sin'](_0x4cbe61);}else{if(_0x428ea9!=_0x186ff9['SR_DE_FISH_PTZ_FLOOR'])return _0x31ddcf;_0xa133ad['fHAngleCos']=(_0x3501fe-0.5)/_0xd2137a,_0xa133ad['fHAngleSin']=(0.5-_0x5db699)/_0xd2137a;var _0x3a4040=_0xd2137a*_0x530a52;_0xa133ad['fVAngleCos']=Math['cos'](_0x3a4040),_0xa133ad['fVAngleSin']=Math['sin'](_0x3a4040);}return _0xa87ede;}},{'key':'ComputeAngleHorizontal','value':function(_0x29818c,_0x5b806c,_0x317efc){var _0x37f326,_0x10f5ae,_0xf18d33,_0x551c74,_0x45cf44,_0x384585,_0x530308,_0x578f2e=_0x29818c;return(_0x5b806c-(_0x45cf44=0.5))*(_0x5b806c-_0x45cf44)+(_0x578f2e-_0x45cf44)*(_0x578f2e-_0x45cf44)>0.25?_0x31ddcf:(_0x384585=(_0x5b806c-_0x45cf44)/_0x45cf44*_0x530a52/0x2,_0x37f326=Math['cos'](_0x384585),_0x10f5ae=Math['sin'](_0x384585),(_0x578f2e-_0x45cf44)/_0x45cf44/_0x37f326>0x1||(_0x578f2e-_0x45cf44)/_0x45cf44/_0x37f326<-0x1?_0x31ddcf:(_0x530308=(_0x578f2e-_0x45cf44)/_0x45cf44/_0x37f326*_0x530a52/0x2,_0xf18d33=Math['cos'](_0x530308),_0x551c74=Math['sin'](_0x530308),_0x317efc['fVAngleCos']=_0x37f326,_0x317efc['fVAngleSin']=_0x10f5ae,_0x317efc['fHAngleCos']=_0xf18d33,_0x317efc['fHAngleSin']=_0x551c74,_0xa87ede));}},{'key':'IsInImage','value':function(_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e,_0x34b532,_0x5075bd){return 0x1!=this['IsOutofImage'](_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e['fHAngleCos'],_0x3d507e['fHAngleSin'],_0x3d507e['fVAngleCos'],_0x3d507e['fVAngleSin'],_0x34b532,0x1,0.5,_0x5075bd)&&(0x1!=this['IsOutofImage'](_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e['fHAngleCos'],_0x3d507e['fHAngleSin'],_0x3d507e['fVAngleCos'],_0x3d507e['fVAngleSin'],_0x34b532,0x0,0.5,_0x5075bd)&&(0x1!=this['IsOutofImage'](_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e['fHAngleCos'],_0x3d507e['fHAngleSin'],_0x3d507e['fVAngleCos'],_0x3d507e['fVAngleSin'],_0x34b532,0.5,0x1,_0x5075bd)&&(0x1!=this['IsOutofImage'](_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e['fHAngleCos'],_0x3d507e['fHAngleSin'],_0x3d507e['fVAngleCos'],_0x3d507e['fVAngleSin'],_0x34b532,0.5,0x0,_0x5075bd)&&(0x1!=this['IsOutofImage'](_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e['fHAngleCos'],_0x3d507e['fHAngleSin'],_0x3d507e['fVAngleCos'],_0x3d507e['fVAngleSin'],_0x34b532,0x0,0x0,_0x5075bd)&&(0x1!=this['IsOutofImage'](_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e['fHAngleCos'],_0x3d507e['fHAngleSin'],_0x3d507e['fVAngleCos'],_0x3d507e['fVAngleSin'],_0x34b532,0x0,0x1,_0x5075bd)&&(0x1!=this['IsOutofImage'](_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e['fHAngleCos'],_0x3d507e['fHAngleSin'],_0x3d507e['fVAngleCos'],_0x3d507e['fVAngleSin'],_0x34b532,0x1,0x1,_0x5075bd)&&0x1!=this['IsOutofImage'](_0x1ec9a6,_0x18b1ec,_0x1ff219,_0x4c0d56,_0x3d507e['fHAngleCos'],_0x3d507e['fHAngleSin'],_0x3d507e['fVAngleCos'],_0x3d507e['fVAngleSin'],_0x34b532,0x1,0x0,_0x5075bd)))))));}},{'key':'IsOutofImage','value':function(_0x55554,_0x5cba81,_0x39725d,_0x4b39ef,_0x173db4,_0x33d145,_0x4dd928,_0x4b8cf0,_0x571801,_0x55c4c5,_0x2d5629,_0x302c59){var _0x1a12f8,_0x40381b,_0x33acd8,_0x1be963,_0x4569de,_0x87404c,_0x41254e,_0x42ce74,_0x9f0377,_0x186da2,_0x3b320a,_0x37f2f4,_0xff0b8f;if(0x1,_0x3b320a=(_0x55554+_0x5cba81)/0x2*0x1,_0x37f2f4=(_0x39725d+_0x4b39ef)/0x2*(_0x186da2=(_0x5cba81-_0x55554)/(_0x4b39ef-_0x39725d)),_0xff0b8f=(_0x5cba81-_0x55554)/0x2*0x1,_0x302c59==_0x186ff9['SR_DE_FISH_PTZ_CEILING']){if(_0x40381b=_0x55c4c5-0.5,_0x33acd8=(_0x1a12f8=0.5-_0x2d5629)*_0x4dd928+(_0x87404c=_0x571801)*_0x4b8cf0,(_0x41254e=_0x87404c*_0x4dd928-_0x1a12f8*_0x4b8cf0)<=0x0)return!0x0;_0x9f0377=Math['sqrt'](_0x40381b*_0x40381b+_0x33acd8*_0x33acd8);var _0x23e843=Math['sqrt'](_0x40381b*_0x40381b+_0x33acd8*_0x33acd8+_0x41254e*_0x41254e),_0x3db894=Math['asin'](_0x9f0377/_0x23e843)/1.5707963*0.5;if(_0x4569de=(-((_0x40381b=_0x3db894*_0x40381b/_0x9f0377)*_0x33d145+(_0x33acd8=_0x3db894*_0x33acd8/_0x9f0377)*_0x173db4)*_0xff0b8f*0x2+_0x37f2f4)/_0x186da2,(_0x1be963=((_0x40381b*_0x173db4-_0x33acd8*_0x33d145)*_0xff0b8f*0x2+_0x3b320a)/0x1)<0x0||_0x1be963>0x1||_0x4569de<0x0||_0x4569de>0x1)return!0x0;}if(_0x302c59==_0x186ff9['SR_DE_FISH_PTZ_FLOOR']){if(_0x40381b=_0x55c4c5-0.5,_0x33acd8=(_0x1a12f8=_0x2d5629-0.5)*_0x4dd928+(_0x87404c=_0x571801)*_0x4b8cf0,(_0x41254e=_0x87404c*_0x4dd928-_0x1a12f8*_0x4b8cf0)<=0x0)return!0x0;_0x9f0377=Math['sqrt'](_0x40381b*_0x40381b+_0x33acd8*_0x33acd8);var _0x283f42=Math['sqrt'](_0x40381b*_0x40381b+_0x33acd8*_0x33acd8+_0x41254e*_0x41254e),_0xaf09b9=Math['asin'](_0x9f0377/_0x283f42)/1.5707963*0.5;if(_0x4569de=(((_0x40381b=_0xaf09b9*_0x40381b/_0x9f0377)*_0x33d145+(_0x33acd8=_0xaf09b9*_0x33acd8/_0x9f0377)*_0x173db4)*_0xff0b8f*0x2+_0x37f2f4)/_0x186da2,(_0x1be963=((_0x40381b*_0x173db4-_0x33acd8*_0x33d145)*_0xff0b8f*0x2+_0x3b320a)/0x1)<0x0||_0x1be963>0x1||_0x4569de<0x0||_0x4569de>0x1)return!0x0;}if(_0x302c59==_0x186ff9['SR_DE_FISH_PTZ_WALL']){if(_0x1be963=(_0x40381b=_0x55c4c5-0.5)*_0x173db4+(_0x41254e=(_0x87404c=_0x571801)*_0x4dd928-(_0x1a12f8=_0x2d5629-0.5)*_0x4b8cf0)*_0x33d145,_0x4569de=_0x33acd8=_0x1a12f8*_0x4dd928+_0x87404c*_0x4b8cf0,(_0x42ce74=_0x41254e*_0x173db4-_0x40381b*_0x33d145)<=0x0)return!0x0;_0x9f0377=Math['sqrt'](_0x1be963*_0x1be963+_0x4569de*_0x4569de);var _0x19d8a7=Math['sqrt'](_0x1be963*_0x1be963+_0x4569de*_0x4569de+_0x42ce74*_0x42ce74),_0xfca511=Math['asin'](_0x9f0377/_0x19d8a7)/1.5707963*0.5;if(_0x4569de=(_0xfca511*_0x4569de/_0x9f0377*_0xff0b8f*0x2+_0x37f2f4)/_0x186da2,(_0x1be963=(_0xfca511*_0x1be963/_0x9f0377*_0xff0b8f*0x2+_0x3b320a)/0x1)<0x0||_0x1be963>0x1||_0x4569de<0x0||_0x4569de>0x1)return!0x0;}return!0x1;}},{'key':'ComputePTZPoints','value':function(){if(_0x3cf544==this['nWndPort'])return _0x520965;for(var _0x58c912=0x0;_0x58c912<_0x379995;++_0x58c912)if(null!=this['pRenderParam'][_0x58c912]&&(_0x186ff9['SR_DE_FISH_PTZ_CEILING']==this['pRenderParam'][_0x58c912]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_FLOOR']==this['pRenderParam'][_0x58c912]['nDisplayEffect']||_0x186ff9['SR_DE_FISH_PTZ_WALL']==this['pRenderParam'][_0x58c912]['nDisplayEffect'])){var _0x242d80=_0xa87ede;if(this['nPTZDisplayMode']==_0x495db0){if(_0x242d80=this['GetRangePoints'](_0x58c912),_0xa87ede!=_0x242d80)continue;if(_0x242d80=this['TransformPTZRangePoints'](_0x58c912),_0xa87ede!=_0x242d80)continue;}else{if(this['nPTZDisplayMode']==_0x150ab7&&(_0x242d80=this['GetRectPoints'](_0x58c912),_0xa87ede!=_0x242d80))continue;}}return _0xa87ede;}},{'key':'GetWndPort','value':function(){return this['nWndPort'];}},{'key':'GetPTZDisplayMode','value':function(){return this['nPTZDisplayMode'];}},{'key':'GetPTZColor','value':function(_0x50ee0b,_0x3dbb47){return _0x50ee0b<0x0||_0x50ee0b>=_0x379995||null==_0x3dbb47?_0x31ddcf:(_0x3dbb47['fA']=this['stPTZColor'][_0x50ee0b]['fA'],_0x3dbb47['fR']=this['stPTZColor'][_0x50ee0b]['fR'],_0x3dbb47['fG']=this['stPTZColor'][_0x50ee0b]['fG'],_0x3dbb47['fB']=this['stPTZColor'][_0x50ee0b]['fB'],null!=this['pPTZSetColor']&&(Math['abs'](this['pPTZSetColor'][_0x50ee0b]['fA'])<_0x4a23c6||Math['abs'](this['pPTZSetColor'][_0x50ee0b]['fR'])<_0x4a23c6||Math['abs'](this['pPTZSetColor'][_0x50ee0b]['fG'])<_0x4a23c6||Math['abs'](this['pPTZSetColor'][_0x50ee0b]['fB'])<_0x4a23c6)&&(_0x3dbb47['fA']=this['pPTZSetColor'][_0x50ee0b]['fA'],_0x3dbb47['fR']=this['pPTZSetColor'][_0x50ee0b]['fR'],_0x3dbb47['fG']=this['pPTZSetColor'][_0x50ee0b]['fG'],_0x3dbb47['fB']=this['pPTZSetColor'][_0x50ee0b]['fB']),_0xa87ede);}},{'key':'SetPTZColor','value':function(_0x5e498c,_0x1b4ad4){if(_0x5e498c<0x0||_0x5e498c>=_0x379995)return _0x31ddcf;if(null==_0x1b4ad4)return _0x31ddcf;if(null==this['pPTZSetColor']){this['pPTZSetColor']=[];for(var _0x533551=0x0;_0x533551<_0x379995;++_0x533551)this['pPTZSetColor'][_0x533551]={},this['pPTZSetColor'][_0x533551]['fR']=0x0,this['pPTZSetColor'][_0x533551]['fG']=0x0,this['pPTZSetColor'][_0x533551]['fB']=0x0,this['pPTZSetColor'][_0x533551]['fA']=0x1;}return this['pPTZSetColor'][_0x5e498c]['fR']=_0x1b4ad4['fR'],this['pPTZSetColor'][_0x5e498c]['fG']=_0x1b4ad4['fG'],this['pPTZSetColor'][_0x5e498c]['fB']=_0x1b4ad4['fB'],this['pPTZSetColor'][_0x5e498c]['fA']=_0x1b4ad4['fA'],_0xa87ede;}},{'key':'IsPTZSelected','value':function(_0x3173db){return!(_0x3173db<0x0||_0x3173db>=_0x379995)&&this['bPTZSelected'][_0x3173db];}},{'key':'GetPTZPort','value':function(_0x2294b2,_0xb0dbfe,_0xa80085){if(this['nWndPort']==_0x3cf544)return _0x520965;if(null==this['pRenderParam'][this['nWndPort']])return _0x520965;var _0x15d626=_0x379995,_0x16f17c={};_0x16f17c['fX']=_0x2294b2,_0x16f17c['fY']=_0xb0dbfe;for(var _0x2c3539=0x0;_0x2c3539<_0x379995;++_0x2c3539)this['bPTZSelected'][_0x2c3539]=!0x1;if(this['nPTZDisplayMode']==_0x495db0){switch(this['pRenderParam'][this['nWndPort']]['nDisplayEffect']){case _0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:this['GetPointPano2FishFloor'](_0x16f17c,_0x2294b2,_0xb0dbfe);break;case _0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:this['GetPointPano2FishCeiling'](_0x16f17c,_0x2294b2,_0xb0dbfe);break;case _0x186ff9['SR_DE_FISH_PANORAMA_WALL']:this['GetPointPano2FishWall'](_0x16f17c,_0x2294b2,_0xb0dbfe);}for(var _0x398890=0x0;_0x398890<_0x379995;++_0x398890)if(0x0!=this['nOriPTZPointNum'][_0x398890]){var _0x2c092e={};_0x2c092e['fX']=this['pOriPTZPoints'][_0x398890][0x0]['fX'],_0x2c092e['fY']=this['pOriPTZPoints'][_0x398890][0x0]['fY'];var _0x6358e2={};_0x6358e2['fX']=this['pOriPTZPoints'][_0x398890][0x0]['fX'],_0x6358e2['fY']=this['pOriPTZPoints'][_0x398890][0x0]['fY'];for(var _0x1bdca0=0x1;_0x1bdca0<this['nOriPTZPointNum'][_0x398890];++_0x1bdca0)this['GetPTZRectange'](_0x2c092e,_0x6358e2,this['pOriPTZPoints'][_0x398890][_0x1bdca0]);if(_0x16f17c['fX']<=_0x2c092e['fX']&&_0x16f17c['fX']>=_0x6358e2['fX']&&_0x16f17c['fY']>=_0x6358e2['fY']&&_0x16f17c['fY']<=_0x2c092e['fY']){_0x15d626=_0x398890;break;}}}else{if(this['nPTZDisplayMode']!=_0x150ab7)return _0x86aef9;for(var _0x200f11=0x0;_0x200f11<_0x379995;++_0x200f11)if(_0x16f17c['fX']<=this['pRectPoints'][_0x200f11][0x2]['fX']&&_0x16f17c['fX']>=this['pRectPoints'][_0x200f11][0x0]['fX']&&_0x16f17c['fY']>=this['pRectPoints'][_0x200f11][0x0]['fY']&&_0x16f17c['fY']<=this['pRectPoints'][_0x200f11][0x2]['fY']){_0x15d626=_0x200f11;break;}}return _0x15d626<_0x379995?(this['bPTZSelected'][_0x15d626]=!0x0,_0xa80085['nPTZPort']=_0x15d626,_0xa87ede):_0x86aef9;}},{'key':'SetPTZPort','value':function(_0x54100c){if(_0x54100c<0x0||_0x54100c>=_0x379995)return _0x31ddcf;for(var _0xba5ecb=0x0;_0xba5ecb<_0x379995;++_0xba5ecb)this['bPTZSelected'][_0xba5ecb]=!0x1;if(this['nPTZDisplayMode']==_0x495db0){if(0x0==this['nOriPTZPointNum'][_0x54100c])return _0x31ddcf;this['bPTZSelected'][_0x54100c]=!0x0;}else{if(0x0==this['nPTZRectNum'][_0x54100c])return _0x31ddcf;this['bPTZSelected'][_0x54100c]=!0x0;}return _0xa87ede;}},{'key':'GetPTZRectange','value':function(_0x2a6656,_0x54d29e,_0x1b0a20){return _0x1b0a20['fX']<_0x54d29e['fX']&&(_0x54d29e['fX']=_0x1b0a20['fX']),_0x1b0a20['fY']<_0x54d29e['fY']&&(_0x54d29e['fY']=_0x1b0a20['fY']),_0x1b0a20['fX']>_0x2a6656['fX']&&(_0x2a6656['fX']=_0x1b0a20['fX']),_0x1b0a20['fY']>_0x2a6656['fY']&&(_0x2a6656['fY']=_0x1b0a20['fY']),_0xa87ede;}},{'key':'GetPTZPoints','value':function(_0x4bfd20,_0x581c46,_0x1cb85a){return _0x4bfd20<0x0||_0x4bfd20>=_0x379995?_0x31ddcf:null==this['pRenderParam'][this['nWndPort']]?_0x520965:(_0x495db0==_0x1cb85a?null!=this['pOriPTZPoints'][_0x4bfd20]&&0x0!=this['nOriPTZPointNum'][_0x4bfd20]&&(_0x581c46['pstPoints']=this['pOriPTZPoints'][_0x4bfd20],_0x581c46['nPointNum']=this['nOriPTZPointNum'][_0x4bfd20]):_0x150ab7==_0x1cb85a&&null!=this['pRectPoints'][_0x4bfd20]&&(_0x581c46['pstPoints']=this['pRectPoints'][_0x4bfd20],_0x581c46['nPointNum']=0x4),_0xa87ede);}},{'key':'SetPTZDisplayMode','value':function(_0x236fa7){return this['nPTZDisplayMode']=_0x236fa7,this['ComputePTZPoints']();}},{'key':'GetDisplayEffect','value':function(_0x18e72c){return _0x18e72c<0x0||_0x18e72c>=_0x379995||null==this['pRenderParam']?_0x186ff9['SR_DE_NULL']:this['pRenderParam'][_0x18e72c]['nDisplayEffect'];}},{'key':'GetPTZFragmentPoints','value':function(_0x42473d,_0x24b5a4,_0x3e8a32){if(_0x42473d<0x0||_0x42473d>=_0x379995)return _0x31ddcf;if(null==this['pPanoPTZPoints'][_0x42473d]||0x0==this['nPanoPTZPointNum'][_0x42473d])return _0x31ddcf;var _0x392470=this['nPTZFragmentNode'][_0x42473d][_0x3e8a32];if(_0x24b5a4['nPointNum']=this['nPTZFragmentNode'][_0x42473d][_0x3e8a32+0x1]-this['nPTZFragmentNode'][_0x42473d][_0x3e8a32],_0x24b5a4['nPointNum']<0x0)return _0x520965;_0x24b5a4['pstPoints']=[];for(var _0x3505dd=0x0;_0x3505dd<_0x24b5a4['nPointNum'];++_0x3505dd){var _0x1ae379={};_0x1ae379['fX']=this['pPanoPTZPoints'][_0x42473d][_0x392470+_0x3505dd]['fX'],_0x1ae379['fY']=this['pPanoPTZPoints'][_0x42473d][_0x392470+_0x3505dd]['fY'],_0x24b5a4['pstPoints']['push'](_0x1ae379);}return _0xa87ede;}},{'key':'GetPTZFragmentNum','value':function(_0x4d18ad){return _0x4d18ad<0x0||_0x4d18ad>=_0x379995||0x0==this['nPTZFragmentNum'][_0x4d18ad]?0x0:this['nPTZFragmentNum'][_0x4d18ad];}},{'key':'CalcPTZFragmentPoints','value':function(_0x220257){if(_0x220257<0x0||_0x220257>=_0x379995)return _0x31ddcf;if(null==this['pPanoPTZPoints'][_0x220257]||0x0==this['nPanoPTZPointNum'][_0x220257])return _0x520965;this['nPTZFragmentNode'][_0x220257][0x0]=0x0,this['nPTZFragmentNum'][_0x220257]=0x1;for(var _0x39fb1c=0x0,_0x29453d=0x0;_0x29453d<this['nPanoPTZPointNum'][_0x220257]-0x1;_0x29453d++)Math['abs'](this['pPanoPTZPoints'][_0x220257][_0x29453d+0x1]['fX']-this['pPanoPTZPoints'][_0x220257][_0x29453d]['fX'])>0.5&&(_0x39fb1c=this['nPTZFragmentNum'][_0x220257],this['nPTZFragmentNode'][_0x220257][_0x39fb1c]=_0x29453d+0x1,this['nPTZFragmentNum'][_0x220257]=this['nPTZFragmentNum'][_0x220257]+0x1);var _0x99788e=this['nPanoPTZPointNum'][_0x220257];return Math['abs'](this['pPanoPTZPoints'][_0x220257][0x0]['fX']-this['pPanoPTZPoints'][_0x220257][_0x99788e-0x1]['fX'])<0.5&&(this['pPanoPTZPoints'][_0x220257][_0x99788e]['fX']=this['pPanoPTZPoints'][_0x220257][0x0]['fX'],this['pPanoPTZPoints'][_0x220257][_0x99788e]['fY']=this['pPanoPTZPoints'][_0x220257][0x0]['fY'],this['nPanoPTZPointNum'][_0x220257]=this['nPanoPTZPointNum'][_0x220257]+0x1),_0x39fb1c=this['nPTZFragmentNum'][_0x220257],this['nPTZFragmentNode'][_0x220257][_0x39fb1c]=this['nPanoPTZPointNum'][_0x220257],_0xa87ede;}},{'key':'IsPortAllocated','value':function(_0x57f699){return this['bPortAllocated'][_0x57f699];}},{'key':'GetPointFish2PanoCeiling','value':function(_0x4d4650,_0x33309b,_0x5302ff){if(null==this['pRenderParam'][this['nWndPort']])return _0x520965;if(null==_0x4d4650)return _0x31ddcf;var _0x50af1a,_0x33bc1d;_0x50af1a=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x33bc1d=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0xd61f47,_0x31cd33=0x0;(this['fRX2']>0x1||this['fRY2']>0x1||this['fRX1']<0x0||this['fRY1']<0x0)&&(this['fRX1']<0x0&&(_0xd61f47=0x1*-this['fRX1'])>_0x31cd33&&(_0x31cd33=_0xd61f47),this['fRX2']>0x1&&(_0xd61f47=0x1*(this['fRX2']-0x1))>_0x31cd33&&(_0x31cd33=_0xd61f47),this['fRY1']<0x0&&(_0xd61f47=-this['fRY1']*_0x50af1a)>_0x31cd33&&(_0x31cd33=_0xd61f47),this['fRY2']>0x1&&(_0xd61f47=(this['fRY2']-0x1)*_0x50af1a)>_0x31cd33&&(_0x31cd33=_0xd61f47));var _0x1b5642,_0x157591=_0x31cd33/_0x33bc1d,_0x21e458={};if(_0x21e458['fX']=0x0,_0x21e458['fY']=0x0,Math['abs'](_0x33309b-0.5)<_0x4a23c6&&Math['abs'](_0x5302ff-0.5)<_0x4a23c6)return _0x86aef9;var _0x2e80fa={},_0x54a6d2={};_0x2e80fa['fX']=_0x33309b-0.5,_0x2e80fa['fY']=_0x5302ff-0.5,_0x54a6d2['fX']=-0.5*Math['sin'](this['pRenderParam'][this['nWndPort']]['fAngle']),_0x54a6d2['fY']=0.5*Math['cos'](this['pRenderParam'][this['nWndPort']]['fAngle']);var _0x1aead2=Math['sqrt'](_0x2e80fa['fX']*_0x2e80fa['fX']+_0x2e80fa['fY']*_0x2e80fa['fY']),_0x5cec6b=Math['sqrt'](_0x54a6d2['fX']*_0x54a6d2['fX']+_0x54a6d2['fY']*_0x54a6d2['fY']);return _0x1b5642=Math['acos']((_0x2e80fa['fX']*_0x54a6d2['fX']+_0x2e80fa['fY']*_0x54a6d2['fY'])/(_0x1aead2*_0x5cec6b)),_0x2e80fa['fX']*_0x54a6d2['fY']-_0x2e80fa['fY']*_0x54a6d2['fX']>0x0&&(_0x1b5642=6.2831852-_0x1b5642),_0x21e458['fX']=_0x1b5642/6.2831853,_0x21e458['fY']=(0x2*(0.5-_0x1aead2)-_0x157591)/(0.8-_0x157591),_0x21e458['fY']>=0x0&&_0x21e458['fX']>=0x0&&_0x21e458['fY']<=0x1&&_0x21e458['fX']<=0x1?(_0x4d4650['fX']=_0x21e458['fX'],_0x4d4650['fY']=_0x21e458['fY'],_0xa87ede):_0x31ddcf;}},{'key':'GetPointFish2PanoFloor','value':function(_0x3190e8,_0x1ae5c7,_0x3e57c9){if(null==this['pRenderParam'][this['nWndPort']])return _0x520965;if(null==_0x3190e8)return _0x31ddcf;var _0xb389b3,_0x4f9e7b;_0xb389b3=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x4f9e7b=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0x3d1cb8,_0x193c42=0x0;(this['fRX2']>0x1||this['fRY2']>0x1||this['fRX1']<0x0||this['fRY1']<0x0)&&(this['fRX1']<0x0&&(_0x3d1cb8=0x1*-this['fRX1'])>_0x193c42&&(_0x193c42=_0x3d1cb8),this['fRX2']>0x1&&(_0x3d1cb8=0x1*(this['fRX2']-0x1))>_0x193c42&&(_0x193c42=_0x3d1cb8),this['fRY1']<0x0&&(_0x3d1cb8=-this['fRY1']*_0xb389b3)>_0x193c42&&(_0x193c42=_0x3d1cb8),this['fRY2']>0x1&&(_0x3d1cb8=(this['fRY2']-0x1)*_0xb389b3)>_0x193c42&&(_0x193c42=_0x3d1cb8));var _0x59f56c,_0x474b44=_0x193c42/_0x4f9e7b,_0x1f06df={'fX':0x0,'fY':0x0};if(Math['abs'](_0x1ae5c7-0.5)<_0x4a23c6&&Math['abs'](_0x3e57c9-0.5)<_0x4a23c6)return _0x86aef9;var _0x4e227e={},_0x47ca01={};_0x4e227e['fX']=_0x1ae5c7-0.5,_0x4e227e['fY']=_0x3e57c9-0.5,_0x47ca01['fX']=-0.5*Math['sin'](this['pRenderParam'][this['nWndPort']]['fAngle']),_0x47ca01['fY']=0.5*Math['cos'](this['pRenderParam'][this['nWndPort']]['fAngle']);var _0x2765a4=Math['sqrt'](_0x4e227e['fX']*_0x4e227e['fX']+_0x4e227e['fY']*_0x4e227e['fY']),_0xf458cb=Math['sqrt'](_0x47ca01['fX']*_0x47ca01['fX']+_0x47ca01['fY']*_0x47ca01['fY']);return _0x59f56c=Math['acos']((_0x4e227e['fX']*_0x47ca01['fX']+_0x4e227e['fY']*_0x47ca01['fY'])/(_0x2765a4*_0xf458cb)),_0x4e227e['fX']*_0x47ca01['fY']-_0x4e227e['fY']*_0x47ca01['fX']>0x0&&(_0x59f56c=6.2831852-_0x59f56c),_0x1f06df['fX']=0x1-_0x59f56c/6.2831853,_0x1f06df['fY']=0x1-(0x2*(0.5-_0x2765a4)-_0x474b44)/(0.8-_0x474b44),_0x1f06df['fY']>=0x0&&_0x1f06df['fX']>=0x0&&_0x1f06df['fY']<=0x1&&_0x1f06df['fX']<=0x1?(_0x3190e8['fX']=_0x1f06df['fX'],_0x3190e8['fY']=_0x1f06df['fY'],_0xa87ede):_0x31ddcf;}},{'key':'GetPointFish2PanoWall','value':function(_0x32e9fb,_0x333161,_0x265730){if(null==this['pRenderParam'][this['nWndPort']])return _0x520965;if(null==_0x32e9fb)return _0x31ddcf;var _0x4ff303,_0x33b439;_0x4ff303=(this['fRX2']-this['fRX1'])/(this['fRY2']-this['fRY1']),_0x33b439=(this['fRX2']-this['fRX1'])/0x2*0x1;var _0x224936,_0xc43223,_0x4e65e4,_0x51a192,_0x6331f0,_0x1bbea8=0x0,_0x2283ca=0x1,_0x2966c4=0.1,_0x59ba23=0.9;this['fRX1']<0x0&&(_0x224936=0x1*-this['fRX1'],_0x1bbea8=_0x224936/=0x2*_0x33b439),this['fRX2']>0x1&&(_0xc43223=0x1*(this['fRX2']-0x1),_0x2283ca=0x1-(_0xc43223/=0x2*_0x33b439)),this['fRY1']<0x0&&(_0x4e65e4=-this['fRY1']*_0x4ff303,_0x2966c4=(_0x4e65e4/=0x2*_0x33b439)>0.1?_0x4e65e4:0.1),this['fRY2']>0x1&&(_0x51a192=(this['fRY2']-0x1)*_0x4ff303,_0x59ba23=(_0x51a192/=0x2*_0x33b439)>0x1-0.9?0x1-_0x51a192:0.9);var _0x266343={'fX':0x0,'fY':0x0},_0x219b0f=0x2*_0x333161*_0x33b439,_0xdf73cf=0x2*_0x265730*_0x33b439;return _0x6331f0=Math['sqrt'](_0x33b439*_0x33b439-(_0xdf73cf-_0x33b439)*(_0xdf73cf-_0x33b439)),Math['abs'](_0x6331f0)<_0x4a23c6?SR_ERR_PARAM:(_0x333161=_0x33b439*(_0x219b0f-_0x33b439)/_0x6331f0+_0x33b439,_0x265730=_0xdf73cf,_0x266343['fX']=(_0x333161-0x2*_0x1bbea8*_0x33b439)/(0x2*(_0x2283ca-_0x1bbea8)*_0x33b439),_0x266343['fY']=(_0x265730-0x2*_0x2966c4*_0x33b439)/(0x2*(_0x59ba23-_0x2966c4)*_0x33b439),_0x266343['fY']>=0x0&&_0x266343['fX']>=0x0&&_0x266343['fY']<=0x1&&_0x266343['fX']<=0x1?(_0x32e9fb['fX']=_0x266343['fX'],_0x32e9fb['fY']=_0x266343['fY'],_0xa87ede):_0x31ddcf);}},{'key':'UpdateRangeParam','value':function(_0x6c8fa1,_0x32a255){if(null==this['pRenderParam'][_0x6c8fa1])return _0x520965;if(_0x32a255<0.00001||_0x32a255>0.6)return _0x31ddcf;var _0x3c870d=0x0;return _0x186ff9['SR_DE_FISH_PTZ_WALL']!=this['pRenderParam'][_0x6c8fa1]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PTZ_CEILING']!=this['pRenderParam'][_0x6c8fa1]['nDisplayEffect']&&_0x186ff9['SR_DE_FISH_PTZ_FLOOR']!=this['pRenderParam'][_0x6c8fa1]['nDisplayEffect']||(_0x3c870d=0x7*_0x32a255+0.8,this['IsInImage'](this['fRX1'],this['fRX2'],this['fRY1'],this['fRY2'],this['pRenderParam'][_0x6c8fa1]['fCosH'],this['pRenderParam'][_0x6c8fa1]['fSinH'],this['pRenderParam'][_0x6c8fa1]['fCosV'],this['pRenderParam'][_0x6c8fa1]['fSinV'],_0x3c870d,this['pRenderParam'][_0x6c8fa1]['nDisplayEffect']))?(this['pRenderParam'][_0x6c8fa1]['fZoom']=_0x3c870d,_0xa87ede):_0x31ddcf;}}]),_0x132b86;}()),_0x5440d6=0x20,_0x4ae543=(function(){function _0x48881e(){_0x54580d(this,_0x48881e),this['renderEngine']='webgl',this['oVideoHandle']=null,this['mainCanvasID']=null,this['curTimestamp']=0x0,this['mainSubPort']=0x0,this['mainVaildSubPort']=0x0,this['mainFECCorrect']=_0x186ff9['SR_DE_NULL'],this['FECErrorCode']=0x0,this['subPortNum']=0x0,this['FECShowMode']=_0x495db0,this['pFishParamManager']=null,this['InitFECParam'](),this['privateLinesInfo']=[],this['privateFontsInfo']=[],this['privateImageInfo']=[],this['bSRCallBackFlag']=!0x1,this['curLinesInfo']=null,this['curFontsInfo']=null,this['curImagesInfo']=null,this['maxPrivateLineTimeStamp']=0x0,this['hasSetFECParamManager']=!0x1,this['pWaterFontParam']=[],this['pWaterImageParam']=[],this['waterMarkImageIndex']=0x0,this['waterMarkImageMax']=0x1,this['aPOSAdaptBuf']=[];}return _0x4fd085(_0x48881e,[{'key':'InitDisplay','value':function(_0x41b975,_0xaf9fa6,_0xbaa2d7){return this['renderEngine']=_0xaf9fa6,this['mainCanvasID']=_0x41b975,'2d'===this['renderEngine']||'2D'===this['renderEngine']?(this['oVideoHandle']=new _0x47e209(),console['log']('2d\\x20render')):(this['oVideoHandle']=new _0x453e55(),this['mainFECCorrect']!=_0x186ff9['SR_DE_NULL']&&(null==this['pFishParamManager']&&(this['pFishParamManager']=new _0x30cc90()),this['oVideoHandle']['SR_SetFishParamManager'](this['pFishParamManager']),this['hasSetFECParamManager']=!0x0),console['log']('webgl\\x20render')),this['oVideoHandle']['SR_Init'](_0x41b975,_0xbaa2d7),this['mainVaildSubPort']=this['oVideoHandle']['SR_AddSubPort'](this['mainFECCorrect']),-0x1==this['mainVaildSubPort']?(console['info']('%c\\x20InitDisplay\\x20SR_AddSubPort\\x20error\\x20subport:%d','color:\\x20red',this['mainVaildSubPort']),0x0):(null==this['stFishEyeManager'][0x0]['pRender']&&this['mainFECCorrect']!==_0x186ff9['SR_DE_NULL']&&(this['stFishEyeManager'][0x0]['pRender']=this['oVideoHandle'],this['stFishEyeManager'][0x0]['nSubPort']=0x0,this['stFishEyeManager'][0x0]['sCanvasID']=this['mainCanvasID'],this['stFishEyeManager'][0x0]['bUsed']=0x1,this['stFishEyeManager'][0x0]['bInited']=0x1,this['stFishEyeManager'][0x0]['nValidSubPort']=this['mainVaildSubPort']),0x1);}},{'key':'ReleaseDisplay','value':function(){if(null!=this['oVideoHandle']&&(this['oVideoHandle']['SR_DelSubPort'](this['mainVaildSubPort']),this['oVideoHandle']['SR_Destroy'](),this['oVideoHandle']=null),this['subPortNum']>0x0){for(var _0x94556=0x1;_0x94556<_0x5440d6;_0x94556++)0x0!=this['stFishEyeManager'][_0x94556]['nSubPort']&&null!=this['stFishEyeManager'][_0x94556]['sCanvasID']&&0x0!=this['stFishEyeManager'][_0x94556]['bInited']&&(this['FEC_Disable'](_0x94556),this['FEC_DelPort'](_0x94556));}for(var _0x4ea93c=0x0;_0x4ea93c<_0x5440d6;_0x4ea93c++)this['stFishEyeManager'][_0x4ea93c]['pRender']=null;return this['stFishEyeManager']['splice'](0x0,this['stFishEyeManager']['length']),this['stFishParam']['splice'](0x0,this['stFishParam']['length']),null!=this['pFishParamManager']&&(this['pFishParamManager']['DeInit'](),this['pFishParamManager']=null),this['FECShowMode']=_0x495db0,this['DeInitPrivateParam'](),0x1;}},{'key':'DeInitPrivateParam','value':function(){this['privateLinesInfo']['splice'](0x0,this['privateLinesInfo']['length']),this['privateFontsInfo']['splice'](0x0,this['privateFontsInfo']['length']),this['privateImageInfo']['splice'](0x0,this['privateImageInfo']['length']),this['pWaterFontParam']['splice'](0x0,this['pWaterFontParam']['length']),this['pWaterImageParam']['splice'](0x0,this['pWaterImageParam']['length']),this['bSRCallBackFlag']=!0x1,this['curLinesInfo']=null;}},{'key':'DisplayFrame','value':function(_0x241257,_0x381b91,_0x5e3b07,_0x5d210c,_0x2bf64a,_0x244c7e){var _0x396b03=this;return new Promise(function(_0x3130e8){var _0x805485=-0x1;if(null!=_0x241257&&(_0x805485=_0x5d210c),_0x396b03['bSRCallBackFlag']||(null!=_0x396b03['oVideoHandle']&&_0x396b03['oVideoHandle']['SR_SetCallBack'](_0x396b03['WebGLDisplayCallBack'],_0x396b03,_0x444649),_0x396b03['bSRCallBackFlag']=!0x0),null!=_0x241257&&(0x0==_0x396b03['privateLinesInfo']['length']&&0x0==_0x396b03['privateFontsInfo']['length']&&0x0==_0x396b03['privateImageInfo']['length']||(_0x396b03['curTimestamp']=_0x805485,_0x396b03['FindIntelNodefromList'](_0x396b03['curTimestamp'])),null!=_0x396b03['oVideoHandle']&&_0x396b03['oVideoHandle']['SR_Draw'](_0x241257,_0x381b91,_0x5e3b07,_0x2bf64a,_0x244c7e),_0x396b03['subPortNum']>0x0)){for(var _0x14a6d1=0x1;_0x14a6d1<_0x5440d6;_0x14a6d1++)0x0!=_0x396b03['stFishEyeManager'][_0x14a6d1]['nSubPort']&&null!=_0x396b03['stFishEyeManager'][_0x14a6d1]['sCanvasID']&&0x0!=_0x396b03['stFishEyeManager'][_0x14a6d1]['bInited']&&null!=_0x396b03['stFishEyeManager'][_0x14a6d1]['pRender']&&_0x396b03['stFishEyeManager'][_0x14a6d1]['pRender']['SR_Draw'](_0x241257,_0x381b91,_0x5e3b07,null,null);}_0x3130e8(_0x805485);});}},{'key':'SetDisplayRect','value':function(_0x154492,_0x4d7bf2,_0x1a0b43,_0xfa552d){return null!=this['oVideoHandle']?this['oVideoHandle']['SR_SetDisplayRect'](_0x154492,_0x4d7bf2,_0x1a0b43,_0xfa552d,_0xe9e464):0x0;}},{'key':'SetCanvasSize','value':function(_0x3e6288,_0x186bd2){return null!=this['oVideoHandle']?this['oVideoHandle']['SR_SetCanvasSize'](_0x3e6288,_0x186bd2):0x0;}},{'key':'GetCanvasSize','value':function(){return null!=this['oVideoHandle']?this['oVideoHandle']['SR_GetCanvasSize']():0x0;}},{'key':'SetAntialias','value':function(_0x3c0ac9){return null!=this['oVideoHandle']?this['oVideoHandle']['SR_SetAntialias'](_0x3c0ac9):0x0;}},{'key':'SetD3DPostProcess','value':function(_0x2321b2,_0x3465f0){return null!=this['oVideoHandle']?this['oVideoHandle']['SR_SetImagePostProcess'](_0x2321b2,_0x3465f0):0x0;}},{'key':'InitFECParam','value':function(){this['stFishEyeManager']=[];for(var _0x599cf5=0x0;_0x599cf5<_0x5440d6;_0x599cf5++)this['stFishEyeManager'][_0x599cf5]={},this['stFishEyeManager'][_0x599cf5]['pRender']=null,this['stFishEyeManager'][_0x599cf5]['nSubPort']=0x0,this['stFishEyeManager'][_0x599cf5]['sCanvasID']=null,this['stFishEyeManager'][_0x599cf5]['bUsed']=0x0,this['stFishEyeManager'][_0x599cf5]['bInit']=0x0,this['stFishEyeManager'][_0x599cf5]['nValidSubPort']=0x0,this['stFishEyeManager'][_0x599cf5]['emPlaceType']=_0x1e68ea,this['stFishEyeManager'][_0x599cf5]['emCorrectType']=_0x4fbb93,this['stFishEyeManager'][_0x599cf5]['emEffect']=_0x186ff9['SR_DE_FISH_ORIGINAL'];this['stFishParam']=[];for(var _0x5bb5bd=0x0;_0x5bb5bd<_0x5440d6;_0x5bb5bd++)this['stFishParam'][_0x5bb5bd]={},this['stFishParam'][_0x5bb5bd]['nUpDateType']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZParam']={},this['stFishParam'][_0x5bb5bd]['stPTZParam']['fPTZPositionX']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZParam']['fPTZPositionY']=0x0,this['stFishParam'][_0x5bb5bd]['stCycleParam']={},this['stFishParam'][_0x5bb5bd]['stCycleParam']['fRadiusLeft']=0x0,this['stFishParam'][_0x5bb5bd]['stCycleParam']['fRadiusRight']=0x0,this['stFishParam'][_0x5bb5bd]['stCycleParam']['fRadiusTop']=0x0,this['stFishParam'][_0x5bb5bd]['stCycleParam']['fRadiusBottom']=0x0,this['stFishParam'][_0x5bb5bd]['fZoom']=0x0,this['stFishParam'][_0x5bb5bd]['fWideScanOffset']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZColor']={},this['stFishParam'][_0x5bb5bd]['stPTZColor']['nR']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZColor']['nG']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZColor']['nB']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZColor']['nAlpha']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZSelect']={},this['stFishParam'][_0x5bb5bd]['stPTZSelect']['fTop']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZSelect']['fBottom']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZSelect']['fLeft']=0x0,this['stFishParam'][_0x5bb5bd]['stPTZSelect']['fRight']=0x0,this['stFishParam'][_0x5bb5bd]['nCut']=0x0;}},{'key':'FEC_SetCanvasID','value':function(_0x461e15){return this['mainFECCorrect']=_0x186ff9['SR_DE_FISH_ORIGINAL'],0x1;}},{'key':'FEC_ResetCorrectType','value':function(_0x524c38,_0x41579d,_0x34714a){if(!0x1===this['hasSetFECParamManager']&&(null==this['pFishParamManager']&&(this['pFishParamManager']=new _0x30cc90()),this['oVideoHandle']['SR_SetFishParamManager'](this['pFishParamManager']),this['hasSetFECParamManager']=!0x0),_0x34714a!=_0x4fbb93&&_0x34714a!=_0x2cb8a2&&_0x34714a!=_0x4e5968&&_0x34714a!=_0x1837a3&&_0x34714a!=_0x54a990&&_0x34714a!=_0x30e952&&_0x34714a!=_0x20b7ae&&_0x34714a!=_0x39b0d3&&_0x34714a!=_0x2a01ec)return console['log']('%c\\x2020231122\\x20hardDecoder\\x20not\\x20support\\x20correctType:%d','color:red',_0x34714a),this['FECErrorCode']=0x10,0x0;if(0x1!=this['FECParamJudge'](_0x524c38,_0x41579d,_0x34714a))return 0x0;var _0x204106;if(_0x204106=this['_ConvertDisplayEffect'](_0x41579d,_0x34714a),0x0==_0x524c38&&null==this['stFishEyeManager'][_0x524c38]['pRender']&&(this['stFishEyeManager'][_0x524c38]['pRender']=this['oVideoHandle'],this['stFishEyeManager'][_0x524c38]['nSubPort']=_0x524c38,this['stFishEyeManager'][_0x524c38]['sCanvasID']=this['mainCanvasID'],this['stFishEyeManager'][_0x524c38]['bUsed']=0x1,this['stFishEyeManager'][_0x524c38]['bInited']=0x1,this['stFishEyeManager'][_0x524c38]['nValidSubPort']=this['mainVaildSubPort'],this['stFishEyeManager'][_0x524c38]['emPlaceType']=_0x41579d,this['stFishEyeManager'][_0x524c38]['emCorrectType']=_0x34714a,this['stFishEyeManager'][_0x524c38]['emEffect']=_0x204106,this['mainFECCorrect']=_0x204106),null!=this['stFishEyeManager'][_0x524c38]['pRender']){this['stFishEyeManager'][_0x524c38]['pRender']['SR_DelSubPort'](this['stFishEyeManager'][_0x524c38]['nValidSubPort']);var _0x3379b4=this['stFishEyeManager'][_0x524c38]['pRender']['SR_AddSubPort'](_0x204106);if(-0x1==_0x3379b4)return console['info']('%c\\x20FEC_ResetCorrectType\\x20SR_AddSubPort\\x20error\\x20subport:%d','color:\\x20red',_0x3379b4),0x0;if(this['stFishEyeManager'][_0x524c38]['nValidSubPort']=_0x3379b4,this['stFishEyeManager'][_0x524c38]['emPlaceType']=_0x41579d,this['stFishEyeManager'][_0x524c38]['emCorrectType']=_0x34714a,this['stFishEyeManager'][_0x524c38]['emEffect']=_0x204106,_0x1837a3<=this['stFishEyeManager'][_0x524c38]['emCorrectType']){var _0x5ac827=this['stFishEyeManager'][_0x524c38]['pRender']['SR_SetRenderState'](_0x57ef5a,0x0);_0xa87ede!=_0x5ac827&&console['log']('>>>VideoRender.js\\x20SR_SetRenderState\\x20failed\\x20ret:%08x\\x0a',_0x5ac827);}}return this['FECShowMode']>0x0&&null!=this['stFishEyeManager'][_0x524c38]['pRender']&&this['stFishEyeManager'][_0x524c38]['pRender']['SR_SetPTZDisplayMode'](this['FECShowMode']),0x0==_0x524c38&&(this['mainVaildSubPort']=this['stFishEyeManager'][_0x524c38]['nValidSubPort']),0x1;}},{'key':'FEC_GetPort','value':function(_0x4edce7,_0x16fe01){if(_0x16fe01!=_0x4fbb93&&_0x16fe01!=_0x2cb8a2&&_0x16fe01!=_0x4e5968&&_0x16fe01!=_0x1837a3&&_0x16fe01!=_0x54a990&&_0x16fe01!=_0x30e952&&_0x16fe01!=_0x20b7ae&&_0x16fe01!=_0x39b0d3&&_0x16fe01!=_0x2a01ec)return console['log']('%c\\x2020231112\\x20hardDecoder\\x20not\\x20support\\x20emCorrectType:%d','color:red',_0x16fe01),this['FECErrorCode']=0x10,-0x1;var _0x427cfe;if(0x1!=this['FECParamJudge'](-0x1,_0x4edce7,_0x16fe01))return-0x1;var _0x3df02b=0x0;for(_0x427cfe=0x1;_0x427cfe<_0x5440d6;_0x427cfe++)if(0x0==this['stFishEyeManager'][_0x427cfe]['nSubPort']&&0x0==this['stFishEyeManager'][_0x427cfe]['bUsed']){this['stFishEyeManager'][_0x427cfe]['nSubPort']=_0x427cfe,this['stFishEyeManager'][_0x427cfe]['nValidSubPort']=-0x1,this['stFishEyeManager'][_0x427cfe]['bUsed']=0x1,this['stFishEyeManager'][_0x427cfe]['emPlaceType']=_0x4edce7,this['stFishEyeManager'][_0x427cfe]['emCorrectType']=_0x16fe01,_0x3df02b=_0x427cfe;break;}if(_0x5440d6==_0x427cfe)return console['info']('%c\\x20FEC_GetPort-12\\x20fish\\x20subport\\x20max','color:\\x20red'),this['FECErrorCode']=0x504,-0x1;var _0x36ac05;return _0x36ac05=this['_ConvertDisplayEffect'](this['stFishEyeManager'][_0x3df02b]['emPlaceType'],this['stFishEyeManager'][_0x3df02b]['emCorrectType']),_0x186ff9['SR_DE_FISH_ORIGINAL']!=_0x36ac05?(0x0==this['stFishEyeManager'][_0x3df02b]['bInited']&&(this['stFishEyeManager'][_0x3df02b]['emEffect']=_0x36ac05,this['stFishEyeManager'][_0x3df02b]['bInited']=0x0,this['stFishParam'][_0x3df02b]['fZoom']=0.005,this['stFishParam'][_0x3df02b]['stPTZParam']['fPTZPositionX']=0.5,this['stFishParam'][_0x3df02b]['stPTZParam']['fPTZPositionY']=0.5,this['stFishParam'][_0x3df02b]['fWideScanOffset']=0x0),this['FECErrorCode']=0x0,this['subPortNum']++,_0x3df02b):_0x3df02b<_0x5440d6&&0x0==this['stFishEyeManager'][_0x3df02b]['bInited']?(this['stFishEyeManager'][_0x3df02b]['emEffect']=_0x36ac05,this['stFishEyeManager'][_0x3df02b]['bInited']=0x0,this['stFishParam'][_0x3df02b]['fZoom']=0x0,this['stFishParam'][_0x3df02b]['stPTZParam']['fPTZPositionX']=0x0,this['stFishParam'][_0x3df02b]['stPTZParam']['fPTZPositionY']=0x0,this['stFishParam'][_0x3df02b]['fWideScanOffset']=0x0,this['FECErrorCode']=0x0,this['subPortNum']++,_0x3df02b):(this['stFishEyeManager'][_0x427cfe]['pRender']=null,this['stFishEyeManager'][_0x427cfe]['nSubPort']=0x0,this['stFishEyeManager'][_0x427cfe]['sCanvasID']=null,this['stFishEyeManager'][_0x427cfe]['bUsed']=0x0,this['stFishEyeManager'][_0x427cfe]['bInited']=0x0,this['stFishEyeManager'][_0x427cfe]['nValidSubPort']=0x0,this['stFishEyeManager'][_0x427cfe]['emPlaceType']=_0x1e68ea,this['stFishEyeManager'][_0x427cfe]['emCorrectType']=_0x4fbb93,this['stFishEyeManager'][_0x427cfe]['emEffect']=_0x186ff9['SR_DE_FISH_ORIGINAL'],this['FECErrorCode']=_0xa88cb3,-0x1);}},{'key':'FECParamJudge','value':function(_0xd98f83,_0x19e843,_0x440875){if((_0x240c92==_0x19e843||_0x1e68ea==_0x19e843)&&_0x30e952==_0x440875)return console['info']('%c\\x20FEC_GetPort-1\\x20floor\\x20and\\x20ceiling\\x20not\\x20support\\x20lat','color:\\x20red'),this['FECErrorCode']=_0xa88cb3,0x0;if(_0x2aea6b==_0x19e843&&_0x20b7ae==_0x440875)return console['info']('%c\\x20FEC_GetPort-2\\x20wall\\x20not\\x20support\\x20cylinger','color:\\x20red'),this['FECErrorCode']=_0xa88cb3,0x0;if(_0x2aea6b==_0x19e843&&_0x443c47==_0x440875)return console['info']('%c\\x20FEC_GetPort-3\\x20wall\\x20not\\x20support\\x20split\\x20cylinger','color:\\x20red'),this['FECErrorCode']=_0xa88cb3,0x0;if((_0x240c92==_0x19e843||_0x1e68ea==_0x19e843)&&_0x39b0d3==_0x440875)return console['info']('%c\\x20FEC_GetPort-4\\x20floor\\x20and\\x20ceiling\\x20not\\x20support\\x20horizontal','color:\\x20red'),this['FECErrorCode']=_0xa88cb3,0x0;if((_0x240c92==_0x19e843||_0x1e68ea==_0x19e843)&&_0x2a01ec==_0x440875)return console['info']('%c\\x20FEC_GetPort-5\\x20floor\\x20and\\x20ceiling\\x20not\\x20support\\x20vertical','color:\\x20red'),this['FECErrorCode']=_0xa88cb3,0x0;if(_0x2aea6b!=_0x19e843&&_0x240c92!=_0x19e843&&_0x1e68ea!=_0x19e843)return console['info']('%c\\x20FEC_GetPort-6\\x20emPlaceType\\x20only\\x20support\\x20floor,\\x20ceiling\\x20and\\x20wall','color:\\x20red'),this['FECErrorCode']=MP_E_SUPPORT,0x0;if(0x0!=_0x440875&&_0x440875!=_0x54a990&&_0x440875!=_0x2cb8a2&&_0x440875!=_0x4e5968&&_0x440875!=_0x30e952&&_0x440875!=_0x1837a3&&_0x440875!=_0x20b7ae&&_0x440875!=_0x443c47&&_0x440875!=_0x30ecd9&&_0x440875!=_0x39b0d3&&_0x440875!=_0x2a01ec)return console['info']('%c\\x20FEC_GetPort-7\\x20emCorrectType\\x20error','color:\\x20red'),this['FECErrorCode']=MP_E_SUPPORT,0x0;for(var _0x4c6d6b=0x0;_0x4c6d6b<_0x5440d6;_0x4c6d6b++)if(_0x4c6d6b!=_0xd98f83){if(this['stFishEyeManager'][_0x4c6d6b]['bUsed']&&this['stFishEyeManager'][_0x4c6d6b]['emPlaceType']!=_0x19e843)return console['info']('%c\\x20FEC_GetPort-8\\x20emPlaceType\\x20changed','color:\\x20red'),this['FECErrorCode']=0x517,0x0;if(this['stFishEyeManager'][_0x4c6d6b]['bUsed']&&this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']!=_0x54a990&&this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']!=_0x1837a3&&this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']!=_0x20b7ae&&this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']!=_0x443c47&&this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']!=_0x30ecd9&&this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']!=_0x39b0d3&&this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']!=_0x2a01ec&&_0x440875!=_0x54a990&&_0x440875!=_0x1837a3&&_0x440875!=_0x20b7ae&&_0x440875!=_0x443c47&&_0x440875!=_0x30ecd9&&_0x440875!=_0x39b0d3&&_0x440875!=_0x2a01ec)return console['info']('%c\\x20FEC_GetPort-9\\x20origin/180/360/lat\\x20only\\x20display\\x20one\\x20port','color:\\x20red'),this['FECErrorCode']=0x518,0x0;if(this['stFishEyeManager'][_0x4c6d6b]['bUsed']&&(this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']==_0x54a990&&_0x440875==_0x2cb8a2||this['stFishEyeManager'][_0x4c6d6b]['emCorrectType']==_0x2cb8a2&&_0x440875==_0x54a990))return console['info']('%c\\x20FEC_GetPort-10\\x20180\\x20cannot\\x20support\\x20ptz','color:\\x20red'),this['FECErrorCode']=0x518,0x0;}return 0x1;}},{'key':'FEC_Enable','value':function(_0x38de61){return _0x38de61<0x1||_0x38de61>0x1f||null==_0x38de61?(console['info']('%c\\x20FEC_Enable-1\\x20nSubPort:%d','color:\\x20red',_0x38de61),this['FECErrorCode']=_0x41c932,0x0):null!==this['stFishEyeManager'][_0x38de61]['pRender']?(console['info']('%c\\x20FEC_Enable-2\\x20nSubPort:%d','color:\\x20red',_0x38de61),this['FECErrorCode']=0x515,0x0):(null==this['stFishEyeManager'][_0x38de61]['pRender']&&(this['stFishEyeManager'][_0x38de61]['pRender']=new _0x453e55(),null==this['pFishParamManager']&&(this['pFishParamManager']=new _0x30cc90()),this['stFishEyeManager'][_0x38de61]['pRender']['SR_SetFishParamManager'](this['pFishParamManager'])),0x1);}},{'key':'FEC_SetWnd','value':function(_0xb663fd,_0x1038c6){if(_0xb663fd<0x1||_0xb663fd>0x1f||null==_0xb663fd)return console['info']('%c\\x20FEC_SetWnd-1\\x20nSubPort:%d','color:\\x20red',_0xb663fd),this['FECErrorCode']=_0x41c932,0x0;if(null==this['stFishEyeManager'][_0xb663fd]['pRender'])return console['info']('%c\\x20FEC_SetWnd-2\\x20nSubPort:%d\\x20pRender\\x20is\\x20null','color:\\x20red',_0xb663fd),this['FECErrorCode']=_0x599b74,0x0;if(0x0==this['stFishEyeManager'][_0xb663fd]['bUsed'])return console['info']('%c\\x20FEC_SetWnd-3\\x20nSubPort:%d\\x20bUsed:%d','color:\\x20red',_0xb663fd,this['stFishEyeManager'][_0xb663fd]['bUsed']),this['FECErrorCode']=_0x4b57a2,0x0;if(null==_0x1038c6)return console['info']('%c\\x20FEC_SetWnd-4\\x20nSubPort:%d\\x20sCanvasID:%s','color:\\x20red',_0xb663fd,_0x1038c6),this['FECErrorCode']=0x519,0x0;if(0x0!=this['stFishEyeManager'][_0xb663fd]['nSubPort']&&0x0!=this['stFishEyeManager'][_0xb663fd]['bUsed']){if(0x0!=this['stFishEyeManager'][_0xb663fd]['bInited']&&null!=this['stFishEyeManager'][_0xb663fd]['sCanvasID'])return _0x1038c6!=this['stFishEyeManager'][_0xb663fd]['sCanvasID']?(console['info']('%c\\x20FEC_SetWnd-5\\x20nSubPort:%d\\x20sCanvasID:%s\\x20already\\x20init','color:\\x20red',_0xb663fd,_0x1038c6),this['FECErrorCode']=0x506,0x0):0x1;var _0x49e36c;_0x49e36c=this['_ConvertDisplayEffect'](this['stFishEyeManager'][_0xb663fd]['emPlaceType'],this['stFishEyeManager'][_0xb663fd]['emCorrectType']);var _0x4577b8=this['stFishEyeManager'][_0xb663fd]['pRender']['SR_Init'](_0x1038c6,_0xa01ff6),_0x552ae2=this['stFishEyeManager'][_0xb663fd]['pRender']['SR_AddSubPort'](_0x49e36c);if(-0x1==_0x552ae2)return console['info']('%c\\x20FEC_SetWnd\\x20SR_AddSubPort\\x20error\\x20subport:%d','color:\\x20red',_0xb663fd),0x0;if(this['stFishEyeManager'][_0xb663fd]['nValidSubPort']=_0x552ae2,_0xa87ede!=_0x4577b8)return this['stFishEyeManager'][_0xb663fd]['bInited']=0x0,this['stFishEyeManager'][_0xb663fd]['sCanvasID']=null,this['FECErrorCode']=_0x4b57a2,0x0;if(this['stFishEyeManager'][_0xb663fd]['bInited']=0x1,this['stFishEyeManager'][_0xb663fd]['sCanvasID']=_0x1038c6,_0x1837a3<=this['stFishEyeManager'][_0xb663fd]['emCorrectType']){var _0x303aaf=this['stFishEyeManager'][_0xb663fd]['pRender']['SR_SetRenderState'](_0x57ef5a,0x0);_0xa87ede!=_0x303aaf&&console['log']('>>>VideoRender.js\\x20SR_SetRenderState\\x20failed\\x20ret:%08x\\x0a',_0x303aaf);}return this['FECShowMode']>0x0&&this['stFishEyeManager'][_0xb663fd]['pRender']['SR_SetPTZDisplayMode'](this['FECShowMode']),0x1;}return this['FECErrorCode']=_0x4b57a2,0x0;}},{'key':'FEC_Disable','value':function(_0x21074f,_0x145f67,_0x183cf1){if(_0x21074f<0x1||_0x21074f>0x1f||null==_0x21074f)return console['info']('%c\\x20FEC_Disable-1\\x20nSubPort:%d','color:\\x20red',_0x21074f),this['FECErrorCode']=_0x41c932,0x0;if(0x1==this['stFishEyeManager'][_0x21074f]['bInited']&&null!=this['stFishEyeManager'][_0x21074f]['pRender']){if(_0xa87ede!=this['stFishEyeManager'][_0x21074f]['pRender']['SR_DelSubPort'](this['stFishEyeManager'][_0x21074f]['nValidSubPort']))return console['info']('%c\\x20FEC_Disable-2\\x20SR_DelSubPort\\x20error\\x20nSubPort:%d','color:\\x20red',_0x21074f),0x0;this['stFishEyeManager'][_0x21074f]['bInited']=0x0,this['stFishEyeManager'][_0x21074f]['nValidSubPort']=-0x1,this['stFishEyeManager'][_0x21074f]['pRender']['SR_Destroy'](),this['stFishEyeManager'][_0x21074f]['pRender']=null;}return 0x1;}},{'key':'FEC_DelPort','value':function(_0x439d0b){return _0x439d0b<0x1||_0x439d0b>0x1f||null==_0x439d0b?(console['info']('%c\\x20FEC_DelPort-1\\x20nSubPort:%d','color:\\x20red',_0x439d0b),this['FECErrorCode']=_0x41c932,0x0):0x0==this['stFishEyeManager'][_0x439d0b]['bUsed']?(console['info']('%c\\x20FEC_DelPort-2\\x20nSubPort:%d\\x20bUsed:%d','color:\\x20red',_0x439d0b,this['stFishEyeManager'][_0x439d0b]['bUsed']),this['FECErrorCode']=_0x4b57a2,0x0):(this['stFishEyeManager'][_0x439d0b]['nSubPort']=0x0,this['stFishEyeManager'][_0x439d0b]['sCanvasID']=null,this['stFishEyeManager'][_0x439d0b]['bUsed']=0x0,this['stFishEyeManager'][_0x439d0b]['bInited']=0x0,this['stFishEyeManager'][_0x439d0b]['nValidSubPort']=0x0,this['stFishEyeManager'][_0x439d0b]['emPlaceType']=_0x1e68ea,this['stFishEyeManager'][_0x439d0b]['emCorrectType']=_0x4fbb93,this['stFishEyeManager'][_0x439d0b]['emEffect']=_0x186ff9['SR_DE_FISH_ORIGINAL'],this['stFishParam'][_0x439d0b]['stCycleParam']['fRadiusLeft']=0x0,this['stFishParam'][_0x439d0b]['stCycleParam']['fRadiusRight']=0x1,this['stFishParam'][_0x439d0b]['stCycleParam']['fRadiusTop']=0x0,this['stFishParam'][_0x439d0b]['stCycleParam']['fRadiusBottom']=0x1,this['subPortNum']>0x0&&this['subPortNum']--,0x1);}},{'key':'FEC_SetParam','value':function(_0x237226,_0x485f7d){if(this['FECErrorCode']=0x0,_0x237226<0x0||_0x237226>0x1f||null==_0x237226)return console['info']('%c\\x20FEC_SetParam-1\\x20nSubPort:%d','color:\\x20red',_0x237226),this['FECErrorCode']=_0x41c932,0x0;if(null==this['stFishEyeManager'][_0x237226]['pRender'])return console['info']('%c\\x20FEC_SetParam-2\\x20nSubPort:%d\\x20pRender:%d','color:\\x20red',_0x237226,this['stFishEyeManager'][_0x237226]['pRender']),this['FECErrorCode']=_0x599b74,0x0;if(0x0==this['stFishEyeManager'][_0x237226]['bUsed'])return console['info']('%c\\x20FEC_SetParam-3\\x20nSubPort:%d\\x20bUsed:%d','color:\\x20red',_0x237226,this['stFishEyeManager'][_0x237226]['bUsed']),this['FECErrorCode']=_0x4b57a2,0x0;if(this['stFishEyeManager'][_0x237226]['emCorrectType']>=_0x1837a3&&this['stFishEyeManager'][_0x237226]['emCorrectType']<=_0x2a01ec&&0x1e&_0x485f7d['upDateType'])return console['info']('%c\\x20FEC_SetParam-4\\x20nSubPort:%d\\x20not\\x203D','color:\\x20red',_0x237226),this['FECErrorCode']=_0x13beae,0x0;if(_0x16ee77&_0x485f7d['upDateType']){if(null==_0x485f7d['stCycleParam'])return this['FECErrorCode']=_0x31d5c8,0x0;for(var _0x43b2cb=0x1;_0x43b2cb<_0x5440d6;_0x43b2cb++){if(this['stFishEyeManager'][_0x43b2cb]['bUsed']&&this['stFishEyeManager'][_0x43b2cb]['nSubPort']&&_0x39b0d3==this['stFishEyeManager'][_0x43b2cb]['emCorrectType']&&(_0x485f7d['stCycleParam']['fRadiusLeft']<=-0.5||_0x485f7d['stCycleParam']['fRadiusLeft']>=0.4||_0x485f7d['stCycleParam']['fRadiusRight']<=0.6||_0x485f7d['stCycleParam']['fRadiusRight']>=1.5||_0x485f7d['stCycleParam']['fRadiusTop']<=-0.5||_0x485f7d['stCycleParam']['fRadiusTop']>0x0||_0x485f7d['stCycleParam']['fRadiusBottom']<0x1||_0x485f7d['stCycleParam']['fRadiusBottom']>=1.5||_0x485f7d['stCycleParam']['fRadiusLeft']+_0x485f7d['stCycleParam']['fRadiusRight']<=0.8||_0x485f7d['stCycleParam']['fRadiusLeft']+_0x485f7d['stCycleParam']['fRadiusRight']>=1.2||_0x485f7d['stCycleParam']['fRadiusTop']+_0x485f7d['stCycleParam']['fRadiusBottom']<=0.8||_0x485f7d['stCycleParam']['fRadiusTop']+_0x485f7d['stCycleParam']['fRadiusBottom']>=1.2))return this['FECErrorCode']=_0x31d5c8,0x0;if(this['stFishEyeManager'][_0x43b2cb]['bUsed']&&this['stFishEyeManager'][_0x43b2cb]['nSubPort']&&_0x2a01ec==this['stFishEyeManager'][_0x43b2cb]['emCorrectType']&&(_0x485f7d['stCycleParam']['fRadiusLeft']<=-0.5||_0x485f7d['stCycleParam']['fRadiusLeft']>0x0||_0x485f7d['stCycleParam']['fRadiusRight']<0x1||_0x485f7d['stCycleParam']['fRadiusRight']>=1.5||_0x485f7d['stCycleParam']['fRadiusTop']<=-0.5||_0x485f7d['stCycleParam']['fRadiusTop']>=0.4||_0x485f7d['stCycleParam']['fRadiusBottom']<=0.6||_0x485f7d['stCycleParam']['fRadiusBottom']>=1.5||_0x485f7d['stCycleParam']['fRadiusLeft']+_0x485f7d['stCycleParam']['fRadiusRight']<=0.8||_0x485f7d['stCycleParam']['fRadiusLeft']+_0x485f7d['stCycleParam']['fRadiusRight']>=1.2||_0x485f7d['stCycleParam']['fRadiusTop']+_0x485f7d['stCycleParam']['fRadiusBottom']<=0.8||_0x485f7d['stCycleParam']['fRadiusTop']+_0x485f7d['stCycleParam']['fRadiusBottom']>=1.2))return this['FECErrorCode']=_0x31d5c8,0x0;}}if(0x0==this['stFishEyeManager'][_0x237226]['bInited']){if(_0x353221&_0x485f7d['upDateType']){if(_0x2cb8a2!=this['stFishEyeManager'][_0x237226]['emCorrectType']&&_0x4e5968!=this['stFishEyeManager'][_0x237226]['emCorrectType']||_0x2aea6b==this['stFishEyeManager'][_0x237226]['emPlaceType'])return this['FECErrorCode']=_0x13beae,0x0;for(var _0x1db10f=0x1;_0x1db10f<_0x5440d6;_0x1db10f++)if(this['stFishEyeManager'][_0x1db10f]['nSubPort']&&this['stFishEyeManager'][_0x1db10f]['bUsed']&&this['stFishEyeManager'][_0x1db10f]['emCorrectType']==_0x54a990)return this['FECErrorCode']=_0x1ee0b0,0x0;this['stFishParam'][_0x237226]['fWideScanOffset']=_0x485f7d['fValue'];}if(_0x1f2582&_0x485f7d['upDateType']){if(null==_0x485f7d['stPTZColor'])return this['FECErrorCode']=_0x31d5c8,0x0;if(_0x485f7d['stPTZColor']['nR']>0xff||_0x485f7d['stPTZColor']['nG']>0xff||_0x485f7d['stPTZColor']['nB']>0xff||_0x485f7d['stPTZColor']['nAlpha']>0xff)return this['FECErrorCode']=_0x13beae,0x0;this['stFishParam'][_0x237226]['stPTZColor']['nR']=_0x485f7d['stPTZColor']['nR'],this['stFishParam'][_0x237226]['stPTZColor']['nG']=_0x485f7d['stPTZColor']['nG'],this['stFishParam'][_0x237226]['stPTZColor']['nB']=_0x485f7d['stPTZColor']['nB'],this['stFishParam'][_0x237226]['stPTZColor']['nAlpha']=_0x485f7d['stPTZColor']['nAlpha'];}if(_0x2b1528&_0x485f7d['upDateType']){if(_0x54a990!=this['stFishEyeManager'][_0x237226]['emCorrectType'])return this['FECErrorCode']=_0x13beae,0x0;this['stFishParam'][_0x237226]['stPTZParam']['fPTZPositionX']=_0x485f7d['fPTZParam']['fPTZPositionX'],this['stFishParam'][_0x237226]['stPTZParam']['fPTZPositionY']=_0x485f7d['fPTZParam']['fPTZPositionY'];}if(_0x3ff4c5&_0x485f7d['upDateType']){if(_0x54a990!=this['stFishEyeManager'][_0x237226]['emCorrectType'])return this['FECErrorCode']=_0x13beae,0x0;this['stFishParam'][_0x237226]['fZoom']=_0x485f7d['fPTZZoom'];}if(_0x160732&_0x485f7d['upDateType']){if(null==this['stFishParam']['stPTZSelect'])return 0x0;if(_0x54a990!=this['stFishEyeManager'][_0x237226]['emCorrectType'])return this['FECErrorCode']=_0x13beae,0x0;this['stFishParam']['stPTZSelect']['fTop']=_0x485f7d['stPTZSelect']['fTop'],this['stFishParam']['stPTZSelect']['fBottom']=_0x485f7d['stPTZSelect']['fBottom'],this['stFishParam']['stPTZSelect']['fLeft']=_0x485f7d['stPTZSelect']['fLeft'],this['stFishParam']['stPTZSelect']['fRight']=_0x485f7d['stPTZSelect']['fRight'];}if(_0x16ee77&_0x485f7d['upDateType']){if(null==_0x485f7d['stCycleParam'])return this['FECErrorCode']=_0x31d5c8,0x0;if(0x0==this['_IsValidRadiusParam'](_0x485f7d['stCycleParam']))return this['FECErrorCode']=_0x31d5c8,0x0;this['stFishParam'][0x0]['stCycleParam']['fRadiusLeft']=_0x485f7d['stCycleParam']['fRadiusLeft'],this['stFishParam'][0x0]['stCycleParam']['fRadiusRight']=_0x485f7d['stCycleParam']['fRadiusRight'],this['stFishParam'][0x0]['stCycleParam']['fRadiusTop']=_0x485f7d['stCycleParam']['fRadiusTop'],this['stFishParam'][0x0]['stCycleParam']['fRadiusBottom']=_0x485f7d['stCycleParam']['fRadiusBottom'];}return 0x1;}if(_0x353221&_0x485f7d['upDateType']){if(_0x2cb8a2!=this['stFishEyeManager'][_0x237226]['emCorrectType']&&_0x4e5968!=this['stFishEyeManager'][_0x237226]['emCorrectType']||_0x2aea6b==this['stFishEyeManager'][_0x237226]['emPlaceType'])return this['FECErrorCode']=_0x13beae,0x0;for(var _0x605b6d=0x1;_0x605b6d<_0x5440d6;_0x605b6d++)if(this['stFishEyeManager'][_0x605b6d]['nSubPort']&&this['stFishEyeManager'][_0x605b6d]['bUsed']&&this['stFishEyeManager'][_0x605b6d]['emCorrectType']==_0x54a990)return this['FECErrorCode']=_0x1ee0b0,0x0;var _0x2745e8={};if(_0x2745e8['nFishParamType']=_0x5ca12e,_0x2745e8['bBlack']=0x0,_0x2745e8['fAngle']=_0x485f7d['fValue'],_0xa87ede!=this['stFishEyeManager'][_0x237226]['pRender']['SR_SetFishParam'](_0x2745e8))return this['FECErrorCode']=_0x1ee0b0,0x0;this['stFishParam'][_0x237226]['fWideScanOffset']=_0x485f7d['fValue'];}if(_0x1f2582&_0x485f7d['upDateType']){if(null==_0x485f7d['stPTZColor'])return this['FECErrorCode']=_0x13beae,0x0;if(_0x485f7d['stPTZColor']['nR']>0xff||_0x485f7d['stPTZColor']['nG']>0xff||_0x485f7d['stPTZColor']['nB']>0xff||_0x485f7d['stPTZColor']['nAlpha']>0xff)return this['FECErrorCode']=_0x13beae,0x0;var _0x226925={};_0x226925['fR']=float(_0x485f7d['stPTZColor']['nR']/0xff),_0x226925['fG']=float(_0x485f7d['stPTZColor']['nG']/0xff),_0x226925['fB']=float(_0x485f7d['stPTZColor']['nB']/0xff),_0x226925['fA']=float(_0x485f7d['stPTZColor']['nAlpha']/0xff),this['stFishParam'][_0x237226]['stPTZColor']['nR']=_0x485f7d['stPTZColor']['nR'],this['stFishParam'][_0x237226]['stPTZColor']['nG']=_0x485f7d['stPTZColor']['nG'],this['stFishParam'][_0x237226]['stPTZColor']['nB']=_0x485f7d['stPTZColor']['nB'],this['stFishParam'][_0x237226]['stPTZColor']['nAlpha']=_0x485f7d['stPTZColor']['nAlpha'];}if(_0x2b1528&_0x485f7d['upDateType']){if(_0x54a990!=this['stFishEyeManager'][_0x237226]['emCorrectType'])return this['FECErrorCode']=_0x13beae,0x0;var _0x179a25={};_0x179a25['nFishParamType']=_0x3be196,_0x179a25['bBlack']=0x0,_0x179a25['fPTZX']=_0x485f7d['fPTZParam']['fPTZPositionX'],_0x179a25['fPTZY']=_0x485f7d['fPTZParam']['fPTZPositionY'];var _0x2080ac=this['stFishEyeManager'][_0x237226]['pRender']['SR_SetFishParam'](_0x179a25);if(_0xa87ede!=_0x2080ac)return this['FECErrorCode']=_0x1ee0b0,0x0;this['stFishParam'][_0x237226]['stPTZParam']['fPTZPositionX']=_0x485f7d['fPTZParam']['fPTZPositionX'],this['stFishParam'][_0x237226]['stPTZParam']['fPTZPositionY']=_0x485f7d['fPTZParam']['fPTZPositionY'];}if(_0x3ff4c5&_0x485f7d['upDateType']){if(_0x54a990!=this['stFishEyeManager'][_0x237226]['emCorrectType'])return this['FECErrorCode']=_0x13beae,0x0;var _0x3a5d9f={};if(_0x3a5d9f['nFishParamType']=_0x378a81,_0x3a5d9f['bBlack']=0x0,_0x3a5d9f['fZoom']=_0x485f7d['fPTZZoom'],_0xa87ede!=this['stFishEyeManager'][_0x237226]['pRender']['SR_SetFishParam'](_0x3a5d9f))return this['FECErrorCode']=_0x1ee0b0,0x0;this['stFishParam'][_0x237226]['fZoom']=_0x485f7d['fPTZZoom'];}if(_0x16ee77&_0x485f7d['upDateType']){if(0x0==this['_IsValidRadiusParam'](_0x485f7d['stCycleParam']))return this['FECErrorCode']=_0x31d5c8,0x0;var _0x5b29fe={};if(_0x5b29fe['nFishParamType']=_0x392c27,_0x5b29fe['bBlack']=0x1,_0x5b29fe['fRXLeft']=_0x485f7d['stCycleParam']['fRadiusLeft'],_0x5b29fe['fRXRight']=_0x485f7d['stCycleParam']['fRadiusRight'],_0x5b29fe['fRYTop']=_0x485f7d['stCycleParam']['fRadiusTop'],_0x5b29fe['fRYBottom']=_0x485f7d['stCycleParam']['fRadiusBottom'],_0xa87ede!=this['stFishEyeManager'][_0x237226]['pRender']['SR_SetFishParam'](this['stFishEyeManager'][_0x237226]['nValidSubPort'],_0x5b29fe))return this['FECErrorCode']=_0x31d5c8,0x0;this['stFishParam'][0x0]['stCycleParam']['fRadiusLeft']=_0x485f7d['stCycleParam']['fRadiusLeft'],this['stFishParam'][0x0]['stCycleParam']['fRadiusRight']=_0x485f7d['stCycleParam']['fRadiusRight'],this['stFishParam'][0x0]['stCycleParam']['fRadiusTop']=_0x485f7d['stCycleParam']['fRadiusTop'],this['stFishParam'][0x0]['stCycleParam']['fRadiusBottom']=_0x485f7d['stCycleParam']['fRadiusBottom'];}return _0x160732&_0x485f7d['upDateType']&&_0x54a990==this['stFishEyeManager'][_0x237226]['emCorrectType']&&_0xa87ede!=this['stFishEyeManager'][_0x237226]['pRender']['SR_SetFishParam'](this['stFishEyeManager'][_0x237226]['stPTZSelect'])?(this['FECErrorCode']=0x513,0x0):0x1;}},{'key':'FEC_GetParam','value':function(_0x23d898,_0x5da795){return _0x23d898<0x0||_0x23d898>0x1f||null==_0x23d898?(console['info']('%c\\x20FEC_GetParam-1\\x20nSubPort:%d','color:\\x20red',_0x23d898),this['FECErrorCode']=_0x41c932,0x0):null==this['stFishEyeManager'][_0x23d898]['pRender']?(console['info']('%c\\x20FEC_GetParam-2\\x20pRender:%d','color:\\x20red',this['stFishEyeManager'][_0x23d898]['pRender']),this['FECErrorCode']=_0x599b74,0x0):(this['stFishEyeManager'][_0x23d898]['pRender']['SR_GetFishParam'](_0x5da795),_0x5da795['emCorrectType']=this['stFishEyeManager'][_0x23d898]['emCorrectType'],0x1);}},{'key':'_IsValidRadiusParam','value':function(_0x40fd77){return _0x40fd77['fRadiusBottom']<=_0x40fd77['fRadiusTop']||_0x40fd77['fRadiusRight']<=_0x40fd77['fRadiusLeft']?0x0:0x1;}},{'key':'FEC_SetViewParam','value':function(_0x4a0fcd,_0x6d5dc9,_0x40e4db){return _0x4a0fcd<0x0||_0x4a0fcd>0x1f||null==_0x4a0fcd?(console['info']('%c\\x20FEC_SetViewParam-1\\x20nSubPort:%d','color:\\x20red',_0x4a0fcd),this['FECErrorCode']=_0x41c932,0x0):null==this['stFishEyeManager'][_0x4a0fcd]['pRender']?(console['info']('%c\\x20FEC_SetViewParam-2\\x20pRender:%d','color:\\x20red',this['stFishEyeManager'][_0x4a0fcd]['pRender']),this['FECErrorCode']=_0x599b74,0x0):_0x6d5dc9<_0x394973||_0x6d5dc9>_0x339c63?(this['FECErrorCode']=_0x633153,0x0):(this['FECErrorCode']=0x0,0x0==this['stFishEyeManager'][_0x4a0fcd]['bInited']?(this['FECErrorCode']=_0x4b57a2,0x0):_0x1837a3<=this['stFishEyeManager'][_0x4a0fcd]['emCorrectType']?_0xa87ede!=this['stFishEyeManager'][_0x4a0fcd]['pRender']['SR_SetViewParam'](_0x6d5dc9,_0x40e4db)?(this['FECErrorCode']=_0x633153,0x0):0x1:(this['FECErrorCode']=_0x13beae,0x0));}},{'key':'FEC_GetViewParam','value':function(_0xcd7f54,_0x5891ca,_0x5f1437){if(_0x5f1437['fValue']=-0x1,_0xcd7f54<0x0||_0xcd7f54>0x1f||null==_0xcd7f54)return console['info']('%c\\x20FEC_GetViewParam-1\\x20nSubPort:%d','color:\\x20red',_0xcd7f54),this['FECErrorCode']=_0x41c932,0x0;if(null==this['stFishEyeManager'][_0xcd7f54]['pRender'])return console['info']('%c\\x20FEC_GetViewParam-2\\x20pRender:%d','color:\\x20red',this['stFishEyeManager'][_0xcd7f54]['pRender']),this['FECErrorCode']=_0x599b74,0x0;if(_0x5891ca<0x1||_0x5891ca>0x3||0x0==this['stFishEyeManager'][_0xcd7f54]['bInited'])return 0x0;if(_0x1837a3<=this['stFishEyeManager'][_0xcd7f54]['emCorrectType'])this['stFishEyeManager'][_0xcd7f54]['pRender']['SR_GetViewParam'](_0x5891ca,_0x5f1437);return 0x1;}},{'key':'FEC_SetDisplayRegion','value':function(_0x3d509f,_0x79e701,_0x3db710,_0x11fb5e,_0x5d386a,_0x384723,_0x377cbb){return _0x3d509f<0x0||_0x3d509f>0x1f||null==_0x3d509f?(console['info']('%c\\x20FEC_SetDisplayRegion-1\\x20nSubPort:%d','color:\\x20red',_0x3d509f),this['FECErrorCode']=_0x41c932,0x0):null==this['stFishEyeManager'][_0x3d509f]['pRender']?(console['info']('%c\\x20FEC_SetDisplayRegion-2\\x20pRender:%d','color:\\x20red',this['stFishEyeManager'][_0x3d509f]['pRender']),this['FECErrorCode']=_0x599b74,0x0):0x0!=_0x79e701||0x0!=_0x3db710?(this['FECErrorCode']=_0x633153,0x0):this['stFishEyeManager'][_0x3d509f]['emCorrectType']!=_0x4fbb93&&this['stFishEyeManager'][_0x3d509f]['emCorrectType']!=_0x2cb8a2&&this['stFishEyeManager'][_0x3d509f]['emCorrectType']!=_0x4e5968&&this['stFishEyeManager'][_0x3d509f]['emCorrectType']!=_0x30e952?(this['FECErrorCode']=_0xa88cb3,0x0):0x0==this['stFishEyeManager'][_0x3d509f]['bInited']?(this['FECErrorCode']=_0x4b57a2,0x0):_0x11fb5e<0x0||_0x5d386a<0x0||_0x384723<0x0||_0x377cbb<0x0?(this['FECErrorCode']=_0x633153,0x0):_0xa87ede!=this['stFishEyeManager'][_0x3d509f]['pRender']['SR_SetDisplayRect'](_0x11fb5e,_0x5d386a,_0x384723,_0x377cbb,_0xe9e464)?(this['FECErrorCode']=0x511,0x0):0x1;}},{'key':'FEC_SetBackCilling','value':function(_0xbc4cf3,_0x201397){return _0xbc4cf3<0x0||_0xbc4cf3>0x1f||null==_0xbc4cf3?(this['FECErrorCode']=_0x41c932,0x0):null==this['stFishEyeManager'][_0xbc4cf3]['pRender']?(this['FECErrorCode']=_0x599b74,0x0):0x0==this['stFishEyeManager'][_0xbc4cf3]['bInited']?(this['FECErrorCode']=_0x4b57a2,0x0):_0xa87ede!=this['stFishEyeManager'][_0xbc4cf3]['pRender']['SR_SetRenderState'](_0x57ef5a,_0x201397)?(this['FECErrorCode']=0x511,0x0):0x1;}},{'key':'FEC_GetPTZPort','value':function(_0x4fe218,_0x7d79a,_0x4703e2){if(null!=this['stFishEyeManager'][_0x4fe218]['pRender']){var _0x47f9ac={'nPTZPort':-0x1};if(this['stFishEyeManager'][_0x4fe218]['pRender']['SR_GetPTZPort'](_0x7d79a,_0x4703e2,_0x47f9ac)==_0xa87ede)return _0x47f9ac['nPTZPort'];}return-0x1;}},{'key':'FEC_SetPTZDisplayMode','value':function(_0x5168d7){return _0x5168d7>=0x0&&_0x5168d7<=0x2?(null!=this['stFishEyeManager'][0x0]['pRender']&&this['stFishEyeManager'][0x0]['pRender']['SR_SetPTZDisplayMode'](_0x5168d7),this['FECShowMode']=_0x5168d7,0x1):(console['info']('%c\\x20FEC_SetPTZDisplayMode\\x20ptzMode:%d','color:\\x20red',_0x5168d7),0x0);}},{'key':'CheckFrameRGB','value':function(_0x400c17,_0x548d6f,_0x2d4a2b,_0x429d43,_0x85a7c0,_0x75707d){if(null==_0x400c17)return 0x0;for(var _0x1abe54=_0x400c17['width']/(_0x429d43-0x1),_0x597f03=_0x400c17['height']/(_0x2d4a2b-0x1),_0x5de9dd=0x0,_0x42fb15=0x0,_0x5e4ee7=[],_0x370864=0x0;_0x370864<_0x2d4a2b*_0x429d43;_0x370864++)_0x5e4ee7[_0x370864]=0x0,this['aPOSAdaptBuf'][_0x370864]=0x0;if(_0x548d6f){for(var _0x3e2865=0x0,_0x5c702f=0x0;_0x5c702f<_0x400c17['height'];_0x5c702f++)for(var _0x10ae9f=0x0;_0x10ae9f<_0x400c17['width'];_0x10ae9f++){_0x5de9dd=(_0x5de9dd=Math['round'](_0x10ae9f/(_0x1abe54/0x2)/0x2))<_0x429d43?_0x5de9dd:_0x429d43-0x1,_0x42fb15=(_0x42fb15=Math['round'](_0x5c702f/(_0x597f03/0x2)/0x2))<_0x2d4a2b?_0x42fb15:_0x2d4a2b-0x1;var _0x336a7e=_0x400c17['pBuffer'][_0x3e2865],_0x24b367=_0x400c17['pBuffer'][_0x3e2865+0x1],_0x36ee90=_0x400c17['pBuffer'][_0x3e2865+0x2],_0x22e317=Math['round'](0.299*_0x336a7e+0.587*_0x24b367+0.114*_0x36ee90);this['aPOSAdaptBuf'][_0x5de9dd+_0x42fb15*_0x429d43]+=_0x22e317,_0x5e4ee7[_0x5de9dd+_0x42fb15*_0x429d43]++,_0x3e2865+=0x4;}for(var _0x401fa2=0x0,_0x5bb257=0x0;_0x5bb257<_0x2d4a2b*_0x429d43;_0x5bb257++)_0x401fa2=this['aPOSAdaptBuf'][_0x5bb257]/_0x5e4ee7[_0x5bb257],this['aPOSAdaptBuf'][_0x5bb257]=_0x401fa2>0x80?0x0:0x1;}else{for(var _0x3562ea=Math['round'](_0x85a7c0*_0x400c17['width']),_0x1174dc=Math['round'](_0x75707d*_0x400c17['height']),_0x55c743=_0x1174dc-0x2;_0x55c743<_0x1174dc+0x2;_0x55c743++)for(var _0xb2203=_0x3562ea-0x2;_0xb2203<_0x3562ea+0x2;_0xb2203++){var _0x5add96=0x4*Math['floor']((0x4*_0xb2203+_0x55c743*_0x400c17['width']*0x4)/0x4),_0x1f54e5=_0x400c17['pBuffer'][_0x5add96],_0x2a4e1c=_0x400c17['pBuffer'][_0x5add96+0x1],_0x49d1c6=_0x400c17['pBuffer'][_0x5add96+0x2],_0x2aa3f7=Math['round'](0.299*_0x1f54e5+0.587*_0x2a4e1c+0.114*_0x49d1c6);this['aPOSAdaptBuf'][0x0]+=_0x2aa3f7,_0x5e4ee7[0x0]++;}this['aPOSAdaptBuf'][0x0]=this['aPOSAdaptBuf'][0x0]/_0x5e4ee7[0x0]>0x80?0x0:0x1;}return 0x1;}},{'key':'GetWaterFontParam','value':function(_0x2b0736){var _0x4f4c87=_0x2b0736['pFontString']['length'],_0x1ea0c5=_0x2b0736['pstFontRotate']['fRotateAngle']%0x168/0x168*0x2*Math['PI'],_0x4bcf18=Math['min'](_0x2b0736['pstFontSize']['nFontWidth'],_0x2b0736['pstFontSize']['nFontHeight']),_0x353469=_0x4bcf18/this['mainCanvasID']['width'],_0x5c3214=_0x4bcf18/this['mainCanvasID']['height'],_0xf815fd=_0x353469*Math['cos'](Math['PI']/0x2-_0x1ea0c5)*_0x2b0736['pSpace'],_0x55e462=_0x5c3214*Math['sin'](Math['PI']/0x2-_0x1ea0c5)*_0x2b0736['pSpace'],_0x59715c=[],_0x34cae1=[],_0x7da49d=[];if(_0x2b0736['nFontAlign']){for(var _0x1169c4=0x0;_0x1169c4<_0x4f4c87;_0x1169c4++)_0x59715c[_0x1169c4]=_0x2b0736['pFontString'][0x0]['length']*_0x353469/0x6,_0x34cae1[_0x1169c4]=Math['atan2'](_0x59715c[0x0],_0x55e462),_0x7da49d[_0x1169c4]=Math['sqrt'](_0x59715c[0x0]*_0x59715c[0x0],_0x55e462*_0x55e462);}else{for(var _0x2fc8f2=0x0;_0x2fc8f2<_0x4f4c87;_0x2fc8f2++)_0x59715c[_0x2fc8f2]=0x0,_0x34cae1[_0x2fc8f2]=0x0,_0x7da49d[_0x2fc8f2]=0x0;}var _0x2555f3=Math['floor'](_0x2b0736['pstFontNumber']['nRowNumber']),_0x3d982a=Math['floor'](_0x2b0736['pstFontNumber']['nColNumber']),_0x55fbab=_0x2555f3*_0x3d982a;if(_0x2b0736['pstFontRotate']['fFillFullScreen']){for(var _0x2a16f3=[],_0x3d058c=[],_0x14f147=0x1/(_0x2555f3-0x1),_0x54aad3=0x0;_0x54aad3<_0x2555f3;_0x54aad3++)_0x2a16f3[_0x54aad3]=_0x14f147*_0x54aad3-_0x55e462*((_0x4f4c87-0x1)/0x2);for(var _0x207291=0x1/(_0x3d982a-0x1),_0x38e523=0x0;_0x38e523<_0x3d982a;_0x38e523++)_0x3d058c[_0x38e523]=_0x207291*_0x38e523+_0xf815fd*((_0x4f4c87-0x1)/0x2);for(var _0x29c684=0x0;_0x29c684<_0x55fbab;++_0x29c684)for(var _0x3e40a4=0x0;_0x3e40a4<_0x4f4c87;_0x3e40a4++){this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]={},this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pString']=_0x2b0736['pFontString'][_0x3e40a4],this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['nFontWidth']=_0x4bcf18,this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['nFontHeight']=_0x4bcf18,this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstStartPos']={};var _0x268e69=_0x29c684%_0x3d982a,_0x3739c2=Math['floor'](_0x29c684/_0x3d982a),_0x42d794=Math['PI']/0x2-_0x1ea0c5+_0x34cae1[_0x3e40a4];this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstStartPos']['fX']=_0x3d058c[_0x268e69]-_0x3e40a4*_0xf815fd+_0x7da49d[_0x3e40a4]*Math['cos'](_0x42d794),this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstStartPos']['fY']=_0x2a16f3[_0x3739c2]+_0x3e40a4*_0x55e462-_0x7da49d[_0x3e40a4]*Math['sin'](_0x42d794),_0x2b0736['nColorAdapt']?(this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstFontColor']={},this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstFontColor']['fR']=this['aPOSAdaptBuf'][_0x29c684],this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstFontColor']['fG']=this['aPOSAdaptBuf'][_0x29c684],this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstFontColor']['fB']=this['aPOSAdaptBuf'][_0x29c684],this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstFontColor']['fA']=_0x2b0736['pstFontColor']['fA']):this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstFontColor']=_0x2b0736['pstFontColor'],this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['bBackGround']=!0x1,this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pstBGColor']=null,this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['fRotateAngle']=_0x2b0736['pstFontRotate']['fRotateAngle'],this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['pFontFamily']=_0x2b0736['pFontFamily'],_0x2b0736['nFontAlign']?(this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['textAlign']='left',this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['textBaseline']='top'):(this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['textAlign']='center',this['pWaterFontParam'][_0x4f4c87*_0x29c684+_0x3e40a4]['textBaseline']='middle');}}else{for(var _0x177df4=0x0;_0x177df4<_0x2b0736['pFontString']['length'];_0x177df4++)this['pWaterFontParam'][_0x177df4]={},this['pWaterFontParam'][_0x177df4]['pString']=_0x2b0736['pFontString'][_0x177df4],this['pWaterFontParam'][_0x177df4]['nFontWidth']=_0x4bcf18,this['pWaterFontParam'][_0x177df4]['nFontHeight']=_0x4bcf18,this['pWaterFontParam'][_0x177df4]['pstStartPos']={},this['pWaterFontParam'][_0x177df4]['pstStartPos']['fX']=_0x2b0736['pstStartPos']['fX']-_0x177df4*_0xf815fd,this['pWaterFontParam'][_0x177df4]['pstStartPos']['fY']=_0x2b0736['pstStartPos']['fY']+_0x177df4*_0x55e462,_0x2b0736['nColorAdapt']?(this['pWaterFontParam'][_0x177df4]['pstFontColor']={},this['pWaterFontParam'][_0x177df4]['pstFontColor']['fR']=this['aPOSAdaptBuf'][0x0],this['pWaterFontParam'][_0x177df4]['pstFontColor']['fG']=this['aPOSAdaptBuf'][0x0],this['pWaterFontParam'][_0x177df4]['pstFontColor']['fB']=this['aPOSAdaptBuf'][0x0],this['pWaterFontParam'][_0x177df4]['pstFontColor']['fA']=_0x2b0736['pstFontColor']['fA']):this['pWaterFontParam'][_0x177df4]['pstFontColor']=_0x2b0736['pstFontColor'],this['pWaterFontParam'][_0x177df4]['bBackGround']=!0x1,this['pWaterFontParam'][_0x177df4]['pstBGColor']=null,this['pWaterFontParam'][_0x177df4]['fRotateAngle']=_0x2b0736['pstFontRotate']['fRotateAngle'],this['pWaterFontParam'][_0x177df4]['pFontFamily']=_0x2b0736['pFontFamily'],_0x2b0736['nFontAlign']?(this['pWaterFontParam'][_0x177df4]['textAlign']='left',this['pWaterFontParam'][_0x177df4]['textBaseline']='top'):(this['pWaterFontParam'][_0x177df4]['textAlign']='center',this['pWaterFontParam'][_0x177df4]['textBaseline']='middle');}return 0x1;}},{'key':'SetWaterMarkFont','value':function(_0x1caf95,_0x5cfbb1){if(this['pWaterFontParam']['splice'](0x0,this['pWaterFontParam']['length']),null===_0x1caf95)return 0x1;if(_0x1caf95['nColorAdapt']){var _0x30b2aa={'nWidth':0x10,'nHeight':0x10,'nBufferLen':0x0},_0x45f96a=this['oVideoHandle']['SR_GetCaptureSize'](_0x30b2aa);if(_0xa87ede==_0x45f96a){var _0x24b57b=new Uint8Array(_0x30b2aa['nBufferLen']),_0x498d3b={};if(_0x498d3b['pBuffer']=_0x24b57b,this['oVideoHandle']['SR_CaptureScreen'](_0x498d3b),_0x498d3b['width']=_0x30b2aa['nWidth'],_0x498d3b['height']=_0x30b2aa['nHeight'],_0x1caf95['pstFontRotate']['fFillFullScreen']){var _0x3dc164=Math['floor'](_0x1caf95['pstFontNumber']['nRowNumber']),_0x5ec18c=Math['floor'](_0x1caf95['pstFontNumber']['nColNumber']);this['CheckFrameRGB'](_0x498d3b,0x1,_0x3dc164,_0x5ec18c,0x0,0x0);}else this['CheckFrameRGB'](_0x498d3b,0x0,0x1,0x1,_0x1caf95['pstStartPos']['fX'],_0x1caf95['pstStartPos']['fY']);_0x24b57b=null;}}return this['GetWaterFontParam'](_0x1caf95),0x1;}},{'key':'ImageDecoder','value':function(_0x5a3da3,_0x1c5c5e,_0xbe633){var _0x5e9ab7=this;_0x5a3da3['decode']({'frameIndex':_0xbe633})['then'](function(_0xfaa340){_0x5e9ab7['pWaterImageParam'][_0xbe633]={},_0x5e9ab7['pWaterImageParam'][_0xbe633]['videoStream']=_0xfaa340['image'],_0x5e9ab7['pWaterImageParam'][_0xbe633]['nImageWidth']=_0xfaa340['image']['displayWidth'],_0x5e9ab7['pWaterImageParam'][_0xbe633]['nImageHeight']=_0xfaa340['image']['displayHeight'],null!=_0x1c5c5e['pstRectPos']?_0x5e9ab7['pWaterImageParam'][_0xbe633]['pstRectPos']=_0x1c5c5e['pstRectPos']:_0x5e9ab7['pWaterImageParam'][_0xbe633]['pstRectPos']={'fLeft':0x0,'fRight':0.1,'fTop':0x0,'fBottom':0.1},null!=_0x1c5c5e['fAlpha']&&_0x1c5c5e['fAlpha']<=0x1&&_0x1c5c5e['fAlpha']>=0x0?_0x5e9ab7['pWaterImageParam'][_0xbe633]['fAlpha']=_0x1c5c5e['fAlpha']:_0x5e9ab7['pWaterImageParam'][_0xbe633]['fAlpha']=0x1,_0x5e9ab7['waterMarkImageMax']=_0x5a3da3['tracks']['selectedTrack']['frameCount'],_0xbe633<_0x5a3da3['tracks']['selectedTrack']['frameCount']-0x1&&_0x5e9ab7['ImageDecoder'](_0x5a3da3,_0x1c5c5e,_0xbe633+0x1);});}},{'key':'SetWaterMarkImage','value':function(_0x4e2929){if(this['pWaterImageParam']['splice'](0x0,this['pWaterImageParam']['length']),null===_0x4e2929)return 0x1;if(null!=_0x4e2929['pImageData']){var _0xb20ecb=new ImageDecoder({'data':_0x4e2929['pImageData'],'type':'image/'+_0x4e2929['pImageType']});_0xb20ecb['tracks']['ready']['then'](function(){}),this['ImageDecoder'](_0xb20ecb,_0x4e2929,0x0);}return this['waterMarkImageIndex']=0x0,0x1;}},{'key':'_ConvertDisplayEffect','value':function(_0x4ea039,_0x46ff13){switch(_0x4ea039){case _0x2aea6b:return _0x54a990==_0x46ff13?_0x186ff9['SR_DE_FISH_PTZ_WALL']:_0x4e5968==_0x46ff13||_0x30e952==_0x46ff13?_0x186ff9['SR_DE_FISH_PANORAMA_WALL']:_0x1837a3==_0x46ff13?_0x186ff9['SR_DE_FISH_SEMISPHERE']:_0x30ecd9==_0x46ff13?_0x186ff9['SR_DE_FISH_PLANET']:_0x39b0d3==_0x46ff13?_0x186ff9['SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL']:_0x2a01ec==_0x46ff13?_0x186ff9['SR_DE_FISH_ARCSPHERE_VERTICAL_WALL']:_0x186ff9['SR_DE_FISH_ORIGINAL'];case _0x240c92:return _0x54a990==_0x46ff13?_0x186ff9['SR_DE_FISH_PTZ_FLOOR']:_0x4e5968==_0x46ff13?_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_360']:_0x2cb8a2==_0x46ff13?_0x186ff9['SR_DE_FISH_PANORAMA_FLOOR_180']:_0x30e952==_0x46ff13?_0x186ff9['SR_DE_FISH_PANORAMA_WALL']:_0x1837a3==_0x46ff13?_0x186ff9['SR_DE_FISH_SEMISPHERE']:_0x20b7ae==_0x46ff13?_0x186ff9['SR_DE_FISH_CYLINDER_FLOOR']:_0x443c47==_0x46ff13?_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_FLOOR']:_0x30ecd9==_0x46ff13?_0x186ff9['SR_DE_FISH_PLANET']:_0x186ff9['SR_DE_FISH_ORIGINAL'];case _0x1e68ea:return _0x54a990==_0x46ff13?_0x186ff9['SR_DE_FISH_PTZ_CEILING']:_0x4e5968==_0x46ff13?_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_360']:_0x2cb8a2==_0x46ff13?_0x186ff9['SR_DE_FISH_PANORAMA_CEILING_180']:_0x30e952==_0x46ff13?_0x186ff9['SR_DE_FISH_PANORAMA_WALL']:_0x1837a3==_0x46ff13?_0x186ff9['SR_DE_FISH_SEMISPHERE']:_0x20b7ae==_0x46ff13?_0x186ff9['SR_DE_FISH_CYLINDER_CEILING']:_0x443c47==_0x46ff13?_0x186ff9['SR_DE_FISH_CYLINDER_SPLIT_CEILING']:_0x30ecd9==_0x46ff13?_0x186ff9['SR_DE_FISH_PLANET']:_0x186ff9['SR_DE_FISH_ORIGINAL'];default:return _0x186ff9['SR_DE_FISH_ORIGINAL'];}return _0x186ff9['SR_DE_FISH_ORIGINAL'];}},{'key':'GetCanvasData','value':function(_0x168b52){var _0x4cbc60={'nWidth':0x0,'nHeight':0x0,'nBufferLen':0x0},_0x2f0ef5=this['oVideoHandle']['SR_GetCaptureSize'](_0x4cbc60);(_0xa87ede!=_0x2f0ef5||_0x4cbc60['nBufferLen']<=0x0)&&_0x168b52(null);var _0x58ab1e=new Uint8Array(_0x4cbc60['nBufferLen']);null==_0x58ab1e&&_0x168b52(null);var _0x40363f={};_0x40363f['pBuffer']=_0x58ab1e,this['oVideoHandle']['SR_CaptureScreen'](_0x40363f),_0x168b52(_0x58ab1e,_0x4cbc60['nWidth'],_0x4cbc60['nHeight']);}},{'key':'FindIntelNodefromList','value':function(_0xff0932){if(0x0!=this['privateLinesInfo']['length']){var _0x11e4ab=this['privateLinesInfo'][0x0]['absTimeStamp'];if(_0x11e4ab<=_0xff0932+0x64&&_0x11e4ab>_0xff0932-0x64)this['curLinesInfo']=this['privateLinesInfo']['shift']();else{if(_0x11e4ab>_0xff0932+0x7d0||_0x11e4ab<_0xff0932-0x7d0)for(this['curLinesInfo']=this['privateLinesInfo']['shift']();this['privateLinesInfo']['length']>0x0;){var _0x2d684a=this['privateLinesInfo'][0x0]['absTimeStamp'];if(!(_0x2d684a>_0xff0932+0x7d0||_0x2d684a<_0xff0932-0x7d0))break;this['curLinesInfo']=this['privateLinesInfo']['shift']();}}}if(0x0!=this['privateFontsInfo']['length']){var _0x588728=this['privateFontsInfo'][0x0]['absTimeStamp'];if(_0x588728<=_0xff0932+0x3e8&&_0x588728>_0xff0932-0x3e8)this['curFontsInfo']=this['privateFontsInfo']['shift']();else{if(_0x588728>_0xff0932+0x7d0||_0x588728<_0xff0932-0x7d0)for(this['curFontsInfo']=this['privateFontsInfo']['shift']();this['privateFontsInfo']['length']>0x0;){var _0xe2c5d7=this['privateFontsInfo'][0x0]['absTimeStamp'];if(!(_0xe2c5d7>_0xff0932+0x7d0||_0xe2c5d7<_0xff0932-0x7d0))break;this['curFontsInfo']=this['privateFontsInfo']['shift']();}}}if(0x0!=this['privateImageInfo']['length']){var _0x258d83=this['privateImageInfo'][0x0]['absTimeStamp'];if(_0x258d83<=_0xff0932+0x3e8&&_0x258d83>_0xff0932-0x3e8)this['curImagesInfo']=this['privateImageInfo']['shift']();else{if(_0x258d83>_0xff0932+0x7d0||_0x258d83<_0xff0932-0x7d0)for(this['curImagesInfo']=this['privateImageInfo']['shift']();this['privateImageInfo']['length']>0x0;){var _0x5a81bc=this['privateImageInfo'][0x0]['absTimeStamp'];if(!(_0x5a81bc>_0xff0932+0x7d0||_0x5a81bc<_0xff0932-0x7d0))break;this['curImagesInfo']=this['privateImageInfo']['shift']();}}}return 0x1;}},{'key':'RenderPrivateData','value':function(_0x1231e6){return 0x0!=this['privateLinesInfo']['length']||_0x1231e6||(this['curLinesInfo']=null),0x1;}},{'key':'InputPrivateInfo','value':function(_0x4714d3,_0x175777,_0x56d599){var _0x1f7229=!0x1,_0x186733=0x0;if(_0x4714d3['linesNum']>0x0){if(_0x4714d3['absTimeStamp']<=this['maxPrivateLineTimeStamp']){var _0x1673f8=0x0;for(_0x1673f8=0x0;_0x1673f8<this['privateLinesInfo']['length'];_0x1673f8++)if(this['privateLinesInfo'][_0x1673f8]['absTimeStamp']==_0x4714d3['absTimeStamp']){_0x1f7229=!0x0,_0x186733=_0x1673f8;break;}}if(_0x1f7229){var _0x2798dd=this['privateLinesInfo'][_0x186733]['linesNum'];this['privateLinesInfo'][_0x186733]['linesNum']=_0x2798dd+_0x4714d3['linesNum'];for(var _0x271036=0x0;_0x271036<_0x4714d3['linesNum'];_0x271036++){this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]={},this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['vertex_num']=_0x4714d3['stDrawLinesArray'][_0x271036]['vertex_num'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['lineWidth']=_0x4714d3['stDrawLinesArray'][_0x271036]['lineWidth'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['bFill']=_0x4714d3['stDrawLinesArray'][_0x271036]['bFill'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['bLoop']=_0x4714d3['stDrawLinesArray'][_0x271036]['bLoop'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['color']={},this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['color']['R']=_0x4714d3['stDrawLinesArray'][_0x271036]['color']['R'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['color']['G']=_0x4714d3['stDrawLinesArray'][_0x271036]['color']['G'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['color']['B']=_0x4714d3['stDrawLinesArray'][_0x271036]['color']['B'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['color']['A']=_0x4714d3['stDrawLinesArray'][_0x271036]['color']['A'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['stPoint']=[];for(var _0x23d852=0x0;_0x23d852<_0x4714d3['stDrawLinesArray'][_0x271036]['vertex_num'];_0x23d852++)this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['stPoint'][_0x23d852]={},this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['stPoint'][_0x23d852]['x']=_0x4714d3['stDrawLinesArray'][_0x271036]['stPoint'][_0x23d852]['x'],this['privateLinesInfo'][_0x186733]['stDrawLinesArray'][_0x271036+_0x2798dd]['stPoint'][_0x23d852]['y']=_0x4714d3['stDrawLinesArray'][_0x271036]['stPoint'][_0x23d852]['y'];}}else{this['maxPrivateLineTimeStamp']<_0x4714d3['absTimeStamp']&&(this['maxPrivateLineTimeStamp']=_0x4714d3['absTimeStamp']);var _0x134d36={};_0x134d36['linesNum']=_0x4714d3['linesNum'],_0x134d36['absTimeStamp']=_0x4714d3['absTimeStamp'],_0x134d36['stDrawLinesArray']=[];for(var _0x4bcab2=0x0;_0x4bcab2<_0x4714d3['linesNum'];_0x4bcab2++){_0x134d36['stDrawLinesArray'][_0x4bcab2]={},_0x134d36['stDrawLinesArray'][_0x4bcab2]['vertex_num']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['vertex_num'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['lineWidth']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['lineWidth'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['bFill']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['bFill'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['bLoop']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['bLoop'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['color']={},_0x134d36['stDrawLinesArray'][_0x4bcab2]['color']['R']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['color']['R'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['color']['G']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['color']['G'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['color']['B']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['color']['B'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['color']['A']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['color']['A'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['stPoint']=[];for(var _0x19e95f=0x0;_0x19e95f<_0x4714d3['stDrawLinesArray'][_0x4bcab2]['vertex_num'];_0x19e95f++)_0x134d36['stDrawLinesArray'][_0x4bcab2]['stPoint'][_0x19e95f]={},_0x134d36['stDrawLinesArray'][_0x4bcab2]['stPoint'][_0x19e95f]['x']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['stPoint'][_0x19e95f]['x'],_0x134d36['stDrawLinesArray'][_0x4bcab2]['stPoint'][_0x19e95f]['y']=_0x4714d3['stDrawLinesArray'][_0x4bcab2]['stPoint'][_0x19e95f]['y'];}this['privateLinesInfo']['push'](_0x134d36);}}if(_0x175777['nFontsNum']>0x0){if(_0x175777['absTimeStamp']<=this['maxPrivateLineTimeStamp']){var _0x5026f8=0x0;for(_0x5026f8=0x0;_0x5026f8<this['privateFontsInfo']['length'];_0x5026f8++)if(this['privateFontsInfo'][_0x5026f8]['absTimeStamp']==_0x175777['absTimeStamp']){_0x1f7229=!0x0,_0x186733=_0x5026f8;break;}}if(_0x1f7229);else{this['maxPrivateLineTimeStamp']<_0x175777['absTimeStamp']&&(this['maxPrivateLineTimeStamp']=_0x175777['absTimeStamp']);var _0x4876a6={};_0x4876a6['nFontsNum']=_0x175777['nFontsNum'],_0x4876a6['absTimeStamp']=_0x175777['absTimeStamp'],_0x4876a6['stDrawFontsArray']=[];for(var _0x52496a=0x0;_0x52496a<_0x175777['nFontsNum'];_0x52496a++)_0x4876a6['stDrawFontsArray'][_0x52496a]={},_0x4876a6['stDrawFontsArray'][_0x52496a]['nFontSizeW']=_0x175777['stDrawFontsArray'][_0x52496a]['nFontSizeW'],_0x4876a6['stDrawFontsArray'][_0x52496a]['nFontSizeH']=_0x175777['stDrawFontsArray'][_0x52496a]['nFontSizeH'],_0x4876a6['stDrawFontsArray'][_0x52496a]['color']={},_0x4876a6['stDrawFontsArray'][_0x52496a]['color']['R']=_0x175777['stDrawFontsArray'][_0x52496a]['color']['R'],_0x4876a6['stDrawFontsArray'][_0x52496a]['color']['G']=_0x175777['stDrawFontsArray'][_0x52496a]['color']['G'],_0x4876a6['stDrawFontsArray'][_0x52496a]['color']['B']=_0x175777['stDrawFontsArray'][_0x52496a]['color']['B'],_0x4876a6['stDrawFontsArray'][_0x52496a]['color']['A']=_0x175777['stDrawFontsArray'][_0x52496a]['color']['A'],_0x4876a6['stDrawFontsArray'][_0x52496a]['stPoint']={},_0x4876a6['stDrawFontsArray'][_0x52496a]['stPoint']['x']=_0x175777['stDrawFontsArray'][_0x52496a]['stPoint']['x'],_0x4876a6['stDrawFontsArray'][_0x52496a]['stPoint']['y']=_0x175777['stDrawFontsArray'][_0x52496a]['stPoint']['y'],_0x4876a6['stDrawFontsArray'][_0x52496a]['fontstring']=_0x175777['stDrawFontsArray'][_0x52496a]['fontString'];this['privateFontsInfo']['push'](_0x4876a6);}}if(_0x56d599['nPixelFormat']>0x0){if(_0x56d599['absTimeStamp']<=this['maxPrivateLineTimeStamp']){var _0x33e36e=0x0;for(_0x33e36e=0x0;_0x33e36e<this['privateImageInfo']['length'];_0x33e36e++)if(this['privateImageInfo'][_0x33e36e]['absTimeStamp']==_0x56d599['absTimeStamp']){_0x1f7229=!0x0,_0x186733=_0x33e36e;break;}}if(_0x1f7229);else{this['maxPrivateLineTimeStamp']<_0x56d599['absTimeStamp']&&(this['maxPrivateLineTimeStamp']=_0x56d599['absTimeStamp']);var _0x271b09={};_0x271b09['absTimeStamp']=_0x56d599['absTimeStamp'],_0x271b09['nWidth']=_0x56d599['nWidth'],_0x271b09['nHeight']=_0x56d599['nHeight'],_0x271b09['pstRect']={},_0x271b09['pstRect']['fTop']=_0x56d599['pstRect']['fTop'],_0x271b09['pstRect']['fBottom']=_0x56d599['pstRect']['fBottom'],_0x271b09['pstRect']['fLeft']=_0x56d599['pstRect']['fLeft'],_0x271b09['pstRect']['fRight']=_0x56d599['pstRect']['fRight'],_0x271b09['nPixelFormat']=_0x56d599['nPixelFormat'],_0x271b09['fAlpha']=_0x56d599['fAlpha'],_0x271b09['picImageData']=_0x56d599['picImageData'],this['privateImageInfo']['push'](_0x271b09);}}return 0x1;}},{'key':'WebGLDisplayCallBack','value':function(_0x273e95){if(0x0!=_0x273e95['privateLinesInfo']['length']||null!=_0x273e95['curLinesInfo']){if(null!=_0x273e95['curLinesInfo']){for(var _0x152c9d=[],_0x3b3ffc=0x0,_0x4ea37c=0x1,_0xae4f9b=0x0;_0xae4f9b<_0x273e95['curLinesInfo']['linesNum'];_0xae4f9b++){_0x152c9d[_0xae4f9b]={},_0x152c9d[_0xae4f9b]['nPointNum']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['vertex_num'],_0x152c9d[_0xae4f9b]['nLineWidth']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['lineWidth'],_0x4ea37c=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['bFill'],_0x152c9d[_0xae4f9b]['bLoop']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['bLoop'],_0x152c9d[_0xae4f9b]['pstColor']={},_0x152c9d[_0xae4f9b]['pstColor']['fR']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['color']['R'],_0x152c9d[_0xae4f9b]['pstColor']['fG']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['color']['G'],_0x152c9d[_0xae4f9b]['pstColor']['fB']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['color']['B'],_0x152c9d[_0xae4f9b]['pstColor']['fA']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['color']['A'],_0x152c9d[_0xae4f9b]['pstPoints']=[];for(var _0x19d608=0x0;_0x19d608<_0x152c9d[_0xae4f9b]['nPointNum'];_0x19d608++)_0x152c9d[_0xae4f9b]['pstPoints'][_0x19d608]={},_0x152c9d[_0xae4f9b]['pstPoints'][_0x19d608]['fX']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['stPoint'][_0x19d608]['x'],_0x152c9d[_0xae4f9b]['pstPoints'][_0x19d608]['fY']=_0x273e95['curLinesInfo']['stDrawLinesArray'][_0xae4f9b]['stPoint'][_0x19d608]['y'];_0x3b3ffc+=_0x152c9d[_0xae4f9b]['nPointNum'];}_0x273e95['oVideoHandle']['SR_DrawLinesEx'](_0x152c9d,_0x273e95['curLinesInfo']['linesNum'],_0x3b3ffc,_0x4ea37c);}_0x273e95['curLinesInfo']=null;}if((0x0!=_0x273e95['privateFontsInfo']['length']||null!=_0x273e95['curFontsInfo'])&&null!=_0x273e95['curFontsInfo']&&0x0!=_0x273e95['curFontsInfo']['nFontsNum']){for(var _0x318203=[],_0x238209=0x0;_0x238209<_0x273e95['curFontsInfo']['nFontsNum'];_0x238209++){var _0x3ac5ed={},_0x431a46=_0x273e95['curFontsInfo']['stDrawFontsArray'][_0x238209]['fontstring'],_0x3a1ba2={};_0x3a1ba2['fX']=_0x273e95['curFontsInfo']['stDrawFontsArray'][_0x238209]['stPoint']['x'],_0x3a1ba2['fY']=_0x273e95['curFontsInfo']['stDrawFontsArray'][_0x238209]['stPoint']['y'];var _0x1f2cce={'fR':0x1,'fG':0x0,'fB':0x0};_0x1f2cce['fA']=_0x273e95['curFontsInfo']['stDrawFontsArray'][_0x238209]['color']['A'];var _0x5074eb=_0x273e95['curFontsInfo']['stDrawFontsArray'][_0x238209]['nFontSizeW'],_0x441f96=_0x273e95['curFontsInfo']['stDrawFontsArray'][_0x238209]['nFontSizeH'];_0x3ac5ed['pString']=_0x431a46,_0x3ac5ed['pstStartPos']=_0x3a1ba2,_0x3ac5ed['nFontWidth']=_0x5074eb,_0x3ac5ed['nFontHeight']=_0x441f96,_0x3ac5ed['pstFontColor']=_0x1f2cce,_0x3ac5ed['bBackGround']=!0x1,_0x3ac5ed['pstBGColor']=null,_0x3ac5ed['fRotateAngle']=0x0,_0x3ac5ed['pFontFamily']='sans-serif',_0x318203['push'](_0x3ac5ed);}_0x273e95['oVideoHandle']['SR_DrawFontEx'](_0x318203,_0x273e95['curFontsInfo']['nFontsNum']);}if(0x0!=_0x273e95['privateImageInfo']['length']||null!=_0x273e95['curImagesInfo']){var _0x2481ef=null;null!=_0x273e95['curImagesInfo']&&null!=_0x273e95['curImagesInfo']&&null!=_0x273e95['curImagesInfo']['picImageData']&&null!=_0x273e95['curImagesInfo']['picImageData']&&(_0x2481ef=new Uint16Array(_0x273e95['curImagesInfo']['picImageData']['buffer'])),null!=_0x273e95['curImagesInfo']&&_0x273e95['curImagesInfo']['nPixelFormat']>0x0&&_0x273e95['oVideoHandle']['SR_DrawImage'](_0x2481ef,_0x273e95['curImagesInfo']['nWidth'],_0x273e95['curImagesInfo']['nHeight'],_0x273e95['curImagesInfo']['pstRect'],_0x273e95['curImagesInfo']['nPixelFormat'],_0x273e95['curImagesInfo']['fAlpha']);}if(0x0!==_0x273e95['pWaterFontParam']['length']&&_0x273e95['oVideoHandle']['SR_DrawFontEx'](_0x273e95['pWaterFontParam'],_0x273e95['pWaterFontParam']['length']),0x0!==_0x273e95['pWaterImageParam']['length']){_0x273e95['waterMarkImageIndex']>=_0x273e95['waterMarkImageMax']&&(_0x273e95['waterMarkImageIndex']=0x0);var _0x1b3126=_0x273e95['waterMarkImageIndex'];_0x273e95['oVideoHandle']['SR_DrawImage'](_0x273e95['pWaterImageParam'][_0x1b3126]['videoStream'],_0x273e95['pWaterImageParam'][_0x1b3126]['nImageWidth'],_0x273e95['pWaterImageParam'][_0x1b3126]['nImageHeight'],_0x273e95['pWaterImageParam'][_0x1b3126]['pstRectPos'],_0xa01ff6,_0x273e95['pWaterImageParam'][_0x1b3126]['fAlpha']),_0x273e95['waterMarkImageIndex']++;}}}]),_0x48881e;}()),_0x5111f0=(function(){function _0x231541(){_0x54580d(this,_0x231541),this['startTime']=0x0,this['curTime']=0x0,this['timeWalk']=0x0,this['lastDate']=0x0,this['preTimerStamp']=0x0;}return _0x4fd085(_0x231541,[{'key':'Init','value':function(){this['startTime']=this['GetCurTime']();}},{'key':'GetCurTime','value':function(){return this['curTime']=0x3c*new Date()['getHours']()*0x3c*0x3e8+0x3c*new Date()['getMinutes']()*0x3e8+0x3e8*new Date()['getSeconds']()+new Date()['getMilliseconds'](),this['lastDate']=new Date()['getDate'](),this['curTime'];}},{'key':'GetTimerWalk','value':function(){var _0x2e0b9c=this['GetCurTime']()-this['startTime'];return this['lastDate']!==new Date()['getDate']()&&(_0x2e0b9c+=0x18*(new Date()['getDate']()-this['lastDate'])*0x3c*0x3c*0x3e8),_0x2e0b9c;}},{'key':'timerReset','value':function(){this['startTime']=0x0,this['curTime']=0x0,this['timeWalk']=0x0,this['lastDate']=0x0,this['preTimerStamp']=0x0;}}]),_0x231541;}()),_0x436cae=(function(){function _0x2bfe2e(){var _0xc5035a=arguments['length']>0x0&&void 0x0!==arguments[0x0]?arguments[0x0]:null;_0x54580d(this,_0x2bfe2e),this['canvas']=null,this['streamOpenMode']=0x0,this['context']=null,this['oVideoDecoder']=null,this['frameBuffers']=[],this['initTimer']=!0x1,this['preTimeStamp']=0x0,this['baseTimeStamp']=0x0,this['resetTimer']=!0x0,this['RenderFrame']=this['RenderFrame']['bind'](this),this['renderCurStatus']=0x2,this['playSpeed']=0x1,this['nplaySpeed']=0x1,this['displayBuf']=0xe,this['needForward']=!0x1,this['firstFrame']=!0x0,this['LatcyTime']=0x0,this['displayFrameInfoCB']=null,this['displayFrameInfo']=[],this['curFrameInfo']={},this['curFrameInfo']['timeStamp']=0x0,this['sx']=0x0,this['sy']=0x0,this['sw']=0x0,this['sh']=0x0,this['displayRunning']=!0x1,this['oRenderTimer']=null,this['waitIFrameTimestamp']=0x0,this['curFrame']=null,this['player']=null,null!=_0xc5035a&&(this['player']=_0xc5035a),this['renderEngine']='webgl',this['oVideoRender']=null,this['FECCanvasID']='',this['oVideoRender']=new _0x4ae543();}return _0x4fd085(_0x2bfe2e,[{'key':'init','value':function(_0x2b4de0,_0x2c8a8e,_0x250db0,_0x3f5d69){this['canvas']=_0x2b4de0,this['streamOpenMode']=_0x2c8a8e,this['renderEngine']=_0x3f5d69,this['SetCurStatus'](0x2),null==this['oVideoDecoder']&&(this['oVideoDecoder']=new _0x285caf(_0x250db0,this,this['player']),null!==this['oVideoDecoder']&&this['oVideoDecoder']['initDecoder']()),this['frameBuffers']=this['oVideoDecoder']['ready_frames'],null!=this['oVideoRender']&&this['oVideoRender']['InitDisplay'](this['canvas'],this['renderEngine'],0x100),null==this['oRenderTimer']&&(this['oRenderTimer']=new _0x5111f0());}},{'key':'HardDecodeError','value':function(){return this['player']['_switchHardToSoft'](),0x1;}},{'key':'inputData','value':function(_0x2ca1dd,_0x429b37){var _0x3a0a86={};_0x3a0a86['port']=_0x429b37['port'],_0x3a0a86['codecType']=_0x429b37['codecType'],_0x3a0a86['frameType']=_0x429b37['frameType'],_0x3a0a86['frameSize']=_0x429b37['frameSize'],_0x3a0a86['width']=_0x429b37['width'],_0x3a0a86['height']=_0x429b37['height'],_0x3a0a86['timeStamp']=_0x429b37['timeStamp'],_0x3a0a86['frameRate']=_0x429b37['frameRate'],_0x3a0a86['frameNum']=_0x429b37['frameNum'],_0x3a0a86['interlace']=_0x429b37['interlace'],_0x3a0a86['streamEnd']=_0x429b37['streamEnd'],_0x3a0a86['cropLeft']=_0x429b37['cropLeft'],_0x3a0a86['cropRight']=_0x429b37['cropRight'],_0x3a0a86['cropTop']=_0x429b37['cropTop'],_0x3a0a86['cropBottom']=_0x429b37['cropBottom'],_0x3a0a86['year']=_0x429b37['year'],_0x3a0a86['month']=_0x429b37['month'],_0x3a0a86['week']=_0x429b37['week'],_0x3a0a86['day']=_0x429b37['day'],_0x3a0a86['hour']=_0x429b37['hour'],_0x3a0a86['minute']=_0x429b37['minute'],_0x3a0a86['second']=_0x429b37['second'],_0x3a0a86['milliseconds']=_0x429b37['milliseconds'],this['displayFrameInfo']['push'](_0x3a0a86),this['oVideoDecoder']['inputData'](_0x2ca1dd,_0x429b37);}},{'key':'_resetDecoder','value':function(){var _0x1b030e=this;return new Promise(function(_0x4d081d,_0x553412){_0x1b030e['oVideoDecoder']['resetDecoder']()['then'](function(){_0x1b030e['displayFrameInfo']['splice'](0x0,_0x1b030e['displayFrameInfo']['length']),_0x1b030e['curFrameInfo']={},_0x1b030e['oVideoRender']['DeInitPrivateParam'](),_0x1b030e['renderCurStatus']=0x2,_0x1b030e['player']?_0x1b030e['player']['JSPlayM4_ResetEnd']():postMessage({'function':'resetEnd'}),_0x4d081d();},function(){_0x553412();});});}},{'key':'_resetRenderTimer','value':function(){this['initTimer']=!0x1,this['preTimeStamp']=0x0,this['baseTimeStamp']=0x0,this['resetTimer']=!0x0,null!=this['oRenderTimer']&&this['oRenderTimer']['timerReset'](),this['RenderFrame']=this['RenderFrame']['bind'](this),this['renderCurStatus']=0x2,this['curTimeStamp']=0x0,this['getImageJPEG']=!0x1,this['getImageBMP']=!0x1,this['getCropImageJPEG']=!0x1,this['getCropImageBMP']=!0x1,this['displayFrameInfoCB']=null,this['displayFrameInfo']['splice'](0x0,this['displayFrameInfo']['length']),this['curFrameInfo']={};}},{'key':'_destroyPlayCtrl','value':function(){var _0x3ce15e=this;this['oVideoDecoder']['destroyDecoder']()['then'](function(){_0x3ce15e['oVideoDecoder']=null,null!=_0x3ce15e['oVideoRender']&&(_0x3ce15e['oVideoRender']['ReleaseDisplay'](),_0x3ce15e['oVideoRender']=null),_0x3ce15e['_resetRenderTimer'](),_0x3ce15e['oRenderTimer']=null,_0x3ce15e['displayRunning']=!0x1,console['log']('>>>JS\\x2002\\x20destroy\\x20oVideoDecoder/oVideoRender');},function(){console['log']('stop\\x20failed\\x20');});}},{'key':'RenderFrame','value':function(){var _0x409278=this;switch(this['renderCurStatus']){case 0x0:this['_resetRenderTimer'](),this['_resetDecoder']()['then'](function(){var _0x24c4ed=setTimeout(function(){_0x409278['RenderFrame'](),clearTimeout(_0x24c4ed);},0x1);},function(){});break;case 0x2:if(this['displayRunning'])this['chooseFrame']()['then'](function(_0x57f524){if(_0x409278['curFrame']=_0x57f524,-0x1==_0x409278['displayBuf']||0x0==_0x409278['streamOpenMode']&&0x0==_0x409278['LatcyTime'])null!=_0x409278['curFrame']&&(_0x409278['curTimeStamp']=_0x409278['curFrame']['timestamp'],_0x409278['paint'](_0x409278['curFrame'])),requestAnimationFrame(_0x409278['RenderFrame']);else{if(null!=_0x409278['curFrame']){_0x409278['initTimer']&&!_0x409278['resetTimer']||(_0x409278['oRenderTimer']['Init'](),_0x409278['initTimer']=!0x0,_0x409278['resetTimer']=!0x1,_0x409278['preTimeStamp']=_0x409278['curFrame']['timestamp'],_0x409278['baseTimeStamp']=_0x409278['curFrame']['timestamp'],0x1==_0x409278['streamOpenMode']&&(_0x409278['LatcyTime']=0x0)),_0x409278['curTimeStamp']=_0x409278['curFrame']['timestamp'];var _0x49eb0b=_0x409278['curTimeStamp']-_0x409278['preTimeStamp'],_0x30b6b7=_0x409278['curTimeStamp']-_0x409278['baseTimeStamp'];(_0x49eb0b>0x1388||_0x49eb0b<0x0||_0x30b6b7<0x0)&&(_0x409278['oRenderTimer']['Init'](),_0x409278['preTimeStamp']=_0x409278['curFrame']['timestamp'],_0x409278['baseTimeStamp']=_0x409278['curTimeStamp']);var _0x4b1144=(_0x409278['curTimeStamp']-_0x409278['baseTimeStamp']+_0x409278['LatcyTime'])/_0x409278['playSpeed']-_0x409278['oRenderTimer']['GetTimerWalk']();if(_0x4b1144<0xf&&_0x4b1144>-0xf)_0x409278['paint'](_0x409278['curFrame']),_0x409278['preTimeStamp']=_0x409278['curTimeStamp'],_0x409278['RenderFrame']();else{if(_0x4b1144<0x0)_0x409278['paint'](_0x409278['curFrame']),_0x409278['preTimeStamp']=_0x409278['curTimeStamp'],_0x409278['RenderFrame']();else var _0x263c52=setTimeout(function(){0x2==_0x409278['renderCurStatus']?(_0x409278['paint'](_0x409278['curFrame']),_0x409278['preTimeStamp']=_0x409278['curTimeStamp'],_0x409278['RenderFrame']()):_0x409278['RenderFrame'](),clearTimeout(_0x263c52);},_0x4b1144-0x5);}}else{_0x409278['playSpeed']>0x2&&0x1;var _0x1fce2d=setTimeout(function(){_0x409278['RenderFrame'](),clearTimeout(_0x1fce2d);},0x0);}}});else var _0x13bfbc=setTimeout(function(){_0x409278['RenderFrame'](),clearTimeout(_0x13bfbc);},0x5);break;case 0x3:var _0x2afd32=setTimeout(function(){_0x409278['_refresh'](),_0x409278['RenderFrame'](),clearTimeout(_0x2afd32);},0x5);break;case 0x5:if(this['needForward'])this['chooseFrame']()['then'](function(_0x4c6555){_0x409278['curFrame']=_0x4c6555;var _0x4e05c4=setTimeout(function(){null!=_0x409278['curFrame']&&(_0x409278['paint'](_0x409278['curFrame']),_0x409278['needForward']=!0x1),_0x409278['RenderFrame'](),clearTimeout(_0x4e05c4);},0x1);});else var _0x570dc5=setTimeout(function(){_0x409278['_refresh'](),_0x409278['RenderFrame'](),clearTimeout(_0x570dc5);},0x5);break;case 0x4:return void this['_destroyPlayCtrl']();default:return;}}},{'key':'paint','value':function(_0x2382b9){var _0x10ce19=this;return new Promise(function(_0x184257,_0x3369ae){if(0x4==_0x10ce19['curstatus']||null==_0x2382b9||null==_0x10ce19['oVideoRender'])_0x184257();else{_0x10ce19['waitIFrameTimestamp']===_0x2382b9['timestamp']&&(_0x10ce19['resetTimer']=!0x0);var _0x43dc93={'nCropLeft':0x0,'nCropRight':0x0,'nCropTop':0x0,'nCropBottom':0x0};_0x43dc93['nCodeWidth']=_0x2382b9['displayWidth'],_0x43dc93['nCodeHeight']=_0x2382b9['displayHeight'];var _0x420bde={'x':0x0,'y':0x0};_0x420bde['width']=_0x2382b9['displayWidth'],_0x420bde['height']=_0x2382b9['displayHeight'],_0x10ce19['oVideoRender']['DisplayFrame'](_0x2382b9,_0x2382b9['displayWidth'],_0x2382b9['displayHeight'],_0x2382b9['timestamp'],_0x43dc93,null)['then'](function(_0x4d63d0){null!==_0x10ce19['displayFrameInfoCB']&&_0x10ce19['respondFrameInfoCB'](_0x4d63d0),_0x10ce19['firstFrame']&&(null!=_0x10ce19['player']?null!=_0x10ce19['player']['FFCallBackFun']&&_0x10ce19['player']['FFCallBackFun']():postMessage({'function':'firstFrameCB','value':!0x0}),_0x10ce19['firstFrame']=!0x1),_0x184257();});}});}},{'key':'respondFrameInfoCB','value':function(_0x2eec20){if(0x0!=this['displayFrameInfo']['length']&&this['curFrameInfo']['timeStamp']!==_0x2eec20){for(var _0x5cda6c={},_0x54c3ca=0x0;_0x54c3ca<this['displayFrameInfo']['length']&&(_0x5cda6c=this['displayFrameInfo']['shift']())['timeStamp']!=_0x2eec20;_0x54c3ca++);this['curFrameInfo']['port']=_0x5cda6c['port'],this['curFrameInfo']['codecType']=_0x5cda6c['codecType'],this['curFrameInfo']['frameType']=_0x5cda6c['frameType'],this['curFrameInfo']['frameSize']=_0x5cda6c['frameSize'],this['curFrameInfo']['width']=_0x5cda6c['width'],this['curFrameInfo']['height']=_0x5cda6c['height'],this['curFrameInfo']['timeStamp']=_0x5cda6c['timeStamp'],this['curFrameInfo']['frameRate']=_0x5cda6c['frameRate'],this['curFrameInfo']['frameNum']=_0x5cda6c['frameNum'],this['curFrameInfo']['interlace']=_0x5cda6c['interlace'],this['curFrameInfo']['streamEnd']=_0x5cda6c['streamEnd'],this['curFrameInfo']['cropLeft']=_0x5cda6c['cropLeft'],this['curFrameInfo']['cropRight']=_0x5cda6c['cropRight'],this['curFrameInfo']['cropTop']=_0x5cda6c['cropTop'],this['curFrameInfo']['cropBottom']=_0x5cda6c['cropBottom'],this['curFrameInfo']['year']=_0x5cda6c['year'],this['curFrameInfo']['month']=_0x5cda6c['month'],this['curFrameInfo']['week']=_0x5cda6c['week'],this['curFrameInfo']['day']=_0x5cda6c['day'],this['curFrameInfo']['hour']=_0x5cda6c['hour'],this['curFrameInfo']['minute']=_0x5cda6c['minute'],this['curFrameInfo']['second']=_0x5cda6c['second'],this['curFrameInfo']['milliseconds']=_0x5cda6c['milliseconds'],this['displayFrameInfoCB'](this['curFrameInfo']);}}},{'key':'postImageData','value':function(_0x23da09,_0x181d56,_0x2ca6fa,_0x54b505,_0x3f5f6c){this['player']?(this['getImageJPEG']&&(this['getImageJPEG']=!0x1,this['player']['_GetImage2'](_0x23da09,_0x181d56,_0x2ca6fa,_0x54b505,'jpeg',_0x3f5f6c,0x0,0x0,0x0,0x0)),this['getImageBMP']&&(this['getImageBMP']=!0x1,this['player']['_GetImage2'](_0x23da09,_0x181d56,_0x2ca6fa,_0x54b505,'bmp',_0x3f5f6c,0x0,0x0,0x0,0x0)),this['getCropImageJPEG']&&(this['getCropImageJPEG']=!0x1,this['player']['_GetImage2'](_0x23da09,_0x181d56,_0x2ca6fa,_0x54b505,'jpeg',_0x3f5f6c,this['sx'],this['sy'],this['sw'],this['sh'])),this['getCropImageBMP']&&(this['getCropImageBMP']=!0x1,this['player']['_GetImage2'](_0x23da09,_0x181d56,_0x2ca6fa,_0x54b505,'bmp',_0x3f5f6c,this['sx'],this['sy'],this['sw'],this['sh']))):(this['getImageJPEG']&&(this['getImageJPEG']=!0x1,postMessage({'function':'imageYUV','value':_0x23da09['buffer'],'size':_0x181d56,'width':_0x2ca6fa,'height':_0x54b505,'type':'jpeg','yuvType':_0x3f5f6c,'sx':0x0,'sy':0x0,'sw':0x0,'sh':0x0},[_0x23da09['buffer']])),this['getImageBMP']&&(this['getImageBMP']=!0x1,postMessage({'function':'imageYUV','value':_0x23da09['buffer'],'size':_0x181d56,'width':_0x2ca6fa,'height':_0x54b505,'type':'bmp','yuvType':_0x3f5f6c,'sx':0x0,'sy':0x0,'sw':0x0,'sh':0x0},[_0x23da09['buffer']])),this['getCropImageJPEG']&&(this['getCropImageJPEG']=!0x1,postMessage({'function':'imageYUV','value':_0x23da09['buffer'],'size':_0x181d56,'width':_0x2ca6fa,'height':_0x54b505,'type':'jpeg','yuvType':_0x3f5f6c,'sx':this['sx'],'sy':this['sy'],'sw':this['sw'],'sh':this['sh']},[_0x23da09['buffer']])),this['getCropImageBMP']&&(this['getCropImageBMP']=!0x1,postMessage({'function':'imageYUV','value':_0x23da09['buffer'],'size':_0x181d56,'width':_0x2ca6fa,'height':_0x54b505,'type':'bmp','yuvType':_0x3f5f6c,'sx':this['sx'],'sy':this['sy'],'sw':this['sw'],'sh':this['sh']},[_0x23da09['buffer']])));}},{'key':'chooseFrame','value':function(){var _0x45f677=this;return new Promise(function(_0x318d43,_0xf2cda4){if(null==_0x45f677['oVideoRender']||null==_0x45f677['oVideoDecoder'])_0x318d43(null);else{if(_0x45f677['oVideoDecoder']['decoderObjNeedReset'])_0x45f677['oVideoDecoder']['resetDecoder']()['then'](function(){_0x45f677['oVideoDecoder']['decoderObjNeedReset']=!0x1,_0x318d43(null);},function(){_0xf2cda4();});else{var _0x333c9e=_0x45f677['oVideoDecoder']['GetFrameBufferLength']();0x1==_0x45f677['streamOpenMode']&&_0x333c9e<0x3?_0x318d43(null):_0x45f677['oVideoDecoder']['GetFrame']()['then'](function(_0x93c594){_0x318d43(_0x93c594);},function(){});}}});}},{'key':'SetDisplayRegion','value':function(_0x528461,_0x69e80a,_0x1ed1c5,_0x31af05){return null==this['oVideoRender']?0x0:(this['sx']=_0x528461,this['sy']=_0x69e80a,this['sw']=_0x1ed1c5,this['sh']=_0x31af05,this['oVideoRender']['SetDisplayRect'](_0x528461,_0x69e80a,_0x1ed1c5,_0x31af05));}},{'key':'SetCurStatus','value':function(_0x4d3bc4){return this['renderCurStatus']=_0x4d3bc4,0x1;}},{'key':'fast','value':function(){var _0x4114f6=this['_GetFastSpeed'](this['nplaySpeed']);return this['_SetPlaySpeed'](_0x4114f6);}},{'key':'slow','value':function(){var _0x424dc2=this['_GetSlowSpeed'](this['nplaySpeed']);return this['_SetPlaySpeed'](_0x424dc2);}},{'key':'Pause','value':function(_0x26d476){if(_0x26d476)this['SetCurStatus'](0x3);else{if(0x3!==this['renderCurStatus'])return-0x1;this['SetCurStatus'](0x2),this['resetTimer']=!0x0;}return 0x1;}},{'key':'_refresh','value':function(){0x0!=this['frameBuffers']['length']&&this['paint'](this['frameBuffers'][0x0]);}},{'key':'OneByOne','value':function(_0xed1311){if(_0xed1311)this['SetCurStatus'](0x5),this['needForward']=!0x0;else{if(0x5!==this['renderCurStatus'])return-0x1;this['SetCurStatus'](0x2),this['resetTimer']=!0x0,this['needForward']=!0x1,this['_SetPlaySpeed'](0x1);}return 0x1;}},{'key':'SetCanvasSize','value':function(_0x2099f6,_0x5edbf8){return null!=this['oVideoRender']&&this['oVideoRender']['SetCanvasSize'](_0x2099f6,_0x5edbf8);}},{'key':'GetCanvasSize','value':function(){return null!=this['oVideoRender']&&this['oVideoRender']['GetCanvasSize']();}},{'key':'GetPlayedTime','value':function(){return this['curTimeStamp'];}},{'key':'_SetPlaySpeed','value':function(_0x3fe8a4){switch(_0x3fe8a4){case-0x10:case-0x8:case-0x4:case-0x2:case 0x1:case 0x2:case 0x4:case 0x8:case 0x10:case 0x20:case 0x40:break;default:return-0x1;}return _0x3fe8a4===this['nplaySpeed']||(this['nplaySpeed']=_0x3fe8a4,this['playSpeed']=_0x3fe8a4>0x0?_0x3fe8a4:-0x1/_0x3fe8a4,console['log']('playSpeed:'+this['playSpeed']),this['resetTimer']=!0x0,this['needForward']=!0x1,0x2!=this['renderCurStatus']&&this['SetCurStatus'](0x2)),0x1;}},{'key':'_GetFastSpeed','value':function(_0x56131f){var _0x3a8976=0x0;switch(_0x56131f){case-0x10:_0x3a8976=-0x8;break;case-0x8:_0x3a8976=-0x4;break;case-0x4:_0x3a8976=-0x2;break;case-0x2:_0x3a8976=0x1;break;case 0x1:_0x3a8976=0x2;break;case 0x2:_0x3a8976=0x4;break;case 0x4:_0x3a8976=0x8;break;case 0x8:_0x3a8976=0x10;break;case 0x10:_0x3a8976=0x20;break;case 0x20:_0x3a8976=0x40;break;default:_0x3a8976=0x0;}return _0x3a8976;}},{'key':'_GetSlowSpeed','value':function(_0x45b3b7){var _0x3856b0=0x0;switch(_0x45b3b7){case-0x8:_0x3856b0=-0x10;break;case-0x4:_0x3856b0=-0x8;break;case-0x2:_0x3856b0=-0x4;break;case 0x1:_0x3856b0=-0x2;break;case 0x2:_0x3856b0=0x1;break;case 0x4:_0x3856b0=0x2;break;case 0x8:_0x3856b0=0x4;break;case 0x10:_0x3856b0=0x8;break;case 0x20:_0x3856b0=0x10;break;case 0x40:_0x3856b0=0x20;break;default:_0x3856b0=0x0;}return _0x3856b0;}},{'key':'SetDisplayBuf','value':function(_0x106ca3){return this['displayBuf']=_0x106ca3,this['LatcyTime']=0x1==_0x106ca3?0x0:0xf==_0x106ca3?0x2bc:0x2d==_0x106ca3?0x76c:_0x106ca3>0x6&&_0x106ca3<0x2d?0x28*_0x106ca3+0x64:-0x1==_0x106ca3?0x0:0x32,0x1;}},{'key':'GetJPEG','value':function(){var _0x250f6c=this;this['oVideoDecoder']['GetImageYUV']()['then'](function(_0x5c4ac6){var _0x204c0f=_0x5c4ac6['yuvFrameBuffer'],_0x13cae3=_0x5c4ac6['yuvLength'],_0x5692f0=_0x5c4ac6['displayWidth'],_0x138c37=_0x5c4ac6['displayHeight'],_0x2b67ff=_0x5c4ac6['yuvType'];-0x1!=_0x204c0f&&(_0x250f6c['player']?_0x250f6c['player']['_GetImage2'](_0x204c0f,_0x13cae3,_0x5692f0,_0x138c37,'jpeg',_0x2b67ff,0x0,0x0,0x0,0x0):postMessage({'function':'imageYUV','value':_0x204c0f['buffer'],'size':_0x13cae3,'width':_0x5692f0,'height':_0x138c37,'type':'jpeg','yuvType':_0x2b67ff,'sx':0x0,'sy':0x0,'sw':0x0,'sh':0x0},[_0x204c0f['buffer']]));},function(){});}},{'key':'GetBMP','value':function(){var _0x40df8b=this;this['oVideoDecoder']['GetImageYUV']()['then'](function(_0x783b6f){var _0x11b41c=_0x783b6f['yuvFrameBuffer'],_0x2648e7=_0x783b6f['yuvLength'],_0x2875d9=_0x783b6f['displayWidth'],_0x1d5f92=_0x783b6f['displayHeight'],_0x1d4ea2=_0x783b6f['yuvType'];-0x1!=_0x11b41c&&(_0x40df8b['player']?_0x40df8b['player']['_GetImage2'](_0x11b41c,_0x2648e7,_0x2875d9,_0x1d5f92,'bmp',_0x1d4ea2,0x0,0x0,0x0,0x0):postMessage({'function':'imageYUV','value':_0x11b41c['buffer'],'size':_0x2648e7,'width':_0x2875d9,'height':_0x1d5f92,'type':'bmp','yuvType':_0x1d4ea2,'sx':0x0,'sy':0x0,'sw':0x0,'sh':0x0},[_0x11b41c['buffer']]));},function(){});}},{'key':'GetCropJPEG','value':function(){var _0x19dfc0=this;this['oVideoDecoder']['GetImageYUV']()['then'](function(_0x3af1e4){var _0x2a2139=_0x3af1e4['yuvFrameBuffer'],_0x5be45e=_0x3af1e4['yuvLength'],_0x3fad91=_0x3af1e4['displayWidth'],_0x579157=_0x3af1e4['displayHeight'],_0x43e814=_0x3af1e4['yuvType'];-0x1!=_0x2a2139&&(_0x19dfc0['player']?_0x19dfc0['player']['_GetImage2'](_0x2a2139,_0x5be45e,_0x3fad91,_0x579157,'jpeg',_0x43e814,_0x19dfc0['sx'],_0x19dfc0['sy'],_0x19dfc0['sw'],_0x19dfc0['sh']):postMessage({'function':'imageYUV','value':_0x2a2139['buffer'],'size':_0x5be45e,'width':_0x3fad91,'height':_0x579157,'type':'jpeg','yuvType':_0x43e814,'sx':_0x19dfc0['sx'],'sy':_0x19dfc0['sy'],'sw':_0x19dfc0['sw'],'sh':_0x19dfc0['sh']},[_0x2a2139['buffer']]));},function(){});}},{'key':'GetCropBMP','value':function(){var _0x2e57e5=this;this['oVideoDecoder']['GetImageYUV']()['then'](function(_0x39ea05){var _0x312376=_0x39ea05['yuvFrameBuffer'],_0x1e6e7b=_0x39ea05['yuvLength'],_0x531810=_0x39ea05['displayWidth'],_0x39d2d4=_0x39ea05['displayHeight'],_0x118eb9=_0x39ea05['yuvType'];-0x1!=_0x312376&&(_0x2e57e5['player']?_0x2e57e5['player']['_GetImage2'](_0x312376,_0x1e6e7b,_0x531810,_0x39d2d4,'bmp',_0x118eb9,_0x2e57e5['sx'],_0x2e57e5['sy'],_0x2e57e5['sw'],_0x2e57e5['sh']):postMessage({'function':'imageYUV','value':_0x312376['buffer'],'size':_0x1e6e7b,'width':_0x531810,'height':_0x39d2d4,'type':'bmp','yuvType':_0x118eb9,'sx':_0x2e57e5['sx'],'sy':_0x2e57e5['sy'],'sw':_0x2e57e5['sw'],'sh':_0x2e57e5['sh']},[_0x312376['buffer']]));},function(){});}},{'key':'GetCanvasCapture','value':function(_0x5274f0){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20GetCanvasCapture','color:red'),0x0):(this['oVideoRender']['GetCanvasData'](_0x5274f0),0x1);}},{'key':'SetDecodeFrameType','value':function(_0xafe902){return this['waitIFrameTimestamp']=_0xafe902,0x1;}},{'key':'SetStreamEnd','value':function(){return this['oVideoDecoder']['SetStreamEnd'](),0x1;}},{'key':'SetAntialias','value':function(_0x4cb309){return null!=this['oVideoRender']?this['oVideoRender']['SetAntialias'](_0x4cb309):0x0;}},{'key':'SetFrameInfoCallBack','value':function(_0x193a6f,_0xfa0899){return this['displayFrameInfoCB']=_0xfa0899?_0x193a6f:null,0x1;}},{'key':'FEC_SetCanvasID','value':function(_0x5e972f){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_SetCanvasID'](_0x5e972f):(this['FECCanvasID']=_0x5e972f,0x0);}},{'key':'FEC_ResetCorrectType','value':function(_0x1c4eb6,_0x3befb7,_0x1bc68a){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_ResetCorrectType'](_0x1c4eb6,_0x3befb7,_0x1bc68a):0x0;}},{'key':'FEC_GetPort','value':function(_0x4bc99e,_0x1d761d){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),-0x1):null!=this['oVideoRender']?this['oVideoRender']['FEC_GetPort'](_0x4bc99e,_0x1d761d):-0x1;}},{'key':'FEC_Enable','value':function(_0x24c814){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_Enable'](_0x24c814):0x0;}},{'key':'FEC_SetParam','value':function(_0x4b47cc,_0x45ac68){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_SetParam'](_0x4b47cc,_0x45ac68):0x0;}},{'key':'FEC_GetParam','value':function(_0x262555,_0x597461){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_GetParam'](_0x262555,_0x597461):0x0;}},{'key':'FEC_SetViewParam','value':function(_0x1da199,_0x16b82f,_0x414559){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_SetViewParam'](_0x1da199,_0x16b82f,_0x414559):0x0;}},{'key':'FEC_GetViewParam','value':function(_0x5a0af3,_0x3a1b00,_0x59130e){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_GetViewParam'](_0x5a0af3,_0x3a1b00,_0x59130e):0x0;}},{'key':'FEC_SetWnd','value':function(_0xa8e05,_0x2eb965){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_SetWnd'](_0xa8e05,_0x2eb965):0x0;}},{'key':'FEC_Disable','value':function(_0x3906d4,_0x22cb26,_0x385acc){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_Disable'](_0x3906d4,_0x22cb26,_0x385acc):0x0;}},{'key':'FEC_DelPort','value':function(_0x1eac9f){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_DelPort'](_0x1eac9f):0x0;}},{'key':'FEC_SetDisplayRegion','value':function(_0x56017d,_0x464808,_0x52ea86,_0x5e218a,_0x40d1eb,_0x2e645c,_0x13d4de){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_SetDisplayRegion'](_0x56017d,_0x464808,_0x52ea86,_0x5e218a,_0x40d1eb,_0x2e645c,_0x13d4de):0x0;}},{'key':'FEC_SetBackCilling','value':function(_0x453651,_0x19c072){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_SetBackCilling'](_0x453651,_0x19c072):0x0;}},{'key':'FEC_GetPTZPort','value':function(_0x267004,_0x22cae9,_0x35fdab){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),-0x1):null!=this['oVideoRender']?this['oVideoRender']['FEC_GetPTZPort'](_0x267004,_0x22cae9,_0x35fdab):-0x1;}},{'key':'FEC_SetPTZDisplayMode','value':function(_0x44ab29){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20FEC\\x20correct','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['FEC_SetPTZDisplayMode'](_0x44ab29):0x0;}},{'key':'InputPrivateInfo','value':function(_0x59722d,_0x11ebaf,_0xf48ace){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20PrivateInfo','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['InputPrivateInfo'](_0x59722d,_0x11ebaf,_0xf48ace):0x1;}},{'key':'RenderPrivateData','value':function(_0x20408a){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20PrivateInfo','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['RenderPrivateData'](_0x20408a):0x1;}},{'key':'SetWaterMarkFont','value':function(_0x45d8a7){return'2d'===this['renderEngine']||'2D'===this['renderEngine']||null==this['oVideoRender']?(console['log']('%c\\x20param\\x20error\\x20this.renderEngine:%d,this.oVideoRender:%d','color:red',this['renderEngine'],this['oVideoRender']),0x0):(null!=this['oVideoRender']&&this['oVideoRender']['SetWaterMarkFont'](_0x45d8a7,{'yuvFrameBuffer':-0x1,'yuvLength':-0x1,'displayWidth':-0x1,'displayHeight':-0x1,'yuvType':-0x1}),0x1);}},{'key':'SetWaterMarkImage','value':function(_0x48982c){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20SetWaterMarkImage','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['SetWaterMarkImage'](_0x48982c):0x1;}},{'key':'SetD3DPostProcess','value':function(_0x105551,_0x2dcd9b){return'2d'===this['renderEngine']||'2D'===this['renderEngine']?(console['log']('%c\\x202D\\x20render\\x20not\\x20support\\x20SetD3DPostProcess','color:red'),0x0):null!=this['oVideoRender']?this['oVideoRender']['SetD3DPostProcess'](_0x105551,_0x2dcd9b):0x1;}}]),_0x2bfe2e;}());_0x2e6310=new _0x436cae(),self['onmessage']=function(_0x336e5d){let _0x3b3e97=_0x336e5d['data'];switch(_0x3b3e97['command']){case'init':_0x2e6310['init'](_0x3b3e97['canvas'],_0x3b3e97['streamOpenMode'],_0x3b3e97['sab'],_0x3b3e97['renderEngine']);break;case'inputData':let _0x380e6b=new Uint8Array(_0x3b3e97['rawData']),_0x590bb2=_0x3b3e97['rawDataFrameInfo'];_0x2e6310['inputData'](_0x380e6b,_0x590bb2),_0x380e6b=null;break;case'SetDisplayRegion':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),_0x2e6310['SetDisplayRegion'](_0x3b3e97['sx'],_0x3b3e97['sy'],_0x3b3e97['sw'],_0x3b3e97['sh']);break;case'stop':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),_0x2e6310['SetCurStatus'](0x4);let _0x2622f7=setInterval(()=>{_0x2e6310['displayRunning']||(_0x2e6310=null,self['postMessage']({'function':'stop'}),clearInterval(_0x2622f7),_0x2622f7=null,self['close'](),console['log']('>>>JS\\x2003\\x20destroy\\x20oVideoPlayCtrl\\x20and\\x20worker'));},0x2);break;case'fast':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),0x1!==_0x2e6310['fast']()&&self['postMessage']({'function':'paraError'});break;case'slow':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),0x1!==_0x2e6310['slow']()&&self['postMessage']({'function':'paraError'});break;case'SetDisplayBuf':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),0x1!==_0x2e6310['SetDisplayBuf'](_0x3b3e97['value'])&&self['postMessage']({'function':'paraError'});break;case'Pause':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),0x1!==_0x2e6310['Pause'](_0x3b3e97['value'])&&self['postMessage']({'function':'paraError'});break;case'OneByOne':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),0x1!==_0x2e6310['OneByOne'](_0x3b3e97['value'])&&self['postMessage']({'function':'paraError'});break;case'SetCanvasSize':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),0x1!==_0x2e6310['SetCanvasSize'](_0x3b3e97['width'],_0x3b3e97['height'])&&self['postMessage']({'function':'paraError'});break;case'GetCanvasSize':null===_0x2e6310&&self['postMessage']({'function':'OrderError'}),0x1!==_0x2e6310['GetCanvasSize']()&&self['postMessage']({'function':'paraError'});break;case'GetPlayedTime':null===_0x2e6310&&self['postMessage']({'function':'OrderError'});let _0x1b5e3d=_0x2e6310['GetPlayedTime']();0x0!==_0x1b5e3d&&self['postMessage']({'function':'GetPlayedTime','value':_0x1b5e3d});break;case'needReset':_0x2e6310['SetCurStatus'](0x0);break;case'GetJPEG':_0x2e6310['GetJPEG']();break;case'GetBMP':_0x2e6310['GetBMP']();break;case'GetCropJPEG':_0x2e6310['GetCropJPEG']();break;case'GetCropBMP':_0x2e6310['GetCropBMP']();break;case'SetDecodeFrameType':_0x2e6310['SetDecodeFrameType'](_0x3b3e97['timestamp']);break;case'streamEnd':_0x2e6310['SetStreamEnd']();break;case'SetAntialias':_0x2e6310['SetAntialias'](_0x3b3e97['value']);break;case'SetFrameInfoCallBack':_0x2e6310['SetFrameInfoCallBack'](_0x26f608=>{self['postMessage']({'function':'SetFrameInfoCallBack','curFrameInfo':_0x26f608});},_0x3b3e97['value']);break;case'FEC_SetCanvasID':_0x2e6310['FEC_SetCanvasID'](_0x3b3e97['canvasID']);break;case'FECResetCorrectType':_0x2e6310['FEC_ResetCorrectType'](_0x3b3e97['fishSubPort'],_0x3b3e97['placeType'],_0x3b3e97['correctType']);break;case'FECGetPort':let _0xc3af92=_0x2e6310['FEC_GetPort'](_0x3b3e97['placeType'],_0x3b3e97['correctType']);(_0xc3af92<0x1||_0xc3af92>0x1f||null==_0xc3af92)&&(_0xc3af92=-0x1),self['postMessage']({'function':'FECGetPort','fishSubPort':_0xc3af92});break;case'FECEnable':_0x2e6310['FEC_Enable'](_0x3b3e97['fishSubPort']);break;case'FECSetParam':_0x2e6310['FEC_SetParam'](_0x3b3e97['fishSubPort'],_0x3b3e97['param2d']);break;case'FECGetParam':let _0x28b110={};_0x2e6310['FEC_GetParam'](_0x3b3e97['fishSubPort'],_0x28b110),self['postMessage']({'function':'FECGetParam','param2d':_0x28b110});break;case'FECSetViewParam':_0x2e6310['FEC_SetViewParam'](_0x3b3e97['fishSubPort'],_0x3b3e97['upDateType'],_0x3b3e97['fValue']);break;case'FECGetViewParam':let _0x3712f4={};_0x2e6310['FEC_GetViewParam'](_0x3b3e97['fishSubPort'],_0x3b3e97['upDateType'],_0x3712f4),self['postMessage']({'function':'FECGetViewParam','Param3D':Param});break;case'FECSetWnd':_0x2e6310['FEC_SetWnd'](_0x3b3e97['fishSubPort'],_0x3b3e97['offscrrenCnv']);break;case'FECDisable':_0x2e6310['FEC_Disable'](_0x3b3e97['fishSubPort'],_0x3b3e97['clearFECCanvas'],_0x3b3e97['clearContext']);break;case'FECDelPort':_0x2e6310['FEC_DelPort'](_0x3b3e97['fishSubPort']);break;case'FECSetDisplayRegion':_0x2e6310['FEC_SetDisplayRegion'](_0x3b3e97['fishSubPort'],_0x3b3e97['type'],_0x3b3e97['regionNum'],_0x3b3e97['sx'],_0x3b3e97['sy'],_0x3b3e97['sw'],_0x3b3e97['sh']);break;case'FECSetBackCilling':_0x2e6310['FEC_SetBackCilling'](_0x3b3e97['fishSubPort'],_0x3b3e97['bValue']);break;case'FECGetPTZPort':let _0x1b036c=_0x2e6310['FEC_GetPTZPort'](_0x3b3e97['fPositionX'],_0x3b3e97['fPositionY']);(_0x1b036c<0x1||_0x1b036c>0x1f||null==_0x1b036c)&&(_0x1b036c=-0x1,console['info']('%c\\x20hardDecoderWorker\\x20FECGetPTZPort\\x20error\\x20','color:\\x20red')),self['postMessage']({'function':'FECGetPTZPort','fishSubPort':_0x1b036c});break;case'FECSetPTZDisplayMode':_0x2e6310['FEC_SetPTZDisplayMode'](_0x3b3e97['ptzMode']);break;case'RenderPrivateData':_0x2e6310['RenderPrivateData'](_0x3b3e97['bTrue']);break;case'InputPrivateInfo':_0x2e6310['InputPrivateInfo'](_0x3b3e97['linesInfo'],_0x3b3e97['fontInfo'],_0x3b3e97['ImageInfo']);break;case'GetCanvasCapture':_0x2e6310['GetCanvasCapture'](_0x3b3e97['cbFun']);break;case'SetWaterMarkFont':_0x2e6310['SetWaterMarkFont'](_0x3b3e97['fontParam']);break;case'SetWaterMarkImage':_0x2e6310['SetWaterMarkImage'](_0x3b3e97['imageParam']);break;case'SetD3DPostProcess':_0x2e6310['SetD3DPostProcess'](_0x3b3e97['ProcessType'],_0x3b3e97['ProcessValue']);}};})());","Worker",void 0,void 0)},d=function(){var e=new xe(16);return xe!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},u=function(e,t,i,n){var a,r,o,s,l,c,d,u,h,f,x,p,m,_,g,v,y,S,b,P,E,C,T,R,w=n[0],I=n[1],D=n[2],k=Math.hypot(w,I,D);return k<fe?null:(w*=k=1/k,I*=k,D*=k,a=Math.sin(i),o=1-(r=Math.cos(i)),s=t[0],l=t[1],c=t[2],d=t[3],u=t[4],h=t[5],f=t[6],x=t[7],p=t[8],m=t[9],_=t[10],g=t[11],v=w*w*o+r,y=I*w*o+D*a,S=D*w*o-I*a,b=w*I*o-D*a,P=I*I*o+r,E=D*I*o+w*a,C=w*D*o+I*a,T=I*D*o-w*a,R=D*D*o+r,e[0]=s*v+u*y+p*S,e[1]=l*v+h*y+m*S,e[2]=c*v+f*y+_*S,e[3]=d*v+x*y+g*S,e[4]=s*b+u*P+p*E,e[5]=l*b+h*P+m*E,e[6]=c*b+f*P+_*E,e[7]=d*b+x*P+g*E,e[8]=s*C+u*T+p*R,e[9]=l*C+h*T+m*R,e[10]=c*C+f*T+_*R,e[11]=d*C+x*T+g*R,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},h=function(){var e=new xe(3);return xe!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e},f=function(e,t,i){var n=new xe(3);return n[0]=e,n[1]=t,n[2]=i,n},x=function(){var e=new xe(4);return xe!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e},p=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return m(e,t);var i=Object.prototype.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)?m(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}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 r,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw r}}}},m=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n};n.r(s),n.d(s,{JSPlayCtrl:function(){return qe}});var _=1281,g=1282,v=1285,y=1287,S=1288,b=1289,P=1298,E=1302,C=256,T=512,R=768,w=1024,I=1280,D=1536,k=1792,F=2048,A=2304,M=2560,L=n(687),B=n.n(L),O=n(477),j=n.n(O),N=function(){function t(i,n,a){e(this,t),this.width=0,this.height=0,this.decoderObj=null,this.FirstFrame=!0,this.ready_frames=[],this.underflow=!0,this.sab=i,this.frameRate=30,this.needSetPreSoft=!1,this.decoderCurStatus=2,this.decoderOutSuccess=!1,this.decoderObjNeedReset=!1,this.oVideoRenderHandle=n,this.output=this.output.bind(this),this.reportError=this.reportError.bind(this),this.player=null,null!=a&&(this.player=a),this.curFrame=null}return o(t,[{key:"initDecoder",value:function(){if(null==this.decoderObj){var e={output:this.output,error:this.reportError};this.decoderObj=new VideoDecoder(e)}this.underflow&&(this.underflow=!1,setTimeout(this.oVideoRenderHandle.RenderFrame(),0),this.oVideoRenderHandle.displayRunning=!0),this.decoderCurStatus=2,this.FirstFrame=!0}},{key:"inputData",value:function(e,t){null!=this.decoderObj&&("configured"==this.decoderObj.state||this.FirstFrame)&&this.decodeProcess(e,t),t.nStreamEnd&&this.SetStreamEnd()}},{key:"concatenate",value:function(e){for(var t=0,i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];for(var r=0,o=n;r<o.length;r++)t+=o[r].length;for(var s=new e(t),l=0,c=0,d=n;c<d.length;c++){var u=d[c];s.set(u,l),l+=u.length}return s}},{key:"processData",value:function(e){for(var t=null,i=null,n=null,a=!1,r=!1,o=0,s=0;s<e.length-4;s++){if(0!=e[s]||0!=e[s+1]||0!=e[s+2]||1!=e[s+3]||103!=e[s+4]&&39!=e[s+4]||(0!=s?(r=!0,t=e.slice(s),o=s):t=e),0==e[s]&&0==e[s+1]&&0==e[s+2]&&1==e[s+3]&&(9==e[s+4]||6==e[s+4])){if(null==t)continue;null==i&&(i=e.slice(o,s),a=!0)}if(0==e[s]&&0==e[s+1]&&0==e[s+2]&&1==e[s+3]&&(101==e[s+4]||37==e[s+4])){a&&(n=e.slice(s));break}}return a?this.concatenate(Uint8Array,i,n):r?t:e}},{key:"processData1",value:function(e){return 0!=e[0]||0!=e[1]||0!=e[2]||1!=e[3]||9!=e[4]&&6!=e[4]?e:e.slice(5)}},{key:"formatVideoDecoderConfigure",value:function(e,t,i,n){var a="";if(5==t)a="hvc1.1.6.L123.00",console.log("265 hard decoder");else if(256==t){for(var r=0;r<e.length;r++)if(103===e[r]||39===e[r]){var o=e.subarray(r+1,r+4);a="avc1.";for(var s=0;s<3;s++){var l=o[s].toString(16);l.length<2&&(l="0"+l),a+=l}break}console.log("264 hard decoder")}else console.log("Support Error: hard decoder only support 264 and 265 !!!");var c={codec:a,hardwareAcceleration:"prefer-hardware",optimizeForLatency:1};return 5!=t&&this.needSetPreSoft&&(c.hardwareAcceleration="prefer-software"),c}},{key:"decodeProcess",value:function(e,t){var i=this;this.frameRate!=t.frameRate&&(this.frameRate=t.frameRate),this.width!=t.width&&(this.width=t.width),this.height!=t.height&&(this.height=t.height),t.needSetPreSoft&&(this.needSetPreSoft=t.needSetPreSoft);var n=e;if(4!=this.decoderCurStatus&&null!=this.decoderObj)if("configured"==this.decoderObj.state){var a=new EncodedVideoChunk({data:n,timestamp:t.timeStamp,type:t.isKeyFrame?"key":"delta"});this.decoderObj.decode(a),n=null,e=null,a=null,t.frameType}else if(t.isKeyFrame&&"unconfigured"==this.decoderObj.state){var r=this.formatVideoDecoderConfigure(e,t.codecType,t.width,t.height);if(""==r.codec)return-1;VideoDecoder.isConfigSupported(r).then((function(a){if(a.supported){i.decoderObj.configure(r),n=i.processData(e),i.FirstFrame=!1;var o=new EncodedVideoChunk({data:n,timestamp:t.timeStamp,type:t.isKeyFrame?"key":"delta"});i.decoderObj.decode(o),r=null,n=null,e=null}else console.log("%c4>HardDecoder ConfigSupported error,switch hard to soft","color: red"),i.oVideoRenderHandle.HardDecodeError()})).catch((function(){console.log("VideoDecoder.js isConfigSupported error switch hard to soft "),i.oVideoRenderHandle.HardDecodeError()}))}}},{key:"output",value:function(e){"configured"==this.decoderObj.state?(e.format,e.codedWidth,e.codedHeight,e.displayWidth,e.displayHeight,e.duration,e.timestamp,this.ready_frames.push(e),this.decoderOutSuccess||(this.decoderOutSuccess=!0),this.decoderObj.decodeQueueSize<=1&&(this.player?this.player.JSPlayM4_GetRawData():postMessage({function:"GetRawData"}))):e.close()}},{key:"output2",value:function(e){var t=this;e.timestamp,createImageBitmap(e).then((function(i){e.close(),t.ready_frames.push(i)}))}},{key:"reportError",value:function(e){this.decoderOutSuccess?this.decoderObjNeedReset=!0:(this.oVideoRenderHandle.HardDecodeError(),console.log("%cswitch hardVideoDecoder to softVideoDecoder","color: red"))}},{key:"destroyDecoder",value:function(){var e=this;return new Promise((function(t,i){e.clearDecoderObjBuffer().then((function(){null!=e.decoderObj&&("closed"!=e.decoderObj.state&&e.decoderObj.close(),console.log(">>>JS 01 destroy decoderObj"),e.decoderObj=null),e.decoderCurStatus=4,e.decoderOutSuccess=!1,e.FirstFrame=!0,e.underflow=!0,e.needSetPreSoft=!1,e.decoderObjNeedReset=!1,t()}),(function(){i()}))}))}},{key:"resetDecoder",value:function(){var e=this;return new Promise((function(t,i){e.destroyDecoder().then((function(){e.initDecoder(),console.log("%c reset hard decoder","color:red"),t()}),(function(){i()}))}))}},{key:"clearDecoderObjBuffer",value:function(){var e=this;return new Promise((function(t,i){for(var n=e.ready_frames.length,a=0;a<n;a++)e.ready_frames.shift().close();e.ready_frames.splice(0,e.ready_frames.length),null!=e.decoderObj&&"configured"==e.decoderObj.state&&e.decoderObj.reset(),t()}))}},{key:"SetStreamEnd",value:function(){return 0==this.decoderObj.decodeQueueSize&&0==this.ready_frames.length&&(this.decoderObj.flush(),console.log("flush")),1}},{key:"GetFrame",value:function(){var e=this;return new Promise((function(t,i){if(null!=e.curFrame){var n=e.ready_frames.shift();n.close(),n=null,e.curFrame=null}0!=e.ready_frames.length?(e.curFrame=e.ready_frames[0],t(e.curFrame)):(e.curFrame=null,t(null))}))}},{key:"GetFrameBufferLength",value:function(){return this.ready_frames.length}},{key:"GetImageYUV",value:function(){var e=this;return new Promise((function(t,i){var n=null;if(null!=e.curFrame?n=e.curFrame:0!=e.ready_frames.length&&(n=e.ready_frames[0]),null!=n){var a=n.displayWidth,r=n.displayHeight,o=a*r*3/2,s=new Uint8Array(o),l=n.format;n.copyTo(s).then((function(){console.log("2 yuvLength:"+o+",displayWidth:"+a),t({yuvFrameBuffer:s,yuvLength:o,displayWidth:a,displayHeight:r,yuvType:l})}))}else t({yuvFrameBuffer:-1,yuvLength:-1,displayWidth:-1,displayHeight:-1,yuvType:-1})}))}}]),t}(),U=2147483649,z=2147483651,H=2147483652,V=2147483653,Z=2147483658,W=2147483661,G=2147483662,Y={SR_DE_NULL:0,SR_DE_FISH_ORIGINAL:1,SR_DE_FISH_PTZ_CEILING:2,SR_DE_FISH_PTZ_FLOOR:3,SR_DE_FISH_PTZ_WALL:4,SR_DE_FISH_PANORAMA_CEILING_360:5,SR_DE_FISH_PANORAMA_CEILING_180:6,SR_DE_FISH_PANORAMA_FLOOR_360:7,SR_DE_FISH_PANORAMA_FLOOR_180:8,SR_DE_FISH_PANORAMA_WALL:9,SR_DE_FISH_SEMISPHERE:10,SR_DE_EAGLEEYE_SEMISPHERE:11,SR_DE_EAGLEEYE_PLANE:12,SR_DE_FISH_CYLINDER_CEILING:13,SR_DE_FISH_CYLINDER_FLOOR:14,SR_DE_FISH_CYLINDER_SPLIT_CEILING:15,SR_DE_FISH_CYLINDER_SPLIT_FLOOR:16,SR_DE_FISH_PLANET:17,SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL:18,SR_DE_FISH_ARCSPHERE_VERTICAL_WALL:19,SR_DE_FISH_ANIMATION_SWITCH_CEILING:20,SR_DE_FISH_ANIMATION_SWITCH_FLOOR:21,SR_DE_PANORAMA_SPHERE:22,SR_DE_PANORAMA_PLANET:23},X=256,J="\nattribute vec3 xy;\nattribute vec2 uv;\nuniform int bCapture; \n\nvarying highp vec2 v_uv;\n\nvoid main(void) {\n  if(bCapture == 1)\n  {\n    gl_Position = vec4(xy.x, -xy.y, xy.z, 1.0);\n  }\n  else\n  {\n    gl_Position = vec4(xy, 1.0);\n  }\n  v_uv = uv;\n}\n",q="\n    attribute vec3 position;\n    attribute vec4   color;\n    varying   float  pp;\n    varying   vec4  colorOut;\n    uniform int bCapture; \n\n    void main()\n    {\n        if(bCapture == 1)\n        {\n            gl_Position = vec4(position.x, -position.y, 0.0, 1.0);\n        }\n        else\n        {\n            gl_Position = vec4(position.x, position.y, 0.0, 1.0);\n        }\n        pp = position.z;\n        colorOut = color;\n    }\n",K="\n    varying  mediump float pp;\n    varying  lowp vec4  colorOut;\n    void main()\n    {\n        gl_FragColor = colorOut;\n        mediump float fx = abs(pp);\n        if (fx > 0.2)\n        { \n            gl_FragColor.a = colorOut.a*(1.25 - 1.25*fx);\n        } \n    } \n",$="\n    attribute vec4 position; \n    attribute vec4 texCoord; \n    uniform   mat4   matRotate; \n    varying vec4 pp; \n    uniform int bCapture;\n\n    void main() \n    { \n        gl_Position = position; //* matRotate; \n        if(bCapture == 1)\n        {\n           gl_Position.y =  -position.y;\n        }\n        pp = texCoord; \n    } \n",Q="\n    precision mediump float; \n    uniform sampler2D texture;\n    varying lowp vec4 pp; \n    uniform float fAlpha;\n    void main(void) \n    { \n        gl_FragColor = texture2D(texture, pp.st); \n        gl_FragColor.a *= fAlpha; \n    } \n",ee=32,te=1024,ie=.05,ne=1e-6,ae=3.1415926,re=.02,oe=1e3,se=.78539815,le=-1,ce=ae/18,de=ae/3,ue=ae/6,he=ae/9,fe=1e-6,xe="undefined"!=typeof Float32Array?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var pe,me,_e;h(),pe=new xe(4),xe!=Float32Array&&(pe[0]=0,pe[1]=0,pe[2]=0,pe[3]=0),h(),f(1,0,0),f(0,1,0),x(),x(),me=new xe(9),xe!=Float32Array&&(me[1]=0,me[2]=0,me[3]=0,me[5]=0,me[6]=0,me[7]=0),me[0]=1,me[4]=1,me[8]=1,_e=new xe(2),xe!=Float32Array&&(_e[0]=0,_e[1]=0);var ge=function(){function t(){e(this,t),this.fFov=.785,this.fAspect=1,this.fNear=.02,this.fFar=1e3,this.fTheta=0,this.fAlpha=0,this.fBeta=0,this.fScale=1,this.bOrtho=!1,this.matView=d(),this.matProj=d(),this.vecEye=f(0,0,0),this.vecCenter=f(0,0,100),this.vecUp=f(0,1,0)}return o(t,[{key:"SetYaw",value:function(e){this.fTheta=e}},{key:"GetYaw",value:function(){return this.fTheta}},{key:"SetPitch",value:function(e){this.fAlpha=e}},{key:"GetPitch",value:function(){return this.fAlpha}},{key:"SetRoll",value:function(e){this.fBeta=e}},{key:"GetRoll",value:function(){return this.fBeta}},{key:"SetScale",value:function(e){this.fScale=e}},{key:"GetScale",value:function(){return this.fScale}},{key:"SetFov",value:function(e){this.fFov=e}},{key:"SetAspect",value:function(e){this.fAspect=e}},{key:"SetNear",value:function(e){this.fNear=e}},{key:"SetFar",value:function(e){this.fFar=e}},{key:"SetOrtho",value:function(e){this.bOrtho=e}},{key:"UpdateCamera",value:function(e,t){if(!(e<=0||t<=0)){if(1==this.bOrtho)!function(e,t,i,n,a,r,o){var s=1/(t-i),l=1/(n-a),c=1/(r-o);e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+i)*s,e[13]=(a+n)*l,e[14]=(o+r)*c,e[15]=1}(this.matProj,0,e,t,0,this.fNear,this.fFar);else{var i=this.fFov/ae*180;!function(e,t,i,n,a){var r=1/Math.tan(t/2);if(e[0]=r/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&a!==1/0){var o=1/(n-a);e[10]=(a+n)*o,e[14]=2*a*n*o}else e[10]=-1,e[14]=-2*n}(this.matProj,i,e/t,this.fNear,this.fFar)}this.vecEye=f(0,0,this.fScale),this.vecCenter=f(0,0,0),this.vecUp=f(0,1,0);var n=f(1,0,0),a=f(0,1,0),r=f(0,0,1),o=d();x=o,p=this.vecEye,m=this.vecCenter,_=this.vecUp,I=p[0],D=p[1],k=p[2],F=_[0],A=_[1],M=_[2],L=m[0],B=m[1],O=m[2],Math.abs(I-L)<fe&&Math.abs(D-B)<fe&&Math.abs(k-O)<fe?((w=x)[0]=1,w[1]=0,w[2]=0,w[3]=0,w[4]=0,w[5]=1,w[6]=0,w[7]=0,w[8]=0,w[9]=0,w[10]=1,w[11]=0,w[12]=0,w[13]=0,w[14]=0,w[15]=1):(E=I-L,C=D-B,T=k-O,g=A*(T*=R=1/Math.hypot(E,C,T))-M*(C*=R),v=M*(E*=R)-F*T,y=F*C-A*E,(R=Math.hypot(g,v,y))?(g*=R=1/R,v*=R,y*=R):(g=0,v=0,y=0),S=C*y-T*v,b=T*g-E*y,P=E*v-C*g,(R=Math.hypot(S,b,P))?(S*=R=1/R,b*=R,P*=R):(S=0,b=0,P=0),x[0]=g,x[1]=S,x[2]=E,x[3]=0,x[4]=v,x[5]=b,x[6]=C,x[7]=0,x[8]=y,x[9]=P,x[10]=T,x[11]=0,x[12]=-(g*I+v*D+y*k),x[13]=-(S*I+b*D+P*k),x[14]=-(E*I+C*D+T*k),x[15]=1);var s=d(),l=d(),c=d(),h=d();u(l,s,-this.fAlpha,n),u(c,l,-this.fTheta,a),u(h,c,-this.fBeta,r),function(e,t,i){var n=t[0],a=t[1],r=t[2],o=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=t[9],f=t[10],x=t[11],p=t[12],m=t[13],_=t[14],g=t[15],v=i[0],y=i[1],S=i[2],b=i[3];e[0]=v*n+y*s+S*u+b*p,e[1]=v*a+y*l+S*h+b*m,e[2]=v*r+y*c+S*f+b*_,e[3]=v*o+y*d+S*x+b*g,v=i[4],y=i[5],S=i[6],b=i[7],e[4]=v*n+y*s+S*u+b*p,e[5]=v*a+y*l+S*h+b*m,e[6]=v*r+y*c+S*f+b*_,e[7]=v*o+y*d+S*x+b*g,v=i[8],y=i[9],S=i[10],b=i[11],e[8]=v*n+y*s+S*u+b*p,e[9]=v*a+y*l+S*h+b*m,e[10]=v*r+y*c+S*f+b*_,e[11]=v*o+y*d+S*x+b*g,v=i[12],y=i[13],S=i[14],b=i[15],e[12]=v*n+y*s+S*u+b*p,e[13]=v*a+y*l+S*h+b*m,e[14]=v*r+y*c+S*f+b*_,e[15]=v*o+y*d+S*x+b*g}(this.matView,o,h)}var x,p,m,_,g,v,y,S,b,P,E,C,T,R,w,I,D,k,F,A,M,L,B,O}},{key:"GetView",value:function(){return this.matView}},{key:"GetProj",value:function(){return this.matProj}}]),t}(),ve=function(){function t(){e(this,t),this.canvas=null,this.ctx=null,this.videoShaderProgram=0,this.vertexPosBuffer=0,this.texturePosBuffer=0,this.pFrameData=null,this.frameDisplayWidth=0,this.frameDisplayHeight=0,this.onlySupportedWebGL1=!1,this.bAntialias=!1,this.bRecreateTex=!0,this.nSurfaceTexture=[],this.nMaxPointNum=0,this.pLinePosVertices=null,this.pLineClrVertices=null,this.glLinePosBuffer=0,this.glLineClrBuffer=0,this.nLineTriangleNum=0,this.nLineShaderProgram=0,this.pFillBlockPosVertices=null,this.pFillBlockClrVertices=null,this.nMaxFillBlockTriNum=0,this.glBlockPosBuffer=0,this.glBlockClrBuffer=0,this.nBlockShaderProgram=0,this.nDrawFontWidth=0,this.nDrawFontHeight=0,this.nFontColorTexture=0,this.pFontColorBuffer=0,this.nFontShaderProgram=0,this.nFontBGNum=0,this.pstFontBGLines=[],this.nImageShaderProgram=0,this.pImagePosVertices=null,this.pImageClrVertices=null,this.glImagePosBuffer=0,this.glImageClrBuffer=0,this.nImageColorTexture=null,this.nDrawImageWidth=0,this.nDrawImageHeight=0,this.nImageColorTextures=[],this.pFishParamManager=null,this.enDisplayEffect=Y.SR_DE_NULL,this.nFECPort=le,this.bIsCapturing=!1,this.pSemiSpherePos=null,this.pSemiSphereTex=null,this.nSemiSpherePosNum=0,this.nSemiSpherePosSize=0,this.nSemiSphereTexSize=0,this.pCylinderPos=null,this.pCylinderTex=null,this.nCylinderPosNum=0,this.nCylinderPosSize=0,this.nCylinderTexSize=0,this.fCylinderHeight=0,this.fCylinderRadius=0,this.pArcSpherePos=null,this.pArcSphereTex=null,this.nArcSpherePosNum=0,this.nArcSpherePosSize=0,this.nArcSphereTexSize=0,this.fImageWidth=1,this.fImageHeight=1,this.fTexCenterX=.5,this.fTexCenterY=.5,this.fTexRadius=.5,this.b3DPort=!1,this.pCamera=null,this.fRotateX=0,this.fRotateY=0,this.fScale=0,this.fRotateLimitX=0,this.fRotateLimitY=0,this.pfuncCBIn=null,this.pfuncCBOut=null,this.pUserIn=null,this.pUserOut=null,this.bCullBack=!1,this.fSrcUseLeft=0,this.fSrcUseRight=1,this.fSrcUseTop=0,this.fSrcUseBottom=1,this.fDstUseLeft=0,this.fDstUseRight=1,this.fDstUseTop=0,this.fDstUseBottom=1,this.enPixelFormat=0,this.nTextureNum=0,this.textCanvas=null,this.textCanvasCtx=null,this.nCaptureWidth=0,this.nCaptureHeight=0,this.nCaptureRTTex=0,this.nCaptureFBO=0,this.nCaptureFBOWidth=0,this.nCaptureFBOHeight=0,this.nCaptureDepthbuffer=0,this.bCaptureResInit=!1,this.fBrightness=0,this.fHue=0,this.fSaturation=0,this.fContrast=0,this.fSharpness=0,this.nPostProc=0}return o(t,[{key:"CompileProgram",value:function(e,t){var i=this.ctx;if(null==i||null==e||null==t)return-1;var n=i.createShader(i.VERTEX_SHADER);if(i.shaderSource(n,e),i.compileShader(n),!i.getShaderParameter(n,i.COMPILE_STATUS))return console.log("Vertex shader failed to compile: "+i.getShaderInfoLog(n)),-1;var a=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(a,t),i.compileShader(a),!i.getShaderParameter(a,i.COMPILE_STATUS))return console.log("Fragment shader failed to compile: "+i.getShaderInfoLog(a)),-1;var r=i.createProgram();return i.attachShader(r,n),i.attachShader(r,a),i.linkProgram(r),i.getProgramParameter(r,i.LINK_STATUS)?(i.deleteShader(n),i.deleteShader(a),r):(console.log("Program failed to compile: "+i.getProgramInfoLog(r)),-1)}},{key:"SR_Init",value:function(e,t){if(null==e)return V;if(this.canvas=e,this.ctx=this.canvas.getContext("webgl2"),this.ctx||(this.ctx=this.canvas.getContext("webgl")||this.canvas.getContext("experimental-webgl"),this.onlySupportedWebGL1=!0,console.log("only support webgl1")),!this.ctx)return console.log("your browser does not support WebGL"),G;if(2==t||6==t)return U;switch(t){case 1:case 3:this.nTextureNum=3;break;case 2:case 6:this.nTextureNum=2;break;case X:this.nTextureNum=1;break;default:return U}return this.enPixelFormat=t,1}},{key:"SR_Draw",value:function(e,t,i,n,a){if(null==this.ctx)return H;var r=this.nTextureNum;if(null==e||t<=0||i<=0)return V;if(0==this.videoShaderProgram||0==this.vertexPosBuffer||0==this.texturePosBuffer)return H;var o=1;if(X==this.enPixelFormat)this.frameDisplayWidth=t,this.frameDisplayHeight=i;else if(1!=(o=this._ResizeFrameData(e,t,i,n)))return o;if(this.ctx.useProgram(this.videoShaderProgram),1==this.bRecreateTex){if(this.enPixelFormat==X){if(0!=this.nSurfaceTexture[0]){var s=this.nSurfaceTexture[0];this.ctx.deleteTexture(s),this.nSurfaceTexture[0]=0}var l=this.ctx.createTexture();if(l<=0)return W;this.ctx.bindTexture(this.ctx.TEXTURE_2D,l),1==this.bAntialias?this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR_MIPMAP_NEAREST):this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE),this.nSurfaceTexture[0]=l}else if(1==this.enPixelFormat||3==this.enPixelFormat)for(var c=0;c<r;c++){if(0!=this.nSurfaceTexture[c]){var d=this.nSurfaceTexture[c];this.ctx.deleteTexture(d),this.nSurfaceTexture[c]=0}var u=this.ctx.createTexture();if(u<=0)return W;if(this.ctx.bindTexture(this.ctx.TEXTURE_2D,u),1==this.bAntialias?this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR_MIPMAP_NEAREST):this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE),0==c){var h=this.ctx.getUniformLocation(this.videoShaderProgram,"Ytexture");this.ctx.uniform1i(h,0)}else if(1==c){var f=this.ctx.getUniformLocation(this.videoShaderProgram,"Utexture");this.ctx.uniform1i(f,1)}else if(2==c){var x=this.ctx.getUniformLocation(this.videoShaderProgram,"Vtexture");this.ctx.uniform1i(x,2)}this.nSurfaceTexture[c]=u,this.ctx.bindTexture(this.ctx.TEXTURE_2D,null)}this.bRecreateTex=!1}this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.vertexPosBuffer);var p=this.ctx.getAttribLocation(this.videoShaderProgram,"xy");if(p<0)return W;this.ctx.vertexAttribPointer(p,3,this.ctx.FLOAT,!1,0,0),this.ctx.enableVertexAttribArray(p),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.texturePosBuffer);var m=this.ctx.getAttribLocation(this.videoShaderProgram,"uv");if(m<0)return W;this.ctx.vertexAttribPointer(m,2,this.ctx.FLOAT,!1,0,0),this.ctx.enableVertexAttribArray(m),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null);var _=this.enDisplayEffect,g=this.ctx.getUniformLocation(this.videoShaderProgram,"bCapture");if(g<=0)return W;this.ctx.uniform1i(g,0);var v=this.ctx.getUniformLocation(this.videoShaderProgram,"nPostProc");switch(this.ctx.uniform1i(v,this.nPostProc),1==this.nPostProc&&(o=this._SetImagePostProcess()),_){case Y.SR_DE_NULL:break;case Y.SR_DE_FISH_ORIGINAL:case Y.SR_DE_FISH_PTZ_CEILING:case Y.SR_DE_FISH_PTZ_FLOOR:case Y.SR_DE_FISH_PTZ_WALL:case Y.SR_DE_FISH_PANORAMA_CEILING_360:case Y.SR_DE_FISH_PANORAMA_CEILING_180:case Y.SR_DE_FISH_PANORAMA_FLOOR_360:case Y.SR_DE_FISH_PANORAMA_FLOOR_180:case Y.SR_DE_FISH_PANORAMA_WALL:if(null==this.pFishParamManager)return H;var y={};if(1!=(o=this.pFishParamManager.GetRenderParam(this.nFECPort,y)))return o;if(Y.SR_DE_FISH_ORIGINAL==_){var S=this.ctx.getUniformLocation(this.videoShaderProgram,"bBlack");if(S<=0)return W;this.ctx.uniform1i(S,y.bBlack);var b=this.ctx.getUniformLocation(this.videoShaderProgram,"bCut");if(b<=0)return W;this.ctx.uniform1i(b,y.bCut)}if(Y.SR_DE_FISH_PTZ_CEILING==_||Y.SR_DE_FISH_PTZ_FLOOR==_||Y.SR_DE_FISH_PTZ_WALL==_){var P=this.ctx.getUniformLocation(this.videoShaderProgram,"fHAngleCos");if(P<=0)return W;this.ctx.uniform1f(P,y.fCosH);var E=this.ctx.getUniformLocation(this.videoShaderProgram,"fHAngleSin");if(E<=0)return W;this.ctx.uniform1f(E,y.fSinH);var C=this.ctx.getUniformLocation(this.videoShaderProgram,"fVAngleCos");if(C<=0)return W;this.ctx.uniform1f(C,y.fCosV);var T=this.ctx.getUniformLocation(this.videoShaderProgram,"fVAngleSin");if(T<=0)return W;this.ctx.uniform1f(T,y.fSinV);var R=this.ctx.getUniformLocation(this.videoShaderProgram,"fZoom");if(R<=0)return W;this.ctx.uniform1f(R,y.fZoom)}if(Y.SR_DE_FISH_PANORAMA_CEILING_360==_||Y.SR_DE_FISH_PANORAMA_CEILING_180==_||Y.SR_DE_FISH_PANORAMA_FLOOR_360==_||Y.SR_DE_FISH_PANORAMA_FLOOR_180==_){var w=this.ctx.getUniformLocation(this.videoShaderProgram,"fAngle");if(w<=0)return W;this.ctx.uniform1f(w,y.fAngle)}var I=this.ctx.getUniformLocation(this.videoShaderProgram,"fRX1");if(I<=0)return W;this.ctx.uniform1f(I,y.fRXLeft);var D=this.ctx.getUniformLocation(this.videoShaderProgram,"fRX2");if(D<=0)return W;this.ctx.uniform1f(D,y.fRXRight);var k=this.ctx.getUniformLocation(this.videoShaderProgram,"fRY1");if(k<=0)return W;this.ctx.uniform1f(k,y.fRYTop);var F=this.ctx.getUniformLocation(this.videoShaderProgram,"fRY2");if(F<=0)return W;this.ctx.uniform1f(F,y.fRYBottom);break;case Y.SR_DE_FISH_SEMISPHERE:this.pCamera.SetScale(this.fScale),this.pCamera.SetPitch(3.14-this.fRotateX),this.pCamera.SetYaw(-this.fRotateY),this.pCamera.UpdateCamera(this.canvas.width,this.canvas.height);var A=this.pCamera.GetView(),M=this.pCamera.GetProj(),L=this.ctx.getUniformLocation(this.videoShaderProgram,"matView");if(L<=0)return W;this.ctx.uniformMatrix4fv(L,!1,A);var B=this.ctx.getUniformLocation(this.videoShaderProgram,"matProj");if(B<=0)return W;this.ctx.uniformMatrix4fv(B,!1,M);break;case Y.SR_DE_FISH_CYLINDER_CEILING:case Y.SR_DE_FISH_CYLINDER_FLOOR:case Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL:case Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL:this.pCamera.SetScale(this.fScale),this.pCamera.SetPitch(-this.fRotateX),this.pCamera.SetYaw(-this.fRotateY),this.pCamera.UpdateCamera(this.canvas.width,this.canvas.height);var O=this.pCamera.GetView(),j=this.pCamera.GetProj(),N=this.ctx.getUniformLocation(this.videoShaderProgram,"matView");if(N<=0)return W;this.ctx.uniformMatrix4fv(N,!1,O);var z=this.ctx.getUniformLocation(this.videoShaderProgram,"matProj");if(z<=0)return W;this.ctx.uniformMatrix4fv(z,!1,j);break;default:return U}if(this.canvas.width<=0||this.canvas.height<=0)return G;if(null!=a&&1!=(o=this.SR_SetDisplayRect(a.fx,a.fy,a.width,a.height,2)))return o;if(null!=a?this.ctx.viewport(this.canvas.width*this.fDstUseLeft,this.canvas.height*this.fDstUseTop,this.canvas.width*this.fDstUseRight,this.canvas.height*this.fDstUseBottom):(this.ctx.viewport(0,0,this.canvas.width,this.canvas.height),this.ctx.clearColor(0,0,0,1),this.ctx.clear(this.ctx.COLOR_BUFFER_BIT|this.ctx.DEPTH_BUFFER_BIT)),this.b3DPort&&(this.ctx.enable(this.ctx.DEPTH_TEST),this.ctx.depthFunc(this.ctx.LESS),this.ctx.depthMask(!0),1==this.bCullBack?this.ctx.enable(this.ctx.CULL_FACE):this.ctx.disable(this.ctx.CULL_FACE)),this.enPixelFormat==X)this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[0]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,t,i,0,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,e),1==this.bAntialias&&this.ctx.generateMipmap(this.ctx.TEXTURE_2D);else if(1==this.enPixelFormat){var Z=this.pFrameData.subarray(0,t*i);this.ctx.activeTexture(this.ctx.TEXTURE0),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[0]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,t,i,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,Z);var J=this.pFrameData.subarray(t*i+t/2*i/2,t*i+t/2*i/2+t/2*i/2);this.ctx.activeTexture(this.ctx.TEXTURE1),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[1]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,t/2,i/2,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,J);var q=this.pFrameData.subarray(t*i,t*i+t/2*i/2);this.ctx.activeTexture(this.ctx.TEXTURE2),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[2]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,t/2,i/2,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,q),1==this.bAntialias&&this.ctx.generateMipmap(this.ctx.TEXTURE_2D),Z=null,J=null,q=null}else 3==this.enPixelFormat&&(Z=this.pFrameData.subarray(0,t*i),this.ctx.activeTexture(this.ctx.TEXTURE0),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[0]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,t,i,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,Z),J=this.pFrameData.subarray(t*i,t*i+t/2*i/2),this.ctx.activeTexture(this.ctx.TEXTURE1),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[1]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,t/2,i/2,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,J),q=this.pFrameData.subarray(t*i+t/2*i/2,t*i+t/2*i/2+t/2*i/2),this.ctx.activeTexture(this.ctx.TEXTURE2),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[2]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,t/2,i/2,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,q),1==this.bAntialias&&this.ctx.generateMipmap(this.ctx.TEXTURE_2D),Z=null,J=null,q=null);if(this.onlySupportedWebGL1||this.ctx.clearBufferfi(this.ctx.DEPTH_STENCIL,0,1,0),0==this.b3DPort)this.ctx.drawArrays(this.ctx.TRIANGLE_FAN,0,4);else if(this.enDisplayEffect==Y.SR_DE_FISH_SEMISPHERE){if(this.nSemiSpherePosNum<=0)return H;this.ctx.drawArrays(this.ctx.TRIANGLES,0,this.nSemiSpherePosNum)}else if(this.enDisplayEffect==Y.SR_DE_FISH_CYLINDER_CEILING||this.enDisplayEffect==Y.SR_DE_FISH_CYLINDER_FLOOR){if(this.nCylinderPosNum<=0)return H;this.ctx.drawArrays(this.ctx.TRIANGLES,0,this.nCylinderPosNum)}else if(this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL||this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL){if(this.nArcSpherePosNum<=0)return H;this.ctx.drawArrays(this.ctx.TRIANGLES,0,this.nArcSpherePosNum)}if(this.ctx.useProgram(null),null!=this.pFishParamManager){var K=this.pFishParamManager.GetWndPort();K!=le&&K==this.nFECPort&&this.DrawPTZLines()}return null!=this.pfuncCBIn&&this.pfuncCBIn(this.pUserIn),null!=this.pfuncCBOut&&this.pfuncCBOut(this.pUserOut),1}},{key:"DrawPTZLines",value:function(){if(null==this.pFishParamManager)return H;var e=this.pFishParamManager.GetPTZDisplayMode();if(2==e||1==e)for(var t=0,i={fR:0,fG:0,fB:0,fA:0},n=0;n<ee;++n)if(0!=this.pFishParamManager.IsPortAllocated(n)&&(t=2,1==this.pFishParamManager.GetPTZColor(n,i))){1==this.pFishParamManager.IsPTZSelected(n)&&(t+=1);var a=this.pFishParamManager.GetWndPort();if(n!=a&&2==e)if(Y.SR_DE_FISH_ORIGINAL==this.pFishParamManager.GetDisplayEffect(a)){var r={};if(1!=this.pFishParamManager.GetPTZPoints(n,r,2))continue;if(null!=r.pstPoints&&0!=r.nPointNum&&1!=this.SR_DrawLines(r.pstPoints,r.nPointNum,!0,i,t,!1))continue}else{var o;if((o=this.pFishParamManager.GetPTZFragmentNum(n))<=0)continue;for(var s=0;s<o;s++){var l={};this.pFishParamManager.GetPTZFragmentPoints(n,l,s),null!=l.pstPoints&&0!=l.nPointNum&&this.SR_DrawLines(l.pstPoints,l.nPointNum,!1,i,t,!1)}}else if(n!=a&&1==e){var c={};if(1!=this.pFishParamManager.GetPTZPoints(n,c,1))continue;if(null!=c.pstPoints&&0!=c.nPointNum&&1!=this.SR_DrawLines(c.pstPoints,c.nPointNum,!0,i,t,!1))continue}}return 1}},{key:"DrawFillBlock",value:function(e,t,i){if(null==this.ctx)return H;if(null==e||t<1||i<2)return V;for(var n=0,a=0;a<t;++a){if(null==e[a].pstPoints||e[a].nPointNum<3||!0!==e[a].bLoop||null==e[a].pstColor)return V;n+=e[a].nPointNum}if(n!==i)return V;var r=i-2*t;if(r>this.nMaxFillBlockTriNum&&(this.pFillBlockPosVertices=null,this.pFillBlockClrVertices=null,this.nMaxFillBlockTriNum=r),0==this.glBlockPosBuffer&&(this.glBlockPosBuffer=this.ctx.createBuffer(),0==this.glBlockPosBuffer))return W;if(0==this.glBlockClrBuffer&&(this.glBlockClrBuffer=this.ctx.createBuffer(),0==this.glBlockClrBuffer))return W;if(null==this.pFillBlockPosVertices){var o=this.nMaxFillBlockTriNum;if(this.pFillBlockPosVertices=new Float32Array(3*o*3),null==this.pFillBlockPosVertices)return z}if(this.pFillBlockPosVertices.fill(0),null==this.pFillBlockClrVertices){var s=this.nMaxFillBlockTriNum;if(this.pFillBlockClrVertices=new Float32Array(4*s*3),null==this.pFillBlockClrVertices)return z}this.pFillBlockClrVertices.fill(0);for(var l=0,c=0,d=0,u=null,h=null,f={},x={},p={},m=0;m<t;++m){d=e[m].nPointNum,u=e[m].pstPoints,h=e[m].pstColor,f.fX=(u[0].fX-this.fSrcUseLeft)/(this.fSrcUseRight-this.fSrcUseLeft),f.fX=this.fDstUseLeft+f.fX*(this.fDstUseRight-this.fDstUseLeft),f.fX=2*f.fX-1,f.fY=(u[0].fY-this.fSrcUseTop)/(this.fSrcUseBottom-this.fSrcUseTop),f.fY=this.fDstUseTop+f.fY*(this.fDstUseBottom-this.fDstUseTop),f.fY=1-2*f.fY;for(var _=1;_<d-1;_++)x.fX=(u[_].fX-this.fSrcUseLeft)/(this.fSrcUseRight-this.fSrcUseLeft),x.fX=this.fDstUseLeft+x.fX*(this.fDstUseRight-this.fDstUseLeft),x.fX=2*x.fX-1,x.fY=(u[_].fY-this.fSrcUseTop)/(this.fSrcUseBottom-this.fSrcUseTop),x.fY=this.fDstUseTop+x.fY*(this.fDstUseBottom-this.fDstUseTop),x.fY=1-2*x.fY,p.fX=(u[_+1].fX-this.fSrcUseLeft)/(this.fSrcUseRight-this.fSrcUseLeft),p.fX=this.fDstUseLeft+p.fX*(this.fDstUseRight-this.fDstUseLeft),p.fX=2*p.fX-1,p.fY=(u[_+1].fY-this.fSrcUseTop)/(this.fSrcUseBottom-this.fSrcUseTop),p.fY=this.fDstUseTop+p.fY*(this.fDstUseBottom-this.fDstUseTop),p.fY=1-2*p.fY,this.pFillBlockPosVertices[l++]=f.fX,this.pFillBlockPosVertices[l++]=f.fY,this.pFillBlockPosVertices[l++]=0,this.pFillBlockClrVertices[c++]=h.fR,this.pFillBlockClrVertices[c++]=h.fG,this.pFillBlockClrVertices[c++]=h.fB,this.pFillBlockClrVertices[c++]=h.fA,this.pFillBlockPosVertices[l++]=x.fX,this.pFillBlockPosVertices[l++]=x.fY,this.pFillBlockPosVertices[l++]=0,this.pFillBlockClrVertices[c++]=h.fR,this.pFillBlockClrVertices[c++]=h.fG,this.pFillBlockClrVertices[c++]=h.fB,this.pFillBlockClrVertices[c++]=h.fA,this.pFillBlockPosVertices[l++]=p.fX,this.pFillBlockPosVertices[l++]=p.fY,this.pFillBlockPosVertices[l++]=0,this.pFillBlockClrVertices[c++]=h.fR,this.pFillBlockClrVertices[c++]=h.fG,this.pFillBlockClrVertices[c++]=h.fB,this.pFillBlockClrVertices[c++]=h.fA}if(0==this.nBlockShaderProgram&&(this.nBlockShaderProgram=this.CompileProgram(q,K),this.nBlockShaderProgram<=0))return W;this.ctx.enable(this.ctx.BLEND),this.ctx.blendFunc(this.ctx.SRC_ALPHA,this.ctx.ONE_MINUS_SRC_ALPHA),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.glBlockPosBuffer),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,this.pFillBlockPosVertices,this.ctx.STATIC_DRAW),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.glBlockClrBuffer),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,this.pFillBlockClrVertices,this.ctx.STATIC_DRAW),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),this.ctx.useProgram(this.nBlockShaderProgram);var g=this.ctx.getUniformLocation(this.nLineShaderProgram,"bCapture");if(g<=0)return W;1==this.bIsCapturing?this.ctx.uniform1i(g,1):this.ctx.uniform1i(g,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.glBlockPosBuffer);var v=this.ctx.getAttribLocation(this.nBlockShaderProgram,"position");this.ctx.enableVertexAttribArray(v),this.ctx.vertexAttribPointer(v,3,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.glBlockClrBuffer);var y=this.ctx.getAttribLocation(this.nBlockShaderProgram,"color");return this.ctx.enableVertexAttribArray(y),this.ctx.vertexAttribPointer(y,4,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),this.ctx.drawArrays(this.ctx.TRIANGLES,0,3*r),this.ctx.useProgram(null),this.ctx.disable(this.ctx.BLEND),1}},{key:"ComputeLinePoint",value:function(e,t){if(null==e||t<1)return V;if(null==this.pLinePosVertices||null==this.pLineClrVertices)return H;var i=0,n=0;1==this.bIsCapturing?(i=(this.fDstUseRight-this.fDstUseLeft)*this.nCaptureWidth,n=(this.fDstUseBottom-this.fDstUseTop)*this.nCaptureHeight):(i=(this.fDstUseRight-this.fDstUseLeft)*this.canvas.width,n=(this.fDstUseBottom-this.fDstUseTop)*this.canvas.height);for(var a=0,r=0,o=0,s=0,l=0,c=0,d=0,u=0,h=0,f=0,x=0,p=0;p<t;++p){var m=[];if(!((x=e[p].nPointNum)<=0)){for(var _=0;_<x;++_){var g={};g.fX=(e[p].pstPoints[_].fX-this.fSrcUseLeft)/(this.fSrcUseRight-this.fSrcUseLeft),g.fX=this.fDstUseLeft+g.fX*(this.fDstUseRight-this.fDstUseLeft),g.fX=2*g.fX-1,g.fY=(e[p].pstPoints[_].fY-this.fSrcUseTop)/(this.fSrcUseBottom-this.fSrcUseTop),g.fY=this.fDstUseTop+g.fY*(this.fDstUseBottom-this.fDstUseTop),g.fY=1-2*g.fY,m.push(g)}if(this.canvas.width<=0||this.canvas.height<=0)return G;if(c=3.5*e[p].nLineWidth/i,d=3.5*e[p].nLineWidth/n,c<=0||d<=0)return V;var v=e[p].pstColor;if(null==v||null==v)return V;for(var y=0;y<x-1;++y)r=m[y+1].fX-m[y].fX,o=m[y+1].fY-m[y].fY,a=Math.sqrt(r*r+o*o),Math.abs(a-0)<1e-6||(s=-c*o/a/2,l=d*r/a/2,this.pLinePosVertices[h++]=m[y].fX+s,this.pLinePosVertices[h++]=m[y].fY+l,this.pLinePosVertices[h++]=-1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[y+1].fX-s,this.pLinePosVertices[h++]=m[y+1].fY-l,this.pLinePosVertices[h++]=1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[y].fX-s,this.pLinePosVertices[h++]=m[y].fY-l,this.pLinePosVertices[h++]=1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[y].fX+s,this.pLinePosVertices[h++]=m[y].fY+l,this.pLinePosVertices[h++]=-1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[y+1].fX+s,this.pLinePosVertices[h++]=m[y+1].fY+l,this.pLinePosVertices[h++]=-1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[y+1].fX-s,this.pLinePosVertices[h++]=m[y+1].fY-l,this.pLinePosVertices[h++]=1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,u+=2);1==e[p].bLoop&&2<x&&(r=m[x-1].fX-m[0].fX,o=m[x-1].fY-m[0].fY,a=Math.sqrt(r*r+o*o),Math.abs(a-0)>1e-6&&(s=-c*o/a/2,l=d*r/a/2,this.pLinePosVertices[h++]=m[0].fX+s,this.pLinePosVertices[h++]=m[0].fY+l,this.pLinePosVertices[h++]=-1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[x-1].fX-s,this.pLinePosVertices[h++]=m[x-1].fY-l,this.pLinePosVertices[h++]=1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[0].fX-s,this.pLinePosVertices[h++]=m[0].fY-l,this.pLinePosVertices[h++]=1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[0].fX+s,this.pLinePosVertices[h++]=m[0].fY+l,this.pLinePosVertices[h++]=-1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[x-1].fX+s,this.pLinePosVertices[h++]=m[x-1].fY+l,this.pLinePosVertices[h++]=-1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,this.pLinePosVertices[h++]=m[x-1].fX-s,this.pLinePosVertices[h++]=m[x-1].fY-l,this.pLinePosVertices[h++]=1,this.pLineClrVertices[f++]=v.fR,this.pLineClrVertices[f++]=v.fG,this.pLineClrVertices[f++]=v.fB,this.pLineClrVertices[f++]=v.fA,u+=2))}}return 0==u?V:(this.nLineTriangleNum=u,1)}},{key:"SR_DrawLines",value:function(e,t,i,n,a,r){var o=[],s={};return s.pstPoints=e,s.nPointNum=t,s.bLoop=i,s.pstColor=n,s.nLineWidth=a,o.push(s),this.SR_DrawLinesEx(o,1,t,r)}},{key:"SR_DrawLinesEx",value:function(e,t,i,n){if(null==this.ctx)return H;if(null==e||t<1||i<2)return V;if(0==this.nLineShaderProgram){var a=this.CompileProgram(q,K);if(a<=0)return W;this.nLineShaderProgram=a}if(1==n)return this.DrawFillBlock(e,t,i);for(var r=0,o=0;o<t;++o){if(null==e[o].pstPoints||e[o].nPointNum<=1||e[o].nPointNum>=1024||e[o].nLineWidth<=0||null==e[o].pstColor)return V;r+=e[o].nPointNum}if(r!=i)return V;if((r+=t)>this.nMaxPointNum&&(this.nMaxPointNum=r,this.pLinePosVertices=null,this.pLineClrVertices=null),null==this.pLinePosVertices&&(this.pLinePosVertices=new Float32Array(6*this.nMaxPointNum*3),null==this.pLinePosVertices))return z;if(this.pLinePosVertices.fill(0),null==this.pLineClrVertices&&(this.pLineClrVertices=new Float32Array(6*this.nMaxPointNum*4),null==this.pLineClrVertices))return z;if(this.pLineClrVertices.fill(0),0==this.glLinePosBuffer&&(this.glLinePosBuffer=this.ctx.createBuffer(),0==this.glLinePosBuffer))return W;if(0==this.glLineClrBuffer&&(this.glLineClrBuffer=this.ctx.createBuffer(),0==this.glLineClrBuffer))return W;var s=this.ComputeLinePoint(e,t);if(1!=s)return s;this.ctx.enable(this.ctx.BLEND),this.ctx.blendFunc(this.ctx.SRC_ALPHA,this.ctx.ONE_MINUS_SRC_ALPHA);var l=this.nLineShaderProgram;this.ctx.useProgram(l);var c=this.ctx.getUniformLocation(this.nLineShaderProgram,"bCapture");if(c<=0)return W;1==this.bIsCapturing?this.ctx.uniform1i(c,1):this.ctx.uniform1i(c,0);var d=this.glLinePosBuffer,u=this.glLineClrBuffer,h=this.nLineTriangleNum,f=this.pLinePosVertices,x=this.pLineClrVertices;this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,d),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,f,this.ctx.STATIC_DRAW);var p=this.ctx.getAttribLocation(l,"position");this.ctx.enableVertexAttribArray(p),this.ctx.vertexAttribPointer(p,3,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,u),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,x,this.ctx.STATIC_DRAW);var m=this.ctx.getAttribLocation(l,"color");return this.ctx.enableVertexAttribArray(m),this.ctx.vertexAttribPointer(m,4,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),1==this.bIsCapturing?this.ctx.viewport(0,0,this.nCaptureWidth,this.nCaptureHeight):this.ctx.viewport(0,0,this.canvas.width,this.canvas.height),this.ctx.drawArrays(this.ctx.TRIANGLES,0,3*h),this.ctx.useProgram(null),this.ctx.disable(this.ctx.BLEND),1}},{key:"SR_DrawFont",value:function(e,t,i,n,a,r,o,s,l,c,d){if(null==e||null==t||null==i||n<=1||a<=1)return V;if(1==r&&null==o)return V;var u=[],h={};return h.bBackground=r,h.nFontWidth=n,h.nFontHeight=a,h.pstBGColor=o,h.pstFontColor=i,h.pString=e,h.pstStartPos=t,h.fRotateAngle=s,h.pFontFamily=l,h.textAlign=c,h.textBaseline=d,u.push(h),this.SR_DrawFontEx(u,1)}},{key:"SR_DrawFontEx",value:function(e,t){if(null==this.ctx)return H;if(0>t||null==e)return V;var i,n,a=0,r=0;if(1==this.bIsCapturing){if(0==this.nCaptureWidth||0==this.nCaptureHeight)return H;a=Math.round((this.fDstUseRight-this.fDstUseLeft)*this.nCaptureWidth),r=Math.round((this.fDstUseBottom-this.fDstUseTop)*this.nCaptureHeight)}else a=Math.round((this.fDstUseRight-this.fDstUseLeft)*this.canvas.width),r=Math.round((this.fDstUseBottom-this.fDstUseTop)*this.canvas.height);if(a=a+4-a%4,r=r+4-r%4,this.nDrawFontWidth==a&&this.nDrawFontHeight==r||(this.pFontColorBuffer=null,this.nFontColorTexture=0,this.nDrawFontWidth=a,this.nDrawFontHeight=r,null!=this.textCanvas&&(this.textCanvas.remove(),this.textCanvas=null,this.textCanvasCtx=null)),0==this.nFontColorTexture){if(this.nFontColorTexture=this.ctx.createTexture(),0==this.nFontColorTexture)return W;this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nFontColorTexture),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE)}if(null==this.textCanvas){if(this.textCanvas=document.createElement("canvas"),null==this.textCanvas)return Z;if(this.textCanvasCtx=this.textCanvas.getContext("2d"),null==this.textCanvasCtx)return Z;this.textCanvasCtx.canvas.width=this.nDrawFontWidth,this.textCanvasCtx.canvas.height=this.nDrawFontHeight}this.textCanvasCtx.clearRect(0,0,this.nDrawFontWidth,this.nDrawFontHeight);for(var o=0;o<t;++o){var s=e[o].nFontWidth,l=e[o].nFontHeight;1==this.bIsCapturing&&(s=Math.round(.7*this.nCaptureWidth/this.canvas.width*s),l=Math.round(.7*this.nCaptureHeight/this.canvas.height*l));var c=s<l?s:l;this.textCanvasCtx.font=c.toString()+"px "+e[o].pFontFamily,null==e[o].textAlign||null==e[o].textAlign?this.textCanvasCtx.textAlign="left":this.textCanvasCtx.textAlign=e[o].textAlign,null==e[o].textBaseline||null==e[o].textBaseline?this.textCanvasCtx.textBaseline="top":this.textCanvasCtx.textBaseline=e[o].textBaseline;var d=parseInt(255*e[o].pstFontColor.fR),u=parseInt(255*e[o].pstFontColor.fG),h=parseInt(255*e[o].pstFontColor.fB),f=d<16?"0"+d.toString(16):d.toString(16),x=u<16?"0"+u.toString(16):u.toString(16),p=h<16?"0"+h.toString(16):h.toString(16);this.textCanvasCtx.fillStyle="#"+f+x+p,this.textCanvasCtx.globalAlpha=e[o].pstFontColor.fA;var m=e[o].pstStartPos.fX*this.nDrawFontWidth,_=e[o].pstStartPos.fY*this.nDrawFontHeight;this.textCanvasCtx.save(),this.textCanvasCtx.translate(m,_),this.textCanvasCtx.rotate(e[o].fRotateAngle*Math.PI/180),this.textCanvasCtx.fillText(e[o].pString,0,0),this.textCanvasCtx.restore()}if(this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nFontColorTexture),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,this.textCanvasCtx.canvas),0==this.nFontShaderProgram&&(this.nFontShaderProgram=this.CompileProgram("\n    attribute vec4  position;\n    attribute vec4  texCoord;\n    varying vec4  pp; \n    uniform int bCapture;\n\n    void main()\n    { \n        gl_Position.x  = position.x;\n        gl_Position.y  = position.y;\n        if(bCapture == 1)\n        {\n            gl_Position.y = -position.y;\n        }\n        gl_Position.z  = 0.1;\n        gl_Position.w  = 1.0;\n        pp = texCoord; \n    }\n","\n    varying lowp vec4 pp;\n    uniform sampler2D texture;\n\n    void main(void)\n    {\n        gl_FragColor = texture2D(texture, pp.st);\n    }\n"),this.nFontShaderProgram<=0))return W;1==this.bIsCapturing?(i=this.nCaptureWidth+4-this.nCaptureWidth%4,n=this.nCaptureHeight+4-this.nCaptureHeight%4):(i=this.canvas.width+4-this.canvas.width%4,n=this.canvas.height+4-this.canvas.height%4),this.ctx.viewport(0,0,i,n),this.ctx.enable(this.ctx.BLEND),this.ctx.blendFunc(this.ctx.SRC_ALPHA,this.ctx.ONE_MINUS_SRC_ALPHA),this.ctx.useProgram(this.nFontShaderProgram);var g=this.ctx.getUniformLocation(this.nFontShaderProgram,"bCapture");if(g<=0)return W;1==this.bIsCapturing?this.ctx.uniform1i(g,1):this.ctx.uniform1i(g,0),this.ctx.activeTexture(this.ctx.TEXTURE0),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nFontColorTexture);var v=this.ctx.getUniformLocation(this.nFontShaderProgram,"texture");this.ctx.uniform1i(v,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.vertexPosBuffer);var y=this.ctx.getAttribLocation(this.nFontShaderProgram,"position");this.ctx.enableVertexAttribArray(y),this.ctx.vertexAttribPointer(y,3,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.texturePosBuffer);var S=this.ctx.getAttribLocation(this.nFontShaderProgram,"texCoord");return this.ctx.enableVertexAttribArray(S),this.ctx.vertexAttribPointer(S,2,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),this.ctx.drawArrays(this.ctx.TRIANGLE_FAN,0,4),this.ctx.bindTexture(this.ctx.TEXTURE_2D,null),this.ctx.useProgram(null),this.ctx.disable(this.ctx.BLEND),1}},{key:"SR_DrawImage",value:function(e,t,i,n,a,r){if(null==this.ctx)return H;if(null==e||t<=0||i<=0||null==n||r<0||r>1)return V;if(this.nDrawImageWidth=t,this.nDrawImageHeight=i,0==this.glImagePosBuffer&&(this.glImagePosBuffer=this.ctx.createBuffer(),0==this.glImagePosBuffer))return W;if(0==this.glImageClrBuffer&&(this.glImageClrBuffer=this.ctx.createBuffer(),0==this.glImageClrBuffer))return W;if(null==this.pImageClrVertices){if(this.pImageClrVertices=new Float32Array(12),null==this.pImageClrVertices)return z;this.pImageClrVertices[0]=0,this.pImageClrVertices[1]=0,this.pImageClrVertices[2]=0,this.pImageClrVertices[3]=1,this.pImageClrVertices[4]=1,this.pImageClrVertices[5]=0,this.pImageClrVertices[6]=1,this.pImageClrVertices[7]=0,this.pImageClrVertices[8]=0,this.pImageClrVertices[9]=1,this.pImageClrVertices[10]=1,this.pImageClrVertices[11]=1}var o={},s={};if(o.fLeft=(n.fLeft-this.fSrcUseLeft)/(this.fSrcUseRight-this.fSrcUseLeft),o.fRight=(n.fRight-this.fSrcUseLeft)/(this.fSrcUseRight-this.fSrcUseLeft),o.fTop=(n.fTop-this.fSrcUseTop)/(this.fSrcUseBottom-this.fSrcUseTop),o.fBottom=(n.fBottom-this.fSrcUseTop)/(this.fSrcUseBottom-this.fSrcUseTop),s.fLeft=this.fDstUseLeft+o.fLeft*(this.fDstUseRight-this.fDstUseLeft),s.fRight=this.fDstUseLeft+o.fRight*(this.fDstUseRight-this.fDstUseLeft),s.fTop=this.fDstUseTop+o.fTop*(this.fDstUseBottom-this.fDstUseTop),s.fBottom=this.fDstUseTop+o.fBottom*(this.fDstUseBottom-this.fDstUseTop),null==this.pImagePosVertices&&(this.pImagePosVertices=new Float32Array(12),null==this.pImagePosVertices))return z;switch(this.pImagePosVertices.fill(0),this.pImagePosVertices[0]=2*s.fLeft-1,this.pImagePosVertices[1]=1-2*s.fTop,this.pImagePosVertices[2]=2*s.fLeft-1,this.pImagePosVertices[3]=1-2*s.fBottom,this.pImagePosVertices[4]=2*s.fRight-1,this.pImagePosVertices[5]=1-2*s.fTop,this.pImagePosVertices[6]=2*s.fRight-1,this.pImagePosVertices[7]=1-2*s.fTop,this.pImagePosVertices[8]=2*s.fLeft-1,this.pImagePosVertices[9]=1-2*s.fBottom,this.pImagePosVertices[10]=2*s.fRight-1,this.pImagePosVertices[11]=1-2*s.fBottom,1==this.bIsCapturing?this.ctx.viewport(0,0,this.nCaptureWidth,this.nCaptureHeight):this.ctx.viewport(0,0,this.canvas.width,this.canvas.height),this.ctx.enable(this.ctx.BLEND),this.ctx.blendFunc(this.ctx.SRC_ALPHA,this.ctx.ONE_MINUS_SRC_ALPHA),a){case 5:if(null==this.nImageColorTexture){if(this.nImageColorTexture=this.ctx.createTexture(),0==this.nImageColorTexture)return W;this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTexture),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE)}if(this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTexture),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,this.nDrawImageWidth,this.nDrawImageHeight,0,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,e),0==this.nImageShaderProgram){var l=this.CompileProgram($,Q);if(l<=0)return W;this.nImageShaderProgram=l}break;case 4:if(null==this.nImageColorTexture){if(this.nImageColorTexture=this.ctx.createTexture(),0==this.nImageColorTexture)return W;this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTexture),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE)}if(this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTexture),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGB,this.nDrawImageWidth,this.nDrawImageHeight,0,this.ctx.RGB,this.ctx.UNSIGNED_SHORT_5_6_5,e),0==this.nImageShaderProgram){var c=this.CompileProgram($,"\n    precision mediump float; \n    uniform sampler2D texture; \n    varying lowp vec4 pp;\n    uniform float fAlpha;\n    void main(void) \n    { \n        gl_FragColor = texture2D(texture, pp.st); \n        gl_FragColor.a *= fAlpha; \n    } \n");if(c<=0)return W;this.nImageShaderProgram=c}break;case 1:for(var d=0;d<3;d++){if(this.nImageColorTextures[d]=this.ctx.createTexture(),0==this.nImageColorTextures[d])return W;this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTextures[d]),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE)}if(this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTextures[0]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,this.nDrawImageWidth,this.nDrawImageHeight,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,e),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTextures[1]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,this.nDrawImageWidth/2,this.nDrawImageHeight/2,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,e+this.nDrawImageWidth*this.nDrawImageHeight*5/4),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTextures[2]),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.LUMINANCE,this.nDrawImageWidth/2,this.nDrawImageHeight/2,0,this.ctx.LUMINANCE,this.ctx.UNSIGNED_BYTE,e+this.nDrawImageWidth*this.nDrawImageHeight),0==this.nImageShaderProgram){var u=this.CompileProgram($,"\n    precision mediump float;\n    uniform sampler2D Ytexture;\n    uniform sampler2D Utexture;\n    uniform sampler2D Vtexture;\n    uniform float fAlpha;\n    varying lowp vec4 pp;\n\n    void main(void)\n    {\n        float r, g, b, y, u, v; \n\n        y = texture2D(Ytexture, pp.st).r; \n        u = texture2D(Utexture, pp.st).r; \n        v = texture2D(Vtexture, pp.st).r; \n\n        y = 1.1643 * (y - 0.0625); \n        u = u - 0.5; \n        v = v - 0.5; \n\n        r = y + 1.5958 * v; \n        g = y - 0.39173 * u - 0.81290 * v; \n        b = y + 2.017 * u; \n\n        gl_FragColor = vec4(r, g, b, fAlpha); \n    }\n");if(u<=0)return W;this.nImageShaderProgram=u}break;case X:if(null==this.nImageColorTexture){if(this.nImageColorTexture=this.ctx.createTexture(),0==this.nImageColorTexture)return W;this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTexture),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE)}this.ctx.useProgram(this.videoShaderProgram),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.vertexPosBuffer);var h=this.ctx.getAttribLocation(this.videoShaderProgram,"xy");if(h<0)return W;this.ctx.vertexAttribPointer(h,3,this.ctx.FLOAT,!1,0,0),this.ctx.enableVertexAttribArray(h),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.texturePosBuffer);var f=this.ctx.getAttribLocation(this.videoShaderProgram,"uv");if(f<0)return W;if(this.ctx.vertexAttribPointer(f,2,this.ctx.FLOAT,!1,0,0),this.ctx.enableVertexAttribArray(f),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),this.ctx.useProgram(null),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTexture),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,this.nDrawImageWidth,this.nDrawImageHeight,0,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,e),0==this.nImageShaderProgram){var x=this.CompileProgram($,Q);if(x<=0)return W;this.nImageShaderProgram=x}break;default:return U}var p=this.nImageShaderProgram;this.ctx.useProgram(p);var m=this.ctx.getUniformLocation(this.nImageShaderProgram,"bCapture");if(m<=0)return W;1==this.bIsCapturing?this.ctx.uniform1i(m,1):this.ctx.uniform1i(m,0),this.ctx.activeTexture(this.ctx.TEXTURE0),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nImageColorTexture);var _=this.ctx.getUniformLocation(this.nImageShaderProgram,"texture");this.ctx.uniform1i(_,0),_=this.ctx.getUniformLocation(this.nImageShaderProgram,"fAlpha"),this.ctx.uniform1f(_,r),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.glImagePosBuffer),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,this.pImagePosVertices,this.ctx.STATIC_DRAW);var g=this.ctx.getAttribLocation(this.nImageShaderProgram,"position");this.ctx.enableVertexAttribArray(g),this.ctx.vertexAttribPointer(g,2,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.glImageClrBuffer),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,this.pImageClrVertices,this.ctx.STATIC_DRAW);var v=this.ctx.getAttribLocation(this.nImageShaderProgram,"texCoord");return this.ctx.enableVertexAttribArray(v),this.ctx.vertexAttribPointer(v,2,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),this.ctx.drawArrays(this.ctx.TRIANGLES,0,6),this.ctx.useProgram(null),this.ctx.disable(this.ctx.BLEND),1}},{key:"SR_AddSubPort",value:function(e){var t,i,n=le;if(null==this.ctx)return n;if(null!=this.pFishParamManager?n=this.pFishParamManager.GetFECPort(e):e==Y.SR_DE_NULL&&(n=0),n==le)return le;switch(this.nFECPort=n,e){case Y.SR_DE_NULL:t=J,this.enPixelFormat==X?i="\nprecision mediump float;\nvarying highp vec2 v_uv;\nuniform sampler2D texture;\nuniform float fWndWidth;\nuniform float fWndHeight;\nuniform float fBrightness;\nuniform float fHue;\nuniform float fSaturation;\nuniform float fContrast;\nuniform float fSharpness;\nuniform int nPostProc;\nvec3 rgb2hsv(vec3 c) \n{ \n    vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); \n    vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); \n    vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); \n    float d = q.x - min(q.w, q.y); \n    float e = 1.0e-10; \n    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); \n} \nvec3 hsv2rgb(vec3 c) \n{ \n    vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); \n    vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); \n    return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); \n} \nvec3 sharpen() \n{ \n    vec3 sharpenColor; \n    float offWidth = 1.0 / fWndWidth; \n    float offHeight = 1.0 / fWndHeight; \n    float tempSharpness = fSharpness * 100.0; \n    vec2 uv     = v_uv; \n    sharpenColor  = (1.0 + 4.0 * tempSharpness) * texture2D(texture, uv).rgb; \n\n    uv            = v_uv + vec2(offWidth, 0); \n    sharpenColor -= tempSharpness * texture2D(texture, uv).rgb; \n\n    uv            = v_uv + vec2(-offWidth, 0); \n    sharpenColor -= tempSharpness * texture2D(texture, uv).rgb; \n\n    uv            = v_uv + vec2(0, offHeight); \n    sharpenColor -= tempSharpness * texture2D(texture, uv).rgb; \n\n    uv            = v_uv + vec2(0, -offHeight); \n    sharpenColor -= tempSharpness * texture2D(texture, uv).rgb; \n\n    return sharpenColor; \n} \nvoid main(void) \n{\n    if(1 == nPostProc)\n    {\n        vec3 fragRGB = sharpen();                    //sharpen 锐度\n        vec3 fragHSV = rgb2hsv(fragRGB); \n        fragHSV.x = fragHSV.x + fHue;                   //hue 色度\n        fragHSV.y = fragHSV.y * (fSaturation + 1.0);    //saturation 饱和度\n        fragRGB = hsv2rgb(fragHSV); \n        if (fBrightness > 0.0)                          //brightness 亮度\n        { \n            fragRGB = fragRGB + (1.0 - fragRGB) * fBrightness; \n        } \n        else \n        { \n            fragRGB = fragRGB + fragRGB * fBrightness; \n        } \n        float tempContrast = fContrast > 0.0 ? fContrast * 10.0 : fContrast; \n        fragRGB = ((fragRGB - 0.5) * max(tempContrast + 1.0, 0.0)) + 0.5;      //contrast 对比度\n        gl_FragColor = vec4(fragRGB, 1.0); \n    }\n    else\n    {\n        gl_FragColor = texture2D(texture, v_uv);\n    }\n}\n":1!=this.enPixelFormat&&3!=this.enPixelFormat||(i="\nprecision mediump float;\nvarying highp vec2 v_uv;\nuniform sampler2D Ytexture;\nuniform sampler2D Utexture;\nuniform sampler2D Vtexture;\nuniform float fWndWidth;\nuniform float fWndHeight;\nuniform float fBrightness;\nuniform float fHue;\nuniform float fSaturation;\nuniform float fContrast;\nuniform float fSharpness;\nuniform int nPostProc;\nvec3 rgb;\nvec3 yuv2rgb(float y, float u, float v)\n{\n    float r,g,b; \n    y = 1.1643 * (y - 0.0625); \n    u = u - 0.5; \n    v = v - 0.5; \n    r = y + 1.5958 * v; \n    g = y - 0.39173 * u - 0.81290 * v; \n    b = y + 2.017 * u; \n    return vec3(r, g, b);\n}\nvec3 rgb2hsv(vec3 c) \n{ \n    vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); \n    vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); \n    vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); \n\n    float d = q.x - min(q.w, q.y); \n    float e = 1.0e-10; \n    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); \n} \n\nvec3 hsv2rgb(vec3 c) \n{ \n    vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); \n    vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); \n    return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); \n} \n\nvec3 sharpen(vec3 c) \n{ \n    vec3 sharpenColor; \n    float sharpenColorY;\n    float sharpenColorU;\n    float sharpenColorV;\n    float offWidth  = 1.0 / fWndWidth; \n    float offHeight = 1.0 / fWndHeight; \n    float tempSharpness = fSharpness * 100.0; \n\n    sharpenColor = (1.0 + 4.0 * tempSharpness) * c;\n\n    vec2 uv       = v_uv + vec2(offWidth, 0); \n    sharpenColorY = texture2D(Ytexture, uv).r; \n    sharpenColorU = texture2D(Utexture, uv).r; \n    sharpenColorV = texture2D(Vtexture, uv).r; \n    sharpenColor -= tempSharpness *  yuv2rgb(sharpenColorY, sharpenColorU, sharpenColorV);\n\n    uv            = v_uv + vec2(-offWidth, 0); \n    sharpenColorY = texture2D(Ytexture, uv).r;\n    sharpenColorU = texture2D(Utexture, uv).r; \n    sharpenColorV = texture2D(Vtexture, uv).r; \n    sharpenColor -= tempSharpness *  yuv2rgb(sharpenColorY, sharpenColorU, sharpenColorV);\n\n    uv            = v_uv + vec2(0, offHeight);\n    sharpenColorY = texture2D(Ytexture, uv).r; \n    sharpenColorU = texture2D(Utexture, uv).r; \n    sharpenColorV = texture2D(Vtexture, uv).r; \n    sharpenColor -= tempSharpness * yuv2rgb(sharpenColorY, sharpenColorU, sharpenColorV);\n\n    uv            = v_uv + vec2(0, -offHeight); \n    sharpenColorY = texture2D(Ytexture, uv).r; \n    sharpenColorU = texture2D(Utexture, uv).r; \n    sharpenColorV = texture2D(Vtexture, uv).r; \n    sharpenColor -= tempSharpness *  yuv2rgb(sharpenColorY, sharpenColorU, sharpenColorV);\n\n    return sharpenColor; \n} \nvoid main(void)\n{\n    float y, u, v;\n    y = texture2D(Ytexture, v_uv).r;\n    u = texture2D(Utexture, v_uv).r;\n    v = texture2D(Vtexture, v_uv).r;\n    rgb = yuv2rgb(y, u, v);\n    if(1 == nPostProc)\n    {\n        vec3 fragRGB = sharpen(rgb);                    //sharpen 锐度\n        vec3 fragHSV = rgb2hsv(fragRGB); \n        fragHSV.x = fragHSV.x + fHue;                   //hue 色度\n        fragHSV.y = fragHSV.y * (fSaturation + 1.0);    //saturation 饱和度\n        fragRGB = hsv2rgb(fragHSV); \n        if (fBrightness > 0.0)                        //brightness 亮度\n        { \n            fragRGB = fragRGB + (1.0 - fragRGB) * fBrightness; \n        } \n        else \n        { \n            fragRGB = fragRGB + fragRGB * fBrightness; \n        } \n\n        float tempContrast = fContrast > 0.0 ? fContrast * 10.0 : fContrast; \n        fragRGB = ((fragRGB - 0.5) * max(tempContrast + 1.0, 0.0)) + 0.5;      //contrast 对比度\n        gl_FragColor = vec4(fragRGB, 1.0); \n    }\n    else\n    {\n        gl_FragColor = vec4(rgb, 1.0);\n    }\n}\n"),this.b3DPort=!1;break;case Y.SR_DE_FISH_ORIGINAL:t=J,i="\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D texture;\nuniform float fRX1;\nuniform float fRX2;\nuniform float fRY1;\nuniform float fRY2;\nuniform int bBlack; \nuniform int bCut;\n\nvoid main()\n{ \n\tfloat r,g,b;\n\tvec4 origin;\n\n\tfloat  w;\n\tfloat  h;\n\tfloat  fCenterX;\n\tfloat  fCenterY;\n\tfloat  fRadius;\n\tw = 1.0;\n\th = (fRX2 - fRX1) / (fRY2 - fRY1);\n\tfCenterX = (fRX1 + fRX2) / 2.0 * w;    ///<圆心实际坐标\n\tfCenterY = (fRY1 + fRY2) / 2.0 * h;\n\tfRadius = (fRX2 - fRX1) / 2.0 * w;     ///<半径实际长度\n\tfloat  leftCut = 0.0;\n\tfloat  rightCut = 1.0;\n\tfloat  topCut = 0.0;\n\tfloat  bottomCut = 1.0;\n\tif(bCut == 1)\n\t{\n\t\tif(fRX1 > 0.0)\n\t\t{\n\t\t\tleftCut = fRX1;\n\t\t}\n\t\tif(fRX2 < 1.0)\n\t\t{\n\t\t\trightCut = fRX2;\n\t\t}\n\t\tif(fRY1 > 0.0)\n\t\t{\n\t\t\ttopCut = fRY1;\n\t\t}\n\t\tif(fRY2 < 1.0)\n\t\t{\n\t\t\tbottomCut = fRY2;\n\t\t}\n\t}\n\torigin.s = v_uv.s * (rightCut-leftCut) + leftCut;\n\torigin.t = v_uv.t * (bottomCut-topCut) + topCut;\n\n\tr = texture2D(texture, origin.st).r; \n\tg = texture2D(texture, origin.st).g; \n\tb = texture2D(texture, origin.st).b; \n\n\tif(bBlack == 1)\n\t{\n\t\tfloat tmpX, tmpY;\n\t\ttmpX = origin.s * w; \n\t\ttmpY = origin.t * h; \n\t\tfloat d2 = (tmpX-fCenterX)*(tmpX-fCenterX) + (tmpY-fCenterY)*(tmpY-fCenterY);\n\t\tif(d2 > fRadius*fRadius)\n\t\t{\n\t\t\tr = 0.0; \n\t\t\tg = 0.0; \n\t\t\tb = 0.0; \n\t\t}\n\t}\n\n\tgl_FragColor = vec4(r ,g ,b , 1.0);\n}\n",this.b3DPort=!1;break;case Y.SR_DE_FISH_PTZ_CEILING:t=J,i="\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D texture;\nuniform float fHAngleCos;\nuniform float fHAngleSin;\nuniform float fVAngleCos;\nuniform float fVAngleSin;\nuniform float fZoom;\n\nuniform float fRX1; \nuniform float fRX2; \nuniform float fRY1; \nuniform float fRY2; \n\nvoid main()\n{\n    float r,g,b;  \n\n    vec4 origin1;\n    vec4 origin2;\n    vec4 result;\n    float  z1;\n    float  z2;\n    float  dnew;\n\n    float  w;\n    float  h;\n    float  fCenterX;\n    float  fCenterY;\n    float  fRadius;\n    w = 1.0;\n    h = (fRX2 - fRX1) / (fRY2 - fRY1);\n    fCenterX = (fRX1 + fRX2) / 2.0 * w;    \n    fCenterY = (fRY1 + fRY2) / 2.0 * h;\n    fRadius = (fRX2 - fRX1) / 2.0 * w; \n\n    origin1.s = v_uv.s - 0.5;\n    origin1.t = 0.5 - v_uv.t;\n    z1 = fZoom ;\n\n    origin2.s = origin1.s ;\n    origin2.t = (origin1.t*fVAngleCos + z1*fVAngleSin);\n    z2 = z1*fVAngleCos - origin1.t*fVAngleSin;\n\n    dnew = sqrt(origin2.s*origin2.s + origin2.t*origin2.t) ;\n    float d = sqrt(origin2.s*origin2.s + origin2.t*origin2.t + z2*z2);\n    float theta = asin(dnew/d);\n    float tmp = theta / 1.5707963 * 0.5;\n    origin2.s = tmp*origin2.s / dnew ;\n    origin2.t = tmp*origin2.t / dnew ;\n\n    result.s = ((origin2.s*fHAngleCos - origin2.t*fHAngleSin)*fRadius*2.0+fCenterX)/w;\n    result.t = (-(origin2.s*fHAngleSin + origin2.t*fHAngleCos)*fRadius*2.0+fCenterY)/h;\n\n    r = texture2D(texture, result.st).r; \n    g = texture2D(texture, result.st).g; \n    b = texture2D(texture, result.st).b; \n    if(result.s > 1.0 || result.t > 1.0 || result.s < 0.0 || result.t < 0.0)\n    {\n        r = 0.0; \n        g = 0.0; \n        b = 0.0; \n    }\n    gl_FragColor = vec4(r ,g ,b , 1.0);\n} \n",this.b3DPort=!1;break;case Y.SR_DE_FISH_PTZ_FLOOR:t=J,i="\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D texture;  \nuniform float fHAngleCos;  \nuniform float fHAngleSin; \nuniform float fVAngleCos;  \nuniform float fVAngleSin;  \nuniform float fZoom;\n\nuniform float fRX1; \nuniform float fRX2; \nuniform float fRY1; \nuniform float fRY2; \n\nvoid main()\n{\n    float r,g,b;\n\n    vec4 origin1;\n    vec4 origin2;\n    vec4 result;\n    float  z1;\n    float  z2;\n    float  dnew;\n\n    float  w;\n    float  h;\n    float  fCenterX;\n    float  fCenterY;\n    float  fRadius;\n    w = 1.0;\n    h = (fRX2 - fRX1) / (fRY2 - fRY1);\n    fCenterX = (fRX1 + fRX2) / 2.0 * w;     ///<Բ��ʵ������\n    fCenterY = (fRY1 + fRY2) / 2.0 * h;\n    fRadius = (fRX2 - fRX1) / 2.0 * w;     ///<�뾶ʵ�ʳ���\n    origin1.s = v_uv.s - 0.5;\n    origin1.t = v_uv.t - 0.5;\n    z1 = fZoom ;\n\n    origin2.s = origin1.s ;\n    origin2.t = (origin1.t*fVAngleCos + z1*fVAngleSin);\n    z2 = z1*fVAngleCos - origin1.t*fVAngleSin;\n\n    dnew = sqrt(origin2.s*origin2.s + origin2.t*origin2.t) ;\n    float d = sqrt(origin2.s*origin2.s + origin2.t*origin2.t + z2*z2);\n    float theta = asin(dnew/d);\n    float tmp = theta / 1.5707963 * 0.5;\n    origin2.s = tmp*origin2.s / dnew ;\n    origin2.t = tmp*origin2.t / dnew ;\n\n    result.s = ((origin2.s*fHAngleCos - origin2.t*fHAngleSin)*fRadius*2.0+fCenterX)/w;\n    result.t = ((origin2.s*fHAngleSin + origin2.t*fHAngleCos)*fRadius*2.0+fCenterY)/h;\n\n    r = texture2D(texture, result.st).r; \n    g = texture2D(texture, result.st).g; \n    b = texture2D(texture, result.st).b; \n    if(result.s > 1.0 || result.t > 1.0 || result.s < 0.0 || result.t < 0.0)\n    {\n        r = 0.0;\n        g = 0.0; \n        b = 0.0; \n    }\n    gl_FragColor = vec4(r ,g ,b , 1.0);\n} \n",this.b3DPort=!1;break;case Y.SR_DE_FISH_PTZ_WALL:t=J,i="\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D texture;\nuniform float fHAngleCos;\nuniform float fHAngleSin;  \nuniform float fVAngleCos;  \nuniform float fVAngleSin;  \nuniform float fZoom;\n\nuniform float fRX1; \nuniform float fRX2; \nuniform float fRY1; \nuniform float fRY2; \n\nvoid main()\n{\n    float r,g,b;  \n\n    vec4 origin1;\n    vec4 origin2;\n    vec4 origin3;\n    vec4 result;\n    float  z1;\n    float  z2;\n    float  z3;\n    float  dnew;\n\n    float  w;\n    float  h;\n    float  fCenterX;\n    float  fCenterY;\n    float  fRadius;\n    w = 1.0;\n    h = (fRX2 - fRX1) / (fRY2 - fRY1);\n    fCenterX = (fRX1 + fRX2) / 2.0 * w;    ///<Բ��ʵ������\n    fCenterY = (fRY1 + fRY2) / 2.0 * h;\n    fRadius = (fRX2 - fRX1) / 2.0 * w;    ///<�뾶ʵ�ʳ���\n\n    origin1.s = v_uv.s - 0.5;\n    origin1.t = v_uv.t - 0.5;\n    z1 = fZoom ;\n\n    origin2.s = origin1.s ;\n    origin2.t = (origin1.t*fVAngleCos + z1*fVAngleSin);\n    z2 = z1*fVAngleCos - origin1.t*fVAngleSin;\n\n    origin3.s = origin2.s*fHAngleCos + z2*fHAngleSin ;\n    origin3.t = origin2.y;\n    z3 = z2*fHAngleCos - origin2.x*fHAngleSin;\n\n    dnew = sqrt(origin3.s*origin3.s + origin3.t*origin3.t) ;\n    float d = sqrt(origin3.s*origin3.s + origin3.t*origin3.t + z3*z3);\n    float theta = asin(dnew/d);\n    float tmp = theta / 1.5707963 * 0.5;\n    result.s = (tmp*origin3.s / dnew * fRadius * 2.0 + fCenterX)/w;\n    result.t = (tmp*origin3.t / dnew * fRadius * 2.0 + fCenterY)/h;\n\n    r = texture2D(texture, result.st).r; \n    g = texture2D(texture, result.st).g; \n    b = texture2D(texture, result.st).b; \n    if(result.s > 1.0 || result.t > 1.0 || result.s < 0.0 || result.t < 0.0)\n    {\n        r = 0.0; \n        g = 0.0; \n        b = 0.0; \n    }\n    gl_FragColor = vec4(r ,g ,b , 1.0);\n} \n",this.b3DPort=!1;break;case Y.SR_DE_FISH_PANORAMA_CEILING_360:t=J,i="\n    precision highp float;\n    varying vec2 v_uv;\n    uniform sampler2D texture;\n    uniform float fAngle;\n    uniform float fRX1;\n    uniform float fRX2;\n    uniform float fRY1;\n    uniform float fRY2;\n    \n    void main()\n    {\n    \n        float r,g,b; \n    \n        vec4 origin;\n        vec4 result;\n        float  thetabase;\n        float  d;\n    \n        float  w;\n        float  h;\n        float  fCenterX;\n        float  fCenterY;\n        float  fRadius;\n        w = 1.0;\n        h = (fRX2 - fRX1) / (fRY2 - fRY1);\n        fCenterX = (fRX1 + fRX2) / 2.0 * w;    ///<圆心实际坐标\n        fCenterY = (fRY1 + fRY2) / 2.0 * h;\n        fRadius = (fRX2 - fRX1) / 2.0 * w;    ///<半径实际长度\n        float fMax = 0.0;\n        if(fRX2 > 1.0 || fRY2 > 1.0 || fRX1 < 0.0 || fRY1 < 0.0) ///<如果不是一个完整的圆\n        {\n            float tmp;\n            if(fRX1 < 0.0)\n            {\n                tmp = -fRX1 * w; ///<左边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRX2 > 1.0)\n            {\n                tmp = (fRX2 - 1.0) * w; ///<右边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRY1 < 0.0)\n            {\n                tmp = -fRY1 * h; ///<上边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRY2 > 1.0)\n            {\n                tmp = (fRY2 - 1.0) * h; ///<下边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n        }\n        float topCut = fMax / fRadius;  ///<如果不是一个完整的圆,最终矫正图需要切掉上面无图像部分,否则无需切\n        float bottomCut = 0.8;           ///<为矫正效果,最终矫正图固定切掉下面一部分\n        origin.s = v_uv.s;\n        origin.t = (bottomCut - topCut) * v_uv.t + topCut;\n        thetabase = 6.2831853 * origin.s + fAngle;\n        d = fRadius * (1.0 - origin.t);\n        result.s = (fCenterX - d*sin(thetabase)) / w;\n        result.t = (fCenterY + d*cos(thetabase)) / h;\n    \n        r = texture2D(texture, result.st).r;\n        g = texture2D(texture, result.st).g;\n        b = texture2D(texture, result.st).b;\n        if(result.s > 1.0 || result.t > 1.0 || result.s < 0.0 || result.t < 0.0)\n        {\n            r = 0.0; \n            g = 0.0; \n            b = 0.0;\n        }\n        gl_FragColor = vec4(r, g, b, 1.0);\n    }\n",this.b3DPort=!1;break;case Y.SR_DE_FISH_PANORAMA_CEILING_180:t=J,i="\n    precision highp float;\n    varying vec2 v_uv;\n    uniform sampler2D texture;\n    uniform float fAngle;\n    uniform float fRX1; \n    uniform float fRX2; \n    uniform float fRY1; \n    uniform float fRY2; \n    \n    void main()\n    {\n        float r,g,b;  \n    \n        vec4 origin;\n        vec4 result;\n        float  thetabase;\n        float  d;\n    \n        vec4 newpp;  ///<180矫正pp纹理坐标的点对应360矫正newpp纹理坐标对应的点\n        if (v_uv.t  <= 0.5)\n        {\n            newpp.s =  v_uv.s / 2.0 + 0.5;\n            newpp.t =  v_uv.t * 2.0;\n        }\n        else\n        {\n            newpp.s =  v_uv.s / 2.0;\n            newpp.t =  (v_uv.t - 0.5) * 2.0;\n        }\n        float  w;\n        float  h;\n        float  fCenterX;\n        float  fCenterY;\n        float  fRadius;\n        w = 1.0;\n        h = (fRX2 - fRX1) / (fRY2 - fRY1);\n        fCenterX = (fRX1 + fRX2) / 2.0 * w;     ///<圆心实际坐标\n        fCenterY = (fRY1 + fRY2) / 2.0 * h;\n        fRadius = (fRX2 - fRX1) / 2.0 * w;     ///<半径实际长度\n        float fMax = 0.0;\n        if(fRX2 > 1.0 || fRY2 > 1.0 || fRX1 < 0.0 || fRY1 < 0.0) ///<如果不是一个完整的圆\n        {\n            float tmp;\n            if(fRX1 < 0.0)\n            {\n                tmp = -fRX1 * w; ///<左边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRX2 > 1.0)\n            {\n                tmp = (fRX2 - 1.0) * w; ///<右边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRY1 < 0.0)\n            {\n                tmp = -fRY1 * h; ///<上边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRY2 > 1.0)\n            {\n                tmp = (fRY2 - 1.0) * h; ///<下边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n        }\n        float topCut = fMax / fRadius;   ///<如果不是一个完整的圆,最终矫正图需要切掉上面无图像部分,否则无需切\n        float bottomCut = 0.8;           ///<为矫正效果,最终矫正图固定切掉下面一部分\n        origin.s = newpp.s;\n        origin.t = (bottomCut - topCut) * newpp.t + topCut;\n        thetabase = 6.2831853 * origin.s + fAngle;\n        d = fRadius * (1.0 - origin.t);\n        result.s = (fCenterX - d*sin(thetabase)) / w;\n        result.t = (fCenterY + d*cos(thetabase)) / h;\n    \n        r = texture2D(texture, result.st).r;\n        g = texture2D(texture, result.st).g;\n        b = texture2D(texture, result.st).b;\n        if(result.s > 1.0 || result.t > 1.0 || result.s < 0.0 || result.t < 0.0)\n        {\n            r = 0.0;\n            g = 0.0;\n            b = 0.0;\n        }\n        gl_FragColor = vec4(r ,g ,b , 1.0);\n    }\n",this.b3DPort=!1;break;case Y.SR_DE_FISH_PANORAMA_FLOOR_360:t=J,i="\n    precision highp float;\n    varying vec2 v_uv;\n    uniform sampler2D texture;\n    uniform float fAngle;\n    uniform float fRX1;\n    uniform float fRX2;\n    uniform float fRY1;\n    uniform float fRY2;\n    \n    void main()\n    {\n        float r,g,b;  \n    \n        vec4 origin;\n        vec4 result;\n        float  thetabase;\n        float  d;\n    \n        float  w;\n        float  h;\n        float  fCenterX;\n        float  fCenterY;\n        float  fRadius;\n        w = 1.0;\n        h = (fRX2 - fRX1) / (fRY2 - fRY1);\n        fCenterX = (fRX1 + fRX2) / 2.0 * w;    ///<圆心实际坐标\n        fCenterY = (fRY1 + fRY2) / 2.0 * h;\n        fRadius = (fRX2 - fRX1) / 2.0 * w;    ///<半径实际长度\n        float fMax = 0.0;\n        if(fRX2 > 1.0 || fRY2 > 1.0 || fRX1 < 0.0 || fRY1 < 0.0) ///<如果不是一个完整的圆\n        {\n            float tmp;\n            if(fRX1 < 0.0)\n            {\n                tmp = -fRX1 * w; ///<左边超出图像部分最大实际长度\n                if(tmp > fMax)\n                   fMax = tmp;\n            }\n            if(fRX2 > 1.0)\n            {\n                tmp = (fRX2 - 1.0) * w; ///<右边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRY1 < 0.0)\n            {\n                tmp = -fRY1 * h; ///<上边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRY2 > 1.0)\n            {\n                tmp = (fRY2 - 1.0) * h; ///<下边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n        }\n        float topCut = fMax / fRadius;   ///<如果不是一个完整的圆,最终矫正图需要切掉上面无图像部分,否则无需切\n        float bottomCut = 0.8;           ///<为矫正效果,最终矫正图固定切掉下面一部分\n        origin.s = 1.0 - v_uv.s;\n        origin.t = (bottomCut - topCut) * (1.0 - v_uv.t) + topCut;\n        thetabase = 6.2831853 * origin.s + fAngle;\n        d = fRadius * (1.0 - origin.t);\n        result.s = (fCenterX - d*sin(thetabase)) / w;\n        result.t = (fCenterY + d*cos(thetabase)) / h;\n    \n        r = texture2D(texture, result.st).r;\n        g = texture2D(texture, result.st).g;\n        b = texture2D(texture, result.st).b;\n        if(result.s > 1.0 || result.t > 1.0 || result.s < 0.0 || result.t < 0.0)\n        {\n            r = 0.0; \n            g = 0.0; \n            b = 0.0; \n        }\n        gl_FragColor = vec4(r ,g ,b , 1.0);\n    }\n",this.b3DPort=!1;break;case Y.SR_DE_FISH_PANORAMA_FLOOR_180:t=J,i="\n    precision highp float;\n    varying vec2 v_uv;\n    uniform sampler2D texture;\n    uniform float fAngle;\n    uniform float fRX1;\n    uniform float fRX2;\n    uniform float fRY1;\n    uniform float fRY2;\n\n    void main()\n    {\n        float r,g,b;  \n        vec4 origin;\n        vec4 result;\n        float  thetabase;\n        float  d;\n    \n        vec4 newpp;  ///<180矫正pp纹理坐标的点对应360矫正newpp纹理坐标对应的点\n        if (v_uv.t  <= 0.5) \n        {\n            newpp.s =  v_uv.s / 2.0;\n            newpp.t =  v_uv.t * 2.0;\n        }\n        else\n        {\n            newpp.s =  v_uv.s / 2.0 + 0.5;\n            newpp.t =  (v_uv.t - 0.5) * 2.0;\n        }\n        float  w;\n        float  h;\n        float  fCenterX;\n        float  fCenterY;\n        float  fRadius;\n        w = 1.0;\n        h = (fRX2 - fRX1) / (fRY2 - fRY1);\n        fCenterX = (fRX1 + fRX2) / 2.0 * w;    ///<圆心实际坐标\n        fCenterY = (fRY1 + fRY2) / 2.0 * h;\n        fRadius = (fRX2 - fRX1) / 2.0 * w;     ///<半径实际长度\n        float fMax = 0.0;\n        if(fRX2 > 1.0 || fRY2 > 1.0 || fRX1 < 0.0 || fRY1 < 0.0) ///<如果不是一个完整的圆\n        {\n             float tmp;\n            if(fRX1 < 0.0)\n            {\n                tmp = -fRX1 * w; ///<左边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRX2 > 1.0)\n            {\n                tmp = (fRX2 - 1.0) * w; ///<右边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRY1 < 0.0)\n            {\n                tmp = -fRY1 * h; ///<上边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n            if(fRY2 > 1.0)\n            {\n                tmp = (fRY2 - 1.0) * h; ///<下边超出图像部分最大实际长度\n                if(tmp > fMax)\n                    fMax = tmp;\n            }\n        }\n        float topCut = fMax / fRadius;   ///<如果不是一个完整的圆,最终矫正图需要切掉上面无图像部分,否则无需切\n        float bottomCut = 0.8;           ///<为矫正效果,最终矫正图固定切掉下面一部分\n        origin.s = 1.0 - newpp.s;\n        origin.t = (bottomCut - topCut) * (1.0 - newpp.t) + topCut;\n        thetabase = 6.2831853 * origin.s + fAngle;\n        d = fRadius * (1.0 - origin.t);\n        result.s = (fCenterX - d*sin(thetabase)) / w;\n        result.t = (fCenterY + d*cos(thetabase)) / h;\n    \n        r = texture2D(texture, result.st).r; \n        g = texture2D(texture, result.st).g;\n        b = texture2D(texture, result.st).b;\n        if(result.s > 1.0 || result.t > 1.0 || result.s < 0.0 || result.t < 0.0)\n        {\n            r = 0.0; \n            g = 0.0; \n            b = 0.0; \n        }\n        gl_FragColor = vec4(r ,g ,b , 1.0);\n    } \n",this.b3DPort=!1;break;case Y.SR_DE_FISH_PANORAMA_WALL:t=J,i="\n    precision highp float;\n    varying vec2 v_uv;\n    uniform sampler2D texture;\n    uniform float fRX1;\n    uniform float fRX2;\n    uniform float fRY1; \n    uniform float fRY2; \n    \n    void main()\n    {\n        float r,g,b;\n    \n        vec4 origin;\n        vec4 result;\n        float  d;\n        float  w;\n        float  h;\n        float  fCenterX;\n        float  fCenterY;\n        float  fRadius;\n        w = 1.0;\n        h = (fRX2 - fRX1) / (fRY2 - fRY1);\n        fCenterX = (fRX1 + fRX2) / 2.0 * w;     ///<圆心实际坐标\n        fCenterY = (fRY1 + fRY2) / 2.0 * h;\n        fRadius = (fRX2 - fRX1) / 2.0 * w;     ///<半径实际长度\n        float  defaultTopCut = 0.1;\n        float  defaultBottomCut = 0.9;\n        float  leftCut = 0.0;    ///<当图像中圆不完整时需要切掉无图像部分,即使图像完整,为了效果,也要切掉上下固定的一部分\n        float  rightCut = 1.0;\n        float  topCut = defaultTopCut;\n        float  bottomCut = defaultBottomCut;\n        if(fRX1 < 0.0)\n        {\n            float tmp;\n            tmp = -fRX1 * w; ///<左边超出图像部分最大实际长度\n            tmp = tmp / (2.0*fRadius);\n            leftCut = tmp;\n        }\n        if(fRX2 > 1.0)\n        {\n            float tmp;\n            tmp = (fRX2 - 1.0) * w; ///<右边超出图像部分最大实际长度\n            tmp = tmp / (2.0*fRadius);\n            rightCut = 1.0 - tmp;\n        }\n        if(fRY1 < 0.0)\n        {\n            float tmp;\n            tmp = -fRY1 * h; ///<上边超出图像部分最大实际长度\n            tmp = tmp / (2.0*fRadius);\n            if(tmp > defaultTopCut)\n                topCut = tmp;\n            else\n                topCut = defaultTopCut;\n        }\n        if(fRY2 > 1.0)\n        {\n            float tmp;\n            tmp = (fRY2 - 1.0) * h; ///<下边超出图像部分最大实际长度\n            tmp = tmp / (2.0*fRadius);\n            if(tmp > 1.0 - defaultBottomCut)\n                bottomCut = 1.0 - tmp;\n            else\n                bottomCut = defaultBottomCut;\n        }\n        origin.s = v_uv.s * (rightCut-leftCut) + leftCut;\n        origin.t = v_uv.t * (bottomCut-topCut) + topCut;\n        float tmpx = origin.s * 2.0 * fRadius + fCenterX - fRadius; ///<纹理坐标转化为原图上的实际坐标\n        float tmpy = origin.t * 2.0 * fRadius + fCenterY - fRadius;\n        d = sqrt(fRadius*fRadius - (tmpy-fCenterY)*(tmpy-fCenterY));\n        result.s = ((tmpx-fCenterX) * d / fRadius + fCenterX) / w;\n        result.t = tmpy / h;\n    \n        r = texture2D(texture, result.st).r; \n        g = texture2D(texture, result.st).g; \n        b = texture2D(texture, result.st).b; \n        if(result.s > 1.0 || result.t > 1.0 || result.s < 0.0 || result.t < 0.0)\n        {\n            r = 0.0; \n            g = 0.0; \n            b = 0.0; \n        }\n        gl_FragColor = vec4(r ,g ,b , 1.0);\n    }\n",this.b3DPort=!1;break;case Y.SR_DE_FISH_SEMISPHERE:case Y.SR_DE_FISH_CYLINDER_CEILING:case Y.SR_DE_FISH_CYLINDER_FLOOR:case Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL:case Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL:e==Y.SR_DE_FISH_SEMISPHERE&&(this.bCullBack=!0),t="\n    attribute vec4 xy;\n    attribute vec2 uv;\n    varying highp vec2 v_uv;\n    uniform int bCapture;\n\n    uniform mat4 matProj;\n    uniform mat4 matView;\n    void main(void) {\n        gl_Position = matProj * matView * xy;\n        v_uv = uv;\n        if(bCapture == 1)\n        {\n          v_uv.y = 1.0 - uv.y;\n        }\n    }\n",i="\n    varying highp vec2 v_uv;\n    uniform sampler2D texture;\n    void main(void) {\n        gl_FragColor = texture2D(texture, v_uv);\n    }\n",this.b3DPort=!0;break;default:return U}var a=this.CompileProgram(t,i);if(a<=0)return W;this.videoShaderProgram=a;var r=null,o=null,s=1;if(0==this.b3DPort)r=new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0]),o=new Float32Array([0,1,0,0,1,0,1,1]);else{var l={},c=!1;if(null==this.pFishParamManager)return H;for(var d=0;d<ee;++d)if(d!=n&&1==this.pFishParamManager.GetRenderParam(d,l)){c=!0;break}var u=0,h=1,f=0,x=1;if(1==c&&(u=l.fRXLeft,h=l.fRXRight,f=l.fRYTop,x=l.fRYBottom),e==Y.SR_DE_FISH_SEMISPHERE)s=this._CreateSemiSphere(u,h,f,x),r=this.pSemiSpherePos,o=this.pSemiSphereTex;else if(e==Y.SR_DE_FISH_CYLINDER_CEILING||e==Y.SR_DE_FISH_CYLINDER_FLOOR)s=this._CreateCylinder(e,u,h,f,x,2,2),r=this.pCylinderPos,o=this.pCylinderTex;else{if(e!=Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL&&e!=Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL)return U;0==c?Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL==e?(u=.05,h=.95,f=-.3,x=1.3):Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL==e&&(u=-.16,h=1.16,f=.005,x=.995):Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL==e?(l.fRYTop>0||l.fRYBottom<1)&&(u=.05,h=.95,f=-.3,x=1.3):Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL==e&&(l.fRXLeft>0||l.fRXRight<1)&&(u=-.16,h=1.16,f=.005,x=.995),s=this._CreateArcSphere(e,u,h,f,x),r=this.pArcSpherePos,o=this.pArcSphereTex}if(1!=s)return s;var p={};if(1!=(s=this.pFishParamManager.GetFishParam(this.nFECPort,p)))return s;if(p.nFishParamType=1,p.fRXLeft=u,p.fRXRight=h,p.fRYTop=f,p.fRYBottom=x,this.pFishParamManager.SetFishParam(this.nFECPort,p),1!=s)return s}if(null==r||null==o)return U;var m=this.ctx.createBuffer();this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,m),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,r,this.ctx.STATIC_DRAW),this.vertexPosBuffer=m;var _=this.ctx.createBuffer();return this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,_),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,o,this.ctx.STATIC_DRAW),this.texturePosBuffer=_,this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),0==this.b3DPort&&(r=null,o=null),1!=(s=this.InitCamera(e))?s:(this.enDisplayEffect=e,this.nFECPort)}},{key:"SR_DelSubPort",value:function(e){return null==this.ctx?H:(null!=this.pFishParamManager&&this.nFECPort==e&&this.pFishParamManager.FreeFECPort(this.nFECPort),this.enDisplayEffect=Y.SR_DE_NULL,0!=this.videoShaderProgram&&null!=this.ctx&&(this.ctx.deleteProgram(this.videoShaderProgram),this.videoShaderProgram=0),0!=this.vertexPosBuffer&&null!=this.ctx&&(this.ctx.deleteBuffer(this.vertexPosBuffer),this.vertexPosBuffer=0),0!=this.texturePosBuffer&&null!=this.ctx&&(this.ctx.deleteBuffer(this.texturePosBuffer),this.texturePosBuffer=0),this.nMaxPointNum=0,this.pLinePosVertices=null,this.pLineClrVertices=null,0!=this.glLinePosBuffer&&null!=this.ctx&&(this.ctx.deleteBuffer(this.glLinePosBuffer),this.glLinePosBuffer=0),0!=this.glLineTexBuffer&&null!=this.ctx&&(this.ctx.deleteBuffer(this.glLineTexBuffer),this.glLineTexBuffer=0),this.nLineTriangleNum=0,0!=this.nLineShaderProgram&&null!=this.ctx&&(this.ctx.deleteProgram(this.nLineShaderProgram),this.nLineShaderProgram=0),this.pFillBlockPosVertices=null,this.pFillBlockClrVertices=null,this.nMaxFillBlockTriNum=0,0!=this.glBlockPosBuffer&&null!=this.ctx&&(this.ctx.deleteBuffer(this.glBlockPosBuffer),this.glBlockPosBuffer=0),0!=this.glBlockClrBuffer&&null!=this.ctx&&(this.ctx.deleteBuffer(this.glBlockClrBuffer),this.glBlockClrBuffer=0),0!=this.nBlockShaderProgram&&null!=this.ctx&&(this.ctx.deleteProgram(this.nBlockShaderProgram),this.nBlockShaderProgram=0),this.nDrawFontWidth=0,this.nDrawFontHeight=0,0!=this.nFontColorTexture&&null!=this.ctx&&(this.ctx.deleteTexture(this.nFontColorTexture),this.nFontColorTexture=0),this.pFontColorBuffer=0,0!=this.nFontShaderProgram&&null!=this.ctx&&(this.ctx.deleteProgram(this.nFontShaderProgram),this.nFontShaderProgram=0),0!=this.nCaptureRTTex&&(this.ctx.deleteTexture(this.nCaptureRTTex),this.nCaptureRTTex=0),0!=this.nCaptureFBO&&(this.ctx.deleteFramebuffer(this.nCaptureFBO),this.nCaptureFBO=0),0!=this.nCaptureDepthbuffer&&(this.ctx.deleteRenderbuffer(this.nCaptureDepthbuffer),this.nCaptureDepthbuffer=0),this.bCaptureResInit=!1,this.pSemiSpherePos=null,this.pSemiSphereTex=null,this.nSemiSpherePosNum=0,this.nSemiSpherePosSize=0,this.nSemiSphereTexSize=0,this.pCylinderPos=null,this.pCylinderTex=null,this.nCylinderPosNum=0,this.nCylinderPosSize=0,this.nCylinderTexSize=0,this.fCylinderHeight=0,this.fCylinderRadius=0,this.pArcSpherePos=null,this.pArcSphereTex=null,this.nArcSpherePosNum=0,this.nArcSpherePosSize=0,this.nArcSphereTexSize=0,this.b3DPort=!1,this.pCamera=null,this.fRotateX=0,this.fRotateY=0,this.fScale=0,this.pfuncCBIn=null,this.pfuncCBOut=null,this.pUserIn=null,this.pUserOut=null,this.ctx.disable(this.ctx.CULL_FACE),this.ctx.disable(this.ctx.DEPTH_TEST),1)}},{key:"SR_GetFishParam",value:function(e){return null==e?V:null==this.pFishParamManager?H:this.pFishParamManager.GetFishParam(this.nFECPort,e)}},{key:"SR_SetFishParam",value:function(e){return null==e?V:null==this.pFishParamManager?H:this.pFishParamManager.SetFishParam(this.nFECPort,e)}},{key:"SR_SetDisplayRect",value:function(e,t,i,n,a){if(null==this.ctx)return H;var r=e,o=t,s=e+i,l=t+n,c=null,d=null;switch(a){case 1:if(this.frameDisplayWidth>0&&this.frameDisplayHeight>0){if(this.fSrcUseLeft=r/this.frameDisplayWidth,this.fSrcUseLeft<0?this.fSrcUseLeft=0:this.fSrcUseLeft>1&&(this.fSrcUseLeft=1),this.fSrcUseTop=o/this.frameDisplayHeight,this.fSrcUseTop<0?this.fSrcUseTop=0:this.fSrcUseTop>1&&(this.fSrcUseTop=1),this.fSrcUseRight=s/this.frameDisplayWidth,this.fSrcUseRight<0?this.fSrcUseRight=0:this.fSrcUseRight>1&&(this.fSrcUseRight=1),this.fSrcUseBottom=l/this.frameDisplayHeight,this.fSrcUseBottom<0?this.fSrcUseBottom=0:this.fSrcUseBottom>1&&(this.fSrcUseBottom=1),this.fSrcUseLeft>=this.fSrcUseRight||this.fSrcUseTop>=this.fSrcUseBottom)return V;c=new Float32Array([this.fSrcUseLeft,this.fSrcUseBottom,this.fSrcUseLeft,this.fSrcUseTop,this.fSrcUseRight,this.fSrcUseTop,this.fSrcUseRight,this.fSrcUseBottom])}else c=new Float32Array([0,1,0,0,1,0,1,1]);this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.texturePosBuffer),this.ctx.bufferSubData(this.ctx.ARRAY_BUFFER,0,c),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),c=null;break;case 2:if(this.frameDisplayWidth>0&&this.frameDisplayHeight>0){if(this.fDstUseLeft=r/this.frameDisplayWidth,this.fDstUseLeft<0?this.fDstUseLeft=0:this.fDstUseLeft>1&&(this.fDstUseLeft=1),this.fDstUseTop=o/this.frameDisplayHeight,this.fDstUseTop<0?this.fDstUseTop=0:this.fDstUseTop>1&&(this.fDstUseTop=1),this.fDstUseRight=s/this.frameDisplayWidth,this.fDstUseRight<0?this.fDstUseRight=0:this.fDstUseRight>1&&(this.fDstUseRight=1),this.fDstUseBottom=l/this.frameDisplayHeight,this.fDstUseBottom<0?this.fDstUseBottom=0:this.fDstUseBottom>1&&(this.fDstUseBottom=1),this.fDstUseLeft>=this.fDstUseRight||this.fDstUseTop>=this.fDstUseBottom)return V;(d=new Float32Array(12))[0]=2*this.fDstUseLeft-1,d[1]=1-2*this.fDstUseBottom,d[2]=0,d[3]=2*this.fDstUseLeft-1,d[4]=1-2*this.fDstUseTop,d[5]=0,d[6]=2*this.fDstUseRight-1,d[7]=1-2*this.fDstUseTop,d[8]=0,d[9]=2*this.fDstUseRight-1,d[10]=1-2*this.fDstUseBottom,d[11]=0,this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.vertexPosBuffer),this.ctx.bufferSubData(this.ctx.ARRAY_BUFFER,0,d),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null),d=null}break;default:return U}return 1}},{key:"SR_Destroy",value:function(){if(null==this.ctx)return H;this.frameDisplayWidth=0,this.frameDisplayHeight=0,this.pFrameData=null;for(var e=0;e<this.nTextureNum;e++)0!=this.nSurfaceTexture[e]&&null!=this.ctx&&(this.ctx.deleteTexture(this.nSurfaceTexture[e]),this.nSurfaceTexture[e]=0);return this.SR_DelSubPort(this.nFECPort),this.ctx.getExtension("WEBGL_lose_context").loseContext(),this.ctx=null,this.onlySupportedWebGL1=!1,this.bAntialias=!1,this.bRecreateTex=!0,this.pFishParamManager=null,1}},{key:"SR_SetCanvasSize",value:function(e,t){return this.canvas.width=e,this.canvas.height=t,1}},{key:"SR_GetCanvasSize",value:function(){return console.log("canvas width:"+this.canvas.width+",height:"+this.canvas.height),1}},{key:"SR_SetAntialias",value:function(e){return 1==this.onlySupportedWebGL1?U:(this.bAntialias!=e&&(this.bRecreateTex=!0,this.bAntialias=e),1)}},{key:"SR_SetPTZDisplayMode",value:function(e){return null==this.pFishParamManager?H:this.pFishParamManager.SetPTZDisplayMode(e)}},{key:"SR_SetFishParamManager",value:function(e){return null!=this.pFishParamManager?U:(this.pFishParamManager=e,1)}},{key:"_CreateSemiSphere",value:function(e,t,i,n){if(null!=this.pSemiSpherePos||null!=this.pSemiSphereTex)return H;this.pSemiSpherePos=new Float32Array(43200),this.pSemiSphereTex=new Float32Array(28800);for(var a=(t-e)/(n-i),r=(t-e)/2*1,o=6.2831852/60,s=.0392699075,l=0,c=0,d=0,u=0;u<60;++u)for(var h=0;h<40;++h){var f=u*o;0==u&&(l=f);var x=59==u?l:(u+1)*o,p=-h*s,m=-(h+1)*s,_=void 0,g=void 0;this.pSemiSpherePos[c]=-1*Math.cos(p)*Math.cos(f),this.pSemiSpherePos[c+1]=1*Math.sin(p),this.pSemiSpherePos[c+2]=-1*Math.cos(p)*Math.sin(f),g=.5-.5*(1+p/1.5707963)*Math.sin(f),_=.5-.5*(1+p/1.5707963)*Math.cos(f),this.pSemiSphereTex[d++]=(2*_*r+1*e)/1,this.pSemiSphereTex[d++]=(2*g*r+i*a)/a,c+=3,this.pSemiSpherePos[c]=-1*Math.cos(m)*Math.cos(f),this.pSemiSpherePos[c+1]=1*Math.sin(m),this.pSemiSpherePos[c+2]=-1*Math.cos(m)*Math.sin(f),g=.5-.5*(1+m/1.5707963)*Math.sin(f),_=.5-.5*(1+m/1.5707963)*Math.cos(f),this.pSemiSphereTex[d++]=(2*_*r+1*e)/1,this.pSemiSphereTex[d++]=(2*g*r+i*a)/a,c+=3,this.pSemiSpherePos[c]=-1*Math.cos(p)*Math.cos(x),this.pSemiSpherePos[c+1]=1*Math.sin(p),this.pSemiSpherePos[c+2]=-1*Math.cos(p)*Math.sin(x),g=.5-.5*(1+p/1.5707963)*Math.sin(x),_=.5-.5*(1+p/1.5707963)*Math.cos(x),this.pSemiSphereTex[d++]=(2*_*r+1*e)/1,this.pSemiSphereTex[d++]=(2*g*r+i*a)/a,c+=3,this.pSemiSpherePos[c]=-1*Math.cos(p)*Math.cos(x),this.pSemiSpherePos[c+1]=1*Math.sin(p),this.pSemiSpherePos[c+2]=-1*Math.cos(p)*Math.sin(x),g=.5-.5*(1+p/1.5707963)*Math.sin(x),_=.5-.5*(1+p/1.5707963)*Math.cos(x),this.pSemiSphereTex[d++]=(2*_*r+1*e)/1,this.pSemiSphereTex[d++]=(2*g*r+i*a)/a,c+=3,this.pSemiSpherePos[c]=-1*Math.cos(m)*Math.cos(f),this.pSemiSpherePos[c+1]=1*Math.sin(m),this.pSemiSpherePos[c+2]=-1*Math.cos(m)*Math.sin(f),g=.5-.5*(1+m/1.5707963)*Math.sin(f),_=.5-.5*(1+m/1.5707963)*Math.cos(f),this.pSemiSphereTex[d++]=(2*_*r+1*e)/1,this.pSemiSphereTex[d++]=(2*g*r+i*a)/a,c+=3,this.pSemiSpherePos[c]=-1*Math.cos(m)*Math.cos(x),this.pSemiSpherePos[c+1]=1*Math.sin(m),this.pSemiSpherePos[c+2]=-1*Math.cos(m)*Math.sin(x),g=.5-.5*(1+m/1.5707963)*Math.sin(x),_=.5-.5*(1+m/1.5707963)*Math.cos(x),this.pSemiSphereTex[d++]=(2*_*r+1*e)/1,this.pSemiSphereTex[d++]=(2*g*r+i*a)/a,c+=3}return this.nSemiSpherePosNum=c/3,this.nSemiSpherePosSize=3,this.nSemiSphereTexSize=2,1}},{key:"_CreateCylinder",value:function(e,t,i,n,a,r,o){if(null!=this.pCylinderPos||null!=this.pCylinderTex)return H;if(Math.abs(r-0)<ne)this.fCylinderHeight=2;else{if(r<.5||r>6)return V;this.fCylinderHeight=r}if(Math.abs(o-0)<ne)this.fCylinderRadius=e==Y.SR_DE_FISH_CYLINDER_FLOOR||e==Y.SR_DE_FISH_CYLINDER_CEILING?2:1;else{if(o<.5||o>4)return V;this.fCylinderRadius=o}if(this.pCylinderPos=new Float32Array(43200),this.pCylinderTex=new Float32Array(28800),null==this.pCylinderPos||null==this.pCylinderTex)return this.pCylinderPos=null,this.pCylinderTex=null,z;for(var s=(i-t)/(a-n),l=(i-t)/2*1,c=6.2831852/60,d=this.fCylinderHeight/40,u=0,h=0,f=0;f<60;++f)for(var x=0;x<40;++x){var p=f*c,m=(f+1)*c,_=void 0,g=void 0;this.pCylinderPos[u]=-this.fCylinderRadius*Math.sin(p),this.pCylinderPos[u+1]=this.fCylinderHeight/2-x*d,this.pCylinderPos[u+2]=-this.fCylinderRadius*Math.cos(p),Y.SR_DE_FISH_CYLINDER_FLOOR==e||Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR==e?(_=.5+(.1+.01*x)*Math.sin(p),g=.5+(.1+.01*x)*Math.cos(p)):(_=.5-(.5-.01*x)*Math.sin(p),g=.5+(.5-.01*x)*Math.cos(p)),this.pCylinderTex[h++]=(2*_*l+1*t)/1,this.pCylinderTex[h++]=(2*g*l+n*s)/s,u+=3,this.pCylinderPos[u]=-this.fCylinderRadius*Math.sin(p),this.pCylinderPos[u+1]=this.fCylinderHeight/2-(x+1)*d,this.pCylinderPos[u+2]=-this.fCylinderRadius*Math.cos(p),Y.SR_DE_FISH_CYLINDER_FLOOR==e||Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR==e?(_=.5+(.1+.01*(x+1))*Math.sin(p),g=.5+(.1+.01*(x+1))*Math.cos(p)):(_=.5-(.5-.01*(x+1))*Math.sin(p),g=.5+(.5-.01*(x+1))*Math.cos(p)),this.pCylinderTex[h++]=(2*_*l+1*t)/1,this.pCylinderTex[h++]=(2*g*l+n*s)/s,u+=3,this.pCylinderPos[u]=-this.fCylinderRadius*Math.sin(m),this.pCylinderPos[u+1]=this.fCylinderHeight/2-x*d,this.pCylinderPos[u+2]=-this.fCylinderRadius*Math.cos(m),Y.SR_DE_FISH_CYLINDER_FLOOR==e||Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR==e?(_=.5+(.1+.01*x)*Math.sin(m),g=.5+(.1+.01*x)*Math.cos(m)):(_=.5-(.5-.01*x)*Math.sin(m),g=.5+(.5-.01*x)*Math.cos(m)),this.pCylinderTex[h++]=(2*_*l+1*t)/1,this.pCylinderTex[h++]=(2*g*l+n*s)/s,u+=3,this.pCylinderPos[u]=-this.fCylinderRadius*Math.sin(m),this.pCylinderPos[u+1]=this.fCylinderHeight/2-x*d,this.pCylinderPos[u+2]=-this.fCylinderRadius*Math.cos(m),Y.SR_DE_FISH_CYLINDER_FLOOR==e||Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR==e?(_=.5+(.1+.01*x)*Math.sin(m),g=.5+(.1+.01*x)*Math.cos(m)):(_=.5-(.5-.01*x)*Math.sin(m),g=.5+(.5-.01*x)*Math.cos(m)),this.pCylinderTex[h++]=(2*_*l+1*t)/1,this.pCylinderTex[h++]=(2*g*l+n*s)/s,u+=3,this.pCylinderPos[u]=-this.fCylinderRadius*Math.sin(p),this.pCylinderPos[u+1]=this.fCylinderHeight/2-(x+1)*d,this.pCylinderPos[u+2]=-this.fCylinderRadius*Math.cos(p),Y.SR_DE_FISH_CYLINDER_FLOOR==e||Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR==e?(_=.5+(.1+.01*(x+1))*Math.sin(p),g=.5+(.1+.01*(x+1))*Math.cos(p)):(_=.5-(.5-.01*(x+1))*Math.sin(p),g=.5+(.5-.01*(x+1))*Math.cos(p)),this.pCylinderTex[h++]=(2*_*l+1*t)/1,this.pCylinderTex[h++]=(2*g*l+n*s)/s,u+=3,this.pCylinderPos[u]=-this.fCylinderRadius*Math.sin(m),this.pCylinderPos[u+1]=this.fCylinderHeight/2-(x+1)*d,this.pCylinderPos[u+2]=-this.fCylinderRadius*Math.cos(m),Y.SR_DE_FISH_CYLINDER_FLOOR==e||Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR==e?(_=.5+(.1+.01*(x+1))*Math.sin(m),g=.5+(.1+.01*(x+1))*Math.cos(m)):(_=.5-(.5-.01*(x+1))*Math.sin(m),g=.5+(.5-.01*(x+1))*Math.cos(m)),this.pCylinderTex[h++]=(2*_*l+1*t)/1,this.pCylinderTex[h++]=(2*g*l+n*s)/s,u+=3}return this.nCylinderPosNum=u/3,this.nCylinderPosSize=3,this.nCylinderTexSize=2,1}},{key:"_CreateArcSphere",value:function(e,t,i,n,a){if(null!=this.pArcSpherePos||null!=this.pArcSphereTex)return H;if(e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL){if(n>0||a<1)return SR_ERR_PARAM}else{if(e!=Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL)return U;if(t>0||i<1)return SR_ERR_PARAM}this.fImageWidth=1,this.fImageHeight=(i-t)/(a-n),this.fTexCenterX=(t+i)/2*this.fImageWidth,this.fTexCenterY=(n+a)/2*this.fImageHeight,this.fTexRadius=(i-t)/2*this.fImageWidth;if(null==this.pArcSphereTex&&(this.pArcSphereTex=new Float32Array(14688),null==this.pArcSphereTex))return z;if(null==this.pArcSpherePos&&(this.pArcSpherePos=new Float32Array(22032),null==this.pArcSpherePos))return z;var r=new Float32Array(64);if(null==r)return z;var o=1;if(e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?o=this._ComputeLatitudeHorizontal(r,25,40,1):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&(o=this._ComputeLatitudeVertical(r,25,40,1)),1!=o)return this.pArcSpherePos=null,this.pArcSphereTex=null,o;this.fFirstLatitude=r[12],this.fLastLatitude=r[51];var s=0,l=0,c=new Float32Array(5);if(null==c)return this.pArcSpherePos=null,this.pArcSphereTex=null,z;for(var d=ae/24,u=-12;u<12;++u)for(var h=u<0?-u:u,f=u<0?h:h+1,x=u<0?64-2*(h-1)-2:64-2*h-2,p=0;p<x;++p,++f)e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?this._ComputeVertexAndTexturePosHorizontal(1,1.5707963-d*u,r[f],c):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&this._ComputeVertexAndTexturePosVertical(1,1.5707963-d*u,r[f],c),this.pArcSpherePos[s]=c[0],this.pArcSpherePos[s+1]=c[1],this.pArcSpherePos[s+2]=c[2],this.pArcSphereTex[l++]=c[3],this.pArcSphereTex[l++]=c[4],s+=3,e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?this._ComputeVertexAndTexturePosHorizontal(1,1.5707963-d*(u+1),r[f],c):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&this._ComputeVertexAndTexturePosVertical(1,1.5707963-d*(u+1),r[f],c),this.pArcSpherePos[s]=c[0],this.pArcSpherePos[s+1]=c[1],this.pArcSpherePos[s+2]=c[2],this.pArcSphereTex[l++]=c[3],this.pArcSphereTex[l++]=c[4],s+=3,u>=0&&0==p?e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?this._ComputeVertexAndTexturePosHorizontal(1,1.5707963-d*u,r[f-1],c):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&this._ComputeVertexAndTexturePosVertical(1,1.5707963-d*u,r[f-1],c):e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?this._ComputeVertexAndTexturePosHorizontal(1,1.5707963-d*(u+1),r[f-1],c):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&this._ComputeVertexAndTexturePosVertical(1,1.5707963-d*(u+1),r[f-1],c),this.pArcSpherePos[s]=c[0],this.pArcSpherePos[s+1]=c[1],this.pArcSpherePos[s+2]=c[2],this.pArcSphereTex[l++]=c[3],this.pArcSphereTex[l++]=c[4],s+=3,e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?this._ComputeVertexAndTexturePosHorizontal(1,1.5707963-d*(u+1),r[f],c):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&this._ComputeVertexAndTexturePosVertical(1,1.5707963-d*(u+1),r[f],c),this.pArcSpherePos[s]=c[0],this.pArcSpherePos[s+1]=c[1],this.pArcSpherePos[s+2]=c[2],this.pArcSphereTex[l++]=c[3],this.pArcSphereTex[l++]=c[4],s+=3,e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?this._ComputeVertexAndTexturePosHorizontal(1,1.5707963-d*u,r[f],c):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&this._ComputeVertexAndTexturePosVertical(1,1.5707963-d*u,r[f],c),this.pArcSpherePos[s]=c[0],this.pArcSpherePos[s+1]=c[1],this.pArcSpherePos[s+2]=c[2],this.pArcSphereTex[l++]=c[3],this.pArcSphereTex[l++]=c[4],s+=3,u<0&&p==x-1?e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?this._ComputeVertexAndTexturePosHorizontal(1,1.5707963-d*(u+1),r[f+1],c):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&this._ComputeVertexAndTexturePosVertical(1,1.5707963-d*(u+1),r[f+1],c):e==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?this._ComputeVertexAndTexturePosHorizontal(1,1.5707963-d*u,r[f+1],c):e==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL&&this._ComputeVertexAndTexturePosVertical(1,1.5707963-d*u,r[f+1],c),this.pArcSpherePos[s]=c[0],this.pArcSpherePos[s+1]=c[1],this.pArcSpherePos[s+2]=c[2],this.pArcSphereTex[l++]=c[3],this.pArcSphereTex[l++]=c[4],s+=3;return this.nArcSpherePosNum=s/3,this.nArcSpherePosSize=3,this.nArcSphereTexSize=2,r=null,c=null,1}},{key:"_ComputeIntersectionOfPlaneAndLongtitude",value:function(e,t,i){if(null==e)return V;var n,a=e[1]*i,r=e[2]*i*Math.sin(t),o=-e[3],s=0;if(e[1]>0){var l=a*a*o*o-(a*a+r*r)*(o*o-r*r);s=(-a*o-Math.sqrt(l))/(a*a+r*r),l=r*r*o*o-(a*a+r*r)*(o*o-a*a)}if(e[1]<0){var c=a*a*o*o-(a*a+r*r)*(o*o-r*r);s=(-a*o+Math.sqrt(c))/(a*a+r*r),c=r*r*o*o-(a*a+r*r)*(o*o-a*a)}return n=-i*s,Math.asin(n/i)}},{key:"_ComputeLatitudeHorizontal",value:function(e,t,i,n){if(null==e)return V;var a=0,r=(this.fTexCenterY,ae/(t-1)),o=ae*this.fTexCenterY/(2*this.fTexRadius),s=Math.asin(this.fTexCenterY/this.fTexRadius),l=Math.atan(Math.cos(o)/(Math.sin(o)-Math.sin(s))),c=new Float32Array(4);c[0]=0,c[1]=Math.sin(l),c[2]=Math.cos(l),c[3]=-n*Math.sin(l)*Math.sin(s),e[a++]=o;for(var d=1;d<=(t-3)/2;++d){var u=this._ComputeIntersectionOfPlaneAndLongtitude(c,1.5707963-r*d,n);e[a++]=u}for(var h=-Math.asin((this.fImageHeight-this.fTexCenterY)/this.fTexRadius),f=s,x=(f-h)/(i-1),p=0;p<i;++p)e[a++]=f-p*x;var m=h,_=ae*(this.fTexCenterY-this.fImageHeight)/(2*this.fTexRadius);l=Math.atan(Math.cos(_)/(Math.sin(m)-Math.sin(_)));var g=new Float32Array(4);g[0]=0,g[1]=-Math.sin(l),g[2]=Math.cos(l),g[3]=n*Math.sin(l)*Math.sin(m);for(var v=1;v<=(t-3)/2;++v){var y=this._ComputeIntersectionOfPlaneAndLongtitude(g,r*v,n);e[a++]=y}return e[a++]=_,c=null,g=null,1}},{key:"_ComputeVertexAndTexturePosHorizontal",value:function(e,t,i,n){if(null==n)return V;n[2]=-e*Math.cos(i)*Math.sin(t),n[0]=e*Math.cos(i)*Math.cos(t),n[1]=e*Math.sin(i);var a,r=-Math.asin(-n[2]/e)/ae;a=i>=0?Math.acos(n[0]/Math.sqrt(n[0]*n[0]+n[1]*n[1])):6.2831852-Math.acos(n[0]/Math.sqrt(n[0]*n[0]+n[1]*n[1]));var o=this.fTexCenterX-this.fTexRadius,s=this.fTexRadius-this.fTexCenterY;return n[3]=(Math.cos(a)*this.fTexRadius*(1+2*r)+this.fTexRadius+o)/this.fImageWidth,n[4]=(Math.sin(a)*this.fTexRadius*(-1-2*r)+this.fTexRadius-s)/this.fImageHeight,1}},{key:"_ComputeLatitudeVertical",value:function(e,t,i,n){if(null==e)return SR_ERR_PARAM;var a=0,r=ae/(t-1),o=ae*this.fTexCenterX/(2*this.fTexRadius),s=Math.asin(this.fTexCenterX/this.fTexRadius),l=Math.atan(Math.cos(o)/(Math.sin(o)-Math.sin(s))),c=new Float32Array(4);c[0]=0,c[1]=Math.sin(l),c[2]=Math.cos(l),c[3]=-n*Math.sin(l)*Math.sin(s),e[a++]=o;for(var d=1;d<=(t-3)/2;++d){var u=this._ComputeIntersectionOfPlaneAndLongtitude(c,1.5707963-r*d,n);e[a++]=u}for(var h=-Math.asin((this.fImageWidth-this.fTexCenterX)/this.fTexRadius),f=s,x=(f-h)/(i-1),p=0;p<i;++p)e[a++]=f-p*x;var m=h,_=ae*(this.fTexCenterX-this.fImageWidth)/(2*this.fTexRadius);l=Math.atan(Math.cos(_)/(Math.sin(m)-Math.sin(_)));var g=new Float32Array(4);g[0]=0,g[1]=-Math.sin(l),g[2]=Math.cos(l),g[3]=n*Math.sin(l)*Math.sin(m);for(var v=1;v<=(t-3)/2;++v){var y=this._ComputeIntersectionOfPlaneAndLongtitude(g,r*v,n);e[a++]=y}return e[a++]=_,c=null,g=null,1}},{key:"_ComputeVertexAndTexturePosVertical",value:function(e,t,i,n){if(null==n)return SR_ERR_PARAM;n[2]=-e*Math.cos(i)*Math.sin(t),n[1]=e*Math.cos(i)*Math.cos(t),n[0]=-e*Math.sin(i);var a,r=-Math.asin(-n[2]/e)/ae;a=t<=1.5707963?Math.acos(n[0]/Math.sqrt(n[0]*n[0]+n[1]*n[1])):6.2831852-Math.acos(n[0]/Math.sqrt(n[0]*n[0]+n[1]*n[1]));var o=this.fTexCenterX-this.fTexRadius,s=this.fTexRadius-this.fTexCenterY;return n[3]=(Math.cos(a)*this.fTexRadius*(1+2*r)+this.fTexRadius+o)/this.fImageWidth,n[4]=(Math.sin(a)*this.fTexRadius*(-1-2*r)+this.fTexRadius-s)/this.fImageHeight,1}},{key:"InitCamera",value:function(e){if(null!=this.pCamera)return SR_ERR_CALL_ORDER;switch(e){case Y.SR_DE_NULL:case Y.SR_DE_FISH_ORIGINAL:case Y.SR_DE_FISH_PTZ_CEILING:case Y.SR_DE_FISH_PTZ_FLOOR:case Y.SR_DE_FISH_PTZ_WALL:case Y.SR_DE_FISH_PANORAMA_CEILING_360:case Y.SR_DE_FISH_PANORAMA_CEILING_180:case Y.SR_DE_FISH_PANORAMA_FLOOR_360:case Y.SR_DE_FISH_PANORAMA_FLOOR_180:case Y.SR_DE_FISH_PANORAMA_WALL:return 1;case Y.SR_DE_FISH_SEMISPHERE:if(this.pCamera=new ge,null==this.pCamera)return z;this.pCamera.SetFov(se),this.pCamera.SetNear(re),this.pCamera.SetFar(oe),this.fRotateX=1.57,this.pCamera.SetPitch(3.14-this.fRotateX),this.fScale=3,this.pCamera.SetScale(this.fScale);break;case Y.SR_DE_FISH_CYLINDER_CEILING:case Y.SR_DE_FISH_CYLINDER_FLOOR:if(this.pCamera=new ge,null==this.pCamera)return z;this.pCamera.SetFov(se),this.pCamera.SetNear(re),this.pCamera.SetFar(oe),this.fRotateX=.785,this.pCamera.SetPitch(-this.fRotateX),this.fScale=6,this.pCamera.SetScale(this.fScale);break;case Y.SR_DE_FISH_CYLINDER_SPLIT_CEILING:case Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR:if(this.pCamera=new ge,null==this.pCamera)return z;this.pCamera.SetOrtho(!0),this.pCamera.SetNear(re),this.pCamera.SetFar(oe),this.fScale=3,this.pCamera.SetScale(this.fScale);break;case Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL:case Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL:if(this.pCamera=new ge,null==this.pCamera)return z;this.pCamera.SetFov(se),this.pCamera.SetNear(re),this.pCamera.SetFar(oe),this.fScale=2,this.pCamera.SetScale(this.fScale),Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL==e?(this.fRotateLimitX=ce,this.fRotateLimitY=de):(this.fRotateLimitX=ue,this.fRotateLimitY=he);break;default:return U}return 1}},{key:"SR_SetViewParam",value:function(e,t){if(!this.b3DPort)return U;switch(e){case 1:if((this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL||this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL)&&(t>this.fRotateLimitX||t<-this.fRotateLimitX))return V;this.fRotateX=t;break;case 2:if((this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL||this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL)&&(t>this.fRotateLimitY||t<-this.fRotateLimitY))return V;this.fRotateY=t;break;case 3:if(this.enDisplayEffect==Y.SR_DE_FISH_SEMISPHERE){if(t<-.8||t>900)return V}else if(this.enDisplayEffect==Y.SR_DE_FISH_CYLINDER_FLOOR||this.enDisplayEffect==Y.SR_DE_FISH_CYLINDER_CEILING){if(t<0||t>900)return V}else if(this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL||this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL){if(t<-.3||t>5)return V;this._ComputeRotateLimits()}this.fScale=t;break;default:return U}return 1}},{key:"SR_GetViewParam",value:function(e,t){if(!this.b3DPort)return H;var i=0;switch(e){case 1:i=this.fRotateX;break;case 2:i=this.fRotateY;break;case 3:i=this.fScale;break;default:return U}return t.fValue=i,1}},{key:"SR_SetCallBack",value:function(e,t,i){switch(i){case 0:this.pfuncCBIn=e,this.pUserIn=t;break;case 1:this.pfuncCBOut=e,this.pUserOut=t;break;default:return U}return 1}},{key:"SR_SetRenderState",value:function(e,t){switch(e){case 1:if(this.b3DPort)return U;break;case 2:if(!this.b3DPort)return U;Math.abs(t-0)<ne?this.bCullBack=!1:this.bCullBack=!0;break;default:return U}return 1}},{key:"SR_SetPTZColor",value:function(e,t){return null==this.pFishParamManager?H:this.pFishParamManager.SetPTZColor(e,t)}},{key:"SR_GetPTZColor",value:function(e,t){return null==this.pFishParamManager?H:this.pFishParamManager.GetPTZColor(e,t)}},{key:"SR_SetPTZPort",value:function(e){return null==this.pFishParamManager?H:this.pFishParamManager.SetPTZPort(e)}},{key:"SR_GetPTZPort",value:function(e,t,i){return null==this.pFishParamManager?H:null==i?V:this.pFishParamManager.GetPTZPort(e,t,i)}},{key:"SR_GetCaptureSize",value:function(e){if(null==e)return V;if(null==this.ctx)return H;if(null==e.nWidth||null==e.nWidth||null==e.nHeight||null==e.nHeight)return V;var t=0,i=0;if(0==e.nWidth&&0==e.nHeight)switch(this.enDisplayEffect){case Y.SR_DE_FISH_PTZ_WALL:case Y.SR_DE_FISH_PTZ_CEILING:case Y.SR_DE_FISH_PTZ_FLOOR:t=Math.round(5*this.frameDisplayHeight/8),i=Math.round(3*t/4);break;case Y.SR_DE_NULL:t=Math.round((this.fSrcUseRight-this.fSrcUseLeft)*this.frameDisplayWidth),i=Math.round((this.fSrcUseBottom-this.fSrcUseTop)*this.frameDisplayHeight);break;case Y.SR_DE_FISH_ORIGINAL:case Y.SR_DE_FISH_SEMISPHERE:case Y.SR_DE_FISH_CYLINDER_CEILING:case Y.SR_DE_FISH_CYLINDER_FLOOR:case Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL:case Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL:t=Math.round(this.frameDisplayWidth),i=Math.round(this.frameDisplayHeight);break;case Y.SR_DE_FISH_PANORAMA_FLOOR_360:case Y.SR_DE_FISH_PANORAMA_CEILING_360:this.frameDisplayHeight>=2048?(t=6144,i=864):this.frameDisplayHeight>=1536&&2048>this.frameDisplayHeight?(t=4096,i=576):(t=Math.round(3.14*this.frameDisplayHeight/1.6),i=Math.round(9*this.frameDisplayWidth/16),t=Math.round(2*t),i=Math.round(i/2));break;case Y.SR_DE_FISH_PANORAMA_FLOOR_180:case Y.SR_DE_FISH_PANORAMA_CEILING_180:this.frameDisplayHeight>=3072?(t=4096,i=2304):this.frameDisplayHeight>=2048&&3072>this.frameDisplayHeight?(t=3072,i=1728):this.frameDisplayHeight>=1536&&2048>this.frameDisplayHeight?(t=2048,i=1152):(t=Math.round(3.14*this.frameDisplayHeight/1.6),i=Math.round(9*t/16));break;case Y.SR_DE_FISH_PANORAMA_WALL:t=Math.round(this.frameDisplayHeight),i=Math.round(9*t/16);break;default:return V}else t=Math.round(e.nWidth),i=Math.round(e.nHeight);return t<16||i<16?V:(this.nCaptureWidth=4*Math.round(t/4),this.nCaptureHeight=Math.round(i),e.nWidth=this.nCaptureWidth,e.nHeight=this.nCaptureHeight,e.nBufferLen=this.nCaptureWidth*this.nCaptureHeight*4,1)}},{key:"SR_CaptureScreen",value:function(e){var t=1;if(1!=(t=this._BeginCapture()))return t;if(0==this.videoShaderProgram||0==this.vertexPosBuffer||0==this.texturePosBuffer)return H;this.ctx.useProgram(this.videoShaderProgram),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.vertexPosBuffer);var i=this.ctx.getAttribLocation(this.videoShaderProgram,"xy");if(i<0)return W;this.ctx.vertexAttribPointer(i,3,this.ctx.FLOAT,!1,0,0),this.ctx.enableVertexAttribArray(i),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.texturePosBuffer);var n=this.ctx.getAttribLocation(this.videoShaderProgram,"uv");if(n<0)return W;this.ctx.vertexAttribPointer(n,2,this.ctx.FLOAT,!1,0,0),this.ctx.enableVertexAttribArray(n),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null);var a=this.enDisplayEffect,r=this.ctx.getUniformLocation(this.videoShaderProgram,"bCapture");if(r<=0)return W;switch(this.ctx.uniform1i(r,1),a){case Y.SR_DE_NULL:break;case Y.SR_DE_FISH_ORIGINAL:case Y.SR_DE_FISH_PTZ_CEILING:case Y.SR_DE_FISH_PTZ_FLOOR:case Y.SR_DE_FISH_PTZ_WALL:case Y.SR_DE_FISH_PANORAMA_CEILING_360:case Y.SR_DE_FISH_PANORAMA_CEILING_180:case Y.SR_DE_FISH_PANORAMA_FLOOR_360:case Y.SR_DE_FISH_PANORAMA_FLOOR_180:case Y.SR_DE_FISH_PANORAMA_WALL:if(null==this.pFishParamManager)return H;var o={};if(1!=(t=this.pFishParamManager.GetRenderParam(this.nFECPort,o)))return t;if(Y.SR_DE_FISH_ORIGINAL==a){var s=this.ctx.getUniformLocation(this.videoShaderProgram,"bBlack");if(s<=0)return W;this.ctx.uniform1i(s,o.bBlack);var l=this.ctx.getUniformLocation(this.videoShaderProgram,"bCut");if(l<=0)return W;this.ctx.uniform1i(l,o.bCut)}if(Y.SR_DE_FISH_PTZ_CEILING==a||Y.SR_DE_FISH_PTZ_FLOOR==a||Y.SR_DE_FISH_PTZ_WALL==a){var c=this.ctx.getUniformLocation(this.videoShaderProgram,"fHAngleCos");if(c<=0)return W;this.ctx.uniform1f(c,o.fCosH);var d=this.ctx.getUniformLocation(this.videoShaderProgram,"fHAngleSin");if(d<=0)return W;this.ctx.uniform1f(d,o.fSinH);var u=this.ctx.getUniformLocation(this.videoShaderProgram,"fVAngleCos");if(u<=0)return W;this.ctx.uniform1f(u,o.fCosV);var h=this.ctx.getUniformLocation(this.videoShaderProgram,"fVAngleSin");if(h<=0)return W;this.ctx.uniform1f(h,o.fSinV);var f=this.ctx.getUniformLocation(this.videoShaderProgram,"fZoom");if(f<=0)return W;this.ctx.uniform1f(f,o.fZoom)}if(Y.SR_DE_FISH_PANORAMA_CEILING_360==a||Y.SR_DE_FISH_PANORAMA_CEILING_180==a||Y.SR_DE_FISH_PANORAMA_FLOOR_360==a||Y.SR_DE_FISH_PANORAMA_FLOOR_180==a){var x=this.ctx.getUniformLocation(this.videoShaderProgram,"fAngle");if(x<=0)return W;this.ctx.uniform1f(x,o.fAngle)}var p=this.ctx.getUniformLocation(this.videoShaderProgram,"fRX1");if(p<=0)return W;this.ctx.uniform1f(p,o.fRXLeft);var m=this.ctx.getUniformLocation(this.videoShaderProgram,"fRX2");if(m<=0)return W;this.ctx.uniform1f(m,o.fRXRight);var _=this.ctx.getUniformLocation(this.videoShaderProgram,"fRY1");if(_<=0)return W;this.ctx.uniform1f(_,o.fRYTop);var g=this.ctx.getUniformLocation(this.videoShaderProgram,"fRY2");if(g<=0)return W;this.ctx.uniform1f(g,o.fRYBottom);break;case Y.SR_DE_FISH_SEMISPHERE:this.pCamera.SetScale(this.fScale),this.pCamera.SetPitch(3.14-this.fRotateX),this.pCamera.SetYaw(-this.fRotateY),this.pCamera.UpdateCamera(this.canvas.width,this.canvas.height);var v=this.pCamera.GetView(),y=this.pCamera.GetProj(),S=this.ctx.getUniformLocation(this.videoShaderProgram,"matView");if(S<=0)return W;this.ctx.uniformMatrix4fv(S,!1,v);var b=this.ctx.getUniformLocation(this.videoShaderProgram,"matProj");if(b<=0)return W;this.ctx.uniformMatrix4fv(b,!1,y);break;case Y.SR_DE_FISH_CYLINDER_CEILING:case Y.SR_DE_FISH_CYLINDER_FLOOR:case Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL:case Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL:this.pCamera.SetScale(this.fScale),this.pCamera.SetPitch(-this.fRotateX),this.pCamera.SetYaw(-this.fRotateY),this.pCamera.UpdateCamera(this.canvas.width,this.canvas.height);var P=this.pCamera.GetView(),E=this.pCamera.GetProj(),C=this.ctx.getUniformLocation(this.videoShaderProgram,"matView");if(C<=0)return W;this.ctx.uniformMatrix4fv(C,!1,P);var T=this.ctx.getUniformLocation(this.videoShaderProgram,"matProj");if(T<=0)return W;this.ctx.uniformMatrix4fv(T,!1,E);break;default:return U}if(this.nCaptureWidth<=0||this.nCaptureHeight<=0)return G;if(this.ctx.viewport(0,0,this.nCaptureWidth,this.nCaptureHeight),this.ctx.clearColor(0,0,0,1),this.ctx.clear(this.ctx.COLOR_BUFFER_BIT|this.ctx.DEPTH_BUFFER_BIT),this.b3DPort&&(this.ctx.enable(this.ctx.DEPTH_TEST),this.ctx.depthFunc(this.ctx.LESS),this.ctx.depthMask(!0),1==this.bCullBack?this.ctx.enable(this.ctx.CULL_FACE):this.ctx.disable(this.ctx.CULL_FACE)),this.enPixelFormat==X?this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[0]):(1==this.enPixelFormat||3==this.enPixelFormat)&&(this.ctx.activeTexture(this.ctx.TEXTURE0),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[0]),this.ctx.activeTexture(this.ctx.TEXTURE1),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[1]),this.ctx.activeTexture(this.ctx.TEXTURE2),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nSurfaceTexture[2])),this.onlySupportedWebGL1||this.ctx.clearBufferfi(this.ctx.DEPTH_STENCIL,0,1,0),0==this.b3DPort)this.ctx.drawArrays(this.ctx.TRIANGLE_FAN,0,4);else if(this.enDisplayEffect==Y.SR_DE_FISH_SEMISPHERE){if(this.nSemiSpherePosNum<=0)return H;this.ctx.drawArrays(this.ctx.TRIANGLES,0,this.nSemiSpherePosNum)}else if(this.enDisplayEffect==Y.SR_DE_FISH_CYLINDER_CEILING||this.enDisplayEffect==Y.SR_DE_FISH_CYLINDER_FLOOR){if(this.nCylinderPosNum<=0)return H;this.ctx.drawArrays(this.ctx.TRIANGLES,0,this.nCylinderPosNum)}else if(this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL||this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL){if(this.nArcSpherePosNum<=0)return H;this.ctx.drawArrays(this.ctx.TRIANGLES,0,this.nArcSpherePosNum)}return this.ctx.useProgram(null),null!=this.pfuncCBIn&&this.pfuncCBIn(this.pUserIn),null!=this.pfuncCBOut&&this.pfuncCBOut(this.pUserOut),1!=(t=this._EndCapture(e))?t:1}},{key:"SR_SetImagePostProcess",value:function(e,t){if(null==this.ctx)return H;if(5==e||2==e){if(0-t>ne||t-1>ne)return V}else if((1==e||3==e||4==e)&&(-1-t>ne||t-1>ne))return V;switch(e){case 1:this.fBrightness=t;break;case 2:this.fHue=t;break;case 3:this.fSaturation=t;break;case 4:this.fContrast=t;break;case 5:this.fSharpness=t;break;default:return U}return Math.abs(this.fBrightness-0)<ne&&Math.abs(this.fHue-0)<ne&&Math.abs(this.fSaturation-0)<ne&&Math.abs(this.fContrast-0)<ne&&Math.abs(this.fSharpness-0)<ne?this.nPostProc=0:this.nPostProc=1,1}},{key:"_BeginCapture",value:function(){var e=1;return 0==this.bCaptureResInit&&1!=(e=this._InitRenderTarget(this.nCaptureWidth,this.nCaptureHeight,!1,!0))?e:1!=(e=this._Resize(this.nCaptureWidth,this.nCaptureHeight,!1,!0))?e:(this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER,this.nCaptureFBO),this.bIsCapturing=!0,1)}},{key:"_InitRenderTarget",value:function(e,t,i,n){if(0!=this.nCaptureRTTex||0!=this.nCaptureFBO)return H;if(e<=0||t<=0)return V;if(this.nCaptureRTTex=this.ctx.createTexture(),this.nCaptureRTTex<=0)return W;if(this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nCaptureRTTex),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,e,t,0,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,null),0==this.nCaptureFBO&&(this.nCaptureFBO=this.ctx.createFramebuffer(),this.nCaptureFBO<=0))return W;if(this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER,this.nCaptureFBO),this.ctx.framebufferTexture2D(this.ctx.FRAMEBUFFER,this.ctx.COLOR_ATTACHMENT0,this.ctx.TEXTURE_2D,this.nCaptureRTTex,0),1==n&&0==this.nCaptureDepthbuffer){if(this.nCaptureDepthbuffer=this.ctx.createRenderbuffer(),this.nCaptureDepthbuffer<=0)return W;this.ctx.bindRenderbuffer(this.ctx.RENDERBUFFER,this.nCaptureDepthbuffer),this.ctx.renderbufferStorage(this.ctx.RENDERBUFFER,this.ctx.DEPTH_COMPONENT16,e,t),this.ctx.framebufferRenderbuffer(this.ctx.FRAMEBUFFER,this.ctx.DEPTH_ATTACHMENT,this.ctx.RENDERBUFFER,this.nCaptureDepthbuffer)}return this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER,null),this.nCaptureFBOWidth=e,this.nCaptureFBOHeight=t,this.bCaptureResInit=!0,1}},{key:"_Resize",value:function(e,t,i,n){if(this.nCaptureFBOWidth!=e||this.nCaptureFBOHeight!=t){if(this.nCaptureFBOWidth=e,this.nCaptureFBOHeight=t,0!=this.nCaptureRTTex&&(this.ctx.deleteTexture(this.nCaptureRTTex),this.nCaptureRTTex=0),0!=this.nCaptureDepthbuffer&&(this.ctx.deleteRenderbuffer(this.nCaptureDepthbuffer),this.nCaptureDepthbuffer=0),0==this.nCaptureRTTex&&(this.nCaptureRTTex=this.ctx.createTexture(),this.nCaptureRTTex<=0))return W;if(this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.nCaptureRTTex),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.LINEAR),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,this.ctx.CLAMP_TO_EDGE),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,this.ctx.CLAMP_TO_EDGE),this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,this.nCaptureFBOWidth,this.nCaptureFBOHeight,0,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,null),this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER,this.nCaptureFBO),this.ctx.framebufferTexture2D(this.ctx.FRAMEBUFFER,this.ctx.COLOR_ATTACHMENT0,this.ctx.TEXTURE_2D,this.nCaptureRTTex,0),1==n&&0==this.nCaptureDepthbuffer){if(this.nCaptureDepthbuffer=this.ctx.createRenderbuffer(),this.nCaptureDepthbuffer<=0)return W;this.ctx.bindRenderbuffer(this.ctx.RENDERBUFFER,this.nCaptureDepthbuffer),this.ctx.renderbufferStorage(this.ctx.RENDERBUFFER,this.ctx.DEPTH_COMPONENT16,e,t),this.ctx.framebufferRenderbuffer(this.ctx.FRAMEBUFFER,this.ctx.DEPTH_ATTACHMENT,this.ctx.RENDERBUFFER,this.nCaptureDepthbuffer)}this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER,null)}return 1}},{key:"_EndCapture",value:function(e){return null==this.ctx?H:null==e.pBuffer||null==e.pBuffer?V:(this.ctx.readPixels(0,0,this.nCaptureWidth,this.nCaptureHeight,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,e.pBuffer),this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER,null),this.bIsCapturing=!1,1)}},{key:"_ResizeFrameData",value:function(e,t,i,n){if(0==t%8&&null==n)return this.frameDisplayWidth=Math.round(t),this.frameDisplayHeight=Math.round(i),this.pFrameData=e,1;if(null!=n&&0==n.nCropBottom&&0==n.nCropLeft&&0==n.nCropRight&&0==n.nCropTop&&0==t%8)return this.frameDisplayWidth=Math.round(t),this.frameDisplayHeight=Math.round(i),this.pFrameData=e,1;if((null==this.pFrameData||this.frameDisplayWidth!=t/8*8||this.frameDisplayHeight!=i)&&(this.frameDisplayWidth=8*Math.round(t/8),this.frameDisplayHeight=Math.round(i),this.pFrameData=null,this.pFrameData=new Uint8Array(this.frameDisplayWidth*this.frameDisplayHeight*3/2),null==this.pFrameData))return z;var a=0,r=0,o=Math.round(n.nCodeWidth),s=Math.round(n.nCodeHeight),l=0;if(1==this.enPixelFormat||3==this.enPixelFormat){var c,d,u;null!=n?(a=Math.round(n.nCropLeft),r=Math.round(n.nCropTop),c=e.subarray(a*o+r,o*s),d=e.subarray(o*s+r*o/4+a/2,o*s*5/4),u=e.subarray(o*s*5/4+r*o/4+a/2,o*s*3/2),l=o):(c=e.subarray(0,t*i),d=e.subarray(t*i,t*i*5/4),u=e.subarray(t*i*5/4,t*i*3/2),l=this.frameDisplayWidth);for(var h=null,f=0;f<this.frameDisplayHeight;++f){var x=Math.round(f*l),p=Math.round(f*l+this.frameDisplayWidth);h=c.slice(x,p);var m=Math.round(f*this.frameDisplayWidth);this.pFrameData.set(h,m)}for(var _=0;_<this.frameDisplayHeight/2;++_){var g=Math.round(_*l/2),v=Math.round(_*l/2+this.frameDisplayWidth/2);h=d.slice(g,v);var y=Math.round(this.frameDisplayWidth*this.frameDisplayHeight+_*this.frameDisplayWidth/2);this.pFrameData.set(h,y)}for(var S=0;S<this.frameDisplayHeight/2;++S){var b=Math.round(S*l/2),P=Math.round(S*l/2+this.frameDisplayWidth/2);h=u.slice(b,P);var E=Math.round(this.frameDisplayWidth*this.frameDisplayHeight*5/4+S*this.frameDisplayWidth/2);this.pFrameData.set(h,E)}c=null,d=null,u=null,h=null}else if(2==this.enPixelFormat){var C,T,R;null!=n?(a=Math.round(n.nCropLeft),r=Math.round(n.nCropTop),C=e.subarray(r*o+a,o*s),T=e.subarray(o*s+r*o/4+a/2,o*s*3/2),l=Math.round(n.nCodeWidth)):(C=e.subarray(0,o*s),T=e.subarray(o*s,o*s*3/2),l=this.frameDisplayWidth);for(var w=0;w<this.frameDisplayHeight;++w){var I=Math.round(w*l),D=Math.round(w*l+this.frameDisplayWidth);R=C.slice(I,D);var k=Math.round(w*this.frameDisplayWidth);this.pFrameData.set(R,k)}for(var F=0;F<this.frameDisplayHeight/2;++F){var A=Math.round(F*l),M=Math.round(F*l+this.frameDisplayWidth);R=T.slice(A,M);var L=Math.round(this.frameDisplayWidth*this.frameDisplayHeight+F*this.frameDisplayWidth);this.pFrameData.set(R,L)}C=null,T=null,R=null}return 1}},{key:"_SetImagePostProcess",value:function(){var e=this.ctx.getUniformLocation(this.videoShaderProgram,"fBrightness");if(e<=0)return W;this.ctx.uniform1f(e,this.fBrightness);var t=this.ctx.getUniformLocation(this.videoShaderProgram,"fHue");if(t<=0)return W;this.ctx.uniform1f(t,this.fHue);var i=this.ctx.getUniformLocation(this.videoShaderProgram,"fSaturation");if(i<=0)return W;this.ctx.uniform1f(i,this.fSaturation);var n=this.ctx.getUniformLocation(this.videoShaderProgram,"fContrast");if(n<=0)return W;this.ctx.uniform1f(n,this.fContrast);var a=this.ctx.getUniformLocation(this.videoShaderProgram,"fSharpness");if(a<=0)return W;this.ctx.uniform1f(a,this.fSharpness);var r=this.ctx.getUniformLocation(this.videoShaderProgram,"fWndWidth");if(r<=0)return W;this.ctx.uniform1f(r,this.frameDisplayWidth);var o=this.ctx.getUniformLocation(this.videoShaderProgram,"fWndHeight");return o<=0?W:(this.ctx.uniform1f(o,this.frameDisplayHeight),1)}},{key:"_ComputeRotateLimits",value:function(){if(this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL||this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL){var e,t;if(this.enDisplayEffect==Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL?(e=ce,t=de):(e=ue,t=he),0==this.canvas.width||0==this.canvas.height)this.fRotateLimitX=e,this.fRotateLimitY=t;else{var i=Math.tan(2.748893525);if(Math.abs(i*this.fScale)<1){var n=i*i+1,a=-2*i*i*this.fScale,r=i*i*this.fScale*this.fScale-1,o=(-a-Math.sqrt(a*a-4*n*r))/(2*n),s=i*(o-this.fScale);this.fRotateLimitX=Math.acos(s/Math.sqrt(o*o+s*s)),this.fRotateLimitX<e&&(this.fRotateLimitX=e)}else this.fRotateLimitX=e;var l=Math.atan(this.canvas.width/this.canvas.height*Math.tan(se/2));if(i=Math.tan(ae-l),Math.abs(i*this.fScale)<1){var c=i*i+1,d=-2*i*i*this.fScale,u=i*i*this.fScale*this.fScale-1,h=(-d-Math.sqrt(d*d-4*c*u))/(2*c),f=i*(h-this.fScale);this.fRotateLimitY=Math.acos(f/Math.sqrt(h*h+f*f)),this.fRotateLimitY<t&&(this.fRotateLimitY=t)}else this.fRotateLimitY=t}this.fRotateX>this.fRotateLimitX&&(this.fRotateX=this.fRotateLimitX),this.fRotateX<-this.fRotateLimitX&&(this.fRotateX=-this.fRotateLimitX),this.fRotateY>this.fRotateLimitY&&(this.fRotateY=this.fRotateLimitX),this.fRotateY<-this.fRotateLimitX&&(this.fRotateY=-this.fRotateLimitX)}return 1}}]),t}(),ye=function(){function t(){e(this,t),this.canvas=null,this.ctx=null,this.regionSx=0,this.regionSy=0,this.regionSw=0,this.regionSh=0,this.needRect=!1,this.bAntialias=!1,this.bRecreateAntia=!1,this.pfuncCBIn=null,this.pUserIn=null,this.pfuncCBOut=null,this.pUserOut=null}return o(t,[{key:"SR_Init",value:function(e){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.ctx||console.log("your browser does not support 2d render")}},{key:"SR_Draw",value:function(e){return this.needRect?this.ctx.drawImage(e,this.regionSx,this.regionSy,this.regionSw,this.regionSh,0,0,this.canvas.width,this.canvas.height):this.ctx.drawImage(e,0,0,e.displayWidth,e.displayHeight,0,0,this.canvas.width,this.canvas.height),null!=this.pfuncCBIn&&this.pfuncCBIn(this.pUserIn),1}},{key:"GetCanvasData",value:function(e){console.log("%c start time:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds(),"color: blue");var t=this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height);console.log("%c 2 time:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds(),"color: blue");var i=document.createElement("canvas"),n=i.getContext("2d");i.width=this.canvas.width,i.height=this.canvas.height,n.putImageData(t,0,0);var a=i.toDataURL(),r=document.createElement("a");r.download=(new Date).getTime()+".jpeg",r.href=a,r.dataset.downloadurl=["image/jpeg",r.download,r.href].join(":"),document.body.appendChild(r),r.click(),document.body.removeChild(r),console.log("%c end time:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds(),"color: blue")}},{key:"SR_DelSubPort",value:function(e){return 0}},{key:"SR_AddSubPort",value:function(e){return 0}},{key:"SR_SetDisplayRect",value:function(e,t,i,n){this.regionSx=e,this.regionSy=t,this.regionSw=i,this.regionSh=n,this.needRect=!0}},{key:"SR_Destroy",value:function(){this.canvas=null,this.ctx=null,this.regionSx=0,this.regionSy=0,this.regionSw=0,this.regionSh=0,this.needRect=!1}},{key:"SR_SetCanvasSize",value:function(e,t){this.canvas.width=e,this.canvas.height=t}},{key:"SR_GetCanvasSize",value:function(){console.log("canvas width:"+this.canvas.width+",height:"+this.canvas.height)}},{key:"SR_SetAntialias",value:function(e){return e!=this.bAntialias?(this.bAntialias=e,this.bRecreateAntia=!0):this.bRecreateAntia=!1,this.bRecreateAntia&&(this.bAntialias?(this.canvas.width=5*this.canvas.width,this.canvas.height=5*this.canvas.height,this.canvas.style.transform="scale(0.2)",this.canvas.style.transformOrigin="0 0"):(this.canvas.width=this.canvas.width/5,this.canvas.height=this.canvas.height/5,this.canvas.style.transform="scale(1)",this.canvas.style.transformOrigin="0 0")),1}},{key:"SR_SetCallBack",value:function(e,t,i){switch(i){case 0:this.pfuncCBIn=e,this.pUserIn=t;break;case 1:this.pfuncCBOut=e,this.pUserOut=t;break;default:return 0}return 1}},{key:"SR_DrawFont",value:function(e,t,i,n,a,r,o,s,l){var c=[],d={};return d.bBackground=r,d.nFontWidth=n,d.nFontHeight=a,d.pstBGColor=o,d.pstFontColor=i,d.pString=e,d.pstStartPos=t,d.fRotateAngle=s,d.pFontFamily=l,c.push(d),this.SR_DrawFontEx(c,1),1}},{key:"SR_DrawFontEx",value:function(e,t){for(var i=0;i<t;i++){this.ctx.textBaseline="top";var n=e[i].nFontWidth,a=e[i].nFontHeight,r=(n=Math.round(n))<(a=Math.round(a))?n:a;this.ctx.font=r.toString()+"px "+e[i].pFontFamily;var o=parseInt(255*e[i].pstFontColor.fR),s=parseInt(255*e[i].pstFontColor.fG),l=parseInt(255*e[i].pstFontColor.fB),c=o<16?"0"+o.toString(16):o.toString(16),d=s<16?"0"+s.toString(16):s.toString(16),u=l<16?"0"+l.toString(16):l.toString(16);this.ctx.fillStyle="#"+c+d+u,this.ctx.globalAlpha=e[i].pstFontColor.fA,this.ctx.fillText(e[i].pString,e[i].pstStartPos.fX*this.canvas.width,e[i].pstStartPos.fY*this.canvas.height)}return 1}},{key:"SR_DrawImage",value:function(e,t,i,n,a,r){return 1}},{key:"SR_DrawLinesEx",value:function(e,t,i,n){return 1}}]),t}(),Se=function(){function t(){e(this,t),this.bPortAllocated=[],this.pRenderParam=[],this.pFishParam=[],this.stPTZColor=[],this.pPTZSetColor=null,this.nBasePTZPointNum=[],this.nOriPTZPointNum=[],this.nPanoPTZPointNum=[],this.nPTZFragmentNum=[],this.pBasePTZPoints=[],this.pPanoPTZPoints=[],this.pRectPoints=[],this.nPTZRectNum=[],this.nPTZDisplayMode=0,this.fRX1=0,this.fRX2=1,this.fRY1=0,this.fRY2=1,this.bBlack=!1,this.pOriPTZPoints=[],this.nWndPort=le,this.nPlaceType=0,this.nPTZFragmentNode=[],this.bPTZSelected=[],this.nPTZDisplayMode=2;for(var i=0;i<ee;++i){this.bPortAllocated[i]=!1,this.bPTZSelected[i]=!1,this.pRenderParam[i]=null,this.pFishParam[i]=null,this.stPTZColor[i]={},this.stPTZColor[i].fR=0,this.stPTZColor[i].fG=0,this.stPTZColor[i].fB=0,this.stPTZColor[i].fA=0,this.nBasePTZPointNum[i]=0,this.nOriPTZPointNum[i]=0,this.nPanoPTZPointNum[i]=0,this.nPTZRectNum[i]=0,this.pPanoPTZPoints[i]=[],this.pRectPoints[i]=[],this.pBasePTZPoints[i]=[],this.pOriPTZPoints[i]=[];for(var n=0;n<4;++n)this.pRectPoints[i][n]={},this.pRectPoints[i][n].fX=0,this.pRectPoints[i][n].fY=0;for(var a=0;a<te;++a)this.pBasePTZPoints[i][a]={},this.pBasePTZPoints[i][a].fX=0,this.pBasePTZPoints[i][a].fY=0,this.pOriPTZPoints[i][a]={},this.pOriPTZPoints[i][a].fX=0,this.pOriPTZPoints[i][a].fY=0,this.pPanoPTZPoints[i][a]={},this.pPanoPTZPoints[i][a].fX=0,this.pPanoPTZPoints[i][a].fY=0;this.nPTZFragmentNum[i]=0,this.nPTZFragmentNode[i]=[];for(var r=0;r<100;++r)this.nPTZFragmentNode[i][r]=0}this.InitColorList()}return o(t,[{key:"GetFECPort",value:function(e){for(var t=le,i=0;i<ee;++i)if(0==this.bPortAllocated[i]){t=i;break}if(t==le)return t;if(e==Y.SR_DE_NULL)return t;if(1!=this.JudgeDisplayEffect(e))return this.FreeFECPort(t),le;if(Y.SR_DE_FISH_PANORAMA_CEILING_360==e||Y.SR_DE_FISH_PANORAMA_CEILING_180==e||Y.SR_DE_FISH_PANORAMA_FLOOR_360==e||Y.SR_DE_FISH_PANORAMA_FLOOR_180==e||Y.SR_DE_FISH_PANORAMA_WALL==e||Y.SR_DE_FISH_ORIGINAL==e){if(le!=this.nWndPort)return this.FreeFECPort(t),le;this.nWndPort=t}if(!(Y.SR_DE_FISH_PTZ_CEILING!=e&&Y.SR_DE_FISH_PTZ_FLOOR!=e&&Y.SR_DE_FISH_PTZ_WALL!=e||le==this.nWndPort||null==this.pRenderParam[this.nWndPort]||Y.SR_DE_FISH_PANORAMA_CEILING_180!=this.pRenderParam[this.nWndPort].nDisplayEffect&&Y.SR_DE_FISH_PANORAMA_FLOOR_180!=this.pRenderParam[this.nWndPort].nDisplayEffect))return this.FreeFECPort(t),le;if(Y.SR_DE_FISH_PANORAMA_CEILING_180==e||Y.SR_DE_FISH_PANORAMA_FLOOR_180==e)for(var n=0;n<ee;++n)if(null!=this.pRenderParam[n]&&(Y.SR_DE_FISH_PTZ_CEILING==this.pRenderParam[n].nDisplayEffect||Y.SR_DE_FISH_PTZ_FLOOR==this.pRenderParam[n].nDisplayEffect||Y.SR_DE_FISH_PTZ_WALL==this.pRenderParam[n].nDisplayEffect))return this.FreeFECPort(t),le;if(Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL==e)for(var a=0;a<ee;++a)if(null!=this.pRenderParam[a]&&Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL==this.pRenderParam[a].nDisplayEffect)return this.FreeFECPort(t),le;if(Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL==e)for(var r=0;r<ee;++r)if(null!=this.pRenderParam[r]&&Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL==this.pRenderParam[r].nDisplayEffect)return this.FreeFECPort(t),le;return this.pRenderParam[t]={},this.pRenderParam[t].fCosH=1,this.pRenderParam[t].fSinH=0,this.pRenderParam[t].fCosV=1,this.pRenderParam[t].fSinV=0,this.pRenderParam[t].fAngle=0,this.pRenderParam[t].fRX1=this.fRX1,this.pRenderParam[t].fRX2=this.fRX2,this.pRenderParam[t].fRY1=this.fRY1,this.pRenderParam[t].fRY2=this.fRY2,this.pRenderParam[t].bBlack=this.bBlack,this.pRenderParam[t].fZoom=.035+.8,this.pRenderParam[t].nDisplayEffect=e,this.pRenderParam[t].bBlack=!1,this.pRenderParam[t].bCut=!1,this.pFishParam[t]={},this.pFishParam[t].nFishParamType=0,this.pFishParam[t].bCut=!1,this.pFishParam[t].fAngle=this.pRenderParam[t].fAngle,this.pFishParam[t].fPTZX=.5,this.pFishParam[t].fPTZY=.5,this.pFishParam[t].fRXLeft=this.pRenderParam[t].fRX1,this.pFishParam[t].fRXRight=this.pRenderParam[t].fRX2,this.pFishParam[t].fRYTop=this.pRenderParam[t].fRY1,this.pFishParam[t].fRYBottom=this.pRenderParam[t].fRY2,this.pFishParam[t].bBlack=this.pRenderParam[t].bBlack,this.pFishParam[t].fZoom=(this.pRenderParam[t].fZoom-.8)/7,this.bPortAllocated[t]=!0,t}},{key:"FreeFECPort",value:function(e){if(e<0||e>=ee)return V;this.nWndPort==e&&(this.nWndPort=le),null!=this.pRenderParam[e]&&(this.pRenderParam[e].fCosH=1,this.pRenderParam[e].fSinH=0,this.pRenderParam[e].fCosV=1,this.pRenderParam[e].fSinV=0,this.pRenderParam[e].fAngle=0,this.pRenderParam[e].fZoom=0,this.pRenderParam[e].fRX1=0,this.pRenderParam[e].fRX2=1,this.pRenderParam[e].fRY1=0,this.pRenderParam[e].fRY2=1,this.pRenderParam[e].nDisplayEffect=0,this.pRenderParam[e].bBlack=!1,this.pRenderParam[e].bCut=!1),null!=this.pFishParam[e]&&(this.pFishParam[e].nFishParamType=0,this.pFishParam[e].fRXLeft=0,this.pFishParam[e].fRXRight=1,this.pFishParam[e].fRYTop=0,this.pFishParam[e].fRYBottom=1,this.pFishParam[e].bBlack=!1,this.pFishParam[e].bCut=!1,this.pFishParam[e].fAngle=0,this.pFishParam[e].fZoom=0,this.pFishParam[e].fPTZX=.5,this.pFishParam[e].fPTZY=.5),this.nBasePTZPointNum[e]=0,this.nOriPTZPointNum[e]=0,this.nPanoPTZPointNum[e]=0,this.nPTZRectNum[e]=0;for(var t=0;t<4;++t)this.pRectPoints[e][t].fX=0,this.pRectPoints[e][t].fY=0;for(var n=0;n<te;++n)this.pBasePTZPoints[e][n].fX=0,this.pBasePTZPoints[e][n].fY=0,this.pOriPTZPoints[e][n].fX=0,this.pOriPTZPoints[e][n].fY=0,this.pPanoPTZPoints[e][n].fX=0,this.pPanoPTZPoints[e][n].fY=0;if(null!=this.pPTZSetColor&&(this.pPTZSetColor[e].fA=0,this.pPTZSetColor[e].fR=0,this.pPTZSetColor[e].fG=0,this.pPTZSetColor[e].fB=0),this.bPTZSelected[e]=!1,0!=this.nPlaceType){var a=!1;if(null!=this.pRenderParam[i])for(var r=0;r<ee;++r)if(null!=this.pRenderParam[r]&&(Y.SR_DE_FISH_PTZ_CEILING==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_PTZ_FLOOR==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_PTZ_WALL==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_PANORAMA_CEILING_360==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_PANORAMA_CEILING_180==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_PANORAMA_FLOOR_360==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_PANORAMA_FLOOR_180==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_PANORAMA_WALL==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_CYLINDER_CEILING==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_CYLINDER_FLOOR==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_CYLINDER_SPLIT_CEILING==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL==this.pRenderParam[r].nDisplayEffect||Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL==this.pRenderParam[r].nDisplayEffect)){a=!0;break}a||(this.nPlaceType=0)}for(var o=!1,s=0;s<ee;++s)if(null!=this.pRenderParam[s]){o=!0;break}o||(this.fRX1=0,this.fRX2=1,this.fRY1=0,this.fRY2=1,this.bBlack=!1),this.nPTZFragmentNum[e]=0;for(var l=0;l<100;++l)this.nPTZFragmentNode[e][l]=0;return this.bPortAllocated[e]=!1,1}},{key:"DeInit",value:function(){for(var e=0;e<ee;++e){for(var t=0;t<4;++t)this.pRectPoints[e][t]=null;for(var i=0;i<te;++i)this.pBasePTZPoints[e][i]=null,this.pOriPTZPoints[e][i]=null,this.pPanoPTZPoints[e][i]=null;this.nPTZFragmentNum[e]=0,this.nPTZFragmentNode[e]=null,this.bPortAllocated[e]=!1,this.bPTZSelected[e]=!1,this.pRenderParam[e]=null,this.pFishParam[e]=null,this.stPTZColor[e]=null,this.nBasePTZPointNum[e]=0,this.nOriPTZPointNum[e]=0,this.nPanoPTZPointNum[e]=0,this.nPTZRectNum[e]=0,this.pPanoPTZPoints[e]=null,this.pRectPoints[e]=null,this.pBasePTZPoints[e]=null,this.pOriPTZPoints[e]=null}return this.bPortAllocated=null,this.pRenderParam=null,this.pFishParam=null,this.stPTZColor=null,this.pPTZSetColor=null,this.nBasePTZPointNum=null,this.nOriPTZPointNum=null,this.nPanoPTZPointNum=null,this.nPTZFragmentNum=null,this.pBasePTZPoints=null,this.pPanoPTZPoints=null,this.pRectPoints=null,this.nPTZRectNum=null,this.nPTZDisplayMode=0,this.fRX1=0,this.fRX2=1,this.fRY1=0,this.fRY2=1,this.bBlack=!1,this.pOriPTZPoints=null,this.pBasePTZPoints=null,this.nWndPort=le,this.nPlaceType=0,this.nPTZFragmentNode=null,this.bPTZSelected=null,this.nPTZDisplayMode=2,1}},{key:"InitColorList",value:function(){this.stPTZColor[0].fR=.5,this.stPTZColor[0].fG=.5,this.stPTZColor[0].fB=0,this.stPTZColor[0].fA=1,this.stPTZColor[1].fR=1,this.stPTZColor[1].fG=0,this.stPTZColor[1].fB=0,this.stPTZColor[1].fA=1,this.stPTZColor[2].fR=0,this.stPTZColor[2].fG=1,this.stPTZColor[2].fB=0,this.stPTZColor[2].fA=1,this.stPTZColor[3].fR=0,this.stPTZColor[3].fG=0,this.stPTZColor[3].fB=1,this.stPTZColor[3].fA=1,this.stPTZColor[4].fR=1,this.stPTZColor[4].fG=1,this.stPTZColor[4].fB=0,this.stPTZColor[4].fA=1,this.stPTZColor[5].fR=.5,this.stPTZColor[5].fG=0,this.stPTZColor[5].fB=1,this.stPTZColor[5].fA=1,this.stPTZColor[6].fR=0,this.stPTZColor[6].fG=1,this.stPTZColor[6].fB=1,this.stPTZColor[6].fA=1,this.stPTZColor[7].fR=1,this.stPTZColor[7].fG=.5,this.stPTZColor[7].fB=0,this.stPTZColor[7].fA=1,this.stPTZColor[8].fR=0,this.stPTZColor[8].fG=.5,this.stPTZColor[8].fB=.5,this.stPTZColor[8].fA=1;for(var e=9;e<ee;e++)this.stPTZColor[e].fR=1*e/ee,this.stPTZColor[e].fG=1*e/ee,this.stPTZColor[e].fB=1*e/ee,this.stPTZColor[e].fA=1;return 1}},{key:"GetRangePoints",value:function(e){if(e<0||e>=ee)return V;if(null==this.pRenderParam[e])return H;var t=0,i=0;switch(this.nOriPTZPointNum[e]=0,this.nBasePTZPointNum[e]=0,this.pRenderParam[e].nDisplayEffect){case Y.SR_DE_FISH_PTZ_CEILING:for(i=0;i<1;i+=.01)this.GetFishPTZCeiling(t,i,e);for(i=.9995,t=0;t<1;t+=.02)this.GetFishPTZCeiling(t,i,e);for(t=.999,i=.9995;i>=0;i-=.01)this.GetFishPTZCeiling(t,i,e);for(i=0,t=.999;t>=0;t-=.02)this.GetFishPTZCeiling(t,i,e);break;case Y.SR_DE_FISH_PTZ_FLOOR:for(i=0;i<1;i+=.01)this.GetFishPTZFloor(t,i,e);for(i=.9995,t=0;t<1;t+=.02)this.GetFishPTZFloor(t,i,e);for(t=.999,i=.9995;i>=0;i-=.01)this.GetFishPTZFloor(t,i,e);for(i=0,t=.999;t>=0;t-=.02)this.GetFishPTZFloor(t,i,e);break;case Y.SR_DE_FISH_PTZ_WALL:for(i=0;i<1;i+=.01)this.GetFishPTZWALL(t,i,e);for(i=.9995,t=0;t<1;t+=.02)this.GetFishPTZWALL(t,i,e);for(t=.999,i=.9995;i>=0;i-=.01)this.GetFishPTZWALL(t,i,e);for(i=0,t=.999;t>=0;t-=.02)this.GetFishPTZWALL(t,i,e);break;default:return U}return 1}},{key:"TransformPTZRangePoints",value:function(e){if(le==this.nWndPort)return H;if(null==this.pBasePTZPoints[e]||null==this.pRenderParam[this.nWndPort])return H;this.nPanoPTZPointNum[e]=0;var t=1,i=this.nWndPort;switch(this.pRenderParam[i].nDisplayEffect){case Y.SR_DE_FISH_PANORAMA_WALL:if(1!=(t=this.GetPanoPTZWall(e)))return t;break;case Y.SR_DE_FISH_PANORAMA_FLOOR_360:if(1!=(t=this.GetPanoPTZFloor(e)))return t;break;case Y.SR_DE_FISH_PANORAMA_CEILING_360:if(1!=(t=this.GetPanoPTZCeiling(e)))return t}return this.CalcPTZFragmentPoints(e),1}},{key:"GetRectPoints",value:function(e){if(e<0||e>=ee)return V;if(this.nWndPort==le)return H;if(null==this.pRenderParam[this.nWndPort]||null==this.pFishParam[e])return H;var t=1,i={fX:0,fY:0};switch(this.pRenderParam[this.nWndPort].nDisplayEffect){case Y.SR_DE_FISH_PANORAMA_WALL:if(1!=(t=this.GetPointFish2PanoWall(i,this.pFishParam[e].fPTZX,this.pFishParam[e].fPTZY)))return t;break;case Y.SR_DE_FISH_PANORAMA_FLOOR_360:if(1!=(t=this.GetPointFish2PanoFloor(i,this.pFishParam[e].fPTZX,this.pFishParam[e].fPTZY)))return U==t&&(this.pRectPoints[e]=null),t;break;case Y.SR_DE_FISH_PANORAMA_CEILING_360:if(1!=(t=this.GetPointFish2PanoCeiling(i,this.pFishParam[e].fPTZX,this.pFishParam[e].fPTZY)))return U==t&&(this.pRectPoints[e]=null),t;break;case Y.SR_DE_FISH_ORIGINAL:i.fX=this.pFishParam[e].fPTZX,i.fY=this.pFishParam[e].fPTZY}if(null==this.pRectPoints[e]){this.pRectPoints[e]=[];for(var n=0;n<4;++n)this.pRectPoints[e][n]={},this.pRectPoints[e][n].fX=0,this.pRectPoints[e][n].fY=0}return this.pRectPoints[e][0].fX=i.fX-ie,this.pRectPoints[e][0].fY=i.fY-ie,this.pRectPoints[e][1].fX=i.fX+ie,this.pRectPoints[e][1].fY=i.fY-ie,this.pRectPoints[e][2].fX=i.fX+ie,this.pRectPoints[e][2].fY=i.fY+ie,this.pRectPoints[e][3].fX=i.fX-ie,this.pRectPoints[e][3].fY=i.fY+ie,this.nPTZRectNum[e]=4,1}},{key:"GetFishPTZCeiling",value:function(e,t,i){var n,a,r,o,s,l,c,d={fX:0,fY:0},u={fX:0,fY:0},h={fX:0,fY:0},f={};o=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),s=(this.fRX1+this.fRX2)/2*1,l=(this.fRY1+this.fRY2)/2*o,c=(this.fRX2-this.fRX1)/2*1,d.fX=t-.5,d.fY=.5-e,n=this.pRenderParam[i].fZoom,u.fX=d.fX,u.fY=d.fY*this.pRenderParam[i].fCosV+n*this.pRenderParam[i].fSinV,a=n*this.pRenderParam[i].fCosV-d.fY*this.pRenderParam[i].fSinV,r=Math.sqrt(u.fX*u.fX+u.fY*u.fY);var x=Math.sqrt(u.fX*u.fX+u.fY*u.fY+a*a),p=Math.asin(r/x)/1.5707963*.5;u.fX=p*u.fX/r,u.fY=p*u.fY/r,h.fX=u.fX*this.pRenderParam[i].fCosH-u.fY*this.pRenderParam[i].fSinH,h.fY=u.fX*this.pRenderParam[i].fSinH+u.fY*this.pRenderParam[i].fCosH,f.fX=2*h.fX*c+s,f.fY=2*-h.fY*c+l;var m=this.nBasePTZPointNum[i];this.pBasePTZPoints[i][m].fX=h.fX+.5,this.pBasePTZPoints[i][m].fY=.5-h.fY,this.nBasePTZPointNum[i]=this.nBasePTZPointNum[i]+1;var _=this.fRX1<=0?0:1*this.fRX1,g=this.fRY1<=0?0:this.fRY1*o,v=this.fRX2>=1?1-_:1*this.fRX2-_,y=this.fRY2>=1?o-g:this.fRY2*o-g;if(f.fX=(f.fX-_)/v,f.fY=(f.fY-g)/y,f.fX<=1&&f.fY<=1&&f.fX>=0&&f.fY>=0){var S=this.nOriPTZPointNum[i];this.pOriPTZPoints[i][S].fX=f.fX,this.pOriPTZPoints[i][S].fY=f.fY,this.nOriPTZPointNum[i]=this.nOriPTZPointNum[i]+1}return 1}},{key:"GetFishPTZFloor",value:function(e,t,i){var n,a,r,o,s,l,c,d={fX:0,fY:0},u={fX:0,fY:0},h={fX:0,fY:0},f={};o=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),s=(this.fRX1+this.fRX2)/2*1,l=(this.fRY1+this.fRY2)/2*o,c=(this.fRX2-this.fRX1)/2*1,d.fX=e-.5,d.fY=t-.5,n=this.pRenderParam[i].fZoom,u.fX=d.fX,u.fY=d.fY*this.pRenderParam[i].fCosV+n*this.pRenderParam[i].fSinV,a=n*this.pRenderParam[i].fCosV-d.fY*this.pRenderParam[i].fSinV,r=Math.sqrt(u.fX*u.fX+u.fY*u.fY);var x=Math.sqrt(u.fX*u.fX+u.fY*u.fY+a*a),p=Math.asin(r/x)/1.5707963*.5;u.fX=p*u.fX/r,u.fY=p*u.fY/r,h.fX=u.fX*this.pRenderParam[i].fCosH-u.fY*this.pRenderParam[i].fSinH,h.fY=u.fX*this.pRenderParam[i].fSinH+u.fY*this.pRenderParam[i].fCosH,f.fX=2*h.fX*c+s,f.fY=2*h.fY*c+l;var m=this.nBasePTZPointNum[i];this.pBasePTZPoints[i][m].fX=h.fX+.5,this.pBasePTZPoints[i][m].fY=h.fY+.5,this.nBasePTZPointNum[i]=this.nBasePTZPointNum[i]+1;var _=this.fRX1<=0?0:1*this.fRX1,g=this.fRY1<=0?0:this.fRY1*o,v=this.fRX2>=1?1-_:1*this.fRX2-_,y=this.fRY2>=1?o-g:this.fRY2*o-g;if(f.fX=(f.fX-_)/v,f.fY=(f.fY-g)/y,f.fX<=1&&f.fY<=1&&f.fX>=0&&f.fY>=0){var S=this.nOriPTZPointNum[i];this.pOriPTZPoints[i][S].fX=f.fX,this.pOriPTZPoints[i][S].fY=f.fY,this.nOriPTZPointNum[i]=this.nOriPTZPointNum[i]+1}return 1}},{key:"GetFishPTZWALL",value:function(e,t,i){var n,a,r,o,s,l,c,d,u={fX:0,fY:0},h={fX:0,fY:0},f={fX:0,fY:0},x={};s=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),l=(this.fRX1+this.fRX2)/2*1,c=(this.fRY1+this.fRY2)/2*s,d=(this.fRX2-this.fRX1)/2*1,u.fX=t-.5,u.fY=e-.5,n=this.pRenderParam[i].fZoom,h.fX=u.fX,h.fY=u.fY*this.pRenderParam[i].fCosV+n*this.pRenderParam[i].fSinV,a=n*this.pRenderParam[i].fCosV-u.fY*this.pRenderParam[i].fSinV,f.fX=h.fX*this.pRenderParam[i].fCosH+a*this.pRenderParam[i].fSinH,f.fY=h.fY,r=a*this.pRenderParam[i].fCosH-h.fX*this.pRenderParam[i].fSinH,o=Math.sqrt(f.fX*f.fX+f.fY*f.fY);var p=Math.sqrt(f.fX*f.fX+f.fY*f.fY+r*r),m=Math.asin(o/p)/1.5707963*.5;x.fX=m*f.fX/o*d*2+l,x.fY=m*f.fY/o*d*2+c;var _=this.nBasePTZPointNum[i];this.pBasePTZPoints[i][_].fX=m*f.fX/o+.5,this.pBasePTZPoints[i][_].fY=m*f.fY/o+.5,this.nBasePTZPointNum[i]=this.nBasePTZPointNum[i]+1;var g=this.fRX1<=0?0:1*this.fRX1,v=this.fRY1<=0?0:this.fRY1*s,y=this.fRX2>=1?1-g:1*this.fRX2-g,S=this.fRY2>=1?s-v:this.fRY2*s-v;if(x.fX=(x.fX-g)/y,x.fY=(x.fY-v)/S,x.fX<=1&&x.fY<=1&&x.fX>=0&&x.fY>=0){var b=this.nOriPTZPointNum[i];this.pOriPTZPoints[i][b].fX=x.fX,this.pOriPTZPoints[i][b].fY=x.fY,this.nOriPTZPointNum[i]=this.nOriPTZPointNum[i]+1}return 1}},{key:"GetPanoPTZCeiling",value:function(e){if(null==this.pRenderParam[e]||null==this.pRenderParam[this.nWndPort])return H;if(null==this.pBasePTZPoints[e])return H;var t,i,n=this.nBasePTZPointNum[e];t=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),i=(this.fRX2-this.fRX1)/2*1;var a,r=0;(this.fRX2>1||this.fRY2>1||this.fRY1<0||this.fRX1<0)&&(this.fRX1<0&&(a=1*-this.fRX1)>r&&(r=a),this.fRX2>1&&(a=1*(this.fRX2-1))>r&&(r=a),this.fRY1<0&&(a=-this.fRY1*t)>r&&(r=a),this.fRY2>1&&(a=(this.fRY2-1)*t)>r&&(r=a));for(var o,s=r/i,l={fX:0,fY:0},c={fX:0,fY:0},d=0;d<n;++d)if(c.fX=this.pBasePTZPoints[e][d].fX,c.fY=this.pBasePTZPoints[e][d].fY,!(Math.abs(c.fX-.5)<ne&&Math.abs(c.fY-.5)<ne)){var u={fX:0,fY:0},h={fX:0,fY:0};u.fX=c.fX-.5,u.fY=c.fY-.5,h.fX=-.5*Math.sin(this.pRenderParam[this.nWndPort].fAngle),h.fY=.5*Math.cos(this.pRenderParam[this.nWndPort].fAngle);var f=Math.sqrt(u.fX*u.fX+u.fY*u.fY),x=Math.sqrt(h.fX*h.fX+h.fY*h.fY);if(o=Math.acos((u.fX*h.fX+u.fY*h.fY)/(f*x)),u.fX*h.fY-u.fY*h.fX>0&&(o=6.2831852-o),l.fX=o/6.2831853,l.fY=(2*(.5-f)-s)/(.8-s),l.fY>=0&&l.fX>=0&&l.fY<=1&&l.fX<=1){var p=this.nPanoPTZPointNum[e];this.pPanoPTZPoints[e][p].fX=l.fX,this.pPanoPTZPoints[e][p].fY=l.fY,this.nPanoPTZPointNum[e]=this.nPanoPTZPointNum[e]+1}}return 1}},{key:"GetPanoPTZFloor",value:function(e){if(null==this.pRenderParam[e]||null==this.pRenderParam[this.nWndPort])return H;if(null==this.pBasePTZPoints[e])return H;var t,i,n=this.nBasePTZPointNum[e];t=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),i=(this.fRX2-this.fRX1)/2*1;var a,r=0;(this.fRX2>1||this.fRY2>1||this.fRY1<0||this.fRX1<0)&&(this.fRX1<0&&(a=1*-this.fRX1)>r&&(r=a),this.fRX2>1&&(a=1*(this.fRX2-1))>r&&(r=a),this.fRY1<0&&(a=-this.fRY1*t)>r&&(r=a),this.fRY2>1&&(a=(this.fRY2-1)*t)>r&&(r=a));for(var o,s=r/i,l={fX:0,fY:0},c={fX:0,fY:0},d=0;d<n;++d)if(c.fX=this.pBasePTZPoints[e][d].fX,c.fY=this.pBasePTZPoints[e][d].fY,!(Math.abs(c.fX-.5)<ne&&Math.abs(c.fY-.5)<ne)){var u={fX:0,fY:0},h={fX:0,fY:0};u.fX=c.fX-.5,u.fY=c.fY-.5,h.fX=-.5*Math.sin(this.pRenderParam[this.nWndPort].fAngle),h.fY=.5*Math.cos(this.pRenderParam[this.nWndPort].fAngle);var f=Math.sqrt(u.fX*u.fX+u.fY*u.fY),x=Math.sqrt(h.fX*h.fX+h.fY*h.fY);if(o=Math.acos((u.fX*h.fX+u.fY*h.fY)/(f*x)),u.fX*h.fY-u.fY*h.fX>0&&(o=6.2831852-o),l.fX=1-o/6.2831853,l.fY=1-(2*(.5-f)-s)/(.8-s),l.fY>=0&&l.fX>=0&&l.fY<=1&&l.fX<=1){var p=this.nPanoPTZPointNum[e];this.pPanoPTZPoints[e][p].fX=l.fX,this.pPanoPTZPoints[e][p].fY=l.fY,this.nPanoPTZPointNum[e]=this.nPanoPTZPointNum[e]+1}}return 1}},{key:"GetPanoPTZWall",value:function(e){if(null==this.pRenderParam[e]||null==this.pRenderParam[this.nWndPort])return H;if(null==this.pBasePTZPoints[e])return H;var t,i,n=this.nBasePTZPointNum[e];t=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),i=(this.fRX2-this.fRX1)/2*1;var a,r,o,s,l,c=0,d=1,u=.1,h=.9;this.fRX1<0&&(a=1*-this.fRX1,c=a/=2*i),this.fRX2>1&&(r=1*(this.fRX2-1),d=1-(r/=2*i)),this.fRY1<0&&(o=-this.fRY1*t,u=(o/=2*i)>.1?o:.1),this.fRY2>1&&(s=(this.fRY2-1)*t,h=(s/=2*i)>1-.9?1-s:.9);for(var f={fX:0,fY:0},x={fX:0,fY:0},p=0;p<n;++p){x.fX=this.pBasePTZPoints[e][p].fX,x.fY=this.pBasePTZPoints[e][p].fY;var m=2*x.fX*i,_=2*x.fY*i;if(l=Math.sqrt(i*i-(_-i)*(_-i)),!(Math.abs(l)<ne)&&(x.fX=i*(m-i)/l+i,x.fY=_,f.fX=(x.fX-2*c*i)/(2*(d-c)*i),f.fY=(x.fY-2*u*i)/(2*(h-u)*i),f.fY>=0&&f.fX>=0&&f.fY<=1&&f.fX<=1)){var g=this.nPanoPTZPointNum[e];this.pPanoPTZPoints[e][g].fX=f.fX,this.pPanoPTZPoints[e][g].fY=f.fY,this.nPanoPTZPointNum[e]=this.nPanoPTZPointNum[e]+1}}return 1}},{key:"GetPointPano2FishCeiling",value:function(e,t,i){if(null==e||null==this.pRenderParam[this.nWndPort])return H;var n,a;n=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),a=(this.fRX2-this.fRX1)/2*1;var r,o=0,s=1,l=0,c=1,d=0;(this.fRX2>1||this.fRY2>1||this.fRX1<0||this.fRY1<0)&&(this.fRX1<0&&((r=1*-this.fRX1)>d&&(d=r),o=r/=2*a),this.fRX2>1&&((r=1*(this.fRX2-1))>d&&(d=r),s=1-(r/=2*a)),this.fRY1<0&&((r=-this.fRY1*n)>d&&(d=r),l=r/=2*a),this.fRY2>1&&((r=(this.fRY2-1)*n)>d&&(d=r),c=1-(r/=2*a)));var u,h,f=d/a,x={},p={};return x.fX=t,x.fY=(.8-f)*i+f,u=6.2831853*x.fX+this.pRenderParam[this.nWndPort].fAngle,h=.5*(1-x.fY),p.fX=.5-h*Math.sin(u),p.fY=.5+h*Math.cos(u),p.fX=(p.fX-o)/(s-o),p.fY=(p.fY-l)/(c-l),e.fX=p.fX,e.fY=p.fY,1}},{key:"GetPointPano2FishFloor",value:function(e,t,i){if(null==this.pRenderParam[this.nWndPort])return H;if(null==e)return V;var n,a;n=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),a=(this.fRX2-this.fRX1)/2*1;var r,o=0,s=1,l=0,c=1,d=0;(this.fRX2>1||this.fRY2>1||this.fRX1<0||this.fRY1<0)&&(this.fRX1<0&&((r=1*-this.fRX1)>d&&(d=r),o=r/=2*a),this.fRX2>1&&((r=1*(this.fRX2-1))>d&&(d=r),s=1-(r/=2*a)),this.fRY1<0&&((r=-this.fRY1*n)>d&&(d=r),l=r/=2*a),this.fRY2>1&&((r=(this.fRY2-1)*n)>d&&(d=r),c=1-(r/=2*a)));var u,h,f=d/a,x={},p={};return x.fX=1-t,x.fY=(.8-f)*(1-i)+f,u=6.2831853*x.fX+this.pRenderParam[this.nWndPort].fAngle,h=.5*(1-x.fY),p.fX=.5-h*Math.sin(u),p.fY=.5+h*Math.cos(u),p.fX=(p.fX-o)/(s-o),p.fY=(p.fY-l)/(c-l),e.fX=p.fX,e.fY=p.fY,1}},{key:"GetPointPano2FishWall",value:function(e,t,i){if(null==this.pRenderParam[this.nWndPort])return H;if(null==e)return V;var n,a;n=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),a=(this.fRX2-this.fRX1)/2*1;var r,o,s,l,c=0,d=1,u=.1,h=.9,f=0,x=1,p=0,m=1;this.fRX1<0&&(r=1*-this.fRX1,c=r/=2*a,f=r),this.fRX2>1&&(o=1*(this.fRX2-1),d=1-(o/=2*a),x=1-o),this.fRY1<0&&(s=-this.fRY1*n,u=(s/=2*a)>.1?s:.1,p=s),this.fRY2>1&&(l=(this.fRY2-1)*n,h=(l/=2*a)>1-.9?1-l:.9,m=1-l);var _={},g={};_.fX=t*(d-c)+c,_.fY=i*(h-u)+u;var v=Math.sqrt(.25-(_.fY-.5)*(_.fY-.5));return g.fX=(_.fX-.5)*v/.5+.5,g.fY=_.fY,g.fX=(g.fX-f)/(x-f),g.fY=(g.fY-p)/(m-p),e.fX=g.fX,e.fY=g.fY,1}},{key:"UpdatePTZPosition",value:function(e,t,i){if(null==this.pRenderParam[e])return H;var n={fHAngleSin:0,fHAngleCos:0,fVAngleSin:0,fVAngleCos:0},a=1;if(Y.SR_DE_FISH_PTZ_FLOOR==this.pRenderParam[e].nDisplayEffect||Y.SR_DE_FISH_PTZ_CEILING==this.pRenderParam[e].nDisplayEffect){if(1!=(a=this.ComputeAngleVertical(t,i,n,this.pRenderParam[e].nDisplayEffect)))return a}else{if(Y.SR_DE_FISH_PTZ_WALL!=this.pRenderParam[e].nDisplayEffect)return U;if(1!=(a=this.ComputeAngleHorizontal(t,i,n)))return a}return 0==this.IsInImage(this.fRX1,this.fRX2,this.fRY1,this.fRY2,n,this.pRenderParam[e].fZoom,this.pRenderParam[e].nDisplayEffect)?V:(this.pRenderParam[e].fCosH=n.fHAngleCos,this.pRenderParam[e].fSinH=n.fHAngleSin,this.pRenderParam[e].fCosV=n.fVAngleCos,this.pRenderParam[e].fSinV=n.fVAngleSin,1)}},{key:"JudgeDisplayEffect",value:function(e){var t=0;switch(t){case 0:return t=this.GetPlaceType(e),4==this.nPlaceType&&(this.nPlaceType=0),1;case 3:return(t=this.GetPlaceType(e))==this.nPlaceType||4==this.nPlaceType?1:U;case 2:case 1:return(t=this.GetPlaceType(e))==this.nPlaceType||4==t?1:U;default:return U}return U}},{key:"GetPlaceType",value:function(e){switch(e){case Y.SR_DE_FISH_PTZ_CEILING:case Y.SR_DE_FISH_PANORAMA_CEILING_360:case Y.SR_DE_FISH_PANORAMA_CEILING_180:case Y.SR_DE_FISH_CYLINDER_CEILING:case Y.SR_DE_FISH_CYLINDER_SPLIT_CEILING:return 3;case Y.SR_DE_FISH_PTZ_FLOOR:case Y.SR_DE_FISH_PANORAMA_FLOOR_360:case Y.SR_DE_FISH_PANARAMA_FLOOR_180:case Y.SR_DE_FISH_CYLINDER_FLOOR:case Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR:return 2;case Y.SR_DE_FISH_PTZ_WALL:case Y.SR_DE_FISH_PANORAMA_WALL:case Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL:case Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL:return 1;case Y.SR_DE_FISH_SEMISPHERE:case Y.SR_DE_FISH_ORIGINAL:case Y.SR_DE_FISH_PLANET:case Y.SR_DE_FISH_SPHERE:case Y.SR_DE_FISH_PLANET:return 4;default:return 0}return 0}},{key:"SetFishParam",value:function(e,t){if(e<0||e>=ee)return V;if(null==t)return V;if(null==this.pRenderParam[e])return H;var i=1;switch(t.nFishParamType){case 1:if(1!=(i=this.UpdateCircyeParam(t.fRXLeft,t.fRXRight,t.fRYTop,t.fRYBottom)))return i;this.pRenderParam[e].bCut=t.bCut,this.bBlack=t.bBlack;break;case 2:if(Y.SR_DE_FISH_PANORAMA_CEILING_360!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PANORAMA_CEILING_180!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PANORAMA_FLOOR_360!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PANORAMA_FLOOR_180!=this.pRenderParam[e].nDisplayEffect)return U;if(1!=(i=this.UpdateWideScanAngle(e,t.fAngle)))return i;this.pFishParam[e].fAngle=t.fAngle;break;case 3:if(Y.SR_DE_FISH_PTZ_WALL!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PTZ_CEILING!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PTZ_FLOOR!=this.pRenderParam[e].nDisplayEffect)return U;if(1!=(i=this.UpdateRangeParam(e,t.fZoom)))return i;this.pFishParam[e].fZoom=t.fZoom;break;case 4:if(Y.SR_DE_FISH_PTZ_WALL!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PTZ_CEILING!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PTZ_FLOOR!=this.pRenderParam[e].nDisplayEffect)return U;if(1!=(i=this.UpdatePTZPosition(e,t.fPTZX,t.fPTZY,this.pRenderParam[e].fZoom,!0)))return i;this.pFishParam[e].fPTZX=t.fPTZX,this.pFishParam[e].fPTZY=t.fPTZY;break;default:return U}return this.ComputePTZPoints()}},{key:"GetFishParam",value:function(e,t){return e<0||e>=ee||null==t||null==this.pFishParam[e]?V:(t.fRXLeft=this.fRX1,t.fRXRight=this.fRX2,t.fRYTop=this.fRY1,t.fRYBottom=this.fRY2,t.bBlack=this.bBlack,t.bCut=this.pRenderParam[e].bCut,t.nFishParamType=this.pFishParam[e].nFishParamType,t.fAngle=this.pFishParam[e].fAngle,t.fZoom=this.pFishParam[e].fZoom,t.fPTZX=this.pFishParam[e].fPTZX,t.fPTZY=this.pFishParam[e].fPTZY,1)}},{key:"GetRenderParam",value:function(e,t){return e<0||e>=ee||null==t||null==this.pRenderParam[e]?V:(t.fRXLeft=this.fRX1,t.fRXRight=this.fRX2,t.fRYTop=this.fRY1,t.fRYBottom=this.fRY2,t.bBlack=this.bBlack,t.fCosH=this.pRenderParam[e].fCosH,t.fSinH=this.pRenderParam[e].fSinH,t.fCosV=this.pRenderParam[e].fCosV,t.fSinV=this.pRenderParam[e].fSinV,t.fAngle=this.pRenderParam[e].fAngle,t.fZoom=this.pRenderParam[e].fZoom,t.nDisplayEffect=this.pRenderParam[e].nDisplayEffect,t.bCut=this.pRenderParam[e].bCut,1)}},{key:"UpdateCircyeParam",value:function(e,t,i,n){if(e<=-.5||e>=.4||t<=.6||t>=1.5||i<=-.5||i>=.4||n<=.6||n>=1.5||e+t<=.8||e+t>=1.2||i+n<=.8||i+n>=1.2)return V;if(e<0||t>1||i<0||n>1)for(var a=0;a<ee;++a)if(null!=this.pRenderParam[a]&&(Y.SR_DE_FISH_PTZ_CEILING==this.pRenderParam[a].nDisplayEffect||Y.SR_DE_FISH_PTZ_FLOOR==this.pRenderParam[a].nDisplayEffect||Y.SR_DE_FISH_PTZ_WALL==this.pRenderParam[a].nDisplayEffect)){var r={};if(r.fHAngleCos=this.pRenderParam[a].fCosH,r.fHAngleSin=this.pRenderParam[a].fSinH,r.fVAngleCos=this.pRenderParam[a].fCosV,r.fVAngleSin=this.pRenderParam[a].fSinV,0==this.IsInImage(e,t,i,n,r,this.pRenderParam[a].fZoom,this.pRenderParam[a].nDisplayEffect))return V}return this.fRX1=e,this.fRX2=t,this.fRY1=i,this.fRY2=n,1}},{key:"UpdateWideScanAngle",value:function(e,t){return null==this.pRenderParam[e]?H:(Y.SR_DE_FISH_PANORAMA_FLOOR_360==this.pRenderParam[e].nDisplayEffect||Y.SR_DE_FISH_PANORAMA_FLOOR_180==this.pRenderParam[e].nDisplayEffect?this.pRenderParam[e].fAngle=t:Y.SR_DE_FISH_PANORAMA_CEILING_360!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PANORAMA_CEILING_180!=this.pRenderParam[e].nDisplayEffect||(this.pRenderParam[e].fAngle=-t),1)}},{key:"ComputeAngleVertical",value:function(e,t,i,n){var a=e,r=t,o=Math.sqrt((r-.5)*(r-.5)+(a-.5)*(a-.5));if(o>.5)return V;if(o<.001)return i.fVAngleCos=1,i.fVAngleSin=0,i.fHAngleCos=1,i.fHAngleSin=0,1;if(n==Y.SR_DE_FISH_PTZ_CEILING){i.fHAngleCos=(.5-r)/o,i.fHAngleSin=(.5-a)/o;var s=o*ae;i.fVAngleCos=Math.cos(s),i.fVAngleSin=Math.sin(s)}else{if(n!=Y.SR_DE_FISH_PTZ_FLOOR)return V;i.fHAngleCos=(r-.5)/o,i.fHAngleSin=(.5-a)/o;var l=o*ae;i.fVAngleCos=Math.cos(l),i.fVAngleSin=Math.sin(l)}return 1}},{key:"ComputeAngleHorizontal",value:function(e,t,i){var n,a,r,o,s,l,c,d=e;return(t-(s=.5))*(t-s)+(d-s)*(d-s)>.25?V:(l=(t-s)/s*ae/2,n=Math.cos(l),a=Math.sin(l),(d-s)/s/n>1||(d-s)/s/n<-1?V:(c=(d-s)/s/n*ae/2,r=Math.cos(c),o=Math.sin(c),i.fVAngleCos=n,i.fVAngleSin=a,i.fHAngleCos=r,i.fHAngleSin=o,1))}},{key:"IsInImage",value:function(e,t,i,n,a,r,o){return 1!=this.IsOutofImage(e,t,i,n,a.fHAngleCos,a.fHAngleSin,a.fVAngleCos,a.fVAngleSin,r,1,.5,o)&&1!=this.IsOutofImage(e,t,i,n,a.fHAngleCos,a.fHAngleSin,a.fVAngleCos,a.fVAngleSin,r,0,.5,o)&&1!=this.IsOutofImage(e,t,i,n,a.fHAngleCos,a.fHAngleSin,a.fVAngleCos,a.fVAngleSin,r,.5,1,o)&&1!=this.IsOutofImage(e,t,i,n,a.fHAngleCos,a.fHAngleSin,a.fVAngleCos,a.fVAngleSin,r,.5,0,o)&&1!=this.IsOutofImage(e,t,i,n,a.fHAngleCos,a.fHAngleSin,a.fVAngleCos,a.fVAngleSin,r,0,0,o)&&1!=this.IsOutofImage(e,t,i,n,a.fHAngleCos,a.fHAngleSin,a.fVAngleCos,a.fVAngleSin,r,0,1,o)&&1!=this.IsOutofImage(e,t,i,n,a.fHAngleCos,a.fHAngleSin,a.fVAngleCos,a.fVAngleSin,r,1,1,o)&&1!=this.IsOutofImage(e,t,i,n,a.fHAngleCos,a.fHAngleSin,a.fVAngleCos,a.fVAngleSin,r,1,0,o)}},{key:"IsOutofImage",value:function(e,t,i,n,a,r,o,s,l,c,d,u){var h,f,x,p,m,_,g,v,y,S,b,P,E;if(b=(e+t)/2*1,P=(i+n)/2*(S=(t-e)/(n-i)),E=(t-e)/2*1,u==Y.SR_DE_FISH_PTZ_CEILING){if(f=c-.5,x=(h=.5-d)*o+(_=l)*s,(g=_*o-h*s)<=0)return!0;y=Math.sqrt(f*f+x*x);var C=Math.sqrt(f*f+x*x+g*g),T=Math.asin(y/C)/1.5707963*.5;if(m=(-((f=T*f/y)*r+(x=T*x/y)*a)*E*2+P)/S,(p=((f*a-x*r)*E*2+b)/1)<0||p>1||m<0||m>1)return!0}if(u==Y.SR_DE_FISH_PTZ_FLOOR){if(f=c-.5,x=(h=d-.5)*o+(_=l)*s,(g=_*o-h*s)<=0)return!0;y=Math.sqrt(f*f+x*x);var R=Math.sqrt(f*f+x*x+g*g),w=Math.asin(y/R)/1.5707963*.5;if(m=(((f=w*f/y)*r+(x=w*x/y)*a)*E*2+P)/S,(p=((f*a-x*r)*E*2+b)/1)<0||p>1||m<0||m>1)return!0}if(u==Y.SR_DE_FISH_PTZ_WALL){if(p=(f=c-.5)*a+(g=(_=l)*o-(h=d-.5)*s)*r,m=x=h*o+_*s,(v=g*a-f*r)<=0)return!0;y=Math.sqrt(p*p+m*m);var I=Math.sqrt(p*p+m*m+v*v),D=Math.asin(y/I)/1.5707963*.5;if(m=(D*m/y*E*2+P)/S,(p=(D*p/y*E*2+b)/1)<0||p>1||m<0||m>1)return!0}return!1}},{key:"ComputePTZPoints",value:function(){if(le==this.nWndPort)return H;for(var e=0;e<ee;++e)if(null!=this.pRenderParam[e]&&(Y.SR_DE_FISH_PTZ_CEILING==this.pRenderParam[e].nDisplayEffect||Y.SR_DE_FISH_PTZ_FLOOR==this.pRenderParam[e].nDisplayEffect||Y.SR_DE_FISH_PTZ_WALL==this.pRenderParam[e].nDisplayEffect)){if(2==this.nPTZDisplayMode){if(1!=this.GetRangePoints(e))continue;if(1!=this.TransformPTZRangePoints(e))continue}else if(1==this.nPTZDisplayMode&&1!=this.GetRectPoints(e))continue}return 1}},{key:"GetWndPort",value:function(){return this.nWndPort}},{key:"GetPTZDisplayMode",value:function(){return this.nPTZDisplayMode}},{key:"GetPTZColor",value:function(e,t){return e<0||e>=ee||null==t?V:(t.fA=this.stPTZColor[e].fA,t.fR=this.stPTZColor[e].fR,t.fG=this.stPTZColor[e].fG,t.fB=this.stPTZColor[e].fB,null!=this.pPTZSetColor&&(Math.abs(this.pPTZSetColor[e].fA)<ne||Math.abs(this.pPTZSetColor[e].fR)<ne||Math.abs(this.pPTZSetColor[e].fG)<ne||Math.abs(this.pPTZSetColor[e].fB)<ne)&&(t.fA=this.pPTZSetColor[e].fA,t.fR=this.pPTZSetColor[e].fR,t.fG=this.pPTZSetColor[e].fG,t.fB=this.pPTZSetColor[e].fB),1)}},{key:"SetPTZColor",value:function(e,t){if(e<0||e>=ee)return V;if(null==t)return V;if(null==this.pPTZSetColor){this.pPTZSetColor=[];for(var i=0;i<ee;++i)this.pPTZSetColor[i]={},this.pPTZSetColor[i].fR=0,this.pPTZSetColor[i].fG=0,this.pPTZSetColor[i].fB=0,this.pPTZSetColor[i].fA=1}return this.pPTZSetColor[e].fR=t.fR,this.pPTZSetColor[e].fG=t.fG,this.pPTZSetColor[e].fB=t.fB,this.pPTZSetColor[e].fA=t.fA,1}},{key:"IsPTZSelected",value:function(e){return!(e<0||e>=ee)&&this.bPTZSelected[e]}},{key:"GetPTZPort",value:function(e,t,i){if(this.nWndPort==le)return H;if(null==this.pRenderParam[this.nWndPort])return H;var n=ee,a={};a.fX=e,a.fY=t;for(var r=0;r<ee;++r)this.bPTZSelected[r]=!1;if(2==this.nPTZDisplayMode){switch(this.pRenderParam[this.nWndPort].nDisplayEffect){case Y.SR_DE_FISH_PANORAMA_FLOOR_360:this.GetPointPano2FishFloor(a,e,t);break;case Y.SR_DE_FISH_PANORAMA_CEILING_360:this.GetPointPano2FishCeiling(a,e,t);break;case Y.SR_DE_FISH_PANORAMA_WALL:this.GetPointPano2FishWall(a,e,t)}for(var o=0;o<ee;++o)if(0!=this.nOriPTZPointNum[o]){var s={};s.fX=this.pOriPTZPoints[o][0].fX,s.fY=this.pOriPTZPoints[o][0].fY;var l={};l.fX=this.pOriPTZPoints[o][0].fX,l.fY=this.pOriPTZPoints[o][0].fY;for(var c=1;c<this.nOriPTZPointNum[o];++c)this.GetPTZRectange(s,l,this.pOriPTZPoints[o][c]);if(a.fX<=s.fX&&a.fX>=l.fX&&a.fY>=l.fY&&a.fY<=s.fY){n=o;break}}}else{if(1!=this.nPTZDisplayMode)return U;for(var d=0;d<ee;++d)if(a.fX<=this.pRectPoints[d][2].fX&&a.fX>=this.pRectPoints[d][0].fX&&a.fY>=this.pRectPoints[d][0].fY&&a.fY<=this.pRectPoints[d][2].fY){n=d;break}}return n<ee?(this.bPTZSelected[n]=!0,i.nPTZPort=n,1):U}},{key:"SetPTZPort",value:function(e){if(e<0||e>=ee)return V;for(var t=0;t<ee;++t)this.bPTZSelected[t]=!1;if(2==this.nPTZDisplayMode){if(0==this.nOriPTZPointNum[e])return V;this.bPTZSelected[e]=!0}else{if(0==this.nPTZRectNum[e])return V;this.bPTZSelected[e]=!0}return 1}},{key:"GetPTZRectange",value:function(e,t,i){return i.fX<t.fX&&(t.fX=i.fX),i.fY<t.fY&&(t.fY=i.fY),i.fX>e.fX&&(e.fX=i.fX),i.fY>e.fY&&(e.fY=i.fY),1}},{key:"GetPTZPoints",value:function(e,t,i){return e<0||e>=ee?V:null==this.pRenderParam[this.nWndPort]?H:(2==i?null!=this.pOriPTZPoints[e]&&0!=this.nOriPTZPointNum[e]&&(t.pstPoints=this.pOriPTZPoints[e],t.nPointNum=this.nOriPTZPointNum[e]):1==i&&null!=this.pRectPoints[e]&&(t.pstPoints=this.pRectPoints[e],t.nPointNum=4),1)}},{key:"SetPTZDisplayMode",value:function(e){return this.nPTZDisplayMode=e,this.ComputePTZPoints()}},{key:"GetDisplayEffect",value:function(e){return e<0||e>=ee||null==this.pRenderParam?Y.SR_DE_NULL:this.pRenderParam[e].nDisplayEffect}},{key:"GetPTZFragmentPoints",value:function(e,t,i){if(e<0||e>=ee)return V;if(null==this.pPanoPTZPoints[e]||0==this.nPanoPTZPointNum[e])return V;var n=this.nPTZFragmentNode[e][i];if(t.nPointNum=this.nPTZFragmentNode[e][i+1]-this.nPTZFragmentNode[e][i],t.nPointNum<0)return H;t.pstPoints=[];for(var a=0;a<t.nPointNum;++a){var r={};r.fX=this.pPanoPTZPoints[e][n+a].fX,r.fY=this.pPanoPTZPoints[e][n+a].fY,t.pstPoints.push(r)}return 1}},{key:"GetPTZFragmentNum",value:function(e){return e<0||e>=ee||0==this.nPTZFragmentNum[e]?0:this.nPTZFragmentNum[e]}},{key:"CalcPTZFragmentPoints",value:function(e){if(e<0||e>=ee)return V;if(null==this.pPanoPTZPoints[e]||0==this.nPanoPTZPointNum[e])return H;this.nPTZFragmentNode[e][0]=0,this.nPTZFragmentNum[e]=1;for(var t=0,i=0;i<this.nPanoPTZPointNum[e]-1;i++)Math.abs(this.pPanoPTZPoints[e][i+1].fX-this.pPanoPTZPoints[e][i].fX)>.5&&(t=this.nPTZFragmentNum[e],this.nPTZFragmentNode[e][t]=i+1,this.nPTZFragmentNum[e]=this.nPTZFragmentNum[e]+1);var n=this.nPanoPTZPointNum[e];return Math.abs(this.pPanoPTZPoints[e][0].fX-this.pPanoPTZPoints[e][n-1].fX)<.5&&(this.pPanoPTZPoints[e][n].fX=this.pPanoPTZPoints[e][0].fX,this.pPanoPTZPoints[e][n].fY=this.pPanoPTZPoints[e][0].fY,this.nPanoPTZPointNum[e]=this.nPanoPTZPointNum[e]+1),t=this.nPTZFragmentNum[e],this.nPTZFragmentNode[e][t]=this.nPanoPTZPointNum[e],1}},{key:"IsPortAllocated",value:function(e){return this.bPortAllocated[e]}},{key:"GetPointFish2PanoCeiling",value:function(e,t,i){if(null==this.pRenderParam[this.nWndPort])return H;if(null==e)return V;var n,a;n=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),a=(this.fRX2-this.fRX1)/2*1;var r,o=0;(this.fRX2>1||this.fRY2>1||this.fRX1<0||this.fRY1<0)&&(this.fRX1<0&&(r=1*-this.fRX1)>o&&(o=r),this.fRX2>1&&(r=1*(this.fRX2-1))>o&&(o=r),this.fRY1<0&&(r=-this.fRY1*n)>o&&(o=r),this.fRY2>1&&(r=(this.fRY2-1)*n)>o&&(o=r));var s,l=o/a,c={fX:0,fY:0};if(Math.abs(t-.5)<ne&&Math.abs(i-.5)<ne)return U;var d={},u={};d.fX=t-.5,d.fY=i-.5,u.fX=-.5*Math.sin(this.pRenderParam[this.nWndPort].fAngle),u.fY=.5*Math.cos(this.pRenderParam[this.nWndPort].fAngle);var h=Math.sqrt(d.fX*d.fX+d.fY*d.fY),f=Math.sqrt(u.fX*u.fX+u.fY*u.fY);return s=Math.acos((d.fX*u.fX+d.fY*u.fY)/(h*f)),d.fX*u.fY-d.fY*u.fX>0&&(s=6.2831852-s),c.fX=s/6.2831853,c.fY=(2*(.5-h)-l)/(.8-l),c.fY>=0&&c.fX>=0&&c.fY<=1&&c.fX<=1?(e.fX=c.fX,e.fY=c.fY,1):V}},{key:"GetPointFish2PanoFloor",value:function(e,t,i){if(null==this.pRenderParam[this.nWndPort])return H;if(null==e)return V;var n,a;n=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),a=(this.fRX2-this.fRX1)/2*1;var r,o=0;(this.fRX2>1||this.fRY2>1||this.fRX1<0||this.fRY1<0)&&(this.fRX1<0&&(r=1*-this.fRX1)>o&&(o=r),this.fRX2>1&&(r=1*(this.fRX2-1))>o&&(o=r),this.fRY1<0&&(r=-this.fRY1*n)>o&&(o=r),this.fRY2>1&&(r=(this.fRY2-1)*n)>o&&(o=r));var s,l=o/a,c={fX:0,fY:0};if(Math.abs(t-.5)<ne&&Math.abs(i-.5)<ne)return U;var d={},u={};d.fX=t-.5,d.fY=i-.5,u.fX=-.5*Math.sin(this.pRenderParam[this.nWndPort].fAngle),u.fY=.5*Math.cos(this.pRenderParam[this.nWndPort].fAngle);var h=Math.sqrt(d.fX*d.fX+d.fY*d.fY),f=Math.sqrt(u.fX*u.fX+u.fY*u.fY);return s=Math.acos((d.fX*u.fX+d.fY*u.fY)/(h*f)),d.fX*u.fY-d.fY*u.fX>0&&(s=6.2831852-s),c.fX=1-s/6.2831853,c.fY=1-(2*(.5-h)-l)/(.8-l),c.fY>=0&&c.fX>=0&&c.fY<=1&&c.fX<=1?(e.fX=c.fX,e.fY=c.fY,1):V}},{key:"GetPointFish2PanoWall",value:function(e,t,i){if(null==this.pRenderParam[this.nWndPort])return H;if(null==e)return V;var n,a;n=(this.fRX2-this.fRX1)/(this.fRY2-this.fRY1),a=(this.fRX2-this.fRX1)/2*1;var r,o,s,l,c,d=0,u=1,h=.1,f=.9;this.fRX1<0&&(r=1*-this.fRX1,d=r/=2*a),this.fRX2>1&&(o=1*(this.fRX2-1),u=1-(o/=2*a)),this.fRY1<0&&(s=-this.fRY1*n,h=(s/=2*a)>.1?s:.1),this.fRY2>1&&(l=(this.fRY2-1)*n,f=(l/=2*a)>1-.9?1-l:.9);var x={fX:0,fY:0},p=2*t*a,m=2*i*a;return c=Math.sqrt(a*a-(m-a)*(m-a)),Math.abs(c)<ne?SR_ERR_PARAM:(t=a*(p-a)/c+a,i=m,x.fX=(t-2*d*a)/(2*(u-d)*a),x.fY=(i-2*h*a)/(2*(f-h)*a),x.fY>=0&&x.fX>=0&&x.fY<=1&&x.fX<=1?(e.fX=x.fX,e.fY=x.fY,1):V)}},{key:"UpdateRangeParam",value:function(e,t){if(null==this.pRenderParam[e])return H;if(t<1e-5||t>.6)return V;var i=0;return Y.SR_DE_FISH_PTZ_WALL!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PTZ_CEILING!=this.pRenderParam[e].nDisplayEffect&&Y.SR_DE_FISH_PTZ_FLOOR!=this.pRenderParam[e].nDisplayEffect||(i=7*t+.8,this.IsInImage(this.fRX1,this.fRX2,this.fRY1,this.fRY2,this.pRenderParam[e].fCosH,this.pRenderParam[e].fSinH,this.pRenderParam[e].fCosV,this.pRenderParam[e].fSinV,i,this.pRenderParam[e].nDisplayEffect))?(this.pRenderParam[e].fZoom=i,1):V}}]),t}(),be=32,Pe=function(){function t(){e(this,t),this.renderEngine="webgl",this.oVideoHandle=null,this.mainCanvasID=null,this.curTimestamp=0,this.mainSubPort=0,this.mainVaildSubPort=0,this.mainFECCorrect=Y.SR_DE_NULL,this.FECErrorCode=0,this.subPortNum=0,this.FECShowMode=2,this.pFishParamManager=null,this.InitFECParam(),this.privateLinesInfo=[],this.privateFontsInfo=[],this.privateImageInfo=[],this.bSRCallBackFlag=!1,this.curLinesInfo=null,this.curFontsInfo=null,this.curImagesInfo=null,this.maxPrivateLineTimeStamp=0,this.hasSetFECParamManager=!1,this.pWaterFontParam=[],this.pWaterImageParam=[],this.waterMarkImageIndex=0,this.waterMarkImageMax=1,this.aPOSAdaptBuf=[]}return o(t,[{key:"InitDisplay",value:function(e,t,i){return this.renderEngine=t,this.mainCanvasID=e,"2d"===this.renderEngine||"2D"===this.renderEngine?(this.oVideoHandle=new ye,console.log("2d render")):(this.oVideoHandle=new ve,this.mainFECCorrect!=Y.SR_DE_NULL&&(null==this.pFishParamManager&&(this.pFishParamManager=new Se),this.oVideoHandle.SR_SetFishParamManager(this.pFishParamManager),this.hasSetFECParamManager=!0),console.log("webgl render")),this.oVideoHandle.SR_Init(e,i),this.mainVaildSubPort=this.oVideoHandle.SR_AddSubPort(this.mainFECCorrect),-1==this.mainVaildSubPort?(console.info("%c InitDisplay SR_AddSubPort error subport:%d","color: red",this.mainVaildSubPort),0):(null==this.stFishEyeManager[0].pRender&&this.mainFECCorrect!==Y.SR_DE_NULL&&(this.stFishEyeManager[0].pRender=this.oVideoHandle,this.stFishEyeManager[0].nSubPort=0,this.stFishEyeManager[0].sCanvasID=this.mainCanvasID,this.stFishEyeManager[0].bUsed=1,this.stFishEyeManager[0].bInited=1,this.stFishEyeManager[0].nValidSubPort=this.mainVaildSubPort),1)}},{key:"ReleaseDisplay",value:function(){if(null!=this.oVideoHandle&&(this.oVideoHandle.SR_DelSubPort(this.mainVaildSubPort),this.oVideoHandle.SR_Destroy(),this.oVideoHandle=null),this.subPortNum>0)for(var e=1;e<be;e++)0!=this.stFishEyeManager[e].nSubPort&&null!=this.stFishEyeManager[e].sCanvasID&&0!=this.stFishEyeManager[e].bInited&&(this.FEC_Disable(e),this.FEC_DelPort(e));for(var t=0;t<be;t++)this.stFishEyeManager[t].pRender=null;return this.stFishEyeManager.splice(0,this.stFishEyeManager.length),this.stFishParam.splice(0,this.stFishParam.length),null!=this.pFishParamManager&&(this.pFishParamManager.DeInit(),this.pFishParamManager=null),this.FECShowMode=2,this.DeInitPrivateParam(),1}},{key:"DeInitPrivateParam",value:function(){this.privateLinesInfo.splice(0,this.privateLinesInfo.length),this.privateFontsInfo.splice(0,this.privateFontsInfo.length),this.privateImageInfo.splice(0,this.privateImageInfo.length),this.pWaterFontParam.splice(0,this.pWaterFontParam.length),this.pWaterImageParam.splice(0,this.pWaterImageParam.length),this.bSRCallBackFlag=!1,this.curLinesInfo=null}},{key:"DisplayFrame",value:function(e,t,i,n,a,r){var o=this;return new Promise((function(s){var l=-1;if(null!=e&&(l=n),o.bSRCallBackFlag||(null!=o.oVideoHandle&&o.oVideoHandle.SR_SetCallBack(o.WebGLDisplayCallBack,o,0),o.bSRCallBackFlag=!0),null!=e&&(0==o.privateLinesInfo.length&&0==o.privateFontsInfo.length&&0==o.privateImageInfo.length||(o.curTimestamp=l,o.FindIntelNodefromList(o.curTimestamp)),null!=o.oVideoHandle&&o.oVideoHandle.SR_Draw(e,t,i,a,r),o.subPortNum>0))for(var c=1;c<be;c++)0!=o.stFishEyeManager[c].nSubPort&&null!=o.stFishEyeManager[c].sCanvasID&&0!=o.stFishEyeManager[c].bInited&&null!=o.stFishEyeManager[c].pRender&&o.stFishEyeManager[c].pRender.SR_Draw(e,t,i,null,null);s(l)}))}},{key:"SetDisplayRect",value:function(e,t,i,n){return null!=this.oVideoHandle?this.oVideoHandle.SR_SetDisplayRect(e,t,i,n,1):0}},{key:"SetCanvasSize",value:function(e,t){return null!=this.oVideoHandle?this.oVideoHandle.SR_SetCanvasSize(e,t):0}},{key:"GetCanvasSize",value:function(){return null!=this.oVideoHandle?this.oVideoHandle.SR_GetCanvasSize():0}},{key:"SetAntialias",value:function(e){return null!=this.oVideoHandle?this.oVideoHandle.SR_SetAntialias(e):0}},{key:"SetD3DPostProcess",value:function(e,t){return null!=this.oVideoHandle?this.oVideoHandle.SR_SetImagePostProcess(e,t):0}},{key:"InitFECParam",value:function(){this.stFishEyeManager=[];for(var e=0;e<be;e++)this.stFishEyeManager[e]={},this.stFishEyeManager[e].pRender=null,this.stFishEyeManager[e].nSubPort=0,this.stFishEyeManager[e].sCanvasID=null,this.stFishEyeManager[e].bUsed=0,this.stFishEyeManager[e].bInit=0,this.stFishEyeManager[e].nValidSubPort=0,this.stFishEyeManager[e].emPlaceType=3,this.stFishEyeManager[e].emCorrectType=0,this.stFishEyeManager[e].emEffect=Y.SR_DE_FISH_ORIGINAL;this.stFishParam=[];for(var t=0;t<be;t++)this.stFishParam[t]={},this.stFishParam[t].nUpDateType=0,this.stFishParam[t].stPTZParam={},this.stFishParam[t].stPTZParam.fPTZPositionX=0,this.stFishParam[t].stPTZParam.fPTZPositionY=0,this.stFishParam[t].stCycleParam={},this.stFishParam[t].stCycleParam.fRadiusLeft=0,this.stFishParam[t].stCycleParam.fRadiusRight=0,this.stFishParam[t].stCycleParam.fRadiusTop=0,this.stFishParam[t].stCycleParam.fRadiusBottom=0,this.stFishParam[t].fZoom=0,this.stFishParam[t].fWideScanOffset=0,this.stFishParam[t].stPTZColor={},this.stFishParam[t].stPTZColor.nR=0,this.stFishParam[t].stPTZColor.nG=0,this.stFishParam[t].stPTZColor.nB=0,this.stFishParam[t].stPTZColor.nAlpha=0,this.stFishParam[t].stPTZSelect={},this.stFishParam[t].stPTZSelect.fTop=0,this.stFishParam[t].stPTZSelect.fBottom=0,this.stFishParam[t].stPTZSelect.fLeft=0,this.stFishParam[t].stPTZSelect.fRight=0,this.stFishParam[t].nCut=0}},{key:"FEC_SetCanvasID",value:function(e){return this.mainFECCorrect=Y.SR_DE_FISH_ORIGINAL,1}},{key:"FEC_ResetCorrectType",value:function(e,t,i){if(!1===this.hasSetFECParamManager&&(null==this.pFishParamManager&&(this.pFishParamManager=new Se),this.oVideoHandle.SR_SetFishParamManager(this.pFishParamManager),this.hasSetFECParamManager=!0),0!=i&&i!=T&&i!=R&&i!=I&&i!=C&&i!=w&&i!=D&&i!=A&&i!=M)return console.log("%c 20231122 hardDecoder not support correctType:%d","color:red",i),this.FECErrorCode=16,0;if(1!=this.FECParamJudge(e,t,i))return 0;var n;if(n=this._ConvertDisplayEffect(t,i),0==e&&null==this.stFishEyeManager[e].pRender&&(this.stFishEyeManager[e].pRender=this.oVideoHandle,this.stFishEyeManager[e].nSubPort=e,this.stFishEyeManager[e].sCanvasID=this.mainCanvasID,this.stFishEyeManager[e].bUsed=1,this.stFishEyeManager[e].bInited=1,this.stFishEyeManager[e].nValidSubPort=this.mainVaildSubPort,this.stFishEyeManager[e].emPlaceType=t,this.stFishEyeManager[e].emCorrectType=i,this.stFishEyeManager[e].emEffect=n,this.mainFECCorrect=n),null!=this.stFishEyeManager[e].pRender){this.stFishEyeManager[e].pRender.SR_DelSubPort(this.stFishEyeManager[e].nValidSubPort);var a=this.stFishEyeManager[e].pRender.SR_AddSubPort(n);if(-1==a)return console.info("%c FEC_ResetCorrectType SR_AddSubPort error subport:%d","color: red",a),0;if(this.stFishEyeManager[e].nValidSubPort=a,this.stFishEyeManager[e].emPlaceType=t,this.stFishEyeManager[e].emCorrectType=i,this.stFishEyeManager[e].emEffect=n,I<=this.stFishEyeManager[e].emCorrectType){var r=this.stFishEyeManager[e].pRender.SR_SetRenderState(2,0);1!=r&&console.log(">>>VideoRender.js SR_SetRenderState failed ret:%08x\n",r)}}return this.FECShowMode>0&&null!=this.stFishEyeManager[e].pRender&&this.stFishEyeManager[e].pRender.SR_SetPTZDisplayMode(this.FECShowMode),0==e&&(this.mainVaildSubPort=this.stFishEyeManager[e].nValidSubPort),1}},{key:"FEC_GetPort",value:function(e,t){if(0!=t&&t!=T&&t!=R&&t!=I&&t!=C&&t!=w&&t!=D&&t!=A&&t!=M)return console.log("%c 20231112 hardDecoder not support emCorrectType:%d","color:red",t),this.FECErrorCode=16,-1;var i;if(1!=this.FECParamJudge(-1,e,t))return-1;var n,a=0;for(i=1;i<be;i++)if(0==this.stFishEyeManager[i].nSubPort&&0==this.stFishEyeManager[i].bUsed){this.stFishEyeManager[i].nSubPort=i,this.stFishEyeManager[i].nValidSubPort=-1,this.stFishEyeManager[i].bUsed=1,this.stFishEyeManager[i].emPlaceType=e,this.stFishEyeManager[i].emCorrectType=t,a=i;break}return be==i?(console.info("%c FEC_GetPort-12 fish subport max","color: red"),this.FECErrorCode=1284,-1):(n=this._ConvertDisplayEffect(this.stFishEyeManager[a].emPlaceType,this.stFishEyeManager[a].emCorrectType),Y.SR_DE_FISH_ORIGINAL!=n?(0==this.stFishEyeManager[a].bInited&&(this.stFishEyeManager[a].emEffect=n,this.stFishEyeManager[a].bInited=0,this.stFishParam[a].fZoom=.005,this.stFishParam[a].stPTZParam.fPTZPositionX=.5,this.stFishParam[a].stPTZParam.fPTZPositionY=.5,this.stFishParam[a].fWideScanOffset=0),this.FECErrorCode=0,this.subPortNum++,a):a<be&&0==this.stFishEyeManager[a].bInited?(this.stFishEyeManager[a].emEffect=n,this.stFishEyeManager[a].bInited=0,this.stFishParam[a].fZoom=0,this.stFishParam[a].stPTZParam.fPTZPositionX=0,this.stFishParam[a].stPTZParam.fPTZPositionY=0,this.stFishParam[a].fWideScanOffset=0,this.FECErrorCode=0,this.subPortNum++,a):(this.stFishEyeManager[i].pRender=null,this.stFishEyeManager[i].nSubPort=0,this.stFishEyeManager[i].sCanvasID=null,this.stFishEyeManager[i].bUsed=0,this.stFishEyeManager[i].bInited=0,this.stFishEyeManager[i].nValidSubPort=0,this.stFishEyeManager[i].emPlaceType=3,this.stFishEyeManager[i].emCorrectType=0,this.stFishEyeManager[i].emEffect=Y.SR_DE_FISH_ORIGINAL,this.FECErrorCode=v,-1))}},{key:"FECParamJudge",value:function(e,t,i){if((2==t||3==t)&&w==i)return console.info("%c FEC_GetPort-1 floor and ceiling not support lat","color: red"),this.FECErrorCode=v,0;if(1==t&&D==i)return console.info("%c FEC_GetPort-2 wall not support cylinger","color: red"),this.FECErrorCode=v,0;if(1==t&&k==i)return console.info("%c FEC_GetPort-3 wall not support split cylinger","color: red"),this.FECErrorCode=v,0;if((2==t||3==t)&&A==i)return console.info("%c FEC_GetPort-4 floor and ceiling not support horizontal","color: red"),this.FECErrorCode=v,0;if((2==t||3==t)&&M==i)return console.info("%c FEC_GetPort-5 floor and ceiling not support vertical","color: red"),this.FECErrorCode=v,0;if(1!=t&&2!=t&&3!=t)return console.info("%c FEC_GetPort-6 emPlaceType only support floor, ceiling and wall","color: red"),this.FECErrorCode=MP_E_SUPPORT,0;if(0!=i&&i!=C&&i!=T&&i!=R&&i!=w&&i!=I&&i!=D&&i!=k&&i!=F&&i!=A&&i!=M)return console.info("%c FEC_GetPort-7 emCorrectType error","color: red"),this.FECErrorCode=MP_E_SUPPORT,0;for(var n=0;n<be;n++)if(n!=e){if(this.stFishEyeManager[n].bUsed&&this.stFishEyeManager[n].emPlaceType!=t)return console.info("%c FEC_GetPort-8 emPlaceType changed","color: red"),this.FECErrorCode=1303,0;if(this.stFishEyeManager[n].bUsed&&this.stFishEyeManager[n].emCorrectType!=C&&this.stFishEyeManager[n].emCorrectType!=I&&this.stFishEyeManager[n].emCorrectType!=D&&this.stFishEyeManager[n].emCorrectType!=k&&this.stFishEyeManager[n].emCorrectType!=F&&this.stFishEyeManager[n].emCorrectType!=A&&this.stFishEyeManager[n].emCorrectType!=M&&i!=C&&i!=I&&i!=D&&i!=k&&i!=F&&i!=A&&i!=M)return console.info("%c FEC_GetPort-9 origin/180/360/lat only display one port","color: red"),this.FECErrorCode=1304,0;if(this.stFishEyeManager[n].bUsed&&(this.stFishEyeManager[n].emCorrectType==C&&i==T||this.stFishEyeManager[n].emCorrectType==T&&i==C))return console.info("%c FEC_GetPort-10 180 cannot support ptz","color: red"),this.FECErrorCode=1304,0}return 1}},{key:"FEC_Enable",value:function(e){return e<1||e>31||null==e?(console.info("%c FEC_Enable-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0):null!==this.stFishEyeManager[e].pRender?(console.info("%c FEC_Enable-2 nSubPort:%d","color: red",e),this.FECErrorCode=1301,0):(null==this.stFishEyeManager[e].pRender&&(this.stFishEyeManager[e].pRender=new ve,null==this.pFishParamManager&&(this.pFishParamManager=new Se),this.stFishEyeManager[e].pRender.SR_SetFishParamManager(this.pFishParamManager)),1)}},{key:"FEC_SetWnd",value:function(e,t){if(e<1||e>31||null==e)return console.info("%c FEC_SetWnd-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0;if(null==this.stFishEyeManager[e].pRender)return console.info("%c FEC_SetWnd-2 nSubPort:%d pRender is null","color: red",e),this.FECErrorCode=_,0;if(0==this.stFishEyeManager[e].bUsed)return console.info("%c FEC_SetWnd-3 nSubPort:%d bUsed:%d","color: red",e,this.stFishEyeManager[e].bUsed),this.FECErrorCode=g,0;if(null==t)return console.info("%c FEC_SetWnd-4 nSubPort:%d sCanvasID:%s","color: red",e,t),this.FECErrorCode=1305,0;if(0!=this.stFishEyeManager[e].nSubPort&&0!=this.stFishEyeManager[e].bUsed){if(0!=this.stFishEyeManager[e].bInited&&null!=this.stFishEyeManager[e].sCanvasID)return t!=this.stFishEyeManager[e].sCanvasID?(console.info("%c FEC_SetWnd-5 nSubPort:%d sCanvasID:%s already init","color: red",e,t),this.FECErrorCode=1286,0):1;var i;i=this._ConvertDisplayEffect(this.stFishEyeManager[e].emPlaceType,this.stFishEyeManager[e].emCorrectType);var n=this.stFishEyeManager[e].pRender.SR_Init(t,X),a=this.stFishEyeManager[e].pRender.SR_AddSubPort(i);if(-1==a)return console.info("%c FEC_SetWnd SR_AddSubPort error subport:%d","color: red",e),0;if(this.stFishEyeManager[e].nValidSubPort=a,1!=n)return this.stFishEyeManager[e].bInited=0,this.stFishEyeManager[e].sCanvasID=null,this.FECErrorCode=g,0;if(this.stFishEyeManager[e].bInited=1,this.stFishEyeManager[e].sCanvasID=t,I<=this.stFishEyeManager[e].emCorrectType){var r=this.stFishEyeManager[e].pRender.SR_SetRenderState(2,0);1!=r&&console.log(">>>VideoRender.js SR_SetRenderState failed ret:%08x\n",r)}return this.FECShowMode>0&&this.stFishEyeManager[e].pRender.SR_SetPTZDisplayMode(this.FECShowMode),1}return this.FECErrorCode=g,0}},{key:"FEC_Disable",value:function(e,t,i){if(e<1||e>31||null==e)return console.info("%c FEC_Disable-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0;if(1==this.stFishEyeManager[e].bInited&&null!=this.stFishEyeManager[e].pRender){if(1!=this.stFishEyeManager[e].pRender.SR_DelSubPort(this.stFishEyeManager[e].nValidSubPort))return console.info("%c FEC_Disable-2 SR_DelSubPort error nSubPort:%d","color: red",e),0;this.stFishEyeManager[e].bInited=0,this.stFishEyeManager[e].nValidSubPort=-1,this.stFishEyeManager[e].pRender.SR_Destroy(),this.stFishEyeManager[e].pRender=null}return 1}},{key:"FEC_DelPort",value:function(e){return e<1||e>31||null==e?(console.info("%c FEC_DelPort-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0):0==this.stFishEyeManager[e].bUsed?(console.info("%c FEC_DelPort-2 nSubPort:%d bUsed:%d","color: red",e,this.stFishEyeManager[e].bUsed),this.FECErrorCode=g,0):(this.stFishEyeManager[e].nSubPort=0,this.stFishEyeManager[e].sCanvasID=null,this.stFishEyeManager[e].bUsed=0,this.stFishEyeManager[e].bInited=0,this.stFishEyeManager[e].nValidSubPort=0,this.stFishEyeManager[e].emPlaceType=3,this.stFishEyeManager[e].emCorrectType=0,this.stFishEyeManager[e].emEffect=Y.SR_DE_FISH_ORIGINAL,this.stFishParam[e].stCycleParam.fRadiusLeft=0,this.stFishParam[e].stCycleParam.fRadiusRight=1,this.stFishParam[e].stCycleParam.fRadiusTop=0,this.stFishParam[e].stCycleParam.fRadiusBottom=1,this.subPortNum>0&&this.subPortNum--,1)}},{key:"FEC_SetParam",value:function(e,t){if(this.FECErrorCode=0,e<0||e>31||null==e)return console.info("%c FEC_SetParam-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0;if(null==this.stFishEyeManager[e].pRender)return console.info("%c FEC_SetParam-2 nSubPort:%d pRender:%d","color: red",e,this.stFishEyeManager[e].pRender),this.FECErrorCode=_,0;if(0==this.stFishEyeManager[e].bUsed)return console.info("%c FEC_SetParam-3 nSubPort:%d bUsed:%d","color: red",e,this.stFishEyeManager[e].bUsed),this.FECErrorCode=g,0;if(this.stFishEyeManager[e].emCorrectType>=I&&this.stFishEyeManager[e].emCorrectType<=M&&30&t.upDateType)return console.info("%c FEC_SetParam-4 nSubPort:%d not 3D","color: red",e),this.FECErrorCode=b,0;if(1&t.upDateType){if(null==t.stCycleParam)return this.FECErrorCode=S,0;for(var i=1;i<be;i++){if(this.stFishEyeManager[i].bUsed&&this.stFishEyeManager[i].nSubPort&&A==this.stFishEyeManager[i].emCorrectType&&(t.stCycleParam.fRadiusLeft<=-.5||t.stCycleParam.fRadiusLeft>=.4||t.stCycleParam.fRadiusRight<=.6||t.stCycleParam.fRadiusRight>=1.5||t.stCycleParam.fRadiusTop<=-.5||t.stCycleParam.fRadiusTop>0||t.stCycleParam.fRadiusBottom<1||t.stCycleParam.fRadiusBottom>=1.5||t.stCycleParam.fRadiusLeft+t.stCycleParam.fRadiusRight<=.8||t.stCycleParam.fRadiusLeft+t.stCycleParam.fRadiusRight>=1.2||t.stCycleParam.fRadiusTop+t.stCycleParam.fRadiusBottom<=.8||t.stCycleParam.fRadiusTop+t.stCycleParam.fRadiusBottom>=1.2))return this.FECErrorCode=S,0;if(this.stFishEyeManager[i].bUsed&&this.stFishEyeManager[i].nSubPort&&M==this.stFishEyeManager[i].emCorrectType&&(t.stCycleParam.fRadiusLeft<=-.5||t.stCycleParam.fRadiusLeft>0||t.stCycleParam.fRadiusRight<1||t.stCycleParam.fRadiusRight>=1.5||t.stCycleParam.fRadiusTop<=-.5||t.stCycleParam.fRadiusTop>=.4||t.stCycleParam.fRadiusBottom<=.6||t.stCycleParam.fRadiusBottom>=1.5||t.stCycleParam.fRadiusLeft+t.stCycleParam.fRadiusRight<=.8||t.stCycleParam.fRadiusLeft+t.stCycleParam.fRadiusRight>=1.2||t.stCycleParam.fRadiusTop+t.stCycleParam.fRadiusBottom<=.8||t.stCycleParam.fRadiusTop+t.stCycleParam.fRadiusBottom>=1.2))return this.FECErrorCode=S,0}}if(0==this.stFishEyeManager[e].bInited){if(4&t.upDateType){if(T!=this.stFishEyeManager[e].emCorrectType&&R!=this.stFishEyeManager[e].emCorrectType||1==this.stFishEyeManager[e].emPlaceType)return this.FECErrorCode=b,0;for(var n=1;n<be;n++)if(this.stFishEyeManager[n].nSubPort&&this.stFishEyeManager[n].bUsed&&this.stFishEyeManager[n].emCorrectType==C)return this.FECErrorCode=y,0;this.stFishParam[e].fWideScanOffset=t.fValue}if(16&t.upDateType){if(null==t.stPTZColor)return this.FECErrorCode=S,0;if(t.stPTZColor.nR>255||t.stPTZColor.nG>255||t.stPTZColor.nB>255||t.stPTZColor.nAlpha>255)return this.FECErrorCode=b,0;this.stFishParam[e].stPTZColor.nR=t.stPTZColor.nR,this.stFishParam[e].stPTZColor.nG=t.stPTZColor.nG,this.stFishParam[e].stPTZColor.nB=t.stPTZColor.nB,this.stFishParam[e].stPTZColor.nAlpha=t.stPTZColor.nAlpha}if(8&t.upDateType){if(C!=this.stFishEyeManager[e].emCorrectType)return this.FECErrorCode=b,0;this.stFishParam[e].stPTZParam.fPTZPositionX=t.fPTZParam.fPTZPositionX,this.stFishParam[e].stPTZParam.fPTZPositionY=t.fPTZParam.fPTZPositionY}if(2&t.upDateType){if(C!=this.stFishEyeManager[e].emCorrectType)return this.FECErrorCode=b,0;this.stFishParam[e].fZoom=t.fPTZZoom}if(32&t.upDateType){if(null==this.stFishParam.stPTZSelect)return 0;if(C!=this.stFishEyeManager[e].emCorrectType)return this.FECErrorCode=b,0;this.stFishParam.stPTZSelect.fTop=t.stPTZSelect.fTop,this.stFishParam.stPTZSelect.fBottom=t.stPTZSelect.fBottom,this.stFishParam.stPTZSelect.fLeft=t.stPTZSelect.fLeft,this.stFishParam.stPTZSelect.fRight=t.stPTZSelect.fRight}if(1&t.upDateType){if(null==t.stCycleParam)return this.FECErrorCode=S,0;if(0==this._IsValidRadiusParam(t.stCycleParam))return this.FECErrorCode=S,0;this.stFishParam[0].stCycleParam.fRadiusLeft=t.stCycleParam.fRadiusLeft,this.stFishParam[0].stCycleParam.fRadiusRight=t.stCycleParam.fRadiusRight,this.stFishParam[0].stCycleParam.fRadiusTop=t.stCycleParam.fRadiusTop,this.stFishParam[0].stCycleParam.fRadiusBottom=t.stCycleParam.fRadiusBottom}return 1}if(4&t.upDateType){if(T!=this.stFishEyeManager[e].emCorrectType&&R!=this.stFishEyeManager[e].emCorrectType||1==this.stFishEyeManager[e].emPlaceType)return this.FECErrorCode=b,0;for(var a=1;a<be;a++)if(this.stFishEyeManager[a].nSubPort&&this.stFishEyeManager[a].bUsed&&this.stFishEyeManager[a].emCorrectType==C)return this.FECErrorCode=y,0;var r={nFishParamType:2,bBlack:0};if(r.fAngle=t.fValue,1!=this.stFishEyeManager[e].pRender.SR_SetFishParam(r))return this.FECErrorCode=y,0;this.stFishParam[e].fWideScanOffset=t.fValue}if(16&t.upDateType){if(null==t.stPTZColor)return this.FECErrorCode=b,0;if(t.stPTZColor.nR>255||t.stPTZColor.nG>255||t.stPTZColor.nB>255||t.stPTZColor.nAlpha>255)return this.FECErrorCode=b,0;var o={};o.fR=float(t.stPTZColor.nR/255),o.fG=float(t.stPTZColor.nG/255),o.fB=float(t.stPTZColor.nB/255),o.fA=float(t.stPTZColor.nAlpha/255),this.stFishParam[e].stPTZColor.nR=t.stPTZColor.nR,this.stFishParam[e].stPTZColor.nG=t.stPTZColor.nG,this.stFishParam[e].stPTZColor.nB=t.stPTZColor.nB,this.stFishParam[e].stPTZColor.nAlpha=t.stPTZColor.nAlpha}if(8&t.upDateType){if(C!=this.stFishEyeManager[e].emCorrectType)return this.FECErrorCode=b,0;var s={nFishParamType:4,bBlack:0};if(s.fPTZX=t.fPTZParam.fPTZPositionX,s.fPTZY=t.fPTZParam.fPTZPositionY,1!=this.stFishEyeManager[e].pRender.SR_SetFishParam(s))return this.FECErrorCode=y,0;this.stFishParam[e].stPTZParam.fPTZPositionX=t.fPTZParam.fPTZPositionX,this.stFishParam[e].stPTZParam.fPTZPositionY=t.fPTZParam.fPTZPositionY}if(2&t.upDateType){if(C!=this.stFishEyeManager[e].emCorrectType)return this.FECErrorCode=b,0;var l={nFishParamType:3,bBlack:0};if(l.fZoom=t.fPTZZoom,1!=this.stFishEyeManager[e].pRender.SR_SetFishParam(l))return this.FECErrorCode=y,0;this.stFishParam[e].fZoom=t.fPTZZoom}if(1&t.upDateType){if(0==this._IsValidRadiusParam(t.stCycleParam))return this.FECErrorCode=S,0;var c={nFishParamType:1,bBlack:1};if(c.fRXLeft=t.stCycleParam.fRadiusLeft,c.fRXRight=t.stCycleParam.fRadiusRight,c.fRYTop=t.stCycleParam.fRadiusTop,c.fRYBottom=t.stCycleParam.fRadiusBottom,1!=this.stFishEyeManager[e].pRender.SR_SetFishParam(this.stFishEyeManager[e].nValidSubPort,c))return this.FECErrorCode=S,0;this.stFishParam[0].stCycleParam.fRadiusLeft=t.stCycleParam.fRadiusLeft,this.stFishParam[0].stCycleParam.fRadiusRight=t.stCycleParam.fRadiusRight,this.stFishParam[0].stCycleParam.fRadiusTop=t.stCycleParam.fRadiusTop,this.stFishParam[0].stCycleParam.fRadiusBottom=t.stCycleParam.fRadiusBottom}return 32&t.upDateType&&C==this.stFishEyeManager[e].emCorrectType&&1!=this.stFishEyeManager[e].pRender.SR_SetFishParam(this.stFishEyeManager[e].stPTZSelect)?(this.FECErrorCode=1299,0):1}},{key:"FEC_GetParam",value:function(e,t){return e<0||e>31||null==e?(console.info("%c FEC_GetParam-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0):null==this.stFishEyeManager[e].pRender?(console.info("%c FEC_GetParam-2 pRender:%d","color: red",this.stFishEyeManager[e].pRender),this.FECErrorCode=_,0):(this.stFishEyeManager[e].pRender.SR_GetFishParam(t),t.emCorrectType=this.stFishEyeManager[e].emCorrectType,1)}},{key:"_IsValidRadiusParam",value:function(e){return e.fRadiusBottom<=e.fRadiusTop||e.fRadiusRight<=e.fRadiusLeft?0:1}},{key:"FEC_SetViewParam",value:function(e,t,i){return e<0||e>31||null==e?(console.info("%c FEC_SetViewParam-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0):null==this.stFishEyeManager[e].pRender?(console.info("%c FEC_SetViewParam-2 pRender:%d","color: red",this.stFishEyeManager[e].pRender),this.FECErrorCode=_,0):t<1||t>3?(this.FECErrorCode=E,0):(this.FECErrorCode=0,0==this.stFishEyeManager[e].bInited?(this.FECErrorCode=g,0):I<=this.stFishEyeManager[e].emCorrectType?1!=this.stFishEyeManager[e].pRender.SR_SetViewParam(t,i)?(this.FECErrorCode=E,0):1:(this.FECErrorCode=b,0))}},{key:"FEC_GetViewParam",value:function(e,t,i){return i.fValue=-1,e<0||e>31||null==e?(console.info("%c FEC_GetViewParam-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0):null==this.stFishEyeManager[e].pRender?(console.info("%c FEC_GetViewParam-2 pRender:%d","color: red",this.stFishEyeManager[e].pRender),this.FECErrorCode=_,0):t<1||t>3||0==this.stFishEyeManager[e].bInited?0:(I<=this.stFishEyeManager[e].emCorrectType&&this.stFishEyeManager[e].pRender.SR_GetViewParam(t,i),1)}},{key:"FEC_SetDisplayRegion",value:function(e,t,i,n,a,r,o){return e<0||e>31||null==e?(console.info("%c FEC_SetDisplayRegion-1 nSubPort:%d","color: red",e),this.FECErrorCode=P,0):null==this.stFishEyeManager[e].pRender?(console.info("%c FEC_SetDisplayRegion-2 pRender:%d","color: red",this.stFishEyeManager[e].pRender),this.FECErrorCode=_,0):0!=t||0!=i?(this.FECErrorCode=E,0):0!=this.stFishEyeManager[e].emCorrectType&&this.stFishEyeManager[e].emCorrectType!=T&&this.stFishEyeManager[e].emCorrectType!=R&&this.stFishEyeManager[e].emCorrectType!=w?(this.FECErrorCode=v,0):0==this.stFishEyeManager[e].bInited?(this.FECErrorCode=g,0):n<0||a<0||r<0||o<0?(this.FECErrorCode=E,0):1!=this.stFishEyeManager[e].pRender.SR_SetDisplayRect(n,a,r,o,1)?(this.FECErrorCode=1297,0):1}},{key:"FEC_SetBackCilling",value:function(e,t){return e<0||e>31||null==e?(this.FECErrorCode=P,0):null==this.stFishEyeManager[e].pRender?(this.FECErrorCode=_,0):0==this.stFishEyeManager[e].bInited?(this.FECErrorCode=g,0):1!=this.stFishEyeManager[e].pRender.SR_SetRenderState(2,t)?(this.FECErrorCode=1297,0):1}},{key:"FEC_GetPTZPort",value:function(e,t,i){if(null!=this.stFishEyeManager[e].pRender){var n={nPTZPort:-1};if(1==this.stFishEyeManager[e].pRender.SR_GetPTZPort(t,i,n))return n.nPTZPort}return-1}},{key:"FEC_SetPTZDisplayMode",value:function(e){return e>=0&&e<=2?(null!=this.stFishEyeManager[0].pRender&&this.stFishEyeManager[0].pRender.SR_SetPTZDisplayMode(e),this.FECShowMode=e,1):(console.info("%c FEC_SetPTZDisplayMode ptzMode:%d","color: red",e),0)}},{key:"CheckFrameRGB",value:function(e,t,i,n,a,r){if(null==e)return 0;for(var o=e.width/(n-1),s=e.height/(i-1),l=0,c=0,d=[],u=0;u<i*n;u++)d[u]=0,this.aPOSAdaptBuf[u]=0;if(t){for(var h=0,f=0;f<e.height;f++)for(var x=0;x<e.width;x++){l=(l=Math.round(x/(o/2)/2))<n?l:n-1,c=(c=Math.round(f/(s/2)/2))<i?c:i-1;var p=e.pBuffer[h],m=e.pBuffer[h+1],_=e.pBuffer[h+2],g=Math.round(.299*p+.587*m+.114*_);this.aPOSAdaptBuf[l+c*n]+=g,d[l+c*n]++,h+=4}for(var v=0,y=0;y<i*n;y++)v=this.aPOSAdaptBuf[y]/d[y],this.aPOSAdaptBuf[y]=v>128?0:1}else{for(var S=Math.round(a*e.width),b=Math.round(r*e.height),P=b-2;P<b+2;P++)for(var E=S-2;E<S+2;E++){var C=4*Math.floor((4*E+P*e.width*4)/4),T=e.pBuffer[C],R=e.pBuffer[C+1],w=e.pBuffer[C+2],I=Math.round(.299*T+.587*R+.114*w);this.aPOSAdaptBuf[0]+=I,d[0]++}this.aPOSAdaptBuf[0]=this.aPOSAdaptBuf[0]/d[0]>128?0:1}return 1}},{key:"GetWaterFontParam",value:function(e){var t=e.pFontString.length,i=e.pstFontRotate.fRotateAngle%360/360*2*Math.PI,n=Math.min(e.pstFontSize.nFontWidth,e.pstFontSize.nFontHeight),a=n/this.mainCanvasID.width,r=n/this.mainCanvasID.height,o=a*Math.cos(Math.PI/2-i)*e.pSpace,s=r*Math.sin(Math.PI/2-i)*e.pSpace,l=[],c=[],d=[];if(e.nFontAlign)for(var u=0;u<t;u++)l[u]=e.pFontString[0].length*a/6,c[u]=Math.atan2(l[0],s),d[u]=Math.sqrt(l[0]*l[0],s*s);else for(var h=0;h<t;h++)l[h]=0,c[h]=0,d[h]=0;var f=Math.floor(e.pstFontNumber.nRowNumber),x=Math.floor(e.pstFontNumber.nColNumber),p=f*x;if(e.pstFontRotate.fFillFullScreen){for(var m=[],_=[],g=1/(f-1),v=0;v<f;v++)m[v]=g*v-s*((t-1)/2);for(var y=1/(x-1),S=0;S<x;S++)_[S]=y*S+o*((t-1)/2);for(var b=0;b<p;++b)for(var P=0;P<t;P++){this.pWaterFontParam[t*b+P]={},this.pWaterFontParam[t*b+P].pString=e.pFontString[P],this.pWaterFontParam[t*b+P].nFontWidth=n,this.pWaterFontParam[t*b+P].nFontHeight=n,this.pWaterFontParam[t*b+P].pstStartPos={};var E=b%x,C=Math.floor(b/x),T=Math.PI/2-i+c[P];this.pWaterFontParam[t*b+P].pstStartPos.fX=_[E]-P*o+d[P]*Math.cos(T),this.pWaterFontParam[t*b+P].pstStartPos.fY=m[C]+P*s-d[P]*Math.sin(T),e.nColorAdapt?(this.pWaterFontParam[t*b+P].pstFontColor={},this.pWaterFontParam[t*b+P].pstFontColor.fR=this.aPOSAdaptBuf[b],this.pWaterFontParam[t*b+P].pstFontColor.fG=this.aPOSAdaptBuf[b],this.pWaterFontParam[t*b+P].pstFontColor.fB=this.aPOSAdaptBuf[b],this.pWaterFontParam[t*b+P].pstFontColor.fA=e.pstFontColor.fA):this.pWaterFontParam[t*b+P].pstFontColor=e.pstFontColor,this.pWaterFontParam[t*b+P].bBackGround=!1,this.pWaterFontParam[t*b+P].pstBGColor=null,this.pWaterFontParam[t*b+P].fRotateAngle=e.pstFontRotate.fRotateAngle,this.pWaterFontParam[t*b+P].pFontFamily=e.pFontFamily,e.nFontAlign?(this.pWaterFontParam[t*b+P].textAlign="left",this.pWaterFontParam[t*b+P].textBaseline="top"):(this.pWaterFontParam[t*b+P].textAlign="center",this.pWaterFontParam[t*b+P].textBaseline="middle")}}else for(var R=0;R<e.pFontString.length;R++)this.pWaterFontParam[R]={},this.pWaterFontParam[R].pString=e.pFontString[R],this.pWaterFontParam[R].nFontWidth=n,this.pWaterFontParam[R].nFontHeight=n,this.pWaterFontParam[R].pstStartPos={},this.pWaterFontParam[R].pstStartPos.fX=e.pstStartPos.fX-R*o,this.pWaterFontParam[R].pstStartPos.fY=e.pstStartPos.fY+R*s,e.nColorAdapt?(this.pWaterFontParam[R].pstFontColor={},this.pWaterFontParam[R].pstFontColor.fR=this.aPOSAdaptBuf[0],this.pWaterFontParam[R].pstFontColor.fG=this.aPOSAdaptBuf[0],this.pWaterFontParam[R].pstFontColor.fB=this.aPOSAdaptBuf[0],this.pWaterFontParam[R].pstFontColor.fA=e.pstFontColor.fA):this.pWaterFontParam[R].pstFontColor=e.pstFontColor,this.pWaterFontParam[R].bBackGround=!1,this.pWaterFontParam[R].pstBGColor=null,this.pWaterFontParam[R].fRotateAngle=e.pstFontRotate.fRotateAngle,this.pWaterFontParam[R].pFontFamily=e.pFontFamily,e.nFontAlign?(this.pWaterFontParam[R].textAlign="left",this.pWaterFontParam[R].textBaseline="top"):(this.pWaterFontParam[R].textAlign="center",this.pWaterFontParam[R].textBaseline="middle");return 1}},{key:"SetWaterMarkFont",value:function(e,t){if(this.pWaterFontParam.splice(0,this.pWaterFontParam.length),null===e)return 1;if(e.nColorAdapt){var i={nWidth:16,nHeight:16,nBufferLen:0};if(1==this.oVideoHandle.SR_GetCaptureSize(i)){var n=new Uint8Array(i.nBufferLen),a={};if(a.pBuffer=n,this.oVideoHandle.SR_CaptureScreen(a),a.width=i.nWidth,a.height=i.nHeight,e.pstFontRotate.fFillFullScreen){var r=Math.floor(e.pstFontNumber.nRowNumber),o=Math.floor(e.pstFontNumber.nColNumber);this.CheckFrameRGB(a,1,r,o,0,0)}else this.CheckFrameRGB(a,0,1,1,e.pstStartPos.fX,e.pstStartPos.fY);n=null}}return this.GetWaterFontParam(e),1}},{key:"ImageDecoder",value:function(e,t,i){var n=this;e.decode({frameIndex:i}).then((function(a){n.pWaterImageParam[i]={},n.pWaterImageParam[i].videoStream=a.image,n.pWaterImageParam[i].nImageWidth=a.image.displayWidth,n.pWaterImageParam[i].nImageHeight=a.image.displayHeight,null!=t.pstRectPos?n.pWaterImageParam[i].pstRectPos=t.pstRectPos:n.pWaterImageParam[i].pstRectPos={fLeft:0,fRight:.1,fTop:0,fBottom:.1},null!=t.fAlpha&&t.fAlpha<=1&&t.fAlpha>=0?n.pWaterImageParam[i].fAlpha=t.fAlpha:n.pWaterImageParam[i].fAlpha=1,n.waterMarkImageMax=e.tracks.selectedTrack.frameCount,i<e.tracks.selectedTrack.frameCount-1&&n.ImageDecoder(e,t,i+1)}))}},{key:"SetWaterMarkImage",value:function(e){if(this.pWaterImageParam.splice(0,this.pWaterImageParam.length),null===e)return 1;if(null!=e.pImageData){var t=new ImageDecoder({data:e.pImageData,type:"image/"+e.pImageType});t.tracks.ready.then((function(){})),this.ImageDecoder(t,e,0)}return this.waterMarkImageIndex=0,1}},{key:"_ConvertDisplayEffect",value:function(e,t){switch(e){case 1:return C==t?Y.SR_DE_FISH_PTZ_WALL:R==t||w==t?Y.SR_DE_FISH_PANORAMA_WALL:I==t?Y.SR_DE_FISH_SEMISPHERE:F==t?Y.SR_DE_FISH_PLANET:A==t?Y.SR_DE_FISH_ARCSPHERE_HORIZONTAL_WALL:M==t?Y.SR_DE_FISH_ARCSPHERE_VERTICAL_WALL:Y.SR_DE_FISH_ORIGINAL;case 2:return C==t?Y.SR_DE_FISH_PTZ_FLOOR:R==t?Y.SR_DE_FISH_PANORAMA_FLOOR_360:T==t?Y.SR_DE_FISH_PANORAMA_FLOOR_180:w==t?Y.SR_DE_FISH_PANORAMA_WALL:I==t?Y.SR_DE_FISH_SEMISPHERE:D==t?Y.SR_DE_FISH_CYLINDER_FLOOR:k==t?Y.SR_DE_FISH_CYLINDER_SPLIT_FLOOR:F==t?Y.SR_DE_FISH_PLANET:Y.SR_DE_FISH_ORIGINAL;case 3:return C==t?Y.SR_DE_FISH_PTZ_CEILING:R==t?Y.SR_DE_FISH_PANORAMA_CEILING_360:T==t?Y.SR_DE_FISH_PANORAMA_CEILING_180:w==t?Y.SR_DE_FISH_PANORAMA_WALL:I==t?Y.SR_DE_FISH_SEMISPHERE:D==t?Y.SR_DE_FISH_CYLINDER_CEILING:k==t?Y.SR_DE_FISH_CYLINDER_SPLIT_CEILING:F==t?Y.SR_DE_FISH_PLANET:Y.SR_DE_FISH_ORIGINAL;default:return Y.SR_DE_FISH_ORIGINAL}}},{key:"GetCanvasData",value:function(e){var t={nWidth:0,nHeight:0,nBufferLen:0};(1!=this.oVideoHandle.SR_GetCaptureSize(t)||t.nBufferLen<=0)&&e(null);var i=new Uint8Array(t.nBufferLen);null==i&&e(null);var n={};n.pBuffer=i,this.oVideoHandle.SR_CaptureScreen(n),e(i,t.nWidth,t.nHeight)}},{key:"FindIntelNodefromList",value:function(e){if(0!=this.privateLinesInfo.length){var t=this.privateLinesInfo[0].absTimeStamp;if(t<=e+100&&t>e-100)this.curLinesInfo=this.privateLinesInfo.shift();else if(t>e+2e3||t<e-2e3)for(this.curLinesInfo=this.privateLinesInfo.shift();this.privateLinesInfo.length>0;){var i=this.privateLinesInfo[0].absTimeStamp;if(!(i>e+2e3||i<e-2e3))break;this.curLinesInfo=this.privateLinesInfo.shift()}}if(0!=this.privateFontsInfo.length){var n=this.privateFontsInfo[0].absTimeStamp;if(n<=e+1e3&&n>e-1e3)this.curFontsInfo=this.privateFontsInfo.shift();else if(n>e+2e3||n<e-2e3)for(this.curFontsInfo=this.privateFontsInfo.shift();this.privateFontsInfo.length>0;){var a=this.privateFontsInfo[0].absTimeStamp;if(!(a>e+2e3||a<e-2e3))break;this.curFontsInfo=this.privateFontsInfo.shift()}}if(0!=this.privateImageInfo.length){var r=this.privateImageInfo[0].absTimeStamp;if(r<=e+1e3&&r>e-1e3)this.curImagesInfo=this.privateImageInfo.shift();else if(r>e+2e3||r<e-2e3)for(this.curImagesInfo=this.privateImageInfo.shift();this.privateImageInfo.length>0;){var o=this.privateImageInfo[0].absTimeStamp;if(!(o>e+2e3||o<e-2e3))break;this.curImagesInfo=this.privateImageInfo.shift()}}return 1}},{key:"RenderPrivateData",value:function(e){return 0!=this.privateLinesInfo.length||e||(this.curLinesInfo=null),1}},{key:"InputPrivateInfo",value:function(e,t,i){var n=!1,a=0;if(e.linesNum>0){if(e.absTimeStamp<=this.maxPrivateLineTimeStamp){var r=0;for(r=0;r<this.privateLinesInfo.length;r++)if(this.privateLinesInfo[r].absTimeStamp==e.absTimeStamp){n=!0,a=r;break}}if(n){var o=this.privateLinesInfo[a].linesNum;this.privateLinesInfo[a].linesNum=o+e.linesNum;for(var s=0;s<e.linesNum;s++){this.privateLinesInfo[a].stDrawLinesArray[s+o]={},this.privateLinesInfo[a].stDrawLinesArray[s+o].vertex_num=e.stDrawLinesArray[s].vertex_num,this.privateLinesInfo[a].stDrawLinesArray[s+o].lineWidth=e.stDrawLinesArray[s].lineWidth,this.privateLinesInfo[a].stDrawLinesArray[s+o].bFill=e.stDrawLinesArray[s].bFill,this.privateLinesInfo[a].stDrawLinesArray[s+o].bLoop=e.stDrawLinesArray[s].bLoop,this.privateLinesInfo[a].stDrawLinesArray[s+o].color={},this.privateLinesInfo[a].stDrawLinesArray[s+o].color.R=e.stDrawLinesArray[s].color.R,this.privateLinesInfo[a].stDrawLinesArray[s+o].color.G=e.stDrawLinesArray[s].color.G,this.privateLinesInfo[a].stDrawLinesArray[s+o].color.B=e.stDrawLinesArray[s].color.B,this.privateLinesInfo[a].stDrawLinesArray[s+o].color.A=e.stDrawLinesArray[s].color.A,this.privateLinesInfo[a].stDrawLinesArray[s+o].stPoint=[];for(var l=0;l<e.stDrawLinesArray[s].vertex_num;l++)this.privateLinesInfo[a].stDrawLinesArray[s+o].stPoint[l]={},this.privateLinesInfo[a].stDrawLinesArray[s+o].stPoint[l].x=e.stDrawLinesArray[s].stPoint[l].x,this.privateLinesInfo[a].stDrawLinesArray[s+o].stPoint[l].y=e.stDrawLinesArray[s].stPoint[l].y}}else{this.maxPrivateLineTimeStamp<e.absTimeStamp&&(this.maxPrivateLineTimeStamp=e.absTimeStamp);var c={};c.linesNum=e.linesNum,c.absTimeStamp=e.absTimeStamp,c.stDrawLinesArray=[];for(var d=0;d<e.linesNum;d++){c.stDrawLinesArray[d]={},c.stDrawLinesArray[d].vertex_num=e.stDrawLinesArray[d].vertex_num,c.stDrawLinesArray[d].lineWidth=e.stDrawLinesArray[d].lineWidth,c.stDrawLinesArray[d].bFill=e.stDrawLinesArray[d].bFill,c.stDrawLinesArray[d].bLoop=e.stDrawLinesArray[d].bLoop,c.stDrawLinesArray[d].color={},c.stDrawLinesArray[d].color.R=e.stDrawLinesArray[d].color.R,c.stDrawLinesArray[d].color.G=e.stDrawLinesArray[d].color.G,c.stDrawLinesArray[d].color.B=e.stDrawLinesArray[d].color.B,c.stDrawLinesArray[d].color.A=e.stDrawLinesArray[d].color.A,c.stDrawLinesArray[d].stPoint=[];for(var u=0;u<e.stDrawLinesArray[d].vertex_num;u++)c.stDrawLinesArray[d].stPoint[u]={},c.stDrawLinesArray[d].stPoint[u].x=e.stDrawLinesArray[d].stPoint[u].x,c.stDrawLinesArray[d].stPoint[u].y=e.stDrawLinesArray[d].stPoint[u].y}this.privateLinesInfo.push(c)}}if(t.nFontsNum>0){if(t.absTimeStamp<=this.maxPrivateLineTimeStamp){var h=0;for(h=0;h<this.privateFontsInfo.length;h++)if(this.privateFontsInfo[h].absTimeStamp==t.absTimeStamp){n=!0,a=h;break}}if(n);else{this.maxPrivateLineTimeStamp<t.absTimeStamp&&(this.maxPrivateLineTimeStamp=t.absTimeStamp);var f={};f.nFontsNum=t.nFontsNum,f.absTimeStamp=t.absTimeStamp,f.stDrawFontsArray=[];for(var x=0;x<t.nFontsNum;x++)f.stDrawFontsArray[x]={},f.stDrawFontsArray[x].nFontSizeW=t.stDrawFontsArray[x].nFontSizeW,f.stDrawFontsArray[x].nFontSizeH=t.stDrawFontsArray[x].nFontSizeH,f.stDrawFontsArray[x].color={},f.stDrawFontsArray[x].color.R=t.stDrawFontsArray[x].color.R,f.stDrawFontsArray[x].color.G=t.stDrawFontsArray[x].color.G,f.stDrawFontsArray[x].color.B=t.stDrawFontsArray[x].color.B,f.stDrawFontsArray[x].color.A=t.stDrawFontsArray[x].color.A,f.stDrawFontsArray[x].stPoint={},f.stDrawFontsArray[x].stPoint.x=t.stDrawFontsArray[x].stPoint.x,f.stDrawFontsArray[x].stPoint.y=t.stDrawFontsArray[x].stPoint.y,f.stDrawFontsArray[x].fontstring=t.stDrawFontsArray[x].fontString;this.privateFontsInfo.push(f)}}if(i.nPixelFormat>0){if(i.absTimeStamp<=this.maxPrivateLineTimeStamp){var p=0;for(p=0;p<this.privateImageInfo.length;p++)if(this.privateImageInfo[p].absTimeStamp==i.absTimeStamp){n=!0,a=p;break}}if(n);else{this.maxPrivateLineTimeStamp<i.absTimeStamp&&(this.maxPrivateLineTimeStamp=i.absTimeStamp);var m={};m.absTimeStamp=i.absTimeStamp,m.nWidth=i.nWidth,m.nHeight=i.nHeight,m.pstRect={},m.pstRect.fTop=i.pstRect.fTop,m.pstRect.fBottom=i.pstRect.fBottom,m.pstRect.fLeft=i.pstRect.fLeft,m.pstRect.fRight=i.pstRect.fRight,m.nPixelFormat=i.nPixelFormat,m.fAlpha=i.fAlpha,m.picImageData=i.picImageData,this.privateImageInfo.push(m)}}return 1}},{key:"WebGLDisplayCallBack",value:function(e){if(0!=e.privateLinesInfo.length||null!=e.curLinesInfo){if(null!=e.curLinesInfo){for(var t=[],i=0,n=1,a=0;a<e.curLinesInfo.linesNum;a++){t[a]={},t[a].nPointNum=e.curLinesInfo.stDrawLinesArray[a].vertex_num,t[a].nLineWidth=e.curLinesInfo.stDrawLinesArray[a].lineWidth,n=e.curLinesInfo.stDrawLinesArray[a].bFill,t[a].bLoop=e.curLinesInfo.stDrawLinesArray[a].bLoop,t[a].pstColor={},t[a].pstColor.fR=e.curLinesInfo.stDrawLinesArray[a].color.R,t[a].pstColor.fG=e.curLinesInfo.stDrawLinesArray[a].color.G,t[a].pstColor.fB=e.curLinesInfo.stDrawLinesArray[a].color.B,t[a].pstColor.fA=e.curLinesInfo.stDrawLinesArray[a].color.A,t[a].pstPoints=[];for(var r=0;r<t[a].nPointNum;r++)t[a].pstPoints[r]={},t[a].pstPoints[r].fX=e.curLinesInfo.stDrawLinesArray[a].stPoint[r].x,t[a].pstPoints[r].fY=e.curLinesInfo.stDrawLinesArray[a].stPoint[r].y;i+=t[a].nPointNum}e.oVideoHandle.SR_DrawLinesEx(t,e.curLinesInfo.linesNum,i,n)}e.curLinesInfo=null}if((0!=e.privateFontsInfo.length||null!=e.curFontsInfo)&&null!=e.curFontsInfo&&0!=e.curFontsInfo.nFontsNum){for(var o=[],s=0;s<e.curFontsInfo.nFontsNum;s++){var l={},c=e.curFontsInfo.stDrawFontsArray[s].fontstring,d={};d.fX=e.curFontsInfo.stDrawFontsArray[s].stPoint.x,d.fY=e.curFontsInfo.stDrawFontsArray[s].stPoint.y;var u={fR:1,fG:0,fB:0};u.fA=e.curFontsInfo.stDrawFontsArray[s].color.A;var h=e.curFontsInfo.stDrawFontsArray[s].nFontSizeW,f=e.curFontsInfo.stDrawFontsArray[s].nFontSizeH;l.pString=c,l.pstStartPos=d,l.nFontWidth=h,l.nFontHeight=f,l.pstFontColor=u,l.bBackGround=!1,l.pstBGColor=null,l.fRotateAngle=0,l.pFontFamily="sans-serif",o.push(l)}e.oVideoHandle.SR_DrawFontEx(o,e.curFontsInfo.nFontsNum)}if(0!=e.privateImageInfo.length||null!=e.curImagesInfo){var x=null;null!=e.curImagesInfo&&null!=e.curImagesInfo&&null!=e.curImagesInfo.picImageData&&null!=e.curImagesInfo.picImageData&&(x=new Uint16Array(e.curImagesInfo.picImageData.buffer)),null!=e.curImagesInfo&&e.curImagesInfo.nPixelFormat>0&&e.oVideoHandle.SR_DrawImage(x,e.curImagesInfo.nWidth,e.curImagesInfo.nHeight,e.curImagesInfo.pstRect,e.curImagesInfo.nPixelFormat,e.curImagesInfo.fAlpha)}if(0!==e.pWaterFontParam.length&&e.oVideoHandle.SR_DrawFontEx(e.pWaterFontParam,e.pWaterFontParam.length),0!==e.pWaterImageParam.length){e.waterMarkImageIndex>=e.waterMarkImageMax&&(e.waterMarkImageIndex=0);var p=e.waterMarkImageIndex;e.oVideoHandle.SR_DrawImage(e.pWaterImageParam[p].videoStream,e.pWaterImageParam[p].nImageWidth,e.pWaterImageParam[p].nImageHeight,e.pWaterImageParam[p].pstRectPos,X,e.pWaterImageParam[p].fAlpha),e.waterMarkImageIndex++}}}]),t}(),Ee=function(){function t(){e(this,t),this.startTime=0,this.curTime=0,this.timeWalk=0,this.lastDate=0,this.preTimerStamp=0}return o(t,[{key:"Init",value:function(){this.startTime=this.GetCurTime()}},{key:"GetCurTime",value:function(){return this.curTime=60*(new Date).getHours()*60*1e3+60*(new Date).getMinutes()*1e3+1e3*(new Date).getSeconds()+(new Date).getMilliseconds(),this.lastDate=(new Date).getDate(),this.curTime}},{key:"GetTimerWalk",value:function(){var e=this.GetCurTime()-this.startTime;return this.lastDate!==(new Date).getDate()&&(e+=24*((new Date).getDate()-this.lastDate)*60*60*1e3),e}},{key:"timerReset",value:function(){this.startTime=0,this.curTime=0,this.timeWalk=0,this.lastDate=0,this.preTimerStamp=0}}]),t}(),Ce=function(){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e(this,t),this.canvas=null,this.streamOpenMode=0,this.context=null,this.oVideoDecoder=null,this.frameBuffers=[],this.initTimer=!1,this.preTimeStamp=0,this.baseTimeStamp=0,this.resetTimer=!0,this.RenderFrame=this.RenderFrame.bind(this),this.renderCurStatus=2,this.playSpeed=1,this.nplaySpeed=1,this.displayBuf=14,this.needForward=!1,this.firstFrame=!0,this.LatcyTime=0,this.displayFrameInfoCB=null,this.displayFrameInfo=[],this.curFrameInfo={},this.curFrameInfo.timeStamp=0,this.sx=0,this.sy=0,this.sw=0,this.sh=0,this.displayRunning=!1,this.oRenderTimer=null,this.waitIFrameTimestamp=0,this.curFrame=null,this.player=null,null!=i&&(this.player=i),this.renderEngine="webgl",this.oVideoRender=null,this.FECCanvasID="",this.oVideoRender=new Pe}return o(t,[{key:"init",value:function(e,t,i,n){this.canvas=e,this.streamOpenMode=t,this.renderEngine=n,this.SetCurStatus(2),null==this.oVideoDecoder&&(this.oVideoDecoder=new N(i,this,this.player),null!==this.oVideoDecoder&&this.oVideoDecoder.initDecoder()),this.frameBuffers=this.oVideoDecoder.ready_frames,null!=this.oVideoRender&&this.oVideoRender.InitDisplay(this.canvas,this.renderEngine,256),null==this.oRenderTimer&&(this.oRenderTimer=new Ee)}},{key:"HardDecodeError",value:function(){return this.player._switchHardToSoft(),1}},{key:"inputData",value:function(e,t){var i={};i.port=t.port,i.codecType=t.codecType,i.frameType=t.frameType,i.frameSize=t.frameSize,i.width=t.width,i.height=t.height,i.timeStamp=t.timeStamp,i.frameRate=t.frameRate,i.frameNum=t.frameNum,i.interlace=t.interlace,i.streamEnd=t.streamEnd,i.cropLeft=t.cropLeft,i.cropRight=t.cropRight,i.cropTop=t.cropTop,i.cropBottom=t.cropBottom,i.year=t.year,i.month=t.month,i.week=t.week,i.day=t.day,i.hour=t.hour,i.minute=t.minute,i.second=t.second,i.milliseconds=t.milliseconds,this.displayFrameInfo.push(i),this.oVideoDecoder.inputData(e,t)}},{key:"_resetDecoder",value:function(){var e=this;return new Promise((function(t,i){e.oVideoDecoder.resetDecoder().then((function(){e.displayFrameInfo.splice(0,e.displayFrameInfo.length),e.curFrameInfo={},e.oVideoRender.DeInitPrivateParam(),e.renderCurStatus=2,e.player?e.player.JSPlayM4_ResetEnd():postMessage({function:"resetEnd"}),t()}),(function(){i()}))}))}},{key:"_resetRenderTimer",value:function(){this.initTimer=!1,this.preTimeStamp=0,this.baseTimeStamp=0,this.resetTimer=!0,null!=this.oRenderTimer&&this.oRenderTimer.timerReset(),this.RenderFrame=this.RenderFrame.bind(this),this.renderCurStatus=2,this.curTimeStamp=0,this.getImageJPEG=!1,this.getImageBMP=!1,this.getCropImageJPEG=!1,this.getCropImageBMP=!1,this.displayFrameInfoCB=null,this.displayFrameInfo.splice(0,this.displayFrameInfo.length),this.curFrameInfo={}}},{key:"_destroyPlayCtrl",value:function(){var e=this;this.oVideoDecoder.destroyDecoder().then((function(){e.oVideoDecoder=null,null!=e.oVideoRender&&(e.oVideoRender.ReleaseDisplay(),e.oVideoRender=null),e._resetRenderTimer(),e.oRenderTimer=null,e.displayRunning=!1,console.log(">>>JS 02 destroy oVideoDecoder/oVideoRender")}),(function(){console.log("stop failed ")}))}},{key:"RenderFrame",value:function(){var e=this;switch(this.renderCurStatus){case 0:this._resetRenderTimer(),this._resetDecoder().then((function(){var t=setTimeout((function(){e.RenderFrame(),clearTimeout(t)}),1)}),(function(){}));break;case 2:if(this.displayRunning)this.chooseFrame().then((function(t){if(e.curFrame=t,-1==e.displayBuf||0==e.streamOpenMode&&0==e.LatcyTime)null!=e.curFrame&&(e.curTimeStamp=e.curFrame.timestamp,e.paint(e.curFrame)),requestAnimationFrame(e.RenderFrame);else if(null!=e.curFrame){e.initTimer&&!e.resetTimer||(e.oRenderTimer.Init(),e.initTimer=!0,e.resetTimer=!1,e.preTimeStamp=e.curFrame.timestamp,e.baseTimeStamp=e.curFrame.timestamp,1==e.streamOpenMode&&(e.LatcyTime=0)),e.curTimeStamp=e.curFrame.timestamp;var i=e.curTimeStamp-e.preTimeStamp,n=e.curTimeStamp-e.baseTimeStamp;(i>5e3||i<0||n<0)&&(e.oRenderTimer.Init(),e.preTimeStamp=e.curFrame.timestamp,e.baseTimeStamp=e.curTimeStamp);var a=(e.curTimeStamp-e.baseTimeStamp+e.LatcyTime)/e.playSpeed-e.oRenderTimer.GetTimerWalk();if(a<15&&a>-15)e.paint(e.curFrame),e.preTimeStamp=e.curTimeStamp,e.RenderFrame();else if(a<0)e.paint(e.curFrame),e.preTimeStamp=e.curTimeStamp,e.RenderFrame();else var r=setTimeout((function(){2==e.renderCurStatus?(e.paint(e.curFrame),e.preTimeStamp=e.curTimeStamp,e.RenderFrame()):e.RenderFrame(),clearTimeout(r)}),a-5)}else{e.playSpeed;var o=setTimeout((function(){e.RenderFrame(),clearTimeout(o)}),0)}}));else var t=setTimeout((function(){e.RenderFrame(),clearTimeout(t)}),5);break;case 3:var i=setTimeout((function(){e._refresh(),e.RenderFrame(),clearTimeout(i)}),5);break;case 5:if(this.needForward)this.chooseFrame().then((function(t){e.curFrame=t;var i=setTimeout((function(){null!=e.curFrame&&(e.paint(e.curFrame),e.needForward=!1),e.RenderFrame(),clearTimeout(i)}),1)}));else var n=setTimeout((function(){e._refresh(),e.RenderFrame(),clearTimeout(n)}),5);break;case 4:return void this._destroyPlayCtrl();default:return}}},{key:"paint",value:function(e){var t=this;return new Promise((function(i,n){if(4==t.curstatus||null==e||null==t.oVideoRender)i();else{t.waitIFrameTimestamp===e.timestamp&&(t.resetTimer=!0);var a={nCropLeft:0,nCropRight:0,nCropTop:0,nCropBottom:0};a.nCodeWidth=e.displayWidth,a.nCodeHeight=e.displayHeight;var r={x:0,y:0};r.width=e.displayWidth,r.height=e.displayHeight,t.oVideoRender.DisplayFrame(e,e.displayWidth,e.displayHeight,e.timestamp,a,null).then((function(e){null!==t.displayFrameInfoCB&&t.respondFrameInfoCB(e),t.firstFrame&&(null!=t.player?null!=t.player.FFCallBackFun&&t.player.FFCallBackFun():postMessage({function:"firstFrameCB",value:!0}),t.firstFrame=!1),i()}))}}))}},{key:"respondFrameInfoCB",value:function(e){if(0!=this.displayFrameInfo.length&&this.curFrameInfo.timeStamp!==e){for(var t={},i=0;i<this.displayFrameInfo.length&&(t=this.displayFrameInfo.shift()).timeStamp!=e;i++);this.curFrameInfo.port=t.port,this.curFrameInfo.codecType=t.codecType,this.curFrameInfo.frameType=t.frameType,this.curFrameInfo.frameSize=t.frameSize,this.curFrameInfo.width=t.width,this.curFrameInfo.height=t.height,this.curFrameInfo.timeStamp=t.timeStamp,this.curFrameInfo.frameRate=t.frameRate,this.curFrameInfo.frameNum=t.frameNum,this.curFrameInfo.interlace=t.interlace,this.curFrameInfo.streamEnd=t.streamEnd,this.curFrameInfo.cropLeft=t.cropLeft,this.curFrameInfo.cropRight=t.cropRight,this.curFrameInfo.cropTop=t.cropTop,this.curFrameInfo.cropBottom=t.cropBottom,this.curFrameInfo.year=t.year,this.curFrameInfo.month=t.month,this.curFrameInfo.week=t.week,this.curFrameInfo.day=t.day,this.curFrameInfo.hour=t.hour,this.curFrameInfo.minute=t.minute,this.curFrameInfo.second=t.second,this.curFrameInfo.milliseconds=t.milliseconds,this.displayFrameInfoCB(this.curFrameInfo)}}},{key:"postImageData",value:function(e,t,i,n,a){this.player?(this.getImageJPEG&&(this.getImageJPEG=!1,this.player._GetImage2(e,t,i,n,"jpeg",a,0,0,0,0)),this.getImageBMP&&(this.getImageBMP=!1,this.player._GetImage2(e,t,i,n,"bmp",a,0,0,0,0)),this.getCropImageJPEG&&(this.getCropImageJPEG=!1,this.player._GetImage2(e,t,i,n,"jpeg",a,this.sx,this.sy,this.sw,this.sh)),this.getCropImageBMP&&(this.getCropImageBMP=!1,this.player._GetImage2(e,t,i,n,"bmp",a,this.sx,this.sy,this.sw,this.sh))):(this.getImageJPEG&&(this.getImageJPEG=!1,postMessage({function:"imageYUV",value:e.buffer,size:t,width:i,height:n,type:"jpeg",yuvType:a,sx:0,sy:0,sw:0,sh:0},[e.buffer])),this.getImageBMP&&(this.getImageBMP=!1,postMessage({function:"imageYUV",value:e.buffer,size:t,width:i,height:n,type:"bmp",yuvType:a,sx:0,sy:0,sw:0,sh:0},[e.buffer])),this.getCropImageJPEG&&(this.getCropImageJPEG=!1,postMessage({function:"imageYUV",value:e.buffer,size:t,width:i,height:n,type:"jpeg",yuvType:a,sx:this.sx,sy:this.sy,sw:this.sw,sh:this.sh},[e.buffer])),this.getCropImageBMP&&(this.getCropImageBMP=!1,postMessage({function:"imageYUV",value:e.buffer,size:t,width:i,height:n,type:"bmp",yuvType:a,sx:this.sx,sy:this.sy,sw:this.sw,sh:this.sh},[e.buffer])))}},{key:"chooseFrame",value:function(){var e=this;return new Promise((function(t,i){if(null==e.oVideoRender||null==e.oVideoDecoder)t(null);else if(e.oVideoDecoder.decoderObjNeedReset)e.oVideoDecoder.resetDecoder().then((function(){e.oVideoDecoder.decoderObjNeedReset=!1,t(null)}),(function(){i()}));else{var n=e.oVideoDecoder.GetFrameBufferLength();1==e.streamOpenMode&&n<3?t(null):e.oVideoDecoder.GetFrame().then((function(e){t(e)}),(function(){}))}}))}},{key:"SetDisplayRegion",value:function(e,t,i,n){return null==this.oVideoRender?0:(this.sx=e,this.sy=t,this.sw=i,this.sh=n,this.oVideoRender.SetDisplayRect(e,t,i,n))}},{key:"SetCurStatus",value:function(e){return this.renderCurStatus=e,1}},{key:"fast",value:function(){var e=this._GetFastSpeed(this.nplaySpeed);return this._SetPlaySpeed(e)}},{key:"slow",value:function(){var e=this._GetSlowSpeed(this.nplaySpeed);return this._SetPlaySpeed(e)}},{key:"Pause",value:function(e){if(e)this.SetCurStatus(3);else{if(3!==this.renderCurStatus)return-1;this.SetCurStatus(2),this.resetTimer=!0}return 1}},{key:"_refresh",value:function(){0!=this.frameBuffers.length&&this.paint(this.frameBuffers[0])}},{key:"OneByOne",value:function(e){if(e)this.SetCurStatus(5),this.needForward=!0;else{if(5!==this.renderCurStatus)return-1;this.SetCurStatus(2),this.resetTimer=!0,this.needForward=!1,this._SetPlaySpeed(1)}return 1}},{key:"SetCanvasSize",value:function(e,t){return null!=this.oVideoRender&&this.oVideoRender.SetCanvasSize(e,t)}},{key:"GetCanvasSize",value:function(){return null!=this.oVideoRender&&this.oVideoRender.GetCanvasSize()}},{key:"GetPlayedTime",value:function(){return this.curTimeStamp}},{key:"_SetPlaySpeed",value:function(e){switch(e){case-16:case-8:case-4:case-2:case 1:case 2:case 4:case 8:case 16:case 32:case 64:break;default:return-1}return e===this.nplaySpeed||(this.nplaySpeed=e,this.playSpeed=e>0?e:-1/e,console.log("playSpeed:"+this.playSpeed),this.resetTimer=!0,this.needForward=!1,2!=this.renderCurStatus&&this.SetCurStatus(2)),1}},{key:"_GetFastSpeed",value:function(e){var t=0;switch(e){case-16:t=-8;break;case-8:t=-4;break;case-4:t=-2;break;case-2:t=1;break;case 1:t=2;break;case 2:t=4;break;case 4:t=8;break;case 8:t=16;break;case 16:t=32;break;case 32:t=64;break;default:t=0}return t}},{key:"_GetSlowSpeed",value:function(e){var t=0;switch(e){case-8:t=-16;break;case-4:t=-8;break;case-2:t=-4;break;case 1:t=-2;break;case 2:t=1;break;case 4:t=2;break;case 8:t=4;break;case 16:t=8;break;case 32:t=16;break;case 64:t=32;break;default:t=0}return t}},{key:"SetDisplayBuf",value:function(e){return this.displayBuf=e,this.LatcyTime=1==e?0:15==e?700:45==e?1900:e>6&&e<45?40*e+100:-1==e?0:50,1}},{key:"GetJPEG",value:function(){var e=this;this.oVideoDecoder.GetImageYUV().then((function(t){var i=t.yuvFrameBuffer,n=t.yuvLength,a=t.displayWidth,r=t.displayHeight,o=t.yuvType;-1!=i&&(e.player?e.player._GetImage2(i,n,a,r,"jpeg",o,0,0,0,0):postMessage({function:"imageYUV",value:i.buffer,size:n,width:a,height:r,type:"jpeg",yuvType:o,sx:0,sy:0,sw:0,sh:0},[i.buffer]))}),(function(){}))}},{key:"GetBMP",value:function(){var e=this;this.oVideoDecoder.GetImageYUV().then((function(t){var i=t.yuvFrameBuffer,n=t.yuvLength,a=t.displayWidth,r=t.displayHeight,o=t.yuvType;-1!=i&&(e.player?e.player._GetImage2(i,n,a,r,"bmp",o,0,0,0,0):postMessage({function:"imageYUV",value:i.buffer,size:n,width:a,height:r,type:"bmp",yuvType:o,sx:0,sy:0,sw:0,sh:0},[i.buffer]))}),(function(){}))}},{key:"GetCropJPEG",value:function(){var e=this;this.oVideoDecoder.GetImageYUV().then((function(t){var i=t.yuvFrameBuffer,n=t.yuvLength,a=t.displayWidth,r=t.displayHeight,o=t.yuvType;-1!=i&&(e.player?e.player._GetImage2(i,n,a,r,"jpeg",o,e.sx,e.sy,e.sw,e.sh):postMessage({function:"imageYUV",value:i.buffer,size:n,width:a,height:r,type:"jpeg",yuvType:o,sx:e.sx,sy:e.sy,sw:e.sw,sh:e.sh},[i.buffer]))}),(function(){}))}},{key:"GetCropBMP",value:function(){var e=this;this.oVideoDecoder.GetImageYUV().then((function(t){var i=t.yuvFrameBuffer,n=t.yuvLength,a=t.displayWidth,r=t.displayHeight,o=t.yuvType;-1!=i&&(e.player?e.player._GetImage2(i,n,a,r,"bmp",o,e.sx,e.sy,e.sw,e.sh):postMessage({function:"imageYUV",value:i.buffer,size:n,width:a,height:r,type:"bmp",yuvType:o,sx:e.sx,sy:e.sy,sw:e.sw,sh:e.sh},[i.buffer]))}),(function(){}))}},{key:"GetCanvasCapture",value:function(e){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support GetCanvasCapture","color:red"),0):(this.oVideoRender.GetCanvasData(e),1)}},{key:"SetDecodeFrameType",value:function(e){return this.waitIFrameTimestamp=e,1}},{key:"SetStreamEnd",value:function(){return this.oVideoDecoder.SetStreamEnd(),1}},{key:"SetAntialias",value:function(e){return null!=this.oVideoRender?this.oVideoRender.SetAntialias(e):0}},{key:"SetFrameInfoCallBack",value:function(e,t){return this.displayFrameInfoCB=t?e:null,1}},{key:"FEC_SetCanvasID",value:function(e){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_SetCanvasID(e):(this.FECCanvasID=e,0)}},{key:"FEC_ResetCorrectType",value:function(e,t,i){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_ResetCorrectType(e,t,i):0}},{key:"FEC_GetPort",value:function(e,t){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),-1):null!=this.oVideoRender?this.oVideoRender.FEC_GetPort(e,t):-1}},{key:"FEC_Enable",value:function(e){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_Enable(e):0}},{key:"FEC_SetParam",value:function(e,t){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_SetParam(e,t):0}},{key:"FEC_GetParam",value:function(e,t){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_GetParam(e,t):0}},{key:"FEC_SetViewParam",value:function(e,t,i){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_SetViewParam(e,t,i):0}},{key:"FEC_GetViewParam",value:function(e,t,i){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_GetViewParam(e,t,i):0}},{key:"FEC_SetWnd",value:function(e,t){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_SetWnd(e,t):0}},{key:"FEC_Disable",value:function(e,t,i){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_Disable(e,t,i):0}},{key:"FEC_DelPort",value:function(e){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_DelPort(e):0}},{key:"FEC_SetDisplayRegion",value:function(e,t,i,n,a,r,o){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_SetDisplayRegion(e,t,i,n,a,r,o):0}},{key:"FEC_SetBackCilling",value:function(e,t){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_SetBackCilling(e,t):0}},{key:"FEC_GetPTZPort",value:function(e,t,i){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),-1):null!=this.oVideoRender?this.oVideoRender.FEC_GetPTZPort(e,t,i):-1}},{key:"FEC_SetPTZDisplayMode",value:function(e){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support FEC correct","color:red"),0):null!=this.oVideoRender?this.oVideoRender.FEC_SetPTZDisplayMode(e):0}},{key:"InputPrivateInfo",value:function(e,t,i){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support PrivateInfo","color:red"),0):null!=this.oVideoRender?this.oVideoRender.InputPrivateInfo(e,t,i):1}},{key:"RenderPrivateData",value:function(e){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support PrivateInfo","color:red"),0):null!=this.oVideoRender?this.oVideoRender.RenderPrivateData(e):1}},{key:"SetWaterMarkFont",value:function(e){return"2d"===this.renderEngine||"2D"===this.renderEngine||null==this.oVideoRender?(console.log("%c param error this.renderEngine:%d,this.oVideoRender:%d","color:red",this.renderEngine,this.oVideoRender),0):(null!=this.oVideoRender&&this.oVideoRender.SetWaterMarkFont(e,{yuvFrameBuffer:-1,yuvLength:-1,displayWidth:-1,displayHeight:-1,yuvType:-1}),1)}},{key:"SetWaterMarkImage",value:function(e){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support SetWaterMarkImage","color:red"),0):null!=this.oVideoRender?this.oVideoRender.SetWaterMarkImage(e):1}},{key:"SetD3DPostProcess",value:function(e,t){return"2d"===this.renderEngine||"2D"===this.renderEngine?(console.log("%c 2D render not support SetD3DPostProcess","color:red"),0):null!=this.oVideoRender?this.oVideoRender.SetD3DPostProcess(e,t):1}}]),t}(),Te=function(){function t(i){e(this,t),this.player=i,this.oVideoPlayCtrl=new Ce(i)}return o(t,[{key:"init",value:function(e,t,i,n){if(null===this.oVideoPlayCtrl)return 0;this.oVideoPlayCtrl.init(e,t,i,n)}},{key:"inputData",value:function(e,t){null!=this.oVideoPlayCtrl&&this.oVideoPlayCtrl.inputData(e,t)}},{key:"SetDisplayRegion",value:function(e,t,i,n){if(null===this.oVideoPlayCtrl)return 0;this.oVideoPlayCtrl.SetDisplayRegion(e,t,i,n)}},{key:"stop",value:function(){if(null===this.oVideoPlayCtrl)return 0;this.oVideoPlayCtrl.SetCurStatus(4),this.oVideoPlayCtrl=null,console.log(">>>JS 03 destroy oVideoPlayCtrl")}},{key:"fast",value:function(){return null===this.oVideoPlayCtrl||1!==this.oVideoPlayCtrl.fast()?0:void 0}},{key:"slow",value:function(){return null===this.oVideoPlayCtrl||1!==this.oVideoPlayCtrl.slow()?0:void 0}},{key:"SetDisplayBuf",value:function(e){return null===this.oVideoPlayCtrl||1!==this.oVideoPlayCtrl.SetDisplayBuf(e)?0:void 0}},{key:"Pause",value:function(e){return null===this.oVideoPlayCtrl||1!==this.oVideoPlayCtrl.Pause(e)?0:void 0}},{key:"OneByOne",value:function(e){return null===this.oVideoPlayCtrl||1!==this.oVideoPlayCtrl.OneByOne(e)?0:void 0}},{key:"SetCanvasSize",value:function(e,t){return null===this.oVideoPlayCtrl||1!==this.oVideoPlayCtrl.SetCanvasSize(e,t)?0:void 0}},{key:"GetCanvasSize",value:function(){return null===this.oVideoPlayCtrl||1!==this.oVideoPlayCtrl.GetCanvasSize()?0:void 0}},{key:"GetPlayedTime",value:function(){return null===this.oVideoPlayCtrl?0:this.oVideoPlayCtrl.GetPlayedTime()}},{key:"needReset",value:function(){this.oVideoPlayCtrl.SetCurStatus(0)}},{key:"GetJPEG",value:function(){this.oVideoPlayCtrl.GetJPEG()}},{key:"GetBMP",value:function(){this.oVideoPlayCtrl.GetBMP()}},{key:"GetCropJPEG",value:function(){this.oVideoPlayCtrl.GetCropJPEG()}},{key:"GetCropBMP",value:function(){this.oVideoPlayCtrl.GetCropBMP()}},{key:"JSPlayM4_GetCanvasCapture",value:function(e){this.oVideoPlayCtrl.GetCanvasCapture(e)}},{key:"SetDecodeFrameType",value:function(e){this.oVideoPlayCtrl.SetDecodeFrameType(e)}},{key:"streamEnd",value:function(){this.oVideoPlayCtrl.SetStreamEnd()}},{key:"SetAntialias",value:function(e){return this.oVideoPlayCtrl.SetAntialias(e)}},{key:"SetFrameInfoCallBack",value:function(e,t){return this.oVideoPlayCtrl.SetFrameInfoCallBack(e,t)}},{key:"FEC_SetCanvasID",value:function(e){return this.oVideoPlayCtrl.FEC_SetCanvasID(e)}},{key:"FEC_ResetCorrectType",value:function(e,t,i){return this.oVideoPlayCtrl.FEC_ResetCorrectType(e,t,i)}},{key:"FEC_GetPort",value:function(e,t){return this.oVideoPlayCtrl.FEC_GetPort(e,t)}},{key:"FEC_Enable",value:function(e){return this.oVideoPlayCtrl.FEC_Enable(e)}},{key:"FEC_SetParam",value:function(e,t){return this.oVideoPlayCtrl.FEC_SetParam(e,t)}},{key:"FEC_GetParam",value:function(e,t){return this.oVideoPlayCtrl.FEC_GetParam(e,t)}},{key:"FEC_SetViewParam",value:function(e,t,i){return this.oVideoPlayCtrl.FEC_SetViewParam(e,t,i)}},{key:"FEC_GetViewParam",value:function(e,t,i){return this.oVideoPlayCtrl.FEC_GetViewParam(e,t,i)}},{key:"FEC_SetWnd",value:function(e,t){return this.oVideoPlayCtrl.FEC_SetWnd(e,t)}},{key:"FEC_Disable",value:function(e,t,i){return this.oVideoPlayCtrl.FEC_Disable(e,t,i)}},{key:"FEC_DelPort",value:function(e){return this.oVideoPlayCtrl.FEC_DelPort(e)}},{key:"FEC_SetDisplayRegion",value:function(e,t,i,n,a,r,o){return this.oVideoPlayCtrl.FEC_SetDisplayRegion(e,t,i,n,a,r,o)}},{key:"FEC_SetBackCilling",value:function(e,t){return this.oVideoPlayCtrl.FEC_SetBackCilling(e,t)}},{key:"FEC_GetPTZPort",value:function(e,t,i){return this.oVideoPlayCtrl.FEC_GetPTZPort(e,t,i)}},{key:"FEC_SetPTZDisplayMode",value:function(e){return this.oVideoPlayCtrl.FEC_SetPTZDisplayMode(e)}},{key:"InputPrivateInfo",value:function(e,t,i){return this.oVideoPlayCtrl.InputPrivateInfo(e,t,i)}},{key:"RenderPrivateData",value:function(e){return this.oVideoPlayCtrl.RenderPrivateData(e)}},{key:"SetWaterMarkFont",value:function(e){return this.oVideoPlayCtrl.SetWaterMarkFont(e)}},{key:"SetWaterMarkImage",value:function(e){return this.oVideoPlayCtrl.SetWaterMarkImage(e)}},{key:"SetD3DPostProcess",value:function(e,t){return this.oVideoPlayCtrl.SetD3DPostProcess(e,t)}}]),t}(),Re=[];!function(){for(var e=0;e<8;e++){Re[e]=[];for(var t=0;t<64;t++)Re[e][t]=null}}();var we=null,Ie=!1,De=1,ke=1,Fe={bSupHardOrSoft:!0,bSupHardDecAVC:!0,bSupHardDecHEVC:!0,cmd:"unloaded",errorCode:0,status:0},Ae=-1;window.JSPlayM4_RawDataCallBack=function(e,t,i,n){null!=Re[n][e]&&Re[n][e].__proto__.hasOwnProperty("JSPlayM4_InputRawData")&&Re[n][e].JSPlayM4_InputRawData(e,t,i)},window.JSPlayM4_PrivateInfoCallBack=function(e,t,i,n,a){null!=Re[a][e]&&Re[a][e].__proto__.hasOwnProperty("JSPlayM4_InputPrivateInfo")&&Re[a][e].JSPlayM4_InputPrivateInfo(t,i,n)};var Me=function(){function t(i,n,a){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"webgl",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:-1;if(e(this,t),this.jsplayer=i,this.szBasePath=n,this.fn=a,this.nUser=o,this.renderEngine=s,this.hasWebWorker=l,this.setHasThread=c,this.oJSPlayerObj=this,this.port=-1,this.pcVideoManager=null,this.decodeWorker=null,this.offscreen=null,this.canvasID="",this.canvasCnv=null,this.rtpType=0,this.decodeEngine=1,this.FirstFrameCallBackflag=!1,this.inputDataBuffer=null,this.inputDataBufferSize=204800,this.canvasIDData=null,this._decoderLoaded=!1,this.streamOpenMode=0,this.width=0,this.height=0,this.rawDataFrameInfoBuffer=null,this.rawDataFrameInfo={},this.displayFrameInfo={},this.startTimeStamp=0,this.decodeFrameType=0,this.switchDecodeFrame=!1,this.displayBuf=0,this.needSetDisplayBuf=!1,this.FirstFrame=!0,this.codecType=0,this.curStatus=0,this.playSpeed=1,this.needWaitIFrame=!1,this.printfFlag=!1,this.SetDisRegionBottom=0,this.SetDisRegionLeft=0,this.SetDisRegionRight=0,this.SetDisRegionTop=0,this.cropBottom=0,this.cropLeft=0,this.cropRight=0,this.cropTop=0,this.canvasWidth=960,this.canvasHeight=480,this.enableCanvas=!0,this.needResetCanvasSize=!1,this.hasThread=0,this.aTotalBuffer=[],this.iFrameNum=0,this.bWriteData=!0,this.downloadFlag=!1,this.bWriteAudioPCMData=!0,this.audioPCMBuffer=[],this.iAudioPCMFrameNum=0,this.pBmpData=null,this.nBmpDataSize=0,this.pBmpSizeData=null,this.bmpDataCallback=null,this.bmpDownloadFlag=!1,this.pJpegData=null,this.nJpegDataSize=0,this.pJPEGSizeData=null,this.jpegDataCallback=null,this.jpegDownloadFlag=!1,this.stDisplayRect={top:0,left:0,right:0,bottom:0},this.iZoomNum=0,this.iRatio_x=1,this.iRatio_y=1,this.pFECTotalCanvasIDData=null,this.iFECCanvasIDLen=0,this.iFECZoomNum=0,this.iFECRatio_x=1,this.iFECRatio_y=1,this.stFECDisplayRect={top:0,left:0,right:0,bottom:0},this.FECcanvasIDArray=[],this.FECGetPortCB=null,this.FECGetPTZPortCB=null,this.FECParamCB=null,this.FECViewParamCB=null,this.FFCallBackFun=null,this.addtionCallBackFun=null,this.displayCallBackFun=null,this.decCallBackFun=null,this.getPlayTimeCallBackFun=null,this.runtimeCBFun=null,this.callbackFlag=!1,this.runTimeModule=0,this.needSetSecretKey=!1,this.SecretKeyData=null,this.needPlaySound=!1,this.decInterval=-1,this.volumeValue=-1,this.renderPrivateInfo=new Map,this.renderIntelSubEx=new Map,this.renderIntelFlagEx=new Map,this.reversePlay=!1,this.decodeThreadNum=0,this.antialiasFlag=-1,this.decodeERCLevel=0,this.d3dPostProcessType=0,this.d3dPostProcessValue=0,this.needSetD3DPostProcess=!1,this.resetBufferType=-1,this.playOrBackSwitchMode=0,this.setStretchPlayTime=0,this.setStretchPlaySpeed=0,this.autoSmoothPlayModel=-1,this.keepPlaySpeed=-1,this.FECCanvasID="",this.FECPlaceType=0,this.FECCorrectType=0,this.anrParamFlag=!1,this.anrParamLevel=-1,this.resampleFlag=!1,this.resampleRate=48e3,this.globalBaseTime=null,this.needSetSkipErrorData=!1,this.skipErrorData=-1,this.needSetDemuxModel=!1,this.setDemuxModelType=-1,this.setDemuxModelFlag=!1,this.setAudioThreadModel=-1,this.syncToAudio=-1,this.HIK40Head=[],this.HIKHeadSize=40,this.HIKPoolSize=2097152,this.supportWebCodecs=_getFSupportWebCodecs(),this.supportSab=!!window.SharedArrayBuffer,this.offscreen=!!window.OffscreenCanvas,this.supportOffscreen=!1,this.offscreen){var d=new OffscreenCanvas(1,1),u=d.getContext("webgl");u&&(this.supportOffscreen=!0,u.getExtension("WEBGL_lose_context").loseContext()),d=null,u=null}if(console.log("%cstart load Decoder.js time:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds(),"color: blue"),null!=we||Ie)new Promise((function(e,t){e()})).then((function(){if(null===we)var e=setInterval((function(){null!==we&&(clearInterval(e),e=null,r.fn(Fe))}),10);else r.fn(Fe)}));else if(Ie=!0,Ae=_getFExplore(),this.supportWebCodecs?-1<Ae&&Ae<94?(console.info("%c1>your chrome version %d does not support 264/265 hard Decoder,please update the latest version above chromeV107","color: red",Ae),ke=0,De=0,Fe.bSupHardDecAVC=!1,Fe.bSupHardDecHEVC=!1,this.supportSab?Fe.bSupHardOrSoft=!0:Fe.bSupHardOrSoft=!1):94<=Ae&&Ae<107?(console.info("%c1>your chrome version %d does not support 265 hard Decoder,please update the latest version above chromeV107","color: red",Ae),De=0,Fe.bSupHardDecAVC=!0,Fe.bSupHardDecHEVC=!1,Fe.bSupHardOrSoft=!0):(Fe.bSupHardDecAVC=!0,Fe.bSupHardDecHEVC=!1,Fe.bSupHardOrSoft=!0):(console.info("%c1>your browser does not support hard Decoder ","color: red"),ke=0,De=0,Fe.bSupHardDecAVC=!1,Fe.bSupHardDecHEVC=!1,this.supportSab?Fe.bSupHardOrSoft=!0:Fe.bSupHardOrSoft=!1),Fe.bSupHardOrSoft){var h=this.szBasePath,f=document.createElement("script");f.type="text/javascript",f.src=h,console.info("%c>>>>The Decoder.js path:%s","color: green",h),f.onload=function(){window.JSPlayerModule().then((function(e){we=e,r._decoderLoaded=!0,Fe.cmd="loaded";var t=we._JSPlayM4_GetSDKVersion(),i=we._JSPlayM4_GetBuildDate();console.log("%cEnd load Decoder.js time:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds()+",version:"+t.toString(16)+",buildDate:"+i.toString(16),"color: blue"),r.supportWebCodecs?VideoDecoder.isConfigSupported({codec:"hvc1.1.6.L123.00",hardwareAcceleration:"prefer-hardware"}).then((function(e){e.supported?(Fe.bSupHardDecHEVC=!0,console.info("%c1>your browser support 264/265 hard Decoder","color: green")):(console.warn("%c1>your PC does not support 265 hard Decoder, if you want to hard decode 265 ,try to update the GPU driver","color: red"),De=0),r.callbackFlag||(r.fn(Fe),r.callbackFlag=!0)})).catch((function(){De=0,Fe.bSupHardDecHEVC=!1,console.log("%c2>hevc supported error","color: red"),r.callbackFlag||(r.fn(Fe),r.callbackFlag=!0)})):r.fn(Fe)}))},document.body.appendChild(f)}else console.log("%c not support hard or soft","color:red"),new Promise((function(e,t){e()})).then((function(){r.fn(Fe)}))}return o(t,[{key:"startWorker",value:function(e){function t(t,i){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){if(window.Worker){if(null==t.decodeWorker){if(t.decodeWorker=new c,null==t.decodeWorker)return 0;console.log("decodeWorker create success!")}t.canvasCnv=document.getElementById(e),t.offscreen=t.canvasCnv.transferControlToOffscreen(),t.decodeWorker.postMessage({command:"init",streamOpenMode:t.streamOpenMode,canvas:t.offscreen,sab:t.supportSab,renderEngine:t.renderEngine},[t.offscreen]),0!=t.displayBuf&&t.decodeWorker.postMessage({command:"SetDisplayBuf",value:t.displayBuf}),t.decodeWorker.onmessage=function(e){var i=e.data;switch(i.function){case"error":startWorker(t.canvasID,t);break;case"GetFrameData":var n=new Uint8Array(i.data);t.downloadRTPData(n);break;case"GetRawData":t.JSPlayM4_GetRawData();break;case"OrderError":console.log(">>>JS OrderError");break;case"GetPlayedTime":var a=i.value;t.getPlayTimeCallBackFun&&t.getPlayTimeCallBackFun(a-t.startTimeStamp);break;case"resetEnd":t.JSPlayM4_ResetEnd();break;case"bitmap":var r=i.value,o=i.type;t._GetImage(r,o);break;case"imageYUV":var s=new Uint8Array(i.value),l=i.size,c=new Uint8Array(s),d=i.type,u=i.width,h=i.height,f=i.yuvType,x=i.sx,p=i.sy,m=i.sw,_=i.sh;t._GetImage2(c,l,u,h,d,f,x,p,m,_),s=null,c=null,i.value=null;break;case"stop":t.decodeWorker=null,console.log("HardWorker is null");break;case"firstFrameCB":null!=t.FFCallBackFun&&t.FFCallBackFun();break;case"SetFrameInfoCallBack":t.displayFrameInfo.port=i.curFrameInfo.port,t.displayFrameInfo.codecType=i.curFrameInfo.codecType,t.displayFrameInfo.frameType=i.curFrameInfo.frameType,t.displayFrameInfo.frameSize=i.curFrameInfo.frameSize,t.displayFrameInfo.width=i.curFrameInfo.width,t.displayFrameInfo.height=i.curFrameInfo.height,t.displayFrameInfo.timeStamp=i.curFrameInfo.timeStamp,t.displayFrameInfo.frameRate=i.curFrameInfo.frameRate,t.displayFrameInfo.frameNum=i.curFrameInfo.frameNum,t.displayFrameInfo.interlace=i.curFrameInfo.interlace,t.displayFrameInfo.streamEnd=i.curFrameInfo.streamEnd,t.displayFrameInfo.cropLeft=i.curFrameInfo.cropLeft,t.displayFrameInfo.cropRight=i.curFrameInfo.cropRight,t.displayFrameInfo.cropTop=i.curFrameInfo.cropTop,t.displayFrameInfo.cropBottom=i.curFrameInfo.cropBottom,t.displayFrameInfo.year=i.curFrameInfo.year,t.displayFrameInfo.month=i.curFrameInfo.month,t.displayFrameInfo.week=i.curFrameInfo.week,t.displayFrameInfo.day=i.curFrameInfo.day,t.displayFrameInfo.hour=i.curFrameInfo.hour,t.displayFrameInfo.minute=i.curFrameInfo.minute,t.displayFrameInfo.second=i.curFrameInfo.second,t.displayFrameInfo.milliseconds=i.curFrameInfo.milliseconds;break;case"FECGetViewParam":null!=t.FECViewParamCB&&t.FECViewParamCB(i.Param3D);break;case"FECGetParam":null!=t.FECParamCB&&t.FECParamCB(i.param2d);break;case"FECGetPort":null!=t.FECGetPortCB&&t.FECGetPortCB(i.fishSubPort);break;case"FECGetPTZPort":null!=t.FECGetPTZPortCB&&t.FECGetPTZPortCB(i.fishSubPort)}},t.decodeWorker.addEventListener("error",(function(e){console.error(e)}))}}))},{key:"JSPlayM4_SetStreamEnd",value:function(){return 0}},{key:"JSPlayM4_GetPort",value:function(){return this.printfFlag&&console.log(">>>>>yff>>> JSPlayM4_GetPort 1"),null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetPort","color: red"),0):(this.port=we._JSPlayM4_GetPort(),Re[this.nUser][this.port]=this.oJSPlayerObj,this.printfFlag&&console.log(">>>>>yff>>> JSPlayM4_GetPort 2"),1)}},{key:"JSPlayM4_SetStreamOpenMode",value:function(e){return this.printfFlag&&console.log(">>>>>yff>>>>> JSPlayM4_SetStreamOpenMode 1 mode:"+e),null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetStreamOpenMode","color: red"),0):(this.streamOpenMode=e,this.printfFlag&&console.log(">>>>>yff>>>>> JSPlayM4_SetStreamOpenMode 2  mode:"+e),null==this.pcVideoManager&&(this.pcVideoManager=new Te(this)),we._JSPlayM4_SetStreamOpenMode(this.port,e))}},{key:"JSPlayM4_OpenStream",value:function(e,t,i){if(this.printfFlag&&console.log(">>>>>yff>>>>> JSPlayM4_OpenStream 1 :"+e+",this.port:"+this.port),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_OpenStream","color: red"),0;var n=we._malloc(t);if(null===n)return console.log("hikHeadBuffer malloc failed"),0;var a=new Uint8Array(e.buffer);if(5==e[10]&&0==e[11]){if(this.codecType=5,!Fe.bSupHardDecHEVC&&!this.supportSab)return console.info("%c3>The codecType is VIDEO_AVC265,not support SharedArrayBuffer","color: red"),16}else 1==e[10]&&0==e[11]?this.codecType=1:0==e[10]&&1==e[11]?this.codecType=256:this.codecType=0;we.writeArrayToMemory(a,n);var r=we._JSPlayM4_OpenStream(this.port,n,t,i);return null!==n&&(we._free(n),n=null),a=null,this.HIK40Head=new Uint8Array(e),this.HIKHeadSize=t,this.HIKPoolSize=i,r}},{key:"JSPlayM4_SetDecodeEngine",value:function(e){return this.printfFlag&&console.log(">>>>>yff>>>>> JSPlayM4_SetDecodeEngine 1:"+e),0!=e&&1!=e?(console.log("0 is softDecode, 1 is hardDecoder,decodeEngine:"+e),0):0!==e||this.supportSab&&this.supportOffscreen?(this.decodeEngine=e,1):(this.jsplayer._switchV3ToV1(this.streamOpenMode,this.HIK40Head,this.HIKHeadSize,this.HIKPoolSize,!0),0)}},{key:"_switchHardToSoft",value:function(){return this.JSPlayM4_Stop(!0),this.JSPlayM4_CloseStream(),this.JSPlayM4_FreePort(),this.supportSab&&this.supportOffscreen?(this.JSPlayM4_SetDecodeEngine(0)&&(console.log("V3 switchHardToSoft this.szBasePath:"+this.szBasePath),this.JSPlayM4_GetPort(),this.JSPlayM4_SetStreamOpenMode(this.streamOpenMode),this.JSPlayM4_OpenStream(this.HIK40Head,this.HIKHeadSize,this.HIKPoolSize),this.JSPlayM4_Play(null,!0)),1):(this.jsplayer._switchV3ToV1(this.streamOpenMode,this.HIK40Head,this.HIKHeadSize,this.HIKPoolSize,!0),0)}},{key:"_HardToSoftNeedResetParam",value:function(){null!=this.FFCallBackFun&&we._JSPlayM4_SetFirstFrameCallBack(this.port,this.FirstFrameCallBackflag,this.nUser),this.needSetSecretKey&&this.JSPlayM4_SetSecretKey(this.SecretKeyData),null!=this.globalBaseTime&&this.globalBaseTime.month>0&&this.globalBaseTime.month<13&&this.JSPlayM4_SetGlobalBaseTime(this.globalBaseTime.year,this.globalBaseTime.month,this.globalBaseTime.day,this.globalBaseTime.hour,this.globalBaseTime.min,this.globalBaseTime.sec,this.globalBaseTime.ms),this.needSetSkipErrorData&&this.JSPlayM4_SkipErrorData(this.skipErrorData),this.needSetDemuxModel&&this.JSPlayM4_SetDemuxModel(this.setDemuxModelType,this.setDemuxModelFlag),this.JSPlayM4_SetDecodeFrameType(this.decodeFrameType),-1!=this.decInterval&&we._JSPlayM4_SetIFrameDecInterval(this.port,nInterval),0!=this.decodeThreadNum&&we._JSPlayM4_SetDecodeThreadNum(this.port,this.decodeThreadNum),0!=this.decodeERCLevel&&we._JSPlayM4_SetDecodeERC(this.port,this.decodeERCLevel),-1!=this.resetBufferType&&we._JSPlayM4_ResetBuffer(this.port,this.resetBufferType),this.needPlaySound&&this.JSPlayM4_PlaySound(),-1!=this.setAudioThreadModel&&this.JSPlayM4_SetAudioThreadModel(this.setAudioThreadModel),-1!=this.syncToAudio&&this.JSPlayM4_SyncToAudio(this.syncToAudio),this.anrParamFlag&&-1!=this.anrParamLevel&&this.JSPlayM4_SetANRParam(this.anrParamFlag,this.anrParamLevel),this.resampleFlag&&this.JSPlayM4_SetResampleValue(this.resampleFlag,this.resampleRate),-1!=this.volumeValue&&this.JSPlayM4_SetVolume(this.volumeValue),null!=this.runtimeCBFun&&we._JSPlayM4_SetRunTimeInfoCallBackEx(this.port,this.runTimeModule,this.nUser),0!=this.playOrBackSwitchMode&&we._JSPlayM4_SetPlayOrBackSwitchMode(this.port,this.playOrBackSwitchMode);var e,t=p(this.renderPrivateInfo.keys());try{for(t.s();!(e=t.n()).done;){var i=e.value,n=this.renderPrivateInfo.get(i);we._JSPlayM4_RenderPrivateData(this.port,i,n)}}catch(e){t.e(e)}finally{t.f()}var a,r=p(this.renderIntelSubEx.keys());try{for(r.s();!(a=r.n()).done;){var o=a.value,s=this.renderIntelSubEx.get(o),l=this.renderIntelFlagEx.get(o);we._JSPlayM4_RenderPrivateDataEx(this.port,o,s,l)}}catch(e){r.e(e)}finally{r.f()}return this.needSetDisplayBuf&&we._JSPlayM4_SetDisplayBuf(this.port,this.displayBuf),-1!=this.antialiasFlag&&we._JSPlayM4_SetAntialias(this.port,this.antialiasFlag),this.needSetD3DPostProcess&&we._JSPlayM4_SetD3DPostProcess(this.port,this.d3dPostProcessType,this.d3dPostProcessValue),0!=this.setStretchPlaySpeed&&we._JSPlayM4_SetStretchPlay(this.port,this.setStretchPlayTime,this.setStretchPlaySpeed),-1!=this.autoSmoothPlayModel&&we._JSPlayM4_SetAutoSmoothPlay(this.port,this.autoSmoothPlayModel),-1!=this.keepPlaySpeed&&we._JSPlayM4_KeepPlaySpeed(this.port,this.keepPlaySpeed),0!=this.printfFlag&&this.JSPlayM4_SetPrintLogFlag(this.printfFlag),""!=this.FECCanvasID&&this.JSPlayM4_FEC_SetCanvasID(this.FECCanvasID,!0),0!=this.FECPlaceType&&we._JSPlayM4_FEC_ResetCorrectType(this.port,0,this.FECPlaceType,this.FECCorrectType),1}},{key:"JSPlayM4_DownloadRawData",value:function(){return this.downloadFlag=!0,1}},{key:"JSPlayM4_InputRawData",value:function(e,t,i){if(this.rawDataFrameInfoBuffer=i,this.rawDataFrameInfo.port=e,this.rawDataFrameInfo.codecType=we.HEAP32[this.rawDataFrameInfoBuffer+4>>2],this.rawDataFrameInfo.frameType=we.HEAP32[this.rawDataFrameInfoBuffer+12>>2],this.rawDataFrameInfo.frameSize=we.HEAP32[this.rawDataFrameInfoBuffer+16>>2],this.rawDataFrameInfo.width=we.HEAP32[this.rawDataFrameInfoBuffer+20>>2],this.rawDataFrameInfo.height=we.HEAP32[this.rawDataFrameInfoBuffer+24>>2],this.rawDataFrameInfo.timeStamp=we.HEAP32[this.rawDataFrameInfoBuffer+28>>2],this.rawDataFrameInfo.frameRate=we.HEAP32[this.rawDataFrameInfoBuffer+32>>2],this.rawDataFrameInfo.frameNum=we.HEAP32[this.rawDataFrameInfoBuffer+36>>2],this.rawDataFrameInfo.isKeyFrame=we.HEAP32[this.rawDataFrameInfoBuffer+40>>2],this.rawDataFrameInfo.interlace=we.HEAP32[this.rawDataFrameInfoBuffer+44>>2],this.rawDataFrameInfo.streamEnd=we.HEAP32[this.rawDataFrameInfoBuffer+48>>2],this.rawDataFrameInfo.cropLeft=we.HEAP32[this.rawDataFrameInfoBuffer+52>>2],this.rawDataFrameInfo.cropRight=we.HEAP32[this.rawDataFrameInfoBuffer+56>>2],this.rawDataFrameInfo.cropTop=we.HEAP32[this.rawDataFrameInfoBuffer+60>>2],this.rawDataFrameInfo.cropBottom=we.HEAP32[this.rawDataFrameInfoBuffer+64>>2],this.rawDataFrameInfo.year=we.HEAP16[this.rawDataFrameInfoBuffer+68>>1],this.rawDataFrameInfo.month=we.HEAP16[this.rawDataFrameInfoBuffer+70>>1],this.rawDataFrameInfo.week=we.HEAP16[this.rawDataFrameInfoBuffer+72>>1],this.rawDataFrameInfo.day=we.HEAP16[this.rawDataFrameInfoBuffer+74>>1],this.rawDataFrameInfo.hour=we.HEAP16[this.rawDataFrameInfoBuffer+76>>1],this.rawDataFrameInfo.minute=we.HEAP16[this.rawDataFrameInfoBuffer+78>>1],this.rawDataFrameInfo.second=we.HEAP16[this.rawDataFrameInfoBuffer+80>>1],this.rawDataFrameInfo.milliseconds=we.HEAP16[this.rawDataFrameInfoBuffer+82>>1],this.rawDataFrameInfo.needSetPreSoft=!1,(this.rawDataFrameInfo.frameRate<1||1==this.rawDataFrameInfo.interlace)&&(this.rawDataFrameInfo.needSetPreSoft=!0),5==this.rawDataFrameInfo.codecType&&Ae<107&&console.info("%c1>your browser does not support hard 265 Decoder,please update chrome,sab:%d","color: red",this.sab),0!=this.width&&0!=this.height||(this.width=this.rawDataFrameInfo.width,this.height=this.rawDataFrameInfo.height,this.startTimeStamp=this.rawDataFrameInfo.timeStamp,this.FirstFrame=!1),0==this.rawDataFrameInfo.cropLeft&&0==this.rawDataFrameInfo.cropRight&&0==this.rawDataFrameInfo.cropTop&&0==this.rawDataFrameInfo.cropBottom||(this.cropBottom=this.rawDataFrameInfo.cropBottom,this.cropLeft=this.rawDataFrameInfo.cropLeft,this.cropRight=this.rawDataFrameInfo.cropRight,this.cropTop=this.rawDataFrameInfo.cropTop),1==this.decodeFrameType){if(1!==this.rawDataFrameInfo.isKeyFrame)return 1;this.needWaitIFrame&&(this.hasWebWorker?this.decodeWorker.postMessage({command:"SetDecodeFrameType",timestamp:this.rawDataFrameInfo.timeStamp}):this.pcVideoManager.SetDecodeFrameType(this.rawDataFrameInfo.timeStamp),this.needWaitIFrame=!1)}if(0==this.decodeFrameType&&1==this.switchDecodeFrame){if(1!==this.rawDataFrameInfo.isKeyFrame)return 1;this.switchDecodeFrame=!1}if(this.downloadFlag&&this.downloadRTPData(t),this.hasWebWorker){if(null===this.decodeWorker)return t=null,0;this.decodeWorker.postMessage({command:"inputData",rawData:t.buffer,rawDataFrameInfo:this.rawDataFrameInfo},[t.buffer])}else null!==this.pcVideoManager&&this.pcVideoManager.inputData(t,this.rawDataFrameInfo)}},{key:"JSPlayM4_GetRawData",value:function(){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetRawData","color: red"),0;we._JSPlayM4_GetRawData(this.port)}},{key:"JSPlayM4_ResetEnd",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_ResetEnd","color: red"),0):we._JSPlayM4_ResetEnd(this.port)}},{key:"JSPlayM4_NeedReset",value:function(e,t,i){return this.hasWebWorker?null!=Re[i][e].decodeWorker&&Re[i][e].decodeWorker.postMessage({command:"needReset"}):this.pcVideoManager.needReset(),1}},{key:"JSPlayM4_SetAudioDisplayBuf",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetAudioDisplayBuf","color: red"),0):we._JSPlayM4_SetAudioDisplayBuf(this.port,e)}},{key:"JSPlayM4_Play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.printfFlag&&console.log(">>>>>yff>>>>> JSPlayM4_Play 1 this.canvasID:"+this.canvasID+",this.supportSab:"+this.supportSab),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_Play","color: red"),0;if(this.printfFlag&&console.log(">>>>>yff>>>>> JSPlayM4_Play 2:"+this.decodeEngine),null!=e&&(this.canvasID=e,this.canvasWidth=document.getElementById(this.canvasID).width,this.canvasHeight=document.getElementById(this.canvasID).height),0===De&&5===this.codecType?(this.decodeEngine=0,console.info("%c2>there will decode 265 by softDecoder","color: green")):0!==ke||256!==this.codecType&&1!==this.codecType||(this.decodeEngine=0,console.info("%c2>there will decode 264 by softDecoder","color: green")),0==ke&&0==De&&(this.decodeEngine=0),!(this.supportSab&&this.supportOffscreen||0!==this.decodeEngine))return console.info("%c3>SharedArrayBuffer or Offscreen Error , does not support Soft Decdoe!!!!!","color: red"),this.jsplayer._switchV3ToV1(this.streamOpenMode,this.HIK40Head,this.HIKHeadSize,this.HIKPoolSize,!0),0;if(-1!=this.setHasThread&&(this.hasThread=this.setHasThread),we._JSPlayM4_SetDecodeEngine(this.port,this.decodeEngine,this.hasThread),console.log("%cThe final decodeEngine is %d (0 is soft,1 is hard),codecType:%d","color: green",this.decodeEngine,this.codecType),0===this.decodeEngine&&t&&null!=this.canvasID){var i=document.getElementById(this.canvasID);i&&(this.clonedCanvas=i.cloneNode(!0),this.clonedCanvasParentNode=i.parentNode,this.clonedCanvasParentNode.replaceChild(this.clonedCanvas,i))}this.printfFlag&&console.log(">>>>>yff>>>>> JSPlayM4_Play 2 this.canvasID:"+this.canvasID+",this.supportSab:"+this.supportSab+",this.decodeEngine:"+this.decodeEngine);var n=1;if(1===this.decodeEngine){this.hasWebWorker?this.startWorker(this.canvasID,this):(this.canvasCnv=document.getElementById(this.canvasID),this.pcVideoManager.init(this.canvasCnv,this.streamOpenMode,this.supportSab,this.renderEngine),this.needSetDisplayBuf&&this.pcVideoManager.SetDisplayBuf(this.displayBuf)),we._JSPlayM4_SetVideoRawDataCallBack(this.port,this.nUser);var a=we.addFunction(this.JSPlayM4_NeedReset,"viii");we._JSPlayM4_SetResetCallBack(this.port,a,this.nUser),we._JSPlayM4_SetPrivateInfoCallBack(this.port,this.nUser),this.JSPlayM4_SetCanvasSize(this.canvasWidth,this.canvasHeight),1==(n=we._JSPlayM4_Play(this.port,null))&&(this.curStatus=2)}else if(0===this.decodeEngine){if(""!=this.canvasID&&null!=this.canvasID){var r=this._stringToBytes("#"+this.canvasID),o=2*(this.canvasID.length+1);if(this.canvasIDData=we._malloc(o),null===this.canvasIDData)return 0;var s=we.HEAPU8.subarray(this.canvasIDData,this.canvasIDData+o),l=new Uint8Array(o);s.set(l,0),s.set(new Uint8Array(r)),s=null,l=null}this._HardToSoftNeedResetParam(),1==(n=we._JSPlayM4_Play(this.port,this.canvasIDData))&&(this.curStatus=2)}return this.JSPlayM4_SetFrameInfoCallBack(1),n}},{key:"JSPlayM4_InputData",value:function(e,t){if(this.inputDataBufferSize<t&&(null!==this.inputDataBuffer&&(we._free(this.inputDataBuffer),this.inputDataBuffer=null),this.inputDataBufferSize=t),null===this.inputDataBuffer&&(this.inputDataBuffer=we._malloc(this.inputDataBufferSize)),null===this.inputDataBuffer)return console.log("inputdata malloc failed!!!"),0;if(1==this.needResetCanvasSize&&(this.JSPlayM4_SetCanvasSize(this.canvasWidth,this.canvasHeight+1),this.needResetCanvasSize=!1),this.enableCanvas){var i=this.JSPlayM4_GetFrameInfo(),n=i.width,a=i.height;n&&a&&(this.JSPlayM4_SetCanvasSize(this.canvasWidth,this.canvasHeight-1),this.enableCanvas=!1,this.needResetCanvasSize=!0)}var r=new Uint8Array(e.buffer);we.writeArrayToMemory(r,this.inputDataBuffer);var o=we._JSPlayM4_InputData(this.port,this.inputDataBuffer,t);return this.printfFlag&&console.log(">>>>>yff>>>>> JSPlayM4_InputData 2 res:"+o+",inputSize:"+t),o}},{key:"JSPlayM4_Stop",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_Stop","color: red"),0;if(this.hasWebWorker?null!=this.decodeWorker&&this.decodeWorker.postMessage({command:"stop"}):null!=this.pcVideoManager&&this.pcVideoManager.stop(),this.bWriteData&&this.iFrameNum>0){console.log("download"+this.iFrameNum+"Psdata");var t=new Uint8Array(this.aTotalBuffer);this._downloadFile(t,"RTPRaw.data"),this.aTotalBuffer.splice(0,this.aTotalBuffer.length),this.bWriteData=!1,this.iFrameNum=0,t=null}if(2==this.curStatus||5==this.curStatus){var i=we._JSPlayM4_Stop(this.port);if(1==i&&(this.curStatus=4),1==i&&e){var n=document.getElementById(this.canvasID);if(n&&(this.clonedCanvas=n.cloneNode(!0),this.clonedCanvasParentNode=n.parentNode,this.clonedCanvasParentNode.replaceChild(this.clonedCanvas,n)),0!=this.FECcanvasIDArray.length)for(var a=0;a<this.FECcanvasIDArray.length;a++){var r=document.getElementById(this.FECcanvasIDArray[a]);r&&(this.clonedCanvas=r.cloneNode(!0),this.clonedCanvasParentNode=r.parentNode,this.clonedCanvasParentNode.replaceChild(this.clonedCanvas,r))}}return i}return 1}},{key:"JSPlayM4_CloseStream",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_CloseStream","color: red"),0):null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_FreePort","color: red"),0):(null!==this.inputDataBuffer&&(we._free(this.inputDataBuffer),this.inputDataBuffer=null),null!==this.canvasIDData&&(we._free(this.canvasIDData),this.canvasIDData=null,this.FirstFrame=!0),null!=this.pFECTotalCanvasIDData&&(we._free(this.pFECTotalCanvasIDData),this.pFECTotalCanvasIDData=null),null!=this.pBmpData&&(we._free(this.pBmpData),this.pBmpData=null),null!=this.pBmpSizeData&&(we._free(this.pBmpSizeData),this.pBmpSizeData=null),null!=this.pJpegData&&(we._free(this.pJpegData),this.pJpegData=null),null!=this.pJPEGSizeData&&(we._free(this.pJPEGSizeData),this.pJPEGSizeData=null),this.bmpDataCallback=null,this.jpegDataCallback=null,this.aTotalBuffer.splice(0,this.aTotalBuffer.length),this.audioPCMBuffer.splice(0,this.audioPCMBuffer.length),this.width=0,this.height=0,this.curStatus=1,this.iZoomNum=0,this.rawDataFrameInfoBuffer=null,this.displayFrameInfo={},this.rawDataFrameInfo={},this.pcVideoManager=null,we._JSPlayM4_CloseStream(this.port))}},{key:"JSPlayM4_FreePort",value:function(){return we._JSPlayM4_FreePort(this.port)}},{key:"JSPlayM4_SetDecodeFrameType",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDecodeFrameType","color: red"),0):(this.decodeFrameType=e,1===this.decodeEngine?(0==e&&1==this.decodeFrameType&&(this.switchDecodeFrame=!0),1==e&&(this.needWaitIFrame=!0),1):we._JSPlayM4_SetDecodeFrameType(this.port,e))}},{key:"JSPlayM4_PlaySound",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_PlaySound","color: red"),0):(this.needPlaySound=!0,we._JSPlayM4_PlaySound(this.port))}},{key:"resizedataURL",value:function(e,t,i){return new Promise((n=B().mark((function n(a,r){var o;return B().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:(o=document.createElement("img")).onload=function(){var e=document.createElement("canvas"),n=e.getContext("2d");e.width=t,e.height=i,n.drawImage(this,0,0,t,i);var r=e.toDataURL();a(r)},o.src=e;case 3:case"end":return n.stop()}}),n)})),a=function(){var e=this,t=arguments;return new Promise((function(i,a){var r=n.apply(e,t);function o(e){l(r,i,a,o,s,"next",e)}function s(e){l(r,i,a,o,s,"throw",e)}o(void 0)}))},function(e,t){return a.apply(this,arguments)}));var n,a}},{key:"_GetImage",value:function(e,t){if(1===this.decodeEngine&&e.width&&e.height){var i="image/"+t,n=document.createElement("canvas"),a=n.getContext("2d");n.width=e.width,n.height=e.height,a.drawImage(e,0,0,e.width,e.height),n.toBlob((function(n){console.log("blob:"+n);var r=window.URL.createObjectURL(n),o=document.createElement("a");o.download=(new Date).getTime()+"."+t,o.href=r,o.dataset.downloadurl=[i,o.download,o.href].join(":"),document.body.appendChild(o),o.click(),document.body.removeChild(o),e.close(),a=null}),i)}}},{key:"_GetImage2",value:function(e,t,i,n,a,r,o,s,l,c){var d=this;setTimeout((function(){if(0!=i&&0!=n){var u=we._malloc(t);if(null===u)return;we.writeArrayToMemory(new Uint8Array(e,0,t),u);var h;h=704!=i||288!=n&&240!=n?i*n*4+60:i*n*8+60;var f=we._malloc(h),x=we._malloc(4);if(null===f||null===x)return we._free(u),u=null,null!=f&&(we._free(f),f=null),void(null!=x&&(we._free(x),x=null));we.setValue(x,h,"i32");var p=2;"nv12"===r?p=2:"I420"===r&&(p=3),"jpeg"==a?we._JSPlayM4_VideoDataToJpeg(d.port,u,t,f,x,i,n,p,o,s,l,c):"bmp"==a&&we._JSPlayM4_VideoDataToBMP(d.port,u,t,f,x,i,n,p,o,s,l,c);var m=we.getValue(x,"i32"),_=new Uint8Array(m);_.set(we.HEAPU8.subarray(f,f+m)),0==o&&0==s&&0==l&&0==c?"jpeg"==a?(null!=d.jpegDataCallback&&d.jpegDataCallback(_,m),d.jpegDownloadFlag&&d._downloadFile(_,"GetImage."+a),d.jpegDataCallback=null,d.jpegDownloadFlag=!1):"bmp"==a&&(null!=d.bmpDataCallback&&d.bmpDataCallback(_,m),d.bmpDownloadFlag&&d._downloadFile(_,"GetImage."+a),d.bmpDataCallback=null,d.bmpDownloadFlag=!1):d._downloadFile(_,"GetCropImage."+a),_=null,null!=f&&(we._free(f),f=null),null!=x&&(we._free(x),x=null)}}),0)}},{key:"JSPlayM4_GetJPEG",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.jpegDataCallback=e,this.jpegDownloadFlag=t,1===this.decodeEngine)return this.hasWebWorker?this.decodeWorker.postMessage({command:"GetJPEG"}):null!=this.pcVideoManager&&this.pcVideoManager.GetJPEG(),1;if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetJPEG","color: red"),0;var i=we._JSPlayM4_GetFrameInfo(this.port);if(this.width=we.HEAP32[i+12>>2],this.height=we.HEAP32[i+16>>2],0!=this.width&&0!=this.height){var n=this.width*this.height*4+60;if((null==this.pJpegData||this.nJPEGDataSize<n)&&(null!=this.pJpegData&&(we._free(this.pJpegData),this.pJpegData=null),this.nJPEGDataSize=n,this.pJpegData=we._malloc(this.nJPEGDataSize),null===this.pJpegData))return;null==this.pJPEGSizeData&&(this.pJPEGSizeData=we._malloc(4));var a=we._JSPlayM4_GetJPEG(this.port,this.pJpegData,this.nJPEGDataSize,this.pJPEGSizeData);if(1!=a){var r=we._JSPlayM4_GetLastError(this.port);console.log("errorcode:"+r)}if(1==a){var o=we.getValue(this.pJPEGSizeData,"i32"),s=new Uint8Array(o);s.set(we.HEAPU8.subarray(this.pJpegData,this.pJpegData+o)),null!=e&&e(s,o),t&&this._downloadFile(s,"GetJPEG.jpeg"),s=null,this.jpegDataCallback=null,this.jpegDownloadFlag=!1}return a}return 0}},{key:"JSPlayM4_GetBMP",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.bmpDataCallback=e,this.bmpDownloadFlag=t,1===this.decodeEngine)return this.hasWebWorker?this.decodeWorker.postMessage({command:"GetBMP"}):null!=this.pcVideoManager&&this.pcVideoManager.GetBMP(),1;if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetBMP","color: red"),0;var i=we._JSPlayM4_GetFrameInfo(this.port);if(this.width=we.HEAP32[i+12>>2],this.height=we.HEAP32[i+16>>2],0==this.width||0==this.height)return 0;var n;if(n=704!=this.width||288!=this.height&&240!=this.height?this.width*this.height*4+60:this.width*this.height*8+60,!(null==this.pBmpData||this.nBmpDataSize<n)||(null!=this.pBmpData&&(we._free(this.pBmpData),this.pBmpData=null),this.nBmpDataSize=n,this.pBmpData=we._malloc(this.nBmpDataSize),null!==this.pBmpData)){null==this.pBmpSizeData&&(this.pBmpSizeData=we._malloc(4));var a=we._JSPlayM4_GetBMP(this.port,this.pBmpData,this.nBmpDataSize,this.pBmpSizeData);if(1!=a){var r=we._JSPlayM4_GetLastError(this.port);console.log("errorcode:"+r)}if(1==a){var o=we.getValue(this.pBmpSizeData,"i32"),s=new Uint8Array(o);s.set(we.HEAPU8.subarray(this.pBmpData,this.pBmpData+o)),null!=e&&e(s,o),t&&this._downloadFile(s,"GetBmp.bmp"),s=null,this.bmpDataCallback=null,this.bmpDownloadFlag=!1}return 1}}},{key:"JSPlayM4_GetCropJPEG",value:function(){if(1===this.decodeEngine)return this.hasWebWorker?this.decodeWorker.postMessage({command:"GetCropJPEG"}):null!=this.pcVideoManager&&this.pcVideoManager.GetCropJPEG(),1;if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetCropJPEG","color: red"),0;var e=we._JSPlayM4_GetFrameInfo(this.port);if(this.width=we.HEAP32[e+12>>2],this.height=we.HEAP32[e+16>>2],0!=this.width&&0!=this.height){var t=this.width*this.height*4+60,i=we._malloc(t),n=we._malloc(4),a=this.SetDisRegionBottom,r=this.SetDisRegionLeft,o=this.SetDisRegionRight,s=this.SetDisRegionTop;if(null===i)return;var l=we._JSPlayM4_GetCropJPEG(this.port,i,t,n,0,0,r,s,o,a);if(1!=l){var c=we._JSPlayM4_GetLastError(this.port);console.log("errorcode:"+c)}if(1==l){var d=we.getValue(n,"i32"),u=new Uint8Array(d);u.set(we.HEAPU8.subarray(i,i+d)),this._downloadFile(u,"GetCropJPEG.jpeg"),u=null}return null!=i&&(we._free(i),i=null),null!=n&&(we._free(n),n=null),l}return 0}},{key:"JSPlayM4_GetCropBMP",value:function(){if(1===this.decodeEngine)return this.hasWebWorker?this.decodeWorker.postMessage({command:"GetCropBMP"}):null!=this.pcVideoManager&&this.pcVideoManager.GetCropBMP(),1;if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetCropBMP","color: red"),0;var e=we._JSPlayM4_GetFrameInfo(this.port);if(this.width=we.HEAP32[e+12>>2],this.height=we.HEAP32[e+16>>2],0==this.width||0==this.height)return 0;var t=this.width*this.height*4+60,i=we._malloc(t),n=we._malloc(4),a=this.SetDisRegionBottom,r=this.SetDisRegionLeft,o=this.SetDisRegionRight,s=this.SetDisRegionTop;if(null!==i){var l=we._JSPlayM4_GetCropBMP(this.port,i,t,n,0,0,r,s,o,a);if(1!=l){var c=we._JSPlayM4_GetLastError(this.port);console.log("errorcode:"+c)}if(1==l){var d=we.getValue(n,"i32"),u=new Uint8Array(d);u.set(we.HEAPU8.subarray(i,i+d)),this._downloadFile(u,"GetCropBmp.bmp"),u=null}return null!=i&&(we._free(i),i=null),null!=n&&(we._free(n),n=null),1}}},{key:"JSPlayM4_GetCanvasCapture",value:function(e){return 1===this.decodeEngine?(this.hasWebWorker?this.decodeWorker.postMessage({command:"GetCanvasCapture",cbFun:e}):null!=this.pcVideoManager&&this.pcVideoManager.JSPlayM4_GetCanvasCapture(e),1):(console.info("%c SoftDecode not support canvas capture","color: red"),1)}},{key:"JSPlayM4_StopSound",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_StopSound","color: red"),0):(this.needPlaySound=!1,we._JSPlayM4_StopSound())}},{key:"JSPlayM4_GetSDKVersion",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetSDKVersion","color: red"),0):we._JSPlayM4_GetSDKVersion()}},{key:"JSPlayM4_GetBuildDate",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetBuildDate","color: red"),0):we._JSPlayM4_GetBuildDate()}},{key:"JSPlayM4_GetLastError",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetLastError","color: red"),0):we._JSPlayM4_GetLastError(this.port)}},{key:"JSPlayM4_Fast",value:function(){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_Fast","color: red"),0;if(0===this.streamOpenMode)return 1;if(1===this.decodeEngine)if(this.hasWebWorker){if(null===this.decodeWorker)return 0;this.decodeWorker.postMessage({command:"fast"})}else null!=this.pcVideoManager&&this.pcVideoManager.fast();var e=we._JSPlayM4_Fast(this.port);return 1==e&&(this.playSpeed=2*this.playSpeed),e}},{key:"JSPlayM4_Slow",value:function(){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_Slow","color: red"),0;if(0===this.streamOpenMode)return 1;if(1===this.decodeEngine)if(this.hasWebWorker){if(null===this.decodeWorker)return 0;this.decodeWorker.postMessage({command:"slow"})}else null!=this.pcVideoManager&&this.pcVideoManager.slow();var e=we._JSPlayM4_Slow(this.port);return 1==e&&(this.playSpeed=this.playSpeed/2),console.log("this.playSpeed:"+this.playSpeed),e}},{key:"JSPlayM4_SetIFrameDecInterval",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetIFrameDecInterval","color: red"),0):1===this.decodeEngine?1:(this.decInterval=e,we._JSPlayM4_SetIFrameDecInterval(this.port,e))}},{key:"JSPlayM4_Pause",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_Pause","color: red"),0):0===this.streamOpenMode?1:(1===this.decodeEngine&&(this.hasWebWorker?this.decodeWorker.postMessage({command:"Pause",value:e}):null!=this.pcVideoManager&&this.pcVideoManager.Pause(e)),we._JSPlayM4_Pause(this.port,e))}},{key:"JSPlayM4_OneByOne",value:function(){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_OneByOne","color: red"),0;if(0===this.streamOpenMode)return 0;Fe.cmd="onebyone";var e=we._JSPlayM4_GetSourceBufferRemain(this.port),t=we._JSPlayM4_GetLastError(this.port);return e<1e3||31==t?(Fe.errorCode=31,Fe.status=!0,this.fn(Fe)):(e>this.HIKPoolSize-1e3||11==t)&&(Fe.errorCode=0,Fe.status=!1,this.fn(Fe)),this.curStatus=5,1===this.decodeEngine&&(this.hasWebWorker?this.decodeWorker.postMessage({command:"OneByOne",value:1}):null!=this.pcVideoManager&&this.pcVideoManager.OneByOne(1)),we._JSPlayM4_OneByOne(this.port)}},{key:"JSPlayM4_OneByOneResume",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_OneByOneResume","color: red"),0):(Fe.cmd="play",0===this.streamOpenMode?1:(this.curStatus=2,1===this.decodeEngine&&(this.hasWebWorker?this.decodeWorker.postMessage({command:"OneByOne",value:0}):null!=this.pcVideoManager&&this.pcVideoManager.OneByOne(0)),we._JSPlayM4_Play(this.port,this.canvasIDData)))}},{key:"JSPlayM4_SetVolume",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetVolume","color: red"),0):(this.volumeValue=e,we._JSPlayM4_SetVolume(this.port,e))}},{key:"JSPlayM4_GetVolume",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetVolume","color: red"),0):we._JSPlayM4_GetVolume(this.port)}},{key:"JSPlayM4_SetDisplayRegion",value:function(e,t,i,n,a){var r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDisplayRegion","color: red"),0;var s=1,l=t,c=n,d=i,u=a;if("number"!=typeof t||"number"!=typeof n||"number"!=typeof i||"number"!=typeof a)return console.log("param is not number"),0;if(r)l=0,d=this.canvasWidth,c=0,u=this.canvasHeight,this.iZoomNum=0,this.iRatio_x=1,this.iRatio_y=1;else if(o){if(l<0||d<0||c<0||u<0)return 0;0!==this.iZoomNum&&(l=Math.round(l/this.iRatio_x)+this.stDisplayRect.left,c=Math.round(c/this.iRatio_y)+this.stDisplayRect.top,d=Math.round(d/this.iRatio_x)+this.stDisplayRect.left,u=Math.round(u/this.iRatio_y)+this.stDisplayRect.top)}if(this.stDisplayRect={top:c,left:l,right:d,bottom:u},d-l<16||u-c<16||d-l>this.canvasWidth||u-c>this.canvasHeight)return console.log(">>>JS left:"+t+",right:"+i+",top:"+n+",bottom:"+a+",bClose:"+r+",bZoomEnable:"+o+",iZoomNum:"+this.iZoomNum+",canvasWidth:"+this.canvasWidth+",canvasHeight:"+this.canvasHeight),0;if(1===this.decodeEngine)if(this.SetDisRegionBottom=u/this.canvasHeight*this.height,this.SetDisRegionLeft=l/this.canvasWidth*this.width,this.SetDisRegionRight=d/this.canvasWidth*this.width,this.SetDisRegionTop=c/this.canvasHeight*this.height,this.hasWebWorker){if(null===this.decodeWorker)return 0;this.decodeWorker.postMessage({command:"SetDisplayRegion",sx:this.SetDisRegionLeft,sy:this.SetDisRegionTop,sw:this.SetDisRegionRight-this.SetDisRegionLeft,sh:this.SetDisRegionBottom-this.SetDisRegionTop})}else null!=this.pcVideoManager&&this.pcVideoManager.SetDisplayRegion(this.SetDisRegionLeft,this.SetDisRegionTop,this.SetDisRegionRight-this.SetDisRegionLeft,this.SetDisRegionBottom-this.SetDisRegionTop);else{var h=we._JSPlayM4_GetFrameInfo(this.port);this.width=we.HEAP32[h+12>>2],this.height=we.HEAP32[h+16>>2],this.SetDisRegionBottom=u/this.canvasHeight*this.height,this.SetDisRegionLeft=l/this.canvasWidth*this.width,this.SetDisRegionRight=d/this.canvasWidth*this.width,this.SetDisRegionTop=c/this.canvasHeight*this.height,s=we._JSPlayM4_SetDisplayRegion(this.port,this.canvasID,this.SetDisRegionLeft,this.SetDisRegionRight,this.SetDisRegionTop,this.SetDisRegionBottom)}return o&&(this.iRatio_x=this.canvasWidth/(d-l),this.iRatio_y=this.canvasHeight/(u-c),this.iZoomNum++),s}},{key:"JSPlayM4_SetPrintLogFlag",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetPrintLogFlag","color: red"),0):(this.printfFlag=Number(e),we._JSPlayM4_SetPrintLogFlag(this.port,e))}},{key:"JSPlayM4_RenderPrivateData",value:function(e,t){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_RenderPrivateData","color: red"),0;if(this.renderPrivateInfo.set(e,t),1===this.decodeEngine)if(this.hasWebWorker){if(null===this.decodeWorker)return 0;this.decodeWorker.postMessage({command:"RenderPrivateData",bTrue:t})}else null!=this.pcVideoManager&&this.pcVideoManager.RenderPrivateData(t);return we._JSPlayM4_RenderPrivateData(this.port,e,t)}},{key:"JSPlayM4_RenderPrivateDataEx",value:function(e,t,i){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_RenderPrivateDataEx","color: red"),0):(this.renderIntelSubEx.set(e,t),this.renderIntelFlagEx.set(e,i),we._JSPlayM4_RenderPrivateDataEx(this.port,e,t,i))}},{key:"JSPlayM4_SetCanvasSize",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetCanvasSize","color: red"),0;if(e<16||t<16||null===this.canvasID)return 0;if(this.canvasWidth=e,this.canvasHeight=t,1===this.decodeEngine)if(this.hasWebWorker){if(null==this.decodeWorker)return 0;this.decodeWorker.postMessage({command:"SetCanvasSize",width:e,height:t})}else null!=this.pcVideoManager&&this.pcVideoManager.SetCanvasSize(e,t);return we._JSPlayM4_SetCanvasSize(this.port,e,t,i)}},{key:"JSPlayM4_SetDisplayBuf",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDisplayBuf","color: red"),0):(this.displayBuf=e,this.needSetDisplayBuf=!0,1===this.decodeEngine&&(this.hasWebWorker?null===this.decodeWorker||this.decodeWorker.postMessage({command:"SetDisplayBuf",value:e}):null!=this.pcVideoManager&&this.pcVideoManager.SetDisplayBuf(e)),we._JSPlayM4_SetDisplayBuf(this.port,e))}},{key:"JSPlayM4_GetSourceBufferRemain",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetSourceBufferRemain","color: red"),0):we._JSPlayM4_GetSourceBufferRemain(this.port)}},{key:"JSPlayM4_GetBufferValue",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetBufferValue","color: red"),0):we._JSPlayM4_GetBufferValue(this.port,e)}},{key:"JSPlayM4_ReversePlay",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_ReversePlay","color: red"),0):0===this.streamOpenMode?1:(this.reversePlay=!0,we._JSPlayM4_ReversePlay(this.port))}},{key:"JSPlayM4_SetDecodeThreadNum",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDecodeThreadNum","color: red"),0):(this.decodeThreadNum=e,we._JSPlayM4_SetDecodeThreadNum(this.port,e))}},{key:"JSPlayM4_GetCanvasSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetCanvasSize","color: red"),0):1===this.decodeEngine?(this.hasWebWorker?this.decodeWorker.postMessage({command:"GetCanvasSize"}):null!=this.pcVideoManager&&this.pcVideoManager.GetCanvasSize(),1):we._JSPlayM4_GetCanvasSize(this.port,e)}},{key:"JSPlayM4_DisplayLostFrames",value:function(e,t,i){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_DisplayLostFrames","color: red"),0):we._JSPlayM4_DisplayLostFrames(this.port,e,t,i)}},{key:"JSPlayM4_SetANRParam",value:function(e,t){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetANRParam","color: red"),0):(this.anrParamFlag=e,this.anrParamLevel=t,we._JSPlayM4_SetANRParam(this.port,e,t))}},{key:"JSPlayM4_SetResampleValue",value:function(e,t){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetResampleValue","color: red"),0):(this.resampleFlag=e,this.resampleRate=t,we._JSPlayM4_SetResampleValue(this.port,e,t))}},{key:"JSPlayM4_SetAntialias",value:function(e){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetAntialias","color: red"),0;var t=1;return this.antialiasFlag=e,1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker&&this.decodeWorker.postMessage({command:"SetAntialias",value:e}):null!=this.pcVideoManager&&(t=this.pcVideoManager.SetAntialias(e)):t=we._JSPlayM4_SetAntialias(this.port,e),t}},{key:"JSPlayM4_SyncToAudio",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SyncToAudio","color: red"),0):(this.syncToAudio=SyncToAudio,we._JSPlayM4_SyncToAudio(this.port,e))}},{key:"JSPlayM4_SetAudioThreadModel",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetAudioThreadModel","color: red"),0):(this.setAudioThreadModel=e,we._JSPlayM4_SetAudioThreadModel(this.port,e))}},{key:"JSPlayM4_SetDecodeERC",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDecodeERC","color: red"),0):(this.decodeERCLevel=e,we._JSPlayM4_SetDecodeERC(this.port,e))}},{key:"JSPlayM4_SkipErrorData",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SkipErrorData","color: red"),0):(this.needSetSkipErrorData=!0,this.skipErrorData=e,we._JSPlayM4_SkipErrorData(this.port,e))}},{key:"JSPlayM4_SetDemuxModel",value:function(e,t){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDemuxModel","color: red"),0):(this.needSetDemuxModel=!0,this.setDemuxModelType=e,this.setDemuxModelFlag=t,we._JSPlayM4_SetDemuxModel(this.port,e,t))}},{key:"JSPlayM4_SetD3DPostProcess",value:function(e,t){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetD3DPostProcess","color: red"),0;var i=1;return this.d3dPostProcessType=e,this.d3dPostProcessValue=t,this.needSetD3DPostProcess=!0,1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker&&this.decodeWorker.postMessage({command:"SetD3DPostProcess",ProcessType:e,ProcessValue:t}):null!=this.pcVideoManager&&(i=this.pcVideoManager.SetD3DPostProcess(e,t)):i=we._JSPlayM4_SetD3DPostProcess(this.port,e,t),i}},{key:"JSPlayM4_SetFirstFrameCallBack",value:function(e,t){if(!(t&&"function"==typeof t||null===t))return 0;if(this.FFCallBackFun=t,this.FirstFrameCallBackflag=e,null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetFirstFrameCallBack","color: red"),0;var i=1;return 0===this.decodeEngine&&(i=we._JSPlayM4_SetFirstFrameCallBack(this.port,e,this.nUser)),i}},{key:"JSPlayM4_SetDecCallBack",value:function(e,t){return t&&"function"==typeof t||null===t?(this.decCallBackFun=t,null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDecCallBack","color: red"),0):we._JSPlayM4_SetDecCallBack(this.port,e,this.nUser)):0}},{key:"JSPlayM4_SetDisplayCallBack",value:function(e,t){return t&&"function"==typeof t||null===t?(this.displayCallBackFun=t,null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDisplayCallBack","color: red"),0):we._JSPlayM4_SetDisplayCallBack(this.port,e,this.nUser)):0}},{key:"JSPlayM4_SetFrameInfoCallBack",value:function(e){var t=this,i=1;if(1===this.decodeEngine)this.hasWebWorker?null!=this.decodeWorker&&this.decodeWorker.postMessage({command:"SetFrameInfoCallBack",value:e}):null!=this.pcVideoManager&&(i=this.pcVideoManager.SetFrameInfoCallBack((function(e){t.displayFrameInfo.port=e.port,t.displayFrameInfo.codecType=e.codecType,t.displayFrameInfo.frameType=e.frameType,t.displayFrameInfo.frameSize=e.frameSize,t.displayFrameInfo.width=e.width,t.displayFrameInfo.height=e.height,t.displayFrameInfo.timeStamp=e.timeStamp,t.displayFrameInfo.frameRate=e.frameRate,t.displayFrameInfo.frameNum=e.frameNum,t.displayFrameInfo.interlace=e.interlace,t.displayFrameInfo.streamEnd=e.streamEnd,t.displayFrameInfo.cropLeft=e.cropLeft,t.displayFrameInfo.cropRight=e.cropRight,t.displayFrameInfo.cropTop=e.cropTop,t.displayFrameInfo.cropBottom=e.cropBottom,t.displayFrameInfo.year=e.year,t.displayFrameInfo.month=e.month,t.displayFrameInfo.week=e.week,t.displayFrameInfo.day=e.day,t.displayFrameInfo.hour=e.hour,t.displayFrameInfo.minute=e.minute,t.displayFrameInfo.second=e.second,t.displayFrameInfo.milliseconds=e.milliseconds}),e));else{if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetFrameInfoCallBack","color: red"),0;i=we._JSPlayM4_SetFrameInfoCallBack(this.port,e)}return i}},{key:"JSPlayM4_SetDecCBStream",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetDecCBStream","color: red"),0):we._JSPlayM4_SetDecCBStream(this.port,e)}},{key:"JSPlayM4_GetFrameInfo",value:function(){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetFrameInfo","color: red"),0;var e={};if(0==this.decodeEngine){var t=we._JSPlayM4_GetFrameInfo(this.port);e.port=we.HEAP32[t>>2],e.frameType=we.HEAP32[t+4>>2],e.frameSize=we.HEAP32[t+8>>2],e.width=we.HEAP32[t+12>>2],e.height=we.HEAP32[t+16>>2],e.timeStamp=we.HEAP32[t+20>>2],e.frameRate=we.HEAP32[t+24>>2],e.bitPerSample=we.HEAP32[t+28>>2],e.samplesPerSec=we.HEAP32[t+32>>2],e.channel=we.HEAP32[t+36>>2],e.frameNum=we.HEAP32[t+40>>2],e.cropLeft=we.HEAP32[t+44>>2],e.cropRight=we.HEAP32[t+48>>2],e.cropTop=we.HEAP32[t+52>>2],e.cropBottom=we.HEAP32[t+56>>2],e.year=we.HEAP16[t+60>>1],e.month=we.HEAP16[t+62>>1],e.week=we.HEAP16[t+64>>1],e.day=we.HEAP16[t+66>>1],e.hour=we.HEAP16[t+68>>1],e.minute=we.HEAP16[t+70>>1],e.second=we.HEAP16[t+72>>1],e.milliseconds=we.HEAP16[t+74>>1],this.width=e.width,this.height=e.height}else e=this.displayFrameInfo;return e}},{key:"JSPlayM4_GetAdditionData",value:function(){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetAdditionData","color: red"),0;var e=null,t=we._JSPlayM4_GetAdditionData(this.port);return e.dataType=we.HEAP32[t>>2],e.dataStrVersion=we.HEAP32[t+4>>2],e.dataTimeStamp=we.HEAP32[t+8>>2],e.dataLength=we.HEAP32[t+12>>2],e.pData=we.HEAP32[t+16>>2],e.additionDataBuffer=new Uint8Array(dataLength),additionDataBuffer.set(we.HEAPU8.subarray(pData,pData+dataLength)),e}},{key:"JSPlayM4_SetAdditionDataCallBack",value:function(e,t,i){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetAdditionDataCallBack","color: red"),0):i&&"function"==typeof i||null===i?(this.addtionCallBackFun=i,we._JSPlayM4_SetAdditionDataCallBack(this.port,e,t,this.nUser)):0}},{key:"JSPlayM4_GetPlayedTimeEx",value:function(e){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetPlayedTimeEx","color: red"),0;if(!(e&&"function"==typeof e||null===e))return 0;if(this.getPlayTimeCallBackFun=e,1===this.decodeEngine){if(this.hasWebWorker)this.decodeWorker.postMessage({command:"GetPlayedTime"});else if(null!=this.pcVideoManager){var t=this.pcVideoManager.GetPlayedTime();this.getPlayTimeCallBackFun&&this.getPlayTimeCallBackFun(t-this.startTimeStamp)}}else{var i=we._JSPlayM4_GetPlayedTimeEx(this.port);this.getPlayTimeCallBackFun(i)}}},{key:"JSPlayM4_GetFileTime",value:function(){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetFileTime","color: red"),0):we._JSPlayM4_GetFileTime(this.port)}},{key:"JSPlayM4_GetMpOffset",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_GetMpOffset","color: red"),0):e>this.JSPlayM4_GetFileTime()?-1:(1===this.decodeEngine&&(this.hasWebWorker?this.decodeWorker.postMessage({command:"needReset"}):null!=this.pcVideoManager&&this.pcVideoManager.needReset()),we._JSPlayM4_GetMpOffset(this.port,e))}},{key:"JSPlayM4_ResetBuffer",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_ResetBuffer","color: red"),0):(this.resetBufferType=e,we._JSPlayM4_ResetBuffer(this.port,e))}},{key:"JSPlayM4_SetGlobalBaseTime",value:function(e,t,i,n,a,r,o){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetGlobalBaseTime","color: red"),0):(this.globalBaseTime={year:e,month:t,day:i,hour:n,min:a,sec:r,ms:o},we._JSPlayM4_SetGlobalBaseTime(this.port,e,t,i,n,a,r,o))}},{key:"JSPlayM4_SetSecretKey",value:function(e){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetSecretKey","color: red"),0;var t=this._stringToBytes(e),i=we._malloc(128);if(null!==i){var n=we.HEAPU8.subarray(i,i+128),a=new Uint8Array(128);n.set(a,0),n.set(new Uint8Array(t)),n=null,a=null;var r=we._JSPlayM4_SetSecretKey(this.port,1,i,128);return null!==i&&(we._free(i),i=null),1===r&&(this.needSetSecretKey=!0,this.SecretKeyData=e),r}}},{key:"JSPlayM4_SetRunTimeInfoCallBackEx",value:function(e,t){return t&&"function"==typeof t||null===t?(this.runtimeCBFun=t,this.runTimeModule=e,null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetRunTimeInfoCallBackEx","color: red"),0):we._JSPlayM4_SetRunTimeInfoCallBackEx(this.port,e,this.nUser)):0}},{key:"JSPlayM4_SetPlayOrBackSwitchMode",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetPlayOrBackSwitchMode","color: red"),0):(this.playOrBackSwitchMode=e,0==this.decodeEngine?we._JSPlayM4_SetPlayOrBackSwitchMode(this.port,e):0)}},{key:"JSPlayM4_SetStretchPlay",value:function(e,t){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetStretchPlay","color: red"),0):(this.setStretchPlayTime=e,this.setStretchPlaySpeed=t,0==this.decodeEngine?we._JSPlayM4_SetStretchPlay(this.port,e,t):0)}},{key:"JSPlayM4_SetAutoSmoothPlay",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetAutoSmoothPlay","color: red"),0):(this.autoSmoothPlayModel=e,0==this.decodeEngine?we._JSPlayM4_SetAutoSmoothPlay(this.port,e):0)}},{key:"JSPlayM4_KeepPlaySpeed",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_KeepPlaySpeed","color: red"),0):(this.keepPlaySpeed=e,0==this.decodeEngine?we._JSPlayM4_KeepPlaySpeed(this.port,e):0)}},{key:"JSPlayM4_IgnoreHeaderAudioDefine",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_IgnoreHeaderAudioDefine","color: red"),0):we._JSPlayM4_IgnoreHeaderAudioDefine(this.port,e)}},{key:"JSPlayM4_SetSycGroup",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetSycGroup","color: red"),0):we._JSPlayM4_SetSycGroup(this.port,e)}},{key:"JSPlayM4_FEC_SetCanvasID",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_SetCanvasID","color: red"),0;this.FECCanvasID=e;var i=1;if(null!=e&&""!=e)if(this.FECcanvasIDArray=e.split(","),1===this.decodeEngine)this.hasWebWorker?this.decodeWorker.postMessage({command:"SetCanvasID"}):null!=this.pcVideoManager?i=this.pcVideoManager.FEC_SetCanvasID(e):console.info("%c JSPlayM4_FEC_SetCanvasID this.pcVideoManager is null","color: red");else{for(var n="",a=0;a<this.FECcanvasIDArray.length;a++)a==this.FECcanvasIDArray.length-1?n+="#"+this.FECcanvasIDArray[a]:n+="#"+this.FECcanvasIDArray[a]+",";if(0!=this.FECcanvasIDArray.length&&t)for(var r=0;r<this.FECcanvasIDArray.length;r++){var o=document.getElementById(this.FECcanvasIDArray[r]);if(o){var s=o.cloneNode(!0);o.parentNode.replaceChild(s,o)}}var l=this._stringToBytes(n),c=2*n.length;if(this.pFECTotalCanvasIDData=we._malloc(c),null===this.pFECTotalCanvasIDData)return 0;var d=we.HEAPU8.subarray(this.pFECTotalCanvasIDData,this.pFECTotalCanvasIDData+c),u=new Uint8Array(c);d.set(u,0),d.set(new Uint8Array(l)),d=null,u=null,i=we._JSPlayM4_FEC_SetCanvasID(this.port,this.pFECTotalCanvasIDData)}else console.log(" JSPlayM4_FEC_SetCanvasID canvasID is null :"+e),i=0;return i}},{key:"JSPlayM4_FEC_ResetCorrectType",value:function(e,t,i){if(this.printfFlag&&console.log("JSPlayM4_FEC_ResetCorrectType 1 decodeEngine:"+this.decodeEngine+",hasWebWorker:"+this.hasWebWorker+",fishSubPort:"+e+",placeType:"+t+",correctType:"+i),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_ResetCorrectType","color: red"),0;this.FECPlaceType=t,this.FECCorrectType=i;var n=1;return 1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECResetCorrectType",fishSubPort:e,placeType:t,correctType:i}):n=0:n=null!=this.pcVideoManager?this.pcVideoManager.FEC_ResetCorrectType(e,t,i):0:n=we._JSPlayM4_FEC_ResetCorrectType(this.port,e,t,i),n}},{key:"JSPlayM4_FEC_GetPort",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(this.printfFlag&&console.log(">>>JS JSPlayM4_FEC_GetPort this.decodeEngine:"+this.decodeEngine+",placeType:"+e+",correctType:"+t),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_GetPort","color: red"),0;var n=-1;return this.FECGetPortCB=i,1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECGetPort",placeType:e,correctType:t}):n=-1:(null!=this.pcVideoManager?((n=this.pcVideoManager.FEC_GetPort(e,t))<1||n>31||null==n)&&(n=-1):n=-1,null!=this.FECGetPortCB&&this.FECGetPortCB(n)):(((n=we._JSPlayM4_FEC_GetPort(this.port,e,t))<1||n>31||null==n)&&(n=-1),null!=this.FECGetPortCB&&this.FECGetPortCB(n)),n}},{key:"JSPlayM4_FEC_Enable",value:function(e){if(this.printfFlag&&console.log(">>>JS JSPlayM4_FEC_Enable this.decodeEngine:"+this.decodeEngine+",fishSubPort:"+e),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_Enable","color: red"),0;var t=1;return 0==e?console.log("fishPort is 0 ,main canvas doesn't need call FEC_Enable"):1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECEnable",fishSubPort:e}):t=0:t=null!=this.pcVideoManager?this.pcVideoManager.FEC_Enable(e):0:t=we._JSPlayM4_FEC_Enable(this.port,e),t}},{key:"JSPlayM4_FEC_SetParam",value:function(e,t){if(this.printfFlag&&console.log(">>>JS JSPlayM4_FEC_SetParam 1 this.decodeEngine:"+this.decodeEngine+",fishSubPort:"+e+",upDateType:"+t.upDateType+",param2d.fPTZParam.fPTZPositionX:"+t.fPTZParam.fPTZPositionX+",param2d.fPTZParam.fPTZPositionY:"+t.fPTZParam.fPTZPositionY),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_SetParam","color: red"),0;var i=1;if(1===this.decodeEngine)this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECSetParam",fishSubPort:e,param2d:t}):i=0:i=null!=this.pcVideoManager?this.pcVideoManager.FEC_SetParam(e,t):0;else{var n=we._JSPlayM4_GetFishEye2DParam();null!=t.upDateType&&(we.HEAP32[n>>2]=t.upDateType),null!=t.fPTZParam&&null!=t.fPTZParam.fPTZPositionX&&null!=t.fPTZParam.fPTZPositionY&&(we.HEAPF32[n+8>>2]=t.fPTZParam.fPTZPositionX,we.HEAPF32[n+12>>2]=t.fPTZParam.fPTZPositionY),null!=t.fPTZParam&&(we.HEAPF32[n+32>>2]=t.fPTZZoom),null!=t.fValue&&(we.HEAPF32[n+36>>2]=t.fValue),i=we._JSPlayM4_FEC_SetParam(this.port,e)}return i}},{key:"JSPlayM4_FEC_GetParam",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_GetParam","color: red"),0;var i={fRXLeft:0,fRXRight:0,fRYTop:0,fRYBottom:0,bBlack:0,bCut:0,nFishParamType:0,fAngle:0,fZoom:0,fPTZX:0,fPTZY:0,emCorrectType:0};if(this.FECParamCB=t,1===this.decodeEngine)this.hasWebWorker?null!=this.decodeWorker&&this.decodeWorker.postMessage({command:"FECGetParam",fishSubPort:e}):null!=this.pcVideoManager&&(this.pcVideoManager.FEC_GetParam(e,i),null!=this.FECParamCB&&this.FECParamCB(i));else{var n=we._JSPlayM4_FEC_GetParam(this.port,e);i.bBlack=0,i.fPTZX=we.HEAPF32[n+8>>2],i.fPTZY=we.HEAPF32[n+12>>2],i.fRXLeft=we.HEAPF32[n+16>>2],i.fRXRight=we.HEAPF32[n+20>>2],i.fRYTop=we.HEAPF32[n+24>>2],i.fRYBottom=we.HEAPF32[n+28>>2],i.fZoom=we.HEAPF32[n+32>>2],i.fAngle=we.HEAPF32[n+36>>2],i.bCut=we.HEAPF32[n+63>>2],i.nFishParamType=we.HEAPF32[n+67>>2],null!=this.FECParamCB&&this.FECParamCB(i)}return 1}},{key:"JSPlayM4_FEC_SetViewParam",value:function(e,t,i){if(this.printfFlag&&console.log(">>>JS JSPlayM4_FEC_SetViewParam this.decodeEngine:"+this.decodeEngine+",fishSubPort:"+e+",upDateType:"+t+",fValue:"+i),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_SetViewParam","color: red"),0;var n=1;return 1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECSetViewParam",fishSubPort:e,upDateType:t,fValue:i}):n=0:n=null!=this.pcVideoManager?this.pcVideoManager.FEC_SetViewParam(e,t,i):0:n=we._JSPlayM4_FEC_SetViewParam(this.port,e,t,i),n}},{key:"JSPlayM4_FEC_GetViewParam",value:function(e,t,i){if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_GetViewParam","color: red"),0;var n=1;this.FECViewParamCB=i;var a={fValue:-1};if(1===this.decodeEngine)this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECGetViewParam",fishSubPort:e,upDateType:t}):n=0:null!=this.pcVideoManager?(n=this.pcVideoManager.FEC_GetViewParam(e,t,a),null!=this.FECViewParamCB&&this.FECViewParamCB(a)):n=0;else{var r=we._JSPlayM4_GetViewParam(this.port,e,t);a.fValue=r,null!=this.FECViewParamCB&&this.FECViewParamCB(a)}return n}},{key:"JSPlayM4_FEC_SetWnd",value:function(e,t){if(this.printfFlag&&console.log(">>>JS JSPlayM4_FEC_SetWnd this.decodeEngine:"+this.decodeEngine+",fishSubPort:"+e+",hWnd:"+t),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_SetWnd","color: red"),0;var i=1;if(0==e)console.log("fishPort is 0 ,main canvas doesn't need call FEC_SetWnd");else if(null!=t)if(1===this.decodeEngine){var n=document.getElementById(t);if(this.hasWebWorker){var a=n.transferControlToOffscreen();null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECSetWnd",fishSubPort:e,offscrrenCnv:a},[a]):i=0}else i=null!=this.pcVideoManager?this.pcVideoManager.FEC_SetWnd(e,n):0}else{var r=null;if(null!=t){var o=this._stringToBytes("#"+t),s=2*(t.length+1);r=we._malloc(s);var l=we.HEAPU8.subarray(r,r+s),c=new Uint8Array(s);l.set(c,0),l.set(new Uint8Array(o)),l=null,c=null}i=we._JSPlayM4_FEC_SetWnd(this.port,e,r),null!=r&&(we._free(r),r=null)}else console.log(">>>JS JSPlayM4_FEC_SetWnd hwnd error this.decodeEngine:"+this.decodeEngine+",fishSubPort:"+e+",hWnd:"+t),i=0;return i}},{key:"JSPlayM4_FEC_Disable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=1;return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_Disable","color: red"),0):(0==e?console.log("fishPort is 0 ,main canvas doesn't need call FEC_Disable"):1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECDisable",fishSubPort:e,clearFECCanvas:t,clearContext:i}):n=0:n=null!=this.pcVideoManager?this.pcVideoManager.FEC_Disable(e,t,i):0:n=we._JSPlayM4_FEC_Disable(this.port,e,t,i),n)}},{key:"JSPlayM4_FEC_DelPort",value:function(e){if(this.printfFlag&&console.log(">>>JS JSPlayM4_FEC_DelPort this.decodeEngine:"+this.decodeEngine+",fishSubPort:"+e),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_DelPort","color: red"),0;var t=1;return 1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECDelPort",fishSubPort:e}):t=0:t=null!=this.pcVideoManager?this.pcVideoManager.FEC_DelPort(e):0:t=we._JSPlayM4_FEC_DelPort(this.port,e),t}},{key:"JSPlayM4_FEC_SetDisplayRegion",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0;if(this.printfFlag&&console.log(">>>JS JSPlayM4_FEC_SetDisplayRegion this.decodeEngine:"+this.decodeEngine+",fishSubPort:"+e+",left:"+n.left+",right:"+n.right+",top:"+n.top+",bottom:"+n.bottom),null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_SetDisplayRegion","color: red"),0;var s=1,l=n.left,c=n.right,d=n.top,u=n.bottom;if("number"!=typeof l||"number"!=typeof c||"number"!=typeof u||"number"!=typeof d)return console.log("param is not number"),0;if(r){if(o){if(l<0||c<0||d<0||u<0)return 0;0!==this.iFECZoomNum&&(l=Math.round(l/this.iFECRatio_x)+this.stFECDisplayRect.left,d=Math.round(d/this.iFECRatio_y)+this.stFECDisplayRect.top,c=Math.round(c/this.iFECRatio_x)+this.stFECDisplayRect.left,u=Math.round(u/this.iFECRatio_y)+this.stFECDisplayRect.top)}}else l=0,c=this.canvasWidth,d=0,u=this.canvasHeight,this.iFECZoomNum=0,this.iFECRatio_x=1,this.iFECRatio_y=1;if(this.stFECDisplayRect={top:d,left:l,right:c,bottom:u},c-l<16||u-d<16||c-l>this.canvasWidth||u-d>this.canvasHeight)return 0;if(1===this.decodeEngine){var h=l/this.canvasWidth*this.width,f=c/this.canvasWidth*this.width,x=d/this.canvasHeight*this.height,p=u/this.canvasHeight*this.height;this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECSetDisplayRegion",fishSubPort:e,type:t,regionNum:i,sx:h,sy:x,sw:f-h,sh:p-x}):s=0:s=null!=this.pcVideoManager?this.pcVideoManager.FEC_SetDisplayRegion(e,t,i,h,x,f-h,p-x):0}else if(null!==we){var m=l/this.canvasWidth*1e3,_=c/this.canvasWidth*1e3,g=d/this.canvasHeight*1e3,v=u/this.canvasHeight*1e3;s=r?we._JSPlayM4_FEC_SetDisplayRegion(this.port,e,t,i,m,_,g,v,a,r):we._JSPlayM4_FEC_SetDisplayRegion(this.port,e,0,0,0,0,0,0,null,r)}else s=0;return o&&(this.iFECRatio_x=this.canvasWidth/(c-l),this.iFECRatio_y=this.canvasHeight/(u-d),this.iFECZoomNum++),s}},{key:"JSPlayM4_FEC_SetBackCilling",value:function(e,t){var i=1;return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_SetBackCilling","color: red"),0):(1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECSetBackCilling",fishSubPort:e,bValue:t}):i=0:i=null!=this.pcVideoManager?this.pcVideoManager.FEC_SetBackCilling(e,t):0:i=we._JSPlayM4_FEC_SetBackCilling(this.port,e,t),i)}},{key:"JSPlayM4_FEC_GetPTZPort",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(null===we)return console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_GetPTZPort","color: red"),0;var a=-1;return this.FECGetPTZPortCB=n,1===this.decodeEngine?this.hasWebWorker?null!=this.decodeWorker?this.decodeWorker.postMessage({command:"FECGetPTZPort",fPositionX:e,fPositionY:t}):a=0:null!=this.pcVideoManager?(((a=this.pcVideoManager.FEC_GetPTZPort(i,e,t))<0||a>31||null==a)&&(a=-1),null!=this.FECGetPTZPortCB&&this.FECGetPTZPortCB(a)):a=-1:console.info("%c softDecoder not support JSPlayM4_FEC_GetPTZPort","color: red"),a}},{key:"JSPlayM4_FEC_SetPTZDisplayMode",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_FEC_SetPTZDisplayMode","color: red"),0):(1===this.decodeEngine&&(this.hasWebWorker?null!=this.decodeWorker&&this.decodeWorker.postMessage({command:"FECSetPTZDisplayMode",ptzMode:e}):null!=this.pcVideoManager&&this.pcVideoManager.FEC_SetPTZDisplayMode(e)),1)}},{key:"JSPlayM4_FEC_PTZ2Window",value:function(e,t,i,n){return 1}},{key:"JSPlayM4_FEC_PTZ2Window2",value:function(e,t,i){return 1}},{key:"JSPlayM4_InputPrivateInfo",value:function(e,t,i){var n={};n.linesNum=we.HEAP32[e>>2],n.absTimeStamp=we.HEAP32[e+4>>2],n.stDrawLinesArray=[];for(var a=0;a<n.linesNum;a++){n.stDrawLinesArray[a]={},n.stDrawLinesArray[a].vertex_num=we.HEAP32[e+8+112*a>>2],n.stDrawLinesArray[a].lineWidth=we.HEAP32[e+12+112*a>>2],n.stDrawLinesArray[a].bFill=we.HEAP32[e+16+112*a>>2],n.stDrawLinesArray[a].bLoop=we.HEAP32[e+20+112*a>>2],n.stDrawLinesArray[a].color={},n.stDrawLinesArray[a].color.R=we.HEAPF32[e+24+112*a>>2],n.stDrawLinesArray[a].color.G=we.HEAPF32[e+28+112*a>>2],n.stDrawLinesArray[a].color.B=we.HEAPF32[e+32+112*a>>2],n.stDrawLinesArray[a].color.A=we.HEAPF32[e+36+112*a>>2],n.stDrawLinesArray[a].stPoint=[];for(var r=0;r<n.stDrawLinesArray[a].vertex_num;r++)n.stDrawLinesArray[a].stPoint[r]={},n.stDrawLinesArray[a].stPoint[r].x=we.HEAPF32[e+40+112*a+8*r>>2],n.stDrawLinesArray[a].stPoint[r].y=we.HEAPF32[e+44+112*a+8*r>>2]}var o={};o.nFontsNum=we.HEAP32[t>>2],o.absTimeStamp=we.HEAP32[t+4>>2],o.stDrawFontsArray=[];for(var s=0;s<o.nFontsNum;s++){o.stDrawFontsArray[s]={},o.stDrawFontsArray[s].nFontSizeW=we.HEAP32[t+8+40*s>>2],o.stDrawFontsArray[s].nFontSizeH=we.HEAP32[t+12+40*s>>2],o.stDrawFontsArray[s].color={},o.stDrawFontsArray[s].color.R=we.HEAPF32[t+16+40*s>>2],o.stDrawFontsArray[s].color.G=we.HEAPF32[t+20+40*s>>2],o.stDrawFontsArray[s].color.B=we.HEAPF32[t+24+40*s>>2],o.stDrawFontsArray[s].color.A=we.HEAPF32[t+28+40*s>>2],o.stDrawFontsArray[s].stPoint={},o.stDrawFontsArray[s].stPoint.x=we.HEAPF32[t+32+40*s>>2],o.stDrawFontsArray[s].stPoint.y=we.HEAPF32[t+36+40*s>>2];var l=we.HEAP32[t+40+40*s>>2],c=we.HEAP32[t+44+40*s>>2],d=new Uint8Array(c);d.set(we.HEAP8.subarray(l,l+c));for(var u="",h=0;h<d.length;h++)0!==d[h]&&(u+=String.fromCharCode(d[h]));o.stDrawFontsArray[s].fontString=u}var f={};f.absTimeStamp=we.HEAP32[i>>2],f.nWidth=we.HEAP32[i+4>>2],f.nHeight=we.HEAP32[i+8>>2],f.pstRect={},f.pstRect.fTop=we.HEAPF32[i+12>>2],f.pstRect.fBottom=we.HEAPF32[i+16>>2],f.pstRect.fLeft=we.HEAPF32[i+20>>2],f.pstRect.fRight=we.HEAPF32[i+24>>2],f.nPixelFormat=we.HEAP32[i+28>>2],f.fAlpha=we.HEAPF32[i+32>>2],f.nPixelFormat;var x=we.HEAP32[i+36>>2],p=we.HEAP32[i+40>>2],m=new Uint8Array(p);return m.set(we.HEAPU8.subarray(x,x+p)),f.picImageData=m,1===this.decodeEngine&&(this.hasWebWorker?this.decodeWorker.postMessage({command:"InputPrivateInfo",linesInfo:n,fontInfo:o,ImageInfo:f}):null!=this.pcVideoManager&&this.pcVideoManager.InputPrivateInfo(n,o,f)),1}},{key:"JSPlayM4_SetWaterMarkFont",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetWaterMarkFont","color: red"),0):(1===this.decodeEngine?this.hasWebWorker?this.decodeWorker.postMessage({command:"SetWaterMarkFont",fontParam:e}):null!=this.pcVideoManager&&this.pcVideoManager.SetWaterMarkFont(e):console.log("%c1>soft decode not support SetWaterMarkFont,","color: red"),1)}},{key:"JSPlayM4_SetWaterMarkImage",value:function(e){return null===we?(console.info("%coJSPlayerWasm is null,can't JSPlayM4_SetWaterMarkImage","color: red"),0):(1===this.decodeEngine?this.hasWebWorker?this.decodeWorker.postMessage({command:"SetWaterMarkImage",imageParam:e}):null!=this.pcVideoManager&&this.pcVideoManager.SetWaterMarkImage(e):console.log("%c1>soft decode not support SetWaterMarkImage,","color: red"),1)}},{key:"_stringToBytes",value:function(e){for(var t,i,n=[],a=0;a<e.length;a++){t=e.charCodeAt(a),i=[];do{i.push(255&t),t>>=8}while(t);n=n.concat(i.reverse())}return n}},{key:"_downloadFile",value:function(e,t){var i=e;r(e,Blob)||r(e,File)||(i=new Blob([e]));var n=window.URL.createObjectURL(i),a=window.document.createElement("a");a.href=n,a.download=t;var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!0),a.dispatchEvent(o)}},{key:"downloadRTPData",value:function(e){if(this.bWriteData){var t=e,i=this.aTotalBuffer.length;console.log("totalLength:"+i);for(var n=0,a=t.length;n<a;n++)this.aTotalBuffer[i+n]=t[n];this.iFrameNum++,t=null,console.log("downloadRTPdata iFrameNum:"+this.iFrameNum)}if(this.bWriteData&&this.iFrameNum>=600){console.log("download600RawData");var r=new Uint8Array(this.aTotalBuffer);this._downloadFile(r,"Raw600.data"),this.aTotalBuffer.splice(0,this.aTotalBuffer.length),this.bWriteData=!1,this.iFrameNum=0,r=null}}},{key:"downloadAudioPCMData",value:function(e){if(this.bWriteAudioPCMData){for(var t=e,i=this.audioPCMBuffer.length,n=0,a=t.length;n<a;n++)this.audioPCMBuffer[i+n]=t[n];this.iAudioPCMFrameNum++,t=null,console.log("download ANR Decode AudioData FrameNum:"+this.iAudioPCMFrameNum)}if(this.bWriteAudioPCMData&&this.iAudioPCMFrameNum>=WRITE_PCM_NUM){console.log("download"+WRITE_PCM_NUM+"this.audioPCMBuffer");var r=new Uint8Array(this.audioPCMBuffer);this._downloadFile(r,"AudioANR.data"),this.audioPCMBuffer.splice(0,this.audioPCMBuffer.length),this.bWriteAudioPCMData=!1,this.iAudioPCMFrameNum=0,r=null}}}]),t}();window._getFExplore=function(){var e,t={},i=navigator.userAgent.toLowerCase();if((e=i.match(/rv:([\d.]+)\) like gecko/))||(e=i.match(/msie ([\d\.]+)/))?t.ie=e[1]:(e=i.match(/edge\/([\d\.]+)/))?t.edge=e[1]:(e=i.match(/firefox\/([\d\.]+)/))?t.firefox=e[1]:(e=i.match(/(?:opera|opr).([\d\.]+)/))?t.opera=e[1]:(e=i.match(/chrome\/([\d\.]+)/))?t.chrome=e[1]:(e=i.match(/version\/([\d\.]+).*safari/))&&(t.safari=e[1]),t.chrome){var n=t.chrome,a=n.indexOf(".");return Number(n.substring(0,a))}return t.ie?console.info("%c1>your browser is IE ,it does not support play without plugin","color: red"):t.safari?console.info("%c1>your browser is safari ,it does not support softV2.0 or hard decode","color: red"):t.firefox?console.info("%c1>your browser is Firefox ,it only support soft decode","color: red"):console.info("%c1>your browser does not support play without plugin","color: red"),-1},window.JSPlayM4_AdditionDataCBFun=function(e,t,i){if(null!=Re[i][e]){var n={};n.dataType=we.HEAP32[t>>2],n.dataStrVersion=we.HEAP32[t+4>>2],n.dataTimeStamp=we.HEAP32[t+8>>2],n.dataLength=we.HEAP32[t+12>>2],n.pData=we.HEAP32[t+16>>2],n.additionDataBuffer=new Uint8Array(n.dataLength),n.additionDataBuffer.set(we.HEAPU8.subarray(n.pData,n.pData+n.dataLength)),Re[i][e].hasOwnProperty("addtionCallBackFun")&&null!=Re[i][e].addtionCallBackFun&&null!=Re[i][e].addtionCallBackFun&&Re[i][e].addtionCallBackFun(n)}},window.JSPlayM4_DisplayCallBack=function(e,t,i,n,a){if(null!=Re[a][e]){var r={};r.yuvData=t,r.isize=i,r.timeStamp=n,Re[a][e].hasOwnProperty("displayCallBackFun")&&null!=Re[a][e].displayCallBackFun&&Re[a][e].displayCallBackFun(r)}},window.JSPlayM4_DecCallBack=function(e,t,i,n,a,r){if(null!=Re[r][e]){var o={};o.port=e,o.Data=t,o.isize=i,o.iDataType=n,o.SampleRate=a,Re[r][e].hasOwnProperty("decCallBackFun")&&null!=Re[r][e].decCallBackFun&&Re[r][e].decCallBackFun(o)}},window.JSPlayM4_RunTimeInfoCallBack=function(e,t,i,n){if(null!=Re[n][e]){var a=we.HEAP32[t>>2],r=we.HEAP32[t+4>>2],o=we.HEAP32[t+8>>2],s=we.HEAP32[t+12>>2],l=i;Re[n][e].hasOwnProperty("runtimeCBFun")&&null!=Re[n][e].runtimeCBFun&&Re[n][e].runtimeCBFun(a,r,o,s,l)}},window.JSPlayM4_FirstFrameCallBack=function(e,t){null!=Re[t][e]&&Re[t][e].hasOwnProperty("FFCallBackFun")&&null!=Re[t][e].FFCallBackFun&&null!=Re[t][e].FFCallBackFun&&Re[t][e].FFCallBackFun()},window.JSPlayM4_AudioPCMCallBack=function(e,t,i,n){null!=Re[n][e]&&Re[n][e].__proto__.hasOwnProperty("downloadAudioPCMData")&&Re[n][e].downloadAudioPCMData(t)},window.JSPlayM4_RTPRawDataCallBack=function(e,t,i){null!=Re[i][port]&&Re[i][port].__proto__.hasOwnProperty("downloadRTPData")&&Re[i][port].downloadRTPData(e)};var Le,Be=function(e){return"\n(function (event) {\n    const AUDIO_TYPE = 0;\t// 音频\n    const VIDEO_TYPE = 1;   // 视频\n    const PRIVT_TYPE = 2;  // 私有帧\n\n    const PLAYM4_AUDIO_FRAME = 100; // 音频帧\n    const PLAYM4_VIDEO_FRAME = 101; // 视频帧\n\n    const PLAYM4_OK = 1;\n    const PLAYM4_ORDER_ERROR = 2;\n    const PLAYM4_DECODE_ERROR = 44 \t// 解码失败\n    const PLAYM4_NOT_KEYFRAME = 48; \t// 非关键帧\n    const PLAYM4_NEED_MORE_DATA = 31;   // 需要更多数据才能解析\n    const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环\n    const PLAYM4_SYS_NOT_SUPPORT = 16; \t// 不支持\n\n    importScripts('".concat(e,'\');\n    Module.addOnPostRun(function () {\n        postMessage({ \'function\': "loaded" });\n    });\n\n    var iStreamMode = 0;  // 流模式\n\n    var bOpenMode = false;\n    var bOpenStream = false;\n\n    var funGetFrameData = null;\n    var funGetAudFrameData = null;\n\n    var bWorkerPrintLog = false;//worker层log开关\n\n    var g_nPort = -1;\n    var pInputData = null;\n    var inputBufferSize = 40960;\n\n    self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {\n        let port = nPort;\n        let user = pUser;\n        let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];\n        let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];\n        let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];\n        let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];\n        let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];\n        // console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);\n        postMessage({ \'function\': "RunTimeInfoCallBack", \'nRunTimeModule\': nRunTimeModule, \'nStrVersion\': nStrVersion, \'nFrameTimeStamp\': nFrameTimeStamp, \'nFrameNum\': nFrameNum, \'nErrorCode\': nErrorCode });\n    }\n\n    onmessage = function (event) {\n        var eventData = event.data;\n        var res = 0;\n        switch (eventData.command) {\n            case "printLog":\n                let downloadFlag = eventData.data;\n                if (downloadFlag === true) {\n                    bWorkerPrintLog = true;\n                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);\n                }\n                else {\n                    bWorkerPrintLog = false;\n                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);\n                }\n\n                if (res !== PLAYM4_OK) {\n                    console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);\n                    postMessage({ \'function\': "printLog", \'errorCode\': res });\n                }\n                break;\n            case "SetPlayPosition":\n                let nFrameNumOrTime = eventData.data;\n                let enPosType = eventData.type;\n                // res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);\n                // if (res !== PLAYM4_OK)\n                // {\n                //     postMessage({\'function\': "SetPlayPosition", \'errorCode\': res});\n                //     return;\n                // }\n                // //有没有buffer需要清除\n\n                break;\n            case "SetStreamOpenMode":\n                //获取端口号\n                g_nPort = Module._GetPort();\n                //设置流打开模式\n                iStreamMode = eventData.data;\n                res = Module._SetStreamOpenMode(g_nPort, iStreamMode);\n                if (res !== PLAYM4_OK) {\n                    postMessage({ \'function\': "SetStreamOpenMode", \'errorCode\': res });\n                    return;\n                }\n                bOpenMode = true;\n                break;\n\n            case "OpenStream":\n                // 接收到的数据\n                var iHeadLen = eventData.dataSize;\n                var pHead = Module._malloc(iHeadLen + 4);\n                if (pHead === null) {\n                    return;\n                }\n                var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);\n                aHead.set(new Uint8Array(eventData.data));\n                res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);\n                postMessage({ \'function\': "OpenStream", \'errorCode\': res });\n                if (res !== PLAYM4_OK) {\n                    //释放内存\n                    Module._free(pHead);\n                    pHead = null;\n                    return;\n                }\n                bOpenStream = true;\n                break;\n            case "Play":\n                let resP = Module._Play(g_nPort);\n                if (resP !== PLAYM4_OK) {\n                    return;\n                }\n                break;\n            case "InputData":\n                // 接收到的数据\n                var iLen = eventData.dataSize;\n                if (iLen > 0) {\n                    if (pInputData == null || iLen > inputBufferSize) {\n                        if (pInputData != null) {\n                            Module._free(pInputData);\n                            pInputData = null;\n                        }\n                        if (iLen > inputBufferSize) {\n                            inputBufferSize = iLen;\n                        }\n\n                        pInputData = Module._malloc(inputBufferSize);\n                        if (pInputData === null) {\n                            return;\n                        }\n                    }\n\n                    var inputData = new Uint8Array(eventData.data);\n                    // var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);\n                    // aInputData.set(inputData);\n                    Module.writeArrayToMemory(inputData, pInputData);\n                    inputData = null;\n                    res = Module._InputData(g_nPort, pInputData, iLen);\n                    if (res !== PLAYM4_OK) {\n                        let errorCode = Module._GetLastError(g_nPort);\n                        let sourceRemain = Module._GetSourceBufferRemain(g_nPort);\n                        postMessage({ \'function\': "InputData", \'errorCode\': errorCode, "sourceRemain": sourceRemain });\n                    }\n                    //Module._free(pInputData);\n                    //pInputData = null;\n                } else {\n                    let sourceRemain = Module._GetSourceBufferRemain(g_nPort);\n                    if (sourceRemain == 0) {\n                        postMessage({ \'function\': "InputData", \'errorCode\': PLAYM4_NEED_MORE_DATA });\n                        return;\n                    }\n                }\n\n                /////////////////////\n                // if (funGetFrameData === null) {\n                //     funGetFrameData = Module.cwrap(\'GetFrameData\', \'number\');\n                // }\n\n                while (bOpenMode && bOpenStream) {\n\n                    var ret = getFrameData();\n                    // 直到获取视频帧或数据不足为止\n                    if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret ||  || PLAYM4_NEED_NEET_LOOP === ret\n                    {\n                        break;\n                    }\n                }\n                break;\n\n            case "SetSecretKey":\n                var keyLen = eventData.nKeyLen;\n                var pKeyData = Module._malloc(keyLen);\n                if (pKeyData === null) {\n                    return;\n                }\n                var nKeySize = eventData.data.length\n                var bufData = stringToBytes(eventData.data);\n                var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);\n                let u8array = new Uint8Array(keyLen);\n                aKeyData.set(u8array, 0);\n                aKeyData.set(new Uint8Array(bufData));\n                aKeyData = null;\n                u8array = null;\n\n                res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize\n                if (res !== PLAYM4_OK) {\n                    postMessage({ \'function\': "SetSecretKey", \'errorCode\': res });\n                    Module._free(pKeyData);\n                    pKeyData = null;\n                    return;\n                }\n\n                Module._free(pKeyData);\n                pKeyData = null;\n                break;\n\n            case "GetBMP":\n                var nBMPWidth = eventData.width;\n                var nBMPHeight = eventData.height;\n                var pYUVData = eventData.data;\n                var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;\n                var oBMPCropRect = eventData.rect;\n\n                var pDataYUV = Module._malloc(nYUVSize);\n                if (pDataYUV === null) {\n                    return;\n                }\n\n                Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);\n\n                // 分配BMP空间\n                var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;\n                var pBmpData = Module._malloc(nBmpSize);\n                var pBmpSize = Module._malloc(4);\n                if (pBmpData === null || pBmpSize === null) {\n                    Module._free(pDataYUV);\n                    pDataYUV = null;\n\n                    if (pBmpData != null) {\n                        Module._free(pBmpData);\n                        pBmpData = null;\n                    }\n\n                    if (pBmpSize != null) {\n                        Module._free(pBmpSize);\n                        pBmpSize = null;\n                    }\n                    return;\n                }\n\n                //Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码\n                Module.setValue(pBmpSize, nBmpSize, "i32");\n                res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,\n                    oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);\n                if (res !== PLAYM4_OK) {\n                    postMessage({ \'function\': "GetBMP", \'errorCode\': res });\n                    Module._free(pDataYUV);\n                    pDataYUV = null;\n                    Module._free(pBmpData);\n                    pBmpData = null;\n                    Module._free(pBmpSize);\n                    pBmpSize = null;\n                    return;\n                }\n\n                // 获取BMP图片大小\n                var nBmpDataSize = Module.getValue(pBmpSize, "i32");\n\n                // 获取BMP图片数据\n                var aBmpData = new Uint8Array(nBmpDataSize);\n                aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));\n\n                postMessage({ \'function\': "GetBMP", \'data\': aBmpData, \'errorCode\': res }, [aBmpData.buffer]);\n                aBmpData = null;\n                if (pDataYUV != null) {\n                    Module._free(pDataYUV);\n                    pDataYUV = null;\n                }\n                if (pBmpData != null) {\n                    Module._free(pBmpData);\n                    pBmpData = null;\n                }\n                if (pBmpSize != null) {\n                    Module._free(pBmpSize);\n                    pBmpSize = null;\n                }\n                break;\n\n            case "GetJPEG":\n                var nJpegWidth = eventData.width;\n                var nJpegHeight = eventData.height;\n                var pYUVData1 = eventData.data;\n                var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;\n                var oJpegCropRect = eventData.rect;\n\n                var pDataYUV1 = Module._malloc(nYUVSize1);\n                if (pDataYUV1 === null) {\n                    return;\n                }\n\n                Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);\n\n                // 分配JPEG空间\n                var pJpegData = Module._malloc(nYUVSize1);\n                var pJpegSize = Module._malloc(4);\n                if (pJpegData === null || pJpegSize === null) {\n                    if (pJpegData != null) {\n                        Module._free(pJpegData);\n                        pJpegData = null;\n                    }\n\n                    if (pJpegSize != null) {\n                        Module._free(pJpegSize);\n                        pJpegSize = null;\n                    }\n\n                    if (pDataYUV1 != null) {\n                        Module._free(pDataYUV1);\n                        pDataYUV1 = null;\n                    }\n                    return;\n                }\n\n                Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32");    // JPEG抓图,输入缓冲长度不小于当前帧YUV大小\n\n                res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,\n                    oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);\n                if (res !== PLAYM4_OK) {\n                    postMessage({ \'function\': "GetJPEG", \'errorCode\': res });\n                    if (pJpegData != null) {\n                        Module._free(pJpegData);\n                        pJpegData = null;\n                    }\n\n                    if (pJpegSize != null) {\n                        Module._free(pJpegSize);\n                        pJpegSize = null;\n                    }\n\n                    if (pDataYUV1 != null) {\n                        Module._free(pDataYUV1);\n                        pDataYUV1 = null;\n                    }\n                    return;\n                }\n\n                // 获取JPEG图片大小\n                var nJpegSize = Module.getValue(pJpegSize, "i32");\n\n                // 获取JPEG图片数据\n                var aJpegData = new Uint8Array(nJpegSize);\n                aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));\n\n                postMessage({ \'function\': "GetJPEG", \'data\': aJpegData, \'errorCode\': res }, [aJpegData.buffer]);\n\n                nJpegSize = null;\n                aJpegData = null;\n\n                if (pDataYUV1 != null) {\n                    Module._free(pDataYUV1);\n                    pDataYUV1 = null;\n                }\n                if (pJpegData != null) {\n                    Module._free(pJpegData);\n                    pJpegData = null;\n                }\n                if (pJpegSize != null) {\n                    Module._free(pJpegSize);\n                    pJpegSize = null;\n                }\n                break;\n\n            case "SetDecodeFrameType":\n                var nFrameType = eventData.data;\n                res = Module._SetDecodeFrameType(g_nPort, nFrameType);\n                if (res !== PLAYM4_OK) {\n                    postMessage({ \'function\': "SetDecodeFrameType", \'errorCode\': res });\n                    return;\n                }\n                break;\n            case "CloseStream":\n                //stop\n                let resS = Module._Stop(g_nPort);\n                if (resS !== PLAYM4_OK) {\n                    postMessage({ \'function\': "Stop", \'errorCode\': res });\n                    return;\n                }\n                //closeStream\n                res = Module._CloseStream(g_nPort);\n                if (res !== PLAYM4_OK) {\n                    postMessage({ \'function\': "CloseStream", \'errorCode\': res });\n                    return;\n                }\n                //freePort\n                let resF = Module._FreePort(g_nPort);\n                if (resF !== PLAYM4_OK) {\n                    postMessage({ \'function\': "FreePort", \'errorCode\': res });\n                    return;\n                }\n                if (pInputData != null) {\n                    Module._free(pInputData);\n                    pInputData = null;\n                }\n                break;\n            case "PlaySound":\n                let resPS = Module._PlaySound(g_nPort);\n                if (resPS !== PLAYM4_OK) {\n                    console.log("PlaySound failed");\n                    return;\n                }\n                break;\n            case "StopSound":\n                let resSS = Module._StopSound();\n                if (resSS !== PLAYM4_OK) {\n                    console.log("StopSound failed");\n                    return;\n                }\n                break;\n            case "SetVolume":\n                let resSV = Module._SetVolume(g_nPort, eventData.volume);\n                if (resSV !== PLAYM4_OK) {\n                    console.log("Audio SetVolume failed");\n                    return;\n                }\n                break;\n            case "GetVolume":\n                let volume = Module._GetVolume();\n                if (volume > 0) {\n                    postMessage({ \'function\': "GetVolume", \'volume\': volume });\n                }\n                else {\n                    console.log("Audio GetVolume failed");\n                    return;\n                }\n                break;\n            case "OnlyPlaySound":\n                let resOPS = Module._OnlyPlaySound(g_nPort);\n                if (resOPS !== PLAYM4_OK) {\n                    console.log("OnlyPlaySound failed");\n                    return;\n                }\n                break;\n            case "Pause":\n                let resPa = Module._Pause(g_nPort, eventData.bPlay);\n                if (resPa !== PLAYM4_OK) {\n                    console.log("Pause failed");\n                    return;\n                }\n            case "PlayRate":\n                Module._SetPlayRate(g_nPort, eventData.playRate);\n                break;\n            case "SetIFrameDecInterval":\n                Module._SetIFrameDecInterval(g_nPort, eventData.data);\n                break;\n            case "SetLostFrameMode":\n                Module._SetLostFrameMode(g_nPort, eventData.data, 0);\n                break;\n            case "SetDemuxModel":\n                let resSDM = Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);\n                break;\n            case "SkipErrorData":\n                Module._SkipErrorData(g_nPort, eventData.bSkip);\n                break;\n            case "SetDecodeERC":\n                Module._SetDecodeERC(g_nPort, eventData.nLevel);\n                break;\n            case "SetANRParam":\n                Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);\n                break;\n            case "SetResampleValue":\n                Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);\n                break;\n            case "GetLastError":\n                let errorCode = Module._GetLastError(g_nPort);\n                postMessage({ \'function\': "GetLastError", \'errorCode\': errorCode });\n                break;\n            case "SetGlobalBaseTime":\n                Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);\n                break;\n            case "SetRunTimeInfoCB":\n                Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);\n                break;\n            default:\n                break;\n        }\n    };\n\n    function getOSDTime(oFrameInfo) {\n        var iYear = oFrameInfo.year;\n        var iMonth = oFrameInfo.month;\n        var iDay = oFrameInfo.day;\n        var iHour = oFrameInfo.hour;\n        var iMinute = oFrameInfo.minute;\n        var iSecond = oFrameInfo.second;\n        var iMiSecond = oFrameInfo.misecond\n\n        if (iMonth < 10) {\n            iMonth = "0" + iMonth;\n        }\n        if (iDay < 10) {\n            iDay = "0" + iDay;\n        }\n        if (iHour < 10) {\n            iHour = "0" + iHour;\n        }\n        if (iMinute < 10) {\n            iMinute = "0" + iMinute;\n        }\n        if (iSecond < 10) {\n            iSecond = "0" + iSecond;\n        }\n        let osdTime = {};\n\n        osdTime.year = iYear;\n        osdTime.month = iMonth;\n        osdTime.week = 0;\n        osdTime.day = iDay;\n        osdTime.hour = iHour;\n        osdTime.minute = iMinute;\n        osdTime.second = iSecond;\n        osdTime.milliseconds = iMiSecond;\n        return osdTime;\n        //return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;\n    }\n    // 获取帧数据\n    function getFrameData() {\n        // function getFrameData() {\n        // 获取帧数据\n        var res = Module._GetFrameData();\n        //var res = fun();\n        if (res === PLAYM4_OK) {\n            var iFrameInfo = Module._GetFrameInfo();\n            let oFrameInfo = {};\n            oFrameInfo.frameType = Module.HEAP32[iFrameInfo >> 2];\n            oFrameInfo.frameSize = Module.HEAP32[iFrameInfo + 4 >> 2];\n            oFrameInfo.width = Module.HEAP32[iFrameInfo + 8 >> 2];\n            oFrameInfo.height = Module.HEAP32[iFrameInfo + 12 >> 2];\n            oFrameInfo.timeStamp = Module.HEAP32[iFrameInfo + 16 >> 2];\n            oFrameInfo.frameRate = Module.HEAP32[iFrameInfo + 20 >> 2];\n            oFrameInfo.bitsPerSample = Module.HEAP32[iFrameInfo + 24 >> 2];\n            oFrameInfo.samplesPerSec = Module.HEAP32[iFrameInfo + 28 >> 2];\n            oFrameInfo.channels = Module.HEAP32[iFrameInfo + 32 >> 2];\n            oFrameInfo.frameNum = Module.HEAP32[iFrameInfo + 36 >> 2];\n\n            oFrameInfo.cropLeft = Module.HEAP32[iFrameInfo + 40 >> 2];\n            oFrameInfo.cropRight = Module.HEAP32[iFrameInfo + 44 >> 2];\n            oFrameInfo.cropTop = Module.HEAP32[iFrameInfo + 48 >> 2];\n            oFrameInfo.cropBottom = Module.HEAP32[iFrameInfo + 52 >> 2];\n\n            oFrameInfo.year = Module.HEAP16[iFrameInfo + 56 >> 1];\n            oFrameInfo.month = Module.HEAP16[iFrameInfo + 58 >> 1];\n            oFrameInfo.day = Module.HEAP16[iFrameInfo + 60 >> 1];\n            oFrameInfo.hour = Module.HEAP16[iFrameInfo + 62 >> 1];\n            oFrameInfo.minute = Module.HEAP16[iFrameInfo + 64 >> 1];\n            oFrameInfo.second = Module.HEAP16[iFrameInfo + 66 >> 1];\n            oFrameInfo.misecond = Module.HEAP16[iFrameInfo + 68 >> 1];\n            switch (oFrameInfo.frameType) {\n                case AUDIO_TYPE:\n                    var iSize = oFrameInfo.frameSize;\n                    if (0 === iSize) {\n                        return -1;\n                    }\n                    var pPCM = Module._GetFrameBuffer();\n                    // var audioBuf = new ArrayBuffer(iSize);\n                    var aPCMData = new Uint8Array(iSize);\n                    aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));\n                    if (bWorkerPrintLog) {\n                        console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + \',channel:\' + oFrameInfo.channels + \',bitsPerSample:\' + oFrameInfo.bitsPerSample);\n                    }\n                    postMessage({\n                        \'function\': "GetFrameData", \'type\': "audioType", \'data\': aPCMData.buffer,\n                        \'frameInfo\': oFrameInfo, \'errorCode\': res\n                    }, [aPCMData.buffer]);\n\n                    oFrameInfo = null;\n                    pPCM = null;\n                    aPCMData = null;\n                    return PLAYM4_AUDIO_FRAME;\n\n                case VIDEO_TYPE:\n                    var szOSDTime = getOSDTime(oFrameInfo);\n\n                    var iWidth = oFrameInfo.width;\n                    var iHeight = oFrameInfo.height;\n\n                    var iYUVSize = iWidth * iHeight * 3 / 2;\n                    if (0 === iYUVSize) {\n                        return -1;\n                    }\n\n                    var pYUV = Module._GetFrameBuffer();\n\n                    // 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象\n                    var aYUVData = new Uint8Array(iYUVSize);\n                    aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));\n                    if (bWorkerPrintLog) {\n                        console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);\n                    }\n\n                    postMessage({\n                        \'function\': "GetFrameData", \'type\': "videoType", \'data\': aYUVData.buffer,\n                        \'dataLen\': aYUVData.length, \'osd\': szOSDTime, \'frameInfo\': oFrameInfo, \'errorCode\': res\n                    }, [aYUVData.buffer]);\n\n                    oFrameInfo = null;\n                    pYUV = null;\n                    aYUVData = null;\n                    return PLAYM4_VIDEO_FRAME;\n\n                case PRIVT_TYPE:\n                    postMessage({\n                        \'function\': "GetFrameData", \'type\': "", \'data\': null,\n                        \'dataLen\': -1, \'osd\': 0, \'frameInfo\': null, \'errorCode\': PLAYM4_SYS_NOT_SUPPORT\n                    });\n                    return PLAYM4_SYS_NOT_SUPPORT;\n\n                default:\n                    postMessage({\n                        \'function\': "GetFrameData", \'type\': "", \'data\': null,\n                        \'dataLen\': -1, \'osd\': 0, \'frameInfo\': null, \'errorCode\': PLAYM4_SYS_NOT_SUPPORT\n                    });\n                    return PLAYM4_SYS_NOT_SUPPORT;\n            }\n        }\n        else {\n            let errorCode = Module._GetLastError(g_nPort);\n            //解码失败返回裸数据\n            if (PLAYM4_DECODE_ERROR === errorCode) {\n                var rawInfo = Module._GetRawDataInfo();\n                var pRawData = Module._GetRawDataBuffer();\n                var aRawData = new Uint8Array(rawInfo.isize);\n                aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));\n                postMessage({\n                    \'function\': "GetRawData", \'type\': "", \'data\': aRawData.buffer,\n                    \'rawDataLen\': rawInfo.isize, \'osd\': 0, \'frameInfo\': null, \'errorCode\': errorCode\n                });\n                rawInfo = null;\n                pRawData = null;\n                aRawData = null;\n            }\n            //需要更多数据\n            if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {\n                postMessage({\n                    \'function\': "GetFrameData", \'type\': "", \'data\': null,\n                    \'dataLen\': -1, \'osd\': 0, \'frameInfo\': null, \'errorCode\': errorCode\n                });\n            }\n            return errorCode;\n        }\n    }\n\n    // 开始计算时间\n    function startTime() {\n        return new Date().getTime();\n    }\n\n    // 结束计算时间\n    function endTime() {\n        return new Date().getTime();\n    }\n\n    // 字母字符串转byte数组\n    function stringToBytes(str) {\n        var ch, st, re = [];\n        for (var i = 0; i < str.length; i++) {\n            ch = str.charCodeAt(i);  // get char\n            st = [];                 // set up "stack"\n            do {\n                st.push(ch & 0xFF);  // push byte to stack\n                ch = ch >> 8;          // shift value down by 1 byte\n            }\n            while (ch);\n            // add stack contents to result\n            // done because chars have "wrong" endianness\n            re = re.concat(st.reverse());\n        }\n        // return an array of bytes\n        return re;\n    }\n})();\n')},Oe=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),je=(Le=void 0,function(e){return e&&(Le=e),Le}),Ne=function(){function e(){if(function(e,t){if(!r(e,t))throw new TypeError("Cannot call a class as a function")}(this,e),je())return je();if(void 0!==e.unique)return e.unique;e.unique=this,this.oAudioContext=null,this.currentVolume=80,this.bSetVolume=!1,this.gainNode=null,this.iWndNum=-1,this.mVolumes=new Map;var t=window.AudioContext||window.webkitAudioContext;this.oAudioContext=new t,this.writeString=function(e,t,i){for(var n=0;n<i.length;n++)e.setUint8(t+n,i.charCodeAt(n))},this.setBufferToDataview=function(e,t,i){for(var n=0;n<i.length;n++,t++)e.setUint8(t,i[n])},je(this)}return Oe(e,[{key:"Play",value:function(e,t,i){var n=new ArrayBuffer(44+t),a=new DataView(n),r=i.samplesPerSec,o=i.channels,s=i.bitsPerSample;this.writeString(a,0,"RIFF"),a.setUint32(4,32+2*t,!0),this.writeString(a,8,"WAVE"),this.writeString(a,12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,o,!0),a.setUint32(24,r,!0),a.setUint32(28,2*r,!0),a.setUint16(32,o*s/8,!0),a.setUint16(34,s,!0),this.writeString(a,36,"data"),a.setUint32(40,t,!0),this.setBufferToDataview(a,44,e);var l=this;return this.oAudioContext.decodeAudioData(a.buffer,(function(e){var t=l.oAudioContext.createBufferSource();if(null==t)return-1;t.buffer=e,t.start(0),(null==l.gainNode||l.bSetVolume)&&(l.gainNode=l.oAudioContext.createGain(),l.bSetVolume=!1),l.gainNode.gain.value=l.currentVolume/100,l.gainNode.connect(l.oAudioContext.destination),t.connect(l.gainNode)}),(function(e){return console.log("decode error"),-1})),0}},{key:"Stop",value:function(){return null!=this.gainNode&&(this.gainNode.disconnect(),this.gainNode=null),!0}},{key:"SetVolume",value:function(e){return this.bSetVolume=!0,this.currentVolume=e,this.mVolumes.set(this.iWndNum,this.currentVolume),!0}},{key:"SetWndNum",value:function(e){this.iWndNum=e;var t=this.mVolumes.get(e);return null==t&&(t=80),this.currentVolume=t,!0}},{key:"GetVolume",value:function(){var e=this.mVolumes.get(this.iWndNum);return null==e&&(e=80),e}}]),e}(),Ue=31,ze=25,He=20480,Ve={width:0,height:0,frameNum:0,yuvData:null},Ze={width:0,height:0,frameNum:0,yuvData:null},We={sampleRate:0,channel:0,bitsPerSample:0,length:0,pcmData:null},Ge={id:null,cmd:null,data:null,errorCode:0,status:null},Ye=function(){function t(i,n,a,r){if(e(this,t),this.jsplayer=i,null==n||void 0===n||"string"!=typeof n)return 0;if(this.szBasePath=n,!a||"function"!=typeof a)return 0;this.fnCallBack=a,this.decodeWorker=null,this.streamOpenMode=null,this.bOpenStream=!1,this.audioRenderer=null,this.aAudioBuffer=[],this.iAudioBufferSize=0,this.Volume=0,this.oSuperRender=null,this.aVideoFrameBuffer=[],this.YUVBufferSize=1,this.szOSDTime=null,this.bJSPrintLog=!1,this.bWriteYUVData=!1,this.iYUV10size=0,this.aVideoYUVBuffer=[],this.bWritePCMData=!1,this.iAudioBuffer500Size=0,this.aAudioPCMBuffer=[],this.bWriteRawData=!1,this.iRawDataSize=0,this.aRawDataBuffer=[],this.bWriteRTPData=!0,this.iRTPDataSize=0,this.aRTPDataBuffer=[],this.downloadRTP=!1,this.rtpNum=0,this.bPlaySound=!1,this.bPlay=!1,this.bPause=!1,this.bOnebyOne=!1,this.bPlayRateChange=!1,this.audioNum=0,this.videoNum=0,this.FrameForwardLen=1,this.bOnlyPlaySound=!1,this.bVideoCropInfo=!1,this.dataCallBackFun=null,this.YUVBufSizeCBFun=null,this.DecCallBackFun=null,this.DisplayCallBackFun=null,this.PCMCallBackFun=null,this.DecInfoYUV=Ve,this.DisplayInfoYUV=Ze,this.DecInfoPCM=We,this.displayFrameInfo={},this.frameInfoFlag=!0,this.startTimeStamp=0,this.nWidth=0,this.nHeight=0,this.nSPSCropLeft=0,this.nSPSCropRight=0,this.nSPSCropTop=0,this.nSPSCropBottom=0,this.decCBStream=0,this.sCanvasId=null,this.aDisplayBuf=null,this.bVisibility=!0,this.nDecFrameType=0,this.runtimeInfoCBFun=null,this.firstFrameCB=null,this.needFirstFrameCB=!1,this.iCanvasWidth=0,this.iCanvasHeight=0,this.iZoomNum=0,this.iRatio_x=1,this.iRatio_y=1,this.stDisplayRect={top:0,left:0,right:0,bottom:0},this.bDisRect=!1,this.stYUVRect={top:0,left:0,right:0,bottom:0},this.aInputDataLens=[],this.aInputDataBuffer=[],this.bIsGetYUV=!1,this.bIsFirstFrame=!0,this.iInputMaxBufSize=5242880,this.bIsInput=!1,this.bIsInputBufOver=!1,this.bIsInputBufWillOver=!1,this.iInputDataLen=He;var o=this;this.errorCode=1,this.loopNum=0,console.info("%c1>there will play by V1","color: green"),this.setCallBack=function(e,t,i,n,a){var o=Ge;o.id=r,o.cmd=t,o.data=i,o.errorCode=n,o.status=a,e.errorCode=n,e.fnCallBack(o)},this.convertErrorCode=function(e){switch(e){case 1:return 1;case 98:return 0;default:return e}},this.arrayBufferCopy=function(e){var t=e.byteLength,i=new Uint8Array(t),n=new Uint8Array(e),a=0;for(a=0;a<t;a++)i[a]=n[a];return i},this.inputDataFun=function(){var e,t=0;if(o.bIsGetYUV=!1,o.bIsInputBufOver||o.bIsInputBufWillOver){e=new Uint8Array(1);var i={command:"InputData",data:new Uint8Array(e).buffer,dataSize:0};o.decodeWorker.postMessage(i,[i.data])}else if(o.bPlay&&(!o.bPause||o.bOnebyOne)||this.bOnlyPlaySound){for(;o.aInputDataLens.length>0&&!((t+=o.aInputDataLens.shift())>o.iInputDataLen););e=o.aInputDataBuffer.splice(0,t),i={command:"InputData",data:new Uint8Array(e).buffer,dataSize:t},o.decodeWorker.postMessage(i,[i.data])}e=null},this.getPic=function(e,t){if(null==this.decodeWorker||null==this.oSuperRender)return 2;if(!this.bPlay)return 2;if(!e||"function"!=typeof e)return 0;if(this.dataCallBackFun=e,0===this.iZoomNum)this.stYUVRect.left=0,this.stYUVRect.top=0,this.stYUVRect.right=0,this.stYUVRect.bottom=0;else{if(0===this.iCanvasWidth||0===this.iCanvasHeight)this.stYUVRect.left=0,this.stYUVRect.top=0,this.stYUVRect.right=0,this.stYUVRect.bottom=0;else{var i=this.nWidth/this.iCanvasWidth,n=this.nHeight/this.iCanvasHeight;this.stYUVRect.left=Math.round(this.stDisplayRect.left*i),this.stYUVRect.top=Math.round(this.stDisplayRect.top*n),this.stYUVRect.right=Math.round(this.stDisplayRect.right*i),this.stYUVRect.bottom=Math.round(this.stDisplayRect.bottom*n)}if(this.stYUVRect.right-this.stYUVRect.left<32||this.stYUVRect.bottom-this.stYUVRect.top<32)return 0}if(null==this.aDisplayBuf)return 2;var a={command:t,data:this.arrayBufferCopy(this.aDisplayBuf).buffer,width:this.nWidth,height:this.nHeight,rect:this.stYUVRect};return this.decodeWorker.postMessage(a,[a.data]),1},this.createWorker=function(e){if(window.Worker){if(null==e.decodeWorker){var t=new Blob([Be(e.szBasePath)]),i=URL.createObjectURL(t);if(this.decodeWorker=new Worker(i),e.bJSPrintLog&&console.log(">>>JSPlayV1.1 createWorker success!"),null==e.decodeWorker)return 60}e.decodeWorker.onmessage=function(t){var i=null,n=t.data;switch(e.errorCode=n.errorCode,n.function){case"printLog":console.log("print JSPlayerSDK log failed");break;case"loaded":i="loaded",console.log("V1 Decoder.js loaded path:"+e.szBasePath),e.setCallBack(e,"loaded",0,0,!0);break;case"SetStreamOpenMode":i="SetStreamOpenMode";break;case"OpenStream":if(i="OpenStream",1===n.errorCode)return void(o.bOpenStream=!0);break;case"InputData":i="InputData",11===n.errorCode&&(o.bIsInputBufOver=!0,console.log("yff inputBuffer over set key frame \n"),1!=o.nDecFrameType&&o.PlayM4_SetDecodeFrameType(1)),36===n.errorCode&&(o.bIsInputBufWillOver=!0),n.errorCode===Ue&&(o.bIsInputBufOver=!1,o.bIsInputBufWillOver=!1,o.aInputDataLens.length>0&&o.bIsInput?(o.inputDataFun(),o.bIsInput=!1):o.bIsGetYUV=!0);break;case"GetFrameData":if(i="GetFrameData",!o.bOnlyPlaySound){if(null!=n.data&&null!=n.frameInfo&&(n.frameInfo.width,n.frameInfo.height),!o.bPlay)return;if(o.errorCode=n.errorCode,!(o.bIsFirstFrame||n.errorCode!==Ue&&35!==n.errorCode)){n.errorCode===Ue&&(o.bIsInputBufOver=!1,o.bIsInputBufWillOver=!1),o.loopNum>5?(o.bIsGetYUV=!0,o.loopNum=0):(o.inputDataFun(),o.loopNum++);break}o.bIsInputBufOver||o.bIsInputBufWillOver?o.inputDataFun():"videoType"===n.type&&(o.aInputDataLens.length>0&&o.bIsInput?(o.inputDataFun(),o.bIsInput=!1):o.bIsGetYUV=!0,o.bIsFirstFrame=!1)}if(o.bVisibility&&1===n.errorCode)switch(n.type){case"videoType":if(null==n.data||null==n.frameInfo)return 0;null!=o.DecCallBackFun&&(o.DecInfoYUV.port=0,o.DecInfoYUV.iDataType=3,o.DecInfoYUV.height=n.frameInfo.height,o.DecInfoYUV.width=n.frameInfo.width,o.DecInfoYUV.isize=n.frameInfo.width*n.frameInfo.height*3/2,o.DecInfoYUV.Data=new Uint8Array(n.data),o.DecCallBackFun(o.DecInfoYUV)),o.bIsFirstFrame=!1,e.nWidth=n.frameInfo.width,e.nHeight=n.frameInfo.height,e.nSPSCropLeft=n.frameInfo.cropLeft,e.nSPSCropRight=n.frameInfo.cropRight,e.nSPSCropTop=n.frameInfo.cropTop,e.nSPSCropBottom=n.frameInfo.cropBottom,e.timeStamp=n.frameInfo.timeStamp;var a=new Object;if(a.data=n.data,a.osdTime=n.frameInfo,a.nWidth=n.frameInfo.width,a.nHeight=n.frameInfo.height,a.frameNum=n.frameInfo.frameNum,a.timeStamp=n.frameInfo.timeStamp,e.bWriteYUVData){for(var r=new Uint8Array(n.data),s=e.aVideoYUVBuffer.length,l=0,c=r.length;l<c;l++)e.aVideoYUVBuffer[s+l]=r[l];e.iYUV10size++,r=null}if(e.bWriteYUVData&&e.iYUV10size>=20){var d=new Uint8Array(e.aVideoYUVBuffer);e.downloadFile(d,"videoYUV.data"),e.aVideoYUVBuffer.splice(0,e.aVideoYUVBuffer.length),e.bWriteYUVData=!1,e.iYUV10size=0,d=null}if(e.aVideoFrameBuffer.push(a),a=null,e.aVideoFrameBuffer.length>5&&(e.bOnebyOne||e.aVideoFrameBuffer.splice(0,2)),e.bOnebyOne&&e.aVideoFrameBuffer.length>=15){e.setCallBack(e,"OnebyOne",0,0,!1),e.bIsFirstFrame=!0;break}break;case"audioType":if(e.bPlaySound&&!e.bPlayRateChange||o.bOnlyPlaySound){for(null!=o.PCMCallBackFun&&(o.DecInfoPCM.port=0,o.DecInfoPCM.SampleRate=n.frameInfo.samplesPerSec,o.DecInfoPCM.channel=n.frameInfo.channels,o.DecInfoPCM.bitsPerSample=n.frameInfo.bitsPerSample,o.DecInfoPCM.iDataType=101,o.DecInfoPCM.Data=new Uint8Array(n.data),o.DecInfoPCM.isize=o.DecInfoPCM.Data.length,o.PCMCallBackFun(o.DecInfoPCM)),r=new Uint8Array(n.data),s=e.aAudioBuffer.length,l=0,c=r.length;l<c;l++)e.aAudioBuffer[s+l]=r[l];if(e.iAudioBufferSize++,r=null,e.bWritePCMData){for(r=new Uint8Array(n.data),s=e.aAudioPCMBuffer.length,l=0,c=r.length;l<c;l++)e.aAudioPCMBuffer[s+l]=r[l];console.log("audio_type num:"+e.iAudioBuffer500Size+", len:"+r.length),e.iAudioBuffer500Size++,r=null}if(e.bWritePCMData&&e.iAudioBuffer500Size>=100){var u=new Uint8Array(e.aAudioPCMBuffer);e.downloadFile(u,"audioPCM.data"),e.aAudioPCMBuffer.splice(0,e.aAudioPCMBuffer.length),e.bWritePCMData=!1,e.iAudioBuffer500Size=0,u=null}e.iAudioBufferSize>=ze&&(e.audioRenderer.Play(e.aAudioBuffer,e.aAudioBuffer.length,n.frameInfo),e.aAudioBuffer.splice(0,e.aAudioBuffer.length),e.aAudioBuffer.length=0,e.iAudioBufferSize=0)}}break;case"GetRawData":if(i="GetRawData",e.bWriteRawData){var h=new Uint8Array(n.data),f=e.aRawDataBuffer.length;for(l=0,c=h.length;l<c;l++)e.aRawDataBuffer[f+l]=h[l];e.iRawDataSize++,h=null}if(e.bWriteRawData&&e.iRawDataSize>=100){var x=new Uint8Array(e.aRawDataBuffer);e.downloadFile(x,"rawBuffer.data"),e.aRawDataBuffer.splice(0,e.aRawDataBuffer.length),e.bWriteRawData=!1,e.iRawDataSize=0,x=null}break;case"PlaySound":i="PlaySound";break;case"GetJPEG":if(i="GetJPEG",1!==n.errorCode)return void console.log("GetJPEG ErrorParam");var p=n.data;e.dataCallBackFun(p,p.length);break;case"GetBMP":if(i="GetBMP",1!==n.errorCode)return void console.log("GetBMP ErrorParam");var m=n.data;e.dataCallBackFun(m,m.length);break;case"RunTimeInfoCallBack":i="RunTimeInfoCallBack";var _=n.nRunTimeModule,g=n.nStrVersion,v=n.nFrameTimeStamp,y=n.nFrameNum,S=n.nErrorCode;null!=e.runtimeInfoCBFun&&e.runtimeInfoCBFun(_,g,v,y,S)}"GetFrameData"!==i&&"loaded"!==i?e.setCallBack(e,i,0,e.convertErrorCode(n.errorCode),!0):16!==n.errorCode&&101!==n.errorCode&&100!==n.errorCode&&48!==n.errorCode||e.setCallBack(e,i,0,e.convertErrorCode(n.errorCode),!0)}}},this.createWorker(o),this.draw=function(){if(o.bPlay){if(o.needFirstFrameCB&&null!=o.firstFrameCB&&(o.firstFrameCB(),o.needFirstFrameCB=!1),!o.bPause||o.bOnebyOne){requestAnimationFrame(o.draw);var e=o.aVideoFrameBuffer.length;if(null!=o.YUVBufSizeCBFun&&o.YUVBufSizeCBFun(e),o.bOnebyOne){if(e<=8&&o.setCallBack(o,"OnebyOne",0,Ue,!0),e<=o.FrameForwardLen+1)return void o.setCallBack(o,"OnebyOne",0,Ue,!0);for(var t=o.FrameForwardLen;t>1;)o.aVideoFrameBuffer.shift(),t--;o.bOnebyOne=!1}if(e>0){var i=o.aVideoFrameBuffer.shift(),n={};n.nCropLeft=o.nSPSCropLeft,n.nCropRight=o.nSPSCropRight,n.nCropTop=o.nSPSCropTop,n.nCropBottom=o.nSPSCropBottom,n.nCodeWidth=i.nWidth,n.nCodeHeight=i.nHeight,o.aDisplayBuf=i.data;var a=new Uint8Array(o.aDisplayBuf);o.bVideoCropInfo?o.oSuperRender.DisplayFrame(a,i.nWidth-o.nSPSCropLeft-o.nSPSCropRight,i.nHeight-o.nSPSCropTop-o.nSPSCropBottom,i.timeStamp,n,null):o.oSuperRender.DisplayFrame(a,i.nWidth,i.nHeight,i.timeStamp,n,null),null!=o.DisplayCallBackFun&&(o.DisplayInfoYUV.height=i.nHeight,o.DisplayInfoYUV.width=i.nWidth,o.DisplayInfoYUV.iSize=o.DisplayInfoYUV.height*o.DisplayInfoYUV.width*3/2,o.DisplayInfoYUV.frameNum=i.frameNum,o.DisplayInfoYUV.timeStamp=i.timeStamp,o.DisplayInfoYUV.yuvData=new Uint8Array(a),o.DisplayCallBackFun(o.DisplayInfoYUV)),o.frameInfoFlag&&(o.displayFrameInfo.codecType=0,o.displayFrameInfo.frameType=0,o.displayFrameInfo.frameSize=0,o.displayFrameInfo.width=i.nWidth,o.displayFrameInfo.height=i.nHeight,o.displayFrameInfo.timeStamp=i.timeStamp,o.displayFrameInfo.frameRate=0,o.displayFrameInfo.frameNum=i.frameNum,o.displayFrameInfo.interlace=0,o.displayFrameInfo.streamEnd=0,o.displayFrameInfo.cropLeft=o.nSPSCropLeft,o.displayFrameInfo.cropRight=o.nSPSCropRight,o.displayFrameInfo.cropTop=o.nSPSCropTop,o.displayFrameInfo.cropBottom=o.nSPSCropBottom,o.displayFrameInfo.year=i.osdTime.year,o.displayFrameInfo.month=i.osdTime.month,o.displayFrameInfo.week=0,o.displayFrameInfo.day=i.osdTime.day,o.displayFrameInfo.hour=i.osdTime.hour,o.displayFrameInfo.minute=i.osdTime.minute,o.displayFrameInfo.second=i.osdTime.second,o.displayFrameInfo.milliseconds=i.osdTime.misecond),0==o.startTimeStamp&&(o.startTimeStamp=i.timeStamp),a=null;var r=i.osdTime.year,s=i.osdTime.month,l=i.osdTime.day,c=i.osdTime.hour,d=i.osdTime.minute,u=i.osdTime.second;o.szOSDTime=r+"-"+s+"-"+l+" "+c+":"+d+":"+u,i=null}else o.setCallBack(o,"Play",0,Ue,!0)}}else o.bPlay||(o.aVideoFrameBuffer.splice(0,o.aVideoFrameBuffer.length),o.aAudioBuffer.splice(0,o.aAudioBuffer.length))}}return o(t,[{key:"PlayM4_SetCurrentFrameNum",value:function(e,t){return 16}},{key:"PlayM4_OpenPlayerSDKPrintLog",value:function(e){return!0===e?(this.bJSPrintLog=!0,this.decodeWorker.postMessage({command:"printLog",data:e})):(this.bJSPrintLog=!1,this.decodeWorker.postMessage({command:"printLog",data:e})),1}},{key:"PlayM4_DownloadYUVdata",value:function(){return this.bWriteYUVData=!0,1}},{key:"PlayM4_DownloadPCMdata",value:function(){return this.bWritePCMData=!0,1}},{key:"PlayM4_SetDecCallBack",value:function(e,t){return e?(1==this.decCBStream&&(this.DecCallBackFun=t),2==this.decCBStream&&(this.PCMCallBackFun=t),3==this.decCBStream&&(this.PCMCallBackFun=t,this.DecCallBackFun=t)):(1==this.decCBStream&&(this.DecCallBackFun=null),2==this.decCBStream&&(this.PCMCallBackFun=null),3==this.decCBStream&&(this.PCMCallBackFun=null,this.DecCallBackFun=null)),1}},{key:"PlayM4_SetDisplayCallBack",value:function(e){return e&&"function"==typeof e?(this.DisplayCallBackFun=e,1):0}},{key:"PlayM4_SetPCMCallBack",value:function(e){return e&&"function"==typeof e?(this.PCMCallBackFun=e,1):0}},{key:"PlayM4_SetStreamOpenMode",value:function(e){return null==e||void 0===e||0!==e&&1!==e?0:(this.streamOpenMode=e,1)}},{key:"PlayM4_DownloadRTPData",value:function(e){this.downloadRTP=e}},{key:"PlayM4_SetVideoCropInfo",value:function(e){return null==e||void 0===e||"boolean"!=typeof e?0:(this.bVideoCropInfo=e,1)}},{key:"PlayM4_OpenStream",value:function(e,t,i){return this.bJSPrintLog&&console.log(">>>JS PlayM4_OpenStream nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds()),null==this.decodeWorker?2:null==e||t<=0||i<=0?0:(this.bPlay=!1,this.bPause=!1,this.bOnebyOne=!1,this.bIsFirstFrame=!0,this.bIsGetYUV=!1,this.bIsInput=!1,4===e[8]&&0===e[9]?this.streamOpenMode=0:this.streamOpenMode=1,this.decodeWorker.postMessage({command:"SetStreamOpenMode",data:this.streamOpenMode}),this.decodeWorker.postMessage({command:"OpenStream",data:e,dataSize:t,bufPoolSize:i}),this.bOpenStream=!0,1)}},{key:"PlayM4_CloseStream",value:function(){return null===this.decodeWorker?1:null===this.decodeWorker||!1===this.bOpenStream?2:(this.bOnlyPlaySound=!1,this.decodeWorker.postMessage({command:"CloseStream"}),null!==this.oSuperRender&&(this.oSuperRender.ReleaseDisplay(),this.oSuperRender=null),null!==this.audioRenderer&&(this.audioRenderer.Stop(),this.audioRenderer=null),this.aAudioBuffer.splice(0,this.aAudioBuffer.length),this.aVideoFrameBuffer.splice(0,this.aVideoFrameBuffer.length),this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length),this.aInputDataLens.splice(0,this.aInputDataLens.length),this.aVideoYUVBuffer.splice(0,this.aVideoYUVBuffer.length),this.aAudioPCMBuffer.splice(0,this.aAudioPCMBuffer.length),this.aRawDataBuffer.splice(0,this.aRawDataBuffer.length),this.bOpenStream=!1,this.iAudioBufferSize=0,this.szOSDTime=null,this.startTimeStamp,1)}},{key:"PlayM4_Destroy",value:function(){return null===this.decodeWorker||(this.PlayM4_CloseStream(),this.decodeWorker.terminate(),this.decodeWorker=null),1}},{key:"PlayM4_FreePort",value:function(){return this.decodeWorker.terminate(),this.decodeWorker=null,1}},{key:"PlayM4_InputData",value:function(e,t){var i=this.aInputDataBuffer.length;if(4===t){var n=new Uint8Array(e.buffer);if(1===n[0]&&2===n[1]&&3===n[2]&&4===n[3])return this.bIsFirstFrame||this.bIsGetYUV?this.inputDataFun():this.bIsInput=!0,n=null,1}if(i+t>this.iInputMaxBufSize)return console.log("input over"),this.bIsGetYUV?this.inputDataFun():this.bIsInput=!0,11;var a=null,r=t;switch(this.streamOpenMode){case 1:a=new Uint8Array(e.buffer),this.aInputDataLens.push(t);break;case 0:r=t+4;var o=new Uint32Array([t]),s=new Uint8Array(o.buffer);(a=new Uint8Array(r)).set(s,0),a.set(e,4),o=null,s=null,this.aInputDataLens.push(t+4);break;default:return 16}for(var l=0;l<r;l++)this.aInputDataBuffer[i+l]=a[l];return!this.bPlay&&!this.bOnlyPlaySound||null===this.decodeWorker||!1===this.bOpenStream||(a=null,this.bOnlyPlaySound||this.bIsFirstFrame||this.bIsGetYUV?this.inputDataFun():this.bIsInput=!0),1}},{key:"PlayM4_Play",value:function(e){if(null===this.decodeWorker)return 2;if(this.bJSPrintLog&&console.log(">>>JS PlayM4_Play canvasID: "+e),null===e)this.bOnlyPlaySound=!0,this.decodeWorker.postMessage({command:"OnlyPlaySound"}),this.sCanvasId=null;else{if("string"!=typeof e)return 0;if(this.bOnebyOne&&(this.bPlayRateChange=!1,this.bOnebyOne=!1,this.bPause=!1,this.draw()),this.bPlay)return 1;if(null==this.oSuperRender&&(this.canvasCnv=document.getElementById(e),this.oSuperRender=new Pe,this.oSuperRender.InitDisplay(this.canvasCnv,"webgl",1),null==this.oSuperRender))return 61;this.sCanvasId=e,this.bPlay=!0,this.bPause=!1,this.bOnebyOne=!1,this.bPlayRateChange=!1,this.bOnlyPlaySound=!1,this.draw()}return null==this.audioRenderer&&(this.audioRenderer=new Ne,null==this.audioRenderer)?61:(this.decodeWorker.postMessage({command:"Play"}),1)}},{key:"PlayM4_Stop",value:function(e){if(!0===this.bJSPrintLog&&console.log(">>>>yff1020>>>>> V1 PlayM4_Stop"),null==this.decodeWorker||null==this.oSuperRender)return 2;if(!this.bPlay)return 2;this.bPlaySound&&(this.PlayM4_StopSound(),this.bPlaySound=!0),this.bPlay=!1,this.bOnebyOne=!1,this.bPause=!1,this.oSuperRender.SetDisplayRect(0,0,this.nWidth,this.nHeight),this.iZoomNum=0,this.bDisRect=!1;var t={};t.nCropLeft=this.nSPSCropLeft,t.nCropRight=this.nSPSCropRight,t.nCropTop=this.nSPSCropTop,t.nCropBottom=this.nSPSCropBottom,t.nCodeWidth=this.nWidth,t.nCodeHeight=this.nHeight,this.bVideoCropInfo?this.oSuperRender.DisplayFrame(null,this.nWidth-this.nSPSCropLeft-this.nSPSCropRight,this.nHeight-this.nSPSCropTop-this.nSPSCropBottom,this.timeStamp,t,null):this.oSuperRender.DisplayFrame(null,this.nWidth,this.nHeight,this.timeStamp,t,null);var i=document.getElementById(this.sCanvasId);return i&&(this.clonedCanvas=i.cloneNode(!0),this.clonedCanvasParentNode=i.parentNode,this.clonedCanvasParentNode.replaceChild(this.clonedCanvas,i)),1}},{key:"PlayM4_PlayRate",value:function(e){return null==this.decodeWorker?2:(this.bPlayRateChange=1!==e,e<1&&(e=1),this.iInputDataLen=e*He,this.decodeWorker.postMessage({command:"PlayRate",playRate:e}),1)}},{key:"PlayM4_Pause",value:function(e){return null==this.decodeWorker||null==this.oSuperRender?2:this.bPlay?this.bOnebyOne||this.bPause==e?2:(this.bPause=e,this.bIsFirstFrame=!0,e?this.bPlaySound&&(this.PlayM4_StopSound(),this.bPlaySound=!0):(this.bPlaySound&&this.PlayM4_PlaySound(),this.draw()),1):2}},{key:"PlayM4_OneByOne",value:function(e){return null==this.decodeWorker||null==this.oSuperRender?2:this.bPlay?e>10||e<=0?0:(e||(e=1),this.iInputDataLen=He,this.FrameForwardLen=e,this.bPause=!0,this.bOnebyOne=!0,this.bIsFirstFrame=!0,this.draw(),1):2}},{key:"PlayM4_PlaySound",value:function(e){return null===this.decodeWorker||!1===this.bOpenStream?2:e<0||e>16?0:null==this.audioRenderer&&(this.audioRenderer=new Ne,null==this.audioRenderer)?61:(this.decodeWorker.postMessage({command:"PlaySound"}),this.audioRenderer.SetWndNum(e),0!==this.Volume&&this.audioRenderer.SetVolume(this.Volume),this.audioRenderer.oAudioContext.resume(),this.bPlaySound=!0,1)}},{key:"PlayM4_StopSound",value:function(){return null==this.decodeWorker||null==this.audioRenderer?2:this.bPlaySound?(this.decodeWorker.postMessage({command:"StopSound"}),this.bPlaySound=!1,1):2}},{key:"PlayM4_SetDisplayBuf",value:function(e){return null==this.decodeWorker?2:e<=0?0:(this.YUVBufferSize=e,1)}},{key:"PlayM4_SetSecretKey",value:function(e,t,i){if(null==this.decodeWorker||!1===this.bOpenStream)return 2;if(null==t)return 0;if(1===e){if(128!==i)return 0;if(null==t||void 0===t)return 0}else if(0!==e)return 0;return this.decodeWorker.postMessage({command:"SetSecretKey",data:t,nKeyType:e,nKeyLen:i}),1}},{key:"PlayM4_SetDecodeFrameType",value:function(e){return console.log("PlayM4_SetDecodeFrameType nFrameType:"+e),null==this.decodeWorker||null==this.oSuperRender?2:0!==e&&1!==e?0:(this.bJSPrintLog&&console.log(">>>JS PlayM4_SetDecodeFrameType :"+e),this.nDecFrameType=e,this.decodeWorker.postMessage({command:"SetDecodeFrameType",data:e}),1)}},{key:"PlayM4_SetIFrameDecInterval",value:function(e){return 1!==this.nDecFrameType?2:e<0?0:(this.decodeWorker.postMessage({command:"SetIFrameDecInterval",data:e}),1)}},{key:"PlayM4_SetLostFrameMode",value:function(e){return e<0||e>1?0:(this.decodeWorker.postMessage({command:"SetLostFrameMode",data:e}),1)}},{key:"PlayM4_SetDisplayRegion",value:function(e,t,i){if(!0===this.bJSPrintLog&&console.log(">>>>yff1020>>>>> PlayM4_SetDisplayRegion left:"+e.left+",top:"+e.top+",right:"+e.right+",bottom:"+e.bottom),null===this.decodeWorker||!1===this.bPlay||null===this.oSuperRender)return 2;if(null===this.canvasId)return 2;if(!0===t){if(null==e)return 0;if("number"!=typeof e.left||"number"!=typeof e.top||"number"!=typeof e.right||"number"!=typeof e.bottom)return 0;if(e.right<0||e.left<0||e.top<0||e.bottom<0)return 0;var n=e.left,a=e.right,r=e.top,o=e.bottom,s=document.getElementById(this.sCanvasId).getBoundingClientRect();if(this.iCanvasWidth=s.width,this.iCanvasHeight=s.height,a-n<16||o-r<16||a-n>this.iCanvasWidth||o-r>this.iCanvasHeight)return 0;0!==this.iZoomNum&&(n=Math.round(n/this.iRatio_x)+this.stDisplayRect.left,r=Math.round(r/this.iRatio_y)+this.stDisplayRect.top,a=Math.round(a/this.iRatio_x)+this.stDisplayRect.left,o=Math.round(o/this.iRatio_y)+this.stDisplayRect.top),this.stDisplayRect={top:r,left:n,right:a,bottom:o};var l=o/this.iCanvasHeight*this.nHeight,c=n/this.iCanvasWidth*this.nWidth,d=a/this.iCanvasWidth*this.nWidth,u=r/this.iCanvasHeight*this.nHeight;this.oSuperRender.SetDisplayRect(c,u,d-c,l-u),this.bDisRect=!0;var h=a-n,f=o-r;this.iRatio_x=this.iCanvasWidth/h,this.iRatio_y=this.iCanvasHeight/f,i&&this.iZoomNum++}else this.oSuperRender.SetDisplayRect(0,0,this.nWidth,this.nHeight),this.iZoomNum=0,this.bDisRect=!1;if(this.bPause||this.bOnebyOne||this.bPlayRateChange){var x={};x.nCropLeft=this.nSPSCropLeft,x.nCropRight=this.nSPSCropRight,x.nCropTop=this.nSPSCropTop,x.nCropBottom=this.nSPSCropBottom,x.nCodeWidth=this.nWidth,x.nCodeHeight=this.nHeight,this.bVideoCropInfo?this.oSuperRender.DisplayFrame(new Uint8Array(this.aDisplayBuf),this.nWidth-this.nSPSCropLeft-this.nSPSCropRight,this.nHeight-this.nSPSCropTop-this.nSPSCropBottom,this.timeStamp,x,null):this.oSuperRender.DisplayFrame(new Uint8Array(this.aDisplayBuf),this.nWidth,this.nHeight,this.timeStamp,x,null)}return 1}},{key:"PlayM4_GetBMP",value:function(e){return this.getPic(e,"GetBMP")}},{key:"PlayM4_GetJPEG",value:function(e){return this.getPic(e,"GetJPEG")}},{key:"PlayM4_SetVolume",value:function(e){return null==this.decodeWorker||null==this.audioRenderer?2:e<0||e>100||""===e?0:(this.Volume=e,this.audioRenderer.SetVolume(e),1)}},{key:"PlayM4_GetVolume",value:function(e){if(null==this.decodeWorker)return 2;if(null==this.audioRenderer)return 2;if(e&&"function"==typeof e){var t=this.audioRenderer.GetVolume();return null===t?63:(e(t),1)}return 0}},{key:"PlayM4_GetOSDTime",value:function(e){return null==this.decodeWorker?2:this.bPlay?e&&"function"==typeof e?(e(this.szOSDTime),1):0:2}},{key:"PlayM4_SetFrameInfoCallBack",value:function(e){return this.frameInfoFlag=!!e,1}},{key:"PlayM4_GetFrameInfo",value:function(){return this.displayFrameInfo}},{key:"PlayM4_IsVisible",value:function(e){return this.bVisibility=e,1}},{key:"PlayM4_GetSdkVersion",value:function(){return"07040007"}},{key:"PlayM4_GetBuildDate",value:function(){return"20231219"}},{key:"PlayM4_GetInputBufSize",value:function(){return this.aInputDataBuffer.length}},{key:"PlayM4_SetInputBufSize",value:function(e){return e>0?(this.iInputMaxBufSize=e,console.log(">>JSBufferSize SetInputBufSize:"+this.iInputMaxBufSize),1):0}},{key:"PlayM4_GetYUVBufSize",value:function(){return this.aVideoFrameBuffer.length}},{key:"PlayM4_GetFrameResolution",value:function(e){return null==this.decodeWorker?2:e&&"function"==typeof e?(e(this.nWidth,this.nHeight),1):0}},{key:"PlayM4_RegisterYUVBufSizeCB",value:function(e){return e&&"function"==typeof e?(this.YUVBufSizeCBFun=e,1):0}},{key:"PlayM4_UnRegisterYUVBufSizeCB",value:function(){return null!=this.YUVBufSizeCBFun&&(this.YUVBufSizeCBFun=null),1}},{key:"PlayM4_ClearCanvas",value:function(){if(null==this.oSuperRender)return 2;var e={};return e.nCropLeft=this.nSPSCropLeft,e.nCropRight=this.nSPSCropRight,e.nCropTop=this.nSPSCropTop,e.nCropBottom=this.nSPSCropBottom,e.nCodeWidth=this.nWidth,e.nCodeHeight=this.nHeight,this.bVideoCropInfo?this.oSuperRender.DisplayFrame(null,this.nWidth-this.nSPSCropLeft-this.nSPSCropRight,this.nHeight-this.nSPSCropTop-this.nSPSCropBottom,this.timeStamp,e,null):this.oSuperRender.DisplayFrame(null,this.nWidth,this.nHeight,this.timeStamp,e,null),1}},{key:"PlayM4_ReleaseInputBuffer",value:function(){return null===this.aInputDataBuffer?2:(this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length),this.aInputDataLens.splice(0,this.aInputDataLens.length),1)}},{key:"PlayM4_GetDecodeFrameType",value:function(){return this.nDecFrameType}},{key:"PlayM4_SetRunTimeInfoCallBackEx",value:function(e,t){return this.runtimeInfoCBFun=t,null==this.decodeWorker?2:(this.decodeWorker.postMessage({command:"SetRunTimeInfoCB",nModuleType:e}),1)}},{key:"PlayM4_SetDemuxModel",value:function(e,t){return null==this.decodeWorker?2:(this.decodeWorker.postMessage({command:"SetDemuxModel",nIdemuxType:e,bTrue:t}),1)}},{key:"PlayM4_SkipErrorData",value:function(e){return null==this.decodeWorker?2:(this.decodeWorker.postMessage({command:"SkipErrorData",bSkip:e}),1)}},{key:"PlayM4_SetDecodeERC",value:function(e){return null==this.decodeWorker?2:(this.decodeWorker.postMessage({command:"SetDecodeERC",nLevel:e}),1)}},{key:"PlayM4_SetANRParam",value:function(e,t){return null==this.decodeWorker?2:(this.decodeWorker.postMessage({command:"SetANRParam",nEnable:e,nANRLevel:t}),1)}},{key:"PlayM4_SetResampleValue",value:function(e,t){return null==this.decodeWorker?2:(this.decodeWorker.postMessage({command:"SetResampleValue",nEnable:e,resampleValue:t}),1)}},{key:"PlayM4_SetGlobalBaseTime",value:function(e,t,i,n,a,r,o){return null==this.decodeWorker?2:e<2e3||e>3e3||t<1||t>12||e<0||t<0||i<0||n<0||a<0||r<0||o<0?16:(this.decodeWorker.postMessage({command:"SetGlobalBaseTime",year:e,month:t,day:i,hour:n,min:a,sec:r,ms:o}),1)}},{key:"PlayM4_SetAudioDisplayBuf",value:function(e){return ze=e,1}},{key:"PlayM4_GetCanvasCapture",value:function(e){return null!=this.oSuperRender?this.oSuperRender.GetCanvasData(e):1}},{key:"PlayM4_SetFirstFrameCallBack",value:function(e,t){return null!=t&&"function"!=typeof t?0:(e&&(this.firstFrameCB=t),this.needFirstFrameCB=!0,1)}},{key:"PlayM4_SetDecCBStream",value:function(e){return this.decCBStream=e,1}},{key:"PlayM4_SetCanvasSize",value:function(e,t){return null!=this.oSuperRender&&this.oSuperRender.SetCanvasSize(e,t)}},{key:"PlayM4_GetCanvasSize",value:function(){return null!=this.oSuperRender&&this.oSuperRender.GetCanvasSize()}},{key:"PlayM4_GetBufferValue",value:function(){return this.iInputMaxBufSize}},{key:"PlayM4_GetLastError",value:function(){return this.errorCode}},{key:"PlayM4_GetPlayedTimeEx",value:function(e){e(this.timeStamp-this.startTimeStamp)}},{key:"PlayM4_SetAntialias",value:function(e){return null!=this.oSuperRender&&this.oSuperRender.SetAntialias(e)}},{key:"PlayM4_SetWaterMarkFont",value:function(e){return null!=this.oSuperRender&&this.oSuperRender.SetWaterMarkFont(e)}},{key:"PlayM4_SetWaterMarkImage",value:function(e){return null!=this.oSuperRender&&this.oSuperRender.SetWaterMarkImage(e)}},{key:"PlayM4_SetD3DPostProcess",value:function(e,t){return null!=this.oSuperRender&&this.oSuperRender.SetD3DPostProcess(e,t)}},{key:"getScriptDirectory",value:function(){var e=self.location.href;return e.substr(0,e.lastIndexOf("/")+1)}},{key:"downloadFile",value:function(e,t){var i=e;r(e,Blob)||r(e,File)||(i=new Blob([e]));var n=window.URL.createObjectURL(i),a=window.document.createElement("a");a.href=n,a.download=t;var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!0),a.dispatchEvent(o)}}]),t}(),Xe=a((function(){return function(e,t){var i,n,a,r,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(a=2&r[0]?n.return:r[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,r[1])).done)return a;switch(n=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){o.label=r[1];break}if(6===r[0]&&o.label<a[1]){o.label=a[1],a=r;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(r);break}a[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}(this,(function(e){return[2,WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))]}))})),Je={bSupHardOrSoft:!0,bSupHardDecAVC:!0,bSupHardDecHEVC:!0,cmd:null,errorCode:0,status:null},qe=function(){function t(i,n,a){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"webgl",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:-1;if(e(this,t),console.log("%c>>>JSPlayerInterface wasmPathV3:%s, wasmPathV1:%s, chromeVersion:%d","color: red",i,n,_getFExplore()),this.szBasePathV3=i,this.szBasePathV1=n,this.fnCallBack=a,this.nUser=o,this.renderEngine=s,this.hasWebWorker=l,this.setHasThread=c,this.decodeEngine=1,this.streamOpenMode=0,this.printfFlag=!1,this.canvasID="",this.FECcanvasIDArray=[],this.aTotalBuffer=[],this.iFrameNum=0,this.bWriteData=!0,this.downloadInputDataFlag=!1,this.rtpDataNeedAdd4Size=!1,this.aInputDataBuffer=[],this.iInputMaxBufSize=2097152,this.audioDisplayBufSize=0,this.decodeFrameType=0,this.decInterval=-1,this.volume=0,this.displayBuf=0,this.anrParamLevel=0,this.anrParamFlag=0,this.resampleRate=0,this.resampleFlag=0,this.decodeERCLevel=0,this.skipErrorData=0,this.demuxModelType=0,this.demuxModeFlag=0,this.needResetBuffer=0,this.globalBaseTime={},this.globalBaseTime.year=0,this.inputBufSize=0,this.waterFontParam=null,this.waterImageParam=null,this.needSetFFCB=!1,this.FFCBFlag=0,this.firstFrameCB=null,this.needSetSecretKey=!1,this.keyData=null,this.runtimeModule=0,this.runtimeCBFun=null,this.needSetRunTimeInfoCB=!1,this.needPlaySound=!1,this.CanvasSubPortMap=new Map,this.oJSPlayerObj=null,this.supportWebCodecs=window._getFSupportWebCodecs(),this.supportSab=!!window.SharedArrayBuffer,this.offscreen=!!window.OffscreenCanvas,this.supportOffscreen=!1,this.offscreen){var d=new OffscreenCanvas(1,1),u=d.getContext("webgl");u&&(this.supportOffscreen=!0,u.getExtension("WEBGL_lose_context").loseContext()),d=null,u=null}this.securityContext=!0,"https:"===window.location.protocol||"localhost"===location.hostname?this.securityContext=!0:this.securityContext=!1;var h=this.JSPlayM4_GetSDKVersion(),f=this.JSPlayM4_GetBuildDate();console.log("%c wasmplayer.min.js version:%s,buildDate:%s","color: blue",h,f),this.supportSIMD=!1,this.callBackParameter=Je,this.jsplayerVersion=3,this.supportWebCodecs&&this.securityContext?this.jsplayerVersion=3:this.supportSab&&this.supportOffscreen?this.jsplayerVersion=2:this.jsplayerVersion=1,this.jsplayerVersion<3&&(this.callBackParameter.bSupHardDecAVC=!1,this.callBackParameter.bSupHardDecHEVC=!1,this.callBackParameter.bSupHardOrSoft=!1),null===this.szBasePathV3&&null!=this.szBasePathV1?this.jsplayerVersion=1:null!=this.szBasePathV3&&null===this.szBasePathV1?(console.info("%c>>>> szBasePathV1 is null ","color: red"),this.jsplayerVersion=3):null===this.szBasePathV3&&null===this.szBasePathV1&&(console.info("%c>>>> szBasePathV3 and szBasePathV1 are null ","color: red"),this.fnCallBack(this.callBackParameter)),Xe().then(function(e){e?(this.supportSIMD=!0,console.log("%c>>>>your browser protocol is %s, hostname:%s, WebCodecs:%s,Sab:%s,Offscreen:%s,SIMD:%s,jsplayerVersion:%d","color: red",window.location.protocol,location.hostname,this.supportWebCodecs,this.supportSab,this.supportOffscreen,this.supportSIMD,this.jsplayerVersion)):(this.supportSIMD=!1,console.log("%c>>>>your browser protocol is %s, hostname:%s, WebCodecs:%s,Sab:%s,Offscreen:%s,SIMD:%s,jsplayerVersion:%d","color: red",window.location.protocol,location.hostname,this.supportWebCodecs,this.supportSab,this.supportOffscreen,this.supportSIMD,this.jsplayerVersion))}.bind(this)),this.wasmloaded=!1,this.jsplayerVersion>1?this.oJSPlayerObj=new Me(this,this.szBasePathV3,(function(e){var t=e.bSupHardOrSoft,i=e.bSupHardDecAVC,n=e.bSupHardDecHEVC,a=e.cmd,o=e.errorCode,s=e.status;r.callBackParameter.bSupHardDecAVC=i,r.callBackParameter.bSupHardDecHEVC=n,r.callBackParameter.bSupHardOrSoft=t,r.callBackParameter.cmd=a,r.callBackParameter.errorCode=o,r.callBackParameter.status=s,r.wasmloaded=!0,r.fnCallBack(r.callBackParameter)}),this.nUser,this.renderEngine,this.hasWebWorker,this.setHasThread,this.jsplayerVersion):this.oJSPlayerObj=new Ye(this,this.szBasePathV1,(function(e){e.instance;var t=e.cmd,i=e.errorCode,n=e.status;r.callBackParameter.bSupHardDecAVC=!1,r.callBackParameter.bSupHardDecHEVC=!1,r.callBackParameter.bSupHardOrSoft=!1,r.callBackParameter.cmd=t,r.callBackParameter.errorCode=i,r.callBackParameter.status=n,r.wasmloaded=!0,r.fnCallBack(r.callBackParameter)}),0)}return o(t,[{key:"JSPlayM4_SetStreamEnd",value:function(){return 0}},{key:"JSPlayM4_GetPort",value:function(){return this.printfFlag&&console.log(">>>>>yff>>> JSPlayM4_GetPort 1"),null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetPort this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1&&this.oJSPlayerObj.JSPlayM4_GetPort(),1)}},{key:"JSPlayM4_SetStreamOpenMode",value:function(e){return this.printfFlag&&console.log(">>>>>yff20230817>>>>> JSPlayM4_SetStreamOpenMode 1 mode:"+e),this.streamOpenMode=e,null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetStreamOpenMode this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetStreamOpenMode(e):this.oJSPlayerObj.PlayM4_SetStreamOpenMode(e),1)}},{key:"JSPlayM4_OpenStream",value:function(e,t,i){if(this.printfFlag&&console.log(">>>>>yff20230817>>>>> JSPlayM4_OpenStream 1 :"+e),40!==t&&console.info("%cJSPlayM4_OpenStream nSize is not 40","color: red"),4===e[8]&&0===e[9]&&(this.rtpDataNeedAdd4Size=!0),this.downloadInputDataFlag){var n=new Uint8Array(e.buffer);this.downloadRTPData(n),console.log("write 40 hik head")}var a=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_OpenStream this.oJSPlayerObj is null"),0):(a=this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_OpenStream(e,t,i):this.oJSPlayerObj.PlayM4_OpenStream(e,t,i),this.HIK40Head=e,this.HIKHeadSize=t,this.HIKPoolSize=i,16===a&&this._switchV3ToV1(this.streamOpenMode,e,t,i,this.needPlay),a)}},{key:"_switchV3ToV1",value:function(e,t,i,n,a){var r=this;console.log("%c5>switch V3 to V1","color: red"),this.jsplayerVersion=1,this.oJSPlayerObj.JSPlayM4_Stop(),this.oJSPlayerObj.JSPlayM4_CloseStream(),this.oJSPlayerObj.JSPlayM4_FreePort(),this.oJSPlayerObj=null;var o=new Ye(this,this.szBasePathV1,(function(s){s.instance;var l=s.cmd,c=s.errorCode,d=s.status;"loaded"===l&&(r.oJSPlayerObj=o,r.callBackParameter.cmd=l,r.callBackParameter.errorCode=c,r.callBackParameter.status=d,r.JSPlayM4_SetStreamOpenMode(e),r.JSPlayM4_OpenStream(t,i,n),(a||r.needPlay)&&r.JSPlayM4_Play(r.canvasID),r._switchV3ToV1ResetParam())}),0)}},{key:"_switchV3ToV1ResetParam",value:function(){return this.needSetSecretKey&&this.JSPlayM4_SetSecretKey(this.keyData),this.needSetFFCB&&this.JSPlayM4_SetFirstFrameCallBack(this.FFCBFlag,this.firstFrameCB),this.needSetRunTimeInfoCB&&this.JSPlayM4_SetRunTimeInfoCallBackEx(this.runtimeModule,this.runtimeCBFun),this.needPlaySound&&this.JSPlayM4_PlaySound(),0!=this.skipErrorData&&this.oJSPlayerObj.PlayM4_SkipErrorData(this.skipErrorData),0!=this.demuxModeFlag&&this.oJSPlayerObj.PlayM4_SetDemuxModel(this.demuxModelType,this.demuxModeFlag),0!=this.globalBaseTime.year&&this.oJSPlayerObj.PlayM4_SetGlobalBaseTime(this.globalBaseTime.year,this.globalBaseTime.month,this.globalBaseTime.day,this.globalBaseTime.hour,this.globalBaseTime.min,this.globalBaseTime.sec,this.globalBaseTime.ms),-1!=this.decInterval&&this.oJSPlayerObj.PlayM4_SetIFrameDecInterval(this.decInterval),0!=this.decodeERCLevel&&this.oJSPlayerObj.PlayM4_SetDecodeERC(this.decodeERCLevel),0!=this.volume&&this.JSPlayM4_SetVolume(this.volume),0!=this.anrParamFlag&&this.oJSPlayerObj.PlayM4_SetANRParam(this.anrParamFlag,this.anrParamLevel),0!=this.resampleFlag&&this.oJSPlayerObj.PlayM4_SetResampleValue(this.resampleFlag,this.resampleRate),0!=this.displayBuf&&this.oJSPlayerObj.PlayM4_SetDisplayBuf(this.displayBuf),null!=this.waterFontParam&&this.oJSPlayerObj.PlayM4_SetWaterMarkFont(this.waterFontParam),null!=this.waterImageParam&&this.oJSPlayerObj.PlayM4_SetWaterMarkImage(this.waterImageParam),0!=this.audioDisplayBufSize&&this.oJSPlayerObj.PlayM4_SetAudioDisplayBuf(this.audioDisplayBufSize),0!=this.decodeFrameType&&this.JSPlayM4_SetDecodeFrameType(this.decodeFrameType),0!=this.needResetBuffer&&this.oJSPlayerObj.PlayM4_ReleaseInputBuffer(),0!=this.inputBufSize&&this.oJSPlayerObj.PlayM4_SetInputBufSize(this.inputBufSize),1}},{key:"JSPlayM4_SetDecodeEngine",value:function(e){if(this.printfFlag&&console.log(">>>>>yff20230817>>>>> JSPlayM4_SetDecodeEngine 1:"+e),0!=e&&1!=e)return console.log("0 is V3softDecode, 1 is V3hardDecoder,decodeEngine:"+e),0;this.decodeEngine=e;var t=1;if(this.jsplayerVersion>1){if(!this.supportSab)return console.info("%c3>JSPlayM4_SetDecodeEngine(0 is soft,1 is hard):%d,SharedArrayBuffer Error , does not support Soft Decdoe!!!!!","color: red",e),0;t=this.oJSPlayerObj.JSPlayM4_SetDecodeEngine(this.decodeEngine)}return t}},{key:"JSPlayM4_DownloadData",value:function(){return this.downloadInputDataFlag=!0,1}},{key:"JSPlayM4_SetAudioDisplayBuf",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetAudioDisplayBuf this.oJSPlayerObj is null"),0):(this.audioDisplayBufSize=e,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetAudioDisplayBuf(e):this.oJSPlayerObj.PlayM4_SetAudioDisplayBuf(e))}},{key:"JSPlayM4_Play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.canvasID=e;var t=1;return this.printfFlag&&console.log(">>>>>yff20230817>>>>> JSPlayM4_Play 1 this.supportSab:"+this.supportSab),null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_Play this.oJSPlayerObj is null"),this.needPlay=!0,0):(this.jsplayerVersion>1?(t=this.oJSPlayerObj.JSPlayM4_Play(e),0!=this.aInputDataBuffer.length&&(this.oJSPlayerObj.JSPlayM4_InputData(new Uint8Array(this.aInputDataBuffer),this.aInputDataBuffer.length),this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length))):(t=this.oJSPlayerObj.PlayM4_Play(e),0!=this.aInputDataBuffer.length&&(this.oJSPlayerObj.PlayM4_InputData(new Uint8Array(this.aInputDataBuffer),this.aInputDataBuffer.length),this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length))),t)}},{key:"JSPlayM4_InputData",value:function(e,t){var i;if(null===this.oJSPlayerObj||!this.wasmloaded){var n=this.aInputDataBuffer.length;if(n+t>this.iInputMaxBufSize)return console.log("WasmPlayer input over"),0;for(var a=0;a<t;a++)this.aInputDataBuffer[n+a]=e[a];return 0}if(i=this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_InputData(e,t):this.oJSPlayerObj.PlayM4_InputData(e,t),this.downloadInputDataFlag)if(this.rtpDataNeedAdd4Size){var r=null,o=t+4,s=new Uint32Array([t]),l=new Uint8Array(s.buffer);(r=new Uint8Array(o)).set(l,0),r.set(e,4),this.downloadRTPData(r),s=null,l=null,r=null}else this.downloadRTPData(e);return i}},{key:"JSPlayM4_Stop",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(null===this.oJSPlayerObj)return console.log(">>>>>yff>>> JSPlayM4_Stop this.oJSPlayerObj is null"),0;if(this.bWriteData&&this.iFrameNum>0){console.log("download"+this.iFrameNum+"Psdata");var t=new Uint8Array(this.aTotalBuffer);this._downloadFile(t,"RTPRaw.data"),this.aTotalBuffer.splice(0,this.aTotalBuffer.length),this.bWriteData=!1,this.iFrameNum=0,t=null}return this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_Stop(e):this.oJSPlayerObj.PlayM4_Stop(e)}},{key:"JSPlayM4_CloseStream",value:function(){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>>  JSPlayM4_CloseStream this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_CloseStream():this.oJSPlayerObj.PlayM4_CloseStream()}},{key:"JSPlayM4_FreePort",value:function(){var e=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FreePort this.oJSPlayerObj is null"),0):(e=this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_FreePort():this.oJSPlayerObj.PlayM4_FreePort(),this.oJSPlayerObj=null,e)}},{key:"JSPlayM4_SetDecodeFrameType",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetDecodeFrameType this.oJSPlayerObj is null"),0):(this.decodeFrameType=e,this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_SetDecodeFrameType(e):7==e?t=this.oJSPlayerObj.PlayM4_SetLostFrameMode(1):(t=this.oJSPlayerObj.PlayM4_SetLostFrameMode(0),t=this.oJSPlayerObj.PlayM4_SetDecodeFrameType(e)),t)}},{key:"JSPlayM4_PlaySound",value:function(){return this.needPlaySound=!0,null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_PlaySound this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_PlaySound():this.oJSPlayerObj.PlayM4_PlaySound(0)}},{key:"JSPlayM4_GetJPEG",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetJPEG this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetJPEG(e,t):this.oJSPlayerObj.PlayM4_GetJPEG(e)}},{key:"JSPlayM4_GetBMP",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetBMP this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetBMP(e,t):this.oJSPlayerObj.PlayM4_GetBMP(e)}},{key:"JSPlayM4_GetCropJPEG",value:function(){var e=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetCropJPEG this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?e=this.oJSPlayerObj.JSPlayM4_GetCropJPEG():console.log("%c1>JSPlayerV1.X does not support GetCropJPEG","color: red"),e)}},{key:"JSPlayM4_GetCropBMP",value:function(){var e=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetCropBMP this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?e=this.oJSPlayerObj.JSPlayM4_GetCropBMP():console.log("%c1>JSPlayerV1.X does not support GetCropBMP","color: red"),e)}},{key:"JSPlayM4_GetCanvasCapture",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetCanvasCapture this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetCanvasCapture(e):this.oJSPlayerObj.PlayM4_GetCanvasCapture(e)}},{key:"JSPlayM4_StopSound",value:function(){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_StopSound this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_StopSound():this.oJSPlayerObj.PlayM4_StopSound()}},{key:"JSPlayM4_GetSDKVersion",value:function(){return"08010001"}},{key:"JSPlayM4_GetBuildDate",value:function(){return"2023220"}},{key:"JSPlayM4_GetLastError",value:function(){return null===this.oJSPlayerObj?0:this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetLastError():this.oJSPlayerObj.PlayM4_GetLastError()}},{key:"JSPlayM4_Fast",value:function(){var e=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_Fast this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1&&(e=this.oJSPlayerObj.JSPlayM4_Fast()),e)}},{key:"JSPlayM4_Slow",value:function(){var e=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_Slow this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1&&(e=this.oJSPlayerObj.JSPlayM4_Slow()),e)}},{key:"JSPlayM4_SetIFrameDecInterval",value:function(e){return this.decInterval=e,null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetIFrameDecInterval this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetIFrameDecInterval(e):this.oJSPlayerObj.PlayM4_SetIFrameDecInterval(e)}},{key:"JSPlayM4_Pause",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_Pause this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_Pause(e):this.oJSPlayerObj.PlayM4_Pause(e)}},{key:"JSPlayM4_OneByOne",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_OneByOne this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_OneByOne():this.oJSPlayerObj.PlayM4_OneByOne(e)}},{key:"JSPlayM4_OneByOneResume",value:function(){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_OneByOneResume this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_OneByOneResume():this.oJSPlayerObj.PlayM4_Pause(!1)}},{key:"JSPlayM4_SetVolume",value:function(e){var t=1;if(null===this.oJSPlayerObj)return console.log(">>>>>yff>>> JSPlayM4_SetVolume this.oJSPlayerObj is null"),0;if(this.volume=e,this.jsplayerVersion>1)t=this.oJSPlayerObj.JSPlayM4_SetVolume(e);else{var i=e/65535*100;t=this.oJSPlayerObj.PlayM4_SetVolume(i)}return t}},{key:"JSPlayM4_GetVolume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetVolume this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?(t=this.oJSPlayerObj.JSPlayM4_GetVolume(),null!=e&&e(t)):t=this.oJSPlayerObj.PlayM4_GetVolume((function(t){null!=e&&e(t/100*65535)})),t)}},{key:"JSPlayM4_SetDisplayRegion",value:function(e,t,i,n,a){var r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=1;if(null===this.oJSPlayerObj)return console.log(">>>>>yff>>> JSPlayM4_SetDisplayRegion this.oJSPlayerObj is null"),0;if(this.jsplayerVersion>1)s=this.oJSPlayerObj.JSPlayM4_SetDisplayRegion(e,t,i,n,a,r,o);else{var l={};l.left=t,l.right=i,l.top=n,l.bottom=a,s=this.oJSPlayerObj.PlayM4_SetDisplayRegion(l,!r,o)}return s}},{key:"JSPlayM4_SetPrintLogFlag",value:function(e){return this.printfFlag=e,null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetPrintLogFlag this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetPrintLogFlag(e):this.oJSPlayerObj.PlayM4_OpenPlayerSDKPrintLog(e)}},{key:"JSPlayM4_RenderPrivateData",value:function(e,t){var i=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_RenderPrivateData this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?i=this.oJSPlayerObj.JSPlayM4_RenderPrivateData(e,t):console.log("%c1>JSPlayerV1.X does not support RenderPrivateData","color: red"),i)}},{key:"JSPlayM4_RenderPrivateDataEx",value:function(e,t,i){var n=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_RenderPrivateDataEx this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?n=this.oJSPlayerObj.JSPlayM4_RenderPrivateDataEx(e,t,i):console.log("%c1>JSPlayerV1.X does not support RenderPrivateDataEx","color: red"),n)}},{key:"JSPlayM4_SetCanvasSize",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetCanvasSize this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetCanvasSize(e,t,i):this.oJSPlayerObj.PlayM4_SetCanvasSize(e,t)}},{key:"JSPlayM4_SetDisplayBuf",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetDisplayBuf this.oJSPlayerObj is null"),0):(this.displayBuf=e,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetDisplayBuf(e):this.oJSPlayerObj.PlayM4_SetDisplayBuf(e))}},{key:"JSPlayM4_GetSourceBufferRemain",value:function(){return null===this.oJSPlayerObj?0:this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetSourceBufferRemain():this.oJSPlayerObj.PlayM4_GetInputBufSize()}},{key:"JSPlayM4_GetBufferValue",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetBufferValue this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetBufferValue(e):this.oJSPlayerObj.PlayM4_GetBufferValue(e)}},{key:"JSPlayM4_ReversePlay",value:function(){var e=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_ReversePlay this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?e=this.oJSPlayerObj.JSPlayM4_ReversePlay():console.log("%c1>JSPlayerV1.X does not support ReversePlay","color: red"),e)}},{key:"JSPlayM4_SetDecodeThreadNum",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetDecodeThreadNum this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_SetDecodeThreadNum(e):console.log("%c1>JSPlayerV1.X does not support SetDecodeThreadNum, V1.X decocde only 1 thread","color: red"),t)}},{key:"JSPlayM4_GetCanvasSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetCanvasSize this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetCanvasSize(e):this.oJSPlayerObj.PlayM4_GetCanvasSize()}},{key:"JSPlayM4_DisplayLostFrames",value:function(e,t,i){var n=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_DisplayLostFrames this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?n=this.oJSPlayerObj.JSPlayM4_DisplayLostFrames(e,t,i):console.log("%c1>JSPlayerV1.X does not support DisplayLostFrames","color: red"),n)}},{key:"JSPlayM4_SetANRParam",value:function(e,t){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetANRParam this.oJSPlayerObj is null"),0):(this.anrParamLevel=t,this.anrParamFlag=e,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetANRParam(e,t):this.oJSPlayerObj.PlayM4_SetANRParam(e,t))}},{key:"JSPlayM4_SetResampleValue",value:function(e,t){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetResampleValue this.oJSPlayerObj is null"),0):(this.resampleRate=t,this.resampleFlag=e,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetResampleValue(e,t):this.oJSPlayerObj.PlayM4_SetResampleValue(e,t))}},{key:"JSPlayM4_SetAntialias",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetAntialias this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_SetAntialias(e):console.log("%c1>JSPlayerV1.X does not support JSPlayM4_SetAntialias 20230922","color: red"),t)}},{key:"JSPlayM4_SyncToAudio",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SyncToAudio this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_SyncToAudio(e):console.log("%c1>JSPlayerV1.X does not support SyncToAudio","color: red"),t)}},{key:"JSPlayM4_SetAudioThreadModel",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetAudioThreadModel this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_SetAudioThreadModel(e):console.log("%c1>JSPlayerV1.X does not support SetAudioThreadModel","color: red"),t)}},{key:"JSPlayM4_SetDecodeERC",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetDecodeERC this.oJSPlayerObj is null"),0):(this.decodeERCLevel=e,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetDecodeERC(e):this.oJSPlayerObj.PlayM4_SetDecodeERC(e))}},{key:"JSPlayM4_SkipErrorData",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SkipErrorData this.oJSPlayerObj is null"),0):(this.skipErrorData=e,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SkipErrorData(e):this.oJSPlayerObj.PlayM4_SkipErrorData(e))}},{key:"JSPlayM4_SetDemuxModel",value:function(e,t){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetDemuxModel this.oJSPlayerObj is null"),0):(this.demuxModelType=e,this.demuxModeFlag=t,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetDemuxModel(e,t):this.oJSPlayerObj.PlayM4_SetDemuxModel(e,t))}},{key:"JSPlayM4_SetD3DPostProcess",value:function(e,t){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetD3DPostProcess this.oJSPlayerObj is null"),0):"number"!=typeof e||"number"!=typeof t?(console.log(">>>>>yff>>> JSPlayM4_SetD3DPostProcess nPostType or fValue is not number"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetD3DPostProcess(e,t):this.oJSPlayerObj.PlayM4_SetD3DPostProcess(e,t)}},{key:"JSPlayM4_SetFirstFrameCallBack",value:function(e,t){return this.needSetFFCB=!0,this.FFCBFlag=e,this.firstFrameCB=t,null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetFirstFrameCallBack this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetFirstFrameCallBack(e,t):this.oJSPlayerObj.PlayM4_SetFirstFrameCallBack(e,t)}},{key:"JSPlayM4_SetDecCallBack",value:function(e,t){return null===this.oJSPlayerObj||"function"!=typeof t?(console.log(">>>>>yff>>> JSPlayM4_SetDecCallBack this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetDecCallBack(e,t):this.oJSPlayerObj.PlayM4_SetDecCallBack(e,t)}},{key:"JSPlayM4_SetDisplayCallBack",value:function(e,t){return null===this.oJSPlayerObj||"function"!=typeof t?(console.log(">>>>>yff>>> JSPlayM4_SetDisplayCallBack this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetDisplayCallBack(e,t):this.oJSPlayerObj.PlayM4_SetDisplayCallBack(t)}},{key:"JSPlayM4_SetFrameInfoCallBack",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetFrameInfoCallBack this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetFrameInfoCallBack(e):this.oJSPlayerObj.PlayM4_SetFrameInfoCallBack(e)}},{key:"JSPlayM4_SetDecCBStream",value:function(e){return null===this.oJSPlayerObj||e<1||e>3?(console.log(">>>>>yff>>> JSPlayM4_SetDecCBStream this.oJSPlayerObj is null stream:"+e),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetDecCBStream(e):this.oJSPlayerObj.PlayM4_SetDecCBStream(e)}},{key:"JSPlayM4_GetFrameInfo",value:function(){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetFrameInfo this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetFrameInfo():this.oJSPlayerObj.PlayM4_GetFrameInfo()}},{key:"JSPlayM4_GetAdditionData",value:function(){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetAdditionData this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetAdditionData():(console.log("%c1>JSPlayerV1.X does not support GetAdditionData","color: red"),0)}},{key:"JSPlayM4_SetAdditionDataCallBack",value:function(e,t,i){var n=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetAdditionDataCallBack this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?n=this.oJSPlayerObj.JSPlayM4_SetAdditionDataCallBack(e,t,i):(console.log("%c1>JSPlayerV1.X does not support SetAdditionDataCallBack","color: red"),n=0),n)}},{key:"JSPlayM4_GetPlayedTimeEx",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetPlayedTimeEx this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_GetPlayedTimeEx(e):this.oJSPlayerObj.PlayM4_GetPlayedTimeEx(e)}},{key:"JSPlayM4_GetFileTime",value:function(){var e=0;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetFileTime this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?e=this.oJSPlayerObj.JSPlayM4_GetFileTime():console.log("%c1>JSPlayerV1.X does not support GetPlayedTimeEx","color: red"),1e3*e)}},{key:"JSPlayM4_GetMpOffset",value:function(e){var t=-1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetMpOffset this.oJSPlayerObj is null"),-1):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_GetMpOffset(e):console.log("%c1>JSPlayerV1.X does not support GetMpOffset","color: red"),t)}},{key:"JSPlayM4_ResetBuffer",value:function(e){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_ResetBuffer this.oJSPlayerObj is null"),0):(this.needResetBuffer=!0,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_ResetBuffer(e):this.oJSPlayerObj.PlayM4_ReleaseInputBuffer())}},{key:"JSPlayM4_SetGlobalBaseTime",value:function(e,t,i,n,a,r,o){return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetGlobalBaseTime this.oJSPlayerObj is null"),0):(this.globalBaseTime={year:e,month:t,day:i,hour:n,min:a,sec:r,ms:o},this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetGlobalBaseTime(e,t,i,n,a,r,o):this.oJSPlayerObj.PlayM4_SetGlobalBaseTime(e,t,i,n,a,r,o))}},{key:"JSPlayM4_SetSecretKey",value:function(e){return this.needSetSecretKey=!0,this.keyData=e,null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetSecretKey this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetSecretKey(e):this.oJSPlayerObj.PlayM4_SetSecretKey(1,e,128)}},{key:"JSPlayM4_SetRunTimeInfoCallBackEx",value:function(e,t){return this.runtimeModule=e,this.runtimeCBFun=t,this.needSetRunTimeInfoCB=!0,null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetRunTimeInfoCallBackEx this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetRunTimeInfoCallBackEx(e,t):this.oJSPlayerObj.PlayM4_SetRunTimeInfoCallBackEx(e,t)}},{key:"JSPlayM4_SetPlayOrBackSwitchMode",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetPlayOrBackSwitchMode this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_SetPlayOrBackSwitchMode(e):console.log("%c1>JSPlayerV1.X does not support SetPlayOrBackSwitchMode","color: red"),t)}},{key:"JSPlayM4_SetStretchPlay",value:function(e,t){var i=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetStretchPlay this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?i=this.oJSPlayerObj.JSPlayM4_SetStretchPlay(e,t):console.log("%c1>JSPlayerV1.X does not support SetStretchPlay","color: red"),i)}},{key:"JSPlayM4_SetAutoSmoothPlay",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetAutoSmoothPlay this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_SetAutoSmoothPlay(e):console.log("%c1>JSPlayerV1.X does not support SetAutoSmoothPlay","color: red"),t)}},{key:"JSPlayM4_KeepPlaySpeed",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_KeepPlaySpeed this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_KeepPlaySpeed(e):console.log("%c1>JSPlayerV1.X does not support KeepPlaySpeed","color: red"),t)}},{key:"JSPlayM4_IgnoreHeaderAudioDefine",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_IgnoreHeaderAudioDefine this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_IgnoreHeaderAudioDefine(e):console.log("%c1>JSPlayerV1.X does not support IgnoreHeaderAudioDefine","color: red"),t)}},{key:"JSPlayM4_SetSycGroup",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetSycGroup this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_SetSycGroup(e):console.log("%c1>JSPlayerV1.X does not support SetSycGroup","color: red"),t)}},{key:"JSPlayM4_FEC_SetCanvasID",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=1;return this.FECcanvasIDArray=e.split(","),null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_SetCanvasID this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_FEC_SetCanvasID(e):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red"),t)}},{key:"JSPlayM4_FEC_ResetCorrectType",value:function(e,t,i){var n=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_ResetCorrectType this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?n=this.oJSPlayerObj.JSPlayM4_FEC_ResetCorrectType(e,t,i):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red"),n)}},{key:"JSPlayM4_FEC_GetPort",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_GetPort this.oJSPlayerObj is null"),-1):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_FEC_GetPort(e,t,i):-1}},{key:"JSPlayM4_FEC_Enable",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_Enable this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_FEC_Enable(e):console.log("%c1>JSPlayerV1.X does not support  FEC 20230922","color: red"),t)}},{key:"JSPlayM4_FEC_SetParam",value:function(e,t){var i=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_SetParam this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?i=this.oJSPlayerObj.JSPlayM4_FEC_SetParam(e,t):console.log("%c1>JSPlayerV1.X does not support  FEC 20230922","color: red"),i)}},{key:"JSPlayM4_FEC_GetParam",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_GetParam this.oJSPlayerObj is null"),0):this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_FEC_GetParam(e,t):(console.log("%c1>JSPlayerV1.X does not support  FEC 20230922","color: red"),1)}},{key:"JSPlayM4_FEC_SetViewParam",value:function(e,t,i){var n=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_SetViewParam this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?n=this.oJSPlayerObj.JSPlayM4_FEC_SetViewParam(e,t,i):console.log("%c1>JSPlayerV1.X does not support  FEC 20230922","color: red"),n)}},{key:"JSPlayM4_FEC_GetViewParam",value:function(e,t,i){var n=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_GetViewParam this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?n=this.oJSPlayerObj.JSPlayM4_FEC_GetViewParam(e,t,i):console.log("%c1>JSPlayerV1.X does not support  FEC 20230922","color: red"),n)}},{key:"JSPlayM4_FEC_SetWnd",value:function(e,t){var i=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_SetWnd this.oJSPlayerObj is null"),0):(this.CanvasSubPortMap.set(e,t),this.jsplayerVersion>1?i=this.oJSPlayerObj.JSPlayM4_FEC_SetWnd(e,t):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red"),i)}},{key:"JSPlayM4_FEC_Disable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_Disable this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?n=this.oJSPlayerObj.JSPlayM4_FEC_Disable(e,t,i):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red"),n)}},{key:"JSPlayM4_FEC_DelPort",value:function(e){var t=1;if(null===this.oJSPlayerObj)return console.log(">>>>>yff>>> JSPlayM4_FEC_DelPort this.oJSPlayerObj is null"),0;var i=this.CanvasSubPortMap.get(e);this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_FEC_DelPort(e):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red");var n=document.getElementById(i);if(n){var a=n.cloneNode(!0);n.parentNode.replaceChild(a,n)}return this.CanvasSubPortMap.delete(e),t}},{key:"JSPlayM4_FEC_SetDisplayRegion",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_SetDisplayRegion this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?s=this.oJSPlayerObj.JSPlayM4_FEC_SetDisplayRegion(e,t,i,n,a,r,o):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red"),s)}},{key:"JSPlayM4_FEC_SetBackCilling",value:function(e,t){var i=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_SetBackCilling this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?i=this.oJSPlayerObj.JSPlayM4_FEC_SetBackCilling(e,t):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red"),i)}},{key:"JSPlayM4_FEC_GetPTZPort",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=-1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_GetPTZPort this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?a=this.oJSPlayerObj.JSPlayM4_FEC_GetPTZPort(e,t,i,n):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red"),a)}},{key:"JSPlayM4_FEC_SetPTZDisplayMode",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_FEC_SetPTZDisplayMode this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?t=this.oJSPlayerObj.JSPlayM4_FEC_SetPTZDisplayMode(e):console.log("%c1>JSPlayerV1.X does not support FEC 20230922","color: red"),t)}},{key:"JSPlayM4_SetVideoCropInfo",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetVideoCropInfo this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?console.log("%c1>JSPlayerV3.X does not support SetVideoCropInfo,","color: red"):t=this.oJSPlayerObj.PlayM4_SetVideoCropInfo(e),t)}},{key:"JSPlayM4_IsVisible",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_IsVisible this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?console.log("%c1>JSPlayerV3.X does not support IsVisible,","color: red"):t=this.oJSPlayerObj.PlayM4_IsVisible(e),t)}},{key:"JSPlayM4_SetInputBufSize",value:function(e){var t=1;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_SetInputBufSize this.oJSPlayerObj is null"),0):(this.inputBufSize=e,this.jsplayerVersion>1?console.log("%c1>JSPlayerV3.X does not support SetInputBufSize,","color: red"):t=this.oJSPlayerObj.PlayM4_SetInputBufSize(e),t)}},{key:"JSPlayM4_GetYUVBufSize",value:function(){var e=0;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetYUVBufSize this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?console.log("%c1>JSPlayerV3.X does not support GetYUVBufSize,","color: red"):e=this.oJSPlayerObj.PlayM4_GetYUVBufSize(),e)}},{key:"JSPlayM4_ClearCanvas",value:function(){var e=0;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_ClearCanvas this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?console.log("%c1>JSPlayerV3.X does not support ClearCanvas,","color: red"):e=this.oJSPlayerObj.PlayM4_ClearCanvas(),e)}},{key:"JSPlayM4_ReleaseInputBuffer",value:function(){var e=0;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_ReleaseInputBuffer this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?console.log("%c1>JSPlayerV3.X does not support ReleaseInputBuffer,","color: red"):e=this.oJSPlayerObj.PlayM4_ReleaseInputBuffer(),e)}},{key:"JSPlayM4_GetDecodeFrameType",value:function(){var e=0;return null===this.oJSPlayerObj?(console.log(">>>>>yff>>> JSPlayM4_GetDecodeFrameType this.oJSPlayerObj is null"),0):(this.jsplayerVersion>1?console.log("%c1>JSPlayerV3.X does not support GetDecodeFrameType,","color: red"):e=this.oJSPlayerObj.PlayM4_GetDecodeFrameType(),e)}},{key:"JSPlayM4_SetWaterMarkFont",value:function(e){if(null===this.oJSPlayerObj)return console.log(">>>>>yff>>> JSPlayM4_SetWaterMarkFont this.oJSPlayerObj is null"),0;if(null!=e){if(void 0===e.pFontString||null==e.pstStartPos||null==e.pstFontColor||null==e.pstFontSize||null==e.pstFontRotate||null==e.pFontFamily||null==e.pstStartPos.fX||null==e.pstStartPos.fY||null==e.pstFontColor.fR||null==e.pstFontColor.fG||null==e.pstFontColor.fB||null==e.pstFontColor.fA||null==e.pstFontSize.nFontWidth||null==e.pstFontSize.nFontHeight||null==e.pstFontRotate.fRotateAngle||null==e.pstFontRotate.fFillFullScreen||null==e.pSpace)return console.log(">>>>>yff>>> JSPlayM4_SetWaterMarkFont pFontParam undefined"),0;if(e.pstStartPos.fX>1||e.pstStartPos.fX<0||e.pstStartPos.fY>1||e.pstStartPos.fY<0||e.pstFontColor.fR>1||e.pstFontColor.fR<0||e.pstFontColor.fG>1||e.pstFontColor.fG<0||e.pstFontColor.fB>1||e.pstFontColor.fB<0||e.pstFontColor.fA>1||e.pstFontColor.fA<0)return console.log(">>>>>yff>>> JSPlayM4_SetWaterMarkFont pFontParam f* is 0~1"),0;if(1!=e.pstFontRotate.fFillFullScreen&&0!=e.pstFontRotate.fFillFullScreen&&1!=e.pstFontRotate.fFillFullScreen&&0!=e.pstFontRotate.fFillFullScreen)return console.log(">>>>>yff>>> pFontParam.pstFontRotate.fFillFullScreen is true or false"),0;if(e.pstFontRotate.fFillFullScreen&&(e.pstFontNumber.nRowNumber<3||e.pstFontNumber.nColNumber<3||null==e.pstFontNumber.nRowNumber||null==e.pstFontNumber.nColNumber||e.pstFontNumber.nRowNumber>13||e.pstFontNumber.nColNumber>13))return console.log(">>>>>yff>>> pFontParam.pstFontNumber row/col num should be greater than 2 and les than 13"),0;if("string"!=typeof e.pFontFamily)return console.log(">>>>>yff>>> pFontParam.pFontFamily is not string"),0;if(!Array.isArray(e.pFontString))return console.log(">>>>>yff>>> pFontParam.pFontString is not array"),0;(e.pstFontSize.nFontHeight<=0||e.pstFontSize.nFontWidth<=0)&&(e=null),null!=e.nFontAlign&&null!=e.nFontAlign||(e.nFontAlign=0),null!=e.nColorAdapt&&null!=e.nColorAdapt||(e.nColorAdapt=0)}return this.waterFontParam=e,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetWaterMarkFont(e):this.oJSPlayerObj.PlayM4_SetWaterMarkFont(e)}},{key:"JSPlayM4_SetWaterMarkImage",value:function(e){if(null===this.oJSPlayerObj)return console.log(">>>>>yff>>> JSPlayM4_SetWaterMarkImage this.oJSPlayerObj is null"),0;if(!("ImageDecoder"in window))return console.log(">>>>>yff>>> window not support ImageDecoder"),16;if(null!=e){if(void 0===e.pImageData)return console.log(">>>>>yff>>> JSPlayM4_SetWaterMarkImage pImageParam.pImageData undefined"),0;if(void 0===e.pImageType||"jpg"!=e.pImageType&&"jpeg"!=e.pImageType&&"png"!=e.pImageType&&"gif"!=e.pImageType&&"bmp"!=e.pImageType&&"webp"!=e.pImageType&&"avif"!=e.pImageType)return console.log(">>>>>yff>>> JSPlayM4_SetWaterMarkImage pImageParam.pImageType:"+e.pImageType+" error"),0;(void 0===e.pstRectPos||e.fLeft<0||e.fLeft>1||e.fRight<0||e.fRight>1||e.fTop<0||e.fTop>1||e.fBottom<0||e.fBottom>1)&&(e.pstRectPos={fLeft:0,fRight:.1,fTop:0,fBottom:.1}),(void 0===e.fAlpha||e.fAlpha<0||e.fAlpha>1)&&(e.fAlpha=1)}return this.waterImageParam=e,this.jsplayerVersion>1?this.oJSPlayerObj.JSPlayM4_SetWaterMarkImage(e):this.oJSPlayerObj.PlayM4_SetWaterMarkImage(e)}},{key:"_downloadFile",value:function(e,t){var i=e;r(e,Blob)||r(e,File)||(i=new Blob([e]));var n=window.URL.createObjectURL(i),a=window.document.createElement("a");a.href=n,a.download=t;var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!0),a.dispatchEvent(o)}},{key:"downloadRTPData",value:function(e){if(this.bWriteData){var t=e,i=this.aTotalBuffer.length;console.log("totalLength:"+i);for(var n=0,a=t.length;n<a;n++)this.aTotalBuffer[i+n]=t[n];this.iFrameNum++,t=null,console.log("download200RTPdata iFrameNum:"+this.iFrameNum)}if(this.bWriteData&&this.iFrameNum>=100){console.log("download100RawData");var r=new Uint8Array(this.aTotalBuffer);this._downloadFile(r,"Raw100.data"),this.aTotalBuffer.splice(0,this.aTotalBuffer.length),this.bWriteData=!1,this.iFrameNum=0,r=null}}}]),t}();window._getFExplore=function(){var e,t={},i=navigator.userAgent.toLowerCase();if((e=i.match(/rv:([\d.]+)\) like gecko/))||(e=i.match(/msie ([\d\.]+)/))?t.ie=e[1]:(e=i.match(/edge\/([\d\.]+)/))?t.edge=e[1]:(e=i.match(/firefox\/([\d\.]+)/))?t.firefox=e[1]:(e=i.match(/(?:opera|opr).([\d\.]+)/))?t.opera=e[1]:(e=i.match(/chrome\/([\d\.]+)/))?t.chrome=e[1]:(e=i.match(/version\/([\d\.]+).*safari/))&&(t.safari=e[1]),t.chrome){var n=t.chrome,a=n.indexOf(".");return Number(n.substring(0,a))}return t.ie?console.info("%c1>your browser is IE ,it does not support play without plugin","color: red"):t.safari?console.info("%c1>your browser is safari","color: red"):t.firefox?console.info("%c1>your browser is Firefox","color: red"):console.info("%c1>your browser does not support play without plugin","color: red"),-1},window._getFSupportWebCodecs=function(){return"undefined"!=typeof MediaMetadata&&"undefined"!=typeof MediaRecorder&&"undefined"!=typeof VideoDecoder},window._getFSupportSIMD=function(){return new Promise((function(e,t){Xe().then((function(i){i?e():t()}))}))}}(),s}()}();var Wu=Zu.exports.JSPlayCtrl,Gu={exports:{}};!function(e,t){function i(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}!function(n,a){var r="function",o="undefined",s="object",l="string",c="major",d="model",u="name",h="type",f="vendor",x="version",p="architecture",m="console",_="mobile",g="tablet",v="smarttv",y="wearable",S="embedded",b="Amazon",P="Apple",E="ASUS",C="BlackBerry",T="Browser",R="Chrome",w="Firefox",I="Google",D="Huawei",k="LG",F="Microsoft",A="Motorola",M="Opera",L="Samsung",B="Sharp",O="Sony",j="Xiaomi",N="Zebra",U="Facebook",z="Chromium OS",H="Mac OS",V=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},Z=function(e,t){return(void 0===e?"undefined":i(e))===l&&-1!==W(t).indexOf(W(e))},W=function(e){return e.toLowerCase()},G=function(e,t){if((void 0===e?"undefined":i(e))===l)return e=e.replace(/^\s\s*/,""),(void 0===t?"undefined":i(t))===o?e:e.substring(0,500)},Y=function(e,t){for(var n,o,l,c,d,u,h=0;h<t.length&&!d;){var f=t[h],x=t[h+1];for(n=o=0;n<f.length&&!d&&f[n];)if(d=f[n++].exec(e))for(l=0;l<x.length;l++)u=d[++o],(void 0===(c=x[l])?"undefined":i(c))===s&&c.length>0?2===c.length?i(c[1])==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?i(c[1])!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):a:this[c[0]]=u?c[1].call(this,u,c[2]):a:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):a):this[c]=u||a;h+=2}},X=function(e,t){for(var n in t)if(i(t[n])===s&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Z(t[n][r],e))return"?"===n?a:n}else if(Z(t[n],e))return"?"===n?a:n;return e},J={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},q={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[x,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[x,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,x],[/opios[\/ ]+([\w\.]+)/i],[x,[u,M+" Mini"]],[/\bopr\/([\w\.]+)/i],[x,[u,M]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[x,[u,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,x],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[x,[u,"UC"+T]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[x,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[x,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[x,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[x,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[x,[u,"Smart Lenovo "+T]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+T],x],[/\bfocus\/([\w\.]+)/i],[x,[u,w+" Focus"]],[/\bopt\/([\w\.]+)/i],[x,[u,M+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[x,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[x,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[x,[u,M+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[x,[u,"MIUI "+T]],[/fxios\/([-\w\.]+)/i],[x,[u,w]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+T]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+T],x],[/samsungbrowser\/([\w\.]+)/i],[x,[u,L+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],x],[/metasr[\/ ]?([\d\.]+)/i],[x,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],x],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[u,x],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,U],x],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[u,x],[/\bgsa\/([\w\.]+) .*safari\//i],[x,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[x,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[x,[u,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,R+" WebView"],x],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[x,[u,"Android "+T]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,x],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[x,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[x,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[x,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,x],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],x],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[x,[u,w+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[u,x],[/(cobalt)\/([\w\.]+)/i],[u,[x,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,W]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",W]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,W]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[f,L],[h,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[f,L],[h,_]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[f,P],[h,_]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[f,P],[h,g]],[/(macintosh);/i],[d,[f,P]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[f,B],[h,_]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[f,D],[h,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[f,D],[h,_]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[f,j],[h,_]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[f,j],[h,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[f,"OPPO"],[h,_]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[f,"Vivo"],[h,_]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[f,"Realme"],[h,_]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[f,A],[h,_]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[f,A],[h,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[f,k],[h,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[f,k],[h,_]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[f,"Lenovo"],[h,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[f,"Nokia"],[h,_]],[/(pixel c)\b/i],[d,[f,I],[h,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[f,I],[h,_]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[f,O],[h,_]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[f,O],[h,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[f,"OnePlus"],[h,_]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[f,b],[h,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[f,b],[h,_]],[/(playbook);[-\w\),; ]+(rim)/i],[d,f,[h,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[f,C],[h,_]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[f,E],[h,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[f,E],[h,_]],[/(nexus 9)/i],[d,[f,"HTC"],[h,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[d,/_/g," "],[h,_]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[f,"Acer"],[h,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[f,"Meizu"],[h,_]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[f,"Ulefone"],[h,_]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,d,[h,_]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,d,[h,g]],[/(surface duo)/i],[d,[f,F],[h,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[f,"Fairphone"],[h,_]],[/(u304aa)/i],[d,[f,"AT&T"],[h,_]],[/\bsie-(\w*)/i],[d,[f,"Siemens"],[h,_]],[/\b(rct\w+) b/i],[d,[f,"RCA"],[h,g]],[/\b(venue[\d ]{2,7}) b/i],[d,[f,"Dell"],[h,g]],[/\b(q(?:mv|ta)\w+) b/i],[d,[f,"Verizon"],[h,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[f,"Barnes & Noble"],[h,g]],[/\b(tm\d{3}\w+) b/i],[d,[f,"NuVision"],[h,g]],[/\b(k88) b/i],[d,[f,"ZTE"],[h,g]],[/\b(nx\d{3}j) b/i],[d,[f,"ZTE"],[h,_]],[/\b(gen\d{3}) b.+49h/i],[d,[f,"Swiss"],[h,_]],[/\b(zur\d{3}) b/i],[d,[f,"Swiss"],[h,g]],[/\b((zeki)?tb.*\b) b/i],[d,[f,"Zeki"],[h,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],d,[h,g]],[/\b(ns-?\w{0,9}) b/i],[d,[f,"Insignia"],[h,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[f,"NextBook"],[h,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],d,[h,_]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],d,[h,_]],[/\b(ph-1) /i],[d,[f,"Essential"],[h,_]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[f,"Envizen"],[h,g]],[/\b(trio[-\w\. ]+) b/i],[d,[f,"MachSpeed"],[h,g]],[/\btu_(1491) b/i],[d,[f,"Rotor"],[h,g]],[/(shield[\w ]+) b/i],[d,[f,"Nvidia"],[h,g]],[/(sprint) (\w+)/i],[f,d,[h,_]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[f,F],[h,_]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[f,N],[h,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[f,N],[h,_]],[/smart-tv.+(samsung)/i],[f,[h,v]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[f,L],[h,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,k],[h,v]],[/(apple) ?tv/i],[f,[d,P+" TV"],[h,v]],[/crkey/i],[[d,R+"cast"],[f,I],[h,v]],[/droid.+aft(\w+)( bui|\))/i],[d,[f,b],[h,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[f,B],[h,v]],[/(bravia[\w ]+)( bui|\))/i],[d,[f,O],[h,v]],[/(mitv-\w{5}) bui/i],[d,[f,j],[h,v]],[/Hbbtv.*(technisat) (.*);/i],[f,d,[h,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,G],[d,G],[h,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,d,[h,m]],[/droid.+; (shield) bui/i],[d,[f,"Nvidia"],[h,m]],[/(playstation [345portablevi]+)/i],[d,[f,O],[h,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[f,F],[h,m]],[/((pebble))app/i],[f,d,[h,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[f,P],[h,y]],[/droid.+; (glass) \d/i],[d,[f,I],[h,y]],[/droid.+; (wt63?0{2,3})\)/i],[d,[f,N],[h,y]],[/(quest( 2| pro)?)/i],[d,[f,U],[h,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[h,S]],[/(aeobc)\b/i],[d,[f,b],[h,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[h,_]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[h,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,_]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[x,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[x,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,x],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[x,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,x],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[x,X,J]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[x,X,J],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[x,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,H],[x,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[x,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,x],[/\(bb(10);/i],[x,[u,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[x,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[x,[u,w+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[x,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[x,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[x,[u,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,z],x],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,x],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],x],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,x]]},K=function(e,t){if((void 0===e?"undefined":i(e))===s&&(t=e,e=a),this,!(null!=(m=K)&&"undefined"!=typeof Symbol&&m[Symbol.hasInstance]?m[Symbol.hasInstance](this):this instanceof m))return new K(e,t).getResult();var m,v=(void 0===n?"undefined":i(n))!==o&&n.navigator?n.navigator:a,y=e||(v&&v.userAgent?v.userAgent:""),S=v&&v.userAgentData?v.userAgentData:a,b=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(q,t):q,P=v&&v.userAgent==y;return this.getBrowser=function(){var e,t={};return t[u]=a,t[x]=a,Y.call(t,y,b.browser),t[c]=(void 0===(e=t[x])?"undefined":i(e))===l?e.replace(/[^\d\.]/g,"").split(".")[0]:a,P&&v&&v.brave&&i(v.brave.isBrave)==r&&(t[u]="Brave"),t},this.getCPU=function(){var e={};return e[p]=a,Y.call(e,y,b.cpu),e},this.getDevice=function(){var e={};return e[f]=a,e[d]=a,e[h]=a,Y.call(e,y,b.device),P&&!e[h]&&S&&S.mobile&&(e[h]=_),P&&"Macintosh"==e[d]&&v&&i(v.standalone)!==o&&v.maxTouchPoints&&v.maxTouchPoints>2&&(e[d]="iPad",e[h]=g),e},this.getEngine=function(){var e={};return e[u]=a,e[x]=a,Y.call(e,y,b.engine),e},this.getOS=function(){var e={};return e[u]=a,e[x]=a,Y.call(e,y,b.os),P&&!e[u]&&S&&"Unknown"!=S.platform&&(e[u]=S.platform.replace(/chrome os/i,z).replace(/macos/i,H)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(e){return y=(void 0===e?"undefined":i(e))===l&&e.length>500?G(e,500):e,this},this.setUA(y),this};K.VERSION="0.7.37",K.BROWSER=V([u,x,c]),K.CPU=V([p]),K.DEVICE=V([d,f,h,m,_,v,g,y,S]),K.ENGINE=K.OS=V([u,x]),i(t)!==o?(i(e)!==o&&e.exports&&(t=e.exports=K),t.UAParser=K):(void 0===n?"undefined":i(n))!==o&&(n.UAParser=K);var $=(void 0===n?"undefined":i(n))!==o&&(n.jQuery||n.Zepto);if($&&!$.ua){var Q=new K;$.ua=Q.getResult(),$.ua.get=function(){return Q.getUA()},$.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var i in t)$.ua[i]=t[i]}}}("object"==typeof window?window:Ct)}(Gu,Gu.exports);var Yu=Tt(Gu.exports);function Xu(e,t,i){return Xu=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return i&&Ju(a,i.prototype),a},Xu.apply(null,arguments)}function Ju(e,t){return Ju=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ju(e,t)}function qu(e){return e.logger.log("player engine start init"),function(e){var t,i,n,a=(null!=(n=null==(t=e._options.staticPath)?void 0:t.replace(/\/$/,""))?n:"")+"/PlayCtrlWasm",r=a+"/playCtrl3/hasWorker/HasSIMD/Decoder.js",o=a+"/playCtrl1/HasSIMD/Decoder.js";window.SharedArrayBuffer||(r=a+"/playCtrl3/noWorker/Decoder.js");var s=function(){var e=new Yu;if(null==e?void 0:e.getResult){var t,i,n=(null==e?void 0:e.getResult())||{};if(n.browser&&"Chrome"===n.browser.name&&(!["120","118"].includes(null==(t=n.browser)?void 0:t.major)||"macOS"!==(null==(i=n.os)?void 0:i.name)))return!0}return!1}(),l=function(t,i,n,a){return void 0===t&&(t=0),void 0===i&&(i="webgl"),void 0===n&&(n=0),void 0===a&&(a=0),new Promise((function(l){var c=e._options.decoderType,d=[!Xc()&&s&&["auto","v3"].includes(c)?r:null,o];e.wasmplayer=Xu(Wu,[].concat(d,[function(t){"loaded"===t.cmd&&(e.logger.log("init wasm cmd:",t.cmd),window.JSPlayerModuleLoaded=!0),e._decoderStatus=t,l(t)},t,i,n,a])),window["wasmplayer-"+e._options.id]=e.wasmplayer}))};return null==(i=window)?void 0:i._getFSupportSIMD().then((function(){return l()}),(function(){return r=a+"/playCtrl3/hasWorker/NoSIMD/Decoder.js",o=a+"/playCtrl1/NoSIMD/Decoder.js",l()}))}(e).then((function(t){return e.logger.log("player engine init success"),t}))}var Ku={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function a(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,o),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,a=[];if(0===this._eventsCount)return a;for(n in e=this._events)t.call(e,n)&&a.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,r=n.length,o=new Array(r);a<r;a++)o[a]=n[a].fn;return o},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,a,r,o){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,d=this._events[s],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,a),!0;case 5:return d.fn.call(d.context,t,n,a,r),!0;case 6:return d.fn.call(d.context,t,n,a,r,o),!0}for(c=1,l=new Array(u-1);c<u;c++)l[c-1]=arguments[c];d.fn.apply(d.context,l)}else{var h,f=d.length;for(c=0;c<f;c++)switch(d[c].once&&this.removeListener(e,d[c].fn,void 0,!0),u){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,t);break;case 3:d[c].fn.call(d[c].context,t,n);break;case 4:d[c].fn.call(d[c].context,t,n,a);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];d[c].fn.apply(d[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,a){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var s=this._events[r];if(s.fn)s.fn!==t||a&&!s.once||n&&s.context!==n||o(this,r);else{for(var l=0,c=[],d=s.length;l<d;l++)(s[l].fn!==t||a&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[r]=1===c.length?c[0]:c:o(this,r)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}(Ku);var $u=Tt(Ku.exports);Date.prototype.Format=function(e){var t={"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 i in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?t[i]:("00"+t[i]).substr((""+t[i]).length)));return e};var Qu=function(e,t){var i=new RegExp("(\\?|#|&)"+e+"=(.*?)(#|&|$)"),n=(t||window.location.href).match(i);return decodeURIComponent(n?n[2]:"")},eh=function(e,t){var i=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=t.match(i);return null!=n?unescape(n[2]):null};function th(e,t){if(/^[0-9]{8}T[0-9]{6}Z$/.test(e))return e;if(/[0-9]{8,14}/.test(e)){var i=6-(14-e.length),n=t.length,a=e+t.substring(i,n);return a.slice(0,8)+"T"+a.slice(8)+"Z"}throw new Error("回放时间格式有误,请确认")}function ih(e){var t=e.slice(0,4),i=e.slice(4,6),n=e.slice(6,8),a=e.slice(9,11),r=e.slice(11,13),o=e.slice(13,15);return new Date((t+"-"+i+"-"+n+" "+a+":"+r+":"+o).replace(/-/g,"/")).getTime()}function nh(e){var t=[];return e.forEach((function(e){0===t.length||e.downloadPath!==t[t.length-1].downloadPath?t.push({downloadPath:e.downloadPath,ownerId:e.ownerId,iStorageVersion:e.iStorageVersion,videoType:e.videoType,iPlaySpeed:0,startTime:e.startTime,endTime:e.endTime}):t[t.length-1].endTime=e.endTime})),t}function ah(e){var t=e.wasmplayer;t&&t.JSPlayM4_CloseStream(),e.playing=!1}function rh(e,t,i,n){return e._playerWindow.reRenderCanvas(),e._wss_info={wssUrl:t,oParams:i},new Promise((function(t,i){e._oStreamClient.stopAll(),null===e._g_port&&(e._g_port=e.wasmplayer.JSPlayM4_GetPort(),e.logger.log("1.获取播放库端口号 g_port:"+e._g_port)),e.event.emit(pd,cd({type:md.openStreamCallback,data:null})),lh(e).then(t,i)}))}var oh=!0,sh=!0;function lh(e,t){return new Promise((function(i,n){e._oStreamClient.openStream(e._wss_info.wssUrl,e._wss_info.oParams,(function(n){if(n.errorCode&&"1"!=n.errorCode&&e.event.emit(pd,cd({type:md.pluginErrorHandler,iWndIndex:0,code:n.errorCode,data:n})),null==n?void 0:n.bHead){var a;if(e.event.emit(pd,cd({type:md.getStreamHeaderCallback})),"resume"!==t&&function(e,t){var i=e.wasmplayer,n=i.JSPlayM4_OpenStream(t,40,4194304);e.event.emit("PlayM4_openStream",cd(t)),i.JSPlayM4_SetFirstFrameCallBack(1,(function(){e.event.emit("firstFrameCallBack",cd(null))})),i.JSPlayM4_SetRunTimeInfoCallBackEx(1,(function(t,i,n,a,r){e.event.emit(pd,cd({type:md.setRunTimeInfoCallBack,data:{nRunTimeModule:t,nStrVersion:i,nFrameTimeStamp:n,nFrameNum:a,nErrorCode:r}}))})),e.logger.log("3.打开流 resO:"+n)}(e,null==n?void 0:n.buf),e._aHead=new Uint8Array(n.buf),"resume"===t&&((null==e||null==(a=e.urlInfo)?void 0:a.validateCode)?e.setSecretKey(e.urlInfo.validateCode):e._secretKey&&e.setSecretKey(e._secretKey)),"resume"!==t){var r;try{var o,s=function(e){return{year:parseInt(e.slice(0,4)),month:parseInt(e.slice(4,6)),day:parseInt(e.slice(6,8)),hour:parseInt(e.slice(9,11)),min:parseInt(e.slice(11,13)),second:parseInt(e.slice(13,15))+3}}(Qu("begin",null==(o=e._wss_info.oParams)?void 0:o.playURL));if(!isNaN(s.year)){var l=e.wasmplayer.JSPlayM4_SetGlobalBaseTime(s.year,s.month,s.day,s.hour,s.min,s.second,0);e.logger.log("设置OSD时间res:",l)}}catch(t){e.logger.error("JSPlayM4_SetGlobalBaseTime:",t)}if(e.playing=!0,1!=+e.wasmplayer.JSPlayM4_SetFrameInfoCallBack(1)){var c=e.wasmplayer.JSPlayM4_GetLastError();e.logger.error("resFrameInfoError:",c)}e.wasmplayer.JSPlayM4_RenderPrivateData(4,1),oh=!0,sh=!0,e.event.emit("JSPlayM4_Play_Before",cd(void 0)),(null==e||null==(r=e.urlInfo)?void 0:r.validateCode)?e.setSecretKey(e.urlInfo.validateCode):e._secretKey&&e.setSecretKey(e._secretKey);var d=e.wasmplayer.JSPlayM4_Play(e._playerWindow.canvasId);e.event.emit("JSPlayM4_Play_After",cd(void 0)),e.logger.log("4.开始播放 resP:"+d,e._playerWindow.canvasId),i(d)}}else{sh&&(sh=!1,e.event.emit(pd,cd({type:md.getVideoStreamCallback}))),oh&&e.wasmplayer.JSPlayM4_GetFrameInfo().width&&(e.event.emit(pd,cd({type:md.appearFirstFrameCallback})),e.event.emit(pd,cd({type:md.averageStreamSuccessCallback})),oh=!1);var u=new Uint8Array(n.buf);n.statusString?e.event.emit(pd,cd({type:md.pluginErrorHandler,iWndIndex:0,code:1001,data:n})):n.type&&"exception"===n.type&&e.event.emit(pd,cd({type:md.pluginErrorHandler,iWndIndex:0,code:1002,data:n})),e.wasmplayer.JSPlayM4_InputData(u,u.length),u=null}"resume"!==t&&(e.playing=!0),e.event.emit("recordInputData",cd(n.buf))}),(function(){e.playing&&e.event.emit(pd,cd({type:md.pluginErrorHandler,iWndIndex:0,code:1003})),e.playing=!1,n()})).then((function(){e._oStreamClient.startPlay().then((function(){if("resume"===t){var a=e.wasmplayer.JSPlayM4_Pause(0);a?(e.playing=!0,e._tempPauseDate=null,i(a)):n()}else{var r=e.wasmplayer.JSPlayM4_SetStreamOpenMode(1);e.logger.log("2.设置流模式 resSSOM:"+r)}e.event.emit(dd.play)})).catch((function(t){e.playing=!1,e.logger.error("startPlay error:",t),n(t.oError)}))}),(function(t){e.playing=!1,ah(e),n(t)}))}))}function ch(e){return(e=+e)<10&&(e="0"+e),e+""}var dh={startPos:{fX:.1,fY:.1},fontColor:{fR:0,fG:0,fB:0,fA:1},fontSize:{nFontWidth:20,nFontHeight:20},fontRotate:{fRotateAngle:0,fFillFullScreen:!1},fontFamily:"Arial",fontNumber:{nRowNumber:5,nColNumber:5},space:1};function uh(){return uh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},uh.apply(this,arguments)}var hh=function(){function e(e){var t,i;this.event=new $u,this.playbackRate=1,this.playing=!1,this.volume=0,this.destroyed=!1,this.deviceCapacity={},this.error=null,this._aHead=null,this._g_port=null,this._secretKey="",this._tempPauseDate=null,this._tempPauseTime="",this._decoderStatus={},this._wss_info={wssUrl:"",oParams:{playURL:""}},this.version="8.0.2-alpha.4",this._setOptions(e),this._playerWindow=new Vu(this._options.id,this._options.width,this._options.height),this._playerWindow.render(),this.esCanvas=new Qt(this._options.id+"canvas_draw0"),i=(t=this).$container,wt(i).find("."+Uu+"-container").children().each((function(){wt(this).bind("mouseenter",(function(){wt(i).find("."+Uu+"-canvas-draw").css("pointer-events","all"),t.__b3DZoom?(t.esCanvas=null,wt(i).find("."+Uu+"-canvas-draw").unbind(),t.esCanvas=new Qt(t._options.id+"canvas_draw0"),t.esCanvas.setShapeType("Rect"),t.esCanvas.setDrawStyle("#ff0000","",0),t.esCanvas.setDrawStatus(!0,(function(e){"function"==typeof t.__fCallback&&t.__fCallback(e)}))):wt(i).find("."+Uu+"-canvas-draw").css("pointer-events","none")})),wt(this).bind("mouseleave",(function(){wt(i).find("."+Uu+"-canvas-draw").css("pointer-events","none")}))})),this._playerInit(),this._playerFullScreen=new ju(this,this._options.fullScreenEle)}var t=e.prototype;return t._playerInit=function(){var e=this;return qu(this).then((function(t){return e._wasmDecoderInfo=t,"loaded"===t.cmd&&e._options.autoPlay&&e.play(),t}))},t.play=function(e){return this._destroyed(),this._setOptions(null!=e?e:{}),function(e){return new Promise((function(t,i){e._options.accessToken&&td(e._options.url)&&function(e){var t=e._options.url;return e.service.getRealPlayUrl({ezopen:e._options.url}).then((function(i){var n=i.realUrl,a=eh("checkCode",n);return a&&(e._validateCode=a),n.includes("playback")?function(e,t,i){var n,a,r=null!=(n=eh("begin",t))?n:eh("begin",i),o=null!=(a=eh("end",t))?a:eh("end",i);if(r)t=t.replace("&begin="+Qu("begin",t),"&begin="+th(r,"000000")),Qu("begin",t)||(t+="&begin="+th(r,"000000"));else{var s=new Date;t=t+"&begin="+(null==s?void 0:s.Format("yyyyMMdd"))+"T000000Z"}if(o?(t=t.replace("&end="+Qu("end",t),"&end="+th(o,"235959")),Qu("end",t)||(t+="&end="+th(o,"235959"))):t=t+"&end="+th(Qu("begin",t).substr(0,8),"235959"),Qu("stream",t)||(t=t.replace("stream","&stream")),i.includes(".cloud"))return function(e,t,i,n,a){return new Promise((function(r,o){var s=function(){l=nh(c);var e=JSON.stringify(l).replace("\\","");t+="&recSlice="+e.replace("\\","")+"&r="+Math.random(),r(t)},l=[],c=[];!function t(){e.service.getVideoByTime({channelNo:a,startTime:i,endTime:n}).then((function(e){var n;(null==(n=e.data)?void 0:n.files)&&e.data.files.length>0?e.data.isAll?s():(e.data.files&&(c=c.concat(e.data.files)),i=e.data.nextFileTime>0?e.data.nextFileTime:(new Date).getTime(),t()):s()}))}()}))}(e,t,ih(Qu("begin",t)),ih(Qu("end",t)),Qu("chn",t));if(i.includes("alarmId")){var l=Qu("alarmId",t);return function(e,t,i,n){return new Promise((function(a,r){e.service.getVideoByID({channelNo:i,alarmId:n}).then((function(e){if(200==+e.code){var i=[];if(e.data){var n;i=nh([e.data]);var o=JSON.stringify(i).replace("\\","");t+="&recSlice="+o.replace("\\",""),t=1==+(null==(n=e.data)?void 0:n.recType)?t.replace("/playback","/cloudplayback"):t.replace("/cloudplayback","/playback"),a(t)}}else r({code:-1,msg:"未找到录像片段"})}))}))}(e,t,Qu("chn",t),l)}return Promise.resolve(t)}(e,n,t):Promise.resolve(n)}))}(e).then((function(n){!function(e,t,i,n){var a,r,o,s,l,c,d=(l=(s=t).split("?")[0].replace("/live","").replace("/playback",""),(c=(s.includes("/live")?"/live?":s.includes("cloudplayback")?"/cloudplayback?":"/playback?")+s.split("?")[1]).includes("/playback")&&(c=c.replace("stream=2","stream=1")),{websocketConnectUrl:l,websocketStreamingParam:c});if(d.websocketConnectUrl){var u=null!=(o=null==(r=e._options)||null==(a=r.env)?void 0:a.wsUrl)?o:d.websocketConnectUrl;rh(e,u,{playURL:d.websocketStreamingParam}).then((function(){return i(0)}),(function(t){e.logger.error("play error: ",t),n(1)}))}}(e,n,t,i)})).catch((function(t){e.logger.error("play error: ",t),i(1)}))}))}(this)},t._wss_play=function(e,t,i){var n=this;return void 0===t&&(t={playURL:""}),this._destroyed(),new Promise((function(i,a){var r=setInterval((function(){window.JSPlayerModuleLoaded&&(clearInterval(r),rh(n,e,t).then((function(e){i(e)})).catch((function(e){a(e)})))}),50)}))},t.pause=function(e){return function(e,t,i){if(!e.playing)return Promise.reject(ld(void 0,-1,"当前不是播放状态,不需要暂停"));var n=e.getFrameInfo(),a=new Date(n.year+"/"+n.month+"/"+n.day+" "+n.hour+":"+n.minute+":"+n.second).getTime()/1e3,r=new Date(1e3*a);return e._tempPauseDate=r.valueOf(),e._tempPauseTime=""+n.year+ch(n.month)+ch(n.day)+ch(n.hour)+ch(n.minute)+ch(n.second),new Promise((function(i,n){t?e.stop().then((function(){i(ld(r,0,"暂停成功"))})).catch((function(e){n(ld(r,-1,"暂停失败"))})):(e._oStreamClient.stopAll(),1==+e.wasmplayer.JSPlayM4_Pause(1)?(e.playing=!1,i(ld(r))):n(ld(r,-1,"暂停失败"))),e.event.emit("pause",cd(void 0))}))}(this,e)},t.resume=function(e){return this._destroyed(),function(e,t){var i=e._tempPauseTime,n=e._tempPauseDate,a=e._wss_info;if(e.playing)return Promise.resolve();var r=!1;return new Promise((function(o,s){var l,c,d;t&&(i?i=i.slice(0,14-t.length)+t:(r=!0,i=t)),(null==(l=a.oParams)?void 0:l.playURL.includes("playback"))&&(a.oParams.playURL=null==a||null==(c=a.oParams)?void 0:c.playURL.replace(/begin=[0-9]{8}T[0-9]{6}Z/gi,"begin="+i.slice(0,8)+"T"+i.slice(8,14)+"Z")),a.oParams.playURL.includes("cloudplayback")&&(a.oParams.playURL=null==a||null==(d=a.oParams)?void 0:d.playURL.replace(/"startTime":[0-9]{13}/gi,'"startTime":'+n)),t&&!r?e._wss_play(null==a?void 0:a.wssUrl,null==a?void 0:a.oParams).then((function(e){o(e)})).catch((function(e){s(e)})):lh(e,"resume").then((function(e){o(e)})).catch((function(e){s(e)}))}))}(this,e)},t.destroy=function(){return(e=this)._oStreamClient&&(null==(t=e._oStreamClient)||t.destroy(),e._oStreamClient=null),ah(e),e.wasmplayer&&(e.wasmplayer.JSPlayM4_Stop(),e.wasmplayer.JSPlayM4_FreePort(),e.wasmplayer=null),e._g_port=null,e.pluginManager&&(e.pluginManager.destroy(),e.pluginManager=null),e._playerWindow&&(e._playerWindow.destroy(),e._playerWindow=null),setTimeout((function(){e.event&&(e.event.emit(dd.destroy),e.event=null)}),0),e.destroyed=!0,Promise.resolve();var e,t},t._destroyed=function(){return function(e){if(e.destroyed)throw new Error("player is destroyed!")}(this)},t.stop=function(){return t=(e=this).wasmplayer,e.playing?new Promise((function(i,n){try{e.snapshot("","jpeg","base64",!1).then((function(t){var i,n=e.$container.getElementsByClassName(Uu+"-container")[0],a=document.getElementById(e._playerWindow.canvasId);a&&n&&n.removeChild(a),e._playerWindow.$playerWnd&&(null===e.fECCorrect._correctType?e._playerWindow.$playerWnd.style.backgroundImage="url("+(null==(i=t.data)?void 0:i.base64)+")":e._playerWindow.$playerWnd.style.backgroundImage="none",e._playerWindow.$playerWnd.style.backgroundSize="100% 100%")}))}catch(e){}setTimeout((function(){e._oStreamClient&&e._oStreamClient.stopAll().then((function(){e.event.emit("stop",cd(void 0)),e.event.emit("JSPlayM4_Stop",cd(void 0));var n=t.JSPlayM4_Stop(!1);if(1===n)ah(e),i({resS:n});else{var a=t.JSPlayM4_GetLastError();if(35==+a)var r=setInterval((function(){n?clearInterval(r):1==+(n=t.JSPlayM4_Stop(!1))?(ah(e),i({resS:n})):(a=t.JSPlayM4_GetLastError(),e.logger.error("JSPlayM4_Stop error: ",a))}),50);else e.logger.error("stop - other error, still resolve: ",a),ah(e),i({resS:n,jsPluginErrorCode:a})}})).catch((function(i){ah(e);var a=t.JSPlayM4_GetLastError();e.logger.error("JSPlayM4_Stop error: ",a),n({jsPluginErrorCode:a})}))}),300)})):Promise.resolve();var e,t},t.snapshot=function(e,t,i,n){return function(e,t,i,n,a){void 0===i&&(i="jpeg");var r=e.wasmplayer;return new Promise((function(o){var s=r.JSPlayM4_GetJPEG((function(r,s){if(r){var l=new Uint8Array(s);if(l.set(r.subarray(0,s)),t=(null!=(f=t)&&""!==f?t:(new Date).getTime())+"."+i,!0===a&&"base64"!==n){var c=new Blob([l],{type:"image/jpeg"}),d=URL.createObjectURL(c),u=document.createElement("a");u.style.display="none",u.href=d,u.download="image.jpeg",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)}var h=function(e){for(var t=new Uint8Array(e),i="",n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return"data:image/jpeg;base64,"+window.btoa(i)}(r);e.event.emit(dd.snapshot,cd({fileName:t,base64:h})),o(ld({fileName:t,base64:h}))}var f}),!1);1!==s&&o(ld(null,-1,"截图失败"))}))}(this,e,"jpeg",i,n)},t.fullScreen=function(e,t){return this._playerFullScreen.fullScreen(e,t)},t.exitScreen=function(){return this._playerFullScreen.exitScreen()},t.resize=function(e,t){return function(e,t,i){t=+t,i=+i;var n=Bu();return isNaN(t)||isNaN(i)?(t=e._options.width,i=e._options.height):n||(e._options.width=t,e._options.height=i),t<16||i<16?Promise.reject():(e.$container.style.width=t+"px",e.$container.style.height=i+"px",e._playerWindow&&(e._playerWindow.resize(t,i),e.wasmplayer&&0==+e.wasmplayer.JSPlayM4_SetCanvasSize(t,i)&&e.logger.error("canvas resize fail")),e.event&&e.event.emit("resize",cd({width:t,height:i})),e.logger&&e.logger.log("resize: width: "+t+"  height: "+i),Promise.resolve({width:t,height:i}))}(this,e,t)},t.setVolume=function(e){return function(e,t){var i=0;return 0===t?1===(i=e.wasmplayer.JSPlayM4_StopSound())&&(e.volume=0):1===t&&1===(i=e.wasmplayer.JSPlayM4_PlaySound())&&(e.volume=1),e.event.emit(dd.volumeChange,cd(t)),i}(this,e)},t.use=function(e){this.pluginManager.use(e)},t.setFECCorrectType=function(e,t){return this.fECCorrect.setFECCorrectType(e,t)},t.setFEC2DParam=function(e,t){return this.fECCorrect.setFEC2DParam(e,t)},t.setFEC3DViewParam=function(e){return this.fECCorrect.setFEC3DViewParam(e)},t.get3DViewParam=function(e){return this.fECCorrect.get3DViewParam(e)},t.setPoster=function(e){},t.setPlaybackRate=function(e){!function(e,t){if(t=+t,Number.isNaN(t))throw new Error("rate is error, only support 0.5 | 1 | 2 | 4");if(![.5,1,2,4].includes(t))throw new Error("rate is error, only support  0.5 | 1 | 2 | 4");e._oStreamClient.setPlayRate(t);var i=e.playbackRate;if(i>t)for(var n=t;n<i;)n*=2,e.wasmplayer.JSPlayM4_Slow();else if(i<t)for(var a=i;a<t;)a*=2,e.wasmplayer.JSPlayM4_Fast();4==+t&&e.wasmplayer.JSPlayM4_SetDecodeThreadNum(4),e.event.emit(dd.rateChange,cd(t)),e.playbackRate=t}(this,e)},t.seek=function(e,t,i){return function(e,t,i,n){return e.wasmplayer.JSPlayM4_ResetBuffer(1),e.event.emit(dd.seek,cd({iWndNum:t,szStartTime:i,szStopTime:n})),e._oStreamClient.seek(i,n),Promise.resolve()}(this,e,t,i)},t._setOptions=function(e){Nu(this,e)},t.enable3DZoom=function(e){return function(e,t){if(!e.playing)return-1;var i=e.wasmplayer,n=i.JSPlayM4_GetFrameInfo();return new Promise((function(t,a){t({code:0,data:i.JSPlayM4_SetDisplayRegion(e._playerWindow.canvasId,0,n.width,0,n.height,!1,!0)})})),wt("."+e._options.id+"draw-window").unbind(),e.__fCallback=t,e.esCanvas=new Qt(e._options.id+"canvas_draw0"),e.esCanvas.setShapeType("Rect"),e.esCanvas.setDrawStyle("#ff0000","",0),e.esCanvas.setDrawStatus(!0,(function(e){"function"==typeof t&&t(e)})),e.__b3DZoom=!0,0}(this,e)},t.disable3DZoom=function(){return(e=this).playing?(e.esCanvas.setDrawStatus(!1),e.__fCallback=null,e.__b3DZoom=!1,0):-1;var e},t.getOSDTime=function(){var e=this.getFrameInfo();return new Date(e.year+"/"+e.month+"/"+e.day+" "+e.hour+":"+e.minute+":"+e.second).getTime()/1e3},t.getFrameInfo=function(){return this.wasmplayer.JSPlayM4_GetFrameInfo()},t.setDisplayRegion=function(e,t,i,n,a,r){void 0===a&&(a=!0),void 0===r&&(r=!1);var o=function(e,t,i,n,a,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var s=e.wasmplayer,l=e.getFrameInfo(),c=e._playerWindow.canvasId,d=document.getElementById(c);if(d){var u=function(e){return{width:(null==e?void 0:e.style.width)?+(null==e?void 0:e.style.width.replace("px","")):e.width||e.offsetWidth,height:(null==e?void 0:e.style.height)?+(null==e?void 0:e.style.height.replace("px","")):e.height||e.offsetHeight}}(d),h=u.width,f=u.height;return o&&(f=u.width,h=u.height),e.event.emit("setDisplayRegion",cd({left:t,right:i,top:n,bottom:a,flag:r,isFullscreen:o})),s.JSPlayM4_SetDisplayRegion(c,h*t/l.width,h*i/l.width,f*n/l.height,f*a/l.height,!r,!1)}}(this,e,t,i,n,a,r);return 1===o},t.setSecretKey=function(e){if(null!=e&&""!==e){this._secretKey=e;var t=this.wasmplayer.JSPlayM4_SetSecretKey(e);return 1==+t?this.logger.log("set secretKey success, ",e):this.logger.error("set secretKey fail, ",e),t}},t.getOpions=function(){return this._options},t.setLogger=function(e){this._setOptions(uh({},this._options,{logger:Object.assign({},this._options.logger,e)}))},t.getVersion=function(){var e=this.wasmplayer.JSPlayM4_GetSDKVersion();return{version:"8.0.2-alpha.4",decoder:this._wasmDecoderInfo.bSupHardOrSoft?"V3":"V1",decoderVersion:e.toString(16)}},t.setWaterMark=function(e){return function(e,t){var i=e.wasmplayer;return t=Object.assign({},dh,t),new Promise((function(e,n){var a;1===(a=t&&t.fontString?i.JSPlayM4_SetWaterMarkFont({pFontString:t.fontString,pstStartPos:t.startPos,pstFontColor:t.fontColor,pstFontSize:t.fontSize,pstFontRotate:t.fontRotate,pstFontNumber:t.fontNumber,pFontFamily:t.fontFamily,pSpace:t.space}):i.JSPlayM4_SetWaterMarkFont(null))?e({code:0,msg:"水印设置成功"}):n({code:-1,msg:a})}))}(this,e)},e}(),fh="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),xh=new Uint8Array(16);function ph(){if(!fh)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fh(xh)}for(var mh=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,_h=[],gh=0;gh<256;++gh)_h.push((gh+256).toString(16).substr(1));function vh(e,t,i){var n=(e=e||{}).random||(e.rng||ph)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var a=0;a<16;++a)t[i+a]=n[a];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(_h[e[t+0]]+_h[e[t+1]]+_h[e[t+2]]+_h[e[t+3]]+"-"+_h[e[t+4]]+_h[e[t+5]]+"-"+_h[e[t+6]]+_h[e[t+7]]+"-"+_h[e[t+8]]+_h[e[t+9]]+"-"+_h[e[t+10]]+_h[e[t+11]]+_h[e[t+12]]+_h[e[t+13]]+_h[e[t+14]]+_h[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&mh.test(e)}(i))throw TypeError("Stringified UUID is invalid");return i}(n)}function yh(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Sh=function(){function e(){this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}var t=e.prototype;return t.$=function(e){var t=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,i=/^(?:\s*(<[\w\W]+>)[^>]*|.([\w-]*))$/;if(t.test(e)){var n=t.exec(e);return document.getElementById(n[2])}if(i.test(e)){for(var a=i.exec(e),r=document.getElementsByTagName("*"),o=[],s=0,l=r.length;s<l;s++)r[s].className.match(new RegExp("(\\s|^)"+a[2]+"(\\s|$)"))&&o.push(r[s]);return o}},t.dateFormat=function(e,t){var i={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),i)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?i[n]:("00"+i[n]).substr((""+i[n]).length)));return t},t.downloadFile=function(e,t){var i=e;yh(e,Blob)||yh(e,File)||(i=new Blob([e]));var n=window.URL.createObjectURL(i),a=window.document.createElement("a");a.href=n,a.download=t;var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),a.dispatchEvent(r)},t.createxmlDoc=function(){for(var e,t=["MSXML2.DOMDocument","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","Microsoft.XmlDom"],i=0,n=t.length;i<n;i++)try{e=new ActiveXObject(t[i]);break}catch(t){e=document.implementation.createDocument("","",null);break}return e.async="false",e},t.parseXmlFromStr=function(e){if(null===e||""===e)return null;var t=this.createxmlDoc();return"Netscape"===navigator.appName||"Opera"===navigator.appName?t=(new DOMParser).parseFromString(e,"text/xml"):t.loadXML(e),t},t.encode=function(e){var t,i,n,a,r,o,s,l="",c=0;for(e=this._utf8_encode(e);c<e.length;)a=(t=e.charCodeAt(c++))>>2,r=(3&t)<<4|(i=e.charCodeAt(c++))>>4,o=(15&i)<<2|(n=e.charCodeAt(c++))>>6,s=63&n,isNaN(i)?o=s=64:isNaN(n)&&(s=64),l=l+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(o)+this._keyStr.charAt(s);return l},t.decode=function(e){var t,i,n,a,r,o,s="",l=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");l<e.length;)t=this._keyStr.indexOf(e.charAt(l++))<<2|(a=this._keyStr.indexOf(e.charAt(l++)))>>4,i=(15&a)<<4|(r=this._keyStr.indexOf(e.charAt(l++)))>>2,n=(3&r)<<6|(o=this._keyStr.indexOf(e.charAt(l++))),s+=String.fromCharCode(t),64!==r&&(s+=String.fromCharCode(i)),64!==o&&(s+=String.fromCharCode(n));return this._utf8_decode(s)},t._utf8_encode=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},t._utf8_decode=function(e){for(var t="",i=0,n=0,a=0;i<e.length;)if((n=e.charCodeAt(i))<128)t+=String.fromCharCode(n),i++;else if(n>191&&n<224)a=e.charCodeAt(i+1),t+=String.fromCharCode((31&n)<<6|63&a),i+=2;else{a=e.charCodeAt(i+1);var r=e.charCodeAt(i+2);t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&r),i+=3}return t},t.isFirefox=function(){var e=!1,t=navigator.userAgent.toLowerCase(),i="";return t.match(/firefox\/([\d.]+)/)&&(i=t.match(/firefox\/([\d.]+)/)[1],parseInt(i.split(".")[0],10)>-1&&(e=!0)),e},t.isSafari=function(){var e=!1,t=navigator.userAgent.toLowerCase(),i="";return t.match(/version\/([\d.]+).safari./)&&(i=t.match(/version\/([\d.]+).safari./)[1],parseInt(i.split(".")[0],10)>-1&&(e=!0)),e},t.isEdge=function(){return navigator.userAgent.toLowerCase().indexOf("edge")>-1},t.isIOS=function(){return!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)},e}(),bh=new Sh;window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.URL=window.URL||window.webkitURL;var Ph,Eh=function(){function e(e,t,i,n){this.szUUID=e,this.szFileName=t,this.iStreamType=i,this.szPath="",this.bStart=!1,this.aStreamList=[],this.options=n,this.fileContents=[]}var t=e.prototype;return t.init=function(){var e=this;return new Promise((function(t){e.fileContents=[]}))},t.getDateDir=function(){return bh.dateFormat(new Date,"yyyy-MM-dd")},t.writeFileHeader=function(e){var t=new Blob([e],{type:"application/octet-stream"});this.fileContents.push(t),this.bStart=!0},t.writeFileContent=function(e){var t=new Blob([e],{type:"application/octet-stream"});this.fileContents.push(t)},t.writeFile=function(e){var t=this;if(this.bStart)if(this.aStreamList.length>0){var i=this.aStreamList.shift();if(e.seek(e.length),e.length>=this.options.iFileSize)return void(this.options.cbEventHandler&&this.options.cbEventHandler(3001,this.szUUID));var n=new Blob([i]);e.write(n)}else setTimeout((function(){t.writeFile(e)}),1e3)},t.stopWriteFile=function(){var e=this;return this.bStart=!1,new Promise((function(t){var i=new Blob(e.fileContents,{type:"application/octet-stream"});e.fileContents=[],t(URL.createObjectURL(i))}))},e}(),Ch=function(){function e(e,t,i,n,a,r,o,s){this.szBasePath=e,this.szUUID=t,this.szFileName=i,this.aHeadBuf=new Uint8Array(n),this.iPackType=a,this.iStreamType=r,this.oWorker=null,this.oFileSystem=null,this.options=o,this.bHead=!0,this.staticPath=s,this.fileContents=[]}var t=e.prototype;return t.init=function(){var e=this;return new Promise((function(t,i){e.initWorker().then((function(){t(e.szUUID)}),(function(e){i(e)}))}))},t.initFileSystem=function(){var e=this;return this.oFileSystem=new Eh(this.szUUID,this.szFileName,this.iStreamType,this.options),new Promise((function(t,i){e.oFileSystem.init().then((function(){t()}),(function(e){i(e)}))}))},t.initWorker=function(){var e=this;return new Promise((function(t){var i,n=new Blob([(i=e.staticPath,void 0===i&&(i="https://open.ys7.com/assets/ezuikit_v3.6"),'(function() {\n    const RECORDRTP = 0;  //录制一份未经过转封装的码流原始数据,用于定位问题\n    self.Module = { memoryInitializerRequest: loadMemInitFile(), TOTAL_MEMORY: 128*1024*1024 };\n    importScripts = (function (globalEval) {\n        var xhr = new XMLHttpRequest;\n        return function importScripts() {\n          var\n            args = Array.prototype.slice.call(arguments)\n            , len = args.length\n            , i = 0\n            , meta\n            , data\n            , content\n            ;\n          for (; i < len; i++) {\n            if (args[i].substr(0, 5).toLowerCase() === "data:") {\n              data = args[i];\n              content = data.indexOf(",");\n              meta = data.substr(5, content).toLowerCase();\n              data = decodeURIComponent(data.substr(content + 1));\n              if (/;s*base64s*[;,]/.test(meta)) {\n                data = atob(data);\n              }\n              if (/;s*charset=[uU][tT][fF]-?8s*[;,]/.test(meta)) {\n                data = decodeURIComponent(escape(data));\n              }\n            } else {\n              xhr.open("GET", args[i], false);\n              xhr.send(null);\n              data = xhr.responseText;\n            }\n            globalEval(data);\n          }\n        };\n      }(eval));\n    importScripts(\''+i+'/js/transform/SystemTransform.js\');\n\n    Module.postRun.push(function() {\n        postMessage({type: "loaded"});\n    });\n\n    onmessage = function (e) {\n        var data = e.data;\n\n        if ("create" === data.type) {\n            var iHeadLen = data.len;\n            var pHead = Module._malloc(iHeadLen);\n\n            var aData = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);\n            aData.set(new Uint8Array(data.buf));\n\n            var iTransType = data.packType;//目标格式 RTP->PS\n            if (RECORDRTP) {\n                postMessage({type: "created"});\n                postMessage({type: "outputData", buf: data.buf, dType: 1}, [data.buf]);\n            } else {\n                var iRet = Module._ST_Create(pHead, iHeadLen, iTransType);\n                if (iRet != 0) {\n                    console.log("_ST_Create failed!");\n                } else {\n                    Module._ST_Start();\n                    postMessage({type: "created"});\n                }\n            }\n\n        } else if ("inputData" === data.type) {\n            if (RECORDRTP) {\n                var aFileData = new Uint8Array(data.buf);  // 拷贝一份\n                var iBufferLen = aFileData.length;\n                var szBufferLen = iBufferLen.toString(16);\n                if (szBufferLen.length === 1) {\n                    szBufferLen = "000" + szBufferLen;\n                } else if (szBufferLen.length === 2) {\n                    szBufferLen = "00" + szBufferLen;\n                } else if (szBufferLen.length === 3) {\n                    szBufferLen = "0" + szBufferLen;\n                }\n                var aData = [0, 0, parseInt(szBufferLen.substring(0, 2), 16), parseInt(szBufferLen.substring(2, 4), 16)];\n                for(var iIndex = 0, iDataLength = aFileData.length; iIndex < iDataLength; iIndex++) {\n                    aData[iIndex + 4] = aFileData[iIndex]\n                }\n                var dataUint8 = new Uint8Array(aData);\n                postMessage({type: "outputData", buf: dataUint8.buffer, dType: 2}, [dataUint8.buffer]);\n            } else {\n                var iDataLen = data.len;\n                var pData = Module._malloc(iDataLen);\n\n                var aData = Module.HEAPU8.subarray(pData, pData + iDataLen);\n                aData.set(new Uint8Array(data.buf));\n\n                var iRet = Module._ST_InputData(0, pData, iDataLen);\n                if (iRet != 0) {\n                    //console.log("_ST_InputData failed!");// 一开始会有一些失败,但是不影响后面的文件存储\n                }\n\n                Module._free(pData);\n            }\n        } else if ("release" === data.type) {\n            Module._ST_Stop();\n            Module._ST_Release();\n\n            close();\n        }\n    };\n\n    function loadMemInitFile() {\n        var req = new XMLHttpRequest();\n        req.open(\'GET\', \''+i+"/js/transform/SystemTransform.js.mem');\n        req.responseType = 'arraybuffer';\n        req.send();\n\n        return req;\n    }\n})();")]),a=URL.createObjectURL(n);e.oWorker=new Worker(a),e.oWorker.onmessage=function(i){var n=i.data,a=e.iPackType;if(1===e.options.iPackage&&(a=12),"loaded"===n.type)e.oWorker.postMessage({type:"create",buf:e.aHeadBuf.buffer,len:40,packType:a},[e.aHeadBuf.buffer]);else if("created"===n.type)t();else if("outputData"===n.type){var r=new Uint8Array(n.buf);if(1===e.options.iPackage)if(e.bHead){var o=new Blob([r],{type:"video/mp4"});e.fileContents.push(o),e.bStart=!0,e.bHead=!1}else{var s=new Blob([r],{type:"video/mp4"});e.fileContents.push(s)}else if(1===n.dType){var l=new Blob([r],{type:"video/mp4"});e.fileContents.push(l),e.bStart=!0}else{var c=new Blob([r],{type:"application/octet-stream"});e.fileContents.push(c)}}}}))},t.inputData=function(e){if(this.oWorker){var t=new Uint8Array(e);this.oWorker.postMessage({type:"inputData",buf:t.buffer,len:t.length},[t.buffer])}},t.stopRecord=function(e){var t=this;return new Promise((function(i,n){t.oWorker?t.oWorker.postMessage({type:"release"}):n();var a=new Blob(t.fileContents,{type:"application/octet-stream"});t.fileContents=[];var r=URL.createObjectURL(a);if(t.bStart=!1,e){var o=document.createElement("a");o.href=r,o.download=t.szFileName,document.body.appendChild(o),o.click(),document.body.removeChild(o)}i(r)}))},e}(),Th=(Ph=Symbol("STORAGELIST"),function(){function e(e,t,i){this.szBasePath=e,this[Ph]={},this.options={iFileSize:1073741824},Object.assign(this.options,t),"string"==typeof t.staticPath&&(this.staticPath=t.staticPath)}var t=e.prototype;return t.startRecord=function(e,t,i,n,a){var r=this,o=vh(),s=Object.assign({},this.options,a),l=new Ch(this.szBasePath,o,e,t,i,n,s,this.staticPath);return new Promise((function(e,t){l.init().then((function(t){r[Ph][t]=l,e(t)}),(function(e){t(e)}))}))},t.inputData=function(e,t){var i=this[Ph][e];i&&i.inputData(t)},t.stopRecord=function(e,t){var i=this;return new Promise((function(n,a){var r=i[Ph][e];r?r.stopRecord(t).then((function(){delete i[Ph][e],n()}),(function(){a()})):a()}))},e}()),Rh=function(){function e(){this._oStorageManager=new Th("./transform",{staticPath:"https://open.ys7.com/assets/ezuikit_v4.0"},void 0)}var t=e.prototype;return t.startRecord=function(e,t){var i=this;return t=null!=t?t:(new Date).getTime()+"",new Promise((function(n,a){i._oStorageManager.startRecord(t+".mp4",e,2,0,{cbEventHandler:function(e){a(e)},iPackage:0}).then((function(e){i.szStorageUUID=e,n(e)}),(function(e){a(e)}))}))},t.inputData=function(e){this.szStorageUUID&&this._oStorageManager.inputData(this.szStorageUUID,e)},t.stopRecord=function(e){var t=this;return void 0===e&&(e=!0),new Promise((function(i,n){t._oStorageManager.stopRecord(t.szStorageUUID,e).then((function(e){i(t.szStorageUUID),t.szStorageUUID=""}),(function(e){n(e)}))}))},e}(),wh=function(){function e(){this.name="ezuikit-player-plugin-record",this.recording=!1,this._record=new Rh}var t=e.prototype;return t.exec=function(e){var t=this;this._player=e,setTimeout((function(){["stop","pause","destroy"].forEach((function(i){e.event.on(i,(function(){t.stopRecord()}))}))}),0)},t.startRecord=function(e,t){var i,n=this;return void 0===e&&(e=""+(new Date).getTime()),this._recordInputDataFn=function(e){var t;n._record.szStorageUUID&&(null==(t=n._record)||t.inputData(e.data))},null==(i=this._record)?void 0:i.startRecord(this._player._aHead,e).then((function(t){var i,a,r;n.recording=!0,null==(a=n._player)||null==(i=a.logger)||i.log("[PlayerRecordPlugin] start record video, filename: ",e),null==(r=n._player)||r.event.on("recordInputData",n._recordInputDataFn)}))},t.stopRecord=function(){var e,t,i,n;return this.recording?(this.recording=!1,null==(t=this._player)||null==(e=t.logger)||e.log("[PlayerRecordPlugin] stop record video"),null==(i=this._player)||i.event.off("recordInputData",this._recordInputDataFn),null==(n=this._record)?void 0:n.stopRecord()):Promise.resolve()},t.destroy=function(){var e=this;this.stopRecord().then((function(){var t,i;null==(i=e._player)||null==(t=i.logger)||t.log("[PlayerRecordPlugin] destroy"),e._record=null}))},e}();function Ih(){return Ih=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Ih.apply(this,arguments)}var Dh=function(){function e(e){var t=e.szId;delete e.szId,this.iWidth=e.iWidth,this.iHeight=e.iHeight,this.player=new hh(Ih({},e,{decoderType:!0===e.isCloudRecord?"v1":"auto",id:t})),this.i18n=this.player.i18n,this._recordPlugin=new wh,this.player.use(this._recordPlugin),this.nWidth=0,this.nHeight=0,this.oStreamClient=this.player._oStreamClient,this.g_port=0,this.oStyle=Object.assign({border:"#000000",borderSelect:"#FFCC00",background:"#4C4B4B"},e.oStyle),this._initEventCallback()}var t,i=e.prototype;return i._initEventCallback=function(){var e=this;this.player.event.on(dd.resize,(function(t){e.iWidth=t.data.width,e.iHeight=t.data.height})),this.player.event.on(pd,(function(t){var i,n,a,r,o,s,l,c,d;t.data.type===md.openStreamCallback&&(null==(i=e.EventCallback)?void 0:i.openStreamCallback)&&e.EventCallback.openStreamCallback(),t.data.type===md.pluginErrorHandler&&(null==(n=e.EventCallback)?void 0:n.pluginErrorHandler)&&e.EventCallback.openStreamCallback(t.data.iWndIndex,t.data.code,t.data.data),t.data.type===md.getStreamHeaderCallback&&(null==(a=e.EventCallback)?void 0:a.getStreamHeaderCallback)&&e.EventCallback.getStreamHeaderCallback(),t.data.type===md.getVideoStreamCallback&&(null==(r=e.EventCallback)?void 0:r.getVideoStreamCallback)&&e.EventCallback.getVideoStreamCallback(),t.data.type===md.appearFirstFrameCallback&&(null==(o=e.EventCallback)?void 0:o.appearFirstFrameCallback)&&e.EventCallback.appearFirstFrameCallback(),t.data.type===md.averageStreamSuccessCallback&&(null==(s=e.EventCallback)?void 0:s.averageStreamSuccessCallback)&&e.EventCallback.averageStreamSuccessCallback(),t.data.type===md.pluginErrorHandler&&(null==(l=e.EventCallback)?void 0:l.pluginErrorHandler)&&e.EventCallback.pluginErrorHandler(t.data.iWndIndex,t.data.code,null==(d=t.data)?void 0:d.data),t.data.type===md.setRunTimeInfoCallBack&&(null==(c=e.EventCallback)?void 0:c.setRunTimeInfoCallBack)&&e.EventCallback.setRunTimeInfoCallBack(t.data.data.nRunTimeModule,t.data.data.nStrVersion,t.data.data.nFrameTimeStamp,t.data.data.nFrameNum,t.data.data.nErrorCode)}))},i.JSPlayM4_SetDecodeEngine=function(e){this.useHard=e},i.JS_Play=function(e,t,i,n,a){return void 0===e&&(e=""),void 0===t&&(t={playURL:""}),this.player._wss_play(e,t,i,n,a)},i.JS_SetSecretKey=function(e,t){this.secretKey=t,this.player.setSecretKey(t)},i.JS_OpenSound=function(){return this.player.setVolume(1)},i.JS_CloseSound=function(){return this.player.setVolume(0)},i.JS_Enable3DZoom=function(e,t){return this.player.enable3DZoom(t,e)},i.JSPlayM4_SetDisplayRegion=function(e,t,i,n){var a=this;new Promise((function(r,o){r({code:0,data:window["wasmplayer-"+a.szId].JSPlayM4_SetDisplayRegion(a.szId+"-player",e,t,i,n,!1,!0)})}))},i.JS_Disable3DZoom=function(){return this.player.disable3DZoom(fCallback,iWin)},i.JS_StartSave=function(e,t){return void 0===t&&(t=""+(new Date).getTime()),this._recordPlugin.startRecord(t)},i.JS_StopSave=function(){return this._recordPlugin.stopRecord()},i._JSPlayM4_GetFrameInfo=function(){return this.player.getFrameInfo()},i._JSPlayM4_SetDisplayRegion=function(e,t,i,n,a,r){return this.player.setDisplayRegion(e,t,i,n,!0,r)},i.JS_CapturePicture=function(e,t,i,n,a){var r=this;return this.bPlay?new Promise((function(e,i){r.player.snapshot(t,"jpeg","base",!0).then((function(t){0===t.code?("function"==typeof n&&n({fileName:t.data.fileName,base64:t.data.base64}),e(Ih({},t,{code:1}))):i(t)}))})):Promise.reject({code:-1,msg:"暂停状态下无法截图"})},i.JS_GetOSDTime=function(){return Promise.resolve(this.player.getOSDTime())},i.JS_Resize=function(e,t){this.player.resize(e,t)},i.JS_GetSDKVersion=function(){return this.player.getVersion().decoderVersion},i.JS_Stop=function(){return this.player.stop()},i.JS_DestroyWorker=function(){this.player.destroy()},i.JS_Speed=function(e){this.player.setPlaybackRate(3!=+e?e:.5)},i.JS_Seek=function(e,t,i){return this.player.seek(e,t,i)},i.JS_Pause=function(e,t){var i=this;return new Promise((function(e,n){i.player.pause(t).then((function(t){e({pauseDate:t.pauseDate,code:1,msg:null==t?void 0:t.msg})}),(function(){n()}))}))},i.JS_Resume=function(e){return this.player.resume(e)},i.JS_FECCorrectType=function(e,t){return this.player.setFECCorrectType(e,t)},i.JS_FECSetParam2D=function(e,t){return this.player.setFEC2DParam(e,t)},i.FEC_Set3DViewParam=function(e){return this.player.setFEC3DViewParam(e)},i.FEC_Get3DViewParam=function(e){return this.player.get3DViewParam(e)},i.JS_SetWaterMarkFont=function(e){return this.player.setWaterMark(e)},(t=[{key:"bPlay",get:function(){return this.player.playing}},{key:"iRate",get:function(){return this.player.playbackRate}},{key:"playURL",get:function(){return this.player._wss_info.oParams.playURL},set:function(e){this.player._wss_info=Ih({},this.player._wss_info,{oParams:{playURL:e}})}},{key:"FECSplitIds",get:function(){return this.player.fECCorrect._FECSplitIds},set:function(e){this.player.fECCorrect._FECSplitIds=e}},{key:"correctType",get:function(){return this.player.fECCorrect._correctType},set:function(e){this.player.fECCorrect._correctType=e}}])&&function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),kh=I(Dh),Fh=function(e,t){if(void 0===e)return t.themeData?{templateType:"themeData",templateId:"themeData"}:{templateType:"local",templateId:""};if("string"==typeof e){if(32===e.length)return{templateType:"remote",templateId:e};if(-1!==["theme","standard"].indexOf(e))return"simple"===e&&void 0===t.header&&void 0===t.footer?{templateType:"local",templateId:""}:{templateType:"iframe",templateId:e};if(-1!==["pcLive","pcRec","mobileLive","mobileRec","noData","security","voice","simple","mobileCall","miniRec"].indexOf(e))return-1!=t.url.indexOf("rec")&&"simple"!=t.template&&"miniRec"!=t.id?{templateType:"local",templateId:T()?"mobileRec":"pcRec"}:{templateType:"local",templateId:e};if(t&&t.isCall)return{templateType:"invalid",templateId:e}}},Ah=function(){var e=window.navigator.userAgent.toLowerCase(),t=(/version.*safari/.test(e),/chrome/.test(e));/gecko/.test(e)&&/webkit/.test(e);if(T())return!1;if(t){return function(){for(var e=window.navigator.userAgent.split(" "),t="",i=0;i<e.length;i++)/chrome/i.test(e[i])&&(t=e[i]);return!!t&&Number(t.split("/")[1].split(".")[0])}()>91&&!!window.SharedArrayBuffer}return!1};var Mh=function(){function e(t){var i=this;r(this,e),l(this,"_isCloudRecord",!1),l(this,"_controllers",[]),this.isStoping=!1;var n,a,o=t.autoplay,s=void 0===o||o;if((t.template||t.themeData)&&(s=!1),this.params=t,this.autoplay=s,this.talkChannelNo=t.talkChannelNo||null,this.eventEmitter=new pt,this.timeZone=0,this.ptzSpeed=t.ptzSpeed||2,this.ptzSpeedOptions={slow:1,mid:2,fast:3},window.EZUIKit[t.id]={state:{EZUIKitPlayer:{init:window.EZUIKit[t.id]&&window.EZUIKit[t.id].state&&window.EZUIKit[t.id].state.EZUIKitPlayer.init||!1,themeInit:window.EZUIKit[t.id]&&window.EZUIKit[t.id].state&&window.EZUIKit[t.id].state.EZUIKitPlayer.themeInit||!1,talkInit:window.EZUIKit[t.id]&&window.EZUIKit[t.id].state&&window.EZUIKit[t.id].state.EZUIKitPlayer.talkInit||!1}}},this.dataReport=!1!==t.dataReport,this.reportHTTP=!0===t.reportHTTP,this.monitorReport=!0,this.dataReport?this.reportHTTP?this.monitorReport=!0:"https:"!==window.location.protocol||(n=window.location.hostname,4===(a=n.split(".").map((function(e){return!isNaN(e)}))).length&&a.every(Boolean))?this.monitorReport=!1:this.monitorReport=!0:this.monitorReport=!1,new W(this.params.env?this.params.env.domain:null),"iframe"===Fh(this.params.template,t).templateType)return new mt.EZUIKitPlayer(t);this.id=t.id,this.width=t.width,this.height=t.height,this.fullScreenWidth=0,this.fullScreenHeight=0,this.isCall=t.isCall||!1,this.isWebConsole=t.isWebConsole||!1,this.callTime=t.callTime||null,this.hangUpCallback=t.hangUpCallback||null,this.isNeedBellRing=!1!==t.isNeedBellRing,this.url=t.url,this.accessToken=t.accessToken,this.deviceSerial=P(t.url).deviceSerial,this.channelNo=P(t.url).channelNo,this.themeId=Fh(t.template,t).templateId,this.sourceThemeId=Fh(t.template,t).templateId,this.id=t.id,this.audio=!0,this.poster=t.poster,this.speed=1,this.disabledTimeLine=!1,this.disabledPTZ=!1,this.enableSharedArrayBufferGuide=!1,this.capacity=null,this.playTimer=null,this.env={domain:j},this.isMobile=T(),this.support3DZoom=!1,this.use3DZoom=!1,this.is3DZooming=!1,this.useHardDev=void 0!==t.useHardDev&&t.useHardDev,this.host="open.ys7.com",this._isCloudRecord=t.isCloudRecord,this._spaceId=t.isCloudRecord?_("spaceId",this.url):void 0,this.waterMark_JSPlugin=!1,this.useSeek=t.useSeek,this.isInspect=t.isInspect||!1,this.inspectRecordingDuration=t.inspectRecordingDuration||144e5,this.inspectVideoWidth=t.inspectVideoWidth||290,this.inspectVideoHeight=t.inspectVideoHeight||170,this._FECCorrectType=null,this._FECSplitIds="",document.getElementById("".concat(this.id,"-wrap"))&&(document.getElementById("".concat(this.id,"-wrap")).innerHTML="",document.getElementById("".concat(this.id,"-wrap")).id=this.id),this.staticPath="https://openstatic.ys7.com/ezuikit_js/v8.0.2";var c=!this.useHardDev&&Ah()||this.useHardDev&&!this._IsSupHardDecAVC()&&!this._IsSupHardDecHEVC()&&Ah()||this.useHardDev&&(this._IsSupHardDecAVC()||this._IsSupHardDecHEVC()||Ah());this.isV3=c,"string"==typeof t.staticPath&&(t.staticPath.startsWith("http")?this.staticPath=t.staticPath:this.staticPath=window.location.protocol+"//"+window.location.host+t.staticPath),void 0!==t.audio&&(this.audio=t.audio),void 0!==t.env&&(this.env=Object.assign(this.env,t.env)),void 0!==t.host&&(this.host=t.host),void 0!==t.isMobile&&(this.isMobile=t.isMobile),void 0!==t.disabledTimeLine&&(this.disabledTimeLine=t.disabledTimeLine),void 0!==t.disabledPTZ&&(this.disabledPTZ=t.disabledPTZ),void 0!==t.enableSharedArrayBufferGuide&&(this.enableSharedArrayBufferGuide=t.enableSharedArrayBufferGuide);!function(){if(Ah())console.log("启用多线程解析视频");else{if(!T&&91<function(){for(var e=navigator.userAgent.split(" "),t="",i=0;i<e.length;i++)/chrome/i.test(e[i])&&(t=e[i]);return!!t&&Number(t.split("/")[1].split(".")[0])}&&i.enableSharedArrayBufferGuide){console.log("提示用户开启谷歌实验室特性");var e="".concat(i.id,"-wrap"),n=document.createElement("div"),a=document.createElement("span");a.innerHTML=i.i18n.t("client.USE_MULTITHREADING_WARING"),n.appendChild(a);var r=document.createElement("a");r.href="https://open.ys7.com/help/384",r.setAttribute("target","_blank"),n.appendChild(r),r.innerHTML=i.i18n.t("client.OPEN_INSTRUCTIONS"),n.id="".concat(i.id,"-guide"),n.style="font-size:12px;color:red;",setTimeout((function(){document.getElementById(e)&&document.getElementById(e).insertBefore(n,document.getElementById(i.id))}),5e3)}}i.pluginStatus=new F(i,i.id),i.videoInitTime=Date.now(),i.videoPlayState=1,window.monitorExtendsInfo={protocol:"ezopen",url:i.url,serial:i.deviceSerial,no:i.channelNo,env:i.env.domain,type:P(i.url).type};var o=Object.assign({},t);if(delete o.accessToken,delete o.url,i.monitorReport&&window.ezuikitMonitor.report({action:1,logInfo:{pluginVersion:c?"v3":"v1",params:o}}),i.initTime=(new Date).getTime(),i.autoplay){var s=i.initEZUIKitPlayer(t),l=i._getRealUrlPromise(t.accessToken,t.url);Promise.all([s,l]).then((function(e){e[1]?(i.playStartTime=(new Date).getTime(),i._pluginPlay(e[1],(function(){if(1===i.videoPlayState||4===i.videoPlayState){i.videoPlayState=2;var e=Date.now();i.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:i.isV3?"v3":"v1",loadTime:e-i.videoInitTime,loadTimeDesc:{initTime:i.playStartTime-i.videoInitTime,stopTime:0,getWsTime:i.doCreateWsTime-i.playStartTime,createWsTime:e-i.doCreateWsTime}}})}console.log("自动播放成功")}),(function(){console.log("自动播放失败")}))):console.log("promise of one",e),window.EZUIKit[t.id].state.EZUIKitPlayer.init=!0,document.getElementById("".concat(t.id,"canvas_draw0"))&&(document.getElementById("".concat(t.id,"canvas_draw0")).style.border="none")})).catch((function(e){if(console.log("err",e),1===i.videoPlayState||4===i.videoPlayState){i.videoPlayState=3;var t=Date.now();i.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:i.isV3?"v3":"v1",loadTime:t-i.videoInitTime,err:e}})}i.Theme&&i.Theme.setDisabled(!0),i.pluginStatus.loadingClear(),i.isInspect?(i.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(i.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:e&&e.msg,btnName:i.i18n.t("client.default.BTN_RETRY"),type:1}),i.Theme.jSPlugin.Zoom&&i.Theme.jSPlugin.Zoom.stopZoom(),i.Theme&&i.Theme.inspect&&i.Theme.inspect.InspectEvent&&i.Theme.inspect.InspectEvent.disableEvidenceBtn()):i.pluginStatus.loadingSetText({text:e&&e.msg||i.i18n.t("client.play.GET_PLAYURL_FAILED"),color:"red"})}))}else{(s=i.initEZUIKitPlayer(t)).then((function(e){console.log("初始化成功",e),window.EZUIKit[t.id].state.EZUIKitPlayer.init=!0,document.getElementById("".concat(t.id,"canvas_draw0"))&&(document.getElementById("".concat(t.id,"canvas_draw0")).style.border="none"),i.initSuccessTime=(new Date).getTime()}))}t.plugin&&-1!==t.plugin.indexOf("talk")&&(i.Talk=new ue(i),window.EZUIKit[t.id].state.EZUIKitPlayer.talkInit=!0),i.getDeviceCapacity()}(),this.play=gt((function(e){return i._play(e)}),500,!0),this.resume=gt((function(e){return i._resume(e)}),500,!0),this.changePlayUrl=gt((function(e,t,n){return i._changePlayUrl(e,t,n)}),500),window.addEventListener("beforeunload",(function(){console.log("退出页面,停止视频流"),i.stop()})),this._controllers=[]}return s(e,[{key:"_getExplore",value:function(){var e,t={},i=navigator.userAgent.toLowerCase();if((e=i.match(/rv:([\d.]+)\) like gecko/))||(e=i.match(/msie ([\d\.]+)/))?t.ie=e[1]:(e=i.match(/edge\/([\d\.]+)/))?t.edge=e[1]:(e=i.match(/firefox\/([\d\.]+)/))?t.firefox=e[1]:(e=i.match(/(?:opera|opr).([\d\.]+)/))?t.opera=e[1]:(e=i.match(/chrome\/([\d\.]+)/))?t.chrome=e[1]:(e=i.match(/version\/([\d\.]+).*safari/))&&(t.safari=e[1]),t.chrome){var n=t.chrome,a=n.indexOf(".");return Number(n.substring(0,a))}return t.ie?console.info("%c1>your browser is IE ,it does not support play without plugin","color: red"):t.safari?console.info("%c1>your browser is safari ,it does not support softV2.0 or hard decode","color: red"):t.firefox?console.info("%c1>your browser is Firefox ,it only support soft decode","color: red"):console.info("%c1>your browser does not support play without plugin","color: red"),-1}},{key:"_IsSupHardDecAVC",value:function(e){return this._getExplore()>=94?(e&&e(!0),!0):(e&&e(!1),!1)}},{key:"_IsSupHardDecHEVC",value:function(e){var t=!1;if(this._getExplore()>=107){window.VideoDecoder?VideoDecoder.isConfigSupported({codec:"hvc1.1.6.L123.00",hardwareAcceleration:"prefer-hardware"}).then((function(i){i.supported?(t=!0,e&&e({bSupHardDecHEVC:t})):e&&e({bSupHardDecHEVC:t})})):e&&e({bSupHardDecHEVC:t})}else e&&e({bSupHardDecHEVC:t})}},{key:"initEZUIKitPlayer",value:function(e){var i=this,n=e.id,a=e.width,r=void 0===a?600:a,o=e.height,s=void 0===o?400:o;if(!e.width||!e.height){var l=document.getElementById(n).getBoundingClientRect();!e.width&&l.width>0&&(r=l.width),!e.height&&l.height>0&&(s=l.height)}if(!document.getElementById("".concat(n,"-wrap"))){var c=document.createElement("div");c.id="".concat(n,"-wrap"),c.style="display:inline-block;width:".concat(r,"px;position:relative;vertical-align: bottom;"),document.getElementById(n).parentNode.insertBefore(c,document.getElementById(n)),document.getElementById(n).parentNode.removeChild(document.getElementById(n)),this.isInspect&&(c.style.height="".concat(s,"px"),this.width-=this.inspectVideoWidth,this.height-=this.inspectVideoHeight,r=this.width,s=this.height),c.innerHTML="<div id=".concat(n,"></div>"),document.getElementById(n).style="display:inline-block;width:".concat(r,"px;height:").concat(s,"px;"),document.getElementById(n).style.verticalAlign="top"}Array.isArray(window.recTimer)&&window.recTimer.map((function(e){clearInterval(e)}));var d=new A(this,n);this.Message=d;var u=new Promise((function(a,o){console.log("开始初始化decoder:",(new Date).getTime());var l=i;i.randomNum=Math.random(),window.randomNum=i.randomNum;var c=new kh({szId:n,iType:2,width:r,height:s,iMaxSplit:1,iCurrentSplit:1,szBasePath:"",useHardDev:i.useHardDev,isHardH264:i._IsSupHardDecAVC(),isHardH265:i._IsSupHardDecHEVC(),isSharedArrayBuffer:Ah(),staticPath:i.staticPath,isCloudRecord:i._isCloudRecord,env:i.env,oStyle:{border:"none",background:"#000000"}});i.i18n=c.i18n,i.i18n.switchTranslation("zh"),i.i18n.appendTranslations({zh:M}),i.pluginStatus.loadingStart(n),i.isCall||i.isInspect?i.pluginStatus.loadingSetText({text:i.i18n.t("client.play.VIDEO_LOADING")}):"miniRec"==i.themeId?i.pluginStatus.loadingSetText({text:""}):i.pluginStatus.loadingSetText({text:i.i18n.t("client.init.INIT_FINSHED")});var d=!1;c.EventCallback={openStreamCallback:function(){console.log("开启取流---v1"),i.openStreamTime=(new Date).getTime(),d=!1},getStreamHeaderCallback:function(){console.log("完成取流返回流头"),i.getStreamHeaderTime=(new Date).getTime(),d=!1},getVideoStreamCallback:function(){console.log("返回视频流(首次)"),i.getVideoStreamTime=(new Date).getTime(),i.isCall&&i.Theme&&i.Theme.decoderState&&i.Theme.decoderState.state.rejection&&(console.log("挂断/拒绝状态------------stop"),i.stop((function(){i.pluginStatus.loadingClear(),i.pluginStatus.loadingSetTextWithBtn({text:i.i18n.t("client.call.CALL_END"),color:"white",isMobile:i.isMobile,type:2})}))),i.isInspect&&i.Theme.decoderState.state.play&&("map"!==i.Theme.inspectMode&&i.Theme.jSPlugin.Zoom&&setTimeout((function(){i.Theme.jSPlugin.Zoom.startZoom()}),1e3),i.Theme&&i.Theme.inspect&&i.Theme.inspect.InspectEvent&&i.Theme.inspect.InspectEvent.enableEvidenceBtn())},appearFirstFrameCallback:function(){console.log("出现首帧画面(播放成功)"),i.appearFirstFrameTime=(new Date).getTime()},averageStreamSuccessCallback:function(){i.Zoom=new Pe(i),i.averageStreamSuccessTime=i.initSuccessTime-i.initTime+(i.gotWsUrlTime-i.startGetWsUrlTime)+(i.appearFirstFrameTime-i.openStreamTime),console.log("平均成功取流的出流耗时:",i.averageStreamSuccessTime)},loadEventHandler:function(){},zoomEventResponse:function(){},windowEventSelect:function(e){},pluginErrorHandler:function(e,t,n){if(!(i.isCall&&i.Theme&&i.Theme.decoderState&&i.Theme.decoderState.state.rejection))if(1003===t)console.log("断流"),i.Theme&&i.Theme.setDecoderState({play:!1}),i.pluginStatus.setPlayStatus({play:!1}),c.bPlay||(i.pluginStatus.loadingClear(),i.isCall?i.pluginStatus.loadingSetTextWithBtn({text:i.i18n.t("client.play.DISCONNECT"),color:"white",btnName:i.isMobile?i.i18n.t("client.default.BTN_RETRY"):i.i18n.t("client.default.BTN_RELOAD"),isMobile:i.isMobile,type:i.isCall?1:2}):i.isInspect?(i.pluginStatus.loadingSetTextWithBtn({mask:!0,text:i.i18n.t("client.play.DISCONNECT"),btnName:i.i18n.t("client.default.BTN_RETRY"),type:1}),i.Theme.jSPlugin.Zoom&&i.Theme.jSPlugin.Zoom.stopZoom(),i.Theme&&i.Theme.inspect&&i.Theme.inspect.InspectEvent&&i.Theme.inspect.InspectEvent.disableEvidenceBtn()):i.pluginStatus.loadingSetText({text:i.i18n.t("client.play.DISCONNECT"),color:"red"})),"function"==typeof i.params.handleError&&i.params.handleError({msg:i.i18n.t("client.play.DISCONNECT"),retcode:1003,id:i.params.id,type:"handleError"});else if(1!=n.errorCode){var a=Date.now();1===i.videoPlayState||4===i.videoPlayState?(i.videoPlayState=3,i.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:i.isV3?"v3":"v1",err:n,loadTime:a-i.videoInitTime}})):2===i.videoPlayState&&(i.videoPlayState=5,i.monitorReport&&window.ezuikitMonitor.report({action:5,logInfo:{pluginVersion:i.isV3?"v3":"v1",err:n,loadTime:a-i.videoInitTime}}));var r=i.i18n.t("client.play.DISCONNECT");n.errorCode&&(r=i.i18n.t("stream."+n.errorCode)),i.Theme&&i.Theme.setDecoderState({play:!1}),i.pluginStatus.setPlayStatus({play:!1}),i.pluginStatus.loadingClear(),i.isCall?i.pluginStatus.loadingSetTextWithBtn({text:r,color:"white",btnName:i.isMobile?i.i18n.t("client.default.BTN_RETRY"):i.i18n.t("client.default.BTN_RELOAD"),isMobile:i.isMobile}):i.isInspect?(i.Theme.jSPlugin.Zoom&&i.Theme.jSPlugin.Zoom.stopZoom(),i.pluginStatus.loadingSetTextWithBtn({mask:!0,text:r,btnName:i.i18n.t("client.default.BTN_RETRY"),type:1}),i.Theme&&i.Theme.inspect&&i.Theme.inspect.InspectEvent&&i.Theme.inspect.InspectEvent.disableEvidenceBtn()):i.pluginStatus.loadingSetText({text:r,color:"red"}),"function"==typeof i.params.handleError&&i.params.handleError({msg:r,retcode:n.errorCode,id:i.params.id,type:"handleError"})}else i.pluginStatus.loadingClear(),i.Theme&&i.Theme.setDisabled(!1)},windowEventOver:function(e){},windowEventOut:function(e){},windowEventUp:function(e){},windowFullCcreenChange:function(e){},firstFrameDisplay:function(e,t,i){console.log(t,i),c.JS_SetCanFullScreen(!1)},performanceLack:function(){},mouseEvent:function(e,t,i){},setRunTimeInfoCallBack:function(n,a,r,o,s){if(5===s)if(l.isInspect){l.pluginStatus.loadingClear(),l.Theme.jSPlugin.Zoom&&l.Theme.jSPlugin.Zoom.stopZoom(),(c=document.getElementById("".concat(i.id,"-loading-item-txt")))&&c.textContent===i.i18n.t("client.play.DEVICE_ENCRYPTED")||l.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(i.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:i.i18n.t("client.play.DEVICE_ENCRYPTED"),color:"white",btnName:i.i18n.t("client.default.BTN_RETRY"),type:1})}else{var c=document.getElementById("".concat(i.id,"-loading-item-txt"));i.Theme.decoderState&&i.Theme.decoderState.state.play&&(null===c||-1===c.innerHTML.indexOf("设备已加密"))&&(l.pluginStatus.loadingClear(),l.pluginStatus.loadingSetText({text:i.i18n.t("client.play.DEVICE_ENCRYPTED"),color:"red"}))}else l.pluginStatus.loadingClear();if(!d){var u=function(i){var n=_("begin",l.url);"function"==typeof e.handleError&&e.handleError({retcode:h,data:t(t({},f),{},{time:Number.isNaN(i)||void 0===i?n||(new Date).Format("yyyyMMdd")+"000000":new Date(i).Format("yyyyMMddhhmmss")}),id:l.params.id,type:"handleRunTimeInfoError"})};vt(i.id);var h=-1,f={nRunTimeModule:n,nStrVersion:a,nFrameTimeStamp:r,nFrameNum:o,nErrorCode:s};i._tempSeekTime?u(i._tempSeekTime.getTime()):i.getOSDTime().then((function(e){u(Number.isNaN(e.data)?void 0:1e3*e.data)})),setTimeout((function(){i.jSPlugin.JS_Stop(0),i.Theme&&i.Theme.setDecoderState({play:!1,sound:!1,recordvideo:!1,talk:!1,zoom:!1,capturePicture:!1})}),1e3)}d=!0}},void 0!==e.handleTalkSuccess&&(i.handleTalkSuccess=e.handleTalkSuccess),void 0!==e.handleTalkError&&(i.handleTalkError=e.handleTalkError),i.jSPlugin=c;var u=setInterval((function(){window.JSPlayerModuleLoaded&&(clearInterval(u),"function"==typeof i.params.handleInitSuccess&&i.params.handleInitSuccess({retcode:0,id:i.params.id,type:"handleInitSuccess"}),a({meta:{retcode:200,msg:i.i18n.t("client.init.INIT_SUCCESS")}}))}),50)}));return this.themeId&&(console.log(this.themeId),1==e.isCall?this.Theme=new Je(this,e.id):1==e.isInspect?this.Theme=new xt(this):this.Theme=new Ae(this,e.id),window.EZUIKit[e.id].state.EZUIKitPlayer.themeInit=!0,"function"==typeof this.params.handleThemeChange&&(this.handleThemeChange=this.params.handleThemeChange)),u}},{key:"_getRealUrlPromise",value:function(e,t){var i=this;console.log("开始获取ws播放地址: url => ".concat(t," ").concat(this.accessToken));var n=this;this.startGetWsTime=Date.now(),this.startGetWsUrlTime=(new Date).getTime();var r=this.env.domain;this.env&&(r=this.env.domain);var o=function(o,c){var d="",u=r+"/api/lapp/live/url/ezopen",h=new FormData;if(h.append("ezopen",t),h.append("isFlv","false"),h.append("userAgent",window.navigator.userAgent),h.append("isHttp","false"),h.append("accessToken",e),i.params.extraParams&&i.params.extraParams.ezopenParams&&"object"===a(i.params.extraParams.ezopenParams))for(var f in i.params.extraParams.ezopenParams)h.append(f,i.params.extraParams.ezopenParams[f]);var x=new AbortController;i._controllers.push(x),fetch(u,{method:"POST",signal:x.signal,body:h}).then((function(e){try{return e.json()}catch(e){var t={type:"fail"};return c(t),t}})).then((function(e){if(200==e.code||0==e.retcode){var u="",h="";e.ext&&e.ext.token?(d+=e.data,h=e.ext.token,u=e.data):e.data&&e.data.token&&(d+=e.data.url,h=e.data.token,u=e.data.url);var f=-1!==t.indexOf("live")?"live":"playback",x=_("checkCode",d="live"===f?d+"&ssn="+h+"&auth=1&biz=4&cln=100":d+"&ssn="+h+"&auth=1&cln=100");if(x&&(void 0!==i.jSPlugin.decoderVersion&&"2.0"===i.jSPlugin.decoderVersion?i.validateCode=x:(console.log("设置密钥",x),i.validateCode=x,i.jSPlugin.JS_SetSecretKey(0,x))),i.params.extraParams&&i.params.extraParams.wsParams)if("string"==typeof i.params.extraParams.wsParams)d+="&"+i.params.extraParams.wsParams;else if("object"===a(i.params.extraParams.wsParams))for(var p in i.params.extraParams.wsParams)d+="&"+p+"="+i.params.extraParams.wsParams[p];if(-1!==d.indexOf("playback")){var m,g,v=_("begin",u)||_("begin",t),y=_("end",u)||_("end",t);if(""!==_("timeZone",t)){var S=parseInt(_("timeZone",t));S<24&&S>-24?n.timeZone=S:(n.timeZone=0,console.warn("timeZone时区参数错误,取值范围为-23~23"))}else t.indexOf("timeZone=")>-1&&(d=d.replace("timeZone=","timeZone=0"));if(v?(m=s(v,"000000",n.timeZone),d=d.replace("&begin="+_("begin",u),""),d+="&begin="+m):(m=J((F=(new Date).Format("yyyyMMdd")+"000000",A=parseInt(F.substring(0,4),10),M=parseInt(F.substring(4,6),10)-1,L=parseInt(F.substring(6,8),10),B=parseInt(F.substring(8,10),10),O=parseInt(F.substring(10,12),10),j=parseInt(F.substring(12,14),10),new Date(A,M,L,B,O,j)),n.timeZone).Format("yyyyMMddThhmmssZ"),d=d+"&begin="+m),y?(g=s(y,"235959",n.timeZone),d=d.replace("&end="+_("end",u),"")):g=v?s(s(v,"000000",n.timeZone).substr(0,8),"235959"):J(new Date,n.timeZone).Format("yyyyMMdd")+"T235959Z",m.slice(0,8)!==g.slice(0,8)&&(g=m.slice(0,8)+g.slice(8)),d=d+"&end="+g,_("stream",u)||(d=d.replace("stream","&stream")),n._isCloudRecord&&-1!==t.indexOf(".cloud")&&"7"===_("busType",n.url)){var b=l(_("begin",d)),P=l(_("end",d)),E=_("serial",d),T=_("chn",d),R={accessToken:i.accessToken,deviceSerial:E,channelNo:T,startTime:b,endTime:P,spaceId:i._spaceId},w=[];Y(i,R).then((function(e){!function(e){if(e.data&&e.data&&e.data.length>0){w=w.concat(e.data);var t=JSON.stringify(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];function i(e){var i={};return t.forEach((function(t){i[t]=e[t]})),i.istorageVersion&&(i.iStorageVersion=i.istorageVersion,delete i.istorageVersion),i}return e.reduce((function(e,t,n){return 0===n?(e.push(i(t)),e):(e[e.length-1].downloadPath===t.downloadPath?e[e.length-1].endTime=t.endTime:e.push(i(t)),e)}),[])}(w,["downloadPath","ownerId","istorageVersion","spaceId","startTime","endTime","videoType","busType"])).replace("\\","");d+="&recSlice="+t.replace("\\","")+"&r="+Math.random(),o(d)}else c({retcode:-1,msg:n.i18n.t("client.cloudRecord.NO_CLOUD_RECORD")})}(e)})).catch((function(e){c({retcode:-1,msg:n.i18n.t("client.cloudRecord.NO_CLOUD_RECORD")})}))}else if(-1!==t.indexOf(".cloud")&&"7"!==_("busType",i.url)){b=l(_("begin",d)),P=l(_("end",d)),E=_("serial",d),T=_("chn",d);var I=r+"/api/lapp/video/by/time",D={accessToken:n.accessToken,recType:1,deviceSerial:E,channelNo:T,startTime:b,endTime:P,version:"2.0"};C(I,"POST",D,"",(function(e){if(200==e.code){var t=[];if(e.data&&e.data.files&&e.data.files.length>0){var i=e.data.files,a=(new Date).getTime();if(e.data.isAll){t=s(i);var r=JSON.stringify(t).replace("\\","");d+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),o(d)}else{!function e(){D.startTime=a,C(I,"POST",D,"",(function(n){if(n.data&&n.data.files&&n.data.files.length>0)if(0==n.data.isAll)n.data.files&&(i=i.concat(n.data.files)),a=n.data.nextFileTime>0?n.data.nextFileTime:(new Date).getTime(),e();else{t=s(i);var r=JSON.stringify(t).replace("\\","");d+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),o(d)}else{t=s(i);r=JSON.stringify(t).replace("\\","");d+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),o(d)}}))}()}}else c({retcode:-1,msg:n.i18n.t("client.play.NO_RECORD")})}else c({retcode:-1,msg:n.i18n.t("client.play.NO_RECORD")});function s(e){var t=[];return e.forEach((function(e,i){0==t.length||e.downloadPath!==t[t.length-1].downloadPath?t.push({downloadPath:e.downloadPath,ownerId:e.ownerId,iStorageVersion:e.iStorageVersion,videoType:e.videoType,iPlaySpeed:0,startTime:e.startTime,endTime:e.endTime}):t[t.length-1].endTime=e.endTime})),t}}))}else if(-1!==t.indexOf("alarmId")){console.log("进入alarmId回放");var k=_("alarmId",d);b=l(_("begin",d)),P=l(_("end",d)),E=_("serial",d),T=_("chn",d),I=r+"/api/lapp/video/by/id",D={accessToken:n.accessToken,deviceSerial:E,channelNo:T,alarmId:k};C(I,"POST",D,"",(function(e){if(200==e.code){var t=[];if(e.data){t=function(e){var t=[];return e.forEach((function(e,i){0==t.length||e.downloadPath!==t[t.length-1].downloadPath?t.push({downloadPath:e.downloadPath,ownerId:e.ownerId,iStorageVersion:e.iStorageVersion,videoType:e.videoType,iPlaySpeed:0,startTime:e.startTime,endTime:e.endTime}):t[t.length-1].endTime=e.endTime})),console.log("downloadPathArr",t),t}([e.data]);var i=JSON.stringify(t).replace("\\","");d+="&recSlice="+i.replace("\\",""),console.log("realUrl",d,e.data.recType),d=1==e.data.recType?d.replace("/playback","/cloudplayback"):d.replace("/cloudplayback","/playback"),o(d)}}}))}else o(d)}else o(d)}else"fail"!==e.type?(i.Theme&&(i.Theme.setDisabled(!0),i.Theme.setDecoderState({play:!1})),i.pluginStatus.setPlayStatus({play:!1}),i.pluginStatus.loadingClear(),i.isInspect?(i.Theme.jSPlugin.Zoom&&i.Theme.jSPlugin.Zoom.stopZoom(),i.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(i.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:e.msg,color:"white",btnName:i.i18n.t("client.default.BTN_RETRY"),type:1}),i.Theme&&i.Theme.inspect&&i.Theme.inspect.InspectEvent&&i.Theme.inspect.InspectEvent.disableEvidenceBtn()):i.pluginStatus.loadingSetText({text:e.msg,color:"red"}),setTimeout((function(){vt(i.id)}),200),setTimeout((function(){vt(i.id)}),200),c(e)):"fail"===e.type&&c(e);var F,A,M,L,B,O,j})).catch((function(e){console.error(e),c({type:"fail"})}))};return new Promise((function(e,t){return o(e,t)}));function s(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(i<=-24||i>=24)&&(i=0);if(/^[0-9]{8}T[0-9]{6}Z$/.test(e))e=e.replace("T","").replace("Z","");else{if(!/[0-9]{8,14}/.test(e))throw new Error("回放时间格式有误,请确认");var n=6-(14-e.length),r=t.length;e+=t.substring(n,r)}var o=60*i*60*1e3,s=function(e){"object"!==a(e)&&(e=new Date(e));var t=e.getFullYear(),i=(e.getMonth()+1).toString().padStart(2,"0"),n=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),s=e.getSeconds().toString().padStart(2,"0");return"".concat(t).concat(i).concat(n).concat(r).concat(o).concat(s)}(new Date(parseInt(e.slice(0,4)),parseInt(e.slice(4,6))-1,parseInt(e.slice(6,8)),parseInt(e.slice(8,10)),parseInt(e.slice(10,12)),parseInt(e.slice(12,14))).getTime()+o);return s.slice(0,8)+"T"+s.slice(8)+"Z"}function l(e){var t=e.slice(0,4),i=e.slice(4,6),n=e.slice(6,8),a=e.slice(9,11),r=e.slice(11,13),o=e.slice(13,15);return new Date((t+"-"+i+"-"+n+" "+a+":"+r+":"+o).replace(/-/g,"/")).getTime()}}},{key:"_pluginPlay",value:function(e,t,i){var n=this;if(console.log("执行播放 _pluginPlay",e),!e)return!1;function a(e){var t=e.split("?")[0].replace("/live","").replace("/playback",""),i=(-1===e.indexOf("/live")?-1!==e.indexOf("cloudplayback")?"/cloudplayback?":"/playback?":"/live?")+e.split("?")[1];return-1!==i.indexOf("/playback")&&(i=i.replace("stream=2","stream=1")),{websocketConnectUrl:t,websocketStreamingParam:i}}var r=a(e).websocketConnectUrl;this.env&&this.env.wsUrl&&(r=this.env.wsUrl),this.doCreateWsTime=Date.now(),this.gotWsUrlTime=(new Date).getTime();var o={playURL:a(e).websocketStreamingParam};console.log("播放前 stop 阶段 结束"),this.isStoping=!1;var s=Date.now();console.log("执行播放 ... this.jSPlugin.JS_Play at ",s),this.jSPlugin&&this.jSPlugin.JS_Play(r,o,0).then((function(){if(console.log("执行播放 ... this.jSPlugin.JS_Play 播放成功",r,o),console.log("执行播放耗时 ",Date.now()-s),n.isStoping)console.log("现在在播放前 stop 阶段,此次应为无效播放成功触发。不执行后续回调, 此次耗时无效");else{if(n.validateCode&&void 0!==n.jSPlugin.decoderVersion&&"2.0"===n.jSPlugin.decoderVersion&&n.jSPlugin.JS_SetSecretKey(0,n.validateCode),n.pluginStatus.loadingClear(),n.pluginStatus.setPlayStatus({play:!0,loading:!1}),n.Theme){if(n.Theme.setDecoderState({play:!0}),!n.isCall&&Object.keys(n.Theme.themeData).length>0)var e=k.findIndex(n.Theme.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;n.audio=e}n.audio&&setTimeout((function(){n.openSound()}),100),"function"==typeof n.params.handleSuccess&&n.params.handleSuccess({retcode:0,id:n.params.id,type:"handleSuccess"}),t(o)}}),(function(e){console.log("err",e);var t=n.i18n.t("client.play.PLAY_FAILED"),a=-1;if(n.jSPlugin&&n.jSPlugin.bPlay)return!1;e&&e.errorCode&&(n.Theme&&n.Theme.setDisabled(!0),t=n.i18n.t("stream."+e.errorCode),a=e.errorCode),n.isCall?n.Theme&&n.Theme.decoderState&&n.Theme.decoderState.state.rejection||(n.pluginStatus.loadingClear(),n.pluginStatus.loadingSetTextWithBtn({text:t,color:"white",btnName:n.isMobile?n.i18n.t("client.default.BTN_RETRY"):n.i18n.t("client.default.BTN_RELOAD"),isMobile:n.isMobile})):(n.pluginStatus.loadingClear(),n.isInspect?(n.Theme.jSPlugin.Zoom&&n.Theme.jSPlugin.Zoom.stopZoom(),5404===a?document.getElementById("".concat(n.id,"-no - inspect - box"))||n.Theme&&n.Theme.inspectEnding():n.pluginStatus.loadingSetTextWithBtn({mask:!0,text:t,color:"white",btnName:n.i18n.t("client.default.BTN_RETRY"),type:1}),n.Theme&&n.Theme.inspect&&n.Theme.inspect.InspectEvent&&n.Theme.inspect.InspectEvent.disableEvidenceBtn()):n._destroy||n.pluginStatus.loadingSetText({text:t,color:"red"})),"function"==typeof n.params.handleError&&n.params.handleError({retcode:a,msg:t,id:n.params.id,type:"handleError"}),i()}))}},{key:"_play",value:function(e){var t=this;console.log("执行播放 play options.url =>",e),vt(this.id),this.pluginStatus.setPlayStatus({play:!1,loading:!0}),this.playStartTime=(new Date).getTime(),e&&("string"==typeof e&&(this.url=e),"string"==typeof e.url&&(this.url=e.url),"string"==typeof e.accessToken&&(this.accessToken=e.accessToken),"string"==typeof P(this.url).deviceSerial&&(this.deviceSerial=P(this.url).deviceSerial),"string"==typeof P(this.url).channelNo&&(this.channelNo=P(this.url).channelNo),!this.Theme||"string"!=typeof e.url&&"string"!=typeof e.accessToken||this.Theme.getDeviceInfo((function(e){})));var i=new Promise((function(e,i){console.log("执行 播放前 stop"),t.isStoping=!0,t.jSPlugin.JS_Stop(0).then((function(){t.stopTime=Date.now(),console.log("播放前 stop 执行成功 this.url => ".concat(t.url," ").concat(t.accessToken)),t._getRealUrlPromise(t.accessToken,t.url).then((function(n){t._pluginPlay(n,(function(i){if(console.log("---------------------播放成功回调"),console.log("this.videoPlayState",t.videoPlayState),t.eventEmitter&&t.eventEmitter.emit("play",{eventType:"play",code:0,target:t,msg:t.i18n.t("client.play.PLAY_SUCCESS")}),1===t.videoPlayState||4===t.videoPlayState){t.videoPlayState=2;var n=Date.now();t.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:t.isV3?"v3":"v1",loadTime:n-t.videoInitTime,loadTimeDesc:{initTime:t.playStartTime-t.videoInitTime,stopTime:t.stopTime-t.playStartTime,getWsTime:t.doCreateWsTime-t.stopTime,createWsTime:n-t.doCreateWsTime}}})}setTimeout((function(){t.pluginStatus.loadingClear(),t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection&&(console.log("挂断/拒绝状态------------stop"),t.stop((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("client.call.CALL_END"),color:"white",isMobile:t.isMobile,type:2})})));var e=t.jSPlugin._JSPlayM4_GetFrameInfo(0);t.jSPlugin._JSPlayM4_SetDisplayRegion(0,e.width,0,e.height,!1)}),500),t.jSPlugin&&t._FECSplitIds&&t._FECCorrectType&&t.jSPlugin.JS_FECCorrectType(t._FECCorrectType,t._FECSplitIds),t.waterMark_JSPlugin&&t.setWaterMarkFont(t.waterMark_JSPlugin),e(!0)}),(function(){return i(!1)}))})).catch((function(e){var n=Date.now();1===t.videoPlayState||4===t.videoPlayState?(t.videoPlayState=3,t.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:t.isV3?"v3":"v1",err:e,loadTime:n-t.videoInitTime}})):2===t.videoPlayState&&(t.videoPlayState=5,t.monitorReport&&window.ezuikitMonitor.report({action:5,logInfo:{pluginVersion:t.isV3?"v3":"v1",err:e,loadTime:n-t.videoInitTime}}));var a=e.msg?e.msg:t.i18n.t("client.play.PLAY_FAILED");t.Theme&&t.Theme.setDisabled(!0),t.isCall?t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection?e&&20018==e.code?t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("client.call.USER_DO_NOT_OWN_DEVICE"),color:"white",isMobile:t.isMobile,type:2}):t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("client.call.CALL_END"),color:"white",isMobile:t.isMobile,type:2}):e&&20018==e.code?(t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("client.call.USER_DO_NOT_OWN_DEVICE"),color:"white",isMobile:t.isMobile,type:2}),!t.isWebConsole&&t.Theme&&t.Theme.call&&t.Theme.call.userNoDevice()):t.pluginStatus.loadingSetTextWithBtn({text:a,color:"white",btnName:t.isMobile?t.i18n.t("client.default.BTN_RETRY"):t.i18n.t("client.default.BTN_RELOAD"),isMobile:t.isMobile}):t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:a,color:"white",btnName:t.i18n.t("client.default.BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):(console.error("播放失败,请检查设备及客户端网络",e),t.pluginStatus.loadingSetText({text:a,color:"red"})),"function"==typeof t.params.handleError&&t.params.handleError({retcode:e.oError?e.oError.errorCode:e.code||-1,msg:a,id:t.params.id,type:"handleError"}),t.eventEmitter&&t.eventEmitter.emit("play",{eventType:"play",code:e.oError?e.oError.errorCode:e.code||-1,target:t,msg:e.msg?e.msg:t.i18n.t("client.play.PLAY_FAILED")}),i({retcode:e.oError?e.oError.errorCode:e.code||-1,msg:a,id:t.params.id,type:"handleError"})}))}))}));return i}},{key:"stop",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return this._abortFetch(),this.pluginStatus.setPlayStatus({loading:!0}),this.reSetTheme(),this.jSPlugin.JS_Stop(0).then((function(){console.log("停止成功"),e.pluginStatus.setPlayStatus({play:!1,loading:!1}),e.Theme&&e.Theme.setDecoderState({play:!1}),e.eventEmitter&&e.eventEmitter.emit("stop",{eventType:"stop",code:0,target:e,msg:e.i18n.t("client.play.STOP_SUCCESS")}),t()}))}},{key:"changeVideoLevel",value:function(e){var t=this.url,i=t;"number"==typeof e&&(i=1===e?t.replace(".live",".hd.live"):t.replace(".hd.live",".live"),this.jSPlugin.playURL=e?this.jSPlugin.playURL.replace("stream=2","stream=1"):this.jSPlugin.playURL.replace("stream=1","stream=2"),console.warn("changeVideoLevel","该方法将不在支持传入number类型的参数,建议使用对象类型的参数")),"object"===a(e)&&("number"==typeof e.streamType&&["sd","hd"].includes(e.level)&&(i="hd"===e.level?t.replace(".live",".hd.live"):t.replace(".hd.live",".live")),this.jSPlugin.playURL=1===e.streamType?this.jSPlugin.playURL.replace("stream=2","stream=1"):this.jSPlugin.playURL.replace("stream=1","stream=2")),this.url=i;var n=this.changePlayUrl({url:i},(function(){}),!1);return this.eventEmitter&&this.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:0,target:this,data:e,msg:this.i18n.t("client.videoLevel.CHANGE_VIDEO_LEVEL")}),m(n)?n:new Promise((function(e){e(n)}))}},{key:"reSetTheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.Theme&&this.Theme.Ptz&&this.Theme.decoderState.state.pantile&&(this.Theme.setDecoderState({pantile:!1}),this.Theme.Ptz.hide()),this.Theme&&this.Theme.decoderState.state.recordvideo&&this.Theme.setDecoderState({recordvideo:!1}),e.indexOf("zoom")>-1&&(this.use3DZoom?(this.is3DZooming=!1,this.close3DZoom()):(this.Zoom&&this.Zoom.currentScale>1&&this.Zoom.stopZoom(),this.Theme&&this.Theme.setDecoderState({zoom:!1}))),this.Theme&&this.Theme.decoderState.state.talk&&(this.stopTalk(),this.Theme.setDecoderState({talk:!1})),this.Theme&&this.Theme.Rec&&!this.Theme.isMobile&&this.Theme.Rec.datepickerHide(),this.Theme&&this.Theme.Rec&&(this.Theme.changeRecSpeed(1),this.Theme.nextRate=1,this.speed=1,this.Theme.setDecoderState({speed:!1})),this.eventEmitter&&this.eventEmitter.emit("reSetTheme",{eventType:"reSetTheme",code:0,target:this,msg:this.i18n.t("client.theme.RESET_THEME")})}},{key:"_changePlayUrl",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this;this.Theme&&(this.Theme.setDecoderState({play:!1}),this.Theme.setDisabled(!0)),setTimeout((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingStart(t.id),t.pluginStatus.loadingSetText({text:t.i18n.t("client.default.LOADING")})}),100),this.reSetTheme(["zoom"]),this.getDeviceCapacity({accessToken:e.accessToken||this.accessToken,deviceSerial:e.deviceSerial||this.deviceSerial});var r=this.url,o=this._spaceId,s=this._isCloudRecord,l=function(e,t){if(t.url)return t.url;var i=e.split("/")[4].split(".")[e.split("/")[4].split(".").length-1].split("?")[0];"rec"===i&&-1!==e.indexOf(".cloud.rec")&&(i="cloud.rec");t.type&&(i="miniRec"==t.type?"rec":t.type);var n=e.split("/")[3];t.deviceSerial&&(n=t.deviceSerial);var r=e.split("/")[4].split(".")[0];t.channelNo&&(r=t.channelNo);var l=2===e.split("/")[2].split("@").length?e.split("/")[2].split("@")[0]:"";void 0!==t.validCode&&(l=t.validCode);var c=void 0===t.hd?-1!==e.indexOf(".hd"):t.hd,d="ezopen://".concat(l?"".concat(l,"@"):"").concat(a.host,"/").concat(n,"/").concat(r).concat(c?".hd":"",".").concat(i);if(""!==_("timeZone",e)){var u=parseInt(_("timeZone",e));u<24&&u>-24?a.timeZone=u:(a.timeZone=0,console.warn("timeZone时区参数错误,取值范围为-23~23"))}if("live"===i)return d;d="ezopen://".concat(l?"".concat(l,"@"):"").concat(a.host,"/").concat(n,"/").concat(r,".").concat(i),t.begin&&t.end?d+="?begin=".concat(t.begin,"&end=").concat(t.end):t.begin?d+="?begin=".concat(t.begin):_("begin",e)&&_("end",e)?d+="?begin=".concat(_("begin",e),"&end=").concat(_("end",e)):_("begin",e)&&(d+="?begin=".concat(_("begin",e)));s&&-1!==d.indexOf("cloud.rec")&&(d+="".concat(-1!==d.indexOf("?")?"&":"?","busType=7").concat(o?"&spaceId=".concat(o):""));return d}(r,e);e.accessToken&&(this.accessToken=e.accessToken,this.deviceSerial=e.deviceSerial,this.channelNo=e.channelNo),this.url=l,this.videoInitTime=Date.now(),this.videoPlayState=1,window.monitorExtendsInfo={protocol:"ezopen",url:this.url,serial:this.deviceSerial,no:this.channelNo,env:this.env.domain,type:P(this.url).type};var c=Object.assign({},a.params);return delete c.accessToken,delete c.url,this.monitorReport&&window.ezuikitMonitor.report({action:4,logInfo:{pluginVersion:this.isV3?"v3":"v1",type:P(this.url).type,params:c}}),i(),new Promise((function(i,a){var r={url:l};return e.accessToken&&(r.accessToken=e.accessToken),console.log("切换播放地址 参数 ",r),t.play(r).then((function(){console.log("切换播放地址 play 执行成功 ",t.url,t.accessToken),n&&(e.type?t.Theme&&("rec"==e.type||"cloud.rec"==e.type?t.Theme.changeTheme(t.isMobile?"mobileRec":"pcRec"):"miniRec"==e.type?t.Theme.changeTheme("miniRec"):(t.Theme.changeTheme(t.isMobile?"mobileLive":"pcLive"),t.Theme.Rec&&t.Theme.Rec.unSyncTimeLine())):t.Theme&&(t.url.indexOf(".rec")>-1?t.Theme.changeTheme(t.isMobile?"mobileRec":"pcRec"):(t.isCall?t.Theme.changeTheme(t.isMobile?"mobileCall":"webCall"):t.Theme.changeTheme(t.themeId),t.Theme.Rec&&t.Theme.Rec.unSyncTimeLine()))),e&&e.begin&&e.deviceSerial&&t.Theme&&t.Theme.Rec.setDatepickerDate(e.begin),t.Theme&&(t.Theme.setDisabled(!1),t.Theme.Zoom&&t.Theme.Zoom.stopZoom()),t.eventEmitter&&t.eventEmitter.emit("changePlayUrl",{eventType:"changePlayUrl",code:0,target:t,msg:t.i18n.t("client.play.CHANGE_PLAYURL_SUCCESS")}),i(l)})).catch((function(e){a(l),t.eventEmitter&&t.eventEmitter.emit("changePlayUrl",{eventType:"changePlayUrl",code:-1,target:t,msg:e&&e.msg?e.msg:t.i18n.t("client.play.CHANGE_PLAYURL_FAILED")}),e&&e.msg&&(t.pluginStatus.loadingClear(),t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:e.msg,color:"white",btnName:t.i18n.t("client.default.BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:e.msg,color:"red"}))}))}))}},{key:"getOSDTime",value:function(){var e=this;return new Promise((function(t,i){e.jSPlugin.JS_GetOSDTime(0).then((function(i){e.eventEmitter&&e.eventEmitter.emit("getOSDTime",{eventType:"getOSDTime",code:0,target:e,data:i,msg:e.i18n.t("client.play.GET_OSD_TIME")}),t({code:0,retcode:0,data:i}),"function"==typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:0,data:i})})).catch((function(t){e.eventEmitter&&e.eventEmitter.emit("getOSDTime",{eventType:"getOSDTime",code:-1,target:e,msg:t||e.i18n.t("client.play.GET_OSD_TIME")}),i({code:-1,retcode:-1,data:t}),"function"==typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:-1,data:-1})}))}))}},{key:"capturePicture",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.jSPlugin.JS_CapturePicture(0,e||(new Date).getTime(),"JPEG",i,!!i);if(m(n))return new Promise((function(e,i){n.then((function(i){"function"==typeof t.params.capturePictureCallBack&&t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:0});var n={id:t.id,code:0,data:i.data,type:"handleCapturePicture"};t.eventEmitter&&t.eventEmitter.emit("capturePicture",{eventType:"capturePicture",code:0,target:t,data:i.data,msg:t.i18n.t("client.capture.CAPTURE_SUCCESS")}),"function"==typeof t.params.handleCapturePicture&&t.params.handleCapturePicture(n),e(n)}),(function(e){"function"==typeof t.params.capturePictureCallBack&&t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:-1}),t.eventEmitter&&t.eventEmitter.emit("capturePicture",{eventType:"capturePicture",code:-1,target:t,msg:e||t.i18n.t("client.capture.CAPTURE_FAILED")});var n=Object.assign({id:t.id,type:"handleCapturePicture",code:-1},e);"function"==typeof t.params.handleCapturePicture&&t.params.handleCapturePicture(n),i(n)}))}))}},{key:"startSave",value:function(e){var t=this,i=this.jSPlugin.JS_StartSave(0,e),n=this;return m(i)?(i.then((function(){"function"==typeof n.params.startSaveCallBack&&n.params.startSaveCallBack({id:n.id,type:"startSave",code:0}),n.eventEmitter&&n.eventEmitter.emit("startSave",{eventType:"startSave",code:0,target:n,msg:t.i18n.t("client.record.START_RECORD_SUCCESS")})})).catch((function(e){console.log(e),n.eventEmitter&&n.eventEmitter.emit("startSave",{eventType:"startSave",code:-1,target:n,msg:t.i18n.t("client.record.START_RECORD_FAILED")}),"function"==typeof n.params.startSaveCallBack&&n.params.startSaveCallBack({id:n.id,type:"startSave",code:-1})})),i):(this.Theme&&this.Theme.setDecoderState({recordvideo:!0}),new Promise((function(e){e(i)})))}},{key:"stopSave",value:function(){var e=this,t=this.jSPlugin.JS_StopSave(0),i=this;return m(t)?(t.then((function(){i.eventEmitter&&i.eventEmitter.emit("stopSave",{eventType:"stopSave",code:0,target:i,msg:e.i18n.t("client.record.STOP_RECORD_SUCCESS")}),"function"==typeof i.params.stopSaveCallBack&&i.params.stopSaveCallBack({id:i.id,type:"stopSave",code:0})})).catch((function(){i.eventEmitter&&i.eventEmitter.emit("stopSave",{eventType:"stopSave",code:-1,target:i,msg:e.i18n.t("client.record.STOP_RECORD_FAILED")}),"function"==typeof i.params.stopSaveCallBack&&i.params.stopSaveCallBack({id:i.id,type:"stopSave",code:-1})})),t):(this.Theme&&this.Theme.setDecoderState({recordvideo:!1}),new Promise((function(e){e(t)})))}},{key:"openSound",value:function(){var e=this.jSPlugin.JS_OpenSound(0);return console.log("打开声音",e),this.eventEmitter&&this.eventEmitter.emit("openSound",{eventType:"openSound",code:e,target:this,msg:this.i18n.t("client.sound.OPEN_SOUND")}),m(e)?e:(this.Theme&&this.Theme.setDecoderState({sound:!0}),"function"==typeof this.params.openSoundCallBack&&this.params.openSoundCallBack({id:this.id,type:"openSound",code:e}),new Promise((function(t){t(e)})))}},{key:"closeSound",value:function(){var e=this.jSPlugin.JS_CloseSound(0);return this.eventEmitter&&this.eventEmitter.emit("closeSound",{eventType:"closeSound",code:e,target:this,msg:this.i18n.t("client.sound.CLOSE_SOUND")}),m(e)?e:(this.Theme&&this.Theme.setDecoderState({sound:!1}),"function"==typeof this.params.closeSoundCallBack&&this.params.closeSoundCallBack({id:this.id,type:"closeSound",code:e}),new Promise((function(t){t(e)})))}},{key:"enableZoom",value:function(){var e=this.jSPlugin.JS_EnableZoom(0);return this.eventEmitter&&this.eventEmitter.emit("startZoom",{eventType:"startZoom",code:e,target:this,msg:this.i18n.t("client.zoom.START_ZOOM")}),m(e)?e:new Promise((function(t){t(e)}))}},{key:"closeZoom",value:function(){var e=this.jSPlugin.JS_DisableZoom(0);return this.eventEmitter&&this.eventEmitter.emit("closeZoom",{eventType:"closeZoom",code:e,target:this,msg:this.i18n.t("client.zoom.CLOSE_ZOOM")}),m(e)?e:new Promise((function(t){t(e)}))}},{key:"zoomAdd",value:function(e){this.Zoom&&this.Zoom.addScale(e)}},{key:"zoomSub",value:function(e){this.Zoom&&this.Zoom.subScale(e)}},{key:"enable3DZoom",value:function(){var e=this;if(!this.use3DZoom)return new Promise((function(e,t){this.eventEmitter&&this.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:this,msg:this.i18n.t("client.zoom.3D_ZOOM_DISABLE")}),t({code:-1,msg:this.i18n.t("client.zoom.3D_ZOOM_DISABLE")})}));if(this.is3DZooming)return new Promise((function(e,t){this.eventEmitter&&this.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:this,msg:this.i18n.t("client.zoom.3D_ZOOM_ACTIVED")}),t({code:-1,msg:this.i18n.t("client.zoom.3D_ZOOM_ACTIVED")})}));if(this.isMobile||(this.Zoom&&this.Zoom.stopZoom(),this.Theme&&this.Theme.setDecoderState({zoom:!1})),this.support3DZoom){this.is3DZooming=!0,this.Theme&&this.Theme.setDecoderState({zoom:!0}),document.getElementById("".concat(this.id,"-zoom-content"))&&(document.getElementById("".concat(this.id,"-zoom-content")).title=this.i18n.t("client.zoom.3D_ZOOM"));var t=this.jSPlugin.JS_Enable3DZoom(0,(function(t){var i=e.Theme&&e.Theme.decoderState.state.expend&&e.isMobile?e.fullScreenWidth:e.width,n=e.Theme&&e.Theme.decoderState.state.expend&&e.isMobile?e.fullScreenHeight:e.height,a=function(e,t){if(!e||!e.startPos||!e.endPos)return-1;var i=e.startPos[0],n=e.startPos[1],a=e.endPos[0],r=e.endPos[1];return t?a>i&&r<n?1:a<i&&r>n?0:-1:a>i&&r>n?1:a<i&&r<n?0:-1}(t,e.Theme&&e.Theme.decoderState.state.expend);if(a>-1)try{var r=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;if(!(e&&t&&i&&i.startPos&&i.endPos))return-1;var a=i.startPos[0],r=i.startPos[1],o=i.endPos[0],s=i.endPos[1],l=Math.abs(o-a),c=Math.abs(s-r),d=parseInt((a+o)/2),u=parseInt((r+s)/2),h=Math.round(e*t/(l*c));return console.log("最大缩放倍数:",n),console.log("计算缩放倍数:",e*t/(l*c)),console.log("下发缩放倍数:",h>n?n:h),{startPointX:parseInt(a/e*256),startPointY:parseInt(r/t*256),endPointX:parseInt(o/e*256),endPointY:parseInt(s/t*256),zoomRate:h>n?n:h,targetCenterX:d,targetCenterY:u,targetWidth:l,targetHeight:c}}(i,n,t,e.capacity&&e.capacity.support_zoomOut_maxTime?e.capacity.support_zoomOut_maxTime:5),o=e.env.domain+"/api/v3/das/device/3d/zoom?accessToken=".concat(e.accessToken,"&deviceSerial=").concat(P(e.url).deviceSerial,"&channelNo=").concat(P(e.url).channelNo,"&command=").concat(0==a?9:8,"&zoomTimes=").concat(r.zoomRate,"&startPointX=").concat(r.startPointX,"&startPointY=").concat(r.startPointY,"&endPointX=").concat(r.endPointX,"&endPointY=").concat(r.endPointY,"&length=").concat(parseInt(n),"&width=").concat(parseInt(i),"&midPointX=").concat(r.targetCenterX,"&midPointY=").concat(r.targetCenterY,"&lengthX=").concat(r.targetWidth,"&lengthY=").concat(r.targetHeight);fetch(o,{method:"POST"}).then((function(e){return e.json()})).then((function(t){200!=t.code&&e.pluginStatus.loadingSetText({text:t.msg,color:"red",delayClear:2e3})})).catch((function(t){e.pluginStatus.loadingSetText({text:e.i18n.t("client.zoom.3D_ZOOM_FAILED"),color:"red",delayClear:2e3})}))}catch(t){e.pluginStatus.loadingSetText({text:e.i18n.t("client.zoom.3D_ZOOM_FAILED"),color:"red",delayClear:2e3})}}));return this.Zoom=new Pe(this),this.eventEmitter&&this.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:t,target:this,msg:this.i18n.t("client.zoom.START_3D_ZOOM")}),m(t)?t:new Promise((function(e){e(t)}))}return this.is3DZooming=!1,document.getElementById("".concat(this.id,"-zoom-content"))&&(document.getElementById("".concat(this.id,"-zoom-content")).title=this.i18n.t("client.zoom.ZOOM")),new Promise((function(e,t){this.eventEmitter&&this.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:this,msg:this.i18n.t("client.zoom.DEVICE_NOT_SUPPORT_3D_ZOOM")}),t({code:-1,msg:this.i18n.t("client.zoom.DEVICE_NOT_SUPPORT_3D_ZOOM")})}))}},{key:"close3DZoom",value:function(){var e=this;if(!this.use3DZoom)return new Promise((function(t,i){e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:-1,target:e,msg:this.i18n.t("client.zoom.3D_ZOOM_NOT_ACTIVED")}),i({code:-1,msg:this.i18n.t("client.zoom.3D_ZOOM_NOT_ACTIVED")})}));if(this.is3DZooming){this.Theme&&this.Theme.setDecoderState({zoom:!1});var t=this.jSPlugin.JS_Disable3DZoom(0);return this.Zoom=new Pe(this),this.is3DZooming=!1,this.eventEmitter&&this.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:t,target:this,msg:this.i18n.t("client.zoom.CLOSE_3D_ZOOM")}),m(t)?t:new Promise((function(e){e(t)}))}return new Promise((function(e,t){this.eventEmitter&&this.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:-1,target:this,msg:this.i18n.t("client.zoom.3D_ZOOM_CLOSED")}),t({code:-1,msg:this.i18n.t("client.zoom.3D_ZOOM_CLOSED")})}))}},{key:"changeZoomType",value:function(e){var t=this;if(e&&this.capacity&&!this.support3DZoom)return this.eventEmitter&&this.eventEmitter.emit("changeZoomType",{eventType:"changeZoomType",code:-1,target:this,msg:this.i18n.t("client.zoom.DEVICE_NOT_SUPPORT_3D_ZOOM")}),{code:-1,msg:this.i18n.t("client.zoom.DEVICE_NOT_SUPPORT_3D_ZOOM")};this.is3DZooming?this.close3DZoom():this.Theme&&this.Theme.decoderState.state.zoom&&this.Zoom&&this.Zoom.stopZoom(),this.Theme&&this.Theme.setDecoderState({zoom:!1}),this.use3DZoom=e,this.Zoom=new Pe(this),setTimeout((function(){e?document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("client.zoom.3D_ZOOM")):document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("client.zoom.ZOOM")),t.isMobile&&e&&t.enable3DZoom(),t.eventEmitter&&t.eventEmitter.emit("changeZoomType",{eventType:"changeZoomType",code:0,target:t,msg:t.i18n.t("client.zoom.CHANGE_ZOOM_TYPE")})}),500)}},{key:"setPoster",value:function(e){Ah()?document.getElementById("".concat(this.id))&&(document.getElementById("".concat(this.id)).style.backgroundImage="url(".concat(e,")"),document.getElementById("".concat(this.id)).style.backgroundSize="100% 100%"):document.getElementById("".concat(this.id,"-player"))&&(document.getElementById("".concat(this.id,"-player")).style.backgroundImage="url(".concat(e,")"),document.getElementById("".concat(this.id,"-player")).style.backgroundSize="cover"),this.eventEmitter&&this.eventEmitter.emit("setPoster",{eventType:"setPoster",code:0,target:this,msg:this.i18n.t("client.play.SET_POSTER")})}},{key:"reSize",value:function(e,t){var i=0,n=0;if(this.params.height=t,this.params.width=e,this.Theme&&this.Theme.isNeedRenderHeader&&document.getElementById("".concat(this.id,"-headControl"))&&(i=parseInt(document.getElementById("".concat(this.id,"-headControl")).style.height,10)),this.Theme&&this.Theme.isNeedRenderTimeLine&&!this.isMobile&&(n=48),t=t-i-n,this.width=e,this.height=t,document.getElementById("".concat(this.id,"-wrap")).style="width:".concat(e,"px;position:relative;display:inline-block;vertical-align: bottom;"),document.getElementById("".concat(this.id)).style.width=e+"px",document.getElementById("".concat(this.id)).style.height=t+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin&&(this.jSPlugin.iHeight=t,this.jSPlugin.iWidth=e),this.jSPlugin.JS_Resize(e,t);else{document.getElementById("".concat(this.id,"-player"))&&(document.getElementById("".concat(this.id,"-player")).width=e,document.getElementById("".concat(this.id,"-player")).height=t,document.getElementById("".concat(this.id,"-player")).style.width=e+"px",document.getElementById("".concat(this.id,"-player")).style.height=t+"px",document.getElementById("".concat(this.id,"-container-0")).style.height=t+"px");var a=1;if(document.getElementById("".concat(this.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)&&(a=2),document.getElementById("".concat(this.id,"canvas0")).style.width=e*a+"px",document.getElementById("".concat(this.id,"canvas0")).style.height=t*a+"px",document.getElementById("".concat(this.id,"canvas0")).width=e*a,document.getElementById("".concat(this.id,"canvas0")).height=t*a,document.getElementById("".concat(this.id,"canvas0")).parentNode.style.width=e*a+"px",document.getElementById("".concat(this.id,"canvas0")).parentNode.style.height=t*a+"px",document.getElementById("".concat(this.id,"canvas_draw0")).height=t*a;this.jSPlugin&&(this.jSPlugin.iHeight=t*a,this.jSPlugin.iWidth=e*a)}var r=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;this.Theme.Rec&&this.Theme.Rec.recAutoSize&&!r&&this.Theme.Rec.recAutoSize(),this.isInspect&&(document.getElementById("".concat(this.id,"-wrap")).style="width:".concat(e,"px; height:").concat(t,"px;position:relative;display:inline-block;vertical-align: bottom;"),this.width-=this.inspectVideoWidth,this.height-=this.inspectVideoHeight,e=this.width,t=this.height,this.width=e,this.height=t,this.Theme.inspect.reSize(e,t)),this.eventEmitter&&this.eventEmitter.emit("reSize",{eventType:"reSize",code:0,target:this,msg:this.i18n.t("client.play.RESIZE")})}},{key:"fast",value:function(e){var t=this,i=this.speed;if(e){var n=this.jSPlugin.JS_Speed(e);this.Theme&&(this.Theme.changeRecSpeed(e),this.Theme.nextRate=e)}else{if(1===i)i=2;else{if(2!==i)return console.log("当前已经是最大播放倍数"),"function"==typeof this.params.handleError&&this.params.handleError({msg:this.i18n.t("client.play.MAX_SPEED_LIMIT"),retcode:1003,id:this.id,type:"handleError"}),new Promise((function(e,n){t.speed=i,n({code:-1,data:{speed:i,result:t.i18n.t("client.play.MAX_SPEED_LIMIT")}})}));i=4}n=this.jSPlugin.JS_Speed(i);this.Theme&&(this.Theme.changeRecSpeed(i),this.Theme.nextRate=i)}return new Promise((function(e){t.speed=i,t.eventEmitter&&t.eventEmitter.emit("fast",{eventType:"fast",code:0,data:i,target:t,msg:t.i18n.t("client.play.SPEED")}),e({code:0,data:{speed:i,result:n}})}))}},{key:"slow",value:function(){var e=this,t=this.speed;if(4===t)t=2;else{if(2!==t)return console.log("当前已经是最小播放倍数"),"function"==typeof this.params.handleError&&this.params.handleError({msg:this.i18n.t("client.play.MIN_SPEED_LIMIT"),retcode:1003,id:this.id,type:"handleError"}),new Promise((function(i,n){e.speed=t,n({code:-1,data:{speed:t,result:e.i18n.t("client.play.MIN_SPEED_LIMIT")}})}));t=1}var i=this.jSPlugin.JS_Speed(t);return new Promise((function(n){e.speed=t,e.eventEmitter&&e.eventEmitter.emit("slow",{eventType:"slow",code:0,data:t,target:e,msg:e.i18n.t("client.play.SPEED")}),n({code:0,data:{speed:t,result:i}})}))}},{key:"seek",value:function(e,t){var i=this.url,n=(_("begin",i)||(new Date).Format("yyyyMMdd")).substr(0,8);if(t=a(n,"235959"),6===e.length)e=a(n,e);else{if(16!==e.length)return"function"==typeof this.params.handleError&&(this.eventEmitter&&this.eventEmitter.emit("seek",{eventType:"seek",code:-2,target:this,msg:this.i18n.t("client.play.SEEK_TIMEFORMAT_ERROR")}),this.params.handleError({msg:this.i18n.t("client.play.SEEK_TIMEFORMAT_ERROR"),retcode:-1,id:this.id,type:"handleError"})),!1;if(e.substr(0,8)!==n)return"function"==typeof this.params.handleError&&(this.eventEmitter&&this.eventEmitter.emit("seek",{eventType:"seek",code:-1,target:this,msg:this.i18n.t("client.play.SEEK_CANNOT_CROSS_DAYS")}),this.params.handleError({msg:this.i18n.t("client.play.SEEK_CANNOT_CROSS_DAYS"),retcode:-1,id:this.id,type:"handleError"})),!1}function a(e,t){if(/^[0-9]{8}T[0-9]{6}Z$/.test(e))return e;if(/[0-9]{8,14}/.test(e)){var i=6-(14-e.length),n=t.length,a=e+t.substring(i,n);return a.slice(0,8)+"T"+a.slice(8)+"Z"}throw new Error(this.i18n.t("client.default.TIMEFORMAT_ERROR"))}var r=this.jSPlugin.JS_Seek(0,e,t);return console.log("seekRT",r),m(r)?r:new Promise((function(e){e(r)}))}},{key:"fullScreen",value:function(){var e=this;S(document.getElementById("".concat(this.id))).then((function(t){console.log("全屏promise",window.screen.availWidth),e.jSPlugin.JS_Resize(window.screen.availWidth,window.screen.availHeight),e.eventEmitter&&e.eventEmitter.emit("fullScreen",{eventType:"fullScreen",code:0,target:e,msg:e.i18n.t("client.fullscreen.FULLSCREEN")}),"function"==typeof e.params.fullScreenCallBack&&e.params.fullScreenCallBack({id:e.id,type:"fullScreen",code:0})}));var t=function(){var t=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;t||e.jSPlugin.JS_Resize(e.width,e.height),"function"==typeof e.params.fullScreenChangeCallBack&&e.params.fullScreenChangeCallBack({id:e.id,type:"fullScreen",code:t})};["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"].forEach((function(e){window.removeEventListener(e,t),window.addEventListener(e,t)}))}},{key:"cancelFullScreen",value:function(){var e=this;b().then((function(t){console.log("取消全屏",t,e.jSPlugin),e.jSPlugin.JS_Resize(e.width,e.height),e.eventEmitter&&e.eventEmitter.emit("cancelFullScreen",{eventType:"cancelFullScreen",code:0,target:e,msg:e.i18n.t("client.fullscreen.FULLSCREEN_EXIT")})}))}},{key:"startTalk",value:function(){this.Talk.startTalk()}},{key:"stopTalk",value:function(){this.Talk.stopTalk()}},{key:"destroy",value:function(){this._destroy=!0,this.Theme&&(this.Theme.decoderState.state.play&&this.stop(),"function"==typeof this.Theme.destroy&&this.Theme.destroy(),this.Theme=null,window.EZUIKit[this.params.id].state.EZUIKitPlayer.themeInit=!1),window.recTimer&&Array.isArray(window.recTimer)&&window.recTimer.forEach((function(e){return clearInterval(e)})),this.recTimer&&clearInterval(this.recTimer),this._abortFetch();var e=this.jSPlugin.JS_DestroyWorker(0);return this.eventEmitter&&this.eventEmitter.emit("destroy",{eventType:"destroy",code:0,target:this,msg:this.i18n.t("client.destroy.DESTROY")}),this.jSPlugin=null,m(e)?e:new Promise((function(t){t(e)}))}},{key:"getDeviceCapacity",value:function(e){var t=this,i=this.env.domain;this.capacity={},this.env&&(i=this.env.domain);var n=i+"/api/lapp/device/capacity",a=e||{accessToken:this.accessToken,deviceSerial:P(this.url).deviceSerial};C(n,"POST",a,"",(function(e){if(t.support3DZoom=!1,document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("client.zoom.ZOOM")),200==e.code&&e.data){if(t.capacity=e.data,t.isMobile&&t.isCall&&(!t.capacity.support_doorcall_playback||1!=t.capacity.support_doorcall_playback)){if(console.log("小窗口initMiniRec-------------设备能力集失败"),t.isWebConsole)return;setTimeout((function(){document.getElementById("".concat(t.jSPlugin.id,"-wrap"))&&document.getElementById("miniRecbox")&&(document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")))}),1500)}t.capacity&&"1"==t.capacity.support_3d_position&&t.url.indexOf(".live")>-1&&(t.support3DZoom=!0,t.params.use3DZoom&&(t.use3DZoom=!0,document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("client.zoom.3D_ZOOM")))),t.eventEmitter&&t.eventEmitter.emit("getDeviceCapacity",{eventType:"getDeviceCapacity",code:0,data:e,target:t,msg:t.i18n.t("client.capacity.GET_CAPACITY")})}}))}},{key:"pause",value:function(e){var t=this;return new Promise((function(i,n){t.jSPlugin.JS_CloseSound(0),t.jSPlugin.JS_Pause(0,e).then((function(e){t.eventEmitter&&t.eventEmitter.emit("pause",{eventType:"pause",code:0,target:t,msg:t.i18n.t("client.play.PAUSE")}),t.Theme&&t.Theme.setDecoderState({play:!1,pauseDate:e.pauseDate}),i()})).catch((function(e){t.eventEmitter&&t.eventEmitter.emit("pause",{eventType:"pause",code:-1,target:t,msg:e||t.i18n.t("client.play.PAUSE_FAILED")}),console.log(e),n(e)}))}))}},{key:"_resume",value:function(e){var t=this;return new Promise((function(i,n){t.pluginStatus.setPlayStatus({play:!1,loading:!0}),t.validateCode&&""!=t.validateCode&&t.jSPlugin.JS_SetSecretKey(0,t.validateCode),t.jSPlugin.JS_Resume(e).then((function(e){(setTimeout((function(){-1!==t.url.indexOf(".rec")&&1!=t.speed&&t.jSPlugin.JS_Speed(t.speed)}),500),t.Theme)&&(t.Theme.setDecoderState({play:!0}),t.fast(t.speed),t.Theme.decoderState.state.sound&&setTimeout((function(){t.openSound()}),500));t.eventEmitter&&t.eventEmitter.emit("resume",{eventType:"resume",code:0,target:t,msg:t.i18n.t("client.play.RESUME")}),i(e)})).catch((function(e){console.log("resume err",e),t.eventEmitter&&t.eventEmitter.emit("resume",{eventType:"resume",code:-1,target:t,msg:e||t.i18n.t("client.play.RESUME_FAILED")}),n(e)}))}))}},{key:"getDefinitionList",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getDefinitionList",{eventType:"getDefinitionList",code:0,data:this.Theme?this.Theme.decoderState.state.hdList:[],target:this,msg:this.i18n.t("client.videoLevel.GET_VIDEO_LEVEL_LIST")}),this.Theme?this.Theme.decoderState.state.hdList:[]}},{key:"getDefinition",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getDefinition",{eventType:"getDefinition",code:0,data:!!this.Theme&&this.Theme.decoderState.state.hd,target:this,msg:this.i18n.t("client.videoLevel.GET_VIDEO_LEVEL_LIST")}),!!this.Theme&&this.Theme.decoderState.state.hd}},{key:"setDefinition",value:function(e){var t=this.getDefinitionList().find((function(t){return"string"==typeof e?t.level===e:"object"===a(e)?t.level===e.level:void 0}));if(!t)return this.eventEmitter&&this.eventEmitter.emit("setDefinition",{eventType:"setDefinition",code:-1,target:this,msg:this.i18n.t("client.videoLevel.PLEASE_INPUT_RIGHT_VIDEO_LEVEL")}),void console.log("请输入正确的清晰度");this.changeVideoLevel(t),this.Theme&&(this.Theme.setDecoderState({hd:t}),this.Theme.resetMobileZoomStatus()),this.Theme&&this.Theme.decoderState.state.recordvideo&&this.Theme.setDecoderState({recordvideo:!1}),this.eventEmitter&&this.eventEmitter.emit("setDefinition",{eventType:"setDefinition",code:0,target:this,msg:this.i18n.t("client.videoLevel.CHANGE_VIDEO_LEVEL")})}},{key:"getPtzStatus",value:function(){if(this.Theme)return this.eventEmitter&&this.eventEmitter.emit("getPtzStatus",{eventType:"getPtzStatus",code:0,data:!!this.Theme&&this.Theme.Ptz.showPtz,target:this,msg:this.i18n.t("client.ptz.GET_PTZ_STATUS")}),console.log("当前是否开启云台:",this.Theme.Ptz.showPtz),this.Theme.Ptz.showPtz;this.eventEmitter&&this.eventEmitter.emit("getPtzStatus",{eventType:"getPtzStatus",code:-1,data:!!this.Theme&&this.Theme.Ptz.showPtz,target:this,msg:this.i18n.t("client.ptz.GET_PTZ_STATUS_FAILED")})}},{key:"openPtz",value:function(){return this.Theme?this.isMobile&&this.Theme&&!this.Theme.decoderState.state.expend?(console.log("移动端,非全屏状态不展示云台"),this.eventEmitter&&this.eventEmitter.emit("openPtz",{eventType:"openPtz",code:-1,target:this,msg:this.i18n.t("client.ptz.MOBILE_HIDE_PTZ")}),!1):(console.log("显示云台"),this.Theme.setDecoderState({pantile:!0}),void this.Theme.Ptz.show()):(this.eventEmitter&&this.eventEmitter.emit("openPtz",{eventType:"openPtz",code:-1,target:this,msg:this.i18n.t("client.ptz.OPTION_PTZ_FAILED")}),{code:-1,msg:this.i18n.t("client.ptz.OPTION_PTZ_FAILED")})}},{key:"closePtz",value:function(){if(!this.Theme)return this.eventEmitter&&this.eventEmitter.emit("closePtz",{eventType:"closePtz",code:-1,target:this,msg:this.i18n.t("client.ptz.OPTION_PTZ_FAILED")}),{code:-1,msg:this.i18n.t("client.ptz.OPTION_PTZ_FAILED")};console.log("隐藏云台"),this.Theme.setDecoderState({pantile:!1}),this.Theme.Ptz.hide()}},{key:"isBrowserFullscreen",value:function(){if(this.Theme)return console.log("当前是否为浏览器全屏状态:",this.Theme.decoderState.state.webExpend),this.eventEmitter&&this.eventEmitter.emit("isBrowserFullscreen",{eventType:"isBrowserFullscreen",code:0,target:this,data:this.Theme.decoderState.state.webExpend,msg:this.i18n.t("client.fullscreen.GET_WEB_FULLSCREEN_STATUS")}),this.Theme.decoderState.state.webExpend}},{key:"browserFullscreen",value:function(){this.Theme&&(this.Theme.webExpend(),this.Theme.setDecoderState({webExpend:!0}),this.eventEmitter&&this.eventEmitter.emit("browserFullscreen",{eventType:"browserFullscreen",code:0,target:this,msg:this.i18n.t("client.fullscreen.WEB_FULLSCREEN")}))}},{key:"exitBrowserFullscreen",value:function(e,t){var i=this;b().then((function(n){i.jSPlugin.JS_Resize(e||i.width,t||i.height),i.Theme&&(i.Theme.Rec&&i.Theme.Rec.recAutoSize(),i.Theme.setDecoderState({webExpend:!1})),i.eventEmitter&&i.eventEmitter.emit("exitBrowserFullscreen",{eventType:"exitBrowserFullscreen",code:0,target:i,msg:i.i18n.t("client.fullscreen.WEB_FULLSCREEN_EXIT")})}))}},{key:"getPlayRate",value:function(){return console.log("当前播放速度:",this.speed),this.eventEmitter&&this.eventEmitter.emit("getPlayRate",{eventType:"getPlayRate",code:0,data:this.speed,target:this,msg:this.i18n.t("client.play.GET_SPEED")}),this.speed}},{key:"setMirrorFlip",value:function(e){return"number"!=typeof e?(this.eventEmitter&&this.eventEmitter.emit("setMirrorFlip",{eventType:"setMirrorFlip",code:-1,target:this,msg:this.i18n.t("client.mirror.MIRROR_TYPE_ERROR")}),Promise.reject({code:-1,msg:this.i18n.t("client.mirror.MIRROR_TYPE_ERROR")})):(this.eventEmitter&&this.eventEmitter.emit("setMirrorFlip",{eventType:"setMirrorFlip",code:0,target:this,msg:this.i18n.t("client.mirror.MIRROR")}),function(e,t,i,n,a){return new Promise((function(r,o){C("".concat(e,"/api/lapp/device/ptz/mirror"),"POST",{accessToken:t,deviceSerial:i,channelNo:n,command:a},"",r)}))}(this.env.domain,this.accessToken,this.deviceSerial,this.channelNo,e))}},{key:"setFECCorrectType",value:function(e,t){var i=this;if(!this.capacity||this.capacity&&"1"!==this.capacity.support_fisheye_mode)return this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("client.FEC.DEVICE_NOT_SUPPORT")}),Promise.reject({code:-1,msg:this.i18n.t("client.FEC.DEVICE_NOT_SUPPORT")});if(!window.SharedArrayBuffer||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev)return this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("client.FEC.FEC_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("client.FEC.FEC_SUPPORT_VERSION")});var n=(1===e.place?V:3===e.place?H:[]).find((function(t){return t.type===e.type&&t.place===e.place}));return n?n.split>0&&void 0===a(t)?(this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("client.FEC.NO_CANVAS_ID")}),Promise.reject({code:-1,msg:this.i18n.t("client.FEC.NO_CANVAS_ID")})):(this.jSPlugin.FECSplitIds=t,this.jSPlugin.correctType=n,this._FECCorrectType=n,this._FECSplitIds=t,this.stop().then((function(){return i.play().then((function(e){return 1===n.place&&0===n.correctType||3===n.place&&0===n.correctType?i.Theme.resumeFECBtn():i.Theme.disabledFECBtn(),i.eventEmitter&&i.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:0,target:i,msg:i.i18n.t("client.FEC.CHANGE_FEC_TYPE")}),e}))}))):(this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("client.FEC.TYPE_NOT_SUPPORT")}),Promise.reject({code:-1,msg:this.i18n.t("client.FEC.TYPE_NOT_SUPPORT")}))}},{key:"setFEC3DViewParam",value:function(e){return!this._FECCorrectType||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev?(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("client.FEC.FEC_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("client.FEC.FEC_SUPPORT_VERSION")})):this.jSPlugin.FEC_Set3DViewParam&&this._FECCorrectType&&(3===this._FECCorrectType.place&&this._FECCorrectType.correctType===U||1===this._FECCorrectType.place&&this._FECCorrectType.correctType===z)?(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:0,target:this,msg:this.i18n.t("client.FEC.SET_FEC_PARAMS")}),this.jSPlugin.FEC_Set3DViewParam(e)):(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("client.FEC.SET_FEC_PARAMS_FAILED")}),Promise.reject({code:-1,msg:this.i18n.t("client.FEC.SET_FEC_PARAMS_FAILED")}))}},{key:"getFEC3DViewParam",value:function(e){return!this._FECCorrectType||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev?(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("client.FEC.GET_FEC_PARAMS_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("client.FEC.GET_FEC_PARAMS_SUPPORT_VERSION")})):this.jSPlugin.FEC_Set3DViewParam&&this._FECCorrectType&&(3===this._FECCorrectType.place&&this._FECCorrectType.correctType===U||1===this._FECCorrectType.place&&this._FECCorrectType.correctType===z)?(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:0,target:this,data:this.jSPlugin.FEC_Get3DViewParam(e),msg:this.i18n.t("client.FEC.SET_FEC_PARAMS")}),this.jSPlugin.FEC_Get3DViewParam(e)):(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("client.FEC.SET_FEC_PARAMS_FAILED")}),Promise.reject({code:-1,msg:this.i18n.t("client.FEC.SET_FEC_PARAMS_FAILED")}))}},{key:"setWaterMarkFont",value:function(e){return this.eventEmitter&&this.eventEmitter.emit("setWaterMarkFont",{eventType:"setWaterMarkFont",code:0,target:this,msg:this.i18n.t("client.watermark.SET_WATERMARK")}),this.waterMark_JSPlugin=e,this.jSPlugin.JS_SetWaterMarkFont(e)}},{key:"_abortFetch",value:function(){this._controllers.forEach((function(e){e.abort()})),this._controllers=[]}}]),e}(),Lh=null;function Bh(e){e.responseMsg.eventName,console.log(e.responseMsg)}function Oh(){Lh.JS_SetWindowControlCallback({cbIntegrationCallBack:Bh}),Lh.JS_StartService("window",{dllPath:"./chain/cloudTransform.dll"}).then((function(){Lh.JS_CreateWnd("playWnd",900,500).then((function(){console.log("JS_CreateWnd success")}))}))}function jh(){console.log("cbConnectError"),Lh=null,console.error("确认本地进程是否已安装并开启成功!")}function Nh(e){console.log("cbConnectClose"),Lh=null}window.onscroll=function(){null!=Lh&&Lh.JS_Resize(900,500)},window.onresize=function(){null!=Lh&&Lh.JS_Resize(900,500)},window.onunload=function(){try{Lh.JS_HideWnd(),null!=Lh&&(Lh.JS_DestroyWnd().then((function(){console.log("JS_DestroyWnd")}),(function(){})),Lh.JS_StopService("window").then((function(){Lh.JS_Disconnect().then((function(){console.log("JS_Disconnect")}),(function(){}))})))}catch(e){console.error(e)}},window.onpagehide=function(){try{Lh.JS_HideWnd()}catch(e){console.error(e)}};var Uh=function(){function e(t){var i=this;r(this,e),l(this,"changeModel",(function(e,t){var n=i;i.switchVideo=parseInt(e),Lh&&Lh.JS_RequestInterface({funcName:"ChangeModel",arguments:encodeURI(JSON.stringify({model:e}))}).then((function(i){0==e?n.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode}):n.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode,startTime:t.startTime,endTime:t.endTime})}))})),l(this,"init",(function(e){var t=i;if(e.appKey&&e.accessToken){void 0!==e.appKey&&(i.appKey=e.appKey),void 0!==e.accessToken&&(i.accessToken=e.accessToken),void 0!==e.platformId&&(i.platformId=e.platformId);var n=l(l(l(l(l(l(l(l({layout:+t.layout,userName:"",waterMark:""},"waterMark","1"),"iWndType",0),"intelligenceEnable",1),"isRecord",1),"isSetPos",1),"motionDetectEnable",0),"playBackAlarmOverlyingEnable",0),"response",{code:0,message:null,data:{appKey:e.appKey,ezvizToken:e.accessToken,videoLevel:0,logLevel:3,showMainTool:1,showSubTool:1,waterMark:"1",userName:"openteam",platformId:e.platformId}});console.log("初始化入参",n),window.ezuikitMonitor.report({protocol:"hd",appKey:e.appKey,action:1,logInfo:{argumentsPram:n}}),Lh.JS_RequestInterface({funcName:"Init",arguments:encodeURI(JSON.stringify(n))}).then((function(e){console.log(e.responseMsg),t.showTips(!0,"视频初始化成功!")}))}else t.showTips(!1,"请输入appkey和token")})),l(this,"play",(function(e){var t=i;if(e.deviceSerial&&e.channelNo){void 0!==e.deviceSerial&&(i.deviceSerial=e.deviceSerial),void 0!==e.channelNo&&(i.channelNo=e.channelNo),void 0!==e.startTime&&e.startTime&&(i.startTime=e.startTime+" 00:00:00"),void 0!==e.endTime&&e.endTime&&(i.endTime=e.endTime+" 23:59:59"),void 0!==e.validateCode&&e.validateCode&&(i.validateCode=e.validateCode);var n={response:{code:0,message:null,data:{deviceSerial:e.deviceSerial,channelCode:e.channelNo,channelNo:+e.channelNo,codeIsEncrypt:0,validateCode:e.validateCode,deviceClass:t.deviceClass,deviceType:"10222",channelId:"2222222222",channelName:"channelNameTest",storeName:"storeName",storeId:"storeid",startTime:i.startTime,endTime:i.endTime}}};"1"===t.deviceClass?(n.response.data.channelCode=t.channelNo,n.response.data.platformId=t.platformId):n.response.data.channelNo=+t.channelNo,1===i.switchVideo&&(i.startTime&&(n.response.data.startTime=i.startTime),i.endTime&&(n.response.data.endTime=i.endTime)),console.log("预览/回放入参",n),Lh.JS_RequestInterface({funcName:0===i.switchVideo?"StartPreview":"StartPlayback",arguments:encodeURI(JSON.stringify(n))}).then((function(e){console.log(e.responseMsg),t.showTips(!0,"预览/回放成功!")})).catch((function(e){console.log("开始播放:",e)}))}})),l(this,"showCBInfo",(function(e){i.callbackMessage=i.callbackMessage+JSON.stringify(e)+"\n\n",console.log(i.callbackMessage)})),l(this,"showTips",(function(e,t){})),l(this,"hideVideo",(function(){Lh.JS_HideWnd()})),l(this,"showVideo",(function(){Lh.JS_ShowWnd()})),l(this,"GetLayout",(function(){Lh.JS_RequestInterface({funcName:"GetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"capturePicture",(function(e){Lh.JS_RequestInterface({funcName:"CaptureJPGEx",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"stop",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;Lh.JS_RequestInterface({funcName:"StopPlay",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"setLayout",(function(e){var t=parseInt(e);isNaN(t)||0==t||t>=13?console.log("不支持实际布局大于16的窗口数"):(i.layout=t,Lh.JS_RequestInterface({funcName:"SetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{layout:t}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)})))})),l(this,"setSoundVolumn",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1?arguments[1]:void 0;Lh.JS_RequestInterface({funcName:"SoundVolumn",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e),volumn:parseInt(t)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"testMute",(function(){var e=parseInt(prompt("请输入窗口ID"));Lh.JS_RequestInterface({funcName:"MuteOnOff",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:e}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"testSelectWnd",(function(){var e=parseInt(prompt("请输入窗口ID"));Lh.JS_RequestInterface({funcName:"SelectPlayWnd",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:e}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"setVideoLevel",(function(e,t){Lh.JS_RequestInterface({funcName:"SetVideoLevel",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:1==i.switchVideo?0:parseInt(e),level:parseInt(t,10)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"startTalk",(function(e){Lh.JS_RequestInterface({funcName:"StartTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"stopTalk",(function(e){Lh.JS_RequestInterface({funcName:"StopTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"startSave",(function(e){Lh.JS_RequestInterface({funcName:"StartRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),l(this,"stopSave",(function(e){Lh.JS_RequestInterface({funcName:"StopRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),this.appKey="b9a3ad6e8026410095d8252169fa430a",this.accessToken="at.2vtum8873rrcwbrv431qb6pn94dkbv23-8dw2twn355-1u3x014-wrthellzk",this.deviceSerial="C33368372",this.channelNo="1",this.validateCode="",this.deviceClass="0",this.platformId="",this.startTime="",this.endTime="",this.layout=2,this.switchVideo=0,this.tips="调用成功",this.successTip=!1,this.tipsShow=!1,Lh=function(e,t,i,n){return new WebControl({szPluginContainer:e,iServicePortStart:14510,iServicePortEnd:14519,cbConnectSuccess:t,cbConnectError:i,cbConnectClose:n})}("playWnd",Oh,jh,Nh)}return s(e,[{key:"alarmMsg",value:function(){var e={request:{body:{alarmTypes:[10800,0,0,0,0],channelId:"066dde0465dd4abaab6afe355baf9d0b",endTime:"1621007999000",startTime:"1620921600000"},callBack:"GetAlarmMsgOrders",majorKey:"",method:"POST",storeId:"",url:"/videoplugin/message/getMessageByTypes"},response:{code:0,message:null,data:[{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620921217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920678e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919513e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919483e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919333e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918913e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918305e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917858e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917658e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917244e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917064e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916668e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916529e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916343e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916081e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915825e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915394e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915197e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914971e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914644e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914533e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914457e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914376e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914284e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913431e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912354e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912275e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912093e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091189e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911839e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091176e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911682e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091127e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911184e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910982e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910781e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910727e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910677e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910647e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910588e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910544e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091041e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091035e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910278e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910124e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909939e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909847e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909817e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909664e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909605e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909575e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090912e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909028e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908999e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908969e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908909e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090888e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908835e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090875e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090872e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908652e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908582e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908552e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908456e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090805e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907918e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907758e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907625e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907386e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907292e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907127e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906828e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906797e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906747e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906717e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906632e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906368e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906013e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905946e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905823e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905622e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905511e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905382e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905352e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905322e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905262e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905196e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090515e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904813e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090473e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209047e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904618e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904286e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904173e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904053e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904023e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903854e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903723e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903643e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903573e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903505e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209032e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090312e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902977e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090286e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090277e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902639e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902517e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902373e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090232e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902253e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902198e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902132e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090194e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090185e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901685e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901638e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090152e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901489e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901424e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901271e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901233e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900915e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900774e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900744e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090065e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090044e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900409e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900175e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900134e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900069e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900016e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899908e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899826e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899756e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899467e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899406e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899265e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899211e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089914e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089911e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089905e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898785e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898666e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898507e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898248e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898218e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898088e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089802e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089796e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089785e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089769e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089763e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16208976e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089757e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089754e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897475e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897369e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897339e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897279e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897237e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897207e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897172e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896985e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896874e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896814e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896783e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896621e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896447e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896358e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896307e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896277e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896214e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089604e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895953e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895921e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895868e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089577e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895704e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089559e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089548e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895377e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895347e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895171e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895136e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895017e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894896e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894738e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894539e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894359e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894213e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894183e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893964e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893934e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893754e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893606e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089353e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893452e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893423e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893357e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892904e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892824e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892764e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892479e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892311e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892281e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892209e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892063e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089187e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089181e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891708e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891655e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891585e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891401e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891257e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891178e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891128e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891033e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089094e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890794e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890714e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890469e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890179e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890108e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890041e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889937e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889635e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889451e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889317e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889227e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889139e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888902e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888837e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888767e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888737e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888706e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888633e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888413e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888353e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888323e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888249e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888162e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888e6},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887859e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887776e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887734e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887692e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887619e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887355e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088732e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887289e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887126e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887066e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088697e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886884e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886804e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886728e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886538e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886396e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886334e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886246e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886111e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885956e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885894e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885696e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885514e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885341e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885306e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885276e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885186e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885114e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885037e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884975e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884945e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884911e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088478e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884696e3}],success:!0}};console.log(e),Lh.JS_RequestInterface({funcName:"TransFunctionResult",arguments:encodeURI(JSON.stringify(e))})}}]),e}();Hh.sessions={},Hh.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){var e=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),t=33;return window.navigator.userAgent.match("Linux")&&(t=35),e>=26&&e<=t||Hh.extension.isInstalled()}return!0};var zh={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(e){var t=window.setTimeout((function(){var t=new Error("NavigatorUserMediaError");return t.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',e(t)}),1e3);this.cache[t]=e,window.postMessage({type:"janusGetScreen",id:t},"*")},init:function(){var e={};this.cache=e,window.addEventListener("message",(function(t){if(t.origin==window.location.origin)if("janusGotScreen"==t.data.type&&e[t.data.id]){var i=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var n=new Error("NavigatorUserMediaError");n.name="You cancelled the request for permission, giving up...",i(n)}else i(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&(console.log("clearing ",t.data.id),window.clearTimeout(t.data.id))}))}};function Hh(e,t){if(void 0===Hh.initDone)return e.error("Library not initialized"),{};if(!Hh.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(Hh.log("Library initialized: "+Hh.initDone),(e=e||{}).success="function"==typeof e.success?e.success:Hh.noop,e.error="function"==typeof e.error?e.error:Hh.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:Hh.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var i=!1,n=null,r={},o=null,s=null,l=0,c=e.server;Hh.isArray(c)?(Hh.log("Multiple servers provided ("+c.length+"), will use the first that works"),c=null,s=e.server,Hh.debug(s)):0===c.indexOf("ws")?(i=!0,Hh.log("Using WebSockets to contact Janus: "+c)):(i=!1,Hh.log("Using REST API to contact Janus: "+c));var d=e.iceServers;null==d&&(d=[{urls:"stun:stun.l.google.com:19302"}]);var u=e.iceTransportPolicy,h=e.bundlePolicy,f=e.ipv6;null==f&&(f=!1);var x=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(x=!0===e.withCredentials);var p=10;void 0!==e.max_poll_events&&null!==e.max_poll_events&&(p=e.max_poll_events),p<1&&(p=1);var m=null;void 0!==e.token&&null!==e.token&&(m=e.token);var _=null;void 0!==e.apisecret&&null!==e.apisecret&&(_=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var g=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(g=e.keepAlivePeriod),isNaN(g)&&(g=25e3);var v=6e4;function y(e){var t={high:9e5,medium:3e5,low:1e5};return null!=e&&(e.high&&(t.high=e.high),e.medium&&(t.medium=e.medium),e.low&&(t.low=e.low)),t}void 0!==e.longPollTimeout&&null!==e.longPollTimeout&&(v=e.longPollTimeout),isNaN(v)&&(v=6e4);var S=!1,b=null,P={},E=this,C=0,T={};function R(){if(null!=b)if(Hh.debug("Long poll..."),S){var t=c+"/"+b+"?rid="+(new Date).getTime();null!=p&&(t=t+"&maxev="+p),null!=m&&(t=t+"&token="+encodeURIComponent(m)),null!=_&&(t=t+"&apisecret="+encodeURIComponent(_)),Hh.httpAPICall(t,{verb:"GET",withCredentials:x,success:w,timeout:v,error:function(t,i){if(Hh.error(t+":",i),++C>3)return S=!1,void e.error("Lost connection to the server (is it down?)");R()}})}else Hh.warn("Is the server down? (connected=false)")}function w(e,t){if(C=0,i||null==b||!0===t||R(),i||!Hh.isArray(e))if("keepalive"!==e.rtcgw)if("ack"!==e.rtcgw)if("success"!==e.rtcgw)if("trickle"===e.rtcgw){if(null==(l=e.sender))return void Hh.warn("Missing sender...");if(null==(d=P[l]))return void Hh.debug("This handle is not attached to this session");var a=e.candidate;Hh.debug("Got a trickled candidate on session "+b),Hh.debug(a);var r=d.webrtcStuff;r.pc&&r.remoteSdp?(Hh.debug("Adding remote candidate:",a),a&&!0!==a.completed?r.pc.addIceCandidate(a):r.pc.addIceCandidate(Hh.endOfCandidates)):(Hh.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),r.candidates||(r.candidates=[]),r.candidates.push(a),Hh.debug(r.candidates))}else{if("webrtcup"===e.rtcgw)return Hh.debug("Got a webrtcup event on session "+b),Hh.debug(e),null==(l=e.sender)?void Hh.warn("Missing sender..."):null==(d=P[l])?void Hh.debug("This handle is not attached to this session"):void d.webrtcState(!0);if("hangup"===e.rtcgw){if(Hh.debug("Got a hangup event on session "+b),Hh.debug(e),null==(l=e.sender))return void Hh.warn("Missing sender...");if(null==(d=P[l]))return void Hh.debug("This handle is not attached to this session");d.webrtcState(!1,e.reason),d.hangup()}else if("detached"===e.rtcgw){if(Hh.debug("Got a detached event on session "+b),Hh.debug(e),null==(l=e.sender))return void Hh.warn("Missing sender...");if(null==(d=P[l]))return;d.detached=!0,d.ondetached(),d.detach()}else if("media"===e.rtcgw){if(Hh.debug("Got a media event on session "+b),Hh.debug(e),null==(l=e.sender))return void Hh.warn("Missing sender...");if(null==(d=P[l]))return void Hh.debug("This handle is not attached to this session");d.mediaState(e.type,e.receiving)}else if("slowlink"===e.rtcgw){if(Hh.debug("Got a slowlink event on session "+b),Hh.debug(e),console.log("json的所有信息打印-----------------------------------------------",e),null==(l=e.sender))return void Hh.warn("Missing sender...");if(null==(d=P[l]))return void Hh.debug("This handle is not attached to this session");d.slowLink(e.uplink,e.lost)}else{if("error"===e.rtcgw){var o,s;if(Hh.error("Ooops: "+e.error.code+" "+e.error.reason),Hh.debug(e),null!=(o=e.transaction))null!=(s=T[o])&&s(e),delete T[o];return}if("event"===e.rtcgw){var l;if(Hh.debug("Got a plugin event on session "+b),Hh.debug(e),null==(l=e.sender))return void Hh.warn("Missing sender...");var c=e.plugindata;if(null==c)return void Hh.warn("Missing plugindata...");Hh.debug("  -- Event is coming from "+l+" ("+c.plugin+")");var d,u=c.data;if(Hh.debug(u),null==(d=P[l]))return void Hh.warn("This handle is not attached to this session");var h=e.jsep;null!=h&&(Hh.debug("Handling SDP as well..."),Hh.debug(h));var f=d.onmessage;null!=f?(Hh.debug("Notifying application..."),f(u,h)):Hh.debug("No provided notification callback")}else{if("timeout"===e.rtcgw)return Hh.error("Timeout on session "+b),Hh.debug(e),void(i&&n.close(3504,"Gateway timeout"));Hh.warn("Unknown message/event  '"+e.rtcgw+"' on session "+b),Hh.debug(e)}}}else Hh.debug("Got a success on session "+b),Hh.debug(e),null!=(o=e.transaction)&&(null!=(s=T[o])&&s(e),delete T[o]);else Hh.debug("Got an ack on session "+b),Hh.debug(e),null!=(o=e.transaction)&&(null!=(s=T[o])&&s(e),delete T[o]);else Hh.vdebug("Got a keepalive on session "+b);else for(var x=0;x<e.length;x++)w(e[x],!0)}function I(){if(null!==c&&i&&S){o=setTimeout(I,g);var e={rtcgw:"keepalive",session_id:b,transaction:Hh.randomString(12)};null!=m&&(e.token=m),null!=_&&(e.apisecret=_),n.send(JSON.stringify(e))}}function D(e){var a=Hh.randomString(12),d={rtcgw:"create",transaction:a,token:"testtoken"};if(d=Object.assign({},d,t),e.reconnect&&(S=!1,d.rtcgw="claim",d.session_id=b,n&&(n.onopen=null,n.onerror=null,n.onclose=null,o&&(clearTimeout(o),o=null))),null!=m&&(d.token=m),null!=_&&(d.apisecret=_),null===c&&Hh.isArray(s)&&(0===(c=s[l]).indexOf("ws")?(i=!0,Hh.log("Server #"+(l+1)+": trying WebSockets to contact Janus ("+c+")")):(i=!1,Hh.log("Server #"+(l+1)+": trying REST API to contact Janus ("+c+")"))),i)for(var u in n=Hh.newWebSocket(c,"rtcgw-protocol"),r={error:function(){if(Hh.error("Error connecting to the Janus WebSockets server... "+c),Hh.isArray(s)&&!e.reconnect)return++l==s.length?void e.error("Error connecting to any of the provided Janus servers: Is the server down?"):(c=null,void setTimeout((function(){D(e)}),200));e.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){T[a]=function(t){if(Hh.debug(t),"success"!==t.rtcgw)return Hh.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error(t.error.reason);o=setTimeout(I,g),S=!0,b=t.session_id?t.session_id:t.data.id,e.reconnect?Hh.log("Claimed session: "+b):Hh.log("Created session: "+b),Hh.sessions[b]=E,e.success(b)},n.send(JSON.stringify(d))},message:function(e){w(JSON.parse(e.data))}})n.addEventListener(u,r[u]);else Hh.httpAPICall(c,{verb:"POST",withCredentials:x,body:d,success:function(t){if(Hh.debug(t),"success"!==t.rtcgw)return Hh.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error(t.error.reason);S=!0,b=t.session_id?t.session_id:t.data.id,e.reconnect?Hh.log("Claimed session: "+b):Hh.log("Created session: "+b),Hh.sessions[b]=E,R(),e.success()},error:function(t,i){if(Hh.error(t+":",i),Hh.isArray(s)&&!e.reconnect)return++l==s.length?void e.error("Error connecting to any of the provided Janus servers: Is the server down?"):(c=null,void setTimeout((function(){D(e)}),200));""===i?e.error(t+": Is the server down?"):e.error(t+": "+i)}})}function k(e,t){if((t=t||{}).success="function"==typeof t.success?t.success:Hh.noop,t.error="function"==typeof t.error?t.error:Hh.noop,!S)return Hh.warn("Is the server down? (connected=false)"),void t.error("Is the server down? (connected=false)");var a=P[e];if(null==a||null===a.webrtcStuff||void 0===a.webrtcStuff)return Hh.warn("Invalid handle"),void t.error("Invalid handle");var r=t.message,o=t.jsep,s=Hh.randomString(12),l={rtcgw:"message",body:r,transaction:s};if(null!==a.token&&void 0!==a.token&&(l.token=a.token),null!=_&&(l.apisecret=_),null!=o&&(l.jsep=o),Hh.debug("Sending message to plugin (handle="+e+"):"),Hh.debug(l),i)return l.session_id=b,l.handle_id=e,T[s]=function(e){if(Hh.debug("Message sent!"),Hh.debug(e),"success"===e.rtcgw){var i=e.plugindata;if(null==i)return Hh.warn("Request succeeded, but missing plugindata..."),void t.success();Hh.log("Synchronous transaction successful ("+i.plugin+")");var n=i.data;return Hh.debug(n),void t.success(n)}"ack"===e.rtcgw?t.success():void 0!==e.error&&null!==e.error?(Hh.error("Ooops: "+e.error.code+" "+e.error.reason),t.error(e.error.code+" "+e.error.reason)):(Hh.error("Unknown error"),t.error("Unknown error"))},void n.send(JSON.stringify(l));Hh.httpAPICall(c+"/"+b+"/"+e,{verb:"POST",withCredentials:x,body:l,success:function(e){if(Hh.debug("Message sent!"),Hh.debug(e),"success"===e.rtcgw){var i=e.plugindata;if(null==i)return Hh.warn("Request succeeded, but missing plugindata..."),void t.success();Hh.log("Synchronous transaction successful ("+i.plugin+")");var n=i.data;return Hh.debug(n),void t.success(n)}"ack"===e.rtcgw?t.success():void 0!==e.error&&null!==e.error?(Hh.error("Ooops: "+e.error.code+" "+e.error.reason),t.error(e.error.code+" "+e.error.reason)):(Hh.error("Unknown error"),t.error("Unknown error"))},error:function(e,i){Hh.error(e+":",i),t.error(e+": "+i)}})}function F(e,t){if(S){var a=P[e];if(null!=a&&null!==a.webrtcStuff&&void 0!==a.webrtcStuff){var r={rtcgw:"trickle",candidate:t,transaction:Hh.randomString(12)};if(null!==a.token&&void 0!==a.token&&(r.token=a.token),null!=_&&(r.apisecret=_),Hh.vdebug("Sending trickle candidate (handle="+e+"):"),Hh.vdebug(r),i)return r.session_id=b,r.handle_id=e,void n.send(JSON.stringify(r));Hh.httpAPICall(c+"/"+b+"/"+e,{verb:"POST",withCredentials:x,body:r,success:function(e){Hh.vdebug("Candidate sent!"),Hh.vdebug(e),"ack"===e.rtcgw||Hh.error("Ooops: "+e.error.code+" "+e.error.reason)},error:function(e,t){Hh.error(e+":",t)}})}else Hh.warn("Invalid handle")}else Hh.warn("Is the server down? (connected=false)")}function A(e,t,i,n){var a=P[e];if(null!=a&&null!==a.webrtcStuff&&void 0!==a.webrtcStuff){var r=a.webrtcStuff,o=function(e){Hh.log("Received state change on data channel:",e);var t=e.target.label,i=r.dataChannel[t]?r.dataChannel[t].readyState:"null";if(Hh.log("State change on <"+t+"> data channel: "+i),"open"===i){if(r.dataChannel[t].pending&&r.dataChannel[t].pending.length>0){for(var n in Hh.log("Sending pending messages on <"+t+">:",r.dataChannel[t].pending.length),r.dataChannel[t].pending){var o=r.dataChannel[t].pending[n];Hh.log("Sending string on data channel <"+t+">: "+o),r.dataChannel[t].send(o)}r.dataChannel[t].pending=[]}a.ondataopen(t)}};r.dataChannel[t]=i||r.pc.createDataChannel(t,{ordered:!1}),r.dataChannel[t].onmessage=function(e){Hh.log("Received message on data channel:",e);var t=e.target.label;a.ondata(e.data,t)},r.dataChannel[t].onopen=o,r.dataChannel[t].onclose=o,r.dataChannel[t].onerror=function(e){Hh.error("Got error on data channel:",e)},r.dataChannel[t].pending=[],n&&r.dataChannel[t].pending.push(n)}else Hh.warn("Invalid handle")}function M(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Hh.noop,t.error="function"==typeof t.error?t.error:Hh.noop;var i=P[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Hh.warn("Invalid handle"),void t.error("Invalid handle");var n=i.webrtcStuff,a=t.text;if(null==a)return Hh.warn("Invalid text"),void t.error("Invalid text");var r=t.label?t.label:Hh.dataChanDefaultLabel;return n.dataChannel[r]?"open"!==n.dataChannel[r].readyState?(n.dataChannel[r].pending.push(a),void t.success()):(Hh.log("Sending string on data channel <"+r+">: "+a),n.dataChannel[r].send(a),void t.success()):(A(e,r,!1,a),void t.success())}function L(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Hh.noop,t.error="function"==typeof t.error?t.error:Hh.noop;var i=P[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Hh.warn("Invalid handle"),void t.error("Invalid handle");var n=i.webrtcStuff;if(null===n.dtmfSender||void 0===n.dtmfSender){if(void 0!==n.pc&&null!==n.pc){var a=n.pc.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(!a)return Hh.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");n.dtmfSender=a.dtmf,n.dtmfSender&&(Hh.log("Created DTMF Sender"),n.dtmfSender.ontonechange=function(e){Hh.debug("Sent DTMF tone: "+e.tone)})}if(null===n.dtmfSender||void 0===n.dtmfSender)return Hh.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var r=t.dtmf;if(null==r)return Hh.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var o=r.tones;if(null==o)return Hh.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var s=r.duration;null==s&&(s=500);var l=r.gap;null==l&&(l=50),Hh.debug("Sending DTMF string "+o+" (duration "+s+"ms, gap "+l+"ms)"),n.dtmfSender.insertDTMF(o,s,l),t.success()}function B(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Hh.noop,t.error="function"==typeof t.error?t.error:Hh.noop;var a=!0;void 0!==t.asyncRequest&&null!==t.asyncRequest&&(a=!0===t.asyncRequest);var r=!0;void 0!==t.noRequest&&null!==t.noRequest&&(r=!0===t.noRequest),Hh.log("Destroying handle "+e+" (async="+a+")"),G(e);var o=P[e];if(null==o||o.detached)return delete P[e],void t.success();if(r)return delete P[e],void t.success();if(!S)return Hh.warn("Is the server down? (connected=false)"),void t.error("Is the server down? (connected=false)");var s={rtcgw:"detach",transaction:Hh.randomString(12)};if(null!==o.token&&void 0!==o.token&&(s.token=o.token),null!=_&&(s.apisecret=_),i)return s.session_id=b,s.handle_id=e,n.send(JSON.stringify(s)),delete P[e],void t.success();Hh.httpAPICall(c+"/"+b+"/"+e,{verb:"POST",async:a,withCredentials:x,body:s,success:function(i){Hh.log("Destroyed handle:"),Hh.debug(i),"success"!==i.rtcgw&&Hh.error("Ooops: "+i.error.code+" "+i.error.reason),delete P[e],t.success()},error:function(i,n){Hh.error(i+":",n),delete P[e],t.success()}})}function O(e,t,i,n,r){var o=P[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return Hh.warn("Invalid handle"),void n.error("Invalid handle");var s=o.webrtcStuff;Hh.debug("streamsDone:",r),r&&(Hh.debug("  -- Audio tracks:",r.getAudioTracks()),Hh.debug("  -- Video tracks:",r.getVideoTracks()));var l=!1;if(s.myStream&&i.update&&!s.streamExternal){if((!i.update&&Y(i)||i.update&&(i.addAudio||i.replaceAudio))&&r.getAudioTracks()&&r.getAudioTracks().length)if(s.myStream.addTrack(r.getAudioTracks()[0]),Hh.unifiedPlan){Hh.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",r.getAudioTracks()[0]);var c=null;if((p=s.pc.getTransceivers())&&p.length>0)for(var x in p){if((_=p[x]).sender&&_.sender.track&&"audio"===_.sender.track.kind||_.receiver&&_.receiver.track&&"audio"===_.receiver.track.kind){c=_;break}}c&&c.sender?c.sender.replaceTrack(r.getAudioTracks()[0]):s.pc.addTrack(r.getAudioTracks()[0],r)}else Hh.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",r.getAudioTracks()[0]),s.pc.addTrack(r.getAudioTracks()[0],r);if((!i.update&&J(i)||i.update&&(i.addVideo||i.replaceVideo))&&r.getVideoTracks()&&r.getVideoTracks().length)if(s.myStream.addTrack(r.getVideoTracks()[0]),Hh.unifiedPlan){Hh.log((i.replaceVideo?"Replacing":"Adding")+" video track:",r.getVideoTracks()[0]);var p,m=null;if((p=s.pc.getTransceivers())&&p.length>0)for(var x in p){var _;if((_=p[x]).sender&&_.sender.track&&"video"===_.sender.track.kind||_.receiver&&_.receiver.track&&"video"===_.receiver.track.kind){m=_;break}}m&&m.sender?m.sender.replaceTrack(r.getVideoTracks()[0]):s.pc.addTrack(r.getVideoTracks()[0],r)}else Hh.log((i.replaceVideo?"Replacing":"Adding")+" video track:",r.getVideoTracks()[0]),s.pc.addTrack(r.getVideoTracks()[0],r)}else s.myStream=r,l=!0;if(!s.pc){var g={iceServers:d,iceTransportPolicy:u,bundlePolicy:h};"chrome"===Hh.webRTCAdapter.browserDetails.browser&&(g.sdpSemantics=Hh.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan");var v={optional:[{DtlsSrtpKeyAgreement:!0}]};if(!0===f&&v.optional.push({googIPv6:!0}),n.rtcConstraints&&"object"===a(n.rtcConstraints))for(var x in Hh.debug("Adding custom PeerConnection constraints:",n.rtcConstraints),n.rtcConstraints)v.optional.push(n.rtcConstraints[x]);"edge"===Hh.webRTCAdapter.browserDetails.browser&&(g.bundlePolicy="max-bundle"),Hh.log("Creating PeerConnection"),Hh.debug(v),s.pc=new RTCPeerConnection(g,v),Hh.debug(s.pc),s.pc.getStats&&(s.volume={},s.bitrate.value="0 kbits/sec"),Hh.log("Preparing local SDP and gathering candidates (trickle="+s.trickle+")"),s.pc.oniceconnectionstatechange=function(e){s.pc&&o.iceState(s.pc.iceConnectionState)},s.pc.onicecandidate=function(t){if(null==t.candidate||"edge"===Hh.webRTCAdapter.browserDetails.browser&&t.candidate.candidate.indexOf("endOfCandidates")>0)Hh.log("End of candidates."),s.iceDone=!0,!0===s.trickle?F(e,{completed:!0}):function(e,t){t=t||{},t.success="function"==typeof t.success?t.success:Hh.noop,t.error="function"==typeof t.error?t.error:Hh.noop;var i=P[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return void Hh.warn("Invalid handle, not sending anything");var n=i.webrtcStuff;if(Hh.log("Sending offer/answer SDP..."),null===n.mySdp||void 0===n.mySdp)return void Hh.warn("Local SDP instance is invalid, not sending anything...");n.mySdp={type:n.pc.localDescription.type,sdp:n.pc.localDescription.sdp},!1===n.trickle&&(n.mySdp.trickle=!1);Hh.debug(t),n.sdpSent=!0,t.success(n.mySdp)}(e,n);else{var i={candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex};!0===s.trickle&&F(e,i)}},s.pc.ontrack=function(e){Hh.log("Handling Remote Track"),Hh.debug(e),e.streams&&(s.remoteStream=e.streams[0],o.onremotestream(s.remoteStream),e.track.onended||(Hh.log("Adding onended callback to track:",e.track),e.track.onended=function(e){Hh.log("Remote track muted/removed:",e),s.remoteStream&&(s.remoteStream.removeTrack(e.target),o.onremotestream(s.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){Hh.log("Remote track flowing again:",e);try{s.remoteStream.addTrack(e.target),o.onremotestream(s.remoteStream)}catch(e){Hh.error(e)}}))}}if(l&&null!=r)if(Hh.log("Adding local stream"),console.log("callbacks",n),"screen"==n.media.video){var S=!0===n.simulcast2;r.getTracks().forEach((function(e){if(Hh.log("Adding local track:",e),e.applyConstraints({frameRate:5}),S)if("audio"===e.kind)s.pc.addTrack(e,r);else{Hh.log("Enabling rid-based simulcasting:",e);var t=y(n.simulcastMaxBitrates);s.pc.addTransceiver(e,{direction:"sendrecv",streams:[r],sendEncodings:[{rid:"h",active:!0,maxBitrate:t.high},{rid:"m",active:!0,maxBitrate:t.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:t.low,scaleResolutionDownBy:4}]})}else s.pc.addTrack(e,r)}))}else{S=!0===n.simulcast2;var b=r.getTracks(),E=b[0];if(E){var C=E.getSettings();console.log("videoTrack",E),console.log("videosettings",C)}var T=r.getAudioTracks()[0];if(T){var R=T.getSettings();console.log("audiosettings",R)}b.forEach((function(e){if(e.applyConstraints({frameRate:{max:n.frameRate}}),Hh.log("Adding local track:",e),S){s.pc.addTrack(e,r);var t=null,i=s.pc.getSenders();for(var a in i){var o=i[a];o&&o.track&&"video"===o.track.kind&&(t=o)}var l=null;t&&(l=t.getParameters()),l&&l.encodings&&(l.encodings[0].maxBitrate=1e5,t.setParameters(l).then((function(e){console.log("Successed to set parameters!",l)})).catch((function(e){console.log("err",e),console.error(e)})))}else if("audio"===e.kind)s.pc.addTrack(e,r);else{Hh.log("Enabling rid-based simulcasting:",e);var c=n.bitrate||1e5;s.pc.addTransceiver(e,{direction:"sendrecv",streams:[r],sendEncodings:[{rid:"h",active:!0,maxBitrate:c}]})}}))}(function(e){if(Hh.debug("isDataEnabled:",e),"edge"==Hh.webRTCAdapter.browserDetails.browser)return Hh.warn("Edge doesn't support data channels yet"),!1;return null!=e&&!0===e.data})(i)&&!s.dataChannel[Hh.dataChanDefaultLabel]&&(Hh.log("Creating data channel"),A(e,Hh.dataChanDefaultLabel,!1),s.pc.ondatachannel=function(t){Hh.log("Data channel created by Janus:",t),A(e,t.channel.label,t.channel)}),s.myStream&&o.onlocalstream(s.myStream),null==t?function(e,t,i){i=i||{},i.success="function"==typeof i.success?i.success:Hh.noop,i.error="function"==typeof i.error?i.error:Hh.noop,i.customizeSdp="function"==typeof i.customizeSdp?i.customizeSdp:Hh.noop;var n=P[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Hh.warn("Invalid handle"),void i.error("Invalid handle");var a=n.webrtcStuff,r=!0===i.simulcast;r?Hh.log("Creating offer (iceDone="+a.iceDone+", simulcast="+r+")"):Hh.log("Creating offer (iceDone="+a.iceDone+")");var o={};if(Hh.unifiedPlan){var s=null,l=null,c=a.pc.getTransceivers();if(c&&c.length>0)for(var d in c){var u=c[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(l||(l=u))}var h=Y(t),f=X(t);h||f?h&&f?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Hh.log("Setting audio transceiver to sendrecv:",s)):h&&!f?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Hh.log("Setting audio transceiver to sendonly:",s)):!h&&f&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Hh.log("Setting audio transceiver to recvonly:",s)):(s=a.pc.addTransceiver("audio",{direction:"recvonly"}),Hh.log("Adding recvonly audio transceiver:",s))):t.removeAudio&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",Hh.log("Setting audio transceiver to inactive:",s));var x=J(t),p=q(t);x||p?x&&p?l&&(l.setDirection?l.setDirection("sendrecv"):l.direction="sendrecv",Hh.log("Setting video transceiver to sendrecv:",l)):x&&!p?l&&(l.setDirection?l.setDirection("sendonly"):l.direction="sendonly",Hh.log("Setting video transceiver to sendonly:",l)):!x&&p&&(l?(l.setDirection?l.setDirection("recvonly"):l.direction="recvonly",Hh.log("Setting video transceiver to recvonly:",l)):(l=a.pc.addTransceiver("video",{direction:"recvonly"}),Hh.log("Adding recvonly video transceiver:",l))):t.removeVideo&&l&&(l.setDirection?l.setDirection("inactive"):l.direction="inactive",Hh.log("Setting video transceiver to inactive:",l))}else o.offerToReceiveAudio=X(t),o.offerToReceiveVideo=q(t);var m=!0===i.iceRestart;m&&(o.iceRestart=!0);Hh.debug(o);var _=J(t);if(_&&r&&"firefox"===Hh.webRTCAdapter.browserDetails.browser){Hh.log("Enabling Simulcasting for Firefox (RID)");var g=a.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(g){var v=g.getParameters();v||(v={});var S=y(i.simulcastMaxBitrates);v.encodings=[{rid:"h",active:!0,maxBitrate:S.high},{rid:"m",active:!0,maxBitrate:S.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:S.low,scaleResolutionDownBy:4}],g.setParameters(v)}}a.pc.createOffer(o).then((function(e){Hh.debug(e);var t={type:e.type,sdp:e.sdp};i.customizeSdp(t),e.sdp=t.sdp,Hh.log("Setting local description"),_&&r&&("chrome"===Hh.webRTCAdapter.browserDetails.browser||"safari"===Hh.webRTCAdapter.browserDetails.browser?(Hh.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=function(e){for(var t=e.split("\r\n"),i=!1,n=[-1],a=[-1],r=null,o=null,s=null,l=null,c=-1,d=0;d<t.length;d++){if(h=t[d].match(/m=(\w+) */)){if("video"===h[1]){if(!(n[0]<0)){c=d;break}i=!0}else if(n[0]>-1){c=d;break}}else if(i){var u=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(u)n[0]=u[1],a[0]=u[2],t.splice(d,1),d--;else{if(n[0]){if((x=t[d].match("a=ssrc:"+n[0]+" cname:(.+)"))&&(r=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" msid:(.+)"))&&(o=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" mslabel:(.+)"))&&(s=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" label:(.+)"))&&(l=x[1]),0===t[d].indexOf("a=ssrc:"+a[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+n[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(n[0]<0){c=-1,i=!1;for(d=0;d<t.length;d++){var h;if(h=t[d].match(/m=(\w+) */)){if("video"===h[1]){if(!(n[0]<0)){c=d;break}i=!0}else if(n[0]>-1){c=d;break}}else if(i){if(n[0]<0){var f=t[d].match(/a=ssrc:(\d+)/);if(f){n[0]=f[1],t.splice(d,1),d--;continue}}else{var x;if((x=t[d].match("a=ssrc:"+n[0]+" cname:(.+)"))&&(r=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" msid:(.+)"))&&(o=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" mslabel:(.+)"))&&(s=x[1]),(x=t[d].match("a=ssrc:"+n[0]+" label:(.+)"))&&(l=x[1]),0===t[d].indexOf("a=ssrc:"+a[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+n[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(n[0]<0)return Hh.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;c<0&&(c=t.length);n[1]=Math.floor(4294967295*Math.random()),n[2]=Math.floor(4294967295*Math.random()),a[1]=Math.floor(4294967295*Math.random()),a[2]=Math.floor(4294967295*Math.random());for(d=0;d<n.length;d++)r&&(t.splice(c,0,"a=ssrc:"+n[d]+" cname:"+r),c++),o&&(t.splice(c,0,"a=ssrc:"+n[d]+" msid:"+o),c++),s&&(t.splice(c,0,"a=ssrc:"+n[d]+" mslabel:"+s),c++),l&&(t.splice(c,0,"a=ssrc:"+n[d]+" label:"+l),c++),r&&(t.splice(c,0,"a=ssrc:"+a[d]+" cname:"+r),c++),o&&(t.splice(c,0,"a=ssrc:"+a[d]+" msid:"+o),c++),s&&(t.splice(c,0,"a=ssrc:"+a[d]+" mslabel:"+s),c++),l&&(t.splice(c,0,"a=ssrc:"+a[d]+" label:"+l),c++);t.splice(c,0,"a=ssrc-group:FID "+n[2]+" "+a[2]),t.splice(c,0,"a=ssrc-group:FID "+n[1]+" "+a[1]),t.splice(c,0,"a=ssrc-group:FID "+n[0]+" "+a[0]),t.splice(c,0,"a=ssrc-group:SIM "+n[0]+" "+n[1]+" "+n[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n");return e}(e.sdp)):"firefox"!==Hh.webRTCAdapter.browserDetails.browser&&Hh.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),a.mySdp=e.sdp,a.pc.setLocalDescription(e).catch(i.error),a.mediaConstraints=o,a.iceDone||a.trickle?(Hh.log("Offer ready"),Hh.debug(i),i.success(e)):Hh.log("Waiting for all candidates...")}),i.error)}(e,i,n):s.pc.setRemoteDescription(t).then((function(){if(Hh.log("Remote description accepted!"),s.remoteSdp=t.sdp,s.candidates&&s.candidates.length>0){for(var a=0;a<s.candidates.length;a++){var r=s.candidates[a];Hh.debug("Adding remote candidate:",r),r&&!0!==r.completed?s.pc.addIceCandidate(r):s.pc.addIceCandidate(Hh.endOfCandidates)}s.candidates=[]}!function(e,t,i){i=i||{},i.success="function"==typeof i.success?i.success:Hh.noop,i.error="function"==typeof i.error?i.error:Hh.noop,i.customizeSdp="function"==typeof i.customizeSdp?i.customizeSdp:Hh.noop;var n=P[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Hh.warn("Invalid handle"),void i.error("Invalid handle");var a=n.webrtcStuff,r=!0===i.simulcast;r?Hh.log("Creating answer (iceDone="+a.iceDone+", simulcast="+r+")"):Hh.log("Creating answer (iceDone="+a.iceDone+")");var o=null;if(Hh.unifiedPlan){o={};var s=null,l=null,c=a.pc.getTransceivers();if(c&&c.length>0)for(var d in c){var u=c[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(l||(l=u))}var h=Y(t),f=X(t);if(h||f){if(h&&f){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Hh.log("Setting audio transceiver to sendrecv:",s)}catch(e){Hh.error(e)}}else if(h&&!f)try{s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Hh.log("Setting audio transceiver to sendonly:",s))}catch(e){Hh.error(e)}else if(!h&&f)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Hh.log("Setting audio transceiver to recvonly:",s)}catch(e){Hh.error(e)}else s=a.pc.addTransceiver("audio",{direction:"recvonly"}),Hh.log("Adding recvonly audio transceiver:",s)}else if(t.removeAudio&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",Hh.log("Setting audio transceiver to inactive:",s)}catch(e){Hh.error(e)}var x=J(t),p=q(t);if(x||p){if(x&&p){if(l)try{l.setDirection?l.setDirection("sendrecv"):l.direction="sendrecv",Hh.log("Setting video transceiver to sendrecv:",l)}catch(e){Hh.error(e)}}else if(x&&!p){if(l)try{l.setDirection?l.setDirection("sendonly"):l.direction="sendonly",Hh.log("Setting video transceiver to sendonly:",l)}catch(e){Hh.error(e)}}else if(!x&&p)if(l)try{l.setDirection?l.setDirection("recvonly"):l.direction="recvonly",Hh.log("Setting video transceiver to recvonly:",l)}catch(e){Hh.error(e)}else l=a.pc.addTransceiver("video",{direction:"recvonly"}),Hh.log("Adding recvonly video transceiver:",l)}else if(t.removeVideo&&l)try{l.setDirection?l.setDirection("inactive"):l.direction="inactive",Hh.log("Setting video transceiver to inactive:",l)}catch(e){Hh.error(e)}}else o="firefox"==Hh.webRTCAdapter.browserDetails.browser||"edge"==Hh.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:X(t),offerToReceiveVideo:q(t)}:{mandatory:{OfferToReceiveAudio:X(t),OfferToReceiveVideo:q(t)}};Hh.debug(o);var m=J(t);if(m&&r&&"firefox"===Hh.webRTCAdapter.browserDetails.browser){Hh.log("Enabling Simulcasting for Firefox (RID)");var _=a.pc.getSenders()[1];Hh.log(_);var g=_.getParameters();Hh.log(g);var v=y(i.simulcastMaxBitrates);_.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:v.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:v.medium},{rid:"low",active:!0,priority:"low",maxBitrate:v.low}]})}a.pc.createAnswer(o).then((function(e){Hh.debug(e);var t={type:e.type,sdp:e.sdp};i.customizeSdp(t),e.sdp=t.sdp,Hh.log("Setting local description"),m&&r&&("chrome"===Hh.webRTCAdapter.browserDetails.browser?Hh.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==Hh.webRTCAdapter.browserDetails.browser&&Hh.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),a.mySdp=e.sdp,a.pc.setLocalDescription(e).catch(i.error),a.mediaConstraints=o,a.iceDone||a.trickle?i.success(e):Hh.log("Waiting for all candidates...")}),i.error)}(e,i,n)}),n.error)}function j(e,t,i){(i=i||{}).success="function"==typeof i.success?i.success:Hh.noop,i.error="function"==typeof i.error?i.error:W;var n=i.jsep;if(t&&n)return Hh.error("Provided a JSEP to a createOffer"),void i.error("Provided a JSEP to a createOffer");if(!(t||n&&n.type&&n.sdp))return Hh.error("A valid JSEP is required for createAnswer"),void i.error("A valid JSEP is required for createAnswer");i.media=i.media||{audio:!0,video:!0};var r=i.media,o=P[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return Hh.warn("Invalid handle"),void i.error("Invalid handle");var s,l=o.webrtcStuff;if(l.trickle=(s=i.trickle,Hh.debug("isTrickleEnabled:",s),null==s||!0===s),void 0===l.pc||null===l.pc)r.update=!1,r.keepAudio=!1,r.keepVideo=!1;else if(void 0!==l.pc&&null!==l.pc){if(Hh.log("Updating existing media session"),r.update=!0,null!==i.stream&&void 0!==i.stream)i.stream!==l.myStream&&Hh.log("Renegotiation involves a new external stream");else{if(r.addAudio){if(r.keepAudio=!1,r.replaceAudio=!1,r.removeAudio=!1,r.audioSend=!0,l.myStream&&l.myStream.getAudioTracks()&&l.myStream.getAudioTracks().length)return Hh.error("Can't add audio stream, there already is one"),void i.error("Can't add audio stream, there already is one")}else r.removeAudio?(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!1,r.audioSend=!1):r.replaceAudio&&(r.keepAudio=!1,r.addAudio=!1,r.removeAudio=!1,r.audioSend=!0);if(null===l.myStream||void 0===l.myStream?(r.replaceAudio&&(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!0,r.audioSend=!0),Y(r)&&(r.keepAudio=!1,r.addAudio=!0)):null===l.myStream.getAudioTracks()||void 0===l.myStream.getAudioTracks()||0===l.myStream.getAudioTracks().length?(r.replaceAudio&&(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!0,r.audioSend=!0),Y(r)&&(r.keepVideo=!1,r.addAudio=!0)):!Y(r)||r.removeAudio||r.replaceAudio||(r.keepAudio=!0),r.addVideo){if(r.keepVideo=!1,r.replaceVideo=!1,r.removeVideo=!1,r.videoSend=!0,l.myStream&&l.myStream.getVideoTracks()&&l.myStream.getVideoTracks().length)return Hh.error("Can't add video stream, there already is one"),void i.error("Can't add video stream, there already is one")}else r.removeVideo?(r.keepVideo=!1,r.replaceVideo=!1,r.addVideo=!1,r.videoSend=!1):r.replaceVideo&&(r.keepVideo=!1,r.addVideo=!1,r.removeVideo=!1,r.videoSend=!0);null===l.myStream||void 0===l.myStream||null===l.myStream.getVideoTracks()||void 0===l.myStream.getVideoTracks()||0===l.myStream.getVideoTracks().length?(r.replaceVideo&&(r.keepVideo=!1,r.replaceVideo=!1,r.addVideo=!0,r.videoSend=!0),J(r)&&(r.keepVideo=!1,r.addVideo=!0)):!J(r)||r.removeVideo||r.replaceVideo||(r.keepVideo=!0),r.addData&&(r.data=!0)}if(Y(r)&&r.keepAudio&&J(r)&&r.keepVideo)return o.consentDialog(!1),void O(e,n,r,i,l.myStream)}if(r.update&&!l.streamExternal){if(r.removeAudio||r.replaceAudio){if(l.myStream&&l.myStream.getAudioTracks()&&l.myStream.getAudioTracks().length){var c=l.myStream.getAudioTracks()[0];Hh.log("Removing audio track:",c),l.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(l.pc.getSenders()&&l.pc.getSenders().length){var d=!0;if(r.replaceAudio&&Hh.unifiedPlan&&(d=!1),d)for(var u in l.pc.getSenders()){(c=l.pc.getSenders()[u])&&c.track&&"audio"===c.track.kind&&(Hh.log("Removing audio sender:",c),l.pc.removeTrack(c))}}}if(r.removeVideo||r.replaceVideo){if(l.myStream&&l.myStream.getVideoTracks()&&l.myStream.getVideoTracks().length){c=l.myStream.getVideoTracks()[0];Hh.log("Removing video track:",c),l.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(l.pc.getSenders()&&l.pc.getSenders().length){var h=!0;if(r.replaceVideo&&Hh.unifiedPlan&&(h=!1),h)for(var u in l.pc.getSenders()){(c=l.pc.getSenders()[u])&&c.track&&"video"===c.track.kind&&(Hh.log("Removing video sender:",c),l.pc.removeTrack(c))}}}}if(null!==i.stream&&void 0!==i.stream){var f=i.stream;if(Hh.log("MediaStream provided by the application"),Hh.debug(f),r.update&&l.myStream&&l.myStream!==i.stream&&!l.streamExternal){try{var x=l.myStream.getTracks();for(var p in x){var m=x[p];Hh.log(m),null!=m&&m.stop()}}catch(e){}l.myStream=null}return l.streamExternal=!0,o.consentDialog(!1),void O(e,n,r,i,f)}if(Y(r)||J(r)){if(!Hh.isGetUserMediaAvailable())return void i.error("getUserMedia not available");var _={mandatory:{},optional:[]};o.consentDialog(!0);var g=Y(r);!0===g&&null!=r&&null!=r&&"object"===a(r.audio)&&(g=r.audio);var v=J(r);if(!0===v&&null!=r&&null!=r){var y=!0===i.simulcast,S=!0===i.simulcast2;if(!y&&!S||n||void 0!==r.video&&!1!==r.video||(r.video="hires"),r.video&&"screen"!=r.video&&"window"!=r.video)if("object"===a(r.video))v=r.video;else{var b=0,E=0;"lowres"===r.video?(E=240,b=320):"lowres-16:9"===r.video?(E=180,b=320):"hires"===r.video||"hires-16:9"===r.video||"hdres"===r.video?(E=720,b=1280):"fhdres"===r.video?(E=1080,b=1920):"4kres"===r.video?(E=2160,b=3840):"stdres"===r.video?(E=480,b=640):"stdres-16:9"===r.video?(E=360,b=640):(Hh.log("Default video setting is stdres 4:3"),E=480,b=640),Hh.log("Adding media constraint:",r.video),v={height:{ideal:E},width:{ideal:b}},Hh.log("Adding video constraint:",v)}else if("screen"===r.video||"window"===r.video){var C=function(t,a){o.consentDialog(!1),t?i.error(t):O(e,n,r,i,a)},T=function(e,t,i){Hh.log("Adding media constraint (screen capture)"),Hh.debug(e),navigator.mediaDevices.getUserMedia(e).then((function(e){i?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(i){e.addTrack(i.getAudioTracks()[0]),t(null,e)})):t(null,e)})).catch((function(e){o.consentDialog(!1),t(e)}))};if(r.screenshareFrameRate||(r.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){o.consentDialog(!1),Y(r)&&!r.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(a){t.addTrack(a.getAudioTracks()[0]),O(e,n,r,i,t)})):O(e,n,r,i,t)}),(function(e){o.consentDialog(!1),i.error(e)}));if("chrome"===Hh.webRTCAdapter.browserDetails.browser){var R=Hh.webRTCAdapter.browserDetails.version,w=33;window.navigator.userAgent.match("Linux")&&(w=35),R>=26&&R<=w?(_={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:r.screenshareFrameRate,maxFrameRate:r.screenshareFrameRate,chromeMediaSource:"screen"}},audio:Y(r)&&!r.keepAudio},T(_,C)):Hh.extension.getScreen((function(e,t){if(e)return o.consentDialog(!1),i.error(e);(_={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:r.screenshareFrameRate,maxFrameRate:r.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=t,T(_,C,Y(r)&&!r.keepAudio)}))}else if("firefox"===Hh.webRTCAdapter.browserDetails.browser){if(!(Hh.webRTCAdapter.browserDetails.version>=33)){var I=new Error("NavigatorUserMediaError");return I.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",o.consentDialog(!1),void i.error(I)}_={video:{mozMediaSource:r.video,mediaSource:r.video},audio:Y(r)&&!r.keepAudio},T(_,(function(e,t){if(C(e,t),!e)var i=t.currentTime,n=window.setInterval((function(){t||window.clearInterval(n),t.currentTime==i&&(window.clearInterval(n),t.onended&&t.onended()),i=t.currentTime}),500)}))}return}}null!=r&&"screen"===r.video||navigator.mediaDevices.enumerateDevices().then((function(t){var s=t.some((function(e){return"audioinput"===e.kind})),l=function(e){if(Hh.debug("isScreenSendEnabled:",e),null==e)return!1;if("object"!==a(e.video)||"object"!==a(e.video.mandatory))return!1;var t=e.video.mandatory;if(t.chromeMediaSource)return"desktop"===t.chromeMediaSource||"screen"===t.chromeMediaSource;if(t.mozMediaSource)return"window"===t.mozMediaSource||"screen"===t.mozMediaSource;if(t.mediaSource)return"window"===t.mediaSource||"screen"===t.mediaSource;return!1}(r)||t.some((function(e){return"videoinput"===e.kind})),c=Y(r),d=J(r),u=function(e){return Hh.debug("isAudioSendRequired:",e),null!=e&&(!1!==e.audio&&!1!==e.audioSend&&(void 0!==e.failIfNoAudio&&null!==e.failIfNoAudio&&!0===e.failIfNoAudio))}(r),h=function(e){return Hh.debug("isVideoSendRequired:",e),null!=e&&(!1!==e.video&&!1!==e.videoSend&&(void 0!==e.failIfNoVideo&&null!==e.failIfNoVideo&&!0===e.failIfNoVideo))}(r);if(c||d||u||h){var x=!!c&&s,p=!!d&&l;if(!x&&!p)return o.consentDialog(!1),i.error("No capture device found"),!1;if(!x&&u)return o.consentDialog(!1),i.error("Audio capture is required, but no capture device found"),!1;if(!p&&h)return o.consentDialog(!1),i.error("Video capture is required, but no capture device found"),!1}var m={audio:!(!s||r.keepAudio)&&g,video:!(!l||r.keepVideo)&&v};r.encodings&&(m=r.encodings),Hh.debug("getUserMedia constraints",m),m.audio||m.video?(console.log("gumConstraints_________",m,r.encodings),navigator.mediaDevices.getUserMedia(r.encodings?r.encodings:m).then((function(t){o.consentDialog(!1),O(e,n,r,i,t)})).catch((function(e){o.consentDialog(!1),i.error({code:e.code,name:e.name,message:e.message})}))):(o.consentDialog(!1),O(e,n,r,i,f))})).catch((function(e){o.consentDialog(!1),i.error("enumerateDevices error",e)}))}else O(e,n,r,i)}function N(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Hh.noop,t.error="function"==typeof t.error?t.error:W;var i=t.jsep,n=P[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Hh.warn("Invalid handle"),void t.error("Invalid handle");var a=n.webrtcStuff;if(null!=i){if(null===a.pc)return Hh.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void t.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");a.pc.setRemoteDescription(i).then((function(){if(Hh.log("Remote description accepted!"),a.remoteSdp=i.sdp,a.candidates&&a.candidates.length>0){for(var e=0;e<a.candidates.length;e++){var n=a.candidates[e];Hh.debug("Adding remote candidate:",n),n&&!0!==n.completed?a.pc.addIceCandidate(n):a.pc.addIceCandidate(Hh.endOfCandidates)}a.candidates=[]}t.success()}),t.error)}else t.error("Invalid JSEP")}function U(e,t){var i=P[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Hh.warn("Invalid handle"),0;var n=t?"remote":"local",a=i.webrtcStuff;return a.volume[n]||(a.volume[n]={value:0}),a.pc.getStats&&"chrome"===Hh.webRTCAdapter.browserDetails.browser?!t||null!==a.remoteStream&&void 0!==a.remoteStream?t||null!==a.myStream&&void 0!==a.myStream?null===a.volume[n].timer||void 0===a.volume[n].timer?(Hh.log("Starting "+n+" volume monitor"),a.volume[n].timer=setInterval((function(){a.pc.getStats((function(e){for(var i=e.result(),r=0;r<i.length;r++){var o=i[r];"ssrc"==o.type&&(t&&o.stat("audioOutputLevel")?a.volume[n].value=parseInt(o.stat("audioOutputLevel")):!t&&o.stat("audioInputLevel")&&(a.volume[n].value=parseInt(o.stat("audioInputLevel"))))}}))}),200),0):a.volume[n].value:(Hh.warn("Local stream unavailable"),0):(Hh.warn("Remote stream unavailable"),0):(Hh.warn("Getting the "+n+" volume unsupported by browser"),0)}function z(e,t){var i=P[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Hh.warn("Invalid handle"),!0;var n=i.webrtcStuff;return null===n.pc||void 0===n.pc?(Hh.warn("Invalid PeerConnection"),!0):void 0===n.myStream||null===n.myStream?(Hh.warn("Invalid local MediaStream"),!0):t?null===n.myStream.getVideoTracks()||void 0===n.myStream.getVideoTracks()||0===n.myStream.getVideoTracks().length?(Hh.warn("No video track"),!0):!n.myStream.getVideoTracks()[0].enabled:null===n.myStream.getAudioTracks()||void 0===n.myStream.getAudioTracks()||0===n.myStream.getAudioTracks().length?(Hh.warn("No audio track"),!0):!n.myStream.getAudioTracks()[0].enabled}function H(e,t,i){var n=P[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Hh.warn("Invalid handle"),!1;var a=n.webrtcStuff;return null===a.pc||void 0===a.pc?(Hh.warn("Invalid PeerConnection"),!1):void 0===a.myStream||null===a.myStream?(Hh.warn("Invalid local MediaStream"),!1):t?null===a.myStream.getVideoTracks()||void 0===a.myStream.getVideoTracks()||0===a.myStream.getVideoTracks().length?(Hh.warn("No video track"),!1):(a.myStream.getVideoTracks()[0].enabled=!i,!0):null===a.myStream.getAudioTracks()||void 0===a.myStream.getAudioTracks()||0===a.myStream.getAudioTracks().length?(Hh.warn("No audio track"),!1):(a.myStream.getAudioTracks()[0].enabled=!i,!0)}function V(e,t){var i=P[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Hh.warn("Invalid handle"),"Invalid handle";var n=i.webrtcStuff;return null===n.pc||void 0===n.pc?"Invalid PeerConnection":n.pc.getStats?void n.pc.getStats().then((function(e){e.forEach((function(e){if(e){var i=!1;if(("video"===e.mediaType||e.id.toLowerCase().indexOf("video")>-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?i=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(i=!0),i)if(t&&t(e),n.bitrate.bsnow=e.bytesReceived,n.bitrate.tsnow=e.timestamp,null===n.bitrate.bsbefore||null===n.bitrate.tsbefore)n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow;else{var a=n.bitrate.tsnow-n.bitrate.tsbefore;"safari"==Hh.webRTCAdapter.browserDetails.browser&&(a/=1e3);var r=Math.round(8*(n.bitrate.bsnow-n.bitrate.bsbefore)/a);"safari"===Hh.webRTCAdapter.browserDetails.browser&&(r=parseInt(r/1e3)),n.bitrate.value=r+" kbits/sec",n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow}}}))})):(Hh.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function Z(e){var t=P[e];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return Hh.warn("Invalid handle"),"Invalid handle";var i=t.webrtcStuff;return null===i.pc||void 0===i.pc?"Invalid PeerConnection":i.pc.getStats?null===i.bitrate.timer||void 0===i.bitrate.timer?(Hh.log("Starting bitrate timer (via getStats)"),i.bitrate.timer=setInterval((function(){i.pc.getStats().then((function(e){e.forEach((function(e){if(e){var t=!1;if(("video"===e.mediaType||e.id.toLowerCase().indexOf("video")>-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?t=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(t=!0),t)if(i.bitrate.bsnow=e.bytesReceived,i.bitrate.tsnow=e.timestamp,null===i.bitrate.bsbefore||null===i.bitrate.tsbefore)i.bitrate.bsbefore=i.bitrate.bsnow,i.bitrate.tsbefore=i.bitrate.tsnow;else{var n=i.bitrate.tsnow-i.bitrate.tsbefore;"safari"==Hh.webRTCAdapter.browserDetails.browser&&(n/=1e3);var a=Math.round(8*(i.bitrate.bsnow-i.bitrate.bsbefore)/n);"safari"===Hh.webRTCAdapter.browserDetails.browser&&(a=parseInt(a/1e3)),i.bitrate.value=a+" kbits/sec",i.bitrate.bsbefore=i.bitrate.bsnow,i.bitrate.tsbefore=i.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):i.bitrate.value:(Hh.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function W(e){Hh.error("WebRTC error:",e)}function G(e,t){Hh.log("Cleaning WebRTC stuff");var a=P[e];if(null!=a){var r=a.webrtcStuff;if(null!=r){if(!0===t){var o={rtcgw:"hangup",transaction:Hh.randomString(12)};null!==a.token&&void 0!==a.token&&(o.token=a.token),null!=_&&(o.apisecret=_),Hh.debug("Sending hangup request (handle="+e+"):"),Hh.debug(o),i?(o.session_id=b,o.handle_id=e,n.send(JSON.stringify(o))):Hh.httpAPICall(c+"/"+b+"/"+e,{verb:"POST",withCredentials:x,body:o})}r.remoteStream=null,r.volume&&(r.volume.local&&r.volume.local.timer&&clearInterval(r.volume.local.timer),r.volume.remote&&r.volume.remote.timer&&clearInterval(r.volume.remote.timer)),r.volume={},r.bitrate.timer&&clearInterval(r.bitrate.timer),r.bitrate.timer=null,r.bitrate.bsnow=null,r.bitrate.bsbefore=null,r.bitrate.tsnow=null,r.bitrate.tsbefore=null,r.bitrate.value=null;try{if(!r.streamExternal&&null!==r.myStream&&void 0!==r.myStream){Hh.log("Stopping local stream tracks");var s=r.myStream.getTracks();for(var l in s){var d=s[l];Hh.log(d),null!=d&&d.stop()}}}catch(e){}r.streamExternal=!1,r.myStream=null;try{r.pc.close()}catch(e){}r.pc=null,r.candidates=null,r.mySdp=null,r.remoteSdp=null,r.iceDone=!1,r.dataChannel={},r.dtmfSender=null}a.oncleanup()}}function Y(e){return Hh.debug("isAudioSendEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioSend||null===e.audioSend||!0===e.audioSend)}function X(e){return Hh.debug("isAudioRecvEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioRecv||null===e.audioRecv||!0===e.audioRecv)}function J(e){return Hh.debug("isVideoSendEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoSend||null===e.videoSend||!0===e.videoSend)}function q(e){return Hh.debug("isVideoRecvEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoRecv||null===e.videoRecv||!0===e.videoRecv)}D(e),this.getServer=function(){return c},this.isConnected=function(){return S},this.reconnect=function(e){(e=e||{}).success="function"==typeof e.success?e.success:Hh.noop,e.error="function"==typeof e.error?e.error:Hh.noop,e.reconnect=!0,D(e)},this.getSessionId=function(){return b},this.destroy=function(t){!function(t){t=t||{},t.success="function"==typeof t.success?t.success:Hh.noop;var a=!0;void 0!==t.asyncRequest&&null!==t.asyncRequest&&(a=!0===t.asyncRequest);var s=!0;void 0!==t.notifyDestroyed&&null!==t.notifyDestroyed&&(s=!0===t.notifyDestroyed);var l=!1;void 0!==t.cleanupHandles&&null!==t.cleanupHandles&&(l=!0===t.cleanupHandles);if(Hh.log("Destroying session "+b+" (async="+a+")"),!S)return Hh.warn("Is the server down? (connected=false)"),void t.success();if(null==b)return Hh.warn("No session to destroy"),t.success(),void(s&&e.destroyed());if(l)for(var d in P)B(d,{noRequest:!0});var u={rtcgw:"destroy",transaction:Hh.randomString(12)};null!=m&&(u.token=m);null!=_&&(u.apisecret=_);if(i){u.session_id=b;var h=function(){for(var e in r)n.removeEventListener(e,r[e]);n.removeEventListener("message",f),n.removeEventListener("error",p),o&&clearTimeout(o),n.close()},f=function(i){var n=JSON.parse(i.data);n.session_id==u.session_id&&n.transaction==u.transaction&&(h(),t.success(),s&&e.destroyed())},p=function(i){h(),t.error("Failed to destroy the server: Is the server down?"),s&&e.destroyed()};return n.addEventListener("message",f),n.addEventListener("error",p),void n.send(JSON.stringify(u))}Hh.httpAPICall(c+"/"+b,{verb:"POST",async:a,withCredentials:x,body:u,success:function(i){Hh.log("Destroyed session:"),Hh.debug(i),b=null,S=!1,"success"!==i.rtcgw&&Hh.error("Ooops: "+i.error.code+" "+i.error.reason),t.success(),s&&e.destroyed()},error:function(i,n){Hh.error(i+":",n),b=null,S=!1,t.success(),s&&e.destroyed(),pluginHandlesp}})}(t)},this.attach=function(e){!function(e){if(e=e||{},e.success="function"==typeof e.success?e.success:Hh.noop,e.error="function"==typeof e.error?e.error:Hh.noop,e.consentDialog="function"==typeof e.consentDialog?e.consentDialog:Hh.noop,e.iceState="function"==typeof e.iceState?e.iceState:Hh.noop,e.mediaState="function"==typeof e.mediaState?e.mediaState:Hh.noop,e.webrtcState="function"==typeof e.webrtcState?e.webrtcState:Hh.noop,e.slowLink="function"==typeof e.slowLink?e.slowLink:Hh.noop,e.onmessage="function"==typeof e.onmessage?e.onmessage:Hh.noop,e.onlocalstream="function"==typeof e.onlocalstream?e.onlocalstream:Hh.noop,e.onremotestream="function"==typeof e.onremotestream?e.onremotestream:Hh.noop,e.ondata="function"==typeof e.ondata?e.ondata:Hh.noop,e.ondataopen="function"==typeof e.ondataopen?e.ondataopen:Hh.noop,e.oncleanup="function"==typeof e.oncleanup?e.oncleanup:Hh.noop,e.ondetached="function"==typeof e.ondetached?e.ondetached:Hh.noop,!S)return Hh.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var t=e.plugin;if(null==t)return Hh.error("Invalid plugin"),void e.error("Invalid plugin");var a=e.opaqueId,r=e.token?e.token:m,o=Hh.randomString(12),s={rtcgw:"attach",plugin:t,opaque_id:a,transaction:o};null!=r&&(s.token=r);null!=_&&(s.apisecret=_);if(i)return T[o]=function(i){if(Hh.debug(i),"success"!==i.rtcgw)return Hh.error("Ooops: "+i.error.code+" "+i.error.reason),void e.error("Ooops: "+i.error.code+" "+i.error.reason);var n=i.data.id;Hh.log("Created handle: "+n);var a={session:E,plugin:t,id:n,token:r,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 n},getPlugin:function(){return t},getVolume:function(){return U(n,!0)},getRemoteVolume:function(){return U(n,!0)},getLocalVolume:function(){return U(n,!1)},isAudioMuted:function(){return z(n,!1)},muteAudio:function(){return H(n,!1,!0)},unmuteAudio:function(){return H(n,!1,!1)},isVideoMuted:function(){return z(n,!0)},muteVideo:function(){return H(n,!0,!0)},unmuteVideo:function(){return H(n,!0,!1)},getBitrate:function(){return Z(n)},getNetworkQuality:function(e){V(n,e)},send:function(e){k(n,e)},data:function(e){M(n,e)},dtmf:function(e){L(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){j(n,!0,e)},createAnswer:function(e){j(n,!1,e)},handleRemoteJsep:function(e){N(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){G(n,!0===e)},detach:function(e){B(n,e)}};P[n]=a,e.success(a)},s.session_id=b,void n.send(JSON.stringify(s));Hh.httpAPICall(c+"/"+b,{verb:"POST",withCredentials:x,body:s,success:function(i){if(Hh.debug(i),"success"!==i.rtcgw)return Hh.error("Ooops: "+i.error.code+" "+i.error.reason),void e.error("Ooops: "+i.error.code+" "+i.error.reason);var n=i.data.id;Hh.log("Created handle: "+n);var a={session:E,plugin:t,id:n,token:r,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 n},getPlugin:function(){return t},getVolume:function(){return U(n,!0)},getRemoteVolume:function(){return U(n,!0)},getLocalVolume:function(){return U(n,!1)},isAudioMuted:function(){return z(n,!1)},muteAudio:function(){return H(n,!1,!0)},unmuteAudio:function(){return H(n,!1,!1)},isVideoMuted:function(){return z(n,!0)},muteVideo:function(){return H(n,!0,!0)},unmuteVideo:function(){return H(n,!0,!1)},getBitrate:function(){return Z(n)},getNetworkQuality:function(e){V(n,e)},send:function(e){k(n,e)},data:function(e){M(n,e)},dtmf:function(e){L(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){j(n,!0,e)},createAnswer:function(e){j(n,!1,e)},handleRemoteJsep:function(e){N(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){G(n,!0===e)},detach:function(e){B(n,e)}};P[n]=a,e.success(a)},error:function(e,t){Hh.error(e+":",t)}})}(e)}}Hh.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,i=e&&e.Promise||Promise,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},extension:e&&e.extension||zh,isArray:function(e){return Array.isArray(e)},webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,n){var r={method:n.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===n.verb&&(r.headers["Content-Type"]="application/json"),void 0!==n.withCredentials&&(r.credentials=!0===n.withCredentials?"include":n.withCredentials?n.withCredentials:"omit"),void 0!==n.body&&(r.body=JSON.stringify(n.body));var o=t(e,r).catch((function(e){return i.reject({message:"Probably a network error, is the server down?",error:e})}));if(void 0!==n.timeout){var s=new i((function(e,t){var i=setTimeout((function(){return clearTimeout(i),t({message:"Request timed out",timeout:n.timeout})}),n.timeout)}));o=i.race([o,s])}return o.then((function(e){return e.ok?a(n.success)===a(Hh.noop)?e.json().then((function(e){n.success(e)})).catch((function(t){return i.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:i.reject({message:"API call failed",response:e})})).catch((function(e){a(n.error)===a(Hh.noop)&&n.error(e.message||"<< internal error >>",e)})),o}}},Hh.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,i=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new i(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||zh,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,i){var n=void 0!==i.body?{contentType:"application/json",data:JSON.stringify(i.body)}:{},r=void 0!==i.withCredentials?{xhrFields:{withCredentials:i.withCredentials}}:{};return t.ajax(t.extend(n,r,{url:e,type:i.verb,cache:!1,dataType:"json",async:i.async,timeout:i.timeout,success:function(e){a(i.success)===a(Hh.noop)&&i.success(e)},error:function(e,t,n){a(i.error)===a(Hh.noop)&&i.error(t,n)}}))}}},Hh.noop=function(){},Hh.dataChanDefaultLabel="JanusDataChannel",Hh.endOfCandidates=null,Hh.init=function(e){if((e=e||{}).callback="function"==typeof e.callback?e.callback:Hh.noop,!0===Hh.initDone)e.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),Hh.trace=Hh.noop,Hh.debug=Hh.noop,Hh.vdebug=Hh.noop,Hh.log=Hh.noop,Hh.warn=Hh.noop,Hh.error=Hh.noop,!0===e.debug||"all"===e.debug)Hh.trace=console.trace.bind(console),Hh.debug=console.debug.bind(console),Hh.vdebug=console.debug.bind(console),Hh.log=console.log.bind(console),Hh.warn=console.warn.bind(console),Hh.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var i=e.debug[t];switch(i){case"trace":Hh.trace=console.trace.bind(console);break;case"debug":Hh.debug=console.debug.bind(console);break;case"vdebug":Hh.vdebug=console.debug.bind(console);break;case"log":Hh.log=console.log.bind(console);break;case"warn":Hh.warn=console.warn.bind(console);break;case"error":Hh.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+i+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')")}}Hh.log("Initializing library");var n=e.dependencies||Hh.useDefaultDependencies();Hh.isArray=n.isArray,Hh.webRTCAdapter=n.webRTCAdapter,Hh.httpAPICall=n.httpAPICall,Hh.newWebSocket=n.newWebSocket,Hh.extension=n.extension,Hh.extension.init(),Hh.listDevices=function(e,t){e="function"==typeof e?e:Hh.noop,null==t&&(t={audio:!0,video:!0}),Hh.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(i){Hh.debug(i),e(i);try{var n=t.getTracks();for(var a in n){var r=n[a];null!=r&&r.stop()}}catch(e){}}))})).catch((function(t){Hh.error(t),e([])})):(Hh.warn("navigator.mediaDevices unavailable"),e([]))},Hh.attachMediaStream=function(e,t){"chrome"===Hh.webRTCAdapter.browserDetails.browser?Hh.webRTCAdapter.browserDetails.version>=52?e.srcObject=t:void 0!==e.src?e.src=URL.createObjectURL(t):Hh.error("Error attaching stream to element"):e.srcObject=t},Hh.reattachMediaStream=function(e,t){"chrome"===Hh.webRTCAdapter.browserDetails.browser?Hh.webRTCAdapter.browserDetails.version>=52?e.srcObject=t.srcObject:void 0!==e.src?e.src=t.src:Hh.error("Error reattaching stream to element"):e.srcObject=t.srcObject};var a=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",r=window["on"+a];if(window.addEventListener(a,(function(e){for(var t in Hh.log("Closing window"),Hh.sessions)null!==Hh.sessions[t]&&void 0!==Hh.sessions[t]&&Hh.sessions[t].destroyOnUnload&&(Hh.log("Destroying session "+t),Hh.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));r&&"function"==typeof r&&r()})),Hh.safariVp8=!1,"safari"===Hh.webRTCAdapter.browserDetails.browser&&Hh.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var t in RTCRtpSender.getCapabilities("video").codecs){var o=RTCRtpSender.getCapabilities("video").codecs[t];if(o&&o.mimeType&&"video/vp8"===o.mimeType.toLowerCase()){Hh.safariVp8=!0;break}}Hh.safariVp8?Hh.log("This version of Safari supports VP8"):Hh.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 s=new RTCPeerConnection({},{});s.createOffer({offerToReceiveVideo:!0}).then((function(e){Hh.safariVp8=-1!==e.sdp.indexOf("VP8"),Hh.safariVp8?Hh.log("This version of Safari supports VP8"):Hh.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"),s.close(),s=null}))}if(Hh.unifiedPlan=!1,"firefox"===Hh.webRTCAdapter.browserDetails.browser&&Hh.webRTCAdapter.browserDetails.version>=59)Hh.unifiedPlan=!0;else if("chrome"===Hh.webRTCAdapter.browserDetails.browser&&Hh.webRTCAdapter.browserDetails.version<72)Hh.unifiedPlan=!1;else if("currentDirection"in RTCRtpTransceiver.prototype){var l=new RTCPeerConnection;try{l.addTransceiver("audio"),Hh.unifiedPlan=!0}catch(e){}l.close()}else Hh.unifiedPlan=!1;Hh.initDone=!0,e.callback()}},Hh.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},Hh.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},Hh.randomString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i="",n=0;n<e;n++){var a=Math.floor(62*Math.random());i+=t.substring(a,a+1)}return i},window.Janus=Hh;var Vh="V1.0",Zh="https://open.ys7.com",Wh={},Gh=function(e,t){Wh[e]||(Wh[e]=[]),Wh[e].push(t)},Yh=function(){var e=Array.prototype.shift.call(arguments),t=Wh[e];if(!t||0===t.length)return!1;for(var i,n=0;i=t[n];n++)i.apply(this,arguments)};function Xh(){var e={};return e.promise=new Promise((function(t,i){e.resolve=t,e.reject=i})),e}var Jh=function(){function e(t){r(this,e),l(this,"subscribe",(function(e){var t=Xh(),i={cmdType:"subremote",streamtype:e.type,customId:e.clientId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId},n=null;return window["ezuikit-webrtc"].opt.janus.attach({plugin:"rtcgw.plugin.sts",opaqueId:window["ezuikit-webrtc"].opt.opaqueId,success:function(a){console.log("pluginHandle",a),8==e.type?window["ezuikit-webrtc"].opt.subscribeScreenHandle=a:(window["ezuikit-webrtc"].opt["".concat(e.clientId)]=a,1==e.type&&window["ezuikit-webrtc"].opt["".concat(e.clientId)].send({message:{cmdType:"unsubremote",streamtype:2,customId:e.clientId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId},success:function(){},error:function(e){}})),(n=a).createOffer({media:{videoSend:!1,audioSend:!1,audioRecv:!0,videoRecv:!0,audio:!0,video:!0,data:!1},simulcast:!1,simulcast2:!1,success:function(e){Janus.debug("remoteFeed createOffer Got SDP!"),Janus.debug(e),n.send({message:i,jsep:e})},error:function(e){Janus.error("remoteFeed WebRTC error:",e),t.reject(e)}})},error:function(e){console.error("  -- Error attaching plugin...",e),t.reject(e)},consentDialog:function(e){Janus.debug("Consent dialog should be "+(e?"on":"off")+" now")},iceState:function(e){switch(Janus.log("ICE state changed to "+e),e){case"connected":console.log("ice connect success");break;case"disconnected":console.log("ice connect loss")}},mediaState:function(e,t){Janus.log("Janus "+(t?"started":"stopped")+" receiving our "+e)},webrtcState:function(e){Janus.log("Janus says our WebRTC PeerConnection is "+(e?"up":"down")+" now")},slowLink:function(e,t){Janus.warn("Janus reports problems "+(e?"sending":"receiving")+" packets on this PeerConnection ("+t+" lost packets)")},onmessage:function(e,t){Janus.debug(" ::: Got a message :::"),Janus.debug(e),null!=t&&(Janus.debug("Handling SDP as well..."),Janus.debug(t),n.handleRemoteJsep({jsep:t})),"subremoteack"===e.rtcgw&&Yh("subremoteack",e)},onlocalstream:function(e){},onremotestream:function(i){console.log("remoteStream==================================",i);var n={clientId:e.clientId,stream:i,streamType:e.type};t.resolve(n),Yh("remoteStream",n)},ondataopen:function(e){Janus.log("The DataChannel is available!")},ondata:function(e){Janus.debug("We got data from the DataChannel! "+e)},oncleanup:function(){Janus.log(" ::: Got a cleanup notification :::")}}),t.promise})),l(this,"subscribeStream",(function(e){var t=Xh(),i={cmdType:"resumesubremote",streamtype:e.type,customId:e.clientId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};return window["ezuikit-webrtc"].opt["".concat(e.clientId)]&&window["ezuikit-webrtc"].opt["".concat(e.clientId)].send({message:i,success:function(){t.resolve("success")},error:function(e){t.reject(e)}}),t.promise})),l(this,"unsubscribe",(function(e){var t=Xh(),i={cmdType:"unsubremote",streamtype:e.type,customId:e.clientId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};return 8==e.type?window["ezuikit-webrtc"].opt.subscribeScreenHandle.send({message:i,success:function(){window["ezuikit-webrtc"].opt.subscribeScreenHandle.detach({noRequest:!1,success:function(){t.resolve("success")}})},error:function(e){t.reject(e)}}):window["ezuikit-webrtc"].opt["".concat(e.clientId)].send({message:i,success:function(){3==e.type?window["ezuikit-webrtc"].opt["".concat(e.clientId)].detach({noRequest:!1,success:function(){t.resolve("success")}}):t.resolve("success")},error:function(e){t.reject(e)}}),t.promise})),l(this,"unsubscribeStream",(function(e){var t=Xh(),i={cmdType:"pausesubremote",streamtype:e.type,customId:e.clientId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};return window["ezuikit-webrtc"].opt["".concat(e.clientId)].send({message:i,success:function(){t.resolve("success")},error:function(e){t.reject(e)}}),t.promise})),l(this,"listen",(function(){return Gh.apply(void 0,arguments)})),this.initEZWEBPlayer(t)}return s(e,[{key:"initEZWEBPlayer",value:function(e){console.log("params",e),window["ezuikit-webrtc"]={opt:{roomParams:{room:0,userId:e.userId,video:1,internalRoomId:null,roomId:e.roomId,clientId:null,rtctoken:e.rtctoken},janus:null,mainHandle:null,sts:null,screenHandle:null,subscribeScreenHandle:null,opaqueId:"sts-"+Janus.randomString(12),localStreamType:null,server:null,accessToken:e.accessToken,stream:"",screenStream:null,apiDomain:Zh,cln:{local:{username:"",client_id:""}}},videoParams:{},audioParams:{},cameraId:null,microphoneId:null,bitrate:1e5,frameRate:15,width:320,height:240},C("".concat(Zh,"/api/v3/rtc/wss"),"POST",{appId:e.appId,roomId:e.roomId,customId:e.userId,accessToken:e.accessToken},{"Content-Type":"application/x-www-form-urlencoded",accessToken:e.accessToken},(function(t){if(console.log("data",t),200!=t.meta.code)return void e.handleError(t.meta);var i=t.data;i.clientId;var n=i.domain;i.internalRoomId;var a=i.wssPath;window["ezuikit-webrtc"].opt.server="wss://".concat(n,"/").concat(a),window["ezuikit-webrtc"].opt.roomParams.internalRoomId=t.data.internalRoomId,window["ezuikit-webrtc"].opt.roomParams.clientId=t.data.clientId;var r={token:"token=".concat(e.rtctoken,"&userId=").concat(e.userId,"&roomId=").concat(e.roomId,"&appId=").concat(e.appId),authtype:23};Janus.init({debug:"all",callback:function(){window["ezuikit-webrtc"].opt.janus=new Janus({server:window["ezuikit-webrtc"].opt.server,success:function(t){t&&e.onMessage(t)},error:function(t){e.handleError(t)},destroyed:function(){}},r)}})}))}},{key:"getVersion",value:function(){var e=Xh();return e.resolve(Vh),e.promise}},{key:"getSupport",value:function(){var e=Xh(),t={isWebrtcSupport:!0,isH264Support:!0},i=document.createElement("video");return i.canPlayType&&(i.canPlayType("video/mp4;codecs=“avc1.64001E”")?t.isH264Support=!0:t.isH264Support=!1),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia?(t.isWebrtcSupport=!0,e.resolve(t)):(t.isWebrtcSupport=!1,e.reject(t)),e.promise}},{key:"getMediaList",value:function(){var e=Xh();return navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){e.resolve(t)})):e.reject("no devices"),e.promise}},{key:"getCamerasList",value:function(){var e=Xh();return navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var i=[];t.map((function(e){"videoinput"==e.kind&&i.push(e)})),e.resolve(i)})):e.reject("no devices"),e.promise}},{key:"getMicrophonesList",value:function(){var e=Xh();return navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var i=[];t.map((function(e){"audioinput"==e.kind&&i.push(e)})),e.resolve(i)})):e.reject("no devices"),e.promise}},{key:"getSpeakersList",value:function(){var e=Xh();return navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var i=[];t.map((function(e){"audiooutput"==e.kind&&i.push(e)})),e.resolve(i)})):e.reject("no devices"),e.promise}},{key:"play",value:function(e){var t=Xh(),i=document.getElementById(e.domId),n=window["ezuikit-webrtc"].opt.cln.local.stream;return Janus.attachMediaStream(i,n),i.play(),document.getElementById(e.domId)?t.resolve("success"):t.reject("no video dom"),t.promise}},{key:"leaveRoom",value:function(e){var t=Xh(),i={cmdType:"exitRoom",customId:window["ezuikit-webrtc"].opt.roomParams.userId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};return window["ezuikit-webrtc"].opt.mainHandle.send({message:i,success:function(){window["ezuikit-webrtc"].opt.janus.destroy({success:function(){}}),t.resolve("success")},error:function(e){console.error("  -- Error attaching plugin...",e),t.reject(e)}}),t.promise}},{key:"setCameraDevice",value:function(e){var t=Xh();return window["ezuikit-webrtc"].cameraId=e.deviceId,window["ezuikit-webrtc"].opt.sts&&window["ezuikit-webrtc"].opt.sts.createOffer({media:{video:{deviceId:e.deviceId},replaceVideo:!0,audio:1!=window["ezuikit-webrtc"].opt.localStreamType},simulcast:!1,simulcast2:!1,bitrate:window["ezuikit-webrtc"].bitrate,frameRate:window["ezuikit-webrtc"].frameRate,success:function(e){console.log("createOffersuccess"),Janus.debug("Got SDP!"),Janus.debug(e),t.resolve("success")},error:function(e){console.log("createOffererror"),Janus.error("WebRTC error:",e),t.reject(e)}}),t.promise}},{key:"setMicrophoneDevice",value:function(e){var t=Xh();return window["ezuikit-webrtc"].microphoneId=e.deviceId,window["ezuikit-webrtc"].opt.sts&&window["ezuikit-webrtc"].opt.sts.createOffer({media:{audio:{deviceId:e.deviceId},replaceAudio:!0,video:2!=window["ezuikit-webrtc"].opt.localStreamType},simulcast:!1,simulcast2:!1,bitrate:window["ezuikit-webrtc"].bitrate,frameRate:window["ezuikit-webrtc"].frameRate,success:function(e){console.log("createOffersuccess"),Janus.debug("Got SDP!"),Janus.debug(e),t.resolve("success")},error:function(e){console.log("createOffererror"),Janus.error("WebRTC error:",e),t.reject(e)}}),t.promise}},{key:"setVideoProfile",value:function(e){var t=Xh(),i={video:{width:e.video.width||360,height:e.video.height||640,frameRate:e.video.frameRate},bitrate:e.video.bitrate||5e5,id:e.id};return window["ezuikit-webrtc"].videoParams=i.video,window["ezuikit-webrtc"].bitrate=1e3*i.bitrate,window["ezuikit-webrtc"].frameRate=e.video.frameRate,window["ezuikit-webrtc"].width=e.video.width,window["ezuikit-webrtc"].height=e.video.height,t.resolve("success"),t.promise}},{key:"setAudioProfile",value:function(e){var t={audio:{deviceId:window["ezuikit-webrtc"].cameraId,sampleRate:e.audio.sampleRate||"32000HZ",sampleSize:e.audio.sampleSize||16,channelCount:e.audio.channelCount||1},id:e.id};window["ezuikit-webrtc"].audioParams=t.audio,console.log("window['ezuikit-webrtc'].videoParams",window["ezuikit-webrtc"])}},{key:"joinRoom",value:function(e){var t=Xh();return window["ezuikit-webrtc"].opt.janus.attach({plugin:"rtcgw.plugin.sts",opaqueId:window["ezuikit-webrtc"].opt.opaqueId,success:function(e){console.log("pluginHandle",e),window["ezuikit-webrtc"].opt.mainHandle=e,Janus.debug("Trying a createOffer too (audio/video sendrecv)");var i={cmdType:"enterRoom",customId:window["ezuikit-webrtc"].opt.roomParams.userId,clientId:window["ezuikit-webrtc"].opt.roomParams.clientId,strroomId:window["ezuikit-webrtc"].opt.roomParams.roomId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId,authtype:23,authentication:window["ezuikit-webrtc"].opt.roomParams.rtctoken};e.send({message:i}),t.resolve(e.id)},error:function(e){console.error("  -- Error attaching plugin...",e),t.reject(e)},consentDialog:function(e){Janus.debug("Consent dialog should be "+(e?"on":"off")+" now")},iceState:function(e){switch(Janus.log("ICE state changed to "+e),e){case"connected":console.log("ice connect success");break;case"disconnected":console.log("ice connect loss")}},mediaState:function(e,t){Janus.log("Janus "+(t?"started":"stopped")+" receiving our "+e)},webrtcState:function(e){Janus.log("Janus says our WebRTC PeerConnection is "+(e?"up":"down")+" now")},slowLink:function(e,t){Janus.warn("Janus reports problems "+(e?"sending":"receiving")+" packets on this PeerConnection ("+t+" lost packets)")},onmessage:function(e,t){Janus.debug(" ::: Got a message :::"),Janus.debug(e),null!=t&&(Janus.debug("Handling SDP as well..."),Janus.debug(t),window["ezuikit-webrtc"].opt.mainHandle.handleRemoteJsep({jsep:t}));var i=e.result;if(null!=i){if("done"===i)return;i.status}"enterRoomack"===e.rtcgw&&Yh("enterRoomack",e),"clientJoin"===e.rtcgw&&Yh("clientJoin",e),"clientLeave"===e.rtcgw&&Yh("clientLeave",e),"stream-added"===e.rtcgw&&Yh("steam-added",e),"stream-removed"===e.rtcgw&&Yh("stream-removed",e),"audioleve"===e.rtcgw&&Yh("audioleve",e),"networkquality"===e.rtcgw&&Yh("networkquality",e),"error"===e.rtcgw&&Yh("error",e),"audioleve"===e.rtcgw&&Yh("audioleve",e),"publishlocalstreamack"===e.rtcgw&&Yh("publishlocalstreamack",e),"subremoteack"===e.rtcgw&&Yh("subremoteack",e)},onlocalstream:function(e){console.log("onlocalstream",e),Janus.debug(" ::: Got a local stream :::"),Janus.debug(e),window["ezuikit-webrtc"].opt.cln.local.stream=e},onremotestream:function(e){},ondataopen:function(e){Janus.log("The DataChannel is available!")},ondata:function(e){Janus.debug("We got data from the DataChannel! "+e)},oncleanup:function(){Janus.log(" ::: Got a cleanup notification :::")}}),t.promise}},{key:"getLocalStream",value:function(e){var t=Xh();return window["ezuikit-webrtc"].opt.cln.local.stream?t.resolve(window["ezuikit-webrtc"].opt.cln.local.stream):t.reject("no stream"),t.promise}},{key:"getScreenStream",value:function(e){var t=Xh();return window["ezuikit-webrtc"].opt.screenStream?t.resolve(window["ezuikit-webrtc"].opt.screenStream):t.reject("no stream"),t.promise}},{key:"suspendStream",value:function(e){this.controlStream(e,"suspend")}},{key:"controlStream",value:function(e,t){var i=Xh(),n={cmdType:"resume"==t?"resumelocalstream":"pauselocalstream",streamtype:e.type,customId:window["ezuikit-webrtc"].opt.roomParams.userId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};return 2==e.type&&window["ezuikit-webrtc"].opt.cln.local.stream.getTracks().forEach((function(e){"audio"==e.kind&&(e.enabled="resume"==t)})),1==e.type&&window["ezuikit-webrtc"].opt.cln.local.stream.getTracks().forEach((function(e){"video"==e.kind&&(e.enabled="resume"==t)})),8==e.type&&(console.log(" window['ezuikit-webrtc'].opt.screenStream.getTracks()",window["ezuikit-webrtc"].opt.screenStream.getTracks()),window["ezuikit-webrtc"].opt.screenStream.getTracks().forEach((function(e){e.enabled="resume"==t}))),3==e.type&&window["ezuikit-webrtc"].opt.cln.local.stream.getTracks().forEach((function(e){e.enabled="resume"==t})),8==e.type?window["ezuikit-webrtc"].opt.screenHandle.send({message:n,success:function(){i.resolve("success")},error:function(e){i.reject(e)}}):window["ezuikit-webrtc"].opt.sts.send({message:n,success:function(){i.resolve("success")},error:function(e){i.reject(e)}}),i.promise}},{key:"resumeStream",value:function(e){this.controlStream(e,"resume")}},{key:"publishStream",value:function(e){var t=Xh(),i={cmdType:"publishlocalstream",streamtype:e.type,customId:window["ezuikit-webrtc"].opt.roomParams.userId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};8!=e.type&&(window["ezuikit-webrtc"].opt.localStreamType=e.type),window["ezuikit-webrtc"].videoParams;var n={videoSend:!0,audioSend:!0,audioRecv:!0,videoRecv:!0,data:!1,video:"stdres",audio:!0};switch(e.type){case 1:n={videoSend:!0,audioSend:!0,audioRecv:!0,videoRecv:!0,data:!1,video:{deviceId:window["ezuikit-webrtc"].cameraId,width:window["ezuikit-webrtc"].width,height:window["ezuikit-webrtc"].height},audio:!1};break;case 2:n={videoSend:!0,audioSend:!0,audioRecv:!0,videoRecv:!0,data:!1,video:!1,audio:{deviceId:window["ezuikit-webrtc"].microphoneId}};break;case 3:n={videoSend:!0,audioSend:!0,audioRecv:!0,videoRecv:!0,data:!1,video:{deviceId:window["ezuikit-webrtc"].cameraId,width:window["ezuikit-webrtc"].width,height:window["ezuikit-webrtc"].height},audio:{deviceId:window["ezuikit-webrtc"].microphoneId}};break;case 8:n={audioRecv:!1,videoRecv:!0,data:!1,audioSend:!1,videoSend:!0,video:"screen",screenshareFrameRate:3}}return console.log("media-----------",n),console.log("window['ezuikit-webrtc'].bitrate",window["ezuikit-webrtc"].bitrate),console.log("window['ezuikit-webrtc'].opt.sts",window["ezuikit-webrtc"].opt.sts),window["ezuikit-webrtc"].opt.sts&&8!=e.type?window["ezuikit-webrtc"].opt.sts.createOffer({media:n,simulcast:!1,simulcast2:!1,bitrate:window["ezuikit-webrtc"].bitrate,frameRate:window["ezuikit-webrtc"].frameRate,success:function(e){console.log("createOffersuccess"),Janus.debug("Got SDP!"),Janus.debug(e),window["ezuikit-webrtc"].opt.sts.send({message:i,jsep:e}),t.resolve("success")},error:function(e){console.log("createOffererror"),Janus.error("WebRTC error:",e),t.reject(e)}}):window["ezuikit-webrtc"].opt.janus.attach({plugin:"rtcgw.plugin.sts",opaqueId:window["ezuikit-webrtc"].opt.opaqueId,success:function(a){console.log("pluginHandle",a),8==e.type?window["ezuikit-webrtc"].opt.screenHandle=a:window["ezuikit-webrtc"].opt.sts=a,Janus.debug("Trying a createOffer too (audio/video sendrecv)"),a.createOffer({media:n,simulcast:!1,simulcast2:!1,bitrate:window["ezuikit-webrtc"].bitrate,frameRate:window["ezuikit-webrtc"].frameRate,success:function(e){console.log("createOffersuccess"),Janus.debug("Got SDP!"),Janus.debug(e),a.send({message:i,jsep:e}),t.resolve("success")},error:function(e){console.log("createOffererror"),Janus.error("WebRTC error:",e),t.reject(e)}})},error:function(e){console.error("  -- Error attaching plugin...",e),t.reject(e)},consentDialog:function(e){Janus.debug("Consent dialog should be "+(e?"on":"off")+" now")},iceState:function(e){switch(Janus.log("ICE state changed to "+e),e){case"connected":console.log("ice connect success");break;case"disconnected":console.log("ice connect loss")}},mediaState:function(e,t){Janus.log("Janus "+(t?"started":"stopped")+" receiving our "+e)},webrtcState:function(e){Janus.log("Janus says our WebRTC PeerConnection is "+(e?"up":"down")+" now")},slowLink:function(e,t){Janus.warn("Janus reports problems "+(e?"sending":"receiving")+" packets on this PeerConnection ("+t+" lost packets)")},onmessage:function(t,i){console.log("消息回调+++++++++++++++++++++++++++++++++++++++++",t,i),Janus.debug(" ::: Got a message :::"),Janus.debug(t),null!=i&&(Janus.debug("Handling SDP as well..."),Janus.debug(i),8==e.type?window["ezuikit-webrtc"].opt.screenHandle.handleRemoteJsep({jsep:i}):window["ezuikit-webrtc"].opt.sts.handleRemoteJsep({jsep:i}))},onlocalstream:function(t){console.log("onlocalstream",t),Janus.debug(" ::: Got a local stream :::"),Janus.debug(t),8==e.type?(window["ezuikit-webrtc"].opt.screenStream=t,t.getVideoTracks()[0].addEventListener("ended",(function(){console.log("停止了屏幕共享-----------------------");var e={cmdType:"unpublishlocalstream",streamtype:8,customId:window["ezuikit-webrtc"].opt.roomParams.userId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};window["ezuikit-webrtc"].opt.screenHandle&&window["ezuikit-webrtc"].opt.screenHandle.send({message:e,success:function(){window["ezuikit-webrtc"].opt.screenHandle.detach({noRequest:!1}),window["ezuikit-webrtc"].opt.screenHandle=null},error:function(e){}})}))):window["ezuikit-webrtc"].opt.cln.local.stream=t},onremotestream:function(e){},ondataopen:function(e){Janus.log("The DataChannel is available!")},ondata:function(e){Janus.debug("We got data from the DataChannel! "+e)},oncleanup:function(){Janus.log(" ::: Got a cleanup notification :::")}}),t.promise}},{key:"unpublishStream",value:function(e){var i=Xh(),n={cmdType:"unpublishlocalstream",streamtype:3,customId:window["ezuikit-webrtc"].opt.roomParams.userId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};return 8==e.type?window["ezuikit-webrtc"].opt.screenHandle.send({message:t(t({},n),{},{streamtype:8}),success:function(){window["ezuikit-webrtc"].opt.screenHandle.detach({noRequest:!1}),window["ezuikit-webrtc"].opt.screenHandle=null,i.resolve("success")},error:function(e){i.reject(e)}}):window["ezuikit-webrtc"].opt.sts.send({message:n,success:function(){window["ezuikit-webrtc"].opt.sts.detach({noRequest:!1}),window["ezuikit-webrtc"].opt.sts=null,i.resolve("success")},error:function(e){i.reject(e)}}),i.promise}},{key:"ezwebTrigger",value:function(e){var t={stream:window["ezuikit-webrtc"].opt.cln.local.stream,clientId:"cliendId-".concat(20*Math.random())};Yh("steam-added",t)}},{key:"playRemoteSteam",value:function(e){var t=document.getElementById(e.domId);Janus.attachMediaStream(t,e.stream),t.load();var i=t.play();void 0!==i&&i.then((function(){t.play()})).catch((function(e){}))}},{key:"getQuality",value:function(e){window["ezuikit-webrtc"].opt.z3.getNetworkQuality(e.handleId,(function(e){console.log("NetworkQuality",e)}))}}]),e}(),qh="8.0.2";class Kh{static get JS_ERROR(){return"js_error"}static get RESOURCE_ERROR(){return"resource_error"}static get VUE_ERROR(){return"vue_error"}static get PROMISE_ERROR(){return"promise_error"}static get AJAX_ERROR(){return"ajax_error"}static get CONSOLE_INFO(){return"console_info"}static get CONSOLE_WARN(){return"console_warn"}static get CONSOLE_ERROR(){return"console_error"}static get CROSS_SCRIPT_ERROR(){return"cross_srcipt_error"}static get UNKNOW_ERROR(){return"unknow_error"}static get PERFORMANCE(){return"performance"}static get BUSINESS(){return"business"}}class $h{static get ERROR(){return"Error"}static get WARN(){return"Warning"}static get INFO(){return"Info"}}class Qh{static get FETCH(){return"fetch"}static get DEFAULT(){return"default"}}var ef=function(){var e="undefined"!=typeof self?self:this,t=e||{},i={navigator:void 0!==e.navigator?e.navigator:{},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},n={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var t=i.navigator.userAgent||{},a=n.getMatchMap(t);for(var r in i.infoMap)for(var o=0;o<i.infoMap[r].length;o++){var s=i.infoMap[r][o];a[s]&&(e[r]=s)}},getOS:function(){return n.matchInfoMap(this),this.os},getOSVersion:function(){var e=this,t=i.navigator.userAgent||{};e.osVersion="";var n={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return n[e.os]&&(e.osVersion=n[e.os](),e.osVersion==t&&(e.osVersion="")),e.osVersion},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"竖屏":"横屏"},getDeviceType:function(){var e=this;return e.device="PC",n.matchInfoMap(e),e.device},getNetwork:function(){return navigator&&navigator.connection&&navigator.connection.effectiveType},getLanguage:function(){var e;return this.language=((e=(i.navigator.browserLanguage||i.navigator.language).split("-"))[1]&&(e[1]=e[1].toUpperCase()),e.join("_")),this.language},createFingerprint:function(e){var t=document.createElement("canvas"),i=t.getContext("2d"),n=e||window.location.host;i.textBaseline="top",i.font="14px 'Arial'",i.textBaseline="tencent",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",i.fillText(n,2,15),i.fillStyle="rgba(102, 204, 0, 0.7)",i.fillText(n,4,17);var a=t.toDataURL().replace("data:image/png;base64,",""),r=function(e){var t,i,n,a="";for(t=0,i=(e+="").length;t<i;t++)a+=(n=e.charCodeAt(t).toString(16)).length<2?"0"+n:n;return a}(atob(a).slice(-16,-12));return r},getBrowserInfo:function(){var e=this;n.matchInfoMap(e);var a=i.navigator.userAgent||{},r=function(e,t){var n=i.navigator.mimeTypes;for(var a in n)if(n[a][e]==t)return!0;return!1},o=n.getMatchMap(a),s=!1;if(t.chrome){var l=a.replace(/^.*Chrome\/([\d]+).*$/,"$1");l>36&&t.showModalDialog?s=!0:l>45&&(s=r("type","application/vnd.chromium.remoting-viewer"))}if(o.Baidu&&o.Opera&&(o.Baidu=!1),o.Mobile&&(o.Mobile=!(a.indexOf("iPad")>-1)),s&&(r("type","application/gameplugin")||i.navigator&&void 0===i.navigator.connection.saveData?o["360SE"]=!0:o["360EE"]=!0),o.IE||o.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 74:case 105:break;case 102:o["360EE"]=!0;break;case 104:o["360SE"]=!0}var c={Safari:function(){return a.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return a.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return a.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return a.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return a.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return a.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return a.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return a.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return a.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return a.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return a.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return a.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return a.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return a.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return a.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return a.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return a.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return a.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return a.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return a.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return a.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[a.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[a.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return a.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return a.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return a.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return a.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return a.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return a.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){return{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[navigator.userAgent.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"2345Explorer":function(){return a.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return a.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return a.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return a.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return a.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return a.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},Taobao:function(){return a.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return a.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return a.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return a.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return a.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return a.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",c[e.browser]&&(e.browserVersion=c[e.browser](),e.browserVersion==a&&(e.browserVersion="")),"Edge"==e.browser&&(e.engine="EdgeHTML"),"Chrome"==e.browser&&parseInt(e.browserVersion)>27&&(e.engine="Blink"),"Opera"==e.browser&&parseInt(e.browserVersion)>12&&(e.engine="Blink"),"Yandex"==e.browser&&(e.engine="Blink"),e.browser+"(版本: "+e.browserVersion+"&nbsp;&nbsp;内核: "+e.engine+")"}},a={DeviceInfoObj:function(e){e=e||{domain:""};var a={deviceType:n.getDeviceType(),OS:n.getOS(),OSVersion:n.getOSVersion(),screenHeight:t.screen.height,screenWidth:t.screen.width,language:n.getLanguage(),netWork:n.getNetwork(),orientation:n.getOrientationStatu(),browserInfo:n.getBrowserInfo(),fingerprint:n.createFingerprint(e.domain),userAgent:i.navigator.userAgent};if(!e.info||0==e.info.length)return a;var r={};for(var o in a)e.info.forEach((function(e){e.toLowerCase()==o.toLowerCase()&&(r[e=o]=a[e])}));return r}};return{getDeviceInfo:function(e){return a.DeviceInfoObj(e)}}}(),tf={type:e=>Object.prototype.toString.call(e).replace(/\[object\s|\]/g,""),isFunction(e){return"Function"===this.type(e)},isArray(e){return"Array"===this.type(e)},isNull:e=>null==e||""==e||null==e,objectIsNull:e=>"{}"===JSON.stringify(e),isObject(e){return"Object"===this.type(e)}};class nf{toReport(e,t){try{let n=JSON.stringify(t);var i=new XMLHttpRequest;i.open("POST",e,!0),i.setRequestHeader("Content-Type","application/json"),i.send(n)}catch(e){console.log(e)}}}class af{toReport(e,t){try{let i=JSON.stringify(t);fetch(e,{headers:{"Content-Type":"application/json"},method:"POST",body:i,mode:"same-origin",keepalive:!0})}catch(i){(new nf).toReport(e,t),console.log("fetch请求异常",i)}}}class rf{toReport(e,t){try{(new Image).src=e+"?st="+(new Date).getTime()+"&"+this.formatParams(t)}catch(e){console.log(e)}}formatParams(e){var t=[];for(var i in e)t.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return t.join("&")}}class of{toReport(e,t){try{t.st=(new Date).getTime(),navigator.sendBeacon&&navigator.sendBeacon(e,this.formatParamsByURLSearchParams(t))}catch(e){console.log(e)}}formatParamsByFormData(e){const t=new FormData;for(var i in e)t.append(i,e[i]);return t}formatParamsByURLSearchParams(e){const t=new URLSearchParams;for(var i in e)"object"==typeof e[i]&&(e[i]=JSON.stringify(e[i])),t.append(i,e[i]);return t}formatParams(e){var t=[];for(var i in e)t.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return t.join("&")}}class sf{constructor(e){this.url=e}report(e,t){t=t||{isFetch:!1,isXHR:!1,isImg:!1,isNavigator:!1},this.checkUrl(this.url)?this.sendInfo(e,t):console.log("上报信息url地址格式不正确,url=",this.url)}sendInfo(e,t={}){let i=new af,n=new rf,a=new nf,r=new of;t.isImg?n.toReport(this.url,e):t.isFetch?i.toReport(this.url,e):t.isXHR?a.toReport(this.url,e):t.isNavigator?r.toReport(this.url,e):!!(t.isFetch&&t.isImg&&t.isXHR&&t.isNavigator)||r.toReport(this.url,e)}checkUrl(e){if(!e)return!1;return/^[hH][tT][tT][pP]([sS]?):\/\//.test(e)}}var lf={isStop:!0,queues:[],add:function(e,t){this.queues.push({reportUrl:e,data:t})},fire:function(){if(!this.queues||0===this.queues.length)return void(this.isStop=!0);this.isStop=!1;let e=this.queues[0];e.reportUrl&&new sf(e.reportUrl).report(e.data),this.queues.splice(0,1),this.fire()}};class cf{constructor(e){this.category=Kh.UNKNOW_ERROR,this.level=$h.INFO,this.msg="",this.url="",this.line="",this.col="",this.errorObj="",this.reportUrl=e.reportUrl,this.extendsInfo=e.extendsInfo}recordError(){this.handleRecordError(),lf.isStop&&lf.fire()}handleRecordError(){try{if(!this.msg)return;if(this.reportUrl&&this.url&&this.url.toLowerCase().indexOf(this.reportUrl.toLowerCase())>=0)return void console.log("统计错误接口异常",this.msg);let e=this.handleErrorInfo();lf.add(this.reportUrl,e)}catch(e){console.log(e)}}handleErrorInfo(){let e=this.getExtendsInfo(),t="",i=0;switch(this.category){case Kh.BUSINESS:if(!this.msg.textKey)return e=Object.assign({},e,this.msg),e.l=window.location.href,e;t=JSON.stringify(this.msg),i=1,e.textKey=this.msg.textKey,this.msg.h&&(e.h=this.msg.h),this.msg.text&&(e.text=this.msg.text);break;case Kh.PERFORMANCE:t=JSON.stringify(this.msg),i=1e3,e.clientInfo=this.getDeviceInfo();break;case Kh.AJAX_ERROR:t=JSON.stringify(this.msg),i=100;break;case Kh.RESOURCE_ERROR:const n={msg:this.msg,url:encodeURIComponent(this.url)};t=JSON.stringify(n),i=101;break;case Kh.JS_ERROR:t="错误类别: "+this.category+"\r\n",t+="日志信息: "+this.msg+"\r\n",t+="url: "+encodeURIComponent(this.url)+"\r\n",t+="错误行号: "+this.line+"\r\n",t+="错误列号: "+this.col+"\r\n",this.errorObj&&this.errorObj.stack&&(t+="错误栈: "+this.errorObj.stack+"\r\n"),i=102;break;default:t=this.msg,i=106}return e.logInfo=t,e.l=window.location.pathname,e.action=i,e}getExtendsInfo(){try{let t,i={},n=this.extendsInfo||{};for(var e in tf.isFunction(n.getDynamic)&&(t=n.getDynamic()),tf.isObject(t)&&(n={...n,...t}),n)tf.isFunction(n[e])||(i[e]=n[e]);return i}catch(e){return console.log("call getExtendsInfo error",e),{}}}getDeviceInfo(){try{let e=ef.getDeviceInfo();return JSON.stringify(e)}catch(e){return console.log(e),""}}}function df(e,t){if(!e||"string"!=typeof t)return!0;if("string"==typeof e){if(t.startsWith("/")){if(window.location.hostname.endsWith(e))return!0}else{if(new URL(t).hostname.endsWith(e))return!0}return!1}if("object"==typeof e&&e instanceof Array){let i=!1;return e.forEach((e=>{if("string"==typeof e)if(t.startsWith("/"))window.location.hostname.endsWith(e)&&(i=!0);else{new URL(t).hostname.endsWith(e)&&(i=!0)}})),i}return!1}class uf{constructor(e){this.params=e}handleError(e){switch(e){case Qh.FETCH:new hf(this.params).handleError();break;case Qh.DEFAULT:new ff(this.params).handleError();break;default:new hf(this.params).handleError(),new ff(this.params).handleError()}}}class hf extends cf{constructor(e){super(e),this.ajaxDomain=e.ajaxDomain}handleError(){if(!window.fetch)return;this.level=$h.WARN,this.category=Kh.AJAX_ERROR;let e=this,t=window.fetch;window.fetch=function(){let i=arguments,n=(new Date).getTime(),a=null;return t.apply(this,arguments).then((function(t){try{const r=t.headers?t.headers.get("content-type"):"";if("string"==typeof r&&r.includes("application/json")){const r=t.clone();a=r.status;let o=(new Date).getTime()-n;r.json().then((function(t){const r={fetchStart:n,url:i[0],requestOptions:i[1],status:a,responseBody:t,loadTime:o};e.msg=r,df(e.ajaxDomain,r.url)&&e.recordError()}))}else{const r=t.clone();a=r.status;let o=(new Date).getTime()-n;r.text().then((function(t){try{t=JSON.parse(t)}catch(e){console.log("JSON.parse 失败")}const r={fetchStart:n,url:i[0],requestOptions:i[1],status:a,responseBody:t,loadTime:o};e.msg=r,df(e.ajaxDomain,r.url)&&e.recordError()}))}}catch(e){console.log("获取响应数据上报异常"),console.log(e)}return t})).catch((function(e){console.log("获取响应数据上报异常"),console.log(e)}))}}}class ff extends cf{constructor(e){super(e),this.ajaxDomain=e.ajaxDomain}handleError(){if(!window.XMLHttpRequest)return;this.level=$h.WARN,this.category=Kh.AJAX_ERROR;let e=this,t=XMLHttpRequest.prototype.open,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(e,i,n){return this._url="string"==typeof i?i:i.href,this._method=e,t.call(this,e,this._url,"boolean"!=typeof n||n)},XMLHttpRequest.prototype.send=function(){let t=(new Date).getTime();return this.addEventListener&&this.addEventListener("readystatechange",(function(){if(4===this.readyState)if(this.status>=200&&this.status<300){let i=(new Date).getTime()-t;const n={method:this._method},a={fetchStart:t,url:this._url,requestOptions:n,responseBody:this.response,status:this.status,loadTime:i};e.msg=a,df(e.ajaxDomain,a.url)&&e.recordError()}else{let i=(new Date).getTime()-t;const n={method:this._method},a={fetchStart:t,url:this._url,requestOptions:n,status:this.status,loadTime:i};e.msg=a,df(e.ajaxDomain,a.url)&&e.recordError()}})),i.apply(this,arguments)}}}class xf extends cf{constructor(e){super(e)}handleError(){this.registerInfo(),this.registerWarn(),this.registerError()}registerInfo(){let e=this;console.tInfo=function(){e.handleLog($h.INFO,Kh.CONSOLE_INFO,arguments)}}registerWarn(){let e=this;console.tWarn=function(){e.handleLog($h.WARN,Kh.CONSOLE_WARN,arguments)}}registerError(){let e=this;console.tError=function(){e.handleLog($h.ERROR,Kh.CONSOLE_ERROR,arguments)}}handleLog(e,t,i){try{this.level=e;let n=[...i];this.msg=n.join("\r\n"),this.url=location.href,this.category=t,this.recordError()}catch(t){console.log("console统计错误异常",e,t)}}}!function(){window.console||(window.console={});["tInfo","tWarn","tError"].forEach(((e,t)=>{console[e]||(console[e]=function(){})}))}();class pf extends cf{constructor(e){super(e)}handleError(){window.onerror=(e,t,i,n,a)=>{console.log("monitor onerror");try{this.level=$h.WARN,this.category=Kh.JS_ERROR,this.msg=e,this.url=t,this.line=i,this.col=n,this.errorObj=a,this.recordError()}catch(a){console.log("js错误异常",a)}}}}class mf extends cf{constructor(e){super(e)}handleError(){window.addEventListener("unhandledrejection",(e=>{try{if(!e||!e.reason)return;e.reason.config&&e.reason.config.url&&(this.url=e.reason.config.url),this.level=$h.WARN,this.category=Kh.PROMISE_ERROR,this.msg=e.reason,this.recordError()}catch(e){console.log(e)}}),!0)}}class _f extends cf{constructor(e){super(e)}handleError(){window.addEventListener("error",(e=>{console.log("monitor addEventListener error");try{if(!e)return;this.category=Kh.RESOURCE_ERROR;let t=e.target||e.srcElement;if(!(t instanceof HTMLScriptElement||t instanceof HTMLLinkElement||t instanceof HTMLImageElement))return;this.level="IMG"===t.tagName.toUpperCase()?$h.WARN:$h.ERROR,this.msg="加载 "+t.tagName+" 资源错误",this.url=t.src||t.href,this.errorObj=t,this.recordError()}catch(e){console.log("资源加载收集异常",e)}}),!0)}}var gf,vf,yf,Sf,bf=-1,Pf=function(e){addEventListener("pageshow",(function(t){t.persisted&&(bf=t.timeStamp,e(t))}),!0)},Ef=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Cf=function(){var e=Ef();return e&&e.activationStart||0},Tf=function(e,t){var i=Ef(),n="navigate";return bf>=0?n="back-forward-cache":i&&(document.prerendering||Cf()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Rf=function(e,t,i){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return n.observe(Object.assign({type:e,buffered:!0},i||{})),n}}catch(e){}},wf=function(e,t,i,n){var a,r;return function(o){t.value>=0&&(o||n)&&((r=t.value-(a||0))||void 0===a)&&(a=t.value,t.delta=r,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,i),e(t))}},If=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Df=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},kf=function(e){var t=!1;return function(i){t||(e(i),t=!0)}},Ff=-1,Af=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Mf=function(e){"hidden"===document.visibilityState&&Ff>-1&&(Ff="visibilitychange"===e.type?e.timeStamp:0,Bf())},Lf=function(){addEventListener("visibilitychange",Mf,!0),addEventListener("prerenderingchange",Mf,!0)},Bf=function(){removeEventListener("visibilitychange",Mf,!0),removeEventListener("prerenderingchange",Mf,!0)},Of=function(){return Ff<0&&(Ff=Af(),Lf(),Pf((function(){setTimeout((function(){Ff=Af(),Lf()}),0)}))),{get firstHiddenTime(){return Ff}}},jf=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Nf=[1800,3e3],Uf=function(e,t){t=t||{},jf((function(){var i,n=Of(),a=Tf("FCP"),r=Rf("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(r.disconnect(),e.startTime<n.firstHiddenTime&&(a.value=Math.max(e.startTime-Cf(),0),a.entries.push(e),i(!0)))}))}));r&&(i=wf(e,a,Nf,t.reportAllChanges),Pf((function(n){a=Tf("FCP"),i=wf(e,a,Nf,t.reportAllChanges),If((function(){a.value=performance.now()-n.timeStamp,i(!0)}))})))}))},zf=[.1,.25],Hf={passive:!0,capture:!0},Vf=new Date,Zf=function(e,t){gf||(gf=t,vf=e,yf=new Date,Yf(removeEventListener),Wf())},Wf=function(){if(vf>=0&&vf<yf-Vf){var e={entryType:"first-input",name:gf.type,target:gf.target,cancelable:gf.cancelable,startTime:gf.timeStamp,processingStart:gf.timeStamp+vf};Sf.forEach((function(t){t(e)})),Sf=[]}},Gf=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var i=function(){Zf(e,t),a()},n=function(){a()},a=function(){removeEventListener("pointerup",i,Hf),removeEventListener("pointercancel",n,Hf)};addEventListener("pointerup",i,Hf),addEventListener("pointercancel",n,Hf)}(t,e):Zf(t,e)}},Yf=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Gf,Hf)}))},Xf=[100,300],Jf=[2500,4e3],qf={},Kf=[800,1800],$f=function e(t){document.prerendering?jf((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},Qf=function(e,t){t=t||{};var i=Tf("TTFB"),n=wf(e,i,Kf,t.reportAllChanges);$f((function(){var a=Ef();if(a){var r=a.responseStart;if(r<=0||r>performance.now())return;i.value=Math.max(r-Cf(),0),i.entries=[a],n(!0),Pf((function(){i=Tf("TTFB",0),(n=wf(e,i,Kf,t.reportAllChanges))(!0)}))}}))};class ex extends cf{constructor(e){super(e||{}),this.category=Kh.PERFORMANCE,this.reportUrl=e.reportUrl||"",this.performanceData={},this.saveData=this.saveData.bind(this),Uf(this.saveData),function(e,t){t=t||{},jf((function(){var i,n=Of(),a=Tf("FID"),r=function(e){e.startTime<n.firstHiddenTime&&(a.value=e.processingStart-e.startTime,a.entries.push(e),i(!0))},o=function(e){e.forEach(r)},s=Rf("first-input",o);i=wf(e,a,Xf,t.reportAllChanges),s&&Df(kf((function(){o(s.takeRecords()),s.disconnect()}))),s&&Pf((function(){var n;a=Tf("FID"),i=wf(e,a,Xf,t.reportAllChanges),Sf=[],vf=-1,gf=null,Yf(addEventListener),n=r,Sf.push(n),Wf()}))}))}(this.saveData),function(e,t){t=t||{},jf((function(){var i,n=Of(),a=Tf("LCP"),r=function(e){var t=e[e.length-1];t&&t.startTime<n.firstHiddenTime&&(a.value=Math.max(t.startTime-Cf(),0),a.entries=[t],i())},o=Rf("largest-contentful-paint",r);if(o){i=wf(e,a,Jf,t.reportAllChanges);var s=kf((function(){qf[a.id]||(r(o.takeRecords()),o.disconnect(),qf[a.id]=!0,i(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return setTimeout(s,0)}),!0)})),Df(s),Pf((function(n){a=Tf("LCP"),i=wf(e,a,Jf,t.reportAllChanges),If((function(){a.value=performance.now()-n.timeStamp,qf[a.id]=!0,i(!0)}))}))}}))}(this.saveData),function(e,t){t=t||{},Uf(kf((function(){var i,n=Tf("CLS",0),a=0,r=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=r[0],i=r[r.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,r.push(e)):(a=e.value,r=[e])}})),a>n.value&&(n.value=a,n.entries=r,i())},s=Rf("layout-shift",o);s&&(i=wf(e,n,zf,t.reportAllChanges),Df((function(){o(s.takeRecords()),i(!0)})),Pf((function(){a=0,n=Tf("CLS",0),i=wf(e,n,zf,t.reportAllChanges),If((function(){return i()}))})),setTimeout(i,0))})))}(this.saveData),Qf(this.saveData)}saveData(e){this.performanceData[e.name]=e.value,"LCP"===e.name&&this.record(this.performanceData)}record(e){this.msg=e,this.recordError()}}const tx="common_a",ix=/((<(A|B|BUTTON|DIV|H1|H2|H3|H4|H5|H6|P|IMG|SPAN|TABLE|TD|TEXTAREA|VIDEO)([^<>])*>)([^<>])+(<\/(A|B|BUTTON|DIV|H1|H2|H3|H4|H5|H6|P|IMG|SPAN|TABLE|TD|TEXTAREA|VIDEO)>)|(<(IMG|VIDEO)(.)+>))/i;function nx(e){var t=e.nodeName,i="";if(e.hasAttribute("data-monitor")&&e.getAttribute("data-monitor"))return`${i=e.getAttribute("data-monitor")}`.slice(0,20);var n=e.outerHTML.match(ix);if(n&&n.length>0)if("IMG"===t)i=e.getAttribute("alt");else i=(i=n[0].match(/>[^<>]+<\//)?n[0].match(/>[^<>]+<\//)[0]:"").replace(/[^A-Za-z0-9\u4e00-\u9fa5]/g,"");return`${i}`.slice(0,20)}class ax extends cf{constructor(e){super(e||{}),this.category=Kh.BUSINESS,this.reportUrl=e.reportUrl||"";const t=e.keyName||"textkey",i=this;window.addEventListener("click",(function(e){let n=e.target;if(!n)return!1;let a=n.getAttribute(t),r=n.getAttribute("link")||n.getAttribute("href");if(a||r){const e={textKey:a||tx};r&&(e.h=r);const t=nx(n);t&&(e.text=t),i.record(e)}else{for(;!a&&!r&&n.parentNode;)n=n.parentNode,n.getAttribute&&(a=n.getAttribute(t),r=n.getAttribute("link")||n.getAttribute("href"));if(a||r){const e={textKey:a||tx};r&&(e.h=r);const t=nx(n);t&&(e.text=t),i.record(e)}}}))}record(e){this.msg=e,this.recordError()}}class rx extends cf{constructor(e){super(e||{}),this.category=Kh.BUSINESS,this.reportUrl=e.reportUrl||""}record(e){this.msg=e,this.recordError()}}Date.prototype.format=function(e){let t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours()%12==0?12:this.getHours()%12,"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()},i={0:"/u65e5",1:"/u4e00",2:"/u4e8c",3:"/u4e09",4:"/u56db",5:"/u4e94",6:"/u516d"};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),/(E+)/.test(e)&&(e=e.replace(RegExp.$1,(RegExp.$1.length>1?RegExp.$1.length>2?"/u661f/u671f":"/u5468":"")+i[this.getDay()+""]));for(let i in t)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[i]:("00"+t[i]).substr((""+t[i]).length)));return e};window.monitorExtendsInfo={},window.ezuikitMonitor=new class{constructor(e){this.jsError=!0,this.promiseError=!0,this.resourceError=!0,this.ajaxError=!0,this.ajaxDomain=null,this.isReportHref=!1,this.consoleError=!1,e=e||{},this.jsError=!(!1===e.jsError),this.promiseError=!(!1===e.promiseError),this.resourceError=!(!1===e.resourceError),this.consoleError=!0===e.consoleError,this.ajaxError=!(!1===e.ajaxError),this.ajaxDomain=e.ajaxDomain||this.ajaxDomain,this.isReportHref=e.isReportHref||this.isReportHref,this.business=!(!1===e.business),this.reportUrl=e.url,this.performace=!(!1===e.performace),this.extendsInfo=e.extendsInfo||{};let t={reportUrl:this.reportUrl,extendsInfo:this.extendsInfo};if(this.jsError&&new pf(t).handleError(),this.promiseError&&new mf(t).handleError(),this.resourceError&&new _f(t).handleError(),this.ajaxError){let e=Object.assign({},t,{ajaxDomain:this.ajaxDomain});new uf(e).handleError()}this.consoleError&&new xf(t).handleError(),this.performace&&new ex(t),this.business&&new ax(t),this.manual=new rx(t)}report(e){return this.manual&&this.manual.record(e),this}}({ajaxDomain:["open.ys7.com",".ezvizlife.com"],url:"https://log.ys7.com/statistics.do/opensdk_ezuikit",extendsInfo:{v:qh,getDynamic:function(){return window.monitorExtendsInfo}}});var ox={Core:f,HLS:R,FLV:class{constructor(e,t){console.log("isSupportFlv",window.flvjs.isSupported()),window.flvjs.isSupported()&&this.initFLV(e,t)}toString(){return`Flv ${this.coreX}-${this.coreY}`}initFLV(e,t){const{deviceSerial:i,channelNo:n,hd:a,type:r}=E(t);window.ezuikitMonitor.report({protocol:"flv",url:t,serial:i,no:n,action:1,logInfo:{type:r}});var o=document.getElementById(e);o.getAttribute("controls")||o.setAttribute("controls",!0);var s=window.flvjs.createPlayer({type:"flv",url:t,isLive:!0},{enableStashBuffer:!0,stashInitialSize:128,enableWorker:!0});s.attachMediaElement(o),s.load(),s.play(),this.flvUrl=t,this.flv=s,this.video=o,this.video.addEventListener("oncanplaythrough",(function(){console.log("oncanplaythrough")}),!1),this.video.addEventListener("onerror",(function(){console.log("onerror")}),!1)}play(){console.log("执行flv播放",this.video),this.video.play()}stop(){this.video.pause(),this.flv.unload()}destroy(){void 0!==this.flv&&null!==this.flv&&(this.flv.pause(),this.flv.unload(),this.flv.detachMediaElement(),this.flv.destroy(),this.flv=null)}},EZUIKitPlayer:Mh,EZUIKitHD:Uh,EZWebRtc:Jh};return window.EZUIKit=ox,ox}));