diff --git a/public/index.html b/public/index.html index b46be5e8..4fdd0ec3 100644 --- a/public/index.html +++ b/public/index.html @@ -200,4 +200,4 @@ } - \ No newline at end of file + diff --git a/public/jsVideoPlugin-1.0.0.min.js b/public/jsVideoPlugin-1.0.0.min.js index 861380e7..e5db9016 100644 --- a/public/jsVideoPlugin-1.0.0.min.js +++ b/public/jsVideoPlugin-1.0.0.min.js @@ -34,4 +34,4 @@ function(L){var e,p,w,o,F,v,W,N,S,u,l,_,b,r,C,m,s,a,y,k="sizzle"+1*new Date,f=L. var i=tt(100);var o=tt(101);var s=tt(52);et.Buffer=c;et.SlowBuffer=y;et.INSPECT_MAX_BYTES=50;c.TYPED_ARRAY_SUPPORT=e.TYPED_ARRAY_SUPPORT!==undefined?e.TYPED_ARRAY_SUPPORT:t();et.kMaxLength=n();function t(){try{var e=new Uint8Array(1);e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return e.foo()===42&&typeof e.subarray==="function"&&e.subarray(1,1).byteLength===0}catch(t){return false}}function n(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(n()=n()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+n().toString(16)+" bytes")}return e|0}function y(e){if(+e!=e){e=0}return c.alloc(+e)}c.isBuffer=function te(e){return!!(e!=null&&e._isBuffer)};c.compare=function M(e,t){if(!c.isBuffer(e)||!c.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var n=e.length;var i=t.length;for(var r=0,o=Math.min(n,i);r>>1;case"base64":return A(e).length;default:if(i)return q(e).length;t=(""+t).toLowerCase();i=true}}}c.byteLength=g;function L(e,t,n){var i=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(n===undefined||n>this.length){n=this.length}if(n<=0){return""}n>>>=0;t>>>=0;if(n<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return G(this,t,n);case"utf8":case"utf-8":return b(this,t,n);case"ascii":return U(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return J(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}c.prototype._isBuffer=true;function P(e,t,n){var i=e[t];e[t]=e[n];e[n]=i}c.prototype.swap16=function re(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var t=0;t0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};c.prototype.compare=function M(e,t,n,i,r){if(!c.isBuffer(e)){throw new TypeError("Argument must be a Buffer")}if(t===undefined){t=0}if(n===undefined){n=e?e.length:0}if(i===undefined){i=0}if(r===undefined){r=this.length}if(t<0||n>e.length||i<0||r>this.length){throw new RangeError("out of range index")}if(i>=r&&t>=n){return 0}if(i>=r){return-1}if(t>=n){return 1}t>>>=0;n>>>=0;i>>>=0;r>>>=0;if(this===e)return 0;var o=r-i;var s=n-t;var a=Math.min(o,s);var u=this.slice(i,r);var l=e.slice(t,n);for(var f=0;f2147483647){n=2147483647}else if(n<-2147483648){n=-2147483648}n=+n;if(isNaN(n)){n=r?0:e.length-1}if(n<0)n=e.length+n;if(n>=e.length){if(r)return-1;else n=e.length-1}else if(n<0){if(r)n=0;else return-1}if(typeof t==="string"){t=c.from(t,i)}if(c.isBuffer(t)){if(t.length===0){return-1}return S(e,t,n,i,r)}else if(typeof t==="number"){t=t&255;if(c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(r){return Uint8Array.prototype.indexOf.call(e,t,n)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,n)}}return S(e,[t],n,i,r)}throw new TypeError("val must be string, number or Buffer")}function S(e,t,n,i,r){var o=1;var s=e.length;var a=t.length;if(i!==undefined){i=String(i).toLowerCase();if(i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(e.length<2||t.length<2){return-1}o=2;s/=2;a/=2;n/=2}}function u(e,t){if(o===1){return e[t]}else{return e.readUInt16BE(t*o)}}var l;if(r){var f=-1;for(l=n;ls)n=s-a;for(l=n;l>=0;l--){var c=true;for(var h=0;hr){i=r}}var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");if(i>o/2){i=o/2}for(var s=0;sr)n=r;if(e.length>0&&(n<0||t<0)||t>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var o=false;for(;;){switch(i){case"hex":return F(this,e,t,n);case"utf8":case"utf-8":return W(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return N(this,e,t,n);case"base64":return B(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();o=true}}};c.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(e,t,n){if(t===0&&n===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,n))}}function b(e,t,n){n=Math.min(e.length,n);var i=[];var r=t;while(r239?4:o>223?3:o>191?2:1;if(r+a<=n){var u,l,f,c;switch(a){case 1:if(o<128){s=o}break;case 2:u=e[r+1];if((u&192)===128){c=(o&31)<<6|u&63;if(c>127){s=c}}break;case 3:u=e[r+1];l=e[r+2];if((u&192)===128&&(l&192)===128){c=(o&15)<<12|(u&63)<<6|l&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:u=e[r+1];l=e[r+2];f=e[r+3];if((u&192)===128&&(l&192)===128&&(f&192)===128){c=(o&15)<<18|(u&63)<<12|(l&63)<<6|f&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;a=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);r+=a}return H(i)}var C=4096;function H(e){var t=e.length;if(t<=C){return String.fromCharCode.apply(String,e)}var n="";var i=0;while(ii)n=i;var r="";for(var o=t;on){e=n}if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(tn)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function me(e,t,n){e=e|0;t=t|0;if(!n)k(e,t,this.length);var i=this[e];var r=1;var o=0;while(++o0&&(r*=256)){i+=this[e+--t]*r}return i};c.prototype.readUInt8=function ge(e,t){if(!t)k(e,1,this.length);return this[e]};c.prototype.readUInt16LE=function Pe(e,t){if(!t)k(e,2,this.length);return this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function we(e,t){if(!t)k(e,2,this.length);return this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function Se(e,t){if(!t)k(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function _e(e,t){if(!t)k(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function be(e,t,n){e=e|0;t=t|0;if(!n)k(e,t,this.length);var i=this[e];var r=1;var o=0;while(++o=r)i-=Math.pow(2,8*t);return i};c.prototype.readIntBE=function Ce(e,t,n){e=e|0;t=t|0;if(!n)k(e,t,this.length);var i=t;var r=1;var o=this[e+--i];while(i>0&&(r*=256)){o+=this[e+--i]*r}r*=128;if(o>=r)o-=Math.pow(2,8*t);return o};c.prototype.readInt8=function ke(e,t){if(!t)k(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};c.prototype.readInt16LE=function Te(e,t){if(!t)k(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function Re(e,t){if(!t)k(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function De(e,t){if(!t)k(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function xe(e,t){if(!t)k(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function Ie(e,t){if(!t)k(e,4,this.length);return o.read(this,e,true,23,4)};c.prototype.readFloatBE=function Ee(e,t){if(!t)k(e,4,this.length);return o.read(this,e,false,23,4)};c.prototype.readDoubleLE=function qe(e,t){if(!t)k(e,8,this.length);return o.read(this,e,true,52,8)};c.prototype.readDoubleBE=function Ae(e,t){if(!t)k(e,8,this.length);return o.read(this,e,false,52,8)};function T(e,t,n,i,r,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}c.prototype.writeUIntLE=function Oe(e,t,n,i){e=+e;t=t|0;n=n|0;if(!i){var r=Math.pow(2,8*n)-1;T(this,e,t,n,r,0)}var o=1;var s=0;this[t]=e&255;while(++s=0&&(s*=256)){this[t+o]=e/s&255}return t+n};c.prototype.writeUInt8=function Le(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,1,255,0);if(!c.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e&255;return t+1};function R(e,t,n,i){if(t<0)t=65535+t+1;for(var r=0,o=Math.min(e.length-n,2);r>>(i?r:1-r)*8}}c.prototype.writeUInt16LE=function Fe(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,2,65535,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{R(this,e,t,true)}return t+2};c.prototype.writeUInt16BE=function We(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,2,65535,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{R(this,e,t,false)}return t+2};function D(e,t,n,i){if(t<0)t=4294967295+t+1;for(var r=0,o=Math.min(e.length-n,4);r>>(i?r:3-r)*8&255}}c.prototype.writeUInt32LE=function Ne(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,4,4294967295,0);if(c.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e&255}else{D(this,e,t,true)}return t+4};c.prototype.writeUInt32BE=function Be(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,4,4294967295,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{D(this,e,t,false)}return t+4};c.prototype.writeIntLE=function ze(e,t,n,i){e=+e;t=t|0;if(!i){var r=Math.pow(2,8*n-1);T(this,e,t,n,r-1,-r)}var o=0;var s=1;var a=0;this[t]=e&255;while(++o>0)-a&255}return t+n};c.prototype.writeIntBE=function Je(e,t,n,i){e=+e;t=t|0;if(!i){var r=Math.pow(2,8*n-1);T(this,e,t,n,r-1,-r)}var o=n-1;var s=1;var a=0;this[t+o]=e&255;while(--o>=0&&(s*=256)){if(e<0&&a===0&&this[t+o+1]!==0){a=1}this[t+o]=(e/s>>0)-a&255}return t+n};c.prototype.writeInt8=function He(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,1,127,-128);if(!c.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e&255;return t+1};c.prototype.writeInt16LE=function Ue(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,2,32767,-32768);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{R(this,e,t,true)}return t+2};c.prototype.writeInt16BE=function je(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,2,32767,-32768);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{R(this,e,t,false)}return t+2};c.prototype.writeInt32LE=function Ge(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,4,2147483647,-2147483648);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};c.prototype.writeInt32BE=function Ve(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{D(this,e,t,false)}return t+4};function x(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,i,r){if(!r){x(e,t,n,4,34028234663852886e22,-34028234663852886e22)}o.write(e,t,n,i,23,4);return n+4}c.prototype.writeFloatLE=function Ye(e,t,n){return I(this,e,t,true,n)};c.prototype.writeFloatBE=function Xe(e,t,n){return I(this,e,t,false,n)};function E(e,t,n,i,r){if(!r){x(e,t,n,8,17976931348623157e292,-17976931348623157e292)}o.write(e,t,n,i,52,8);return n+8}c.prototype.writeDoubleLE=function Ze(e,t,n){return E(this,e,t,true,n)};c.prototype.writeDoubleBE=function Ke(e,t,n){return E(this,e,t,false,n)};c.prototype.copy=function $e(e,t,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;--o){e[o+t]=this[o+n]}}else if(r<1e3||!c.TYPED_ARRAY_SUPPORT){for(o=0;o>>0;n=n===undefined?this.length:n>>>0;if(!e)e=0;var o;if(typeof e==="number"){for(o=t;o55295&&n<57344){if(!r){if(n>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)o.push(239,191,189);continue}r=n;continue}if(n<56320){if((t-=3)>-1)o.push(239,191,189);r=n;continue}n=(r-55296<<10|n-56320)+65536}else if(r){if((t-=3)>-1)o.push(239,191,189)}r=null;if(n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else{throw new Error("Invalid code point")}}return o}function $(e){var t=[];for(var n=0;n>8;r=n%256;o.push(r);o.push(i)}return o}function A(e){return i.toByteArray(X(e))}function O(e,t,n,i){for(var r=0;r=t.length||r>=e.length)break;t[r+n]=e[r]}return r}function ee(e){return e!==e}}).call(this,tt(6))},function(e,t,n){t=e.exports=n(53);t.Stream=t;t.Readable=t;t.Writable=n(36);t.Duplex=n(5);t.Transform=n(57);t.PassThrough=n(108)},function(N,e,B){"use strict";(function(e,t,n){var s=B(15);N.exports=g;function L(e,t,n){this.chunk=e;this.encoding=t;this.callback=n;this.next=null}function h(e){var t=this;this.next=null;this.entry=null;this.finish=function(){M(t,e)}}var a=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?t:s.nextTick;var u;g.WritableState=m;var i=Object.create(B(9));i.inherits=B(7);var r={deprecate:B(107)};var o=B(54);var l=B(16).Buffer;var f=n.Uint8Array||function(){};function c(e){return l.from(e)}function d(e){return l.isBuffer(e)||e instanceof f}var p=B(55);i.inherits(g,o);function v(){}function m(e,t){u=u||B(5);e=e||{};var n=t instanceof u;this.objectMode=!!e.objectMode;if(n)this.objectMode=this.objectMode||!!e.writableObjectMode;var i=e.highWaterMark;var r=e.writableHighWaterMark;var o=this.objectMode?16:16*1024;if(i||i===0)this.highWaterMark=i;else if(n&&(r||r===0))this.highWaterMark=r;else this.highWaterMark=o;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var s=e.decodeStrings===false;this.decodeStrings=!s;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){T(t,e)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new h(this)}m.prototype.getBuffer=function F(){var e=this.bufferedRequest;var t=[];while(e){t.push(e);e=e.next}return t};(function(){try{Object.defineProperty(m.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(e){}})();var y;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){y=Function.prototype[Symbol.hasInstance];Object.defineProperty(g,Symbol.hasInstance,{value:function(e){if(y.call(this,e))return true;if(this!==g)return false;return e&&e._writableState instanceof m}})}else{y=function(e){return e instanceof this}}function g(e){u=u||B(5);if(!y.call(g,this)&&!(this instanceof u)){return new g(e)}this._writableState=new m(e,this);this.writable=true;if(e){if(typeof e.write==="function")this._write=e.write;if(typeof e.writev==="function")this._writev=e.writev;if(typeof e.destroy==="function")this._destroy=e.destroy;if(typeof e["final"]==="function")this._final=e["final"]}o.call(this)}g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function P(e,t){var n=new Error("write after end");e.emit("error",n);s.nextTick(t,n)}function w(e,t,n,i){var r=true;var o=false;if(n===null){o=new TypeError("May not write null values to stream")}else if(typeof n!=="string"&&n!==undefined&&!t.objectMode){o=new TypeError("Invalid non-string/buffer chunk")}if(o){e.emit("error",o);s.nextTick(i,o);r=false}return r}g.prototype.write=function(e,t,n){var i=this._writableState;var r=false;var o=!i.objectMode&&d(e);if(o&&!l.isBuffer(e)){e=c(e)}if(typeof t==="function"){n=t;t=null}if(o)t="buffer";else if(!t)t=i.defaultEncoding;if(typeof n!=="function")n=v;if(i.ended)P(this,n);else if(o||w(this,i,e,n)){i.pendingcb++;r=_(this,i,o,e,t,n)}return r};g.prototype.cork=function(){var e=this._writableState;e.corked++};g.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest)x(this,e)}};g.prototype.setDefaultEncoding=function W(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e;return this};function S(e,t,n){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=l.from(t,n)}return t}Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function _(e,t,n,i,r,o){if(!n){var s=S(t,i,r);if(i!==s){n=true;r="buffer";i=s}}var a=t.objectMode?1:i.length;t.length+=a;var u=t.length>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function l(e,t,n){var i=t.length-1;if(i=0){if(r>0)e.lastNeed=r-1;return r}if(--i=0){if(r>0)e.lastNeed=r-2;return r}if(--i=0){if(r>0){if(r===2)r=0;else e.lastNeed=r-3}return r}return 0}function f(e,t,n){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function c(e){var t=this.lastTotal-this.lastNeed;var n=f(this,e,t);if(n!==undefined)return n;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function h(e,t){var n=l(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);e.copy(this.lastChar,0,i);return e.toString("utf8",t,i)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function p(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return n.slice(0,-1)}}return n}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function v(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function m(e,t){var n=(e.length-t)%3;if(n===0)return e.toString("base64",t);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-n)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function g(e){return e.toString(this.encoding)}function P(e){return e&&e.length?this.write(e):""}},function(e,i,t){"use strict";(function(p){Object.defineProperty(i,"__esModule",{value:true});var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var n=function(){function i(e,t){for(var n=0;n)[^>]*|#([\w-]*))$/;var n=/^(?:\s*(<[\w\W]+>)[^>]*|.([\w-]*))$/;if(t.test(e)){var i=t.exec(e);return document.getElementById(i[2])}else if(n.test(e)){var r=n.exec(e);var o=document.getElementsByTagName("*");var s=[];for(var a=0,u=o.length;a>2;s=(n&3)<<4|i>>4;a=(i&15)<<2|r>>6;u=r&63;if(isNaN(i)){a=u=64}else if(isNaN(r)){u=64}t=t+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(a)+this._keyStr.charAt(u)}return t}},{key:"decode",value:function c(e){var t="";var n;var i;var r;var o;var s;var a;var u;var l=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(l>4;i=(s&15)<<4|a>>2;r=(a&3)<<6|u;t=t+String.fromCharCode(n);if(a!==64){t=t+String.fromCharCode(i)}if(u!==64){t=t+String.fromCharCode(r)}}t=this._utf8_decode(t);return t}},{key:"_utf8_encode",value:function a(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n127&&i<2048){t+=String.fromCharCode(i>>6|192);t+=String.fromCharCode(i&63|128)}else{t+=String.fromCharCode(i>>12|224);t+=String.fromCharCode(i>>6&63|128);t+=String.fromCharCode(i&63|128)}}return t}},{key:"_utf8_decode",value:function u(e){var t="";var n=0;var i=0;var r=0;while(n191&&i<224){r=e.charCodeAt(n+1);t+=String.fromCharCode((i&31)<<6|r&63);n+=2}else{r=e.charCodeAt(n+1);var o=e.charCodeAt(n+2);t+=String.fromCharCode((i&15)<<12|(r&63)<<6|o&63);n+=3}}return t}},{key:"isFirefox",value:function l(){var e=false;var t=navigator.userAgent.toLowerCase();var n="";var i=-1;if(t.match(/firefox\/([\d.]+)/)){n=t.match(/firefox\/([\d.]+)/)[1];i=parseInt(n.split(".")[0],10);if(i>-1){e=true}}return e}},{key:"isSafari",value:function h(){var e=false;var t=navigator.userAgent.toLowerCase();var n="";var i=-1;if(t.match(/version\/([\d.]+).safari./)){n=t.match(/version\/([\d.]+).safari./)[1];i=parseInt(n.split(".")[0],10);if(i>-1){e=true}}return e}},{key:"isEdge",value:function t(){return navigator.userAgent.toLowerCase().indexOf("edge")>-1}},{key:"getStatusCode",value:function d(e){var t=e.responseXML;var n="";try{if(t){n=p(t).find("subStatusCode").text()}else if("object"===v(JSON.parse(e.responseText))){var i=JSON.parse(e.responseText);n=""+i["subStatusCode"]}}catch(r){}return n}}]);return e}();var t=i.oTool=new e}).call(this,t(1))},function(e,t){var n=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(n){var i=new Uint8Array(16);e.exports=function o(){n(i);return i}}else{var r=new Array(16);e.exports=function s(){for(var e=0,t;e<16;e++){if((e&3)===0)t=Math.random()*4294967296;r[e]=t>>>((e&3)<<3)&255}return r}}},function(e,t){var r=[];for(var n=0;n<256;++n){r[n]=(n+256).toString(16).substr(1)}function i(e,t){var n=t||0;var i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}e.exports=i},function(e,t,n){"use strict";function i(e,t,n,i){var r=e&65535|0,o=e>>>16&65535|0,s=0;while(n!==0){s=n>2e3?2e3:n;n-=s;do{r=r+t[i++]|0;o=o+r|0}while(--s);r%=65521;o%=65521}return r|o<<16|0}e.exports=i},function(e,t,n){"use strict";function i(){var e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++){e=e&1?3988292384^e>>>1:e>>>1}t[n]=e}return t}var a=i();function r(e,t,n,i){var r=a,o=i+n;e^=-1;for(var s=i;s>>8^r[(e^t[s])&255]}return e^-1}e.exports=r},function(e,t,n){"use strict";var u=n(4);var r=true;var o=true;try{String.fromCharCode.apply(null,[0])}catch(s){r=false}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(s){o=false}var l=new u.Buf8(256);for(var i=0;i<256;i++){l[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1}l[254]=l[254]=1;t.string2buf=function(e){var t,n,i,r,o,s=e.length,a=0;for(r=0;r>>6;t[o++]=128|n&63}else if(n<65536){t[o++]=224|n>>>12;t[o++]=128|n>>>6&63;t[o++]=128|n&63}else{t[o++]=240|n>>>18;t[o++]=128|n>>>12&63;t[o++]=128|n>>>6&63;t[o++]=128|n&63}}return t};function f(e,t){if(t<65534){if(e.subarray&&o||!e.subarray&&r){return String.fromCharCode.apply(null,u.shrinkBuf(e,t))}}var n="";for(var i=0;i4){a[i++]=65533;n+=o-1;continue}r&=o===2?31:o===3?15:7;while(o>1&&n1){a[i++]=65533;continue}if(r<65536){a[i++]=r}else{r-=65536;a[i++]=55296|r>>10&1023;a[i++]=56320|r&1023}}return f(a,i)};t.utf8border=function(e,t){var n;t=t||e.length;if(t>e.length){t=e.length}n=t-1;while(n>=0&&(e[n]&192)===128){n--}if(n<0){return t}if(n===0){return t}return n+l[e[n]]>t?n:t}},function(e,t,n){"use strict";function i(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}e.exports=i},function(e,t,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e){(function(){var e;t.exports=e=function(){function e(){}e.prototype.hasFeature=function(e,t){return true};e.prototype.createDocumentType=function(e,t,n){throw new Error("This DOM method is not implemented.")};e.prototype.createDocument=function(e,t,n){throw new Error("This DOM method is not implemented.")};e.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")};e.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")};return e}()}).call(this)},function(f,e,c){(function(){var r,n,i,e,t,o,s,a,u=function(e,t){for(var n in t){if(l.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},l={}.hasOwnProperty;a=c(3).isPlainObject;i=c(46);n=c(91);t=c(2);r=c(0);s=c(50);o=c(33);f.exports=e=function(e){u(t,e);function t(e){t.__super__.constructor.call(this,null);this.name="#document";this.type=r.Document;this.documentURI=null;this.domConfig=new n;e||(e={});if(!e.writer){e.writer=new o}this.options=e;this.stringify=new s(e)}Object.defineProperty(t.prototype,"implementation",{value:new i});Object.defineProperty(t.prototype,"doctype",{get:function(){var e,t,n,i;i=this.children;for(t=0,n=i.length;t"}else{return"attribute: {"+e+"}, parent: <"+this.parent.name+">"}};e.prototype.isEqualNode=function(e){if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.value!==this.value){return false}return true};return e}()}).call(this)},function(o,e,s){(function(){var n,e,t,i=function(e,t){for(var n in t){if(r.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},r={}.hasOwnProperty;t=s(2);n=s(0);o.exports=e=function(e){i(t,e);function t(e){t.__super__.constructor.call(this,e);this.type=n.Dummy}t.prototype.clone=function(){return Object.create(this)};t.prototype.toString=function(e){return""};return t}(t)}).call(this)},function(t,e){(function(){var e,r=function(e,t){return function(){return e.apply(t,arguments)}},o={}.hasOwnProperty;t.exports=e=function(){function e(e){this.assertLegalName=r(this.assertLegalName,this);this.assertLegalChar=r(this.assertLegalChar,this);var t,n,i;e||(e={});this.options=e;if(!this.options.version){this.options.version="1.0"}n=e.stringify||{};for(t in n){if(!o.call(n,t))continue;i=n[t];this[t]=i}}e.prototype.name=function(e){if(this.options.noValidation){return e}return this.assertLegalName(""+e||"")};e.prototype.text=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.textEscape(""+e||""))};e.prototype.cdata=function(e){if(this.options.noValidation){return e}e=""+e||"";e=e.replace("]]>","]]]]>");return this.assertLegalChar(e)};e.prototype.comment=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+e)}return this.assertLegalChar(e)};e.prototype.raw=function(e){if(this.options.noValidation){return e}return""+e||""};e.prototype.attValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.attEscape(e=""+e||""))};e.prototype.insTarget=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.insValue=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/\?>/)){throw new Error("Invalid processing instruction value: "+e)}return this.assertLegalChar(e)};e.prototype.xmlVersion=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+e)}return e};e.prototype.xmlEncoding=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+e)}return this.assertLegalChar(e)};e.prototype.xmlStandalone=function(e){if(this.options.noValidation){return e}if(e){return"yes"}else{return"no"}};e.prototype.dtdPubID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdSysID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdElementValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdAttType=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdAttDefault=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdEntityValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdNData=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.convertAttKey="@";e.prototype.convertPIKey="?";e.prototype.convertTextKey="#text";e.prototype.convertCDataKey="#cdata";e.prototype.convertCommentKey="#comment";e.prototype.convertRawKey="#raw";e.prototype.assertLegalChar=function(e){var t,n;if(this.options.noValidation){return e}t="";if(this.options.version==="1.0"){t=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(n=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+n.index)}}else if(this.options.version==="1.1"){t=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(n=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+n.index)}}return e};e.prototype.assertLegalName=function(e){var t;if(this.options.noValidation){return e}this.assertLegalChar(e);t=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!e.match(t)){throw new Error("Invalid character in name")}return e};e.prototype.textEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&").replace(//g,">").replace(/\r/g," ")};e.prototype.attEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&").replace(/0){return new Array(i).join(t.indent)}}return""};e.prototype.endline=function(e,t,n){if(!t.pretty||t.suppressPrettyCount){return""}else{return t.newline}};e.prototype.attribute=function(e,t,n){var i;this.openAttribute(e,t,n);i=" "+e.name+'="'+e.value+'"';this.closeAttribute(e,t,n);return i};e.prototype.cdata=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+""+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.comment=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"\x3c!-- ";t.state=g.InsideTag;i+=e.value;t.state=g.CloseTag;i+=" --\x3e"+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.declaration=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"";i+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.docType=function(e,t,n){var i,r,o,s,a;n||(n=0);this.openNode(e,t,n);t.state=g.OpenTag;s=this.indent(e,t,n);s+="0){s+=" [";s+=this.endline(e,t,n);t.state=g.InsideTag;a=e.children;for(r=0,o=a.length;r";s+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return s};e.prototype.element=function(e,t,n){var i,r,o,s,a,u,l,f,c,h,d,p,v,m;n||(n=0);h=false;d="";this.openNode(e,t,n);t.state=g.OpenTag;d+=this.indent(e,t,n)+"<"+e.name;p=e.attribs;for(c in p){if(!P.call(p,c))continue;i=p[c];d+=this.attribute(i,t,n)}o=e.children.length;s=o===0?null:e.children[0];if(o===0||e.children.every(function(e){return(e.type===y.Text||e.type===y.Raw)&&e.value===""})){if(t.allowEmpty){d+=">";t.state=g.CloseTag;d+=""+this.endline(e,t,n)}else{t.state=g.CloseTag;d+=t.spaceBeforeSlash+"/>"+this.endline(e,t,n)}}else if(t.pretty&&o===1&&(s.type===y.Text||s.type===y.Raw)&&s.value!=null){d+=">";t.state=g.InsideTag;t.suppressPrettyCount++;h=true;d+=this.writeChildNode(s,t,n+1);t.suppressPrettyCount--;h=false;t.state=g.CloseTag;d+=""+this.endline(e,t,n)}else{if(t.dontPrettyTextNodes){v=e.children;for(a=0,l=v.length;a"+this.endline(e,t,n);t.state=g.InsideTag;m=e.children;for(u=0,f=m.length;u";if(h){t.suppressPrettyCount--}d+=this.endline(e,t,n);t.state=g.None}this.closeNode(e,t,n);return d};e.prototype.writeChildNode=function(e,t,n){switch(e.type){case y.CData:return this.cdata(e,t,n);case y.Comment:return this.comment(e,t,n);case y.Element:return this.element(e,t,n);case y.Raw:return this.raw(e,t,n);case y.Text:return this.text(e,t,n);case y.ProcessingInstruction:return this.processingInstruction(e,t,n);case y.Dummy:return"";case y.Declaration:return this.declaration(e,t,n);case y.DocType:return this.docType(e,t,n);case y.AttributeDeclaration:return this.dtdAttList(e,t,n);case y.ElementDeclaration:return this.dtdElement(e,t,n);case y.EntityDeclaration:return this.dtdEntity(e,t,n);case y.NotationDeclaration:return this.dtdNotation(e,t,n);default:throw new Error("Unknown XML node type: "+e.constructor.name)}};e.prototype.processingInstruction=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"";i+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.raw=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n);t.state=g.InsideTag;i+=e.value;t.state=g.CloseTag;i+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.text=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n);t.state=g.InsideTag;i+=e.value;t.state=g.CloseTag;i+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.dtdAttList=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+""+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.dtdElement=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+""+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.dtdEntity=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+""+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.dtdNotation=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+""+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.openNode=function(e,t,n){};e.prototype.closeNode=function(e,t,n){};e.prototype.openAttribute=function(e,t,n){};e.prototype.closeAttribute=function(e,t,n){};return e}()}).call(this)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return n.call(e)=="[object Array]"}},function(G,e,V){"use strict";(function(e,y){var g=V(15);G.exports=v;var i=V(52);var s;v.ReadableState=p;var L=V(13).EventEmitter;var P=function(e,t){return e.listeners(t).length};var r=V(54);var a=V(16).Buffer;var t=e.Uint8Array||function(){};function u(e){return a.from(e)}function o(e){return a.isBuffer(e)||e instanceof t}var n=Object.create(V(9));n.inherits=V(7);var l=V(103);var w=void 0;if(l&&l.debuglog){w=l.debuglog("stream")}else{w=function(){}}var f=V(104);var c=V(55);var h;n.inherits(v,r);var d=["error","close","destroy","pause","resume"];function S(e,t,n){if(typeof e.prependListener==="function")return e.prependListener(t,n);if(!e._events||!e._events[t])e.on(t,n);else if(i(e._events[t]))e._events[t].unshift(n);else e._events[t]=[n,e._events[t]]}function p(e,t){s=s||V(5);e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode;if(n)this.objectMode=this.objectMode||!!e.readableObjectMode;var i=e.highWaterMark;var r=e.readableHighWaterMark;var o=this.objectMode?16:16*1024;if(i||i===0)this.highWaterMark=i;else if(n&&(r||r===0))this.highWaterMark=r;else this.highWaterMark=o;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new f;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=e.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(e.encoding){if(!h)h=V(37).StringDecoder;this.decoder=new h(e.encoding);this.encoding=e.encoding}}function v(e){s=s||V(5);if(!(this instanceof v))return new v(e);this._readableState=new p(e,this);this.readable=true;if(e){if(typeof e.read==="function")this._read=e.read;if(typeof e.destroy==="function")this._destroy=e.destroy}r.call(this)}Object.defineProperty(v.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(e){if(!this._readableState){return}this._readableState.destroyed=e}});v.prototype.destroy=c.destroy;v.prototype._undestroy=c.undestroy;v.prototype._destroy=function(e,t){this.push(null);t(e)};v.prototype.push=function(e,t){var n=this._readableState;var i;if(!n.objectMode){if(typeof e==="string"){t=t||n.defaultEncoding;if(t!==n.encoding){e=a.from(e,t);t=""}i=true}}else{i=true}return m(this,e,t,false,i)};v.prototype.unshift=function(e){return m(this,e,null,true,false)};function m(e,t,n,i,r){var o=e._readableState;if(t===null){o.reading=false;D(e,o)}else{var s;if(!r)s=b(o,t);if(s){e.emit("error",s)}else if(o.objectMode||t&&t.length>0){if(typeof t!=="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==a.prototype){t=u(t)}if(i){if(o.endEmitted)e.emit("error",new Error("stream.unshift() after end event"));else _(e,o,t,true)}else if(o.ended){e.emit("error",new Error("stream.push() after EOF"))}else{o.reading=false;if(o.decoder&&!n){t=o.decoder.write(t);if(o.objectMode||t.length!==0)_(e,o,t,false);else E(e,o)}else{_(e,o,t,false)}}}else if(!i){o.reading=false}}return C(o)}function _(e,t,n,i){if(t.flowing&&t.length===0&&!t.sync){e.emit("data",n);e.read(0)}else{t.length+=t.objectMode?1:n.length;if(i)t.buffer.unshift(n);else t.buffer.push(n);if(t.needReadable)x(e)}E(e,t)}function b(e,t){var n;if(!o(t)&&typeof t!=="string"&&t!==undefined&&!e.objectMode){n=new TypeError("Invalid non-string/buffer chunk")}return n}function C(e){return!e.ended&&(e.needReadable||e.length=k){e=k}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function R(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=T(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}v.prototype.read=function(e){w("read",e);e=parseInt(e,10);var t=this._readableState;var n=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){w("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)O(this);else x(this);return null}e=R(e,t);if(e===0&&t.ended){if(t.length===0)O(this);return null}var i=t.needReadable;w("need readable",i);if(t.length===0||t.length-e0)r=A(e,t);else r=null;if(r===null){t.needReadable=true;e=0}else{t.length-=e}if(t.length===0){if(!t.ended)t.needReadable=true;if(n!==e&&t.ended)O(this)}if(r!==null)this.emit("data",r);return r};function D(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();if(n&&n.length){t.buffer.push(n);t.length+=t.objectMode?1:n.length}}t.ended=true;x(e)}function x(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){w("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)g.nextTick(I,e);else I(e)}}function I(e){w("emit readable");e.emit("readable");q(e)}function E(e,t){if(!t.readingMore){t.readingMore=true;g.nextTick(F,e,t)}}function F(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length1&&M(r.pipes,n)!==-1)&&!l){w("false write response, pause",i._readableState.awaitDrain);i._readableState.awaitDrain++;c=true}i.pause()}}function d(e){w("onerror",e);m();n.removeListener("error",d);if(P(n,"error")===0)n.emit("error",e)}S(n,"error",d);function p(){n.removeListener("finish",v);m()}n.once("close",p);function v(){w("onfinish");n.removeListener("close",p);m()}n.once("finish",v);function m(){w("unpipe");i.unpipe(n)}n.emit("pipe",i);if(!r.flowing){w("pipe resume");i.resume()}return n};function W(t){return function(){var e=t._readableState;w("pipeOnDrain",e.awaitDrain);if(e.awaitDrain)e.awaitDrain--;if(e.awaitDrain===0&&P(t,"data")){e.flowing=true;q(t)}}}v.prototype.unpipe=function(e){var t=this._readableState;var n={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,n);return this}if(!e){var i=t.pipes;var r=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var o=0;o=t.length){if(t.decoder)n=t.buffer.join("");else if(t.buffer.length===1)n=t.buffer.head.data;else n=t.buffer.concat(t.length);t.buffer.clear()}else{n=J(e,t.buffer,t.decoder)}return n}function J(e,t,n){var i;if(eo.length?o.length:e;if(s===o.length)r+=o;else r+=o.slice(0,e);e-=s;if(e===0){if(s===o.length){++i;if(n.next)t.head=n.next;else t.head=t.tail=null}else{t.head=n;n.data=o.slice(s)}break}++i}t.length-=i;return r}function U(e,t){var n=a.allocUnsafe(e);var i=t.head;var r=1;i.data.copy(n);e-=i.data.length;while(i=i.next){var o=i.data;var s=e>o.length?o.length:e;o.copy(n,n.length-e,0,s);e-=s;if(e===0){if(s===o.length){++r;if(i.next)t.head=i.next;else t.head=t.tail=null}else{t.head=i;i.data=o.slice(s)}break}++r}t.length-=r;return n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!t.endEmitted){t.ended=true;g.nextTick(j,t,e)}}function j(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function M(e,t){for(var n=0,i=e.length;n=0){e._idleTimeoutId=setTimeout(function n(){if(e._onTimeout)e._onTimeout()},t)}};o(106);r.setImmediate=typeof self!=="undefined"&&self.setImmediate||typeof e!=="undefined"&&e.setImmediate||this&&this.setImmediate;r.clearImmediate=typeof self!=="undefined"&&self.clearImmediate||typeof e!=="undefined"&&e.clearImmediate||this&&this.clearImmediate}).call(this,o(6))},function(e,t,n){"use strict";e.exports=s;var i=n(5);var r=Object.create(n(9));r.inherits=n(7);r.inherits(s,i);function o(e,t){var n=this._transformState;n.transforming=false;var i=n.writecb;if(!i){return this.emit("error",new Error("write callback called multiple times"))}n.writechunk=null;n.writecb=null;if(t!=null)this.push(t);i(e);var r=this._readableState;r.reading=false;if(r.needReadable||r.length0&&u[1].indexOf("trident")>-1){u[1]="msie"}var l={};l[u[1]]=true;l.version=Math.floor(u[2].split(".")[0]);if(l.safari){var f=a.indexOf("version/")+8;var c=a.indexOf(" safari/");var h=a.slice(f,c);l.version=Math.floor(h.split(".")[0])}return l}},{key:"createEventScript",value:function r(e,t,n){var i=document.createElement("script");i.htmlFor=e;i.event=t;i.innerHTML=n;document.getElementById(e).appendChild(i)}},{key:"createxmlDoc",value:function o(){var e;var t=["MSXML2.DOMDocument","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","Microsoft.XmlDom"];for(var n=0,i=t.length;n0){t=new ActiveXObject("Microsoft.XMLDOM");t["async"]=false;t.loadXML(e)}else{var n=new DOMParser;t=n.parseFromString(e,"text/xml")}}catch(i){t=new ActiveXObject("Microsoft.XMLDOM");t["async"]=false;t.loadXML(e)}return t}},{key:"isNotSupportNoPlugin",value:function n(){var e=this.browser();var t=false;if(e.edge&&e.version<16){t=true}else if(e.safari&&e.version<11){t=true}else if(e.chrome&&e.version<57){t=true}else if(e.firfox&&e.version<52){t=true}return t}},{key:"encode",value:function f(e){var t="";var n;var i;var r;var o;var s;var a;var u;var l=0;e=this._utf8_encode(e);while(l>2;s=(n&3)<<4|i>>4;a=(i&15)<<2|r>>6;u=r&63;if(isNaN(i)){a=u=64}else if(isNaN(r)){u=64}t=t+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(a)+this._keyStr.charAt(u)}return t}},{key:"decode",value:function c(e){var t="";var n;var i;var r;var o;var s;var a;var u;var l=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(l>4;i=(s&15)<<4|a>>2;r=(a&3)<<6|u;t=t+String.fromCharCode(n);if(a!==64){t=t+String.fromCharCode(i)}if(u!==64){t=t+String.fromCharCode(r)}}t=this._utf8_decode(t);return t}},{key:"_utf8_encode",value:function a(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n127&&i<2048){t+=String.fromCharCode(i>>6|192);t+=String.fromCharCode(i&63|128)}else{t+=String.fromCharCode(i>>12|224);t+=String.fromCharCode(i>>6&63|128);t+=String.fromCharCode(i&63|128)}}return t}},{key:"_utf8_decode",value:function u(e){var t="";var n=0;var i=0;var r=0;while(n191&&i<224){r=e.charCodeAt(n+1);t+=String.fromCharCode((i&31)<<6|r&63);n+=2}else{r=e.charCodeAt(n+1);var o=e.charCodeAt(n+2);t+=String.fromCharCode((i&15)<<12|(r&63)<<6|o&63);n+=3}}return t}},{key:"colorTransfer",value:function i(e){var t=parseInt(e,10);var n=t.toString(16);n="0"+n;return n.substring(n.length-2)}},{key:"colorRgb",value:function l(e){var t=e.toLowerCase();var n=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(t&&n.test(t)){if(t.length===4){var i="#";for(var r=1;r<4;r+=1){i+=t.slice(r,r+1).concat(t.slice(r,r+1))}t=i}var o=[];for(var s=1;s<7;s+=2){o.push(parseInt("0x"+t.slice(s,s+2),16))}return o}return[0,0,0]}}]);return e}();var r=t.oUtils=new i},function(e,t,n){e.exports=n(61)},function(e,t,n){"use strict";(function(Xt){Object.defineProperty(t,"__esModule",{value:true});t.JSVideoPlugin=undefined;var Zt=function(){function i(e,t){for(var n=0;n0){e.oOptions.iPluginType=e.oOptions.iFoceInitMode}if(e.oOptions.iPluginType>-1){if(e.oOptions.iPluginType===0){e.initActiveX()}else if(e.oOptions.iPluginType===1){setTimeout(function(){e.initJSPlugin()},300)}else if(e.oOptions.iPluginType===2){if(window._oMultiVideoPlugin&&!e.oOptions.bNewInstance){e.reInitLocalService()}else{e.initLocalService()}}return}if(en.oUtils.browser().msie){e.initActiveX()}else{if(rn[e.oOptions.szId]&&!e.oOptions.bNewInstance){e.reInitLocalService()}else{e.initLocalService()}}}},{key:"JS_GetVideoMode",value:function e(){return this.iPluginMode}},{key:"JS_CreateWnd",value:function a(e,t,n){return this.oPlugin.JS_CreateWnd(e,t,n)}},{key:"JS_ShowWnd",value:function u(){return this.oPlugin.JS_ShowWnd()}},{key:"JS_HideWnd",value:function l(){return this.oPlugin.JS_HideWnd()}},{key:"JS_SetWndCover",value:function f(e,t){return this.oPlugin.JS_SetWndCover(e,t)}},{key:"JS_CheckLocalServiceConnected",value:function c(){return $t.LocalServiceControl.prototype.JS_CheckLocalServiceConnected()}},{key:"JS_SetWindowControlCallback",value:function h(e){this.oPlugin.JS_SetWindowControlCallback(e)}},{key:"JS_ArrangeWindow",value:function d(e,t){return this.oPlugin.JS_ArrangeWindow(e,t)}},{key:"JS_SetSecretKey",value:function p(e,t,n){return this.oPlugin.JS_SetSecretKey(e,t,n)}},{key:"JS_SetOriginalString",value:function v(e,t){return this.oPlugin.JS_SetOriginalString(e,t)}},{key:"JS_GetEncryptString",value:function m(e,t,n){return this.oPlugin.JS_GetEncryptString(e,t,n)}},{key:"JS_GetDecryptString",value:function y(e,t,n){return this.oPlugin.JS_GetDecryptString(e,t,n)}},{key:"JS_DestroyPlugin",value:function g(){return this.oPlugin.JS_DestroyPlugin(this.oOptions.bNewInstance)}},{key:"JS_Play",value:function P(e,t,n,i,r,o){var s=e.indexOf("://")+3;var a=e.substring(s).indexOf("/");var u=e.substring(0,a+s);var l=e.substring(a+s+1);if(this.iPluginMode===0||this.iPluginMode===2){if(!o){if(!i&&!r){e=u.replace(/video/i,"rtsp")+"/ISAPI/streaming/channels/"+l;if(l==="0"){e=u.replace(/video/i,"rtsp")+"/ISAPI/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/101"}}else{e=u.replace(/video/i,"rtsp")+"/ISAPI/streaming/tracks/"+l+"?starttime="+i+"&endtime="+r}}var f=t.auth;var c=en.oUtils.decode(f);if(c.indexOf(":::4:")===-1){f=t.userInfo}e=e.replace(/https/g,"http");e=e.replace(/rtsps/g,"rtsp");return this.oPlugin.JS_Play(e,{auth:f},n,i,r)}else if(this.iPluginMode===1){e=e.replace(/video/i,"ws");var h=en.oUtils.decode(t.auth);var d={sessionID:h.split("::")[1]};if(h.indexOf(":::3:")>-1){d={sessionID:h.split(":::3:")[1]}}else if(h.indexOf(":::4:")>-1){d={token:h.split(":::4:")[1]}}t.secondAuth&&(d.secondAuth=t.secondAuth);return this.oPlugin.JS_Play(e,d,n,i,r)}}},{key:"JS_Play2",value:function w(e,t){return this.oPlugin.JS_Play2(e,t)}},{key:"JS_OpenFileBrowser2",value:function S(e,t){return this.oPlugin.JS_OpenFileBrowser2(e,t)}},{key:"JS_uploadFileByForm",value:function _(e){return this.oPlugin.JS_uploadFileByForm(e)}},{key:"JS_StopFormAsynUpload",value:function b(){return this.oPlugin.JS_StopFormAsynUpload()}},{key:"JS_ReversePlay",value:function C(e,t,n,i,r){var o=e.indexOf("://")+3;var s=e.substring(o).indexOf("/");var a=e.substring(0,s+o);var u=e.substring(s+o+1);if(this.iPluginMode===0||this.iPluginMode===2){e=a.replace(/video/i,"rtsp")+"/ISAPI/streaming/tracks/"+u+"?starttime="+i+"&endtime="+r;var l=t.auth;var f=en.oUtils.decode(l);if(f.indexOf(":::4:")===-1){l=t.userInfo}e=e.replace(/https/g,"http");return this.oPlugin.JS_ReversePlay(e,{auth:l},n,i,r)}else if(this.iPluginMode===1){e=a.replace(/video/i,"ws");return this.oPlugin.JS_ReversePlay(e,t,n,i,r)}}},{key:"JS_Stop",value:function k(e){return this.oPlugin.JS_Stop(e)}},{key:"JS_Seek",value:function T(e,t,n){return this.oPlugin.JS_Seek(e,t,n)}},{key:"JS_StopRealPlayAll",value:function R(){return this.oPlugin.JS_StopRealPlayAll()}},{key:"JS_Pause",value:function D(e){return this.oPlugin.JS_Pause(e)}},{key:"JS_Resume",value:function x(e){return this.oPlugin.JS_Resume(e)}},{key:"JS_Slow",value:function I(e){return this.oPlugin.JS_Slow(e)}},{key:"JS_Fast",value:function E(e){return this.oPlugin.JS_Fast(e)}},{key:"JS_Transmission",value:function q(e,t){return this.oPlugin.JS_Transmission(e,t)}},{key:"JS_FrameForward",value:function A(e){return this.oPlugin.JS_FrameForward(e)}},{key:"JS_GetOSDTime",value:function O(e){return this.oPlugin.JS_GetOSDTime(e)}},{key:"JS_GetPlayInfo",value:function M(e){return this.oPlugin.JS_GetPlayInfo(e)}},{key:"JS_OpenSound",value:function L(e){return this.oPlugin.JS_OpenSound(e)}},{key:"JS_CloseSound",value:function F(){return this.oPlugin.JS_CloseSound()}},{key:"JS_GetVolume",value:function W(e){return this.oPlugin.JS_GetVolume(e)}},{key:"JS_SetVolume",value:function N(e,t){return this.oPlugin.JS_SetVolume(e,t)}},{key:"JS_EnableZoom",value:function B(e,t){return this.oPlugin.JS_EnableZoom(e,t)}},{key:"JS_DisableZoom",value:function z(e){return this.oPlugin.JS_DisableZoom(e)}},{key:"JS_CapturePicture",value:function J(e,t,n){return this.oPlugin.JS_CapturePicture(e,t,n)}},{key:"JS_StartSave",value:function H(e,t){return this.oPlugin.JS_StartSave(e,t)}},{key:"JS_StopSave",value:function U(e){return this.oPlugin.JS_StopSave(e)}},{key:"JS_StartTalk",value:function j(e,t,n,i,r,o,s,a,u,l){return this.oPlugin.JS_StartTalk(e,t,n,i,r,o,s,a,u,l)}},{key:"JS_StopTalk",value:function G(){return this.oPlugin.JS_StopTalk()}},{key:"JS_SetPlayMode",value:function V(e){return this.oPlugin.JS_SetPlayMode(e)}},{key:"JS_SetFullScreenCapability",value:function Y(e){return this.oPlugin.JS_SetFullScreenCapability(e)}},{key:"JS_FullScreenDisplay",value:function X(e){return this.oPlugin.JS_FullScreenDisplay(e)}},{key:"JS_EnableIVS",value:function Z(e,t,n){return this.oPlugin.JS_EnableIVS(e,t,n)}},{key:"JS_SRInit",value:function K(e,t){return this.oPlugin.JS_SRInit(e,t)}},{key:"JS_SRPTZ",value:function $(e,t,n){return this.oPlugin.JS_SRPTZ(e,t,n)}},{key:"JS_SetPlaybackDrawType",value:function Q(e,t){return this.oPlugin.JS_SetPlaybackDrawType(e,t)}},{key:"JS_SetPlayBackType",value:function ee(e){return this.oPlugin.JS_SetPlayBackType(e)}},{key:"JS_SetTrsPlayBackParam",value:function te(e,t){return this.oPlugin.JS_SetTrsPlayBackParam(e,t)}},{key:"JS_GetLocalConfig",value:function ne(){return this.oPlugin.JS_GetLocalConfig()}},{key:"JS_SetLocalConfig",value:function ie(e){return this.oPlugin.JS_SetLocalConfig(e)}},{key:"JS_GetLastError",value:function re(){return this.oPlugin.JS_GetLastError()}},{key:"JS_OpenFileBrowser",value:function oe(e,t){return this.oPlugin.JS_OpenFileBrowser(e,t)}},{key:"JS_OpenDirectory",value:function se(e){return this.oPlugin.JS_OpenDirectory(e)}},{key:"JS_StartAsynUpload",value:function ae(e,t,n,i,r){if(r&&this.iPluginMode===1){var o=en.oUtils.decode(n);n=o.split(":::4:")[1]}return this.oPlugin.JS_StartAsynUpload(e,t,n,i,r)}},{key:"JS_StopAsynUpload",value:function ue(){return this.oPlugin.JS_StopAsynUpload()}},{key:"JS_GetUploadErrorInfo",value:function le(){return this.oPlugin.JS_GetUploadErrorInfo()}},{key:"JS_UploadFile",value:function fe(e,t,n,i,r){if(r&&this.iPluginMode===1){var o=en.oUtils.decode(t);t=o.split(":::4:")[1]}return this.oPlugin.JS_UploadFile(e,t,n,i,r)}},{key:"JS_GetIpcImportErrorInfo",value:function ce(){return this.oPlugin.JS_GetIpcImportErrorInfo()}},{key:"JS_DownloadFile",value:function he(e,t,n,i,r,o){return this.oPlugin.JS_DownloadFile(e,t,n,i,r,o)}},{key:"JS_DownloadFileNoPlugin",value:function de(e,t,n,i,r,o){return this.oPlugin.JS_DownloadFileNoPlugin(e,t,n,i,r,o)}},{key:"JS_StartUpgrade",value:function pe(e,t,n,i,r,o){if(o&&this.iPluginMode===1){var s=en.oUtils.decode(n);n=s.split(":::4:")[1]}return this.oPlugin.JS_StartUpgrade(e,t,n,i,r,o)}},{key:"JS_StopUpgrade",value:function ve(){return this.oPlugin.JS_StopUpgrade()}},{key:"JS_GetUpgradeStatus",value:function me(){return this.oPlugin.JS_GetUpgradeStatus()}},{key:"JS_GetUpgradeProgress",value:function ye(){return this.oPlugin.JS_GetUpgradeProgress()}},{key:"JS_ExportDeviceLog",value:function ge(e,t,n){var i=null;if(this.iPluginMode!==0){i=Kt.JSPlugin.prototype.JS_ExportDeviceLog(e,t,n)}else{i=this.oPlugin.JS_ExportDeviceLog(e,t,n)}return i}},{key:"JS_ExportReport",value:function Pe(e,t,n){var i=null;if(this.iPluginMode!==0){i=Kt.JSPlugin.prototype.JS_ExportReport(e,t,n)}else{i=this.oPlugin.JS_ExportReport(e,t,n)}return i}},{key:"JS_StartAsyncDownload",value:function we(e,t,n,i,r){return this.oPlugin.JS_StartAsyncDownload(e,t,n,i,r)}},{key:"JS_StopAsyncDownload",value:function Se(e){return this.oPlugin.JS_StopAsyncDownload(e)}},{key:"JS_GetDownloadStatus",value:function _e(e){return this.oPlugin.JS_GetDownloadStatus(e)}},{key:"JS_GetDownloadProgress",value:function be(e){return this.oPlugin.JS_GetDownloadProgress(e)}},{key:"JS_EnablePDC",value:function Ce(e,t){return this.oPlugin.JS_EnablePDC(e,t)}},{key:"JS_Resize",value:function ke(e,t){return this.oPlugin.JS_Resize(e,t)}},{key:"JS_SetDrawCallback",value:function Te(e,t,n,i,r,o){return this.oPlugin.JS_SetDrawCallback(e,t,n,i,r,o)}},{key:"JS_SetDrawStatus",value:function Re(e,t,n){return this.oPlugin.JS_SetDrawStatus(e,t,n)}},{key:"JS_ClearRegion",value:function De(){return this.oPlugin.JS_ClearRegion()}},{key:"JS_SetDrawShapeInfo",value:function xe(e,t){return this.oPlugin.JS_SetDrawShapeInfo(e,t)}},{key:"JS_SetGridInfo",value:function Ie(e){return this.oPlugin.JS_SetGridInfo(e)}},{key:"JS_GetGridInfo",value:function Ee(){return this.oPlugin.JS_GetGridInfo()}},{key:"JS_SetRectInfo",value:function qe(e){return this.oPlugin.JS_SetRectInfo(e)}},{key:"JS_GetRectInfo",value:function Ae(){return this.oPlugin.JS_GetRectInfo()}},{key:"JS_SetPolygonInfo",value:function Oe(e){return this.oPlugin.JS_SetPolygonInfo(e)}},{key:"JS_GetPolygonInfo",value:function Me(){return this.oPlugin.JS_GetPolygonInfo()}},{key:"JS_SetLineInfo",value:function Le(e){return this.oPlugin.JS_SetLineInfo(e)}},{key:"JS_GetLineInfo",value:function Fe(){return this.oPlugin.JS_GetLineInfo()}},{key:"JS_SetPointInfo",value:function We(e,t){return this.oPlugin.JS_SetPointInfo(e,t)}},{key:"JS_GetPointInfo",value:function Ne(){return this.oPlugin.JS_GetPointInfo()}},{key:"JS_SetTextOverlay",value:function Be(e){return this.oPlugin.JS_SetTextOverlay(e)}},{key:"JS_GetTextOverlay",value:function ze(){return this.oPlugin.JS_GetTextOverlay()}},{key:"JS_ClearShapeByType",value:function Je(e,t){return this.oPlugin.JS_ClearShapeByType(e,t)}},{key:"JS_ChooseShape",value:function He(e,t){return this.oPlugin.JS_ChooseShape(e,t)}},{key:"JS_SetCorrectionType",value:function Ue(e){return this.oPlugin.JS_SetCorrectionType(e)}},{key:"JS_SetPlaceType",value:function je(e){return this.oPlugin.JS_SetPlaceType(e)}},{key:"JS_StartFishListener",value:function Ge(e,t,n){return this.oPlugin.JS_StartFishListener(e,t,n)}},{key:"JS_StopFishListener",value:function Ve(){return this.oPlugin.JS_StopFishListener()}},{key:"JS_SetFishBoxListInfo",value:function Ye(e){return this.oPlugin.JS_SetFishBoxListInfo(e)}},{key:"JS_GetFishBoxListInfo",value:function Xe(){return this.oPlugin.JS_GetFishBoxListInfo()}},{key:"JS_ClearAllWndFishBoxInfo",value:function Ze(){return this.oPlugin.JS_ClearAllWndFishBoxInfo()}},{key:"JS_SetFishWndProperty",value:function Ke(e,t,n){return this.oPlugin.JS_SetFishWndProperty(e,t,n)}},{key:"JS_SetFishParams",value:function $e(e,t,n,i){return this.oPlugin.JS_SetFishParams(e,t,n,i)}},{key:"JS_ArrangeFECWindow",value:function Qe(e){return this.oPlugin.JS_ArrangeFECWindow(e)}},{key:"JS_StartFECScan",value:function et(e){return this.oPlugin.JS_StartFECScan(e)}},{key:"JS_StopFECScan",value:function tt(){return this.oPlugin.JS_StopFECScan()}},{key:"JS_FishEyePTZ",value:function nt(e,t){return this.oPlugin.JS_FishEyePTZ(e,t)}},{key:"JS_FishEyeGetPreset",value:function it(){return this.oPlugin.JS_FishEyeGetPreset()}},{key:"JS_FishEyeSetPreset",value:function rt(e){return this.oPlugin.JS_FishEyeSetPreset(e)}},{key:"JS_StartFECCruise",value:function ot(e){return this.oPlugin.JS_StartFECCruise(e)}},{key:"JS_StopFECCruise",value:function st(){return this.oPlugin.JS_StopFECCruise()}},{key:"JS_SetIsHttps",value:function at(e){return this.oPlugin.JS_SetIsHttps(e)}},{key:"JS_SetReconnectInfo",value:function ut(e,t){return this.oPlugin.JS_SetReconnectInfo(e,t)}},{key:"JS_CheckUpdate",value:function lt(e){return this.oPlugin.JS_CheckUpdate(e)}},{key:"JS_SelectShape",value:function ft(e,t){return this.oPlugin.JS_SelectShape(e,t)}},{key:"JS_GetPictureSize",value:function ct(e){return this.oPlugin.JS_GetPictureSize(e)}},{key:"JS_SetOriginResolution",value:function ht(e,t,n){return this.oPlugin.JS_SetOriginResolution(e,t,n)}},{key:"JS_SetPlayWndMode",value:function dt(e,t,n){return this.oPlugin.JS_SetPlayWndMode(e,t,n)}},{key:"JS_UpdateWindowStyle",value:function pt(e){return this.oPlugin.JS_UpdateWindowStyle(e)}},{key:"JS_CuttingPartWindow",value:function vt(e,t,n,i){return this.oPlugin.JS_CuttingPartWindow(e,t,n,i)}},{key:"JS_RepairPartWindow",value:function mt(e,t,n,i){return this.oPlugin.JS_RepairPartWindow(e,t,n,i)}},{key:"JS_ClearAllCanvas",value:function yt(){var e=null;if(this.iPluginMode===1){e=this.oPlugin.JS_ClearAllCanvas()}else{e=new Promise(function(e){e()})}return e}},{key:"JS_PlayWithImg",value:function gt(e,t){return this.oPlugin.JS_PlayWithImg(e,t)}},{key:"JS_DestroyAll",value:function Pt(){return this.oPlugin.JS_DestroyAll()}},{key:"JS_SetPackageType",value:function wt(e){return this.oPlugin.JS_SetPackageType(e)}},{key:"JS_SetZeroChanInfo",value:function St(e,t,n){return this.oPlugin.JS_SetZeroChanInfo(e,t,n)}},{key:"JS_SetSnapDrawWndIndex",value:function _t(e){return this.oPlugin.JS_SetSnapDrawWndIndex(e)}},{key:"JS_SetWindowSelected",value:function bt(e){return this.oPlugin.JS_SetWindowSelected(e)}},{key:"JS_GetDownFilePath",value:function Ct(e){return this.oPlugin.JS_GetDownFilePath(e)}},{key:"JS_SycVideoAndAudio",value:function kt(e,t,n){return this.oPlugin.JS_SycVideoAndAudio(e,t,n)}},{key:"JS_DeleteDownloadFile",value:function Tt(e,t,n){return this.oPlugin.JS_DeleteDownloadFile(e,t,n)}},{key:"JS_GetEngineSupport",value:function Rt(){return this.oPlugin.JS_GetEngineSupport()}},{key:"JS_ExsitGetSlfPointList",value:function Dt(){return this.oPlugin.JS_ExistGetSlfPointList()}},{key:"JS_GetSlfPointList",value:function xt(e,t){return this.oPlugin.JS_GetSlfPointList(e,t)}},{key:"JS_GetSlfVersion",value:function It(){return this.oPlugin.JS_GetSlfVersion()}},{key:"JS_AudioPlay",value:function Et(e,t,n,i,r,o){return this.oPlugin.JS_AudioPlay(e,t,n,i,r,o)}},{key:"JS_StartSycAudioPlay",value:function qt(e,t,n,i){return this.oPlugin.JS_StartSycAudioPlay(e,t,n,i)}},{key:"JS_StopSycAudioPlay",value:function At(e){return this.oPlugin.JS_StopSycAudioPlay(e)}},{key:"JS_SetAudioPlayStatus",value:function Ot(e){return this.oPlugin.JS_SetAudioPlayStatus(e)}},{key:"JS_StopAudioPlay",value:function Mt(){return this.oPlugin.JS_StopAudioPlay()}},{key:"JS_StartAudioSave",value:function Lt(e){return this.oPlugin.JS_StartAudioSave(e)}},{key:"JS_StopAudioSave",value:function Ft(){return this.oPlugin.JS_StopAudioSave()}},{key:"JS_GetAudioPlayedTime",value:function Wt(){return this.oPlugin.JS_GetAudioPlayedTime()}},{key:"JS_AudioPause",value:function Nt(){return this.oPlugin.JS_AudioPause()}},{key:"JS_AudioResume",value:function Bt(){return this.oPlugin.JS_AudioResume()}},{key:"JS_SetAudioVolume",value:function zt(e,t){return this.oPlugin.JS_SetAudioVolume(e,t)}},{key:"JS_StartAlarmChan",value:function Jt(e,t,n,i){var r;if(isNaN(i)){arguments[3]=3e4}var o=Array.prototype.slice.call(arguments,0);return(r=this.oPlugin).JS_StartAlarmChan.apply(r,tn(o))}},{key:"JS_StopAlarmChan",value:function Ht(e){var t;if(isNaN(e)){arguments[0]=3e4}var n=Array.prototype.slice.call(arguments,0);return(t=this.oPlugin).JS_StopAlarmChan.apply(t,tn(n))}},{key:"JS_StartFormAsynUpload",value:function Ut(e,t){var n;if(isNaN(t)){arguments[1]=3e4}var i=Array.prototype.slice.call(arguments,0);return(n=this.oPlugin).JS_StartFormAsynUpload.apply(n,tn(i))}},{key:"JS_StopFormAsynUpload",value:function b(e){var t;if(isNaN(e)){arguments[0]=3e4}var n=Array.prototype.slice.call(arguments,0);return(t=this.oPlugin).JS_StopFormAsynUpload.apply(t,tn(n))}},{key:"JS_IsPluginExist",value:function jt(){try{return this.oPlugin.JS_IsPluginExist()}catch(e){console.log(e);return false}}},{key:"JS_SetPicInfoToPlayer",value:function Gt(e,t,n,i){return this.oPlugin.JS_SetPicInfoToPlayer(e,t,n,i)}},{key:"JS_SubmitHttpRequest",value:function Vt(e){return this.oPlugin.JS_StartSyncHttpTransmission(e)}},{key:"JS_GetCaptureData",value:function Yt(e){return this.oPlugin.JS_GetCaptureData(e)}}]);return n}();e.getPluginMode=function(t,n,i){var r=0;var e=new Promise(function(e){if(en.oUtils.browser().msie||en.oUtils.browser().safari&&en.oUtils.browser().version<11||en.oUtils.browser().firefox&&en.oUtils.browser().version<52||en.oUtils.browser().chrome&&en.oUtils.browser().version<45){e(r)}else{$t.LocalServiceControl.prototype.JS_CheckLocalServiceConnected(t,n,i).then(function(){r=2;e(r)},function(){r=1;e(r)})}});return e};window.MPversion=function(){var e=n(115);return e};return e}();t.JSVideoPlugin=e}).call(this,n(1))},function(e,t,i){"use strict";(function(xt){Object.defineProperty(t,"__esModule",{value:true});t.JSPlugin=undefined;var It=function(){function i(e,t){for(var n=0;n=Math.pow(u,2)?i:0);var c=s+(f%u===u-1?n:0);var h=a+(f+u>=Math.pow(u,2)?i:0);l+='
'+''+''+'
  • ');xt("#jsplugin_download_li").trigger("click");xt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_DownloadFileNoPlugin",value:function ne(t){var e=new Promise(function(e){xt("body").append('
  • ');xt("#jsplugin_download_li").trigger("click");xt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_StartUpgrade",value:function ie(e,t,n,i,r,s){var o=new Promise(function(i,r){if(!e){r();return}Ke[vt]=0;var o=new XMLHttpRequest;o.onreadystatechange=function(){if(o.readyState===4){if(o.status===200){Ke[vt]=100;i()}else{Ke[vt]=1;var e=Et.oTool.parseXmlFromStr(o.responseText);if(xt(e).find("subStatusCode").text()==="lowPrivilege"){r(403)}else if(xt(e).find("MErrDevSelfEx").length>0||xt(e).find("MErrCode").length>0){var t=parseInt(xt(e).find("MErrDevSelfEx").text(),10);var n=parseInt(xt(e).find("MErrCode").text(),10);if(t>0){r(t)}else if(n>0){r(n)}else{r()}}else{r()}}}};if(s){if(e.indexOf("?")>=0){e+="&token="+n}else{e+="?token="+n}}o.open("put",e,true);o.send(Ke[pt]);Ke[mt]=t});return o}},{key:"JS_StopUpgrade",value:function re(){var e=new Promise(function(e){Ke[pt]=null;e()});return e}},{key:"JS_GetUpgradeStatus",value:function oe(){var e=new Promise(function(e){if(Ke[vt]===100){e(0)}e(Ke[vt])});return e}},{key:"JS_GetUpgradeProgress",value:function se(){var e=new Promise(function(e){var t=0;if(!Ke[mt]){e(t)}var n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===4){if(n.status===200){t=parseInt(xt(Et.oTool.parseXmlFromStr(n.responseText)).find("percent").text(),10)}}};n.open("get",Ke[mt],false);n.send(null);if(Ke[vt]===100){e(100)}e(t)});return e}},{key:"JS_ExportDeviceLog",value:function ae(p,v,m){var e=new Promise(function(e){var t=[];var n=[];t=t.concat(xt(p).find("searchMatchItem").toArray());for(var i=0;i=0?"&":"?")+"playbackURI="+t;xt("body").append('
  • ');xt("#jsplugin_download_li").trigger("click");xt("#jsplugin_download_a").remove();e()});return t}},{key:"JS_StopAsyncDownload",value:function ce(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetDownloadStatus",value:function he(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetDownloadProgress",value:function de(){var e=new Promise(function(e){e()});return e}},{key:"JS_EnablePDC",value:function pe(){var e=new Promise(function(e){e()});return e}},{key:"JS_Resize",value:function ve(n,i){var e=new Promise(function(e){setTimeout(function(){var e=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||false;if(Ke[ht]&&e){n=xt(window).width();i=xt(window).height();rt.find("div").eq(0).css({width:n,height:i})}else{rt.find("div").eq(0).css({width:n,height:i})}Ke[ot].iWidth=n;Ke[ot].iHeight=i;if(Et.oTool.isFirefox()){for(var t=0;t0){if(r.id){var n=Ke[ft].getAllShapesInfo().length;Ke[ft].setMaxShapeSupport(n+1)}else{Ke[ft].setMaxShapeSupport(r.maxShapeSupport)}}Ke[ft].setCurrentShapeInfo({szId:r.id,szTips:r.tips,lineType:r.lineType,iMinClosed:r.minPointSupport||r.minClosed||3,iMaxPointNum:r.maxPointSupport||r.pointNumMax||11,iPolygonType:1,szDrawColor:r.drawColor||"",szFillColor:r.fillColor||r.drawColor||"",iTranslucent:r.translucent||0,iRedrawMode:r.redrawMode||0,type:r.type});e()});return e}},{key:"JS_SetGridInfo",value:function we(i){var e=new Promise(function(e,t){if(i===null||typeof i==="undefined"){t();return}var n="#ff0000";if(i.drawColor){n=i.drawColor}Ke[ft].setDrawStyle(n);Ke[ft].setShapesInfoByType("Grid",[{gridMap:i.gridMap,gridColNum:i.gridColNum,gridRowNum:i.gridRowNum}]);Ke[ft].setShapeType("Grid");e()});return e}},{key:"JS_GetGridInfo",value:function Se(){var e=new Promise(function(e,t){if(!Ke[ft]){t()}var n=Ke[ft].getShapesInfoByType("Grid")[0];if(!n){t()}e({gridColNum:n.gridColNum,gridRowNum:n.gridRowNum,gridMap:n.gridMap})});return e}},{key:"JS_SetRectInfo",value:function _e(s){var e=new Promise(function(e,t){if(typeof s==="undefined"||!s.length){t();return}if(s[0]&&s[0].maxShapeSupport&&s[0].maxShapeSupport>0){Ke[ft].setMaxShapeSupport(s[0].maxShapeSupport)}else{Ke[ft].setMaxShapeSupport(25)}Ke[ft].setDrawMutiShapeOneTime(false);var n=[];if(s.length>0){for(var i=0,r=s.length;i0){n.push(s[i])}}}if(n.length>0){Ke[ft].setShapesInfoByType("Rect",n);e()}else{t()}});return e}},{key:"JS_GetRectInfo",value:function be(){var e=new Promise(function(e,t){if(!Ke[ft]){t()}var n=[];var i=Ke[ft].getShapesInfoByType("Rect");for(var r=0,o=i.length;r0){for(var i=0,r=s.length;i0){Ke[ft].setCurrentShapeInfo({szId:s[i].id});n.push(s[i])}}}if(n.length>0){Ke[ft].setShapesInfoByType("Polygon",n);e()}else{t()}});return e}},{key:"JS_GetPolygonInfo",value:function ke(){var e=new Promise(function(e){var t=[];var n=Ke[ft].getShapesInfoByType("Polygon");for(var i=0,r=n.length;i0){for(var i=0,r=f.length;i0){n.push(f[i])}}}if(n.length>0){Ke[ft].setShapesInfoByType("Line",n);Ke[ft].setShapeType("");e()}else{t()}});return e}},{key:"JS_GetLineInfo",value:function Re(){var e=new Promise(function(e){var t=[];var n=Ke[ft].getShapesInfoByType("Line");for(var i=0,r=n.length;i0){for(var i=0,r=f.length;i0){f[i].points=[l];n.push(f[i])}}}if(n.length>0){Ke[ft].setShapesInfoByType("Point",n);e()}else{t()}});return e}},{key:"JS_GetPointInfo",value:function Ee(){var e=new Promise(function(e){var t=[];var n=Ke[ft].getShapesInfoByType("Point");for(var i=0,r=n.length;i0){for(var i=0,r=s.length;iKe[ut]-1){e=Ke[yt]}Ke.EventCallback.windowEventSelect(e,true);return Promise.resolve()}},{key:"JS_GetSlfPointList",value:function Ge(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetSlfVersion",value:function Ve(){var e=new Promise(function(e){e()});return e}},{key:"JS_ExistGetSlfPointList",value:function Ye(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetIpcImportErrorInfo",value:function Xe(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetWindowSelected",value:function Ze(e){rt.find(".parent-wnd").eq(0).find(".play-window").css("border","1px solid "+Ke.oPluginColor.borderColor);rt.find(".parent-wnd").eq(0).children().eq(e).find(".play-window").eq(0).css("border","1px solid "+Ke.oPluginColor.selectBorderColor);Ke.EventCallback.windowEventSelect(e);return Promise.resolve()}}]);return r}();return t}();t.JSPlugin=e}).call(this,i(1))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.StreamClient=undefined;var d=function(){function i(e,t){for(var n=0;n-1){t=true}var y=this;var i=e.split("://");var r=i[0];var g="";var P=7681;var w=1;var S=0;if(t){g=i[1].split("]:")[0]+"]";P=Math.floor(i[1].split("]:")[1].split("/")[0]);w=Math.floor(i[1].split("]:")[1].split("/")[1]/100);S=Math.floor(i[1].split("]:")[1].split("/")[1]%100)-1}else{g=i[1].split(":")[0];P=Math.floor(i[1].split(":")[1].split("/")[0]);w=Math.floor(i[1].split(":")[1].split("/")[1]/100);S=Math.floor(i[1].split(":")[1].split("/")[1]%100)-1}if(w===0){S=0}v=v||{};var o="&sessionID=";if(v.token&&!v.playURL){o="&token="}var s="";if(v.secondAuth){var a=v.secondAuth.split("&");if(a&&a.length){a.forEach(function(e){if(-1!==e.indexOf("security=")||-1!==e.indexOf("iv=")){s+="&"+e}else{var t=e.split("=");if(t&&2===t.length){v[t[0]]=t[1]}}})}}var u=v.sessionID||v.session||(v.playURL?"":v.token)||"";var _=new window.WebSocket(r+"://"+g+":"+P+(v.mode?"/"+v.mode:"")+"?version="+y[T]+"&cipherSuites="+y[R]+o+u+s+(v.proxy?"&proxy="+v.proxy:""));_.binaryType="arraybuffer";var b=p["default"].v4();var l=new Promise(function(d,p){_.onopen=function(){y[c].push(h.createClientObject(_,b,w,S));if(!v.playURL&&!v.sessionID&&!v.deviceSerial&&!v.token){y[C].push(h.createClientObject(_,b,w,S));d(b)}};_.onmessage=function(e){if(typeof e.data==="string"){var t=JSON.parse(e.data);var n=y[k](b);if(t&&t.version&&t.cipherSuite){y[T]=t.version;y[R]=parseInt(t.cipherSuite,10);if(t&&t.PKD&&t.rand){y[C].push(x.createClientObject(_,b,t.PKD,t.rand,v))}else{var i="live://"+g+":"+P+"/"+w+"/"+S;if(y[R]===-1){y[C].push(I.createClientObject(_,b,i,v))}else{y[C].push(D.createClientObject(_,b,i))}}d(b);return}if(t&&t.sdp){var r=D.getMediaFromSdp(t.sdp);var o=D.getMediaType(t.sdp);if("0004"===o){m({type:"videoNotSupport"})}else{m({bHead:true,buf:r})}}if(t&&t.cmd){if(t.cmd==="end"){m({type:"exception",cmd:t.cmd})}}if(t&&t.statusString){if(t.statusString.toLowerCase()==="ok"){if(y[C][n].resolve){y[C][n].resolve(t)}}if(t.statusString.toLowerCase()!=="ok"){var s=D.getError(t);if(n>-1){if(y[C][n].reject){y[C][n].reject(s)}}else{p(s)}}}}else{var a={};var u=new Uint8Array(e.data);if(u.byteLength===64||u.byteLength===40){var l=-1;var f=u.byteLength;for(var c=0;c-1){s[C][a].resolve=e;s[C][a].reject=t;var n=null;if(!i||!r){if(s[C][a].iCurChannel===0&&s[T]==="0.1"){n=h.zeroPlayCmd(s[C][a].iCurChannel,s[C][a].iCurStream)}else{if(s[T]!=="0.1"){if(s[R]===0){n=x.playCmd(s[C][a])}else if(s[R]===1){n=D.playCmd(s[C][a].playURL)}else if(s[R]===-1){n=I.playCmd(s[C][a])}}else{n=h.playCmd(s[C][a].iCurChannel,s[C][a].iCurStream)}}}else{if(s[T]!=="0.1"){if(s[R]===0){n=x.playbackCmd(s[C][a],i,r)}else if(s[R]===1){n=D.playbackCmd(i,r,s[C][a].playURL,o)}else if(s[R]===-1){n=I.playbackCmd(s[C][a],i,r)}}else{n=h.playbackCmd(i,r,s[C][a].iCurChannel,s[C][a].iCurStream)}}s[C][a].socket.send(n);if(s[T]==="0.1"){e()}}else{if(s[T]==="0.1"){t()}}});return t}},{key:"singleFrame",value:function t(){}},{key:"setPlayRate",value:function i(s,a){var u=this;var e=new Promise(function(e,t){for(var n=0,i=u[C].length;ng)&&e.nsecs===undefined){l=0}if(l>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}g=u;P=l;y=s;u+=122192928e5;var c=((u&268435455)*1e4+l)%4294967296;r[i++]=c>>>24&255;r[i++]=c>>>16&255;r[i++]=c>>>8&255;r[i++]=c&255;var h=u/4294967296*1e4&268435455;r[i++]=h>>>8&255;r[i++]=h&255;r[i++]=h>>>24&15|16;r[i++]=h>>>16&255;r[i++]=s>>>8|128;r[i++]=s&255;for(var d=0;d<6;++d){r[i+d]=o[d]}return t?t:v(r)}e.exports=i},function(e,t,n){var s=n(39);var a=n(40);function i(e,t,n){var i=t&&n||0;if(typeof e=="string"){t=e==="binary"?new Array(16):null;e=null}e=e||{};var r=e.random||(e.rng||s)();r[6]=r[6]&15|64;r[8]=r[8]&63|128;if(t){for(var o=0;o<16;++o){t[i+o]=r[o]}}return t||a(r)}e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var s=function(){function i(e,t){for(var n=0;n>>0).toString(16).toLocaleUpperCase().toString(16);for(var n=t.length;n<8;n++){t="0"+t}var i=[0,0,0,0];for(var r=0,o=t.length;r0){t=parseInt(e.MErrDevSelfEx,10)}else if(parseInt(e.MErrCode,10)>0){t=parseInt(e.MErrCode,10)}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="streamLimit"){t=m}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="badAuthorization"){t=y}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="lowPrivilege"){t=g}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="notSupport"){t=P}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="insufficientTranscodingResources"){t=S}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="incorrentUserNameOrPassword"){t=h}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="needDoubleVerification"){t=d}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="noDoubleVerificationUser"){t=p}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="achieveMaxChannelLimit"){t=w}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="limitPreviewNumber"){t=_}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="notEncodeOrFail"){t=b}}return t}}]);return e}();return e}();t.DirectDevice=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.LiveMedia=undefined;var o=function(){function i(e,t){for(var n=0;n=0;){var s=t*this[e++]+n[i]+r,r=Math.floor(s/67108864);n[i++]=s&67108863}return r}function U(e,t,n,i,r,o){var s=t&32767;for(t>>=15;--o>=0;){var a=this[e]&32767,u=this[e++]>>15,l=t*a+u*s,a=s*a+((l&32767)<<15)+n[i]+(r&1073741823),r=(a>>>30)+(l>>>15)+t*u+(r>>>30);n[i++]=a&1073741823}return r}function j(e,t,n,i,r,o){var s=t&16383;for(t>>=14;--o>=0;){var a=this[e]&16383,u=this[e++]>>14,l=t*a+u*s,a=s*a+((l&16383)<<14)+n[i]+r,r=(a>>28)+(l>>14)+t*u;n[i++]=a&268435455}return r}n&&e.appName=="Microsoft Internet Explorer"?(m.prototype.am=U,t=30):n&&e.appName!="Netscape"?(m.prototype.am=H,t=26):(m.prototype.am=j,t=28);m.prototype.DB=t;m.prototype.DM=(1<=0;--t){e[t]=this[t]}e.t=this.t;e.s=this.s}function Y(e){this.t=1;this.s=e<0?-1:0;e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0}function p(e){var t=y();t.fromInt(e);return t}function X(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.s=this.t=0;for(var i=e.length,r=!1,o=0;--i>=0;){var s=n==8?e[i]&255:f(e,i);s<0?e.charAt(i)=="-"&&(r=!0):(r=!1,o==0?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<>this.DB-o):this[this.t-1]|=s<=this.DB&&(o-=this.DB))}if(n==8&&(e[0]&128)!=0)this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e;){--this.t}}function K(e){if(this.s<0)return"-"+this.negate().toString(e);if(e==16)e=4;else if(e==8)e=3;else if(e==2)e=1;else if(e==32)e=5;else if(e==64)e=6;else if(e==4)e=2;else return this.toRadix(e);var t=(1<0){if(s>s)>0)i=!0,r=l(n);for(;o>=0;){s>(s+=this.DB-e)):(n=this[o]>>(s-=e)&t,s<=0&&(s+=this.DB,--o)),n>0&&(i=!0),i&&(r+=l(n))}}return i?r:"0"}function $(){var e=y();m.ZERO.subTo(this,e);return e}function Q(){return this.s<0?this.negate():this}function ee(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t,t=n-e.t;if(t!=0)return t;for(;--n>=0;){if((t=this[n]-e[n])!=0)return t}return 0}function g(e){var t=1,n;if((n=e>>>16)!=0)e=n,t+=16;if((n=e>>8)!=0)e=n,t+=8;if((n=e>>4)!=0)e=n,t+=4;if((n=e>>2)!=0)e=n,t+=2;e>>1!=0&&(t+=1);return t}function te(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)}function ne(e,t){var n;for(n=this.t-1;n>=0;--n){t[n+e]=this[n]}for(n=e-1;n>=0;--n){t[n]=0}t.t=this.t+e;t.s=this.s}function ie(e,t){for(var n=e;n=0;--a){t[a+o+1]=this[a]>>i|s,s=(this[a]&r)<=0;--a){t[a]=0}t[o]=s;t.t=this.t+o+1;t.s=this.s;t.clamp()}function oe(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var i=e%this.DB,r=this.DB-i,o=(1<>i;for(var s=n+1;s>i}i>0&&(t[this.t-n-1]|=(this.s&o)<>=this.DB}if(e.t>=this.DB}i+=this.s}else{for(i+=this.s;n>=this.DB}i-=e.s}t.s=i<0?-1:0;i<-1?t[n++]=this.DV+i:i>0&&(t[n++]=i);t.t=n;t.clamp()}function ae(e,t){var n=this.abs(),i=e.abs(),r=n.t;for(t.t=r+i.t;--r>=0;){t[r]=0}for(r=0;r=0;){e[n]=0}for(n=0;n=t.DV)e[n+t.t]-=t.DV,e[n+t.t+1]=1}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1));e.s=0;e.clamp()}function le(e,t,n){var i=e.abs();if(!(i.t<=0)){var r=this.abs();if(r.t0?(i.lShiftTo(a,o),r.lShiftTo(a,n)):(i.copyTo(o),r.copyTo(n));i=o.t;r=o[i-1];if(r!=0){var u=r*(1<1?o[i-2]>>this.F2:0),l=this.FV/u,u=(1<=0&&(n[n.t++]=1,n.subTo(d,n));m.ONE.dlShiftTo(i,d);for(d.subTo(o,o);o.t=0;){var p=n[--c]==r?this.DM:Math.floor(n[c]*l+(n[c-1]+f)*u);if((n[c]+=o.am(0,p,n,h,0,i))0&&n.rShiftTo(a,n);s<0&&m.ZERO.subTo(n,n)}}}}function fe(e){var t=y();this.abs().divRemTo(e,null,t);this.s<0&&t.compareTo(m.ZERO)>0&&e.subTo(t,t);return t}function P(e){this.m=e}function ce(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function he(e){return e}function de(e){e.divRemTo(this.m,null,e)}function pe(e,t,n){e.multiplyTo(t,n);this.reduce(n)}function ve(e,t){e.squareTo(t);this.reduce(t)}P.prototype.convert=ce;P.prototype.revert=he;P.prototype.reduce=de;P.prototype.mulTo=pe;P.prototype.sqrTo=ve;function me(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3,t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV;return t>0?this.DV-t:-t}function w(e){this.m=e;this.mp=e.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<0&&this.m.subTo(t,t);return t}function ge(e){var t=y();e.copyTo(t);this.reduce(t);return t}function Pe(e){for(;e.t<=this.mt2;){e[e.t++]=0}for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM,n=t+this.m.t;for(e[n]+=this.m.am(0,i,e,t,0,this.m.t);e[n]>=e.DV;){e[n]-=e.DV,e[++n]++}}e.clamp();e.drShiftTo(this.m.t,e);e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function we(e,t){e.squareTo(t);this.reduce(t)}function Se(e,t,n){e.multiplyTo(t,n);this.reduce(n)}w.prototype.convert=ye;w.prototype.revert=ge;w.prototype.reduce=Pe;w.prototype.mulTo=Se;w.prototype.sqrTo=we;function _e(){return(this.t>0?this[0]&1:this.s)==0}function be(e,t){if(e>4294967295||e<1)return m.ONE;var n=y(),i=y(),r=t.convert(this),o=g(e)-1;for(r.copyTo(n);--o>=0;){if(t.sqrTo(n,i),(e&1<0)t.mulTo(i,r,n);else var s=n,n=i,i=s}return t.revert(n)}function Ce(e,t){var n;n=e<256||t.isEven()?new P(t):new w(t);return this.exp(e,n)}m.prototype.copyTo=V;m.prototype.fromInt=Y;m.prototype.fromString=X;m.prototype.clamp=Z;m.prototype.dlShiftTo=ne;m.prototype.drShiftTo=ie;m.prototype.lShiftTo=re;m.prototype.rShiftTo=oe;m.prototype.subTo=se;m.prototype.multiplyTo=ae;m.prototype.squareTo=ue;m.prototype.divRemTo=le;m.prototype.invDigit=me;m.prototype.isEven=_e;m.prototype.exp=be;m.prototype.toString=K;m.prototype.negate=$;m.prototype.abs=Q;m.prototype.compareTo=ee;m.prototype.bitLength=te;m.prototype.mod=fe;m.prototype.modPowInt=Ce;m.ZERO=p(0);m.ONE=p(1);function ke(){var e=y();this.copyTo(e);return e}function Te(){if(this.s<0){if(this.t==1)return this[0]-this.DV;else{if(this.t==0)return-1}}else if(this.t==1)return this[0];else if(this.t==0)return 0;return(this[1]&(1<<32-this.DB)-1)<>24}function De(){return this.t==0?this.s:this[0]<<16>>16}function xe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Ie(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Ee(e){e==null&&(e=10);if(this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),t=Math.pow(e,t),n=p(t),i=y(),r=y(),o="";for(this.divRemTo(n,i,r);i.signum()>0;){o=(t+r.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,r)}return r.intValue().toString(e)+o}function qe(e,t){this.fromInt(0);t==null&&(t=10);for(var n=this.chunkSize(t),i=Math.pow(t,n),r=!1,o=0,s=0,a=0;a=n&&(this.dMultiply(i),this.dAddOffset(s,0),s=o=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0));r&&m.ZERO.subTo(this,this)}function Ae(e,t,n){if("number"==typeof t){if(e<2)this.fromInt(1);else{this.fromNumber(e,n);this.testBit(e-1)||this.bitwiseTo(m.ONE.shiftLeft(e-1),u,this);for(this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);){this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(m.ONE.shiftLeft(e-1),this)}}}else{var n=[],i=e&7;n.length=(e>>3)+1;t.nextBytes(n);i>0?n[0]&=(1<0){if(n>n)!=(this.s&this.DM)>>n)t[r++]=i|this.s<=0;){if(n<8?(i=(this[e]&(1<>(n+=this.DB-8)):(i=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),(i&128)!=0&&(i|=-256),r==0&&(this.s&128)!=(i&128)&&++r,r>0||i!=this.s)t[r++]=i}}return t}function Me(e){return this.compareTo(e)==0}function Le(e){return this.compareTo(e)<0?this:e}function Fe(e){return this.compareTo(e)>0?this:e}function We(e,t,n){var i,r,o=Math.min(e.t,this.t);for(i=0;i>=16,t+=16);(e&255)==0&&(e>>=8,t+=8);(e&15)==0&&(e>>=4,t+=4);(e&3)==0&&(e>>=2,t+=2);(e&1)==0&&++t;return t}function Ye(){for(var e=0;e=this.t?this.s!=0:(this[t]&1<>=this.DB}if(e.t>=this.DB}i+=this.s}else{for(i+=this.s;n>=this.DB}i+=e.s}t.s=i<0?-1:0;i>0?t[n++]=i:i<-1&&(t[n++]=this.DV+i);t.t=n;t.clamp()}function it(e){var t=y();this.addTo(e,t);return t}function rt(e){var t=y();this.subTo(e,t);return t}function ot(e){var t=y();this.multiplyTo(e,t);return t}function st(){var e=y();this.squareTo(e);return e}function at(e){var t=y();this.divRemTo(e,t,null);return t}function ut(e){var t=y();this.divRemTo(e,null,t);return t}function lt(e){var t=y(),n=y();this.divRemTo(e,t,n);return[t,n]}function ft(e){this[this.t]=this.am(0,e-1,this,0,0,this.t);++this.t;this.clamp()}function ct(e,t){if(e!=0){for(;this.t<=t;){this[this.t++]=0}for(this[t]+=e;this[t]>=this.DV;){this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}}function d(){}function S(e){return e}function ht(e,t,n){e.multiplyTo(t,n)}function dt(e,t){e.squareTo(t)}d.prototype.convert=S;d.prototype.revert=S;d.prototype.mulTo=ht;d.prototype.sqrTo=dt;function pt(e){return this.exp(e,new d)}function vt(e,t,n){var i=Math.min(this.t+e.t,t);n.s=0;for(n.t=i;i>0;){n[--i]=0}var r;for(r=n.t-this.t;i=0;){n[i]=0}for(i=Math.max(t-this.t,0);i2*this.m.t)return e.mod(this.m);else if(e.compareTo(this.m)<0)return e;else{var t=y();e.copyTo(t);this.reduce(t);return t}}function gt(e){return e}function Pt(e){e.drShiftTo(this.m.t-1,this.r2);if(e.t>this.m.t+1)e.t=this.m.t+1,e.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;){e.dAddOffset(1,this.m.t+1)}for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;){e.subTo(this.m,e)}}function wt(e,t){e.squareTo(t);this.reduce(t)}function St(e,t,n){e.multiplyTo(t,n);this.reduce(n)}_.prototype.convert=yt;_.prototype.revert=gt;_.prototype.reduce=Pt;_.prototype.mulTo=St;_.prototype.sqrTo=wt;function _t(e,t){var n=e.bitLength(),i,r=p(1),o;if(n<=0)return r;else i=n<18?1:n<48?3:n<144?4:n<768?5:6;o=n<8?new P(t):t.isEven()?new _(t):new w(t);var s=[],a=3,u=i-1,l=(1<1){n=y();for(o.sqrTo(s[1],n);a<=l;){s[a]=y(),o.mulTo(n,s[a-2],s[a]),a+=2}}for(var f=e.t-1,c,h=!0,d=y(),n=g(e[f])-1;f>=0;){n>=u?c=e[f]>>n-u&l:(c=(e[f]&(1<0&&(c|=e[f-1]>>this.DB+n-u));for(a=i;(c&1)==0;){c>>=1,--a}if((n-=a)<0)n+=this.DB,--f;if(h)s[c].copyTo(r),h=!1;else{for(;a>1;){o.sqrTo(r,d),o.sqrTo(d,r),a-=2}a>0?o.sqrTo(r,d):(a=r,r=d,d=a);o.mulTo(d,s[c],r)}for(;f>=0&&(e[f]&1<0&&(t.rShiftTo(i,t),e.rShiftTo(i,e));for(;t.signum()>0;){(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e))}i>0&&e.lShiftTo(i,e);return e}function Ct(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(t==0)n=this[0]%e;else for(var i=this.t-1;i>=0;--i){n=(t*n+this[i])%e}return n}function kt(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return m.ZERO;for(var n=e.clone(),i=this.clone(),r=p(1),o=p(0),s=p(0),a=p(1);n.signum()!=0;){for(;n.isEven();){n.rShiftTo(1,n);if(t){if(!r.isEven()||!o.isEven())r.addTo(this,r),o.subTo(e,o);r.rShiftTo(1,r)}else o.isEven()||o.subTo(e,o);o.rShiftTo(1,o)}for(;i.isEven();){i.rShiftTo(1,i);if(t){if(!s.isEven()||!a.isEven())s.addTo(this,s),a.subTo(e,a);s.rShiftTo(1,s)}else a.isEven()||a.subTo(e,a);a.rShiftTo(1,a)}n.compareTo(i)>=0?(n.subTo(i,n),t&&r.subTo(s,r),o.subTo(a,o)):(i.subTo(n,i),t&&s.subTo(r,s),a.subTo(o,a))}if(i.compareTo(m.ONE)!=0)return m.ZERO;if(a.compareTo(e)>=0)return a.subtract(e);if(a.signum()<0)a.addTo(e,a);else return a;return a.signum()<0?a.add(e):a}var b=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Tt=67108864/b[b.length-1];function Rt(e){var t,n=this.abs();if(n.t==1&&n[0]<=b[b.length-1]){for(t=0;t>1;if(e>b.length)e=b.length;for(var r=y(),o=0;o=l;){e/=2,t/=2,n>>>=1}return(e+n)/t};return e};f=o.pow(u,s);a=o.pow(2,a);l=a*2;d(o.random(),r)})([],Math,256,6,52);function C(){}function xt(e){var t;for(t=0;t>8&255;D[x++]^=e>>16&255;D[x++]^=e>>24&255;x>=T&&(x-=T)}function Ot(){At((new Date).getTime())}if(D==null){D=[];x=0;var I;if(e.appName=="Netscape"&&e.appVersion<"5"&&window.crypto){var Mt=window.crypto.random(32);for(I=0;I>>8,D[x++]=I&255}x=0;Ot()}function Lt(){if(R==null){Ot();R=qt();R.init(D);for(x=0;x>16)+(t>>16)+(n>>16)<<16|n&65535}function g(e,t){return e>>>t|e<<32-t}e=function(e){for(var e=e.replace(/\r\n/g,"\n"),t="",n=0;n127&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(i&63|128))}return t}(e);return function(e){for(var t="",n=0;n>2]>>(3-n%4)*8+4&15)+"0123456789abcdef".charAt(e[n>>2]>>(3-n%4)*8&15)}return t}(function(e,t){var n=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],r=Array(64),o,s,a,u,l,f,c,h,d,p,v,m;e[t>>5]|=128<<24-t%32;e[(t+64>>9<<4)+15]=t;for(d=0;d>>10,r[p-7]),g(r[p-15],7)^g(r[p-15],18)^r[p-15]>>>3),r[p-16]),v=y(y(y(y(h,g(l,6)^g(l,11)^g(l,25)),l&f^~l&c),n[p]),r[p]),m=y(g(o,2)^g(o,13)^g(o,22),o&s^o&a^s&a),h=c,c=f,f=l,l=y(u,v),u=a,a=s,s=o,o=y(v,m)}i[0]=y(o,i[0]);i[1]=y(s,i[1]);i[2]=y(a,i[2]);i[3]=y(u,i[3]);i[4]=y(l,i[4]);i[5]=y(f,i[5]);i[6]=y(c,i[6]);i[7]=y(h,i[7])}return i}(function(e){for(var t=[],n=0;n>5]|=(e.charCodeAt(n/8)&255)<<24-n%32}return t}(e),e.length*8))}var Nt={hex:function hn(e){return Wt(e)}};function Bt(e){function t(e,t){return e<>>32-t}function n(e){var t="",n,i;for(n=7;n>=0;n--){i=e>>>n*4&15,t+=i.toString(16)}return t}var i,r,o=Array(80),s=1732584193,a=4023233417,u=2562383102,l=271733878,f=3285377520,c,h,d,p,v,e=function(e){for(var e=e.replace(/\r\n/g,"\n"),t="",n=0;n127&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(i&63|128))}return t}(e);c=e.length;var m=[];for(i=0;i>>29);m.push(c<<3&4294967295);for(e=0;e>>32-o,t)}function n(e,t,n,i,r,o,s){e=a(e,a(a(t&i|n&~i,r),s));return a(e<>>32-o,t)}function i(e,t,n,i,r,o,s){e=a(e,a(a(t^n^i,r),s));return a(e<>>32-o,t)}function r(e,t,n,i,r,o,s){e=a(e,a(a(n^(t|~i),r),s));return a(e<>>32-o,t)}function o(e){var t="",n="",i;for(i=0;i<=3;i++){n=e>>>i*8&255,n="0"+n.toString(16),t+=n.substr(n.length-2,2)}return t}var s=[],u,l,f,c,h,d,p,v,e=function(e){for(var e=e.replace(/\r\n/g,"\n"),t="",n=0;n127&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(i&63|128))}return t}(e),s=function(e){var t,n=e.length;t=n+8;for(var i=((t-t%64)/64+1)*16,r=Array(i-1),o=0,s=0;s>>29;return r}(e);h=1732584193;d=4023233417;p=2562383102;v=271733878;for(e=0;e=0&&t>0;){var r=e.charCodeAt(i--);r<128?n[--t]=r:r>127&&r<2048?(n[--t]=r&63|128,n[--t]=r>>6|192):(n[--t]=r&63|128,n[--t]=r>>6&63|128,n[--t]=r>>12|224)}n[--t]=0;i=new E;for(r=[];t>2;){for(r[0]=0;r[0]==0;){i.nextBytes(r)}n[--t]=r[0]}n[--t]=2;n[--t]=0;return new m(n)}function A(){this.n=null;this.e=0;this.coeff=this.dmq1=this.dmp1=this.q=this.p=this.d=null}function Gt(e,t){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=q(e,16),this.e=parseInt(t,16)):alert("Invalid RSA public key")}function Vt(e){return e.modPowInt(this.e,this.n)}function Yt(e){e=jt(e,this.n.bitLength()+7>>3);if(e==null)return null;e=this.doPublic(e);if(e==null)return null;e=e.toString(16);return(e.length&1)==0?e:"0"+e}A.prototype.doPublic=Vt;A.prototype.setPublic=Gt;A.prototype.encrypt=Yt;function Xt(e,t){for(var n=e.toByteArray(),i=0;i=n.length)return null}for(var r="";++i191&&o<224?(r+=String.fromCharCode((o&31)<<6|n[i+1]&63),++i):(r+=String.fromCharCode((o&15)<<12|(n[i+1]&63)<<6|n[i+2]&63),i+=2)}return r}function Zt(e,t,n){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=q(e,16),this.e=parseInt(t,16),this.d=q(n,16)):alert("Invalid RSA private key")}function Kt(e,t,n,i,r,o,s,a){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=q(e,16),this.e=parseInt(t,16),this.d=q(n,16),this.p=q(i,16),this.q=q(r,16),this.dmp1=q(o,16),this.dmq1=q(s,16),this.coeff=q(a,16)):alert("Invalid RSA private key")}function $t(e,t){var n=new C,i=e>>1;this.e=parseInt(t,16);for(var r=new m(t,16);;){for(;;){if(this.p=new m(e-i,1,n),this.p.subtract(m.ONE).gcd(r).compareTo(m.ONE)==0&&this.p.isProbablePrime(10))break}for(;;){if(this.q=new m(i,1,n),this.q.subtract(m.ONE).gcd(r).compareTo(m.ONE)==0&&this.q.isProbablePrime(10))break}if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q;this.q=o}var o=this.p.subtract(m.ONE),s=this.q.subtract(m.ONE),a=o.multiply(s);if(a.gcd(r).compareTo(m.ONE)==0){this.n=this.p.multiply(this.q);this.d=r.modInverse(a);this.dmp1=this.d.mod(o);this.dmq1=this.d.mod(s);this.coeff=this.q.modInverse(this.p);break}}}function Qt(e){if(this.p==null||this.q==null)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),e=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;){t=t.add(this.p)}return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)}function en(e){e=this.doPrivate(q(e,16));return e==null?null:Xt(e,this.n.bitLength()+7>>3)}A.prototype.doPrivate=Qt;A.prototype.setPrivate=Zt;A.prototype.setPrivateEx=Kt;A.prototype.generate=$t;A.prototype.decrypt=en;var O=[];O.sha1="3021300906052b0e03021a05000414";O.sha256="3031300d060960864801650304020105000420";var M=[];M.sha1=zt.hex;M.sha256=Nt.hex;function L(e,t,n){t/=4;for(var e=(0,M[n])(e),n="00"+O[n]+e,e="",t=t-4-n.length,i=0;i=256)i^=283}else t>24&&r%t==16&&(o=[l.Sbox[o[0]],l.Sbox[o[1]],l.Sbox[o[2]],l.Sbox[o[3]]]);for(var s=0;s<4;s++){e[r+s]=e[r+s-t]^o[s]}}};l.Encrypt=function(e,t){var n=t.length;l.AddRoundKey(e,t.slice(0,16));for(var i=16;i=16;n-=16){l.AddRoundKey(e,t.slice(n,n+16)),l.MixColumns_Inv(e),l.ShiftRows(e,l.ShiftRowTab_Inv),l.SubBytes(e,l.Sbox_Inv)}l.AddRoundKey(e,t.slice(0,16))};l.SubBytes=function(e,t){for(var n=0;n<16;n++){e[n]=t[e[n]]}};l.AddRoundKey=function(e,t){for(var n=0;n<16;n++){e[n]^=t[n]}};l.ShiftRows=function(e,t){for(var n=[].concat(e),i=0;i<16;i++){e[i]=n[t[i]]}};l.MixColumns=function(e){for(var t=0;t<16;t+=4){var n=e[t+0],i=e[t+1],r=e[t+2],o=e[t+3],s=n^i^r^o;e[t+0]^=s^l.xtime[n^i];e[t+1]^=s^l.xtime[i^r];e[t+2]^=s^l.xtime[r^o];e[t+3]^=s^l.xtime[o^n]}};l.MixColumns_Inv=function(e){for(var t=0;t<16;t+=4){var n=e[t+0],i=e[t+1],r=e[t+2],o=e[t+3],s=n^i^r^o,a=l.xtime[s],u=l.xtime[l.xtime[a^n^r]]^s;s^=l.xtime[l.xtime[a^i^o]];e[t+0]^=u^l.xtime[n^i];e[t+1]^=s^l.xtime[i^r];e[t+2]^=u^l.xtime[r^o];e[t+3]^=s^l.xtime[o^n]}};return l}(),cn=function(){var u={};F.Init();u.b256to64=function(e){var t,n,i,r="",o=0,s=0,a=e.length;for(i=0;i>2&63),t=(n&3)<<4):s==1?(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t|n>>4&15),t=(n&15)<<2):s==2&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t|n>>6&3),o+=1,r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n&63)),o+=1,s+=1,s==3&&(s=0)}s>0&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t),r+="=");s==1&&(r+="=");return r};u.b64to256=function(e){var t,n,i="",r=0,o=0,s=e.length;for(n=0;n=0&&(r&&(i+=String.fromCharCode(o|t>>6-r&255)),r=r+2&7,o=t<>6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n&63)}t+1==e.length?(n=parseInt(e.substring(t,t+1),16),i+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),i+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((n&3)<<4));for(;(i.length&3)>0;){i+="="}return i};u.b64to16=function(e){var t="",n,i=0,r;for(n=0;n>2),r=v&3,i=1):i==1?(t+=l(r<<2|v>>4),r=v&15,i=2):i==2?(t+=l(r),t+=l(v>>2),r=v&3,i=3):(t+=l(r<<2|v>>4),t+=l(v&15),i=0))}i==1&&(t+=l(r<<2));return t};u.string2bytes=function(e){for(var t=[],n=0;n>>2]|=(n[r>>>2]>>>24-8*(r%4)&255)<<24-8*((i+r)%4)}else if(65535>>2]=n[r>>>2]}else t.push.apply(t,n);this.sigBytes+=e;return this},clamp:function w(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-8*(t%4);e.length=a.ceil(t/4)},clone:function y(){var e=r.clone.call(this);e.words=this.words.slice(0);return e},random:function S(e){for(var t=[],n=0;n>>2]>>>24-8*(i%4)&255;n.push((r>>>4).toString(16));n.push((r&15).toString(16))}return n.join("")},parse:function b(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-4*(i%8)}return new u.init(n,t/2)}},l=o.Latin1={stringify:function _(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i>>2]>>>24-8*(i%4)&255))}return n.join("")},parse:function b(e){for(var t=e.length,n=[],i=0;i>>2]|=(e.charCodeAt(i)&255)<<24-8*(i%4)}return new u.init(n,t)}},f=o.Utf8={stringify:function _(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function b(e){return l.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=r.extend({reset:function C(){this._data=new u.init;this._nDataBytes=0},_append:function k(e){"string"==typeof e&&(e=f.parse(e));this._data.concat(e);this._nDataBytes+=e.sigBytes},_process:function T(e){var t=this._data,n=t.words,i=t.sigBytes,r=this.blockSize,o=i/(4*r),o=e?a.ceil(o):a.max((o|0)-this._minBufferSize,0);e=o*r;i=a.min(4*e,i);if(e){for(var s=0;s>>2]>>>24-8*(r%4)&255)<<16|(t[r+1>>>2]>>>24-8*((r+1)%4)&255)<<8|t[r+2>>>2]>>>24-8*((r+2)%4)&255,s=0;4>s&&r+.75*s>>6*(3-s)&63))}}if(t=i.charAt(64))for(;e.length%4;){e.push(t)}return e.join("")},parse:function l(e){var t=e.length,n=this._map,i=n.charAt(64);i&&(i=e.indexOf(i),-1!=i&&(t=i));for(var i=[],r=0,o=0;o>>6-2*(o%4);i[r>>>2]|=(s|a)<<24-8*(r%4);r++}}return u.create(i,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();(function(o){function b(e,t,n,i,r,o,s){e=e+(t&n|~t&i)+r+s;return(e<>>32-o)+t}function C(e,t,n,i,r,o,s){e=e+(t&i|n&~i)+r+s;return(e<>>32-o)+t}function k(e,t,n,i,r,o,s){e=e+(t^n^i)+r+s;return(e<>>32-o)+t}function T(e,t,n,i,r,o,s){e=e+(n^(t|~i))+r+s;return(e<>>32-o)+t}for(var e=O,t=e.lib,n=t.WordArray,i=t.Hasher,t=e.algo,R=[],r=0;64>r;r++){R[r]=4294967296*o.abs(o.sin(r+1))|0}t=t.MD5=i.extend({_doReset:function s(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function D(e,t){for(var n=0;16>n;n++){var i=t+n,r=e[i];e[i]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360}var n=this._hash.words,i=e[t+0],r=e[t+1],o=e[t+2],s=e[t+3],a=e[t+4],u=e[t+5],l=e[t+6],f=e[t+7],c=e[t+8],h=e[t+9],d=e[t+10],p=e[t+11],v=e[t+12],m=e[t+13],y=e[t+14],g=e[t+15],P=n[0],w=n[1],S=n[2],_=n[3],P=b(P,w,S,_,i,7,R[0]),_=b(_,P,w,S,r,12,R[1]),S=b(S,_,P,w,o,17,R[2]),w=b(w,S,_,P,s,22,R[3]),P=b(P,w,S,_,a,7,R[4]),_=b(_,P,w,S,u,12,R[5]),S=b(S,_,P,w,l,17,R[6]),w=b(w,S,_,P,f,22,R[7]),P=b(P,w,S,_,c,7,R[8]),_=b(_,P,w,S,h,12,R[9]),S=b(S,_,P,w,d,17,R[10]),w=b(w,S,_,P,p,22,R[11]),P=b(P,w,S,_,v,7,R[12]),_=b(_,P,w,S,m,12,R[13]),S=b(S,_,P,w,y,17,R[14]),w=b(w,S,_,P,g,22,R[15]),P=C(P,w,S,_,r,5,R[16]),_=C(_,P,w,S,l,9,R[17]),S=C(S,_,P,w,p,14,R[18]),w=C(w,S,_,P,i,20,R[19]),P=C(P,w,S,_,u,5,R[20]),_=C(_,P,w,S,d,9,R[21]),S=C(S,_,P,w,g,14,R[22]),w=C(w,S,_,P,a,20,R[23]),P=C(P,w,S,_,h,5,R[24]),_=C(_,P,w,S,y,9,R[25]),S=C(S,_,P,w,s,14,R[26]),w=C(w,S,_,P,c,20,R[27]),P=C(P,w,S,_,m,5,R[28]),_=C(_,P,w,S,o,9,R[29]),S=C(S,_,P,w,f,14,R[30]),w=C(w,S,_,P,v,20,R[31]),P=k(P,w,S,_,u,4,R[32]),_=k(_,P,w,S,c,11,R[33]),S=k(S,_,P,w,p,16,R[34]),w=k(w,S,_,P,y,23,R[35]),P=k(P,w,S,_,r,4,R[36]),_=k(_,P,w,S,a,11,R[37]),S=k(S,_,P,w,f,16,R[38]),w=k(w,S,_,P,d,23,R[39]),P=k(P,w,S,_,m,4,R[40]),_=k(_,P,w,S,i,11,R[41]),S=k(S,_,P,w,s,16,R[42]),w=k(w,S,_,P,l,23,R[43]),P=k(P,w,S,_,h,4,R[44]),_=k(_,P,w,S,v,11,R[45]),S=k(S,_,P,w,g,16,R[46]),w=k(w,S,_,P,o,23,R[47]),P=T(P,w,S,_,i,6,R[48]),_=T(_,P,w,S,f,10,R[49]),S=T(S,_,P,w,y,15,R[50]),w=T(w,S,_,P,u,21,R[51]),P=T(P,w,S,_,v,6,R[52]),_=T(_,P,w,S,s,10,R[53]),S=T(S,_,P,w,d,15,R[54]),w=T(w,S,_,P,r,21,R[55]),P=T(P,w,S,_,c,6,R[56]),_=T(_,P,w,S,g,10,R[57]),S=T(S,_,P,w,l,15,R[58]),w=T(w,S,_,P,m,21,R[59]),P=T(P,w,S,_,a,6,R[60]),_=T(_,P,w,S,p,10,R[61]),S=T(S,_,P,w,o,15,R[62]),w=T(w,S,_,P,h,21,R[63]);n[0]=n[0]+P|0;n[1]=n[1]+w|0;n[2]=n[2]+S|0;n[3]=n[3]+_|0},_doFinalize:function a(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var r=o.floor(n/4294967296);t[(i+64>>>9<<4)+15]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360;t[(i+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360;e.sigBytes=4*(t.length+1);this._process();e=this._hash;t=e.words;for(n=0;4>n;n++){i=t[n],t[n]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}return e},clone:function u(){var e=i.clone.call(this);e._hash=this._hash.clone();return e}});e.MD5=i._createHelper(t);e.HmacMD5=i._createHmacHelper(t)})(Math);(function(){var e=O,t=e.lib,n=t.Base,l=t.WordArray,t=e.algo,i=t.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function r(e){this.cfg=this.cfg.extend(e)},compute:function f(e,t){for(var n=this.cfg,i=n.hasher.create(),r=l.create(),o=r.words,s=n.keySize,n=n.iterations;o.length>>2]&255}};t.BlockCipher=u.extend({cfg:u.cfg.extend({mode:l,padding:c}),reset:function g(){u.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function T(e,t){this._mode.processBlock(e,t)},_doFinalize:function _(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=t.CipherParams=n.extend({init:function y(e){this.mixIn(e)},toString:function R(e){return(e||this.formatter).stringify(this)}}),l=(e.format={}).OpenSSL={stringify:function D(e){var t=e.ciphertext;e=e.salt;return(e?s.create([1398893684,1701076831]).concat(e).concat(t):t).toString(r)},parse:function x(e){e=r.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=s.create(t.slice(2,4));t.splice(0,4);e.sigBytes-=16}return h.create({ciphertext:e,salt:n})}},d=t.SerializableCipher=n.extend({cfg:n.extend({format:l}),encrypt:function I(e,t,n,i){i=this.cfg.extend(i);var r=e.createEncryptor(n,i);t=r.finalize(t);r=r.cfg;return h.create({ciphertext:t,key:n,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function E(e,t,n,i){i=this.cfg.extend(i);t=this._parse(t,i.format);return e.createDecryptor(n,i).finalize(t.ciphertext)},_parse:function q(e,t){return"string"==typeof e?t.parse(e,this):e}}),e=(e.kdf={}).OpenSSL={execute:function A(e,t,n,i){i||(i=s.random(8));e=a.create({keySize:t+n}).compute(e,i);n=s.create(e.words.slice(t),4*n);e.sigBytes=4*t;return h.create({key:e,iv:n,salt:i})}},p=t.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:e}),encrypt:function I(e,t,n,i){i=this.cfg.extend(i);n=i.kdf.execute(n,e.keySize,e.ivSize);i.iv=n.iv;e=d.encrypt.call(this,e,t,n.key,i);e.mixIn(n);return e},decrypt:function E(e,t,n,i){i=this.cfg.extend(i);t=this._parse(t,i.format);n=i.kdf.execute(n,e.keySize,e.ivSize,t.salt);i.iv=n.iv;return d.decrypt.call(this,e,t,n.key,i)}})}();(function(){for(var e=O,t=e.lib.BlockCipher,n=e.algo,s=[],i=[],r=[],o=[],a=[],u=[],l=[],f=[],c=[],h=[],d=[],p=0;256>p;p++){d[p]=128>p?p<<1:p<<1^283}for(var v=0,m=0,p=0;256>p;p++){var y=m^m<<1^m<<2^m<<3^m<<4,y=y>>>8^y&255^99;s[v]=y;i[y]=v;var g=d[v],P=d[g],w=d[P],S=257*d[y]^16843008*y;r[v]=S<<24|S>>>8;o[v]=S<<16|S>>>16;a[v]=S<<8|S>>>24;u[v]=S;S=16843009*w^65537*P^257*g^16843008*v;l[y]=S<<24|S>>>8;f[y]=S<<16|S>>>16;c[y]=S<<8|S>>>24;h[y]=S;v?(v=g^d[d[d[w^g]]],m^=d[d[m]]):v=m=1}var _=[0,1,2,4,8,16,32,64,128,27,54],n=n.AES=t.extend({_doReset:function b(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],r=0;r>>24]<<24|s[o>>>16&255]<<16|s[o>>>8&255]<<8|s[o&255]):(o=o<<8|o>>>24,o=s[o>>>24]<<24|s[o>>>16&255]<<16|s[o>>>8&255]<<8|s[o&255],o^=_[r/n|0]<<24);i[r]=i[r-n]^o}}t=this._invKeySchedule=[];for(n=0;nn||4>=r?o:l[s[o>>>24]]^f[s[o>>>16&255]]^c[s[o>>>8&255]]^h[s[o&255]]}},encryptBlock:function C(e,t){this._doCryptBlock(e,t,this._keySchedule,r,o,a,u,s)},decryptBlock:function k(e,t){var n=e[t+1];e[t+1]=e[t+3];e[t+3]=n;this._doCryptBlock(e,t,this._invKeySchedule,l,f,c,h,i);n=e[t+1];e[t+1]=e[t+3];e[t+3]=n},_doCryptBlock:function T(e,t,n,i,r,o,s,a){for(var u=this._nRounds,l=e[t]^n[0],f=e[t+1]^n[1],c=e[t+2]^n[2],h=e[t+3]^n[3],d=4,p=1;p>>24]^r[f>>>16&255]^o[c>>>8&255]^s[h&255]^n[d++],m=i[f>>>24]^r[c>>>16&255]^o[h>>>8&255]^s[l&255]^n[d++],y=i[c>>>24]^r[h>>>16&255]^o[l>>>8&255]^s[f&255]^n[d++],h=i[h>>>24]^r[l>>>16&255]^o[f>>>8&255]^s[c&255]^n[d++],l=v,f=m,c=y}v=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[h&255])^n[d++];m=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[l&255])^n[d++];y=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[f&255])^n[d++];h=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[c&255])^n[d++];e[t]=v;e[t+1]=m;e[t+2]=y;e[t+3]=h},keySize:8});e.AES=t._createHelper(n)})();t["default"]=O},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var i=function(){function i(e,t){for(var n=0;n>>JS AudioRenderer.js load finish!")}}}}if(!qe){qe=true;var r=document.createElement("script");r.type="text/javascript";r.src=w.szBasePath+"SuperRender_10.js";var o=document.getElementsByTagName("head")[0];o.appendChild(r);r.onload=r.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"){if(Ae){console.log(">>>JS SuperRender_10.js load finish!")}}}}this.convertErrorCode=function(e){switch(e){case 1:return ne;case 98:return te;default:return e}};this.arrayBufferCopy=function(e){var t=e.byteLength;var n=new Uint8Array(t);var i=new Uint8Array(e);var r=0;for(r=0;r>>JS inputDataFun over!")}e=new Uint8Array(1);t=new Uint8Array(e);var i={command:"InputData",data:t.buffer,dataSize:0};w.decodeWorker.postMessage(i,[i.data])}else{if(w.bPlay&&(!w.bPause||w.bOnebyOne)||this.bOnlyPlaySound){while(w.aInputDataLens.length>0){n+=w.aInputDataLens.shift();if(n>w.iInputDataLen){break}}if(Ae){console.log(">>>JS inputDataFun-len:%d,totalSize:%d",n,w.aInputDataBuffer.length)}e=w.aInputDataBuffer.splice(0,n);t=new Uint8Array(e);var i={command:"InputData",data:t.buffer,dataSize:n};w.decodeWorker.postMessage(i,[i.data])}}e=null;t=null};this.getPic=function(e,t){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(e&&typeof e==="function"){this.dataCallBackFun=e}else{return te}if(0===this.iZoomNum){this.stYUVRect.left=0;this.stYUVRect.top=0;this.stYUVRect.right=0;this.stYUVRect.bottom=0}else{if(0===this.iCanvasWidth||0===this.iCanvasHeight){this.stYUVRect.left=0;this.stYUVRect.top=0;this.stYUVRect.right=0;this.stYUVRect.bottom=0}else{var n=this.nWidth/this.iCanvasWidth;var i=this.nHeight/this.iCanvasHeight;this.stYUVRect.left=Math.round(this.stDisplayRect.left*n);this.stYUVRect.top=Math.round(this.stDisplayRect.top*i);this.stYUVRect.right=Math.round(this.stDisplayRect.right*n);this.stYUVRect.bottom=Math.round(this.stDisplayRect.bottom*i)}if(this.stYUVRect.right-this.stYUVRect.left<32||this.stYUVRect.bottom-this.stYUVRect.top<32){return te}}if(this.aDisplayBuf==null){return ie}var r=this.arrayBufferCopy(this.aDisplayBuf);var o={command:t,data:r.buffer,width:this.nWidth,height:this.nHeight,rect:this.stYUVRect};if(Ae){console.log(">>>JS capture nWidth = %d,nWidth = %d",this.nWidth,this.nHeight)}this.decodeWorker.postMessage(o,[o.data]);return ne};this.createWorker=function(P){if(window.Worker){if(this.decodeWorker==null){this.decodeWorker=new Worker(w.szBasePath+"DecodeWorker.js");if(Ae){console.log(">>>JS createWorker success!!!!!!!!!!!!!!!!!!!!!!!!!")}if(this.decodeWorker==null){return ue}}this.decodeWorker.onmessage=function(e){var t=null;var n=e.data;switch(n["function"]){case"printLog":console.log("print JSPlayerSDK log failed");break;case"loaded":t="loaded";P.setCallBack(P,"loaded",0,0,true);break;case"SetStreamOpenMode":t="SetStreamOpenMode";break;case"OpenStream":t="OpenStream";if(1===n.errorCode){w.bOpenStream=true;return}break;case"InputData":t="InputData";if(n.errorCode===re){w.bIsInputBufOver=true;w.inputDataFun();if(Ae){console.log(">>>JS InputData PLAYM4_BUF_OVER")}}if(n.errorCode===se){w.bIsInputBufOver=false;if(Ae){console.log(">>>JS InputData PLAYM4_NEED_MORE_DATA")}}break;case"GetFrameData":t="GetFrameData";if(!w.bOnlyPlaySound){if(Ae){console.log(">>>JS mainthread display GetFrameData 1-1")}if(n.data!=null&&n.frameInfo!=null){var i=n.frameInfo.width;var r=n.frameInfo.height}if(!w.bPlay){return}if(!w.bIsFirstFrame&&n.errorCode===se){w.bIsInputBufOver=false;setTimeout(w.inputDataFun(),5);break}else if(w.bIsInputBufOver){w.inputDataFun()}else{if(n.type==="videoType"){if(w.aInputDataLens.length>0&&w.bIsInput){w.inputDataFun();w.bIsInput=false}else{w.bIsGetYUV=true}w.bIsFirstFrame=false}}}if(Ae){console.log(">>>JS mainthread display GetFrameData bVisibility:"+w.bVisibility)}if(w.bVisibility){if(ne===n.errorCode){switch(n.type){case"videoType":if(Ae){console.log(">>>JS mainthread display GetFrameData type:"+n.type)}if(n.data==null||n.frameInfo==null){return te}if(w.DecCallBackFun!=null){if(Ae){console.log(">>>JS MainThread-GetYUVData")}w.DecInfoYUV.height=n.frameInfo.height;w.DecInfoYUV.width=n.frameInfo.width;w.DecInfoYUV.frameNum=n.frameInfo.frameNum;w.DecInfoYUV.yuvData=new Uint8Array(n.data);w.DecCallBackFun(w.DecInfoYUV)}w.bIsFirstFrame=false;P.nWidth=n.frameInfo.width;P.nHeight=n.frameInfo.height;P.nSPSCropLeft=n.frameInfo.cropLeft;P.nSPSCropRight=n.frameInfo.cropRight;P.nSPSCropTop=n.frameInfo.cropTop;P.nSPSCropBottom=n.frameInfo.cropBottom;var o=new Object;o.data=n.data;o.osdTime=n.osd;o.nWidth=n.frameInfo.width;o.nHeight=n.frameInfo.height;o.frameNum=n.frameInfo.frameNum;o.timeStamp=n.frameInfo.timeStamp;if(P.bWriteYUVData){var s=new Uint8Array(n.data);var a=P.aVideoYUVBuffer.length;for(var u=0,l=s.length;u=Ke){var f=new Uint8Array(P.aVideoYUVBuffer);P.downloadFile(f,"videoYUV.data");P.aVideoYUVBuffer.splice(0,P.aVideoYUVBuffer.length);P.bWriteYUVData=false;P.iYUV10size=0;f=null}if(Ae){console.log(">>>JS mainthread getVideoInfo Width:"+o.nWidth+",height:"+o.nHeight+",frameNum:"+o.frameNum)}P.aVideoFrameBuffer.push(o);o=null;var c=P.aVideoFrameBuffer.length;if(c>je){if(Ae){console.log(">>>JS render loose frame iYUVNum:%d",c)}if(!P.bOnebyOne){P.aVideoFrameBuffer.splice(0,Ge)}}if(P.SetPlayPositionFlag&&P.bSetPlayPositionType===Ie&&(n.frameInfo.frameNum===P.iFrameNumOrTime||n.frameInfo.timeStamp===P.iFrameNumOrTime)){P.setCallBack(P,"SetFrameNum",0,0,false);P.bIsFirstFrame=true;break}if(P.bOnebyOne){if(P.aVideoFrameBuffer.length>=Re){P.setCallBack(P,"OnebyOne",0,0,false);P.bIsFirstFrame=true;break}}break;case"audioType":if(Ae){console.log(">>>JS mainthread display GetFrameData 2-3 type:"+n.type+",bPlaySound:"+P.bPlaySound+",!bPlayRateChange:"+!P.bPlayRateChange+",bOnlyPlaySound:"+w.bOnlyPlaySound)}if(P.bPlaySound&&!P.bPlayRateChange||w.bOnlyPlaySound){if(Ae){console.log(">>>JS mainthread display GetFrameData 2-4 type"+n.type+"bOnlyPlaySound:"+w.bOnlyPlaySound)}if(w.PCMCallBackFun!=null){if(Ae){console.log(">>>JS MainThread-GetYUVData")}w.DecInfoPCM.sampleRate=n.frameInfo.samplesPerSec;w.DecInfoPCM.channel=n.frameInfo.channels;w.DecInfoPCM.bitsPerSample=n.frameInfo.bitsPerSample;w.DecInfoPCM.pcmData=new Uint8Array(n.data);w.DecInfoPCM.length=w.DecInfoPCM.pcmData.length;w.PCMCallBackFun(w.DecInfoPCM)}var s=new Uint8Array(n.data);var a=P.aAudioBuffer.length;for(var u=0,l=s.length;u>>JS play sound 1 iAudioBufferNum:%d, BufferLen:%d",P.iAudioBufferSize,P.aAudioBuffer.length)}if(P.bWritePCMData){var s=new Uint8Array(n.data);var a=P.aAudioPCMBuffer.length;for(var u=0,l=s.length;u=Ze){var h=new Uint8Array(P.aAudioPCMBuffer);P.downloadFile(h,"audioPCM.data");P.aAudioPCMBuffer.splice(0,P.aAudioPCMBuffer.length);P.bWritePCMData=false;P.iAudioBuffer500Size=0;h=null}if(P.iAudioBufferSize>=Ue){if(Ae){console.log(">>>JS play sound 2 iAudioBufferNum:%d, BufferLen:%d",P.iAudioBufferSize,P.aAudioBuffer.length)}P.audioRenderer.Play(P.aAudioBuffer,P.aAudioBuffer.length,n.frameInfo);if(Ae){console.log(">>>JS mainthread display Audio push 3 sysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}P.aAudioBuffer.splice(0,P.aAudioBuffer.length);P.aAudioBuffer.length=0;P.iAudioBufferSize=0}}break;case"privateType":if(Ae){console.log(">>>JS mainthread display GetFrameData 2-5 type"+n.type+"bOnlyPlaySound:"+w.bOnlyPlaySound)}break;default:if(Ae){console.log(">>>JS mainthread display GetFrameData 2-6 type:"+n.type+",bOnlyPlaySound:"+w.bOnlyPlaySound)}break}}else{if(Ae){console.log(">>>JS mainthread GetFrameData is not Ok,errorCode:"+n.errorCode)}}}break;case"GetRawData":t="GetRawData";if(P.bWriteRawData){var d=new Uint8Array(n.data);var p=P.aRawDataBuffer.length;for(var u=0,l=d.length;u=$e){var v=new Uint8Array(P.aRawDataBuffer);P.downloadFile(v,"rawBuffer.data");P.aRawDataBuffer.splice(0,P.aRawDataBuffer.length);P.bWriteRawData=false;P.iRawDataSize=0;v=null}break;case"PlaySound":t="PlaySound";break;case"SetPlayPosition":console.log(">>>JS mainthread SetPlayPosition error,errorCode:"+n.errorCode);break;case"GetJPEG":t="GetJPEG";var m=n.data;P.dataCallBackFun(m);break;case"GetBMP":t="GetBMP";var y=n.data;P.dataCallBackFun(y);break;case"GetAudEncodeData":if(Ae){console.log(">>>JS MainThread-GetAudEncodeData 1")}t="GetAudEncodeData";if(ne===n.errorCode){if(w.AudEncodeDataCBFun!=null){if(Ae){console.log(">>>JS GetAudEncodeData 1 dataSize"+n.dataSize+", nSysTime:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}w.AudEncodeDataCBFun(new Uint8Array(n.data));if(Ae){console.log(">>>JS GetAudEncodeData 2 dataSize"+n.dataSize+", nSysTime:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}}if(P.bWriteAudEnc){var s=new Uint8Array(n.data);var a=P.aAudioEncBuffer.length;for(var u=0,l=s.length;u=Xe){var g=new Uint8Array(P.aAudioEncBuffer);P.downloadFile(g,"Enc.AAC");P.aAudioEncBuffer.splice(0,P.aAudioEncBuffer.length);P.bWriteAudEnc=false;P.iAudioEncBufferSize=0;g=null}}else{if(Ae){console.log(">>>JS MainThread-GetAudEncodeData 2 err")}}break;default:break}if("GetFrameData"!==t||"GetAudEncodeData"!==t){P.setCallBack(P,t,0,P.convertErrorCode(n.errorCode),true)}else{if(oe===n.errorCode||pe===n.errorCode||de===n.errorCode||ae===n.errorCode){P.setCallBack(P,t,0,P.convertErrorCode(n.errorCode),true)}}}}};this.createWorker(w);this.draw=function(){if(w.bPlay){if(!w.bPause||w.bOnebyOne){requestAnimationFrame(w.draw);var e=w.aVideoFrameBuffer.length;if(w.YUVBufSizeCBFun!=null){w.YUVBufSizeCBFun(e)}if(w.bOnebyOne){if(e<=Je){w.setCallBack(w,"OnebyOne",0,se,true)}if(e<=w.FrameForwardLen+1){w.setCallBack(w,"OnebyOne",0,se,true);return}else{var t=w.FrameForwardLen;while(t>1){var n=w.aVideoFrameBuffer.shift();t--}}w.bOnebyOne=false}if(Ae){console.log(">>>JS Draw aVideoFrameBuffer.length == "+e)}if(e>w.YUVBufferSize){var i=w.aVideoFrameBuffer.shift();if(w.SetPlayPositionFlag){if(Ae){console.log(">>>JS SetPlayPositionFlag frameNumOrTime:"+w.iFrameNumOrTime+",currentFrameNum:"+i.frameNum)}if(i.frameNum!=w.iFrameNumOrTime){if(Ae){console.log(">>>JS frameNum!= frameNumOrTime:"+i.frameNum)}return}if(w.bSetPlayPositionType===Ie){w.bPause=true}w.SetPlayPositionFlag=false}if(Ae){console.log(">>>after display frameNum:"+i.frameNum)}w.aDisplayBuf=i.data;var r=new Uint8Array(w.aDisplayBuf);if(Ae){console.log(">>>JS SR_DisplayFrameData 1 nWidth:%d, nHeight:%d, nWidth1:%d, nHeight1:%d",i.nWidth,i.nHeight,w.nWidth,w.nHeight)}w.oSuperRender.SR_DisplayFrameData(i.nWidth,i.nHeight,r,i.nWidth-w.nSPSCropLeft-w.nSPSCropRight,i.nHeight-w.nSPSCropTop-w.nSPSCropBottom);if(w.DisplayCallBackFun!=null){if(Ae){console.log(">>>JS MainThread-DisplayCallBackFun")}w.DisplayInfoYUV.height=i.nHeight;w.DisplayInfoYUV.width=i.nWidth;w.DisplayInfoYUV.frameNum=i.frameNum;w.DisplayInfoYUV.yuvData=new Uint8Array(r);w.DisplayCallBackFun(w.DisplayInfoYUV)}if(Ae&&w.bOnebyOne){console.log("OneByOne frameNum:"+i.frameNum)}if(Ae){console.log(">>>JS SR_DisplayFrameData 2 nWidth:%d, nHeight:%d, nWidth1:%d, nHeight1:%d",i.nWidth,i.nHeight,w.nWidth,w.nHeight)}r=null;w.szOSDTime=i.osdTime;i=null}else{w.setCallBack(w,"Play",0,se,true)}}}else{if(!w.bPlay){if(Ae){console.log(">>>JS mainThread stop play jsplaySDKInterface")}w.aVideoFrameBuffer.splice(0,w.aVideoFrameBuffer.length);w.aAudioBuffer.splice(0,w.aAudioBuffer.length)}}};this.checkAudioType=function(e){var i=function i(e,t){var n=e[t]&255|(e[t+1]&255)<<8|(e[t+2]&255)<<16|(e[t+3]&255)<<24;return n};var t=[e[12],e[13],0,0];var n=i(t,0);switch(n){case we.AUDIO_G711_A:case we.AUDIO_G711_U:case we.AUDIO_G722_1:case we.AUDIO_G726_2:case we.AUDIO_G726_A:case we.AUDIO_G726_U:case we.AUDIO_AACLC:case we.AUDIO_MPEG:case we.AUDIO_ADPCM:return ne;default:return oe}}}Q(a,[{key:"PlayM4_SetCurrentFrameNum",value:function n(e,t){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(e<0){return te}if(t!==0&&t!==1){return te}return this.PlayM4_SetPlayPosition(0,e,t)}},{key:"PlayM4_SetPlayPosition",value:function i(e,t,n){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(e!==0&&e!==1){return te}if(t<0){return te}if(n!==0&&n!==1){return te}this.SetPlayPositionFlag=true;this.iFrameNumOrTime=t;this.bSetPlayPositionType=n;this.decodeWorker.postMessage({command:"SetPlayPosition",data:this.iFrameNumOrTime,type:e});this.aAudioBuffer.splice(0,this.aAudioBuffer.length);this.iAudioBufferSize=0;this.aVideoFrameBuffer.splice(0,this.aVideoFrameBuffer.length);this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length);this.aInputDataLens.splice(0,this.aInputDataLens.length);this.bIsFirstFrame=true;this.bIsInputBufOver=false;return ne}},{key:"PlayM4_OpenPlayerSDKPrintLog",value:function t(e){if(e===true){Ae=true;this.decodeWorker.postMessage({command:"printLog",data:e})}else{Ae=false;this.decodeWorker.postMessage({command:"printLog",data:e})}return ne}},{key:"PlayM4_DownloadYUVdata",value:function e(){this.bWriteYUVData=true;return ne}},{key:"PlayM4_DownloadPCMdata",value:function r(){this.bWritePCMData=true;return ne}},{key:"PlayM4_SetDecCallBack",value:function o(e){if(Ae){console.log(">>>JS MainThread-PlayM4_SetDecCallBack")}if(e&&typeof e==="function"){this.DecCallBackFun=e;return ne}else{return te}}},{key:"PlayM4_SetDisplayCallBack",value:function s(e){if(Ae){console.log(">>>JS MainThread-PlayM4_SetDisplayCallBack")}if(e&&typeof e==="function"){this.DisplayCallBackFun=e;return ne}else{return te}}},{key:"PlayM4_SetPCMCallBack",value:function u(e){if(Ae){console.log(">>>JS MainThread-PlayM4_SetDisplayCallBack")}if(e&&typeof e==="function"){this.PCMCallBackFun=e;return ne}else{return te}}},{key:"PlayM4_SetStreamOpenMode",value:function l(e){if(e==null||e===undefined){return te}if(e!==be&&e!==Ce){return te}this.streamOpenMode=e;if(Ae){console.log(">>>JS PlayM4_SetStreamOpenMode nMode:"+e)}return ne}},{key:"PlayM4_DownloadRTPData",value:function f(e){this.downloadRTP=e}},{key:"PlayM4_OpenStream",value:function c(e,t,n){if(Ae){console.log(">>>JS PlayM4_OpenStream 1 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}if(this.decodeWorker==null){return ie}if(this.downloadRTP){var i=new Uint8Array(e.buffer);this.DownloadRTPData(i);console.log("write 40 hik head")}if(e==null||t<=0||n<=0){return te}this.bPlay=false;this.bPause=false;this.bOnebyOne=false;this.bIsFirstFrame=true;this.bIsGetYUV=false;this.bIsInput=false;var r=this.checkAudioType(e);if(ne!==r){this.bAudioTypeSupport=false}else{this.bAudioTypeSupport=true}this.decodeWorker.postMessage({command:"SetStreamOpenMode",data:this.streamOpenMode});if(Ae){console.log(">>>JS PlayM4_OpenStream 2 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}this.decodeWorker.postMessage({command:"OpenStream",data:e,dataSize:t,bufPoolSize:n});if(Ae){console.log(">>>JS PlayM4_OpenStream 3 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}this.bOpenStream=true;return ne}},{key:"PlayM4_CloseStream",value:function h(){if(Ae){console.log(">>>JS PlayM4_CloseStream 1 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}if(this.decodeWorker===null||this.bOpenStream===false){return ie}this.bOnlyPlaySound=false;this.PlayM4_Stop();this.decodeWorker.postMessage({command:"CloseStream"});if(this.oSuperRender!==null){this.oSuperRender.SR_Destroy();this.oSuperRender=null}if(this.audioRenderer!==null){this.audioRenderer.Stop();this.audioRenderer=null}this.aAudioBuffer.splice(0,this.aAudioBuffer.length);this.aVideoFrameBuffer.splice(0,this.aVideoFrameBuffer.length);this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length);this.aInputDataLens.splice(0,this.aInputDataLens.length);this.aAudioEncBuffer.splice(0,this.aAudioEncBuffer.length);this.aVideoYUVBuffer.splice(0,this.aVideoYUVBuffer.length);this.aAudioPCMBuffer.splice(0,this.aAudioPCMBuffer.length);this.aRawDataBuffer.splice(0,this.aRawDataBuffer.length);this.bOpenStream=false;this.iAudioBufferSize=0;this.szOSDTime=null;return ne}},{key:"PlayM4_Destroy",value:function d(){if(Ae){console.log(">>>JS PlayM4_Destroy 1 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}if(this.decodeWorker===null){return ne}this.PlayM4_CloseStream();this.decodeWorker.terminate();this.decodeWorker=null;return ne}},{key:"PlayM4_InputData",value:function p(e,t){var n=this.aInputDataBuffer.length;if(t===4){var i=new Uint8Array(e.buffer);if(i[0]===1&&i[1]===2&&i[2]===3&&i[3]===4){if(Ae){console.log(">>>JS PlaySDKInterface PlayM4_InputData:intput end")}if(this.bIsFirstFrame){if(Ae){console.log(">>>JS inputData FirstTime")}this.inputDataFun()}else{if(this.bIsGetYUV){this.inputDataFun()}else{this.bIsInput=true}}i=null;return ne}}if(n+t>this.iInputMaxBufSize){console.log("input over");this.inputDataFun();return re}var r=null;var o=t;switch(this.streamOpenMode){case Ce:r=new Uint8Array(e.buffer);if(this.downloadRTP){this.DownloadRTPData(r);this.rtpNum++;console.log("STREAM_FILE psNUm:"+this.rtpNum)}this.aInputDataLens.push(t);break;case be:o=t+4;var s=new Uint32Array([t]);var a=new Uint8Array(s.buffer);r=new Uint8Array(o);r.set(a,0);r.set(e,4);if(this.downloadRTP){this.DownloadRTPData(r);this.rtpNum++;console.log("STREAM_REALTIME rtpNUm:"+this.rtpNum)}s=null;a=null;this.aInputDataLens.push(t+4);break;default:return oe}for(var u=0;u>>JS PlayM4_InputData 1: nSize:%d, iInputBufLen:%d, iInputMaxBufSize;%d",t,this.aInputDataBuffer.length,this.iInputMaxBufSize)}if(this.bOnlyPlaySound){if(Ae){console.log(">>>JS PlayM4_InputData: OnlyPlaySound")}this.inputDataFun()}else{if(this.bIsFirstFrame){if(Ae){console.log(">>>JS PlayM4_InputData is firstFrame")}this.inputDataFun()}else{if(this.bIsGetYUV){if(Ae){console.log(">>>JS PlayM4_InputData is GetYUV")}this.inputDataFun()}else{if(Ae){console.log(">>>JS PlayM4_InputData 1-3 sysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}this.bIsInput=true}}}return ne}},{key:"DownloadRTPData",value:function v(e){if(this.bWriteRTPData){var t=new Uint8Array(e);var n=this.aRTPDataBuffer.length;for(var i=0,r=t.length;i=xe){console.log("download"+xe+"RTPdata");var o=new Uint8Array(this.aRTPDataBuffer);this.downloadFile(o,"RTP.data");this.aRTPDataBuffer.splice(0,this.aRTPDataBuffer.length);this.bWriteRTPData=false;this.iRTPDataSize=0;this.rtpNum=0;this.downloadRTP=false;o=null}}},{key:"PlayM4_Play",value:function m(e){if(this.decodeWorker===null){return ie}if(Ae){console.log(">>>JS PlayM4_Play canvasID: "+e)}if(e===null){this.bOnlyPlaySound=true;this.sCanvasId=null}else{if(typeof e!=="string"){return te}if(this.bOnebyOne){this.bPlayRateChange=false;this.bOnebyOne=false;this.bPause=false;this.draw()}if(this.bPlay){return ne}if(this.oSuperRender==null){this.oSuperRender=new SuperRender(e,this.szBasePath);if(this.oSuperRender==null){return le}}this.sCanvasId=e;this.bPlay=true;this.bPause=false;this.bOnebyOne=false;this.bPlaySound=false;this.bPlayRateChange=false;this.bOnlyPlaySound=false;this.draw()}if(this.audioRenderer==null){this.audioRenderer=new AudioRenderer;if(this.audioRenderer==null){return le}}return ne}},{key:"PlayM4_Stop",value:function y(){if(Ae){console.log(">>>JS PlayM4_Stop 1")}if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(this.bPlaySound){this.PlayM4_StopSound();this.bPlaySound=true}this.bPlay=false;this.bOnebyOne=false;this.bPause=false;this.oSuperRender.SR_SetDisplayRect(null);this.iZoomNum=0;this.bDisRect=false;this.oSuperRender.SR_DisplayFrameData(this.nWidth,this.nHeight,null);return ne}},{key:"PlayM4_PlayRate",value:function g(e){if(this.decodeWorker==null){return ie}if(e===1){this.bPlayRateChange=false}else{this.bPlayRateChange=true}if(e<1){e=1}this.iInputDataLen=e*De;return ne}},{key:"PlayM4_Pause",value:function P(e){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(this.bOnebyOne){return ie}if(typeof e!=="boolean"){return te}this.bPause=e;this.bIsFirstFrame=true;if(Ae){console.log(">>>JS PlayM4_Pause:"+e)}if(e){if(this.bPlaySound){this.PlayM4_StopSound();this.bPlaySound=true}}else{if(this.bPlaySound){this.PlayM4_PlaySound()}this.draw()}return ne}},{key:"PlayM4_OneByOne",value:function w(e){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(e>10||e<=0){return te}if(!e){e=1}this.iInputDataLen=De;this.FrameForwardLen=e;this.bPause=true;this.bOnebyOne=true;this.bIsFirstFrame=true;this.draw();return ne}},{key:"PlayM4_PlaySound",value:function S(e){if(this.decodeWorker===null||this.bOpenStream===false){return ie}if(!this.bAudioTypeSupport){return oe}if(e<0||e>16){return te}if(this.audioRenderer==null){this.audioRenderer=new AudioRenderer;if(this.audioRenderer==null){return le}}this.audioRenderer.SetWndNum(e);this.audioRenderer.oAudioContext.resume();this.bPlaySound=true;return ne}},{key:"PlayM4_StopSound",value:function _(){if(this.decodeWorker==null||this.audioRenderer==null){return ie}if(!this.bPlaySound){return ie}this.bPlaySound=false;return ne}},{key:"PlayM4_SetDisplayBuf",value:function b(e){if(this.decodeWorker==null){return ie}if(e<=0){return te}this.YUVBufferSize=e;return ne}},{key:"PlayM4_SetSecretKey",value:function C(e,t,n){if(this.decodeWorker==null||this.bOpenStream===false){return ie}if(t==null){return te}if(_e===e){if(128===n){if(t==null||t===undefined){return te}}else{return te}}else if(Se===e){}else{return te}this.decodeWorker.postMessage({command:"SetSecretKey",data:t,nKeyType:e,nKeyLen:n});return ne}},{key:"PlayM4_SetDecodeFrameType",value:function k(e){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(e!==ke&&e!==Te){return te}if(Ae){console.log(">>>JS PlayM4_SetDecodeFrameType");console.log(e)}this.nDecFrameType=e;this.decodeWorker.postMessage({command:"SetDecodeFrameType",data:e});return ne}},{key:"PlayM4_SetIFrameDecInterval",value:function T(e){if(this.nDecFrameType!==Te){return ie}if(e<0){return te}this.decodeWorker.postMessage({command:"SetIFrameDecInterval",data:e});return ne}},{key:"PlayM4_SetLostFrameMode",value:function R(e){if(e<0||e>1){return te}this.decodeWorker.postMessage({command:"SetLostFrameMode",data:e});return ne}},{key:"PlayM4_SetDisplayRegion",value:function D(e,t){if(Ae){console.log("PlayM4_SetDisplayRegion ")}if(this.decodeWorker===null||this.bPlay===false||this.oSuperRender===null){return ie}if(this.canvasId===null){return ie}if(t===true){if(e===null||e===undefined){if(Ae){console.log("PlayM4_SetDisplayRegion: dipalyRect is null")}return te}if(typeof e.left==="number"&&typeof e.top==="number"&&typeof e.right==="number"&&typeof e.bottom==="number"){if(e.right<0||e.left<0||e.top<0||e.bottom<0){if(Ae){console.log("PlayM4_SetDisplayRegion: dipalyRect rectParameter is wrong")}return te}var n=e.left;var i=e.right;var r=e.top;var o=e.bottom;var s=document.getElementById(this.sCanvasId).getBoundingClientRect();this.iCanvasWidth=s.width;this.iCanvasHeight=s.height;if(i-n<16||o-r<16||i-n>this.iCanvasWidth||o-r>this.iCanvasHeight){return te}if(this.iZoomNum!==0){n=Math.round(n/this.iRatio_x)+this.stDisplayRect.left;r=Math.round(r/this.iRatio_y)+this.stDisplayRect.top;i=Math.round(i/this.iRatio_x)+this.stDisplayRect.left;o=Math.round(o/this.iRatio_y)+this.stDisplayRect.top}this.stDisplayRect={top:r,left:n,right:i,bottom:o};this.oSuperRender.SR_SetDisplayRect(this.stDisplayRect);this.bDisRect=true;var a=i-n;var u=o-r;this.iRatio_x=this.iCanvasWidth/a;this.iRatio_y=this.iCanvasHeight/u;this.iZoomNum++}else{return te}}else{this.oSuperRender.SR_SetDisplayRect(null);this.iZoomNum=0;this.bDisRect=false}if(this.bPause||this.bOnebyOne||this.bPlayRateChange){this.oSuperRender.SR_DisplayFrameData(this.nWidth,this.nHeight,new Uint8Array(this.aDisplayBuf))}return ne}},{key:"PlayM4_GetBMP",value:function x(e){return this.getPic(e,"GetBMP")}},{key:"PlayM4_GetJPEG",value:function I(e){return this.getPic(e,"GetJPEG")}},{key:"PlayM4_SetVolume",value:function E(e){if(this.decodeWorker==null){return ie}if(this.audioRenderer==null){return ie}if(e<0||e>100){return te}this.audioRenderer.SetVolume(e/100);return ne}},{key:"PlayM4_GetVolume",value:function q(e){if(this.decodeWorker==null){return ie}if(this.audioRenderer==null){return ie}if(e&&typeof e==="function"){var t=this.audioRenderer.GetVolume();if(t===null){return fe}else{e(Math.round(t*10)*10);return ne}}else{return te}}},{key:"PlayM4_GetOSDTime",value:function A(e){if(this.decodeWorker==null){return ie}if(!this.bPlay){return ie}if(e&&typeof e==="function"){e(this.szOSDTime);return ne}else{return te}}},{key:"PlayM4_IsVisible",value:function O(e){this.bVisibility=e;if(Ae){console.log(">>>JS PlayM4_IsVisible visibility:"+e)}return ne}},{key:"PlayM4_GetSdkVersion",value:function M(){return"07020146"}},{key:"PlayM4_GetBuildDate",value:function L(){return"20211104"}},{key:"PlayM4_GetInputBufSize",value:function F(){return this.aInputDataBuffer.length}},{key:"PlayM4_SetInputBufSize",value:function W(e){if(e>0){this.iInputMaxBufSize=e;return ne}else{return te}}},{key:"PlayM4_GetYUVBufSize",value:function N(){return this.aVideoFrameBuffer.length}},{key:"PlayM4_GetFrameResolution",value:function B(e){if(this.decodeWorker==null){return ie}if(e&&typeof e==="function"){e(this.nWidth,this.nHeight);return ne}else{return te}}},{key:"PlayM4_RegisterYUVBufSizeCB",value:function z(e){if(e&&typeof e==="function"){this.YUVBufSizeCBFun=e;return ne}else{return te}}},{key:"PlayM4_UnRegisterYUVBufSizeCB",value:function J(){if(this.YUVBufSizeCBFun!=null){this.YUVBufSizeCBFun=null}return ne}},{key:"PlayM4_ClearCanvas",value:function H(){if(this.oSuperRender==null){return ie}this.oSuperRender.SR_DisplayFrameData(this.nWidth,this.nHeight,null);return ne}},{key:"PlayM4_ReleaseInputBuffer",value:function U(){if(this.aInputDataBuffer===null){return ie}this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length);this.aInputDataLens.splice(0,this.aInputDataLens.length);return ne}},{key:"PlayM4_GetDecodeFrameType",value:function j(){return this.nDecFrameType}},{key:"PlayM4_CreateAudEncode",value:function G(e){if(Ae){console.log(">>>JS PlayM4_CreateAudEncode 1 nEncoderType:"+e)}if(this.decodeWorker==null){return he}if(eye||e===me){return ce}this.decodeWorker.postMessage({command:"CreateAudEncode",encodertype:e});if(Ae){console.log(">>>JS PlayM4_CreateAudEncode 2 nEncoderType:"+e)}return ne}},{key:"PlayM4_SetAudEncodeParam",value:function V(e,t,n,i){if(Ae){console.log(">>>JS PlayM4_SetAudEncodeParam 1 nSampleRate:"+e+",nChannel:"+t+" ,nBitRate:"+n+" ,nBitWidth:"+i)}if(this.decodeWorker==null){return he}if(t!=ge||i!=Pe){return ce}this.decodeWorker.postMessage({command:"SetAudEncodeParam",samplerate:e,channel:t,bitrate:n,bitwidth:i});if(Ae){console.log(">>>JS PlayM4_SetAudEncodeParam 2 nSampleRate:"+e+",nChannel:"+t+" ,nBitRate:"+n+" ,nBitWidth:"+i)}return ne}},{key:"PlayM4_InputAudEncodeData",value:function Y(e,t){if(Ae){console.log(">>>JS PlayM4_InputAudEncodeData 1 dataSize:"+t)}if(this.decodeWorker==null){return he}if(Ae){console.log(">>>JS PlayM4_InputAudEncodeData 2 dataSize:"+t+", nSysTime:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}this.decodeWorker.postMessage({command:"InputAudEncodeData",data:e,dataSize:t});return ne}},{key:"PlayM4_DestroyAudEncode",value:function X(){if(Ae){console.log(">>>JS MainThread-PlayM4_DestroyAudEncode 1 ")}if(this.decodeWorker==null){return he}this.aAudioEncBuffer.splice(0,this.aAudioEncBuffer.length);this.iAudioEncBufferSize=0;this.decodeWorker.postMessage({command:"DestroyAudEncode"});return ne}},{key:"PlayM4_GetAudioEmcBuf",value:function Z(){return this.aAudioEncBuffer}},{key:"PlayM4_RegisterAudEncodeCB",value:function K(e){if(Ae){console.log(">>>JS PlayM4_RegisterAudEncodeCB 1 callback:"+e)}if(e&&typeof e==="function"){this.AudEncodeDataCBFun=e;if(Ae){console.log(">>>JS PlayM4_RegisterAudEncodeCB 2 callback:"+e)}return ne}else{return te}}},{key:"downloadFile",value:function $(e,t){var n=e;if(!(e instanceof Blob||e instanceof File)){n=new Blob([e])}var i=window.URL.createObjectURL(n);var r=window.document.createElement("a");r.href=i;r.download=t;var o=document.createEvent("MouseEvents");o.initEvent("click",true,true);r.dispatchEvent(o)}}]);return a}()},function(e,i,r){"use strict";(function(h){Object.defineProperty(i,"__esModule",{value:true});i.StorageManager=undefined;var l=function(){function i(e,t){for(var n=0;n0){var n=this.aStreamList.shift();e.seek(e.length);if(e.length>=this.options.iFileSize){if(this.options.cbEventHandler){this.options.cbEventHandler(y,this.szUUID)}return}var i=new Blob([n]);e.write(i)}else{setTimeout(function(){t.writeFile(e)},m)}}}},{key:"stopWriteFile",value:function u(){var i=this;this.bStart=false;this.aStreamList.length=0;var e=new Promise(function(t,n){window.requestFileSystem(window.TEMPORARY,i.options.iFileSize,function(e){e.root.getFile(i.szPath+"/"+i.szFileName,{create:false},function(e){e.file(function(e){t();f.oTool.downloadFile(e,e.name)})},function(){n()})},function(){n()})});return e}}]);return r}();var g=function(){function a(e,t,n,i,r,o,s){p(this,a);this.szBasePath=e;this.szUUID=t;this.szFileName=n;this.aHeadBuf=new Uint8Array(i);this.iPackType=r;this.iStreamType=o;this.oWorker=null;this.oFileSystem=null;this.options=s}l(a,[{key:"init",value:function t(){var n=this;var e=new Promise(function(e,t){n.initFileSystem().then(function(){n.initWorker().then(function(){e(n.szUUID)},function(e){t(e)})},function(e){t(e)})});return e}},{key:"initFileSystem",value:function i(){var n=this;this.oFileSystem=new u(this.szUUID,this.szFileName,this.iStreamType,this.options);var e=new Promise(function(e,t){n.oFileSystem.init().then(function(){e()},function(e){t(e)})});return e}},{key:"initWorker",value:function n(){var r=this;var e=new Promise(function(i){r.oWorker=new Worker(r.szBasePath+"/systemTransform-worker.min.js");r.oWorker.onmessage=function(e){var t=e.data;if("loaded"===t.type){r.oWorker.postMessage({type:"create",buf:r.aHeadBuf.buffer,len:40,packType:r.iPackType},[r.aHeadBuf.buffer])}else if("created"===t.type){i()}else if("outputData"===t.type){var n=new Uint8Array(t.buf);if(s===t.dType){r.oFileSystem.writeFileHeader(n)}else{r.oFileSystem.writeFileContent(n)}}}});return e}},{key:"inputData",value:function r(e){if(this.oWorker){var t=new Uint8Array(e);this.oWorker.postMessage({type:"inputData",buf:t.buffer,len:t.length},[t.buffer])}}},{key:"stopRecord",value:function o(){var n=this;var e=new Promise(function(e,t){if(n.oWorker){n.oWorker.postMessage({type:"release"})}else{t()}if(n.oFileSystem){n.oFileSystem.stopWriteFile().then(function(){e()},function(){t()})}else{t()}});return e}}]);return a}();var n=function(){var c=Symbol("STORAGELIST");var e=function(){function n(e,t){p(this,n);this.szBasePath=e;this[c]={};this.options={iFileSize:1024*1024*1024};h.extend(this.options,t)}l(n,[{key:"startRecord",value:function f(e,t,n,i,r){var o=this;var s=d["default"].v4();var a=h.extend({},this.options,r);var u=new g(this.szBasePath,s,e,t,n,i,a);var l=new Promise(function(t,n){u.init().then(function(e){o[c][e]=u;t(e)},function(e){n(e)})});return l}},{key:"inputData",value:function i(e,t){var n=this[c][e];if(n){n.inputData(t)}}},{key:"stopRecord",value:function t(i){var r=this;var e=new Promise(function(e,t){var n=r[c][i];if(n){n.stopRecord().then(function(){delete r[c][i];e()},function(){t()})}else{t()}});return e}}]);return n}();return e}();i.StorageManager=n}).call(this,r(1))},function(e,t,n){"use strict";(function(K){Object.defineProperty(t,"__esModule",{value:true});var $=function(){function i(e,t){for(var n=0;n=c.m_iMinClosed){c.m_bClosed=true;D[L]=false;c.setPointInfo(c.m_aPoint);H(c);J();a=false;if(!D[N]&&0===c.m_iRedrawMode){D[q]=false}D[z]&&D[z]({id:+c.m_szId,type:c.m_szType,event:"drawEnd"})}}if(D[F]&&c){if(c.m_aPoint.length>=c.m_iMinClosed){c.m_bClosed=true;D[F]=false;D[q]=false;c.setPointInfo(c.m_aPoint);H(c);J()}}}else if(e.button===0){u=e.offsetX;l=e.offsetY;f="draw";if(!D[L]){var t=r();if(t!==-1){if(D[E][t].inArc(e.offsetX,e.offsetY,5)){f="stretch"}}if(f!=="stretch"){for(var n=0,i=D[E].length;n-1){if(a){if(f==="drag"){D[E][t].drag(e.offsetX,e.offsetY)}else if(f==="stretch"){D[E][t].stretch(e.offsetX,e.offsetY);D[z]&&D[z]({id:+D[E][t].m_szId,type:D[E][t].m_szType,event:"stretch"})}}}else{if(D[q]){if(a){if(D[A]==="Rect"){c.move([[u,l],[e.offsetX,e.offsetY]])}else if(D[A]==="Grid"){D[E][0].move(u,l,e.offsetX,e.offsetY)}}}}}else if(D[L]){if(D[q]){if(a){if(D[A]==="Polygon"&&c.m_iPolygonType===0){c.m_bClosed=true}J();c.move(e.offsetX,e.offsetY,u,l)}}}else if(D[F]){if(D[q]){if(a){J();c.move(e.offsetX,e.offsetY)}}}});D[x].bind("mouseup",function(e){D[x][0].style.cursor="default";if(c!==null&&typeof c!=="undefined"&&f==="draw"&&D[q]){if(D[A]==="Rect"){if(Math.abs(e.offsetX-u)>2&&Math.abs(e.offsetY-l)>2){H(c);if(!D[N]&&0===c.m_iRedrawMode&&1===D[O]){D[q]=false}D[z]&&D[z]({id:+c.m_szId,type:c.m_szType,event:"drawEnd"})}if(D[B]){var t={id:+c.m_szId,startPos:[],endPos:[],tips:c.m_szTips};if(c.m_aPoint[0]&&c.m_aPoint[2]){try{var n=void 0;var i=void 0;var r=void 0;var o=void 0;if(e.offsetX>u&&e.offsetY>l){t.startPos=c.m_aPoint[0]||[e.offsetX,e.offsetY];t.endPos=c.m_aPoint[2]||[e.offsetX,e.offsetY];n=c.m_aPoint[0][0]/D.m_iCanvasWidth;i=c.m_aPoint[0][1]/D.m_iCanvasHeight;r=c.m_aPoint[2][0]/D.m_iCanvasWidth;o=c.m_aPoint[2][1]/D.m_iCanvasHeight}else{t.startPos=c.m_aPoint[2]||[e.offsetX,e.offsetY];t.endPos=c.m_aPoint[0]||[e.offsetX,e.offsetY];n=c.m_aPoint[2][0]/D.m_iCanvasWidth;i=c.m_aPoint[2][1]/D.m_iCanvasHeight;r=c.m_aPoint[0][0]/D.m_iCanvasWidth;o=c.m_aPoint[0][1]/D.m_iCanvasHeight}t.points=[[n,i],[r,i],[r,o],[n,o]];D[B]&&D[B](t)}catch(s){}}D.clearAllShape()}c=null}else if(D[A]==="Polygon"&&c.m_iPolygonType===0&&D[L]){if(Math.abs(e.offsetX-u)>2&&Math.abs(e.offsetY-l)>2){H(c);D[L]=false;if(!D[N]&&0===c.m_iRedrawMode){D[q]=false}D[z]&&D[z]({id:+c.m_szId,type:c.m_szType,event:"drawEnd"})}}}if(!D[L]&&!D[F]){a=false}else{a=true}if(!D[L]||!D[F]){J()}});D[x].bind("dblclick",function(){if(D[q]){if(D[A]==="Grid"){D[E][0].m_szGridMap="fffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffc";J()}}if(o){o.m_aPoint.pop()}});D[x].bind("mouseout",function(){D[x][0].style.cursor="default";if(!D[L]&&!D[F]){a=false}else{a=true}})}var e=function(){function e(){Q(this,e);this.m_szId="";this.m_aPoint=[];this.m_bChoosed=false;this.m_szDrawColor=D[M].szDrawColor;this.m_szFillColor=D[M].szFillColor;this.m_iTranslucent=D[M].iTranslucent;this.m_iIndexChoosePoint=-1;this.m_iDriftStartX=0;this.m_iDriftStartY=0;this.m_oEdgePoints={top:{x:0,y:0},left:{x:0,y:0},right:{x:0,y:0},bottom:{x:0,y:0}};this.m_szTips="";this.m_iEditType=0;this.m_iMinClosed=3;this.m_iMaxPointNum=11;this.m_bClosed=false;this.m_iRedrawMode=0}$(e,[{key:"draw",value:function t(){}},{key:"drag",value:function r(e,t){if(this.m_iEditType!==2){var n=this.m_aPoint.length;var i=0;for(i=0;iD.m_iCanvasWidth||this.m_aPoint[i][1]+t-this.m_iDriftStartY>D.m_iCanvasHeight||this.m_aPoint[i][0]+e-this.m_iDriftStartX<0||this.m_aPoint[i][1]+t-this.m_iDriftStartY<0){this.m_iDriftStartX=e;this.m_iDriftStartY=t;return}}for(i=0;it!==this.m_aPoint[o][1]>t&&e<(this.m_aPoint[o][0]-this.m_aPoint[r][0])*(t-this.m_aPoint[r][1])/(this.m_aPoint[o][1]-this.m_aPoint[r][1])+this.m_aPoint[r][0]){n=!n}}return n}},{key:"inArc",value:function a(e,t,n){var i=false;for(var r=0,o=this.m_aPoint.length;r0){this.m_aPoint=e;this.setEdgePoints(e)}}},{key:"addPoint",value:function l(e,t){if(this.m_aPoint.lengththis.m_oEdgePoints.right.x){this.m_oEdgePoints.right.x=e[t][0];this.m_oEdgePoints.right.y=e[t][1]}if(e[t][1]>this.m_oEdgePoints.bottom.y){this.m_oEdgePoints.bottom.x=e[t][0];this.m_oEdgePoints.bottom.y=e[t][1]}if(e[t][0]e[o][0]){t=e[o][0]}if(n>e[o][1]){n=e[o][1]}if(ithis.m_aPoint[3][0]&&tthis.m_aPoint[0][0]){this.m_aPoint[1][0]=e;this.m_aPoint[2][0]=e}}else if(this.m_iIndexChoosePoint===5){if(ethis.m_aPoint[1][1]){this.m_aPoint[3][0]=e;this.m_aPoint[3][1]=t;this.m_aPoint[0][0]=e;this.m_aPoint[2][1]=t}}else if(this.m_iIndexChoosePoint===6){if(t>this.m_aPoint[1][1]){this.m_aPoint[2][1]=t;this.m_aPoint[3][1]=t}}else if(this.m_iIndexChoosePoint===7){if(e>this.m_aPoint[0][0]&&t>this.m_aPoint[0][1]){this.m_aPoint[2][0]=e;this.m_aPoint[2][1]=t;this.m_aPoint[1][0]=e;this.m_aPoint[3][1]=t}}J()}}},{key:"move",value:function o(e){J();this.m_bChoosed=true;var t=e[0][0];var n=e[0][1];var i=e[1][0];var r=e[1][1];this.setPointInfo([[t,n],[i,n],[i,r],[t,r]]);this.draw()}},{key:"inArc",value:function d(e,t,n){var i=this.m_aPoint[0][0];var r=this.m_aPoint[0][1];var o=this.m_aPoint[2][0]-i;var s=this.m_aPoint[2][1]-r;var a=Math.round(o/2);var u=Math.round(s/2);var l=[i,i+a,i+o,i,i+o,i,i+a,i+o];var f=[r,r,r,r+u,r+u,r+s,r+s,r+s];for(var c=0;c<8;c++){var h=Math.sqrt((e-l[c])*(e-l[c])+(t-f[c])*(t-f[c]));if(hD.m_iCanvasHeight||this.m_aPoint[i][0]+e-this.m_iDriftStartX<0||this.m_aPoint[i][1]+t-this.m_iDriftStartY<0){this.m_iDriftStartX=e;this.m_iDriftStartY=t;return}}for(i=0;iD.m_iCanvasHeight||this.m_aPoint[i][1]+t-this.m_iDriftStartY<0){this.m_iDriftStartX=e;this.m_iDriftStartY=t;return}}for(i=0;i0){f=1}else{f=-1}if(i-t>0){c=1}else{c=-1}var h=[];for(var d=0;d=a&&d<=a+l&&p>=s&&p<=s+u){h[d][p]=1}else{h[d][p]=0}}else{if(d<=a&&d>=a-l&&p>=s&&p<=s+u){h[d][p]=1}else{h[d][p]=0}}}else{if(c===1){if(d>=a&&d<=a+l&&p<=s&&p>=s-u){h[d][p]=1}else{h[d][p]=0}}else{if(d<=a&&d>=a-l&&p<=s&&p>=s-u){h[d][p]=1}else{h[d][p]=0}}}}}this.m_aAddGridMap=h;this.draw()}}]);return t}(e);var Y=function(e){m(t,e);function t(){Q(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.m_szType="Line";e.m_iLineType=0;e.m_iDirection=0;e.m_iArrowType=0;e.m_aCrossArrowPoint=[];return e}$(t,[{key:"draw",value:function n(){if(this.m_iLineType===0||this.m_iLineType===2){this.drawNormalLine()}else if(this.m_iLineType===1){this.drawArrowLine2()}else if(this.m_iLineType===3){this.drawCrossLine()}else if(this.m_iLineType===4){this.drawLineCount()}}},{key:"drawNormalLine",value:function r(){D[I].globalAlpha=1;if(this.m_aPoint.length>0){D[I].beginPath();D[I].strokeStyle=this.m_szDrawColor;D[I].lineWidth=2;D[I].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]);for(var e=1,t=this.m_aPoint.length;e0){D[I].strokeStyle=this.m_szDrawColor;D[I].globalAlpha=1;var n=0;var i=0;for(n=0,i=this.m_aPoint.length;ne[o][0]){t=e[o][0]}if(n>e[o][1]){n=e[o][1]}if(i0){D[I].fillStyle=this.m_szFillColor;D[I].strokeStyle=this.m_szDrawColor;D[I].globalAlpha=1;var e=0;var t=0;if(this.m_bChoosed){for(e=0,t=this.m_aPoint.length;e0){D[I].fillStyle=this.m_szFillColor;D[I].strokeStyle=this.m_szDrawColor;D[I].globalAlpha=1;var r=0;var o=0;for(r=0,o=this.m_aPoint.length;rthis.m_aPoint[3][0]&&tthis.m_aPoint[0][0]&&t>this.m_aPoint[0][1]){this.m_aPoint[2][0]=e;this.m_aPoint[2][1]=t;this.m_aPoint[1][0]=e;this.m_aPoint[3][1]=t}}else if(this.m_iIndexChoosePoint===3){if(ethis.m_aPoint[1][1]){this.m_aPoint[3][0]=e;this.m_aPoint[3][1]=t;this.m_aPoint[0][0]=e;this.m_aPoint[2][1]=t}}}this.setPointInfo(this.m_aPoint);J()}}}]);return t}(e);var Z=function(e){m(t,e);function t(){Q(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.m_szType="Point";e.m_szId="";e.m_szPointType="circle";return e}$(t,[{key:"draw",value:function n(){if(this.m_szPointType==="circle"){this.drawCirclePoint()}else if(this.m_szPointType==="cross"){this.drawcrossPoint()}}},{key:"drawCirclePoint",value:function i(){D[I].beginPath();D[I].fillStyle=this.m_szDrawColor;D[I].globalAlpha=1;D[I].arc(this.m_aPoint[0][0],this.m_aPoint[0][1],10,0,Math.PI*2,true);D[I].closePath();D[I].fill()}},{key:"drawcrossPoint",value:function r(){D[I].beginPath();D[I].strokeStyle=this.m_szDrawColor;D[I].fillStyle=this.m_szDrawColor;D[I].lineWidth=2;D[I].globalAlpha=1;D[I].moveTo(this.m_aPoint[0][0]-12,this.m_aPoint[0][1]);D[I].lineTo(this.m_aPoint[0][0]+12,this.m_aPoint[0][1]);D[I].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]-12);D[I].lineTo(this.m_aPoint[0][0],this.m_aPoint[0][1]+12);D[I].fillText(this.m_szTips,this.m_aPoint[0][0]+12,this.m_aPoint[0][1]-12);D[I].closePath();D[I].stroke()}},{key:"stretch",value:function o(){}},{key:"inShape",value:function s(e,t){var n=false;if(this.m_szPointType==="cross"){if(e<=this.m_aPoint[0][0]+4&&e>=this.m_aPoint[0][0]-4&&t<=this.m_aPoint[0][1]+12&&t>=this.m_aPoint[0][1]-12){n=true}else if(t<=this.m_aPoint[0][1]+4&&t>=this.m_aPoint[0][1]-4&&e<=this.m_aPoint[0][0]+12&&e>=this.m_aPoint[0][0]-12){n=true}}return n}}]);return t}(e);var t=function(){function t(e){Q(this,t);D=this;this[x]=K("#"+e);this.szCanvasId=e;this[I]=this[x][0].getContext("2d");this[E]=[];this[q]=false;this[A]="";this[O]=10;this[N]=true;this[W]={};this[B]=null;this[M]={szDrawColor:"#ff0000",szFillColor:"#343434",iTranslucent:.7};this[L]=false;this[F]=false;this.m_iCanvasWidth=this[x].width()||document.getElementById(this.szCanvasId).width;this.m_iCanvasHeight=this[x].height()||document.getElementById(this.szCanvasId).height;this.m_iHorizontalResolution=0;this.m_iVerticalResolution=0;this.m_szDisplayMode="";this.m_szVideoFormat="";this.m_iHistoryCanvasWidth=this[x].width();this.m_iHistoryCanvasHeight=this[x].height();U();this[E].length=0}$(t,[{key:"_getCanvasPoints",value:function r(e){var t=e.length;var n=[];for(var i=0;i0){for(var r=0;r0&&t>0){this.m_iCanvasWidth=e;this.m_iCanvasHeight=t;J()}}},{key:"setDrawStyle",value:function g(e,t,n){this[M]={szDrawColor:e,szFillColor:t,iTranslucent:n}}},{key:"clearAllShape",value:function P(){this[E].length=0;D[L]=false;D[F]=false;J()}},{key:"clearShapeByType",value:function w(e){var t=this[E].length;for(var n=t;n>0;n--){if(this[E][n-1].m_szType===e){if(e==="Grid"){this[E][n-1].m_szGridMap="";this[E][n-1].m_aAddGridMap=[]}else{this[E].splice(n-1,1)}}}if("Polygon"===e){D[L]=false}if("Line"===e){D[F]=false}if(e==="All"||e==="AllWindows"){this[E].length=0}J()}},{key:"deleteChoosedShape",value:function S(){var e=this.getAllShapesInfo();var t=e.length;if(t>0){for(var n=0;n0){for(var r=0;re){this[E].splice(e,1)}J()}},{key:"updateCanvas",value:function C(e){this[x]=K("#"+e);this.szCanvasId=e;this[I]=this[x][0].getContext("2d");this.m_iCanvasWidth=this[x].width()||document.getElementById(this.szCanvasId).width;this.m_iCanvasHeight=this[x].height()||document.getElementById(this.szCanvasId).height;U()}},{key:"resizeCanvas",value:function k(){this.m_iHistoryCanvasWidth=this.m_iCanvasWidth;this.m_iHistoryCanvasHeight=this.m_iCanvasHeight;this.m_iCanvasWidth=this[x].width()||document.getElementById(this.szCanvasId).width;this.m_iCanvasHeight=this[x].height()||document.getElementById(this.szCanvasId).height}},{key:"canvasRedraw",value:function T(){J("canvasRedraw")}},{key:"setDrawEventCallback",value:function R(e){this[z]=e}}]);return t}();return t}();t.ESCanvas=e}).call(this,n(1))},function(e,r,o){"use strict";(function(Jt){Object.defineProperty(r,"__esModule",{value:true});r.LocalServiceControl=undefined;var Ht=function(){function i(e,t){for(var n=0;n0){clearTimeout(t.iUpdateParentWndTimer);t.iUpdateParentWndTimer=-1}if(t.iVCTimeEnd-t.iVCTimeStart<100){t.iUpdateParentWndTimer=setTimeout(function(){t.oRequest.updateParentWnd().then(function(){if(!t.bFreeze&&!t.bDevTool){t.fShowWnd()}},function(){})},100)}else{if(!t.bFreeze&&!t.bDevTool){t.fShowWnd()}}}else{if(!t.bFreeze&&!t.bDevTool){t.fShowWnd()}}}};this.fHideWnd=function(){return this.oRequest.hideWnd()};this.fShowWnd=function(){this.oRequest.showWnd()};this.fUnload=function(){Jt(window).off("unload",this.fUnload);this.JS_Disconnect()};this.fFocus=function(){t.bFocus=true;setTimeout(function(){if(!document.hidden&&!t.bFreeze&&!t.bDevTool){t.fShowWnd()}},200)};this.fBlur=function(){this.bFocus=false};document.addEventListener("visibilitychange",this.fVisibilityChange,true);Jt(window).on("focus",this.fFocus);Jt(window).on("blur",this.fBlur);this.oRequest=new Ut.Request({szPluginContainer:this.oOptions.szPluginContainer,cbConnectSuccess:this.oOptions.cbConnectSuccess,cbConnectError:this.oOptions.cbConnectError,cbConnectClose:function i(e){if(t.iCreateWndTimer>0){clearTimeout(t.iCreateWndTimer);t.iCreateWndTimer=-1}if(t.oOptions.cbConnectClose){t.oOptions.cbConnectClose(e)}},oSessionInfo:this.oOptions.oSessionInfo,bNoDetectPort:this.oOptions.bNoDetectPort,bUseInQT:this.oOptions.bUseInQT,iServicePortStart:this.oOptions.iServicePortStart,iServicePortEnd:this.oOptions.iServicePortEnd});if(this.oRequest!==null){Jt(window).on("unload",this.fUnload)}}Ht(r,[{key:"JS_Disconnect",value:function e(){this.oRequest.disconnect()}},{key:"JS_CreateWnd",value:function t(n,u,l){var f=this;this.szWndId=n;var e=new Promise(function(t,i){var e=null;if(f.oOptions.szIframeId&&Jt("#"+f.oOptions.szIframeId).length){e=Jt("#"+n,Jt("#"+f.oOptions.szIframeId)[0].contentWindow.document)}else{e=Jt("#"+n)}if(e.length>0){var o=jt.oUtils.getWndPostion(e,f.bEmbed,f.oOptions.szIframeId,f.oOptions.bChildIframe,f.oOptions.szChildIframeId);var s=f.oOptions.szIframeId?Jt("#"+f.oOptions.szIframeId)[0].contentWindow||window.top:window.top;var a=s.document.title;f.iCreateWndTimer=function(){var r="";if(jt.oUtils.browser().msie){r="IEFrame"}else if(jt.oUtils.browser().chrome){r="Chrome"}if(!f.bDevTool){var e=jt.oUtils.getDevicePixelRatio();u=Math.round(u*e);l=Math.round(l*e);var n=function n(e,t){var i=function i(t,n){f.oRequest.createWnd(o.left,o.top,u,l,r,f.bEmbed,f.oPluginColor).then(function(){s.document.title=a;f.freshDocumentTitle();t()},function(e){s.document.title=a;f.freshDocumentTitle();if(5001===e.errorCode){if(!document.hidden&&!f.bFreeze&&f.bFocus){f.fShowWnd()}t()}else{n(e)}})};f.handleBeforeCreateWnd(f.oOptions.beforeCreateWnd).then(function(){i(e,t)},function(){i(e,t)})};f.oRequest.destroyWnd().then(function(){n(t,i)},function(){n(t,i)})}};Jt(function(){f.oRequest.getRequestUUID().then(function(e){if(!e){i("uuid undefined");return false}s.document.title=e;f.freshDocumentTitle();f.iCreateWndTimer()})})}else{i()}});return e}},{key:"handleBeforeCreateWnd",value:function n(i){return new Promise(function(e,t){if("function"===typeof i){try{i(e,t)}catch(n){t(n)}}else{e()}})}},{key:"JS_CheckLocalServiceConnected",value:function o(n,i,r){var e=new Promise(function(e,t){Ut.Request.checkLocalServiceConnected(n,i,r).then(function(){e()},function(){t()})});return e}},{key:"JS_ShowWnd",value:function i(){var n=this;var e=new Promise(function(e,t){n.bFreeze=false;if(!document.hidden&&!n.bDevTool){n.fShowWnd()}e()});return e}},{key:"JS_HideWnd",value:function s(){var n=this;var e=new Promise(function(e,t){n.bFreeze=true;n.fHideWnd().then(function(){e()},function(){t()})});return e}},{key:"JS_SetWndCover",value:function a(i,r){var o=this;var e=new Promise(function(e,t){var n=jt.oUtils.getDevicePixelRatio();if(!jt.oUtils.browser().msie){if("left"===i){o.oWndCover.left=r}else if("top"===i){o.oWndCover.top=r}else if("right"===i){o.oWndCover.right=r}else if("bottom"===i){o.oWndCover.bottom=r}}r=Math.round(r*n);o.oRequest.setWndCover(i,r).then(function(){e()},function(){t()})});return e}},{key:"JS_SetWindowControlCallback",value:function h(e){var t=this;Jt.extend(this.oPluginCallback,e);var n={onGetSelectWndInfo:function i(e){if(0<=e.wndInfo.wndIndex){t.fCurrentCallback=t.afCurrentCallback[e.wndInfo.wndIndex]}if(t.oPluginCallback.onGetSelectWndInfo){t.oPluginCallback.onGetSelectWndInfo(parseInt(e.wndInfo.wndIndex,10))}},onPluginEventHandler:function r(e){if(t.oPluginCallback.onPluginEventHandler){t.oPluginCallback.onPluginEventHandler(parseInt(e.wndIndex,10),parseInt(e.eventType,10))}},onDrawCallback:function o(e){if(t.fCurrentCallback){t.fCurrentCallback(e.shapeInfo)}},onDrawEvent:function s(e){if(t.oPluginCallback.onDrawEvent){t.oPluginCallback.onDrawEvent(e)}},onFisheyePTZInfo:function a(e){if(t.oPluginCallback.onFisheyePTZInfo){t.oPluginCallback.onFisheyePTZInfo(e&&e.fishEyePTZInfo)}},onFullScreenChange:function u(e){if(t.oPluginCallback.onFullScreenChange){t.oPluginCallback.onFullScreenChange(e&&e.full)}},onMouseEvent:function l(e){if(t.oPluginCallback.onMouseEvent){t.oPluginCallback.onMouseEvent(e&&e.mouseInfo)}},onUploadAlarmInfo:function f(e){if(t.oPluginCallback.onUploadAlarmInfo){t.oPluginCallback.onUploadAlarmInfo(e&&e.alarm)}},onGetVoiceInfo:function c(e){if(t.oPluginCallback.onGetVoiceInfo){if(e&&e.dbValue){t.oPluginCallback.onGetVoiceInfo([e.dbValue])}if(e&&e.levlAngle){t.oPluginCallback.onGetVoiceInfo([],parseInt(e.levlAngle,10))}}}};this.oRequest.setWindowControlCallback(n)}},{key:"JS_ArrangeWindow",value:function u(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.arrangeWindow(n,i).then(function(){e()},function(){t()})});return e}},{key:"JS_SetSecretKey",value:function l(e,n,i){var r=this;var t=new Promise(function(e,t){r.oRequest.setSecretKey(n,i).then(function(){e()},function(e){t(e.errorCode)})});return t}},{key:"JS_SetOriginalString",value:function f(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setOriginalString(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetEncryptString",value:function c(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.getEncryptString(e,i,r).then(function(e){t(e.encryptString)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetDecryptString",value:function d(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.getDecryptString(e,i,r).then(function(e){t(e.decryptString)},function(e){n(e.errorCode)})});return t}},{key:"JS_DestroyPlugin",value:function p(n){var i=this;this.oPluginCallback={};var e=new Promise(function(e,t){i.oRequest.destroyWnd().then(function(){if(n){i.JS_Disconnect()}e()},function(){t()})});return e}},{key:"JS_DestroyAll",value:function v(){this.JS_DestroyPlugin();this.oRequest.destroy();return Promise.resolve()}},{key:"JS_Play",value:function m(n,i,r,o,s){var a=this;var e=new Promise(function(e,t){a.oRequest.startPlay(n,i,r,o,s).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Play2",value:function y(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.startPlayV2(i,n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_ReversePlay",value:function g(n,i,r,o,s){var a=this;var e=new Promise(function(e,t){a.oRequest.reversePlay(n,i,r,o,s).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Stop",value:function P(n){var i=this;var e=new Promise(function(e,t){i.oRequest.stop(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Seek",value:function w(){var e=new Promise(function(e){e()});return e}},{key:"JS_StopRealPlayAll",value:function S(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopAll().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Pause",value:function _(n){var i=this;var e=new Promise(function(e,t){i.oRequest.pause(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Resume",value:function b(n){var i=this;var e=new Promise(function(e,t){i.oRequest.resume(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Slow",value:function C(n){var i=this;var e=new Promise(function(e,t){i.oRequest.slow(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Fast",value:function k(n){var i=this;var e=new Promise(function(e,t){i.oRequest.fast(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Transmission",value:function T(){var e=new Promise(function(e){e()});return e}},{key:"JS_FrameForward",value:function R(n){var i=this;var e=new Promise(function(e,t){i.oRequest.frame(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetOSDTime",value:function D(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getOSDTime(e).then(function(e){t(e.osdTime)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetPlayInfo",value:function x(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getPlayInfo(e).then(function(e){t(e.playInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_OpenSound",value:function I(n){var i=this;var e=new Promise(function(e,t){i.oRequest.openSound(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_CloseSound",value:function E(){var n=this;var e=new Promise(function(e,t){n.oRequest.closeSound().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetVolume",value:function q(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getVolume(e).then(function(e){t(e.volume)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetVolume",value:function A(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setVolume(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_EnableZoom",value:function O(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.enableZoom(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_DisableZoom",value:function M(n){var i=this;var e=new Promise(function(e,t){i.oRequest.disableZoom(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_CapturePicture",value:function L(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.capture(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartSave",value:function F(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.startSave(n,i,r.iPackageType).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopSave",value:function W(n){var i=this;var e=new Promise(function(e,t){i.oRequest.stopSave(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartTalk",value:function N(n,i,r,o,s,a,u,l,f,c){var h=this;var e=new Promise(function(e,t){h.oRequest.startTalk(n,i,r,o,s,a,u,l,f,c).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopTalk",value:function B(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopTalk().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlayMode",value:function z(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetFullScreenCapability",value:function J(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setFullScreenCapability(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_FullScreenDisplay",value:function H(n){var i=this;var e=new Promise(function(e,t){i.oRequest.fullScreen(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_EnableIVS",value:function U(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.enableIVS(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SRInit",value:function j(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.SRInit(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SRPTZ",value:function G(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.SRPTZ(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlaybackDrawType",value:function V(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setPlaybackDrawType(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlayBackType",value:function Y(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setPlayBackType(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetTrsPlayBackParam",value:function X(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setTrsPlayBackParam(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetLocalConfig",value:function Z(){var i=this;var e=new Promise(function(t,n){i.oRequest.getLocalConfig().then(function(e){t(e.localConfig);i.iProtocolType=parseInt(e.localConfig.protocolType,10)},function(e){n(e&&e.errorCode)})});return e}},{key:"JS_GetEngineSupport",value:function K(){var e=this;var t=new Promise(function(t,n){e.oRequest.getEngineSupport().then(function(e){t(e)},function(e){n(e&&e.errorCode)})});return t}},{key:"JS_SetLocalConfig",value:function $(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setLocalConfig(n).then(function(){i.iProtocolType=parseInt(n.protocolType,10);e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetLastError",value:function Q(){var e=this;var t=new Promise(function(t,n){e.oRequest.getLastError().then(function(e){t(e.lastError)},function(e){n(e.errorCode)})});return t}},{key:"JS_OpenFileBrowser",value:function ee(e,i){var r=this;var t=new Promise(function(t,n){if(!r.bLocalServiceRunning||r.bOpened){n();return}r.bOpened=true;r.oRequest.browseFilePath(e,i).then(function(e){r.bOpened=false;t(e.filepath)},function(e){r.bOpened=false;n(e.errorCode)})});return t}},{key:"JS_OpenDirectory",value:function te(n){var i=this;var e=new Promise(function(e,t){i.oRequest.openDirectory(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartAsynUpload",value:function ne(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.startAsynUpload(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopAsynUpload",value:function ie(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopAsynUpload().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetUploadErrorInfo",value:function re(){var e=this;var t=new Promise(function(t,n){e.oRequest.getUploadErrorInfo().then(function(e){t(e.errorInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_UploadFile",value:function oe(e,i,r,o){var s=this;var t=new Promise(function(t,n){s.oRequest.uploadFile(e,i,r,o).then(function(e){t(e)},function(e){n({readyState:4,status:e.errorCode,responseXML:e.errorInfo?jt.oUtils.parseXmlFromStr(e.errorInfo):null,errorInfo:e.errorInfo})})});return t}},{key:"JS_GetIpcImportErrorInfo",value:function se(){var e=this;var t=new Promise(function(t,n){e.oRequest.getIpcImportErrorInfo().then(function(e){t(e.errorInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_DownloadFile",value:function ae(e,i,r,o,s,a){var u=this;var t=new Promise(function(t,n){u.oRequest.downloadFile(e,i,r,o,s,a).then(function(e){if(typeof e.ret==="undefined"){t(0)}else{t(e.ret)}},function(e){n({readyState:4,status:e.errorCode,responseXML:e.errorInfo?jt.oUtils.parseXmlFromStr(e.errorInfo):null})})});return t}},{key:"JS_DownloadFileNoPlugin",value:function ue(t){var e=new Promise(function(e){Jt("body").append('
  • ');Jt("#jsplugin_download_li").trigger("click");Jt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_StartUpgrade",value:function le(n,i,r,o,s){var a=this;var e=new Promise(function(e,t){a.oRequest.startUpgrade(n,i,r,o,s).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopUpgrade",value:function fe(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopUpgrade().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetUpgradeStatus",value:function ce(){var e=this;var t=new Promise(function(t,n){e.oRequest.getUpgradeStatus().then(function(e){t(e.upgradeStatus)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetUpgradeProgress",value:function he(){var e=this;var t=new Promise(function(t,n){e.oRequest.getUpgradeProgress().then(function(e){t(e.upgradeProgress)},function(e){n(e.errorCode)})});return t}},{key:"JS_ExportDeviceLog",value:function de(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.exportDeviceLog(e,i,r).then(function(e){if(typeof e.ret==="undefined"){t(0)}else{t(e.ret)}},function(e){n(e.errorCode)})});return t}},{key:"JS_ExportReport",value:function pe(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.exportReport(e,i,r).then(function(e){if(typeof e.ret==="undefined"){t(0)}else{t(e.ret)}},function(e){n(e.errorCode)})});return t}},{key:"JS_StartAsyncDownload",value:function ve(e,i,r,o){var s=this;var t=new Promise(function(t,n){s.oRequest.startAsyncDownload(e,i,r,o,s.iPackageType).then(function(e){t(e.downloadId)},function(e){n({readyState:4,status:e.errorCode,responseXML:e.errorInfo?jt.oUtils.parseXmlFromStr(e.errorInfo):null})})});return t}},{key:"JS_StopAsyncDownload",value:function me(n){var i=this;var e=new Promise(function(e,t){i.oRequest.stopAsyncDownload(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetDownloadStatus",value:function ye(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getDownloadStatus(e).then(function(e){t(e.downloadStatus)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetDownloadProgress",value:function ge(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getDownloadProgress(e).then(function(e){t(e.downloadProgress)},function(e){n(e.errorCode)})});return t}},{key:"JS_EnablePDC",value:function Pe(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.enablePDC(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Resize",value:function we(o,s){var a=this;var e=new Promise(function(e,t){var n=null;if(a.oOptions.szIframeId&&Jt("#"+a.oOptions.szIframeId).length){n=Jt("#"+a.szWndId,Jt("#"+a.oOptions.szIframeId)[0].contentWindow.document)}else{n=Jt("#"+a.szWndId)}if(n.length>0){var i=jt.oUtils.getWndPostion(n,a.bEmbed,a.oOptions.szIframeId,a.oOptions.bChildIframe,a.oOptions.szChildIframeId);var r=jt.oUtils.getDevicePixelRatio();if(!jt.oUtils.browser().msie){if(a.oWndCover.left>0){i.left=i.left+Math.round(a.oWndCover.left*r);o=o-a.oWndCover.left}if(a.oWndCover.top>0){i.top=i.top+Math.round(a.oWndCover.top*r);s=s-a.oWndCover.top}if(a.oWndCover.right>0){o=o-a.oWndCover.right}if(a.oWndCover.bottom>0){s=s-a.oWndCover.bottom}}o=Math.round(o*r);s=Math.round(s*r);a.oRequest.setWndGeometry(i.left,i.top,o,s).then(function(){e()},function(){t()})}else{t()}});return e}},{key:"JS_SetDrawCallback",value:function Se(n,i,r,o,s,a){var u=this;a=a||{};u.fCurrentCallback=null;u.afCurrentCallback[n]=null;var e=new Promise(function(e,t){u.oRequest.setDrawCallback(n,i,r,o,a).then(function(){u.fCurrentCallback=s;u.afCurrentCallback[n]=s;e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetDrawStatus",value:function _e(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setDrawStatus(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_ClearRegion",value:function be(){var n=this;var e=new Promise(function(e,t){n.oRequest.clearRegion().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetDrawShapeInfo",value:function Ce(n,i){var r=this;var e=new Promise(function(e,t){if(r.iDrawWondIndex!==-1){i.wndIndex=r.iDrawWondIndex}r.oRequest.setDrawShapeInfo(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetGridInfo",value:function ke(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setGridInfo(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetGridInfo",value:function Te(){var e=this;var t=new Promise(function(t,n){e.oRequest.getGridInfo().then(function(e){t(e.gridInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetRectInfo",value:function Re(i){var r=this;var e=new Promise(function(e,t){if(r.iDrawWondIndex!==-1){var n=void 0;for(n=0;nt;r(i)},function(){e()})});return e}},{key:"JS_SelectShape",value:function ot(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.selectShape(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetPictureSize",value:function st(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getPictureSize(e).then(function(e){t(e)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetOriginResolution",value:function at(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.setOriginResolution(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlayWndMode",value:function ut(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.setPlayWndMode(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_CuttingPartWindow",value:function lt(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.cuttingPartWindow(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_RepairPartWindow",value:function ft(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.repairPartWindow(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_PlayWithImg",value:function ct(){return Promise.resolve()}},{key:"JS_SetPackageType",value:function ht(e){this.iPackageType=e;return Promise.resolve()}},{key:"JS_SetSnapDrawWndIndex",value:function dt(e){this.iDrawWondIndex=e;return Promise.resolve()}},{key:"JS_ExistGetSlfPointList",value:function pt(){return Promise.resolve(true)}},{key:"JS_GetSlfPointList",value:function vt(e,i){var r=this;var t=new Promise(function(t,n){r.oRequest.getSlfPointList(e,i).then(function(e){t(e.points)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetWindowSelected",value:function mt(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setWindowSelected(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_AudioPlay",value:function yt(n,i,r,o,s,a){var u=this;var e=new Promise(function(e,t){u.oRequest.audioPlay(n,i,r,o,s,a).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartSycAudioPlay",value:function gt(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.startSycAudioPlay(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetDownFilePath",value:function Pt(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getDownFilePath(e).then(function(e){t(e.files)},function(e){n(e.errorCode)})});return t}},{key:"JS_DeleteDownLoadFile",value:function wt(e){var i=this;var t=new Promise(function(t,n){i.oRequest.deleteDownloadFile(e).then(function(e){t(e)},function(e){n(e.errorCode)})});return t}},{key:"JS_SycVideoAndAudio",value:function St(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.sycVideoAndAudio(e,i,r).then(function(e){t(e.files)},function(e){n(e.errorCode)})});return t}},{key:"JS_StopSycAudioPlay",value:function _t(n){var i=this;var e=new Promise(function(e,t){i.oRequest.stopSycAudioPlay(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetAudioPlayStatus",value:function bt(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setAudioPlayStatus(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopAudioPlay",value:function Ct(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopAudioPlay().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartAudioSave",value:function kt(n){var i=this;var e=new Promise(function(e,t){i.oRequest.startAudioRecord(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopAudioSave",value:function Tt(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopAudioSave().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetAudioPlayedTime",value:function Rt(){var e=this;var t=new Promise(function(n,i){if(!e.bLocalServiceRunning){i();return}e.oRequest.getAudioPlayedTime().then(function(e){var t=e.time;if(t<0||!t){i()}else{n(t)}},function(e){i(e.errorCode)})});return t}},{key:"JS_AudioPause",value:function Dt(){var n=this;var e=new Promise(function(e,t){if(!n.bLocalServiceRunning){t();return}n.oRequest.audioPlayPasue().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_AudioResume",value:function xt(){var n=this;var e=new Promise(function(e,t){if(!n.bLocalServiceRunning){t();return}n.oRequest.audioPlayResume().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetAudioVolume",value:function It(n,i){var r=this;var e=new Promise(function(e,t){if(!r.bLocalServiceRunning){t();return}r.oRequest.setAudioVolume(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartAlarmChan",value:function Et(e,t,n,i){var r=Array.prototype.slice.call(arguments,0);return this.commonReturn("startAlarmChan",r)}},{key:"JS_StopAlarmChan",value:function qt(e){var t=Array.prototype.slice.call(arguments,0);return this.commonReturn("stopAlarmChan",t)}},{key:"JS_StartFormAsynUpload",value:function At(e,t){var n=Array.prototype.slice.call(arguments,0);return this.commonReturn("startFormAsynUpload",n)}},{key:"JS_StopFormAsynUpload",value:function Ot(e){var t=Array.prototype.slice.call(arguments,0);return this.commonReturn("stopFormAsynUpload",t)}},{key:"JS_IsPluginExist",value:function Mt(){var e=false;if(this.oRequest&&this.oRequest.oRequest&&this.oRequest.oRequest.szUUID){e=true}return e}},{key:"JS_OpenFileBrowser2",value:function Lt(){var e=Array.prototype.slice.call(arguments,0);return this.commonReturn("openFileBrowser2",e)}},{key:"commonReturn",value:function Ft(r){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var s=this;var e=new Promise(function(t,n){try{var e;(e=s.oRequest)[r].apply(e,Gt(o)).then(function(e){t(e)},function(e){n(e)})}catch(i){n(i)}});return e}},{key:"freshDocumentTitle",value:function Wt(){var e=document.createElement("iframe");e.src="data:text/html;base64,bm90aGluZw==";e.style.display="none";var t=function t(){setTimeout(function(){e.removeEventListener("load",t);e.parentNode.removeChild(e)},0)};e.addEventListener("load",t);document.body.appendChild(e)}},{key:"JS_SetPicInfoToPlayer",value:function Nt(n,i,r,o){var s=this;var e=new Promise(function(e,t){if(!s.bLocalServiceRunning){t();return}s.oRequest.setPicInfoToPlayer(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartSyncHttpTransmission",value:function Bt(e){var i=this;var t=new Promise(function(t,n){if(!i.bLocalServiceRunning){n();return}i.oRequest.syncHttpTransmission(e).then(function(e){t(e)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetCaptureData",value:function zt(e){var i=this;var t=new Promise(function(t,n){if(!i.bLocalServiceRunning){n();return}i.oRequest.getCaptureData(e).then(function(e){t(e.fileContent)},function(e){n(e.errorCode)})});return t}}]);return r}();return e}();r.LocalServiceControl=i}).call(this,o(1))},function(e,i,r){"use strict";(function(Lt){Object.defineProperty(i,"__esModule",{value:true});i.Request=undefined;var Ft=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var Wt=function(){function i(e,t){for(var n=0;n0){var h=function h(){o.imageHttp(i+"?"+u[0],{success:function t(e){u.shift();if(u.length>0){if(o.bInitConnect||o.bConnected){h()}}else{if(r.success){r.success(e)}}},error:function e(){if(r.error){r.error()}},abort:function n(){if(r.abort){r.abort()}}})};h()}}},{key:"splitStr",value:function a(e){var t=this.getByteLen(e);var n=[];var i=1500;for(var r=0,o=Math.ceil(t/i);r=0;a--){for(var u=0;u1){t="laputa"===e[0]?"laputa":"local"}else{i()}var r=v["default"].v4();u.sequence=r;u.uuid=l.szUUID;u.timestamp=(new Date).getTime()+"";var o=JSON.stringify(u);if(l.bConnected){l.sendImageHttp(l.szHost+":"+l.oOptions.iPort+"/imghttp/"+t,o,r,{success:function s(e){if(!e){i();return}var t=JSON.parse(e);if(0===t.errorCode){n(t)}else{i(t)}},error:function a(){i()}})}else{i()}});return e}},{key:"parseCmd",value:function c(e){var t=e.cmd;var n=t.split(".");var i=n[1];if("window"===n[0]||"video"===n[0]){if(this.oWindowControlCallback[i]){this.oWindowControlCallback[i](e)}}}}]);return n}();return e}();r.ImageHttpRequest=i}).call(this,o(1))},function(e,t,n){"use strict";var i=n(4).assign;var r=n(80);var o=n(83);var s=n(45);var a={};i(a,r,o,s);e.exports=a},function(e,t,n){"use strict";var s=n(81);var a=n(4);var u=n(43);var r=n(17);var o=n(44);var l=Object.prototype.toString;var f=0;var c=4;var h=0;var d=1;var p=2;var v=-1;var m=0;var y=8;function g(e){if(!(this instanceof g))return new g(e);this.options=a.assign({level:v,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},e||{});var t=this.options;if(t.raw&&t.windowBits>0){t.windowBits=-t.windowBits}else if(t.gzip&&t.windowBits>0&&t.windowBits<16){t.windowBits+=16}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new o;this.strm.avail_out=0;var n=s.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h){throw new Error(r[n])}if(t.header){s.deflateSetHeader(this.strm,t.header)}if(t.dictionary){var i;if(typeof t.dictionary==="string"){i=u.string2buf(t.dictionary)}else if(l.call(t.dictionary)==="[object ArrayBuffer]"){i=new Uint8Array(t.dictionary)}else{i=t.dictionary}n=s.deflateSetDictionary(this.strm,i);if(n!==h){throw new Error(r[n])}this._dict_set=true}}g.prototype.push=function(e,t){var n=this.strm;var i=this.options.chunkSize;var r,o;if(this.ended){return false}o=t===~~t?t:t===true?c:f;if(typeof e==="string"){n.input=u.string2buf(e)}else if(l.call(e)==="[object ArrayBuffer]"){n.input=new Uint8Array(e)}else{n.input=e}n.next_in=0;n.avail_in=n.input.length;do{if(n.avail_out===0){n.output=new a.Buf8(i);n.next_out=0;n.avail_out=i}r=s.deflate(n,o);if(r!==d&&r!==h){this.onEnd(r);this.ended=true;return false}if(n.avail_out===0||n.avail_in===0&&(o===c||o===p)){if(this.options.to==="string"){this.onData(u.buf2binstring(a.shrinkBuf(n.output,n.next_out)))}else{this.onData(a.shrinkBuf(n.output,n.next_out))}}}while((n.avail_in>0||n.avail_out===0)&&r!==d);if(o===c){r=s.deflateEnd(this.strm);this.onEnd(r);this.ended=true;return r===h}if(o===p){this.onEnd(h);n.avail_out=0;return true}return true};g.prototype.onData=function(e){this.chunks.push(e)};g.prototype.onEnd=function(e){if(e===h){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=a.flattenChunks(this.chunks)}}this.chunks=[];this.err=e;this.msg=this.strm.msg};function i(e,t){var n=new g(t);n.push(e,true);if(n.err){throw n.msg||r[n.err]}return n.result}function P(e,t){t=t||{};t.raw=true;return i(e,t)}function w(e,t){t=t||{};t.gzip=true;return i(e,t)}t.Deflate=g;t.deflate=i;t.deflateRaw=P;t.gzip=w},function(o,e,t){"use strict";var c=t(4);var l=t(82);var N=t(41);var f=t(42);var s=t(17);var h=0;var B=1;var z=3;var d=4;var J=5;var p=0;var H=1;var v=-2;var u=-3;var m=-5;var U=-1;var j=1;var y=2;var G=3;var V=4;var Y=0;var X=2;var g=8;var Z=9;var K=15;var $=8;var Q=29;var ee=256;var n=ee+1+Q;var te=30;var ne=19;var ie=2*n+1;var re=15;var P=3;var w=258;var S=w+P+1;var oe=32;var _=42;var se=69;var b=73;var C=91;var k=103;var T=113;var R=666;var D=1;var x=2;var I=3;var E=4;var ae=3;function q(e,t){e.msg=s[t];return t}function ue(e){return(e<<1)-(e>4?9:0)}function A(e){var t=e.length;while(--t>=0){e[t]=0}}function O(e){var t=e.state;var n=t.pending;if(n>e.avail_out){n=e.avail_out}if(n===0){return}c.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out);e.next_out+=n;t.pending_out+=n;e.total_out+=n;e.avail_out-=n;t.pending-=n;if(t.pending===0){t.pending_out=0}}function a(e,t){l._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t);e.block_start=e.strstart;O(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function L(e,t){e.pending_buf[e.pending++]=t>>>8&255;e.pending_buf[e.pending++]=t&255}function le(e,t,n,i){var r=e.avail_in;if(r>i){r=i}if(r===0){return 0}e.avail_in-=r;c.arraySet(t,e.input,e.next_in,r,n);if(e.state.wrap===1){e.adler=N(e.adler,t,r,n)}else if(e.state.wrap===2){e.adler=f(e.adler,t,r,n)}e.next_in+=r;e.total_in+=r;return r}function fe(e,t){var n=e.max_chain_length;var i=e.strstart;var r;var o;var s=e.prev_length;var a=e.nice_match;var u=e.strstart>e.w_size-S?e.strstart-(e.w_size-S):0;var l=e.window;var f=e.w_mask;var c=e.prev;var h=e.strstart+w;var d=l[i+s-1];var p=l[i+s];if(e.prev_length>=e.good_match){n>>=2}if(a>e.lookahead){a=e.lookahead}do{r=t;if(l[r+s]!==p||l[r+s-1]!==d||l[r]!==l[i]||l[++r]!==l[i+1]){continue}i+=2;r++;do{}while(l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&is){e.match_start=t;s=o;if(o>=a){break}d=l[i+s-1];p=l[i+s]}}while((t=c[t&f])>u&&--n!==0);if(s<=e.lookahead){return s}return e.lookahead}function F(e){var t=e.w_size;var n,i,r,o,s;do{o=e.window_size-e.lookahead-e.strstart;if(e.strstart>=t+(t-S)){c.arraySet(e.window,e.window,t,t,0);e.match_start-=t;e.strstart-=t;e.block_start-=t;i=e.hash_size;n=i;do{r=e.head[--n];e.head[n]=r>=t?r-t:0}while(--i);i=t;n=i;do{r=e.prev[--n];e.prev[n]=r>=t?r-t:0}while(--i);o+=t}if(e.strm.avail_in===0){break}i=le(e.strm,e.window,e.strstart+e.lookahead,o);e.lookahead+=i;if(e.lookahead+e.insert>=P){s=e.strstart-e.insert;e.ins_h=e.window[s];e.ins_h=(e.ins_h<e.pending_buf_size-5){n=e.pending_buf_size-5}for(;;){if(e.lookahead<=1){F(e);if(e.lookahead===0&&t===h){return D}if(e.lookahead===0){break}}e.strstart+=e.lookahead;e.lookahead=0;var i=e.block_start+n;if(e.strstart===0||e.strstart>=i){e.lookahead=e.strstart-i;e.strstart=i;a(e,false);if(e.strm.avail_out===0){return D}}if(e.strstart-e.block_start>=e.w_size-S){a(e,false);if(e.strm.avail_out===0){return D}}}e.insert=0;if(t===d){a(e,true);if(e.strm.avail_out===0){return I}return E}if(e.strstart>e.block_start){a(e,false);if(e.strm.avail_out===0){return D}}return D}function he(e,t){var n;var i;for(;;){if(e.lookahead=P){e.ins_h=(e.ins_h<=P){i=l._tr_tally(e,e.strstart-e.match_start,e.match_length-P);e.lookahead-=e.match_length;if(e.match_length<=e.max_lazy_match&&e.lookahead>=P){e.match_length--;do{e.strstart++;e.ins_h=(e.ins_h<=P){e.ins_h=(e.ins_h<4096)){e.match_length=P-1}}if(e.prev_length>=P&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-P;i=l._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-P);e.lookahead-=e.prev_length-1;e.prev_length-=2;do{if(++e.strstart<=r){e.ins_h=(e.ins_h<=P&&e.strstart>0){r=e.strstart-1;i=s[r];if(i===s[++r]&&i===s[++r]&&i===s[++r]){o=e.strstart+w;do{}while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&re.lookahead){e.match_length=e.lookahead}}}if(e.match_length>=P){n=l._tr_tally(e,1,e.match_length-P);e.lookahead-=e.match_length;e.strstart+=e.match_length;e.match_length=0}else{n=l._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(n){a(e,false);if(e.strm.avail_out===0){return D}}}e.insert=0;if(t===d){a(e,true);if(e.strm.avail_out===0){return I}return E}if(e.last_lit){a(e,false);if(e.strm.avail_out===0){return D}}return x}function pe(e,t){var n;for(;;){if(e.lookahead===0){F(e);if(e.lookahead===0){if(t===h){return D}break}}e.match_length=0;n=l._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++;if(n){a(e,false);if(e.strm.avail_out===0){return D}}}e.insert=0;if(t===d){a(e,true);if(e.strm.avail_out===0){return I}return E}if(e.last_lit){a(e,false);if(e.strm.avail_out===0){return D}}return x}function r(e,t,n,i,r){this.good_length=e;this.max_lazy=t;this.nice_length=n;this.max_chain=i;this.func=r}var W;W=[new r(0,0,0,0,ce),new r(4,4,8,4,he),new r(4,5,16,8,he),new r(4,6,32,32,he),new r(4,4,16,16,i),new r(8,16,32,32,i),new r(8,16,128,128,i),new r(8,32,128,256,i),new r(32,128,258,1024,i),new r(32,258,258,4096,i)];function ve(e){e.window_size=2*e.w_size;A(e.head);e.max_lazy_match=W[e.level].max_lazy;e.good_match=W[e.level].good_length;e.nice_match=W[e.level].nice_length;e.max_chain_length=W[e.level].max_chain;e.strstart=0;e.block_start=0;e.lookahead=0;e.insert=0;e.match_length=e.prev_length=P-1;e.match_available=0;e.ins_h=0}function me(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=g;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new c.Buf16(ie*2);this.dyn_dtree=new c.Buf16((2*te+1)*2);this.bl_tree=new c.Buf16((2*ne+1)*2);A(this.dyn_ltree);A(this.dyn_dtree);A(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new c.Buf16(re+1);this.heap=new c.Buf16(2*n+1);A(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new c.Buf16(2*n+1);A(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function ye(e){var t;if(!e||!e.state){return q(e,v)}e.total_in=e.total_out=0;e.data_type=X;t=e.state;t.pending=0;t.pending_out=0;if(t.wrap<0){t.wrap=-t.wrap}t.status=t.wrap?_:T;e.adler=t.wrap===2?0:1;t.last_flush=h;l._tr_init(t);return p}function ge(e){var t=ye(e);if(t===p){ve(e.state)}return t}function Pe(e,t){if(!e||!e.state){return v}if(e.state.wrap!==2){return v}e.state.gzhead=t;return p}function we(e,t,n,i,r,o){if(!e){return v}var s=1;if(t===U){t=6}if(i<0){s=0;i=-i}else if(i>15){s=2;i-=16}if(r<1||r>Z||n!==g||i<8||i>15||t<0||t>9||o<0||o>V){return q(e,v)}if(i===8){i=9}var a=new me;e.state=a;a.strm=e;a.wrap=s;a.gzhead=null;a.w_bits=i;a.w_size=1<J||t<0){return e?q(e,v):v}i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===R&&t!==d){return q(e,e.avail_out===0?m:v)}i.strm=e;n=i.last_flush;i.last_flush=t;if(i.status===_){if(i.wrap===2){e.adler=0;M(i,31);M(i,139);M(i,8);if(!i.gzhead){M(i,0);M(i,0);M(i,0);M(i,0);M(i,0);M(i,i.level===9?2:i.strategy>=y||i.level<2?4:0);M(i,ae);i.status=T}else{M(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(!i.gzhead.extra?0:4)+(!i.gzhead.name?0:8)+(!i.gzhead.comment?0:16));M(i,i.gzhead.time&255);M(i,i.gzhead.time>>8&255);M(i,i.gzhead.time>>16&255);M(i,i.gzhead.time>>24&255);M(i,i.level===9?2:i.strategy>=y||i.level<2?4:0);M(i,i.gzhead.os&255);if(i.gzhead.extra&&i.gzhead.extra.length){M(i,i.gzhead.extra.length&255);M(i,i.gzhead.extra.length>>8&255)}if(i.gzhead.hcrc){e.adler=f(e.adler,i.pending_buf,i.pending,0)}i.gzindex=0;i.status=se}}else{var s=g+(i.w_bits-8<<4)<<8;var a=-1;if(i.strategy>=y||i.level<2){a=0}else if(i.level<6){a=1}else if(i.level===6){a=2}else{a=3}s|=a<<6;if(i.strstart!==0){s|=oe}s+=31-s%31;i.status=T;L(i,s);if(i.strstart!==0){L(i,e.adler>>>16);L(i,e.adler&65535)}e.adler=1}}if(i.status===se){if(i.gzhead.extra){r=i.pending;while(i.gzindex<(i.gzhead.extra.length&65535)){if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}O(e);r=i.pending;if(i.pending===i.pending_buf_size){break}}M(i,i.gzhead.extra[i.gzindex]&255);i.gzindex++}if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}if(i.gzindex===i.gzhead.extra.length){i.gzindex=0;i.status=b}}else{i.status=b}}if(i.status===b){if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}O(e);r=i.pending;if(i.pending===i.pending_buf_size){o=1;break}}if(i.gzindexr){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}if(o===0){i.gzindex=0;i.status=C}}else{i.status=C}}if(i.status===C){if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}O(e);r=i.pending;if(i.pending===i.pending_buf_size){o=1;break}}if(i.gzindexr){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}if(o===0){i.status=k}}else{i.status=k}}if(i.status===k){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size){O(e)}if(i.pending+2<=i.pending_buf_size){M(i,e.adler&255);M(i,e.adler>>8&255);e.adler=0;i.status=T}}else{i.status=T}}if(i.pending!==0){O(e);if(e.avail_out===0){i.last_flush=-1;return p}}else if(e.avail_in===0&&ue(t)<=ue(n)&&t!==d){return q(e,m)}if(i.status===R&&e.avail_in!==0){return q(e,m)}if(e.avail_in!==0||i.lookahead!==0||t!==h&&i.status!==R){var u=i.strategy===y?pe(i,t):i.strategy===G?de(i,t):W[i.level].func(i,t);if(u===I||u===E){i.status=R}if(u===D||u===I){if(e.avail_out===0){i.last_flush=-1}return p}if(u===x){if(t===B){l._tr_align(i)}else if(t!==J){l._tr_stored_block(i,0,0,false);if(t===z){A(i.head);if(i.lookahead===0){i.strstart=0;i.block_start=0;i.insert=0}}}O(e);if(e.avail_out===0){i.last_flush=-1;return p}}}if(t!==d){return p}if(i.wrap<=0){return H}if(i.wrap===2){M(i,e.adler&255);M(i,e.adler>>8&255);M(i,e.adler>>16&255);M(i,e.adler>>24&255);M(i,e.total_in&255);M(i,e.total_in>>8&255);M(i,e.total_in>>16&255);M(i,e.total_in>>24&255)}else{L(i,e.adler>>>16);L(i,e.adler&65535)}O(e);if(i.wrap>0){i.wrap=-i.wrap}return i.pending!==0?p:H}function be(e){var t;if(!e||!e.state){return v}t=e.state.status;if(t!==_&&t!==se&&t!==b&&t!==C&&t!==k&&t!==T&&t!==R){return q(e,v)}e.state=null;return t===T?q(e,u):p}function Ce(e,t){var n=t.length;var i;var r,o;var s;var a;var u;var l;var f;if(!e||!e.state){return v}i=e.state;s=i.wrap;if(s===2||s===1&&i.status!==_||i.lookahead){return v}if(s===1){e.adler=N(e.adler,t,n,0)}i.wrap=0;if(n>=i.w_size){if(s===0){A(i.head);i.strstart=0;i.block_start=0;i.insert=0}f=new c.Buf8(i.w_size);c.arraySet(f,t,n-i.w_size,i.w_size,0);t=f;n=i.w_size}a=e.avail_in;u=e.next_in;l=e.input;e.avail_in=n;e.next_in=0;e.input=t;F(i);while(i.lookahead>=P){r=i.strstart;o=i.lookahead-(P-1);do{i.ins_h=(i.ins_h<=0){e[t]=0}}var z=0;var a=1;var J=2;var H=3;var U=258;var s=29;var u=256;var l=u+1+s;var f=30;var c=19;var m=2*l+1;var y=15;var o=16;var j=7;var h=256;var d=16;var p=17;var v=18;var g=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var G=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var V=512;var S=new Array((l+2)*2);t(S);var _=new Array(f*2);t(_);var b=new Array(V);t(b);var C=new Array(U-H+1);t(C);var k=new Array(s);t(k);var T=new Array(f);t(T);function R(e,t,n,i,r){this.static_tree=e;this.extra_bits=t;this.extra_base=n;this.elems=i;this.max_length=r;this.has_stree=e&&e.length}var D;var x;var I;function n(e,t){this.dyn_tree=e;this.max_code=0;this.stat_desc=t}function Y(e){return e<256?b[e]:b[256+(e>>>7)]}function E(e,t){e.pending_buf[e.pending++]=t&255;e.pending_buf[e.pending++]=t>>>8&255}function q(e,t,n){if(e.bi_valid>o-n){e.bi_buf|=t<>o-e.bi_valid;e.bi_valid+=n-o}else{e.bi_buf|=t<>>=1;n<<=1}while(--t>0);return n>>>1}function Z(e){if(e.bi_valid===16){E(e,e.bi_buf);e.bi_buf=0;e.bi_valid=0}else if(e.bi_valid>=8){e.pending_buf[e.pending++]=e.bi_buf&255;e.bi_buf>>=8;e.bi_valid-=8}}function K(e,t){var n=t.dyn_tree;var i=t.max_code;var r=t.stat_desc.static_tree;var o=t.stat_desc.has_stree;var s=t.stat_desc.extra_bits;var a=t.stat_desc.extra_base;var u=t.stat_desc.max_length;var l;var f,c;var h;var d;var p;var v=0;for(h=0;h<=y;h++){e.bl_count[h]=0}n[e.heap[e.heap_max]*2+1]=0;for(l=e.heap_max+1;lu){h=u;v++}n[f*2+1]=h;if(f>i){continue}e.bl_count[h]++;d=0;if(f>=a){d=s[f-a]}p=n[f*2];e.opt_len+=p*(h+d);if(o){e.static_len+=p*(r[f*2+1]+d)}}if(v===0){return}do{h=u-1;while(e.bl_count[h]===0){h--}e.bl_count[h]--;e.bl_count[h+1]+=2;e.bl_count[u]--;v-=2}while(v>0);for(h=u;h!==0;h--){f=e.bl_count[h];while(f!==0){c=e.heap[--l];if(c>i){continue}if(n[c*2+1]!==h){e.opt_len+=(h-n[c*2+1])*n[c*2];n[c*2+1]=h}f--}}}function $(e,t,n){var i=new Array(y+1);var r=0;var o;var s;for(o=1;o<=y;o++){i[o]=r=r+n[o-1]<<1}for(s=0;s<=t;s++){var a=e[s*2+1];if(a===0){continue}e[s*2]=X(i[a]++,a)}}function Q(){var e;var t;var n;var i;var r;var o=new Array(y+1);n=0;for(i=0;i>=7;for(;i8){E(e,e.bi_buf)}else if(e.bi_valid>0){e.pending_buf[e.pending++]=e.bi_buf}e.bi_buf=0;e.bi_valid=0}function ne(e,t,n,i){te(e);if(i){E(e,n);E(e,~n)}W.arraySet(e.pending_buf,e.window,t,n,e.pending);e.pending+=n}function ie(e,t,n,i){var r=t*2;var o=n*2;return e[r]>1;s>=1;s--){O(e,n,s)}l=o;do{s=e.heap[1];e.heap[1]=e.heap[e.heap_len--];O(e,n,1);a=e.heap[1];e.heap[--e.heap_max]=s;e.heap[--e.heap_max]=a;n[l*2]=n[s*2]+n[a*2];e.depth[l]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1;n[s*2+1]=n[a*2+1]=l;e.heap[1]=l++;O(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1];K(e,t);$(n,u,e.bl_count)}function oe(e,t,n){var i;var r=-1;var o;var s=t[0*2+1];var a=0;var u=7;var l=4;if(s===0){u=138;l=3}t[(n+1)*2+1]=65535;for(i=0;i<=n;i++){o=s;s=t[(i+1)*2+1];if(++a=3;t--){if(e.bl_tree[w[t]*2+1]!==0){break}}e.opt_len+=3*(t+1)+5+5+4;return t}function ue(e,t,n,i){var r;q(e,t-257,5);q(e,n-1,5);q(e,i-4,4);for(r=0;r>>=1){if(t&1&&e.dyn_ltree[n*2]!==0){return i}}if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0){return r}for(n=32;n0){if(e.strm.data_type===B){e.strm.data_type=le(e)}M(e,e.l_desc);M(e,e.d_desc);s=ae(e);r=e.opt_len+3+7>>>3;o=e.static_len+3+7>>>3;if(o<=r){r=o}}else{r=o=n+5}if(n+4<=r&&t!==-1){he(e,t,n,i)}else if(e.strategy===N||o===r){q(e,(a<<1)+(i?1:0),3);re(e,S,_)}else{q(e,(J<<1)+(i?1:0),3);ue(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1);re(e,e.dyn_ltree,e.dyn_dtree)}ee(e);if(i){te(e)}}function ve(e,t,n){e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255;e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255;e.pending_buf[e.l_buf+e.last_lit]=n&255;e.last_lit++;if(t===0){e.dyn_ltree[n*2]++}else{e.matches++;t--;e.dyn_ltree[(C[n]+u+1)*2]++;e.dyn_dtree[Y(t)*2]++}return e.last_lit===e.lit_bufsize-1}e._tr_init=ce;e._tr_stored_block=he;e._tr_flush_block=pe;e._tr_tally=ve;e._tr_align=de},function(e,t,n){"use strict";var c=n(84);var h=n(4);var d=n(43);var p=n(45);var i=n(17);var r=n(44);var o=n(87);var v=Object.prototype.toString;function s(e){if(!(this instanceof s))return new s(e);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;if(t.raw&&t.windowBits>=0&&t.windowBits<16){t.windowBits=-t.windowBits;if(t.windowBits===0){t.windowBits=-15}}if(t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)){t.windowBits+=32}if(t.windowBits>15&&t.windowBits<48){if((t.windowBits&15)===0){t.windowBits|=15}}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new r;this.strm.avail_out=0;var n=c.inflateInit2(this.strm,t.windowBits);if(n!==p.Z_OK){throw new Error(i[n])}this.header=new o;c.inflateGetHeader(this.strm,this.header);if(t.dictionary){if(typeof t.dictionary==="string"){t.dictionary=d.string2buf(t.dictionary)}else if(v.call(t.dictionary)==="[object ArrayBuffer]"){t.dictionary=new Uint8Array(t.dictionary)}if(t.raw){n=c.inflateSetDictionary(this.strm,t.dictionary);if(n!==p.Z_OK){throw new Error(i[n])}}}}s.prototype.push=function(e,t){var n=this.strm;var i=this.options.chunkSize;var r=this.options.dictionary;var o,s;var a,u,l;var f=false;if(this.ended){return false}s=t===~~t?t:t===true?p.Z_FINISH:p.Z_NO_FLUSH;if(typeof e==="string"){n.input=d.binstring2buf(e)}else if(v.call(e)==="[object ArrayBuffer]"){n.input=new Uint8Array(e)}else{n.input=e}n.next_in=0;n.avail_in=n.input.length;do{if(n.avail_out===0){n.output=new h.Buf8(i);n.next_out=0;n.avail_out=i}o=c.inflate(n,p.Z_NO_FLUSH);if(o===p.Z_NEED_DICT&&r){o=c.inflateSetDictionary(this.strm,r)}if(o===p.Z_BUF_ERROR&&f===true){o=p.Z_OK;f=false}if(o!==p.Z_STREAM_END&&o!==p.Z_OK){this.onEnd(o);this.ended=true;return false}if(n.next_out){if(n.avail_out===0||o===p.Z_STREAM_END||n.avail_in===0&&(s===p.Z_FINISH||s===p.Z_SYNC_FLUSH)){if(this.options.to==="string"){a=d.utf8border(n.output,n.next_out);u=n.next_out-a;l=d.buf2string(n.output,a);n.next_out=u;n.avail_out=i-u;if(u){h.arraySet(n.output,n.output,a,u,0)}this.onData(l)}else{this.onData(h.shrinkBuf(n.output,n.next_out))}}}if(n.avail_in===0&&n.avail_out===0){f=true}}while((n.avail_in>0||n.avail_out===0)&&o!==p.Z_STREAM_END);if(o===p.Z_STREAM_END){s=p.Z_FINISH}if(s===p.Z_FINISH){o=c.inflateEnd(this.strm);this.onEnd(o);this.ended=true;return o===p.Z_OK}if(s===p.Z_SYNC_FLUSH){this.onEnd(p.Z_OK);n.avail_out=0;return true}return true};s.prototype.onData=function(e){this.chunks.push(e)};s.prototype.onEnd=function(e){if(e===p.Z_OK){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=h.flattenChunks(this.chunks)}}this.chunks=[];this.err=e;this.msg=this.strm.msg};function a(e,t){var n=new s(t);n.push(e,true);if(n.err){throw n.msg||i[n.err]}return n.result}function u(e,t){t=t||{};t.raw=true;return a(e,t)}t.Inflate=s;t.inflate=a;t.inflateRaw=u;t.ungzip=a},function(r,e,t){"use strict";var x=t(4);var I=t(41);var E=t(42);var ae=t(85);var q=t(86);var ue=0;var A=1;var O=2;var M=4;var le=5;var L=6;var F=0;var fe=1;var ce=2;var W=-2;var N=-3;var B=-4;var he=-5;var z=8;var J=1;var H=2;var U=3;var j=4;var G=5;var V=6;var Y=7;var X=8;var Z=9;var K=10;var $=11;var Q=12;var ee=13;var de=14;var te=15;var pe=16;var ve=17;var me=18;var ye=19;var ne=20;var ie=21;var ge=22;var Pe=23;var we=24;var Se=25;var _e=26;var re=27;var be=28;var Ce=29;var oe=30;var se=31;var ke=32;var o=852;var s=592;var a=15;var u=a;function Te(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function l(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new x.Buf16(320);this.work=new x.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function f(e){var t;if(!e||!e.state){return W}t=e.state;e.total_in=e.total_out=t.total=0;e.msg="";if(t.wrap){e.adler=t.wrap&1}t.mode=J;t.last=0;t.havedict=0;t.dmax=32768;t.head=null;t.hold=0;t.bits=0;t.lencode=t.lendyn=new x.Buf32(o);t.distcode=t.distdyn=new x.Buf32(s);t.sane=1;t.back=-1;return F}function c(e){var t;if(!e||!e.state){return W}t=e.state;t.wsize=0;t.whave=0;t.wnext=0;return f(e)}function h(e,t){var n;var i;if(!e||!e.state){return W}i=e.state;if(t<0){n=0;t=-t}else{n=(t>>4)+1;if(t<48){t&=15}}if(t&&(t<8||t>15)){return W}if(i.window!==null&&i.wbits!==t){i.window=null}i.wrap=n;i.wbits=t;return c(e)}function d(e,t){var n;var i;if(!e){return W}i=new l;e.state=i;i.window=null;n=h(e,t);if(n!==F){e.state=null}return n}function p(e){return d(e,u)}var v=true;var n,i;function Re(e){if(v){var t;n=new x.Buf32(512);i=new x.Buf32(32);t=0;while(t<144){e.lens[t++]=8}while(t<256){e.lens[t++]=9}while(t<280){e.lens[t++]=7}while(t<288){e.lens[t++]=8}q(A,e.lens,0,288,n,0,e.work,{bits:9});t=0;while(t<32){e.lens[t++]=5}q(O,e.lens,0,32,i,0,e.work,{bits:5});v=false}e.lencode=n;e.lenbits=9;e.distcode=i;e.distbits=5}function De(e,t,n,i){var r;var o=e.state;if(o.window===null){o.wsize=1<=o.wsize){x.arraySet(o.window,t,n-o.wsize,o.wsize,0);o.wnext=0;o.whave=o.wsize}else{r=o.wsize-o.wnext;if(r>i){r=i}x.arraySet(o.window,t,n-i,r,o.wnext);i-=r;if(i){x.arraySet(o.window,t,n-i,i,0);o.wnext=i;o.whave=o.wsize}else{o.wnext+=r;if(o.wnext===o.wsize){o.wnext=0}if(o.whave>>8&255;n.check=E(n.check,k,2,0);l=0;f=0;n.mode=H;break}n.flags=0;if(n.head){n.head.done=false}if(!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check";n.mode=oe;break}if((l&15)!==z){e.msg="unknown compression method";n.mode=oe;break}l>>>=4;f-=4;b=(l&15)+8;if(n.wbits===0){n.wbits=b}else if(b>n.wbits){e.msg="invalid window size";n.mode=oe;break}n.dmax=1<>8&1}if(n.flags&512){k[0]=l&255;k[1]=l>>>8&255;n.check=E(n.check,k,2,0)}l=0;f=0;n.mode=U;case U:while(f<32){if(a===0){break e}a--;l+=i[o++]<>>8&255;k[2]=l>>>16&255;k[3]=l>>>24&255;n.check=E(n.check,k,4,0)}l=0;f=0;n.mode=j;case j:while(f<16){if(a===0){break e}a--;l+=i[o++]<>8}if(n.flags&512){k[0]=l&255;k[1]=l>>>8&255;n.check=E(n.check,k,2,0)}l=0;f=0;n.mode=G;case G:if(n.flags&1024){while(f<16){if(a===0){break e}a--;l+=i[o++]<>>8&255;n.check=E(n.check,k,2,0)}l=0;f=0}else if(n.head){n.head.extra=null}n.mode=V;case V:if(n.flags&1024){d=n.length;if(d>a){d=a}if(d){if(n.head){b=n.head.extra_len-n.length;if(!n.head.extra){n.head.extra=new Array(n.head.extra_len)}x.arraySet(n.head.extra,i,o,d,b)}if(n.flags&512){n.check=E(n.check,i,d,o)}a-=d;o+=d;n.length-=d}if(n.length){break e}}n.length=0;n.mode=Y;case Y:if(n.flags&2048){if(a===0){break e}d=0;do{b=i[o+d++];if(n.head&&b&&n.length<65536){n.head.name+=String.fromCharCode(b)}}while(b&&d>9&1;n.head.done=true}e.adler=n.check=0;n.mode=Q;break;case K:while(f<32){if(a===0){break e}a--;l+=i[o++]<>>=f&7;f-=f&7;n.mode=re;break}while(f<3){if(a===0){break e}a--;l+=i[o++]<>>=1;f-=1;switch(l&3){case 0:n.mode=de;break;case 1:Re(n);n.mode=ne;if(t===L){l>>>=2;f-=2;break e}break;case 2:n.mode=ve;break;case 3:e.msg="invalid block type";n.mode=oe}l>>>=2;f-=2;break;case de:l>>>=f&7;f-=f&7;while(f<32){if(a===0){break e}a--;l+=i[o++]<>>16^65535)){e.msg="invalid stored block lengths";n.mode=oe;break}n.length=l&65535;l=0;f=0;n.mode=te;if(t===L){break e}case te:n.mode=pe;case pe:d=n.length;if(d){if(d>a){d=a}if(d>u){d=u}if(d===0){break e}x.arraySet(r,i,o,d,s);a-=d;o+=d;u-=d;s+=d;n.length-=d;break}n.mode=Q;break;case ve:while(f<14){if(a===0){break e}a--;l+=i[o++]<>>=5;f-=5;n.ndist=(l&31)+1;l>>>=5;f-=5;n.ncode=(l&15)+4;l>>>=4;f-=4;if(n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols";n.mode=oe;break}n.have=0;n.mode=me;case me:while(n.have>>=3;f-=3}while(n.have<19){n.lens[D[n.have++]]=0}n.lencode=n.lendyn;n.lenbits=7;T={bits:n.lenbits};C=q(ue,n.lens,0,19,n.lencode,0,n.work,T);n.lenbits=T.bits;if(C){e.msg="invalid code lengths set";n.mode=oe;break}n.have=0;n.mode=ye;case ye:while(n.have>>24;g=m>>>16&255;P=m&65535;if(y<=f){break}if(a===0){break e}a--;l+=i[o++]<>>=y;f-=y;n.lens[n.have++]=P}else{if(P===16){R=y+2;while(f>>=y;f-=y;if(n.have===0){e.msg="invalid bit length repeat";n.mode=oe;break}b=n.lens[n.have-1];d=3+(l&3);l>>>=2;f-=2}else if(P===17){R=y+3;while(f>>=y;f-=y;b=0;d=3+(l&7);l>>>=3;f-=3}else{R=y+7;while(f>>=y;f-=y;b=0;d=11+(l&127);l>>>=7;f-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat";n.mode=oe;break}while(d--){n.lens[n.have++]=b}}}if(n.mode===oe){break}if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block";n.mode=oe;break}n.lenbits=9;T={bits:n.lenbits};C=q(A,n.lens,0,n.nlen,n.lencode,0,n.work,T);n.lenbits=T.bits;if(C){e.msg="invalid literal/lengths set";n.mode=oe;break}n.distbits=6;n.distcode=n.distdyn;T={bits:n.distbits};C=q(O,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,T);n.distbits=T.bits;if(C){e.msg="invalid distances set";n.mode=oe;break}n.mode=ne;if(t===L){break e}case ne:n.mode=ie;case ie:if(a>=6&&u>=258){e.next_out=s;e.avail_out=u;e.next_in=o;e.avail_in=a;n.hold=l;n.bits=f;ae(e,h);s=e.next_out;r=e.output;u=e.avail_out;o=e.next_in;i=e.input;a=e.avail_in;l=n.hold;f=n.bits;if(n.mode===Q){n.back=-1}break}n.back=0;for(;;){m=n.lencode[l&(1<>>24;g=m>>>16&255;P=m&65535;if(y<=f){break}if(a===0){break e}a--;l+=i[o++]<>w)];y=m>>>24;g=m>>>16&255;P=m&65535;if(w+y<=f){break}if(a===0){break e}a--;l+=i[o++]<>>=w;f-=w;n.back+=w}l>>>=y;f-=y;n.back+=y;n.length=P;if(g===0){n.mode=_e;break}if(g&32){n.back=-1;n.mode=Q;break}if(g&64){e.msg="invalid literal/length code";n.mode=oe;break}n.extra=g&15;n.mode=ge;case ge:if(n.extra){R=n.extra;while(f>>=n.extra;f-=n.extra;n.back+=n.extra}n.was=n.length;n.mode=Pe;case Pe:for(;;){m=n.distcode[l&(1<>>24;g=m>>>16&255;P=m&65535;if(y<=f){break}if(a===0){break e}a--;l+=i[o++]<>w)];y=m>>>24;g=m>>>16&255;P=m&65535;if(w+y<=f){break}if(a===0){break e}a--;l+=i[o++]<>>=w;f-=w;n.back+=w}l>>>=y;f-=y;n.back+=y;if(g&64){e.msg="invalid distance code";n.mode=oe;break}n.offset=P;n.extra=g&15;n.mode=we;case we:if(n.extra){R=n.extra;while(f>>=n.extra;f-=n.extra;n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back";n.mode=oe;break}n.mode=Se;case Se:if(u===0){break e}d=h-u;if(n.offset>d){d=n.offset-d;if(d>n.whave){if(n.sane){e.msg="invalid distance too far back";n.mode=oe;break}}if(d>n.wnext){d-=n.wnext;p=n.wsize-d}else{p=n.wnext-d}if(d>n.length){d=n.length}v=n.window}else{v=r;p=s-n.offset;d=n.length}if(d>u){d=u}u-=d;n.length-=d;do{r[s++]=v[p++]}while(--d);if(n.length===0){n.mode=ie}break;case _e:if(u===0){break e}r[s++]=n.length;u--;n.mode=ie;break;case re:if(n.wrap){while(f<32){if(a===0){break e}a--;l|=i[o++]<>>24;d>>>=w;p-=w;w=P>>>16&255;if(w===0){T[o++]=P&65535}else if(w&16){S=P&65535;w&=15;if(w){if(p>>=w;p-=w}if(p<15){d+=k[i++]<>>24;d>>>=w;p-=w;w=P>>>16&255;if(w&16){_=P&65535;w&=15;if(pu){e.msg="invalid distance too far back";n.mode=R;break e}d>>>=w;p-=w;w=o-s;if(_>w){w=_-w;if(w>f){if(n.sane){e.msg="invalid distance too far back";n.mode=R;break e}}b=0;C=h;if(c===0){b+=l-w;if(w2){T[o++]=C[b++];T[o++]=C[b++];T[o++]=C[b++];S-=3}if(S){T[o++]=C[b++];if(S>1){T[o++]=C[b++]}}}else{b=o-_;do{T[o++]=T[b++];T[o++]=T[b++];T[o++]=T[b++];S-=3}while(S>2);if(S){T[o++]=T[b++];if(S>1){T[o++]=T[b++]}}}}else if((w&64)===0){P=m[(P&65535)+(d&(1<>3;i-=S;p-=S<<3;d&=(1<=1;h--){if(R[h]!==0){break}}if(d>h){d=h}if(h===0){r[o++]=1<<24|64<<16|0;r[o++]=1<<24|64<<16|0;a.bits=1;return 0}for(c=1;c0&&(e===W||h!==1)){return-1}D[1]=0;for(l=1;lL||e===B&&y>F){return 1}for(;;){E=l-v;if(s[f]T){q=x[I+s[f]];A=C[k+s[f]]}else{q=32+64;A=0}P=1<>v)+w]=E<<24|q<<16|A|0}while(w!==0);P=1<>=1}if(P!==0){g&=P-1;g+=P}else{g=0}f++;if(--R[l]===0){if(l===h){break}l=t[n+s[f]]}if(l>d&&(g&_)!==S){if(v===0){v=d}b+=c;p=l-v;m=1<L||e===B&&y>F){return 1}S=g&_;r[S]=d<<24|p<<16|b-o|0}}if(g!==0){r[b+g]=l-v<<24|64<<16|0}a.bits=d;return 0}},function(e,t,n){"use strict";function i(){this.text=0;this.time=0;this.xflags=0;this.os=0;this.extra=null;this.extra_len=0;this.name="";this.comment="";this.hcrc=0;this.done=false}e.exports=i},function(e,i,r){"use strict";(function(u){Object.defineProperty(i,"__esModule",{value:true});i.WebChannelRequest=undefined;var l=function(){function i(e,t){for(var n=0;n=0||e.indexOf(">")>=0||e.indexOf("<")>=0)};d=function(e){return""};t=function(e){return e.replace("]]>","]]]]>")};n.Builder=function(){function e(e){var t,n,i;this.options={};n=r["0.2"];for(t in n){if(!p.call(n,t))continue;i=n[t];this.options[t]=i}for(t in e){if(!p.call(e,t))continue;i=e[t];this.options[t]=i}}e.prototype.buildObject=function(e){var l,f,c,t,n;l=this.options.attrkey;f=this.options.charkey;if(Object.keys(e).length===1&&this.options.rootName===r["0.2"].rootName){n=Object.keys(e)[0];e=e[n]}else{n=this.options.rootName}c=function(u){return function(e,t){var n,i,r,o,s,a;if(typeof t!=="object"){if(u.options.cdata&&h(t)){e.raw(d(t))}else{e.txt(t)}}else if(Array.isArray(t)){for(o in t){if(!p.call(t,o))continue;i=t[o];for(s in i){r=i[s];e=c(e.ele(s),r).up()}}}else{for(s in t){if(!p.call(t,s))continue;i=t[s];if(s===l){if(typeof i==="object"){for(n in i){a=i[n];e=e.att(n,a)}}}else if(s===f){if(u.options.cdata&&h(i)){e=e.raw(d(i))}else{e=e.txt(i)}}else if(Array.isArray(i)){for(o in i){if(!p.call(i,o))continue;r=i[o];if(typeof r==="string"){if(u.options.cdata&&h(r)){e=e.ele(s).raw(d(r)).up()}else{e=e.ele(s,r).up()}}else{e=c(e.ele(s),r).up()}}}else if(typeof i==="object"){e=c(e.ele(s),i).up()}else{if(typeof i==="string"&&u.options.cdata&&h(i)){e=e.ele(s).raw(d(i)).up()}else{if(i==null){i=""}e=e.ele(s,i.toString()).up()}}}}return e}}(this);t=i.create(n,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return c(t,e).end(this.options.renderOpts)};return e}()}).call(this)},function(f,e,c){(function(){var e,t,n,s,r,i,o,a,u,l;l=c(3),a=l.assign,u=l.isFunction;n=c(46);s=c(47);r=c(96);o=c(33);i=c(97);e=c(0);t=c(12);f.exports.create=function(e,t,n,i){var r,o;if(e==null){throw new Error("Root element needs a name.")}i=a({},t,n,i);r=new s(i);o=r.element(e);if(!i.headless){r.declaration(i);if(i.pubID!=null||i.sysID!=null){r.dtd(i)}}return o};f.exports.begin=function(e,t,n){var i;if(u(e)){i=[e,t],t=i[0],n=i[1];e={}}if(t){return new r(e,t,n)}else{return new s(e)}};f.exports.stringWriter=function(e){return new o(e)};f.exports.streamWriter=function(e,t){return new i(e,t)};f.exports.implementation=new n;f.exports.nodeType=e;f.exports.writerState=t}).call(this)},function(i,e,r){(function(){var e,t,n;t=r(92);n=r(93);i.exports=e=function(){function e(){var e;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new t,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=e=Object.create(this.defaultParams)}Object.defineProperty(e.prototype,"parameterNames",{get:function(){return new n(Object.keys(this.defaultParams))}});e.prototype.getParameter=function(e){if(this.params.hasOwnProperty(e)){return this.params[e]}else{return null}};e.prototype.canSetParameter=function(e,t){return true};e.prototype.setParameter=function(e,t){if(t!=null){return this.params[e]=t}else{return delete this.params[e]}};return e}()}).call(this)},function(t,e){(function(){var e;t.exports=e=function(){function e(){}e.prototype.handleError=function(e){throw new Error(e)};return e}()}).call(this)},function(t,e){(function(){var e;t.exports=e=function(){function e(e){this.arr=e||[]}Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length}});e.prototype.item=function(e){return this.arr[e]||null};e.prototype.contains=function(e){return this.arr.indexOf(e)!==-1};return e}()}).call(this)},function(t,e){(function(){var e;t.exports=e=function(){function e(e){this.nodes=e}Object.defineProperty(e.prototype,"length",{get:function(){return this.nodes.length||0}});e.prototype.clone=function(){return this.nodes=null};e.prototype.item=function(e){return this.nodes[e]||null};return e}()}).call(this)},function(e,t){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},function(k,e,T){(function(){var l,o,r,n,i,s,a,u,f,c,h,d,e,p,v,m,y,g,P,w,S,_,b,t,C={}.hasOwnProperty;t=T(3),_=t.isObject,S=t.isFunction,b=t.isPlainObject,w=t.getValue;l=T(0);d=T(47);p=T(20);n=T(22);i=T(23);m=T(30);P=T(31);v=T(32);c=T(24);h=T(25);s=T(26);u=T(27);a=T(28);f=T(29);r=T(48);g=T(50);y=T(33);o=T(12);k.exports=e=function(){function e(e,t,n){var i;this.name="?xml";this.type=l.Document;e||(e={});i={};if(!e.writer){e.writer=new y}else if(b(e.writer)){i=e.writer;e.writer=new y}this.options=e;this.writer=e.writer;this.writerOptions=this.writer.filterOptions(i);this.stringify=new g(e);this.onDataCallback=t||function(){};this.onEndCallback=n||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}e.prototype.createChildNode=function(e){var t,n,i,r,o,s,a,u;switch(e.type){case l.CData:this.cdata(e.value);break;case l.Comment:this.comment(e.value);break;case l.Element:i={};a=e.attribs;for(n in a){if(!C.call(a,n))continue;t=a[n];i[n]=t.value}this.node(e.name,i);break;case l.Dummy:this.dummy();break;case l.Raw:this.raw(e.value);break;case l.Text:this.text(e.value);break;case l.ProcessingInstruction:this.instruction(e.target,e.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+e.constructor.name)}u=e.children;for(o=0,s=u.length;o=0){this.up()}return this.onEnd()};e.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};e.prototype.openNode=function(e){var t,n,i,r;if(!e.isOpen){if(!this.root&&this.currentLevel===0&&e.type===l.Element){this.root=e}n="";if(e.type===l.Element){this.writerOptions.state=o.OpenTag;n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name;r=e.attribs;for(i in r){if(!C.call(r,i))continue;t=r[i];n+=this.writer.attribute(t,this.writerOptions,this.currentLevel)}n+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel);this.writerOptions.state=o.InsideTag}else{this.writerOptions.state=o.OpenTag;n=this.writer.indent(e,this.writerOptions,this.currentLevel)+""}n+=this.writer.endline(e,this.writerOptions,this.currentLevel)}this.onData(n,this.currentLevel);return e.isOpen=true}};e.prototype.closeNode=function(e){var t;if(!e.isClosed){t="";this.writerOptions.state=o.CloseTag;if(e.type===l.Element){t=this.writer.indent(e,this.writerOptions,this.currentLevel)+""+this.writer.endline(e,this.writerOptions,this.currentLevel)}else{t=this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel)}this.writerOptions.state=o.None;this.onData(t,this.currentLevel);return e.isClosed=true}};e.prototype.onData=function(e,t){this.documentStarted=true;return this.onDataCallback(e,t+1)};e.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};e.prototype.debugInfo=function(e){if(e==null){return""}else{return"node: <"+e+">"}};e.prototype.ele=function(){return this.element.apply(this,arguments)};e.prototype.nod=function(e,t,n){return this.node(e,t,n)};e.prototype.txt=function(e){return this.text(e)};e.prototype.dat=function(e){return this.cdata(e)};e.prototype.com=function(e){return this.comment(e)};e.prototype.ins=function(e,t){return this.instruction(e,t)};e.prototype.dec=function(e,t,n){return this.declaration(e,t,n)};e.prototype.dtd=function(e,t,n){return this.doctype(e,t,n)};e.prototype.e=function(e,t,n){return this.element(e,t,n)};e.prototype.n=function(e,t,n){return this.node(e,t,n)};e.prototype.t=function(e){return this.text(e)};e.prototype.d=function(e){return this.cdata(e)};e.prototype.c=function(e){return this.comment(e)};e.prototype.r=function(e){return this.raw(e)};e.prototype.i=function(e,t){return this.instruction(e,t)};e.prototype.att=function(){if(this.currentNode&&this.currentNode.type===l.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};e.prototype.a=function(){if(this.currentNode&&this.currentNode.type===l.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};e.prototype.ent=function(e,t){return this.entity(e,t)};e.prototype.pent=function(e,t){return this.pEntity(e,t)};e.prototype.not=function(e,t){return this.notation(e,t)};return e}()}).call(this)},function(i,e,r){(function(){var d,p,e,t,n=function(e,t){for(var n in t){if(v.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},v={}.hasOwnProperty;d=r(0);t=r(51);p=r(12);i.exports=e=function(e){n(i,e);function i(e,t){this.stream=e;i.__super__.constructor.call(this,t)}i.prototype.endline=function(e,t,n){if(e.isLastRootNode&&t.state===p.CloseTag){return""}else{return i.__super__.endline.call(this,e,t,n)}};i.prototype.document=function(e,t){var n,i,r,o,s,a,u,l,f;u=e.children;for(i=r=0,s=u.length;r0){this.stream.write(" [");this.stream.write(this.endline(e,t,n));t.state=p.InsideTag;s=e.children;for(r=0,o=s.length;r");this.stream.write(this.endline(e,t,n));t.state=p.None;return this.closeNode(e,t,n)};i.prototype.element=function(e,t,n){var i,r,o,s,a,u,l,f,c,h;n||(n=0);this.openNode(e,t,n);t.state=p.OpenTag;this.stream.write(this.indent(e,t,n)+"<"+e.name);c=e.attribs;for(l in c){if(!v.call(c,l))continue;i=c[l];this.attribute(i,t,n)}o=e.children.length;s=o===0?null:e.children[0];if(o===0||e.children.every(function(e){return(e.type===d.Text||e.type===d.Raw)&&e.value===""})){if(t.allowEmpty){this.stream.write(">");t.state=p.CloseTag;this.stream.write("")}else{t.state=p.CloseTag;this.stream.write(t.spaceBeforeSlash+"/>")}}else if(t.pretty&&o===1&&(s.type===d.Text||s.type===d.Raw)&&s.value!=null){this.stream.write(">");t.state=p.InsideTag;t.suppressPrettyCount++;f=true;this.writeChildNode(s,t,n+1);t.suppressPrettyCount--;f=false;t.state=p.CloseTag;this.stream.write("")}else{this.stream.write(">"+this.endline(e,t,n));t.state=p.InsideTag;h=e.children;for(a=0,u=h.length;a")}this.stream.write(this.endline(e,t,n));t.state=p.None;return this.closeNode(e,t,n)};i.prototype.processingInstruction=function(e,t,n){return this.stream.write(i.__super__.processingInstruction.call(this,e,t,n))};i.prototype.raw=function(e,t,n){return this.stream.write(i.__super__.raw.call(this,e,t,n))};i.prototype.text=function(e,t,n){return this.stream.write(i.__super__.text.call(this,e,t,n))};i.prototype.dtdAttList=function(e,t,n){return this.stream.write(i.__super__.dtdAttList.call(this,e,t,n))};i.prototype.dtdElement=function(e,t,n){return this.stream.write(i.__super__.dtdElement.call(this,e,t,n))};i.prototype.dtdEntity=function(e,t,n){return this.stream.write(i.__super__.dtdEntity.call(this,e,t,n))};i.prototype.dtdNotation=function(e,t,n){return this.stream.write(i.__super__.dtdNotation.call(this,e,t,n))};return i}(t)}).call(this)},function(e,l,t){(function(){"use strict";var r,o,e,d,p,s,i,a,u=function(e,t){return function(){return e.apply(t,arguments)}},n=function(e,t){for(var n in t){if(v.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},v={}.hasOwnProperty;i=t(99);e=t(13);r=t(113);s=t(58);a=t(56).setImmediate;o=t(19).defaults;d=function(e){return typeof e==="object"&&e!=null&&Object.keys(e).length===0};p=function(e,t,n){var i,r,o;for(i=0,r=e.length;i0){i[f.options.childkey]=o}o=i}else if(u){u[f.options.childkey]=u[f.options.childkey]||[];s={};for(n in o){if(!v.call(o,n))continue;s[n]=o[n]}u[f.options.childkey].push(s);delete o["#name"];if(Object.keys(o).length===1&&c in o&&!f.EXPLICIT_CHARKEY){o=o[c]}}}if(h.length>0){return f.assignOrPush(u,r,o)}else{if(f.options.explicitRoot){a=o;o={};o[r]=a}f.resultObject=o;f.saxParser.ended=true;return f.emit("end",f.resultObject)}}}(this);n=function(i){return function(e){var t,n;n=h[h.length-1];if(n){n[c]+=e;if(i.options.explicitChildren&&i.options.preserveChildrenOrder&&i.options.charsAsChildren&&(i.options.includeWhiteChars||e.replace(/\\n/g,"").trim()!=="")){n[i.options.childkey]=n[i.options.childkey]||[];t={"#name":"__text__"};t[c]=e;if(i.options.normalize){t[c]=t[c].replace(/\s{2,}/g," ").trim()}n[i.options.childkey].push(t)}return n}}}(this);this.saxParser.ontext=n;return this.saxParser.oncdata=function(e){return function(e){var t;t=n(e);if(t){return t.cdata=true}}}(this)};t.prototype.parseString=function(e,t){var n;if(t!=null&&typeof t==="function"){this.on("end",function(e){this.reset();return t(null,e)});this.on("error",function(e){this.reset();return t(e)})}try{e=e.toString();if(e.trim()===""){this.emit("end",null);return true}e=r.stripBOM(e);if(this.options["async"]){this.remaining=e;a(this.processAsync);return this.saxParser}return this.saxParser.write(e).close()}catch(i){n=i;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",n);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw n}}};t.prototype.parseStringPromise=function(t){return new Promise(function(e){return function(n,i){return e.parseString(t,function(e,t){if(e){return i(e)}else{return n(t)}})}}(this))};return t}(e);l.parseString=function(e,t,n){var i,r,o;if(n!=null){if(typeof n==="function"){i=n}if(typeof t==="object"){r=t}}else{if(typeof t==="function"){i=t}r={}}o=new l.Parser(r);return o.parseString(e,i)};l.parseStringPromise=function(e,t){var n,i;if(typeof t==="object"){n=t}i=new l.Parser(n);return i.parseStringPromise(e)}}).call(this)},function(e,t,U){(function(H){(function(a){a.parser=function(e,t){return new i(e,t)};a.SAXParser=i;a.SAXStream=f;a.createStream=t;a.MAX_BUFFER_LENGTH=64*1024;var u=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];a.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function i(e,t){if(!(this instanceof i)){return new i(e,t)}var n=this;r(n);n.q=n.c="";n.bufferCheckPosition=a.MAX_BUFFER_LENGTH;n.opt=t||{};n.opt.lowercase=n.opt.lowercase||n.opt.lowercasetags;n.looseCase=n.opt.lowercase?"toLowerCase":"toUpperCase";n.tags=[];n.closed=n.closedRoot=n.sawRoot=false;n.tag=n.error=null;n.strict=!!e;n.noscript=!!(e||n.opt.noscript);n.state=S.BEGIN;n.strictEntities=n.opt.strictEntities;n.ENTITIES=n.strictEntities?Object.create(a.XML_ENTITIES):Object.create(a.ENTITIES);n.attribList=[];if(n.opt.xmlns){n.ns=Object.create(v)}n.trackPosition=n.opt.position!==false;if(n.trackPosition){n.position=n.line=n.column=0}_(n,"onready")}if(!Object.create){Object.create=function(e){function t(){}t.prototype=e;var n=new t;return n}}if(!Object.keys){Object.keys=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n))t.push(n);return t}}function l(e){var t=Math.max(a.MAX_BUFFER_LENGTH,10);var n=0;for(var i=0,r=u.length;it){switch(u[i]){case"textNode":C(e);break;case"cdata":b(e,"oncdata",e.cdata);e.cdata="";break;case"script":b(e,"onscript",e.script);e.script="";break;default:T(e,"Max buffer length exceeded: "+u[i])}}n=Math.max(n,o)}var s=a.MAX_BUFFER_LENGTH-n;e.bufferCheckPosition=s+e.position}function r(e){for(var t=0,n=u.length;t"||g(e)}function w(e,t){return e.test(t)}function N(e,t){return!w(e,t)}var S=0;a.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++};a.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};a.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(a.ENTITIES).forEach(function(e){var t=a.ENTITIES[e];var n=typeof t==="number"?String.fromCharCode(t):t;a.ENTITIES[e]=n});for(var n in a.STATE){a.STATE[a.STATE[n]]=n}S=a.STATE;function _(e,t,n){e[t]&&e[t](n)}function b(e,t,n){if(e.textNode)C(e);_(e,t,n)}function C(e){e.textNode=k(e.opt,e.textNode);if(e.textNode)_(e,"ontext",e.textNode);e.textNode=""}function k(e,t){if(e.trim)t=t.trim();if(e.normalize)t=t.replace(/\s+/g," ");return t}function T(e,t){C(e);if(e.trackPosition){t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c}t=new Error(t);e.error=t;_(e,"onerror",t);return e}function R(e){if(e.sawRoot&&!e.closedRoot)D(e,"Unclosed root tag");if(e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT){T(e,"Unexpected end")}C(e);e.c="";e.closed=true;_(e,"onend");i.call(e,e.strict,e.opt);return e}function D(e,t){if(typeof e!=="object"||!(e instanceof i)){throw new Error("bad call to strictFail")}if(e.strict){T(e,t)}}function B(e){if(!e.strict)e.tagName=e.tagName[e.looseCase]();var t=e.tags[e.tags.length-1]||e;var n=e.tag={name:e.tagName,attributes:{}};if(e.opt.xmlns){n.ns=t.ns}e.attribList.length=0;b(e,"onopentagstart",n)}function x(e,t){var n=e.indexOf(":");var i=n<0?["",e]:e.split(":");var r=i[0];var o=i[1];if(t&&e==="xmlns"){r="xmlns";o=""}return{prefix:r,local:o}}function I(e){if(!e.strict){e.attribName=e.attribName[e.looseCase]()}if(e.attribList.indexOf(e.attribName)!==-1||e.tag.attributes.hasOwnProperty(e.attribName)){e.attribName=e.attribValue="";return}if(e.opt.xmlns){var t=x(e.attribName,true);var n=t.prefix;var i=t.local;if(n==="xmlns"){if(i==="xml"&&e.attribValue!==d){D(e,"xml: prefix must be bound to "+d+"\n"+"Actual: "+e.attribValue)}else if(i==="xmlns"&&e.attribValue!==p){D(e,"xmlns: prefix must be bound to "+p+"\n"+"Actual: "+e.attribValue)}else{var r=e.tag;var o=e.tags[e.tags.length-1]||e;if(r.ns===o.ns){r.ns=Object.create(o.ns)}r.ns[i]=e.attribValue}}e.attribList.push([e.attribName,e.attribValue])}else{e.tag.attributes[e.attribName]=e.attribValue;b(e,"onattribute",{name:e.attribName,value:e.attribValue})}e.attribName=e.attribValue=""}function E(t,e){if(t.opt.xmlns){var n=t.tag;var i=x(t.tagName);n.prefix=i.prefix;n.local=i.local;n.uri=n.ns[i.prefix]||"";if(n.prefix&&!n.uri){D(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName));n.uri=i.prefix}var r=t.tags[t.tags.length-1]||t;if(n.ns&&r.ns!==n.ns){Object.keys(n.ns).forEach(function(e){b(t,"onopennamespace",{prefix:e,uri:n.ns[e]})})}for(var o=0,s=t.attribList.length;o";n.tagName="";n.state=S.SCRIPT;return}b(n,"onscript",n.script);n.script=""}var e=n.tags.length;var t=n.tagName;if(!n.strict){t=t[n.looseCase]()}var i=t;while(e--){var r=n.tags[e];if(r.name!==i){D(n,"Unexpected close tag")}else{break}}if(e<0){D(n,"Unmatched closing tag: "+n.tagName);n.textNode+="";n.state=S.TEXT;return}n.tagName=t;var o=n.tags.length;while(o-- >e){var s=n.tag=n.tags.pop();n.tagName=n.tag.name;b(n,"onclosetag",n.tagName);var a={};for(var u in s.ns){a[u]=s.ns[u]}var l=n.tags[n.tags.length-1]||n;if(n.opt.xmlns&&s.ns!==l.ns){Object.keys(s.ns).forEach(function(e){var t=s.ns[e];b(n,"onclosenamespace",{prefix:e,uri:t})})}}if(e===0)n.closedRoot=true;n.tagName=n.attribValue=n.attribName="";n.attribList.length=0;n.state=S.TEXT}function z(e){var t=e.entity;var n=t.toLowerCase();var i;var r="";if(e.ENTITIES[t]){return e.ENTITIES[t]}if(e.ENTITIES[n]){return e.ENTITIES[n]}t=n;if(t.charAt(0)==="#"){if(t.charAt(1)==="x"){t=t.slice(2);i=parseInt(t,16);r=i.toString(16)}else{t=t.slice(1);i=parseInt(t,10);r=i.toString(10)}}t=t.replace(/^0+/,"");if(isNaN(i)||r.toLowerCase()!==t){D(e,"Invalid character entity");return"&"+e.entity+";"}return String.fromCodePoint(i)}function A(e,t){if(t==="<"){e.state=S.OPEN_WAKA;e.startTagPosition=e.position}else if(!g(t)){D(e,"Non-whitespace before first tag.");e.textNode=t;e.state=S.TEXT}}function O(e,t){var n="";if(t"){b(t,"onsgmldeclaration",t.sgmlDecl);t.sgmlDecl="";t.state=S.TEXT}else if(P(i)){t.state=S.SGML_DECL_QUOTED;t.sgmlDecl+=i}else{t.sgmlDecl+=i}continue;case S.SGML_DECL_QUOTED:if(i===t.q){t.state=S.SGML_DECL;t.q=""}t.sgmlDecl+=i;continue;case S.DOCTYPE:if(i===">"){t.state=S.TEXT;b(t,"ondoctype",t.doctype);t.doctype=true}else{t.doctype+=i;if(i==="["){t.state=S.DOCTYPE_DTD}else if(P(i)){t.state=S.DOCTYPE_QUOTED;t.q=i}}continue;case S.DOCTYPE_QUOTED:t.doctype+=i;if(i===t.q){t.q="";t.state=S.DOCTYPE}continue;case S.DOCTYPE_DTD:t.doctype+=i;if(i==="]"){t.state=S.DOCTYPE}else if(P(i)){t.state=S.DOCTYPE_DTD_QUOTED;t.q=i}continue;case S.DOCTYPE_DTD_QUOTED:t.doctype+=i;if(i===t.q){t.state=S.DOCTYPE_DTD;t.q=""}continue;case S.COMMENT:if(i==="-"){t.state=S.COMMENT_ENDING}else{t.comment+=i}continue;case S.COMMENT_ENDING:if(i==="-"){t.state=S.COMMENT_ENDED;t.comment=k(t.opt,t.comment);if(t.comment){b(t,"oncomment",t.comment)}t.comment=""}else{t.comment+="-"+i;t.state=S.COMMENT}continue;case S.COMMENT_ENDED:if(i!==">"){D(t,"Malformed comment");t.comment+="--"+i;t.state=S.COMMENT}else{t.state=S.TEXT}continue;case S.CDATA:if(i==="]"){t.state=S.CDATA_ENDING}else{t.cdata+=i}continue;case S.CDATA_ENDING:if(i==="]"){t.state=S.CDATA_ENDING_2}else{t.cdata+="]"+i;t.state=S.CDATA}continue;case S.CDATA_ENDING_2:if(i===">"){if(t.cdata){b(t,"oncdata",t.cdata)}b(t,"onclosecdata");t.cdata="";t.state=S.TEXT}else if(i==="]"){t.cdata+="]"}else{t.cdata+="]]"+i;t.state=S.CDATA}continue;case S.PROC_INST:if(i==="?"){t.state=S.PROC_INST_ENDING}else if(g(i)){t.state=S.PROC_INST_BODY}else{t.procInstName+=i}continue;case S.PROC_INST_BODY:if(!t.procInstBody&&g(i)){continue}else if(i==="?"){t.state=S.PROC_INST_ENDING}else{t.procInstBody+=i}continue;case S.PROC_INST_ENDING:if(i===">"){b(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody});t.procInstName=t.procInstBody="";t.state=S.TEXT}else{t.procInstBody+="?"+i;t.state=S.PROC_INST_BODY}continue;case S.OPEN_TAG:if(w(y,i)){t.tagName+=i}else{B(t);if(i===">"){E(t)}else if(i==="/"){t.state=S.OPEN_TAG_SLASH}else{if(!g(i)){D(t,"Invalid character in tag name")}t.state=S.ATTRIB}}continue;case S.OPEN_TAG_SLASH:if(i===">"){E(t,true);q(t)}else{D(t,"Forward-slash in opening tag not followed by >");t.state=S.ATTRIB}continue;case S.ATTRIB:if(g(i)){continue}else if(i===">"){E(t)}else if(i==="/"){t.state=S.OPEN_TAG_SLASH}else if(w(m,i)){t.attribName=i;t.attribValue="";t.state=S.ATTRIB_NAME}else{D(t,"Invalid attribute name")}continue;case S.ATTRIB_NAME:if(i==="="){t.state=S.ATTRIB_VALUE}else if(i===">"){D(t,"Attribute without value");t.attribValue=t.attribName;I(t);E(t)}else if(g(i)){t.state=S.ATTRIB_NAME_SAW_WHITE}else if(w(y,i)){t.attribName+=i}else{D(t,"Invalid attribute name")}continue;case S.ATTRIB_NAME_SAW_WHITE:if(i==="="){t.state=S.ATTRIB_VALUE}else if(g(i)){continue}else{D(t,"Attribute without value");t.tag.attributes[t.attribName]="";t.attribValue="";b(t,"onattribute",{name:t.attribName,value:""});t.attribName="";if(i===">"){E(t)}else if(w(m,i)){t.attribName=i;t.state=S.ATTRIB_NAME}else{D(t,"Invalid attribute name");t.state=S.ATTRIB}}continue;case S.ATTRIB_VALUE:if(g(i)){continue}else if(P(i)){t.q=i;t.state=S.ATTRIB_VALUE_QUOTED}else{D(t,"Unquoted attribute value");t.state=S.ATTRIB_VALUE_UNQUOTED;t.attribValue=i}continue;case S.ATTRIB_VALUE_QUOTED:if(i!==t.q){if(i==="&"){t.state=S.ATTRIB_VALUE_ENTITY_Q}else{t.attribValue+=i}continue}I(t);t.q="";t.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:if(g(i)){t.state=S.ATTRIB}else if(i===">"){E(t)}else if(i==="/"){t.state=S.OPEN_TAG_SLASH}else if(w(m,i)){D(t,"No whitespace between attributes");t.attribName=i;t.attribValue="";t.state=S.ATTRIB_NAME}else{D(t,"Invalid attribute name")}continue;case S.ATTRIB_VALUE_UNQUOTED:if(!W(i)){if(i==="&"){t.state=S.ATTRIB_VALUE_ENTITY_U}else{t.attribValue+=i}continue}I(t);if(i===">"){E(t)}else{t.state=S.ATTRIB}continue;case S.CLOSE_TAG:if(!t.tagName){if(g(i)){continue}else if(N(m,i)){if(t.script){t.script+=""){q(t)}else if(w(y,i)){t.tagName+=i}else if(t.script){t.script+=""){q(t)}else{D(t,"Invalid characters in closing tag")}continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var s;var a;switch(t.state){case S.TEXT_ENTITY:s=S.TEXT;a="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:s=S.ATTRIB_VALUE_QUOTED;a="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:s=S.ATTRIB_VALUE_UNQUOTED;a="attribValue";break}if(i===";"){t[a]+=z(t);t.entity="";t.state=s}else if(w(t.entity.length?F:L,i)){t.entity+=i}else{D(t,"Invalid character in entity name");t[a]+="&"+t.entity+i;t.entity="";t.state=s}continue;default:throw new Error(t,"Unknown state: "+t.state)}}if(t.position>=t.bufferCheckPosition){l(t)}return t} /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var u=String.fromCharCode;var l=Math.floor;var e=function(){var e=16384;var t=[];var n;var i;var r=-1;var o=arguments.length;if(!o){return""}var s="";while(++r1114111||l(a)!==a){throw RangeError("Invalid code point: "+a)}if(a<=65535){t.push(a)}else{a-=65536;n=(a>>10)+55296;i=a%1024+56320;t.push(n,i)}if(r+1===o||t.length>e){s+=u.apply(null,t);t.length=0}}return s};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:e,configurable:true,writable:true})}else{String.fromCodePoint=e}})()}})(false?undefined:t)}).call(this,U(34).Buffer)},function(e,t,n){"use strict";t.byteLength=s;t.toByteArray=a;t.fromByteArray=v;var u=[];var l=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var r=0,o=i.length;r0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=e.indexOf("=");if(n===-1)n=t;var i=n===t?0:4-n%4;return[n,i]}function s(e){var t=c(e);var n=t[0];var i=t[1];return(n+i)*3/4-i}function h(e,t,n){return(t+n)*3/4-n}function a(e){var t;var n=c(e);var i=n[0];var r=n[1];var o=new f(h(e,i,r));var s=0;var a=r>0?i-4:i;var u;for(u=0;u>16&255;o[s++]=t>>8&255;o[s++]=t&255}if(r===2){t=l[e.charCodeAt(u)]<<2|l[e.charCodeAt(u+1)]>>4;o[s++]=t&255}if(r===1){t=l[e.charCodeAt(u)]<<10|l[e.charCodeAt(u+1)]<<4|l[e.charCodeAt(u+2)]>>2;o[s++]=t>>8&255;o[s++]=t&255}return o}function d(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[e&63]}function p(e,t,n){var i;var r=[];for(var o=t;oa?a:s+o))}if(i===1){t=e[n-1];r.push(u[t>>2]+u[t<<4&63]+"==")}else if(i===2){t=(e[n-2]<<8)+e[n-1];r.push(u[t>>10]+u[t>>4&63]+u[t<<2&63]+"=")}return r.join("")}},function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -t.read=function(e,t,n,i,r){var o,s;var a=r*8-i-1;var u=(1<>1;var f=-7;var c=n?r-1:0;var h=n?-1:1;var d=e[t+c];c+=h;o=d&(1<<-f)-1;d>>=-f;f+=a;for(;f>0;o=o*256+e[t+c],c+=h,f-=8){}s=o&(1<<-f)-1;o>>=-f;f+=i;for(;f>0;s=s*256+e[t+c],c+=h,f-=8){}if(o===0){o=1-l}else if(o===u){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);o=o-l}return(d?-1:1)*s*Math.pow(2,o-i)};t.write=function(e,t,n,i,r,o){var s,a,u;var l=o*8-r-1;var f=(1<>1;var h=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:o-1;var p=i?1:-1;var v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){a=isNaN(t)?1:0;s=f}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-s))<1){s--;u*=2}if(s+c>=1){t+=h/u}else{t+=h*Math.pow(2,1-c)}if(t*u>=2){s++;u/=2}if(s+c>=f){a=0;s=f}else if(s+c>=1){a=(t*u-1)*Math.pow(2,r);s=s+c}else{a=t*Math.pow(2,c-1)*Math.pow(2,r);s=0}}for(;r>=8;e[n+d]=a&255,d+=p,a/=256,r-=8){}s=s<0;e[n+d]=s&255,d+=p,s/=256,l-=8){}e[n+d-p]|=v*128}},function(e,t,n){e.exports=r;var f=n(13).EventEmitter;var i=n(7);i(r,f);r.Readable=n(35);r.Writable=n(109);r.Duplex=n(110);r.Transform=n(111);r.PassThrough=n(112);r.Stream=r;function r(){f.call(this)}r.prototype.pipe=function(t,e){var n=this;function i(e){if(t.writable){if(false===t.write(e)&&n.pause){n.pause()}}}n.on("data",i);function r(){if(n.readable&&n.resume){n.resume()}}t.on("drain",r);if(!t._isStdio&&(!e||e.end!==false)){n.on("end",s);n.on("close",a)}var o=false;function s(){if(o)return;o=true;t.end()}function a(){if(o)return;o=true;if(typeof t.destroy==="function")t.destroy()}function u(e){l();if(f.listenerCount(this,"error")===0){throw e}}n.on("error",u);t.on("error",u);function l(){n.removeListener("data",i);t.removeListener("drain",r);n.removeListener("end",s);n.removeListener("close",a);n.removeListener("error",u);t.removeListener("error",u);n.removeListener("end",l);n.removeListener("close",l);t.removeListener("close",l)}n.on("end",l);n.on("close",l);t.on("close",l);t.emit("pipe",n);return t}},function(e,t){},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=n(16).Buffer;var i=n(105);function l(e,t,n){e.copy(t,n)}e.exports=function(){function e(){a(this,e);this.head=null;this.tail=null;this.length=0}e.prototype.push=function n(e){var t={data:e,next:null};if(this.length>0)this.tail.next=t;else this.head=t;this.tail=t;++this.length};e.prototype.unshift=function i(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length};e.prototype.shift=function t(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e};e.prototype.clear=function r(){this.head=this.tail=null;this.length=0};e.prototype.join=function o(e){if(this.length===0)return"";var t=this.head;var n=""+t.data;while(t=t.next){n+=e+t.data}return n};e.prototype.concat=function s(e){if(this.length===0)return u.alloc(0);if(this.length===1)return this.head.data;var t=u.allocUnsafe(e>>>0);var n=this.head;var i=0;while(n){l(n.data,t,i);i+=n.data.length;n=n.next}return t};return e}();if(i&&i.inspect&&i.inspect.custom){e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e}}},function(e,t){},function(e,t,n){(function(e,g){(function(n,i){"use strict";if(n.setImmediate){return}var r=1;var o={};var s=false;var a=n.document;var u;function e(e){if(typeof e!=="function"){e=new Function(""+e)}var t=new Array(arguments.length-1);for(var n=0;n"}this.oOptions.oId.html(""+this.szColorParam+"");this.oPlugin=this.oOptions.oId.find("#"+this.oOptions.szId+"_multiVideoActiveX")[0];if(this.oPlugin===null||typeof this.oPlugin==="undefined"){this.oPlugin=null}else if(this.oPlugin.object===null||typeof this.oPlugin.object==="undefined"){this.oPlugin=null}this.fCurrentCallback=null;this.afCurrentCallback=[];this.fPointCallback=null;this.iProtocolType=0;this.oPluginCallback={};this.szPluginVersion="V3.0.6.46";this.ConsoleLog=function(e){var t=sessionStorage.getItem("bDebugMode");if(t){console.log(e)}}}Ht(i,[{key:"JS_CreateWnd",value:function o(e,t,n){var i=this;var r=zt.Deferred();setTimeout(function(){i.oOptions.oId.html(""+this.szColorParam+"");i.oPlugin=i.oOptions.oId.find("#"+i.oOptions.szId+"_multiVideoActiveX")[0];if(i.oPlugin===null||i.oPlugin.object===null){i.oPlugin=null}r.resolve()},100);return r.promise()}},{key:"JS_ShowWnd",value:function n(){var e=this;var t=zt.Deferred();setTimeout(function(){zt("#"+e.oOptions.szId+"_multiVideoActiveX").show();t.resolve()},100);return t.promise()}},{key:"JS_HideWnd",value:function r(){var e=this;var t=zt.Deferred();setTimeout(function(){zt("#"+e.oOptions.szId+"_multiVideoActiveX").hide();t.resolve()},100);return t.promise()}},{key:"JS_SetWndCover",value:function t(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetWindowControlCallback",value:function s(e){var f=this;var t=f.oOptions.szIframeId&&zt("#"+f.oOptions.szIframeId).length?zt("#"+f.oOptions.szIframeId)[0].contentWindow:window;zt.extend(this.oPluginCallback,e);t.GetSelectWndInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("SelectWnd").eq(0).text(),10);if(0<=n){f.fCurrentCallback=f.afCurrentCallback[n]}if(f.oPluginCallback.onGetSelectWndInfo){f.oPluginCallback.onGetSelectWndInfo(n)}};t.PluginEventHandler=function(e,t,n){if(e===69){var i=f.oPlugin.HWP_GetDrawLineInfo(t);var r=Ut.oUtils.parseXmlFromStr(i);var o=[];zt(r).find("RegionCoordinates").each(function(){var e=parseFloat(zt(this).find("positionX").text());var t=1-parseFloat(zt(this).find("positionY").text());o.push([e,t])});var s="Line";if(o.length>3){s="Polygon"}if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:s,points:o})}}else if(e===14){f.oPluginCallback.onPluginEventHandler&&f.oPluginCallback.onPluginEventHandler(e,t)}else if(e===67){f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:"Line",event:"choosed"})}else if(e===68){var a="Polygon";if(0===parseInt(n,10)){a="Rect"}f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:a,event:"choosed"})}else if(e===70){var u="Polygon";if(0===parseInt(n,10)){u="Rect"}f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:u,event:"drawEnd"})}else{f.oPluginCallback.onPluginEventHandler&&f.oPluginCallback.onPluginEventHandler(t,e)}};t.ZoomInfoCallback=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=0;var r=0;var o=0;var s=0;i=parseInt(zt(t).find("StartPoint").eq(0).find("positionX").eq(0).text(),10)/255;r=parseInt(zt(t).find("StartPoint").eq(0).find("positionY").eq(0).text(),10)/255;o=parseInt(zt(t).find("EndPoint").eq(0).find("positionX").eq(0).text(),10)/255;s=parseInt(zt(t).find("EndPoint").eq(0).find("positionY").eq(0).text(),10)/255;n=[[i,r],[o,r],[o,s],[i,s]];if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:"Rect",points:n},e)}};t.EZoomInfoCallback=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=0;var r=0;var o=0;var s=0;i=parseInt(zt(t).find("StartPoint").eq(0).find("positionX").eq(0).text(),10)/255;r=parseInt(zt(t).find("StartPoint").eq(0).find("positionY").eq(0).text(),10)/255;o=parseInt(zt(t).find("EndPoint").eq(0).find("positionX").eq(0).text(),10)/255;s=parseInt(zt(t).find("EndPoint").eq(0).find("positionY").eq(0).text(),10)/255;n=[[i,r],[o,r],[o,s],[i,s]];if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:"Rect",points:n},e)}};t.GetFishPTZInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("infoType").eq(0).text(),10);var i=parseInt(zt(t).find("WndType").eq(0).text(),10);var r=zt(t).find("id").eq(0).text();var o=[parseFloat(zt(t).find("posX").eq(0).text()),parseFloat(zt(t).find("posY").eq(0).text())];var s=[parseFloat(zt(t).find("pos2X").eq(0).text()),parseFloat(zt(t).find("pos2Y").eq(0).text())];var a=parseInt(zt(t).find("pointSequence").eq(0).text(),10);var u=parseInt(zt(t).find("tracSequence").eq(0).text(),10);var l={type:n,windowType:i,id:r,position:o,originPosition:s,pointId:a,traceId:u};if(f.oPluginCallback.onFisheyePTZInfo){f.oPluginCallback.onFisheyePTZInfo(l)}};t.KeyBoardEvent=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("keyCode").eq(0).text(),10);if(n===27){if(f.oPluginCallback.onFullScreenChange){f.oPluginCallback.onFullScreenChange(false)}}};t.MouseEvent=function(e,t){var n=Ut.oUtils.parseXmlFromStr(e);var i=parseInt(zt(n).find("WndIndex").eq(0).text(),10);var r=parseInt(zt(n).find("EventType").eq(0).text(),10);var o=parseFloat(zt(n).find("Position").eq(0).find("x").eq(0).text());var s=parseFloat(zt(n).find("Position").eq(0).find("y").eq(0).text());if(f.oPluginCallback.onMouseEvent){f.oPluginCallback.onMouseEvent({wndIndex:i,eventType:r,point:[o,s],pluginID:t})}if(f.fPointCallback&&r===1){f.fPointCallback({id:1,eventType:r,point:[o,s]})}};t.SetZeroChanEnlarge=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("BeState").eq(0).text(),10);var i=parseInt(zt(t).find("MCP_x").eq(0).text(),10);var r=parseInt(zt(t).find("MCP_y").eq(0).text(),10);if(f.oPluginCallback.onZeroEnlargeState){f.oPluginCallback.onZeroEnlargeState({state:n,x:i,y:r})}};t.GetVoiceInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=zt(t).find("levlAngle").eq(0).text()?parseInt(zt(t).find("levlAngle").eq(0).text(),10):"";zt(t).find("voiceInfo").each(function(){var e=parseFloat(zt(this).find("dbValue").eq(0).text());n.push(e)});if(f.oPluginCallback.onGetVoiceInfo){if(i){f.oPluginCallback.onGetVoiceInfo([],i)}else{f.oPluginCallback.onGetVoiceInfo(n)}}}}},{key:"JS_ArrangeWindow",value:function a(e,t){var n=zt.Deferred();if(t&&t.length>0){var i='';zt.each(t,function(e,t){i+="\n "+(e+1)+"\n 0\n "+(t.dragable?1:0)+"\n 25500\n "+t.left+""+t.top+"\n "+t.width+""+t.height+"\n "+t.layer+"\n "});i+="";this.oPlugin.HWP_ArrangeCustomWindow(i)}else{this.oPlugin.HWP_ArrangeWindow(e)}setTimeout(function(){n.resolve()},100);return n.promise()}},{key:"JS_SetSecretKey",value:function u(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_SetSecretKey(n,t);setTimeout(function(){if(o<0){o=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_SetSecretKey:"+o);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_GetEncryptString",value:function l(e,t,n){var i=zt.Deferred();var r=0;var o=this;r=this.oPlugin.HWP_SetOriginalString(t,n,"");var s=this.oPlugin.HWP_GetEncryptString(e);setTimeout(function(){if(r<0){r=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetOriginalString:"+r);i.reject()}else{i.resolve(s)}},100);return i.promise()}},{key:"JS_GetDecryptString",value:function e(t,n,i){var r=this;var o=zt.Deferred();setTimeout(function(){if(!i){o.reject();return}var e=r.oPlugin.HWP_GetDecryptString(t,n,i);o.resolve(e)},100);return o.promise()}},{key:"JS_SetOriginalString",value:function f(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetOriginalString(e,t,"");setTimeout(function(){if(r<0){r=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetOriginalString:"+r);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_DestroyPlugin",value:function c(){var e=zt.Deferred();zt("#"+this.oOptions.szId+"_multiVideoActiveX").remove();this.oPlugin=null;this.oPluginCallback={};setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_Play",value:function h(e,t,n,i,r){var o=zt.Deferred();var s=this;var a=this.oPlugin.HWP_Play(e,t.auth,n,i,r);setTimeout(function(){if(a<0){a=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_Play:"+a);o.reject(a)}else{o.resolve()}},100);return o.promise()}},{key:"JS_Play2",value:function d(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_Play_V20(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_Play_V20:"+e);n.reject(r)}else{n.resolve(r)}},100);return n.promise()}},{key:"JS_OpenFileBrowser2",value:function p(e,t){if(!t){t=32}var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_OpenFileBrowser_V2(e,t);setTimeout(function(){if(r){n.resolve(r)}else{var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_OpenFileBrowser_V2:"+e);n.reject()}},100);return n.promise()}},{key:"JS_uploadFileByForm",value:function v(e){var t=-1;var n=zt.Deferred();var i=this;t=this.oPlugin.HWP_StartFormAsynUpload(e);setTimeout(function(){if(t===0){n.resolve(t)}else{var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_StartFormAsynUpload:"+e);n.reject(t)}},100);return n.promise()}},{key:"HWP_StopFormAsynUpload",value:function m(){var t=-1;var n=this;var i=zt.Deferred();t=this.oPlugin.HWP_StopFormAsynUpload();setTimeout(function(){if(t===0){i.resolve(t)}else{var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFormAsynUpload:"+e);i.reject(t)}},100);return i.promise()}},{key:"JS_ReversePlay",value:function y(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_ReversePlay(e,t.auth,n,i,r);setTimeout(function(){if(a<0){a=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_ReversePlay:"+a);s.reject(a)}else{s.resolve()}},100);return s.promise()}},{key:"JS_Stop",value:function g(e){var t=zt.Deferred();var n=this;if(!(this&&this.oPlugin)){t.reject()}else{try{var i=this.oPlugin.HWP_Stop(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Stop:"+e);t.reject()}else{t.resolve()}},100)}catch(r){n.ConsoleLog("HWP_Stop:"+r);t.reject(r)}}return t.promise()}},{key:"JS_Seek",value:function P(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_StopRealPlayAll",value:function w(){var e=zt.Deferred();var t=this.oPlugin.StopRealPlayAll();setTimeout(function(){if(t<0){e.reject()}else{e.resolve()}},100);return e.promise()}},{key:"JS_Pause",value:function S(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Pause(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Pause:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Resume",value:function _(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Resume(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Resume:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Slow",value:function b(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Slow(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Slow:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Fast",value:function C(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Fast(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Fast:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Transmission",value:function k(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_FrameForward",value:function T(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_FrameForward(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FrameForward:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetOSDTime",value:function R(e){var t=zt.Deferred();var n=-1;var i=this;n=this.oPlugin.HWP_GetOSDTime(e);setTimeout(function(){if(n<0||!n){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_GetOSDTime:"+n+";HWP_GetLastError:"+e);t.reject()}else{t.resolve(n)}},100);return t.promise()}},{key:"JS_OpenSound",value:function D(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_OpenSound(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_OpenSound:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_CloseSound",value:function x(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_CloseSound();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_CloseSound:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetVolume",value:function I(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetVolume(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetVolume:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_SetVolume",value:function E(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetVolume(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetVolume:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetAudioVolume",value:function q(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetAudioVolume(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetAudioVolume:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_EnableZoom",value:function A(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_EnableZoom(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_EnableZoom:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_DisableZoom",value:function O(e){var t=zt.Deferred();this.oPlugin.HWP_DisableZoom(e);var n=this;setTimeout(function(){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_DisableZoom:"+e);t.resolve()},100);return t.promise()}},{key:"JS_CapturePicture",value:function M(e,t){var n=this;var i=zt.Deferred();t=t.replace(/playback_/g,"");var r=n.oPlugin.HWP_CapturePicture(e,t);setTimeout(function(){if(r<0){r=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_CapturePicture:"+r);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StartSave",value:function L(e,t){var n=this;var i=zt.Deferred();var r=n.oPlugin.HWP_StartSave(e,t);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartSave:"+e);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StopSave",value:function F(e){var t=this;var n=zt.Deferred();var i=this.oPlugin.HWP_StopSave(e);setTimeout(function(){if(i<0){var e=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopSave:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_StartTalk",value:function W(e,t,n,i,r,o,s,a,u,l){var f=zt.Deferred();var c=void 0;var h=this;if(typeof l==="undefined"){c=this.oPlugin.HWP_StartVoiceTalk_V20(e,t,n,i,r,o,s,a,u)}else{c=this.oPlugin.HWP_StartVoiceTalk_V20Ex(e,t,n,i,r,o,s,a,u,l?l:0)}setTimeout(function(){if(c<0){var e=h.oPlugin.HWP_GetLastError();var t=typeof l==="undefined"?"HWP_StartVoiceTalk_V20":"HWP_StartVoiceTalk_V20Ex";h.ConsoleLog(t+":"+e);f.reject()}else{f.resolve()}},100);return f.promise()}},{key:"JS_StopTalk",value:function N(){var e=zt.Deferred();this.oPlugin.HWP_StopVoiceTalk();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetPlayMode",value:function B(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlayModeType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlayModeType:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetFullScreenCapability",value:function z(t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetCanFullScreen(t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetCanFullScreen:"+t+";HWP_GetLastError:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_FullScreenDisplay",value:function J(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_FullScreenDisplay(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FullScreenDisplay:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_EnableIVS",value:function H(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_EnableIVS(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_EnableIVS:"+e);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_SRInit",value:function U(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SR_Init(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SR_Init:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SRPTZ",value:function j(e,t,n){var i=zt.Deferred();var r=this;var o=0;if(t===4||t===5){o=this.oPlugin.HWP_SR_Zoom(e,5-t,n)}else{o=this.oPlugin.HWP_SR_PTZ(e,t,n)}setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();if(t===4||t===5){r.ConsoleLog("HWP_SR_Zoom:"+e)}else{r.ConsoleLog("HWP_SR_PTZ:"+e)}i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_SetPlaybackDrawType",value:function G(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetPlaybackDrawType(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetPlaybackDrawType:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetPlayBackType",value:function V(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlayBackType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlayBackType:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetTrsPlayBackParam",value:function Y(e,t){var n=zt.Deferred();var i=this;var r=''+""+t.transBitrate+""+""+t.transFrameRate+""+""+t.transResolution+"";var o=this.oPlugin.HWP_SetTrsPlayBackParam(e,r);setTimeout(function(){if(o<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetTrsPlayBackParam:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_GetLocalConfig",value:function X(){var t=this;var n=zt.Deferred();var e=this.oPlugin.HWP_GetLocalConfig();var i=Ut.oUtils.parseXmlFromStr(e);var r={protocolType:zt(i).find("ProtocolType").eq(0).text(),streamType:zt(i).find("StreamType").eq(0).text(),packgeSize:zt(i).find("PackgeSize").eq(0).text(),playWndType:zt(i).find("PlayWndType").eq(0).text(),buffNumberType:zt(i).find("BuffNumberType").eq(0).text(),recordPath:zt(i).find("RecordPath").eq(0).text(),capturePath:zt(i).find("CapturePath").eq(0).text(),playbackFilePath:zt(i).find("PlaybackFilePath").eq(0).text(),playbackPicPath:zt(i).find("PlaybackPicPath").eq(0).text(),downloadPath:zt(i).find("DownloadPath").eq(0).text(),snapScenePicPath:zt(i).find("SnapScenePicPath").eq(0).text(),snapViewPicPath:zt(i).find("SnapViewPicPath").eq(0).text(),ivsMode:zt(i).find("IVSMode").eq(0).text(),realPlayAll:zt(i).find("RealPlayAll").eq(0).text(),captureFileFormat:zt(i).find("CaptureFileFormat").eq(0).text(),osdPosInfo:zt(i).find("OSDPosInfo").eq(0).text(),osdPicInfo:zt(i).find("OSDPicInfo").eq(0).text(),showWizard:zt(i).find("ShowWizard").eq(0).text(),secretKey:zt(i).find("SecretKey").eq(0).text(),showFireBox:zt(i).find("ShowFireBox").eq(0).text(),showFireDistance:zt(i).find("ShowFireDistance").eq(0).text(),showFireMaxTemperature:zt(i).find("ShowFireMaxTemp").eq(0).text(),showFireMaxTemperaturePos:zt(i).find("ShowFireMaxTempPos").eq(0).text(),showTemperaturePoint:zt(i).find("ShowTemPoint").eq(0).text(),showTemperatureLine:zt(i).find("ShowTemLine").eq(0).text(),showTemperatureBox:zt(i).find("ShowTemBox").eq(0).text(),captureIncludeTemperatureInfo:zt(i).find("CaptureTemp").eq(0).text(),customBuffNumber:zt(i).find("CustomBuffNumber").eq(0).text(),faceSnapPicPath:zt(i).find("FaceSnapPicPath").eq(0).text(),d3dCapture:zt(i).find("D3DCapture").eq(0).text(),HumanTrack:zt(i).find("HumanTrack").eq(0).text(),VehicleTrack:zt(i).find("VehicleTrack").eq(0).text(),RenderTrack:zt(i).find("RenderTrack").eq(0).text(),shieldMask:zt(i).find("ShieldMask").eq(0).text(),wasteGasDection:zt(i).find("WasteGasDection").eq(0).text(),gasInfo:zt(i).find("GasInfo").eq(0).text(),audioDownloadPath:zt(i).find("AudioDownloadPath").eq(0).text(),audioRecordPath:zt(i).find("AudioRecordPath").eq(0).text(),picOrRegionFill:zt(i).find("PicOrRegionFill").eq(0).text()};t.iProtocolType=parseInt(r.protocolType,10);setTimeout(function(){if(!r){var e=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_GetLocalConfig:"+e);n.reject()}else{n.resolve(r)}},100);return n.promise()}},{key:"JS_SetLocalConfig",value:function Z(t){var n=this;var i=zt.Deferred();var e=''+""+t.protocolType+""+t.streamType+""+""+t.packgeSize+""+t.playWndType+""+""+t.buffNumberType+""+t.recordPath+""+""+t.capturePath+""+t.playbackFilePath+""+""+t.playbackPicPath+""+t.downloadPath+""+""+t.snapScenePicPath+""+t.snapViewPicPath+""+""+t.ivsMode+""+t.realPlayAll+""+""+t.captureFileFormat+""+t.osdPosInfo+""+""+t.osdPicInfo+""+t.showWizard+""+""+t.secretKey+""+t.showFireBox+""+""+t.showFireDistance+""+t.showFireMaxTemperature+""+""+t.showFireMaxTemperaturePos+""+t.showTemperaturePoint+""+""+t.showTemperatureLine+""+t.showTemperatureBox+""+""+t.captureIncludeTemperatureInfo+""+""+t.customBuffNumber+""+""+t.faceSnapPicPath+""+""+t.HumanTrack+""+""+t.VehicleTrack+""+""+t.RenderTrack+""+""+t.shieldMask+""+""+t.wasteGasDection+""+""+t.gasInfo+""+""+t.audioDownloadPath+""+""+t.audioRecordPath+""+""+t.picOrRegionFill+""+"";var r=this.oPlugin.HWP_SetLocalConfig(e);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetLocalConfig:"+e);i.reject()}else{n.iProtocolType=parseInt(t.protocolType,10);i.resolve()}},100);return i.promise()}},{key:"JS_GetLastError",value:function K(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetLastError();setTimeout(function(){if(t<0){e.reject()}else{e.resolve(t)}},100);return e.promise()}},{key:"JS_OpenFileBrowser",value:function $(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_OpenFileBrowser(e,t);setTimeout(function(){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_OpenFileBrowser:"+e);n.resolve(r)},100);return n.promise()}},{key:"JS_OpenDirectory",value:function Q(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_OpenDirectory(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_OpenFileBrowser:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartAsynUpload",value:function ee(e,t,n,i){var r=zt.Deferred();var o=this;var s=this.oPlugin.HWP_StartAsynUpload(e,t,n,i,0);setTimeout(function(){if(s<0){s=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_OpenFileBrowser:"+s);r.reject(s)}else{r.resolve()}},100);return r.promise()}},{key:"JS_StopAsynUpload",value:function te(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopAsynUpload();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopAsynUpload:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetUploadErrorInfo",value:function ne(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetUploadErrorInfo();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_UploadFile",value:function ie(e,t,n,i){var r=this;var o=zt.Deferred();var s=r.oPlugin.HWP_UploadFile(e,t,n,i,0);setTimeout(function(){if(s<0){var e=r.oPlugin.HWP_GetHttpErrorInfo();s=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_UploadFile:"+s);r.ConsoleLog("HWP_GetHttpErrorInfo:"+e);o.reject({readyState:4,status:s,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null,errorInfo:e})}else{o.resolve()}},100);return o.promise()}},{key:"JS_GetIpcImportErrorInfo",value:function re(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetIpcImportErrorInfo();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_DownloadFile",value:function oe(e,t,n,i,r,o){var s=this;var a=zt.Deferred();var u=0;if(i===2){u=this.oPlugin.HWP_ExportFile(e,t,n,i,o)}else{u=this.oPlugin.HWP_ExportDeviceConfig(e,t,"",r)}setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetHttpErrorInfo();u=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_GetHttpErrorInfo:"+e);if(i===2){s.ConsoleLog("HWP_ExportFile:"+u)}else{s.ConsoleLog("HWP_ExportDeviceConfig:"+u)}a.reject({readyState:4,status:u,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null})}else{a.resolve(u)}},100);return a.promise()}},{key:"JS_DownloadFileNoPlugin",value:function se(t){var e=new Promise(function(e){zt("body").append('
  • ');zt("#jsplugin_download_li").trigger("click");zt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_StartUpgrade",value:function ae(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_StartUpgradeEx(e,t,n,i,r,"");if(a<0){a=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_StartUpgradeEx:"+a);if(a===10){var u=void 0;try{u=o.oPlugin.HWP_GetProtectModeWithoutAdmin()}catch(l){u=-1}if(u===1){s.reject(605)}else{s.reject(a)}}else{s.reject(a)}}else{s.resolve()}return s.promise()}},{key:"JS_StopUpgrade",value:function ue(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopUpgrade();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopUpgrade:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetUpgradeStatus",value:function le(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_UpgradeStatus();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_UpgradeStatus:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_GetUpgradeProgress",value:function fe(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_UpgradeStatus();if(i>=0){i=this.oPlugin.HWP_UpgradeProgress()}setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_UpgradeProgress:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_ExportDeviceLog",value:function ce(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_ExportDeviceLog(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ExportDeviceLog:"+e);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_ExportReport",value:function he(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_ExportReport(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ExportReport:"+e);i.reject()}else{i.resolve({status:o})}},100);return i.promise()}},{key:"JS_StartAsyncDownload",value:function de(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_StartDownloadEx(e,t,n,i,r?r:"");setTimeout(function(){if(a<0){a=o.oPlugin.HWP_GetLastError();var e=o.oPlugin.HWP_GetHttpErrorInfo();o.ConsoleLog("HWP_ExportReport:"+a);o.ConsoleLog("HWP_GetHttpErrorInfo:"+e);s.reject({readyState:4,status:a,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null})}else{s.resolve(a)}},100);return s.promise()}},{key:"JS_StopAsyncDownload",value:function pe(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopDownload(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopDownload:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetDownloadStatus",value:function ve(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownloadStatus(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownloadStatus:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_GetDownloadProgress",value:function me(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownloadStatus(e);if(i>=0){i=this.oPlugin.HWP_GetDownloadProgress(e)}setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownloadProgress:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_EnablePDC",value:function ye(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_EnablePDC(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_EnablePDC:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_Resize",value:function ge(){var t=zt.Deferred();var n=this;setTimeout(function(){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_EnablePDC:"+e);t.resolve()},100);return t.promise()}},{key:"JS_SetDrawCallback",value:function Pe(t,e,n,i,r,o){var s=this;var a=zt.Deferred();s.fCurrentCallback=null;s.afCurrentCallback[t]=null;s.fPointCallback=null;var u=0;var l=0;var f="";if(n!=="Rect"){if(n==="Line"){l=2}else if(n==="Polygon"){l=4}else if(n==="Point"){var c="";c+="1";c+="1";c+="002552";c+="";u=this.oPlugin.HWP_SetSnapPointInfo(0,c);f="HWP_SetSnapPointInfo";setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetLastError();s.ConsoleLog(f+":"+e);a.reject()}else{s.fPointCallback=r;a.resolve()}},100);return a.promise()}else{l=0}if(e){f="HWP_SetPlaybackDrawType";u=s.oPlugin.HWP_SetPlaybackDrawType(t,l)}else{f="HWP_ClearDrawLineInfo";u=s.oPlugin.HWP_ClearDrawLineInfo(t)}}else{if(e){var h=1;if(o&&o.mode>=0){h=o.mode}u=s.oPlugin.HWP_EnableZoom(t,h);f="HWP_EnableZoom"}else{s.oPlugin.HWP_DisableZoom(t);f="HWP_DisableZoom"}}setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetLastError();s.ConsoleLog(f+":"+e);a.reject()}else{s.fCurrentCallback=r;s.afCurrentCallback[t]=r;a.resolve()}},100);return a.promise()}},{key:"JS_SetDrawStatus",value:function we(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=zt.Deferred();var r=0;r=this.oPlugin.HWP_SetDrawStatus(e);if(e){if(t){r=this.oPlugin.HWP_SetSnapDrawMode(n,t)}else{r=this.oPlugin.HWP_SetSnapDrawMode(n,3)}}else{r=this.oPlugin.HWP_SetSnapDrawMode(n,-1)}setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_ClearRegion",value:function Se(){var e=zt.Deferred();var t=this.oPlugin.HWP_ClearRegion();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_SetDrawShapeInfo",value:function _e(e,t){var n=zt.Deferred();var i=0;var r=this;var o="";if(e==="Rect"){i=this.oPlugin.HWP_SetSnapDrawMode(0,1);o="HWP_SetSnapDrawMode";if(i>=0){if(t.type===0){var s="PALroi";s+="704"+"576"+""+(t.translucent!==1?"transparent":"shelter")+""+""+t.maxShapeSupport+"";i=this.oPlugin.HWP_SetRegionInfo(s);o="HWP_SetRegionInfo"}else if(t.type===1){var a="";a+="";a+=""+t.id+"";a+=""+t.tips+"";a+=""+(t.tipsPos||0)+"";a+="false";a+="0";a+=""+t.widthHeightRate+"";a+="";a+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";a+="";a+="";i=this.oPlugin.HWP_SetSnapPolygonInfo(a);o="HWP_SetSnapPolygonInfo"}}}else if(e==="Grid"){i=this.oPlugin.HWP_SetSnapDrawMode(0,1);o="HWP_SetSnapDrawMode";if(i>=0){var u="PAL";u+="grid"+t.gridRowNum+"";u+=""+t.gridColNum+"";u+="transparent";i=this.oPlugin.HWP_SetRegionInfo(u);o="HWP_SetRegionInfo"}}else if(e==="Polygon"){i=this.oPlugin.HWP_SetSnapDrawMode(0,2);o="HWP_SetSnapDrawMode";if(i>=0){var l="";l+="";l+=""+t.id+"";l+=""+t.tips+"";l+="false";l+="1";l+=""+(t.maxPointSupport+1)+"";l+=""+(t.minPointSupport+1)+"";l+="";l+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";l+="";l+="";i=this.oPlugin.HWP_SetSnapPolygonInfo(l);o="HWP_SetSnapPolygonInfo"}}else if(e==="Line"){var f='';f+="";f+=""+t.id+"";f+=""+t.editType+"";f+=""+t.lineType+"";f+=""+t.tips+"";f+=""+t.direction+""+t.mode+"";if(t.lineType!==2){f+=""+t.direction+"";f+=""+t.points[0][0]+""+t.points[0][1]+""+t.points[1][0]+""+t.points[1][1]+""}else{f+=""+(!t.direction?0:t.direction-1)+"";f+="";var c=t.points&&t.points.length;if(c>0){f+="";for(var h=0;h"+t.points[h][0]+""+t.points[h][1]+""}f+=""}f+=""+(c>0).toString()+"";f+=""+(t.direction===0?"false":"true")+"";if(t.minClosed){f+=""+t.minClosed+""}if(t.pointNumMax){f+=""+t.pointNumMax+""}if(t.directionTips){f+=""+t.directionTips+""}f+=""}f+="false";f+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";f+="";f+="";i=this.oPlugin.HWP_SetSnapLineInfo(f);o="HWP_SetSnapLineInfo"}else if(e==="Point"){var d="";var p=!t.replace?0:1;d+=""+p+"";d+="";if(t.id){d+=""+t.id+""}if(t.type){d+=""+(t.type==="cross"?1:2)+""}if(t.drawColor){var v=Ut.oUtils.colorRgb(t.drawColor);d+="";d+=""+v[0]+"";d+=""+v[1]+"";d+=""+v[2]+"";d+=""}d+="";d+="";i=this.oPlugin.HWP_SetSnapPointInfo(0,d);o="HWP_SetSnapPointInfo";return d}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetGridInfo",value:function be(e){var t=zt.Deferred();var n=this;var i="PAL";i+="grid"+e.gridRowNum+"";i+=""+e.gridColNum+"";i+="transparent"+e.gridMap+"";var r=this.oPlugin.HWP_SetRegionInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetRegionInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetGridInfo",value:function Ce(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetRegionInfo();var n=Ut.oUtils.parseXmlFromStr(t);var i=parseInt(zt(n).find("columnGranularity").text(),10);var r=parseInt(zt(n).find("rowGranularity").text(),10);var o={gridColNum:i,gridRowNum:r,gridMap:zt(n).find("gridMap").text()};setTimeout(function(){e.resolve(o)},100);return e.promise()}},{key:"JS_SetRectInfo",value:function ke(t){var n=zt.Deferred();var i=-1;var r=this;var o="";if(t[0].type===0){var s="PALroi";var e="transparent";if(t[0].translucent===1){e="shelter"}else if(t[0].translucent===2){e="quadrilateral"}s+="704"+"576"+""+e+""+"";zt.each(t,function(e){s+="";s+="";zt.each(t[e].points,function(e,t){s+=""+Math.round(t[0]*704)+""+""+Math.round((1-t[1])*576)+""});s+="";s+=""});s+=""+t[0].maxShapeSupport+"";i=this.oPlugin.HWP_SetRegionInfo(s);o="HWP_SetRegionInfo"}else if(t[0].type===1){var a="";zt.each(t,function(e,t){a+="";a+=""+t.id+"";a+=""+(t.editType||0)+"";a+=""+(t.tips||"")+"";a+=""+(t.tipsPos||0)+"";a+="true";a+="0";a+=""+t.widthHeightRate+"";a+="";zt.each(t.points,function(e,t){a+=""+t[0]+""+t[1]+""});a+="";a+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";a+=""});a+="";i=this.oPlugin.HWP_SetSnapPolygonInfo(a);o="HWP_SetSnapPolygonInfo"}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_GetRectInfo",value:function Te(){var e=zt.Deferred();var n=[];var t=this.oPlugin.HWP_GetRegionInfo();var i=Ut.oUtils.parseXmlFromStr(t);zt(i).find("DetectionRegion").each(function(e){var t=[];zt(this).find("RegionCoordinatesList").find("RegionCoordinates").each(function(){t.push([parseInt(zt(this).find("positionX").text(),10)/704,1-parseInt(zt(this).find("positionY").text(),10)/576])});n.push({id:e+1,points:t})});var s=[];var r=this.oPlugin.HWP_GetSnapPolygonInfo();var o=Ut.oUtils.parseXmlFromStr(r);zt(o).find("SnapPolygon").each(function(){var e=parseInt(zt(this).find("polygonType").text(),10);if(e===0){var t=zt(this).find("id").text();var n=zt(this).find("isClosed").text()==="true";var i=zt(this).find("tips").text();var r=[];zt(this).find("pointList").find("point").each(function(){r.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});var o={id:t,closed:n,points:r,tips:i};s.push(o)}});setTimeout(function(){if(n.length>0){e.resolve(n)}else if(s.length>0){e.resolve(s)}else{e.resolve([])}},100);return e.promise()}},{key:"JS_SetPolygonInfo",value:function Re(e){var t=zt.Deferred();var n=this;var i="";zt.each(e,function(e,t){if(typeof t.closed==="undefined"){t.closed=true}i+="";i+=""+t.id+"";i+=""+t.editType+"";i+=""+t.tips+"";i+=""+t.closed.toString()+"";i+="1";i+="";zt.each(t.points,function(e,t){i+=""+t[0]+""+t[1]+""});i+="";i+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";i+=""});i+="";var r=this.oPlugin.HWP_SetSnapPolygonInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetSnapPolygonInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetPolygonInfo",value:function De(){var e=zt.Deferred();var l=[];var t=this.oPlugin.HWP_GetSnapPolygonInfo();var n=Ut.oUtils.parseXmlFromStr(t);zt(n).find("SnapPolygon").each(function(){var e=parseInt(zt(this).find("polygonType").text(),10);if(e===1){var t=zt(this).find("id").text();var n=zt(this).find("isClosed").text()==="true";var i=zt(this).find("tips").text();var r="#"+Ut.oUtils.colorTransfer(zt(this).find("r").text())+Ut.oUtils.colorTransfer(zt(this).find("g").text())+Ut.oUtils.colorTransfer(zt(this).find("b").text());var o=parseInt(zt(this).find("PointNumMax").text(),10);var s=parseInt(zt(this).find("MinClosed").text(),10);var a=[];zt(this).find("pointList").find("point").each(function(){a.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});var u={id:t,points:a,closed:n,tips:i,drawColor:r,polygonType:e,pointNumMax:o,minClosed:s};l.push(u)}});setTimeout(function(){e.resolve(l)},100);return e.promise()}},{key:"JS_SetLineInfo",value:function xe(e){var t=zt.Deferred();var n=this;var r='';zt.each(e,function(e,t){r+="";r+=""+t.id+"";r+=""+t.editType+"";r+=""+t.lineType+"";r+=""+t.tips+"";if(t.lineType!==2){r+=""+t.mode+"";r+=""+t.direction+""+t.direction+""+t.points[0][0]+""+t.points[0][1]+""+t.points[1][0]+""+t.points[1][1]+"";if(t.cutOffPositions){r+="true";zt.each(t.cutOffPositions,function(e,t){r+=""+t+""});r+=""}}else{r+=""+(!t.direction?0:t.direction-1)+"";var n=t.points.length;for(var i=0;i"+t.points[i][0]+""+t.points[i][1]+""}r+=""+(n>0).toString()+"";r+=""+(t.direction===0?"false":"true")+"";if(t.minClosed){r+=""+t.minClosed+""}if(t.pointNumMax){r+=""+t.pointNumMax+""}if(t.directionTips){r+=""+t.directionTips+""}r+=""}r+="false";r+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";r+=""});r+="";var i=this.oPlugin.HWP_SetSnapLineInfo(r);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetSnapPolygonInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetLineInfo",value:function Ie(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetSnapLineInfo();var n=Ut.oUtils.parseXmlFromStr(t);var p=[];zt(n).find("SnapLine").each(function(){var e=parseInt(zt(this).find("id").text(),10);var t=parseInt(zt(this).find("LineTypeEx").text(),10);var n=zt(this).find("tips").text();var i=void 0;if(t===3){i=parseInt(zt(this).find("CustomType").text(),10)||parseInt(zt(this).find("LineType").text(),10)}else if(t===1||t===4){i=parseInt(zt(this).find("ArrowType").text(),10)}else if(t===2){var r=parseInt(zt(this).find("ArrowType").text(),10);if(isNaN(r)){r=1}else{r+=1}i=r}var o=[];var s=[];var a=[];var u=false;var l=[];var f=false;var c=false;var h={bShow:false,aPoints:[]};if(t!==2){o.push([parseFloat(zt(this).find("StartPos").find("x").text()),parseFloat(zt(this).find("StartPos").find("y").text())]);o.push([parseFloat(zt(this).find("EndPos").find("x").text()),parseFloat(zt(this).find("EndPos").find("y").text())]);if(t===4){s.push([parseFloat(zt(this).find("Demarcation").find("Sp_x").text()),parseFloat(zt(this).find("Demarcation").find("Sp_y").text())]);s.push([parseFloat(zt(this).find("Demarcation").find("Ep_x").text()),parseFloat(zt(this).find("Demarcation").find("Ep_y").text())]);a.push([parseFloat(zt(this).find("PDCArrow").find("Sp_x").text()),parseFloat(zt(this).find("PDCArrow").find("Sp_y").text())]);a.push([parseFloat(zt(this).find("PDCArrow").find("Ep_x").text()),parseFloat(zt(this).find("PDCArrow").find("Ep_y").text())]);u="true"===zt(this).find("PDCShowMark").text()}if(t===5){h.bShow=true;h.aPoints.length=0;zt(this).find("PN_Width").each(function(){h.aPoints.push(parseFloat(zt(this).text()))})}}else{zt(this).find("BreakLine").find("point").each(function(){o.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});f="true"===zt(this).find("isShowArrow").text();c="true"===zt(this).find("isClosed").text();if(f){zt(this).find("BreakLine").find("BLArrow").each(function(){l.push([[parseFloat(zt(this).find("Sp_x").text()),parseFloat(zt(this).find("Sp_y").text())],[parseFloat(zt(this).find("Ep_x").text()),parseFloat(zt(this).find("Ep_y").text())]])})}}var d={id:e,lineType:t,tips:n,points:o,direction:i,demarcation:s,pdcArrow:a,showMark:u,showArrow:f,arrowList:l,bClosed:c};if(h.bShow){d.cutOffPositions=h.aPoints}p.push(d)});setTimeout(function(){e.resolve(p)},100);return e.promise()}},{key:"JS_SetTextOverlay",value:function Ee(e){var t=zt.Deferred();var n=this;var i=e.channelName.name.replace(/&/g,"&");i=i.replace(/"+r+""+o+""+""+e.channelName.enable+""+i+""+""+e.channelName.alignment+""+""+e.minMoveValue+""+""+Math.round(e.channelName.point[0]*r)+""+""+Math.round(e.channelName.point[1]*o)+""+""+e.date.enable+""+e.date.dateType+""+""+e.date.timeFormat+""+e.date.showWeekDay+""+""+e.date.alignment+""+""+e.minMoveValue+""+""+Math.round(e.date.point[0]*r)+""+""+Math.round(e.date.point[1]*o)+""+"";for(var a=0,u=e.text.length;a";s+=""+e.text[a].id+""+e.text[a].enable+""+""+e.text[a].alignment+""+""+e.minMoveValue+""+""+Math.round(e.text[a].point[0]*r)+""+""+Math.round(e.text[a].point[1]*o)+""+""+l+"";s+=""}s+="";var f=this.oPlugin.HWP_SetTextOverlay(s);setTimeout(function(){if(f<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetTextOverlay:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetTextOverlay",value:function qe(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetTextOverlay();var n=Ut.oUtils.parseXmlFromStr(t);var i={};var r=zt(n).find("channelNameOverlay").eq(0);var o=zt(n).find("DateTimeOverlay").eq(0);var s=zt(n).find("TextOverlayList").eq(0);var a=parseInt(zt(n).find("videoResolutionWidth").eq(0).text(),10);var u=parseInt(zt(n).find("videoResolutionHeight").eq(0).text(),10);i.channelName={enable:zt(r).find("enabled").eq(0).text()==="true",name:zt(r).find("name").eq(0).text(),alignment:0,point:[zt(r).find("positionX").eq(0).text()/a,zt(r).find("positionY").eq(0).text()/u]};i.date={enable:zt(o).find("enabled").eq(0).text()==="true",alignment:parseInt(zt(o).find("alignment").eq(0).text(),10)||0,dateType:parseInt(zt(o).find("type").eq(0).text(),10)||0,timeFormat:zt(o).find("clockType").eq(0).text(),showWeekDay:zt(o).find("displayWeek").eq(0).text()==="true",point:[zt(o).find("positionX").eq(0).text()/a,zt(o).find("positionY").eq(0).text()/u]};i.text=[];for(var l=0,f=zt(s).find("TextOverlay").length;l0&&(o===0||o===1)){var s='';for(var a=0,u=e.length;a"+e[a]+""+o+""}s+="";i=this.oPlugin.HWP_ClearTargetPolygon(s);setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ClearTargetPolygon:"+e);n.reject()}else{n.resolve()}},100)}else{i=this.oPlugin.HWP_ClearSnapInfo(o);setTimeout(function(){if("Choosed"===t){n.resolve(i);return}if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ClearSnapInfo:"+e);n.reject()}else{n.resolve(i)}},100)}return n.promise()}},{key:"JS_SetCorrectionType",value:function Oe(e){var t=zt.Deferred();var n=0;var i=this;if(e===1){n=this.oPlugin.HWP_SetPlayModeType(7)}else{n=this.oPlugin.HWP_SetPlayModeType(7)}n=this.oPlugin.HWP_SetCorrectionType(e);setTimeout(function(){if(n<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetCorrectionType:"+e);t.reject(n)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetPlaceType",value:function Me(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlaceType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlaceType:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFishListener",value:function Le(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_StartFishListener(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_StartFishListener:"+e);i.reject(o)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StopFishListener",value:function Fe(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFishListener();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFishListener:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetFishBoxListInfo",value:function We(e){var t=zt.Deferred();var n=this;var i='';zt.each(e,function(e,t){i+="";i+=""+t.id+"";i+=""+t.xPoint+"";i+=""+t.yPoint+"";i+=""+t.zPoint+"";i+=""});i+="";var r=this.oPlugin.HWP_SetFishBoxListInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetFishBoxListInfo:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetFishBoxListInfo",value:function Ne(){var e=zt.Deferred();var t=this.oPlugin.HWP_FECGetBoxPosList();var n=Ut.oUtils.parseXmlFromStr(t);var r=[];zt(n).find("PointPos").each(function(){var e=parseInt(zt(this).find("id").text(),10);var t=parseFloat(zt(this).find("xPoint").text());var n=parseFloat(zt(this).find("yPoint").text());var i=parseFloat(zt(this).find("zPoint").text());r.push({id:e,xPoint:t,yPoint:n,zPoint:i})});setTimeout(function(){e.resolve(r)},100);return e.promise()}},{key:"JS_ClearAllWndFishBoxInfo",value:function Be(){var e=zt.Deferred();this.oPlugin.HWP_ClearAllWndFishBoxInfo();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetFishWndProperty",value:function ze(e,t,n){var i=zt.Deferred();var r=this.oPlugin.HWP_SetFishWndPty(e,t,n);var o=this;setTimeout(function(){if(r<0){var e=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetFishWndPty:"+e);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_SetFishParams",value:function Je(e,t,n,i){var r=zt.Deferred();var o=this;var s='';s+=""+e+"";s+=""+t+"";s+=""+n+"";s+=""+i+"";s+="";var a=this.oPlugin.HWP_SetFishParams(s);setTimeout(function(){if(a<0){var e=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetFishParams:"+e);r.reject(a)}else{r.resolve()}},100);return r.promise()}},{key:"JS_ArrangeFECWindow",value:function He(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_ArrangeFECWindow(e,"");setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_ArrangeFECWindow:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFECScan",value:function Ue(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StartFECScan(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFECScan:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopFECScan",value:function je(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFECScan();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFECScan:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_FishEyePTZ",value:function Ge(e,t){var n=zt.Deferred();var i=0;var r=this;var o="";if(e===4){i=this.oPlugin.HWP_FECZoomIn(t);o="HWP_FECZoomIn"}else if(e===5){i=this.oPlugin.HWP_FECZoomOut(t);o="HWP_FECZoomOut"}else{i=this.oPlugin.HWP_FECPTZ(t);o="HWP_FECPTZ"}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject(i)}else{n.resolve()}},100);return n.promise()}},{key:"JS_FishEyeGetPreset",value:function Ve(){var e=zt.Deferred();var t=this.oPlugin.HWP_FECGetPreset();var n=Ut.oUtils.parseXmlFromStr(t);var i=parseFloat(zt(n).find("xPoint").text());var r=parseFloat(zt(n).find("yPoint").text());var o=parseFloat(zt(n).find("zPoint").text());var s={xPoint:i,yPoint:r,zPoint:o};setTimeout(function(){e.resolve(s)},100);return e.promise()}},{key:"JS_FishEyeSetPreset",value:function Ye(e){var t=zt.Deferred();var n=this;var i='';i+=""+e.xPoint+"";i+=""+e.yPoint+"";i+=""+e.zPoint+"";i+="";var r=this.oPlugin.HWP_FECSetPreset(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FECSetPreset:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFECCruise",value:function Xe(e){var t=zt.Deferred();var n=this;var i='';zt.each(e,function(e,t){i+="";i+=""+t.xPoint+"";i+=""+t.yPoint+"";i+=""+t.zPoint+"";i+="";i+=""});i+="";var r=this.oPlugin.HWP_StartFECCruise(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFECCruise:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopFECCruise",value:function Ze(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFECCruise();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFECCruise:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetIsHttps",value:function Ke(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetIsHttps(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetIsHttps:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetReconnectInfo",value:function $e(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetReconnectInfo(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetReconnectInfo:"+e);n.reject(r)}else{n.resolve()}},100);return n.promise()}},{key:"JS_CheckUpdate",value:function Qe(e){var t=zt.Deferred();var n=this;try{var i=e.replace(/<\blocalServiceControl.*<\/localServiceControl\b>/,"");var r=this.oPlugin.HWP_CheckPluginUpdate(i);setTimeout(function(){t.resolve(r)},100)}catch(o){n.ConsoleLog("HWP_CheckPluginUpdate:"+o);t.reject(o)}return t.promise()}},{key:"JS_SelectShape",value:function et(e,t){var n=zt.Deferred();var i=0;if(e==="Rect"){i=0}else if(e==="Polygon"){i=1}else if(e==="Line"){i=2}else if(e==="All"){i=4;this.oPlugin.HWP_ClearDrawLineInfo(0)}var r=this.oPlugin.HWP_SelectDraw(0,i,t);setTimeout(function(){n.resolve(r)},100);return n.promise()}},{key:"JS_GetPictureSize",value:function tt(e){var t=zt.Deferred();var n=this.oPlugin.HWP_GetPictureSize(e);setTimeout(function(){t.resolve({width:parseInt(n.split("*")[0],10),height:parseInt(n.split("*")[1],10)})},100);return t.promise()}},{key:"JS_SetOriginResolution",value:function nt(e,t,n){var i=zt.Deferred();var r=this.oPlugin.HWP_setOriginResolution(e,t,n);setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_SetPlayWndMode",value:function it(e,t,n){var i=zt.Deferred();if(n){e=64}var r=this.oPlugin.HWP_setPlayWndMode(e,t);setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_UpdateWindowStyle",value:function rt(){var e=new Promise(function(e){e()});return e}},{key:"JS_CuttingPartWindow",value:function ot(){var e=new Promise(function(e){e()});return e}},{key:"JS_RepairPartWindow",value:function st(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetPointInfo",value:function at(e,t){var n='';var i="";t=t?t:0;i+=""+t+"";i+="1";var r=false;if(e){zt.each(e,function(){var e="";if(this.id>0){e+=""+this.id+""}if(this.drawColor){var t=Ut.oUtils.colorRgb(this.drawColor);e+="";e+=""+t[0]+"";e+=""+t[1]+"";e+=""+t[2]+"";e+=""}if(this.tips){e+=""+this.tips+""}if(this.editType||this.editType===0){e+=""+this.editType+""}if(this.lineType===2){r=true;n+="";n+=e+"2"+""+""+""+""+""+""+""+""+""+"true"+"1"+"1";if(this.points&&this.points.length>0){n+=""+this.points[0]+""+this.points[1]+""}n+=""+""}else{i+=""+e;if(this.type){i+=""+(this.type==="circle"?2:1)+""}if(this.points){i+="";i+=""+this.points[0]+"";i+=""+this.points[1]+"";i+=""}i+=""}})}i+="";n+="";var o=zt.Deferred();var s=void 0;if(r){s=this.oPlugin.HWP_SetSnapLineInfo(n)}else{s=this.oPlugin.HWP_SetSnapPointInfo(0,i)}setTimeout(function(){o.resolve(s)},100);return o.promise()}},{key:"JS_GetPointInfo",value:function ut(){var e=Ut.oUtils.parseXmlFromStr(this.oPlugin.HWP_GetSnapPointInfo(0));var t=Ut.oUtils.parseXmlFromStr(this.oPlugin.HWP_GetSnapLineInfo());var n=[];zt(e).find("SnapPoint").each(function(){n.push({id:parseInt(zt(this).find("id").text(),10),drawColor:"#"+Ut.oUtils.colorTransfer(zt(this).find("color r").text())+Ut.oUtils.colorTransfer(zt(this).find("color g").text())+Ut.oUtils.colorTransfer(zt(this).find("color b").text()),type:zt(this).find("type").text()==="2"?"circle":"cross",replace:parseInt(zt(e).find("mode").text(),10)===1,point:[parseFloat(zt(e).find("positionX").text()),parseFloat(zt(e).find("positionY").text())]})});zt(t).find("SnapLine").each(function(){if(zt(this).find("BreakLine point").length===1){n.push({id:parseInt(zt(this).find("id").text(),10),drawColor:"#"+Ut.oUtils.colorTransfer(zt(this).find("color r").text())+Ut.oUtils.colorTransfer(zt(this).find("color g").text())+Ut.oUtils.colorTransfer(zt(this).find("color b").text()),type:"cross",replace:false,point:[parseFloat(zt(this).find("BreakLine x").text()),parseFloat(zt(this).find("BreakLine y").text())]})}});var i=zt.Deferred();setTimeout(function(){i.resolve(n)},100);return i.promise()}},{key:"JS_PlayWithImg",value:function lt(){return Promise.resolve()}},{key:"JS_DestroyAll",value:function ft(){this.JS_DestroyPlugin();return Promise.resolve()}},{key:"JS_SetPackageType",value:function ct(e){this.oPlugin.HWP_SetPackageType(e);return Promise.resolve()}},{key:"JS_GetPlayInfo",value:function ht(e){var t=this.oPlugin.HWP_GetPictureSize(e);var n=t.split("*");var i={pictureSize:{width:parseInt(n[0],10),height:parseInt(n[1],10)}};return Promise.resolve(i)}},{key:"JS_SetZeroChanInfo",value:function dt(e,t,n){this.oPlugin.HWP_SetZeroChanInfo(e,t,n);return Promise.resolve()}},{key:"JS_SetSnapDrawWndIndex",value:function pt(e){this.oPlugin.HWP_SetSnapDrawWndIndex(e);return Promise.resolve()}},{key:"JS_SetWindowSelected",value:function vt(e){this.oPlugin.HWP_SetWindowSelected(e);return Promise.resolve()}},{key:"JS_GetEngineSupport",value:function mt(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetEngineSupport();var n=Ut.oUtils.parseXmlFromStr(t);var i={HardDecodeCap:{GPUType:zt(n).find("HardDecodeCap GPUType").eq(0).text(),D3D9Support:zt(n).find("HardDecodeCap D3D9Support").eq(0).text(),D3D11Support:zt(n).find("HardDecodeCap D3D11Support").eq(0).text()},RenderCap:{DDrawSupport:zt(n).find("RenderCap DDrawSupport").eq(0).text(),D3D9SurfaceSupport:zt(n).find("RenderCap D3D9SurfaceSupport").eq(0).text(),D3D9TextureSupport:zt(n).find("RenderCap D3D9TextureSupport").eq(0).text(),D3D11Support:zt(n).find("RenderCap D3D11Support").eq(0).text()}};setTimeout(function(){if(!i){e.reject()}else{e.resolve(i)}},100);return e.promise()}},{key:"JS_ExistGetSlfPointList",value:function yt(){var e=zt.Deferred();var t=typeof this.oPlugin.HWP_GetSlfPointList!=="undefined";setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_GetSlfPointList",value:function gt(e,t){var n=zt.Deferred();var i=this.oPlugin.HWP_GetSlfPointList(e,t);var r=Ut.oUtils.parseXmlFromStr(i);var o=[];zt(r).find("SLFPoint").each(function(){var e={x:zt(this).find("ImagePoint").eq(0).find("x").eq(0).text(),y:zt(this).find("ImagePoint").eq(0).find("y").eq(0).text(),p:zt(this).find("PTZValue").eq(0).find("p").eq(0).text(),t:zt(this).find("PTZValue").eq(0).find("t").eq(0).text(),z:zt(this).find("PTZValue").eq(0).find("z").eq(0).text()};o.push(e)});setTimeout(function(){n.resolve(o)},100);return n.promise()}},{key:"JS_GetSlfVersion",value:function Pt(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetSlfVersion();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_AudioPlay",value:function wt(e,t,n,i,r){var o=zt.Deferred();var s=this;var a=null;if(r){a=this.oPlugin.HWP_StartAudioPlayEx(e,t,n,i,r)}else{a=this.oPlugin.HWP_StartAudioPlay(e,t,n,i)}setTimeout(function(){if(a<0){a=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_StartAudioPlayEx:"+a);o.reject(a)}else{o.resolve()}},100);return o.promise()}},{key:"JS_StartSycAudioPlay",value:function St(e,t,n,i){var r=zt.Deferred();var o=this;var s=null;s=this.oPlugin.HWP_StartSycAudioPlay(n,e,t,i);setTimeout(function(){if(s<0){s=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_StartSycAudioPlay:"+s);r.reject(s)}else{r.resolve()}},100);return r.promise()}},{key:"JS_GetDownFilePath",value:function _t(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownLoadFilePath(e);console.log("JS_GetDownFilePath");console.log(i);setTimeout(function(){if(i){t.resolve(i)}else{i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownLoadFilePath:"+i);t.reject(i)}},100);return t.promise()}},{key:"JS_DeleteDownLoadFile",value:function bt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_DeleteDownLoadFile(e);setTimeout(function(){if(i){t.resolve(i)}else{i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_DeleteDownLoadFile:"+i);t.reject(i)}},100);return t.promise()}},{key:"JS_SycVideoAndAudio",value:function Ct(e,t,n){var i=zt.Deferred();var r=this;var o=zt(t).find("files").eq(0).text();var s=zt(n).find("files").eq(0).text();var a=""+e+"";a+=""+o+"";a+=""+s+"";a+="";var u=this.oPlugin.HWP_SycVideoAndAudio(a);setTimeout(function(){if(u){i.resolve(u)}else{u=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_SycVideoAndAudio:"+u);i.reject(u)}},100);return i.promise()}},{key:"JS_StopSycAudioPlay",value:function kt(e){var t=zt.Deferred();var n=this;var i=null;i=this.oPlugin.HWP_StopSycAudioPlay(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopSycAudioPlay:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetAudioPlayStatus",value:function Tt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetAudioPlayStatus(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetAudioPlayStatus:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopAudioPlay",value:function Rt(){var e=zt.Deferred();var t=this;var n=this.oPlugin.HWP_StopAudioPlay();setTimeout(function(){if(n<0){n=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopAudioPlay:"+n);e.reject(n)}else{e.resolve()}},100);return e.promise()}},{key:"JS_StartAudioSave",value:function Dt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StartAudioRecord(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartAudioRecord:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopAudioSave",value:function xt(){var e=zt.Deferred();var t=this;var n=this.oPlugin.HWP_StopAudioRecord();setTimeout(function(){if(n<0){n=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopAudioRecord:"+n);e.reject(n)}else{e.resolve()}},100);return e.promise()}},{key:"JS_GetAudioPlayedTime",value:function It(){var t=zt.Deferred();var n=-1;var i=this;n=this.oPlugin.HWP_GetAudioPlayedTime();setTimeout(function(){if(n<0||!n){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_GetAudioPlayedTime:"+e);t.reject()}else{t.resolve(n)}},100);return t.promise()}},{key:"JS_AudioPause",value:function Et(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_AudioPlayPasue();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_AudioPlayPasue:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_AudioResume",value:function qt(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_AudioPlayResume();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_AudioPlayPasue:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartAlarmChan",value:function At(e,t,n,i){return this.runPluginMethod("HWP_StartAlarmChan",[e,t,n],i)}},{key:"JS_StopAlarmChan",value:function Ot(e){return this.runPluginMethod("HWP_StopAlarmChan",[],e)}},{key:"JS_StartFormAsynUpload",value:function Mt(e,t){var n=typeof e==="undefined"?"undefined":Jt(e);var i="";if("object"===n){var r=new jt["default"].Builder;i=r.buildObject({UploadInfo:e})}else if("string"===n){i=e}else{return Promise.reject("")}return this.runPluginMethod("HWP_StartFormAsynUpload",[i],t)}},{key:"JS_StopFormAsynUpload",value:function Lt(e){return this.runPluginMethod("HWP_StopFormAsynUpload",[],e)}},{key:"JS_IsPluginExist",value:function Ft(){var e=false;var t=null;try{t=new ActiveXObject("WebVideoActiveX.WebVideoActiveXCtrl.1")}catch(n){t=null}if(null!==t){e=true}else{e=false}return e}},{key:"runPluginMethod",value:function Wt(e,t,n){var i=zt.Deferred();var r=this;var o={iRet:-1};var s=setTimeout(function(){i.reject(e+" time out ")},n);var a=void 0;Object.defineProperty(o,"iRet",{enumerable:true,configurable:true,set:function l(e){if(s){clearTimeout(s)}if(e<0){i.reject(e)}else{i.resolve(e)}a=e},get:function f(){return a}});try{if(this.oPlugin){switch(e){case"HWP_StartAlarmChan":o.iRet=this.oPlugin.HWP_StartAlarmChan(t[0],t[1],t[2]);break;case"HWP_StopAlarmChan":o.iRet=this.oPlugin.HWP_StopAlarmChan();break;case"HWP_StartFormAsynUpload":o.iRet=this.oPlugin.HWP_StartFormAsynUpload(t[0]);break;case"HWP_StopFormAsynUpload":o.iRet=this.oPlugin.HWP_StopFormAsynUpload();break;default:break}if(o.iRet<0){var u=r.oPlugin.HWP_GetLastError();r.ConsoleLog(e+":"+u)}}else{i.reject("without plugin")}}catch(c){r.ConsoleLog(e+":"+c);i.reject(c)}return i.promise()}},{key:"reactive",value:function Nt(e,t,n){var i=this;var r="__"+e+"Get";var o="__"+e+"Set";var s=void 0;Object.defineProperty(this,e,{get:function a(){zt(document.body).trigger(r,{value:s});if(t&&typeof t==="function"){return t.bind(i)(s)}return s},set:function u(e){zt(document.body).trigger(o,{oldValue:s,newValue:e});if(n&&typeof n==="function"){n.bind(i)(s,e)}else{s=e}}})}},{key:"JS_SetPicInfoToPlayer",value:function Bt(e,t,n,i){var r=zt.Deferred();var o=this.oPlugin.HWP_SetPicInfoToPlayer(e,t,n,i);var s=this;setTimeout(function(){if(o<0){o=s.oPlugin.HWP_GetLastError();r.reject(o)}else{r.resolve()}},100);return r.promise()}}]);return i}();return e}();i.ActiveXControl=n}).call(this,r(1))},function(e){e.exports=JSON.parse('{"version":"V1.0.0 build230210","playCrtl":"V7.4.0.1","pluginVersion":"V3.0.7.50","localServiceVersion":"V1.0.38"}')}])}); \ No newline at end of file +t.read=function(e,t,n,i,r){var o,s;var a=r*8-i-1;var u=(1<>1;var f=-7;var c=n?r-1:0;var h=n?-1:1;var d=e[t+c];c+=h;o=d&(1<<-f)-1;d>>=-f;f+=a;for(;f>0;o=o*256+e[t+c],c+=h,f-=8){}s=o&(1<<-f)-1;o>>=-f;f+=i;for(;f>0;s=s*256+e[t+c],c+=h,f-=8){}if(o===0){o=1-l}else if(o===u){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);o=o-l}return(d?-1:1)*s*Math.pow(2,o-i)};t.write=function(e,t,n,i,r,o){var s,a,u;var l=o*8-r-1;var f=(1<>1;var h=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:o-1;var p=i?1:-1;var v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){a=isNaN(t)?1:0;s=f}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-s))<1){s--;u*=2}if(s+c>=1){t+=h/u}else{t+=h*Math.pow(2,1-c)}if(t*u>=2){s++;u/=2}if(s+c>=f){a=0;s=f}else if(s+c>=1){a=(t*u-1)*Math.pow(2,r);s=s+c}else{a=t*Math.pow(2,c-1)*Math.pow(2,r);s=0}}for(;r>=8;e[n+d]=a&255,d+=p,a/=256,r-=8){}s=s<0;e[n+d]=s&255,d+=p,s/=256,l-=8){}e[n+d-p]|=v*128}},function(e,t,n){e.exports=r;var f=n(13).EventEmitter;var i=n(7);i(r,f);r.Readable=n(35);r.Writable=n(109);r.Duplex=n(110);r.Transform=n(111);r.PassThrough=n(112);r.Stream=r;function r(){f.call(this)}r.prototype.pipe=function(t,e){var n=this;function i(e){if(t.writable){if(false===t.write(e)&&n.pause){n.pause()}}}n.on("data",i);function r(){if(n.readable&&n.resume){n.resume()}}t.on("drain",r);if(!t._isStdio&&(!e||e.end!==false)){n.on("end",s);n.on("close",a)}var o=false;function s(){if(o)return;o=true;t.end()}function a(){if(o)return;o=true;if(typeof t.destroy==="function")t.destroy()}function u(e){l();if(f.listenerCount(this,"error")===0){throw e}}n.on("error",u);t.on("error",u);function l(){n.removeListener("data",i);t.removeListener("drain",r);n.removeListener("end",s);n.removeListener("close",a);n.removeListener("error",u);t.removeListener("error",u);n.removeListener("end",l);n.removeListener("close",l);t.removeListener("close",l)}n.on("end",l);n.on("close",l);t.on("close",l);t.emit("pipe",n);return t}},function(e,t){},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=n(16).Buffer;var i=n(105);function l(e,t,n){e.copy(t,n)}e.exports=function(){function e(){a(this,e);this.head=null;this.tail=null;this.length=0}e.prototype.push=function n(e){var t={data:e,next:null};if(this.length>0)this.tail.next=t;else this.head=t;this.tail=t;++this.length};e.prototype.unshift=function i(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length};e.prototype.shift=function t(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e};e.prototype.clear=function r(){this.head=this.tail=null;this.length=0};e.prototype.join=function o(e){if(this.length===0)return"";var t=this.head;var n=""+t.data;while(t=t.next){n+=e+t.data}return n};e.prototype.concat=function s(e){if(this.length===0)return u.alloc(0);if(this.length===1)return this.head.data;var t=u.allocUnsafe(e>>>0);var n=this.head;var i=0;while(n){l(n.data,t,i);i+=n.data.length;n=n.next}return t};return e}();if(i&&i.inspect&&i.inspect.custom){e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e}}},function(e,t){},function(e,t,n){(function(e,g){(function(n,i){"use strict";if(n.setImmediate){return}var r=1;var o={};var s=false;var a=n.document;var u;function e(e){if(typeof e!=="function"){e=new Function(""+e)}var t=new Array(arguments.length-1);for(var n=0;n"}this.oOptions.oId.html(""+this.szColorParam+"");this.oPlugin=this.oOptions.oId.find("#"+this.oOptions.szId+"_multiVideoActiveX")[0];if(this.oPlugin===null||typeof this.oPlugin==="undefined"){this.oPlugin=null}else if(this.oPlugin.object===null||typeof this.oPlugin.object==="undefined"){this.oPlugin=null}this.fCurrentCallback=null;this.afCurrentCallback=[];this.fPointCallback=null;this.iProtocolType=0;this.oPluginCallback={};this.szPluginVersion="V3.0.6.46";this.ConsoleLog=function(e){var t=sessionStorage.getItem("bDebugMode");if(t){console.log(e)}}}Ht(i,[{key:"JS_CreateWnd",value:function o(e,t,n){var i=this;var r=zt.Deferred();setTimeout(function(){i.oOptions.oId.html(""+this.szColorParam+"");i.oPlugin=i.oOptions.oId.find("#"+i.oOptions.szId+"_multiVideoActiveX")[0];if(i.oPlugin===null||i.oPlugin.object===null){i.oPlugin=null}r.resolve()},100);return r.promise()}},{key:"JS_ShowWnd",value:function n(){var e=this;var t=zt.Deferred();setTimeout(function(){zt("#"+e.oOptions.szId+"_multiVideoActiveX").show();t.resolve()},100);return t.promise()}},{key:"JS_HideWnd",value:function r(){var e=this;var t=zt.Deferred();setTimeout(function(){zt("#"+e.oOptions.szId+"_multiVideoActiveX").hide();t.resolve()},100);return t.promise()}},{key:"JS_SetWndCover",value:function t(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetWindowControlCallback",value:function s(e){var f=this;var t=f.oOptions.szIframeId&&zt("#"+f.oOptions.szIframeId).length?zt("#"+f.oOptions.szIframeId)[0].contentWindow:window;zt.extend(this.oPluginCallback,e);t.GetSelectWndInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("SelectWnd").eq(0).text(),10);if(0<=n){f.fCurrentCallback=f.afCurrentCallback[n]}if(f.oPluginCallback.onGetSelectWndInfo){f.oPluginCallback.onGetSelectWndInfo(n)}};t.PluginEventHandler=function(e,t,n){if(e===69){var i=f.oPlugin.HWP_GetDrawLineInfo(t);var r=Ut.oUtils.parseXmlFromStr(i);var o=[];zt(r).find("RegionCoordinates").each(function(){var e=parseFloat(zt(this).find("positionX").text());var t=1-parseFloat(zt(this).find("positionY").text());o.push([e,t])});var s="Line";if(o.length>3){s="Polygon"}if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:s,points:o})}}else if(e===14){f.oPluginCallback.onPluginEventHandler&&f.oPluginCallback.onPluginEventHandler(e,t)}else if(e===67){f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:"Line",event:"choosed"})}else if(e===68){var a="Polygon";if(0===parseInt(n,10)){a="Rect"}f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:a,event:"choosed"})}else if(e===70){var u="Polygon";if(0===parseInt(n,10)){u="Rect"}f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:u,event:"drawEnd"})}else{f.oPluginCallback.onPluginEventHandler&&f.oPluginCallback.onPluginEventHandler(t,e)}};t.ZoomInfoCallback=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=0;var r=0;var o=0;var s=0;i=parseInt(zt(t).find("StartPoint").eq(0).find("positionX").eq(0).text(),10)/255;r=parseInt(zt(t).find("StartPoint").eq(0).find("positionY").eq(0).text(),10)/255;o=parseInt(zt(t).find("EndPoint").eq(0).find("positionX").eq(0).text(),10)/255;s=parseInt(zt(t).find("EndPoint").eq(0).find("positionY").eq(0).text(),10)/255;n=[[i,r],[o,r],[o,s],[i,s]];if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:"Rect",points:n},e)}};t.EZoomInfoCallback=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=0;var r=0;var o=0;var s=0;i=parseInt(zt(t).find("StartPoint").eq(0).find("positionX").eq(0).text(),10)/255;r=parseInt(zt(t).find("StartPoint").eq(0).find("positionY").eq(0).text(),10)/255;o=parseInt(zt(t).find("EndPoint").eq(0).find("positionX").eq(0).text(),10)/255;s=parseInt(zt(t).find("EndPoint").eq(0).find("positionY").eq(0).text(),10)/255;n=[[i,r],[o,r],[o,s],[i,s]];if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:"Rect",points:n},e)}};t.GetFishPTZInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("infoType").eq(0).text(),10);var i=parseInt(zt(t).find("WndType").eq(0).text(),10);var r=zt(t).find("id").eq(0).text();var o=[parseFloat(zt(t).find("posX").eq(0).text()),parseFloat(zt(t).find("posY").eq(0).text())];var s=[parseFloat(zt(t).find("pos2X").eq(0).text()),parseFloat(zt(t).find("pos2Y").eq(0).text())];var a=parseInt(zt(t).find("pointSequence").eq(0).text(),10);var u=parseInt(zt(t).find("tracSequence").eq(0).text(),10);var l={type:n,windowType:i,id:r,position:o,originPosition:s,pointId:a,traceId:u};if(f.oPluginCallback.onFisheyePTZInfo){f.oPluginCallback.onFisheyePTZInfo(l)}};t.KeyBoardEvent=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("keyCode").eq(0).text(),10);if(n===27){if(f.oPluginCallback.onFullScreenChange){f.oPluginCallback.onFullScreenChange(false)}}};t.MouseEvent=function(e,t){var n=Ut.oUtils.parseXmlFromStr(e);var i=parseInt(zt(n).find("WndIndex").eq(0).text(),10);var r=parseInt(zt(n).find("EventType").eq(0).text(),10);var o=parseFloat(zt(n).find("Position").eq(0).find("x").eq(0).text());var s=parseFloat(zt(n).find("Position").eq(0).find("y").eq(0).text());if(f.oPluginCallback.onMouseEvent){f.oPluginCallback.onMouseEvent({wndIndex:i,eventType:r,point:[o,s],pluginID:t})}if(f.fPointCallback&&r===1){f.fPointCallback({id:1,eventType:r,point:[o,s]})}};t.SetZeroChanEnlarge=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("BeState").eq(0).text(),10);var i=parseInt(zt(t).find("MCP_x").eq(0).text(),10);var r=parseInt(zt(t).find("MCP_y").eq(0).text(),10);if(f.oPluginCallback.onZeroEnlargeState){f.oPluginCallback.onZeroEnlargeState({state:n,x:i,y:r})}};t.GetVoiceInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=zt(t).find("levlAngle").eq(0).text()?parseInt(zt(t).find("levlAngle").eq(0).text(),10):"";zt(t).find("voiceInfo").each(function(){var e=parseFloat(zt(this).find("dbValue").eq(0).text());n.push(e)});if(f.oPluginCallback.onGetVoiceInfo){if(i){f.oPluginCallback.onGetVoiceInfo([],i)}else{f.oPluginCallback.onGetVoiceInfo(n)}}}}},{key:"JS_ArrangeWindow",value:function a(e,t){var n=zt.Deferred();if(t&&t.length>0){var i='';zt.each(t,function(e,t){i+="\n "+(e+1)+"\n 0\n "+(t.dragable?1:0)+"\n 25500\n "+t.left+""+t.top+"\n "+t.width+""+t.height+"\n "+t.layer+"\n "});i+="";this.oPlugin.HWP_ArrangeCustomWindow(i)}else{this.oPlugin.HWP_ArrangeWindow(e)}setTimeout(function(){n.resolve()},100);return n.promise()}},{key:"JS_SetSecretKey",value:function u(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_SetSecretKey(n,t);setTimeout(function(){if(o<0){o=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_SetSecretKey:"+o);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_GetEncryptString",value:function l(e,t,n){var i=zt.Deferred();var r=0;var o=this;r=this.oPlugin.HWP_SetOriginalString(t,n,"");var s=this.oPlugin.HWP_GetEncryptString(e);setTimeout(function(){if(r<0){r=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetOriginalString:"+r);i.reject()}else{i.resolve(s)}},100);return i.promise()}},{key:"JS_GetDecryptString",value:function e(t,n,i){var r=this;var o=zt.Deferred();setTimeout(function(){if(!i){o.reject();return}var e=r.oPlugin.HWP_GetDecryptString(t,n,i);o.resolve(e)},100);return o.promise()}},{key:"JS_SetOriginalString",value:function f(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetOriginalString(e,t,"");setTimeout(function(){if(r<0){r=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetOriginalString:"+r);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_DestroyPlugin",value:function c(){var e=zt.Deferred();zt("#"+this.oOptions.szId+"_multiVideoActiveX").remove();this.oPlugin=null;this.oPluginCallback={};setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_Play",value:function h(e,t,n,i,r){var o=zt.Deferred();var s=this;var a=this.oPlugin.HWP_Play(e,t.auth,n,i,r);setTimeout(function(){if(a<0){a=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_Play:"+a);o.reject(a)}else{o.resolve()}},100);return o.promise()}},{key:"JS_Play2",value:function d(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_Play_V20(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_Play_V20:"+e);n.reject(r)}else{n.resolve(r)}},100);return n.promise()}},{key:"JS_OpenFileBrowser2",value:function p(e,t){if(!t){t=32}var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_OpenFileBrowser_V2(e,t);setTimeout(function(){if(r){n.resolve(r)}else{var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_OpenFileBrowser_V2:"+e);n.reject()}},100);return n.promise()}},{key:"JS_uploadFileByForm",value:function v(e){var t=-1;var n=zt.Deferred();var i=this;t=this.oPlugin.HWP_StartFormAsynUpload(e);setTimeout(function(){if(t===0){n.resolve(t)}else{var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_StartFormAsynUpload:"+e);n.reject(t)}},100);return n.promise()}},{key:"HWP_StopFormAsynUpload",value:function m(){var t=-1;var n=this;var i=zt.Deferred();t=this.oPlugin.HWP_StopFormAsynUpload();setTimeout(function(){if(t===0){i.resolve(t)}else{var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFormAsynUpload:"+e);i.reject(t)}},100);return i.promise()}},{key:"JS_ReversePlay",value:function y(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_ReversePlay(e,t.auth,n,i,r);setTimeout(function(){if(a<0){a=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_ReversePlay:"+a);s.reject(a)}else{s.resolve()}},100);return s.promise()}},{key:"JS_Stop",value:function g(e){var t=zt.Deferred();var n=this;if(!(this&&this.oPlugin)){t.reject()}else{try{var i=this.oPlugin.HWP_Stop(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Stop:"+e);t.reject()}else{t.resolve()}},100)}catch(r){n.ConsoleLog("HWP_Stop:"+r);t.reject(r)}}return t.promise()}},{key:"JS_Seek",value:function P(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_StopRealPlayAll",value:function w(){var e=zt.Deferred();var t=this.oPlugin.StopRealPlayAll();setTimeout(function(){if(t<0){e.reject()}else{e.resolve()}},100);return e.promise()}},{key:"JS_Pause",value:function S(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Pause(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Pause:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Resume",value:function _(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Resume(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Resume:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Slow",value:function b(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Slow(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Slow:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Fast",value:function C(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Fast(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Fast:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Transmission",value:function k(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_FrameForward",value:function T(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_FrameForward(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FrameForward:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetOSDTime",value:function R(e){var t=zt.Deferred();var n=-1;var i=this;n=this.oPlugin.HWP_GetOSDTime(e);setTimeout(function(){if(n<0||!n){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_GetOSDTime:"+n+";HWP_GetLastError:"+e);t.reject()}else{t.resolve(n)}},100);return t.promise()}},{key:"JS_OpenSound",value:function D(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_OpenSound(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_OpenSound:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_CloseSound",value:function x(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_CloseSound();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_CloseSound:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetVolume",value:function I(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetVolume(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetVolume:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_SetVolume",value:function E(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetVolume(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetVolume:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetAudioVolume",value:function q(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetAudioVolume(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetAudioVolume:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_EnableZoom",value:function A(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_EnableZoom(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_EnableZoom:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_DisableZoom",value:function O(e){var t=zt.Deferred();this.oPlugin.HWP_DisableZoom(e);var n=this;setTimeout(function(){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_DisableZoom:"+e);t.resolve()},100);return t.promise()}},{key:"JS_CapturePicture",value:function M(e,t){var n=this;var i=zt.Deferred();t=t.replace(/playback_/g,"");var r=n.oPlugin.HWP_CapturePicture(e,t);setTimeout(function(){if(r<0){r=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_CapturePicture:"+r);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StartSave",value:function L(e,t){var n=this;var i=zt.Deferred();var r=n.oPlugin.HWP_StartSave(e,t);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartSave:"+e);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StopSave",value:function F(e){var t=this;var n=zt.Deferred();var i=this.oPlugin.HWP_StopSave(e);setTimeout(function(){if(i<0){var e=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopSave:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_StartTalk",value:function W(e,t,n,i,r,o,s,a,u,l){var f=zt.Deferred();var c=void 0;var h=this;if(typeof l==="undefined"){c=this.oPlugin.HWP_StartVoiceTalk_V20(e,t,n,i,r,o,s,a,u)}else{c=this.oPlugin.HWP_StartVoiceTalk_V20Ex(e,t,n,i,r,o,s,a,u,l?l:0)}setTimeout(function(){if(c<0){var e=h.oPlugin.HWP_GetLastError();var t=typeof l==="undefined"?"HWP_StartVoiceTalk_V20":"HWP_StartVoiceTalk_V20Ex";h.ConsoleLog(t+":"+e);f.reject()}else{f.resolve()}},100);return f.promise()}},{key:"JS_StopTalk",value:function N(){var e=zt.Deferred();this.oPlugin.HWP_StopVoiceTalk();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetPlayMode",value:function B(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlayModeType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlayModeType:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetFullScreenCapability",value:function z(t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetCanFullScreen(t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetCanFullScreen:"+t+";HWP_GetLastError:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_FullScreenDisplay",value:function J(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_FullScreenDisplay(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FullScreenDisplay:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_EnableIVS",value:function H(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_EnableIVS(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_EnableIVS:"+e);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_SRInit",value:function U(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SR_Init(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SR_Init:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SRPTZ",value:function j(e,t,n){var i=zt.Deferred();var r=this;var o=0;if(t===4||t===5){o=this.oPlugin.HWP_SR_Zoom(e,5-t,n)}else{o=this.oPlugin.HWP_SR_PTZ(e,t,n)}setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();if(t===4||t===5){r.ConsoleLog("HWP_SR_Zoom:"+e)}else{r.ConsoleLog("HWP_SR_PTZ:"+e)}i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_SetPlaybackDrawType",value:function G(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetPlaybackDrawType(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetPlaybackDrawType:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetPlayBackType",value:function V(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlayBackType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlayBackType:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetTrsPlayBackParam",value:function Y(e,t){var n=zt.Deferred();var i=this;var r=''+""+t.transBitrate+""+""+t.transFrameRate+""+""+t.transResolution+"";var o=this.oPlugin.HWP_SetTrsPlayBackParam(e,r);setTimeout(function(){if(o<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetTrsPlayBackParam:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_GetLocalConfig",value:function X(){var t=this;var n=zt.Deferred();var e=this.oPlugin.HWP_GetLocalConfig();var i=Ut.oUtils.parseXmlFromStr(e);var r={protocolType:zt(i).find("ProtocolType").eq(0).text(),streamType:zt(i).find("StreamType").eq(0).text(),packgeSize:zt(i).find("PackgeSize").eq(0).text(),playWndType:zt(i).find("PlayWndType").eq(0).text(),buffNumberType:zt(i).find("BuffNumberType").eq(0).text(),recordPath:zt(i).find("RecordPath").eq(0).text(),capturePath:zt(i).find("CapturePath").eq(0).text(),playbackFilePath:zt(i).find("PlaybackFilePath").eq(0).text(),playbackPicPath:zt(i).find("PlaybackPicPath").eq(0).text(),downloadPath:zt(i).find("DownloadPath").eq(0).text(),snapScenePicPath:zt(i).find("SnapScenePicPath").eq(0).text(),snapViewPicPath:zt(i).find("SnapViewPicPath").eq(0).text(),ivsMode:zt(i).find("IVSMode").eq(0).text(),realPlayAll:zt(i).find("RealPlayAll").eq(0).text(),captureFileFormat:zt(i).find("CaptureFileFormat").eq(0).text(),osdPosInfo:zt(i).find("OSDPosInfo").eq(0).text(),osdPicInfo:zt(i).find("OSDPicInfo").eq(0).text(),showWizard:zt(i).find("ShowWizard").eq(0).text(),secretKey:zt(i).find("SecretKey").eq(0).text(),showFireBox:zt(i).find("ShowFireBox").eq(0).text(),showFireDistance:zt(i).find("ShowFireDistance").eq(0).text(),showFireMaxTemperature:zt(i).find("ShowFireMaxTemp").eq(0).text(),showFireMaxTemperaturePos:zt(i).find("ShowFireMaxTempPos").eq(0).text(),showTemperaturePoint:zt(i).find("ShowTemPoint").eq(0).text(),showTemperatureLine:zt(i).find("ShowTemLine").eq(0).text(),showTemperatureBox:zt(i).find("ShowTemBox").eq(0).text(),captureIncludeTemperatureInfo:zt(i).find("CaptureTemp").eq(0).text(),customBuffNumber:zt(i).find("CustomBuffNumber").eq(0).text(),faceSnapPicPath:zt(i).find("FaceSnapPicPath").eq(0).text(),d3dCapture:zt(i).find("D3DCapture").eq(0).text(),HumanTrack:zt(i).find("HumanTrack").eq(0).text(),VehicleTrack:zt(i).find("VehicleTrack").eq(0).text(),RenderTrack:zt(i).find("RenderTrack").eq(0).text(),shieldMask:zt(i).find("ShieldMask").eq(0).text(),wasteGasDection:zt(i).find("WasteGasDection").eq(0).text(),gasInfo:zt(i).find("GasInfo").eq(0).text(),audioDownloadPath:zt(i).find("AudioDownloadPath").eq(0).text(),audioRecordPath:zt(i).find("AudioRecordPath").eq(0).text(),picOrRegionFill:zt(i).find("PicOrRegionFill").eq(0).text()};t.iProtocolType=parseInt(r.protocolType,10);setTimeout(function(){if(!r){var e=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_GetLocalConfig:"+e);n.reject()}else{n.resolve(r)}},100);return n.promise()}},{key:"JS_SetLocalConfig",value:function Z(t){var n=this;var i=zt.Deferred();var e=''+""+t.protocolType+""+t.streamType+""+""+t.packgeSize+""+t.playWndType+""+""+t.buffNumberType+""+t.recordPath+""+""+t.capturePath+""+t.playbackFilePath+""+""+t.playbackPicPath+""+t.downloadPath+""+""+t.snapScenePicPath+""+t.snapViewPicPath+""+""+t.ivsMode+""+t.realPlayAll+""+""+t.captureFileFormat+""+t.osdPosInfo+""+""+t.osdPicInfo+""+t.showWizard+""+""+t.secretKey+""+t.showFireBox+""+""+t.showFireDistance+""+t.showFireMaxTemperature+""+""+t.showFireMaxTemperaturePos+""+t.showTemperaturePoint+""+""+t.showTemperatureLine+""+t.showTemperatureBox+""+""+t.captureIncludeTemperatureInfo+""+""+t.customBuffNumber+""+""+t.faceSnapPicPath+""+""+t.HumanTrack+""+""+t.VehicleTrack+""+""+t.RenderTrack+""+""+t.shieldMask+""+""+t.wasteGasDection+""+""+t.gasInfo+""+""+t.audioDownloadPath+""+""+t.audioRecordPath+""+""+t.picOrRegionFill+""+"";var r=this.oPlugin.HWP_SetLocalConfig(e);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetLocalConfig:"+e);i.reject()}else{n.iProtocolType=parseInt(t.protocolType,10);i.resolve()}},100);return i.promise()}},{key:"JS_GetLastError",value:function K(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetLastError();setTimeout(function(){if(t<0){e.reject()}else{e.resolve(t)}},100);return e.promise()}},{key:"JS_OpenFileBrowser",value:function $(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_OpenFileBrowser(e,t);setTimeout(function(){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_OpenFileBrowser:"+e);n.resolve(r)},100);return n.promise()}},{key:"JS_OpenDirectory",value:function Q(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_OpenDirectory(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_OpenFileBrowser:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartAsynUpload",value:function ee(e,t,n,i){var r=zt.Deferred();var o=this;var s=this.oPlugin.HWP_StartAsynUpload(e,t,n,i,0);setTimeout(function(){if(s<0){s=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_OpenFileBrowser:"+s);r.reject(s)}else{r.resolve()}},100);return r.promise()}},{key:"JS_StopAsynUpload",value:function te(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopAsynUpload();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopAsynUpload:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetUploadErrorInfo",value:function ne(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetUploadErrorInfo();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_UploadFile",value:function ie(e,t,n,i){var r=this;var o=zt.Deferred();var s=r.oPlugin.HWP_UploadFile(e,t,n,i,0);setTimeout(function(){if(s<0){var e=r.oPlugin.HWP_GetHttpErrorInfo();s=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_UploadFile:"+s);r.ConsoleLog("HWP_GetHttpErrorInfo:"+e);o.reject({readyState:4,status:s,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null,errorInfo:e})}else{o.resolve()}},100);return o.promise()}},{key:"JS_GetIpcImportErrorInfo",value:function re(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetIpcImportErrorInfo();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_DownloadFile",value:function oe(e,t,n,i,r,o){var s=this;var a=zt.Deferred();var u=0;if(i===2){u=this.oPlugin.HWP_ExportFile(e,t,n,i,o)}else{u=this.oPlugin.HWP_ExportDeviceConfig(e,t,"",r)}setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetHttpErrorInfo();u=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_GetHttpErrorInfo:"+e);if(i===2){s.ConsoleLog("HWP_ExportFile:"+u)}else{s.ConsoleLog("HWP_ExportDeviceConfig:"+u)}a.reject({readyState:4,status:u,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null})}else{a.resolve(u)}},100);return a.promise()}},{key:"JS_DownloadFileNoPlugin",value:function se(t){var e=new Promise(function(e){zt("body").append('
  • ');zt("#jsplugin_download_li").trigger("click");zt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_StartUpgrade",value:function ae(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_StartUpgradeEx(e,t,n,i,r,"");if(a<0){a=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_StartUpgradeEx:"+a);if(a===10){var u=void 0;try{u=o.oPlugin.HWP_GetProtectModeWithoutAdmin()}catch(l){u=-1}if(u===1){s.reject(605)}else{s.reject(a)}}else{s.reject(a)}}else{s.resolve()}return s.promise()}},{key:"JS_StopUpgrade",value:function ue(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopUpgrade();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopUpgrade:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetUpgradeStatus",value:function le(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_UpgradeStatus();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_UpgradeStatus:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_GetUpgradeProgress",value:function fe(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_UpgradeStatus();if(i>=0){i=this.oPlugin.HWP_UpgradeProgress()}setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_UpgradeProgress:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_ExportDeviceLog",value:function ce(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_ExportDeviceLog(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ExportDeviceLog:"+e);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_ExportReport",value:function he(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_ExportReport(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ExportReport:"+e);i.reject()}else{i.resolve({status:o})}},100);return i.promise()}},{key:"JS_StartAsyncDownload",value:function de(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_StartDownloadEx(e,t,n,i,r?r:"");setTimeout(function(){if(a<0){a=o.oPlugin.HWP_GetLastError();var e=o.oPlugin.HWP_GetHttpErrorInfo();o.ConsoleLog("HWP_ExportReport:"+a);o.ConsoleLog("HWP_GetHttpErrorInfo:"+e);s.reject({readyState:4,status:a,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null})}else{s.resolve(a)}},100);return s.promise()}},{key:"JS_StopAsyncDownload",value:function pe(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopDownload(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopDownload:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetDownloadStatus",value:function ve(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownloadStatus(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownloadStatus:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_GetDownloadProgress",value:function me(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownloadStatus(e);if(i>=0){i=this.oPlugin.HWP_GetDownloadProgress(e)}setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownloadProgress:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_EnablePDC",value:function ye(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_EnablePDC(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_EnablePDC:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_Resize",value:function ge(){var t=zt.Deferred();var n=this;setTimeout(function(){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_EnablePDC:"+e);t.resolve()},100);return t.promise()}},{key:"JS_SetDrawCallback",value:function Pe(t,e,n,i,r,o){var s=this;var a=zt.Deferred();s.fCurrentCallback=null;s.afCurrentCallback[t]=null;s.fPointCallback=null;var u=0;var l=0;var f="";if(n!=="Rect"){if(n==="Line"){l=2}else if(n==="Polygon"){l=4}else if(n==="Point"){var c="";c+="1";c+="1";c+="002552";c+="";u=this.oPlugin.HWP_SetSnapPointInfo(0,c);f="HWP_SetSnapPointInfo";setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetLastError();s.ConsoleLog(f+":"+e);a.reject()}else{s.fPointCallback=r;a.resolve()}},100);return a.promise()}else{l=0}if(e){f="HWP_SetPlaybackDrawType";u=s.oPlugin.HWP_SetPlaybackDrawType(t,l)}else{f="HWP_ClearDrawLineInfo";u=s.oPlugin.HWP_ClearDrawLineInfo(t)}}else{if(e){var h=1;if(o&&o.mode>=0){h=o.mode}u=s.oPlugin.HWP_EnableZoom(t,h);f="HWP_EnableZoom"}else{s.oPlugin.HWP_DisableZoom(t);f="HWP_DisableZoom"}}setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetLastError();s.ConsoleLog(f+":"+e);a.reject()}else{s.fCurrentCallback=r;s.afCurrentCallback[t]=r;a.resolve()}},100);return a.promise()}},{key:"JS_SetDrawStatus",value:function we(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=zt.Deferred();var r=0;r=this.oPlugin.HWP_SetDrawStatus(e);if(e){if(t){r=this.oPlugin.HWP_SetSnapDrawMode(n,t)}else{r=this.oPlugin.HWP_SetSnapDrawMode(n,3)}}else{r=this.oPlugin.HWP_SetSnapDrawMode(n,-1)}setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_ClearRegion",value:function Se(){var e=zt.Deferred();var t=this.oPlugin.HWP_ClearRegion();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_SetDrawShapeInfo",value:function _e(e,t){var n=zt.Deferred();var i=0;var r=this;var o="";if(e==="Rect"){i=this.oPlugin.HWP_SetSnapDrawMode(0,1);o="HWP_SetSnapDrawMode";if(i>=0){if(t.type===0){var s="PALroi";s+="704"+"576"+""+(t.translucent!==1?"transparent":"shelter")+""+""+t.maxShapeSupport+"";i=this.oPlugin.HWP_SetRegionInfo(s);o="HWP_SetRegionInfo"}else if(t.type===1){var a="";a+="";a+=""+t.id+"";a+=""+t.tips+"";a+=""+(t.tipsPos||0)+"";a+="false";a+="0";a+=""+t.widthHeightRate+"";a+="";a+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";a+="";a+="";i=this.oPlugin.HWP_SetSnapPolygonInfo(a);o="HWP_SetSnapPolygonInfo"}}}else if(e==="Grid"){i=this.oPlugin.HWP_SetSnapDrawMode(0,1);o="HWP_SetSnapDrawMode";if(i>=0){var u="PAL";u+="grid"+t.gridRowNum+"";u+=""+t.gridColNum+"";u+="transparent";i=this.oPlugin.HWP_SetRegionInfo(u);o="HWP_SetRegionInfo"}}else if(e==="Polygon"){i=this.oPlugin.HWP_SetSnapDrawMode(0,2);o="HWP_SetSnapDrawMode";if(i>=0){var l="";l+="";l+=""+t.id+"";l+=""+t.tips+"";l+="false";l+="1";l+=""+(t.maxPointSupport+1)+"";l+=""+(t.minPointSupport+1)+"";l+="";l+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";l+="";l+="";i=this.oPlugin.HWP_SetSnapPolygonInfo(l);o="HWP_SetSnapPolygonInfo"}}else if(e==="Line"){var f='';f+="";f+=""+t.id+"";f+=""+t.editType+"";f+=""+t.lineType+"";f+=""+t.tips+"";f+=""+t.direction+""+t.mode+"";if(t.lineType!==2){f+=""+t.direction+"";f+=""+t.points[0][0]+""+t.points[0][1]+""+t.points[1][0]+""+t.points[1][1]+""}else{f+=""+(!t.direction?0:t.direction-1)+"";f+="";var c=t.points&&t.points.length;if(c>0){f+="";for(var h=0;h"+t.points[h][0]+""+t.points[h][1]+""}f+=""}f+=""+(c>0).toString()+"";f+=""+(t.direction===0?"false":"true")+"";if(t.minClosed){f+=""+t.minClosed+""}if(t.pointNumMax){f+=""+t.pointNumMax+""}if(t.directionTips){f+=""+t.directionTips+""}f+=""}f+="false";f+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";f+="";f+="";i=this.oPlugin.HWP_SetSnapLineInfo(f);o="HWP_SetSnapLineInfo"}else if(e==="Point"){var d="";var p=!t.replace?0:1;d+=""+p+"";d+="";if(t.id){d+=""+t.id+""}if(t.type){d+=""+(t.type==="cross"?1:2)+""}if(t.drawColor){var v=Ut.oUtils.colorRgb(t.drawColor);d+="";d+=""+v[0]+"";d+=""+v[1]+"";d+=""+v[2]+"";d+=""}d+="";d+="";i=this.oPlugin.HWP_SetSnapPointInfo(0,d);o="HWP_SetSnapPointInfo";return d}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetGridInfo",value:function be(e){var t=zt.Deferred();var n=this;var i="PAL";i+="grid"+e.gridRowNum+"";i+=""+e.gridColNum+"";i+="transparent"+e.gridMap+"";var r=this.oPlugin.HWP_SetRegionInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetRegionInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetGridInfo",value:function Ce(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetRegionInfo();var n=Ut.oUtils.parseXmlFromStr(t);var i=parseInt(zt(n).find("columnGranularity").text(),10);var r=parseInt(zt(n).find("rowGranularity").text(),10);var o={gridColNum:i,gridRowNum:r,gridMap:zt(n).find("gridMap").text()};setTimeout(function(){e.resolve(o)},100);return e.promise()}},{key:"JS_SetRectInfo",value:function ke(t){var n=zt.Deferred();var i=-1;var r=this;var o="";if(t[0].type===0){var s="PALroi";var e="transparent";if(t[0].translucent===1){e="shelter"}else if(t[0].translucent===2){e="quadrilateral"}s+="704"+"576"+""+e+""+"";zt.each(t,function(e){s+="";s+="";zt.each(t[e].points,function(e,t){s+=""+Math.round(t[0]*704)+""+""+Math.round((1-t[1])*576)+""});s+="";s+=""});s+=""+t[0].maxShapeSupport+"";i=this.oPlugin.HWP_SetRegionInfo(s);o="HWP_SetRegionInfo"}else if(t[0].type===1){var a="";zt.each(t,function(e,t){a+="";a+=""+t.id+"";a+=""+(t.editType||0)+"";a+=""+(t.tips||"")+"";a+=""+(t.tipsPos||0)+"";a+="true";a+="0";a+=""+t.widthHeightRate+"";a+="";zt.each(t.points,function(e,t){a+=""+t[0]+""+t[1]+""});a+="";a+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";a+=""});a+="";i=this.oPlugin.HWP_SetSnapPolygonInfo(a);o="HWP_SetSnapPolygonInfo"}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_GetRectInfo",value:function Te(){var e=zt.Deferred();var n=[];var t=this.oPlugin.HWP_GetRegionInfo();var i=Ut.oUtils.parseXmlFromStr(t);zt(i).find("DetectionRegion").each(function(e){var t=[];zt(this).find("RegionCoordinatesList").find("RegionCoordinates").each(function(){t.push([parseInt(zt(this).find("positionX").text(),10)/704,1-parseInt(zt(this).find("positionY").text(),10)/576])});n.push({id:e+1,points:t})});var s=[];var r=this.oPlugin.HWP_GetSnapPolygonInfo();var o=Ut.oUtils.parseXmlFromStr(r);zt(o).find("SnapPolygon").each(function(){var e=parseInt(zt(this).find("polygonType").text(),10);if(e===0){var t=zt(this).find("id").text();var n=zt(this).find("isClosed").text()==="true";var i=zt(this).find("tips").text();var r=[];zt(this).find("pointList").find("point").each(function(){r.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});var o={id:t,closed:n,points:r,tips:i};s.push(o)}});setTimeout(function(){if(n.length>0){e.resolve(n)}else if(s.length>0){e.resolve(s)}else{e.resolve([])}},100);return e.promise()}},{key:"JS_SetPolygonInfo",value:function Re(e){var t=zt.Deferred();var n=this;var i="";zt.each(e,function(e,t){if(typeof t.closed==="undefined"){t.closed=true}i+="";i+=""+t.id+"";i+=""+t.editType+"";i+=""+t.tips+"";i+=""+t.closed.toString()+"";i+="1";i+="";zt.each(t.points,function(e,t){i+=""+t[0]+""+t[1]+""});i+="";i+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";i+=""});i+="";var r=this.oPlugin.HWP_SetSnapPolygonInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetSnapPolygonInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetPolygonInfo",value:function De(){var e=zt.Deferred();var l=[];var t=this.oPlugin.HWP_GetSnapPolygonInfo();var n=Ut.oUtils.parseXmlFromStr(t);zt(n).find("SnapPolygon").each(function(){var e=parseInt(zt(this).find("polygonType").text(),10);if(e===1){var t=zt(this).find("id").text();var n=zt(this).find("isClosed").text()==="true";var i=zt(this).find("tips").text();var r="#"+Ut.oUtils.colorTransfer(zt(this).find("r").text())+Ut.oUtils.colorTransfer(zt(this).find("g").text())+Ut.oUtils.colorTransfer(zt(this).find("b").text());var o=parseInt(zt(this).find("PointNumMax").text(),10);var s=parseInt(zt(this).find("MinClosed").text(),10);var a=[];zt(this).find("pointList").find("point").each(function(){a.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});var u={id:t,points:a,closed:n,tips:i,drawColor:r,polygonType:e,pointNumMax:o,minClosed:s};l.push(u)}});setTimeout(function(){e.resolve(l)},100);return e.promise()}},{key:"JS_SetLineInfo",value:function xe(e){var t=zt.Deferred();var n=this;var r='';zt.each(e,function(e,t){r+="";r+=""+t.id+"";r+=""+t.editType+"";r+=""+t.lineType+"";r+=""+t.tips+"";if(t.lineType!==2){r+=""+t.mode+"";r+=""+t.direction+""+t.direction+""+t.points[0][0]+""+t.points[0][1]+""+t.points[1][0]+""+t.points[1][1]+"";if(t.cutOffPositions){r+="true";zt.each(t.cutOffPositions,function(e,t){r+=""+t+""});r+=""}}else{r+=""+(!t.direction?0:t.direction-1)+"";var n=t.points.length;for(var i=0;i"+t.points[i][0]+""+t.points[i][1]+""}r+=""+(n>0).toString()+"";r+=""+(t.direction===0?"false":"true")+"";if(t.minClosed){r+=""+t.minClosed+""}if(t.pointNumMax){r+=""+t.pointNumMax+""}if(t.directionTips){r+=""+t.directionTips+""}r+=""}r+="false";r+=""+Ut.oUtils.colorRgb(t.drawColor)[0]+""+Ut.oUtils.colorRgb(t.drawColor)[1]+""+Ut.oUtils.colorRgb(t.drawColor)[2]+"";r+=""});r+="";var i=this.oPlugin.HWP_SetSnapLineInfo(r);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetSnapPolygonInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetLineInfo",value:function Ie(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetSnapLineInfo();var n=Ut.oUtils.parseXmlFromStr(t);var p=[];zt(n).find("SnapLine").each(function(){var e=parseInt(zt(this).find("id").text(),10);var t=parseInt(zt(this).find("LineTypeEx").text(),10);var n=zt(this).find("tips").text();var i=void 0;if(t===3){i=parseInt(zt(this).find("CustomType").text(),10)||parseInt(zt(this).find("LineType").text(),10)}else if(t===1||t===4){i=parseInt(zt(this).find("ArrowType").text(),10)}else if(t===2){var r=parseInt(zt(this).find("ArrowType").text(),10);if(isNaN(r)){r=1}else{r+=1}i=r}var o=[];var s=[];var a=[];var u=false;var l=[];var f=false;var c=false;var h={bShow:false,aPoints:[]};if(t!==2){o.push([parseFloat(zt(this).find("StartPos").find("x").text()),parseFloat(zt(this).find("StartPos").find("y").text())]);o.push([parseFloat(zt(this).find("EndPos").find("x").text()),parseFloat(zt(this).find("EndPos").find("y").text())]);if(t===4){s.push([parseFloat(zt(this).find("Demarcation").find("Sp_x").text()),parseFloat(zt(this).find("Demarcation").find("Sp_y").text())]);s.push([parseFloat(zt(this).find("Demarcation").find("Ep_x").text()),parseFloat(zt(this).find("Demarcation").find("Ep_y").text())]);a.push([parseFloat(zt(this).find("PDCArrow").find("Sp_x").text()),parseFloat(zt(this).find("PDCArrow").find("Sp_y").text())]);a.push([parseFloat(zt(this).find("PDCArrow").find("Ep_x").text()),parseFloat(zt(this).find("PDCArrow").find("Ep_y").text())]);u="true"===zt(this).find("PDCShowMark").text()}if(t===5){h.bShow=true;h.aPoints.length=0;zt(this).find("PN_Width").each(function(){h.aPoints.push(parseFloat(zt(this).text()))})}}else{zt(this).find("BreakLine").find("point").each(function(){o.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});f="true"===zt(this).find("isShowArrow").text();c="true"===zt(this).find("isClosed").text();if(f){zt(this).find("BreakLine").find("BLArrow").each(function(){l.push([[parseFloat(zt(this).find("Sp_x").text()),parseFloat(zt(this).find("Sp_y").text())],[parseFloat(zt(this).find("Ep_x").text()),parseFloat(zt(this).find("Ep_y").text())]])})}}var d={id:e,lineType:t,tips:n,points:o,direction:i,demarcation:s,pdcArrow:a,showMark:u,showArrow:f,arrowList:l,bClosed:c};if(h.bShow){d.cutOffPositions=h.aPoints}p.push(d)});setTimeout(function(){e.resolve(p)},100);return e.promise()}},{key:"JS_SetTextOverlay",value:function Ee(e){var t=zt.Deferred();var n=this;var i=e.channelName.name.replace(/&/g,"&");i=i.replace(/"+r+""+o+""+""+e.channelName.enable+""+i+""+""+e.channelName.alignment+""+""+e.minMoveValue+""+""+Math.round(e.channelName.point[0]*r)+""+""+Math.round(e.channelName.point[1]*o)+""+""+e.date.enable+""+e.date.dateType+""+""+e.date.timeFormat+""+e.date.showWeekDay+""+""+e.date.alignment+""+""+e.minMoveValue+""+""+Math.round(e.date.point[0]*r)+""+""+Math.round(e.date.point[1]*o)+""+"";for(var a=0,u=e.text.length;a";s+=""+e.text[a].id+""+e.text[a].enable+""+""+e.text[a].alignment+""+""+e.minMoveValue+""+""+Math.round(e.text[a].point[0]*r)+""+""+Math.round(e.text[a].point[1]*o)+""+""+l+"";s+=""}s+="";var f=this.oPlugin.HWP_SetTextOverlay(s);setTimeout(function(){if(f<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetTextOverlay:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetTextOverlay",value:function qe(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetTextOverlay();var n=Ut.oUtils.parseXmlFromStr(t);var i={};var r=zt(n).find("channelNameOverlay").eq(0);var o=zt(n).find("DateTimeOverlay").eq(0);var s=zt(n).find("TextOverlayList").eq(0);var a=parseInt(zt(n).find("videoResolutionWidth").eq(0).text(),10);var u=parseInt(zt(n).find("videoResolutionHeight").eq(0).text(),10);i.channelName={enable:zt(r).find("enabled").eq(0).text()==="true",name:zt(r).find("name").eq(0).text(),alignment:0,point:[zt(r).find("positionX").eq(0).text()/a,zt(r).find("positionY").eq(0).text()/u]};i.date={enable:zt(o).find("enabled").eq(0).text()==="true",alignment:parseInt(zt(o).find("alignment").eq(0).text(),10)||0,dateType:parseInt(zt(o).find("type").eq(0).text(),10)||0,timeFormat:zt(o).find("clockType").eq(0).text(),showWeekDay:zt(o).find("displayWeek").eq(0).text()==="true",point:[zt(o).find("positionX").eq(0).text()/a,zt(o).find("positionY").eq(0).text()/u]};i.text=[];for(var l=0,f=zt(s).find("TextOverlay").length;l0&&(o===0||o===1)){var s='';for(var a=0,u=e.length;a"+e[a]+""+o+""}s+="";i=this.oPlugin.HWP_ClearTargetPolygon(s);setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ClearTargetPolygon:"+e);n.reject()}else{n.resolve()}},100)}else{i=this.oPlugin.HWP_ClearSnapInfo(o);setTimeout(function(){if("Choosed"===t){n.resolve(i);return}if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ClearSnapInfo:"+e);n.reject()}else{n.resolve(i)}},100)}return n.promise()}},{key:"JS_SetCorrectionType",value:function Oe(e){var t=zt.Deferred();var n=0;var i=this;if(e===1){n=this.oPlugin.HWP_SetPlayModeType(7)}else{n=this.oPlugin.HWP_SetPlayModeType(7)}n=this.oPlugin.HWP_SetCorrectionType(e);setTimeout(function(){if(n<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetCorrectionType:"+e);t.reject(n)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetPlaceType",value:function Me(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlaceType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlaceType:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFishListener",value:function Le(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_StartFishListener(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_StartFishListener:"+e);i.reject(o)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StopFishListener",value:function Fe(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFishListener();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFishListener:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetFishBoxListInfo",value:function We(e){var t=zt.Deferred();var n=this;var i='';zt.each(e,function(e,t){i+="";i+=""+t.id+"";i+=""+t.xPoint+"";i+=""+t.yPoint+"";i+=""+t.zPoint+"";i+=""});i+="";var r=this.oPlugin.HWP_SetFishBoxListInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetFishBoxListInfo:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetFishBoxListInfo",value:function Ne(){var e=zt.Deferred();var t=this.oPlugin.HWP_FECGetBoxPosList();var n=Ut.oUtils.parseXmlFromStr(t);var r=[];zt(n).find("PointPos").each(function(){var e=parseInt(zt(this).find("id").text(),10);var t=parseFloat(zt(this).find("xPoint").text());var n=parseFloat(zt(this).find("yPoint").text());var i=parseFloat(zt(this).find("zPoint").text());r.push({id:e,xPoint:t,yPoint:n,zPoint:i})});setTimeout(function(){e.resolve(r)},100);return e.promise()}},{key:"JS_ClearAllWndFishBoxInfo",value:function Be(){var e=zt.Deferred();this.oPlugin.HWP_ClearAllWndFishBoxInfo();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetFishWndProperty",value:function ze(e,t,n){var i=zt.Deferred();var r=this.oPlugin.HWP_SetFishWndPty(e,t,n);var o=this;setTimeout(function(){if(r<0){var e=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetFishWndPty:"+e);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_SetFishParams",value:function Je(e,t,n,i){var r=zt.Deferred();var o=this;var s='';s+=""+e+"";s+=""+t+"";s+=""+n+"";s+=""+i+"";s+="";var a=this.oPlugin.HWP_SetFishParams(s);setTimeout(function(){if(a<0){var e=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetFishParams:"+e);r.reject(a)}else{r.resolve()}},100);return r.promise()}},{key:"JS_ArrangeFECWindow",value:function He(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_ArrangeFECWindow(e,"");setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_ArrangeFECWindow:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFECScan",value:function Ue(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StartFECScan(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFECScan:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopFECScan",value:function je(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFECScan();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFECScan:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_FishEyePTZ",value:function Ge(e,t){var n=zt.Deferred();var i=0;var r=this;var o="";if(e===4){i=this.oPlugin.HWP_FECZoomIn(t);o="HWP_FECZoomIn"}else if(e===5){i=this.oPlugin.HWP_FECZoomOut(t);o="HWP_FECZoomOut"}else{i=this.oPlugin.HWP_FECPTZ(t);o="HWP_FECPTZ"}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject(i)}else{n.resolve()}},100);return n.promise()}},{key:"JS_FishEyeGetPreset",value:function Ve(){var e=zt.Deferred();var t=this.oPlugin.HWP_FECGetPreset();var n=Ut.oUtils.parseXmlFromStr(t);var i=parseFloat(zt(n).find("xPoint").text());var r=parseFloat(zt(n).find("yPoint").text());var o=parseFloat(zt(n).find("zPoint").text());var s={xPoint:i,yPoint:r,zPoint:o};setTimeout(function(){e.resolve(s)},100);return e.promise()}},{key:"JS_FishEyeSetPreset",value:function Ye(e){var t=zt.Deferred();var n=this;var i='';i+=""+e.xPoint+"";i+=""+e.yPoint+"";i+=""+e.zPoint+"";i+="";var r=this.oPlugin.HWP_FECSetPreset(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FECSetPreset:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFECCruise",value:function Xe(e){var t=zt.Deferred();var n=this;var i='';zt.each(e,function(e,t){i+="";i+=""+t.xPoint+"";i+=""+t.yPoint+"";i+=""+t.zPoint+"";i+="";i+=""});i+="";var r=this.oPlugin.HWP_StartFECCruise(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFECCruise:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopFECCruise",value:function Ze(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFECCruise();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFECCruise:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetIsHttps",value:function Ke(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetIsHttps(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetIsHttps:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetReconnectInfo",value:function $e(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetReconnectInfo(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetReconnectInfo:"+e);n.reject(r)}else{n.resolve()}},100);return n.promise()}},{key:"JS_CheckUpdate",value:function Qe(e){var t=zt.Deferred();var n=this;try{var i=e.replace(/<\blocalServiceControl.*<\/localServiceControl\b>/,"");var r=this.oPlugin.HWP_CheckPluginUpdate(i);setTimeout(function(){t.resolve(r)},100)}catch(o){n.ConsoleLog("HWP_CheckPluginUpdate:"+o);t.reject(o)}return t.promise()}},{key:"JS_SelectShape",value:function et(e,t){var n=zt.Deferred();var i=0;if(e==="Rect"){i=0}else if(e==="Polygon"){i=1}else if(e==="Line"){i=2}else if(e==="All"){i=4;this.oPlugin.HWP_ClearDrawLineInfo(0)}var r=this.oPlugin.HWP_SelectDraw(0,i,t);setTimeout(function(){n.resolve(r)},100);return n.promise()}},{key:"JS_GetPictureSize",value:function tt(e){var t=zt.Deferred();var n=this.oPlugin.HWP_GetPictureSize(e);setTimeout(function(){t.resolve({width:parseInt(n.split("*")[0],10),height:parseInt(n.split("*")[1],10)})},100);return t.promise()}},{key:"JS_SetOriginResolution",value:function nt(e,t,n){var i=zt.Deferred();var r=this.oPlugin.HWP_setOriginResolution(e,t,n);setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_SetPlayWndMode",value:function it(e,t,n){var i=zt.Deferred();if(n){e=64}var r=this.oPlugin.HWP_setPlayWndMode(e,t);setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_UpdateWindowStyle",value:function rt(){var e=new Promise(function(e){e()});return e}},{key:"JS_CuttingPartWindow",value:function ot(){var e=new Promise(function(e){e()});return e}},{key:"JS_RepairPartWindow",value:function st(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetPointInfo",value:function at(e,t){var n='';var i="";t=t?t:0;i+=""+t+"";i+="1";var r=false;if(e){zt.each(e,function(){var e="";if(this.id>0){e+=""+this.id+""}if(this.drawColor){var t=Ut.oUtils.colorRgb(this.drawColor);e+="";e+=""+t[0]+"";e+=""+t[1]+"";e+=""+t[2]+"";e+=""}if(this.tips){e+=""+this.tips+""}if(this.editType||this.editType===0){e+=""+this.editType+""}if(this.lineType===2){r=true;n+="";n+=e+"2"+""+""+""+""+""+""+""+""+""+"true"+"1"+"1";if(this.points&&this.points.length>0){n+=""+this.points[0]+""+this.points[1]+""}n+=""+""}else{i+=""+e;if(this.type){i+=""+(this.type==="circle"?2:1)+""}if(this.points){i+="";i+=""+this.points[0]+"";i+=""+this.points[1]+"";i+=""}i+=""}})}i+="";n+="";var o=zt.Deferred();var s=void 0;if(r){s=this.oPlugin.HWP_SetSnapLineInfo(n)}else{s=this.oPlugin.HWP_SetSnapPointInfo(0,i)}setTimeout(function(){o.resolve(s)},100);return o.promise()}},{key:"JS_GetPointInfo",value:function ut(){var e=Ut.oUtils.parseXmlFromStr(this.oPlugin.HWP_GetSnapPointInfo(0));var t=Ut.oUtils.parseXmlFromStr(this.oPlugin.HWP_GetSnapLineInfo());var n=[];zt(e).find("SnapPoint").each(function(){n.push({id:parseInt(zt(this).find("id").text(),10),drawColor:"#"+Ut.oUtils.colorTransfer(zt(this).find("color r").text())+Ut.oUtils.colorTransfer(zt(this).find("color g").text())+Ut.oUtils.colorTransfer(zt(this).find("color b").text()),type:zt(this).find("type").text()==="2"?"circle":"cross",replace:parseInt(zt(e).find("mode").text(),10)===1,point:[parseFloat(zt(e).find("positionX").text()),parseFloat(zt(e).find("positionY").text())]})});zt(t).find("SnapLine").each(function(){if(zt(this).find("BreakLine point").length===1){n.push({id:parseInt(zt(this).find("id").text(),10),drawColor:"#"+Ut.oUtils.colorTransfer(zt(this).find("color r").text())+Ut.oUtils.colorTransfer(zt(this).find("color g").text())+Ut.oUtils.colorTransfer(zt(this).find("color b").text()),type:"cross",replace:false,point:[parseFloat(zt(this).find("BreakLine x").text()),parseFloat(zt(this).find("BreakLine y").text())]})}});var i=zt.Deferred();setTimeout(function(){i.resolve(n)},100);return i.promise()}},{key:"JS_PlayWithImg",value:function lt(){return Promise.resolve()}},{key:"JS_DestroyAll",value:function ft(){this.JS_DestroyPlugin();return Promise.resolve()}},{key:"JS_SetPackageType",value:function ct(e){this.oPlugin.HWP_SetPackageType(e);return Promise.resolve()}},{key:"JS_GetPlayInfo",value:function ht(e){var t=this.oPlugin.HWP_GetPictureSize(e);var n=t.split("*");var i={pictureSize:{width:parseInt(n[0],10),height:parseInt(n[1],10)}};return Promise.resolve(i)}},{key:"JS_SetZeroChanInfo",value:function dt(e,t,n){this.oPlugin.HWP_SetZeroChanInfo(e,t,n);return Promise.resolve()}},{key:"JS_SetSnapDrawWndIndex",value:function pt(e){this.oPlugin.HWP_SetSnapDrawWndIndex(e);return Promise.resolve()}},{key:"JS_SetWindowSelected",value:function vt(e){this.oPlugin.HWP_SetWindowSelected(e);return Promise.resolve()}},{key:"JS_GetEngineSupport",value:function mt(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetEngineSupport();var n=Ut.oUtils.parseXmlFromStr(t);var i={HardDecodeCap:{GPUType:zt(n).find("HardDecodeCap GPUType").eq(0).text(),D3D9Support:zt(n).find("HardDecodeCap D3D9Support").eq(0).text(),D3D11Support:zt(n).find("HardDecodeCap D3D11Support").eq(0).text()},RenderCap:{DDrawSupport:zt(n).find("RenderCap DDrawSupport").eq(0).text(),D3D9SurfaceSupport:zt(n).find("RenderCap D3D9SurfaceSupport").eq(0).text(),D3D9TextureSupport:zt(n).find("RenderCap D3D9TextureSupport").eq(0).text(),D3D11Support:zt(n).find("RenderCap D3D11Support").eq(0).text()}};setTimeout(function(){if(!i){e.reject()}else{e.resolve(i)}},100);return e.promise()}},{key:"JS_ExistGetSlfPointList",value:function yt(){var e=zt.Deferred();var t=typeof this.oPlugin.HWP_GetSlfPointList!=="undefined";setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_GetSlfPointList",value:function gt(e,t){var n=zt.Deferred();var i=this.oPlugin.HWP_GetSlfPointList(e,t);var r=Ut.oUtils.parseXmlFromStr(i);var o=[];zt(r).find("SLFPoint").each(function(){var e={x:zt(this).find("ImagePoint").eq(0).find("x").eq(0).text(),y:zt(this).find("ImagePoint").eq(0).find("y").eq(0).text(),p:zt(this).find("PTZValue").eq(0).find("p").eq(0).text(),t:zt(this).find("PTZValue").eq(0).find("t").eq(0).text(),z:zt(this).find("PTZValue").eq(0).find("z").eq(0).text()};o.push(e)});setTimeout(function(){n.resolve(o)},100);return n.promise()}},{key:"JS_GetSlfVersion",value:function Pt(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetSlfVersion();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_AudioPlay",value:function wt(e,t,n,i,r){var o=zt.Deferred();var s=this;var a=null;if(r){a=this.oPlugin.HWP_StartAudioPlayEx(e,t,n,i,r)}else{a=this.oPlugin.HWP_StartAudioPlay(e,t,n,i)}setTimeout(function(){if(a<0){a=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_StartAudioPlayEx:"+a);o.reject(a)}else{o.resolve()}},100);return o.promise()}},{key:"JS_StartSycAudioPlay",value:function St(e,t,n,i){var r=zt.Deferred();var o=this;var s=null;s=this.oPlugin.HWP_StartSycAudioPlay(n,e,t,i);setTimeout(function(){if(s<0){s=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_StartSycAudioPlay:"+s);r.reject(s)}else{r.resolve()}},100);return r.promise()}},{key:"JS_GetDownFilePath",value:function _t(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownLoadFilePath(e);console.log("JS_GetDownFilePath");console.log(i);setTimeout(function(){if(i){t.resolve(i)}else{i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownLoadFilePath:"+i);t.reject(i)}},100);return t.promise()}},{key:"JS_DeleteDownLoadFile",value:function bt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_DeleteDownLoadFile(e);setTimeout(function(){if(i){t.resolve(i)}else{i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_DeleteDownLoadFile:"+i);t.reject(i)}},100);return t.promise()}},{key:"JS_SycVideoAndAudio",value:function Ct(e,t,n){var i=zt.Deferred();var r=this;var o=zt(t).find("files").eq(0).text();var s=zt(n).find("files").eq(0).text();var a=""+e+"";a+=""+o+"";a+=""+s+"";a+="";var u=this.oPlugin.HWP_SycVideoAndAudio(a);setTimeout(function(){if(u){i.resolve(u)}else{u=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_SycVideoAndAudio:"+u);i.reject(u)}},100);return i.promise()}},{key:"JS_StopSycAudioPlay",value:function kt(e){var t=zt.Deferred();var n=this;var i=null;i=this.oPlugin.HWP_StopSycAudioPlay(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopSycAudioPlay:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetAudioPlayStatus",value:function Tt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetAudioPlayStatus(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetAudioPlayStatus:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopAudioPlay",value:function Rt(){var e=zt.Deferred();var t=this;var n=this.oPlugin.HWP_StopAudioPlay();setTimeout(function(){if(n<0){n=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopAudioPlay:"+n);e.reject(n)}else{e.resolve()}},100);return e.promise()}},{key:"JS_StartAudioSave",value:function Dt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StartAudioRecord(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartAudioRecord:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopAudioSave",value:function xt(){var e=zt.Deferred();var t=this;var n=this.oPlugin.HWP_StopAudioRecord();setTimeout(function(){if(n<0){n=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopAudioRecord:"+n);e.reject(n)}else{e.resolve()}},100);return e.promise()}},{key:"JS_GetAudioPlayedTime",value:function It(){var t=zt.Deferred();var n=-1;var i=this;n=this.oPlugin.HWP_GetAudioPlayedTime();setTimeout(function(){if(n<0||!n){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_GetAudioPlayedTime:"+e);t.reject()}else{t.resolve(n)}},100);return t.promise()}},{key:"JS_AudioPause",value:function Et(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_AudioPlayPasue();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_AudioPlayPasue:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_AudioResume",value:function qt(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_AudioPlayResume();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_AudioPlayPasue:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartAlarmChan",value:function At(e,t,n,i){return this.runPluginMethod("HWP_StartAlarmChan",[e,t,n],i)}},{key:"JS_StopAlarmChan",value:function Ot(e){return this.runPluginMethod("HWP_StopAlarmChan",[],e)}},{key:"JS_StartFormAsynUpload",value:function Mt(e,t){var n=typeof e==="undefined"?"undefined":Jt(e);var i="";if("object"===n){var r=new jt["default"].Builder;i=r.buildObject({UploadInfo:e})}else if("string"===n){i=e}else{return Promise.reject("")}return this.runPluginMethod("HWP_StartFormAsynUpload",[i],t)}},{key:"JS_StopFormAsynUpload",value:function Lt(e){return this.runPluginMethod("HWP_StopFormAsynUpload",[],e)}},{key:"JS_IsPluginExist",value:function Ft(){var e=false;var t=null;try{t=new ActiveXObject("WebVideoActiveX.WebVideoActiveXCtrl.1")}catch(n){t=null}if(null!==t){e=true}else{e=false}return e}},{key:"runPluginMethod",value:function Wt(e,t,n){var i=zt.Deferred();var r=this;var o={iRet:-1};var s=setTimeout(function(){i.reject(e+" time out ")},n);var a=void 0;Object.defineProperty(o,"iRet",{enumerable:true,configurable:true,set:function l(e){if(s){clearTimeout(s)}if(e<0){i.reject(e)}else{i.resolve(e)}a=e},get:function f(){return a}});try{if(this.oPlugin){switch(e){case"HWP_StartAlarmChan":o.iRet=this.oPlugin.HWP_StartAlarmChan(t[0],t[1],t[2]);break;case"HWP_StopAlarmChan":o.iRet=this.oPlugin.HWP_StopAlarmChan();break;case"HWP_StartFormAsynUpload":o.iRet=this.oPlugin.HWP_StartFormAsynUpload(t[0]);break;case"HWP_StopFormAsynUpload":o.iRet=this.oPlugin.HWP_StopFormAsynUpload();break;default:break}if(o.iRet<0){var u=r.oPlugin.HWP_GetLastError();r.ConsoleLog(e+":"+u)}}else{i.reject("without plugin")}}catch(c){r.ConsoleLog(e+":"+c);i.reject(c)}return i.promise()}},{key:"reactive",value:function Nt(e,t,n){var i=this;var r="__"+e+"Get";var o="__"+e+"Set";var s=void 0;Object.defineProperty(this,e,{get:function a(){zt(document.body).trigger(r,{value:s});if(t&&typeof t==="function"){return t.bind(i)(s)}return s},set:function u(e){zt(document.body).trigger(o,{oldValue:s,newValue:e});if(n&&typeof n==="function"){n.bind(i)(s,e)}else{s=e}}})}},{key:"JS_SetPicInfoToPlayer",value:function Bt(e,t,n,i){var r=zt.Deferred();var o=this.oPlugin.HWP_SetPicInfoToPlayer(e,t,n,i);var s=this;setTimeout(function(){if(o<0){o=s.oPlugin.HWP_GetLastError();r.reject(o)}else{r.resolve()}},100);return r.promise()}}]);return i}();return e}();i.ActiveXControl=n}).call(this,r(1))},function(e){e.exports=JSON.parse('{"version":"V1.0.0 build230210","playCrtl":"V7.4.0.1","pluginVersion":"V3.0.7.50","localServiceVersion":"V1.0.38"}')}])}); diff --git a/public/webVideoCtrl.js b/public/webVideoCtrl.js index 2cd188f6..97110eee 100644 --- a/public/webVideoCtrl.js +++ b/public/webVideoCtrl.js @@ -171,6 +171,7 @@ return oPromise }; var _initPlugin = function (szContainerID) { + let oPromise = new Promise(function (resolve, reject) { if (!m_utilsInc.isUndefined(szContainerID)) { m_options.szContainerID = szContainerID @@ -598,6 +599,7 @@ } ; this.I_Login = function (szIP, iProtocol, iPort, szUserName, szPassword, options) { + let oPromise = new Promise(function (resolve, reject) { var szDeviceIdentify = szIP + "_" + iPort; var iIndex = this.findDeviceIndexByIP(szDeviceIdentify); diff --git a/src/views/bigScreen/enpComponents/orgwryList.vue b/src/views/bigScreen/enpComponents/orgwryList.vue index b5e02dc9..fe0ed93d 100644 --- a/src/views/bigScreen/enpComponents/orgwryList.vue +++ b/src/views/bigScreen/enpComponents/orgwryList.vue @@ -223,10 +223,16 @@
    监控设备 -
    - - {{ eqk.name }} +
    + + {{ eqj.name }}
    + + +
    +
    +
    +
    @@ -348,8 +354,9 @@ export default { eqs: {},//生产设备 eqc: {},//监测设备 eqz: {},//治理设备 - eqk: {},//监控设备 + eqj: {},//监控设备 resizeTimeout:null, + } }, mounted() { @@ -382,6 +389,24 @@ export default { this.$emit('close') }, handleClick() { + //摄像头插件,再返回的时候,先执行了停止预览,再执行了退出 + //退出预览 + WebVideoCtrl.I_Stop({ + success: function () { + console.log("停止预览成功!"); + }, + error: function (oError) { + console.log("停止预览失败!") + } + }).then(()=>{ + //摄像头退出 + WebVideoCtrl.I_Logout(this.ip).then(() => { + console.log(this.ip + " " + "退出成功!"); + WebVideoCtrl.I_DestroyPlugin();//销毁监控插件 + }, () => { + console.log(this.ip + " " + "退出失败!"); + }); + }); this.pfkdetail = false; this.detailItem = {}; }, @@ -389,6 +414,7 @@ export default { this.pfkdetail = true; this.detailItem = row; this.$nextTick(() => { + this.init() this.getEquipments(row.equipments); }) @@ -404,7 +430,11 @@ export default { that.eqc = res; } else if (res.type == 30) { that.eqz = res; - } + }else if (res.type == 50) { //监控设备 + that.eqj = res; + this.ip = res.ip; + this.login(); +} })) }); const promise = Promise.all(reqs); @@ -492,12 +522,68 @@ export default { that.resizeChart("dataChart"); that.resizeChart("dataChart2"); that.resizeChart("dataChart3"); - }, 300); + }, 300); }, + //监控摄像头 + //初始化插件 + init() { + WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin"); + WebVideoCtrl.I_InitPlugin("divPlugin", "100%", "100%", { + iWndowType: 2, //分裂系数N*N + bWndFull: true, //双击全屏 + cbInitPluginCompleted: function () { + WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(() => { + // 检查插件是否最新 + WebVideoCtrl.I_CheckPluginVersion().then((bFlag) => { + if (bFlag) { + alert("检测到新的插件版本,双击开发包目录里的HCWebSDKPlugin.exe升级!"); + } + }); + }, () => { + alert("插件初始化失败,请确认是否已安装插件;如果未安装,请双击开发包目录里的HCWebSDKPlugin.exe安装!"); + }); + }, + }); + }, + + //摄像头登录 + login(){ + + WebVideoCtrl.I_Login( + this.eqj.ip, + 1, + this.eqj.port, + this.eqj.login_name, + this.eqj.login_pwd, + { + async: true, + cgi: 1, + success: (xmlDoc) => { + console.log("登录成功", xmlDoc); + //预览 + WebVideoCtrl.I_StartRealPlay(this.eqj.ip + "_" + this.eqj.port, { + success: () => { + console.log("预览成功"); + }, + }); + }, + error: (xmlDoc) => { + console.log("登录失败", xmlDoc); + }, + } + ); + } } } \ No newline at end of file + diff --git a/src/views/bigScreen/enpComponents/pollutant.vue b/src/views/bigScreen/enpComponents/pollutant.vue index 2c19a7fd..fe7b506c 100644 --- a/src/views/bigScreen/enpComponents/pollutant.vue +++ b/src/views/bigScreen/enpComponents/pollutant.vue @@ -329,12 +329,13 @@ export default { yAxis: {}, series: [{ type: 'line' }] }, + } }, - mounted() { - let that = this; - that.init(); - }, + + mounted() { + + }, methods: { initDom() { var chart1 = echarts.init(document.getElementById('dataChart'), 'dark'); @@ -359,12 +360,16 @@ export default { this.$refs.table.queryData(this.query); }, rowClick(row) { + this.pollutantDetail = true; this.detailItem = row; this.$nextTick(() => { + + this.init(); this.getEquipments(row.equipments); this.initTimeNow(); this.initDom(); + }) }, getEquipments(ids) { @@ -384,9 +389,11 @@ export default { that.getDetailData(3, id); } else if (res.type == 50) { //监控设备 - debugger; - this.login(res);//监控摄像头 + + that.eqj = res; + this.ip = res.ip; + this.login(); } }) }); @@ -444,55 +451,70 @@ export default { // } }) }, - handleClick() { - this.pollutantDetail = false; + handleClick() { + //摄像头插件,再返回的时候,先执行了停止预览,再执行了退出 + //退出预览 + WebVideoCtrl.I_Stop({ + success: function () { + console.log("停止预览成功!"); + }, + error: function (oError) { + console.log("停止预览失败!") + } + }).then(()=>{ + //摄像头退出 + WebVideoCtrl.I_Logout(this.ip).then(() => { + console.log(this.ip + " " + "退出成功!"); + WebVideoCtrl.I_DestroyPlugin();//销毁监控插件 + }, () => { + console.log(this.ip + " " + "退出失败!"); + }); + }); + this.pollutantDetail = false; this.detailItem = {}; + + + }, //监控摄像头 //初始化插件 init() { - WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin"); - //初始化 - alert(1) - WebVideoCtrl.I_InitPlugin("divPlugin", 200, 200, { + WebVideoCtrl.I_InitPlugin("divPlugin", "100%", "100%", { iWndowType: 2, //分裂系数N*N bWndFull: true, //双击全屏 cbInitPluginCompleted: function () { - alert(1) - WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(() => { + WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(() => { // 检查插件是否最新 WebVideoCtrl.I_CheckPluginVersion().then((bFlag) => { if (bFlag) { alert("检测到新的插件版本,双击开发包目录里的HCWebSDKPlugin.exe升级!"); } - }); - }, () => { - alert("插件初始化失败,请确认是否已安装插件;如果未安装,请双击开发包目录里的HCWebSDKPlugin.exe安装!"); }); - - }, - }); - - }, + }, () => { + alert("插件初始化失败,请确认是否已安装插件;如果未安装,请双击开发包目录里的HCWebSDKPlugin.exe安装!"); + }); + }, + }); + }, //摄像头登录 - login(jkdata){ + login(){ WebVideoCtrl.I_Login( - jkdata.ip, + this.eqj.ip, 1, - jkdata.port, - jkdata.login_name, - jkdata.login_pwd, + this.eqj.port, + this.eqj.login_name, + this.eqj.login_pwd, { async: true, cgi: 1, success: (xmlDoc) => { console.log("登录成功", xmlDoc); //预览 - WebVideoCtrl.I_StartRealPlay(szIp + "_" + ipPort, { + WebVideoCtrl.I_StartRealPlay(this.eqj.ip + "_" + this.eqj.port, { success: () => { console.log("预览成功"); }, @@ -503,8 +525,7 @@ export default { }, } ); - } - + } } } @@ -513,5 +534,6 @@ export default { width: 200px; height: 200px; /* background: #ffffff; */ + border: 2px solid rgba(237, 159, 23, 0.8); } diff --git a/src/views/bigScreen/enpComponents/video.vue b/src/views/bigScreen/enpComponents/video.vue index 88ce17b6..857124e0 100644 --- a/src/views/bigScreen/enpComponents/video.vue +++ b/src/views/bigScreen/enpComponents/video.vue @@ -1,26 +1,96 @@ @@ -53,19 +123,22 @@ export default { value: 4, label: '4x4' } - ] + ], + }; }, mounted() { let that = this; that.init(); + + }, methods: { //初始化插件 init() { // alert('init') WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin"); - WebVideoCtrl.I_InitPlugin("divPlugin", 600, 600, { + WebVideoCtrl.I_InitPlugin("divPlugin", "100%", "100%", { iWndowType: 2, //分裂系数N*N bWndFull: true, //双击全屏 cbInitPluginCompleted: function () { @@ -82,6 +155,7 @@ export default { }); }, }); + }, //登录 Login() { @@ -95,10 +169,26 @@ export default { async: true, cgi: 1, success: (xmlDoc) => { - console.log("登录成功", xmlDoc); + + + //TODO 获取通道信息 + this.getChannelInfo(); + + + this.$message({ + showClose: true, + message: '登录成功!', + type: 'success' + }); + }, error: (xmlDoc) => { - console.log("登录失败", xmlDoc); + this.$message({ + showClose: true, + message: '登录失败!', + type: 'error' + }); + }, } ); @@ -107,8 +197,20 @@ export default { vShow() { WebVideoCtrl.I_StartRealPlay(this.szIp + "_" + this.ipPort, { success: () => { - console.log("预览成功"); - }, + this.$message({ + showClose: true, + message: '预览成功!', + type: 'success' + }); + + },error: () => { + this.$message({ + showClose: true, + message: '预览失败!', + type: 'error' + }); + + }, }); @@ -122,10 +224,19 @@ export default { if (oWndInfo != null) { WebVideoCtrl.I_Stop({ success: function () { - console.log("停止预览成功!") + this.$message({ + showClose: true, + message: '停止预览成功!', + type: 'success' + }); + }, error: function (oError) { - console.log("停止预览失败!") + this.$message({ + showClose: true, + message: '停止预览失败!', + type: 'error' + }); } }); } @@ -137,6 +248,7 @@ export default { }, //登出 logOut() { + //WebVideoCtrl.I_Logout(this.szIp + "_" + this.ipPort, {}); var szDeviceIdentify =this.szIp; @@ -144,14 +256,35 @@ export default { return; } WebVideoCtrl.I_Logout(szDeviceIdentify).then(() => { - console.log(szDeviceIdentify + " " + "退出成功!"); + this.$message({ + showClose: true, + message: '退出成功!', + type: 'success' + }); }, () => { - console.log(szDeviceIdentify + " " + "退出失败!"); + this.$message({ + showClose: true, + message: '退出成功!', + type: 'error' + }); }); }, //销毁插件 breakdom() { - WebVideoCtrl.I_DestroyPlugin(); + + WebVideoCtrl.I_DestroyPlugin().then(() => { + this.$message({ + showClose: true, + message: '插件已销毁!', + type: 'success' + }); + }, () => { + this.$message({ + showClose: true, + message: '插件销毁失败!', + type: 'error' + }); + }); }, // 窗口分割数 @@ -173,14 +306,103 @@ export default { console.log(szInfo, oError.errorCode, oError.errorMsg); }); } - } + }, + // 打开声音 + clickOpenSound() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(0), + szInfo = ""; + if (oWndInfo != null) { + var allWndInfo = WebVideoCtrl.I_GetWindowStatus(); + // 循环遍历所有窗口,如果有窗口打开了声音,先关闭 + for (var i = 0, iLen = allWndInfo.length; i < iLen; i++) { + oWndInfo = allWndInfo[i]; + if (oWndInfo.bSound) { + WebVideoCtrl.I_CloseSound(oWndInfo.iIndex); + break; + } + } + WebVideoCtrl.I_OpenSound().then(() => { + console.log(oWndInfo.szDeviceIdentify + " " + "打开声音成功!"); + }, (oError) => { + var szInfo = " 打开声音失败!"; + console.log(oWndInfo.szDeviceIdentify + szInfo, oError.errorCode, oError.errorMsg); + }); + } + }, + // 关闭声音 + clickCloseSound() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(0), + szInfo = ""; + if (oWndInfo != null) { + WebVideoCtrl.I_CloseSound().then(() => { + console.log(oWndInfo.szDeviceIdentify + " " + "关闭声音成功!"); + }, (oError) => { + var szInfo = " 关闭声音失败!"; + console.log(oWndInfo.szDeviceIdentify + szInfo, oError.errorCode, oError.errorMsg); + }); + } + }, + + + + }, };