ezuikit-js 8.1.8 → 8.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js DELETED
@@ -1,62 +0,0 @@
1
- /*
2
- *
3
- * ezuikit.js v8.1.6
4
- * Copyright (c) 2025-2-13 Ezviz-OpenBiz
5
- * Released under ISC the License.
6
- *
7
- */
8
- import"abortcontroller-polyfill";import"formdata-polyfill";import{getStaticPath as e}from"@ezuikit/utils-tools";import t from"@ezuikit/utils-i18n";import n from"screenfull";import{find as i,findIndex as o,throttle as a}from"lodash-es";import r from"debounce-promise";import s from"@ezuikit/player-ezopen/dist/adapter.esm";import c from"@ezuikit/utils-collect";function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t,n,i,o,a,r){try{var s=e[a](r),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(i,o)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,w(i.key),i)}}function p(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=E(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw a}}}}function f(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e){throw new TypeError('"'+e+'" is read-only')}function _(){_=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,i){var a=t&&t.prototype instanceof v?t:v,r=Object.create(a.prototype),s=new A(i||[]);return o(r,"_invoke",{value:C(e,n,s)}),r}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var m="suspendedStart",h="suspendedYield",p="executing",g="completed",f={};function v(){}function y(){}function S(){}var b={};l(b,r,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(D([])));T&&T!==n&&i.call(T,r)&&(b=T);var E=S.prototype=v.prototype=Object.create(b);function P(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(o,a,r,s){var c=u(e[o],e,a);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,r,s)}),(function(e){n("throw",e,r,s)})):t.resolve(d).then((function(e){l.value=e,r(l)}),(function(e){return n("throw",e,r,s)}))}s(c.arg)}var a;o(this,"_invoke",{value:function(e,i){function o(){return new t((function(t,o){n(e,i,t,o)}))}return a=a?a.then(o,o):o()}})}function C(t,n,i){var o=m;return function(a,r){if(o===p)throw Error("Generator is already running");if(o===g){if("throw"===a)throw r;return{value:e,done:!0}}for(i.method=a,i.arg=r;;){var s=i.delegate;if(s){var c=I(s,i);if(c){if(c===f)continue;return c}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===m)throw o=g,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=p;var l=u(t,n,i);if("normal"===l.type){if(o=i.done?g:h,l.arg===f)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(o=g,i.method="throw",i.arg=l.arg)}}}function I(t,n){var i=n.method,o=t.iterator[i];if(o===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),f;var a=u(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,f;var r=a.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,f):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)}function x(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 j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[r];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(i.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=S,o(E,"constructor",{value:S,configurable:!0}),o(S,"constructor",{value:y,configurable:!0}),y.displayName=l(S,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,l(e,c,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},P(k.prototype),l(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,i,o,a){void 0===a&&(a=Promise);var r=new k(d(e,n,i,o),a);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},P(E),l(E,c,"Generator"),l(E,r,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=D,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(i,o){return s.type="throw",s.arg=t,n.next=i,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],s=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var c=i.call(r,"catchLoc"),l=i.call(r,"finallyLoc");if(c&&l){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;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,f):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),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var o=i.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:D(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),f}},t}function b(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||E(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 w(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function T(e){return T="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},T(e)}function E(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}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 n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e};var P=function(e,t,n,i){var o=document.getElementsByTagName("head")[0].getElementsByTagName("script"),a=!1;if(n)a=n();else for(var r=0;r<o.length;r++)o[r].getAttribute("src")==e&&(a=!0,o[r].readyState?o[r].onreadystatechange=function(){"complete"!=o[r].readyState&&"loaded"!=o[r].readyState||(o[r].onreadystatechange=null,t(i))}:o[r].onload=function(){t(i)});if(!a){try{if(!document.querySelector('script[src="'.concat(e,'"]'))){var s=document.createElement("script");s.setAttribute("src",e),s.setAttribute("crossorigin",!0),s.onload=function(){return t(i)},document.getElementsByTagName("head")[0].appendChild(s)}}catch(e){}setTimeout((function(){t(i)}),15)}},k=function(e){for(var t=document.getElementsByTagName("head")[0].getElementsByTagName("script"),n=0;n<t.length;n++)if(t[n].getAttribute("src")==e)return void document.getElementsByTagName("head")[0].removeChild(t[n]);console.log("No matching script file found.")},C=function(e,t){try{if(document.querySelector('link[href="'.concat(e,'"]')))return}catch(e){}for(var n=document.getElementsByTagName("head")[0].getElementsByTagName("link"),i=!1,o=0;o<n.length;o++)n[o].getAttribute("href")==e&&(i=!0);if(!i){var a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.href=e,a.onload=t,document.getElementsByTagName("head")[0].appendChild(a)}},I=function(e){for(var t=document.getElementsByTagName("head")[0].getElementsByTagName("link"),n=0;n<t.length;n++)if(t[n].getAttribute("href")==e)return void document.getElementsByTagName("head")[0].removeChild(t[n]);console.log("No matching CSS file found.")},x=function(e){return!!e&&("object"===T(e)||"function"==typeof e)&&"function"==typeof e.then},j=function(e,t){var n=new RegExp("(\\?|#|&)"+e+"=(.*?)(#|&|$)"),i=(t||window.location.href).match(n);return decodeURIComponent(i?i[2]:"")},A=function(e,t){var n=t.parentNode;n.lastChild==t?n.appendChild(e):n.insertBefore(e,t.nextSibling)},D=function(e){var t=document.documentElement.clientWidth,n="";n+="width:"+document.documentElement.clientHeight+"px;",n+="height:"+t+"px;",n+="-webkit-transform: rotate(90.001deg); transform: rotate(90.001deg);",n+="-webkit-transform-origin: "+t/2+"px "+t/2+"px;",n+="transform-origin: "+t/2+"px "+t/2+"px;",n+="position: fixed;top: 0;left: 0;z-index:10",e.style.cssText=n},R=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":-1!==e.indexOf(".rec")?"rec":"live"}},L=function(e){var t=e.match(/\/([A-Za-z\d]{9})\_(\d)\_(\d)/);if(t.length>3){var n=t[1],i=t[2],o="1"===t[3],a="live";return e.indexOf("rec=local")>-1?a="rec":e.indexOf("rec=cloud")>-1&&(a="cloud.rec"),{deviceSerial:n,channelNo:i,hd:o,type:a}}return{}};var B=function(e,t,n,i,o,a){var r=e,s=new XMLHttpRequest;s.onreadystatechange=function(){if(4==s.readyState&&200==s.status)if(function(e){if("string"==typeof e)try{var t=JSON.parse(e);return!("object"!==T(t)||!t)}catch(e){return!1}console.log("It is not a string!")}(s.responseText)){var e=JSON.parse(s.responseText);o(e)}else o(s.responseText)},s.open(t,r,!0);var c=new FormData;for(var l in n)c.append(l,n[l]);if(i&&"object"===T(i))for(var l in i)s.setRequestHeader(l,i[l]);s.send(c)},M=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)},O=function(){return p((function e(t,n){var i=this;u(this,e),P("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()&&i.initHLS(t,n)}),(function(){return!!window.Hls}))}),[{key:"toString",value:function(){return"hls ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initHLS",value:function(e,t){var n=L(t),i=n.deviceSerial,o=n.channelNo;n.hd,window.ezuikitMonitor.report({protocol:"hls",url:t,serial:i,no:o,action:1});var a=document.getElementById(e),r=new window.Hls({defaultAudioCodec:"mp4a.40.2"});r.loadSource(t),r.attachMedia(a),r.on(window.Hls.Events.MANIFEST_PARSED,(function(){a.play()})),r.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"),r.startLoad();break;case window.Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),r.recoverMediaError();break;default:r.destroy()}})),this.hls=r,this.video=a,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()}}])}();function z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var N,F={exports:{}};globalThis,N=()=>(()=>{var e={343:e=>{var t=Object.prototype.hasOwnProperty,n="~";function i(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,i,a,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new o(i,a||e,r),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,o=[];if(0===this._eventsCount)return o;for(i in e=this._events)t.call(e,i)&&o.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,a=i.length,r=new Array(a);o<a;o++)r[o]=i[o].fn;return r},s.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,o,a,r){var s=n?n+e:e;if(!this._events[s])return!1;var c,l,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,i),!0;case 4:return d.fn.call(d.context,t,i,o),!0;case 5:return d.fn.call(d.context,t,i,o,a),!0;case 6:return d.fn.call(d.context,t,i,o,a,r),!0}for(l=1,c=new Array(u-1);l<u;l++)c[l-1]=arguments[l];d.fn.apply(d.context,c)}else{var m,h=d.length;for(l=0;l<h;l++)switch(d[l].once&&this.removeListener(e,d[l].fn,void 0,!0),u){case 1:d[l].fn.call(d[l].context);break;case 2:d[l].fn.call(d[l].context,t);break;case 3:d[l].fn.call(d[l].context,t,i);break;case 4:d[l].fn.call(d[l].context,t,i,o);break;default:if(!c)for(m=1,c=new Array(u-1);m<u;m++)c[m-1]=arguments[m];d[l].fn.apply(d[l].context,c)}}return!0},s.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,i,o){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return r(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||o&&!s.once||i&&s.context!==i||r(this,a);else{for(var c=0,l=[],d=s.length;c<d;c++)(s[c].fn!==t||o&&!s[c].once||i&&s[c].context!==i)&&l.push(s[c]);l.length?this._events[a]=1===l.length?l[0]:l:r(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&r(this,t)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s},825:(e,t,n)=>{n.d(t,{A:()=>i});const i=function(){function e(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return e.prototype.isComplete=function(){return!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&this.audioChannelCount,!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&this.sarDen,null!=this.mimeType},e.prototype.isSeekable=function(){return this.hasKeyframesIndex},e.prototype.getNearestKeyframe=function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,n=this._search(t.times,e);return{index:n,milliseconds:t.times[n],fileposition:t.filepositions[n]}},e.prototype._search=function(e,t){var n=0,i=e.length-1,o=0,a=0,r=i;for(t<e[0]&&(n=0,a=r+1);a<=r;){if((o=a+Math.floor((r-a)/2))===i||t>=e[o]&&t<e[o+1]){n=o;break}e[o]<t?a=o+1:r=o-1}return n},e}()},453:(e,t,n)=>{n.d(t,{$_:()=>i,EX:()=>a,EZ:()=>o,Sc:()=>r});var i=function(e,t,n,i,o){this.dts=e,this.pts=t,this.duration=n,this.originalDts=i,this.isSyncPoint=o,this.fileposition=null},o=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),a=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var 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))},e.prototype.getLastSyncPointBeforeDts=function(e){if(0===this._list.length)return null;var t=this._list,n=0,i=t.length-1,o=0,a=0,r=i;for(e<t[0].dts&&(n=0,a=r+1);a<=r;){if((o=a+Math.floor((r-a)/2))===i||e>=t[o].dts&&e<t[o+1].dts){n=o;break}t[o].dts<e?a=o+1:r=o-1}return this._list[n]},e}(),r=function(){function e(e){this._type=e,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._list.length},e.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},e.prototype._searchNearestSegmentBefore=function(e){var t,n=this._list;if(0===n.length)return-2;var i=n.length-1,o=0,a=0,r=i,s=0;if(e<n[0].originalBeginDts)return-1;for(;a<=r;){if((o=a+Math.floor((r-a)/2))===i||e>((null===(t=n[o].lastSample)||void 0===t?void 0:t.originalDts)||0)&&e<n[o+1].originalBeginDts){s=o;break}n[o].originalBeginDts<e?a=o+1:r=o-1}return s},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t,n,i=this._list,o=e,a=this._lastAppendLocation,r=0;-1!==a&&a<i.length&&o.originalBeginDts>=((null===(n=null===(t=i[a])||void 0===t?void 0:t.lastSample)||void 0===n?void 0:n.originalDts)||0)&&(a===i.length-1||a<i.length-1&&o.originalBeginDts<i[a+1].originalBeginDts)?r=a+1:i.length>0&&(r=this._searchNearestSegmentBefore(o.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,o)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].syncPoints;0===n.length&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null},e}()},976:(e,t,n)=>{n.d(t,{A:()=>Be});var i=n(413),o=n(502),a=n(620),r=n(825);function s(e,t,n){var i=e;if(t+n<i.length){for(;n--;)if(128!=(192&i[++t]))return!1;return!0}return!1}const c=function(e){for(var t=[],n=e,i=0,o=e.length;i<o;)if(n[i]<128)t.push(String.fromCharCode(n[i])),++i;else{if(n[i]<192);else if(n[i]<224){if(s(n,i,1)&&(a=(31&n[i])<<6|63&n[i+1])>=128){t.push(String.fromCharCode(65535&a)),i+=2;continue}}else if(n[i]<240){if(s(n,i,2)&&(a=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2])>=2048&&55296!=(63488&a)){t.push(String.fromCharCode(65535&a)),i+=3;continue}}else if(n[i]<248){var a;if(s(n,i,3)&&(a=(7&n[i])<<18|(63&n[i+1])<<12|(63&n[i+2])<<6|63&n[i+3])>65536&&a<1114112){a-=65536,t.push(String.fromCharCode(a>>>10|55296)),t.push(String.fromCharCode(1023&a|56320)),i+=4;continue}}t.push(String.fromCharCode(65533)),++i}return t.join("")};var l,d=n(713),u=(l=new ArrayBuffer(2),new DataView(l).setInt16(0,256,!0),256===new Int16Array(l)[0]);const m=function(){function e(){}return e.parseScriptData=function(t,n,i){var a={};try{var r=e.parseValue(t,n,i),s=e.parseValue(t,n+r.size,i-r.size);a[r.data]=s.data}catch(e){o.A.e("AMF",e.toString())}return a},e.parseObject=function(t,n,i){if(i<3)throw new d.j4("Data not enough when parse ScriptDataObject");var o=e.parseString(t,n,i),a=e.parseValue(t,n+o.size,i-o.size),r=a.objectEnd;return{data:{name:o.data,value:a.data},size:o.size+a.size,objectEnd:r}},e.parseVariable=function(t,n,i){return e.parseObject(t,n,i)},e.parseString=function(e,t,n){if(n<2)throw new d.j4("Data not enough when parse String");var i=new DataView(e,t,n).getUint16(0,!u);return{data:i>0?c(new Uint8Array(e,t+2,i)):"",size:2+i}},e.parseLongString=function(e,t,n){if(n<4)throw new d.j4("Data not enough when parse LongString");var i=new DataView(e,t,n).getUint32(0,!u);return{data:i>0?c(new Uint8Array(e,t+4,i)):"",size:4+i}},e.parseDate=function(e,t,n){if(n<10)throw new d.j4("Data size invalid when parse Date");var i=new DataView(e,t,n),o=i.getFloat64(0,!u),a=i.getInt16(8,!u);return{data:new Date(o+=60*a*1e3),size:10}},e.parseValue=function(t,n,i){if(i<1)throw new d.j4("Data not enough when parse Value");var a,r=new DataView(t,n,i),s=1,c=r.getUint8(0),l=!1;try{switch(c){case 0:a=r.getFloat64(1,!u),s+=8;break;case 1:a=!!r.getUint8(1),s+=1;break;case 2:var m=e.parseString(t,n+1,i-1);a=m.data,s+=m.size;break;case 3:a={};var h=0;for(9==(16777215&r.getUint32(i-4,!u))&&(h=3);s<i-4;){var p=e.parseObject(t,n+s,i-s-h);if(p.objectEnd)break;a[p.data.name]=p.data.value,s+=p.size}s<=i-3&&9==(16777215&r.getUint32(s-1,!u))&&(s+=3);break;case 8:for(a={},s+=4,h=0,9==(16777215&r.getUint32(i-4,!u))&&(h=3);s<i-8;){var g=e.parseVariable(t,n+s,i-s-h);if(g.objectEnd)break;a[g.data.name]=g.data.value,s+=g.size}s<=i-3&&9==(16777215&r.getUint32(s-1,!u))&&(s+=3);break;case 9:a=void 0,s=1,l=!0;break;case 10:a=[];var f=r.getUint32(1,!u);s+=4;for(var v=0;v<f;v++){var y=e.parseValue(t,n+s,i-s);a.push(y.data),s+=y.size}break;case 11:var S=e.parseDate(t,n+1,i-1);a=S.data,s+=S.size;break;case 12:var _=e.parseString(t,n+1,i-1);a=_.data,s+=_.size;break;default:s=i,o.A.w("AMF","Unsupported AMF value type "+c.toString())}}catch(e){o.A.e("AMF",e.toString())}return{data:a,size:s,objectEnd:l}},e}(),h=function(){function e(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}return e.prototype.destroy=function(){this._buffer=null},e.prototype._fillCurrentWord=function(){var e,t=this._total_bytes-this._buffer_index;if(t<=0)throw new d.j4("ExpGolomb: _fillCurrentWord() but no bytes available");var n=Math.min(4,t),i=new Uint8Array(4);i.set(null===(e=this._buffer)||void 0===e?void 0:e.subarray(this._buffer_index,this._buffer_index+n)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=n,this._current_word_bits_left=8*n},e.prototype.readBits=function(e){if(e>32)throw new d.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var i=e-this._current_word_bits_left;this._fillCurrentWord();var o=Math.min(i,this._current_word_bits_left),a=this._current_word>>>32-o;return this._current_word<<=o,this._current_word_bits_left-=o,n<<o|a},e.prototype.readBool=function(){return 1===this.readBits(1)},e.prototype.readByte=function(){return this.readBits(8)},e.prototype._skipLeadingZero=function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(this._current_word&2147483648>>>e)return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}(),p=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,n=t.byteLength,i=new Uint8Array(n),o=0,a=0;a<n;a++)a>=2&&3===t[a]&&0===t[a-1]&&0===t[a-2]||(i[o]=t[a],o++);return new Uint8Array(i.buffer,0,o)},e.parseSPS=function(t){for(var n=t.subarray(1,4),i="avc1.",o=0;o<3;o++){var a=n[o].toString(16);a.length<2&&(a="0"+a),i+=a}var r=e._ebsp2rbsp(t),s=new h(r);s.readByte();var c=s.readByte();s.readByte();var l=s.readByte();s.readUEG();var d=e.getProfileString(c),u=e.getLevelString(l),m=1,p=420,g=8,f=8;if((100===c||110===c||122===c||244===c||44===c||83===c||86===c||118===c||128===c||138===c||144===c)&&(3===(m=s.readUEG())&&s.readBits(1),m<=3&&(p=[0,420,422,444][m]),g=s.readUEG()+8,f=s.readUEG()+8,s.readBits(1),s.readBool()))for(var v=3!==m?8:12,y=0;y<v;y++)s.readBool()&&(y<6?e._skipScalingList(s,16):e._skipScalingList(s,64));s.readUEG();var S=s.readUEG();if(0===S)s.readUEG();else if(1===S){s.readBits(1),s.readSEG(),s.readSEG();var _=s.readUEG();for(y=0;y<_;y++)s.readSEG()}var b=s.readUEG();s.readBits(1);var w=s.readUEG(),T=s.readUEG(),E=s.readBits(1);0===E&&s.readBits(1),s.readBits(1);var P=0,k=0,C=0,I=0;s.readBool()&&(P=s.readUEG(),k=s.readUEG(),C=s.readUEG(),I=s.readUEG());var x=1,j=1,A=0,D=!0,R=0,L=0;if(s.readBool()){if(s.readBool()){var B=s.readByte();B>0&&B<16?(x=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][B-1],j=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][B-1]):255===B&&(x=s.readByte()<<8|s.readByte(),j=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var M=s.readBits(32),O=s.readBits(32);D=s.readBool(),A=(R=O)/(L=2*M)}}var z=1;1===x&&1===j||(z=x/j);var N=0,F=0;0===m?(N=1,F=2-E):(N=3===m?1:2,F=(1===m?2:1)*(2-E));var U=16*(w+1),V=16*(T+1)*(2-E);U-=(P+k)*N,V-=(C+I)*F;var H=Math.ceil(U*z);return s.destroy(),s=null,{codec_mimetype:i,profile_idc:c,level_idc:l,profile_string:d,level_string:u,chroma_format_idc:m,bit_depth:g,bit_depth_luma:g,bit_depth_chroma:f,ref_frames:b,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:D,fps:A,fps_den:L,fps_num:R},sar_ratio:{width:x,height:j},codec_size:{width:U,height:V},present_size:{width:H,height:V}}},e._skipScalingList=function(e,t){for(var n=8,i=8,o=0;o<t;o++)0!==i&&(i=(n+e.readSEG()+256)%256),n=0===i?n:i},e.getProfileString=function(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"}},e.getLevelString=function(e){return(e/10).toFixed(1)},e.getChromaFormatString=function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},e}();var g=n(465);const f=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,n=t.byteLength,i=new Uint8Array(n),o=0,a=0;a<n;a++)a>=2&&3===t[a]&&0===t[a-1]&&0===t[a-2]||(i[o]=t[a],o++);return new Uint8Array(i.buffer,0,o)},e.parseVPS=function(t){var n=e._ebsp2rbsp(t),i=new h(n);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()}},e.parseSPS=function(t){var n=e._ebsp2rbsp(t),i=new h(n);i.readByte(),i.readByte();for(var o=0,a=0,r=0,s=0,c=(i.readBits(4),i.readBits(3)),l=(i.readBool(),i.readBits(2)),d=i.readBool(),u=i.readBits(5),m=i.readByte(),p=i.readByte(),g=i.readByte(),f=i.readByte(),v=i.readByte(),y=i.readByte(),S=i.readByte(),_=i.readByte(),b=i.readByte(),w=i.readByte(),T=i.readByte(),E=[],P=[],k=0;k<c;k++)E.push(i.readBool()),P.push(i.readBool());if(c>0)for(k=c;k<8;k++)i.readBits(2);for(k=0;k<c;k++)E[k]&&(i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte()),P[k]&&i.readByte();i.readUEG();var C=i.readUEG();3===C&&i.readBits(1);var I=i.readUEG(),x=i.readUEG();i.readBool()&&(o+=i.readUEG(),a+=i.readUEG(),r+=i.readUEG(),s+=i.readUEG());var j=i.readUEG(),A=i.readUEG(),D=i.readUEG();for(k=i.readBool()?0:c;k<=c;k++)i.readUEG(),i.readUEG(),i.readUEG();if(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readBool()&&i.readBool())for(var R=0;R<4;R++)for(var L=0;L<(3===R?2:6);L++)if(i.readBool()){var B=Math.min(64,1<<4+(R<<1));for(R>1&&i.readSEG(),k=0;k<B;k++)i.readSEG()}else i.readUEG();i.readBool(),i.readBool(),i.readBool()&&(i.readByte(),i.readUEG(),i.readUEG(),i.readBool());var M=i.readUEG(),O=0;for(k=0;k<M;k++){var z=!1;if(0!==k&&(z=i.readBool()),z){k===M&&i.readUEG(),i.readBool(),i.readUEG();for(var N=0,F=0;F<=O;F++){var U=i.readBool(),V=!1;U||(V=i.readBool()),(U||V)&&N++}O=N}else{var H=i.readUEG(),G=i.readUEG();for(O=H+G,F=0;F<H;F++)i.readUEG(),i.readBool();for(F=0;F<G;F++)i.readUEG(),i.readBool()}}if(i.readBool()){var Z=i.readUEG();for(k=0;k<Z;k++){for(F=0;F<D+4;F++)i.readBits(1);i.readBits(1)}}var W=0,q=1,K=1,J=!1,Y=1,X=1;if(i.readBool(),i.readBool(),i.readBool()){if(i.readBool()){var Q=i.readByte();Q>0&&Q<=16?(q=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Q-1],K=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Q-1]):255===Q&&(q=i.readBits(16),K=i.readBits(16))}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(3),i.readBool(),i.readBool()&&(i.readByte(),i.readByte(),i.readByte())),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool(),i.readBool(),i.readBool(),i.readBool()&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(Y=i.readBits(32),X=i.readBits(32),i.readBool()&&i.readUEG(),i.readBool())){var $,ee,te=!1;for($=i.readBool(),ee=i.readBool(),($||ee)&&((te=i.readBool())&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),te&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5)),k=0;k<=c;k++){var ne=i.readBool();J=ne;var ie=!1,oe=1;ne||(ie=i.readBool());var ae=!1;if(ie?i.readSEG():ae=i.readBool(),ae||(oe=i.readUEG()+1),$)for(F=0;F<oe;F++)i.readUEG(),i.readUEG(),te&&(i.readUEG(),i.readUEG());if(ee)for(F=0;F<oe;F++)i.readUEG(),i.readUEG(),te&&(i.readUEG(),i.readUEG())}}i.readBool()&&(i.readBool(),i.readBool(),i.readBool(),W=i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG())}i.readBool();var re="hvc1.".concat(u,".1.L").concat(T,".B0"),se=I-(o+a)*(1===C||2===C?2:1),ce=x-(r+s)*(1===C?2:1),le=1;return 1!==q&&1!==K&&(le=q/K),i.destroy(),i=null,{codec_mimetype:re,level_string:e.getLevelString(T),profile_idc:u,bit_depth:j+8,ref_frames:1,chroma_format:C,chroma_format_string:e.getChromaFormatString(C),general_level_idc:T,general_profile_space:l,general_tier_flag:d,general_profile_idc:u,general_profile_compatibility_flags_1:m,general_profile_compatibility_flags_2:p,general_profile_compatibility_flags_3:g,general_profile_compatibility_flags_4:f,general_constraint_indicator_flags_1:v,general_constraint_indicator_flags_2:y,general_constraint_indicator_flags_3:S,general_constraint_indicator_flags_4:_,general_constraint_indicator_flags_5:b,general_constraint_indicator_flags_6:w,min_spatial_segmentation_idc:W,constant_frame_rate:0,chroma_format_idc:C,bit_depth_luma_minus8:j,bit_depth_chroma_minus8:A,frame_rate:{fixed:J,fps:X/Y,fps_den:Y,fps_num:X},sar_ratio:{width:q,height:K},codec_size:{width:se,height:ce},present_size:{width:se*le,height:ce}}},e.parsePPS=function(t){var n=e._ebsp2rbsp(t),i=new h(n);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();var o=i.readBool(),a=i.readBool(),r=1;return a&&o?r=0:a?r=3:o&&(r=2),{parallelismType:r}},e.getChromaFormatString=function(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"}},e.getProfileString=function(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"}},e.getLevelString=function(e){return(e/30).toFixed(1)},e}();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(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const _=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))},b=function(){function e(){}return e.parseOBUs=function(t){for(var n=null,i=0;i<t.byteLength;){t[i];var o=(120&t[i])>>3,a=!!(4&t[i]),r=!!(2&t[i]);t[i],i+=1,a&&(i+=1);var s=Number.POSITIVE_INFINITY;if(r){s=0;for(var c=0;s|=(127&t[i])<<7*c,128&t[i+=1];c++);}1===o&&(n=e.parseSeuqneceHeader(t.subarray(i,i+s))),i+=s}return n},e.parseSeuqneceHeader=function(t){var n=new h(t),i=n.readBits(3),o=(n.readBool(),n.readBool()),a=!0,r=0,s=0,c=[];if(o)c.push({operating_point_idc:0,level:n.readBits(5),tier:0});else{if(n.readBool()){var l=n.readBits(32),d=n.readBits(32),u=n.readBool();if(u){for(var m=0;0===n.readBits(1);)m+=1;m>=32||n.readBits(m)}r=d,s=l,a=u,n.readBool()&&(n.readBits(5),n.readBits(32),n.readBits(5),n.readBits(5))}for(var p=n.readBool(),g=n.readBits(5),f=0;f<=g;f++){var v=n.readBits(12),y=n.readBits(5),S=y>7?n.readBits(1):0;c.push({operating_point_idc:v,level:y,tier:S}),p&&n.readBool()&&n.readBits(4)}}var _=c[0],b=_.level,w=_.tier,T=n.readBits(4),E=n.readBits(4),P=n.readBits(T+1)+1,k=n.readBits(E+1)+1,C=!1;o||(C=n.readBool()),C&&(n.readBits(4),n.readBits(4)),n.readBool(),n.readBool(),n.readBool();var I=!1;o||(n.readBool(),n.readBool(),n.readBool(),n.readBool(),(I=n.readBool())&&(n.readBool(),n.readBool()),(n.readBool()||n.readBits(1))&&(n.readBool()||n.readBits(1)),I&&n.readBits(3)),n.readBool(),n.readBool(),n.readBool();var x=n.readBool(),j=8;j=2===i&&x?n.readBool()?12:10:x?10:8;var A=!1;1!==i&&(A=n.readBool()),n.readBool()&&(n.readBits(8),n.readBits(8),n.readBits(8));var D=1,R=1;return A?(n.readBits(1),D=1,R=1):(n.readBits(1),0===i?(D=1,R=1):1===i?(D=0,R=0):12===j?n.readBits(1)&&n.readBits(1):(D=1,R=0),D&&R&&n.readBits(2),n.readBits(1)),n.readBool(),n.destroy(),n=null,{codec_mimetype:"av01.".concat(i,".").concat(e.getLevelString(b,w),".").concat(j.toString(10).padStart(2,"0")),level:b,tier:w,level_string:e.getLevelString(b,w),profile_idc:i,profile_string:"".concat(i),bit_depth:j,ref_frames:1,chroma_format:e.getChromaFormat(A,D,R),chroma_format_string:e.getChromaFormatString(A,D,R),frame_rate:{fixed:a,fps:r/s,fps_den:s,fps_num:r},sar_ratio:{width:1,height:1},codec_size:{width:P,height:k},present_size:{width:1*P,height:k}}},e.getLevelString=function(e,t){return"".concat(e.toString(10).padStart(2,"0")).concat(0===t?"M":"H")},e.getChromaFormat=function(e,t,n){return e?0:0===t&&0===n?3:1===t&&0===n?2:1===t&&1===n?1:Number.NaN},e.getChromaFormatString=function(e,t,n){return e?"4:0:0":0===t&&0===n?"4:4:4":1===t&&0===n?"4:2:2":1===t&&1===n?"4:2:0":"Unknown"},e}();var w=function(){function e(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 r.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};var n={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return n;var i,o=(4&t[4])>>>2!=0,a=!!(1&t[4]),r=(i=t)[5]<<24|i[6]<<16|i[7]<<8|i[8];return r<9?n:{match:!0,consumed:r,dataOffset:r,hasAudioTrack:o,hasVideoTrack:a}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo&&(this._mediaInfo.duration=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo&&(this._mediaInfo.hasAudio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo&&(this._mediaInfo.hasVideo=e)},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new r.A},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,n){var i,a;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new d.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var r=0,s=this._littleEndian;if(0===n){if(!(t.byteLength>13))return 0;var c=e.probe(t);r=(null==c?void 0:c.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,n+r!==this._dataOffset&&o.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(l=new DataView(t,r)).getUint32(0,!s)&&o.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),r+=4);r<t.byteLength;){this._dispatch=!0;var l=new DataView(t,r);if(r+11+4>t.byteLength)break;var u=l.getUint8(0),m=16777215&l.getUint32(0,!s);if(r+11+m+4>t.byteLength)break;if(8===u||9===u||18===u){var h=l.getUint8(4),p=l.getUint8(5),g=l.getUint8(6)|p<<8|h<<16|l.getUint8(7)<<24;16777215&l.getUint32(7,!s)&&o.A.w(this.TAG,"Meet tag which has StreamID != 0!");var f=r+11;switch(u){case 8:this._parseAudioData(t,f,m,g);break;case 9:this._parseVideoData(t,f,m,g,n+r);break;case 18:this._parseScriptData(t,f,m)}var v=l.getUint32(11+m,!s);v!==11+m&&o.A.w(this.TAG,"Invalid PrevTagSize ".concat(v)),r+=11+m+4}else o.A.w(this.TAG,"Unsupported tag type ".concat(u,", skipped")),r+=11+m+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(i=this._audioTrack)||void 0===i?void 0:i.length)||(null===(a=this._videoTrack)||void 0===a?void 0:a.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),r},e.prototype._parseScriptData=function(e,t,n){var i,a,r,s=m.parseScriptData(e,t,n);if(s.hasOwnProperty("onMetaData")){if(null==s.onMetaData||"object"!=typeof s.onMetaData)return void o.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&o.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=s;var c=null===(i=this._metadata)||void 0===i?void 0:i.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},c)),"boolean"==typeof(null==c?void 0:c.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=c.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==c?void 0:c.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=c.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==c?void 0:c.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=c.audiodatarate),"number"==typeof(null==c?void 0:c.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=c.videodatarate),"number"==typeof(null==c?void 0:c.width)&&this._mediaInfo&&(this._mediaInfo.width=c.width),"number"==typeof(null==c?void 0:c.height)&&this._mediaInfo&&(this._mediaInfo.height=c.height),"number"==typeof(null==c?void 0:c.duration)){if(!this._durationOverrided){var l=Math.floor(c.duration*this._timescale);this._duration=l,this._mediaInfo&&(this._mediaInfo.duration=l)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==c?void 0:c.framerate)){var d=Math.floor(1e3*c.framerate);if(d>0){var u=d/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=u,this._referenceFrameRate.fps_num=d,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=u)}}if("object"==typeof(null==c?void 0:c.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var h=c.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(h)),c.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=c),o.A.v(this.TAG,"Parsed onMetaData"),(null===(a=this._mediaInfo)||void 0===a?void 0:a.isComplete())&&(null===(r=this._onMediaInfo)||void 0===r||r.call(this,this._mediaInfo))}Object.keys(s).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},s))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],n=[],i=1;i<e.times.length;i++){var o=this._timestampBase+Math.floor(1e3*e.times[i]);t.push(o),n.push(e.filepositions[i])}return{times:t,filepositions:n}},e.prototype._parseAudioData=function(e,t,n,i){var a,r,s,c,l,d,u,m,h,p;if(n<=1)o.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var f=new DataView(e,t,n).getUint8(0),v=f>>>4;if(2===v||10===v){var y=0,S=(12&f)>>>2;if(S>=0&&S<=4){y=this._flvSoundRateTable[S];var b=1&f,w=this._audioMetadata,T=this._audioTrack;if(w||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(w=this._audioMetadata={}).type="audio",w.id=null==T?void 0:T.id,w.timescale=this._timescale,w.duration=this._duration,w.audioSampleRate=y,w.channelCount=0===b?1:2),10===v){var E=this._parseAACAudioData(e,t+1,n-1);if(void 0===E)return;if(0===(null==E?void 0:E.packetType)){if(null==w?void 0:w.config){if(_(E.data.config,null==w?void 0:w.config))return;o.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var P=E.data;w.audioSampleRate=null==P?void 0:P.samplingRate,w.channelCount=null==P?void 0:P.channelCount,w.codec=null==P?void 0:P.codec,w.originalCodec=null==P?void 0:P.originalCodec,w.config=null==P?void 0:P.config,w.refSampleDuration=1024/w.audioSampleRate*w.timescale,o.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(c=this._videoTrack)||void 0===c?void 0:c.length))&&(null===(l=this._onDataAvailable)||void 0===l||l.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"audio",w),(I=this._mediaInfo).audioCodec=w.originalCodec||"",I.audioSampleRate=w.audioSampleRate,I.audioChannelCount=w.channelCount,I.hasVideo?null!=I.videoCodec&&(I.mimeType='video/x-flv; codecs="'+I.videoCodec+","+I.audioCodec+'"'):I.mimeType='video/x-flv; codecs="'+I.audioCodec+'"',(null==I?void 0:I.isComplete())&&(null===(u=this._onMediaInfo)||void 0===u||u.call(this,I))}else if(1===E.packetType){var k=this._timestampBase+i,C={unit:E.data,length:E.data.byteLength,dts:k,pts:k};T&&(null==T||T.samples.push(C),T.length+=(null===(m=null==E?void 0:E.data)||void 0===m?void 0:m.length)||0)}else o.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(E.packetType))}else if(2===v){if(!w.codec){var I;if(void 0===(P=this._parseMP3AudioData(e,t+1,n-1,!0)))return;w.audioSampleRate=P.samplingRate,w.channelCount=P.channelCount,w.codec=P.codec,w.originalCodec=P.originalCodec,w.refSampleDuration=1152/w.audioSampleRate*w.timescale,o.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(h=this._onTrackMetadata)||void 0===h||h.call(this,"audio",w),(I=this._mediaInfo).audioCodec=w.codec,I.audioSampleRate=w.audioSampleRate,I.audioChannelCount=w.channelCount,I.audioDataRate=P.bitRate,(null==I?void 0:I.hasVideo)?null!=I.videoCodec&&(I.mimeType='video/x-flv; codecs="'+I.videoCodec+","+I.audioCodec+'"'):I.mimeType='video/x-flv; codecs="'+I.audioCodec+'"',I.isComplete()&&(null===(p=this._onMediaInfo)||void 0===p||p.call(this,I))}var x=this._parseMP3AudioData(e,t+1,n-1,!1);if(void 0===x)return;k=this._timestampBase+i;var j={unit:x,length:x.byteLength,dts:k,pts:k};null==T||T.samples.push(j),T&&(T.length+=x.length)}}else null===(r=this._onError)||void 0===r||r.call(this,g.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+S)}else null===(a=this._onError)||void 0===a||a.call(this,g.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+v)}},e.prototype._parseAACAudioData=function(e,t,n){if(!(n<=1)){var i={},a=new Uint8Array(e,t,n);return i.packetType=a[0],0===a[0]?i.data=this._parseAACAudioSpecificConfig(e,t+1,n-1):i.data=a.subarray(1),i}o.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,n){var i,o,a,r,s=new Uint8Array(e,t,n),c=null,l=0,d=null;if(l=a=s[0]>>>3,(r=(7&s[0])<<1|s[1]>>>7)<0||r>=this._mpegSamplingRates.length)null===(i=this._onError)||void 0===i||i.call(this,g.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var u=this._mpegSamplingRates[r],m=(120&s[1])>>>3;if(!(m<0||m>=8)){5===l&&(d=(7&s[1])<<1|s[2]>>>7,s[2]);var h=self.navigator.userAgent.toLowerCase();return h.includes("firefox")?r>=6?(l=5,c=new Array(4),d=r-3):(l=2,c=new Array(2),d=r):h.includes("android")?(l=2,c=new Array(2),d=r):(l=5,d=r,c=new Array(4),r>=6?d=r-3:1===m&&(l=2,c=new Array(2),d=r)),c[0]=l<<3,c[0]|=(15&r)>>>1,c[1]=(15&r)<<7,c[1]|=(15&m)<<3,5===l&&(c[1]|=(15&d)>>>1,c[2]=(1&d)<<7,c[2]|=8,c[3]=0),{config:c,samplingRate:u,channelCount:m,codec:"mp4a.40."+l,originalCodec:"mp4a.40."+a}}null===(o=this._onError)||void 0===o||o.call(this,g.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,n,i){if(!(n<4)){this._littleEndian;var a,r=new Uint8Array(e,t,n);if(i){if(255!==r[0])return;var s=r[1]>>>3&3,c=(6&r[1])>>1,l=(240&r[2])>>>4,d=(12&r[2])>>>2,u=3&~(r[3]>>>6)?2:1,m=0,h=0;switch(s){case 0:m=this._mpegAudioV25SampleRateTable[d];break;case 2:m=this._mpegAudioV20SampleRateTable[d];break;case 3:m=this._mpegAudioV10SampleRateTable[d]}switch(c){case 1:l<this._mpegAudioL3BitRateTable.length&&(h=this._mpegAudioL3BitRateTable[l]);break;case 2:l<this._mpegAudioL2BitRateTable.length&&(h=this._mpegAudioL2BitRateTable[l]);break;case 3:l<this._mpegAudioL1BitRateTable.length&&(h=this._mpegAudioL1BitRateTable[l])}a={bitRate:h,samplingRate:m,channelCount:u,codec:"mp3",originalCodec:"mp3"}}else a=r;return a}o.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},e.prototype._parseVideoData=function(e,t,n,i,a){var r,s;if(n<=1)o.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!this._hasVideoFlagOverrided||!1!==this._hasVideo){var c=new Uint8Array(e,t,n)[0],l=(112&c)>>>4;if(128&c){var d=15&c,u=String.fromCharCode.apply(String,function(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}([],function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}(new Uint8Array(e,t,n).slice(1,5)),!1));"hvc1"===u?this._parseEnhancedHEVCVideoPacket(e,t+5,n-5,i,a,l,d):"av01"===u?this._parseEnhancedAV1VideoPacket(e,t+5,n-5,i,a,l,d):null===(s=this._onError)||void 0===s||s.call(this,g.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(u))}else{var m=15&c;7===m?this._parseAVCVideoPacket(e,t+1,n-1,i,a,l):12===m?this._parseHEVCVideoPacket(e,t+1,n-1,i,a,l):null===(r=this._onError)||void 0===r||r.call(this,g.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(m))}}},e.prototype._parseAVCVideoPacket=function(e,t,n,i,a,r){var s;if(n<4)o.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var c=this._littleEndian,l=new DataView(e,t,n),d=l.getUint8(0),u=(16777215&l.getUint32(0,!c))<<8>>8;0===d?this._parseAVCDecoderConfigurationRecord(e,t+4,n-4):1===d?this._parseAVCVideoData(e,t+4,n-4,i,a,r,u):2===d||null===(s=this._onError)||void 0===s||s.call(this,g.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(d))}},e.prototype._parseHEVCVideoPacket=function(e,t,n,i,a,r){var s;if(n<4)o.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var c=this._littleEndian,l=new DataView(e,t,n),d=l.getUint8(0),u=(16777215&l.getUint32(0,!c))<<8>>8;0===d?this._parseHEVCDecoderConfigurationRecord(e,t+4,n-4):1===d?this._parseHEVCVideoData(e,t+4,n-4,i,a,r,u):2===d||null===(s=this._onError)||void 0===s||s.call(this,g.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(d))}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,n,i,o,a,r){var s,c=this._littleEndian,l=new DataView(e,t,n);if(0===r)this._parseHEVCDecoderConfigurationRecord(e,t,n);else if(1===r){var d=(4294967040&l.getUint32(0,!c))>>8;this._parseHEVCVideoData(e,t+3,n-3,i,o,a,d)}else 3===r?this._parseHEVCVideoData(e,t,n,i,o,a,0):2===r||null===(s=this._onError)||void 0===s||s.call(this,g.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(r))},e.prototype._parseEnhancedAV1VideoPacket=function(e,t,n,i,o,a,r){var s,c;this._littleEndian,0===r?this._parseAV1CodecConfigurationRecord(e,t,n):1===r?this._parseAV1VideoData(e,t,n,i,o,a,0):5===r?null===(s=this._onError)||void 0===s||s.call(this,g.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(r)):2===r||null===(c=this._onError)||void 0===c||c.call(this,g.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(r))},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,n){var i,a,r,s,c,l,d,u,m,h,f;if(n<7)o.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var v=this._videoMetadata,y=this._videoTrack,S=this._littleEndian,b=new DataView(e,t,n);if(v){if(void 0!==v.avcc){var w=new Uint8Array(e,t,n);if(_(w,v.avcc))return;o.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(v=this._videoMetadata={}).type="video",v.id=null==y?void 0:y.id,v.timescale=this._timescale,v.duration=this._duration;var T=b.getUint8(0),E=b.getUint8(1);if(b.getUint8(2),b.getUint8(3),1===T&&0!==E)if(this._naluLengthSize=1+(3&b.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var P=31&b.getUint8(5);if(0!==P){P>1&&o.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(P));for(var k=6,C=0;C<P;C++){var I=b.getUint16(k,!S);if(k+=2,0!==I){var x=new Uint8Array(e,t+k,I);k+=I;var j=p.parseSPS(x);if(0===C){v.codecWidth=j.codec_size.width,v.codecHeight=j.codec_size.height,v.presentWidth=j.present_size.width,v.presentHeight=j.present_size.height,v.profile=j.profile_string,v.level=j.level_string,v.bitDepth=j.bit_depth,v.chromaFormat=j.chroma_format,v.sarRatio=j.sar_ratio,v.frameRate=j.frame_rate,j.frame_rate.fixed&&0!==j.frame_rate.fps_num&&0!==j.frame_rate.fps_den||(v.frameRate=this._referenceFrameRate);var A=null===(s=v.frameRate)||void 0===s?void 0:s.fps_den,D=null===(c=v.frameRate)||void 0===c?void 0:c.fps_num;v.refSampleDuration=v.timescale*(A/D);for(var R=x.subarray(1,4),L="avc1.",B=0;B<3;B++){var M=R[B].toString(16);M.length<2&&(M="0"+M),L+=M}v.codec=L;var O=this._mediaInfo;O.width=v.codecWidth,O.height=v.codecHeight,O.fps=v.frameRate.fps,O.profile=v.profile,O.level=v.level,O.refFrames=j.ref_frames,O.chromaFormat=j.chroma_format_string,O.sarNum=v.sarRatio.width,O.sarDen=v.sarRatio.height,O.videoCodec=L,O.hasAudio?null!=O.audioCodec&&(O.mimeType='video/x-flv; codecs="'+O.videoCodec+","+O.audioCodec+'"'):O.mimeType='video/x-flv; codecs="'+O.videoCodec+'"',O.isComplete()&&(null===(l=this._onMediaInfo)||void 0===l||l.call(this,O))}}}var z=b.getUint8(k);if(0!==z){for(z>1&&o.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(z)),k++,C=0;C<z;C++)I=b.getUint16(k,!S),k+=2,0!==I&&(k+=I);v.avcc=new Uint8Array(n),v.avcc.set(new Uint8Array(e,t,n),0),o.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(u=this._audioTrack)||void 0===u?void 0:u.length)||(null===(m=this._videoTrack)||void 0===m?void 0:m.length))&&(null===(h=this._onDataAvailable)||void 0===h||h.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(f=this._onTrackMetadata)||void 0===f||f.call(this,"video",v)}else null===(d=this._onError)||void 0===d||d.call(this,g.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else null===(r=this._onError)||void 0===r||r.call(this,g.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else null===(a=this._onError)||void 0===a||a.call(this,g.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(i=this._onError)||void 0===i||i.call(this,g.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},e.prototype._parseHEVCDecoderConfigurationRecord=function(e,t,n){var i,a,r,s,c,l,d;if(n<22)o.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var u=this._videoMetadata,m=this._videoTrack,h=this._littleEndian,p=new DataView(e,t,n);if(u){if(void 0!==u.hvcc){var v=new Uint8Array(e,t,n);if(_(v,u.hvcc))return;o.A.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={}).type="video",u.id=null==m?void 0:m.id,u.timescale=this._timescale,u.duration=this._duration;var y=p.getUint8(0),S=31&p.getUint8(1);if(1===y&&0!==S)if(this._naluLengthSize=1+(3&p.getUint8(21)),3===this._naluLengthSize||4===this._naluLengthSize){for(var b=p.getUint8(22),w=0,T=23;w<b;w++){var E=63&p.getUint8(T+0),P=p.getUint16(T+1,!h);T+=3;for(var k=0;k<P;k++){var C=p.getUint16(T+0,!h);if(0===k)if(33===E){T+=2;var I=new Uint8Array(e,t+T,C),x=f.parseSPS(I);u.codecWidth=x.codec_size.width,u.codecHeight=x.codec_size.height,u.presentWidth=x.present_size.width,u.presentHeight=x.present_size.height,u.profile=null==x?void 0:x.profile_string,u.level=x.level_string,u.bitDepth=x.bit_depth,u.chromaFormat=x.chroma_format,u.sarRatio=x.sar_ratio,u.frameRate=x.frame_rate,x.frame_rate.fixed&&0!==x.frame_rate.fps_num&&0!==x.frame_rate.fps_den||(u.frameRate=this._referenceFrameRate);var j=u.frameRate.fps_den,A=u.frameRate.fps_num;u.refSampleDuration=u.timescale*(j/A),u.codec=x.codec_mimetype;var D=this._mediaInfo;D.width=u.codecWidth,D.height=u.codecHeight,D.fps=u.frameRate.fps,D.profile=u.profile,D.level=u.level,D.refFrames=x.ref_frames,D.chromaFormat=x.chroma_format_string,D.sarNum=u.sarRatio.width,D.sarDen=u.sarRatio.height,D.videoCodec=x.codec_mimetype,D.hasAudio?null!=D.audioCodec&&(D.mimeType='video/x-flv; codecs="'+D.videoCodec+","+D.audioCodec+'"'):D.mimeType='video/x-flv; codecs="'+D.videoCodec+'"',D.isComplete()&&(null===(r=this._onMediaInfo)||void 0===r||r.call(this,D)),T+=C}else T+=2+C;else T+=2+C}}u.hvcc=new Uint8Array(n),u.hvcc.set(new Uint8Array(e,t,n),0),o.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(c=this._videoTrack)||void 0===c?void 0:c.length))&&(null===(l=this._onDataAvailable)||void 0===l||l.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"video",u)}else null===(a=this._onError)||void 0===a||a.call(this,g.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(i=this._onError)||void 0===i||i.call(this,g.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord")}},e.prototype._parseAV1CodecConfigurationRecord=function(e,t,n){var i,a,r,s,c,l,d,u,m,h,p;if(n<4)o.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var f=this._videoMetadata,v=this._videoTrack,y=(this._littleEndian,new DataView(e,t,n));f?void 0!==f.av1c&&o.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(f=this._videoMetadata={}).type="video",f.id=null==v?void 0:v.id,f.timescale=this._timescale,f.duration=this._duration);var S=127&y.getUint8(0);if(y.getUint8(1),y.getUint8(1),y.getUint8(2),1===S){var _=b.parseOBUs(new Uint8Array(e,t+4,n-4));if(null!=_){f.codecWidth=null===(r=null==_?void 0:_.codec_size)||void 0===r?void 0:r.width,f.codecHeight=null===(s=null==_?void 0:_.codec_size)||void 0===s?void 0:s.height,f.presentWidth=null===(c=null==_?void 0:_.present_size)||void 0===c?void 0:c.width,f.presentHeight=null===(l=null==_?void 0:_.present_size)||void 0===l?void 0:l.height,f.profile=_.profile_string,f.level=_.level_string,f.bitDepth=_.bit_depth,f.chromaFormat=_.chroma_format,f.sarRatio=_.sar_ratio,f.frameRate=_.frame_rate,_.frame_rate.fixed&&0!==_.frame_rate.fps_num&&0!==_.frame_rate.fps_den||(f.frameRate=this._referenceFrameRate);var w=f.frameRate.fps_den,T=f.frameRate.fps_num;f.refSampleDuration=f.timescale*(w/T),f.codec=_.codec_mimetype;var E=this._mediaInfo;E.width=f.codecWidth,E.height=f.codecHeight,E.fps=f.frameRate.fps,E.profile=f.profile,E.level=f.level,E.refFrames=_.ref_frames,E.chromaFormat=_.chroma_format_string,E.sarNum=f.sarRatio.width,E.sarDen=f.sarRatio.height,E.videoCodec=_.codec_mimetype,E.hasAudio?null!=E.audioCodec&&(E.mimeType='video/x-flv; codecs="'+E.videoCodec+","+E.audioCodec+'"'):E.mimeType='video/x-flv; codecs="'+E.videoCodec+'"',E.isComplete()&&(null===(d=this._onMediaInfo)||void 0===d||d.call(this,E)),f.av1c=new Uint8Array(n),f.av1c.set(new Uint8Array(e,t,n),0),o.A.v(this.TAG,"Parsed AV1CodecConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(u=this._audioTrack)||void 0===u?void 0:u.length)||(null===(m=this._videoTrack)||void 0===m?void 0:m.length))&&(null===(h=this._onDataAvailable)||void 0===h||h.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(p=this._onTrackMetadata)||void 0===p||p.call(this,"video",f)}else null===(a=this._onError)||void 0===a||a.call(this,g.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else null===(i=this._onError)||void 0===i||i.call(this,g.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},e.prototype._parseAVCVideoData=function(e,t,n,i,a,r,s){for(var c=this._littleEndian,l=new DataView(e,t,n),d=[],u=0,m=0,h=this._naluLengthSize,p=this._timestampBase+i,g=1===r;m<n;){if(m+4>=n){o.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(m,", dataSize = ").concat(n));break}var f=l.getUint32(m,!c);if(3===h&&(f>>>=8),f>n-h)return void o.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var v=31&l.getUint8(m+h);5===v&&(g=!0);var y=new Uint8Array(e,t+m,h+f),S={type:v,data:y};d.push(S),u+=y.byteLength,m+=h+f}if(d.length){var _=this._videoTrack,b={units:d,length:u,isKeyframe:g,dts:p,cts:s,pts:p+s};g&&(b.fileposition=a),_&&(_.samples.push(b),_.length+=u)}},e.prototype._parseHEVCVideoData=function(e,t,n,i,a,r,s){for(var c=this._littleEndian,l=new DataView(e,t,n),d=[],u=0,m=0,h=this._naluLengthSize,p=this._timestampBase+i,g=1===r;m<n;){if(m+4>=n){o.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(m,", dataSize = ").concat(n));break}var f=l.getUint32(m,!c);if(3===h&&(f>>>=8),f>n-h)return void o.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var v=31&l.getUint8(m+h);19!==v&&20!==v||(g=!0);var y=new Uint8Array(e,t+m,h+f),S={type:v,data:y};d.push(S),u+=y.byteLength,m+=h+f}if(d.length){var _=this._videoTrack,b={units:d,length:u,isKeyframe:g,dts:p,cts:s,pts:p+s};g&&(b.fileposition=a),_&&(null==_||_.samples.push(b),_.length+=u)}},e.prototype._parseAV1VideoData=function(e,t,n,i,o,a,r){this._littleEndian;var s,c=[],l=this._timestampBase+i,d=1===a;if(s=n,c.push({unitType:0,data:new Uint8Array(e,t+0,n)}),c.length){var u=this._videoTrack,m={units:c,length:s,isKeyframe:d,dts:l,cts:r,pts:l+r};d&&(m.fileposition=o),u&&(null==u||u.samples.push(m),u.length+=s)}},e}();const T=w,E=function(){function e(){}return e.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},e}();var P,k=function(){this.program_pmt_pid={}};!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"}(P||(P={}));var C,I=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},x=function(){},j=function(){},A=function(){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"}(C||(C={}));var D,R,L=function(){},B=function(e){var 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)},M=function(){function e(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_&&o.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,n=this.data_;;){if(t+3>=n.byteLength)return this.eof_flag_=!0,n.byteLength;var i=n[t+0]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3],o=n[t+0]<<16|n[t+1]<<8|n[t+2];if(1===i||1===o)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var n=this.current_startcode_offset_,i=31&e[n+=1==(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])?4:3],o=(128&e[n])>>>7,a=this.findNextStartCodeOffset(n);if(this.current_startcode_offset_=a,!(i>=C.kReserved0)&&0===o){var r=e.subarray(n,a);(t=new L).type=i,t.data=r}}return t},e}(),O=function(){function e(e,t,n){var i=8+e.byteLength+1+2+t.byteLength,o=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(o=!0,i+=4);var a=this.data=new Uint8Array(i);a[0]=1,a[1]=e[1],a[2]=e[2],a[3]=e[3],a[4]=255,a[5]=225;var r=e.byteLength;a[6]=r>>>8,a[7]=255&r;var s=8;a.set(e,8),a[s+=r]=1;var c=t.byteLength;a[s+1]=c>>>8,a[s+2]=255&c,a.set(t,s+3),s+=3+c,o&&(a[s]=252|n.chroma_format_idc,a[s+1]=248|n.bit_depth_luma-8,a[s+2]=248|n.bit_depth_chroma-8,a[s+3]=0,s+=4)}return e.prototype.getData=function(){return this.data},e}();!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"}(D||(D={})),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"}(R||(R={}));var z,N,F=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],U=(z=function(e,t){return z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},z(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),V=function(){},H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return U(t,e),t}(V),G=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&o.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,n=this.data_;;){if(t+7>=n.byteLength)return this.eof_flag_=!0,n.byteLength;if(4095==(n[t+0]<<8|n[t+1])>>>4)return t;t++}},e.prototype.readNextAACFrame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var n=this.current_syncword_offset_,i=(8&e[n+1])>>>3,o=(6&e[n+1])>>>1,a=1&e[n+1],r=(192&e[n+2])>>>6,s=(60&e[n+2])>>>2,c=(1&e[n+2])<<2|(192&e[n+3])>>>6,l=(3&e[n+3])<<11|e[n+4]<<3|(224&e[n+5])>>>5;if(e[n+6],n+l>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var d=1===a?7:9,u=l-d;n+=d;var m=this.findNextSyncwordOffset(n+u);if(this.current_syncword_offset_=m,(0===i||1===i)&&0===o){var h=e.subarray(n,n+u);(t=new V).audio_object_type=r+1,t.sampling_freq_index=s,t.sampling_frequency=F[s],t.channel_config=c,t.data=h}}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Z=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&o.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,n=this.data_;;){if(t+1>=n.byteLength)return this.eof_flag_=!0,n.byteLength;if(695==(n[t+0]<<3|n[t+1]>>>5))return t;t++}},e.prototype.getLATMValue=function(e){for(var t=e.readBits(2),n=0,i=0;i<=t;i++)n<<=8,n|=e.readByte();return n},e.prototype.readNextAACFrame=function(e){for(var t=this.data_,n=null;null==n&&!this.eof_flag_;){var i=this.current_syncword_offset_,a=(31&t[i+1])<<8|t[i+2];if(i+3+a>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var r=new h(t.subarray(i+3,i+3+a)),s=null;if(r.readBool()){if(null==e){o.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(i+3+a),r.destroy();continue}s=e}else{var c=r.readBool();if(c&&r.readBool()){o.A.e(this.TAG,"audioMuxVersionA is Not Supported"),r.destroy();break}if(c&&this.getLATMValue(r),!r.readBool()){o.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),r.destroy();break}if(0!==r.readBits(6)){o.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),r.destroy();break}if(0!==r.readBits(4)){o.A.e(this.TAG,"more than 2 numProgram Not Supported"),r.destroy();break}if(0!==r.readBits(3)){o.A.e(this.TAG,"more than 2 numLayer Not Supported"),r.destroy();break}var l=c?this.getLATMValue(r):0,d=r.readBits(5);l-=5;var u=r.readBits(4);l-=4;var m=r.readBits(4);l-=4,r.readBits(3),(l-=3)>0&&r.readBits(l);var p=r.readBits(3);if(0!==p){o.A.e(this.TAG,"frameLengthType = ".concat(p,". Only frameLengthType = 0 Supported")),r.destroy();break}r.readByte();var g=r.readBool();if(g)if(c)this.getLATMValue(r);else{for(var f=0;;){f<<=8;var v=r.readBool();if(f+=r.readByte(),!v)break}console.log(f)}r.readBool()&&r.readByte(),(s=new H).audio_object_type=d,s.sampling_freq_index=u,s.sampling_frequency=F[s.sampling_freq_index],s.channel_config=m,s.other_data_present=g}for(var y=0;;){var S=r.readByte();if(y+=S,255!==S)break}for(var _=new Uint8Array(y),b=0;b<y;b++)_[b]=r.readByte();(n=new H).audio_object_type=s.audio_object_type,n.sampling_freq_index=s.sampling_freq_index,n.sampling_frequency=F[s.sampling_freq_index],n.channel_config=s.channel_config,n.other_data_present=s.other_data_present,n.data=_,this.current_syncword_offset_=this.findNextSyncwordOffset(i+3+a)}return n},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),W=function(e){var t=[],n=e.audio_object_type,i=e.audio_object_type,o=e.sampling_freq_index,a=e.channel_config,r=0,s=navigator.userAgent.toLowerCase();s.includes("firefox")?o>=6?(i=5,t=new Array(4),r=o-3):(i=2,t=new Array(2),r=o):s.includes("android")?(i=2,t=new Array(2),r=o):(i=5,r=o,t=new Array(4),o>=6?r=o-3:1===a&&(i=2,t=new Array(2),r=o)),t[0]=i<<3,t[0]|=(15&o)>>>1,t[1]=(15&o)<<7,t[1]|=(15&a)<<3,5===i&&(t[1]|=(15&r)>>>1,t[2]=(1&r)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=F[o],this.channel_count=a,this.codec_mimetype="mp4a.40."+i.toString(),this.original_codec_mimetype="mp4a.40."+n.toString()},q=function(){},K=function(){};!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"}(N||(N={}));var J,Y=function(e){var 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})},X=function(e){var t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},Q=function(e,t){var n=t.readBits(8);return e?{component_tag:n}:{component_tag:n,splice_time:Y(t)}},$=function(e){return{component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}},ee=function(e){var t=e.readBits(32),n=e.readBool();e.readBits(7);var i={splice_event_id:t,splice_event_cancel_indicator:n};if(n)return i;if(i.out_of_network_indicator=e.readBool(),i.program_splice_flag=e.readBool(),i.duration_flag=e.readBool(),e.readBits(5),i.program_splice_flag)i.utc_splice_time=e.readBits(32);else{i.component_count=e.readBits(8),i.components=[];for(var o=0;o<i.component_count;o++)i.components.push($(e))}return i.duration_flag&&(i.break_duration=X(e)),i.unique_program_id=e.readBits(16),i.avail_num=e.readBits(8),i.avails_expected=e.readBits(8),i},te=function(e,t,n,i){return{descriptor_tag:e,descriptor_length:t,identifier:n,provider_avail_id:i.readBits(32)}},ne=function(e,t,n,i){var o=i.readBits(8),a=i.readBits(3);i.readBits(5);for(var r="",s=0;s<a;s++)r+=String.fromCharCode(i.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:n,preroll:o,dtmf_count:a,DTMF_char:r}},ie=function(e){var t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},oe=function(e,t,n,i){var o=i.readBits(32),a=i.readBool();i.readBits(7);var r={descriptor_tag:e,descriptor_length:t,identifier:n,segmentation_event_id:o,segmentation_event_cancel_indicator:a};if(a)return r;if(r.program_segmentation_flag=i.readBool(),r.segmentation_duration_flag=i.readBool(),r.delivery_not_restricted_flag=i.readBool(),r.delivery_not_restricted_flag?i.readBits(5):(r.web_delivery_allowed_flag=i.readBool(),r.no_regional_blackout_flag=i.readBool(),r.archive_allowed_flag=i.readBool(),r.device_restrictions=i.readBits(2)),!r.program_segmentation_flag){r.component_count=i.readBits(8),r.components=[];for(var s=0;s<r.component_count;s++)r.components.push(ie(i))}r.segmentation_duration_flag&&(r.segmentation_duration=i.readBits(40)),r.segmentation_upid_type=i.readBits(8),r.segmentation_upid_length=i.readBits(8);var c=new Uint8Array(r.segmentation_upid_length);for(s=0;s<r.segmentation_upid_length;s++)c[s]=i.readBits(8);return r.segmentation_upid=c.buffer,r.segmentation_type_id=i.readBits(8),r.segment_num=i.readBits(8),r.segments_expected=i.readBits(8),52!==r.segmentation_type_id&&54!==r.segmentation_type_id&&56!==r.segmentation_type_id&&58!==r.segmentation_type_id||(r.sub_segment_num=i.readBits(8),r.sub_segments_expected=i.readBits(8)),r},ae=function(e,t,n,i){return{descriptor_tag:e,descriptor_length:t,identifier:n,TAI_seconds:i.readBits(48),TAI_ns:i.readBits(32),UTC_offset:i.readBits(16)}},re=function(e){return{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=function(e,t,n,i){for(var o=i.readBits(4),a=[],r=0;r<o;r++)a.push(re(i));return{descriptor_tag:e,descriptor_length:t,identifier:n,audio_count:o,components:a}};!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"}(J||(J={}));var ce=function(){},le=function(e){var 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)},de=function(){function e(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_&&o.A.e(this.TAG,"Could not find H265 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,n=this.data_;;){if(t+3>=n.byteLength)return this.eof_flag_=!0,n.byteLength;var i=n[t+0]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3],o=n[t+0]<<16|n[t+1]<<8|n[t+2];if(1===i||1===o)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var n=this.current_startcode_offset_,i=e[n+=1==(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])?4:3]>>1&63,o=(128&e[n])>>>7,a=this.findNextStartCodeOffset(n);if(this.current_startcode_offset_=a,0===o){var r=e.subarray(n,a);(t=new ce).type=i,t.data=r}}return t},e}(),ue=function(){function e(e,t,n,i){var o=23+(5+e.byteLength)+(5+t.byteLength)+(5+n.byteLength),a=this.data=new Uint8Array(o);a[0]=1,a[1]=(3&i.general_profile_space)<<6|(i.general_tier_flag?1:0)<<5|31&i.general_profile_idc,a[2]=i.general_profile_compatibility_flags_1,a[3]=i.general_profile_compatibility_flags_2,a[4]=i.general_profile_compatibility_flags_3,a[5]=i.general_profile_compatibility_flags_4,a[6]=i.general_constraint_indicator_flags_1,a[7]=i.general_constraint_indicator_flags_2,a[8]=i.general_constraint_indicator_flags_3,a[9]=i.general_constraint_indicator_flags_4,a[10]=i.general_constraint_indicator_flags_5,a[11]=i.general_constraint_indicator_flags_6,a[12]=i.general_level_idc,a[13]=240|(3840&i.min_spatial_segmentation_idc)>>8,a[14]=255&i.min_spatial_segmentation_idc,a[15]=252|3&i.parallelismType,a[16]=252|3&i.chroma_format_idc,a[17]=248|7&i.bit_depth_luma_minus8,a[18]=248|7&i.bit_depth_chroma_minus8,a[19]=0,a[20]=0,a[21]=(3&i.constant_frame_rate)<<6|(7&i.num_temporal_layers)<<3|(i.temporal_id_nested?1:0)<<2|3,a[22]=3,a[23]=128|J.kSliceVPS,a[24]=0,a[25]=1,a[26]=(65280&e.byteLength)>>8,a[27]=255&e.byteLength,a.set(e,28),a[23+(5+e.byteLength)+0]=128|J.kSliceSPS,a[23+(5+e.byteLength)+1]=0,a[23+(5+e.byteLength)+2]=1,a[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,a[23+(5+e.byteLength)+4]=255&t.byteLength,a.set(t,23+(5+e.byteLength)+5),a[23+(5+e.byteLength+5+t.byteLength)+0]=128|J.kSlicePPS,a[23+(5+e.byteLength+5+t.byteLength)+1]=0,a[23+(5+e.byteLength+5+t.byteLength)+2]=1,a[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&n.byteLength)>>8,a[23+(5+e.byteLength+5+t.byteLength)+4]=255&n.byteLength,a.set(n,23+(5+e.byteLength+5+t.byteLength)+5)}return e.prototype.getData=function(){return this.data},e}(),me=function(){},he=function(){},pe=function(){},ge=[[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]],fe=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&o.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,n=this.data_;;){if(t+7>=n.byteLength)return this.eof_flag_=!0,n.byteLength;if(2935==(n[t+0]<<8|n[t+1]))return t;t++}},e.prototype.readNextAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var n=this.current_syncword_offset_,i=e[n+4]>>6,o=[48e3,44200,33e3][i],a=63&e[n+4],r=2*ge[i][a];if(n+r>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var s=this.findNextSyncwordOffset(n+r);this.current_syncword_offset_=s;var c=e[n+5]>>3,l=7&e[n+5],d=e[n+6]>>5,u=0;1&d&&1!==d&&(u+=2),4&d&&(u+=2),2===d&&(u+=2);var m=(e[n+6]<<8|e[n+7])>>12-u&1,h=[2,1,2,3,3,4,4,5][d]+m;(t=new pe).sampling_frequency=o,t.channel_count=h,t.channel_mode=d,t.bit_stream_identification=c,t.low_frequency_effects_channel_on=m,t.bit_stream_mode=l,t.frame_size_code=a,t.data=e.subarray(n,n+r)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),ve=function(e){var 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"},ye=function(){},Se=function(){function e(e){this.TAG="EAC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&o.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,n=this.data_;;){if(t+7>=n.byteLength)return this.eof_flag_=!0,n.byteLength;if(2935==(n[t+0]<<8|n[t+1]))return t;t++}},e.prototype.readNextEAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var n=this.current_syncword_offset_,i=new h(e.subarray(n+2)),o=(i.readBits(2),i.readBits(3),i.readBits(11)+1<<1),a=i.readBits(2),r=null,s=null;3===a?(r=[24e3,22060,16e3][a=i.readBits(2)],s=3):(r=[48e3,44100,32e3][a],s=i.readBits(2));var c=i.readBits(3),l=i.readBits(1),d=i.readBits(5);if(n+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var u=this.findNextSyncwordOffset(n+o);this.current_syncword_offset_=u;var m=[2,1,2,3,3,4,4,5][c]+l;i.destroy(),(t=new ye).sampling_frequency=r,t.channel_count=m,t.channel_mode=c,t.bit_stream_identification=d,t.low_frequency_effects_channel_on=l,t.frame_size=o,t.num_blks=[1,2,3,6][s],t.data=e.subarray(n,n+o)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),_e=function(e){var t,n=Math.floor(e.frame_size*e.sampling_frequency/(16*e.num_blks));t=[255&n,248&n,e.sampling_rate_code<<6|e.bit_stream_identification<<1,e.channel_mode<<1|e.low_frequency_effects_channel_on,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"},be=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),we=function(){return we=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},we.apply(this,arguments)},Te=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r},Ee=function(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},Pe=function(e){function t(t,n){var i=e.call(this)||this;return i.TAG="TSDemuxer",i.first_parse_=!0,i.media_info_=new r.A,i.timescale_=90,i.duration_=0,i.current_pmt_pid_=-1,i.program_pmt_map_={},i.pes_slice_queues_={},i.section_slice_queues_={},i.video_metadata_={vps:void 0,sps:void 0,pps:void 0,details:void 0},i.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},i.aac_last_sample_pts_=void 0,i.aac_last_incomplete_data_=null,i.has_video_=!1,i.has_audio_=!1,i.video_init_segment_dispatched_=!1,i.audio_init_segment_dispatched_=!1,i.video_metadata_changed_=!1,i.audio_metadata_changed_=!1,i.loas_previous_frame=null,i.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},i.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},i.ts_packet_size_=t.ts_packet_size,i.sync_offset_=t.sync_offset,i.config_=n,i}return be(t,e),t.prototype.destroy=function(){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,e.prototype.destroy.call(this)},t.probe=function(e){var t=new Uint8Array(e),n=-1,i=188;if(t.byteLength<=3*i)return{needMoreData:!0};for(;-1===n;){for(var a=Math.min(1e3,t.byteLength-3*i),r=0;r<a;){if(71===t[r]&&71===t[r+i]&&71===t[r+2*i]){n=r;break}r++}if(-1===n)if(188===i)i=192;else{if(192!==i)break;i=204}}return-1===n?{match:!1}:(192===i&&n>=4?(o.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),n-=4):204===i&&o.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:i,sync_offset:n})},t.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new r.A},t.prototype.parseChunks=function(e,t){var n;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new d.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0;for(this.first_parse_&&(this.first_parse_=!1,i=this.sync_offset_);i+this.ts_packet_size_<=e.byteLength;){var a=t+i;192===this.ts_packet_size_&&(i+=4);var r=new Uint8Array(e,i,188),s=r[0];if(71!==s){o.A.e(this.TAG,"sync_byte = ".concat(s,", not 0x47"));break}var c=(64&r[1])>>>6,l=(r[1],(31&r[1])<<8|r[2]),u=(48&r[3])>>>4,m=15&r[3],h={},p=4;if(2===u||3===u){var g=r[4];if(5+g===188){i+=188,204===this.ts_packet_size_&&(i+=16);continue}g>0&&(h=this.parseAdaptationField(e,i+4,1+g)),p=5+g}if(1===u||3===u)if(0===l||l===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[l]===P.kSCTE35){var f=188-p;this.handleSectionSlice(e,i+p,f,{pid:l,file_position:a,payload_unit_start_indicator:c,continuity_conunter:m,random_access_indicator:h.random_access_indicator})}else if(void 0!==(null===(n=this.pmt_)||void 0===n?void 0:n.pid_stream_type[l])){f=188-p;var v=this.pmt_.pid_stream_type[l];(l===this.pmt_.common_pids.h264||l===this.pmt_.common_pids.h265||l===this.pmt_.common_pids.adts_aac||l===this.pmt_.common_pids.loas_aac||l===this.pmt_.common_pids.ac3||l===this.pmt_.common_pids.eac3||l===this.pmt_.common_pids.opus||l===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[l]||this.pmt_.timed_id3_pids[l])&&this.handlePESSlice(e,i+p,f,{pid:l,stream_type:v,file_position:a,payload_unit_start_indicator:c,continuity_conunter:m,random_access_indicator:h.random_access_indicator})}i+=188,204===this.ts_packet_size_&&(i+=16)}return this.dispatchAudioVideoMediaSegment(),i},t.prototype.parseAdaptationField=function(e,t,n){var i=new Uint8Array(e,t,n),a=i[0];return a>0?a>183?(o.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(a)),{}):{discontinuity_indicator:(128&i[1])>>>7,random_access_indicator:(64&i[1])>>>6,elementary_stream_priority_indicator:(32&i[1])>>>5}:{}},t.prototype.handleSectionSlice=function(e,t,n,i){var o=new Uint8Array(e,t,n),a=this.section_slice_queues_?this.section_slice_queues_[i.pid]:{};if(i.payload_unit_start_indicator){var r=o[0];if(void 0!==a&&0!==(null==a?void 0:a.total_length)){var s=new Uint8Array(e,t+1,Math.min(n,r));a.slices.push(s),a.total_length+=s.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):this.clearSlices(a,i)}for(var c=1+r;c<o.byteLength&&255!==o[c+0];){var l=(15&o[c+1])<<8|o[c+2];this.section_slice_queues_&&(this.section_slice_queues_[i.pid]=new A,a=this.section_slice_queues_[i.pid]),a.expected_length=l+3,a.file_position=i.file_position,a.random_access_indicator=i.random_access_indicator,s=new Uint8Array(e,t+c,Math.min(n-c,a.expected_length-a.total_length)),a.slices.push(s),a.total_length+=s.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):a.total_length>=a.expected_length&&this.clearSlices(a,i),c+=s.byteLength}}else void 0!==a&&0!==a.total_length&&(s=new Uint8Array(e,t,Math.min(n,a.expected_length-a.total_length)),a.slices.push(s),a.total_length+=s.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):a.total_length>=a.expected_length&&this.clearSlices(a,i))},t.prototype.handlePESSlice=function(e,t,n,i){var a=new Uint8Array(e,t,n),r=a[0]<<16|a[1]<<8|a[2],s=(a[3],a[4]<<8|a[5]);if(i.payload_unit_start_indicator){if(1!==r)return void o.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(r));var c=this.pes_slice_queues_[i.pid];c&&(0===c.expected_length||c.expected_length===c.total_length?this.emitPESSlices(c,i):this.clearSlices(c,i)),this.pes_slice_queues_&&(this.pes_slice_queues_[i.pid]=new A,this.pes_slice_queues_[i.pid].file_position=i.file_position,this.pes_slice_queues_[i.pid].random_access_indicator=i.random_access_indicator)}if(void 0!==this.pes_slice_queues_[i.pid]){var l=this.pes_slice_queues_[i.pid];l.slices.push(a),i.payload_unit_start_indicator&&(l.expected_length=0===s?0:s+6),l.total_length+=a.byteLength,l.expected_length>0&&l.expected_length===l.total_length?this.emitPESSlices(l,i):l.expected_length>0&&l.expected_length<l.total_length&&this.clearSlices(l,i)}},t.prototype.emitSectionSlices=function(e,t){for(var n=new Uint8Array(e.total_length),i=0,o=0;i<e.slices.length;i++){var a=e.slices[i];n.set(a,o),o+=a.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var r=new j;r.pid=t.pid,r.data=n,r.file_position=e.file_position,r.random_access_indicator=e.random_access_indicator,this.parseSection(r)},t.prototype.emitPESSlices=function(e,t){for(var n=new Uint8Array(e.total_length),i=0,o=0;i<e.slices.length;i++){var a=e.slices[i];n.set(a,o),o+=a.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var r=new x;r.pid=t.pid,r.data=n,r.stream_type=t.stream_type,r.file_position=e.file_position,r.random_access_indicator=e.random_access_indicator,this.parsePES(r)},t.prototype.clearSlices=function(e,t){e.slices=[],e.expected_length=-1,e.total_length=0},t.prototype.parseSection=function(e){var t,n=e.data,i=e.pid;0===i?this.parsePAT(n):i===this.current_pmt_pid_?this.parsePMT(n):(null===(t=this.pmt_)||void 0===t?void 0:t.scte_35_pids[i])&&this.parseSCTE35(n)},t.prototype.parsePES=function(e){var t=e.data,n=t[0]<<16|t[1]<<8|t[2],i=t[3],a=t[4]<<8|t[5];if(1===n)if(188!==i&&190!==i&&191!==i&&240!==i&&241!==i&&255!==i&&242!==i&&248!==i){t[6];var r=(192&t[7])>>>6,s=t[8],c=void 0,l=void 0;2!==r&&3!==r||(c=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,l=3===r?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:c);var d=9+s,u=void 0;if(0!==a){if(a<3+s)return void o.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");u=a-3-s}else u=t.byteLength-d;var m=t.subarray(d,d+u);switch(e.stream_type){case P.kMPEG1Audio:case P.kMPEG2Audio:this.parseMP3Payload(m,c);break;case P.kPESPrivateData:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(m,c):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(m,c):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(m,c):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(m,c,l,e.pid,i):this.parsePESPrivateDataPayload(m,c,l,e.pid,i);break;case P.kADTSAAC:this.parseADTSAACPayload(m,c);break;case P.kLOASAAC:this.parseLOASAACPayload(m,c);break;case P.kAC3:this.parseAC3Payload(m,c);break;case P.kEAC3:this.parseEAC3Payload(m,c);break;case P.kID3:this.parseTimedID3MetadataPayload(m,c,l,e.pid,i);break;case P.kH264:this.parseH264Payload(m,c,l,e.file_position,e.random_access_indicator);break;case P.kH265:this.parseH265Payload(m,c,l,e.file_position,e.random_access_indicator)}}else 188!==i&&191!==i&&240!==i&&241!==i&&255!==i&&242!==i&&248!==i||e.stream_type!==P.kPESPrivateData||(d=6,u=void 0,u=0!==a?a:t.byteLength-d,m=t.subarray(d,d+u),this.parsePESPrivateDataPayload(m,void 0,void 0,e.pid,i));else o.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(n))},t.prototype.parsePAT=function(e){var t=e[0];if(0===t){var n=(15&e[1])<<8|e[2],i=(e[3],e[4],(62&e[5])>>>1),a=1&e[5],r=e[6],s=(e[7],null);if(1===a&&0===r)(s=new k).version_number=i;else if(null==(s=this.pat_))return;for(var c=n-5-4,l=-1,d=-1,u=8;u<8+c;u+=4){var m=e[u]<<8|e[u+1],h=(31&e[u+2])<<8|e[u+3];0===m?s.network_pid=h:(s.program_pmt_pid[m]=h,-1===l&&(l=m),-1===d&&(d=h))}1===a&&0===r&&(void 0===this.pat_&&o.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(s))),this.pat_=s,this.current_program_=l,this.current_pmt_pid_=d)}else o.A.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))},t.prototype.parsePMT=function(e){var t=e[0];if(2===t){var n=(15&e[1])<<8|e[2],i=e[3]<<8|e[4],a=(62&e[5])>>>1,r=1&e[5],s=e[6],c=(e[7],null);if(1===r&&0===s)(c=new I).program_number=i,c.version_number=a,this.program_pmt_map_[i]=c;else if(null==(c=this.program_pmt_map_[i]))return;e[8],e[9];for(var l=(15&e[10])<<8|e[11],d=12+l,u=n-9-l-4,m=d;m<d+u;){var h=e[m],p=(31&e[m+1])<<8|e[m+2],g=(15&e[m+3])<<8|e[m+4];c.pid_stream_type[p]=h;var f=c.common_pids.h264||c.common_pids.h265,v=c.common_pids.adts_aac||c.common_pids.loas_aac||c.common_pids.ac3||c.common_pids.eac3||c.common_pids.opus||c.common_pids.mp3;if(h!==P.kH264||f)if(h!==P.kH265||f)if(h!==P.kADTSAAC||v)if(h!==P.kLOASAAC||v)if(h!==P.kAC3||v)if(h!==P.kEAC3||v)if(h!==P.kMPEG1Audio&&h!==P.kMPEG2Audio||v)if(h===P.kPESPrivateData){if(c.pes_private_data_pids[p]=!0,g>0){for(var y=m+5;y<m+5+g;){var S=e[y+0],_=e[y+1];if(5===S){var b=String.fromCharCode.apply(String,Ee([],Te(Array.from(e.subarray(y+2,y+2+_))),!1));"VANC"===b?c.smpte2038_pids[p]=!0:"Opus"===b&&(c.common_pids.opus=p)}else if(127===S&&p===c.common_pids.opus){var w=null;if(128===e[y+2]&&(w=e[y+3]),null==w){o.A.e(this.TAG,"Not Supported Opus channel count.");continue}var T={codec:"opus",channel_count:15&w?15&w:2,channel_config_code:w,sample_rate:48e3},E={codec:"opus",meta:T};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(E)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(E)):(this.audio_metadata_=T,this.dispatchAudioInitSegment(E))}y+=2+_}var k=e.subarray(m+5,m+5+g);this.dispatchPESPrivateDataDescriptor(p,h,k)}}else h===P.kID3?c.timed_id3_pids[p]=!0:h===P.kSCTE35&&(c.scte_35_pids[p]=!0);else c.common_pids.mp3=p;else c.common_pids.eac3=p;else c.common_pids.ac3=p;else c.common_pids.loas_aac=p;else c.common_pids.adts_aac=p;else c.common_pids.h265=p;else c.common_pids.h264=p;m+=5+g}i===this.current_program_&&(void 0===this.pmt_&&o.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(c))),this.pmt_=c,(c.common_pids.h264||c.common_pids.h265)&&(this.has_video_=!0),(c.common_pids.adts_aac||c.common_pids.loas_aac||c.common_pids.ac3||c.common_pids.opus||c.common_pids.mp3)&&(this.has_audio_=!0))}else o.A.e(this.TAG,"parsePMT: table_id ".concat(t," is not corresponded to PMT!"))},t.prototype.parseSCTE35=function(e){var t=function(e){var t,n,i,o,a,r,s=new h(e),c=s.readBits(8),l=s.readBool(),d=s.readBool();s.readBits(2);var u=s.readBits(12),m=s.readBits(8),p=s.readBool(),g=s.readBits(6),f=4*s.readBits(31)+s.readBits(2),v=s.readBits(8),y=s.readBits(12),S=s.readBits(12),_=s.readBits(8),b=null;_===N.kSpliceNull?b={}:_===N.kSpliceSchedule?b=function(e){for(var t=e.readBits(8),n=[],i=0;i<t;i++)n.push(ee(e));return{splice_count:t,events:n}}(s):_===N.kSpliceInsert?b=function(e){var t=e.readBits(32),n=e.readBool();e.readBits(7);var i={splice_event_id:t,splice_event_cancel_indicator:n};if(n)return i;if(i.out_of_network_indicator=e.readBool(),i.program_splice_flag=e.readBool(),i.duration_flag=e.readBool(),i.splice_immediate_flag=e.readBool(),e.readBits(4),i.program_splice_flag&&!i.splice_immediate_flag&&(i.splice_time=Y(e)),!i.program_splice_flag){i.component_count=e.readBits(8),i.components=[];for(var o=0;o<i.component_count;o++)i.components.push(Q(i.splice_immediate_flag,e))}return i.duration_flag&&(i.break_duration=X(e)),i.unique_program_id=e.readBits(16),i.avail_num=e.readBits(8),i.avails_expected=e.readBits(8),i}(s):_===N.kTimeSignal?b=function(e){return{splice_time:Y(e)}}(s):_===N.kBandwidthReservation?b={}:_===N.kPrivateCommand?b=function(e,t){for(var n=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),i=new Uint8Array(e-4),o=0;o<e-4;o++)i[o]=t.readBits(8);return{identifier:n,private_data:i.buffer}}(S,s):s.readBits(8*S);for(var w=[],T=s.readBits(16),E=0;E<T;){var P=s.readBits(8),k=s.readBits(8),C=String.fromCharCode(s.readBits(8),s.readBits(8),s.readBits(8),s.readBits(8));0===P?w.push(te(P,k,C,s)):1===P?w.push(ne(P,k,C,s)):2===P?w.push(oe(P,k,C,s)):3===P?w.push(ae(P,k,C,s)):4===P?w.push(se(P,k,C,s)):s.readBits(8*(k-4)),E+=2+k}var I={table_id:c,section_syntax_indicator:l,private_indicator:d,section_length:u,protocol_version:m,encrypted_packet:p,encryption_algorithm:g,pts_adjustment:f,cw_index:v,tier:y,splice_command_length:S,splice_command_type:_,splice_command:b,descriptor_loop_length:T,splice_descriptors:w,E_CRC32:p?s.readBits(32):void 0,CRC32:s.readBits(32)};if(_===N.kSpliceInsert){var x=b;if(x.splice_event_cancel_indicator)return{splice_command_type:_,detail:I,data:e};if(x.program_splice_flag&&!x.splice_immediate_flag){var j=x.duration_flag?null===(t=null==x?void 0:x.break_duration)||void 0===t?void 0:t.auto_return:void 0,A=x.duration_flag?((null===(n=null==x?void 0:x.break_duration)||void 0===n?void 0:n.duration)||0)/90:void 0;return(null===(i=x.splice_time)||void 0===i?void 0:i.time_specified_flag)?{splice_command_type:_,pts:(f+((null===(o=null==x?void 0:x.splice_time)||void 0===o?void 0:o.pts_time)||0))%Math.pow(2,33),auto_return:j,duraiton:A,detail:I,data:e}:{splice_command_type:_,auto_return:j,duraiton:A,detail:I,data:e}}return{splice_command_type:_,auto_return:j=x.duration_flag?null===(a=x.break_duration)||void 0===a?void 0:a.auto_return:void 0,duraiton:A=x.duration_flag?((null===(r=x.break_duration)||void 0===r?void 0:r.duration)||0)/90:void 0,detail:I,data:e}}if(_===N.kTimeSignal){var D=b;return D.splice_time.time_specified_flag?{splice_command_type:_,pts:(f+(D.splice_time.pts_time||0))%Math.pow(2,33),detail:I,data:e}:{splice_command_type:_,detail:I,data:e}}return{splice_command_type:_,detail:I,data:e}}(e);if(void 0!==t.pts){var n=Math.floor(t.pts/this.timescale_);t.pts=n}else t.nearest_pts=this.aac_last_sample_pts_;this.onSCTE35Metadata&&this.onSCTE35Metadata(t)},t.prototype.parseH264Payload=function(e,t,n,i,a){for(var r,s,c=new M(e),l=null,d=[],u=0,m=!1;null!=(l=c.readNextNaluPayload());){var h=new B(l);if(h.type===C.kSliceSPS){var g=p.parseSPS(l.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(h,g)&&(o.A.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:h,pps:void 0,details:g}):this.video_metadata_&&(this.video_metadata_.sps=h,this.video_metadata_.details=g)}else h.type===C.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_&&(this.video_metadata_.pps=h),(null===(r=this.video_metadata_)||void 0===r?void 0:r.sps)&&(null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):(h.type===C.kSliceIDR||h.type===C.kSliceNonIDR&&1===a)&&(m=!0);this.video_init_segment_dispatched_&&(d.push(h),u+=h.data.byteLength)}var f=Math.floor(t/this.timescale_),v=Math.floor(n/this.timescale_);if(d.length){var y=this.video_track_,S={units:d,length:u,isKeyframe:m,dts:v,pts:f,cts:f-v,file_position:i};y&&(y.samples.push(S),y.length+=u)}},t.prototype.parseH265Payload=function(e,t,n,i,a){for(var r,s,c,l,d,u,m,h=new de(e),p=null,g=[],v=0,y=!1;null!=(p=h.readNextNaluPayload());){var S=new le(p);if(S.type===J.kSliceVPS){if(!this.video_init_segment_dispatched_){var _=f.parseVPS(p.data);this.video_metadata_&&(this.video_metadata_.vps=S,this.video_metadata_.details=we(we({},null===(r=this.video_metadata_)||void 0===r?void 0:r.details),_))}}else S.type===J.kSliceSPS?(_=f.parseSPS(p.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(S,_)&&(o.A.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:S,pps:void 0,details:_}):this.video_metadata_&&(this.video_metadata_.sps=S,this.video_metadata_.details=we(we({},null===(s=this.video_metadata_)||void 0===s?void 0:s.details),_))):S.type===J.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(_=f.parsePPS(p.data),this.video_metadata_&&(this.video_metadata_.pps=S,this.video_metadata_.details=we(we({},null===(c=this.video_metadata_)||void 0===c?void 0:c.details),_)),(null===(l=this.video_metadata_)||void 0===l?void 0:l.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())):S.type!==J.kSliceIDR_W_RADL&&S.type!==J.kSliceIDR_N_LP&&S.type!==J.kSliceCRA_NUT||(y=!0);this.video_init_segment_dispatched_&&(g.push(S),v+=S.data.byteLength)}var b=Math.floor(t/this.timescale_),w=Math.floor(n/this.timescale_);if(g.length){var T=this.video_track_,E={units:g,length:v,isKeyframe:y,dts:w,pts:b,cts:b-w,file_position:i};T&&(null===(m=T.samples)||void 0===m||m.push(E),T.length+=v)}},t.prototype.detectVideoMetadataChange=function(e,t){var n,i,a,r,s,c,l,d,u,m;if(t.codec_mimetype!==(null===(i=null===(n=this.video_metadata_)||void 0===n?void 0:n.details)||void 0===i?void 0:i.codec_mimetype))return o.A.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(null===(a=this.video_metadata_)||void 0===a?void 0:a.details.codec_mimetype," to ").concat(null==t?void 0:t.codec_mimetype)),!0;if(t.codec_size.width!==(null===(s=null===(r=this.video_metadata_)||void 0===r?void 0:r.details)||void 0===s?void 0:s.codec_size.width)||t.codec_size.height!==(null===(l=null===(c=this.video_metadata_)||void 0===c?void 0:c.details)||void 0===l?void 0:l.codec_size.height)){var h=null===(d=this.video_metadata_)||void 0===d?void 0:d.details.codec_size,p=t.codec_size;return o.A.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(h.width,"x").concat(h.height," to ").concat(p.width,"x").concat(p.height)),!0}return t.present_size.width!==(null===(u=this.video_metadata_)||void 0===u?void 0:u.details.present_size.width)&&(o.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(null===(m=this.video_metadata_)||void 0===m?void 0:m.details.present_size.width," to ").concat(null==t?void 0:t.present_size.width)),!0)},t.prototype.isInitSegmentDispatched=function(){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_},t.prototype.dispatchVideoInitSegment=function(){var e,t,n,i,a,r,s,c,l,d,u,m,h=null===(e=this.video_metadata_)||void 0===e?void 0:e.details,p={type:"video"};p.id=null===(t=this.video_track_)||void 0===t?void 0:t.id,p.timescale=1e3,p.duration=this.duration_,p.codecWidth=h.codec_size.width,p.codecHeight=h.codec_size.height,p.presentWidth=h.present_size.width,p.presentHeight=h.present_size.height,p.profile=h.profile_string,p.level=h.level_string,p.bitDepth=h.bit_depth,p.chromaFormat=h.chroma_format,p.sarRatio=h.sar_ratio,p.frameRate=h.frame_rate;var g=p.frameRate.fps_den,f=p.frameRate.fps_num;if(p.refSampleDuration=g/f*1e3,p.codec=h.codec_mimetype,null===(n=this.video_metadata_)||void 0===n?void 0:n.vps){var v=null===(i=this.video_metadata_)||void 0===i?void 0:i.vps.data.subarray(4),y=null===(r=null===(a=this.video_metadata_)||void 0===a?void 0:a.sps)||void 0===r?void 0:r.data.subarray(4),S=null===(c=null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)||void 0===c?void 0:c.data.subarray(4),_=new ue(v,y,S,h);p.hvcc=_.getData(),this.video_init_segment_dispatched_||o.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}else{y=null===(d=null===(l=this.video_metadata_)||void 0===l?void 0:l.sps)||void 0===d?void 0:d.data.subarray(4),S=null===(m=null===(u=this.video_metadata_)||void 0===u?void 0:u.pps)||void 0===m?void 0:m.data.subarray(4);var b=new O(y,S,h);p.avcc=b.getData(),this.video_init_segment_dispatched_||o.A.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}this.onTrackMetadata&&this.onTrackMetadata("video",p),this.video_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var w=this.media_info_;w.hasVideo=!0,w.width=p.codecWidth,w.height=p.codecHeight,w.fps=p.frameRate.fps,w.profile=p.profile,w.level=p.level,w.refFrames=h.ref_frames,w.chromaFormat=h.chroma_format_string,w.sarNum=p.sarRatio.width,w.sarDen=p.sarRatio.height,w.videoCodec=p.codec,w.hasAudio&&w.audioCodec?w.mimeType='video/mp2t; codecs="'.concat(w.videoCodec,",").concat(w.audioCodec,'"'):w.mimeType='video/mp2t; codecs="'.concat(w.videoCodec,'"'),w.isComplete()&&this.onMediaInfo&&this.onMediaInfo(w)},t.prototype.dispatchVideoMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.video_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(null,this.video_track_)},t.prototype.dispatchAudioMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.audio_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,null)},t.prototype.dispatchAudioVideoMediaSegment=function(){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_)},t.prototype.parseADTSAACPayload=function(e,t){var n,i,a;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var r=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);r.set(this.aac_last_incomplete_data_,0),r.set(e,this.aac_last_incomplete_data_.byteLength),e=r}var s,c=0;if(void 0!==t&&(c=t/this.timescale_),"aac"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/(null===(i=this.audio_metadata_)||void 0===i?void 0:i.sampling_frequency)*1e3,c=this.aac_last_sample_pts_+s;else if(void 0===t)return void o.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var l=this.aac_last_sample_pts_+s;Math.abs(l-c)>1&&(o.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(l,"ms, PES pts: ").concat(c,"ms")),c=l)}}for(var d=new G(e),u=null,m=c,h=0;null!=(u=d.readNextAACFrame());){s=1024/u.sampling_frequency*1e3;var p={codec:"aac",data:u};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:u.audio_object_type,sampling_freq_index:u.sampling_freq_index,sampling_frequency:u.sampling_frequency,channel_config:u.channel_config},this.dispatchAudioInitSegment(p)),h=m;var g=Math.floor(m),f={unit:u.data,length:u.data.byteLength,pts:g,dts:g};this.audio_track_&&(null===(a=this.audio_track_)||void 0===a||a.samples.push(f),this.audio_track_.length+=u.data.byteLength),m+=s}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),h&&(this.aac_last_sample_pts_=h)}},t.prototype.parseLOASAACPayload=function(e,t){var n,i,a;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var r=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);r.set(this.aac_last_incomplete_data_,0),r.set(e,this.aac_last_incomplete_data_.byteLength),e=r}var s,c=0;if(void 0!==t&&(c=t/this.timescale_),"aac"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/this.audio_metadata_.sampling_frequency*1e3,c=this.aac_last_sample_pts_+s;else if(void 0===t)return void o.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var l=this.aac_last_sample_pts_+s;Math.abs(l-c)>1&&(o.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(l,"ms, PES pts: ").concat(c,"ms")),c=l)}}for(var d=new Z(e),u=null,m=c,h=0;null!=(u=d.readNextAACFrame(null!==(i=this.loas_previous_frame)&&void 0!==i?i:void 0));){this.loas_previous_frame=u,s=1024/u.sampling_frequency*1e3;var p={codec:"aac",data:u};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:u.audio_object_type,sampling_freq_index:u.sampling_freq_index,sampling_frequency:u.sampling_frequency,channel_config:u.channel_config},this.dispatchAudioInitSegment(p)),h=m;var g=Math.floor(m),f={unit:u.data,length:u.data.byteLength,pts:g,dts:g};this.audio_track_&&(null===(a=this.audio_track_)||void 0===a||a.samples.push(f),this.audio_track_.length+=u.data.byteLength),m+=s}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),h&&(this.aac_last_sample_pts_=h)}},t.prototype.parseAC3Payload=function(e,t){var n,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,r=0;if(void 0!==t&&(r=t/this.timescale_),"ac-3"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)a=1536/this.audio_metadata_.sampling_frequency*1e3,r=this.aac_last_sample_pts_+a;else if(void 0===t)return void o.A.w(this.TAG,"AC3: Unknown pts");for(var s=new fe(e),c=null,l=r,d=0;null!=(c=s.readNextAC3Frame());){a=1536/c.sampling_frequency*1e3;var u={codec:"ac-3",data:c};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(u)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(u)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:c.sampling_frequency,bit_stream_identification:c.bit_stream_identification,bit_stream_mode:c.bit_stream_mode,low_frequency_effects_channel_on:c.low_frequency_effects_channel_on,channel_mode:c.channel_mode},this.dispatchAudioInitSegment(u)),d=l;var m=Math.floor(l),h={unit:c.data,length:c.data.byteLength,pts:m,dts:m};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(h),this.audio_track_.length+=c.data.byteLength),l+=a}d&&(this.aac_last_sample_pts_=d)}},t.prototype.parseEAC3Payload=function(e,t){var n,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,r=0;if(void 0!==t&&(r=t/this.timescale_),"ec-3"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)a=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,r=this.aac_last_sample_pts_+a;else if(void 0===t)return void o.A.w(this.TAG,"EAC3: Unknown pts");for(var s=new Se(e),c=null,l=r,d=0;null!=(c=s.readNextEAC3Frame());){a=1536/c.sampling_frequency*1e3;var u={codec:"ec-3",data:c};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(u)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(u)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:c.sampling_frequency,bit_stream_identification:c.bit_stream_identification,low_frequency_effects_channel_on:c.low_frequency_effects_channel_on,num_blks:c.num_blks,channel_mode:c.channel_mode},this.dispatchAudioInitSegment(u)),d=l;var m=Math.floor(l),h={unit:c.data,length:c.data.byteLength,pts:m,dts:m};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(h),this.audio_track_.length+=c.data.byteLength),l+=a}d&&(this.aac_last_sample_pts_=d)}},t.prototype.parseOpusPayload=function(e,t){var n,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,r=0;if(void 0!==t&&(r=t/this.timescale_),"opus"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)a=20,r=this.aac_last_sample_pts_+a;else if(void 0===t)return void o.A.w(this.TAG,"Opus: Unknown pts");for(var s=r,c=0,l=0;l<e.length;){a=20;for(var d=!!(16&e[l+1]),u=!!(8&e[l+1]),m=l+2,h=0;255===e[m];)h+=255,m+=1;h+=e[m],m+=1,m+=d?2:0,m+=u?2:0,c=s;var p=Math.floor(s),g=e.slice(m,m+h),f={unit:g,length:g.byteLength,pts:p,dts:p};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(f),this.audio_track_.length+=g.byteLength),s+=a,l=m+h}c&&(this.aac_last_sample_pts_=c)}},t.prototype.parseMP3Payload=function(e,t){var n;if(!this.has_video_||this.video_init_segment_dispatched_){var i=e[1]>>>3&3,o=(6&e[1])>>1,a=(e[2],(12&e[2])>>>2),r=3&~(e[3]>>>6)?2:1,s=0,c=34;switch(i){case 0:s=[11025,12e3,8e3,0][a];break;case 2:s=[22050,24e3,16e3,0][a];break;case 3:s=[44100,48e3,32e3,0][a]}switch(o){case 1:c=34;break;case 2:c=33;break;case 3:c=32}var l=new he;l.object_type=c,l.sample_rate=s,l.channel_count=r,l.data=e;var d={codec:"mp3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(d)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(d)):(this.audio_metadata_={codec:"mp3",object_type:c,sample_rate:s,channel_count:r},this.dispatchAudioInitSegment(d));var u={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(u),this.audio_track_.length+=e.byteLength)}},t.prototype.detectAudioMetadataChange=function(e){var t,n,i,a;if(e.codec!==(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))return o.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec," to ").concat(e.codec)),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){if((r=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return o.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(r.audio_object_type)),!0;if(r.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return o.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(r.sampling_freq_index)),!0;if(r.channel_config!==this.audio_metadata_.channel_config)return o.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(i=this.audio_metadata_)||void 0===i?void 0:i.channel_config," to ").concat(r.channel_config)),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var r;if((r=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return o.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(a=this.audio_metadata_)||void 0===a?void 0:a.sampling_frequency," to ").concat(r.sampling_frequency)),!0;if(r.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return o.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(r.bit_stream_identification)),!0;if(r.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return o.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(r.bit_stream_mode)),!0;if(r.channel_mode!==this.audio_metadata_.channel_mode)return o.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(r.channel_mode)),!0;if(r.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return o.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(r.low_frequency_effects_channel_on)),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){if((s=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return o.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return o.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var s;if((s=e.data).object_type!==this.audio_metadata_.object_type)return o.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(s.object_type)),!0;if(s.sample_rate!==this.audio_metadata_.sample_rate)return o.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return o.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}return!1},t.prototype.dispatchAudioInitSegment=function(e){var t,n,i,a,r,s,c={type:"audio"};if(c.id=null===(t=this.audio_track_)||void 0===t?void 0:t.id,c.timescale=1e3,c.duration=this.duration_,"aac"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec)){var l="aac"===e.codec?e.data:null,d=new W(l);c.audioSampleRate=d.sampling_rate,c.channelCount=d.channel_count,c.codec=d.codec_mimetype,c.originalCodec=d.original_codec_mimetype,c.config=d.config,c.refSampleDuration=1024/c.audioSampleRate*c.timescale}else if("ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var u="ac-3"===e.codec?e.data:null,m=new ve(u);c.audioSampleRate=m.sampling_rate,c.channelCount=m.channel_count,c.codec=m.codec_mimetype,c.originalCodec=m.original_codec_mimetype,c.config=m.config,c.refSampleDuration=1536/c.audioSampleRate*c.timescale}else if("ec-3"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)){var h="ec-3"===e.codec?e.data:null,p=new _e(h);c.audioSampleRate=p.sampling_rate,c.channelCount=p.channel_count,c.codec=p.codec_mimetype,c.originalCodec=p.original_codec_mimetype,c.config=p.config,c.refSampleDuration=256*p.num_blks/c.audioSampleRate*c.timescale}else"opus"===(null===(r=this.audio_metadata_)||void 0===r?void 0:r.codec)?(c.audioSampleRate=this.audio_metadata_.sample_rate,c.channelCount=this.audio_metadata_.channel_count,c.channelConfigCode=this.audio_metadata_.channel_config_code,c.codec="opus",c.originalCodec="opus",c.config=void 0,c.refSampleDuration=20):"mp3"===(null===(s=this.audio_metadata_)||void 0===s?void 0:s.codec)&&(c.audioSampleRate=this.audio_metadata_.sample_rate,c.channelCount=this.audio_metadata_.channel_count,c.codec="mp3",c.originalCodec="mp3",c.config=void 0);this.audio_init_segment_dispatched_||o.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(c.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",c),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var g=this.media_info_;g.hasAudio=!0,g.audioCodec=c.originalCodec,g.audioSampleRate=c.audioSampleRate,g.audioChannelCount=c.channelCount,g.hasVideo&&g.videoCodec?g.mimeType='video/mp2t; codecs="'.concat(g.videoCodec,",").concat(g.audioCodec,'"'):g.mimeType='video/mp2t; codecs="'.concat(g.audioCodec,'"'),g.isComplete()&&this.onMediaInfo&&this.onMediaInfo(g)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,n){var i=new K;i.pid=e,i.stream_type=t,i.descriptor=n,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(i)},t.prototype.parsePESPrivateDataPayload=function(e,t,n,i,o){var a=new q;if(a.pid=i,a.stream_id=o,a.len=e.byteLength,a.data=e,void 0!==t){var r=Math.floor(t/this.timescale_);a.pts=r}else a.nearest_pts=this.aac_last_sample_pts_;if(void 0!==n){var s=Math.floor(n/this.timescale_);a.dts=s}this.onPESPrivateData&&this.onPESPrivateData(a)},t.prototype.parseTimedID3MetadataPayload=function(e,t,n,i,o){var a=new q;if(a.pid=i,a.stream_id=o,a.len=e.byteLength,a.data=e,void 0!==t){var r=Math.floor(t/this.timescale_);a.pts=r}if(void 0!==n){var s=Math.floor(n/this.timescale_);a.dts=s}this.onTimedID3Metadata&&this.onTimedID3Metadata(a)},t.prototype.parseSMPTE2038MetadataPayload=function(e,t,n,i,o){var a=new me;if(a.pid=i,a.stream_id=o,a.len=e.byteLength,a.data=e,void 0!==t){var r=Math.floor(t/this.timescale_);a.pts=r}if(a.nearest_pts=this.aac_last_sample_pts_,void 0!==n){var s=Math.floor(n/this.timescale_);a.dts=s}a.ancillaries=function(e){for(var t=new h(e),n=0,i=[];n+=6,0===t.readBits(6);){var o=t.readBool();n+=1;var a=t.readBits(11);n+=11;var r=t.readBits(12);n+=12;var s=255&t.readBits(10);n+=10;var c=255&t.readBits(10);n+=10;var l=255&t.readBits(10);n+=10;for(var d=new Uint8Array(l),u=0;u<l;u++){var m=255&t.readBits(10);n+=10,d[u]=m}t.readBits(10),n+=10;var p="User Defined";65===s?7===c&&(p="SCTE-104"):95===s?220===c?p="ARIB STD-B37 (1SEG)":221===c?p="ARIB STD-B37 (ANALOG)":222===c?p="ARIB STD-B37 (SD)":223===c&&(p="ARIB STD-B37 (HD)"):97===s&&(1===c?p="EIA-708":2===c&&(p="EIA-608")),i.push({yc_indicator:o,line_number:a,horizontal_offset:r,did:s,sdid:c,user_data:d,description:p,information:{}}),t.readBits(8-(n-Math.floor(n/8))%8),n+=(8-(n-Math.floor(n/8)))%8}return t.destroy(),t=null,i}(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(a)},t}(E);const ke=Pe;var Ce=new Uint8Array([0,0,0,0,0,0,0,0]),Ie=function(){function e(){}return e.init=function(){for(var t in e.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:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)])},e.box=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=8,o=null,a=Array.prototype.slice.call(arguments,1),r=a.length,s=0;s<r;s++)i+=a[s].byteLength;(o=new Uint8Array(i))[0]=i>>>24&255,o[1]=i>>>16&255,o[2]=i>>>8&255,o[3]=255&i,o.set(e,4);var c=8;for(s=0;s<r;s++)o.set(a[s],c),c+=a[s].byteLength;return o},e.generateInitSegment=function(t){var n=e.box(e.types.ftyp,e.constants.FTYP),i=e.moov(t),o=new Uint8Array(n.byteLength+i.byteLength);return o.set(n,0),o.set(i,n.byteLength),o},e.moov=function(t){var n=e.mvhd(t.timescale,t.duration),i=e.trak(t),o=e.mvex(t);return e.box(e.types.moov,n,i,o)},e.mvhd=function(t,n){return e.box(e.types.mvhd,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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var n=t.id,i=t.duration,o=t.presentWidth,a=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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,o>>>8&255,255&o,0,0,a>>>8&255,255&a,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var n=t.timescale,i=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))},e.hdlr=function(t){var n;return n="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,n)},e.minf=function(t){var n;return n="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,n,e.dinf(),e.stbl(t))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"ac-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ac3(t)):"ec-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ec3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"video"===t.type&&t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):"video"===t.type&&t.codec.startsWith("av01")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.av01(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var n=t.channelCount,i=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types[".mp3"],o)},e.mp4a=function(t){var n=t.channelCount,i=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.mp4a,o,e.esds(t))},e.ac3=function(t){var n,i=t.channelCount,o=t.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,o>>>8&255,255&o,0,0]);return e.box(e.types["ac-3"],a,e.box(e.types.dac3,new Uint8Array(null!==(n=t.config)&&void 0!==n?n:[])))},e.ec3=function(t){var n,i=t.channelCount,o=t.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,o>>>8&255,255&o,0,0]);return e.box(e.types["ec-3"],a,e.box(e.types.dec3,new Uint8Array(null!==(n=t.config)&&void 0!==n?n:[])))},e.esds=function(t){var n,i=null!==(n=t.config)&&void 0!==n?n:[],o=i.length,a=new Uint8Array([0,0,0,0,3,23+o,0,1,0,4,15+o,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([o]).concat(i).concat([6,1,2]));return e.box(e.types.esds,a)},e.Opus=function(t){var n=t.channelCount,i=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.Opus,o,e.dOps(t))},e.dOps=function(t){var n=t.channelCount,i=t.channelConfigCode,o=t.audioSampleRate,a=[];switch(i){case 1:case 2:a=[0];break;case 0:a=[255,1,1,0,1];break;case 128:a=[255,2,0,0,1];break;case 3:a=[1,2,1,0,2,1];break;case 4:a=[1,2,2,0,1,2,3];break;case 5:a=[1,3,2,0,4,1,2,3];break;case 6:a=[1,4,2,0,4,1,2,3,5];break;case 7:a=[1,4,2,0,4,1,2,3,5,6];break;case 8:a=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:a=[1,1,2,0,1];break;case 131:a=[1,1,3,0,1,2];break;case 132:a=[1,1,4,0,1,2,3];break;case 133:a=[1,1,5,0,1,2,3,4];break;case 134:a=[1,1,6,0,1,2,3,4,5];break;case 135:a=[1,1,7,0,1,2,3,4,5,6];break;case 136:a=[1,1,8,0,1,2,3,4,5,6,7]}var r=new Uint8Array(function(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}([0,n,0,0,o>>>24&255,o>>>17&255,o>>>8&255,o>>>0&255,0,0],function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}(a),!1));return e.box(e.types.dOps,r)},e.avc1=function(t){var n=t.avcc,i=t.codecWidth,o=t.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,o>>>8&255,255&o,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,a,e.box(e.types.avcC,n))},e.hvc1=function(t){var n=t.hvcc,i=t.codecWidth,o=t.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,o>>>8&255,255&o,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,a,e.box(e.types.hvcC,n))},e.av01=function(t){var n,i,o=t.av1c,a=null!==(n=t.codecWidth)&&void 0!==n?n:192,r=null!==(i=t.codecHeight)&&void 0!==i?i:108,s=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 e.box(e.types.av01,s,e.box(e.types.av1C,o))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var n=t.id,i=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,i)},e.moof=function(t,n){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,n))},e.mfhd=function(t){var n=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,n)},e.traf=function(t,n){var i=t.id,o=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),r=e.sdtp(t),s=e.trun(t,r.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,o,a,s,r)},e.sdtp=function(t){for(var n=t.samples||[],i=n.length,o=new Uint8Array(4+i),a=0;a<i;a++){var r=n[a].flags;o[a+4]=r.isLeading<<6|r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy}return e.box(e.types.sdtp,o)},e.trun=function(t,n){var i=t.samples||[],o=i.length,a=12+16*o,r=new Uint8Array(a);n+=8+a,r.set([0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,255&o,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var s=0;s<o;s++){var c=i[s].duration,l=i[s].size,d=i[s].flags,u=i[s].cts;r.set([c>>>24&255,c>>>16&255,c>>>8&255,255&c,l>>>24&255,l>>>16&255,l>>>8&255,255&l,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.isNonSync,0,0,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*s)}return e.box(e.types.trun,r)},e.mdat=function(t){return e.box(e.types.mdat,t)},e.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:Ce,STSC:Ce,STCO:Ce,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])},e}();Ie.init();const xe=Ie,je=function(){function e(){}return e.getSilentFrame=function(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},e}();var Ae=n(453);const De=function(){function e(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 Ae.Sc("audio"),this._videoSegmentInfoList=new Ae.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!a.A.chrome||!(a.A.version&&a.A.version.major<50||a.A.version&&50===a.A.version.major&&((null===(t=a.A.version)||void 0===t?void 0:t.build)||0)<2661)),this._fillSilentAfterSeek=!(!a.A.msedge&&!a.A.msie),this._mp3UseMpegAudio=!a.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(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},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new d.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var n=null,i="mp4",o=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(i="mpeg",o="",n=new Uint8Array):n=xe.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,n=xe.generateInitSegment(t)}if(!this._onInitSegment)throw new d.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:n.buffer,codec:o,container:"".concat(e,"/").concat(i),mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){var n,i;this._dtsBaseInited||((null===(n=null==e?void 0:e.samples)||void 0===n?void 0:n.length)&&(this._audioDtsBase=e.samples[0].dts),(null===(i=null==t?void 0:t.samples)||void 0===i?void 0:i.length)&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,n={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(n.samples.push(e),n.length=null==e?void 0:e.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(i.samples.push(t),i.length=null==t?void 0:t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(n,!0),this._remuxAudio(i,!0)},e.prototype._remuxAudio=function(e,t){var n,i,r,s,c,l,d;if(null!=this._audioMeta){var u,m,h=e,p=h.samples,g=-1,f=this._audioMeta.refSampleDuration,v="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,y=this._dtsBaseInited&&void 0===this._audioNextDts,S=!1;if(p&&0!==p.length&&(1!==p.length||t)){var _=0,b=null,w=0;v?(_=0,w=h.length):(_=8,w=8+h.length);var T=null;if(p.length>1&&(w-=(T=p.pop()).length),null!=this._audioStashedLastSample){var E=this._audioStashedLastSample;this._audioStashedLastSample=null,p.unshift(E),w+=E.length}null!=T&&(this._audioStashedLastSample=T);var P=p[0].dts-this._dtsBase;if(this._audioNextDts)u=P-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())u=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(S=!0);else{var k=this._audioSegmentInfoList.getLastSampleBefore(P);if(null!=k){var C=P-(k.originalDts+k.duration);C<=3&&(C=0),u=P-(k.dts+k.duration+C)}else u=0}if(S){var I=P-u,x=this._videoSegmentInfoList.getLastSegmentBefore(P);if(null!=x&&x.beginDts<I){if(F=je.getSilentFrame(null===(n=this._audioMeta)||void 0===n?void 0:n.originalCodec,null===(i=this._audioMeta)||void 0===i?void 0:i.channelCount)){var j=x.beginDts,A=I-x.beginDts;o.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(j,", duration: ").concat(A)),p.unshift({unit:F,dts:j,pts:j}),w+=F.byteLength}}else S=!1}for(var D=[],R=0;R<p.length;R++){var L=(E=p[R]).unit,B=E.dts-this._dtsBase,M=(j=B,!1),O=null,z=0;if(!(B<-.001)){if("mp3"!==this._audioMeta.codec){var N=B;if(this._audioNextDts&&(N=this._audioNextDts),(u=B-N)<=-3*(f||0)){o.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(B," ms ,curRefDts: ").concat(N," ms) due to dtsCorrection: ").concat(u," ms overlap."));continue}if(u>=3*(f||0)&&this._fillAudioTimestampGap&&!a.A.safari){M=!0;var F,U=Math.floor(u/(f||0));o.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(B," ms, curRefDts: ").concat(N," ms, ")+"dtsCorrection: ".concat(Math.round(u)," ms, generate: ").concat(U," frames")),j=Math.floor(N),z=Math.floor(N+(f||0))-j,null==(F=je.getSilentFrame(null===(r=this._audioMeta)||void 0===r?void 0:r.originalCodec,this._audioMeta.channelCount))&&(o.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(s=this._audioMeta)||void 0===s?void 0:s.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),F=L),O=[];for(var V=0;V<U;V++){N+=f||0;var H=Math.floor(N),G=Math.floor(N+(f||0))-H,Z={dts:H,pts:H,cts:0,unit:F,size:F.byteLength,duration:G,originalDts:B,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};O.push(Z),w+=Z.size}this._audioNextDts=N+(f||0)}else j=Math.floor(N),z=Math.floor(N+(f||0))-j,this._audioNextDts=N+(f||0)}else j=B-u,z=R!==p.length-1?p[R+1].dts-this._dtsBase-u-j:null!=T?T.dts-this._dtsBase-u-j:D.length>=1?null===(c=D[D.length-1])||void 0===c?void 0:c.duration:Math.floor(f||0),this._audioNextDts=j+z;-1===g&&(g=j),D.push({dts:j,pts:j,cts:0,unit:E.unit,size:null===(l=E.unit)||void 0===l?void 0:l.byteLength,duration:z,originalDts:B,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),M&&D.push.apply(D,O)}}if(0===D.length)return h.samples=[],void(h.length=0);for(v?b=new Uint8Array(w):((b=new Uint8Array(w))[0]=w>>>24&255,b[1]=w>>>16&255,b[2]=w>>>8&255,b[3]=255&w,b.set(xe.types.mdat,4)),R=0;R<D.length;R++)L=D[R].unit,b.set(L,_),_+=L.byteLength||0;var W=D[D.length-1];m=W.dts+W.duration;var q,K=new Ae.EZ;K.beginDts=g,K.endDts=m,K.beginPts=g,K.endPts=m,K.originalBeginDts=D[0].originalDts,K.originalEndDts=W.originalDts+W.duration,K.firstSample=new Ae.$_(D[0].dts,D[0].pts,D[0].duration,D[0].originalDts,!1),K.lastSample=new Ae.$_(W.dts,W.pts,W.duration,W.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(K),h.samples=D,h.sequenceNumber++,q=v?new Uint8Array:xe.moof(h,g),h.samples=[],h.length=0;var J={type:"audio",data:this._mergeBoxes(q,b).buffer,sampleCount:D.length,info:K};v&&y&&J&&(J.timestampOffset=g),null===(d=this._onMediaSegment)||void 0===d||d.call(this,"audio",J)}}},e.prototype._remuxVideo=function(e,t){var n,i;if(null!=this._videoMeta){var o,a,r,s=e,c=s.samples,l=-1,d=-1;if(c&&0!==c.length&&(1!==c.length||t)){var u=8,m=null,h=8+e.length,p=null;if(c.length>1&&(h-=(p=c.pop()).length),null!=this._videoStashedLastSample){var g=this._videoStashedLastSample;this._videoStashedLastSample=null,c.unshift(g),h+=(null==g?void 0:g.length)||0}null!=p&&(this._videoStashedLastSample=p);var f=c[0].dts-this._dtsBase;if(this._videoNextDts)o=f-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())o=0;else{var v=this._videoSegmentInfoList.getLastSampleBefore(f);if(null!=v){var y=f-(v.originalDts+v.duration);y<=3&&(y=0),o=f-(v.dts+v.duration+y)}else o=0}for(var S=new Ae.EZ,_=[],b=0;b<c.length;b++){var w=(g=c[b]).dts-this._dtsBase,T=g.isKeyframe,E=w-o,P=g.cts,k=E+P;-1===l&&(l=E,d=k);var C=0;if(C=b!==c.length-1?c[b+1].dts-this._dtsBase-o-E:null!=p?p.dts-this._dtsBase-o-E:_.length>=1?_[_.length-1].duration:Math.floor((null===(n=this._videoMeta)||void 0===n?void 0:n.refSampleDuration)||0),T){var I=new Ae.$_(E,k,C,g.dts,!0);I.fileposition=g.fileposition,S.appendSyncPoint(I)}_.push({dts:E,pts:k,cts:P,units:g.units,size:g.length,isKeyframe:T,duration:C,originalDts:w,flags:{isLeading:0,dependsOn:T?2:1,isDependedOn:T?1:0,hasRedundancy:0,isNonSync:T?0:1}})}for((m=new Uint8Array(h))[0]=h>>>24&255,m[1]=h>>>16&255,m[2]=h>>>8&255,m[3]=255&h,m.set(xe.types.mdat,4),b=0;b<_.length;b++)for(var x=_[b].units;null==x?void 0:x.length;){var j=x.shift(),A=null==j?void 0:j.data;m.set(A,u),u+=A.byteLength}var D=_[_.length-1];if(a=D.dts+D.duration,r=D.pts+D.duration,this._videoNextDts=a,S.beginDts=l,S.endDts=a,S.beginPts=d,S.endPts=r,S.originalBeginDts=_[0].originalDts,S.originalEndDts=D.originalDts+D.duration,S.firstSample=new Ae.$_(_[0].dts,_[0].pts,_[0].duration,_[0].originalDts,!!_[0].isKeyframe),S.lastSample=new Ae.$_(D.dts,D.pts,D.duration,D.originalDts,!!D.isKeyframe),this._isLive||this._videoSegmentInfoList.append(S),s.samples=_,s.sequenceNumber++,this._forceFirstIDR){var R=_[0].flags;R.dependsOn=2,R.isNonSync=0}var L=xe.moof(s,l);s.samples=[],s.length=0,null===(i=this._onMediaSegment)||void 0===i||i.call(this,"video",{type:"video",data:this._mergeBoxes(L,m).buffer,sampleCount:_.length,info:S})}}},e.prototype._mergeBoxes=function(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n},e}();var Re=n(302),Le=n(716);const Be=function(){function e(e,t){var n;this.TAG="TransmuxingController",this._emitter=new i.A,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;var o=0;null===(n=this._mediaDataSource.segments)||void 0===n||n.forEach((function(n){n.timestampBase=o,o+=n.duration,n.cors=e.cors,n.withCredentials=e.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)})),isNaN(o)||this._mediaDataSource.duration===o||(this._mediaDataSource.duration=o),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){var e,t,n;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===(n=this._remuxer)||void 0===n||n.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){var n,i,o;if(this._currentSegmentIndex=e,null===(n=this._mediaDataSource)||void 0===n?void 0:n.segments){var a=null===(i=this._mediaDataSource)||void 0===i?void 0:i.segments[e],r=this._ioctl=new Re.A(a,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===(o=this._demuxer)||void 0===o||o.bindDataSource(this._ioctl):r.onDataArrival=this._onInitChunkArrival.bind(this),r.open(t)}},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isWorking())&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isPaused())&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){var t,n,i,o,a,r,s,c,l,d,u,m,h,p;if(null!=this._mediaInfo&&(null===(t=this._mediaInfo)||void 0===t?void 0:t.isSeekable())){var g=this._searchSegmentIndexContains(e);if(g===this._currentSegmentIndex){var f=(null===(n=this._mediaInfo)||void 0===n?void 0:n.segments)?null===(i=this._mediaInfo)||void 0===i?void 0:i.segments[g]:{};if(void 0===f)this._pendingSeekTime=e;else{var v=null==f?void 0:f.getNearestKeyframe(e);null===(o=this._remuxer)||void 0===o||o.seek(null==v?void 0:v.milliseconds),null===(a=this._ioctl)||void 0===a||a.seek(null==v?void 0:v.fileposition),this._pendingResolveSeekPoint=null==v?void 0:v.milliseconds}}else{var y=(null===(r=this._mediaInfo)||void 0===r?void 0:r.segments)?null===(s=this._mediaInfo)||void 0===s?void 0:s.segments[g]:{};void 0===y?(this._pendingSeekTime=e,this._internalAbort(),null===(c=this._remuxer)||void 0===c||c.seek(),null===(l=this._remuxer)||void 0===l||l.insertDiscontinuity(),this._loadSegment(g)):(v=y.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===(m=this._demuxer)||void 0===m||m.resetMediaInfo(),this._demuxer.timestampBase=(null===(h=this._mediaDataSource)||void 0===h?void 0:h.segments)?null===(p=this._mediaDataSource)||void 0===p?void 0:p.segments[g].timestampBase:0),this._loadSegment(g,null==v?void 0:v.fileposition),this._pendingResolveSeekPoint=null==v?void 0:v.milliseconds,this._reportSegmentMediaInfo(g))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){var t,n=this._mediaDataSource.segments,i=((null==n?void 0:n.length)||0)-1;if(0===((null==n?void 0:n.length)||0))return i;for(var o=0;o<((null==n?void 0:n.length)||0);o++)if(n&&e<((null===(t=n[o])||void 0===t?void 0:t.timestampBase)||0)){i=o-1;break}return i},e.prototype._onInitChunkArrival=function(e,t){var n,i,a,r,s,c=this,l=0;if(t>0)null===(n=this._demuxer)||void 0===n||n.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(i=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===i?void 0:i.timestampBase:0,l=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(e,t))||0;else{var d=null;(d=T.probe(e)).match&&(this._setupFLVDemuxerRemuxer(d),l=(null===(r=this._demuxer)||void 0===r?void 0:r.parseChunks(e,t))||0),d.match||(null==d?void 0:d.needMoreData)||(d=ke.probe(e)).match&&(this._setupTSDemuxerRemuxer(d),l=(null===(s=this._demuxer)||void 0===s?void 0:s.parseChunks(e,t))||0),d.match||(null==d?void 0:d.needMoreData)||(d=null,o.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){c._internalAbort()})),this._emitter.emit(Le.A.DEMUX_ERROR,g.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return l},e.prototype._setupFLVDemuxerRemuxer=function(e){var t;this._demuxer=new T(e,this._config),this._remuxer||(this._remuxer=new De(this._config));var n=this._mediaDataSource;void 0===n.duration||isNaN(n.duration)||(this._demuxer.overridedDuration=n.duration),"boolean"==typeof n.hasAudio&&(this._demuxer.overridedHasAudio=n.hasAudio),"boolean"==typeof n.hasVideo&&(this._demuxer.overridedHasVideo=n.hasVideo),n.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(t=null==n?void 0:n.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))},e.prototype._setupTSDemuxerRemuxer=function(e){var t=this._demuxer=new ke(e,this._config);this._remuxer||(this._remuxer=new De(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)},e.prototype._onMediaInfo=function(e){var t,n,i=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(n=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===n?void 0:n.length)||0,Object.setPrototypeOf(this._mediaInfo,r.A.prototype));var o=Object.assign({},e);Object.setPrototypeOf(o,r.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=o),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=i._pendingSeekTime;i._pendingSeekTime=null,i.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(Le.A.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(Le.A.SCRIPTDATA_ARRIVED,e)},e.prototype._onTimedID3Metadata=function(e){var t,n=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==n&&(void 0!==e.pts&&(e.pts-=n),void 0!==e.dts&&(e.dts-=n),this._emitter.emit(Le.A.TIMED_ID3_METADATA_ARRIVED,e))},e.prototype._onSMPTE2038Metadata=function(e){var t,n=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==n&&(void 0!==e.pts&&(e.pts-=n),void 0!==e.dts&&(e.dts-=n),void 0!==e.nearest_pts&&(e.nearest_pts-=n),this._emitter.emit(Le.A.SMPTE2038_METADATA_ARRIVED,e))},e.prototype._onSCTE35Metadata=function(e){var t,n=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==n&&(void 0!==e.pts&&(e.pts-=n),void 0!==e.nearest_pts&&(e.nearest_pts-=n),this._emitter.emit(Le.A.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(Le.A.PES_PRIVATE_DATA_DESCRIPTOR,e)},e.prototype._onPESPrivateData=function(e){var t,n=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==n&&(void 0!==e.pts&&(e.pts-=n),void 0!==e.nearest_pts&&(e.nearest_pts-=n),void 0!==e.dts&&(e.dts-=n),this._emitter.emit(Le.A.PES_PRIVATE_DATA_ARRIVED,e))},e.prototype._onIOSeeked=function(){var e;null===(e=this._remuxer)||void 0===e||e.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t,n,i=e+1;i<((null===(n=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===n?void 0:n.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(i)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(Le.A.LOADING_COMPLETE),this._disableStatisticsReporter())},e.prototype._onIORedirect=function(e){var t,n=null===(t=this._ioctl)||void 0===t?void 0:t.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[n].redirectedURL=e)},e.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(Le.A.RECOVERED_EARLY_EOF)},e.prototype._onIOException=function(e,t){o.A.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(Le.A.IO_ERROR,e,t),this._disableStatisticsReporter()},e.prototype._onDemuxException=function(e,t){o.A.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(Le.A.DEMUX_ERROR,e,t)},e.prototype._onRemuxerInitSegmentArrival=function(e,t){this._emitter.emit(Le.A.INIT_SEGMENT,e,t)},e.prototype._onRemuxerMediaSegmentArrival=function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(Le.A.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var n=t.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,a.A.safari&&n.length>0&&n[0].originalDts===i&&(i=n[0].pts),this._emitter.emit(Le.A.RECOMMEND_SEEKPOINT,i)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t,n,i,o,a=(null===(t=this._mediaInfo)||void 0===t?void 0:t.segments)?null===(n=this._mediaInfo)||void 0===n?void 0:n.segments[e]:{},r=Object.assign({},a);r.duration=null===(i=this._mediaInfo)||void 0===i?void 0:i.duration,r.segmentCount=null===(o=this._mediaInfo)||void 0===o?void 0:o.segmentCount,delete r.segments,delete r.keyframesIndex,this._emitter.emit(Le.A.MEDIA_INFO,r)},e.prototype._reportStatisticsInfo=function(){var e,t,n,i,o,a,r={};r.url=null===(e=this._ioctl)||void 0===e?void 0:e.currentURL,r.hasRedirect=null===(t=this._ioctl)||void 0===t?void 0:t.hasRedirect,r.hasRedirect&&(r.redirectedURL=null===(n=this._ioctl)||void 0===n?void 0:n.currentRedirectedURL),r.speed=null===(i=this._ioctl)||void 0===i?void 0:i.currentSpeed,r.loaderType=null===(o=this._ioctl)||void 0===o?void 0:o.loaderType,r.currentSegmentIndex=this._currentSegmentIndex,r.totalSegmentCount=null===(a=this._mediaDataSource.segments)||void 0===a?void 0:a.length,this._emitter.emit(Le.A.STATISTICS_INFO,r)},e}()},716:(e,t,n)=>{n.d(t,{A:()=>i});const i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},291:(e,t,n)=>{var i=n(641),o=n(976),a=n(716),r=null,s=function(e,t){self.postMessage({msg:"logcat_callback",data:{type:e,logcat:t}})};function c(e,t){var n={msg:a.A.INIT_SEGMENT,data:{type:e,data:t}};self.postMessage(n,[t.data])}function l(e,t){var n={msg:a.A.MEDIA_SEGMENT,data:{type:e,data:t}};self.postMessage(n,[t.data])}function d(){var e={msg:a.A.LOADING_COMPLETE};self.postMessage(e)}function u(){var e={msg:a.A.RECOVERED_EARLY_EOF};self.postMessage(e)}function m(e){var t={msg:a.A.MEDIA_INFO,data:e};self.postMessage(t)}function h(e){var t={msg:a.A.METADATA_ARRIVED,data:e};self.postMessage(t)}function p(e){var t={msg:a.A.SCRIPTDATA_ARRIVED,data:e};self.postMessage(t)}function g(e){var t={msg:a.A.TIMED_ID3_METADATA_ARRIVED,data:e};self.postMessage(t)}function f(e){var t={msg:a.A.SMPTE2038_METADATA_ARRIVED,data:e};self.postMessage(t)}function v(e){var t={msg:a.A.SCTE35_METADATA_ARRIVED,data:e};self.postMessage(t)}function y(e){var t={msg:a.A.PES_PRIVATE_DATA_DESCRIPTOR,data:e};self.postMessage(t)}function S(e){var t={msg:a.A.PES_PRIVATE_DATA_ARRIVED,data:e};self.postMessage(t)}function _(e){var t={msg:a.A.STATISTICS_INFO,data:e};self.postMessage(t)}function b(e,t){self.postMessage({msg:a.A.IO_ERROR,data:{type:e,info:t}})}function w(e,t){self.postMessage({msg:a.A.DEMUX_ERROR,data:{type:e,info:t}})}function T(e){self.postMessage({msg:a.A.RECOMMEND_SEEKPOINT,data:e})}self.addEventListener("message",(function(e){switch(e.data.cmd){case"init":(r=new o.A(e.data.param[0],e.data.param[1])).on(a.A.IO_ERROR,b),r.on(a.A.DEMUX_ERROR,w),r.on(a.A.INIT_SEGMENT,c),r.on(a.A.MEDIA_SEGMENT,l),r.on(a.A.LOADING_COMPLETE,d),r.on(a.A.RECOVERED_EARLY_EOF,u),r.on(a.A.MEDIA_INFO,m),r.on(a.A.METADATA_ARRIVED,h),r.on(a.A.SCRIPTDATA_ARRIVED,p),r.on(a.A.TIMED_ID3_METADATA_ARRIVED,g),r.on(a.A.SMPTE2038_METADATA_ARRIVED,f),r.on(a.A.SCTE35_METADATA_ARRIVED,v),r.on(a.A.PES_PRIVATE_DATA_DESCRIPTOR,y),r.on(a.A.PES_PRIVATE_DATA_ARRIVED,S),r.on(a.A.STATISTICS_INFO,_),r.on(a.A.RECOMMEND_SEEKPOINT,T);break;case"destroy":r&&(r.destroy(),r=null),self.postMessage({msg:"destroyed"});break;case"start":null==r||r.start();break;case"stop":null==r||r.stop();break;case"seek":null==r||r.seek(e.data.param);break;case"pause":null==r||r.pause();break;case"resume":null==r||r.resume();break;case"logging_config":var t=e.data.param;i.A.applyConfig(t),!0===t.enableCallback?i.A.addLogListener(s):i.A.removeLogListener(s)}}))},465:(e,t,n)=>{n.d(t,{A:()=>i});const i={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},133:(e,t,n)=>{n.d(t,{default:()=>G});var i={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},o=n(302),a={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function r(){return Object.assign({},a)}var s=function(){function e(){}return e.supportMSEH264Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},e.supportMSEH265Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},e.supportNetworkStreamIO=function(){var e=new o.A({},r()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"===t||"xhr-moz-chunked-loader"===t},e.getNetworkLoaderTypeName=function(){var e=new o.A({},r()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){void 0===e.videoElement&&(e.videoElement=window.document.createElement("video"));var n=e.videoElement.canPlayType(t);return"probably"===n||"maybe"===n},e.getFeatureList=function(){var t={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.msePlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName()||"",t.mseLivePlayback=t.msePlayback&&t.networkStreamIO,t.mseH265Playback=e.supportMSEH265Playback(),t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}();const c=s;var l=n(288),d=n(413),u=n(502),m=n(620);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",DESTROYING:"destroying"},p=function(){const e=ENTRY_MODULE,t={};function n(i){if(t[i])return t[i].exports;const o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.m=e,n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(const i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.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}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};const i=n(ENTRY_MODULE);return i.default||i};p.toString();const g="[\\.|\\-|\\+|\\w|/|@]+",f="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+g+").*?\\)";function v(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function y(e){return!isNaN(1*e)}function S(e,t,i){const o={};o[i]=[];const a=t.toString(),r=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!r)return o;const s=r[1];let c,l=new RegExp("(\\\\n|\\W)"+v(s)+f,"g");for(;c=l.exec(a);)"dll-reference"!==c[3]&&o[i].push(c[3]);for(l=new RegExp("\\("+v(s)+'\\("(dll-reference\\s('+g+'))"\\)\\)'+f,"g");c=l.exec(a);)e[c[2]]||(o[i].push(c[1]),e[c[2]]=n(c[1]).m),o[c[2]]=o[c[2]]||[],o[c[2]].push(c[4]);const d=Object.keys(o);for(let e=0;e<d.length;e++)for(let t=0;t<o[d[e]].length;t++)y(o[d[e]][t])&&(o[d[e]][t]=1*o[d[e]][t]);return o}function _(e){return Object.keys(e).reduce(((t,n)=>t||e[n].length>0),!1)}function b(e,t,n,i){const o=e[i].map((e=>`"${e}": ${t[i][e].toString()}`)).join(","),a=p.toString().split("ENTRY_MODULE");return`${a[0]}{${o}}${a[1]}"${n}"${a[2]}`}function w(e,t){t=t||{};const i={main:n.m},o=t.all?{main:Object.keys(i.main)}:function(e,t){const n={main:[t]},i={main:[]},o={main:{}};for(;_(n);){const t=Object.keys(n);for(let a=0;a<t.length;a++){const r=t[a],s=n[r].pop();if(o[r]=o[r]||{},o[r][s]||!e[r][s])continue;o[r][s]=!0,i[r]=i[r]||[],i[r].push(s);const c=S(e,e[r][s],r),l=Object.keys(c);for(let e=0;e<l.length;e++)n[l[e]]=n[l[e]]||[],n[l[e]]=n[l[e]].concat(c[l[e]])}}return i}(i,e);let a="";Object.keys(o).filter((e=>"main"!==e)).forEach((e=>{let t=0;for(;o[e][t];)t++;o[e].push(t),i[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a+=`var ${e} = (${b(o,i,t,modules)})();\n`})),a+=`(${b(o,i,e,"main")})();`;const r=new window.Blob([a],{type:"text/javascript"});if(t.bare)return r;const s=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(r),c=new window.Worker(s);return c.objectURL=s,c}var T=n(641),E=n(976),P=n(716),k=n(825),C=function(){function e(e,t){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new d.A,t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=w(291),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)},T.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:T.A.getConfig()})}catch(n){u.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new E.A(e,t)}else this._controller=new E.A(e,t);if(this._controller){var n=this._controller;null==n||n.on(P.A.IO_ERROR,this._onIOError.bind(this)),null==n||n.on(P.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==n||n.on(P.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==n||n.on(P.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==n||n.on(P.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==n||n.on(P.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==n||n.on(P.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==n||n.on(P.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==n||n.on(P.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==n||n.on(P.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==n||n.on(P.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==n||n.on(P.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==n||n.on(P.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==n||n.on(P.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==n||n.on(P.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==n||n.on(P.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){var e;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),T.A.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},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){var e;this._worker?this._worker.postMessage({cmd:"start"}):null===(e=this._controller)||void 0===e||e.start()},e.prototype.close=function(){var e;this._worker?this._worker.postMessage({cmd:"stop"}):null===(e=this._controller)||void 0===e||e.stop()},e.prototype.seek=function(e){var t;this._worker?this._worker.postMessage({cmd:"seek",param:e}):null===(t=this._controller)||void 0===t||t.seek(e)},e.prototype.pause=function(){var e;this._worker?this._worker.postMessage({cmd:"pause"}):null===(e=this._controller)||void 0===e||e.pause()},e.prototype.resume=function(){var e;this._worker?this._worker.postMessage({cmd:"resume"}):null===(e=this._controller)||void 0===e||e.resume()},e.prototype._onInitSegment=function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(P.A.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(P.A.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(P.A.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(P.A.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.TIMED_ID3_METADATA_ARRIVED,e)}))},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.SMPTE2038_METADATA_ARRIVED,e)}))},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.SCTE35_METADATA_ARRIVED,e)}))},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.PES_PRIVATE_DATA_DESCRIPTOR,e)}))},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.PES_PRIVATE_DATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(P.A.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(P.A.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(P.A.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,n=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 P.A.INIT_SEGMENT:case P.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,n.type,n.data);break;case P.A.LOADING_COMPLETE:case P.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case P.A.MEDIA_INFO:Object.setPrototypeOf(n,k.A.prototype),this._emitter.emit(t.msg,n);break;case P.A.METADATA_ARRIVED:case P.A.SCRIPTDATA_ARRIVED:case P.A.TIMED_ID3_METADATA_ARRIVED:case P.A.SMPTE2038_METADATA_ARRIVED:case P.A.SCTE35_METADATA_ARRIVED:case P.A.PES_PRIVATE_DATA_DESCRIPTOR:case P.A.PES_PRIVATE_DATA_ARRIVED:case P.A.STATISTICS_INFO:this._emitter.emit(t.msg,n);break;case P.A.IO_ERROR:case P.A.DEMUX_ERROR:this._emitter.emit(t.msg,n.type,n.info);break;case P.A.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,n);break;case"logcat_callback":u.A.emitter.emit("log",n.type,n.logcat)}},e}();const I=C,x="error",j="source_open",A="update_end",D="buffer_full";var R=n(453),L=n(713),B=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new d.A,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new R.EX}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new L.j4("MediaSource has been attached to an HTMLMediaElement!");var 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},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var n=this._pendingSegments[t];n.splice(0,n.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var i=this._sourceBuffers[t];if(i){if("closed"!==e.readyState){try{e.removeSourceBuffer(i)}catch(e){u.A.e(this.TAG,e.message)}null==i||i.removeEventListener("error",this.e.onSourceBufferError),null==i||i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){u.A.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)},e.prototype.appendInitSegment=function(e,t){var n;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var i=e,o="".concat(i.container);i.codec&&i.codec.length>0&&(o+=";codecs=".concat(i.codec));var a=!1;if(u.A.v(this.TAG,"Received Initialization Segment, mimeType: "+o),this._lastInitSegments[i.type]=i,o!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])u.A.v(this.TAG,"Notice: ".concat(i.type," mimeType changed, origin: ").concat(this._mimeTypes[i.type]||"",", target: ").concat(o));else{a=!0;try{var r=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(o);r.addEventListener("error",this.e.onSourceBufferError),r.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return u.A.e(this.TAG,e.message),void this._emitter.emit(x,{code:e.code,msg:e.message})}}this._mimeTypes[i.type]=o}t||this._pendingSegments[i.type].push(i),a||this._sourceBuffers[i.type]&&!(null===(n=this._sourceBuffers[i.type])||void 0===n?void 0:n.updating)&&this._doAppendSegments(),m.A.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var n=this._sourceBuffers[t.type];!n||n.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){var t,n;for(var i in this._sourceBuffers)if(this._sourceBuffers[i]){var o=this._sourceBuffers[i];if("open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState))try{null==o||o.abort()}catch(e){u.A.e(this.TAG,e.message)}this._idrList.clear();var a=this._pendingSegments[i];if(a.splice(0,a.length),"closed"!==(null===(n=this._mediaSource)||void 0===n?void 0:n.readyState)){if(o){for(var r=0;r<o.buffered.length;r++){var s=o.buffered.start(r),c=o.buffered.end(r);this._pendingRemoveRanges[i].push({start:s,end:c})}(null==o?void 0:o.updating)||this._doRemoveRanges()}if(m.A.safari){var l=this._lastInitSegments[i];l&&(this._pendingSegments[i].push(l),(null==o?void 0:o.updating)||this._doAppendSegments())}}}},e.prototype.endOfStream=function(){var e,t,n=this._mediaSource,i=this._sourceBuffers;n&&"open"===n.readyState?(null===(e=i.video)||void 0===e?void 0:e.updating)||(null===(t=i.audio)||void 0===t?void 0:t.updating)?this._hasPendingEos=!0:(this._hasPendingEos=!1,n.endOfStream()):n&&"closed"===n.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},e.prototype.getNearestKeyframe=function(e){return this._idrList.getLastSyncPointBeforeDts(e)},e.prototype._needCleanupSourceBuffer=function(){var e,t;if(!this._config.autoCleanupSourceBuffer)return!1;var n=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var i in this._sourceBuffers){var o=this._sourceBuffers[i];if(o){var a=o.buffered;if(a.length>=1&&n-a.start(0)>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0))return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e,t,n,i=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var o in this._sourceBuffers){var a=this._sourceBuffers[o];if(a){for(var r=a.buffered,s=!1,c=0;c<r.length;c++){var l=r.start(c),d=r.end(c);if(l<=i&&i<d+3){if(i-l>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0)){s=!0;var u=i-((null===(n=this._config)||void 0===n?void 0:n.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[o].push({start:l,end:u})}}else d<i&&(s=!0,this._pendingRemoveRanges[o].push({start:l,end:d}))}s&&!a.updating&&this._doRemoveRanges()}}},e.prototype._updateMediaSourceDuration=function(){var e,t,n,i,o=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)&&!(null===(n=o.video)||void 0===n?void 0:n.updating)&&!(null===(i=o.audio)||void 0===i?void 0:i.updating)){var a=this._mediaSource.duration,r=this._pendingMediaDuration;r>0&&(isNaN(a)||r>a)&&(u.A.v(this.TAG,"Update MediaSource duration from ".concat(a," to ").concat(r)),this._mediaSource.duration=r),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){var e;for(var t in this._pendingRemoveRanges)if(this._sourceBuffers[t]&&!(null===(e=this._sourceBuffers[t])||void 0===e?void 0:e.updating))for(var n=this._sourceBuffers[t],i=this._pendingRemoveRanges[t];i.length&&!(null==n?void 0:n.updating);){var o=i.shift();null==n||n.remove(o.start,o.end)}},e.prototype._doAppendSegments=function(){var e,t,n,i=this._pendingSegments;for(var o in i)if(this._sourceBuffers[o]&&!(null===(e=this._sourceBuffers[o])||void 0===e?void 0:e.updating)&&i[o].length>0){var a=i[o].shift();if(null==a?void 0:a.timestampOffset){var r=(null===(t=this._sourceBuffers[o])||void 0===t?void 0:t.timestampOffset)||0,s=a.timestampOffset/1e3;Math.abs(r-s)>.1&&(u.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(r," to ").concat(s)),this._sourceBuffers[o]&&(this._sourceBuffers[o].timestampOffset=s)),delete a.timestampOffset}if(!a.data||0===a.data.byteLength)continue;try{null===(n=this._sourceBuffers[o])||void 0===n||n.appendBuffer(a.data),this._isBufferFull=!1,"video"===o&&a.hasOwnProperty("info")&&this._idrList.appendArray(a.info.syncPoints)}catch(e){this._pendingSegments[o].unshift(a),22===e.code?(this._isBufferFull||this._emitter.emit(D),this._isBufferFull=!0):(u.A.e(this.TAG,e.message),this._emitter.emit(x,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){var e;if(u.A.v(this.TAG,"MediaSource onSourceOpen"),null===(e=this._mediaSource)||void 0===e||e.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var t=this._pendingSourceBufferInit;t.length;){var n=t.shift();this.appendInitSegment(n,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(j)},e.prototype._onSourceEnded=function(){u.A.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){u.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(A)},e.prototype._onSourceBufferError=function(e){u.A.e(this.TAG,"SourceBuffer Error: ".concat(e))},e}();const M=B;var O=n(465),z={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},N={NETWORK_EXCEPTION:l.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:l.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:l.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:l.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:O.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:O.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:O.A.CODEC_UNSUPPORTED},F=function(){function e(e,t){var n,i,o;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new d.A,this._config=r(),"object"==typeof t&&Object.assign(this._config,t);var a=e.type.toLowerCase();if("mse"!==a&&"mpegts"!==a&&"m2ts"!==a&&"flv"!==a)throw new L.Qn("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;var s=m.A.chrome&&(m.A.version&&(null===(n=m.A.version)||void 0===n?void 0:n.major)<50||m.A.version&&50===(null===(i=null===m.A||void 0===m.A?void 0:m.A.version)||void 0===i?void 0:i.major)&&((null===(o=null===m.A||void 0===m.A?void 0:m.A.version)||void 0===o?void 0:o.build)||-1)<2661);this._alwaysSeekKeyframe=!!(s||m.A.msedge||m.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return e.prototype.destroy=function(){this._emitter.emit(h.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var n=this;e===h.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){n._emitter.emit(h.MEDIA_INFO,n.mediaInfo)})):e===h.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){n._emitter.emit(h.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t,n,i,o,a,r=this;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 M(this._config),null===(t=this._msectl)||void 0===t||t.on(A,this._onmseUpdateEnd.bind(this)),null===(n=this._msectl)||void 0===n||n.on(D,this._onmseBufferFull.bind(this)),null===(i=this._msectl)||void 0===i||i.on(j,(function(){r._mseSourceOpened=!0,r._hasPendingLoad&&(r._hasPendingLoad=!1,r.load())})),null===(o=this._msectl)||void 0===o||o.on(x,(function(e){r._emitter.emit(h.ERROR,z.MEDIA_ERROR,N.MEDIA_MSE_ERROR,e)})),null===(a=this._msectl)||void 0===a||a.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){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)},e.prototype.load=function(){var e=this;if(!this._mediaElement)throw new L.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new L.j4("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(!this._config.deferLoadAfterSourceOpen||this._mseSourceOpened?(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new I(this._mediaDataSource,this._config),this._transmuxer.on(P.A.INIT_SEGMENT,(function(t,n){var i;null===(i=e._msectl)||void 0===i||i.appendInitSegment(n)})),this._transmuxer.on(P.A.MEDIA_SEGMENT,(function(t,n){var i,o,a;if(null===(i=e._msectl)||void 0===i||i.appendMediaSegment(n),e._config.lazyLoad&&!e._config.isLive){var r=null===(o=e._mediaElement)||void 0===o?void 0:o.currentTime;n.info.endDts>=1e3*(r+((null===(a=e._config)||void 0===a?void 0:a.lazyLoadMaxDuration)||0))&&null==e._progressChecker&&(u.A.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(P.A.LOADING_COMPLETE,(function(){var t;null===(t=e._msectl)||void 0===t||t.endOfStream(),e._emitter.emit(h.LOADING_COMPLETE)})),this._transmuxer.on(P.A.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(h.RECOVERED_EARLY_EOF)})),this._transmuxer.on(P.A.IO_ERROR,(function(t,n){e._emitter.emit(h.ERROR,z.NETWORK_ERROR,t,n)})),this._transmuxer.on(P.A.DEMUX_ERROR,(function(t,n){e._emitter.emit(h.ERROR,z.MEDIA_ERROR,t,{code:-1,msg:n})})),this._transmuxer.on(P.A.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(h.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(P.A.METADATA_ARRIVED,(function(t){e._emitter.emit(h.METADATA_ARRIVED,t)})),this._transmuxer.on(P.A.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(h.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(P.A.TIMED_ID3_METADATA_ARRIVED,(function(t){e._emitter.emit(h.TIMED_ID3_METADATA_ARRIVED,t)})),this._transmuxer.on(P.A.SMPTE2038_METADATA_ARRIVED,(function(t){e._emitter.emit(h.SMPTE2038_METADATA_ARRIVED,t)})),this._transmuxer.on(P.A.SCTE35_METADATA_ARRIVED,(function(t){e._emitter.emit(h.SCTE35_METADATA_ARRIVED,t)})),this._transmuxer.on(P.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(t){e._emitter.emit(h.PES_PRIVATE_DATA_DESCRIPTOR,t)})),this._transmuxer.on(P.A.PES_PRIVATE_DATA_ARRIVED,(function(t){e._emitter.emit(h.PES_PRIVATE_DATA_ARRIVED,t)})),this._transmuxer.on(P.A.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(h.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(P.A.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){var e;return function(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}c((i=i.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){return function(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var o=this._mediaElement.getVideoPlaybackQuality();n=o.totalVideoFrames,i=o.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e},e.prototype._onmseUpdateEnd=function(){var e,t,n,i,o=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,a=(null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime)||0;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&(null==o?void 0:o.length)>0&&!(null===(n=this._mediaElement)||void 0===n?void 0:n.paused)){var r=o.end(o.length-1);if(r>((null===(i=this._config)||void 0===i?void 0:i.liveBufferLatencyMaxLatency)||0)&&r-a>(this._config.liveBufferLatencyMaxLatency||0)){var s=r-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=s}}if(this._config.lazyLoad&&!this._config.isLive){for(var c=0,l=0;l<o.length;l++){var d=o.start(l),m=o.end(l);if(d<=a&&a<m){c=m;break}}c>=a+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(u.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){u.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e,t,n,i=(null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime)||0,o=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered,a=!1,r=0;r<o.length;r++){var s=o.start(r),c=o.end(r);if(i>=s&&i<c){i>=c-(this._config.lazyLoadRecoverDuration||0)&&(a=!0);break}}a&&(window.clearInterval(this._progressChecker),this._progressChecker=null,a&&(u.A.v(this.TAG,"Continue loading from paused position"),null===(n=this._transmuxer)||void 0===n||n.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t,n=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered,i=0;i<n.length;i++){var o=n.start(i),a=n.end(i);if(e>=o&&e<a)return!0}return!1},e.prototype._internalSeek=function(e){var t,n,i,o,a,r=this._isTimepointBuffered(e),s=!1,c=0;if(e<1&&(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered).length>0){var l=(null===(n=this._mediaElement)||void 0===n?void 0:n.buffered).start(0);(l<1&&e<l||m.A.safari)&&(s=!0,c=m.A.safari?.1:l)}if(s)this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=c);else if(r){if(this._alwaysSeekKeyframe){var d=null===(i=this._msectl)||void 0===i?void 0:i.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=null!=d?d.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===(o=this._msectl)||void 0===o||o.seek(e),null===(a=this._transmuxer)||void 0===a||a.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e))},e.prototype._checkAndApplyUnbufferedSeekpoint=function(){var e,t,n,i;if(this._seekpointRecord)if(((null===(e=this._seekpointRecord)||void 0===e?void 0:e.recordTime)||0)<=this._now()-100){var o=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(o)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),null===(n=this._msectl)||void 0===n||n.seek(o),null===(i=this._transmuxer)||void 0===i||i.seek(Math.floor(1e3*o)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=o)))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},e.prototype._checkAndResumeStuckPlayback=function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var n=t.buffered;n.length>0&&t.currentTime<n.start(0)&&(u.A.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(n.start(0))),this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=n.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress)))}else this._mediaElement&&this._mediaElement.removeEventListener("progress",this.e.onvProgress)},e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null)},e.prototype._onvSeeking=function(e){var t,n,i,o=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime,a=null===(n=this._mediaElement)||void 0===n?void 0:n.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(o<1&&a.length>0){var r=a.start(0);if(r<1&&o<r||m.A.safari)return this._requestSetTime=!0,void(this._mediaElement&&(m.A.safari?this._mediaElement.currentTime=.1:this._mediaElement.currentTime=r))}if(this._isTimepointBuffered(o)){if(this._alwaysSeekKeyframe){var s=null===(i=this._msectl)||void 0===i?void 0:i.getNearestKeyframe(Math.floor(1e3*o));null!=s&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=s.dts/1e3))}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:o,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},e.prototype._onvCanPlay=function(e){var t;this._receivedCanPlay=!0,null===(t=this._mediaElement)||void 0===t||t.removeEventListener("canplay",this.e.onvCanPlay)},e.prototype._onvStalled=function(e){this._checkAndResumeStuckPlayback(!0)},e.prototype._onvProgress=function(e){this._checkAndResumeStuckPlayback()},e}();const U=F,V=function(){function e(e,t){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new d.A,this._config=r(),"object"==typeof t&&Object.assign(this._config,t);var n=e.type.toLowerCase();if("mse"===n||"mpegts"===n||"m2ts"===n||"flv"===n)throw new L.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new L.Qn("NativePlayer(".concat(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}return e.prototype.destroy=function(){var e;this._emitter.emit(h.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,null===(e=this._emitter)||void 0===e||e.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var n=this;e===h.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(h.MEDIA_INFO,n.mediaInfo)})):e===h.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(h.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){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)},e.prototype.load=function(){var e;if(!this._mediaElement)throw new L.j4("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)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){var e;return function(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}c((i=i.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){return function(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var 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},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var o=this._mediaElement.getVideoPlaybackQuality();n=o.totalVideoFrames,i=o.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null),this._emitter.emit(h.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(h.STATISTICS_INFO,this.statisticsInfo)},e}();var H={createPlayer:function(e,t){(null==e?void 0:e.url)&&(e.url=function(e,t){void 0===t&&(t=["h264"]);var n=(t||["h264"]).reduce((function(e,t){return t=t.toLowerCase(),e+(i[t]||0)}),0),o=e.split("?")[0],a=e.split("?")[1];return a=(a||"").split("&").filter((function(e){return!/^vc=\d?/.test(e)})).join("&"),o+"?"+a+(a?"&":"")+"vc="+n}(e.url,["h264","h265"]));var n=e;if(null==n||"object"!=typeof n)throw new L.Qn("MediaDataSource must be an javascript object!");if(!Object.prototype.hasOwnProperty.call(n,"type"))throw new L.Qn("MediaDataSource must has type field to indicate video file type!");switch(n.type){case"mse":case"mpegts":case"m2ts":case"flv":return new U(n,t);default:return new V(n,t)}},isSupported:function(){return c.supportMSEH264Playback()},getFeatureList:function(){return c.getFeatureList()},BaseLoader:l.HC,LoaderStatus:l.eO,LoaderErrors:l.Xv,version:"",Events:h,ErrorTypes:z,ErrorDetails:N,MSEPlayer:U,NativePlayer:V,LoggingControl:T.A};Object.defineProperty(H,"version",{enumerable:!0,get:function(){return"2.0.1"}});const G=H},446:(e,t,n)=>{e.exports=n(133).default},302:(e,t,n)=>{n.d(t,{A:()=>S});var i=n(502);const o=function(){function e(){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}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(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())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0===e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();var a,r=n(288),s=n(620),c=n(713),l=(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});const d=function(e){function t(t,n){var i=e.call(this,"fetch-stream-loader")||this;return i.TAG="FetchStreamLoader",i._seekHandler=t,i._config=n,i._needStash=!0,i._requestAbort=!1,i._abortController=null,i._contentLength=null,i._receivedLength=0,i}return l(t,e),t.isSupported=function(){var e;try{var t=s.A.msedge&&((null===(e=null===s.A||void 0===s.A?void 0:s.A.version)||void 0===e?void 0:e.minor)||0)>=15048&&!s.A.webkit,n=!s.A.msedge||t;return self.fetch&&self.ReadableStream&&n}catch(e){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var n=this;this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(i=e.redirectedURL);var o=this._seekHandler.getConfig(i,t),a=new self.Headers;if("object"==typeof o.headers){var s=o.headers;for(var l in s)s.hasOwnProperty(l)&&a.append(l,s[l])}var d={method:"GET",headers:a,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var l in this._config.headers)a.append(l,this._config.headers[l]);e.cors||(d.mode="same-origin"),e.withCredentials&&(d.credentials="include"),(null==e?void 0:e.referrerPolicy)&&(d.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(d.signal=this._abortController.signal)),this._status=r.eO.kConnecting,self.fetch(o.url,d).then((function(e){var t,i;if(n._requestAbort)return n._status=r.eO.kIdle,void(null===(t=e.body)||void 0===t||t.cancel());if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==o.url&&n._onURLRedirect){var a=n._seekHandler.removeURLParameters(e.url);n._onURLRedirect(a)}var s=e.headers.get("Content-Length");return null!=s&&(n._contentLength=parseInt(s),0!==n._contentLength&&n._onContentLengthKnown&&n._onContentLengthKnown(n._contentLength)),n._pump.call(n,null===(i=e.body)||void 0===i?void 0:i.getReader())}if(n._status=r.eO.kError,!n._onError)throw new c.Al("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);n._onError(r.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){var t;if(!(null===(t=n._abortController)||void 0===t?void 0:t.signal.aborted)){if(n._status=r.eO.kError,!n._onError)throw e;n._onError(r.Xv.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){var e;if(this._requestAbort=!0,(this._status!==r.eO.kBuffering||!s.A.chrome)&&this._abortController)try{null===(e=this._abortController)||void 0===e||e.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(n){var i,o,a,s;if(n.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=r.eO.kError;var l=r.Xv.EARLY_EOF,d={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new c.Al(d.msg);t._onError(l,d)}else t._status=r.eO.kComplete,t._onComplete&&t._onComplete((null===(i=t._range)||void 0===i?void 0:i.from)||0,((null===(o=t._range)||void 0===o?void 0:o.from)||0)+t._receivedLength-1);else{if(null===(a=t._abortController)||void 0===a?void 0:a.signal.aborted)return void(t._status=r.eO.kComplete);if(t._requestAbort)return t._status=r.eO.kComplete,e.cancel();t._status=r.eO.kBuffering;var u=n.value.buffer,m=((null===(s=t._range)||void 0===s?void 0:s.from)||0)+t._receivedLength;t._receivedLength+=u.byteLength,t._onDataArrival&&t._onDataArrival(u,m,t._receivedLength),t._pump(e)}})).catch((function(e){var n,i;if(null===(i=null===(n=t._abortController)||void 0===n?void 0:n.signal)||void 0===i?void 0:i.aborted)t._status=r.eO.kComplete;else if(11!==e.code||!s.A.msedge){t._status=r.eO.kError;var o=0,a=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(o=r.Xv.EXCEPTION,a={code:e.code,msg:e.message}):(o=r.Xv.EARLY_EOF,a={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new c.Al(a.msg);t._onError(o,a)}}))},t}(r.HC);var u=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const m=function(e){function t(t,n){var i=e.call(this,"xhr-moz-chunked-loader")||this;return i.TAG="MozChunkedLoader",i._seekHandler=t,i._config=n,i._needStash=!0,i._xhr=null,i._requestAbort=!1,i._contentLength=null,i._receivedLength=0,i}return u(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return i.A.w("MozChunkedLoader",e.message),!1}},t.prototype.destroy=function(){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),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(n=e.redirectedURL);var i=this._seekHandler.getConfig(n,t);this._requestURL=i.url;var o=this._xhr=new XMLHttpRequest;if(o.open("GET",i.url,!0),o.responseType="moz-chunked-arraybuffer",o.onreadystatechange=this._onReadyStateChange.bind(this),o.onprogress=this._onProgress.bind(this),o.onloadend=this._onLoadEnd.bind(this),o.onerror=this._onXhrError.bind(this),e.withCredentials&&(o.withCredentials=!0),"object"==typeof i.headers){var a=i.headers;for(var s in a)a.hasOwnProperty(s)&&o.setRequestHeader(s,a[s])}if("object"==typeof this._config.headers)for(var s in a=this._config.headers)a.hasOwnProperty(s)&&o.setRequestHeader(s,a[s]);this._status=r.eO.kConnecting,o.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=r.eO.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!==t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var n=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(n)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=r.eO.kError,!this._onError)throw new c.Al("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(r.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=r.eO.kBuffering}},t.prototype._onProgress=function(e){var t;if(this._status!==r.eO.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var n=e.target.response,i=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._receivedLength;this._receivedLength+=n.byteLength,this._onDataArrival&&this._onDataArrival(n,i,this._receivedLength)}},t.prototype._onLoadEnd=function(e){this._requestAbort?this._requestAbort=!1:this._status!==r.eO.kError&&(this._status=r.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},t.prototype._onXhrError=function(e){this._status=r.eO.kError;var t=0,n=null;if(this._contentLength&&e.loaded<this._contentLength?(t=r.Xv.EARLY_EOF,n={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=r.Xv.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new c.Al(n.msg);this._onError(t,n)},t}(r.HC);var h=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const p=function(e){function t(t,n){var i=e.call(this,"xhr-range-loader")||this;return i.TAG="RangeLoader",i._seekHandler=t,i._config=n,i._needStash=!1,i._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],i._currentChunkSizeKB=384,i._currentSpeedNormalized=0,i._zeroSpeedChunkCount=0,i._xhr=null,i._speedSampler=new o,i._requestAbort=!1,i._waitForTotalLength=!1,i._totalLengthReceived=!1,i._currentRequestURL=null,i._currentRedirectedURL=null,i._currentRequestRange=null,i._totalLength=null,i._contentLength=null,i._receivedLength=0,i._lastTimeLoaded=0,i}return h(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return i.A.w("RangeLoader",e.message),!1}},t.prototype.destroy=function(){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),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),t.prototype.open=function(e,t){this._dataSource=e,this._range=t,this._status=r.eO.kConnecting;var n=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(n=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||n?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},t.prototype._openSubRange=function(){var e,t,n=1024*this._currentChunkSizeKB,i=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength,o=i+n;null!=this._contentLength&&o-this._range.from>=this._contentLength&&(o=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._contentLength-1),this._currentRequestRange={from:i,to:o},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var n=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?n=this._currentRedirectedURL:null!=e.redirectedURL&&(n=e.redirectedURL));var i=this._seekHandler.getConfig(n,t);this._currentRequestURL=i.url;var o=this._xhr=new XMLHttpRequest;if(o.open("GET",i.url,!0),o.responseType="arraybuffer",o.onreadystatechange=this._onReadyStateChange.bind(this),o.onprogress=this._onProgress.bind(this),o.onload=this._onLoad.bind(this),o.onerror=this._onXhrError.bind(this),e.withCredentials&&(o.withCredentials=!0),"object"==typeof i.headers){var a=i.headers;for(var r in a)a.hasOwnProperty(r)&&o.setRequestHeader(r,a[r])}if("object"==typeof this._config.headers)for(var r in a=this._config.headers)a.hasOwnProperty(r)&&o.setRequestHeader(r,a[r]);o.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=r.eO.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=r.eO.kBuffering}else{if(this._status=r.eO.kError,!this._onError)throw new c.Al("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(r.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==r.eO.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var n=e.total;this._internalAbort(),null!=n&&0!==n&&(this._totalLength=n)}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)}var i=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(i)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,n=t.length-1,i=0,o=0,a=n;if(e<t[0])return t[0];for(;o<=a;){if((i=o+Math.floor((a-o)/2))===n||e>=t[i]&&e<t[i+1])return t[i];t[i]<e?o=i+1:a=i-1}},t.prototype._onLoad=function(e){if(this._status!==r.eO.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){var n=this._normalizeSpeed(t);this._currentSpeedNormalized!==n&&(this._currentSpeedNormalized=n,this._currentChunkSizeKB=n)}var i=e.target.response,o=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():a=!0,this._onDataArrival&&this._onDataArrival(i,o,this._receivedLength),a&&(this._status=r.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},t.prototype._onXhrError=function(e){this._status=r.eO.kError;var t=0,n=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=r.Xv.EARLY_EOF,n={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=r.Xv.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new c.Al(n.msg);this._onError(t,n)},t}(r.HC);var g=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const f=function(e){function t(t,n){var i=e.call(this,"websocket-loader")||this;return i.TAG="WebSocketLoader",i._needStash=!0,i._ws=null,i._requestAbort=!1,i._receivedLength=0,i}return g(t,e),t.isSupported=function(){try{return void 0!==self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var 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.eO.kConnecting}catch(e){this._status=r.eO.kError;var n={code:e.code,msg:e.message};if(!this._onError)throw new c.Al(n.msg);this._onError(r.Xv.EXCEPTION,n)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=r.eO.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=r.eO.kBuffering},t.prototype._onWebSocketClose=function(e){this._requestAbort?this._requestAbort=!1:(this._status=r.eO.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1))},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var n=new FileReader;n.onload=function(){t._dispatchArrayBuffer(null==n?void 0:n.result)},n.readAsArrayBuffer(e.data)}else{this._status=r.eO.kError;var i={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new c.Al(i.msg);this._onError(r.Xv.EXCEPTION,i)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,n=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=r.eO.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new c.Al(t.msg);this._onError(r.Xv.EXCEPTION,t)},t}(r.HC),v=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var n,i={};return 0!==t.from||-1!==t.to?(n=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),i.Range=n):this._zeroStart&&(i.Range="bytes=0-"),{url:e,headers:i}},e.prototype.removeURLParameters=function(e){return e},e}(),y=function(){function e(e,t){this._startName=e,this._endName=t}return e.prototype.getConfig=function(e,t){var n=e;if(0!==t.from||-1!==t.to){var i=!0;n.includes("?")||(n+="?",i=!1),i&&(n+="&"),n+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(n+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:n,headers:{}}},e.prototype.removeURLParameters=function(e){var t,n=e.split("?")[0],i=e.indexOf("?");-1!==i&&(t=e.substring(i+1));var o="";if(void 0!==t&&t.length>0)for(var a=t.split("&"),r=0;r<a.length;r++){var s=a[r].split("="),c=r>0;s[0]!==this._startName&&s[0]!==this._endName&&(c&&(o+="&"),o+=a[r])}return 0===o.length?n:n+"?"+o},e}(),S=function(){function e(e,t,n){this.TAG="IOController",this._config=t,this._extraData=n,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 o,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){var e,t,n;(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&(null===(t=this._loader)||void 0===t||t.abort()),null===(n=this._loader)||void 0===n||n.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},e.prototype.isWorking=function(){var e;return(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){var e;return null===(e=this._dataSource)||void 0===e?void 0:e.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){var e;return null!=this._redirectedURL||void 0!==(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){var e;return this._redirectedURL||(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){var e,t;return this._loaderClass===p?null===(e=this._loader)||void 0===e?void 0:e.currentSpeed:null===(t=this._speedSampler)||void 0===t?void 0:t.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new v(!!this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",n=e.seekParamEnd||"bend";this._seekHandler=new y(t,n)}else{if("custom"!==e.seekType)throw new c.Qn("Invalid seekType in config: ".concat((null==e?void 0:e.seekType)||""));if("function"!=typeof e.customSeekHandler)throw new c.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){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=f;else if(d.isSupported())this._loaderClass=d;else if(m.isSupported())this._loaderClass=m;else{if(!p.isSupported())throw new c.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=p}},e.prototype._createLoader=function(){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)))},e.prototype.open=function(e){var t,n;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===(n=this._loader)||void 0===n||n.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){var e;null===(e=this._loader)||void 0===e||e.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){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)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){var n,i,o,a;(null===(n=this._loader)||void 0===n?void 0:n.isWorking())&&(null===(i=this._loader)||void 0===i||i.abort()),this._flushStashBuffer(t),null===(o=this._loader)||void 0===o||o.destroy(),this._loader=null;var r={from:e,to:-1};this._currentRange={from:r.from,to:-1},null===(a=this._speedSampler)||void 0===a||a.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,r),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new c.Qn("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var n=new ArrayBuffer(t);if(this._stashUsed>0){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(n,0,t).set(i,0)}this._stashBuffer=n,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,n=t.length-1,i=0,o=0,a=n;if(e<t[0])return t[0];for(;o<=a;){if((i=o+Math.floor((a-o)/2))===n||e>=t[i]&&e<t[i+1])return t[i];t[i]<e?o=i+1:a=i-1}},e.prototype._adjustStashSize=function(e){var t=0;(t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var n=1024*t+1048576;this._bufferSize<n&&this._expandBuffer(n),this._stashSize=1024*t},e.prototype._dispatchChunks=function(e,t){return this._currentRange&&(this._currentRange.to=t+e.byteLength-1),this._onDataArrival?this._onDataArrival(e,t):0},e.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},e.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},e.prototype._onLoaderChunkArrival=function(e,t,n){var i,o;if(!this._onDataArrival)throw new c.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),null===(i=this._speedSampler)||void 0===i||i.addBytes(e.byteLength);var a=null===(o=this._speedSampler)||void 0===o?void 0:o.lastSecondKBps;if(0!==a){var r=this._normalizeSpeed(a);this._speedNormalized!==r&&(this._speedNormalized=r,this._adjustStashSize(r))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize)(d=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;else if(d=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var s=this._stashBuffer.slice(0,this._stashUsed);(u=this._dispatchChunks(s,this._stashByteStart))<s.byteLength?u>0&&(m=new Uint8Array(s,u),d.set(m,0),this._stashUsed=m.byteLength,this._stashByteStart+=u):(this._stashUsed=0,this._stashByteStart+=u),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),d=new Uint8Array(this._stashBuffer,0,this._bufferSize)),d.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(u=this._dispatchChunks(e,t))<e.byteLength&&((l=e.byteLength-u)>this._bufferSize&&(this._expandBuffer(l),d=new Uint8Array(this._stashBuffer,0,this._bufferSize)),d.set(new Uint8Array(e,u),0),this._stashUsed+=l,this._stashByteStart=t+u);else if(0===this._stashUsed){var l;(u=this._dispatchChunks(e,t))<e.byteLength&&((l=e.byteLength-u)>this._bufferSize&&this._expandBuffer(l),(d=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,u),0),this._stashUsed+=l,this._stashByteStart=t+u)}else{var d,u;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(d=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(u=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&u>0){var m=new Uint8Array(this._stashBuffer,u);d.set(m,0)}this._stashUsed-=u,this._stashByteStart+=u}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart),o=t.byteLength-n;if(n<t.byteLength){if(!e){if(n>0){var a=new Uint8Array(this._stashBuffer,0,this._bufferSize),r=new Uint8Array(t,n);a.set(r,0),this._stashUsed=r.byteLength,this._stashByteStart+=n}return 0}i.A.w(this.TAG,"".concat(o," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,o}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){var n;switch(i.A.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=r.Xv.UNRECOVERABLE_EARLY_EOF),e){case r.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var o=((null===(n=this._currentRange)||void 0===n?void 0:n.to)||0)+1;return void(o<this._totalLength&&(i.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(o,!1)))}e=r.Xv.UNRECOVERABLE_EARLY_EOF;case r.Xv.UNRECOVERABLE_EARLY_EOF:case r.Xv.CONNECTING_TIMEOUT:case r.Xv.HTTP_STATUS_CODE_INVALID:case r.Xv.EXCEPTION:}if(!this._onError)throw new c.Al("IOException: "+t.msg);this._onError(e,t)},e}()},288:(e,t,n)=>{n.d(t,{HC:()=>r,Xv:()=>a,eO:()=>o});var i=n(713),o={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},a={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},r=function(){function e(e){this._type=e||"undefined",this._status=o.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=o.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===o.kConnecting||this._status===o.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new i.Xu("Unimplemented abstract function!")},e.prototype.abort=function(){throw new i.Xu("Unimplemented abstract function!")},e}()},620:(e,t,n)=>{n.d(t,{A:()=>o});var i={};!function(){var 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)||[],n=/(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)||[],o={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},a={};if(o.browser){a[o.browser]=!0;var r=o.majorVersion.split(".");a.version={major:parseInt(o.majorVersion,10),string:o.version},r.length>1&&(a.version.minor=parseInt(r[1],10)),r.length>2&&(a.version.build=parseInt(r[2],10))}if(o.platform&&(a[o.platform]=!0),(a.chrome||a.opr||a.safari)&&(a.webkit=!0),a.rv||a.iemobile){a.rv&&delete a.rv;var s="msie";o.browser=s,a[s]=!0}if(a.edge){delete a.edge;var c="msedge";o.browser=c,a[c]=!0}if(a.opr){var l="opera";o.browser=l,a[l]=!0}if(a.safari&&a.android){var d="android";o.browser=d,a[d]=!0}for(var u in a.name=o.browser,a.platform=o.platform,i)Object.prototype.hasOwnProperty.call(i,u)&&delete i[u];Object.assign(i,a)}();const o=i},713:(e,t,n)=>{n.d(t,{Al:()=>a,Qn:()=>s,Xu:()=>c,j4:()=>r});var i,o=(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(){function e(e){this.name="RuntimeException",this._message=e}return Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),r=function(e){function t(t){var n=e.call(this,t)||this;return n.name="IllegalStateException",n}return o(t,e),t}(a),s=function(e){function t(t){var n=e.call(this,t)||this;return n.name="InvalidArgumentException",n}return o(t,e),t}(a),c=function(e){function t(t){var n=e.call(this,t)||this;return n.name="NotImplementedException",n}return o(t,e),t}(a)},502:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(413);const o=function(){function e(){}return e.e=function(t,n){var i;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var o="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&(null===(i=e.emitter)||void 0===i||i.emit("log","error",o)),e.ENABLE_ERROR&&(console.error?console.error(o):console.warn?console.warn(o):console.log(o))},e.i=function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",i),e.ENABLE_INFO&&(console.info?console.info(i):console.log(i))},e.w=function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",i),e.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))},e.d=function(t,n){var i;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var o="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&(null===(i=e.emitter)||void 0===i||i.emit("log","debug",o)),e.ENABLE_DEBUG&&(console.debug?console.debug(o):console.log(o))},e.v=function(t,n){var i;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var o="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&(null===(i=e.emitter)||void 0===i||i.emit("log","verbose",o)),e.ENABLE_VERBOSE&&console.log(o)},e.FORCE_GLOBAL_TAG=!1,e.GLOBAL_TAG="ezuikit-flv",e.ENABLE_CALLBACK=!1,e.emitter=new i.A,e.ENABLE_ERROR=!0,e.ENABLE_INFO=!0,e.ENABLE_WARN=!0,e.ENABLE_DEBUG=!0,e.ENABLE_VERBOSE=!0,e}()},641:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(413),o=n(502);const a=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return o.A.FORCE_GLOBAL_TAG},set:function(t){o.A.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return o.A.GLOBAL_TAG},set:function(t){o.A.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return o.A.ENABLE_VERBOSE&&o.A.ENABLE_DEBUG&&o.A.ENABLE_INFO&&o.A.ENABLE_WARN&&o.A.ENABLE_ERROR},set:function(t){o.A.ENABLE_VERBOSE=t,o.A.ENABLE_DEBUG=t,o.A.ENABLE_INFO=t,o.A.ENABLE_WARN=t,o.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return o.A.ENABLE_DEBUG},set:function(t){o.A.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return o.A.ENABLE_VERBOSE},set:function(t){o.A.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return o.A.ENABLE_INFO},set:function(t){o.A.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return o.A.ENABLE_WARN},set:function(t){o.A.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return o.A.ENABLE_ERROR},set:function(t){o.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:o.A.GLOBAL_TAG,forceGlobalTag:o.A.FORCE_GLOBAL_TAG,enableVerbose:o.A.ENABLE_VERBOSE,enableDebug:o.A.ENABLE_DEBUG,enableInfo:o.A.ENABLE_INFO,enableWarn:o.A.ENABLE_WARN,enableError:o.A.ENABLE_ERROR,enableCallback:o.A.ENABLE_CALLBACK}},e.applyConfig=function(e){o.A.GLOBAL_TAG=e.globalTag,o.A.FORCE_GLOBAL_TAG=e.forceGlobalTag,o.A.ENABLE_VERBOSE=e.enableVerbose,o.A.ENABLE_DEBUG=e.enableDebug,o.A.ENABLE_INFO=e.enableInfo,o.A.ENABLE_WARN=e.enableWarn,o.A.ENABLE_ERROR=e.enableError,o.A.ENABLE_CALLBACK=!!e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var n=e.getConfig();t.emit("change",n)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){o.A.emitter.addListener("log",t),o.A.emitter.listenerCount("log")>0&&(o.A.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){o.A.emitter.removeListener("log",t),0===o.A.emitter.listenerCount("log")&&(o.A.ENABLE_CALLBACK=!1,e._notifyChange())},e.emitter=new i.A,e}()},413:(e,t,n)=>{n.d(t,{A:()=>i});const i=n(343)}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}return n.m=e,n.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(446)})();var U=z(F.exports=N());window.flvjs=U;var V=function(){return p((function e(t,n){u(this,e),console.log("isSupportFlv",window.flvjs.isSupported()),window.flvjs.isSupported()&&this.initFLV(t,n)}),[{key:"toString",value:function(){return"Flv ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initFLV",value:function(e,t){var n=L(t),i=n.deviceSerial,o=n.channelNo;n.hd;var a=n.type;window.ezuikitMonitor.report({protocol:"flv",url:t,serial:i,no:o,action:1,logInfo:{type:a}});var r=document.getElementById(e);r.getAttribute("controls")||r.setAttribute("controls",!0);var s=window.flvjs.createPlayer({type:"flv",url:t,isLive:!0},{enableStashBuffer:!0,stashInitialSize:128,enableWorker:!0});s.attachMediaElement(r),s.load(),s.play(),this.flvUrl=t,this.flv=s,this.video=r,this.video.addEventListener("oncanplaythrough",(function(){console.log("oncanplaythrough")}),!1),this.video.addEventListener("onerror",(function(){console.log("onerror")}),!1)}},{key:"play",value:function(){console.log("执行flv播放",this.video),this.video.play()}},{key:"stop",value:function(){this.video.pause(),this.flv.unload()}},{key:"destroy",value:function(){void 0!==this.flv&&null!==this.flv&&(this.flv.pause(),this.flv.unload(),this.flv.detachMediaElement(),this.flv.destroy(),this.flv=null)}}])}(),H=function(){function e(t,n){u(this,e),this.id=n,this.jSPlugin=t,this.state={play:!1,loading:!1,text:""},this.loadingSetText=this.loadingSetText,e._instanceStyle()}return p(e,[{key:"destroy",value:function(){}},{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=e,n=document.getElementById(t),i=n.offsetWidth,o=n.offsetHeight,a=n.offsetLeft;this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"map"==this.jSPlugin.Theme.inspectMode&&(a=0),document.getElementById("".concat(e,"-loading-id-0"))&&document.getElementById("".concat(e,"-loading-id-0")).parentNode.removeChild(document.getElementById("".concat(e,"-loading-id-0")));var r=document.createElement("div");r.setAttribute("id","".concat(e,"-loading-id-0"));var s="position:absolute;outline:none;pointer-events:none;";s+="width: 100%;background-size: cover; background-repeat:no-repeat;",s+="height: 100%;",s+="top:0;",s+="left:"+a+"px;",r.setAttribute("style",s),r.style.height=o,r.setAttribute("class","loading-container"),n.style.position="relative",this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"map"==this.jSPlugin.Theme.inspectMode&&(n.style.position="absolute"),n.appendChild(r);var c=document.createElement("div"),l=document.createElement("div");c.setAttribute("class","loading-item"),c.setAttribute("id","".concat(e,"-loading-item-0"));s="display:inline-flex;pointer-events:none;flex-direction:column;justify-content:center;align-items: center;width:100%;height:"+o+"px;outline:none;vertical-align: top;position:absolute;";function d(e,t,n,i){return{top:parseInt(i/n,10)*(e/n),left:i%n*(t/n)}}s+="left:"+d(o,i,1,0).left+"px;",s+="top:"+d(o,i,1,0).top+"px;",c.setAttribute("style",s);var u=1,m=document.createElement("div");l.innerHTML="",l.style.color="#fff",m.setAttribute("class","loading"),m.setAttribute("id","".concat(e,"-loading-icon"));var h='<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&&(u=this.jSPlugin.width/1024,h='<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*u,'" height="').concat(40*u,'"><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>')),m.innerHTML=h,c.appendChild(m),c.appendChild(l),r.appendChild(c)}},{key:"loadingStop",value:function(e){var t=document.getElementById("".concat(e,"-loading-item-0"));t&&document.getElementById("".concat(e,"-loading-icon"))&&t.removeChild(document.getElementById("".concat(e,"-loading-icon")))}},{key:"loadingSetText",value:function(e){var t=this;if(this.loadingClearText(),document.getElementById("".concat(this.id,"-loading-item-0"))){var n=document.getElementById("".concat(this.id,"-loading-item-0")),i=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes[1];if(i||(n.style.height="100%",(i=document.createElement("div")).innerHTML=e.text,n.appendChild(i)),i.id="".concat(this.id,"-loading-item-txt"),i.innerHTML=e.text,i.style.fontSize="14px",!this.jSPlugin.isMobile&&this.jSPlugin.isCall){var o=this.jSPlugin.width/1024;i.style.fontSize="".concat(28*o,"px"),i.style.marginTop="16px"}if(this.jSPlugin.isCall&&1==e.type){var a=document.getElementById("".concat(this.id,"-loading-item-txt")),r=document.createElement("div");r.style="margin-bottom: 8px;width:24px;height:24px;",r.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(r,a)}if(i.style.color=e.color||"#FFFFFF",i.style.padding="0 6%",i.style.textAlign="center",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 n=!!this.jSPlugin.Theme.call&&this.jSPlugin.Theme.call.themeData||null;(n&&(0===n.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 i=document.getElementById("".concat(this.id,"-loading-item-0"));if(i){i.style.height="100%",i.style["pointer-events"]="auto";var o=document.createElement("div");if(o.id="".concat(this.id,"-loading-item-txt"),o.innerHTML=e.text,o.title=e.text,o.style.color=e.color||"#FFFFFF",e.isMobile){var a=14*(this.jSPlugin.width/375);o.style.fontSize=a+"px"}else{var r=28*(this.jSPlugin.width/1024);o.style.fontSize=r+"px"}if(this.jSPlugin.isInspect&&(o.style="text-align: center; color: white; font-size: 14px; white-space: nowrap;overflow: hidden;text-overflow: ellipsis; width: 70%;"),i.appendChild(o),e.type&&2==e.type){var s=8,c=24;if(e.isMobile){c=24*(this.jSPlugin.width/375)}else{var l=this.jSPlugin.width/1024;s=l<1?16*l:16,c=40*l}var d=document.getElementById("".concat(this.id,"-loading-item-txt"));(h=document.createElement("div")).style="margin-bottom: ".concat(s,"px;width:").concat(c,"px;height:").concat(c,"px;"),h.innerHTML='<svg width="'.concat(c,'px" height="').concat(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="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(h,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&&this.jSPlugin.Theme&&"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 m=this.jSPlugin.width/1024;u.style="color:#648FFC;margin-top:16px;cursor: pointer;font-size:".concat(24*m,"px;"),this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"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(i.appendChild(u),e.isMobile&&1==e.type){var h,p=document.getElementById("".concat(this.id,"-loading-item-txt"));(h=document.createElement("div")).style="margin-bottom: 8px;width:24px;height:24px;",h.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(h,p)}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("".concat(this.id,"-loading-icon"))&&document.getElementById("".concat(this.id,"-loading-icon")).parentNode.removeChild(document.getElementById("".concat(this.id,"-loading-icon")))}}},{key:"loadingEnd",value:function(){var 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"}}],[{key:"_instanceStyle",value:function(){e._STYLE||(e._STYLE=document.createElement("style"),e._STYLE.id="ezuikit-status-style",e._STYLE.innerHTML="@keyframes antRotate {to {transform: rotate(400deg);transform-origin:50% 50%;}} .loading {display: inline-block;z-index: 1000;-webkit-animation: antRotate 1s infinite linear;animation: antRotate 1s infinite linear;}",document.getElementsByTagName("head")[0].appendChild(e._STYLE))}}])}();f(H,"_STYLE",void 0);var G=function(){function e(t){var n=this;if(u(this,e),this.jSPlugin=t,this.pluginStatus=new H(this,this.jSPlugin.id),this.showPtz=!1,document.getElementById(this.jSPlugin.id+"-ez-ptz-item"))return!1;var i=document.createElement("div");i.id=this.jSPlugin.id+"-ez-ptz-item",i.className="ez-ptz-wrap",i.style="display:none;",e._instanceStyle(),i.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="').concat(this.jSPlugin.i18n.t("PTZ_SPEED"),'">\n <div class="ez-ptzspeed-progress-line">\n <div class="ez-ptzspeed-progress-line-dot" id="').concat(this.jSPlugin.id,'-ptzspeed-slow-dot"></div>\n <div class="ez-ptzspeed-progress-line-dot active" id="').concat(this.jSPlugin.id,'-ptzspeed-mid-dot"></div>\n <div class="ez-ptzspeed-progress-line-dot" id="').concat(this.jSPlugin.id,'-ptzspeed-fast-dot"></div>\n </div>\n <div class="ez-ptzspeed-progress-points">\n <div class="ez-ptzspeed-progress-points-slow" id="').concat(this.jSPlugin.id,'-ptzspeed-slow">\n ').concat(this.jSPlugin.i18n.t("PTZ_SLOW"),'\n </div>\n <div class="ez-ptzspeed-progress-points-mid" id="').concat(this.jSPlugin.id,'-ptzspeed-mid">\n ').concat(this.jSPlugin.i18n.t("PTZ_MID"),'\n </div>\n <div class="ez-ptzspeed-progress-points-fast" id="').concat(this.jSPlugin.id,'-ptzspeed-fast">\n ').concat(this.jSPlugin.i18n.t("PTZ_FAST"),'\n </div>\n </div>\n </div>\n </div>\n <div class="ez-ptzbtn-container">\n <div class="ez-ptzbtn-zoom" title="').concat(this.jSPlugin.i18n.t("DEVICE_ZOOM"),'" 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="').concat(this.jSPlugin.i18n.t("DEVICE_FOCUS"),'" 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(i),document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),console.log("点击开始"),n._handlePtzTouch(e,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),console.log("触摸结束"),n._handlePtzTouch(e,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).onmouseup=function(e){e.target.id&&(e.target.id.indexOf("slow")>-1&&(n.jSPlugin.ptzSpeed=n.jSPlugin.ptzSpeedOptions?n.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-slow-dot")).classList.add("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),e.target.id.indexOf("mid")>-1&&(n.jSPlugin.ptzSpeed=n.jSPlugin.ptzSpeedOptions?n.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-mid-dot")).classList.add("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),e.target.id.indexOf("fast")>-1&&(n.jSPlugin.ptzSpeed=n.jSPlugin.ptzSpeedOptions?n.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(n.jSPlugin.id,"-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&&(n.jSPlugin.ptzSpeed=n.jSPlugin.ptzSpeedOptions?n.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-slow-dot")).classList.add("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),e.target.id.indexOf("mid")>-1&&(n.jSPlugin.ptzSpeed=n.jSPlugin.ptzSpeedOptions?n.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-mid-dot")).classList.add("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-fast-dot")).classList.remove("active")),e.target.id.indexOf("fast")>-1&&(n.jSPlugin.ptzSpeed=n.jSPlugin.ptzSpeedOptions?n.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-slow-dot")).classList.remove("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-mid-dot")).classList.remove("active"),document.getElementById("".concat(n.jSPlugin.id,"-ptzspeed-fast-dot")).classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmousedown=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmouseup=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("focal","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchend=function(e){e.preventDefault(),e.stopPropagation(),n._handleBtnTouch("focal","sub","stop")}}return p(e,[{key:"destroy",value:function(){}},{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 n=this,i=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).getBoundingClientRect(),o=i.left+41,a=i.top+41,r=e.x||e.changedTouches[0].clientX,s=e.y||e.changedTouches[0].clientY,c=0,l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",d=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,u=0;function m(e,t){var n=Math.atan2(t,e);n<0&&(n+=2*Math.PI);var i=n*(180/Math.PI)-225-12.5;return i<0&&(i+=360),Math.floor(i/45)+1}if(/^rotate\(90/.test(document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.transform))switch(m(r-o,s-a)){case 1:c=2,u=90;break;case 2:c=4,u=135;break;case 3:c=0,u=180;break;case 4:c=6,u=225;break;case 5:c=3,u=270;break;case 6:c=7,u=315;break;case 7:c=1,u=0;break;case 8:c=5,u=45}else switch(m(r-o,s-a)){case 1:c=0,u=180;break;case 2:c=6,u=225;break;case 3:c=3,u=270;break;case 4:c=7,u=315;break;case 5:c=1,u=0;break;case 6:c=5,u=45;break;case 7:c=2,u=90;break;case 8:c=4,u=135}document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(u,"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)"),"stop"===t&&(l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",d=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="");var h=new FormData;h.append("deviceSerial",R(this.jSPlugin.url).deviceSerial),h.append("channelNo",R(this.jSPlugin.url).channelNo),h.append("speed",this.jSPlugin.ptzSpeed),h.append("direction",c),h.append("accessToken",d),fetch(l,{method:"POST",body:h}).then((function(e){return e.json()})).then((function(e){if("start"===t&&200!=e.code){console.log(e.code,n.jSPlugin.i18n.t("38"+e.code));var i=n.jSPlugin.i18n.t("38"+e.code)||e.msg;n.pluginStatus.loadingSetText({text:i,color:"red",delayClear:2e3})}60005!=e.code&&60002!=e.code&&60003!=e.code&&60004!=e.code&&60006!=e.code||(document.getElementById("".concat(n.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(u,"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"))})).catch((function(e){console.log("云台调用异常",e)}))}},{key:"_handleBtnTouch",value:function(e,t,n){var i=this,o=8;o="zoom"===e?"add"===t?8:9:"add"===t?10:11;var a=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",r=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;"stop"===n&&(a=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",r=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video);var s=new FormData;s.append("deviceSerial",R(this.jSPlugin.url).deviceSerial),s.append("channelNo",R(this.jSPlugin.url).channelNo),s.append("speed",this.jSPlugin.ptzSpeed),s.append("direction",o),s.append("accessToken",r),fetch(a,{method:"POST",body:s}).then((function(e){return e.json()})).then((function(t){"start"===n&&200!=t.code&&(6e4==t.code||60006==t.code?i.pluginStatus.loadingSetText({text:"zoom"===e?i.jSPlugin.i18n.t("NOT_SUPPORT_DEVICE_ZOOM"):i.jSPlugin.i18n.t("NOT_SUPPORT_FOCUS"),color:"red",delayClear:2e3}):i.pluginStatus.loadingSetText({text:t.msg,color:"red",delayClear:2e3}))})).catch((function(e){}))}}],[{key:"_instanceStyle",value:function(){if(!e._STYLE){e._STYLE=document.createElement("style"),e._STYLE.id="ezuikit-ptz-style";var t=M();e._STYLE.innerHTML="\n .ez-ptz-container {\n position: relative;\n width: 80px;\n height: 80px;\n background: rgba(255, 255, 255, 0.70);\n box-shadow: 0px 0px 33px 4px rgb(0 0 0 / 15%);\n border: 1px solid rgba(255, 255, 255, 0.70);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n user-select: none;\n }\n .ez-ptz-container .ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n top: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.top.active {\n border-bottom-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n bottom: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom.active {\n border-top-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-left: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n right: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.right.active {\n border-left-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-right: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n left: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-main.center {\n width: 23px;\n height: 23px;\n background: #407AFF;\n border-radius: 100%;\n top: calc(50% - 12.4px);\n left: calc(50% - 12.4px);\n position: absolute;\n }\n\n .ez-ptz-wrap {\n position: absolute;\n right: 0px;\n top: 0;\n width: 85px;\n height: 100%;\n padding: 0 20px;\n flex-direction: column;\n justify-content: center;\n background: rgba(0,0,0,0.9);\n box-sizing: content-box !important;\n }\n\n .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }\n\n .ez-ptzspeed-progress-line{\n height: 1px;\n background: #ffffff;\n margin: 16px 0 8px;\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-line-dot{\n width: 5px;\n height: 5px;\n border: 2px solid #ffffff;\n border-radius: 50%;\n background: #ffffff;\n margin: -3px 0;\n cursor: pointer;\n }\n\n .ez-ptzspeed-progress-line-dot.active{\n border-color: #407AFF;\n }\n \n .ez-ptzspeed-progress-points{\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-points-slow{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-mid{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-fast{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzbtn-container{\n width: 100%;\n height:".concat(t?"60px":"18px",";\n margin-top: 14px;\n display: ").concat(t?"block":"flex",";\n }\n\n .ez-ptzbtn-focal,\n .ez-ptzbtn-zoom{\n width: ").concat(t?"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?"50%":"24px",";\n height: 20px;\n cursor: pointer;\n text-align: center;\n }\n\n .ez-ptzbtn-zoom{\n margin: ").concat(t?"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(e._STYLE)}}}])}();f(G,"_STYLE",void 0);var Z=function(){function e(t,n){u(this,e),this.jSPlugin=t,this.heightPop=n||366,e._instanceStyle(),this.initPopupCustom()}return p(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,n=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.createElement("div");i.style="display:flex;",i.id="".concat(this.jSPlugin.id,"-wrap-popup-custom"),i.innerHTML='<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(i),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)}}],[{key:"_instanceStyle",value:function(){if(!e._STYLE){var t=document.documentElement.clientWidth/375||1;e._STYLE=document.createElement("style"),e._STYLE.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;}"),document.getElementsByTagName("head")[0].appendChild(e._STYLE)}}}])}();f(Z,"_STYLE",void 0);var W=function(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(n){t.state[n]=e[n],"scrollTop"===n&&document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.scrollTo(0,e[n]),"current"===n&&document.getElementById("time-line-current")&&(document.getElementById("time-line-current").innerHTML=e[n])}))},this.setDisabled=function(e){this.setState({disabled:e}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.style.overflowY=e?"hidden":"scroll")},this.timeToSecond=function(e){var t=e.split(":"),n=Number(t[0]),i=Number(t[1]),o=Number(t[2]);return 60*n*60+60*i+(o||0)},this.minuteToTime=function(e){var t=Math.floor(e/60),n=e%60;return(t>9?t:"0"+t)+":"+(n>9?n:"0"+n)},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/),n=e.indexOf("iPad")>-1,i=e.indexOf("iPhone")>-1||e.indexOf("Mac")>-1;return!!(t||n||i)},this.checkIsHarmonyOS=function(){return navigator.userAgent.indexOf("ohos")>-1},this.checkIsHarmonyOS()?(document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchstart",(function(){if(t.state.disabled)return!1;e.ontouchstart()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchmove",(function(){if(t.state.disabled)return!1;e.ontouchmove()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchend",(function(){if(t.state.disabled)return!1;var n;new Promise((function(e,t){var i=-1;n=setInterval((function(){var t,o,a=null===(t=document.getElementById("time-line-item"))||void 0===t||null===(o=t.parentNode)||void 0===o?void 0:o.scrollTop;a!==i?(console.log("scolling",a,i),i=a):(console.log("scoll stop",a,i),clearInterval(n),e(a))}),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")&&(document.getElementById("time-line-item").parentNode.ontouchstart=function(){if(t.state.disabled)return!1;e.ontouchstart()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchmove=function(){if(t.state.disabled)return!1;e.ontouchmove()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchend=function(){if(t.state.disabled)return!1;var n;new Promise((function(e,t){var i=-1;n=setInterval((function(){var t,o,a=null===(t=document.getElementById("time-line-item"))||void 0===t||null===(o=t.parentNode)||void 0===o?void 0:o.scrollTop;a!==i?(console.log("scolling",a,i),i=a):(console.log("scoll stop",a,i),clearInterval(n),e(a))}),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()};W.prototype.changeScale=function(e){this.setState({timelag:e}),this.matchTimeDot()},W.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}),this.matchRecTimeDot(),this.primaryOffsetH()):(this.setState({availTimeLine:[]}),this.matchRecTimeDot())},W.prototype.matchTimeDot=function(){var e=this.state;e.start;var t=e.end,n=e.timelag;e.availTimeLine;for(var i=[],o=this.timeToMinute(t),a=o=Math.floor(o/n)*n;a>=0;){var r=0,s=0;a==o&&(r=70),0==a&&(s=230);var c=this.minuteToTime(a);i.push({id:a,current:c,label:"a"+a,marginTop:r,marginBottom:s,recArr:[]}),a-=n}this.setState({timeArr:i}),this.renderDateLine()},W.prototype.matchRecTimeDot=function(){var e=this.state,t=e.start,n=e.end,i=e.timelag,o=e.availTimeLine,a=e.timeArr;console.log("start",t,"end",n);var r=o.length;if(0===r)for(var s=0;s<a.length;s++)a[s].recArr=[];else{for(var c=0;c<a.length;c++)a[c].recArr=[];for(var l=0;l<r;l++){var d,u,m,h,p=o[l],g=this.timeToSecond(p.st),f=this.timeToSecond(p.et);m=(g-60*(d=Math.floor(g/(60*i))*i))/i,h=(f-60*(u=Math.floor(f/(60*i))*i))/i;for(s=0;s<a.length;s++)if(a[s].id==d&&a[s].id==u){var v=h-m,y=60-h;a[s].recArr.push({height:v,top:y})}else a[s].id==d?a[s].recArr.push({height:60-m,top:0}):a[s].id==u?a[s].recArr.push({height:h,top:60-h}):a[s].id>d&&a[s].id<u&&a[s].recArr.push({height:60,top:0})}}this.setState({timeArr:a}),this.renderDateLine()},W.prototype.renderDateLine=function(){var e=this.state;e.id;var t=e.timeArr,n=document.getElementById("time-line-item");n.innerHTML="",t.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 o='<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){o+='<div class="item-unavail" style="height: '.concat(e.height,"px;background-color:#A8B9ED; top: ").concat(e.top,'px"></div>')})),o+="<div id=".concat(e.label,' style="position: relative; top: 51px; left: 40%"> ').concat(e.current,"</div>"),i.innerHTML=o,n.appendChild(i)}))},W.prototype.primaryOffsetH=function(){var e=this.state,t=e.start,n=e.timelag,i=e.timeArr[0].current,o=this.timeToSecond(i)-this.timeToSecond(t),a=Math.ceil(o/n)+60;this.setState({scrollTop:a}),console.log("起始偏移量",a)},W.prototype.currentOffsetH=function(){var e=this.state,t=e.current,n=e.timelag,i=e.timeArr[0].current,o=this.timeToSecond(i)-this.timeToSecond(t),a=Math.ceil(o/n)+60;this.setState({scrollTop:a})},W.prototype.rectTopTotime=function(e){var t,n,i=this.state.timelag,o=Math.floor(e/60),a=e-60*o;if(console.log("index:",o,"offsetH:",a),0==a)t=this.state.timeArr[o-1].current,n=0;else{var r=this.state.timeArr[o].current,s=this.timeToMinute(r),c=(60-a)*i,l=Math.floor(c/60)+s,d=60*Math.floor(c/60);n=Math.ceil(c-d),t=this.minuteToTime(l)}this.setState({current:t+":"+(n>9?n:"0"+n),scrollTop:e})},W.prototype.stepScrollTimeLine=function(e){this.setState({current:e}),this.currentOffsetH()},W.prototype.secondCountDown=function(e){var t=this.state.current.split(":"),n=60*Number(t[0])*60+60*Number(t[1])+Number(t[2])+1,i=Math.floor(n/3600),o=Math.floor((n-3600*i)/60),a=n-3600*i-60*o;this.setState({current:(i>9?i:"0"+i)+":"+(o>9?o:"0"+o)+":"+(a>9?a:"0"+a)})};var q=W,K="https://open.ys7.com",J=256,Y=1536,X=2304,Q=[{place:3,name:"鱼眼不矫正",type:0,correctType:0},{place:3,name:"360°全景",type:1,correctType:768},{place:3,name:"4分屏",type:4,correctList:[{correctType:J,x:.25,y:.25},{correctType:J,x:.75,y:.25},{correctType:J,x:.25,y:.75},{correctType:J,x:.75,y:.75}],correctType:J},{place:3,name:"柱状",type:5,correctType:Y,viewParam:{x:0,y:0}}],ee=[{place:1,name:"鱼眼不矫正",type:0,correctType:0},{place:1,name:"360°全景",type:1,correctType:768},{place:1,name:"4分屏",type:2,correctList:[{correctType:J,x:.25,y:.25},{correctType:J,x:.75,y:.25},{correctType:J,x:.25,y:.75},{correctType:J,x:.75,y:.75}],correctType:J},{place:1,name:"广角",type:4,correctType:X}];var te=K,ne=function(){return p((function e(t){return u(this,e),e.instant?e.instant:(te=t||te,e.instant=this)}),[{key:"setDomain",value:function(e){te=e||te}},{key:"fetch",value:function(e){function t(t,n){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:te+e:e,new Promise((function(n,i){fetch(e,t).then((function(e){try{return e.json()}catch(e){i({code:-1,msg:"data json parse error"})}})).then((function(e){200==+e.code||e.meta&&200===e.meta.code?n(e):i(e)})).catch((function(e){i(e)}))}))}))}])}();function ie(e){var t=e.slice(0,4),n=e.slice(4,6),i=e.slice(6,8),o=e.slice(8,10),a=e.slice(10,12),r=e.slice(12,14);return new Date("".concat(t,"/").concat(n,"/").concat(i," ").concat(o,":").concat(a,":").concat(r))}function oe(e,t){var n,i,o={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},a=Object.keys(o).reduce((function(e,t){return null==o[t]?e:e+="&".concat(t,"=").concat(encodeURIComponent(o[t]))}),"").replace("&",""),r=e.env.domain+"/api/service/cloudrecord/video/info/list?".concat(a);return(n=r,i={method:"get",headers:{accessToken:e.accessToken||e.token.deviceToken.global,deviceSerial:t.deviceSerial,localIndex:t.channelNo}},new Promise((function(e,t){fetch(n,i).then((function(e){return e.json()})).then((function(n){200==+n.code||n.meta&&200===n.meta.code?e(n):t(n)})).catch((function(e){t(e)}))}))).then((function(e){return e.data=(e.data||[]).map((function(e){return e.endTime=ie(e.stopTime).getTime(),e.startTime=ie(e.startTime).getTime(),e.busType=7,e})),e}))}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(t<=-24||t>=24)&&(t=0);var n=e.slice(0,4),i=e.slice(4,6),o=e.slice(6,8),a=e.slice(8,10),r=e.slice(10,12),s=e.slice(12,14),c=new Date(n,i-1,o,a,r,s);c.setHours(c.getHours()+t),c>new Date&&(c=new Date);var l=c.getFullYear(),d=("0"+(c.getMonth()+1)).slice(-2),u=("0"+c.getDate()).slice(-2),m=("0"+c.getHours()).slice(-2),h=("0"+c.getMinutes()).slice(-2),p=("0"+c.getSeconds()).slice(-2);return new Date("".concat(l,"/").concat(d,"/").concat(u," ").concat(m,":").concat(h,":").concat(p))}f(ne,"instant",void 0);var re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(t<=-24||t>=24)&&(t=0);var n=60*t*60*1e3,i=e.getTime()+n;return new Date(i)},se=function(){return p((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{rejection:!1,play:!1,pantile:!1,recordvideo:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1};u(this,e),this.id=t,this.state=n}),[{key:"getState",value:function(){return this.state}},{key:"setState",value:function(e){this.state=y(y({},this.state),e)}}])}(),ce=new(function(){return p((function e(){var t=this;u(this,e),f(this,"createInstance",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.instances.has(e)&&(console.warn("Instance with id ".concat(e," already exists.")),t.removeInstance(e));var i=new se(e,n);t.instances.set(e,i)})),f(this,"getInstance",(function(e){return t.instances.has(e)?t.instances.get(e):(console.warn("Instance with id ".concat(e," does not exist.")),null)})),f(this,"removeInstance",(function(e){if(!t.instances.has(e))return console.warn("Instance with id ".concat(e," does not exist.")),null;t.instances.delete(e)})),f(this,"listInstances",(function(){return Array.from(t.instances.values())})),this.instances=new Map,this.globalState={talk:!1,expend:!1,webExpend:!1,sound:!1}}),[{key:"getGlobalState",value:function(){return this.globalState}},{key:"setGlobalState",value:function(e){this.globalState=y(y({},this.globalState),e)}}])}());function le(e){var t=new Date(e),n=t.getHours(),i=t.getMinutes(),o=t.getSeconds();return(n>9?n:"0"+n)+":"+(i>9?i:"0"+i)+":"+(o>9?o:"0"+o)}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 n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e};var de=function(){function e(t,n,i){if(u(this,e),this.changeRecSpeed=n,this.resetMobileZoomStatus=i,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=R(this.jSPlugin.url).type,this.operating=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.recList=[],this.isSeeking=!1,this.datepickerLang={zh:"zh-CN",en:"en-US"},this.datepickerVisible=!1,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),e._instanceStyle(),j("begin",this.jSPlugin.url)){var o=j("begin",this.jSPlugin.url);this.date=o.slice(0,4)+"/"+o.slice(4,6)+"/"+o.slice(6,8),this.begin=this.date+" ".concat(o.slice(8,10)||"00",":").concat(o.slice(10,12)||"00",":").concat(o.slice(12,14)||"00"),this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(j("end",this.jSPlugin.url)){var a=j("end",this.jSPlugin.url);this.end=this.date+" ".concat(a.slice(8,10)||"23",":").concat(a.slice(10,12)||"59",":").concat(a.slice(12,14)||"59"),this.initEnd=this.end}this.recInit()}return p(e,[{key:"recInit",value:function(){this.createDom(),this.initTimeLine(),this.fetchDeviceRec(),this.injectJsCss(this.jSPlugin),this.syncTimeLine(),this.bindEvent()}},{key:"injectJsCss",value:function(e){this.unInjectJsCss();var t=this,n=document.getElementById("".concat(e.id,"-wrap"));C("".concat(e.staticPath,"/rec/datepicker.min.css")),P("".concat(e.staticPath,"/rec/jquery.min.js"),(function(e){P("".concat(e.staticPath,"/rec/datepicker.js"),(function(e){P("".concat(e.staticPath,"/rec/datepicker.").concat(t.datepickerLang[e.language],".js"),(function(e){var i=n.getElementsByClassName("datepicker-container")[0];!i&&$("#".concat(e.id,"-datepicker")).datepicker&&$("#".concat(e.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:t.datepickerLang[e.language],date:new Date(j("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:n}),(i=n.getElementsByClassName("datepicker-container")[0])&&(i.style.display="none",i.style.bottom="-314px",i.style.right="0px"),t.datepickerVisible=!1,$("#".concat(e.id,"-datepicker")).on("pick.datepicker",(function(n){var o={begin:new Date(n.date).Format("yyyyMMddhhmmss")};if(t.begin=n.date,t.end=new Date(n.date).Format("yyyy-MM-dd")+" 23:59:59",n.date>new Date||new Date(n.date).Format("yyyyMMdd")===new Date(document.getElementById("".concat(e.id,"-datepicker")).getAttribute("data-value")).Format("yyyyMMdd"))n.preventDefault();else{var a=new Date(n.date).Format("yyyy/MM/dd");document.getElementById("".concat(e.id,"-datepicker"))&&document.getElementById("".concat(e.id,"-datepicker")).setAttribute("data-value",a),t.date=a,e.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:a}}),e.Theme.decoderState&&e.Theme.decoderState.state&&(e.Theme.decoderState.state.cloudRec?o={begin:new Date(n.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"}:e.Theme.decoderState.state.rec&&(o={begin:new Date(n.date).Format("yyyyMMddhhmmss"),type:"rec"}))}e.changePlayUrl(o,(function(){}),!1).then((function(){setTimeout((function(){var e=document.getElementById("date");e&&(e.value=new Date(n.date).Format("yyyy-MM-dd"))}),0),t.fetchDeviceRec(),t.jSPlugin.Theme.decoderState.state.sound&&t.jSPlugin.openSound(),t.syncTimeLine()})),t.changeRecSpeed(1),t.resetMobileZoomStatus(),i&&(i.style.display="none"),t.datepickerVisible=!1})),$("#".concat(e.id,"-datepicker")).off("click").on("click",(function(e){t.datepickerVisible?i&&(i.style.display="none"):i&&(i.style.display="inline"),t.datepickerVisible=!t.datepickerVisible})),document.getElementById("date-picker")&&document.getElementById("date-picker").addEventListener("focus",(function(e){e.target.blur()}))}),(function(){}),e)}),(function(){}),e)}),(function(){}),e)}},{key:"createDom",value:function(){var e=document.createElement("div");e.id="date-switch-container-wrap",e.className="date-switch-container-wrap",e.style="",e.innerHTML='\n <div class="date-switch-container">\n <div class="current-date" id="current-date">'.concat(this.jSPlugin.i18n.t("RECORD_TIPS"),'</div>\n <div class="date-container">\n <label for="date" style="width: 40px;height: 40px;">\n <div class="date-icon"></div>\n </label>\n <div autocomplete="off" data-toggle="').concat(this.jSPlugin.id,'-datepicker" id="').concat(this.jSPlugin.id,'-datepicker" name="').concat(this.jSPlugin.id,'-datepicker" data-value="').concat(this.date.replace(/\//g,"-")||(new Date).Format("yyyy-MM-dd"),'" style="opacity:0;width:32px;height:34px;cursor:pointer;"> </div>\n </div>\n </div>\n '),A(e,document.getElementById("".concat(this.jSPlugin.id,"-wrap")));var t=document.createElement("div");t.id="rec-type-container-wrap",t.className="rec-type-container-wrap",t.style="",t.innerHTML='\n <div class="rec-type-container">\n <div class="rec-type-text"><span id="recCount">0</span>'.concat(this.jSPlugin.i18n.t("RECORDS"),'</div>\n <div class="rec-type-switch">\n <label>\n <input type="checkbox" name="type" id="cloudType" value="1" hidden />\n \n \n <label for="cloudType" class="advice">\n <span>\n ').concat(this.jSPlugin._isCloudRecord?'<svg width="20.000000" height="20.000000" viewBox="0 0 20 20" fill="#CCCCCC" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <desc>\n Created with Pixso.\n </desc>\n <defs />\n <path id="路径" d="M14.87 7.7L16.96 6.71C17.64 6.39 18.45 6.69 18.76 7.38C18.85 7.56 18.89 7.76 18.89 7.96L18.89 12.03C18.89 12.79 18.28 13.4 17.53 13.4C17.31 13.4 17.08 13.35 16.88 13.24L14.87 12.13L14.87 7.7Z" fill="#648FFC" fill-opacity="1.000000" fill-rule="evenodd" />\n <path id="路径" d="M14.87 7.7L16.96 6.71C17.64 6.39 18.45 6.69 18.76 7.38C18.85 7.56 18.89 7.76 18.89 7.96L18.89 12.03C18.89 12.79 18.28 13.4 17.53 13.4C17.31 13.4 17.08 13.35 16.88 13.24L14.87 12.13" stroke="#2C2C2C" stroke-opacity="0" stroke-width="1.250000" />\n <mask id="mask_1435_272" fill="white">\n <path id="减去顶层" d="M15.2407 6.22559C15.2407 5.08887 14.3291 4.16699 13.2046 4.16699L3.70264 4.16699C2.57812 4.16699 1.6665 5.08887 1.6665 6.22559L1.6665 13.7749C1.6665 14.9121 2.57812 15.8335 3.70264 15.8335L13.2046 15.8335C14.3291 15.8335 15.2407 14.9121 15.2407 13.7749L15.2407 6.22559ZM7.39282 7.53711C7.39282 7.19189 7.08911 6.91211 6.71411 6.91211L5.35669 6.91211L5.27759 6.91602C4.93994 6.95215 4.67798 7.21631 4.67798 7.53711C4.67798 7.88232 4.98193 8.16211 5.35669 8.16211L6.71411 8.16211L6.79321 8.15771C7.13086 8.12158 7.39282 7.85742 7.39282 7.53711Z" clip-rule="evenodd" fill="" fill-opacity="1.000000" fill-rule="evenodd" />\n </mask>\n <path id="减去顶层" d="M15.2407 6.22559C15.2407 5.08887 14.3291 4.16699 13.2046 4.16699L3.70264 4.16699C2.57812 4.16699 1.6665 5.08887 1.6665 6.22559L1.6665 13.7749C1.6665 14.9121 2.57812 15.8335 3.70264 15.8335L13.2046 15.8335C14.3291 15.8335 15.2407 14.9121 15.2407 13.7749L15.2407 6.22559ZM7.39282 7.53711C7.39282 7.19189 7.08911 6.91211 6.71411 6.91211L5.35669 6.91211L5.27759 6.91602C4.93994 6.95215 4.67798 7.21631 4.67798 7.53711C4.67798 7.88232 4.98193 8.16211 5.35669 8.16211L6.71411 8.16211L6.79321 8.15771C7.13086 8.12158 7.39282 7.85742 7.39282 7.53711Z" clip-rule="evenodd" fill="" fill-opacity="1.000000" fill-rule="evenodd" mask="url(#mask_1435_272)" />\n <path id="减去顶层" d="" fill="" fill-opacity="0.000000" fill-rule="nonzero" />\n </svg>':'<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 '),A(t,e);var n=document.createElement("div");n.id="mobile-rec-wrap",n.className="mobileRec-wrap",n.style="",n.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 ',A(n,t)}},{key:"initTimeLine",value:function(){var e=this;this.TimeLineOBJ=new q({id:"time-line-item",getPlayParam:function(t){var n=e;console.log("子组件传值到父组件",t,t.current,e.date);var i=t.current,o=new Date(e.date).Format("yyyyMMdd").substr(0,8)+(t.current?i.replace(/:/g,""):t.current.replace(/:/g,""));if("cloud.rec"===e.type||e.jSPlugin.useSeek&&e.jSPlugin.capacity&&"1"==e.jSPlugin.capacity.support_seek_playback){if(!e.isSeeking)if(n.recList.length>0)if(new Date("".concat(e.date," ").concat(t.current)).valueOf()>=n.lastDate)e.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}),e.syncTimeLine();else e.jSPlugin.Theme.decoderState.state.play?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.i18n.t("LOADING")}),e.jSPlugin.Theme.setDisabled(!0),e.jSPlugin.seek(o.substr(8,6),"235959").then((function(){var t=setInterval((function(){e.jSPlugin.getOSDTime().then((function(i){console.log("seek时间同步:",new Date(1e3*i.data).Format("yyyyMMddhhmmss"),o,new Date(1e3*i.data).Format("yyyyMMddhhmmss")>=o),new Date(1e3*i.data).Format("yyyyMMddhhmmss")>=o&&(e.isSeeking=!1,e.syncTimeLine(),clearInterval(t),e.jSPlugin.pluginStatus.loadingStop(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.Theme.setDisabled(!1),e.jSPlugin.waterMark_JSPlugin&&n.jSPlugin.setWaterMarkFont(n.jSPlugin.waterMark_JSPlugin),n.jSPlugin.Theme.decoderState.state.sound&&n.jSPlugin.openSound())}))}),500)}))})):e.unSyncTimeLine().then((function(){e.jSPlugin.pluginStatus.loadingStart(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),e.jSPlugin.pluginStatus.loadingSetText({text:e.jSPlugin.i18n.t("LOADING")}),e.jSPlugin.Theme.setDisabled(!0);var t=e.jSPlugin.url;t.indexOf("begin")>-1?t=t.replace(/(begin=)(\d+)/,(function(e,t,n){return t+o})):t+="?begin=".concat(o),e.jSPlugin.play({url:t}).then((function(){e.syncTimeLine(),e.jSPlugin.pluginStatus.loadingStop(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.Theme.setDisabled(!1),n.jSPlugin.waterMark_JSPlugin&&n.jSPlugin.setWaterMarkFont(n.jSPlugin.waterMark_JSPlugin)})).catch((function(e){console.log("时间轴拖动失败:",e)}))}))}else{var a=function(){setTimeout((function(){e.disabled=!1}),e.seekFrequency)},r=function(t){e.disabled=!0,e.unSyncTimeLine().then((function(){e.jSPlugin.pluginStatus.loadingStart(e.jSPlugin.id),e.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),e.jSPlugin.pluginStatus.loadingSetText({text:e.jSPlugin.i18n.t("LOADING")}),e.jSPlugin.Theme.setDisabled(!0);var i=e.jSPlugin.url;i.indexOf("begin")>-1?i=i.replace(/(begin=)(\d+)/,(function(e,t,n){return t+o})):i+="?begin=".concat(o),e.jSPlugin.play({url:i,unSaveUrl:!0,showPoster:!0}).then((function(){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),n.jSPlugin.waterMark_JSPlugin&&n.jSPlugin.setWaterMarkFont(n.jSPlugin.waterMark_JSPlugin),e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound()})).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(a)}),e.seekFrequency)):r(a)}},ontouchstart:function(){e.operating=!0,e.unSyncTimeLine()},ontouchmove:function(){0==e.operating&&(e.operating=!0,e.unSyncTimeLine())},ontouchend:function(){e.operating=!1}})}},{key:"unInjectJsCss",value:function(){ce.listInstances().length<=1&&(I("".concat(this.jSPlugin.staticPath,"/rec/datepicker.min.css")),k("".concat(this.jSPlugin.staticPath,"/rec/jquery.min.js")),k("".concat(this.jSPlugin.staticPath,"/rec/datepicker.js")),k("".concat(this.jSPlugin.staticPath,"/rec/datepicker.").concat(this.datepickerLang[this.jSPlugin.language],".js")))}},{key:"destroy",value:function(){this.unInjectJsCss()}},{key:"fetchDeviceRec",value:function(){var e=this,t=function(t){console.log("时间:",t);var n=t.length;document.getElementById("recCount").innerHTML=n;for(var i=[],o=n-1;o>=0;o--){var a=t[o],r=le(a.endTime),s=le(a.startTime);i.push({st:s,et:r})}e.TimeLineOBJ.setDateLine(i)},n=new FormData,i=this;n.append("deviceSerial",R(this.jSPlugin.url).deviceSerial),n.append("channelNo",R(this.jSPlugin.url).channelNo),n.append("accessToken",this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video),n.append("recType","cloud.rec"===this.type?1:2);var o=j("timeZone",this.jSPlugin.url),a=null,r=null;if(o<=23&&o>=-23&&"cloud.rec"!==this.type){var s=ae(new Date(this.begin).Format("yyyyMMddhhmmss"),+o);a=new Date(s.Format("yyyy/MM/dd")+" 00:00:00").getTime(),r=new Date(s.Format("yyyy/MM/dd")+" 23:59:59").getTime(),n.append("startTime",a),n.append("endTime",r),this.date=s.Format("yyyy/MM/dd")}else a=new Date(this.begin).getTime(),r=new Date(this.end).getTime(),n.append("startTime",a),n.append("endTime",r);if(this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===j("busType",this.jSPlugin.url)){var c={deviceSerial:R(this.jSPlugin.url).deviceSerial,channelNo:R(this.jSPlugin.url).channelNo,startTime:a,endTime:r,spaceId:this.jSPlugin._spaceId};oe(this.jSPlugin,c).then((function(e){if(e.data&&e.data.length>0){var n=e.data;i.recList=n,i.lastDate=n[n.length-1].endTime,t(n)}}))}else fetch(this.jSPlugin.env.domain+"/api/lapp/video/by/time",{method:"POST",body:n}).then((function(e){return e.json()})).then((function(e){if(200==e.code&&e.data){var n;n=e.data,i.recList=n,i.lastDate=n[n.length-1].endTime,t(n)}else t([])}))}},{key:"syncTimeLine",value:function(){var e=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((function(e){clearInterval(e)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];var t=this;this.TimeLineOBJ&&(this.jSPlugin.recTimer=setInterval((function(){if(e.operating)return console.log("操作中"),!1;e.jSPlugin.getOSDTime().then((function(e){var n,i,o,a,r;e.data>0&&t.TimeLineOBJ.stepScrollTimeLine((n=1e3*e.data,i=new Date(n),o=i.getHours(),a=i.getMinutes(),r=i.getSeconds(),(o>9?o:"0"+o)+":"+(a>9?a:"0"+a)+":"+(r>9?r:"0"+r)))})).catch((function(e){console.log("err:-----",e),console.log("未找到当前获取播放时间,等待中...")}))}),500),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer))}},{key:"unSyncTimeLine",value:function(){var e=this;return new Promise((function(t,n){e.jSPlugin.recTimer&&(clearInterval(e.jSPlugin.recTimer),e.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[e.jSPlugin.id])&&(window.recTimer[e.jSPlugin.id].map((function(e){clearInterval(e)})),window.recTimer[e.jSPlugin.id]=[]):window.recTimer={},t()}))}},{key:"bindEvent",value:function(){var e=this;document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(function(t){var n=t.target.checked?2:1;e.type=t.target.checked?"rec":"cloud.rec",console.log("recType",n),console.log("this.date",e),e.jSPlugin.changePlayUrl({type:e.type,begin:"".concat(new Date(e.date).Format("yyyyMMdd"),"000000")},(function(){e.jSPlugin._isCloudRecord&&e.jSPlugin.Theme.changeTheme("mobileRec")})).then((function(){console.log("切换类型成功"),e.syncTimeLine(),e.changeRecSpeed(1),e.resetMobileZoomStatus(),e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound()}),(function(e){console.log("err",e)})).catch((function(e){console.log(e)}))}))}}],[{key:"_instanceStyle",value:function(){e._STYLE||(e._STYLE=document.createElement("style"),e._STYLE.id="ezuikit-mobile-rec-style",e._STYLE.innerHTML='\n body{\n padding: 0;\n margin: 0;\n }\n .time-line-container {\n text-align: left;\n height: 300px;\n /* outline: 1px solid red; */\n /* background: gray; */\n position: relative;\n /* padding-top: 60px; */\n margin-top: 20px;\n }\n\n .time-line-container .time-line-item-container {\n display: inline-block;\n /* height: 400px; */\n width: 30%;\n /* background: indianred; */\n overflow-y: scroll;\n overflow-x: hidden;\n /* padding-top: 60px; */\n height: 300px;\n box-sizing: border-box;\n white-space: nowrap;\n position: relative;\n }\n\n .time-line-container .time-line-item-container::-webkit-scrollbar {\n width: 0px;\n /*滚动条宽度*/\n height: 0px;\n /*滚动条高度*/\n }\n\n .time-line-item .time-item {\n position: relative;\n box-sizing: border-box;\n height: 60px;\n font-size: 12px;\n color: rgb(150, 150, 150);\n border-right: 6px solid;\n border-right-color: #ddd;\n }\n\n .time-line-item .time-item .scale {\n width: 6px;\n height: 9px;\n border-bottom: 1px solid #ccc;\n float: right;\n clear: both;\n }\n\n .time-line-item .time-item .item-unavail {\n width: 6px;\n position: absolute;\n left: 100%;\n background-color: #ddd;\n }\n\n .time-line-container .current-time {\n position: absolute;\n left: 0;\n top: 40px;\n height: 29px;\n /* line-height: 58px; */\n border-bottom: 1px solid #648FFC;\n width: 60%;\n margin-left: 26%;\n }\n\n .time-line-container .current-time .current-time-bg {\n position: relative;\n top: 15px;\n width: 100px;\n height: 29px;\n line-height: 29px;\n left: -70px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .time-line-container .current-time .current-time-bg::before {\n content: \'\';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n background: #648FFC;\n top: 11px;\n position: absolute;\n right: 30px;\n }\n\n .date-switch-container {\n height: 40px;\n position: relative;\n text-align: center;\n margin: 20px 10px;\n }\n\n .date-switch-container .current-date {\n line-height: 40px;\n height: 22px;\n font-size: 16px;\n color: #2C2C2C;\n text-align: center;\n font-weight: bold;\n }\n\n .date-container {\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .rec-type-container {\n display: flex;\n justify-content: space-between;\n }\n\n .rec-type-container .rec-type-text {\n padding: 0 15px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .rec-type-container .rec-type-switch {\n padding: 0 20px;\n }\n\n .date-container input {\n position: absolute;\n opacity: 0;\n display: inline-block;\n width: 40px;\n height: 40px;\n z-index: 10;\n left: 0;\n }\n\n .date-container label {\n position: absolute;\n left: 0;\n top: 0;\n /* display: none; */\n z-index: 0;\n }\n\n .date-icon {\n display: inline-block;\n width: 40px;\n height: 40px;\n background: url(\'https://resource.eziot.com/group2/M00/00/6A/CtwQF2F6VieAQrU9AAABP-_Nsqo949.png\') no-repeat 100% 100%;\n }\n .select-container {\n padding: 10px;\n display: flex;\n justify-content: space-between;\n }\n\n .advice {\n height: 24px;\n width: 70px;\n display: flex;\n justify-content: space-between;\n line-height: 24px;\n background: #F8F8F8;\n border-radius: 8px;\n }\n\n .advice span {\n width: 40px;\n display: inline-block;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n\n }\n\n input[type="checkbox"]:checked+.advice span:last-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child svg {\n fill: #648FFC !important;\n }\n\n input[type="checkbox"]:checked+.advice span:last-child svg {\n fill: #648FFC !important;\n }',document.getElementsByTagName("head")[0].appendChild(e._STYLE))}}])}();f(de,"_STYLE",void 0);var ue=function(){return p((function e(t,n){u(this,e),this.id=n,this.jSPlugin=t,this.timer=null,this.state={play:!1,loading:!1}}),[{key:"default",value:function(e,t){var n=this,i="msgId",o=t||document.getElementById("".concat(this.id,"-wrap"));document.getElementById("".concat(this.id,"-").concat(i))&&o.removeChild(document.getElementById("".concat(this.id,"-").concat(i)));var a=document.createElement("div");a.id="".concat(this.id,"-").concat(i),a.style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);text-align: center;padding: 4px 16px;background: #00000080;color: #FFFFFF;font-size: 14px;",a.innerHTML=e,o.appendChild(a),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){var e=document.getElementById("".concat(n.id,"-").concat(i));o&&e&&o.removeChild(e)}),2e3)}}])}(),me={391001:"取流地址或端口非法",395e3:"服务内部异常,请稍后重试",395400:"预览取流参数异常",395402:"设备当前时段无录像,请选择其他时间段",395403:"服务异常,请重试或联系客服",395404:"设备不在线,请优化网络后重启设备再试",395405:"设备侧网络问题,请检查优化网络后重启设备再试",395406:"token过期,请重试",395407:"客户端的URL格式错误",395409:"预览开启隐私保护",395410:"服务异常,请重试或联系客服",395411:"无权查看当前设备",395412:"服务异常,请重试或联系客服",395413:"服务异常,请重试或联系客服",395415:"设备通道错误",395416:"当前观看路数达到设备最大限制,请重启设备或联系设备售后处理",395451:"设备不支持该码流类型,请检查设备通道支持情况或联系硬件售后",395452:"设备侧网络较差,请检查优化网络后重启设备再试",395454:"设备侧网络较差,请检查优化网络后重启设备再试",395455:"设备通道异常,请检查通道配置后重试",395456:"设备通道异常,请检查通道配置后重试",395457:"服务异常,请重试或联系客服",395458:"服务异常,请重试或联系客服",395459:"服务异常,请重试或联系客服",395460:"服务异常,请重试或联系客服",395492:"服务异常,请重试或联系客服",395500:"服务异常,请重试或联系客服",395501:"服务异常,请重试或联系客服",395503:"服务异常,请重试或联系客服",395504:"服务异常,请重试或联系客服",395505:"服务异常,请重试或联系客服",395506:"暂不支持该设备直接取流,请连接NVR后重试或联系客服",395507:"设备4G无限流量套餐仅支持萤石云视频APP使用,请联系APP客服更换套餐",395530:"服务异常,请重试或联系客服",395544:"视频源不存在,请检查设备配置",395545:"服务异常,请重试或联系客服",395546:"同时观看人数达到账号最大限制,请联系客服",395547:"同时观看人数达到账号最大限制,请联系客服",395556:"服务异常,请重试或联系客服",395557:"设备取流失败,请联系硬件售后",395558:"查找录像开始时间错误",395560:"服务异常,请重试或联系客服",395561:"服务异常,请重试或联系客服",395562:"服务异常,请重试或联系客服",395563:"服务异常,请重试或联系客服",395564:"服务异常,请重试或联系客服",395566:"服务异常,请重试或联系客服",395567:"服务异常,请重试或联系客服",395568:"服务异常,请重试或联系客服",395569:"服务异常,请重试或联系客服",395600:"服务异常,请重试或联系客服",395601:"服务异常,请重试或联系客服",395602:"服务异常,请重试或联系客服",395610:"服务异常,请重试或联系客服",395620:"服务异常,请重试或联系客服",395701:"服务异常,请重试或联系客服",395702:"服务异常,请重试或联系客服",395703:"服务异常,请重试或联系客服",396001:"服务异常,请重试或联系客服",396099:"服务异常,请重试或联系客服",396101:"服务异常,请重试或联系客服",396102:"服务异常,请重试或联系客服",396103:"服务异常,请重试或联系客服",396104:"服务异常,请重试或联系客服",396105:"设备异常,请重试或联系客服",396106:"设备通道异常,请检查通道配置后重试",396107:"设备异常,请重试或联系客服",396108:"服务异常,请重试或联系客服",396109:"服务异常,请重试或联系客服",396110:"设备异常,请重试或联系客服",396501:"设备异常,请重试或联系客服",396502:"设备异常,请重试或联系客服",396503:"设备异常,请重试或联系客服",396504:"设备异常,请重试或联系客服",396505:"设备异常,请重试或联系客服",396506:"设备异常,请重试或联系客服",396508:"设备异常,请重试或联系客服",396509:"设备异常,请重试或联系客服",396510:"设备异常,请重试或联系客服",396511:"设备异常,请重试或联系客服",396512:"设备异常,请重试或联系客服",396513:"设备异常,请重试或联系客服",396514:"设备异常,请重试或联系客服",396515:"设备异常,请重试或联系客服",396516:"设备异常,请重试或联系客服",396517:"设备异常,请重试或联系客服",396518:"设备异常,请重试或联系客服",396519:"设备网络异常,请检查优化网络后重启设备再试",396520:"设备网络异常,请检查优化网络后重启设备再试",396700:"服务异常,请重试或联系客服",396701:"回放结束",397001:"服务异常,请重试或联系客服",397002:"服务异常,请重试或联系客服",397003:"服务异常,请重试或联系客服",397004:"服务异常,请重试或联系客服",397005:"设备取流连接断开,请检查网络后重试",397006:"服务异常,请重试或联系客服",397007:"服务异常,请重试或联系客服",399e3:"服务异常,请重试或联系客服",399001:"客户端网络超时",399002:"服务异常,请重试或联系客服",399016:"token失效,请更新并重试",399048:"同时观看人数达到账号最大限制,请联系客服",399049:"免费版并发数达到上限,请升级企业版使用多并发能力",3810001:"操作失败",3810002:"账号异常,操作失败",3810005:"账号异常,操作失败",3820002:"设备不存在,请检查设备连接情况",3820006:"操作失败,请检查设备网络情况",3820007:"操作失败,请检查设备网络情况",3820008:"操作过于频繁,稍后再试",3820014:"操作失败",3820032:"通道不存在请检查设备连接情况",3849999:"操作失败,请重试",386e4:"操作失败,设备不支持该操作",3860001:"操作失败,用户无权限",3860002:"设备已旋转到上限位",3860003:"设备已旋转到下限位",3860004:"设备已旋转到左限位",3860005:"设备已旋转到右限位",3860006:"操作失败,请重试",3860009:"设备正在操作中",3860020:"操作失败",BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍后",TIMEFORMAT_ERROR:"时间格式有误,请确认",USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功",GET_PLAYURL_FAILED:"获取播放地址失败",VIDEO_LOADING:"视频加载中",DISCONNECT:"连接断开,请重试",DEVICE_ENCRYPTED:"设备已加密",NO_RECORD:"未找到录像片段",PLAY_FAILED:"播放失败,请检查设备及客户端网络",PLAY_SUCCESS:"播放成功",STOP_SUCCESS:"停止成功",CHANGE_PLAYURL_SUCCESS:"切换播放地址成功",CHANGE_PLAYURL_FAILED:"切换播放地址失败",GET_OSD_TIME:"获取OSD时间",GET_OSD_TIME_FAILED:"获取OSD时间失败",SET_POSTER:"设置播放器封面",RESIZE:"调整播放器尺寸",SPEED:"倍速",SPEED_RATE:"倍",SPEED_CANCEL:"取消",GET_SPEED:"获取当前播放速率",MAX_SPEED_LIMIT:"播放速度最大为4倍速度",MIN_SPEED_LIMIT:"播放速度最小为1倍速度",SEEK_CANNOT_CROSS_DAYS:"seek时间不能跨日期",SEEK_TIMEFORMAT_ERROR:"seek时间格式错误",PAUSE:"暂停",PAUSE_FAILED:"暂停失败",RESUME:"恢复播放",RESUME_FAILED:"恢复播放失败",CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"该设备在当天没有云录制的录像",CHANGE_VIDEO_LEVEL:"切换清晰度",CHANGE_VIDEO_LEVEL_FAIL:"切换清晰度失败",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度",VIDEO_LEVEL_NOT_SUPPORT:"当前设备不支持该清晰度",VIDEO_LEVEL_FLUENT:"流畅",VIDEO_LEVEL_SATNDARD:"标清",VIDEO_LEVEL_HEIGH:"高清",VIDEO_LEVEL_SPUER:"超清",VIDEO_LEVEL_EXTREME:"极清",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"重置主题",BTN_PLAY:"播放/结束播放",BTN_SOUND:"声音",BTN_RECORDVIDEO:"录屏",BTN_CAPTURE:"截图",BTN_TALK:"对讲",BTN_ZOOM:"电子放大",BTN_3D_ZOOM:"3D定位",BTN_PTZ:"云台控制",BTN_EXPEND:"全局全屏",BTN_WEBEXPEND:"网页全屏",BTN_HD:"画面清晰度",BTN_SPEED:"回放倍速",BTN_CLOUDREC:"云存储回放",BTN_CLOUDRECORD:"云录制",BTN_REC:"本地存储",DEVICE_NAME:"设备名称",DEVICE_ID:"设备序列号",CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败",START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败",RECORD_TIPS:"今日录像",RECORDS:"个录像",OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音",SOUND_OPENED:"当前已经有画面正在播放声音",ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"已经放大到最大倍数8.0X",ZOOM_SUB_MIN:"已经缩小到最小倍数1.0X",ZOOM_LIMIT_MAX:"超出最大倍率8.0X",ZOOM_LIMIT_MIN:"超出最小倍率1.0X","3D_ZOOM":"3D定位","3D_ZOOM_DISABLE":"未启用3D定位功能","3D_ZOOM_FAILED":"3D定位失败,请重试",START_3D_ZOOM:"开启3D定位",CLOSE_3D_ZOOM:"关闭3D定位",DEVICE_NOT_SUPPORT_3D_ZOOM:"当前设备不支持3D定位功能","3D_ZOOM_ACTIVED":"3D定位已处于开启状态","3D_ZOOM_NOT_ACTIVED":"未启用3D定位功能","3D_ZOOM_CLOSED":"3D定位已处于关闭状态",CHANGE_ZOOM_TYPE:"改变缩放模式",FULLSCREEN:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏",DESTROY:"销毁",GET_CAPACITY:"获取设备能力级",GET_CAPACITY_FAILED:"获取设备能力级失败",GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距",NOT_SUPPORT_DEVICE_ZOOM:"当前设备不支持物理缩放",NOT_SUPPORT_FOCUS:"当前设备不支持变焦",MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误",CHANGE_FEC_TYPE:"切换鱼眼矫正类型",DEVICE_NOT_SUPPORT:"设备不支持鱼眼模式",TYPE_NOT_SUPPORT:"鱼眼矫正类型暂时不支持",FEC_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正",NO_CANVAS_ID:"鱼眼矫正类型需要分屏,但是没有传正确的分屏的canvas id",SET_FEC_PARAMS:"设置3D矫正视角参数",GET_FEC_PARAMS:"获取3D矫正视角参数",SET_FEC_PARAMS_FAILED:"该矫正类型不能设置3D矫正视角参数",GET_FEC_PARAMS_FAILED:"该矫正类型不能获取3D矫正视角参数",GET_FEC_PARAMS_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正获取3D矫正视角参数",SET_WATERMARK:"设置水印"},he={391001:"Illegal streaming address or port",395e3:"Internal service exception, please try again later",395400:"Preview streaming parameter exception",395402:"Device has no recording in the current time period, please select another time period",395403:"Service exception, please try again or contact customer service",395404:"The device is not online, Please optimize the network and restart the device to try again",395405:"Device side network is poor, please check and optimize the network and restart the device to try again",395406:"Token expired, please try again",395407:"Client URL format error",395409:"Service exception, please try again or contact customer service",395410:"Service exception, please try again or contact customer service",395411:"No permission to view the current device",395412:"Service exception, please try again or contact customer service",395413:"Service exception, please try again or contact customer service",395415:"Device channel error",395416:"The current number of viewing channels has reached the maximum limit of the device. Please restart the device or contact the device after-sales service",395451:"The device does not support this bitstream type. Please check the device channel support or contact the hardware after-sales service",395452:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395454:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395455:"The device channel is abnormal. Please check the channel configuration and try again",395456:"The device channel is abnormal. Please check the channel configuration and try again",395457:"Service exception, please try again or contact customer service",395458:"Service exception, please try again or contact customer service",395459:"Service exception, please try again or contact customer service",395460:"Service exception, please try again or contact customer service",395492:"Service exception, please try again or contact customer service",395500:"Service exception, please try again or contact customer service",395501:"Service exception, please try again or contact customer service",395503:"Service exception, please try again or contact customer service",395504:"Service exception, please try again or contact customer service",395505:"Service exception, please try again or contact customer service",395506:"Direct streaming of this device is not supported at present, please try again or contact customer service after connecting to NVR",395507:"Device 4G unlimited traffic package only supports EZVIZ Cloud Video APP, please contact APP customer service to change the package",395530:"Service exception, please try again or contact customer service",395544:"Video source does not exist, please check device configuration",395545:"Service exception, please try again or contact customer service",395546:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395547:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395556:"Service exception, please try again or contact customer service",395557:"Device streaming failed, please contact hardware after-sales",395558:"Error in finding the start time of recording",395560:"Service exception, please try again or contact customer service",395561:"Service exception, please try again or contact customer service",395562:"Service exception, please try again or contact customer service",395563:"Service exception, please try again or contact customer service",395564:"Service exception, please try again or contact customer service",395566:"Service exception, please try again or contact customer service",395567:"Service exception, please try again or contact customer service",395568:"Service exception, please try again or contact customer service",395569:"Service exception, please try again or contact customer service",395600:"Service exception, please try again or contact customer service",395601:"Service exception, please try again or contact customer service",395602:"Service exception, please try again or contact customer service",395610:"Service exception, please try again or contact customer service",395620:"Service exception, please try again or contact customer service",395701:"Service exception, please try again or contact customer service",395702:"Service exception, please try again or contact customer service",395703:"Service exception, please try again or contact customer service",396001:"Service exception, please try again or contact customer service",396099:"Service exception, please try again or contact customer service",396101:"Service exception, please try again or contact customer service",396102:"Service exception, please try again or contact customer service",396103:"Service exception, please try again or contact customer service",396104:"Service exception, please try again or contact customer service",396105:"Device abnormality, please try again or contact customer service",396106:"Device channel abnormality, please check the channel configuration and try again",396107:"Device abnormality, please try again or contact customer service",396108:"Service exception, please try again or contact customer service",396109:"Service exception, please try again or contact customer service",396110:"Device abnormality, please try again or contact customer service",396501:"Device abnormality, please try again or contact customer service",396502:"Device abnormality, please try again or contact customer service",396503:"Device abnormality, please try again or contact customer service",396504:"Device abnormality, please try again or contact customer service",396505:"Device abnormality, please try again or contact customer service",396506:"Device abnormality, please try again or contact customer service",396508:"Device abnormality, please try again or contact customer service",396509:"Device abnormality, please try again or contact customer service",396510:"Device abnormality, please try again or contact customer service",396511:"Device abnormality, please try again or contact customer service",396512:"Device abnormality, please try again or contact customer service",396513:"Device abnormality, please try again or contact customer service",396514:"Device abnormality, please try again or contact customer service",396515:"Device abnormality, please try again or contact customer service",396516:"Device abnormality, please try again or contact customer service",396517:"Device abnormality, please try again or contact customer service",396518:"Device abnormality, please try again or contact customer service",396519:"Device network abnormality, please check and optimize the network and restart the device to try again",396520:"Device network abnormality, please check and optimize the network and restart the device to try again",396700:"Service exception, please try again or contact customer service",396701:"Playback ends",397001:"Service exception, please try again or contact customer service",397002:"Service exception, please try again or contact customer service",397003:"Service exception, please try again or contact customer service",397004:"Service exception, please try again or contact customer service",397005:"Device streaming connection is disconnected, please check the network and try again",397006:"Service exception, please try again or contact customer service",397007:"Service exception, please try again or contact customer service",399e3:"Service exception, please try again or contact customer service",399001:"Client network timeout",399002:"Service exception, please try again or contact customer service",399016:"Token invalid, please update and retry",399048:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399049:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",3810001:"Operation failed",3810002:"Account exception, operation failed",3810005:"Account exception, operation failed",3820002:"Device does not exist, please check the device connection status",3820006:"Operation failed, please check the network condition of the device",3820007:"Operation failed, please check the network condition of the device",3820008:"The operation is too frequent, please try again later",3820014:"Operation failed",3820032:"The channel does not exist. Please check the device connection status",3849999:"Operation failed, please try again",386e4:"Operation failed, the device does not support this operation",3860001:"Operation failed, user does not have permission",3860002:"The device has been rotated to the upper limit position",3860003:"The device has been rotated to the lower limit position",3860004:"The device has rotated to the left limit position",3860005:"The device has been rotated to the right limit position",3860006:"Operation failed, please try again",3860009:"The device is currently in operation",3860020:"Operation failed",BTN_RETRY:"Retry",BTN_RELOAD:"Reload",LOADING:"Loading, please wait",TIMEFORMAT_ERROR:"The time format is wrong, please confirm",USE_MULTITHREADING_WARING:"Your current browser can enable the multi-threaded feature of Google Labs to get a better playback experience and avoid browser freezes and crashes. For details, see:",OPEN_INSTRUCTIONS:"Enablement instructions",INIT_FINSHED:"Initialize the player completed",INIT_SUCCESS:"Initialize the player successfully",GET_PLAYURL_FAILED:"Failed to obtain the playback address",VIDEO_LOADING:"Video loading",DISCONNECT:"Connection disconnected, please try again",DEVICE_ENCRYPTED:"Device encrypted",NO_RECORD:"No video clips found",PLAY_FAILED:"Play failed, please check the device and client network",PLAY_SUCCESS:"Play successfully",STOP_SUCCESS:"Stop successfully",CHANGE_PLAYURL_SUCCESS:"Switch the playback address successfully",CHANGE_PLAYURL_FAILED:"Switch the playback address failed",GET_OSD_TIME:"Get OSD time",GET_OSD_TIME_FAILED:"Failed to get OSD time",SET_POSTER:"Set the player cover",RESIZE:"Adjust the player size",SPEED:"speeds",SPEED_RATE:"X",SPEED_CANCEL:"Cancel",GET_SPEED:"Get the current playback rate",MAX_SPEED_LIMIT:"The maximum playback speed is 4 times the speed",MIN_SPEED_LIMIT:"The minimum playback speed is 1 times the speed",SEEK_CANNOT_CROSS_DAYS:"The seek time cannot cross dates",SEEK_TIMEFORMAT_ERROR:"The seek time format is wrong",PAUSE:"Pause",PAUSE_FAILED:"Pause failed",RESUME:"Resume playback",RESUME_FAILED:"Resume playback failed",CALL_END:"Call ended",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"The device has no cloud recorded video on that day",CHANGE_VIDEO_LEVEL:"Switch definition",CHANGE_VIDEO_LEVEL_FAIL:"Switch definition failed",GET_VIDEO_LEVEL_LIST:"Get the definition list supported by the device",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"Please enter the correct definition",VIDEO_LEVEL_NOT_SUPPORT:"The current device does not support this definition",VIDEO_LEVEL_FLUENT:"Fluent",VIDEO_LEVEL_SATNDARD:"Standard",VIDEO_LEVEL_HEIGH:"heigh",VIDEO_LEVEL_SPUER:"Super",VIDEO_LEVEL_EXTREME:"Extreme",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"Reset theme",BTN_PLAY:"Play/end playback",BTN_SOUND:"Sound",BTN_RECORDVIDEO:"Screen recording",BTN_CAPTURE:"Screenshot",BTN_TALK:"Intercom",BTN_ZOOM:"Electronic zoom",BTN_3D_ZOOM:"3D positioning",BTN_PTZ:"PTZ control",BTN_EXPEND:"Global full screen",BTN_WEBEXPEND:"Web page full screen",BTN_HD:"Image definition",BTN_SPEED:"Playback speed",BTN_CLOUDREC:"Cloud storage playback",BTN_CLOUDRECORD:"Cloud recording",BTN_REC:"Local storage",DEVICE_NAME:"Device name",DEVICE_ID:"Device serial number",CAPTURE_SUCCESS:"Screenshot successful",CAPTURE_FAILED:"Screenshot failed",START_RECORD_SUCCESS:"Start recording successful",START_RECORD_FAILED:"Screenshot failed",STOP_RECORD_SUCCESS:"Stop recording successful",STOP_RECORD_FAILED:"Stop recording failed",RECORD_TIPS:"Today's recording",RECORDS:" in total",OPEN_SOUND:"Turn on sound",CLOSE_SOUND:"Turn off sound",SOUND_OPENED:"There is already a picture playing sound at the moment",ZOOM:"Electronic zoom",START_ZOOM:"Turn on electronic zoom",CLOSE_ZOOM:"Turn off electronic zoom",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"It has been enlarged to a maximum magnification of 8.0X",ZOOM_SUB_MIN:"It has been reduced to the minimum multiple of 1.0X",ZOOM_LIMIT_MAX:"Exceeding maximum magnification of 8.0X",ZOOM_LIMIT_MIN:"Exceeding the minimum magnification of 1.0X","3D_ZOOM":"3D positioning","3D_ZOOM_DISABLE":"3D positioning function not enabled","3D_ZOOM_FAILED":"3D positioning failed, please try again",START_3D_ZOOM:"Turn on 3D positioning",CLOSE_3D_ZOOM:"Turn off 3D positioning",DEVICE_NOT_SUPPORT_3D_ZOOM:"Current device does not support 3D positioning function","3D_ZOOM_ACTIVED":"3D positioning is already enabled","3D_ZOOM_NOT_ACTIVED":"3D positioning function is not enabled","3D_ZOOM_CLOSED":"3D positioning is already disabled",CHANGE_ZOOM_TYPE:"Change zoom mode",FULLSCREEN:"Global full screen",FULLSCREEN_EXIT:"Exit global full screen",GET_WEB_FULLSCREEN_STATUS:"Get browser web page full screen status",WEB_FULLSCREEN:"Turn on web page full screen",WEB_FULLSCREEN_EXIT:"Exit full screen webpage",DESTROY:"Destroy",GET_CAPACITY:"Get device capability level",GET_CAPACITY_FAILED:"Get device capability level failed",GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length",NOT_SUPPORT_DEVICE_ZOOM:"Device does not support physical zoom",NOT_SUPPORT_FOCUS:"Device does not support adjusting the focal length",MIRROR:"Mirror flip",MIRROR_TYPE_ERROR:"Flip parameter type error",CHANGE_FEC_TYPE:"Switch fisheye correction type",DEVICE_NOT_SUPPORT:"Device does not support fisheye mode",TYPE_NOT_SUPPORT:"Fisheye correction type is not supported temporarily",FEC_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction",NO_CANVAS_ID:"Fisheye correction type requires split screen, but the correct split screen canvas id is not passed",SET_FEC_PARAMS:"Set 3D correction perspective parameters",GET_FEC_PARAMS:"Get 3D correction perspective parameters",SET_FEC_PARAMS_FAILED:"This correction type cannot set 3D correction perspective parameters",GET_FEC_PARAMS_FAILED:"This correction type cannot get 3D correction perspective parameters",GET_FEC_PARAMS_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction Get 3D correction perspective parameters",SET_WATERMARK:"Set watermark"},pe={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"}]},ge={color:"blue",backgroundColor:"blue",activeColor:"blue",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-footer-0",iconId:"play",part:"left",defaultActive:0,isrender:0,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},fe=function(e){this.jsPlugin=e;var t={id:e.id,isMouseDown:!1,isOver:!1,mousePosition:null,oldTime:null,nowTime:e.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(t).forEach((function(e){n[e]=t[e]})),this.options={width:this.canvasWidth,height:48,time:(new Date).getTime(),timeSection:[],timeWidth:0},this.subTime=function(e){return e<10?"0"+e:e},this.tranTime=function(e){var t=e;if(e){var n=new Date(e);t=n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate()+" "+this.subTime(n.getHours())+":"+this.subTime(n.getMinutes())+":"+this.subTime(n.getSeconds())}return t},this.init=function(e){var t=this.options;return new Promise((function(i,o){e.width&&document.getElementById(e.id).setAttribute("width",parseInt(e.width,10)+"px"),n.randomNum=(Math.random()+"").split(".").join(""),n.timeWidthTblIndex=t.timeWidth;var a=document.getElementById("".concat(n.jsPlugin.id,"-canvas"));n.drawPen=a.getContext("2d"),n.nowTime=e.nowTime,n.timeSection=t.timeSection||[],n.canvasWidth=a.offsetWidth,n.canvasHeight=a.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()}))},this.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}))},this.mousemove=function(e){if(this.isMouseDown&&this.isOver){var t=this.mousePosition-e.pageX;if(0===t)return;var n=0;switch(this.timeWidth){case 60:n=.1;break;case 1800:n=3;break;case 3600:n=90;break;case 86400:n=120}var i=new Date(this.oldTime).getTime()+t*n*1e3;this.updata({time:i}),this.moved=!0}else{var o=parseInt(document.getElementById("".concat(this.jsPlugin.id,"-canvas-container")).offsetLeft,10);this.mousePosition=e.pageX-o,this.updata()}},this.mousedown=function(e){this.isMouseDown=!0,this.mousePosition=e.pageX,this.oldTime=this.nowTime},this.mouseover=function(e){this.isOver=!0},this.mouseleave=function(e){this.isOver=!1,this.isMouseDown=!1,this.updata()},this.changeSize=function(e){console.log("changeSize",e),this.options.timeWidth=e,this.updata({timeWidth:e})},this.mouseUpFn=function(e,t){if(this.isMouseDown&&(this.isMouseDown=!1,this.moved)){this.moved=!1;var n=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(n),this.updata({time:this.nowTime}),this.oldTime=this.nowTime,console.log("nowTime",new Date(this.nowTime),n),t(this.nowTime)}},this.readOnly=function(e){console.log("更改为只读"),this.options.readOnly=!0,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="not-allowed"},this.unReadOnly=function(e){console.log("更改为只读"),this.options.readOnly=!1,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="pointer"},this.run=function(e){n.isMouseDown||n.updata(e)},this.getTime=function(e){console.log("this",this),console.log("当前时间",new Date(this.nowTime))},this.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()},this.drawSolidLine=function(e,t,n,i,o,a){this.drawPen.save(),this.drawPen.strokeStyle=a,this.drawPen.lineWidth=o,this.drawPen.beginPath(),this.drawPen.moveTo(e,t),this.drawPen.lineTo(n,i),this.drawPen.stroke(),this.drawPen.restore()},this.drawString=function(e,t,n,i,o){this.drawPen.font="12px serif",this.drawPen.fillStyle="#ffffff",this.drawPen.textAlign=i||"left",this.drawPen.fillText(e,t,n+10)},this.drawScale=function(){var e=this,t="rgba(255,255,255)",n=new Date(e.nowTime),i=n.getSeconds(),o=n.getMinutes(),a=n.getHours(),r=n.getDate(),s=0;switch(e.timeWidth){case 60:var c=parseInt(e.canvasWidth/10);n.setSeconds(n.getSeconds()-parseInt(c/2,10)),r=n.getDate(),a=n.getHours(),o=n.getMinutes(),i=n.getSeconds();for(var l=0;l<c;l++){if(s=i+l,n.setSeconds(s),s%10==0){e.drawSolidLine(l*e.canvasWidth/c,8,l*e.canvasWidth/c,e.canvasHeight/5+8,1,t);var d=this.subTime(n.getHours())+":"+this.subTime(n.getMinutes())+":"+this.subTime(n.getSeconds());e.drawString(d,l*e.canvasWidth/c,e.canvasHeight/5*2.5,"center","rgba(255,255,255,0.3)")}else e.drawSolidLine(l*e.canvasWidth/c,8,l*e.canvasWidth/c,e.canvasHeight/5*.5+8,1,t);n.setDate(r),n.setHours(a),n.setMinutes(o)}break;case 1800:var u=new Date(e.nowTime),m=3600*u.getHours()+60*u.getMinutes()+u.getSeconds(),h=parseInt(m/60),p={position:parseInt(e.canvasWidth/2),time:0,hideString:!0},g=Math.ceil(e.canvasWidth/40)+h,f=[];f.push(p);for(var v=0;v<g;v++)f.push({position:p.position+20*v-parseInt(m/3),time:p.time+60*v}),f.unshift({position:p.position-20*v-parseInt(m/3),time:p.time-60*v});for(var y=0;y<f.length;y++)if(e.drawSolidLine(f[y].position,8,f[y].position,e.canvasHeight/5*(f[y].time%100==0?1:.5)+8,1,t),f[y].time%100==0&&!f[y].hideString){var S=new Date(1e3*f[y].time),_=S.getUTCHours()<10?"0".concat(S.getUTCHours()):S.getUTCHours(),b=S.getUTCMinutes()<10?"0".concat(S.getUTCMinutes()):S.getUTCMinutes();S.getUTCSeconds()<10?"0".concat(S.getUTCSeconds()):S.getUTCSeconds();var w="".concat(_,":").concat(b);e.drawString(w,f[y].position,e.canvasHeight/5*2,"center","rgba(255,255,255,0.3)")}break;case 3600:var T=new Date(e.nowTime),E=3600*T.getHours()+60*T.getMinutes()+T.getSeconds(),P=parseInt(E/1800),k={position:parseInt(e.canvasWidth/2),time:0,hideString:!0},C=Math.ceil(e.canvasWidth/40)+P,I=[];I.push(k);for(var x=0;x<C;x++)I.push({position:k.position+20*x-parseInt(E/90),time:k.time+1800*x}),I.unshift({position:k.position-20*x-parseInt(E/90),time:k.time-1800*x});for(var j=0;j<I.length;j++)if(e.drawSolidLine(I[j].position,8,I[j].position,e.canvasHeight/5*(I[j].time%9e3==0?1:.5)+8,1,t),I[j].time%9e3==0&&!I[j].hideString){var A=new Date(1e3*I[j].time),D=A.getUTCHours()<10?"0".concat(A.getUTCHours()):A.getUTCHours(),R=A.getUTCMinutes()<10?"0".concat(A.getUTCMinutes()):A.getUTCMinutes();A.getUTCSeconds()<10?"0".concat(A.getUTCSeconds()):A.getUTCSeconds();var L="".concat(D,":").concat(R);e.drawString(L,I[j].position,e.canvasHeight/5*2,"center","rgba(255,255,255,0.3)")}break;case 86400:var B=new Date(e.nowTime),M=3600*B.getHours()+60*B.getMinutes()+B.getSeconds(),O=parseInt(M/3600),z={position:parseFloat(e.canvasWidth/2),time:0,hideString:!0},N=Math.ceil(e.canvasWidth/60)+O,F=[];F.push(z);for(var U=0;U<N;U++)F.push({position:z.position+30*U-M/120,time:z.time+3600*U}),F.unshift({position:z.position-30*U-M/120,time:z.time-3600*U});for(var V=0;V<F.length;V++)if(e.drawSolidLine(F[V].position,8,F[V].position,e.canvasHeight/5*(F[V].time%7200==0?1:.5)+8,1,t),F[V].time%7200==0&&!F[V].hideString){var H=new Date(1e3*F[V].time),G=H.getUTCHours()<10?"0".concat(H.getUTCHours()):H.getUTCHours(),Z=H.getUTCMinutes()<10?"0".concat(H.getUTCMinutes()):H.getUTCMinutes();H.getUTCSeconds()<10?"0".concat(H.getUTCSeconds()):H.getUTCSeconds();var W="".concat(G,":").concat(Z);e.drawString(W,F[V].position,e.canvasHeight/5*2,"center","rgba(255,255,255,0.3)")}}},this.getRecord=function(e,t,n){this.timeSection=e,this.drawRecord()},this.drawRecord=function(){for(var e=this.timeSection||[],t=this,n=t.drawPen,i=0;i<e.length;i++){var o=r(e[i].startTime),a=r(e[i].endTime);n.fillStyle="#1890ff80",n.fillRect(o,0,a-o,48)}function r(e){var n=10;switch(t.timeWidth){case 60:n=10;break;case 1800:n=20/60;break;case 3600:n=20/30/60;break;case 86400:n=.5/60}var i=t.canvasWidth/2+(e-t.nowTime)/1e3*n;return i>t.canvasWidth&&(i=t.canvasWidth),i<=0&&(i=0),i}},this.drawOtherMsg=function(){this.drawSolidLine(this.canvasWidth/2,0,this.canvasWidth/2,this.canvasHeight,2,"#1890FF"),this.drawPen.shadowBlur=0,this.isOver&&!this.isMouseDown?(this.mouseTime=this.mousePosition/this.canvasWidth*this.timeWidth*1e3+this.nowTime-this.timeWidth/2*1e3,this.mouseString=this.tranTime(this.mouseTime),this.hoverTime=this.mouseString,this.hoverLeft=this.mousePosition-60,this.timeTipShow=!0):this.timeTipShow=!1}},ve=function(){function e(){u(this,e)}return p(e,null,[{key:"append",value:function(t,n,i){!function o(a){if(a>=t.length)n&&n();else{var r=t[a];if(e.LoadedScripts.find((function(e){return e===r})))o(a+1);else{var s=document.querySelector('script[src="'.concat(r,'"]'));if(s)s.readyState?s.addEventListener("readystatechange",(function(){"complete"!=s.readyState&&"loaded"!=s.readyState||o(a+1)})):s.addEventListener("load",(function(){o(a+1)}));else{var c=document.createElement("script");c.src=r,c.setAttribute("crossorigin",!0),c.onload=function(){e.LoadedScripts.push(r),o(a+1),c=null},c.onerror=function(){i&&i(t[a]),c=null},document.head.appendChild(c)}}}}(0)}},{key:"remove",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(t){var n=document.querySelector('script[src="'.concat(t,'"]'));if(n)try{document.head.removeChild(n)}catch(e){}var i=e.LoadedScripts.indexOf(t);i>-1&&e.LoadedScripts.splice(i,1)}))}},{key:"clear",value:function(){e.remove(e.LoadedScripts)}}])}();f(ve,"LoadedScripts",[]);var ye=function(){return p((function e(t){if(u(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.datepickerLang={zh:"zh-CN",en:"en-US"},this.recInit()}),[{key:"recInit",value:function(){var e,t,n=this;if(!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0;var i=parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).width,10)-100,o=document.createElement("div");o.style="display:inline-block;height:48px;",o.id=this.jSPlugin.id+"-canvas-container",o.className="ezuikit-time-line-control";var a=document.createElement("canvas");a.id=this.jSPlugin.id+"-canvas",a.className="time-line-body",a.height="48",a.width=i,a.style="display:inline-block;",a.innerHTML="该浏览器不支持canvas",o.appendChild(a),A(o,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")));var r=document.createElement("div");r.className="timeline-controls",r.style="display:flex;width:100px;height:48px;text-align:center;line-height: 48px;vertical-align: top;background: #000000;";var s='\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');r.innerHTML=s,A(r,o),this.timeLine=new fe(this.jSPlugin);var c=this;this.timeLine.init({id:this.jSPlugin.id+"-canvas",width:i,nowTime:this.nowTime,onChange:function(e){if(console.log("time",e,new Date(e).Format("yyyyMMddhhmmss")),"rec"===R(n.jSPlugin.url).type&&new Date(e).Format("yyyy-MM-dd")!=c.date)return console.warn("本地SD卡不支持跨天回放"),void(c.jSPlugin.eventEmitter&&c.jSPlugin.eventEmitter.emit("recTimeChange",{code:-1,data:{time:new Date(e).Format("yyyyMMddhhmmss")},msg:"本地SD卡不支持跨天回放"}));var t=new Date(e).Format("yyyyMMddhhmmss");if(console.log("----------------this.jSPlugin.url",n.jSPlugin.url),n.jSPlugin.Theme&&n.jSPlugin.Theme.decoderState.state.recordvideo&&(n.jSPlugin.Theme.setDecoderState({recordvideo:!1}),"cloud.rec"===R(n.jSPlugin.url).type&&n.jSPlugin.stopSave()),"cloud.rec"===R(n.jSPlugin.url).type||n.jSPlugin.useSeek&&n.jSPlugin.capacity&&"1"==n.jSPlugin.capacity.support_seek_playback){if(!n.isSeeking)if(c.recList.length>0)if(new Date(e).valueOf()>=c.lastDate)n.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3});else n.jSPlugin.Theme.decoderState.state.play?n.unSyncTimeLine().then((function(){n.isSeeking=!0,n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),n.jSPlugin.pluginStatus.loadingSetText({text:n.jSPlugin.i18n.t("LOADING")}),n.jSPlugin.Theme.setDisabled(!0),n.jSPlugin._tempSeekTime=e,n.jSPlugin.seek(t.substr(8,6),"235959").then((function(){var t=setInterval((function(){n.jSPlugin._destroy?clearInterval(t):n.jSPlugin.getOSDTime().then((function(i){var o=new Date(e).valueOf()/1e3;if(console.log("seek时间同步:",new Date(1e3*i.data).Format("hh:mm:ss"),new Date(1e3*o).Format("hh:mm:ss"),i.data>=o),i.data>=o-2){n.isSeeking=!1,n.syncTimeLine(),clearInterval(t),n.jSPlugin.pluginStatus.loadingStop(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),n.jSPlugin.pluginStatus.loadingClear(),n.jSPlugin.Theme.setDisabled(!1),n.jSPlugin._tempSeekTime=null,c.jSPlugin.waterMark_JSPlugin&&c.jSPlugin.setWaterMarkFont(c.jSPlugin.waterMark_JSPlugin);var a=n.jSPlugin.Theme.decoderState.state.sound,r=ce.getInstance(n.jSPlugin.id);a&&r.getState().sound&&setTimeout((function(){n.jSPlugin.openSound()}),500),c.jSPlugin.eventEmitter&&c.jSPlugin.eventEmitter.emit("recTimeChange",{code:0,data:{time:new Date(e).Format("yyyyMMddhhmmss")}})}}))}),1e3)}))})):n.unSyncTimeLine().then((function(){n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),n.jSPlugin.pluginStatus.loadingSetText({text:n.jSPlugin.i18n.t("LOADING")}),n.jSPlugin.Theme.setDisabled(!0);var i=n.jSPlugin.url;i.indexOf("begin")>-1?i=i.replace(/(begin=)(\d+)/,(function(e,n,i){return n+t})):i+="?begin=".concat(t),n.jSPlugin.play({url:i}).then((function(){n.syncTimeLine(),n.jSPlugin.pluginStatus.loadingStop(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),n.jSPlugin.pluginStatus.loadingClear(),n.jSPlugin.Theme.setDisabled(!1),c.jSPlugin.waterMark_JSPlugin&&c.jSPlugin.setWaterMarkFont(c.jSPlugin.waterMark_JSPlugin),c.jSPlugin.eventEmitter&&c.jSPlugin.eventEmitter.emit("recTimeChange",{code:0,data:{time:new Date(e).Format("yyyyMMddhhmmss")}})})).catch((function(e){console.log("时间轴拖动失败:",e)}))}))}else{var i=function(){setTimeout((function(){n.disabled=!1}),n.seekFrequency)},o=function(i){n.disabled=!0,n.unSyncTimeLine().then((function(){n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),n.jSPlugin.pluginStatus.loadingSetText({text:n.jSPlugin.i18n.t("LOADING")}),n.jSPlugin.Theme.setDisabled(!0);var o=n.jSPlugin.url;o.indexOf("begin")>-1?o=o.replace(/(begin=)(\d+)/,(function(e,n,i){return n+t})):o+="?begin=".concat(t),n.jSPlugin.play({url:o,unSaveUrl:!0,showPoster:!0}).then((function(){i&&i(),n.syncTimeLine(),n.jSPlugin.pluginStatus.loadingStop(n.jSPlugin.id),n.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),n.jSPlugin.pluginStatus.loadingClear(),n.jSPlugin.Theme.setDisabled(!1),c.jSPlugin.waterMark_JSPlugin&&c.jSPlugin.setWaterMarkFont(c.jSPlugin.waterMark_JSPlugin),n.jSPlugin.Theme.decoderState.state.sound&&n.jSPlugin.openSound(),c.jSPlugin.eventEmitter&&c.jSPlugin.eventEmitter.emit("recTimeChange",{code:0,data:{time:new Date(e).Format("yyyyMMddhhmmss")}})})).catch((function(e){console.log("时间轴拖动失败:",e)}))})),n.jSPlugin.Theme&&n.jSPlugin.Theme.decoderState&&n.jSPlugin.Theme.decoderState.state&&n.jSPlugin.Theme.decoderState.state.zoom&&(n.jSPlugin.Theme.setDecoderState({zoom:!1}),n.jSPlugin.Zoom.stopZoom())};n.disabled?(console.log("操作频繁,等待2秒后执行"),n.seekTimer&&clearTimeout(n.seekTimer),n.seekTimer=setTimeout((function(){o(i)}),n.seekFrequency)):o(i)}}}).then((function(){n.syncTimeLine()}));var l,d,u=null===(e=document.getElementById("".concat(this.jSPlugin.id,"-wrap")))||void 0===e||null===(t=e.classList)||void 0===t?void 0:t.contains("ezuikit-player-wrap-mobile-fullscreen");if(document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"))&&!this.jSPlugin._isCurrentBrowserFullscreen&&!u){var m=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container")).clientHeight;this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-m,!0)}l=c.jSPlugin,d=document.getElementById("".concat(l.id,"-wrap")),C("".concat(l.staticPath,"/rec/datepicker.min.css")),ve.append(["".concat(l.staticPath,"/rec/jquery.min.js"),"".concat(l.staticPath,"/rec/datepicker.js"),"".concat(l.staticPath,"/rec/datepicker.").concat(c.datepickerLang[l.language],".js")],(function(){var e=d.getElementsByClassName("datepicker-container")[0];!e&&$("#".concat(l.id,"-datepicker")).datepicker&&$("#".concat(l.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:c.datepickerLang[l.language],date:new Date(j("begin",l.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:d}),(e=d.getElementsByClassName("datepicker-container")[0])&&(e.style.display="none"),c.datepickerVisible=!1,$("#".concat(l.id,"-datepicker")).on("pick.datepicker",(function(t){if(console.log("重新选择日期",t.date,new Date(t.date).Format("yyyyMMddhhmmss"),new Date(document.getElementById("".concat(l.id,"-datepicker")).value).Format("yyyyMMdd")),t.date>new Date||new Date(t.date).Format("yyyyMMddhhmmss")===new Date(document.getElementById("".concat(l.id,"-datepicker")).value).Format("yyyyMMdd"))t.preventDefault();else{var n=new Date(t.date).Format("yyyy-MM-dd");document.getElementById("".concat(l.id,"-datepicker")).value=n,c.jSPlugin.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:n}}),c.renderRec(new Date(t.date).Format("yyyy-MM-dd")),l.Theme.decoderState&&l.Theme.decoderState.state?l.Theme.decoderState.state.cloudRec?l.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"},(function(){}),!1).then((function(e){c.jSPlugin.Theme.decoderState.state.sound&&c.jSPlugin.openSound()})):l.Theme.decoderState.state.rec?l.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"rec"},(function(){}),!1).then((function(e){c.jSPlugin.Theme.decoderState.state.sound&&c.jSPlugin.openSound()})):l.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss")},(function(){}),!1).then((function(e){c.jSPlugin.Theme.decoderState.state.sound&&c.jSPlugin.openSound()})):l.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss")},(function(){}),!1).then((function(e){c.jSPlugin.Theme.decoderState.state.sound&&c.jSPlugin.openSound()}))}e&&(e.style.display="none"),c.datepickerVisible=!1,l.Theme&&l.Theme.decoderState&&l.Theme.decoderState.state&&l.Theme.decoderState.state.zoom&&(l.Theme.setDecoderState({zoom:!1}),l.Zoom.stopZoom())})),$("#".concat(l.id,"-datepicker")).off("click").on("click",(function(t){console.log("点击日期"),c.datepickerVisible?e&&(e.style.display="none"):e&&(e.style.display="inline"),c.datepickerVisible=!c.datepickerVisible}))}),(function(){})),document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-add")).onclick=function(){n.unSyncTimeLine().then((function(){n.currentTimeWidth<3&&n.timeLine.changeSize(++n.currentTimeWidth),n.syncTimeLine()}))},document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-sub")).onclick=function(){n.unSyncTimeLine().then((function(){n.currentTimeWidth>0&&n.timeLine.changeSize(--n.currentTimeWidth),n.syncTimeLine()}))};var h=j("begin",this.jSPlugin.url)||(new Date).Format("yyyyMMdd");h=ae(h,j("timeZone",this.jSPlugin.url)?parseInt(j("timeZone",this.jSPlugin.url)):0),this.renderRec(h.Format("yyyy-MM-dd")),this.observer=new MutationObserver((function(e,t){}));var p=document.getElementById("".concat(this.jSPlugin.id));this.observer.observe(p,{attributes:!0,attributeOldValue:!0,attributeFilter:["style"]})}},{key:"destroy",value:function(){ce.listInstances().length<=1&&(I("".concat(this.jSPlugin.staticPath,"/rec/datepicker.min.css")),ve.remove(["".concat(this.jSPlugin.staticPath,"/rec/jquery.min.js"),"".concat(this.jSPlugin.staticPath,"/rec/datepicker.js"),"".concat(this.jSPlugin.staticPath,"/rec/datepicker.").concat(this.datepickerLang[this.jSPlugin.language],".js")]))}},{key:"setDatepickerDate",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(t){var n=t.getElementsByClassName("datepicker-container")[0];if(n){var i=n;i.parentNode.removeChild(i),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"));if(e){var t=e.getElementsByClassName("datepicker-container")[0];t&&(t.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,n=this,i=parseInt(getComputedStyle(document.getElementById(n.jSPlugin.id)).width,10)-100;document.getElementById("".concat(this.jSPlugin.id,"-canvas"))&&i!==parseInt(document.getElementById("".concat(n.jSPlugin.id,"-canvas")).width)&&n.unSyncTimeLine().then((function(){n.timeLine.setWidth({id:"".concat(t.jSPlugin.id),width:i}),n.syncTimeLine(),e&&e()}))}},{key:"syncTimeLine",value:function(){var e=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((function(e){clearInterval(e)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];var t=this;this.jSPlugin.recTimer=setInterval((function(){t.jSPlugin.getOSDTime().then((function(n){var i=n.data;if(-1===i)console.log("获取播放时间错误");else if(i>0){var o=new Date(i>1e12?i:1e3*i);e.nowTime=o,t.timeLine.run({time:o})}})).catch((function(e){var n=t.jSPlugin.Theme.decoderState.state.pauseDate;t.timeLine.run({time:t.timeLine.nowTime||n})}))}),1e3),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer)}},{key:"unSyncTimeLine",value:function(){var e=this;return new Promise((function(t,n){e.jSPlugin.recTimer&&(clearInterval(e.jSPlugin.recTimer),e.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[e.jSPlugin.id])&&(window.recTimer[e.jSPlugin.id].map((function(e){clearInterval(e)})),window.recTimer[e.jSPlugin.id]=[]):window.recTimer={},t()}))}},{key:"renderRec",value:function(e){var t=this;this.date=e;var n=this,i=new Date(new Date(e).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime();this.jSPlugin.timeZone&&-1===this.jSPlugin.url.indexOf(".cloud")&&(i=new Date(re(new Date(i),this.jSPlugin.timeZone).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime());var o=new Date(new Date(i).Format("yyyy-MM-dd 23:59:59").replace(/-/g,"/")).getTime();if(this.timeLine.getRecord([],i,o),this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===j("busType",this.jSPlugin.url)){var a={deviceSerial:R(this.jSPlugin.url).deviceSerial,channelNo:R(this.jSPlugin.url).channelNo,startTime:i,endTime:o,spaceId:this.jSPlugin._spaceId};oe(this.jSPlugin,a).then((function(e){if(e.data&&e.data.length>0){var a=e.data;n.recList=a,n.lastDate=a[a.length-1].endTime,t.timeLine.getRecord(a,i,o)}}))}else if(-1===this.jSPlugin.url.indexOf(".cloud")){var r={accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,recType:"cloud.rec"===R(this.jSPlugin.url).type?1:2,deviceSerial:R(this.jSPlugin.url).deviceSerial,channelNo:R(this.jSPlugin.url).channelNo,startTime:i,endTime:o,version:"2.0",pageSize:200},s=[],c=function(e){if(e.meta&&200==e.meta.code){if(e.data&&Array.isArray(e.data.records)){var a=e.data.records.map((function(e){return e.startTime=1e3*e.startTime,e.endTime=1e3*e.endTime,e}));s=s.concat(a)}if(e.data&&e.data.hasMore){var d=t.jSPlugin.env.domain+"/api/v3/device/local/video/unify/query?accessToken="+(t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.video)+"&deviceSerial="+R(t.jSPlugin.url).deviceSerial+"&channelNo="+R(t.jSPlugin.url).channelNo+"&startTime="+e.data.nextFileTime+"&endTime="+o/1e3+"&pageSize=200";fetch(d,{method:"GET",headers:y(y({},r),{},{startTime:e.data.nextFileTime})}).then((function(e){return e.json()})).then((function(e){e&&e.meta&&200==e.meta.code?c(e):l(e)})).catch((function(e){l(e)}))}else s.length>0&&(n.recList=s,n.lastDate=s[s.length-1].endTime,n.timeLine.getRecord(s,i,o)),n.timeLine.run({time:new Date(i)})}},l=function(e){console.log("获取片段失败",e)},d=this.jSPlugin.env.domain+"/api/v3/device/local/video/unify/query?accessToken="+(this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video)+"&deviceSerial="+R(this.jSPlugin.url).deviceSerial+"&channelNo="+R(this.jSPlugin.url).channelNo+"&startTime="+i/1e3+"&endTime="+o/1e3+"&pageSize=200";fetch(d,{method:"GET",headers:r}).then((function(e){return e.json()})).then((function(e){e&&e.meta&&200==e.meta.code?c(e):l(e)})).catch((function(e){l(e)}))}else{var u={accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,recType:1,deviceSerial:R(this.jSPlugin.url).deviceSerial,channelNo:R(this.jSPlugin.url).channelNo,startTime:i,endTime:o,version:"2.0"},m=this.jSPlugin.env.domain+"/api/lapp/video/by/time";B(m,"POST",u,"",(function(e){if(e.data&&e.data.files&&e.data.files.length>0){var a=e.data.files,r=(new Date).getTime(),s=e.data.isAll;if(n.recList=a,n.lastDate=a[a.length-1].endTime,s)t.timeLine.getRecord(a,i,o);else{u.startTime=r,B(t.jSPlugin.env.domain+"/api/lapp/video/by/time","POST",u,"",(function(e){e.data&&e.data.files&&e.data.files.length>0&&0==e.data.isAll?(e.data.files&&(a.concat(e.data.files),S("dataArr"),n.recList=a,n.lastDate=a[a.length-1].endTime),e.data.nextFileTime>0?e.data.nextFileTime:(new Date).getTime(),S("nextFileTime"),recTransaction()):n.timeLine.getRecord(a,i,o)}))}t.timeLine.run({time:new Date(i)})}else e.data&&e.data.length>0&&(n.recList=e.data,n.lastDate=e.data[e.data.length-1].endTime,n.timeLine.getRecord(e.data,i,o),n.timeLine.run({time:new Date(i)}))}))}}}])}();function Se(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(){function e(t,n,i){function o(r,s){if(!n[r]){if(!t[r]){if(!s&&Se)return Se(r);if(a)return a(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[r]={exports:{}};t[r][0].call(l.exports,(function(e){return o(t[r][1][e]||e)}),l,l.exports,e,t,n,i)}return n[r].exports}for(var a=Se,r=0;r<i.length;r++)o(i[r]);return o}return e}()({1:[function(e,t,n){var i=(0,e("./adapter_factory.js").adapterFactory)({window:window});window.adapter=i,t.exports=i},{"./adapter_factory.js":2}],2:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.adapterFactory=d;var i=l(e("./utils")),o=l(e("./chrome/chrome_shim")),a=l(e("./edge/edge_shim")),r=l(e("./firefox/firefox_shim")),s=l(e("./safari/safari_shim")),c=l(e("./common_shim"));function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}
9
- /*
10
- * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
11
- *
12
- * Use of this source code is governed by a BSD-style license
13
- * that can be found in the LICENSE file in the root of the source
14
- * tree.
15
- */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},n=i.log,l=i.detectBrowser(e),d={browserDetails:l,commonShim:c,extractVersion:i.extractVersion,disableLog:i.disableLog,disableWarnings:i.disableWarnings};switch(l.browser){case"chrome":if(!o||!o.shimPeerConnection||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),d;n("adapter.js shimming chrome."),d.browserShim=o,o.shimGetUserMedia(e),o.shimMediaStream(e),o.shimPeerConnection(e),o.shimOnTrack(e),o.shimAddTrackRemoveTrack(e),o.shimGetSendersWithDtmf(e),o.shimGetStats(e),o.shimSenderReceiverGetStats(e),o.fixNegotiationNeeded(e),c.shimRTCIceCandidate(e),c.shimConnectionState(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e),c.removeAllowExtmapMixed(e);break;case"firefox":if(!r||!r.shimPeerConnection||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),d;n("adapter.js shimming firefox."),d.browserShim=r,r.shimGetUserMedia(e),r.shimPeerConnection(e),r.shimOnTrack(e),r.shimRemoveStream(e),r.shimSenderGetStats(e),r.shimReceiverGetStats(e),r.shimRTCDataChannel(e),r.shimAddTransceiver(e),r.shimCreateOffer(e),r.shimCreateAnswer(e),c.shimRTCIceCandidate(e),c.shimConnectionState(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e);break;case"edge":if(!a||!a.shimPeerConnection||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),d;n("adapter.js shimming edge."),d.browserShim=a,a.shimGetUserMedia(e),a.shimGetDisplayMedia(e),a.shimPeerConnection(e),a.shimReplaceTrack(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e);break;case"safari":if(!s||!t.shimSafari)return n("Safari shim is not included in this adapter release."),d;n("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),c.shimRTCIceCandidate(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e),c.removeAllowExtmapMixed(e);break;default:n("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,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i="function"==typeof Symbol&&"symbol"===T(Symbol.iterator)?function(e){return T(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":T(e)},o=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return o.shimGetUserMedia}});var a=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return a.shimGetDisplayMedia}}),n.shimMediaStream=l,n.shimOnTrack=d,n.shimGetSendersWithDtmf=u,n.shimGetStats=m,n.shimSenderReceiverGetStats=h,n.shimAddTrackRemoveTrackWithNative=p,n.shimAddTrackRemoveTrack=g,n.shimPeerConnection=f,n.fixNegotiationNeeded=v;var r=s(e("../utils.js"));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function d(e){if("object"===(void 0===e?"undefined":i(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 n=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(i){var o=void 0;o=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===i.track.id})):{track:i.track};var a=new Event("track");a.track=i.track,a.receiver=o,a.transceiver={receiver:o},a.streams=[t.stream],n.dispatchEvent(a)})),t.stream.getTracks().forEach((function(i){var o=void 0;o=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===i.id})):{track:i};var a=new Event("track");a.track=i,a.receiver=o,a.transceiver={receiver:o},a.streams=[t.stream],n.dispatchEvent(a)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else r.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))}function u(e){if("object"===(void 0===e?"undefined":i(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 n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){var o=n.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};var o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){o.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var a=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._senders=this._senders||[],a.apply(this,[e]),e.getTracks().forEach((function(e){n._senders.push(t(n,e))}))};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((function(e){var n=t._senders.find((function(t){return t.track===e}));n&&t._senders.splice(t._senders.indexOf(n),1)}))}}else if("object"===(void 0===e?"undefined":i(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 m(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,n=Array.prototype.slice.call(arguments),i=n[0],o=n[1],a=n[2];if(arguments.length>0&&"function"==typeof i)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof i))return t.apply(this,[]);var r=function(e){var t={};return e.result().forEach((function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){n[t]=e.stat(t)})),t[n.id]=n})),t},s=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};if(arguments.length>=2){var c=function(e){o(s(r(e)))};return t.apply(this,[c,i])}return new Promise((function(n,i){t.apply(e,[function(e){n(s(r(e)))},i])})).then(o,a)}}}function h(e){if("object"===(void 0===e?"undefined":i(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,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return r.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var o=e.RTCPeerConnection.prototype.getReceivers;o&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=o.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),r.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 r.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],n=void 0,i=void 0,o=void 0;return this.getSenders().forEach((function(e){e.track===t&&(n?o=!0:n=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(i?o=!0:i=e),e.track===t})),o||n&&i?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():i?i.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return a.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,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var i=this.getSenders();n.apply(this,arguments);var o=this.getSenders().filter((function(e){return-1===i.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(o)};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};var o=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(n){var i=t._shimmedLocalStreams[n].indexOf(e);-1!==i&&t._shimmedLocalStreams[n].splice(i,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]})),o.apply(this,arguments)}}function g(e){if(e.RTCPeerConnection){var t=r.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return p(e);var n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(n.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var o=new e.MediaStream(t.getTracks());this._streams[t.id]=o,this._reverseStreams[o.id]=t,t=o}i.apply(this,[t])};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.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,n){var i=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var o=[].slice.call(arguments,1);if(1!==o.length||!o[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");if(this.getSenders().find((function(e){return e.track===t})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var a=this._streams[n.id];if(a)a.addTrack(t),Promise.resolve().then((function(){i.dispatchEvent(new Event("negotiationneeded"))}));else{var r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=c({},t,(function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[function(n){var i=l(e,n);t[0].apply(null,[i])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then((function(t){return l(e,t)}))}));e.RTCPeerConnection.prototype[t]=i[t]}));var a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=d(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};var s=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=s.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 n=void 0;Object.keys(this._streams).forEach((function(i){t._streams[i].getTracks().find((function(t){return e.track===t}))&&(n=t._streams[i])})),n&&(1===n.getTracks().length?this.removeStream(this._reverseStreams[n.id]):n.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function l(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var i=e._reverseStreams[t],o=e._streams[i.id];n=n.replace(new RegExp(o.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function d(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var i=e._reverseStreams[t],o=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),o.id)})),new RTCSessionDescription({type:t.type,sdp:n})}}function f(e){var t=r.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=c({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=i[t]}));var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}function v(e){r.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){if("stable"===e.target.signalingState)return e}))}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,n){function i(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((function(t){var i=n.video&&n.video.width,o=n.video&&n.video.height,a=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:a||3}},i&&(n.video.mandatory.maxWidth=i),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=i},{}],5:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===T(Symbol.iterator)?function(e){return T(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":T(e)};n.shimGetUserMedia=s;var o=a(e("../utils.js"));function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var r=o.log;function s(e){var t=e&&e.navigator;if(t.mediaDevices){var n=o.detectBrowser(e),a=function(e){if("object"!==(void 0===e?"undefined":i(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var o="object"===i(e[n])?e[n]:{ideal:e[n]};void 0!==o.exact&&"number"==typeof o.exact&&(o.min=o.max=o.exact);var a=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==o.ideal){t.optional=t.optional||[];var r={};"number"==typeof o.ideal?(r[a("min",n)]=o.ideal,t.optional.push(r),(r={})[a("max",n)]=o.ideal,t.optional.push(r)):(r[a("",n)]=o.ideal,t.optional.push(r))}void 0!==o.exact&&"number"!=typeof o.exact?(t.mandatory=t.mandatory||{},t.mandatory[a("",n)]=o.exact):["min","max"].forEach((function(e){void 0!==o[e]&&(t.mandatory=t.mandatory||{},t.mandatory[a(e,n)]=o[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,o){if(n.version>=61)return o(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===i(e.audio)){var s=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};s((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=a(e.audio)}if(e&&"object"===i(e.video)){var c=e.video.facingMode;c=c&&("object"===(void 0===c?"undefined":i(c))?c:{ideal:c});var l=n.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||l)){delete e.video.facingMode;var d=void 0;if("environment"===c.exact||"environment"===c.ideal?d=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(d=["front"]),d)return t.mediaDevices.enumerateDevices().then((function(t){var n=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return d.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!n&&t.length&&d.includes("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=c.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=a(e.video),r("chrome: "+JSON.stringify(e)),o(e)}))}e.video=a(e.video)}return r("chrome: "+JSON.stringify(e)),o(e)},c=function(e){return n.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}}},l=function(e,n,i){s(e,(function(e){t.webkitGetUserMedia(e,n,(function(e){i&&i(c(e))}))}))};if(t.getUserMedia=l.bind(t),t.mediaDevices.getUserMedia){var d=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return s(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(c(e))}))}))}}}}},{"../utils.js":15}],6:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===T(Symbol.iterator)?function(e){return T(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":T(e)};n.shimRTCIceCandidate=c,n.shimMaxMessageSize=l,n.shimSendThrowTypeError=d,n.shimConnectionState=u,n.removeAllowExtmapMixed=m;var o=s(e("sdp")),a=r(e("./utils"));function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function s(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":i(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 n=new t(e),a=o.default.parseCandidate(e.candidate),r=Object.assign(n,a);return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,a.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}}function l(e){if(e.RTCPeerConnection){var t=a.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=function(e){if(!e||!e.sdp)return!1;var t=o.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=o.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},i=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n},r=function(e){var n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},s=function(e,n){var i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);var a=o.default.matchPrefix(e.sdp,"a=max-message-size:");return a.length>0?i=parseInt(a[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},c=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}),n(arguments[0])){var e=i(arguments[0]),o=r(e),a=s(arguments[0],e),l=void 0;l=0===o&&0===a?Number.POSITIVE_INFINITY:0===o||0===a?Math.max(o,a):Math.min(o,a);var d={};Object.defineProperty(d,"maxMessageSize",{get:function(){return l}}),this._sctp=d}return c.apply(this,arguments)}}}function d(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 n(e,this),e},a.wrapPeerConnectionEvent(e,"datachannel",(function(e){return n(e.channel,e.target),e}))}function n(e,t){var n=e.send;e.send=function(){var i=arguments[0],o=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&o>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}}function u(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 n=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 n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}}function m(e){if(e.RTCPeerConnection){var t=a.detectBrowser(e);if(!("chrome"===t.browser&&t.version>=71)){var n=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")),n.apply(this,arguments)}}}}},{"./utils":15,sdp:17}],7:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),n.shimPeerConnection=d,n.shimReplaceTrack=u;var a=l(e("../utils")),r=e("./filtericeservers"),s=c(e("rtcpeerconnection-shim"));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function d(e){var t=a.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 n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.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 i=(0,s.default)(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,r.filterIceServers)(e.iceServers,t.version),a.log("ICE servers after filtering:",e.iceServers)),new i(e)},e.RTCPeerConnection.prototype=i.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,n){Object.defineProperty(n,"__esModule",{value:!0}),n.filterIceServers=a;var i=o(e("../utils"));function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){var n=!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&&i.deprecated("RTCIceServer.url","RTCIceServer.urls");var o="string"==typeof t;return o&&(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&&!n?(n=!0,!0):t&&!n})),delete e.url,e.urls=o?t[0]:t,!!t.length}}))}},{"../utils":15}],9:[function(e,t,n){function i(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(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=i},{}],10:[function(e,t,n){function i(e){var t=e&&e.navigator,n=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},i=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return i(e).catch((function(e){return Promise.reject(n(e))}))}}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetUserMedia=i},{}],11:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i="function"==typeof Symbol&&"symbol"===T(Symbol.iterator)?function(e){return T(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":T(e)},o=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return o.shimGetUserMedia}});var a=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return a.shimGetDisplayMedia}}),n.shimOnTrack=l,n.shimPeerConnection=d,n.shimSenderGetStats=u,n.shimReceiverGetStats=m,n.shimRemoveStream=h,n.shimRTCDataChannel=p,n.shimAddTransceiver=g,n.shimCreateOffer=f,n.shimCreateAnswer=v;var r=s(e("../utils"));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){"object"===(void 0===e?"undefined":i(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 d(e){var t=r.detectBrowser(e);if("object"===(void 0===e?"undefined":i(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=c({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=i[t]})),t.version<68){var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var o={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),n=e[0],i=e[1],r=e[2];return a.apply(this,[n||null]).then((function(e){if(t.version<53&&!i)try{e.forEach((function(e){e.type=o[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:o[t.type]||t.type}))}))}return e})).then(i,r)}}}function u(e){if("object"===(void 0===e?"undefined":i(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,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.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 m(e){if("object"===(void 0===e?"undefined":i(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,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n}),r.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function h(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;r.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)}))})}function p(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function g(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],n=e&&"sendEncodings"in e;n&&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 i=t.apply(this,arguments);if(n){var o=i.sender,a=o.getParameters();"encodings"in a||(a.encodings=e.sendEncodings,this.setParametersPromises.push(o.setParameters(a).catch((function(){}))))}return i})}}function f(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}}function v(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}}},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(e,t,n){function i(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){var i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=i},{}],13:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===T(Symbol.iterator)?function(e){return T(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":T(e)};n.shimGetUserMedia=r;var o=a(e("../utils"));function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){var t=o.detectBrowser(e),n=e&&e.navigator,a=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){o.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var r=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":i(e))&&"object"===i(e.audio)&&(e=JSON.parse(JSON.stringify(e)),r(e.audio,"autoGainControl","mozAutoGainControl"),r(e.audio,"noiseSuppression","mozNoiseSuppression")),s(e)},a&&a.prototype.getSettings){var c=a.prototype.getSettings;a.prototype.getSettings=function(){var e=c.apply(this,arguments);return r(e,"mozAutoGainControl","autoGainControl"),r(e,"mozNoiseSuppression","noiseSuppression"),e}}if(a&&a.prototype.applyConstraints){var l=a.prototype.applyConstraints;a.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":i(e))&&(e=JSON.parse(JSON.stringify(e)),r(e,"autoGainControl","mozAutoGainControl"),r(e,"noiseSuppression","mozNoiseSuppression")),l.apply(this,[e])}}}}},{"../utils":15}],14:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===T(Symbol.iterator)?function(e){return T(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":T(e)};n.shimLocalStreamsAPI=r,n.shimRemoteStreamsAPI=s,n.shimCallbacksAPI=c,n.shimGetUserMedia=l,n.shimConstraints=d,n.shimRTCIceServerUrls=u,n.shimTrackEventTransceiver=m,n.shimCreateOfferLegacy=h;var o=a(e("../utils"));function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){if("object"===(void 0===e?"undefined":i(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 n=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(i){return t.call(n,i,e)})),e.getVideoTracks().forEach((function(i){return t.call(n,i,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){var n=arguments[1];return n&&(this._localStreams?this._localStreams.includes(n)||this._localStreams.push(n):this._localStreams=[n]),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var n=this._localStreams.indexOf(e);if(-1!==n){this._localStreams.splice(n,1);var i=e.getTracks();this.getSenders().forEach((function(e){i.includes(e.track)&&t.removeTrack(e)}))}})}}function s(e){if("object"===(void 0===e?"undefined":i(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 n=new Event("addstream");n.stream=e,t.dispatchEvent(n)}}))})}});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 n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}}))}),t.apply(e,arguments)}}}function c(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,n=t.createOffer,o=t.createAnswer,a=t.setLocalDescription,r=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var i=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[i]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=o.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};var c=function(e,t,n){var i=a.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=c,c=function(e,t,n){var i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=c,c=function(e,t,n){var i=s.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=c}}function l(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var n=t.mediaDevices,i=n.getUserMedia.bind(n);t.mediaDevices.getUserMedia=function(e){return i(d(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function d(e){return e&&void 0!==e.video?Object.assign({},e,{video:o.compactObject(e.video)}):e}function u(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var i=[],a=0;a<e.iceServers.length;a++){var r=e.iceServers[a];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(o.deprecated("RTCIceServer.url","RTCIceServer.urls"),(r=JSON.parse(JSON.stringify(r))).urls=r.url,delete r.url,i.push(r)):i.push(e.iceServers[a])}e.iceServers=i}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})}function m(e){"object"===(void 0===e?"undefined":i(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 h(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var n=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&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.offerToReceiveAudio||n||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var i=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&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.offerToReceiveVideo||i||this.addTransceiver("video")}return t.apply(this,arguments)}}},{"../utils":15}],15:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===T(Symbol.iterator)?function(e){return T(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":T(e)};function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.extractVersion=s,n.wrapPeerConnectionEvent=c,n.disableLog=l,n.disableWarnings=d,n.log=u,n.deprecated=m,n.detectBrowser=h,n.compactObject=g,n.walkStats=f,n.filterStats=v;var a=!0,r=!0;function s(e,t,n){var i=e.match(t);return i&&i.length>=n&&parseInt(i[n],10)}function c(e,t,n){if(e.RTCPeerConnection){var i=e.RTCPeerConnection.prototype,o=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return o.apply(this,arguments);var a=function(e){var t=n(e);t&&i(t)};return this._eventMap=this._eventMap||{},this._eventMap[i]=a,o.apply(this,[e,a])};var a=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return a.apply(this,arguments);var i=this._eventMap[n];return delete this._eventMap[n],a.apply(this,[e,i])},Object.defineProperty(i,"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 l(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":i(e))+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function d(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":i(e))+". Please use a boolean."):(r=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function u(){if("object"===("undefined"==typeof window?"undefined":i(window))){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function m(e,t){r&&console.warn(e+" is deprecated, please use "+t+" instead.")}function h(e){var t=e.navigator,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=s(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)n.browser="chrome",n.version=s(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=s(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=s(t.userAgent,/AppleWebKit\/(\d+)\./,1),n.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return n}function p(e){return"[object Object]"===Object.prototype.toString.call(e)}function g(e){return p(e)?Object.keys(e).reduce((function(t,n){var i=p(e[n]),a=i?g(e[n]):e[n],r=i&&!Object.keys(a).length;return void 0===a||r?t:Object.assign(t,o({},n,a))}),{}):e}function f(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((function(i){i.endsWith("Id")?f(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach((function(t){f(e,e.get(t),n)}))})))}function v(e,t,n){var i=n?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;var a=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&a.push(e)})),a.forEach((function(t){e.forEach((function(n){n.type===i&&n.trackId===t.id&&f(e,n,o)}))})),o}},{}],16:[function(e,t,n){var i=e("sdp");function o(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}function a(e,t,n,o,a){var r=i.writeRtpDescription(e.kind,t);if(r+=i.writeIceParameters(e.iceGatherer.getLocalParameters()),r+=i.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":a||"active"),r+="a=mid:"+e.mid+"\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 s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var c="msid:"+(o?o.id:"-")+" "+s+"\r\n";r+="a="+c,r+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,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:"+i.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),r}function r(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var i=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var o="string"==typeof i;return o&&(i=[i]),i=i.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||n?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)})),delete e.url,e.urls=o?i[0]:i,!!i.length}}))}function s(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},i=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},o=function(e,t,n,o){var a=i(e.parameters.apt,n),r=i(t.parameters.apt,o);return a&&r&&a.name.toLowerCase()===r.name.toLowerCase()};return e.codecs.forEach((function(i){for(var a=0;a<t.codecs.length;a++){var r=t.codecs[a];if(i.name.toLowerCase()===r.name.toLowerCase()&&i.clockRate===r.clockRate){if("rtx"===i.name.toLowerCase()&&i.parameters&&r.parameters.apt&&!o(i,r,e.codecs,t.codecs))continue;(r=JSON.parse(JSON.stringify(r))).numChannels=Math.min(i.numChannels,r.numChannels),n.codecs.push(r),r.rtcpFeedback=r.rtcpFeedback.filter((function(e){for(var t=0;t<i.rtcpFeedback.length;t++)if(i.rtcpFeedback[t].type===e.type&&i.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var i=0;i<t.headerExtensions.length;i++){var o=t.headerExtensions[i];if(e.uri===o.uri){n.headerExtensions.push(o);break}}})),n}function c(e,t,n){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(n)}function l(e,t){var n=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 n||e.addRemoteCandidate(t),!n}function d(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}t.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function u(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}function m(t,n,i,o){var a=new Event("track");a.track=n,a.receiver=i,a.transceiver={receiver:i},a.streams=o,e.setTimeout((function(){t._dispatchEvent("track",a)}))}var h=function(n){var o=this,a=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){o[e]=a[e].bind(a)})),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",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw d("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=r(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var s=n.iceCandidatePoolSize;s>0;s--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=i.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(h.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(h.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),h.prototype.onicecandidate=null,h.prototype.onaddstream=null,h.prototype.ontrack=null,h.prototype.onremovestream=null,h.prototype.onsignalingstatechange=null,h.prototype.oniceconnectionstatechange=null,h.prototype.onconnectionstatechange=null,h.prototype.onicegatheringstatechange=null,h.prototype.onnegotiationneeded=null,h.prototype.ondatachannel=null,h.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},h.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},h.prototype.getConfiguration=function(){return this._config},h.prototype.getLocalStreams=function(){return this.localStreams},h.prototype.getRemoteStreams=function(){return this.remoteStreams},h.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,i={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&&n)i.iceTransport=this.transceivers[0].iceTransport,i.dtlsTransport=this.transceivers[0].dtlsTransport;else{var o=this._createIceAndDtlsTransports();i.iceTransport=o.iceTransport,i.dtlsTransport=o.dtlsTransport}return t||this.transceivers.push(i),i},h.prototype.addTrack=function(t,n){if(this._isClosed)throw d("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var i;if(this.transceivers.find((function(e){return e.track===t})))throw d("InvalidAccessError","Track already exists.");for(var o=0;o<this.transceivers.length;o++)this.transceivers[o].track||this.transceivers[o].kind!==t.kind||(i=this.transceivers[o]);return i||(i=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),i.track=t,i.stream=n,i.rtpSender=new e.RTCRtpSender(t,i.dtlsTransport),i.rtpSender},h.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var i=e.clone();e.getTracks().forEach((function(e,t){var n=i.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),i.getTracks().forEach((function(e){n.addTrack(e,i)}))}},h.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 n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw d("InvalidAccessError","Sender was not created by this connection.");var i=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null;var o=this.transceivers.map((function(e){return e.stream}));-1===o.indexOf(i)&&this.localStreams.indexOf(i)>-1&&this.localStreams.splice(this.localStreams.indexOf(i),1),this._maybeFireNegotiationNeeded()},h.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},h.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},h.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},h.prototype._createIceGatherer=function(t,n){var i=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var o=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(o,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;o.state=n?"completed":"gathering",null!==i.transceivers[t].bufferedCandidateEvents&&i.transceivers[t].bufferedCandidateEvents.push(e)},o.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),o},h.prototype._gather=function(t,n){var o=this,a=this.transceivers[n].iceGatherer;if(!a.onlocalcandidate){var r=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,a.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),a.onlocalcandidate=function(e){if(!(o.usingBundle&&n>0)){var r=new Event("icecandidate");r.candidate={sdpMid:t,sdpMLineIndex:n};var s=e.candidate,c=!s||0===Object.keys(s).length;if(c)"new"!==a.state&&"gathering"!==a.state||(a.state="completed");else{"new"===a.state&&(a.state="gathering"),s.component=1,s.ufrag=a.getLocalParameters().usernameFragment;var l=i.writeCandidate(s);r.candidate=Object.assign(r.candidate,i.parseCandidate(l)),r.candidate.candidate=l,r.candidate.toJSON=function(){return{candidate:r.candidate.candidate,sdpMid:r.candidate.sdpMid,sdpMLineIndex:r.candidate.sdpMLineIndex,usernameFragment:r.candidate.usernameFragment}}}var d=i.getMediaSections(o._localDescription.sdp);d[r.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+r.candidate.candidate+"\r\n",o._localDescription.sdp=i.getDescription(o._localDescription.sdp)+d.join("");var u=o.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==o.iceGatheringState&&(o.iceGatheringState="gathering",o._emitGatheringStateChange()),c||o._dispatchEvent("icecandidate",r),u&&(o._dispatchEvent("icecandidate",new Event("icecandidate")),o.iceGatheringState="complete",o._emitGatheringStateChange())}},e.setTimeout((function(){r.forEach((function(e){a.onlocalcandidate(e)}))}),0)}},h.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var i=new e.RTCDtlsTransport(n);return i.ondtlsstatechange=function(){t._updateConnectionState()},i.onerror=function(){Object.defineProperty(i,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:i}},h.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var i=this.transceivers[e].dtlsTransport;i&&(delete i.ondtlsstatechange,delete i.onerror,delete this.transceivers[e].dtlsTransport)},h.prototype._transceive=function(e,n,o){var a=s(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:i.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),o&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},h.prototype.setLocalDescription=function(e){var t,n,o=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(d("TypeError",'Unsupported type "'+e.type+'"'));if(!c("setLocalDescription",e.type,o.signalingState)||o._isClosed)return Promise.reject(d("InvalidStateError","Can not set local "+e.type+" in state "+o.signalingState));if("offer"===e.type)t=i.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=i.parseRtpParameters(e);o.transceivers[t].localCapabilities=n})),o.transceivers.forEach((function(e,t){o._gather(e.mid,t)}));else if("answer"===e.type){t=i.splitSections(o._remoteDescription.sdp),n=t.shift();var a=i.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var r=o.transceivers[t],c=r.iceGatherer,l=r.iceTransport,d=r.dtlsTransport,u=r.localCapabilities,m=r.remoteCapabilities;if(!(i.isRejected(e)&&0===i.matchPrefix(e,"a=bundle-only").length||r.rejected)){var h=i.getIceParameters(e,n),p=i.getDtlsParameters(e,n);a&&(p.role="server"),o.usingBundle&&0!==t||(o._gather(r.mid,t),"new"===l.state&&l.start(c,h,a?"controlling":"controlled"),"new"===d.state&&d.start(p));var g=s(u,m);o._transceive(r,g.codecs.length>0,!1)}}))}return o._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?o._updateSignalingState("have-local-offer"):o._updateSignalingState("stable"),Promise.resolve()},h.prototype.setRemoteDescription=function(o){var a=this;if(-1===["offer","answer"].indexOf(o.type))return Promise.reject(d("TypeError",'Unsupported type "'+o.type+'"'));if(!c("setRemoteDescription",o.type,a.signalingState)||a._isClosed)return Promise.reject(d("InvalidStateError","Can not set remote "+o.type+" in state "+a.signalingState));var r={};a.remoteStreams.forEach((function(e){r[e.id]=e}));var h=[],p=i.splitSections(o.sdp),g=p.shift(),f=i.matchPrefix(g,"a=ice-lite").length>0,v=i.matchPrefix(g,"a=group:BUNDLE ").length>0;a.usingBundle=v;var y=i.matchPrefix(g,"a=ice-options:")[0];return a.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(c,d){var m=i.splitLines(c),p=i.getKind(c),y=i.isRejected(c)&&0===i.matchPrefix(c,"a=bundle-only").length,S=m[0].substr(2).split(" ")[2],_=i.getDirection(c,g),b=i.parseMsid(c),w=i.getMid(c)||i.generateIdentifier();if(y||"application"===p&&("DTLS/SCTP"===S||"UDP/DTLS/SCTP"===S))a.transceivers[d]={mid:w,kind:p,protocol:S,rejected:!0};else{var T,E,P,k,C,I,x,j,A;!y&&a.transceivers[d]&&a.transceivers[d].rejected&&(a.transceivers[d]=a._createTransceiver(p,!0));var D,R,L=i.parseRtpParameters(c);y||(D=i.getIceParameters(c,g),(R=i.getDtlsParameters(c,g)).role="client"),x=i.parseRtpEncodingParameters(c);var B=i.parseRtcpParameters(c),M=i.matchPrefix(c,"a=end-of-candidates",g).length>0,O=i.matchPrefix(c,"a=candidate:").map((function(e){return i.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===o.type||"answer"===o.type)&&!y&&v&&d>0&&a.transceivers[d]&&(a._disposeIceAndDtlsTransports(d),a.transceivers[d].iceGatherer=a.transceivers[0].iceGatherer,a.transceivers[d].iceTransport=a.transceivers[0].iceTransport,a.transceivers[d].dtlsTransport=a.transceivers[0].dtlsTransport,a.transceivers[d].rtpSender&&a.transceivers[d].rtpSender.setTransport(a.transceivers[0].dtlsTransport),a.transceivers[d].rtpReceiver&&a.transceivers[d].rtpReceiver.setTransport(a.transceivers[0].dtlsTransport)),"offer"!==o.type||y)"answer"!==o.type||y||(E=(T=a.transceivers[d]).iceGatherer,P=T.iceTransport,k=T.dtlsTransport,C=T.rtpReceiver,I=T.sendEncodingParameters,j=T.localCapabilities,a.transceivers[d].recvEncodingParameters=x,a.transceivers[d].remoteCapabilities=L,a.transceivers[d].rtcpParameters=B,O.length&&"new"===P.state&&(!f&&!M||v&&0!==d?O.forEach((function(e){l(T.iceTransport,e)})):P.setRemoteCandidates(O)),v&&0!==d||("new"===P.state&&P.start(E,D,"controlling"),"new"===k.state&&k.start(R)),!s(T.localCapabilities,T.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&T.sendEncodingParameters[0].rtx&&delete T.sendEncodingParameters[0].rtx,a._transceive(T,"sendrecv"===_||"recvonly"===_,"sendrecv"===_||"sendonly"===_),!C||"sendrecv"!==_&&"sendonly"!==_?delete T.rtpReceiver:(A=C.track,b?(r[b.stream]||(r[b.stream]=new e.MediaStream),n(A,r[b.stream]),h.push([A,C,r[b.stream]])):(r.default||(r.default=new e.MediaStream),n(A,r.default),h.push([A,C,r.default]))));else{(T=a.transceivers[d]||a._createTransceiver(p)).mid=w,T.iceGatherer||(T.iceGatherer=a._createIceGatherer(d,v)),O.length&&"new"===T.iceTransport.state&&(!M||v&&0!==d?O.forEach((function(e){l(T.iceTransport,e)})):T.iceTransport.setRemoteCandidates(O)),j=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(j.codecs=j.codecs.filter((function(e){return"rtx"!==e.name}))),I=T.sendEncodingParameters||[{ssrc:1001*(2*d+2)}];var z,N=!1;"sendrecv"===_||"sendonly"===_?(N=!T.rtpReceiver,C=T.rtpReceiver||new e.RTCRtpReceiver(T.dtlsTransport,p),N&&(A=C.track,b&&"-"===b.stream||(b?(r[b.stream]||(r[b.stream]=new e.MediaStream,Object.defineProperty(r[b.stream],"id",{get:function(){return b.stream}})),Object.defineProperty(A,"id",{get:function(){return b.track}}),z=r[b.stream]):(r.default||(r.default=new e.MediaStream),z=r.default)),z&&(n(A,z),T.associatedRemoteMediaStreams.push(z)),h.push([A,C,z]))):T.rtpReceiver&&T.rtpReceiver.track&&(T.associatedRemoteMediaStreams.forEach((function(e){var t=e.getTracks().find((function(e){return e.id===T.rtpReceiver.track.id}));t&&u(t,e)})),T.associatedRemoteMediaStreams=[]),T.localCapabilities=j,T.remoteCapabilities=L,T.rtpReceiver=C,T.rtcpParameters=B,T.sendEncodingParameters=I,T.recvEncodingParameters=x,a._transceive(a.transceivers[d],!1,N)}}})),void 0===a._dtlsRole&&(a._dtlsRole="offer"===o.type?"active":"passive"),a._remoteDescription={type:o.type,sdp:o.sdp},"offer"===o.type?a._updateSignalingState("have-remote-offer"):a._updateSignalingState("stable"),Object.keys(r).forEach((function(t){var n=r[t];if(n.getTracks().length){if(-1===a.remoteStreams.indexOf(n)){a.remoteStreams.push(n);var i=new Event("addstream");i.stream=n,e.setTimeout((function(){a._dispatchEvent("addstream",i)}))}h.forEach((function(e){var t=e[0],i=e[1];n.id===e[2].id&&m(a,t,i,[n])}))}})),h.forEach((function(e){e[2]||m(a,e[0],e[1],[])})),e.setTimeout((function(){a&&a.transceivers&&a.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()},h.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")},h.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},h.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))},h.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 n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},h.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 n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},h.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(d("InvalidStateError","Can not call createOffer after close"));var o=n.transceivers.filter((function(e){return"audio"===e.kind})).length,r=n.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&&(o=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(r=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--r<0&&(e.wantReceive=!1)}));o>0||r>0;)o>0&&(n._createTransceiver("audio"),o--),r>0&&(n._createTransceiver("video"),r--);var c=i.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(o,a){var r=o.track,s=o.kind,c=o.mid||i.generateIdentifier();o.mid=c,o.iceGatherer||(o.iceGatherer=n._createIceGatherer(a,n.usingBundle));var l=e.RTCRtpSender.getCapabilities(s);t<15019&&(l.codecs=l.codecs.filter((function(e){return"rtx"!==e.name}))),l.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),o.remoteCapabilities&&o.remoteCapabilities.codecs&&o.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),l.headerExtensions.forEach((function(e){(o.remoteCapabilities&&o.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var d=o.sendEncodingParameters||[{ssrc:1001*(2*a+1)}];r&&t>=15019&&"video"===s&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),o.wantReceive&&(o.rtpReceiver=new e.RTCRtpReceiver(o.dtlsTransport,s)),o.localCapabilities=l,o.sendEncodingParameters=d})),"max-compat"!==n._config.bundlePolicy&&(c+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),c+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){c+=a(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),c+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,c+="a="+i.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(c+="a=end-of-candidates\r\n"))}));var l=new e.RTCSessionDescription({type:"offer",sdp:c});return Promise.resolve(l)},h.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(d("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(d("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var o=i.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(o+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),o+="a=ice-options:trickle\r\n";var r=i.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,i){if(!(i+1>r)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?o+="m=application 0 DTLS/SCTP 5000\r\n":o+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?o+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(o+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(o+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;e.stream&&("audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var l=s(e.localCapabilities,e.remoteCapabilities);!l.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,o+=a(e,l,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(o+="a=rtcp-rsize\r\n")}}));var c=new e.RTCSessionDescription({type:"answer",sdp:o});return Promise.resolve(c)},h.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(o,a){if(!n._remoteDescription)return a(d("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var r=e.sdpMLineIndex;if(e.sdpMid)for(var s=0;s<n.transceivers.length;s++)if(n.transceivers[s].mid===e.sdpMid){r=s;break}var c=n.transceivers[r];if(!c)return a(d("OperationError","Can not add ICE candidate"));if(c.rejected)return o();var u=Object.keys(e.candidate).length>0?i.parseCandidate(e.candidate):{};if("tcp"===u.protocol&&(0===u.port||9===u.port))return o();if(u.component&&1!==u.component)return o();if((0===r||r>0&&c.iceTransport!==n.transceivers[0].iceTransport)&&!l(c.iceTransport,u))return a(d("OperationError","Can not add ICE candidate"));var m=e.candidate.trim();0===m.indexOf("a=")&&(m=m.substr(2)),(t=i.getMediaSections(n._remoteDescription.sdp))[r]+="a="+(u.type?m:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=i.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var h=0;h<n.transceivers.length&&(n.transceivers[h].rejected||(n.transceivers[h].iceTransport.addRemoteCandidate({}),(t=i.getMediaSections(n._remoteDescription.sdp))[h]+="a=end-of-candidates\r\n",n._remoteDescription.sdp=i.getDescription(n._remoteDescription.sdp)+t.join(""),!n.usingBundle));h++);o()}))},h.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)})),!n)throw d("InvalidAccessError","Invalid selector.");return n.getStats()}var i=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&i.push(e[t].getStats())}))})),Promise.all(i).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 n=e[t];if(n&&n.prototype&&n.prototype.getStats){var i=n.prototype.getStats;n.prototype.getStats=function(){return i.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){e[n].type=o(e[n]),t.set(n,e[n])})),t}))}}}));var p=["createOffer","createAnswer"];return p.forEach((function(e){var t=h.prototype[e];h.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)}})),(p=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=h.prototype[e];h.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=h.prototype[e];h.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)}})),h}},{sdp:17}],17:[function(e,t,n){var i={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};i.localCName=i.generateIdentifier(),i.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},i.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},i.getDescription=function(e){var t=i.splitSections(e);return t&&t[0]},i.getMediaSections=function(e){var t=i.splitSections(e);return t.shift(),t},i.matchPrefix=function(e,t){return i.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},i.parseCandidate=function(e){for(var t,n={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]},i=8;i<t.length;i+=2)switch(t[i]){case"raddr":n.relatedAddress=t[i+1];break;case"rport":n.relatedPort=parseInt(t[i+1],10);break;case"tcptype":n.tcpType=t[i+1];break;case"ufrag":n.ufrag=t[i+1],n.usernameFragment=t[i+1];break;default:n[t[i]]=t[i+1]}return n},i.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 n=e.type;return t.push("typ"),t.push(n),"host"!==n&&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(" ")},i.parseIceOptions=function(e){return e.substr(14).split(" ")},i.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},i.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},i.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]}},i.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},i.parseFmtp=function(e){for(var t,n={},i=e.substr(e.indexOf(" ")+1).split(";"),o=0;o<i.length;o++)n[(t=i[o].trim().split("="))[0].trim()]=t[1];return n},i.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var i=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)})),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},i.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},i.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},i.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substr(t+1,i-t-1),n.value=e.substr(i+1)):n.attribute=e.substr(t+1),n},i.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},i.getMid=function(e){var t=i.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},i.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},i.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:i.matchPrefix(e+t,"a=fingerprint:").map(i.parseFingerprint)}},i.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},i.getIceParameters=function(e,t){var n=i.splitLines(e);return{usernameFragment:(n=n.concat(i.splitLines(t))).filter((function(e){return 0===e.indexOf("a=ice-ufrag:")}))[0].substr(12),password:n.filter((function(e){return 0===e.indexOf("a=ice-pwd:")}))[0].substr(10)}},i.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},i.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=i.splitLines(e)[0].split(" "),o=3;o<n.length;o++){var a=n[o],r=i.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(r){var s=i.parseRtpMap(r),c=i.matchPrefix(e,"a=fmtp:"+a+" ");switch(s.parameters=c.length?i.parseFmtp(c[0]):{},s.rtcpFeedback=i.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(i.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return i.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(i.parseExtmap(e))})),t},i.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=i.writeRtpMap(e),n+=i.writeFmtp(e),n+=i.writeRtcpFb(e)}));var o=0;return t.codecs.forEach((function(e){e.maxptime>o&&(o=e.maxptime)})),o>0&&(n+="a=maxptime:"+o+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=i.writeExtmap(e)})),n},i.parseRtpEncodingParameters=function(e){var t,n=[],o=i.parseRtpParameters(e),a=-1!==o.fecMechanisms.indexOf("RED"),r=-1!==o.fecMechanisms.indexOf("ULPFEC"),s=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=s.length>0&&s[0].ssrc,l=i.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));l.length>0&&l[0].length>1&&l[0][0]===c&&(t=l[0][1]),o.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var i={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(i.rtx={ssrc:t}),n.push(i),a&&((i=JSON.parse(JSON.stringify(i))).fec={ssrc:c,mechanism:r?"red+ulpfec":"red"},n.push(i))}})),0===n.length&&c&&n.push({ssrc:c});var d=i.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,n.forEach((function(e){e.maxBitrate=d}))),n},i.parseRtcpParameters=function(e){var t={},n=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var o=i.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=o.length>0,t.compound=0===o.length;var a=i.matchPrefix(e,"a=rtcp-mux");return t.mux=a.length>0,t},i.parseMsid=function(e){var t,n=i.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var o=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return o.length>0?{stream:(t=o[0].value.split(" "))[0],track:t[1]}:void 0},i.parseSctpDescription=function(e){var t,n=i.parseMLine(e),o=i.matchPrefix(e,"a=max-message-size:");o.length>0&&(t=parseInt(o[0].substr(19),10)),isNaN(t)&&(t=65536);var a=i.matchPrefix(e,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(i.matchPrefix(e,"a=sctpmap:").length>0){var r=i.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(r[0],10),protocol:r[1],maxMessageSize:t}}},i.writeSctpDescription=function(e,t){var n=[];return n="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&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},i.generateSessionId=function(){return Math.random().toString().substr(2,21)},i.writeSessionBoilerplate=function(e,t,n){var o=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||i.generateSessionId())+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},i.writeMediaSection=function(e,t,n,o){var a=i.writeRtpDescription(e.kind,t);if(a+=i.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=i.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),a+="a=mid:"+e.mid+"\r\n",e.direction?a+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var r="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";a+="a="+r,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+r,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+r,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+i.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),a},i.getDirection=function(e,t){for(var n=i.splitLines(e),o=0;o<n.length;o++)switch(n[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[o].substr(2)}return t?i.getDirection(t):"sendrecv"},i.getKind=function(e){return i.splitLines(e)[0].split(" ")[0].substr(2)},i.isRejected=function(e){return"0"===e.split(" ",2)[1]},i.parseMLine=function(e){var t=i.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},i.parseOLine=function(e){var t=i.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]}},i.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=i.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},"object"===T(t)&&(t.exports=i)},{}]},{},[1])(1),
16
- /*
17
- The MIT License (MIT)
18
-
19
- Copyright (c) 2016 Meetecho
20
-
21
- Permission is hereby granted, free of charge, to any person obtaining
22
- a copy of this software and associated documentation files (the "Software"),
23
- to deal in the Software without restriction, including without limitation
24
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
25
- and/or sell copies of the Software, and to permit persons to whom the
26
- Software is furnished to do so, subject to the following conditions:
27
-
28
- The above copyright notice and this permission notice shall be included
29
- in all copies or substantial portions of the Software.
30
-
31
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
34
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
35
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
36
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
37
- OTHER DEALINGS IN THE SOFTWARE.
38
- */
39
- be.sessions={},be.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||be.extension.isInstalled()}return!0};var _e={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 n=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var i=new Error("NavigatorUserMediaError");i.name="You cancelled the request for permission, giving up...",n(i)}else n(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&(console.log("clearing ",t.data.id),window.clearTimeout(t.data.id))}))}};function be(e){if(void 0===be.initDone)return e.error("Library not initialized"),{};if(!be.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(be.log("Library initialized: "+be.initDone),(e=e||{}).success="function"==typeof e.success?e.success:be.noop,e.error="function"==typeof e.error?e.error:be.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:be.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var t=!1,n=null,i={},o=null,a=null,r=0,s=e.server;be.isArray(s)?(be.log("Multiple servers provided ("+s.length+"), will use the first that works"),s=null,a=e.server,be.debug(a)):0===s.indexOf("ws")?(t=!0,be.log("Using WebSockets to contact Janus: "+s)):(t=!1,be.log("Using REST API to contact Janus: "+s));var c=e.iceServers;null==c&&(c=[{urls:"stun:stun.l.google.com:19302"}]);var l=e.iceTransportPolicy,u=e.bundlePolicy,m=e.ipv6;null==m&&(m=!1);var h=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(h=!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 g=null;void 0!==e.token&&null!==e.token&&(g=e.token);var f=null;void 0!==e.apisecret&&null!==e.apisecret&&(f=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var v=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(v=e.keepAlivePeriod),isNaN(v)&&(v=25e3);var y=6e4;function S(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&&(y=e.longPollTimeout),isNaN(y)&&(y=6e4);var b=!1,w=null,E={},P=this,k=0,C={};function I(){if(null!=w)if(be.debug("Long poll..."),b){var t=s+"/"+w+"?rid="+(new Date).getTime();null!=p&&(t=t+"&maxev="+p),null!=g&&(t=t+"&token="+encodeURIComponent(g)),null!=f&&(t=t+"&apisecret="+encodeURIComponent(f)),be.httpAPICall(t,{verb:"GET",withCredentials:h,success:x,timeout:y,error:function(t,n){if(be.error(t+":",n),++k>3)return b=!1,void e.error("Lost connection to the server (is it down?)");I()}})}else be.warn("Is the server down? (connected=false)")}function x(e,i){if(k=0,t||null==w||!0===i||I(),t||!be.isArray(e))if("keepalive"!==e.rtcgw)if("ack"!==e.rtcgw)if("success"!==e.rtcgw)if("trickle"===e.rtcgw){if(null==(c=e.sender))return void be.warn("Missing sender...");if(null==(d=E[c]))return void be.debug("This handle is not attached to this session");var o=e.candidate;be.debug("Got a trickled candidate on session "+w),be.debug(o);var a=d.webrtcStuff;a.pc&&a.remoteSdp?(be.debug("Adding remote candidate:",o),o&&!0!==o.completed?a.pc.addIceCandidate(o):a.pc.addIceCandidate(be.endOfCandidates)):(be.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),a.candidates||(a.candidates=[]),a.candidates.push(o),be.debug(a.candidates))}else{if("webrtcup"===e.rtcgw)return be.debug("Got a webrtcup event on session "+w),be.debug(e),null==(c=e.sender)?void be.warn("Missing sender..."):null==(d=E[c])?void be.debug("This handle is not attached to this session"):void d.webrtcState(!0);if("hangup"===e.rtcgw){if(be.debug("Got a hangup event on session "+w),be.debug(e),null==(c=e.sender))return void be.warn("Missing sender...");if(null==(d=E[c]))return void be.debug("This handle is not attached to this session");d.webrtcState(!1,e.reason),d.hangup()}else if("detached"===e.rtcgw){if(be.debug("Got a detached event on session "+w),be.debug(e),null==(c=e.sender))return void be.warn("Missing sender...");if(null==(d=E[c]))return;d.detached=!0,d.ondetached(),d.detach()}else if("media"===e.rtcgw){if(be.debug("Got a media event on session "+w),be.debug(e),null==(c=e.sender))return void be.warn("Missing sender...");if(null==(d=E[c]))return void be.debug("This handle is not attached to this session");d.mediaState(e.type,e.receiving)}else if("slowlink"===e.rtcgw){if(be.debug("Got a slowlink event on session "+w),be.debug(e),null==(c=e.sender))return void be.warn("Missing sender...");if(null==(d=E[c]))return void be.debug("This handle is not attached to this session");d.slowLink(e.uplink,e.lost)}else{if("error"===e.rtcgw){var r,s;if(be.error("Ooops: "+e.error.code+" "+e.error.reason),be.debug(e),null!=(r=e.transaction))null!=(s=C[r])&&s(e),delete C[r];return}if("event"===e.rtcgw){var c;if(be.debug("Got a plugin event on session "+w),be.debug(e),null==(c=e.sender))return void be.warn("Missing sender...");var l=e.plugindata;if(null==l)return void be.warn("Missing plugindata...");be.debug(" -- Event is coming from "+c+" ("+l.plugin+")");var d,u=l.data;if(be.debug(u),null==(d=E[c]))return void be.warn("This handle is not attached to this session");var m=e.jsep;null!=m&&(be.debug("Handling SDP as well..."),be.debug(m));var h=d.onmessage;null!=h?(be.debug("Notifying application..."),h(u,m)):be.debug("No provided notification callback")}else{if("timeout"===e.rtcgw)return be.error("Timeout on session "+w),be.debug(e),void(t&&n.close(3504,"Gateway timeout"));be.warn("Unknown message/event '"+e.rtcgw+"' on session "+w),be.debug(e)}}}else be.debug("Got a success on session "+w),be.debug(e),null!=(r=e.transaction)&&(null!=(s=C[r])&&s(e),delete C[r]);else be.debug("Got an ack on session "+w),be.debug(e),null!=(r=e.transaction)&&(null!=(s=C[r])&&s(e),delete C[r]);else be.vdebug("Got a keepalive on session "+w);else for(var p=0;p<e.length;p++)x(e[p],!0)}function j(){if(null!==s&&t&&b){o=setTimeout(j,v);var e={rtcgw:"keepalive",session_id:w,transaction:be.randomString(12)};null!=g&&(e.token=g),null!=f&&(e.apisecret=f),n.send(JSON.stringify(e))}}function A(c){var l=be.randomString(12),d={rtcgw:"create",transaction:l,token:window.EZUIKit.opt.stream,device:window.EZUIKit.opt.deviceSerial,channel:window.EZUIKit.opt.channelNo,authBizType:"TALK"};if(c.reconnect&&(b=!1,d.rtcgw="claim",d.session_id=w,n&&(n.onopen=null,n.onerror=null,n.onclose=null,o&&(clearTimeout(o),o=null))),null!=g&&(d.token=g),null!=f&&(d.apisecret=f),null===s&&be.isArray(a)&&(0===(s=a[r]).indexOf("ws")?(t=!0,be.log("Server #"+(r+1)+": trying WebSockets to contact Janus ("+s+")")):(t=!1,be.log("Server #"+(r+1)+": trying REST API to contact Janus ("+s+")"))),t)for(var u in n=be.newWebSocket(s,"rtcgw-protocol"),i={error:function(){if(be.error("Error connecting to the Janus WebSockets server... "+s),be.isArray(a)&&!c.reconnect)return++r==a.length?void c.error("Error connecting to any of the provided Janus servers: Is the server down?"):(s=null,void setTimeout((function(){A(c)}),200));c.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){C[l]=function(e){if(be.debug(e),"success"!==e.rtcgw)return be.error("Ooops: "+e.error.code+" "+e.error.reason),void c.error(e.error.reason);o=setTimeout(j,v),b=!0,w=e.session_id?e.session_id:e.data.id,c.reconnect?be.log("Claimed session: "+w):be.log("Created session: "+w),be.sessions[w]=P,c.success()},n.send(JSON.stringify(d))},message:function(e){x(JSON.parse(e.data))},close:function(){null!==s&&b&&(b=!1,e.error("Lost connection to the server (is it down?)"))}})n.addEventListener(u,i[u]);else be.httpAPICall(s,{verb:"POST",withCredentials:h,body:d,success:function(e){if(be.debug(e),"success"!==e.rtcgw)return be.error("Ooops: "+e.error.code+" "+e.error.reason),void c.error(e.error.reason);b=!0,w=e.session_id?e.session_id:e.data.id,c.reconnect?be.log("Claimed session: "+w):be.log("Created session: "+w),be.sessions[w]=P,I(),c.success()},error:function(e,t){if(be.error(e+":",t),be.isArray(a)&&!c.reconnect)return++r==a.length?void c.error("Error connecting to any of the provided Janus servers: Is the server down?"):(s=null,void setTimeout((function(){A(c)}),200));""===t?c.error(e+": Is the server down?"):c.error(e+": "+t)}})}function D(e,i){if((i=i||{}).success="function"==typeof i.success?i.success:be.noop,i.error="function"==typeof i.error?i.error:be.noop,!b)return be.warn("Is the server down? (connected=false)"),void i.error("Is the server down? (connected=false)");var o=E[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return be.warn("Invalid handle"),void i.error("Invalid handle");var a=i.message,r=i.jsep,c=be.randomString(12),l={rtcgw:"message",body:a,transaction:c};if(null!==o.token&&void 0!==o.token&&(l.token=o.token),null!=f&&(l.apisecret=f),null!=r&&(l.jsep=r),be.debug("Sending message to plugin (handle="+e+"):"),be.debug(l),t)return l.session_id=w,l.handle_id=e,C[c]=function(e){if(be.debug("Message sent!"),be.debug(e),"success"===e.rtcgw){var t=e.plugindata;if(null==t)return be.warn("Request succeeded, but missing plugindata..."),void i.success();be.log("Synchronous transaction successful ("+t.plugin+")");var n=t.data;return be.debug(n),void i.success(n)}"ack"===e.rtcgw?i.success():void 0!==e.error&&null!==e.error?(be.error("Ooops: "+e.error.code+" "+e.error.reason),i.error(e.error.code+" "+e.error.reason)):(be.error("Unknown error"),i.error("Unknown error"))},void n.send(JSON.stringify(l));be.httpAPICall(s+"/"+w+"/"+e,{verb:"POST",withCredentials:h,body:l,success:function(e){if(be.debug("Message sent!"),be.debug(e),"success"===e.rtcgw){var t=e.plugindata;if(null==t)return be.warn("Request succeeded, but missing plugindata..."),void i.success();be.log("Synchronous transaction successful ("+t.plugin+")");var n=t.data;return be.debug(n),void i.success(n)}"ack"===e.rtcgw?i.success():void 0!==e.error&&null!==e.error?(be.error("Ooops: "+e.error.code+" "+e.error.reason),i.error(e.error.code+" "+e.error.reason)):(be.error("Unknown error"),i.error("Unknown error"))},error:function(e,t){be.error(e+":",t),i.error(e+": "+t)}})}function R(e,i){if(b){var o=E[e];if(null!=o&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){var a={rtcgw:"trickle",candidate:i,transaction:be.randomString(12)};if(null!==o.token&&void 0!==o.token&&(a.token=o.token),null!=f&&(a.apisecret=f),be.vdebug("Sending trickle candidate (handle="+e+"):"),be.vdebug(a),t)return a.session_id=w,a.handle_id=e,void n.send(JSON.stringify(a));be.httpAPICall(s+"/"+w+"/"+e,{verb:"POST",withCredentials:h,body:a,success:function(e){be.vdebug("Candidate sent!"),be.vdebug(e),"ack"===e.rtcgw||be.error("Ooops: "+e.error.code+" "+e.error.reason)},error:function(e,t){be.error(e+":",t)}})}else be.warn("Invalid handle")}else be.warn("Is the server down? (connected=false)")}function L(e,t,n,i){var o=E[e];if(null!=o&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){var a=o.webrtcStuff,r=function(e){be.log("Received state change on data channel:",e);var t=e.target.label,n=a.dataChannel[t]?a.dataChannel[t].readyState:"null";if(be.log("State change on <"+t+"> data channel: "+n),"open"===n){if(a.dataChannel[t].pending&&a.dataChannel[t].pending.length>0){for(var i in be.log("Sending pending messages on <"+t+">:",a.dataChannel[t].pending.length),a.dataChannel[t].pending){var r=a.dataChannel[t].pending[i];be.log("Sending string on data channel <"+t+">: "+r),a.dataChannel[t].send(r)}a.dataChannel[t].pending=[]}o.ondataopen(t)}};a.dataChannel[t]=n||a.pc.createDataChannel(t,{ordered:!1}),a.dataChannel[t].onmessage=function(e){be.log("Received message on data channel:",e);var t=e.target.label;o.ondata(e.data,t)},a.dataChannel[t].onopen=r,a.dataChannel[t].onclose=r,a.dataChannel[t].onerror=function(e){be.error("Got error on data channel:",e)},a.dataChannel[t].pending=[],i&&a.dataChannel[t].pending.push(i)}else be.warn("Invalid handle")}function B(e,t){(t=t||{}).success="function"==typeof t.success?t.success:be.noop,t.error="function"==typeof t.error?t.error:be.noop;var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return be.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff,o=t.text;if(null==o)return be.warn("Invalid text"),void t.error("Invalid text");var a=t.label?t.label:be.dataChanDefaultLabel;return i.dataChannel[a]?"open"!==i.dataChannel[a].readyState?(i.dataChannel[a].pending.push(o),void t.success()):(be.log("Sending string on data channel <"+a+">: "+o),i.dataChannel[a].send(o),void t.success()):(L(e,a,!1,o),void t.success())}function M(e,t){(t=t||{}).success="function"==typeof t.success?t.success:be.noop,t.error="function"==typeof t.error?t.error:be.noop;var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return be.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff;if(null===i.dtmfSender||void 0===i.dtmfSender){if(void 0!==i.pc&&null!==i.pc){var o=i.pc.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(!o)return be.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=o.dtmf,i.dtmfSender&&(be.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(e){be.debug("Sent DTMF tone: "+e.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return be.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var a=t.dtmf;if(null==a)return be.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var r=a.tones;if(null==r)return be.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var s=a.duration;null==s&&(s=500);var c=a.gap;null==c&&(c=50),be.debug("Sending DTMF string "+r+" (duration "+s+"ms, gap "+c+"ms)"),i.dtmfSender.insertDTMF(r,s,c),t.success()}function O(e,i){(i=i||{}).success="function"==typeof i.success?i.success:be.noop,i.error="function"==typeof i.error?i.error:be.noop;var o=!0;void 0!==i.asyncRequest&&null!==i.asyncRequest&&(o=!0===i.asyncRequest);var a=!0;void 0!==i.noRequest&&null!==i.noRequest&&(a=!0===i.noRequest),be.log("Destroying handle "+e+" (async="+o+")"),Y(e);var r=E[e];if(null==r||r.detached)return delete E[e],void i.success();if(a)return delete E[e],void i.success();if(!b)return be.warn("Is the server down? (connected=false)"),void i.error("Is the server down? (connected=false)");var c={rtcgw:"detach",transaction:be.randomString(12)};if(null!==r.token&&void 0!==r.token&&(c.token=r.token),null!=f&&(c.apisecret=f),t)return c.session_id=w,c.handle_id=e,n.send(JSON.stringify(c)),delete E[e],void i.success();be.httpAPICall(s+"/"+w+"/"+e,{verb:"POST",async:o,withCredentials:h,body:c,success:function(t){be.log("Destroyed handle:"),be.debug(t),"success"!==t.rtcgw&&be.error("Ooops: "+t.error.code+" "+t.error.reason),delete E[e],i.success()},error:function(t,n){be.error(t+":",n),delete E[e],i.success()}})}function z(e,t,n,i,o){return N.apply(this,arguments)}function N(){var e;return e=_().mark((function e(t,n,i,o,a){var r,s,d,h,p,g,f,v,y,b,w,P,k,C,I,x,j,A,D,B,M,O,z,N,F,U,Z;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=E[t])&&null!==r.webrtcStuff&&void 0!==r.webrtcStuff){e.next=5;break}return be.warn("Invalid handle"),o.error("Invalid handle"),e.abrupt("return");case 5:if(s=r.webrtcStuff,be.debug("streamsDone:",a),a&&(be.debug(" -- Audio tracks:",a.getAudioTracks()),be.debug(" -- Video tracks:",a.getVideoTracks())),d=!1,s.myStream&&i.update&&!s.streamExternal){e.next=14;break}s.myStream=a,d=!0,e.next=66;break;case 14:if(!((!i.update&&X(i)||i.update&&(i.addAudio||i.replaceAudio))&&a.getAudioTracks()&&a.getAudioTracks().length)){e.next=45;break}if(s.myStream.addTrack(a.getAudioTracks()[0]),!be.unifiedPlan){e.next=43;break}if(be.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),h=null,!((p=s.pc.getTransceivers())&&p.length>0)){e.next=30;break}e.t0=_().keys(p);case 22:if((e.t1=e.t0()).done){e.next=30;break}if(g=e.t1.value,!((f=p[g]).sender&&f.sender.track&&"audio"===f.sender.track.kind||f.receiver&&f.receiver.track&&"audio"===f.receiver.track.kind)){e.next=28;break}return h=f,e.abrupt("break",30);case 28:e.next=22;break;case 30:return v=null,e.prev=31,e.next=34,o.customizeStream(a);case 34:v=e.sent,e.next=40;break;case 37:e.prev=37,e.t2=e.catch(31),o.error(e.t2);case 40:h&&h.sender?h.sender.replaceTrack((null===(y=v)||void 0===y||null===(b=y.getAudioTracks)||void 0===b||null===(w=b.call(y))||void 0===w?void 0:w[0])||a.getAudioTracks()[0]):s.pc.addTrack((null===(P=v)||void 0===P||null===(k=P.getAudioTracks)||void 0===k||null===(C=k.call(P))||void 0===C?void 0:C[0])||a.getAudioTracks()[0],v||a),e.next=45;break;case 43:be.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),s.pc.addTrack(a.getAudioTracks()[0],a);case 45:if(!((!i.update&&$(i)||i.update&&(i.addVideo||i.replaceVideo))&&a.getVideoTracks()&&a.getVideoTracks().length)){e.next=66;break}if(s.myStream.addTrack(a.getVideoTracks()[0]),!be.unifiedPlan){e.next=64;break}if(be.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),I=null,!((p=s.pc.getTransceivers())&&p.length>0)){e.next=61;break}e.t3=_().keys(p);case 53:if((e.t4=e.t3()).done){e.next=61;break}if(g=e.t4.value,!((f=p[g]).sender&&f.sender.track&&"video"===f.sender.track.kind||f.receiver&&f.receiver.track&&"video"===f.receiver.track.kind)){e.next=59;break}return I=f,e.abrupt("break",61);case 59:e.next=53;break;case 61:I&&I.sender?I.sender.replaceTrack(a.getVideoTracks()[0]):s.pc.addTrack(a.getVideoTracks()[0],a),e.next=66;break;case 64:be.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),s.pc.addTrack(a.getVideoTracks()[0],a);case 66:if(!s.pc){if(x={iceServers:c,iceTransportPolicy:l,bundlePolicy:u},"chrome"===be.webRTCAdapter.browserDetails.browser&&(x.sdpSemantics=be.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan"),j={optional:[{DtlsSrtpKeyAgreement:!0}]},!0===m&&j.optional.push({googIPv6:!0}),o.rtcConstraints&&"object"===T(o.rtcConstraints))for(g in be.debug("Adding custom PeerConnection constraints:",o.rtcConstraints),o.rtcConstraints)j.optional.push(o.rtcConstraints[g]);"edge"===be.webRTCAdapter.browserDetails.browser&&(x.bundlePolicy="max-bundle"),be.log("Creating PeerConnection"),be.debug(j),s.pc=new RTCPeerConnection(x,j),be.debug(s.pc),s.pc.getStats&&(s.volume={},s.bitrate.value="0 kbits/sec"),be.log("Preparing local SDP and gathering candidates (trickle="+s.trickle+")"),s.pc.oniceconnectionstatechange=function(e){s.pc&&r.iceState(s.pc.iceConnectionState)},s.pc.onicecandidate=function(e){if(null==e.candidate||"edge"===be.webRTCAdapter.browserDetails.browser&&e.candidate.candidate.indexOf("endOfCandidates")>0)be.log("End of candidates."),s.iceDone=!0,!0===s.trickle?R(t,{completed:!0}):G(t,o);else{var n={candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex};!0===s.trickle&&R(t,n)}},s.pc.ontrack=function(e){be.log("Handling Remote Track"),be.debug(e),e.streams&&(s.remoteStream=e.streams[0],r.onremotestream(s.remoteStream),e.track.onended||(be.log("Adding onended callback to track:",e.track),e.track.onended=function(e){be.log("Remote track muted/removed:",e),s.remoteStream&&(s.remoteStream.removeTrack(e.target),r.onremotestream(s.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){try{s.remoteStream.addTrack(e.target),r.onremotestream(s.remoteStream)}catch(e){be.error(e)}}))}}if(!d||null==a){e.next=96;break}be.log("Adding local stream"),A=!0===o.simulcast2,D=a.getTracks(),B=0;case 72:if(!(B<D.length)){e.next=96;break}if(M=D[B],A){e.next=92;break}if("audio"!==M.kind){e.next=89;break}return U=null,e.prev=77,e.next=80,o.customizeStream(a);case 80:U=e.sent,e.next=86;break;case 83:e.prev=83,e.t5=e.catch(77),o.error(e.t5);case 86:s.pc.addTrack((null===(O=U)||void 0===O||null===(z=(N=O).getAudioTracks)||void 0===z||null===(F=z.call(N))||void 0===F?void 0:F[0])||M,U||a),e.next=90;break;case 89:s.pc.addTrack(M,a);case 90:e.next=93;break;case 92:"audio"===M.kind?s.pc.addTrack(M,a):(be.log("Enabling rid-based simulcasting:",M),Z=S(o.simulcastMaxBitrates),s.pc.addTransceiver(M,{direction:"sendrecv",streams:[a],sendEncodings:[{rid:"h",active:!0,maxBitrate:Z.high},{rid:"m",active:!0,maxBitrate:Z.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:Z.low,scaleResolutionDownBy:4}]}));case 93:B++,e.next=72;break;case 96:te(i)&&!s.dataChannel[be.dataChanDefaultLabel]&&(be.log("Creating data channel"),L(t,be.dataChanDefaultLabel,!1),s.pc.ondatachannel=function(e){be.log("Data channel created by Janus:",e),L(t,e.channel.label,e.channel)}),s.myStream&&r.onlocalstream(s.myStream),null==n?V(t,i,o):s.pc.setRemoteDescription(n).then((function(){if(be.log("Remote description accepted!"),s.remoteSdp=n.sdp,s.candidates&&s.candidates.length>0){for(var e=0;e<s.candidates.length;e++){var a=s.candidates[e];be.debug("Adding remote candidate:",a),a&&!0!==a.completed?s.pc.addIceCandidate(a):s.pc.addIceCandidate(be.endOfCandidates)}s.candidates=[]}H(t,i,o)}),o.error);case 99:case"end":return e.stop()}}),e,null,[[31,37],[77,83]])})),N=function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function r(e){d(a,i,o,r,s,"next",e)}function s(e){d(a,i,o,r,s,"throw",e)}r(void 0)}))},N.apply(this,arguments)}function F(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:be.noop,n.error="function"==typeof n.error?n.error:J,n.customizeStream="function"==typeof n.customizeStream?n.customizeStream:be.noop;var i=n.jsep;if(t&&i)return be.error("Provided a JSEP to a createOffer"),void n.error("Provided a JSEP to a createOffer");if(!(t||i&&i.type&&i.sdp))return be.error("A valid JSEP is required for createAnswer"),void n.error("A valid JSEP is required for createAnswer");n.media=n.media||{audio:!0,video:!0};var o=n.media,a=E[e];if(null==a||null===a.webrtcStuff||void 0===a.webrtcStuff)return be.warn("Invalid handle"),void n.error("Invalid handle");var r,s=a.webrtcStuff;if(s.trickle=(r=n.trickle,be.debug("isTrickleEnabled:",r),null==r||!0===r),void 0===s.pc||null===s.pc)o.update=!1,o.keepAudio=!1,o.keepVideo=!1;else if(void 0!==s.pc&&null!==s.pc){if(be.log("Updating existing media session"),o.update=!0,null!==n.stream&&void 0!==n.stream)n.stream!==s.myStream&&be.log("Renegotiation involves a new external stream");else{if(o.addAudio){if(o.keepAudio=!1,o.replaceAudio=!1,o.removeAudio=!1,o.audioSend=!0,s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length)return be.error("Can't add audio stream, there already is one"),void n.error("Can't add audio stream, there already is one")}else o.removeAudio?(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!1,o.audioSend=!1):o.replaceAudio&&(o.keepAudio=!1,o.addAudio=!1,o.removeAudio=!1,o.audioSend=!0);if(null===s.myStream||void 0===s.myStream?(o.replaceAudio&&(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!0,o.audioSend=!0),X(o)&&(o.keepAudio=!1,o.addAudio=!0)):null===s.myStream.getAudioTracks()||void 0===s.myStream.getAudioTracks()||0===s.myStream.getAudioTracks().length?(o.replaceAudio&&(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!0,o.audioSend=!0),X(o)&&(o.keepVideo=!1,o.addAudio=!0)):!X(o)||o.removeAudio||o.replaceAudio||(o.keepAudio=!0),o.addVideo){if(o.keepVideo=!1,o.replaceVideo=!1,o.removeVideo=!1,o.videoSend=!0,s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length)return be.error("Can't add video stream, there already is one"),void n.error("Can't add video stream, there already is one")}else o.removeVideo?(o.keepVideo=!1,o.replaceVideo=!1,o.addVideo=!1,o.videoSend=!1):o.replaceVideo&&(o.keepVideo=!1,o.addVideo=!1,o.removeVideo=!1,o.videoSend=!0);null===s.myStream||void 0===s.myStream||null===s.myStream.getVideoTracks()||void 0===s.myStream.getVideoTracks()||0===s.myStream.getVideoTracks().length?(o.replaceVideo&&(o.keepVideo=!1,o.replaceVideo=!1,o.addVideo=!0,o.videoSend=!0),$(o)&&(o.keepVideo=!1,o.addVideo=!0)):!$(o)||o.removeVideo||o.replaceVideo||(o.keepVideo=!0),o.addData&&(o.data=!0)}if(X(o)&&o.keepAudio&&$(o)&&o.keepVideo)return a.consentDialog(!1),void z(e,i,o,n,s.myStream)}if(o.update&&!s.streamExternal){if(o.removeAudio||o.replaceAudio){if(s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length){var c=s.myStream.getAudioTracks()[0];be.log("Removing audio track:",c),s.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var l=!0;if(o.replaceAudio&&be.unifiedPlan&&(l=!1),l)for(var d in s.pc.getSenders()){(c=s.pc.getSenders()[d])&&c.track&&"audio"===c.track.kind&&(be.log("Removing audio sender:",c),s.pc.removeTrack(c))}}}if(o.removeVideo||o.replaceVideo){if(s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length){c=s.myStream.getVideoTracks()[0];be.log("Removing video track:",c),s.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var u=!0;if(o.replaceVideo&&be.unifiedPlan&&(u=!1),u)for(var d in s.pc.getSenders()){(c=s.pc.getSenders()[d])&&c.track&&"video"===c.track.kind&&(be.log("Removing video sender:",c),s.pc.removeTrack(c))}}}}if(null!==n.stream&&void 0!==n.stream){var m=n.stream;if(be.log("MediaStream provided by the application"),be.debug(m),o.update&&s.myStream&&s.myStream!==n.stream&&!s.streamExternal){try{var h=s.myStream.getTracks();for(var p in h){var g=h[p];be.log(g),null!=g&&g.stop()}}catch(e){}s.myStream=null}return s.streamExternal=!0,a.consentDialog(!1),void z(e,i,o,n,m)}if(X(o)||$(o)){if(!be.isGetUserMediaAvailable())return void n.error("getUserMedia not available");var f={mandatory:{},optional:[]};a.consentDialog(!0);var v=X(o);!0===v&&null!=o&&null!=o&&"object"===T(o.audio)&&(v=o.audio);var y=$(o);if(!0===y&&null!=o&&null!=o){var S=!0===n.simulcast,_=!0===n.simulcast2;if(!S&&!_||i||void 0!==o.video&&!1!==o.video||(o.video="hires"),o.video&&"screen"!=o.video&&"window"!=o.video)if("object"===T(o.video))y=o.video;else{var b=0,w=0;"lowres"===o.video?(w=240,b=320):"lowres-16:9"===o.video?(w=180,b=320):"hires"===o.video||"hires-16:9"===o.video||"hdres"===o.video?(w=720,b=1280):"fhdres"===o.video?(w=1080,b=1920):"4kres"===o.video?(w=2160,b=3840):"stdres"===o.video?(w=480,b=640):"stdres-16:9"===o.video?(w=360,b=640):(be.log("Default video setting is stdres 4:3"),w=480,b=640),be.log("Adding media constraint:",o.video),y={height:{ideal:w},width:{ideal:b}},be.log("Adding video constraint:",y)}else if("screen"===o.video||"window"===o.video){var P=function(t,r){a.consentDialog(!1),t?n.error(t):z(e,i,o,n,r)},k=function(e,t,n){be.log("Adding media constraint (screen capture)"),be.debug(e),navigator.mediaDevices.getUserMedia(e).then((function(e){n?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(n){e.addTrack(n.getAudioTracks()[0]),t(null,e)})):t(null,e)})).catch((function(e){a.consentDialog(!1),t(e)}))};if(o.screenshareFrameRate||(o.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){a.consentDialog(!1),X(o)&&!o.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(a){t.addTrack(a.getAudioTracks()[0]),z(e,i,o,n,t)})):z(e,i,o,n,t)}),(function(e){a.consentDialog(!1),n.error(e)}));if("chrome"===be.webRTCAdapter.browserDetails.browser){var C=be.webRTCAdapter.browserDetails.version,I=33;window.navigator.userAgent.match("Linux")&&(I=35),C>=26&&C<=I?(f={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate,chromeMediaSource:"screen"}},audio:X(o)&&!o.keepAudio},k(f,P)):be.extension.getScreen((function(e,t){if(e)return a.consentDialog(!1),n.error(e);(f={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=t,k(f,P,X(o)&&!o.keepAudio)}))}else if("firefox"===be.webRTCAdapter.browserDetails.browser){if(!(be.webRTCAdapter.browserDetails.version>=33)){var x=new Error("NavigatorUserMediaError");return x.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",a.consentDialog(!1),void n.error(x)}f={video:{mozMediaSource:o.video,mediaSource:o.video},audio:X(o)&&!o.keepAudio},k(f,(function(e,t){if(P(e,t),!e)var n=t.currentTime,i=window.setInterval((function(){t||window.clearInterval(i),t.currentTime==n&&(window.clearInterval(i),t.onended&&t.onended()),n=t.currentTime}),500)}))}return}}null!=o&&"screen"===o.video||navigator.mediaDevices.enumerateDevices().then((function(t){var r=t.some((function(e){return"audioinput"===e.kind})),s=function(e){if(be.debug("isScreenSendEnabled:",e),null==e)return!1;if("object"!==T(e.video)||"object"!==T(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}(o)||t.some((function(e){return"videoinput"===e.kind})),c=X(o),l=$(o),d=function(e){return be.debug("isAudioSendRequired:",e),null!=e&&(!1!==e.audio&&!1!==e.audioSend&&(void 0!==e.failIfNoAudio&&null!==e.failIfNoAudio&&!0===e.failIfNoAudio))}(o),u=function(e){return be.debug("isVideoSendRequired:",e),null!=e&&(!1!==e.video&&!1!==e.videoSend&&(void 0!==e.failIfNoVideo&&null!==e.failIfNoVideo&&!0===e.failIfNoVideo))}(o);if(c||l||d||u){var h=!!c&&r,p=!!l&&s;if(!h&&!p)return a.consentDialog(!1),n.error("No capture device found"),!1;if(!h&&d)return a.consentDialog(!1),n.error("Audio capture is required, but no capture device found"),!1;if(!p&&u)return a.consentDialog(!1),n.error("Video capture is required, but no capture device found"),!1}var g={audio:!(!r||o.keepAudio)&&v,video:!(!s||o.keepVideo)&&y};be.debug("getUserMedia constraints",g),g.audio||g.video?navigator.mediaDevices.getUserMedia(g).then((function(t){a.consentDialog(!1),z(e,i,o,n,t)})).catch((function(e){a.consentDialog(!1),n.error({code:e.code,name:e.name,message:e.message})})):(a.consentDialog(!1),z(e,i,o,n,m))})).catch((function(e){a.consentDialog(!1),n.error("enumerateDevices error",e)}))}else z(e,i,o,n)}function U(e,t){(t=t||{}).success="function"==typeof t.success?t.success:be.noop,t.error="function"==typeof t.error?t.error:J;var n=t.jsep,i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return be.warn("Invalid handle"),void t.error("Invalid handle");var o=i.webrtcStuff;if(null!=n){if(null===o.pc)return be.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");o.pc.setRemoteDescription(n).then((function(){if(be.log("Remote description accepted!"),o.remoteSdp=n.sdp,o.candidates&&o.candidates.length>0){for(var e=0;e<o.candidates.length;e++){var i=o.candidates[e];be.debug("Adding remote candidate:",i),i&&!0!==i.completed?o.pc.addIceCandidate(i):o.pc.addIceCandidate(be.endOfCandidates)}o.candidates=[]}t.success()}),t.error)}else t.error("Invalid JSEP")}function V(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:be.noop,n.error="function"==typeof n.error?n.error:be.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:be.noop;var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return be.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,a=!0===n.simulcast;a?be.log("Creating offer (iceDone="+o.iceDone+", simulcast="+a+")"):be.log("Creating offer (iceDone="+o.iceDone+")");var r={};if(be.unifiedPlan){var s=null,c=null,l=o.pc.getTransceivers();if(l&&l.length>0)for(var d in l){var u=l[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)&&(c||(c=u))}var m=X(t),h=Q(t);m||h?m&&h?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",be.log("Setting audio transceiver to sendrecv:",s)):m&&!h?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",be.log("Setting audio transceiver to sendonly:",s)):!m&&h&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",be.log("Setting audio transceiver to recvonly:",s)):(s=o.pc.addTransceiver("audio",{direction:"recvonly"}),be.log("Adding recvonly audio transceiver:",s))):t.removeAudio&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",be.log("Setting audio transceiver to inactive:",s));var p=$(t),g=ee(t);p||g?p&&g?c&&(c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",be.log("Setting video transceiver to sendrecv:",c)):p&&!g?c&&(c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",be.log("Setting video transceiver to sendonly:",c)):!p&&g&&(c?(c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",be.log("Setting video transceiver to recvonly:",c)):(c=o.pc.addTransceiver("video",{direction:"recvonly"}),be.log("Adding recvonly video transceiver:",c))):t.removeVideo&&c&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive",be.log("Setting video transceiver to inactive:",c))}else r.offerToReceiveAudio=Q(t),r.offerToReceiveVideo=ee(t);!0===n.iceRestart&&(r.iceRestart=!0),be.debug(r);var f=$(t);if(f&&a&&"firefox"===be.webRTCAdapter.browserDetails.browser){be.log("Enabling Simulcasting for Firefox (RID)");var v=o.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(v){var y=v.getParameters();y||(y={});var _=S(n.simulcastMaxBitrates);y.encodings=[{rid:"h",active:!0,maxBitrate:_.high},{rid:"m",active:!0,maxBitrate:_.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:_.low,scaleResolutionDownBy:4}],v.setParameters(y)}}o.pc.createOffer(r).then((function(e){be.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,be.log("Setting local description"),f&&a&&("chrome"===be.webRTCAdapter.browserDetails.browser||"safari"===be.webRTCAdapter.browserDetails.browser?(be.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=function(e){for(var t=e.split("\r\n"),n=!1,i=[-1],o=[-1],a=null,r=null,s=null,c=null,l=-1,d=0;d<t.length;d++){if(m=t[d].match(/m=(\w+) */)){if("video"===m[1]){if(!(i[0]<0)){l=d;break}n=!0}else if(i[0]>-1){l=d;break}}else if(n){var u=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(u)i[0]=u[1],o[0]=u[2],t.splice(d,1),d--;else{if(i[0]){if((p=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(c=p[1]),0===t[d].indexOf("a=ssrc:"+o[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(i[0]<0){l=-1,n=!1;for(d=0;d<t.length;d++){var m;if(m=t[d].match(/m=(\w+) */)){if("video"===m[1]){if(!(i[0]<0)){l=d;break}n=!0}else if(i[0]>-1){l=d;break}}else if(n){if(i[0]<0){var h=t[d].match(/a=ssrc:(\d+)/);if(h){i[0]=h[1],t.splice(d,1),d--;continue}}else{var p;if((p=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(c=p[1]),0===t[d].indexOf("a=ssrc:"+o[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(i[0]<0)return be.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;l<0&&(l=t.length);i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),o[1]=Math.floor(4294967295*Math.random()),o[2]=Math.floor(4294967295*Math.random());for(d=0;d<i.length;d++)a&&(t.splice(l,0,"a=ssrc:"+i[d]+" cname:"+a),l++),r&&(t.splice(l,0,"a=ssrc:"+i[d]+" msid:"+r),l++),s&&(t.splice(l,0,"a=ssrc:"+i[d]+" mslabel:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+i[d]+" label:"+c),l++),a&&(t.splice(l,0,"a=ssrc:"+o[d]+" cname:"+a),l++),r&&(t.splice(l,0,"a=ssrc:"+o[d]+" msid:"+r),l++),s&&(t.splice(l,0,"a=ssrc:"+o[d]+" mslabel:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+o[d]+" label:"+c),l++);t.splice(l,0,"a=ssrc-group:FID "+i[2]+" "+o[2]),t.splice(l,0,"a=ssrc-group:FID "+i[1]+" "+o[1]),t.splice(l,0,"a=ssrc-group:FID "+i[0]+" "+o[0]),t.splice(l,0,"a=ssrc-group:SIM "+i[0]+" "+i[1]+" "+i[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n");return e}(e.sdp)):"firefox"!==be.webRTCAdapter.browserDetails.browser&&be.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e).catch(n.error),o.mediaConstraints=r,o.iceDone||o.trickle?(be.log("Offer ready"),be.debug(n),n.success(e)):be.log("Waiting for all candidates...")}),n.error)}function H(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:be.noop,n.error="function"==typeof n.error?n.error:be.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:be.noop;var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return be.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,a=!0===n.simulcast;a?be.log("Creating answer (iceDone="+o.iceDone+", simulcast="+a+")"):be.log("Creating answer (iceDone="+o.iceDone+")");var r=null;if(be.unifiedPlan){r={};var s=null,c=null,l=o.pc.getTransceivers();if(l&&l.length>0)for(var d in l){var u=l[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)&&(c||(c=u))}var m=X(t),h=Q(t);if(m||h){if(m&&h){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",be.log("Setting audio transceiver to sendrecv:",s)}catch(e){be.error(e)}}else if(m&&!h)try{s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",be.log("Setting audio transceiver to sendonly:",s))}catch(e){be.error(e)}else if(!m&&h)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",be.log("Setting audio transceiver to recvonly:",s)}catch(e){be.error(e)}else s=o.pc.addTransceiver("audio",{direction:"recvonly"}),be.log("Adding recvonly audio transceiver:",s)}else if(t.removeAudio&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",be.log("Setting audio transceiver to inactive:",s)}catch(e){be.error(e)}var p=$(t),g=ee(t);if(p||g){if(p&&g){if(c)try{c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",be.log("Setting video transceiver to sendrecv:",c)}catch(e){be.error(e)}}else if(p&&!g){if(c)try{c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",be.log("Setting video transceiver to sendonly:",c)}catch(e){be.error(e)}}else if(!p&&g)if(c)try{c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",be.log("Setting video transceiver to recvonly:",c)}catch(e){be.error(e)}else c=o.pc.addTransceiver("video",{direction:"recvonly"}),be.log("Adding recvonly video transceiver:",c)}else if(t.removeVideo&&c)try{c.setDirection?c.setDirection("inactive"):c.direction="inactive",be.log("Setting video transceiver to inactive:",c)}catch(e){be.error(e)}}else r="firefox"==be.webRTCAdapter.browserDetails.browser||"edge"==be.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:Q(t),offerToReceiveVideo:ee(t)}:{mandatory:{OfferToReceiveAudio:Q(t),OfferToReceiveVideo:ee(t)}};be.debug(r);var f=$(t);if(f&&a&&"firefox"===be.webRTCAdapter.browserDetails.browser){be.log("Enabling Simulcasting for Firefox (RID)");var v=o.pc.getSenders()[1];be.log(v);var y=v.getParameters();be.log(y);var _=S(n.simulcastMaxBitrates);v.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:_.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:_.medium},{rid:"low",active:!0,priority:"low",maxBitrate:_.low}]})}o.pc.createAnswer(r).then((function(e){be.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,be.log("Setting local description"),f&&a&&("chrome"===be.webRTCAdapter.browserDetails.browser?be.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==be.webRTCAdapter.browserDetails.browser&&be.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e).catch(n.error),o.mediaConstraints=r,o.iceDone||o.trickle?n.success(e):be.log("Waiting for all candidates...")}),n.error)}function G(e,t){(t=t||{}).success="function"==typeof t.success?t.success:be.noop,t.error="function"==typeof t.error?t.error:be.noop;var n=E[e];if(null!=n&&null!==n.webrtcStuff&&void 0!==n.webrtcStuff){var i=n.webrtcStuff;be.log("Sending offer/answer SDP..."),null!==i.mySdp&&void 0!==i.mySdp?(i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp.trickle=!1),be.debug(t),i.sdpSent=!0,t.success(i.mySdp)):be.warn("Local SDP instance is invalid, not sending anything...")}else be.warn("Invalid handle, not sending anything")}function Z(e,t){var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return be.warn("Invalid handle"),0;var i=t?"remote":"local",o=n.webrtcStuff;return o.volume[i]||(o.volume[i]={value:0}),o.pc.getStats&&"chrome"===be.webRTCAdapter.browserDetails.browser?!t||null!==o.remoteStream&&void 0!==o.remoteStream?t||null!==o.myStream&&void 0!==o.myStream?null===o.volume[i].timer||void 0===o.volume[i].timer?(be.log("Starting "+i+" volume monitor"),o.volume[i].timer=setInterval((function(){o.pc.getStats((function(e){for(var n=e.result(),a=0;a<n.length;a++){var r=n[a];"ssrc"==r.type&&(t&&r.stat("audioOutputLevel")?o.volume[i].value=parseInt(r.stat("audioOutputLevel")):!t&&r.stat("audioInputLevel")&&(o.volume[i].value=parseInt(r.stat("audioInputLevel"))))}}))}),200),0):o.volume[i].value:(be.warn("Local stream unavailable"),0):(be.warn("Remote stream unavailable"),0):(be.warn("Getting the "+i+" volume unsupported by browser"),0)}function W(e,t){var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return be.warn("Invalid handle"),!0;var i=n.webrtcStuff;return null===i.pc||void 0===i.pc?(be.warn("Invalid PeerConnection"),!0):void 0===i.myStream||null===i.myStream?(be.warn("Invalid local MediaStream"),!0):t?null===i.myStream.getVideoTracks()||void 0===i.myStream.getVideoTracks()||0===i.myStream.getVideoTracks().length?(be.warn("No video track"),!0):!i.myStream.getVideoTracks()[0].enabled:null===i.myStream.getAudioTracks()||void 0===i.myStream.getAudioTracks()||0===i.myStream.getAudioTracks().length?(be.warn("No audio track"),!0):!i.myStream.getAudioTracks()[0].enabled}function q(e,t,n){var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return be.warn("Invalid handle"),!1;var o=i.webrtcStuff;return null===o.pc||void 0===o.pc?(be.warn("Invalid PeerConnection"),!1):void 0===o.myStream||null===o.myStream?(be.warn("Invalid local MediaStream"),!1):t?null===o.myStream.getVideoTracks()||void 0===o.myStream.getVideoTracks()||0===o.myStream.getVideoTracks().length?(be.warn("No video track"),!1):(o.myStream.getVideoTracks()[0].enabled=!n,!0):null===o.myStream.getAudioTracks()||void 0===o.myStream.getAudioTracks()||0===o.myStream.getAudioTracks().length?(be.warn("No audio track"),!1):(o.myStream.getAudioTracks()[0].enabled=!n,!0)}function K(e){var t=E[e];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return be.warn("Invalid handle"),"Invalid handle";var n=t.webrtcStuff;return null===n.pc||void 0===n.pc?"Invalid PeerConnection":n.pc.getStats?null===n.bitrate.timer||void 0===n.bitrate.timer?(be.log("Starting bitrate timer (via getStats)"),n.bitrate.timer=setInterval((function(){n.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(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 i=n.bitrate.tsnow-n.bitrate.tsbefore;"safari"==be.webRTCAdapter.browserDetails.browser&&(i/=1e3);var o=Math.round(8*(n.bitrate.bsnow-n.bitrate.bsbefore)/i);"safari"===be.webRTCAdapter.browserDetails.browser&&(o=parseInt(o/1e3)),n.bitrate.value=o+" kbits/sec",n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):n.bitrate.value:(be.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function J(e){be.error("WebRTC error:",e)}function Y(e,i){be.log("Cleaning WebRTC stuff");var o=E[e];if(null!=o){var a=o.webrtcStuff;if(null!=a){if(!0===i){var r={rtcgw:"hangup",transaction:be.randomString(12)};null!==o.token&&void 0!==o.token&&(r.token=o.token),null!=f&&(r.apisecret=f),be.debug("Sending hangup request (handle="+e+"):"),be.debug(r),t?(r.session_id=w,r.handle_id=e,n.send(JSON.stringify(r))):be.httpAPICall(s+"/"+w+"/"+e,{verb:"POST",withCredentials:h,body:r})}a.remoteStream=null,a.volume&&(a.volume.local&&a.volume.local.timer&&clearInterval(a.volume.local.timer),a.volume.remote&&a.volume.remote.timer&&clearInterval(a.volume.remote.timer)),a.volume={},a.bitrate.timer&&clearInterval(a.bitrate.timer),a.bitrate.timer=null,a.bitrate.bsnow=null,a.bitrate.bsbefore=null,a.bitrate.tsnow=null,a.bitrate.tsbefore=null,a.bitrate.value=null;try{if(!a.streamExternal&&null!==a.myStream&&void 0!==a.myStream){be.log("Stopping local stream tracks");var c=a.myStream.getTracks();for(var l in c){var d=c[l];be.log(d),null!=d&&d.stop()}}}catch(e){}a.streamExternal=!1,a.myStream=null;try{a.pc.close()}catch(e){}a.pc=null,a.candidates=null,a.mySdp=null,a.remoteSdp=null,a.iceDone=!1,a.dataChannel={},a.dtmfSender=null}o.oncleanup()}}function X(e){return be.debug("isAudioSendEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioSend||null===e.audioSend||!0===e.audioSend)}function Q(e){return be.debug("isAudioRecvEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioRecv||null===e.audioRecv||!0===e.audioRecv)}function $(e){return be.debug("isVideoSendEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoSend||null===e.videoSend||!0===e.videoSend)}function ee(e){return be.debug("isVideoRecvEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoRecv||null===e.videoRecv||!0===e.videoRecv)}function te(e){return be.debug("isDataEnabled:",e),"edge"==be.webRTCAdapter.browserDetails.browser?(be.warn("Edge doesn't support data channels yet"),!1):null!=e&&!0===e.data}A(e),this.getServer=function(){return s},this.isConnected=function(){return b},this.reconnect=function(e){(e=e||{}).success="function"==typeof e.success?e.success:be.noop,e.error="function"==typeof e.error?e.error:be.noop,e.reconnect=!0,A(e)},this.getSessionId=function(){return w},this.destroy=function(a){!function(a){a=a||{},a.success="function"==typeof a.success?a.success:be.noop;var r=!0;void 0!==a.asyncRequest&&null!==a.asyncRequest&&(r=!0===a.asyncRequest);var c=!0;void 0!==a.notifyDestroyed&&null!==a.notifyDestroyed&&(c=!0===a.notifyDestroyed);var l=!1;void 0!==a.cleanupHandles&&null!==a.cleanupHandles&&(l=!0===a.cleanupHandles);if(be.log("Destroying session "+w+" (async="+r+")"),!b)return be.warn("Is the server down? (connected=false)"),void a.success();if(null==w)return be.warn("No session to destroy"),a.success(),void(c&&e.destroyed());if(l)for(var d in E)O(d,{noRequest:!0});var u={rtcgw:"destroy",transaction:be.randomString(12)};null!=g&&(u.token=g);null!=f&&(u.apisecret=f);if(t){u.session_id=w;var m=function(){for(var e in i)n.removeEventListener(e,i[e]);n.removeEventListener("message",p),n.removeEventListener("error",v),o&&clearTimeout(o),n.close()},p=function(t){var n=JSON.parse(t.data);n.session_id==u.session_id&&n.transaction==u.transaction&&(m(),a.success(),c&&e.destroyed())},v=function(t){m(),a.error("Failed to destroy the server: Is the server down?"),c&&e.destroyed()};return n.addEventListener("message",p),n.addEventListener("error",v),void n.send(JSON.stringify(u))}be.httpAPICall(s+"/"+w,{verb:"POST",async:r,withCredentials:h,body:u,success:function(t){be.log("Destroyed session:"),be.debug(t),w=null,b=!1,"success"!==t.rtcgw&&be.error("Ooops: "+t.error.code+" "+t.error.reason),a.success(),c&&e.destroyed()},error:function(t,n){be.error(t+":",n),w=null,b=!1,a.success(),c&&e.destroyed()}})}(a)},this.attach=function(e){!function(e){if(e=e||{},e.success="function"==typeof e.success?e.success:be.noop,e.error="function"==typeof e.error?e.error:be.noop,e.consentDialog="function"==typeof e.consentDialog?e.consentDialog:be.noop,e.iceState="function"==typeof e.iceState?e.iceState:be.noop,e.mediaState="function"==typeof e.mediaState?e.mediaState:be.noop,e.webrtcState="function"==typeof e.webrtcState?e.webrtcState:be.noop,e.slowLink="function"==typeof e.slowLink?e.slowLink:be.noop,e.onmessage="function"==typeof e.onmessage?e.onmessage:be.noop,e.onlocalstream="function"==typeof e.onlocalstream?e.onlocalstream:be.noop,e.onremotestream="function"==typeof e.onremotestream?e.onremotestream:be.noop,e.ondata="function"==typeof e.ondata?e.ondata:be.noop,e.ondataopen="function"==typeof e.ondataopen?e.ondataopen:be.noop,e.oncleanup="function"==typeof e.oncleanup?e.oncleanup:be.noop,e.ondetached="function"==typeof e.ondetached?e.ondetached:be.noop,!b)return be.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var i=e.plugin;if(null==i)return be.error("Invalid plugin"),void e.error("Invalid plugin");var o=e.opaqueId,a=e.token?e.token:g,r=be.randomString(12),c={rtcgw:"attach",plugin:i,opaque_id:o,transaction:r};null!=a&&(c.token=a);null!=f&&(c.apisecret=f);if(t)return C[r]=function(t){if(be.debug(t),"success"!==t.rtcgw)return be.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error("Ooops: "+t.error.code+" "+t.error.reason);var n=t.data.id;be.log("Created handle: "+n);var o={session:P,plugin:i,id:n,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return n},getPlugin:function(){return i},getVolume:function(){return Z(n,!0)},getRemoteVolume:function(){return Z(n,!0)},getLocalVolume:function(){return Z(n,!1)},isAudioMuted:function(){return W(n,!1)},muteAudio:function(){return q(n,!1,!0)},unmuteAudio:function(){return q(n,!1,!1)},isVideoMuted:function(){return W(n,!0)},muteVideo:function(){return q(n,!0,!0)},unmuteVideo:function(){return q(n,!0,!1)},getBitrate:function(){return K(n)},send:function(e){D(n,e)},data:function(e){B(n,e)},dtmf:function(e){M(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){F(n,!0,e)},createAnswer:function(e){F(n,!1,e)},handleRemoteJsep:function(e){U(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Y(n,!0===e)},detach:function(e){O(n,e)}};E[n]=o,e.success(o)},c.session_id=w,void n.send(JSON.stringify(c));be.httpAPICall(s+"/"+w,{verb:"POST",withCredentials:h,body:c,success:function(t){if(be.debug(t),"success"!==t.rtcgw)return be.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error("Ooops: "+t.error.code+" "+t.error.reason);var n=t.data.id;be.log("Created handle: "+n);var o={session:P,plugin:i,id:n,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return n},getPlugin:function(){return i},getVolume:function(){return Z(n,!0)},getRemoteVolume:function(){return Z(n,!0)},getLocalVolume:function(){return Z(n,!1)},isAudioMuted:function(){return W(n,!1)},muteAudio:function(){return q(n,!1,!0)},unmuteAudio:function(){return q(n,!1,!1)},isVideoMuted:function(){return W(n,!0)},muteVideo:function(){return q(n,!0,!0)},unmuteVideo:function(){return q(n,!0,!1)},getBitrate:function(){return K(n)},send:function(e){D(n,e)},data:function(e){B(n,e)},dtmf:function(e){M(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){F(n,!0,e)},createAnswer:function(e){F(n,!1,e)},handleRemoteJsep:function(e){U(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Y(n,!0===e)},detach:function(e){O(n,e)}};E[n]=o,e.success(o)},error:function(e,t){be.error(e+":",t)}})}(e)}}be.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,n=e&&e.Promise||Promise,i=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new i(e,t)},extension:e&&e.extension||_e,isArray:function(e){return Array.isArray(e)},webRTCAdapter:e&&e.adapter||window.adapter,httpAPICall:function(e,i){var o={method:i.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===i.verb&&(o.headers["Content-Type"]="application/json"),void 0!==i.withCredentials&&(o.credentials=!0===i.withCredentials?"include":i.withCredentials?i.withCredentials:"omit"),void 0!==i.body&&(o.body=JSON.stringify(i.body));var a=t(e,o).catch((function(e){return n.reject({message:"Probably a network error, is the server down?",error:e})}));if(void 0!==i.timeout){var r=new n((function(e,t){var n=setTimeout((function(){return clearTimeout(n),t({message:"Request timed out",timeout:i.timeout})}),i.timeout)}));a=n.race([a,r])}return a.then((function(e){return e.ok?T(i.success)===T(be.noop)?e.json().then((function(e){i.success(e)})).catch((function(t){return n.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:n.reject({message:"API call failed",response:e})})).catch((function(e){T(i.error)===T(be.noop)&&i.error(e.message||"<< internal error >>",e)})),a}}},be.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||_e,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,n){var i=void 0!==n.body?{contentType:"application/json",data:JSON.stringify(n.body)}:{},o=void 0!==n.withCredentials?{xhrFields:{withCredentials:n.withCredentials}}:{};return t.ajax(t.extend(i,o,{url:e,type:n.verb,cache:!1,dataType:"json",async:n.async,timeout:n.timeout,success:function(e){T(n.success)===T(be.noop)&&n.success(e)},error:function(e,t,i){T(n.error)===T(be.noop)&&n.error(t,i)}}))}}},be.noop=function(){},be.dataChanDefaultLabel="JanusDataChannel",be.endOfCandidates=null,be.init=function(e){if((e=e||{}).callback="function"==typeof e.callback?e.callback:be.noop,!0===be.initDone)e.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),be.trace=be.noop,be.debug=be.noop,be.vdebug=be.noop,be.log=be.noop,be.warn=be.noop,be.error=be.noop,!0===e.debug||"all"===e.debug)be.trace=console.trace.bind(console),be.debug=console.debug.bind(console),be.vdebug=console.debug.bind(console),be.log=console.log.bind(console),be.warn=console.warn.bind(console),be.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var n=e.debug[t];switch(n){case"trace":be.trace=console.trace.bind(console);break;case"debug":be.debug=console.debug.bind(console);break;case"vdebug":be.vdebug=console.debug.bind(console);break;case"log":be.log=console.log.bind(console);break;case"warn":be.warn=console.warn.bind(console);break;case"error":be.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+n+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')")}}var i=e.dependencies||be.useDefaultDependencies();be.isArray=i.isArray,be.webRTCAdapter=i.webRTCAdapter,be.httpAPICall=i.httpAPICall,be.newWebSocket=i.newWebSocket,be.extension=i.extension,be.extension.init(),be.listDevices=function(e,t){e="function"==typeof e?e:be.noop,null==t&&(t={audio:!0,video:!0}),be.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(n){be.debug(n),e(n);try{var i=t.getTracks();for(var o in i){var a=i[o];null!=a&&a.stop()}}catch(e){}}))})).catch((function(t){be.error(t),e([])})):(be.warn("navigator.mediaDevices unavailable"),e([]))},be.attachMediaStream=function(e,t){"chrome"===be.webRTCAdapter.browserDetails.browser?be.webRTCAdapter.browserDetails.version>=52?e.srcObject=t:be.error("Error attaching stream to element"):e.srcObject=t},be.reattachMediaStream=function(e,t){"chrome"===be.webRTCAdapter.browserDetails.browser?be.webRTCAdapter.browserDetails.version>=52?e.srcObject=t.srcObject:void 0!==e.src?e.src=t.src:be.error("Error reattaching stream to element"):e.srcObject=t.srcObject};var o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+o];if(window.addEventListener(o,(function(e){for(var t in be.log("Closing window"),be.sessions)null!==be.sessions[t]&&void 0!==be.sessions[t]&&be.sessions[t].destroyOnUnload&&(be.log("Destroying session "+t),be.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));a&&"function"==typeof a&&a()})),be.safariVp8=!1,"safari"===be.webRTCAdapter.browserDetails.browser&&be.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 r=RTCRtpSender.getCapabilities("video").codecs[t];if(r&&r.mimeType&&"video/vp8"===r.mimeType.toLowerCase()){be.safariVp8=!0;break}}be.safariVp8?be.log("This version of Safari supports VP8"):be.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){be.safariVp8=-1!==e.sdp.indexOf("VP8"),be.safariVp8?be.log("This version of Safari supports VP8"):be.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(be.unifiedPlan=!1,"firefox"===be.webRTCAdapter.browserDetails.browser&&be.webRTCAdapter.browserDetails.version>=59)be.unifiedPlan=!0;else if("chrome"===be.webRTCAdapter.browserDetails.browser&&be.webRTCAdapter.browserDetails.version<72)be.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){var c=new RTCPeerConnection;try{c.addTransceiver("audio"),be.unifiedPlan=!0}catch(e){}c.close()}else be.unifiedPlan=!1;be.initDone=!0,e.callback()}},be.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},be.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},be.randomString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i<e;i++){var o=Math.floor(62*Math.random());n+=t.substring(o,o+1)}return n},window.Janus_Talk=be;var we=window.Janus_Talk,Te=null,Ee=null,Pe="tts-"+Janus_Talk.randomString(12),ke=null;we.init({debug:"all",callback:function(){window.stopTalk=function(){Te.destroy()},window.startTalk=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.customizeStream,n=void 0===t?null:t,i=e.audio,o=void 0===i||i;we.isWebrtcSupported()?Te=new we({server:window.EZUIKit.opt.rtcUrl,success:function(){Te.attach({plugin:"rtcgw.plugin.tts",opaqueId:Pe,success:function(e){Ee=window.tts=e,we.log("Plugin attached! ("+Ee.getPlugin()+", id="+Ee.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"),we.debug("Trying a createOffer too (audio/video sendrecv)"),Ee.createOffer({media:{audio:o||!0,video:!1,data:!1},simulcast:!1,simulcast2:!1,customizeStream:n,success:function(e){we.debug("Got SDP!"),we.debug(e),Ee.send({message:i,jsep:e}),void 0!==window.EZUIKit.handleTalkSuccess&&window.EZUIKit.handleTalkSuccess()},error:function(e){we.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){we.debug("Consent dialog should be "+(e?"on":"off")+" now")},iceState:function(e){we.log("ICE state changed to "+e)},mediaState:function(e,t){we.log("Janus "+(t?"started":"stopped")+" receiving our "+e)},webrtcState:function(e){we.log("Janus says our WebRTC PeerConnection is "+(e?"up":"down")+" now")},slowLink:function(e,t){we.warn("Janus reports problems "+(e?"sending":"receiving")+" packets on this PeerConnection ("+t+" lost packets)")},onmessage:function(e,t){we.debug(" ::: Got a message :::"),we.debug(e),null!=t&&(we.debug("Handling SDP as well..."),we.debug(t),Ee.handleRemoteJsep({jsep:t}));var n=e.result;if(null!=n){if("done"===n)return bootbox.alert("The TTS Test is over"),null!=ke&&ke.stop(),void(ke=null);"msg"===n&&void 0!==window.EZUIKit.handleTalkMessage&&window.EZUIKit.handleTalkMessage(e),"slow_link"===n.status&&toastr.warning("Janus apparently missed many packets we sent, maybe we should reduce the bitrate","Packet loss?",{timeOut:2e3})}},onlocalstream:function(e){we.debug(" ::: Got a local stream :::"),we.debug(e),we.attachMediaStream(document.getElementById("myaudio"),e),"completed"!==Ee.webrtcStuff.pc.iceConnectionState&&"connected"!==Ee.webrtcStuff.pc.iceConnectionState&&(null==ke?document.getElementById("audioright"):ke.spin());var t=e.getAudioTracks();null==t||t.length},onremotestream:function(e){we.debug(" ::: Got a remote stream :::"),we.debug(e),we.attachMediaStream(document.getElementById("peeraudio"),e);var t=e.getAudioTracks();null==t||0===t.length||document.getElementById("peeraudio").play()},ondataopen:function(e){we.log("The DataChannel is available!")},ondata:function(e){we.debug("We got data from the DataChannel! "+e)},oncleanup:function(){we.log(" ::: Got a cleanup notification :::"),null!=ke&&ke.stop(),ke=null}})},error:function(e){we.error(e),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)},destroyed:function(){}}):bootbox.alert("No WebRTC support... ")}}});var Ce=function(){return p((function e(t){var n=this;u(this,e),this.jSPlugin=t,this.pluginStatus=new H(this,this.jSPlugin.params.id),this.talkChannelNo=t.talkChannelNo,this.gainNode=null,this.volumeGain=null,this.volumeChangeInterval=null,this.microphoneId=null;var i=document.createElement("div");i.id="audioleft";var o=document.createElement("audio");o.id="myaudio",o.muted=!0,o.setAttribute("autoplay",!0),o.setAttribute("controls",!0),i.appendChild(o),i.style="display:none;";var a=document.createElement("div");a.id="audioright",a.style="display:none;";var r=document.createElement("audio");r.id="peeraudio",r.setAttribute("autoplay",!0),r.setAttribute("controls",!0),a.appendChild(r),window.EZUIKit.handleTalkError=function(e){console.log("talk err",e),void 0!==n.jSPlugin.handleTalkError&&n.jSPlugin.handleTalkError(e)},window.EZUIKit.handleTalkSuccess=function(e){console.log("talk success",e),void 0!==n.jSPlugin.handleTalkSuccess&&n.jSPlugin.handleTalkSuccess(e)},window.EZUIKit.opt={rtcUrl:"",talkLink:"",ttsUrl:"",stream:"",deviceSerial:R(this.jSPlugin.url).deviceSerial,channelNo:R(this.jSPlugin.url).channelNo},this.audioLeft=i,this.audioRight=a,document.body.appendChild(i),document.body.appendChild(a)}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"destroy",value:function(){document.body.removeChild(this.audioLeft),document.body.removeChild(this.audioRight)}},{key:"startTalk",value:function(e){var t=this,n=this;new Promise((function(e,n){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(R(t.jSPlugin.url).deviceSerial),{method:"GET",headers:{accessToken:t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.global}}).then((function(e){return e.json()})).then((function(n){n.meta&&200==n.meta.code?n.data&&n.data.valueInfo&&0==n.data.valueInfo.mode?fetch(t.jSPlugin.env.domain+"/api/v3/device/talkMode"+"?deviceSerial=".concat(R(t.jSPlugin.url).deviceSerial,"&channelNo=").concat(R(t.jSPlugin.url).channelNo,"&mode=1"),{method:"PUT",headers:{accessToken:t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.video}}).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:n})})).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 o=new FormData;if(o.append("accessToken",t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.video),o.append("deviceSerial",R(t.jSPlugin.url).deviceSerial),o.append("channelNo",t.jSPlugin.channelNo||"0"),t.jSPlugin.params.extraParams&&t.jSPlugin.params.extraParams.talkParams&&"object"===T(t.jSPlugin.params.extraParams.talkParams))for(var a in t.jSPlugin.params.extraParams.talkParams)data.append(a,t.jSPlugin.params.extraParams.talkParams[a]);fetch(t.jSPlugin.env.domain+"/api/lapp/live/talk/url",{method:"POST",body:o}).then((function(e){return e.json()})).then((function(i){if(200==i.code){var o=i.data;if(o){var a=o.rtcUrl;if(-1===a.indexOf("ws")&&(a=a.replace("https","wss").replace("rtcgw","rtcgw-ws")),window.EZUIKit.opt.rtcUrl=a,window.EZUIKit.opt.ttsUrl="tts://"+o.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"===T(t.jSPlugin.params.extraParams.ttsParams))for(var r in t.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+r+"="+t.jSPlugin.params.extraParams.ttsParams[r];window.EZUIKit.opt.deviceSerial=R(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,o.ttsUrl.indexOf("gb28181")>-1&&(window.EZUIKit.opt.talkType="gb28181"),e&&e(o.ttsUrl.indexOf("gb28181")>-1||-1!==window.EZUIKit.opt.deviceSerial.indexOf(":")),window.EZUIKit.opt.stream=t.jSPlugin.accessToken?o.stream:t.jSPlugin.token.streamToken.talk,window.startTalk({customizeStream:n._customizeStream.bind(n),audio:!t.microphoneId||{deviceId:t.microphoneId}}),t.observeVolumeChange(),t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:t,msg:"开启对讲"})}}else console.log(i.code,t.jSPlugin.i18n.t("38"+i.code)),t.pluginStatus.loadingSetText({text:i.msg||t.jSPlugin.i18n.t("38"+i.code),color:"red",delayClear:2e3}),t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:-1,target:t,msg:i.msg||t.jSPlugin.i18n.t("38"+i.code)}),"function"==typeof t.jSPlugin.params.handleError&&t.jSPlugin.params.handleError({msg:i.msg||t.jSPlugin.i18n.t("38"+i.code),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(){var e=this;try{window.stopTalk()}catch(e){console.log("stopTalk error:",e)}this.gainNode=null,clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null,this.jSPlugin.eventEmitter&&(setTimeout((function(){e.jSPlugin.eventEmitter.emit("volumeChange",{eventType:"volumeChange",code:0,target:e,data:0,msg:"音量变化"})}),200),this.jSPlugin.eventEmitter.emit("stopTalk",{eventType:"stopTalk",code:0,target:this,msg:"结束对讲"})),document.getElementById("myaudio")&&document.getElementById("myaudio").srcObject&&document.getElementById("myaudio").srcObject.getTracks()[0].stop()}},{key:"changeTalkChannelNo",value:function(e){window.EZUIKit.opt&&window.EZUIKit.opt.channelNo&&(this.talkChannelNo=e,window.EZUIKit.opt.channelNo=e)}},{key:"_customizeStream",value:function(e){var t=this;return new Promise((function(n,i){var o,a=new window.AudioContext;t.gainNode=a.createGain();var r=a.createMediaStreamSource(e);t.gainNode.gain.value=null!==(o=t.volumeGain)&&void 0!==o?o:1;var s=a.createMediaStreamDestination();r.connect(t.gainNode),t.gainNode.connect(s),n(s.stream)}))}},{key:"setVolumeGain",value:function(e){var t=["",null].includes(e)?1:Number(e);return"number"==typeof t&&t>=0?(this.volumeGain=Math.min(t,10),this.gainNode&&(this.gainNode.gain.value=this.volumeGain),{code:0,msg:"成功",res:null}):{code:-1,msg:"参数格式有误",res:null}}},{key:"observeVolumeChange",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).interval,n=void 0===t?100:t;this.volumeChangeInterval&&(clearInterval(volumeChangeInterval),volumeChangeInterval=null),this.volumeChangeInterval=setInterval((function(){var t,n,i,o,a;null===(t=window.tts)||void 0===t||null===(n=t.webrtcStuff)||void 0===n||null===(i=n.pc)||void 0===i||null===(o=i.getStats)||void 0===o||null===(a=o.call(i))||void 0===a||a.then((function(t){t.forEach((function(t){var n,i;"media-source"===t.type&&(null===(n=e.jSPlugin)||void 0===n||null===(i=n.eventEmitter)||void 0===i||i.emit("volumeChange",{eventType:"volumeChange",code:0,target:e,data:t.audioLevel,msg:"音量变化"}))}))}))}),n)}},{key:"getMicrophonePermission",value:function(){return new Promise((function(e,t){navigator.mediaDevices.getUserMedia({audio:!0}).then((function(t){t.getTracks().forEach((function(e){e.stop()})),e({code:0,msg:"成功",res:null})})).catch((function(t){e({code:-1,msg:"获取麦克风权限失败",res:t})}))}))}},{key:"getMicrophonesList",value:function(){return new Promise((function(e,t){navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var n=[];t.map((function(e){"audioinput"==e.kind&&n.push(e)})),e({code:0,msg:"成功",res:n})})):e({code:-1,msg:"未查询到相关设备",res:null})}))}},{key:"setProfile",value:function(e){var t=this,n=e.microphoneId;n!==this.microphoneId&&(this.microphoneId=n,this.gainNode&&(window.stopTalk(),setTimeout((function(){window.startTalk({customizeStream:t._customizeStream.bind(t),audio:!t.microphoneId||{deviceId:t.microphoneId}})}),200)))}}])}(),Ie=function(){function e(t){var n=this;u(this,e),this.jSPlugin=t,this.pluginStatus=new H(this,this.jSPlugin.id),e._instanceStyle();var i=document.createElement("div");i.className="mobile-ez-ptz-container",i.id="mobile-ez-ptz-container";var o=window.innerHeight;i.style="display:inline-block;width: ".concat(this.jSPlugin.width,"px;text-align:center;height: ").concat(o-this.jSPlugin.height-5,"px");var a=document.createElement("div");a.className="live-ptz-title",a.id="live-ptz-title",a.innerHTML=this.jSPlugin.i18n.t("BTN_PTZ"),document.getElementById("live-ptz-title")||i.appendChild(a);var r=document.createElement("div");r.className="live-ptz-intro",r.id="live-ptz-intro",r.innerHTML=this.jSPlugin.i18n.t("MOBILE_PTZ_TIPS"),document.getElementById("live-ptz-intro")||i.appendChild(r);var s=document.createElement("div");s.id="mobile-ez-ptz-item",s.className="mobile-ez-ptz-wrap",s.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")||i.appendChild(s),A(i,document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.getElementById("mobile-ez-ptz-item").ontouchstart=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").ontouchend=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")},document.getElementById("mobile-ez-ptz-item").onmousedown=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").onmouseup=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")}}return p(e,[{key:"show",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: inline-block"}},{key:"hide",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: none"}},{key:"_handlePtzTouch",value:function(e,t){var n=this,i=document.getElementById("mobile-ez-ptz-item").getBoundingClientRect(),o=i.left+130,a=i.top+130,r=(e.x||e.changedTouches[0].clientX)-o,s=(e.y||e.changedTouches[0].clientY)-a,c=0,l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",d=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;Math.abs(r)>Math.abs(s)?r>0?(c=3,document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("default","active")):(c=2,document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("default","active")):s>0?(c=1,document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("default","active")):(c=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===c?180:1===c?0:2===c?90:270,"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)"),"stop"===t&&(l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",d=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById("mobile-ez-ptz-item").style="",document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("active","default"));var u=new FormData;u.append("deviceSerial",R(this.jSPlugin.url).deviceSerial),u.append("channelNo",R(this.jSPlugin.url).channelNo),u.append("speed",1),u.append("direction",c),u.append("accessToken",d),fetch(l,{method:"POST",body:u}).then((function(e){return e.json()})).then((function(e){if(200==e.code);else{console.log(e.code,n.jSPlugin.i18n.t("38"+e.code));var t=n.jSPlugin.i18n.t("38"+e.code)||e.msg;n.pluginStatus.loadingSetText({text:t,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===c?180:1===c?0:2===c?90:270,"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"))}})).catch((function(e){console.log("云台调用异常",e)}))}}],[{key:"_instanceStyle",value:function(){e._STYLE||(e._STYLE=document.createElement("style"),e._STYLE.innerHTML="\n body{\n padding: 0;\n margin: 0;\n }\n #mobile-ez-ptz-container {\n display: inline-block;\n width: 375px;\n text-align: center;\n }\n .live-ptz-title{\n height: 25px;\n font-size: 18px;\n color: #2c2c2c;\n text-align: center;\n font-weight: 700;\n margin: 24px 0 12px;\n }\n .live-ptz-intro {\n margin-bottom: 24px;\n color: #aaaaaa;\n }\n .mobile-ez-ptz-wrap {\n background-image: linear-gradient(180deg, #f6f8ff 0%, #ededed6b 50%)\n }\n #mobile-ez-ptz-container .mobile-ez-ptz-container {\n position: relative;\n width: 260px;\n height: 260px;\n background: rgba(255, 255, 255, 0.80);\n border: 1px solid rgba(255, 255, 255, 0.80);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n margin: auto;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n top: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top.active {\n border-bottom-color: #1890FF;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n bottom: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom.active {\n border-top-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-left: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n right: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right.active {\n border-left-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n left: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left.active {\n border-right-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .ez-ptz-main.center {\n width: 52px;\n height: 52px;\n background: #FFFFFF;\n border: 2px solid #eee;\n border-radius: 100%;\n top: calc(50% - 26px);\n left: calc(50% - 26px);\n position: absolute;\n /* box-shadow: 0px -39px 40px 6px #1890ff; */\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-wrap {\n display: inline-block;\n padding: 24px 24px;\n border-radius: 100%;\n overflow: hidden;\n }\n\n #mobile-ez-ptz-container .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }",document.getElementsByTagName("head")[0].appendChild(e._STYLE))}}])}();f(Ie,"_STYLE",void 0);var xe={header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]},footer:{color:"#FFFFFF",backgroundColor:"rgb(0 0 0 / 0%)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-0",iconId:"play",part:"left",defaultActive:1,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-1",iconId:"capturePicture",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-2",iconId:"sound",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-3",iconId:"pantile",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-4",iconId:"recordvideo",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-5",iconId:"talk",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-6",iconId:"hd",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-7",iconId:"webExpend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-8",iconId:"expend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]}},je={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Ae={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},De={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Re={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Le={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},Be={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Me={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Oe={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},ze=[{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:De.data.header,footer:De.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:Re.data.header,footer:Re.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:Be.data.header,footer:Be.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:Le.data.header,footer:Le.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:Me.data.header,footer:Me.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:je.data.header,footer:je.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:Ae.data.header,footer:Ae.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:Oe.data.header,footer:Oe.data.footer}],Ne=function(){return p((function e(t){var n=this;u(this,e),this.jSPlugin=t,this.enableZoom=!1,this.videoWidth=1920,this.videoHeight=1080,this.currentScale=1,this.currentPosition={left:0,top:0,right:1920,bottom:1080},this.info={},this.clientRect=document.getElementById(t.id).getBoundingClientRect(),this.DOM=document.getElementById(t.id);var i=document.createElement("div");i.id="".concat(t.id,"-zoom-container");var o=document.getElementById("".concat(t.id,"-audioControls")),a=48;o&&(a=o.offsetHeight);var r=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;":"";i.style="position: absolute;\n display:none;\n left: 12px;\n bottom: ".concat(t.isMobile?"".concat(a+6,"px"):"80px",";\n ").concat(r,"\n ");var s='\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; user-select: none;">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" 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>').concat(this.jSPlugin.i18n.t("ZOOM_ADD"),'</title>\n <g>\n <rect class="st0" width="20" height="20" fill="none"/>\n </g>\n <g>\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>\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>\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" 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>').concat(this.jSPlugin.i18n.t("ZOOM_SUB"),'</title>\n <g>\n <rect class="st0" width="20" height="20" fill="none"/>\n </g>\n <g>\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>\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 ');i.innerHTML=s,document.getElementById("".concat(t.id,"-audioControls-left"))&&(document.getElementById("".concat(t.id,"-audioControls-left")).parentNode.appendChild(i),document.getElementById("".concat(t.id,"-addScale")).onclick=function(){n.addScale()},document.getElementById("".concat(t.id,"-subScale")).onclick=function(){n.subScale()}),this._event()}),[{key:"_event",value:function(){var e=this,t=setInterval((function(){var n=document.getElementById("".concat(e.jSPlugin.id,"-container-0"));clearInterval(t),e.jSPlugin.isMobile?n&&(n.addEventListener("touchstart",(function(t){return e.onTouchstart(t)})),n.addEventListener("touchend",(function(t){return e.onTouchend(t)}))):n&&(n.addEventListener("mousedown",(function(t){return e.onMouseDown(t)})),n.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 n=e.touches[0];if(n){var i={clientX:0,clientY:0};i.clientX=n.clientX,i.clientY=n.clientY,this.point1=i}}},{key:"onTouchend",value:function(e){var t=this,n=this.currentPosition;if(1===this.currentScale)return!1;var i=e.changedTouches[0];this.isMobileFullScreen?(n.left=n.left-(i.clientY-t.point1.clientY),n.top=n.top+(i.clientX-t.point1.clientX)):(n.left=n.left-(i.clientX-t.point1.clientX),n.top=n.top-(i.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,n){var i=e?e.getBoundingClientRect():null,o=t?t.getBoundingClientRect():null,a=n?n.getBoundingClientRect():null;if(!i&&!o&&!a)return null;if(!i)return o.top<a.top?t:n;if(!o)return i.top<a.top?e:n;if(!a)return i.top<o.top?e:t;var r=[i.top,o.top,a.top],s=Math.max.apply(Math,r);return i.top===s?e:o.top===s?t:n}},{key:"handleFullscreen",value:function(e,t,n){this.clientRect={width:t,height:n}}},{key:"startZoom",value:function(){try{if(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="block"),this.dpr="v1-soft"==this.jSPlugin.decodeEngine?1:this.jSPlugin.dpr,this.jSPlugin.jSPlugin)try{var e=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.info=Object.assign({},e),this.videoWidth=(e.width||this.jSPlugin.width)*this.dpr,this.videoHeight=(e.height||this.jSPlugin.height)*this.dpr,this.currentPosition.right=e.width*this.dpr,this.currentPosition.bottom=e.height*this.dpr,this.jSPlugin.jSPlugin.bEZoom=!0}catch(e){}this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("startZoom",{eventType:"startZoom",code:0,target:this,msg:"开启电子放大"}),this.renderDot(),this.enableZoom=!0}catch(e){this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("startZoom",{eventType:"startZoom",code:-1,target:this,msg:e||"开启电子放大失败"})}}},{key:"stopZoom",value:function(){try{this._resetZoom(),this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopZoom",{eventType:"stopZoom",code:0,target:this,msg:"关闭电子放大"}),document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="none")}catch(e){this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopZoom",{eventType:"stopZoom",code:-1,target:this,msg:e||"关闭电子放大失败"})}}},{key:"_resetZoom",value:function(){this.currentScale=1,this.currentPosition.left=0,this.currentPosition.top=0,this.currentPosition.right=this.videoWidth,this.currentPosition.bottom=this.videoHeight,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,n=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);if(console.log("info::",n),n.width!=this.info.width){var i=parseFloat(n.width/this.info.width);e.left=e.left*i*(i>1?1.25:.75),e.right=e.right*i*(i>1?1.25:.75),this.info.width=n.width,this.videoWidth=n.width*(i>1.25?1:.75)*this.dpr}if(n.height!=this.info.height){var o=parseFloat(n.height/this.info.height);e.top=e.top*o*(o>1?1.25:.75),e.bottom=e.bottom*o*(o>1?1.25:.75),this.info.height=n.height,this.videoHeight=n.height*(o>1?1.25:.75)*this.dpr}e.left=e.left+.5*(e.right-e.left-this.videoWidth/t),e.left<=0?e.left=0:e.left>this.videoWidth-this.videoWidth/t&&(e.left=this.videoWidth-this.videoWidth/t),e.right=e.left+this.videoWidth/t,e.top=e.top+.5*(e.bottom-e.top-this.videoHeight/t),e.top<=0?e.top=0:e.top>this.videoHeight-this.videoHeight/t&&(e.top=this.videoHeight-this.videoHeight/t),e.bottom=e.top+this.videoHeight/t,e.left=parseInt(e.left,10),e.right=parseInt(e.right,10),e.top=parseInt(e.top,10),e.bottom=parseInt(e.bottom,10);try{e.left<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;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomAdd",{eventType:"zoomAdd",code:1,target:this,msg:"执行放大"}),this.currentScale>=8?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_ADD_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale+e,this.currentScale>8?(console.log("超出最大倍率"),this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"subScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomSub",{eventType:"zoomSub",code:1,target:this,msg:"执行缩小"}),this.currentScale<=1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_SUB_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale-e,this.currentScale<1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"_JSPlayM4_SetDisplayRegion",value:function(e,t,n,i,o){this.jSPlugin&&this.jSPlugin.jSPlugin&&(console.log("%c计算后,","color: red;",this.videoWidth,this.videoHeight,e,t,n,i,this.currentScale),this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(e,t,n,i,o,this.isMobileFullScreen))}},{key:"isMobileFullScreen",get:function(){return!!(M()&&this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state.expend)}}])}(),Fe=[{videoLevel:1,streamTypeIn:2,type:"compatible"},{videoLevel:2,streamTypeIn:1,type:"compatible"}],Ue={0:"VIDEO_LEVEL_FLUENT",1:"VIDEO_LEVEL_SATNDARD",2:"VIDEO_LEVEL_HEIGH",3:"VIDEO_LEVEL_SPUER",4:"VIDEO_LEVEL_EXTREME",5:"VIDEO_LEVEL_3K",6:"VIDEO_LEVEL_4k"},Ve="8.1.6",He=function(e,t,n,i){var o="".concat(e.env.domain,"/api/service/media/template/getDetail?accessToken=").concat(e.accessToken||e.token.httpToken.url,"&id=").concat(t);fetch(o,{method:"GET"}).then((function(e){return e.json()})).then((function(e){var t;(t=e).meta&&n(t)})).catch((function(e){var t;t=e,console.log(t),i(t)}))},Ge=function(e){var t="".concat(e.env.domain,"/api/service/device/capacity/video/quality?accessToken=").concat(e.accessToken||e.token.deviceToken.video,"&deviceSerial=").concat(e.deviceSerial,"&channelNo=").concat(e.channelNo),n=[];return fetch(t,{method:"GET",headers:{clientType:"ezuikit",sdkVersion:Ve}}).then((function(e){return e.json()})).then((function(e){return(e.meta&&200===e.meta.code&&e.data&&e.data.length>0?e.data:Fe).map((function(e){n.push({name:Ue[e.videoLevel],level:e.videoLevel,streamTypeIn:e.streamTypeIn,type:e.type})})),n})).catch((function(){return Fe.map((function(e){n.push({name:Ue[e.videoLevel],level:e.videoLevel,streamTypeIn:e.streamTypeIn,type:"compatible"})})),n}))},Ze=function(e,t){var n="".concat(e.env.domain,"/api/v3/device/setVideoLevel?accessToken=").concat(e.accessToken||e.token.deviceToken.video," "),i=new FormData;return i.append("videoLevel",parseInt(t)),fetch(n,{method:"POST",headers:{accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:e.deviceSerial,localIndex:e.channelNo},body:i}).then((function(e){return e.json()})).then((function(e){return e}))},We=function(e,t){var n=new FormData;return Object.keys(t).map((function(e){n.append(e,t[e])})),fetch(e.env.domain+"/api/service/media/stream/server/info?version=2.0&protocol=4",{method:"GET",headers:{deviceSerial:t.deviceSerial,accessToken:t.accessToken,localIndex:t.localIndex}}).then((function(e){return e.json()})).then((function(t){if(t.meta&&200==t.meta.code){var n=JSON.parse(localStorage.getItem("ezuikit_addressList")),i=function(t){var i=e.deviceSerial+"_"+e.channelNo,o=new Date;n[i]=[{domain:t.domain,port:t.port,expire:new Date(o.setHours(o.getHours()+12)).Format("yyyyMMddThhmmssZ")}],Array.isArray(t.backups)&&t.backups.map((function(e){n[i].push({domain:e.domain,port:e.port,expire:new Date(o.setHours(o.getHours()+12)).Format("yyyyMMddThhmmssZ")})})),localStorage.setItem("ezuikit_addressList",JSON.stringify(n))};if(t.data&&Array.isArray(n[e.deviceSerial+"_"+e.channelNo])){var o=Array.isArray(t.data.backups)?b(t.data.backups):[];o.push({domain:t.data.domain,port:t.data.port}),(!function(e,t){if(e.length!==t.length)return!1;for(var n=b(e).sort((function(e,t){return e.domain>t.domain?1:-1})),i=b(t).sort((function(e,t){return e.domain>t.domain?1:-1})),o=0;o<n.length;o++)if(n[o].domain!==i[o].domain)return!1;return!0}(n[e.deviceSerial+"_"+e.channelNo],o)||n[e.deviceSerial+"_"+e.channelNo][0].expire<=(new Date).Format("yyyyMMddThhmmssZ"))&&i(t.data)}e.maxReloadTime=n[e.deviceSerial+"_"+e.channelNo].length}return t}))},qe=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},Ke=500,Je=function(){return p((function e(t){var n=this;u(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;var o=ce.getGlobalState();if(this.decoderState={state:{play:!1,pauseDate:null,sound:!o.sound&&!!t.audio,recordvideo:!1,recordCount:"00:00",talk:!1,zoom:!1,pantile:!1,speed:!1,expend:!1,webExpend:!1,cloudRec:"cloud.rec"===R(t.url).type,rec:"rec"===R(t.url).type,type:R(t.url).type}},this.allowZoom=!this.jSPlugin.use3DZoom,this.zoomDisable=!1,this.pluginStatus=new H(this,this.jSPlugin.params.id),this.inited=!1,this.isMobile=M(),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.pauseTime=null,this.themeData=xe,this.jSPlugin.themeId)switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"security":case"voice":case"simple":case"miniRec":var a=i(ze,(function(e){return e.themeId===n.jSPlugin.themeId}));a&&(this.themeData=a),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 Ce(this.jSPlugin)),C("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),C("".concat(this.jSPlugin.staticPath,"/css/theme.css")),this._fullscreenchange=null,this._fullScreenChangeEvent()}),[{key:"fetchThemeData",value:function(e){var t=this;He(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]}))),e.data.themeType&&("live"===R(t.jSPlugin.url).type?-1===e.data.themeType.toLowerCase().indexOf("live")&&console.error("当前模板类型".concat(e.data.themeType,"与播放类型").concat(R(t.jSPlugin.url).type,"不对应,请检查模板类型")):-1===e.data.themeType.toLowerCase().indexOf("rec")&&console.error("当前模板类型".concat(e.data.themeType,"与播放类型").concat(R(t.jSPlugin.url).type,"不对应,请检查模板类型"))),t.initThemeData(),t.renderThemeData()):console.log("模板获取失败:",e)}),(function(e){console.log("模板获取失败:",e),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 n=i(ze,(function(e){return e.themeId===t.jSPlugin.themeId}));n&&(this.themeData=n),this.initThemeData();break;default:this.fetchThemeData(e)}else"object"===T(e)&&(this.themeData=e,this.initThemeData());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(e)}},{key:"renderThemeData",value:function(){var e=this,t=this.themeData,n=t.header,i=t.footer;if(this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color.replace("-diy",""),n.btnList.map((function(t,n){t.isrender&&e.setDecoderState(f({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&i)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i.color.replace("-diy",""),this.jSPlugin.params.extraBtn&&(i.btnList=[].concat(b(i.btnList),b(this.jSPlugin.params.extraBtn))),i.btnList.map((function(t,n){if(t.isrender&&e.setDecoderState(f({},t.iconId,e.decoderState.state[t.iconId])),"play"===t.iconId&&t.defaultActive&&!e.themeInited&&e.jSPlugin.autoplay)var i=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(i),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"),document.getElementById("".concat(e.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.opacity=1,document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.pointerEvents="all"),e.startAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===R(this.jSPlugin.url).type,rec:"rec"===R(this.jSPlugin.url).type,type:R(this.jSPlugin.url).type});else if(!this.themeInited)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&e.jSPlugin.autoplay&&(clearInterval(a),e.themeInited=!0)}),50);o(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 Ne(this.jSPlugin))}},{key:"setDecoderState",value:function(e){var t=this,n=this.themeData,i=n.header,o=n.footer;Object.keys(e).map((function(n,a){var r="#FFFFFF",s="#FFFFFF";switch(-1===i.btnList.findIndex((function(e){return e.iconId===n}))?(r=o.color.replace("-diy",""),s=o.activeColor.replace("-diy","")):(r=i.color.replace("-diy",""),s=o.activeColor.replace("-diy","")),n){case"play":e[n]?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[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[0].style.fill=e[n]?s:r):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[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[1].style.fill=e[n]?s:r);break;case"sound":document.getElementById("".concat(t.jSPlugin.id,"-sound"))&&(e[n]?(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[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[n]?s:r):(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[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[0].style.fill=e[n]?s:r));break;case"recordvideo":document.getElementById("".concat(t.jSPlugin.id,"-recordvideo"))&&(document.getElementById("".concat(t.jSPlugin.id,"-recordvideo")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-recordvideo-content")).childNodes[0].style.fill=e[n]?s:r,e[n]?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[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[n]?s:r);break;case"zoom":document.getElementById("".concat(t.jSPlugin.id,"-zoom"))&&(document.getElementById("".concat(t.jSPlugin.id,"-zoom")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-zoom-content")).childNodes[1].style.fill=e[n]?s:r);break;case"pantile":document.getElementById("".concat(t.jSPlugin.id,"-pantile"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-pantile-content")).childNodes[0].style.fill=e[n]?s:r);break;case"webExpend":e[n]?(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[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[0].style.fill=e[n]?s:r,document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[1].style.fill=e[n]?s:r);break;case"capturePicture":document.getElementById("".concat(t.jSPlugin.id,"-capturePicture"))&&(document.getElementById("".concat(t.jSPlugin.id,"-capturePicture")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-capturePicture-content")).childNodes[0].style.fill=e[n]?s:r);break;case"expend":e[n]?(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[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[0].style.fill=e[n]?s:r,document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[1].style.fill=e[n]?s:r);break;case"hd":break;case"speed":if(document.getElementById("".concat(t.jSPlugin.id,"-speed"))){var c=document.getElementById("".concat(t.jSPlugin.id,"-speed-content")).children[1].children[0];"not-allowed"!==c.style.cursor&&(c.style.color=e[n]?s:r,c.style.borderColor=e[n]?s:r)}document.getElementById("".concat(t.jSPlugin.id,"-select-mask"))&&(t.isMobile&&e[n]?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[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[n]?s:r),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?r:s);break;case"cloudRecord":var l=document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord"));l&&(l.className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=e[n]?s:r),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?r:s);break;case"rec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[n]?r:s),document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=e[n]?r:s),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?s:r)}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"),document.getElementById("".concat(e.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-headControl")).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"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).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 n=this.matchBtn(e),i=document.createElement("div");i.className="theme-icon-item",i.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>Ke?48:32,'px;display: flex;align-items: center;position:relative;">')).concat(n.domString,"</div>")+"</span>",i.onclick=function(e){n.onclick(e)},n.onmouseenter&&(i.onmouseenter=function(e){n.onmouseenter(e)}),n.onmouseleave&&(i.onmouseleave=function(e){n.onmouseleave(e)}),"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[0].appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[1].appendChild(i)}},{key:"renderHeader",value:function(e,t){var n=this.matchBtn(e),i=document.createElement("div");i.className="theme-icon-item",i.style="max-width:50%;",i.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>Ke?48:32,'px;">')).concat(n.domString,"</span>")+"</span>",i.onclick=function(e){n.onclick(e)},"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[1].appendChild(i)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<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(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"setDisabled",value:function(e){var t=this.decoderState.state,n=t.sound,i=t.expend,o=e?"cursor: not-allowed; color: gray; fill: gray; ":"cursor: default";null!=document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,n?"-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",o),null!=document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon")).setAttribute("style",o),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",o),null!=document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon"))&&document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon")).setAttribute("style",o),this.allowZoom||null!=document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon")).setAttribute("style",o),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",o);var a=document.getElementsByClassName("".concat(this.jSPlugin.id,"-select-quality-btn"));if(a.length)for(var r=0;r<a.length;r++)e?(a[r].style.cursor="not-allowed",a[r].style.color="gray",a[r].style.fill="gray"):(a[r].style.cursor="default",a[r].style.fill="",a[r].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,n=this.themeData,i=n.header,a=n.footer,r={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===i.btnList.findIndex((function(t){return t.iconId===e}))?(r.color=a.color,r.backgroundColor=a.backgroundColor,r.activeColor=a.activeColor):(r.color=i.color,r.backgroundColor=i.backgroundColor,r.activeColor=i.activeColor);var s=this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf("cloud.rec"),c=this.isMobile?45:32;switch(e){case"play":r.title=this.jSPlugin.i18n.t("BTN_PLAY"),r.id=e,r.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>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?48:32,'" fill="').concat(r.color,'" viewBox="-6 -6 32 32">\n <path 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(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.rec,o=e.cloudRec,a=e.recordvideo,r=e.pantile,s=e.expend,c=e.zoom,l=e.talk,d=e.sound,u=ce.getGlobalState(),m=ce.getInstance(t.jSPlugin.id);window.recTimer&&Array.isArray(window.recTimer[t.jSPlugin.id])&&(window.recTimer[t.jSPlugin.id].map((function(e){clearInterval(e)})),window.recTimer[t.jSPlugin.id]=[]),n?(i||o?(t.Rec&&t.Rec.unSyncTimeLine(),t.jSPlugin.pause().then((function(){t.setDecoderState({play:!n}),t.setDisabled(n)}))):(t.jSPlugin.stop((function(){}),!0).then((function(){t.setDecoderState({play:!n}),t.setDisabled(n)})),c&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),l&&(t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk(),u.talk&&ce.setGlobalState({talk:!1}),m.getState().talk&&m.setState({talk:!1}))),a&&t.setDecoderState({recordvideo:!1}),d&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1}),m.setState({sound:!0}))):(i||o?(t.Rec&&t.Rec.syncTimeLine(),t.jSPlugin.resume().then((function(){t.setDisabled(n),t.setDecoderState({play:!n,expend:s})}))):t.jSPlugin.play().then((function(){t.setDisabled(n),t.setDecoderState({play:!n,expend:s})})),t.jSPlugin.use3DZoom&&t.resetMobileZoomStatus()),t.jSPlugin.use3DZoom?(t.setDecoderState({zoom:!1}),t.allowZoom=!1):t.allowZoom=i||o,r&&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":r.title=this.jSPlugin.i18n.t("BTN_SOUND"),r.id=e,r.domString='<span style="height: 100%">'+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-nosound-icon" style="display:none" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?48:32,'" fill="').concat(r.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 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>",r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.sound,o=e.talk,a=e.pantile;n&&!o&&(i?(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})):t.jSPlugin.openSound(),a&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})))};break;case"recordvideo":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_RECORDVIDEO"),r.id=e,r.domString='<svg id="'.concat(this.jSPlugin.id,'-recordvideo-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.recordvideo;n&&(i?(t.jSPlugin.stopSave(t.jSPlugin.downloadRecord),t.setDecoderState({recordvideo:!1})):(t.jSPlugin.startSave("".concat((new Date).getTime())),t.setDecoderState({recordvideo:!0})))};break;case"capturePicture":r.title=this.jSPlugin.i18n.t("BTN_CAPTURE"),r.id=e,r.domString='<svg id="'.concat(this.jSPlugin.id,'-capturePicture-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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>',r.onclick=function(){t.decoderState.state.play?t.jSPlugin.capturePicture("".concat((new Date).getTime()),(function(){}),t.jSPlugin.download):console.log("视频未播放,无法截图")};break;case"talk":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_TALK"),r.id=e,r.domString='<div style="height: '.concat(this.jSPlugin.width>Ke?15:10,"px; width: ").concat(this.jSPlugin.width>Ke?8:5,"px; position: absolute; left: ").concat(this.jSPlugin.width>Ke?20:13,"px; top: ").concat(this.jSPlugin.width>Ke?14:9,'px; border-radius: 50%; overflow:hidden;">')+'<div id="'.concat(this.jSPlugin.id,'-volume-column" style="height: 0; width: 100%; position: absolute; background: #00cc66; left: 0; bottom: 0; display: none;"></div>')+"</div>"+'<svg id="'.concat(this.jSPlugin.id,'-talk-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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>',this.jSPlugin.eventEmitter.on("volumeChange",(function(e){var n=e.data;document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.height="".concat(100*n,"%"))})),r.onclick=function(){var e=t.decoderState.state,n=e.talk,i=e.sound,a=e.play,r=ce.getGlobalState(),s=ce.getInstance(t.jSPlugin.id);if(a)if(n){t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk();var c=o(t.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;t.themeData&&c&&t.jSPlugin.openSound(),r.talk&&ce.setGlobalState({talk:!1}),s.getState().talk&&s.setState({talk:!1})}else{if(r.talk)return console.warn("当前已经有设备正在对讲"),void(t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:430005,target:t,msg:"当前已经有设备正在对讲"}));t.setDecoderState({talk:!0}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="block",t.jSPlugin.Talk.startTalk((function(e){i&&!e&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),ce.setGlobalState({talk:!0}),s.setState({talk:!0})}))}};break;case"zoom":if(s)break;r.title=this.jSPlugin.use3DZoom?this.jSPlugin.i18n.t("BTN_3D_ZOOM"):this.jSPlugin.i18n.t("BTN_ZOOM"),r.id=e,r.domString="<div></div>"+'<svg id="'.concat(this.jSPlugin.id,'-zoom-icon" class="theme-icon-item-icon" fill="').concat(r.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>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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>'),r.onclick=function(){var e=t.decoderState.state,n=e.zoom,i=e.play,o=e.rec,a=e.cloudRec;if(t.jSPlugin.use3DZoom){if(!i)return!1;n?t.jSPlugin.close3DZoom():t.jSPlugin.enable3DZoom()}else{if(t.zoomDisable||!o&&!a&&!i)return!1;n?t.jSPlugin.Zoom.stopZoom():t.jSPlugin.Zoom.startZoom()}t.setDecoderState({zoom:!n})};break;case"pantile":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_PTZ"),r.id=e,r.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(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.pantile,o=e.expend;if(n)if(i)t.Ptz.hide(),t.setDecoderState({pantile:!1});else{if(t.isMobile&&!o)return console.log("移动端,非全屏状态不展示云台"),!1;t.Ptz.show(),t.setDecoderState({pantile:!0})}};break;case"expend":r.title=this.jSPlugin.i18n.t("BTN_EXPEND"),r.id=e,r.domString='<span><svg id="'.concat(this.jSPlugin.id,'-expend-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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 id="'.concat(this.jSPlugin.id,'-unexpend-icon" class="theme-icon-item-icon" style="display:none" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?48:32,'" fill="').concat(r.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>'),r.onclick=function(){var e=t.decoderState.state,n=e.expend,i=e.pantile;if(e.play)if(n)if(t.isMobile){var o=t._extendHeadeTimeLinrHight(!0);document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-32px"),document.getElementById("".concat(t.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(t.jSPlugin.id,"-select-speed")).style.background="#ffffff"),function(e,t,n){var i="";i+="width:"+t+"px;",i+="height:"+n+"px;",i+="-webkit-transform: none; transform: none;",i+="-webkit-transform-origin: 0 0;",i+="transform-origin: 0 0;",i+="position: relative;",e.style.cssText=i}(document.getElementById("".concat(t.jSPlugin.id,"-wrap")),t.jSPlugin.width,t.jSPlugin.height),console.log("[mobile cancelMobileFullScreen]"),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).classList.remove("ezuikit-player-wrap-mobile-fullscreen"),t.jSPlugin.jSPlugin.JS_Resize(t.jSPlugin.width,t.jSPlugin.height-o),i&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})),t.jSPlugin.fullScreenWidth=t.jSPlugin.width,t.jSPlugin.fullScreenHeight=t.jSPlugin.height,t.jSPlugin.Zoom&&t.jSPlugin.Zoom.handleFullscreen&&t.jSPlugin.Zoom.handleFullscreen(!n,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"),document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.height=45*t.jSPlugin.videoLevelList.length+"px"),t.setDecoderState({expend:!1})}else t.jSPlugin.exitFullscreen();else if(t.isMobile){var a=t._extendHeadeTimeLinrHight(!0);D(document.getElementById("".concat(t.jSPlugin.id,"-wrap"))),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).classList.add("ezuikit-player-wrap-mobile-fullscreen"),console.log("[mobile requestMobileFullScreen]");var r=document.documentElement.clientWidth,s=document.documentElement.clientHeight;document.getElementById("".concat(t.jSPlugin.id))&&(document.getElementById("".concat(t.jSPlugin.id)).style["backface-visibility"]="hidden"),document.getElementById("".concat(t.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(t.jSPlugin.id,"-select-speed")).style.background="none"),t.jSPlugin.jSPlugin.JS_Resize(s,r-a,!0),t.jSPlugin.fullScreenWidth=s,t.jSPlugin.fullScreenHeight=r-a,t.jSPlugin.Zoom&&t.jSPlugin.Zoom.handleFullscreen&&t.jSPlugin.Zoom.handleFullscreen(!n,s,r-a),document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon")).style.display="block"),document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom=0,document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.height="100%"),t.setDecoderState({expend:!0})}else t.jSPlugin.fullscreen()};break;case"webExpend":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_WEBEXPEND"),r.id=e,r.domString='<span><svg id="'.concat(this.jSPlugin.id,'-webExpend-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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(r.color,'" style="display:none;" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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>",r.onclick=function(){var e=t.decoderState.state,n=e.webExpend;if(e.expend)return console.log("正在全局全屏"),!1;window.recTimer&&Array.isArray(window.recTimer[t.jSPlugin.id])&&(window.recTimer[t.jSPlugin.id].map((function(e){clearInterval(e)})),window.recTimer[t.jSPlugin.id]=[]),n?t.jSPlugin.exitBrowserFullscreen():t.jSPlugin.browserFullscreen(),t.jSPlugin.Theme.Rec&&setTimeout((function(){t.jSPlugin.Theme.Rec.recAutoSize()}),100)};break;case"hd":if(s)break;var l="".concat(this.jSPlugin.id,"-select-quality"),d="".concat(l,"-item");r.title=this.jSPlugin.i18n.t("BTN_HD"),r.id=e;var u="",m="";return this.jSPlugin.videoLevelList.findIndex((function(e){return e.level==t.jSPlugin.videoLevel}))>-1?this.jSPlugin.videoLevelList.map((function(e){u+='<li class="selectOption default '.concat(d,'" style="height: ').concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;" name="option" data-type="').concat(e.level,'" id="').concat(l,"_").concat(e.level,'">').concat(t.jSPlugin.i18n.t(Ue[e.level]),"</li>"),e.level==t.jSPlugin.videoLevel&&(m+=t._videoLevelIcon(t.jSPlugin.id,l,t.jSPlugin.width,Ke,e))})):this.jSPlugin.videoLevelList.map((function(e,n){0===n&&(m+=t._videoLevelIcon(t.jSPlugin.id,l,t.jSPlugin.width,Ke,e)),u+='<li class="selectOption default '.concat(d,'" style="height: ').concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;" name="option" data-type="').concat(e.level,'" id="').concat(l,"_").concat(e.level,'">').concat(t.jSPlugin.i18n.t(Ue[e.level]),"</li>")})),u+='<li class="selectOption cancel" style="background: #ffffff;'.concat(this.isMobile?"":"display:none;",'" name="option" id="').concat(this.jSPlugin.id,'-select-speed">').concat(this.jSPlugin.i18n.t("SPEED_CANCEL"),"</li>"),m+='<span class=\'speed-select-mask\' style="display:none;height: 100vh;" id="'.concat(this.jSPlugin.id,'-select-hd-mask"></span>'),r.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?"100px":"50px",") !important;bottom: calc(env(safe-area-inset-bottom) + ").concat(this.isMobile?"100px":"50px",") !important;height: ").concat(this.jSPlugin.videoLevelList.length*c,'px">\n ').concat(u,'\n </ul>\n <span id="').concat(this.jSPlugin.id,'-hdSelect-icon-warp" style="user-select: none;">\n ').concat(m,"\n </span>"),r.onclick=function(e){var n=t.decoderState.state,i=n.expend,o=n.recordvideo,a=n.play,r=n.zoom,s=n.pantile,c=n.sound,d=n.talk;if(e.stopPropagation(),a){var u=e.target.id,m=e.target.getAttribute("data-type");if(0===u.indexOf(l)){if(t.jSPlugin.videoLevel+""!==m){if(d){var h=ce.getGlobalState(),p=ce.getInstance(t.jSPlugin.id);t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk(),h.talk&&ce.setGlobalState({talk:!1}),p.getState().talk&&p.setState({talk:!1})}var g=t.jSPlugin.videoLevelList.find((function(e){return e.level+""===m}));!g||g.streamTypeIn===t.jSPlugin.streamTypeIn&&g.level+""==t.jSPlugin.videoLevel+""||(t.jSPlugin.changeVideoLevel(g).then((function(e){c&&t.jSPlugin.openSound()})),r&&(t.jSPlugin.Zoom.stopZoom(),t.setDecoderState({zoom:!1})))}t.resetMobileZoomStatus(),o&&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&&i&&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",s&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1}))}},r;case"speed":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_SPEED"),r.id=e,r.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?"100px":"50px",") !important;bottom: calc(env(safe-area-inset-bottom) + ").concat(this.isMobile?"100px":"50px",') !important;">')+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed4">4').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed2">2').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption active" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed1">1').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed05">0.5').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption cancel" style="'.concat(this.isMobile?"":"display:none;",'" name="option" id="').concat(this.jSPlugin.id,'-select-speed">').concat(this.jSPlugin.i18n.t("SPEED_CANCEL"),"</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(r.color,';\n text-align: center;border-radius: 12.5px; user-select: none;"\n id="').concat(this.jSPlugin.id,'-speed-text"\n >').concat(1===this.nextRate?this.jSPlugin.i18n.t("SPEED"):"".concat(this.nextRate).concat(this.jSPlugin.i18n.t("SPEED_RATE")).replace("3","0.5"),"</div>\n ")+'<span class=\'speed-select-mask\' style="display:none;height: 100vh;" id="'.concat(this.jSPlugin.id,'-select-mask"></span>')+"</span>",r.onclick=function(e){var n=t.decoderState.state,i=n.speed,o=n.expend,a=n.play;if(e.stopPropagation(),!a)return!1;if(!i&&t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).className=o?"speed speed-select mobile expend":"speed speed-select mobile"),t.isMobile&&(o?(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) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)")),t.nextRate=1,e.target.id)switch(e.target.id){case"".concat(t.jSPlugin.id,"-select-speed1"):t.nextRate=1,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(1),t.jSPlugin.speed=1,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed2"):t.nextRate=2,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(2),t.jSPlugin.speed=2,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed4"):t.nextRate=4,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(4),t.jSPlugin.speed=4,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed05"):t.nextRate=3,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(.5),t.jSPlugin.speed=.5,t.setDecoderState({speed:!i});break;default:t.isMobile?t.setDecoderState({speed:!i}):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:!i}),t.themeData.autoFocus>0&&("none"===document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display?t.startAutoFocus():t.stopAutoFocus())};break;case"deviceName":r.title=this.jSPlugin.i18n.t("DEVICE_NAME"),r.id=e,r.domString="<span>".concat(this.jSPlugin.i18n.t("DEVICE_NAME"),"</span>"),r.onclick=function(){};break;case"deviceID":r.title=this.jSPlugin.i18n.t("DEVICE_ID"),r.id=e,r.domString="<span>".concat(this.jSPlugin.i18n.t("DEVICE_ID"),"</span>"),r.onclick=function(){};break;case"cloudRec":if(this.jSPlugin._isCloudRecord)break;r.title=this.jSPlugin.i18n.t("BTN_CLOUDREC"),r.id=e,r.domString='\n <span>\n <svg class="theme-icon-item-icon" fill="'.concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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 '),r.onclick=function(){var e=t.decoderState.state.sound;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=j("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()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))};break;case"cloudRecord":if(!this.jSPlugin._isCloudRecord)break;r.title=this.jSPlugin.i18n.t("BTN_CLOUDRECORD"),r.id=e,r.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(r.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>'),r.onclick=function(){var e=t.decoderState.state.sound;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=j("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()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))};break;case"rec":r.title=this.jSPlugin.i18n.t("BTN_REC"),r.id=e,r.domString='\n <span>\n <svg class="theme-icon-item-icon" fill='.concat(r.color,' version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>Ke?48:32,'" height="').concat(this.jSPlugin.width>Ke?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 '),r.onclick=function(){var e=t.decoderState.state.sound;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(){t.jSPlugin._isCloudRecord&&t.changeTheme("pcRec");var e=j("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()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))}}return r}},{key:"_videoLevelIcon",value:function(e,t,n,i,o){return'\n <span id="'.concat(e,'-videoLevel-icon" class="theme-icon-item-icon ').concat(t,"-btn\" data-type='").concat(o.level,"' style=\"display: inline-block;min-width: 48px;height: ").concat(n>i?48:32,"px;line-height: ").concat(n>i?48:30,'px;text-align: center;">\n ').concat(this.jSPlugin.i18n.t(Ue[o.level]),"\n </span>\n ")}},{key:"_fullScreenChangeEvent",value:function(){var e=this,t=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.getElementById("".concat(this.jSPlugin.id)),o=this;this._fullscreenchange=function(n){var a=o.decoderState.state.zoom;n.target===i?e.jSPlugin.isCurrentFullscreen?o.setDecoderState({expend:!0,webExpend:!1}):(o.setDecoderState({expend:!1,webExpend:!1}),a&&o.jSPlugin.use3DZoom&&o.jSPlugin.enable3DZoom()):n.target===t&&(e.jSPlugin.isCurrentBrowserFullscreen?o.setDecoderState({webExpend:!0}):o.setDecoderState({webExpend:!1})),o.Rec&&window.randomNum==o.jSPlugin.randomNum&&setTimeout((function(){o.Rec.recAutoSize((function(){if(o.jSPlugin.Zoom.currentScale>1){var e=o.jSPlugin.Zoom.currentScale;o.jSPlugin.Zoom.stopZoom(),setTimeout((function(){o.jSPlugin.Zoom.startZoom(),o.jSPlugin.Zoom.currentScale=e,o.jSPlugin.Zoom.doScale(e)}),200)}}))}),100),document.getElementById("".concat(o.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(o.jSPlugin.id,"-hdSelect")).style.display="none"),document.getElementById("".concat(o.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(o.jSPlugin.id,"-speedSelect")).style.display="none"),o.isMobile&&(document.getElementById("".concat(o.jSPlugin.id,"-select-hd-mask"))&&(document.getElementById("".concat(o.jSPlugin.id,"-select-hd-mask")).style.display="none"),document.getElementById("".concat(o.jSPlugin.id,"-select-mask"))&&(document.getElementById("".concat(o.jSPlugin.id,"-select-mask")).style.display="none")),o.themeData.autoFocus>0&&o.startAutoFocus(),e.setDecoderState({speed:!1})},n.isEnabled&&n.on("change",this._fullscreenchange)}},{key:"changeRecSpeed",value:function(e){var t=this,n=function(e){if(!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")},i="1";switch(e){case 1:n(2),i=this.jSPlugin.i18n.t("SPEED");break;case 2:n(1),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case 4:n(0),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case.5:n(3),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;default:n(2),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"))}document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&(document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).innerHTML=i)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,n=t.header,i=t.footer,a=this.jSPlugin.id;if(this.header=pe,this.footer=ge,this.isNeedRenderHeader=o(n.btnList,(function(e){return e.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isMobile&&(this.isNeedRenderHeader=o(n.btnList,(function(e){return e.isrender>0&&"deviceID"===e.iconId||e.isrender>0&&"deviceName"===e.iconId}))>=0&&"miniRec"!=this.jSPlugin.id),this.isNeedRenderFooter=o(i.btnList,(function(e){return e.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isNeedRenderTimeLine=o(n.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 s={height:this.jSPlugin.width>Ke?"48px":"32px","line-height":this.jSPlugin.width>Ke?"48px":"32px",display:"flex","justify-content":"space-between",top:0,left:0,right:0,"z-index":999,"background-color":"rgba(0,0,0,.8)",color:"#FFFFFF",width:"100%",position:"absolute"};r.style=qe(s),document.getElementById("".concat(a,"-wrap")).insertBefore(r,document.getElementById(a))}var c=document.getElementById("".concat(a,"-wrap")).classList.contains("ezuikit-player-wrap-mobile-fullscreen");!document.getElementById("".concat(this.jSPlugin.id,"-headControl"))||this.jSPlugin._isCurrentBrowserFullscreen||c||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1),!0)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))),!document.getElementById("".concat(this.jSPlugin.id,"-headControl"))||this.jSPlugin._isCurrentBrowserFullscreen||isMobileFullscreen||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1),!0);if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(this.jSPlugin.width>Ke?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>Ke?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 d={"min-height":this.jSPlugin.width>Ke?"48px":"32px","max-height":this.jSPlugin.width>Ke?"96px":"80px",position:"relative","margin-top":this.jSPlugin.width>Ke?"-48px":"-32px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%"};l.style=qe(d),l.innerHTML='<div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;height:').concat(this.jSPlugin.width>Ke?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>"),A(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=n.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color;var u,m=g(n.btnList);try{for(m.s();!(u=m.n()).done;){var h=u.value;if(h.isrender)try{this.renderHeader(h.iconId,h.part)}catch(e){}}}catch(e){m.e(e)}finally{m.f()}}if(this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))){document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i.color;var p,f=g(i.btnList);try{for(f.s();!(p=f.n()).done;){var v=p.value;if(v.isrender)try{this.renderFooter(v.iconId,v.part)}catch(e){}}}catch(e){f.e(e)}finally{f.f()}}if(this.isNeedRenderTimeLine)if(this.isMobile)document.getElementById("".concat(this.jSPlugin.id,"-headControl-right"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).style.display="none"),this.Rec?this.Rec.recInit():this.Rec=new de(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 ye(this.jSPlugin));var y=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(y)}),50)}if(o(this.themeData.footer.btnList,(function(e){return"pantile"===e.iconId&&1===e.isrender}))>=0&&!this.jSPlugin.disabledPTZ&&(this.isMobile&&(this.MobilePtz=new Ie(this.jSPlugin)),this.Ptz=new G(this.jSPlugin)),this.themeData.poster){this.jSPlugin.poster=this.themeData.poster;var S=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(S),e.jSPlugin.setPoster(e.themeData.poster))}),50)}this.inited=!0,this.jSPlugin.deviceInfo&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).innerHTML=this.jSPlugin.deviceInfo.deviceName||""),document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).innerHTML=R(this.jSPlugin.url).deviceSerial||"")),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&&(e.style.display="none"),this.jSPlugin.jSPlugin.Zoom&&this.jSPlugin.jSPlugin.Zoom.resetZoom()}}},{key:"webExpend",value:function(){var e=this.decoderState.state;e.webExpend;var t=e.expend;return!!e.play&&(t?(console.log("正在全局全屏"),!1):void this.jSPlugin.browserFullscreen())}},{key:"expend",value:function(){var e=this.decoderState.state,t=e.webExpend;return!!e.play&&(t?(console.log("正在网站全屏"),!1):void(this.isMobile?(D(document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.documentElement.clientWidth,document.documentElement.clientHeight,document.getElementById("".concat(this.jSPlugin.id)).style["backface-visibility"]="hidden"):this.jSPlugin.fullscreen()))}},{key:"_extendHeadeTimeLinrHight",value:function(e){var t=0,n=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"));return n&&!e&&(t=parseInt(window.getComputedStyle(n).height,10)),t}},{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 n,i=g(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=t.querySelector("#".concat(o));a&&(a.style.display="none")}}catch(e){i.e(e)}finally{i.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 n,i=g(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=t.querySelector("#".concat(o));a&&(a.style.display="")}}catch(e){i.e(e)}finally{i.f()}}}},{key:"destroy",value:function(){var e=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));this.Rec&&this.Rec.destroy&&this.Rec.destroy(),this.Ptz&&this.Ptz.destroy&&this.Ptz.destroy(),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 o=document.getElementById("mobile-ez-ptz-container");this._removeElement(o);var a=document.getElementById("date-switch-container-wrap");this._removeElement(a);var r=document.getElementById("rec-type-container-wrap");this._removeElement(r);var s=document.getElementById("mobile-rec-wrap");this._removeElement(s),n.isEnabled&&this._fullscreenchange&&n.off("change",this._fullscreenchange),ce.listInstances().length<=1&&(I("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),I("".concat(this.jSPlugin.staticPath,"/css/theme.css")))}},{key:"_removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}}])}(),Ye=function(){return p((function e(t){u(this,e),this.url=t.url||"",this.method=t.method||"POST",this.headers=t.headers||{},this.body=t.body||{},this.onBeforeUpload=t.onBeforeUpload||function(){},this.onUploadProgress=t.onUploadProgress||function(){},this.onUploadComplete=t.onUploadComplete||function(){},this.controller=new AbortController}),[{key:"upload",value:function(){var e=this;this.onBeforeUpload(this.body);var t={method:this.method,headers:this.headers,signal:this.controller.signal,body:this.body};fetch(this.url,t).then((function(e){return e.json()})).then((function(t){e.onUploadComplete({body:e.body,response:t})})).catch((function(e){"AbortError"===e.name?console.log("上传被取消"):console.error("Error:",e)})),t.body&&"FormData"==t.body.constructor.name&&"signal"in t&&t.signal.addEventListener("progress",(function(t){t.lengthComputable&&e.onUploadProgress(y(y({},e.body),{},{progress:t.loaded/t.total}))}))}},{key:"cancel",value:function(){this.controller.abort()}}])}(),Xe=function(){return p((function e(t,n){u(this,e),this.jSPlugin=t,this.isMobile=n,this.timer=null,this.initToastCustom()}),[{key:"initToastCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="none":this.randerToast()}},{key:"randerToast",value:function(){var e=this.jSPlugin.width,t=1;t=this.isMobile?e/375||1:e/1024||1;var n=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.createElement("div");i.style="display:none;position:absolute;top:0;width: 100%;align-items: center;justify-content: center;",i.id="".concat(this.jSPlugin.id,"-wrap-Toast-custom"),this.isMobile?i.innerHTML='<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 '):i.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 '),n.insertBefore(i,document.getElementById(this.jSPlugin.id))}},{key:"initToastContent",value:function(e){var t=this,n=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")))}),n)):(this.randerToast(),this.initToastContent(e))}}])}(),Qe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},s="";r=Object.assign(r,a);var c=new Headers;Object.keys(r).map((function(e){c.append(e,r[e])})),r=c,Object.keys(Object.assign({},n)).forEach((function(e){var t=n[e];"string"==typeof n[e]&&(t=n[e].replace("%","%25")),void 0!==n[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 l=e+(-1!==["GET","PUT","DELETE"].indexOf(t.toUpperCase())?s:""),d={headers:r,method:t};"POST"===t&&(d.body=s),"POST"===t&&a&&"application/json"===a["Content-Type"]&&(d.body=JSON.stringify(n)),"GET"===t&&(-1===l.indexOf("?")?l+="?_r=".concat(Math.random()):l+="&_r=".concat(Math.random())),fetch(l,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){i&&i(e)})).catch((function(e){o&&o(e)}))},$e=function(e,t,n){var i=new FormData;i.append("deviceSerial",R(e.url).deviceSerial),i.append("cmd","open"),fetch("".concat(domain,"/api/v3/device/acs/remote/door?accessToken=").concat(e.accessToken||e.token.deviceToken.globalAll),{method:"POST",body:i}).then((function(e){return e.json()})).then((function(e){console.log("get theme data",e),t(e)})).catch((function(e){n(e)}))},et=function(e,t,n){var i={accessToken:e.accessToken||e.token.httpToken.url,pageStart:0,pageSize:4,default:!0,voiceName:"轻应用语音文件"},o="".concat(e.env.domain,"/api/lapp/voice/query");Qe(o,"POST",i,(function(e){console.log(e),t(e)}),(function(e){console.log(e),n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},tt=function(e,t,n,i){var o="".concat(e.env.domain,"/api/lapp/voice/send"),a=new FormData;a.append("deviceSerial",R(e.url).deviceSerial),a.append("accessToken",e.accessToken||e.token.deviceToken.video),a.append("channelNo",R(e.url).channelNo||1),a.append("fileUrl",t),fetch(o,{method:"POST",body:a}).then((function(e){return e.json()})).then((function(e){!function(e){console.log(e),n(e)}(e)})).catch((function(e){var t;t=e,console.log(t),i(t)}))},nt=function(){return p((function e(t,n){u(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.switchFooter=n,this.sendLoadingStats=!1,this.toastCustom=new Xe(t,!1),this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.initQuickReply()}),[{key:"initQuickReply",value:function(){document.getElementById("pc-quickReply-back")||this.renderQuickReply(),document.getElementById("pc-quickReply-back-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){var e=this,t=this.videoWidth/1024||1,n=document.createElement("div");n.style="width:100%;",n.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(n),document.getElementById("pc-quickReply-back").onclick=function(){e.switchFooter("onBell")}}},{key:"matchQuickReplyBtn",value:function(){var e=this,t=this.videoWidth/1024||1,n=document.getElementById("pc-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,o){var a=document.createElement("div");a.id="pc-quickReply-back-item-".concat(o),a.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);"),a.innerHTML='<div id="pc-quickReply-back-item-box-'.concat(o,'">\n <span id="pc-quickReply-name-').concat(o,'" style="line-height: ').concat(64*t,'px;">').concat(i.voiceName,"</span>\n </div>"),a.onclick=function(){e.sendLoadingStats||(console.log("item:"+i),e.sendQuickReply(i,o))},n.appendChild(a)}))}},{key:"setBtnCheckLoading",value:function(e,t){var n=this.videoWidth/1024||1;if(t>-1){document.getElementById("pc-quickReply-back-item-".concat(t));var i=document.getElementById("pc-quickReply-back-item-box-".concat(t)),o=document.getElementById("pc-quickReply-name-".concat(t));if(1==e){var a=document.getElementById("pc-quickReply-icon-loading-".concat(t));a&&o&&i.removeChild(a)}else if(o){var r=document.createElement("span");r.id="pc-quickReply-icon-loading-".concat(t),r.style="vertical-align: middle;margin-right:".concat(16*n,"px;"),r.innerHTML='<svg width="'.concat(30*n,'" height="').concat(30*n,'" 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>'),i.insertBefore(r,o)}}}},{key:"getQuickReplyList",value:function(){var e=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);et(this.jSPlugin,(function(t){if(t&&200==t.code){var n=t.data||[],i=[];t.data.forEach((function(e,t){i=e.voiceName.split("_"),n[t].voiceName=i[1]})),e.quickReplyList=n,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,n=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 i=document.createElement("div");i.id="pc-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",i.innerHTML='<div class="" style="heigth:'.concat(40*n,'px">\n <svg width="').concat(40*n,'" height="').concat(40*n,'" 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*n,"px;margin-top:").concat(10*n,"px;line-height:").concat(36*n,'px;">加载中…</div>'),document.getElementById("pc-quickReply-loading").appendChild(i)}}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 o=document.createElement("div");o.id="pc-quickReply-loaderror-box",o.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",o.innerHTML='<div style="font-size: '.concat(28*n,'px;color: rgba(255,255,255,0.90);">快速回复加载失败</div>\n <div id="pc-quickReply-loaderror-reload" style="font-size: ').concat(24*n,"px;margin-top:").concat(16*n,'px;color: rgba(100,143,252,0.90);cursor: pointer;">重新加载</div>'),document.getElementById("pc-quickReply-loaderror").appendChild(o),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 n=this;this.sendLoadingStats=!0,this.setBtnCheckLoading(0,t);tt(this.jSPlugin,e.fileUrl,(function(e){n.sendLoadingStats=!1,n.setBtnCheckLoading(1,t),e&&200==e.code?n.toastCustom.initToastContent("快捷回复成功"):n.toastCustom.initToastContent("快捷回复失败,请重试"),n.switchFooter("onBell")}),(function(e){console.log(e),n.sendLoadingStats=!1,n.setBtnCheckLoading(1,t),n.toastCustom.initToastContent("快捷回复失败,请重试"),n.switchFooter("onBell")}))}}])}(),it=function(){return p((function e(t,n){u(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.switchFooter=n,this.toastCustom=new Xe(t,!1),this.lockStatus=!1,this.initRemoteUnlock()}),[{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,n=document.createElement("div");n.style="width:100%;",n.id="pc-remoteUnlock-box",n.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(n),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"),n=document.createElement("div");n.id="pc-remoteUnlock-content-slide",n.style="width: 100%;display: flex;justify-content: center;cursor: pointer;",n.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(n),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)),n=this.getOffsetLeft(t),i=document.getElementById("pc-remoteUnlock-slide-box"),o=document.getElementById("pc-remoteUnlock-slide-bgColor"),a=document.getElementById("pc-remoteUnlock-slide-tips"),r=document.getElementById("pc-remoteUnlock-slide-ball"),s=this;r.onmousedown=function(t){var c=(t=t||window.event).offsetX;r.style.transition="",o.style.transition="",document.onmouseup=function(){console.log("--------------onmouseup"),s.lockStatus||(o.style.width="0px",r.style.left=8*e+"px",r.style.transition="left 0.6s linear",o.style.transition="width 0.6s linear"),document.onmouseup=null,document.onmousemove=null},document.onmousemove=function(t){t=t||window.event;console.log("videoDom",n);var l=t.pageX-i.offsetLeft-c-n,d=i.clientWidth-r.clientWidth-8*e;l<=0&&(l=0),l>=d&&(l=d),r.style.left=l+"px",l!=d||s.lockStatus||s.lockStatus||(s.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",o.style.width=i.clientWidth+"px",o.style.backgroundColor="#598FFF",i.style.border="0",r.style.backgroundColor="#ffffff",a.textContent="正在开锁",r.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("下发远程开锁");$e(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()}}])}(),ot={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#ffffff",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}};function at(e){var t=new ne,n=new FormData;for(var i in e)n.append(i,e[i]);return t.fetch("/api/lapp/device/info",{method:"POST",body:n})}var rt=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},st=function(){return p((function e(t,n,i,o){var a=this;u(this,e),f(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",a.autoPlayRing)})),f(this,"muteCommon",(function(e){var t=a.decoderState.state,n=t.talk,i=t.sound;n?(console.log("结束对讲"),a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),a.jSPlugin.Talk.stopTalk(),i||a.jSPlugin.openSound()):(a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),i||a.jSPlugin.openSound())})),f(this,"switchCallStatus",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=a.themeData,i=n.header,o=n.footer,r=null;if("onCall"==e){console.log("接听"),a.bellStatus="onCall",a.switchFooter("onCall"),o[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderFooter(e.iconId,e),"mute"==e.iconId&&(r=e)})),i[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderHeader(e.iconId,e)}));var s=document.getElementById("".concat(a.jSPlugin.id,"-header-onBell"));s&&s.parentElement.removeChild(s),1==a.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(a.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==a.themeData.customConfig.defaultMicro&&r?a.muteCommon(r):a.setDecoderState({mute:!1},r.backgroundColor),a.removeBellRing()}else console.log("响铃"),a.bellStatus="onBell",a.jSPlugin.Theme.changeTheme(a.themeData,t)})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,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 Xe(t,!1)}),[{key:"initBellRing",value:function(){var e=this,t=this.decoderState.state,n=t.play,i=t.isEditing;t.rejection;var o=this.videoWidth/1024;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var a=document.getElementById("bellring"),r=document.getElementById("bellring-audio");if(!a&&!r){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||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var c=(this.videoHeight-180*o)/2,l=document.createElement("div");l.id="bellring-icon",l.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(c,"px;display: flex;align-items: center;justify-content: center;"),l.innerHTML='<div style="width: '.concat(180*o,"px;height: ").concat(180*o,'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*o,"px;height: ").concat(100*o,'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*o,'px" height="').concat(40*o,'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(l),n&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var t=e.decoderState.state,n=t.isEditing,i=t.rejection;"onBell"!=e.bellStatus||i||(e.removeBellRing(),n||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 n=this,i=this.themeData,o=i.header,a=i.footer,r=this.decoderState.state,s=r.mute,c=r.rejection,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===o[this.bellStatus].btnList.findIndex((function(t){return t.iconId===e}))?(l.color=a[this.bellStatus].color,l.backgroundColor=a[this.bellStatus].backgroundColor,l.activeColor=a[this.bellStatus].activeColor):(l.color=o[this.bellStatus].color,l.backgroundColor=o[this.bellStatus].backgroundColor,l.activeColor=o[this.bellStatus].activeColor);var d=this.videoWidth/6;this.videoWidth;var u=this.videoWidth/1024||1;switch(e){case"ringStatus":return l.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,l.id=e,l.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>"),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=e,l.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>"),l.onclick=function(){},l;case"callStatus":return l.title="通话中",l.id=e,l.domString='<span id="header-onCall-ringStatus" style="color:'.concat(t.color||"#FFFFFF",";font-size: ").concat(32*u,'px;display: block;text-align: left;" >通话中</span>'),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=e,l.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>"),l.onclick=function(){},l;case"rejection":return l.title="拒绝",l.id=e,l.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(c?"#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>'),l.onclick=function(){var e=n.decoderState.state,t=e.play,i=e.isEditing,o=e.rejection;if(i||o)return!1;console.log("拒绝"),t&&n.jSPlugin.stop(),n.removeBellRing(),n.setDecoderState({play:!1,rejection:!0}),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("rejection")},l;case"quickReply":return l.title="快捷回复",l.id=e,l.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(c?"#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>'),l.onclick=function(){if(n.decoderState.state.rejection)return!1;console.log("快捷回复"),n.switchFooter("quickReply"),n.quickReplyEle=new nt(n.jSPlugin,n.switchFooter)},l;case"answer":return l.title="接听",l.id=e,l.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(c?"#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>'),l.onclick=function(){var e=n,i=n.decoderState.state,r=i.play,s=i.isEditing,c=i.talk,l=i.sound,d=i.rejection;if(s||d)return!1;console.log("接听"),n.jSPlugin.pluginStatus.loadingClear(),r||(n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),n.jSPlugin.play(),n.setDecoderState({play:!r})),c||1!=n.themeData.customConfig.defaultMicro||(n.setDecoderState({talk:!0,mute:!1}),l&&n.jSPlugin.closeSound(),n.jSPlugin.Talk.startTalk()),n.setDecoderState({sound:!1}),n.bellStatus="onCall",n.switchFooter("onCall"),a[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderFooter(e.iconId,e)})),o[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderHeader(e.iconId,e)}));var u=document.getElementById("".concat(n.jSPlugin.id,"-header-onBell"));u&&u.parentElement.removeChild(u),1==n.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),n.jSPlugin.setPoster("")),0==n.themeData.customConfig.defaultMicro&&(n.muteCommon(t),n.jSPlugin.openSound()),n.removeBellRing(),n.maxTalkTime=1e3*n.themeData.customConfig.maxTalkTime*60,setTimeout((function(){c&&(console.log("结束对讲"),e.setDecoderState({talk:!1}),e.jSPlugin.Talk.stopTalk()),r&&(e.jSPlugin.stop(),e.setDecoderState({play:!r})),n.rejectionStatusDispose(),n.remoteUnlockEle&&n.remoteUnlockEle.goback(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp")}),n.maxTalkTime)},l;case"remoteUnlock":return l.title="远程开锁",l.id=e,l.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(c?"#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>'),l.onclick=function(){var e=n.decoderState.state,t=e.isEditing,i=e.rejection;if(t||"onBell"==n.bellStatus||i)return!1;console.log("远程开锁"),n.switchFooter("remoteUnlock"),n.remoteUnlockEle=new it(n.jSPlugin,n.switchFooter)},l;case"mute":return l.title="静音",l.id=e,l.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(c?"#CCCCCC":t.backgroundColor,";background: ").concat(c&&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":c?"#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>'),l.onclick=function(){var e=n.decoderState.state,i=e.talk,o=e.sound;if(e.play,e.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),n.setDecoderState({talk:!1,mute:!0},t.backgroundColor),n.jSPlugin.Talk.stopTalk(),n.jSPlugin.openSound()):(console.log("开始对讲"),n.setDecoderState({talk:!0,mute:!1},t.backgroundColor),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),n.jSPlugin.Talk.startTalk())},l;case"hangUp":return l.title="挂断",l.id=e,l.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(c?"#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>'),l.onclick=function(){var e=n.decoderState.state,t=e.talk,i=e.play,o=e.sound;if(e.rejection)return!1;t&&(console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk()),i&&(n.jSPlugin.stop(),n.setDecoderState({play:!i})),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),(i||t)&&(console.log("挂断"),n.removeBellRing(),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp"))},l;default:return l}}},{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,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(n.innerHTML="",n.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),o.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,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));"onBell"==this.bellStatus?(n.innerHTML="",n.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){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 n=this,i=this.videoWidth/1024||1,o=this.matchBtn(e,t);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var a=document.createElement("span");a.innerHTML="".concat(o.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;padding-top: ').concat(32*i,'px;";>\n ').concat(o.domString,"\n </span>"),r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(r)}}},{key:"renderFooter",value:function(e,t){var n=this,i=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 o=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(o.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-content" title="').concat(o.title,'" style="display: flex;align-items: center;position:relative;">')).concat(o.domString,"</div>")+"</span>",r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},o.onmouseenter&&(r.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseenter(e)}),o.onmouseleave&&(r.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseleave(e)});var s=this.videoWidth/597,c=document.createElement("span");c.className="icon-move left",c.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.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>'),c.onclick=function(){n.editIcon(o.id,"left","footer")},r.appendChild(c);var l=document.createElement("span");if(l.className="icon-move right",l.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.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*a,"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>'),l.onclick=function(){n.editIcon(o.id,"right","footer")},r.appendChild(l),"answer"==e||"rejection"==e||"hangUp"==e);else{var d=document.createElement("span");d.className="icon-move close",d.innerHTML='<span id="'.concat(o.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: ').concat(-15*s-1,"px;left: ").concat(20*s+.5*a-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(){n.editIcon(o.id,"delete","footer")},r.appendChild(d)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(r):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r),this.decoderState.state.isEditing&&"mute"==e&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?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,n=this.themeData,i=n.header,a=n.footer,r=this.jSPlugin.id,s=this.videoWidth/1024;if(this.isNeedRenderHeader=o(i[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=o(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 c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),c.setAttribute("class","header-controls"),c.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",d={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%)"};c.style=rt(d),document.getElementById("".concat(r,"-wrap")).insertBefore(c,document.getElementById(r));var u=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(u)}),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 m=.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(m,"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 p={"min-height":m+"px","max-height":m+"px",position:"relative","margin-top":"-"+m+"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*s+"px"};h.style=rt(p),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 '),A(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=i[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color,i[this.bellStatus].btnList.map((function(t,n){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,n){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 g=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(g),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,n=this.themeData,i=n.header,o=n.footer;if(this.isNeedRenderHeader&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.setDecoderState(f({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&o)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=o[this.bellStatus].color.replace("-diy",""),o[this.bellStatus].btnList.map((function(n,i){if(n.isrender&&e.setDecoderState(f({},n.iconId,e.decoderState.state[n.iconId])),0==i&&!e.themeInited&&e.activeThemeStatus)var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),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"===R(this.jSPlugin.url).type,rec:"rec"===R(this.jSPlugin.url).type,type:R(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!t?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),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,n){console.log("编辑组件",e,t,n);var i=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n][this.bellStatus].btnList,r=o(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":a[r].isrender=0;break;case"right":for(var c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),i[n][this.bellStatus].btnList=a,this.jSPlugin.Theme.changeTheme(i)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<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(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){console.log("----------editStart2");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.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")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(e){var t=this;He(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=ot,t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}},{key:"getCallDeviceInfo",value:function(){var e=this;this.videoWidth,at({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:R(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>"))}}])}(),ct=function(){return p((function e(t,n,i){u(this,e),this.jSPlugin=t,this.videoWidth=i,this.switchFooter=n,this.toastCustom=new Xe(t,!0),this.sendLoadingStats=!1,this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.popupCustom=new Z(t,366),document.getElementById("mobile-quickReply-list")||(this.popupCustom.initPopupContent("快捷回复",this.renderQuickReply()),this.initQuickReply())}),[{key:"initQuickReply",value:function(){document.getElementById("mobile-quickReply-list-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){document.documentElement.clientWidth;var 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,n=document.getElementById("mobile-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,o){var a=document.createElement("div");a.id="mobile-quickReply-list-item-".concat(o),a.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;"),a.innerHTML='\n <svg id="mobile-quickReply-icon-'.concat(o,'" 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(o,'" style="padding-left: 5px;">').concat(i.voiceName,"</span>"),a.onclick=function(){console.log("item:"+i),e.sendLoadingStats||(e.setBtnCheckStatus(o),e.sendQuickReply(i))},n.appendChild(a)}))}},{key:"setBtnCheckStatus",value:function(e){var t=this,n="";this.quickReplyList.forEach((function(i,o){n=document.getElementById("mobile-quickReply-list-item-".concat(o)),o==e?(n.style.background="#F4F6FC",n.style.color="#648FFC",t.setBtnCheckLoding(0,o)):(n.style.background="#ffffff",n.style.color="#2c2c2c")}))}},{key:"setBtnCheckLoding",value:function(e,t){console.log(t);var n=this.videoWidth/375||1;if(t>-1){var i=document.getElementById("mobile-quickReply-list-item-".concat(t)),o=document.getElementById("mobile-quickReply-name-".concat(t)),a=document.getElementById("mobile-quickReply-icon-".concat(t));if(1==e){if(document.getElementById("mobile-quickReply-icon-loading-".concat(t))&&o){var r=document.createElement("span");r.id="mobile-quickReply-icon-".concat(t),r.style="height:".concat(24*n,"px;"),r.innerHTML='\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>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 '),i.insertBefore(r,o)}}else if(a&&o){i.removeChild(a);var s=document.createElement("span");s.id="mobile-quickReply-icon-loading-".concat(t),s.style="height:".concat(20*n,"px;width: ").concat(24*n,"px;"),s.innerHTML='<svg width="'.concat(20*n,'" height="').concat(20*n,'" 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>'),i.insertBefore(s,o)}}}},{key:"getQuickReplyList",value:function(){var e=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);et(this.jSPlugin,(function(t){if(t&&200==t.code){var n=t.data||[],i=[];t.data.forEach((function(e,t){i=e.voiceName.split("_"),n[t].voiceName=i[1]})),e.quickReplyList=n,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,n=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 i=document.createElement("div");i.id="mobile-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: row;",i.innerHTML='<div class="" style="heigth:'.concat(20*n,'px">\n <svg width="').concat(20*n,'" height="').concat(20*n,'" 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*n,"px;margin-left:",10,'px;color:#666666;">正在加载,请稍候</div>'),document.getElementById("mobile-quickReply-loading").appendChild(i)}}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 o=document.createElement("div");o.id="mobile-quickReply-loaderror-box",o.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",o.innerHTML='<div style="">\n <img style="width:'.concat(186*n,"px;height:").concat(120*n,'px;" src="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPZ34KAAStrAAA0pZ5cGTw167.png" />\n </div>\n <div style="font-size: ').concat(16*n,'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(o),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;tt(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()}}])}(),lt=function(){return p((function e(t,n,i){u(this,e),this.jSPlugin=t,this.videoWidth=i,this.switchFooter=n,this.toastCustom=new Xe(t,!0),this.lockStatus=!1,this.popupCustom=new Z(t,265),this.popupCustom.initPopupContent("远程开锁",this.renderRemoteUnlock()),this.renderRemoteUnlockSlide()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("mobile-remoteUnlock-content")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var 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"),n=document.createElement("div");n.id="mobile-remoteUnlock-content-slide",n.style="width: 100%;display: flex;justify-content: center;padding: 0 ".concat(15*e,"px"),n.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(n),this.madeSlideEvent()}},{key:"madeSlideEvent",value:function(){var e=this.videoWidth/375||1,t=document.getElementById("mobile-remoteUnlock-slide-box"),n=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),o=document.getElementById("mobile-remoteUnlock-slide-ball"),a=this;o.ontouchstart=function(r){console.log("ontouchstart");var s=(r=r||window.event).touches[0].pageX;o.style.transition="",n.style.transition="",document.ontouchmove=function(r){var c=(r=r||window.event).touches[0].pageX-t.offsetLeft-s,l=t.clientWidth-o.clientWidth-8*e;c<=0&&(c=0),c>=l&&(c=l),o.style.left=c+"px",c!=l||a.lockStatus||(a.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",n.style.width=t.clientWidth+"px",n.style.backgroundColor="#598FFF",t.style.border="0",o.style.backgroundColor="#ffffff",i.textContent="正在开锁",i.style.color="#ffffff",o.ontouchstart=null,a.sendRemoteUnlockApi())},document.ontouchend=function(){a.lockStatus||(n.style.width="0px",o.style.left=8*e+"px",o.style.transition="left 0.6s linear",n.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"),n=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),o=document.getElementById("mobile-remoteUnlock-slide-ball");n.style.width="0px",o.style.left=8*e+"px",i.textContent="右滑开锁",i.style.color="#666666",document.getElementById("slide-ball-start").style.display="inline",document.getElementById("slide-ball-end").style.display="none",n.style.backgroundColor="#FFFFFF",t.style.border="1px solid rgba(255,255,255,1)",o.style.backgroundColor="#598FFF"}},{key:"sendRemoteUnlockApi",value:function(){var e=this;console.log("下发远程开锁");$e(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()}}])}(),dt={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"}]}}},ut=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},mt=function(){return p((function e(t,n,i,o){var a=this;u(this,e),f(this,"switchCallStatus",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=a.themeData,i=n.header,o=n.footer,r=null;if("onCall"==e){console.log("接听"),a.bellStatus="onCall",a.switchFooter("onCall"),o[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderFooter(e.iconId,e),"mute"==e.iconId&&(r=e)})),i[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderHeader(e.iconId,e)}));var s=document.getElementById("".concat(a.jSPlugin.id,"-header-onBell"));s&&s.parentElement.removeChild(s),1==a.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(a.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==a.themeData.customConfig.defaultMicro&&r?a.muteCommon(r):a.setDecoderState({mute:!1},r.backgroundColor),a.removeBellRing(),a.miniRecCloseClick()}else console.log("响铃"),a.bellStatus="onBell",a.jSPlugin.Theme.changeTheme(a.themeData,t)})),f(this,"muteCommon",(function(e){var t=a.decoderState.state,n=t.talk,i=t.sound;n?(console.log("结束对讲"),a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),a.jSPlugin.Talk.stopTalk(),i||a.jSPlugin.openSound()):(a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),i||a.jSPlugin.openSound())})),f(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()),a.checkIsAppleDevice()||!1?window.removeEventListener("touchstart",a.autoPlayRing):window.removeEventListener("click",a.autoPlayRing)})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,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 Xe(t,!0)}),[{key:"initBellRing",value:function(){var e=this,t=this.decoderState.state,n=t.play,i=t.isEditing,o=this.videoWidth,a=o/375;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var r=document.getElementById("bellring"),s=document.getElementById("bellring-audio");if(!r&&!s){if(this.jSPlugin.isNeedBellRing){var c=document.createElement("div");c.id="bellring",c.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(c)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var l=1.8*o,d=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(d=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*l+6);var u=d+(this.videoHeight-130*a)/2,m=document.createElement("div");m.id="bellring-icon",m.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;"),m.innerHTML='<div style="width: '.concat(130*a,"px;height: ").concat(130*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(80*a,"px;height: ").concat(80*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(m),n&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var t=e.decoderState.state,n=t.isEditing,i=t.rejection;"onBell"!=e.bellStatus||i||(e.removeBellRing(),n||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,n=new Date(e-1e4).Format("yyyyMMddhhmmss"),i=new Date(t).Format("yyyyMMddhhmmss");this.recUrl="".concat(this.recUrl,"?begin=").concat(n,"&end=").concat(i),console.log("recurl="+this.recUrl)}}},{key:"initMiniRec",value:function(){var e=this,t=this,n=this.videoWidth,i=n/375,o=1.8*n,a=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(a=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*o+6);var r=a+this.videoHeight+10*i;if(console.log(a),document.getElementById("miniRecbox"))document.getElementById("miniRecbox")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")),document.getElementById("miniClose")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),this.initMiniRec();else{var s=document.createElement("div");s.id="miniRecbox",s.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;top: ".concat(r,"px;right: ").concat(9*i,"px;"),s.innerHTML='<div id="miniRec"></div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s),this.getMiniCallTimeUrl();var c={domain:K};this.miniRecPlayer=new Ft({id:"miniRec",width:160*i,height:90*i,template:"miniRec",url:this.recUrl,token:this.jSPlugin.token,handleError:function(n){console.log("小窗口handleError------------",n),n&&6701==n.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||c});var l=document.createElement("div");l.id="miniClose",l.style="position: absolute;top: ".concat(r+8,"px;right: ").concat(16*i,"px;"),l.innerHTML='<div id="miniClose-btn" style="width: '.concat(24*i,"px;height: ").concat(24*i,'px;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: rgba(0,0,0,0.1);">\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>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(l),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 n=t+this.videoHeight+10*e;if(document.getElementById("miniRecbox"))document.getElementById("miniRecbox").style.top=n+"px",document.getElementById("miniClose").style.top=n+8+"px";else{var i=document.createElement("div");i.id="miniRecbox",i.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;\n top: ".concat(n,"px;\n right: ").concat(9*e,"px;\n user-select: none;\n "),i.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(i);var o=document.createElement("div");o.id="miniClose",o.style="z-index: 4;position: absolute;top: ".concat(n+8,"px;right: ").concat(16*e,"px;"),o.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(o),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,n=t/375,i=1.8*t,o=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(o=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*i+6),console.log("headerHeight-------",o);var a=o+this.videoHeight+10*n;if(console.log("videoTop-------",a),"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*n,90*n);var r=this.videoHeight+10*n,s=.2*i-90*n-10*n;document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginTop=r+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft=t-160*n-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=o+"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*n+"px",document.getElementById("miniRec-embed").style.height=90*n+"px",document.getElementById("miniRec").style.width=160*n+"px",document.getElementById("miniRec").style.height=90*n+"px"):this.miniRecPlayer.reSize(160*n,90*n),this.jSPlugin.reSize(this.videoWidth,this.videoHeight),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+NaN,document.getElementById("".concat(this.jSPlugin.id)).style.marginTop="0",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft="0",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="0px",document.getElementById("miniRecbox").style.top=a+"px",document.getElementById("miniRecbox").style.right="9px",document.getElementById("miniRecbox").style.left="auto",document.getElementById("miniRecbox").style.borderRadius="8px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=.2*i+"px"}},{key:"matchBtn",value:function(e,t){var n=this,i=this.themeData,o=i.header,a=i.footer,r=this.decoderState.state,s=r.mute,c=r.rejection;document.documentElement.clientHeight;var l=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===o[this.bellStatus].btnList.findIndex((function(t){return t.iconId===e}))?(u.color=a[this.bellStatus].color,u.backgroundColor=a[this.bellStatus].backgroundColor,u.activeColor=a[this.bellStatus].activeColor):(u.color=o[this.bellStatus].color,u.backgroundColor=o[this.bellStatus].backgroundColor,u.activeColor=o[this.bellStatus].activeColor);var m=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*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'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*m,'px;user-select: none;">拒绝</div>\n </div>'),u.onclick=function(){var e=n,t=n.decoderState.state,i=t.play,o=t.isEditing,a=t.rejection;if(o||a)return!1;console.log("拒绝"),i&&n.jSPlugin.stop(),n.removeBellRing(),n.setDecoderState({play:!1,rejection:!0}),e.miniRecCloseClick(),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.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*l,"px;height: ").concat(40*l,"px;color:").concat(c?"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*l,'px" height="').concat(24*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="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(c?"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=n.decoderState.state,t=e.isEditing,i=e.rejection;if(t||i)return!1;console.log("快捷回复"),n.switchFooter("quickReply"),n.quickReplyEle=new ct(n.jSPlugin,n.switchFooter,n.videoWidth)},u;case"answer":return u.title="接听",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'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*m,'px;user-select: none;">接听</div>\n </div>'),u.onclick=function(){var e=n,i=n.decoderState.state,r=i.play,s=i.isEditing,c=i.talk,l=i.sound,d=i.rejection;if(s||d)return!1;console.log("接听"),n.jSPlugin.pluginStatus.loadingClear(),n.bellStatus="onCall",n.switchFooter("onCall"),a[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderFooter(e.iconId,e)})),o[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderHeader(e.iconId,e)}));var u=document.getElementById("".concat(n.jSPlugin.id,"-header-onBell"));u&&u.parentElement.removeChild(u),1==n.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),n.jSPlugin.setPoster("")),n.removeBellRing(),n.miniRecCloseClick(),r||(n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),n.jSPlugin.play(),n.setDecoderState({play:!r})),c||1!=n.themeData.customConfig.defaultMicro||(n.setDecoderState({talk:!0,mute:!1}),l&&n.jSPlugin.closeSound(),n.jSPlugin.Talk.startTalk()),n.setDecoderState({sound:!1}),0==n.themeData.customConfig.defaultMicro&&(n.muteCommon(t),n.jSPlugin.openSound()),n.maxTalkTime=1e3*n.themeData.customConfig.maxTalkTime*60,setTimeout((function(){c&&(console.log("结束对讲"),e.setDecoderState({talk:!1}),e.jSPlugin.Talk.stopTalk()),r&&(e.jSPlugin.stop(),e.setDecoderState({play:!r})),n.rejectionStatusDispose(),n.remoteUnlockEle&&n.remoteUnlockEle.closeRemoteUnlock(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp")}),n.maxTalkTime)},u;case"remoteUnlock":return u.title="远程开锁",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'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*m,'px;user-select: none;">远程开锁</div>\n </div>'),u.onclick=function(){var e=n.decoderState.state,t=e.isEditing;e.play;var i=e.rejection;if(t||"onBell"==n.bellStatus||i)return!1;console.log("远程开锁"),n.switchFooter("remoteUnlock"),n.remoteUnlockEle=new lt(n.jSPlugin,n.switchFooter,n.videoWidth)},u;case"mute":return u.title="静音",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div id="').concat(this.jSPlugin.id,'-icon-mute" style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;border: 1px solid ").concat(c?"#cccccc":t.backgroundColor,";background: ").concat(c&&s?"#cccccc":"#ffffff",';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'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":c?"#cccccc":t.backgroundColor,'"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">静音</div>\n </div>'),u.onclick=function(){var e=n.decoderState.state,i=e.talk,o=e.sound;if(e.play,e.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),n.setDecoderState({talk:!1,mute:!0},t.backgroundColor),n.jSPlugin.Talk.stopTalk(),n.jSPlugin.openSound()):(console.log("开始对讲"),n.setDecoderState({talk:!0,mute:!1},t.backgroundColor),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),n.jSPlugin.Talk.startTalk())},u;case"hangUp":return u.title="挂断",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'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*m,'px;user-select: none;">挂断</div>\n </div>'),u.onclick=function(){var e=n,t=n.decoderState.state,i=t.talk,o=t.play;if(t.rejection)return!1;i&&(console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk()),o&&(n.jSPlugin.stop(),n.setDecoderState({play:!o})),(o||i)&&(e.miniRecCloseClick(),console.log("挂断"),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.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,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")),a=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(n.innerHTML="",o.innerHTML="",n.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),a.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,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn"));"onBell"==this.bellStatus?(n.innerHTML="",o.innerHTML="",n.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){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 n=this,i=this.matchBtn(e,t);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var o=document.createElement("span");o.innerHTML="".concat(i.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(o)}else{var a=document.createElement("div");a.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),a.style="max-width:50%;position:relative;",a.innerHTML='<span id="'.concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,'-content" style="display:inline-block;height:auto;";>\n ').concat(i.domString,"\n </span>"),a.onclick=function(e){if(n.decoderState.state.isEditing)return!1;i.onclick(e)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(a)}}},{key:"renderFooter",value:function(e,t){var n=this,i=this.decoderState.state.mute;if("remoteUnlock"==e&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var o=this.matchBtn(e,t),a=this.videoWidth/4,r=document.createElement("div");if(r.className="theme-icon-item","quickReply"!==o.id&&(r.style="width:".concat(.66*a,"px;padding:0 ").concat(.12*a,"px;box-sizing: content-box;-webkit-tap-highlight-color:transparent;")),r.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-content" title="').concat(o.title,'" style="display: flex;align-items: center;position:relative;">')).concat(o.domString,"</div>")+"</span>",r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},o.onmouseenter&&(r.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseenter(e)}),o.onmouseleave&&(r.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseleave(e)}),"quickReply"!=e){var s=document.createElement("span");s.className="icon-move left",s.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.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(){n.editIcon(o.id,"left","footer")},r.appendChild(s);var c=document.createElement("span");c.className="icon-move right",c.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.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>'),c.onclick=function(){n.editIcon(o.id,"right","footer")},r.appendChild(c)}if("answer"==e||"rejection"==e||"hangUp"==e);else{var l=document.createElement("span");l.className="icon-move close",l.innerHTML='<span id="'.concat(o.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>'),l.onclick=function(){n.editIcon(o.id,"delete","footer")},r.appendChild(l)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(r):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r),"quickReply"===o.id&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).appendChild(r)),this.decoderState.state.isEditing&&"mute"==e&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?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,n=t.header,i=t.footer,a=this.decoderState.state.isEditing,r=this.videoWidth,s=r/375,c=1.8*r,l=this.jSPlugin.id;if(this.isNeedRenderHeader=o(n[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=o(i[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=f(f({display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":.1*c+"px","align-items":"center","text-align":"center","font-size":"24ox"},"color","#2c2c2c"),"margin-top","6px");d.style=ut(u),document.getElementById("".concat(l,"-wrap")).insertBefore(d,document.getElementById(l));var m=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(m)}),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*c,"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*s,"px;margin-bottom: ").concat(40*s,"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*s,"px;margin-bottom: ").concat(40*s,"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 h=document.createElement("div");h.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),h.setAttribute("class","ez-iframe-footer-container");var p={position:"relative","margin-top":.2*c+"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"};h.style=ut(p),h.innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*s,"px;margin-bottom: ").concat(40*s,"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 '),A(h,document.getElementById(l))}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"))&&n[this.bellStatus].btnList.map((function(t,n){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=i[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i[this.bellStatus].color,i[this.bellStatus].btnList.map((function(t,n){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 g=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(g),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/),n=e.indexOf("iPad")>-1,i=e.indexOf("iPhone")>-1||e.indexOf("Mac")>-1;return!!(t||n||i)}},{key:"renderThemeData",value:function(){var e=this,t=this.themeData,n=t.header,i=t.footer,o=this.decoderState.state.isEditing;if(this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n[this.bellStatus].color.replace("-diy",""),n[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.setDecoderState(f({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&i)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(t,n){if(t.isrender&&e.setDecoderState(f({},t.iconId,e.decoderState.state[t.iconId])),console.log("-------------activeThemeStatus"),0==n&&!e.themeInited&&e.activeThemeStatus)var i=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(i),1!=e.themeData.customConfig.bellPoster||o?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"===R(this.jSPlugin.url).type,rec:"rec"===R(this.jSPlugin.url).type,type:R(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!o?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.jSPlugin.reSize(e.jSPlugin.params.width,e.jSPlugin.params.height))}),50);o||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,n){console.log("编辑组件",e,t,n);var i=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n][this.bellStatus].btnList,r=o(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":a[r].isrender=0;break;case"right":for(var c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),i[n][this.bellStatus].btnList=a,this.jSPlugin.Theme.changeTheme(i)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<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(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){console.log("----------editStart1");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.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")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),i&&i.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:He(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=dt,t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}}},{key:"getCallDeviceInfo",value:function(){var e=this;this.videoWidth,at({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:R(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>"))}}])}(),ht=function(){return p((function e(t){if(u(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"===R(t.url).type,rec:"rec"===R(t.url).type,type:R(t.url).type}},console.log("matchEzopenUrl(jSPlugin.url)",R(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 mt(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState):this.call=new st(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 Ce(this.jSPlugin)),C("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),C("".concat(this.jSPlugin.staticPath,"/css/theme.css"))}),[{key:"changeTheme",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=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"===T(e)&&(this.themeData=e,this.call.setThemeData(e,n),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 n=this,i=this.themeData;i.header,i.footer,Object.keys(e).map((function(i){if("mute"===i)document.getElementById("".concat(n.jSPlugin.id,"-icon-mute"))&&(console.log("mute"),e[i]?(document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.background=t,document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.border=" 1px solid ".concat(t),document.getElementById("icon-mute-path").style.fill="#ffffff"):(document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.background="#ffffff",document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.border="1px solid ".concat(t),document.getElementById("icon-mute-path").style.fill=t));n.decoderState.state=Object.assign(n.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,n){console.log("编辑组件",e,t,n);var i=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n].btnList,r=o(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":if("rec"===e){if(-1===o(a,(function(e){return"cloudRec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===e&&-1===o(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 c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),i[n].btnList=a,this.changeTheme(i)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<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(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));i&&i.setAttribute("class","header-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));n&&n.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;at({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:R(this.jSPlugin.url).deviceSerial}).then((function(n){200==n.code&&n.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(n.data.category,"</span>"))})).catch((function(e){console.log("获取设备信息失败",e)}))}}])}(),pt=function(){return p((function e(t){u(this,e),this.jSPlugin=t;var n=window["EZUIKIT_TIMER_INTERVAL_".concat(t.id)];n&&Object.keys(n).length>0&&this.resetTimer(),window["EZUIKIT_TIMER_INTERVAL_".concat(t.id)]={}}),[{key:"createInterval",value:function(e,t,n){window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)][e]=setInterval(t,n)}},{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]}}])}(),gt=p((function e(t){var n=this;u(this,e),f(this,"initMap",(function(){var e=n,t=n.videoWidth,i=n.videoHeight;if(document.getElementById("".concat(n.jSPlugin.id,"-miniRecbox")))document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-miniRecbox"))),n.initMap();else{var o=document.createElement("div");o.id="".concat(n.jSPlugin.id,"-miniRecbox"),o.style=";position: absolute; bottom:96px;right:".concat(n.jSPlugin.inspectVideoWidth,"px;"),o.innerHTML='<div id="'.concat(n.jSPlugin.id,'-mapbox" style="\n width: ').concat(.3333*t,"px;\n height: ").concat(.3333*i,'px;\n "></div>'),document.getElementById("".concat(n.jSPlugin.id,"-wrap")).insertBefore(o,document.getElementById("".concat(n.jSPlugin.id,"-ez-iframe-footer-container"))),e.map=e.loadMap("".concat(n.jSPlugin.id,"-mapbox"))}return e.map})),f(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})),f(this,"createCircle",(function(e,t,i,o){var a=new BMapGL.Point(e,t),r=new BMapGL.Marker(a,{title:o});if(n.map.addOverlay(r),0!=i){var s=new BMapGL.Circle(new BMapGL.Point(e,t),i,{strokeColor:"#ff4d4f",strokeWeight:4,strokeOpacity:1,strokeStyle:"dashed",fillOpacity:0});n.map.addOverlay(s)}})),f(this,"createInspectPoints",(function(e){e.map((function(e){n.createCircle(e.longitude,e.latitude,e.radius,e.inspectPointName)}))})),f(this,"createPolygon",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#407AFF",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"solid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"407AFF",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=[];e.split(";").map((function(e){var t=e.split(",");c.push(new BMapGL.Point(t[0],t[1]))})),n.inspectRange=new BMapGL.Polygon(c,{strokeColor:t,strokeWeight:o,strokeOpacity:a,strokeStyle:i,fillOpacity:s,fillColor:r}),n.map.addOverlay(n.inspectRange)})),f(this,"createTrack",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#18C796",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"solid",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=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],m=[];if(e.map((function(e){var t=!1;n.currentTrack.length>0&&n.currentTrack.map((function(n){n.longitude===e.longitude&&n.latitude===e.latitude&&n.reportTime===e.reportTime&&(t=!0)})),t||(0==m.length&&n.currentTrack.length>0&&m.push(new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude)),m.push(new BMapGL.Point(e.longitude,e.latitude)))})),0!=m.length){var h=new BMapGL.Polyline(m,{strokeColor:i,strokeWeight:a,strokeOpacity:r,strokeStyle:o,fillOpacity:s});if(t?(n.map.addOverlay(h),n.map.centerAndZoom(m[m.length-1],15)):(n.trackAni=new BMapGLLib.TrackAnimation(n.map,h,{overallView:u,tilt:c,duration:l,delay:d}),n.trackAni.start()),n.currentTrack=e,n.currentTrack.length>0&&n.currentTrack.length>0){var p=new BMapGL.Point(n.currentTrack[0].longitude,n.currentTrack[0].latitude);if(n.startPoint=new BMapGL.Marker(p,{icon:new BMapGL.Icon("".concat(n.jSPlugin.staticPath,"/imgs/start.png"),new BMapGL.Size(32,47)),offset:new BMapGL.Size(0,-17)}),n.map.addOverlay(n.startPoint),1==n.currentTrack.length)return;var g=new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude);n.endPoint&&n.map.removeOverlay(n.endPoint),setTimeout((function(){n.endPoint=new BMapGL.Marker(g,{icon:new BMapGL.Icon("".concat(n.jSPlugin.staticPath,"/imgs/end.png"),new BMapGL.Size(30,30))}),n.map.addOverlay(n.endPoint)}),t?0:l)}}})),f(this,"centerToTrack",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;n.currentTrack.length>0&&(1==n.currentTrack.length?n.map.centerAndZoom(new BMapGL.Point(n.currentTrack[0].longitude,n.currentTrack[0].latitude),e):n.map.centerAndZoom(new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude),e))})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.toastCustom=new Xe(t,!1),this.currentTrack=[],this.startPoint=null,this.endPoint=null,this.trackAni=null,this.inspectRange=null,this.map=this.initMap()})),ft=p((function e(t){var n=this;u(this,e),f(this,"init",(function(){var e=n;if(n.videoWidth,n.videoHeight,document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")))document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box"))&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box"))),e.init();else{var t=document.createElement("div");t.id="".concat(n.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(n.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(n.jSPlugin.id,"-wrap")).appendChild(t)}})),f(this,"deviceErrorInfo",(function(e,t){var i=Object.assign({tips:"",refreshBtn:"",refreshShow:!1},e);if(document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box")))document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box"))&&document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box"))),n.deviceErrorInfo(e,t);else{n.videoHeight;var o=document.createElement("div");o.id="".concat(n.jSPlugin.id,"-no-inspect-box"),o.style="width:100%;height:100%; background: #ffffff; display: flex; justify-content: center; align-items: center",o.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(i.tips,'</div>\n <button id="').concat(n.jSPlugin.id,'-inspect-device-status-refresh" style="display: ').concat(i.refreshShow?"block":"none",'; width: 80px; margin: 0 auto;" type="button" class="ezuikit-btn ezuikit-btn-primary"><span>').concat(i.refreshBtn,"</span></button>\n </div>\n "),document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")).appendChild(o),document.getElementById("".concat(n.jSPlugin.id,"-inspect-device-status-refresh")).addEventListener("click",(function(){t&&t()}))}})),f(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 Xe(t,!1),this.init()})),vt=function(){return p((function e(t){u(this,e),this.timer=null;var n={wrapNode:document.body,time:2e3,content:"",type:"info",center:!1,top:8};this.params=y(y({},n),t),this.init()}),[{key:"init",value:function(){var e=this;this.timer=null;var t=this.params,n=t.wrapNode,i=t.content,o=t.time,a=t.type,r=t.center,s=t.top;this.wrapNode=n;var c=document.createElement("div");c.setAttribute("class","ezuikit-message"),r?c.setAttribute("style","top: 50%; transform: translateY(-50%);"):c.setAttribute("style","top: ".concat(s||0,"px;")),this.wrapNode.appendChild(c),this.initMessageContent(a,i,c),0!==o&&(this.timer=setTimeout((function(){e.wrapNode.removeChild(c)}),o||2e3))}},{key:"initMessageContent",value:function(e,t,n){var i=document.createElement("div");i.setAttribute("class","ezuikit-message-notice"),i.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"),n.appendChild(i)}}])}(),yt=function(){return p((function e(t){u(this,e),this.params=y(y({},{id:"",width:"100%",height:"100%",preview:!0,showIcon:!0,src:"",alt:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png"}),t),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var e=this.params,t=e.id,n=e.width,i=e.height,o=e.preview;if(document.getElementById(t)){var a=document.createElement("div");a.setAttribute("class","ezuikit-image"),a.setAttribute("style","width:".concat(n,";height:").concat(i,";")),document.getElementById(t).appendChild(a),this.initImage(a),o&&this.initPreview(a)}}},{key:"previewImg",value:function(){var e=this.params,t=e.src,n=e.alt,i=e.fallback,o=document.createElement("div");o.setAttribute("id",this.id+"-preview"),o.setAttribute("class","ezuikit-image-preview"),o.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 a=document.createElement("img");a.setAttribute("class","ezuikit-image-preview-img"),a.setAttribute("alt",n),a.setAttribute("src",t),a.addEventListener("error",(function(){a.setAttribute("src",i)})),document.body.appendChild(o),o.querySelector(".ezuikit-image-preview-img-main").appendChild(a),document.getElementById(this.id+"-ezuikit-image-preview-operations").addEventListener("click",(function(){document.body.removeChild(o)}))}},{key:"initImage",value:function(e){var t=this.params,n=t.src,i=t.alt,o=t.fallback,a=document.createElement("img");a.setAttribute("class","ezuikit-image-img"),a.setAttribute("alt",i),a.setAttribute("src",n),a.addEventListener("error",(function(){a.setAttribute("src",o)})),e.appendChild(a)}},{key:"initPreview",value:function(e){var t=this,n=this.params.showIcon,i=document.createElement("div");i.setAttribute("class","ezuikit-image-mask"),n&&(i.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(i),e.onclick=function(){t.previewImg()}}}])}(),St=function(){return p((function e(t){u(this,e),this.params=y(y({},{id:"",parentNodeId:"",title:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),t),this.initState=!1,this.init(t)}),[{key:"init",value:function(){var e=this,t=this.params,n=t.id,i=t.content,o=t.placement,a=t.title,r=document.getElementById(n);if(r){var s=document.createElement("div");if(s.setAttribute("id",n+"-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(a?'<div class="ezuikit-popover-title">'.concat(a,"</div>"):"",'\n\t\t\t\t\t\t<div class="ezuikit-popover-inner-content">').concat(i,"</div>\n\t\t\t\t\t</div>\n\t\t\t\t"),!document.getElementById(n+"-popover")){var c=document.body;this.params.parentNodeId&&(c=document.getElementById(this.params.parentNodeId)),c.appendChild(s),this.renderPopover(s,r,o)}document.body.addEventListener("click",(function(t){e.addEventListenerFn(t)}))}}},{key:"addEventListenerFn",value:function(e){var t=this.params.id,n=document.getElementById(t),i=document.getElementById(t+"-popover");n&&e.target!==n&&!n.contains(e.target)&&i&&e.target!==i&&!i.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,n,i,o){e.style.display="block";var a=t.getBoundingClientRect(),r=a.top,s=a.left,c=a.width,l=a.height,d=e.getBoundingClientRect(),u=d.width,m=d.height;i&&(u=i),o&&(m=o);var h=document.body;this.params.parentNodeId&&(h=document.getElementById(this.params.parentNodeId));var p=this.params.arrowPointAtCenter,g=0,f=0,v=e.getElementsByClassName("ezuikit-popover-arrow")[0],y=v.getBoundingClientRect(),S=y.width,_=y.height;if(p){var b=0,w=0;switch(n){case"top":default:b=u/2,w=m;break;case"bottom":b=u/2,w=0;break;case"left":b=u,w=m/2;break;case"right":b=0,w=m/2;break;case"topLeft":b=(c-S)/2,w=m;break;case"topRight":b=u-(c+S)/2,w=m;break;case"bottomLeft":b=(c-S)/2,w=0;break;case"bottomRight":b=u-(c+S)/2,w=0;break;case"leftTop":b=u,w=(l-_)/2;break;case"leftBottom":b=u,w=m-(l+_)/2;break;case"rightTop":b=0,w=(l-10)/2;break;case"rightBottom":b=0,w=m-(l+_)/2}v.style.left=b+"px",v.style.top=w+"px"}switch(n){case"top":g=-(m+_),f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top");break;case"bottom":g=l-_/2,f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottom");break;case"left":g=(l-m)/2,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-left");break;case"right":g=(l-m)/2,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-right");break;case"topLeft":g=-(m+_),f=0,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topLeft");break;case"topRight":g=-(m+_),f=c-u,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topRight");break;case"bottomLeft":g=l-_/2,f=0,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomLeft");break;case"bottomRight":g=l-_/2,f=c-u,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomRight");break;case"leftTop":g=0,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftTop");break;case"leftBottom":g=l-m,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftBottom");break;case"rightTop":g=0,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightTop");break;case"rightBottom":g=l-m,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightBottom");break;default:g=-m,f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top")}var T=document.documentElement.scrollTop||document.body.scrollTop,E=document.documentElement.scrollLeft||document.body.scrollLeft;e.style.top=r+T+g+"px",e.style.left=s+E+f+"px";var P=e.getBoundingClientRect(),k=h===document.body?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:h.getBoundingClientRect(),C=n;P.left<k.left&&(C=(C=C.replace("Right","Left")).replace("right","left")),P.right>k.right&&(C=(C=C.replace("Left","Right")).replace("left","right")),P.top<k.top&&(C=(C=C.replace("Top","Bottom")).replace("top","bottom")),P.bottom>k.bottom&&(C=(C=C.replace("Bottom","Top")).replace("bottom","top")),C!==n&&this.renderPopover(e,t,C,u,m)}}])}(),_t=function(){return p((function e(t){u(this,e),this.params=y(y({},{id:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),t),this.PopconfirmDom=null,this.init(t)}),[{key:"init",value:function(){var e=this,t=this.params,n=t.content,i=t.cancelText,o=t.okText,a=t.onCancel,r=t.onConfirm,s=document.createElement("div");s.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=i;var l=document.createElement("button");return l.className="ezuikit-btn ezuikit-ok-btn ezuikit-btn-primary",l.innerText=o,s.querySelector(".ezuikit-popover-buttons").appendChild(c),s.querySelector(".ezuikit-popover-buttons").appendChild(l),this.PopconfirmDom=new St(y(y({},this.params),{},{content:s.innerHTML})),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn").onclick=function(){a?a():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(){r?r():e.hide()}),this.PopconfirmDom}},{key:"hide",value:function(){this.PopconfirmDom.hidePopover()}}])}(),bt=function(){return p((function e(t){u(this,e),this.params=y(y({},{id:"",width:"100%",height:"100%",preview:!0,poster:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png",src:""}),t),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var e=this.params,t=e.id,n=e.width,i=e.height,o=e.preview;if(document.getElementById(t)){var a=document.createElement("div");a.setAttribute("class","ezuikit-video"),a.setAttribute("style","width:".concat(n,";height:").concat(i,";")),document.getElementById(t).appendChild(a),this.initVideo(a),o&&this.initPreview(a)}}},{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,n=t.poster,i=t.fallback,o=document.createElement("img");o.setAttribute("class","ezuikit-video-img"),o.setAttribute("src",n),o.addEventListener("error",(function(){o.setAttribute("src",i)})),e.appendChild(o)}},{key:"initPreview",value:function(e){var t=this,n=document.createElement("div");n.setAttribute("class","ezuikit-video-mask"),n.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(n),e.onclick=function(){t.previewVideo()}}}])}(),wt=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:t,page:0},a="".concat(e.env.domain,"/api/service/devicekit/bodycamera/device/trace");Qe(a,"GET",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},Tt=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:R(e.url).deviceSerial,validateCode:R(e.url).validCode,channelNo:R(e.url).channelNo,evidenceFileType:t},a="".concat(e.env.domain,"/api/service/devicekit/common/file/evidence");Qe(a,"POST",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},Et=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,taskId:t},a="".concat(e.env.domain,"/api/service/devicekit/opencloud/task/info");Qe(a,"GET",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})};var Pt=function(){return p((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};u(this,e),this.jSPlugin=t,this.currentEventInfo=n,this.inspectInfo=t.Theme.inspect.inspectInfo,this.type=o,this.timer=i,this.startTime=1e3,this.videoRecordingStatus=!0,this.saveSuccessCallback=a,this.init()}),[{key:"init",value:function(){this.renderEventDetail(),this.eventDetailDomEvent()}},{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap show")}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).innerHTML=""}},{key:"validationEventTag",value:function(){return 0==document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).value.length?(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="block",document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).innerHTML="请输入事件标签",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input input-has-error"),!1):(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input"),!0)}},{key:"renderVideo",value:function(e,t,n){var i=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 o=this.currentEventInfo.evidenceId;this.timer.clearTimer("videoRecordingStatusTimer"),this.timer.createInterval("videoRecordingStatusTimer",(function(){Et(i.jSPlugin,o,(function(e){if(e.meta&&200===e.meta.code){var t=e.data,n=t.taskStatus,o=t.fileUrl,a=t.videoCoverPic||"".concat(i.jSPlugin.staticPath,"/imgs/bg.svg");i.renderVideo(n,a,o)}}))}),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 bt({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview"),poster:t,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),src:n}),this.timer.clearTimer("videoRecordingStatusTimer"))}},{key:"renderEventDetail",value:function(){var e=this,t=this.currentEventInfo,n=t.evidenceFileType,i=t.fileUrl,o=t.taskStatus,a=t.videoCoverPic,r=document.createElement("div");r.setAttribute("class","inspectEventDetail");var s="";if(s=1===n?a||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"):i||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),r.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===n?"图片存证":"视频存证",'</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===n?'<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(r),1===this.type?document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(1===n?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===n?" ~ -":""),1===n&&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,n,i,o;e.startTime&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-time")).innerHTML=(t=e.startTime,n=parseInt(t%864e5/36e5),i=parseInt(t%36e5/6e4),o=parseInt(t%6e4/1e3),(n<10?"0".concat(n):n)+":"+(i<10?"0".concat(i):i)+":"+(o<10?"0".concat(o):o))),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===n){var c=this.currentEventInfo&&this.currentEventInfo.fileUrl;this.renderVideo(o,s,c)}else new yt({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,n=t.evidenceFileType,i=t.evidenceId;document.getElementById("".concat(this.jSPlugin.id,"-event-cancel")).addEventListener("click",(function(t){e.cancelPopover=new _t({id:"".concat(e.jSPlugin.id,"-event-cancel"),content:"确定要取消吗?".concat(1===e.type?"取消后编辑的内容将不会保存。":"取消后对应存证也将删除。"),placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){e.cancelPopover.hide()},onConfirm:function(){1===n&&(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,n=t.evidenceFileType,i=t.evidenceId,o=e.inspectInfo,a=o.inspectRecordId,r=o.inspectPerson,s=document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML,c={inspectRecordId:a,depositaryOfficer:r,evidenceFileId:i,evidenceFileType:n,eventType:document.getElementById("".concat(e.jSPlugin.id,"-event-tag")).value,eventRemark:document.getElementById("".concat(e.jSPlugin.id,"-event-remark")).value};1===n&&(c.eventBeginTime=s.split("~")[0].trim(),c.eventEndTime=s.split("~")[1].trim(),e.timer.clearTimer("videoRecordingStatusTimer")),0===n&&(c.eventTime=s),1===e.type&&(c.inspectEventId=e.currentEventInfo.inspectEventId,delete c.depositaryOfficer,delete c.eventTime,delete c.eventBeginTime,delete c.eventEndTime,delete c.evidenceFileId,delete c.evidenceFileType,function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:"",inspectEventId:"",eventType:"",eventRemark:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/update");Qe(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,c,(function(t){t.meta&&200===t.meta.code?(e.hide(),e.saveSuccessCallback&&e.saveSuccessCallback({eventType:c.eventType,eventRemark:c.eventRemark})):new vt({type:"error",content:"保存失败,".concat(t.meta&&t.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new vt({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))),0===e.type&&function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:"",eventType:"",evidenceFileId:"",eventTime:"",eventBeginTime:"",eventEndTime:"",depositaryOfficer:"",eventRemark:"",evidenceFileType:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event");Qe(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,c,(function(t){t.meta&&200===t.meta.code?(e.hide(),e.saveSuccessCallback&&e.saveSuccessCallback()):new vt({type:"error",content:"保存失败,".concat(t.meta&&t.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new vt({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 _t({id:"".concat(e.jSPlugin.id,"-inspectEventDetail-back"),content:"确定要返回吗?".concat(1===e.type?"返回后编辑的内容将不会保存。":"返回后对应存证也将删除。"),placement:"bottomRight",arrowPointAtCenter:!0,onCancel:function(){e.backPopover.hide()},onConfirm:function(){1===n&&(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,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,taskId:t},a="".concat(e.env.domain,"/api/v3/open/cloud/video/frame/stop");Qe(a,"POST",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,i,(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?Et(e.jSPlugin,i,(function(t){if(t.meta&&200===t.meta.code){var n=t.data,i=n.taskStatus,o=n.fileUrl,a=n.videoCoverPic;e.timer&&e.timer.clearTimer("videoRecordingTimer");var r=a||"".concat(e.jSPlugin.staticPath,"/imgs/bg.svg");e.renderVideo(i,r,o),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 vt({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 vt({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")}))}}])}(),kt=function(){return p((function e(t,n,i){var o=this;u(this,e),f(this,"hideDelEConfirm",(function(){for(var e=0;e<o.delEConfirmList.length;e++)o.delEConfirmList[e].hide()})),f(this,"initRender",(function(){var e=o;if(document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")))document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box"))&&document.getElementById("".concat(o.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box"))),e.initRender();else{var t=document.createElement("div");t.id="".concat(o.jSPlugin.id,"-inspect-event-box"),t.setAttribute("class","inspect-event-box");var n=0;document.getElementById("".concat(o.jSPlugin.id,"-inspectInfoControl"))&&(n=document.getElementById("".concat(o.jSPlugin.id,"-inspectInfoControl")).clientHeight),t.style="background: #fff;position: absolute;right: 0;bottom: 0; top:".concat(n,"px;"),t.innerHTML='\n <div id="'.concat(o.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(o.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(o.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(o.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(o.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(o.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(o.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(o.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(o.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(o.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(o.jSPlugin.id,'-inspect-event-list-wrap-main"></div>\n <div id="').concat(o.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(o.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(o.jSPlugin.id,'-inspect-event-detail-box"></div>\n </div>\n '),document.getElementById("".concat(o.jSPlugin.id,"-wrap")).appendChild(t),o.jSPlugin.Theme.decoderState.state.play?o.enableEvidenceBtn():o.disableEvidenceBtn(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).onclick=function(){o.listLoading||o.startEvidence||(o.startEvidence=!0,o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",Tt(o.jSPlugin,0,(function(e){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",e.meta&&200===e.meta.code?new Pt(o.jSPlugin,e.data,o.timer,0,(function(){o.initEvent(),new vt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})):new vt({type:"error",content:"图片存证失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new vt({type:"error",content:"图片存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).onclick=function(){o.listLoading||o.startEvidence||(o.startEvidence=!0,o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",Tt(o.jSPlugin,1,(function(e){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",e.meta&&200===e.meta.code?new Pt(o.jSPlugin,e.data,o.timer,0,(function(){o.initEvent(),new vt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})):new vt({type:"error",content:"视频存证失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new vt({type:"error",content:"视频存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-refresh")).onclick=function(){o.listLoading||o.startEvidence||(o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-loading")).style.display="block",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none",e.initEvent())}}})),f(this,"renderList",(function(e){document.getElementById("".concat(o.jSPlugin.id,"-inspect-loading")).style.display="none";var t=e.data||[];if(t.length>0){document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="block",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none";for(var n=function(){var n=document.createElement("div");n.setAttribute("class","inspect-event-item");var a=t[i];n.setAttribute("id","".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)),n.innerHTML="",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap-main")).appendChild(n);var r,s=document.createElement("div");s.setAttribute("class","inspect-event-item-header-wrap"),1==a.evidenceFileType&&(r="".concat(a.eventBeginTime.split(" ")[1],"~").concat(a.eventEndTime.split(" ")[1])),0==a.evidenceFileType&&(r="".concat(a.eventTime.split(" ")[1]));var c="";1===a.evidenceFileType&&(1===a.taskStatus||2===a.taskStatus?c="storage":4===a.taskStatus||5===a.taskStatus||6===a.taskStatus||7===a.taskStatus?c="storage-error":0!==a.taskStatus&&3!==a.taskStatus||(c="storage-success")),s.innerHTML='\n <div class="inspect-event-item-header '.concat(c,'">\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===a.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===a.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(r||"-",'</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 '),n.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",n.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",n.querySelector(".inspect-event-item-body").style.display="none")};var l=document.createElement("div");l.setAttribute("class","inspect-event-item-body"),l.style.display="none";var d=(1===a.evidenceFileType?a.videoCoverPic:a.fileUrl)||"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg");l.innerHTML='\n <div class="inspect-event-item-img" id="'.concat(o.jSPlugin.id,"-inspect-view-").concat(a.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(a.eventType,'">').concat(a.eventType,"</span>\n </div>\n </div>\n "),n.appendChild(l),1==a.evidenceFileType&&(1===a.taskStatus||2===a.taskStatus?document.getElementById("".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId)).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap" style="background:url('.concat(o.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===a.taskStatus?document.getElementById("".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId)).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap video-stroage-exceptional-status-tips-error" style="background:url('.concat(o.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!==a.taskStatus&&3!==a.taskStatus||new bt({id:"".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId),src:a.fileUrl,poster:d,fallback:"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg")})),0==a.evidenceFileType&&new yt({id:"".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId),src:d,fallback:"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg"),showIcon:!1});var u=document.createElement("div");u.setAttribute("class","inspect-event-item-body-info-opr");var m=document.createElement("span");m.setAttribute("class","inspect-event-item-body-info-opr-icon"),m.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(m);var h=document.createElement("span");h.setAttribute("class","inspect-event-item-body-info-opr-icon"),h.id="".concat(o.jSPlugin.id,"-inspect-event-del-").concat(a.inspectEventId),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="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(h),m.onclick=function(e){o.startEvidence||new Pt(o.jSPlugin,a,o.timer,1,(function(e){new vt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40}),a=Object.assign(a,e),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").innerHTML=a.eventType,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").setAttribute("title",a.eventType)}))},h.onclick=function(e){o.startEvidence||(o.delE=new _t({id:"".concat(o.jSPlugin.id,"-inspect-event-del-").concat(a.inspectEventId),content:"确定要删除该事件吗?",placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){o.delE.hide()},onConfirm:function(){!function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectEventId:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/delete");Qe(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(o.jSPlugin,{inspectEventId:a.inspectEventId},(function(e){e.meta&&200===e.meta.code?(o.delE.hide(),o.initEvent(),setTimeout((function(){new vt({type:"success",content:"删除成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),10)):new vt({type:"error",content:"删除失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new vt({type:"error",content:"删除失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}))}}),o.delEConfirmList.push(o.delE))},n.querySelector(".inspect-event-item-body-info").appendChild(u),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).onscroll=function(t){var n=t.target;o.hideDelEConfirm(),n.scrollTop+n.offsetHeight>=n.scrollHeight-48&&!o.listLoading&&(e.start+1)*e.size<e.total&&o.initEvent(e.start+1)}},i=0;i<t.length;i++)n()}else document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="block"})),this.jSPlugin=t,this.videoWidth=t.width,this.inspectRecordId=n,this.timer=i,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()}),[{key:"initEvent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,i=this;i.listLoading=!0,0===t?i.initRender(t):document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="flex";var o=function(t){new vt({type:"error",content:t.meta&&t.meta.message||"列表获取失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40}),i.renderList({})};i.inspectRecordId?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,r={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:t,pageStart:n,pageSize:i},s="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/page");Qe(s,"GET",r,(function(e){o&&o(e)}),(function(e){a&&a(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(i.jSPlugin,i.inspectRecordId,t,n,(function(t){i.listLoading=!1,document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",t.meta&&200===t.meta.code?i.renderList(t.data||{}):o(t)}),(function(t){i.listLoading=!1,document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",o(t)})):(i.listLoading=!1,document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",i.renderList({}))}},{key:"disableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).setAttribute("disabled","disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).setAttribute("disabled","disabled")}},{key:"enableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).removeAttribute("disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).removeAttribute("disabled")}}])}(),Ct=function(){return p((function e(t,n,i,o,r){var s=this;u(this,e),f(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 n=document.createElement("div");return n.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;",n.id="".concat(e.jSPlugin.id,"-location-btn"),n.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>',n.onclick=function(t){setTimeout((function(){e.inspectMapWin.centerToTrack(18)}),100)},t.getContainer().appendChild(n),n},new t})),f(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(){a((function(){return s.miniRecSwitchClick()}),1e3)()}})),f(this,"initMiniWinToggleBtn",(function(){var e=.3333*s.videoWidth,t=.3333*s.videoHeight,n=document.createElement("div");n.id="".concat(s.jSPlugin.id,"-miniToggle"),n.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;"),n.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(n),document.getElementById("".concat(s.jSPlugin.id,"-miniToggle")).onclick=function(){s.miniWinToggleClick()}})),f(this,"init",(function(){s.initSwithcBtn(),s.initMiniWinToggleBtn()})),f(this,"setStyleListByIds",(function(e){e.map((function(e){var t=document.getElementById(e.id);t&&Object.keys(e.styleList).map((function(n){t.style[n]=e.styleList[n]}))}))})),this.jSPlugin=t,this.inspectMode=n,this.inspectMapWin=i,this.changeInspectMode=o,this.videoWidth=t.width,this.videoHeight=t.height,this.minWinStatus="open",this.decoderState=r,this.ZoomControl=new BMapGL.ZoomControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(40,50)}),this.LocationControl=this.createLocationControl(),this.NavigationControl3D=new BMapGL.NavigationControl3D({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(28,105)}),this.init()}),[{key:"miniWinToggleClick",value:function(){var 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,n=.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,n),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:n+"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"}}])}}])}(),It={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0,inspectInfo:{color:"#000000",backgroundColor:"#ffffff",activeColor:"#1890FF",btnList:[{btnKey:"inspectName",iconId:"inspectName",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectBeginTime",iconId:"inspectBeginTime",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectPerson",iconId:"inspectPerson",part:"right",defaultActive:0,isrender:1,color:"#262626"}]}},header:{color:"#2c2c2c",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"deviceName",iconId:"deviceName",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"inspectTime",iconId:"inspectTime",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"signalType",iconId:"signalType",part:"right",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"batteryStatus",iconId:"batteryStatus",part:"right",defaultActive:0,isrender:1,color:"#ffffff"}]},footer:{color:"#ffffff",backgroundColor:"#000000",activeColor:"blue",btnList:[{btnKey:"talk",iconId:"talk",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"},{btnKey:"sound",iconId:"sound",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"}]}},xt=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t};var jt=500,At=function(){return p((function e(t,n,i,o,a,r,s){u(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,this.isNeedRenderInspectInfo=!1,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.inspectMode=a,this.changeInspectMode=r,this.themeInited=!1,this.inspectRecordId=null,this.inspectInfo={},this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.globalContainer=new ft(this.jSPlugin),this.toastCustom=new Xe(t,!1),this.InspectEvent=null,this.timer=s}),[{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,n,i,o,a=e.split(" "),r=a[0].split("-"),s=a[1].split(":"),c=new Date(r[0],r[1]-1,r[2],s[0],s[1],s[2]),l=(new Date).getTime()-new Date(c).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=l,n=parseInt(t%864e5/36e5),i=parseInt(t%36e5/6e4),o=parseInt(t%6e4/1e3),(n<10?"0".concat(n):n)+":"+(i<10?"0".concat(i):i)+":"+(o<10?"0".concat(o):o)),"\n ")}},{key:"matchBtn",value:function(e,t){var n=this,i=this.themeData,a=i.customConfig,r=i.header,s=i.footer,c=a.inspectInfo,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}},d=c.btnList.findIndex((function(t){return t.iconId===e}));switch(-1!==d?(l.color=c.color,l.backgroundColor=c.backgroundColor,l.activeColor=c.activeColor):-1!==(d=r.btnList.findIndex((function(t){return t.iconId===e})))?(l.color=r.color,l.backgroundColor=r.backgroundColor,l.activeColor=r.activeColor):(l.color=s.color,l.backgroundColor=s.backgroundColor,l.activeColor=s.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>jt?48:32,'" height="').concat(this.jSPlugin.width>jt?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=n.decoderState.state,t=e.talk,i=e.sound;if(e.play)if(t){console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk();var a=o(n.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;n.themeData&&a&&n.jSPlugin.openSound()}else console.log("开始对讲"),n.setDecoderState({talk:!0}),n.jSPlugin.Talk.startTalk((function(e){i&&!e&&(n.jSPlugin.closeSound(),n.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>jt?48:32,'" height="').concat(this.jSPlugin.width>jt?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>jt?48:32,'" height="').concat(this.jSPlugin.width>jt?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=n.decoderState.state,t=e.play,i=e.sound,o=e.talk;t&&!o&&(i?(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})):n.jSPlugin.openSound())},l;default:return l}}},{key:"renderInspectInfo",value:function(e,t){var n=this.matchBtn(e,t),i=document.createElement("sapn");i.innerHTML="".concat(n.domString),"left"===t.part?document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-right")).appendChild(i)}},{key:"renderHeader",value:function(e,t){var n=this.matchBtn(e,t),i=document.createElement("span");i.className="".concat(this.jSPlugin.id,"-header-content"),i.style="display: flex; align-items: center; ",i.innerHTML="\n ".concat(n.domString,"\n "),"left"===t.part?document.getElementById("".concat(this.jSPlugin.id,"-headControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).appendChild(i)}},{key:"renderFooter",value:function(e,t){var n=this,i=this.matchBtn(e,t),o=this.videoWidth/6,a=document.createElement("div");a.className="theme-icon-item",this.jSPlugin.isWebConsole?a.style="padding:0 ".concat(.1*o,"px;"):a.style="padding:0 ".concat(.1*o,"px;cursor: pointer;"),a.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(i.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(i.id,'-content" title="').concat(i.title,'" style="display: flex;align-items: center;position:relative;">')).concat(i.domString,"</div>")+"</span>",a.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onclick(e)},i.onmouseenter&&(a.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onmouseenter(e)}),i.onmouseleave&&(a.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onmouseleave(e)}),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(a)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,n=t.customConfig,i=t.header,a=t.footer,r=n.inspectInfo,s=this.jSPlugin.id;if(this.isNeedRenderInspectInfo=o(r.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader=o(i.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=o(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 c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-inspectInfoControl")),c.setAttribute("class","inspectInfo-controls"),c.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"};c.style=xt(l),document.getElementById("".concat(s,"-wrap")).insertBefore(c,document.getElementById(this.jSPlugin.id));var d=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(d)}),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 u=document.createElement("div");u.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),u.setAttribute("class","header-controls"),u.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 m={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"};u.style=xt(m),document.getElementById("".concat(s,"-wrap")).insertBefore(u,document.getElementById(s));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 p=document.createElement("div");p.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),p.setAttribute("class","ez-iframe-footer-container");var g={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"};p.style=xt(g),p.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 "),A(p,document.getElementById(s))}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,n){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=i.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i.color,i.btnList.map((function(t,n){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,n){t.isrender&&e.renderFooter(t.iconId,t)}))),this.inspectMapWin=new gt(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,n=this.themeData,i=n.inspectInfo,o=n.header,a=n.footer;if(this.isNeedRenderInspectInfo&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=i.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=i.color.replace("-diy",""),i.btnList.map((function(t,n){t.isrender&&e.setDecoderState(f({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderHeader&&o&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=o.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=o.color.replace("-diy",""),o.btnList&&o.btnList.map((function(t,n){t.isrender&&e.setDecoderState(f({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&a)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a.color.replace("-diy",""),a.btnList.map((function(n,i){if(n.isrender&&e.setDecoderState(f({},n.iconId,e.decoderState.state[n.iconId])),0==i&&!e.themeInited&&e.activeThemeStatus)var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),1!=e.themeData.customConfig.bellPoster||t?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),this.setDecoderState({cloudRec:"cloud.rec"===R(this.jSPlugin.url).type,rec:"rec"===R(this.jSPlugin.url).type,type:R(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 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 Ne(this.jSPlugin)),this.getInspectDevInfo(this.jSPlugin,!0,!1)}},{key:"getInspectRecord",value:function(){var e=this;!function(e,t,n){var i={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:R(e.url).deviceSerial},o="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/detail/latest");Qe(o,"GET",i,(function(e){t&&t(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(this.jSPlugin,(function(t){if(200==t.meta.code&&t.data){var n=t.data;n.inspectRange&&e.inspectMapWin.createPolygon(n.inspectRange,"#407AFF","dashed",4,1,"#407AFF",.08),n.inspectPoints&&n.inspectPoints.length>0&&e.inspectMapWin.createInspectPoints(n.inspectPoints),"video"===e.inspectMode&&e.inspectMapWin.map.removeOverlay(e.inspectMapWin.inspectRange),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectName"))&&n.inspectName&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectName")).innerText=""+n.inspectName),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectBeginTime"))&&n.beginTime&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectBeginTime")).innerText="巡检开始时间:"+n.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(n.beginTime)}),1e3),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectPerson"))&&n.inspectPerson&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectPerson")).innerText="本地巡检员:"+n.inspectPerson),e.inspectInfo=n,n.inspectRecordId&&wt(e.jSPlugin,n.inspectRecordId,(function(t){200==t.meta.code&&t.data&&(e.inspectMapWin.createTrack(t.data,!0),e.timer.createInterval("TraceTimer",(function(){n.inspectRecordId&&wt(e.jSPlugin,n.inspectRecordId,(function(t){200==t.meta.code&&t.data&&e.inspectMapWin.createTrack(t.data,!1)}),(function(){}))}),5e3))}),(function(){})),e.InspectEvent=new kt(e.jSPlugin,n.inspectRecordId,e.timer)}else e.InspectEvent=new kt(e.jSPlugin,null,e.timer)}),(function(e){}))}},{key:"getInspectDevInfo",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!function(e,t,n){var i={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:R(e.url).deviceSerial},o="".concat(e.env.domain,"/api/service/devicekit/bodycamera");Qe(o,"GET",i,(function(e){t&&t(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e,(function(o){o.meta&&200==o.meta.code&&o.data?1===o.data.status?(i&&!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(o.data.deviceName,"(").concat(o.data.deviceSerial,")"),document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName")).setAttribute("title","".concat(o.data.deviceName,"(").concat(o.data.deviceSerial,")"))),document.getElementById("".concat(t.jSPlugin.id,"-header-signalType"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-signalType")).innerHTML=t.renderSignalType(o.data.signalType)),document.getElementById("".concat(t.jSPlugin.id,"-header-batteryStatus"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-batteryStatus")).innerHTML=t.renderBatteryStatus(o.data.batteryStatus)),t.timer.createInterval("InspectDevInfoTimer",(function(){t.getInspectDevInfo(e,!1,!1)}),3e5),n&&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:o.meta.message,refreshShow:!1}))}),(function(){t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-global-box"),!1)}))}},{key:"fetchThemeData",value:function(e){var t=this;He(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=It,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 n=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)&&(n=2),document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.width=e*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.height=t*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).width=e*n,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).height=t*n,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.width=e*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.height=t*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).height=t*n}}},{key:"reSize",value:function(e,t){var n=.3333*e,i=.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=n+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=i+"px"):(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=t+"px"),this.reSizeVideo(n,i),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=i/2+96-30+"px",document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.right=this.jSPlugin.inspectVideoWidth+n+"px"}}])}(),Dt=function(){return p((function e(t){var n=this;if(u(this,e),f(this,"changeInspectMode",(function(e){n.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,cloudRec:"cloud.rec"===R(t.url).type,rec:"rec"===R(t.url).type,type:R(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=It,"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.timer||(this.timer=new pt(t)),this.jSPlugin.themeId)if(this.isMobile||(this.inspect=new At(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 Ce(this.jSPlugin)),C("".concat(this.jSPlugin.staticPath,"/css/theme.css")),C("".concat(this.jSPlugin.staticPath,"/css/component.css")),C("".concat(this.jSPlugin.staticPath,"/css/inspectTheme.css"))}),[{key:"setDecoderState",value:function(e,t){var n=this,i="#FFFFFF",o="#1890FF";Object.keys(e).map((function(t){switch(t){case"talk":document.getElementById("".concat(n.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(n.jSPlugin.id,"-talk")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[t]?o:i,document.getElementById("".concat(n.jSPlugin.id,"-talk-content")).childNodes[2].style.color=e[t]?o:i);break;case"sound":document.getElementById("".concat(n.jSPlugin.id,"-sound"))&&(e[t]?(document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(n.jSPlugin.id,"-sound")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[t]?o:i,document.getElementById("".concat(n.jSPlugin.id,"-sound-label")).style.color=e[t]?o:i):(document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(n.jSPlugin.id,"-sound")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-sound-label")).style.color=e[t]?o:i))}n.decoderState.state=Object.assign(n.decoderState.state,e)}))}},{key:"setDisabled",value:function(e){var t=this.decoderState.state,n=t.sound;t.hd,null!=document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,n?"-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()}}])}(),Rt=function(){return p((function e(){u(this,e),this.events={}}),[{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 n=this;this.on(e,(function i(){var o=Array.prototype.slice.call(arguments);t.apply(null,o),n.off(e,i)}))}},{key:"removeAllListener",value:function(){this.events={}}}])}();function Lt(e){document.getElementById("".concat(e,"-player"))&&document.getElementById("".concat(e,"-container-0")).removeChild(document.getElementById("".concat(e,"-player")))}var Bt=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:M()?"mobileRec":"pcRec"}:{templateType:"local",templateId:e};if(t&&t.isCall)return{templateType:"invalid",templateId:e}}},Mt=function(){var e=window.navigator.userAgent.toLowerCase(),t=(/version.*safari/.test(e),/chrome/.test(e));/gecko/.test(e)&&/webkit/.test(e);if(M())return!1;if(t){return function(){for(var e=window.navigator.userAgent.split(" "),t="",n=0;n<e.length;n++)/chrome/i.test(e[n])&&(t=e[n]);return!!t&&Number(t.split("/")[1].split(".")[0])}()>91&&!!window.SharedArrayBuffer}return!1};var Ot=function(e){if(console.log("err",e),e&&e.retcode)return String(e.retcode);if(e&&e.code){var t=String(e.code);return"1".concat(t.padStart(5,"0"))}if(e&&e.errorCode){var n=String(e.errorCode);return"39".concat(n.padStart(4,"0"))}return"400001"};function zt(){var e,t={},n=navigator.userAgent.toLowerCase();if((e=n.match(/rv:([\d.]+)\) like gecko/))||(e=n.match(/msie ([\d\.]+)/))?t.ie=e[1]:(e=n.match(/edge\/([\d\.]+)/))?t.edge=e[1]:(e=n.match(/firefox\/([\d\.]+)/))?t.firefox=e[1]:(e=n.match(/(?:opera|opr).([\d\.]+)/))?t.opera=e[1]:(e=n.match(/chrome\/([\d\.]+)/))?t.chrome=e[1]:(e=n.match(/version\/([\d\.]+).*safari/))&&(t.safari=e[1]),t.chrome){var i=t.chrome,o=i.indexOf(".");return Number(i.substring(0,o))}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}function Nt(e){return zt()>=94?(e&&e(!0),!0):(e&&e(!1),!1)}var Ft=function(){function i(o){var a=this;u(this,i),f(this,"_isCloudRecord",!1),f(this,"_controllers",[]),f(this,"_handleRealUrl",(function(e){var t=JSON.parse(localStorage.getItem("ezuikit_addressList"));return Array.isArray(t[a.deviceSerial+"_"+a.channelNo])&&t[a.deviceSerial+"_"+a.channelNo].map((function(t){t.wsUrl=e.replace(/(wss:\/\/)([^\/:]+)(:\d+)/,"$1".concat(t.domain,":").concat(t.port))})),localStorage.setItem("ezuikit_addressList",JSON.stringify(t)),Array.isArray(t[a.deviceSerial+"_"+a.channelNo])&&t[a.deviceSerial+"_"+a.channelNo].length>0?t[a.deviceSerial+"_"+a.channelNo][0].wsUrl:e})),i._instanceStyle(),this.isStoping=!1;var s,c,l=o.autoplay,d=void 0===l||l;if(this.params=o,this.autoplay=d,this.talkChannelNo=o.talkChannelNo||null,this.eventEmitter=new Rt,this.timeZone=0,this.ptzSpeed=o.ptzSpeed||2,this.download=void 0===o.download||o.download,this.downloadRecord=void 0===o.downloadRecord||o.downloadRecord,this.recordRes={},this.disableRenderPrivateData=void 0===o.disableRenderPrivateData||o.disableRenderPrivateData,this.ptzSpeedOptions={slow:1,mid:2,fast:3},window.EZUIKit[o.id]={state:{EZUIKitPlayer:{init:window.EZUIKit[o.id]&&window.EZUIKit[o.id].state&&window.EZUIKit[o.id].state.EZUIKitPlayer.init||!1,themeInit:window.EZUIKit[o.id]&&window.EZUIKit[o.id].state&&window.EZUIKit[o.id].state.EZUIKitPlayer.themeInit||!1,talkInit:window.EZUIKit[o.id]&&window.EZUIKit[o.id].state&&window.EZUIKit[o.id].state.EZUIKitPlayer.talkInit||!1}}},!this.params.id)throw new Error("id param is required!");if(!document.getElementById(this.params.id))throw new Error("#".concat(this.params.id," node does not exist"));this.appKey="test",this.dataReport=!1!==o.dataReport,this.reportHTTP=!0===o.reportHTTP,this.monitorReport=!0,this.dataReport?this.reportHTTP?this.monitorReport=!0:"https:"!==window.location.protocol||(s=window.location.hostname,4===(c=s.split(".").map((function(e){return!Number.isNaN(e)}))).length&&c.every(Boolean))?this.monitorReport=!1:this.monitorReport=!0:this.monitorReport=!1,new ne(this.params.env?this.params.env.domain:null),this.id=o.id,this.width=o.width,this.height=o.height,this.fullScreenWidth=0,this.fullScreenHeight=0,this.isCall=o.isCall||!1,this.isWebConsole=o.isWebConsole||!1,this.callTime=o.callTime||null,this.hangUpCallback=o.hangUpCallback||null,this.isNeedBellRing=!1!==o.isNeedBellRing,this.url=o.url,this.accessToken=o.accessToken,this.deviceSerial=R(o.url).deviceSerial,this.channelNo=R(o.url).channelNo,this.themeId=Bt(o.template,o).templateId,this.themeId=Bt(o.template,o).templateId?Bt(o.template,o).templateId:"simple",this.id=o.id,this.audio=!0,this.audioOnly=!0,this.poster=o.poster,this.speed=1,this.disabledTimeLine=!1,this.disabledPTZ=!1,this.capacity=null,this.playTimer=null,this.env={domain:K},this.isMobile=M(),this.support3DZoom=!1,this.use3DZoom=!1,this.is3DZooming=!1,this.useHardDev=void 0!==o.useHardDev&&o.useHardDev,this.host="open.ys7.com",this._isCloudRecord=o.isCloudRecord,this._spaceId=o.isCloudRecord?j("spaceId",this.url):void 0,this.waterMark_JSPlugin=!1,this.useSeek=o.useSeek,this.dpr=o.dpr||1,this.decoderType=o.decoderType||"auto",this.videoLevelList=[],this.videoLevel=1,this.streamTypeIn=1,this.language=o.language||"zh",this.languageList=o.languageList||["zh","en"],-1===this.languageList.indexOf(this.language)&&(console.warn("语言【".concat(this.language,"】暂不支持,已切换至中文")),this.language="zh"),this.i18n=new t({zh:me,en:he}),this.i18n.switchTranslation(this.language||"zh"),this.token=o.token||{},this.deviceInfo={},this.quality=o.quality,document.getElementById("".concat(this.id))&&void 0===this.initDOM&&(this.initDOM=document.getElementById("".concat(this.id)).cloneNode(!0)),this._isCurrentFullscreen=!1,this._isCurrentBrowserFullscreen=!1,this.isInspect=o.isInspect||!1,this.inspectRecordingDuration=o.inspectRecordingDuration||144e5,this.inspectVideoWidth=o.inspectVideoWidth||290,this.inspectVideoHeight=o.inspectVideoHeight||170,this._FECCorrectType=null,this._FECSplitIds="",this.initSuccessTime=0,this.initTime=0,this.gotWsUrlTime=0,this.startGetWsUrlTime=0,this.appearFirstFrameTime=0,this.openStreamTime=0,this.maxReloadTime=0,this.maxAddressAccount=o.maxAddressAccount||1e3,this.reloadCodeBalckList=o.reloadCodeBalckList||[5402,5406,5411,5507,5546,9048,9049,5451,5558],document.getElementById("".concat(this.id,"-wrap"))&&this.initDOM&&(document.getElementById("".concat(this.id,"-wrap")).parentNode.appendChild(this.initDOM),document.getElementById("".concat(this.id,"-wrap")).parentNode.removeChild(document.getElementById("".concat(this.id,"-wrap"))),delete this.initDOM),this.staticPath="https://openstatic.ys7.com/ezuikit_js/v8.1.6/ezuikit_static";var m,h,p=!this.useHardDev&&Mt()||this.useHardDev&&!Nt()&&(h=!1,!void(zt()>=107&&window.VideoDecoder?VideoDecoder.isConfigSupported({codec:"hvc1.1.6.L123.00",hardwareAcceleration:"prefer-hardware"}).then((function(e){e.supported?(h=!0,m&&m({bSupHardDecHEVC:h})):m&&m({bSupHardDecHEVC:h})})):m&&m({bSupHardDecHEVC:h})))&&Mt()||this.useHardDev&&(Nt()||this.isSupHardDecHEVC()||Mt());this.isV3=p,"string"==typeof o.staticPath&&(o.staticPath.startsWith("http")?this.staticPath=o.staticPath:this.staticPath=e(o.staticPath)),void 0!==o.audio&&(this.audio=o.audio),void 0!==o.audioOnly&&(this.audioOnly=o.audioOnly),void 0!==o.env&&(this.env=Object.assign(this.env,o.env)),void 0!==o.host&&(this.host=o.host),void 0!==o.isMobile&&(this.isMobile=o.isMobile),void 0!==o.disabledTimeLine&&(this.disabledTimeLine=o.disabledTimeLine),void 0!==o.disabledPTZ&&(this.disabledPTZ=o.disabledPTZ);var g=JSON.parse(localStorage.getItem("ezuikit_addressList"))||{},v=Object.keys(g);v.length>this.maxAddressAccount&&v.map((function(e,t){t<v.length&&t>v.length-a.maxAddressAccount||delete g[e]})),g[this.deviceSerial+"_"+this.channelNo]||(g=y(y({},g),{},f({},this.deviceSerial+"_"+this.channelNo,[])),localStorage.setItem("ezuikit_addressList",JSON.stringify(g))),localStorage.getItem("ezuikit_reloadAddressList")&&localStorage.removeItem("ezuikit_reloadAddressList");!function(){var e=a;a.pluginStatus=new H(a,a.id),a.videoInitTime=Date.now(),a.videoPlayState=1,window.monitorExtendsInfo={protocol:"ezopen",url:a.url,serial:a.deviceSerial,no:a.channelNo,env:a.env.domain,type:R(a.url).type};var t=Object.assign({},o);(function(e,t){var n=[];return Object.keys(t).map((function(e){n.push("".concat(e,"=").concat(t[e]))})),fetch(e.env.domain+"/api/service/appKey/get?".concat(n.join("&")),{method:"GET"}).then((function(e){return e.json()})).then((function(e){return e}))})(a,{checkToken:a.accessToken||a.token.deviceToken.video,sn:a.deviceSerial,cno:a.channelNo}).then((function(e){e.data&&(a.appKey=e.data.appKey)})),a._autoSwitchByQuality().finally((function(){a.initEZUIKitPlayer(o).finally((function(){var n=Date.now();We(e,{deviceSerial:e.deviceSerial,localIndex:e.channelNo,accessToken:e.accessToken||e.token.deviceToken.video}).then((function(e){})).finally((function(i){a.autoplay?a._getRealUrlPromise(o.url).then((function(e){var i=Date.now();if(a.monitorReport&&window.ezuikitMonitor.report({action:1,logInfo:{pluginVersion:p?"v3":"v1",params:t},appKey:a.appKey}),e){var r=Date.now();a._pluginPlay(e,(function(){if(1===a.videoPlayState||4===a.videoPlayState){a.videoPlayState=2;var e=Date.now();a.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:a.isV3?"v3":"v1",loadTime:e-a.videoInitTime,loadTimeDesc:{initTime:a.initTime,stopTime:0,getWsTime:i-n,createWsTime:e-r}},appKey:a.appKey,loadTime:e-a.videoInitTime,initTime:a.initTime,getWsTime:i-n,createWsTime:e-r})}a.audio&&setTimeout((function(){a.openSound()}),100)}),(function(e){if(1===a.videoPlayState||4===a.videoPlayState){a.videoPlayState=3;var t=Date.now();a.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:a.isV3?"v3":"v1",loadTime:t-a.videoInitTime,err:e},errorCode:Ot(e),appKey:a.appKey,loadTime:t-a.videoInitTime})}a.Theme&&a.Theme.setDisabled(!0),a.isInspect?(a.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(a.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:e&&e.msg,btnName:a.i18n.t("BTN_RETRY"),type:1}),a.Theme.jSPlugin.Zoom&&a.Theme.jSPlugin.Zoom.stopZoom(),a.Theme&&a.Theme.inspect&&a.Theme.inspect.InspectEvent&&a.Theme.inspect.InspectEvent.disableEvidenceBtn()):a.pluginStatus.loadingSetText({text:e&&e.msg||a.i18n.t("GET_PLAYURL_FAILED"),color:"red"})}))}else console.log("promise of one",e);window.EZUIKit[o.id].state.EZUIKitPlayer.init=!0,document.getElementById("".concat(o.id,"canvas_draw0"))&&(document.getElementById("".concat(o.id,"canvas_draw0")).style.border="none")})).catch((function(t){if(1===e.videoPlayState||4===e.videoPlayState){e.videoPlayState=3;var n=Date.now();e.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:e.isV3?"v3":"v1",loadTime:n-e.videoInitTime,err:t},errorCode:Ot(t),appKey:e.appKey,loadTime:n-e.videoInitTime})}e.Theme&&e.Theme.setDisabled(!0),e.isInspect?(e.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(e.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:t&&t.msg,btnName:e.i18n.t("BTN_RETRY"),type:1}),e.Theme.jSPlugin.Zoom&&e.Theme.jSPlugin.Zoom.stopZoom(),e.Theme&&e.Theme.inspect&&e.Theme.inspect.InspectEvent&&e.Theme.inspect.InspectEvent.disableEvidenceBtn()):e.pluginStatus.loadingSetText({text:t&&t.msg||e.i18n.t("GET_PLAYURL_FAILED"),color:"red"})})):(window.EZUIKit[o.id].state.EZUIKitPlayer.init=!0,document.getElementById("".concat(o.id,"canvas_draw0"))&&(document.getElementById("".concat(o.id,"canvas_draw0")).style.border="none"))}))}))})),a.getDeviceCapacity(),ce.createInstance(a.id,{rejection:!1,play:!1,pantile:!1,recordvideo:!1,talk:!1,expend:!1,webExpend:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1}),a.initSuccessTime=(new Date).getTime(),o.plugin&&-1!==o.plugin.indexOf("talk")&&(a.Talk=new Ce(a),window.EZUIKit[o.id].state.EZUIKitPlayer.talkInit=!0)}(),this.play=r((function(e){return a._play(e)}),500,!0),this.resume=r((function(e){return a._resume(e)}),500,!0),this.changePlayUrl=r((function(e,t,n){return a._changePlayUrl(e,t,n)}),500),window.addEventListener("beforeunload",(function(){console.log("退出页面,停止视频流"),ce.removeInstance(a.id),a.stop()})),this._controllers=[],n.isEnabled&&(this._fullscreenChangeEvent=this._fullscreenChangeEvent.bind(this),n.on("change",this._fullscreenChangeEvent))}return p(i,[{key:"initEZUIKitPlayer",value:function(e){var t=this,n=e.id,i=e.width,o=void 0===i?600:i,a=e.height,r=void 0===a?400:a;if(!e.width||!e.height){var c=document.getElementById(n).getBoundingClientRect();!e.width&&c.width>0&&(o=c.width),!e.height&&c.height>0&&(r=c.height)}if(!document.getElementById("".concat(n,"-wrap"))){var l=document.createElement("div");l.id="".concat(n,"-wrap"),l.style="display:inline-block;width:".concat(o,"px;position:relative;vertical-align: bottom;"),document.getElementById(n).parentNode.insertBefore(l,document.getElementById(n)),document.getElementById(n).parentNode.removeChild(document.getElementById(n)),this.isInspect&&(l.style.height="".concat(r,"px"),this.width-=this.inspectVideoWidth,this.height-=this.inspectVideoHeight,o=this.width,r=this.height),l.innerHTML="<div id=".concat(n,"></div>"),document.getElementById(n).style="display:inline-block;width:".concat(o,"px;height:").concat(r,"px;"),document.getElementById(n).style.verticalAlign="top",this._$containerResizeEvent()}window.recTimer&&Array.isArray(window.recTimer[n])&&(window.recTimer[n].map((function(e){clearInterval(e)})),window.recTimer[n]=[]);var d=new ue(this,n);this.Message=d;var u=new Promise((function(i,a){var c=t;t.randomNum=Math.random(),window.randomNum=t.randomNum;var l=new s({szId:n,iType:2,width:o,height:r,iMaxSplit:1,iCurrentSplit:1,szBasePath:"",staticPath:t.staticPath,isCloudRecord:t._isCloudRecord,downloadRecord:t.downloadRecord,env:t.env,oStyle:{border:"none",background:"#000000"},decoderType:t.params.decoderType,decodeEngine:void 0!==t.params.decodeEngine?t.params.decodeEngine:1,autoPlay:!1,dpr:t.params.dpr,url:t.params.url,debugDownloadData:t.params.debugDownloadData,disableRenderPrivateData:t.disableRenderPrivateData});t.pluginStatus.loadingStart(n),t.isCall||t.isInspect?t.pluginStatus.loadingSetText({text:t.i18n.t("VIDEO_LOADING")}):"miniRec"==t.themeId?t.pluginStatus.loadingSetText({text:""}):t.pluginStatus.loadingSetText({text:t.i18n.t("INIT_FINSHED")});var d=!1;l.EventCallback={openStreamCallback:function(){t.openStreamTime=(new Date).getTime(),d=!1},getStreamHeaderCallback:function(){t.getStreamHeaderTime=(new Date).getTime(),d=!1},getVideoStreamCallback:function(){t.getVideoStreamTime=(new Date).getTime(),t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection&&t.stop((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2})})),t.isInspect&&t.Theme.decoderState.state.play&&("map"!==t.Theme.inspectMode&&t.Theme.jSPlugin.Zoom&&setTimeout((function(){t.Theme.jSPlugin.Zoom.startZoom()}),1e3),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.enableEvidenceBtn())},firstFrameCallback:function(e){switch(e){case 0:t.decodeEngine="v3-soft";break;case 1:t.decodeEngine="v3-hard";break;case 2:t.decodeEngine="v1-soft"}console.log("final decodeEngine is :",t.decodeEngine);var n=JSON.parse(localStorage.getItem("ezuikit_addressList"));Array.isArray(n[c.deviceSerial+"_"+c.channelNo])&&(t.maxReloadTime=n[c.deviceSerial+"_"+c.channelNo].length)},appearFirstFrameCallback:function(){t.pluginStatus.loadingClear(),t.appearFirstFrameTime=(new Date).getTime(),document.getElementById("".concat(t.id,"-player"))&&(document.getElementById("".concat(t.id,"-player")).style.display="block"),"function"==typeof t.params.handleFirstFrameDisplay&&t.params.handleFirstFrameDisplay({retcode:0,id:t.params.id,type:"handleFirstFrameDisplay"}),"function"==typeof t.params.handleSuccess&&t.params.handleSuccess({retcode:0,id:t.params.id,type:"handleSuccess"})},averageStreamSuccessCallback:function(){t.Zoom=new Ne(t),t.averageStreamSuccessTime=t.initSuccessTime-t.initTime+(t.gotWsUrlTime-t.startGetWsUrlTime)+(t.appearFirstFrameTime-t.openStreamTime)},loadEventHandler:function(){},zoomEventResponse:function(){},windowEventSelect:function(e){},pluginErrorHandler:function(e,n,i){if(!(t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection))if(1003===n)t.Theme&&t.Theme.setDecoderState({play:!1}),l.bPlay||(t.isCall?t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("DISCONNECT"),color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("BTN_RELOAD"),isMobile:t.isMobile,type:t.isCall?1:2}):t.isInspect&&(t.pluginStatus.loadingSetTextWithBtn({mask:!0,text:t.i18n.t("DISCONNECT"),btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()));else if(1!=i.errorCode){var o=function(){var e=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:i,loadTime:e-t.videoInitTime},errorCode:Ot(i),appKey:t.appKey,loadTime:e-t.videoInitTime})):2===t.videoPlayState&&(t.videoPlayState=5,t.monitorReport&&window.ezuikitMonitor.report({action:5,logInfo:{pluginVersion:t.isV3?"v3":"v1",err:i,loadTime:e-t.videoInitTime},errorCode:Ot(i),appKey:t.appKey,loadTime:e-t.videoInitTime}));var n=t.i18n.t("DISCONNECT");n=t.i18n.t("39"+i.errorCode),t.Theme&&t.Theme.setDecoderState({play:!1}),t.pluginStatus.setPlayStatus({play:!1}),t.pluginStatus.loadingClear(),t.isCall?t.pluginStatus.loadingSetTextWithBtn({text:n,color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("BTN_RELOAD"),isMobile:t.isMobile}):t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,text:n,btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:n,color:"red"}),"function"==typeof t.params.handleError&&t.params.handleError({msg:n,retcode:i.errorCode,id:t.params.id,type:"handleError"})};t.reloadCodeBalckList.indexOf(i.errorCode)>-1?o():t._reload(i).catch((function(e){o()}))}else t.pluginStatus.loadingClear(),t.Theme&&t.Theme.setDisabled(!1)},windowEventOver:function(e){},windowEventOut:function(e){},windowEventUp:function(e){},windowFullCcreenChange:function(e){},firstFrameDisplay:function(e,t,n){l.JS_SetCanFullScreen(!1)},performanceLack:function(){},mouseEvent:function(e,t,n){},setRunTimeInfoCallBack:function(n){var i=n.pstRuntimeInfo;if(5===i.nErrorCode)if(c.isInspect){c.pluginStatus.loadingClear(),c.Theme.jSPlugin.Zoom&&c.Theme.jSPlugin.Zoom.stopZoom(),(o=document.getElementById("".concat(t.id,"-loading-item-txt")))&&o.textContent===t.i18n.t("DEVICE_ENCRYPTED")||c.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:t.i18n.t("DEVICE_ENCRYPTED"),color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1})}else{var o=document.getElementById("".concat(t.id,"-loading-item-txt"));t.Theme.decoderState&&t.Theme.decoderState.state.play&&(null===o||-1===o.innerHTML.indexOf("设备已加密"))&&(c.pluginStatus.loadingClear(),c.pluginStatus.loadingSetText({text:t.i18n.t("DEVICE_ENCRYPTED"),color:"red"}))}if(!d&&9!==i.nErrorCode){var a=function(t){var n=j("begin",c.url);"function"==typeof e.handleError&&e.handleError({retcode:r,data:y(y({},s),{},{time:Number.isNaN(t)||void 0===t?n||(new Date).Format("yyyyMMdd")+"000000":new Date(t).Format("yyyyMMddhhmmss")}),id:c.params.id,type:"handleRunTimeInfoError"})};Lt(t.id);var r=-1,s=i;t._tempSeekTime?a(t._tempSeekTime.getTime()):t.getOSDTime().then((function(e){a(Number.isNaN(e.data)?void 0:1e3*e.data)})),setTimeout((function(){t.jSPlugin.JS_Stop(0),t.Theme&&t.Theme.setDecoderState({play:!1,sound:!1,recordvideo:!1,talk:!1,zoom:!1,capturePicture:!1})}),1e3)}d=!0},setAdditionDataCallBack:function(t){"function"==typeof e.handleAdditionData&&e.handleAdditionData({retcode:0,data:t,id:e.id,type:"handleAdditionData"})}},void 0!==e.handleTalkSuccess&&(t.handleTalkSuccess=e.handleTalkSuccess),void 0!==e.handleTalkError&&(t.handleTalkError=e.handleTalkError),t.jSPlugin=l,l.player.event.on("initializing",(function(e){var n,o;c.url.indexOf(".live")>-1?(n=c,o="".concat(n.env.domain,"/api/lapp/device/camera/list?accessToken=").concat(n.accessToken||n.token.deviceToken.video,"&deviceSerial=").concat(n.deviceSerial," "),fetch(o,{method:"POST",headers:{clientType:"ezuikit",sdkVersion:Ve}}).then((function(e){return e.json()})).then((function(e){return e})).catch((function(e){return e}))).then((function(e){if(200==e.code){if(Array.isArray(e.data)&&e.data.length>0){var n=e.data.findIndex((function(e){return e.channelNo==c.channelNo})),o=e.data[n];Ge(c).then((function(e){c.videoLevelList=e,"compatible"===e[0].type?t.url.indexOf(".hd.live")>0?(c.videoLevel=e[1].level,c.streamTypeIn=e[1].streamTypeIn):t.url.indexOf(".live")>0&&(c.videoLevel=e[0].level,c.streamTypeIn=e[0].streamTypeIn):e.map((function(e){e.level==o.videoLevel&&(c.videoLevel=e.level,c.streamTypeIn=e.streamTypeIn)}))})).catch((function(e){})).finally((function(){c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})}))}}else c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})})).catch((function(e){c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})})):(t._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}}))}))}));return u}},{key:"_reload",value:function(e){var t=this;return new Promise((function(n,i){try{var o=JSON.parse(localStorage.getItem("ezuikit_addressList"));if(Array.isArray(o[t.deviceSerial+"_"+t.channelNo])&&o[t.deviceSerial+"_"+t.channelNo].length>0){t.maxReloadTime-=1;var a=o[t.deviceSerial+"_"+t.channelNo].shift();if(o[t.deviceSerial+"_"+t.channelNo].push(a),localStorage.setItem("ezuikit_addressList",JSON.stringify(o)),t.maxReloadTime>0){console.log("使用备用机房地址"),t.monitorReport&&window.ezuikitMonitor.report({action:6,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:t.wsUrl,error:Ot(e)},appKey:t.appKey});var r=new URL(o[t.deviceSerial+"_"+t.channelNo][0].wsUrl);t.url.indexOf("rec")>-1&&t.getOSDTime().then((function(e){console.log("恢复回放时间点:",t.OSD),r.searchParams.set("begin",new Date(1e3*t.OSD).Format("yyyyMMddThhmmssZ"))}));var s=Date.now();t.stop((function(){}),!0).then((function(e){var i=Date.now();t._pluginPlay(r.toString(),(function(){if(console.log("备用机房地址取流成功"),t.monitorReport&&window.ezuikitMonitor.report({action:7,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:o[t.deviceSerial+"_"+t.channelNo][0].wsUrl,reloadRes:{code:1,msg:"发起重试成功"}},appKey:t.appKey}),1===t.videoPlayState||4===t.videoPlayState){var e=Date.now();t.videoPlayState=2;var a=Date.now();t.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:t.isV3?"v3":"v1",loadTime:a-t.videoInitTime,loadTimeDesc:{initTime:t.initTime,stopTime:0,getWsTime:e-s,createWsTime:a-i}},appKey:t.appKey,loadTime:a-t.videoInitTime,initTime:t.initTime,getWsTime:e-s,createWsTime:a-i})}ce.getInstance(t.id).getState().sound&&setTimeout((function(){t.openSound(),t.Theme.setDecoderState({sound:!0})}),2e3),n({code:1,msg:"发起重试成功"})}),(function(e){}))})).catch((function(e){console.log("备用机房地址取流失败 -1"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:o[t.deviceSerial+"_"+t.channelNo][0].wsUrl,reloadRes:{code:-1,msg:"发起重试失败",stopError:e}},appKey:t.appKey}),i({code:-1,msg:"发起重试失败",stopError:e})}))}else console.log("备用机房地址取流失败 -2"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"所有备用机房地址取流失败"}},appKey:t.appKey}),i({code:-2,msg:"所有备用机房地址取流失败"})}else console.log("备用机房地址取流失败 -2"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"无可用的备用机房地址"}},appKey:t.appKey}),i({code:-2,msg:"无可用的备用机房地址"})}catch(e){console.log("备用机房地址取流失败",e),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"备用机房地址重试失败",error:e}},appKey:t.appKey}),i({code:-2,msg:"备用机房地址重试失败"})}}))}},{key:"_initTheme",value:function(){var e=this;e.initTime=(new Date).getTime()-e.videoInitTime,e.themeId&&(1==e.params.isCall?e.Theme=new ht(e,params.id):1==e.params.isInspect?e.Theme=new Dt(e):e.Theme=new Je(e,e.params.id),window.EZUIKit[e.params.id].state.EZUIKitPlayer.themeInit=!0,"function"==typeof e.params.handleThemeChange&&(e.handleThemeChange=e.params.handleThemeChange))}},{key:"_getRealUrlPromise",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this;this.startGetWsTime=Date.now(),this.startGetWsUrlTime=(new Date).getTime();var o=this.env.domain;this.env&&(o=this.env.domain);var a=function(a,c){var l="",d="",u="",m={ezopen:e,isFlv:!1,userAgent:window.navigator.userAgent,isHttp:!1,needStreamToken:i.accessToken?1:0,accessToken:i.accessToken||i.token.deviceToken.video};if(t.params.extraParams&&t.params.extraParams.ezopenParams&&"object"===T(t.params.extraParams.ezopenParams))for(var h in t.params.extraParams.ezopenParams)m[h]=t.params.extraParams.ezopenParams[h];var p=new AbortController;t._controllers.push(p),function(e,t,n){var i=new FormData;return Object.keys(t).map((function(e){i.append(e,t[e])})),fetch(e.env.domain+"/api/lapp/live/url/ezopen",{method:"POST",signal:n,body:i,headers:{clientType:"ezuikit",sdkVersion:Ve}}).then((function(e){return e.json()})).then((function(e){return e}))}(t,m,p.signal).then((function(m){if(200==m.code||0==m.retcode){m.ext&&m.ext.token?(l+=m.data,u=i.accessToken?m.ext.token:t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data):m.data&&("string"==typeof m.data?(l+=m.data,u=t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data):(l+=m.data.url,u=i.accessToken?m.data.token:t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data.url));var h=-1!==e.indexOf("live")?"live":"playback",p=j("checkCode",l="live"===h?l+"&ssn="+u+"&auth=1&biz=4&cln=100":l+"&ssn="+u+"&auth=1&cln=100");if(p&&(void 0!==t.jSPlugin.decoderVersion&&"2.0"===t.jSPlugin.decoderVersion?t.validateCode=p:(t.validateCode=p,t.jSPlugin.JS_SetSecretKey(0,p))),t.params.extraParams&&t.params.extraParams.wsParams)if("string"==typeof t.params.extraParams.wsParams)l+="&"+t.params.extraParams.wsParams;else if("object"===T(t.params.extraParams.wsParams))for(var g in t.params.extraParams.wsParams)l+="&"+g+"="+t.params.extraParams.wsParams[g];if(-1!==l.indexOf("playback")){var f,v,S=j("begin",e)||j("begin",d),_=j("end",e)||j("end",d);if(""===j("timeZone",e)||n)e.indexOf("timeZone=")>-1&&(l=l.replace("timeZone=","timeZone=0"));else{var b=parseInt(j("timeZone",e));b<24&&b>-24?i.timeZone=b:(i.timeZone=0,console.warn("timeZone时区参数错误,取值范围为-23~23"))}if(S?(f=r(S,"000000",n?0:i.timeZone),l=l.replace("&begin="+j("begin",d),""),l+="&begin="+f):(f=re((L=(new Date).Format("yyyyMMdd")+"000000",M=parseInt(L.substring(0,4),10),O=parseInt(L.substring(4,6),10)-1,z=parseInt(L.substring(6,8),10),N=parseInt(L.substring(8,10),10),F=parseInt(L.substring(10,12),10),U=parseInt(L.substring(12,14),10),new Date(M,O,z,N,F,U)),n?0:i.timeZone).Format("yyyyMMddThhmmssZ"),l=l+"&begin="+f),_?(v=r(_,"235959",n?0:i.timeZone),l=l.replace("&end="+j("end",d),"")):v=S?r(r(S,"000000",n?0:i.timeZone).substr(0,8),"235959"):re(new Date,n?0:i.timeZone).Format("yyyyMMdd")+"T235959Z",f.slice(0,8)!==v.slice(0,8)&&(v=f.slice(0,8)+v.slice(8)),l=l+"&end="+v,j("stream",d)||(l=l.replace("stream","&stream")),i._isCloudRecord&&-1!==e.indexOf(".cloud")&&"7"===j("busType",i.url)){var w=s(j("begin",l)),E=s(j("end",l)),P=j("serial",l),k=j("chn",l),C={accessToken:t.accessToken||t.token.deviceToken.global,deviceSerial:P,channelNo:k,startTime:w,endTime:E,spaceId:t._spaceId},I=[];oe(i,C).then((function(e){!function(e){if(e.data&&e.data&&e.data.length>0){I=I.concat(e.data);var t=JSON.stringify(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];function n(e){var n={};return t.forEach((function(t){n[t]=e[t]})),n.istorageVersion&&(n.iStorageVersion=n.istorageVersion,delete n.istorageVersion),n}return e.reduce((function(e,t,i){return 0===i?(e.push(n(t)),e):(e[e.length-1].downloadPath===t.downloadPath?e[e.length-1].endTime=t.endTime:e.push(n(t)),e)}),[])}(I,["downloadPath","ownerId","istorageVersion","spaceId","startTime","endTime","videoType","busType"])).replace("\\","");l+="&recSlice="+t.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else c({retcode:"420004",msg:i.i18n.t("NO_CLOUD_RECORD")})}(e)})).catch((function(e){c({retcode:"420004",msg:i.i18n.t("NO_CLOUD_RECORD")})}))}else if(-1!==e.indexOf(".cloud")&&"7"!==j("busType",t.url)){w=s(j("begin",l)),E=s(j("end",l)),P=j("serial",l),k=j("chn",l);var x=o+"/api/lapp/video/by/time",A={accessToken:t.accessToken||t.token.deviceToken.video,recType:1,deviceSerial:P,channelNo:k,startTime:w,endTime:E,version:"2.0"};B(x,"POST",A,"",(function(e){if(200==e.code){var t=[];if(e.data&&e.data.files&&e.data.files.length>0){var n=e.data.files,o=(new Date).getTime();if(e.data.isAll){t=d(n);var r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else{var s=function(){A.startTime=o,B(x,"POST",A,"",(function(e){if(e.data&&e.data.files&&e.data.files.length>0)if(0==e.data.isAll)e.data.files&&(n=n.concat(e.data.files)),o=e.data.nextFileTime>0?e.data.nextFileTime:(new Date).getTime(),s();else{t=d(n);var r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else{t=d(n);r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}}))};s()}}else c({retcode:"420003",msg:i.i18n.t("NO_RECORD")})}else c({retcode:"420003",msg:i.i18n.t("NO_RECORD")});function d(e){var t=[];return e.forEach((function(e,n){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 a(i._handleRealUrl(l))}else a(i._handleRealUrl(l))}else{var D=JSON.parse(localStorage.getItem("ezuikit_addressList")),R=D?D[i.deviceSerial+"_"+i.channelNo]:[];R.length>0&&R[0].wsUrl&&"10002"!=m.code?a(R[0].wsUrl):("fail"!==m.type?(t.Theme&&(t.Theme.setDisabled(!0),t.Theme.setDecoderState({play:!1})),t.pluginStatus.setPlayStatus({play:!1}),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:m.msg,color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:m.msg,color:"red"}),setTimeout((function(){Lt(t.id)}),200),c(y(y({},m),{},{type:"fail",retcode:m.code}))):c(y(y({},m),{},{type:"fail"})),t.params.handleError&&t.params.handleError(y(y({},m),{},{retcode:m.code})))}var L,M,O,z,N,F,U})).catch((function(e){var t=JSON.parse(localStorage.getItem("ezuikit_addressList")),n=t?t[i.deviceSerial+"_"+i.channelNo]:[];n.length>0&&n[0].wsUrl?a(n[0].wsUrl):(console.error(e),c({retcode:"400002",type:"fail",msg:e}))}))};return new Promise((function(e,t){return a(e,t)}));function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(n<=-24||n>=24)&&(n=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 i=6-(14-e.length),o=t.length;e+=t.substring(i,o)}var a=60*n*60*1e3,r=function(e){"object"!==T(e)&&(e=new Date(e));var t=e.getFullYear(),n=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),o=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0"),r=e.getSeconds().toString().padStart(2,"0");return"".concat(t).concat(n).concat(i).concat(o).concat(a).concat(r)}(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()+a);return r.slice(0,8)+"T"+r.slice(8)+"Z"}function s(e){var t=e.slice(0,4),n=e.slice(4,6),i=e.slice(6,8),o=e.slice(9,11),a=e.slice(11,13),r=e.slice(13,15);return new Date((t+"-"+n+"-"+i+" "+o+":"+a+":"+r).replace(/-/g,"/")).getTime()}}},{key:"_autoSwitchByQuality",value:function(){var e=this;return["0","1","2","3","4","5","6","pp","qp"].includes(this.quality+"")&&this.url.indexOf(".live")>-1?Ge(this).then((function(t){if(t.findIndex((function(e){return"compatible"===e.type}))>=0)return Promise.resolve();var n={};return(n="pp"===e.quality?t[0]:"qp"===e.quality?t[t.length-1]:t.find((function(t){return t.level===+e.quality&&"compatible"!==t.type})))?Ze(e,n.level):void 0})):Promise.resolve()}},{key:"_pluginPlay",value:function(e,t,n){var i=this,o=this;if(console.log("取流地址: ",e),!e)return!1;(function(e,t){var n=new FormData;return Object.keys(t).map((function(e){n.append(e,t[e])})),fetch(e.env.domain+"/api/lapp/device/info",{method:"POST",body:n}).then((function(e){return e.json()})).then((function(e){return e}))})(this,{accessToken:this.accessToken||this.token.deviceToken.global,deviceSerial:R(this.url).deviceSerial}).then((function(e){e.data&&(o.deviceInfo=e.data,document.getElementById("".concat(o.id,"-deviceName-content"))&&(document.getElementById("".concat(o.id,"-deviceName-content")).innerHTML=o.deviceInfo.deviceName||""))})).finally((function(){if(void 0!==i.deviceInfo.status&&1!==i.deviceInfo.status&&i.url.indexOf("live")>-1)return i.pluginStatus.loadingClear(),i.Theme&&i.Theme.setDisabled(!0),i.pluginStatus.loadingSetText({text:i.i18n.t("395404"),color:"red"}),"function"==typeof i.params.handleError&&i.params.handleError({msg:i.i18n.t("395404"),retcode:5404,id:i.params.id,type:"handleError"}),n({msg:i.i18n.t("395404"),retcode:"395404"}),!1;function a(e){var t=e.split("?")[0].replace("/live","").replace("/playback",""),n=(-1===e.indexOf("/live")?-1!==e.indexOf("cloudplayback")?"/cloudplayback?":"/playback?":"/live?")+e.split("?")[1];return{websocketConnectUrl:t,websocketStreamingParam:n=n.replace("stream=2",-1!==n.indexOf("/playback")?"stream=1":"stream=".concat(o.streamTypeIn))}}var r=a(e).websocketConnectUrl;i.env&&i.env.wsUrl&&(r=i.env.wsUrl),i.wsUrl=r,i.doCreateWsTime=Date.now(),i.gotWsUrlTime=(new Date).getTime();var s={playURL:a(e).websocketStreamingParam+"&stream="+i.streamTypeIn};i.isStoping=!1,i.jSPlugin&&i.jSPlugin.JS_Play(r,s,0).then((function(){i.isStoping||(i.validateCode&&void 0!==i.jSPlugin.decoderVersion&&"2.0"===i.jSPlugin.decoderVersion&&i.jSPlugin.JS_SetSecretKey(0,i.validateCode),i.pluginStatus.setPlayStatus({play:!0,loading:!1}),i.Theme&&i.Theme.setDecoderState({play:!0}),t(s))}),(function(e){var t=i.i18n.t("PLAY_FAILED"),o=-1;if(i.jSPlugin&&i.jSPlugin.bPlay)return!1;e&&e.errorCode&&(i.Theme&&i.Theme.setDisabled(!0),t=i.i18n.t("39"+e.errorCode),o=e.errorCode),i.isCall?i.Theme&&i.Theme.decoderState&&i.Theme.decoderState.state.rejection||(i.pluginStatus.loadingClear(),i.pluginStatus.loadingSetTextWithBtn({text:t,color:"white",btnName:i.isMobile?i.i18n.t("BTN_RETRY"):i.i18n.t("BTN_RELOAD"),isMobile:i.isMobile})):(i.pluginStatus.loadingClear(),i.isInspect?(i.Theme.jSPlugin.Zoom&&i.Theme.jSPlugin.Zoom.stopZoom(),5404===o?document.getElementById("".concat(i.id,"-no - inspect - box"))||i.Theme&&i.Theme.inspectEnding():i.pluginStatus.loadingSetTextWithBtn({mask:!0,text:t,color:"white",btnName:i.i18n.t("BTN_RETRY"),type:1}),i.Theme&&i.Theme.inspect&&i.Theme.inspect.InspectEvent&&i.Theme.inspect.InspectEvent.disableEvidenceBtn()):i._destroy||i.pluginStatus.loadingSetText({text:t,color:"red"})),n({msg:t,retcode:o})}))}))}},{key:"_play",value:function(e){var t=this;this.pluginStatus.setPlayStatus({play:!1,loading:!0}),this.playStartTime=(new Date).getTime(),e&&!e.unSaveUrl&&("string"==typeof e&&(this.url=e),"string"==typeof e.url&&(this.url=e.url),"string"==typeof R(this.url).deviceSerial&&(this.deviceSerial=R(this.url).deviceSerial),"string"==typeof R(this.url).channelNo&&(this.channelNo=R(this.url).channelNo));var n=new Promise((function(n,i){t.isStoping=!0,t.jSPlugin.JS_Stop(e&&e.showPoster?e.showPoster:0).then((function(){Lt(t.id),t.stopTime=Date.now();var o=Date.now();t._getRealUrlPromise(e&&e.url?e.url:t.url,e&&!!e.url).then((function(e){var a=Date.now();t._pluginPlay(e,(function(e){if(t.eventEmitter&&t.eventEmitter.emit("play",{eventType:"play",code:0,target:t,msg:t.i18n.t("PLAY_SUCCESS")}),1===t.videoPlayState||4===t.videoPlayState){t.videoPlayState=2;var i=Date.now();t.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:t.isV3?"v3":"v1",loadTime:i-t.videoInitTime,loadTimeDesc:{stopTime:t.stopTime-t.playStartTime,getWsTime:a-o,createWsTime:i-a}},appKey:t.appKey,loadTime:i-t.videoInitTime,getWsTime:a-o,createWsTime:i-a})}setTimeout((function(){t.pluginStatus.loadingClear(),t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection&&t.stop((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2})}))}),500),t.jSPlugin&&t._FECSplitIds&&t._FECCorrectType&&t.jSPlugin.JS_FECCorrectType(t._FECCorrectType,t._FECSplitIds),t.waterMark_JSPlugin&&t.setWaterMarkFont(t.waterMark_JSPlugin);var r=ce.getGlobalState();ce.getInstance(t.id).getState().sound&&!1===r.sound&&setTimeout((function(){t.openSound(),t.Theme.setDecoderState({sound:!0})}),500),n(!0)}),(function(){return i(!1)}))})).catch((function(e){var n=e.msg?e.msg:t.i18n.t("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("USER_DO_NOT_OWN_DEVICE"),color:"white",isMobile:t.isMobile,type:2}):t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2}):e&&20018==e.code?(t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("USER_DO_NOT_OWN_DEVICE"),color:"white",isMobile:t.isMobile,type:2}),!t.isWebConsole&&t.Theme&&t.Theme.call&&t.Theme.userNoDevice()):t.pluginStatus.loadingSetTextWithBtn({text:n,color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("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:n,color:"white",btnName:t.i18n.t("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:n,color:"red"})),"function"==typeof t.params.handleError&&t.params.handleError({retcode:e.oError?e.oError.errorCode:e.code||-1,msg:n,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("PLAY_FAILED")}),i({retcode:e.oError?e.oError.errorCode:e.code||-1,msg:n,id:t.params.id,type:"handleError"})}))}))}));return n}},{key:"stop",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0;return this._abortFetch(),this.pluginStatus.setPlayStatus({loading:!0}),this.reSetTheme(),this.jSPlugin.JS_Stop(n).then((function(){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("STOP_SUCCESS")}),t()}))}},{key:"changeVideoLevel",value:function(e){var t,n=this;return"object"===T(e)?this.videoLevelList.map((function(n){n.level===e.level&&(t=n)})):this.videoLevelList.map((function(n){n.level===e&&(t=n)})),void 0===t?(console.log(this.i18n.t("VIDEO_LEVEL_NOT_SUPPORT")+":"+e),void(this.eventEmitter&&this.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-2,target:this,data:e,msg:this.i18n.t("VIDEO_LEVEL_NOT_SUPPORT")+":"+e}))):(this.videoLevel=t.level,this.streamTypeIn=t.streamTypeIn,new Promise((function(t,i){Ze(n,n.videoLevel).then((function(o){document.getElementById("".concat(n.id,"-videoLevel-icon"))&&(document.getElementById("".concat(n.id,"-videoLevel-icon")).innerHTML=n.i18n.t(Ue[n.videoLevel]),document.getElementById("".concat(n.id,"-videoLevel-icon")).dataset.type=n.videoLevel),n.changePlayUrl({url:n.url},(function(){}),!1).then((function(i){n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:0,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL")}),t(i)})).catch((function(t){console.log("清晰度切换失败:",t),n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-1,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")}),i(o)}))})).catch((function(i){console.log("清晰度切换失败:",i),n.url.indexOf(".hd.live")>=0?n.url=n.url.replace(".hd.live",".live"):n.url.indexOf(".live")>=0&&(n.url=n.url.replace(".live",".hd.live")),n.changePlayUrl({url:n.url},(function(){}),!1).then((function(){document.getElementById("".concat(n.id,"-videoLevel-icon"))&&(document.getElementById("".concat(n.id,"-videoLevel-icon")).innerHTML=n.i18n.t(Ue[n.videoLevel]),document.getElementById("".concat(n.id,"-videoLevel-icon")).dataset.type=n.videoLevel),t(res)})),n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-1,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")})}))})))}},{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("RESET_THEME")})}},{key:"_changePlayUrl",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=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("LOADING")})}),100),this.reSetTheme(["zoom"]);var a=this.url,r=this._spaceId,s=this._isCloudRecord,c=function(e,t){if(t.url)return t.url;var n=e.split("/")[4].split(".")[e.split("/")[4].split(".").length-1].split("?")[0];"rec"===n&&-1!==e.indexOf(".cloud.rec")&&(n="cloud.rec");t.type&&(n="miniRec"==t.type?"rec":t.type);var i=e.split("/")[3];t.deviceSerial&&(i=t.deviceSerial);var a=e.split("/")[4].split(".")[0];t.channelNo&&(a=t.channelNo);var c=2===e.split("/")[2].split("@").length?e.split("/")[2].split("@")[0]:"";void 0!==t.validCode&&(c=t.validCode);var l="ezopen://".concat(c?"".concat(c,"@"):"").concat(o.host,"/").concat(i,"/").concat(a,".").concat(n);if(""!==j("timeZone",e)){var d=parseInt(j("timeZone",e));d<24&&d>-24?o.timeZone=d:(o.timeZone=0,console.warn("timeZone时区参数错误,取值范围为-23~23"))}if("live"===n)return l;l="ezopen://".concat(c?"".concat(c,"@"):"").concat(o.host,"/").concat(i,"/").concat(a,".").concat(n),t.begin&&t.end?l+="?begin=".concat(t.begin,"&end=").concat(t.end):t.begin?l+="?begin=".concat(t.begin):j("begin",e)&&j("end",e)?l+="?begin=".concat(j("begin",e),"&end=").concat(j("end",e)):j("begin",e)&&(l+="?begin=".concat(j("begin",e)));s&&-1!==l.indexOf("cloud.rec")&&(l+="".concat(-1!==l.indexOf("?")?"&":"?","busType=7").concat(r?"&spaceId=".concat(r):""));return l}(a,e);if(this.url=c,this.deviceSerial=e.deviceSerial||R(this.url).deviceSerial||this.deviceSerial,this.channelNo=e.channelNo||R(this.url).channelNo||this.channelNo,this.accessToken=e.accessToken||this.accessToken,this.token=e.token||this.token,this.videoInitTime=Date.now(),this.videoPlayState=4,e.url){var l=JSON.parse(localStorage.getItem("ezuikit_addressList"))||{};l[this.deviceSerial+"_"+this.channelNo]||(l=y(y({},l),{},f({},this.deviceSerial+"_"+this.channelNo,[])),localStorage.setItem("ezuikit_addressList",JSON.stringify(l))),We(this,{deviceSerial:this.deviceSerial,localIndex:this.channelNo,accessToken:this.accessToken||this.token.deviceToken.video})}window.monitorExtendsInfo={protocol:"ezopen",url:this.url,serial:this.deviceSerial,no:this.channelNo,env:this.env.domain,type:R(this.url).type};var d=Object.assign({},o.params);return this.monitorReport&&window.ezuikitMonitor.report({action:4,logInfo:{pluginVersion:this.isV3?"v3":"v1",type:R(this.url).type,params:d},appKey:this.appKey}),this.jSPlugin.player&&(this.jSPlugin.player.playbackRate=1,this.jSPlugin.player._playbackRate=1),this.getDeviceCapacity({deviceSerial:this.deviceSerial,accessToken:this.accessToken||this.token.deviceToken.video}),n(),new Promise((function(n,o){var a={url:c};return e.token&&(a.token=e.token),e.accessToken&&(a.accessToken=e.accessToken),t.play(a).then((function(){i&&(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("CHANGE_PLAYURL_SUCCESS")}),n(c)})).catch((function(e){o(c),t.eventEmitter&&t.eventEmitter.emit("changePlayUrl",{eventType:"changePlayUrl",code:-1,target:t,msg:e&&e.msg?e.msg:t.i18n.t("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("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,n){e.jSPlugin.JS_GetOSDTime(0).then((function(n){e.eventEmitter&&e.eventEmitter.emit("getOSDTime",{eventType:"getOSDTime",code:0,target:e,data:n,msg:e.i18n.t("GET_OSD_TIME")}),n&&n>0&&(e.OSD=n),t({code:0,retcode:0,data:n}),"function"==typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:0,data:n})})).catch((function(t){e.eventEmitter&&e.eventEmitter.emit("getOSDTime",{eventType:"getOSDTime",code:-1,target:e,msg:t||e.i18n.t("GET_OSD_TIME")}),n({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,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,o=this.jSPlugin.JS_CapturePicture(0,e||(new Date).getTime(),"JPEG",n,void 0!==i?i:this.download);if(x(o))return new Promise((function(n,i){o.then((function(i){"function"==typeof t.params.capturePictureCallBack&&t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:0});var o={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("CAPTURE_SUCCESS")}),"function"==typeof t.params.handleCapturePicture&&t.params.handleCapturePicture(o),t._isCloudRecord&&-1!==t.url.indexOf(".cloud")&&"7"===j("busType",t.url)&&fetch(t.env.domain+"/api/service/cloud/upload/url"+"?fileName=".concat(e,"&fileType=pic&expireDays=-1&urlExpireTime=1&bizType=ezuikit&accessToken=").concat(t.accessToken||t.token.httpToken.url),{method:"GET"}).then((function(e){return e.json()})).then((function(e){if(e.data&&e.data[0]){var n=new FormData;Object.keys(e.data[0].fields).map((function(t){n.append(t,e.data[0].fields[t])}));for(var o=atob(i.data.base64.split(",")[1]),a=[],r=0;r<o.length;r++)a.push(o.charCodeAt(r));var s=new Blob([new Uint8Array(a)],{type:"image/jpeg"});n.append("file",s,"image.jpeg"),new Ye({url:e.data[0].url,method:"POST",body:n,headers:{accessToken:t.accessToken||t.token.httpToken.url},onUploadComplete:function(e){e.response&&e.response.meta&&200==e.response.meta.code&&console.log("".concat(i.data.fileName," 上传至云存储完成"))}}).upload()}else console.log("云录制文件上传地址获取失败1:",e.meta.message)})).catch((function(e){console.log("云录制文件上传地址获取失败2:",e),console.log(JSON.stringify(e))})),n(o)}),(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("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,t){var n=this,i=this.jSPlugin.JS_StartSave(e,(function(e,t){n.recordRes={url:e,file:t}}),t||this.validateCode),o=this;return x(i)?(i.then((function(){"function"==typeof o.params.startSaveCallBack&&o.params.startSaveCallBack({id:o.id,type:"startSave",code:0}),o.eventEmitter&&o.eventEmitter.emit("startSave",{eventType:"startSave",code:0,target:o,msg:n.i18n.t("START_RECORD_SUCCESS")})})).catch((function(e){o.eventEmitter&&o.eventEmitter.emit("startSave",{eventType:"startSave",code:-1,target:o,msg:n.i18n.t("START_RECORD_FAILED")}),"function"==typeof o.params.startSaveCallBack&&o.params.startSaveCallBack({id:o.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(),n=this;return x(t)?(t.then((function(){setTimeout((function(){n.eventEmitter&&n.eventEmitter.emit("stopSave",{eventType:"stopSave",code:0,target:n,data:e.recordRes,msg:e.i18n.t("STOP_RECORD_SUCCESS")}),"function"==typeof n.params.stopSaveCallBack&&n.params.stopSaveCallBack({id:n.id,type:"stopSave",data:e.recordRes,code:0}),e.recordRes={}}),200)})).catch((function(){n.eventEmitter&&n.eventEmitter.emit("stopSave",{eventType:"stopSave",code:-1,target:n,msg:e.i18n.t("STOP_RECORD_FAILED")}),"function"==typeof n.params.stopSaveCallBack&&n.params.stopSaveCallBack({id:n.id,type:"stopSave",code:-1}),e.recordRes={}})),t):(this.Theme&&this.Theme.setDecoderState({recordvideo:!1}),new Promise((function(e){e(t)})))}},{key:"openSound",value:function(){var e=this,t=ce.getGlobalState(),n=ce.getInstance(this.id);if((t.sound&&!1===n.getState().sound||t.talk&&!1===n.getState().talk)&&this.audioOnly)return this.eventEmitter&&this.eventEmitter.emit("openSound",{eventType:"openSound",code:460001,target:this,msg:this.i18n.t("SOUND_OPENED")}),new Promise((function(e,t){t("当前已经有画面正在播放声音")}));var i=this.jSPlugin.JS_OpenSound(0);return this.eventEmitter&&this.eventEmitter.emit("openSound",{eventType:"openSound",code:i,target:this,msg:this.i18n.t("OPEN_SOUND")}),this.Theme&&this.Theme.setDecoderState({sound:!0}),"function"==typeof this.params.openSoundCallBack&&this.params.openSoundCallBack({id:this.id,type:"openSound",code:i}),ce.setGlobalState({sound:!0}),n.setState({sound:!0}),Array.isArray(ce.listInstances())&&this.audioOnly&&ce.listInstances().map((function(t){t.state.sound&&t.id!=e.id&&ce.getInstance(t.id).setState({sound:!1})})),x(i)?i:new Promise((function(e){e(i)}))}},{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("CLOSE_SOUND")}),x(e)?e:(this.Theme&&this.Theme.setDecoderState({sound:!1}),"function"==typeof this.params.closeSoundCallBack&&this.params.closeSoundCallBack({id:this.id,type:"closeSound",code:e}),ce.getInstance(this.id).setState({sound:!1}),ce.setGlobalState({sound:!1}),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("START_ZOOM")}),x(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("CLOSE_ZOOM")}),x(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(!e.use3DZoom)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_DISABLE")}),n({code:-1,msg:e.i18n.t("3D_ZOOM_DISABLE")})}));if(e.is3DZooming)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_ACTIVED")}),n({code:-1,msg:e.i18n.t("3D_ZOOM_ACTIVED")})}));if(e.isMobile||(e.Zoom&&e.Zoom.stopZoom(),e.Theme&&e.Theme.setDecoderState({zoom:!1})),e.support3DZoom){e.is3DZooming=!0,e.Theme&&e.Theme.setDecoderState({zoom:!0}),document.getElementById("".concat(e.id,"-zoom-content"))&&(document.getElementById("".concat(e.id,"-zoom-content")).title=e.i18n.t("3D_ZOOM"));var t=e.jSPlugin.JS_Enable3DZoom(0,(function(t){var n=e.Theme&&e.Theme.decoderState.state.expend&&e.isMobile?e.fullScreenWidth:e.width,i=e.Theme&&e.Theme.decoderState.state.expend&&e.isMobile?e.fullScreenHeight:e.height,o=function(e,t){if(!e||!e.startPos||!e.endPos)return-1;var n=e.startPos[0],i=e.startPos[1],o=e.endPos[0],a=e.endPos[1];return t?o>n&&a<i?1:o<n&&a>i?0:-1:o>n&&a>i?1:o<n&&a<i?0:-1}(t,e.Theme&&e.Theme.decoderState.state.expend);if(o>-1)try{var a=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;if(!(e&&t&&n&&n.startPos&&n.endPos))return-1;var o=n.startPos[0],a=n.startPos[1],r=n.endPos[0],s=n.endPos[1],c=Math.abs(r-o),l=Math.abs(s-a),d=parseInt((o+r)/2),u=parseInt((a+s)/2),m=Math.round(e*t/(c*l));return{startPointX:parseInt(o/e*256),startPointY:parseInt(a/t*256),endPointX:parseInt(r/e*256),endPointY:parseInt(s/t*256),zoomRate:m>i?i:m,targetCenterX:d,targetCenterY:u,targetWidth:c,targetHeight:l}}(n,i,t,e.capacity&&e.capacity.support_zoomOut_maxTime?e.capacity.support_zoomOut_maxTime:5),r=e.env.domain+"/api/v3/das/device/3d/zoom?accessToken=".concat(e.accessToken||e.token.deviceToken.video,"&deviceSerial=").concat(R(e.url).deviceSerial,"&channelNo=").concat(R(e.url).channelNo,"&command=").concat(0==o?9:8,"&zoomTimes=").concat(a.zoomRate,"&startPointX=").concat(a.startPointX,"&startPointY=").concat(a.startPointY,"&endPointX=").concat(a.endPointX,"&endPointY=").concat(a.endPointY,"&length=").concat(parseInt(i),"&width=").concat(parseInt(n),"&midPointX=").concat(a.targetCenterX,"&midPointY=").concat(a.targetCenterY,"&lengthX=").concat(a.targetWidth,"&lengthY=").concat(a.targetHeight);fetch(r,{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("3D_ZOOM_FAILED"),color:"red",delayClear:2e3})}))}catch(t){e.pluginStatus.loadingSetText({text:e.i18n.t("3D_ZOOM_FAILED"),color:"red",delayClear:2e3})}}));return e.Zoom=new Ne(e),e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:t,target:e,msg:e.i18n.t("START_3D_ZOOM")}),x(t)?t:new Promise((function(e){e(t)}))}return e.is3DZooming=!1,document.getElementById("".concat(e.id,"-zoom-content"))&&(document.getElementById("".concat(e.id,"-zoom-content")).title=e.i18n.t("ZOOM")),new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),n({code:-1,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")})}))}},{key:"close3DZoom",value:function(){var e=this;if(!e.use3DZoom)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_NOT_ACTIVED")})}));if(e.is3DZooming){e.Theme&&e.Theme.setDecoderState({zoom:!1});var t=e.jSPlugin.JS_Disable3DZoom(0);return e.Zoom=new Ne(e),e.is3DZooming=!1,e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:t,target:e,msg:e.i18n.t("CLOSE_3D_ZOOM")}),x(t)?t:new Promise((function(e){e(t)}))}return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_CLOSED")}),n({code:-1,msg:e.i18n.t("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("DEVICE_NOT_SUPPORT_3D_ZOOM")}),{code:-1,msg:this.i18n.t("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 Ne(this),setTimeout((function(){e?document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("3D_ZOOM")):document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("ZOOM")),t.isMobile&&e&&t.enable3DZoom(),t.eventEmitter&&t.eventEmitter.emit("changeZoomType",{eventType:"changeZoomType",code:0,target:t,msg:t.i18n.t("CHANGE_ZOOM_TYPE")})}),500)}},{key:"setPoster",value:function(e){Mt()?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("SET_POSTER")})}},{key:"reSize",value:function(e,t){var n,i,o=0;(this.params.height=t,this.params.width=e,this.Theme&&this.Theme.isNeedRenderTimeLine&&!this.isMobile&&document.getElementById("".concat(this.id,"-canvas-container")))&&(o=parseInt(null===(i=document.getElementById("".concat(this.id,"-canvas-container")))||void 0===i?void 0:i.clientHeight,10));if(n=t-o,this._isCurrentBrowserFullscreen||(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=n+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin&&(this.jSPlugin.iHeight=t,this.jSPlugin.iWidth=e);else{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)}this.Theme&&this.Theme.Rec&&this.Theme.Rec.recAutoSize&&!this._isCurrentFullscreen&&this.Theme.Rec.recAutoSize(),this.Theme&&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("RESIZE")}),this.eventEmitter.emit("resize",{eventType:"resize",code:0,target:this,msg:this.i18n.t("RESIZE")}))}},{key:"resize",value:function(e,t){this.reSize(e,t)}},{key:"fast",value:function(e){var t=this,n=this.speed;if(e){var i=this.jSPlugin.JS_Speed(e);this.Theme&&(this.Theme.changeRecSpeed(e),this.Theme.nextRate=e)}else{if(1===n)n=2;else{if(2!==n)return console.log("当前已经是最大播放倍数"),"function"==typeof this.params.handleError&&this.params.handleError({msg:this.i18n.t("MAX_SPEED_LIMIT"),retcode:1003,id:this.id,type:"handleError"}),new Promise((function(e,i){t.speed=n,i({code:-1,data:{speed:n,result:t.i18n.t("MAX_SPEED_LIMIT")}})}));n=4}i=this.jSPlugin.JS_Speed(n);this.Theme&&(this.Theme.changeRecSpeed(n),this.Theme.nextRate=n)}return new Promise((function(e){t.speed=n,t.eventEmitter&&t.eventEmitter.emit("fast",{eventType:"fast",code:0,data:n,target:t,msg:t.i18n.t("SPEED")}),e({code:0,data:{speed:n,result:i}})}))}},{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("MIN_SPEED_LIMIT"),retcode:1003,id:this.id,type:"handleError"}),new Promise((function(n,i){e.speed=t,i({code:-1,data:{speed:t,result:e.i18n.t("MIN_SPEED_LIMIT")}})}));t=1}var n=this.jSPlugin.JS_Speed(t);return new Promise((function(i){e.speed=t,e.eventEmitter&&e.eventEmitter.emit("slow",{eventType:"slow",code:0,data:t,target:e,msg:e.i18n.t("SPEED")}),i({code:0,data:{speed:t,result:n}})}))}},{key:"seek",value:function(e,t){var n=this.url,i=(j("begin",n)||(new Date).Format("yyyyMMdd")).substr(0,8);if(t=o(i,"235959"),6===e.length)e=o(i,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("SEEK_TIMEFORMAT_ERROR")}),this.params.handleError({msg:this.i18n.t("SEEK_TIMEFORMAT_ERROR"),retcode:-1,id:this.id,type:"handleError"})),!1;if(e.substr(0,8)!==i)return"function"==typeof this.params.handleError&&(this.eventEmitter&&this.eventEmitter.emit("seek",{eventType:"seek",code:-1,target:this,msg:this.i18n.t("SEEK_CANNOT_CROSS_DAYS")}),this.params.handleError({msg:this.i18n.t("SEEK_CANNOT_CROSS_DAYS"),retcode:-1,id:this.id,type:"handleError"})),!1}function o(e,t){if(/^[0-9]{8}T[0-9]{6}Z$/.test(e))return e;if(/[0-9]{8,14}/.test(e)){var n=6-(14-e.length),i=t.length,o=e+t.substring(n,i);return o.slice(0,8)+"T"+o.slice(8)+"Z"}throw new Error(this.i18n.t("TIMEFORMAT_ERROR"))}var a=this.jSPlugin.JS_Seek(0,e,t);return x(a)?a:new Promise((function(e){e(a)}))}},{key:"fullScreen",value:function(){this.fullscreen()}},{key:"fullscreen",value:function(){var e=this;return this._isCurrentFullscreen?Promise.resolve():(this._isCurrentFullscreen=!0,this._isCurrentBrowserFullscreen?Promise.resolve().then((function(){e._isCurrentBrowserFullscreen&&e._fullscreenChangeEvent({target:document.getElementById("".concat(e.id,"-wrap"))})})):this.browserFullscreen())}},{key:"_fullscreenChangeEvent",value:function(e){var t=document.getElementById("".concat(this.id,"-wrap"));if(this._isCurrentBrowserFullscreen=n.element===t,e.target===t){var i,o;if(this._isCurrentBrowserFullscreen)t.classList.add("ezuikit-player-wrap-web-fullscreen"),this._isCurrentFullscreen&&t.classList.add("ezuikit-player-wrap-fullscreen"),this.resize(window.screen.width||window.screen.availWidth,window.screen.height||window.screen.availHeight),null===(o=this.eventEmitter)||void 0===o||o.emit("fullscreen"),this.eventEmitter&&this.eventEmitter.emit(this._isCurrentFullscreen?"fullscreen":"browserFullscreen",{eventType:this._isCurrentFullscreen?"fullscreen":"browserFullscreen",code:0,target:this,msg:this._isCurrentFullscreen?this.i18n.t("FULLSCREEN_EXIT"):this.i18n.t("WEB_FULLSCREEN")});else t.classList.remove("ezuikit-player-wrap-web-fullscreen","ezuikit-player-wrap-fullscreen"),this._isCurrentFullscreen=!1,this.resize(this.width,this.height),this.eventEmitter&&this.eventEmitter.emit("exitFullscreen",{eventType:"exitFullscreen",code:0,target:this,msg:this.i18n.t("WEB_FULLSCREEN_EXIT")});null===(i=this.eventEmitter)||void 0===i||i.emit("fullscreenChange",{eventType:"fullscreenChange",code:0,target:this,data:{isCurrentFullscreen:this._isCurrentFullscreen,isCurrentBrowserFullscreen:this._isCurrentBrowserFullscreen}})}}},{key:"cancelFullScreen",value:function(){this.exitFullscreen()}},{key:"exitFullscreen",value:function(){return n.isEnabled?n.exit():Promise.resolve()}},{key:"startTalk",value:function(){this.Talk.startTalk()}},{key:"stopTalk",value:function(){this.Talk.stopTalk(),this.Theme&&this.Theme.decoderState.state.talk&&this.Theme.setDecoderState({talk:!1});var e=ce.getGlobalState(),t=ce.getInstance(this.id);e.talk&&ce.setGlobalState({talk:!1}),t.getState().talk&&t.setState({talk:!1})}},{key:"setVolumeGain",value:function(e){return this.Talk.setVolumeGain(e)}},{key:"getMicrophonePermission",value:function(){return this.Talk.getMicrophonePermission()}},{key:"getMicrophonesList",value:function(){return this.Talk.getMicrophonesList()}},{key:"setProfile",value:function(e){this.Talk.setProfile(e)}},{key:"destroy",value:function(){this._destroy=!0;var e=ce.getInstance(this.id);e&&(e.getState().sound&&this.closeSound(),e.getState().talk&&(this.stopTalk(),e.setState({talk:!1}),ce.setGlobalState({talk:!1}))),n.isEnabled&&(n.off("change",this._fullscreenChangeEvent),this._fullscreenChangeEvent=null);var t=document.getElementById("".concat(this.id,"-wrap"));if(this._resizeObserver&&t){try{this._resizeObserver.unobserve(t)}catch(e){}this._resizeObserver=null}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),this.pluginStatus&&"function"==typeof this.pluginStatus.destroy&&this.pluginStatus.destroy(),this.Talk&&"function"==typeof this.Talk.destroy&&this.Talk.destroy(),window.recTimer&&Array.isArray(window.recTimer)&&(window.recTimer[this.id].map((function(e){clearInterval(e)})),window.recTimer[this.id]=[]),this.recTimer&&clearInterval(this.recTimer),this._abortFetch();var o=this.jSPlugin.JS_DestroyWorker(0);if(ce&&this.id&&ce.removeInstance(this.id),ce&&0===ce.listInstances().length){if(i._STYLE){var a=document.getElementById(i._STYLE.id);a&&document.getElementsByTagName("head")[0].removeChild(a),i._STYLE=null}if(H._STYLE){var r=document.getElementById(H._STYLE.id);r&&document.getElementsByTagName("head")[0].removeChild(r),H._STYLE=null}if(G._STYLE){var s=document.getElementById(G._STYLE.id);s&&document.getElementsByTagName("head")[0].removeChild(s),G._STYLE=null}if(Z._STYLE){var c=document.getElementById(Z._STYLE.id);c&&document.getElementsByTagName("head")[0].removeChild(c),Z._STYLE=null}if(de._STYLE){var l=document.getElementById(de._STYLE.id);l&&document.getElementsByTagName("head")[0].removeChild(l),de._STYLE=null}}return this.eventEmitter&&this.eventEmitter.emit("destroy",{eventType:"destroy",code:0,target:this,msg:this.i18n.t("DESTROY")}),this.jSPlugin=null,document.getElementById("".concat(this.id,"-wrap"))&&this.initDOM&&(document.getElementById("".concat(this.id,"-wrap")).parentNode.appendChild(this.initDOM),document.getElementById("".concat(this.id,"-wrap")).parentNode.removeChild(document.getElementById("".concat(this.id,"-wrap"))),delete this.initDOM),x(o)?o:new Promise((function(e){e(o)}))}},{key:"getDeviceCapacity",value:function(e){var t=this,n=this.env.domain;this.capacity={},this.env&&(n=this.env.domain);var i=n+"/api/lapp/device/capacity",o=e||{accessToken:this.accessToken||this.token.deviceToken.video,deviceSerial:R(this.url).deviceSerial};B(i,"POST",o,"",(function(e){if(t.support3DZoom=!1,document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("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(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("3D_ZOOM")))),t.eventEmitter&&t.eventEmitter.emit("getDeviceCapacity",{eventType:"getDeviceCapacity",code:0,data:e,target:t,msg:t.i18n.t("GET_CAPACITY")})}}))}},{key:"pause",value:function(e){var t=this;return new Promise((function(n,i){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("PAUSE")}),t.Theme&&t.Theme.setDecoderState({play:!1,pauseDate:e.pauseDate}),n()})).catch((function(e){t.eventEmitter&&t.eventEmitter.emit("pause",{eventType:"pause",code:-1,target:t,msg:e||t.i18n.t("PAUSE_FAILED")}),i(e)}))}))}},{key:"_resume",value:function(e){var t=this;return new Promise((function(n,i){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));var i=ce.getGlobalState();ce.getInstance(t.id).getState().sound&&!1===i.sound&&setTimeout((function(){t.openSound()}),500),t.eventEmitter&&t.eventEmitter.emit("resume",{eventType:"resume",code:0,target:t,msg:t.i18n.t("RESUME")}),n(e)})).catch((function(e){t.eventEmitter&&t.eventEmitter.emit("resume",{eventType:"resume",code:-1,target:t,msg:e||t.i18n.t("RESUME_FAILED")}),i(e)}))}))}},{key:"getVideoLevelList",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getVideoLevelList",{eventType:"getVideoLevelList",code:0,data:this.videoLevelList,target:this,msg:this.i18n.t("GET_VIDEO_LEVEL_LIST")}),this.videoLevelList}},{key:"getVideoLevel",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getVideoLevel",{eventType:"getVideoLevel",code:0,data:this.videoLevel,target:this,msg:this.i18n.t("GET_VIDEO_LEVEL_LIST")}),this.videoLevel}},{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("GET_PTZ_STATUS")}),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("GET_PTZ_STATUS_FAILED")})}},{key:"openPtz",value:function(){return this.Theme?this.isMobile&&this.Theme&&!this.Theme.decoderState.state.expend?(this.eventEmitter&&this.eventEmitter.emit("openPtz",{eventType:"openPtz",code:-1,target:this,msg:this.i18n.t("MOBILE_HIDE_PTZ")}),!1):(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("OPTION_PTZ_FAILED")}),{code:-1,msg:this.i18n.t("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("OPTION_PTZ_FAILED")}),{code:-1,msg:this.i18n.t("OPTION_PTZ_FAILED")};this.Theme.setDecoderState({pantile:!1}),this.Theme.Ptz.hide()}},{key:"isCurrentBrowserFullscreen",get:function(){return this._isCurrentBrowserFullscreen}},{key:"browserFullscreen",value:function(){var e=document.getElementById("".concat(this.id,"-wrap"));return e&&n.isEnabled?n.request(e):Promise.resolve()}},{key:"exitBrowserFullscreen",value:function(){return this.exitFullscreen()}},{key:"getPlayRate",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getPlayRate",{eventType:"getPlayRate",code:0,data:this.speed,target:this,msg:this.i18n.t("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("MIRROR_TYPE_ERROR")}),Promise.reject({code:-1,msg:this.i18n.t("MIRROR_TYPE_ERROR")})):(this.eventEmitter&&this.eventEmitter.emit("setMirrorFlip",{eventType:"setMirrorFlip",code:0,target:this,msg:this.i18n.t("MIRROR")}),function(e,t,n,i){return new Promise((function(o,a){B("".concat(e.env.domain,"/api/lapp/device/ptz/mirror"),"POST",{accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:t,channelNo:n,command:i},"",o)}))}(this,this.deviceSerial,this.channelNo,e))}},{key:"setFECCorrectType",value:function(e,t){var n=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("FEC.DEVICE_NOT_SUPPORT")}),Promise.reject({code:-1,msg:this.i18n.t("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("FEC.FEC_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")});var i=(1===e.place?ee:3===e.place?Q:[]).find((function(t){return t.type===e.type&&t.place===e.place}));return i?i.split>0&&void 0===T(t)?(this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.NO_CANVAS_ID")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.NO_CANVAS_ID")})):(this.jSPlugin.FECSplitIds=t,this.jSPlugin.correctType=i,this._FECCorrectType=i,this._FECSplitIds=t,this.stop().then((function(){return n.play().then((function(e){return 1===i.place&&0===i.correctType||3===i.place&&0===i.correctType?n.Theme.resumeFECBtn():n.Theme.disabledFECBtn(),n.eventEmitter&&n.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:0,target:n,msg:n.i18n.t("FEC.CHANGE_FEC_TYPE")}),e}))}))):(this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.TYPE_NOT_SUPPORT")}),Promise.reject({code:-1,msg:this.i18n.t("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("FEC.FEC_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")})):this.jSPlugin.FEC_Set3DViewParam&&this._FECCorrectType&&(3===this._FECCorrectType.place&&this._FECCorrectType.correctType===Y||1===this._FECCorrectType.place&&this._FECCorrectType.correctType===X)?(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:0,target:this,msg:this.i18n.t("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("FEC.SET_FEC_PARAMS_FAILED")}),Promise.reject({code:-1,msg:this.i18n.t("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("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")})):this.jSPlugin.FEC_Set3DViewParam&&this._FECCorrectType&&(3===this._FECCorrectType.place&&this._FECCorrectType.correctType===Y||1===this._FECCorrectType.place&&this._FECCorrectType.correctType===X)?(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:0,target:this,data:this.jSPlugin.FEC_Get3DViewParam(e),msg:this.i18n.t("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("FEC.SET_FEC_PARAMS_FAILED")}),Promise.reject({code:-1,msg:this.i18n.t("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("SET_WATERMARK")}),this.waterMark_JSPlugin=e,this.jSPlugin.JS_SetWaterMarkFont(e)}},{key:"changeTheme",value:function(e){this.Theme&&this.Theme.changeTheme(e)}},{key:"_abortFetch",value:function(){this._controllers.forEach((function(e){e.abort()})),this._controllers=[]}},{key:"isCurrentFullscreen",get:function(){return this._isCurrentFullscreen}},{key:"_$containerResizeEvent",value:function(){try{var e=document.getElementById("".concat(this.id,"-wrap"));this._resizeObserver=new ResizeObserver((function(e){var t,n=g(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=i.contentRect;o.left,o.top,o.width,o.height;i.target}}catch(e){n.e(e)}finally{n.f()}})),e&&this._resizeObserver.observe(e)}catch(e){}}}],[{key:"_instanceStyle",value:function(){i._STYLE||(i._STYLE=document.createElement("style"),i._STYLE.id="ezuikit-player-wrap-fullscreen",i._STYLE.innerHTML="\n .ezuikit-player-wrap-web-fullscreen {}\n .ezuikit-player-wrap-fullscreen .header-controls{ display: none!important}\n .ezuikit-player-wrap-fullscreen .ez-iframe-footer-container { display: none!important}\n .ezuikit-player-wrap-fullscreen .ezuikit-time-line-control{ display: none!important}\n .ezuikit-player-wrap-fullscreen .timeline-controls{ display: none!important}\n ",document.getElementsByTagName("head")[0].appendChild(i._STYLE))}}])}();f(Ft,"_STYLE",void 0),f(Ft,"LOCALES",{zh:me,en:he}),Ft.prototype.tokenSchema={streamToken:{live:{actionType:"PREVIEW",resourceCategory:"global"},rec:{actionType:"PLAYBACK",resourceCategory:"global"},talk:{actionType:"TALK",resourceCategory:"global"}},deviceToken:{video:{action:"*",resourceCategory:"video"},global:{action:"*",resourceCategory:"global"}},httpToken:{url:{urlPattern:"/**"}}},Ft.prototype.deepCheck=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n<0)return{};var i={};for(var o in e)if(void 0!==e[o]&&void 0===t[o])i[o]=e[o];else if("object"===T(e[o])&&!Array.isArray(e[o])){var a=Ft.prototype.deepCheck(e[o],t[o],n-1);Object.keys(a).length>0&&(i[o]=a)}return i},Ft.prototype.checkToken=function(e){return Ft.prototype.deepCheck(Ft.prototype.tokenSchema,e)};var Ut=null;function Vt(e){e.responseMsg.eventName,console.log(e.responseMsg)}function Ht(){Ut.JS_SetWindowControlCallback({cbIntegrationCallBack:Vt}),Ut.JS_StartService("window",{dllPath:"./chain/cloudTransform.dll"}).then((function(){Ut.JS_CreateWnd("playWnd",900,500).then((function(){console.log("JS_CreateWnd success")}))}))}function Gt(){console.log("cbConnectError"),Ut=null,console.error("确认本地进程是否已安装并开启成功!")}function Zt(e){console.log("cbConnectClose"),Ut=null}var Wt=new WeakSet,qt=function(){return p((function e(t){var n=this;u(this,e),m(this,Wt),f(this,"changeModel",(function(e,t){var i=n;n.switchVideo=parseInt(e),Ut&&Ut.JS_RequestInterface({funcName:"ChangeModel",arguments:encodeURI(JSON.stringify({model:e}))}).then((function(n){0==e?i.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode}):i.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode,startTime:t.startTime,endTime:t.endTime})}))})),f(this,"init",(function(e){var t=n;if(e.appKey&&e.accessToken){void 0!==e.appKey&&(n.appKey=e.appKey),void 0!==e.accessToken&&(n.accessToken=e.accessToken),void 0!==e.platformId&&(n.platformId=e.platformId);var i=f(f(f(f(f(f(f(f({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("初始化入参",i),window.ezuikitMonitor.report({protocol:"hd",appKey:e.appKey,action:1,logInfo:{argumentsPram:i}}),Ut.JS_RequestInterface({funcName:"Init",arguments:encodeURI(JSON.stringify(i))}).then((function(e){console.log(e.responseMsg),t.showTips(!0,"视频初始化成功!")}))}else t.showTips(!1,"请输入appkey和token")})),f(this,"play",(function(e){var t=n;if(e.deviceSerial&&e.channelNo){void 0!==e.deviceSerial&&(n.deviceSerial=e.deviceSerial),void 0!==e.channelNo&&(n.channelNo=e.channelNo),void 0!==e.startTime&&e.startTime&&(n.startTime=e.startTime+" 00:00:00"),void 0!==e.endTime&&e.endTime&&(n.endTime=e.endTime+" 23:59:59"),void 0!==e.validateCode&&e.validateCode&&(n.validateCode=e.validateCode);var i={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:n.startTime,endTime:n.endTime}}};"1"===t.deviceClass?(i.response.data.channelCode=t.channelNo,i.response.data.platformId=t.platformId):i.response.data.channelNo=+t.channelNo,1===n.switchVideo&&(n.startTime&&(i.response.data.startTime=n.startTime),n.endTime&&(i.response.data.endTime=n.endTime)),console.log("预览/回放入参",i),Ut.JS_RequestInterface({funcName:0===n.switchVideo?"StartPreview":"StartPlayback",arguments:encodeURI(JSON.stringify(i))}).then((function(e){console.log(e.responseMsg),t.showTips(!0,"预览/回放成功!")})).catch((function(e){console.log("开始播放:",e)}))}})),f(this,"showCBInfo",(function(e){n.callbackMessage=n.callbackMessage+JSON.stringify(e)+"\n\n",console.log(n.callbackMessage)})),f(this,"showTips",(function(e,t){})),f(this,"hideVideo",(function(){Ut.JS_HideWnd()})),f(this,"showVideo",(function(){Ut.JS_ShowWnd()})),f(this,"GetLayout",(function(){Ut.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)}))})),f(this,"capturePicture",(function(e){Ut.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)}))})),f(this,"stop",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;Ut.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)}))})),f(this,"setLayout",(function(e){var t=parseInt(e);isNaN(t)||0==t||t>=13?console.log("不支持实际布局大于16的窗口数"):(n.layout=t,Ut.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)})))})),f(this,"setSoundVolumn",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1?arguments[1]:void 0;Ut.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)}))})),f(this,"testMute",(function(){var e=parseInt(prompt("请输入窗口ID"));Ut.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)}))})),f(this,"testSelectWnd",(function(){var e=parseInt(prompt("请输入窗口ID"));Ut.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)}))})),f(this,"setVideoLevel",(function(e,t){Ut.JS_RequestInterface({funcName:"SetVideoLevel",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:1==n.switchVideo?0:parseInt(e),level:parseInt(t,10)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),f(this,"startTalk",(function(e){Ut.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)}))})),f(this,"stopTalk",(function(e){Ut.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)}))})),f(this,"startSave",(function(e){Ut.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)}))})),f(this,"stopSave",(function(e){Ut.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,Ut=function(e,t,n,i){return new WebControl({szPluginContainer:e,iServicePortStart:14510,iServicePortEnd:14519,cbConnectSuccess:t,cbConnectError:n,cbConnectClose:i})}("playWnd",Ht,Gt,Zt),function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(Wt,this,Kt).call(this)}),[{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),Ut.JS_RequestInterface({funcName:"TransFunctionResult",arguments:encodeURI(JSON.stringify(e))})}}])}();function Kt(){window.onscroll=function(){null!=Ut&&Ut.JS_Resize(900,500)},window.onresize=function(){null!=Ut&&Ut.JS_Resize(900,500)},window.onunload=function(){try{Ut.JS_HideWnd(),null!=Ut&&(Ut.JS_DestroyWnd().then((function(){console.log("JS_DestroyWnd")}),(function(){})),Ut.JS_StopService("window").then((function(){Ut.JS_Disconnect().then((function(){console.log("JS_Disconnect")}),(function(){}))})))}catch(e){console.error(e)}},window.onpagehide=function(){try{Ut.JS_HideWnd()}catch(e){console.error(e)}}}
40
- /*
41
- The MIT License (MIT)
42
-
43
- Copyright (c) 2016 Meetecho
44
-
45
- Permission is hereby granted, free of charge, to any person obtaining
46
- a copy of this software and associated documentation files (the "Software"),
47
- to deal in the Software without restriction, including without limitation
48
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
49
- and/or sell copies of the Software, and to permit persons to whom the
50
- Software is furnished to do so, subject to the following conditions:
51
-
52
- The above copyright notice and this permission notice shall be included
53
- in all copies or substantial portions of the Software.
54
-
55
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
56
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
58
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
59
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
60
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
61
- OTHER DEALINGS IN THE SOFTWARE.
62
- */Yt.sessions={},Yt.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||Yt.extension.isInstalled()}return!0};var Jt={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 n=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var i=new Error("NavigatorUserMediaError");i.name="You cancelled the request for permission, giving up...",n(i)}else n(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&(console.log("clearing ",t.data.id),window.clearTimeout(t.data.id))}))}};function Yt(e,t){if(void 0===Yt.initDone)return e.error("Library not initialized"),{};if(!Yt.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(Yt.log("Library initialized: "+Yt.initDone),(e=e||{}).success="function"==typeof e.success?e.success:Yt.noop,e.error="function"==typeof e.error?e.error:Yt.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:Yt.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var n=!1,i=null,o={},a=null,r=null,s=0,c=e.server;Yt.isArray(c)?(Yt.log("Multiple servers provided ("+c.length+"), will use the first that works"),c=null,r=e.server,Yt.debug(r)):0===c.indexOf("ws")?(n=!0,Yt.log("Using WebSockets to contact Janus: "+c)):(n=!1,Yt.log("Using REST API to contact Janus: "+c));var l=e.iceServers;null==l&&(l=[{urls:"stun:stun.l.google.com:19302"}]);var d=e.iceTransportPolicy,u=e.bundlePolicy,m=e.ipv6;null==m&&(m=!1);var h=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(h=!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 g=null;void 0!==e.token&&null!==e.token&&(g=e.token);var f=null;void 0!==e.apisecret&&null!==e.apisecret&&(f=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var v=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(v=e.keepAlivePeriod),isNaN(v)&&(v=25e3);var y=6e4;function S(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&&(y=e.longPollTimeout),isNaN(y)&&(y=6e4);var _=!1,b=null,w={},E=this,P=0,k={};function C(){if(null!=b)if(Yt.debug("Long poll..."),_){var t=c+"/"+b+"?rid="+(new Date).getTime();null!=p&&(t=t+"&maxev="+p),null!=g&&(t=t+"&token="+encodeURIComponent(g)),null!=f&&(t=t+"&apisecret="+encodeURIComponent(f)),Yt.httpAPICall(t,{verb:"GET",withCredentials:h,success:I,timeout:y,error:function(t,n){if(Yt.error(t+":",n),++P>3)return _=!1,void e.error("Lost connection to the server (is it down?)");C()}})}else Yt.warn("Is the server down? (connected=false)")}function I(e,t){if(P=0,n||null==b||!0===t||C(),n||!Yt.isArray(e))if("keepalive"!==e.rtcgw)if("ack"!==e.rtcgw)if("success"!==e.rtcgw)if("trickle"===e.rtcgw){if(null==(c=e.sender))return void Yt.warn("Missing sender...");if(null==(d=w[c]))return void Yt.debug("This handle is not attached to this session");var o=e.candidate;Yt.debug("Got a trickled candidate on session "+b),Yt.debug(o);var a=d.webrtcStuff;a.pc&&a.remoteSdp?(Yt.debug("Adding remote candidate:",o),o&&!0!==o.completed?a.pc.addIceCandidate(o):a.pc.addIceCandidate(Yt.endOfCandidates)):(Yt.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),a.candidates||(a.candidates=[]),a.candidates.push(o),Yt.debug(a.candidates))}else{if("webrtcup"===e.rtcgw)return Yt.debug("Got a webrtcup event on session "+b),Yt.debug(e),null==(c=e.sender)?void Yt.warn("Missing sender..."):null==(d=w[c])?void Yt.debug("This handle is not attached to this session"):void d.webrtcState(!0);if("hangup"===e.rtcgw){if(Yt.debug("Got a hangup event on session "+b),Yt.debug(e),null==(c=e.sender))return void Yt.warn("Missing sender...");if(null==(d=w[c]))return void Yt.debug("This handle is not attached to this session");d.webrtcState(!1,e.reason),d.hangup()}else if("detached"===e.rtcgw){if(Yt.debug("Got a detached event on session "+b),Yt.debug(e),null==(c=e.sender))return void Yt.warn("Missing sender...");if(null==(d=w[c]))return;d.detached=!0,d.ondetached(),d.detach()}else if("media"===e.rtcgw){if(Yt.debug("Got a media event on session "+b),Yt.debug(e),null==(c=e.sender))return void Yt.warn("Missing sender...");if(null==(d=w[c]))return void Yt.debug("This handle is not attached to this session");d.mediaState(e.type,e.receiving)}else if("slowlink"===e.rtcgw){if(Yt.debug("Got a slowlink event on session "+b),Yt.debug(e),console.log("json的所有信息打印-----------------------------------------------",e),null==(c=e.sender))return void Yt.warn("Missing sender...");if(null==(d=w[c]))return void Yt.debug("This handle is not attached to this session");d.slowLink(e.uplink,e.lost)}else{if("error"===e.rtcgw){var r,s;if(Yt.error("Ooops: "+e.error.code+" "+e.error.reason),Yt.debug(e),null!=(r=e.transaction))null!=(s=k[r])&&s(e),delete k[r];return}if("event"===e.rtcgw){var c;if(Yt.debug("Got a plugin event on session "+b),Yt.debug(e),null==(c=e.sender))return void Yt.warn("Missing sender...");var l=e.plugindata;if(null==l)return void Yt.warn("Missing plugindata...");Yt.debug(" -- Event is coming from "+c+" ("+l.plugin+")");var d,u=l.data;if(Yt.debug(u),null==(d=w[c]))return void Yt.warn("This handle is not attached to this session");var m=e.jsep;null!=m&&(Yt.debug("Handling SDP as well..."),Yt.debug(m));var h=d.onmessage;null!=h?(Yt.debug("Notifying application..."),h(u,m)):Yt.debug("No provided notification callback")}else{if("timeout"===e.rtcgw)return Yt.error("Timeout on session "+b),Yt.debug(e),void(n&&i.close(3504,"Gateway timeout"));Yt.warn("Unknown message/event '"+e.rtcgw+"' on session "+b),Yt.debug(e)}}}else Yt.debug("Got a success on session "+b),Yt.debug(e),null!=(r=e.transaction)&&(null!=(s=k[r])&&s(e),delete k[r]);else Yt.debug("Got an ack on session "+b),Yt.debug(e),null!=(r=e.transaction)&&(null!=(s=k[r])&&s(e),delete k[r]);else Yt.vdebug("Got a keepalive on session "+b);else for(var p=0;p<e.length;p++)I(e[p],!0)}function x(){if(null!==c&&n&&_){a=setTimeout(x,v);var e={rtcgw:"keepalive",session_id:b,transaction:Yt.randomString(12)};null!=g&&(e.token=g),null!=f&&(e.apisecret=f),i.send(JSON.stringify(e))}}function j(e){var l=Yt.randomString(12),d={rtcgw:"create",transaction:l,token:"testtoken"};if(d=Object.assign({},d,t),e.reconnect&&(_=!1,d.rtcgw="claim",d.session_id=b,i&&(i.onopen=null,i.onerror=null,i.onclose=null,a&&(clearTimeout(a),a=null))),null!=g&&(d.token=g),null!=f&&(d.apisecret=f),null===c&&Yt.isArray(r)&&(0===(c=r[s]).indexOf("ws")?(n=!0,Yt.log("Server #"+(s+1)+": trying WebSockets to contact Janus ("+c+")")):(n=!1,Yt.log("Server #"+(s+1)+": trying REST API to contact Janus ("+c+")"))),n)for(var u in i=Yt.newWebSocket(c,"rtcgw-protocol"),o={error:function(){if(Yt.error("Error connecting to the Janus WebSockets server... "+c),Yt.isArray(r)&&!e.reconnect)return++s==r.length?void e.error("Error connecting to any of the provided Janus servers: Is the server down?"):(c=null,void setTimeout((function(){j(e)}),200));e.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){k[l]=function(t){if(Yt.debug(t),"success"!==t.rtcgw)return Yt.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error(t.error.reason);a=setTimeout(x,v),_=!0,b=t.session_id?t.session_id:t.data.id,e.reconnect?Yt.log("Claimed session: "+b):Yt.log("Created session: "+b),Yt.sessions[b]=E,e.success(b)},i.send(JSON.stringify(d))},message:function(e){I(JSON.parse(e.data))}})i.addEventListener(u,o[u]);else Yt.httpAPICall(c,{verb:"POST",withCredentials:h,body:d,success:function(t){if(Yt.debug(t),"success"!==t.rtcgw)return Yt.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error(t.error.reason);_=!0,b=t.session_id?t.session_id:t.data.id,e.reconnect?Yt.log("Claimed session: "+b):Yt.log("Created session: "+b),Yt.sessions[b]=E,C(),e.success()},error:function(t,n){if(Yt.error(t+":",n),Yt.isArray(r)&&!e.reconnect)return++s==r.length?void e.error("Error connecting to any of the provided Janus servers: Is the server down?"):(c=null,void setTimeout((function(){j(e)}),200));""===n?e.error(t+": Is the server down?"):e.error(t+": "+n)}})}function A(e,t){if((t=t||{}).success="function"==typeof t.success?t.success:Yt.noop,t.error="function"==typeof t.error?t.error:Yt.noop,!_)return Yt.warn("Is the server down? (connected=false)"),void t.error("Is the server down? (connected=false)");var o=w[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return Yt.warn("Invalid handle"),void t.error("Invalid handle");var a=t.message,r=t.jsep,s=Yt.randomString(12),l={rtcgw:"message",body:a,transaction:s};if(null!==o.token&&void 0!==o.token&&(l.token=o.token),null!=f&&(l.apisecret=f),null!=r&&(l.jsep=r),Yt.debug("Sending message to plugin (handle="+e+"):"),Yt.debug(l),n)return l.session_id=b,l.handle_id=e,k[s]=function(e){if(Yt.debug("Message sent!"),Yt.debug(e),"success"===e.rtcgw){var n=e.plugindata;if(null==n)return Yt.warn("Request succeeded, but missing plugindata..."),void t.success();Yt.log("Synchronous transaction successful ("+n.plugin+")");var i=n.data;return Yt.debug(i),void t.success(i)}"ack"===e.rtcgw?t.success():void 0!==e.error&&null!==e.error?(Yt.error("Ooops: "+e.error.code+" "+e.error.reason),t.error(e.error.code+" "+e.error.reason)):(Yt.error("Unknown error"),t.error("Unknown error"))},void i.send(JSON.stringify(l));Yt.httpAPICall(c+"/"+b+"/"+e,{verb:"POST",withCredentials:h,body:l,success:function(e){if(Yt.debug("Message sent!"),Yt.debug(e),"success"===e.rtcgw){var n=e.plugindata;if(null==n)return Yt.warn("Request succeeded, but missing plugindata..."),void t.success();Yt.log("Synchronous transaction successful ("+n.plugin+")");var i=n.data;return Yt.debug(i),void t.success(i)}"ack"===e.rtcgw?t.success():void 0!==e.error&&null!==e.error?(Yt.error("Ooops: "+e.error.code+" "+e.error.reason),t.error(e.error.code+" "+e.error.reason)):(Yt.error("Unknown error"),t.error("Unknown error"))},error:function(e,n){Yt.error(e+":",n),t.error(e+": "+n)}})}function D(e,t){if(_){var o=w[e];if(null!=o&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){var a={rtcgw:"trickle",candidate:t,transaction:Yt.randomString(12)};if(null!==o.token&&void 0!==o.token&&(a.token=o.token),null!=f&&(a.apisecret=f),Yt.vdebug("Sending trickle candidate (handle="+e+"):"),Yt.vdebug(a),n)return a.session_id=b,a.handle_id=e,void i.send(JSON.stringify(a));Yt.httpAPICall(c+"/"+b+"/"+e,{verb:"POST",withCredentials:h,body:a,success:function(e){Yt.vdebug("Candidate sent!"),Yt.vdebug(e),"ack"===e.rtcgw||Yt.error("Ooops: "+e.error.code+" "+e.error.reason)},error:function(e,t){Yt.error(e+":",t)}})}else Yt.warn("Invalid handle")}else Yt.warn("Is the server down? (connected=false)")}function R(e,t,n,i){var o=w[e];if(null!=o&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){var a=o.webrtcStuff,r=function(e){Yt.log("Received state change on data channel:",e);var t=e.target.label,n=a.dataChannel[t]?a.dataChannel[t].readyState:"null";if(Yt.log("State change on <"+t+"> data channel: "+n),"open"===n){if(a.dataChannel[t].pending&&a.dataChannel[t].pending.length>0){for(var i in Yt.log("Sending pending messages on <"+t+">:",a.dataChannel[t].pending.length),a.dataChannel[t].pending){var r=a.dataChannel[t].pending[i];Yt.log("Sending string on data channel <"+t+">: "+r),a.dataChannel[t].send(r)}a.dataChannel[t].pending=[]}o.ondataopen(t)}};a.dataChannel[t]=n||a.pc.createDataChannel(t,{ordered:!1}),a.dataChannel[t].onmessage=function(e){Yt.log("Received message on data channel:",e);var t=e.target.label;o.ondata(e.data,t)},a.dataChannel[t].onopen=r,a.dataChannel[t].onclose=r,a.dataChannel[t].onerror=function(e){Yt.error("Got error on data channel:",e)},a.dataChannel[t].pending=[],i&&a.dataChannel[t].pending.push(i)}else Yt.warn("Invalid handle")}function L(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Yt.noop,t.error="function"==typeof t.error?t.error:Yt.noop;var n=w[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Yt.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff,o=t.text;if(null==o)return Yt.warn("Invalid text"),void t.error("Invalid text");var a=t.label?t.label:Yt.dataChanDefaultLabel;return i.dataChannel[a]?"open"!==i.dataChannel[a].readyState?(i.dataChannel[a].pending.push(o),void t.success()):(Yt.log("Sending string on data channel <"+a+">: "+o),i.dataChannel[a].send(o),void t.success()):(R(e,a,!1,o),void t.success())}function B(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Yt.noop,t.error="function"==typeof t.error?t.error:Yt.noop;var n=w[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Yt.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff;if(null===i.dtmfSender||void 0===i.dtmfSender){if(void 0!==i.pc&&null!==i.pc){var o=i.pc.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(!o)return Yt.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=o.dtmf,i.dtmfSender&&(Yt.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(e){Yt.debug("Sent DTMF tone: "+e.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return Yt.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var a=t.dtmf;if(null==a)return Yt.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var r=a.tones;if(null==r)return Yt.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var s=a.duration;null==s&&(s=500);var c=a.gap;null==c&&(c=50),Yt.debug("Sending DTMF string "+r+" (duration "+s+"ms, gap "+c+"ms)"),i.dtmfSender.insertDTMF(r,s,c),t.success()}function M(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Yt.noop,t.error="function"==typeof t.error?t.error:Yt.noop;var o=!0;void 0!==t.asyncRequest&&null!==t.asyncRequest&&(o=!0===t.asyncRequest);var a=!0;void 0!==t.noRequest&&null!==t.noRequest&&(a=!0===t.noRequest),Yt.log("Destroying handle "+e+" (async="+o+")"),W(e);var r=w[e];if(null==r||r.detached)return delete w[e],void t.success();if(a)return delete w[e],void t.success();if(!_)return Yt.warn("Is the server down? (connected=false)"),void t.error("Is the server down? (connected=false)");var s={rtcgw:"detach",transaction:Yt.randomString(12)};if(null!==r.token&&void 0!==r.token&&(s.token=r.token),null!=f&&(s.apisecret=f),n)return s.session_id=b,s.handle_id=e,i.send(JSON.stringify(s)),delete w[e],void t.success();Yt.httpAPICall(c+"/"+b+"/"+e,{verb:"POST",async:o,withCredentials:h,body:s,success:function(n){Yt.log("Destroyed handle:"),Yt.debug(n),"success"!==n.rtcgw&&Yt.error("Ooops: "+n.error.code+" "+n.error.reason),delete w[e],t.success()},error:function(n,i){Yt.error(n+":",i),delete w[e],t.success()}})}function O(e,t,n,i,o){var a=w[e];if(null==a||null===a.webrtcStuff||void 0===a.webrtcStuff)return Yt.warn("Invalid handle"),void i.error("Invalid handle");var r=a.webrtcStuff;Yt.debug("streamsDone:",o),o&&(Yt.debug(" -- Audio tracks:",o.getAudioTracks()),Yt.debug(" -- Video tracks:",o.getVideoTracks()));var s=!1;if(r.myStream&&n.update&&!r.streamExternal){if((!n.update&&q(n)||n.update&&(n.addAudio||n.replaceAudio))&&o.getAudioTracks()&&o.getAudioTracks().length)if(r.myStream.addTrack(o.getAudioTracks()[0]),Yt.unifiedPlan){Yt.log((n.replaceAudio?"Replacing":"Adding")+" audio track:",o.getAudioTracks()[0]);var c=null;if((p=r.pc.getTransceivers())&&p.length>0)for(var h in p){if((f=p[h]).sender&&f.sender.track&&"audio"===f.sender.track.kind||f.receiver&&f.receiver.track&&"audio"===f.receiver.track.kind){c=f;break}}c&&c.sender?c.sender.replaceTrack(o.getAudioTracks()[0]):r.pc.addTrack(o.getAudioTracks()[0],o)}else Yt.log((n.replaceAudio?"Replacing":"Adding")+" audio track:",o.getAudioTracks()[0]),r.pc.addTrack(o.getAudioTracks()[0],o);if((!n.update&&J(n)||n.update&&(n.addVideo||n.replaceVideo))&&o.getVideoTracks()&&o.getVideoTracks().length)if(r.myStream.addTrack(o.getVideoTracks()[0]),Yt.unifiedPlan){Yt.log((n.replaceVideo?"Replacing":"Adding")+" video track:",o.getVideoTracks()[0]);var p,g=null;if((p=r.pc.getTransceivers())&&p.length>0)for(var h in p){var f;if((f=p[h]).sender&&f.sender.track&&"video"===f.sender.track.kind||f.receiver&&f.receiver.track&&"video"===f.receiver.track.kind){g=f;break}}g&&g.sender?g.sender.replaceTrack(o.getVideoTracks()[0]):r.pc.addTrack(o.getVideoTracks()[0],o)}else Yt.log((n.replaceVideo?"Replacing":"Adding")+" video track:",o.getVideoTracks()[0]),r.pc.addTrack(o.getVideoTracks()[0],o)}else r.myStream=o,s=!0;if(!r.pc){var v={iceServers:l,iceTransportPolicy:d,bundlePolicy:u};"chrome"===Yt.webRTCAdapter.browserDetails.browser&&(v.sdpSemantics=Yt.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan");var y={optional:[{DtlsSrtpKeyAgreement:!0}]};if(!0===m&&y.optional.push({googIPv6:!0}),i.rtcConstraints&&"object"===T(i.rtcConstraints))for(var h in Yt.debug("Adding custom PeerConnection constraints:",i.rtcConstraints),i.rtcConstraints)y.optional.push(i.rtcConstraints[h]);"edge"===Yt.webRTCAdapter.browserDetails.browser&&(v.bundlePolicy="max-bundle"),Yt.log("Creating PeerConnection"),Yt.debug(y),r.pc=new RTCPeerConnection(v,y),Yt.debug(r.pc),r.pc.getStats&&(r.volume={},r.bitrate.value="0 kbits/sec"),Yt.log("Preparing local SDP and gathering candidates (trickle="+r.trickle+")"),r.pc.oniceconnectionstatechange=function(e){r.pc&&a.iceState(r.pc.iceConnectionState)},r.pc.onicecandidate=function(t){if(null==t.candidate||"edge"===Yt.webRTCAdapter.browserDetails.browser&&t.candidate.candidate.indexOf("endOfCandidates")>0)Yt.log("End of candidates."),r.iceDone=!0,!0===r.trickle?D(e,{completed:!0}):function(e,t){t=t||{},t.success="function"==typeof t.success?t.success:Yt.noop,t.error="function"==typeof t.error?t.error:Yt.noop;var n=w[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return void Yt.warn("Invalid handle, not sending anything");var i=n.webrtcStuff;if(Yt.log("Sending offer/answer SDP..."),null===i.mySdp||void 0===i.mySdp)return void Yt.warn("Local SDP instance is invalid, not sending anything...");i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp.trickle=!1);Yt.debug(t),i.sdpSent=!0,t.success(i.mySdp)}(e,i);else{var n={candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex};!0===r.trickle&&D(e,n)}},r.pc.ontrack=function(e){Yt.log("Handling Remote Track"),Yt.debug(e),e.streams&&(r.remoteStream=e.streams[0],a.onremotestream(r.remoteStream),e.track.onended||(Yt.log("Adding onended callback to track:",e.track),e.track.onended=function(e){Yt.log("Remote track muted/removed:",e),r.remoteStream&&(r.remoteStream.removeTrack(e.target),a.onremotestream(r.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){try{r.remoteStream.addTrack(e.target),a.onremotestream(r.remoteStream)}catch(e){Yt.error(e)}}))}}if(s&&null!=o)if(Yt.log("Adding local stream"),console.log("callbacks",i),"screen"==i.media.video){var _=!0===i.simulcast2;o.getTracks().forEach((function(e){if(e.applyConstraints({frameRate:5}),_)if("audio"===e.kind)r.pc.addTrack(e,o);else{Yt.log("Enabling rid-based simulcasting:",e);var t=S(i.simulcastMaxBitrates);r.pc.addTransceiver(e,{direction:"sendrecv",streams:[o],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 r.pc.addTrack(e,o)}))}else{_=!0===i.simulcast2;var b=o.getTracks(),E=b[0];if(E){var P=E.getSettings();console.log("videoTrack",E),console.log("videosettings",P)}var k=o.getAudioTracks()[0];if(k){var C=k.getSettings();console.log("audiosettings",C)}b.forEach((function(e){if(e.applyConstraints({frameRate:{max:i.frameRate}}),_){r.pc.addTrack(e,o);var t=null,n=r.pc.getSenders();for(var a in n){var s=n[a];s&&s.track&&"video"===s.track.kind&&(t=s)}var c=null;t&&(c=t.getParameters()),c&&c.encodings&&(c.encodings[0].maxBitrate=1e5,t.setParameters(c).then((function(e){console.log("Successed to set parameters!",c)})).catch((function(e){console.log("err",e),console.error(e)})))}else if("audio"===e.kind)r.pc.addTrack(e,o);else{Yt.log("Enabling rid-based simulcasting:",e);var l=i.bitrate||1e5;r.pc.addTransceiver(e,{direction:"sendrecv",streams:[o],sendEncodings:[{rid:"h",active:!0,maxBitrate:l}]})}}))}(function(e){if(Yt.debug("isDataEnabled:",e),"edge"==Yt.webRTCAdapter.browserDetails.browser)return Yt.warn("Edge doesn't support data channels yet"),!1;return null!=e&&!0===e.data})(n)&&!r.dataChannel[Yt.dataChanDefaultLabel]&&(Yt.log("Creating data channel"),R(e,Yt.dataChanDefaultLabel,!1),r.pc.ondatachannel=function(t){Yt.log("Data channel created by Janus:",t),R(e,t.channel.label,t.channel)}),r.myStream&&a.onlocalstream(r.myStream),null==t?function(e,t,n){n=n||{},n.success="function"==typeof n.success?n.success:Yt.noop,n.error="function"==typeof n.error?n.error:Yt.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Yt.noop;var i=w[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Yt.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,a=!0===n.simulcast;a?Yt.log("Creating offer (iceDone="+o.iceDone+", simulcast="+a+")"):Yt.log("Creating offer (iceDone="+o.iceDone+")");var r={};if(Yt.unifiedPlan){var s=null,c=null,l=o.pc.getTransceivers();if(l&&l.length>0)for(var d in l){var u=l[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)&&(c||(c=u))}var m=q(t),h=K(t);m||h?m&&h?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Yt.log("Setting audio transceiver to sendrecv:",s)):m&&!h?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Yt.log("Setting audio transceiver to sendonly:",s)):!m&&h&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Yt.log("Setting audio transceiver to recvonly:",s)):(s=o.pc.addTransceiver("audio",{direction:"recvonly"}),Yt.log("Adding recvonly audio transceiver:",s))):t.removeAudio&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",Yt.log("Setting audio transceiver to inactive:",s));var p=J(t),g=Y(t);p||g?p&&g?c&&(c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",Yt.log("Setting video transceiver to sendrecv:",c)):p&&!g?c&&(c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",Yt.log("Setting video transceiver to sendonly:",c)):!p&&g&&(c?(c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",Yt.log("Setting video transceiver to recvonly:",c)):(c=o.pc.addTransceiver("video",{direction:"recvonly"}),Yt.log("Adding recvonly video transceiver:",c))):t.removeVideo&&c&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive",Yt.log("Setting video transceiver to inactive:",c))}else r.offerToReceiveAudio=K(t),r.offerToReceiveVideo=Y(t);var f=!0===n.iceRestart;f&&(r.iceRestart=!0);Yt.debug(r);var v=J(t);if(v&&a&&"firefox"===Yt.webRTCAdapter.browserDetails.browser){Yt.log("Enabling Simulcasting for Firefox (RID)");var y=o.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(y){var _=y.getParameters();_||(_={});var b=S(n.simulcastMaxBitrates);_.encodings=[{rid:"h",active:!0,maxBitrate:b.high},{rid:"m",active:!0,maxBitrate:b.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:b.low,scaleResolutionDownBy:4}],y.setParameters(_)}}o.pc.createOffer(r).then((function(e){Yt.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Yt.log("Setting local description"),v&&a&&("chrome"===Yt.webRTCAdapter.browserDetails.browser||"safari"===Yt.webRTCAdapter.browserDetails.browser?(Yt.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=function(e){for(var t=e.split("\r\n"),n=!1,i=[-1],o=[-1],a=null,r=null,s=null,c=null,l=-1,d=0;d<t.length;d++){if(m=t[d].match(/m=(\w+) */)){if("video"===m[1]){if(!(i[0]<0)){l=d;break}n=!0}else if(i[0]>-1){l=d;break}}else if(n){var u=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(u)i[0]=u[1],o[0]=u[2],t.splice(d,1),d--;else{if(i[0]){if((p=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(c=p[1]),0===t[d].indexOf("a=ssrc:"+o[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(i[0]<0){l=-1,n=!1;for(d=0;d<t.length;d++){var m;if(m=t[d].match(/m=(\w+) */)){if("video"===m[1]){if(!(i[0]<0)){l=d;break}n=!0}else if(i[0]>-1){l=d;break}}else if(n){if(i[0]<0){var h=t[d].match(/a=ssrc:(\d+)/);if(h){i[0]=h[1],t.splice(d,1),d--;continue}}else{var p;if((p=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(c=p[1]),0===t[d].indexOf("a=ssrc:"+o[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(i[0]<0)return Yt.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;l<0&&(l=t.length);i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),o[1]=Math.floor(4294967295*Math.random()),o[2]=Math.floor(4294967295*Math.random());for(d=0;d<i.length;d++)a&&(t.splice(l,0,"a=ssrc:"+i[d]+" cname:"+a),l++),r&&(t.splice(l,0,"a=ssrc:"+i[d]+" msid:"+r),l++),s&&(t.splice(l,0,"a=ssrc:"+i[d]+" mslabel:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+i[d]+" label:"+c),l++),a&&(t.splice(l,0,"a=ssrc:"+o[d]+" cname:"+a),l++),r&&(t.splice(l,0,"a=ssrc:"+o[d]+" msid:"+r),l++),s&&(t.splice(l,0,"a=ssrc:"+o[d]+" mslabel:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+o[d]+" label:"+c),l++);t.splice(l,0,"a=ssrc-group:FID "+i[2]+" "+o[2]),t.splice(l,0,"a=ssrc-group:FID "+i[1]+" "+o[1]),t.splice(l,0,"a=ssrc-group:FID "+i[0]+" "+o[0]),t.splice(l,0,"a=ssrc-group:SIM "+i[0]+" "+i[1]+" "+i[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n");return e}(e.sdp)):"firefox"!==Yt.webRTCAdapter.browserDetails.browser&&Yt.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e).catch(n.error),o.mediaConstraints=r,o.iceDone||o.trickle?(Yt.log("Offer ready"),Yt.debug(n),n.success(e)):Yt.log("Waiting for all candidates...")}),n.error)}(e,n,i):r.pc.setRemoteDescription(t).then((function(){if(Yt.log("Remote description accepted!"),r.remoteSdp=t.sdp,r.candidates&&r.candidates.length>0){for(var o=0;o<r.candidates.length;o++){var a=r.candidates[o];Yt.debug("Adding remote candidate:",a),a&&!0!==a.completed?r.pc.addIceCandidate(a):r.pc.addIceCandidate(Yt.endOfCandidates)}r.candidates=[]}!function(e,t,n){n=n||{},n.success="function"==typeof n.success?n.success:Yt.noop,n.error="function"==typeof n.error?n.error:Yt.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Yt.noop;var i=w[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Yt.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,a=!0===n.simulcast;a?Yt.log("Creating answer (iceDone="+o.iceDone+", simulcast="+a+")"):Yt.log("Creating answer (iceDone="+o.iceDone+")");var r=null;if(Yt.unifiedPlan){r={};var s=null,c=null,l=o.pc.getTransceivers();if(l&&l.length>0)for(var d in l){var u=l[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)&&(c||(c=u))}var m=q(t),h=K(t);if(m||h){if(m&&h){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Yt.log("Setting audio transceiver to sendrecv:",s)}catch(e){Yt.error(e)}}else if(m&&!h)try{s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Yt.log("Setting audio transceiver to sendonly:",s))}catch(e){Yt.error(e)}else if(!m&&h)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Yt.log("Setting audio transceiver to recvonly:",s)}catch(e){Yt.error(e)}else s=o.pc.addTransceiver("audio",{direction:"recvonly"}),Yt.log("Adding recvonly audio transceiver:",s)}else if(t.removeAudio&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",Yt.log("Setting audio transceiver to inactive:",s)}catch(e){Yt.error(e)}var p=J(t),g=Y(t);if(p||g){if(p&&g){if(c)try{c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",Yt.log("Setting video transceiver to sendrecv:",c)}catch(e){Yt.error(e)}}else if(p&&!g){if(c)try{c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",Yt.log("Setting video transceiver to sendonly:",c)}catch(e){Yt.error(e)}}else if(!p&&g)if(c)try{c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",Yt.log("Setting video transceiver to recvonly:",c)}catch(e){Yt.error(e)}else c=o.pc.addTransceiver("video",{direction:"recvonly"}),Yt.log("Adding recvonly video transceiver:",c)}else if(t.removeVideo&&c)try{c.setDirection?c.setDirection("inactive"):c.direction="inactive",Yt.log("Setting video transceiver to inactive:",c)}catch(e){Yt.error(e)}}else r="firefox"==Yt.webRTCAdapter.browserDetails.browser||"edge"==Yt.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:K(t),offerToReceiveVideo:Y(t)}:{mandatory:{OfferToReceiveAudio:K(t),OfferToReceiveVideo:Y(t)}};Yt.debug(r);var f=J(t);if(f&&a&&"firefox"===Yt.webRTCAdapter.browserDetails.browser){Yt.log("Enabling Simulcasting for Firefox (RID)");var v=o.pc.getSenders()[1];Yt.log(v);var y=v.getParameters();Yt.log(y);var _=S(n.simulcastMaxBitrates);v.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:_.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:_.medium},{rid:"low",active:!0,priority:"low",maxBitrate:_.low}]})}o.pc.createAnswer(r).then((function(e){Yt.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Yt.log("Setting local description"),f&&a&&("chrome"===Yt.webRTCAdapter.browserDetails.browser?Yt.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==Yt.webRTCAdapter.browserDetails.browser&&Yt.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e).catch(n.error),o.mediaConstraints=r,o.iceDone||o.trickle?n.success(e):Yt.log("Waiting for all candidates...")}),n.error)}(e,n,i)}),i.error)}function z(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Yt.noop,n.error="function"==typeof n.error?n.error:Z;var i=n.jsep;if(t&&i)return Yt.error("Provided a JSEP to a createOffer"),void n.error("Provided a JSEP to a createOffer");if(!(t||i&&i.type&&i.sdp))return Yt.error("A valid JSEP is required for createAnswer"),void n.error("A valid JSEP is required for createAnswer");n.media=n.media||{audio:!0,video:!0};var o=n.media,a=w[e];if(null==a||null===a.webrtcStuff||void 0===a.webrtcStuff)return Yt.warn("Invalid handle"),void n.error("Invalid handle");var r,s=a.webrtcStuff;if(s.trickle=(r=n.trickle,Yt.debug("isTrickleEnabled:",r),null==r||!0===r),void 0===s.pc||null===s.pc)o.update=!1,o.keepAudio=!1,o.keepVideo=!1;else if(void 0!==s.pc&&null!==s.pc){if(Yt.log("Updating existing media session"),o.update=!0,null!==n.stream&&void 0!==n.stream)n.stream!==s.myStream&&Yt.log("Renegotiation involves a new external stream");else{if(o.addAudio){if(o.keepAudio=!1,o.replaceAudio=!1,o.removeAudio=!1,o.audioSend=!0,s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length)return Yt.error("Can't add audio stream, there already is one"),void n.error("Can't add audio stream, there already is one")}else o.removeAudio?(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!1,o.audioSend=!1):o.replaceAudio&&(o.keepAudio=!1,o.addAudio=!1,o.removeAudio=!1,o.audioSend=!0);if(null===s.myStream||void 0===s.myStream?(o.replaceAudio&&(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!0,o.audioSend=!0),q(o)&&(o.keepAudio=!1,o.addAudio=!0)):null===s.myStream.getAudioTracks()||void 0===s.myStream.getAudioTracks()||0===s.myStream.getAudioTracks().length?(o.replaceAudio&&(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!0,o.audioSend=!0),q(o)&&(o.keepVideo=!1,o.addAudio=!0)):!q(o)||o.removeAudio||o.replaceAudio||(o.keepAudio=!0),o.addVideo){if(o.keepVideo=!1,o.replaceVideo=!1,o.removeVideo=!1,o.videoSend=!0,s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length)return Yt.error("Can't add video stream, there already is one"),void n.error("Can't add video stream, there already is one")}else o.removeVideo?(o.keepVideo=!1,o.replaceVideo=!1,o.addVideo=!1,o.videoSend=!1):o.replaceVideo&&(o.keepVideo=!1,o.addVideo=!1,o.removeVideo=!1,o.videoSend=!0);null===s.myStream||void 0===s.myStream||null===s.myStream.getVideoTracks()||void 0===s.myStream.getVideoTracks()||0===s.myStream.getVideoTracks().length?(o.replaceVideo&&(o.keepVideo=!1,o.replaceVideo=!1,o.addVideo=!0,o.videoSend=!0),J(o)&&(o.keepVideo=!1,o.addVideo=!0)):!J(o)||o.removeVideo||o.replaceVideo||(o.keepVideo=!0),o.addData&&(o.data=!0)}if(q(o)&&o.keepAudio&&J(o)&&o.keepVideo)return a.consentDialog(!1),void O(e,i,o,n,s.myStream)}if(o.update&&!s.streamExternal){if(o.removeAudio||o.replaceAudio){if(s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length){var c=s.myStream.getAudioTracks()[0];Yt.log("Removing audio track:",c),s.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var l=!0;if(o.replaceAudio&&Yt.unifiedPlan&&(l=!1),l)for(var d in s.pc.getSenders()){(c=s.pc.getSenders()[d])&&c.track&&"audio"===c.track.kind&&(Yt.log("Removing audio sender:",c),s.pc.removeTrack(c))}}}if(o.removeVideo||o.replaceVideo){if(s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length){c=s.myStream.getVideoTracks()[0];Yt.log("Removing video track:",c),s.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var u=!0;if(o.replaceVideo&&Yt.unifiedPlan&&(u=!1),u)for(var d in s.pc.getSenders()){(c=s.pc.getSenders()[d])&&c.track&&"video"===c.track.kind&&(Yt.log("Removing video sender:",c),s.pc.removeTrack(c))}}}}if(null!==n.stream&&void 0!==n.stream){var m=n.stream;if(Yt.log("MediaStream provided by the application"),Yt.debug(m),o.update&&s.myStream&&s.myStream!==n.stream&&!s.streamExternal){try{var h=s.myStream.getTracks();for(var p in h){var g=h[p];Yt.log(g),null!=g&&g.stop()}}catch(e){}s.myStream=null}return s.streamExternal=!0,a.consentDialog(!1),void O(e,i,o,n,m)}if(q(o)||J(o)){if(!Yt.isGetUserMediaAvailable())return void n.error("getUserMedia not available");var f={mandatory:{},optional:[]};a.consentDialog(!0);var v=q(o);!0===v&&null!=o&&null!=o&&"object"===T(o.audio)&&(v=o.audio);var y=J(o);if(!0===y&&null!=o&&null!=o){var S=!0===n.simulcast,_=!0===n.simulcast2;if(!S&&!_||i||void 0!==o.video&&!1!==o.video||(o.video="hires"),o.video&&"screen"!=o.video&&"window"!=o.video)if("object"===T(o.video))y=o.video;else{var b=0,E=0;"lowres"===o.video?(E=240,b=320):"lowres-16:9"===o.video?(E=180,b=320):"hires"===o.video||"hires-16:9"===o.video||"hdres"===o.video?(E=720,b=1280):"fhdres"===o.video?(E=1080,b=1920):"4kres"===o.video?(E=2160,b=3840):"stdres"===o.video?(E=480,b=640):"stdres-16:9"===o.video?(E=360,b=640):(Yt.log("Default video setting is stdres 4:3"),E=480,b=640),Yt.log("Adding media constraint:",o.video),y={height:{ideal:E},width:{ideal:b}},Yt.log("Adding video constraint:",y)}else if("screen"===o.video||"window"===o.video){var P=function(t,r){a.consentDialog(!1),t?n.error(t):O(e,i,o,n,r)},k=function(e,t,n){Yt.log("Adding media constraint (screen capture)"),Yt.debug(e),navigator.mediaDevices.getUserMedia(e).then((function(e){n?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(n){e.addTrack(n.getAudioTracks()[0]),t(null,e)})):t(null,e)})).catch((function(e){a.consentDialog(!1),t(e)}))};if(o.screenshareFrameRate||(o.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){a.consentDialog(!1),q(o)&&!o.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(a){t.addTrack(a.getAudioTracks()[0]),O(e,i,o,n,t)})):O(e,i,o,n,t)}),(function(e){a.consentDialog(!1),n.error(e)}));if("chrome"===Yt.webRTCAdapter.browserDetails.browser){var C=Yt.webRTCAdapter.browserDetails.version,I=33;window.navigator.userAgent.match("Linux")&&(I=35),C>=26&&C<=I?(f={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate,chromeMediaSource:"screen"}},audio:q(o)&&!o.keepAudio},k(f,P)):Yt.extension.getScreen((function(e,t){if(e)return a.consentDialog(!1),n.error(e);(f={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=t,k(f,P,q(o)&&!o.keepAudio)}))}else if("firefox"===Yt.webRTCAdapter.browserDetails.browser){if(!(Yt.webRTCAdapter.browserDetails.version>=33)){var x=new Error("NavigatorUserMediaError");return x.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",a.consentDialog(!1),void n.error(x)}f={video:{mozMediaSource:o.video,mediaSource:o.video},audio:q(o)&&!o.keepAudio},k(f,(function(e,t){if(P(e,t),!e)var n=t.currentTime,i=window.setInterval((function(){t||window.clearInterval(i),t.currentTime==n&&(window.clearInterval(i),t.onended&&t.onended()),n=t.currentTime}),500)}))}return}}null!=o&&"screen"===o.video||navigator.mediaDevices.enumerateDevices().then((function(t){var r=t.some((function(e){return"audioinput"===e.kind})),s=function(e){if(Yt.debug("isScreenSendEnabled:",e),null==e)return!1;if("object"!==T(e.video)||"object"!==T(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}(o)||t.some((function(e){return"videoinput"===e.kind})),c=q(o),l=J(o),d=function(e){return Yt.debug("isAudioSendRequired:",e),null!=e&&(!1!==e.audio&&!1!==e.audioSend&&(void 0!==e.failIfNoAudio&&null!==e.failIfNoAudio&&!0===e.failIfNoAudio))}(o),u=function(e){return Yt.debug("isVideoSendRequired:",e),null!=e&&(!1!==e.video&&!1!==e.videoSend&&(void 0!==e.failIfNoVideo&&null!==e.failIfNoVideo&&!0===e.failIfNoVideo))}(o);if(c||l||d||u){var h=!!c&&r,p=!!l&&s;if(!h&&!p)return a.consentDialog(!1),n.error("No capture device found"),!1;if(!h&&d)return a.consentDialog(!1),n.error("Audio capture is required, but no capture device found"),!1;if(!p&&u)return a.consentDialog(!1),n.error("Video capture is required, but no capture device found"),!1}var g={audio:!(!r||o.keepAudio)&&v,video:!(!s||o.keepVideo)&&y};o.encodings&&(g=o.encodings),Yt.debug("getUserMedia constraints",g),g.audio||g.video?(console.log("gumConstraints_________",g,o.encodings),navigator.mediaDevices.getUserMedia(o.encodings?o.encodings:g).then((function(t){a.consentDialog(!1),O(e,i,o,n,t)})).catch((function(e){a.consentDialog(!1),n.error({code:e.code,name:e.name,message:e.message})}))):(a.consentDialog(!1),O(e,i,o,n,m))})).catch((function(e){a.consentDialog(!1),n.error("enumerateDevices error",e)}))}else O(e,i,o,n)}function N(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Yt.noop,t.error="function"==typeof t.error?t.error:Z;var n=t.jsep,i=w[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Yt.warn("Invalid handle"),void t.error("Invalid handle");var o=i.webrtcStuff;if(null!=n){if(null===o.pc)return Yt.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");o.pc.setRemoteDescription(n).then((function(){if(Yt.log("Remote description accepted!"),o.remoteSdp=n.sdp,o.candidates&&o.candidates.length>0){for(var e=0;e<o.candidates.length;e++){var i=o.candidates[e];Yt.debug("Adding remote candidate:",i),i&&!0!==i.completed?o.pc.addIceCandidate(i):o.pc.addIceCandidate(Yt.endOfCandidates)}o.candidates=[]}t.success()}),t.error)}else t.error("Invalid JSEP")}function F(e,t){var n=w[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Yt.warn("Invalid handle"),0;var i=t?"remote":"local",o=n.webrtcStuff;return o.volume[i]||(o.volume[i]={value:0}),o.pc.getStats&&"chrome"===Yt.webRTCAdapter.browserDetails.browser?!t||null!==o.remoteStream&&void 0!==o.remoteStream?t||null!==o.myStream&&void 0!==o.myStream?null===o.volume[i].timer||void 0===o.volume[i].timer?(Yt.log("Starting "+i+" volume monitor"),o.volume[i].timer=setInterval((function(){o.pc.getStats((function(e){for(var n=e.result(),a=0;a<n.length;a++){var r=n[a];"ssrc"==r.type&&(t&&r.stat("audioOutputLevel")?o.volume[i].value=parseInt(r.stat("audioOutputLevel")):!t&&r.stat("audioInputLevel")&&(o.volume[i].value=parseInt(r.stat("audioInputLevel"))))}}))}),200),0):o.volume[i].value:(Yt.warn("Local stream unavailable"),0):(Yt.warn("Remote stream unavailable"),0):(Yt.warn("Getting the "+i+" volume unsupported by browser"),0)}function U(e,t){var n=w[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Yt.warn("Invalid handle"),!0;var i=n.webrtcStuff;return null===i.pc||void 0===i.pc?(Yt.warn("Invalid PeerConnection"),!0):void 0===i.myStream||null===i.myStream?(Yt.warn("Invalid local MediaStream"),!0):t?null===i.myStream.getVideoTracks()||void 0===i.myStream.getVideoTracks()||0===i.myStream.getVideoTracks().length?(Yt.warn("No video track"),!0):!i.myStream.getVideoTracks()[0].enabled:null===i.myStream.getAudioTracks()||void 0===i.myStream.getAudioTracks()||0===i.myStream.getAudioTracks().length?(Yt.warn("No audio track"),!0):!i.myStream.getAudioTracks()[0].enabled}function V(e,t,n){var i=w[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Yt.warn("Invalid handle"),!1;var o=i.webrtcStuff;return null===o.pc||void 0===o.pc?(Yt.warn("Invalid PeerConnection"),!1):void 0===o.myStream||null===o.myStream?(Yt.warn("Invalid local MediaStream"),!1):t?null===o.myStream.getVideoTracks()||void 0===o.myStream.getVideoTracks()||0===o.myStream.getVideoTracks().length?(Yt.warn("No video track"),!1):(o.myStream.getVideoTracks()[0].enabled=!n,!0):null===o.myStream.getAudioTracks()||void 0===o.myStream.getAudioTracks()||0===o.myStream.getAudioTracks().length?(Yt.warn("No audio track"),!1):(o.myStream.getAudioTracks()[0].enabled=!n,!0)}function H(e,t){var n=w[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Yt.warn("Invalid handle"),"Invalid handle";var i=n.webrtcStuff;return null===i.pc||void 0===i.pc?"Invalid PeerConnection":i.pc.getStats?void i.pc.getStats().then((function(e){e.forEach((function(e){if(e){var n=!1;if(("video"===e.mediaType||e.id.toLowerCase().indexOf("video")>-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?n=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(n=!0),n)if(t&&t(e),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 o=i.bitrate.tsnow-i.bitrate.tsbefore;"safari"==Yt.webRTCAdapter.browserDetails.browser&&(o/=1e3);var a=Math.round(8*(i.bitrate.bsnow-i.bitrate.bsbefore)/o);"safari"===Yt.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}}}))})):(Yt.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function G(e){var t=w[e];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return Yt.warn("Invalid handle"),"Invalid handle";var n=t.webrtcStuff;return null===n.pc||void 0===n.pc?"Invalid PeerConnection":n.pc.getStats?null===n.bitrate.timer||void 0===n.bitrate.timer?(Yt.log("Starting bitrate timer (via getStats)"),n.bitrate.timer=setInterval((function(){n.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(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 i=n.bitrate.tsnow-n.bitrate.tsbefore;"safari"==Yt.webRTCAdapter.browserDetails.browser&&(i/=1e3);var o=Math.round(8*(n.bitrate.bsnow-n.bitrate.bsbefore)/i);"safari"===Yt.webRTCAdapter.browserDetails.browser&&(o=parseInt(o/1e3)),n.bitrate.value=o+" kbits/sec",n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):n.bitrate.value:(Yt.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function Z(e){Yt.error("WebRTC error:",e)}function W(e,t){Yt.log("Cleaning WebRTC stuff");var o=w[e];if(null!=o){var a=o.webrtcStuff;if(null!=a){if(!0===t){var r={rtcgw:"hangup",transaction:Yt.randomString(12)};null!==o.token&&void 0!==o.token&&(r.token=o.token),null!=f&&(r.apisecret=f),Yt.debug("Sending hangup request (handle="+e+"):"),Yt.debug(r),n?(r.session_id=b,r.handle_id=e,i.send(JSON.stringify(r))):Yt.httpAPICall(c+"/"+b+"/"+e,{verb:"POST",withCredentials:h,body:r})}a.remoteStream=null,a.volume&&(a.volume.local&&a.volume.local.timer&&clearInterval(a.volume.local.timer),a.volume.remote&&a.volume.remote.timer&&clearInterval(a.volume.remote.timer)),a.volume={},a.bitrate.timer&&clearInterval(a.bitrate.timer),a.bitrate.timer=null,a.bitrate.bsnow=null,a.bitrate.bsbefore=null,a.bitrate.tsnow=null,a.bitrate.tsbefore=null,a.bitrate.value=null;try{if(!a.streamExternal&&null!==a.myStream&&void 0!==a.myStream){Yt.log("Stopping local stream tracks");var s=a.myStream.getTracks();for(var l in s){var d=s[l];Yt.log(d),null!=d&&d.stop()}}}catch(e){}a.streamExternal=!1,a.myStream=null;try{a.pc.close()}catch(e){}a.pc=null,a.candidates=null,a.mySdp=null,a.remoteSdp=null,a.iceDone=!1,a.dataChannel={},a.dtmfSender=null}o.oncleanup()}}function q(e){return Yt.debug("isAudioSendEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioSend||null===e.audioSend||!0===e.audioSend)}function K(e){return Yt.debug("isAudioRecvEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioRecv||null===e.audioRecv||!0===e.audioRecv)}function J(e){return Yt.debug("isVideoSendEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoSend||null===e.videoSend||!0===e.videoSend)}function Y(e){return Yt.debug("isVideoRecvEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoRecv||null===e.videoRecv||!0===e.videoRecv)}j(e),this.getServer=function(){return c},this.isConnected=function(){return _},this.reconnect=function(e){(e=e||{}).success="function"==typeof e.success?e.success:Yt.noop,e.error="function"==typeof e.error?e.error:Yt.noop,e.reconnect=!0,j(e)},this.getSessionId=function(){return b},this.destroy=function(t){!function(t){t=t||{},t.success="function"==typeof t.success?t.success:Yt.noop;var r=!0;void 0!==t.asyncRequest&&null!==t.asyncRequest&&(r=!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(Yt.log("Destroying session "+b+" (async="+r+")"),!_)return Yt.warn("Is the server down? (connected=false)"),void t.success();if(null==b)return Yt.warn("No session to destroy"),t.success(),void(s&&e.destroyed());if(l)for(var d in w)M(d,{noRequest:!0});var u={rtcgw:"destroy",transaction:Yt.randomString(12)};null!=g&&(u.token=g);null!=f&&(u.apisecret=f);if(n){u.session_id=b;var m=function(){for(var e in o)i.removeEventListener(e,o[e]);i.removeEventListener("message",p),i.removeEventListener("error",v),a&&clearTimeout(a),i.close()},p=function(n){var i=JSON.parse(n.data);i.session_id==u.session_id&&i.transaction==u.transaction&&(m(),t.success(),s&&e.destroyed())},v=function(n){m(),t.error("Failed to destroy the server: Is the server down?"),s&&e.destroyed()};return i.addEventListener("message",p),i.addEventListener("error",v),void i.send(JSON.stringify(u))}Yt.httpAPICall(c+"/"+b,{verb:"POST",async:r,withCredentials:h,body:u,success:function(n){Yt.log("Destroyed session:"),Yt.debug(n),b=null,_=!1,"success"!==n.rtcgw&&Yt.error("Ooops: "+n.error.code+" "+n.error.reason),t.success(),s&&e.destroyed()},error:function(n,i){Yt.error(n+":",i),b=null,_=!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:Yt.noop,e.error="function"==typeof e.error?e.error:Yt.noop,e.consentDialog="function"==typeof e.consentDialog?e.consentDialog:Yt.noop,e.iceState="function"==typeof e.iceState?e.iceState:Yt.noop,e.mediaState="function"==typeof e.mediaState?e.mediaState:Yt.noop,e.webrtcState="function"==typeof e.webrtcState?e.webrtcState:Yt.noop,e.slowLink="function"==typeof e.slowLink?e.slowLink:Yt.noop,e.onmessage="function"==typeof e.onmessage?e.onmessage:Yt.noop,e.onlocalstream="function"==typeof e.onlocalstream?e.onlocalstream:Yt.noop,e.onremotestream="function"==typeof e.onremotestream?e.onremotestream:Yt.noop,e.ondata="function"==typeof e.ondata?e.ondata:Yt.noop,e.ondataopen="function"==typeof e.ondataopen?e.ondataopen:Yt.noop,e.oncleanup="function"==typeof e.oncleanup?e.oncleanup:Yt.noop,e.ondetached="function"==typeof e.ondetached?e.ondetached:Yt.noop,!_)return Yt.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var t=e.plugin;if(null==t)return Yt.error("Invalid plugin"),void e.error("Invalid plugin");var o=e.opaqueId,a=e.token?e.token:g,r=Yt.randomString(12),s={rtcgw:"attach",plugin:t,opaque_id:o,transaction:r};null!=a&&(s.token=a);null!=f&&(s.apisecret=f);if(n)return k[r]=function(n){if(Yt.debug(n),"success"!==n.rtcgw)return Yt.error("Ooops: "+n.error.code+" "+n.error.reason),void e.error("Ooops: "+n.error.code+" "+n.error.reason);var i=n.data.id;Yt.log("Created handle: "+i);var o={session:E,plugin:t,id:i,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return t},getVolume:function(){return F(i,!0)},getRemoteVolume:function(){return F(i,!0)},getLocalVolume:function(){return F(i,!1)},isAudioMuted:function(){return U(i,!1)},muteAudio:function(){return V(i,!1,!0)},unmuteAudio:function(){return V(i,!1,!1)},isVideoMuted:function(){return U(i,!0)},muteVideo:function(){return V(i,!0,!0)},unmuteVideo:function(){return V(i,!0,!1)},getBitrate:function(){return G(i)},getNetworkQuality:function(e){H(i,e)},send:function(e){A(i,e)},data:function(e){L(i,e)},dtmf:function(e){B(i,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){z(i,!0,e)},createAnswer:function(e){z(i,!1,e)},handleRemoteJsep:function(e){N(i,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){W(i,!0===e)},detach:function(e){M(i,e)}};w[i]=o,e.success(o)},s.session_id=b,void i.send(JSON.stringify(s));Yt.httpAPICall(c+"/"+b,{verb:"POST",withCredentials:h,body:s,success:function(n){if(Yt.debug(n),"success"!==n.rtcgw)return Yt.error("Ooops: "+n.error.code+" "+n.error.reason),void e.error("Ooops: "+n.error.code+" "+n.error.reason);var i=n.data.id;Yt.log("Created handle: "+i);var o={session:E,plugin:t,id:i,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return t},getVolume:function(){return F(i,!0)},getRemoteVolume:function(){return F(i,!0)},getLocalVolume:function(){return F(i,!1)},isAudioMuted:function(){return U(i,!1)},muteAudio:function(){return V(i,!1,!0)},unmuteAudio:function(){return V(i,!1,!1)},isVideoMuted:function(){return U(i,!0)},muteVideo:function(){return V(i,!0,!0)},unmuteVideo:function(){return V(i,!0,!1)},getBitrate:function(){return G(i)},getNetworkQuality:function(e){H(i,e)},send:function(e){A(i,e)},data:function(e){L(i,e)},dtmf:function(e){B(i,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){z(i,!0,e)},createAnswer:function(e){z(i,!1,e)},handleRemoteJsep:function(e){N(i,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){W(i,!0===e)},detach:function(e){M(i,e)}};w[i]=o,e.success(o)},error:function(e,t){Yt.error(e+":",t)}})}(e)}}Yt.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,n=e&&e.Promise||Promise,i=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new i(e,t)},extension:e&&e.extension||Jt,isArray:function(e){return Array.isArray(e)},webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,i){var o={method:i.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===i.verb&&(o.headers["Content-Type"]="application/json"),void 0!==i.withCredentials&&(o.credentials=!0===i.withCredentials?"include":i.withCredentials?i.withCredentials:"omit"),void 0!==i.body&&(o.body=JSON.stringify(i.body));var a=t(e,o).catch((function(e){return n.reject({message:"Probably a network error, is the server down?",error:e})}));if(void 0!==i.timeout){var r=new n((function(e,t){var n=setTimeout((function(){return clearTimeout(n),t({message:"Request timed out",timeout:i.timeout})}),i.timeout)}));a=n.race([a,r])}return a.then((function(e){return e.ok?T(i.success)===T(Yt.noop)?e.json().then((function(e){i.success(e)})).catch((function(t){return n.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:n.reject({message:"API call failed",response:e})})).catch((function(e){T(i.error)===T(Yt.noop)&&i.error(e.message||"<< internal error >>",e)})),a}}},Yt.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||Jt,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,n){var i=void 0!==n.body?{contentType:"application/json",data:JSON.stringify(n.body)}:{},o=void 0!==n.withCredentials?{xhrFields:{withCredentials:n.withCredentials}}:{};return t.ajax(t.extend(i,o,{url:e,type:n.verb,cache:!1,dataType:"json",async:n.async,timeout:n.timeout,success:function(e){T(n.success)===T(Yt.noop)&&n.success(e)},error:function(e,t,i){T(n.error)===T(Yt.noop)&&n.error(t,i)}}))}}},Yt.noop=function(){},Yt.dataChanDefaultLabel="JanusDataChannel",Yt.endOfCandidates=null,Yt.init=function(e){if((e=e||{}).callback="function"==typeof e.callback?e.callback:Yt.noop,!0===Yt.initDone)e.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),Yt.trace=Yt.noop,Yt.debug=Yt.noop,Yt.vdebug=Yt.noop,Yt.log=Yt.noop,Yt.warn=Yt.noop,Yt.error=Yt.noop,!0===e.debug||"all"===e.debug)Yt.trace=console.trace.bind(console),Yt.debug=console.debug.bind(console),Yt.vdebug=console.debug.bind(console),Yt.log=console.log.bind(console),Yt.warn=console.warn.bind(console),Yt.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var n=e.debug[t];switch(n){case"trace":Yt.trace=console.trace.bind(console);break;case"debug":Yt.debug=console.debug.bind(console);break;case"vdebug":Yt.vdebug=console.debug.bind(console);break;case"log":Yt.log=console.log.bind(console);break;case"warn":Yt.warn=console.warn.bind(console);break;case"error":Yt.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+n+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')")}}var i=e.dependencies||Yt.useDefaultDependencies();Yt.isArray=i.isArray,Yt.webRTCAdapter=i.webRTCAdapter,Yt.httpAPICall=i.httpAPICall,Yt.newWebSocket=i.newWebSocket,Yt.extension=i.extension,Yt.extension.init(),Yt.listDevices=function(e,t){e="function"==typeof e?e:Yt.noop,null==t&&(t={audio:!0,video:!0}),Yt.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(n){Yt.debug(n),e(n);try{var i=t.getTracks();for(var o in i){var a=i[o];null!=a&&a.stop()}}catch(e){}}))})).catch((function(t){Yt.error(t),e([])})):(Yt.warn("navigator.mediaDevices unavailable"),e([]))},Yt.attachMediaStream=function(e,t){"chrome"===Yt.webRTCAdapter.browserDetails.browser?Yt.webRTCAdapter.browserDetails.version>=52?e.srcObject=t:void 0!==e.src?e.src=URL.createObjectURL(t):Yt.error("Error attaching stream to element"):e.srcObject=t},Yt.reattachMediaStream=function(e,t){"chrome"===Yt.webRTCAdapter.browserDetails.browser?Yt.webRTCAdapter.browserDetails.version>=52?e.srcObject=t.srcObject:void 0!==e.src?e.src=t.src:Yt.error("Error reattaching stream to element"):e.srcObject=t.srcObject};var o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+o];if(window.addEventListener(o,(function(e){for(var t in Yt.log("Closing window"),Yt.sessions)null!==Yt.sessions[t]&&void 0!==Yt.sessions[t]&&Yt.sessions[t].destroyOnUnload&&(Yt.log("Destroying session "+t),Yt.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));a&&"function"==typeof a&&a()})),Yt.safariVp8=!1,"safari"===Yt.webRTCAdapter.browserDetails.browser&&Yt.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 r=RTCRtpSender.getCapabilities("video").codecs[t];if(r&&r.mimeType&&"video/vp8"===r.mimeType.toLowerCase()){Yt.safariVp8=!0;break}}Yt.safariVp8?Yt.log("This version of Safari supports VP8"):Yt.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){Yt.safariVp8=-1!==e.sdp.indexOf("VP8"),Yt.safariVp8?Yt.log("This version of Safari supports VP8"):Yt.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(Yt.unifiedPlan=!1,"firefox"===Yt.webRTCAdapter.browserDetails.browser&&Yt.webRTCAdapter.browserDetails.version>=59)Yt.unifiedPlan=!0;else if("chrome"===Yt.webRTCAdapter.browserDetails.browser&&Yt.webRTCAdapter.browserDetails.version<72)Yt.unifiedPlan=!1;else if("currentDirection"in RTCRtpTransceiver.prototype){var c=new RTCPeerConnection;try{c.addTransceiver("audio"),Yt.unifiedPlan=!0}catch(e){}c.close()}else Yt.unifiedPlan=!1;Yt.initDone=!0,e.callback()}},Yt.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},Yt.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},Yt.randomString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i<e;i++){var o=Math.floor(62*Math.random());n+=t.substring(o,o+1)}return n},window.Janus=Yt;var Xt="V1.0",Qt="https://open.ys7.com",$t={},en=function(e,t){$t[e]||($t[e]=[]),$t[e].push(t)},tn=function(){var e=Array.prototype.shift.call(arguments),t=$t[e];if(!t||0===t.length)return!1;for(var n,i=0;n=t[i];i++)n.apply(this,arguments)};function nn(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}var on=function(){return p((function e(t){u(this,e),f(this,"subscribe",(function(e){var t=nn(),n={cmdType:"subremote",streamtype:e.type,customId:e.clientId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId},i=null;return window["ezuikit-webrtc"].opt.janus.attach({plugin:"rtcgw.plugin.sts",opaqueId:window["ezuikit-webrtc"].opt.opaqueId,success:function(o){console.log("pluginHandle",o),8==e.type?window["ezuikit-webrtc"].opt.subscribeScreenHandle=o:(window["ezuikit-webrtc"].opt["".concat(e.clientId)]=o,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){}})),(i=o).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),i.send({message:n,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),i.handleRemoteJsep({jsep:t})),"subremoteack"===e.rtcgw&&tn("subremoteack",e)},onlocalstream:function(e){},onremotestream:function(n){console.log("remoteStream==================================",n);var i={clientId:e.clientId,stream:n,streamType:e.type};t.resolve(i),tn("remoteStream",i)},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})),f(this,"subscribeStream",(function(e){var t=nn(),n={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:n,success:function(){t.resolve("success")},error:function(e){t.reject(e)}}),t.promise})),f(this,"unsubscribe",(function(e){var t=nn(),n={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:n,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:n,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})),f(this,"unsubscribeStream",(function(e){var t=nn(),n={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:n,success:function(){t.resolve("success")},error:function(e){t.reject(e)}}),t.promise})),f(this,"listen",(function(){return en.apply(void 0,arguments)})),this.initEZWEBPlayer(t)}),[{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:Qt,cln:{local:{username:"",client_id:""}}},videoParams:{},audioParams:{},cameraId:null,microphoneId:null,bitrate:1e5,frameRate:15,width:320,height:240},B("".concat(Qt,"/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 n=t.data;n.clientId;var i=n.domain;n.internalRoomId;var o=n.wssPath;window["ezuikit-webrtc"].opt.server="wss://".concat(i,"/").concat(o),window["ezuikit-webrtc"].opt.roomParams.internalRoomId=t.data.internalRoomId,window["ezuikit-webrtc"].opt.roomParams.clientId=t.data.clientId;var a={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(){}},a)}})}))}},{key:"getVersion",value:function(){var e=nn();return e.resolve(Xt),e.promise}},{key:"getSupport",value:function(){var e=nn(),t={isWebrtcSupport:!0,isH264Support:!0},n=document.createElement("video");return n.canPlayType&&(n.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=nn();return navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){e.resolve(t)})):e.reject("no devices"),e.promise}},{key:"getCamerasList",value:function(){var e=nn();return navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var n=[];t.map((function(e){"videoinput"==e.kind&&n.push(e)})),e.resolve(n)})):e.reject("no devices"),e.promise}},{key:"getMicrophonesList",value:function(){var e=nn();return navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var n=[];t.map((function(e){"audioinput"==e.kind&&n.push(e)})),e.resolve(n)})):e.reject("no devices"),e.promise}},{key:"getSpeakersList",value:function(){var e=nn();return navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var n=[];t.map((function(e){"audiooutput"==e.kind&&n.push(e)})),e.resolve(n)})):e.reject("no devices"),e.promise}},{key:"play",value:function(e){var t=nn(),n=document.getElementById(e.domId),i=window["ezuikit-webrtc"].opt.cln.local.stream;return Janus.attachMediaStream(n,i),n.play(),document.getElementById(e.domId)?t.resolve("success"):t.reject("no video dom"),t.promise}},{key:"leaveRoom",value:function(e){var t=nn(),n={cmdType:"exitRoom",customId:window["ezuikit-webrtc"].opt.roomParams.userId,roomId:window["ezuikit-webrtc"].opt.roomParams.internalRoomId};return window["ezuikit-webrtc"].opt.mainHandle.send({message:n,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=nn();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=nn();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=nn(),n={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=n.video,window["ezuikit-webrtc"].bitrate=1e3*n.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=nn();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 n={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:n}),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 n=e.result;if(null!=n){if("done"===n)return;n.status}"enterRoomack"===e.rtcgw&&tn("enterRoomack",e),"clientJoin"===e.rtcgw&&tn("clientJoin",e),"clientLeave"===e.rtcgw&&tn("clientLeave",e),"stream-added"===e.rtcgw&&tn("steam-added",e),"stream-removed"===e.rtcgw&&tn("stream-removed",e),"audioleve"===e.rtcgw&&tn("audioleve",e),"networkquality"===e.rtcgw&&tn("networkquality",e),"error"===e.rtcgw&&tn("error",e),"audioleve"===e.rtcgw&&tn("audioleve",e),"publishlocalstreamack"===e.rtcgw&&tn("publishlocalstreamack",e),"subremoteack"===e.rtcgw&&tn("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=nn();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=nn();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 n=nn(),i={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:i,success:function(){n.resolve("success")},error:function(e){n.reject(e)}}):window["ezuikit-webrtc"].opt.sts.send({message:i,success:function(){n.resolve("success")},error:function(e){n.reject(e)}}),n.promise}},{key:"resumeStream",value:function(e){this.controlStream(e,"resume")}},{key:"publishStream",value:function(e){var t=nn(),n={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 i={videoSend:!0,audioSend:!0,audioRecv:!0,videoRecv:!0,data:!1,video:"stdres",audio:!0};switch(e.type){case 1:i={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:i={videoSend:!0,audioSend:!0,audioRecv:!0,videoRecv:!0,data:!1,video:!1,audio:{deviceId:window["ezuikit-webrtc"].microphoneId}};break;case 3:i={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:i={audioRecv:!1,videoRecv:!0,data:!1,audioSend:!1,videoSend:!0,video:"screen",screenshareFrameRate:3}}return console.log("media-----------",i),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:i,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:n,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(o){console.log("pluginHandle",o),8==e.type?window["ezuikit-webrtc"].opt.screenHandle=o:window["ezuikit-webrtc"].opt.sts=o,Janus.debug("Trying a createOffer too (audio/video sendrecv)"),o.createOffer({media:i,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),o.send({message:n,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,n){console.log("消息回调+++++++++++++++++++++++++++++++++++++++++",t,n),Janus.debug(" ::: Got a message :::"),Janus.debug(t),null!=n&&(Janus.debug("Handling SDP as well..."),Janus.debug(n),8==e.type?window["ezuikit-webrtc"].opt.screenHandle.handleRemoteJsep({jsep:n}):window["ezuikit-webrtc"].opt.sts.handleRemoteJsep({jsep:n}))},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 t=nn(),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:y(y({},n),{},{streamtype:8}),success:function(){window["ezuikit-webrtc"].opt.screenHandle.detach({noRequest:!1}),window["ezuikit-webrtc"].opt.screenHandle=null,t.resolve("success")},error:function(e){t.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,t.resolve("success")},error:function(e){t.reject(e)}}),t.promise}},{key:"ezwebTrigger",value:function(e){var t={stream:window["ezuikit-webrtc"].opt.cln.local.stream,clientId:"cliendId-".concat(20*Math.random())};tn("steam-added",t)}},{key:"playRemoteSteam",value:function(e){var t=document.getElementById(e.domId);Janus.attachMediaStream(t,e.stream),t.load();var n=t.play();void 0!==n&&n.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)}))}}])}(),an=function(){return p((function e(t){u(this,e),this.collect=new c(t)}),[{key:"report",value:function(e){this.collect.send(y({},e))}},{key:"updateParams",value:function(e){this.collect.updateExtendsInfo(e)}},{key:"setForbidden",value:function(e){this.collect.setForbidden(e)}}])}();window.monitorExtendsInfo={},window.ezuikitMonitor=new an({url:"https://log.ys7.com/statistics.do/opensdk_ezuikit",extendsInfo:{v:Ve,getDynamic:function(){return window.monitorExtendsInfo}}}),window.EZUIKit={};var rn={HLS:O,FLV:V,EZUIKitPlayer:Ft,EZUIKitHD:qt,EZWebRtc:on};export{qt as EZUIKitHD,Ft as EZUIKitPlayer,on as EZWebRtc,V as FLV,O as HLS,rn as default};